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:65
int globalBin(int etaBin, int phiBin) const
Definition: TICLLayerTile.h:52

◆ 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 62 of file TICLLayerTile.h.

References TICLLayerTileT< T >::tile_.

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

◆ 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, and AlignmentTrackSelector_cfi::phiMin.

36  {
37  int etaBinMin = etaBin(etaMin);
38  int etaBinMax = etaBin(etaMax);
39  int phiBinMin = phiBin(phiMin);
40  int phiBinMax = phiBin(phiMax);
41  // If the search window cross the phi-bin boundary, add T::nPhiBins to the
42  // MAx value. This guarantees that the caller can perform a valid doule
43  // loop on eta and phi. It is the caller responsibility to perform a module
44  // operation on the phiBin values returned by this function, to explore the
45  // correct bins.
46  if (phiBinMax < phiBinMin) {
47  phiBinMax += T::nPhiBins;
48  }
49  return std::array<int, 4>({{etaBinMin, etaBinMax, phiBinMin, phiBinMax}});
50  }
int etaBin(float eta) const
Definition: TICLLayerTile.h:19
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