/[PAMELA software]/DarthVader/ToFLevel2/inc/ToFLevel2.h
ViewVC logotype

Diff of /DarthVader/ToFLevel2/inc/ToFLevel2.h

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

revision 1.22 by pamela, Fri Jun 20 12:22:11 2008 UTC revision 1.23 by carbone, Fri Nov 20 11:05:21 2009 UTC
# Line 25  Line 25 
25  #include <GLTables.h> // Emiliano  #include <GLTables.h> // Emiliano
26  #include <OrbitalInfo.h> // Emiliano  #include <OrbitalInfo.h> // Emiliano
27  #include <ToFCore.h> // Emiliano  #include <ToFCore.h> // Emiliano
28    #include <physics/tof/TofEvent.h>
29    
30  //  //
31  // Declaration of the core fortran routines  // Declaration of the core fortran routines
32  //  //
# Line 46  extern "C" int rdtofcal(char [], int *); Line 48  extern "C" int rdtofcal(char [], int *);
48  #define ZTOF32 -24.34  #define ZTOF32 -24.34
49    
50    
51    class ToFGeom : public TObject {
52    
53    private:
54      TArrayI  ePlane, eXY;
55    
56    public:
57      ToFGeom() {
58        int plane[24] = {
59          0, 0, 0, 0, 0, 0, 0, 0,
60          1, 1, 1, 1, 1, 1,
61          2, 2,            
62          3, 3,            
63          4, 4, 4,
64          5, 5, 5
65        };
66        int plXY[6]= {  2,  1,  1,  2,  2,  1 }; // X==1, Y==2 */
67        ePlane.Set(24,plane);
68        eXY.Set(6,plXY);
69      }
70    
71      int GetPad(   int idpmt)  { return (int)((idpmt+0.5)/2.); }
72      int GetPlane( int idpmt)  { return ePlane[ GetPad(idpmt) ];  }
73      int GetXY(    int idpmt)  { return eXY[ GetPlane(idpmt) ]; }
74    
75       ClassDef(ToFGeom,1);
76    
77    };
78    
79    
80  /**  /**
81   * \brief  Class which contains the PMT data   * \brief  Class which contains the PMT data
82   *   *
# Line 74  class ToFPMT : public TObject { Line 105  class ToFPMT : public TObject {
105      ClassDef(ToFPMT,2);      ClassDef(ToFPMT,2);
106  };  };
107    
108    /**
109     * \brief  Class used to calibrate adc to dEdx for each PMT
110     *
111     * Class used to calibrate adc to dEdx for each PMT
112     */
113    class ToFdEdx : public TObject {
114    
115     private:
116        //
117    
118        ToFGeom  eGeom;  // ToF geometry
119        //
120    
121        Float_t  adc_he;
122        
123        TArrayF eDEDXpmt;  // 0-47  pmt dEdx
124        TArrayF eZpmt;     // 0-47  pmt charge
125        TArrayF eDEDXpad;  // 0-23  paddle dEdx
126        TArrayF eZpad;     // 0-23  paddle charge
127        TArrayF eDEDXlayer;  // 0-5 layer dEdx
128        TArrayF eZlayer;     // 0-5 layer charge
129        TArrayF eDEDXplane;  // 0-2 plane dEdx
130        TArrayF eZplane;     // 0-2 plane charge
131    
132        TArrayF INFOpmt;  // 0-47 pmt status
133        TArrayF INFOlayer;  //0-5 layer status
134        
135        // parameters:
136        TArrayF PMTsat;  // 0-47  saturation parameters
137    
138        TArrayF TDx[48];  // 200 x 48  define an array of 200 elements per each pmt
139        TArrayF TDy[48];
140    
141        TArrayF parAtt[48];      // 48 x 6
142        TArrayF parPos[48];      // 48 x 4
143        TArrayF parDesatBB[48];  // 48 x 3
144        TArrayF parBBneg[48];    // 48 x 3
145        TArrayF  parBBpos;    // 48 x 1
146    
147        double f_adcPC( float x );
148        double f_BB( TArrayF &p, float x );
149        double f_BB5B( float x );
150        double f_att( TArrayF &p, float x ) ;
151        double f_att5B( float x );
152        double f_desatBB( TArrayF &p, float x );  
153        double f_desatBB5B( float x );
154        double f_pos( TArrayF &p, float x );
155        double f_pos5B( float x );
156        float Get_adc_he( int id, float pl_x[6], float pl_y[6]);
157    
158        Bool_t conn[12];
159    
160        UInt_t ts[12];
161        UInt_t te[12];    
162      
163        
164     public:
165        ToFdEdx();   // class constructor
166        ~ToFdEdx(){ Delete(); };  // class distructor
167        //
168        void Clear(Option_t *option="");
169        void Delete(Option_t *option="") { Clear(); }
170    
171        //    void InitPar(const char *pardir);  // init parameters
172        void Define_PMTsat();
173        //void ReadParTD( Int_t ipmt, const char *fname  );
174    
175        void ReadParAtt(            const char *fname  );
176        void ReadParPos(            const char *fname  );
177        void ReadParBBneg(          const char *fname  );
178        void ReadParBBpos(          const char *fname  );
179        void ReadParDesatBB(        const char *fname  );
180    
181        void CheckConnectors(UInt_t atime, GL_PARAM *glparam, TSQLServer *dbc);
182    
183        void Process( UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof, pamela::tof::TofEvent *tofl0 ); //
184        void Print(Option_t *option="");
185        void PrintTD();
186    
187    
188        Float_t GetdEdx_pmt(Int_t ipmt) { return eDEDXpmt[ipmt]; }  // 0-47 dEdx for each PMT for tracked events
189        Float_t GetCharge_pmt(Int_t ipmt) {return eZpmt[ipmt];}  // 0-47 Z for each PMT for tracked events
190        Float_t GetdEdx_pad(Int_t ipad) {return eDEDXpad[ipad];}  // 0-23 dEdx for each paddle for tracked events (no request of consistency between PMT's response when both on!)
191        Float_t GetCharge_pad(Int_t ipad) {return  eZpad[ipad];}  // 0-23 Z for each paddle for tracked events (no request of consistency)
192        Float_t GetdEdx_layer(Int_t ilay) {return eDEDXlayer[ilay];}  // 0-5 dEdx for each layer for tracked events
193        Float_t GetCharge_layer(Int_t ilay) {return eZlayer[ilay];}  // 0-5 Z for each layer for tracked events
194        Float_t GetdEdx_plane(Int_t ipl) {return eDEDXplane[ipl];}  // 0-2 dEdx for each plane for tracked events
195        Float_t GetCharge_plane(Int_t ipl) {return eZplane[ipl];}  // 0-2 Z for each plane for tracked events N.B.: here there is a soft request of consistency between the two layers...to be discussed!!
196        
197        Float_t GetInfo_pmt(Int_t ipmt) {return INFOpmt[ipmt];} // 0-47 pmt status
198        Float_t GetInfo_layer(Int_t ilay) {return INFOlayer[ilay];}  // 0-5 layer status
199    
200    
201    
202        //
203        //
204        ToFdEdx* GetToFdEdx(){return this;};
205    
206    
207    
208    
209        ClassDef(ToFdEdx,1);
210    };
211    
212    
213  /**  /**
214   * \brief Class which contains the tracker related variables   * \brief Class which contains the tracker related variables

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

  ViewVC Help
Powered by ViewVC 1.1.23