LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
genf::GFRecoHitIfc< HitPolicy > Class Template Referenceabstract

#include "GFRecoHitIfc.h"

Inheritance diagram for genf::GFRecoHitIfc< HitPolicy >:
genf::GFAbsRecoHit genf::PointHit

Public Member Functions

 GFRecoHitIfc (int dim)
 Constructor specifying dimension of hit coordinate vector. More...
 
virtual ~GFRecoHitIfc ()
 
virtual const GFDetPlanegetDetPlane (GFAbsTrackRep *rep)
 Returns the detector plane object for this hit and a given track representation. More...
 
virtual TMatrixT< Double_t > getHitCoord (const GFDetPlane &plane, const GFDetPlane &planePrev)
 Get hit coordinates in a specific detector plane. More...
 
virtual TMatrixT< Double_t > getHitCoord (const GFDetPlane &plane)
 
virtual TMatrixT< Double_t > getHitCov (const GFDetPlane &plane)
 Get hit covariances in a specific detector plane. More...
 
virtual TMatrixT< Double_t > getHitCov (const GFDetPlane &plane, const GFDetPlane &planePrev, const TMatrixT< Double_t > &state, const Double_t &mass)
 
const std::string & getPolicyName ()
 
virtual TMatrixT< Double_t > getHMatrix (const GFAbsTrackRep *stateVector)=0
 Get transformation matrix. Transformation between hit coordinates and track representation coordinates. More...
 
virtual TMatrixT< Double_t > getHMatrix (const GFAbsTrackRep *stateVector, const Double_t &, const Double_t &)=0
 
virtual TMatrixT< Double_t > residualVector (const GFAbsTrackRep *stateVector, const TMatrixT< Double_t > &state, const GFDetPlane &d)
 Calculate residual with respect to a track representation. More...
 
virtual TMatrixT< Double_t > residualVector (const GFAbsTrackRep *stateVector, const TMatrixT< Double_t > &state, const GFDetPlane &d, const GFDetPlane &dPrev, const double &mass)
 
TMatrixT< Double_t > getRawHitCov () const
 Get raw hit covariances. More...
 
TMatrixT< Double_t > getRawHitCoord () const
 Get raw hit coordinates. More...
 
virtual GFAbsRecoHitclone ()=0
 Get clone of this object. More...
 
virtual void Print (std::ostream &out=std::cout) const
 Print raw hit coordinates. More...
 
int getNparHit ()
 

Protected Attributes

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

Detailed Description

template<class HitPolicy>
class genf::GFRecoHitIfc< HitPolicy >

Definition at line 62 of file GFRecoHitIfc.h.

Constructor & Destructor Documentation

template<class HitPolicy >
genf::GFRecoHitIfc< HitPolicy >::GFRecoHitIfc ( int  dim)
inline

Constructor specifying dimension of hit coordinate vector.

Definition at line 70 of file GFRecoHitIfc.h.

70 : GFAbsRecoHit(dim){;}
GFAbsRecoHit()
Default constructor needed for compatibility with ROOT.
template<class HitPolicy >
virtual genf::GFRecoHitIfc< HitPolicy >::~GFRecoHitIfc ( )
inlinevirtual

Definition at line 71 of file GFRecoHitIfc.h.

71 {;}

Member Function Documentation

virtual GFAbsRecoHit* genf::GFAbsRecoHit::clone ( )
pure virtualinherited

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!

Implemented in genf::PointHit.

Referenced by genf::GFAbsRecoHit::getRawHitCoord().

template<class HitPolicy >
virtual const GFDetPlane& genf::GFRecoHitIfc< HitPolicy >::getDetPlane ( GFAbsTrackRep rep)
inlinevirtual

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 genf::GFAbsRecoHit.

Definition at line 82 of file GFRecoHitIfc.h.

82 {return fPolicy.detPlane(this,rep);}
template<class HitPolicy >
virtual TMatrixT<Double_t> genf::GFRecoHitIfc< HitPolicy >::getHitCoord ( const GFDetPlane plane,
const GFDetPlane planePrev 
)
inlinevirtual

Get hit coordinates in a specific detector plane.

Implementation in the HitPolicy

Implements genf::GFAbsRecoHit.

Definition at line 88 of file GFRecoHitIfc.h.

89  {return fPolicy.hitCoord(this,plane,planePrev);}
template<class HitPolicy >
virtual TMatrixT<Double_t> genf::GFRecoHitIfc< HitPolicy >::getHitCoord ( const GFDetPlane plane)
inlinevirtual

Implements genf::GFAbsRecoHit.

Definition at line 90 of file GFRecoHitIfc.h.

91  {return fPolicy.hitCoord(this,plane);}
template<class HitPolicy >
virtual TMatrixT<Double_t> genf::GFRecoHitIfc< HitPolicy >::getHitCov ( const GFDetPlane plane)
inlinevirtual

Get hit covariances in a specific detector plane.

Implementation in the HitPolicy

Implements genf::GFAbsRecoHit.

Definition at line 97 of file GFRecoHitIfc.h.

98  {return fPolicy.hitCov(this,plane);}
template<class HitPolicy >
virtual TMatrixT<Double_t> genf::GFRecoHitIfc< HitPolicy >::getHitCov ( const GFDetPlane plane,
const GFDetPlane planePrev,
const TMatrixT< Double_t > &  state,
const Double_t &  mass 
)
inlinevirtual

Implements genf::GFAbsRecoHit.

Definition at line 99 of file GFRecoHitIfc.h.

100  {return fPolicy.hitCov(this,plane,planePrev, state, mass);}
virtual TMatrixT<Double_t> genf::GFAbsRecoHit::getHMatrix ( const GFAbsTrackRep stateVector)
pure virtualinherited

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:

Implemented in genf::PointHit.

Referenced by genf::GFKalman::getChi2Hit(), genf::GFKalman::processHit(), and genf::GFAbsRecoHit::residualVector().

virtual TMatrixT<Double_t> genf::GFAbsRecoHit::getHMatrix ( const GFAbsTrackRep stateVector,
const Double_t &  ,
const Double_t &   
)
pure virtualinherited

Implemented in genf::PointHit.

int genf::GFAbsRecoHit::getNparHit ( )
inlineinherited

Definition at line 238 of file GFAbsRecoHit.h.

References genf::GFAbsRecoHit::fNparHit.

238 {return fNparHit;}
template<class HitPolicy >
const std::string& genf::GFRecoHitIfc< HitPolicy >::getPolicyName ( )
inlinevirtual

Reimplemented from genf::GFAbsRecoHit.

Definition at line 102 of file GFRecoHitIfc.h.

102 {return fPolicy.getName();}
TMatrixT<Double_t> genf::GFAbsRecoHit::getRawHitCov ( ) const
inlineinherited

Get raw hit covariances.

Definition at line 177 of file GFAbsRecoHit.h.

References genf::GFAbsRecoHit::fHitCov.

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

177 {return fHitCov;}
TMatrixT< Double_t > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:83
virtual void genf::GFAbsRecoHit::Print ( std::ostream &  out = std::cout) const
inlinevirtualinherited

Print raw hit coordinates.

Definition at line 233 of file GFAbsRecoHit.h.

References genf::GFAbsRecoHit::getPolicyName(), and genf::PrintROOTobject().

234  { PrintROOTobject(out, fHitCoord); }
TMatrixT< Double_t > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:80
void PrintROOTobject(std::ostream &, const ROOTOBJ &)
Small utility functions which print some ROOT objects into an output stream.
Definition: GFException.h:129
virtual TMatrixT<Double_t> genf::GFAbsRecoHit::residualVector ( const GFAbsTrackRep stateVector,
const TMatrixT< Double_t > &  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 147 of file GFAbsRecoHit.h.

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

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

149  {
150  std::cout << "GFAbsRecoHit::residualVector(3args) Not correctly Using theta -- multiple scattering -- information !!! Fix this if you really want to use getChi2Hit" << std::endl;
151  TMatrixT<Double_t> H = getHMatrix(stateVector);
152  return ( getHitCoord(d) - (H*state ));
153  }
virtual TMatrixT< Double_t > getHitCoord(const GFDetPlane &, const GFDetPlane &)=0
Get hit coordinates in a specific detector plane.
virtual TMatrixT< Double_t > getHMatrix(const GFAbsTrackRep *stateVector)=0
Get transformation matrix. Transformation between hit coordinates and track representation coordinate...
Float_t d
Definition: plot.C:237
virtual TMatrixT<Double_t> genf::GFAbsRecoHit::residualVector ( const GFAbsTrackRep stateVector,
const TMatrixT< Double_t > &  state,
const GFDetPlane d,
const GFDetPlane dPrev,
const double &  mass 
)
inlinevirtualinherited

Definition at line 155 of file GFAbsRecoHit.h.

References beta, genf::GFAbsRecoHit::getHitCoord(), genf::GFAbsRecoHit::getHMatrix(), and genf::GFDetPlane::getO().

161  {
162  Double_t dist = (d.getO()-dPrev.getO()).Mag();
163  // Double_t mass = 0.104; // close enough for muons, pions, I think.
164  Double_t mom = fabs(1.0/state[0][0]);
165  Double_t beta = mom/sqrt(mass*mass+mom*mom);
166  if (std::isnan(dist) || dist<0.2) dist=0.2; // don't allow 0s here.
167  if (std::isnan(beta) || beta<0.04) beta=0.04;
168 
169  TMatrixT<Double_t> H = getHMatrix(stateVector,beta,dist);
170  return ( getHitCoord(d,dPrev) - (H*state ));
171  }
virtual TMatrixT< Double_t > getHitCoord(const GFDetPlane &, const GFDetPlane &)=0
Get hit coordinates in a specific detector plane.
virtual TMatrixT< Double_t > getHMatrix(const GFAbsTrackRep *stateVector)=0
Get transformation matrix. Transformation between hit coordinates and track representation coordinate...
Double_t beta
Float_t d
Definition: plot.C:237

Member Data Documentation

TMatrixT<Double_t> genf::GFAbsRecoHit::fHitCoord
protectedinherited

Vector of raw coordinates of hit.

Definition at line 80 of file GFAbsRecoHit.h.

Referenced by genf::GFAbsRecoHit::getRawHitCoord(), and genf::PointHit::PointHit().

TMatrixT<Double_t> genf::GFAbsRecoHit::fHitCov
protectedinherited

Covariance of raw hit coordinates.

Definition at line 83 of file GFAbsRecoHit.h.

Referenced by genf::GFAbsRecoHit::getRawHitCov(), and genf::PointHit::PointHit().

template<class HitPolicy >
HitPolicy genf::GFRecoHitIfc< HitPolicy >::fPolicy
protected

Definition at line 64 of file GFRecoHitIfc.h.


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