BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkHelixRep Class Reference

#include <TrkHelixRep.h>

+ Inheritance diagram for TrkHelixRep:

Public Member Functions

 TrkHelixRep (const TrkExchangePar &inPar, TrkRecoTrk *myTrack, PdtPid::PidType hypo, const TrkHotList *=0)
 
 TrkHelixRep (const TrkExchangePar &inPar, TrkRecoTrk *trk, PdtPid::PidType hypo, int nact, int nsv, int ndc, double chi2, double startFoundRange, double endFoundRange)
 
virtual ~TrkHelixRep ()
 
virtual TrkHelixRepclone (TrkRecoTrk *newTrack) const
 
virtual TrkHelixRepcloneNewHypo (PdtPid::PidType hypo)
 
virtual TrkDifTrajtraj ()
 
virtual const TrkDifTrajtraj () const
 
const IfdKeymyKey () const
 
virtual TrkExchangePar helix (double fltLen) const
 
virtual bool resid (const TrkHitOnTrk *h, double &residual, double &residErr, bool exclude) const
 
virtual void printAll (std::ostream &ostr) const
 
virtual void print (std::ostream &ostr) const
 
virtual TrkSimpTrajsimpTraj ()
 
virtual const TrkSimpTrajsimpTraj () const
 
- Public Member Functions inherited from TrkSimpleRep
 TrkSimpleRep (const TrkHotList *, TrkRecoTrk *, PdtPid::PidType)
 
 TrkSimpleRep (TrkRecoTrk *, PdtPid::PidType, int nActive, int nSvt, int nDch, double chi2, double startFoundRange, double endFoundRange)
 
 TrkSimpleRep (const TrkSimpleRep &right, TrkRecoTrk *trk, PdtPid::PidType)
 
virtual ~TrkSimpleRep ()
 
int nDof () const
 
double chisq () const
 
void setChisq (double c)
 
virtual int charge () const
 
virtual Hep3Vector momentum (double fltL=0.) const
 
virtual double pt (double fltL=0.) const
 
virtual BesVectorErr momentumErr (double fltL) const
 
virtual HepMatrix posmomCov (double fltL) const
 
virtual void getAllCovs (double fltL, HepSymMatrix &xxCov, HepSymMatrix &ppCov, HepMatrix &xpCov) const
 
virtual void getAllWeights (double fltL, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight) const
 
virtual void getAllWeights (const HepPoint3D &pt, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight) const
 
virtual TrkErrCode fit ()
 
TrkHelixFitterfitter ()
 
- Public Member Functions inherited from TrkRep
 TrkRep (const TrkHotList &inHots, TrkRecoTrk *trk, PdtPid::PidType hypo)
 
 TrkRep (TrkHotList &inHots, TrkRecoTrk *trk, PdtPid::PidType hypo, bool stealHots=false)
 
 TrkRep (const TrkHotList *inHots, TrkRecoTrk *trk, PdtPid::PidType hypo)
 
 TrkRep (TrkHotList *inHots, TrkRecoTrk *trk, PdtPid::PidType hypo, bool takeownership=false)
 
 TrkRep (TrkRecoTrk *trk, PdtPid::PidType hypo, int nAct, int nSvt, int nMdc, double startFoundRange, double endFoundRange)
 
 TrkRep (TrkRecoTrk *trk, PdtPid::PidType hypo, bool createHotList=false)
 
 TrkRep (const TrkRep &oldRep, TrkRecoTrk *trk, PdtPid::PidType hypo)
 
virtual ~TrkRep ()
 
virtual TrkRepclone (TrkRecoTrk *newTrack) const =0
 
virtual TrkRepcloneNewHypo (PdtPid::PidType hypo)=0
 
bool operator== (const TrkRep &)
 
virtual ChisqConsistency chisqConsistency () const
 
virtual int nActive () const
 
virtual int nSvt () const
 
virtual int nMdc () const
 
virtual PdtPid::PidType particleType () const
 
TrkRecoTrkparentTrack ()
 
const TrkRecoTrkparentTrack () const
 
double startValidRange () const
 
double endValidRange () const
 
virtual double startFoundRange () const
 
virtual double endFoundRange () const
 
virtual const IfdKeymyKey () const
 
double trackT0 () const
 
virtual HepPoint3D position (double fltL) const
 
virtual Hep3Vector direction (double fltL) const
 
virtual double arrivalTime (double fltL) const
 
virtual BesPointErr positionErr (double fltL) const
 
virtual BesVectorErr directionErr (double fltL) const
 
virtual void addHot (TrkHitOnTrk *theHot)
 
virtual void removeHot (TrkHitOnTrk *theHot)
 
virtual void activateHot (TrkHitOnTrk *theHot)
 
virtual void deactivateHot (TrkHitOnTrk *theHot)
 
virtual TrkHotListhotList ()
 
virtual const TrkHotListhotList () const
 
virtual void updateHots ()
 
virtual bool resid (const TrkHitOnTrk *theHot, double &residual, double &residErr, bool exclude=false) const
 
bool hitCapable () const
 
virtual TrkErrCode fit ()=0
 
- Public Member Functions inherited from TrkFitStatus
bool is2d () const
 
bool fitCurrent () const
 
bool fitValid () const
 
bool multScat () const
 
std::ostream & printStatus (std::ostream &os=std::cout) const
 
void setValid (bool v)
 
void setCurrent (bool c)
 
void set2d (bool d)
 
void setMultScat (bool m)
 
const TrkErrCodefitStatus () const
 
history_iterator beginHistory () const
 
history_iterator endHistory () const
 
history_riterator reverseBeginHistory () const
 
history_riterator reverseEndHistory () const
 
std::pair< history_iterator, history_iterator > history () const
 
const std::vector< TrkHistory > & historyVector () const
 
virtual void addHistory (const TrkErrCode &status, const char *modulename)
 
template<class T >
void addHistory (T begin, T end)
 
template<class T >
void addHistory (std::pair< T, T > p)
 
std::ostream & printHistory (std::ostream &os=std::cout) const
 
- Public Member Functions inherited from TrkFit
virtual ChisqConsistency chisqConsistency () const =0
 
virtual bool validFlightLength (double fltL, double tolerance=0.0) const
 
void printType (std::ostream &ostr) const
 
virtual int nActive () const =0
 
virtual int nSvt () const =0
 
virtual int nMdc () const =0
 
virtual PdtPid::PidType particleType () const =0
 
virtual TrkExchangePar helix (double fltL) const =0
 
virtual double arrivalTime (double fltL) const =0
 
virtual double startFoundRange () const =0
 
virtual double endFoundRange () const =0
 
virtual int charge () const =0
 
virtual double chisq () const =0
 
virtual int nDof () const =0
 
virtual const TrkDifTrajtraj () const =0
 
virtual HepPoint3D position (double fltL) const =0
 
virtual Hep3Vector direction (double fltL) const =0
 
virtual Hep3Vector momentum (double fltL=0.) const =0
 
virtual double pt (double fltL=0.) const =0
 
virtual BesPointErr positionErr (double fltL) const =0
 
virtual BesVectorErr directionErr (double fltL) const =0
 
virtual BesVectorErr momentumErr (double fltL) const =0
 
virtual HepMatrix posmomCov (double fltL) const =0
 
virtual void getAllCovs (double fltL, HepSymMatrix &xxCov, HepSymMatrix &ppCov, HepMatrix &xpCov) const =0
 
virtual void getAllWeights (double fltL, HepVector &pos, HepVector &mom, HepSymMatrix &xxWeight, HepSymMatrix &ppWeight, HepMatrix &xpWeight) const =0
 
virtual double startValidRange () const =0
 
virtual double endValidRange () const =0
 
virtual void printAll (std::ostream &ostr) const =0
 
virtual void print (std::ostream &ostr) const =0
 
- Public Member Functions inherited from TrkHitOnTrkUpdater
virtual ~TrkHitOnTrkUpdater ()=0
 

Protected Member Functions

 TrkHelixRep (const TrkHelixRep &right, TrkRecoTrk *trk, PdtPid::PidType)
 
- Protected Member Functions inherited from TrkSimpleRep
TrkSimpleRepoperator= (const TrkSimpleRep &right)
 
virtual TrkSimpTrajsimpTraj ()=0
 
virtual const TrkSimpTrajsimpTraj () const =0
 
- Protected Member Functions inherited from TrkRep
TrkRepoperator= (const TrkRep &)
 
const TrkContexttrkContext () const
 
- Protected Member Functions inherited from TrkFitStatus
virtual ~TrkFitStatus ()
 
 TrkFitStatus ()
 
TrkFitStatusoperator= (const TrkFitStatus &)
 
 TrkFitStatus (const TrkFitStatus &)
 
- Protected Member Functions inherited from TrkFit
 TrkFit ()
 
virtual ~TrkFit ()
 
- Protected Member Functions inherited from TrkAbsFit
 TrkAbsFit ()
 
virtual ~TrkAbsFit ()
 
- Protected Member Functions inherited from TrkHitOnTrkUpdater
TrkErrCode updateMeasurement (TrkHitOnTrk &hot, const TrkDifTraj *traj=0, bool maintainAmbiguity=false) const
 
void setActivity (TrkHitOnTrk &hot, bool active) const
 
void setParent (TrkHitOnTrk &hot, TrkRep *parent) const
 
TrkBase::Functors::updateMeasurement updateMeasurement (const TrkDifTraj *traj=0, bool maintainAmbiguity=false) const
 
TrkBase::Functors::setParent setParent (TrkRep *parent) const
 
TrkBase::Functors::setActive setActive (bool active) const
 

Additional Inherited Members

- Public Types inherited from TrkFitStatus
typedef std::unary_function< TrkFitStatus, boolpredicate_type
 
- Protected Attributes inherited from TrkRep
std::auto_ptr< TrkHotList_hotList
 

Detailed Description

Definition at line 22 of file TrkHelixRep.h.

Constructor & Destructor Documentation

◆ TrkHelixRep() [1/3]

TrkHelixRep::TrkHelixRep ( const TrkExchangePar inPar,
TrkRecoTrk myTrack,
PdtPid::PidType  hypo,
const TrkHotList hots = 0 
)

Definition at line 21 of file TrkHelixRep.cxx.

24 :
25 TrkSimpleRep(hots, trk, hypo),
26 _traj(inPar)
27{}

◆ TrkHelixRep() [2/3]

TrkHelixRep::TrkHelixRep ( const TrkExchangePar inPar,
TrkRecoTrk trk,
PdtPid::PidType  hypo,
int  nact,
int  nsv,
int  ndc,
double  chi2,
double  startFoundRange,
double  endFoundRange 
)

Definition at line 31 of file TrkHelixRep.cxx.

33 :
34 TrkSimpleRep(trk, hypo, nact, nsv, ndc, chi2, stFndRng, endFndRng),
35 _traj(inPar.params(), inPar.covariance())
36{}
const HepVector & params() const
const HepSymMatrix & covariance() const

◆ ~TrkHelixRep()

TrkHelixRep::~TrkHelixRep ( )
virtual

Definition at line 43 of file TrkHelixRep.cxx.

44{}

◆ TrkHelixRep() [3/3]

TrkHelixRep::TrkHelixRep ( const TrkHelixRep right,
TrkRecoTrk trk,
PdtPid::PidType  hypo 
)
protected

Definition at line 39 of file TrkHelixRep.cxx.

39 :
40 TrkSimpleRep(old, trk, hypo), _traj(old._traj)
41{}

Member Function Documentation

◆ clone()

TrkHelixRep * TrkHelixRep::clone ( TrkRecoTrk newTrack) const
virtual

Implements TrkRep.

Definition at line 47 of file TrkHelixRep.cxx.

48{
49 TrkHelixRep* newRep = new TrkHelixRep(*this, theTrack, this->particleType());
50 newRep->setCurrent(fitCurrent());
51 return newRep;
52}
bool fitCurrent() const
Definition: TrkFitStatus.h:33
void setCurrent(bool c)
Definition: TrkFitStatus.h:39
virtual PdtPid::PidType particleType() const
Definition: TrkRep.cxx:308

◆ cloneNewHypo()

TrkHelixRep * TrkHelixRep::cloneNewHypo ( PdtPid::PidType  hypo)
virtual

Implements TrkRep.

Definition at line 55 of file TrkHelixRep.cxx.

56{
57 TrkHelixRep* newRep = new TrkHelixRep(*this, parentTrack(), hypo);
58 newRep->setValid(fitValid());
59 newRep->setCurrent(fitCurrent()); // true for helices, anyway
60 return newRep;
61}
void setValid(bool v)
bool fitValid() const
Definition: TrkFitStatus.h:34
TrkRecoTrk * parentTrack()
Definition: TrkRep.h:82

◆ helix()

TrkExchangePar TrkHelixRep::helix ( double  fltLen) const
virtual

Implements TrkFit.

Definition at line 64 of file TrkHelixRep.cxx.

65{
66 HepVector outPar = _traj.parameters()->parameter();
68 return TrkExchangePar(outPar, _traj.parameters()->covariance());
69}
double rad() const
Definition: BesAngle.h:118
HepVector & parameter()
Definition: DifIndepPar.h:51
@ phi0Index
Definition: HelixTraj.h:30
HepSymMatrix & covariance()
Definition: TrkParams.h:54
TrkParams * parameters()
Definition: TrkSimpTraj.h:80

◆ myKey()

const IfdKey & TrkHelixRep::myKey ( ) const
virtual

Reimplemented from TrkRep.

Definition at line 118 of file TrkHelixRep.cxx.

119{
120 static IfdIntKey _theKey(3133);
121 return _theKey;
122}

◆ print()

void TrkHelixRep::print ( std::ostream &  ostr) const
virtual

Implements TrkAbsFit.

Definition at line 72 of file TrkHelixRep.cxx.

73{
74 ostr << "TrkHelixRep "
75 << " q: "<<charge()
76 << " phi0: " << BesAngle(_traj.phi0()).rad()
77 << " om: "<<_traj.omega()
78 << " pt: "<<pt()
79 << " p: "<<momentum()
80 << " d0: " << _traj.d0()
81 << " z0: " << _traj.z0()
82 << " ct: " << _traj.tanDip()
83 << "parent track: "<<parentTrack()->id() << endl;
84}
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum
double omega() const
Definition: HelixTraj.h:81
double d0() const
Definition: HelixTraj.h:79
double phi0() const
Definition: HelixTraj.cxx:510
double z0() const
Definition: HelixTraj.h:82
double tanDip() const
Definition: HelixTraj.h:83
const TrkId & id() const
Definition: TrkRecoTrk.cxx:134
virtual double pt(double fltL=0.) const
virtual int charge() const

Referenced by printAll().

◆ printAll()

void TrkHelixRep::printAll ( std::ostream &  ostr) const
virtual

Implements TrkAbsFit.

Definition at line 87 of file TrkHelixRep.cxx.

88{
89 print(ostr);
90}
virtual void print(std::ostream &ostr) const
Definition: TrkHelixRep.cxx:72

◆ resid()

bool TrkHelixRep::resid ( const TrkHitOnTrk h,
double &  residual,
double &  residErr,
bool  exclude 
) const
virtual

Reimplemented from TrkRep.

Definition at line 126 of file TrkHelixRep.cxx.

128{
129 if (this != h->getParentRep() ) return false;
130 static HepVector derivs; double deltaChi;
131 TrkErrCode errCode = h->getFitStuff( derivs, deltaChi );
132 // TODO: add caching of derivatives here...
133 if (errCode.failure()) return false;
134 if (!exclude || !h->isActive()) {
135 HepSymMatrix c = _traj.parameters()->covariance().similarityT(derivs);
136 double tErr2 = c(1,1);
137 double rms = h->hitRms();
138 residual=h->residual();
139 double e2=rms*rms+(h->isActive()?-1:1)*tErr2;
140 if (e2<0) return false;
141 residErr=sqrt(e2);
142 } else {
143 assert(h->isActive());
144 // FIXME: never really checked this is really OK...
145 // FIXME: should compare to HelixRefiner...
146 HepSymMatrix w=_traj.parameters()->covariance();
147 int ier;
148 w.invert(ier);
149 if (ier!=0) return false;
150 HepVector p0 = _traj.parameters()->parameter();
151 HepVector p1 = w*p0;
152 p1 -= deltaChi*derivs;
153 for (unsigned i=0; i<p0.num_row(); ++i) for (unsigned j=0; j<i+1 ;++j) {
154 w.fast(i+1,j+1) -= derivs[i]*derivs[j];
155 }
156 w.invert(ier);
157 if (ier!=0) return false;
158 residual=h->residual()+h->hitRms()*dot(derivs,w*p1-p0);
159 residErr=h->hitRms()*sqrt(w(1,1)+1);
160 }
161 return true;
162}
Double_t e2
int failure() const
Definition: TrkErrCode.h:61
double residual() const
double hitRms() const
Definition: TrkHitOnTrk.h:89
const TrkRep * getParentRep() const
Definition: TrkHitOnTrk.h:73
bool isActive() const
Definition: TrkHitOnTrk.h:200
TrkErrCode getFitStuff(HepVector &derivs, double &deltaChi) const

◆ simpTraj() [1/2]

TrkSimpTraj & TrkHelixRep::simpTraj ( )
virtual

Implements TrkSimpleRep.

Definition at line 93 of file TrkHelixRep.cxx.

94{
95 return _traj;
96}

◆ simpTraj() [2/2]

const TrkSimpTraj & TrkHelixRep::simpTraj ( ) const
virtual

Implements TrkSimpleRep.

Definition at line 99 of file TrkHelixRep.cxx.

100{
101 return _traj;
102}

◆ traj() [1/2]

TrkDifTraj & TrkHelixRep::traj ( )
virtual

Definition at line 105 of file TrkHelixRep.cxx.

106{
107 return _traj;
108}

◆ traj() [2/2]

const TrkDifTraj & TrkHelixRep::traj ( ) const
virtual

Implements TrkAbsFit.

Definition at line 111 of file TrkHelixRep.cxx.

112{
113 return _traj;
114}

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