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::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaTowerIsolationProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaTowerIsolationProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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::EDProducer.

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(), 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  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:84
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
T const * product() const
Definition: Handle.h:74

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