49 outputFile_ = ps.
getParameter<std::string>(
"outputFile");
53 minPhotonAbsEta_ = ps.
getParameter<
double>(
"minPhotonAbsEta");
54 maxPhotonAbsEta_ = ps.
getParameter<
double>(
"maxPhotonAbsEta");
56 maxPhotonHoverE_ = ps.
getParameter<
double>(
"maxPhotonHoverE");
60 createPhotonTTree_ = ps.
getParameter<
bool>(
"createPhotonTTree");
63 rootFile_ = TFile::Open(outputFile_.c_str(),
"RECREATE");
91 h_isoEcalRecHit_ =
new TH1F(
"photonEcalIso",
"Ecal Rec Hit Isolation", 100, 0, 100);
92 h_isoHcalRecHit_ =
new TH1F(
"photonHcalIso",
"Hcal Rec Hit Isolation", 100, 0, 100);
93 h_trk_pt_solid_ =
new TH1F(
"photonTrackSolidIso",
"Sum of track pT in a cone of #DeltaR" , 100, 0, 100);
94 h_trk_pt_hollow_ =
new TH1F(
"photonTrackHollowIso",
"Sum of track pT in a hollow cone" , 100, 0, 100);
95 h_ntrk_solid_ =
new TH1F(
"photonTrackCountSolid",
"Number of tracks in a cone of #DeltaR", 100, 0, 100);
96 h_ntrk_hollow_ =
new TH1F(
"photonTrackCountHollow",
"Number of tracks in a hollow cone", 100, 0, 100);
97 h_ebgap_ =
new TH1F(
"photonInEBgap",
"Ecal Barrel gap flag", 2, -0.5, 1.5);
98 h_eeGap_ =
new TH1F(
"photonInEEgap",
"Ecal Endcap gap flag", 2, -0.5, 1.5);
99 h_ebeeGap_ =
new TH1F(
"photonInEEgap",
"Ecal Barrel/Endcap gap flag", 2, -0.5, 1.5);
100 h_r9_ =
new TH1F(
"photonR9",
"R9 = E(3x3) / E(SuperCluster)", 300, 0, 3);
103 h_photonEt_ =
new TH1F(
"photonEt",
"Photon E_{T}", 200, 0, 200);
104 h_photonEta_ =
new TH1F(
"photonEta",
"Photon #eta", 200, -4, 4);
105 h_photonPhi_ =
new TH1F(
"photonPhi",
"Photon #phi", 200, -1.*
TMath::Pi(),
TMath::Pi());
106 h_hadoverem_ =
new TH1F(
"photonHoverE",
"Hadronic over EM", 200, 0, 1);
109 h_photonScEt_ =
new TH1F(
"photonScEt",
"Photon SuperCluster E_{T}", 200, 0, 200);
110 h_photonScEta_ =
new TH1F(
"photonScEta",
"Photon #eta", 200, -4, 4);
111 h_photonScPhi_ =
new TH1F(
"photonScPhi",
"Photon #phi", 200, -1.*
TMath::Pi(),
TMath::Pi());
112 h_photonScEtaWidth_ =
new TH1F(
"photonScEtaWidth",
"#eta-width", 100, 0, .1);
115 h_photonInAnyGap_ =
new TH1F(
"photonInAnyGap",
"Photon in any gap flag", 2, -0.5, 1.5);
116 h_nPassingPho_ =
new TH1F(
"photonPassingCount",
"Total number photons (0=NotPassing, 1=Passing)", 2, -0.5, 1.5);
117 h_nPho_ =
new TH1F(
"photonCount",
"Number of photons passing cuts in event", 10, 0, 10);
120 if ( createPhotonTTree_ ) {
121 tree_PhotonAll_ =
new TTree(
"TreePhotonAll",
"Reconstructed Photon");
122 tree_PhotonAll_->Branch(
"recPhoton", &recPhoton.isolationEcalRecHit,
"isolationEcalRecHit/F:isolationHcalRecHit:isolationSolidTrkCone:isolationHollowTrkCone:nTrkSolidCone:nTrkHollowCone:isEBGap:isEEGap:isEBEEGap:r9:et:eta:phi:hadronicOverEm:ecalIso:hcalIso:trackIso");
138 evt.
getByLabel(
"selectedLayer1Photons", photonHandle);
141 int photonCounter = 0;
148 float photonEt = currentPhoton.
et();
149 float superClusterEt = (currentPhoton.
superCluster()->energy())/(cosh(currentPhoton.
superCluster()->position().eta()));
152 bool passCuts = ( photonEt > minPhotonEt_ ) &&
153 ( fabs(currentPhoton.
eta()) > minPhotonAbsEta_ ) &&
154 ( fabs(currentPhoton.
eta()) < maxPhotonAbsEta_ ) &&
155 ( currentPhoton.
r9() > minPhotonR9_ ) &&
173 h_r9_->
Fill(currentPhoton.
r9());
176 h_photonEt_->
Fill(photonEt);
177 h_photonEta_->
Fill(currentPhoton.
eta());
178 h_photonPhi_->
Fill(currentPhoton.
phi());
184 h_photonScEt_->
Fill(superClusterEt);
187 h_photonScEtaWidth_->Fill(currentPhoton.
superCluster()->etaWidth());
190 h_nPassingPho_->Fill(1.0);
195 if ( createPhotonTTree_ ) {
202 recPhoton.isEBGap = currentPhoton.
isEBGap();
203 recPhoton.isEEGap = currentPhoton.
isEEGap();
204 recPhoton.isEBEEGap = currentPhoton.
isEBEEGap();
205 recPhoton.r9 = currentPhoton.
r9();
206 recPhoton.et = currentPhoton.
et();
207 recPhoton.eta = currentPhoton.
eta();
208 recPhoton.phi = currentPhoton.
phi();
210 recPhoton.ecalIso = currentPhoton.
ecalIso();
211 recPhoton.hcalIso = currentPhoton.
hcalIso();
212 recPhoton.trackIso = currentPhoton.
trackIso();
216 tree_PhotonAll_->Fill();
223 h_photonInAnyGap_->Fill(1.0);
225 h_photonInAnyGap_->Fill(0.0);
233 h_nPassingPho_->Fill(0.0);
237 h_nPho_->Fill(photonCounter);
252 h_isoEcalRecHit_->Write();
253 h_isoHcalRecHit_->Write();
254 h_trk_pt_solid_-> Write();
255 h_trk_pt_hollow_->Write();
256 h_ntrk_solid_-> Write();
257 h_ntrk_hollow_-> Write();
260 h_ebeeGap_-> Write();
264 h_photonEt_-> Write();
265 h_photonEta_-> Write();
266 h_photonPhi_-> Write();
267 h_hadoverem_-> Write();
270 h_photonScEt_-> Write();
271 h_photonScEta_-> Write();
272 h_photonScPhi_-> Write();
273 h_photonScEtaWidth_->Write();
276 h_photonInAnyGap_->Write();
277 h_nPassingPho_-> Write();
T getParameter(std::string const &) const
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
Analysis-level Photon class.
virtual void analyze(const edm::Event &, const edm::EventSetup &)
virtual double et() const
transverse energy
bool isEBGap() const
true if photon is in EB, and inside the boundaries in super crystals/modules
PatPhotonSimpleAnalyzer(const edm::ParameterSet &)
float trkSumPtSolidConeDR04() const
bool isEBEEGap() const
true if photon is in boundary between EB and EE
float ecalRecHitSumEtConeDR04() const
virtual double eta() const
momentum pseudorapidity
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int nTrkHollowConeDR04() const
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool isEEGap() const
true if photon is in EE, and inside the boundaries in supercrystal/D
~PatPhotonSimpleAnalyzer()
reco::SuperClusterRef superCluster() const
override the superCluster method from CaloJet, to access the internal storage of the supercluster ...
int nTrkSolidConeDR04() const
float trkSumPtHollowConeDR04() const
virtual double phi() const
momentum azimuthal angle