LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
genf::GeaneTrackRep2 Class Reference

#include "GeaneTrackRep2.h"

Inheritance diagram for genf::GeaneTrackRep2:
genf::GFAbsTrackRep

Public Member Functions

 GeaneTrackRep2 ()
 
 GeaneTrackRep2 (const GFDetPlane &plane, const TVector3 &mom, const TVector3 &poserr, const TVector3 &momerr, int PDGCode)
 
virtual ~GeaneTrackRep2 ()
 
virtual GFAbsTrackRepclone () const
 
virtual GFAbsTrackRepprototype () const
 
virtual double extrapolate (const GFDetPlane &, TMatrixT< Double_t > &statePred)
 returns the tracklength spanned in this extrapolation More...
 
virtual double extrapolate (const GFDetPlane &, TMatrixT< Double_t > &statePred, TMatrixT< Double_t > &covPred)
 Extrapolates the track to the given detectorplane. More...
 
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. More...
 
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. More...
 
virtual TVector3 getPos (const GFDetPlane &)
 
virtual TVector3 getMom (const GFDetPlane &)
 
virtual void getPosMom (const GFDetPlane &, TVector3 &pos, TVector3 &mom)
 
virtual void getPosMomCov (const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< Double_t > &cov)
 method which gets position, momentum and 6x6 covariance matrix More...
 
virtual double getCharge () const
 
int getPDG ()
 
void switchDirection ()
 
double extrapolate (const GFDetPlane &plane)
 This changes the state and cov and plane of the rep. More...
 
virtual void stepalong (double h)
 make step of h cm along the track 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
 
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 ()
 

Protected Attributes

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
 

Private Member Functions

void poca2Line (const TVector3 &, const TVector3 &, const TVector3 &, TVector3 &)
 
void pocaLine2Line (const TVector3 &point1, const TVector3 &line1, const TVector3 &point2, const TVector3 &line2, TVector3 &result1, TVector3 &result2)
 

Private Attributes

int fPdg
 
int fG3ParticleID
 
double fCharge
 

Friends

std::ostream & operator<< (std::ostream &s, const GeaneTrackRep2 &me)
 

Detailed Description

Definition at line 36 of file GeaneTrackRep2.h.

Constructor & Destructor Documentation

genf::GeaneTrackRep2::GeaneTrackRep2 ( )

Definition at line 35 of file GeaneTrackRep2.cxx.

Referenced by clone(), and prototype().

36  : GFAbsTrackRep(6), fPdg(0)
37 {
38 
39 }
genf::GeaneTrackRep2::GeaneTrackRep2 ( const GFDetPlane plane,
const TVector3 &  mom,
const TVector3 &  poserr,
const TVector3 &  momerr,
int  PDGCode 
)

Definition at line 41 of file GeaneTrackRep2.cxx.

References e, fCharge, genf::GFAbsTrackRep::fCov, fG3ParticleID, fPdg, genf::GFAbsTrackRep::fRefPlane, genf::GFAbsTrackRep::fState, genf::GFDetPlane::getO(), genf::GFDetPlane::getU(), genf::GFDetPlane::getV(), GFException::setFatal(), and w.

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 }
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:96
TVector3 getO() const
Definition: GFDetPlane.h:76
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:50
TVector3 getU() const
Definition: GFDetPlane.h:77
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:80
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:93
TVector3 getV() const
Definition: GFDetPlane.h:78
Float_t e
Definition: plot.C:34
Float_t w
Definition: plot.C:23
genf::GeaneTrackRep2::~GeaneTrackRep2 ( )
virtual

Definition at line 105 of file GeaneTrackRep2.cxx.

106 {
107 
108 }

Member Function Documentation

void genf::GFAbsTrackRep::addChiSqu ( double  aChiSqu)
inlineinherited

Definition at line 293 of file GFAbsTrackRep.h.

Referenced by genf::GFKalman::processHit().

293  {
294  fChiSqu += aChiSqu;
295  }
double fChiSqu
chiSqu of the track fit
Definition: GFAbsTrackRep.h:99
void genf::GFAbsTrackRep::addNDF ( unsigned int  n)
inlineinherited

Definition at line 296 of file GFAbsTrackRep.h.

References n.

Referenced by genf::GFKalman::processHit().

296  {
297  fNdf += n;
298  }
Char_t n[5]
virtual GFAbsTrackRep* genf::GeaneTrackRep2::clone ( ) const
inlinevirtual

Implements genf::GFAbsTrackRep.

Definition at line 51 of file GeaneTrackRep2.h.

References GeaneTrackRep2().

51 {return new GeaneTrackRep2(*this);}
double genf::GeaneTrackRep2::extrapolate ( const GFDetPlane plane,
TMatrixT< Double_t > &  statePred 
)
virtual

returns the tracklength spanned in this extrapolation

TODO: make this faster by neglecting covariances ?

Reimplemented from genf::GFAbsTrackRep.

Definition at line 114 of file GeaneTrackRep2.cxx.

Referenced by getMom(), getPos(), getPosMom(), and prototype().

116 {
117  TMatrixT<Double_t> covPred(6,6);
118  return extrapolate(pl,statePred,covPred);
120 }
virtual double extrapolate(const GFDetPlane &, TMatrixT< Double_t > &statePred)
returns the tracklength spanned in this extrapolation
double genf::GeaneTrackRep2::extrapolate ( const GFDetPlane plane,
TMatrixT< Double_t > &  statePred,
TMatrixT< Double_t > &  covPred 
)
virtual

Extrapolates the track to the given detectorplane.

Results are put into statePred and covPred This method does NOT alter the state of the object!

Implements genf::GFAbsTrackRep.

Definition at line 124 of file GeaneTrackRep2.cxx.

References d, dir, genf::GFDetPlane::dist(), E, e, fCharge, genf::GFAbsTrackRep::fCov, genf::GFAbsTrackRep::fDimension, fG3ParticleID, genf::GFAbsTrackRep::fRefPlane, genf::GFAbsTrackRep::fState, genf::GFAbsTrackRep::getMom(), genf::GFDetPlane::getO(), genf::GFDetPlane::getU(), genf::GFDetPlane::getV(), GFException::setFatal(), THETACUT, x1, and x2.

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 }
Float_t E
Definition: plot.C:23
Float_t x1[n_points_granero]
Definition: compare.C:5
unsigned int fDimension
Dimensionality of track representation.
Definition: GFAbsTrackRep.h:90
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
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
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:93
TVector3 getV() const
Definition: GFDetPlane.h:78
Float_t x2[n_points_geant4]
Definition: compare.C:26
Float_t e
Definition: plot.C:34
double genf::GFAbsTrackRep::extrapolate ( const GFDetPlane plane)
inherited

This changes the state and cov and plane of the rep.

This method extrapolates to to the plane and sets the results of state, cov and also plane in itself.

Definition at line 33 of file GFAbsTrackRep.cxx.

References genf::GFAbsTrackRep::extrapolate(), genf::GFAbsTrackRep::fDimension, and genf::GFAbsTrackRep::setData().

33  {
34  TMatrixT<Double_t> statePred(fDimension,1);
35  TMatrixT<Double_t> covPred(fDimension,fDimension);
36  double retVal = extrapolate(plane,statePred,covPred);
37  setData(statePred,plane,&covPred);
38  return retVal;
39 }
unsigned int fDimension
Dimensionality of track representation.
Definition: GFAbsTrackRep.h:90
virtual void setData(const TMatrixT< Double_t > &st, const GFDetPlane &pl, const TMatrixT< Double_t > *cov=NULL)
virtual double extrapolate(const GFDetPlane &plane, TMatrixT< Double_t > &statePred)
returns the tracklength spanned in this extrapolation
void genf::GeaneTrackRep2::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 449 of file GeaneTrackRep2.cxx.

References dir, genf::GFDetPlane::dist(), E, fCharge, genf::GFAbsTrackRep::fCov, fG3ParticleID, genf::GFAbsTrackRep::fRefPlane, genf::GFAbsTrackRep::getMom(), genf::GFAbsTrackRep::getPos(), poca2Line(), pocaLine2Line(), GFException::setFatal(), THETACUT, x1, and x2.

Referenced by prototype().

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 }
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
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:96
#define THETACUT
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
TDirectory * dir
Definition: macro.C:5
void pocaLine2Line(const TVector3 &point1, const TVector3 &line1, const TVector3 &point2, const TVector3 &line2, TVector3 &result1, TVector3 &result2)
Float_t x2[n_points_geant4]
Definition: compare.C:26
void genf::GeaneTrackRep2::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 262 of file GeaneTrackRep2.cxx.

References dir, genf::GFDetPlane::dist(), E, fCharge, genf::GFAbsTrackRep::fCov, fG3ParticleID, genf::GFAbsTrackRep::fRefPlane, genf::GFAbsTrackRep::getMom(), genf::GFAbsTrackRep::getPos(), poca2Line(), GFException::setFatal(), THETACUT, x1, and x2.

Referenced by prototype().

264  {
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 }
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
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:96
#define THETACUT
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
TDirectory * dir
Definition: macro.C:5
Float_t x2[n_points_geant4]
Definition: compare.C:26
virtual double genf::GeaneTrackRep2::getCharge ( ) const
inlinevirtual

Implements genf::GFAbsTrackRep.

Definition at line 92 of file GeaneTrackRep2.h.

References fCharge.

92 {return fCharge;}
double genf::GFAbsTrackRep::getChiSqu ( ) const
inlineinherited

Definition at line 245 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::fChiSqu.

Referenced by genf::GFTrack::getChiSqu(), genf::GFAbsTrackRep::getRedChiSqu(), trkf::Track3DKalman::produce(), and trkf::Track3DKalmanSPS::produce().

245  {
246  return fChiSqu;
247  }
double fChiSqu
chiSqu of the track fit
Definition: GFAbsTrackRep.h:99
const TMatrixT<Double_t>& genf::GFAbsTrackRep::getCov ( ) const
inlineinherited
double genf::GFAbsTrackRep::getCovElem ( int  i,
int  j 
) const
inlineinherited
unsigned int genf::GFAbsTrackRep::getDim ( ) const
inlineinherited

returns dimension of state vector

Definition at line 194 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::fDimension, and genf::GFAbsTrackRep::Print().

Referenced by genf::GFKalman::getChi2Hit(), genf::GFAbsTrackRep::getNDF(), genf::GFTrack::getResiduals(), genf::GFKalman::processHit(), and genf::GFDaf::processTrack().

194 {return fDimension;}
unsigned int fDimension
Dimensionality of track representation.
Definition: GFAbsTrackRep.h:90
TMatrixT<Double_t> genf::GFAbsTrackRep::getFirstCov ( ) const
inlineinherited

Definition at line 230 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::fFirstCov.

230  {
231  return fFirstCov;
232  }
TMatrixT< Double_t > fFirstCov
GFDetPlane genf::GFAbsTrackRep::getFirstPlane ( ) const
inlineinherited

Definition at line 233 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::fFirstPlane.

233  {
234  return fFirstPlane;
235  }
GFDetPlane fFirstPlane
TMatrixT<Double_t> genf::GFAbsTrackRep::getFirstState ( ) const
inlineinherited

Definition at line 227 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::fFirstState.

227  {
228  return fFirstState;
229  }
TMatrixT< Double_t > fFirstState
state, cov and plane for first and last point in fit
TMatrixT<Double_t> genf::GFAbsTrackRep::getLastCov ( ) const
inlineinherited

Definition at line 239 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::fLastCov.

239  {
240  return fLastCov;
241  }
TMatrixT< Double_t > fLastCov
GFDetPlane genf::GFAbsTrackRep::getLastPlane ( ) const
inlineinherited

Definition at line 242 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::fLastPlane.

Referenced by trkf::Track3DKalman::produce(), and trkf::Track3DKalmanSPS::produce().

242  {
243  return fLastPlane;
244  }
TMatrixT<Double_t> genf::GFAbsTrackRep::getLastState ( ) const
inlineinherited

Definition at line 236 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::fLastState.

236  {
237  return fLastState;
238  }
TMatrixT< Double_t > fLastState
TVector3 genf::GeaneTrackRep2::getMom ( const GFDetPlane pl)
virtual

Implements genf::GFAbsTrackRep.

Definition at line 605 of file GeaneTrackRep2.cxx.

References extrapolate(), genf::GFAbsTrackRep::fRefPlane, genf::GFAbsTrackRep::fState, genf::GFDetPlane::getNormal(), genf::GFDetPlane::getU(), and genf::GFDetPlane::getV().

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 }
virtual double extrapolate(const GFDetPlane &, TMatrixT< Double_t > &statePred)
returns the tracklength spanned in this extrapolation
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:93
unsigned int genf::GFAbsTrackRep::getNDF ( ) const
inlineinherited

Definition at line 253 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::getDim().

Referenced by genf::GFTrack::getNDF(), genf::GFAbsTrackRep::getRedChiSqu(), trkf::Track3DKalman::produce(), and trkf::Track3DKalmanSPS::produce().

253  {
254  if(fNdf>getDim()) return fNdf-getDim();
255  return 0;
256  }
unsigned int getDim() const
returns dimension of state vector
int genf::GeaneTrackRep2::getPDG ( )
inline

Definition at line 94 of file GeaneTrackRep2.h.

References fPdg.

94 {return fPdg;};
TVector3 genf::GeaneTrackRep2::getPos ( const GFDetPlane pl)
virtual

Implements genf::GFAbsTrackRep.

Definition at line 597 of file GeaneTrackRep2.cxx.

References extrapolate(), genf::GFAbsTrackRep::fRefPlane, genf::GFAbsTrackRep::fState, genf::GFDetPlane::getO(), genf::GFDetPlane::getU(), and genf::GFDetPlane::getV().

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 }
virtual double extrapolate(const GFDetPlane &, TMatrixT< Double_t > &statePred)
returns the tracklength spanned in this extrapolation
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:93
void genf::GeaneTrackRep2::getPosMom ( const GFDetPlane pl,
TVector3 &  pos,
TVector3 &  mom 
)
virtual

Implements genf::GFAbsTrackRep.

Definition at line 617 of file GeaneTrackRep2.cxx.

References extrapolate(), genf::GFAbsTrackRep::fRefPlane, genf::GFAbsTrackRep::fState, genf::GFDetPlane::getNormal(), genf::GFDetPlane::getO(), genf::GFDetPlane::getU(), and genf::GFDetPlane::getV().

Referenced by prototype().

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 }
virtual double extrapolate(const GFDetPlane &, TMatrixT< Double_t > &statePred)
returns the tracklength spanned in this extrapolation
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:93
void genf::GeaneTrackRep2::getPosMomCov ( const GFDetPlane pl,
TVector3 &  pos,
TVector3 &  mom,
TMatrixT< Double_t > &  cov 
)
virtual

method which gets position, momentum and 6x6 covariance matrix

default implementation in cxx file, if a ConcreteTrackRep can not implement this functionality

Reimplemented from genf::GFAbsTrackRep.

Definition at line 628 of file GeaneTrackRep2.cxx.

Referenced by prototype().

628  {
629  cov.ResizeTo(6,6);
630  std::cerr<<"insert brain here " << __FILE__ << " " << __LINE__
631  << " ->abort" <<std::endl;
632  throw;
633 }
void genf::GFAbsTrackRep::getPosMomCov ( TVector3 &  pos,
TVector3 &  mom,
TMatrixT< Double_t > &  c 
)
inlineinherited

Definition at line 223 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::getPosMomCov().

223  {
224  getPosMomCov(fRefPlane,pos,mom,c);
225  }
virtual void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< Double_t > &cov)
method which gets position, momentum and 6x6 covariance matrix
double genf::GFAbsTrackRep::getRedChiSqu ( ) const
inlineinherited

returns chi2/ndf

Definition at line 249 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::getChiSqu(), and genf::GFAbsTrackRep::getNDF().

Referenced by genf::GFTrack::getRedChiSqu().

249  {
250  if(getNDF()>0) return getChiSqu()/getNDF();
251  return 0;
252  }
unsigned int getNDF() const
double getChiSqu() const
const GFDetPlane& genf::GFAbsTrackRep::getReferencePlane ( ) const
inlineinherited
const TMatrixT<Double_t>& genf::GFAbsTrackRep::getState ( ) const
inlineinherited
double genf::GFAbsTrackRep::getStateElem ( int  i) const
inlineinherited

Definition at line 201 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::fState.

201 {return fState(i,0);}
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:93
bool genf::GFAbsTrackRep::getStatusFlag ( )
inlineinherited
void genf::GeaneTrackRep2::poca2Line ( const TVector3 &  extr1,
const TVector3 &  extr2,
const TVector3 &  point,
TVector3 &  result 
)
private

Definition at line 566 of file GeaneTrackRep2.cxx.

Referenced by extrapolateToLine(), and extrapolateToPoint().

566  {
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 }
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:50
void genf::GeaneTrackRep2::pocaLine2Line ( const TVector3 &  point1,
const TVector3 &  line1,
const TVector3 &  point2,
const TVector3 &  line2,
TVector3 &  result1,
TVector3 &  result2 
)
private

Definition at line 577 of file GeaneTrackRep2.cxx.

References E, and s.

Referenced by extrapolateToLine().

577  {
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 }
Float_t s
Definition: plot.C:23
Float_t E
Definition: plot.C:23
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:50
void genf::GFAbsTrackRep::Print ( std::ostream &  out = std::cout) const
virtualinherited

Definition at line 93 of file GFAbsTrackRep.cxx.

References genf::GFAbsTrackRep::fChiSqu, genf::GFAbsTrackRep::fCov, genf::GFAbsTrackRep::fRefPlane, genf::GFAbsTrackRep::fState, genf::GFDetPlane::Print(), and genf::PrintROOTmatrix().

Referenced by genf::GFAbsTrackRep::getDim(), and genf::GFTrack::Print().

93  {
94  out << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
95  out <<"GFAbsTrackRep::Parameters at reference plane ";
96  fRefPlane.Print(out);
97  out <<"GFAbsTrackRep::State"<<std::endl;
98  PrintROOTmatrix(out, fState);
99  out <<"GFAbsTrackRep::Covariances"<<std::endl;
100  PrintROOTmatrix(out, fCov);
101  out <<"GFAbsTrackRep::chi^2"<<std::endl;
102  out <<fChiSqu<<std::endl;
103  out << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
104 }
double fChiSqu
chiSqu of the track fit
Definition: GFAbsTrackRep.h:99
void PrintROOTmatrix(std::ostream &out, const TMatrixT< T > &m)
Small utility functions which print some ROOT objects into an output stream.
Definition: GFException.h:132
void Print(std::ostream &out=std::cout) const
Definition: GFDetPlane.cxx:242
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:96
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:93
virtual GFAbsTrackRep* genf::GeaneTrackRep2::prototype ( ) const
inlinevirtual
void genf::GFAbsTrackRep::reset ( )
virtualinherited

Definition at line 80 of file GFAbsTrackRep.cxx.

References genf::GFAbsTrackRep::fCov, genf::GFAbsTrackRep::fFirstCov, genf::GFAbsTrackRep::fFirstState, genf::GFAbsTrackRep::fLastCov, genf::GFAbsTrackRep::fLastState, genf::GFAbsTrackRep::fRefPlane, genf::GFAbsTrackRep::fState, and genf::GFDetPlane::set().

Referenced by genf::GFAbsTrackRep::getStatusFlag().

80  {
81  std::cout<<"GFAbsTrackRep::reset"<<std::endl;
82  TVector3 nullVec(0.,0.,0.);
83  fRefPlane.set(nullVec,nullVec,nullVec);
84  fState.Zero();
85  fCov.Zero();
86  fFirstState.Zero();
87  fFirstCov.Zero();
88  fLastState.Zero();
89  fLastCov.Zero();
90 }
void set(const TVector3 &o, const TVector3 &u, const TVector3 &v)
Definition: GFDetPlane.cxx:85
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:96
TMatrixT< Double_t > fFirstCov
TMatrixT< Double_t > fLastState
TMatrixT< Double_t > fLastCov
TMatrixT< Double_t > fFirstState
state, cov and plane for first and last point in fit
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:93
void genf::GFAbsTrackRep::setChiSqu ( double  aChiSqu)
inlineinherited

Definition at line 287 of file GFAbsTrackRep.h.

Referenced by genf::GFKalman::fittingPass().

287  {
288  fChiSqu = aChiSqu;
289  }
double fChiSqu
chiSqu of the track fit
Definition: GFAbsTrackRep.h:99
void genf::GFAbsTrackRep::setCov ( const TMatrixT< Double_t > &  aCov)
inlineinherited

Definition at line 263 of file GFAbsTrackRep.h.

Referenced by genf::GFDaf::blowUpCovs(), genf::GFKalman::blowUpCovs(), and genf::GFKalman::blowUpCovsDiag().

263  {
264  fCov=aCov;
265  }
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:96
virtual void genf::GFAbsTrackRep::setData ( const TMatrixT< Double_t > &  st,
const GFDetPlane pl,
const TMatrixT< Double_t > *  cov = NULL 
)
inlinevirtualinherited

Definition at line 258 of file GFAbsTrackRep.h.

Referenced by genf::GFAbsTrackRep::extrapolate(), genf::GFKalman::processHit(), genf::GFDaf::processTrack(), genf::RKTrackRep::setData(), and genf::RKTrackRep::switchDirection().

258  {
259  fState=st;
260  fRefPlane=pl;
261  if(cov!=NULL) fCov=*cov;
262  }
TMatrixT< Double_t > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:96
TMatrixT< Double_t > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:93
void genf::GFAbsTrackRep::setFirstCov ( const TMatrixT< Double_t > &  aCov)
inlineinherited

Definition at line 269 of file GFAbsTrackRep.h.

269  {
270  fFirstCov = aCov;
271  }
TMatrixT< Double_t > fFirstCov
void genf::GFAbsTrackRep::setFirstPlane ( const GFDetPlane aPlane)
inlineinherited

Definition at line 272 of file GFAbsTrackRep.h.

272  {
273  fFirstPlane = aPlane;;
274  }
GFDetPlane fFirstPlane
void genf::GFAbsTrackRep::setFirstState ( const TMatrixT< Double_t > &  aState)
inlineinherited

Definition at line 266 of file GFAbsTrackRep.h.

266  {
267  fFirstState = aState;
268  }
TMatrixT< Double_t > fFirstState
state, cov and plane for first and last point in fit
bool genf::GFAbsTrackRep::setInverted ( bool  f = true)
inlineinherited

Deprecated. Should be removed soon.

Definition at line 306 of file GFAbsTrackRep.h.

References f.

306 {fInverted=f; return true;}
bool fInverted
specifies the direction of flight of the particle
TFile f
Definition: plotHisto.C:6
void genf::GFAbsTrackRep::setLastCov ( const TMatrixT< Double_t > &  aCov)
inlineinherited

Definition at line 278 of file GFAbsTrackRep.h.

278  {
279  fLastCov = aCov;
280  }
TMatrixT< Double_t > fLastCov
void genf::GFAbsTrackRep::setLastPlane ( const GFDetPlane aPlane)
inlineinherited

Definition at line 281 of file GFAbsTrackRep.h.

281  {
282  fLastPlane = aPlane;;
283  }
void genf::GFAbsTrackRep::setLastState ( const TMatrixT< Double_t > &  aState)
inlineinherited

Definition at line 275 of file GFAbsTrackRep.h.

275  {
276  fLastState = aState;
277  }
TMatrixT< Double_t > fLastState
void genf::GFAbsTrackRep::setNDF ( unsigned int  n)
inlineinherited

Definition at line 290 of file GFAbsTrackRep.h.

References n.

Referenced by genf::GFKalman::fittingPass().

290  {
291  fNdf = n;
292  }
Char_t n[5]
void genf::GFAbsTrackRep::setStatusFlag ( int  _val)
inlineinherited

Definition at line 299 of file GFAbsTrackRep.h.

References genf::GFAbsTrackRep::switchDirection().

Referenced by genf::GFKalman::fittingPass(), and genf::GFDaf::processTrack().

299  {
300  fStatusFlag = _val;
301  }
int fStatusFlag
status of track representation: 0 means everything&#39;s OK
void genf::GFAbsTrackRep::stepalong ( double  h)
virtualinherited

make step of h cm along the track

There is an emply implementation in GFAbsTrackRep.cxx which will abort (see one of the extrapolate methods above). This can be overwritten, if this feature is needed.

Definition at line 71 of file GFAbsTrackRep.cxx.

References genf::GFAbsTrackRep::Abort().

71  {
72  Abort("stepalong()");
73 }
void Abort(std::string method)
void genf::GeaneTrackRep2::switchDirection ( )
inlinevirtual

Implements genf::GFAbsTrackRep.

Definition at line 97 of file GeaneTrackRep2.h.

97 {;}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const GeaneTrackRep2 me 
)
friend

Referenced by prototype().

Member Data Documentation

double genf::GeaneTrackRep2::fCharge
private
double genf::GFAbsTrackRep::fChiSqu
protectedinherited

chiSqu of the track fit

Definition at line 99 of file GFAbsTrackRep.h.

Referenced by genf::GFAbsTrackRep::getChiSqu(), and genf::GFAbsTrackRep::Print().

unsigned int genf::GFAbsTrackRep::fDimension
protectedinherited

Dimensionality of track representation.

Definition at line 90 of file GFAbsTrackRep.h.

Referenced by genf::SlTrackRep::extrapolate(), extrapolate(), genf::GFAbsTrackRep::extrapolate(), and genf::GFAbsTrackRep::getDim().

TMatrixT<Double_t> genf::GFAbsTrackRep::fFirstCov
protectedinherited
GFDetPlane genf::GFAbsTrackRep::fFirstPlane
protectedinherited

Definition at line 113 of file GFAbsTrackRep.h.

Referenced by genf::GFAbsTrackRep::getFirstPlane().

TMatrixT<Double_t> genf::GFAbsTrackRep::fFirstState
protectedinherited

state, cov and plane for first and last point in fit

Definition at line 108 of file GFAbsTrackRep.h.

Referenced by genf::GFAbsTrackRep::getFirstState(), and genf::GFAbsTrackRep::reset().

int genf::GeaneTrackRep2::fG3ParticleID
private
bool genf::GFAbsTrackRep::fInverted
protectedinherited

specifies the direction of flight of the particle

Definition at line 105 of file GFAbsTrackRep.h.

TMatrixT<Double_t> genf::GFAbsTrackRep::fLastCov
protectedinherited

Definition at line 112 of file GFAbsTrackRep.h.

Referenced by genf::GFAbsTrackRep::getLastCov(), and genf::GFAbsTrackRep::reset().

GFDetPlane genf::GFAbsTrackRep::fLastPlane
protectedinherited

Definition at line 114 of file GFAbsTrackRep.h.

Referenced by genf::GFAbsTrackRep::getLastPlane().

TMatrixT<Double_t> genf::GFAbsTrackRep::fLastState
protectedinherited
unsigned int genf::GFAbsTrackRep::fNdf
protectedinherited

Definition at line 100 of file GFAbsTrackRep.h.

int genf::GeaneTrackRep2::fPdg
private

Definition at line 107 of file GeaneTrackRep2.h.

Referenced by GeaneTrackRep2(), and getPDG().

int genf::GFAbsTrackRep::fStatusFlag
protectedinherited

status of track representation: 0 means everything's OK

Definition at line 103 of file GFAbsTrackRep.h.

Referenced by genf::GFAbsTrackRep::getStatusFlag().


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