11TEST(_GTestCbmTrdPoint, CheckDefaultConstructor)
16 compareTrdPointDataMembers(test, -1, -1, TVector3(0., 0., 0.), TVector3(0., 0., 0.), TVector3(0., 0., 0.),
17 TVector3(0., 0., 0.), 0., 0., 0., 0);
21 compareTrdPointDataMembers(*test1, -1, -1, TVector3(0., 0., 0.), TVector3(0., 0., 0.), TVector3(0., 0., 0.),
22 TVector3(0., 0., 0.), 0., 0., 0., 0);
25TEST(_GTestCbmTrdPoint, CheckStandardConstructor)
29 TVector3 posin {-2.1, 6.1, 23.};
30 TVector3 momin {2.5, 4.5, 78.};
31 TVector3 posout {2.1, -6.1, -23.};
32 TVector3 momout {-2.5, -4.5, -78.};
35 double eloss {0.4567};
38 CbmTrdPoint test(trackid, detid, posin, momin, posout, momout, tof, length, eloss);
40 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
44 compareTrdPointDataMembers(*test1, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
47TEST(_GTestCbmTrdPoint, CheckCopyConstructor)
51 TVector3 posin {-2.1, 6.1, 23.};
52 TVector3 momin {2.5, 4.5, 78.};
53 TVector3 posout {2.1, -6.1, -23.};
54 TVector3 momout {-2.5, -4.5, -78.};
57 double eloss {0.4567};
60 CbmTrdPoint test(trackid, detid, posin, momin, posout, momout, tof, length, eloss);
62 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
69 compareTrdPointDataMembers(test2, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
72 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
75TEST(_GTestCbmTrdPoint, CheckCopyAssignmentOperator)
79 TVector3 posin {-2.1, 6.1, 23.};
80 TVector3 momin {2.5, 4.5, 78.};
81 TVector3 posout {2.1, -6.1, -23.};
82 TVector3 momout {-2.5, -4.5, -78.};
85 double eloss {0.4567};
88 CbmTrdPoint test(trackid, detid, posin, momin, posout, momout, tof, length, eloss);
90 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
98 compareTrdPointDataMembers(test2, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
101 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
104TEST(_GTestCbmTrdPoint, CheckMoveConstructor)
106 int32_t trackid {34};
108 TVector3 posin {-2.1, 6.1, 23.};
109 TVector3 momin {2.5, 4.5, 78.};
110 TVector3 posout {2.1, -6.1, -23.};
111 TVector3 momout {-2.5, -4.5, -78.};
114 double eloss {0.4567};
117 CbmTrdPoint test(trackid, detid, posin, momin, posout, momout, tof, length, eloss);
119 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
126 compareTrdPointDataMembers(test2, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
130 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
133TEST(_GTestCbmTrdPoint, CheckAssignmentOperator)
135 int32_t trackid {34};
137 TVector3 posin {-2.1, 6.1, 23.};
138 TVector3 momin {2.5, 4.5, 78.};
139 TVector3 posout {2.1, -6.1, -23.};
140 TVector3 momout {-2.5, -4.5, -78.};
143 double eloss {0.4567};
146 CbmTrdPoint test(trackid, detid, posin, momin, posout, momout, tof, length, eloss);
148 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
154 test2 = std::move(test);
156 compareTrdPointDataMembers(test2, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
160 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
163TEST(_GTestCbmTrdPoint, CheckPrint)
165 int32_t trackid {34};
167 TVector3 posin {-2.1, 6.1, 23.};
168 TVector3 momin {2.5, 4.5, 78.};
169 TVector3 posout {2.1, -6.1, -23.};
170 TVector3 momout {-2.5, -4.5, -78.};
173 double eloss {0.4567};
176 CbmTrdPoint test(trackid, detid, posin, momin, posout, momout, tof, length, eloss);
178 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
180 testing::internal::CaptureStdout();
182 std::string output = testing::internal::GetCapturedStdout();
184 EXPECT_STREQ(
"[INFO] TRD point for track 34 in detector 45\n[INFO] "
185 "Position In (-2.1, 6.1, 23) cm\n[INFO] Momentum In (2.5, "
186 "4.5, 78) GeV\n[INFO] Position Out (2.1, -6.1, -23) "
187 "cm\n[INFO] Momentum Out (-2.5, -4.5, -78) GeV\n[INFO] "
188 "Time 34.56 ns, Length 1.2 cm, Energy loss 456700 keV\n",
193TEST(_GTestCbmTrdPoint, CheckPositionOut)
195 int32_t trackid {34};
197 TVector3 posin {-2.1, 6.1, 23.};
198 TVector3 momin {2.5, 4.5, 78.};
199 TVector3 posout {2.1, -6.1, -23.};
200 TVector3 momout {-2.5, -4.5, -78.};
203 double eloss {0.4567};
206 CbmTrdPoint test(trackid, detid, posin, momin, posout, momout, tof, length, eloss);
208 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
211 TVector3 testVect {0., 0., 0.};
215 EXPECT_FLOAT_EQ(posout.X(), testVect.X());
216 EXPECT_FLOAT_EQ(posout.Y(), testVect.Y());
217 EXPECT_FLOAT_EQ(posout.Z(), testVect.Z());
220TEST(_GTestCbmTrdPoint, CheckMomentumOut)
222 int32_t trackid {34};
224 TVector3 posin {-2.1, 6.1, 23.};
225 TVector3 momin {2.5, 4.5, 78.};
226 TVector3 posout {2.1, -6.1, -23.};
227 TVector3 momout {-2.5, -4.5, -78.};
230 double eloss {0.4567};
233 CbmTrdPoint test(trackid, detid, posin, momin, posout, momout, tof, length, eloss);
235 compareTrdPointDataMembers(test, trackid, detid, posin, momin, posout, momout, tof, length, eloss, eventid);
238 TVector3 testVect {0., 0., 0.};
242 EXPECT_FLOAT_EQ(momout.X(), testVect.X());
243 EXPECT_FLOAT_EQ(momout.Y(), testVect.Y());
244 EXPECT_FLOAT_EQ(momout.Z(), testVect.Z());
void compareTrdPointDataMembers(CbmTrdPoint &test, int32_t trackID, int32_t detID, TVector3 posin, TVector3 momin, TVector3 posout, TVector3 momout, double tof, double length, double eLoss, int32_t eventid)