ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleHistograms.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
5
6#include "GaudiKernel/ITHistSvc.h"
9#include "TH1D.h"
10
11namespace egammaMonitoring {
12
14
15 const char* fN = m_name.c_str();
16
17 histoMap["pT"] = new TH1D(Form("%s_pT",fN) , ";p_{T} [GeV];Events", 40, 0, 200);
18 histoMap["eta"] = new TH1D(Form("%s_eta",fN), ";#eta;Events" , 90, -4.5, 4.5);
19 histoMap["phi"] = new TH1D(Form("%s_phi",fN), ";#phi;Events" , 20, -TMath::Pi(), TMath::Pi());
20
21 histoMap["eta_15GeV"] = new TH1D(Form("%s_eta_15GeV",fN), ";#eta;Events", 90, -4.5, 4.5);
22 histoMap["phi_15GeV"] = new TH1D(Form("%s_phi_15GeV",fN), ";#phi;Events", 20, -TMath::Pi(), TMath::Pi());
24 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"pT", histoMap["pT"]));
25 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"eta", histoMap["eta"]));
26 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"phi", histoMap["phi"]));
27
28 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"eta_15GeV", histoMap["eta_15GeV"]));
29 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"phi_15GeV", histoMap["phi_15GeV"]));
30
31 if (m_hasFwd) {
32 histoMap["pT_eta4"] = new TH1D(Form("%s_pT_eta4",fN) , ";p_{T} [GeV];Events",40, 0, 200);
33 histoMap["phi_eta4"] = new TH1D(Form("%s_phi_eta4",fN), ";#phi;Events" ,20, -TMath::Pi(), TMath::Pi());
34 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"pT_eta4", histoMap["pT_eta4"]));
35 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"phi_eta4", histoMap["phi_eta4"]));
36 }
37
38 return StatusCode::SUCCESS;
39 }
40
44
45 void ParticleHistograms::fill(const xAOD::IParticle& egamma, float /*mu*/) {
46
47 double pT = egamma.pt()*1e-3;
48 if (pT > 0)
49 histoMap["pT"]->Fill(pT);
50 histoMap["eta"]->Fill(egamma.eta());
51 histoMap["phi"]->Fill(egamma.phi());
52
53 if (pT > 15) {
54 histoMap["eta_15GeV"]->Fill(egamma.eta());
55 histoMap["phi_15GeV"]->Fill(egamma.phi());
56 }
57
58 if (m_hasFwd && std::abs(egamma.eta()) < 4.) {
59 histoMap["pT_eta4"]->Fill(pT);
60 histoMap["phi_eta4"]->Fill(egamma.phi());
61 }
62
63 }
64
65}
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual double pt() const
transverse momentum
virtual double phi() const
phi in [-pi,pi[
virtual double eta() const
pseudo rapidity
SmartIF< ITHistSvc > m_rootHistSvc
Definition IHistograms.h:48
std::map< std::string, TH1D * > histoMap
Definition IHistograms.h:42
void fill(const xAOD::IParticle &egamma)
elec/gamma data class.
Definition egamma.h:58
Class providing the definition of the 4-vector interface.