StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
genFitDca.h
1  /*
2  * \class StDcaGenFit
3  * \author Victor Perevoztchikov, 2006
4  */
5 /***************************************************************************
6  *
7  * $Id: genFitDca.h,v 1.1 2020/05/23 23:25:06 perev Exp $
8  *
9  * Author: Victor Perevoztchikov
10  ***************************************************************************
11  *
12  * Description:
13  *
14  * class StDcaGenFit it is almost copy of StEvent/StDcaGeometry
15  * class GFull is a converter from GenFit format into DCA representation in StDcaGenFit
16  *
17  * GFull gf;
18  * // Pos[3] - Position of track
19  * // UVN[3][3] - coordinate system in which Fit is made
20  * gf.SetGlob(Pos,UVN);
21  * gf.SetPars(icharge,PosV,PbegV); gf.SetBigPars(icharge,PosV,PbegV);
22  * gf.SetErrs(gfiErrs);
23  * // pars[5] - qPinv = charge/P
24  * // - uc - cos(Track direction * UVN[0]
25  * // - vc - cos(Track direction * UVN[1]
26  * // - u - posiotion along UVN[0]
27  * // - v - posiotion along UVN[1]
28  * gf.SetPars(Pars,sign
29  *
30  * // emx[15] - triangle error matrix
31  * gf.SetErrs(emx);
32  *
33  * StDcaGenFit dca,dca1;
34  * gf.FillDcaPars(dca);
35  * gf.FillDcaErrs(dca);
36  * // now dca is filled
37  *
38  ***************************************************************************
39  *
40  * $Log: genFitDca.h,v $
41  * Revision 1.1 2020/05/23 23:25:06 perev
42  * GenFit errors conversion into Dca
43  *
44  * Revision 2.6 2012/03/28 13:39:46 fisyak
45  * Add default parameter for Print
46  *
47  * Revision 2.5 2010/01/26 20:34:39 fisyak
48  * Add print out and conversion from DCA to x,y,z,px,py,pz
49  *
50  * Revision 2.4 2009/10/28 13:54:35 fisyak
51  * Forgot one more set
52  *
53  * Revision 2.3 2008/03/04 01:03:14 perev
54  * remove redundant mHz
55  *
56  **************************************************************************/
57 #ifndef StDcaGenFit_hh
58 #define StDcaGenFit_hh
59 #include "TVector3.h"
60 #include "TVectorD.h"
61 // All enums
62 enum {kNMaxPars = 6, kNMaxErrs= (kNMaxPars*(kNMaxPars+1))/2};
63 enum {kNMinPars = 5, kNMinErrs= (kNMinPars*(kNMinPars+1))/2};
64 enum {kNBigPars = 7, kNBigErrs= (kNBigPars*(kNBigPars+1))/2};
65 enum {
66  kqPinv = 0, // charge/momentum
67  kUc, // cos to Uvector
68  kVc, // cos to Vvector
69  kNc, // cos to Vvector
70  kU_, // along Uvector
71  kV_ // along Vvector
72 };
73 enum {
74  kqPtInv = 0, // charge/Pt
75  kDirX,
76  kDirY,
77  kDirZ,
78  kPosX,
79  kPosY,
80  kPosZ
81 };
82 enum {
83  kImp,
84  kZ,
85  kPsi,
86  kPti,
87  kTan
88 };
89 
90 class StDcaGenFit;
91 
92 class GFGlob {
93 public:
94 GFGlob();
95 double mH[3]; //Mag field in global sys
96 double mPos[3]; //Origin in global sys
97 double mUVN[3][3]; //Directions of local coord sys
98 };
99 
100 
101 class GFitPars
102 {
103 public:
104 GFitPars();
105 operator double* ()
106 
107 
108 
109 {return &mqPinv;}
110 operator const double* () const {return &mqPinv;}
111 void SetPars(double qpinv, double uc, double vc, double u, double v,int sig=1);
112 public:
113 double mqPinv; // charge/momentum
114 double mUc; // cos to Uvector
115 double mVc; // cos to Vvector
116 double mNc; // cos to Vvector
117 double mU; // along Uvector
118 double mV; // along Vvector
119 double mN; // along Nvector
120 int mSig; //+1,-1 track direction
121 };
122 
123 class GFitErrs
124 {
125 public:
126 GFitErrs();
127 public:
128 operator const double* () const {return &qPqP;}
129 operator double* () {return &qPqP;}
130 
131 
132 
133 
134 
135 public:
136 double
137 qPqP,
138 qPUc,UcUc,
139 qPVc,UcVc,VcVc,
140 qPNc,UcNc,VcNc,NcNc,
141 qPU, UcU, VcU, NcU, UU,
142 qPV, UcV, VcV, NcV, UV, VV;
143 };
144 
145 class GFull
146 {
147 public:
148 GFull(){mBigPars.ResizeTo(kNBigPars);}
149 void SetMag (const double h[3]);
150 void SetGlob (const double pos[3],const double uvn[3][3]);
151 void SetPars(double qpinv, double uc, double vc, double u, double v,int sig=1);
152 void SetPars(const double pars[5] ,int sig);
153 void SetPars(int icharge,const TVector3 pos,const TVector3 mom);
154 TVectorD GetPars(int* iSig=0) const;
155 
156 
157 void SetBigPars(int icharge,const TVector3 pos,const TVector3 mom);
158 const TVectorD &GetBigPars() const {return mBigPars;};
159 const double *GetBigErrs() const {return mBigErrs;};
160 void MakeTrak();
161 void SetErrs(const double emx[15]);
162 TVector3 Pos() const;
163 TVector3 Dir() const;
164 TVector3 Mom() const { return Dir()*(1./fabs(Pinv()));}
165 double SinL() const;
166 double CosL() const;
167 double TanL() const;
168 double Lam() const;
169 double Psi() const;
170 double Pti() const; //Perpendicular Z axis invered&signed
171 double Pinv() const; //Perpendicular Z axis invered&signed
172 double Imp() const;
173 const double *BigErrs() const { return mBigErrs;}
174 const double *XtdPars() const { return mPars; }
175 const double *XtdErrs() const { return mErrs; }
176 void FillDcaPars(StDcaGenFit &dca);
177 void FillDcaErrs(StDcaGenFit &dca);
178 static void TestConvertErrs();
179 
180 TVectorD BigVal() const ;
181 double BigDer(int ib,int iu);
182 
183 
184 
185 public:
186 GFGlob mGlob;
187 GFitPars mPars;
188 GFitErrs mErrs;
189 
190 TVector3 mPos;
191 TVector3 mDir;
192 double mqPinv;
193 TVectorD mBigPars;
194 double mBigErrs[kNBigErrs];
195 };
196 
197 
198 
199 class StDcaGenFit {
200 public:
201  StDcaGenFit();
202  virtual ~StDcaGenFit();
203 
204  Int_t charge() const {return (mPti>0)? -1:1;} // synchro with StiTrackNode charge definition
205  double impact() const {return mImp;}
206  double curvature() const {return mCurv;}
207  double psi() const {return mPsi ;}
208  double dipAngle() const {return atan(mTan);}
209  double tanDip() const {return mTan ;}
210  double pt() const {return 1./fabs(mPti);}
211  double z() const {return mZ ;}
212  double hz() const {return mCurv/mPti;}
213  TVector3 origin() const;
214  TVector3 momentum() const;
215  const float* params() const {return &mImp;}
216  const float* errMatrix() const {return &mImpImp;}
217  virtual void Print(const char *option = "") const;
218  //
219  // Experts only set function
220  //
221  void set(const float pars[6], const float errs[15]);
222  void set(const double pars[6], const double errs[15]);
223 
224 public:
225  char mBeg[1];
226  float mImp;
231  float mZ;
233  float mPsi;
235  float mPti;
237  float mTan;
239  float mCurv;
240 
242  float mImpImp;
243  float mZImp, mZZ;
244  float mPsiImp, mPsiZ, mPsiPsi;
245  float mPtiImp, mPtiZ, mPtiPsi, mPtiPti;
246  float mTanImp, mTanZ, mTanPsi, mTanPti, mTanTan;
247 
248  char mEnd[1];
249 
250 };
251 
252 #endif
253 
float mPsi
Psi angle of the track.
Definition: genFitDca.h:233
float mImpImp
pars errors
Definition: genFitDca.h:242
float mZ
Z-coordinate of this track (reference plane)
Definition: genFitDca.h:231
float mImp
Definition: genFitDca.h:229
float mPti
signed invert pt [sign = sign(-qB)]
Definition: genFitDca.h:235
float mTan
tangent of the track momentum dip angle
Definition: genFitDca.h:237
float mCurv
signed curvature
Definition: genFitDca.h:239