LDMX Software
EcalDigiCollection.h
Go to the documentation of this file.
1
9#ifndef EVENT_ECALDIGICOLLECTION_H_
10#define EVENT_ECALDIGICOLLECTION_H_
11
12// ROOT
13#include "TObject.h" //for ClassDef
14
15// STL
16#include <stdint.h> //32bit words
17
18#include <iostream> //Print method
19#include <vector> //vector lists
20
21namespace ldmx {
22
31 int rawID_{-1};
32
34 int adc_t_{0};
35
37 int adc_tm1_{0};
38
40 int tot_{0};
41
43 int toa_{0};
44};
45
59 public:
64
69
76 void Clear();
77
84 void Print() const;
85
89 unsigned int getNumSamplesPerDigi() const { return numSamplesPerDigi_; }
90
94 void setNumSamplesPerDigi(unsigned int n) {
96 return;
97 }
98
102 unsigned int getSampleOfInterestIndex() const { return sampleOfInterest_; }
103
107 void setSampleOfInterestIndex(unsigned int n) {
109 return;
110 }
111
115 std::vector<EcalDigiSample> getDigi(unsigned int digiIndex) const;
116
120 unsigned int getNumDigis() const { return channelIDs_.size(); }
121
125 void addDigi(std::vector<EcalDigiSample> newSamples);
126
127 private:
129 static const int ONE_BIT_MASK = 1;
130
132 static const int TEN_BIT_MASK = (1 << 10) - 1;
133
135 static const int FIRSTFLAG_POS = 31;
136
138 static const int SECONFLAG_POS = 30;
139
141 static const int FIRSTMEAS_POS = 20;
142
144 static const int SECONMEAS_POS = 10;
145
146 private:
148 std::vector<int> channelIDs_;
149
151 std::vector<int32_t> samples_;
152
154 unsigned int numSamplesPerDigi_{1};
155
157 unsigned int sampleOfInterest_{0};
158
163};
164} // namespace ldmx
165
166#endif /* EVENT_ECALDIGI_H_ */
Represents a collection of the ECal digi hits.
std::vector< EcalDigiSample > getDigi(unsigned int digiIndex) const
Get samples for the input digi index.
void addDigi(std::vector< EcalDigiSample > newSamples)
Translate and add samples to collection.
unsigned int sampleOfInterest_
index for the sample of interest in the samples list
std::vector< int > channelIDs_
list of channel IDs that we have digis for
ClassDef(EcalDigiCollection, 1)
The ROOT class definition.
virtual ~EcalDigiCollection()
Class destructor.
std::vector< int32_t > samples_
list of samples that we have been given
EcalDigiCollection()
Class constructor.
static const int SECONFLAG_POS
Bit position of second flag.
static const int TEN_BIT_MASK
Mask for lowest order ten bits in an int.
void setSampleOfInterestIndex(unsigned int n)
Set index of sample of interest.
static const int ONE_BIT_MASK
Mask for lowest order bit in an int.
static const int FIRSTFLAG_POS
Bit position of first flag.
unsigned int numSamplesPerDigi_
number of samples for each digi
unsigned int getSampleOfInterestIndex() const
Get index of sample of interest.
static const int SECONMEAS_POS
Bit position of second measurement.
static const int FIRSTMEAS_POS
Bit position of first measurement.
void Print() const
Print out the object.
unsigned int getNumDigis() const
Get total number of digis.
void Clear()
Clear the data in the object.
unsigned int getNumSamplesPerDigi() const
Get number of samples per digi.
void setNumSamplesPerDigi(unsigned int n)
Set number of samples for each digi.
One sample of an Ecal digi channel.
int adc_tm1_
ADC counts in this channel at the previous time.
int toa_
Time counts when signal arrived in this channel.
int adc_t_
ADC counts in this channel at this time.
int rawID_
Raw integer ID of channel this sample is for.
int tot_
Time counts over threshhold in this channel.