FairRoot/PandaRoot
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
PndSttRecoHit Class Reference

#include <PndSttRecoHit.h>

Inheritance diagram for PndSttRecoHit:
GFRecoHitIfc< HitPolicy > GFAbsRecoHit

Public Member Functions

 PndSttRecoHit ()
 
 PndSttRecoHit (PndSttHit *currenthit)
 
 PndSttRecoHit (PndSttHit *currenthit, TClonesArray *tubeArr)
 
virtual ~PndSttRecoHit ()
 
virtual GFAbsRecoHitclone ()
 Get clone of this object. More...
 
virtual TMatrixT< double > getHMatrix (const GFAbsTrackRep *stateVector)
 Get transformation matrix. Transformation between hit coordinates and track representation coordinates. More...
 
virtual const GFDetPlanegetDetPlane (GFAbsTrackRep *rep)
 Returns the detector plane object for this hit and a given track representation. More...
 
virtual TMatrixT< double > getHitCoord (const GFDetPlane &plane)
 Get hit coordinates in a specific detector plane. More...
 
virtual TMatrixT< double > getHitCov (const GFDetPlane &plane)
 Get hit covariances in a specific detector plane. More...
 
const std::string & getPolicyName ()
 
 ClassDef (GFRecoHitIfc, 1)
 
virtual TMatrixT< double > residualVector (const GFAbsTrackRep *stateVector, const TMatrixT< double > &state, const GFDetPlane &d)
 Calculate residual with respect to a track representation. More...
 
TMatrixT< double > getRawHitCov () const
 Get raw hit covariances. More...
 
TMatrixT< double > getRawHitCoord () const
 Get raw hit coordinates. More...
 
virtual void Print ()
 Print raw hit coordinates. More...
 
int getNparHit ()
 

Protected Attributes

HitPolicy fPolicy
 
TMatrixT< double > fHitCoord
 Vector of raw coordinates of hit. More...
 
TMatrixT< double > fHitCov
 Covariance of raw hit coordinates. More...
 

Static Protected Attributes

static const int NparHitRep = 7
 

Detailed Description

Definition at line 19 of file PndSttRecoHit.h.

Constructor & Destructor Documentation

PndSttRecoHit::PndSttRecoHit ( )

Definition at line 43 of file PndSttRecoHit.cxx.

Referenced by clone().

45 {
46 
47 }
static const int NparHitRep
Definition: PndSttRecoHit.h:39
GFRecoHitIfc< GFWireHitPolicy > WireHitRecoHit
Definition: PndFtsRecoHit.h:15
PndSttRecoHit::PndSttRecoHit ( PndSttHit currenthit)

Definition at line 50 of file PndSttRecoHit.cxx.

References GFAbsRecoHit::fHitCoord, GFAbsRecoHit::fHitCov, GFRecoHitIfc< HitPolicy >::fPolicy, PndSttTube::GetHalfLength(), PndSttHit::GetIsochrone(), PndSttHit::GetIsochroneError(), PndSttTube::GetPosition(), PndSttMapCreator::GetTubeFromTubeID(), PndSttHit::GetTubeID(), PndSttTube::GetWireDirection(), i, NparHitRep, and rtdb.

51 
52  FairRuntimeDb* rtdb = FairRunAna::Instance()->GetRuntimeDb();
53  PndGeoSttPar *sttParameters = (PndGeoSttPar*) rtdb->getContainer("PndGeoSttPar");
54  Int_t tubeID = currenthit->GetTubeID();
55  PndSttMapCreator *mapper = new PndSttMapCreator(sttParameters);
56  PndSttTube *tube = (PndSttTube*) mapper->GetTubeFromTubeID(tubeID);
57 
58  // wire1(3), wire2(3), rdrift
59  TVector3 wiredirection = tube->GetWireDirection();
60  TVector3 wiredirection2 = tube->GetHalfLength() * wiredirection;
61  TVector3 cenposition = tube->GetPosition();
62  TVector3 wire1, wire2;
63  wire1 = cenposition - wiredirection2;
64  wire2 = cenposition + wiredirection2;
65  // cout << "Wiredirection, wire1, wire2 " << endl;
66  // wiredirection.Print();
67  // wire1.Print();
68  // wire2.Print();
69  fHitCoord[0][0] = wire1.X();
70  fHitCoord[1][0] = wire1.Y();
71  fHitCoord[2][0] = wire1.Z();
72  fHitCoord[3][0] = wire2.X();
73  fHitCoord[4][0] = wire2.Y();
74  fHitCoord[5][0] = wire2.Z();
75  fHitCoord[6][0] = currenthit->GetIsochrone();
76 
77  // errors on drift radius
78  for(int i = 0; i < NparHitRep; i++) for(int j = 0; j < NparHitRep; j++) fHitCov[i][j] = 0.;
79  // fHitCov[6][6] = 0.0100 * 0.0100;
80  fHitCov[6][6] = pow(currenthit->GetIsochroneError(), 2);
81 
82  // cut on distance
83  fPolicy.setMaxDistance(0.5);
84 }
Int_t i
Definition: run_full.C:25
Double_t GetHalfLength()
Definition: PndSttTube.cxx:99
TMatrixT< double > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:76
static const int NparHitRep
Definition: PndSttRecoHit.h:39
GFRecoHitIfc< GFWireHitPolicy > WireHitRecoHit
Definition: PndFtsRecoHit.h:15
PndSttTube * GetTubeFromTubeID(Int_t tubeid)
HitPolicy fPolicy
Definition: GFRecoHitIfc.h:62
Double_t GetIsochrone() const
Definition: PndSttHit.h:62
TVector3 GetPosition()
Definition: PndSttTube.cxx:87
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
Int_t GetTubeID() const
Definition: PndSttHit.h:75
Double_t GetIsochroneError() const
Definition: PndSttHit.h:63
TVector3 GetWireDirection()
Definition: PndSttTube.cxx:107
TMatrixT< double > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:79
PndSttRecoHit::PndSttRecoHit ( PndSttHit currenthit,
TClonesArray *  tubeArr 
)

Definition at line 87 of file PndSttRecoHit.cxx.

References GFAbsRecoHit::fHitCoord, GFAbsRecoHit::fHitCov, GFRecoHitIfc< HitPolicy >::fPolicy, PndSttTube::GetHalfLength(), PndSttHit::GetIsochrone(), PndSttHit::GetIsochroneError(), PndSttTube::GetPosition(), PndSttHit::GetTubeID(), PndSttTube::GetWireDirection(), i, and NparHitRep.

88 
89  Int_t tubeID = currenthit->GetTubeID();
90  PndSttTube *tube = (PndSttTube *) tubeArray->At(tubeID);
91 
92  // wire1(3), wire2(3), rdrift
93  TVector3 wiredirection = tube->GetWireDirection();
94  TVector3 wiredirection2 = tube->GetHalfLength() * wiredirection;
95  TVector3 cenposition = tube->GetPosition();
96  TVector3 wire1, wire2;
97  wire1 = cenposition - wiredirection2;
98  wire2 = cenposition + wiredirection2;
99  // cout << "Wiredirection, wire1, wire2 " << endl;
100  // wiredirection.Print();
101  // wire1.Print();
102  // wire2.Print();
103  fHitCoord[0][0] = wire1.X();
104  fHitCoord[1][0] = wire1.Y();
105  fHitCoord[2][0] = wire1.Z();
106  fHitCoord[3][0] = wire2.X();
107  fHitCoord[4][0] = wire2.Y();
108  fHitCoord[5][0] = wire2.Z();
109  fHitCoord[6][0] = currenthit->GetIsochrone();
110 
111  // errors on drift radius
112  for(int i = 0; i < NparHitRep; i++) for(int j = 0; j < NparHitRep; j++) fHitCov[i][j] = 0.;
113  // fHitCov[6][6] = 0.0100 * 0.0100;
114  fHitCov[6][6] = pow(currenthit->GetIsochroneError(), 2);
115 
116  // cut on distance
117  fPolicy.setMaxDistance(0.5);
118 }
Int_t i
Definition: run_full.C:25
Double_t GetHalfLength()
Definition: PndSttTube.cxx:99
TMatrixT< double > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:76
static const int NparHitRep
Definition: PndSttRecoHit.h:39
GFRecoHitIfc< GFWireHitPolicy > WireHitRecoHit
Definition: PndFtsRecoHit.h:15
HitPolicy fPolicy
Definition: GFRecoHitIfc.h:62
Double_t GetIsochrone() const
Definition: PndSttHit.h:62
TVector3 GetPosition()
Definition: PndSttTube.cxx:87
Int_t GetTubeID() const
Definition: PndSttHit.h:75
Double_t GetIsochroneError() const
Definition: PndSttHit.h:63
TVector3 GetWireDirection()
Definition: PndSttTube.cxx:107
TMatrixT< double > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:79
PndSttRecoHit::~PndSttRecoHit ( )
virtual

Definition at line 40 of file PndSttRecoHit.cxx.

41 {}

Member Function Documentation

template<class HitPolicy>
GFRecoHitIfc< HitPolicy >::ClassDef ( GFRecoHitIfc< HitPolicy >  ,
 
)
inherited
virtual GFAbsRecoHit* PndSttRecoHit::clone ( )
inlinevirtual

Get clone of this object.

Virtual abstract method. Has to be implemented by inherting classes. Creates a deep copy of this object. Ownership is trandsferred to the caller!

Implements GFAbsRecoHit.

Definition at line 29 of file PndSttRecoHit.h.

References PndSttRecoHit().

29 {return new PndSttRecoHit(*this);};
template<class HitPolicy>
virtual const GFDetPlane& GFRecoHitIfc< HitPolicy >::getDetPlane ( GFAbsTrackRep rep)
inlinevirtualinherited

Returns the detector plane object for this hit and a given track representation.

The actutal code for this method depends on the hit geometry and is implemented in the HitPolicy

See Also
PlanarHitPolicy
SpacepointHitPolicy
WirepointHitPolicy

Implements GFAbsRecoHit.

Definition at line 80 of file GFRecoHitIfc.h.

80 {return fPolicy.detPlane(this,rep);}
HitPolicy fPolicy
Definition: GFRecoHitIfc.h:62
template<class HitPolicy>
virtual TMatrixT<double> GFRecoHitIfc< HitPolicy >::getHitCoord ( const GFDetPlane plane)
inlinevirtualinherited

Get hit coordinates in a specific detector plane.

Implementation in the HitPolicy

Implements GFAbsRecoHit.

Definition at line 86 of file GFRecoHitIfc.h.

87  {return fPolicy.hitCoord(this,plane);}
HitPolicy fPolicy
Definition: GFRecoHitIfc.h:62
template<class HitPolicy>
virtual TMatrixT<double> GFRecoHitIfc< HitPolicy >::getHitCov ( const GFDetPlane plane)
inlinevirtualinherited

Get hit covariances in a specific detector plane.

Implementation in the HitPolicy

Implements GFAbsRecoHit.

Definition at line 93 of file GFRecoHitIfc.h.

94  {return fPolicy.hitCov(this,plane);}
HitPolicy fPolicy
Definition: GFRecoHitIfc.h:62
TMatrixT< double > PndSttRecoHit::getHMatrix ( const GFAbsTrackRep stateVector)
virtual

Get transformation matrix. Transformation between hit coordinates and track representation coordinates.

This is a virtual abstract method which has to be implemented in the child classes.

In general there is a linear transformation between the coordinate system of the hit (which is defined by the detector plane) and the coordinates of the track representation in that plane. In the most simple case the track representation has 5 parameters (space + momentum) while a hit usually has less (one to three space coordinates).

The transformation matrix is then simply projecting out the space-components of the track representation.

Its dimensions are NxM. Where N is the number of dimensions of the hit in the detector plane (usually 2 or 1) and M is the dimension of the track representation.

In this method a hit has to define with which track representations it can work together. It should be the only point where this explicit coordination is necessary.

For example code see implementing classes below:

Implements GFAbsRecoHit.

Definition at line 121 of file PndSttRecoHit.cxx.

122 {
123  if (dynamic_cast<const GeaneTrackRep*>(stateVector) != NULL) {
124  TMatrixT<double> HMatrix(1,5);
125 
126  HMatrix[0][0] = 0.;
127  HMatrix[0][1] = 0.;
128  HMatrix[0][2] = 0.;
129  HMatrix[0][3] = 1.;
130  HMatrix[0][4] = 0.;
131 
132  return HMatrix;
133  }
134  else if (dynamic_cast<const RKTrackRep*>(stateVector) != NULL) { // CHECK this has been added but not tested: if you are not going to use it for testing purposes, please use GeaneTrackRep
135  TMatrixT<double> HMatrix(1,5);
136 
137  HMatrix[0][0] = 0.;
138  HMatrix[0][1] = 0.;
139  HMatrix[0][2] = 0.;
140  HMatrix[0][3] = 1.;
141  HMatrix[0][4] = 0.;
142 
143  return HMatrix;
144  }
145  else {
146  std::cerr << "PndSttRecoHit can only handle state"
147  << " vectors of type GeaneTrackRep -> abort" << std::endl;
148  throw;
149  }
150 
151 }
int GFAbsRecoHit::getNparHit ( )
inlineinherited

Definition at line 211 of file GFAbsRecoHit.h.

References GFAbsRecoHit::fNparHit.

211 {return fNparHit;}
template<class HitPolicy>
const std::string& GFRecoHitIfc< HitPolicy >::getPolicyName ( )
inlinevirtualinherited

Reimplemented from GFAbsRecoHit.

Definition at line 96 of file GFRecoHitIfc.h.

96 {return fPolicy.getName();}
HitPolicy fPolicy
Definition: GFRecoHitIfc.h:62
TMatrixT<double> GFAbsRecoHit::getRawHitCoord ( ) const
inlineinherited
TMatrixT<double> GFAbsRecoHit::getRawHitCov ( ) const
inlineinherited

Get raw hit covariances.

Definition at line 153 of file GFAbsRecoHit.h.

References GFAbsRecoHit::fHitCov.

Referenced by GFTools::getSmoothedChiSqu(), GFWirepointHitPolicy::hitCov(), GFWireHitPolicy::hitCov(), GFSpacepointHitPolicy::hitCov(), and GFPlanarHitPolicy::hitCov().

153 {return fHitCov;}
TMatrixT< double > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:79
virtual void GFAbsRecoHit::Print ( )
inlinevirtualinherited

Print raw hit coordinates.

Definition at line 207 of file GFAbsRecoHit.h.

References GFAbsRecoHit::fHitCoord.

207 {fHitCoord.Print();}
TMatrixT< double > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:76
virtual TMatrixT<double> GFAbsRecoHit::residualVector ( const GFAbsTrackRep stateVector,
const TMatrixT< double > &  state,
const GFDetPlane d 
)
inlinevirtualinherited

Calculate residual with respect to a track representation.

Returns the N-dimensional residual of this vector to a given track representation.

This method is not doing any extrapolation. But it creates the necessary detector plane object. See GFAbsRecoHit::getGFDetPlane

Parameters
stateVectorpointer to track representation - used to synchronize with the track repesentation
stateparameter vector of the track representation
See Also
setHMatrix
getGFDetPlane

Definition at line 142 of file GFAbsRecoHit.h.

References GFAbsRecoHit::getHitCoord(), and GFAbsRecoHit::getHMatrix().

Referenced by GFKalman::getChi2Hit(), GFTrack::getResiduals(), and GFKalman::processHit().

144  {
145  TMatrixT<double> H = getHMatrix(stateVector);
146  return ( getHitCoord(d) - (H*state ));
147  }
virtual TMatrixT< double > getHMatrix(const GFAbsTrackRep *stateVector)=0
Get transformation matrix. Transformation between hit coordinates and track representation coordinate...
virtual TMatrixT< double > getHitCoord(const GFDetPlane &)=0
Get hit coordinates in a specific detector plane.

Member Data Documentation

TMatrixT<double> GFAbsRecoHit::fHitCoord
protectedinherited
TMatrixT<double> GFAbsRecoHit::fHitCov
protectedinherited
template<class HitPolicy>
HitPolicy GFRecoHitIfc< HitPolicy >::fPolicy
protectedinherited
const int PndSttRecoHit::NparHitRep = 7
staticprotected

Definition at line 39 of file PndSttRecoHit.h.

Referenced by PndSttRecoHit().


The documentation for this class was generated from the following files: