CMS 3D CMS Logo

Public Member Functions | Private Attributes

EgammaHLTR9Producer Class Reference

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

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

List of all members.

Public Member Functions

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

Private Attributes

edm::ParameterSet conf_
edm::InputTag ecalRechitEBTag_
edm::InputTag ecalRechitEETag_
edm::InputTag recoEcalCandidateProducer_
bool useSwissCross_

Detailed Description

Author:
Roberto Covarelli (CERN)

$Id:

Definition at line 32 of file EgammaHLTR9Producer.h.


Constructor & Destructor Documentation

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

Definition at line 26 of file EgammaHLTR9Producer.cc.

References conf_, ecalRechitEBTag_, ecalRechitEETag_, edm::ParameterSet::getParameter(), recoEcalCandidateProducer_, and useSwissCross_.

                                                                      : conf_(config)
{
 // use configuration file to setup input/output collection names
  recoEcalCandidateProducer_ = conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer");
  ecalRechitEBTag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEB");
  ecalRechitEETag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEE");
  useSwissCross_   = conf_.getParameter< bool > ("useSwissCross");
  //register your products
  produces < reco::RecoEcalCandidateIsolationMap >();
}
EgammaHLTR9Producer::~EgammaHLTR9Producer ( )

Definition at line 38 of file EgammaHLTR9Producer.cc.

{}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 47 of file EgammaHLTR9Producer.cc.

References EcalClusterLazyTools::e3x3(), ecalRechitEBTag_, ecalRechitEETag_, EcalClusterLazyTools::eMax(), edm::Event::getByLabel(), edm::AssociationMap< Tag >::insert(), edm::Event::put(), recoEcalCandidateProducer_, and useSwissCross_.

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

  EcalClusterLazyTools lazyTools( iEvent, iSetup, ecalRechitEBTag_, ecalRechitEETag_ );
  
  reco::RecoEcalCandidateIsolationMap r9Map;
   
  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoecalcandHandle->begin(); iRecoEcalCand != recoecalcandHandle->end(); iRecoEcalCand++){
    
    reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle,iRecoEcalCand-recoecalcandHandle->begin());

    float r9 = -1;

    if (useSwissCross_){
      // I guess this can be removed completely
      //DetId maxEId = (lazyTools.getMaximum(*(recoecalcandref->superCluster()->seed()) )).first;
      //float EcalSeverityLevelAlgo::swissCross( const DetId id, const EcalRecHitCollection & recHits, float recHitEtThreshold )
      edm::Handle< EcalRecHitCollection > pEBRecHits;
      iEvent.getByLabel( ecalRechitEBTag_, pEBRecHits );
      r9 = -1;//EcalSeverityLevelAlgo::swissCross( maxEId, *(pEBRecHits.product()), 0. );
    }
    else{
    float e9 = lazyTools.e3x3( *(recoecalcandref->superCluster()->seed()) );
    if (e9 != 0 ) {r9 = lazyTools.eMax(*(recoecalcandref->superCluster()->seed())  )/e9;}
    }

    r9Map.insert(recoecalcandref, r9);
    
  }

  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> R9Map(new reco::RecoEcalCandidateIsolationMap(r9Map));
  iEvent.put(R9Map);

}

Member Data Documentation

Definition at line 47 of file EgammaHLTR9Producer.h.

Referenced by EgammaHLTR9Producer().

Definition at line 43 of file EgammaHLTR9Producer.h.

Referenced by EgammaHLTR9Producer(), and produce().

Definition at line 44 of file EgammaHLTR9Producer.h.

Referenced by EgammaHLTR9Producer(), and produce().

Definition at line 42 of file EgammaHLTR9Producer.h.

Referenced by EgammaHLTR9Producer(), and produce().

Definition at line 45 of file EgammaHLTR9Producer.h.

Referenced by EgammaHLTR9Producer(), and produce().