10#include <TMatrixTSym.h>
14#include <gtest/gtest-spi.h>
15#include <gtest/gtest.h>
22 int32_t retValInt {-111};
23 double retValDouble {-111.};
26 EXPECT_EQ(evnumber, retValInt);
29 EXPECT_EQ(starttime, retValDouble);
32 EXPECT_EQ(endtime, retValDouble);
35 EXPECT_EQ(numobjects, retValInt);
40 double val[6] = {0., 0., 0., 0., 0., 0.};
52 std::vector<uint32_t> indices)
54 int32_t retValInt {-111};
55 uint32_t retValUInt {111};
58 EXPECT_EQ(numobjects, retValInt);
61 EXPECT_EQ(numobjectstype, retValInt);
63 if (numobjectstype > 0) {
64 for (int32_t i = 0; i < numobjectstype; ++i) {
66 EXPECT_EQ(indices[i], retValUInt);
72TEST(_GTestCbmEvent, CheckDefaultConstructor)
76 SCOPED_TRACE(
"CheckDefaultConstructor");
80TEST(_GTestCbmEvent, CheckStandardConstructor)
84 SCOPED_TRACE(
"CheckStandardConstructor");
90TEST(_GTestCbmEvent, CheckSettersAndGetters)
94 SCOPED_TRACE(
"CheckSettersAndGetters: Initial Test");
100 SCOPED_TRACE(
"CheckSettersAndGetters: SetStartTime");
104 test.SetEndTime(-45.);
106 SCOPED_TRACE(
"CheckSettersAndGetters: SetEndTime");
111 test.SetMatch(testMatch);
113 SCOPED_TRACE(
"CheckSettersAndGetters: SetMatch");
118TEST(_GTestCbmEvent, CheckAddData)
122 SCOPED_TRACE(
"CheckAddData: Initial Test");
126 std::vector<uint32_t> mctrack;
127 std::vector<uint32_t> stspoint;
128 std::vector<uint32_t> stsdigi;
129 std::vector<uint32_t> stscluster;
130 std::vector<uint32_t> stshit;
131 std::vector<uint32_t> ststrack;
134 mctrack.push_back(11);
137 SCOPED_TRACE(
"CheckAddData: Add first MCTrack");
147 mctrack.push_back(23);
150 SCOPED_TRACE(
"CheckAddData: Add second MCTrack");
161 EXPECT_EQ(-2, retValUInt);
163 stspoint.push_back(1);
166 SCOPED_TRACE(
"CheckAddData: Add StsPoint");
176 stsdigi.push_back(2);
179 SCOPED_TRACE(
"CheckAddData: Add StsDigi");
189 stscluster.push_back(3);
192 SCOPED_TRACE(
"CheckAddData: Add StsCluster");
205 SCOPED_TRACE(
"CheckAddData: Add StsHit");
215 ststrack.push_back(5);
218 SCOPED_TRACE(
"CheckAddData: Add StsTrack");
228 ststrack.push_back(6);
231 SCOPED_TRACE(
"CheckAddData: Add StsTrack via AddStsTrack");
241 retValUInt = test.GetStsTrackIndex(0);
242 EXPECT_EQ(5, retValUInt);
244 retValUInt = test.GetStsTrackIndex(1);
245 EXPECT_EQ(6, retValUInt);
247 retValUInt = test.GetStsTrackIndex(2);
248 EXPECT_EQ(-2, retValUInt);
250 retValUInt = test.GetNofStsTracks();
251 EXPECT_EQ(2, retValUInt);
254 ststrack.push_back(11);
255 ststrack.push_back(12);
256 ststrack.push_back(13);
258 test.SetStsTracks(ststrack);
259 retValUInt = test.GetNofStsTracks();
260 EXPECT_EQ(3, retValUInt);
262 SCOPED_TRACE(
"CheckAddData: Add StsTracks via StsStsTrack");
272 EXPECT_STREQ(
"Event -111 at t = 1 ns. Registered data types: 6, data "
273 "objects: 9, without matches\n -- Data type 0, number "
274 "of data 2\n -- Data type 200, number of data 1\n "
275 " -- Data type 201, number of data 1\n -- Data type "
276 "202, number of data 1\n -- Data type 203, number of "
277 "data 1\n -- Data type 204, number of data 3\n",
278 test.ToString().c_str());
281TEST(_GTestCbmEvent, CheckSetVertex)
294 CbmVertex testVertex {
"Vertex",
"Vertex", 1., 2., 3., 4., 5, 6, Cov};
297 test.
SetVertex(1., 2., 3., 4., 5, 6, Cov);
299 SCOPED_TRACE(
"CheckSetVertex");
void compareEventDataMembers(CbmEvent &test, int32_t evnumber, double starttime, double endtime, int32_t numobjects, CbmMatch *match, CbmVertex *vertex)
TEST(_GTestCbmEvent, CheckDefaultConstructor)
void compareEventMap(CbmEvent &test, int32_t numobjects, int32_t numobjectstype, ECbmDataType type, std::vector< uint32_t > indices)
Class characterising one event by a collection of links (indices) to data objects,...
size_t GetNofData() const
void SetVertex(double x, double y, double z, double chi2, int32_t ndf, int32_t nTracks, const TMatrixFSym &covMat)
int32_t GetNumber() const
double GetStartTime() const
double GetEndTime() const
void SetStartTime(double startTime)
CbmMatch * GetMatch() const
uint32_t GetIndex(ECbmDataType type, uint32_t iData)
double GetCovariance(int32_t i, int32_t j) const
int32_t GetNTracks() const
void compareVertexDataMembers(CbmVertex &test, double x, double y, double z, double chi2, int32_t ndf, int32_t ntracks, double *cov)