CMS 3D CMS Logo

List of all members | Public Member Functions
HGCalTowerMap3DImpl Class Reference

#include <HGCalTowerMap3DImpl.h>

Public Member Functions

void buildTowerMap3D (const std::vector< edm::Ptr< l1t::HGCalTowerMap >> &towerMaps2D, l1t::HGCalTowerBxCollection &towerMap)
 
 HGCalTowerMap3DImpl ()
 

Detailed Description

Definition at line 11 of file HGCalTowerMap3DImpl.h.

Constructor & Destructor Documentation

HGCalTowerMap3DImpl::HGCalTowerMap3DImpl ( )

Definition at line 12 of file HGCalTowerMap3DImpl.cc.

13 {
14 
15 }

Member Function Documentation

void HGCalTowerMap3DImpl::buildTowerMap3D ( const std::vector< edm::Ptr< l1t::HGCalTowerMap >> &  towerMaps2D,
l1t::HGCalTowerBxCollection towerMap 
)

Definition at line 21 of file HGCalTowerMap3DImpl.cc.

References mps_fire::i, genParticles_cff::map, fftjetcommon_cfi::nEtaBins, l1t::HGCalTowerMap::nEtaBins(), l1t::HGCalTowerMap::nPhiBins(), ecaldqm::binning::nPhiBins, reco::LeafCandidate::pt(), BXVector< T >::resize(), BXVector< T >::set(), and l1t::HGCalTowerMap::tower().

23  {
24 
25  l1t::HGCalTowerMap towerMap;
26 
27  for(const auto& map : towerMapsPtrs){
28  if(towerMap.nEtaBins()==0) towerMap = (*map);
29  else towerMap += (*map);
30  }
31 
32  int nEtaBins = towerMap.nEtaBins();
33  int nPhiBins = towerMap.nPhiBins();
34 
35  vector<l1t::HGCalTower> towersTmp;
36 
37  for(int iEta=-nEtaBins; iEta<=nEtaBins; iEta++){
38  if(iEta==0) continue;
39  for(int iPhi=0; iPhi<nPhiBins; iPhi++){
40  const l1t::HGCalTower& tower = towerMap.tower(iEta,iPhi);
41  if(tower.pt()>0) towersTmp.push_back(tower);
42  }
43  }
44 
45  towers.resize(0, towersTmp.size());
46  int i=0;
47  for(auto tower : towersTmp){
48  towers.set( 0, i, tower);
49  i++;
50  }
51 
52 
53 }
virtual double pt() const final
transverse momentum
int nEtaBins() const
Definition: HGCalTowerMap.h:29
const l1t::HGCalTower & tower(int iEta, int iPhi) const
Definition: HGCalTowerMap.h:33
int nPhiBins() const
Definition: HGCalTowerMap.h:30