#include <HFEMClusterProducer.h>
Public Member Functions | |
virtual void | beginRun (edm::Run const &, edm::EventSetup const &) override final |
HFEMClusterProducer (edm::ParameterSet const &conf) | |
virtual void | produce (edm::Event &e, edm::EventSetup const &iSetup) |
Private Attributes | |
HFClusterAlgo | algo_ |
edm::InputTag | hfreco_ |
Definition at line 15 of file HFEMClusterProducer.h.
HFEMClusterProducer::HFEMClusterProducer | ( | edm::ParameterSet const & | conf | ) | [explicit] |
Definition at line 14 of file HFEMClusterProducer.cc.
References algo_, edm::ParameterSet::getParameter(), and HFClusterAlgo::setup().
: hfreco_(conf.getParameter<edm::InputTag>("hits")) { produces<reco::HFEMClusterShapeCollection>(); produces<reco::BasicClusterCollection>(); produces<reco::SuperClusterCollection>(); produces<reco::HFEMClusterShapeAssociationCollection>(); algo_.setup(conf.getParameter<double>("minTowerEnergy"), conf.getParameter<double>("seedThresholdET"), conf.getParameter<double>("maximumSL"), conf.getParameter<double>("maximumRenergy"), conf.getParameter<bool>("usePMTFlag"), conf.getParameter<bool>("usePulseFlag"), conf.getParameter<bool>("forcePulseFlagMC"), conf.getParameter<int>("correctionType")); }
virtual void HFEMClusterProducer::beginRun | ( | edm::Run const & | , |
edm::EventSetup const & | |||
) | [inline, override, virtual] |
Reimplemented from edm::EDProducer.
Definition at line 19 of file HFEMClusterProducer.h.
References algo_, and HFClusterAlgo::resetForRun().
{ algo_.resetForRun(); }
void HFEMClusterProducer::produce | ( | edm::Event & | e, |
edm::EventSetup const & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 29 of file HFEMClusterProducer.cc.
References algo_, HFClusterAlgo::clusterize(), geometry, edm::EventSetup::get(), edm::Event::getByLabel(), hfreco_, i, HFClusterAlgo::isMC(), edm::EventBase::isRealData(), and edm::Event::put().
{ edm::Handle<HFRecHitCollection> hf_hits; e.getByLabel(hfreco_,hf_hits); edm::ESHandle<CaloGeometry> geometry; iSetup.get<CaloGeometryRecord>().get(geometry); // create return data std::auto_ptr<reco::HFEMClusterShapeCollection> retdata1(new HFEMClusterShapeCollection()); std::auto_ptr<reco::SuperClusterCollection> retdata2(new SuperClusterCollection()); std::auto_ptr<reco::HFEMClusterShapeAssociationCollection> retdata3(new HFEMClusterShapeAssociationCollection()); algo_.isMC(!e.isRealData()); algo_.clusterize(*hf_hits, *geometry, *retdata1, *retdata2); edm::OrphanHandle<reco::SuperClusterCollection> SupHandle; edm::OrphanHandle<reco::HFEMClusterShapeCollection> ShapeHandle; // put the results ShapeHandle=e.put(retdata1); SupHandle=e.put(retdata2); for (unsigned int i=0; i < ShapeHandle->size();i++){ retdata3->insert(edm::Ref<reco::SuperClusterCollection>(SupHandle,i),edm::Ref<reco::HFEMClusterShapeCollection>(ShapeHandle,i)); } e.put(retdata3); }
HFClusterAlgo HFEMClusterProducer::algo_ [private] |
Definition at line 22 of file HFEMClusterProducer.h.
Referenced by beginRun(), HFEMClusterProducer(), and produce().
edm::InputTag HFEMClusterProducer::hfreco_ [private] |
Definition at line 21 of file HFEMClusterProducer.h.
Referenced by produce().