CMS 3D CMS Logo

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

#include <CastorChannelStatus.h>

Public Types

enum  StatusBit {
  UNKNOWN = 0, BAD = 1, GOOD = 2, HOT = 3,
  DEAD = 4, END = 5
}
 

Public Member Functions

 CastorChannelStatus ()
 
 CastorChannelStatus (unsigned long fid, uint32_t status)
 
 CastorChannelStatus (unsigned long fid, std::string status)
 
uint32_t getValue () const
 
bool isBitSet (unsigned int bitnumber) const
 
uint32_t rawId () const
 
void setBit (unsigned int bitnumber)
 
void setValue (uint32_t value)
 
void unsetBit (unsigned int bitnumber)
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

uint32_t mId
 
uint32_t mStatus
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 15 of file CastorChannelStatus.h.

Member Enumeration Documentation

◆ StatusBit

Constructor & Destructor Documentation

◆ CastorChannelStatus() [1/3]

CastorChannelStatus::CastorChannelStatus ( )
inline

Definition at line 29 of file CastorChannelStatus.h.

◆ CastorChannelStatus() [2/3]

CastorChannelStatus::CastorChannelStatus ( unsigned long  fid,
uint32_t  status 
)
inline

Definition at line 30 of file CastorChannelStatus.h.

◆ CastorChannelStatus() [3/3]

CastorChannelStatus::CastorChannelStatus ( unsigned long  fid,
std::string  status 
)
inline

Definition at line 31 of file CastorChannelStatus.h.

References BAD, DEAD, END, GOOD, HOT, mStatus, mps_update::status, and UNKNOWN.

31  : mId(fid) {
32  if (status == "BAD")
33  mStatus = BAD;
34  else if (status == "GOOD")
35  mStatus = GOOD;
36  else if (status == "HOT")
37  mStatus = HOT;
38  else if (status == "DEAD")
39  mStatus = DEAD;
40  else if (status == "END")
41  mStatus = END;
42  else
43  mStatus = UNKNOWN;
44  }

Member Function Documentation

◆ getValue()

uint32_t CastorChannelStatus::getValue ( ) const
inline

Definition at line 68 of file CastorChannelStatus.h.

References mStatus.

Referenced by CastorDbASCIIIO::dumpObject(), and RecHitCorrector::produce().

68 { return mStatus; }

◆ isBitSet()

bool CastorChannelStatus::isBitSet ( unsigned int  bitnumber) const
inline

Definition at line 61 of file CastorChannelStatus.h.

References mStatus.

61  {
62  uint32_t statadd = 0x1 << (bitnumber);
63  return (mStatus & statadd) ? (true) : (false);
64  }

◆ rawId()

uint32_t CastorChannelStatus::rawId ( ) const
inline

Definition at line 66 of file CastorChannelStatus.h.

References mId.

66 { return mId; }

◆ serialize()

template<class Archive >
void CastorChannelStatus::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setBit()

void CastorChannelStatus::setBit ( unsigned int  bitnumber)
inline

Definition at line 51 of file CastorChannelStatus.h.

References mStatus.

51  {
52  uint32_t statadd = 0x1 << (bitnumber);
53  mStatus = mStatus | statadd;
54  }

◆ setValue()

void CastorChannelStatus::setValue ( uint32_t  value)
inline

◆ unsetBit()

void CastorChannelStatus::unsetBit ( unsigned int  bitnumber)
inline

Definition at line 55 of file CastorChannelStatus.h.

References mStatus.

55  {
56  uint32_t statadd = 0x1 << (bitnumber);
57  statadd = ~statadd;
58  mStatus = mStatus & statadd;
59  }

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 74 of file CastorChannelStatus.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 74 of file CastorChannelStatus.h.

Member Data Documentation

◆ mId

uint32_t CastorChannelStatus::mId
private

Definition at line 71 of file CastorChannelStatus.h.

Referenced by rawId().

◆ mStatus

uint32_t CastorChannelStatus::mStatus
private