CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Simulation/BOOST/MdcTunningSvc/MdcTunningSvc-00-00-26/MdcTunningSvc/MdcTunningSvc.h
Go to the documentation of this file.
1#ifndef MDCTUNNINGSVC_H_
2#define MDCTUNNINGSVC_H_
3
4#include "GaudiKernel/IInterface.h"
5#include "GaudiKernel/Kernel.h"
6#include "GaudiKernel/Service.h"
7#include "GaudiKernel/IIncidentListener.h"
8#include "GaudiKernel/IDataProviderSvc.h"
9#include "BesMdcRes.hh"
10#include "MdcTunningSvc/IMdcTunningSvc.h"
11//#include <mysql.h>
12#include "DatabaseSvc/IDatabaseSvc.h"
13#include <map>
14#include <vector>
15
16class MdcTunningSvc: public Service, virtual public IMdcTunningSvc,
17 virtual public IIncidentListener{
18 public:
19 MdcTunningSvc( const std::string& name, ISvcLocator* svcloc );
21
22 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvUnknown);
23 virtual StatusCode initialize();
24 virtual StatusCode finalize();
25
26 // Incident handler
27 void handle(const Incident&);
29 //huangb add
30 bool setMcEff(std::string eff_con);
31 bool setMcRes();
32 //bool setMcRes2();
33 bool setMcRes2(std::string res_con);
34 bool setMcRes3(std::string res_con);
36
38 void setMdcRes(std::string path);
39 double NewSig(int layerId, double driftD);
40 double DeldriftD(int layerId,double driftD);
41 double Delcostta(int layerId,double costta);
42 double GetEff(int layerId,int cellId,double driftD,double cosTheta,int posFlag);
43 double GetRes(int layerId,int cellId,double driftD,double cosTheta,int posFlag,double entranceAngle,double& mean,double& sigma);
44 double GetRes2(int layerId,int cellId,double driftD,double cosTheta,int posFlag,double entranceAngle,double& f,double& mean1,double& sigma1,double& mean2,double& sigma2);
45 double GetRes3(int layerId,int cellId,double driftD,double cosTheta,int posFlag,double entranceAngle,double& f,double& mean1,double& sigma1,double& mean2,double& sigma2,double& ResLargest,double& ResSmallest,double& ResRatio);
46 double ResvEntr(int layerId,double enterA,int ilr,double driftD);
47 double DelEtr_Sig(int lay,double enterA,int ilr,double driftD);
48
49 double get_docaEff(int i,int j){ return docaEff[i][j];};
50 double get_thetaEff(int i,int j){ return thetaEff[i][j];};
51 double get_cellEff(int i,int j){return cellEff[i][j];}
52
53 private:
54
55 static const int docaNo=60;
56 static const int thetaNo=40;
57 int cellNo[43];
58 double docaEff[43][docaNo];
59 double thetaEff[43][thetaNo];
60 double cellEff[43][288];
61 double docaRes[43][docaNo][2][2];
62 double docaF[43][docaNo][2];
63 double docaMean1[43][docaNo][2];
64 double docaSigma1[43][docaNo][2];
65 double docaMean2[43][docaNo][2];
66 double docaSigma2[43][docaNo][2];
67 //added by liukai 2012-6-4
68 //residual range in every residual distribution for hitOnTrk
69 double resLargest[43][docaNo][2];
70 double resSmallest[43][docaNo][2];
71 double resRatio[43][docaNo][2];
72 double resLargest_2[43][docaNo][2];
73 double resSmallest_2[43][docaNo][2];
74 double resRatio_2[43][docaNo][2];
75
76 double docaEff_2[43][docaNo];
77 double thetaEff_2[43][thetaNo];
78 double cellEff_2[43][288];
79 double docaRes_2[43][docaNo][2][2];
80 double docaF_2[43][docaNo][2];
81 double docaMean1_2[43][docaNo][2];
82 double docaSigma1_2[43][docaNo][2];
83 double docaMean2_2[43][docaNo][2];
84 double docaSigma2_2[43][docaNo][2];
85
86 std::string m_ParBossVer;//added by liukai
87 double dD[18];
88 int m_EndcapTuning;
89 bool m_dbFlag;
90 std::string m_effFile;
91 std::string m_resFile;
92 std::string m_effFile_endcap;
93 std::string m_resFile_endcap;
94 std::string m_path;
95 BesMdcRes* m_BesMdcRes;
96 //huangb add
97 bool m_fromDB;
98 IDataProviderSvc* m_eventSvc;
99 // MYSQL *conn;
100 std::string host;
101 std::string dbName;
102 std::string table;
103 std::string userName;
104 std::string password;
105 unsigned int serialNo;
106
107 IDatabaseSvc* m_dbsvc;
108};
109
110#endif
virtual StatusCode finalize()
double DelEtr_Sig(int lay, double enterA, int ilr, double driftD)
void setMdcRes(std::string path)
bool setMcRes2(std::string res_con)
bool setMcRes3(std::string res_con)
StatusCode getMdcTuningTableInfo()
double Delcostta(int layerId, double costta)
void handle(const Incident &)
BesMdcRes * getMdcRes()
double ResvEntr(int layerId, double enterA, int ilr, double driftD)
bool setMcEff(std::string eff_con)
double NewSig(int layerId, double driftD)
double DeldriftD(int layerId, double driftD)
bool initTuningConst()
virtual StatusCode initialize()
double GetRes(int layerId, int cellId, double driftD, double cosTheta, int posFlag, double entranceAngle, double &mean, double &sigma)
double GetEff(int layerId, int cellId, double driftD, double cosTheta, int posFlag)
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
MdcTunningSvc(const std::string &name, ISvcLocator *svcloc)
double GetRes2(int layerId, int cellId, double driftD, double cosTheta, int posFlag, double entranceAngle, double &f, double &mean1, double &sigma1, double &mean2, double &sigma2)
double GetRes3(int layerId, int cellId, double driftD, double cosTheta, int posFlag, double entranceAngle, double &f, double &mean1, double &sigma1, double &mean2, double &sigma2, double &ResLargest, double &ResSmallest, double &ResRatio)