BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
RealizationSvc Class Reference

#include <RealizationSvc.h>

+ Inheritance diagram for RealizationSvc:

Public Member Functions

 RealizationSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~RealizationSvc ()
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 
void handle (const Incident &)
 
void readDB (int runNo)
 
void updateRealData ()
 
int getInitEvtID ()
 
void setInitEvtID (int i)
 
void setLuminosity (float i)
 
float getLuminosity ()
 
float getLuminosity (int runNo)
 
void setBunchPosX (double i)
 
void setBunchPosY (double i)
 
void setBunchPosZ (double i)
 
void setBunchSizeX (double i)
 
void setBunchSizeY (double i)
 
void setBunchSizeZ (double i)
 
double getBunchPosX ()
 
double getBunchPosY ()
 
double getBunchPosZ ()
 
double getBunchSizeX ()
 
double getBunchSizeY ()
 
double getBunchSizeZ ()
 
double getTrgGain (int cry_id)
 
void setRunEvtNum (int i)
 
int getRunEvtNum ()
 
void setTrgTable (std::vector< uint32_t > i)
 
std::vector< uint32_t > getTrgTable ()
 
int getEtotDataSteps ()
 
int getVthBEtotH ()
 
int getVthEEtotH ()
 
int getVthEtotL ()
 
int getVthEtotM ()
 
int getVthBLZ ()
 
int getVthDiffB ()
 
int getVthDiffE ()
 
int getVthBalBLK ()
 
int getVthBalEEMC ()
 
int getVthDiffMin ()
 
void setBgFileName (std::vector< std::string > i)
 
std::vector< std::string > getBgFileName ()
 
std::vector< std::string > getBgFileName (std::string query)
 
float getRunTotalTime ()
 
float getTauValue ()
 
std::vector< double > getRunInfo ()
 
std::vector< std::string > getTofThreshold ()
 
std::vector< int > getRunList ()
 
int getRunId ()
 
void setRunId (int i)
 
bool UseDBFlag ()
 
bool ifReadBunch ()
 
bool ifReadTrg ()
 
bool ifReadRandTrg ()
 
bool ifReadTFEE ()
 
 RealizationSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~RealizationSvc ()
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 
void handle (const Incident &)
 
void readDB (int runNo)
 
void updateRealData ()
 
int getInitEvtID ()
 
void setInitEvtID (int i)
 
void setLuminosity (float i)
 
float getLuminosity ()
 
float getLuminosity (int runNo)
 
void setBunchPosX (double i)
 
void setBunchPosY (double i)
 
void setBunchPosZ (double i)
 
void setBunchSizeX (double i)
 
void setBunchSizeY (double i)
 
void setBunchSizeZ (double i)
 
double getBunchPosX ()
 
double getBunchPosY ()
 
double getBunchPosZ ()
 
double getBunchSizeX ()
 
double getBunchSizeY ()
 
double getBunchSizeZ ()
 
double getTrgGain (int cry_id)
 
void setRunEvtNum (int i)
 
int getRunEvtNum ()
 
void setTrgTable (std::vector< uint32_t > i)
 
std::vector< uint32_t > getTrgTable ()
 
int getEtotDataSteps ()
 
int getVthBEtotH ()
 
int getVthEEtotH ()
 
int getVthEtotL ()
 
int getVthEtotM ()
 
int getVthBLZ ()
 
int getVthDiffB ()
 
int getVthDiffE ()
 
int getVthBalBLK ()
 
int getVthBalEEMC ()
 
int getVthDiffMin ()
 
void setBgFileName (std::vector< std::string > i)
 
std::vector< std::string > getBgFileName ()
 
std::vector< std::string > getBgFileName (std::string query)
 
float getRunTotalTime ()
 
float getTauValue ()
 
std::vector< double > getRunInfo ()
 
std::vector< std::string > getTofThreshold ()
 
std::vector< int > getRunList ()
 
int getRunId ()
 
void setRunId (int i)
 
bool UseDBFlag ()
 
bool ifReadBunch ()
 
bool ifReadTrg ()
 
bool ifReadRandTrg ()
 
bool ifReadTFEE ()
 

Additional Inherited Members

- Static Public Member Functions inherited from IRealizationSvc
static const InterfaceID & interfaceID ()
 
static const InterfaceID & interfaceID ()
 

Detailed Description

Constructor & Destructor Documentation

◆ RealizationSvc() [1/2]

RealizationSvc::RealizationSvc ( const std::string &  name,
ISvcLocator *  svcloc 
)

◆ ~RealizationSvc() [1/2]

RealizationSvc::~RealizationSvc ( )
inline

◆ RealizationSvc() [2/2]

RealizationSvc::RealizationSvc ( const std::string &  name,
ISvcLocator *  svcloc 
)

◆ ~RealizationSvc() [2/2]

RealizationSvc::~RealizationSvc ( )
inline

Member Function Documentation

◆ finalize() [1/2]

StatusCode RealizationSvc::finalize ( )
virtual

Definition at line 93 of file RealizationSvc.cxx.

93 {
94 MsgStream log(messageService(), name());
95 log << MSG::INFO << "RealizationSvc::finalize()" << endreq;
96
97 return StatusCode::SUCCESS;
98}

◆ finalize() [2/2]

virtual StatusCode RealizationSvc::finalize ( )
virtual

◆ getBgFileName() [1/4]

std::vector< std::string > RealizationSvc::getBgFileName ( )
inline

Definition at line 86 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

86{ return m_bgfilename; }

Referenced by MixerAlg::execute(), and MixerAlg::initialize().

◆ getBgFileName() [2/4]

std::vector< std::string > RealizationSvc::getBgFileName ( )
inline

◆ getBgFileName() [3/4]

std::vector< std::string > RealizationSvc::getBgFileName ( std::string  query)

Definition at line 146 of file RealizationSvc.cxx.

146 {
147 MsgStream log( messageService(), name() );
149
150 std::vector<std::string> Bgfilename;
151 Bgfilename.clear();
152
153 std::vector<std::string> fileInfor;
154 ConnectionProvider::eRet e = m_connect->getReadBackgroundInfo(fileInfor,query);
155 if(e != 0 ) {
156 log << MSG::ERROR << "Could not find background infor., exit." << endreq;
157 exit(1);
158 }
159
160 for(unsigned int i = 0; i < fileInfor.size(); i+=2)
161 {
162 Bgfilename.push_back(fileInfor[i]+"/"+fileInfor[i+1]);
163 }
164 fileInfor.clear();
165
166 for(unsigned int i = 0; i < Bgfilename.size(); i++) {
167 log << MSG::INFO << "Background file name: " << Bgfilename[i] << endreq;
168 }
169
170 return Bgfilename;
171}
ConnectionProvider::eRet getReadBackgroundInfo(std::vector< std::string > &fileInfor, int runNo)

◆ getBgFileName() [4/4]

std::vector< std::string > RealizationSvc::getBgFileName ( std::string  query)

◆ getBunchPosX() [1/2]

double RealizationSvc::getBunchPosX ( )
inline

Definition at line 47 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

47{ return m_bunch_x; }

Referenced by G4HepMCInterface::HepMC2G4().

◆ getBunchPosX() [2/2]

double RealizationSvc::getBunchPosX ( )
inline

◆ getBunchPosY() [1/2]

double RealizationSvc::getBunchPosY ( )
inline

Definition at line 48 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

48{ return m_bunch_y; }

Referenced by G4HepMCInterface::HepMC2G4().

◆ getBunchPosY() [2/2]

double RealizationSvc::getBunchPosY ( )
inline

◆ getBunchPosZ() [1/2]

double RealizationSvc::getBunchPosZ ( )
inline

Definition at line 49 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

49{ return m_bunch_z; }

Referenced by G4HepMCInterface::HepMC2G4().

◆ getBunchPosZ() [2/2]

double RealizationSvc::getBunchPosZ ( )
inline

◆ getBunchSizeX() [1/2]

double RealizationSvc::getBunchSizeX ( )
inline

Definition at line 50 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

50{ return m_sigma_x; }

Referenced by G4HepMCInterface::HepMC2G4().

◆ getBunchSizeX() [2/2]

double RealizationSvc::getBunchSizeX ( )
inline

◆ getBunchSizeY() [1/2]

double RealizationSvc::getBunchSizeY ( )
inline

Definition at line 51 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

51{ return m_sigma_y; }

Referenced by G4HepMCInterface::HepMC2G4().

◆ getBunchSizeY() [2/2]

double RealizationSvc::getBunchSizeY ( )
inline

◆ getBunchSizeZ() [1/2]

double RealizationSvc::getBunchSizeZ ( )
inline

Definition at line 52 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

52{ return m_sigma_z; }

Referenced by G4HepMCInterface::HepMC2G4().

◆ getBunchSizeZ() [2/2]

double RealizationSvc::getBunchSizeZ ( )
inline

◆ getEtotDataSteps() [1/2]

int RealizationSvc::getEtotDataSteps ( )
inline

Definition at line 73 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

73{ return m_EtotDataSteps; }

◆ getEtotDataSteps() [2/2]

int RealizationSvc::getEtotDataSteps ( )
inline

◆ getInitEvtID() [1/2]

int RealizationSvc::getInitEvtID ( )
inline

Definition at line 34 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

34{ return m_initEvtID; }

Referenced by McContext::McContext().

◆ getInitEvtID() [2/2]

int RealizationSvc::getInitEvtID ( )
inline

◆ getLuminosity() [1/4]

float RealizationSvc::getLuminosity ( )
inline

Definition at line 38 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

38{ return m_lumi; }

Referenced by McContext::McContext().

◆ getLuminosity() [2/4]

float RealizationSvc::getLuminosity ( )
inline

◆ getLuminosity() [3/4]

float RealizationSvc::getLuminosity ( int  runNo)

Definition at line 131 of file RealizationSvc.cxx.

131 {
133
134 MsgStream log( messageService(), name() );
135 std::string sLum;
136 ConnectionProvider::eRet e = m_connect->getReadLumInfo(sLum,runNo, m_SftVer, m_ParVer, m_bossRelease);
137 if(e != 0 ) {
138 log << MSG::ERROR << "Could not find Luminosity infor., exit." << endreq;
139 exit(1);
140 }
141 m_lumi = std::atof(sLum.c_str());
142 log << MSG::INFO << "Luminosity is " << m_lumi << " in Run " << runNo << endreq;
143 return m_lumi;
144}
int runNo
Definition: DQA_TO_DB.cxx:12
ConnectionProvider::eRet getReadLumInfo(std::string &Lum, int runNo, std::string SftVer, std::string ParVer, std::string BossRelease)

◆ getLuminosity() [4/4]

float RealizationSvc::getLuminosity ( int  runNo)

◆ getRunEvtNum() [1/2]

int RealizationSvc::getRunEvtNum ( )
inline

Definition at line 62 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

62{ return m_RunEvtNum; }

◆ getRunEvtNum() [2/2]

int RealizationSvc::getRunEvtNum ( )
inline

◆ getRunId() [1/2]

◆ getRunId() [2/2]

int RealizationSvc::getRunId ( )
inline

◆ getRunInfo() [1/2]

std::vector< double > RealizationSvc::getRunInfo ( )
inline

Definition at line 94 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

94{return m_runInfo; }

◆ getRunInfo() [2/2]

std::vector< double > RealizationSvc::getRunInfo ( )
inline

◆ getRunList() [1/2]

std::vector< int > RealizationSvc::getRunList ( )
inline

Definition at line 100 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

100{ return m_runIdList; }

Referenced by McContext::McContext().

◆ getRunList() [2/2]

std::vector< int > RealizationSvc::getRunList ( )
inline

◆ getRunTotalTime() [1/2]

float RealizationSvc::getRunTotalTime ( )
inline

Definition at line 90 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

90{ return m_runTotalTime; }

Referenced by MixerAlg::execute().

◆ getRunTotalTime() [2/2]

float RealizationSvc::getRunTotalTime ( )
inline

◆ getTauValue() [1/2]

float RealizationSvc::getTauValue ( )
inline

Definition at line 91 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

91{ return m_tauValue; }

Referenced by MixerAlg::execute().

◆ getTauValue() [2/2]

float RealizationSvc::getTauValue ( )
inline

◆ getTofThreshold() [1/2]

std::vector< std::string > RealizationSvc::getTofThreshold ( )
inline

Definition at line 97 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

97{ return m_tfee; }

◆ getTofThreshold() [2/2]

std::vector< std::string > RealizationSvc::getTofThreshold ( )
inline

◆ getTrgGain() [1/2]

double RealizationSvc::getTrgGain ( int  cry_id)
inline

Definition at line 54 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

54{ return m_trgGain[cry_id]; }

Referenced by BesTrigL1::getEmcAnalogSig(), and EmcTCFinder::setEmcDigi().

◆ getTrgGain() [2/2]

double RealizationSvc::getTrgGain ( int  cry_id)
inline

◆ getTrgTable() [1/2]

std::vector< uint32_t > RealizationSvc::getTrgTable ( )
inline

Definition at line 70 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

70{ return m_trgTable; }

Referenced by BesGlobalTrigSvc::handle().

◆ getTrgTable() [2/2]

std::vector< uint32_t > RealizationSvc::getTrgTable ( )
inline

◆ getVthBalBLK() [1/2]

int RealizationSvc::getVthBalBLK ( )
inline

◆ getVthBalBLK() [2/2]

int RealizationSvc::getVthBalBLK ( )
inline

◆ getVthBalEEMC() [1/2]

int RealizationSvc::getVthBalEEMC ( )
inline

Definition at line 82 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

82{ return m_VthBalEEMC; }

Referenced by BesGlobalTrigSvc::getL1EBL_EC().

◆ getVthBalEEMC() [2/2]

int RealizationSvc::getVthBalEEMC ( )
inline

◆ getVthBEtotH() [1/2]

int RealizationSvc::getVthBEtotH ( )
inline

Definition at line 74 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

74{ return m_VthBEtotH; }

Referenced by BesGlobalTrigSvc::getL1ETOT_BR().

◆ getVthBEtotH() [2/2]

int RealizationSvc::getVthBEtotH ( )
inline

◆ getVthBLZ() [1/2]

int RealizationSvc::getVthBLZ ( )
inline

Definition at line 78 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

78{ return m_VthBLZ; }

Referenced by BesGlobalTrigSvc::getL1EBL_Z().

◆ getVthBLZ() [2/2]

int RealizationSvc::getVthBLZ ( )
inline

◆ getVthDiffB() [1/2]

int RealizationSvc::getVthDiffB ( )
inline

Definition at line 79 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

79{ return m_VthDiffB; }

Referenced by BesGlobalTrigSvc::getL1EDIFF_BR().

◆ getVthDiffB() [2/2]

int RealizationSvc::getVthDiffB ( )
inline

◆ getVthDiffE() [1/2]

int RealizationSvc::getVthDiffE ( )
inline

Definition at line 80 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

80{ return m_VthDiffE; }

Referenced by BesGlobalTrigSvc::getL1EDIFF_EC().

◆ getVthDiffE() [2/2]

int RealizationSvc::getVthDiffE ( )
inline

◆ getVthDiffMin() [1/2]

int RealizationSvc::getVthDiffMin ( )
inline

Definition at line 83 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

83{ return m_VthDiffMin; }

◆ getVthDiffMin() [2/2]

int RealizationSvc::getVthDiffMin ( )
inline

◆ getVthEEtotH() [1/2]

int RealizationSvc::getVthEEtotH ( )
inline

Definition at line 75 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

75{ return m_VthEEtotH; }

Referenced by BesGlobalTrigSvc::getL1ETOT_EC().

◆ getVthEEtotH() [2/2]

int RealizationSvc::getVthEEtotH ( )
inline

◆ getVthEtotL() [1/2]

int RealizationSvc::getVthEtotL ( )
inline

Definition at line 76 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

76{ return m_VthEtotL; }

Referenced by BesGlobalTrigSvc::getL1ETOT_L().

◆ getVthEtotL() [2/2]

int RealizationSvc::getVthEtotL ( )
inline

◆ getVthEtotM() [1/2]

int RealizationSvc::getVthEtotM ( )
inline

Definition at line 77 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

77{ return m_VthEtotM; }

Referenced by BesGlobalTrigSvc::getL1ETOT_M().

◆ getVthEtotM() [2/2]

int RealizationSvc::getVthEtotM ( )
inline

◆ handle() [1/2]

void RealizationSvc::handle ( const Incident &  inc)

Definition at line 111 of file RealizationSvc.cxx.

111 {
112 MsgStream log( messageService(), name() );
113 log << MSG::DEBUG << "handle: " << inc.type() << endreq;
114 if ( inc.type() == "NewRun" ){
115 log << MSG::DEBUG << "Begin New Run" << endreq;
116 if(m_useDB == true) {
117 int runNo;
118 SmartDataPtr<Event::EventHeader> evt(m_eventSvc,"/Event/EventHeader");
119 if( evt ){
120 runNo = evt -> runNumber();
121 log << MSG::INFO <<"The runNumber of current event is "<<runNo<<endreq;
122 }
123 else {
124 log << MSG::ERROR <<"Can not get EventHeader!"<<endreq;
125 }
126 readDB(std::abs(runNo));
127 }
128 }
129}
void readDB(int runNo)

◆ handle() [2/2]

void RealizationSvc::handle ( const Incident &  )

◆ ifReadBunch() [1/2]

bool RealizationSvc::ifReadBunch ( )
inline

Definition at line 106 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

106{ return m_ifReadBunch; }

Referenced by G4HepMCInterface::HepMC2G4().

◆ ifReadBunch() [2/2]

bool RealizationSvc::ifReadBunch ( )
inline

◆ ifReadRandTrg() [1/2]

bool RealizationSvc::ifReadRandTrg ( )
inline

Definition at line 108 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

108{ return m_ifReadRandTrg; }

Referenced by MixerAlg::execute(), and MixerAlg::initialize().

◆ ifReadRandTrg() [2/2]

bool RealizationSvc::ifReadRandTrg ( )
inline

◆ ifReadTFEE() [1/2]

bool RealizationSvc::ifReadTFEE ( )
inline

Definition at line 109 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

109{ return m_ifReadTFEE; }

◆ ifReadTFEE() [2/2]

bool RealizationSvc::ifReadTFEE ( )
inline

◆ ifReadTrg() [1/2]

bool RealizationSvc::ifReadTrg ( )
inline

Definition at line 107 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

107{ return m_ifReadTrg; }

Referenced by BesGlobalTrigSvc::handle().

◆ ifReadTrg() [2/2]

bool RealizationSvc::ifReadTrg ( )
inline

◆ initialize() [1/2]

StatusCode RealizationSvc::initialize ( )
virtual

Definition at line 39 of file RealizationSvc.cxx.

39 {
40 MsgStream log(messageService(), name());
41 log << MSG::INFO << "RealizationSvc::initialize()" << endreq;
42
43 StatusCode sc = Service::initialize();
44 if( sc.isFailure() ) return sc;
45
46 if(m_SftVer == "NONE") m_SftVer = getenv("BES_RELEASE");
47
48 for(unsigned int i = 0; i < m_runNoList.size(); i++) {
49 if(m_runNoList[i] != 0) {
50 std::cout <<"run id : " << m_runNoList[i] << std::endl;
51 if(find(m_runIdList.begin(),m_runIdList.end(),m_runNoList[i]) == m_runIdList.end()) m_runIdList.push_back(m_runNoList[i]);
52 else log << MSG::ALWAYS <<"RunNo "<<m_runNoList[i]<<" repeated in run list"<<endreq;
53 }
54 else {
55 if(i == 0 || (i+1) >= m_runNoList.size()) log << MSG::ERROR << "Please check your run id list, it is wrong" << endreq;
56 if(m_runNoList[i+1] < m_runNoList[i-1]) {
57 for(int j = m_runNoList[i+1]+1; j < m_runNoList[i-1]; j++) {
58 if(find(m_runIdList.begin(),m_runIdList.end(),j) == m_runIdList.end()) m_runIdList.push_back(j);
59 else log << MSG::ALWAYS <<"RunNo "<<j<<" repeated in run list"<<endreq;
60 }
61 }
62 else {
63 for(int j = m_runNoList[i-1]+1; j < m_runNoList[i+1]; j++) {
64 if(find(m_runIdList.begin(),m_runIdList.end(),j) == m_runIdList.end()) m_runIdList.push_back(j);
65 else log << MSG::ALWAYS <<"RunNo "<<j<<" repeated in run list"<<endreq;
66 }
67 }
68 }
69 }
70 m_runID = m_runIdList[0];
71
72 m_connect = new RealDBUtil::ConnectionProvider();
73 if (!m_connect) {
74 log << MSG::ERROR << "Could not open connection to database" << endreq;
75 }
76
77 IIncidentSvc* incsvc;
78 sc = service("IncidentSvc", incsvc);
79 int priority = 100;
80 if( sc.isSuccess() ){
81 incsvc -> addListener(this, "NewRun", priority);
82 }
83
84 sc = serviceLocator()->service("EventDataSvc", m_eventSvc, true);
85 if (sc.isFailure() ) {
86 log << MSG::ERROR << "Unable to find EventDataSvc " << endreq;
87 return sc;
88 }
89
90 return StatusCode::SUCCESS;
91}

◆ initialize() [2/2]

virtual StatusCode RealizationSvc::initialize ( )
virtual

◆ queryInterface() [1/2]

StatusCode RealizationSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
virtual

Definition at line 100 of file RealizationSvc.cxx.

101{
102 if ( IRealizationSvc::interfaceID().versionMatch(riid) ) {
103 *ppvInterface = (IRealizationSvc*)this;
104 }else{
105 return Service::queryInterface(riid, ppvInterface);
106 }
107 addRef();
108 return StatusCode::SUCCESS;
109}

◆ queryInterface() [2/2]

virtual StatusCode RealizationSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
virtual

◆ readDB() [1/2]

void RealizationSvc::readDB ( int  runNo)

Definition at line 242 of file RealizationSvc.cxx.

242 {
243 MsgStream log( messageService(), name() );
244 log << MSG::DEBUG << "In getCaliConst" << endreq;
245
247
248 StatusCode sc;
249
250 //Get bunch infor
251 if(m_ifReadBunch == true) {
252 std::vector<std::string> sbunch;
253 std::vector<double> bunchInfo;
254 ConnectionProvider::eRet e = m_connect->getReadBunchInfo(sbunch,runNo,m_SftVer,m_ParVer,m_bossRelease);
255 if(e == 7 ) {
256 bool last = true;
257 for(int id = 1; true; id++) {
258 e = m_connect->getReadBunchInfo(sbunch,runNo+id,m_SftVer,m_ParVer,m_bossRelease);
259 last = true;
260 if(e == 7) {
261 if((runNo-id) > 0) {
262 e = m_connect->getReadBunchInfo(sbunch,runNo-id,m_SftVer,m_ParVer,m_bossRelease);
263 last = false;
264 }
265 }
266 if(e == 0) {
267 if(last == true) log << MSG::INFO << "Use Bunch infor. of run " << runNo+id << " instead of run " << runNo << endreq;
268 if(last == false) log << MSG::INFO << "Use Bunch infor. of run " << runNo-id << " instead of run " << runNo << endreq;
269 break;
270 }
271 }
272 }
273 if(e != 0 && e != 7) {
274 log << MSG::ERROR << "Could not find Bunch infor., exit." << endreq;
275 exit(1);
276 }
277 for(unsigned int i = 0; i < sbunch.size(); i++)
278 {
279 bunchInfo.push_back(atof(sbunch[i].c_str()));
280 }
281 sbunch.clear();
282
283 if(bunchInfo.size() == 6)
284 {
285 //convert from cm to mm
286 m_bunch_x = 10*bunchInfo[0];
287 m_bunch_y = 10*bunchInfo[1];
288 m_bunch_z = 10*bunchInfo[2];
289 m_sigma_x = 10*bunchInfo[3];
290 m_sigma_y = 10*bunchInfo[4];
291 m_sigma_z = 10*bunchInfo[5];
292 log << MSG::INFO << "BunchPosX: " << m_bunch_x << " BunchPosY: " << m_bunch_y << " BunchPosZ: " << m_bunch_z << " in Run " << runNo << endreq;
293 log << MSG::INFO << "BunchSigmaX: " << m_sigma_x << " BunchSigmaY: " << m_sigma_y << " BunchSigmaZ: " << m_sigma_z << " in Run " << runNo << endreq;
294 }
295 else {
296 log << MSG::ERROR << "Please check the bunch information, the size is " << bunchInfo.size() << endreq;
297 }
298 bunchInfo.clear();
299 }
300
301 //get trigger table
302 if(m_ifReadTrg == true) {
303 m_trgTable.clear();
304 std::vector<std::string> strgTable;
305 ConnectionProvider::eRet e = m_connect->getReadTrgTableInfo(strgTable,runNo);
306 if(e != 0 ) {
307 log << MSG::ERROR << "Could not find TrgTable infor., exit." << endreq;
308 exit(1);
309 }
310 for(unsigned int i = 0; i < strgTable.size(); i++)
311 {
312 long long value = 0;
313 for (unsigned int j = 0; j < (strgTable[i]).length(); j++)
314 {
315 value = value*10 + (strgTable[i][j] - '0');
316 }
317 m_trgTable.push_back(uint32_t(value));
318 }
319 strgTable.clear();
320 if(m_trgTable.size() != 65) log << MSG::ERROR << "Please check the TrgTable information, the size is " << m_trgTable.size() << endreq;
321
322 std::vector<double> vtrgGain;
323 e = m_connect->getEmcGain(vtrgGain,runNo);
324 if(e != 0 ) {
325 log << MSG::ERROR << "Could not find emc gain infor., exit." << endreq;
326 exit(1);
327 }
328 for(unsigned int i = 0; i < vtrgGain.size(); i++) {
329 m_trgGain[i] = vtrgGain[i];
330 }
331
332 //get trigger config information
333 e = m_connect->getTrgConfigInfo(runNo);
334 if(e != 0 ) {
335 log << MSG::ERROR << "Could not find Trigger config infor., exit." << endreq;
336 exit(1);
337 }
338 m_EtotDataSteps = m_connect->getEtotDataSteps();
339 m_VthBEtotH = m_connect->getVthBEtotH();
340 m_VthEEtotH = m_connect->getVthEEtotH();
341 m_VthEtotL = m_connect->getVthEtotL();
342 m_VthEtotM = m_connect->getVthEtotM();
343 m_VthBLZ = m_connect->getVthBLZ();
344 m_VthDiffB = m_connect->getVthDiffB();
345 m_VthDiffE = m_connect->getVthDiffE();
346 m_VthBalBLK = m_connect->getVthBalBLK();
347 m_VthBalEEMC = m_connect->getVthBalEEMC();
348 m_VthDiffMin = m_connect->getVthDiffMin();
349 }
350
351 //get background file
352 if(m_ifReadRandTrg == true) {
353 std::vector<std::string> fileInfor;
354 ConnectionProvider::eRet e = m_connect->getReadBackgroundInfo(fileInfor,runNo);
355 if(e == 7 ) {
356 bool last = true;
357 for(int id = 1; true; id++) {
358 e = m_connect->getReadBackgroundInfo(fileInfor,runNo+id);
359 last = true;
360 if(e == 7) {
361 if((runNo-id) > 0) {
362 e = m_connect->getReadBackgroundInfo(fileInfor,runNo-id);
363 last = false;
364 }
365 }
366 if(e == 0) {
367 if(last == true) log << MSG::INFO << "Use Bg files of run " << runNo+id << " instead of run " << runNo << endreq;
368 if(last == false) log << MSG::INFO << "Use Bg files of run " << runNo-id << " instead of run " << runNo << endreq;
369 break;
370 }
371 }
372 }
373 if(e != 0 && e != 7) {
374 log << MSG::ERROR << "Could not find background infor., exit." << endreq;
375 exit(1);
376 }
377 m_bgfilename.clear();
378 for(unsigned int i = 0; i < fileInfor.size(); i+=2)
379 {
380 m_bgfilename.push_back(fileInfor[i]+"/"+fileInfor[i+1]);
381 }
382 fileInfor.clear();
383 for(unsigned int i = 0; i < m_bgfilename.size(); i++) {
384 log << MSG::INFO << "Background file name: " << m_bgfilename[i] << " in run " << runNo << endreq;
385 }
386
387 //get luminosity curve parameters
388 std::string srunTime;
389 std::string stau_value;
390 e = m_connect->getLumCurvePar(srunTime, stau_value, runNo, m_SftVer, m_ParVer, m_bossRelease);
391 if(e != 0 ) {
392 log << MSG::ERROR << "Could not find Luminosity curve parameters, exit." << endreq;
393 exit(1);
394 }
395 m_runTotalTime = std::atof(srunTime.c_str());
396 m_tauValue = std::atof(stau_value.c_str());
397 log << MSG::INFO << "Total time is " << m_runTotalTime << ", tau is " << m_tauValue << " in run " << runNo << ". " << endreq;
398 }
399
400 //get tof threshold in table TFEE
401 if(m_ifReadTFEE == true) {
402 m_tfee.clear();
403 ConnectionProvider::eRet e = m_connect->getReadTofThreshInfo(m_tfee,runNo);
404 if(e != 0 ) {
405 log << MSG::ERROR << "Could not find TFEE infor., exit." << endreq;
406 exit(1);
407 }
408
409 for(unsigned int i = 0; i < m_tfee.size(); i++) {
410 log << MSG::INFO << "TFEE ----> " << m_tfee[i] << endreq;
411 }
412 }
413
414 //get run infor.
415 if(m_ifReadRunInfo == true) {
416 m_runInfo.clear();
417 std::vector<std::string> srunInfo;
418 ConnectionProvider::eRet e = m_connect->getRunInfo(srunInfo,runNo);
419 if(e != 0 ) {
420 log << MSG::ERROR << "Could not find run infor., exit." << endreq;
421 exit(1);
422 }
423 for(unsigned int i = 0; i < srunInfo.size(); i++)
424 {
425 m_runInfo.push_back(atof(srunInfo[i].c_str()));
426 }
427 srunInfo.clear();
428
429 for(unsigned int i = 0; i < m_runInfo.size(); i++) {
430 log << MSG::INFO << "runInfo ----> " << m_runInfo[i] << endreq;
431 }
432 }
433
434}
ConnectionProvider::eRet getRunInfo(std::vector< std::string > &runInfo, int runNo)
ConnectionProvider::eRet getReadBunchInfo(std::vector< std::string > &bunch, int runNo, std::string SftVer, std::string ParVer, std::string BossRelease)
ConnectionProvider::eRet getLumCurvePar(std::string &runTotalTime, std::string &tau_value, int runNo, std::string SftVer, std::string ParVer, std::string BossRelease)
ConnectionProvider::eRet getTrgConfigInfo(int runNo)
ConnectionProvider::eRet getEmcGain(std::vector< double > &emcGain, int runNo)
ConnectionProvider::eRet getReadTrgTableInfo(std::vector< std::string > &trgTable, int runNo)
ConnectionProvider::eRet getReadTofThreshInfo(std::vector< std::string > &tofThresh, int runNo)
char * c_str(Index i)
Definition: EvtCyclic3.cc:252

Referenced by handle().

◆ readDB() [2/2]

void RealizationSvc::readDB ( int  runNo)

◆ setBgFileName() [1/2]

void RealizationSvc::setBgFileName ( std::vector< std::string >  i)
inline

Definition at line 85 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

85{ m_bgfilename = i; }

◆ setBgFileName() [2/2]

void RealizationSvc::setBgFileName ( std::vector< std::string >  i)
inline

◆ setBunchPosX() [1/2]

void RealizationSvc::setBunchPosX ( double  i)
inline

Definition at line 41 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

41{ m_bunch_x = i; }

◆ setBunchPosX() [2/2]

void RealizationSvc::setBunchPosX ( double  i)
inline

◆ setBunchPosY() [1/2]

void RealizationSvc::setBunchPosY ( double  i)
inline

Definition at line 42 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

42{ m_bunch_y = i; }

◆ setBunchPosY() [2/2]

void RealizationSvc::setBunchPosY ( double  i)
inline

◆ setBunchPosZ() [1/2]

void RealizationSvc::setBunchPosZ ( double  i)
inline

Definition at line 43 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

43{ m_bunch_z = i; }

◆ setBunchPosZ() [2/2]

void RealizationSvc::setBunchPosZ ( double  i)
inline

◆ setBunchSizeX() [1/2]

void RealizationSvc::setBunchSizeX ( double  i)
inline

Definition at line 44 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

44{ m_sigma_x = i; }

◆ setBunchSizeX() [2/2]

void RealizationSvc::setBunchSizeX ( double  i)
inline

◆ setBunchSizeY() [1/2]

void RealizationSvc::setBunchSizeY ( double  i)
inline

Definition at line 45 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

45{ m_sigma_y = i; }

◆ setBunchSizeY() [2/2]

void RealizationSvc::setBunchSizeY ( double  i)
inline

◆ setBunchSizeZ() [1/2]

void RealizationSvc::setBunchSizeZ ( double  i)
inline

Definition at line 46 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

46{ m_sigma_z = i; }

◆ setBunchSizeZ() [2/2]

void RealizationSvc::setBunchSizeZ ( double  i)
inline

◆ setInitEvtID() [1/2]

void RealizationSvc::setInitEvtID ( int  i)
inline

Definition at line 35 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

35{ m_initEvtID = i; }

◆ setInitEvtID() [2/2]

void RealizationSvc::setInitEvtID ( int  i)
inline

◆ setLuminosity() [1/2]

void RealizationSvc::setLuminosity ( float  i)
inline

Definition at line 37 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

37{ m_lumi = i; }

◆ setLuminosity() [2/2]

void RealizationSvc::setLuminosity ( float  i)
inline

◆ setRunEvtNum() [1/2]

void RealizationSvc::setRunEvtNum ( int  i)
inline

Definition at line 57 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

57{ m_RunEvtNum = i; }

Referenced by McContext::McContext(), and McContext::next().

◆ setRunEvtNum() [2/2]

void RealizationSvc::setRunEvtNum ( int  i)
inline

◆ setRunId() [1/2]

void RealizationSvc::setRunId ( int  i)
inline

Definition at line 102 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

102{ m_runID = i; }

Referenced by McContext::McContext(), and McContext::next().

◆ setRunId() [2/2]

void RealizationSvc::setRunId ( int  i)
inline

◆ setTrgTable() [1/2]

void RealizationSvc::setTrgTable ( std::vector< uint32_t >  i)
inline

Definition at line 69 of file InstallArea/include/RealizationSvc/RealizationSvc/RealizationSvc.h.

69{ m_trgTable = i; }

◆ setTrgTable() [2/2]

void RealizationSvc::setTrgTable ( std::vector< uint32_t >  i)
inline

◆ updateRealData() [1/2]

void RealizationSvc::updateRealData ( )

Definition at line 436 of file RealizationSvc.cxx.

436 {
437}

◆ updateRealData() [2/2]

void RealizationSvc::updateRealData ( )

◆ UseDBFlag() [1/2]

◆ UseDBFlag() [2/2]

bool RealizationSvc::UseDBFlag ( )
inline

The documentation for this class was generated from the following files: