CbmRoot
_GTestCbmStripHit.cxx
Go to the documentation of this file.
1 #include "CbmStripHit.h"
2 
3 #include <TVector3.h>
4 
5 #include <gtest/gtest-spi.h>
6 #include <gtest/gtest.h>
7 
8 #include "compareStripHit.h"
9 
10 TEST(_GTestCbmStripHit, CheckDefaultConstructor) {
11  CbmStripHit test;
12  {
13  SCOPED_TRACE("CheckDefaultConstructor");
15  test, kSTRIPHIT, 0., 0., -1, -1, nullptr, -1., -1., 0., 0., 0., 0.);
16  }
17 }
18 
19 TEST(_GTestCbmStripHit, CheckStandardConstructor) {
20  CbmStripHit test {-1, 0., 0., 0., 0., 0., 0., -1};
21  {
22  SCOPED_TRACE("CheckStandardConstructor");
24  test, kSTRIPHIT, 0., 0., -1, -1, nullptr, -1., -1., 0., 0., 0., 0.);
25  }
26 }
27 
28 TEST(_GTestCbmStripHit, CheckStandardConstructorWithTime) {
29  CbmStripHit test {-1, 0., 0., 0., 0., 0., 0., -1, -2., -2.};
30  {
31  SCOPED_TRACE("CheckStandardConstructorWithTime");
33  test, kSTRIPHIT, 0., 0., -1, -1, nullptr, -2., -2., 0., 0., 0., 0.);
34  }
35 }
36 
37 TEST(_GTestCbmStripHit, CheckStandardConstructorTVector3) {
38  TVector3 pos {
39  0.,
40  0.,
41  0.,
42  };
43  TVector3 poserror {
44  0.,
45  0.,
46  0.,
47  };
48  CbmStripHit test {-1, pos, poserror, -1};
49  {
50  SCOPED_TRACE("CheckStandardConstructor");
52  test, kSTRIPHIT, 0., 0., -1, -1, nullptr, -1., -1., 0., 0., 0., 0.);
53  }
54 }
55 
56 TEST(_GTestCbmStripHit, CheckStandardConstructorTVector3WithTime) {
57  TVector3 pos {
58  0.,
59  0.,
60  0.,
61  };
62  TVector3 poserror {
63  0.,
64  0.,
65  0.,
66  };
67  CbmStripHit test {-1, pos, poserror, -1, -2., -2};
68  {
69  SCOPED_TRACE("CheckStandardConstructorWithTime");
71  test, kSTRIPHIT, 0., 0., -1, -1, nullptr, -2., -2., 0., 0., 0., 0.);
72  }
73 }
74 
75 TEST(_GTestCbmStripHit, CheckSetters) {
76  CbmStripHit test;
77  {
78  SCOPED_TRACE("CheckSetters: Initial Test");
80  test, kSTRIPHIT, 0., 0., -1, -1, nullptr, -1., -1., 0., 0., 0., 0.);
81  }
82 
83  test.SetU(-11.);
84  {
85  SCOPED_TRACE("CheckSetters: SetU");
87  test, kSTRIPHIT, 0., 0., -1, -1, nullptr, -1., -1., -11., 0., 0., 0.);
88  }
89 
90  test.SetDu(-12.);
91  {
92  SCOPED_TRACE("CheckSetters: SetDu");
94  test, kSTRIPHIT, 0., 0., -1, -1, nullptr, -1., -1., -11., -12., 0., 0.);
95  }
96 
97  test.SetPhi(-13.);
98  {
99  SCOPED_TRACE("CheckSetters: SetPhi");
101  test, kSTRIPHIT, 0., 0., -1, -1, nullptr, -1., -1., -11., -12., -13., 0.);
102  }
103 
104  test.SetDphi(-14.);
105  {
106  SCOPED_TRACE("CheckSetters: SetDphi");
108  kSTRIPHIT,
109  0.,
110  0.,
111  -1,
112  -1,
113  nullptr,
114  -1.,
115  -1.,
116  -11.,
117  -12.,
118  -13.,
119  -14.);
120  }
121 }
122 
123 TEST(_GTestCbmMatch, CheckToString) {
124  CbmStripHit test;
125  EXPECT_STREQ("CbmStripHit: address=-1 pos=(0,0,0) err=(0,0,0) refId=-1\n",
126  test.ToString().c_str());
127 }
CbmStripHit::SetDu
void SetDu(Double_t du)
Definition: CbmStripHit.h:89
TEST
TEST(_GTestCbmStripHit, CheckDefaultConstructor)
Definition: _GTestCbmStripHit.cxx:10
CbmStripHit
Definition: CbmStripHit.h:22
CbmStripHit::ToString
virtual std::string ToString() const
Inherited from CbmBaseHit.
Definition: CbmStripHit.cxx:54
kSTRIPHIT
@ kSTRIPHIT
Definition: CbmHit.h:19
CbmStripHit.h
CbmStripHit::SetU
void SetU(Double_t u)
Definition: CbmStripHit.h:87
CbmStripHit::SetPhi
void SetPhi(Double_t phi)
Definition: CbmStripHit.h:88
compareStripHit.h
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
compareStripHitDataMembers
void compareStripHitDataMembers(CbmStripHit &test, HitType type, Double_t z, Double_t dz, Int_t refid, Int_t address, CbmMatch *match, Double_t time, Double_t errortime, Double_t u, Double_t du, Double_t phi, Double_t dphi)
Definition: compareStripHit.h:9
CbmStripHit::SetDphi
void SetDphi(Double_t dphi)
Definition: CbmStripHit.h:90