All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ICARUS/CRT/CRTData.hh
Go to the documentation of this file.
1 #ifndef ICCRTData_hh_
2 #define ICCRTData_hh_
3 
4 #include <cstdint>
5 
6 /// icarus::crt::CRTData flag mnemonics
7 namespace icarus::crt::CRTDataFlags {
8  static constexpr uint32_t TS0Present = 0x0001; ///< TS0 counter was restarted in time
9  static constexpr uint32_t TS1Present = 0x0002; ///< TS1 counter was restarted in time
10  static constexpr uint32_t TS0Reference = 0x0004; ///< This hit is a T0 reference signal
11  static constexpr uint32_t TS1Reference = 0x0008; ///< This hit is a T1 reference signal
12 }
13 
14 namespace icarus::crt {
15  /**
16  * @brief Single hit (self trigger) of a CRT board
17  *
18  * The structure contains data related to a single
19  * (self-triggered) hit in CRT FEB. The MAC address
20  * corresponds to a Monte Carlo mapping of FEBs.
21  * All timestamps are absolute Unix timestamps
22  * with 1 ns step.
23  *
24  */
25 
26  struct CRTData {
27 
28  uint8_t fMac5 { 0 }; ///< FEB address following numbering convention common for both data and MC.
29  uint32_t fEntry; ///< Hit index for given FEB in an event (starts from 0 for each event).
30  uint64_t fTs0 { 0 }; ///< Absolute hit timestamp [ns]
31  uint64_t fTs1 { 0 }; ///< Trigger time, not well defined as of Apr 14, 2021.
32  uint16_t fAdc[64] {}; ///< ADC readout for each channel. CAEN (Bern) CRT FEBs use only indices 0-31.
33 
34  uint32_t fFlags { 0 }; ///< DAQ uses 8 bits, remaining bits reserved for future use
35  uint64_t fThisPollStart { 0 }; ///< Absolute timestamp [ns] of the start of the data transfer from FEB
36  uint64_t fLastPollStart { 0 }; ///< Absolute timestamp [ns] of the start of the previous data transfer from FEB
37  uint32_t fHitsInPoll { 0 }; ///< Total number of hits in the data transfer (including hits omitted by FEB)
38 
39  uint32_t fCoinc { 0 }; ///< Top CRT coincidence bit map
40 
41  uint64_t fLastAcceptedTimestamp { 0 }; ///< Timestamp of the previous measured hit
42  uint16_t fLostHits { 0 }; ///< Number of hits omitted by FEB since the previous measured hit
43 
44 
45  bool IsOverflow_TS0() const { return !(fFlags & CRTDataFlags::TS0Present); }
46  bool IsOverflow_TS1() const { return !(fFlags & CRTDataFlags::TS1Present); }
49 
50  };
51 
52 } // namespace icarus::crt
53 
54 
55 #endif
uint8_t fMac5
FEB address following numbering convention common for both data and MC.
bool IsOverflow_TS1() const
uint16_t fLostHits
Number of hits omitted by FEB since the previous measured hit.
bool IsOverflow_TS0() const
uint32_t fEntry
Hit index for given FEB in an event (starts from 0 for each event).
static constexpr uint32_t TS1Reference
This hit is a T1 reference signal.
uint64_t fThisPollStart
Absolute timestamp [ns] of the start of the data transfer from FEB.
bool IsReference_TS0() const
static constexpr uint32_t TS1Present
TS1 counter was restarted in time.
uint64_t fLastAcceptedTimestamp
Timestamp of the previous measured hit.
Single hit (self trigger) of a CRT board.
uint32_t fHitsInPoll
Total number of hits in the data transfer (including hits omitted by FEB)
static constexpr uint32_t TS0Reference
This hit is a T0 reference signal.
static constexpr uint32_t TS0Present
TS0 counter was restarted in time.
uint16_t fAdc[64]
ADC readout for each channel. CAEN (Bern) CRT FEBs use only indices 0-31.
uint64_t fLastPollStart
Absolute timestamp [ns] of the start of the previous data transfer from FEB.
uint32_t fCoinc
Top CRT coincidence bit map.
bool IsReference_TS1() const
uint32_t fFlags
DAQ uses 8 bits, remaining bits reserved for future use.
process_name crt
uint64_t fTs0
Absolute hit timestamp [ns].
uint64_t fTs1
Trigger time, not well defined as of Apr 14, 2021.