#include <EvtStoreQuery.h>
Inheritance diagram for EvtStoreQuery:
Public Types | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
enum | Status |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
Public Member Functions | |
EvtStoreQuery (const std::string &name, ISvcLocator *svc) | |
Standard Service Constructor. | |
virtual StatusCode | initialize () |
virtual StatusCode | finalize () |
virtual const DataObject * | queryInputAddress (const std::string &location, const unsigned long &entry) |
Search TES and AES (when used) for a data object at certain location and with required entry number. | |
virtual StatusCode | queryInterface (const InterfaceID &id, void **interface) |
Methods required by ServiceManager. | |
virtual unsigned long | addRef () |
virtual unsigned long | release () |
virtual const std::string & | name () const |
virtual const InterfaceID & | type () const |
virtual StatusCode | configure () |
virtual StatusCode | start () |
virtual StatusCode | stop () |
virtual StatusCode | terminate () |
virtual Gaudi::StateMachine::State | FSMState () const |
virtual Gaudi::StateMachine::State | targetFSMState () const |
virtual StatusCode | reinitialize () |
virtual StatusCode | restart () |
virtual StatusCode | sysInitialize () |
virtual StatusCode | sysStart () |
virtual StatusCode | sysStop () |
virtual StatusCode | sysFinalize () |
virtual StatusCode | sysReinitialize () |
virtual StatusCode | sysRestart () |
virtual StatusCode | setProperty (const Property &p) |
virtual StatusCode | setProperty (const std::string &s) |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
virtual StatusCode | getProperty (Property *p) const |
virtual const Property & | getProperty (const std::string &name) const |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
virtual const std::vector< Property * > & | getProperties () const |
ISvcLocator * | serviceLocator () const |
IMessageSvc * | msgSvc () |
IMessageSvc * | msgSvc () const |
IMessageSvc * | messageService () |
IMessageSvc * | messageService () const |
StatusCode | setProperties () |
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const |
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
IAuditorSvc * | auditorSvc () const |
virtual unsigned long | addRef ()=0 |
virtual unsigned long | release ()=0 |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
Public Attributes | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
Protected Member Functions | |
int | outputLevel () const |
Protected Attributes | |
IntegerProperty | m_outputLevel |
Gaudi::StateMachine::State | m_state |
Gaudi::StateMachine::State | m_targetState |
IMessageSvc * | m_messageSvc |
Private Attributes | |
bool | m_useAES |
std::string | m_evtSvcName |
IDataProviderSvc * | m_evtSvc |
std::string | m_archiveSvcName |
IDataProviderSvc * | m_archiveSvc |
Friends | |
friend class | ServiceManager |
Definition at line 14 of file EvtStoreQuery.h.
EvtStoreQuery::EvtStoreQuery | ( | const std::string & | name, | |
ISvcLocator * | svc | |||
) |
Standard Service Constructor.
Definition at line 13 of file EvtStoreQuery.cpp.
00014 : 00015 Service(name,svc), 00016 m_useAES(true), 00017 m_evtSvc(0), 00018 m_archiveSvc(0) 00019 { 00020 declareProperty("UseAes",m_useAES=true, "Is AES in use?"); 00021 declareProperty("TES",m_evtSvcName="EventDataSvc","Name of TES"); 00022 declareProperty("AES",m_archiveSvcName="EventDataArchiveSvc","Name of AES"); 00023 }
StatusCode EvtStoreQuery::initialize | ( | ) | [virtual] |
Reimplemented from Service.
Definition at line 44 of file EvtStoreQuery.cpp.
00045 { 00046 MsgStream log(msgSvc(), name()); 00047 00048 StatusCode status = service(m_evtSvcName,m_evtSvc); 00049 00050 log<<MSG::DEBUG<<"m_evtSvc "<<m_evtSvc<<endreq; 00051 if (status.isFailure()) { 00052 log<<MSG::ERROR<<"Service [EventDataSvc] not found"<<endreq; 00053 return status; 00054 } 00055 00056 // get archive service 00057 if(m_useAES) { 00058 status = service(m_archiveSvcName,m_archiveSvc); 00059 00060 log<<MSG::DEBUG<<"m_archiveSvc "<<m_archiveSvc<<endreq; 00061 if (status.isFailure() || m_archiveSvc==0) { 00062 log<<MSG::ERROR<<"Service [EventDataArchiveSvc] not found"<<endreq; 00063 return status; 00064 } 00065 } 00066 00067 return Service::initialize(); 00068 }
StatusCode EvtStoreQuery::finalize | ( | ) | [virtual] |
Reimplemented from Service.
Definition at line 70 of file EvtStoreQuery.cpp.
00071 { 00072 if(m_archiveSvc!=0) { 00073 m_archiveSvc->release(); 00074 } 00075 00076 return Service::finalize(); 00077 }
const DataObject * EvtStoreQuery::queryInputAddress | ( | const std::string & | location, | |
const unsigned long & | entry | |||
) | [virtual] |
Search TES and AES (when used) for a data object at certain location and with required entry number.
location: TES or TTree location entry: TTree entry (This implicitly requires a TemporalDataObject)
Return 0 if not found and a pointer if succeed.
Implements IEvtStoreQuery.
Definition at line 79 of file EvtStoreQuery.cpp.
00080 { 00081 MsgStream log(msgSvc(), name()); 00082 // log<<MSG::INFO<<"Searching: "<<location<<"\t"<<entry<<endreq; 00083 00084 DataObject* pObj=0; 00085 DayaBay::TemporalDataObject* pTdo=0; 00086 StatusCode sc; 00087 00088 if(!m_useAES) 00089 { 00090 sc=m_evtSvc->findObject(location,pObj); 00091 if(sc.isSuccess()) 00092 { 00093 try{ 00094 pTdo=dynamic_cast<DayaBay::TemporalDataObject*>(pObj); 00095 } catch(...) { 00096 // 00097 } 00098 if(pTdo!=0) 00099 { 00100 const GenericAddress* ria=pTdo->inputAddress(); 00101 //log<<MSG::INFO<<"ria= "<<ria<<endreq; 00102 if(ria!=0) 00103 { 00104 //log<<MSG::INFO<<"Searching: "<<location<<"\t"<<entry<<"\t"<<pObj<<endreq; 00105 if(ria->ipar()[0]==entry) 00106 { 00107 log<<MSG::DEBUG<<"Found: "<<location<<"\t"<<entry<<"\t"<<pObj<<endreq; 00108 return pObj; 00109 } 00110 else 00111 { 00112 log<<MSG::DEBUG<<"Reject: "<<location<<"\t"<<entry<<"!="<<ria->ipar()[0]<<"\t"<<pObj 00113 <<"[" << pTdo->earliest() << " --> " << pTdo->latest() << "]" 00114 <<endreq; 00115 } 00116 } 00117 } 00118 } 00119 } 00120 else 00121 { 00122 log<<MSG::DEBUG<<"AES, searching... "<<m_archiveSvc<<"\t"<<location<<"\t"<<entry<<endreq; 00123 SmartDataPtr<DybArchiveList> data_list(m_archiveSvc,location); 00124 if( data_list!=0 ) 00125 { 00126 log<<MSG::DEBUG<<"size of list "<<data_list->size(); 00127 // newest data is always at the FRONT of the list 00128 DybArchiveList::const_iterator finished = data_list->end(); 00129 DybArchiveList::const_iterator iter = data_list->begin(); 00130 for(;iter!=finished;++iter) 00131 { 00132 pObj=(*iter); 00133 if(pObj!=0) 00134 { 00135 try{ 00136 pTdo=dynamic_cast<DayaBay::TemporalDataObject*>(pObj); 00137 } catch(...) { 00138 // 00139 } 00140 if(pTdo!=0) 00141 { 00142 const GenericAddress* ria=pTdo->inputAddress(); 00143 log<<MSG::DEBUG<<"ria= "<<ria<<endreq; 00144 if(ria!=0) 00145 { 00146 log<<MSG::DEBUG<<"Checking: "<<location<<"\t"<<ria->ipar()[0]<<"\t"<<entry<<"\t"<<pObj<<endreq; 00147 if(ria->ipar()[0]==entry) 00148 { 00149 log<<MSG::DEBUG<<"Found: "<<location<<"\t"<<entry<<"\t"<<pObj<<endreq; 00150 return pObj; 00151 } 00152 } 00153 } 00154 } 00155 } 00156 } 00157 } 00158 00159 return 0; 00160 }
StatusCode EvtStoreQuery::queryInterface | ( | const InterfaceID & | id, | |
void ** | interface | |||
) | [virtual] |
Methods required by ServiceManager.
Reimplemented from Service.
Definition at line 25 of file EvtStoreQuery.cpp.
00027 { 00028 MsgStream log(msgSvc(), name()); 00029 00030 if (IEvtStoreQuery::interfaceID().versionMatch(id)) { 00031 // If good enough match return this object. 00032 *interface = (IEvtStoreQuery*)this; 00033 addRef(); 00034 //log<<MSG::ERROR<<"match"<<endreq; 00035 } else { 00036 // Interface is not directly available: try out a base class. 00037 //log<<MSG::ERROR<<"no match"<<endreq; 00038 return Service::queryInterface(id,interface); 00039 } 00040 00041 return StatusCode::SUCCESS; 00042 }
bool EvtStoreQuery::m_useAES [private] |
Definition at line 42 of file EvtStoreQuery.h.
std::string EvtStoreQuery::m_evtSvcName [private] |
Definition at line 45 of file EvtStoreQuery.h.
IDataProviderSvc* EvtStoreQuery::m_evtSvc [private] |
Definition at line 46 of file EvtStoreQuery.h.
std::string EvtStoreQuery::m_archiveSvcName [private] |
Definition at line 49 of file EvtStoreQuery.h.
IDataProviderSvc* EvtStoreQuery::m_archiveSvc [private] |
Definition at line 50 of file EvtStoreQuery.h.