FairRoot/PandaRoot
PndHypRecoHit.cxx
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 // $Id$
4 //
5 // Description:
6 // Implementation of class PndSdsRecoHit
7 // see PndSdsRecoHit.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 // Ralf Kliemt TUD (application to PndMvd)
15 //
16 //-----------------------------------------------------------
17 
18 // C/C++ Headers ----------------------
19 // root Headers ----------------------
20 
21 //-----------------------------------------------------------
22 // File and Version Information:
23 // $Id$
24 //
25 // Description:
26 // Implementation of class PndSdsRecoHit
27 // see PndSdsRecoHit.h for details
28 //
29 // Environment:
30 // Software developed for the PANDA Detector at FAIR.
31 //
32 // Author List:
33 // Sebastian Neubert TUM (original author)
34 // Ralf Kliemt TUD (application to PndMvd)
35 //
36 //-----------------------------------------------------------
37 
38 // C/C++ Headers ----------------------
39 // root Headers ----------------------
40 #include "TMatrixT.h"
41 #include "TMath.h"
42 // Collaborating Class Headers --------
43 #include "FairMCPoint.h"
44 #include "LSLTrackRep.h"
45 #include "GeaneTrackRep.h"
46 #include "GFDetPlane.h"
47 // This Class' Header ------------------
48 #include "PndHypRecoHit.h"
49 #include "PndHypPoint.h"
50 #include "PndHypHit.h"
51 #include "PndHypHit.h"
52 #include "PndHypGeoHandling.h"
53 #include "FairRootManager.h"
54 // Class Member definitions -----------
55 
57 
58 
60 {
61  if(fGeoH!=0) delete (fGeoH);
62 }
63 
65  : GFRecoHitIfc<GFPlanarHitPolicy>(fNparHitRep)
66 {
68 }
69 
70 
72  : GFRecoHitIfc<GFPlanarHitPolicy>(fNparHitRep)
73 {
74  std::cout<<" -I- PndHypRecoHit::PndHypRecoHit(PndHypMCPoint*) called."<<std::endl;
75 
76 
77  fHitCoord[0][0] = point->GetX();
78  fHitCoord[1][0] = point->GetY();
79 
80  fHitCov[0][0] = 0.01;//cost*sigx*sigx;
81  fHitCov[1][1] = 0.01;//cost*sigy*sigy;
82 
83  TVector3 o(0.,0.,point->GetZ()),
84  u(1.,0.,0.),
85  v(0.,1.,0.);
86 
88 
89 }
90 
92  : GFRecoHitIfc<GFPlanarHitPolicy>(fNparHitRep)
93 {
94 
95  //std::cout<<" -I- PndHypRecoHit::PndHypRecoHit(PndHypHit*) called."<<std::endl;
96  //std::cout<<*hit<<std::endl;
97 
98  TString id = hit->GetDetName();
99 
100  FairRootManager* ioman = FairRootManager::Instance();
101  TString fGeoFile = ioman->GetInFile()->GetName();
102  fGeoH = new PndHypGeoHandling(fGeoFile.Data());
103 
104  TVector3 oo, uu, vv;
105  fGeoH->GetOUVId(id, oo,uu,vv);
106 
107  TVector3 position = hit->GetPosition();
108  TVector3 localpos = fGeoH->MasterToLocalId(position, id);
109 
110  fHitCoord[0][0] = localpos.X();
111  fHitCoord[1][0] = localpos.Y();
112 
113  fHitCov[0][0] = 0.0050 * 0.0050;
114  fHitCov[1][1] = 0.0050 * 0.0050;
115 
116  fPolicy.setDetPlane(GFDetPlane(oo,uu,vv));
117 
118 
119 }
120 
121 
122 TMatrixT<double>
124 {
125 
126  // !! TODO I copied this from the DemoRecoHit - check validity!!!
127  if (dynamic_cast<const GeaneTrackRep*>(stateVector) != NULL) {
128  // Uses TrackParP (q/p,v',w',v,w)
129  // coordinates are defined by detplane!
130  TMatrixT<double> HMatrix(fNparHitRep,5);
131 
132  HMatrix[0][0] = 0.;
133  HMatrix[0][1] = 0.;
134  HMatrix[0][2] = 0.;
135  HMatrix[0][3] = 1.;
136  HMatrix[0][4] = 0.;
137 
138  HMatrix[1][0] = 0.;
139  HMatrix[1][1] = 0.;
140  HMatrix[1][2] = 0.;
141  HMatrix[1][3] = 0.;
142  HMatrix[1][4] = 1.;
143  return HMatrix;
144  }
145  else if (dynamic_cast<const LSLTrackRep*>(stateVector) != NULL) {
146  // LSLTrackRep (x,y,x',y',q/p)
147  TMatrixT<double> HMatrix(fNparHitRep,5);
148 
149 
150 
151  HMatrix[0][0] = 1.;
152  HMatrix[0][1] = 0.;
153  HMatrix[0][2] = 0.;
154  HMatrix[0][3] = 0.;
155  HMatrix[0][4] = 0.;
156 
157  HMatrix[1][0] = 0.;
158  HMatrix[1][1] = 1.;
159  HMatrix[1][2] = 0.;
160  HMatrix[1][3] = 0.;
161  HMatrix[1][4] = 0.;
162  return HMatrix;
163 
164  }
165  else {
166  std::cerr << "DemoRecoHit can only handle state"
167  << " vectors of type LSLTrackRep or GeaneTrackRep -> abort"
168  << std::endl;
169  throw;
170  }
171 
172 }
173 
174 Double_t
176  const TMatrixT<Double_t>& state)
177 {
178  throw;
179 }
180 
181 
182 
virtual Double_t residualScalar(GFAbsTrackRep *stateVector, const TMatrixT< Double_t > &state)
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:80
RecoHit interface template class. Provides comfortable interface to create RecoHits.
Definition: GFRecoHitIfc.h:60
Detector plane genfit geometry class.
Definition: GFDetPlane.h:59
TVector3 GetPosition() const
Definition: PndHypHit.h:87
TMatrixT< double > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:76
void setDetPlane(const GFDetPlane &p)
Set physical detector plane. Needs to be called before hit can be used.
void GetOUVId(TString id, TVector3 &o, TVector3 &u, TVector3 &v)
for a volume given by its ID the o, u, v vectors for the plane are returned
Class to access the naming information of the MVD.
TGeoManager * gGeoManager
__m128 v
Definition: P4_F32vec4.h:4
TString GetDetName() const
Definition: PndHypHit.h:83
Double_t
virtual ~PndHypRecoHit()
virtual TMatrixT< double > getHMatrix(const GFAbsTrackRep *stateVector)
Get transformation matrix. Transformation between hit coordinates and track representation coordinate...
Policy class implementing a planar hit geometry.
TVector3 MasterToLocalId(const TVector3 &master, const TString &id)
ClassImp(PndAnaContFact)
static const Int_t fNparHitRep
Definition: PndHypRecoHit.h:73
PndSdsMCPoint * hit
Definition: anasim.C:70
TString fGeoFile
PndHypGeoHandling * fGeoH
Definition: PndHypRecoHit.h:74
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72
TMatrixT< double > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:79