11 |
#include <TRefArray.h> |
#include <TRefArray.h> |
12 |
#include <TRef.h> |
#include <TRef.h> |
13 |
|
|
14 |
#include <TrkStruct.h> |
#include <TrkParams.h> |
15 |
#include <TrkLevel1.h> |
#include <TrkLevel1.h> |
16 |
|
|
17 |
// z-coordinate of track state-vector reference-plane |
// z-coordinate of track state-vector reference-plane |
18 |
#define ZINI 23.5 |
#define ZINI 23.5 |
|
// upper and lower (mechanical) z-coordinate of the tracker |
|
|
//#define ZTRKUP 22.29 |
|
|
//#define ZTRKDW -22.22 |
|
19 |
// (mechanical) z-coordinate of the tracker planes |
// (mechanical) z-coordinate of the tracker planes |
20 |
#define ZTRK6 -22.23 |
#define ZTRK6 -22.22 |
21 |
#define ZTRK5 -13.32 |
#define ZTRK5 -13.31 |
22 |
#define ZTRK4 -4.42 |
#define ZTRK4 -4.41 |
23 |
#define ZTRK3 4.48 |
#define ZTRK3 4.49 |
24 |
#define ZTRK2 13.38 |
#define ZTRK2 13.39 |
25 |
#define ZTRK1 22.28 |
#define ZTRK1 22.29 |
26 |
|
// magnet cavity dimensions |
27 |
|
#define ZMAGNHIGH 21.83 |
28 |
|
#define ZMAGNLOW -21.83 |
29 |
|
#define XMAGNHIGH 8.07 |
30 |
|
#define XMAGNLOW -8.07 |
31 |
|
#define YMAGNHIGH 6.57 |
32 |
|
#define YMAGNLOW -6.57 |
33 |
// (mechanical) x/y-coordinates of magnet cavity |
// (mechanical) x/y-coordinates of magnet cavity |
34 |
#define XTRKL -8.1 |
#define XTRKL -8.1 |
35 |
#define XTRKR 8.1 |
#define XTRKR 8.1 |
59 |
Trajectory(); |
Trajectory(); |
60 |
Trajectory(int n); |
Trajectory(int n); |
61 |
Trajectory(int n, float* pz); |
Trajectory(int n, float* pz); |
62 |
|
~Trajectory(){Delete();}; |
63 |
void Dump(); |
void Dump(); |
64 |
|
void Delete(); |
65 |
|
|
66 |
|
int DoTrack2(float* al); |
67 |
float GetLength(){float l=0; for(int i=0; i<npoint;i++)l=l+tl[i]; return l;}; |
float GetLength(){float l=0; for(int i=0; i<npoint;i++)l=l+tl[i]; return l;}; |
68 |
float GetLength(int,int); |
float GetLength(int,int); |
69 |
|
|
76 |
* A track is defined by the measured coordinates associated to it, the |
* A track is defined by the measured coordinates associated to it, the |
77 |
* track status vector, plus other quantities. |
* track status vector, plus other quantities. |
78 |
* A track may have an "image", due to the ambiguity in the y view. |
* A track may have an "image", due to the ambiguity in the y view. |
79 |
|
* |
80 |
|
* Cluster flags: xgood[6], ygood[6] |
81 |
|
* |
82 |
|
* xgood/ygood = +/- 0lsccccccc |
83 |
|
* | |||------- ID (1-7483647) of the included cluster |
84 |
|
* | ||-------- sensor number (1,2 - increasing y) |
85 |
|
* | |--------- ladder number (1,2,3 - increasing x) |
86 |
|
* |------------- does-not/does include bad strips |
87 |
*/ |
*/ |
88 |
// ================================================================== |
// ================================================================== |
89 |
class TrkTrack : public TObject { |
class TrkTrack : public TObject { |
92 |
|
|
93 |
int seqno; ///<stored track sequential number |
int seqno; ///<stored track sequential number |
94 |
int image; ///<sequential number of track-image |
int image; ///<sequential number of track-image |
|
|
|
95 |
|
|
96 |
public: |
public: |
97 |
|
|
|
// TRef clx[6]; |
|
|
// TRef cly[6]; |
|
|
TRefArray *clx; |
|
|
TRefArray *cly; |
|
|
|
|
98 |
float al[5]; ///<TRACK STATE VECTOR |
float al[5]; ///<TRACK STATE VECTOR |
99 |
float coval[5][5]; ///<covariance matrix |
float coval[5][5]; ///<covariance matrix |
100 |
int xgood[6]; ///<mask of included x planes |
int xgood[6]; ///<cluster flag for x-view (0 = view not included in the fit) |
101 |
int ygood[6]; ///<mask of included y planes |
int ygood[6]; ///<cluster flag for y-view (0 = view not included in the fit) |
102 |
float xm[6]; ///<measured x coordinates |
float xm[6]; ///<measured x coordinates |
103 |
float ym[6]; ///<measured y coordinates |
float ym[6]; ///<measured y coordinates |
104 |
float zm[6]; ///<measured z coordinates |
float zm[6]; ///<measured z coordinates |
105 |
float resx[6]; ///<spatial resolution on X view |
float resx[6]; ///<spatial resolution on X view |
106 |
float resy[6]; ///<spatial resolution on y view |
float resy[6]; ///<spatial resolution on y view |
107 |
|
float tailx[6]; ///<spatial resolution tail on X view |
108 |
|
float taily[6]; ///<spatial resolution tail on y view |
109 |
float chi2; ///<chi2 |
float chi2; ///<chi2 |
110 |
int nstep; ///<n. step |
int nstep; ///<n. step |
111 |
float xv[6]; ///<calculated x coordinates |
float xv[6]; ///<calculated x coordinates |
112 |
float yv[6]; ///<calculated y coordinates |
float yv[6]; ///<calculated y coordinates |
113 |
float zv[6]; ///<calculated z coordinates |
float zv[6]; ///<calculated z coordinates |
114 |
float axv[6]; ///<calculated angles (deg) on x view |
float axv[6]; ///<calculated angles (deg) on x view |
115 |
float ayv[6]; ///<calculated angles (deg) on y view |
float ayv[6]; ///<calculated angles (deg) on y view |
116 |
float dedx_x[6]; ///<signal in MIP (scaled to 300 micrometer) |
float dedx_x[6]; ///<dE/dx in MIP (<0 if saturated) |
117 |
float dedx_y[6]; ///<signal in MIP (scaled to 300 micrometer) |
float dedx_y[6]; ///<dE/dx in MIP (<0 if saturated) |
|
|
|
118 |
|
|
119 |
TrkTrack(); |
TrkTrack(); |
120 |
TrkTrack(const TrkTrack&); |
TrkTrack(const TrkTrack&); |
121 |
|
|
122 |
void Dump(); |
~TrkTrack(){ Delete(); }; |
|
void Clear(); |
|
123 |
|
|
124 |
|
void Dump(); |
125 |
|
void Clear(); |
126 |
|
void Clear(Option_t *option){Clear();}; |
127 |
|
void Delete(); |
128 |
|
void Copy(TrkTrack&); |
129 |
|
// void Set(); |
130 |
|
|
131 |
Int_t GetSeqNo(){return seqno;} ///< Returns the track sequential number |
Int_t GetSeqNo(){return seqno;} ///< Returns the track sequential number |
132 |
Int_t GetImageSeqNo(){return image;} ///< Returns the track image sequential number |
Int_t GetImageSeqNo(){return image;} ///< Returns the track image sequential number |
133 |
Bool_t HasImage(){return !(image==-1);} ///< Returns true if the track has an image |
Bool_t HasImage(){return !(image==-1);} ///< Returns true if the track has an image |
134 |
int DoTrack(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
int DoTrack(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
135 |
int DoTrack2(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
int DoTrack2(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
136 |
float BdL(){return 0;}; ///< Evaluates the integral of B*dL along the track. |
float BdL(){return 0;}; ///< Evaluates the integral of B*dL along the track. |
137 |
Int_t GetNX(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=xgood[i]; return n;}; |
Int_t GetNX(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=(Int_t)XGood(i); return n;}; |
138 |
Int_t GetNY(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=ygood[i]; return n;}; |
Int_t GetNY(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=(Int_t)YGood(i); return n;}; |
139 |
Int_t GetNtot(){return GetNX()+GetNY();}; |
Int_t GetNtot(){return GetNX()+GetNY();}; |
140 |
Float_t GetRigidity(); |
Float_t GetRigidity(); |
141 |
Float_t GetDeflection(); |
Float_t GetDeflection(); |
142 |
|
Bool_t IsSaturated(int,int); |
143 |
|
Bool_t IsSaturated(int); |
144 |
|
Bool_t IsSaturated(); |
145 |
|
Bool_t IsBad(int,int); |
146 |
Float_t GetDEDX(); |
Float_t GetDEDX(); |
147 |
Float_t GetDEDX(Int_t ip){if( !(xgood[ip]+ygood[ip]) ) return 0; return (dedx_x[ip]+dedx_y[ip])/(xgood[ip]+ygood[ip]);}; |
Float_t GetDEDX(int); |
148 |
// sono un'imbecille... assegno xm e ym anche quando si tratta di un singolo |
Float_t GetDEDX(int,int); |
149 |
// non posso quindi usare xm e ym per dire se una vista e` inclusa nel fit o no |
Int_t GetLeverArmX(); |
150 |
/* Bool_t XGood(int ip){ return xm[ip] != -100.;}; |
Int_t GetLeverArmY(); |
151 |
Bool_t YGood(int ip){ return ym[ip] != -100.;};*/ |
|
152 |
Bool_t XGood(int ip){ return xgood[ip]==1;}; |
void SetMeasure(double *xmeas, double *ymeas, double *zmeas); |
153 |
Bool_t YGood(int ip){ return ygood[ip]==1;}; |
void SetResolution(double *rx, double *ry); |
154 |
|
void SetTail(double *tx, double *ty, double factor); |
155 |
TrkCluster *GetClusterX(int ip){TrkCluster *pt = (TrkCluster*)(clx->At(ip)); return pt;}; |
void SetStudentParam(int flag); |
156 |
TrkCluster *GetClusterY(int ip){TrkCluster *pt = (TrkCluster*)(cly->At(ip)); return pt;}; |
void SetGood(int *xg, int *yg); |
157 |
|
void LoadField(TString s); |
158 |
|
void Fit(double pfixed, int& fail, int iprint, int froml1); |
159 |
|
void Fit(double pfixed, int& fail, int iprint){ Fit(pfixed,fail,iprint,0); }; |
160 |
|
void FitReset(); |
161 |
|
void SetTrackingMode(int trackmode); |
162 |
|
void SetPrecisionFactor(double fact); |
163 |
|
void SetStepMin(int istepmin); |
164 |
|
Bool_t IsInsideCavity(); |
165 |
|
|
166 |
|
void EvaluateClusterPositions(); |
167 |
|
|
168 |
|
void FillMiniStruct(cMini2track&); |
169 |
|
void SetFromMiniStruct(cMini2track*); |
170 |
|
|
171 |
|
Int_t GetClusterX_ID(int ip); |
172 |
|
Int_t GetClusterY_ID(int ip); |
173 |
|
Int_t GetLadder(int ip); |
174 |
|
Int_t GetSensor(int ip); |
175 |
|
Bool_t XGood(int ip){ return GetClusterX_ID(ip)!=-1; }; |
176 |
|
Bool_t YGood(int ip){ return GetClusterY_ID(ip)!=-1; }; |
177 |
|
void ResetXGood(int ip){ xgood[ip]=0; }; |
178 |
|
void ResetYGood(int ip){ ygood[ip]=0; }; |
179 |
|
void SetXGood(int ip, int clid, int is); |
180 |
|
void SetYGood(int ip, int clid, int is); |
181 |
|
|
182 |
|
Bool_t BadClusterX(int ip){ return IsBad(ip,0); }; |
183 |
|
Bool_t BadClusterY(int ip){ return IsBad(ip,1); }; |
184 |
|
|
185 |
|
Bool_t SaturatedClusterX(int ip){ return IsSaturated(ip,0); }; |
186 |
|
Bool_t SaturatedClusterY(int ip){ return IsSaturated(ip,1); }; |
187 |
|
|
188 |
TrkTrack* GetTrkTrack(){return this;}; |
TrkTrack* GetTrkTrack(){return this;}; |
189 |
|
|
190 |
friend class TrkLevel2; |
friend class TrkLevel2; |
191 |
|
|
192 |
ClassDef(TrkTrack,2); |
ClassDef(TrkTrack,3); |
193 |
|
|
194 |
}; |
}; |
195 |
/** |
/** |
204 |
|
|
205 |
public: |
public: |
206 |
|
|
|
TRef cls; |
|
|
|
|
207 |
int plane; ///<plane |
int plane; ///<plane |
208 |
float coord[2]; ///<coordinate (on sensor 1 and 2) |
float coord[2]; ///<coordinate (on sensor 1 and 2) |
209 |
float sgnl; ///<cluster signal in MIP |
float sgnl; ///<cluster signal in MIP (<0 if saturated) |
210 |
|
|
211 |
TrkSinglet(); |
TrkSinglet(); |
212 |
TrkSinglet(const TrkSinglet&); |
TrkSinglet(const TrkSinglet&); |
213 |
|
~TrkSinglet(){Delete();}; |
214 |
|
|
215 |
void Dump(); |
void Dump(); |
216 |
|
void Clear(); |
217 |
|
void Clear(Option_t *option){Clear();}; |
218 |
|
void Delete(){Clear();}; |
219 |
|
Float_t GetSignal(){return fabs(sgnl);} |
220 |
|
Bool_t IsSaturated(){return (sgnl<0); }; |
221 |
|
|
|
TrkCluster *GetCluster(){TrkCluster *pt = (TrkCluster*)cls.GetObject(); return pt;}; |
|
|
|
|
222 |
friend class TrkLevel2; |
friend class TrkLevel2; |
223 |
|
|
224 |
ClassDef(TrkSinglet,2); |
ClassDef(TrkSinglet,3); |
225 |
|
|
226 |
}; |
}; |
227 |
|
|
239 |
class TrkLevel2 : public TObject { |
class TrkLevel2 : public TObject { |
240 |
|
|
241 |
private: |
private: |
242 |
|
|
|
// TRefArray *PhysicalTrack; ///< physical tracks (no image) - |
|
|
|
|
243 |
public: |
public: |
244 |
|
|
245 |
Int_t good[12]; ///< event status |
Int_t good[12]; ///< event status |
246 |
// Int_t good2; |
UInt_t VKmask[12]; ///< Viking-chip mask |
247 |
// Int_t crc[12]; |
UInt_t VKflag[12]; ///< Viking-chip flag |
248 |
|
|
249 |
TClonesArray *Track; ///< fitted tracks |
TClonesArray *Track; ///< fitted tracks |
250 |
TClonesArray *SingletX; ///< x singlets |
TClonesArray *SingletX; ///< x singlets |
252 |
|
|
253 |
TrkLevel2(); |
TrkLevel2(); |
254 |
// TrkLevel2(cTrkLevel2 *); |
// TrkLevel2(cTrkLevel2 *); |
255 |
|
~TrkLevel2(){Delete();}; |
256 |
|
|
257 |
|
void Clear(); |
258 |
|
void Clear(Option_t *option){Clear();}; |
259 |
|
void Delete(); |
260 |
|
void Set(); |
261 |
|
|
262 |
int ntrk() {return Track->GetEntries();} ///< number of stored track |
int ntrk() {return Track->GetEntries();} ///< number of stored track |
263 |
int nclsx(){return SingletX->GetEntries();} ///< number of x singlets |
int nclsx(){return SingletX->GetEntries();} ///< number of x singlets |
264 |
int nclsy(){return SingletY->GetEntries();} ///< number of y singlets |
int nclsy(){return SingletY->GetEntries();} ///< number of y singlets |
265 |
|
|
266 |
void Dump(); |
void Dump(); |
267 |
void SetFromLevel2Struct(cTrkLevel2 *); |
void SetFromLevel2Struct(cTrkLevel2 *, TrkLevel1 *); |
268 |
void SetFromLevel2Struct(cTrkLevel2 *, TrkLevel1 *); |
void SetFromLevel2Struct(cTrkLevel2 *s2){ SetFromLevel2Struct(s2, NULL); }; |
269 |
void GetLevel2Struct(cTrkLevel2 *) const; |
void SetFromLevel2Struct(TrkLevel1 *l1) { SetFromLevel2Struct(&level2event_, l1); }; |
270 |
void Clear(); |
void SetFromLevel2Struct() { SetFromLevel2Struct(&level2event_); }; |
271 |
|
void GetLevel2Struct(cTrkLevel2 *) const; |
272 |
void LoadField(TString); |
void LoadField(TString); |
273 |
|
float GetBX(float* v){return TrkParams::GetBX(v);};///< Bx (kGauss) |
274 |
|
float GetBY(float* v){return TrkParams::GetBY(v);};///< By (kGauss) |
275 |
|
float GetBZ(float* v){return TrkParams::GetBZ(v);};///< Bz (kGauss) |
276 |
Float_t GetZTrk(Int_t); |
Float_t GetZTrk(Int_t); |
277 |
Float_t GetXTrkLeft(){return XTRKL;}; |
Float_t GetXTrkLeft(){return XTRKL;}; |
278 |
Float_t GetXTrkRight(){return XTRKR;}; |
Float_t GetXTrkRight(){return XTRKR;}; |
279 |
Float_t GetYTrkLeft(){return YTRKL;}; |
Float_t GetYTrkLeft(){return YTRKL;}; |
280 |
Float_t GetYTrkRight(){return YTRKR;}; |
Float_t GetYTrkRight(){return YTRKR;}; |
281 |
|
|
282 |
|
Bool_t IsMaskedVK(int,int); |
283 |
|
Bool_t GetVKMask(int,int); |
284 |
|
Bool_t GetVKFlag(int,int); |
285 |
|
|
286 |
TrkSinglet *GetSingletX(int); |
TrkSinglet *GetSingletX(int); |
287 |
TrkSinglet *GetSingletY(int); |
TrkSinglet *GetSingletY(int); |
288 |
|
|
289 |
TrkTrack *GetStoredTrack(int i); |
TrkTrack *GetStoredTrack(int i); |
290 |
Int_t GetSeqNo(Int_t i) {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number |
Int_t GetSeqNo(Int_t i) {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number |
|
// TClonesArray *GetTracks_Chi2Sorted(); |
|
|
// TClonesArray *GetTracks_NFitSorted(); |
|
|
// TClonesArray *GetTracks(); |
|
|
TRefArray *GetTracks_NFitSorted(); |
|
|
TRefArray *GetTracks(){return this->GetTracks_NFitSorted();}; |
|
|
|
|
|
// int GetNTracks(){return this->GetTracks()->GetEntries();} |
|
|
Int_t GetNTracks(); |
|
|
TrkTrack* GetTrack(int i); |
|
|
TrkTrack* GetTrackImage(int i); |
|
291 |
|
|
292 |
|
TRefArray *GetTracks_NFitSorted(); |
293 |
|
TRefArray *GetTracks(){return this->GetTracks_NFitSorted();}; |
294 |
|
|
295 |
|
Int_t GetNTracks(); |
296 |
|
TrkTrack* GetTrack(int i); |
297 |
|
TrkTrack* GetTrackImage(int i); |
298 |
|
|
299 |
TrkLevel2* GetTrkLevel2(){return this;} |
TrkLevel2* GetTrkLevel2(){return this;} |
300 |
TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array |
TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array |
301 |
|
|
302 |
ClassDef(TrkLevel2,2); |
ClassDef(TrkLevel2,3); |
303 |
|
|
304 |
}; |
}; |
305 |
|
|