ATLAS Offline Software
Loading...
Searching...
No Matches
KinematicSystHandler.h File Reference
#include "xAODMuon/Muon.h"
#include <PATInterfaces/CorrectionCode.h>
#include <MuonEfficiencyCorrections/HistHandler.h>
#include <MuonEfficiencyCorrections/MuonEfficiencyType.h>
#include <PATInterfaces/ISystematicsTool.h>
#include <ColumnarCore/ColumnAccessor.h>
#include <ColumnarCore/ColumnarTool.h>
#include <ColumnarCore/ObjectColumn.h>
#include <ColumnarMuon/MuonDef.h>
#include <TFile.h>
#include <TDirectory.h>
#include <TH1.h>
#include <TF1.h>
#include <string>
#include <iostream>
#include <memory>
#include <map>
#include <cmath>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

namespace ADD_CMODE (CP)

Function Documentation

◆ ADD_CMODE()

namespace ADD_CMODE ( CP )

Add an additional uncertainty to the muon depending on its kinematics.

Set's the absolute scaling of the systematic. For daily puposes it's usually either 1 or -1 indicating if the instance is an upwards or downwards variation.

Initialize method to load the inputs and check that everything will work as expected.

Typedef to prepare function pointers to the muon

Z->mumu reconstruction scale-factors are delivered in eta-phi maps integrating out any pt-dependence. However, the scale-factors as a function of pt show a slight dependence on that variable. An extra binning along pt is not feasable, because of the low statistics in each bin. To account for something we might missed an additional histogram is saved in the scale-factor map showing the absolute deviation from the bin where the probe-distribution has its maximium. On the other hand high pt muons might hit the borders of the T&P method. Once in terms of statistics and once in terms of modeling where the muon might suffer from a so-called catastrophic energy-loss. To estimate this inefficiency the slope in the efficiency of high-pt muons in the drell-yan sample is determined in different spectrometer bins. The systematic designed for muons beyond 200 GeV in transverse momentum.

The two systematics are not applied simultaenously. The first systematic is preferred over the latter if its unvertainty is smaller than the total value of the latter itself.

Constructor having two histhandler objects inside. The

The PrimodialPtSystematic was the former PtKinematicSystHandler. It's kept for backwards compability to run MuonEfficiencyScaleFactors on files before the Moriond_2019 release.

Extra systematic assigned for the TTVA non-closure

Definition at line 1 of file KinematicSystHandler.h.

34 {
35
36 //Interface class to retrieve the Muon dependent systematics
37 class IKinematicSystHandler : public columnar::ColumnarTool<> {
38 public:
40 virtual CP::CorrectionCode GetKineDependent(columnar::MuonId mu, float& Eff) const = 0;
43 virtual void SetSystematicWeight(float SystWeight) = 0;
44
46 virtual bool initialize() = 0;
47 virtual ~IKinematicSystHandler() =default;
48
50 typedef float (IKinematicSystHandler::*KinVariable)(columnar::MuonId mu) const;
51 KinVariable GetMuonVariableToUse(const std::string &name);
52
53 float Eta(columnar::MuonId mu) const;
54 float Pt(columnar::MuonId mu) const;
55 float PtGeV(columnar::MuonId mu) const;
56 float AbsEta(columnar::MuonId mu) const;
57
58 columnar::MuonAccessor<columnar::ObjectColumn> muonsHandle {*this, "Muons"};
59 columnar::MuonAccessor<float> ptAcc {*this, "pt"};
60 columnar::MuonAccessor<float> etaAcc {*this, "eta"};
61 };
73 class PtKinematicSystHandler : public IKinematicSystHandler {
74 public:
75 CP::CorrectionCode GetKineDependent(columnar::MuonId mu, float& eff) const override;
76
77 void SetSystematicWeight(float syst_weight) override;
78
79 bool initialize() override;
80
82 PtKinematicSystHandler(std::unique_ptr<HistHandler> pt_flatnesss, std::unique_ptr<HistHandler> energy_loss);
83 private:
84 std::unique_ptr<HistHandler> m_flatness;
85 std::unique_ptr<HistHandler> m_loss;
86 float m_SystWeight;
87 };
91
92 class PrimodialPtSystematic: public IKinematicSystHandler {
93 public:
94 CP::CorrectionCode GetKineDependent(columnar::MuonId mu, float& Eff) const override;
95
96 void SetSystematicWeight(float SystWeight) override;
97
98 bool initialize() override;
99 PrimodialPtSystematic(std::unique_ptr<HistHandler> HistHandler);
100 private:
101 std::unique_ptr<HistHandler> m_Handler;
102 float m_SystWeight;
103 };
107 class TTVAClosureSysHandler: public IKinematicSystHandler {
108 public:
109 TTVAClosureSysHandler(std::unique_ptr<HistHandler> HistHandler);
110
111 void SetSystematicWeight( float SystWeight) override;
112 bool initialize() override;
113 CP::CorrectionCode GetKineDependent(columnar::MuonId mu, float& Eff) const override;
114 private:
115 std::unique_ptr<HistHandler> m_Handler;
116 float m_SystWeight;
117 };
118
119 class BadMuonVetoSystHandler: public IKinematicSystHandler {
120 public:
121 CP::CorrectionCode GetKineDependent(columnar::MuonId mu, float& Eff) const override;
122 void SetSystematicWeight(float SystWeight)override;
123
124 bool initialize() override;
125 BadMuonVetoSystHandler(TDirectory* InDir_3Stations, TDirectory* InDir_2Stations = nullptr);
126 virtual ~BadMuonVetoSystHandler();
127
128 private:
129 typedef std::pair<float, float> Ranges;
130
131 CP::CorrectionCode findAppropiatePolynomial(const xAOD::Muon& mu, TF1* &Poly) const;
132
133 std::string getNextProperty(std::string &sstr) const;
134 void fillMap(TDirectory* InDir, std::map<Ranges, std::unique_ptr<TF1>>& systPolynomials);
135
136 std::map<Ranges, std::unique_ptr<TF1>> m_syst3Stations;
137 std::map<Ranges, std::unique_ptr<TF1>> m_syst2Stations;
138
139 KinVariable m_uncertVar;
140 KinVariable m_polySelVar;
141 float m_SystWeight;
142 };
143
144} /* namespace ADD_CMODE(CP) */
@ Eta
Definition RPCdef.h:8
the base class for all columnar components
ObjectId< MuonDef > MuonId
Definition MuonDef.h:22
AccessorTemplate< MuonDef, CT, ColumnAccessMode::input, CM > MuonAccessor
Definition MuonDef.h:24
Muon_v1 Muon
Reference the current persistent version:
Definition Muon.h:13
void initialize()