130 minPhotonAbsEta_ = ps.
getParameter<
double>(
"minPhotonAbsEta");
131 maxPhotonAbsEta_ = ps.
getParameter<
double>(
"maxPhotonAbsEta");
133 maxPhotonHoverE_ = ps.
getParameter<
double>(
"maxPhotonHoverE");
137 createPhotonTTree_ = ps.
getParameter<
bool>(
"createPhotonTTree");
140 rootFile_ = TFile::Open(outputFile_.c_str(),
"RECREATE");
162 h_isoEcalRecHit_ =
new TH1F(
"photonEcalIso",
"Ecal Rec Hit Isolation", 100, 0, 100);
163 h_isoHcalRecHit_ =
new TH1F(
"photonHcalIso",
"Hcal Rec Hit Isolation", 100, 0, 100);
164 h_trk_pt_solid_ =
new TH1F(
"photonTrackSolidIso",
"Sum of track pT in a cone of #DeltaR", 100, 0, 100);
165 h_trk_pt_hollow_ =
new TH1F(
"photonTrackHollowIso",
"Sum of track pT in a hollow cone", 100, 0, 100);
166 h_ntrk_solid_ =
new TH1F(
"photonTrackCountSolid",
"Number of tracks in a cone of #DeltaR", 100, 0, 100);
167 h_ntrk_hollow_ =
new TH1F(
"photonTrackCountHollow",
"Number of tracks in a hollow cone", 100, 0, 100);
168 h_ebgap_ =
new TH1F(
"photonInEBgap",
"Ecal Barrel gap flag", 2, -0.5, 1.5);
169 h_eeGap_ =
new TH1F(
"photonInEEgap",
"Ecal Endcap gap flag", 2, -0.5, 1.5);
170 h_ebeeGap_ =
new TH1F(
"photonInEEgap",
"Ecal Barrel/Endcap gap flag", 2, -0.5, 1.5);
171 h_r9_ =
new TH1F(
"photonR9",
"R9 = E(3x3) / E(SuperCluster)", 300, 0, 3);
174 h_photonEt_ =
new TH1F(
"photonEt",
"Photon E_{T}", 200, 0, 200);
175 h_photonEta_ =
new TH1F(
"photonEta",
"Photon #eta", 200, -4, 4);
176 h_photonPhi_ =
new TH1F(
"photonPhi",
"Photon #phi", 200, -1. *
M_PI,
M_PI);
177 h_hadoverem_ =
new TH1F(
"photonHoverE",
"Hadronic over EM", 200, 0, 1);
180 h_photonScEt_ =
new TH1F(
"photonScEt",
"Photon SuperCluster E_{T}", 200, 0, 200);
181 h_photonScEta_ =
new TH1F(
"photonScEta",
"Photon #eta", 200, -4, 4);
182 h_photonScPhi_ =
new TH1F(
"photonScPhi",
"Photon #phi", 200, -1. *
M_PI,
M_PI);
183 h_photonScEtaWidth_ =
new TH1F(
"photonScEtaWidth",
"#eta-width", 100, 0, .1);
186 h_photonInAnyGap_ =
new TH1F(
"photonInAnyGap",
"Photon in any gap flag", 2, -0.5, 1.5);
187 h_nPassingPho_ =
new TH1F(
"photonPassingCount",
"Total number photons (0=NotPassing, 1=Passing)", 2, -0.5, 1.5);
188 h_nPho_ =
new TH1F(
"photonCount",
"Number of photons passing cuts in event", 10, 0, 10);
191 if (createPhotonTTree_) {
192 tree_PhotonAll_ =
new TTree(
"TreePhotonAll",
"Reconstructed Photon");
193 tree_PhotonAll_->Branch(
195 &recPhoton.isolationEcalRecHit,
196 "isolationEcalRecHit/"
197 "F:isolationHcalRecHit:isolationSolidTrkCone:isolationHollowTrkCone:nTrkSolidCone:nTrkHollowCone:isEBGap:"
198 "isEEGap:isEBEEGap:r9:et:eta:phi:hadronicOverEm:ecalIso:hcalIso:trackIso");
211 evt.
getByLabel(
"selectedLayer1Photons", photonHandle);
214 int photonCounter = 0;
216 for (
int i = 0;
i < int(
photons.size());
i++) {
219 float photonEt = currentPhoton.
et();
220 float superClusterEt =
224 bool passCuts = (photonEt > minPhotonEt_) && (fabs(currentPhoton.
eta()) > minPhotonAbsEta_) &&
225 (fabs(currentPhoton.
eta()) < maxPhotonAbsEta_) && (currentPhoton.
r9() > minPhotonR9_) &&
239 h_ebgap_->Fill(currentPhoton.
isEBGap());
240 h_eeGap_->Fill(currentPhoton.
isEEGap());
241 h_ebeeGap_->Fill(currentPhoton.
isEBEEGap());
242 h_r9_->Fill(currentPhoton.
r9());
245 h_photonEt_->Fill(photonEt);
246 h_photonEta_->Fill(currentPhoton.
eta());
247 h_photonPhi_->Fill(currentPhoton.
phi());
253 h_photonScEt_->Fill(superClusterEt);
254 h_photonScEta_->Fill(currentPhoton.
superCluster()->position().eta());
255 h_photonScPhi_->Fill(currentPhoton.
superCluster()->position().phi());
256 h_photonScEtaWidth_->Fill(currentPhoton.
superCluster()->etaWidth());
259 h_nPassingPho_->Fill(1.0);
264 if (createPhotonTTree_) {
271 recPhoton.isEBGap = currentPhoton.
isEBGap();
272 recPhoton.isEEGap = currentPhoton.
isEEGap();
273 recPhoton.isEBEEGap = currentPhoton.
isEBEEGap();
274 recPhoton.r9 = currentPhoton.
r9();
275 recPhoton.et = currentPhoton.
et();
276 recPhoton.eta = currentPhoton.
eta();
277 recPhoton.phi = currentPhoton.
phi();
279 recPhoton.ecalIso = currentPhoton.
ecalIso();
280 recPhoton.hcalIso = currentPhoton.
hcalIso();
281 recPhoton.trackIso = currentPhoton.
trackIso();
285 tree_PhotonAll_->Fill();
290 bool inAnyGap = currentPhoton.
isEBEEGap() || (currentPhoton.
isEB() && currentPhoton.
isEBGap()) ||
293 h_photonInAnyGap_->Fill(1.0);
295 h_photonInAnyGap_->Fill(0.0);
301 h_nPassingPho_->Fill(0.0);
305 h_nPho_->Fill(photonCounter);
316 h_isoEcalRecHit_->Write();
317 h_isoHcalRecHit_->Write();
318 h_trk_pt_solid_->Write();
319 h_trk_pt_hollow_->Write();
320 h_ntrk_solid_->Write();
321 h_ntrk_hollow_->Write();
328 h_photonEt_->Write();
329 h_photonEta_->Write();
330 h_photonPhi_->Write();
331 h_hadoverem_->Write();
334 h_photonScEt_->Write();
335 h_photonScEta_->Write();
336 h_photonScPhi_->Write();
337 h_photonScEtaWidth_->Write();
340 h_photonInAnyGap_->Write();
341 h_nPassingPho_->Write();
Analysis-level Photon class.
bool isEBGap() const
true if photon is in EB, and inside the boundaries in super crystals/modules
#define DEFINE_FWK_MODULE(type)
PatPhotonSimpleAnalyzer(const edm::ParameterSet &)
float hcalTowerSumEtConeDR04(int depth=0) const
float trkSumPtSolidConeDR04() const
bool isEBEEGap() const
true if photon is in boundary between EB and EE
float ecalRecHitSumEtConeDR04() const
TH1F * h_photonScEtaWidth_
~PatPhotonSimpleAnalyzer() override
float isolationHollowTrkCone
void analyze(const edm::Event &, const edm::EventSetup &) override
int nTrkHollowConeDR04() const
float hadronicOverEm(int depth=0) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
float isolationEcalRecHit
bool isEEGap() const
true if photon is in EE, and inside the boundaries in supercrystal/D
struct_recPhoton recPhoton
T getParameter(std::string const &) const
int nTrkSolidConeDR04() const
reco::SuperClusterRef superCluster() const override
override the superCluster method from CaloJet, to access the internal storage of the supercluster ...
float trkSumPtHollowConeDR04() const
double et() const final
transverse energy
float isolationHcalRecHit
float isolationSolidTrkCone
double phi() const final
momentum azimuthal angle
double eta() const final
momentum pseudorapidity