#include <StiKalmanTrack.h>

Public Types | |
| enum | TRefitStatus { kNoErrors = 0, kRefitFail, kNotEnoughUsed, kInNodeNotValid, kBadQA, kVertexNodeInvalid, kNodeNotValid, kTooManyDroppedNodes } |
Public Member Functions | |
| StiKalmanTrack () | |
| virtual | ~StiKalmanTrack () |
| void | reset () |
| void | unset () |
| void | getMomentum (double p[3], double e[6]) const |
| Calculates and returns the momentum and error of the track. | |
| double | getP () const |
| Calculates and returns the momentum of the track at the inner most node. | |
| double | getPt () const |
| Calculates and returns the transverse momentum of the track at the inner most node. | |
| double | getCurvature () const |
| Return the curvature of the track at its inner most point. | |
| double | getRapidity () const |
| Return the rapidity of the track if the mass is known. | |
| double | getPseudoRapidity () const |
| Return the pseudorapidity of the track. | |
| double | getPhi () const |
| Return azimuthal angle at inner most point of the track. | |
| double | getTanL () const |
| Returns the tangent of the dip angle of the track determined at the inner most point of the track. | |
| double | getDca () const |
| virtual double | getDca (const StiHit *vertex) const |
| Return global dca of the track relative to given vertex or point. | |
| void | setDca (double dca) |
| double | getDca (StiTrack *t) const |
| int | getPointCount (int detectorId=0) const |
| Return the number of hits associated with this track. | |
| int | getFitPointCount (int detectorId=0) const |
| Returns the number of hits associated and used in the fit of this track. | |
| void | getAllPointCount (int count[1][3], int maxDetId) const |
| Returns all the PointCount far all detectors and types of nodes. | |
| int | getGapCount () const |
| Return the number of gaps on this track. | |
| double | getTrackLength () const |
| double | getNearBeam (StThreeVectorD *pnt=0, StThreeVectorD *dir=0) const |
| int | getMaxPointCount (int detectorId=0) const |
| UShort_t | getSeedHitCount () const |
| number of hits used to seed the track | |
| void | setSeedHitCount (UShort_t c) |
| int | isPrimary () const |
| void | setPrimary (int vertex) |
| double | calculateTrackLength () const |
| double | calculateTrackSegmentLength (const StiKalmanTrackNode &p1, const StiKalmanTrackNode &p2) const |
| double | getTrackRadLength () const |
| int | calculatePointCount () const |
| int | calculateMaxPointCount () const |
| double | getTpcDedx () const |
| double | getSvtDedx () const |
| StiKTNBidirectionalIterator | begin () const |
| const StiKTNBidirectionalIterator & | end () const |
| StiKTNBidirectionalIterator | rbegin () const |
| const StiKTNBidirectionalIterator & | rend () const |
| void | removeLastNode () |
| StiKalmanTrackNode * | getInnOutMostNode (int inot, int qua) const |
| Same for getNNodes(qua). | |
| StiKalmanTrackNode * | getOuterMostNode (int qua=0) const |
| Accessor method returns the outer most node associated with the track. | |
| StiKalmanTrackNode * | getInnerMostNode (int qua=0) const |
| Accessor method returns the inner most node associated with the track. | |
| StiKalmanTrackNode * | getOuterMostHitNode (int qua=0) const |
| Accessor method returns the outer most hit node associated with the track. | |
| StiKalmanTrackNode * | getInnerMostHitNode (int qua=0) const |
| Accessor method returns the inner most hit node associated with the track. | |
| int | getNNodes (int qua=0) const |
| int | releaseHits (double rMin=4, double rMax=50) |
| StiKalmanTrackNode * | getFirstNode () const |
| Accessor method returns the first node associated with the track. | |
| StiKalmanTrackNode * | getLastNode () const |
| Accessor method returns the last node associated with the track. | |
| void | setLastNode (StiKalmanTrackNode *n) |
| void | setFirstNode (StiKalmanTrackNode *n) |
| void | setFirstLastNode (StiKalmanTrackNode *n) |
| virtual void | add (StiTrackNode *node, int direction) |
| int | initialize (const vector< StiHit * > &) |
| Convenience method to initialize a track based on seed information. | |
| StThreeVector< double > | getMomentumAtOrigin () const |
| Method to return the pointer to the fitter parameters. | |
| StThreeVector< double > | getPoint (int firstLast=0) const |
| virtual vector< StiHit * > | getHits () |
|
virtual vector< const StMeasuredPoint * > | stHits () const |
| return hits; | |
|
virtual vector < StiKalmanTrackNode * > | getNodes (int detectorGroupId) const |
| return vector of nodes with hits | |
| double | getMass () const |
| int | getCharge () const |
| double | getChi2 () const |
| double | getDca2 (StiTrack *t) const |
| double | getDca3 (StiTrack *t) const |
| bool | find (int direction=kOutsideIn) |
| int | refit () |
| int | refitL () |
| void | reserveHits () |
| StiTrackNode * | extendToVertex (StiHit *vertex) |
| void | setFlag (long v) |
| long | getFlag () const |
| StiKalmanTrackNode * | extrapolateToBeam () |
| StiKalmanTrackNode * | extrapolateToRadius (double radius) |
| int | approx (int mode=0) |
| void | reduce () |
| StMCTruth | getTruth (double rXYMin=0, double rXYMax=1000) const |
| void | print (const char *opt="") const |
| StiKalmanTrack & | operator= (const StiKalmanTrack &tk) |
| int | rejectByHitSet () const |
Static Public Member Functions | |
| static void | setKalmanTrackNodeFactory (Factory< StiKalmanTrackNode > *) |
| Set the factory used for the creation of kalman track nodes. | |
| static void | setMaxRefiter (int maxRefiter) |
| static void | setDebug (int m=0) |
| static int | debug () |
Public Attributes | |
| double | _vChi2 |
Static Public Attributes | |
| static int | _debug = 0 |
Protected Attributes | |
| StiKalmanTrackNode * | firstNode |
| StiKalmanTrackNode * | lastNode |
| UShort_t | mSeedHitCount |
| int | mVertex |
| long | mFlag |
| double | m |
| double | _dca |
Static Protected Attributes | |
| static int | mgMaxRefiter = 100 |
|
static Factory < StiKalmanTrackNode > * | trackNodeFactory = 0 |
Friends | |
| ostream & | operator<< (ostream &os, const StiKalmanTrack &track) |
A concrete subclass of StiTrack defining a Kalman track to be used by the Kalman Track Finder.
The track reconstruction is driven by an instance of class StiKalmanTrackFinder while the Kalman state of the track at any given location is held by instances of the StiKalmanTrackNode class. The use of nodes allows, in principle, to have, during the track search, and reconstruction, tracks that behave as trees rather than simple linear or sequential structures.
Users should not invoke the ctor of this class directly but should instead call the "getObject" method of the StiKalmantrackFactory class to get instances of this class. The StiKalmanTrackFactory holds (and owns, i.e. has responsibility for memory management) of a large array of re-usable track objects. Instances of this class should only be obtained from the factory as this eliminates (or at the very least minimizes the risk) of memory leaks.
This class holds a static pointer to a track node factory. The factory is invoked whenever instances of StiTrackNode are needed. The class holds pointers to the fisrt and last node associated with a track. Given that the reconstruction proceeds primarily outside-in, the first node is the outer most point associated with this track. The last node is the inner most point associated with the track.
This class includes a host of convenience methods to calculate track properties such as the number of hits on the track (getPointCount), the track length (getTrackLength), etc. Many of those properties are not stored internally but rather calculated on the fly from the appropriate nodes on the tracks. This offers the advantage that it is not necessary to recalculate these various properties systematically each time a fit or re-fit is performed but once when the information is actually needed.
Definition at line 78 of file StiKalmanTrack.h.
| StiKalmanTrack::StiKalmanTrack | ( | ) | [inline] |
Constructor Delegates the initialization of the object to the reset method. Note that users should not call this ctor directly but should instead invoke to the "getInstance" method of the Factory<StiKalmanTrack> class to get instances of this class. The StiKalmanTrackFactory holds (and owns, i.e. has responsibility for memory management) of a large array of re-usable track objects. Instances of this class should only be obtained from the factory as this eliminates (or at the very least minimizes the risk) of memory leaks.
Definition at line 90 of file StiKalmanTrack.h.
| virtual StiKalmanTrack::~StiKalmanTrack | ( | ) | [inline, virtual] |
Destructor Nothing to be done as instances of this class do not "own" the objects (i.e. nodes) its members point to.
Definition at line 103 of file StiKalmanTrack.h.
| void StiKalmanTrack::add | ( | StiTrackNode * | node, | |
| int | direction | |||
| ) | [virtual] |
Add a kalman track node to this track as a child to the last node of the track Return the added node
Definition at line 1406 of file StiKalmanTrack.cxx.
Referenced by StiKalmanTrackFinder::extendTracksToVertex().
| StiKTNBidirectionalIterator StiKalmanTrack::begin | ( | ) | const [inline] |
Convenience method used to return a track node iterator initialized to the track first node.
| runtime_error |
Definition at line 539 of file StiKalmanTrack.h.
Referenced by StiKalmanTrackFitter::fit(), getAllPointCount(), getChi2(), getFitPointCount(), getGapCount(), getInnOutMostNode(), getMaxPointCount(), getNodes(), getPointCount(), getTrackLength(), getTrackRadLength(), and stHits().
| const StiKTNBidirectionalIterator & StiKalmanTrack::end | ( | ) | const [inline] |
Convenience method used to return a track node iterator initialized to the track last node.
| runtime_error |
Definition at line 562 of file StiKalmanTrack.h.
Referenced by StiKalmanTrackFitter::fit(), getAllPointCount(), getChi2(), getFitPointCount(), getGapCount(), getMaxPointCount(), getNodes(), getPointCount(), getTrackRadLength(), and stHits().
| StiTrackNode * StiKalmanTrack::extendToVertex | ( | StiHit * | vertex | ) | [virtual] |
Extend track to the given vertex.
Attempt an extension of the track the given vertex.
Implements StiTrack.
Definition at line 1149 of file StiKalmanTrack.cxx.
References StiKalmanTrackNode::evaluateChi2(), getInnerMostHitNode(), getInnerMostNode(), StiHit::isDca(), StiKalmanTrackNode::propagate(), StiHit::rotate(), stHits(), and StiKalmanTrackNode::updateNode().
Referenced by StiKalmanTrackFinder::extendTracksToVertex().
| StiKalmanTrackNode * StiKalmanTrack::extrapolateToBeam | ( | ) |
Extrapolate this track to the beam axis (x==0) to provide an estimate of the track location at the beam axis. Returns a null pointer is the operation cannot be completed i.e. the track does not reach the beam axis plane.
Definition at line 1382 of file StiKalmanTrack.cxx.
References getInnerMostNode(), and StiKalmanTrackNode::propagateToBeam().
| int StiKalmanTrack::getCharge | ( | ) | const [virtual] |
Return the track sign
Implements StiTrack.
Definition at line 619 of file StiKalmanTrack.cxx.
References StiKalmanTrackNode::getCharge(), and getInnerMostNode().
Referenced by StiKalmanTrackFinder::extendTracksToVertex().
| double StiKalmanTrack::getChi2 | ( | ) | const [virtual] |
Return the track chi2 per dof
The track chi2 is calculated from the incremental chi2 of all nodes carrying a hit that contributed to the fit of the track. Note that a hit is not counted as contributing to the fit if its chi2 exceeds "StiKalmanTrackFitterParameters::instance()->getMaxChi2()" Note that this function returns "-1" if the number of fit points is smaller than 6
Implements StiTrack.
Definition at line 632 of file StiKalmanTrack.cxx.
| double StiKalmanTrack::getCurvature | ( | ) | const [inline, virtual] |
Return the curvature of the track at its inner most point.
Calculates and returns the track curvature at the inner most node held by this track.
Obtains the curvature from the inner most hit node associated with this track.
Implements StiTrack.
Definition at line 397 of file StiKalmanTrack.h.
References StiKalmanTrackNode::getCurvature(), and getInnerMostHitNode().
| double StiKalmanTrack::getDca | ( | StiTrack * | t | ) | const [inline] |
Returns the distance of closest approach of this track to the give track.
Definition at line 505 of file StiKalmanTrack.h.
| double StiKalmanTrack::getDca | ( | ) | const [inline, virtual] |
Returns the distance of closest approach of this track to the given hit.
Implements StiTrack.
Definition at line 487 of file StiKalmanTrack.h.
| double StiKalmanTrack::getDca2 | ( | StiTrack * | t | ) | const [inline, virtual] |
Calculate and return the distance of closest approach to given track - 2D calc
Implements StiTrack.
Definition at line 517 of file StiKalmanTrack.h.
| double StiKalmanTrack::getDca3 | ( | StiTrack * | t | ) | const [inline, virtual] |
Calculate and return the distance of closest approach to given track - 3D calc
Implements StiTrack.
Definition at line 529 of file StiKalmanTrack.h.
| int StiKalmanTrack::getFitPointCount | ( | int | detectorId = 0 |
) | const [virtual] |
Returns the number of hits associated and used in the fit of this track.
Get number of fit points in given detector.
Return the number of hits (points) used in the fit of this track.
Implements StiTrack.
Definition at line 766 of file StiKalmanTrack.cxx.
References begin(), StiHit::detector(), and end().
| int StiKalmanTrack::getGapCount | ( | ) | const [virtual] |
Return the number of gaps on this track.
Return the number of gaps (active layers with no hits) along this track.
Implements StiTrack.
Definition at line 723 of file StiKalmanTrack.cxx.
| vector< StiHit * > StiKalmanTrack::getHits | ( | ) | [virtual] |
Return all the hits associated with this track, including those with a large incremental chi2 that may not contribute to the fit.
Implements StiTrack.
Definition at line 1313 of file StiKalmanTrack.cxx.
References getLastNode().
| StiKalmanTrackNode * StiKalmanTrack::getInnerMostHitNode | ( | int | qua = 0 |
) | const |
Accessor method returns the inner most hit node associated with the track.
Return the inner most hit associated with this track.
Definition at line 1020 of file StiKalmanTrack.cxx.
References getInnOutMostNode().
Referenced by extendToVertex(), getCurvature(), getDca(), getMomentum(), getP(), getPhi(), getPseudoRapidity(), getPt(), getRapidity(), and getTanL().
| StiKalmanTrackNode * StiKalmanTrack::getInnerMostNode | ( | int | qua = 0 |
) | const [inline] |
Accessor method returns the inner most node associated with the track.
Accessor method returns the inner most node associated with the track.
Definition at line 601 of file StiKalmanTrack.h.
References getInnOutMostNode().
Referenced by extendToVertex(), extrapolateToBeam(), getCharge(), and getMomentumAtOrigin().
| StiKalmanTrackNode * StiKalmanTrack::getInnOutMostNode | ( | int | inot, | |
| int | qua | |||
| ) | const |
Same for getNNodes(qua).
Accessor method returns the inner/outer most node associated with the track. inot: 0=inner, 1=outer; qua : 0=nocheck, 1=with hit inside, 2=chi2 non infinit
Return the inner most hit associated with this track.
| logic_error |
Definition at line 981 of file StiKalmanTrack.cxx.
References begin().
Referenced by StiKalmanTrackFinder::find(), getInnerMostHitNode(), getInnerMostNode(), getOuterMostHitNode(), and getOuterMostNode().
| double StiKalmanTrack::getMass | ( | ) | const [inline, virtual] |
Return the mass hypothesis used in the resconstruction of this track.
Implements StiTrack.
Definition at line 335 of file StiKalmanTrack.h.
Referenced by getRapidity().
| int StiKalmanTrack::getMaxPointCount | ( | int | detectorId = 0 |
) | const [virtual] |
Returns the maximum number of points that can possibly be on the track given its track parameters, i.e. its position in the detector. The calculation accounts for sublayers that are not active, and nominally active volumes that were turned off or had no data for some reason.
Calculate and return the maximum possible number of hits on this track.
Implements StiTrack.
Definition at line 694 of file StiKalmanTrack.cxx.
| void StiKalmanTrack::getMomentum | ( | double | p[3], | |
| double | e[6] | |||
| ) | const [inline, virtual] |
Calculates and returns the momentum and error of the track.
Calculates and returns the momentum and error of the track
This method calculates and returns in the two arrays provided as arguments the 3-momentum and error of the track in Star global coordinates. The 3-momentum is calculated at the inner most point associated with the track. The inner-most point may or may not be the main vertex of the event. Care should thus be exercised while using this method.
The error is calculated (and returned) only if a non null array is passed as a second argument. It is thus possible to get the momentum without a lengthy calculation of the error matrix. The error error matrix corresponds to a full covariance matrix. The definition of the error matrix is described in the introduction of this class definition. Note that the actual calculation of the momentum and associated error is delegated to the track node class and uses the inner most node of the track.
Implements StiTrack.
Definition at line 366 of file StiKalmanTrack.h.
References getInnerMostHitNode().
| double StiKalmanTrack::getNearBeam | ( | StThreeVectorD * | pnt = 0, |
|
| StThreeVectorD * | dir = 0 | |||
| ) | const |
Returns the track length (in centimeters) from the first point to beam line (x=y=0). pnt is the nearest point to beam and dir direction of tracl in this point The main vertex is included in the calculation if associated with the track.
Definition at line 937 of file StiKalmanTrack.cxx.
References StiKalmanTrackNode::getCurvature(), and StiKalmanTrackNode::getPhase().
| StiKalmanTrackNode * StiKalmanTrack::getOuterMostNode | ( | int | qua = 0 |
) | const [inline] |
Accessor method returns the outer most node associated with the track.
Accessor method to get the dca.
Accessor method returns the outer most node associated with the track.
Definition at line 587 of file StiKalmanTrack.h.
References getInnOutMostNode().
Referenced by StiKalmanTrackFinder::extendTrack().
| double StiKalmanTrack::getP | ( | ) | const [inline, virtual] |
Calculates and returns the momentum of the track at the inner most node.
Calculates and returns the momentum of the track at the inner most node held by this track which may or (or not) be the primary vertex.
Implements StiTrack.
Definition at line 378 of file StiKalmanTrack.h.
References getInnerMostHitNode(), and StiKalmanTrackNode::getP().
| double StiKalmanTrack::getPhi | ( | ) | const [inline, virtual] |
Return azimuthal angle at inner most point of the track.
Returns the azimuthal angle of the track determined at the inner most point of the track hich may or may not be a vertex.
Implements StiTrack.
Definition at line 454 of file StiKalmanTrack.h.
References getInnerMostHitNode().
| int StiKalmanTrack::getPointCount | ( | int | detectorId = 0 |
) | const [virtual] |
Return the number of hits associated with this track.
Returns the distance of closest approach of this track to the primary vertex
Implements StiTrack.
Definition at line 665 of file StiKalmanTrack.cxx.
| double StiKalmanTrack::getPseudoRapidity | ( | ) | const [inline, virtual] |
Return the pseudorapidity of the track.
Returns the pseudo-rapidity of the track.
Implements StiTrack.
Definition at line 438 of file StiKalmanTrack.h.
References getInnerMostHitNode().
| double StiKalmanTrack::getPt | ( | ) | const [inline, virtual] |
Calculates and returns the transverse momentum of the track at the inner most node.
Calculates and returns the transverse momentum of the track at the inner most node held by this track which may or (or not) be the primary vertex.
Implements StiTrack.
Definition at line 387 of file StiKalmanTrack.h.
References getInnerMostHitNode(), and StiKalmanTrackNode::getPt().
| double StiKalmanTrack::getRapidity | ( | ) | const [inline, virtual] |
Return the rapidity of the track if the mass is known.
Returns the rapidity of the track if the mass is known.
| runtime_error |
Implements StiTrack.
Definition at line 413 of file StiKalmanTrack.h.
References getInnerMostHitNode(), and getMass().
| double StiKalmanTrack::getTanL | ( | ) | const [inline, virtual] |
Returns the tangent of the dip angle of the track determined at the inner most point of the track.
Return tan(lambda) of the particle at the inner most node held by this track which may (or not) be the primary vertex.
Implements StiTrack.
Definition at line 466 of file StiKalmanTrack.h.
References getInnerMostHitNode().
| double StiKalmanTrack::getTrackLength | ( | ) | const [virtual] |
Returns the track length (in centimeters) from the first to the last point on track. The main vertex is included in the calculation if associated with the track.
Calculate and return the track length.
| runtime_error |
Implements StiTrack.
Definition at line 828 of file StiKalmanTrack.cxx.
References begin(), and StiKalmanTrackNode::getCurvature().
Referenced by StiKalmanTrackFinder::find().
| double StiKalmanTrack::getTrackRadLength | ( | ) | const |
Calculate and return the track segment length between two nodes.
Definition at line 879 of file StiKalmanTrack.cxx.
References begin(), end(), StiKalmanTrackNode::getGasX0(), StiKalmanTrackNode::getX0(), StiKalmanTrackNode::pathlength(), and StiKalmanTrackNode::pathLToNode().
| int StiKalmanTrack::isPrimary | ( | ) | const [inline] |
Identifies the track as a primary or secondary track. The track is defined as primary if it contains a primary vertex i.e. if the vertex was included as a point to the track because it had low enough a incremental chi2.
Definition at line 201 of file StiKalmanTrack.h.
| void StiKalmanTrack::reserveHits | ( | ) |
Declare hits associated with given track as used.
Declare hits on the track ending at "node" as used. This method starts with the last node and seeks the parent of each node recursively. The hit associated with each node (when there is a hit) is set to "used".
Definition at line 1120 of file StiKalmanTrack.cxx.
| void StiKalmanTrack::reset | ( | void | ) | [virtual] |
Reset the class members to their default state. This method is called by the ctor of the class to initialize the members of the class to an "empty" or null track state. The method must also be called everytime an instance of this class is retrieved from its factory in order to set the first and last nodes to "null" thus guaranteeing that the track object is empty i.e. does not represent any track and is thus ready for a new search and reconstruction.
Implements StiTrack.
Definition at line 443 of file StiKalmanTrack.cxx.
Referenced by StiLocalTrackMerger::StiLocalTrackMerger().
| void StiKalmanTrack::setKalmanTrackNodeFactory | ( | Factory< StiKalmanTrackNode > * | val | ) | [static] |
Set the factory used for the creation of kalman track nodes.
Set the factory used for the creation of kalman track nodes.
Definition at line 467 of file StiKalmanTrack.cxx.
1.5.9