FairRoot/PandaRoot
PndHypRecoSPHit.cxx
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 // $Id$
4 //
5 // Description:
6 // Implementation of class DemoSPHit
7 // see DemoSPHit.hh for details
8 //
9 // Environment:
10 // Software developed for the PANDA Detector at FAIR.
11 //
12 // Author List:
13 // Sebastian Neubert TUM (original author)
14 //
15 // modified for hyp purpose by A.sanchez
16 //-----------------------------------------------------------
17 
18 // Panda Headers ----------------------
19 
20 // This Class' Header ------------------
21 #include "PndHypRecoSPHit.h"
22 
23 // C/C++ Headers ----------------------
24 #include <assert.h>
25 
26 // Collaborating Class Headers --------
27 #include "FairMCPoint.h"
28 #include "FairHit.h"
29 #include "LSLTrackRep.h"
30 #include "GeaneTrackRep.h"
31 //#include "DetPlane.h"
32 #include "PndHypHit.h"
33 // Class Member definitions -----------
34 
36 
37 
39 {}
40 
42  : SpacepointRecoHit(NparHitRep)
43 {}
44 
45 PndHypRecoSPHit::PndHypRecoSPHit(double x, double y, double z,
46  double sigx, double sigy, double sigz)
47  : SpacepointRecoHit(NparHitRep)
48 {
49  fHitCoord[0][0] = x;
50  fHitCoord[1][0] = y;
51  fHitCoord[2][0] = z;
52 
53  fHitCov[0][0] = sigx*sigx;
54  fHitCov[1][1] = sigy*sigy;
55  fHitCov[2][2] = sigz*sigz;
56 }
57 
59  const TVector3& sig)
60  : SpacepointRecoHit(NparHitRep)
61 {
62  fHitCoord[0][0] = pos.X();
63  fHitCoord[1][0] = pos.Y();
64  fHitCoord[2][0] = pos.Z();
65  fHitCov[0][0] = sig.X()*sig.X();
66  fHitCov[1][1] = sig.Y()*sig.Y();
67  fHitCov[2][2] = sig.Z()*sig.Z();
68 
69 }
70 
72  : SpacepointRecoHit(NparHitRep)
73 {
74  fHitCoord[0][0] = point->GetX();
75  fHitCoord[1][0] = point->GetY();
76  fHitCoord[2][0] = point->GetZ();
77  // fixed errors on the monte carlo points
78  fHitCov[0][0] = 0.5;
79  fHitCov[1][1] = 0.5;
80  fHitCov[2][2] = 0.5;
81 }
82 
83 
86  return new PndHypRecoSPHit(*this);
87 }
88 
89 
90 TMatrixT<double>
92 {
93  assert(stateVector!=NULL);
94  if (dynamic_cast<const GeaneTrackRep*>(stateVector) != NULL) {
95  // Uses TrackParP (q/p,v',w',v,w)
96  // coordinates are defined by detplane!
97  TMatrixT<double> HMatrix(2,5);
98 
99  HMatrix[0][0] = 0.;
100  HMatrix[0][1] = 0.;
101  HMatrix[0][2] = 0.;
102  HMatrix[0][3] = 1.;
103  HMatrix[0][4] = 0.;
104 
105  HMatrix[1][0] = 0.;
106  HMatrix[1][1] = 0.;
107  HMatrix[1][2] = 0.;
108  HMatrix[1][3] = 0.;
109  HMatrix[1][4] = 1.;
110  return HMatrix;
111  }
112  else if (dynamic_cast<const LSLTrackRep*>(stateVector) != NULL) {
113  // Uses TrackParP (u,v,u',v',q/p)
114  // coordinates are defined by detplane!
115  TMatrixT<double> HMatrix(2,5);
116 
117  HMatrix[0][0] = 1.;
118  HMatrix[0][1] = 0.;
119  HMatrix[0][2] = 0.;
120  HMatrix[0][3] = 0.;
121  HMatrix[0][4] = 0.;
122 
123  HMatrix[1][0] = 0.;
124  HMatrix[1][1] = 1.;
125  HMatrix[1][2] = 0.;
126  HMatrix[1][3] = 0.;
127  HMatrix[1][4] = 0.;
128  return HMatrix;
129  }
130  else {
131  std::cerr << "PndHypRecoSPHit can only handle state"
132  << " vectors of type GeaneTrackRep or LSLTrackRep-> abort"
133  << std::endl;
134  throw;
135  }
136 
137 }
138 
139 
TVector3 pos
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:80
TMatrixT< double > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:76
ClassImp(PndHypRecoSPHit) PndHypRecoSPHit
virtual TMatrixT< double > getHMatrix(const GFAbsTrackRep *stateVector)
Get transformation matrix. Transformation between hit coordinates and track representation coordinate...
TClonesArray * point
Definition: anaLmdDigi.C:29
Double_t z
Base Class for representing a Hit in GENFIT.
Definition: GFAbsRecoHit.h:73
Double_t x
virtual GFAbsRecoHit * clone()
Get clone of this object.
Double_t y
TMatrixT< double > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:79