Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions sbnanaobj/StandardRecord/SRSBNDFrameShiftInfo.h
Original file line number Diff line number Diff line change
@@ -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 <cstdint>
#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<uint16_t>::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
//////////////////////////////////////////////////////////////////////////////
40 changes: 40 additions & 0 deletions sbnanaobj/StandardRecord/SRSBNDTimingInfo.h
Original file line number Diff line number Diff line change
@@ -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 <stdint.h>

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<uint64_t>::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
//////////////////////////////////////////////////////////////////////////////
5 changes: 4 additions & 1 deletion sbnanaobj/StandardRecord/StandardRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -54,10 +56,11 @@ namespace caf
std::vector<SRSBNDCRTTrack> sbnd_crt_tracks; ///< CRT tracks in event (SBND)
int nopflashes; ///< Number of OpFlashes in spill
std::vector<SROpFlash> opflashes; ///< List of OpFlashes in spill

int ncrtpmt_matches; ///<Number of CRT-PMT Matches in event
std::vector<SRCRTPMTMatch> 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)

};

Expand Down
10 changes: 9 additions & 1 deletion sbnanaobj/StandardRecord/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<!-- art::Wrappers for these products are defined in CAFMaker -->

<lcgdict>
<class name="caf::StandardRecord" ClassVersion="13">
<class name="caf::StandardRecord" ClassVersion="14">
<version ClassVersion="14" checksum="1860171062"/>
<version ClassVersion="13" checksum="1979816256"/>
<version ClassVersion="12" checksum="3984422068"/>
<version ClassVersion="11" checksum="483883398"/>
Expand Down Expand Up @@ -407,6 +408,13 @@
<class name="std::vector<caf::SRCRTSpacePoint>" />
<class name="std::vector<caf::SRSBNDCRTTrack>" />

<class name="caf::SRSBNDFrameShiftInfo" ClassVersion="10">
<version ClassVersion="10" checksum="2564414428"/>
</class>
<class name="caf::SRSBNDTimingInfo" ClassVersion="10">
<version ClassVersion="10" checksum="4144120809"/>
</class>

<enum name="caf::Det_t" ClassVersion="10"/>
<enum name="caf::Plane_t" ClassVersion="10"/>
<enum name="caf::Wall_t" ClassVersion="10"/>
Expand Down