15 src_(pset.getParameter<edm::InputTag>(
"src")),
16 srcHepMC_(pset.getParameter<edm::InputTag>(
"hepMcSrc")),
17 hepMcMode_(stringToHepMcMode(pset.getParameter<std::
string>(
"hepMcMode"))),
20 produces<edm::HepMCProduct>();
21 produces<GenFilterInfo>(
"minVisPtFilter");
30 else if(name ==
"replace")
33 throw cms::Exception(
"Configuration") <<
"Unsupported hepMcMode " << name <<
", should be 'new' or 'replace'" << std::endl;
40 std::vector<reco::Muon>
muons;
45 if (combCandidatesHandle->size()==0)
47 for (
size_t idx = 0;
idx < combCandidatesHandle->at(0).numberOfDaughters(); ++
idx)
49 int charge = combCandidatesHandle->at(0).daughter(
idx)->charge();
60 for (
size_t idx = 0;
idx < candsHandle->size(); ++
idx)
62 int charge = candsHandle->at(
idx).charge();
69 if (muons.size() == 0)
71 edm::LogError(
"MCParticleReplacer") <<
"No candidates or muons found!";
75 std::auto_ptr<HepMC::GenEvent> evt;
80 evt =
replacer_->produce(muons, 0, HepMCHandle->GetEvent());
91 bare_product->addHepMCData(evt.release());
93 iEvent.
put(bare_product);
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
#define DEFINE_FWK_MODULE(type)
virtual void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
virtual void endRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
MCParticleReplacer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
static HepMcMode stringToHepMcMode(const std::string &name)
math::XYZPoint Point
point in the space
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
boost::shared_ptr< ParticleReplacerBase > replacer_
math::XYZTLorentzVector LorentzVector
Lorentz vector.