ATLAS Offline Software
UnitTestAlg2.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_ALG2_H
6 #define EVENT_LOOP_UNIT_TEST_ALG2_H
7 
8 // Copyright Nils Krumnack 2011.
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 
23 #include <EventLoopTest/Global.h>
24 
26 #include <AsgTools/IAsgTool.h>
28 
29 class TBranch;
30 class TH1;
31 class TTree;
32 
33 namespace EL
34 {
35  class UnitTestAlg2 final : public AnaAlgorithm
36  {
37  //
38  // public interface
39  //
40 
43  public:
44  void testInvariant () const;
45 
46 
51  public:
52  UnitTestAlg2 (const std::string& name,
53  ISvcLocator* pSvcLocator);
54 
55 
57  public:
58  bool makeOutput;
59 
60 
62  public:
63  enum CallBack
64  {
68  };
69 
70 
71 
72  //
73  // interface inherited from Algorithm
74  //
75 
76  private:
78 
79  private:
81 
82  private:
84 
85 
86 
87  //
88  // private interface
89  //
90 
92  public:
93  float m_property = 0;
94 
96  public:
97  std::string m_string_property;
98 
100  public:
101  ToolHandle<IUnitTestTool> m_toolHandle;
102 
104  private:
105  std::string m_name;
106 
108  private:
109  TBranch *m_branch = nullptr;
110 
112  private:
113  Int_t m_value;
114 
116  private:
117  // TH1 *m_hist;
118 
120  private:
121  TTree *m_tree;
122 
124  private:
125  std::string m_fileName;
126 
128  private:
130 
131  private:
132  unsigned m_calls = 0;
133 
134  private:
135  TH1 *m_callbacks = nullptr;
136 
137  private:
138  TH1 *getCallbacks ();
139  };
140 }
141 
142 #endif
EL::UnitTestAlg2::execute
virtual ::StatusCode execute() override
EL::UnitTestAlg2::getCallbacks
TH1 * getCallbacks()
EL::UnitTestAlg2::CB_INITIALIZE
@ CB_INITIALIZE
Definition: UnitTestAlg2.h:65
EL::UnitTestAlg2::m_tree
TTree * m_tree
description: the histogram we are creating
Definition: UnitTestAlg2.h:121
IUnitTestTool.h
EL::UnitTestAlg2::m_branch
TBranch * m_branch
description: the branch we are using
Definition: UnitTestAlg2.h:109
EL::UnitTestAlg2::CallBack
CallBack
the various callbacks we use
Definition: UnitTestAlg2.h:64
EL::UnitTestAlg2::m_name
std::string m_name
description: the name of the variable we are using
Definition: UnitTestAlg2.h:105
AnaAlgorithm.h
EL::UnitTestAlg2::m_hasInitialize
bool m_hasInitialize
whether initialize has been called
Definition: UnitTestAlg2.h:129
EL::AnaAlgorithm
the (new) base class for EventLoop algorithms
Definition: AnaAlgorithm.h:73
EL::UnitTestAlg2::testInvariant
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
EL::UnitTestAlg2::m_callbacks
TH1 * m_callbacks
Definition: UnitTestAlg2.h:135
EL::UnitTestAlg2::m_value
Int_t m_value
description: the value we are reading from the branch
Definition: UnitTestAlg2.h:113
EL::UnitTestAlg2::UnitTestAlg2
UnitTestAlg2(const std::string &name, ISvcLocator *pSvcLocator)
effects: standard constructor.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
IAsgTool.h
EL::UnitTestAlg2::makeOutput
bool makeOutput
description: whether I create an output n-tuple
Definition: UnitTestAlg2.h:58
EL::UnitTestAlg2::m_calls
unsigned m_calls
Definition: UnitTestAlg2.h:132
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
EL::UnitTestAlg2::initialize
virtual ::StatusCode initialize() override
EL::UnitTestAlg2::m_toolHandle
ToolHandle< IUnitTestTool > m_toolHandle
the tool handle property our owner sets
Definition: UnitTestAlg2.h:101
EL::UnitTestAlg2::m_fileName
std::string m_fileName
the name of the file (for testing changeInput)
Definition: UnitTestAlg2.h:125
EL::UnitTestAlg2::m_property
float m_property
the float property our owner sets
Definition: UnitTestAlg2.h:93
EL::UnitTestAlg2::m_string_property
std::string m_string_property
the string property our owner sets
Definition: UnitTestAlg2.h:97
EL::UnitTestAlg2
Definition: UnitTestAlg2.h:36
EL::UnitTestAlg2::CB_FINALIZE
@ CB_FINALIZE
Definition: UnitTestAlg2.h:67
Global.h
EL::UnitTestAlg2::finalize
virtual ::StatusCode finalize() override
EL::UnitTestAlg2::CB_EXECUTE
@ CB_EXECUTE
Definition: UnitTestAlg2.h:66