CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Attributes
TICLLayerTileT< T > Class Template Reference

#include <TICLLayerTile.h>

Public Types

typedef T type
 

Public Member Functions

void clear ()
 
int etaBin (float eta) const
 
void fill (double eta, double phi, unsigned int layerClusterId)
 
int globalBin (int etaBin, int phiBin) const
 
int globalBin (double eta, double phi) 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
 

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 Typedef Documentation

template<typename T >
typedef T TICLLayerTileT< T >::type

Definition at line 13 of file TICLLayerTile.h.

Member Function Documentation

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

Definition at line 48 of file TICLLayerTile.h.

References dqmiolumiharvest::j, L1TMuonDQMOffline_cfi::nEtaBins, ecaldqm::binning::nPhiBins, and TICLLayerTileT< T >::tile_.

Referenced by BeautifulSoup.Tag::setString().

48  {
49  auto nBins = T::nEtaBins * T::nPhiBins;
50  for (int j = 0; j < nBins; ++j)
51  tile_[j].clear();
52  }
std::array< std::vector< unsigned int >, T::nBins > tile_
Definition: TICLLayerTile.h:57
template<typename T >
int TICLLayerTileT< T >::etaBin ( float  eta) const
inline

Definition at line 19 of file TICLLayerTile.h.

References funct::abs(), generateTowerEtThresholdLUT::etaRange, validate-o2o-wbm::f, maxEta, L1TMuonDQMOffline_cfi::nEtaBins, and alignCSCRings::r.

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

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  }
int etaBin(float eta) const
Definition: TICLLayerTile.h:19
double maxEta
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
template<typename T >
void TICLLayerTileT< T >::fill ( double  eta,
double  phi,
unsigned int  layerClusterId 
)
inline

Definition at line 15 of file TICLLayerTile.h.

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

15  {
16  tile_[globalBin(eta, phi)].push_back(layerClusterId);
17  }
int globalBin(int etaBin, int phiBin) const
Definition: TICLLayerTile.h:44
std::array< std::vector< unsigned int >, T::nBins > tile_
Definition: TICLLayerTile.h:57
template<typename T >
int TICLLayerTileT< T >::globalBin ( int  etaBin,
int  phiBin 
) const
inline

Definition at line 44 of file TICLLayerTile.h.

References ecaldqm::binning::nPhiBins.

Referenced by TICLLayerTileT< T >::fill().

44 { return phiBin + etaBin * T::nPhiBins; }
int etaBin(float eta) const
Definition: TICLLayerTile.h:19
int phiBin(float phi) const
Definition: TICLLayerTile.h:28
template<typename T >
int TICLLayerTileT< T >::globalBin ( double  eta,
double  phi 
) const
inline
template<typename T >
const std::vector<unsigned int>& TICLLayerTileT< T >::operator[] ( int  globalBinId) const
inline

Definition at line 54 of file TICLLayerTile.h.

References TICLLayerTileT< T >::tile_.

54 { return tile_[globalBinId]; }
std::array< std::vector< unsigned int >, T::nBins > tile_
Definition: TICLLayerTile.h:57
template<typename T >
int TICLLayerTileT< T >::phiBin ( float  phi) const
inline

Definition at line 28 of file TICLLayerTile.h.

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

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

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  }
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:8
int phiBin(float phi) const
Definition: TICLLayerTile.h:28
#define M_PI
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.

References TICLLayerTileT< T >::etaBin(), and TICLLayerTileT< T >::phiBin().

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  }
int etaBin(float eta) const
Definition: TICLLayerTile.h:19
tuple etaMin
Definition: Puppi_cff.py:45
int phiBin(float phi) const
Definition: TICLLayerTile.h:28
tuple etaMax
Definition: Puppi_cff.py:46

Member Data Documentation

template<typename T >
std::array<std::vector<unsigned int>, T::nBins> TICLLayerTileT< T >::tile_
private