24 #include "CLHEP/Units/GlobalPhysicalConstants.h" 33 : outputFileName_(iConfig.getParameter<
std::
string>(
"outputFileName")),
84 iBooker.
book1D(histname +
"All_miniAOD",
" Photon Transverse Energy: All ecal ",
etBin,
etMin,
etMax);
86 iBooker.
book1D(histname +
"Barrel_miniAOD",
" Photon Transverse Energy: Barrel ",
etBin,
etMin,
etMax);
88 iBooker.
book1D(histname +
"Endcap_miniAOD",
" Photon Transverse Energy: Endcap ",
etBin,
etMin,
etMax);
92 histname +
"All_miniAOD",
" Photon E/E_{true}: All ecal; E/E_{true} (GeV)",
resBin,
resMin,
resMax);
94 histname +
"Barrel_miniAOD",
"Photon E/E_{true}: Barrel; E/E_{true} (GeV)",
resBin,
resMin,
resMax);
96 histname +
"Endcap_miniAOD",
" Photon E/E_{true}: Endcap; E/E_{true} (GeV)",
resBin,
resMin,
resMax);
98 histname =
"sigmaEoE";
100 iBooker.
book1D(histname +
"All_miniAOD",
"#sigma_{E}/E: All ecal; #sigma_{E}/E", 100, 0., 0.08);
102 iBooker.
book1D(histname +
"Barrel_miniAOD",
"#sigma_{E}/E: Barrel; #sigma_{E}/E", 100, 0., 0.08);
104 iBooker.
book1D(histname +
"Endcap_miniAOD",
"#sigma_{E}/E: Endcap, #sigma_{E}/E", 100, 0., 0.08);
110 histname =
"full5x5_r9";
123 h_hOverE_[0][0] = iBooker.
book1D(histname +
"All_miniAOD",
"H/E: All Ecal", 100, 0., 0.2);
124 h_hOverE_[0][1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
"H/E: Barrel ", 100, 0., 0.2);
125 h_hOverE_[0][2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
"H/E: Endcap ", 100, 0., 0.2);
127 histname =
"newhOverE";
128 h_newhOverE_[0][0] = iBooker.
book1D(histname +
"All_miniAOD",
"new H/E: All Ecal", 100, 0., 0.2);
129 h_newhOverE_[0][1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
"new H/E: Barrel ", 100, 0., 0.2);
130 h_newhOverE_[0][2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
"new H/E: Endcap ", 100, 0., 0.2);
132 histname =
"sigmaIetaIeta";
133 h_sigmaIetaIeta_[0][0] = iBooker.
book1D(histname +
"All_miniAOD",
"sigmaIetaIeta: All Ecal", 100, 0., 0.1);
134 h_sigmaIetaIeta_[0][1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
"sigmaIetaIeta: Barrel ", 100, 0., 0.05);
135 h_sigmaIetaIeta_[0][2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
"sigmaIetaIeta: Endcap ", 100, 0., 0.1);
136 histname =
"full5x5_sigmaIetaIeta";
138 iBooker.
book1D(histname +
"All_miniAOD",
"Full5x5 sigmaIetaIeta: All Ecal", 100, 0., 0.1);
140 iBooker.
book1D(histname +
"Barrel_miniAOD",
"Full5x5 sigmaIetaIeta: Barrel ", 100, 0., 0.05);
142 iBooker.
book1D(histname +
"Endcap_miniAOD",
"Full5x5 sigmaIetaIeta: Endcap ", 100, 0., 0.1);
144 histname =
"ecalRecHitSumEtConeDR04";
146 iBooker.
book1D(histname +
"All_miniAOD",
"ecalRecHitSumEtDR04: All Ecal",
etBin,
etMin, 20.);
148 iBooker.
book1D(histname +
"Barrel_miniAOD",
"ecalRecHitSumEtDR04: Barrel ",
etBin,
etMin, 20.);
150 iBooker.
book1D(histname +
"Endcap_miniAOD",
"ecalRecHitSumEtDR04: Endcap ",
etBin,
etMin, 20.);
151 histname =
"hcalTowerSumEtConeDR04";
153 iBooker.
book1D(histname +
"All_miniAOD",
"hcalTowerSumEtConeDR04: All Ecal",
etBin,
etMin, 20.);
155 iBooker.
book1D(histname +
"Barrel_miniAOD",
"hcalTowerSumEtConeDR04: Barrel ",
etBin,
etMin, 20.);
157 iBooker.
book1D(histname +
"Endcap_miniAOD",
"hcalTowerSumEtConeDR04: Endcap ",
etBin,
etMin, 20.);
159 histname =
"hcalTowerBcSumEtConeDR04";
161 iBooker.
book1D(histname +
"All_miniAOD",
"hcalTowerBcSumEtConeDR04: All Ecal",
etBin,
etMin, 20.);
163 iBooker.
book1D(histname +
"Barrel_miniAOD",
"hcalTowerBcSumEtConeDR04: Barrel ",
etBin,
etMin, 20.);
165 iBooker.
book1D(histname +
"Endcap_miniAOD",
"hcalTowerBcSumEtConeDR04: Endcap ",
etBin,
etMin, 20.);
166 histname =
"isoTrkSolidConeDR04";
168 iBooker.
book1D(histname +
"All_miniAOD",
"isoTrkSolidConeDR04: All Ecal",
etBin,
etMin,
etMax * 0.1);
170 iBooker.
book1D(histname +
"Barrel_miniAOD",
"isoTrkSolidConeDR04: Barrel ",
etBin,
etMin,
etMax * 0.1);
172 iBooker.
book1D(histname +
"Endcap_miniAOD",
"isoTrkSolidConeDR04: Endcap ",
etBin,
etMin,
etMax * 0.1);
173 histname =
"nTrkSolidConeDR04";
179 histname =
"chargedHadIso";
183 histname =
"neutralHadIso";
187 histname =
"photonIso";
200 const auto &
photons = *photonsHandle;
207 if (!(mcIter->pdgId() == 22))
209 if (mcIter->mother() !=
nullptr && !(mcIter->mother()->pdgId() == 25))
211 if (fabs(mcIter->eta()) > 2.5)
216 float mcPhi = mcIter->phi();
217 float mcEta = mcIter->eta();
219 float mcEnergy = mcIter->energy();
221 double dR = 9999999.;
222 float minDr = 10000.;
225 for (
size_t ipho = 0; ipho <
photons.size(); ipho++) {
228 double dphi = pho->
phi() - mcPhi;
230 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
232 double deta = pho->
superCluster()->position().eta() - mcEta;
235 if (
dR < 0.1 &&
dR < minDr) {
248 bool phoIsInBarrel =
false;
249 bool phoIsInEndcap =
false;
251 float phoEta = matchingPho->
superCluster()->position().eta();
252 if (fabs(phoEta) < 1.479) {
253 phoIsInBarrel =
true;
255 phoIsInEndcap =
true;
258 float photonE = matchingPho->
energy();
260 float photonEt = matchingPho->
energy() / cosh(matchingPho->
eta());
263 float r9 = matchingPho->
r9();
265 float r1 = matchingPho->
r1x5();
266 float r2 = matchingPho->
r2x5();
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
edm::EDGetTokenT< reco::GenParticleCollection > genpartToken_
float neutralHadronIso() const
T getParameter(std::string const &) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
virtual void setCurrentFolder(std::string const &fullpath)
float ecalRecHitSumEtConeDR04() const
MonitorElement * h_full5x5_sigmaIetaIeta_[3][3]
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * h_r1_[3][3]
MonitorElement * h_full5x5_r9_[3][3]
edm::ParameterSet parameters_
MonitorElement * h_phoSigmaEoE_[3][3]
float chargedHadronIso() const
MonitorElement * h_nHadIso_[3]
MonitorElement * h_ecalRecHitSumEtConeDR04_[3][3]
P4type getCandidateP4type() const
eBin
CAREFULL for the time being only Loos exists 1 => Tight Photon = GoodCandidate.
MonitorElement * h_sigmaIetaIeta_[3][3]
float trkSumPtSolidConeDR04() const
MonitorElement * h_chHadIso_[3]
MonitorElement * h_hcalTowerBcSumEtConeDR04_[3][3]
float hcalTowerSumEtConeDR04(int depth=0) const
MonitorElement * h_newhOverE_[3][3]
float sigmaIetaIeta() const
MonitorElement * h_isoTrkSolidConeDR04_[3][3]
MonitorElement * h_phoIso_[3]
float full5x5_sigmaIetaIeta() const
float getCorrectedEnergyError(P4type type) const
MonitorElement * h_nTrkSolidConeDR04_[3][3]
float hcalTowerSumEtBcConeDR04(int depth=0) const
~PhotonValidatorMiniAOD() override
float hadTowOverEm(int depth=0) const
MonitorElement * h_hOverE_[3][3]
MonitorElement * h_scPhi_[2]
MonitorElement * h_phoERes_[3][3]
MonitorElement * h_phoE_[2][3]
MonitorElement * h_r9_[3][3]
int nTrkSolidConeDR04() const
float hadronicOverEm(int depth=0) const
reco::SuperClusterRef superCluster() const override
override the superCluster method from CaloJet, to access the internal storage of the supercluster ...
edm::EDGetTokenT< edm::View< pat::Photon > > photonToken_
MonitorElement * h_phoEt_[2][3]
MonitorElement * h_hcalTowerSumEtConeDR04_[3][3]
MonitorElement * h_r2_[3][3]
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
double phi() const final
momentum azimuthal angle
MonitorElement * h_scEta_[2]
PhotonValidatorMiniAOD(const edm::ParameterSet &)
int etaBin(const l1t::HGCalMulticluster *cl)
Power< A, B >::type pow(const A &a, const B &b)
double energy() const final
energy
double eta() const final
momentum pseudorapidity