CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

EgammaHLTBcHcalIsolationProducersRegional Class Reference

#include <EgammaHLTBcHcalIsolationProducersRegional.h>

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

List of all members.

Public Member Functions

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

Private Member Functions

 EgammaHLTBcHcalIsolationProducersRegional (const EgammaHLTBcHcalIsolationProducersRegional &rhs)
EgammaHLTBcHcalIsolationProducersRegionaloperator= (const EgammaHLTBcHcalIsolationProducersRegional &rhs)

Private Attributes

edm::InputTag caloTowerProducer_
int depth_
bool doEtSum_
bool doRhoCorrection_
float effectiveAreaBarrel_
float effectiveAreaEndcap_
float etMin_
ElectronHcalHelper::Configuration hcalCfg_
ElectronHcalHelperhcalHelper_
float innerCone_
float outerCone_
edm::InputTag recoEcalCandidateProducer_
float rhoMax_
edm::InputTag rhoProducer_
float rhoScale_

Detailed Description

Definition at line 26 of file EgammaHLTBcHcalIsolationProducersRegional.h.


Constructor & Destructor Documentation

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

Definition at line 36 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

References caloTowerProducer_, depth_, doEtSum_, doRhoCorrection_, effectiveAreaBarrel_, effectiveAreaEndcap_, etMin_, edm::ParameterSet::getParameter(), hcalCfg_, hcalHelper_, ElectronHcalHelper::Configuration::hcalTowers, ElectronHcalHelper::Configuration::hOverEConeSize, ElectronHcalHelper::Configuration::hOverEPtMin, innerCone_, outerCone_, recoEcalCandidateProducer_, rhoMax_, rhoProducer_, rhoScale_, and ElectronHcalHelper::Configuration::useTowers.

                                                                                                                  {

  recoEcalCandidateProducer_ = config.getParameter<edm::InputTag>("recoEcalCandidateProducer");
  caloTowerProducer_         = config.getParameter<edm::InputTag>("caloTowerProducer");
  rhoProducer_               = config.getParameter<edm::InputTag>("rhoProducer");
  doRhoCorrection_           = config.getParameter<bool>("doRhoCorrection");
  rhoMax_                    = config.getParameter<double>("rhoMax"); 
  rhoScale_                  = config.getParameter<double>("rhoScale"); 

  etMin_                     = config.getParameter<double>("etMin");  
  innerCone_                 = config.getParameter<double>("innerCone");
  outerCone_                 = config.getParameter<double>("outerCone");
  depth_                     = config.getParameter<int>("depth");
  doEtSum_                   = config.getParameter<bool>("doEtSum"); //this variable (which I cant change the name of) switches between hcal isolation and H for H/E
  effectiveAreaBarrel_       = config.getParameter<double>("effectiveAreaBarrel");
  effectiveAreaEndcap_       = config.getParameter<double>("effectiveAreaEndcap");
  
  hcalCfg_.hOverEConeSize = 0.15;
  hcalCfg_.useTowers = true;
  hcalCfg_.hcalTowers = caloTowerProducer_;
  hcalCfg_.hOverEPtMin = etMin_;

  hcalHelper_ = new ElectronHcalHelper(hcalCfg_);

  produces <reco::RecoEcalCandidateIsolationMap>(); 
}
EgammaHLTBcHcalIsolationProducersRegional::~EgammaHLTBcHcalIsolationProducersRegional ( )

Definition at line 63 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

References hcalHelper_.

                                                                                      {
  delete hcalHelper_;
}
EgammaHLTBcHcalIsolationProducersRegional::EgammaHLTBcHcalIsolationProducersRegional ( const EgammaHLTBcHcalIsolationProducersRegional rhs) [inline, private]

Definition at line 33 of file EgammaHLTBcHcalIsolationProducersRegional.h.

{}

Member Function Documentation

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

Definition at line 34 of file EgammaHLTBcHcalIsolationProducersRegional.h.

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

Implements edm::EDProducer.

Definition at line 68 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

References caloTowerProducer_, ElectronHcalHelper::checkSetup(), depth_, doEtSum_, doRhoCorrection_, effectiveAreaBarrel_, effectiveAreaEndcap_, etMin_, edm::Event::getByLabel(), EgammaTowerIsolation::getTowerEtSum(), ElectronHcalHelper::hcalESumDepth1BehindClusters(), ElectronHcalHelper::hcalESumDepth2BehindClusters(), hcalHelper_, ElectronHcalHelper::hcalTowersBehindClusters(), innerCone_, edm::AssociationMap< Tag >::insert(), outerCone_, edm::Handle< T >::product(), edm::Event::put(), ElectronHcalHelper::readEvent(), recoEcalCandidateProducer_, rho, rhoMax_, rhoProducer_, and rhoScale_.

                                                                                                     {

  // Get the HLT filtered objects
  edm::Handle<reco::RecoEcalCandidateCollection> recoEcalCandHandle;
  iEvent.getByLabel(recoEcalCandidateProducer_, recoEcalCandHandle);

  edm::Handle<CaloTowerCollection> caloTowersHandle;
  iEvent.getByLabel(caloTowerProducer_, caloTowersHandle);

  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_;
  
  hcalHelper_->checkSetup(iSetup);
  hcalHelper_->readEvent(iEvent);

  reco::RecoEcalCandidateIsolationMap isoMap;
  
  for(unsigned int iRecoEcalCand=0; iRecoEcalCand <recoEcalCandHandle->size(); iRecoEcalCand++) {
    
    reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle, iRecoEcalCand);
    
    float isol = 0;
    
    std::vector<CaloTowerDetId> towersBehindCluster = hcalHelper_->hcalTowersBehindClusters(*(recoEcalCandRef->superCluster()));
    
    if (doEtSum_) { //calculate hcal isolation excluding the towers behind the cluster which will be used for H for H/E
      EgammaTowerIsolation isolAlgo(outerCone_, innerCone_, etMin_, depth_, caloTowersHandle.product());
      isol = isolAlgo.getTowerEtSum(&(*recoEcalCandRef), &(towersBehindCluster)); // towersBehindCluster are excluded from the isolation sum
      
      if (doRhoCorrection_) {
        if (fabs(recoEcalCandRef->superCluster()->eta()) < 1.442) 
          isol = isol - rho*effectiveAreaBarrel_;
        else
          isol = isol - rho*effectiveAreaEndcap_;
      }
    } else { //calcuate H for H/E
      isol = hcalHelper_->hcalESumDepth1BehindClusters(towersBehindCluster) + hcalHelper_->hcalESumDepth2BehindClusters(towersBehindCluster); //towers beind the cluster are for H for H/E
    }

    isoMap.insert(recoEcalCandRef, isol);
  }
  
  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
  iEvent.put(isolMap);
}

Member Data Documentation