ATLAS Offline Software
UnitTestAlgXAOD.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 #ifndef EVENT_LOOP_UNIT_TEST_ALG_XAOD_H
9 #define EVENT_LOOP_UNIT_TEST_ALG_XAOD_H
10 
11 #include <EventLoopTest/Global.h>
12 
13 #include <EventLoop/Algorithm.h>
14 #include <set>
15 
16 class TBranch;
17 class TH1;
18 class TTree;
19 
20 namespace EL
21 {
22  class UnitTestAlgXAOD : public Algorithm
23  {
24  //
25  // public interface
26  //
27 
30  public:
31  void testInvariant () const;
32 
33 
37  public:
39 
40 
44  public:
45  virtual ~UnitTestAlgXAOD ();
46 
47 
48 
49  //
50  // interface inherited from Algorithm
51  //
52 
61  private:
62  virtual StatusCode setupJob (Job& job) override;
63 
64 
70  private:
71  virtual StatusCode changeInput (bool firstFile) override;
72 
73 
84  private:
85  virtual StatusCode initialize () override;
86 
87  private:
88  virtual StatusCode histInitialize () override;
89 
90 
95  private:
96  virtual StatusCode execute () override;
97 
98 
105  private:
106  virtual StatusCode fileExecute () override;
107 
108 
116  private:
117  virtual StatusCode finalize () override;
118 
119 
126  private:
127  virtual StatusCode histFinalize () override;
128 
129 
130 
131  //
132  // private interface
133  //
134 
136  private:
137  enum class State
138  {
139  START,
142  INITIALIZED,
143  FINALIZED,
145  };
146  private:
148 
151  private:
152  StatusCode testWorkerState (bool validEvent, std::set<State> validStates) const;
153 
154 #pragma GCC diagnostic push
155 #pragma GCC diagnostic ignored "-Wpragmas"
156 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
157 #pragma GCC diagnostic ignored "-Winconsistent-missing-override"
159 #pragma GCC diagnostic pop
160  };
161 }
162 
163 #endif
EL::UnitTestAlgXAOD::changeInput
virtual StatusCode changeInput(bool firstFile) override
effects: do all changes to work with a new input file, e.g.
EL::UnitTestAlgXAOD::State::HIST_FINALIZED
@ HIST_FINALIZED
EL::UnitTestAlgXAOD::initialize
virtual StatusCode initialize() override
effects: do everything that needs to be done before running the algorithm, e.g.
EL::UnitTestAlgXAOD::State::INITIALIZED
@ INITIALIZED
EL::UnitTestAlgXAOD::UnitTestAlgXAOD
UnitTestAlgXAOD()
effects: standard constructor guarantee: strong failures: low level errors II
EL::UnitTestAlgXAOD::State
State
the state we ought to be in
Definition: UnitTestAlgXAOD.h:138
EL::UnitTestAlgXAOD::histFinalize
virtual StatusCode histFinalize() override
effects: this is a post-initialization routine that is called after finalize has been called.
EL::UnitTestAlgXAOD::setupJob
virtual StatusCode setupJob(Job &job) override
effects: give the algorithm a chance to intialize the job with anything this algorithm needs.
EL::UnitTestAlgXAOD::execute
virtual StatusCode execute() override
effects: process the next event guarantee: basic failures: algorithm dependent rationale: the virtual...
EL::UnitTestAlgXAOD::testInvariant
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
EL::Algorithm
Definition: Algorithm.h:22
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Algorithm.h
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
EL::UnitTestAlgXAOD::m_state
State m_state
Definition: UnitTestAlgXAOD.h:147
EL::UnitTestAlgXAOD::State::START
@ START
EL::UnitTestAlgXAOD::State::HIST_INITIALIZED
@ HIST_INITIALIZED
EL::UnitTestAlgXAOD::~UnitTestAlgXAOD
virtual ~UnitTestAlgXAOD()
effects: non-standard destructor guarantee: basic failures: not fully finalized
EL::UnitTestAlgXAOD::histInitialize
virtual StatusCode histInitialize() override
effects: this is a pre-initialization routine that is called before changeInput is called.
EL::UnitTestAlgXAOD::testWorkerState
StatusCode testWorkerState(bool validEvent, std::set< State > validStates) const
check if the state of inputs on the worker is valid right now
EL::UnitTestAlgXAOD::State::INPUT_CHANGED
@ INPUT_CHANGED
EL::UnitTestAlgXAOD::fileExecute
virtual StatusCode fileExecute() override
effects: do all the processing that needs to be done once per file guarantee: basic failures: algorit...
EL::UnitTestAlgXAOD::finalize
virtual StatusCode finalize() override
effects: do everything that needs to be done after completing work on this worker guarantee: basic fa...
EL::UnitTestAlgXAOD::ClassDef
ClassDef(UnitTestAlgXAOD, 1)
EL::Job
Definition: Job.h:51
test_interactive_athena.job
job
Definition: test_interactive_athena.py:6
Global.h
EL::UnitTestAlgXAOD::State::FINALIZED
@ FINALIZED
EL::UnitTestAlgXAOD
Definition: UnitTestAlgXAOD.h:23