CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TICLLayerTileT< T > Class Template Reference

#include <TICLLayerTile.h>

Public Member Functions

void clear ()
 
int etaBin (float eta) const
 
void fill (double eta, double phi, unsigned int layerClusterId)
 
int globalBin (double eta, double phi) const
 
int globalBin (int etaBin, int phiBin) const
 
const std::vector< unsigned int > & operator[] (int globalBinId) const
 
int phiBin (float phi) const
 
std::array< int, 4 > searchBoxEtaPhi (float etaMin, float etaMax, float phiMin, float phiMax) const
 
int typeT () const
 

Private Attributes

std::array< std::vector< unsigned int >, T::nBins > tile_
 

Detailed Description

template<typename T>
class TICLLayerTileT< T >

Definition at line 11 of file TICLLayerTile.h.

Member Function Documentation

◆ clear()

template<typename T >
void TICLLayerTileT< T >::clear ( void  )
inline

◆ etaBin()

template<typename T >
int TICLLayerTileT< T >::etaBin ( float  eta) const
inline

Definition at line 19 of file TICLLayerTile.h.

19  {
20  constexpr float etaRange = T::maxEta - T::minEta;
21  static_assert(etaRange >= 0.f);
22  float r = T::nEtaBins / etaRange;
23  int etaBin = (std::abs(eta) - T::minEta) * r;
24  etaBin = std::clamp(etaBin, 0, T::nEtaBins - 1);
25  return etaBin;
26  }

References funct::abs(), PVValHelper::eta, generateTowerEtThresholdLUT::etaRange, f, maxEta, EgHLTOffEleSelection_cfi::minEta, L1TMuonDQMOffline_cfi::nEtaBins, and alignCSCRings::r.

Referenced by TICLLayerTileT< T >::globalBin(), and TICLLayerTileT< T >::searchBoxEtaPhi().

◆ fill()

template<typename T >
void TICLLayerTileT< T >::fill ( double  eta,
double  phi,
unsigned int  layerClusterId 
)
inline

Definition at line 13 of file TICLLayerTile.h.

13  {
14  tile_[globalBin(eta, phi)].push_back(layerClusterId);
15  }

References PVValHelper::eta, TICLLayerTileT< T >::globalBin(), phi, and TICLLayerTileT< T >::tile_.

◆ globalBin() [1/2]

template<typename T >
int TICLLayerTileT< T >::globalBin ( double  eta,
double  phi 
) const
inline

◆ globalBin() [2/2]

template<typename T >
int TICLLayerTileT< T >::globalBin ( int  etaBin,
int  phiBin 
) const
inline

◆ operator[]()

template<typename T >
const std::vector<unsigned int>& TICLLayerTileT< T >::operator[] ( int  globalBinId) const
inline

Definition at line 54 of file TICLLayerTile.h.

54 { return tile_[globalBinId]; }

References TICLLayerTileT< T >::tile_.

◆ phiBin()

template<typename T >
int TICLLayerTileT< T >::phiBin ( float  phi) const
inline

Definition at line 28 of file TICLLayerTile.h.

28  {
29  auto normPhi = normalizedPhi(phi);
30  float r = T::nPhiBins * M_1_PI * 0.5f;
31  int phiBin = (normPhi + M_PI) * r;
32 
33  return phiBin;
34  }

References M_PI, normalizedPhi(), ecaldqm::binning::nPhiBins, phi, and alignCSCRings::r.

Referenced by TICLLayerTileT< T >::globalBin(), and TICLLayerTileT< T >::searchBoxEtaPhi().

◆ searchBoxEtaPhi()

template<typename T >
std::array<int, 4> TICLLayerTileT< T >::searchBoxEtaPhi ( float  etaMin,
float  etaMax,
float  phiMin,
float  phiMax 
) const
inline

Definition at line 36 of file TICLLayerTile.h.

36  {
37  int etaBinMin = etaBin(etaMin);
38  int etaBinMax = etaBin(etaMax);
39  int phiBinMin = phiBin(phiMin);
40  int phiBinMax = phiBin(phiMax);
41  return std::array<int, 4>({{etaBinMin, etaBinMax, phiBinMin, phiBinMax}});
42  }

References TICLLayerTileT< T >::etaBin(), ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, TICLLayerTileT< T >::phiBin(), AlignmentTrackSelector_cfi::phiMax, and AlignmentTrackSelector_cfi::phiMin.

◆ typeT()

template<typename T >
int TICLLayerTileT< T >::typeT ( ) const
inline

Definition at line 17 of file TICLLayerTile.h.

17 { return T::type; }

Member Data Documentation

◆ tile_

template<typename T >
std::array<std::vector<unsigned int>, T::nBins> TICLLayerTileT< T >::tile_
private
TICLLayerTileT::globalBin
int globalBin(int etaBin, int phiBin) const
Definition: TICLLayerTile.h:44
ALCARECOTkAlBeamHalo_cff.etaMin
etaMin
GeV.
Definition: ALCARECOTkAlBeamHalo_cff.py:32
generateTowerEtThresholdLUT.etaRange
etaRange
Definition: generateTowerEtThresholdLUT.py:55
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PVValHelper::eta
Definition: PVValidationHelpers.h:70
AlignmentTrackSelector_cfi.phiMin
phiMin
Definition: AlignmentTrackSelector_cfi.py:18
maxEta
double maxEta
Definition: PFJetBenchmarkAnalyzer.cc:76
AlignmentTrackSelector_cfi.phiMax
phiMax
Definition: AlignmentTrackSelector_cfi.py:17
normalizedPhi
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:8
TICLLayerTileT::phiBin
int phiBin(float phi) const
Definition: TICLLayerTile.h:28
seedmultiplicitymonitor_newtracking_cfi.nBins
nBins
Definition: seedmultiplicitymonitor_newtracking_cfi.py:8
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
TICLLayerTileT::etaBin
int etaBin(float eta) const
Definition: TICLLayerTile.h:19
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
alignCSCRings.r
r
Definition: alignCSCRings.py:93
TICLLayerTileT::tile_
std::array< std::vector< unsigned int >, T::nBins > tile_
Definition: TICLLayerTile.h:57
DDAxes::phi
L1TMuonDQMOffline_cfi.nEtaBins
nEtaBins
Definition: L1TMuonDQMOffline_cfi.py:21
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition: ALCARECOTkAlBeamHalo_cff.py:33
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ecaldqm::binning::nPhiBins
Definition: MESetBinningUtils.h:70
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
EgHLTOffEleSelection_cfi.minEta
minEta
Definition: EgHLTOffEleSelection_cfi.py:11
TICLLayerTileT::clear
void clear()
Definition: TICLLayerTile.h:48