/[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.5 - (hide annotations) (download)
Tue Jul 11 15:32:26 2006 UTC (18 years, 5 months ago) by pam-fi
Branch: MAIN
CVS Tags: v1r01beta
Changes since 1.4: +29 -10 lines
File MIME type: text/plain
some methods added

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.3
12 mocchiut 1.1 #include <TrkStruct.h>
13    
14 pam-fi 1.2 // z-coordinate of track state-vector reference-plane
15     #define ZINI 23.5
16     // upper and lower (mechanical) z-coordinate of the tracker
17 pam-fi 1.5 //#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 pam-fi 1.2
32 mocchiut 1.1 /**
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 pam-fi 1.2 float* thx; ///< x projected angle
49     float* thy; ///< y projected angle
50     float* tl; ///< track length
51 mocchiut 1.1
52 pam-fi 1.2 Trajectory();
53 mocchiut 1.1 Trajectory(int n);
54     Trajectory(int n, float* pz);
55     void Dump();
56    
57 pam-fi 1.2 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 mocchiut 1.1 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 pam-fi 1.3 int seqno; ///<stored track sequential number
76     int image; ///<sequential number of track-image
77    
78 mocchiut 1.1 public:
79    
80 pam-fi 1.3
81 mocchiut 1.1 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 pam-fi 1.3
99 mocchiut 1.1
100     TrkTrack();
101     TrkTrack(const TrkTrack&);
102    
103     void Dump();
104    
105 pam-fi 1.3 Int_t GetSeqNo(){return seqno;} ///< Returns the track sequential number
106     Int_t GetImageSeqNo(){return image;} ///< Returns the track image sequential number
107 mocchiut 1.1 Bool_t HasImage(){return !(image==-1);} ///< Returns true if the track has an image
108 pam-fi 1.2 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 mocchiut 1.1 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 pam-fi 1.3 Int_t GetNtot(){return GetNX()+GetNY();};
114 mocchiut 1.1 Float_t GetRigidity();
115     Float_t GetDeflection();
116     Float_t GetDEDX();
117    
118     TrkTrack* GetTrkTrack(){return this;};
119    
120 pam-fi 1.3 friend class TrkLevel2;
121    
122 mocchiut 1.1 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 pam-fi 1.3 friend class TrkLevel2;
146    
147 mocchiut 1.1 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 pam-fi 1.5
166     // TRefArray *PhysicalTrack; ///< physical tracks (no image) -
167    
168 mocchiut 1.1 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 pam-fi 1.5 int ntrk() {return Track->GetEntries();} ///< number of stored track
181 mocchiut 1.1 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 FillCommonVar(cTrkLevel2 *);
186     void Clear();
187 pam-fi 1.3 void LoadField(TString);
188 pam-fi 1.5 Float_t GetZTrk(Int_t);
189     Float_t GetXTrkLeft(){return XTRKL;};
190     Float_t GetXTrkRight(){return XTRKR;};
191     Float_t GetYTrkLeft(){return YTRKL;};
192     Float_t GetYTrkRight(){return YTRKR;};
193    
194     TrkSinglet *GetSingletX(int);
195     TrkSinglet *GetSingletY(int);
196    
197     TrkTrack *GetStoredTrack(int i);
198 pam-fi 1.3 Int_t GetSeqNo(Int_t i) {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number
199 pam-fi 1.5 // TClonesArray *GetTracks_Chi2Sorted();
200 pam-fi 1.3 TClonesArray *GetTracks_NFitSorted();
201     TClonesArray *GetTracks();
202 mocchiut 1.1
203 pam-fi 1.4 // int GetNTracks(){return this->GetTracks()->GetEntries();}
204     Int_t GetNTracks();
205     TrkTrack* GetTrack(int i);
206 mocchiut 1.1 TrkTrack* GetTrackImage(int i);
207    
208 pam-fi 1.3 TrkLevel2* GetTrkLevel2(){return this;}
209     TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array
210    
211 mocchiut 1.1 ClassDef(TrkLevel2,1);
212    
213     };
214    
215    
216    
217     #endif

  ViewVC Help
Powered by ViewVC 1.1.23