6 token_(consumes<edm::
HepMCProduct>(cfg.getUntrackedParameter(
"moduleLabel",std::
string(
"generator")))),
7 pdgID(cfg.getParameter<std::vector<int> >(
"PdgId")),
8 index(cfg.getParameter<std::vector<unsigned> >(
"Index")),
10 taggingMode(cfg.getUntrackedParameter<bool>(
"TagMode",
false)),
11 tag(cfg.getUntrackedParameter<std::
string>(
"Tag",
""))
15 <<
"Configuration Error :"
16 <<
"Sizes of array parameters 'PdgId' and 'Index' differ.";
20 edm::LogInfo(
"TagMode") <<
"Filter result in '" <<
tag <<
"', filtering disabled.";
27 LogDebug(
"FilterResult") << (result?
"Pass":
"Fail");
29 evt.
put( std::auto_ptr<bool>(
new bool(result)),
tag);
38 const HepMC::GenEvent *
genEvent = hepmc->GetEvent();
40 HepMC::GenEvent::particle_const_iterator
41 p(genEvent->particles_begin()),
42 p_end(genEvent->particles_end());
44 for (
unsigned i=0;
p!=p_end &&
i<=
maxIndex; ++
p, i++ ) {
45 LogDebug(
"Particle") <<
"index: " << i <<
" pdgID: " << (*p)->pdg_id();
46 for (
unsigned j = 0;
j <
pdgID.size();
j++) {
bool getByToken(EDGetToken token, Handle< PROD > &result) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
MCPdgIndexFilter(const edm::ParameterSet &)
const std::vector< unsigned > index
const edm::EDGetTokenT< edm::HepMCProduct > token_
const std::vector< int > pdgID
volatile std::atomic< bool > shutdown_flag false
virtual bool filter(edm::Event &, const edm::EventSetup &)
bool pass(const edm::Event &)