ATLAS Offline Software
Loading...
Searching...
No Matches
EventWeightFillerTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id: EventWeightFillerTool.cxx 603418 2014-06-24 15:37:50Z ssnyder $
6
7// Local include(s):
9
10// Gaudi/Athena include(s):
12
13using xAOD::EventInfo;
14
15namespace D3PD {
16
18 const std::string& name,
19 const IInterface* parent )
20 : BlockFillerTool< EventInfo >( type, name, parent )
21 {
22 EventWeightFillerTool::book().ignore(); // Avoid coverity warnings.
23 }
24
25
27 {
28 CHECK( addVariable( "mc_event_weight", m_mc_event_weight,
29 "MC weight, coming from the EventType object" ) );
30 return StatusCode::SUCCESS;
31 }
32
33
34 StatusCode EventWeightFillerTool::fill( const EventInfo& ei )
35 {
36 *m_mc_event_weight = ei.mcEventWeight();
37 return StatusCode::SUCCESS;
38 }
39
40} // namespace D3PD
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Type-safe wrapper for block filler tools.
float * m_mc_event_weight
Variable: MC event weight.
EventWeightFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard AlgTool constructor.
virtual StatusCode book()
Book variables for this block.
virtual StatusCode fill(const xAOD::EventInfo &ei)
Fill the variables for this block.
Block filler tool for noisy FEB information.
EventInfo_v1 EventInfo
Definition of the latest event info version.