00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #ifndef WEIGHTOOLBASE_H
00013 #define WEIGHTOOLBASE_H 1
00014
00015
00016 #include "AsgTools/AsgTool.h"
00017
00018 #include "PATInterfaces/IWeightTool.h"
00019 #include "AsgAnalysisInterfaces/IObservableTool.h"
00020 #include "xAODEventInfo/EventInfo.h"
00021
00022
00023 class WeightToolBase : public asg::AsgTool, virtual public IWeightTool, virtual public IObservableTool
00024 {
00026 ASG_TOOL_CLASS2( WeightToolBase, IWeightTool, IObservableTool )
00027
00028 public:
00030 WeightToolBase( const std::string& name );
00031
00033 virtual ~WeightToolBase() {};
00034
00036 virtual StatusCode initialize() override;
00037
00039 #ifndef XAOD_STANDALONE
00040 virtual StatusCode finalize() override;
00041 #else
00042 virtual StatusCode finalize();
00043 #endif
00044
00045
00046
00047
00049 virtual double getWeight() const override = 0;
00050
00051
00052 protected:
00053
00054 bool addDecoration(const xAOD::EventInfo* evtInfo, float weight) const;
00055
00056 std::string m_prefixWeightDecoration;
00057 std::string m_weightName;
00058
00059 };
00060
00061 #endif //> !WEIGHTOOLBASE_H