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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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

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 65 of file HBHEPlan1Combiner.cc.

66  : ignorePlan1Topology_(conf.getParameter<bool>("ignorePlan1Topology")),
67  usePlan1Mode_(conf.getParameter<bool>("usePlan1Mode")),
69  // Check that the rechit recombination algorithm has been successfully configured
70  if (!combiner_.get())
71  throw cms::Exception("HBHEPlan1BadConfig") << "Invalid Plan1RechitCombiner algorithm configuration" << std::endl;
72 
73  // Consumes and produces statements
74  tok_rechits_ = consumes<HBHERecHitCollection>(conf.getParameter<edm::InputTag>("hbheInput"));
75  produces<HBHERecHitCollection>();
76 }

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

◆ ~HBHEPlan1Combiner()

HBHEPlan1Combiner::~HBHEPlan1Combiner ( )
override

Definition at line 78 of file HBHEPlan1Combiner.cc.

78  {
79  // do anything here that needs to be done at destruction time
80  // (e.g. close files, deallocate resources etc.)
81 }

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 131 of file HBHEPlan1Combiner.cc.

131  {
133 
134  desc.add<edm::InputTag>("hbheInput");
135  desc.add<bool>("ignorePlan1Topology");
136  desc.add<bool>("usePlan1Mode");
137 
139 
140  descriptions.addDefault(desc);
141 }

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

◆ produce()

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

Definition at line 88 of file HBHEPlan1Combiner.cc.

88  {
89  using namespace edm;
90 
91  // Get the Hcal topology
93  eventSetup.get<HcalRecNumberingRecord>().get(htopo);
94  combiner_->setTopo(htopo.product());
95 
96  // Are we using "Plan 1" geometry?
97  const bool plan1Mode = ignorePlan1Topology_ ? usePlan1Mode_ : htopo->getMergePositionFlag();
98 
99  // Find the input rechit collection
100  Handle<HBHERecHitCollection> inputRechits;
101  iEvent.getByToken(tok_rechits_, inputRechits);
102 
103  // Create a new output collections
104  std::unique_ptr<HBHERecHitCollection> outputRechits = std::make_unique<HBHERecHitCollection>();
105  outputRechits->reserve(inputRechits->size());
106 
107  // Iterate over the input collection. Copy QIE8 rechits directly into
108  // the output collection and prepare to combine QIE11 rechits.
109  combiner_->clear();
110  for (typename HBHERecHitCollection::const_iterator it = inputRechits->begin(); it != inputRechits->end(); ++it) {
111  // If the rechit has TDC time info, it corresponds to QIE11
112  if (plan1Mode && CaloRecHitAuxSetter::getBit(it->auxPhase1(), HBHERecHitAuxSetter::OFF_TDC_TIME))
113  combiner_->add(*it);
114  else
115  outputRechits->push_back(*it);
116  }
117 
118  // Combine QIE11 rechits and fill the output collection
119  combiner_->combine(&*outputRechits);
120 
121  // Put the output collection into the Event
122  iEvent.put(std::move(outputRechits));
123 }

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

Member Data Documentation

◆ combiner_

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

Definition at line 59 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().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
edm
HLT enums.
Definition: AlignableModifier.h:19
parsePlan1RechitCombiner
std::unique_ptr< AbsPlan1RechitCombiner > parsePlan1RechitCombiner(const edm::ParameterSet &ps)
Definition: parsePlan1RechitCombiner.cc:7
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HBHEPlan1Combiner::ignorePlan1Topology_
bool ignorePlan1Topology_
Definition: HBHEPlan1Combiner.cc:55
HBHERecHitAuxSetter::OFF_TDC_TIME
static const unsigned OFF_TDC_TIME
Definition: HBHERecHitAuxSetter.h:35
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
HBHEPlan1Combiner::tok_rechits_
edm::EDGetTokenT< HBHERecHitCollection > tok_rechits_
Definition: HBHEPlan1Combiner.cc:54
HcalTopology::getMergePositionFlag
bool getMergePositionFlag() const
Definition: HcalTopology.h:167
edm::Handle
Definition: AssociativeIterator.h:50
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
add_param_set
#define add_param_set(name)
Definition: HBHEPlan1Combiner.cc:125
edm::ESHandle< HcalTopology >
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
edm::ParameterSet
Definition: ParameterSet.h:36
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
qcdUeDQM_cfi.algorithm
algorithm
Definition: qcdUeDQM_cfi.py:32
iEvent
int iEvent
Definition: GenABIO.cc:224
CaloRecHitAuxSetter::getBit
constexpr bool getBit(const uint32_t u, const unsigned bitnum)
Definition: CaloRecHitAuxSetter.h:37
HBHEPlan1Combiner::combiner_
std::unique_ptr< AbsPlan1RechitCombiner > combiner_
Definition: HBHEPlan1Combiner.cc:59
HBHEPlan1Combiner::usePlan1Mode_
bool usePlan1Mode_
Definition: HBHEPlan1Combiner.cc:56
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
cms::Exception
Definition: Exception.h:70
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::InputTag
Definition: InputTag.h:15