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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 34 of file EgammaTowerIsolationProducer.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file EgammaTowerIsolationProducer.cc.

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

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

Definition at line 42 of file EgammaTowerIsolationProducer.cc.

42 {}

Member Function Documentation

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

Definition at line 51 of file EgammaTowerIsolationProducer.cc.

References egHcalDepth_, egHcalIsoConeSizeIn_, egHcalIsoConeSizeOut_, egHcalIsoPtMin_, emObjectProducer_, objects.autophobj::filler, edm::Event::getByLabel(), mps_fire::i, eostools::move(), edm::Handle< T >::product(), edm::Event::put(), and towerProducer_.

52 {
53 
54  // Get the filtered objects
56  iEvent.getByLabel(emObjectProducer_,emObjectHandle);
57 
58  // Get the barrel hcal hits
60  iEvent.getByLabel(towerProducer_, towerHandle);
61  const CaloTowerCollection* towers = towerHandle.product();
62 
63  auto isoMap = std::make_unique<edm::ValueMap<double>>();
65  std::vector<double> retV(emObjectHandle->size(),0);
66 
70  egHcalDepth_,
71  towers) ;
72 
73 
74  for( size_t i = 0 ; i < emObjectHandle->size(); ++i) {
75  double isoValue = myHadIsolation.getTowerEtSum(&(emObjectHandle->at(i)));
76  retV[i]=isoValue;
77  }
78 
79  filler.insert(emObjectHandle,retV.begin(),retV.end());
80  filler.fill();
81  iEvent.put(std::move(isoMap));
82 
83 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
T const * product() const
Definition: Handle.h:81
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::ParameterSet EgammaTowerIsolationProducer::conf_
private

Definition at line 52 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer().

signed int EgammaTowerIsolationProducer::egHcalDepth_
private

Definition at line 50 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

double EgammaTowerIsolationProducer::egHcalIsoConeSizeIn_
private

Definition at line 49 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

double EgammaTowerIsolationProducer::egHcalIsoConeSizeOut_
private

Definition at line 48 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

double EgammaTowerIsolationProducer::egHcalIsoPtMin_
private

Definition at line 47 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

edm::InputTag EgammaTowerIsolationProducer::emObjectProducer_
private

Definition at line 44 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

edm::InputTag EgammaTowerIsolationProducer::towerProducer_
private

Definition at line 45 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().