ATLAS Offline Software
Loading...
Searching...
No Matches
UnitTestSkim.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7//
8// includes
9//
10
12
13#include <TTree.h>
16#include <EventLoop/IWorker.h>
18
19//
20// method implementations
21//
22
23namespace EL
24{
25 void UnitTestSkim ::
26 testInvariant () const
27 {}
28
29
30
31 UnitTestSkim ::
32 UnitTestSkim ()
33 {
34 RCU_NEW_INVARIANT (this);
35 }
36
37
38
39 StatusCode UnitTestSkim ::
40 changeInput (bool /*firstFile*/)
41 {
43 wk()->tree()->SetBranchAddress ("el_n", &el_n);
44 return StatusCode::SUCCESS;
45 }
46
47
48
49 StatusCode UnitTestSkim ::
50 initialize ()
51 {
53
54 m_skim = getNTupleSvc (wk(), "output");
55 m_skim->tree()->Branch ("el_n2", &el_n2, "el_n2/I");
56
57 return StatusCode::SUCCESS;
58 }
59
60
61
62 StatusCode UnitTestSkim ::
63 execute ()
64 {
66
67 wk()->tree()->GetEntry (wk()->treeEntry());
68 el_n2 = el_n * el_n;
69
70 return StatusCode::SUCCESS;
71 }
72}
#define RCU_CHANGE_INVARIANT(x)
Definition Assert.h:219
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:221
IWorker * wk() const
description: the worker that is controlling us guarantee: no-fail
NTupleSvc * m_skim
description: the output algorithm we use
Int_t el_n
description: the member we read into
Int_t el_n2
description: the member we write from
This module defines the arguments passed from the BATCH driver to the BATCH worker.
NTupleSvc * getNTupleSvc(IWorker *worker, const std::string &outputStream, const std::string &treeName="")
effects: get the skimming algorithm for the given output for this worker guarantee: strong failures: ...
::StatusCode StatusCode
StatusCode definition for legacy code.