ATLAS Offline Software
Loading...
Searching...
No Matches
UnitTestAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#ifndef EVENT_LOOP_UNIT_TEST_ALG_H
8#define EVENT_LOOP_UNIT_TEST_ALG_H
9
11
12
13
15
16#include <EventLoop/Algorithm.h>
17
18class TBranch;
19class TH1;
20class TTree;
21
22namespace EL
23{
24 class UnitTestAlg : public Algorithm
25 {
26 //
27 // public interface
28 //
29
32 public:
33 void testInvariant () const;
34
35
40 public:
41 UnitTestAlg (const std::string& branchName = "el_n");
42
43
45 public:
47
48
49
50 //
51 // interface inherited from Algorithm
52 //
53
62 private:
63 virtual StatusCode setupJob (Job& job) override;
64
65
71 private:
72 virtual StatusCode changeInput (bool firstFile) override;
73
74
85 private:
86 virtual StatusCode initialize () override;
87
88 private:
89 virtual StatusCode histInitialize () override;
90
91
96 private:
97 virtual StatusCode execute () override;
98
99
106 private:
107 virtual StatusCode fileExecute () override;
108
109
117 private:
118 virtual StatusCode finalize () override;
119
120
127 private:
128 virtual StatusCode histFinalize () override;
129
130
131
132 //
133 // private interface
134 //
135
137 private:
138 std::string m_name;
139
141 private:
142 TBranch *m_branch;
143
145 private:
146 Int_t m_value;
147
149 private:
150 // TH1 *m_hist; //!
151
153 private:
154 TTree *m_tree;
155
157 private:
158 std::string m_fileName;
159
161 private:
163
165 private:
167
168 private:
169 unsigned m_calls = 0;
170
171#pragma GCC diagnostic push
172#pragma GCC diagnostic ignored "-Wpragmas"
173#pragma GCC diagnostic ignored "-Wunknown-pragmas"
174#pragma GCC diagnostic ignored "-Winconsistent-missing-override"
176#pragma GCC diagnostic pop
177 };
178}
179
180#endif
friend class Job
Definition Algorithm.h:292
Algorithm()
effects: standard default constructor guarantee: strong failures: low level errors I
virtual StatusCode setupJob(Job &job) override
effects: give the algorithm a chance to intialize the job with anything this algorithm needs.
TBranch * m_branch
description: the branch we are using
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
virtual StatusCode histInitialize() override
effects: this is a pre-initialization routine that is called before changeInput is called.
virtual StatusCode finalize() override
effects: do everything that needs to be done after completing work on this worker guarantee: basic fa...
virtual StatusCode initialize() override
effects: do everything that needs to be done before running the algorithm, e.g.
Int_t m_value
description: the value we are reading from the branch
UnitTestAlg(const std::string &branchName="el_n")
effects: standard constructor.
virtual StatusCode execute() override
effects: process the next event guarantee: basic failures: algorithm dependent rationale: the virtual...
std::string m_fileName
the name of the file (for testing changeInput)
bool m_hasHistInitialize
whether histInitialize has been called
bool makeOutput
description: whether I create an output n-tuple
Definition UnitTestAlg.h:46
virtual StatusCode histFinalize() override
effects: this is a post-initialization routine that is called after finalize has been called.
std::string m_name
description: the name of the variable we are using
ClassDef(UnitTestAlg, 1)
virtual StatusCode fileExecute() override
effects: do all the processing that needs to be done once per file guarantee: basic failures: algorit...
bool m_hasInitialize
whether initialize has been called
TTree * m_tree
description: the histogram we are creating
virtual StatusCode changeInput(bool firstFile) override
effects: do all changes to work with a new input file, e.g.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
::StatusCode StatusCode
StatusCode definition for legacy code.