25 #include "CLHEP/Units/GlobalPhysicalConstants.h" 34 : outputFileName_(iConfig.getParameter<
std::
string>(
"outputFileName")),
75 h_scEta_[0] = iBooker.
book1D(
"scEta_miniAOD",
" SC Eta ", etaBin, etaMin, etaMax);
76 h_scPhi_[0] = iBooker.
book1D(
"scPhi_miniAOD",
" SC Phi ", phiBin, phiMin, phiMax);
81 h_phoE_[0][0] = iBooker.
book1D(histname +
"All_miniAOD",
" Photon Energy: All ecal ", eBin, eMin, eMax);
82 h_phoE_[0][1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
" Photon Energy: barrel ", eBin, eMin, eMax);
83 h_phoE_[0][2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
" Photon Energy: Endcap ", eBin, eMin, eMax);
87 iBooker.
book1D(histname +
"All_miniAOD",
" Photon Transverse Energy: All ecal ", etBin, etMin, etMax);
89 iBooker.
book1D(histname +
"Barrel_miniAOD",
" Photon Transverse Energy: Barrel ", etBin, etMin, etMax);
91 iBooker.
book1D(histname +
"Endcap_miniAOD",
" Photon Transverse Energy: Endcap ", etBin, etMin, etMax);
95 histname +
"All_miniAOD",
" Photon E/E_{true}: All ecal; E/E_{true} (GeV)", resBin, resMin, resMax);
97 histname +
"Barrel_miniAOD",
"Photon E/E_{true}: Barrel; E/E_{true} (GeV)", resBin, resMin, resMax);
99 histname +
"Endcap_miniAOD",
" Photon E/E_{true}: Endcap; E/E_{true} (GeV)", resBin, resMin, resMax);
101 histname =
"sigmaEoE";
103 iBooker.
book1D(histname +
"All_miniAOD",
"#sigma_{E}/E: All ecal; #sigma_{E}/E", 100, 0., 0.08);
105 iBooker.
book1D(histname +
"Barrel_miniAOD",
"#sigma_{E}/E: Barrel; #sigma_{E}/E", 100, 0., 0.08);
107 iBooker.
book1D(histname +
"Endcap_miniAOD",
"#sigma_{E}/E: Endcap, #sigma_{E}/E", 100, 0., 0.08);
110 h_r9_[0][0] = iBooker.
book1D(histname +
"All_miniAOD",
" r9: All Ecal", r9Bin, r9Min, r9Max);
111 h_r9_[0][1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
" r9: Barrel ", r9Bin, r9Min, r9Max);
112 h_r9_[0][2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
" r9: Endcap ", r9Bin, r9Min, r9Max);
113 histname =
"full5x5_r9";
114 h_full5x5_r9_[0][0] = iBooker.
book1D(histname +
"All_miniAOD",
" r9: All Ecal", r9Bin, r9Min, r9Max);
115 h_full5x5_r9_[0][1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
" r9: Barrel ", r9Bin, r9Min, r9Max);
116 h_full5x5_r9_[0][2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
" r9: Endcap ", r9Bin, r9Min, r9Max);
118 h_r1_[0][0] = iBooker.
book1D(histname +
"All_miniAOD",
" e1x5/e5x5: All Ecal", r9Bin, r9Min, r9Max);
119 h_r1_[0][1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
" e1x5/e5x5: Barrel ", r9Bin, r9Min, r9Max);
120 h_r1_[0][2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
" e1x5/e5x5: Endcap ", r9Bin, r9Min, r9Max);
122 h_r2_[0][0] = iBooker.
book1D(histname +
"All_miniAOD",
" e2x5/e5x5: All Ecal", r9Bin, r9Min, r9Max);
123 h_r2_[0][1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
" e2x5/e5x5: Barrel ", r9Bin, r9Min, r9Max);
124 h_r2_[0][2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
" e2x5/e5x5: Endcap ", r9Bin, r9Min, r9Max);
126 h_hOverE_[0][0] = iBooker.
book1D(histname +
"All_miniAOD",
"H/E: All Ecal", 100, 0., 0.2);
127 h_hOverE_[0][1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
"H/E: Barrel ", 100, 0., 0.2);
128 h_hOverE_[0][2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
"H/E: Endcap ", 100, 0., 0.2);
130 histname =
"newhOverE";
131 h_newhOverE_[0][0] = iBooker.
book1D(histname +
"All_miniAOD",
"new H/E: All Ecal", 100, 0., 0.2);
132 h_newhOverE_[0][1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
"new H/E: Barrel ", 100, 0., 0.2);
133 h_newhOverE_[0][2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
"new H/E: Endcap ", 100, 0., 0.2);
135 histname =
"sigmaIetaIeta";
136 h_sigmaIetaIeta_[0][0] = iBooker.
book1D(histname +
"All_miniAOD",
"sigmaIetaIeta: All Ecal", 100, 0., 0.1);
137 h_sigmaIetaIeta_[0][1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
"sigmaIetaIeta: Barrel ", 100, 0., 0.05);
138 h_sigmaIetaIeta_[0][2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
"sigmaIetaIeta: Endcap ", 100, 0., 0.1);
139 histname =
"full5x5_sigmaIetaIeta";
141 iBooker.
book1D(histname +
"All_miniAOD",
"Full5x5 sigmaIetaIeta: All Ecal", 100, 0., 0.1);
143 iBooker.
book1D(histname +
"Barrel_miniAOD",
"Full5x5 sigmaIetaIeta: Barrel ", 100, 0., 0.05);
145 iBooker.
book1D(histname +
"Endcap_miniAOD",
"Full5x5 sigmaIetaIeta: Endcap ", 100, 0., 0.1);
147 histname =
"ecalRecHitSumEtConeDR04";
149 iBooker.
book1D(histname +
"All_miniAOD",
"ecalRecHitSumEtDR04: All Ecal", etBin, etMin, 20.);
151 iBooker.
book1D(histname +
"Barrel_miniAOD",
"ecalRecHitSumEtDR04: Barrel ", etBin, etMin, 20.);
153 iBooker.
book1D(histname +
"Endcap_miniAOD",
"ecalRecHitSumEtDR04: Endcap ", etBin, etMin, 20.);
154 histname =
"hcalTowerSumEtConeDR04";
156 iBooker.
book1D(histname +
"All_miniAOD",
"hcalTowerSumEtConeDR04: All Ecal", etBin, etMin, 20.);
158 iBooker.
book1D(histname +
"Barrel_miniAOD",
"hcalTowerSumEtConeDR04: Barrel ", etBin, etMin, 20.);
160 iBooker.
book1D(histname +
"Endcap_miniAOD",
"hcalTowerSumEtConeDR04: Endcap ", etBin, etMin, 20.);
162 histname =
"hcalTowerBcSumEtConeDR04";
164 iBooker.
book1D(histname +
"All_miniAOD",
"hcalTowerBcSumEtConeDR04: All Ecal", etBin, etMin, 20.);
166 iBooker.
book1D(histname +
"Barrel_miniAOD",
"hcalTowerBcSumEtConeDR04: Barrel ", etBin, etMin, 20.);
168 iBooker.
book1D(histname +
"Endcap_miniAOD",
"hcalTowerBcSumEtConeDR04: Endcap ", etBin, etMin, 20.);
169 histname =
"isoTrkSolidConeDR04";
171 iBooker.
book1D(histname +
"All_miniAOD",
"isoTrkSolidConeDR04: All Ecal", etBin, etMin, etMax * 0.1);
173 iBooker.
book1D(histname +
"Barrel_miniAOD",
"isoTrkSolidConeDR04: Barrel ", etBin, etMin, etMax * 0.1);
175 iBooker.
book1D(histname +
"Endcap_miniAOD",
"isoTrkSolidConeDR04: Endcap ", etBin, etMin, etMax * 0.1);
176 histname =
"nTrkSolidConeDR04";
182 histname =
"chargedHadIso";
183 h_chHadIso_[0] = iBooker.
book1D(histname +
"All_miniAOD",
"PF chargedHadIso: All Ecal", etBin, etMin, 20.);
184 h_chHadIso_[1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
"PF chargedHadIso: Barrel", etBin, etMin, 20.);
185 h_chHadIso_[2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
"PF chargedHadIso: Endcap", etBin, etMin, 20.);
186 histname =
"neutralHadIso";
187 h_nHadIso_[0] = iBooker.
book1D(histname +
"All_miniAOD",
"PF neutralHadIso: All Ecal", etBin, etMin, 20.);
188 h_nHadIso_[1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
"PF neutralHadIso: Barrel", etBin, etMin, 20.);
189 h_nHadIso_[2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
"PF neutralHadIso: Endcap", etBin, etMin, 20.);
190 histname =
"photonIso";
191 h_phoIso_[0] = iBooker.
book1D(histname +
"All_miniAOD",
"PF photonIso: All Ecal", etBin, etMin, 20.);
192 h_phoIso_[1] = iBooker.
book1D(histname +
"Barrel_miniAOD",
"PF photonIso: Barrel", etBin, etMin, 20.);
193 h_phoIso_[2] = iBooker.
book1D(histname +
"Endcap_miniAOD",
"PF photonIso: Endcap", etBin, etMin, 20.);
205 const auto &
photons = *photonsHandle;
210 for (reco::GenParticleCollection::const_iterator mcIter = genParticles->begin(); mcIter != genParticles->end();
212 if (!(mcIter->pdgId() == 22))
214 if (mcIter->mother() !=
nullptr && !(mcIter->mother()->pdgId() == 25))
216 if (fabs(mcIter->eta()) > 2.5)
221 float mcPhi = mcIter->phi();
222 float mcEta = mcIter->eta();
224 float mcEnergy = mcIter->energy();
226 double dR = 9999999.;
227 float minDr = 10000.;
230 for (
size_t ipho = 0; ipho <
photons.size(); ipho++) {
233 double dphi = pho->
phi() - mcPhi;
235 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
237 double deta = pho->
superCluster()->position().eta() - mcEta;
240 if (dR < 0.1 && dR < minDr) {
253 bool phoIsInBarrel =
false;
254 bool phoIsInEndcap =
false;
256 float phoEta = matchingPho->
superCluster()->position().eta();
257 if (fabs(phoEta) < 1.479) {
258 phoIsInBarrel =
true;
260 phoIsInEndcap =
true;
263 float photonE = matchingPho->
energy();
265 float photonEt = matchingPho->
energy() / cosh(matchingPho->
eta());
268 float r9 = matchingPho->
r9();
270 float r1 = matchingPho->
r1x5();
271 float r2 = matchingPho->
r2x5();
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::GenParticleCollection > genpartToken_
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
double eta() const final
momentum pseudorapidity
float neutralHadronIso() const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * h_full5x5_sigmaIetaIeta_[3][3]
void setCurrentFolder(std::string const &fullpath)
void analyze(const edm::Event &, const edm::EventSetup &) override
float trkSumPtSolidConeDR04() const
void dqmEndRun(edm::Run const &r, edm::EventSetup const &es) override
MonitorElement * h_r1_[3][3]
MonitorElement * h_full5x5_r9_[3][3]
float ecalRecHitSumEtConeDR04() const
edm::ParameterSet parameters_
MonitorElement * h_phoSigmaEoE_[3][3]
reco::SuperClusterRef superCluster() const override
override the superCluster method from CaloJet, to access the internal storage of the supercluster ...
MonitorElement * h_nHadIso_[3]
MonitorElement * h_ecalRecHitSumEtConeDR04_[3][3]
eBin
CAREFULL for the time being only Loos exists 1 => Tight Photon = GoodCandidate.
MonitorElement * h_sigmaIetaIeta_[3][3]
float chargedHadronIso() const
float full5x5_sigmaIetaIeta() const
MonitorElement * h_chHadIso_[3]
MonitorElement * h_hcalTowerBcSumEtConeDR04_[3][3]
MonitorElement * h_newhOverE_[3][3]
float hcalTowerSumEtBcConeDR04() const
Hcal isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
MonitorElement * h_isoTrkSolidConeDR04_[3][3]
MonitorElement * h_phoIso_[3]
float sigmaIetaIeta() const
double energy() const final
energy
MonitorElement * h_nTrkSolidConeDR04_[3][3]
float hadTowOverEm() const
the ration of hadronic energy in towers behind the BCs in the SC and the SC energy ...
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
~PhotonValidatorMiniAOD() override
float getCorrectedEnergyError(P4type type) const
MonitorElement * h_hOverE_[3][3]
MonitorElement * h_scPhi_[2]
P4type getCandidateP4type() const
MonitorElement * h_phoERes_[3][3]
MonitorElement * h_phoE_[2][3]
MonitorElement * h_r9_[3][3]
int nTrkSolidConeDR04() const
void dqmBeginRun(edm::Run const &r, edm::EventSetup const &theEventSetup) override
edm::EDGetTokenT< edm::View< pat::Photon > > photonToken_
MonitorElement * h_phoEt_[2][3]
MonitorElement * h_hcalTowerSumEtConeDR04_[3][3]
MonitorElement * h_r2_[3][3]
double phi() const final
momentum azimuthal angle
MonitorElement * h_scEta_[2]
PhotonValidatorMiniAOD(const edm::ParameterSet &)
Power< A, B >::type pow(const A &a, const B &b)