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 (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

◆ 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 ( double  eta,
double  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  {
16  tile_[globalBin(eta, phi)].push_back(layerClusterId);
17  }
std::array< std::vector< unsigned int >, T::nBins > tile_
Definition: TICLLayerTile.h:76
int globalBin(int etaBin, int phiBin) const
Definition: TICLLayerTile.h:63

◆ globalBin() [1/2]

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

◆ globalBin() [2/2]

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

◆ operator[]()

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

Definition at line 73 of file TICLLayerTile.h.

References TICLLayerTileT< T >::tile_.

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

◆ phiBin()

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, phi, 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

◆ 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.

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().

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

Member Data Documentation

◆ tile_

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