ATLAS Offline Software
Loading...
Searching...
No Matches
UnitTestAlg1.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef EVENT_LOOP_UNIT_TEST_ALG1_H
6#define EVENT_LOOP_UNIT_TEST_ALG1_H
7
8//
9// Distributed under the Boost Software License, Version 1.0.
10// (See accompanying file LICENSE_1_0.txt or copy at
11// http://www.boost.org/LICENSE_1_0.txt)
12
13// Please feel free to contact me (krumnack@iastate.edu) for bug
14// reports, feature suggestions, praise and complaints.
15
16
20
21
22
24
25#include <EventLoop/Algorithm.h>
26
27class TBranch;
28class TH1;
29class TTree;
30
31namespace EL
32{
33 class UnitTestAlg1 : public Algorithm
34 {
35 //
36 // public interface
37 //
38
41 public:
42 void testInvariant () const;
43
44
49 public:
50 UnitTestAlg1 (const std::string& branchName = "el_n");
51
52
54 public:
56
57
59 public:
71
72
73
74 //
75 // interface inherited from Algorithm
76 //
77
86 private:
87 virtual StatusCode setupJob (Job& job) override;
88
89
95 private:
96 virtual StatusCode changeInput (bool firstFile) override;
97
98
109 private:
110 virtual StatusCode initialize () override;
111
112 private:
113 virtual StatusCode histInitialize () override;
114
115
120 private:
121 virtual StatusCode execute () override;
122
123
130 private:
131 virtual StatusCode fileExecute () override;
132
133
141 private:
142 virtual StatusCode finalize () override;
143
144
151 private:
152 virtual StatusCode histFinalize () override;
153
154
155
156 //
157 // private interface
158 //
159
161 private:
162 std::string m_name;
163
165 private:
166 TBranch *m_branch;
167
169 private:
170 Int_t m_value;
171
173 private:
174 // TH1 *m_hist; //!
175
177 private:
178 TTree *m_tree;
179
181 private:
182 std::string m_fileName;
183
185 private:
187
189 private:
191
192 private:
193 unsigned m_calls = 0;
194
195 private:
196 TH1 *m_callbacks = nullptr;
197
198 private:
200
201#pragma GCC diagnostic push
202#pragma GCC diagnostic ignored "-Wpragmas"
203#pragma GCC diagnostic ignored "-Wunknown-pragmas"
204#pragma GCC diagnostic ignored "-Winconsistent-missing-override"
206#pragma GCC diagnostic pop
207 };
208}
209
210#endif
friend class Job
Definition Algorithm.h:292
Algorithm()
effects: standard default constructor guarantee: strong failures: low level errors I
virtual StatusCode initialize() override
effects: do everything that needs to be done before running the algorithm, e.g.
virtual StatusCode changeInput(bool firstFile) override
effects: do all changes to work with a new input file, e.g.
bool m_hasHistInitialize
whether histInitialize has been called
std::string m_fileName
the name of the file (for testing changeInput)
bool m_hasInitialize
whether initialize has been called
ClassDef(UnitTestAlg1, 1)
TH1 * getCallbacks()
TBranch * m_branch
description: the branch we are using
Int_t m_value
description: the value we are reading from the branch
TTree * m_tree
description: the histogram we are creating
virtual StatusCode finalize() override
effects: do everything that needs to be done after completing work on this worker guarantee: basic fa...
virtual StatusCode execute() override
effects: process the next event guarantee: basic failures: algorithm dependent rationale: the virtual...
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
virtual StatusCode histFinalize() override
effects: this is a post-initialization routine that is called after finalize has been called.
bool makeOutput
description: whether I create an output n-tuple
virtual StatusCode setupJob(Job &job) override
effects: give the algorithm a chance to intialize the job with anything this algorithm needs.
virtual StatusCode histInitialize() override
effects: this is a pre-initialization routine that is called before changeInput is called.
UnitTestAlg1(const std::string &branchName="el_n")
effects: standard constructor.
std::string m_name
description: the name of the variable we are using
virtual StatusCode fileExecute() override
effects: do all the processing that needs to be done once per file guarantee: basic failures: algorit...
CallBack
the various callbacks we use
This module defines the arguments passed from the BATCH driver to the BATCH worker.
::StatusCode StatusCode
StatusCode definition for legacy code.