#include <Calibration/IsolatedParticles/plugins/IsolatedParticlesGeneratedJets.cc>
Public Member Functions | |
IsolatedParticlesGeneratedJets (const edm::ParameterSet &) | |
~IsolatedParticlesGeneratedJets () | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob () |
void | BookHistograms () |
void | clearTreeVectors () |
virtual void | endJob () |
Private Attributes | |
bool | debug |
edm::Service< TFileService > | fs |
edm::InputTag | jetSrc |
edm::InputTag | partSrc |
std::vector< double > * | t_gjetE |
std::vector< double > * | t_gjetEta |
std::vector< int > * | t_gjetN |
std::vector< double > * | t_gjetPhi |
std::vector< double > * | t_gjetPt |
std::vector< std::vector < double > > * | t_jetTrkCharge |
std::vector< std::vector < double > > * | t_jetTrkEta |
std::vector< std::vector < double > > * | t_jetTrkP |
std::vector< std::vector < double > > * | t_jetTrkPdg |
std::vector< std::vector < double > > * | t_jetTrkPhi |
std::vector< std::vector < double > > * | t_jetTrkPt |
TTree * | tree |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 34 of file IsolatedParticlesGeneratedJets.h.
IsolatedParticlesGeneratedJets::IsolatedParticlesGeneratedJets | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 23 of file IsolatedParticlesGeneratedJets.cc.
References debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), jetSrc, and partSrc.
{ debug = iConfig.getUntrackedParameter<bool> ("Debug", false); jetSrc = iConfig.getParameter<edm::InputTag>("JetSource"); partSrc = iConfig.getParameter<edm::InputTag>("ParticleSource"); }
IsolatedParticlesGeneratedJets::~IsolatedParticlesGeneratedJets | ( | ) |
Definition at line 31 of file IsolatedParticlesGeneratedJets.cc.
{ }
void IsolatedParticlesGeneratedJets::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 35 of file IsolatedParticlesGeneratedJets.cc.
References abs, DeDxDiscriminatorTools::charge(), clearTreeVectors(), gather_cfg::cout, debug, reco::LeafCandidate::energy(), eta(), reco::LeafCandidate::eta(), genParticleCandidates2GenParticles_cfi::genParticles, edm::Event::getByLabel(), JetMatchingTools::getGenParticles(), jetSrc, AlCaHLTBitMon_ParallelJobs::p, partSrc, benchmark_cfg::pdgId, reco::LeafCandidate::phi(), phi, reco::LeafCandidate::pt(), t_gjetE, t_gjetEta, t_gjetN, t_gjetPhi, t_gjetPt, t_jetTrkCharge, t_jetTrkEta, t_jetTrkP, t_jetTrkPdg, t_jetTrkPhi, t_jetTrkPt, and tree.
{ //using namespace edm; clearTreeVectors(); //=== genJet information edm::Handle<reco::GenJetCollection> genJets; iEvent.getByLabel(jetSrc, genJets); //=== genJet information edm::Handle<reco::GenParticleCollection> genParticles; iEvent.getByLabel(partSrc, genParticles); JetMatchingTools jetMatching (iEvent); std::vector <std::vector <const reco::GenParticle*> > genJetConstituents (genJets->size()); int njets = 0; for (unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) { const reco::GenJet& genJet = (*genJets) [iGenJet]; double genJetE = genJet.energy(); double genJetPt = genJet.pt(); double genJetEta = genJet.eta(); double genJetPhi = genJet.phi(); if( genJetPt> 30.0 && std::abs(genJetEta)<3.0 ) { njets++; std::vector <const reco::GenParticle*> genJetConstituents = jetMatching.getGenParticles ((*genJets) [iGenJet]); std::vector<double> v_trkP, v_trkPt, v_trkEta, v_trkPhi, v_trkPdg, v_trkCharge; if(debug) std::cout<<"Jet(pt,Eta,Phi) "<<genJetPt<<" "<<genJetEta<<" "<<genJetPhi <<std::endl; for(unsigned int ic=0; ic<genJetConstituents.size(); ic++) { if(debug) { std::cout << "p,pt,eta,phi "<<genJetConstituents[ic]->p()<<" "<<genJetConstituents[ic]->pt() <<" "<<genJetConstituents[ic]->eta()<<" "<<genJetConstituents[ic]->phi() <<std::endl; } v_trkP.push_back(genJetConstituents[ic]->p()); v_trkPt.push_back(genJetConstituents[ic]->pt()); v_trkEta.push_back(genJetConstituents[ic]->eta()); v_trkPhi.push_back(genJetConstituents[ic]->phi()); v_trkPdg.push_back(genJetConstituents[ic]->pdgId()); v_trkCharge.push_back(genJetConstituents[ic]->charge()); } //loop over genjet constituents t_gjetE ->push_back(genJetE ); t_gjetPt ->push_back(genJetPt ); t_gjetEta ->push_back(genJetEta); t_gjetPhi ->push_back(genJetPhi); t_jetTrkP ->push_back(v_trkP ); t_jetTrkPt ->push_back(v_trkPt ); t_jetTrkEta ->push_back(v_trkEta); t_jetTrkPhi ->push_back(v_trkPhi); t_jetTrkPdg ->push_back(v_trkPdg); t_jetTrkCharge ->push_back(v_trkCharge); } // if jetPt>30 } //loop over genjets t_gjetN->push_back(njets); unsigned int indx = 0; for(reco::GenParticleCollection::const_iterator ig = genParticles->begin(); ig!= genParticles->end(); ++ig,++indx) { if (debug) std::cout << "Track " << indx << " Status " << ig->status() << " charge " << ig->charge() << " pdgId " << ig->pdgId() << " mass " << ig->mass() << " P " << ig->momentum() << " E " << ig->energy() << " Origin " << ig->vertex() << std::endl; } tree->Fill(); }
void IsolatedParticlesGeneratedJets::beginJob | ( | void | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 118 of file IsolatedParticlesGeneratedJets.cc.
References BookHistograms().
{ BookHistograms(); }
void IsolatedParticlesGeneratedJets::BookHistograms | ( | ) | [private] |
Definition at line 139 of file IsolatedParticlesGeneratedJets.cc.
References fs, t_gjetE, t_gjetEta, t_gjetN, t_gjetPhi, t_gjetPt, t_jetTrkCharge, t_jetTrkEta, t_jetTrkP, t_jetTrkPdg, t_jetTrkPhi, t_jetTrkPt, and tree.
Referenced by beginJob().
{ tree = fs->make<TTree>("tree", "tree"); t_gjetN = new std::vector<int> (); t_gjetE = new std::vector<double>(); t_gjetPt = new std::vector<double>(); t_gjetEta = new std::vector<double>(); t_gjetPhi = new std::vector<double>(); t_jetTrkP = new std::vector<std::vector<double> >(); t_jetTrkPt = new std::vector<std::vector<double> >(); t_jetTrkEta = new std::vector<std::vector<double> >(); t_jetTrkPhi = new std::vector<std::vector<double> >(); t_jetTrkPdg = new std::vector<std::vector<double> >(); t_jetTrkCharge = new std::vector<std::vector<double> >(); tree->Branch("t_gjetN", "vector<int>", &t_gjetN); tree->Branch("t_gjetE", "vector<double>", &t_gjetE); tree->Branch("t_gjetPt", "vector<double>", &t_gjetPt); tree->Branch("t_gjetEta", "vector<double>", &t_gjetEta); tree->Branch("t_gjetPhi", "vector<double>", &t_gjetPhi); tree->Branch("t_jetTrkP", "vector<vector<double> >", &t_jetTrkP); tree->Branch("t_jetTrkPt", "vector<vector<double> >", &t_jetTrkPt); tree->Branch("t_jetTrkEta", "vector<vector<double> >", &t_jetTrkEta); tree->Branch("t_jetTrkPhi", "vector<vector<double> >", &t_jetTrkPhi); tree->Branch("t_jetTrkPdg", "vector<vector<double> >", &t_jetTrkPdg); tree->Branch("t_jetTrkCharge", "vector<vector<double> >", &t_jetTrkCharge); }
void IsolatedParticlesGeneratedJets::clearTreeVectors | ( | ) | [private] |
Definition at line 124 of file IsolatedParticlesGeneratedJets.cc.
References t_gjetE, t_gjetEta, t_gjetN, t_gjetPhi, t_gjetPt, t_jetTrkCharge, t_jetTrkEta, t_jetTrkP, t_jetTrkPdg, t_jetTrkPhi, and t_jetTrkPt.
Referenced by analyze().
{ t_gjetN ->clear(); t_gjetE ->clear(); t_gjetPt ->clear(); t_gjetEta ->clear(); t_gjetPhi ->clear(); t_jetTrkP ->clear(); t_jetTrkPt ->clear(); t_jetTrkEta ->clear(); t_jetTrkPhi ->clear(); t_jetTrkPdg ->clear(); t_jetTrkCharge ->clear(); }
void IsolatedParticlesGeneratedJets::endJob | ( | void | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 171 of file IsolatedParticlesGeneratedJets.cc.
{ }
bool IsolatedParticlesGeneratedJets::debug [private] |
Definition at line 48 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), and IsolatedParticlesGeneratedJets().
Definition at line 50 of file IsolatedParticlesGeneratedJets.h.
Referenced by BookHistograms().
Definition at line 49 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), and IsolatedParticlesGeneratedJets().
Definition at line 49 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), and IsolatedParticlesGeneratedJets().
std::vector<double>* IsolatedParticlesGeneratedJets::t_gjetE [private] |
Definition at line 55 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), BookHistograms(), and clearTreeVectors().
std::vector<double> * IsolatedParticlesGeneratedJets::t_gjetEta [private] |
Definition at line 55 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), BookHistograms(), and clearTreeVectors().
std::vector<int>* IsolatedParticlesGeneratedJets::t_gjetN [private] |
Definition at line 53 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), BookHistograms(), and clearTreeVectors().
std::vector<double> * IsolatedParticlesGeneratedJets::t_gjetPhi [private] |
Definition at line 55 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), BookHistograms(), and clearTreeVectors().
std::vector<double> * IsolatedParticlesGeneratedJets::t_gjetPt [private] |
Definition at line 55 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), BookHistograms(), and clearTreeVectors().
std::vector< std::vector<double> >* IsolatedParticlesGeneratedJets::t_jetTrkCharge [private] |
Definition at line 62 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), BookHistograms(), and clearTreeVectors().
std::vector< std::vector<double> >* IsolatedParticlesGeneratedJets::t_jetTrkEta [private] |
Definition at line 59 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), BookHistograms(), and clearTreeVectors().
std::vector< std::vector<double> >* IsolatedParticlesGeneratedJets::t_jetTrkP [private] |
Definition at line 57 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), BookHistograms(), and clearTreeVectors().
std::vector< std::vector<double> >* IsolatedParticlesGeneratedJets::t_jetTrkPdg [private] |
Definition at line 61 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), BookHistograms(), and clearTreeVectors().
std::vector< std::vector<double> >* IsolatedParticlesGeneratedJets::t_jetTrkPhi [private] |
Definition at line 60 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), BookHistograms(), and clearTreeVectors().
std::vector< std::vector<double> >* IsolatedParticlesGeneratedJets::t_jetTrkPt [private] |
Definition at line 58 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), BookHistograms(), and clearTreeVectors().
TTree* IsolatedParticlesGeneratedJets::tree [private] |
Definition at line 51 of file IsolatedParticlesGeneratedJets.h.
Referenced by analyze(), and BookHistograms().