/[PAMELA software]/DarthVader/TrackerLevel2/inc/TrkLevel2.h
ViewVC logotype

Contents of /DarthVader/TrackerLevel2/inc/TrkLevel2.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (show annotations) (download)
Fri Apr 27 10:39:57 2007 UTC (17 years, 7 months ago) by pam-fi
Branch: MAIN
CVS Tags: v3r04, v3r03
Changes since 1.23: +49 -40 lines
File MIME type: text/plain
v3r00: new hough parameters, new variables, and other things...

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 <TRefArray.h>
12 #include <TRef.h>
13
14 #include <TrkParams.h>
15 #include <TrkLevel1.h>
16
17 // z-coordinate of track state-vector reference-plane
18 #define ZINI 23.5
19 // (mechanical) z-coordinate of the tracker planes
20 #define ZTRK6 -22.23
21 #define ZTRK5 -13.32
22 #define ZTRK4 -4.42
23 #define ZTRK3 4.48
24 #define ZTRK2 13.38
25 #define ZTRK1 22.28
26 // (mechanical) x/y-coordinates of magnet cavity
27 #define XTRKL -8.1
28 #define XTRKR 8.1
29 #define YTRKL -6.6
30 #define YTRKR 6.6
31
32 /**
33 * \brief Class to describe, by points, a particle trajectory in the apparatus.
34 *
35 * The idea is to create it by integrating the equations of motion, given the
36 * track state vector and the z coordinates where to evaluate track position.
37 */
38 // ==================================================================
39 class Trajectory : public TObject{
40 private:
41
42 public:
43
44 int npoint; ///< number of evaluated points along the trajectory
45 float* x; ///< x coordinates
46 float* y; ///< y coordinates
47 float* z; ///< z coordinates
48 float* thx; ///< x projected angle
49 float* thy; ///< y projected angle
50 float* tl; ///< track length
51
52 Trajectory();
53 Trajectory(int n);
54 Trajectory(int n, float* pz);
55 ~Trajectory(){Delete();};
56 void Dump();
57 void Delete();
58
59 int DoTrack2(float* al);
60 float GetLength(){float l=0; for(int i=0; i<npoint;i++)l=l+tl[i]; return l;};
61 float GetLength(int,int);
62
63 ClassDef(Trajectory,2);
64
65 };
66 /**
67 * \brief Class to describe fitted tracks.
68 *
69 * A track is defined by the measured coordinates associated to it, the
70 * track status vector, plus other quantities.
71 * 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 {
83
84 private:
85
86 int seqno; ///<stored track sequential number
87 int image; ///<sequential number of track-image
88
89 public:
90
91 float al[5]; ///<TRACK STATE VECTOR
92 float coval[5][5]; ///<covariance matrix
93 int xgood[6]; ///<cluster flag for x-view (0 = view not included in the fit)
94 int ygood[6]; ///<cluster flag for y-view (0 = view not included in the fit)
95 float xm[6]; ///<measured x coordinates
96 float ym[6]; ///<measured y coordinates
97 float zm[6]; ///<measured z coordinates
98 float resx[6]; ///<spatial resolution on X view
99 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
103 int nstep; ///<n. step
104 float xv[6]; ///<calculated x coordinates
105 float yv[6]; ///<calculated y coordinates
106 float zv[6]; ///<calculated z coordinates
107 float axv[6]; ///<calculated angles (deg) on x view
108 float ayv[6]; ///<calculated angles (deg) on y view
109 float dedx_x[6]; ///<dE/dx in MIP (<0 if saturated)
110 float dedx_y[6]; ///<dE/dx in MIP (<0 if saturated)
111
112 TrkTrack();
113 TrkTrack(const TrkTrack&);
114
115 ~TrkTrack(){ Delete(); };
116
117 void Dump();
118 void Clear();
119 void Clear(Option_t *option){Clear();};
120 void Delete();
121 void Copy(TrkTrack&);
122 // void Set();
123
124 Int_t GetSeqNo(){return seqno;} ///< Returns the track sequential number
125 Int_t GetImageSeqNo(){return image;} ///< Returns the track image sequential number
126 Bool_t HasImage(){return !(image==-1);} ///< Returns true if the track has an image
127 int DoTrack(Trajectory* t); ///< Evaluates the trajectory in the apparatus.
128 int DoTrack2(Trajectory* t); ///< Evaluates the trajectory in the apparatus.
129 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+=(Int_t)XGood(i); return n;};
131 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();};
133 Float_t GetRigidity();
134 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();
140 Float_t GetDEDX(int);
141 Float_t GetDEDX(int,int);
142 Int_t GetLeverArmX();
143 Int_t GetLeverArmY();
144
145 void SetMeasure(double *xmeas, double *ymeas, double *zmeas);
146 void SetResolution(double *rx, double *ry);
147 void SetGood(int *xg, int *yg);
148 void LoadField(TString s);
149 void Fit(double pfixed, int& fail, int iprint);
150 void FitReset();
151 void SetTrackingMode(int trackmode);
152 void SetPrecisionFactor(double fact);
153 void SetStepMin(int istepmin);
154
155 void FillMiniStruct(cMini2track&);
156 void SetFromMiniStruct(cMini2track*);
157
158 Int_t GetClusterX_ID(int ip);
159 Int_t GetClusterY_ID(int ip);
160 Int_t GetLadder(int ip);
161 Int_t GetSensor(int ip);
162 Bool_t XGood(int ip){ return GetClusterX_ID(ip)!=-1; };
163 Bool_t YGood(int ip){ return GetClusterY_ID(ip)!=-1; };
164
165 Bool_t BadClusterX(int ip){ return IsBad(ip,0); };
166 Bool_t BadClusterY(int ip){ return IsBad(ip,1); };
167
168 Bool_t SaturatedClusterX(int ip){ return IsSaturated(ip,0); };
169 Bool_t SaturatedClusterY(int ip){ return IsSaturated(ip,1); };
170
171 TrkTrack* GetTrkTrack(){return this;};
172
173 friend class TrkLevel2;
174
175 ClassDef(TrkTrack,3);
176
177 };
178 /**
179 * \brief Class to describe single clusters ("singlets").
180 *
181 * Single clusters are clusters not associated to any track.
182 */
183 class TrkSinglet : public TObject {
184
185 private:
186
187
188 public:
189
190 int plane; ///<plane
191 float coord[2]; ///<coordinate (on sensor 1 and 2)
192 float sgnl; ///<cluster signal in MIP (<0 if saturated)
193
194 TrkSinglet();
195 TrkSinglet(const TrkSinglet&);
196 ~TrkSinglet(){Delete();};
197
198 void Dump();
199 void Clear();
200 void Clear(Option_t *option){Clear();};
201 void Delete(){Clear();};
202 Float_t GetSignal(){return fabs(sgnl);}
203 Bool_t IsSaturated(){return (sgnl<0); };
204
205 friend class TrkLevel2;
206
207 ClassDef(TrkSinglet,3);
208
209 };
210
211 /**
212 * \brief Class to describe tracker LEVEL2 data.
213 *
214 * A tracker events is defined by some general variables, plus the collection of all the fitted tracks and all
215 * single clusters on X and Y views.
216 * Tracks and single clusters ("singlets") are described by the classes TrkTrack and TrkSinglet respectivelly.
217 *
218 * Each track may have an "image", due to the ambiguity on the Y view, which is stored also.
219 * Thus, the number of stored tracks ( ntrk() ) differs from the number of "physical" tracks ( GetNTracks() ).
220 * Proper methods allow to sort tracks and select the physical ones ( GetTracks() ).
221 */
222 class TrkLevel2 : public TObject {
223
224 private:
225
226 public:
227
228 Int_t good[12]; ///< event status
229 UInt_t VKmask[12]; ///< Viking-chip mask
230 UInt_t VKflag[12]; ///< Viking-chip flag
231
232 TClonesArray *Track; ///< fitted tracks
233 TClonesArray *SingletX; ///< x singlets
234 TClonesArray *SingletY; ///< y singlets
235
236 TrkLevel2();
237 // TrkLevel2(cTrkLevel2 *);
238 ~TrkLevel2(){Delete();};
239
240 void Clear();
241 void Clear(Option_t *option){Clear();};
242 void Delete();
243 void Set();
244
245 int ntrk() {return Track->GetEntries();} ///< number of stored track
246 int nclsx(){return SingletX->GetEntries();} ///< number of x singlets
247 int nclsy(){return SingletY->GetEntries();} ///< number of y singlets
248
249 void Dump();
250 void SetFromLevel2Struct(cTrkLevel2 *, TrkLevel1 *);
251 void SetFromLevel2Struct(cTrkLevel2 *s2){ SetFromLevel2Struct(s2, NULL); };
252 void SetFromLevel2Struct(TrkLevel1 *l1) { SetFromLevel2Struct(&level2event_, l1); };
253 void SetFromLevel2Struct() { SetFromLevel2Struct(&level2event_); };
254 void GetLevel2Struct(cTrkLevel2 *) const;
255 void LoadField(TString);
256 float GetBX(float*);
257 float GetBY(float*);
258 float GetBZ(float*);
259 Float_t GetZTrk(Int_t);
260 Float_t GetXTrkLeft(){return XTRKL;};
261 Float_t GetXTrkRight(){return XTRKR;};
262 Float_t GetYTrkLeft(){return YTRKL;};
263 Float_t GetYTrkRight(){return YTRKR;};
264
265 Bool_t IsMaskedVK(int,int);
266 Bool_t GetVKMask(int,int);
267 Bool_t GetVKFlag(int,int);
268
269 TrkSinglet *GetSingletX(int);
270 TrkSinglet *GetSingletY(int);
271
272 TrkTrack *GetStoredTrack(int i);
273 Int_t GetSeqNo(Int_t i) {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number
274
275 TRefArray *GetTracks_NFitSorted();
276 TRefArray *GetTracks(){return this->GetTracks_NFitSorted();};
277
278 Int_t GetNTracks();
279 TrkTrack* GetTrack(int i);
280 TrkTrack* GetTrackImage(int i);
281
282 TrkLevel2* GetTrkLevel2(){return this;}
283 TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array
284
285 ClassDef(TrkLevel2,3);
286
287 };
288
289 #endif

  ViewVC Help
Powered by ViewVC 1.1.23