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_
bool doRhoCorrection_
float effectiveAreaBarrel_
float effectiveAreaEndcap_
edm::InputTag hbheRecHitProducer_
EgammaHLTHcalIsolationisolAlgo_
edm::InputTag recoEcalCandidateProducer_
float rhoMax_
edm::InputTag rhoProducer_
float rhoScale_

Detailed Description

Author:
Monica Vazquez Acosta (CERN)

$Id:

Definition at line 34 of file EgammaHLTHcalIsolationProducersRegional.h.


Constructor & Destructor Documentation

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

Definition at line 39 of file EgammaHLTHcalIsolationProducersRegional.cc.

References doEtSum_, doRhoCorrection_, effectiveAreaBarrel_, effectiveAreaEndcap_, edm::ParameterSet::getParameter(), hbheRecHitProducer_, isolAlgo_, recoEcalCandidateProducer_, rhoMax_, rhoProducer_, and rhoScale_.

{
 // use configuration file to setup input/output collection names
  recoEcalCandidateProducer_ = config.getParameter<edm::InputTag>("recoEcalCandidateProducer");
  hbheRecHitProducer_        = config.getParameter<edm::InputTag>("hbheRecHitProducer");
  rhoProducer_               = config.getParameter<edm::InputTag>("rhoProducer");
  doRhoCorrection_           = config.getParameter<bool>("doRhoCorrection");
  rhoMax_                    = config.getParameter<double>("rhoMax"); 
  rhoScale_                  = config.getParameter<double>("rhoScale"); 
  
  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");
  effectiveAreaBarrel_       = config.getParameter<double>("effectiveAreaBarrel");
  effectiveAreaEndcap_       = config.getParameter<double>("effectiveAreaEndcap");
  isolAlgo_                  = new EgammaHLTHcalIsolation(eMinHB,eMinHE,etMinHB,etMinHE,innerCone,outerCone,depth);
 
  
  //register your products
  produces < reco::RecoEcalCandidateIsolationMap >();  
}
EgammaHLTHcalIsolationProducersRegional::~EgammaHLTHcalIsolationProducersRegional ( )

Definition at line 66 of file EgammaHLTHcalIsolationProducersRegional.cc.

References isolAlgo_.

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

Definition at line 41 of file EgammaHLTHcalIsolationProducersRegional.h.

{}

Member Function Documentation

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

Definition at line 42 of file EgammaHLTHcalIsolationProducersRegional.h.

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

Implements edm::EDProducer.

Definition at line 79 of file EgammaHLTHcalIsolationProducersRegional.cc.

References begin, doEtSum_, doRhoCorrection_, effectiveAreaBarrel_, effectiveAreaEndcap_, 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(), recoEcalCandidateProducer_, rho, rhoMax_, rhoProducer_, and rhoScale_.

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

  edm::Handle<double> rhoHandle;
  double rho = 0.0;
  if (doRhoCorrection_) {
    iEvent.getByLabel(rhoProducer_, rhoHandle);
    rho = *(rhoHandle.product());
  }

  if (rho > rhoMax_)
    rho = rhoMax_;

  rho = rho*rhoScale_;

  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());      
     
      if (doRhoCorrection_) {
        if (fabs(recoEcalCandRef->superCluster()->eta()) < 1.442) 
          isol = isol - rho*effectiveAreaBarrel_;
        else
          isol = isol - rho*effectiveAreaEndcap_;
      }
    } 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