6 #include "HepMC/PythiaWrapper6_4.h"
14 token_(consumes<edm::
HepMCProduct>(edm::
InputTag(iConfig.getUntrackedParameter(
"moduleLabel",std::
string(
"generator")),
"unsmeared"))),
15 particleID(iConfig.getUntrackedParameter(
"ParticleID", 0)),
16 chargeconju(iConfig.getUntrackedParameter(
"ChargeConjugation",
true)),
17 ndaughters(iConfig.getUntrackedParameter(
"NumberDaughters", 0)),
18 minptcut(iConfig.getUntrackedParameter(
"MinPt", 0.)),
19 maxptcut(iConfig.getUntrackedParameter(
"MaxPt", 14000.)),
20 minetacut(iConfig.getUntrackedParameter(
"MinEta", -10.)),
21 maxetacut(iConfig.getUntrackedParameter(
"MaxEta", 10.))
25 defdauID.push_back(0);
47 bool accepted =
false;
51 const HepMC::GenEvent * myGenEvent = evt->GetEvent();
54 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
55 p != myGenEvent->particles_end(); ++
p ) {
60 if ( (*p)->end_vertex() ) {
61 for ( HepMC::GenVertex::particle_iterator
62 des=(*p)->end_vertex()->particles_begin(HepMC::children);
63 des != (*p)->end_vertex()->particles_end(HepMC::children);
66 for(
unsigned int i=0;
i<
dauIDs.size(); ++
i) {
67 if( (*des)->pdg_id() !=
dauIDs[
i] )
continue ;
68 if( (*des)->momentum().perp() >
minptcut &&
69 (*des)->momentum().perp() <
maxptcut &&
88 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
89 p != myGenEvent->particles_end(); ++
p ) {
94 if ( (*p)->end_vertex() ) {
95 for ( HepMC::GenVertex::particle_iterator
96 des=(*p)->end_vertex()->particles_begin(HepMC::children);
97 des != (*p)->end_vertex()->particles_end(HepMC::children);
100 for(
unsigned int i=0;
i<
dauIDs.size(); ++
i) {
103 int has_antipart = pydat2.kchg[3-1][pythiaCode-1];
104 if( has_antipart == 0 ) IDanti =
dauIDs[
i];
105 if( (*des)->pdg_id() != IDanti )
continue ;
106 if( (*des)->momentum().perp() >
minptcut &&
107 (*des)->momentum().perp() <
maxptcut &&
125 return true; }
else {
return false;}
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::HepMCProduct > token_
std::vector< int > dauIDs
bool getByToken(EDGetToken token, Handle< PROD > &result) const
PythiaDauFilter(const edm::ParameterSet &)
virtual bool filter(edm::Event &, const edm::EventSetup &)