CMS 3D CMS Logo

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

#include <HGCalTowerMap2DImpl.h>

Public Member Functions

template<class T >
void buildTowerMap2D (const std::vector< edm::Ptr< T >> &ptrs, l1t::HGCalTowerMapBxCollection &towerMaps)
 
void eventSetup (const edm::EventSetup &es)
 
 HGCalTowerMap2DImpl (const edm::ParameterSet &conf)
 
void resetTowerMaps ()
 

Private Member Functions

std::unordered_map< int, l1t::HGCalTowerMapnewTowerMaps ()
 

Private Attributes

std::vector< double > layerWeights_
 
HGCalTriggerTowerGeometryHelper towerGeometryHelper_
 
HGCalTriggerTools triggerTools_
 
bool useLayerWeights_
 

Detailed Description

Author
: Thomas Strebler

Description: first iteration of HGCal Tower Maps

Definition at line 14 of file HGCalTowerMap2DImpl.h.

Constructor & Destructor Documentation

◆ HGCalTowerMap2DImpl()

HGCalTowerMap2DImpl::HGCalTowerMap2DImpl ( const edm::ParameterSet conf)

Definition at line 13 of file HGCalTowerMap2DImpl.cc.

14  : useLayerWeights_(conf.getParameter<bool>("useLayerWeights")),
15  layerWeights_(conf.getParameter<std::vector<double>>("layerWeights")),
16  towerGeometryHelper_(conf.getParameter<edm::ParameterSet>("L1TTriggerTowerConfig")) {}

Member Function Documentation

◆ buildTowerMap2D()

template<class T >
void HGCalTowerMap2DImpl::buildTowerMap2D ( const std::vector< edm::Ptr< T >> &  ptrs,
l1t::HGCalTowerMapBxCollection towerMaps 
)
inline

Definition at line 21 of file HGCalTowerMap2DImpl.h.

21  {
22  std::unordered_map<int, l1t::HGCalTowerMap> towerMapsTmp = newTowerMaps();
23 
24  for (const auto& ptr : ptrs) {
25  if (triggerTools_.isNose(ptr->detId()))
26  continue;
27  unsigned layer = triggerTools_.layerWithOffset(ptr->detId());
28  if (towerMapsTmp.find(layer) == towerMapsTmp.end()) {
29  throw cms::Exception("Out of range")
30  << "HGCalTowerMap2dImpl: Found trigger sum in layer " << layer << " for which there is no tower map\n";
31  }
32  // FIXME: should actually sum the energy not the Et...
33  double calibPt = ptr->pt();
34  if (useLayerWeights_)
35  calibPt = layerWeights_[layer] * ptr->mipPt();
36 
37  double etEm = layer <= triggerTools_.lastLayerEE() ? calibPt : 0;
38  double etHad = layer > triggerTools_.lastLayerEE() ? calibPt : 0;
39 
40  towerMapsTmp[layer].addEt(towerGeometryHelper_.getTriggerTower(*ptr), etEm, etHad);
41  }
42 
43  /* store towerMaps in the persistent collection */
44  towerMaps.resize(0, towerMapsTmp.size());
45  int i = 0;
46  for (const auto& towerMap : towerMapsTmp) {
47  towerMaps.set(0, i, towerMap.second);
48  i++;
49  }
50  }

References Exception, HGCalTriggerTowerGeometryHelper::getTriggerTower(), mps_fire::i, HGCalTriggerTools::isNose(), HGCalTriggerTools::lastLayerEE(), phase1PixelTopology::layer, layerWeights_, HGCalTriggerTools::layerWithOffset(), newTowerMaps(), BXVector< T >::resize(), BXVector< T >::set(), towerGeometryHelper_, triggerTools_, and useLayerWeights_.

◆ eventSetup()

void HGCalTowerMap2DImpl::eventSetup ( const edm::EventSetup es)
inline

◆ newTowerMaps()

std::unordered_map< int, l1t::HGCalTowerMap > HGCalTowerMap2DImpl::newTowerMaps ( )
private

Definition at line 18 of file HGCalTowerMap2DImpl.cc.

18  {
19  std::unordered_map<int, l1t::HGCalTowerMap> towerMaps;
20  for (unsigned layer = 1; layer <= triggerTools_.lastLayerBH(); layer++) {
21  // FIXME: this is hardcoded...quite ugly
22  if (layer <= triggerTools_.lastLayerEE() && layer % 2 == 0)
23  continue;
25  }
26 
27  return towerMaps;
28 }

References HGCalTriggerTowerGeometryHelper::getTowerCoordinates(), HGCalTriggerTools::lastLayerBH(), HGCalTriggerTools::lastLayerEE(), phase1PixelTopology::layer, towerGeometryHelper_, and triggerTools_.

Referenced by buildTowerMap2D().

◆ resetTowerMaps()

void HGCalTowerMap2DImpl::resetTowerMaps ( )

Member Data Documentation

◆ layerWeights_

std::vector<double> HGCalTowerMap2DImpl::layerWeights_
private

Definition at line 59 of file HGCalTowerMap2DImpl.h.

Referenced by buildTowerMap2D().

◆ towerGeometryHelper_

HGCalTriggerTowerGeometryHelper HGCalTowerMap2DImpl::towerGeometryHelper_
private

Definition at line 63 of file HGCalTowerMap2DImpl.h.

Referenced by buildTowerMap2D(), eventSetup(), and newTowerMaps().

◆ triggerTools_

HGCalTriggerTools HGCalTowerMap2DImpl::triggerTools_
private

Definition at line 60 of file HGCalTowerMap2DImpl.h.

Referenced by buildTowerMap2D(), eventSetup(), and newTowerMaps().

◆ useLayerWeights_

bool HGCalTowerMap2DImpl::useLayerWeights_
private

Definition at line 58 of file HGCalTowerMap2DImpl.h.

Referenced by buildTowerMap2D().

HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
mps_fire.i
i
Definition: mps_fire.py:428
HGCalTowerMap2DImpl::layerWeights_
std::vector< double > layerWeights_
Definition: HGCalTowerMap2DImpl.h:59
HGCalTowerMap2DImpl::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalTowerMap2DImpl.h:60
HGCalTriggerTowerGeometryHelper::getTriggerTower
unsigned short getTriggerTower(const l1t::HGCalTriggerCell &) const
Definition: HGCalTriggerTowerGeometryHelper.cc:122
l1t::HGCalTowerMap
Definition: HGCalTowerMap.h:15
HGCalTriggerTools::lastLayerBH
unsigned lastLayerBH() const
Definition: HGCalTriggerTools.h:56
HGCalTriggerTools::layerWithOffset
unsigned layerWithOffset(const DetId &) const
Definition: HGCalTriggerTools.cc:134
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
HGCalTriggerTools::isNose
bool isNose(const DetId &) const
Definition: HGCalTriggerTools.cc:170
HGCalTowerMap2DImpl::newTowerMaps
std::unordered_map< int, l1t::HGCalTowerMap > newTowerMaps()
Definition: HGCalTowerMap2DImpl.cc:18
edm::ParameterSet
Definition: ParameterSet.h:47
HGCalTowerMap2DImpl::useLayerWeights_
bool useLayerWeights_
Definition: HGCalTowerMap2DImpl.h:58
BXVector::resize
void resize(int bx, unsigned size)
HGCalTriggerTowerGeometryHelper::eventSetup
void eventSetup(const edm::EventSetup &es)
Definition: HGCalTriggerTowerGeometryHelper.h:33
Exception
Definition: hltDiff.cc:245
HGCalTriggerTowerGeometryHelper::getTowerCoordinates
const std::vector< l1t::HGCalTowerCoord > & getTowerCoordinates() const
Definition: HGCalTriggerTowerGeometryHelper.cc:83
BXVector::set
void set(int bx, unsigned i, const T &object)
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalTriggerTools::lastLayerEE
unsigned lastLayerEE() const
Definition: HGCalTriggerTools.h:54
HGCalTowerMap2DImpl::towerGeometryHelper_
HGCalTriggerTowerGeometryHelper towerGeometryHelper_
Definition: HGCalTowerMap2DImpl.h:63