52 minPhotonAbsEta_ = ps.
getParameter<
double>(
"minPhotonAbsEta");
53 maxPhotonAbsEta_ = ps.
getParameter<
double>(
"maxPhotonAbsEta");
55 maxPhotonHoverE_ = ps.
getParameter<
double>(
"maxPhotonHoverE");
59 createPhotonTTree_ = ps.
getParameter<
bool>(
"createPhotonTTree");
62 rootFile_ = TFile::Open(outputFile_.c_str(),
"RECREATE");
84 h_isoEcalRecHit_ =
new TH1F(
"photonEcalIso",
"Ecal Rec Hit Isolation", 100, 0, 100);
85 h_isoHcalRecHit_ =
new TH1F(
"photonHcalIso",
"Hcal Rec Hit Isolation", 100, 0, 100);
86 h_trk_pt_solid_ =
new TH1F(
"photonTrackSolidIso",
"Sum of track pT in a cone of #DeltaR", 100, 0, 100);
87 h_trk_pt_hollow_ =
new TH1F(
"photonTrackHollowIso",
"Sum of track pT in a hollow cone", 100, 0, 100);
88 h_ntrk_solid_ =
new TH1F(
"photonTrackCountSolid",
"Number of tracks in a cone of #DeltaR", 100, 0, 100);
89 h_ntrk_hollow_ =
new TH1F(
"photonTrackCountHollow",
"Number of tracks in a hollow cone", 100, 0, 100);
90 h_ebgap_ =
new TH1F(
"photonInEBgap",
"Ecal Barrel gap flag", 2, -0.5, 1.5);
91 h_eeGap_ =
new TH1F(
"photonInEEgap",
"Ecal Endcap gap flag", 2, -0.5, 1.5);
92 h_ebeeGap_ =
new TH1F(
"photonInEEgap",
"Ecal Barrel/Endcap gap flag", 2, -0.5, 1.5);
93 h_r9_ =
new TH1F(
"photonR9",
"R9 = E(3x3) / E(SuperCluster)", 300, 0, 3);
96 h_photonEt_ =
new TH1F(
"photonEt",
"Photon E_{T}", 200, 0, 200);
97 h_photonEta_ =
new TH1F(
"photonEta",
"Photon #eta", 200, -4, 4);
98 h_photonPhi_ =
new TH1F(
"photonPhi",
"Photon #phi", 200, -1. *
TMath::Pi(),
TMath::Pi());
99 h_hadoverem_ =
new TH1F(
"photonHoverE",
"Hadronic over EM", 200, 0, 1);
102 h_photonScEt_ =
new TH1F(
"photonScEt",
"Photon SuperCluster E_{T}", 200, 0, 200);
103 h_photonScEta_ =
new TH1F(
"photonScEta",
"Photon #eta", 200, -4, 4);
104 h_photonScPhi_ =
new TH1F(
"photonScPhi",
"Photon #phi", 200, -1. *
TMath::Pi(),
TMath::Pi());
105 h_photonScEtaWidth_ =
new TH1F(
"photonScEtaWidth",
"#eta-width", 100, 0, .1);
108 h_photonInAnyGap_ =
new TH1F(
"photonInAnyGap",
"Photon in any gap flag", 2, -0.5, 1.5);
109 h_nPassingPho_ =
new TH1F(
"photonPassingCount",
"Total number photons (0=NotPassing, 1=Passing)", 2, -0.5, 1.5);
110 h_nPho_ =
new TH1F(
"photonCount",
"Number of photons passing cuts in event", 10, 0, 10);
113 if (createPhotonTTree_) {
114 tree_PhotonAll_ =
new TTree(
"TreePhotonAll",
"Reconstructed Photon");
115 tree_PhotonAll_->Branch(
117 &recPhoton.isolationEcalRecHit,
118 "isolationEcalRecHit/"
119 "F:isolationHcalRecHit:isolationSolidTrkCone:isolationHollowTrkCone:nTrkSolidCone:nTrkHollowCone:isEBGap:"
120 "isEEGap:isEBEEGap:r9:et:eta:phi:hadronicOverEm:ecalIso:hcalIso:trackIso");
133 evt.
getByLabel(
"selectedLayer1Photons", photonHandle);
136 int photonCounter = 0;
141 float photonEt = currentPhoton.
et();
142 float superClusterEt =
146 bool passCuts = (photonEt > minPhotonEt_) && (fabs(currentPhoton.
eta()) > minPhotonAbsEta_) &&
147 (fabs(currentPhoton.
eta()) < maxPhotonAbsEta_) && (currentPhoton.
r9() > minPhotonR9_) &&
161 h_ebgap_->Fill(currentPhoton.
isEBGap());
162 h_eeGap_->Fill(currentPhoton.
isEEGap());
163 h_ebeeGap_->Fill(currentPhoton.
isEBEEGap());
164 h_r9_->Fill(currentPhoton.
r9());
167 h_photonEt_->Fill(photonEt);
168 h_photonEta_->Fill(currentPhoton.
eta());
169 h_photonPhi_->Fill(currentPhoton.
phi());
175 h_photonScEt_->Fill(superClusterEt);
176 h_photonScEta_->Fill(currentPhoton.
superCluster()->position().eta());
177 h_photonScPhi_->Fill(currentPhoton.
superCluster()->position().phi());
178 h_photonScEtaWidth_->Fill(currentPhoton.
superCluster()->etaWidth());
181 h_nPassingPho_->Fill(1.0);
186 if (createPhotonTTree_) {
193 recPhoton.isEBGap = currentPhoton.
isEBGap();
194 recPhoton.isEEGap = currentPhoton.
isEEGap();
195 recPhoton.isEBEEGap = currentPhoton.
isEBEEGap();
196 recPhoton.r9 = currentPhoton.
r9();
197 recPhoton.et = currentPhoton.
et();
198 recPhoton.eta = currentPhoton.
eta();
199 recPhoton.phi = currentPhoton.
phi();
201 recPhoton.ecalIso = currentPhoton.
ecalIso();
202 recPhoton.hcalIso = currentPhoton.
hcalIso();
203 recPhoton.trackIso = currentPhoton.
trackIso();
207 tree_PhotonAll_->Fill();
212 bool inAnyGap = currentPhoton.
isEBEEGap() || (currentPhoton.
isEB() && currentPhoton.
isEBGap()) ||
215 h_photonInAnyGap_->Fill(1.0);
217 h_photonInAnyGap_->Fill(0.0);
223 h_nPassingPho_->Fill(0.0);
227 h_nPho_->Fill(photonCounter);
238 h_isoEcalRecHit_->Write();
239 h_isoHcalRecHit_->Write();
240 h_trk_pt_solid_->Write();
241 h_trk_pt_hollow_->Write();
242 h_ntrk_solid_->Write();
243 h_ntrk_hollow_->Write();
250 h_photonEt_->Write();
251 h_photonEta_->Write();
252 h_photonPhi_->Write();
253 h_hadoverem_->Write();
256 h_photonScEt_->Write();
257 h_photonScEta_->Write();
258 h_photonScPhi_->Write();
259 h_photonScEtaWidth_->Write();
262 h_photonInAnyGap_->Write();
263 h_nPassingPho_->Write();