CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
MultiCandGenEvtSelector Class Reference

#include <MultiCandGenEvtSelector.h>

Inheritance diagram for MultiCandGenEvtSelector:
BaseHiGenEvtSelector

Public Member Functions

bool filter (HepMC::GenEvent *) override
 
 MultiCandGenEvtSelector (const edm::ParameterSet &)
 
 ~MultiCandGenEvtSelector () override
 
- Public Member Functions inherited from BaseHiGenEvtSelector
 BaseHiGenEvtSelector (const edm::ParameterSet &)
 
bool selectParticle (HepMC::GenParticle *par, int status, int pdg, double ptMin, double etaMax)
 
virtual ~BaseHiGenEvtSelector ()
 

Public Attributes

double etaMax_
 
int nTrig_
 
int pdg_
 
double ptMin_
 
int st_
 

Detailed Description

Definition at line 6 of file MultiCandGenEvtSelector.h.

Constructor & Destructor Documentation

◆ MultiCandGenEvtSelector()

MultiCandGenEvtSelector::MultiCandGenEvtSelector ( const edm::ParameterSet iConfig)

Definition at line 4 of file MultiCandGenEvtSelector.cc.

References etaMax_, edm::ParameterSet::getParameter(), nTrig_, pdg_, ptMin_, and st_.

4  : BaseHiGenEvtSelector(iConfig) {
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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
BaseHiGenEvtSelector(const edm::ParameterSet &)

◆ ~MultiCandGenEvtSelector()

MultiCandGenEvtSelector::~MultiCandGenEvtSelector ( )
inlineoverride

Definition at line 9 of file MultiCandGenEvtSelector.h.

9 { ; }

Member Function Documentation

◆ filter()

bool MultiCandGenEvtSelector::filter ( HepMC::GenEvent evt)
overridevirtual

Reimplemented from BaseHiGenEvtSelector.

Definition at line 12 of file MultiCandGenEvtSelector.cc.

References gather_cfg::cout, mps_fire::end, etaMax_, newFWLiteAna::found, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, nTrig_, pdg_, ptMin_, BaseHiGenEvtSelector::selectParticle(), and st_.

12  {
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) {
20  found++;
21  if (found == nTrig_)
22  return true;
23  }
24 
25  return false;
26 }
bool selectParticle(HepMC::GenParticle *par, int status, int pdg, double ptMin, double etaMax)

Member Data Documentation

◆ etaMax_

double MultiCandGenEvtSelector::etaMax_

Definition at line 13 of file MultiCandGenEvtSelector.h.

Referenced by filter(), and MultiCandGenEvtSelector().

◆ nTrig_

int MultiCandGenEvtSelector::nTrig_

Definition at line 16 of file MultiCandGenEvtSelector.h.

Referenced by filter(), and MultiCandGenEvtSelector().

◆ pdg_

int MultiCandGenEvtSelector::pdg_

Definition at line 15 of file MultiCandGenEvtSelector.h.

Referenced by filter(), and MultiCandGenEvtSelector().

◆ ptMin_

double MultiCandGenEvtSelector::ptMin_

Definition at line 12 of file MultiCandGenEvtSelector.h.

Referenced by filter(), and MultiCandGenEvtSelector().

◆ st_

int MultiCandGenEvtSelector::st_

Definition at line 14 of file MultiCandGenEvtSelector.h.

Referenced by filter(), and MultiCandGenEvtSelector().