BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
DedxCorrecSvc.h
Go to the documentation of this file.
1#ifndef DEDXCORRECSVC_H_
2#define DEDXCORRECSVC_H_
3
4#include "GaudiKernel/IInterface.h"
5#include "GaudiKernel/Kernel.h"
6#include "GaudiKernel/Service.h"
12
13#include "GaudiKernel/IDataProviderSvc.h"
14#include "GaudiKernel/IIncidentListener.h"
15
16
17class Identifier;
18
19class DedxCorrecSvc: public Service, virtual public IDedxCorrecSvc,virtual public IIncidentListener{
20public:
21 DedxCorrecSvc( const std::string& name, ISvcLocator* svcloc );
23
24 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvUnknown);
25 virtual StatusCode initialize();
26 virtual StatusCode finalize();
27
28 // Incident handler
29 void handle(const Incident&);
30
31 double RungCorrec( int runNO, int evtNO, double ex ) const;
32 double WireGainCorrec( int wireid,double ex) const;
33 double DriftDistCorrec(int layid, double ddrift, double ex) const;
34 double SaturCorrec(int layid,double costheta, double ex) const;
35 double CosthetaCorrec(double costheta, double ex) const;
36 double T0Correc(double t0, double ex) const;
37 double HadronCorrec( double costheta, double dedx ) const;
38 double ZdepCorrec(int layid,double zhit, double ex) const;
39 double EntaCorrec(int layid,double enta, double ex) const;
40 double LayerGainCorrec( int layid,double ex) const;
41 double DocaSinCorrec(int layid, double doca, double enta, double ex) const;
42 double DipAngCorrec(int layid, double costheta, double ex) const;
43 double GlobalCorrec(double dedx) const;
44 double CellCorrec( int ser, double adc, double dd, double enta,
45 double z, double costheta ) const;
46 double LayerCorrec( int layer, double z, double costheta, double ex ) const;
47 double TrkCorrec( double costheta, double dedx ) const;
48 double StandardCorrec( int runFlag, int ntpFlag, int runNO, int evtNO, double pathl, int wid, int layid, double adc, double dd, double eangle, double z, double costheta ) const;
49 double StandardHitCorrec( int calib_rec_Flag, int runFlag, int ntpFlag, int runNO, int evtNO, double pathl, int wid, int layid, double adc, double dd, double eangle, double costheta ) const;
50 double StandardTrackCorrec(int calib_rec_Flag, int typFlag, int ntpFlag, int runNO, int evtNO, double ex, double costheta, double t0 ) const;
51 double PathL( int ntpFlag, const Dedx_Helix& hel, int layer, int cellid, double z ) const;
52 // double PathLCosmic(const Helix& hel, int layer, int cellid, double z ,double sigmaz ) const;
53 double D2I(const double& cosTheta, const double& D) const;
54 double I2D(const double& cosTheta, const double& I) const;
55 void set_flag( int calib_F );
56 // correction according to large fabs(cos(theta))
57 double f_larcos(double x, int nbin);
58
59 private:
60 bool m_initConstFlg;
61
62 void init_param();
63 void init_param_svc();
64
65 // simple polynomials
66 double sq(double& x) const {return (x*x);}
67 double cub(double& x) const {return (x*x*x);}
68 double sq4(double& x) const {return (x*x*x*x);}
69 double sq5(double& x) const {return sq(x)*cub(x);}
70 double sq6(double& x) const {return cub(x)*cub(x);}
71 double sq7(double& x) const {return sq4(x)*cub(x);}
72 double sq8(double& x) const {return sq4(x)*sq4(x);}
73 double sq9(double& x) const {return sq4(x)*sq5(x);}
74 double sq10(double& x) const {return sq5(x)*sq5(x);}
75 double sq11(double& x) const {return sq5(x)*sq6(x);}
76 // Chebyshev's polynomials
77 double T0(){return 1;}
78 double T1(double& x) const {return x;}
79 double T2(double& x) const {return (2*sq(x)-1);}
80 double T3(double& x) const {return (4*cub(x)-3*x);}
81 double T4(double& x) const {return (8*sq4(x)-8*sq(x)+1);}
82 double T5(double& x) const {return (16*sq5(x)-20*cub(x)+5*x);}
83 double T6(double& x) const {return (32*sq6(x)-48*sq4(x)+18*sq(x)-1);}
84 double T7(double& x) const {return (64*sq7(x)-112*sq5(x)+56*cub(x)-7*x);}
85 double T8(double& x) const {return (128*sq8(x)-256*sq6(x)+160*sq4(x)-32*sq(x)+1);}
86 double T9(double& x) const {return (256*sq9(x)-576*sq7(x)+432*sq5(x)-120*cub(x)+9*x);}
87 double T10(double& x) const {return (512*sq10(x)-1280*sq8(x)+1120*sq6(x)-400*sq4(x)+50*sq(x)-1);}
88 double T11(double& x) const {return (1024*sq11(x)-2816*sq9(x)+2816*sq7(x)-1232*sq5(x)+220*cub(x)-11*x);}
89 double T12(double& x) const {return (2*x*T11(x)-T10(x));}
90 double T13(double& x) const {return (2*x*T12(x)-T11(x));}
91 double T14(double& x) const {return (2*x*T13(x)-T12(x));}
92 double T15(double& x) const {return (2*x*T14(x)-T13(x));}
93 double T16(double& x) const {return (2*x*T15(x)-T14(x));}
94 double T17(double& x) const {return (2*x*T16(x)-T15(x));}
95 double T18(double& x) const {return (2*x*T17(x)-T16(x));}
96 double T19(double& x) const {return (2*x*T18(x)-T17(x));}
97 double T20(double& x) const {return (2*x*T19(x)-T18(x));}
98
99 private:
100 IntegerProperty m_run;
101 double m_valid[6796];
102 double m_wire_g[6796];
103 double m_rung[6][100000];
104 double m_ddg[4][43];
105 double m_docaeangle[40][40];
106 vector<double> m_venangle;
107 double m_ggs[4][43];
108 double m_enta[4][43];
109 double m_zdep[4][43];
110 double m_layer_g[43];
111 double m_dedx_gain;
112 double m_dedx_resol;
113 int N_run;
114 double curve_par[5];
115 double sigma_par[6];
116
117 vector<double> cos_k;
118 vector<double> cos_b;
119
120 vector<double> t0_k;
121 vector<double> t0_b;
122
123
124 double Iner_Stepdoca;
125 double Out_Stepdoca;
126
127 double m_alpha;
128 double m_gamma;
129 double m_delta;
130 double m_power;
131 double m_ratio;
132
133 //int m_valid_flag;
134 /// correction : for individual cell ( calib_F & 2 )? ON:OFF
135
136
137 /// calibration flag : run by run correction ( calib_F & 1 )? ON : OFF
138 int m_rung_flag;
139
140 /// calibration flag : wire by wire correction ( calib_F & 2 )? ON : OFF
141 int m_wireg_flag;
142
143 /// calibration flag : electron dip angle correction ( calib_F & 4 )? ON : OFF
144 int m_ggs_flag;
145
146 /// calibration flag : drift distance ( calib_F & 8 ) ? ON : OFF
147 int m_ddg_flag;
148
149 /// calibration flag : t0 correction ( calib_F & 16 ) ? ON : OFF
150 int m_t0_flag;
151
152 /// calibration flag : hadron saturation correction ( calib_F & 32 ) ? ON : OFF
153 int m_sat_flag;
154
155
156
157 /// calibration flag : entrance angle depsndence ( calib_F & 16 )? ON : OFF
158 int m_enta_flag;
159 /// calibration flag : z depsndence ( calib_F & 32 )? ON : OFF
160 int m_zdep_flag;
161 /// correction : mdc layer gain ( calib_F & 64 )? ON:OFF
162 int m_layerg_flag;
163 /// correction : doca and sinenta correction ( calib_F & 128 )? ON:OFF
164 int m_dcasin_flag;
165 /// correction : Qsaturation correction ( calib_F & 256 )? ON:OFF
166 int m_dip_flag;
167 /// correction : mdc gain (run by run) ( calib_F & 512 )? ON:OFF
168 int m_mdcg_flag;
169 /// control flags
170 int m_init;
171 int m_par_flag;
172 /// mdc geometry
173 IMdcGeomSvc* geosvc;
174 IMagneticFieldSvc* m_pIMF;
175 bool m_debug;
176 int m_debug_i, m_debug_j;
177};
178
179#endif /* DEDXCORRECSVC_H_ */
Double_t x[10]
const DifComplex I
double CosthetaCorrec(double costheta, double ex) const
double D2I(const double &cosTheta, const double &D) const
double f_larcos(double x, int nbin)
virtual StatusCode finalize()
double LayerCorrec(int layer, double z, double costheta, double ex) const
double PathL(int ntpFlag, const Dedx_Helix &hel, int layer, int cellid, double z) const
double StandardTrackCorrec(int calib_rec_Flag, int typFlag, int ntpFlag, int runNO, int evtNO, double ex, double costheta, double t0) const
void handle(const Incident &)
double T0Correc(double t0, double ex) const
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
double LayerGainCorrec(int layid, double ex) const
double EntaCorrec(int layid, double enta, double ex) const
double SaturCorrec(int layid, double costheta, double ex) const
double StandardHitCorrec(int calib_rec_Flag, int runFlag, int ntpFlag, int runNO, int evtNO, double pathl, int wid, int layid, double adc, double dd, double eangle, double costheta) const
double CellCorrec(int ser, double adc, double dd, double enta, double z, double costheta) const
virtual StatusCode initialize()
double WireGainCorrec(int wireid, double ex) const
double HadronCorrec(double costheta, double dedx) const
double TrkCorrec(double costheta, double dedx) const
double RungCorrec(int runNO, int evtNO, double ex) const
double DriftDistCorrec(int layid, double ddrift, double ex) const
double DocaSinCorrec(int layid, double doca, double enta, double ex) const
double DipAngCorrec(int layid, double costheta, double ex) const
double ZdepCorrec(int layid, double zhit, double ex) const
double I2D(const double &cosTheta, const double &I) const
double StandardCorrec(int runFlag, int ntpFlag, int runNO, int evtNO, double pathl, int wid, int layid, double adc, double dd, double eangle, double z, double costheta) const
double GlobalCorrec(double dedx) const
void set_flag(int calib_F)
Helix parameter class.
Definition: Dedx_Helix.h:33
float costheta