FairRoot/PandaRoot
PndMdtRecoHit.cxx
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 // $Id$
4 //
5 // Description:
6 // Implementation of class PndMdtRecoHit
7 // see PndMdtRecoHit.h 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 // Stefano Spataro UNITO (adapted for MDT)
15 //
16 //
17 //-----------------------------------------------------------
18 
19 // Panda Headers ----------------------
20 
21 // This Class' Header ------------------
22 #include "PndMdtRecoHit.h"
23 
24 // C/C++ Headers ----------------------
25 #include <assert.h>
26 
27 // Collaborating Class Headers --------
28 #include "PndMdtPoint.h"
29 #include "PndMdtHit.h"
30 #include "GeaneTrackRep.h"
31 
32 // Class Member definitions -----------
33 
35 
36 TRandom3 PndMdtRecoHit::rand(0);
37 
39 {}
40 
42  : SpacepointRecoHit(NparHitRep), fHit(NULL)
43 {}
44 
45 PndMdtRecoHit::PndMdtRecoHit(double x, double y, double z,
46  double sigx, double sigy, double sigz)
47  : SpacepointRecoHit(NparHitRep), fHit(NULL)
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  bool smear)
61  : SpacepointRecoHit(NparHitRep), fHit(NULL)
62 {
63  if(!smear){
64  fHitCoord[0][0] = pos.X();
65  fHitCoord[1][0] = pos.Y();
66  fHitCoord[2][0] = pos.Z();
67  }
68  else{
69  fHitCoord[0][0] = rand.Gaus(pos.X(),sig.X());
70  fHitCoord[1][0] = rand.Gaus(pos.Y(),sig.Y());
71  fHitCoord[2][0] = rand.Gaus(pos.Z(),sig.Z());
72  }
73  fHitCov[0][0] = sig.X()*sig.X();
74  fHitCov[1][1] = sig.Y()*sig.Y();
75  fHitCov[2][2] = sig.Z()*sig.Z();
76 
77 }
78 
80  : SpacepointRecoHit(NparHitRep),fHit(NULL)
81 {
82  fHitCoord[0][0] = point->GetX();
83  fHitCoord[1][0] = point->GetY();
84  fHitCoord[2][0] = point->GetZ();
85  // fixed errors on the monte carlo points
86  fHitCov[0][0] = 0.5;
87  fHitCov[1][1] = 0.5;
88  fHitCov[2][2] = 0.5;
89 }
90 
92  : SpacepointRecoHit(NparHitRep)
93 {
94  TVector3 hitpos(0,0,0);
95  hit->Position(hitpos);
96  fHitCoord[0][0] = hitpos.X();
97  fHitCoord[1][0] = hitpos.Y();
98  fHitCoord[2][0] = hitpos.Z();
99 
100  TVector3 sig(0,0,0);
101  hit->PositionError(sig);
102  fHitCov[0][0] = sig.X()*sig.X();
103  fHitCov[1][1] = sig.Y()*sig.Y();
104  fHitCov[2][2] = sig.Z()*sig.Z();
105 
106  fHit = hit;
107 }
108 
109 
110 GFAbsRecoHit*
112  return new PndMdtRecoHit(*this);
113 }
114 
115 
116 TMatrixT<double>
118 {
119  assert(stateVector!=NULL);
120  if (dynamic_cast<const GeaneTrackRep*>(stateVector) != NULL) {
121  // Uses TrackParP (q/p,v',w',v,w)
122  // coordinates are defined by detplane!
123  TMatrixT<double> HMatrix(2,5);
124 
125  HMatrix[0][0] = 0.;
126  HMatrix[0][1] = 0.;
127  HMatrix[0][2] = 0.;
128  HMatrix[0][3] = 1.;
129  HMatrix[0][4] = 0.;
130 
131  HMatrix[1][0] = 0.;
132  HMatrix[1][1] = 0.;
133  HMatrix[1][2] = 0.;
134  HMatrix[1][3] = 0.;
135  HMatrix[1][4] = 1.;
136  return HMatrix;
137  }
138  else {
139  std::cerr << "PndMdtRecoHit can only handle state"
140  << " vectors of type GeaneTrackRep-> abort"
141  << std::endl;
142  throw;
143  }
144 
145 }
146 
147 
TVector3 pos
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:80
TRandom1 rand
Definition: RiemannTest.C:20
RecoHit interface template class. Provides comfortable interface to create RecoHits.
Definition: GFRecoHitIfc.h:60
TMatrixT< double > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:76
PndMdtHit * fHit
Definition: PndMdtRecoHit.h:66
virtual GFAbsRecoHit * clone()
Get clone of this object.
Double_t z
Base Class for representing a Hit in GENFIT.
Definition: GFAbsRecoHit.h:73
virtual TMatrixT< double > getHMatrix(const GFAbsTrackRep *stateVector)
Get transformation matrix. Transformation between hit coordinates and track representation coordinate...
static TRandom3 rand
Definition: PndMdtRecoHit.h:67
Double_t x
ClassImp(PndAnaContFact)
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t y
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72
TMatrixT< double > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:79