All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Private Attributes | List of all members
genf::PointHit Class Reference

#include <PointHit.h>

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

Public Member Functions

 PointHit ()
 
 PointHit (TVector3 point, double res)
 
 PointHit (TVector3 point, std::vector< double > &ref)
 
 PointHit (TVector3 point, TVector3 res)
 
virtual ~PointHit ()
 
virtual GFAbsRecoHitclone ()
 Get clone of this object. More...
 
virtual TMatrixT< Double_t > getHMatrix (const GFAbsTrackRep *stateVector)
 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 &)
 
- Public Member Functions inherited from genf::GFRecoHitIfc< HitPolicy >
 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 ()
 
- Public Member Functions inherited from genf::GFAbsRecoHit
virtual ~GFAbsRecoHit ()
 
 GFAbsRecoHit (int NparHit)
 Constructor specifying dimension of coordinate vector. More...
 
 GFAbsRecoHit ()
 Default constructor needed for compatibility with ROOT. More...
 
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 void Print (std::ostream &out=std::cout) const
 Print raw hit coordinates. More...
 
int getNparHit ()
 

Static Private Attributes

static const int NparHitRep = 3
 

Additional Inherited Members

- Protected Attributes inherited from genf::GFRecoHitIfc< HitPolicy >
HitPolicy fPolicy
 
- Protected Attributes inherited from genf::GFAbsRecoHit
TMatrixT< Double_t > fHitCoord
 Vector of raw coordinates of hit. More...
 
TMatrixT< Double_t > fHitCov
 Covariance of raw hit coordinates. More...
 

Detailed Description

Definition at line 14 of file PointHit.h.

Constructor & Destructor Documentation

genf::PointHit::PointHit ( )

Definition at line 21 of file PointHit.cxx.

23 {}
GFRecoHitIfc< GFSpacepointHitPolicy > SpacepointRecoHit
Definition: PointHit.h:12
static const int NparHitRep
Definition: PointHit.h:34
genf::PointHit::PointHit ( TVector3  point,
double  res 
)

Definition at line 25 of file PointHit.cxx.

27 
28  fHitCov[0][0] = res*res;
29  fHitCov[1][1] = res*res;
30  fHitCov[2][2] = res*res;
31  GFDetPlane d;
32 
33  fHitCoord[0][0] = point.X();
34  fHitCoord[1][0] = point.Y();
35  fHitCoord[2][0] = point.Z();
36 
37 }
TMatrixT< Double_t > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:81
GFRecoHitIfc< GFSpacepointHitPolicy > SpacepointRecoHit
Definition: PointHit.h:12
static const int NparHitRep
Definition: PointHit.h:34
TMatrixT< Double_t > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:84
genf::PointHit::PointHit ( TVector3  point,
std::vector< double > &  ref 
)

Definition at line 40 of file PointHit.cxx.

42 
43  //assert (res.size()==4);
44 
45  fHitCov[0][0] = res.at(0);
46  fHitCov[1][1] = res.at(1);
47  fHitCov[2][2] = res.at(3);
48  fHitCov[1][2] = res.at(2); // yz cov element.
49  fHitCov[2][1] = res.at(2); // yz cov element.
50 
51  GFDetPlane d;
52 
53  fHitCoord[0][0] = point.X();
54  fHitCoord[1][0] = point.Y();
55  fHitCoord[2][0] = point.Z();
56 }
TMatrixT< Double_t > fHitCoord
Vector of raw coordinates of hit.
Definition: GFAbsRecoHit.h:81
GFRecoHitIfc< GFSpacepointHitPolicy > SpacepointRecoHit
Definition: PointHit.h:12
static const int NparHitRep
Definition: PointHit.h:34
TMatrixT< Double_t > fHitCov
Covariance of raw hit coordinates.
Definition: GFAbsRecoHit.h:84
genf::PointHit::PointHit ( TVector3  point,
TVector3  res 
)
genf::PointHit::~PointHit ( )
virtual

Definition at line 18 of file PointHit.cxx.

19 {}

Member Function Documentation

genf::GFAbsRecoHit * genf::PointHit::clone ( )
virtual

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

Definition at line 58 of file PointHit.cxx.

58  {
59  return new PointHit(*this);
60 }
TMatrixT< Double_t > genf::PointHit::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 genf::GFAbsRecoHit.

Definition at line 138 of file PointHit.cxx.

139 {
140  if (dynamic_cast<const genf::RKTrackRep*>(stateVector) != nullptr){
141  //I know, since this is the same everytime, it could be done in the
142  //the constructor, but I do it here anyway, to make clear that in the
143  //case of several track-reps per hit, it would have to be done here
144  // fHMatrix.ResizeTo(NparHitRep,5);
145 
146 
147  // TMatrixT<Double_t> HMatrix(2,6);
148  // WTF? Making this 2,5 not 2,6. EC, 3-Jan-2011.
149  TMatrixT<Double_t> HMatrix(2,5);
150 
151  HMatrix[0][0] = 0.;
152  HMatrix[0][1] = 0.;
153  HMatrix[0][2] = 0.;
154  HMatrix[0][3] = 1.;
155  HMatrix[0][4] = 0.;
156  //HMatrix[0][5] = 0.;
157 
158  HMatrix[1][0] = 0.;
159  HMatrix[1][1] = 0.;
160  HMatrix[1][2] = 0.;
161  HMatrix[1][3] = 0.;
162  HMatrix[1][4] = 1.;
163  //HMatrix[1][5] = 0.;
164 
165  return HMatrix;
166  }
167  else if(dynamic_cast<const genf::SlTrackRep*>(stateVector)){
168  TMatrixT<Double_t> HMatrix(2,4);
169 
170  HMatrix[0][0] = 1.;
171  HMatrix[0][1] = 0.;
172  HMatrix[0][2] = 0.;
173  HMatrix[0][3] = 0.;
174 
175 
176  HMatrix[1][0] = 0.;
177  HMatrix[1][1] = 1.;
178  HMatrix[1][2] = 0.;
179  HMatrix[1][3] = 0.;
180  return HMatrix;
181  }
182 
183  else {
184  std::cerr << "PointHit can only handle state"
185  << " vectors of type genf::RKTrackRep or genf::SlTrackRep -> throw" << std::endl;
186  throw;
187  }
188 
189 }
BEGIN_PROLOG could also be cerr
TMatrixT< Double_t > genf::PointHit::getHMatrix ( const GFAbsTrackRep stateVector,
const Double_t &  betac,
const Double_t &  dist 
)
virtual

Implements genf::GFAbsRecoHit.

Definition at line 64 of file PointHit.cxx.

65 {
66  if (dynamic_cast<const genf::RKTrackRep*>(stateVector) != nullptr){
67  //I know, since this is the same everytime, it could be done in the
68  //the constructor, but I do it here anyway, to make clear that in the
69  //case of several track-reps per hit, it would have to be done here
70  // fHMatrix.ResizeTo(NparHitRep,5);
71 
72 
73  // TMatrixT<Double_t> HMatrix(2,6);
74  // WTF? Making this 2,5 not 2,6. EC, 3-Jan-2011.
75  // TMatrixT<Double_t> HMatrix(2,5);
76  TMatrixT<Double_t> HMatrix(5,5);
77 
78  Double_t C = 0.0136/betac*sqrt(dist/14.0)*(1+0.038*log(dist/14.0)); // EC, 2-Jan-2012.
79 
80  HMatrix[0][0] = C;
81  HMatrix[0][1] = 0.;
82  HMatrix[0][2] = 0.;
83  HMatrix[0][3] = 0.;
84  HMatrix[0][4] = 0.;
85 
86  HMatrix[1][0] = 0.;
87  HMatrix[1][1] = 1.;
88  HMatrix[1][2] = 0.;
89  HMatrix[1][3] = 0.;
90  HMatrix[1][4] = 0.;
91 
92  HMatrix[2][0] = 0.;
93  HMatrix[2][1] = 0.;
94  HMatrix[2][2] = 1.;
95  HMatrix[2][3] = 0.;
96  HMatrix[2][4] = 0.;
97 
98  HMatrix[3][0] = 0.;
99  HMatrix[3][1] = 0.;
100  HMatrix[3][2] = 0.;
101  HMatrix[3][3] = 1.;
102  HMatrix[3][4] = 0.;
103 
104  HMatrix[4][0] = 0.;
105  HMatrix[4][1] = 0.;
106  HMatrix[4][2] = 0.;
107  HMatrix[4][3] = 0.;
108  HMatrix[4][4] = 1.;
109 
110 
111  return HMatrix;
112  }
113  else if(dynamic_cast<const genf::SlTrackRep*>(stateVector)){
114  TMatrixT<Double_t> HMatrix(2,4);
115 
116  HMatrix[0][0] = 1.;
117  HMatrix[0][1] = 0.;
118  HMatrix[0][2] = 0.;
119  HMatrix[0][3] = 0.;
120 
121 
122  HMatrix[1][0] = 0.;
123  HMatrix[1][1] = 1.;
124  HMatrix[1][2] = 0.;
125  HMatrix[1][3] = 0.;
126  return HMatrix;
127  }
128 
129  else {
130  std::cerr << "PointHit can only handle state"
131  << " vectors of type genf::RKTrackRep or genf::SlTrackRep -> throw" << std::endl;
132  throw;
133  }
134 
135 }
BEGIN_PROLOG could also be cerr
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)

Member Data Documentation

const int genf::PointHit::NparHitRep = 3
staticprivate

Definition at line 34 of file PointHit.h.


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