CMS 3D CMS Logo

Public Member Functions | Private Attributes

EgammaHLTElectronTrackIsolationProducers Class Reference

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

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

List of all members.

Public Member Functions

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

Private Attributes

edm::ParameterSet conf_
bool egCheckForOtherEleInCone_
double egTrkIsoConeSize_
double egTrkIsoPtMin_
double egTrkIsoRSpan_
double egTrkIsoVetoConeSize_
double egTrkIsoZSpan_
edm::InputTag electronProducer_
EgammaHLTTrackIsolationtest_
edm::InputTag trackProducer_

Detailed Description

Author:
Monica Vazquez Acosta (CERN)
Id:
EgammaHLTElectronTrackIsolationProducers.cc,v 1.8 2010/08/12 15:17:31 sharper Exp

Definition at line 34 of file EgammaHLTElectronTrackIsolationProducers.h.


Constructor & Destructor Documentation

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

Definition at line 33 of file EgammaHLTElectronTrackIsolationProducers.cc.

References conf_, egCheckForOtherEleInCone_, egTrkIsoConeSize_, egTrkIsoPtMin_, egTrkIsoRSpan_, egTrkIsoVetoConeSize_, egTrkIsoZSpan_, electronProducer_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), test_, and trackProducer_.

                                                                                                                : conf_(config)
{

  electronProducer_         = conf_.getParameter<edm::InputTag>("electronProducer");
  trackProducer_                = conf_.getParameter<edm::InputTag>("trackProducer");

  egTrkIsoPtMin_                = conf_.getParameter<double>("egTrkIsoPtMin");
  egTrkIsoConeSize_             = conf_.getParameter<double>("egTrkIsoConeSize");
  egTrkIsoZSpan_                = conf_.getParameter<double>("egTrkIsoZSpan");
  egTrkIsoRSpan_                = conf_.getParameter<double>("egTrkIsoRSpan");
  egTrkIsoVetoConeSize_         = conf_.getParameter<double>("egTrkIsoVetoConeSize");
  egCheckForOtherEleInCone_     = conf_.getUntrackedParameter<bool>("egCheckForOtherEleInCone",false);
  double egTrkIsoStripBarrel    = conf_.getParameter<double>("egTrkIsoStripBarrel");
  double egTrkIsoStripEndcap    = conf_.getParameter<double>("egTrkIsoStripEndcap");

  test_ = new EgammaHLTTrackIsolation(egTrkIsoPtMin_,egTrkIsoConeSize_,
                                      egTrkIsoZSpan_,egTrkIsoRSpan_,egTrkIsoVetoConeSize_,egTrkIsoStripBarrel,egTrkIsoStripEndcap);


  //register your products
  produces < reco::ElectronIsolationMap >();

}
EgammaHLTElectronTrackIsolationProducers::~EgammaHLTElectronTrackIsolationProducers ( )

Definition at line 58 of file EgammaHLTElectronTrackIsolationProducers.cc.

References test_.

{delete test_;}

Member Function Documentation

void EgammaHLTElectronTrackIsolationProducers::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 67 of file EgammaHLTElectronTrackIsolationProducers.cc.

References egCheckForOtherEleInCone_, electronProducer_, EgammaHLTTrackIsolation::electronPtSum(), edm::Event::getByLabel(), edm::AssociationMap< Tag >::insert(), edm::Handle< T >::product(), edm::Event::put(), test_, and trackProducer_.

{

  // Get the HLT filtered objects
  edm::Handle<reco::ElectronCollection> electronHandle;
  iEvent.getByLabel(electronProducer_,electronHandle);

 // Get the general tracks
  edm::Handle<reco::TrackCollection> trackHandle;
  iEvent.getByLabel(trackProducer_, trackHandle);
  const reco::TrackCollection* trackCollection = trackHandle.product();

  reco::ElectronIsolationMap isoMap;

  for(reco::ElectronCollection::const_iterator iElectron = electronHandle->begin(); iElectron != electronHandle->end(); iElectron++){
    
    
    reco::ElectronRef electronref(reco::ElectronRef(electronHandle,iElectron - electronHandle->begin()));
    reco::TrackRef electrontrackref = iElectron->track();
    
    float isol;
    if (!egCheckForOtherEleInCone_) {
      isol = test_->electronPtSum(&(*electrontrackref),trackCollection);
    } else {
      isol = test_->electronPtSum(&(*electrontrackref),electronHandle.product(),trackCollection);
    }
    //if(electronref->pt() != 0. ) isol = isol/electronref->pt();
    
    isoMap.insert(electronref, isol);
      
  }

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

}

Member Data Documentation