ATLAS Offline Software
PhotonValidationPlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 using CLHEP::GeV;
9 
11  m_oAllPlots(this, "PhotAll/", "Reco All"),
12  m_oPhotPlots(this, "Phot/", "Reco Phot"),
13  m_oTopoPhotPlots(this, "PhotTopo/", "Reco Topo Phot"),
14  m_oAmbPhotPlots(this, "PhotAmb/", "Reco Ambig Phot"),
15  m_oConvPhotPlots(this, "Conv/", "Reco Converted"),
16  m_oTruthAllPlots(this, "TruthAll/All/", "Truth Photon"),
17  m_oTruthAllIsoPlots(this, "TruthAll/Iso/all/", "Truth Iso photon"),
18  m_oTruthAllIsoConvPlots(this, "TruthAll/Iso/Conv/", "Truth Iso Conv"),
19  m_oTruthAllIsoUncPlots(this, "TruthAll/Iso/Unc/", "Truth Iso Unc"),
20  m_oTruthRecoPlots(this, "Truth/Reco/all/", "Reco Truth Photon"),
21  m_oTruthRecoConvPlots(this, "Truth/Reco/Conv/", "Reco Truth Conv Photon"),
22  m_oTruthRecoUncPlots(this, "Truth/Reco/Unc/", "Reco Truth Unc Photon"),
23  m_oTruthRecoLoosePlots(this, "Truth/RecoLoose/all/", "Reco Truth as loose Photon"),
24  m_oTruthRecoLooseConvPlots(this, "Truth/RecoLoose/Conv/", "Reco Truth Conv as loose Photon"),
25  m_oTruthRecoLooseUncPlots(this, "Truth/RecoLoose/Unc/", "Reco Truth Unc as loose Photon"),
26  m_oTruthRecoTightPlots(this, "Truth/RecoTight/all/", "Reco Truth as tight Photon"),
27  m_oTruthRecoTightConvPlots(this, "Truth/RecoTight/Conv/", "Reco Truth Conv as tight Photon"),
28  m_oTruthRecoTightUncPlots(this, "Truth/RecoTight/Unc/", "Reco Truth Unc as tight Photon"),
29  m_oTruthIsoPlots(this, "Truth/Iso/all/", "Truth Iso photon"),
30  m_oTruthIsoConvPlots(this, "Truth/Iso/Conv/", "Truth Iso Conv"),
31  m_oTruthIsoUncPlots(this, "Truth/Iso/Unc/", "Truth Iso Unc"),
32  author(nullptr),
33  convTruthR(nullptr),
34  convTruthMatchedR(nullptr),
35  convTruthRvsEta(nullptr),
36  convTruthMatchedRvsEta(nullptr),
37  res_et(nullptr),
38  res_eta(nullptr),
39  res_et_cut(nullptr),
40  res_eta_cut(nullptr)
41 
42 {}
44  author = Book1D("author", "Author of "+ m_sParticleType +"; author;Events", 150, -0.5, 149.5);
45  convTruthR = Book1D("convTruthR", "Radius Of conversion vertex for truth" + m_sParticleType + ";convR;Conversions", 1200,0.,1200.);
46  convTruthMatchedR = Book1D("convTruthMatchedR", "Radius Of conversion vertex for truth matched to reco" + m_sParticleType + ";convR;Conversions", 1200,0.,1200.);
47  convTruthRvsEta = Book2D("convTruthRvsEta", "Radius Of conversion vertex for truth vs #eta" + m_sParticleType + ";convR;#eta", 1200,0.,1200., 1000,-5.,5.);
48  convTruthMatchedRvsEta = Book2D("convTruthMatchedRvsEta", "Radius Of conversion vertex for truth matched to reco vs #eta" + m_sParticleType + ";convR;#eta", 1200,0.,1200., 1000,-5.,5.);
49  res_et = BookTProfile("res_et"," IsoPhoton;E_{T}^{truth}, [GeV];(E_{T} - E_{T}^{truth})/E_{T}^{truth}",100, 0., 200.);
50  res_eta = BookTProfile("res_eta"," IsoPhoton;#eta;(E_{T} - E_{T}^{truth})/E_{T}^{truth}",60, -3., 3.);
51  res_et_cut = BookTProfile("res_et_cut"," IsoPhoton;E_{T}^{truth}, [GeV];(E_{T} - E_{T}^{truth})/E_{T}^{truth}",100, 0., 200.);
52  res_eta_cut = BookTProfile("res_eta_cut"," IsoPhoton;#eta;(E_{T} - E_{T}^{truth})/E_{T}^{truth}",60, -3., 3.);
53 }
54 
56 
57  float weight = 1.;
58  weight = eventInfo.beamSpotWeight();
59 
60  author->Fill(photon.author(),weight);
61  m_oAllPlots.fill(photon, eventInfo, isPrompt);
62 
63  double photon_pt = photon.pt()/GeV;
64  if (photon.author()&xAOD::EgammaParameters::AuthorPhoton&&photon_pt>7.) m_oPhotPlots.fill(photon, eventInfo, isPrompt);
65  if (photon_pt<7.) m_oTopoPhotPlots.fill(photon, eventInfo, isPrompt);
66  if (photon.author()&xAOD::EgammaParameters::AuthorAmbiguous&&photon_pt>7.) m_oAmbPhotPlots.fill(photon, eventInfo, isPrompt);
67 
68  //Select converted photons
69  if (photon_pt>7.)m_oConvPhotPlots.fill(photon, eventInfo, isPrompt);
70 }
PhotonValidationPlots::m_sParticleType
std::string m_sParticleType
Definition: PhotonValidationPlots.h:24
PhotonValidationPlots::convTruthMatchedRvsEta
TH2 * convTruthMatchedRvsEta
Definition: PhotonValidationPlots.h:53
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
PlotBase
Definition: PlotBase.h:34
PhotonValidationPlots.h
PhotonValidationPlots::m_oTopoPhotPlots
Egamma::PhotonPlots m_oTopoPhotPlots
Definition: PhotonValidationPlots.h:29
PhotonValidationPlots::res_eta_cut
TProfile * res_eta_cut
Definition: PhotonValidationPlots.h:57
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
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
PhotonValidationPlots::initializePlots
virtual void initializePlots()
Definition: PhotonValidationPlots.cxx:43
PhotonValidationPlots::convTruthMatchedR
TH1 * convTruthMatchedR
Definition: PhotonValidationPlots.h:51
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
PhotonValidationPlots::author
TH1 * author
Definition: PhotonValidationPlots.h:49
Egamma::PhotonCnvPlots::fill
void fill(const xAOD::Photon &photon, const xAOD::EventInfo &eventInfo, bool isPrompt)
Definition: PhotonCnvPlots.cxx:44
PhotonValidationPlots::m_oAllPlots
Egamma::PhotonPlots m_oAllPlots
Definition: PhotonValidationPlots.h:27
PhotonValidationPlots::convTruthR
TH1 * convTruthR
Definition: PhotonValidationPlots.h:50
xAOD::EgammaParameters::AuthorAmbiguous
const uint16_t AuthorAmbiguous
Object Reconstructed by standard cluster-based algorithm.
Definition: EgammaDefs.h:32
PhotonValidationPlots::m_oAmbPhotPlots
Egamma::PhotonAmbPlots m_oAmbPhotPlots
Definition: PhotonValidationPlots.h:30
PhotonValidationPlots::res_eta
TProfile * res_eta
Definition: PhotonValidationPlots.h:55
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
xAOD::Photon_v1
Definition: Photon_v1.h:37
MCTruthPartClassifier::isPrompt
int isPrompt(const unsigned int classify, bool allow_prompt_tau_decays=true)
Definition: TruthClassifiers.h:180
PhotonValidationPlots::convTruthRvsEta
TH2 * convTruthRvsEta
Definition: PhotonValidationPlots.h:52
PhotonValidationPlots::m_oConvPhotPlots
Egamma::PhotonCnvPlots m_oConvPhotPlots
Definition: PhotonValidationPlots.h:31
CaloCondBlobAlgs_fillNoiseFromASCII.author
string author
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:26
EgammaDefs.h
PlotBase::BookTProfile
TProfile * BookTProfile(const std::string &name, const std::string &labels, int nBinsX, float startX, float endX, float startY=-1, float endY=-1, bool prependDir=true, bool useRMS=false)
Book a TProfile histogram.
Definition: PlotBase.cxx:186
xAOD::EgammaParameters::AuthorPhoton
const uint16_t AuthorPhoton
Object Reconstructed by standard cluster-based algorithm.
Definition: EgammaDefs.h:28
PhotonValidationPlots::PhotonValidationPlots
PhotonValidationPlots(PlotBase *pParent, const std::string &sDir)
Definition: PhotonValidationPlots.cxx:10
PhotonValidationPlots::m_oPhotPlots
Egamma::PhotonPlots m_oPhotPlots
Definition: PhotonValidationPlots.h:28
Egamma::PhotonPlots::fill
void fill(const xAOD::Photon &photon, const xAOD::EventInfo &eventInfo, bool isPrompt)
Definition: PhotonPlots.cxx:42
xAOD::EventInfo_v1::beamSpotWeight
float beamSpotWeight() const
Weight for beam spot size reweighting.
Definition: EventInfo_v1.cxx:970
PhotonValidationPlots::res_et_cut
TProfile * res_et_cut
Definition: PhotonValidationPlots.h:56
PhotonValidationPlots::res_et
TProfile * res_et
Definition: PhotonValidationPlots.h:54
Egamma::PhotonAmbPlots::fill
void fill(const xAOD::Photon &photon, const xAOD::EventInfo &eventInfo, bool isPrompt)
Definition: PhotonAmbPlots.cxx:24
PhotonValidationPlots::fill
void fill(const xAOD::Photon &photon, const xAOD::EventInfo &eventInfo, bool isPrompt)
Definition: PhotonValidationPlots.cxx:55