EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PndHitRecoHit.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PndHitRecoHit.cxx
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 "LSLTrackRep.h"
24 #include "GeaneTrackRep.h"
25 // This Class' Header ------------------
26 #include "PndHitRecoHit.h"
27 
28 // Class Member definitions -----------
29 
31 
32 
34 {
35 }
36 
38 : GFRecoHitIfc<GFSpacepointHitPolicy>(fNparHitRep)
39 {
40 }
41 
42 
44 : GFRecoHitIfc<GFSpacepointHitPolicy>(fNparHitRep)
45 {
46  //std::cout<<" -I- PndHitRecoHit::PndHitRecoHit(FairMCPoint*) called."<<std::endl;
47 
48  fHitCoord[0][0] = point->GetX();
49  fHitCoord[1][0] = point->GetY();
50  fHitCoord[2][0] = point->GetZ();
51 
52  // fixed errors on the monte carlo points
53  // we set the covariances to (500 mum)^2 by hand.
54  Double_t sigmasq=0.05*0.05; //cm //TODO: cm is rigt?
55  fHitCov[0][0] = sigmasq;
56  fHitCov[1][1] = sigmasq;
57  fHitCov[2][2] = sigmasq;
58 
59 }
60 
62 : GFRecoHitIfc<GFSpacepointHitPolicy>(fNparHitRep)
63 {
64  // std::cout<<" -I- PndHitRecoHit::PndHitRecoHit(PndSdsHit*) called."<<std::endl;
65 
66  fHitCoord[0][0] = hit->GetX();
67  fHitCoord[1][0] = hit->GetY();
68  fHitCoord[2][0] = hit->GetZ();
69 
70  fHitCov[0][0] = hit->GetDx() * hit->GetDx();
71  fHitCov[1][1] = hit->GetDy() * hit->GetDy();
72  fHitCov[2][2] = hit->GetDz() * hit->GetDz();
73 
74 }
75 //============================================================================
76 
77 
78 
79 TMatrixT<double>
81 {
82 
83  // !! TODO I copied this from the DemoRecoHit - check validity!!!
84  if (dynamic_cast<const GeaneTrackRep*>(stateVector) != NULL) {
85  // Uses TrackParP (q/p,v',w',v,w)
86  // coordinates are defined by detplane!
87  TMatrixT<double> HMatrix(fNparHitRep,5);
88 
89  HMatrix[0][0] = 0.;
90  HMatrix[0][1] = 0.;
91  HMatrix[0][2] = 0.;
92  HMatrix[0][3] = 1.;
93  HMatrix[0][4] = 0.;
94 
95  HMatrix[1][0] = 0.;
96  HMatrix[1][1] = 0.;
97  HMatrix[1][2] = 0.;
98  HMatrix[1][3] = 0.;
99  HMatrix[1][4] = 1.;
100  return HMatrix;
101  }
102  else if (dynamic_cast<const LSLTrackRep*>(stateVector) != NULL) {
103  // LSLTrackRep (x,y,x',y',q/p) recohits are (Xloc,Yloc,0.)
104  // The virtual detector plane in LSL is perpendicular to Zlab
105  TMatrixT<double> HMatrix(fNparHitRep,5);
106  HMatrix[0][0] = 1.;
107  HMatrix[0][1] = 0.;
108  HMatrix[0][2] = 0.;
109  HMatrix[0][3] = 0.;
110  HMatrix[0][4] = 0.;
111 
112  HMatrix[1][0] = 0.;
113  HMatrix[1][1] = 1.;
114  HMatrix[1][2] = 0.;
115  HMatrix[1][3] = 0.;
116  HMatrix[1][4] = 0.;
117  return HMatrix;
118  }
119  else {
120  std::cerr << "PndHitRecoHit can only handle state"
121  << " vectors of type LSLTrackRep or GeaneTrackRep -> abort"
122  << std::endl;
123  throw;
124  }
125 
126 }
127 
128 Double_t
130  const TMatrixT<Double_t>& state)
131 {
132  std::cerr<<"PndHitRecoHit::residualScalar() called. Throw exception."<<std::endl;
133  throw;
134 }
135