StRoot
1
|
Definition of Kalman Track. More...
#include <StiKalmanTrack.h>
Public Types | |
enum | { kAppGud =1, kAppRR =2, kAppUpd = 4, kAppUPD = 8 } |
Modes for calculating approximate track parameters. | |
enum | TRefitStatus { kNoErrors = 0, kRefitFail, kNotEnoughUsed, kInNodeNotValid, kBadQA, kVertexNodeInvalid, kNodeNotValid, kTooManyDroppedNodes } |
Public Types inherited from StiTrack | |
enum | StiTrackProperty { kCharge =0, kMass, kChi2, kDca2, kDca3, kFlag, kPrimaryDca, kPointCount, kFitPointCount, kGapCount, kTrackLength, kMaxPointCount, kisPrimary, kTpcDedx, kSvtDedx, kCurvature, kP, kPt, kRapidity, kPseudoRapidity, kPhi, kTanL } |
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. More... | |
double | getP () const |
Calculates and returns the momentum of the track at the inner most node. More... | |
double | getPt () const |
Calculates and returns the transverse momentum of the track at the inner most node. More... | |
double | getCurvature () const |
Return the curvature of the track at its inner most point. More... | |
double | getRapidity () const |
Return the rapidity of the track if the mass is known. More... | |
double | getPseudoRapidity () const |
Return the pseudorapidity of the track. More... | |
double | getPhi () const |
Return azimuthal angle at inner most point of the track. More... | |
double | getTanL () const |
Returns the tangent of the dip angle of the track determined at the inner most point of the track. More... | |
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 | combUsed () const |
void | setCombUsed (int comb) |
int | getPointCount (int detectorId=0) const |
Return the number of hits associated with this track. More... | |
int | getFitPointCount (int detectorId=0) const |
Returns the number of hits associated and used in the fit of this track. More... | |
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. More... | |
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 | getTrackRadLength () 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) More... | |
StiKalmanTrackNode * | getOuterMostNode (int qua=0) const |
Accessor method returns the outer most node associated with the track. More... | |
StiKalmanTrackNode * | getInnerMostNode (int qua=0) const |
Accessor method returns the inner most node associated with the track. More... | |
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. More... | |
StiKalmanTrackNode * | getInnerMostDetHitNode (int detectorId) const |
int | getNNodes (int qua=0) const |
int | releaseHits (double rMin=0, 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) |
void | removeNode (StiKalmanTrackNode *n) |
virtual void | add (StiTrackNode *node, int direction, StiTrackNode *near=0) |
virtual int | initialize (const vector< StiHit * > &) |
Convenience method to initialize a track based on seed information. More... | |
virtual int | initialize0 (const std::vector< StiHit * > &hits, StiNodePars *firstPars=0, StiNodePars *lastPars=0, StiNodeErrs *firstErrs=0, StiNodeErrs *lastErrs=0) |
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 | getChi2Max () const |
Return the maximal node chi2. | |
double | getXi2 () const |
double | getDca2 (StiTrack *t) const |
double | getDca3 (StiTrack *t) const |
int | refit () |
int | refitL () |
void | reserveHits (int yes=1) |
StiTrackNode * | extendToVertex (StiHit *vertex) |
void | setFlag (int v) |
int | getFlag () const |
StiKalmanTrackNode * | extrapolateToBeam () |
StiKalmanTrackNode * | extrapolateToRadius (double radius) |
int | approx (int mode=(kAppRR|kAppUPD)) |
void | reduce () |
void | print (const char *opt="") const |
StiKalmanTrack & | operator= (const StiKalmanTrack &tk) |
int | rejectByHitSet () const |
int | idTruth (int *qu=0) const |
void | test (const char *txt="") const |
Public Member Functions inherited from StiTrack | |
virtual int | fit (int direction=kOutsideIn) |
virtual bool | find (int direction=kOutsideIn) |
virtual double | getValue (int key) const |
int | getId () const |
void | setId (int id) |
StiTrack & | operator= (const StiTrack &tk) |
Static Public Member Functions | |
static void | setKalmanTrackNodeFactory (Factory< StiKalmanTrackNode > *) |
Set the factory used for the creation of kalman track nodes. More... | |
static void | setMaxRefiter (int maxRefiter) |
static void | setDebug (int d=0) |
static int | debug () |
Static Public Member Functions inherited from StiTrack | |
static void | setTrackFinder (StiTrackFinder *finder) |
static void | setTrackFitter (StiTrackFitter *fitter) |
static StiTrackFinder * | getTrackFinder () |
static StiTrackFitter * | getTrackFitter () |
Public Attributes | |
double | _vChi2 |
Static Public Attributes | |
static int | _debug = 0 |
Static Protected Member Functions | |
static double | diff (const StiNodePars &p1, const StiNodeErrs &e1, const StiNodePars &p2, const StiNodeErrs &e2, int &igor) |
Protected Attributes | |
StiKalmanTrackNode * | firstNode |
StiKalmanTrackNode * | lastNode |
UShort_t | mSeedHitCount |
char | mCombUsed |
int | mVertex |
int | mFlag |
double | mMass |
double | mXi2 |
double | _dca |
Protected Attributes inherited from StiTrack | |
int | mId |
int | mIdDb |
Static Protected Attributes | |
static StiTrackNodeHelper | sTNH |
static int | mgMaxRefiter = 100 |
static Factory < StiKalmanTrackNode > * | trackNodeFactory = 0 |
Static Protected Attributes inherited from StiTrack | |
static StiTrackFinder * | trackFinder = 0 |
static StiTrackFitter * | trackFitter = 0 |
Friends | |
ostream & | operator<< (ostream &os, const StiKalmanTrack &track) |
Definition of Kalman 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 82 of file StiKalmanTrack.h.
|
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 97 of file StiKalmanTrack.h.
|
inlinevirtual |
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 110 of file StiKalmanTrack.h.
|
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 1518 of file StiKalmanTrack.cxx.
Referenced by initialize(), and StKFVertexMaker::Make().
|
inline |
Convenience method used to return a track node iterator initialized to the track first node.
runtime_error |
Definition at line 540 of file StiKalmanTrack.h.
Referenced by StiKalmanTrackFitter::fit(), getAllPointCount(), getChi2(), getChi2Max(), getFitPointCount(), getGapCount(), getInnOutMostNode(), getMaxPointCount(), getNodes(), getPointCount(), getTrackLength(), getTrackRadLength(), refit(), and stHits().
|
inline |
Returns the combinatoric style used in track construction . and set this value.
Definition at line 164 of file StiKalmanTrack.h.
|
inline |
Convenience method used to return a track node iterator initialized to the track last node.
runtime_error |
Definition at line 555 of file StiKalmanTrack.h.
References StiKTNIterator::end().
Referenced by StiKalmanTrackFitter::fit(), getAllPointCount(), getChi2(), getChi2Max(), getFitPointCount(), getGapCount(), getHits(), getMaxPointCount(), getNodes(), getPointCount(), getTrackRadLength(), and stHits().
|
virtual |
Extend track to the given vertex.
Attempt an extension of the track the given vertex.
Implements StiTrack.
Definition at line 1352 of file StiKalmanTrack.cxx.
References StiKalmanTrackNode::evaluateChi2(), Factory< Abstract >::free(), getInnerMostHitNode(), getInnerMostNode(), Factory< Abstract >::getInstance(), StiHit::isDca(), StiKalmanTrackNode::propagate(), StiHit::rotate(), and StiKalmanTrackNode::updateNode().
Referenced by StKFVertexMaker::Make().
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 1494 of file StiKalmanTrack.cxx.
References Factory< Abstract >::free(), getInnerMostNode(), Factory< Abstract >::getInstance(), and StiKalmanTrackNode::propagateToBeam().
|
virtual |
Return the track sign
Implements StiTrack.
Definition at line 807 of file StiKalmanTrack.cxx.
References StiKalmanTrackNode::getCharge(), and getInnerMostNode().
|
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 820 of file StiKalmanTrack.cxx.
References begin(), and end().
Referenced by StiKalmanTrackFinder::extendSeeds().
|
inlinevirtual |
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 411 of file StiKalmanTrack.h.
References StiKalmanTrackNode::getCurvature(), and getInnerMostHitNode().
|
inlinevirtual |
Returns the distance of closest approach of this track to the given hit.
Calculate and return the distance of closest approach to given hit
Implements StiTrack.
Definition at line 488 of file StiKalmanTrack.h.
|
inline |
Returns the distance of closest approach of this track to the give track.
Calculate and return the distance of closest approach to given track
Definition at line 506 of file StiKalmanTrack.h.
|
inlinevirtual |
Calculate and return the distance of closest approach to given track - 2D calc
Implements StiTrack.
Definition at line 518 of file StiKalmanTrack.h.
|
inlinevirtual |
Calculate and return the distance of closest approach to given track - 3D calc
Implements StiTrack.
Definition at line 530 of file StiKalmanTrack.h.
|
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 970 of file StiKalmanTrack.cxx.
References begin(), StiHit::detector(), and end().
Referenced by StiKalmanTrackFinder::extendSeeds().
|
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 927 of file StiKalmanTrack.cxx.
References begin(), and end().
Referenced by StiKalmanTrackFinder::find().
|
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 1425 of file StiKalmanTrack.cxx.
References end(), and 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 1229 of file StiKalmanTrack.cxx.
References getInnOutMostNode().
Referenced by extendToVertex(), getCurvature(), getDca(), getMomentum(), getP(), getPhi(), getPseudoRapidity(), getPt(), getRapidity(), getTanL(), and StKFVertexMaker::Make().
|
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 594 of file StiKalmanTrack.h.
References getInnOutMostNode().
Referenced by extendToVertex(), extrapolateToBeam(), getCharge(), StKFVertexMaker::Make(), and refit().
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 1195 of file StiKalmanTrack.cxx.
References begin().
Referenced by StiKalmanTrackFinder::find(), getInnerMostHitNode(), getInnerMostNode(), getOuterMostHitNode(), and getOuterMostNode().
|
inlinevirtual |
Return the mass hypothesis used in the resconstruction of this track.
Implements StiTrack.
Definition at line 349 of file StiKalmanTrack.h.
Referenced by getRapidity().
|
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 898 of file StiKalmanTrack.cxx.
|
inlinevirtual |
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 380 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 1151 of file StiKalmanTrack.cxx.
References StiKalmanTrackNode::getCurvature(), StiKalmanTrackNode::getPhase(), StHelix::h(), StHelix::moveOrigin(), StHelix::pathLength(), StHelix::period(), and StHelix::phase().
|
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 580 of file StiKalmanTrack.h.
References getInnOutMostNode().
Referenced by StiKalmanTrackFinder::extendTrack().
|
inlinevirtual |
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 392 of file StiKalmanTrack.h.
References getInnerMostHitNode(), and StiKalmanTrackNode::getP().
|
inlinevirtual |
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 464 of file StiKalmanTrack.h.
References getInnerMostHitNode().
|
virtual |
Return the number of hits associated with this track.
Returns the distance of closest approach of this track to the primary vertex
Calculate and return the number of hits on this track.
Implements StiTrack.
Definition at line 868 of file StiKalmanTrack.cxx.
References begin(), and end().
Referenced by StiStEventFiller::fillEvent(), StiKalmanTrackFinder::find(), and StiHftHits::hftHist().
|
inlinevirtual |
Return the pseudorapidity of the track.
Returns the pseudo-rapidity of the track.
Implements StiTrack.
Definition at line 450 of file StiKalmanTrack.h.
References getInnerMostHitNode().
|
inlinevirtual |
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 401 of file StiKalmanTrack.h.
References getInnerMostHitNode(), and StiKalmanTrackNode::getPt().
|
inlinevirtual |
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 427 of file StiKalmanTrack.h.
References getInnerMostHitNode(), and getMass().
|
inlinevirtual |
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 476 of file StiKalmanTrack.h.
References getInnerMostHitNode().
|
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 1054 of file StiKalmanTrack.cxx.
References begin(), and StiKalmanTrackNode::getCurvature().
Referenced by StiKalmanTrackFinder::find().
double StiKalmanTrack::getTrackRadLength | ( | ) | const |
Calculates the radiation length of material crossed by the track.
Definition at line 1093 of file StiKalmanTrack.cxx.
References begin(), end(), StiKalmanTrackNode::getGasX0(), Named::getName(), StiKalmanTrackNode::getX0(), and StiKalmanTrackNode::pathLToNode().
|
virtual |
Convenience method to initialize a track based on seed information.
Initialization of this kalman track from external parameters.
This track object is initialized on the basis of parameters determined externally. The parameters consist of the track curvature, the tangent of pitch angle, the origin of the helix, and a vector of hits already associated with the track.
curvature | 1/radius of the tack. |
tanl | tan(pitch angle) |
origin | origin of the track in global coordinates. |
v | vector of hits associated with this track. |
Implements StiTrack.
Definition at line 749 of file StiKalmanTrack.cxx.
References add(), StiHit::detector(), BFactory::Free(), Factory< Abstract >::getInstance(), StiKalmanTrackNode::initialize(), and reset().
|
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 215 of file StiKalmanTrack.h.
|
virtual |
Public interface to protected method capable of returning two return values used in this and derived StiCAKalmanTrack classes.
Implements StiTrack.
Definition at line 1555 of file StiKalmanTrack.cxx.
References begin(), getInnerMostNode(), and mgMaxRefiter.
Referenced by StiKalmanTrackFinder::extendTrack(), and StKFVertexMaker::Make().
void StiKalmanTrack::reserveHits | ( | int | yes = 1 | ) |
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 1317 of file StiKalmanTrack.cxx.
Referenced by StiKalmanTrackFinder::extendSeeds().
|
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 687 of file StiKalmanTrack.cxx.
Referenced by initialize().
|
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 709 of file StiKalmanTrack.cxx.
|
staticprotected |
Two return values can be obtained by calling this protected version of refit(). By default the original value is used in the publicly available refit() of this class while the other is used in derived class StiCAKalmanTrack.
Definition at line 327 of file StiKalmanTrack.h.
Referenced by refit().