7 #include <TMatrixTSym.h>
9 #include <gtest/gtest-spi.h>
10 #include <gtest/gtest.h>
23 Int_t retValInt {-111};
24 Double_t retValDouble {-111.};
27 EXPECT_EQ(evnumber, retValInt);
30 EXPECT_EQ(starttime, retValDouble);
33 EXPECT_EQ(endtime, retValDouble);
36 EXPECT_EQ(numobjects, retValInt);
41 Double_t val[6] = {0., 0., 0., 0., 0., 0.};
65 std::vector<UInt_t> indices) {
66 Int_t retValInt {-111};
67 UInt_t retValUInt {111};
70 EXPECT_EQ(numobjects, retValInt);
73 EXPECT_EQ(numobjectstype, retValInt);
75 if (numobjectstype > 0) {
76 for (Int_t
i = 0;
i < numobjectstype; ++
i) {
78 EXPECT_EQ(indices[
i], retValUInt);
84 TEST(_GTestCbmEvent, CheckDefaultConstructor) {
86 { SCOPED_TRACE(
"CheckDefaultConstructor"); }
89 TEST(_GTestCbmEvent, CheckStandardConstructor) {
92 SCOPED_TRACE(
"CheckStandardConstructor");
98 TEST(_GTestCbmEvent, CheckSettersAndGetters) {
101 SCOPED_TRACE(
"CheckSettersAndGetters: Initial Test");
105 test.SetStartTime(-23.);
107 SCOPED_TRACE(
"CheckSettersAndGetters: SetStartTime");
111 test.SetEndTime(-45.);
113 SCOPED_TRACE(
"CheckSettersAndGetters: SetEndTime");
118 test.SetMatch(testMatch);
120 SCOPED_TRACE(
"CheckSettersAndGetters: SetMatch");
125 TEST(_GTestCbmEvent, CheckAddData) {
128 SCOPED_TRACE(
"CheckAddData: Initial Test");
132 std::vector<UInt_t> mctrack;
133 std::vector<UInt_t> stspoint;
134 std::vector<UInt_t> stsdigi;
135 std::vector<UInt_t> stscluster;
136 std::vector<UInt_t> stshit;
137 std::vector<UInt_t> ststrack;
140 mctrack.push_back(11);
143 SCOPED_TRACE(
"CheckAddData: Add first MCTrack");
153 mctrack.push_back(23);
156 SCOPED_TRACE(
"CheckAddData: Add second MCTrack");
167 EXPECT_EQ(-2, retValUInt);
169 stspoint.push_back(1);
172 SCOPED_TRACE(
"CheckAddData: Add StsPoint");
182 stsdigi.push_back(2);
185 SCOPED_TRACE(
"CheckAddData: Add StsDigi");
195 stscluster.push_back(3);
198 SCOPED_TRACE(
"CheckAddData: Add StsCluster");
211 SCOPED_TRACE(
"CheckAddData: Add StsHit");
221 ststrack.push_back(5);
224 SCOPED_TRACE(
"CheckAddData: Add StsTrack");
234 ststrack.push_back(6);
237 SCOPED_TRACE(
"CheckAddData: Add StsTrack via AddStsTrack");
247 retValUInt = test.GetStsTrackIndex(0);
248 EXPECT_EQ(5, retValUInt);
250 retValUInt = test.GetStsTrackIndex(1);
251 EXPECT_EQ(6, retValUInt);
253 retValUInt = test.GetStsTrackIndex(2);
254 EXPECT_EQ(-2, retValUInt);
256 retValUInt = test.GetNofStsTracks();
257 EXPECT_EQ(2, retValUInt);
260 ststrack.push_back(11);
261 ststrack.push_back(12);
262 ststrack.push_back(13);
264 test.SetStsTracks(ststrack);
265 retValUInt = test.GetNofStsTracks();
266 EXPECT_EQ(3, retValUInt);
268 SCOPED_TRACE(
"CheckAddData: Add StsTracks via StsStsTrack");
278 EXPECT_STREQ(
"Event -111 at t = 1 ns. Registered data types: 6, data "
279 "objects: 9, without matches\n -- Data type 0, number "
280 "of data 2\n -- Data type 200, number of data 1\n "
281 " -- Data type 201, number of data 1\n -- Data type "
282 "202, number of data 1\n -- Data type 203, number of "
283 "data 1\n -- Data type 204, number of data 3\n",
284 test.ToString().c_str());
287 TEST(_GTestCbmEvent, CheckSetVertex) {
299 CbmVertex testVertex {
"Vertex",
"Vertex", 1., 2., 3., 4., 5, 6, Cov};
302 test.
SetVertex(1., 2., 3., 4., 5, 6, Cov);
304 SCOPED_TRACE(
"CheckSetVertex");