11#include <vxd/dataobjects/VxdID.h>
12#include <framework/dataobjects/DigitBase.h>
66 [](T x)->APVRawSampleType { return trimToSampleRange(x); }
83 std::transform(samples.begin(), samples.end(),
m_samples.begin(),
84 [](
typename T::value_type x)->APVRawSampleType
85 { return trimToSampleRange(x); }
124 return returnSamples;
135 const auto maxBinIterator = std::max_element(begin(samples), end(samples));
136 const int maxBin = std::distance(begin(samples), maxBinIterator);
147 const float amplitude = *std::max_element(begin(samples), end(samples));
165 T trimmedX = std::min(
166 static_cast<T
>(std::numeric_limits<SVDShaperDigit::APVRawSampleType>::max()),
168 static_cast<T
>(std::numeric_limits<SVDShaperDigit::APVRawSampleType>::lowest()),
178 std::ostringstream os;
179 os <<
"VXDID : " <<
m_sensorID <<
" = " << std::string(thisSensorID) <<
" strip: "
182 std::ostream_iterator<unsigned int>(os,
" "));
183 os <<
"FADC time: " << (
unsigned int)
m_FADCTime << std::endl;
216 { return trimToSampleRange(x + y); }
222 { return trimToSampleRange(x + y); }
239 for (
size_t i = 3; i < 6; i++)
m_samples[i] = 0;
262 bool passesZS(
int nSamples,
float cutMinSignal)
const
267 if (samples_vec[k] >= cutMinSignal)
270 if (nOKSamples >= nSamples)
A common base for subdetector Digits.
EAppendStatus
Enum for return state of addBGDigit function.
@ c_DontAppend
do not append BG digit to digits
The SVD ShaperDigit class.
SVDShaperDigit(VxdID sensorID, bool isU, short cellID, T samples[c_nAPVSamples], int8_t FADCTime=0)
Constructor using c-array of samples.
DigitBase::EAppendStatus addBGDigit(const DigitBase *bg) override
Implementation of base class function.
static void setAPVMode(size_t mode, size_t firstSample)
set APV mode for the event
bool m_isU
True if U, false if V.
std::string toString() const
Display main parameters in this object.
static const std::size_t c_nAPVSamples
Number of APV samples stored.
VxdID::baseType m_sensorID
Compressed sensor identifier.
static SVDShaperDigit::APVRawSampleType trimToSampleRange(T x)
Convert a value to sample range.
VxdID::baseType getRawSensorID() const
Get raw sensor ID.
bool operator<(const SVDShaperDigit &x) const
unsigned int getUniqueChannelID() const override
Implementation of base class function.
std::array< APVRawSampleType, c_nAPVSamples > APVRawSamples
array of APVRawSamplesType objects
uint8_t APVRawSampleType
Types for array of samples received from DAQ.
std::array< APVFloatSampleType, c_nAPVSamples > APVFloatSamples
array of APVFloatSampleType objects
float APVFloatSampleType
Types for array of samples for processing.
bool passesZS(int nSamples, float cutMinSignal) const
does the strip pass the ZS cut?
short m_cellID
Strip coordinate in pitch units.
VxdID getSensorID() const
Get the sensor ID.
APVFloatSamples getSamples() const
Get array of samples.
SVDShaperDigit()
Default constructor for the ROOT IO.
int8_t m_FADCTime
digit time estimate from the FADC, in ns
short int getCellID() const
Get strip ID.
bool isUStrip() const
Get strip direction.
float getFADCTime() const
Get digit FADCTime estimate.
int getMaxTimeBin() const
Get the max bin.
SVDShaperDigit(VxdID sensorID, bool isU, short cellID, T samples, int8_t FADCTime=0)
Constructor using a stl container of samples.
int getMaxADCCounts() const
Get the ADC counts corresponding to the higher sample amplitude.
APVRawSamples m_samples
6 APV signals from the strip.
void adjustAppendedBGDigit() override
Modify already appended BG digit if aquisition mode is 3 sample.
Class to uniquely identify a any structure of the PXD and SVD.
unsigned short baseType
The base integer type for VxdID.
static size_t s_APVSampleBegin
first sample number for 3 sample acquisition mode (0 - 3)
static size_t s_APVSampleMode
APV acquisition mode (3 or 6)
Abstract base class for different kinds of events.