CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HGCalHistoSeedingImpl::HistogramT< T > Class Template Reference

Public Types

using const_iterator = typename Data::const_iterator
 
using Data = std::vector< T >
 
using iterator = typename Data::iterator
 

Public Member Functions

Tat (int zside, unsigned x1, unsigned x2)
 
const Tat (int zside, unsigned x1, unsigned x2) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
 HistogramT ()
 
 HistogramT (unsigned bins1, unsigned bins2)
 

Private Member Functions

unsigned index (int zside, unsigned x1, unsigned x2) const
 

Private Attributes

unsigned bins1_ = 0
 
unsigned bins2_ = 0
 
unsigned bins_ = 0
 
Data histogram_
 

Static Private Attributes

static constexpr unsigned kSides_ = 2
 

Detailed Description

template<typename T>
class HGCalHistoSeedingImpl::HistogramT< T >

Definition at line 23 of file HGCalHistoSeedingImpl.h.

Member Typedef Documentation

◆ const_iterator

template<typename T>
using HGCalHistoSeedingImpl::HistogramT< T >::const_iterator = typename Data::const_iterator

Definition at line 27 of file HGCalHistoSeedingImpl.h.

◆ Data

template<typename T>
using HGCalHistoSeedingImpl::HistogramT< T >::Data = std::vector<T>

Definition at line 25 of file HGCalHistoSeedingImpl.h.

◆ iterator

template<typename T>
using HGCalHistoSeedingImpl::HistogramT< T >::iterator = typename Data::iterator

Definition at line 26 of file HGCalHistoSeedingImpl.h.

Constructor & Destructor Documentation

◆ HistogramT() [1/2]

template<typename T>
HGCalHistoSeedingImpl::HistogramT< T >::HistogramT ( )
inline

Definition at line 30 of file HGCalHistoSeedingImpl.h.

30 : bins1_(0), bins2_(0), bins_(0) {}

◆ HistogramT() [2/2]

template<typename T>
HGCalHistoSeedingImpl::HistogramT< T >::HistogramT ( unsigned  bins1,
unsigned  bins2 
)
inline

Definition at line 31 of file HGCalHistoSeedingImpl.h.

32  : bins1_(bins1), bins2_(bins2), bins_(bins1 * bins2), histogram_(bins_ * kSides_) {}

Member Function Documentation

◆ at() [1/2]

template<typename T>
T& HGCalHistoSeedingImpl::HistogramT< T >::at ( int  zside,
unsigned  x1,
unsigned  x2 
)
inline

◆ at() [2/2]

template<typename T>
const T& HGCalHistoSeedingImpl::HistogramT< T >::at ( int  zside,
unsigned  x1,
unsigned  x2 
) const
inline

◆ begin() [1/2]

template<typename T>
iterator HGCalHistoSeedingImpl::HistogramT< T >::begin ( void  )
inline

Definition at line 38 of file HGCalHistoSeedingImpl.h.

38 { return histogram_.begin(); }

References HGCalHistoSeedingImpl::HistogramT< T >::histogram_.

◆ begin() [2/2]

template<typename T>
const_iterator HGCalHistoSeedingImpl::HistogramT< T >::begin ( void  ) const
inline

Definition at line 39 of file HGCalHistoSeedingImpl.h.

39 { return histogram_.begin(); }

References HGCalHistoSeedingImpl::HistogramT< T >::histogram_.

◆ end() [1/2]

template<typename T>
iterator HGCalHistoSeedingImpl::HistogramT< T >::end ( void  )
inline

Definition at line 40 of file HGCalHistoSeedingImpl.h.

40 { return histogram_.end(); }

References HGCalHistoSeedingImpl::HistogramT< T >::histogram_.

◆ end() [2/2]

template<typename T>
const_iterator HGCalHistoSeedingImpl::HistogramT< T >::end ( void  ) const
inline

Definition at line 41 of file HGCalHistoSeedingImpl.h.

41 { return histogram_.end(); }

References HGCalHistoSeedingImpl::HistogramT< T >::histogram_.

◆ index()

template<typename T>
unsigned HGCalHistoSeedingImpl::HistogramT< T >::index ( int  zside,
unsigned  x1,
unsigned  x2 
) const
inlineprivate

Definition at line 50 of file HGCalHistoSeedingImpl.h.

50  {
51  if (x1 >= bins1_ || x2 >= bins2_) {
52  throw cms::Exception("OutOfBound") << "Trying to access bin (" << x1 << "," << x2
53  << ") in seeding histogram of size (" << bins1_ << "," << bins2_ << ")";
54  }
55  return x2 + bins2_ * x1 + bins_ * (zside > 0 ? 1 : 0);
56  }

References HGCalHistoSeedingImpl::HistogramT< T >::bins1_, HGCalHistoSeedingImpl::HistogramT< T >::bins2_, HGCalHistoSeedingImpl::HistogramT< T >::bins_, Exception, testProducerWithPsetDescEmpty_cfi::x1, testProducerWithPsetDescEmpty_cfi::x2, and ecaldqm::zside().

Referenced by HGCalHistoSeedingImpl::HistogramT< T >::at(), and BeautifulSoup.PageElement::insert().

Member Data Documentation

◆ bins1_

template<typename T>
unsigned HGCalHistoSeedingImpl::HistogramT< T >::bins1_ = 0
private

◆ bins2_

template<typename T>
unsigned HGCalHistoSeedingImpl::HistogramT< T >::bins2_ = 0
private

◆ bins_

template<typename T>
unsigned HGCalHistoSeedingImpl::HistogramT< T >::bins_ = 0
private

◆ histogram_

template<typename T>
Data HGCalHistoSeedingImpl::HistogramT< T >::histogram_
private

◆ kSides_

template<typename T>
constexpr unsigned HGCalHistoSeedingImpl::HistogramT< T >::kSides_ = 2
staticconstexprprivate

Definition at line 44 of file HGCalHistoSeedingImpl.h.

HGCalHistoSeedingImpl::HistogramT::bins2_
unsigned bins2_
Definition: HGCalHistoSeedingImpl.h:46
HGCalHistoSeedingImpl::HistogramT::index
unsigned index(int zside, unsigned x1, unsigned x2) const
Definition: HGCalHistoSeedingImpl.h:50
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
HGCalHistoSeedingImpl::HistogramT::bins1_
unsigned bins1_
Definition: HGCalHistoSeedingImpl.h:45
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
HGCalHistoSeedingImpl::HistogramT::kSides_
static constexpr unsigned kSides_
Definition: HGCalHistoSeedingImpl.h:44
HGCalHistoSeedingImpl::HistogramT::bins_
unsigned bins_
Definition: HGCalHistoSeedingImpl.h:47
Exception
Definition: hltDiff.cc:246
HGCalHistoSeedingImpl::HistogramT::histogram_
Data histogram_
Definition: HGCalHistoSeedingImpl.h:48