Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
21 if (axisptr !=
nullptr) {
22 std::string
axis = axisptr->GetTitle();
24 size_t Abs1 =
axis.find(
"|");
26 if (Abs1 != std::string::npos) Abs2 =
axis.find(
"|", Abs1 + 1);
27 bool AbsAxis = (Abs2 != std::string::npos) && (Abs2 != 0);
28 if (
axis.find(
"pt") != std::string::npos ||
axis.find(
"pT") != std::string::npos ||
axis.find(
"p_{T}") != std::string::npos) {
29 return std::make_unique<PtAxisHandler>(
parent);
30 }
else if (
axis.find(
"phi") != std::string::npos) {
31 return std::make_unique<PhiAxisHandler>(
parent);
32 }
else if (
axis.find(
"q") != std::string::npos ||
axis.find(
"charge") != std::string::npos) {
33 return std::make_unique<ChargeAxisHandler>(
parent);
34 }
else if (
axis.find(
"eta") != std::string::npos) {
35 if (AbsAxis)
return std::make_unique<AbsEtaAxisHandler>(
parent);
36 return std::make_unique<EtaAxisHandler>(
parent);
37 }
else if (
axis.find(
"dRJet") != std::string::npos ||
axis.find(
"#DeltaR (jet, #mu)") != std::string::npos) {
38 return std::make_unique<dRJetAxisHandler>(
parent);
41 Error(
"AxisHandlerProvider",
"Can not interpret axis title '%s'",
axis.c_str());
43 Error(
"AxisHandlerProvider",
"nullptr pointer passed");
45 return std::make_unique<UndefinedAxisHandler>(
parent);
70 s_close_jet_decor = decor_name;
78 std::string dRJetAxisHandler::s_close_jet_decor =
"dRJet";
79 bool dRJetAxisHandler::s_use_2D_sf =
false;
82 m_use_2D_sf(s_use_2D_sf),
83 m_acc(*this,s_close_jet_decor){}
87 static std::atomic<unsigned int> warned = {0};
92 }
else if(
m_acc.isAvailable(
mu) ) {
96 Warning(
"MuonEfficiencyCorrections::dRJetAxisHandler()",
"The DFCommonJetDr jet decoration is not available in the derivation will fall back to %s",s_close_jet_decor.c_str());
104 Warning(
"MuonEfficiencyCorrections::dRJetAxisHandler()",
"The %s decoration has not been found for the Muon. Isolation scale-factors are now also binned in #Delta R(jet,#mu)", s_close_jet_decor.c_str());
105 Warning(
"MuonEfficiencyCorrections::dRJetAxisHandler()",
"using the closest calibrated AntiKt4EMTopo jet with p_{T}>20~GeV and surving the standard OR criteria.");
106 Warning(
"MuonEfficiencyCorrections::dRJetAxisHandler()",
"You should decorate your muon appropiately before passing to the tool, and use dRJet = -1 in case there is no jet in an event.");
107 Warning(
"MuonEfficiencyCorrections::dRJetAxisHandler()",
"For the time being the inclusive scale-factor is going to be returned.");
108 Warning(
"MuonEfficiencyCorrections::dRJetAxisHandler()",
"In future derivations, muons will also be decorated centrally with DFCommonJetDr, for your benefit.");
109 Warning(
"MuonEfficiencyCorrections::dRJetAxisHandler()",
"You can define custom jet decorations via the 'CloseJetDRDecorator' property of the MuonEfficiencyCorrections tool");
164 TAxis* xAx =
GetHist()->GetXaxis();
165 return Form(
"%s_%.2f_to_%.2f", xAx->GetTitle(), xAx->GetBinLowEdge(
bin), xAx->GetBinUpEdge(
bin));
194 return (
GetHist()->GetNbinsX() + 2) * (
GetHist()->GetNbinsY() + 2);
198 int x(-1),
y(-1),
z(-1);
200 return x == 0 ||
x ==
GetHist()->GetXaxis()->GetNbins() + 1 ||
y == 0 ||
y ==
GetHist()->GetYaxis()->GetNbins() + 1;
210 int binx =
GetHist()->GetXaxis()->FindBin(parx);
211 int biny =
GetHist()->GetYaxis()->FindBin(pary);
212 if (binx < 1 || binx >
GetHist()->GetNbinsX() || biny < 1 || biny >
GetHist()->GetNbinsY()) {
222 int x(0),
y(0),
z(0);
224 TAxis* xAx =
GetHist()->GetXaxis();
225 TAxis* yAx =
GetHist()->GetYaxis();
226 return Form(
"%s_%.2f_to_%.2f_times_%s_%.2f_to_%.2f",
228 xAx->GetTitle(), xAx->GetBinLowEdge(
x), xAx->GetBinUpEdge(
x),
230 yAx->GetTitle(), yAx->GetBinLowEdge(
y), yAx->GetBinUpEdge(
y));
252 int x(-1),
y(-1),
z(-1);
254 return x == 0 ||
x ==
GetHist()->GetXaxis()->GetNbins() + 1 ||
255 y == 0 ||
y ==
GetHist()->GetYaxis()->GetNbins() + 1 ||
256 z == 0 ||
z ==
GetHist()->GetZaxis()->GetNbins() + 1;
267 int binx =
GetHist()->GetXaxis()->FindBin(parx);
268 int biny =
GetHist()->GetYaxis()->FindBin(pary);
269 int binz =
GetHist()->GetZaxis()->FindBin(parz);
270 if (binx < 1 || binx >
GetHist()->GetNbinsX() || biny < 1 || biny >
GetHist()->GetNbinsY() || binz < 1 || binz >
GetHist()->GetNbinsZ()) {
279 int x(0),
y(0),
z(0);
281 TAxis* xAx =
GetHist()->GetXaxis();
282 TAxis* yAx =
GetHist()->GetYaxis();
283 TAxis* zAx =
GetHist()->GetZaxis();
284 return Form(
"%s_%.2f_to_%.2f_times_%s_%.2f_to_%.2f_times_%s_%.2f_to_%.2f",
286 xAx->GetTitle(), xAx->GetBinLowEdge(
x), xAx->GetBinUpEdge(
x),
288 yAx->GetTitle(), yAx->GetBinLowEdge(
y), yAx->GetBinUpEdge(
y),
290 zAx->GetTitle(), zAx->GetBinLowEdge(
z), zAx->GetBinUpEdge(
z));
308 return m_h->GetNumberOfBins() + 1;
329 int x(0),
y(0),
z(0);
331 TAxis* xAx =
GetHist()->GetXaxis();
332 TAxis* yAx =
GetHist()->GetYaxis();
333 return Form(
"%s_%.2f_to_%.2f__times_%s_%.2f_to_%.2f",
334 xAx->GetTitle(), xAx->GetBinLowEdge(
x), xAx->GetBinUpEdge(
x),
335 yAx->GetTitle(), yAx->GetBinLowEdge(
y), yAx->GetBinUpEdge(
y));
int nBins() const override
Return the total number of bins in the histogram -> (GetNbins() +2)**n.
CorrectionCode GetBinningParameter(columnar::MuonId, float &) const override
int nBins() const override
Return the total number of bins in the histogram -> (GetNbins() +2)**n.
void SetBinError(int bin, float val)
bool isOverFlowBin(int b) const override
States whether a bin is overflow or not.
std::string GetBinName(unsigned int bin) const override
Translates the bin number into the borders and return them as name.
std::unique_ptr< AxisHandler > m_x_handler
bool isOverFlowBin(int b) const override
States whether a bin is overflow or not.
HistHandler(columnar::ColumnarTool<> *parent, TH1 *Hist)
CorrectionCode GetBinningParameter(columnar::MuonId mu, float &value) const override
int nOverFlowBins() const override
Return the number of overflow bins.
virtual ~HistHandler_TH2Poly()
bool isOverFlowBin(int b) const override
States whether a bin is overflow or not.
CorrectionCode FindBin(columnar::MuonId muon, int &bin) const override
Function that changes from Implementation to implementation.
CorrectionCode FindBin(columnar::MuonId muon, int &bin) const override
Function that changes from Implementation to implementation.
int nOverFlowBins() const override
Return the number of overflow bins.
HistHandler_TH3(columnar::ColumnarTool<> *parent, TH1 *hist)
The HistHandler TH3 handles 3D histograms, since TH3 inhertis from TH1,a TH1* object is parsed avoidi...
virtual ~HistHandler_TH2()
CorrectionCode FindBin(columnar::MuonId muon, int &bin) const override
Function that changes from Implementation to implementation.
Select isolated Photons, Electrons and Muons.
std::unique_ptr< AxisHandler > m_y_handler
std::unique_ptr< TH1 > clone(TH1 *H)
Clones a TH1 and handles the ownership then to a unique_ptr.
bool isOverFlowBin(int b) const override
States whether a bin is overflow or not.
dRJetAxisHandler(columnar::ColumnarTool<> *parent)
int nOverFlowBins() const override
Return the number of overflow bins.
@ OutOfValidityRange
Input object is out of validity range.
@ Error
Some error happened during the object correction.
int nOverFlowBins() const override
Return the number of overflow bins.
std::string GetBinName(unsigned int bin) const override
Translates the bin number into the borders and return them as name.
columnar::MuonAccessor< float > etaAcc
CorrectionCode GetBinningParameter(columnar::MuonId mu, float &value) const override
std::unique_ptr< AxisHandler > m_z_handler
columnar::MuonAccessor< float > chargeAcc
std::unique_ptr< AxisHandler > m_y_handler
CorrectionCode FindBin(columnar::MuonId muon, int &bin) const override
Function that changes from Implementation to implementation.
CorrectionCode GetBinningParameter(columnar::MuonId mu, float &value) const override
static std::unique_ptr< AxisHandler > GetAxisHandler(columnar::ColumnarTool<> *parent, const TAxis *axis)
void SetBinContent(int bin, float val)
columnar::MuonAccessor< float > ptAcc
CorrectionCode GetBinningParameter(columnar::MuonId mu, float &value) const override
CorrectionCode GetBinningParameter(columnar::MuonId mu, float &value) const override
HistHandler_TH1(columnar::ColumnarTool<> *parent, TH1 *hist)
columnar::MuonAccessor< float > acc_dR_deriv
std::unique_ptr< AxisHandler > m_x_handler
static void set_use_2D_sf(const bool)
std::string GetBinName(unsigned int bin) const override
Translates the bin number into the borders and return them as name.
CorrectionCode GetBinningParameter(columnar::MuonId mu, float &value) const override
HistHandler_TH2(columnar::ColumnarTool<> *parent, TH1 *hist)
The HistHandler TH2 handles 2D histograms which are not TH2Poly, since TH2 inhertis from TH1,...
a class representing a single object (electron, muons, etc.)
columnar::MuonAccessor< float > etaAcc
int nBins() const override
Return the total number of bins in the histogram -> (GetNbins() +2)**n.
int nBins() const override
Return the total number of bins in the histogram -> (GetNbins() +2)**n.
columnar::MuonAccessor< float > m_acc
virtual ~HistHandler_TH1()
columnar::MuonAccessor< float > phiAcc
std::string EraseWhiteSpaces(std::string str)
Removes beginning and trailing white spaces from a string.
std::string GetBinName(unsigned int bin) const override
Translates the bin number into the borders and return them as name.
@ Ok
The correction was done successfully.
std::unique_ptr< AxisHandler > m_x_handler
static void set_close_jet_decorator(const std::string &decor_name)
std::unique_ptr< AxisHandler > m_x_handler
Return value from object correction CP tools.
std::unique_ptr< AxisHandler > m_y_handler
HistHandler_TH2Poly(columnar::ColumnarTool<> *parent, TH2Poly *hist)
The HistHandler_TH2Poly handles the TH2Poly histograms of the scale-factor maps.
std::unique_ptr< TH1 > m_H
virtual ~HistHandler_TH3()