CMS 3D CMS Logo

BaseHiGenEvtSelector.h
Go to the documentation of this file.
1 #ifndef __BaseHiGenEvtSelector_h_
2 #define __BaseHiGenEvtSelector_h_
3 
5 #include "HepMC/GenEvent.h"
6 #include "HepMC/GenParticle.h"
7 
9 public:
11  virtual ~BaseHiGenEvtSelector() { ; }
12  virtual bool filter(HepMC::GenEvent*) { return true; }
13  bool selectParticle(HepMC::GenParticle* par, int status, int pdg /*Absolute*/, double ptMin, double etaMax) {
14  return (par->status() == status && abs(par->pdg_id()) == pdg && par->momentum().perp() > ptMin &&
15  fabs(par->momentum().eta()) < etaMax);
16  }
17 };
18 
19 #endif
constexpr float ptMin
bool selectParticle(HepMC::GenParticle *par, int status, int pdg, double ptMin, double etaMax)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual bool filter(HepMC::GenEvent *)
BaseHiGenEvtSelector(const edm::ParameterSet &)