#include <RecoEgamma/EgammaHFProducers/plugins/HFEMClusterProducer.h>
Public Member Functions | |
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().
00014 : hfreco_(conf.getUntrackedParameter<edm::InputTag>("hits")) { 00015 produces<reco::HFEMClusterShapeCollection>(); 00016 produces<reco::BasicClusterCollection>(); 00017 produces<reco::SuperClusterCollection>(); 00018 produces<reco::HFEMClusterShapeAssociationCollection>(); 00019 algo_.setup(conf.getParameter<double>("minTowerEnergy")); 00020 }
void HFEMClusterProducer::produce | ( | edm::Event & | e, | |
edm::EventSetup const & | iSetup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 22 of file HFEMClusterProducer.cc.
References algo_, HFClusterAlgo::clusterize(), edm::EventSetup::get(), edm::Event::getByLabel(), hfreco_, i, and edm::Event::put().
00022 { 00023 00024 edm::Handle<HFRecHitCollection> hf_hits; 00025 00026 e.getByLabel(hfreco_,hf_hits); 00027 00028 edm::ESHandle<CaloGeometry> geometry; 00029 iSetup.get<CaloGeometryRecord>().get(geometry); 00030 00031 // create return data 00032 std::auto_ptr<reco::HFEMClusterShapeCollection> retdata1(new HFEMClusterShapeCollection()); 00033 std::auto_ptr<reco::BasicClusterCollection> retdata2(new BasicClusterCollection()); 00034 std::auto_ptr<reco::SuperClusterCollection> retdata3(new SuperClusterCollection()); 00035 std::auto_ptr<reco::HFEMClusterShapeAssociationCollection> retdata4(new HFEMClusterShapeAssociationCollection()); 00036 00037 00038 algo_.clusterize(*hf_hits, *geometry, *retdata1, *retdata2, *retdata3); 00039 edm::OrphanHandle<reco::SuperClusterCollection> SupHandle; 00040 edm::OrphanHandle<reco::HFEMClusterShapeCollection> ShapeHandle; 00041 00042 // put the results 00043 ShapeHandle=e.put(retdata1); 00044 e.put(retdata2); 00045 SupHandle=e.put(retdata3); 00046 for (unsigned int i=0; i < ShapeHandle->size();i++){ 00047 retdata4->insert(edm::Ref<reco::SuperClusterCollection>(SupHandle,i),edm::Ref<reco::HFEMClusterShapeCollection>(ShapeHandle,i)); 00048 } 00049 00050 00051 e.put(retdata4); 00052 00053 }
HFClusterAlgo HFEMClusterProducer::algo_ [private] |
Definition at line 21 of file HFEMClusterProducer.h.
Referenced by HFEMClusterProducer(), and produce().
edm::InputTag HFEMClusterProducer::hfreco_ [private] |