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

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

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

revision 1.1 by pam-fi, Thu Feb 27 11:24:42 2014 UTC revision 1.2 by pam-ts, Wed Jun 4 07:57:01 2014 UTC
# Line 6  Line 6 
6  #define exttrack_h  #define exttrack_h
7    
8  #include <TrkLevel2.h>  #include <TrkLevel2.h>
9    #include <TrkParams.h>
10    
11    
12    /**
13     * \brief Struct to pass mini2 track parameters to F77 routines
14     */
15    #define NPLANEMAX 56
16    
17    struct cMiniExtTrack {
18        double al[5];
19        double xm[NPLANEMAX],ym[NPLANEMAX],zm[NPLANEMAX];
20        double xm_a[NPLANEMAX],ym_a[NPLANEMAX],zm_a[NPLANEMAX];
21        double xm_b[NPLANEMAX],ym_b[NPLANEMAX],zm_b[NPLANEMAX];
22        double resx[NPLANEMAX],resy[NPLANEMAX];
23        double tailx[NPLANEMAX],taily[NPLANEMAX];
24        double xgood[NPLANEMAX],ygood[NPLANEMAX];
25        double dedxtrk_x[NPLANEMAX];
26        double dedxtrk_y[NPLANEMAX];
27        double zini;
28        double pfixed;
29        double chi2;
30        double xv[NPLANEMAX],yv[NPLANEMAX],zv[NPLANEMAX];
31        double axv[NPLANEMAX],ayv[NPLANEMAX];
32        double cov[5][5];
33        double fact;
34        int nstep;
35        int idcand;
36        int trackmode;
37        int istepmin;
38        int nplanes;
39    
40    };
41    
42    extern "C" {
43    
44      extern struct cMiniExtTrack exttrack_;
45      void miniext_(int*,int*,int*);
46      void guessext_();
47    
48    }
49    
50    
51  class ExtTrack : public TObject {  class ExtTrack : public TObject {
52    
# Line 13  private: Line 54  private:
54    
55  public:  public:
56    
           
     Float_t al[5];           ///<TRACK STATE VECTOR  
     Float_t coval[5][5];     ///<covariance matrix  
     Float_t chi2;            
     Int_t  nstep;            
     Int_t nplanes;  
     Int_t*   xgood ;        //[nplanes]        
     Int_t*   ygood ;        //[nplanes]          
     Float_t* xm ;           //[nplanes]  
     Float_t* ym ;           //[nplanes]  
     Float_t* zm ;           //[nplanes]  
     Float_t* resx ;         //[nplanes]  
     Float_t* resy ;         //[nplanes]  
     Float_t* xv ;           //[nplanes]  
     Float_t* yv ;           //[nplanes]  
     Float_t* zv ;           //[nplanes]  
     Float_t* axv ;          //[nplanes]  
     Float_t* ayv ;          //[nplanes]  
     Float_t* dedx_x ;       //[nplanes]  
     Float_t* dedx_y ;       //[nplanes]  
   
   
     ExtTrack();  
     ExtTrack(Int_t dim);  
     ExtTrack(const ExtTrack&);  
   
     ~ExtTrack(){ Delete(); };  
   
     void Clear(Option_t* option="");  
     void Delete();  
     void Dump();  
   
     void FitReset();  
     void SetDimension(Int_t dim);  
     void SetMeasure(double *xmeas, double *ymeas, double *zmeas);  
     void SetResolution(double *rx, double *ry);  
     void SetGood(Int_t *xg, Int_t *yg);  
   
     void FillMiniStruct(cMini2track& track);  
     void SetFromMiniStruct(cMini2track *track);  
   
   
     Bool_t XGood(int ip){ return xgood[ip]; };  
     Bool_t YGood(int ip){ return ygood[ip]; };  
   
     Int_t GetNX(){Int_t n=0; for(Int_t i=0; i<nplanes; i++)n+=(Int_t)XGood(i); return n;};  
     Int_t GetNY(){Int_t n=0; for(Int_t i=0; i<nplanes; i++)n+=(Int_t)YGood(i); return n;};  
     Int_t GetNXY(){Int_t n=0; for(Int_t i=0; i<nplanes; i++)n+=(Int_t)YGood(i)*XGood(i); return n;};  
     Int_t GetNtot(){return GetNX()+GetNY();};  
57    
58      ClassDef(ExtTrack,1);    float zini;
59      float al[5];           ///<TRACK STATE VECTOR
60      float coval[5][5];     ///<covariance matrix
61      float chi2;          
62      int  nstep;          
63      int nplanes;
64      int*   xgood ;        //[nplanes]      
65      int*   ygood ;        //[nplanes]        
66      int*   multmaxx;     //[nplanes]  
67      int*   multmaxy;     //[nplanes]  
68      float* xm ;           //[nplanes]
69      float* ym ;           //[nplanes]
70      float* zm ;           //[nplanes]
71      float* xma ;           //[nplanes]
72      float* yma ;           //[nplanes]
73      float* zma ;           //[nplanes]
74      float* xmb ;           //[nplanes]
75      float* ymb ;           //[nplanes]
76      float* zmb ;           //[nplanes]
77      float* resx ;         //[nplanes]
78      float* resy ;         //[nplanes]
79      float* xv ;           //[nplanes]
80      float* yv ;           //[nplanes]
81      float* zv ;           //[nplanes]
82      float* axv ;          //[nplanes]
83      float* ayv ;          //[nplanes]
84      float* dedx_x ;       //[nplanes]
85      float* dedx_y ;       //[nplanes]
86    
87      float xGF[14];         ///<calculated x coordinates on GF reference planes
88      float yGF[14];         ///<calculated y coordinates on GF reference planes
89    
90      ExtTrack(int dim=0);
91    
92      ExtTrack( TrkTrack& t){ Set(t); }
93      ExtTrack( const ExtTrack& );
94    
95      ~ExtTrack(){ Delete(); };
96    
97      void SetDimension(int dim);    ///< Allocate vectors
98      void Clear(Option_t* option=""); ///< Deallocate vectors
99      void Delete();        ///< Deallocate vectors
100    
101      void Copy(ExtTrack&);
102    
103    
104      void SetMiniDefault();        ///< Set tracking alg. parameters (static)
105      void SetZ0(float zin){zini = zin; } ///< Set z-coord of reference plane
106    
107    
108      void Set( TrkTrack& t, int index);          ///< Set from TrkTrack object
109      void Set( TrkTrack& t){Set(t,0);};          ///< Set from TrkTrack object
110      void FillMiniStruct(cMiniExtTrack& track);
111      void SetFromMiniStruct(cMiniExtTrack *track);
112      void FillMiniStruct(){FillMiniStruct(exttrack_); };
113      void SetFromMiniStruct(){SetFromMiniStruct(&exttrack_);};
114    
115    
116      bool SetZ(int ip,float zmeas);
117      bool SetXY(int ip,float xmeas, float ymeas, float rx, float ry);
118      bool SetX(int ip,float xa, float xb, float ya, float yb, float res);
119      bool SetY(int ip,float xa, float xb, float ya, float yb, float res);
120      bool ResetXY(int ip);
121    
122      bool SetXGood(int ip,int icl_piu_uno=1, int il=-1, int is=-1 ); ///< same notation as TrkTrack
123      bool SetYGood(int ip,int icl_piu_uno=1, int il=-1, int is=-1 );///< same notation as TrkTrack
124    
125      void ResetFit();                       ///<Reset fit variables
126      void ResetXY();                        ///<Reset all measured-position variables
127      void Reset(){ ResetFit(); ResetXY(); } ///<Reset all variables
128    
129    
130    
131      void Dump();
132    
133    
134      void Fit(double pfixed, int& fail, int iprint);
135    
136      Bool_t XGood(int ip){ return GetClusterX_ID(ip)!=-1; };
137      Bool_t YGood(int ip){ return GetClusterY_ID(ip)!=-1; };
138      int GetClusterX_ID(int ip);
139      int GetClusterY_ID(int ip);
140      int GetLadder(int ip);
141      int GetSensor(int ip);
142    
143      int GetNX(){int n=0; for(int i=0; i<nplanes; i++)n+=(int)(XGood(i)); return n;};
144      int GetNY(){int n=0; for(int i=0; i<nplanes; i++)n+=(int)(YGood(i)); return n;};
145      int GetNXY(){int n=0; for(int i=0; i<nplanes; i++)n+=(int)(YGood(i)&&XGood(i)); return n;};
146      int GetNtot(){return GetNX()+GetNY();};
147    
148      Int_t GetClusterX_Multiplicity(int ip);
149      Int_t GetClusterY_Multiplicity(int ip);
150      Int_t GetClusterX_MaxStrip(int ip);
151      Int_t GetClusterY_MaxStrip(int ip);
152    
153      Float_t GetRigidity();
154    
155      ClassDef(ExtTrack,1);
156    
157  };  };
158    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.23