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

Definition at line 14 of file HBHEChannelGroups.h.

◆ HBHEChannelGroups() [2/2]

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

Definition at line 21 of file HBHEChannelGroups.h.

21  : group_(data, data + len) {
22  if (!validate())
23  throw cms::Exception("In HBHEChannelGroups constructor: invalid input data");
24  }

References Exception, and validate().

Member Function Documentation

◆ getGroup()

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

Definition at line 37 of file HBHEChannelGroups.h.

37 { return group_.at(linearChannel); }

References group_.

Referenced by HcalInterpolatedPulseColl::getChannelPulse().

◆ groupData()

const uint32_t* HBHEChannelGroups::groupData ( ) const
inline

Definition at line 35 of file HBHEChannelGroups.h.

35 { return group_.empty() ? nullptr : &group_[0]; }

References group_.

◆ largestGroupNumber()

unsigned HBHEChannelGroups::largestGroupNumber ( ) const
inline

Definition at line 39 of file HBHEChannelGroups.h.

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  }

References group_, and mps_fire::i.

Referenced by HcalInterpolatedPulseColl::HcalInterpolatedPulseColl().

◆ load()

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

Definition at line 69 of file HBHEChannelGroups.h.

69  {
70  ar& group_;
71  if (!validate())
72  throw cms::Exception("In HBHEChannelGroups::load: invalid data");
73  }

References Exception, group_, and validate().

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

◆ operator!=()

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

Definition at line 52 of file HBHEChannelGroups.h.

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

References alignCSCRings::r.

◆ operator==()

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

Definition at line 50 of file HBHEChannelGroups.h.

50 { return group_ == r.group_; }

References group_, and alignCSCRings::r.

◆ save()

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

Definition at line 62 of file HBHEChannelGroups.h.

62  {
63  if (!validate())
64  throw cms::Exception("In HBHEChannelGroups::save: invalid data");
65  ar& group_;
66  }

References Exception, group_, and validate().

Referenced by SpecificationBuilder_cfi.Specification::saveAll().

◆ setGroup()

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

Definition at line 30 of file HBHEChannelGroups.h.

30 { group_.at(linearChannel) = groupNum; }

References group_.

◆ size()

unsigned HBHEChannelGroups::size ( void  ) const
inline

Definition at line 33 of file HBHEChannelGroups.h.

33 { return group_.size(); }

References group_.

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

◆ validate()

bool HBHEChannelGroups::validate ( ) const
inlineprivate

Definition at line 57 of file HBHEChannelGroups.h.

57 { return group_.size() == HBHELinearMap::ChannelCount; }

References HBHELinearMap::ChannelCount, and group_.

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

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
HBHEChannelGroups::group_
std::vector< uint32_t > group_
Definition: HBHEChannelGroups.h:55
mps_fire.i
i
Definition: mps_fire.py:428
HBHELinearMap::ChannelCount
Definition: HBHELinearMap.h:18
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
alignCSCRings.r
r
Definition: alignCSCRings.py:93
Exception
Definition: hltDiff.cc:245
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
HBHEChannelGroups::validate
bool validate() const
Definition: HBHEChannelGroups.h:57