#include <TestInputLoadAlg.h>
Inheritance diagram for TestInputLoadAlg:
Public Member Functions | |
TestInputLoadAlg (const std::string &name, ISvcLocator *pSvcLocator) | |
virtual | ~TestInputLoadAlg () |
virtual StatusCode | initialize () |
virtual StatusCode | execute () |
virtual StatusCode | finalize () |
virtual StatusCode | sysExecute () |
void | put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const |
void | put (DataObject *object, const std::string &address, const bool useRootInTES=true) const |
Gaudi::Utils::GetData< TYPE >::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
Gaudi::Utils::GetData< TYPE >::return_type | get (const std::string &location, const bool useRootInTES=true) const |
TYPE * | getDet (IDataProviderSvc *svc, const std::string &location) const |
TYPE * | getDet (const std::string &location) const |
bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
bool | exist (const std::string &location, const bool useRootInTES=true) const |
bool | existDet (IDataProviderSvc *svc, const std::string &location) const |
bool | existDet (const std::string &location) const |
TYPE * | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
TYPE * | getOrCreate (const std::string &location, const bool useRootInTES=true) const |
bool | registerContext () const |
INTupleSvc * | evtColSvc () const |
IAlgContextSvc * | contextSvc () const |
TOOL * | tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const |
TOOL * | tool (const std::string &type, const IInterface *parent=0, bool create=true) const |
SERVICE * | svc (const std::string &name, const bool create=true) const |
IUpdateManagerSvc * | updMgrSvc () const |
IDataProviderSvc * | fastContainersSvc () const |
StatusCode | Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
StatusCode | Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
StatusCode | Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const |
StatusCode | Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
MsgStream & | msgStream (const MSG::Level level) const |
MsgStream & | always () const |
MsgStream & | fatal () const |
MsgStream & | err () const |
MsgStream & | error () const |
MsgStream & | warning () const |
MsgStream & | info () const |
MsgStream & | debug () const |
MsgStream & | verbose () const |
MsgStream & | msg () const |
const Statistics & | counters () const |
StatEntity & | counter (const std::string &tag) const |
MSG::Level | msgLevel () const |
bool | msgLevel (const MSG::Level level) const |
void | resetMsgStream () const |
bool | typePrint () const |
bool | propsPrint () const |
bool | statPrint () const |
bool | errorsPrint () const |
long | printStat (const MSG::Level level=MSG::ALWAYS) const |
long | printErrors (const MSG::Level level=MSG::ALWAYS) const |
long | printProps (const MSG::Level level=MSG::ALWAYS) const |
void | registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL) |
StatusCode | runUpdate () |
TransientFastContainer< T > * | getFastContainer (const std::string &location, typename TransientFastContainer< T >::size_type initial=0) |
StatusCode | release (const IInterface *interface) const |
unsigned long | release () |
const std::string & | context () const |
const std::string & | rootInTES () const |
double | globalTimeOffset () const |
virtual StatusCode | sysStart () |
virtual StatusCode | sysInitialize () |
virtual StatusCode | sysReinitialize () |
virtual StatusCode | sysRestart () |
virtual StatusCode | sysStop () |
virtual StatusCode | sysFinalize () |
virtual StatusCode | sysBeginRun () |
virtual StatusCode | sysEndRun () |
virtual const std::string & | name () const |
virtual const std::string & | version () const |
virtual StatusCode | configure () |
virtual StatusCode | terminate () |
virtual StatusCode | start () |
virtual StatusCode | stop () |
virtual StatusCode | reinitialize () |
virtual StatusCode | restart () |
virtual bool | isExecuted () const |
virtual void | setExecuted (bool state) |
virtual void | resetExecuted () |
virtual StatusCode | beginRun () |
virtual StatusCode | endRun () |
virtual Gaudi::StateMachine::State | FSMState () const |
virtual Gaudi::StateMachine::State | targetFSMState () const |
virtual bool | isEnabled () const |
virtual bool | filterPassed () const |
virtual void | setFilterPassed (bool state) |
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 |
void | setOutputLevel (int level) |
IAuditorSvc * | auditorSvc () const |
IChronoStatSvc * | chronoSvc () const |
IChronoStatSvc * | chronoStatService () const |
IDataProviderSvc * | detSvc () const |
IDataProviderSvc * | detDataService () const |
IConversionSvc * | detCnvSvc () const |
IConversionSvc * | detDataCnvService () const |
IDataProviderSvc * | eventSvc () const |
IDataProviderSvc * | evtSvc () const |
IDataProviderSvc * | eventDataService () const |
IConversionSvc * | eventCnvSvc () const |
IConversionSvc * | eventDataCnvService () const |
IHistogramSvc * | histoSvc () const |
IHistogramSvc * | histogramDataService () const |
IMessageSvc * | msgSvc () const |
IMessageSvc * | messageService () const |
INTupleSvc * | ntupleSvc () const |
INTupleSvc * | ntupleService () const |
IRndmGenSvc * | randSvc () const |
IToolSvc * | toolSvc () const |
IExceptionSvc * | exceptionSvc () const |
ISvcLocator * | serviceLocator () const |
ISvcLocator * | svcLoc () const |
StatusCode | createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg) |
std::vector< Algorithm * > * | subAlgorithms () const |
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 |
StatusCode | setProperties () |
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 |
IMonitorSvc * | monitorSvc () const |
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const |
void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const |
unsigned long | addRef () |
StatusCode | queryInterface (const InterfaceID &riid, void **) |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
Public Attributes | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
Protected Types | |
typedef std::map< std::string, StatEntity > | Statistics |
typedef std::map< std::string, unsigned int > | Counter |
typedef std::vector< IAlgTool * > | AlgTools |
typedef std::pair< IInterface *, std::string > | ServiceEntry |
typedef std::vector< ServiceEntry > | Services |
Protected Member Functions | |
StatusCode | releaseTool (const IAlgTool *tool) const |
StatusCode | releaseSvc (const IInterface *svc) const |
bool | isInitialized () const |
bool | isFinalized () const |
int | outputLevel () const |
IntegerProperty & | outputLevelProperty () |
void | initOutputLevel (Property &prop) |
Static Protected Attributes | |
static const bool | IgnoreRootInTES |
static const bool | UseRootInTES |
Private Member Functions | |
StatusCode | get_header (int entry, const std::string &path, bool input_headers) |
StatusCode | get_frame (int entry, const std::string &path, bool input_headers) |
Private Attributes | |
ToolHandle< IDybInputLoadTool > | m_loader |
ToolHandle< IDybEntryPolicyTool > | m_policy |
std::string | m_path |
int | m_test_type |
Load files into the TES directly using a DybInputLoadTool. This is just for testing
Brett Viren <bviren@lycastus.phy.bnl.gov> Tue Nov 16 12:29:12 2010
Definition at line 28 of file TestInputLoadAlg.h.
TestInputLoadAlg::TestInputLoadAlg | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
Definition at line 11 of file TestInputLoadAlg.cc.
00012 : GaudiAlgorithm(name,pSvcLocator) 00013 { 00014 declareProperty("Loader", m_loader, "A IDybInputLoadTool"); 00015 declareProperty("Policy", m_policy, "A IDybEntryPolicyTool"); 00016 declareProperty("Path", m_path, "A TES-like path to the HeaderObject to load"); 00017 declareProperty("TestType", m_test_type=0, "Which tests to run [0,1,2,3,4]"); 00018 }
TestInputLoadAlg::~TestInputLoadAlg | ( | ) | [virtual] |
StatusCode TestInputLoadAlg::initialize | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 24 of file TestInputLoadAlg.cc.
00025 { 00026 MsgStream log(msgSvc(), "TestInputLoadAlg"); 00027 00028 { 00029 StatusCode sc = m_loader.retrieve(); 00030 if (sc.isFailure()) { 00031 log << MSG::ERROR << "Failed to retrieve " << m_loader << endreq; 00032 return sc; 00033 } 00034 } 00035 00036 { 00037 StatusCode sc = m_policy.retrieve(); 00038 if (sc.isFailure()) { 00039 log << MSG::ERROR << "Failed to retrieve " << m_policy << endreq; 00040 return sc; 00041 } 00042 } 00043 return StatusCode::SUCCESS; 00044 }
StatusCode TestInputLoadAlg::execute | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 118 of file TestInputLoadAlg.cc.
00119 { 00120 MsgStream log(msgSvc(), "TestInputLoadAlg"); 00121 00122 int entry = m_policy->next_entry(); 00123 00124 int which = entry%4; 00125 if (m_test_type) which = m_test_type-1; 00126 00127 log << MSG::DEBUG << "test " << which << " loading entry " << entry << endreq; 00128 00129 std::string rspath = "/Event/RegistrationSequence"; 00130 00131 switch(which) { 00132 case 0: 00133 return this->get_header(entry,m_path,false); 00134 break; 00135 case 1: 00136 return this->get_header(entry,m_path,true); 00137 break; 00138 case 2: 00139 return this->get_frame(entry,rspath,true); 00140 break; 00141 case 3: 00142 return this->get_frame(entry,rspath,true); 00143 break; 00144 } 00145 00146 log << MSG::ERROR << "got unknown test code: " << which+1 << " should be in [0-4]" << endreq; 00147 return StatusCode::FAILURE; 00148 }
StatusCode TestInputLoadAlg::finalize | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 150 of file TestInputLoadAlg.cc.
00151 { 00152 return StatusCode::SUCCESS; 00153 }
StatusCode TestInputLoadAlg::get_header | ( | int | entry, | |
const std::string & | path, | |||
bool | input_headers | |||
) | [private] |
Definition at line 68 of file TestInputLoadAlg.cc.
00069 { 00070 MsgStream log(msgSvc(), "TestInputLoadAlg"); 00071 00072 HeaderObject* ho = m_loader->get_header(entry,path,input_headers); 00073 if (!ho) { 00074 log << MSG::ERROR << "Failed to get HeaderObject at entry " 00075 << entry << " and path \"" << path << "\"" << endreq; 00076 return StatusCode::FAILURE; 00077 } 00078 log << MSG::DEBUG << "Found Header object at entry " 00079 << entry << " and path \"" << path << "\"" << endreq; 00080 log << MSG::DEBUG << ho->earliest() << endreq; 00081 std::vector<const HeaderObject*> bucket; 00082 collect_input_headers(log, ho, bucket); 00083 00084 log << MSG::DEBUG << "Got " << bucket.size() << " HeaderObjects" << endreq; 00085 00086 for (size_t ind=0; ind<bucket.size(); ++ind) { 00087 HeaderObject* hop = const_cast<HeaderObject*>(bucket[ind]); 00088 log << MSG::DEBUG << "Putting HeaderObject at " << hop->defLoc() << endreq; 00089 this->put(hop,hop->defLoc()); 00090 } 00091 00092 return StatusCode::SUCCESS; 00093 }
StatusCode TestInputLoadAlg::get_frame | ( | int | entry, | |
const std::string & | path, | |||
bool | input_headers | |||
) | [private] |
Definition at line 95 of file TestInputLoadAlg.cc.
00096 { 00097 MsgStream log(msgSvc(), "TestInputLoadAlg"); 00098 00099 IDybInputLoadTool::ExecutionFrame ef = m_loader->get_frame(entry,path,input_headers); 00100 if (!ef.size()) { 00101 log << MSG::ERROR << "Failed to get non-empty ExecutionFrame at entry " 00102 << entry << " and path \"" << path << "\"" << endreq; 00103 return StatusCode::FAILURE; 00104 } 00105 log << MSG::DEBUG << "Found ExecutionFrame object at entry " 00106 << entry << " and path \"" << path << "\"" << endreq; 00107 00108 log << MSG::DEBUG << "Got " << ef.size() << " HeaderObjects" << endreq; 00109 00110 for (size_t ind=0; ind < ef.size(); ++ind) { 00111 log << MSG::DEBUG << ind << " " << ef[ind].first << endreq; 00112 this->put(ef[ind].second,ef[ind].first); 00113 } 00114 00115 return StatusCode::SUCCESS; 00116 }
Definition at line 43 of file TestInputLoadAlg.h.
Definition at line 44 of file TestInputLoadAlg.h.
std::string TestInputLoadAlg::m_path [private] |
Definition at line 45 of file TestInputLoadAlg.h.
int TestInputLoadAlg::m_test_type [private] |
Definition at line 46 of file TestInputLoadAlg.h.