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