CbmRoot
Loading...
Searching...
No Matches
compareFairMCPoint.h
Go to the documentation of this file.
1/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
5#ifndef COMPAREFAIRMCPOINT_H
6#define COMPAREFAIRMCPOINT_H 1
7
8#include <FairMCPoint.h>
9
10#include <TVector3.h>
11
12#include "gtest/gtest.h"
13
14void compareFairMCPointDataMembers(FairMCPoint& test, int32_t trackID, int32_t detID, TVector3 pos, TVector3 mom,
15 double tof, double length, double eloss, int32_t eventid)
16{
17 int32_t retValInt {-222};
18 double retValDouble {-222.};
19
20 retValInt = test.GetDetectorID();
21 EXPECT_EQ(detID, retValInt);
22
23 retValInt = test.GetEventID();
24 EXPECT_EQ(eventid, retValInt);
25
26 retValInt = test.GetTrackID();
27 EXPECT_EQ(trackID, retValInt);
28
29 retValDouble = test.GetPx();
30 EXPECT_FLOAT_EQ(mom.Px(), retValDouble);
31
32 retValDouble = test.GetPy();
33 EXPECT_FLOAT_EQ(mom.Py(), retValDouble);
34
35 retValDouble = test.GetPz();
36 EXPECT_FLOAT_EQ(mom.Pz(), retValDouble);
37
38 retValDouble = test.GetX();
39 EXPECT_FLOAT_EQ(pos.X(), retValDouble);
40
41 retValDouble = test.GetY();
42 EXPECT_FLOAT_EQ(pos.Y(), retValDouble);
43
44 retValDouble = test.GetZ();
45 EXPECT_FLOAT_EQ(pos.Z(), retValDouble);
46
47 retValDouble = test.GetTime();
48 EXPECT_FLOAT_EQ(tof, retValDouble);
49
50 retValDouble = test.GetLength();
51 EXPECT_FLOAT_EQ(length, retValDouble);
52
53 retValDouble = test.GetEnergyLoss();
54 EXPECT_FLOAT_EQ(eloss, retValDouble);
55}
56
57#endif // COMPAREPSDDIGI_H
void compareFairMCPointDataMembers(FairMCPoint &test, int32_t trackID, int32_t detID, TVector3 pos, TVector3 mom, double tof, double length, double eloss, int32_t eventid)