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::HBHEChannelGroups ( )
inline
HBHEChannelGroups::HBHEChannelGroups ( const unsigned *  data,
const unsigned  len 
)
inline

Definition at line 22 of file HBHEChannelGroups.h.

References Exception, and validate().

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

Member Function Documentation

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

Definition at line 42 of file HBHEChannelGroups.h.

References group_.

Referenced by HcalInterpolatedPulseColl::getChannelPulse().

43  {return group_.at(linearChannel);}
std::vector< uint32_t > group_
const uint32_t* HBHEChannelGroups::groupData ( ) const
inline

Definition at line 39 of file HBHEChannelGroups.h.

References group_.

40  {return group_.empty() ? nullptr : &group_[0];}
std::vector< uint32_t > group_
unsigned HBHEChannelGroups::largestGroupNumber ( ) const
inline

Definition at line 45 of file HBHEChannelGroups.h.

References group_, and mps_fire::i.

Referenced by HcalInterpolatedPulseColl::HcalInterpolatedPulseColl().

46  {
47  unsigned lg = 0;
48  const unsigned sz = group_.size();
49  const uint32_t* dat = sz ? &group_[0] : nullptr;
50  for (unsigned i=0; i<sz; ++i)
51  if (dat[i] > lg)
52  lg = dat[i];
53  return lg;
54  }
std::vector< uint32_t > group_
template<class Archive >
void HBHEChannelGroups::load ( Archive &  ar,
const unsigned   
)
inlineprivate

Definition at line 82 of file HBHEChannelGroups.h.

References Exception, group_, and validate().

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

83  {
84  ar & group_;
85  if (!validate()) throw cms::Exception(
86  "In HBHEChannelGroups::load: invalid data");
87  }
std::vector< uint32_t > group_
bool validate() const
bool HBHEChannelGroups::operator!= ( const HBHEChannelGroups r) const
inline

Definition at line 60 of file HBHEChannelGroups.h.

References alignCSCRings::r.

61  {return !(*this == r);}
bool HBHEChannelGroups::operator== ( const HBHEChannelGroups r) const
inline

Definition at line 57 of file HBHEChannelGroups.h.

References group_.

58  {return group_ == r.group_;}
std::vector< uint32_t > group_
template<class Archive >
void HBHEChannelGroups::save ( Archive &  ar,
const unsigned   
) const
inlineprivate

Definition at line 74 of file HBHEChannelGroups.h.

References Exception, group_, and validate().

Referenced by Vispa.Main.TabController.TabController::allowClose(), Vispa.Main.TabController.TabController::checkModificationTimestamp(), and SpecificationBuilder_cfi.Specification::saveAll().

75  {
76  if (!validate()) throw cms::Exception(
77  "In HBHEChannelGroups::save: invalid data");
78  ar & group_;
79  }
std::vector< uint32_t > group_
bool validate() const
void HBHEChannelGroups::setGroup ( const unsigned  linearChannel,
const unsigned  groupNum 
)
inline

Definition at line 33 of file HBHEChannelGroups.h.

References group_.

34  {group_.at(linearChannel) = groupNum;}
std::vector< uint32_t > group_
unsigned HBHEChannelGroups::size ( void  ) const
inline

Definition at line 37 of file HBHEChannelGroups.h.

References group_.

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

37 {return group_.size();}
std::vector< uint32_t > group_
bool HBHEChannelGroups::validate ( ) const
inlineprivate

Definition at line 66 of file HBHEChannelGroups.h.

References HBHELinearMap::ChannelCount.

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

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

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 71 of file HBHEChannelGroups.h.

Member Data Documentation

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