FairRoot/PandaRoot
PndHitRecoHit.cxx
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 // $Id$
4 //
5 // Description:
6 // Implementation of class PndHitRecoHit
7 // see PndHitRecoHit.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 Uni Bonn (application to FairHits)
15 //
16 //-----------------------------------------------------------
17 
18 // C/C++ Headers ----------------------
19 // root Headers ----------------------
20 #include "TMatrixT.h"
21 #include "TMath.h"
22 // Collaborating Class Headers --------
23 #include "GeaneTrackRep.h"
24 // This Class' Header ------------------
25 #include "PndHitRecoHit.h"
26 
27 // Class Member definitions -----------
28 
30 
31 
33 {
34 }
35 
37 : GFRecoHitIfc<GFSpacepointHitPolicy>(fNparHitRep)
38 {
39 }
40 
41 
43 : GFRecoHitIfc<GFSpacepointHitPolicy>(fNparHitRep)
44 {
45  //std::cout<<" -I- PndHitRecoHit::PndHitRecoHit(FairMCPoint*) called."<<std::endl;
46 
47  fHitCoord[0][0] = point->GetX();
48  fHitCoord[1][0] = point->GetY();
49  fHitCoord[2][0] = point->GetZ();
50 
51  // fixed errors on the monte carlo points
52  // we set the covariances to (500 mum)^2 by hand.
53  Double_t sigmasq=0.05*0.05; //cm //TODO: cm is rigt?
54  fHitCov[0][0] = sigmasq;
55  fHitCov[1][1] = sigmasq;
56  fHitCov[2][2] = sigmasq;
57 
58 }
59 
61 : GFRecoHitIfc<GFSpacepointHitPolicy>(fNparHitRep)
62 {
63  // std::cout<<" -I- PndHitRecoHit::PndHitRecoHit(PndSdsHit*) called."<<std::endl;
64 
65  fHitCoord[0][0] = hit->GetX();
66  fHitCoord[1][0] = hit->GetY();
67  fHitCoord[2][0] = hit->GetZ();
68 
69  fHitCov[0][0] = hit->GetDx() * hit->GetDx();
70  fHitCov[1][1] = hit->GetDy() * hit->GetDy();
71  fHitCov[2][2] = hit->GetDz() * hit->GetDz();
72 
73 }
74 //============================================================================
75 
76 
77 
78 TMatrixT<double>
80 {
81 
82  // !! TODO I copied this from the DemoRecoHit - check validity!!!
83  if (dynamic_cast<const GeaneTrackRep*>(stateVector) != NULL) {
84  // Uses TrackParP (q/p,v',w',v,w)
85  // coordinates are defined by detplane!
86  TMatrixT<double> HMatrix(fNparHitRep,5);
87 
88  HMatrix[0][0] = 0.;
89  HMatrix[0][1] = 0.;
90  HMatrix[0][2] = 0.;
91  HMatrix[0][3] = 1.;
92  HMatrix[0][4] = 0.;
93 
94  HMatrix[1][0] = 0.;
95  HMatrix[1][1] = 0.;
96  HMatrix[1][2] = 0.;
97  HMatrix[1][3] = 0.;
98  HMatrix[1][4] = 1.;
99  return HMatrix;
100  }
101  else {
102  std::cerr << "PndHitRecoHit can only handle state"
103  << " vectors of type GeaneTrackRep -> abort"
104  << std::endl;
105  throw;
106  }
107 
108 }
109 
110 Double_t
112  const TMatrixT<Double_t>& /*state*/)
113 {
114  std::cerr<<"PndHitRecoHit::residualScalar() called. Throw exception."<<std::endl;
115  throw;
116 }
117 
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
TMatrixT< double > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:76
A planar (x,y) reco hit & its sensor plane.
Definition: PndHitRecoHit.h:35
static const Int_t fNparHitRep
Definition: PndHitRecoHit.h:61
virtual TMatrixT< double > getHMatrix(const GFAbsTrackRep *stateVector)
Get transformation matrix. Transformation between hit coordinates and track representation coordinate...
Double_t
TClonesArray * point
Definition: anaLmdDigi.C:29
Policy class implementing a space point hit geometry.
ClassImp(PndHitRecoHit)
virtual ~PndHitRecoHit()
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
TMatrixT< double > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:79