CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EgammaHLTR9Producer Class Reference

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

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

Public Member Functions

 EgammaHLTR9Producer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTR9Producer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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_.

26  : conf_(config)
27 {
28  // use configuration file to setup input/output collection names
29  recoEcalCandidateProducer_ = conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer");
30  ecalRechitEBTag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEB");
31  ecalRechitEETag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEE");
32  useSwissCross_ = conf_.getParameter< bool > ("useSwissCross");
33  //register your products
34  produces < reco::RecoEcalCandidateIsolationMap >();
35 }
T getParameter(std::string const &) const
edm::InputTag ecalRechitEBTag_
edm::InputTag recoEcalCandidateProducer_
edm::ParameterSet conf_
edm::InputTag ecalRechitEETag_
EgammaHLTR9Producer::~EgammaHLTR9Producer ( )

Definition at line 38 of file EgammaHLTR9Producer.cc.

38 {}

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(), first, edm::Event::getByLabel(), EcalClusterLazyTools::getMaximum(), edm::AssociationMap< Tag >::insert(), edm::Event::put(), recoEcalCandidateProducer_, and useSwissCross_.

48 {
49 
50  // Get the HLT filtered objects
52  iEvent.getByLabel(recoEcalCandidateProducer_,recoecalcandHandle);
53 
54  EcalClusterLazyTools lazyTools( iEvent, iSetup, ecalRechitEBTag_, ecalRechitEETag_ );
55 
57 
58  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoecalcandHandle->begin(); iRecoEcalCand != recoecalcandHandle->end(); iRecoEcalCand++){
59 
60  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle,iRecoEcalCand-recoecalcandHandle->begin());
61 
62  float r9 = -1;
63 
64  if (useSwissCross_){
65  // I guess this can be removed completely
66  DetId maxEId = (lazyTools.getMaximum(*(recoecalcandref->superCluster()->seed()) )).first;
67  //float EcalSeverityLevelAlgo::swissCross( const DetId id, const EcalRecHitCollection & recHits, float recHitEtThreshold )
69  iEvent.getByLabel( ecalRechitEBTag_, pEBRecHits );
70  r9 = -1;//EcalSeverityLevelAlgo::swissCross( maxEId, *(pEBRecHits.product()), 0. );
71  }
72  else{
73  float e9 = lazyTools.e3x3( *(recoecalcandref->superCluster()->seed()) );
74  if (e9 != 0 ) {r9 = lazyTools.eMax(*(recoecalcandref->superCluster()->seed()) )/e9;}
75  }
76 
77  r9Map.insert(recoecalcandref, r9);
78 
79  }
80 
81  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> R9Map(new reco::RecoEcalCandidateIsolationMap(r9Map));
82  iEvent.put(R9Map);
83 
84 }
edm::InputTag ecalRechitEBTag_
edm::InputTag recoEcalCandidateProducer_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool first
Definition: L1TdeRCT.cc:79
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
Definition: DetId.h:20
void insert(const key_type &k, const data_type &v)
insert an association
edm::InputTag ecalRechitEETag_

Member Data Documentation

edm::ParameterSet EgammaHLTR9Producer::conf_
private

Definition at line 47 of file EgammaHLTR9Producer.h.

Referenced by EgammaHLTR9Producer().

edm::InputTag EgammaHLTR9Producer::ecalRechitEBTag_
private

Definition at line 43 of file EgammaHLTR9Producer.h.

Referenced by EgammaHLTR9Producer(), and produce().

edm::InputTag EgammaHLTR9Producer::ecalRechitEETag_
private

Definition at line 44 of file EgammaHLTR9Producer.h.

Referenced by EgammaHLTR9Producer(), and produce().

edm::InputTag EgammaHLTR9Producer::recoEcalCandidateProducer_
private

Definition at line 42 of file EgammaHLTR9Producer.h.

Referenced by EgammaHLTR9Producer(), and produce().

bool EgammaHLTR9Producer::useSwissCross_
private

Definition at line 45 of file EgammaHLTR9Producer.h.

Referenced by EgammaHLTR9Producer(), and produce().