CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
EgammaHcalPFClusterIsolationProducer< T1 > Class Template Reference

#include <EgammaHcalPFClusterIsolationProducer.h>

Inheritance diagram for EgammaHcalPFClusterIsolationProducer< T1 >:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef std::vector< T1 > T1Collection
 
typedef edm::Ref< T1CollectionT1Ref
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 EgammaHcalPFClusterIsolationProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHcalPFClusterIsolationProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::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::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const double drMax_
 
const double drVetoBarrel_
 
const double drVetoEndcap_
 
const edm::EDGetTokenT
< T1Collection
emObjectProducer_
 
const double energyBarrel_
 
const double energyEndcap_
 
const double etaStripBarrel_
 
const double etaStripEndcap_
 
const edm::EDGetTokenT
< reco::PFClusterCollection
pfClusterProducerHCAL_
 
const edm::EDGetTokenT
< reco::PFClusterCollection
pfClusterProducerHFEM_
 
const edm::EDGetTokenT
< reco::PFClusterCollection
pfClusterProducerHFHAD_
 
const double useEt_
 
const bool useHF_
 

Additional Inherited Members

- 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

template<typename T1>
class EgammaHcalPFClusterIsolationProducer< T1 >

Definition at line 21 of file EgammaHcalPFClusterIsolationProducer.h.

Member Typedef Documentation

template<typename T1 >
typedef std::vector<T1> EgammaHcalPFClusterIsolationProducer< T1 >::T1Collection

Definition at line 24 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
typedef edm::Ref<T1Collection> EgammaHcalPFClusterIsolationProducer< T1 >::T1Ref

Definition at line 25 of file EgammaHcalPFClusterIsolationProducer.h.

Constructor & Destructor Documentation

template<typename T1 >
EgammaHcalPFClusterIsolationProducer< T1 >::EgammaHcalPFClusterIsolationProducer ( const edm::ParameterSet config)
explicit

Definition at line 23 of file EgammaHcalPFClusterIsolationProducer.cc.

23  :
24 
25  emObjectProducer_ (consumes<T1Collection>(config.getParameter<edm::InputTag>("candidateProducer"))),
26  pfClusterProducerHCAL_ (consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHCAL"))),
27  pfClusterProducerHFEM_ (consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFEM"))),
28  pfClusterProducerHFHAD_ (consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFHAD"))),
29  useHF_ (config.getParameter<bool>("useHF")),
30  drMax_ (config.getParameter<double>("drMax")),
31  drVetoBarrel_ (config.getParameter<double>("drVetoBarrel")),
32  drVetoEndcap_ (config.getParameter<double>("drVetoEndcap")),
33  etaStripBarrel_ (config.getParameter<double>("etaStripBarrel")),
34  etaStripEndcap_ (config.getParameter<double>("etaStripEndcap")),
35  energyBarrel_ (config.getParameter<double>("energyBarrel")),
36  energyEndcap_ (config.getParameter<double>("energyEndcap")),
37  useEt_ (config.getParameter<bool>("useEt")) {
38 
39  produces <edm::ValueMap<float>>();
40 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFEM_
const edm::EDGetTokenT< T1Collection > emObjectProducer_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFHAD_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHCAL_

Definition at line 43 of file EgammaHcalPFClusterIsolationProducer.cc.

44 {}

Member Function Documentation

template<typename T1 >
void EgammaHcalPFClusterIsolationProducer< T1 >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 47 of file EgammaHcalPFClusterIsolationProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), edm::ParameterSetDescription::ifValue(), HLT_FULL_cff::InputTag, and or.

47  {
48 
50  desc.add<edm::InputTag>("candidateProducer", edm::InputTag("gedGsfElectrons"));
51  desc.add<edm::InputTag>("pfClusterProducerHCAL", edm::InputTag("particleFlowClusterHCAL"));
52  desc.ifValue(edm::ParameterDescription<bool>("useHF", false, true),
53  true >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag("hltParticleFlowClusterHFEM"), true) and
54  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag("hltParticleFlowClusterHFHAD"), true)) or
55  false >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag(""), true) and
56  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag(""), true)));
57  desc.add<double>("drMax", 0.3);
58  desc.add<double>("drVetoBarrel", 0.0);
59  desc.add<double>("drVetoEndcap", 0.0);
60  desc.add<double>("etaStripBarrel", 0.0);
61  desc.add<double>("etaStripEndcap", 0.0);
62  desc.add<double>("energyBarrel", 0.0);
63  desc.add<double>("energyEndcap", 0.0);
64  desc.add<bool>("useEt", true);
66 }
std::string defaultModuleLabel()
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::auto_ptr< ParameterDescriptionCases< T > > cases)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T1 >
void EgammaHcalPFClusterIsolationProducer< T1 >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 69 of file EgammaHcalPFClusterIsolationProducer.cc.

References edm::helper::Filler< Map >::fill(), edm::Event::getByToken(), HcalPFClusterIsolation< T1 >::getSum(), edm::helper::Filler< Map >::insert(), and edm::Event::put().

69  {
70 
71  edm::Handle<T1Collection> emObjectHandle;
72  iEvent.getByToken(emObjectProducer_, emObjectHandle);
73 
74  std::auto_ptr<edm::ValueMap<float> > isoMap(new edm::ValueMap<float>());
75  edm::ValueMap<float>::Filler filler(*isoMap);
76  std::vector<float> retV(emObjectHandle->size(),0);
77 
78  std::vector<edm::Handle<reco::PFClusterCollection>> clusterHandles;
80  iEvent.getByToken(pfClusterProducerHCAL_, clusterHandle);
81  clusterHandles.push_back(clusterHandle);
82 
83  if (useHF_) {
85  iEvent.getByToken(pfClusterProducerHFEM_, clusterHandle);
86  clusterHandles.push_back(clusterHandle);
87 
88  iEvent.getByToken(pfClusterProducerHFHAD_, clusterHandle);
89  clusterHandles.push_back(clusterHandle);
90  }
91 
93 
94  for (unsigned int iReco = 0; iReco < emObjectHandle->size(); iReco++) {
95  T1Ref candRef(emObjectHandle, iReco);
96  retV[iReco] = isoAlgo.getSum(candRef, clusterHandles);
97  }
98 
99  filler.insert(emObjectHandle,retV.begin(),retV.end());
100  filler.fill();
101 
102  iEvent.put(isoMap);
103 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFEM_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
const edm::EDGetTokenT< T1Collection > emObjectProducer_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFHAD_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHCAL_

Member Data Documentation

template<typename T1 >
const double EgammaHcalPFClusterIsolationProducer< T1 >::drMax_
private

Definition at line 39 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const double EgammaHcalPFClusterIsolationProducer< T1 >::drVetoBarrel_
private

Definition at line 40 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const double EgammaHcalPFClusterIsolationProducer< T1 >::drVetoEndcap_
private

Definition at line 41 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const edm::EDGetTokenT<T1Collection> EgammaHcalPFClusterIsolationProducer< T1 >::emObjectProducer_
private

Definition at line 33 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const double EgammaHcalPFClusterIsolationProducer< T1 >::energyBarrel_
private

Definition at line 44 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const double EgammaHcalPFClusterIsolationProducer< T1 >::energyEndcap_
private

Definition at line 45 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const double EgammaHcalPFClusterIsolationProducer< T1 >::etaStripBarrel_
private

Definition at line 42 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const double EgammaHcalPFClusterIsolationProducer< T1 >::etaStripEndcap_
private

Definition at line 43 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const edm::EDGetTokenT<reco::PFClusterCollection> EgammaHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHCAL_
private

Definition at line 34 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const edm::EDGetTokenT<reco::PFClusterCollection> EgammaHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHFEM_
private

Definition at line 35 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const edm::EDGetTokenT<reco::PFClusterCollection> EgammaHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHFHAD_
private

Definition at line 36 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const double EgammaHcalPFClusterIsolationProducer< T1 >::useEt_
private

Definition at line 46 of file EgammaHcalPFClusterIsolationProducer.h.

template<typename T1 >
const bool EgammaHcalPFClusterIsolationProducer< T1 >::useHF_
private

Definition at line 38 of file EgammaHcalPFClusterIsolationProducer.h.