1 |
mocchiut |
1.1 |
/** |
2 |
|
|
* \file TrkLevel2.h |
3 |
|
|
* \author Elena Vannuccini |
4 |
|
|
*/ |
5 |
|
|
#ifndef trklevel2_h |
6 |
|
|
#define trklevel2_h |
7 |
|
|
|
8 |
|
|
#include <TObject.h> |
9 |
|
|
#include <TObjArray.h> |
10 |
|
|
#include <TClonesArray.h> |
11 |
pam-fi |
1.7 |
#include <TRefArray.h> |
12 |
pam-fi |
1.3 |
|
13 |
mocchiut |
1.1 |
#include <TrkStruct.h> |
14 |
|
|
|
15 |
pam-fi |
1.2 |
// z-coordinate of track state-vector reference-plane |
16 |
|
|
#define ZINI 23.5 |
17 |
|
|
// upper and lower (mechanical) z-coordinate of the tracker |
18 |
pam-fi |
1.5 |
//#define ZTRKUP 22.29 |
19 |
|
|
//#define ZTRKDW -22.22 |
20 |
|
|
// (mechanical) z-coordinate of the tracker planes |
21 |
|
|
#define ZTRK6 -22.23 |
22 |
|
|
#define ZTRK5 -13.32 |
23 |
|
|
#define ZTRK4 -4.42 |
24 |
|
|
#define ZTRK3 4.48 |
25 |
|
|
#define ZTRK2 13.38 |
26 |
|
|
#define ZTRK1 22.28 |
27 |
|
|
// (mechanical) x/y-coordinates of magnet cavity |
28 |
|
|
#define XTRKL -8.1 |
29 |
|
|
#define XTRKR 8.1 |
30 |
|
|
#define YTRKL -6.6 |
31 |
|
|
#define YTRKR 6.6 |
32 |
pam-fi |
1.2 |
|
33 |
mocchiut |
1.1 |
/** |
34 |
|
|
* \brief Class to describe, by points, a particle trajectory in the apparatus. |
35 |
|
|
* |
36 |
|
|
* The idea is to create it by integrating the equations of motion, given the |
37 |
|
|
* track state vector and the z coordinates where to evaluate track position. |
38 |
|
|
*/ |
39 |
|
|
// ================================================================== |
40 |
|
|
class Trajectory : public TObject{ |
41 |
|
|
private: |
42 |
|
|
|
43 |
|
|
public: |
44 |
|
|
|
45 |
|
|
int npoint; ///< number of evaluated points along the trajectory |
46 |
|
|
float* x; ///< x coordinates |
47 |
|
|
float* y; ///< y coordinates |
48 |
|
|
float* z; ///< z coordinates |
49 |
pam-fi |
1.2 |
float* thx; ///< x projected angle |
50 |
|
|
float* thy; ///< y projected angle |
51 |
|
|
float* tl; ///< track length |
52 |
mocchiut |
1.1 |
|
53 |
pam-fi |
1.2 |
Trajectory(); |
54 |
mocchiut |
1.1 |
Trajectory(int n); |
55 |
|
|
Trajectory(int n, float* pz); |
56 |
|
|
void Dump(); |
57 |
|
|
|
58 |
pam-fi |
1.2 |
float GetLength(){float l=0; for(int i=0; i<npoint;i++)l=l+tl[i]; return l;}; |
59 |
|
|
float GetLength(int,int); |
60 |
|
|
|
61 |
mocchiut |
1.1 |
ClassDef(Trajectory,1); |
62 |
|
|
|
63 |
|
|
}; |
64 |
|
|
/** |
65 |
|
|
* \brief Class to describe fitted tracks. |
66 |
|
|
* |
67 |
|
|
* A track is defined by the measured coordinates associated to it, the |
68 |
|
|
* track status vector, plus other quantities. |
69 |
|
|
* A track may have an "image", due to the ambiguity in the y view. |
70 |
|
|
*/ |
71 |
|
|
// ================================================================== |
72 |
|
|
class TrkTrack : public TObject { |
73 |
|
|
|
74 |
|
|
private: |
75 |
|
|
|
76 |
pam-fi |
1.3 |
int seqno; ///<stored track sequential number |
77 |
|
|
int image; ///<sequential number of track-image |
78 |
|
|
|
79 |
mocchiut |
1.1 |
public: |
80 |
|
|
|
81 |
pam-fi |
1.3 |
|
82 |
mocchiut |
1.1 |
float al[5]; ///<TRACK STATE VECTOR |
83 |
|
|
float coval[5][5]; ///<covariance matrix |
84 |
|
|
int xgood[6]; ///<mask of included x planes |
85 |
|
|
int ygood[6]; ///<mask of included y planes |
86 |
|
|
float xm[6]; ///<measured x coordinates |
87 |
|
|
float ym[6]; ///<measured y coordinates |
88 |
|
|
float zm[6]; ///<measured z coordinates |
89 |
|
|
float resx[6]; ///<spatial resolution on X view |
90 |
|
|
float resy[6]; ///<spatial resolution on y view |
91 |
|
|
float chi2; ///<chi2 |
92 |
|
|
float xv[6]; ///<calculated x coordinates |
93 |
|
|
float yv[6]; ///<calculated y coordinates |
94 |
|
|
float zv[6]; ///<calculated z coordinates |
95 |
|
|
float axv[6]; ///<calculated angles (deg) on x view |
96 |
|
|
float ayv[6]; ///<calculated angles (deg) on y view |
97 |
|
|
float dedx_x[6]; ///<signal in MIP (scaled to 300 micrometer) |
98 |
|
|
float dedx_y[6]; ///<signal in MIP (scaled to 300 micrometer) |
99 |
pam-fi |
1.3 |
|
100 |
mocchiut |
1.1 |
|
101 |
|
|
TrkTrack(); |
102 |
|
|
TrkTrack(const TrkTrack&); |
103 |
|
|
|
104 |
|
|
void Dump(); |
105 |
|
|
|
106 |
pam-fi |
1.3 |
Int_t GetSeqNo(){return seqno;} ///< Returns the track sequential number |
107 |
|
|
Int_t GetImageSeqNo(){return image;} ///< Returns the track image sequential number |
108 |
mocchiut |
1.1 |
Bool_t HasImage(){return !(image==-1);} ///< Returns true if the track has an image |
109 |
pam-fi |
1.2 |
int DoTrack(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
110 |
|
|
int DoTrack2(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
111 |
|
|
float BdL(){return 0;}; ///< Evaluates the integral of B*dL along the track. |
112 |
mocchiut |
1.1 |
Int_t GetNX(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=xgood[i]; return n;}; |
113 |
|
|
Int_t GetNY(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=ygood[i]; return n;}; |
114 |
pam-fi |
1.3 |
Int_t GetNtot(){return GetNX()+GetNY();}; |
115 |
mocchiut |
1.1 |
Float_t GetRigidity(); |
116 |
|
|
Float_t GetDeflection(); |
117 |
|
|
Float_t GetDEDX(); |
118 |
|
|
|
119 |
|
|
TrkTrack* GetTrkTrack(){return this;}; |
120 |
|
|
|
121 |
pam-fi |
1.3 |
friend class TrkLevel2; |
122 |
|
|
|
123 |
mocchiut |
1.1 |
ClassDef(TrkTrack,1); |
124 |
|
|
|
125 |
|
|
}; |
126 |
|
|
/** |
127 |
|
|
* \brief Class to describe single clusters ("singlets"). |
128 |
|
|
* |
129 |
|
|
* Single clusters are clusters not associated to any track. |
130 |
|
|
*/ |
131 |
|
|
class TrkSinglet : public TObject { |
132 |
|
|
|
133 |
|
|
private: |
134 |
|
|
|
135 |
|
|
public: |
136 |
|
|
|
137 |
|
|
int plane; ///<plane |
138 |
|
|
float coord[2]; ///<coordinate (on sensor 1 and 2) |
139 |
|
|
float sgnl; ///<cluster signal in MIP |
140 |
|
|
|
141 |
|
|
TrkSinglet(); |
142 |
|
|
TrkSinglet(const TrkSinglet&); |
143 |
|
|
|
144 |
|
|
void Dump(); |
145 |
|
|
|
146 |
pam-fi |
1.3 |
friend class TrkLevel2; |
147 |
|
|
|
148 |
mocchiut |
1.1 |
ClassDef(TrkSinglet,1); |
149 |
|
|
|
150 |
|
|
}; |
151 |
|
|
|
152 |
|
|
/** |
153 |
|
|
* \brief Class to describe tracker LEVEL2 data. |
154 |
|
|
* |
155 |
|
|
* A tracker events is defined by some general variables, plus the collection of all the fitted tracks and all |
156 |
|
|
* single clusters on X and Y views. |
157 |
|
|
* Tracks and single clusters ("singlets") are described by the classes TrkTrack and TrkSinglet respectivelly. |
158 |
|
|
* |
159 |
|
|
* Each track may have an "image", due to the ambiguity on the Y view, which is stored also. |
160 |
|
|
* Thus, the number of stored tracks ( ntrk() ) differs from the number of "physical" tracks ( GetNTracks() ). |
161 |
|
|
* Proper methods allow to sort tracks and select the physical ones ( GetTracks() ). |
162 |
|
|
*/ |
163 |
|
|
class TrkLevel2 : public TObject { |
164 |
|
|
|
165 |
|
|
private: |
166 |
pam-fi |
1.5 |
|
167 |
|
|
// TRefArray *PhysicalTrack; ///< physical tracks (no image) - |
168 |
|
|
|
169 |
mocchiut |
1.1 |
public: |
170 |
|
|
|
171 |
|
|
Int_t good2; |
172 |
|
|
Int_t crc[12]; |
173 |
|
|
|
174 |
|
|
TClonesArray *Track; ///< fitted tracks |
175 |
|
|
TClonesArray *SingletX; ///< x singlets |
176 |
|
|
TClonesArray *SingletY; ///< y singlets |
177 |
|
|
|
178 |
|
|
TrkLevel2(); |
179 |
|
|
// TrkLevel2(cTrkLevel2 *); |
180 |
|
|
|
181 |
pam-fi |
1.5 |
int ntrk() {return Track->GetEntries();} ///< number of stored track |
182 |
mocchiut |
1.1 |
int nclsx(){return SingletX->GetEntries();} ///< number of x singlets |
183 |
|
|
int nclsy(){return SingletY->GetEntries();} ///< number of y singlets |
184 |
|
|
|
185 |
|
|
void Dump(); |
186 |
pam-fi |
1.6 |
void SetFromLevel2Struct(cTrkLevel2 *); |
187 |
|
|
void GetLevel2Struct(cTrkLevel2 *) const; |
188 |
mocchiut |
1.1 |
void Clear(); |
189 |
pam-fi |
1.3 |
void LoadField(TString); |
190 |
pam-fi |
1.6 |
Float_t GetZTrk(Int_t); |
191 |
|
|
Float_t GetXTrkLeft(){return XTRKL;}; |
192 |
|
|
Float_t GetXTrkRight(){return XTRKR;}; |
193 |
|
|
Float_t GetYTrkLeft(){return YTRKL;}; |
194 |
|
|
Float_t GetYTrkRight(){return YTRKR;}; |
195 |
|
|
|
196 |
|
|
TrkSinglet *GetSingletX(int); |
197 |
|
|
TrkSinglet *GetSingletY(int); |
198 |
|
|
|
199 |
|
|
TrkTrack *GetStoredTrack(int i); |
200 |
pam-fi |
1.3 |
Int_t GetSeqNo(Int_t i) {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number |
201 |
pam-fi |
1.5 |
// TClonesArray *GetTracks_Chi2Sorted(); |
202 |
pam-fi |
1.7 |
// TClonesArray *GetTracks_NFitSorted(); |
203 |
|
|
// TClonesArray *GetTracks(); |
204 |
|
|
TRefArray *GetTracks_NFitSorted(); |
205 |
|
|
TRefArray *GetTracks(){return this->GetTracks_NFitSorted();}; |
206 |
mocchiut |
1.1 |
|
207 |
pam-fi |
1.4 |
// int GetNTracks(){return this->GetTracks()->GetEntries();} |
208 |
|
|
Int_t GetNTracks(); |
209 |
|
|
TrkTrack* GetTrack(int i); |
210 |
mocchiut |
1.1 |
TrkTrack* GetTrackImage(int i); |
211 |
|
|
|
212 |
pam-fi |
1.3 |
TrkLevel2* GetTrkLevel2(){return this;} |
213 |
|
|
TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array |
214 |
|
|
|
215 |
mocchiut |
1.1 |
ClassDef(TrkLevel2,1); |
216 |
|
|
|
217 |
|
|
}; |
218 |
|
|
|
219 |
|
|
|
220 |
|
|
|
221 |
|
|
#endif |