CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EgammaTowerIsolationProducer Class Reference

#include <EgammaTowerIsolationProducer.h>

Inheritance diagram for EgammaTowerIsolationProducer:
edm::stream::EDProducer<>

Public Member Functions

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

Private Attributes

edm::ParameterSet conf_
 
signed int egHcalDepth_
 
double egHcalIsoConeSizeIn_
 
double egHcalIsoConeSizeOut_
 
double egHcalIsoPtMin_
 
edm::InputTag emObjectProducer_
 
edm::InputTag towerProducer_
 

Additional Inherited Members

- 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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 33 of file EgammaTowerIsolationProducer.h.

Constructor & Destructor Documentation

◆ EgammaTowerIsolationProducer()

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

Definition at line 22 of file EgammaTowerIsolationProducer.cc.

22  : conf_(config) {
23  // use configuration file to setup input/output collection names
24  emObjectProducer_ = conf_.getParameter<edm::InputTag>("emObjectProducer");
25 
26  towerProducer_ = conf_.getParameter<edm::InputTag>("towerProducer");
27 
28  egHcalIsoPtMin_ = conf_.getParameter<double>("etMin");
29  egHcalIsoConeSizeIn_ = conf_.getParameter<double>("intRadius");
30  egHcalIsoConeSizeOut_ = conf_.getParameter<double>("extRadius");
31  egHcalDepth_ = conf_.getParameter<int>("Depth");
32 
33  //register your products
34  produces<edm::ValueMap<double>>();
35 }

References conf_, egHcalDepth_, egHcalIsoConeSizeIn_, egHcalIsoConeSizeOut_, egHcalIsoPtMin_, emObjectProducer_, edm::ParameterSet::getParameter(), and towerProducer_.

◆ ~EgammaTowerIsolationProducer()

EgammaTowerIsolationProducer::~EgammaTowerIsolationProducer ( )
override

Definition at line 37 of file EgammaTowerIsolationProducer.cc.

37 {}

Member Function Documentation

◆ produce()

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

Definition at line 44 of file EgammaTowerIsolationProducer.cc.

44  {
45  // Get the filtered objects
47  iEvent.getByLabel(emObjectProducer_, emObjectHandle);
48 
49  // Get the barrel hcal hits
51  iEvent.getByLabel(towerProducer_, towerHandle);
52  const CaloTowerCollection* towers = towerHandle.product();
53 
54  auto isoMap = std::make_unique<edm::ValueMap<double>>();
56  std::vector<double> retV(emObjectHandle->size(), 0);
57 
58  EgammaTowerIsolation myHadIsolation(
60 
61  for (size_t i = 0; i < emObjectHandle->size(); ++i) {
62  double isoValue = myHadIsolation.getTowerEtSum(&(emObjectHandle->at(i)));
63  retV[i] = isoValue;
64  }
65 
66  filler.insert(emObjectHandle, retV.begin(), retV.end());
67  filler.fill();
68  iEvent.put(std::move(isoMap));
69 }

References egHcalDepth_, egHcalIsoConeSizeIn_, egHcalIsoConeSizeOut_, egHcalIsoPtMin_, emObjectProducer_, trigObjTnPSource_cfi::filler, mps_fire::i, iEvent, eostools::move(), edm::Handle< T >::product(), towerProducer_, and HLT_FULL_cff::towers.

Member Data Documentation

◆ conf_

edm::ParameterSet EgammaTowerIsolationProducer::conf_
private

Definition at line 51 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer().

◆ egHcalDepth_

signed int EgammaTowerIsolationProducer::egHcalDepth_
private

Definition at line 49 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

◆ egHcalIsoConeSizeIn_

double EgammaTowerIsolationProducer::egHcalIsoConeSizeIn_
private

Definition at line 48 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

◆ egHcalIsoConeSizeOut_

double EgammaTowerIsolationProducer::egHcalIsoConeSizeOut_
private

Definition at line 47 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

◆ egHcalIsoPtMin_

double EgammaTowerIsolationProducer::egHcalIsoPtMin_
private

Definition at line 46 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

◆ emObjectProducer_

edm::InputTag EgammaTowerIsolationProducer::emObjectProducer_
private

Definition at line 43 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

◆ towerProducer_

edm::InputTag EgammaTowerIsolationProducer::towerProducer_
private

Definition at line 44 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

EgammaTowerIsolationProducer::towerProducer_
edm::InputTag towerProducer_
Definition: EgammaTowerIsolationProducer.h:44
HLT_FULL_cff.towers
towers
Definition: HLT_FULL_cff.py:36362
mps_fire.i
i
Definition: mps_fire.py:428
EgammaTowerIsolationProducer::egHcalIsoConeSizeOut_
double egHcalIsoConeSizeOut_
Definition: EgammaTowerIsolationProducer.h:47
edm::Handle::product
T const * product() const
Definition: Handle.h:70
EgammaTowerIsolationProducer::egHcalIsoPtMin_
double egHcalIsoPtMin_
Definition: EgammaTowerIsolationProducer.h:46
edm::SortedCollection< CaloTower >
edm::Handle
Definition: AssociativeIterator.h:50
config
Definition: config.py:1
EgammaTowerIsolationProducer::egHcalDepth_
signed int egHcalDepth_
Definition: EgammaTowerIsolationProducer.h:49
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
EgammaTowerIsolation
Definition: EgammaTowerIsolation.h:197
iEvent
int iEvent
Definition: GenABIO.cc:224
EgammaTowerIsolationProducer::conf_
edm::ParameterSet conf_
Definition: EgammaTowerIsolationProducer.h:51
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::helper::Filler
Definition: ValueMap.h:22
EgammaTowerIsolationProducer::emObjectProducer_
edm::InputTag emObjectProducer_
Definition: EgammaTowerIsolationProducer.h:43
EgammaTowerIsolationProducer::egHcalIsoConeSizeIn_
double egHcalIsoConeSizeIn_
Definition: EgammaTowerIsolationProducer.h:48
edm::InputTag
Definition: InputTag.h:15