36{
37 void Algorithm ::
38 testInvariant () const
39 {
41 }
42
43
44
45 IWorker *Algorithm ::
46 wk () const
47 {
49 return m_wk;
50 }
51
52
53
54 void Algorithm ::
55 book (const TH1& hist)
56 {
58 wk()->addOutput (
hist.Clone());
59 }
60
61
62
63 TH1 *Algorithm ::
64 hist (const std::string& name) const
65 {
67 return dynamic_cast<TH1*>(wk()->getOutputHist (name));
68 }
69
70
71
72 Algorithm ::
73 Algorithm ()
74 : m_wk (0)
75 {
77 }
78
79
80
81 Algorithm ::
82 ~Algorithm ()
83 {
84 delete m_msg;
85 }
86
87
88
90 evtStore() const
91 {
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 {
106 if (m_msg == 0 || m_msgName != GetName())
107 {
108 delete m_msg;
109 m_msg = nullptr;
110 m_msgName = GetName();
112 if (m_msgName.empty())
113 name =
"UnnamedAlgorithm";
114 else
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 {
129 result << MSG::Level (level);
131 }
132
133
134
135 bool Algorithm ::
136 msgLvl (int lvl) const
137 {
139 return m_msgLevel <= lvl;
140 }
141
142
143
144 void Algorithm ::
145 setMsgLevel (int level)
146 {
148 if (m_msg)
149 m_msg->setLevel (MSG::Level (level));
151 }
152
153
154
155 StatusCode Algorithm ::
156 setupJob (Job& )
157 {
159 return StatusCode::SUCCESS;
160 }
161
162
163
164 StatusCode Algorithm ::
165 fileExecute ()
166 {
168 return StatusCode::SUCCESS;
169 }
170
171
172
173 StatusCode Algorithm ::
174 endOfFile ()
175 {
177 return StatusCode::SUCCESS;
178 }
179
180
181
182 StatusCode Algorithm ::
183 changeInput (bool )
184 {
186 return StatusCode::SUCCESS;
187 }
188
189
190
191 StatusCode Algorithm ::
192 initialize ()
193 {
195 return StatusCode::SUCCESS;
196 }
197
198
199
200 StatusCode Algorithm ::
201 histInitialize ()
202 {
204 return StatusCode::SUCCESS;
205 }
206
207
208
209 StatusCode Algorithm ::
210 execute ()
211 {
213 return StatusCode::SUCCESS;
214 }
215
216
217
218 StatusCode Algorithm ::
219 postExecute ()
220 {
222 return StatusCode::SUCCESS;
223 }
224
225
226
227 StatusCode Algorithm ::
228 finalize ()
229 {
231 return StatusCode::SUCCESS;
232 }
233
234
235
236 StatusCode Algorithm ::
237 histFinalize ()
238 {
240 return StatusCode::SUCCESS;
241 }
242
243
244
245 bool Algorithm ::
246 hasName (const std::string& name) const
247 {
249 return GetName() ==
name;
250 }
251
252
253
254 void Algorithm ::
255 sysSetupJob (Job& job)
256 {
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 {
268 m_nameCache = GetName();
269 return m_nameCache;
270 }
271}
#define RCU_CHANGE_INVARIANT(x)
#define RCU_NEW_INVARIANT(x)
#define RCU_READ_INVARIANT(x)
#define RCU_THROW_MSG(message)
Wrapper for TEvent to make it look like StoreGate.