37 #include "CLHEP/Units/PhysicalConstants.h"
54 rootFile_ =
new TFile(outputFile_.c_str(),
"RECREATE");
76 std::cout <<
"beginJob() -> Book the Histograms" << std::endl;
78 hConv_ntracks_ =
new TH1F(
"nConvTracks",
"Number of tracks of converted Photons ",10,0.,10);
79 hAll_nnout_Assoc_ =
new TH1F(
"All_nnout_Assoc",
"NNout for All Photons(AssociationMap)",100,0.,1.);
80 hAll_nnout_NoConv_Assoc_ =
new TH1F(
"All_nnout_NoConv_Assoc",
"NNout for Unconverted Photons(AssociationMap)",100,0.,1.);
81 hAll_nnout_NoConv_Assoc_R9_ =
new TH1F(
"All_nnout_NoConv_Assoc_R9",
"NNout for Unconverted Photons with R9>0.93 (AssociationMap)",100,0.,1.);
82 hBarrel_nnout_Assoc_ =
new TH1F(
"barrel_nnout_Assoc",
"NNout for Barrel Photons(AssociationMap)",100,0.,1.);
83 hBarrel_nnout_NoConv_Assoc_ =
new TH1F(
"barrel_nnout_NoConv_Assoc",
"NNout for Barrel Unconverted Photons(AssociationMap)",100,0.,1.);
84 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.);
85 hEndcNoPresh_nnout_Assoc_ =
new TH1F(
"endcNoPresh_nnout_Assoc",
"NNout for Endcap NoPresh Photons(AssociationMap)",100,0.,1.);
86 hEndcNoPresh_nnout_NoConv_Assoc_ =
new TH1F(
"endcNoPresh_nnout_NoConv_Assoc",
"NNout for Endcap Unconverted NoPresh Photons(AssociationMap)",100,0.,1.);
87 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.);
88 hEndcWithPresh_nnout_Assoc_ =
new TH1F(
"endcWithPresh_nnout_Assoc",
"NNout for Endcap WithPresh Photons(AssociationMap)",100,0.,1.);
89 hEndcWithPresh_nnout_NoConv_Assoc_ =
new TH1F(
"endcWithPresh_nnout_NoConv_Assoc",
"NNout for Endcap Unconverted WithPresh Photons(AssociationMap)",100,0.,1.);
90 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.);
98 std::cout <<
"endJob() -> Write the Histograms" << std::endl;
99 hConv_ntracks_->Write();
101 hAll_nnout_Assoc_->Write();
102 hAll_nnout_NoConv_Assoc_->Write();
103 hAll_nnout_NoConv_Assoc_R9_->Write();
104 hBarrel_nnout_Assoc_->Write();
105 hBarrel_nnout_NoConv_Assoc_->Write();
106 hBarrel_nnout_NoConv_Assoc_R9_->Write();
107 hEndcNoPresh_nnout_Assoc_->Write();
108 hEndcNoPresh_nnout_NoConv_Assoc_->Write();
109 hEndcNoPresh_nnout_NoConv_Assoc_R9_->Write();
110 hEndcWithPresh_nnout_Assoc_->Write();
111 hEndcWithPresh_nnout_NoConv_Assoc_->Write();
112 hEndcWithPresh_nnout_NoConv_Assoc_R9_->Write();
120 std::cout <<
" -------------- NEW EVENT : Run, Event = " << iEvent.
id() << std::endl;
123 iEvent.
getByLabel(photonCollectionProducer_, photonCollection_ , PhotonHandle);
126 std::cout <<
"----> Photons size: "<< photons.size()<<std::endl;
129 iEvent.
getByLabel(
"piZeroDiscriminators",
"PhotonPi0DiscriminatorAssociationMap", map);
134 for( reco::PhotonCollection::const_iterator iPho = photons.begin(); iPho != photons.end(); iPho++) {
138 float Photon_et = localPho.
et();
float Photon_eta = localPho.
eta();
139 float Photon_phi = localPho.
phi();
float Photon_r9 = localPho.
r9();
142 std::cout <<
"Photon Id = " << iPho - photons.begin()
143 <<
" with Et = " << Photon_et
144 <<
" Eta = " << Photon_eta
145 <<
" Phi = " << Photon_phi
146 <<
" R9 = " << Photon_r9
147 <<
" 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);
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);
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);
193 hEndcWithPresh_nnout_NoConv_Assoc_R9_->Fill(nn);
194 hAll_nnout_NoConv_Assoc_R9_->Fill(nn);
T getParameter(std::string const &) const
virtual double et() const GCC11_FINAL
transverse energy
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
virtual ~SimplePi0DiscAnalyzer()
SimplePi0DiscAnalyzer(const edm::ParameterSet &conf)
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
bool hasConversionTracks() const
Bool flagging photons with a vector of refereces to conversions with size >0.
DEFINE_FWK_MODULE(CosmicTrackingParticleSelector)
std::vector< Photon > PhotonCollection
collectin of Photon objects
T const * product() const
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)