#include <DybTrimIO.h>
Inheritance diagram for DybTrimIO:
Public Member Functions | |
DybTrimIO (const std::string &name, ISvcLocator *pSvcLocator) | |
StatusCode | initialize () |
StatusCode | execute () |
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 | |
bool | m_saveFlag |
std::string | m_nowLocation |
std::string | m_regSeqLocation |
ISaveB4TrimAesSvc * | m_pSaveB4TrimAesSvc |
all the needed services //////////////// Save before trimming | |
std::string | m_pSaveB4TrimAesSvcName |
IDybStorageSvc * | m_pDybStorageSvc |
dyb storage which do the real IO stuff | |
std::string | m_pDybStorageSvcName |
IDataManagerSvc * | m_pArchiveSvc |
AES. | |
std::string | m_pArchiveSvcName |
IArchiveTrimSvc * | m_pTrimSvc |
triming | |
std::string | m_pTrimSvcName |
Definition at line 26 of file DybTrimIO.h.
DybTrimIO::DybTrimIO | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
Definition at line 20 of file DybTrimIO.cc.
00020 : 00021 GaudiAlgorithm(name, pSvcLocator), 00022 m_pSaveB4TrimAesSvc(0), 00023 m_pDybStorageSvc(0), 00024 m_pArchiveSvc(0), 00025 m_pTrimSvc(0) 00026 { 00027 declareProperty("SaveFlag",m_saveFlag=false,"Save or not"); 00028 00029 declareProperty("NowLocation", 00030 m_nowLocation = DayaBay::RegistrationSequenceLocation::Default, 00031 "Location to determine current time, default: RegistrationSequence"); 00032 00033 declareProperty("RegSeqLocation", 00034 m_regSeqLocation=DayaBay::RegistrationSequenceLocation::Default, 00035 "Location to RegistrationSequence"); 00036 00037 declareProperty("SaveB4TrimAesSvc", 00038 m_pSaveB4TrimAesSvcName="SaveB4TrimAesSvc", 00039 "Name of SaveB4TrimAesSvc"); 00040 00041 declareProperty("DybStorageSvc", 00042 m_pDybStorageSvcName="DybStorageSvc", 00043 "Name of an IDybStorageSvc"); 00044 00045 declareProperty("ArchiveSvc", 00046 m_pArchiveSvcName="EventDataArchiveSvc", 00047 "Name of AES"); 00048 00049 declareProperty("TrimSvc", 00050 m_pTrimSvcName="ArchiveTrimSvc", 00051 "Name of trimming service"); 00052 00053 }
StatusCode DybTrimIO::initialize | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 57 of file DybTrimIO.cc.
00058 { 00059 // 00060 StatusCode status; 00061 debug() << " DybTrimIO initialize()" << endreq; 00062 00063 if ( m_saveFlag ) { 00064 // SaveB4TrimAesSvc 00065 status = service(m_pSaveB4TrimAesSvcName, 00066 m_pSaveB4TrimAesSvc); 00067 00068 debug()<<"m_pSaveB4TrimAesSvc "<<m_pSaveB4TrimAesSvc<<endreq; 00069 if (status.isFailure()) { 00070 error()<<"Service [SaveB4TrimAesSvc] not found"<<endreq; 00071 return StatusCode::FAILURE; 00072 } 00073 00074 // DybStorageSvc 00075 status = service(m_pDybStorageSvcName, 00076 m_pDybStorageSvc); 00077 00078 debug()<<"m_pDybStorageSvc "<<m_pDybStorageSvc<<endreq; 00079 if (status.isFailure()) { 00080 error()<<"Service [DybStorageSvc] not found"<<endreq; 00081 return StatusCode::FAILURE; 00082 } 00083 } 00084 00085 // Get archive store 00086 status = service(m_pArchiveSvcName, 00087 m_pArchiveSvc); 00088 00089 debug()<<"m_pArchiveSvc "<<m_pArchiveSvc<<endreq; 00090 if (status.isFailure()) { 00091 error()<<"Service [EventDataArchiveSvc] not found"<<endreq; 00092 return StatusCode::FAILURE; 00093 } 00094 00095 // Get trimming Svc 00096 status = service(m_pTrimSvcName, 00097 m_pTrimSvc); 00098 00099 debug()<<"m_pTrimSvc "<<m_pTrimSvc<<endreq; 00100 if (status.isFailure()) { 00101 error()<<"Service [ArchiveTrimSvc] not found"<<endreq; 00102 return StatusCode::FAILURE; 00103 } 00105 00106 return StatusCode::SUCCESS; 00107 }
StatusCode DybTrimIO::execute | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 111 of file DybTrimIO.cc.
00112 { 00113 StatusCode sc; 00114 debug() << "DybTrimIO execute()" << endreq; 00115 00116 // get the data object at the "now" location 00117 SmartDataPtr<const DayaBay::TemporalDataObject> 00118 pTemoral(eventSvc(),m_nowLocation); 00119 // check the pointer 00120 if (0 == pTemoral) { 00121 error()<<"Failed to retrieve TemporalDataObject from Event Store"<<endreq; 00122 return StatusCode::FAILURE; 00123 } 00124 debug()<<"Current time in DybTrimIO: "<<pTemoral->earliest()<<endreq; 00125 00126 // save before trim 00127 if(m_saveFlag) { 00128 sc = m_pSaveB4TrimAesSvc->store(m_regSeqLocation, 00129 m_pDybStorageSvc, 00130 m_pArchiveSvc, 00131 m_pTrimSvc, 00132 pTemoral->earliest()); 00133 if(sc.isFailure()) { 00134 debug()<<"Failed to write"<<endreq; 00135 return StatusCode::FAILURE; 00136 } 00137 } 00138 00139 // trim base on it 00140 sc = m_pTrimSvc->trim(m_pArchiveSvc,pTemoral->earliest()); 00141 if(sc.isFailure()) { 00142 debug()<<"Failed to trim"<<endreq; 00143 return StatusCode::FAILURE; 00144 } 00145 00146 return StatusCode::SUCCESS; 00147 }
StatusCode DybTrimIO::finalize | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 151 of file DybTrimIO.cc.
00152 { 00153 StatusCode sc; 00154 debug() << "DybTrimIO finalize()" << endreq; 00155 00156 // Trim the rest of elements off 00157 // Some data might still in AES and hasn't been written out. 00158 // Use the limit of TimeStamp to trigger the saving and trimming 00159 00160 // save before trim 00161 if(m_saveFlag) { 00162 sc = m_pSaveB4TrimAesSvc->store(m_regSeqLocation, 00163 m_pDybStorageSvc, 00164 m_pArchiveSvc, 00165 m_pTrimSvc, 00166 TimeStamp::GetEOT()); 00167 if(sc.isFailure()) { 00168 debug()<<"Failed to write"<<endreq; 00169 return StatusCode::FAILURE; 00170 } 00171 } 00172 00173 // trim base on it 00174 sc = m_pTrimSvc->trim(m_pArchiveSvc,TimeStamp::GetEOT()); 00175 if(sc.isFailure()) { 00176 debug()<<"Failed to trim"<<endreq; 00177 return StatusCode::FAILURE; 00178 } 00179 00180 // Now release these service 00181 if (0 != m_pTrimSvc) { 00182 m_pTrimSvc->release(); 00183 } 00184 00185 if (0 != m_pArchiveSvc) { 00186 m_pArchiveSvc->release(); 00187 } 00188 00189 if(m_saveFlag) { 00190 if (0 != m_pSaveB4TrimAesSvc) { 00191 m_pSaveB4TrimAesSvc->release(); 00192 } 00193 00194 if (0 != m_pDybStorageSvc) { 00195 m_pDybStorageSvc->release(); 00196 } 00197 } 00198 00199 return StatusCode::SUCCESS; 00200 }
bool DybTrimIO::m_saveFlag [private] |
Definition at line 37 of file DybTrimIO.h.
std::string DybTrimIO::m_nowLocation [private] |
Definition at line 40 of file DybTrimIO.h.
std::string DybTrimIO::m_regSeqLocation [private] |
Definition at line 43 of file DybTrimIO.h.
ISaveB4TrimAesSvc* DybTrimIO::m_pSaveB4TrimAesSvc [private] |
all the needed services //////////////// Save before trimming
Definition at line 48 of file DybTrimIO.h.
std::string DybTrimIO::m_pSaveB4TrimAesSvcName [private] |
Definition at line 49 of file DybTrimIO.h.
IDybStorageSvc* DybTrimIO::m_pDybStorageSvc [private] |
std::string DybTrimIO::m_pDybStorageSvcName [private] |
Definition at line 53 of file DybTrimIO.h.
IDataManagerSvc* DybTrimIO::m_pArchiveSvc [private] |
std::string DybTrimIO::m_pArchiveSvcName [private] |
Definition at line 57 of file DybTrimIO.h.
IArchiveTrimSvc* DybTrimIO::m_pTrimSvc [private] |
std::string DybTrimIO::m_pTrimSvcName [private] |
Definition at line 61 of file DybTrimIO.h.