/[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.1.1.1 by mocchiut, Fri May 19 13:15:52 2006 UTC revision 1.22 by pam-fi, Wed Mar 28 14:45:24 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 <TrkStruct.h>  #include <TRefArray.h>
12    #include <TRef.h>
13    
14    //#include <TrkStruct.h>
15    #include <TrkParams.h>
16    #include <TrkLevel1.h>
17    
18    // z-coordinate of track state-vector reference-plane
19    #define ZINI 23.5  
20    // upper and lower (mechanical) z-coordinate of the tracker
21    //#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    
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 26  class Trajectory : public TObject{ Line 49  class Trajectory : public TObject{
49      float* x;   ///< x coordinates      float* x;   ///< x coordinates
50      float* y;   ///< y coordinates      float* y;   ///< y coordinates
51      float* z;   ///< z coordinates      float* z;   ///< z coordinates
52        float* thx; ///< x projected angle
53        float* thy; ///< y projected angle
54        float* tl;  ///< track length
55    
56      Trajectory(){npoint=1; x = new float; y = new float; z = new float; return;};      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;};
65        float GetLength(int,int);
66    
67      ClassDef(Trajectory,1);      ClassDef(Trajectory,2);
68    
69  };  };
70  /**  /**
# Line 47  class TrkTrack : public TObject { Line 79  class TrkTrack : public TObject {
79    
80  private:  private:
81    
82        int   seqno;           ///<stored track sequential number
83        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  */
92      float al[5];           ///<TRACK STATE VECTOR      float al[5];           ///<TRACK STATE VECTOR
93      float coval[5][5];     ///<covariance matrix      float coval[5][5];     ///<covariance matrix
94      int   xgood[6];        ///<mask of included x planes      int   xgood[6];        ///<mask of included x planes
# Line 59  public: Line 99  public:
99      float resx[6];         ///<spatial resolution on X view      float resx[6];         ///<spatial resolution on X view
100      float resy[6];         ///<spatial resolution on y view      float resy[6];         ///<spatial resolution on y view
101      float chi2;            ///<chi2      float chi2;            ///<chi2
102        int   nstep;           ///<n. step
103      float xv[6];           ///<calculated x coordinates      float xv[6];           ///<calculated x coordinates
104      float yv[6];           ///<calculated y coordinates      float yv[6];           ///<calculated y coordinates
105      float zv[6];           ///<calculated z coordinates      float zv[6];           ///<calculated z coordinates
106      float axv[6];          ///<calculated angles (deg) on x view      float axv[6];          ///<calculated angles (deg) on x view
107      float ayv[6];          ///<calculated angles (deg) on y view      float ayv[6];          ///<calculated angles (deg) on y view
108      float dedx_x[6];       ///<signal in MIP (scaled to 300 micrometer)      float dedx_x[6];       ///<dE/dx in MIP
109      float dedx_y[6];       ///<signal in MIP (scaled to 300 micrometer)      float dedx_y[6];       ///<dE/dx in MIP
     int   image;           ///<flag to tag track-images  
110    
111      TrkTrack();      TrkTrack();
112      TrkTrack(const TrkTrack&);      TrkTrack(const TrkTrack&);
113    
114        ~TrkTrack(){ Delete(); };
115            
116      void Dump();      void Dump();
117        void Clear();
118        void Clear(Option_t *option){Clear();};
119        void Delete();
120        void Copy(TrkTrack&);
121    //    void Set();
122    
123        Int_t  GetSeqNo(){return seqno;}        ///< Returns the track sequential number
124        Int_t  GetImageSeqNo(){return image;}   ///< Returns the track image sequential number
125      Bool_t HasImage(){return !(image==-1);} ///< Returns true if the track has an image      Bool_t HasImage(){return !(image==-1);} ///< Returns true if the track has an image
126          int DoTrack(Trajectory* t);                     ///< Evaluates the trajectory in the apparatus.      int DoTrack(Trajectory* t);                         ///< Evaluates the trajectory in the apparatus.
127          float BdL(){return 0;};                                 ///< Evaluates the integral of B*dL along the track.      int DoTrack2(Trajectory* t);                        ///< Evaluates the trajectory in the apparatus.
128        float BdL(){return 0;};                                     ///< Evaluates the integral of B*dL along the track.
129      Int_t GetNX(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=xgood[i]; return n;};      Int_t GetNX(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=xgood[i]; return n;};
130      Int_t GetNY(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=ygood[i]; return n;};      Int_t GetNY(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=ygood[i]; return n;};
131        Int_t GetNtot(){return GetNX()+GetNY();};
132      Float_t GetRigidity();      Float_t GetRigidity();
133      Float_t GetDeflection();      Float_t GetDeflection();
134      Float_t GetDEDX();      Float_t GetDEDX();
135        Float_t GetDEDX(Int_t ip){if( !(xgood[ip]+ygood[ip]) ) return 0; return (dedx_x[ip]+dedx_y[ip])/(xgood[ip]+ygood[ip]);};
136        // sono un'imbecille... assegno xm e ym anche quando si tratta di un singolo
137        // non posso quindi usare xm e ym per dire se una vista e` inclusa nel fit o no
138    /*      Bool_t XGood(int ip){ return xm[ip] != -100.;};
139            Bool_t YGood(int ip){ return ym[ip] != -100.;};*/
140        Bool_t XGood(int ip){ return xgood[ip]> 0;};
141        Bool_t YGood(int ip){ return ygood[ip]> 0;};
142        
143    
144        void SetMeasure(double *xmeas, double *ymeas, double *zmeas);
145        void SetResolution(double *rx, double *ry);
146        void SetGood(int *xg, int *yg);
147        void LoadField(TString s);
148        void Fit(double pfixed, int& fail, int iprint);
149        void FitReset();
150        void SetTrackingMode(int trackmode);
151        void SetPrecisionFactor(double fact);
152        void SetStepMin(int istepmin);
153    
154        void FillMiniStruct(cMini2track&);
155        void SetFromMiniStruct(cMini2track*);
156        
157        TrkCluster *GetClusterX(int ip);
158        TrkCluster *GetClusterY(int ip);
159    
160        Int_t GetClusterX_ID(int ip){return xgood[ip];};
161        Int_t GetClusterY_ID(int ip){return ygood[ip];};
162        
163      TrkTrack* GetTrkTrack(){return this;};      TrkTrack* GetTrkTrack(){return this;};
164    
165      ClassDef(TrkTrack,1);      friend class TrkLevel2;
166    
167        ClassDef(TrkTrack,2);
168    
169  };  };
170  /**  /**
# Line 95  public: Line 175  public:
175  class TrkSinglet : public TObject {  class TrkSinglet : public TObject {
176    
177  private:  private:
178            
179    
180  public:  public:
181            
182        TRef cls;
183    
184      int plane;       ///<plane      int plane;       ///<plane
185      float coord[2];  ///<coordinate (on sensor 1 and 2)      float coord[2];  ///<coordinate (on sensor 1 and 2)
# Line 104  public: Line 187  public:
187    
188      TrkSinglet();      TrkSinglet();
189      TrkSinglet(const TrkSinglet&);      TrkSinglet(const TrkSinglet&);
190        ~TrkSinglet(){Delete();};
191    
192      void Dump();      void Dump();
193        void Clear();
194        void Clear(Option_t *option){Clear();};
195        void Delete(){Clear();};
196            
197        TrkCluster *GetCluster(){TrkCluster *pt = (TrkCluster*)cls.GetObject(); return pt;};
198    
199        friend class TrkLevel2;
200    
201      ClassDef(TrkSinglet,1);      ClassDef(TrkSinglet,2);
202    
203  };  };
204    
# Line 125  public: Line 216  public:
216  class TrkLevel2 : public TObject {  class TrkLevel2 : public TObject {
217    
218   private:   private:
219    
220   public:   public:
221    
222        Int_t         good[12];       ///< event status
   
     Int_t good2;  
     Int_t crc[12];  
223    
224      TClonesArray *Track;        ///< fitted tracks      TClonesArray *Track;        ///< fitted tracks
225      TClonesArray *SingletX;     ///< x singlets      TClonesArray *SingletX;     ///< x singlets
# Line 139  class TrkLevel2 : public TObject { Line 227  class TrkLevel2 : public TObject {
227    
228      TrkLevel2();      TrkLevel2();
229  //    TrkLevel2(cTrkLevel2 *);  //    TrkLevel2(cTrkLevel2 *);
230        ~TrkLevel2(){Delete();};
231      int ntrk(){return Track->GetEntries();}     ///< number of stored track          
232        void Clear();
233        void Clear(Option_t *option){Clear();};
234        void Delete();
235        void Set();
236        
237        int ntrk() {return Track->GetEntries();}    ///< number of stored track
238      int nclsx(){return SingletX->GetEntries();} ///< number of x singlets      int nclsx(){return SingletX->GetEntries();} ///< number of x singlets
239      int nclsy(){return SingletY->GetEntries();} ///< number of y singlets      int nclsy(){return SingletY->GetEntries();} ///< number of y singlets
240    
241      void Dump();      void Dump();
242      void FillCommonVar(cTrkLevel2 *);      void SetFromLevel2Struct(cTrkLevel2 *, TrkLevel1 *);
243      void Clear();      void SetFromLevel2Struct(cTrkLevel2 *s2){ SetFromLevel2Struct(s2, NULL);          };
244          void LoadField(TString);      void SetFromLevel2Struct(TrkLevel1 *l1) { SetFromLevel2Struct(&level2event_, l1); };    
245        void SetFromLevel2Struct()              { SetFromLevel2Struct(&level2event_);     };    
246      TrkTrack *GetStoredTrack(int i);      void GetLevel2Struct(cTrkLevel2 *) const;
247      TClonesArray *GetTracks();        void LoadField(TString);
248        float GetBX(float*);
249      int GetNTracks(){return this->GetTracks()->GetEntries();}      float GetBY(float*);
250        float GetBZ(float*);
251        Float_t GetZTrk(Int_t);
252        Float_t GetXTrkLeft(){return XTRKL;};
253        Float_t GetXTrkRight(){return XTRKR;};
254        Float_t GetYTrkLeft(){return YTRKL;};
255        Float_t GetYTrkRight(){return YTRKR;};
256        
257        TrkSinglet   *GetSingletX(int);
258        TrkSinglet   *GetSingletY(int);
259        
260        TrkTrack     *GetStoredTrack(int i);
261        Int_t         GetSeqNo(Int_t i)  {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number
262    //    TClonesArray *GetTracks_Chi2Sorted();
263    //    TClonesArray *GetTracks_NFitSorted();
264    //    TClonesArray *GetTracks();
265        TRefArray *GetTracks_NFitSorted();
266        TRefArray *GetTracks(){return this->GetTracks_NFitSorted();};
267        
268    //    int       GetNTracks(){return this->GetTracks()->GetEntries();}
269        Int_t     GetNTracks();
270      TrkTrack* GetTrack(int i);      TrkTrack* GetTrack(int i);
271      TrkTrack* GetTrackImage(int i);      TrkTrack* GetTrackImage(int i);
272        
273      TrkLevel2* GetTrkLevel2(){return this;}      TrkLevel2*    GetTrkLevel2(){return this;}
274        TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array
275      ClassDef(TrkLevel2,1);      
276        ClassDef(TrkLevel2,2);
277    
278  };  };
279    
   
   
   
280  #endif  #endif

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.23