1 |
/** |
2 |
* \file ExtTrack.h |
3 |
* \author Elena Vannuccini |
4 |
*/ |
5 |
#ifndef exttrack_h |
6 |
#define exttrack_h |
7 |
|
8 |
#include <TrkLevel2.h> |
9 |
#include <TrkParams.h> |
10 |
|
11 |
|
12 |
/** |
13 |
* \brief Struct to pass mini2 track parameters to F77 routines |
14 |
*/ |
15 |
#define NPLANEMAX 56 |
16 |
|
17 |
struct cMiniExtTrack { |
18 |
double al[5]; |
19 |
double xm[NPLANEMAX],ym[NPLANEMAX],zm[NPLANEMAX]; |
20 |
double xm_a[NPLANEMAX],ym_a[NPLANEMAX],zm_a[NPLANEMAX]; |
21 |
double xm_b[NPLANEMAX],ym_b[NPLANEMAX],zm_b[NPLANEMAX]; |
22 |
double resx[NPLANEMAX],resy[NPLANEMAX]; |
23 |
double tailx[NPLANEMAX],taily[NPLANEMAX]; |
24 |
double xgood[NPLANEMAX],ygood[NPLANEMAX]; |
25 |
double dedxtrk_x[NPLANEMAX]; |
26 |
double dedxtrk_y[NPLANEMAX]; |
27 |
double zini; |
28 |
double pfixed; |
29 |
double chi2; |
30 |
double xv[NPLANEMAX],yv[NPLANEMAX],zv[NPLANEMAX]; |
31 |
double axv[NPLANEMAX],ayv[NPLANEMAX]; |
32 |
double cov[5][5]; |
33 |
double fact; |
34 |
int nstep; |
35 |
int idcand; |
36 |
int trackmode; |
37 |
int istepmin; |
38 |
int nplanes; |
39 |
|
40 |
}; |
41 |
|
42 |
extern "C" { |
43 |
|
44 |
extern struct cMiniExtTrack exttrack_; |
45 |
void miniext_(int*,int*,int*); |
46 |
void guessext_(); |
47 |
|
48 |
} |
49 |
|
50 |
|
51 |
class ExtTrack : public TObject { |
52 |
|
53 |
private: |
54 |
|
55 |
public: |
56 |
|
57 |
|
58 |
float zini; |
59 |
float al[5]; ///<TRACK STATE VECTOR |
60 |
float coval[5][5]; ///<covariance matrix |
61 |
float chi2; |
62 |
int nstep; |
63 |
int nplanes; |
64 |
int* xgood ; //[nplanes] |
65 |
int* ygood ; //[nplanes] |
66 |
int* multmaxx; //[nplanes] |
67 |
int* multmaxy; //[nplanes] |
68 |
float* xm ; //[nplanes] |
69 |
float* ym ; //[nplanes] |
70 |
float* zm ; //[nplanes] |
71 |
float* xma ; //[nplanes] |
72 |
float* yma ; //[nplanes] |
73 |
float* zma ; //[nplanes] |
74 |
float* xmb ; //[nplanes] |
75 |
float* ymb ; //[nplanes] |
76 |
float* zmb ; //[nplanes] |
77 |
float* resx ; //[nplanes] |
78 |
float* resy ; //[nplanes] |
79 |
float* xv ; //[nplanes] |
80 |
float* yv ; //[nplanes] |
81 |
float* zv ; //[nplanes] |
82 |
float* axv ; //[nplanes] |
83 |
float* ayv ; //[nplanes] |
84 |
float* dedx_x ; //[nplanes] |
85 |
float* dedx_y ; //[nplanes] |
86 |
|
87 |
float xGF[14]; ///<calculated x coordinates on GF reference planes |
88 |
float yGF[14]; ///<calculated y coordinates on GF reference planes |
89 |
|
90 |
ExtTrack(int dim=0); |
91 |
|
92 |
ExtTrack( TrkTrack& t){SetDimension(6); Set(t); } |
93 |
ExtTrack( const ExtTrack& ); |
94 |
|
95 |
~ExtTrack(){ Delete(); }; |
96 |
|
97 |
void SetDimension(int dim); ///< Allocate vectors |
98 |
void Clear(Option_t* option=""); ///< Deallocate vectors |
99 |
void Delete(); ///< Deallocate vectors |
100 |
|
101 |
void Copy(ExtTrack&); |
102 |
|
103 |
|
104 |
void SetMiniDefault(); ///< Set tracking alg. parameters (static) |
105 |
void SetZ0(float zin){zini = zin; } ///< Set z-coord of reference plane |
106 |
|
107 |
|
108 |
void Set( TrkTrack& t, int index); ///< Set from TrkTrack object |
109 |
void Set( TrkTrack& t){ Set(t,0);}; ///< Set from TrkTrack object |
110 |
void FillMiniStruct(cMiniExtTrack& track); |
111 |
void SetFromMiniStruct(cMiniExtTrack *track); |
112 |
void FillMiniStruct(){FillMiniStruct(exttrack_); }; |
113 |
void SetFromMiniStruct(){SetFromMiniStruct(&exttrack_);}; |
114 |
|
115 |
|
116 |
bool SetZ(int ip,float zmeas); |
117 |
bool SetXY(int ip,float xmeas, float ymeas, float rx, float ry); |
118 |
bool SetX(int ip,float xa, float xb, float ya, float yb, float res); |
119 |
bool SetY(int ip,float xa, float xb, float ya, float yb, float res); |
120 |
bool ResetXY(int ip); |
121 |
|
122 |
bool SetXGood(int ip,int icl_piu_uno=1, int il=-1, int is=-1 ); ///< same notation as TrkTrack |
123 |
bool SetYGood(int ip,int icl_piu_uno=1, int il=-1, int is=-1 );///< same notation as TrkTrack |
124 |
|
125 |
void ResetFit(); ///<Reset fit variables |
126 |
void ResetXY(); ///<Reset all measured-position variables |
127 |
void Reset(){ ResetFit(); ResetXY(); } ///<Reset all variables |
128 |
|
129 |
|
130 |
|
131 |
void Dump(); |
132 |
|
133 |
|
134 |
void Fit(double pfixed, int& fail, int iprint); |
135 |
|
136 |
Bool_t XGood(int ip){ return GetClusterX_ID(ip)!=-1; }; |
137 |
Bool_t YGood(int ip){ return GetClusterY_ID(ip)!=-1; }; |
138 |
int GetClusterX_ID(int ip); |
139 |
int GetClusterY_ID(int ip); |
140 |
int GetLadder(int ip); |
141 |
int GetSensor(int ip); |
142 |
|
143 |
int GetNX(){int n=0; for(int i=0; i<nplanes; i++)n+=(int)(XGood(i)); return n;}; |
144 |
int GetNY(){int n=0; for(int i=0; i<nplanes; i++)n+=(int)(YGood(i)); return n;}; |
145 |
int GetNXY(){int n=0; for(int i=0; i<nplanes; i++)n+=(int)(YGood(i)&&XGood(i)); return n;}; |
146 |
int GetNtot(){return GetNX()+GetNY();}; |
147 |
int GetNhit(){int n=0; for(int i=0; i<nplanes; i++)n+=(int)(YGood(i)||XGood(i)); return n;}; |
148 |
|
149 |
Float_t GetDEDX(); |
150 |
Float_t GetDEDX(int ip); |
151 |
Float_t GetDEDX(int ip,int iv); |
152 |
|
153 |
Float_t GetDEDXX(bool cutSat=false); |
154 |
Float_t GetDEDXY(bool cutSat=false); |
155 |
|
156 |
|
157 |
Int_t GetClusterX_Multiplicity(int ip); |
158 |
Int_t GetClusterY_Multiplicity(int ip); |
159 |
Int_t GetClusterX_MaxStrip(int ip); |
160 |
Int_t GetClusterY_MaxStrip(int ip); |
161 |
|
162 |
Float_t GetRigidity(); |
163 |
Float_t GetDeflection(); |
164 |
Float_t GetMDR(){return (coval[4][4]>0 ? 1./sqrt(coval[4][4]) : 0.); }; |
165 |
|
166 |
Bool_t IsSaturated(int,int); |
167 |
Bool_t IsSaturated(int); |
168 |
Bool_t IsSaturated(); |
169 |
Bool_t IsBad(int,int); |
170 |
Int_t GetLeverArmXY(); |
171 |
Int_t GetLeverArmX(); |
172 |
Int_t GetLeverArmY(); |
173 |
Float_t GetChi2X(); //EM |
174 |
Float_t GetChi2Y(); //EM |
175 |
/* Bool_t IsInsideCavity(float); */ |
176 |
/* Bool_t IsInsideCavity(){ return IsInsideCavity(0.); } */ |
177 |
Bool_t IsInsideAcceptance(float); // EM |
178 |
Bool_t IsInsideAcceptance(){ return IsInsideAcceptance(0.); } //EM |
179 |
/* Bool_t IsInsideGFSurface(const char*,float); */ |
180 |
/* Bool_t IsInsideGFSurface(const char* surf){ return IsInsideGFSurface(surf,0.); } */ |
181 |
/* Bool_t BadClusterX(int ip){ return IsBad(ip,0); } */ |
182 |
/* Bool_t BadClusterY(int ip){ return IsBad(ip,1); } */ |
183 |
/* Bool_t SaturatedClusterX(int ip){ return IsSaturated(ip,0); } */ |
184 |
/* Bool_t SaturatedClusterY(int ip){ return IsSaturated(ip,1); } */ |
185 |
|
186 |
|
187 |
|
188 |
|
189 |
ClassDef(ExtTrack,3); |
190 |
|
191 |
}; |
192 |
|
193 |
#endif |