CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PartonShowerBsHepMCFilter.cc
Go to the documentation of this file.
3 #include <iostream>
4 #include "HepPDT/ParticleID.hh"
5 
6 
7 using namespace edm;
8 using namespace std;
9 
10 
11 //constructor
13 {
14 
15 }
16 
17 
18 //destructor
20 {
21 
22 }
23 
24 //
25 // member functions
26 //
27 
28 // ------------ method called to produce the data ------------
29 bool PartonShowerBsHepMCFilter::filter(const HepMC::GenEvent* evt)
30 {
31 
32  // loop over gen particles
33  for ( HepMC::GenEvent::particle_const_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p ){
34 
35  // check only status 2 particles
36  if( (*p)->status()==2 ){
37  // if one of the status 2 particles is a B-hadron, accept the event
38  HepPDT::ParticleID pid((*p)->pdg_id());
39  if( pid.hasBottom() ){
40  return true; // accept event
41  }
42  }
43 
44  }
45 
46  return false; // skip event
47 
48 }
PartonShowerBsHepMCFilter(const edm::ParameterSet &)
tuple pid
Definition: sysUtil.py:22
virtual bool filter(const HepMC::GenEvent *evt)