ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlanarMeasurement.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PlanarMeasurement.cc
1 
7 #include "PlanarMeasurement.h"
8 
10 #include <GenFit/DetPlane.h>
11 #include <GenFit/SharedPlanePtr.h> // for SharedPlanePtr
12 #include <GenFit/StateOnPlane.h>
13 
14 #include <TMatrixDSymfwd.h> // for TMatrixDSym
15 #include <TMatrixTSym.h> // for TMatrixTSym
16 #include <TVectorDfwd.h> // for TVectorD
17 #include <TVectorT.h> // for TVectorT
18 #include <TVector3.h>
19 
20 namespace PHGenFit
21 {
22 void PlanarMeasurement::init(const TVector3& pos, const TVector3& u, const TVector3& v, const double du, const double dv)
23 {
24  int nDim = 2;
25  TVectorD hitCoords(nDim);
26  TMatrixDSym hitCov(nDim);
27 
28  hitCoords(0) = 0;
29  hitCoords(1) = 0;
30 
31  hitCov(0, 0) = du * du;
32  hitCov(1, 1) = dv * dv;
33 
34  genfit::SharedPlanePtr plane(
35  new genfit::DetPlane(pos, u, v));
36 
37  int measurementCounter_ = 0;
38  _measurement = new genfit::PlanarMeasurement(hitCoords, hitCov, -1,
39  measurementCounter_,
40  nullptr);
41 
42  static_cast<genfit::PlanarMeasurement*>(_measurement)->setPlane(plane, measurementCounter_);
43 }
44 
45 PlanarMeasurement::PlanarMeasurement(const TVector3& pos, const TVector3& u, const TVector3& v, const double du, const double dv)
46 {
47  init(pos, u, v, du, dv);
48 }
49 
50 PlanarMeasurement::PlanarMeasurement(const TVector3& pos, const TVector3& n, const double du, const double dv)
51 {
59  TVector3 u = n.Orthogonal();
60  TVector3 v = n.Cross(u);
61  init(pos, u, v, du, dv);
62 }
63 
64 } // namespace PHGenFit