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
5//
6// Distributed under the Boost Software License, Version 1.0.
7// (See accompanying file LICENSE_1_0.txt or copy at
8// http://www.boost.org/LICENSE_1_0.txt)
9
10// Please feel free to contact me (krumnack@iastate.edu) for bug
11// reports, feature suggestions, praise and complaints.
12
13
14//
15// includes
16//
17
19
20#include <TTree.h>
23#include <EventLoop/IWorker.h>
25
26//
27// method implementations
28//
29
30namespace EL
31{
32 void UnitTestSkim ::
33 testInvariant () const
34 {
35 RCU_INVARIANT (this != 0);
36 }
37
38
39
40 UnitTestSkim ::
41 UnitTestSkim ()
42 {
43 RCU_NEW_INVARIANT (this);
44 }
45
46
47
48 StatusCode UnitTestSkim ::
49 changeInput (bool /*firstFile*/)
50 {
52 wk()->tree()->SetBranchAddress ("el_n", &el_n);
53 return StatusCode::SUCCESS;
54 }
55
56
57
58 StatusCode UnitTestSkim ::
59 initialize ()
60 {
62
63 m_skim = getNTupleSvc (wk(), "output");
64 m_skim->tree()->Branch ("el_n2", &el_n2, "el_n2/I");
65
66 return StatusCode::SUCCESS;
67 }
68
69
70
71 StatusCode UnitTestSkim ::
72 execute ()
73 {
75
76 wk()->tree()->GetEntry (wk()->treeEntry());
77 el_n2 = el_n * el_n;
78
79 return StatusCode::SUCCESS;
80 }
81}
#define RCU_INVARIANT(x)
Definition Assert.h:201
#define RCU_CHANGE_INVARIANT(x)
Definition Assert.h:231
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:233
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.