CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
PartonShowerBsHepMCFilter Class Reference

#include <PartonShowerBsHepMCFilter.h>

Inheritance diagram for PartonShowerBsHepMCFilter:
BaseHepMCFilter

Public Member Functions

virtual bool filter (const HepMC::GenEvent *evt)
 
 PartonShowerBsHepMCFilter (const edm::ParameterSet &)
 
 ~PartonShowerBsHepMCFilter ()
 
- Public Member Functions inherited from BaseHepMCFilter
 BaseHepMCFilter ()
 
virtual ~BaseHepMCFilter ()
 

Detailed Description

Description: Filter gen particles based on pdg_id and status code

Author
bortigno
Version
1.0 02.04.2015

Definition at line 16 of file PartonShowerBsHepMCFilter.h.

Constructor & Destructor Documentation

PartonShowerBsHepMCFilter::PartonShowerBsHepMCFilter ( const edm::ParameterSet iConfig)

Definition at line 12 of file PartonShowerBsHepMCFilter.cc.

13 {
14 
15 }
PartonShowerBsHepMCFilter::~PartonShowerBsHepMCFilter ( )

Definition at line 19 of file PartonShowerBsHepMCFilter.cc.

20 {
21 
22 }

Member Function Documentation

bool PartonShowerBsHepMCFilter::filter ( const HepMC::GenEvent *  evt)
virtual

Implements BaseHepMCFilter.

Definition at line 29 of file PartonShowerBsHepMCFilter.cc.

References AlCaHLTBitMon_ParallelJobs::p, and sysUtil::pid.

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