ATLAS Offline Software
Functions
Algorithm.cxx File Reference
#include <EventLoop/Algorithm.h>
#include <EventLoop/StatusCode.h>
#include <EventLoop/Worker.h>
#include <RootCoreUtils/Assert.h>
#include <RootCoreUtils/ThrowMsg.h>
#include <TH1.h>
#include <AsgMessaging/MsgLevel.h>
#include <AsgMessaging/MsgStream.h>
Include dependency graph for Algorithm.cxx:

Go to the source code of this file.

Functions

 ClassImp (EL::Algorithm) namespace EL
 

Function Documentation

◆ ClassImp()

ClassImp ( EL::Algorithm  )

Definition at line 33 of file Algorithm.cxx.

36 {
37  void Algorithm ::
38  testInvariant () const
39  {
40  RCU_INVARIANT (this != 0);
41  }
42 
43 
44 
45  IWorker *Algorithm ::
46  wk () const
47  {
48  RCU_READ_INVARIANT (this);
49  return m_wk;
50  }
51 
52 
53 
54  void Algorithm ::
55  book (const TH1& hist)
56  {
57  RCU_CHANGE_INVARIANT (this);
58  wk()->addOutput (hist.Clone());
59  }
60 
61 
62 
64  hist (const std::string& name) const
65  {
66  RCU_READ_INVARIANT (this);
67  return dynamic_cast<TH1*>(wk()->getOutputHist (name));
68  }
69 
70 
71 
73  Algorithm ()
74  : m_wk (0)
75  {
76  RCU_NEW_INVARIANT (this);
77  }
78 
79 
80 
81  Algorithm ::
82  ~Algorithm ()
83  {
84  delete m_msg;
85  }
86 
87 
88 
89  asg::SgTEvent *Algorithm ::
90  evtStore() const
91  {
92  RCU_CHANGE_INVARIANT (this);
93  if (m_evtStorePtr)
94  return m_evtStorePtr;
95  m_evtStore = asg::SgTEvent (wk()->xaodEvent(), wk()->xaodStore());
96  m_evtStorePtr = &m_evtStore;
97  return m_evtStorePtr;
98  }
99 
100 
101 
102  MsgStream& Algorithm ::
103  msg () const
104  {
105  RCU_READ_INVARIANT (this);
106  if (m_msg == 0 || m_msgName != GetName())
107  {
108  delete m_msg;
109  m_msg = nullptr;
110  m_msgName = GetName();
111  std::string name;
112  if (m_msgName.empty())
113  name = "UnnamedAlgorithm";
114  else
115  name = m_msgName;
116  m_msg = new MsgStream (name);
117  m_msg->setLevel (MSG::Level (m_msgLevel));
118  }
119  return *m_msg;
120  }
121 
122 
123 
124  MsgStream& Algorithm ::
125  msg (int level) const
126  {
127  RCU_READ_INVARIANT (this);
128  MsgStream& result = msg ();
129  result << MSG::Level (level);
130  return result;
131  }
132 
133 
134 
135  bool Algorithm ::
136  msgLvl (int lvl) const
137  {
138  RCU_READ_INVARIANT (this);
139  return m_msgLevel <= lvl;
140  }
141 
142 
143 
144  void Algorithm ::
145  setMsgLevel (int level)
146  {
147  RCU_READ_INVARIANT (this);
148  if (m_msg)
149  m_msg->setLevel (MSG::Level (level));
150  m_msgLevel = level;
151  }
152 
153 
154 
155  StatusCode Algorithm ::
156  setupJob (Job& /*job*/)
157  {
158  RCU_CHANGE_INVARIANT (this);
159  return StatusCode::SUCCESS;
160  }
161 
162 
163 
164  StatusCode Algorithm ::
165  fileExecute ()
166  {
167  RCU_CHANGE_INVARIANT (this);
168  return StatusCode::SUCCESS;
169  }
170 
171 
172 
173  StatusCode Algorithm ::
174  endOfFile ()
175  {
176  RCU_CHANGE_INVARIANT (this);
177  return StatusCode::SUCCESS;
178  }
179 
180 
181 
182  StatusCode Algorithm ::
183  changeInput (bool /*firstFile*/)
184  {
185  RCU_CHANGE_INVARIANT (this);
186  return StatusCode::SUCCESS;
187  }
188 
189 
190 
192  initialize ()
193  {
194  RCU_CHANGE_INVARIANT (this);
195  return StatusCode::SUCCESS;
196  }
197 
198 
199 
200  StatusCode Algorithm ::
201  histInitialize ()
202  {
203  RCU_CHANGE_INVARIANT (this);
204  return StatusCode::SUCCESS;
205  }
206 
207 
208 
210  execute ()
211  {
212  RCU_CHANGE_INVARIANT (this);
213  return StatusCode::SUCCESS;
214  }
215 
216 
217 
218  StatusCode Algorithm ::
219  postExecute ()
220  {
221  RCU_CHANGE_INVARIANT (this);
222  return StatusCode::SUCCESS;
223  }
224 
225 
226 
228  finalize ()
229  {
230  RCU_CHANGE_INVARIANT (this);
231  return StatusCode::SUCCESS;
232  }
233 
234 
235 
236  StatusCode Algorithm ::
237  histFinalize ()
238  {
239  RCU_CHANGE_INVARIANT (this);
240  return StatusCode::SUCCESS;
241  }
242 
243 
244 
245  bool Algorithm ::
246  hasName (const std::string& name) const
247  {
248  RCU_CHANGE_INVARIANT (this);
249  return GetName() == name;
250  }
251 
252 
253 
254  void Algorithm ::
255  sysSetupJob (Job& job)
256  {
257  RCU_CHANGE_INVARIANT (this);
258  if (setupJob (job) != StatusCode::SUCCESS)
259  RCU_THROW_MSG ("Algorithm::setupJob returned StatusCode::FAILURE");
260  }
261 
262 
263 
264  const std::string& Algorithm ::
265  name() const
266  {
267  RCU_CHANGE_INVARIANT (this);
268  m_nameCache = GetName();
269  return m_nameCache;
270  }
271 }
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
get_generator_info.result
result
Definition: get_generator_info.py:21
plotmaker.hist
hist
Definition: plotmaker.py:148
initialize
void initialize()
Definition: run_EoverP.cxx:894
python.FakeAthena.Algorithm
def Algorithm(name)
Definition: FakeAthena.py:41
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
book
T * book(const std::string &n, const std::string &t, unsigned nbins)
Definition: main_benchmark.cxx:138
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition: Assert.h:201
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
asg::SgTEvent
Wrapper for TEvent to make it look like StoreGate.
Definition: SgTEvent.h:44
TH1
Definition: rootspy.cxx:268
RCU_CHANGE_INVARIANT
#define RCU_CHANGE_INVARIANT(x)
Definition: Assert.h:231
RCU_THROW_MSG
#define RCU_THROW_MSG(message)
Definition: PrintMsg.h:58
test_interactive_athena.job
job
Definition: test_interactive_athena.py:6
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition: Assert.h:229
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition: Assert.h:233