/[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.16 by pam-fi, Tue Jan 16 10:03:49 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 <TrkLevel1.h>
16    
17  // z-coordinate of track state-vector reference-plane  // z-coordinate of track state-vector reference-plane
18  #define ZINI 23.5    #define ZINI 23.5  
19  // upper and lower (mechanical) z-coordinate of the tracker  // upper and lower (mechanical) z-coordinate of the tracker
20  #define ZTRKUP 22.29  //#define ZTRKUP 22.29
21  #define ZTRKDW -22.22  //#define ZTRKDW -22.22
22    // (mechanical) z-coordinate of the tracker planes
23    #define ZTRK6 -22.23
24    #define ZTRK5 -13.32
25    #define ZTRK4 -4.42
26    #define ZTRK3 4.48
27    #define ZTRK2 13.38
28    #define ZTRK1 22.28
29    // (mechanical) x/y-coordinates of magnet cavity
30    #define XTRKL -8.1
31    #define XTRKR  8.1
32    #define YTRKL -6.6
33    #define YTRKR  6.6
34    
35  /**  /**
36   * \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 55  class Trajectory : public TObject{
55      Trajectory();      Trajectory();
56      Trajectory(int n);      Trajectory(int n);
57      Trajectory(int n, float* pz);      Trajectory(int n, float* pz);
58        ~Trajectory(){Delete();};
59      void Dump();      void Dump();
60        void Delete();
61    
62        int DoTrack2(float* al);
63      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;};
64      float GetLength(int,int);      float GetLength(int,int);
65    
66      ClassDef(Trajectory,1);      ClassDef(Trajectory,2);
67    
68  };  };
69  /**  /**
# Line 64  private: Line 81  private:
81      int   seqno;           ///<stored track sequential number      int   seqno;           ///<stored track sequential number
82      int   image;           ///<sequential number of track-image      int   image;           ///<sequential number of track-image
83    
84            
85  public:  public:
86    
87        TRefArray *clx;
88        TRefArray *cly;
89    
90      float al[5];           ///<TRACK STATE VECTOR      float al[5];           ///<TRACK STATE VECTOR
91      float coval[5][5];     ///<covariance matrix      float coval[5][5];     ///<covariance matrix
# Line 77  public: Line 97  public:
97      float resx[6];         ///<spatial resolution on X view      float resx[6];         ///<spatial resolution on X view
98      float resy[6];         ///<spatial resolution on y view      float resy[6];         ///<spatial resolution on y view
99      float chi2;            ///<chi2      float chi2;            ///<chi2
100        int   nstep;           ///<n. step
101      float xv[6];           ///<calculated x coordinates      float xv[6];           ///<calculated x coordinates
102      float yv[6];           ///<calculated y coordinates      float yv[6];           ///<calculated y coordinates
103      float zv[6];           ///<calculated z coordinates      float zv[6];           ///<calculated z coordinates
# Line 85  public: Line 106  public:
106      float dedx_x[6];       ///<signal in MIP (scaled to 300 micrometer)      float dedx_x[6];       ///<signal in MIP (scaled to 300 micrometer)
107      float dedx_y[6];       ///<signal in MIP (scaled to 300 micrometer)      float dedx_y[6];       ///<signal in MIP (scaled to 300 micrometer)
108    
   
109      TrkTrack();      TrkTrack();
110      TrkTrack(const TrkTrack&);      TrkTrack(const TrkTrack&);
111    
112        ~TrkTrack(){ Delete(); };
113            
114      void Dump();      void Dump();
115        void Clear();
116        void Clear(Option_t *option){Clear();};
117        void Delete();
118        void Copy(TrkTrack&);
119    //    void Set();
120    
121      Int_t  GetSeqNo(){return seqno;}        ///< Returns the track sequential number      Int_t  GetSeqNo(){return seqno;}        ///< Returns the track sequential number
122      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 130  public:
130      Float_t GetRigidity();      Float_t GetRigidity();
131      Float_t GetDeflection();      Float_t GetDeflection();
132      Float_t GetDEDX();      Float_t GetDEDX();
133        Float_t GetDEDX(Int_t ip){if( !(xgood[ip]+ygood[ip]) ) return 0; return (dedx_x[ip]+dedx_y[ip])/(xgood[ip]+ygood[ip]);};
134        // sono un'imbecille... assegno xm e ym anche quando si tratta di un singolo
135        // non posso quindi usare xm e ym per dire se una vista e` inclusa nel fit o no
136    /*      Bool_t XGood(int ip){ return xm[ip] != -100.;};
137            Bool_t YGood(int ip){ return ym[ip] != -100.;};*/
138        Bool_t XGood(int ip){ return xgood[ip]==1;};
139        Bool_t YGood(int ip){ return ygood[ip]==1;};
140    
141        void SetMeasure(double *xmeas, double *ymeas, double *zmeas);
142        void SetResolution(double *rx, double *ry);
143        void SetGood(int *xg, int *yg);
144        void LoadField(TString s);
145        void Fit(double pfixed, int& fail, int iprint);
146        void FitReset();
147    
148        void FillMiniStruct(cMini2track&);
149        void SetFromMiniStruct(cMini2track*);
150        
151        TrkCluster *GetClusterX(int ip){TrkCluster *pt = (TrkCluster*)(clx->At(ip)); return pt;};
152        TrkCluster *GetClusterY(int ip){TrkCluster *pt = (TrkCluster*)(cly->At(ip)); return pt;};
153        
154      TrkTrack* GetTrkTrack(){return this;};      TrkTrack* GetTrkTrack(){return this;};
155    
156      friend class TrkLevel2;      friend class TrkLevel2;
157    
158      ClassDef(TrkTrack,1);      ClassDef(TrkTrack,2);
159    
160  };  };
161  /**  /**
# Line 119  public: Line 166  public:
166  class TrkSinglet : public TObject {  class TrkSinglet : public TObject {
167    
168  private:  private:
169            
170    
171  public:  public:
172            
173        TRef cls;
174    
175      int plane;       ///<plane      int plane;       ///<plane
176      float coord[2];  ///<coordinate (on sensor 1 and 2)      float coord[2];  ///<coordinate (on sensor 1 and 2)
# Line 128  public: Line 178  public:
178    
179      TrkSinglet();      TrkSinglet();
180      TrkSinglet(const TrkSinglet&);      TrkSinglet(const TrkSinglet&);
181        ~TrkSinglet(){Delete();};
182    
183      void Dump();      void Dump();
184        void Clear();
185        void Clear(Option_t *option){Clear();};
186        void Delete(){Clear();};
187            
188        TrkCluster *GetCluster(){TrkCluster *pt = (TrkCluster*)cls.GetObject(); return pt;};
189    
190      friend class TrkLevel2;      friend class TrkLevel2;
191    
192      ClassDef(TrkSinglet,1);      ClassDef(TrkSinglet,2);
193    
194  };  };
195    
# Line 151  public: Line 207  public:
207  class TrkLevel2 : public TObject {  class TrkLevel2 : public TObject {
208    
209   private:   private:
210    
211   public:   public:
212    
213        Int_t         good[12];       ///< event status
   
     Int_t good2;  
     Int_t crc[12];  
214    
215      TClonesArray *Track;        ///< fitted tracks      TClonesArray *Track;        ///< fitted tracks
216      TClonesArray *SingletX;     ///< x singlets      TClonesArray *SingletX;     ///< x singlets
# Line 165  class TrkLevel2 : public TObject { Line 218  class TrkLevel2 : public TObject {
218    
219      TrkLevel2();      TrkLevel2();
220  //    TrkLevel2(cTrkLevel2 *);  //    TrkLevel2(cTrkLevel2 *);
221        ~TrkLevel2(){Delete();};
222      int ntrk() {return Track->GetEntries();}     ///< number of stored track          
223        void Clear();
224        void Clear(Option_t *option){Clear();};
225        void Delete();
226        void Set();
227        
228        int ntrk() {return Track->GetEntries();}    ///< number of stored track
229      int nclsx(){return SingletX->GetEntries();} ///< number of x singlets      int nclsx(){return SingletX->GetEntries();} ///< number of x singlets
230      int nclsy(){return SingletY->GetEntries();} ///< number of y singlets      int nclsy(){return SingletY->GetEntries();} ///< number of y singlets
231    
232      void Dump();      void Dump();
233      void FillCommonVar(cTrkLevel2 *);      void SetFromLevel2Struct(cTrkLevel2 *);
234      void Clear();      void SetFromLevel2Struct(cTrkLevel2 *, TrkLevel1 *);
235        void GetLevel2Struct(cTrkLevel2 *) const;
236      void LoadField(TString);      void LoadField(TString);
237        Float_t GetZTrk(Int_t);
238        Float_t GetXTrkLeft(){return XTRKL;};
239        Float_t GetXTrkRight(){return XTRKR;};
240        Float_t GetYTrkLeft(){return YTRKL;};
241        Float_t GetYTrkRight(){return YTRKR;};
242        
243        TrkSinglet   *GetSingletX(int);
244        TrkSinglet   *GetSingletY(int);
245        
246      TrkTrack     *GetStoredTrack(int i);      TrkTrack     *GetStoredTrack(int i);
247      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
248      TClonesArray *GetTracks_Chi2Sorted();  //    TClonesArray *GetTracks_Chi2Sorted();
249      TClonesArray *GetTracks_NFitSorted();  //    TClonesArray *GetTracks_NFitSorted();
250      TClonesArray *GetTracks();  //    TClonesArray *GetTracks();
251        TRefArray *GetTracks_NFitSorted();
252      int       GetNTracks(){return this->GetTracks()->GetEntries();}      TRefArray *GetTracks(){return this->GetTracks_NFitSorted();};
253        
254    //    int       GetNTracks(){return this->GetTracks()->GetEntries();}
255        Int_t     GetNTracks();
256      TrkTrack* GetTrack(int i);      TrkTrack* GetTrack(int i);
257      TrkTrack* GetTrackImage(int i);      TrkTrack* GetTrackImage(int i);
258        
259      TrkLevel2*    GetTrkLevel2(){return this;}      TrkLevel2*    GetTrkLevel2(){return this;}
260      TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array      TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array
261            
262      ClassDef(TrkLevel2,1);      ClassDef(TrkLevel2,2);
263    
264  };  };
265    
   
   
266  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.23