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