13 template <
typename T,
typename... Args>
24 class populate_JobOptionsSvc_t
33 static_assert( std::tuple_size<T>::value == 2,
"Expecting an std::tuple key-value pair" );
36 if ( !isDefault( std::get<1>( t ) ) )
37 m_props.
push_back( make_unique_<prop_t>( std::get<0>( t ), std::get<1>( t ) ) );
39 template <
typename T,
typename... Args>
40 void process( T&& t, Args&&...
args )
42 process( std::forward<T>( t ) );
43 process( std::forward<Args>(
args )... );
49 for (
const auto& i : *props ) {
53 if ( j ==
std::end( m_props ) )
continue;
55 if ( m_props.
empty() )
break;
60 template <
typename... Args>
64 process( std::forward<Args>(
args )... );
65 if ( !m_props.
empty() ) check_veto();
71 ~populate_JobOptionsSvc_t()
80 template <
typename Stream,
typename Container,
typename Separator,
typename Transform>
81 Stream&
ostream_joiner( Stream& os,
const Container&
c, Separator sep, Transform trans )
85 if ( first != last ) {
86 os << trans( *first );
89 for ( ; first != last; ++first ) os << sep << trans( *first );
118 if ( !status.
isSuccess() )
return status;
120 m_timerTool = tool<ISequencerTimerTool>(
"SequencerTimerTool" );
137 status = entry.algorithm()->sysInitialize();
139 return Error(
"Can not initialize " + entry.algorithm()->name(), status );
178 verbose() <<
"Algorithm " << myAlg->
name() <<
" returned filter passed " << ( passed ?
"true" :
"false" )
180 if ( entry.reverse() ) passed = !passed;
197 if (
m_modeOR ? passed : !passed ) {
255 auto jos = service<IJobOptionsSvc>(
"JobOptionsSvc" );
258 auto appMgr = service<IAlgManager>(
"ApplicationMgr" );
259 for (
const auto& item :
m_names.value() ) {
313 warning() << theName <<
" is not an Algorithm - failed dynamic_cast" <<
endmsg;
317 warning() <<
"Unable to find or create " << theName <<
endmsg;
325 msg <<
"Member list: ";
329 return ( alg->
name() == typ ) ? alg->
name() : ( typ +
"/" + alg->
name() );
331 if ( !isDefault(
context() ) ) msg <<
", with context '" <<
context() <<
"'";
357 m_timerTool = tool<ISequencerTimerTool>(
"SequencerTimerTool" );
380 const auto op =
m_modeOR ?
" | " :
" & ";
383 auto iterator = first;
384 while (iterator != last) {
385 if (iterator != first) os << op;
386 if (iterator->reverse()) os <<
"~";
387 iterator->algorithm()->toControlFlowExpression(os);
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.
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
const std::string name() const
property name
bool isSuccess() const
Test for a status code of SUCCESS.
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)
const std::string & context() const
Returns the "context" string. Used to identify different processing states.
Algorithm * algorithm() const
bool isFailure() const
Test for a status code of FAILURE.
StatusCode endRun() override
Algorithm endRun.
virtual StatusCode sysInitialize()=0
Initialization method invoked by the framework.
auto begin(reverse_wrapper< T > &w)
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".
void setExecuted(bool state) override
Set the executed flag to the specified state.
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.
StatusCode finalize() override
standard finalization method
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
auto end(reverse_wrapper< T > &w)
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
StatusCode finalize() override
Algorithm finalization.
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
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.
bool filterPassed() const override
Did this algorithm pass or fail its filter criterion for the last event?
Gaudi::Property< bool > m_returnOK
GaudiSequencer(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
const std::string & name() const
std::string typeName(const std::type_info &typ)
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
StatusCode release(const IInterface *interface) const
Manual forced (and 'safe') release of the active tool or service.
void setFilterPassed(bool state) override
Set the filter passed flag to the specified state.
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
StatusCode beginRun() override
Algorithm beginRun.