37#define ON_DEBUG if ( msgLevel( MSG::DEBUG ) )
56 if ( status.isFailure() )
return status;
59 fatal() <<
"property Output not set. OutputStream instances require an output" <<
endmsg;
68 fatal() <<
"Unable to locate IDataManagerSvc interface" <<
endmsg;
86 fatal() <<
"Unable to connect to conversion service." <<
endmsg;
111 if ( theAlgorithm ) {
117 for (
const auto& i : a.second )
addItem( items, i );
186 if ( sel->begin() != sel->end() ) {
191 for (
auto& j : *sel ) {
200 }
catch (
const std::exception& excpt ) {
201 const std::string loc = ( j->registry() ? j->registry()->identifier() :
"UnRegistered" );
208 for (
auto& j : *sel ) {
213 }
catch (
const std::exception& excpt ) {
214 const std::string loc = ( j->registry() ? j->registry()->identifier() :
"UnRegistered" );
235 if ( level < m_currentItem->depth() ) {
283 auto alg = iAlgItems.first;
284 const Items& items = iAlgItems.second;
285 if ( passed( alg ) ) {
287 debug() <<
"Algorithm '" << alg->name() <<
"' fired. Adding " << items <<
endmsg;
288 for (
const auto& i : items ) {
296 error() <<
"Cannot write mandatory (algorithm dependent) object(s) (Not found) " <<
m_currentItem->path()
306 std::set<DataObject*> unique;
307 std::vector<DataObject*> tmp;
310 if ( !unique.count( o ) ) {
327 for (
auto& i : itms )
delete i;
333 auto matchPath = [&](
const DataStoreItem* i ) {
return i->path() == path; };
345 auto sep = descriptor.rfind(
"#" );
346 std::string obj_path = descriptor.substr( 0, sep );
347 if ( sep != std::string::npos ) {
348 std::string slevel = descriptor.substr( sep + 1 );
349 level = ( slevel ==
"*" ) ? 9999999 : std::stoi( slevel );
352 size_t idx = obj_path.find(
"/", 1 );
353 while ( idx != std::string::npos ) {
354 std::string sub_item = obj_path.substr( 0, idx );
356 idx = obj_path.find(
"/", idx + 1 );
360 const auto& item = itms.back();
362 debug() <<
"Adding OutputStream item " << item->path() <<
" with " << item->depth() <<
" level(s)." <<
endmsg;
369 std::string dbType, svc, shr;
371 const std::string& tag = attrib.tag;
372 const std::string& val = attrib.value;
393 if ( ::strncasecmp( val.c_str(),
"RECREATE", 3 ) == 0 )
395 else if ( ::strncasecmp( val.c_str(),
"READ", 3 ) == 0 )
420 if ( !dbType.empty() || !svc.empty() ) {
421 std::string typ = !dbType.empty() ? dbType : svc;
428 status = ipers->getService( typ, cnvSvc );
430 fatal() <<
"Unable to locate IConversionSvc interface of database type " << typ <<
endmsg;
436 fatal() <<
"Unable to locate IConversionSvc interface (Unknown technology) " <<
endmsg
437 <<
"You either have to specify a technology name or a service name!" <<
endmsg
438 <<
"Please correct the job option \"" <<
name() <<
".Output\" !" <<
endmsg;
460 fatal() <<
"Can't locate ApplicationMgr!!!" <<
endmsg;
463 if ( !theAlgorithm ) {
warning() <<
"Failed to decode Algorithm name " << theName <<
endmsg; }
469 std::vector<Gaudi::Algorithm*>& theAlgs ) {
474 for (
const auto& it : theNames.value() ) {
477 if ( theAlgorithm ) {
479 if ( std::find( std::begin( theAlgs ), std::end( theAlgs ), theAlgorithm ) == std::end( theAlgs ) ) {
480 theAlgorithm->addRef();
481 theAlgs.push_back( theAlgorithm );
484 info() << it <<
" doesn't exist - ignored" <<
endmsg;
void toupper(std::string &s)
std::vector< DataObject * > IDataSelector
This is only a placeholder to allow me compiling until the responsible guy does his work!
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
#define DECLARE_COMPONENT(type)
Provide serialization function (output only) for some common STL classes (vectors,...
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
A DataObject is the base class of any identifiable object on any data store.
Description of the DataStoreItem class.
Base class from which all concrete algorithm classes should be derived.
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
const std::string & name() const override
The identifying name of the algorithm object.
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Implementation of property with value of concrete type.
Parse attribute strings allowing iteration over the various attributes.
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Opaque address interface definition.
Data persistency service interface.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
virtual DataObject * object() const =0
Retrieve object behind the link.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual void setAddress(IOpaqueAddress *pAddress)=0
Set/Update Opaque storage address.
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
Base class for all Incidents (computing events).
A small to stream Data I/O.
Gaudi::Property< std::vector< std::string > > m_requireNames
Items m_optItemList
Vector of optional items to be saved to this stream.
StatusCode execute() override
Working entry point.
Gaudi::Property< bool > m_doPreLoadOpt
Items m_itemList
Vector of items to be saved to this stream.
void clearSelection()
Clear list of selected objects.
DataStoreItem * findItem(const std::string &path)
Find single item identified by its path (exact match)
StatusCode collectFromSubTree(DataObject *)
SmartIF< IConversionSvc > m_pConversionSvc
Keep reference to the data conversion service.
std::vector< DataStoreItem * > Items
int m_events
Number of events written to this output stream.
std::vector< Gaudi::Algorithm * > m_vetoAlgs
Vector of Algorithms that this stream is vetoed by.
std::vector< Gaudi::Algorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
SmartIF< IDataProviderSvc > m_pDataProvider
Keep reference to the data provider service.
StatusCode finalize() override
Terminate OutputStream.
Gaudi::Property< ItemNames > m_optItemNames
Gaudi::Property< std::string > m_outputName
virtual StatusCode collectObjects()
Collect all objects to be written to the output stream.
std::vector< Gaudi::Algorithm * > m_requireAlgs
Vector of Algorithms that this stream requires.
virtual StatusCode connectConversionSvc()
AlgDependentItems m_algDependentItems
Items to be saved for specific algorithms.
DataStoreItem * m_currentItem
Keep track of the current item.
Gaudi::Property< ItemNames > m_itemNames
Gaudi::Property< std::vector< std::string > > m_acceptNames
IDataSelector m_objects
Collection of objects being selected.
SmartIF< IDataManagerSvc > m_pDataManager
Keep reference to the data manager service.
IDataSelector * selectedObjects()
Return the list of selected objects.
bool m_fireIncidents
should I fire incidents for writing opening/closing etc?
virtual StatusCode writeObjects()
Select the different objects and write them to file.
bool isEventAccepted() const
Test whether this event should be output.
StatusCode initialize() override
Initialize OutputStream.
void decodeAlgorithms(Gaudi::Property< std::vector< std::string > > &theNames, std::vector< Gaudi::Algorithm * > &theAlgs)
Decode specified list of Algorithms.
void clearItems(Items &itms)
Clear item list.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Gaudi::Property< bool > m_doPreLoad
Gaudi::Property< std::string > m_persName
Gaudi::Property< bool > m_verifyItems
virtual bool collect(IRegistry *dir, int level)
Store agent's classback.
Gaudi::Property< std::string > m_output
Gaudi::Algorithm * decodeAlgorithm(const std::string &theName)
Decode a single algorithm name.
Gaudi::Property< AlgDependentItemNames > m_algDependentItemList
virtual bool hasInput() const
Tell if the instance has been configured with input items or not.
void addItem(Items &itms, const std::string &descriptor)
Add item to output streamer list.
Gaudi::Property< std::string > m_storeName
Gaudi::Property< std::vector< std::string > > m_vetoNames
std::string m_outputType
Output type: NEW(NEW,CREATE,WRITE,RECREATE), UPDATE)
StatusCode start() override
Start OutputStream.
Small smart pointer class with automatic reference counting for IInterface.
TYPE * get() const
Get interface pointer.
This class is used for returning status codes from appropriate routines.
StatusCode andThen(F &&f, ARGS &&... args) const
Chain code blocks making the execution conditional a success result.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE
GAUDI_API const EventContext & currentContext()
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.