36 #include "CLHEP/Units/PhysicalConstants.h"
53 rootFile_ =
new TFile(outputFile_.c_str(),
"RECREATE");
75 std::cout <<
"beginJob() -> Book the Histograms" << std::endl;
77 hConv_ntracks_ =
new TH1F(
"nConvTracks",
"Number of tracks of converted Photons ",10,0.,10);
78 hAll_nnout_Assoc_ =
new TH1F(
"All_nnout_Assoc",
"NNout for All Photons(AssociationMap)",100,0.,1.);
79 hAll_nnout_NoConv_Assoc_ =
new TH1F(
"All_nnout_NoConv_Assoc",
"NNout for Unconverted Photons(AssociationMap)",100,0.,1.);
80 hAll_nnout_NoConv_Assoc_R9_ =
new TH1F(
"All_nnout_NoConv_Assoc_R9",
"NNout for Unconverted Photons with R9>0.93 (AssociationMap)",100,0.,1.);
81 hBarrel_nnout_Assoc_ =
new TH1F(
"barrel_nnout_Assoc",
"NNout for Barrel Photons(AssociationMap)",100,0.,1.);
82 hBarrel_nnout_NoConv_Assoc_ =
new TH1F(
"barrel_nnout_NoConv_Assoc",
"NNout for Barrel Unconverted Photons(AssociationMap)",100,0.,1.);
83 hBarrel_nnout_NoConv_Assoc_R9_ =
new TH1F(
"barrel_nnout_NoConv_Assoc_R9",
"NNout for Barrel Unconverted Photons with R9>0.93 (AssociationMap)",100,0.,1.);
84 hEndcNoPresh_nnout_Assoc_ =
new TH1F(
"endcNoPresh_nnout_Assoc",
"NNout for Endcap NoPresh Photons(AssociationMap)",100,0.,1.);
85 hEndcNoPresh_nnout_NoConv_Assoc_ =
new TH1F(
"endcNoPresh_nnout_NoConv_Assoc",
"NNout for Endcap Unconverted NoPresh Photons(AssociationMap)",100,0.,1.);
86 hEndcNoPresh_nnout_NoConv_Assoc_R9_ =
new TH1F(
"endcNoPresh_nnout_NoConv_Assoc_R9",
"NNout for Endcap Unconverted NoPresh Photons with R9>0.93 (AssociationMap)",100,0.,1.);
87 hEndcWithPresh_nnout_Assoc_ =
new TH1F(
"endcWithPresh_nnout_Assoc",
"NNout for Endcap WithPresh Photons(AssociationMap)",100,0.,1.);
88 hEndcWithPresh_nnout_NoConv_Assoc_ =
new TH1F(
"endcWithPresh_nnout_NoConv_Assoc",
"NNout for Endcap Unconverted WithPresh Photons(AssociationMap)",100,0.,1.);
89 hEndcWithPresh_nnout_NoConv_Assoc_R9_ =
new TH1F(
"endcWithPresh_nnout_NoConv_Assoc_R9",
"NNout for Endcap Unconverted WithPresh Photons with R9>0.93 (AssociationMap)",100,0.,1.);
97 std::cout <<
"endJob() -> Write the Histograms" << std::endl;
98 hConv_ntracks_->Write();
100 hAll_nnout_Assoc_->Write();
101 hAll_nnout_NoConv_Assoc_->Write();
102 hAll_nnout_NoConv_Assoc_R9_->Write();
103 hBarrel_nnout_Assoc_->Write();
104 hBarrel_nnout_NoConv_Assoc_->Write();
105 hBarrel_nnout_NoConv_Assoc_R9_->Write();
106 hEndcNoPresh_nnout_Assoc_->Write();
107 hEndcNoPresh_nnout_NoConv_Assoc_->Write();
108 hEndcNoPresh_nnout_NoConv_Assoc_R9_->Write();
109 hEndcWithPresh_nnout_Assoc_->Write();
110 hEndcWithPresh_nnout_NoConv_Assoc_->Write();
111 hEndcWithPresh_nnout_NoConv_Assoc_R9_->Write();
119 std::cout <<
" -------------- NEW EVENT : Run, Event = " << iEvent.
id() << std::endl;
122 iEvent.
getByLabel(photonCollectionProducer_, photonCollection_ , PhotonHandle);
125 std::cout <<
"----> Photons size: "<< photons.size()<<std::endl;
128 iEvent.
getByLabel(
"piZeroDiscriminators",
"PhotonPi0DiscriminatorAssociationMap", map);
133 for( reco::PhotonCollection::const_iterator iPho = photons.begin(); iPho != photons.end(); iPho++) {
137 float Photon_et = localPho.
et();
float Photon_eta = localPho.
eta();
138 float Photon_phi = localPho.
phi();
float Photon_r9 = localPho.
r9();
141 std::cout <<
"Photon Id = " << iPho - photons.begin()
142 <<
" with Et = " << Photon_et
143 <<
" Eta = " << Photon_eta
144 <<
" Phi = " << Photon_phi
145 <<
" R9 = " << Photon_r9
146 <<
" and conv_id = " << isPhotConv << std::endl;
156 if(mapIter!=map->end()) {
159 if(fabs(it_super->eta()) <= 1.442) {
160 hBarrel_nnout_Assoc_->Fill(nn);
161 hAll_nnout_Assoc_->Fill(nn);
162 std::cout <<
"AssociationMap Barrel NN = " << nn << std::endl;
164 hBarrel_nnout_NoConv_Assoc_->Fill(nn);
165 hAll_nnout_NoConv_Assoc_->Fill(nn);
168 hBarrel_nnout_NoConv_Assoc_R9_->Fill(nn);
169 hAll_nnout_NoConv_Assoc_R9_->Fill(nn);
171 }
else if( (fabs(it_super->eta()) >= 1.556 && fabs(it_super->eta()) < 1.65) || fabs(it_super->eta()) > 2.5) {
172 hEndcNoPresh_nnout_Assoc_->Fill(nn);
173 hAll_nnout_Assoc_->Fill(nn);
174 std::cout <<
"AssociationMap EndcNoPresh NN = " << nn << std::endl;
176 hEndcNoPresh_nnout_NoConv_Assoc_->Fill(nn);
177 hAll_nnout_NoConv_Assoc_->Fill(nn);
180 hEndcNoPresh_nnout_NoConv_Assoc_R9_->Fill(nn);
181 hAll_nnout_NoConv_Assoc_R9_->Fill(nn);
183 }
else if(fabs(it_super->eta()) >= 1.65 && fabs(it_super->eta()) <= 2.5 ) {
184 hEndcWithPresh_nnout_Assoc_->Fill(nn);
185 hAll_nnout_Assoc_->Fill(nn);
186 std::cout <<
"AssociationMap EndcWithPresh NN = " << nn << std::endl;
188 hEndcWithPresh_nnout_NoConv_Assoc_->Fill(nn);
189 hAll_nnout_NoConv_Assoc_->Fill(nn);
192 hEndcWithPresh_nnout_NoConv_Assoc_R9_->Fill(nn);
193 hAll_nnout_NoConv_Assoc_R9_->Fill(nn);
T getParameter(std::string const &) const
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
friend struct const_iterator
#define DEFINE_FWK_MODULE(type)
virtual double phi() const final
momentum azimuthal angle
virtual ~SimplePi0DiscAnalyzer()
SimplePi0DiscAnalyzer(const edm::ParameterSet &conf)
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
virtual double et() const final
transverse energy
virtual double eta() const final
momentum pseudorapidity
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)