1 #ifndef StiKalmanTrackNode_H
2 #define StiKalmanTrackNode_H 1
9 #include "StiTrackNode.h"
10 #include "StThreeVector.hh"
11 #include "StThreeVectorF.hh"
12 #include "StDetectorDbMaker/StiKalmanTrackFinderParameters.h"
14 #include "StiPlanarShape.h"
15 #include "StiCylindricalShape.h"
16 #include "StiPlacement.h"
18 #include "StiMaterial.h"
26 kEdgePhiPlus, kEdgeZminus, kEdgePhiMinus, kEdgeZplus,
27 kMissPhiPlus, kMissZminus, kMissPhiMinus, kMissZplus,
43 double sumSin, sumCos;
48 void reset(){mPP.reset();mPE.reset();mMtx.reset();}
58 void reset(){mPP.reset();mPE.reset();mHrr.reset();}
90 static double mcs2(
double relRadThickness,
double beta2,
double p2) {
return 14.1*14.1*relRadThickness/(beta2*p2*1e6);}
105 void get(
double& alpha,
double& xRef,
double x[kNPars],
double cc[kNErrs],
double& chi2);
114 int getCharge()
const {
return (mFP.ptin() > 0) ? -1 : 1;}
124 void getMomentum(
double p[3],
double e[6]=0)
const;
127 void setCurvature(
double curvature) {mFP.curv()=curvature;}
128 double getDipAngle()
const {
return atan(mFP.tanl());}
129 double getTanL()
const {
return mFP.tanl();}
131 double getPt()
const;
133 double getP()
const {
return (
getPt()*::sqrt(1.+mFP.tanl()*mFP.tanl()));}
136 double getHz()
const;
137 double getField()
const {
return getHz();}
141 double getX()
const {
return mFP.x();}
142 double getY()
const {
return mFP.y();}
143 double getZ()
const {
return mFP.z();}
144 double x()
const {
return mFP.x();}
145 double y()
const {
return mFP.y();}
146 double z()
const {
return mFP.z();}
147 double getRxy()
const {
return sqrt(mFP.x()*mFP.x()+mFP.y()*mFP.y());}
149 double getEta ()
const {
return mFP.eta(); }
150 double getSin ()
const {
return mFP._sinCA;}
151 double getCos ()
const {
return mFP.
_cosCA;}
152 double getAlpha()
const {
return _alpha; }
153 const double *hitErrs()
const {
return mHrr.G(); }
154 double getEyy()
const {
return mHrr.hYY;}
155 double getEzz()
const {
return mHrr.hZZ;}
156 double getCyy()
const {
return mFE._cYY;}
157 double getCzz()
const {
return mFE._cZZ;}
158 double const *getPars()
const {
return mFP.P;}
159 int getHitCount ()
const {
return hitCount;}
160 int getNullCount()
const {
return nullCount;}
161 int getContigHitCount ()
const {
return contiguousHitCount ;}
162 int getContigNullCount()
const {
return contiguousNullCount;}
167 int incHitCount () {
return ++hitCount;}
168 int incNullCount() {
return ++nullCount;}
169 int incContigHitCount () {
return ++contiguousHitCount ;}
170 int incContigNullCount() {
return ++contiguousNullCount;}
171 void setHitCount (
char c=0) { hitCount=c;}
172 void setNullCount(
char c=0) { nullCount=c;}
173 void setContigHitCount (
char c=0) { contiguousHitCount=c ;}
174 void setContigNullCount(
char c=0) { contiguousNullCount=c;}
175 double getTime()
const;
177 void setHitCand(
int nhits) {mHitCand = nhits;}
178 void setIHitCand(
int ihit) {mIHitCand = ihit;}
179 int getHitCand()
const {
return mHitCand;}
180 int getIHitCand()
const {
return mIHitCand;}
181 StiELoss *getELoss() {
return mELoss;}
182 const StiELoss *getELoss()
const {
return mELoss;}
183 static void PrintStep();
187 void getGlobalMomentum(
double p[3],
double e[6]=0)
const;
200 int propagate(
double x,
int option,
int dir);
203 void saveInfo(
int kase=1);
204 const StiNodeInf *getInfo()
const {
return _inf;}
205 int testError(
double *emx,
int begend);
206 void numeDeriv(
double val,
int kind,
int shape=0,
int dir=0);
207 int testDeriv(
double *der);
214 int getHelicity()
const {
return (mFP.curv() < 0) ? -1 : 1;}
216 double getPsi()
const;
219 double pitchAngle()
const {
return atan(mFP.tanl());}
220 double crossAngle()
const {
return asin(mFP._sinCA);}
221 double sinCrossAngle()
const {
return mFP._sinCA;}
222 double pathlength()
const;
227 double getDedx()
const;
228 static double nice(
double angle);
235 double getX0()
const;
237 double getDensity()
const;
238 double getGasDensity()
const;
242 static Int_t debug() {
return _debug;}
243 static void setDebug(Int_t m) {_debug = m;}
244 static void SetLaser(Int_t m) {_laser = m;}
245 static Int_t IsLaser() {
return _laser;}
246 void PrintpT(
const Char_t *opt=
"")
const ;
247 int getFlipFlop()
const {
return mFlipFlop;}
248 static void ResetComment(
const Char_t *m =
"") {comment = m; commentdEdx =
"";}
249 static const Char_t *Comment() {
return comment.Data();}
251 int print(
const char *opt)
const;
255 void static saveStatics(
double *sav);
256 void static backStatics(
double *sav);
268 const StiNodePars &mPP()
const {
return _ext->mPP; }
269 StiNodePars &mPP() {
if (!_ext) extend();
return _ext->mPP; }
270 const StiNodeErrs &mPE()
const {
return _ext->mPE; }
271 StiNodeErrs &mPE() {
if (!_ext) extend();
return _ext->mPE; }
272 const StiNodeMtx &mMtx()
const {
return _ext->mMtx;}
273 StiNodeMtx &mMtx() {
if (!_ext) extend();
return _ext->mMtx;}
274 const StiNode2Pars &unTouched()
const {
return mUnTouch;}
290 char contiguousHitCount;
291 char contiguousNullCount;
299 static bool useCalculatedHitError;
301 static int fDerivTestOn;
302 static double fDerivTest[kNPars][kNPars];
304 static TString comment;
305 static TString commentdEdx;
312 inline double StiKalmanTrackNode::nice(
double angle)
314 if (angle <= -M_PI) angle += 2*M_PI;
315 if (angle > M_PI) angle -= 2*M_PI;
357 cout <<node.getX()<<endl;
368 return det->getMaterial()->
getX0();
378 return det->getGas()->
getX0();
381 inline double StiKalmanTrackNode::getDensity()
const
389 inline double StiKalmanTrackNode::getGasDensity()
const
400 double x1=pathlength()/2.;
401 double x3=nextNode->pathlength()/2.;
403 if (x2> (x1+x3)) x2=x2-x1-x3;
407 x2/getDetector()->getMaterial()->
getX0(),
408 x3/nextNode->
getX0());
411 inline double StiKalmanTrackNode::getDedx()
const
417 double dx=pathlength();
418 if(dx>0 && de>0)
return de/dx;
void setState(const StiKalmanTrackNode *node)
Sets the Kalman state of this node equal to that of the given node.
int propagate(StiKalmanTrackNode *p, const StiDetector *tDet, int dir)
Propagates a track encapsulated by the given node "p" to the given detector "tDet".
double getP() const
Calculates and returns the momentum of the track at this node.
int propagateToRadius(StiKalmanTrackNode *pNode, double radius, int dir)
void getGlobalRadial(double x[6], double e[15])
Extract state information from this node in Radial representation.
bool propagateToBeam(const StiKalmanTrackNode *p, int dir)
StThreeVectorF getGlobalMomentumF() const
void reset()
Resets the node to a "null" un-used state.
double pathLToNode(const StiKalmanTrackNode *const oNode)
int print(const char *opt) const
rotation angle of local coordinates wrt global coordinates
StThreeVector< double > getHelixCenter() const
Return center of helix circle in global coordinates.
double getPt() const
Calculates and returns the transverse momentum of the track at this node.
friend ostream & operator<<(ostream &os, const StiKalmanTrackNode &n)
StThreeVectorF getMomentumF() const
Convenience Method that returns the track momentum at this node.
Float_t getEloss()
Return the energy deposition associated with this point.
double _cosCA
sine and cosine of cross angle
void resetError(double fak=0)
Resets errors for refit.
double evaluateChi2(const StiHit *hit)
double getCurvature() const
Calculates and returns the tangent of the track pitch angle at this node.
void getGlobalTpt(float x[6], float e[15])
Extract state information from this node in TPT representation.
double getX0() const
Get the radiation length in centimeter.
double mHz
Z mag field in units PGev = Hz*Rcm.
void propagateMCS(StiKalmanTrackNode *previousNode, const StiDetector *tDet)
StiNodeErrs mFE
covariance matrix of the track parameters
int getCharge() const
Get the charge (sign) of the track at this node.
double evaluateChi2Info(const StiHit *hit) const
double getDensity() const
Get the material density in grams/cubic centimeter.
void initialize(StiHit *h)
Initialize this node with the given hit information.