#include <AnalysisRootpleProducerOnlyMC.h>
Definition at line 31 of file AnalysisRootpleProducerOnlyMC.h.
AnalysisRootpleProducerOnlyMC::AnalysisRootpleProducerOnlyMC | ( | const edm::ParameterSet & | pset | ) | [explicit] |
Definition at line 68 of file AnalysisRootpleProducerOnlyMC.cc.
References edm::ParameterSet::getUntrackedParameter().
{ mcEvent = pset.getUntrackedParameter<InputTag>("MCEvent",std::string("")); genJetCollName = pset.getUntrackedParameter<InputTag>("GenJetCollectionName",std::string("")); chgJetCollName = pset.getUntrackedParameter<InputTag>("ChgGenJetCollectionName",std::string("")); chgGenPartCollName = pset.getUntrackedParameter<InputTag>("ChgGenPartCollectionName",std::string("")); piG = acos(-1.); NumberMCParticles=0; NumberInclusiveJet=0; NumberChargedJet=0; }
virtual AnalysisRootpleProducerOnlyMC::~AnalysisRootpleProducerOnlyMC | ( | ) | [inline, virtual] |
Definition at line 37 of file AnalysisRootpleProducerOnlyMC.h.
{}
void AnalysisRootpleProducerOnlyMC::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | |||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 129 of file AnalysisRootpleProducerOnlyMC.cc.
References edm::Event::getByLabel().
{ e.getByLabel( mcEvent , EvtHandle ) ; e.getByLabel( chgGenPartCollName, CandHandleMC ); e.getByLabel( chgJetCollName , ChgGenJetsHandle ); e.getByLabel( genJetCollName , GenJetsHandle ); const HepMC::GenEvent* Evt = EvtHandle->GetEvent() ; EventKind = Evt->signal_process_id(); std::vector<math::XYZTLorentzVector> GenPart; std::vector<GenJet> ChgGenJetContainer; std::vector<GenJet> GenJetContainer; GenPart.clear(); ChgGenJetContainer.clear(); GenJetContainer.clear(); ChargedJet->Clear(); InclusiveJet->Clear(); MonteCarlo->Clear(); if (ChgGenJetsHandle->size()){ for ( GenJetCollection::const_iterator it(ChgGenJetsHandle->begin()), itEnd(ChgGenJetsHandle->end()); it!=itEnd; ++it) { ChgGenJetContainer.push_back(*it); } std::stable_sort(ChgGenJetContainer.begin(),ChgGenJetContainer.end(),GenJetSort()); std::vector<GenJet>::const_iterator it(ChgGenJetContainer.begin()), itEnd(ChgGenJetContainer.end()); for ( int iChargedJet(0); it != itEnd; ++it, ++iChargedJet) { fillChargedJet(it->p(),it->pt(),it->eta(),it->phi()); new((*ChargedJet)[iChargedJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy()); } } if (GenJetsHandle->size()){ for ( GenJetCollection::const_iterator it(GenJetsHandle->begin()), itEnd(GenJetsHandle->end()); it!=itEnd; ++it ) { GenJetContainer.push_back(*it); } std::stable_sort(GenJetContainer.begin(),GenJetContainer.end(),GenJetSort()); std::vector<GenJet>::const_iterator it(GenJetContainer.begin()), itEnd(GenJetContainer.end()); for ( int iInclusiveJet(0); it != itEnd; ++it, ++iInclusiveJet) { fillInclusiveJet(it->p(),it->pt(),it->eta(),it->phi()); new((*InclusiveJet)[iInclusiveJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy()); } } if (CandHandleMC->size()){ for (vector<GenParticle>::const_iterator it(CandHandleMC->begin()), itEnd(CandHandleMC->end()); it != itEnd;it++) { GenPart.push_back(it->p4()); } std::stable_sort(GenPart.begin(),GenPart.end(),GreaterPt()); std::vector<math::XYZTLorentzVector>::const_iterator it(GenPart.begin()), itEnd(GenPart.end()); for( int iMonteCarlo(0); it != itEnd; ++it, ++iMonteCarlo ) { fillMCParticles(it->P(),it->Pt(),it->Eta(),it->Phi()); new((*MonteCarlo)[iMonteCarlo]) TLorentzVector(it->Px(), it->Py(), it->Pz(), it->E()); } } store(); }
void AnalysisRootpleProducerOnlyMC::beginJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 82 of file AnalysisRootpleProducerOnlyMC.cc.
{ // use TFileService for output to root file AnalysisTree = fs->make<TTree>("AnalysisTree","MBUE Analysis Tree "); // process type AnalysisTree->Branch("EventKind",&EventKind,"EventKind/I"); // store p, pt, eta, phi for particles and jets // GenParticles at hadron level AnalysisTree->Branch("NumberMCParticles",&NumberMCParticles,"NumberMCParticles/I"); AnalysisTree->Branch("MomentumMC",MomentumMC,"MomentumMC[NumberMCParticles]/F"); AnalysisTree->Branch("TransverseMomentumMC",TransverseMomentumMC,"TransverseMomentumMC[NumberMCParticles]/F"); AnalysisTree->Branch("EtaMC",EtaMC,"EtaMC[NumberMCParticles]/F"); AnalysisTree->Branch("PhiMC",PhiMC,"PhiMC[NumberMCParticles]/F"); // GenJets AnalysisTree->Branch("NumberInclusiveJet",&NumberInclusiveJet,"NumberInclusiveJet/I"); AnalysisTree->Branch("MomentumIJ",MomentumIJ,"MomentumIJ[NumberInclusiveJet]/F"); AnalysisTree->Branch("TrasverseMomentumIJ",TransverseMomentumIJ,"TransverseMomentumIJ[NumberInclusiveJet]/F"); AnalysisTree->Branch("EtaIJ",EtaIJ,"EtaIJ[NumberInclusiveJet]/F"); AnalysisTree->Branch("PhiIJ",PhiIJ,"PhiIJ[NumberInclusiveJet]/F"); // jets from charged GenParticles AnalysisTree->Branch("NumberChargedJet",&NumberChargedJet,"NumberChargedJet/I"); AnalysisTree->Branch("MomentumCJ",MomentumCJ,"MomentumCJ[NumberChargedJet]/F"); AnalysisTree->Branch("TrasverseMomentumCJ",TransverseMomentumCJ,"TransverseMomentumCJ[NumberChargedJet]/F"); AnalysisTree->Branch("EtaCJ",EtaCJ,"EtaCJ[NumberChargedJet]/F"); AnalysisTree->Branch("PhiCJ",PhiCJ,"PhiCJ[NumberChargedJet]/F"); // alternative storage method: // save TClonesArrays of TLorentzVectors // i.e. store 4-vectors of particles and jets MonteCarlo = new TClonesArray("TLorentzVector", 10000); AnalysisTree->Branch("MonteCarlo", "TClonesArray", &MonteCarlo, 128000, 0); InclusiveJet = new TClonesArray("TLorentzVector", 10000); AnalysisTree->Branch("InclusiveJet", "TClonesArray", &InclusiveJet, 128000, 0); ChargedJet = new TClonesArray("TLorentzVector", 10000); AnalysisTree->Branch("ChargedJet", "TClonesArray", &ChargedJet, 128000, 0); }
void AnalysisRootpleProducerOnlyMC::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 210 of file AnalysisRootpleProducerOnlyMC.cc.
{ }
void AnalysisRootpleProducerOnlyMC::fillChargedJet | ( | float | p, |
float | pt, | ||
float | eta, | ||
float | phi | ||
) |
Definition at line 59 of file AnalysisRootpleProducerOnlyMC.cc.
References eta(), L1TEmulatorMonitor_cff::p, and phi.
void AnalysisRootpleProducerOnlyMC::fillEventInfo | ( | int | e | ) |
Definition at line 36 of file AnalysisRootpleProducerOnlyMC.cc.
{ EventKind = e; }
void AnalysisRootpleProducerOnlyMC::fillInclusiveJet | ( | float | p, |
float | pt, | ||
float | eta, | ||
float | phi | ||
) |
Definition at line 50 of file AnalysisRootpleProducerOnlyMC.cc.
References eta(), L1TEmulatorMonitor_cff::p, and phi.
void AnalysisRootpleProducerOnlyMC::fillMCParticles | ( | float | p, |
float | pt, | ||
float | eta, | ||
float | phi | ||
) |
Definition at line 41 of file AnalysisRootpleProducerOnlyMC.cc.
References eta(), L1TEmulatorMonitor_cff::p, and phi.
void AnalysisRootpleProducerOnlyMC::store | ( | ) |
Definition at line 27 of file AnalysisRootpleProducerOnlyMC.cc.
{ AnalysisTree->Fill(); NumberMCParticles=0; NumberInclusiveJet=0; NumberChargedJet=0; }
TTree* AnalysisRootpleProducerOnlyMC::AnalysisTree [private] |
Definition at line 66 of file AnalysisRootpleProducerOnlyMC.h.
edm::Handle< std::vector<reco::GenParticle> > AnalysisRootpleProducerOnlyMC::CandHandleMC [private] |
Definition at line 57 of file AnalysisRootpleProducerOnlyMC.h.
TClonesArray* AnalysisRootpleProducerOnlyMC::ChargedJet [private] |
Definition at line 86 of file AnalysisRootpleProducerOnlyMC.h.
Definition at line 59 of file AnalysisRootpleProducerOnlyMC.h.
Definition at line 54 of file AnalysisRootpleProducerOnlyMC.h.
Definition at line 53 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::EtaCJ[NCJMAX] [private] |
Definition at line 80 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::EtaEHJ[NEHJMAX] [private] |
Definition at line 82 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::EtaIJ[NIJMAX] [private] |
Definition at line 79 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::EtaMC[NMCPMAX] [private] |
Definition at line 77 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::EtaTJ[NTJMAX] [private] |
Definition at line 81 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::EtaTK[NTKMAX] [private] |
Definition at line 78 of file AnalysisRootpleProducerOnlyMC.h.
int AnalysisRootpleProducerOnlyMC::EventKind [private] |
Definition at line 75 of file AnalysisRootpleProducerOnlyMC.h.
Definition at line 56 of file AnalysisRootpleProducerOnlyMC.h.
Definition at line 64 of file AnalysisRootpleProducerOnlyMC.h.
Definition at line 52 of file AnalysisRootpleProducerOnlyMC.h.
Definition at line 58 of file AnalysisRootpleProducerOnlyMC.h.
TClonesArray* AnalysisRootpleProducerOnlyMC::InclusiveJet [private] |
Definition at line 85 of file AnalysisRootpleProducerOnlyMC.h.
Definition at line 51 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::MomentumCJ[NCJMAX] [private] |
Definition at line 80 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::MomentumEHJ[NEHJMAX] [private] |
Definition at line 82 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::MomentumIJ[NIJMAX] [private] |
Definition at line 79 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::MomentumMC[NMCPMAX] [private] |
Definition at line 77 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::MomentumTJ[NTJMAX] [private] |
Definition at line 81 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::MomentumTK[NTKMAX] [private] |
Definition at line 78 of file AnalysisRootpleProducerOnlyMC.h.
TClonesArray* AnalysisRootpleProducerOnlyMC::MonteCarlo [private] |
Definition at line 84 of file AnalysisRootpleProducerOnlyMC.h.
const int AnalysisRootpleProducerOnlyMC::NCJMAX = 10000 [static, private] |
Definition at line 71 of file AnalysisRootpleProducerOnlyMC.h.
const int AnalysisRootpleProducerOnlyMC::NEHJMAX = 10000 [static, private] |
Definition at line 73 of file AnalysisRootpleProducerOnlyMC.h.
const int AnalysisRootpleProducerOnlyMC::NIJMAX = 10000 [static, private] |
Definition at line 70 of file AnalysisRootpleProducerOnlyMC.h.
const int AnalysisRootpleProducerOnlyMC::NMCPMAX = 10000 [static, private] |
Definition at line 68 of file AnalysisRootpleProducerOnlyMC.h.
const int AnalysisRootpleProducerOnlyMC::NTJMAX = 10000 [static, private] |
Definition at line 72 of file AnalysisRootpleProducerOnlyMC.h.
const int AnalysisRootpleProducerOnlyMC::NTKMAX = 10000 [static, private] |
Definition at line 69 of file AnalysisRootpleProducerOnlyMC.h.
int AnalysisRootpleProducerOnlyMC::NumberCaloJet [private] |
Definition at line 75 of file AnalysisRootpleProducerOnlyMC.h.
int AnalysisRootpleProducerOnlyMC::NumberChargedJet [private] |
Definition at line 75 of file AnalysisRootpleProducerOnlyMC.h.
int AnalysisRootpleProducerOnlyMC::NumberInclusiveJet [private] |
Definition at line 75 of file AnalysisRootpleProducerOnlyMC.h.
int AnalysisRootpleProducerOnlyMC::NumberMCParticles [private] |
Definition at line 75 of file AnalysisRootpleProducerOnlyMC.h.
int AnalysisRootpleProducerOnlyMC::NumberTracks [private] |
Definition at line 75 of file AnalysisRootpleProducerOnlyMC.h.
int AnalysisRootpleProducerOnlyMC::NumberTracksJet [private] |
Definition at line 75 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::PhiCJ[NCJMAX] [private] |
Definition at line 80 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::PhiEHJ[NEHJMAX] [private] |
Definition at line 82 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::PhiIJ[NIJMAX] [private] |
Definition at line 79 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::PhiMC[NMCPMAX] [private] |
Definition at line 77 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::PhiTJ[NTJMAX] [private] |
Definition at line 81 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::PhiTK[NTKMAX] [private] |
Definition at line 78 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::piG [private] |
Definition at line 62 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::TransverseMomentumCJ[NCJMAX] [private] |
Definition at line 80 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::TransverseMomentumEHJ[NEHJMAX] [private] |
Definition at line 82 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::TransverseMomentumIJ[NIJMAX] [private] |
Definition at line 79 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::TransverseMomentumMC[NMCPMAX] [private] |
Definition at line 77 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::TransverseMomentumTJ[NTJMAX] [private] |
Definition at line 81 of file AnalysisRootpleProducerOnlyMC.h.
float AnalysisRootpleProducerOnlyMC::TransverseMomentumTK[NTKMAX] [private] |
Definition at line 78 of file AnalysisRootpleProducerOnlyMC.h.