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
EgammaHLTHcalIsolationDoubleConeProducers Class Reference

#include <RecoEgamma/EgammaHLTProducers/interface/EgammaHLTHcalIsolationDoubleConeProducers.h>

Inheritance diagram for EgammaHLTHcalIsolationDoubleConeProducers:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTHcalIsolationDoubleConeProducers (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTHcalIsolationDoubleConeProducers ()
 
- 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_
 
double egHcalExclusion_
 
double egHcalIsoConeSize_
 
double egHcalIsoPtMin_
 
edm::InputTag hbRecHitProducer_
 
edm::InputTag hfRecHitProducer_
 
edm::InputTag recoEcalCandidateProducer_
 
EgammaHLTHcalIsolationDoubleConetest_
 

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)
 
static void prevalidate (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 36 of file EgammaHLTHcalIsolationDoubleConeProducers.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file EgammaHLTHcalIsolationDoubleConeProducers.cc.

References conf_, egHcalExclusion_, egHcalIsoConeSize_, egHcalIsoPtMin_, edm::ParameterSet::getParameter(), hbRecHitProducer_, hfRecHitProducer_, recoEcalCandidateProducer_, and test_.

36  : conf_(config)
37 {
38  // use configuration file to setup input/output collection names
39  recoEcalCandidateProducer_ = conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer");
40 
41  hbRecHitProducer_ = conf_.getParameter<edm::InputTag>("hbRecHitProducer");
42  hfRecHitProducer_ = conf_.getParameter<edm::InputTag>("hfRecHitProducer");
43 
44  egHcalIsoPtMin_ = conf_.getParameter<double>("egHcalIsoPtMin");
45  egHcalIsoConeSize_ = conf_.getParameter<double>("egHcalIsoConeSize");
46  egHcalExclusion_ = conf_.getParameter<double>("egHcalExclusion");
47 
48  test_ = new EgammaHLTHcalIsolationDoubleCone(egHcalIsoPtMin_,egHcalIsoConeSize_,egHcalExclusion_);
49 
50 
51  //register your products
52  produces < reco::RecoEcalCandidateIsolationMap >();
53 }
T getParameter(std::string const &) const
EgammaHLTHcalIsolationDoubleConeProducers::~EgammaHLTHcalIsolationDoubleConeProducers ( )

Definition at line 56 of file EgammaHLTHcalIsolationDoubleConeProducers.cc.

References test_.

56 {delete test_;}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 65 of file EgammaHLTHcalIsolationDoubleConeProducers.cc.

References begin, edm::EventSetup::get(), edm::Event::getByLabel(), hbRecHitProducer_, hfRecHitProducer_, edm::AssociationMap< Tag >::insert(), EgammaHLTHcalIsolationDoubleCone::isolPtSum(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), edm::Event::put(), recoEcalCandidateProducer_, and test_.

66 {
67  // std::cout << "YYY" << egHcalIsoConeSize_ << " " << egHcalExclusion_ <<std::endl;
68  // Get the HLT filtered objects
70  iEvent.getByLabel(recoEcalCandidateProducer_,recoecalcandHandle);
71 
72  // Get the barrel hcal hits
73  edm::Handle<HBHERecHitCollection> hhitBarrelHandle;
74  iEvent.getByLabel(hbRecHitProducer_, hhitBarrelHandle);
75  const HBHERecHitCollection* hcalhitBarrelCollection = hhitBarrelHandle.product();
76  // Get the forward hcal hits
77  edm::Handle<HFRecHitCollection> hhitEndcapHandle;
78  iEvent.getByLabel(hfRecHitProducer_, hhitEndcapHandle);
79  const HFRecHitCollection* hcalhitEndcapCollection = hhitEndcapHandle.product();
80  //Get Calo Geometry
82  iSetup.get<CaloGeometryRecord>().get(pG);
83  const CaloGeometry* caloGeom = pG.product();
84 
86 
87 
88  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoecalcandHandle->begin(); iRecoEcalCand != recoecalcandHandle->end(); iRecoEcalCand++){
89 
90  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle,iRecoEcalCand -recoecalcandHandle ->begin());
91 
92  const reco::RecoCandidate *tempiRecoEcalCand = &(*recoecalcandref);
93  float isol = test_->isolPtSum(tempiRecoEcalCand,hcalhitBarrelCollection,hcalhitEndcapCollection,caloGeom);
94 
95  isoMap.insert(recoecalcandref, isol);
96  // std::cout << isol << std::endl;
97  }
98 
99  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
100  iEvent.put(isolMap);
101 
102 }
float isolPtSum(const reco::RecoCandidate *recocandidate, const HBHERecHitCollection *hbhe, const HFRecHitCollection *hf, const CaloGeometry *geometry)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void insert(const key_type &k, const data_type &v)
insert an association
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:74
#define begin
Definition: vmac.h:31

Member Data Documentation

edm::ParameterSet EgammaHLTHcalIsolationDoubleConeProducers::conf_
private
double EgammaHLTHcalIsolationDoubleConeProducers::egHcalExclusion_
private
double EgammaHLTHcalIsolationDoubleConeProducers::egHcalIsoConeSize_
private
double EgammaHLTHcalIsolationDoubleConeProducers::egHcalIsoPtMin_
private
edm::InputTag EgammaHLTHcalIsolationDoubleConeProducers::hbRecHitProducer_
private
edm::InputTag EgammaHLTHcalIsolationDoubleConeProducers::hfRecHitProducer_
private
edm::InputTag EgammaHLTHcalIsolationDoubleConeProducers::recoEcalCandidateProducer_
private
EgammaHLTHcalIsolationDoubleCone* EgammaHLTHcalIsolationDoubleConeProducers::test_
private