FairRoot/PandaRoot
PndGemRecoHit2.cxx
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 // $Id$
4 //
5 // Description:
6 // Implementation of class PndGemRecoHit
7 // see PndGemRecoHit.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 // Radoslaw Karabowicz GSI (conversion to GEM)
16 //
17 //-----------------------------------------------------------
18 
19 // C/C++ Headers ----------------------
20 // root Headers ----------------------
21 #include "TMatrixT.h"
22 #include "TMath.h"
23 // Collaborating Class Headers --------
24 #include "FairMCPoint.h"
25 #include "RKTrackRep.h"
26 #include "PlanarMeasurement.h"
27 // This Class' Header ------------------
28 #include "PndGemRecoHit2.h"
29 #include "PndGemMCPoint.h"
30 #include "PndGemHit.h"
31 //#include "PndGemGeoHandling.h"
32 #include "TGeoManager.h"
33 #include "FairRootManager.h"
34 
35 // Class Member definitions -----------
36 
38 
39 
41 {
42 // if(fGeoH!=0)
43 // delete (fGeoH);
44 }
45 
47  : genfit::PlanarMeasurement(fNparHitRep)
48 {
49  // fGeoH = new PndGemGeoHandling(gGeoManager);
50 }
51 
52 
54  : genfit::PlanarMeasurement(fNparHitRep)
55 {
56  // std::cout<<" -I- PndGemRecoHit::PndGemRecoHit(PndGemMCPoint*) called."<<std::endl;
57 
58  rawHitCoords_[0] = point->GetX();
59  rawHitCoords_[1] = point->GetY();
60 
61  rawHitCov_[0][0] = 0.01;
62  rawHitCov_[1][1] = 0.01;
63 
64  TVector3 o(0.,0.,point->GetZ()),
65  u(1.,0.,0.),
66  v(0.,1.,0.);
67 
68  genfit::SharedPlanePtr plane(new genfit::DetPlane(o,u,v));
69  setPlane(plane);
70 
71 }
72 
73 
75  : genfit::PlanarMeasurement(fNparHitRep)
76 {
77 
78  // std::cout<<" -I- PndGemRecoHit::PndGemRecoHit(PndGemHit*) called."<<std::endl;
79  // std::cout<<*hit<<std::endl;
80 
81 
82  setDetId(candHit->getDetId());
83  setHitId(candHit->getHitId());
84 
85  FairRootManager* ioman = FairRootManager::Instance();
86  TString fGeoFile = ioman->GetInFile()->GetName();
87  // PndGemGeoHandling* fGeoH = new PndGemGeoHandling(fGeoFile.Data());
88  //TString path = fGeoH->GetPath(id);
89 
90  Double_t hitX = hit->GetX(), hitY = hit->GetY();
91  Double_t phiAValue = TMath::ATan(hitX/hitY);
92  if ( hitY < 0 ) phiAValue += TMath::Pi();
93  else if ( hitX < 0 ) phiAValue += 2.*TMath::Pi();
94 
95  TVector3 oo (0.,0.,hit->GetZ()),
96  // uu ( TMath::Cos(phiAValue),TMath::Sin(phiAValue),0),
97  // vv (-TMath::Sin(phiAValue),TMath::Cos(phiAValue),0);
98  uu ( TMath::Sin(phiAValue), TMath::Cos(phiAValue),0),
99  vv ( TMath::Cos(phiAValue),-TMath::Sin(phiAValue),0);
100 
101  rawHitCoords_[0] = TMath::Sqrt(hitX*hitX+hitY*hitY);
102  rawHitCoords_[1] = 0.;
103 
104  rawHitCov_[0][0] = hit->GetDr()*hit->GetDr();
105  rawHitCov_[1][1] = hit->GetDp()*hit->GetDp();
106 
107  genfit::SharedPlanePtr plane(new genfit::DetPlane(oo,uu,vv));
108  setPlane(plane, candHit->getPlaneId());
109  //============================================================================
110 }
111 
112 
int getDetId() const
Definition: TrackCandHit.h:48
int getPlaneId() const
Definition: TrackCandHit.h:50
Detector plane.
Definition: DetPlane.h:61
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
virtual ~PndGemRecoHit2()
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
static T Sin(const T &x)
Definition: PndCAMath.h:42
int getHitId() const
Definition: TrackCandHit.h:49
static T Cos(const T &x)
Definition: PndCAMath.h:43
__m128 v
Definition: P4_F32vec4.h:4
void setDetId(int detId)
Hit object for use in TrackCand. Provides IDs and sorting parameters.
Definition: TrackCandHit.h:34
Double_t
Double_t GetDp() const
Definition: PndGemHit.h:76
void setHitId(int hitId)
ClassImp(PndAnaContFact)
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t GetDr() const
Definition: PndGemHit.h:75
TString fGeoFile
Double_t Pi
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72
virtual void setPlane(const SharedPlanePtr &physicalPlane, int planeId=-1)