BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
BeamEnergySvc Class Reference

#include <BeamEnergySvc.h>

+ Inheritance diagram for BeamEnergySvc:

Public Member Functions

 BeamEnergySvc (const std::string &name, ISvcLocator *svcLoc)
 
virtual ~BeamEnergySvc ()
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvIF)
 
bool isRunValid (int run)
 
double getbeamE (int run)
 
- Public Member Functions inherited from IBeamEnergySvc
virtual ~IBeamEnergySvc ()
 
virtual bool isRunValid (int run)=0
 
virtual double getbeamE (int run)=0
 

Friends

class CnvFactory< BeamEnergySvc >
 

Additional Inherited Members

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

Detailed Description

Definition at line 10 of file BeamEnergySvc.h.

Constructor & Destructor Documentation

◆ BeamEnergySvc()

BeamEnergySvc::BeamEnergySvc ( const std::string &  name,
ISvcLocator *  svcLoc 
)

Definition at line 4 of file BeamEnergySvc.cxx.

5: Service(name, svcLoc),
6 m_run(-1),
7 m_isRunValid(false),
8 m_beamE(0)
9{
10 //declareProperty("", m_);
11 declareProperty("Host" , m_host = std::string("bes3db2.ihep.ac.cn"));
12 declareProperty("DbName" , m_dbName = std::string("run"));
13 declareProperty("UserName" , m_userName = std::string("guest"));
14 declareProperty("Password" , m_password = std::string("guestpass"));
15 declareProperty("PortNum" , m_port_num = 3306);
16}

◆ ~BeamEnergySvc()

BeamEnergySvc::~BeamEnergySvc ( )
virtual

Definition at line 18 of file BeamEnergySvc.cxx.

19{
20}

Member Function Documentation

◆ finalize()

StatusCode BeamEnergySvc::finalize ( )
virtual

Definition at line 32 of file BeamEnergySvc.cxx.

33{
34 MsgStream log(messageService(), name());
35 log << MSG::INFO << "@initialize()" << endreq;
36
37 StatusCode sc = Service::finalize();
38
39 return sc;
40}

◆ getbeamE()

double BeamEnergySvc::getbeamE ( int  run)
virtual

Implements IBeamEnergySvc.

Definition at line 131 of file BeamEnergySvc.cxx.

131 {
132 if (!isRunValid(run)){
133 std::cerr << "ERROR in BeamEnergySvc: runNo is invalid!" << std::endl;
134 }
135 return m_beamE;
136}
bool isRunValid(int run)

◆ initialize()

StatusCode BeamEnergySvc::initialize ( )
virtual

Definition at line 22 of file BeamEnergySvc.cxx.

23{
24 MsgStream log(messageService(), name());
25 log << MSG::INFO << "@initialize()" << endreq;
26
27 StatusCode sc = Service::initialize();
28
29 return sc;
30}

◆ isRunValid()

bool BeamEnergySvc::isRunValid ( int  run)
virtual

Implements IBeamEnergySvc.

Definition at line 123 of file BeamEnergySvc.cxx.

123 {
124 if (m_run != run) {
125 ReadDb(run);
126 }
127 return m_isRunValid;
128}

Referenced by getbeamE().

◆ queryInterface()

StatusCode BeamEnergySvc::queryInterface ( const InterfaceID &  riid,
void **  ppvIF 
)
virtual

Definition at line 42 of file BeamEnergySvc.cxx.

43{
44 if ( IBeamEnergySvc::interfaceID().versionMatch(riid) ) {
45 *ppvIF = dynamic_cast<IBeamEnergySvc*>(this);
46 }
47 else {
48 return Service::queryInterface(riid, ppvIF);
49 }
50 addRef();
51 return StatusCode::SUCCESS;
52}
static const InterfaceID & interfaceID()

Friends And Related Function Documentation

◆ CnvFactory< BeamEnergySvc >

friend class CnvFactory< BeamEnergySvc >
friend

Definition at line 1 of file BeamEnergySvc.h.


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