All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FEBData.cxx
Go to the documentation of this file.
1 #ifndef SBND_FEBDATA_CXX
2 #define SBND_FEBDATA_CXX
3 
4 #include "cetlib_except/exception.h"
5 
7 
8 namespace sbnd{
9 namespace crt{
10 
12  fMac5(0)
13  , fTs0(0)
14  , fTs1(0)
15  , fADC()
16  , fCoinc(0)
17  {}
18 
19  FEBData::FEBData(uint16_t mac5, uint32_t ts0, uint32_t ts1, adc_array_t ADC, uint32_t coinc):
20  fMac5(mac5)
21  , fTs0(ts0)
22  , fTs1(ts1)
23  , fADC(ADC)
24  , fCoinc(coinc)
25  {}
26 
28 
29  uint16_t FEBData::Mac5() const
30  {
31  return fMac5;
32  }
33 
34  uint32_t FEBData::Ts0() const
35  {
36  return fTs0;
37  }
38 
39  uint32_t FEBData::Ts1() const
40  {
41  return fTs1;
42  }
43 
45  {
46  return fADC;
47  }
48 
49  uint16_t FEBData::ADC(size_t sipmID) const
50  {
51  if (sipmID >= N_CH) {
52  throw cet::exception("sbnd::crt::FEBData") << "sipmID is out of limits.\n";
53  }
54 
55  return fADC[sipmID];
56  }
57 
58  uint32_t FEBData::Coinc() const
59  {
60  return fCoinc;
61  }
62 
63  void FEBData::SetMac5(uint16_t mac5)
64  {
65  fMac5 = mac5;
66  }
67 
68  void FEBData::SetTs0(uint32_t ts0)
69  {
70  fTs0 = ts0;
71  }
72 
73  void FEBData::SetTs1(uint32_t ts1)
74  {
75  fTs1 = ts1;
76  }
77 
78  void FEBData::SetADC(size_t sipmID, uint16_t adc)
79  {
80  if (sipmID >= N_CH) {
81  throw cet::exception("sbnd::crt::FEBData") << "sipmID is out of limits.\n";
82  }
83 
84  fADC[sipmID] = adc;
85  }
86 
87  void FEBData::SetCoinc(uint32_t coinc)
88  {
89  fCoinc = coinc;
90  }
91 
92 } // namespace crt
93 } // namespace sbnd
94 
95 #endif
96 
uint16_t fMac5
ID of the FEB.
Definition: FEBData.hh:23
void SetCoinc(uint32_t coinc)
Definition: FEBData.cxx:87
uint32_t fTs1
T1 counter.
Definition: FEBData.hh:25
void SetTs1(uint32_t ts1)
Definition: FEBData.cxx:73
void SetTs0(uint32_t ts0)
Definition: FEBData.cxx:68
virtual ~FEBData()
Definition: FEBData.cxx:27
uint32_t fTs0
T0 counter.
Definition: FEBData.hh:24
void SetMac5(uint16_t mac5)
Definition: FEBData.cxx:63
adc_array_t ADC() const
Definition: FEBData.cxx:44
void SetADC(size_t sipmID, uint16_t adc)
Definition: FEBData.cxx:78
uint32_t Coinc() const
Definition: FEBData.cxx:58
uint32_t Ts0() const
Definition: FEBData.cxx:34
std::array< uint16_t, N_CH > adc_array_t
Definition: FEBData.hh:17
uint32_t fCoinc
ID of SiPM that fired the trigger.
Definition: FEBData.hh:27
uint16_t Mac5() const
Definition: FEBData.cxx:29
constexpr int N_CH
Dataproduct to store raw FEB data from the CRT.
Definition: FEBData.hh:15
stream1 can override from command line with o or output services user sbnd
adc_array_t fADC
32 ADC values, one per SiPM
Definition: FEBData.hh:26
process_name crt
uint32_t Ts1() const
Definition: FEBData.cxx:39