11 |
#include <TRefArray.h> |
#include <TRefArray.h> |
12 |
#include <TRef.h> |
#include <TRef.h> |
13 |
|
|
|
//#include <TrkStruct.h> |
|
14 |
#include <TrkParams.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.23 |
21 |
#define ZTRK5 -13.32 |
#define ZTRK5 -13.32 |
69 |
* A track is defined by the measured coordinates associated to it, the |
* A track is defined by the measured coordinates associated to it, the |
70 |
* track status vector, plus other quantities. |
* track status vector, plus other quantities. |
71 |
* 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. |
72 |
|
* |
73 |
|
* Cluster flags: xgood[6], ygood[6] |
74 |
|
* |
75 |
|
* xgood/ygood = +/- 0lsccccccc |
76 |
|
* | |||------- ID (1-7483647) of the included cluster |
77 |
|
* | ||-------- sensor number (1,2 - increasing y) |
78 |
|
* | |--------- ladder number (1,2,3 - increasing x) |
79 |
|
* |------------- does-not/does include bad strips |
80 |
*/ |
*/ |
81 |
// ================================================================== |
// ================================================================== |
82 |
class TrkTrack : public TObject { |
class TrkTrack : public TObject { |
85 |
|
|
86 |
int seqno; ///<stored track sequential number |
int seqno; ///<stored track sequential number |
87 |
int image; ///<sequential number of track-image |
int image; ///<sequential number of track-image |
|
|
|
88 |
|
|
89 |
public: |
public: |
90 |
|
|
|
TRefArray *clx; |
|
|
TRefArray *cly; |
|
|
|
|
|
/* float al[5]; ///<TRACK STATE VECTOR */ |
|
91 |
float al[5]; ///<TRACK STATE VECTOR |
float al[5]; ///<TRACK STATE VECTOR |
92 |
float coval[5][5]; ///<covariance matrix |
float coval[5][5]; ///<covariance matrix |
93 |
int xgood[6]; ///<mask of included x planes |
int xgood[6]; ///<cluster flag for x-view (0 = view not included in the fit) |
94 |
int ygood[6]; ///<mask of included y planes |
int ygood[6]; ///<cluster flag for y-view (0 = view not included in the fit) |
95 |
float xm[6]; ///<measured x coordinates |
float xm[6]; ///<measured x coordinates |
96 |
float ym[6]; ///<measured y coordinates |
float ym[6]; ///<measured y coordinates |
97 |
float zm[6]; ///<measured z coordinates |
float zm[6]; ///<measured z coordinates |
98 |
float resx[6]; ///<spatial resolution on X view |
float resx[6]; ///<spatial resolution on X view |
99 |
float resy[6]; ///<spatial resolution on y view |
float resy[6]; ///<spatial resolution on y view |
100 |
|
float tailx[6]; ///<spatial resolution tail on X view |
101 |
|
float taily[6]; ///<spatial resolution tail on y view |
102 |
float chi2; ///<chi2 |
float chi2; ///<chi2 |
103 |
int nstep; ///<n. step |
int nstep; ///<n. step |
104 |
float xv[6]; ///<calculated x coordinates |
float xv[6]; ///<calculated x coordinates |
106 |
float zv[6]; ///<calculated z coordinates |
float zv[6]; ///<calculated z coordinates |
107 |
float axv[6]; ///<calculated angles (deg) on x view |
float axv[6]; ///<calculated angles (deg) on x view |
108 |
float ayv[6]; ///<calculated angles (deg) on y view |
float ayv[6]; ///<calculated angles (deg) on y view |
109 |
float dedx_x[6]; ///<dE/dx in MIP |
float dedx_x[6]; ///<dE/dx in MIP (<0 if saturated) |
110 |
float dedx_y[6]; ///<dE/dx in MIP |
float dedx_y[6]; ///<dE/dx in MIP (<0 if saturated) |
111 |
|
|
112 |
TrkTrack(); |
TrkTrack(); |
113 |
TrkTrack(const TrkTrack&); |
TrkTrack(const TrkTrack&); |
127 |
int DoTrack(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
int DoTrack(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
128 |
int DoTrack2(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
int DoTrack2(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
129 |
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. |
130 |
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;}; |
131 |
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;}; |
132 |
Int_t GetNtot(){return GetNX()+GetNY();}; |
Int_t GetNtot(){return GetNX()+GetNY();}; |
133 |
Float_t GetRigidity(); |
Float_t GetRigidity(); |
134 |
Float_t GetDeflection(); |
Float_t GetDeflection(); |
135 |
|
Bool_t IsSaturated(int,int); |
136 |
|
Bool_t IsSaturated(int); |
137 |
|
Bool_t IsSaturated(); |
138 |
|
Bool_t IsBad(int,int); |
139 |
Float_t GetDEDX(); |
Float_t GetDEDX(); |
140 |
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); |
141 |
// sono un'imbecille... assegno xm e ym anche quando si tratta di un singolo |
Float_t GetDEDX(int,int); |
142 |
// non posso quindi usare xm e ym per dire se una vista e` inclusa nel fit o no |
Int_t GetLeverArmX(); |
143 |
/* Bool_t XGood(int ip){ return xm[ip] != -100.;}; |
Int_t GetLeverArmY(); |
|
Bool_t YGood(int ip){ return ym[ip] != -100.;};*/ |
|
|
Bool_t XGood(int ip){ return xgood[ip]> 0;}; |
|
|
Bool_t YGood(int ip){ return ygood[ip]> 0;}; |
|
|
|
|
144 |
|
|
145 |
void SetMeasure(double *xmeas, double *ymeas, double *zmeas); |
void SetMeasure(double *xmeas, double *ymeas, double *zmeas); |
146 |
void SetResolution(double *rx, double *ry); |
void SetResolution(double *rx, double *ry); |
147 |
|
void SetTail(double *tx, double *ty, double factor); |
148 |
|
void SetStudentParam(int flag); |
149 |
void SetGood(int *xg, int *yg); |
void SetGood(int *xg, int *yg); |
150 |
void LoadField(TString s); |
void LoadField(TString s); |
151 |
void Fit(double pfixed, int& fail, int iprint); |
void Fit(double pfixed, int& fail, int iprint, int froml1); |
152 |
|
void Fit(double pfixed, int& fail, int iprint){ Fit(pfixed,fail,iprint,0); }; |
153 |
void FitReset(); |
void FitReset(); |
154 |
void SetTrackingMode(int trackmode); |
void SetTrackingMode(int trackmode); |
155 |
void SetPrecisionFactor(double fact); |
void SetPrecisionFactor(double fact); |
156 |
void SetStepMin(int istepmin); |
void SetStepMin(int istepmin); |
157 |
|
|
158 |
|
void EvaluateClusterPositions(); |
159 |
|
|
160 |
void FillMiniStruct(cMini2track&); |
void FillMiniStruct(cMini2track&); |
161 |
void SetFromMiniStruct(cMini2track*); |
void SetFromMiniStruct(cMini2track*); |
162 |
|
|
163 |
TrkCluster *GetClusterX(int ip); |
Int_t GetClusterX_ID(int ip); |
164 |
TrkCluster *GetClusterY(int ip); |
Int_t GetClusterY_ID(int ip); |
165 |
|
Int_t GetLadder(int ip); |
166 |
|
Int_t GetSensor(int ip); |
167 |
|
Bool_t XGood(int ip){ return GetClusterX_ID(ip)!=-1; }; |
168 |
|
Bool_t YGood(int ip){ return GetClusterY_ID(ip)!=-1; }; |
169 |
|
void ResetXGood(int ip){ xgood[ip]=0; }; |
170 |
|
void ResetYGood(int ip){ ygood[ip]=0; }; |
171 |
|
void SetXGood(int ip, int clid, int is); |
172 |
|
void SetYGood(int ip, int clid, int is); |
173 |
|
|
174 |
|
Bool_t BadClusterX(int ip){ return IsBad(ip,0); }; |
175 |
|
Bool_t BadClusterY(int ip){ return IsBad(ip,1); }; |
176 |
|
|
177 |
|
Bool_t SaturatedClusterX(int ip){ return IsSaturated(ip,0); }; |
178 |
|
Bool_t SaturatedClusterY(int ip){ return IsSaturated(ip,1); }; |
179 |
|
|
|
Int_t GetClusterX_ID(int ip){return xgood[ip];}; |
|
|
Int_t GetClusterY_ID(int ip){return ygood[ip];}; |
|
|
|
|
180 |
TrkTrack* GetTrkTrack(){return this;}; |
TrkTrack* GetTrkTrack(){return this;}; |
181 |
|
|
182 |
friend class TrkLevel2; |
friend class TrkLevel2; |
183 |
|
|
184 |
ClassDef(TrkTrack,2); |
ClassDef(TrkTrack,3); |
185 |
|
|
186 |
}; |
}; |
187 |
/** |
/** |
196 |
|
|
197 |
public: |
public: |
198 |
|
|
|
TRef cls; |
|
|
|
|
199 |
int plane; ///<plane |
int plane; ///<plane |
200 |
float coord[2]; ///<coordinate (on sensor 1 and 2) |
float coord[2]; ///<coordinate (on sensor 1 and 2) |
201 |
float sgnl; ///<cluster signal in MIP |
float sgnl; ///<cluster signal in MIP (<0 if saturated) |
202 |
|
|
203 |
TrkSinglet(); |
TrkSinglet(); |
204 |
TrkSinglet(const TrkSinglet&); |
TrkSinglet(const TrkSinglet&); |
208 |
void Clear(); |
void Clear(); |
209 |
void Clear(Option_t *option){Clear();}; |
void Clear(Option_t *option){Clear();}; |
210 |
void Delete(){Clear();}; |
void Delete(){Clear();}; |
211 |
|
Float_t GetSignal(){return fabs(sgnl);} |
212 |
|
Bool_t IsSaturated(){return (sgnl<0); }; |
213 |
|
|
|
TrkCluster *GetCluster(){TrkCluster *pt = (TrkCluster*)cls.GetObject(); return pt;}; |
|
|
|
|
214 |
friend class TrkLevel2; |
friend class TrkLevel2; |
215 |
|
|
216 |
ClassDef(TrkSinglet,2); |
ClassDef(TrkSinglet,3); |
217 |
|
|
218 |
}; |
}; |
219 |
|
|
235 |
public: |
public: |
236 |
|
|
237 |
Int_t good[12]; ///< event status |
Int_t good[12]; ///< event status |
238 |
|
UInt_t VKmask[12]; ///< Viking-chip mask |
239 |
|
UInt_t VKflag[12]; ///< Viking-chip flag |
240 |
|
|
241 |
TClonesArray *Track; ///< fitted tracks |
TClonesArray *Track; ///< fitted tracks |
242 |
TClonesArray *SingletX; ///< x singlets |
TClonesArray *SingletX; ///< x singlets |
262 |
void SetFromLevel2Struct() { SetFromLevel2Struct(&level2event_); }; |
void SetFromLevel2Struct() { SetFromLevel2Struct(&level2event_); }; |
263 |
void GetLevel2Struct(cTrkLevel2 *) const; |
void GetLevel2Struct(cTrkLevel2 *) const; |
264 |
void LoadField(TString); |
void LoadField(TString); |
265 |
float GetBX(float*); |
float GetBX(float* v){return TrkParams::GetBX(v);};///< Bx (kGauss) |
266 |
float GetBY(float*); |
float GetBY(float* v){return TrkParams::GetBY(v);};///< By (kGauss) |
267 |
float GetBZ(float*); |
float GetBZ(float* v){return TrkParams::GetBZ(v);};///< Bz (kGauss) |
268 |
Float_t GetZTrk(Int_t); |
Float_t GetZTrk(Int_t); |
269 |
Float_t GetXTrkLeft(){return XTRKL;}; |
Float_t GetXTrkLeft(){return XTRKL;}; |
270 |
Float_t GetXTrkRight(){return XTRKR;}; |
Float_t GetXTrkRight(){return XTRKR;}; |
271 |
Float_t GetYTrkLeft(){return YTRKL;}; |
Float_t GetYTrkLeft(){return YTRKL;}; |
272 |
Float_t GetYTrkRight(){return YTRKR;}; |
Float_t GetYTrkRight(){return YTRKR;}; |
273 |
|
|
274 |
|
Bool_t IsMaskedVK(int,int); |
275 |
|
Bool_t GetVKMask(int,int); |
276 |
|
Bool_t GetVKFlag(int,int); |
277 |
|
|
278 |
TrkSinglet *GetSingletX(int); |
TrkSinglet *GetSingletX(int); |
279 |
TrkSinglet *GetSingletY(int); |
TrkSinglet *GetSingletY(int); |
280 |
|
|
281 |
TrkTrack *GetStoredTrack(int i); |
TrkTrack *GetStoredTrack(int i); |
282 |
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 |
283 |
// TClonesArray *GetTracks_Chi2Sorted(); |
|
|
// TClonesArray *GetTracks_NFitSorted(); |
|
|
// TClonesArray *GetTracks(); |
|
284 |
TRefArray *GetTracks_NFitSorted(); |
TRefArray *GetTracks_NFitSorted(); |
285 |
TRefArray *GetTracks(){return this->GetTracks_NFitSorted();}; |
TRefArray *GetTracks(){return this->GetTracks_NFitSorted();}; |
286 |
|
|
|
// int GetNTracks(){return this->GetTracks()->GetEntries();} |
|
287 |
Int_t GetNTracks(); |
Int_t GetNTracks(); |
288 |
TrkTrack* GetTrack(int i); |
TrkTrack* GetTrack(int i); |
289 |
TrkTrack* GetTrackImage(int i); |
TrkTrack* GetTrackImage(int i); |
291 |
TrkLevel2* GetTrkLevel2(){return this;} |
TrkLevel2* GetTrkLevel2(){return this;} |
292 |
TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array |
TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array |
293 |
|
|
294 |
ClassDef(TrkLevel2,2); |
ClassDef(TrkLevel2,3); |
295 |
|
|
296 |
}; |
}; |
297 |
|
|