 |
Belle II Software
release-05-02-19
|
11 #ifndef SVD_SHAPERDIGIT_H
12 #define SVD_SHAPERDIGIT_H
14 #include <vxd/dataobjects/VxdID.h>
15 #include <svd/dataobjects/SVDModeByte.h>
16 #include <framework/dataobjects/DigitBase.h>
38 class SVDShaperDigit :
public DigitBase {
50 typedef std::array<APVRawSampleType, c_nAPVSamples>
APVRawSamples;
69 SVDModeByte mode = SVDModeByte()):
74 [](T x)->APVRawSampleType { return trimToSampleRange(x); }
93 std::transform(samples.begin(), samples.end(),
m_samples.begin(),
94 [](
typename T::value_type x)->APVRawSampleType
95 { return trimToSampleRange(x); }
134 return returnSamples;
145 const auto maxBinIterator = std::max_element(begin(samples), end(samples));
146 const int maxBin = std::distance(begin(samples), maxBinIterator);
157 const float amplitude = *std::max_element(begin(samples), end(samples));
182 T trimmedX = std::min(
183 static_cast<T
>(std::numeric_limits<SVDShaperDigit::APVRawSampleType>::max()),
185 static_cast<T
>(std::numeric_limits<SVDShaperDigit::APVRawSampleType>::lowest()),
196 std::ostringstream os;
197 os <<
"VXDID : " <<
m_sensorID <<
" = " << std::string(thisSensorID) <<
" strip: "
200 std::ostream_iterator<unsigned int>(os,
" "));
201 os <<
"FADC time: " << (
unsigned int)
m_FADCTime <<
" Triggerbin:" << (
unsigned int) thisMode.
getTriggerBin() << std::endl;
202 os <<
"RunType: " << (
unsigned int)thisMode.
getRunType() <<
", EventType: " << (
unsigned int) thisMode.
getEventType() <<
203 ", DAQMode: " << (
unsigned int) thisMode.
getDAQMode() << std::endl;
204 os <<
" SVDModeByte: " << (
unsigned int)thisMode << std::endl;
234 { return trimToSampleRange(x + y); }
261 bool passesZS(
int nSamples,
float cutMinSignal)
const
266 if (samples_vec[k] >= cutMinSignal)
269 if (nOKSamples >= nSamples)
294 #endif // SVD_SHAPERDIGIT_H
EAppendStatus
Enum for return state of addBGDigit function.
Class to uniquely identify a any structure of the PXD and SVD.
static const baseType c_DefaultID
Default / non-informative id 10010111 = 151 Run type: zero-suppressed, 2 Event type: global run,...
bool operator<(const SVDShaperDigit &x) const
baseType getTriggerBin() const
Get the triggerBin id.
APVFloatSamples getSamples() const
Get array of samples.
short m_cellID
Strip coordinate in pitch units.
VxdID getSensorID() const
Get the sensor ID.
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
VxdID::baseType m_sensorID
Compressed sensor identifier.
Class to store SVD mode information.
SVDModeByte getModeByte() const
Get the SVDMOdeByte object containing information on trigger FADCTime and DAQ mode.
baseType getDAQMode() const
Get the daqMode id.
float getFADCTime() const
Get digit FADCTime estimate.
VxdID::baseType getRawSensorID() const
Get raw sensor ID.
float APVFloatSampleType
Types for array of samples for processing.
The SVD ShaperDigit class.
std::array< APVFloatSampleType, c_nAPVSamples > APVFloatSamples
array of APVFloatSampleType objects
int8_t m_FADCTime
digit time estimate from the FADC, in ns
int getMaxADCCounts() const
Get the ADC counts corresponding to the higher sample amplitude.
unsigned short baseType
The base integer type for VxdID.
@ c_DontAppend
do not append BG digit to digits
SVDShaperDigit()
Default constructor for the ROOT IO.
Abstract base class for different kinds of events.
uint8_t baseType
The base integer type for SVDModeByte.
DigitBase::EAppendStatus addBGDigit(const DigitBase *bg) override
Implementation of base class function.
unsigned int getUniqueChannelID() const override
Implementation of base class function.
APVRawSamples m_samples
6 APV signals from the strip.
static SVDShaperDigit::APVRawSampleType trimToSampleRange(T x)
Convert a value to sample range.
baseType getRunType() const
Get the runMode id.
bool passesZS(int nSamples, float cutMinSignal) const
does the strip pass the ZS cut?
bool m_isU
True if U, false if V.
static const std::size_t c_nAPVSamples
Number of APV samples stored.
short int getCellID() const
Get strip ID.
std::array< APVRawSampleType, c_nAPVSamples > APVRawSamples
array of APVRawSamplesType objects
SVDModeByte::baseType m_mode
Mode byte, trigger FADCTime + DAQ mode.
std::string toString() const
Display main parameters in this object.
bool isUStrip() const
Get strip direction.
int getMaxTimeBin() const
Get the max bin.
uint8_t APVRawSampleType
Types for array of samples received from DAQ.
baseType getEventType() const
Get the eventMode id.