CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
EgammaHLTHcalIsolationDoubleConeProducers Class Reference

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

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

Public Member Functions

 EgammaHLTHcalIsolationDoubleConeProducers (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~EgammaHLTHcalIsolationDoubleConeProducers ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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 (const std::string &iProcessName, std::vector< const char * > &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 ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::ParameterSet conf_
 
double egHcalExclusion_
 
double egHcalIsoConeSize_
 
double egHcalIsoPtMin_
 
edm::EDGetTokenT
< HBHERecHitCollection
hbRecHitProducer_
 
edm::EDGetTokenT
< HFRecHitCollection
hfRecHitProducer_
 
edm::EDGetTokenT
< reco::RecoEcalCandidateCollection
recoEcalCandidateProducer_
 
EgammaHLTHcalIsolationDoubleConetest_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 37 of file EgammaHLTHcalIsolationDoubleConeProducers.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file EgammaHLTHcalIsolationDoubleConeProducers.cc.

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

23  : conf_(config)
24 {
25  // use configuration file to setup input/output collection names
26  recoEcalCandidateProducer_ = consumes<reco::RecoEcalCandidateCollection>(conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer"));
27  hbRecHitProducer_ = consumes<HBHERecHitCollection>(conf_.getParameter<edm::InputTag>("hbRecHitProducer"));
28  hfRecHitProducer_ = consumes<HFRecHitCollection>(conf_.getParameter<edm::InputTag>("hfRecHitProducer"));
29 
30  egHcalIsoPtMin_ = conf_.getParameter<double>("egHcalIsoPtMin");
31  egHcalIsoConeSize_ = conf_.getParameter<double>("egHcalIsoConeSize");
32  egHcalExclusion_ = conf_.getParameter<double>("egHcalExclusion");
33 
35 
36  //register your products
37  produces < reco::RecoEcalCandidateIsolationMap >();
38 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
EgammaHLTHcalIsolationDoubleConeProducers::~EgammaHLTHcalIsolationDoubleConeProducers ( )

Definition at line 41 of file EgammaHLTHcalIsolationDoubleConeProducers.cc.

References test_.

41 {delete test_;}

Member Function Documentation

void EgammaHLTHcalIsolationDoubleConeProducers::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 43 of file EgammaHLTHcalIsolationDoubleConeProducers.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

43  {
45  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
46  desc.add<edm::InputTag>(("hbRecHitProducer"), edm::InputTag("hltHbhereco"));
47  desc.add<edm::InputTag>(("hfRecHitProducer"), edm::InputTag("hltHfreco"));
48  desc.add<double>(("egHcalIsoPtMin"), 0.);
49  desc.add<double>(("egHcalIsoConeSize"), 0.3);
50  desc.add<double>(("egHcalExclusion"), 0.15);
51  descriptions.add(("hltEgammaHLTHcalIsolationDoubleConeProducers"), desc);
52 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTHcalIsolationDoubleConeProducers::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 54 of file EgammaHLTHcalIsolationDoubleConeProducers.cc.

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

54  {
55  // Get the HLT filtered objects
57  iEvent.getByToken(recoEcalCandidateProducer_,recoecalcandHandle);
58 
59  // Get the barrel hcal hits
60  edm::Handle<HBHERecHitCollection> hhitBarrelHandle;
61  iEvent.getByToken(hbRecHitProducer_, hhitBarrelHandle);
62  const HBHERecHitCollection* hcalhitBarrelCollection = hhitBarrelHandle.product();
63  // Get the forward hcal hits
64  edm::Handle<HFRecHitCollection> hhitEndcapHandle;
65  iEvent.getByToken(hfRecHitProducer_, hhitEndcapHandle);
66  const HFRecHitCollection* hcalhitEndcapCollection = hhitEndcapHandle.product();
67  //Get Calo Geometry
69  iSetup.get<CaloGeometryRecord>().get(pG);
70  const CaloGeometry* caloGeom = pG.product();
71 
73 
74  for(unsigned int iRecoEcalCand=0; iRecoEcalCand<recoecalcandHandle->size(); iRecoEcalCand++) {
75 
76  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
77  float isol = test_->isolPtSum(&(*recoecalcandref), hcalhitBarrelCollection, hcalhitEndcapCollection, caloGeom);
78 
79  isoMap.insert(recoecalcandref, isol);
80  }
81 
82  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
83  iEvent.put(isolMap);
84 
85 }
float isolPtSum(const reco::RecoCandidate *recocandidate, const HBHERecHitCollection *hbhe, const HFRecHitCollection *hf, const CaloGeometry *geometry)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
T const * product() const
Definition: Handle.h:81
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:86
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_

Member Data Documentation

edm::ParameterSet EgammaHLTHcalIsolationDoubleConeProducers::conf_
private
double EgammaHLTHcalIsolationDoubleConeProducers::egHcalExclusion_
private
double EgammaHLTHcalIsolationDoubleConeProducers::egHcalIsoConeSize_
private
double EgammaHLTHcalIsolationDoubleConeProducers::egHcalIsoPtMin_
private
edm::EDGetTokenT<HBHERecHitCollection> EgammaHLTHcalIsolationDoubleConeProducers::hbRecHitProducer_
private
edm::EDGetTokenT<HFRecHitCollection> EgammaHLTHcalIsolationDoubleConeProducers::hfRecHitProducer_
private
edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTHcalIsolationDoubleConeProducers::recoEcalCandidateProducer_
private
EgammaHLTHcalIsolationDoubleCone* EgammaHLTHcalIsolationDoubleConeProducers::test_
private