2 #include <initializer_list> 16 template <
typename Container>
17 bool veto(
const Container* props,
const char*
name )
23 template <
typename F,
typename... Args>
24 void for_each_arg( F&& f, Args&&...
args )
34 class populate_JobOptionsSvc_t
40 template <
typename Properties,
typename Key,
typename Value>
43 const auto& key = std::get<0>( arg );
44 const auto& value = std::get<1>( arg );
45 if ( isDefault( value ) || veto( props, key ) )
return;
51 template <
typename... Args>
57 std::forward<Args>(
args )... );
59 ~populate_JobOptionsSvc_t()
93 m_timerTool = tool<ISequencerTimerTool>(
"SequencerTimerTool" );
110 status = entry.algorithm()->sysInitialize();
112 return Error(
"Can not initialize " + entry.algorithm()->name(), status );
150 verbose() <<
"Algorithm " << myAlg->
name() <<
" returned filter passed " << ( passed ?
"true" :
"false" )
152 if ( entry.reverse() ) passed = !passed;
169 if (
m_modeOR ? passed : !passed ) {
194 auto jos = service<IJobOptionsSvc>(
"JobOptionsSvc" );
197 auto appMgr = service<IAlgManager>(
"ApplicationMgr" );
198 for (
const auto& item :
m_names.value() ) {
248 warning() << theName <<
" is not an Algorithm - failed dynamic_cast" <<
endmsg;
252 warning() <<
"Unable to find or create " << theName <<
endmsg;
260 msg <<
"Member list: ";
266 if ( alg->
name() != typ ) os <<
"/" << alg->
name();
269 if ( !isDefault(
context() ) ) msg <<
", with context '" <<
context() <<
"'";
291 m_timerTool = tool<ISequencerTimerTool>(
"SequencerTimerTool" );
313 if (
m_entries.size() > 1 ) os <<
"seq(";
315 const auto op =
m_modeOR ?
" | " :
" & ";
318 for (
auto iterator = first; iterator != last; ++iterator ) {
319 if ( iterator != first ) os << op;
320 if ( iterator->reverse() ) os <<
"~";
321 iterator->algorithm()->toControlFlowExpression( os );
constexpr static const auto FAILURE
Gaudi::Property< bool > m_measureTime
Definition of the MsgStream class used to transmit messages.
StatusCode execute() override
Algorithm execution.
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
StatusCode createSubAlgorithm(const std::string &type, const std::string &name, Algorithm *&pSubAlg)
Create a sub algorithm.
T forward_as_tuple(T...args)
const std::string & name() const override
The identifying name of the algorithm object.
void setFilterPassed(bool state) const override
Set the filter passed flag to the specified state.
Implementation of property with value of concrete type.
virtual StatusCode sysStart()=0
Startup method invoked by the framework.
const std::string & rootInTES() const
Returns the "rootInTES" string.
bool isExecuted() const override
Has this algorithm been executed since the last reset?
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
StatusCode initialize() override
Algorithm initialization.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
StatusCode initialize() override
standard initialization method
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.
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
bool PyHelper() addPropertyToCatalogue(IInterface *p, char *comp, char *name, char *value)
class MergingTransformer< Out(const vector_of_const_< In > void
const std::string & context() const
Returns the "context" string. Used to identify different processing states.
Algorithm * algorithm() const
virtual StatusCode sysInitialize()=0
Initialization method invoked by the framework.
std::ostream & toControlFlowExpression(std::ostream &os) const override
Produce string represention of the control flow expression.
virtual StatusCode addPropertyToCatalogue(const std::string &client, const Gaudi::Details::PropertyBase &property)=0
Add a property into the JobOptions catalog.
TYPE * get() const
Get interface pointer.
ISequencerTimerTool * m_timerTool
Pointer to the timer tool.
bool isEnabled() const override
Is this algorithm enabled or disabled?
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.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
This class is used for returning status codes from appropriate routines.
const EventContext & getContext() const override
get the context
The useful base class for data processing algorithms.
void membershipHandler(Gaudi::Details::PropertyBase &theProp)
for asynchronous changes in the list of algorithms
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
virtual const std::vector< const Gaudi::Details::PropertyBase * > * getProperties(const std::string &client) const =0
Get the properties associated to a given client.
Gaudi::Property< bool > m_modeOR
constexpr static const auto SUCCESS
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::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Base class from which all concrete algorithm classes should be derived.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
const std::string & type() const
virtual StatusCode removePropertyFromCatalogue(const std::string &client, const std::string &name)=0
Remove a property from the JobOptions catalog.
const StatusCode & ignore() const
Ignore/check StatusCode.
bool filterPassed() const override
Did this algorithm pass or fail its filter criterion for the last event?
void setExecuted(bool state) const override
Set the executed flag to the specified state.
Gaudi::Property< bool > m_returnOK
GaudiSequencer(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
AttribStringParser::Iterator begin(const AttribStringParser &parser)
const std::string & name() const
std::string typeName(const std::type_info &typ)
StatusCode release(const IInterface *interface) const
Manual forced (and 'safe') release of the active tool or service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
int m_timer
Timer number for the sequencer.
StatusCode sysExecute(const EventContext &ctx) override
The actions to be performed by the algorithm on an event.
std::vector< AlgorithmEntry > m_entries
List of algorithms to process.
Gaudi::StateMachine::State FSMState() const override
returns the current state of the algorithm
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)