/[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.25 by mocchiut, Wed Dec 2 22:41:01 2009 UTC
# Line 1  Line 1 
1  /**  /**
2   * \file ToFLevel2.h   * \file ToFLevel2.h
3   * \author Gianfranca DeRosa / Wolfgang Menn   * \author Gianfranca DeRosa / Wolfgang Menn / Rita Carbone with E. M. supervision
4   */   */
5    
6  #ifndef ToFLevel2_h  #ifndef ToFLevel2_h
# 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 59  class ToFPMT : public TObject { Line 90  class ToFPMT : public TObject {
90    
91   public:   public:
92      Int_t pmt_id;     ///<the identification number of the PMT from 0 to 47      Int_t pmt_id;     ///<the identification number of the PMT from 0 to 47
93      Float_t adc;      ///<raw ADC value for this PMT      Float_t adc;      ///<raw ADC value for this PMT
94      Float_t tdc;      ///<raw TDC value for this PMT      Float_t tdc;      ///<raw TDC value for this PMT
95      Float_t tdc_tw;   ///<time-walk corrected TDC value for this PMT      Float_t tdc_tw;   ///<time-walk corrected TDC value for this PMT
96      //      //
# Line 69  class ToFPMT : public TObject { Line 100  class ToFPMT : public TObject {
100      ToFPMT* GetToFPMT(){return this;};      ToFPMT* GetToFPMT(){return this;};
101      void Clear(Option_t *t="");      void Clear(Option_t *t="");
102    
103        ClassDef(ToFPMT,2);
104    };
105    
106    /**
107     * \brief  Class used to calibrate adc to dEdx for each PMT
108     *
109     * Class used to calibrate adc to dEdx for each PMT
110     */
111    class ToFdEdx : public TObject {
112    
113      ClassDef(ToFPMT,2);   private:
114        //
115        ToFGeom  eGeom;  // ToF geometry
116        //
117        Float_t  adc_he;
118        TArrayF eDEDXpmt;  // 0-47  pmt dEdx
119        // parameters:
120        TArrayF PMTsat;  // 0-47  saturation parameters
121        Float_t adc[48];
122        //
123    
124        TArrayF parAtt[48];      // 48 x 6
125        TArrayF parPos[48];      // 48 x 4
126        TArrayF parDesatBB[48];  // 48 x 3
127        TArrayF parBBneg[48];    // 48 x 3
128        TArrayF  parBBpos;    // 48 x 1
129    
130        double f_adcPC( float x );
131        double f_BB( TArrayF &p, float x );
132        double f_BB5B( float x );
133        double f_att( TArrayF &p, float x ) ;
134        double f_att5B( float x );
135        double f_desatBB( TArrayF &p, float x );  
136        double f_desatBB5B( float x );
137        double f_pos( TArrayF &p, float x );
138        double f_pos5B( float x );
139        float Get_adc_he( int id, float pl_x[6], float pl_y[6]);
140    
141        Bool_t conn[12];
142    
143        UInt_t ts[12];
144        UInt_t te[12];    
145      
146        
147     public:
148        ToFdEdx();   // class constructor
149        ~ToFdEdx(){ Delete(); };  // class distructor
150        //
151        void Clear(Option_t *option="");
152        void Delete(Option_t *option="") { Clear(); }
153    
154        void Init(pamela::tof::TofEvent *tofl0 );  // init parameters
155        void Init(Int_t i, Int_t j, Float_t adce);
156        void Define_PMTsat();
157    
158        void ReadParAtt(            const char *fname  );
159        void ReadParPos(            const char *fname  );
160        void ReadParBBneg(          const char *fname  );
161        void ReadParBBpos(          const char *fname  );
162        void ReadParDesatBB(        const char *fname  );
163    
164        void CheckConnectors(UInt_t atime, GL_PARAM *glparam, TSQLServer *dbc);
165    
166        void Process( UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof); //
167        void Print(Option_t *option="");
168    
169        Float_t GetdEdx_pmt(Int_t ipmt) { return eDEDXpmt[ipmt]; }  // 0-47 dEdx for each PMT for tracked events
170        //
171        ToFdEdx* GetToFdEdx(){return this;};
172        ClassDef(ToFdEdx,2);
173  };  };
174    
175    

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

  ViewVC Help
Powered by ViewVC 1.1.23