diff --git a/sbnanaobj/StandardRecord/SRSBNDFrameShiftInfo.h b/sbnanaobj/StandardRecord/SRSBNDFrameShiftInfo.h new file mode 100644 index 00000000..72d0797f --- /dev/null +++ b/sbnanaobj/StandardRecord/SRSBNDFrameShiftInfo.h @@ -0,0 +1,38 @@ +/** + * @file /sbnanaobj/StandardRecord/SRSBNDFrameShiftInfo.h + * @brief Defines CAF data structures to store sbnd::timing::FrameShiftInfo (docdb#43090). + * @author Vu Chi Lan Nguyen + * @date August 29, 2025 + * + */ + +#ifndef SRSBNDFRAMESHIFTINFO_H +#define SRSBNDFRAMESHIFTINFO_H + +#include +#include "sbnanaobj/StandardRecord/SRConstants.h" + +namespace caf +{ + /** + * @brief A struct to store shifts across different reference frames from sbnd::timing::FrameShiftInfo for SBND Data + * + * Each shift is in [ns] + * + * For more information, see + * [SBN DocDB 43090](https://sbn-docdb.fnal.gov/cgi-bin/sso/ShowDocument?docid=43090). + */ + + struct SRSBNDFrameShiftInfo { + static constexpr uint16_t NoType = std::numeric_limits::max(); + uint16_t timingType = NoType; ///< Types of decoded frames: 0 - SPEC TDC ETRIG, 1 - HLT ETRIG, 2 - Do Nothing + double frameTdcCrtt1 = kSignalingNaN; ///< Shift from decoded frame to SPEC-TDC CRT T1 [ns] + double frameTdcBes = kSignalingNaN; ///< Shift from decoded frame to SPEC-TDC BES [ns] + double frameTdcRwm = kSignalingNaN; ///< Shift from decoded frame to SPEC-TDC RWM [ns] + double frameHltCrtt1 = kSignalingNaN; ///< Shift from decoded frame to HLT CRT T1 [ns] + double frameHltBeamGate = kSignalingNaN; ///< Shift from decoded frame to HLT Beam Gate [ns] + double frameApplyAtCaf = kSignalingNaN; ///< Frame to shift to when running at CAF stage + }; +} // end namespace +#endif // SRSBNDFRAMESHIFTINFO_H +////////////////////////////////////////////////////////////////////////////// diff --git a/sbnanaobj/StandardRecord/SRSBNDTimingInfo.h b/sbnanaobj/StandardRecord/SRSBNDTimingInfo.h new file mode 100644 index 00000000..e6005d4e --- /dev/null +++ b/sbnanaobj/StandardRecord/SRSBNDTimingInfo.h @@ -0,0 +1,40 @@ +/** + * @file /sbnanaobj/StandardRecord/SRSBNDTimingInfo.h + * @brief Defines CAF data structures to store sbnd::timing::TimingInfo (docdb#43090). + * @author Vu Chi Lan Nguyen + * @date August 29, 2025 + * + */ + +#ifndef SRSBNDTIMINGINFO_H +#define SRSBNDTIMINGINFO_H + +#include + +namespace caf +{ + /** + * @brief A struct to store important timestamps from sbnd::timing::TimingInfo for SBND data + * + * Each timestamp is in UNIX Timestamp Format [ns] + * + * For more information, see + * [SBN DocDB 43090](https://sbn-docdb.fnal.gov/cgi-bin/sso/ShowDocument?docid=43090). + */ + + struct SRSBNDTimingInfo + { + static constexpr uint64_t NoTimestamp = std::numeric_limits::max(); + + uint64_t rawDAQHeaderTimestamp = NoTimestamp; ///< Timestamp when the event is built by the event builder at DAQ-level + uint64_t tdcCrtt1 = NoTimestamp; ///< Timestamp of BNB stream CRT T1 Reset recorded by the SPEC-TDC + uint64_t tdcBes = NoTimestamp; ///< Timestamp of BES signal sent by MFTU recorded by the SPEC-TDC + uint64_t tdcRwm = NoTimestamp; ///< Timestamp of RWM signal recorded by the SPEC-TDC + uint64_t tdcEtrig = NoTimestamp; ///< Timestamp of Event Trigger (ETRIG) sent by the PTB recorded by the SPEC-TDC + uint64_t hltCrtt1 = NoTimestamp; ///< Timestamp of BNB and Offbeam stream CRT T1 Reset High Level Trigger (HLT) created by the PTB + uint64_t hltEtrig = NoTimestamp; ///< Timestamp of ETRIG HLT created by the PTB + uint64_t hltBeamGate = NoTimestamp; ///< Timestamp of Beam Gate Acceptance HLT created by the PTB + }; +} // end namespace +#endif // SRSBNDTIMINGINFO_H +////////////////////////////////////////////////////////////////////////////// diff --git a/sbnanaobj/StandardRecord/StandardRecord.h b/sbnanaobj/StandardRecord/StandardRecord.h index c08f6d6b..676fcf67 100644 --- a/sbnanaobj/StandardRecord/StandardRecord.h +++ b/sbnanaobj/StandardRecord/StandardRecord.h @@ -11,6 +11,8 @@ #include "sbnanaobj/StandardRecord/SRCRTTrack.h" #include "sbnanaobj/StandardRecord/SRCRTSpacePoint.h" #include "sbnanaobj/StandardRecord/SRSBNDCRTTrack.h" +#include "sbnanaobj/StandardRecord/SRSBNDFrameShiftInfo.h" +#include "sbnanaobj/StandardRecord/SRSBNDTimingInfo.h" #include "sbnanaobj/StandardRecord/SRHeader.h" #include "sbnanaobj/StandardRecord/SRCRTPMTMatch.h" #include "sbnanaobj/StandardRecord/SRSlice.h" @@ -54,10 +56,11 @@ namespace caf std::vector sbnd_crt_tracks; ///< CRT tracks in event (SBND) int nopflashes; ///< Number of OpFlashes in spill std::vector opflashes; ///< List of OpFlashes in spill - int ncrtpmt_matches; /// crtpmt_matches; ///< CRT-PMT matches in event bool pass_flashtrig; ///< Whether this Record passed the Flash Trigger requirement + SRSBNDFrameShiftInfo sbnd_frames; ///< List of Frame Shift in event in unit [ns] (SBND) + SRSBNDTimingInfo sbnd_timings; ///< List of Timing Info in event in UNIX timestamp format(SBND) }; diff --git a/sbnanaobj/StandardRecord/classes_def.xml b/sbnanaobj/StandardRecord/classes_def.xml index d736e7a6..f9a9a75f 100644 --- a/sbnanaobj/StandardRecord/classes_def.xml +++ b/sbnanaobj/StandardRecord/classes_def.xml @@ -5,7 +5,8 @@ - + + @@ -407,6 +408,13 @@ + + + + + + +