Belle II Software  release-08-01-10
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 (KLMChannelNumber channel) const
 Get channel status. More...
 
void setChannelStatus (KLMChannelNumber channel, enum ChannelStatus status)
 Set channel status. More...
 
void setStatusAllChannels (enum ChannelStatus status)
 Set staus for all channels. More...
 
int getActiveStripsInModule (KLMChannelNumber 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< KLMChannelNumber, enum ChannelStatusm_ChannelStatus
 Channel data.
 

Detailed Description

KLM channel status.

Definition at line 29 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 36 of file KLMChannelStatus.h.

36  {
37 
39  c_Unknown,
40 
42  c_Normal,
43 
45  c_Dead,
46 
48  c_Hot,
49 
52 
53  };
@ c_Hot
Hot channel (large background).
@ c_Undetermined
Undetermined (used during calibration).
@ c_Normal
Normally operating channel.
@ c_Dead
Dead channel (no signal).
@ c_Unknown
Unknown status (no data).

Member Function Documentation

◆ getActiveStripsInModule()

int getActiveStripsInModule ( KLMChannelNumber  module) const

Get number of active strips in the specified KLM module.

Parameters
[in]moduleModule number.

Definition at line 58 of file KLMChannelStatus.cc.

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

◆ getChannelStatus()

enum KLMChannelStatus::ChannelStatus getChannelStatus ( KLMChannelNumber  channel) const

Get channel status.

Parameters
[in]channelChannel number.

Definition at line 25 of file KLMChannelStatus.cc.

◆ setChannelStatus()

void setChannelStatus ( KLMChannelNumber  channel,
enum ChannelStatus  status 
)

Set channel status.

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

Definition at line 38 of file KLMChannelStatus.cc.

◆ setStatusAllChannels()

void setStatusAllChannels ( enum ChannelStatus  status)

Set staus for all channels.

Parameters
[in]statusStatus.

Definition at line 51 of file KLMChannelStatus.cc.


The documentation for this class was generated from the following files: