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<>

Public Member Functions

 HBHEPlan1Combiner (const edm::ParameterSet &)
 
 ~HBHEPlan1Combiner () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

std::unique_ptr< AbsPlan1RechitCombinercombiner_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordhtopoToken_
 
bool ignorePlan1Topology_
 
edm::EDGetTokenT< HBHERecHitCollectiontok_rechits_
 
bool usePlan1Mode_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

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::HBHEPlan1Combiner ( const edm::ParameterSet conf)
explicit

Definition at line 68 of file HBHEPlan1Combiner.cc.

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

69  : ignorePlan1Topology_(conf.getParameter<bool>("ignorePlan1Topology")),
70  usePlan1Mode_(conf.getParameter<bool>("usePlan1Mode")),
72  // Check that the rechit recombination algorithm has been successfully configured
73  if (!combiner_.get())
74  throw cms::Exception("HBHEPlan1BadConfig") << "Invalid Plan1RechitCombiner algorithm configuration" << std::endl;
75 
76  // Consumes and produces statements
77  tok_rechits_ = consumes<HBHERecHitCollection>(conf.getParameter<edm::InputTag>("hbheInput"));
78  produces<HBHERecHitCollection>();
79 
80  // ES tokens
81  htopoToken_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
82 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< HBHERecHitCollection > tok_rechits_
std::unique_ptr< AbsPlan1RechitCombiner > parsePlan1RechitCombiner(const edm::ParameterSet &ps)
std::unique_ptr< AbsPlan1RechitCombiner > combiner_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > htopoToken_

◆ ~HBHEPlan1Combiner()

HBHEPlan1Combiner::~HBHEPlan1Combiner ( )
override

Definition at line 84 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

◆ fillDescriptions()

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

Definition at line 136 of file HBHEPlan1Combiner.cc.

References add_param_set, edm::ConfigurationDescriptions::addDefault(), qcdUeDQM_cfi::algorithm, and submitPVResolutionJobs::desc.

136  {
138 
139  desc.add<edm::InputTag>("hbheInput");
140  desc.add<bool>("ignorePlan1Topology");
141  desc.add<bool>("usePlan1Mode");
142 
144 
145  descriptions.addDefault(desc);
146 }
void addDefault(ParameterSetDescription const &psetDescription)
#define add_param_set(name)

◆ produce()

void HBHEPlan1Combiner::produce ( edm::Event iEvent,
const edm::EventSetup eventSetup 
)
overrideprivate

Definition at line 94 of file HBHEPlan1Combiner.cc.

References edm::SortedCollection< T, SORT >::begin(), combiner_, edm::SortedCollection< T, SORT >::end(), options_cfi::eventSetup, CaloRecHitAuxSetter::getBit(), HcalTopology::getMergePositionFlag(), htopoToken_, iEvent, ignorePlan1Topology_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, eostools::move(), HBHERecHitAuxSetter::OFF_TDC_TIME, edm::SortedCollection< T, SORT >::size(), tok_rechits_, and usePlan1Mode_.

94  {
95  using namespace edm;
96 
97  // Get the Hcal topology
98  const HcalTopology& htopo = eventSetup.getData(htopoToken_);
99  combiner_->setTopo(&htopo);
100 
101  // Are we using "Plan 1" geometry?
102  const bool plan1Mode = ignorePlan1Topology_ ? usePlan1Mode_ : htopo.getMergePositionFlag();
103 
104  // Find the input rechit collection
105  Handle<HBHERecHitCollection> inputRechits;
106  iEvent.getByToken(tok_rechits_, inputRechits);
107 
108  // Create a new output collections
109  std::unique_ptr<HBHERecHitCollection> outputRechits = std::make_unique<HBHERecHitCollection>();
110  outputRechits->reserve(inputRechits->size());
111 
112  // Iterate over the input collection. Copy QIE8 rechits directly into
113  // the output collection and prepare to combine QIE11 rechits.
114  combiner_->clear();
115  for (typename HBHERecHitCollection::const_iterator it = inputRechits->begin(); it != inputRechits->end(); ++it) {
116  // If the rechit has TDC time info, it corresponds to QIE11
117  if (plan1Mode && CaloRecHitAuxSetter::getBit(it->auxPhase1(), HBHERecHitAuxSetter::OFF_TDC_TIME))
118  combiner_->add(*it);
119  else
120  outputRechits->push_back(*it);
121  }
122 
123  // Combine QIE11 rechits and fill the output collection
124  combiner_->combine(&*outputRechits);
125 
126  // Put the output collection into the Event
127  iEvent.put(std::move(outputRechits));
128 }
bool getMergePositionFlag() const
Definition: HcalTopology.h:167
size_type size() const
std::vector< T >::const_iterator const_iterator
edm::EDGetTokenT< HBHERecHitCollection > tok_rechits_
static const unsigned OFF_TDC_TIME
int iEvent
Definition: GenABIO.cc:224
const_iterator begin() const
constexpr bool getBit(const uint32_t u, const unsigned bitnum)
std::unique_ptr< AbsPlan1RechitCombiner > combiner_
const_iterator end() const
HLT enums.
def move(src, dest)
Definition: eostools.py:511
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > htopoToken_

Member Data Documentation

◆ combiner_

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

Definition at line 59 of file HBHEPlan1Combiner.cc.

Referenced by HBHEPlan1Combiner(), and produce().

◆ htopoToken_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> HBHEPlan1Combiner::htopoToken_
private

Definition at line 62 of file HBHEPlan1Combiner.cc.

Referenced by HBHEPlan1Combiner(), and produce().

◆ ignorePlan1Topology_

bool HBHEPlan1Combiner::ignorePlan1Topology_
private

Definition at line 55 of file HBHEPlan1Combiner.cc.

Referenced by produce().

◆ tok_rechits_

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

Definition at line 54 of file HBHEPlan1Combiner.cc.

Referenced by HBHEPlan1Combiner(), and produce().

◆ usePlan1Mode_

bool HBHEPlan1Combiner::usePlan1Mode_
private

Definition at line 56 of file HBHEPlan1Combiner.cc.

Referenced by produce().