2 #include <initializer_list> 19 template <
typename Container>
20 bool veto(
const Container* props,
const char*
name ) {
25 template <
typename F,
typename... Args>
26 void for_each_arg( F&& f, Args&&...
args ) {
35 class populate_JobOptionsSvc_t {
40 template <
typename Properties,
typename Key,
typename Value>
42 const auto& key = std::get<0>( arg );
43 const auto& value = std::get<1>( arg );
44 if ( isDefault( value ) || veto( props, key ) )
return;
50 template <
typename... Args>
55 std::forward<Args>(
args )... );
57 ~populate_JobOptionsSvc_t() {
78 if ( !status.isSuccess() )
return status;
80 m_timerTool = tool<ISequencerTimerTool>(
"SequencerTimerTool" );
97 if ( !status.isSuccess() ) {
return Error(
"Can not initialize " + entry.algorithm()->name(), status ); }
133 verbose() <<
"Algorithm " << myAlg->
name() <<
" returned filter passed " << ( passed ?
"true" :
"false" )
135 if ( entry.reverse() ) passed = !passed;
152 if (
m_modeOR ? passed : !passed ) {
162 state.setState( AlgExecState::State::Done );
177 auto jos = service<IJobOptionsSvc>(
"JobOptionsSvc" );
180 auto appMgr = service<IAlgManager>(
"ApplicationMgr" );
181 for (
const auto& item :
m_names.value() ) {
196 result = createSubAlgorithm( theType, theName, myAlg );
201 subAlgorithms()->push_back( myAlg );
229 if ( msgLevel(
MSG::DEBUG ) ) debug() <<
"Added algorithm " << theName <<
endmsg;
231 warning() << theName <<
" is not a Gaudi::Algorithm - failed dynamic_cast" <<
endmsg;
235 warning() <<
"Unable to find or create " << theName <<
endmsg;
243 msg <<
"Member list: ";
249 if (
alg->name() != typ ) os <<
"/" <<
alg->name();
290 if (
m_entries.size() > 1 ) os <<
"seq(";
292 const auto op =
m_modeOR ?
" | " :
" & ";
295 for (
auto iterator = first; iterator != last; ++iterator ) {
296 if ( iterator != first ) os << op;
297 if ( iterator->reverse() ) os <<
"~";
298 iterator->algorithm()->toControlFlowExpression( os );
310 if ( registerContext() ) { algCtx = contextSvc(); }
316 [&](
const std::string& loc ) {
return this->exist<DataObject>( evtSvc(), loc ); } );
318 if ( msgLevel(
MSG::DEBUG ) ) debug() << *it <<
" found, skipping event " <<
endmsg;
326 [&](
const std::string& loc ) {
return this->exist<DataObject>( evtSvc(), loc ); } );
Gaudi::Property< bool > m_measureTime
Definition of the MsgStream class used to transmit messages.
T forward_as_tuple(T... args)
Helper "sentry" class to automatize the safe register/unregister the algorithm's context.
Implementation of property with value of concrete type.
virtual StatusCode sysStart()=0
Startup method invoked by the framework.
StatusCode initialize() override
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
bool PyHelper() addPropertyToCatalogue(IInterface *p, char *comp, char *name, char *value)
WARN_UNUSED StatusCode Error(const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
Print the error message and return with the given StatusCode.
virtual const std::vector< const Gaudi::Details::PropertyBase * > * getProperties(const std::string &client) const =0
Get the properties associated to a given client.
constexpr static const auto SUCCESS
bool filterPassed() const
TYPE * get() const
Get interface pointer.
This class represents an entry point to all the event specific data.
virtual StatusCode sysInitialize()=0
Initialization method invoked by the framework.
virtual StatusCode addPropertyToCatalogue(const std::string &client, const Gaudi::Details::PropertyBase &property)=0
Add a property into the JobOptions catalog.
ISequencerTimerTool * m_timerTool
Pointer to the timer tool.
StatusCode sysExecute(const EventContext &ctx) override
Gaudi::Property< bool > m_ignoreFilter
Helper class to parse a string of format "type/name".
Gaudi::Property< std::vector< std::string > > m_names
Gaudi::Property< bool > m_invert
Main interface for the JobOptions service.
This class is used for returning status codes from appropriate routines.
Gaudi::Algorithm * algorithm() const
const std::string & context() const
Returns the "context" string. Used to identify different processing states.
Gaudi::Property< bool > m_modeOR
StatusCode decodeNames()
Decode a vector of string.
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Gaudi::Property< bool > m_shortCircuit
const std::string & rootInTES() const
Returns the "rootInTES" string.
StatusCode release(const IInterface *interface) const
Manual forced (and 'safe') release of the active tool or service.
void membershipHandler()
for asynchronous changes in the list of algorithms
const StatusCode & ignore() const
Ignore/check StatusCode.
StatusCode execute(const EventContext &ctx) const override
AlgExecState & execState(const EventContext &ctx) const override
reference to AlgExecState of Alg
virtual StatusCode removePropertyFromCatalogue(const std::string &client, const std::string &name)=0
Remove a property from the JobOptions catalog.
Base class from which all concrete algorithm classes should be derived.
constexpr static const auto FAILURE
An abstract interface for Algorithm Context Service.
Gaudi::Property< bool > m_returnOK
AttribStringParser::Iterator begin(const AttribStringParser &parser)
bool isEnabled() const override
Is this algorithm enabled or disabled?
Gaudi::Property< std::vector< std::string > > m_requireObjs
std::string typeName(const std::type_info &typ)
Gaudi::Property< std::vector< std::string > > m_vetoObjs
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
int m_timer
Timer number for the sequencer.
std::vector< AlgorithmEntry > m_entries
List of algorithms to process.
const std::string & name() const override
The identifying name of the algorithm object.
StatusCode sysExecute(const EventContext &ctx) override
The actions to be performed by the algorithm on an event.
std::ostream & toControlFlowExpression(std::ostream &os) const override
Produce string represention of the control flow expression.