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.

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 }

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

◆ ~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.

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) {
19  if (selectParticle(*it, st_, pdg_, ptMin_, etaMax_))
20  found++;
21  if (found == nTrig_)
22  return true;
23  }
24 
25  return false;
26 }

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

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().

MultiCandGenEvtSelector::ptMin_
double ptMin_
Definition: MultiCandGenEvtSelector.h:12
MultiCandGenEvtSelector::nTrig_
int nTrig_
Definition: MultiCandGenEvtSelector.h:16
gather_cfg.cout
cout
Definition: gather_cfg.py:144
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
BaseHiGenEvtSelector::BaseHiGenEvtSelector
BaseHiGenEvtSelector(const edm::ParameterSet &)
Definition: BaseHiGenEvtSelector.h:10
MultiCandGenEvtSelector::st_
int st_
Definition: MultiCandGenEvtSelector.h:14
mps_fire.end
end
Definition: mps_fire.py:242
BaseHiGenEvtSelector::selectParticle
bool selectParticle(HepMC::GenParticle *par, int status, int pdg, double ptMin, double etaMax)
Definition: BaseHiGenEvtSelector.h:13
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MultiCandGenEvtSelector::etaMax_
double etaMax_
Definition: MultiCandGenEvtSelector.h:13
MultiCandGenEvtSelector::pdg_
int pdg_
Definition: MultiCandGenEvtSelector.h:15