2 #define StiTrackNode_H 1
7 #include "StiTreeNode.h"
9 #include "StiNodePars.h"
11 double sign(
const double *b,
int n);
13 enum eTkPars {kNPars=6,kNErrs=21};
16 void reset(){memset(
this,0,
sizeof(
StiNodeMtx));}
17 double A[kNPars][kNPars];
28 double getDelta()
const {
return sqrt(_cXX+_cYY+_cZZ);}
29 double getDelta2()
const {
return (_cXX+_cYY+_cZZ);}
30 const double* G()
const {
return &_cXX;}
31 double* G() {
return &_cXX;}
32 StiNodeErrs &operator*=(
double f) {
for (
int i=0;i<kNErrs;i++){G()[i]*=f;};
return *
this;}
37 void get00(
double *a)
const;
38 void set00(
const double *a) ;
39 void get10(
double *a)
const;
40 void set10(
const double *a) ;
41 void get11(
double *a)
const;
42 void set11(
const double *a) ;
44 void recov(
int force=0);
45 int check(
const char *pri=0)
const;
48 double operator()(
int i,
int j)
const;
55 double _cZX,_cZY, _cZZ;
56 double _cEX,_cEY, _cEZ, _cEE;
57 double _cPX,_cPY, _cPZ, _cPE, _cPP;
58 double _cTX,_cTY, _cTZ, _cTE, _cTP, _cTT;
62 void reset() {memset(
this,0,
sizeof(*
this));}
63 StiHitErrs &operator*=(
double f) {
for (
int i=0;i<6;i++){G()[i]*=f;};
return *
this;}
64 void rotate(
double angle);
65 const double* G()
const {
return &hXX;}
66 double* G() {
return &hXX;}
101 StiHit *getHit (
int idx)
const {
return mHits[idx];}
102 int getNHits ()
const;
103 double getChi2 (
int idx=0)
const {
return mChi2[idx];}
104 double getDetr (
int idx=0)
const {
return mDetr[idx];}
105 void add (
StiHit *
hit,
double chi2,
double detr=1.);
106 void print (
const char* opt=
"")
const;
109 StiHit *mHits[kMaxSize+1];
110 double mChi2[kMaxSize+1];
111 double mDetr[kMaxSize+1];
119 enum eTrackNodeStatus {
132 enum eTrackNodeFlags {
137 virtual double getPt()
const=0;
142 virtual double x_g()
const =0;
143 virtual double y_g()
const =0;
144 virtual double z_g()
const =0;
145 virtual double x()
const =0;
146 virtual double y()
const =0;
147 virtual double z()
const =0;
149 StiHit * getHit()
const {
return _hit;}
153 double getChi2 ()
const {
return _chi2;}
154 double getDeterm()
const {
return _det ;}
155 void setChi2(
double chi2) {_chi2 =chi2;}
156 int getState()
const {
return _state;}
157 void setInvalid() { _state=0;}
158 void setReady() { _state=kTNReady;}
159 int isValid()
const {
return _state>=kTNReady;}
160 int isFitted()
const {
return (_hit && _chi2<1e3);}
161 double getRefPosition()
const;
162 double getLayerAngle()
const;
164 static void mult6(
double Rot[kNPars][kNPars],
const double Pro[kNPars][kNPars]);
165 static void errPropag6(
double G[21],
const double F[6][6],
int nF);
166 static int cylCross(
const double Xp[2],
const double Dp[2],
const double Rho,
const double r
167 ,
int dir,
double out[2][3]);
169 static double sinX(
double x);
182 inline void StiTrackNode::reset()
184 StiTreeNode::reset();
192 inline const StiDetector * StiTrackNode::getDetector()
const
197 inline void StiTrackNode::setDetector(
const StiDetector *detector)
199 _detector = detector;
204 _state = node._state;
205 _detector = node._detector;
static void errPropag6(double G[21], const double F[6][6], int nF)