StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | Friends | List of all members
StiKalmanTrackNode Class Reference

#include <StiKalmanTrackNode.h>

Inheritance diagram for StiKalmanTrackNode:
StiTrackNode StiTreeNode

Public Member Functions

 StiKalmanTrackNode (const StiKalmanTrackNode &node)
 
const StiKalmanTrackNodeoperator= (const StiKalmanTrackNode &node)
 
void reset ()
 Resets the node to a "null" un-used state.
 
void unset ()
 
void resetError (double fak=0)
 Resets errors for refit.
 
void initialize (StiHit *h)
 Initialize this node with the given hit information.
 
void initialize (StiDetector *d)
 
void initialize (const double dir[3])
 
void setState (const StiKalmanTrackNode *node)
 Sets the Kalman state of this node equal to that of the given node. More...
 
void get (double &alpha, double &xRef, double x[kNPars], double cc[kNErrs], double &chi2)
 Extract state information from this node. More...
 
void getGlobalRadial (double x[6], double e[15])
 Extract state information from this node in Radial representation. More...
 
void getGlobalTpt (float x[6], float e[15])
 Extract state information from this node in TPT representation. More...
 
int getCharge () const
 Get the charge (sign) of the track at this node.
 
StThreeVectorF getMomentumF () const
 Convenience Method that returns the track momentum at this node.
 
StThreeVectorF getGlobalMomentumF () const
 
StThreeVector< double > getMomentum () const
 
StThreeVector< double > getGlobalMomentum () const
 
void getMomentum (double p[3], double e[6]=0) const
 
double getCurvature () const
 Calculates and returns the tangent of the track pitch angle at this node.
 
void setCurvature (double curvature)
 
double getDipAngle () const
 
double getTanL () const
 
double getPt () const
 Calculates and returns the transverse momentum of the track at this node. More...
 
double getP () const
 Calculates and returns the momentum of the track at this node.
 
double getHz () const
 
double getField () const
 
double x_g () const
 
double y_g () const
 
double z_g () const
 
double getX () const
 
double getY () const
 
double getZ () const
 
double x () const
 
double y () const
 
double z () const
 
double getRxy () const
 
double getEta () const
 
double getSin () const
 
double getCos () const
 
double getAlpha () const
 
const double * hitErrs () const
 
double getEyy () const
 
double getEzz () const
 
double getCyy () const
 
double getCzz () const
 
double const * getPars () const
 
int getHitCount () const
 
int getNullCount () const
 
int getContigHitCount () const
 
int getContigNullCount () const
 
int incHitCount ()
 
int incNullCount ()
 
int incContigHitCount ()
 
int incContigNullCount ()
 
void setHitCount (char c=0)
 
void setNullCount (char c=0)
 
void setContigHitCount (char c=0)
 
void setContigNullCount (char c=0)
 
double getTime () const
 
void setHitCand (int nhits)
 
void setIHitCand (int ihit)
 
int getHitCand () const
 
int getIHitCand () const
 
StiELossgetELoss ()
 
const StiELossgetELoss () const
 
StThreeVector< double > getPoint () const
 
StThreeVector< double > getGlobalPoint () const
 
void getGlobalMomentum (double p[3], double e[6]=0) const
 Calculates and returns the momentum and error of the track at this node in global coordinates. More...
 
int isEnded () const
 
int isDca () const
 
int propagate (StiKalmanTrackNode *p, const StiDetector *tDet, int dir)
 Propagates a track encapsulated by the given node "p" to the given detector "tDet". More...
 
bool propagate (const StiKalmanTrackNode *p, StiHit *vertex, int dir)
 Propagates a track encapsulated by the given node "p" to the given vertex. More...
 
bool propagateToBeam (const StiKalmanTrackNode *p, int dir)
 
int propagateToRadius (StiKalmanTrackNode *pNode, double radius, int dir)
 
int locate ()
 
int propagate (double x, int option, int dir)
 
void propagateMtx ()
 
void propagateError ()
 
void saveInfo (int kase=1)
 
const StiNodeInfgetInfo () const
 
int testError (double *emx, int begend)
 
void numeDeriv (double val, int kind, int shape=0, int dir=0)
 
int testDeriv (double *der)
 
void propagateMCS (StiKalmanTrackNode *previousNode, const StiDetector *tDet)
 
int nudge (StiHit *hit=0)
 
double evaluateChi2 (const StiHit *hit)
 
double evaluateChi2Info (const StiHit *hit) const
 
int updateNode ()
 
int rotate (double alpha)
 
int getHelicity () const
 
double getPhase () const
 
double getPsi () const
 
double getWindowY ()
 
double getWindowZ ()
 
double pitchAngle () const
 
double crossAngle () const
 
double sinCrossAngle () const
 
double pathlength () const
 
double pathLToNode (const StiKalmanTrackNode *const oNode)
 
StThreeVectorDgetLengths (StiKalmanTrackNode *nextNode)
 
double length (const StThreeVector< double > &delta, double curv)
 
double getDedx () const
 
StThreeVector< double > getHelixCenter () const
 Return center of helix circle in global coordinates.
 
void setHitErrors (const StiHit *hit=0)
 
StiHitErrs getGlobalHitErrs (const StiHit *hit) const
 
double getX0 () const
 
double getGasX0 () const
 
double getDensity () const
 
double getGasDensity () const
 
void extend ()
 
void reduce ()
 
void PrintpT (const Char_t *opt="") const
 
int getFlipFlop () const
 
int print (const char *opt) const
 rotation angle of local coordinates wrt global coordinates
 
const StiNodeParsfitPars () const
 
StiNodeParsfitPars ()
 
const StiNodeErrsfitErrs () const
 
StiNodeErrsfitErrs ()
 
const StiNodeParsmPP () const
 
StiNodeParsmPP ()
 
const StiNodeErrsmPE () const
 
StiNodeErrsmPE ()
 
const StiNodeMtxmMtx () const
 
StiNodeMtxmMtx ()
 
const StiNode2ParsunTouched () const
 
void setUntouched ()
 
- Public Member Functions inherited from StiTrackNode
const StiTrackNodeoperator= (const StiTrackNode &node)
 
void reset ()
 
void unset ()
 
StiHitgetHit () const
 
void setHit (StiHit *hit)
 
const StiDetectorgetDetector () const
 
void setDetector (const StiDetector *detector)
 
double getChi2 () const
 
double getDeterm () const
 
void setChi2 (double chi2)
 
int getState () const
 
void setInvalid ()
 
void setReady ()
 
int isValid () const
 
int isFitted () const
 
double getRefPosition () const
 
double getLayerAngle () const
 
- Public Member Functions inherited from StiTreeNode
 StiTreeNode ()
 
const StiTreeNodeoperator= (const StiTreeNode &node)
 
void reset ()
 
void unset ()
 
void remove (int childIndex)
 
StiTreeNodedisconnect (int all=0)
 
void cutTail (int direction)
 
void setParent (StiTreeNode *newParent)
 
StiTreeNodegetParent () const
 
StiTreeNodegetChildAt (int index) const
 
int getChildCount () const
 
void add (StiTreeNode *newChild, int direction)
 
StiTreeNodegetNextNode () const
 Returns the node that follows this node in a preorder traversal of this.
 
StiTreeNodegetPrevNode () const
 
StiTreeNodegetFirstNode () const
 
StiTreeNodegetLastNode () const
 
void remove (StiTreeNode **fstNode, StiTreeNode **lstNode)
 

Static Public Member Functions

static double mcs2 (double relRadThickness, double beta2, double p2)
 
static void PrintStep ()
 
static double nice (double angle)
 
static Int_t debug ()
 
static void setDebug (Int_t m)
 
static void SetLaser (Int_t m)
 
static Int_t IsLaser ()
 
static void ResetComment (const Char_t *m="")
 
static const Char_t * Comment ()
 
- Static Public Member Functions inherited from StiTrackNode
static void mult6 (double Rot[kNPars][kNPars], const double Pro[kNPars][kNPars])
 
static void errPropag6 (double G[21], const double F[6][6], int nF)
 
static int cylCross (const double Xp[2], const double Dp[2], const double Rho, const double r, int dir, double out[2][3])
 
static double sinX (double x)
 

Public Attributes

int mId
 
- Public Attributes inherited from StiTrackNode
int _state
 
const StiDetector_detector
 
StiHit_hit
 
double _det
 
double _chi2
 

Protected Attributes

char _beg [1]
 
double _alpha
 
double mHz
 Z mag field in units PGev = Hz*Rcm.
 
StiNodePars mFP
 
StiNodeErrs mFE
 covariance matrix of the track parameters
 
StiNode2Pars mUnTouch
 
StiHitErrs mHrr
 
StiELoss mELoss [2]
 
char hitCount
 
char nullCount
 
char contiguousHitCount
 
char contiguousNullCount
 
char mFlipFlop
 
char mHitCand
 
char mIHitCand
 
char _end [1]
 
StiNodeExt_ext
 
StiNodeInf_inf
 
- Protected Attributes inherited from StiTreeNode
StiTreeNodeparent
 
StiTreeNodechildren [2]
 

Static Protected Attributes

static StiNodeStat mgP
 
static bool useCalculatedHitError = true
 
static int fDerivTestOn =-10
 
static double fDerivTest [kNPars][kNPars]
 
static int _debug = 0
 
static TString comment
 
static TString commentdEdx
 
static int _laser = 0
 

Friends

class StiTrackNodeHelper
 
ostream & operator<< (ostream &os, const StiKalmanTrackNode &n)
 

Additional Inherited Members

- Public Types inherited from StiTrackNode
enum  eTrackNodeStatus {
  kTNReset = 0, kTNRotBeg = 1, kTNRotEnd = 2, kTNProBeg = 3,
  kTNProEnd = 4, kTNNudBeg = 5, kTNFitBeg = 6, kTNReady =10,
  kTNNudEnd =11, kTNFitEnd =12, kTNInit =13
}
 
enum  eTrackNodeFlags { kTNRefit = 1 }
 
- Static Public Attributes inherited from StiTrackNode
static int mgFlag =0
 

Detailed Description

Work class used to handle Kalman filter information while constructing track nodes. A node may or may not own a hit depending whether it lies on a measurement layer where a hit was found. A node can have 0, 1, or many children. Nodes are nominally sequenced outside-in i.e. with decreasing radius (or independent variable). The order can however be reversed. In anycase, the order should always be monotonically increasing or decreasing.

Author
Claude A Pruneau

Definition at line 81 of file StiKalmanTrackNode.h.

Member Function Documentation

double StiKalmanTrackNode::evaluateChi2 ( const StiHit hit)

Calculate the increment of chi2 caused by the addition of this node to the track.

Uses the track extrapolation to "_x", and hit position to evaluate and return the increment to the track chi2. The chi2 is not stored internally in this node.

Notes

  1. Use full error matrices.
  2. Return increment in chi2 implied by the node/hit assocition.
  3. Throws an exception if numerical problems arise.

Definition at line 1481 of file StiKalmanTrackNode.cxx.

References StiHit::x().

Referenced by StiKalmanTrack::extendToVertex().

double StiKalmanTrackNode::evaluateChi2Info ( const StiHit hit) const

same as evaluateChi2 but used only _info information\

Definition at line 2435 of file StiKalmanTrackNode.cxx.

References StiNodePars::_cosCA, and StiHit::x().

void StiKalmanTrackNode::get ( double &  alpha,
double &  xRef,
double  x[kNPars],
double  e[kNErrs],
double &  chi2 
)

Extract state information from this node.

returns the node information double& alpha : angle of the local reference frame double& xRef : refence position of this node in the local frame double x[6], : state, for a definition, see the top of this file double cc[21] : error matrix of the state "x" double& chi2) : chi2 of the track at this node

Definition at line 773 of file StiKalmanTrackNode.cxx.

double StiKalmanTrackNode::getGasX0 ( ) const
inline

Return the radiation length (in cm) of the gas surrounding the detector volume at this node.

Definition at line 373 of file StiKalmanTrackNode.h.

References StiMaterial::getX0().

Referenced by StiKalmanTrack::getTrackRadLength(), and propagateMCS().

void StiKalmanTrackNode::getGlobalMomentum ( double  p[3],
double  e[6] = 0 
) const

Calculates and returns the momentum and error of the track at this node in global coordinates.

returns momentum and its error matrix in cartesian coordinates in the global ref frame of the experiment p[0] = px p[1] = py p[2] = pz Use lower triangular matrix e[0] = px-px e[1] = px-py e[2] = py-py e[3] = px-pz e[4] = py-pz e[5] = pz-pz

Definition at line 1031 of file StiKalmanTrackNode.cxx.

StThreeVectorF StiKalmanTrackNode::getGlobalMomentumF ( ) const
inline

Convenience Method that returns the track momentum at this node in global coordinates.

Definition at line 338 of file StiKalmanTrackNode.h.

References getMomentumF().

void StiKalmanTrackNode::getGlobalRadial ( double  x[6],
double  e[15] 
)

Extract state information from this node in Radial representation.

returns the node information double x[6], : state, for a definition, in radial implementation rad - radius at start (cm). See also comments phi - azimuthal angle (in rad) z - z-coord. (cm) psi - azimuthal angle of pT vector (in rads) tanl - tan(dip) =pz/pt curv - Track curvature (1/cm) double cc[15] : error matrix of the state "x" rad is fixed code definition adopted here, where: PhiPhi; ZPhi ,ZZ; TanlPhi ,TanlZ ,TanlTanl, PsiPhi ,PsiZ ,PsiTanl , PsiPsi , CurvPhi ,CurvZ ,CurvTanl, CurvPsi, CurvCurv

Definition at line 910 of file StiKalmanTrackNode.cxx.

void StiKalmanTrackNode::getGlobalTpt ( float  x[6],
float  e[15] 
)

Extract state information from this node in TPT representation.

returns the node information in TPT representation double x[6], : state, for a definition, in radial implementation rad - radius at start (cm). See also comments phi - azimuthal angle (in rad) z - z-coord. (cm) psi - azimuthal angle of pT vector (in rads) tanl - tan(dip) =pz/pt q/pt - double cc[15] : error matrix of the state "x" rad is fixed code definition adopted here, where:

                      Units

______|________________|____________ phi*R | 0 1 2 3 4 | deg*cm z0 | 1 5 6 7 8 | cm tanl | 2 6 9 10 11 | 1 covar(i) psi | 3 7 10 12 13 | deg

q/pt | 4 8 11 13 14 | e*1/(GeV/c)

and where phi = atan2(y0,x0)*(180 deg/pi) R = sqrt(x0*x0 + y0*y0) q/pt = icharge*invpt; (This is what the radius of curvature actually determines) PhiPhi PhiZ PhiTan PhiPsi PhiPt ZZ ZTan ZPsi ZPt TanTan TanPsi TanPt PsiPsi PsiPt PtPt

Definition at line 979 of file StiKalmanTrackNode.cxx.

double StiKalmanTrackNode::getHz ( ) const

Calculates and returns the Z mag field in the current point. units: PGeV = Hz*Radcurv_in_CM

Calculate/return the z component of mag field

Calculate/return the z component of mag field

Field is calcualated via StarMagField class and cashed.

Definition at line 813 of file StiKalmanTrackNode.cxx.

void StiKalmanTrackNode::getMomentum ( double  p[3],
double  e[6] = 0 
) const

Calculates and returns the momentum and error of the track at this node. The momentum is in the local reference frame of this node.

Calculate/return track 3-momentum and error.

Calculate the 3-momentum of the track in the local reference frame.

Momentum Representation

p[0] px outward
p[1] py along detector plane
p[2] pz along beam direction

Notes:

  1. Throws runtime_error exception if |sin(phi)^2|>1.
  2. Bypasses error calculation if error array "e" is a null pointer.

Definition at line 859 of file StiKalmanTrackNode.cxx.

References TCL::trasat().

double StiKalmanTrackNode::getPhase ( ) const

This function translates between ITTF helix parameters and StHelixModel phi. It is only used to fill StTrackGeometry. For a StPhysicalHelix, phi must be transformed by -h*pi/2.

Definition at line 1001 of file StiKalmanTrackNode.cxx.

Referenced by StiKalmanTrack::getDca(), and StiKalmanTrack::getNearBeam().

double StiKalmanTrackNode::getPt ( ) const
virtual

Calculates and returns the transverse momentum of the track at this node.

Calculate/return the track transverse momentum

Calculate the track transverse momentum in GeV/c based on this node's track parameters.

The momentum is calculated based on the track curvature held by this node. A minimum curvature of 1e-12 is allowed.

Implements StiTrackNode.

Definition at line 795 of file StiKalmanTrackNode.cxx.

Referenced by getMomentumF(), getP(), and StiKalmanTrack::getPt().

double StiKalmanTrackNode::getX0 ( ) const
inline

Return the radiation length (in cm) of the the detector volume at this node.

Definition at line 363 of file StiKalmanTrackNode.h.

References StiMaterial::getX0().

Referenced by StiKalmanTrack::getTrackRadLength(), and propagateMCS().

double StiKalmanTrackNode::pathLToNode ( const StiKalmanTrackNode *const  oNode)

Calculate the effect of MCS on the track error matrix.

The track is assumed to propagate from (x0,y0,z0) to (mgP.x1,y1,z1). The calculation is performed for the given mass hypothesis which given a momentum determines the speed "beta" of the particle. The calculation of the average scattering angle is delegated to the function "mcs2". The calculation of energy loss is done by the function eloss.

Calulates length between center of this node and provided node, which is assumed to be on the same helix. Have to use global coords, since nodes may not be in the same detector volume.

Returns
(double) length

Definition at line 1441 of file StiKalmanTrackNode.cxx.

Referenced by StiKalmanTrack::getTrackRadLength().

int StiKalmanTrackNode::propagate ( StiKalmanTrackNode pNode,
const StiDetector tDet,
int  dir 
)

Propagates a track encapsulated by the given node "p" to the given detector "tDet".

Steering routine that propagates the track encapsulated by the given node "pNode" to the given detector "tDet".

The propagation involves the following steps.

  1. Extrapolation of the existing track to the next layer, by "transporting" the track a smaller radius.
  2. Determine if the extrapolation actually intersects an existing volume.
  3. Exit with status code if no intersection is found.
  4. Transport the error matrix to the new radius.
  5. If mcsCalculated==true, proceed to calculate MCS effects on the error matrix.
  6. if elossCalculated==true, proceed to calculate Eloss effects on the track parameters.

Currently, propagate can handle kPlanar and kCylindrical geometries only. An exception is thrown if other geometry shape are used.

Definition at line 1079 of file StiKalmanTrackNode.cxx.

References Named::getName().

Referenced by StiKalmanTrack::extendToVertex(), and StiKalmanTrackFitter::fit().

bool StiKalmanTrackNode::propagate ( const StiKalmanTrackNode parentNode,
StiHit vertex,
int  dir 
)

Propagates a track encapsulated by the given node "p" to the given vertex.

Propagate the track encapsulated by pNode to the given vertex. Use this node
    to represent the track parameters at the vertex.

This method propagates the track from the given parent node "pNode" to the given vertex effectively calculating the location (x,y,z) of the track near the given vertex. It use "this" node to represent/hold the track parameters at the vertex. return true when the propagation is successfull and false otherwise.

Definition at line 1160 of file StiKalmanTrackNode.cxx.

References TDataSet::Path(), StiHit::rotate(), and StiHit::x().

int StiKalmanTrackNode::propagate ( double  xk,
int  option,
int  dir 
)

Work method used to perform the tranport of "this" node from its current "_x" position to the given position "xk". Returns -1 if the propagation cannot be carried out, i.e. if the track curvature is such it cannot reach the desired location. option == 0 Planar option == 1 Cylinder

Definition at line 1228 of file StiKalmanTrackNode.cxx.

void StiKalmanTrackNode::propagateError ( )

Propagate the track error matrix

Note
This method must be called ONLY after a call to the propagate method.

Definition at line 1406 of file StiKalmanTrackNode.cxx.

void StiKalmanTrackNode::propagateMCS ( StiKalmanTrackNode previousNode,
const StiDetector tDet 
)

Calculate the effect of MCS on the track error matrix.

The track is assumed to propagate from (x0,y0,z0) to (x1,y1,z1). The calculation is performed for the given mass hypothesis which given a momentum determines the speed "beta" of the particle. The calculation of the average scattering angle is delegated to the function "mcs2". The calculation of energy loss is done by the function eloss.

???

Definition at line 1535 of file StiKalmanTrackNode.cxx.

References StiElossCalculator::calculate(), StiMaterial::getDensity(), StiMaterial::getElossCalculator(), getGasX0(), StiMaterial::getX0(), and getX0().

void StiKalmanTrackNode::propagateMtx ( )

Make propagation matrix

Note
This method must be called ONLY after a call to the propagate method.

Definition at line 1360 of file StiKalmanTrackNode.cxx.

bool StiKalmanTrackNode::propagateToBeam ( const StiKalmanTrackNode parentNode,
int  dir 
)

Propagate track from the given node to the beam line with x==0. Set the hit and detector pointers to null to manifest this is an extrapolation

Definition at line 1183 of file StiKalmanTrackNode.cxx.

References Named::getName().

Referenced by StiKalmanTrack::extrapolateToBeam().

int StiKalmanTrackNode::propagateToRadius ( StiKalmanTrackNode pNode,
double  radius,
int  dir 
)

Extrapolate the track defined by the given node to the given radius. Return a negative value if the operation is impossible.

Definition at line 1204 of file StiKalmanTrackNode.cxx.

References Named::getName().

int StiKalmanTrackNode::rotate ( double  alpha)

Rotate this node track representation azymuthally by given angle.

This method rotates by an angle alpha the track representation held by this node.

Notes

  1. The rotation is bound between -M_PI and M_PI.
  2. Throws runtime_error if "(_y-y0)*_curv>=0" in order to avoid math exception.
  3. Avoid undue rotations as they are CPU intensive...

Definition at line 1840 of file StiKalmanTrackNode.cxx.

Referenced by StKFVertexMaker::Make().

void StiKalmanTrackNode::setState ( const StiKalmanTrackNode n)

Sets the Kalman state of this node equal to that of the given node.

Set the Kalman state of this node to be identical to that of the given node. This method is useful to initial the state of a node while propagating a track.

Definition at line 751 of file StiKalmanTrackNode.cxx.

References mFE.

int StiKalmanTrackNode::updateNode ( )

Update the track parameters using this node.

This method uses the hit contained by node to update the track parameters contained by this node and thus complete the propagation of this track to the location x=_x.

  1. Throw a runtime_error exception if no hit is actually associated with this node.
  2. Compute the measurement error matrix "r". Invert it.
  3. Update the measurement matrix "k" and calculate updated curvature, eta, and pitch.
  4. Update track error matrix.

Notes

  1. Throw logic_error if no hit is associated with this node.
  2. Throw runtime_error if determinent of "r" matrix is null.

???

Definition at line 1744 of file StiKalmanTrackNode.cxx.

Referenced by StiKalmanTrack::extendToVertex().

Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
const StiKalmanTrackNode n 
)
friend

print to the ostream "os" the parameters of this node and all its children recursively

Definition at line 1884 of file StiKalmanTrackNode.cxx.


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