1#ifndef DEDXCORRECSVC_H_
2#define DEDXCORRECSVC_H_
4#include "GaudiKernel/IInterface.h"
5#include "GaudiKernel/Kernel.h"
6#include "GaudiKernel/Service.h"
13#include "GaudiKernel/IDataProviderSvc.h"
14#include "GaudiKernel/IIncidentListener.h"
21 DedxCorrecSvc(
const std::string& name, ISvcLocator* svcloc );
24 virtual StatusCode
queryInterface(
const InterfaceID& riid,
void** ppvUnknown);
29 void handle(
const Incident&);
31 double RungCorrec(
int runNO,
double ex )
const;
34 double SaturCorrec(
int layid,
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;
41 double DocaSinCorrec(
int layid,
double doca,
double enta,
double ex)
const;
42 double DipAngCorrec(
int layid,
double costheta,
double ex)
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,
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,
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,
double ex,
double costheta,
double t0 )
const;
51 double PathL(
int ntpFlag,
const Dedx_Helix& hel,
int layer,
int cellid,
double z )
const;
53 double D2I(
const double& cosTheta,
const double& D)
const;
54 double I2D(
const double& cosTheta,
const double&
I)
const;
63 void init_param_svc();
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);}
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));}
100 IntegerProperty m_run;
101 double m_valid[6796];
102 double m_wire_g[6796];
103 double m_rung[4][10000];
105 double m_docaeangle[40][40];
106 vector<double> m_venangle;
108 double m_enta[4][43];
109 double m_zdep[4][43];
110 double m_layer_g[43];
117 vector<double> cos_k;
118 vector<double> cos_b;
124 double Iner_Stepdoca;
176 int m_debug_i, m_debug_j;
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
void handle(const Incident &)
double T0Correc(double t0, double ex) const
double RungCorrec(int runNO, double ex) const
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
double LayerGainCorrec(int layid, double ex) const
double StandardCorrec(int runFlag, int ntpFlag, int runNO, double pathl, int wid, int layid, double adc, double dd, double eangle, double z, double costheta) const
double StandardHitCorrec(int calib_rec_Flag, int runFlag, int ntpFlag, int runNO, double pathl, int wid, int layid, double adc, double dd, double eangle, double costheta) const
double EntaCorrec(int layid, double enta, double ex) const
double SaturCorrec(int layid, double costheta, double ex) const
double StandardTrackCorrec(int calib_rec_Flag, int typFlag, int ntpFlag, int runNO, double ex, double costheta, double t0) 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 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 GlobalCorrec(double dedx) const
void set_flag(int calib_F)