The DATCONSVDDigit class.
More...
#include <DATCONSVDDigit.h>
|
static const std::size_t | c_nAPVSamples = 6 |
| Number of APV samples stored.
|
|
The DATCONSVDDigit class.
This class is a simplified version of the SVDShaperDigit class. It is used for the DATCON simulation, as DATCON has less information of the SVD hits available compared to the usual SVDShaperDigits. The DATCONSVDDigit holds a set of 6 raw APV25 signal samples taken on a strip.
Definition at line 30 of file DATCONSVDDigit.h.
◆ APVFloatSamples
Types for array of samples for processing.
Definition at line 45 of file DATCONSVDDigit.h.
◆ APVFloatSampleType
◆ APVRawSamples
Type for array of samples received from DAQ.
Definition at line 40 of file DATCONSVDDigit.h.
◆ APVRawSampleType
◆ DATCONSVDDigit() [1/2]
Constructor using c-array of samples.
- Parameters
-
sensorID | Sensor VXD ID. |
isU | True if u strip, false if v. |
cellID | Strip ID. |
samples | std::array of 6 APV raw samples. |
Definition at line 53 of file DATCONSVDDigit.h.
53 :
54 m_sensorID(sensorID), m_isU(isU), m_cellID(cellID), m_totalCharge(0), m_maxSampleIndex(0)
55 {
56 std::transform(samples, samples + c_nAPVSamples, m_samples.begin(),
57 [](APVFloatSampleType x)->APVRawSampleType { return trimToSampleRange(x); });
58 }
◆ DATCONSVDDigit() [2/2]
Constructor using a stl container of samples.
- Parameters
-
sensorID | Sensor VXD ID. |
isU | True if u strip, false if v. |
cellID | Strip ID. |
samples | std::array of 6 APV raw samples. |
Definition at line 66 of file DATCONSVDDigit.h.
66 :
67 m_sensorID(sensorID), m_isU(isU), m_cellID(cellID), m_totalCharge(0), m_maxSampleIndex(0)
68 {
69 std::transform(samples.begin(), samples.end(), m_samples.begin(),
70 [](typename APVFloatSamples::value_type x)->APVRawSampleType { return trimToSampleRange(x); });
71 }
◆ getCellID()
short int getCellID |
( |
| ) |
const |
|
inline |
◆ getFloatSamples()
Get float-array of 6 APV25 samples.
Definition at line 86 of file DATCONSVDDigit.h.
87 {
88 APVFloatSamples returnSamples;
89 std::transform(m_samples.begin(), m_samples.end(), returnSamples.begin(),
90 [](APVRawSampleType x) { return static_cast<APVFloatSampleType>(x); });
91 return returnSamples;
92 }
◆ getMaxSampleCharge()
unsigned short getMaxSampleCharge |
( |
| ) |
const |
|
inline |
Getter for the charge of the biggest sample of the array in ADUs.
Definition at line 115 of file DATCONSVDDigit.h.
116 {
117 unsigned short maxCharge = 0;
118 for (unsigned int i = 0; i < c_nAPVSamples; i++) {
119 if (m_samples[i] > maxCharge) {
120 maxCharge = m_samples[i];
121 }
122 }
123 return maxCharge;
124 }
◆ getMaxSampleIndex()
unsigned short getMaxSampleIndex |
( |
| ) |
|
|
inline |
Getter for the index of the biggest sample inside the cluster (0...6)
Definition at line 127 of file DATCONSVDDigit.h.
128 {
129 if (m_maxSampleIndex > 0)
130 return m_maxSampleIndex;
131 else {
132 unsigned short maxCharge = 0;
133 for (unsigned int i = 0; i < c_nAPVSamples; i++) {
134 if (m_samples[i] > maxCharge) {
135 maxCharge = m_samples[i];
136 m_maxSampleIndex = i;
137 }
138 }
139 }
140 return m_maxSampleIndex;
141 }
◆ getRawSamples()
Get int-array of of 6 APV25 samples.
Definition at line 95 of file DATCONSVDDigit.h.
96 {
97 return m_samples;
98 }
◆ getRawSensorID()
◆ getSensorID()
VxdID getSensorID |
( |
| ) |
const |
|
inline |
◆ getTotalCharge()
unsigned short getTotalCharge |
( |
| ) |
|
|
inline |
Getter for the total charge of the array in ADUs.
Definition at line 101 of file DATCONSVDDigit.h.
102 {
103 if (m_totalCharge > 0)
104 return m_totalCharge;
105 else {
106 m_totalCharge = 0;
107 for (unsigned int i = 0; i < c_nAPVSamples; i++) {
108 m_totalCharge += m_samples[i];
109 }
110 }
111 return m_totalCharge;
112 }
◆ isUStrip()
◆ setAPVRawSamples()
Setter for the raw samples array.
Definition at line 169 of file DATCONSVDDigit.h.
170 {
171
172 std::transform(apvInputSamples.begin(), apvInputSamples.end(), m_samples.begin(),
173 [](APVFloatSampleType x) { return static_cast<APVRawSampleType>(x); });
174 }
◆ setCellID()
void setCellID |
( |
short | cellID | ) |
|
|
inline |
Setter for the stripID / cellID.
Definition at line 166 of file DATCONSVDDigit.h.
166{ m_cellID = cellID; }
◆ setSensorID()
void setSensorID |
( |
VxdID | sensorid | ) |
|
|
inline |
Setter for the sensorID.
Definition at line 160 of file DATCONSVDDigit.h.
160{ m_sensorID = sensorid; }
◆ setUStrip()
void setUStrip |
( |
bool | isU | ) |
|
|
inline |
◆ trimToSampleRange()
Convert a value to sample range.
- Parameters
-
- Returns
- APVRawSampleType representation of x
Definition at line 148 of file DATCONSVDDigit.h.
149 {
150 T trimmedX = std::min(
151 static_cast<T>(std::numeric_limits<DATCONSVDDigit::APVRawSampleType>::max()),
152 std::max(
153 static_cast<T>(std::numeric_limits<DATCONSVDDigit::APVRawSampleType>::lowest()),
154 x));
155 return static_cast<DATCONSVDDigit::APVRawSampleType>(trimmedX);
156 }
◆ c_nAPVSamples
const std::size_t c_nAPVSamples = 6 |
|
static |
◆ m_cellID
◆ m_isU
◆ m_maxSampleIndex
unsigned short m_maxSampleIndex |
|
private |
◆ m_samples
◆ m_sensorID
◆ m_totalCharge
unsigned short m_totalCharge |
|
private |
The documentation for this class was generated from the following file: