Belle II Software development
ARICHModulesInfo Class Reference

The Class for information on HAPD modules installed in ARICH. More...

#include <ARICHModulesInfo.h>

Inheritance diagram for ARICHModulesInfo:

Public Member Functions

 ARICHModulesInfo ()
 Default constructor.
 
double getChannelQE (unsigned modId, unsigned chNo) const
 Get channel quantum efficiency.
 
void setChannelQE (unsigned modId, unsigned chId, double qe)
 Set channel quantum efficiency.
 
void addModule (unsigned modId, std::vector< float > &qeList, bool active)
 Add installed module.
 
bool isInstalled (unsigned modId) const
 Check if module is installed.
 
bool isActive (unsigned modId) const
 Check if module is active.
 
void print () const
 Dump data.
 

Private Member Functions

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

Private Attributes

std::vector< uint8_t > m_ChannelQE
 Channel QE at 400nm.
 
bool m_active [N_HAPDS]
 array of active HAPDs
 
bool m_installed [N_HAPDS]
 array of installed HAPDs
 

Detailed Description

The Class for information on HAPD modules installed in ARICH.

holds:

  • QEs of all channels of all installed HAPDs
  • list of installed modules. Only installed modules are placed in geant4 geometry.
  • list of active modules. Only SimHits (simulated data) or RawHits (measured data) of active modules are converted to ARICHDigits.

Definition at line 33 of file ARICHModulesInfo.h.

Constructor & Destructor Documentation

◆ ARICHModulesInfo()

Default constructor.

Definition at line 18 of file ARICHModulesInfo.cc.

19{
20 m_ChannelQE.assign(N_HAPDS * N_CHANNELS, 0);
21 std::fill_n(m_installed, N_HAPDS, false);
22 std::fill_n(m_active, N_HAPDS, false);
23}
bool m_installed[N_HAPDS]
array of installed HAPDs
bool m_active[N_HAPDS]
array of active HAPDs
std::vector< uint8_t > m_ChannelQE
Channel QE at 400nm.

Member Function Documentation

◆ addModule()

void addModule ( unsigned  modId,
std::vector< float > &  qeList,
bool  active 
)

Add installed module.

Parameters
modIdmodule ID number
qeListvector of channel QEs (in %!), arranged according to the channel ASIC numbers
activeis module active

Definition at line 42 of file ARICHModulesInfo.cc.

43{
44
45 if (modId > N_HAPDS) B2ERROR("ARICHModulesInfo::addModule: module ID is out of range");
46 if (qeList.size() != N_CHANNELS) B2ERROR("ARICHModulesInfo::addModule: incomplete list of channels QEs");
47
48 m_installed[modId - 1] = true;
49 m_active[modId - 1] = active;
50
51 std::vector<uint8_t>::iterator it = m_ChannelQE.begin() + (modId - 1) * N_CHANNELS;
52 for (auto qe : qeList) {
53 *it = uint8_t(qe + 0.5);
54 ++it;
55 }
56}

◆ getChannelQE()

double getChannelQE ( unsigned  modId,
unsigned  chNo 
) const

Get channel quantum efficiency.

Parameters
modIdmodule ID number
chNochannel number (ASIC number)
Returns
channel QE

Definition at line 25 of file ARICHModulesInfo.cc.

26{
27 if (moduleID > N_HAPDS
28 || channelID > N_CHANNELS - 1) B2ERROR("ARICHModulesInfo::getChannelQE: module ID or channel ID out of range");
29
30 int id = (moduleID - 1) * N_CHANNELS + channelID;
31 return (double)m_ChannelQE[id] / 100.0;
32}

◆ isActive()

bool isActive ( unsigned  modId) const

Check if module is active.

Parameters
modIdmodule ID number
Returns
true if active

Definition at line 65 of file ARICHModulesInfo.cc.

66{
67 if (modId > N_HAPDS) B2ERROR("ARICHModulesInfo::isActive: module ID is out of range");
68
69 return m_active[modId - 1];
70}

◆ isInstalled()

bool isInstalled ( unsigned  modId) const

Check if module is installed.

Parameters
modIdmodule ID number
Returns
true if installed

Definition at line 58 of file ARICHModulesInfo.cc.

59{
60 if (modId > N_HAPDS) B2ERROR("ARICHModulesInfo::isInstalled: module ID is out of range");
61
62 return m_installed[modId - 1];
63}

◆ print()

void print ( ) const

Dump data.

Definition at line 72 of file ARICHModulesInfo.cc.

73{
74 cout << "ARICHModulesInfo: " << endl;
75 cout << " Modules status " << endl;
76 cout << " ID / installed / active / avg. QE" << endl;
77 double maxQE = 0;
78 for (int i = 1; i < N_HAPDS + 1; i++) {
79 cout << right << setfill(' ') << setw(4) << i << ": ";
80 if (isInstalled(i)) cout << 1;
81 else cout << 0;
82 cout << " ";
83 if (isActive(i)) cout << 1;
84 else cout << 0;
85 double avgQE = 0;
86 for (int j = 0; j < N_CHANNELS; j++) {
87 double chQE = getChannelQE(i, j);
88 avgQE += chQE;
89 if (chQE > maxQE) maxQE = chQE;
90 }
91 avgQE /= double(N_CHANNELS);
92 cout << " " << left << setfill('0') << setw(4) << setprecision(2) << avgQE << " ";
93 if ((i) % 10 == 0) cout << endl;
94 }
95 cout << " Maximal channel QE: " << maxQE << endl;
96}
double getChannelQE(unsigned modId, unsigned chNo) const
Get channel quantum efficiency.
bool isInstalled(unsigned modId) const
Check if module is installed.
bool isActive(unsigned modId) const
Check if module is active.

◆ setChannelQE()

void setChannelQE ( unsigned  modId,
unsigned  chId,
double  qe 
)

Set channel quantum efficiency.

Parameters
modIdmodule ID number
chIdchannel number (ASIC number)
qechannel quantum efficiency (0.35 for example)

Definition at line 34 of file ARICHModulesInfo.cc.

35{
36 if (modId > N_HAPDS || chId > N_CHANNELS - 1) B2ERROR("ARICHModulesInfo::setChannelQE: module ID or channel ID out of range");
37
38 int chid = (modId - 1) * N_CHANNELS + chId;
39 m_ChannelQE[chid] = uint8_t(qe * 100 + 0.5);
40}

Member Data Documentation

◆ m_active

bool m_active[N_HAPDS]
private

array of active HAPDs

Definition at line 87 of file ARICHModulesInfo.h.

◆ m_ChannelQE

std::vector<uint8_t> m_ChannelQE
private

Channel QE at 400nm.

Definition at line 85 of file ARICHModulesInfo.h.

◆ m_installed

bool m_installed[N_HAPDS]
private

array of installed HAPDs

Definition at line 88 of file ARICHModulesInfo.h.


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