CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
HBHEChannelGroups Class Reference

#include <HBHEChannelGroups.h>

Public Member Functions

unsigned getGroup (const unsigned linearChannel) const
 
const uint32_t * groupData () const
 
 HBHEChannelGroups ()
 
 HBHEChannelGroups (const unsigned *data, const unsigned len)
 
unsigned largestGroupNumber () const
 
bool operator!= (const HBHEChannelGroups &r) const
 
bool operator== (const HBHEChannelGroups &r) const
 
void setGroup (const unsigned linearChannel, const unsigned groupNum)
 
unsigned size () const
 

Private Member Functions

template<class Archive >
void load (Archive &ar, const unsigned)
 
template<class Archive >
void save (Archive &ar, const unsigned) const
 
bool validate () const
 

Private Attributes

std::vector< uint32_t > group_
 

Friends

class boost::serialization::access
 

Detailed Description

Definition at line 12 of file HBHEChannelGroups.h.

Constructor & Destructor Documentation

◆ HBHEChannelGroups() [1/2]

HBHEChannelGroups::HBHEChannelGroups ( )
inline

◆ HBHEChannelGroups() [2/2]

HBHEChannelGroups::HBHEChannelGroups ( const unsigned *  data,
const unsigned  len 
)
inline

Definition at line 21 of file HBHEChannelGroups.h.

References Exception, and validate().

21  : group_(data, data + len) {
22  if (!validate())
23  throw cms::Exception("In HBHEChannelGroups constructor: invalid input data");
24  }
std::vector< uint32_t > group_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
bool validate() const

Member Function Documentation

◆ getGroup()

unsigned HBHEChannelGroups::getGroup ( const unsigned  linearChannel) const
inline

Definition at line 37 of file HBHEChannelGroups.h.

References group_.

Referenced by HcalInterpolatedPulseColl::getChannelPulse().

37 { return group_.at(linearChannel); }
std::vector< uint32_t > group_

◆ groupData()

const uint32_t* HBHEChannelGroups::groupData ( ) const
inline

Definition at line 35 of file HBHEChannelGroups.h.

References group_.

35 { return group_.empty() ? nullptr : &group_[0]; }
std::vector< uint32_t > group_

◆ largestGroupNumber()

unsigned HBHEChannelGroups::largestGroupNumber ( ) const
inline

Definition at line 39 of file HBHEChannelGroups.h.

References group_, and mps_fire::i.

Referenced by HcalInterpolatedPulseColl::HcalInterpolatedPulseColl().

39  {
40  unsigned lg = 0;
41  const unsigned sz = group_.size();
42  const uint32_t* dat = sz ? &group_[0] : nullptr;
43  for (unsigned i = 0; i < sz; ++i)
44  if (dat[i] > lg)
45  lg = dat[i];
46  return lg;
47  }
std::vector< uint32_t > group_

◆ load()

template<class Archive >
void HBHEChannelGroups::load ( Archive &  ar,
const unsigned   
)
inlineprivate

Definition at line 69 of file HBHEChannelGroups.h.

References Exception, group_, and validate().

Referenced by MatrixToProcess.MatrixToProcess::getProcess(), MatrixToProcess.MatrixToProcess::listAll(), and ConfigBuilder.ConfigBuilder::prepare_FILTER().

69  {
70  ar & group_;
71  if (!validate())
72  throw cms::Exception("In HBHEChannelGroups::load: invalid data");
73  }
std::vector< uint32_t > group_
bool validate() const

◆ operator!=()

bool HBHEChannelGroups::operator!= ( const HBHEChannelGroups r) const
inline

Definition at line 52 of file HBHEChannelGroups.h.

References alignCSCRings::r.

52 { return !(*this == r); }

◆ operator==()

bool HBHEChannelGroups::operator== ( const HBHEChannelGroups r) const
inline

Definition at line 50 of file HBHEChannelGroups.h.

References group_, and alignCSCRings::r.

50 { return group_ == r.group_; }
std::vector< uint32_t > group_

◆ save()

template<class Archive >
void HBHEChannelGroups::save ( Archive &  ar,
const unsigned   
) const
inlineprivate

Definition at line 62 of file HBHEChannelGroups.h.

References Exception, group_, and validate().

Referenced by SpecificationBuilder_cfi.Specification::saveAll().

62  {
63  if (!validate())
64  throw cms::Exception("In HBHEChannelGroups::save: invalid data");
65  ar & group_;
66  }
std::vector< uint32_t > group_
bool validate() const

◆ setGroup()

void HBHEChannelGroups::setGroup ( const unsigned  linearChannel,
const unsigned  groupNum 
)
inline

Definition at line 30 of file HBHEChannelGroups.h.

References group_.

30 { group_.at(linearChannel) = groupNum; }
std::vector< uint32_t > group_

◆ size()

unsigned HBHEChannelGroups::size ( void  ) const
inline

Definition at line 33 of file HBHEChannelGroups.h.

References group_.

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

33 { return group_.size(); }
std::vector< uint32_t > group_

◆ validate()

bool HBHEChannelGroups::validate ( ) const
inlineprivate

Definition at line 57 of file HBHEChannelGroups.h.

References HBHELinearMap::ChannelCount, and group_.

Referenced by HBHEChannelGroups(), load(), and save().

57 { return group_.size() == HBHELinearMap::ChannelCount; }
std::vector< uint32_t > group_

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 59 of file HBHEChannelGroups.h.

Member Data Documentation

◆ group_

std::vector<uint32_t> HBHEChannelGroups::group_
private