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 // inclusive plots, no isolation , ID or truth-matching requirements
16 m_oKinAllPlots(this, "All/KinPlots/", "Reco " + sParticleType +" Photon"),
17 m_oShowerShapesAllPlots(this, "All/ShowerShapesPlots/", sParticleType +" Photon"),
18 m_oShowerShapesAll10GeVPlots(this, "All/ShowerShapes10GeVPlots/", sParticleType +" Photon"),
19 m_oPhotonConversionAllPlots(this, "All/PhotonConversionPlots/", sParticleType +" Photon"),
20 // truth-matchint "Iso" requirement
21 m_oKinIsoPlots(this, "Iso/KinPlots/", "Reco " + sParticleType +" Photon"),
22 m_oShowerShapesIsoPlots(this, "Iso/ShowerShapesPlots/", sParticleType +" Photon"),
23 m_oShowerShapesIso10GeVPlots(this, "Iso/ShowerShapes10GeVPlots/", sParticleType +" Photon"),
24 m_oPhotonConversionIsoPlots(this, "Iso/PhotonConversionPlots/", sParticleType +" Photon"),
25 m_oKinIsoUncPlots(this, "Iso/KinPlotsUnc/", "Reco " + sParticleType +" Photon"),
26 m_oKinIsoConvPlots(this, "Iso/KinPlotsConv/", "Reco " + sParticleType +" Photon"),
27 //
28 m_oKinIsoLoosePlots(this, "IsoLoose/KinPlots/", "Reco " + sParticleType +" Photon"),
29 m_oKinIsoLooseUncPlots(this, "IsoLoose/KinPlotsUnc/", "Reco " + sParticleType +" Photon"),
30 m_oKinIsoLooseConvPlots(this, "IsoLoose/KinPlotsConv/", "Reco " + sParticleType +" Photon"),
31 //
32 m_oKinIsoTightPlots(this, "IsoTight/KinPlots/", "Reco " + sParticleType +" Photon"),
33 m_oKinIsoTightUncPlots(this, "IsoTight/KinPlotsUnc/", "Reco " + sParticleType +" Photon"),
34 m_oKinIsoTightConvPlots(this, "IsoTight/KinPlotsConv/", "Reco " + sParticleType +" Photon"),
35 m_sParticleType(sParticleType),
36 m_nParticles(nullptr),
38{}
39
41 m_nParticles = Book1D("n", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + "s;Events", 15, 0., 15.);
42 m_nParticles_weighted = Book1D("n_weighted", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + "s;Events", 15, 0., 15.);
43}
44
45 void PhotonPlots::fill(const xAOD::Photon& photon, const xAOD::EventInfo& eventInfo, bool isPrompt) {
46 m_oKinAllPlots.fill(photon,eventInfo);
47 m_oShowerShapesAllPlots.fill(photon,eventInfo);
48 if (photon.pt() > 10 * Gaudi::Units::GeV) {
49 m_oShowerShapesAll10GeVPlots.fill(photon,eventInfo);
50 }
51 m_oPhotonConversionAllPlots.fill(photon,eventInfo);
52
53 if(!isPrompt) return;
54
55 m_oKinIsoPlots.fill(photon,eventInfo);
56 m_oShowerShapesIsoPlots.fill(photon,eventInfo);
57 if (photon.pt() > 10 * Gaudi::Units::GeV) {
58 m_oShowerShapesIso10GeVPlots.fill(photon,eventInfo);
59 }
60
61 m_oPhotonConversionIsoPlots.fill(photon,eventInfo);
62 if (!xAOD::EgammaHelpers::isConvertedPhoton(&photon)) m_oKinIsoUncPlots.fill(photon,eventInfo);
63 else m_oKinIsoConvPlots.fill(photon,eventInfo);
64
65 bool val_loose=false;
66
67 photon.passSelection(val_loose, "Loose");
68 if(val_loose) {
69 m_oKinIsoLoosePlots.fill(photon,eventInfo);
70 if (!xAOD::EgammaHelpers::isConvertedPhoton(&photon)) m_oKinIsoLooseUncPlots.fill(photon,eventInfo);
71 else m_oKinIsoLooseConvPlots.fill(photon,eventInfo);
72 }
73
74 bool val_tight=false;
75
76 photon.passSelection(val_tight, "Tight");
77 if(val_tight) {
78 m_oKinIsoTightPlots.fill(photon,eventInfo);
79 if (!xAOD::EgammaHelpers::isConvertedPhoton(&photon)) m_oKinIsoTightUncPlots.fill(photon,eventInfo);
80 else m_oKinIsoTightConvPlots.fill(photon,eventInfo);
81 }
82}
83
84}
Egamma::KinematicsPlots m_oKinIsoLooseUncPlots
Definition PhotonPlots.h:35
virtual void initializePlots()
std::string m_sParticleType
Definition PhotonPlots.h:41
Egamma::KinematicsPlots m_oKinIsoPlots
Definition PhotonPlots.h:28
Egamma::ShowerShapesPlots m_oShowerShapesIsoPlots
Definition PhotonPlots.h:29
PhotonPlots(PlotBase *pParent, const std::string &sDir, const std::string &sParticleType)
Egamma::KinematicsPlots m_oKinIsoTightPlots
Definition PhotonPlots.h:37
Egamma::KinematicsPlots m_oKinAllPlots
Definition PhotonPlots.h:24
Egamma::PhotonConversionPlots m_oPhotonConversionIsoPlots
Definition PhotonPlots.h:31
Egamma::KinematicsPlots m_oKinIsoLooseConvPlots
Definition PhotonPlots.h:36
void fill(const xAOD::Photon &photon, const xAOD::EventInfo &eventInfo, bool isPrompt)
Egamma::ShowerShapesPlots m_oShowerShapesAll10GeVPlots
Definition PhotonPlots.h:26
Egamma::ShowerShapesPlots m_oShowerShapesAllPlots
Definition PhotonPlots.h:25
Egamma::KinematicsPlots m_oKinIsoTightConvPlots
Definition PhotonPlots.h:39
Egamma::KinematicsPlots m_oKinIsoTightUncPlots
Definition PhotonPlots.h:38
Egamma::KinematicsPlots m_oKinIsoLoosePlots
Definition PhotonPlots.h:34
Egamma::PhotonConversionPlots m_oPhotonConversionAllPlots
Definition PhotonPlots.h:27
Egamma::ShowerShapesPlots m_oShowerShapesIso10GeVPlots
Definition PhotonPlots.h:30
Egamma::KinematicsPlots m_oKinIsoUncPlots
Definition PhotonPlots.h:32
Egamma::KinematicsPlots m_oKinIsoConvPlots
Definition PhotonPlots.h:33
TH1D * Book1D(std::string_view name, std::string_view labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition PlotBase.cxx:94
PlotBase(PlotBase *parent, std::string_view 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".