Belle II Software development
ARICHBiasChannelsMapping Class Reference

This class provides ARICH mapping of HAPD modules to bias power supply channels. More...

#include <ARICHBiasChannelsMapping.h>

Inheritance diagram for ARICHBiasChannelsMapping:

Public Member Functions

 ARICHBiasChannelsMapping ()
 Default constructor.
 
int getChannelID (int crate, int slot, int connectionID, int innerID, const std::string &type) const
 Get bias power supply channel ID from inner cable type and ID.
 
std::vector< int > getChannelValues (int connectionID, int innerID, const std::string &type) const
 Get bias power supply cratem slot and channel ID from inner cable type and ID.
 
int getPinID (std::vector< int > channelID) const
 Get inner cable pin ID from bias power supply channel ID.
 
std::string getType (std::vector< int > channel) const
 Get bias/guard type from channel.
 
int getInnerID (std::vector< int > channel) const
 Get inner cable pin ID from bias power supply channel ID.
 
int getConnectionID (std::vector< int > channel) const
 Get inner cable pin ID from bias power supply channel ID.
 
std::tuple< int, int, std::string > getInnerConnection (std::vector< int > channel) const
 Get inner cable ID and type, connected to bias channel.
 
void addMapping (int crate, int slot, int channelID, int pinID, int connectionID, int innerID, const std::string &type)
 Add new entry to the mapping table.
 
void print () const
 Print properties.
 

Private Member Functions

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

Private Attributes

std::map< std::vector< int >, std::tuple< int, int, int, std::string > > m_channel2type
 power suply channel ID link to inner cable
 

Detailed Description

This class provides ARICH mapping of HAPD modules to bias power supply channels.

Definition at line 27 of file ARICHBiasChannelsMapping.h.

Constructor & Destructor Documentation

◆ ARICHBiasChannelsMapping()

Default constructor.

Definition at line 17 of file ARICHBiasChannelsMapping.cc.

18{
19}

Member Function Documentation

◆ addMapping()

void addMapping ( int  crate,
int  slot,
int  channelID,
int  pinID,
int  connectionID,
int  innerID,
const std::string &  type 
)

Add new entry to the mapping table.

Parameters
[in]crateCrate ID number.
[in]slotSlot ID number.
[in]channelIDPower supply channel ID number.
[in]pinIDPin ID of inner cable.
[in]connectionIDConnection number.
[in]innerIDID of inner cable.
[in]typeType of inner cable.

Definition at line 75 of file ARICHBiasChannelsMapping.cc.

77{
78
79 if (channelID > 47 || channelID < 0) { B2WARNING("ARICHBiasChannelsMapping::addMapping: Channel ID number " << channelID << " not valid!"); }
80 if (pinID > 46 || pinID < -2 || pinID == 0) { B2WARNING("ARICHBiasChannelsMapping::addMapping: Pin ID number " << pinID << " not valid!"); }
81 if (innerID > 9 || innerID < -2 || innerID == 0) { B2WARNING("ARICHBiasChannelsMapping::addMapping: Inner ID " << innerID << " not valid!"); }
82
83 auto pinProp = std::make_tuple(pinID, connectionID, innerID, type);
84 std::vector<int> channelMap{crate, slot, channelID};
85 m_channel2type.insert(std::pair<std::vector<int>, std::tuple<int, int, int, std::string>>(channelMap, pinProp));
86
87}
std::map< std::vector< int >, std::tuple< int, int, int, std::string > > m_channel2type
power suply channel ID link to inner cable

◆ getChannelID()

int getChannelID ( int  crate,
int  slot,
int  connectionID,
int  innerID,
const std::string &  type 
) const

Get bias power supply channel ID from inner cable type and ID.

Parameters
[in]crateCrate ID number.
[in]slotSlot ID number.
[in]connectionIDConnection number.
[in]innerIDID of inner cable.
[in]typeType of inner cable.
Returns
Power supply channel ID number.

Definition at line 51 of file ARICHBiasChannelsMapping.cc.

52{
53 if (innerID > 9 || innerID < -2 || innerID == 0) { B2WARNING("ARICHBiasChannelsMapping::getChannelID: Inner ID " << innerID << " not valid!"); }
54
55 vector<int> channel{ -2, -2, -2};
56 for (auto& i : m_channel2type) {
57 if ((std::get<1>(i.second) == connectionID) && (std::get<2>(i.second) == innerID) && (std::get<3>(i.second) == type)
58 && ((i.first)[0] == crate) && ((i.first)[1] == slot)) channel = i.first;
59 }
60 return channel[2];
61}

◆ getChannelValues()

std::vector< int > getChannelValues ( int  connectionID,
int  innerID,
const std::string &  type 
) const

Get bias power supply cratem slot and channel ID from inner cable type and ID.

Parameters
[in]innerIDID of inner cable.
[in]typeType of inner cable.
[in]connectionIDConnection number.
Returns
Power supply channel numbers; crate, slot, channelID.

Definition at line 62 of file ARICHBiasChannelsMapping.cc.

63{
64 if (innerID > 9 || innerID < -2 || innerID == 0) { B2WARNING("ARICHBiasChannelsMapping::getChannelID: Inner ID " << innerID << " not valid!"); }
65
66 vector<int> channel{ -2, -2, -2};
67 for (auto& i : m_channel2type) {
68 if ((std::get<1>(i.second) == connectionID) && (std::get<2>(i.second) == innerID)
69 && (std::get<3>(i.second) == type)) channel = i.first;
70 }
71 return channel;
72}

◆ getConnectionID()

int getConnectionID ( std::vector< int >  channel) const

Get inner cable pin ID from bias power supply channel ID.

Parameters
[in]channelPower supply channel numbers; crate, slot, channelID.
Returns
Connection number.

Definition at line 26 of file ARICHBiasChannelsMapping.cc.

27{
28 std::tuple<int, int, int, std::string> pinProp = m_channel2type.find(channel)->second;
29 return std::get<1>(pinProp);
30}

◆ getInnerConnection()

std::tuple< int, int, std::string > getInnerConnection ( std::vector< int >  channel) const

Get inner cable ID and type, connected to bias channel.

Parameters
[in]channelVector of crate, slot and power supply channel ID number.
Returns
Inner cable ID and type.

Definition at line 43 of file ARICHBiasChannelsMapping.cc.

44{
45 // connection ID, inner ID, type
46
47 std::tuple<int, int, int, std::string> pinProp = m_channel2type.find(channel)->second;
48 return std::make_tuple(std::get<1>(pinProp), std::get<2>(pinProp), std::get<3>(pinProp));
49}

◆ getInnerID()

int getInnerID ( std::vector< int >  channel) const

Get inner cable pin ID from bias power supply channel ID.

Parameters
[in]channelPower supply channel numbers; crate, slot, channelID.
Returns
ID of inner cable.

Definition at line 31 of file ARICHBiasChannelsMapping.cc.

32{
33 std::tuple<int, int, int, std::string> pinProp = m_channel2type.find(channel)->second;
34 return std::get<2>(pinProp);
35}

◆ getPinID()

int getPinID ( std::vector< int >  channelID) const

Get inner cable pin ID from bias power supply channel ID.

Parameters
[in]channelIDPower supply channel ID number.
Returns
Pin ID of inner cable.

Definition at line 21 of file ARICHBiasChannelsMapping.cc.

22{
23 std::tuple<int, int, int, std::string> pinProp = m_channel2type.find(channel)->second;
24 return std::get<0>(pinProp);
25}

◆ getType()

std::string getType ( std::vector< int >  channel) const

Get bias/guard type from channel.

Parameters
[in]channelPower supply channel numbers; crate, slot, channelID.
Returns
Inner cable type.

Definition at line 36 of file ARICHBiasChannelsMapping.cc.

37{
38 std::tuple<int, int, int, std::string> pinProp = m_channel2type.find(channel)->second;
39 return std::get<3>(pinProp);
40}

◆ print()

void print ( ) const

Print properties.

Definition at line 89 of file ARICHBiasChannelsMapping.cc.

90{
91
92 for (int crate = 0; crate < 3 ; crate++) {
93 for (int slot = 0; slot < 15 ; slot++) {
94 for (int channelID = 0; channelID < N_BIASCHANNELS; channelID++) {
95 std::vector<int> channel{crate, slot, channelID};
96 cout << " Channel " << channelID << " (crate " << crate << ", slot " << slot << "): pinID " << getPinID(
97 channel) << ", inner pin " << std::get<0>(getInnerConnection(channel)) << ", inner type " << std::get<1>(getInnerConnection(
98 channel)) << endl;
99 }
100 }
101 }
102
103}
std::tuple< int, int, std::string > getInnerConnection(std::vector< int > channel) const
Get inner cable ID and type, connected to bias channel.
int getPinID(std::vector< int > channelID) const
Get inner cable pin ID from bias power supply channel ID.

Member Data Documentation

◆ m_channel2type

std::map<std::vector<int>, std::tuple<int, int, int, std::string> > m_channel2type
private

power suply channel ID link to inner cable

Definition at line 115 of file ARICHBiasChannelsMapping.h.


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