CMS 3D CMS Logo

HGCalTowerProcessor.cc
Go to the documentation of this file.
2 
6 
11 
13 public:
15  includeTrigCells_ = conf.getParameter<bool>("includeTrigCells"),
16  towermap2D_ = std::make_unique<HGCalTowerMap2DImpl>(conf.getParameterSet("towermap_parameters"));
17  towermap3D_ = std::make_unique<HGCalTowerMap3DImpl>();
18  }
19 
20  void eventSetup(const edm::EventSetup& es) override { towermap2D_->eventSetup(es); }
21 
23  collHandle,
24  l1t::HGCalTowerBxCollection& collTowers,
25  const edm::EventSetup& es) override {
27 
28  auto& towerMapCollHandle = collHandle.first;
29  auto& unclTCsCollHandle = collHandle.second;
30 
31  /* create a persistent vector of pointers to the towerMaps */
32  std::vector<edm::Ptr<l1t::HGCalTowerMap>> towerMapsPtrs;
33  for (unsigned i = 0; i < towerMapCollHandle->size(); ++i) {
34  towerMapsPtrs.emplace_back(towerMapCollHandle, i);
35  }
36 
37  if (includeTrigCells_) {
38  /* create additional TowerMaps from the unclustered TCs */
39 
40  // translate our HGCalClusters into HGCalTriggerCells
41  std::vector<edm::Ptr<l1t::HGCalTriggerCell>> trigCellVec;
42  for (unsigned i = 0; i < unclTCsCollHandle->size(); ++i) {
43  edm::Ptr<l1t::HGCalCluster> ptr(unclTCsCollHandle, i);
44  for (const auto& itTC : ptr->constituents()) {
45  trigCellVec.push_back(itTC.second);
46  }
47  }
48 
49  // fill the TowerMaps with the HGCalTriggersCells
50  l1t::HGCalTowerMapBxCollection towerMapsFromUnclTCs;
51  towermap2D_->buildTowerMap2D(trigCellVec, towerMapsFromUnclTCs);
52 
53  /* merge the two sets of TowerMaps */
54  unsigned int towerMapsPtrsSize = towerMapsPtrs.size();
55  for (unsigned int i = 0; i < towerMapsFromUnclTCs.size(); ++i) {
56  towerMapsPtrs.emplace_back(&(towerMapsFromUnclTCs[i]), i + towerMapsPtrsSize);
57  }
58 
59  /* call to towerMap3D clustering */
60  towermap3D_->buildTowerMap3D(towerMapsPtrs, collTowers);
61  } else {
62  /* call to towerMap3D clustering */
63  towermap3D_->buildTowerMap3D(towerMapsPtrs, collTowers);
64  }
65  }
66 
67 private:
70 
71  /* algorithms instances */
72  std::unique_ptr<HGCalTowerMap2DImpl> towermap2D_;
73  std::unique_ptr<HGCalTowerMap3DImpl> towermap3D_;
74 };
75 
mps_fire.i
i
Definition: mps_fire.py:428
HGCalTowerProcessor::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition: HGCalTowerProcessor.cc:68
HGCalTowerProcessor::towermap2D_
std::unique_ptr< HGCalTowerMap2DImpl > towermap2D_
Definition: HGCalTowerProcessor.cc:72
HGCalTowerProcessor::run
void run(const std::pair< edm::Handle< l1t::HGCalTowerMapBxCollection >, edm::Handle< l1t::HGCalClusterBxCollection >> &collHandle, l1t::HGCalTowerBxCollection &collTowers, const edm::EventSetup &es) override
Definition: HGCalTowerProcessor.cc:22
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
HGCalTowerProcessor::includeTrigCells_
bool includeTrigCells_
Definition: HGCalTowerProcessor.cc:69
edm::Handle
Definition: AssociativeIterator.h:50
BXVector< HGCalTower >
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
HGCalTowerProcessor::HGCalTowerProcessor
HGCalTowerProcessor(const edm::ParameterSet &conf)
Definition: HGCalTowerProcessor.cc:14
HGCalTriggerGeometryBase.h
edm::ESHandle< HGCalTriggerGeometryBase >
HGCalTowerMap3DImpl.h
HGCalTowerMap2DImpl.h
l1t::HGCalClusterT::constituents
const std::unordered_map< uint32_t, edm::Ptr< C > > & constituents() const
Definition: HGCalClusterT.h:50
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
CaloGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:47
HGCalTower.h
edmplugin::PluginFactory
Definition: PluginFactory.h:34
HGCalTowerProcessor
Definition: HGCalTowerProcessor.cc:12
HGCalTowerProcessor::eventSetup
void eventSetup(const edm::EventSetup &es) override
Definition: HGCalTowerProcessor.cc:20
edm::EventSetup
Definition: EventSetup.h:58
HGCalTowerProcessor::towermap3D_
std::unique_ptr< HGCalTowerMap3DImpl > towermap3D_
Definition: HGCalTowerProcessor.cc:73
get
#define get
edm::Ptr
Definition: AssociationVector.h:31
HGCalProcessorBase.h
HGCalTowerMap.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
BXVector::size
unsigned size(int bx) const
HGCalTriggerCell.h
HGCalProcessorBaseT
Definition: HGCalProcessorBaseT.h:10
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128