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 | Private Attributes
EgammaTowerIsolationProducer Class Reference

#include <EgammaTowerIsolationProducer.h>

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

Public Member Functions

 EgammaTowerIsolationProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaTowerIsolationProducer ()
 
- 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 ()
 

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, 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
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

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 ( )

Definition at line 42 of file EgammaTowerIsolationProducer.cc.

42 {}

Member Function Documentation

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

Implements edm::stream::EDProducerBase.

Definition at line 51 of file EgammaTowerIsolationProducer.cc.

References egHcalDepth_, egHcalIsoConeSizeIn_, egHcalIsoConeSizeOut_, egHcalIsoPtMin_, emObjectProducer_, edm::helper::Filler< Map >::fill(), edm::Event::getByLabel(), i, edm::helper::Filler< Map >::insert(), edm::Handle< T >::product(), edm::Event::put(), towerProducer_, and HLT_25ns10e33_v2_cff::towers.

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  std::auto_ptr<edm::ValueMap<double> > isoMap(new edm::ValueMap<double>());
64  edm::ValueMap<double>::Filler filler(*isoMap);
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(isoMap);
82 
83 }
int i
Definition: DBlmapReader.cc:9
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
T const * product() const
Definition: Handle.h:81

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().