5#ifndef MUONEFFICIENCYCORRECTION_MUONSFTESTHELPER_H
6#define MUONEFFICIENCYCORRECTION_MUONSFTESTHELPER_H
20#include <GaudiKernel/ToolHandle.h>
38 const ToolHandle<CP::IMuonTriggerScaleFactors>& Handle,
40 const std::string& Trigger);
43 bool fill(
const EventContext& ctx)
override final;
44 bool init() override final;
48 MuonVal::ScalarBranch<
double> &Var,
53 ToolHandle<CP::IMuonTriggerScaleFactors>
m_handle{};
74 const ToolHandle<CP::IMuonEfficiencyScaleFactors> &handle,
75 const std::string& rel_name =
"");
82 bool fill(
const EventContext& ctx)
override final;
84 bool init() override final;
88 return set.name().
empty() ? std::string(
"") : std::string(
"__") +
set.name();
92 ToolHandle<CP::IMuonEfficiencyScaleFactors>
m_handle{};
106 bool fill(
const EventContext& ctx) {
121 std::vector<std::unique_ptr<SFSet>>
m_SFs{};
132 const ToolHandle<CP::IMuonEfficiencyScaleFactors> &handle,
133 const std::string& rel_name =
"");
137 bool init()
override;
139 bool fill(
const EventContext& ctx)
override;
142 ToolHandle<CP::IMuonEfficiencyScaleFactors>
m_handle{};
144 std::map<CP::SystematicSet, std::shared_ptr<MuonVal::VectorBranch<float>>>
m_SFs{};
xAOD::MuonContainer * muonContainer
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
static const Attributes_t empty
Return value from object correction CP tools.
Class to wrap a set of SystematicVariations.
Return value from object correction CP tools.
std::string name() const override final
Returns the name of the branch.
TTree * tree() override final
Returns the underlying TTree object.
Class to wrap a set of SystematicVariations.
virtual void setMuon(const xAOD::Muon &muon)=0
bool init() override
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
void setMuon(const xAOD::Muon &muon) override final
ToolHandle< CP::IMuonEfficiencyScaleFactors > m_handle
bool fill(const EventContext &ctx) override
The fill method checks if enough information is provided such that the branch is cleared from the inf...
std::map< CP::SystematicSet, std::shared_ptr< MuonVal::VectorBranch< float > > > m_SFs
MuonReplicaBranches(MuonVal::MuonTesterTree &tree, const ToolHandle< CP::IMuonEfficiencyScaleFactors > &handle, const std::string &rel_name="")
MuonSFBranches(MuonVal::MuonTesterTree &tree, const ToolHandle< CP::IMuonEfficiencyScaleFactors > &handle, const std::string &rel_name="")
static std::string systName(const CP::SystematicSet &set)
Dummy helper function that encodes the systname set.
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
bool fill(const EventContext &ctx) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
std::vector< std::unique_ptr< SFSet > > m_SFs
virtual ~MuonSFBranches()=default
CP::CorrectionCode fillSystematic(const xAOD::Muon &muon, SFSet &set)
ToolHandle< CP::IMuonEfficiencyScaleFactors > m_handle
void setMuon(const xAOD::Muon &muon) override final
bool fill(const EventContext &ctx) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
TriggerSFBranches(MuonVal::MuonTesterTree &tree, const ToolHandle< CP::IMuonTriggerScaleFactors > &Handle, const std::string &muonContainer, const std::string &Trigger)
ToolHandle< CP::IMuonTriggerScaleFactors > m_handle
MuonVal::ScalarBranch< double > m_sys_down_SF
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
MuonVal::ScalarBranch< double > m_nominal_SF
virtual ~TriggerSFBranches()=default
SG::ReadHandleKey< xAOD::MuonContainer > m_key
MuonVal::ScalarBranch< double > m_stat_up_SF
CP::CorrectionCode getSF(const xAOD::MuonContainer *muons, MuonVal::ScalarBranch< double > &Var, const CP::SystematicVariation &syst)
MuonVal::ScalarBranch< double > m_stat_down_SF
MuonVal::ScalarBranch< double > m_sys_up_SF
Select isolated Photons, Electrons and Muons.
Class to store array like branches into the n-tuples.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Muon_v1 Muon
Reference the current persistent version:
const CP::SystematicSet cpSet
Systematic set.
MuonSFBranches & parent
Parent from which the TTree pointer & name is retrieved.
MuonVal::ScalarBranch< float > scaleFactor
Actual branches storing scaleFactor & mcEff & dataEff.
bool fill(const EventContext &ctx)
check that all branches are set properly
SFSet(const CP::SystematicSet &cpSet_, MuonSFBranches &parent_)
MuonVal::ScalarBranch< float > dataEff
bool init()
Initialization of the branches.
MuonVal::ScalarBranch< float > mcEff