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 *)
 
 MultiCandGenEvtSelector (const edm::ParameterSet &)
 
virtual ~MultiCandGenEvtSelector ()
 
- 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 ( const edm::ParameterSet iConfig)

Definition at line 4 of file MultiCandGenEvtSelector.cc.

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

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 }
T getParameter(std::string const &) const
BaseHiGenEvtSelector(const edm::ParameterSet &)
virtual MultiCandGenEvtSelector::~MultiCandGenEvtSelector ( )
inlinevirtual

Definition at line 9 of file MultiCandGenEvtSelector.h.

References filter().

9 {;}

Member Function Documentation

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

Reimplemented from BaseHiGenEvtSelector.

Definition at line 14 of file MultiCandGenEvtSelector.cc.

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

Referenced by ~MultiCandGenEvtSelector().

14  {
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 }
bool selectParticle(HepMC::GenParticle *par, int status, int pdg, double ptMin, double etaMax)
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30

Member Data Documentation

double MultiCandGenEvtSelector::etaMax_

Definition at line 13 of file MultiCandGenEvtSelector.h.

Referenced by filter(), and MultiCandGenEvtSelector().

int MultiCandGenEvtSelector::nTrig_

Definition at line 16 of file MultiCandGenEvtSelector.h.

Referenced by filter(), and MultiCandGenEvtSelector().

int MultiCandGenEvtSelector::pdg_

Definition at line 15 of file MultiCandGenEvtSelector.h.

Referenced by filter(), and MultiCandGenEvtSelector().

double MultiCandGenEvtSelector::ptMin_

Definition at line 12 of file MultiCandGenEvtSelector.h.

Referenced by filter(), and MultiCandGenEvtSelector().

int MultiCandGenEvtSelector::st_

Definition at line 14 of file MultiCandGenEvtSelector.h.

Referenced by filter(), and MultiCandGenEvtSelector().