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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by pam-fi, Wed Jun 14 10:01:44 2006 UTC revision 1.20 by pam-fi, Thu Mar 15 12:17:09 2007 UTC
# Line 8  Line 8 
8  #include <TObject.h>  #include <TObject.h>
9  #include <TObjArray.h>  #include <TObjArray.h>
10  #include <TClonesArray.h>  #include <TClonesArray.h>
11    #include <TRefArray.h>
12    #include <TRef.h>
13    
14  #include <TrkStruct.h>  //#include <TrkStruct.h>
15    #include <TrkParams.h>
16    #include <TrkLevel1.h>
17    
18  // z-coordinate of track state-vector reference-plane  // z-coordinate of track state-vector reference-plane
19  #define ZINI 23.5    #define ZINI 23.5  
20  // upper and lower (mechanical) z-coordinate of the tracker  // upper and lower (mechanical) z-coordinate of the tracker
21  #define ZTRKUP 22.29  //#define ZTRKUP 22.29
22  #define ZTRKDW -22.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    
36  /**  /**
37   * \brief Class to describe, by points, a particle trajectory in the apparatus.   * \brief Class to describe, by points, a particle trajectory in the apparatus.
# Line 41  class Trajectory : public TObject{ Line 56  class Trajectory : public TObject{
56      Trajectory();      Trajectory();
57      Trajectory(int n);      Trajectory(int n);
58      Trajectory(int n, float* pz);      Trajectory(int n, float* pz);
59        ~Trajectory(){Delete();};
60      void Dump();      void Dump();
61        void Delete();
62    
63        int DoTrack2(float* al);
64      float GetLength(){float l=0; for(int i=0; i<npoint;i++)l=l+tl[i]; return l;};      float GetLength(){float l=0; for(int i=0; i<npoint;i++)l=l+tl[i]; return l;};
65      float GetLength(int,int);      float GetLength(int,int);
66    
67      ClassDef(Trajectory,1);      ClassDef(Trajectory,2);
68    
69  };  };
70  /**  /**
# Line 64  private: Line 82  private:
82      int   seqno;           ///<stored track sequential number      int   seqno;           ///<stored track sequential number
83      int   image;           ///<sequential number of track-image      int   image;           ///<sequential number of track-image
84    
85            
86  public:  public:
87    
88        TRefArray *clx;
89        TRefArray *cly;
90    
91      float al[5];           ///<TRACK STATE VECTOR      float al[5];           ///<TRACK STATE VECTOR
92      float coval[5][5];     ///<covariance matrix      float coval[5][5];     ///<covariance matrix
# Line 77  public: Line 98  public:
98      float resx[6];         ///<spatial resolution on X view      float resx[6];         ///<spatial resolution on X view
99      float resy[6];         ///<spatial resolution on y view      float resy[6];         ///<spatial resolution on y view
100      float chi2;            ///<chi2      float chi2;            ///<chi2
101        int   nstep;           ///<n. step
102      float xv[6];           ///<calculated x coordinates      float xv[6];           ///<calculated x coordinates
103      float yv[6];           ///<calculated y coordinates      float yv[6];           ///<calculated y coordinates
104      float zv[6];           ///<calculated z coordinates      float zv[6];           ///<calculated z coordinates
105      float axv[6];          ///<calculated angles (deg) on x view      float axv[6];          ///<calculated angles (deg) on x view
106      float ayv[6];          ///<calculated angles (deg) on y view      float ayv[6];          ///<calculated angles (deg) on y view
107      float dedx_x[6];       ///<signal in MIP (scaled to 300 micrometer)      float dedx_x[6];       ///<dE/dx in MIP
108      float dedx_y[6];       ///<signal in MIP (scaled to 300 micrometer)      float dedx_y[6];       ///<dE/dx in MIP
   
109    
110      TrkTrack();      TrkTrack();
111      TrkTrack(const TrkTrack&);      TrkTrack(const TrkTrack&);
112    
113        ~TrkTrack(){ Delete(); };
114            
115      void Dump();      void Dump();
116        void Clear();
117        void Clear(Option_t *option){Clear();};
118        void Delete();
119        void Copy(TrkTrack&);
120    //    void Set();
121    
122      Int_t  GetSeqNo(){return seqno;}        ///< Returns the track sequential number      Int_t  GetSeqNo(){return seqno;}        ///< Returns the track sequential number
123      Int_t  GetImageSeqNo(){return image;}   ///< Returns the track image sequential number      Int_t  GetImageSeqNo(){return image;}   ///< Returns the track image sequential number
# Line 103  public: Line 131  public:
131      Float_t GetRigidity();      Float_t GetRigidity();
132      Float_t GetDeflection();      Float_t GetDeflection();
133      Float_t GetDEDX();      Float_t GetDEDX();
134        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    /*      Bool_t XGood(int ip){ return xm[ip] != -100.;};
138            Bool_t YGood(int ip){ return ym[ip] != -100.;};*/
139        Bool_t XGood(int ip){ return xgood[ip]> 0;};
140        Bool_t YGood(int ip){ return ygood[ip]> 0;};
141        
142    
143        void SetMeasure(double *xmeas, double *ymeas, double *zmeas);
144        void SetResolution(double *rx, double *ry);
145        void SetGood(int *xg, int *yg);
146        void LoadField(TString s);
147        void Fit(double pfixed, int& fail, int iprint);
148        void FitReset();
149        void SetTrackingMode(int trackmode);
150    
151        void FillMiniStruct(cMini2track&);
152        void SetFromMiniStruct(cMini2track*);
153        
154        TrkCluster *GetClusterX(int ip);
155        TrkCluster *GetClusterY(int ip);
156    
157        Int_t GetClusterX_ID(int ip){return xgood[ip];};
158        Int_t GetClusterY_ID(int ip){return ygood[ip];};
159        
160      TrkTrack* GetTrkTrack(){return this;};      TrkTrack* GetTrkTrack(){return this;};
161    
162      friend class TrkLevel2;      friend class TrkLevel2;
163    
164      ClassDef(TrkTrack,1);      ClassDef(TrkTrack,2);
165    
166  };  };
167  /**  /**
# Line 119  public: Line 172  public:
172  class TrkSinglet : public TObject {  class TrkSinglet : public TObject {
173    
174  private:  private:
175            
176    
177  public:  public:
178            
179        TRef cls;
180    
181      int plane;       ///<plane      int plane;       ///<plane
182      float coord[2];  ///<coordinate (on sensor 1 and 2)      float coord[2];  ///<coordinate (on sensor 1 and 2)
# Line 128  public: Line 184  public:
184    
185      TrkSinglet();      TrkSinglet();
186      TrkSinglet(const TrkSinglet&);      TrkSinglet(const TrkSinglet&);
187        ~TrkSinglet(){Delete();};
188    
189      void Dump();      void Dump();
190        void Clear();
191        void Clear(Option_t *option){Clear();};
192        void Delete(){Clear();};
193            
194        TrkCluster *GetCluster(){TrkCluster *pt = (TrkCluster*)cls.GetObject(); return pt;};
195    
196      friend class TrkLevel2;      friend class TrkLevel2;
197    
198      ClassDef(TrkSinglet,1);      ClassDef(TrkSinglet,2);
199    
200  };  };
201    
# Line 151  public: Line 213  public:
213  class TrkLevel2 : public TObject {  class TrkLevel2 : public TObject {
214    
215   private:   private:
216    
217   public:   public:
218    
219        Int_t         good[12];       ///< event status
   
     Int_t good2;  
     Int_t crc[12];  
220    
221      TClonesArray *Track;        ///< fitted tracks      TClonesArray *Track;        ///< fitted tracks
222      TClonesArray *SingletX;     ///< x singlets      TClonesArray *SingletX;     ///< x singlets
# Line 165  class TrkLevel2 : public TObject { Line 224  class TrkLevel2 : public TObject {
224    
225      TrkLevel2();      TrkLevel2();
226  //    TrkLevel2(cTrkLevel2 *);  //    TrkLevel2(cTrkLevel2 *);
227        ~TrkLevel2(){Delete();};
228      int ntrk() {return Track->GetEntries();}     ///< number of stored track          
229        void Clear();
230        void Clear(Option_t *option){Clear();};
231        void Delete();
232        void Set();
233        
234        int ntrk() {return Track->GetEntries();}    ///< number of stored track
235      int nclsx(){return SingletX->GetEntries();} ///< number of x singlets      int nclsx(){return SingletX->GetEntries();} ///< number of x singlets
236      int nclsy(){return SingletY->GetEntries();} ///< number of y singlets      int nclsy(){return SingletY->GetEntries();} ///< number of y singlets
237    
238      void Dump();      void Dump();
239      void FillCommonVar(cTrkLevel2 *);      void SetFromLevel2Struct(cTrkLevel2 *, TrkLevel1 *);
240      void Clear();      void SetFromLevel2Struct(cTrkLevel2 *s2){ SetFromLevel2Struct(s2, NULL);          };
241        void SetFromLevel2Struct(TrkLevel1 *l1) { SetFromLevel2Struct(&level2event_, l1); };    
242        void SetFromLevel2Struct()              { SetFromLevel2Struct(&level2event_);     };    
243        void GetLevel2Struct(cTrkLevel2 *) const;
244      void LoadField(TString);      void LoadField(TString);
245        float GetBX(float*);
246        float GetBY(float*);
247        float GetBZ(float*);
248        Float_t GetZTrk(Int_t);
249        Float_t GetXTrkLeft(){return XTRKL;};
250        Float_t GetXTrkRight(){return XTRKR;};
251        Float_t GetYTrkLeft(){return YTRKL;};
252        Float_t GetYTrkRight(){return YTRKR;};
253        
254        TrkSinglet   *GetSingletX(int);
255        TrkSinglet   *GetSingletY(int);
256        
257      TrkTrack     *GetStoredTrack(int i);      TrkTrack     *GetStoredTrack(int i);
258      Int_t         GetSeqNo(Int_t i)  {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number      Int_t         GetSeqNo(Int_t i)  {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number
259      TClonesArray *GetTracks_Chi2Sorted();  //    TClonesArray *GetTracks_Chi2Sorted();
260      TClonesArray *GetTracks_NFitSorted();  //    TClonesArray *GetTracks_NFitSorted();
261      TClonesArray *GetTracks();  //    TClonesArray *GetTracks();
262        TRefArray *GetTracks_NFitSorted();
263      int       GetNTracks(){return this->GetTracks()->GetEntries();}      TRefArray *GetTracks(){return this->GetTracks_NFitSorted();};
264        
265    //    int       GetNTracks(){return this->GetTracks()->GetEntries();}
266        Int_t     GetNTracks();
267      TrkTrack* GetTrack(int i);      TrkTrack* GetTrack(int i);
268      TrkTrack* GetTrackImage(int i);      TrkTrack* GetTrackImage(int i);
269        
270      TrkLevel2*    GetTrkLevel2(){return this;}      TrkLevel2*    GetTrkLevel2(){return this;}
271      TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array      TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array
272            
273      ClassDef(TrkLevel2,1);      ClassDef(TrkLevel2,2);
274    
275  };  };
276    
   
   
277  #endif  #endif

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.23