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

void buildTowerMap2D (const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &triggerCellsPtrs, 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 ( const edm::ParameterSet conf)

Definition at line 14 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")) {
17 
18 }
T getParameter(std::string const &) const
std::vector< double > layerWeights_
HGCalTriggerTowerGeometryHelper towerGeometryHelper_

Member Function Documentation

void HGCalTowerMap2DImpl::buildTowerMap2D ( const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &  triggerCellsPtrs,
l1t::HGCalTowerMapBxCollection towermaps 
)

Definition at line 35 of file HGCalTowerMap2DImpl.cc.

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

Referenced by HGCalTowerMapProcessor::run().

36  {
37 
38  std::unordered_map<int, l1t::HGCalTowerMap> towerMapsTmp = newTowerMaps();
39 
40  for(auto tc: triggerCellsPtrs) {
41  unsigned layer = triggerTools_.layerWithOffset(tc->detId());
42  // FIXME: should actually sum the energy not the Et...
43  double calibPt = tc->pt();
44  if(useLayerWeights_) calibPt = layerWeights_[layer] * tc->mipPt();
45 
46  double etEm = layer<=triggerTools_.lastLayerEE() ? calibPt : 0;
47  double etHad = layer>triggerTools_.lastLayerEE() ? calibPt : 0;
48 
49  towerMapsTmp[layer].addEt(towerGeometryHelper_.getTriggerTowerFromTriggerCell(tc->detId(), tc->eta(), tc->phi()), etEm, etHad);
50 
51  }
52 
53  /* store towerMaps in the persistent collection */
54  towerMaps.resize(0, towerMapsTmp.size());
55  int i=0;
56  for(auto towerMap : towerMapsTmp){
57  towerMaps.set( 0, i, towerMap.second);
58  i++;
59  }
60 
61 
62 }
unsigned lastLayerEE() const
std::vector< double > layerWeights_
HGCalTriggerTools triggerTools_
unsigned layerWithOffset(const DetId &) const
std::unordered_map< int, l1t::HGCalTowerMap > newTowerMaps()
unsigned short getTriggerTowerFromTriggerCell(const unsigned tcId, const float &eta, const float &phi) const
HGCalTriggerTowerGeometryHelper towerGeometryHelper_
void HGCalTowerMap2DImpl::eventSetup ( const edm::EventSetup es)
inline

Definition at line 26 of file HGCalTowerMap2DImpl.h.

References HGCalTriggerTools::eventSetup(), and triggerTools_.

Referenced by HGCalTowerMapProcessor::run().

26  {
28  }
void eventSetup(const edm::EventSetup &)
HGCalTriggerTools triggerTools_
std::unordered_map< int, l1t::HGCalTowerMap > HGCalTowerMap2DImpl::newTowerMaps ( )
private

Definition at line 21 of file HGCalTowerMap2DImpl.cc.

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

Referenced by buildTowerMap2D().

21  {
22  std::unordered_map<int, l1t::HGCalTowerMap> towerMaps;
23  for(unsigned layer = 1; layer<=triggerTools_.lastLayerBH(); layer++) {
24  // FIXME: this is hardcoded...quite ugly
25  if (layer <= triggerTools_.lastLayerEE() && layer%2 == 0) continue;
26  towerMaps[layer] = l1t::HGCalTowerMap(towerGeometryHelper_.getTowerCoordinates(), layer);
27  }
28 
29  return towerMaps;
30 
31 }
unsigned lastLayerEE() const
HGCalTriggerTools triggerTools_
const std::vector< l1t::HGCalTowerCoord > & getTowerCoordinates() const
unsigned lastLayerBH() const
HGCalTriggerTowerGeometryHelper towerGeometryHelper_
void HGCalTowerMap2DImpl::resetTowerMaps ( )

Member Data Documentation

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

Definition at line 33 of file HGCalTowerMap2DImpl.h.

Referenced by buildTowerMap2D().

HGCalTriggerTowerGeometryHelper HGCalTowerMap2DImpl::towerGeometryHelper_
private

Definition at line 37 of file HGCalTowerMap2DImpl.h.

Referenced by buildTowerMap2D(), and newTowerMaps().

HGCalTriggerTools HGCalTowerMap2DImpl::triggerTools_
private

Definition at line 34 of file HGCalTowerMap2DImpl.h.

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

bool HGCalTowerMap2DImpl::useLayerWeights_
private

Definition at line 32 of file HGCalTowerMap2DImpl.h.

Referenced by buildTowerMap2D().