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

policy class for hits in wire detectors (STT and DCH) which can measure the coordinate along the wire More...

#include <GFWirepointHitPolicy.h>

Inheritance diagram for GFWirepointHitPolicy:

Public Member Functions

 GFWirepointHitPolicy ()
 
const GFDetPlanedetPlane (GFAbsRecoHit *, GFAbsTrackRep *)
 Get detector plane. More...
 
TMatrixT< double > hitCoord (GFAbsRecoHit *, const GFDetPlane &)
 Hit coordinates in detector plane. More...
 
TMatrixT< double > hitCov (GFAbsRecoHit *, const GFDetPlane &)
 Hit covariances in detector plane. More...
 
void checkPlane (GFAbsRecoHit *, const GFDetPlane &)
 Check if the detector plane is valid. More...
 
virtual ~GFWirepointHitPolicy ()
 
double getMaxDistance ()
 
void setMaxDistance (double d)
 
const std::string & getName ()
 
 ClassDef (GFWirepointHitPolicy, 1)
 

Private Attributes

GFDetPlane fDetPlane
 
double fMaxdistance
 

Static Private Attributes

static const std::string fPolicyName = "GFWirepointHitPolicy"
 

Detailed Description

policy class for hits in wire detectors (STT and DCH) which can measure the coordinate along the wire

Author
Christian Höppner (Technische Universität München, original author)
Lia Lavezzi (INFN Pavia, original author)
Sebastian Neubert (Technische Universität München, original author) This policy is not valid for any kind of plane orientation choice: to use it you MUST choose a plane described by u and v axes with v coincident with the wire (and u orthogonal to it, obviously). The hit will be described by 8 coordinates: w_x1, w_y1, w_z1, w_x2, w_y2, w_z2, rdrift, zreco where w_ji (with j = x, y, z and i = 1, 2) are the wire extremities coordinates; rdrift = distance from the wire (u coordinate in the plane) and zreco = coordinate along the wire (in the plane reference frame, v coordinate).

Definition at line 52 of file GFWirepointHitPolicy.h.

Constructor & Destructor Documentation

GFWirepointHitPolicy::GFWirepointHitPolicy ( )

Definition at line 36 of file GFWirepointHitPolicy.cxx.

36 : fMaxdistance(1.E50) {;}
virtual GFWirepointHitPolicy::~GFWirepointHitPolicy ( )
inlinevirtual

Definition at line 75 of file GFWirepointHitPolicy.h.

75 {;}

Member Function Documentation

void GFWirepointHitPolicy::checkPlane ( GFAbsRecoHit hit,
const GFDetPlane plane 
)

Check if the detector plane is valid.

Definition at line 71 of file GFWirepointHitPolicy.cxx.

References CAMath::Abs(), fabs(), GFAbsRecoHit::getRawHitCoord(), and GFDetPlane::getV().

Referenced by hitCoord(), and hitCov().

72 {
73  // raw x1, y1, z1, x2, y2, z2, rdrift, zreco
74  TMatrixT<double> rC = hit->getRawHitCoord();
75 
76  assert(rC.GetNrows()==8);
77 
78  TVector3 wire1(rC[0][0], rC[1][0], rC[2][0]);
79  TVector3 wire2(rC[3][0], rC[4][0], rC[5][0]);
80  TVector3 wiredirection = wire1 - wire2;
81 
82  TVector3 vaxis = plane.getV();
83  wiredirection.SetMag(1.);
84  vaxis.SetMag(1.);
85 
86  if(fabs(TMath::Abs(wiredirection.Dot(vaxis)) - 1) > 1e-3)
87  {
88 
89  std::cout << "GFWirepointHitPolicy: plane not valid!!" << std::endl;
90  }
91 }
TVector3 getV() const
Definition: GFDetPlane.h:77
static T Abs(const T &x)
Definition: PndCAMath.h:39
TMatrixT< double > getRawHitCoord() const
Get raw hit coordinates.
Definition: GFAbsRecoHit.h:158
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
GFWirepointHitPolicy::ClassDef ( GFWirepointHitPolicy  ,
 
)
const GFDetPlane & GFWirepointHitPolicy::detPlane ( GFAbsRecoHit hit,
GFAbsTrackRep rep 
)

Get detector plane.

Definition at line 95 of file GFWirepointHitPolicy.cxx.

References GFDetPlane::dist(), Double_t, GFAbsTrackRep::extrapolateToLine(), fabs(), fDetPlane, fMaxdistance, GFAbsRecoHit::getRawHitCoord(), CAMath::Sqrt(), and x.

96 {
97 
98  TMatrixT<double> x=hit->getRawHitCoord();
99  assert(x.GetNrows()==8);
100  TVector3 wire1(x[0][0],x[1][0],x[2][0]);
101  TVector3 wire2(x[3][0],x[4][0],x[5][0]);
102 
103  // distance of one (the first) of the wire extremities from the plane
104  Double_t d_from_refplane = fDetPlane.dist(wire1).Mag();
105  if(d_from_refplane < 1e-5) return fDetPlane;
106 
107 
108  // point of closest approach
109  TVector3 poca, poca_onwire, dirInPoca;
110 
111  rep->extrapolateToLine(wire1, wire2, poca, dirInPoca, poca_onwire);
112 
113 
114  Double_t distance;
115  distance = TMath::Sqrt(fabs(((wire1-poca).Mag2()*(wire2-wire1).Mag2()-pow((wire1-poca).Dot(wire2-wire1),2))/(wire2-wire1).Mag2()));
116 
117  // check poca inside tube
118  if(distance > fMaxdistance) {
119  GFException exc("distance poca-wire > maxdistance", __LINE__,__FILE__);
120  throw exc;
121  }
122 
123  // find plane
124  // unitary vector along distance
125  // poca (on track), poca_onwire (on wire)
126  TVector3 fromwiretoextr = poca - poca_onwire;
127  fromwiretoextr.SetMag(1.);
128  // unitary vector along the wire
129  TVector3 wiredirection = wire2 - wire1;
130  wiredirection.SetMag(1.);
131 
132  // check orthogonality
133  if(fabs(fromwiretoextr * wiredirection) > 1e-3) {
134  GFException exc("fromwiretoextr*wiredirection > 1e-3", __LINE__,__FILE__);
135  throw exc;
136  }
137 
138  TVector3 U;
139  U = fromwiretoextr;
140  TVector3 V;
141  V = wiredirection;
142  U.SetMag(1.);
143  V.SetMag(1.);
144 
145  TVector3 O = (wire1 + wire2) * 0.5;
146 
147 
148  fDetPlane = GFDetPlane(O, U, V);
149 
150  return fDetPlane;
151 }
Detector plane genfit geometry class.
Definition: GFDetPlane.h:59
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
virtual void extrapolateToLine(const TVector3 &point1, const TVector3 &point2, TVector3 &poca, TVector3 &normVec, TVector3 &poca_onwire)
This method extrapolates to the point of closest approach to a line.
Double_t
TMatrixT< double > getRawHitCoord() const
Get raw hit coordinates.
Definition: GFAbsRecoHit.h:158
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
Double_t x
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:45
TVector3 dist(const TVector3 &point) const
Definition: GFDetPlane.cxx:207
double GFWirepointHitPolicy::getMaxDistance ( )
inline

Definition at line 77 of file GFWirepointHitPolicy.h.

References fMaxdistance.

77 {return fMaxdistance;}
const std::string& GFWirepointHitPolicy::getName ( )
inline

Definition at line 80 of file GFWirepointHitPolicy.h.

References fPolicyName.

80 {return fPolicyName;}
static const std::string fPolicyName
TMatrixT< double > GFWirepointHitPolicy::hitCoord ( GFAbsRecoHit hit,
const GFDetPlane plane 
)

Hit coordinates in detector plane.

Definition at line 39 of file GFWirepointHitPolicy.cxx.

References checkPlane(), and GFAbsRecoHit::getRawHitCoord().

40 {
41  TMatrixT<double> returnMat(2,1);
42 
43  checkPlane(hit, plane);
44 
45  // raw x1, y1, z1, x2, y2, z2, rdrift, zreco
46  TMatrixT<double> rC = hit->getRawHitCoord();
47 
48  returnMat[0][0] = rC[6][0];
49  returnMat[1][0] = rC[7][0];
50  return returnMat;
51 }
TMatrixT< double > getRawHitCoord() const
Get raw hit coordinates.
Definition: GFAbsRecoHit.h:158
void checkPlane(GFAbsRecoHit *, const GFDetPlane &)
Check if the detector plane is valid.
TMatrixT< double > GFWirepointHitPolicy::hitCov ( GFAbsRecoHit hit,
const GFDetPlane plane 
)

Hit covariances in detector plane.

Definition at line 54 of file GFWirepointHitPolicy.cxx.

References checkPlane(), and GFAbsRecoHit::getRawHitCov().

55 {
56  checkPlane(hit, plane);
57 
58  TMatrixT<double> returnCov(2,2);
59  TMatrixT<double> rawCov = hit->getRawHitCov();
60 
61  returnCov[0][0] = rawCov[6][6];
62  returnCov[1][0] = rawCov[7][6];
63  returnCov[0][1] = rawCov[6][7];
64  returnCov[1][1] = rawCov[7][7];
65 
66  return returnCov;
67 }
void checkPlane(GFAbsRecoHit *, const GFDetPlane &)
Check if the detector plane is valid.
TMatrixT< double > getRawHitCov() const
Get raw hit covariances.
Definition: GFAbsRecoHit.h:153
void GFWirepointHitPolicy::setMaxDistance ( double  d)
inline

Definition at line 78 of file GFWirepointHitPolicy.h.

References d, and fMaxdistance.

78 {fMaxdistance=d;}
TObjArray * d

Member Data Documentation

GFDetPlane GFWirepointHitPolicy::fDetPlane
private

Definition at line 85 of file GFWirepointHitPolicy.h.

Referenced by detPlane().

double GFWirepointHitPolicy::fMaxdistance
private

Definition at line 86 of file GFWirepointHitPolicy.h.

Referenced by detPlane(), getMaxDistance(), and setMaxDistance().

const std::string GFWirepointHitPolicy::fPolicyName = "GFWirepointHitPolicy"
staticprivate

Definition at line 82 of file GFWirepointHitPolicy.h.

Referenced by getName().


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