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

#include <GFWirepointHitPolicy.h>

Inheritance diagram for genf::GFWirepointHitPolicy:

Public Member Functions

 GFWirepointHitPolicy ()
 
const GFDetPlanedetPlane (GFAbsRecoHit *, GFAbsTrackRep *)
 Get detector plane. More...
 
TMatrixT< Double_t > hitCoord (GFAbsRecoHit *, const GFDetPlane &)
 Hit coordinates in detector plane. More...
 
TMatrixT< Double_t > 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 ()
 

Private Attributes

GFDetPlane fDetPlane
 
double fMaxdistance
 

Static Private Attributes

static const std::string fPolicyName = "GFWirepointHitPolicy"
 

Detailed Description

Definition at line 55 of file GFWirepointHitPolicy.h.

Constructor & Destructor Documentation

genf::GFWirepointHitPolicy::GFWirepointHitPolicy ( )

Definition at line 37 of file GFWirepointHitPolicy.cxx.

virtual genf::GFWirepointHitPolicy::~GFWirepointHitPolicy ( )
inlinevirtual

Definition at line 78 of file GFWirepointHitPolicy.h.

78 {;}

Member Function Documentation

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

Check if the detector plane is valid.

Definition at line 72 of file GFWirepointHitPolicy.cxx.

73 {
74  // raw x1, y1, z1, x2, y2, z2, rdrift, zreco
75  TMatrixT<Double_t> rC = hit->getRawHitCoord();
76 
77  assert(rC.GetNrows()==8);
78 
79  TVector3 wire1(rC[0][0], rC[1][0], rC[2][0]);
80  TVector3 wire2(rC[3][0], rC[4][0], rC[5][0]);
81  TVector3 wiredirection = wire1 - wire2;
82 
83  TVector3 vaxis = plane.getV();
84  wiredirection.SetMag(1.);
85  vaxis.SetMag(1.);
86 
87  if(fabs(TMath::Abs(wiredirection.Dot(vaxis)) - 1) > 1e-3)
88  {
89 
90  std::cout << "GFWirepointHitPolicy: plane not valid!!" << std::endl;
91  }
92 }
process_name hit
Definition: cheaterreco.fcl:51
do i e
BEGIN_PROLOG could also be cout
const genf::GFDetPlane & genf::GFWirepointHitPolicy::detPlane ( GFAbsRecoHit hit,
GFAbsTrackRep rep 
)

Get detector plane.

Definition at line 96 of file GFWirepointHitPolicy.cxx.

97 {
98 
99  TMatrixT<Double_t> x=hit->getRawHitCoord();
100  assert(x.GetNrows()==8);
101  TVector3 wire1(x[0][0],x[1][0],x[2][0]);
102  TVector3 wire2(x[3][0],x[4][0],x[5][0]);
103 
104  // distance of one (the first) of the wire extremities from the plane
105  Double_t d_from_refplane = fDetPlane.dist(wire1).Mag();
106  if(d_from_refplane < 1e-5) return fDetPlane;
107 
108 
109  // point of closest approach
110  TVector3 poca, poca_onwire, dirInPoca;
111 
112  rep->extrapolateToLine(wire1, wire2, poca, dirInPoca, poca_onwire);
113 
114 
115  Double_t distance;
116  distance = TMath::Sqrt(fabs(((wire1-poca).Mag2()*(wire2-wire1).Mag2()-pow((wire1-poca).Dot(wire2-wire1),2))/(wire2-wire1).Mag2()));
117 
118  // check poca inside tube
119  if(distance > fMaxdistance) {
120  throw GFException("distance poca-wire > maxdistance", __LINE__,__FILE__)/* .setFatal() */;
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  throw GFException("fromwiretoextr*wiredirection > 1e-3", __LINE__,__FILE__)/* .setFatal() */;
135  }
136 
137  TVector3 U;
138  U = fromwiretoextr;
139  TVector3 V;
140  V = wiredirection;
141  U.SetMag(1.);
142  V.SetMag(1.);
143 
144  TVector3 O = (wire1 + wire2) * 0.5;
145 
146 
147  fDetPlane = GFDetPlane(O, U, V);
148 
149  return fDetPlane;
150 }
process_name opflash particleana ie x
TVector3 dist(const TVector3 &point) const
Definition: GFDetPlane.cxx:214
process_name hit
Definition: cheaterreco.fcl:51
BEGIN_PROLOG V
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:48
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:172
do i e
double genf::GFWirepointHitPolicy::getMaxDistance ( )
inline

Definition at line 80 of file GFWirepointHitPolicy.h.

const std::string& genf::GFWirepointHitPolicy::getName ( )
inline

Definition at line 83 of file GFWirepointHitPolicy.h.

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

Hit coordinates in detector plane.

Definition at line 40 of file GFWirepointHitPolicy.cxx.

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

Hit covariances in detector plane.

Definition at line 55 of file GFWirepointHitPolicy.cxx.

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

Definition at line 81 of file GFWirepointHitPolicy.h.

Member Data Documentation

GFDetPlane genf::GFWirepointHitPolicy::fDetPlane
private

Definition at line 88 of file GFWirepointHitPolicy.h.

double genf::GFWirepointHitPolicy::fMaxdistance
private

Definition at line 89 of file GFWirepointHitPolicy.h.

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

Definition at line 85 of file GFWirepointHitPolicy.h.


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