File indexing completed on 2023-03-17 11:04:12
0001 #include "GeneratorInterface/Core/interface/PartonShowerCsHepMCFilter.h"
0002 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0003 #include <iostream>
0004 #include "HepPDT/ParticleID.hh"
0005
0006 using namespace edm;
0007 using namespace std;
0008
0009
0010 PartonShowerCsHepMCFilter::PartonShowerCsHepMCFilter(const edm::ParameterSet& iConfig) {}
0011
0012
0013 PartonShowerCsHepMCFilter::~PartonShowerCsHepMCFilter() {}
0014
0015
0016
0017
0018
0019
0020 bool PartonShowerCsHepMCFilter::filter(const HepMC::GenEvent* evt) {
0021
0022 for (HepMC::GenEvent::particle_const_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p) {
0023
0024 if ((*p)->status() == 2) {
0025
0026 HepPDT::ParticleID pid((*p)->pdg_id());
0027 if (pid.hasCharm()) {
0028 return true;
0029 }
0030 }
0031 }
0032
0033 return false;
0034 }