StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiTrackNodeHelper.h
1 #ifndef StiTrackNodeHelper_H
2 #define StiTrackNodeHelper_H 1
3 
4 
5 #include "StiKalmanTrackNode.h"
6 class StiDetector;
7 class StiMcsErrs {
8 public:
9 void reset() {memset(this,0,sizeof(*this));}
10 public:
11 double _cEE ; //add err to <eta*eta> eta crossing angle
12 double _cPP; //add err to <ptin*ptin>
13 double _cTP; //add err to <tanL*ptin>
14 double _cTT; //add err to <tanL*tanL>
15 double _ptinCorr; //ptin correction factor -1
16 };
17 
18 
19 class QaFit
20 {
21 public:
22 QaFit() {reset();}
23 void reset() {memset(this,0,sizeof(*this));}
24 void add(double val);
25 void finish();
26 int getTally() const {return mTally;}
27 double getAccu(int kValCorr);
28 double getMaxi(int kValCorr) {return mMaxi[kValCorr];}
29 double getNStd(int kValCorr);
30 double getNSgn(int kValCorr);
31 void getInfo(double *info);
32 private:
33 double mPrev;
34 double mAver[2];
35 double mErrr[2];
36 double mMaxi[2];
37 int mNega[2];
38 
39 int mEnded;
40 int mTally;
41 };
42 
43 
45 {
46 public:
47 
49  void set(double chi2max,double chi2vtx,double errConfidence,int iter);
50  void set(StiKalmanTrackNode *pNode,StiKalmanTrackNode *sNode);
51  int makeFit(int smooth);
52  StiKalmanTrackNode *getWorst() const {return mWorstNode;}
53  StiKalmanTrackNode *getFlipFlop() const {return mFlipFlopNode;}
54  StiKalmanTrackNode *getVertexNode() const {return mVertexNode;}
55  int getUsed() const {return mUsed;}
56  void setDir(int dir) { mDir = dir;};
57 static int isCutStep() {return mgCutStep;}
58 private:
59  void reset();
60  int propagatePars(const StiNodePars &parPars
61  , StiNodePars &rotPars
62  , StiNodePars &proPars);
63  int propagateFitd();
64  int propagateMtx();
65  int propagateError();
66  int setHitErrs();
67  int propagateMCS();
68  double evalChi2();
69  double joinChi2();
70  double recvChi2();
71  int updateNode();
72  void resetError(double fk=0.);
73  int nudge();
74  int join();
75  int save();
76  int cutStep(StiNodePars *pars,StiNodePars *base);
77  double pathIn(const StiDetector *det,StiNodePars *pars);
78 // Static methods
79 public:
80 static double joinTwo(int nP1,const double *P1 ,const double *E1
81  ,int nP2,const double *P2 ,const double *E2
82  , double *PJ=0, double *EJ=0);
83 
84 #if 0
85 static double joinVtx( const double *P1 ,const double *E1
86  ,const double *P2 ,const double *E2
87  , double *PJ=0, double *EJ=0);
88 #endif
89 double joinVtx(const double *Y,const StiHitErrs &B
90  ,const StiNodePars &X,const StiNodeErrs &A
91  , StiNodePars *M=0, StiNodeErrs *C=0);
92 static int getHitErrors(const StiHit *hit,const StiNodePars *pars, StiHitErrs *hrr);
93 static Int_t debug() {return _debug;}
94 static void setDebug(Int_t m) {_debug = m;}
95 
96 private:
97 double mChi2Max;
98 double mChi2Vtx;
99 double mNodeErrFactor;
100 double mHitsErrFactor;
101 double mParentHz;
102 double mTargetHz;
103 int mIter; //current iter number
104 int mDir; //current iter number
105 StiKalmanTrackNode *mWorstNode; //node with the worst Chi2
106 StiKalmanTrackNode *mFlipFlopNode; //node with the worst flip/flop ratio
107 StiKalmanTrackNode *mVertexNode; //vertex node
108 char mBeg[1];
109 StiKalmanTrackNode *mParentNode;
110 StiKalmanTrackNode *mTargetNode;
111 const StiDetector *mDetector;
112 const StiHit *mHit;
113 StiNodePars mBestParentPars; //Best parent params
114 StiNodePars mBestParentRotPars; //Best rotated parent params into target node frame
115 StiNodePars mBestPars; //Propagated best parent params into target node frame
116 double mBestDelta; //maximal step in x,y,z allowed
117 
118 StiNodePars mFitdParentPars; //Fitted parent params in own coordianate frame node frame
119 StiNodePars mPredPars; //Fitted parent params propagated into target frame
120 StiNodePars mFitdPars; //Fitted target params
121 StiNodePars mJoinPars; //Joined target params
122 
123 StiNodePars mSavdParentPars; //Saved params from the previous fit
124 double mSavdDelta; //Saved delta to select the best Best
125 
126 StiNodeErrs mFitdParentErrs; //fitted parenterrors
127 StiNodeErrs mPredErrs; //predicted errors
128 StiNodeErrs mFitdErrs; //fitted target errors
129 StiNodeErrs mJoinErrs; //joined target errors
130 StiNodeErrs mBestParentErrs; //best parent errors
131 
132 StiNodeMtx mMtx;
133 StiMcsErrs mMcs;
134 double mHitPars[3];
135 StiHitErrs mHrr;
136 StiNode2Pars mUnTouch;
137 // locals
138  double alpha,ca,sa;
139  double x1;
140  double x2;
141  double dx;
142  double rho;
143  double dsin;
144  double sinCA2;
145  double cosCA2;
146  double sumSin;
147  double sumCos;
148  double dy;
149  double y2;
150  double dl0;
151  double sind;
152  double dl;
153 
154  double mDetm;
155  double mChi2;
156  int mState;
157  int mUsed;
158  char mEnd[1];
159  static int _debug;
160 public:
161  QaFit mCurvQa;
162  QaFit mTanlQa;
163  static int mgCutStep;
164 };
165 
166 
167 
168 #endif
169 
170 
171 
Definition: StiHit.h:51