The Gaudi Framework  v33r0 (d5ea422b)
GaudiSequencer.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDISEQUENCER_H
12 #define GAUDISEQUENCER_H 1
13 
14 // Include files
15 // from Gaudi
16 #include "GaudiAlg/GaudiAlg.h"
17 #include "GaudiAlg/GaudiCommon.h"
18 #include <Gaudi/Sequence.h>
19 
20 // Forward declarations
22 
38 class GAUDI_API GaudiSequencer : public GaudiCommon<Gaudi::Sequence> {
39 public:
42 
43  StatusCode initialize() override;
44  StatusCode execute( const EventContext& ctx ) const override;
45  StatusCode sysExecute( const EventContext& ctx ) override;
46 
48  std::ostream& toControlFlowExpression( std::ostream& os ) const override;
49 
50 private:
51  class AlgorithmEntry final {
52  public:
54  AlgorithmEntry( Gaudi::Algorithm* alg ) : m_algorithm( alg ) {}
55 
56  void setReverse( bool flag ) { m_reverse = flag; }
57 
58  Gaudi::Algorithm* algorithm() const { return m_algorithm; }
59  bool reverse() const { return m_reverse; }
60  void setTimer( int nb ) { m_timer = nb; }
61  int timer() const { return m_timer; }
62 
63  private:
64  Gaudi::Algorithm* m_algorithm = nullptr;
65  bool m_reverse = false;
66  int m_timer = 0;
67  };
68 
70  StatusCode decodeNames();
71 
73  void membershipHandler();
74 
76  this, "VetoObjects", {}, "skip execute if one or more of these TES objects exist"};
78  this, "RequireObjects", {}, "execute only if one or more of these TES objects exist"};
79 
81  this, "Members", {}, &GaudiSequencer::membershipHandler, "list of algorithms"};
82  Gaudi::Property<bool> m_sequential = {this, "Sequential", false, "execute members one at a time"};
83  Gaudi::Property<bool> m_modeOR = {this, "ModeOR", false, "use OR logic instead of AND"};
84  Gaudi::Property<bool> m_ignoreFilter = {this, "IgnoreFilterPassed", false, "always continue"};
85  Gaudi::Property<bool> m_measureTime = {this, "MeasureTime", false, "measure time"};
86  Gaudi::Property<bool> m_returnOK = {this, "ReturnOK", false, "forces the sequencer to return a good status"};
87  Gaudi::Property<bool> m_shortCircuit = {this, "ShortCircuit", true, "stop processing as soon as possible"};
88  Gaudi::Property<bool> m_invert = {this, "Invert", false, "invert the logic result of the sequencer"};
89 
91  ISequencerTimerTool* m_timerTool = nullptr;
92  int m_timer;
93 };
94 #endif // GAUDISEQUENCER_H
Implementation of property with value of concrete type.
Definition: Property.h:370
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:34
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool reverse() const
Gaudi::Algorithm * algorithm() const
int timer() const
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:89
Implements the time measurement inside a sequencer.
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:101
#define GAUDI_API
Definition: Kernel.h:81
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