#include <SimplePi0DiscAnalyzer.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &e, const edm::EventSetup &c) |
virtual void | beginJob () |
virtual void | endJob () |
SimplePi0DiscAnalyzer (const edm::ParameterSet &conf) | |
virtual | ~SimplePi0DiscAnalyzer () |
Private Attributes | |
TH1F * | hAll_nnout_Assoc_ |
TH1F * | hAll_nnout_NoConv_Assoc_ |
TH1F * | hAll_nnout_NoConv_Assoc_R9_ |
TH1F * | hBarrel_nnout_Assoc_ |
TH1F * | hBarrel_nnout_NoConv_Assoc_ |
TH1F * | hBarrel_nnout_NoConv_Assoc_R9_ |
TH1F * | hConv_ntracks_ |
TH1F * | hEndcNoPresh_nnout_Assoc_ |
TH1F * | hEndcNoPresh_nnout_NoConv_Assoc_ |
TH1F * | hEndcNoPresh_nnout_NoConv_Assoc_R9_ |
TH1F * | hEndcWithPresh_nnout_Assoc_ |
TH1F * | hEndcWithPresh_nnout_NoConv_Assoc_ |
TH1F * | hEndcWithPresh_nnout_NoConv_Assoc_R9_ |
std::string | outputFile_ |
std::string | photonCollection_ |
std::string | photonCollectionProducer_ |
TFile * | rootFile_ |
Description: Pi0DiscAnalyzer analyzer using reco data
Implementation: <Notes on="" implementation>="">
Definition at line 44 of file SimplePi0DiscAnalyzer.h.
SimplePi0DiscAnalyzer::SimplePi0DiscAnalyzer | ( | const edm::ParameterSet & | conf | ) | [explicit] |
Definition at line 50 of file SimplePi0DiscAnalyzer.cc.
References edm::ParameterSet::getParameter().
{ outputFile_ = conf.getParameter<std::string>("outputFile"); rootFile_ = new TFile(outputFile_.c_str(),"RECREATE"); photonCollectionProducer_ = conf.getParameter<std::string>("phoProducer"); photonCollection_ = conf.getParameter<std::string>("photonCollection"); }
SimplePi0DiscAnalyzer::~SimplePi0DiscAnalyzer | ( | ) | [virtual] |
Definition at line 64 of file SimplePi0DiscAnalyzer.cc.
void SimplePi0DiscAnalyzer::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 117 of file SimplePi0DiscAnalyzer.cc.
References gather_cfg::cout, reco::LeafCandidate::et(), reco::LeafCandidate::eta(), edm::Event::getByLabel(), reco::Photon::hasConversionTracks(), edm::EventBase::id(), Association::map, reco::LeafCandidate::phi(), ExpressReco_HICollisions_FallBack::photons, edm::Handle< T >::product(), reco::Photon::r9(), and reco::Photon::superCluster().
{ std::cout << std::endl; std::cout << " -------------- NEW EVENT : Run, Event = " << iEvent.id() << std::endl; edm::Handle<reco::PhotonCollection> PhotonHandle; iEvent.getByLabel(photonCollectionProducer_, photonCollection_ , PhotonHandle); const reco::PhotonCollection photons = *(PhotonHandle.product()); std::cout <<"----> Photons size: "<< photons.size()<<std::endl; edm::Handle<reco::PhotonPi0DiscriminatorAssociationMap> map; iEvent.getByLabel("piZeroDiscriminators","PhotonPi0DiscriminatorAssociationMap", map); reco::PhotonPi0DiscriminatorAssociationMap::const_iterator mapIter; int PhoInd = 0; for( reco::PhotonCollection::const_iterator iPho = photons.begin(); iPho != photons.end(); iPho++) { // Loop over Photons reco::Photon localPho(*iPho); float Photon_et = localPho.et(); float Photon_eta = localPho.eta(); float Photon_phi = localPho.phi(); float Photon_r9 = localPho.r9(); bool isPhotConv = localPho.hasConversionTracks(); std::cout << "Photon Id = " << PhoInd << " with Et = " << Photon_et << " Eta = " << Photon_eta << " Phi = " << Photon_phi << " R9 = " << Photon_r9 << " and conv_id = " << isPhotConv << std::endl; SuperClusterRef it_super = localPho.superCluster(); // get the SC related to the Photon candidate // hConv_ntracks_->Fill(Ntrk_conv); float nn = -10; mapIter = map->find(edm::Ref<reco::PhotonCollection>(PhotonHandle,PhoInd)); if(mapIter!=map->end()) { nn = mapIter->val; } if(fabs(it_super->eta()) <= 1.442) { hBarrel_nnout_Assoc_->Fill(nn); hAll_nnout_Assoc_->Fill(nn); std::cout << "AssociationMap Barrel NN = " << nn << std::endl; if(!isPhotConv) { hBarrel_nnout_NoConv_Assoc_->Fill(nn); hAll_nnout_NoConv_Assoc_->Fill(nn); } if(Photon_r9>0.93) { hBarrel_nnout_NoConv_Assoc_R9_->Fill(nn); hAll_nnout_NoConv_Assoc_R9_->Fill(nn); } } else if( (fabs(it_super->eta()) >= 1.556 && fabs(it_super->eta()) < 1.65) || fabs(it_super->eta()) > 2.5) { hEndcNoPresh_nnout_Assoc_->Fill(nn); hAll_nnout_Assoc_->Fill(nn); std::cout << "AssociationMap EndcNoPresh NN = " << nn << std::endl; if(!isPhotConv) { hEndcNoPresh_nnout_NoConv_Assoc_->Fill(nn); hAll_nnout_NoConv_Assoc_->Fill(nn); } if(Photon_r9>0.93) { hEndcNoPresh_nnout_NoConv_Assoc_R9_->Fill(nn); hAll_nnout_NoConv_Assoc_R9_->Fill(nn); } } else if(fabs(it_super->eta()) >= 1.65 && fabs(it_super->eta()) <= 2.5 ) { hEndcWithPresh_nnout_Assoc_->Fill(nn); hAll_nnout_Assoc_->Fill(nn); std::cout << "AssociationMap EndcWithPresh NN = " << nn << std::endl; if(!isPhotConv) { hEndcWithPresh_nnout_NoConv_Assoc_->Fill(nn); hAll_nnout_NoConv_Assoc_->Fill(nn); } if(Photon_r9>0.93) { hEndcWithPresh_nnout_NoConv_Assoc_R9_->Fill(nn); hAll_nnout_NoConv_Assoc_R9_->Fill(nn); } } PhoInd++; } // End Loop over Photons }
void SimplePi0DiscAnalyzer::beginJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 73 of file SimplePi0DiscAnalyzer.cc.
References gather_cfg::cout.
{ rootFile_->cd(); std::cout << "beginJob() -> Book the Histograms" << std::endl; hConv_ntracks_ = new TH1F("nConvTracks","Number of tracks of converted Photons ",10,0.,10); hAll_nnout_Assoc_ = new TH1F("All_nnout_Assoc","NNout for All Photons(AssociationMap)",100,0.,1.); hAll_nnout_NoConv_Assoc_ = new TH1F("All_nnout_NoConv_Assoc","NNout for Unconverted Photons(AssociationMap)",100,0.,1.); hAll_nnout_NoConv_Assoc_R9_ = new TH1F("All_nnout_NoConv_Assoc_R9","NNout for Unconverted Photons with R9>0.93 (AssociationMap)",100,0.,1.); hBarrel_nnout_Assoc_ = new TH1F("barrel_nnout_Assoc","NNout for Barrel Photons(AssociationMap)",100,0.,1.); hBarrel_nnout_NoConv_Assoc_ = new TH1F("barrel_nnout_NoConv_Assoc","NNout for Barrel Unconverted Photons(AssociationMap)",100,0.,1.); 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.); hEndcNoPresh_nnout_Assoc_ = new TH1F("endcNoPresh_nnout_Assoc","NNout for Endcap NoPresh Photons(AssociationMap)",100,0.,1.); hEndcNoPresh_nnout_NoConv_Assoc_ = new TH1F("endcNoPresh_nnout_NoConv_Assoc","NNout for Endcap Unconverted NoPresh Photons(AssociationMap)",100,0.,1.); 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.); hEndcWithPresh_nnout_Assoc_ = new TH1F("endcWithPresh_nnout_Assoc","NNout for Endcap WithPresh Photons(AssociationMap)",100,0.,1.); hEndcWithPresh_nnout_NoConv_Assoc_ = new TH1F("endcWithPresh_nnout_NoConv_Assoc","NNout for Endcap Unconverted WithPresh Photons(AssociationMap)",100,0.,1.); 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.); }
void SimplePi0DiscAnalyzer::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 95 of file SimplePi0DiscAnalyzer.cc.
References gather_cfg::cout.
{ rootFile_->cd(); std::cout << "endJob() -> Write the Histograms" << std::endl; hConv_ntracks_->Write(); hAll_nnout_Assoc_->Write(); hAll_nnout_NoConv_Assoc_->Write(); hAll_nnout_NoConv_Assoc_R9_->Write(); hBarrel_nnout_Assoc_->Write(); hBarrel_nnout_NoConv_Assoc_->Write(); hBarrel_nnout_NoConv_Assoc_R9_->Write(); hEndcNoPresh_nnout_Assoc_->Write(); hEndcNoPresh_nnout_NoConv_Assoc_->Write(); hEndcNoPresh_nnout_NoConv_Assoc_R9_->Write(); hEndcWithPresh_nnout_Assoc_->Write(); hEndcWithPresh_nnout_NoConv_Assoc_->Write(); hEndcWithPresh_nnout_NoConv_Assoc_R9_->Write(); }
TH1F* SimplePi0DiscAnalyzer::hAll_nnout_Assoc_ [private] |
Definition at line 68 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hAll_nnout_NoConv_Assoc_ [private] |
Definition at line 69 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hAll_nnout_NoConv_Assoc_R9_ [private] |
Definition at line 76 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hBarrel_nnout_Assoc_ [private] |
Definition at line 70 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hBarrel_nnout_NoConv_Assoc_ [private] |
Definition at line 71 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hBarrel_nnout_NoConv_Assoc_R9_ [private] |
Definition at line 77 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hConv_ntracks_ [private] |
Definition at line 66 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hEndcNoPresh_nnout_Assoc_ [private] |
Definition at line 72 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hEndcNoPresh_nnout_NoConv_Assoc_ [private] |
Definition at line 73 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hEndcNoPresh_nnout_NoConv_Assoc_R9_ [private] |
Definition at line 78 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hEndcWithPresh_nnout_Assoc_ [private] |
Definition at line 74 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hEndcWithPresh_nnout_NoConv_Assoc_ [private] |
Definition at line 75 of file SimplePi0DiscAnalyzer.h.
TH1F* SimplePi0DiscAnalyzer::hEndcWithPresh_nnout_NoConv_Assoc_R9_ [private] |
Definition at line 79 of file SimplePi0DiscAnalyzer.h.
std::string SimplePi0DiscAnalyzer::outputFile_ [private] |
Definition at line 63 of file SimplePi0DiscAnalyzer.h.
std::string SimplePi0DiscAnalyzer::photonCollection_ [private] |
Definition at line 61 of file SimplePi0DiscAnalyzer.h.
std::string SimplePi0DiscAnalyzer::photonCollectionProducer_ [private] |
Definition at line 60 of file SimplePi0DiscAnalyzer.h.
TFile* SimplePi0DiscAnalyzer::rootFile_ [private] |
Definition at line 64 of file SimplePi0DiscAnalyzer.h.