![]() |
![]() |
#include <BsJpsiPhiFilter.h>
Classes | |
struct | CutStruct |
Public Member Functions | |
BsJpsiPhiFilter (const edm::ParameterSet &) | |
virtual bool | filter (edm::Event &, const edm::EventSetup &) |
~BsJpsiPhiFilter () | |
Private Types | |
typedef std::vector < HepMC::GenParticle * > | GenPartVect |
typedef std::vector < HepMC::GenParticle * > ::const_iterator | GenPartVectIt |
Private Member Functions | |
bool | cuts (const HepMC::GenParticle *jpsi, const CutStruct cut) |
bool | etaInRange (float eta, float etamin, float etamax) |
HepMC::GenParticle * | findParticle (HepMC::GenVertex *, const int requested_id) |
HepMC::GenEvent::particle_const_iterator | getNextBs (const HepMC::GenEvent::particle_const_iterator start, const HepMC::GenEvent::particle_const_iterator end) |
Private Attributes | |
CutStruct | hadronCuts |
std::string | label_ |
CutStruct | leptonCuts |
int | noAccepted |
Definition at line 27 of file BsJpsiPhiFilter.h.
typedef std::vector< HepMC::GenParticle * > BsJpsiPhiFilter::GenPartVect [private] |
Definition at line 44 of file BsJpsiPhiFilter.h.
typedef std::vector< HepMC::GenParticle * >::const_iterator BsJpsiPhiFilter::GenPartVectIt [private] |
Definition at line 45 of file BsJpsiPhiFilter.h.
BsJpsiPhiFilter::BsJpsiPhiFilter | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 9 of file BsJpsiPhiFilter.cc.
References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().
{ label_ = iConfig.getUntrackedParameter("moduleLabel",std::string("generator")); hadronCuts.type = iConfig.getParameter< int >("hadronType"); hadronCuts.etaMin = iConfig.getParameter<double>("hadronEtaMin"); hadronCuts.etaMax = iConfig.getParameter<double>("hadronEtaMax"); hadronCuts.ptMin = iConfig.getParameter<double>("hadronPtMin"); leptonCuts.type = iConfig.getParameter< int >("leptonType"); leptonCuts.etaMin = iConfig.getParameter<double>("leptonEtaMin"); leptonCuts.etaMax = iConfig.getParameter<double>("leptonEtaMax"); leptonCuts.ptMin = iConfig.getParameter<double>("leptonPtMin"); noAccepted = 0; }
BsJpsiPhiFilter::~BsJpsiPhiFilter | ( | ) |
Definition at line 25 of file BsJpsiPhiFilter.cc.
References gather_cfg::cout.
{ std::cout << "Total number of accepted events = " << noAccepted << std::endl; }
bool BsJpsiPhiFilter::cuts | ( | const HepMC::GenParticle * | jpsi, |
const CutStruct | cut | ||
) | [private] |
bool BsJpsiPhiFilter::etaInRange | ( | float | eta, |
float | etamin, | ||
float | etamax | ||
) | [private] |
Definition at line 175 of file BsJpsiPhiFilter.cc.
bool BsJpsiPhiFilter::filter | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDFilter.
Definition at line 72 of file BsJpsiPhiFilter.cc.
References gather_cfg::cout, configurableAnalysis::GenParticle, edm::Event::getByLabel(), and phi.
{ edm::Handle<HepMCProduct> evt; iEvent.getByLabel(label_, evt); const HepMC::GenEvent * generated_event = evt->GetEvent(); //cout << "Start\n"; bool event_passed = false; HepMC::GenEvent::particle_const_iterator bs = getNextBs(generated_event->particles_begin(), generated_event->particles_end()); while (bs!= generated_event->particles_end() ) { // vector< GenParticle * > bsChild = (*bs)->listChildren(); //*** HepMC::GenVertex* outVertex = (*bs)->end_vertex(); //*** GenParticle * jpsi = 0; GenParticle * phi = 0; // cout << "bs size "<<bsChild.size()<<endl; //*** int numChildren = outVertex->particles_out_size(); cout<< "bs size "<<numChildren<<endl; //*** /* if ((bsChild.size()==2) && ((jpsi = findParticle(bsChild, 443))!=0) && ((phi = findParticle(bsChild, 333))!=0)) { cout << bsChild[0]->momentum()<<" "<<bsChild[0]->momentum().eta() <<" "<<bsChild[1]->momentum()<<" "<<bsChild[1]->momentum().eta()<<endl; */ //*** if( (numChildren==2) && ((jpsi = findParticle(outVertex, 443))!=0) && ((phi = findParticle(outVertex, 333))!=0)) { cout << jpsi->momentum().rho()<<" "<<jpsi->momentum().eta() <<" "<<phi->momentum().rho() <<" "<<phi->momentum().eta()<<endl; cout <<"bs dec trouve"<<endl; if (cuts(phi, hadronCuts) && cuts(jpsi, leptonCuts)) { cout <<"OK trouve"<<endl; event_passed = true; break; } } bs = getNextBs(++bs, generated_event->particles_end()); } if (event_passed) noAccepted++; cout << "End filter\n"; delete generated_event; return event_passed; }
HepMC::GenParticle * BsJpsiPhiFilter::findParticle | ( | HepMC::GenVertex * | vertex, |
const int | requested_id | ||
) | [private] |
Definition at line 44 of file BsJpsiPhiFilter.cc.
References abs, gather_cfg::cout, and L1TEmulatorMonitor_cff::p.
HepMC::GenEvent::particle_const_iterator BsJpsiPhiFilter::getNextBs | ( | const HepMC::GenEvent::particle_const_iterator | start, |
const HepMC::GenEvent::particle_const_iterator | end | ||
) | [private] |
Definition at line 58 of file BsJpsiPhiFilter.cc.
References abs, end, and L1TEmulatorMonitor_cff::p.
CutStruct BsJpsiPhiFilter::hadronCuts [private] |
Definition at line 60 of file BsJpsiPhiFilter.h.
std::string BsJpsiPhiFilter::label_ [private] |
Definition at line 62 of file BsJpsiPhiFilter.h.
CutStruct BsJpsiPhiFilter::leptonCuts [private] |
Definition at line 60 of file BsJpsiPhiFilter.h.
int BsJpsiPhiFilter::noAccepted [private] |
Definition at line 63 of file BsJpsiPhiFilter.h.