CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HBHEPlan1Combiner Class Reference

#include <RecoLocalCalo/HcalRecProducers/plugins/HBHEPlan1Combiner.cc>

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

Public Member Functions

 HBHEPlan1Combiner (const edm::ParameterSet &)
 
 ~HBHEPlan1Combiner ()
 
- 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)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

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

Private Member Functions

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

Private Attributes

std::unique_ptr< AbsPlan1RechitCombinercombiner_
 
bool ignorePlan1Topology_
 
edm::EDGetTokenT< HBHERecHitCollectiontok_rechits_
 
bool usePlan1Mode_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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
 
- 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

Description: rechit combiner module for the "Plan 1" scenario

Implementation: [Notes on implementation]

Definition at line 41 of file HBHEPlan1Combiner.cc.

Constructor & Destructor Documentation

HBHEPlan1Combiner::HBHEPlan1Combiner ( const edm::ParameterSet conf)
explicit

Definition at line 66 of file HBHEPlan1Combiner.cc.

References combiner_, edm::ParameterSet::getParameter(), and tok_rechits_.

67  : ignorePlan1Topology_(conf.getParameter<bool>("ignorePlan1Topology")),
68  usePlan1Mode_(conf.getParameter<bool>("usePlan1Mode")),
70 {
71  // Check that the rechit recombination algorithm has been successfully configured
72  if (!combiner_.get())
73  throw cms::Exception("HBHEPlan1BadConfig")
74  << "Invalid Plan1RechitCombiner algorithm configuration"
75  << std::endl;
76 
77  // Consumes and produces statements
78  tok_rechits_ = consumes<HBHERecHitCollection>(conf.getParameter<edm::InputTag>("hbheInput"));
79  produces<HBHERecHitCollection>();
80 }
T getParameter(std::string const &) const
edm::EDGetTokenT< HBHERecHitCollection > tok_rechits_
std::unique_ptr< AbsPlan1RechitCombiner > parsePlan1RechitCombiner(const edm::ParameterSet &ps)
std::unique_ptr< AbsPlan1RechitCombiner > combiner_
HBHEPlan1Combiner::~HBHEPlan1Combiner ( )

Definition at line 83 of file HBHEPlan1Combiner.cc.

84 {
85  // do anything here that needs to be done at destruction time
86  // (e.g. close files, deallocate resources etc.)
87 }

Member Function Documentation

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

Definition at line 145 of file HBHEPlan1Combiner.cc.

References edm::ParameterSetDescription::add(), add_param_set, edm::ConfigurationDescriptions::addDefault(), electronCleaner_cfi::algorithm, and DEFINE_FWK_MODULE.

146 {
148 
149  desc.add<edm::InputTag>("hbheInput");
150  desc.add<bool>("ignorePlan1Topology");
151  desc.add<bool>("usePlan1Mode");
152 
154 
155  descriptions.addDefault(desc);
156 }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define add_param_set(name)
void HBHEPlan1Combiner::produce ( edm::Event iEvent,
const edm::EventSetup eventSetup 
)
overrideprivatevirtual

Definition at line 96 of file HBHEPlan1Combiner.cc.

References edm::SortedCollection< T, SORT >::begin(), combiner_, edm::SortedCollection< T, SORT >::end(), edm::EventSetup::get(), CaloRecHitAuxSetter::getBit(), edm::Event::getByToken(), ignorePlan1Topology_, eostools::move(), HBHERecHitAuxSetter::OFF_TDC_TIME, edm::ESHandle< T >::product(), edm::Event::put(), edm::SortedCollection< T, SORT >::size(), tok_rechits_, usePlan1Mode_, and HcalTopology::withSpecialRBXHBHE().

97 {
98  using namespace edm;
99 
100  // Get the Hcal topology
102  eventSetup.get<HcalRecNumberingRecord>().get(htopo);
103  combiner_->setTopo(htopo.product());
104 
105  // Are we using "Plan 1" geometry?
106  const bool plan1Mode = ignorePlan1Topology_ ? usePlan1Mode_
107  : htopo->withSpecialRBXHBHE();
108 
109  // Find the input rechit collection
110  Handle<HBHERecHitCollection> inputRechits;
111  iEvent.getByToken(tok_rechits_, inputRechits);
112 
113  // Create a new output collections
114  std::unique_ptr<HBHERecHitCollection> outputRechits = std::make_unique<HBHERecHitCollection>();
115  outputRechits->reserve(inputRechits->size());
116 
117  // Iterate over the input collection. Copy QIE8 rechits directly into
118  // the output collection and prepare to combine QIE11 rechits.
119  combiner_->clear();
120  for (typename HBHERecHitCollection::const_iterator it = inputRechits->begin();
121  it != inputRechits->end(); ++it)
122  {
123  // If the rechit has TDC time info, it corresponds to QIE11
124  if (plan1Mode && CaloRecHitAuxSetter::getBit(
125  it->auxPhase1(), HBHERecHitAuxSetter::OFF_TDC_TIME))
126  combiner_->add(*it);
127  else
128  outputRechits->push_back(*it);
129  }
130 
131  // Combine QIE11 rechits and fill the output collection
132  combiner_->combine(&*outputRechits);
133 
134  // Put the output collection into the Event
135  iEvent.put(std::move(outputRechits));
136 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::vector< HBHERecHit >::const_iterator const_iterator
edm::EDGetTokenT< HBHERecHitCollection > tok_rechits_
static const unsigned OFF_TDC_TIME
std::unique_ptr< AbsPlan1RechitCombiner > combiner_
const_iterator end() const
const T & get() const
Definition: EventSetup.h:56
HLT enums.
size_type size() const
bool getBit(const uint32_t u, const unsigned bitnum)
bool withSpecialRBXHBHE() const
Definition: HcalTopology.h:162
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510
const_iterator begin() const

Member Data Documentation

std::unique_ptr<AbsPlan1RechitCombiner> HBHEPlan1Combiner::combiner_
private

Definition at line 60 of file HBHEPlan1Combiner.cc.

Referenced by HBHEPlan1Combiner(), and produce().

bool HBHEPlan1Combiner::ignorePlan1Topology_
private

Definition at line 56 of file HBHEPlan1Combiner.cc.

Referenced by produce().

edm::EDGetTokenT<HBHERecHitCollection> HBHEPlan1Combiner::tok_rechits_
private

Definition at line 55 of file HBHEPlan1Combiner.cc.

Referenced by HBHEPlan1Combiner(), and produce().

bool HBHEPlan1Combiner::usePlan1Mode_
private

Definition at line 57 of file HBHEPlan1Combiner.cc.

Referenced by produce().