9#include <vxd/dataobjects/VxdID.h>
10#include <svd/dataobjects/SVDShaperDigit.h>
14#include <gtest/gtest.h>
35 for (
auto sample : samples)
46 VxdID sensorID(3, 4, 1);
47 short int cellID = 132;
48 char digitFADCTime(-16);
50 std::vector<int> init_samples({0, 5, 10, 9, 6, 5});
51 SVDShaperDigit digit(sensorID,
false, cellID, init_samples, digitFADCTime);
53 EXPECT_EQ(sensorID, digit.getSensorID());
54 EXPECT_FALSE(digit.isUStrip());
55 EXPECT_EQ(cellID, digit.getCellID());
60 EXPECT_EQ(
static_cast<float>(digitFADCTime), digit.getFADCTime());
69 VxdID sensorID(3, 4, 1);
70 short int cellID = 132;
71 char digitFADCTime(-16);
76 sensorID,
false, cellID, init_samples, digitFADCTime);
85 EXPECT_EQ(
static_cast<float>(digitFADCTime), digit.
getFADCTime());
93 VxdID sensorID(3, 4, 1);
94 short int cellID = 132;
96 double init_samples[6] = {0, 5, 10, 9, 6, 5};
106 VxdID sensorID(3, 4, 1);
107 short int cellID = 132;
114 std::vector<float> init_samples({0, -10, 255, 256, 500, -1});
116 const auto& samples = digit.getSamples();
118 auto trimmedSample = std::max(sampleMin, std::min(sampleMax, init_samples[isample]));
119 EXPECT_EQ(trimmedSample, samples[isample]);
133 std::vector<float> init_samples({0, -10, 255, 256, 500, -1});
135 auto trimmedSample = std::max(sampleMin, std::min(sampleMax, init_samples[isample]));
The SVD ShaperDigit class.
static const std::size_t c_nAPVSamples
Number of APV samples stored.
static SVDShaperDigit::APVRawSampleType trimToSampleRange(T x)
Convert a value to sample range.
std::array< APVFloatSampleType, c_nAPVSamples > APVFloatSamples
array of APVFloatSampleType objects
float APVFloatSampleType
Types for array of samples for processing.
VxdID getSensorID() const
Get the sensor ID.
APVFloatSamples getSamples() const
Get array of samples.
short int getCellID() const
Get strip ID.
bool isUStrip() const
Get strip direction.
float getFADCTime() const
Get digit FADCTime estimate.
Class to uniquely identify a any structure of the PXD and SVD.
Abstract base class for different kinds of events.