Belle II Software development
ARICHChannelMask Class Reference

The Class for ARICH HAPD channel mask. More...

#include <ARICHChannelMask.h>

Inheritance diagram for ARICHChannelMask:

Public Member Functions

 ARICHChannelMask ()
 Default constructor.
 
bool isActive (unsigned modId, unsigned chNo) const
 Check if channel is active.
 
void setActiveCh (unsigned modId, unsigned chNo, bool active)
 Set active/non-active channel.
 
void setActiveHAPD (unsigned modId, bool active)
 Set active/non-active HAPD module.
 
void setActiveAPD (unsigned modId, unsigned apdId, bool active)
 Set active/non-active APD of HAPD module.
 
void print () const
 dump content
 

Private Member Functions

 ClassDef (ARICHChannelMask, 1)
 ClassDef, must be the last term before the closing {}.
 

Private Attributes

uint32_t m_DetectorMask [N_HAPDS *N_CHANNELS/32+1] = {0xFFFFFFFF}
 Detector Mask of active channels.
 

Detailed Description

The Class for ARICH HAPD channel mask.

holds mask of non-active channels of all installed HAPDs By default all channels are active

Definition at line 25 of file ARICHChannelMask.h.

Constructor & Destructor Documentation

◆ ARICHChannelMask()

Default constructor.

Definition at line 17 of file ARICHChannelMask.cc.

18{
19 std::fill_n(m_DetectorMask, N_HAPDS * N_CHANNELS / 32 + 1, 0xFFFFFFFF);
20}
uint32_t m_DetectorMask[N_HAPDS *N_CHANNELS/32+1]
Detector Mask of active channels.

Member Function Documentation

◆ isActive()

bool isActive ( unsigned  modId,
unsigned  chNo 
) const

Check if channel is active.

Parameters
modIdmodule ID number
chNoasic channel number
Returns
true if active

Definition at line 47 of file ARICHChannelMask.cc.

48{
49 int ch = (moduleID - 1) * N_CHANNELS + channelID;
50 int bit = ch % 32;
51 unsigned int idx = ch / 32;
52 if (m_DetectorMask[idx] & (1 << bit)) return true;
53 return false;
54}

◆ print()

void print ( ) const

dump content

Definition at line 56 of file ARICHChannelMask.cc.

57{
58
59 cout << endl << "ARICH masked channels" << endl << endl;
60 for (int i = 0; i < N_HAPDS; i++) {
61 int first = 1;
62 //cout << "Module "<< i+1 << ": " ;
63 for (int j = 0; j < N_CHANNELS; j++) {
64 if (!isActive(i + 1, j)) {
65 if (first) cout << "Module " << i + 1 << ": " ;
66 cout << j << " ";
67 first = 0;
68 }
69 }
70 if (!first) cout << endl << endl;
71
72 }
73}
bool isActive(unsigned modId, unsigned chNo) const
Check if channel is active.

◆ setActiveAPD()

void setActiveAPD ( unsigned  modId,
unsigned  apdId,
bool  active 
)

Set active/non-active APD of HAPD module.

Parameters
modIdmodule ID number
apdIdapd chip ID number
activetrue if active

Definition at line 39 of file ARICHChannelMask.cc.

40{
41 int fst = N_CHANNELS / 4 * apd;
42 for (int i = fst; i < fst + N_CHANNELS / 4; i++) {
43 setActiveCh(module, i, active);
44 }
45}
void setActiveCh(unsigned modId, unsigned chNo, bool active)
Set active/non-active channel.

◆ setActiveCh()

void setActiveCh ( unsigned  modId,
unsigned  chNo,
bool  active 
)

Set active/non-active channel.

Parameters
modIdmodule ID number
chNoasic channel number
activetrue if active

Definition at line 22 of file ARICHChannelMask.cc.

23{
24 if (module > N_HAPDS || channel > N_CHANNELS) { B2ERROR("ARICHChannelMask::setActiveCh: module ID / channel ID out of range!"); return;}
25 int ch = (module - 1) * N_CHANNELS + channel;
26 int bit = ch % 32;
27 unsigned int idx = ch / 32;
28 if (active) m_DetectorMask[idx] |= (1 << bit);
29 else m_DetectorMask[idx] &= ~(1 << bit);
30}

◆ setActiveHAPD()

void setActiveHAPD ( unsigned  modId,
bool  active 
)

Set active/non-active HAPD module.

Parameters
modIdmodule ID number
activetrue if active

Definition at line 32 of file ARICHChannelMask.cc.

33{
34 for (int i = 0; i < N_CHANNELS; i++) {
35 setActiveCh(module, i, active);
36 }
37}

Member Data Documentation

◆ m_DetectorMask

uint32_t m_DetectorMask[N_HAPDS *N_CHANNELS/32+1] = {0xFFFFFFFF}
private

Detector Mask of active channels.

Definition at line 70 of file ARICHChannelMask.h.


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