LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
GeaneTrackRep2.cxx
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 //
4 // Description:
5 // Implementation of class GeaneTrackRep
6 // see GeaneTrackRep.hh for details
7 //
8 // Environment:
9 // Software developed for the PANDA Detector at FAIR.
10 //
11 // Author List:
12 // Sebastian Neubert TUM (original author)
13 //
14 //
15 //-----------------------------------------------------------
16 
17 // Panda Headers ----------------------
18 
19 // This Class' Header ------------------
21 
22 // C/C++ Headers ----------------------
23 #include <iostream>
24 #include <cmath>
25 
26 // Collaborating Class Headers --------
29 #include "TGeant3/TGeant3.h"
30 #include "TDatabasePDG.h"
31 // Class Member definitions -----------
32 
33 #define THETACUT 0.4
34 
36  : GFAbsTrackRep(6), fPdg(0)
37 {
38 
39 }
40 
42  const TVector3& mom,
43  const TVector3& poserr,
44  const TVector3& momerr,
45  int PDGCode)
46  : GFAbsTrackRep(6), fPdg(PDGCode)
47 {
48 
49  fG3ParticleID=TDatabasePDG::Instance()->ConvertPdgToGeant3(fPdg);
50  //TDatabasePDG has charge in units of |e|/3
51  fCharge=TDatabasePDG::Instance()->GetParticle(fPdg)->Charge()/3.;
52  /*
53  std::cout << "Initializing GeaneTrackRep2 for particle "
54  << TDatabasePDG::Instance()->GetParticle(fPdg)->GetName()
55  << std::endl;
56  */
57  fRefPlane=plane;
58  TVector3 o=fRefPlane.getO();
59  TVector3 u=fRefPlane.getU();
60  TVector3 v=fRefPlane.getV();
61  TVector3 w=u.Cross(v);
62 
63  fState[3][0] = 0.;
64  fState[4][0] = 0.;
65  fState[0][0] = fCharge/mom.Mag();
66  double pu,pv,pw;
67  pu = mom*u;
68  pv = mom*v;
69  pw = mom*w;
70 
71  if(fabs(pw)<1.e-10){
72  throw GFException("fabs(pw<1.e-10)",__LINE__,__FILE__).setFatal();
73  }
74  fState[1][0] = pu/pw;
75  fState[2][0] = pv/pw;
76  if(pw>0.){
77  //set spu
78  fState[5][0] = 1.;
79  }
80  else{
81  //set spu
82  fState[5][0] = -1.;
83  }
84  fCov[3][3] = poserr.X()*poserr.X() * u.X()*u.X() +
85  poserr.Y()*poserr.Y() * u.Y()*u.Y() +
86  poserr.Z()*poserr.Z() * u.Z()*u.Z();
87  fCov[4][4] = poserr.X()*poserr.X() * v.X()*v.X() +
88  poserr.Y()*poserr.Y() * v.Y()*v.Y() +
89  poserr.Z()*poserr.Z() * v.Z()*v.Z();
90  fCov[0][0] = fCharge*fCharge/pow(mom.Mag(),6.) *
91  (mom.X()*mom.X() * momerr.X()*momerr.X()+
92  mom.Y()*mom.Y() * momerr.Y()*momerr.Y()+
93  mom.Z()*mom.Z() * momerr.Z()*momerr.Z());
94  fCov[1][1] = pow((u.X()/pw - w.X()*pu/(pw*pw)),2.)*momerr.X()*momerr.X() +
95  pow((u.Y()/pw - w.Y()*pu/(pw*pw)),2.)*momerr.Y()*momerr.Y() +
96  pow((u.Z()/pw - w.Z()*pu/(pw*pw)),2.)*momerr.Z()*momerr.Z();
97  fCov[2][2] = pow((v.X()/pw - w.X()*pv/(pw*pw)),2.)*momerr.X()*momerr.X() +
98  pow((v.Y()/pw - w.Y()*pv/(pw*pw)),2.)*momerr.Y()*momerr.Y() +
99  pow((v.Z()/pw - w.Z()*pv/(pw*pw)),2.)*momerr.Z()*momerr.Z();
100  //fCov[5][5] is zero - spu has no error
101 
102 }
103 
104 
106 {
107 
108 }
109 
110 
111 
112 
113 double
115  TMatrixT<Double_t>& statePred)
116 {
117  TMatrixT<Double_t> covPred(6,6);
118  return extrapolate(pl,statePred,covPred);
120 }
121 
122 
123 double
125  TMatrixT<Double_t>& statePred,
126  TMatrixT<Double_t>& covPred)
127 {
128  if(fabs(getMom(fRefPlane).Theta()/TMath::Pi()*180.) < THETACUT){
129  throw GFException("GEANE propagation not possible for p.theta<THETACUT",__LINE__,__FILE__).setFatal();
130  }
131 
132  TGeant3 *gMC3 = (TGeant3*) gMC;
133  if(!gMC3){
134  throw GFException("GeaneTrackRep2: TGeant3 has not been initialized.",__LINE__,__FILE__).setFatal();
135  }
136 
137  statePred.ResizeTo(fDimension,1);covPred.ResizeTo(fDimension,fDimension);
138  TVector3 oto=pl.getO();TVector3 uto=pl.getU();TVector3 vto=pl.getV();
139 
140  TVector3 ofrom=fRefPlane.getO();TVector3 ufrom=fRefPlane.getU();TVector3 vfrom=fRefPlane.getV();
141  TVector3 wfrom=ufrom.Cross(vfrom);;
142 
143  Float_t pli[6];
144  pli[0]=ufrom.X();pli[1]=ufrom.Y();pli[2]=ufrom.Z();pli[3]=vfrom.X();pli[4]=vfrom.Y();pli[5]=vfrom.Z();
145 
146  Float_t plf[12];
147  plf[0]=uto.X();plf[1]=uto.Y();plf[2]=uto.Z();plf[3]=vto.X();plf[4]=vto.Y();plf[5]=vto.Z();plf[6]=oto.X();plf[7]=oto.Y();plf[8]=oto.Z();
148 
149  TString geaneOption;
150  geaneOption="PE";
151 
152  Float_t ein[15];
153  int count=0;;
154  for(int i=0; i<5;++i){
155  for(int j=i;j<5;++j){
156  ein[count++]=fCov[i][j];
157  }
158  }
159  //convert covariance from q/p to 1/p
160  ein[0] /= fCharge*fCharge;ein[1] *= fCharge;ein[2] *= fCharge;ein[3] *= fCharge;ein[4] *= fCharge;
161 
162  if(fState[3][0]==0)fState[3][0]=1E-4;
163  if(fState[4][0]==0)fState[4][0]=1E-4;
164  gMC3->Eufilp(1, ein, pli, plf);
165 
166  TVector3 x1vect;
167  Float_t x1[3];Float_t x2[3];Float_t p1[3];Float_t p2[3];
168 
169  x1vect = ofrom + fState[3][0]*ufrom + fState[4][0]*vfrom;
170  x1vect.GetXYZ(x1);
171  double mom = 1.e30;
172  //double pOVERpw = sqrt(1.+fState[1][0]*fState[1][0]+fState[2][0]*fState[2][0]);
173  if(fabs(fState[0][0])>1.e-30) mom = 1./fabs(fState[0][0]);
174 
175  //momentum in 'local mars'
176  TVector3 p1vect = fState[5][0]*(wfrom+fState[1][0]*ufrom+fState[2][0]*vfrom);
177  p1vect.SetMag(mom);
178 
179  p1vect.GetXYZ(p1);
180 
181  //Determine whether we are doing a forward or backward step:
182  TVector3 dir=pl.dist(x1vect); // direction from pos to plane;
183  if((dir*p1vect)<0){
184  geaneOption="BPE";
185  }
186 
187  for(unsigned int i=0;i<3;++i) {
188  x2[i]=0.;
189  p2[i]=0.;
190  }
191 
192  gMC3->Ertrak(x1,p1,x2,p2,fG3ParticleID, geaneOption.Data());
193 
194  if(x2[0]<-1.E29) {
195  GFException e("obsolete exception?: x2[0]<-1.E29",__LINE__,__FILE__);
196  e.setFatal();
197  throw e;
198  }
199  if(fabs(p2[0])==0. && fabs(p2[1])==0. && fabs(p2[2])==0) {
200  GFException e("fabs(p2[0])==0. && fabs(p2[1])==0. && fabs(p2[2])==0",__LINE__,__FILE__);
201  e.setFatal();
202  throw e;
203  }
204  double trklength = gMC3->TrackLength();
205  Ertrio_t *ertrio = gMC3->fErtrio;
206 
207 #ifndef OLDVMC
208  Ertrio1_t *ertrio1 = gMC3->fErtrio1;
209  if(ertrio1->iertr != 0){
210  GFException e("GEANE error flag for numerical divergence detected",__LINE__,__FILE__);
211  e.setFatal();
212  throw e;
213  }
214 #endif
215 
216  Double_t cov15[15];
217 
218  for(Int_t i=0;i<15;i++) {
219  cov15[i]=ertrio->errout[i];
220  //go from 1/p to q/p
221  if(i == 0) cov15[i] = cov15[i] * fCharge * fCharge;
222  if(i > 0 && i < 5) cov15[i] = cov15[i] * fCharge;
223  }
224 
225  count=0;
226  for(int i=0;i<5;++i){
227  for(int j=i;j<5;++j){
228  covPred[i][j]=cov15[count];
229  if(i!=j)covPred[j][i]=cov15[count];
230  ++count;
231  }
232  }
233  TVector3 d(x2[0]-oto.X(),x2[1]-oto.Y(),x2[2]-oto.Z());
234  statePred[3][0] = d*uto;
235  statePred[4][0] = d*vto;
236  TVector3 p2vect(p2[0],p2[1],p2[2]);
237  statePred[0][0] = fCharge/p2vect.Mag();
238  double pu,pv,pw;
239  pu = p2vect*uto;
240  pv = p2vect*vto;
241  pw = p2vect*(uto.Cross(vto));
242 
243  if(fabs(pw)<1.e-10){
244  GFException exc("fabs(pw)<1.e-10",__LINE__,__FILE__);
245  exc.setFatal();
246  throw exc;
247  }
248  if(pw>0.){
249  statePred[5][0]=1.;
250  statePred[1][0] = pu/fabs(pw);
251  statePred[2][0] = pv/fabs(pw);
252  }
253  else{
254  statePred[5][0]=-1.;
255  statePred[1][0] = -1.*pu/fabs(pw);
256  statePred[2][0] = -1.*pv/fabs(pw);
257  }
258  return trklength;
259 }
260 
261 void
263  TVector3& poca,
264  TVector3& normVec){
265 
266  if(fabs(getMom(fRefPlane).Theta()/TMath::Pi()*180.) < THETACUT){
267  GFException exc("GEANE propagation not possible for p.theta<THETACUT",__LINE__,__FILE__);
268  exc.setFatal();
269  throw exc;
270  }
271 
272  TGeant3 *gMC3 = (TGeant3*) gMC;
273  if(gMC3==NULL){
274  std::cerr << "GeaneTrackRep2: TGeant3 has not been initialized. -> abort"
275  << std::endl;
276  throw;
277  }
278 
279 
280  Float_t nullVec[3];
281  nullVec[0]=0.; nullVec[1]=0.; nullVec[2]=0.;
282  Float_t posArr[3];
283  pos.GetXYZ(posArr);
284  // gMC3->SetClose(pca,pf,dst,w1,w2,po1,po2,po3,cl);
285  gMC3->SetClose(1,posArr,999,nullVec,nullVec,nullVec,nullVec,nullVec,nullVec);
286 
287 
288  Float_t ein[15];
289  int count=0;;
290  for(int i=0; i<5;++i){
291  for(int j=i;j<5;++j){
292  ein[count++]=fCov[i][j];
293  }
294  }
295  //convert covariance from q/p to 1/p
296  ein[0] /= fCharge*fCharge;ein[1] *= fCharge;ein[2] *= fCharge;ein[3] *= fCharge;ein[4] *= fCharge;
297 
298  TVector3 mypos = getPos(fRefPlane);
299  TVector3 mymom = getMom(fRefPlane);
300  Float_t x1[3];
301  Float_t p1[3];
302  Float_t x2[3];
303  Float_t p2[3];
304  Float_t po1[3];
305  Float_t po2[3];
306  Float_t po3[3];
307  Float_t clen[3];
308  for(unsigned int i=0;i<3;++i){
309  x2[i]=0.;p2[i]=0.;po1[i]=0.;po2[i]=0.;po3[i]=0.;clen[i]=0.;
310  }
311  mypos.GetXYZ(x1);
312  mymom.GetXYZ(p1);
313  Float_t maxlen[1] = {(float)(2.*((mypos-pos).Mag()))};
314  gMC3->Eufill(1, ein, maxlen);
315 
316 
317  TString geaneOption;
318  geaneOption="LO";
319  //Determine whether we are doing a forward or backward step:
320  TVector3 dir=fRefPlane.dist(pos); // direction from pos to plane;
321  if((dir*mymom)>0){
322  geaneOption="BLO";
323  }
324 
325  gMC3->Ertrak(x1,p1,x2,p2,fG3ParticleID, geaneOption.Data());
326 
327  gMC3->GetClose(po1,po2,po3,clen);
328 
329  TVector3 poV1(po1);
330  TVector3 poV2(po2);
331  TVector3 poV3(po3);
332  if((fabs(clen[0])<1.E-8 && fabs(clen[1])<1.E-8) ||
333  fabs(clen[0]-clen[1])<1.E-8){
334  poca2Line(poV2,poV3,pos,poca);
335  normVec = poV3-poV2;
336  }
337 
338  else if(fabs(clen[1]-clen[2])<1.E-8){
339  poca2Line(poV1,poV2,pos,poca);
340  normVec = poV2-poV1;
341  }
342  else{
343  TVector3 result12,result23;
344  poca2Line(poV1,poV2,pos,result12);
345  poca2Line(poV2,poV3,pos,result23);
346  if((result12-pos).Mag()<(result23-pos).Mag()){
347  poca = result12;
348  if( (poV2-poca).Mag() > 0.25*(poV1-poV2).Mag() ){
349  normVec = poV2-poV1;
350  }
351  else{//poca is close to poV2, so take poV3-poV1 as direction vector
352  normVec = poV3-poV1;
353  }
354  }
355  else{
356  poca = result23;
357  if( (poV2-poca).Mag() > 0.25*(poV2-poV3).Mag() ){
358  normVec = poV3-poV2;
359  }
360  else{//poca is close to poV2, so take poV3-poV1 as direction vector
361  normVec = poV3-poV1;
362  }
363  }
364  }
365  normVec.SetMag(1.);
366  /*
367  int dim = getDim();
368  TMatrixT<Double_t> statePred(dim,1);
369  TMatrixT<Double_t> covPred(dim,dim);
370  //std::cout<<"GeaneTrackRep2::extrapolateToPoint"<<std::endl;
371  //fRefPlane.Print();
372 
373  TVector3 ofrom=fRefPlane.getO();
374  TVector3 ufrom=fRefPlane.getU();
375  TVector3 vfrom=fRefPlane.getV();
376 
377  _geane->SetPoint(pos);
378  _geane->PropagateFromPlane(ufrom,vfrom);
379 
380  double cova[15];
381  int count=0;;
382  for(int i=0; i<5;++i){
383  for(int j=i;j<5;++j){
384  cova[count++]=cov[i][j];
385  }
386  }
387  // protect against low momentum:
388  if(fabs(state[0][0])>10){
389  GFException exc("GeaneTrackRep2: PROTECT AGAINST LOW MOMENTA",__LINE__,__FILE__);
390  exc.setFatal();
391  throw exc;
392  }
393 
394  // protect against (x,y)=(0,0)
395  if(state[3][0]==0)state[3][0]=1E-4;
396  if(state[4][0]==0)state[4][0]=1E-4;
397 
398  FairTrackParP par(state[3][0],state[4][0],state[1][0],state[2][0],state[0][0],cova,ofrom,ufrom,vfrom,_spu);
399  //par.Print();
400  bool backprop=_backw<0;
401  if(_backw==0){
402  // check if new point is after or before my position
403  TVector3 dir=fRefPlane.dist(pos); // direction from pos to plane;
404  backprop= (dir*getMom(fRefPlane))>0;
405  }
406  if(!backprop){ // point lies in same direction of flight as momentum
407  //std::cout<<" Propagate in flight direction"<<std::endl;
408  _geane->PropagateToVirtualPlaneAtPCA(1);
409  }
410  else{
411  //std::cout<<" backPropagate"<<std::endl;
412  _geane->BackTrackToVirtualPlaneAtPCA(1);
413  }
414 
415  FairTrackParP result;
416  Bool_t prop = kTRUE;
417  prop = _geane->Propagate(&par,&result,fPdg); //211
418  if (prop==kFALSE) {
419  GFException exc("GEANE propagation failed",__LINE__,__FILE__);
420  exc.setFatal();
421  throw exc;
422  //pl=fRefPlane;
423  //return pos;
424  }
425 
426  statePred[0][0]=result.GetQp();
427  statePred[1][0]=result.GetTV();
428  statePred[2][0]=result.GetTW();
429  statePred[3][0]=result.GetV();
430  statePred[4][0]=result.GetW();
431 
432  double* rescov=result.GetCov();
433  count=0;
434  for(int i=0;i<5;++i){
435  for(int j=i;j<5;++j){
436  covPred[i][j]=rescov[count];
437  if(i!=j)covPred[j][i]=rescov[count];
438  ++count;
439  }
440  }
441 
442  poca.SetXYZ(result.GetX(),result.GetY(),result.GetZ());
443  normVec = result.GetJVer().Cross( result.GetKVer() );
444  */
445 }
446 
447 
448 void
450  const TVector3& point2,
451  TVector3& poca,
452  TVector3& normVec,
453  TVector3& poca_onWire)
454 {
455  if(fabs(getMom(fRefPlane).Theta()/TMath::Pi()*180.) < THETACUT){
456  GFException exc("GEANE propagation not possible for p.theta<THETACUT",__LINE__,__FILE__);
457  exc.setFatal();
458  throw exc;
459  }
460 
461  TGeant3 *gMC3 = (TGeant3*) gMC;
462  if(gMC3==NULL){
463  std::cerr << "GeaneTrackRep2: TGeant3 has not been initialized. -> abort"
464  << std::endl;
465  throw;
466  }
467 
468 
469  Float_t nullVec[3];
470  nullVec[0]=0.; nullVec[1]=0.; nullVec[2]=0.;
471  Float_t w1Arr[3];
472  Float_t w2Arr[3];
473  point1.GetXYZ(w1Arr);
474  point2.GetXYZ(w2Arr);
475  // gMC3->SetClose(pca,pf,dst,w1,w2,po1,po2,po3,cl);
476  gMC3->SetClose(2,nullVec,999,w1Arr,w2Arr,nullVec,nullVec,nullVec,nullVec);
477 
478 
479  Float_t ein[15];
480  int count=0;;
481  for(int i=0; i<5;++i){
482  for(int j=i;j<5;++j){
483  ein[count++]=fCov[i][j];
484  }
485  }
486  //convert covariance from q/p to 1/p
487  ein[0] /= fCharge*fCharge;ein[1] *= fCharge;ein[2] *= fCharge;ein[3] *= fCharge;ein[4] *= fCharge;
488 
489  TVector3 mypos = getPos(fRefPlane);
490  TVector3 mymom = getMom(fRefPlane);
491  Float_t x1[3];
492  Float_t p1[3];
493  Float_t x2[3];
494  Float_t p2[3];
495  Float_t po1[3];
496  Float_t po2[3];
497  Float_t po3[3];
498  Float_t clen[3];
499  for(unsigned int i=0;i<3;++i){
500  x2[i]=0.;p2[i]=0.;po1[i]=0.;po2[i]=0.;po3[i]=0.;clen[i]=0.;
501  }
502  mypos.GetXYZ(x1);
503  mymom.GetXYZ(p1);
504 
505  TVector3 pointOnWireClosestToMyPos;
506  poca2Line(point1,point2,mypos,pointOnWireClosestToMyPos);
507 
508  Float_t maxlen[1] = {(float)(2.*((mypos-pointOnWireClosestToMyPos).Mag()))};
509  gMC3->Eufill(1, ein, maxlen);
510 
511  //point1 muss pocaOnWire sein
512  TString geaneOption;
513  geaneOption="LO";
514  //Determine whether we are doing a forward or backward step:
515  TVector3 dir=fRefPlane.dist(pointOnWireClosestToMyPos); // direction from pos to plane;
516  if((dir*mymom)>0){
517  geaneOption="BLO";
518  }
519 
520  gMC3->Ertrak(x1,p1,x2,p2,fG3ParticleID, geaneOption.Data());
521 
522  gMC3->GetClose(po1,po2,po3,clen);
523 
524  TVector3 poV1(po1);
525  TVector3 poV2(po2);
526  TVector3 poV3(po3);
527  if((fabs(clen[0])<1.E-8 && fabs(clen[1])<1.E-8) ||
528  fabs(clen[0]-clen[1])<1.E-8){
529  pocaLine2Line(poV2,poV3-poV2,point1,point2-point1,poca,poca_onWire);
530  normVec = poV3-poV2;
531  }
532  else if(fabs(clen[1]-clen[2])<1.E-8){
533  pocaLine2Line(poV1,poV2-poV1,point1,point2-point1,poca,poca_onWire);
534  normVec = poV2-poV1;
535  }
536  else{
537  TVector3 result12_1,result12_2,result23_1,result23_2;
538  pocaLine2Line(poV1,poV2-poV1,point1,point2-point1,result12_1,result12_2);
539  pocaLine2Line(poV2,poV3-poV2,point1,point2-point1,result23_1,result23_2);
540  if((result12_1-result12_2).Mag()<(result23_1-result23_2).Mag()){
541  poca = result12_1;
542  poca_onWire = result12_2;
543  if( (poV2-poca).Mag() > 0.25*(poV1-poV2).Mag() ){
544  normVec = poV2-poV1;
545  }
546  else{//poca is close to poV2, so take poV3-poV1 as direction vector
547  normVec = poV3-poV1;
548  }
549  }
550  else{
551  poca = result23_1;
552  poca_onWire = result23_2;
553  if( (poV2-poca).Mag() > 0.25*(poV2-poV3).Mag() ){
554  normVec = poV3-poV2;
555  }
556  else{//poca is close to poV2, so take poV3-poV1 as direction vector
557  normVec = poV3-poV1;
558  }
559  }
560  }
561  normVec.SetMag(1.);
562 
563 
564 }
565 
566 void genf::GeaneTrackRep2::poca2Line(const TVector3& extr1,const TVector3& extr2,const TVector3& point,TVector3& result){
567 
568  TVector3 theWire = extr2-extr1;
569  if(theWire.Mag()<1.E-8){
570  GFException exc("GeaneTrackRep2::poca2Line(): try to find poca between line and point, but the line is really just a point",__LINE__,__FILE__);
571  throw exc;
572  }
573  double t = 1./(theWire*theWire)*(point*theWire+extr1*extr1-extr1*extr2);
574  result = extr1+t*theWire;
575 }
576 
577 void genf::GeaneTrackRep2::pocaLine2Line(const TVector3& point1,const TVector3& line1,const TVector3& point2, const TVector3& line2,TVector3& result1,TVector3& result2){
578  TVector3 l(line1);
579  l.SetMag(1.);
580  TVector3 k(line2);
581  k.SetMag(1.);
582  double kl = k*l;
583 
584  if(fabs(kl)<1.E-8){
585  GFException exc("GeaneTrackRep2::pocaLine2Line(): lines are parallel",__LINE__,__FILE__);
586  throw exc;
587  }
588  double s = 1./(kl*kl-1)*(point2*k-point1*k-(point2*l-point1*l)*kl);
589  double t = (point2*l+s*kl-point1*l);
590  result1 = point1+t*l;
591  result2 = point2+s*k;
592 }
593 
594 
595 
596 TVector3
598 {
599  TMatrixT<Double_t> statePred(fState);
600  if(pl!=fRefPlane)extrapolate(pl,statePred);
601  return pl.getO()+(statePred[3][0]*pl.getU())+(statePred[4][0]*pl.getV());
602 }
603 
604 TVector3
606 {
607  TMatrixT<Double_t> statePred(fState);
608  if(pl!=fRefPlane)extrapolate(pl,statePred);
609  //pl.Print();
610  //statePred.Print();
611 
612  TVector3 mom = statePred[5][0]*(pl.getNormal()+statePred[1][0]*pl.getU()+statePred[2][0]*pl.getV());
613  mom.SetMag(1./fabs(statePred[0][0]));
614  return mom;
615 }
616 void
617 genf::GeaneTrackRep2::getPosMom(const GFDetPlane& pl,TVector3& pos, TVector3& mom)
618 {
619  TMatrixT<Double_t> statePred(fState);
620  if(pl!=fRefPlane)extrapolate(pl,statePred);
621  mom = statePred[5][0]*(pl.getNormal()+statePred[1][0]*pl.getU()+statePred[2][0]*pl.getV());
622  mom.SetMag(1./fabs(statePred[0][0]));
623  pos = pl.getO()+(statePred[3][0]*pl.getU())+(statePred[4][0]*pl.getV());
624 }
625 
626 
627 void
628 genf::GeaneTrackRep2::getPosMomCov(const GFDetPlane& /* pl */,TVector3& /* pos */,TVector3& /* mom */,TMatrixT<Double_t>& cov){
629  cov.ResizeTo(6,6);
630  std::cerr<<"insert brain here " << __FILE__ << " " << __LINE__
631  << " ->abort" <<std::endl;
632  throw;
633 }
634 
635 
636 //ClassImp(GeaneTrackRep2)
Float_t s
Definition: plot.C:23
Float_t E
Definition: plot.C:23
Float_t x1[n_points_granero]
Definition: compare.C:5
TVector3 dist(const TVector3 &point) const
Definition: GFDetPlane.cxx:209
unsigned int fDimension
Dimensionality of track representation.
Definition: GFAbsTrackRep.h:90
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:85
TVector3 getNormal() const
Definition: GFDetPlane.cxx:140
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:96
TVector3 getO() const
Definition: GFDetPlane.h:76
#define THETACUT
Float_t d
Definition: plot.C:237
virtual double extrapolate(const GFDetPlane &, TMatrixT< Double_t > &statePred)
returns the tracklength spanned in this extrapolation
void poca2Line(const TVector3 &, const TVector3 &, const TVector3 &, TVector3 &)
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:50
TVector3 getU() const
Definition: GFDetPlane.h:77
TDirectory * dir
Definition: macro.C:5
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:80
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.
void extrapolateToPoint(const TVector3 &pos, TVector3 &poca, TVector3 &normVec)
This method is to extrapolate the track to point of closest approach to a point in space...
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:93
virtual void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< Double_t > &cov)
method which gets position, momentum and 6x6 covariance matrix
void pocaLine2Line(const TVector3 &point1, const TVector3 &line1, const TVector3 &point2, const TVector3 &line2, TVector3 &result1, TVector3 &result2)
TVector3 getV() const
Definition: GFDetPlane.h:78
Float_t x2[n_points_geant4]
Definition: compare.C:26
Float_t e
Definition: plot.C:34
Float_t w
Definition: plot.C:23
virtual void getPosMom(const GFDetPlane &, TVector3 &pos, TVector3 &mom)