ATLAS Offline Software
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 
10 namespace Egamma{
11 
12 
13 PhotonCnvPlots::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 
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);
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::PhotonCnvPlots::m_convR
TH1 * m_convR
Definition: PhotonCnvPlots.h:32
PlotBase
Definition: PlotBase.h:34
Egamma
Definition: ClusMomentumPlots.cxx:11
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
Egamma::PhotonCnvPlots::m_convType
TH1 * m_convType
Definition: PhotonCnvPlots.h:35
PlotBase::Book2D
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
Egamma::PhotonCnvPlots::initializePlots
virtual void initializePlots()
Definition: PhotonCnvPlots.cxx:30
Egamma::PhotonCnvPlots::m_nParticles
TH1 * m_nParticles
Definition: PhotonCnvPlots.h:29
Egamma::PhotonCnvPlots::m_convRvsType
TH2 * m_convRvsType
Definition: PhotonCnvPlots.h:34
xAOD::EgammaParameters::ConversionType
ConversionType
Definition: EgammaEnums.h:268
Egamma::PhotonCnvPlots::m_nParticles_weighted
TH1 * m_nParticles_weighted
Definition: PhotonCnvPlots.h:30
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
PlotBase::Book1D
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
Egamma::PhotonCnvPlots::PhotonCnvPlots
PhotonCnvPlots(PlotBase *pParent, const std::string &sDir, const std::string &sParticleType)
Definition: PhotonCnvPlots.cxx:13
Egamma::PhotonCnvPlots::m_convDeltaEta
TH1 * m_convDeltaEta
Definition: PhotonCnvPlots.h:36
Egamma::PhotonCnvPlots::fill
void fill(const xAOD::Photon &photon, const xAOD::EventInfo &eventInfo, bool isPrompt)
Definition: PhotonCnvPlots.cxx:44
MCTruthClassifierDefs.h
EgammaxAODHelpers.h
xAOD::EgammaHelpers::isConvertedPhoton
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
Definition: EgammaxAODHelpers.cxx:25
PhotonxAODHelpers.h
Egamma::KinematicsPlots::fill
void fill(const xAOD::IParticle &part, const xAOD::EventInfo &eventInfo)
Definition: Reconstruction/egamma/EgammaPhysValMonitoring/src/KinematicsPlots.cxx:28
Egamma::PhotonCnvPlots::m_nVtx
TH1 * m_nVtx
Definition: PhotonCnvPlots.h:31
xAOD::EgammaParameters::convMatchDeltaPhi1
@ convMatchDeltaPhi1
difference between the cluster phi and the phi of the first track of the vertex extrapolated to the s...
Definition: EgammaEnums.h:253
Egamma::PhotonCnvPlots::m_oKinAllPlots
Egamma::KinematicsPlots m_oKinAllPlots
Definition: PhotonCnvPlots.h:24
xAOD::EgammaHelpers::conversionRadius
float conversionRadius(const xAOD::Vertex *vx)
return the conversion radius or 9999.
Definition: PhotonxAODHelpers.cxx:77
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
Egamma::PhotonCnvPlots::m_oKinIsoPlots
Egamma::KinematicsPlots m_oKinIsoPlots
Definition: PhotonCnvPlots.h:25
xAOD::Photon_v1
Definition: Photon_v1.h:37
xAOD::EgammaParameters::convMatchDeltaEta1
@ convMatchDeltaEta1
difference between the cluster eta and the eta of the first track of the vertex extrapolated to the s...
Definition: EgammaEnums.h:243
MCTruthPartClassifier::isPrompt
int isPrompt(const unsigned int classify, bool allow_prompt_tau_decays=true)
Definition: TruthClassifiers.h:180
xAOD::EgammaHelpers::conversionType
xAOD::EgammaParameters::ConversionType conversionType(const xAOD::Photon *ph)
return the photon conversion type (see EgammaEnums)
Definition: PhotonxAODHelpers.cxx:27
PhotonCnvPlots.h
Egamma::PhotonCnvPlots::m_convRvsEta
TH2 * m_convRvsEta
Definition: PhotonCnvPlots.h:33
Egamma::PhotonCnvPlots::m_convDeltaPhi
TH1 * m_convDeltaPhi
Definition: PhotonCnvPlots.h:37
xAOD::EventInfo_v1::beamSpotWeight
float beamSpotWeight() const
Weight for beam spot size reweighting.
Definition: EventInfo_v1.cxx:970
Egamma::PhotonCnvPlots::m_sParticleType
std::string m_sParticleType
Definition: PhotonCnvPlots.h:27