ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
ReweightUtils
ReweightUtils
WeightToolBase.h
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// Base class for a per-event weight computation
8
// The getWeight() function computes and returns the weight
9
// while the evaluate() function (from IObservableTool) is dedicated
10
// to be called mainly when the information already exists
11
// The addDecoration function can be called to add the computed
12
// weight to the EventInfo
13
//
14
// Author: Olivier Arnaez <olivier.arnaez@cern.ch>
16
17
#ifndef WEIGHTOOLBASE_H
18
#define WEIGHTOOLBASE_H 1
19
20
// Include the base class
21
#include "
AsgTools/AsgTool.h
"
22
23
#include "
PATInterfaces/IWeightTool.h
"
24
#include "
AsgAnalysisInterfaces/IObservableTool.h
"
25
#include "
xAODEventInfo/EventInfo.h
"
26
27
28
class
WeightToolBase
:
public
asg::AsgTool
,
virtual
public
IWeightTool
,
virtual
public
IObservableTool
29
{
31
ASG_TOOL_CLASS2
(
WeightToolBase
,
IWeightTool
,
IObservableTool
)
32
33
public
:
35
WeightToolBase
(
const
std::string& name );
36
38
virtual
~WeightToolBase
() {};
39
41
virtual
StatusCode
initialize
()
override
;
42
44
#ifndef XAOD_STANDALONE
45
virtual
StatusCode
finalize
()
override
;
46
#else
47
virtual
StatusCode
finalize
();
48
#endif
49
50
/*/// returns: the value that was calculated from the xAOD::IParticle (composite built event object for instance)
51
virtual double evaluate( const xAOD::IParticle* part ) const=0;*/
52
54
virtual
double
getWeight
()
const override
= 0;
55
56
57
protected
:
58
//add weight to EventInfo as decoration
59
bool
addDecoration
(
const
xAOD::EventInfo
* evtInfo,
float
weight)
const
;
60
61
std::string
m_prefixWeightDecoration
;
62
std::string
m_weightName
;
63
64
};
65
66
#endif
//> !WEIGHTOOLBASE_H
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition
AsgToolMacros.h:77
AsgTool.h
IObservableTool.h
IWeightTool.h
IObservableTool
Interface for tools that want to calculate a quantity from an xAOD::IParticle.
Definition
IObservableTool.h:32
IWeightTool
Interface for tools that want to calculate a weight from different event information.
Definition
IWeightTool.h:21
WeightToolBase::m_weightName
std::string m_weightName
Definition
WeightToolBase.h:62
WeightToolBase::m_prefixWeightDecoration
std::string m_prefixWeightDecoration
Definition
WeightToolBase.h:61
WeightToolBase::WeightToolBase
WeightToolBase(const std::string &name)
Create a proper constructor for Athena.
Definition
WeightToolBase.cxx:14
WeightToolBase::addDecoration
bool addDecoration(const xAOD::EventInfo *evtInfo, float weight) const
Definition
WeightToolBase.cxx:42
WeightToolBase::initialize
virtual StatusCode initialize() override
Usual initialize method of the framework.
Definition
WeightToolBase.cxx:21
WeightToolBase::finalize
virtual StatusCode finalize() override
Usual finalize method of the framework.
Definition
WeightToolBase.cxx:33
WeightToolBase::~WeightToolBase
virtual ~WeightToolBase()
Default destructor.
Definition
WeightToolBase.h:38
WeightToolBase::getWeight
virtual double getWeight() const override=0
returns: the value that was calculated from the usual Athena storegate
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition
AsgTool.h:47
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:18
EventInfo.h
Generated on
for ATLAS Offline Software by
1.14.0