ATLAS Offline Software
Loading...
Searching...
No Matches
PhotonCnvPlots.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 "PhotonCnvPlots.h"
9
10namespace Egamma{
11
12
13PhotonCnvPlots::PhotonCnvPlots(PlotBase* pParent, const std::string& sDir, const std::string& sParticleType):PlotBase(pParent, sDir),
14 m_oKinAllPlots(this, "All/KinPlots/", "Reco " + sParticleType +" Photon"),
15 m_oKinIsoPlots(this, "Iso/KinPlots/", "Reco " + sParticleType +" Photon"),
16 m_sParticleType(sParticleType),
17 m_nParticles(nullptr),
18 m_nParticles_weighted(nullptr),
19 m_nVtx(nullptr),
20 m_convR(nullptr),
21 m_convRvsEta(nullptr),
22 m_convRvsType(nullptr),
23 m_convType(nullptr),
24 m_convDeltaEta(nullptr),
25 m_convDeltaPhi(nullptr)
26
27
28{}
29
31 m_nParticles = Book1D("n", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + ";Events", 15, 0., 15.);
32 m_nParticles_weighted = Book1D("n_weighted", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + ";Events", 15, 0., 15.);
33 m_nVtx = Book1D("nVtx","Number of vertexes"+ m_sParticleType + ";nVtx;Events", 10, -0.5, 9.5);
34 m_convR = Book1D("convR", "Radius Of conversion vertex" + m_sParticleType + ";convR;Conversions", 1200,0.,1200.);
35 m_convRvsEta = Book2D("convRvsEta", "Radius Of conversion vertex vs #eta" + m_sParticleType + ";convR;#eta", 1200,0.,1200., 1000.,-5.,5.);
36 m_convRvsType = Book2D("convRvsType", "Radius Of conversion vertex vs Type" + m_sParticleType + ";convR;Type", 1200,0.,1200., 7.,-.5,6.5);
37 m_convType = Book1D("convType", "Conversion Type"+ m_sParticleType + ";convType;Conversions", 7, -0.5, 6.5);
38 m_convDeltaEta = Book1D("convDeltaEta","Conversion #Delta #eta"+ m_sParticleType +";#eta; Conversions ", 100,-0.5,0.5);
39 m_convDeltaPhi = Book1D("ConvDeltaPhi","Conversion #Delta #varphi"+ m_sParticleType +";#varphi; Conversions ",100 ,-0.5,0.5);
40}
41
42
43
44 void PhotonCnvPlots::fill(const xAOD::Photon& photon, const xAOD::EventInfo& eventInfo, bool isPrompt) {
45
46 float weight = 1.;
47 weight = eventInfo.beamSpotWeight();
48
49 if(!xAOD::EgammaHelpers::isConvertedPhoton(&photon)) return;
50 m_oKinAllPlots.fill(photon,eventInfo);
51
52 if(!isPrompt) return;
53
54 int nvtx=photon.nVertices();
55 m_nVtx->Fill(nvtx,weight);
56
58 m_convType->Fill(cvtype);
59 float vtxRad = xAOD::EgammaHelpers::conversionRadius(&photon);
60
61 float cnvDeltaEta1;
62 float cnvDeltaPhi1;
63 photon.vertexCaloMatchValue(cnvDeltaEta1, xAOD::EgammaParameters::convMatchDeltaEta1);
64 photon.vertexCaloMatchValue(cnvDeltaPhi1, xAOD::EgammaParameters::convMatchDeltaPhi1);
65 m_convDeltaEta->Fill(cnvDeltaEta1,weight);
66 m_convDeltaPhi->Fill(cnvDeltaPhi1,weight);
67
68 m_convR->Fill(vtxRad);
69 m_convRvsEta->Fill(vtxRad,photon.eta(),weight);
70 m_convRvsType->Fill(vtxRad,cvtype,weight);
71 m_oKinIsoPlots.fill(photon,eventInfo);
72
73
74 }
75}
Egamma::KinematicsPlots m_oKinIsoPlots
PhotonCnvPlots(PlotBase *pParent, const std::string &sDir, const std::string &sParticleType)
virtual void initializePlots()
void fill(const xAOD::Photon &photon, const xAOD::EventInfo &eventInfo, bool isPrompt)
Egamma::KinematicsPlots m_oKinAllPlots
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
TH2F * Book2D(const std::string &name, const std::string &labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir=true)
Book a TH2F histogram.
Definition PlotBase.cxx:123
float beamSpotWeight() const
Weight for beam spot size reweighting.
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
xAOD::EgammaParameters::ConversionType conversionType(const xAOD::Photon *ph)
return the photon conversion type (see EgammaEnums)
float conversionRadius(const xAOD::Vertex *vx)
return the conversion radius or 9999.
@ convMatchDeltaPhi1
difference between the cluster phi and the phi of the first track of the vertex extrapolated to the s...
@ convMatchDeltaEta1
difference between the cluster eta and the eta of the first track of the vertex extrapolated to the s...
EventInfo_v1 EventInfo
Definition of the latest event info version.
Photon_v1 Photon
Definition of the current "egamma version".