CMS 3D CMS Logo

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

#include <CaloClusterer.h>

Public Member Functions

void clear ()
 
float eta (int icell) const
 
void fill (const T &val)
 
const Gridgrid () const
 
 GridData ()
 
 GridData (const Grid &grid)
 
int ieta (int icell) const
 
int iphi (int icell) const
 
const Tneigh (int icell, unsigned int idx) const
 
Toperator() (float eta, float phi)
 
const Toperator() (float eta, float phi) const
 
GridData< T > & operator+= (const GridData< T > &other)
 
GridData< T > & operator= (const GridData< T > &other)
 
Toperator[] (int icell)
 
const Toperator[] (int icell) const
 
float phi (int icell) const
 
unsigned int size () const
 
void zero ()
 

Private Attributes

std::vector< Tdata_
 
const T empty_
 
const Gridgrid_
 

Detailed Description

template<typename T>
class l1tpf_calo::GridData< T >

Definition at line 96 of file CaloClusterer.h.

Constructor & Destructor Documentation

◆ GridData() [1/2]

template<typename T>
l1tpf_calo::GridData< T >::GridData ( )
inline

Definition at line 98 of file CaloClusterer.h.

98 : grid_(nullptr), data_(), empty_() {}

◆ GridData() [2/2]

template<typename T>
l1tpf_calo::GridData< T >::GridData ( const Grid grid)
inline

Definition at line 99 of file CaloClusterer.h.

99 : grid_(&grid), data_(grid.size()), empty_() {}

Member Function Documentation

◆ clear()

template<typename T>
void l1tpf_calo::GridData< T >::clear ( void  )
inline

Definition at line 139 of file CaloClusterer.h.

139  {
140  for (T &t : data_)
141  t.clear();
142  }

Referenced by l1tpf_calo::SimpleCaloLinker::run().

◆ eta()

template<typename T>
float l1tpf_calo::GridData< T >::eta ( int  icell) const
inline

◆ fill()

template<typename T>
void l1tpf_calo::GridData< T >::fill ( const T val)
inline

◆ grid()

template<typename T>
const Grid& l1tpf_calo::GridData< T >::grid ( ) const
inline

◆ ieta()

template<typename T>
int l1tpf_calo::GridData< T >::ieta ( int  icell) const
inline

Definition at line 110 of file CaloClusterer.h.

110 { return grid().ieta(icell); }

◆ iphi()

template<typename T>
int l1tpf_calo::GridData< T >::iphi ( int  icell) const
inline

Definition at line 111 of file CaloClusterer.h.

111 { return grid().iphi(icell); }

◆ neigh()

template<typename T>
const T& l1tpf_calo::GridData< T >::neigh ( int  icell,
unsigned int  idx 
) const
inline

Definition at line 116 of file CaloClusterer.h.

116  {
117  int ineigh = grid_->neighbour(icell, idx);
118  return (ineigh < 0 ? empty_ : data_[ineigh]);
119  }

◆ operator()() [1/2]

template<typename T>
T& l1tpf_calo::GridData< T >::operator() ( float  eta,
float  phi 
)
inline

Definition at line 101 of file CaloClusterer.h.

101 { return data_[grid_->find_cell(eta, phi)]; }

◆ operator()() [2/2]

template<typename T>
const T& l1tpf_calo::GridData< T >::operator() ( float  eta,
float  phi 
) const
inline

Definition at line 102 of file CaloClusterer.h.

102 { return data_[grid_->find_cell(eta, phi)]; }

◆ operator+=()

template<typename T>
GridData<T>& l1tpf_calo::GridData< T >::operator+= ( const GridData< T > &  other)
inline

Definition at line 126 of file CaloClusterer.h.

126  {
127  assert(grid_ == other.grid_);
128  for (unsigned int i = 0, n = data_.size(); i < n; ++i) {
129  data_[i] += other.data_[i];
130  }
131  return *this;
132  }

◆ operator=()

template<typename T>
GridData<T>& l1tpf_calo::GridData< T >::operator= ( const GridData< T > &  other)
inline

Definition at line 121 of file CaloClusterer.h.

121  {
122  assert(grid_ == other.grid_);
123  data_ = other.data_;
124  return *this;
125  }

◆ operator[]() [1/2]

template<typename T>
T& l1tpf_calo::GridData< T >::operator[] ( int  icell)
inline

Definition at line 113 of file CaloClusterer.h.

113 { return data_[icell]; }

◆ operator[]() [2/2]

template<typename T>
const T& l1tpf_calo::GridData< T >::operator[] ( int  icell) const
inline

Definition at line 114 of file CaloClusterer.h.

114 { return data_[icell]; }

◆ phi()

template<typename T>
float l1tpf_calo::GridData< T >::phi ( int  icell) const
inline

◆ size()

template<typename T>
unsigned int l1tpf_calo::GridData< T >::size ( void  ) const
inline

Definition at line 106 of file CaloClusterer.h.

106 { return data_.size(); }

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

◆ zero()

template<typename T>
void l1tpf_calo::GridData< T >::zero ( )
inline

Definition at line 136 of file CaloClusterer.h.

136 { fill(T()); }

Member Data Documentation

◆ data_

template<typename T>
std::vector<T> l1tpf_calo::GridData< T >::data_
private

◆ empty_

template<typename T>
const T l1tpf_calo::GridData< T >::empty_
private

Definition at line 147 of file CaloClusterer.h.

Referenced by l1tpf_calo::GridData< PreCluster >::neigh().

◆ grid_

template<typename T>
const Grid* l1tpf_calo::GridData< T >::grid_
private
mps_fire.i
i
Definition: mps_fire.py:428
l1tpf_calo::GridData::empty_
const T empty_
Definition: CaloClusterer.h:147
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
l1tpf_calo::GridData::fill
void fill(const T &val)
Definition: CaloClusterer.h:135
l1tpf_calo::GridData::grid
const Grid & grid() const
Definition: CaloClusterer.h:104
cms::cuda::assert
assert(be >=bs)
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
l1tpf_calo::Grid::iphi
int iphi(int icell) const
Definition: CaloClusterer.h:33
trackingPlots.other
other
Definition: trackingPlots.py:1467
l1tpf_calo::Grid::phi
float phi(int icell) const
Definition: CaloClusterer.h:29
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
l1tpf_calo::Grid::size
unsigned int size() const
Definition: CaloClusterer.h:25
l1tpf_calo::Grid::neighbour
int neighbour(int icell, unsigned int idx) const
Definition: CaloClusterer.h:27
l1tpf_calo::GridData::data_
std::vector< T > data_
Definition: CaloClusterer.h:146
l1tpf_calo::GridData::eta
float eta(int icell) const
Definition: CaloClusterer.h:108
l1tpf_calo::GridData::phi
float phi(int icell) const
Definition: CaloClusterer.h:109
heppy_batch.val
val
Definition: heppy_batch.py:351
T
long double T
Definition: Basic3DVectorLD.h:48
l1tpf_calo::Grid::ieta
int ieta(int icell) const
Definition: CaloClusterer.h:32
l1tpf_calo::GridData::grid_
const Grid * grid_
Definition: CaloClusterer.h:145
l1tpf_calo::Grid::eta
float eta(int icell) const
Definition: CaloClusterer.h:28
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
l1tpf_calo::Grid::find_cell
virtual int find_cell(float eta, float phi) const =0