Public Member Functions | Private Attributes | List of all members
genf::SlTrackRep Class Reference

#include <SlTrackRep.h>

Inheritance diagram for genf::SlTrackRep:
genf::GFAbsTrackRep

Public Member Functions

 SlTrackRep ()
 
 SlTrackRep (const TMatrixT< double > &, const TMatrixT< double > &)
 
 SlTrackRep (const TMatrixT< double > &, const TMatrixT< double > &, const double)
 
 SlTrackRep (const GFDetPlane &, const TMatrixT< double > &, const TMatrixT< double > &)
 
 SlTrackRep (const TVector3 &pos, const TVector3 &dir)
 
virtual ~SlTrackRep ()
 
virtual GFAbsTrackRepclone () const
 
virtual GFAbsTrackRepprototype () const
 
void setReferencePlane (const GFDetPlane &pl)
 
virtual double extrapolate (const GFDetPlane &, TMatrixT< double > &statePred, TMatrixT< double > &covPred)
 
virtual double extrapolate (const GFDetPlane &, TMatrixT< double > &statePred)
 
void extrapolateToPoint (const TVector3 &pos, TVector3 &poca, TVector3 &dirInPoca)
 This method is to extrapolate the track to point of closest approach to a point in space. More...
 
void extrapolateToLine (const TVector3 &point1, const TVector3 &point2, TVector3 &poca, TVector3 &dirInPoca, TVector3 &poca_onwire)
 This method extrapolates to the point of closest approach to a line. More...
 
virtual TVector3 getPos (const GFDetPlane &)
 
virtual TVector3 getMom (const GFDetPlane &)
 
virtual void getPosMom (const GFDetPlane &, TVector3 &pos, TVector3 &mom)
 
virtual double getCharge () const
 
void switchDirection ()
 
- Public Member Functions inherited from genf::GFAbsTrackRep
virtual double extrapolate (const GFDetPlane &plane, TMatrixT< Double_t > &statePred)
 returns the tracklength spanned in this extrapolation More...
 
 GFAbsTrackRep ()
 
 GFAbsTrackRep (int)
 
virtual ~GFAbsTrackRep ()
 
virtual void stepalong (double h)
 make step of h cm along the track More...
 
virtual double extrapolate (const GFDetPlane &plane, TMatrixT< Double_t > &statePred, TMatrixT< Double_t > &covPred)=0
 Extrapolates the track to the given detectorplane. More...
 
double extrapolate (const GFDetPlane &plane)
 This changes the state and cov and plane of the rep. More...
 
unsigned int getDim () const
 returns dimension of state vector More...
 
virtual void Print (std::ostream &out=std::cout) const
 
const TMatrixT< Double_t > & getState () const
 
const TMatrixT< Double_t > & getCov () const
 
double getStateElem (int i) const
 
double getCovElem (int i, int j) const
 
virtual void getPosMomCov (const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< Double_t > &cov)
 method which gets position, momentum and 6x6 covariance matrix More...
 
TVector3 getPos ()
 
TVector3 getMom ()
 
void getPosMomCov (TVector3 &pos, TVector3 &mom, TMatrixT< Double_t > &c)
 
TMatrixT< Double_t > getFirstState () const
 
TMatrixT< Double_t > getFirstCov () const
 
GFDetPlane getFirstPlane () const
 
TMatrixT< Double_t > getLastState () const
 
TMatrixT< Double_t > getLastCov () const
 
GFDetPlane getLastPlane () const
 
double getChiSqu () const
 
double getRedChiSqu () const
 returns chi2/ndf More...
 
unsigned int getNDF () const
 
virtual void setData (const TMatrixT< Double_t > &st, const GFDetPlane &pl, const TMatrixT< Double_t > *cov=NULL)
 
void setCov (const TMatrixT< Double_t > &aCov)
 
void setFirstState (const TMatrixT< Double_t > &aState)
 
void setFirstCov (const TMatrixT< Double_t > &aCov)
 
void setFirstPlane (const GFDetPlane &aPlane)
 
void setLastState (const TMatrixT< Double_t > &aState)
 
void setLastCov (const TMatrixT< Double_t > &aCov)
 
void setLastPlane (const GFDetPlane &aPlane)
 
const GFDetPlanegetReferencePlane () const
 
void setChiSqu (double aChiSqu)
 
void setNDF (unsigned int n)
 
void addChiSqu (double aChiSqu)
 
void addNDF (unsigned int n)
 
void setStatusFlag (int _val)
 
bool setInverted (bool f=true)
 Deprecated. Should be removed soon. More...
 
bool getStatusFlag ()
 
virtual void reset ()
 

Private Attributes

int _backw
 

Additional Inherited Members

- Protected Attributes inherited from genf::GFAbsTrackRep
unsigned int fDimension
 Dimensionality of track representation. More...
 
TMatrixT< Double_t > fState
 The vector of track parameters. More...
 
TMatrixT< Double_t > fCov
 The covariance matrix. More...
 
double fChiSqu
 chiSqu of the track fit More...
 
unsigned int fNdf
 
int fStatusFlag
 status of track representation: 0 means everything's OK More...
 
bool fInverted
 specifies the direction of flight of the particle More...
 
TMatrixT< Double_t > fFirstState
 state, cov and plane for first and last point in fit More...
 
TMatrixT< Double_t > fFirstCov
 
TMatrixT< Double_t > fLastState
 
TMatrixT< Double_t > fLastCov
 
GFDetPlane fFirstPlane
 
GFDetPlane fLastPlane
 
GFDetPlane fRefPlane
 

Detailed Description

Definition at line 7 of file SlTrackRep.h.

Constructor & Destructor Documentation

genf::SlTrackRep::SlTrackRep ( )

Definition at line 4 of file SlTrackRep.cxx.

5  :GFAbsTrackRep(4),_backw(0)
6 {
7 
8 }
genf::SlTrackRep::SlTrackRep ( const TMatrixT< double > &  _state,
const TMatrixT< double > &  sigma 
)

Definition at line 10 of file SlTrackRep.cxx.

12  :GFAbsTrackRep(4),_backw(0)
13 {
14  fState=_state;
15  for(int i=0;i<sigma.GetNrows();++i){
16  fCov[i][i]=sigma[i][0];
17  }
18  setReferencePlane(GFDetPlane(TVector3(0,0,0),TVector3(1,0,0),TVector3(0,1,0)));
19 }
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:94
void setReferencePlane(const GFDetPlane &pl)
Definition: SlTrackRep.h:24
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:91
genf::SlTrackRep::SlTrackRep ( const TMatrixT< double > &  _state,
const TMatrixT< double > &  sigma,
const double  z 
)

Definition at line 47 of file SlTrackRep.cxx.

50  :GFAbsTrackRep(4),_backw(0)
51 {
52 
53  fState=_state;
54  for(int i=0;i<sigma.GetNrows();++i){
55  fCov[i][i]=sigma[i][0];
56  }
57  setReferencePlane(GFDetPlane(TVector3(0,0,z),TVector3(1,0,0),TVector3(0,1,0)));
58 }
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:94
void setReferencePlane(const GFDetPlane &pl)
Definition: SlTrackRep.h:24
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:91
genf::SlTrackRep::SlTrackRep ( const GFDetPlane dp,
const TMatrixT< double > &  _state,
const TMatrixT< double > &  sigma 
)

Definition at line 35 of file SlTrackRep.cxx.

38  :GFAbsTrackRep(4),_backw(0)
39 {
40  fState=_state;
41  for(int i=0;i<sigma.GetNrows();++i){
42  fCov[i][i]=sigma[i][0];
43  }
45 }
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:94
void setReferencePlane(const GFDetPlane &pl)
Definition: SlTrackRep.h:24
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:91
genf::SlTrackRep::SlTrackRep ( const TVector3 &  pos,
const TVector3 &  dir 
)

Definition at line 21 of file SlTrackRep.cxx.

21  :GFAbsTrackRep(4),_backw(0)
22 {
23  GFDetPlane d(pos,dir);
25  fState[0][0]=0.;
26  fState[1][0]=0.;
27  fState[2][0]=0.;
28  fState[3][0]=0.;
29  fCov[0][0]=1.;
30  fCov[1][1]=1.;
31  fCov[2][2]=1.;
32  fCov[3][3]=1.;
33 }
string dir
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:94
void setReferencePlane(const GFDetPlane &pl)
Definition: SlTrackRep.h:24
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:91
genf::SlTrackRep::~SlTrackRep ( )
virtual

Definition at line 61 of file SlTrackRep.cxx.

62 {
63 
64 }

Member Function Documentation

virtual GFAbsTrackRep* genf::SlTrackRep::clone ( ) const
inlinevirtual

Implements genf::GFAbsTrackRep.

Definition at line 21 of file SlTrackRep.h.

21 {return new SlTrackRep(*this);}
double genf::SlTrackRep::extrapolate ( const GFDetPlane pl,
TMatrixT< double > &  statePred,
TMatrixT< double > &  covPred 
)
virtual

Definition at line 104 of file SlTrackRep.cxx.

107 {
108  //std::cout<<std::endl<<std::endl<<"extrapolate to plane with state and cov"<<std::endl<<std::endl;
109  statePred.ResizeTo(fDimension,1);
110  covPred.ResizeTo(fDimension,fDimension);
111  TVector3 o=pl.getO();
112  TVector3 u=pl.getU();
113  TVector3 v=pl.getV();
114  TVector3 w=u.Cross(v);
115  TVector3 ofrom=fRefPlane.getO();
116  TVector3 ufrom=fRefPlane.getU();
117  TVector3 vfrom=fRefPlane.getV();
118  TVector3 wfrom=ufrom.Cross(vfrom);
119  /*
120  std::cout<<"ufrom ";
121  ufrom.Print();
122  std::cout<<"vfrom ";
123  vfrom.Print();
124  std::cout<<"wfrom ";
125  wfrom.Print();
126  */
127  TVector3 p1=ofrom+fState[0][0]*ufrom+fState[1][0]*vfrom;
128  /*
129  std::cout<<"p1 ";
130  p1.Print();
131  */
132  TVector3 dir=(fState[2][0] * ufrom + fState[3][0] * vfrom + wfrom);//in global coordinates
133  /*
134  std::cout<<"dir ";
135  dir.Print();
136  */
137  if(w*dir==0){
138  std::cerr<<"track paralell to detector plane"<<std::endl
139  <<"extrapolation impossible, aborting"<<std::endl;
140  throw;
141  }
142 
143  double t= ((( w * o) - (w * p1)) /
144  (w * dir));
145 
146  double dist=t*dir.Mag();
147 
148  TVector3 p2=p1+t*dir;
149  /*
150  std::cout<<"xtrapolate point p2 ";
151  p2.Print();
152  */
153  double state0=(p2-o)*u;
154  double state1=(p2-o)*v;
155  double state2=(dir*u)/(dir*w);
156  double state3=(dir*v)/(dir*w);
157  /*
158  std::cout<<"start state:"<<std::endl;
159  std::cout<<fState[0][0]<<std::endl
160  <<fState[1][0]<<std::endl
161  <<fState[2][0]<<std::endl
162  <<fState[3][0]<<std::endl;
163  std::cout<<"end state:"<<std::endl;
164  std::cout<<fState0<<std::endl
165  <<fState1<<std::endl
166  <<fState2<<std::endl
167  <<fState3<<std::endl<<std::endl;
168  */
169  TMatrixT<double> jacobian(4,4);
170  /*
171  cg3 = .(ufrom
172  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, ufrom) * c * ufrom
173  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, ufrom) * d * vfrom
174  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, ufrom) *wfrom, u);
175 
176  cg4 = .(vfrom
177  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, vfrom) * c * ufrom
178  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, vfrom) * d * vfrom
179  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, vfrom) *wfrom, u);
180 
181  cg5 = .(- pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) * c * ufrom * .(w, ufrom)
182  + 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, o) * ufrom
183  - pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) * d * vfrom * .(w, ufrom)
184  - pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) *wfrom * .(w, ufrom)
185  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) * c * ufrom * .(w, ufrom)
186  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, ofrom + a * ufrom + b * vfrom) * ufrom
187  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) * d * vfrom * .(w, ufrom)
188  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) *wfrom * .(w, ufrom), u);
189 
190  cg6 = .(-pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) * c * ufrom * .(w, vfrom)
191  - pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) * d * vfrom * .(w, vfrom)
192  + 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, o) * vfrom
193  - pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) *wfrom * .(w, vfrom)
194  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) * c * ufrom * .(w, vfrom)
195  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) * d * vfrom * .(w, vfrom)
196  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, ofrom + a * ufrom + b * vfrom) * vfrom
197  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) *wfrom * .(w, vfrom), u);
198 
199  cg7 = .(ufrom
200  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, ufrom) * c * ufrom
201  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, ufrom) * d * vfrom
202  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, ufrom) *wfrom, v);
203 
204  cg8 = .(vfrom
205  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, vfrom) * c * ufrom
206  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, vfrom) * d * vfrom
207  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, vfrom) *wfrom, v);
208 
209  cg9 = .(-pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) * c * ufrom * .(w, ufrom)
210  + 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, o) * ufrom
211  - pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) * d * vfrom * .(w, ufrom)
212  - pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) *wfrom * .(w, ufrom)
213  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) * c * ufrom * .(w, ufrom)
214  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, ofrom + a * ufrom + b * vfrom) * ufrom
215  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) * d * vfrom * .(w, ufrom)
216  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) *wfrom * .(w, ufrom), v);
217 
218  cg10 = .(-pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) * c * ufrom * .(w, vfrom)
219  - pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) * d * vfrom * .(w, vfrom)
220  + 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, o) * vfrom
221  - pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, o) *wfrom * .(w, vfrom)
222  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) * c * ufrom * .(w, vfrom)
223  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) * d * vfrom * .(w, vfrom)
224  - 1 / .(w, c * ufrom + d * vfrom +wfrom) * .(w, ofrom + a * ufrom + b * vfrom) * vfrom
225  + pow(.(w, c * ufrom + d * vfrom +wfrom), -2) * .(w, ofrom + a * ufrom + b * vfrom) *wfrom * .(w, vfrom), v);
226 
227  cg11 = 0;
228  cg12 = 0;
229 
230  cg13 = .(ufrom, u) / .(c * ufrom + d * vfrom +wfrom, w)
231  - .(c * ufrom + d * vfrom +wfrom, u) * pow(.(c * ufrom + d * vfrom +wfrom, w), -2) * .(ufrom, w);
232 
233  cg14 = .(vfrom, u) / .(c * ufrom + d * vfrom +wfrom, w)
234  - .(c * ufrom + d * vfrom +wfrom, u) * pow(.(c * ufrom + d * vfrom +wfrom, w), -2) * .(vfrom, w);
235  cg15 = 0;
236  cg16 = 0;
237 
238  cg17 = .(ufrom, v) / .(c * ufrom + d * vfrom +wfrom, w)
239  - .(c * ufrom + d * vfrom +wfrom, v) * pow(.(c * ufrom + d * vfrom +wfrom, w), -2) * .(ufrom, w);
240 
241  cg18 = .(vfrom, v) / .(c * ufrom + d * vfrom +wfrom, w)
242  - .(c * ufrom + d * vfrom +wfrom, v) * pow(.(c * ufrom + d * vfrom +wfrom, w), -2) * .(vfrom, w);
243 
244  */
245 
246 
247  double jacobian0 = (ufrom
248  - 1 / (w * dir) * (w * ufrom) * fState[2][0] * ufrom
249  - 1 / (w * dir) * (w * ufrom) * fState[3][0] * vfrom
250  - 1 / (w * dir) * (w * ufrom) * wfrom) * u;
251 
252  double jacobian1 = (vfrom
253  - 1 / (w * dir) * (w * vfrom) * fState[2][0] * ufrom
254  - 1 / (w * dir) * (w * vfrom) * fState[3][0] * vfrom
255  - 1 / (w * dir) * (w * vfrom) * wfrom)* u;
256 
257  double jacobian2 = (- pow( (w * dir), -2) * (w * o) * fState[2][0] * ufrom * (w * ufrom)
258  + 1 / (w * dir) * (w * o) * ufrom
259  - pow((w * dir), -2) * (w * o) * fState[3][0] * vfrom * (w * ufrom)
260  - pow((w * dir), -2) * (w * o) * wfrom * (w * ufrom)
261  + pow((w * dir), -2) * (w * p1) * fState[2][0] * ufrom * (w * ufrom)
262  - 1 / (w * dir) * (w * p1) * ufrom
263  + pow((w * dir), -2) * (w * p1) * fState[3][0] * vfrom * (w * ufrom)
264  + pow((w * dir), -2) * (w * p1) * wfrom * (w * ufrom))* u;
265 
266  double jacobian3 = (-pow( ( w * dir), -2) * (w * o) * fState[2][0] * ufrom * (w * vfrom)
267  - pow((w * dir), -2) * (w * o) * fState[3][0] * vfrom * (w * vfrom)
268  + 1 / (w * dir) * (w * o) * vfrom
269  - pow((w * dir), -2) * (w * o) * wfrom * (w * vfrom)
270  + pow((w * dir), -2) * (w * p1) * fState[2][0] * ufrom * (w * vfrom)
271  + pow((w * dir), -2) * (w * p1) * fState[3][0] * vfrom * (w * vfrom)
272  - 1 / (w * dir) * (w * p1) * vfrom
273  + pow((w * dir), -2) * (w * p1) * wfrom * (w * vfrom))* u;
274 
275  double jacobian4 = (ufrom
276  - 1 / (w * dir) * (w * ufrom) * fState[2][0] * ufrom
277  - 1 / (w * dir) * (w * ufrom) * fState[3][0] * vfrom
278  - 1 / (w * dir) * (w * ufrom) * wfrom)* v;
279 
280  double jacobian5 = (vfrom
281  - 1 / (w * dir) * (w * vfrom) * fState[2][0] * ufrom
282  - 1 / (w * dir) * (w * vfrom) * fState[3][0] * vfrom
283  - 1 / (w * dir) * (w * vfrom) * wfrom)* v;
284 
285  double jacobian6 = (- pow( ( w * dir), -2) * (w * o) * fState[2][0] * ufrom * (w * ufrom)
286  + 1 / (w * dir) * (w * o) * ufrom
287  - pow((w * dir), -2) * (w * o) * fState[3][0] * vfrom * (w * ufrom)
288  - pow((w * dir), -2) * (w * o) * wfrom * (w * ufrom)
289  + pow((w * dir), -2) * (w * p1) * fState[2][0] * ufrom * (w * ufrom)
290  - 1 / (w * dir) * (w * p1) * ufrom
291  + pow((w * dir), -2) * (w * p1) * fState[3][0] * vfrom * (w * ufrom)
292  + pow((w * dir), -2) * (w * p1) * wfrom * (w * ufrom))* v;
293 
294  double jacobian7 = (- pow( ( w * dir), -2) * (w * o) * fState[2][0] * ufrom * (w * vfrom)
295  - pow((w * dir), -2) * (w * o) * fState[3][0] * vfrom * (w * vfrom)
296  + 1 / (w * dir) * (w * o) * vfrom
297  - pow((w * dir), -2) * (w * o) * wfrom * (w * vfrom)
298  + pow((w * dir), -2) * (w * p1) * fState[2][0] * ufrom * (w * vfrom)
299  + pow((w * dir), -2) * (w * p1) * fState[3][0] * vfrom * (w * vfrom)
300  - 1 / (w * dir) * (w * p1) * vfrom
301  + pow((w * dir), -2) * (w * p1) * wfrom * (w * vfrom))* v;
302  double jacobian8 = 0;
303  double jacobian9 = 0;
304 
305  double jacobian10 = ((ufrom * u) / (w * dir)
306  - (dir * u) * pow((w * dir), -2) * (w * ufrom));
307 
308  double jacobian11 = ((vfrom * u) / (w * dir)
309  - (dir * u) * pow((w * dir), -2) * (w * vfrom));
310  double jacobian12 = 0;
311  double jacobian13 = 0;
312 
313  double jacobian14 = ((ufrom * v) / (w * dir)
314  - (dir * v) * pow((w * dir), -2) * (w * ufrom));
315 
316  double jacobian15 = ((vfrom * v) / (w * dir)
317  - (dir * v) * pow((w * dir), -2) * (w * vfrom));
318 
319  jacobian[0][0]=jacobian0; jacobian[0][1]=jacobian1; jacobian[0][2]=jacobian2; jacobian[0][3]=jacobian3;
320  jacobian[1][0]=jacobian4; jacobian[1][1]=jacobian5; jacobian[1][2]=jacobian6; jacobian[1][3]=jacobian7;
321  jacobian[2][0]=jacobian8; jacobian[2][1]=jacobian9; jacobian[2][2]=jacobian10; jacobian[2][3]=jacobian11;
322  jacobian[3][0]=jacobian12; jacobian[3][1]=jacobian13; jacobian[3][2]=jacobian14; jacobian[3][3]=jacobian15;
323  TMatrixT<double> jacobianT(jacobian);
324  jacobianT.T();
325  covPred=jacobian*fCov*(jacobianT);
326  // std::cout<<"covariance[0][0]"<<covPred[0][0]<<std::endl;
327  statePred[0].Assign(state0);
328  statePred[1].Assign(state1);
329  statePred[2].Assign(state2);
330  statePred[3].Assign(state3);
331  return dist;
332 }
constexpr T pow(T x)
Definition: pow.h:72
unsigned int fDimension
Dimensionality of track representation.
Definition: GFAbsTrackRep.h:88
string dir
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:94
TVector3 getO() const
Definition: GFDetPlane.h:81
TVector3 getU() const
Definition: GFDetPlane.h:82
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:91
TVector3 getV() const
Definition: GFDetPlane.h:83
QTextStream & endl(QTextStream &s)
double genf::SlTrackRep::extrapolate ( const GFDetPlane pl,
TMatrixT< double > &  statePred 
)
virtual

Definition at line 65 of file SlTrackRep.cxx.

66  {
67  statePred.ResizeTo(fDimension,1);
68  TVector3 o=pl.getO();
69  TVector3 u=pl.getU();
70  TVector3 v=pl.getV();
71  TVector3 w=u.Cross(v);
72  TVector3 ofrom=fRefPlane.getO();
73  TVector3 ufrom=fRefPlane.getU();
74  TVector3 vfrom=fRefPlane.getV();
75  TVector3 wfrom=ufrom.Cross(vfrom);
76  TVector3 p1=ofrom+fState[0][0]*ufrom+fState[1][0]*vfrom;
77 
78  TVector3 dir=(fState[2][0] * ufrom + fState[3][0] * vfrom + wfrom);//in global coordinates
79 
80  if(w*dir==0){
81  std::cerr<<"track paralell to detector plane"<<std::endl
82  <<"extrapolation impossible, aborting"<<std::endl;
83  throw;
84  }
85 
86  double t= ((( w * o) - (w * p1)) /
87  (w * dir));
88 
89  double dist=t*dir.Mag();
90 
91  TVector3 p2=p1+t*dir;
92 
93  double state0=(p2-o)*u;
94  double state1=(p2-o)*v;
95  double state2=(dir*u)/(dir*w);
96  double state3=(dir*v)/(dir*w);
97 
98  statePred[0].Assign(state0);
99  statePred[1].Assign(state1);
100  statePred[2].Assign(state2);
101  statePred[3].Assign(state3);
102  return dist;
103 }
unsigned int fDimension
Dimensionality of track representation.
Definition: GFAbsTrackRep.h:88
string dir
TVector3 getO() const
Definition: GFDetPlane.h:81
TVector3 getU() const
Definition: GFDetPlane.h:82
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:91
TVector3 getV() const
Definition: GFDetPlane.h:83
QTextStream & endl(QTextStream &s)
void genf::SlTrackRep::extrapolateToLine ( const TVector3 &  point1,
const TVector3 &  point2,
TVector3 &  poca,
TVector3 &  normVec,
TVector3 &  poca_onwire 
)
virtual

This method extrapolates to the point of closest approach to a line.

This method extrapolates to the POCA to a line, i.e. a wire. There is a default implementation just like for the extrapolateToPoca for trackReps which do not need this feature, which will abort the execution if it is ever called.

Reimplemented from genf::GFAbsTrackRep.

Definition at line 352 of file SlTrackRep.cxx.

356  {
357 
358  TVector3 ofrom=fRefPlane.getO();
359  TVector3 ufrom=fRefPlane.getU();
360  TVector3 vfrom=fRefPlane.getV();
361  TVector3 wfrom=ufrom.Cross(vfrom);
362 
363  TVector3 pfrom=ofrom + fState[0][0]*ufrom + fState[1][0]*vfrom;
364  TVector3 dir=(fState[2][0] * ufrom + fState[3][0] * vfrom + wfrom);//in global coordinates
365  TVector3 lineDir=point2-point1;
366  //normal normal to both lineDir and Dir
367  TVector3 normal(dir.y()*lineDir.z()-dir.z()*lineDir.y(),
368  dir.x()*lineDir.z()-dir.z()*lineDir.x(),
369  dir.x()*lineDir.y()-dir.y()*lineDir.x());
370 
371  normal=normal.Unit();
372  TVector3 planeNorm=dir.Cross(normal);
373  double t=(planeNorm*point2-planeNorm*pfrom)/(planeNorm*dir);
374  poca=pfrom+t*dir;
375  double t2=(lineDir*poca - lineDir*point1)/(lineDir*lineDir);
376  poca_onwire=point1+lineDir*t2;
377  dirInPoca=dir;
378 
379 }
string dir
TVector3 getO() const
Definition: GFDetPlane.h:81
TVector3 getU() const
Definition: GFDetPlane.h:82
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:91
TVector3 getV() const
Definition: GFDetPlane.h:83
void genf::SlTrackRep::extrapolateToPoint ( const TVector3 &  point,
TVector3 &  poca,
TVector3 &  normVec 
)
virtual

This method is to extrapolate the track to point of closest approach to a point in space.

Reimplemented from genf::GFAbsTrackRep.

Definition at line 333 of file SlTrackRep.cxx.

335  {
336 
337  TVector3 ofrom=fRefPlane.getO();
338  TVector3 ufrom=fRefPlane.getU();
339  TVector3 vfrom=fRefPlane.getV();
340  TVector3 wfrom=ufrom.Cross(vfrom);
341  TVector3 pfrom=ofrom + fState[0][0]*ufrom + fState[1][0]*vfrom;
342  TVector3 dir=(fState[2][0] * ufrom + fState[3][0] * vfrom + wfrom);//in global coordinates
343  // pfrom.Print();
344  dir=dir.Unit();
345  //dir.Print();
346  double t = (dir * pos - dir * pfrom) / (dir * dir);
347 
348  poca=pfrom + t * dir;
349  dirInPoca=dir.Unit();
350 
351 }
string dir
TVector3 getO() const
Definition: GFDetPlane.h:81
TVector3 getU() const
Definition: GFDetPlane.h:82
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:91
TVector3 getV() const
Definition: GFDetPlane.h:83
virtual double genf::SlTrackRep::getCharge ( ) const
inlinevirtual

Implements genf::GFAbsTrackRep.

Definition at line 50 of file SlTrackRep.h.

50 {return 0;}
TVector3 genf::SlTrackRep::getMom ( const GFDetPlane pl)
virtual

Implements genf::GFAbsTrackRep.

Definition at line 387 of file SlTrackRep.cxx.

387  {
388  TMatrixT<double> statePred(fState);
389  if(pl!=fRefPlane){
390  extrapolate(pl,statePred);
391  }
392  TVector3 ret = pl.getNormal()+(statePred[2][0]*pl.getU())+(statePred[3][0]*pl.getV());
393  ret.SetMag(1.);
394  return ret;
395 }
virtual double extrapolate(const GFDetPlane &, TMatrixT< double > &statePred, TMatrixT< double > &covPred)
Definition: SlTrackRep.cxx:104
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:91
TVector3 genf::SlTrackRep::getPos ( const GFDetPlane pl)
virtual

Implements genf::GFAbsTrackRep.

Definition at line 380 of file SlTrackRep.cxx.

380  {
381  TMatrixT<double> statePred(fState);
382  if(pl!=fRefPlane){
383  extrapolate(pl,statePred);
384  }
385  return pl.getO()+(statePred[0][0]*pl.getU())+(statePred[1][0]*pl.getV());
386 }
virtual double extrapolate(const GFDetPlane &, TMatrixT< double > &statePred, TMatrixT< double > &covPred)
Definition: SlTrackRep.cxx:104
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:91
void genf::SlTrackRep::getPosMom ( const GFDetPlane pl,
TVector3 &  pos,
TVector3 &  mom 
)
virtual

Implements genf::GFAbsTrackRep.

Definition at line 396 of file SlTrackRep.cxx.

396  {
397  pos=getPos(pl);
398  mom=getMom(pl);
399 }
virtual GFAbsTrackRep* genf::SlTrackRep::prototype ( ) const
inlinevirtual

Implements genf::GFAbsTrackRep.

Definition at line 22 of file SlTrackRep.h.

22 {return new SlTrackRep();}
void genf::SlTrackRep::setReferencePlane ( const GFDetPlane pl)
inline

Definition at line 24 of file SlTrackRep.h.

24 {fRefPlane=pl;}
void genf::SlTrackRep::switchDirection ( )
inlinevirtual

Implements genf::GFAbsTrackRep.

Definition at line 52 of file SlTrackRep.h.

Member Data Documentation

int genf::SlTrackRep::_backw
private

Definition at line 57 of file SlTrackRep.h.


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