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 |
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 |
// |
// |
35 |
#define toftrk toftrk_ |
#define toftrk toftrk_ |
36 |
extern "C" int toftrk(); |
extern "C" int toftrk(); |
37 |
#define rdtofcal rdtofcal_ |
#define rdtofcal rdtofcal_ |
38 |
extern "C" int rdtofcal(char [], int *); |
//extern "C" int rdtofcal(char [], int *); |
39 |
|
extern "C" int rdtofcal(const char *, int *); |
40 |
|
|
41 |
// |
// |
42 |
// class which contains track related variables |
// class which contains track related variables |
49 |
#define ZTOF32 -24.34 |
#define ZTOF32 -24.34 |
50 |
|
|
51 |
|
|
52 |
|
class ToFGeom : public TObject { |
53 |
|
|
54 |
|
private: |
55 |
|
TArrayI ePlane, eXY; |
56 |
|
|
57 |
|
public: |
58 |
|
ToFGeom() { |
59 |
|
int plane[24] = { |
60 |
|
0, 0, 0, 0, 0, 0, 0, 0, |
61 |
|
1, 1, 1, 1, 1, 1, |
62 |
|
2, 2, |
63 |
|
3, 3, |
64 |
|
4, 4, 4, |
65 |
|
5, 5, 5 |
66 |
|
}; |
67 |
|
int plXY[6]= { 2, 1, 1, 2, 2, 1 }; // X==1, Y==2 */ |
68 |
|
ePlane.Set(24,plane); |
69 |
|
eXY.Set(6,plXY); |
70 |
|
} |
71 |
|
|
72 |
|
int GetPad( int idpmt) { return (int)((idpmt+0.5)/2.); } |
73 |
|
int GetPlane( int idpmt) { return ePlane[ GetPad(idpmt) ]; } |
74 |
|
int GetXY( int idpmt) { return eXY[ GetPlane(idpmt) ]; } |
75 |
|
|
76 |
|
ClassDef(ToFGeom,1); |
77 |
|
|
78 |
|
}; |
79 |
|
|
80 |
|
|
81 |
/** |
/** |
82 |
* \brief Class which contains the PMT data |
* \brief Class which contains the PMT data |
83 |
* |
* |
91 |
|
|
92 |
public: |
public: |
93 |
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 |
94 |
Float_t adc; ///<raw ADC value for this PMT |
Float_t adc; ///<raw ADC value for this PMT |
95 |
Float_t tdc; ///<raw TDC value for this PMT |
Float_t tdc; ///<raw TDC value for this PMT |
96 |
Float_t tdc_tw; ///<time-walk corrected TDC value for this PMT |
Float_t tdc_tw; ///<time-walk corrected TDC value for this PMT |
97 |
// |
// |
101 |
ToFPMT* GetToFPMT(){return this;}; |
ToFPMT* GetToFPMT(){return this;}; |
102 |
void Clear(Option_t *t=""); |
void Clear(Option_t *t=""); |
103 |
|
|
104 |
|
ClassDef(ToFPMT,2); |
105 |
|
}; |
106 |
|
|
107 |
|
/** |
108 |
|
* \brief Class used to calibrate adc to dEdx for each PMT |
109 |
|
* |
110 |
|
* Class used to calibrate adc to dEdx for each PMT |
111 |
|
*/ |
112 |
|
class ToFdEdx : public TObject { |
113 |
|
|
114 |
|
private: |
115 |
|
// |
116 |
|
ToFGeom eGeom; // ToF geometry |
117 |
|
// |
118 |
|
Float_t adc_he; |
119 |
|
TArrayF *eDEDXpmt; // 0-47 pmt dEdx |
120 |
|
// parameters: |
121 |
|
TArrayF PMTsat; // 0-47 saturation parameters |
122 |
|
Float_t adc[48]; |
123 |
|
// |
124 |
|
|
125 |
|
TArrayF parAtt[48]; // 48 x 6 |
126 |
|
TArrayF parPos[48]; // 48 x 4 |
127 |
|
TArrayF parDesatBB[48]; // 48 x 3 |
128 |
|
TArrayF parBBneg[48]; // 48 x 3 |
129 |
|
TArrayF parBBpos; // 48 x 1 |
130 |
|
|
131 |
|
double f_adcPC( float x ); |
132 |
|
double f_BB( TArrayF &p, float x ); |
133 |
|
double f_BB5B( float x ); |
134 |
|
double f_att( TArrayF &p, float x ) ; |
135 |
|
double f_att5B( float x ); |
136 |
|
double f_desatBB( TArrayF &p, float x ); |
137 |
|
double f_desatBB5B( float x ); |
138 |
|
double f_pos( TArrayF &p, float x ); |
139 |
|
double f_pos5B( float x ); |
140 |
|
float Get_adc_he( int id, float pl_x[6], float pl_y[6]); |
141 |
|
|
142 |
|
Bool_t conn[12]; |
143 |
|
|
144 |
|
UInt_t ts[12]; |
145 |
|
UInt_t te[12]; |
146 |
|
|
147 |
|
|
148 |
|
public: |
149 |
|
ToFdEdx(); // class constructor |
150 |
|
~ToFdEdx(); // class distructor |
151 |
|
// |
152 |
|
void Clear(Option_t *option=""); |
153 |
|
void Delete(Option_t *option=""); |
154 |
|
|
155 |
ClassDef(ToFPMT,2); |
void Init(pamela::tof::TofEvent *tofl0 ); // init parameters |
156 |
|
void Init(Int_t i, Int_t j, Float_t adce); |
157 |
|
void Define_PMTsat(); |
158 |
|
|
159 |
|
void ReadParAtt( const char *fname ); |
160 |
|
void ReadParPos( const char *fname ); |
161 |
|
void ReadParBBneg( const char *fname ); |
162 |
|
void ReadParBBpos( const char *fname ); |
163 |
|
void ReadParDesatBB( const char *fname ); |
164 |
|
|
165 |
|
void CheckConnectors(UInt_t atime, GL_PARAM *glparam, TSQLServer *dbc); |
166 |
|
|
167 |
|
void Process( UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof, Int_t exitat=-1); // |
168 |
|
void Print(Option_t *option=""); |
169 |
|
|
170 |
|
// Float_t GetdEdx_pmt(Int_t ipmt) { return (Float_t)eDEDXpmt[ipmt]; } // 0-47 dEdx for each PMT for tracked events |
171 |
|
Float_t GetdEdx_pmt(Int_t ipmt) { return eDEDXpmt->At(ipmt); } // 0-47 dEdx for each PMT for tracked events |
172 |
|
// |
173 |
|
ToFdEdx* GetToFdEdx(){return this;}; |
174 |
|
ClassDef(ToFdEdx,3); |
175 |
}; |
}; |
176 |
|
|
177 |
|
|