CMS 3D CMS Logo

Public Member Functions | Private Attributes

EgammaHLTPhotonTrackIsolationProducersRegional Class Reference

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

Inheritance diagram for EgammaHLTPhotonTrackIsolationProducersRegional:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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

Private Attributes

edm::ParameterSet conf_
bool countTracks_
double egTrkIsoConeSize_
double egTrkIsoPtMin_
double egTrkIsoRSpan_
double egTrkIsoVetoConeSize_
double egTrkIsoZSpan_
edm::InputTag recoEcalCandidateProducer_
EgammaHLTTrackIsolationtest_
edm::InputTag trackProducer_

Detailed Description

Author:
Monica Vazquez Acosta (CERN)

$Id:

Definition at line 34 of file EgammaHLTPhotonTrackIsolationProducersRegional.h.


Constructor & Destructor Documentation

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

Definition at line 33 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

References conf_, countTracks_, egTrkIsoConeSize_, egTrkIsoPtMin_, egTrkIsoRSpan_, egTrkIsoVetoConeSize_, egTrkIsoZSpan_, edm::ParameterSet::getParameter(), recoEcalCandidateProducer_, test_, and trackProducer_.

                                                                                                                            : conf_(config)
{

  recoEcalCandidateProducer_    = conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer");
  trackProducer_                = conf_.getParameter<edm::InputTag>("trackProducer");

  countTracks_                  = conf_.getParameter<bool>("countTracks");

  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");
 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::RecoEcalCandidateIsolationMap >();

}
EgammaHLTPhotonTrackIsolationProducersRegional::~EgammaHLTPhotonTrackIsolationProducersRegional ( )

Definition at line 60 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

References test_.

{delete test_;}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 69 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

References begin, countTracks_, edm::Event::getByLabel(), edm::AssociationMap< Tag >::insert(), EgammaHLTTrackIsolation::photonPtSum(), EgammaHLTTrackIsolation::photonTrackCount(), edm::Handle< T >::product(), edm::Event::put(), recoEcalCandidateProducer_, test_, and trackProducer_.

{

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

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


  reco::RecoEcalCandidateIsolationMap isoMap;



 for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoecalcandHandle->begin(); iRecoEcalCand != recoecalcandHandle->end(); iRecoEcalCand++){
    
    reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle,iRecoEcalCand -recoecalcandHandle ->begin());
    const reco::RecoCandidate *tempiRecoEcalCand = &(*recoecalcandref);

    bool usePhotonVertex = false;
     
    float isol;
    if (countTracks_) {
      isol = test_->photonTrackCount(tempiRecoEcalCand,trackCollection,usePhotonVertex);
    } else {
      isol = test_->photonPtSum(tempiRecoEcalCand,trackCollection,usePhotonVertex);
    }

    isoMap.insert(recoecalcandref, isol);

  }

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

}

Member Data Documentation