CMS 3D CMS Logo

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