33 #include "CLHEP/Units/PhysicalConstants.h"
86 rootFile_ =
new TFile(outputFile_.c_str(),
"RECREATE");
101 std::cout <<
"beginJob() -> Book the Histograms" << std::endl;
103 hConv_ntracks_ =
new TH1F(
"nConvTracks",
"Number of tracks of converted Photons ", 10, 0., 10);
104 hAll_nnout_Assoc_ =
new TH1F(
"All_nnout_Assoc",
"NNout for All Photons(AssociationMap)", 100, 0., 1.);
105 hAll_nnout_NoConv_Assoc_ =
106 new TH1F(
"All_nnout_NoConv_Assoc",
"NNout for Unconverted Photons(AssociationMap)", 100, 0., 1.);
107 hAll_nnout_NoConv_Assoc_R9_ =
108 new TH1F(
"All_nnout_NoConv_Assoc_R9",
"NNout for Unconverted Photons with R9>0.93 (AssociationMap)", 100, 0., 1.);
109 hBarrel_nnout_Assoc_ =
new TH1F(
"barrel_nnout_Assoc",
"NNout for Barrel Photons(AssociationMap)", 100, 0., 1.);
110 hBarrel_nnout_NoConv_Assoc_ =
111 new TH1F(
"barrel_nnout_NoConv_Assoc",
"NNout for Barrel Unconverted Photons(AssociationMap)", 100, 0., 1.);
112 hBarrel_nnout_NoConv_Assoc_R9_ =
new TH1F(
113 "barrel_nnout_NoConv_Assoc_R9",
"NNout for Barrel Unconverted Photons with R9>0.93 (AssociationMap)", 100, 0., 1.);
114 hEndcNoPresh_nnout_Assoc_ =
115 new TH1F(
"endcNoPresh_nnout_Assoc",
"NNout for Endcap NoPresh Photons(AssociationMap)", 100, 0., 1.);
116 hEndcNoPresh_nnout_NoConv_Assoc_ =
new TH1F(
117 "endcNoPresh_nnout_NoConv_Assoc",
"NNout for Endcap Unconverted NoPresh Photons(AssociationMap)", 100, 0., 1.);
118 hEndcNoPresh_nnout_NoConv_Assoc_R9_ =
119 new TH1F(
"endcNoPresh_nnout_NoConv_Assoc_R9",
120 "NNout for Endcap Unconverted NoPresh Photons with R9>0.93 (AssociationMap)",
124 hEndcWithPresh_nnout_Assoc_ =
125 new TH1F(
"endcWithPresh_nnout_Assoc",
"NNout for Endcap WithPresh Photons(AssociationMap)", 100, 0., 1.);
126 hEndcWithPresh_nnout_NoConv_Assoc_ =
new TH1F(
127 "endcWithPresh_nnout_NoConv_Assoc",
"NNout for Endcap Unconverted WithPresh Photons(AssociationMap)", 100, 0., 1.);
128 hEndcWithPresh_nnout_NoConv_Assoc_R9_ =
129 new TH1F(
"endcWithPresh_nnout_NoConv_Assoc_R9",
130 "NNout for Endcap Unconverted WithPresh Photons with R9>0.93 (AssociationMap)",
138 std::cout <<
"endJob() -> Write the Histograms" << std::endl;
139 hConv_ntracks_->Write();
141 hAll_nnout_Assoc_->Write();
142 hAll_nnout_NoConv_Assoc_->Write();
143 hAll_nnout_NoConv_Assoc_R9_->Write();
144 hBarrel_nnout_Assoc_->Write();
145 hBarrel_nnout_NoConv_Assoc_->Write();
146 hBarrel_nnout_NoConv_Assoc_R9_->Write();
147 hEndcNoPresh_nnout_Assoc_->Write();
148 hEndcNoPresh_nnout_NoConv_Assoc_->Write();
149 hEndcNoPresh_nnout_NoConv_Assoc_R9_->Write();
150 hEndcWithPresh_nnout_Assoc_->Write();
151 hEndcWithPresh_nnout_NoConv_Assoc_->Write();
152 hEndcWithPresh_nnout_NoConv_Assoc_R9_->Write();
157 std::cout <<
" -------------- NEW EVENT : Run, Event = " << iEvent.
id() << std::endl;
160 iEvent.
getByLabel(photonCollectionProducer_, photonCollection_, PhotonHandle);
163 std::cout <<
"----> Photons size: " << photons.size() << std::endl;
166 iEvent.
getByLabel(
"piZeroDiscriminators",
"PhotonPi0DiscriminatorAssociationMap", map);
171 for (reco::PhotonCollection::const_iterator iPho = photons.begin(); iPho != photons.end();
176 float Photon_et = localPho.
et();
177 float Photon_eta = localPho.
eta();
178 float Photon_phi = localPho.
phi();
179 float Photon_r9 = localPho.
r9();
182 std::cout <<
"Photon Id = " << iPho - photons.begin() <<
" with Et = " << Photon_et <<
" Eta = " << Photon_eta
183 <<
" Phi = " << Photon_phi <<
" R9 = " << Photon_r9 <<
" and conv_id = " << isPhotConv << std::endl;
192 if (mapIter != map->end()) {
195 if (fabs(it_super->eta()) <= 1.442) {
196 hBarrel_nnout_Assoc_->Fill(nn);
197 hAll_nnout_Assoc_->Fill(nn);
198 std::cout <<
"AssociationMap Barrel NN = " << nn << std::endl;
200 hBarrel_nnout_NoConv_Assoc_->Fill(nn);
201 hAll_nnout_NoConv_Assoc_->Fill(nn);
203 if (Photon_r9 > 0.93) {
204 hBarrel_nnout_NoConv_Assoc_R9_->Fill(nn);
205 hAll_nnout_NoConv_Assoc_R9_->Fill(nn);
207 }
else if ((fabs(it_super->eta()) >= 1.556 && fabs(it_super->eta()) < 1.65) || fabs(it_super->eta()) > 2.5) {
208 hEndcNoPresh_nnout_Assoc_->Fill(nn);
209 hAll_nnout_Assoc_->Fill(nn);
210 std::cout <<
"AssociationMap EndcNoPresh NN = " << nn << std::endl;
212 hEndcNoPresh_nnout_NoConv_Assoc_->Fill(nn);
213 hAll_nnout_NoConv_Assoc_->Fill(nn);
215 if (Photon_r9 > 0.93) {
216 hEndcNoPresh_nnout_NoConv_Assoc_R9_->Fill(nn);
217 hAll_nnout_NoConv_Assoc_R9_->Fill(nn);
219 }
else if (fabs(it_super->eta()) >= 1.65 && fabs(it_super->eta()) <= 2.5) {
220 hEndcWithPresh_nnout_Assoc_->Fill(nn);
221 hAll_nnout_Assoc_->Fill(nn);
222 std::cout <<
"AssociationMap EndcWithPresh NN = " << nn << std::endl;
224 hEndcWithPresh_nnout_NoConv_Assoc_->Fill(nn);
225 hAll_nnout_NoConv_Assoc_->Fill(nn);
227 if (Photon_r9 > 0.93) {
228 hEndcWithPresh_nnout_NoConv_Assoc_R9_->Fill(nn);
229 hAll_nnout_NoConv_Assoc_R9_->Fill(nn);
std::string photonCollection_
TH1F * hEndcNoPresh_nnout_NoConv_Assoc_
const edm::EventSetup & c
TH1F * hBarrel_nnout_NoConv_Assoc_
#define DEFINE_FWK_MODULE(type)
TH1F * hEndcNoPresh_nnout_NoConv_Assoc_R9_
TH1F * hAll_nnout_NoConv_Assoc_R9_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
SimplePi0DiscAnalyzer(const edm::ParameterSet &conf)
std::string photonCollectionProducer_
TH1F * hEndcWithPresh_nnout_NoConv_Assoc_R9_
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
TH1F * hEndcWithPresh_nnout_NoConv_Assoc_
TH1F * hBarrel_nnout_NoConv_Assoc_R9_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool hasConversionTracks() const
Bool flagging photons with a vector of refereces to conversions with size >0.
T const * product() const
std::vector< Photon > PhotonCollection
collectin of Photon objects
TH1F * hBarrel_nnout_Assoc_
T getParameter(std::string const &) const
TH1F * hEndcNoPresh_nnout_Assoc_
TH1F * hEndcWithPresh_nnout_Assoc_
double et() const final
transverse energy
~SimplePi0DiscAnalyzer() override
double phi() const final
momentum azimuthal angle
TH1F * hAll_nnout_NoConv_Assoc_
double eta() const final
momentum pseudorapidity