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

#include <RecoElectronHistograms.h>

Inheritance diagram for egammaMonitoring::RecoElectronHistograms:
Collaboration diagram for egammaMonitoring::RecoElectronHistograms:

Public Member Functions

StatusCode initializePlots ()
void fill (const xAOD::Electron &elrec)
void isData (bool b=true)
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, TH2D * > histo2DMap
std::map< std::string, TH3D * > histo3DMap
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_isData = false
bool m_hasFwd = false

Detailed Description

Definition at line 16 of file RecoElectronHistograms.h.

Member Function Documentation

◆ fill() [1/3]

void RecoElectronHistograms::fill ( const xAOD::Electron & elrec)

Definition at line 39 of file RecoElectronHistograms.cxx.

39 {
40
42
43 if (!m_isData) {
44 static const SG::AuxElement::ConstAccessor<int> accType("truthType");
45 static const SG::AuxElement::ConstAccessor<int> accOrigin("truthOrigin");
46 if (accOrigin.isAvailable(elrec))
47 histoMap["truthOrigin"]->Fill(accOrigin(elrec));
48 else
49 histoMap["truthOrigin"]->Fill(-1);
50 if (accType.isAvailable(elrec))
51 histoMap["truthType"]->Fill(accType(elrec));
52 else
53 histoMap["truthType"]->Fill(-1);
54 }
55
56 histo2DMap["eta_nTracks"]->Fill(elrec.eta(),elrec.nTrackParticles());
57 if (elrec.nTrackParticles())
58 histo3DMap["eteta_eop"]->Fill(elrec.pt()*1e-3,std::abs(elrec.eta()),elrec.pt()/elrec.trackParticle()->pt());
59
60}
std::map< std::string, TH1D * > histoMap
Definition IHistograms.h:42
void fill(const xAOD::IParticle &egamma)
std::map< std::string, TH2D * > histo2DMap
std::map< std::string, TH3D * > histo3DMap
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition Egamma_v1.cxx:66
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition Egamma_v1.cxx:71
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
size_t nTrackParticles() const
Return the number xAOD::TrackParticles that match the electron candidate.
virtual double pt() const override final
The transverse momentum ( ) of the particle.

◆ fill() [2/3]

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

Reimplemented from egammaMonitoring::ParticleHistograms.

Definition at line 23 of file ParticleHistograms.cxx.

41 {
42 ParticleHistograms::fill(egamma,0.);
43 }

◆ fill() [3/3]

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

Reimplemented from egammaMonitoring::ParticleHistograms.

Definition at line 24 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 }

◆ hasFwd()

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

Definition at line 26 of file ParticleHistograms.h.

26{ m_hasFwd = a; }
static Double_t a

◆ IHistograms() [1/2]

egammaMonitoring::IHistograms::IHistograms ( )
inherited

◆ IHistograms() [2/2]

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

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 RecoElectronHistograms::initializePlots ( )
virtual

Reimplemented from egammaMonitoring::ParticleHistograms.

Definition at line 14 of file RecoElectronHistograms.cxx.

14 {
15
17
18 const char* fN = m_name.c_str();
19
20 if (!m_isData) {
21 histoMap["truthType"] = new TH1D(Form("%s_truthType",fN), ";truth type; Events", 41,-1,40);
22 histoMap["truthOrigin"] = new TH1D(Form("%s_truthOrigin",fN), ";truth origin; Events",51,-1,50);
23 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"truthType", histoMap["truthType"]));
24 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"truthOrigin", histoMap["truthOrigin"]));
25 }
26
27 histo2DMap["eta_nTracks"] = new TH2D(Form("%s_eta_nTracks",fN),
28 ";#eta;n_{trk}; Events", 90, -4.5, 4.5, 10, 0,10);
29 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"eta_nTracks", histo2DMap["eta_nTracks"]));
30
31 histo3DMap["eteta_eop"] = new TH3D(Form("%s_eteta_eop",fN),
32 ";E_{T} [GeV];#eta;E/p; Events", 20, 0, 200, 25, 0, 2.5, 250, 0.5,3.);
33 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"eteta_eop", histo3DMap["eteta_eop"]));
34
35 return StatusCode::SUCCESS;
36
37}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ isData()

void egammaMonitoring::RecoElectronHistograms::isData ( bool b = true)
inline

Definition at line 29 of file RecoElectronHistograms.h.

Member Data Documentation

◆ histo2DMap

std::map<std::string, TH2D*> egammaMonitoring::RecoElectronHistograms::histo2DMap

Definition at line 21 of file RecoElectronHistograms.h.

◆ histo3DMap

std::map<std::string, TH3D*> egammaMonitoring::RecoElectronHistograms::histo3DMap

Definition at line 22 of file RecoElectronHistograms.h.

◆ 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
privateinherited

Definition at line 29 of file ParticleHistograms.h.

◆ m_isData

bool egammaMonitoring::RecoElectronHistograms::m_isData = false
private

Definition at line 32 of file RecoElectronHistograms.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: