CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MultiCandGenEvtSelector.cc
Go to the documentation of this file.
1 #include <iostream>
3 
5  : BaseHiGenEvtSelector(iConfig)
6 {
7  ptMin_ = iConfig.getParameter<double>("ptMin");
8  etaMax_ = iConfig.getParameter<double>("etaMax");
9  pdg_ = iConfig.getParameter<int>("pdg");
10  st_ = iConfig.getParameter<int>("status");
11  nTrig_ = iConfig.getParameter<int>("minimumCandidates");
12 }
13 
14 bool MultiCandGenEvtSelector::filter(HepMC::GenEvent * evt){
15  std::cout<<"Di Muon Fired"<<std::endl;
16 
17  int found = 0;
18  HepMC::GenEvent::particle_const_iterator begin = evt->particles_begin();
19  HepMC::GenEvent::particle_const_iterator end = evt->particles_end();
20  for(HepMC::GenEvent::particle_const_iterator it = begin; it != end; ++it){
21  if(selectParticle(*it, st_, pdg_, ptMin_, etaMax_)) found++;
22  if(found == nTrig_) return true;
23  }
24 
25  return false;
26 }
T getParameter(std::string const &) const
MultiCandGenEvtSelector(const edm::ParameterSet &)
bool filter(HepMC::GenEvent *)
bool selectParticle(HepMC::GenParticle *par, int status, int pdg, double ptMin, double etaMax)
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
tuple cout
Definition: gather_cfg.py:41