File indexing completed on 2025-01-18 09:57:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef GAUDISEQUENCER_H
0012 #define GAUDISEQUENCER_H 1
0013
0014
0015
0016 #include "GaudiAlg/GaudiAlg.h"
0017 #include "GaudiAlg/GaudiCommon.h"
0018 #include <Gaudi/Sequence.h>
0019
0020
0021 class ISequencerTimerTool;
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 class GAUDI_API GaudiSequencer : public GaudiCommon<Gaudi::Sequence> {
0039 public:
0040
0041 using GaudiCommon::GaudiCommon;
0042
0043 StatusCode initialize() override;
0044 StatusCode execute( const EventContext& ctx ) const override;
0045 StatusCode sysExecute( const EventContext& ctx ) override;
0046
0047
0048 std::ostream& toControlFlowExpression( std::ostream& os ) const override;
0049
0050 private:
0051 class AlgorithmEntry final {
0052 public:
0053
0054 AlgorithmEntry( Gaudi::Algorithm* alg ) : m_algorithm( alg ) {}
0055
0056 void setReverse( bool flag ) { m_reverse = flag; }
0057
0058 Gaudi::Algorithm* algorithm() const { return m_algorithm; }
0059 bool reverse() const { return m_reverse; }
0060 void setTimer( int nb ) { m_timer = nb; }
0061 int timer() const { return m_timer; }
0062
0063 private:
0064 Gaudi::Algorithm* m_algorithm = nullptr;
0065 bool m_reverse = false;
0066 int m_timer = 0;
0067 };
0068
0069
0070 StatusCode decodeNames();
0071
0072
0073 void membershipHandler();
0074
0075 Gaudi::Property<std::vector<std::string>> m_vetoObjs{
0076 this, "VetoObjects", {}, "skip execute if one or more of these TES objects exist" };
0077 Gaudi::Property<std::vector<std::string>> m_requireObjs{
0078 this, "RequireObjects", {}, "execute only if one or more of these TES objects exist" };
0079
0080 Gaudi::Property<std::vector<std::string>> m_names = {
0081 this, "Members", {}, &GaudiSequencer::membershipHandler, "list of algorithms" };
0082 Gaudi::Property<bool> m_sequential = { this, "Sequential", false, "execute members one at a time" };
0083 Gaudi::Property<bool> m_modeOR = { this, "ModeOR", false, "use OR logic instead of AND" };
0084 Gaudi::Property<bool> m_ignoreFilter = { this, "IgnoreFilterPassed", false, "always continue" };
0085 Gaudi::Property<bool> m_measureTime = { this, "MeasureTime", false, "measure time" };
0086 Gaudi::Property<bool> m_returnOK = { this, "ReturnOK", false, "forces the sequencer to return a good status" };
0087 Gaudi::Property<bool> m_shortCircuit = { this, "ShortCircuit", true, "stop processing as soon as possible" };
0088 Gaudi::Property<bool> m_invert = { this, "Invert", false, "invert the logic result of the sequencer" };
0089
0090 std::vector<AlgorithmEntry> m_entries;
0091 ISequencerTimerTool* m_timerTool = nullptr;
0092 int m_timer;
0093 };
0094 #endif