ATLAS Offline Software
Loading...
Searching...
No Matches
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
26
27
28class WeightToolBase : public asg::AsgTool, virtual public IWeightTool, virtual public IObservableTool
29 {
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
62 std::string m_weightName;
63
64 };
65
66#endif //> !WEIGHTOOLBASE_H
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Interface for tools that want to calculate a quantity from an xAOD::IParticle.
Interface for tools that want to calculate a weight from different event information.
Definition IWeightTool.h:21
std::string m_weightName
std::string m_prefixWeightDecoration
WeightToolBase(const std::string &name)
Create a proper constructor for Athena.
bool addDecoration(const xAOD::EventInfo *evtInfo, float weight) const
virtual StatusCode initialize() override
Usual initialize method of the framework.
virtual StatusCode finalize() override
Usual finalize method of the framework.
virtual ~WeightToolBase()
Default destructor.
virtual double getWeight() const override=0
returns: the value that was calculated from the usual Athena storegate
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
EventInfo_v1 EventInfo
Definition of the latest event info version.