/[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.6 - (show annotations) (download)
Fri Jul 21 11:03:14 2006 UTC (18 years, 4 months ago) by pam-fi
Branch: MAIN
CVS Tags: v1r01
Changes since 1.5: +12 -11 lines
File MIME type: text/plain
modified for C3PO

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

  ViewVC Help
Powered by ViewVC 1.1.23