131 minPhotonAbsEta_ = ps.
getParameter<
double>(
"minPhotonAbsEta");
132 maxPhotonAbsEta_ = ps.
getParameter<
double>(
"maxPhotonAbsEta");
134 maxPhotonHoverE_ = ps.
getParameter<
double>(
"maxPhotonHoverE");
138 createPhotonTTree_ = ps.
getParameter<
bool>(
"createPhotonTTree");
141 rootFile_ = TFile::Open(outputFile_.c_str(),
"RECREATE");
163 h_isoEcalRecHit_ =
new TH1F(
"photonEcalIso",
"Ecal Rec Hit Isolation", 100, 0, 100);
164 h_isoHcalRecHit_ =
new TH1F(
"photonHcalIso",
"Hcal Rec Hit Isolation", 100, 0, 100);
165 h_trk_pt_solid_ =
new TH1F(
"photonTrackSolidIso",
"Sum of track pT in a cone of #DeltaR", 100, 0, 100);
166 h_trk_pt_hollow_ =
new TH1F(
"photonTrackHollowIso",
"Sum of track pT in a hollow cone", 100, 0, 100);
167 h_ntrk_solid_ =
new TH1F(
"photonTrackCountSolid",
"Number of tracks in a cone of #DeltaR", 100, 0, 100);
168 h_ntrk_hollow_ =
new TH1F(
"photonTrackCountHollow",
"Number of tracks in a hollow cone", 100, 0, 100);
169 h_ebgap_ =
new TH1F(
"photonInEBgap",
"Ecal Barrel gap flag", 2, -0.5, 1.5);
170 h_eeGap_ =
new TH1F(
"photonInEEgap",
"Ecal Endcap gap flag", 2, -0.5, 1.5);
171 h_ebeeGap_ =
new TH1F(
"photonInEEgap",
"Ecal Barrel/Endcap gap flag", 2, -0.5, 1.5);
172 h_r9_ =
new TH1F(
"photonR9",
"R9 = E(3x3) / E(SuperCluster)", 300, 0, 3);
175 h_photonEt_ =
new TH1F(
"photonEt",
"Photon E_{T}", 200, 0, 200);
176 h_photonEta_ =
new TH1F(
"photonEta",
"Photon #eta", 200, -4, 4);
177 h_photonPhi_ =
new TH1F(
"photonPhi",
"Photon #phi", 200, -1. *
TMath::Pi(),
TMath::Pi());
178 h_hadoverem_ =
new TH1F(
"photonHoverE",
"Hadronic over EM", 200, 0, 1);
181 h_photonScEt_ =
new TH1F(
"photonScEt",
"Photon SuperCluster E_{T}", 200, 0, 200);
182 h_photonScEta_ =
new TH1F(
"photonScEta",
"Photon #eta", 200, -4, 4);
183 h_photonScPhi_ =
new TH1F(
"photonScPhi",
"Photon #phi", 200, -1. *
TMath::Pi(),
TMath::Pi());
184 h_photonScEtaWidth_ =
new TH1F(
"photonScEtaWidth",
"#eta-width", 100, 0, .1);
187 h_photonInAnyGap_ =
new TH1F(
"photonInAnyGap",
"Photon in any gap flag", 2, -0.5, 1.5);
188 h_nPassingPho_ =
new TH1F(
"photonPassingCount",
"Total number photons (0=NotPassing, 1=Passing)", 2, -0.5, 1.5);
189 h_nPho_ =
new TH1F(
"photonCount",
"Number of photons passing cuts in event", 10, 0, 10);
192 if (createPhotonTTree_) {
193 tree_PhotonAll_ =
new TTree(
"TreePhotonAll",
"Reconstructed Photon");
194 tree_PhotonAll_->Branch(
196 &recPhoton.isolationEcalRecHit,
197 "isolationEcalRecHit/"
198 "F:isolationHcalRecHit:isolationSolidTrkCone:isolationHollowTrkCone:nTrkSolidCone:nTrkHollowCone:isEBGap:"
199 "isEEGap:isEBEEGap:r9:et:eta:phi:hadronicOverEm:ecalIso:hcalIso:trackIso");
212 evt.
getByLabel(
"selectedLayer1Photons", photonHandle);
215 int photonCounter = 0;
220 float photonEt = currentPhoton.
et();
221 float superClusterEt =
225 bool passCuts = (photonEt > minPhotonEt_) && (fabs(currentPhoton.
eta()) > minPhotonAbsEta_) &&
226 (fabs(currentPhoton.
eta()) < maxPhotonAbsEta_) && (currentPhoton.
r9() > minPhotonR9_) &&
240 h_ebgap_->Fill(currentPhoton.
isEBGap());
241 h_eeGap_->Fill(currentPhoton.
isEEGap());
242 h_ebeeGap_->Fill(currentPhoton.
isEBEEGap());
243 h_r9_->Fill(currentPhoton.
r9());
246 h_photonEt_->Fill(photonEt);
247 h_photonEta_->Fill(currentPhoton.
eta());
248 h_photonPhi_->Fill(currentPhoton.
phi());
254 h_photonScEt_->Fill(superClusterEt);
255 h_photonScEta_->Fill(currentPhoton.
superCluster()->position().eta());
256 h_photonScPhi_->Fill(currentPhoton.
superCluster()->position().phi());
257 h_photonScEtaWidth_->Fill(currentPhoton.
superCluster()->etaWidth());
260 h_nPassingPho_->Fill(1.0);
265 if (createPhotonTTree_) {
272 recPhoton.isEBGap = currentPhoton.
isEBGap();
273 recPhoton.isEEGap = currentPhoton.
isEEGap();
274 recPhoton.isEBEEGap = currentPhoton.
isEBEEGap();
275 recPhoton.r9 = currentPhoton.
r9();
276 recPhoton.et = currentPhoton.
et();
277 recPhoton.eta = currentPhoton.
eta();
278 recPhoton.phi = currentPhoton.
phi();
280 recPhoton.ecalIso = currentPhoton.
ecalIso();
281 recPhoton.hcalIso = currentPhoton.
hcalIso();
282 recPhoton.trackIso = currentPhoton.
trackIso();
286 tree_PhotonAll_->Fill();
291 bool inAnyGap = currentPhoton.
isEBEEGap() || (currentPhoton.
isEB() && currentPhoton.
isEBGap()) ||
294 h_photonInAnyGap_->Fill(1.0);
296 h_photonInAnyGap_->Fill(0.0);
302 h_nPassingPho_->Fill(0.0);
306 h_nPho_->Fill(photonCounter);
317 h_isoEcalRecHit_->Write();
318 h_isoHcalRecHit_->Write();
319 h_trk_pt_solid_->Write();
320 h_trk_pt_hollow_->Write();
321 h_ntrk_solid_->Write();
322 h_ntrk_hollow_->Write();
329 h_photonEt_->Write();
330 h_photonEta_->Write();
331 h_photonPhi_->Write();
332 h_hadoverem_->Write();
335 h_photonScEt_->Write();
336 h_photonScEta_->Write();
337 h_photonScPhi_->Write();
338 h_photonScEtaWidth_->Write();
341 h_photonInAnyGap_->Write();
342 h_nPassingPho_->Write();