CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
l1tpf_calo::GridSelector Class Reference

#include <CaloClusterer.h>

Public Member Functions

void fill (float pt, float eta, float phi, unsigned int index)
 
 GridSelector (std::vector< double > etaBounds, std::vector< double > phiBounds, std::vector< unsigned int > maxClusters)
 
std::vector< unsigned int > returnSorted ()
 
 ~GridSelector ()
 

Private Attributes

const std::vector< double > etaBounds_
 
const std::vector< unsigned int > maxClustersEtaPhi_
 
const std::vector< double > phiBounds_
 
std::vector< std::vector< std::pair< float, unsigned int > > > regionPtIndices_
 

Detailed Description

Definition at line 330 of file CaloClusterer.h.

Constructor & Destructor Documentation

◆ GridSelector()

l1tpf_calo::GridSelector::GridSelector ( std::vector< double >  etaBounds,
std::vector< double >  phiBounds,
std::vector< unsigned int >  maxClusters 
)

Definition at line 759 of file CaloClusterer.cc.

765  regionPtIndices_(!maxClusters.empty() ? maxClusters.size() : 1) {}
const std::vector< unsigned int > maxClustersEtaPhi_
std::vector< std::vector< std::pair< float, unsigned int > > > regionPtIndices_
const std::vector< double > phiBounds_
const std::vector< double > etaBounds_

◆ ~GridSelector()

l1tpf_calo::GridSelector::~GridSelector ( )
inline

Definition at line 333 of file CaloClusterer.h.

333 {}

Member Function Documentation

◆ fill()

void l1tpf_calo::GridSelector::fill ( float  pt,
float  eta,
float  phi,
unsigned int  index 
)

Definition at line 767 of file CaloClusterer.cc.

References PVValHelper::eta, and DiDispStaMuonMonitor_cfi::pt.

Referenced by l1tpf_calo::SingleCaloClusterer::fetchCells(), and l1tpf::PFClusterProducerFromL1EGClusters::produce().

767  {
768  if (!maxClustersEtaPhi_.empty()) {
769  unsigned int etai = etaBounds_.size();
770  for (unsigned int ie = 0; ie < etaBounds_.size() - 1; ie++) {
771  if (eta >= etaBounds_[ie] && eta < etaBounds_[ie + 1]) {
772  etai = ie;
773  break;
774  }
775  }
776  unsigned int phii = phiBounds_.size();
777  for (unsigned int ip = 0; ip < phiBounds_.size() - 1; ip++) {
778  if (phi >= phiBounds_[ip] && phi < phiBounds_[ip + 1]) {
779  phii = ip;
780  break;
781  }
782  }
783  if (etai < etaBounds_.size() && phii < phiBounds_.size()) {
784  regionPtIndices_[etai * (phiBounds_.size() - 1) + phii].emplace_back(pt, index);
785  }
786  } else {
787  regionPtIndices_[0].emplace_back(pt, index);
788  }
789 }
const std::vector< unsigned int > maxClustersEtaPhi_
std::vector< std::vector< std::pair< float, unsigned int > > > regionPtIndices_
const std::vector< double > phiBounds_
const std::vector< double > etaBounds_

◆ returnSorted()

std::vector< unsigned int > l1tpf_calo::GridSelector::returnSorted ( )

Definition at line 791 of file CaloClusterer.cc.

References dqmdumpme::indices, AlCaHLTBitMon_ParallelJobs::p, and jetUpdater_cfi::sort.

Referenced by l1tpf_calo::SingleCaloClusterer::fetchCells(), and l1tpf::PFClusterProducerFromL1EGClusters::produce().

791  {
792  std::vector<unsigned int> indices;
793  for (auto &regionPtIndex : regionPtIndices_) {
794  std::sort(regionPtIndex.begin(), regionPtIndex.end(), std::greater<std::pair<float, unsigned int>>());
795  for (const auto &p : regionPtIndex) {
796  indices.push_back(p.second);
797  }
798  }
799  return indices;
800 }
std::vector< std::vector< std::pair< float, unsigned int > > > regionPtIndices_

Member Data Documentation

◆ etaBounds_

const std::vector<double> l1tpf_calo::GridSelector::etaBounds_
private

Definition at line 338 of file CaloClusterer.h.

◆ maxClustersEtaPhi_

const std::vector<unsigned int> l1tpf_calo::GridSelector::maxClustersEtaPhi_
private

Definition at line 340 of file CaloClusterer.h.

◆ phiBounds_

const std::vector<double> l1tpf_calo::GridSelector::phiBounds_
private

Definition at line 339 of file CaloClusterer.h.

◆ regionPtIndices_

std::vector<std::vector<std::pair<float, unsigned int> > > l1tpf_calo::GridSelector::regionPtIndices_
private

Definition at line 341 of file CaloClusterer.h.