All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FEBData.hh
Go to the documentation of this file.
1 /**
2  * \brief Dataproduct to store raw FEB data from the CRT
3  *
4  * \author Marco Del Tutto
5  */
6 
7 #ifndef SBND_FEBDATA_HH
8 #define SBND_FEBDATA_HH
9 
10 #include <stdint.h>
11 #include <vector>
12 #include <utility>
13 #include <array>
14 
15 constexpr int N_CH = 32;
16 
17 typedef std::array<uint16_t, N_CH> adc_array_t;
18 
19 namespace sbnd::crt {
20 
21  class FEBData {
22 
23  uint16_t fMac5; ///< ID of the FEB
24  uint32_t fTs0; ///< T0 counter
25  uint32_t fTs1; ///< T1 counter
26  adc_array_t fADC; ///< 32 ADC values, one per SiPM
27  uint32_t fCoinc; ///< ID of SiPM that fired the trigger
28 
29  public:
30 
31  /**
32  * Default constructor.
33  */
34  FEBData();
35 
36  /**
37  * Returns the ID of the CRT module.
38  *
39  * @param mac5 The ID of the CRT module (FEB).
40  * @param ts0 The value of the t0 counter.
41  * @param ts1 The value of the t1 counter.
42  * @param ADC The 32-size array with ADC values.
43  * @param coinc The ID of the strip that fired the trigger.
44  */
45  FEBData(uint16_t mac5, uint32_t ts0, uint32_t ts1, adc_array_t ADC, uint32_t coinc);
46 
47  virtual ~FEBData();
48 
49  /**
50  * Returns the ID of the CRT module.
51  *
52  * @return The MAC5 ID of this FEB data.
53  */
54  uint16_t Mac5() const;
55 
56  /**
57  * Returns the T0 time from the T0 counter.
58  *
59  * @return The Ts0 of this FEB data.
60  */
61  uint32_t Ts0() const;
62 
63  /**
64  * Returns the T1 time from the T1 counter.
65  *
66  * @return The Ts1 of this FEB data.
67  */
68  uint32_t Ts1() const;
69 
70  /**
71  * Returns the array of ACD counts from the FEB board.
72  * 32 values are returned, one for each of the 32 SiPMs
73  * in one CRT module.
74  *
75  * @return The ADC array of size 32 of this FEB data.
76  */
77  adc_array_t ADC() const;
78 
79  /**
80  * Returns the ACD counts from a certain sipm in the FEB board.
81  *
82  * @param sipmID The index of the sipm (0-31)
83  *
84  * @return The ADC value for that sipm.
85  */
86  uint16_t ADC(size_t sipmID) const;
87 
88  /**
89  * Returns the ID of the sipm that fired the trigger.
90  *
91  * @return The Coinc variable of this FEB data.
92  */
93  uint32_t Coinc() const;
94 
95  /**
96  * Setter method for Mac5
97  *
98  * @param mac5 The mac5 to set.
99  */
100  void SetMac5(uint16_t mac5);
101 
102  /**
103  * Setter method for Ts0
104  *
105  * @param ts0 The ts0 value to set
106  */
107  void SetTs0(uint32_t ts0);
108 
109  /**
110  * Setter method for Ts1
111  *
112  * @param ts1 The ts1 value to set
113  */
114  void SetTs1(uint32_t ts1);
115 
116  /**
117  * Adds ADC values on a certain sipm.
118  *
119  * @param sipmID The ID of the sipm in the module (0-31).
120  * @param adc The ADC value for this sipm.
121  */
122  void SetADC(size_t sipmID, uint16_t adc);
123 
124  /**
125  * Setter method for coinc
126  *
127  * @param coinc The coinc values to set
128  */
129  void SetCoinc(uint32_t coinc);
130  };
131 
132 } // namespace sbnd::crt
133 
134 #endif
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
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