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 Member Functions | Private Attributes
reco::HcalHaloDataProducer Class Reference

#include <HcalHaloDataProducer.h>

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

Public Member Functions

 HcalHaloDataProducer (const edm::ParameterSet &)
 
 ~HcalHaloDataProducer ()
 
- 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 (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 ()
 

Private Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT
< CaloTowerCollection
calotower_token_
 
edm::EDGetTokenT
< HBHERecHitCollection
hbherechit_token_
 
float HBRecHitEnergyThreshold
 
float HERecHitEnergyThreshold
 
edm::EDGetTokenT
< HFRecHitCollection
hfrechit_token_
 
edm::InputTag IT_CaloTowers
 
edm::InputTag IT_HBHERecHit
 
edm::InputTag IT_HFRecHit
 
edm::InputTag IT_HORecHit
 
int NHitsHcalThreshold
 
float SumHcalEnergyThreshold
 

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 87 of file HcalHaloDataProducer.h.

Constructor & Destructor Documentation

HcalHaloDataProducer::HcalHaloDataProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 15 of file HcalHaloDataProducer.cc.

References edm::ParameterSet::getParameter().

16 {
17  //RecHit Level
18  IT_HBHERecHit = iConfig.getParameter<edm::InputTag>("HBHERecHitLabel");
19  IT_HFRecHit = iConfig.getParameter<edm::InputTag>("HFRecHitLabel");
20  IT_HORecHit = iConfig.getParameter<edm::InputTag>("HORecHitLabel");
21  IT_CaloTowers = iConfig.getParameter<edm::InputTag>("caloTowerCollName");
22 
23  HBRecHitEnergyThreshold = (float)iConfig.getParameter<double>("HBRecHitEnergyThresholdParam");
24  HERecHitEnergyThreshold = (float)iConfig.getParameter<double>("HERecHitEnergyThresholdParam");
25  SumHcalEnergyThreshold = (float) iConfig.getParameter<double>("SumHcalEnergyThresholdParam");
26  NHitsHcalThreshold = iConfig.getParameter<int>("NHitsHcalThresholdParam");
27 
28  hbherechit_token_ = consumes<HBHERecHitCollection>(IT_HBHERecHit);
29  hfrechit_token_ = consumes<HFRecHitCollection>(IT_HFRecHit);
30  calotower_token_ = consumes<CaloTowerCollection>(IT_CaloTowers);
31 
32  produces<HcalHaloData>();
33 }
T getParameter(std::string const &) const
edm::EDGetTokenT< HBHERecHitCollection > hbherechit_token_
edm::EDGetTokenT< CaloTowerCollection > calotower_token_
edm::EDGetTokenT< HFRecHitCollection > hfrechit_token_
HcalHaloDataProducer::~HcalHaloDataProducer ( )

Definition at line 79 of file HcalHaloDataProducer.cc.

79 {}

Member Function Documentation

void HcalHaloDataProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 35 of file HcalHaloDataProducer.cc.

References HcalHaloAlgo::Calculate(), edm::EventSetup::get(), edm::Event::getByToken(), HcalHaloData_cfi::HcalHaloData, edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), edm::Event::put(), HcalHaloAlgo::SetPhiWedgeThresholds(), and HcalHaloAlgo::SetRecHitEnergyThresholds().

36 {
37  //Get CaloGeometry
38  edm::ESHandle<CaloGeometry> TheCaloGeometry;
39  iSetup.get<CaloGeometryRecord>().get(TheCaloGeometry);
40 
41  //Get CaloTowers
43  iEvent.getByToken(calotower_token_, TheCaloTowers);
44 
45  //Get HB/HE RecHits
46  edm::Handle<HBHERecHitCollection> TheHBHERecHits;
47  // iEvent.getByLabel(IT_HBHERecHit, TheHBHERecHits);
48  iEvent.getByToken(hbherechit_token_, TheHBHERecHits);
49 
50  //Get HF RecHits
52  // iEvent.getByLabel(IT_HFRecHit, TheHFRecHits);
53  iEvent.getByToken(hfrechit_token_, TheHFRecHits);
54 
55  // Run the HcalHaloAlgo to reconstruct the HcalHaloData object
56  HcalHaloAlgo HcalAlgo;
59 
60  HcalHaloData HcalData;
61  if( TheCaloGeometry.isValid() && TheHBHERecHits.isValid() )
62  {
63  if( TheCaloTowers.isValid() ) {
64  std::auto_ptr<HcalHaloData> HcalData( new HcalHaloData( HcalAlgo.Calculate(*TheCaloGeometry, TheHBHERecHits, TheCaloTowers) ) ) ;
65  iEvent.put ( HcalData ) ;
66  } else {
67  std::auto_ptr<HcalHaloData> HcalData( new HcalHaloData( HcalAlgo.Calculate(*TheCaloGeometry, TheHBHERecHits) ) ) ;
68  iEvent.put ( HcalData ) ;
69  }
70  }
71  else
72  {
73  std::auto_ptr<HcalHaloData> HcalData( new HcalHaloData() ) ;
74  iEvent.put( HcalData ) ;
75  }
76  return;
77 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
void SetRecHitEnergyThresholds(float HB, float HE)
Definition: HcalHaloAlgo.h:43
edm::EDGetTokenT< HBHERecHitCollection > hbherechit_token_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
reco::HcalHaloData Calculate(const CaloGeometry &TheCaloGeometry, edm::Handle< HBHERecHitCollection > &TheHBHERecHits, edm::Handle< CaloTowerCollection > &TheCaloTowers)
Definition: HcalHaloAlgo.cc:33
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< CaloTowerCollection > calotower_token_
void SetPhiWedgeThresholds(float SumE, int nhits)
Definition: HcalHaloAlgo.h:48
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< HFRecHitCollection > hfrechit_token_
bool isValid() const
Definition: ESHandle.h:47

Member Data Documentation

edm::EDGetTokenT<CaloTowerCollection> reco::HcalHaloDataProducer::calotower_token_
private

Definition at line 105 of file HcalHaloDataProducer.h.

edm::EDGetTokenT<HBHERecHitCollection> reco::HcalHaloDataProducer::hbherechit_token_
private

Definition at line 103 of file HcalHaloDataProducer.h.

float reco::HcalHaloDataProducer::HBRecHitEnergyThreshold
private

Definition at line 107 of file HcalHaloDataProducer.h.

float reco::HcalHaloDataProducer::HERecHitEnergyThreshold
private

Definition at line 108 of file HcalHaloDataProducer.h.

edm::EDGetTokenT<HFRecHitCollection> reco::HcalHaloDataProducer::hfrechit_token_
private

Definition at line 104 of file HcalHaloDataProducer.h.

edm::InputTag reco::HcalHaloDataProducer::IT_CaloTowers
private

Definition at line 101 of file HcalHaloDataProducer.h.

edm::InputTag reco::HcalHaloDataProducer::IT_HBHERecHit
private

Definition at line 98 of file HcalHaloDataProducer.h.

edm::InputTag reco::HcalHaloDataProducer::IT_HFRecHit
private

Definition at line 100 of file HcalHaloDataProducer.h.

edm::InputTag reco::HcalHaloDataProducer::IT_HORecHit
private

Definition at line 99 of file HcalHaloDataProducer.h.

int reco::HcalHaloDataProducer::NHitsHcalThreshold
private

Definition at line 110 of file HcalHaloDataProducer.h.

float reco::HcalHaloDataProducer::SumHcalEnergyThreshold
private

Definition at line 109 of file HcalHaloDataProducer.h.