ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SpacepointMeasurement.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SpacepointMeasurement.cc
1 
8 
10 
11 #include <TMatrixDSymfwd.h> // for TMatrixDSym
12 #include <TMatrixTSym.h>
13 #include <TVector3.h>
14 #include <TVectorDfwd.h>
15 #include <TVectorT.h>
16 
17 namespace PHGenFit
18 {
19 void SpacepointMeasurement::init(const TVector3& pos, const TMatrixDSym& cov)
20 {
21  int nDim = 3;
22  TVectorD hitCoords(nDim);
23  TMatrixDSym hitCov(nDim);
24 
25  hitCoords(0) = pos.X();
26  hitCoords(1) = pos.Y();
27  hitCoords(2) = pos.Z();
28 
29  for (int i = 0; i < 3; i++)
30  for (int j = 0; j < 3; j++)
31  hitCov(i, j) = cov(i, j);
32 
33  int measurementCounter_ = 0;
34  _measurement = new genfit::SpacepointMeasurement(hitCoords, hitCov, -1,
35  measurementCounter_,
36  nullptr);
37 }
38 
39 SpacepointMeasurement::SpacepointMeasurement(const TVector3& pos, const double resolution)
40 {
41  TMatrixDSym cov(3);
42  cov.Zero();
43  cov(0, 0) = resolution * resolution;
44  cov(1, 1) = resolution * resolution;
45  cov(2, 2) = resolution * resolution;
46  init(pos, cov);
47 }
48 
49 SpacepointMeasurement::SpacepointMeasurement(const TVector3& pos, const TVector3& resolution)
50 {
51  TMatrixDSym cov(3);
52  cov.Zero();
53  cov(0, 0) = resolution.X() * resolution.X();
54  cov(1, 1) = resolution.Y() * resolution.Y();
55  cov(2, 2) = resolution.Z() * resolution.Z();
56  init(pos, cov);
57 }
58 
64 SpacepointMeasurement::SpacepointMeasurement(const TVector3& pos, const TMatrixDSym& cov)
65 {
66  init(pos, cov);
67 }
68 
70 {
71  //delete _measurement;
72 }
73 
74 } // namespace PHGenFit