1#ifndef MDCCALIBFUNSVC_H_
2#define MDCCALIBFUNSVC_H_
4#include "GaudiKernel/IInterface.h"
5#include "GaudiKernel/Kernel.h"
6#include "GaudiKernel/Service.h"
7#include "GaudiKernel/IIncidentListener.h"
9#include "GaudiKernel/IDataProviderSvc.h"
10#include "GaudiKernel/SmartDataPtr.h"
11#include "GaudiKernel/DataSvc.h"
12#include "CalibData/CalibModel.h"
13#include "CalibData/Mdc/MdcCalibData.h"
14#include "CalibDataSvc/ICalibRootSvc.h"
16#include "MdcCalibFunSvc/IMdcCalibFunSvc.h"
22 virtual public IIncidentListener{
27 virtual StatusCode
queryInterface(
const InterfaceID& riid,
void** ppvUnknown);
32 void handle(
const Incident&);
42 double getTprop(
int lay,
double z)
const;
48 double entrance = 0.0)
const ;
50 double entrance = 0.0)
const ;
56 double getSigma(
int layid,
int lr,
double dist,
57 double entrance = 0.0,
double tanlam = 0.0,
58 double z = 0.0,
double Q = 1000.0)
const ;
59 double getSigmaLR(
int layid,
int lr,
double dist,
60 double entrance = 0.0,
double tanlam = 0.0,
61 double z = 0.0,
double Q = 1000.0)
const ;
62 double getSigma1(
int layid,
int lr,
double dist,
63 double entrance = 0.0,
double tanlam = 0.0,
64 double z = 0.0,
double Q = 1000.0)
const ;
65 double getSigma2(
int layid,
int lr,
double dist,
66 double entrance = 0.0,
double tanlam = 0.0,
67 double z = 0.0,
double Q = 1000.0)
const ;
68 double getF(
int layid,
int lr,
double dist,
69 double entrance = 0.0,
double tanlam = 0.0,
70 double z = 0.0,
double Q = 1000.0)
const ;
73 double entrance = 0.0,
double tanlam = 0.0,
74 double z = 0.0,
double Q = 1000.0)
const ;
76 double entrance = 0.0,
double tanlam = 0.0,
77 double z = 0.0,
double Q = 1000.0)
const ;
81 void getXtpar(
int layid,
int entr,
int lr,
double par[])
const;
85 double getT0(
int layid,
int cellid)
const ;
86 double getT0(
int wireid)
const {
return m_t0[wireid]; }
87 double getDelT0(
int wireid)
const {
return m_delt0[wireid]; }
90 double getQtpar(
int layid,
int ord)
const;
92 double getWireEff(
int layid,
int cellid)
const ;
93 double getWireEff(
int wireid)
const {
return m_wireEff[wireid]; }
97 void getSdpar(
int layid,
int entr,
int lr,
double par[])
const;
107 static const int NWIRE = 6796;
108 static const int NLAYER = 43;
109 static const int NXTENTR = 18;
110 static const int NXTPAR = 8;
111 static const int NXTORD = 6;
112 static const int NSDBIN = 24;
115 bool initCalibConst();
117 double t2dPoly(
double drifttime,
int layid,
int cellid,
int lr,
118 double entrance = 0.0)
const ;
119 double t2dInter(
double drifttime,
int layid,
int cellid,
int lr,
120 double entrance = 0.0)
const ;
128 int getXtKey(
int layid,
int entr,
int lr,
int ord)
const;
129 int getSdKey(
int layid,
int entr,
int lr,
int bin)
const;
130 int getXtparId(
int layid,
int entr,
int lr,
int ord)
const;
131 int getSdparId(
int layid,
int entr,
int lr,
int bin)
const;
139 std::string m_xtfile;
142 bool m_readWireEffDb;
143 std::string m_wireEffFile;
146 double m_fixSigmaValue;
149 IDataProviderSvc* m_pCalDataSvc;
156 std::map<int, double> m_xtmap;
157 std::vector<double> m_xtpar;
159 std::vector<double> m_t0;
160 std::vector<double> m_delt0;
162 std::vector<double> m_qtpar0;
163 std::vector<double> m_qtpar1;
165 std::map<int, double> m_sdmap;
166 std::vector<double> m_sdpar;
168 std::map<int, double>::iterator m_xtiter;
169 std::map<int, double>::iterator m_sditer;
171 double m_wireEff[6796];
173 int m_nNewXt[
NLAYER][NXTENTR][2];
174 double m_vt[
NLAYER][NXTENTR][2][200];
175 double m_vd[
NLAYER][NXTENTR][2][200];
177 int m_nR2t[
NLAYER][NXTENTR][2];
178 double m_tR2t[
NLAYER][NXTENTR][2][200];
179 double m_sR2t[
NLAYER][NXTENTR][2][200];
181 static const int XTLAYER_INDEX = 11;
182 static const int XTLAYER_MASK = 0x1F800;
183 static const int XTLAYER_DECO = 0x3F;
185 static const int XTENTRA_INDEX = 6;
186 static const int XTENTRA_MASK = 0x7C0;
187 static const int XTENTRA_DECO = 0x1F;
189 static const int XTLR_INDEX = 4;
190 static const int XTLR_MASK = 0x30;
191 static const int XTLR_DECO = 0x3;
193 static const int XTORDER_INDEX = 0;
194 static const int XTORDER_MASK = 0xF;
195 static const int XTORDER_DECO = 0xF;
198 static const int SDLAYER_INDEX = 10;
199 static const int SDLAYER_MASK = 0xFC00;
200 static const int SDLAYER_DECO = 0x3F;
202 static const int SDENTRA_INDEX = 7;
203 static const int SDENTRA_MASK = 0x380;
204 static const int SDENTRA_DECO = 0x7;
206 static const int SDLR_INDEX = 5;
207 static const int SDLR_MASK = 0x60;
208 static const int SDLR_DECO = 0x3;
210 static const int SDBIN_INDEX = 0;
211 static const int SDBIN_MASK = 0x1F;
212 static const int SDBIN_DECO = 0x1F;
216 if(lay<8)
return 220.0;
220inline int MdcCalibFunSvc::getXtparId(
int layid,
int entr,
int lr,
222 int parId = (layid * 432) + (entr * 24) + (lr * 8) + ord;
226inline int MdcCalibFunSvc::getSdparId(
int layid,
int entr,
int lr,
228 int parId = (layid * 288) + (entr * 48) + (lr * 24) +
bin;
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per bin
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
int getNextXtpar(int &key, double &par)
virtual StatusCode finalize()
double getSigmaToT(int layid, int lr, double tdr, double entrance=0.0, double tanlam=0.0, double z=0.0, double Q=1000.0) const
int getSdEntrIndex(double entrance) const
TTree * getR2tTree(int layid) const
double getSigmaToTLR(int layid, int lr, double tdr, double entrance=0.0, double tanlam=0.0, double z=0.0, double Q=1000.0) const
void getSdpar(int layid, int entr, int lr, double par[]) const
double distToDriftTime(double dist, int layid, int cellid, int lr, double entrance=0.0) const
double getSigma2(int layid, int lr, double dist, double entrance=0.0, double tanlam=0.0, double z=0.0, double Q=1000.0) const
double getWireEff(int layid, int cellid) const
double getSigma(int layid, int lr, double dist, double entrance=0.0, double tanlam=0.0, double z=0.0, double Q=1000.0) const
double getWireEff(int wireid) const
double getT0(int layid, int cellid) const
double driftTimeToDist(double drifttime, int layid, int cellid, int lr, double entrance=0.0) const
double getSigmaLR(int layid, int lr, double dist, double entrance=0.0, double tanlam=0.0, double z=0.0, double Q=1000.0) const
double getQtpar(int layid, int ord) const
TTree * getNewXtparTree(int layid, int entr, int lr) const
void getXtpar(int layid, int entr, int lr, double par[]) const
MdcCalibFunSvc(const std::string &name, ISvcLocator *svcloc)
double getSigma1(int layid, int lr, double dist, double entrance=0.0, double tanlam=0.0, double z=0.0, double Q=1000.0) const
int getXtEntrIndex(double entrance) const
double getDelT0(int wireid) const
double getVprop(int lay) const
virtual StatusCode initialize()
void handle(const Incident &)
double getT0(int wireid) const
int getNextSdpar(int &key, double &par)
double getTprop(int lay, double z) const
double getF(int layid, int lr, double dist, double entrance=0.0, double tanlam=0.0, double z=0.0, double Q=1000.0) const
double getTimeWalk(int layid, double Q) const
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)