CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

EgammaHLTHcalIsolationProducersRegional Class Reference

#include <RecoEgamma/EgammaHLTProducers/interface/EgammaHLTHcalIsolationProducersRegional.h>

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

List of all members.

Public Member Functions

 EgammaHLTHcalIsolationProducersRegional (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~EgammaHLTHcalIsolationProducersRegional ()

Private Member Functions

 EgammaHLTHcalIsolationProducersRegional (const EgammaHLTHcalIsolationProducersRegional &rhs)
EgammaHLTHcalIsolationProducersRegionaloperator= (const EgammaHLTHcalIsolationProducersRegional &rhs)

Private Attributes

bool doEtSum_
edm::InputTag hbheRecHitProducer_
EgammaHLTHcalIsolationisolAlgo_
edm::InputTag recoEcalCandidateProducer_

Detailed Description

Author:
Monica Vazquez Acosta (CERN)

$Id:

Definition at line 36 of file EgammaHLTHcalIsolationProducersRegional.h.


Constructor & Destructor Documentation

EgammaHLTHcalIsolationProducersRegional::EgammaHLTHcalIsolationProducersRegional ( const edm::ParameterSet config) [explicit]

Definition at line 39 of file EgammaHLTHcalIsolationProducersRegional.cc.

References doEtSum_, edm::ParameterSet::getParameter(), hbheRecHitProducer_, isolAlgo_, and recoEcalCandidateProducer_.

{
 // use configuration file to setup input/output collection names
  recoEcalCandidateProducer_               = config.getParameter<edm::InputTag>("recoEcalCandidateProducer");

  hbheRecHitProducer_           = config.getParameter<edm::InputTag>("hbheRecHitProducer");
  //hfRecHitProducer_           = conf_.getParameter<edm::InputTag>("hfRecHitProducer"); 

  
  double eMinHB               = config.getParameter<double>("eMinHB");
  double eMinHE               = config.getParameter<double>("eMinHE");
  double etMinHB              = config.getParameter<double>("etMinHB");  
  double etMinHE             = config.getParameter<double>("etMinHE");

  double innerCone            = config.getParameter<double>("innerCone");
  double outerCone            = config.getParameter<double>("outerCone");
  int depth = config.getParameter<int>("depth");

  doEtSum_ = config.getParameter<bool>("doEtSum");
  isolAlgo_ = new EgammaHLTHcalIsolation(eMinHB,eMinHE,etMinHB,etMinHE,innerCone,outerCone,depth);
 
  
  //register your products
  produces < reco::RecoEcalCandidateIsolationMap >();
}
EgammaHLTHcalIsolationProducersRegional::~EgammaHLTHcalIsolationProducersRegional ( )

Definition at line 65 of file EgammaHLTHcalIsolationProducersRegional.cc.

References isolAlgo_.

{
  delete isolAlgo_;
}
EgammaHLTHcalIsolationProducersRegional::EgammaHLTHcalIsolationProducersRegional ( const EgammaHLTHcalIsolationProducersRegional rhs) [inline, private]

Definition at line 43 of file EgammaHLTHcalIsolationProducersRegional.h.

{}

Member Function Documentation

EgammaHLTHcalIsolationProducersRegional& EgammaHLTHcalIsolationProducersRegional::operator= ( const EgammaHLTHcalIsolationProducersRegional rhs) [inline, private]

Definition at line 44 of file EgammaHLTHcalIsolationProducersRegional.h.

{return *this;}
void EgammaHLTHcalIsolationProducersRegional::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 78 of file EgammaHLTHcalIsolationProducersRegional.cc.

References begin, doEtSum_, edm::EventSetup::get(), edm::Event::getByLabel(), EgammaHLTHcalIsolation::getESum(), EgammaHLTHcalIsolation::getEtSum(), hbheRecHitProducer_, edm::AssociationMap< Tag >::insert(), isolAlgo_, edm::ESHandle< T >::product(), edm::Handle< T >::product(), edm::Event::put(), and recoEcalCandidateProducer_.

{
  
  // Get the HLT filtered objects
  edm::Handle<reco::RecoEcalCandidateCollection> recoEcalCandHandle;
  iEvent.getByLabel(recoEcalCandidateProducer_,recoEcalCandHandle);
  // Get the barrel hcal hits
  edm::Handle<HBHERecHitCollection>  hbheRecHitHandle;
  iEvent.getByLabel(hbheRecHitProducer_, hbheRecHitHandle);
  const HBHERecHitCollection* hbheRecHitCollection = hbheRecHitHandle.product();
  
  edm::ESHandle<HcalChannelQuality> hcalChStatus;
  iSetup.get<HcalChannelQualityRcd>().get(hcalChStatus);
  
  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComp;
  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComp);

  

  // Get the forward hcal hits
  //edm::Handle<HFRecHitCollection> hhitEndcapHandle;
  //iEvent.getByLabel(hfRecHitProducer_, hhitEndcapHandle);
  //const HFRecHitCollection* hcalhitEndcapCollection = hhitEndcapHandle.product();
  //Get Calo Geometry
  
  edm::ESHandle<CaloGeometry> caloGeomHandle;
  iSetup.get<CaloGeometryRecord>().get(caloGeomHandle);
  const CaloGeometry* caloGeom = caloGeomHandle.product();
  
  reco::RecoEcalCandidateIsolationMap isoMap;
  
   
  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoEcalCandHandle->begin(); iRecoEcalCand != recoEcalCandHandle->end(); iRecoEcalCand++){
    
    reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle,iRecoEcalCand -recoEcalCandHandle ->begin());
    
    float isol = 0;
    if(doEtSum_) isol = isolAlgo_->getEtSum(recoEcalCandRef->superCluster()->eta(),
                                            recoEcalCandRef->superCluster()->phi(),hbheRecHitCollection,caloGeom,
                                            hcalSevLvlComp.product(),hcalChStatus.product());
    else isol = isolAlgo_->getESum(recoEcalCandRef->superCluster()->eta(),recoEcalCandRef->superCluster()->phi(),
                                   hbheRecHitCollection,caloGeom,
                                   hcalSevLvlComp.product(),hcalChStatus.product());
    
    isoMap.insert(recoEcalCandRef, isol);
    
  }

  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
  iEvent.put(isolMap);

}

Member Data Documentation