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 |
|
|
#include <TrkStruct.h> |
12 |
|
|
|
13 |
pam-fi |
1.2 |
// z-coordinate of track state-vector reference-plane |
14 |
|
|
#define ZINI 23.5 |
15 |
|
|
// upper and lower (mechanical) z-coordinate of the tracker |
16 |
|
|
#define ZTRKUP 22.29 |
17 |
|
|
#define ZTRKDW -22.22 |
18 |
|
|
|
19 |
|
|
|
20 |
mocchiut |
1.1 |
/** |
21 |
|
|
* \brief Class to describe, by points, a particle trajectory in the apparatus. |
22 |
|
|
* |
23 |
|
|
* The idea is to create it by integrating the equations of motion, given the |
24 |
|
|
* track state vector and the z coordinates where to evaluate track position. |
25 |
|
|
*/ |
26 |
|
|
// ================================================================== |
27 |
|
|
class Trajectory : public TObject{ |
28 |
|
|
private: |
29 |
|
|
|
30 |
|
|
public: |
31 |
|
|
|
32 |
|
|
int npoint; ///< number of evaluated points along the trajectory |
33 |
|
|
float* x; ///< x coordinates |
34 |
|
|
float* y; ///< y coordinates |
35 |
|
|
float* z; ///< z coordinates |
36 |
pam-fi |
1.2 |
float* thx; ///< x projected angle |
37 |
|
|
float* thy; ///< y projected angle |
38 |
|
|
float* tl; ///< track length |
39 |
mocchiut |
1.1 |
|
40 |
pam-fi |
1.2 |
Trajectory(); |
41 |
mocchiut |
1.1 |
Trajectory(int n); |
42 |
|
|
Trajectory(int n, float* pz); |
43 |
|
|
void Dump(); |
44 |
|
|
|
45 |
pam-fi |
1.2 |
float GetLength(){float l=0; for(int i=0; i<npoint;i++)l=l+tl[i]; return l;}; |
46 |
|
|
float GetLength(int,int); |
47 |
|
|
|
48 |
mocchiut |
1.1 |
ClassDef(Trajectory,1); |
49 |
|
|
|
50 |
|
|
}; |
51 |
|
|
/** |
52 |
|
|
* \brief Class to describe fitted tracks. |
53 |
|
|
* |
54 |
|
|
* A track is defined by the measured coordinates associated to it, the |
55 |
|
|
* track status vector, plus other quantities. |
56 |
|
|
* A track may have an "image", due to the ambiguity in the y view. |
57 |
|
|
*/ |
58 |
|
|
// ================================================================== |
59 |
|
|
class TrkTrack : public TObject { |
60 |
|
|
|
61 |
|
|
private: |
62 |
|
|
|
63 |
|
|
public: |
64 |
|
|
|
65 |
|
|
float al[5]; ///<TRACK STATE VECTOR |
66 |
|
|
float coval[5][5]; ///<covariance matrix |
67 |
|
|
int xgood[6]; ///<mask of included x planes |
68 |
|
|
int ygood[6]; ///<mask of included y planes |
69 |
|
|
float xm[6]; ///<measured x coordinates |
70 |
|
|
float ym[6]; ///<measured y coordinates |
71 |
|
|
float zm[6]; ///<measured z coordinates |
72 |
|
|
float resx[6]; ///<spatial resolution on X view |
73 |
|
|
float resy[6]; ///<spatial resolution on y view |
74 |
|
|
float chi2; ///<chi2 |
75 |
|
|
float xv[6]; ///<calculated x coordinates |
76 |
|
|
float yv[6]; ///<calculated y coordinates |
77 |
|
|
float zv[6]; ///<calculated z coordinates |
78 |
|
|
float axv[6]; ///<calculated angles (deg) on x view |
79 |
|
|
float ayv[6]; ///<calculated angles (deg) on y view |
80 |
|
|
float dedx_x[6]; ///<signal in MIP (scaled to 300 micrometer) |
81 |
|
|
float dedx_y[6]; ///<signal in MIP (scaled to 300 micrometer) |
82 |
|
|
int image; ///<flag to tag track-images |
83 |
|
|
|
84 |
|
|
TrkTrack(); |
85 |
|
|
TrkTrack(const TrkTrack&); |
86 |
|
|
|
87 |
|
|
void Dump(); |
88 |
|
|
|
89 |
|
|
Bool_t HasImage(){return !(image==-1);} ///< Returns true if the track has an image |
90 |
pam-fi |
1.2 |
int DoTrack(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
91 |
|
|
int DoTrack2(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
92 |
|
|
float BdL(){return 0;}; ///< Evaluates the integral of B*dL along the track. |
93 |
mocchiut |
1.1 |
Int_t GetNX(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=xgood[i]; return n;}; |
94 |
|
|
Int_t GetNY(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=ygood[i]; return n;}; |
95 |
|
|
Float_t GetRigidity(); |
96 |
|
|
Float_t GetDeflection(); |
97 |
|
|
Float_t GetDEDX(); |
98 |
|
|
|
99 |
|
|
TrkTrack* GetTrkTrack(){return this;}; |
100 |
|
|
|
101 |
|
|
ClassDef(TrkTrack,1); |
102 |
|
|
|
103 |
|
|
}; |
104 |
|
|
/** |
105 |
|
|
* \brief Class to describe single clusters ("singlets"). |
106 |
|
|
* |
107 |
|
|
* Single clusters are clusters not associated to any track. |
108 |
|
|
*/ |
109 |
|
|
class TrkSinglet : public TObject { |
110 |
|
|
|
111 |
|
|
private: |
112 |
|
|
|
113 |
|
|
public: |
114 |
|
|
|
115 |
|
|
int plane; ///<plane |
116 |
|
|
float coord[2]; ///<coordinate (on sensor 1 and 2) |
117 |
|
|
float sgnl; ///<cluster signal in MIP |
118 |
|
|
|
119 |
|
|
TrkSinglet(); |
120 |
|
|
TrkSinglet(const TrkSinglet&); |
121 |
|
|
|
122 |
|
|
void Dump(); |
123 |
|
|
|
124 |
|
|
ClassDef(TrkSinglet,1); |
125 |
|
|
|
126 |
|
|
}; |
127 |
|
|
|
128 |
|
|
/** |
129 |
|
|
* \brief Class to describe tracker LEVEL2 data. |
130 |
|
|
* |
131 |
|
|
* A tracker events is defined by some general variables, plus the collection of all the fitted tracks and all |
132 |
|
|
* single clusters on X and Y views. |
133 |
|
|
* Tracks and single clusters ("singlets") are described by the classes TrkTrack and TrkSinglet respectivelly. |
134 |
|
|
* |
135 |
|
|
* Each track may have an "image", due to the ambiguity on the Y view, which is stored also. |
136 |
|
|
* Thus, the number of stored tracks ( ntrk() ) differs from the number of "physical" tracks ( GetNTracks() ). |
137 |
|
|
* Proper methods allow to sort tracks and select the physical ones ( GetTracks() ). |
138 |
|
|
*/ |
139 |
|
|
class TrkLevel2 : public TObject { |
140 |
|
|
|
141 |
|
|
private: |
142 |
|
|
|
143 |
|
|
public: |
144 |
|
|
|
145 |
|
|
|
146 |
|
|
|
147 |
|
|
Int_t good2; |
148 |
|
|
Int_t crc[12]; |
149 |
|
|
|
150 |
|
|
TClonesArray *Track; ///< fitted tracks |
151 |
|
|
TClonesArray *SingletX; ///< x singlets |
152 |
|
|
TClonesArray *SingletY; ///< y singlets |
153 |
|
|
|
154 |
|
|
TrkLevel2(); |
155 |
|
|
// TrkLevel2(cTrkLevel2 *); |
156 |
|
|
|
157 |
|
|
int ntrk(){return Track->GetEntries();} ///< number of stored track |
158 |
|
|
int nclsx(){return SingletX->GetEntries();} ///< number of x singlets |
159 |
|
|
int nclsy(){return SingletY->GetEntries();} ///< number of y singlets |
160 |
|
|
|
161 |
|
|
void Dump(); |
162 |
|
|
void FillCommonVar(cTrkLevel2 *); |
163 |
|
|
void Clear(); |
164 |
|
|
void LoadField(TString); |
165 |
|
|
|
166 |
|
|
TrkTrack *GetStoredTrack(int i); |
167 |
|
|
TClonesArray *GetTracks(); |
168 |
|
|
|
169 |
|
|
int GetNTracks(){return this->GetTracks()->GetEntries();} |
170 |
|
|
TrkTrack* GetTrack(int i); |
171 |
|
|
TrkTrack* GetTrackImage(int i); |
172 |
|
|
|
173 |
|
|
TrkLevel2* GetTrkLevel2(){return this;} |
174 |
|
|
|
175 |
|
|
ClassDef(TrkLevel2,1); |
176 |
|
|
|
177 |
|
|
}; |
178 |
|
|
|
179 |
|
|
|
180 |
|
|
|
181 |
|
|
|
182 |
|
|
#endif |