The Gaudi Framework  v32r0 (3325bb39)
GaudiSequencer.h
Go to the documentation of this file.
1 #ifndef GAUDISEQUENCER_H
2 #define GAUDISEQUENCER_H 1
3 
4 // Include files
5 // from Gaudi
6 #include "GaudiAlg/GaudiAlg.h"
7 #include "GaudiAlg/GaudiCommon.h"
8 #include <Gaudi/Sequence.h>
9 
10 // Forward declarations
12 
28 class GAUDI_API GaudiSequencer : public GaudiCommon<Gaudi::Sequence> {
29 public:
32 
33  StatusCode initialize() override;
34  StatusCode execute( const EventContext& ctx ) const override;
35  StatusCode sysExecute( const EventContext& ctx ) override;
36 
38  std::ostream& toControlFlowExpression( std::ostream& os ) const override;
39 
40 private:
41  class AlgorithmEntry final {
42  public:
44  AlgorithmEntry( Gaudi::Algorithm* alg ) : m_algorithm( alg ) {}
45 
46  void setReverse( bool flag ) { m_reverse = flag; }
47 
48  Gaudi::Algorithm* algorithm() const { return m_algorithm; }
49  bool reverse() const { return m_reverse; }
50  void setTimer( int nb ) { m_timer = nb; }
51  int timer() const { return m_timer; }
52 
53  private:
54  Gaudi::Algorithm* m_algorithm = nullptr;
55  bool m_reverse = false;
56  int m_timer = 0;
57  };
58 
60  StatusCode decodeNames();
61 
63  void membershipHandler();
64 
66  this, "VetoObjects", {}, "skip execute if one or more of these TES objects exist"};
68  this, "RequireObjects", {}, "execute only if one or more of these TES objects exist"};
69 
71  this, "Members", {}, &GaudiSequencer::membershipHandler, "list of algorithms"};
72  Gaudi::Property<bool> m_sequential = {this, "Sequential", false, "execute members one at a time"};
73  Gaudi::Property<bool> m_modeOR = {this, "ModeOR", false, "use OR logic instead of AND"};
74  Gaudi::Property<bool> m_ignoreFilter = {this, "IgnoreFilterPassed", false, "always continue"};
75  Gaudi::Property<bool> m_measureTime = {this, "MeasureTime", false, "measure time"};
76  Gaudi::Property<bool> m_returnOK = {this, "ReturnOK", false, "forces the sequencer to return a good status"};
77  Gaudi::Property<bool> m_shortCircuit = {this, "ShortCircuit", true, "stop processing as soon as possible"};
78  Gaudi::Property<bool> m_invert = {this, "Invert", false, "invert the logic result of the sequencer"};
79 
81  ISequencerTimerTool* m_timerTool = nullptr;
82  int m_timer;
83 };
84 #endif // GAUDISEQUENCER_H
Gaudi::Algorithm * algorithm() const
Implementation of property with value of concrete type.
Definition: Property.h:352
Sequencer for executing several algorithms, stopping when one is faulty.
void setReverse(bool flag)
This class represents an entry point to all the event specific data.
Definition: EventContext.h:24
StatusCode execute() override final
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode initialize() override
standard initialization method
void membershipHandler()
for asynchronous changes in the list of algorithms
STL class.
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:79
Implements the time measurement inside a sequencer.
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:91
int timer() const
bool reverse() const
#define GAUDI_API
Definition: Kernel.h:71
AlgorithmEntry(Gaudi::Algorithm *alg)
Standard constructor.
STL class.
void setTimer(int nb)
int m_timer
Timer number for the sequencer.
std::vector< AlgorithmEntry > m_entries
List of algorithms to process.
GaudiCommon()=delete