CMS 3D CMS Logo

List of all members | Public Member Functions
HGCalTowerMapImplSA Class Reference

#include <HGCalTowerMapImpl_SA.h>

Public Member Functions

 HGCalTowerMapImplSA ()=default
 
void runAlgorithm (const std::vector< l1thgcfirmware::HGCalTowerMap > &inputTowerMaps_SA, std::vector< l1thgcfirmware::HGCalTower > &outputTowers_SA) const
 
 ~HGCalTowerMapImplSA ()=default
 

Detailed Description

Definition at line 7 of file HGCalTowerMapImpl_SA.h.

Constructor & Destructor Documentation

◆ HGCalTowerMapImplSA()

HGCalTowerMapImplSA::HGCalTowerMapImplSA ( )
default

◆ ~HGCalTowerMapImplSA()

HGCalTowerMapImplSA::~HGCalTowerMapImplSA ( )
default

Member Function Documentation

◆ runAlgorithm()

void HGCalTowerMapImplSA::runAlgorithm ( const std::vector< l1thgcfirmware::HGCalTowerMap > &  inputTowerMaps_SA,
std::vector< l1thgcfirmware::HGCalTower > &  outputTowers_SA 
) const

Definition at line 5 of file HGCalTowerMapImpl_SA.cc.

References genParticles_cff::map, l1tHGCalTowerProducer_cfi::tower, and l1thgcfirmware::HGCalTowerMap::towers().

Referenced by HGCalTowerMapsWrapper::process().

6  {
7  // Need better way to initialise the output tower map
8  if (inputTowerMaps_SA.empty())
9  return;
10  std::vector<HGCalTowerCoord> tower_ids;
11  for (const auto& tower : inputTowerMaps_SA.front().towers()) {
12  tower_ids.emplace_back(tower.first, tower.second.eta(), tower.second.phi());
13  }
14  HGCalTowerMap towerMap(tower_ids);
15 
16  for (const auto& map : inputTowerMaps_SA) {
17  towerMap += map;
18  }
19 
20  for (const auto& tower : towerMap.towers()) {
21  if (tower.second.etEm() > 0 || tower.second.etHad() > 0) {
22  outputTowers_SA.push_back(tower.second);
23  }
24  }
25 }