ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalibIntSagittaTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MCAST_MUONCALIBINTSAGITTATOOL_H
6#define MCAST_MUONCALIBINTSAGITTATOOL_H
7
8// C++ includes
9#include <map>
10#include <vector>
11
12// Framework include(s):
15#include "AsgTools/AsgTool.h"
19
24
25namespace CP {
26
28 public asg::AsgTool {
29 // Create a proper constructor for Athena
32
33 public:
34 // Interface methods that must be defined
35 // Interface - Apply the correction on a modifyable object
36 virtual CorrectionCode applyCorrection(MCP::MuonObj& mu) const override;
37
38 // Interface - Is the tool affected by a specific systematic?
39 virtual bool isAffectedBySystematic(const SystematicVariation& systematic) const override;
40 // Interface - Which systematics have an effect on the tool's behaviour?
41 virtual SystematicSet affectingSystematics() const override;
42 // Interface - Systematics to be used for physics analysis
43 virtual SystematicSet recommendedSystematics() const override;
44 // Interface - Use specific systematic
45 virtual StatusCode applySystematicVariation(const SystematicSet& systConfig) override;
46
47 public:
48 // Constructor
49 MuonCalibIntSagittaTool(const std::string& name);
50
51 // Destructor
52 virtual ~MuonCalibIntSagittaTool() = default;
53
54 virtual StatusCode initialize() override;
55
56
57 protected:
58 // Event info
59 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo{this, "EventInfoContName", "EventInfo", "event info key"};
60
61 // Release scheme
62 Gaudi::Property<std::string> m_release{this, "release", "Recs2025_12_11_Run2Run3", "Release"};
63
64 // Sagitta corrections
65 Gaudi::Property<bool> m_doEtaSagittaSys{this, "doEtaSagittaSys", false, "Do Eta dependant systematic system"};
66 Gaudi::Property<bool> m_applyCorrectionOnData{this, "applyCorrectionOnData", true, "If to apply sagitta corrections on data, or take the full effect as systematic"};
67
68 // Do direct CB calibration
69 Gaudi::Property<bool> m_doDirectCBCalib{this, "doDirectCBCalib", true, "Apply sagitta corrections on CB tracks, otherwise, on ID+MS"};
70
71 // Rho value to be used
72 Gaudi::Property<bool> m_useFixedRho{this, "useFixedRho", true, "Force Fixed Rho"};
73 Gaudi::Property<float> m_fixedRhoValue{this, "fixedRhoValue", 1, "Value for rho, if it is forced"};
74
75 // Systematics scheme
76 Gaudi::Property<std::string> m_sysScheme{this, "systematicScheme", "Corr_Scale", "Systematic scheme to be configured"};
77 Gaudi::Property<float> m_extraRebiasSys{this, "extraRebias", 0.00002, "Additional systematic applied for the residual bias observed"};
78
79 // For systematics
81 double SagittaRho{0.};
82 double SagittaBias{0.};
83 double SagittaGlobal{0.};
84 double SagittaPtExtra{0.};
85 double SagittaDataStat{0.};
86 double SagittaEtaSlice{0.};
87 };
88
89 // calculate the parameter set for the given systematic
90 StatusCode calcSystematicVariation(const SystematicSet& systConfig, ParameterSetSagitta& param) const;
91
94
95 typedef std::map<MCP::SagittaCorrection, std::shared_ptr<MCP::CalibContainer>> SagittaCorrConstMap;
96
97 // Corrections from the data
98 std::map<MCP::DataYear, SagittaCorrConstMap> m_sagittaCorrConst_ID;
99 std::map<MCP::DataYear, SagittaCorrConstMap> m_sagittaCorrConst_ME;
100 std::map<MCP::DataYear, SagittaCorrConstMap> m_sagittaCorrConst_CB;
101
102 // Corrections from the MC - what is typically referred to as the kinematic term
103 std::map<MCP::DataYear, SagittaCorrConstMap> m_sagittaCorrConst_mcID;
104 std::map<MCP::DataYear, SagittaCorrConstMap> m_sagittaCorrConst_mcME;
105 std::map<MCP::DataYear, SagittaCorrConstMap> m_sagittaCorrConst_mcCB;
106
107
108 void applySagittaCorrection(double& pt, const std::vector<double>& correction, const int& charge, const bool& isData) const;
109
110
111 // Get the set of correction, based on data + systematic setting
112 std::vector<double> getCorrections(const MCP::TrackCalibObj& mu) const;
113
114 // Statistical combination
115 double statCombCorrection(const MCP::MuonObj& mu, double corrIDpT, double corrMEpT, double CBpT) const;
116 CorrectionCode applyStatCombination(AmgVector(5) parsID, const AmgSymMatrix(5)& covID, AmgVector(5) parsMS, const AmgSymMatrix(5)& covMS, int charge, AmgVector(5) & parsCB, AmgSymMatrix(5) & covCB, double& chi2) const;
117
118
119 }; // class MuonCalibIntSagittaTool
120
121} // namespace CP
122
123#endif
#define ASG_TOOL_CLASS3(CLASSNAME, INT1, INT2, INT3)
Property holding a SG store/key/clid from which a ReadHandle is made.
#define AmgSymMatrix(dim)
#define AmgVector(rows)
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.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
MuonCalibIntSagittaTool(const std::string &name)
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_ME
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig) override
effects: configure this tool for the given list of systematic variations.
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_mcME
virtual ASG_TOOL_CLASS3(MuonCalibIntSagittaTool, CP::IMuonCalibIntTool, CP::ISystematicsTool, CP::IReentrantSystematicsTool) public bool isAffectedBySystematic(const SystematicVariation &systematic) const override
Declare the interface that this class provides.
std::map< MCP::SagittaCorrection, std::shared_ptr< MCP::CalibContainer > > SagittaCorrConstMap
Gaudi::Property< bool > m_useFixedRho
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_CB
SystematicsCache< ParameterSetSagitta > m_Parameters
Gaudi::Property< float > m_fixedRhoValue
Gaudi::Property< bool > m_applyCorrectionOnData
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_ID
Gaudi::Property< float > m_extraRebiasSys
double statCombCorrection(const MCP::MuonObj &mu, double corrIDpT, double corrMEpT, double CBpT) const
Gaudi::Property< bool > m_doDirectCBCalib
virtual SystematicSet affectingSystematics() const override
the list of all systematics this tool can be affected by
Gaudi::Property< bool > m_doEtaSagittaSys
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_mcID
StatusCode calcSystematicVariation(const SystematicSet &systConfig, ParameterSetSagitta &param) const
virtual SystematicSet recommendedSystematics() const override
the list of all systematics this tool recommends to use
virtual ~MuonCalibIntSagittaTool()=default
Gaudi::Property< std::string > m_release
Gaudi::Property< std::string > m_sysScheme
std::vector< double > getCorrections(const MCP::TrackCalibObj &mu) const
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_mcCB
const ParameterSetSagitta * m_currentParameters
CorrectionCode applyStatCombination(AmgVector(5) parsID, const AmgSymMatrix(5)&covID, AmgVector(5) parsMS, const AmgSymMatrix(5)&covMS, int charge, AmgVector(5) &parsCB, AmgSymMatrix(5) &covCB, double &chi2) const
void applySagittaCorrection(double &pt, const std::vector< double > &correction, const int &charge, const bool &isData) const
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
double chi2(TH1 *h0, TH1 *h1)
Select isolated Photons, Electrons and Muons.
setRcore setEtHad setFside pt
Basic object to cache all relevant information from the track.
Definition MuonObj.h:74