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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (hide annotations) (download)
Mon Feb 19 16:28:39 2007 UTC (17 years, 9 months ago) by pam-fi
Branch: MAIN
Changes since 1.18: +1 -0 lines
File MIME type: text/plain
added TRACKMOD parameter

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.8 #include <TRef.h>
13 pam-fi 1.3
14 pam-fi 1.18 //#include <TrkStruct.h>
15     #include <TrkParams.h>
16 pam-fi 1.8 #include <TrkLevel1.h>
17 mocchiut 1.1
18 pam-fi 1.2 // z-coordinate of track state-vector reference-plane
19     #define ZINI 23.5
20     // upper and lower (mechanical) z-coordinate of the tracker
21 pam-fi 1.5 //#define ZTRKUP 22.29
22     //#define ZTRKDW -22.22
23     // (mechanical) z-coordinate of the tracker planes
24     #define ZTRK6 -22.23
25     #define ZTRK5 -13.32
26     #define ZTRK4 -4.42
27     #define ZTRK3 4.48
28     #define ZTRK2 13.38
29     #define ZTRK1 22.28
30     // (mechanical) x/y-coordinates of magnet cavity
31     #define XTRKL -8.1
32     #define XTRKR 8.1
33     #define YTRKL -6.6
34     #define YTRKR 6.6
35 pam-fi 1.2
36 mocchiut 1.1 /**
37     * \brief Class to describe, by points, a particle trajectory in the apparatus.
38     *
39     * The idea is to create it by integrating the equations of motion, given the
40     * track state vector and the z coordinates where to evaluate track position.
41     */
42     // ==================================================================
43     class Trajectory : public TObject{
44     private:
45    
46     public:
47    
48     int npoint; ///< number of evaluated points along the trajectory
49     float* x; ///< x coordinates
50     float* y; ///< y coordinates
51     float* z; ///< z coordinates
52 pam-fi 1.2 float* thx; ///< x projected angle
53     float* thy; ///< y projected angle
54     float* tl; ///< track length
55 mocchiut 1.1
56 pam-fi 1.2 Trajectory();
57 mocchiut 1.1 Trajectory(int n);
58     Trajectory(int n, float* pz);
59 pam-fi 1.15 ~Trajectory(){Delete();};
60 mocchiut 1.1 void Dump();
61 pam-fi 1.15 void Delete();
62 mocchiut 1.1
63 pam-fi 1.13 int DoTrack2(float* al);
64 pam-fi 1.2 float GetLength(){float l=0; for(int i=0; i<npoint;i++)l=l+tl[i]; return l;};
65     float GetLength(int,int);
66    
67 pam-fi 1.9 ClassDef(Trajectory,2);
68 mocchiut 1.1
69     };
70     /**
71     * \brief Class to describe fitted tracks.
72     *
73     * A track is defined by the measured coordinates associated to it, the
74     * track status vector, plus other quantities.
75     * A track may have an "image", due to the ambiguity in the y view.
76     */
77     // ==================================================================
78     class TrkTrack : public TObject {
79    
80     private:
81    
82 pam-fi 1.3 int seqno; ///<stored track sequential number
83     int image; ///<sequential number of track-image
84    
85 pam-fi 1.8
86 mocchiut 1.1 public:
87    
88 pam-fi 1.12 TRefArray *clx;
89     TRefArray *cly;
90 pam-fi 1.3
91 mocchiut 1.1 float al[5]; ///<TRACK STATE VECTOR
92     float coval[5][5]; ///<covariance matrix
93     int xgood[6]; ///<mask of included x planes
94     int ygood[6]; ///<mask of included y planes
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 chi2; ///<chi2
101 pam-fi 1.12 int nstep; ///<n. step
102     float xv[6]; ///<calculated x coordinates
103 mocchiut 1.1 float yv[6]; ///<calculated y coordinates
104     float zv[6]; ///<calculated z coordinates
105     float axv[6]; ///<calculated angles (deg) on x view
106     float ayv[6]; ///<calculated angles (deg) on y view
107     float dedx_x[6]; ///<signal in MIP (scaled to 300 micrometer)
108     float dedx_y[6]; ///<signal in MIP (scaled to 300 micrometer)
109 pam-fi 1.3
110 mocchiut 1.1 TrkTrack();
111     TrkTrack(const TrkTrack&);
112    
113 pam-fi 1.15 ~TrkTrack(){ Delete(); };
114 pam-fi 1.10
115 mocchiut 1.1 void Dump();
116 pam-fi 1.12 void Clear();
117 pam-fi 1.15 void Clear(Option_t *option){Clear();};
118 pam-fi 1.12 void Delete();
119 pam-fi 1.15 void Copy(TrkTrack&);
120 pam-fi 1.16 // void Set();
121    
122 pam-fi 1.3 Int_t GetSeqNo(){return seqno;} ///< Returns the track sequential number
123     Int_t GetImageSeqNo(){return image;} ///< Returns the track image sequential number
124 mocchiut 1.1 Bool_t HasImage(){return !(image==-1);} ///< Returns true if the track has an image
125 pam-fi 1.2 int DoTrack(Trajectory* t); ///< Evaluates the trajectory in the apparatus.
126     int DoTrack2(Trajectory* t); ///< Evaluates the trajectory in the apparatus.
127     float BdL(){return 0;}; ///< Evaluates the integral of B*dL along the track.
128 mocchiut 1.1 Int_t GetNX(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=xgood[i]; return n;};
129     Int_t GetNY(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=ygood[i]; return n;};
130 pam-fi 1.3 Int_t GetNtot(){return GetNX()+GetNY();};
131 mocchiut 1.1 Float_t GetRigidity();
132     Float_t GetDeflection();
133     Float_t GetDEDX();
134 pam-fi 1.12 Float_t GetDEDX(Int_t ip){if( !(xgood[ip]+ygood[ip]) ) return 0; return (dedx_x[ip]+dedx_y[ip])/(xgood[ip]+ygood[ip]);};
135     // sono un'imbecille... assegno xm e ym anche quando si tratta di un singolo
136     // non posso quindi usare xm e ym per dire se una vista e` inclusa nel fit o no
137 pam-fi 1.9 /* Bool_t XGood(int ip){ return xm[ip] != -100.;};
138     Bool_t YGood(int ip){ return ym[ip] != -100.;};*/
139 pam-fi 1.12 Bool_t XGood(int ip){ return xgood[ip]==1;};
140     Bool_t YGood(int ip){ return ygood[ip]==1;};
141    
142     void SetMeasure(double *xmeas, double *ymeas, double *zmeas);
143     void SetResolution(double *rx, double *ry);
144     void SetGood(int *xg, int *yg);
145     void LoadField(TString s);
146     void Fit(double pfixed, int& fail, int iprint);
147     void FitReset();
148 pam-fi 1.19 void SetTrackingMode(int trackmode);
149 pam-fi 1.14
150     void FillMiniStruct(cMini2track&);
151     void SetFromMiniStruct(cMini2track*);
152 pam-fi 1.12
153     TrkCluster *GetClusterX(int ip){TrkCluster *pt = (TrkCluster*)(clx->At(ip)); return pt;};
154     TrkCluster *GetClusterY(int ip){TrkCluster *pt = (TrkCluster*)(cly->At(ip)); return pt;};
155    
156 mocchiut 1.1 TrkTrack* GetTrkTrack(){return this;};
157    
158 pam-fi 1.3 friend class TrkLevel2;
159    
160 pam-fi 1.9 ClassDef(TrkTrack,2);
161 mocchiut 1.1
162     };
163     /**
164     * \brief Class to describe single clusters ("singlets").
165     *
166     * Single clusters are clusters not associated to any track.
167     */
168     class TrkSinglet : public TObject {
169    
170     private:
171 pam-fi 1.8
172 mocchiut 1.1
173     public:
174 pam-fi 1.8
175 pam-fi 1.15 TRef cls;
176 mocchiut 1.1
177     int plane; ///<plane
178     float coord[2]; ///<coordinate (on sensor 1 and 2)
179     float sgnl; ///<cluster signal in MIP
180    
181     TrkSinglet();
182     TrkSinglet(const TrkSinglet&);
183 pam-fi 1.15 ~TrkSinglet(){Delete();};
184 mocchiut 1.1
185     void Dump();
186 pam-fi 1.15 void Clear();
187     void Clear(Option_t *option){Clear();};
188     void Delete(){Clear();};
189 pam-fi 1.8
190 pam-fi 1.11 TrkCluster *GetCluster(){TrkCluster *pt = (TrkCluster*)cls.GetObject(); return pt;};
191 mocchiut 1.1
192 pam-fi 1.3 friend class TrkLevel2;
193    
194 pam-fi 1.9 ClassDef(TrkSinglet,2);
195 mocchiut 1.1
196     };
197    
198     /**
199     * \brief Class to describe tracker LEVEL2 data.
200     *
201     * A tracker events is defined by some general variables, plus the collection of all the fitted tracks and all
202     * single clusters on X and Y views.
203     * Tracks and single clusters ("singlets") are described by the classes TrkTrack and TrkSinglet respectivelly.
204     *
205     * Each track may have an "image", due to the ambiguity on the Y view, which is stored also.
206     * Thus, the number of stored tracks ( ntrk() ) differs from the number of "physical" tracks ( GetNTracks() ).
207     * Proper methods allow to sort tracks and select the physical ones ( GetTracks() ).
208     */
209     class TrkLevel2 : public TObject {
210    
211     private:
212 pam-fi 1.15
213 mocchiut 1.1 public:
214    
215 pam-fi 1.15 Int_t good[12]; ///< event status
216 mocchiut 1.1
217     TClonesArray *Track; ///< fitted tracks
218     TClonesArray *SingletX; ///< x singlets
219     TClonesArray *SingletY; ///< y singlets
220    
221     TrkLevel2();
222     // TrkLevel2(cTrkLevel2 *);
223 pam-fi 1.11 ~TrkLevel2(){Delete();};
224 pam-fi 1.10
225 pam-fi 1.11 void Clear();
226 pam-fi 1.15 void Clear(Option_t *option){Clear();};
227 pam-fi 1.11 void Delete();
228 pam-fi 1.16 void Set();
229 pam-fi 1.11
230     int ntrk() {return Track->GetEntries();} ///< number of stored track
231 mocchiut 1.1 int nclsx(){return SingletX->GetEntries();} ///< number of x singlets
232     int nclsy(){return SingletY->GetEntries();} ///< number of y singlets
233    
234     void Dump();
235 pam-fi 1.11 void SetFromLevel2Struct(cTrkLevel2 *, TrkLevel1 *);
236 pam-fi 1.18 void SetFromLevel2Struct(cTrkLevel2 *s2){ SetFromLevel2Struct(s2, NULL); };
237     void SetFromLevel2Struct(TrkLevel1 *l1) { SetFromLevel2Struct(&level2event_, l1); };
238     void SetFromLevel2Struct() { SetFromLevel2Struct(&level2event_); };
239 pam-fi 1.11 void GetLevel2Struct(cTrkLevel2 *) const;
240 pam-fi 1.3 void LoadField(TString);
241 pam-fi 1.17 float GetBX(float*);
242     float GetBY(float*);
243     float GetBZ(float*);
244 pam-fi 1.6 Float_t GetZTrk(Int_t);
245     Float_t GetXTrkLeft(){return XTRKL;};
246     Float_t GetXTrkRight(){return XTRKR;};
247     Float_t GetYTrkLeft(){return YTRKL;};
248     Float_t GetYTrkRight(){return YTRKR;};
249    
250     TrkSinglet *GetSingletX(int);
251     TrkSinglet *GetSingletY(int);
252    
253     TrkTrack *GetStoredTrack(int i);
254 pam-fi 1.3 Int_t GetSeqNo(Int_t i) {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number
255 pam-fi 1.5 // TClonesArray *GetTracks_Chi2Sorted();
256 pam-fi 1.7 // TClonesArray *GetTracks_NFitSorted();
257     // TClonesArray *GetTracks();
258 pam-fi 1.11 TRefArray *GetTracks_NFitSorted();
259     TRefArray *GetTracks(){return this->GetTracks_NFitSorted();};
260    
261 pam-fi 1.4 // int GetNTracks(){return this->GetTracks()->GetEntries();}
262 pam-fi 1.11 Int_t GetNTracks();
263     TrkTrack* GetTrack(int i);
264 mocchiut 1.1 TrkTrack* GetTrackImage(int i);
265 pam-fi 1.11
266 pam-fi 1.3 TrkLevel2* GetTrkLevel2(){return this;}
267     TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array
268    
269 pam-fi 1.9 ClassDef(TrkLevel2,2);
270 mocchiut 1.1
271     };
272    
273     #endif

  ViewVC Help
Powered by ViewVC 1.1.23