ATLAS Offline Software
Loading...
Searching...
No Matches
egammaMonitoring::ParticleHistograms Class Reference

#include <ParticleHistograms.h>

Inheritance diagram for egammaMonitoring::ParticleHistograms:
Collaboration diagram for egammaMonitoring::ParticleHistograms:

Public Member Functions

StatusCode initializePlots ()
void fill (const xAOD::IParticle &egamma)
void fill (const xAOD::IParticle &egamma, float mu)
void hasFwd (bool a=true)
 IHistograms ()
 IHistograms (std::string name, std::string title, std::string folder, SmartIF< ITHistSvc > rootHistSvc)

Public Attributes

std::map< std::string, TH1D * > histoMap

Protected Attributes

std::string m_name
std::string m_title
std::string m_folder
SmartIF< ITHistSvc > m_rootHistSvc

Private Attributes

bool m_hasFwd = false

Detailed Description

Definition at line 16 of file ParticleHistograms.h.

Member Function Documentation

◆ fill() [1/2]

void egammaMonitoring::ParticleHistograms::fill ( const xAOD::IParticle & egamma)
virtual

◆ fill() [2/2]

void egammaMonitoring::ParticleHistograms::fill ( const xAOD::IParticle & egamma,
float mu )
virtual

Implements egammaMonitoring::IHistograms.

Reimplemented in egammaMonitoring::RecoElectronHistograms, egammaMonitoring::RecoPhotonHistograms, egammaMonitoring::TruthElectronHistograms, and egammaMonitoring::TruthPhotonHistograms.

Definition at line 45 of file ParticleHistograms.cxx.

45 {
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 }
std::map< std::string, TH1D * > histoMap
Definition IHistograms.h:42

◆ hasFwd()

void egammaMonitoring::ParticleHistograms::hasFwd ( bool a = true)
inline

Definition at line 26 of file ParticleHistograms.h.

26{ m_hasFwd = a; }
static Double_t a

◆ IHistograms() [1/2]

egammaMonitoring::IHistograms::IHistograms ( )

◆ IHistograms() [2/2]

egammaMonitoring::IHistograms::IHistograms ( std::string name,
std::string title,
std::string folder,
SmartIF< ITHistSvc > rootHistSvc )
inline

Definition at line 26 of file IHistograms.h.

30 :
31 m_name(std::move(std::move(name))),
32 m_title(std::move(std::move(title))),
33 m_folder(std::move(std::move(folder))),
34 m_rootHistSvc(std::move(rootHistSvc)) {}
SmartIF< ITHistSvc > m_rootHistSvc
Definition IHistograms.h:48

◆ initializePlots()

StatusCode egammaMonitoring::ParticleHistograms::initializePlots ( )
virtual

Implements egammaMonitoring::IHistograms.

Reimplemented in egammaMonitoring::RecoElectronHistograms, egammaMonitoring::RecoPhotonHistograms, egammaMonitoring::TruthElectronHistograms, and egammaMonitoring::TruthPhotonHistograms.

Definition at line 13 of file ParticleHistograms.cxx.

13 {
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());
23
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 }
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ histoMap

std::map<std::string, TH1D*> egammaMonitoring::IHistograms::histoMap
inherited

Definition at line 42 of file IHistograms.h.

◆ m_folder

std::string egammaMonitoring::IHistograms::m_folder
protectedinherited

Definition at line 47 of file IHistograms.h.

◆ m_hasFwd

bool egammaMonitoring::ParticleHistograms::m_hasFwd = false
private

Definition at line 29 of file ParticleHistograms.h.

◆ m_name

std::string egammaMonitoring::IHistograms::m_name
protectedinherited

Definition at line 45 of file IHistograms.h.

◆ m_rootHistSvc

SmartIF<ITHistSvc> egammaMonitoring::IHistograms::m_rootHistSvc
protectedinherited

Definition at line 48 of file IHistograms.h.

◆ m_title

std::string egammaMonitoring::IHistograms::m_title
protectedinherited

Definition at line 46 of file IHistograms.h.


The documentation for this class was generated from the following files: