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
5#ifndef EVENT_LOOP_UNIT_TEST_ALG_H
6#define EVENT_LOOP_UNIT_TEST_ALG_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 UnitTestAlg : public Algorithm
34 {
35 //
36 // public interface
37 //
38
41 public:
42 void testInvariant () const;
43
44
49 public:
50 UnitTestAlg (const std::string& branchName = "el_n");
51
52
54 public:
56
57
58
59 //
60 // interface inherited from Algorithm
61 //
62
71 private:
72 virtual StatusCode setupJob (Job& job) override;
73
74
80 private:
81 virtual StatusCode changeInput (bool firstFile) override;
82
83
94 private:
95 virtual StatusCode initialize () override;
96
97 private:
98 virtual StatusCode histInitialize () override;
99
100
105 private:
106 virtual StatusCode execute () override;
107
108
115 private:
116 virtual StatusCode fileExecute () override;
117
118
126 private:
127 virtual StatusCode finalize () override;
128
129
136 private:
137 virtual StatusCode histFinalize () override;
138
139
140
141 //
142 // private interface
143 //
144
146 private:
147 std::string m_name;
148
150 private:
151 TBranch *m_branch;
152
154 private:
155 Int_t m_value;
156
158 private:
159 // TH1 *m_hist; //!
160
162 private:
163 TTree *m_tree;
164
166 private:
167 std::string m_fileName;
168
170 private:
172
174 private:
176
177 private:
178 unsigned m_calls = 0;
179
180#pragma GCC diagnostic push
181#pragma GCC diagnostic ignored "-Wpragmas"
182#pragma GCC diagnostic ignored "-Wunknown-pragmas"
183#pragma GCC diagnostic ignored "-Winconsistent-missing-override"
185#pragma GCC diagnostic pop
186 };
187}
188
189#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:55
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.