ATLAS Offline Software
Loading...
Searching...
No Matches
IsolationHistograms.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8
9#include "GaudiKernel/ITHistSvc.h"
10
11#include "TH1D.h"
12
13
14using namespace egammaMonitoring;
15
16StatusCode IsolationHistograms::initializePlots(bool do_var_histos) {
17
18 const char* fN = m_name.c_str();
19
20 histoMap["ptCone20"] = new TH1D(Form("%s_ptCone20",fN), ";p_{T}^{cone20} [GeV]; Events / 0.25 GeV", 60, 0., 15.);
21 histoMap["ptCone30"] = new TH1D(Form("%s_ptCone30",fN), ";p_{T}^{cone30} [GeV]; Events / 0.25 GeV", 60, 0., 15.);
22
23 if (do_var_histos) {
24 histoMap["ptVarCone20"] = new TH1D(Form("%s_ptVarCone20",fN), ";p_{T}^{varCone20} [GeV]; Events / 0.25 GeV", 60, 0., 15.);
25 histoMap["ptVarCone30"] = new TH1D(Form("%s_ptVarCone30",fN), ";p_{T}^{varCone30} [GeV]; Events / 0.25 GeV", 60, 0., 15.);
26 }
27 histoMap["topoEtCone20"] = new TH1D(Form("%s_topoEtCone20",fN), ";E_{T}^{topoCone20} [GeV]; Events / 0.8 GeV", 60, -20., 30.);
28 histoMap["topoEtCone30"] = new TH1D(Form("%s_topoEtCone30",fN), ";E_{T}^{topoCone30} [GeV]; Events / 0.8 GeV", 60, -20., 30.);
29 histoMap["topoEtCone40"] = new TH1D(Form("%s_topoEtCone40",fN), ";E_{T}^{topoCone40} [GeV]; Events / 0.8 GeV", 60, -20., 30.);
30
31 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"ptCone20", histoMap["ptCone20"]));
32 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"ptCone30", histoMap["ptCone30"]));
33 if (do_var_histos) {
34 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"ptVarCone20", histoMap["ptVarCone20"]));
35 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"ptVarCone30", histoMap["ptVarCone30"]));
36 }
37 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"topoEtCone20", histoMap["topoEtCone20"]));
38 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"topoEtCone30", histoMap["topoEtCone30"]));
39 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"topoEtCone40", histoMap["topoEtCone40"]));
40
41 return StatusCode::SUCCESS;
42
43} // initializePlots
44
46
47 static const std::map<std::string,xAOD::Iso::IsolationType> mmap = {
48 { "ptCone20", xAOD::Iso::ptcone20 },
49 { "ptCone30", xAOD::Iso::ptcone30 },
50 { "ptVarCone20", xAOD::Iso::ptvarcone20 },
51 { "ptVarCone30", xAOD::Iso::ptvarcone30 },
52 { "topoEtCone20", xAOD::Iso::topoetcone20 },
53 { "topoEtCone30", xAOD::Iso::topoetcone30 },
54 { "topoEtCone40", xAOD::Iso::topoetcone40 } };
55 for (const auto& e : mmap) {
56 if (histoMap.find(e.first) == histoMap.end())
57 continue;
58 float x = -9e9;
59 if (egamma.isolationValue(x, e.second)) {
60 TH1D *h = histoMap[e.first];
61 double xmax = h->GetBinCenter(h->GetNbinsX());
62 h->Fill(std::min(x/1000., xmax));
63 }
64 }
65}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define x
std::map< std::string, TH1D * > histoMap
StatusCode initializePlots(bool do_var_histos)
void fill(const xAOD::Egamma &egamma)
elec/gamma data class.
Definition egamma.h:58
double xmax
Definition listroot.cxx:61
@ topoetcone20
Topo-cluster ET-sum.
@ ptcone20
Track isolation.
@ ptvarcone20
Mini-Isolation http://arxiv.org/abs/1007.2221.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17