Belle II Software development
DATCONSVDDigit Class Reference

The DATCONSVDDigit class. More...

#include <DATCONSVDDigit.h>

Public Types

typedef uint8_t APVRawSampleType
 Type of samples received from DAQ.
 
typedef std::array< APVRawSampleType, c_nAPVSamplesAPVRawSamples
 Type for array of samples received from DAQ.
 
typedef float APVFloatSampleType
 Types of samples for processing.
 
typedef std::array< APVFloatSampleType, c_nAPVSamplesAPVFloatSamples
 Types for array of samples for processing.
 

Public Member Functions

 DATCONSVDDigit (VxdID sensorID, bool isU, short cellID, APVFloatSampleType samples[c_nAPVSamples])
 Constructor using c-array of samples.
 
 DATCONSVDDigit (VxdID sensorID, bool isU, short cellID, APVFloatSamples samples)
 Constructor using a stl container of samples.
 
VxdID getSensorID () const
 Getter for the sensor ID.
 
VxdID::baseType getRawSensorID () const
 Getter for the raw sensor ID.
 
bool isUStrip () const
 Getter for the strip direction (u or v)
 
short int getCellID () const
 Getter for the strip ID.
 
APVFloatSamples getFloatSamples () const
 Get float-array of 6 APV25 samples.
 
APVRawSamples getRawSamples () const
 Get int-array of of 6 APV25 samples.
 
unsigned short getTotalCharge ()
 Getter for the total charge of the array in ADUs.
 
unsigned short getMaxSampleCharge () const
 Getter for the charge of the biggest sample of the array in ADUs.
 
unsigned short getMaxSampleIndex ()
 Getter for the index of the biggest sample inside the cluster (0...6)
 
void setSensorID (VxdID sensorid)
 Setter for the sensorID.
 
void setUStrip (bool isU)
 Setter for the strip direction (u or v).
 
void setCellID (short cellID)
 Setter for the stripID / cellID.
 
void setAPVRawSamples (APVFloatSamples apvInputSamples)
 Setter for the raw samples array.
 

Static Public Member Functions

template<typename T >
static DATCONSVDDigit::APVRawSampleType trimToSampleRange (T x)
 Convert a value to sample range.
 

Static Public Attributes

static const std::size_t c_nAPVSamples = 6
 Number of APV samples stored.
 

Private Attributes

VxdID::baseType m_sensorID
 Compressed sensor identifier.
 
bool m_isU
 True if U, false if V.
 
short m_cellID
 Strip coordinate in pitch units.
 
APVRawSamples m_samples
 6 APV signals from the strip.
 
unsigned short m_totalCharge
 Total charge of this DATCONSVDDigit.
 
unsigned short m_maxSampleIndex
 Index of charge of sample max.
 

Detailed Description

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.

Member Typedef Documentation

◆ APVFloatSamples

Types for array of samples for processing.

Definition at line 45 of file DATCONSVDDigit.h.

◆ APVFloatSampleType

typedef float APVFloatSampleType

Types of samples for processing.

Definition at line 43 of file DATCONSVDDigit.h.

◆ APVRawSamples

Type for array of samples received from DAQ.

Definition at line 40 of file DATCONSVDDigit.h.

◆ APVRawSampleType

typedef uint8_t APVRawSampleType

Type of samples received from DAQ.

Definition at line 38 of file DATCONSVDDigit.h.

Constructor & Destructor Documentation

◆ DATCONSVDDigit() [1/2]

DATCONSVDDigit ( VxdID  sensorID,
bool  isU,
short  cellID,
APVFloatSampleType  samples[c_nAPVSamples] 
)
inline

Constructor using c-array of samples.

Parameters
sensorIDSensor VXD ID.
isUTrue if u strip, false if v.
cellIDStrip ID.
samplesstd::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 }
unsigned short m_maxSampleIndex
Index of charge of sample max.
bool m_isU
True if U, false if V.
static const std::size_t c_nAPVSamples
Number of APV samples stored.
VxdID::baseType m_sensorID
Compressed sensor identifier.
unsigned short m_totalCharge
Total charge of this DATCONSVDDigit.
float APVFloatSampleType
Types of samples for processing.
short m_cellID
Strip coordinate in pitch units.
APVRawSamples m_samples
6 APV signals from the strip.

◆ DATCONSVDDigit() [2/2]

DATCONSVDDigit ( VxdID  sensorID,
bool  isU,
short  cellID,
APVFloatSamples  samples 
)
inline

Constructor using a stl container of samples.

Parameters
sensorIDSensor VXD ID.
isUTrue if u strip, false if v.
cellIDStrip ID.
samplesstd::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 }

Member Function Documentation

◆ getCellID()

short int getCellID ( ) const
inline

Getter for the strip ID.

Definition at line 83 of file DATCONSVDDigit.h.

83{ return m_cellID; }

◆ getFloatSamples()

APVFloatSamples getFloatSamples ( ) const
inline

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 }
uint8_t APVRawSampleType
Type of samples received from DAQ.
std::array< APVFloatSampleType, c_nAPVSamples > APVFloatSamples
Types for array of samples for processing.

◆ 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];
137 }
138 }
139 }
140 return m_maxSampleIndex;
141 }

◆ getRawSamples()

APVRawSamples getRawSamples ( ) const
inline

Get int-array of of 6 APV25 samples.

Definition at line 95 of file DATCONSVDDigit.h.

96 {
97 return m_samples;
98 }

◆ getRawSensorID()

VxdID::baseType getRawSensorID ( ) const
inline

Getter for the raw sensor ID.

Definition at line 77 of file DATCONSVDDigit.h.

77{ return m_sensorID; }

◆ getSensorID()

VxdID getSensorID ( ) const
inline

Getter for the sensor ID.

Definition at line 74 of file DATCONSVDDigit.h.

74{ return m_sensorID; }

◆ 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++) {
109 }
110 }
111 return m_totalCharge;
112 }

◆ isUStrip()

bool isUStrip ( ) const
inline

Getter for the strip direction (u or v)

Definition at line 80 of file DATCONSVDDigit.h.

80{ return m_isU; }

◆ setAPVRawSamples()

void setAPVRawSamples ( APVFloatSamples  apvInputSamples)
inline

Setter for the raw samples array.

Definition at line 169 of file DATCONSVDDigit.h.

170 {
171 // m_samples = apvSamples;
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

Setter for the strip direction (u or v).

Definition at line 163 of file DATCONSVDDigit.h.

163{ m_isU = isU; }

◆ trimToSampleRange()

static DATCONSVDDigit::APVRawSampleType trimToSampleRange ( x)
inlinestatic

Convert a value to sample range.

Parameters
xvalue to be converted
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 }

Member Data Documentation

◆ c_nAPVSamples

const std::size_t c_nAPVSamples = 6
static

Number of APV samples stored.

Definition at line 35 of file DATCONSVDDigit.h.

◆ m_cellID

short m_cellID
private

Strip coordinate in pitch units.

Definition at line 180 of file DATCONSVDDigit.h.

◆ m_isU

bool m_isU
private

True if U, false if V.

Definition at line 179 of file DATCONSVDDigit.h.

◆ m_maxSampleIndex

unsigned short m_maxSampleIndex
private

Index of charge of sample max.

Definition at line 183 of file DATCONSVDDigit.h.

◆ m_samples

APVRawSamples m_samples
private

6 APV signals from the strip.

Definition at line 181 of file DATCONSVDDigit.h.

◆ m_sensorID

VxdID::baseType m_sensorID
private

Compressed sensor identifier.

Definition at line 178 of file DATCONSVDDigit.h.

◆ m_totalCharge

unsigned short m_totalCharge
private

Total charge of this DATCONSVDDigit.

Definition at line 182 of file DATCONSVDDigit.h.


The documentation for this class was generated from the following file: