27 #define ON_DEBUG if ( msgLevel( MSG::DEBUG ) ) 48 fatal() <<
"Unable to locate IDataManagerSvc interface" <<
endmsg;
66 fatal() <<
"Unable to connect to conversion service." <<
endmsg;
97 for (
const auto& i : a.second )
addItem( items, i );
173 for (
auto& j : *sel ) {
183 const std::string loc = ( j->registry() ? j->registry()->identifier() :
"UnRegistered" );
190 for (
auto& j : *sel ) {
196 const std::string loc = ( j->registry() ? j->registry()->identifier() :
"UnRegistered" );
218 if ( level < m_currentItem->depth() ) {
270 const Items& items = iAlgItems.second;
273 debug() <<
"Algorithm '" << alg->
name() <<
"' fired. Adding " << items <<
endmsg;
274 for (
const auto& i : items ) {
296 if ( !unique.
count( o ) ) {
302 m_objects.swap( tmp );
314 for (
auto& i : itms )
delete i;
334 auto sep = descriptor.
rfind(
"#" );
336 if ( sep != std::string::npos ) {
338 level = ( slevel ==
"*" ) ? 9999999 :
std::stoi( slevel );
341 size_t idx = obj_path.
find(
"/", 1 );
342 while ( idx != std::string::npos ) {
345 idx = obj_path.
find(
"/", idx + 1 );
349 const auto& item = itms.
back();
351 debug() <<
"Adding OutputStream item " << item->path() <<
" with " << item->depth() <<
" level(s)." <<
endmsg;
363 switch (::
toupper( tag[0] ) ) {
371 switch (::
toupper( tag[1] ) ) {
381 switch (::
toupper( val[0] ) ) {
383 if (::strncasecmp( val.
c_str(),
"RECREATE", 3 ) == 0 )
385 else if (::strncasecmp( val.
c_str(),
"READ", 3 ) == 0 )
418 status = ipers->getService( typ, cnvSvc );
420 fatal() <<
"Unable to locate IConversionSvc interface of database type " << typ <<
endmsg;
426 fatal() <<
"Unable to locate IConversionSvc interface (Unknown technology) " <<
endmsg 427 <<
"You either have to specify a technology name or a service name!" <<
endmsg 428 <<
"Please correct the job option \"" <<
name() <<
".Output\" !" <<
endmsg;
445 throw GaudiException(
"Failure in OutputStream::decodeAlgorithms",
"OutputStream::acceptAlgsHandler", sc );
460 throw GaudiException(
"Failure in OutputStream::decodeAlgorithms",
"OutputStream::requireAlgsHandler", sc );
475 throw GaudiException(
"Failure in OutputStream::decodeAlgorithms",
"OutputStream::vetoAlgsHandler", sc );
490 theAlgorithm =
dynamic_cast<Algorithm*
>( theIAlg.
get() );
496 fatal() <<
"Can't locate ApplicationMgr!!!" <<
endmsg;
499 if ( !theAlgorithm ) {
500 warning() <<
"Failed to decode Algorithm name " << theName <<
endmsg;
515 for (
const auto& it : theNames.value() ) {
518 if ( theAlgorithm ) {
521 theAlgorithm->addRef();
525 info() << it <<
" doesn't exist - ignored" <<
endmsg;
535 auto passed = [](
const Algorithm* alg ) {
return alg->isExecuted() && alg->filterPassed(); };
Gaudi::Property< std::vector< std::string > > m_acceptNames
Parse attribute strings allowing iteration over the various attributes.
bool isEventAccepted() const
Test whether this event should be output.
constexpr static const auto FAILURE
void clearItems(Items &itms)
Clear item list.
virtual bool hasInput() const
Tell if the instance has been configured with input items or not.
Gaudi::Property< std::vector< std::string > > m_vetoNames
Define general base for Gaudi exception.
StatusCode decodeRequireAlgs()
Decode list of Algorithms that this stream requires.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
IDataSelector m_objects
Collection of objects being selected.
StatusCode finalize() override
Terminate OutputStream.
const std::string & name() const override
The identifying name of the algorithm object.
int m_events
Number of events written to this output stream.
Implementation of property with value of concrete type.
bool isExecuted() const override
Has this algorithm been executed since the last reset?
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
std::string m_outputType
Output type: NEW(NEW,CREATE,WRITE,RECREATE), UPDATE)
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Gaudi::Property< bool > m_verifyItems
DataStoreItem * m_currentItem
Keep track of the current item.
Gaudi::Property< std::string > m_output
Gaudi::Property< std::string > m_outputName
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Gaudi::Property< ItemNames > m_optItemNames
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
std::vector< Algorithm * > m_requireAlgs
Vector of Algorithms that this stream requires.
IDataSelector * selectedObjects()
Return the list of selected objects.
SmartIF< IDataProviderSvc > m_pDataProvider
Keep reference to the data provider service.
Description of the DataStoreItem class.
Gaudi::Property< bool > m_doPreLoad
std::unique_ptr< OutputStreamAgent > m_agent
Keep reference of agent.
const std::string & path() const
Accessor: Retrieve load path.
A small to stream Data I/O.
std::vector< Algorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
#define DECLARE_COMPONENT(type)
StatusCode decodeAlgorithms(Gaudi::Property< std::vector< std::string >> &theNames, std::vector< Algorithm * > &theAlgs)
Decode specified list of Algorithms.
virtual bool collect(IRegistry *dir, int level)
Store agent's classback.
TYPE * get() const
Get interface pointer.
DataStoreItem * findItem(const std::string &path)
Find single item identified by its path (exact match)
virtual StatusCode traverseSubTree(boost::string_ref sub_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name...
void requireAlgsHandler(Gaudi::Details::PropertyBase &theProp)
Handler for RequireAlgs Property.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
virtual StatusCode writeObjects()
Select the different objects and write them to file.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
SmartIF< IConversionSvc > m_pConversionSvc
Keep reference to the data conversion service.
virtual StatusCode connectOutput(const std::string &outputFile)=0
Connect the output file to the service.
StatusCode initialize() override
Initialize OutputStream.
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
virtual StatusCode connectConversionSvc()
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
AlgDependentItems m_algDependentItems
Items to be saved for specific algorithms.
virtual StatusCode commitOutput(const std::string &outputFile, bool do_commit)=0
Commit pending output.
Gaudi::Property< std::vector< std::string > > m_requireNames
void vetoAlgsHandler(Gaudi::Details::PropertyBase &theProp)
Handler for VetoAlgs Property.
This class is used for returning status codes from appropriate routines.
Items m_itemList
Vector of items to be saved to this stream.
void addItem(Items &itms, const std::string &descriptor)
Add item to output streamer list.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Gaudi::Property< AlgDependentItemNames > m_algDependentItemList
SmartIF< IDataManagerSvc > m_pDataManager
Keep reference to the data manager service.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
void clearSelection()
Clear list of selected objects.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
StatusCode decodeVetoAlgs()
Decode list of Algorithms that this stream is vetoed by.
constexpr static const auto SUCCESS
virtual DataObject * object() const =0
Retrieve object behind the link.
void acceptAlgsHandler(Gaudi::Details::PropertyBase &theProp)
Handler for AcceptAlgs Property.
StatusCode execute() override
Working entry point.
Base class from which all concrete algorithm classes should be derived.
Gaudi::Property< std::string > m_storeName
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
virtual void setAddress(IOpaqueAddress *pAddress)=0
Set/Update Opaque storage address.
const StatusCode & ignore() const
Ignore/check StatusCode.
bool filterPassed() const override
Did this algorithm pass or fail its filter criterion for the last event?
Base class for all Incidents (computing events).
Gaudi::Property< bool > m_doPreLoadOpt
Algorithm * decodeAlgorithm(const std::string &theName)
Decode a single algorithm name.
OutputStream(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm Constructor.
Data persistency service interface.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Opaque address interface definition.
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Gaudi::Property< std::string > m_persName
std::vector< Algorithm * > m_vetoAlgs
Vector of Algorithms that this stream is vetoed by.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
A DataObject is the base class of any identifiable object on any data store.
Gaudi::Property< ItemNames > m_itemNames
virtual StatusCode collectObjects()
Collect all objects to be written to the output stream.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
void toupper(std::string &s)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode decodeAcceptAlgs()
Decode list of Algorithms that this stream accepts.
bool m_fireIncidents
should I fire incidents for writing opening/closing etc? in the baseclass, always fire the incidents ...
Items m_optItemList
Vector of optional items to be saved to this stream.