Belle II Software development
ARICHHvChannelsMapping Class Reference

The Class for ARICH mapping of bias power supply channels to modules. More...

#include <ARICHHvChannelsMapping.h>

Inheritance diagram for ARICHHvChannelsMapping:

Public Member Functions

 ARICHHvChannelsMapping ()
 Default constructor.
 
std::vector< int > getChannelValues (int connectionID, int pinID) const
 Get bias power supply channel ID from inner cable type and ID.
 
int getPinID (std::vector< int > channel) const
 Get inner cable pin ID from hv power supply channel ID.
 
int getConnectionID (std::vector< int > channel) const
 Get connection ID from hv power supply channel ID.
 
int getCrate (int connectionID, int pinID) const
 Get connection ID from hv power supply channel ID.
 
int getSlot (int connectionID, int pinID) const
 Get connection ID from hv power supply channel ID.
 
int getChannel (int connectionID, int pinID) const
 Get connection ID from hv power supply channel ID.
 
void addMapping (int crate, int slot, int channelID, int connectionID, int pinID)
 Add new entry to the mapping table.
 

Private Member Functions

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

Private Attributes

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

Detailed Description

The Class for ARICH mapping of bias power supply channels to modules.

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

Definition at line 26 of file ARICHHvChannelsMapping.h.

Constructor & Destructor Documentation

◆ ARICHHvChannelsMapping()

Default constructor.

Definition at line 17 of file ARICHHvChannelsMapping.cc.

18{
19}

Member Function Documentation

◆ addMapping()

void addMapping ( int  crate,
int  slot,
int  channelID,
int  connectionID,
int  pinID 
)

Add new entry to the mapping table.

Parameters
cratecrate
slotslot
channelIDpower supply channel ID number
pinIDpin ID of inner cable
connectionIDID of HV cable connection

Definition at line 58 of file ARICHHvChannelsMapping.cc.

59{
60
61 if (crate > 6 || crate < 3) { B2WARNING("ARICHHvChannelsMapping::addMapping: Crate ID number " << crate << " not valid!"); }
62 if (slot > 12 || slot < 0 || slot % 2 != 0) { B2WARNING("ARICHHvChannelsMapping::addMapping: Slot ID number " << slot << " not valid!"); }
63
64 std::vector<int> pinProp{connectionID, pinID};
65 std::vector<int> channelMap{crate, slot, channelID};
66 m_channel2type.insert(std::pair<std::vector<int>, std::vector<int>>(channelMap, pinProp));
67
68}
std::map< std::vector< int >, std::vector< int > > m_channel2type
power suply channel ID link to inner cable

◆ getChannel()

int getChannel ( int  connectionID,
int  pinID 
) const

Get connection ID from hv power supply channel ID.

Parameters
connectionIDID of HV cable connection
pinIDpin ID of inner cable
Returns
channelID channel ID number

Definition at line 53 of file ARICHHvChannelsMapping.cc.

54{
55 return (ARICHHvChannelsMapping::getChannelValues(connectionID, pinID))[2];
56}
std::vector< int > getChannelValues(int connectionID, int pinID) const
Get bias power supply channel ID from inner cable type and ID.

◆ getChannelValues()

std::vector< int > getChannelValues ( int  connectionID,
int  pinID 
) const

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

Parameters
connectionIDID of HV cable connection
pinIDpin ID of inner cable
Returns
channel values; crate, slot, channel ID

Definition at line 21 of file ARICHHvChannelsMapping.cc.

22{
23
24 vector<int> channel{ -2, -2, -2};
25 for (auto& i : m_channel2type) {
26 if (((i.second)[0] == connectionID) && ((i.second)[1] == pinID)) channel = i.first;
27 }
28 return channel;
29}

◆ getConnectionID()

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

Get connection ID from hv power supply channel ID.

Parameters
channelvalues; crate, slot, channel ID
Returns
connectionID ID of HV cable connection

Definition at line 37 of file ARICHHvChannelsMapping.cc.

38{
39 std::vector<int> pinProp = m_channel2type.find(channel)->second;
40 return pinProp[0];
41}

◆ getCrate()

int getCrate ( int  connectionID,
int  pinID 
) const

Get connection ID from hv power supply channel ID.

Parameters
connectionIDID of HV cable connection
pinIDpin ID of inner cable
Returns
crate crate ID number

Definition at line 43 of file ARICHHvChannelsMapping.cc.

44{
45 return (ARICHHvChannelsMapping::getChannelValues(connectionID, pinID))[0];
46}

◆ getPinID()

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

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

Parameters
channelvalues; crate, slot, channel ID
Returns
pinID pin ID of inner cable

Definition at line 31 of file ARICHHvChannelsMapping.cc.

32{
33 std::vector<int> pinProp = m_channel2type.find(channel)->second;
34 return pinProp[1];
35}

◆ getSlot()

int getSlot ( int  connectionID,
int  pinID 
) const

Get connection ID from hv power supply channel ID.

Parameters
connectionIDID of HV cable connection
pinIDpin ID of inner cable
Returns
slot slot ID number

Definition at line 48 of file ARICHHvChannelsMapping.cc.

49{
50 return (ARICHHvChannelsMapping::getChannelValues(connectionID, pinID))[1];
51}

Member Data Documentation

◆ m_channel2type

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

power suply channel ID link to inner cable

Definition at line 91 of file ARICHHvChannelsMapping.h.


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