Belle II Software  release-05-02-19
KLMChannelStatus Class Reference

KLM channel status. More...

#include <KLMChannelStatus.h>

Inheritance diagram for KLMChannelStatus:
Collaboration diagram for KLMChannelStatus:

Public Types

enum  ChannelStatus {
  c_Unknown,
  c_Normal,
  c_Dead,
  c_Hot,
  c_Undetermined
}
 Channel status. More...
 

Public Member Functions

 KLMChannelStatus ()
 Constructor.
 
 ~KLMChannelStatus ()
 Destructor.
 
enum ChannelStatus getChannelStatus (uint16_t channel) const
 Get channel status. More...
 
void setChannelStatus (uint16_t channel, enum ChannelStatus status)
 Set channel status. More...
 
void setStatusAllChannels (enum ChannelStatus status)
 Set staus for all channels. More...
 
int getActiveStripsInModule (uint16_t module) const
 Get number of active strips in the specified KLM module. More...
 
bool operator== (KLMChannelStatus &status)
 Operator ==.
 
unsigned int newNormalChannels (KLMChannelStatus &status)
 Number of new channels with status c_Normal that have a different status in another channel-status data.
 

Private Member Functions

 ClassDef (Belle2::KLMChannelStatus, 1)
 Class version.
 

Private Attributes

std::map< uint16_t, enum ChannelStatusm_ChannelStatus
 Channel data.
 

Detailed Description

KLM channel status.

Definition at line 37 of file KLMChannelStatus.h.

Member Enumeration Documentation

◆ ChannelStatus

Channel status.

Enumerator
c_Unknown 

Unknown status (no data).

c_Normal 

Normally operating channel.

c_Dead 

Dead channel (no signal).

c_Hot 

Hot channel (large background).

c_Undetermined 

Undetermined (used during calibration).

Definition at line 44 of file KLMChannelStatus.h.

101  :
102 

Member Function Documentation

◆ getActiveStripsInModule()

int getActiveStripsInModule ( uint16_t  module) const

Get number of active strips in the specified KLM module.

Parameters
[in]moduleModule number.

Definition at line 60 of file KLMChannelStatus.cc.

61 {
62  int active;
63  int subdetector, section, sector, layer;
64  const KLMElementNumbers* elementNumbers =
66  elementNumbers->moduleNumberToElementNumbers(
67  module, &subdetector, &section, &sector, &layer);
68  KLMChannelIndex klmModule(subdetector, section, sector, layer, 1, 1);
69  /* Plane number is 0-based for BKLM. */
70  if (subdetector == KLMElementNumbers::c_BKLM) {
71  KLMChannelIndex klmModuleTemp(subdetector, section, sector, layer, 0, 1);
72  klmModule = klmModuleTemp;
73  }
74  klmModule.setIndexLevel(KLMChannelIndex::c_IndexLevelLayer);
75  KLMChannelIndex klmNextModule(klmModule);
76  ++klmNextModule;
77  KLMChannelIndex klmChannel(klmModule);
78  klmChannel.setIndexLevel(KLMChannelIndex::c_IndexLevelStrip);
79  active = 0;
80  for (; klmChannel != klmNextModule; ++klmChannel) {
81  uint16_t channel = klmChannel.getKLMChannelNumber();
82  ChannelStatus status = getChannelStatus(channel);
83  if (status == c_Unknown)
84  B2FATAL("Incomplete KLM channel data.");
85  if (status != c_Dead)
86  active++;
87  }
88  return active;
89 }

◆ getChannelStatus()

enum KLMChannelStatus::ChannelStatus getChannelStatus ( uint16_t  channel) const

Get channel status.

Parameters
[in]channelChannel number.

Definition at line 32 of file KLMChannelStatus.cc.

◆ setChannelStatus()

void setChannelStatus ( uint16_t  channel,
enum ChannelStatus  status 
)

Set channel status.

Parameters
[in]channelChannel number.
[in]statusStatus.

Definition at line 40 of file KLMChannelStatus.cc.

◆ setStatusAllChannels()

void setStatusAllChannels ( enum ChannelStatus  status)

Set staus for all channels.

Parameters
[in]statusStatus.

Definition at line 53 of file KLMChannelStatus.cc.


The documentation for this class was generated from the following files:
Belle2::KLMChannelIndex::c_IndexLevelLayer
@ c_IndexLevelLayer
Layer.
Definition: KLMChannelIndex.h:52
Belle2::KLMChannelStatus::ChannelStatus
ChannelStatus
Channel status.
Definition: KLMChannelStatus.h:44
Belle2::KLMElementNumbers::Instance
static const KLMElementNumbers & Instance()
Instantiation.
Definition: KLMElementNumbers.cc:31
Belle2::KLMElementNumbers::moduleNumberToElementNumbers
void moduleNumberToElementNumbers(uint16_t module, int *subdetector, int *section, int *sector, int *layer) const
Get element numbers by module number.
Definition: KLMElementNumbers.cc:186
Belle2::KLMChannelStatus::c_Dead
@ c_Dead
Dead channel (no signal).
Definition: KLMChannelStatus.h:53
Belle2::KLMElementNumbers::c_BKLM
@ c_BKLM
BKLM.
Definition: KLMElementNumbers.h:47
Belle2::KLMChannelStatus::c_Unknown
@ c_Unknown
Unknown status (no data).
Definition: KLMChannelStatus.h:47
Belle2::KLMChannelIndex
KLM channel index.
Definition: KLMChannelIndex.h:33
Belle2::KLMElementNumbers
KLM element numbers.
Definition: KLMElementNumbers.h:37
Belle2::KLMChannelStatus::getChannelStatus
enum ChannelStatus getChannelStatus(uint16_t channel) const
Get channel status.
Definition: KLMChannelStatus.cc:32
Belle2::KLMChannelIndex::c_IndexLevelStrip
@ c_IndexLevelStrip
Strip.
Definition: KLMChannelIndex.h:58