9#include <vxd/dataobjects/VxdID.h>
10#include <svd/dataobjects/SVDRecoDigit.h>
14#include <gtest/gtest.h>
50 VxdID sensorID(3, 4, 1);
51 short int cellID = 132;
52 float init_charge = 23456;
53 float init_chargeErr = 1234;
54 float init_time = -16;
55 float init_timeErr = 3.21;
56 float init_chi2 = 2.34;
58 std::vector<float> init_probs({0.0, 0.01, 0.10, 0.79, 0.06, 0.04});
59 SVDRecoDigit digit(sensorID,
false, cellID, init_charge, init_chargeErr, init_time,
60 init_timeErr, init_probs, init_chi2);
62 EXPECT_EQ(sensorID, digit.getSensorID());
63 EXPECT_FALSE(digit.isUStrip());
64 EXPECT_EQ(cellID, digit.getCellID());
65 EXPECT_EQ(init_charge, digit.getCharge());
66 EXPECT_EQ(init_chargeErr, digit.getAmplitudeError());
67 EXPECT_EQ(init_time, digit.getTime());
68 EXPECT_EQ(init_timeErr, digit.getTimeError());
70 for (
size_t ip = 0; ip < pdf.size(); ++ip)
73 float outputNorm = std::accumulate(pdf.begin(), pdf.end(), 0.0);
74 EXPECT_LE(fabs(1.0 - outputNorm), 1.0e-6);
75 EXPECT_EQ(init_chi2, digit.getChi2Ndf());
84 VxdID sensorID(3, 4, 1);
85 short int cellID = 132;
86 float init_charge = 23456;
87 float init_chargeErr = 1234;
88 float init_time = -16;
89 float init_timeErr = 3.21;
90 float init_chi2 = 2.34;
92 std::vector<float> init_probs({0.0, 0.01, 0.10, 0.79, 0.06, 0.04});
93 SVDRecoDigit digit(sensorID,
false, cellID, init_charge, init_chargeErr, init_time,
94 init_timeErr, init_probs, init_chi2);
97 digitString(
"VXDID : 25632 = 3.4.1 strip: V-132 Amplitude: 23456 +/- 1234 Time: -16 +/- 3.21\n probabilities: 0 655 6553 51772 3932 2621 Chi2/ndf: 2.34\n");
98 EXPECT_EQ(digitString, digit.toString());
double OutputProbType
Type for output probability array.
OutputProbArray getProbabilities() const
Get signal time pdf.
float getTime() const
Get time estimate.
float getAmplitude() const
Get amplitude estimate.
float getChi2Ndf() const
Get waveform fit chi2/ndf.
VxdID getSensorID() const
Get the sensor ID.
static const uint16_t storedProbArrayNorm
some constant
float getAmplitudeError() const
Get amplitude error.
std::vector< OutputProbType > OutputProbArray
vector of OutProbType objects
short int getCellID() const
Get strip ID.
bool isUStrip() const
Get strip direction.
float getTimeError() const
Get time error.
Class to uniquely identify a any structure of the PXD and SVD.
Abstract base class for different kinds of events.