CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
EgammaTowerIsolationProducer Class Reference
Inheritance diagram for EgammaTowerIsolationProducer:
edm::stream::EDProducer<>

Public Member Functions

 EgammaTowerIsolationProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

const signed int egHcalDepth_
 
const double egHcalIsoConeSizeIn_
 
const double egHcalIsoConeSizeOut_
 
const double egHcalIsoPtMin_
 
const edm::EDGetTokenT
< edm::View< reco::Candidate > > 
emObjectProducer_
 
const edm::EDPutTokenT
< edm::ValueMap< double > > 
putToken_
 
const edm::EDGetTokenT
< CaloTowerCollection
towerProducer_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 18 of file EgammaTowerIsolationProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 41 of file EgammaTowerIsolationProducer.cc.

References edm::ParameterSet::getParameter().

42  : emObjectProducer_{consumes(config.getParameter<edm::InputTag>("emObjectProducer"))},
43  towerProducer_{consumes(config.getParameter<edm::InputTag>("towerProducer"))},
44  putToken_{produces<edm::ValueMap<double>>()},
45  egHcalIsoPtMin_{config.getParameter<double>("etMin")},
46  egHcalIsoConeSizeOut_{config.getParameter<double>("extRadius")},
47  egHcalIsoConeSizeIn_{config.getParameter<double>("intRadius")},
48  egHcalDepth_{config.getParameter<int>("Depth")} {}
const edm::EDGetTokenT< edm::View< reco::Candidate > > emObjectProducer_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDPutTokenT< edm::ValueMap< double > > putToken_
const edm::EDGetTokenT< CaloTowerCollection > towerProducer_

Member Function Documentation

void EgammaTowerIsolationProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 50 of file EgammaTowerIsolationProducer.cc.

References egHcalDepth_, egHcalIsoConeSizeIn_, egHcalIsoConeSizeOut_, egHcalIsoPtMin_, emObjectProducer_, edm::Event::emplace(), edm::helper::Filler< Map >::fill(), edm::Event::get(), edm::Event::getHandle(), mps_fire::i, edm::helper::Filler< Map >::insert(), eostools::move(), putToken_, towerProducer_, and HLT_FULL_cff::towers.

50  {
51  // Get the filtered objects
52  auto emObjectHandle = iEvent.getHandle(emObjectProducer_);
53 
54  // Get the barrel hcal hits
55  auto const& towers = iEvent.get(towerProducer_);
56 
57  edm::ValueMap<double> isoMap;
58  edm::ValueMap<double>::Filler filler(isoMap);
59  std::vector<double> retV(emObjectHandle->size(), 0);
60 
61  EgammaTowerIsolation myHadIsolation(
63 
64  for (size_t i = 0; i < emObjectHandle->size(); ++i) {
65  double isoValue = myHadIsolation.getTowerEtSum(&(emObjectHandle->at(i)));
66  retV[i] = isoValue;
67  }
68 
69  filler.insert(emObjectHandle, retV.begin(), retV.end());
70  filler.fill();
71  iEvent.emplace(putToken_, std::move(isoMap));
72 }
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
def move
Definition: eostools.py:511
const edm::EDGetTokenT< edm::View< reco::Candidate > > emObjectProducer_
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:433
const edm::EDPutTokenT< edm::ValueMap< double > > putToken_
const edm::EDGetTokenT< CaloTowerCollection > towerProducer_

Member Data Documentation

const signed int EgammaTowerIsolationProducer::egHcalDepth_
private

Definition at line 35 of file EgammaTowerIsolationProducer.cc.

Referenced by produce().

const double EgammaTowerIsolationProducer::egHcalIsoConeSizeIn_
private

Definition at line 34 of file EgammaTowerIsolationProducer.cc.

Referenced by produce().

const double EgammaTowerIsolationProducer::egHcalIsoConeSizeOut_
private

Definition at line 33 of file EgammaTowerIsolationProducer.cc.

Referenced by produce().

const double EgammaTowerIsolationProducer::egHcalIsoPtMin_
private

Definition at line 32 of file EgammaTowerIsolationProducer.cc.

Referenced by produce().

const edm::EDGetTokenT<edm::View<reco::Candidate> > EgammaTowerIsolationProducer::emObjectProducer_
private

Definition at line 27 of file EgammaTowerIsolationProducer.cc.

Referenced by produce().

const edm::EDPutTokenT<edm::ValueMap<double> > EgammaTowerIsolationProducer::putToken_
private

Definition at line 30 of file EgammaTowerIsolationProducer.cc.

Referenced by produce().

const edm::EDGetTokenT<CaloTowerCollection> EgammaTowerIsolationProducer::towerProducer_
private

Definition at line 28 of file EgammaTowerIsolationProducer.cc.

Referenced by produce().