CMS 3D CMS Logo

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

◆ type

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

Definition at line 13 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

◆ fill()

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

Definition at line 15 of file TICLLayerTile.h.

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

15 { tile_[globalBin(eta, phi)].push_back(layerClusterId); }
std::array< std::vector< unsigned int >, T::nBins > tile_
Definition: TICLLayerTile.h:74
int globalBin(int etaBin, int phiBin) const
Definition: TICLLayerTile.h:61

◆ globalBin() [1/2]

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

Definition at line 61 of file TICLLayerTile.h.

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

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

61 { return phiBin + etaBin * T::nPhiBins; }
int etaBin(float eta) const
Definition: TICLLayerTile.h:17
int phiBin(float phi) const
Definition: TICLLayerTile.h:26
static constexpr int nPhiBins

◆ globalBin() [2/2]

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

◆ operator[]()

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

Definition at line 71 of file TICLLayerTile.h.

References TICLLayerTileT< T >::tile_.

71 { return tile_[globalBinId]; }
std::array< std::vector< unsigned int >, T::nBins > tile_
Definition: TICLLayerTile.h:74

◆ phiBin()

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

Definition at line 26 of file TICLLayerTile.h.

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

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

26  {
27  auto normPhi = normalizedPhi(phi);
28  float r = T::nPhiBins * M_1_PI * 0.5f;
29  int phiBin = (normPhi + M_PI) * r;
30 
31  return phiBin;
32  }
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:8
int phiBin(float phi) const
Definition: TICLLayerTile.h:26
#define M_PI
static constexpr int nPhiBins

◆ searchBoxEtaPhi()

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

Definition at line 34 of file TICLLayerTile.h.

References TICLLayerTileT< T >::etaBin(), ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, ecaldqm::binning::nPhiBins, TICLLayerTileT< T >::phiBin(), AlignmentTrackSelector_cfi::phiMax, AlignmentTrackSelector_cfi::phiMin, and edm::swap().

34  {
35  // The tile only handles one endcap at a time and does not hold mixed eta
36  // values.
37  if (etaMin * etaMax < 0) {
38  return std::array<int, 4>({{0, 0, 0, 0}});
39  }
40  if (etaMax - etaMin < 0) {
41  return std::array<int, 4>({{0, 0, 0, 0}});
42  }
43  int etaBinMin = etaBin(etaMin);
44  int etaBinMax = etaBin(etaMax);
45  int phiBinMin = phiBin(phiMin);
46  int phiBinMax = phiBin(phiMax);
47  if (etaMin < 0) {
48  std::swap(etaBinMin, etaBinMax);
49  }
50  // If the search window cross the phi-bin boundary, add T::nPhiBins to the
51  // MAx value. This guarantees that the caller can perform a valid doule
52  // loop on eta and phi. It is the caller responsibility to perform a module
53  // operation on the phiBin values returned by this function, to explore the
54  // correct bins.
55  if (phiBinMax < phiBinMin) {
56  phiBinMax += T::nPhiBins;
57  }
58  return std::array<int, 4>({{etaBinMin, etaBinMax, phiBinMin, phiBinMax}});
59  }
int etaBin(float eta) const
Definition: TICLLayerTile.h:17
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112
int phiBin(float phi) const
Definition: TICLLayerTile.h:26
static constexpr int nPhiBins

Member Data Documentation

◆ tile_

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