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

#include <VertexDbSvc.h>

+ Inheritance diagram for VertexDbSvc:

Public Member Functions

 VertexDbSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~VertexDbSvc ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void handle (const Incident &)
 
double * PrimaryVertex ()
 
double * SigmaPrimaryVertex ()
 
bool isVertexValid ()
 
virtual double * PrimaryVertex ()=0
 
virtual double * SigmaPrimaryVertex ()=0
 
virtual bool isVertexValid ()=0
 

Additional Inherited Members

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

Detailed Description

Definition at line 27 of file VertexDbSvc.h.

Constructor & Destructor Documentation

◆ VertexDbSvc()

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

Definition at line 48 of file VertexDbSvc.cxx.

48 :
49 Service (name, svcloc){
50 // declare properties
51 declareProperty("Host" , host = std::string("bes3db2.ihep.ac.cn"));
52 declareProperty("DbName" , dbName = std::string("offlinedb"));
53 declareProperty("UserName" , userName = std::string("guest"));
54 declareProperty("Password" , password = std::string("guestpass"));
55 declareProperty("BossVer" , m_bossver = std::string("default"));
56 declareProperty("VerPar" , m_verpar = std::string("default"));
57 declareProperty("BossRelease",m_bossRelease = std::string("default"));
58}

◆ ~VertexDbSvc()

VertexDbSvc::~VertexDbSvc ( )

Definition at line 60 of file VertexDbSvc.cxx.

60 {
61}

Member Function Documentation

◆ finalize()

StatusCode VertexDbSvc::finalize ( )
virtual

Definition at line 101 of file VertexDbSvc.cxx.

101 {
102 MsgStream log(messageService(), name());
103 log << MSG::INFO << "VertexDbSvc::finalize()" << endreq;
104 // if(m_connect_offline) delete m_connect_offline;
105 return StatusCode::SUCCESS;
106}

◆ handle()

void VertexDbSvc::handle ( const Incident &  inc)

Definition at line 108 of file VertexDbSvc.cxx.

108 {
109 MsgStream log( messageService(), name() );
110 log << MSG::DEBUG << "handle: " << inc.type() << endreq;
111
112 if ( inc.type() == "NewRun" ){
113 log << MSG::DEBUG << "NewRun" << endreq;
114 getVertexTableInfo();
115 }
116}

◆ initialize()

StatusCode VertexDbSvc::initialize ( )
virtual

Definition at line 72 of file VertexDbSvc.cxx.

72 {
73 MsgStream log(messageService(), name());
74 log << MSG::INFO << "VertexDbSvc::initialize()" << endreq;
75
76 StatusCode sc = Service::initialize();
77 if( sc.isFailure() ) return sc;
78
79
80 IIncidentSvc* incsvc;
81 sc = service("IncidentSvc", incsvc);
82 int priority = 100;
83 if( sc.isSuccess() ){
84 incsvc -> addListener(this, "NewRun", priority);
85 }
86
87 sc = serviceLocator()->service("DatabaseSvc",m_dbsvc,true);
88 if (sc .isFailure() ) {
89 log << MSG::ERROR << "Unable to find DatabaseSvc " << endreq;
90 return sc;
91 }
92
93 sc = serviceLocator()->service("EventDataSvc", m_eventSvc, true);
94 if (sc .isFailure() ) {
95 log << MSG::ERROR << "Unable to find EventDataSvc " << endreq;
96 return sc;
97 }
98 return StatusCode::SUCCESS;
99}

◆ isVertexValid()

bool VertexDbSvc::isVertexValid ( )
inlinevirtual

Implements IVertexDbSvc.

Definition at line 71 of file VertexDbSvc.h.

71{return m_isRunNumberValid;}

◆ PrimaryVertex()

double * VertexDbSvc::PrimaryVertex ( )
virtual

Implements IVertexDbSvc.

Definition at line 155 of file VertexDbSvc.cxx.

156{
157 if( !m_isRunNumberValid ) {
158 cerr << "WARNING in VertexDbSvc: runNo is invalid!\n";
159 memset(m_primaryVertex,0,sizeof(m_primaryVertex));
160 }
161 return m_primaryVertex;
162}

◆ queryInterface()

StatusCode VertexDbSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvUnknown 
)
virtual

Definition at line 63 of file VertexDbSvc.cxx.

63 {
64 if( IID_IVertexDbSvc.versionMatch(riid) ){
65 *ppvInterface = static_cast<IVertexDbSvc*> (this);
66 } else{
67 return Service::queryInterface(riid, ppvInterface);
68 }
69 return StatusCode::SUCCESS;
70}

◆ SigmaPrimaryVertex()

double * VertexDbSvc::SigmaPrimaryVertex ( )
virtual

Implements IVertexDbSvc.

Definition at line 164 of file VertexDbSvc.cxx.

165{
166 if( !m_isRunNumberValid ) {
167 cerr << "WARNING in VertexDbSvc: runNo is invalid!\n";
168 memset(m_sigmaPrimaryVertex,0,sizeof(m_sigmaPrimaryVertex));
169 }
170 return m_sigmaPrimaryVertex;
171}

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