test
CMS 3D CMS Logo

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

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

Inheritance diagram for EgammaHLTR9Producer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTR9Producer (const edm::ParameterSet &)
 
void produce (edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
 
 ~EgammaHLTR9Producer ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::EDGetTokenT
< EcalRecHitCollection
ecalRechitEBToken_
 
const edm::EDGetTokenT
< EcalRecHitCollection
ecalRechitEEToken_
 
const edm::EDGetTokenT
< reco::RecoEcalCandidateCollection
recoEcalCandidateProducer_
 
const bool useSwissCross_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Author
Roberto Covarelli (CERN)

$Id:

Definition at line 40 of file EgammaHLTR9Producer.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file EgammaHLTR9Producer.cc.

17  :
18  recoEcalCandidateProducer_(consumes<reco::RecoEcalCandidateCollection> (config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
19  ecalRechitEBToken_(consumes<EcalRecHitCollection>(config.getParameter< edm::InputTag > ("ecalRechitEB"))),
20  ecalRechitEEToken_(consumes<EcalRecHitCollection>(config.getParameter< edm::InputTag > ("ecalRechitEE"))),
21  useSwissCross_(config.getParameter< bool > ("useSwissCross")) {
22 
23  //register your products
24  produces < reco::RecoEcalCandidateIsolationMap >();
25 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEBToken_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEEToken_
EgammaHLTR9Producer::~EgammaHLTR9Producer ( )

Definition at line 27 of file EgammaHLTR9Producer.cc.

28 {}

Member Function Documentation

void EgammaHLTR9Producer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 32 of file EgammaHLTR9Producer.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

32  {
33 
35  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltRecoEcalCandidate"));
36  desc.add<edm::InputTag>(("ecalRechitEB"), edm::InputTag("hltEcalRegionalEgammaRecHit","EcalRecHitsEB"));
37  desc.add<edm::InputTag>(("ecalRechitEE"), edm::InputTag("hltEcalRegionalEgammaRecHit","EcalRecHitsEE"));
38  desc.add<bool> (("useSwissCross"), false);
39  descriptions.add(("hltEgammaHLTR9Producer"), desc);
40 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTR9Producer::produce ( edm::StreamID  sid,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 43 of file EgammaHLTR9Producer.cc.

References ecalRechitEBToken_, ecalRechitEEToken_, edm::Event::getByToken(), edm::AssociationMap< Tag >::insert(), edm::Event::put(), recoEcalCandidateProducer_, and useSwissCross_.

43  {
44 
45  // Get the HLT filtered objects
47  iEvent.getByToken(recoEcalCandidateProducer_,recoecalcandHandle);
48 
50 
52 
53  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoecalcandHandle->begin(); iRecoEcalCand != recoecalcandHandle->end(); iRecoEcalCand++){
54 
55  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle,iRecoEcalCand-recoecalcandHandle->begin());
56 
57  float r9 = -1;
58 
59  if (useSwissCross_){
61  iEvent.getByToken(ecalRechitEBToken_, pEBRecHits);
62  r9 = -1;
63  }
64  else{
65  float e9 = lazyTools.e3x3( *(recoecalcandref->superCluster()->seed()) );
66  if (e9 != 0 ) {r9 = lazyTools.eMax(*(recoecalcandref->superCluster()->seed()) )/e9;}
67  }
68 
69  r9Map.insert(recoecalcandref, r9);
70 
71  }
72 
73  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> R9Map(new reco::RecoEcalCandidateIsolationMap(r9Map));
74  iEvent.put(R9Map);
75 
76 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEBToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEEToken_
void insert(const key_type &k, const data_type &v)
insert an association

Member Data Documentation

const edm::EDGetTokenT<EcalRecHitCollection> EgammaHLTR9Producer::ecalRechitEBToken_
private

Definition at line 52 of file EgammaHLTR9Producer.h.

Referenced by produce().

const edm::EDGetTokenT<EcalRecHitCollection> EgammaHLTR9Producer::ecalRechitEEToken_
private

Definition at line 53 of file EgammaHLTR9Producer.h.

Referenced by produce().

const edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTR9Producer::recoEcalCandidateProducer_
private

Definition at line 51 of file EgammaHLTR9Producer.h.

Referenced by produce().

const bool EgammaHLTR9Producer::useSwissCross_
private

Definition at line 55 of file EgammaHLTR9Producer.h.

Referenced by produce().