#include <StagePuller.h>
Inheritance diagram for StagePuller:
Public Member Functions | |
StagePuller (const std::string &name, ISvcLocator *pSvcLocator) | |
virtual | ~StagePuller () |
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 Attributes | |
ToolHandle< IStage > | m_stage |
Property: "Stage". Name of the stage to pull from. | |
int | m_runTimeSeconds |
Property: "RunTimeSeconds". | |
TimeStamp | m_startTime |
bv@bnl.gov Mon Oct 27 14:35:36 2008
Definition at line 25 of file StagePuller.h.
StagePuller::StagePuller | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
Definition at line 6 of file StagePuller.cc.
00007 : GaudiAlgorithm(name,pSvcLocator) 00008 , m_stage("Stage") 00009 , m_startTime(TimeStamp::GetBOT()) 00010 { 00011 declareProperty("Stage",m_stage, "Stage to pull from."); 00012 declareProperty("RunTimeSeconds",m_runTimeSeconds=0, 00013 "Period of time, in seconds, that the job should run, if non-zero."); 00014 }
StagePuller::~StagePuller | ( | ) | [virtual] |
StatusCode StagePuller::initialize | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 20 of file StagePuller.cc.
00021 { 00022 StatusCode sc = this->GaudiAlgorithm::initialize(); 00023 if (sc.isFailure()) return sc; 00024 00025 MsgStream log(msgSvc(), name()); 00026 00027 log << MSG::DEBUG 00028 << "Retrieving stage " << m_stage.typeAndName() << endreq; 00029 if (m_stage.retrieve().isFailure()) { 00030 log << MSG::ERROR 00031 << "Failed to retrieve " << m_stage << endreq; 00032 return StatusCode::FAILURE; 00033 } 00034 00035 return StatusCode::SUCCESS; 00036 }
StatusCode StagePuller::execute | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 38 of file StagePuller.cc.
00039 { 00040 MsgStream log(msgSvc(), name()); 00041 00042 log << MSG::DEBUG 00043 << "===> Pulling from last stage" << endreq; 00044 00045 IStageData* data = 0; 00046 StatusCode sc = m_stage->nextElement(data,true); 00047 if (!data || sc.isFailure()) { 00048 log << MSG::WARNING 00049 << "Failed to pull next element" << endreq; 00050 return sc; 00051 } 00052 00053 if (m_runTimeSeconds) { 00054 if (m_startTime == TimeStamp::GetBOT()) { 00055 m_startTime = data->time(); 00056 } 00057 double dt_seconds = data->time() - m_startTime; 00058 if (dt_seconds > m_runTimeSeconds) { 00059 00060 } 00061 } 00062 00063 log << MSG::DEBUG 00064 << "Pulled data at time: " << data->time() 00065 << endreq; 00066 00067 IStageData* hsdb = dynamic_cast< IStageData* >(data); 00068 if (!hsdb) { 00069 debug() << "StageData not a StageData, oh well." << endreq; 00070 delete data; 00071 return StatusCode::SUCCESS; 00072 } 00073 00074 DayaBay::HeaderObject& ho = hsdb->header(); 00075 put(&ho,ho.defLoc()); 00076 delete data; 00077 return StatusCode::SUCCESS; 00078 }
StatusCode StagePuller::finalize | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 80 of file StagePuller.cc.
00081 { 00082 m_stage->release(); 00083 return this->GaudiAlgorithm::finalize(); 00084 }
ToolHandle<IStage> StagePuller::m_stage [private] |
int StagePuller::m_runTimeSeconds [private] |
Property: "RunTimeSeconds".
Run time in seconds. If non-zero, this algorithm will monitor the period of time that has passed from the first event to each subsequent event. When that time period has surpassed the RunTime the algorithm will indicate to the framework that the current exection cycle should be the last one.
Definition at line 48 of file StagePuller.h.
TimeStamp StagePuller::m_startTime [private] |
Definition at line 49 of file StagePuller.h.