ATLAS Offline Software
Loading...
Searching...
No Matches
RecoElectronHistograms.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
7#include "GaudiKernel/ITHistSvc.h"
8
9#include "TH2D.h"
10#include "TH3D.h"
11
12using namespace egammaMonitoring;
13
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}
38
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}
61
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
SmartIF< ITHistSvc > m_rootHistSvc
Definition IHistograms.h:48
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.
Electron_v1 Electron
Definition of the current "egamma version".