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

#include <PndHypRecoHit.h>

Inheritance diagram for PndHypRecoHit:
GFRecoHitIfc< GFPlanarHitPolicy > GFAbsRecoHit

Public Member Functions

 PndHypRecoHit ()
 
 PndHypRecoHit (PndHypPoint *point)
 
 PndHypRecoHit (PndHypHit *hit)
 
virtual ~PndHypRecoHit ()
 
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)
 
 ClassDef (PndHypRecoHit, 1)
 
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 Attributes

PndHypGeoHandlingfGeoH
 

Static Private Attributes

static const Int_t fNparHitRep = 3
 

Detailed Description

Definition at line 41 of file PndHypRecoHit.h.

Constructor & Destructor Documentation

PndHypRecoHit::PndHypRecoHit ( )

Definition at line 64 of file PndHypRecoHit.cxx.

References fGeoH, and gGeoManager.

Referenced by clone().

66 {
68 }
Class to access the naming information of the MVD.
TGeoManager * gGeoManager
static const Int_t fNparHitRep
Definition: PndHypRecoHit.h:73
PndHypGeoHandling * fGeoH
Definition: PndHypRecoHit.h:74
PndHypRecoHit::PndHypRecoHit ( PndHypPoint point)

Definition at line 71 of file PndHypRecoHit.cxx.

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

73 {
74  std::cout<<" -I- PndHypRecoHit::PndHypRecoHit(PndHypMCPoint*) called."<<std::endl;
75 
76 
77  fHitCoord[0][0] = point->GetX();
78  fHitCoord[1][0] = point->GetY();
79 
80  fHitCov[0][0] = 0.01;//cost*sigx*sigx;
81  fHitCov[1][1] = 0.01;//cost*sigy*sigy;
82 
83  TVector3 o(0.,0.,point->GetZ()),
84  u(1.,0.,0.),
85  v(0.,1.,0.);
86 
88 
89 }
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: PndHypRecoHit.h:73
TMatrixT< double > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:79
PndHypRecoHit::PndHypRecoHit ( PndHypHit hit)

Definition at line 91 of file PndHypRecoHit.cxx.

References fGeoFile, fGeoH, GFAbsRecoHit::fHitCoord, GFAbsRecoHit::fHitCov, GFRecoHitIfc< GFPlanarHitPolicy >::fPolicy, PndHypHit::GetDetName(), PndHypGeoHandling::GetOUVId(), PndHypHit::GetPosition(), PndHypGeoHandling::MasterToLocalId(), GFPlanarHitPolicy::setDetPlane(), and TString.

93 {
94 
95  //std::cout<<" -I- PndHypRecoHit::PndHypRecoHit(PndHypHit*) called."<<std::endl;
96  //std::cout<<*hit<<std::endl;
97 
98  TString id = hit->GetDetName();
99 
100  FairRootManager* ioman = FairRootManager::Instance();
101  TString fGeoFile = ioman->GetInFile()->GetName();
102  fGeoH = new PndHypGeoHandling(fGeoFile.Data());
103 
104  TVector3 oo, uu, vv;
105  fGeoH->GetOUVId(id, oo,uu,vv);
106 
107  TVector3 position = hit->GetPosition();
108  TVector3 localpos = fGeoH->MasterToLocalId(position, id);
109 
110  fHitCoord[0][0] = localpos.X();
111  fHitCoord[1][0] = localpos.Y();
112 
113  fHitCov[0][0] = 0.0050 * 0.0050;
114  fHitCov[1][1] = 0.0050 * 0.0050;
115 
116  fPolicy.setDetPlane(GFDetPlane(oo,uu,vv));
117 
118 
119 }
Detector plane genfit geometry class.
Definition: GFDetPlane.h:59
TVector3 GetPosition() const
Definition: PndHypHit.h:87
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.
void GetOUVId(TString id, TVector3 &o, TVector3 &u, TVector3 &v)
for a volume given by its ID the o, u, v vectors for the plane are returned
Class to access the naming information of the MVD.
TString GetDetName() const
Definition: PndHypHit.h:83
TVector3 MasterToLocalId(const TVector3 &master, const TString &id)
static const Int_t fNparHitRep
Definition: PndHypRecoHit.h:73
TString fGeoFile
PndHypGeoHandling * fGeoH
Definition: PndHypRecoHit.h:74
TMatrixT< double > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:79
PndHypRecoHit::~PndHypRecoHit ( )
virtual

Definition at line 59 of file PndHypRecoHit.cxx.

References fGeoH.

60 {
61  if(fGeoH!=0) delete (fGeoH);
62 }
PndHypGeoHandling * fGeoH
Definition: PndHypRecoHit.h:74

Member Function Documentation

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

References PndHypRecoHit().

58 {return new PndHypRecoHit(*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 > PndHypRecoHit::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 123 of file PndHypRecoHit.cxx.

References fNparHitRep.

124 {
125 
126  // !! TODO I copied this from the DemoRecoHit - check validity!!!
127  if (dynamic_cast<const GeaneTrackRep*>(stateVector) != NULL) {
128  // Uses TrackParP (q/p,v',w',v,w)
129  // coordinates are defined by detplane!
130  TMatrixT<double> HMatrix(fNparHitRep,5);
131 
132  HMatrix[0][0] = 0.;
133  HMatrix[0][1] = 0.;
134  HMatrix[0][2] = 0.;
135  HMatrix[0][3] = 1.;
136  HMatrix[0][4] = 0.;
137 
138  HMatrix[1][0] = 0.;
139  HMatrix[1][1] = 0.;
140  HMatrix[1][2] = 0.;
141  HMatrix[1][3] = 0.;
142  HMatrix[1][4] = 1.;
143  return HMatrix;
144  }
145  else if (dynamic_cast<const LSLTrackRep*>(stateVector) != NULL) {
146  // LSLTrackRep (x,y,x',y',q/p)
147  TMatrixT<double> HMatrix(fNparHitRep,5);
148 
149 
150 
151  HMatrix[0][0] = 1.;
152  HMatrix[0][1] = 0.;
153  HMatrix[0][2] = 0.;
154  HMatrix[0][3] = 0.;
155  HMatrix[0][4] = 0.;
156 
157  HMatrix[1][0] = 0.;
158  HMatrix[1][1] = 1.;
159  HMatrix[1][2] = 0.;
160  HMatrix[1][3] = 0.;
161  HMatrix[1][4] = 0.;
162  return HMatrix;
163 
164  }
165  else {
166  std::cerr << "DemoRecoHit can only handle state"
167  << " vectors of type LSLTrackRep or GeaneTrackRep -> abort"
168  << std::endl;
169  throw;
170  }
171 
172 }
static const Int_t fNparHitRep
Definition: PndHypRecoHit.h:73
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 PndHypRecoHit::residualScalar ( GFAbsTrackRep stateVector,
const TMatrixT< Double_t > &  state 
)
virtual

Definition at line 175 of file PndHypRecoHit.cxx.

177 {
178  throw;
179 }
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

PndHypGeoHandling* PndHypRecoHit::fGeoH
private

Definition at line 74 of file PndHypRecoHit.h.

Referenced by PndHypRecoHit(), and ~PndHypRecoHit().

TMatrixT<double> GFAbsRecoHit::fHitCoord
protectedinherited
TMatrixT<double> GFAbsRecoHit::fHitCov
protectedinherited
const Int_t PndHypRecoHit::fNparHitRep = 3
staticprivate

Definition at line 73 of file PndHypRecoHit.h.

Referenced by getHMatrix().

GFPlanarHitPolicy GFRecoHitIfc< GFPlanarHitPolicy >::fPolicy
protectedinherited

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