FairRoot/PandaRoot
PndMdtRecoHit2.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 "PndMdtRecoHit2.h"
23 
24 // C/C++ Headers ----------------------
25 #include <assert.h>
26 
27 // Collaborating Class Headers --------
28 #include "PndMdtPoint.h"
29 #include "PndMdtHit.h"
30 
31 // Class Member definitions -----------
32 
34 
35 TRandom3 PndMdtRecoHit2::rand(0);
36 
38 {}
39 
41  : genfit::SpacepointMeasurement(NparHitRep), fHit(NULL)
42 {}
43 
44 PndMdtRecoHit2::PndMdtRecoHit2(double x, double y, double z,
45  double sigx, double sigy, double sigz)
46  : genfit::SpacepointMeasurement(NparHitRep), fHit(NULL)
47 {
48  rawHitCoords_[0] = x;
49  rawHitCoords_[1] = y;
50  rawHitCoords_[2] = z;
51 
52  rawHitCov_[0][0] = sigx*sigx;
53  rawHitCov_[1][1] = sigy*sigy;
54  rawHitCov_[2][2] = sigz*sigz;
55 }
56 
58  const TVector3& sig,
59  bool smear)
60  : genfit::SpacepointMeasurement(NparHitRep), fHit(NULL)
61 {
62  if(!smear){
63  rawHitCoords_[0] = pos.X();
64  rawHitCoords_[1] = pos.Y();
65  rawHitCoords_[2] = pos.Z();
66  }
67  else{
68  rawHitCoords_[0] = rand.Gaus(pos.X(),sig.X());
69  rawHitCoords_[1] = rand.Gaus(pos.Y(),sig.Y());
70  rawHitCoords_[2] = rand.Gaus(pos.Z(),sig.Z());
71  }
72  rawHitCov_[0][0] = sig.X()*sig.X();
73  rawHitCov_[1][1] = sig.Y()*sig.Y();
74  rawHitCov_[2][2] = sig.Z()*sig.Z();
75 
76 }
77 
79  : genfit::SpacepointMeasurement(NparHitRep),fHit(NULL)
80 {
81  rawHitCoords_[0] = point->GetX();
82  rawHitCoords_[1] = point->GetY();
83  rawHitCoords_[2] = point->GetZ();
84  // fixed errors on the monte carlo points
85  rawHitCov_[0][0] = 0.5;
86  rawHitCov_[1][1] = 0.5;
87  rawHitCov_[2][2] = 0.5;
88 }
89 
91  : genfit::SpacepointMeasurement(NparHitRep)
92 {
93  setDetId(candHit->getDetId());
94  setHitId(candHit->getHitId());
95 
96  TVector3 hitpos(0,0,0);
97  hit->Position(hitpos);
98  rawHitCoords_[0] = hitpos.X();
99  rawHitCoords_[1] = hitpos.Y();
100  rawHitCoords_[2] = hitpos.Z();
101 
102  TVector3 sig(0,0,0);
103  hit->PositionError(sig);
104  rawHitCov_[0][0] = sig.X()*sig.X();
105  rawHitCov_[1][1] = sig.Y()*sig.Y();
106  rawHitCov_[2][2] = sig.Z()*sig.Z();
107 
108  fHit = hit;
109 }
110 
int getDetId() const
Definition: TrackCandHit.h:48
TVector3 pos
TRandom1 rand
Definition: RiemannTest.C:20
int getHitId() const
Definition: TrackCandHit.h:49
void setDetId(int detId)
PndMdtHit * fHit
Hit object for use in TrackCand. Provides IDs and sorting parameters.
Definition: TrackCandHit.h:34
Double_t z
void setHitId(int hitId)
Double_t x
static TRandom3 rand
ClassImp(PndAnaContFact)
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t y
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72