FairRoot/PandaRoot
GFSpacepointHitPolicy.cxx
Go to the documentation of this file.
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #include "GFSpacepointHitPolicy.h"
20 
21 #include "assert.h"
22 
23 #include "TMath.h"
24 
25 #include "GFAbsRecoHit.h"
26 
27 const std::string GFSpacepointHitPolicy::fPolicyName = "GFSpacepointHitPolicy";
28 
29 TMatrixT<double>
31 {
32  TMatrixT<double> returnMat(2,1);
33 
34  TMatrixT<double> _D(3,1);
35  TVector3 _U;
36  TVector3 _V;
37 
38  _D[0][0] = (plane.getO())[0];
39  _D[1][0] = (plane.getO())[1];
40  _D[2][0] = (plane.getO())[2];
41 
42  _D *= -1.;
43  _D += hit->getRawHitCoord();
44  //now the vector _D points from the origin of the plane to the hit point
45 
46 
47  _U = plane.getU();
48  _V = plane.getV();
49 
50 
51  returnMat[0][0] = _D[0][0] * _U[0] + _D[1][0] * _U[1] + _D[2][0] * _U[2];
52  returnMat[1][0] = _D[0][0] * _V[0] + _D[1][0] * _V[1] + _D[2][0] * _V[2];
53  //std::cout << "hitCoord="<<std::endl;
54  //returnMat.Print();
55  return returnMat;
56 }
57 
58 TMatrixT<double>
60 {
61  TVector3 _U;
62  TVector3 _V;
63 
64  _U = plane.getU();
65  _V = plane.getV();
66 
67  TMatrixT<double> rawCov = hit->getRawHitCov();
68 
69  TMatrixT<double> jac(3,2);
70 
71  // jac = dF_i/dx_j = s_unitvec * t_untivec, with s=u,v and t=x,y,z
72  jac[0][0] = _U[0];
73  jac[1][0] = _U[1];
74  jac[2][0] = _U[2];
75  jac[0][1] = _V[0];
76  jac[1][1] = _V[1];
77  jac[2][1] = _V[2];
78 
79  TMatrixT<double> jac_orig = jac;
80  TMatrixT<double> jac_t = jac.T();
81 
82  TMatrixT<double> result=jac_t * (rawCov * jac_orig);
83  //std::cout << "hitCov="<<std::endl;
84  //result.Print();
85  return result;
86 }
87 
88 const GFDetPlane&
90 {
91  TMatrixT<double> rawcoord = hit->getRawHitCoord();
92  TVector3 point(rawcoord[0][0],rawcoord[1][0],rawcoord[2][0]);
93 
94  TVector3 poca,dirInPoca;
95  rep->extrapolateToPoint(point,poca,dirInPoca);
96 
97  fPlane.setO(point);
98  fPlane.setNormal(dirInPoca);
99 
100  return fPlane;
101 }
102 
const GFDetPlane & detPlane(GFAbsRecoHit *, GFAbsTrackRep *)
Get detector plane perpendicular to track.
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:80
TVector3 getV() const
Definition: GFDetPlane.h:77
Detector plane genfit geometry class.
Definition: GFDetPlane.h:59
TMatrixT< double > hitCoord(GFAbsRecoHit *, const GFDetPlane &)
Hit coordinates in detector plane.
void setO(const TVector3 &o)
Definition: GFDetPlane.cxx:92
void setNormal(TVector3 n)
Definition: GFDetPlane.cxx:156
TMatrixT< double > getRawHitCoord() const
Get raw hit coordinates.
Definition: GFAbsRecoHit.h:158
TClonesArray * point
Definition: anaLmdDigi.C:29
Policy class implementing a space point hit geometry.
Base Class for representing a Hit in GENFIT.
Definition: GFAbsRecoHit.h:73
TMatrixT< double > hitCov(GFAbsRecoHit *, const GFDetPlane &)
Hit covariances in detector plane.
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
static const std::string fPolicyName
virtual void extrapolateToPoint(const TVector3 &point, TVector3 &poca, TVector3 &normVec)
This method is to extrapolate the track to point of closest approach to a point in space...
TVector3 getU() const
Definition: GFDetPlane.h:76
ClassImp(PndAnaContFact)
TMatrixT< double > getRawHitCov() const
Get raw hit covariances.
Definition: GFAbsRecoHit.h:153
TVector3 getO() const
Definition: GFDetPlane.h:75