CMS 3D CMS Logo

Public Member Functions | Private Attributes

HFEMClusterProducer Class Reference

#include <HFEMClusterProducer.h>

Inheritance diagram for HFEMClusterProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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_

Detailed Description

Definition at line 15 of file HFEMClusterProducer.h.


Constructor & Destructor Documentation

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"));
}

Member Function Documentation

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);

}

Member Data Documentation

Definition at line 21 of file HFEMClusterProducer.h.

Referenced by HFEMClusterProducer(), and produce().

Definition at line 20 of file HFEMClusterProducer.h.

Referenced by produce().