8 |
#include <TObject.h> |
#include <TObject.h> |
9 |
#include <TObjArray.h> |
#include <TObjArray.h> |
10 |
#include <TClonesArray.h> |
#include <TClonesArray.h> |
11 |
|
#include <TRefArray.h> |
12 |
|
#include <TRef.h> |
13 |
|
|
14 |
#include <TrkStruct.h> |
#include <TrkStruct.h> |
15 |
|
#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 |
19 |
// upper and lower (mechanical) z-coordinate of the tracker |
// upper and lower (mechanical) z-coordinate of the tracker |
20 |
#define ZTRKUP 22.29 |
//#define ZTRKUP 22.29 |
21 |
#define ZTRKDW -22.22 |
//#define ZTRKDW -22.22 |
22 |
|
// (mechanical) z-coordinate of the tracker planes |
23 |
|
#define ZTRK6 -22.23 |
24 |
|
#define ZTRK5 -13.32 |
25 |
|
#define ZTRK4 -4.42 |
26 |
|
#define ZTRK3 4.48 |
27 |
|
#define ZTRK2 13.38 |
28 |
|
#define ZTRK1 22.28 |
29 |
|
// (mechanical) x/y-coordinates of magnet cavity |
30 |
|
#define XTRKL -8.1 |
31 |
|
#define XTRKR 8.1 |
32 |
|
#define YTRKL -6.6 |
33 |
|
#define YTRKR 6.6 |
34 |
|
|
35 |
/** |
/** |
36 |
* \brief Class to describe, by points, a particle trajectory in the apparatus. |
* \brief Class to describe, by points, a particle trajectory in the apparatus. |
60 |
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;}; |
61 |
float GetLength(int,int); |
float GetLength(int,int); |
62 |
|
|
63 |
ClassDef(Trajectory,1); |
ClassDef(Trajectory,2); |
64 |
|
|
65 |
}; |
}; |
66 |
/** |
/** |
75 |
|
|
76 |
private: |
private: |
77 |
|
|
78 |
|
int seqno; ///<stored track sequential number |
79 |
|
int image; ///<sequential number of track-image |
80 |
|
|
81 |
|
|
82 |
public: |
public: |
83 |
|
|
84 |
|
// TRef clx[6]; |
85 |
|
// TRef cly[6]; |
86 |
|
TRefArray *clx; |
87 |
|
TRefArray *cly; |
88 |
|
|
89 |
float al[5]; ///<TRACK STATE VECTOR |
float al[5]; ///<TRACK STATE VECTOR |
90 |
float coval[5][5]; ///<covariance matrix |
float coval[5][5]; ///<covariance matrix |
91 |
int xgood[6]; ///<mask of included x planes |
int xgood[6]; ///<mask of included x planes |
96 |
float resx[6]; ///<spatial resolution on X view |
float resx[6]; ///<spatial resolution on X view |
97 |
float resy[6]; ///<spatial resolution on y view |
float resy[6]; ///<spatial resolution on y view |
98 |
float chi2; ///<chi2 |
float chi2; ///<chi2 |
99 |
float xv[6]; ///<calculated x coordinates |
int nstep; ///<n. step |
100 |
|
float xv[6]; ///<calculated x coordinates |
101 |
float yv[6]; ///<calculated y coordinates |
float yv[6]; ///<calculated y coordinates |
102 |
float zv[6]; ///<calculated z coordinates |
float zv[6]; ///<calculated z coordinates |
103 |
float axv[6]; ///<calculated angles (deg) on x view |
float axv[6]; ///<calculated angles (deg) on x view |
104 |
float ayv[6]; ///<calculated angles (deg) on y view |
float ayv[6]; ///<calculated angles (deg) on y view |
105 |
float dedx_x[6]; ///<signal in MIP (scaled to 300 micrometer) |
float dedx_x[6]; ///<signal in MIP (scaled to 300 micrometer) |
106 |
float dedx_y[6]; ///<signal in MIP (scaled to 300 micrometer) |
float dedx_y[6]; ///<signal in MIP (scaled to 300 micrometer) |
107 |
int image; ///<flag to tag track-images |
|
108 |
|
|
109 |
TrkTrack(); |
TrkTrack(); |
110 |
TrkTrack(const TrkTrack&); |
TrkTrack(const TrkTrack&); |
111 |
|
|
112 |
|
~TrkTrack(){Delete();}; |
113 |
|
|
114 |
void Dump(); |
void Dump(); |
115 |
|
void Clear(); |
116 |
|
void Delete(); |
117 |
|
|
118 |
|
Int_t GetSeqNo(){return seqno;} ///< Returns the track sequential number |
119 |
|
Int_t GetImageSeqNo(){return image;} ///< Returns the track image sequential number |
120 |
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 |
121 |
int DoTrack(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
int DoTrack(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
122 |
int DoTrack2(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
int DoTrack2(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
123 |
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. |
124 |
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+=xgood[i]; return n;}; |
125 |
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+=ygood[i]; return n;}; |
126 |
|
Int_t GetNtot(){return GetNX()+GetNY();}; |
127 |
Float_t GetRigidity(); |
Float_t GetRigidity(); |
128 |
Float_t GetDeflection(); |
Float_t GetDeflection(); |
129 |
Float_t GetDEDX(); |
Float_t GetDEDX(); |
130 |
|
Float_t GetDEDX(Int_t ip){if( !(xgood[ip]+ygood[ip]) ) return 0; return (dedx_x[ip]+dedx_y[ip])/(xgood[ip]+ygood[ip]);}; |
131 |
|
// sono un'imbecille... assegno xm e ym anche quando si tratta di un singolo |
132 |
|
// non posso quindi usare xm e ym per dire se una vista e` inclusa nel fit o no |
133 |
|
/* Bool_t XGood(int ip){ return xm[ip] != -100.;}; |
134 |
|
Bool_t YGood(int ip){ return ym[ip] != -100.;};*/ |
135 |
|
Bool_t XGood(int ip){ return xgood[ip]==1;}; |
136 |
|
Bool_t YGood(int ip){ return ygood[ip]==1;}; |
137 |
|
|
138 |
|
TrkCluster *GetClusterX(int ip){TrkCluster *pt = (TrkCluster*)(clx->At(ip)); return pt;}; |
139 |
|
TrkCluster *GetClusterY(int ip){TrkCluster *pt = (TrkCluster*)(cly->At(ip)); return pt;}; |
140 |
|
|
141 |
TrkTrack* GetTrkTrack(){return this;}; |
TrkTrack* GetTrkTrack(){return this;}; |
142 |
|
|
143 |
ClassDef(TrkTrack,1); |
friend class TrkLevel2; |
144 |
|
|
145 |
|
ClassDef(TrkTrack,2); |
146 |
|
|
147 |
}; |
}; |
148 |
/** |
/** |
153 |
class TrkSinglet : public TObject { |
class TrkSinglet : public TObject { |
154 |
|
|
155 |
private: |
private: |
156 |
|
|
157 |
|
|
158 |
public: |
public: |
159 |
|
|
160 |
|
TRef cls; |
161 |
|
|
162 |
int plane; ///<plane |
int plane; ///<plane |
163 |
float coord[2]; ///<coordinate (on sensor 1 and 2) |
float coord[2]; ///<coordinate (on sensor 1 and 2) |
167 |
TrkSinglet(const TrkSinglet&); |
TrkSinglet(const TrkSinglet&); |
168 |
|
|
169 |
void Dump(); |
void Dump(); |
170 |
|
|
171 |
|
TrkCluster *GetCluster(){TrkCluster *pt = (TrkCluster*)cls.GetObject(); return pt;}; |
172 |
|
|
173 |
ClassDef(TrkSinglet,1); |
friend class TrkLevel2; |
174 |
|
|
175 |
|
ClassDef(TrkSinglet,2); |
176 |
|
|
177 |
}; |
}; |
178 |
|
|
190 |
class TrkLevel2 : public TObject { |
class TrkLevel2 : public TObject { |
191 |
|
|
192 |
private: |
private: |
193 |
|
|
194 |
|
// TRefArray *PhysicalTrack; ///< physical tracks (no image) - |
195 |
|
|
196 |
public: |
public: |
197 |
|
|
198 |
|
Int_t good[12]; ///< event status |
199 |
|
// Int_t good2; |
200 |
Int_t good2; |
// Int_t crc[12]; |
|
Int_t crc[12]; |
|
201 |
|
|
202 |
TClonesArray *Track; ///< fitted tracks |
TClonesArray *Track; ///< fitted tracks |
203 |
TClonesArray *SingletX; ///< x singlets |
TClonesArray *SingletX; ///< x singlets |
205 |
|
|
206 |
TrkLevel2(); |
TrkLevel2(); |
207 |
// TrkLevel2(cTrkLevel2 *); |
// TrkLevel2(cTrkLevel2 *); |
208 |
|
~TrkLevel2(){Delete();}; |
209 |
int ntrk(){return Track->GetEntries();} ///< number of stored track |
|
210 |
|
void Clear(); |
211 |
|
void Delete(); |
212 |
|
|
213 |
|
int ntrk() {return Track->GetEntries();} ///< number of stored track |
214 |
int nclsx(){return SingletX->GetEntries();} ///< number of x singlets |
int nclsx(){return SingletX->GetEntries();} ///< number of x singlets |
215 |
int nclsy(){return SingletY->GetEntries();} ///< number of y singlets |
int nclsy(){return SingletY->GetEntries();} ///< number of y singlets |
216 |
|
|
217 |
void Dump(); |
void Dump(); |
218 |
void FillCommonVar(cTrkLevel2 *); |
void SetFromLevel2Struct(cTrkLevel2 *); |
219 |
void Clear(); |
void SetFromLevel2Struct(cTrkLevel2 *, TrkLevel1 *); |
220 |
void LoadField(TString); |
void GetLevel2Struct(cTrkLevel2 *) const; |
221 |
|
void LoadField(TString); |
222 |
TrkTrack *GetStoredTrack(int i); |
Float_t GetZTrk(Int_t); |
223 |
TClonesArray *GetTracks(); |
Float_t GetXTrkLeft(){return XTRKL;}; |
224 |
|
Float_t GetXTrkRight(){return XTRKR;}; |
225 |
int GetNTracks(){return this->GetTracks()->GetEntries();} |
Float_t GetYTrkLeft(){return YTRKL;}; |
226 |
TrkTrack* GetTrack(int i); |
Float_t GetYTrkRight(){return YTRKR;}; |
227 |
|
|
228 |
|
TrkSinglet *GetSingletX(int); |
229 |
|
TrkSinglet *GetSingletY(int); |
230 |
|
|
231 |
|
TrkTrack *GetStoredTrack(int i); |
232 |
|
Int_t GetSeqNo(Int_t i) {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number |
233 |
|
// TClonesArray *GetTracks_Chi2Sorted(); |
234 |
|
// TClonesArray *GetTracks_NFitSorted(); |
235 |
|
// TClonesArray *GetTracks(); |
236 |
|
TRefArray *GetTracks_NFitSorted(); |
237 |
|
TRefArray *GetTracks(){return this->GetTracks_NFitSorted();}; |
238 |
|
|
239 |
|
// int GetNTracks(){return this->GetTracks()->GetEntries();} |
240 |
|
Int_t GetNTracks(); |
241 |
|
TrkTrack* GetTrack(int i); |
242 |
TrkTrack* GetTrackImage(int i); |
TrkTrack* GetTrackImage(int i); |
243 |
|
|
244 |
TrkLevel2* GetTrkLevel2(){return this;} |
TrkLevel2* GetTrkLevel2(){return this;} |
245 |
|
TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array |
246 |
ClassDef(TrkLevel2,1); |
|
247 |
|
ClassDef(TrkLevel2,2); |
248 |
|
|
249 |
}; |
}; |
250 |
|
|
|
|
|
|
|
|
|
|
|
251 |
#endif |
#endif |