ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SpacepointMeasurement2.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SpacepointMeasurement2.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 SpacepointMeasurement2::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  SpacepointMeasurement2::SpacepointMeasurement2(const TVector3& pos, const TVector3& resolution)
40  {
41  TMatrixDSym cov(3);
42  cov.Zero();
43  cov(0, 0) = resolution.X() * resolution.X();
44  cov(1, 1) = resolution.Y() * resolution.Y();
45  cov(2, 2) = resolution.Z() * resolution.Z();
46  init(pos, cov);
47  }
48 
54  SpacepointMeasurement2::SpacepointMeasurement2(const TVector3& pos, const TMatrixDSym& cov)
55  {
56  init(pos, cov);
57  }
58 
60  {
61  //delete _measurement;
62  }
63 
64 } // namespace PHGenFit