ATLAS Offline Software
Loading...
Searching...
No Matches
PhotonPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "PhotonPlots.h"
9using CLHEP::GeV;
10
11namespace Egamma{
12
13
14PhotonPlots::PhotonPlots(PlotBase* pParent, const std::string& sDir, const std::string& sParticleType):PlotBase(pParent, sDir),
15 m_oKinAllPlots(this, "All/KinPlots/", "Reco " + sParticleType +" Photon"),
16 m_oShowerShapesAllPlots(this, "All/ShowerShapesPlots/", sParticleType +" Photon"),
17 m_oPhotonConversionAllPlots(this, "All/PhotonConversionPlots/", sParticleType +" Photon"),
18//
19 m_oKinIsoPlots(this, "Iso/KinPlots/", "Reco " + sParticleType +" Photon"),
20 m_oShowerShapesIsoPlots(this, "Iso/ShowerShapesPlots/", sParticleType +" Photon"),
21 m_oPhotonConversionIsoPlots(this, "Iso/PhotonConversionPlots/", sParticleType +" Photon"),
22 m_oKinIsoUncPlots(this, "Iso/KinPlotsUnc/", "Reco " + sParticleType +" Photon"),
23 m_oKinIsoConvPlots(this, "Iso/KinPlotsConv/", "Reco " + sParticleType +" Photon"),
24 //
25 m_oKinIsoLoosePlots(this, "IsoLoose/KinPlots/", "Reco " + sParticleType +" Photon"),
26 m_oKinIsoLooseUncPlots(this, "IsoLoose/KinPlotsUnc/", "Reco " + sParticleType +" Photon"),
27 m_oKinIsoLooseConvPlots(this, "IsoLoose/KinPlotsConv/", "Reco " + sParticleType +" Photon"),
28 //
29 m_oKinIsoTightPlots(this, "IsoTight/KinPlots/", "Reco " + sParticleType +" Photon"),
30 m_oKinIsoTightUncPlots(this, "IsoTight/KinPlotsUnc/", "Reco " + sParticleType +" Photon"),
31 m_oKinIsoTightConvPlots(this, "IsoTight/KinPlotsConv/", "Reco " + sParticleType +" Photon"),
32 m_sParticleType(sParticleType),
33 m_nParticles(nullptr),
35{}
36
38 m_nParticles = Book1D("n", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + "s;Events", 15, 0., 15.);
39 m_nParticles_weighted = Book1D("n_weighted", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + "s;Events", 15, 0., 15.);
40}
41
42 void PhotonPlots::fill(const xAOD::Photon& photon, const xAOD::EventInfo& eventInfo, bool isPrompt) {
43 m_oKinAllPlots.fill(photon,eventInfo);
44 m_oShowerShapesAllPlots.fill(photon,eventInfo);
45 m_oPhotonConversionAllPlots.fill(photon,eventInfo);
46
47 if(!isPrompt) return;
48
49 m_oKinIsoPlots.fill(photon,eventInfo);
50 m_oShowerShapesIsoPlots.fill(photon,eventInfo);
51 m_oPhotonConversionIsoPlots.fill(photon,eventInfo);
52 if (!xAOD::EgammaHelpers::isConvertedPhoton(&photon)) m_oKinIsoUncPlots.fill(photon,eventInfo);
53 else m_oKinIsoConvPlots.fill(photon,eventInfo);
54
55 bool val_loose=false;
56
57 photon.passSelection(val_loose, "Loose");
58 if(val_loose) {
59 m_oKinIsoLoosePlots.fill(photon,eventInfo);
60 if (!xAOD::EgammaHelpers::isConvertedPhoton(&photon)) m_oKinIsoLooseUncPlots.fill(photon,eventInfo);
61 else m_oKinIsoLooseConvPlots.fill(photon,eventInfo);
62 }
63
64 bool val_tight=false;
65
66 photon.passSelection(val_tight, "Tight");
67 if(val_tight) {
68 m_oKinIsoTightPlots.fill(photon,eventInfo);
69 if (!xAOD::EgammaHelpers::isConvertedPhoton(&photon)) m_oKinIsoTightUncPlots.fill(photon,eventInfo);
70 else m_oKinIsoTightConvPlots.fill(photon,eventInfo);
71 }
72}
73
74}
Egamma::KinematicsPlots m_oKinIsoLooseUncPlots
Definition PhotonPlots.h:33
virtual void initializePlots()
std::string m_sParticleType
Definition PhotonPlots.h:39
Egamma::KinematicsPlots m_oKinIsoPlots
Definition PhotonPlots.h:27
Egamma::ShowerShapesPlots m_oShowerShapesIsoPlots
Definition PhotonPlots.h:28
PhotonPlots(PlotBase *pParent, const std::string &sDir, const std::string &sParticleType)
Egamma::KinematicsPlots m_oKinIsoTightPlots
Definition PhotonPlots.h:35
Egamma::KinematicsPlots m_oKinAllPlots
Definition PhotonPlots.h:24
Egamma::PhotonConversionPlots m_oPhotonConversionIsoPlots
Definition PhotonPlots.h:29
Egamma::KinematicsPlots m_oKinIsoLooseConvPlots
Definition PhotonPlots.h:34
void fill(const xAOD::Photon &photon, const xAOD::EventInfo &eventInfo, bool isPrompt)
Egamma::ShowerShapesPlots m_oShowerShapesAllPlots
Definition PhotonPlots.h:25
Egamma::KinematicsPlots m_oKinIsoTightConvPlots
Definition PhotonPlots.h:37
Egamma::KinematicsPlots m_oKinIsoTightUncPlots
Definition PhotonPlots.h:36
Egamma::KinematicsPlots m_oKinIsoLoosePlots
Definition PhotonPlots.h:32
Egamma::PhotonConversionPlots m_oPhotonConversionAllPlots
Definition PhotonPlots.h:26
Egamma::KinematicsPlots m_oKinIsoUncPlots
Definition PhotonPlots.h:30
Egamma::KinematicsPlots m_oKinIsoConvPlots
Definition PhotonPlots.h:31
TH1D * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition PlotBase.cxx:94
PlotBase(PlotBase *parent, const std::string &sDir)
Definition PlotBase.cxx:29
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
EventInfo_v1 EventInfo
Definition of the latest event info version.
Photon_v1 Photon
Definition of the current "egamma version".