36 #include "CLHEP/Units/PhysicalConstants.h"
51 rootFile_ =
new TFile(outputFile_.c_str(),
"RECREATE");
66 std::cout <<
"beginJob() -> Book the Histograms" << std::endl;
68 hConv_ntracks_ =
new TH1F(
"nConvTracks",
"Number of tracks of converted Photons ", 10, 0., 10);
69 hAll_nnout_Assoc_ =
new TH1F(
"All_nnout_Assoc",
"NNout for All Photons(AssociationMap)", 100, 0., 1.);
70 hAll_nnout_NoConv_Assoc_ =
71 new TH1F(
"All_nnout_NoConv_Assoc",
"NNout for Unconverted Photons(AssociationMap)", 100, 0., 1.);
72 hAll_nnout_NoConv_Assoc_R9_ =
73 new TH1F(
"All_nnout_NoConv_Assoc_R9",
"NNout for Unconverted Photons with R9>0.93 (AssociationMap)", 100, 0., 1.);
74 hBarrel_nnout_Assoc_ =
new TH1F(
"barrel_nnout_Assoc",
"NNout for Barrel Photons(AssociationMap)", 100, 0., 1.);
75 hBarrel_nnout_NoConv_Assoc_ =
76 new TH1F(
"barrel_nnout_NoConv_Assoc",
"NNout for Barrel Unconverted Photons(AssociationMap)", 100, 0., 1.);
77 hBarrel_nnout_NoConv_Assoc_R9_ =
new TH1F(
78 "barrel_nnout_NoConv_Assoc_R9",
"NNout for Barrel Unconverted Photons with R9>0.93 (AssociationMap)", 100, 0., 1.);
79 hEndcNoPresh_nnout_Assoc_ =
80 new TH1F(
"endcNoPresh_nnout_Assoc",
"NNout for Endcap NoPresh Photons(AssociationMap)", 100, 0., 1.);
81 hEndcNoPresh_nnout_NoConv_Assoc_ =
new TH1F(
82 "endcNoPresh_nnout_NoConv_Assoc",
"NNout for Endcap Unconverted NoPresh Photons(AssociationMap)", 100, 0., 1.);
83 hEndcNoPresh_nnout_NoConv_Assoc_R9_ =
84 new TH1F(
"endcNoPresh_nnout_NoConv_Assoc_R9",
85 "NNout for Endcap Unconverted NoPresh Photons with R9>0.93 (AssociationMap)",
89 hEndcWithPresh_nnout_Assoc_ =
90 new TH1F(
"endcWithPresh_nnout_Assoc",
"NNout for Endcap WithPresh Photons(AssociationMap)", 100, 0., 1.);
91 hEndcWithPresh_nnout_NoConv_Assoc_ =
new TH1F(
92 "endcWithPresh_nnout_NoConv_Assoc",
"NNout for Endcap Unconverted WithPresh Photons(AssociationMap)", 100, 0., 1.);
93 hEndcWithPresh_nnout_NoConv_Assoc_R9_ =
94 new TH1F(
"endcWithPresh_nnout_NoConv_Assoc_R9",
95 "NNout for Endcap Unconverted WithPresh Photons with R9>0.93 (AssociationMap)",
103 std::cout <<
"endJob() -> Write the Histograms" << std::endl;
104 hConv_ntracks_->Write();
106 hAll_nnout_Assoc_->Write();
107 hAll_nnout_NoConv_Assoc_->Write();
108 hAll_nnout_NoConv_Assoc_R9_->Write();
109 hBarrel_nnout_Assoc_->Write();
110 hBarrel_nnout_NoConv_Assoc_->Write();
111 hBarrel_nnout_NoConv_Assoc_R9_->Write();
112 hEndcNoPresh_nnout_Assoc_->Write();
113 hEndcNoPresh_nnout_NoConv_Assoc_->Write();
114 hEndcNoPresh_nnout_NoConv_Assoc_R9_->Write();
115 hEndcWithPresh_nnout_Assoc_->Write();
116 hEndcWithPresh_nnout_NoConv_Assoc_->Write();
117 hEndcWithPresh_nnout_NoConv_Assoc_R9_->Write();
122 std::cout <<
" -------------- NEW EVENT : Run, Event = " <<
iEvent.id() << std::endl;
125 iEvent.getByLabel(photonCollectionProducer_, photonCollection_, PhotonHandle);
131 iEvent.getByLabel(
"piZeroDiscriminators",
"PhotonPi0DiscriminatorAssociationMap",
map);
136 for (reco::PhotonCollection::const_iterator iPho =
photons.begin(); iPho !=
photons.end();
141 float Photon_et = localPho.
et();
142 float Photon_eta = localPho.
eta();
143 float Photon_phi = localPho.
phi();
144 float Photon_r9 = localPho.
r9();
147 std::cout <<
"Photon Id = " << iPho -
photons.begin() <<
" with Et = " << Photon_et <<
" Eta = " << Photon_eta
148 <<
" Phi = " << Photon_phi <<
" R9 = " << Photon_r9 <<
" and conv_id = " << isPhotConv << std::endl;
157 if (mapIter !=
map->end()) {
160 if (fabs(it_super->eta()) <= 1.442) {
161 hBarrel_nnout_Assoc_->Fill(
nn);
162 hAll_nnout_Assoc_->Fill(
nn);
163 std::cout <<
"AssociationMap Barrel NN = " <<
nn << std::endl;
165 hBarrel_nnout_NoConv_Assoc_->Fill(
nn);
166 hAll_nnout_NoConv_Assoc_->Fill(
nn);
168 if (Photon_r9 > 0.93) {
169 hBarrel_nnout_NoConv_Assoc_R9_->Fill(
nn);
170 hAll_nnout_NoConv_Assoc_R9_->Fill(
nn);
172 }
else if ((fabs(it_super->eta()) >= 1.556 && fabs(it_super->eta()) < 1.65) || fabs(it_super->eta()) > 2.5) {
173 hEndcNoPresh_nnout_Assoc_->Fill(
nn);
174 hAll_nnout_Assoc_->Fill(
nn);
175 std::cout <<
"AssociationMap EndcNoPresh NN = " <<
nn << std::endl;
177 hEndcNoPresh_nnout_NoConv_Assoc_->Fill(
nn);
178 hAll_nnout_NoConv_Assoc_->Fill(
nn);
180 if (Photon_r9 > 0.93) {
181 hEndcNoPresh_nnout_NoConv_Assoc_R9_->Fill(
nn);
182 hAll_nnout_NoConv_Assoc_R9_->Fill(
nn);
184 }
else if (fabs(it_super->eta()) >= 1.65 && fabs(it_super->eta()) <= 2.5) {
185 hEndcWithPresh_nnout_Assoc_->Fill(
nn);
186 hAll_nnout_Assoc_->Fill(
nn);
187 std::cout <<
"AssociationMap EndcWithPresh NN = " <<
nn << std::endl;
189 hEndcWithPresh_nnout_NoConv_Assoc_->Fill(
nn);
190 hAll_nnout_NoConv_Assoc_->Fill(
nn);
192 if (Photon_r9 > 0.93) {
193 hEndcWithPresh_nnout_NoConv_Assoc_R9_->Fill(
nn);
194 hAll_nnout_NoConv_Assoc_R9_->Fill(
nn);