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

#include <PndGemRecoHit.h>

Inheritance diagram for PndGemRecoHit:
GFRecoHitIfc< GFPlanarHitPolicy > GFAbsRecoHit

Public Member Functions

 PndGemRecoHit ()
 
 PndGemRecoHit (PndGemMCPoint *point)
 
 PndGemRecoHit (PndGemHit *hit)
 
virtual ~PndGemRecoHit ()
 
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 Double_t residualScalar (GFAbsTrackRep *stateVector, const TMatrixT< Double_t > &state)
 
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

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

Private Member Functions

 ClassDef (PndGemRecoHit, 1)
 

Static Private Attributes

static const Int_t fNparHitRep = 2
 

Detailed Description

Definition at line 38 of file PndGemRecoHit.h.

Constructor & Destructor Documentation

PndGemRecoHit::PndGemRecoHit ( )

Definition at line 47 of file PndGemRecoHit.cxx.

Referenced by clone().

49 {
50  // fGeoH = new PndGemGeoHandling(gGeoManager);
51 }
static const Int_t fNparHitRep
Definition: PndGemRecoHit.h:64
PndGemRecoHit::PndGemRecoHit ( PndGemMCPoint point)

Definition at line 54 of file PndGemRecoHit.cxx.

References GFAbsRecoHit::fHitCoord, GFAbsRecoHit::fHitCov, GFRecoHitIfc< GFPlanarHitPolicy >::fPolicy, GFPlanarHitPolicy::setDetPlane(), and v.

56 {
57  // std::cout<<" -I- PndGemRecoHit::PndGemRecoHit(PndGemMCPoint*) called."<<std::endl;
58 
59  fHitCoord[0][0] = point->GetX();
60  fHitCoord[1][0] = point->GetY();
61 
62  fHitCov[0][0] = 0.01;
63  fHitCov[1][1] = 0.01;
64 
65  TVector3 o(0.,0.,point->GetZ()),
66  u(1.,0.,0.),
67  v(0.,1.,0.);
68 
70 
71 }
Detector plane genfit geometry class.
Definition: GFDetPlane.h:59
TMatrixT< double > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:76
void setDetPlane(const GFDetPlane &p)
Set physical detector plane. Needs to be called before hit can be used.
__m128 v
Definition: P4_F32vec4.h:4
static const Int_t fNparHitRep
Definition: PndGemRecoHit.h:64
TMatrixT< double > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:79
PndGemRecoHit::PndGemRecoHit ( PndGemHit hit)

Definition at line 105 of file PndGemRecoHit.cxx.

References CAMath::Cos(), Double_t, fGeoFile, GFAbsRecoHit::fHitCoord, GFAbsRecoHit::fHitCov, GFRecoHitIfc< GFPlanarHitPolicy >::fPolicy, PndGemHit::GetDp(), PndGemHit::GetDr(), Pi, GFPlanarHitPolicy::setDetPlane(), CAMath::Sin(), CAMath::Sqrt(), and TString.

107 {
108 
109  // std::cout<<" -I- PndGemRecoHit::PndGemRecoHit(PndGemHit*) called."<<std::endl;
110  // std::cout<<*hit<<std::endl;
111 
112  FairRootManager* ioman = FairRootManager::Instance();
113  TString fGeoFile = ioman->GetInFile()->GetName();
114  // PndGemGeoHandling* fGeoH = new PndGemGeoHandling(fGeoFile.Data());
115  //TString path = fGeoH->GetPath(id);
116 
117  Double_t hitX = hit->GetX(), hitY = hit->GetY();
118  Double_t phiAValue = TMath::ATan(hitX/hitY);
119  if ( hitY < 0 ) phiAValue += TMath::Pi();
120  else if ( hitX < 0 ) phiAValue += 2.*TMath::Pi();
121 
122  TVector3 oo (0.,0.,hit->GetZ()),
123  // uu ( TMath::Cos(phiAValue),TMath::Sin(phiAValue),0),
124  // vv (-TMath::Sin(phiAValue),TMath::Cos(phiAValue),0);
125  uu ( TMath::Sin(phiAValue), TMath::Cos(phiAValue),0),
126  vv ( TMath::Cos(phiAValue),-TMath::Sin(phiAValue),0);
127 
128  fHitCoord[0][0] = TMath::Sqrt(hitX*hitX+hitY*hitY);
129  fHitCoord[1][0] = 0.;
130 
131  fHitCov[0][0] = hit->GetDr()*hit->GetDr();
132  fHitCov[1][1] = hit->GetDp()*hit->GetDp();
133 
134  if ( hit->GetDp() < 1.e-8 ) {
135  uu.SetXYZ (1.,0.,0.);
136  vv.SetXYZ (0.,1.,0.);
137 
138  fHitCoord[0][0] = hitX;
139  fHitCoord[1][0] = hitY;
140 
141  fHitCov[0][0] = hit->GetDx()*hit->GetDx();
142  fHitCov[1][1] = hit->GetDy()*hit->GetDy();
143  }
144 
145  fPolicy.setDetPlane(GFDetPlane(oo,uu,vv));
146  //============================================================================
147 }
Detector plane genfit geometry class.
Definition: GFDetPlane.h:59
TMatrixT< double > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:76
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
static T Sin(const T &x)
Definition: PndCAMath.h:42
void setDetPlane(const GFDetPlane &p)
Set physical detector plane. Needs to be called before hit can be used.
static T Cos(const T &x)
Definition: PndCAMath.h:43
Double_t
Double_t GetDp() const
Definition: PndGemHit.h:76
static const Int_t fNparHitRep
Definition: PndGemRecoHit.h:64
Double_t GetDr() const
Definition: PndGemHit.h:75
TString fGeoFile
Double_t Pi
TMatrixT< double > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:79
PndGemRecoHit::~PndGemRecoHit ( )
virtual

Definition at line 41 of file PndGemRecoHit.cxx.

42 {
43 // if(fGeoH!=0)
44 // delete (fGeoH);
45 }

Member Function Documentation

PndGemRecoHit::ClassDef ( PndGemRecoHit  ,
 
)
private
GFRecoHitIfc< GFPlanarHitPolicy >::ClassDef ( GFRecoHitIfc< GFPlanarHitPolicy ,
 
)
inherited
virtual GFAbsRecoHit* PndGemRecoHit::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 49 of file PndGemRecoHit.h.

References PndGemRecoHit().

49 {return new PndGemRecoHit(*this);};
virtual const GFDetPlane& GFRecoHitIfc< GFPlanarHitPolicy >::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);}
const GFDetPlane & detPlane(GFAbsRecoHit *, const GFAbsTrackRep *)
Returns the physical detector plane.
virtual TMatrixT<double> GFRecoHitIfc< GFPlanarHitPolicy >::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);}
TMatrixT< double > hitCoord(GFAbsRecoHit *, const GFDetPlane &)
Hit coordinates in detector plane.
virtual TMatrixT<double> GFRecoHitIfc< GFPlanarHitPolicy >::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);}
TMatrixT< double > hitCov(GFAbsRecoHit *, const GFDetPlane &)
Hit covariances in detector plane.
TMatrixT< double > PndGemRecoHit::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 151 of file PndGemRecoHit.cxx.

References fNparHitRep.

152 {
153 
154  if (dynamic_cast<const RKTrackRep*>(stateVector) != NULL) {
155  // Uses TrackParP (q/p,v',w',v,w)
156  // coordinates are defined by detplane!
157  TMatrixT<double> HMatrix(2,5);
158 
159  HMatrix[0][0] = 0.;
160  HMatrix[0][1] = 0.;
161  HMatrix[0][2] = 0.;
162  HMatrix[0][3] = 1.;
163  HMatrix[0][4] = 0.;
164 
165  HMatrix[1][0] = 0.;
166  HMatrix[1][1] = 0.;
167  HMatrix[1][2] = 0.;
168  HMatrix[1][3] = 0.;
169  HMatrix[1][4] = 1.;
170 
171  return HMatrix;
172  }
173 
174  // !! TODO I copied this from the DemoRecoHit - check validity!!!
175  if (dynamic_cast<const GeaneTrackRep*>(stateVector) != NULL) {
176  // Uses TrackParP (q/p,v',w',v,w)
177  // coordinates are defined by detplane!
178  TMatrixT<double> HMatrix(fNparHitRep,5);
179 
180  HMatrix[0][0] = 0.;
181  HMatrix[0][1] = 0.;
182  HMatrix[0][2] = 0.;
183  HMatrix[0][3] = 1.;
184  HMatrix[0][4] = 0.;
185 
186  HMatrix[1][0] = 0.;
187  HMatrix[1][1] = 0.;
188  HMatrix[1][2] = 0.;
189  HMatrix[1][3] = 0.;
190  HMatrix[1][4] = 1.;
191  return HMatrix;
192  }
193  else {
194  std::cerr << "DemoRecoHit can only handle state"
195  << " vectors of type GeaneTrackRep -> abort"
196  << std::endl;
197  throw;
198  }
199 
200 }
static const Int_t fNparHitRep
Definition: PndGemRecoHit.h:64
int GFAbsRecoHit::getNparHit ( )
inlineinherited

Definition at line 211 of file GFAbsRecoHit.h.

References GFAbsRecoHit::fNparHit.

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

Reimplemented from GFAbsRecoHit.

Definition at line 96 of file GFRecoHitIfc.h.

96 {return fPolicy.getName();}
const std::string & getName()
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.

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

Definition at line 203 of file PndGemRecoHit.cxx.

205 {
206  throw;
207 }
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
const Int_t PndGemRecoHit::fNparHitRep = 2
staticprivate

Definition at line 64 of file PndGemRecoHit.h.

Referenced by getHMatrix().

GFPlanarHitPolicy GFRecoHitIfc< GFPlanarHitPolicy >::fPolicy
protectedinherited

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