CMS 3D CMS Logo

HGCalTowerMap3DImpl.cc
Go to the documentation of this file.
1 
8 
10 
11 
13 {
14 
15 }
16 
17 
18 
19 
20 
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 }
int nEtaBins() const
Definition: HGCalTowerMap.h:29
double pt() const final
transverse momentum
const l1t::HGCalTower & tower(int iEta, int iPhi) const
Definition: HGCalTowerMap.h:33
int nPhiBins() const
Definition: HGCalTowerMap.h:30
void buildTowerMap3D(const std::vector< edm::Ptr< l1t::HGCalTowerMap >> &towerMaps2D, l1t::HGCalTowerBxCollection &towerMap)
void set(int bx, unsigned i, const T &object)
void resize(int bx, unsigned size)