ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalibIntScaleSmearTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MCAST_MUONCALIBINTSCALESMEARTOOL_H
6#define MCAST_MUONCALIBINTSCALESMEARTOOL_H
7
8// C++ includes
9#include <map>
10#include <vector>
11#include <limits>
12
13// Framework include(s):
16#include "AsgTools/AsgTool.h"
20
25
26namespace CP {
27
29 public asg::AsgTool {
30 // Create a proper constructor for Athena
33
34 public:
35 // Interface methods that must be defined
36 // Interface - Apply the correction on a modifyable object
37 virtual CorrectionCode applyCorrection(MCP::MuonObj& mu) const override;
38
39 virtual double getExpectedResolution(const int &DetType, double pT, double eta, double phi, MCP::DataYear year, bool isData) const override;
40
41 // Interface - Is the tool affected by a specific systematic?
42 virtual bool isAffectedBySystematic(const SystematicVariation& systematic) const override;
43 // Interface - Which systematics have an effect on the tool's behaviour?
44 virtual SystematicSet affectingSystematics() const override;
45 // Interface - Systematics to be used for physics analysis
46 virtual SystematicSet recommendedSystematics() const override;
47 // Interface - Use specific systematic
48 virtual StatusCode applySystematicVariation(const SystematicSet& systConfig) override;
49
50 public:
51 // Constructor
52 MuonCalibIntScaleSmearTool(const std::string& name);
53
54 // Destructor
55 virtual ~MuonCalibIntScaleSmearTool() = default;
56
57 virtual StatusCode initialize() override;
58
59 protected:
60 // Event info
61 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo{this, "EventInfoContName", "EventInfo", "event info key"};
62
63 // Release scheme
64 Gaudi::Property<std::string> m_release{this, "release", "Recs2025_03_26_Run2Run3", "Release"};
65
66 // Systematics scheme
67 Gaudi::Property<std::string> m_sysScheme{this, "systematicScheme", "Corr_Scale", "Systematic scheme to be configured"};
68
69 // Do direct CB calibration
70 Gaudi::Property<bool> m_doDirectCBCalib{this, "doDirectCBCalib", true, "Do direct calibration of CB tracks, otherwise, do ID+MS"};
71
72 typedef std::map<MCP::ScaleResCorrection, std::shared_ptr<MCP::CalibContainer>> ScaleSmearCorrConstMap;
73
74 // For systematics
76 {
77 std::map<MCP::ScaleSmearParam, double> m_IDparams;
78 std::map<MCP::ScaleSmearParam, double> m_MEparams;
79 std::map<MCP::ScaleSmearParam, double> m_CBparams;
80 };
81
82 // calculate the parameter set for the given systematic
83 StatusCode calcSystematicVariation(const SystematicSet& systConfig, ParameterSetScaleSmear& param) const;
84
87
88 // Corrections from the data
89 std::map<MCP::DataYear, std::map<MCP::ScaleSmearParam, ScaleSmearCorrConstMap>> m_IDparams;
90 std::map<MCP::DataYear, std::map<MCP::ScaleSmearParam, ScaleSmearCorrConstMap>> m_MEparams;
91 std::map<MCP::DataYear, std::map<MCP::ScaleSmearParam, ScaleSmearCorrConstMap>> m_CBparams;
92
93
94 // For expected resu
95 std::map<MCP::DataYear, std::map<MCP::ExpectedResParam, std::shared_ptr<MCP::CalibContainer>>> m_IDExpectedResparams;
96 std::map<MCP::DataYear, std::map<MCP::ExpectedResParam, std::shared_ptr<MCP::CalibContainer>>> m_MEExpectedResparams;
97
99
100 std::map<MCP::ScaleSmearParam, double> getConstants(const MCP::TrackCalibObj& trk, const std::map<MCP::ScaleSmearParam, ScaleSmearCorrConstMap>& constants, const std::map<MCP::ScaleSmearParam, double>& direction) const;
101
102 // Apply all the pT corrections
103 double getCorrectedPt(const MCP::MuonObj& mu, const MCP::TrackCalibObj& trk, const std::map<MCP::ScaleSmearParam, double>& calibConstant) const;
104
105 // Get the smearing correction
106 double getSmearCorr(const MCP::MuonObj& mu, const MCP::TrackCalibObj& trk, double r0, double r1, double r2) const;
107
108 // Apply the ID+MS correction on the CB track
109 double getCorrectedCBPtWithIDMSComb(const MCP::MuonObj& mu, const std::map<MCP::ScaleSmearParam, double>&calibIDConstant , const std::map<MCP::ScaleSmearParam, double>& calibMEConstant) const;
110
111 }; // class MuonCalibIntScaleSmearTool
112
113} // namespace CP
114
115#endif
Scalar eta() const
pseudorapidity method
#define ASG_TOOL_CLASS3(CLASSNAME, INT1, INT2, INT3)
Property holding a SG store/key/clid from which a ReadHandle is made.
Return value from object correction CP tools.
virtual CorrectionCode applyCorrection(MCP::MuonObj &mu) const =0
Declare the interface that the class provides.
interface for all CP tools supporting systematic variations within a reentrant algorithm
Interface for all CP tools supporting systematic variations.
std::map< MCP::DataYear, std::map< MCP::ExpectedResParam, std::shared_ptr< MCP::CalibContainer > > > m_MEExpectedResparams
Gaudi::Property< std::string > m_release
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
virtual SystematicSet affectingSystematics() const override
the list of all systematics this tool can be affected by
static constexpr std::array< MCP::ScaleSmearParam, 5 > m_paramList
std::map< MCP::DataYear, std::map< MCP::ExpectedResParam, std::shared_ptr< MCP::CalibContainer > > > m_IDExpectedResparams
virtual SystematicSet recommendedSystematics() const override
the list of all systematics this tool recommends to use
std::map< MCP::DataYear, std::map< MCP::ScaleSmearParam, ScaleSmearCorrConstMap > > m_CBparams
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const override
Declare the interface that this class provides.
Gaudi::Property< std::string > m_sysScheme
double getCorrectedPt(const MCP::MuonObj &mu, const MCP::TrackCalibObj &trk, const std::map< MCP::ScaleSmearParam, double > &calibConstant) const
SystematicsCache< ParameterSetScaleSmear > m_Parameters
std::map< MCP::ScaleSmearParam, double > getConstants(const MCP::TrackCalibObj &trk, const std::map< MCP::ScaleSmearParam, ScaleSmearCorrConstMap > &constants, const std::map< MCP::ScaleSmearParam, double > &direction) const
virtual ASG_TOOL_CLASS3(MuonCalibIntScaleSmearTool, CP::IMuonCalibIntScaleSmearTool, CP::ISystematicsTool, CP::IReentrantSystematicsTool) public double getExpectedResolution(const int &DetType, double pT, double eta, double phi, MCP::DataYear year, bool isData) const override
Declare the interface that the class provides.
const ParameterSetScaleSmear * m_currentParameters
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
std::map< MCP::DataYear, std::map< MCP::ScaleSmearParam, ScaleSmearCorrConstMap > > m_MEparams
MuonCalibIntScaleSmearTool(const std::string &name)
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig) override
effects: configure this tool for the given list of systematic variations.
StatusCode calcSystematicVariation(const SystematicSet &systConfig, ParameterSetScaleSmear &param) const
std::map< MCP::ScaleResCorrection, std::shared_ptr< MCP::CalibContainer > > ScaleSmearCorrConstMap
double getSmearCorr(const MCP::MuonObj &mu, const MCP::TrackCalibObj &trk, double r0, double r1, double r2) const
double getCorrectedCBPtWithIDMSComb(const MCP::MuonObj &mu, const std::map< MCP::ScaleSmearParam, double > &calibIDConstant, const std::map< MCP::ScaleSmearParam, double > &calibMEConstant) const
virtual ~MuonCalibIntScaleSmearTool()=default
std::map< MCP::DataYear, std::map< MCP::ScaleSmearParam, ScaleSmearCorrConstMap > > m_IDparams
Class to wrap a set of SystematicVariations.
helper class to cache systematics varied calibration constants inside a ISystematicsTool or IRentrant...
Property holding a SG store/key/clid from which a ReadHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Select isolated Photons, Electrons and Muons.
DataYear
Definition EnumDef.h:28
Basic object to cache all relevant information from the track.
Definition MuonObj.h:74