Belle II Software  release-08-01-10
ARICHBiasChannelsMapping.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <TObject.h>
12 #include <map>
13 #include <vector>
14 
15 #define N_BIASCHANNELS 48
16 
17 namespace Belle2 {
23 
26  class ARICHBiasChannelsMapping : public TObject {
27 
28  public:
29 
32 
42  int getChannelID(int crate, int slot, int connectionID, int innerID, const std::string& type) const;
43 
51  std::vector<int> getChannelValues(int connectionID, int innerID, const std::string& type) const;
52 
58  int getPinID(std::vector<int> channelID) const;
59 
65  std::string getType(std::vector<int> channel) const;
66 
72  int getInnerID(std::vector<int> channel) const;
73 
79  int getConnectionID(std::vector<int> channel) const;
80 
86  std::tuple<int, int, std::string> getInnerConnection(std::vector<int> channel) const;
87 
98  void addMapping(int crate, int slot, int channelID, int pinID, int connectionID, int innerID, const std::string& type);
99 
103  void print() const;
104 
105  private:
106 
107  std::map<std::vector<int>, std::tuple<int, int, int, std::string>>
112  };
113 
115 } // namespace
The Class for ARICH mapping of bias power supply channels to modules.
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 getConnectionID(std::vector< int > channel) const
Get inner cable pin ID from bias power supply channel ID.
int getInnerID(std::vector< int > channel) 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 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::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.
ClassDef(ARICHBiasChannelsMapping, 1)
ClassDef, must be the last term before the closing {}.
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.
std::map< std::vector< int >, std::tuple< int, int, int, std::string > > m_channel2type
power suply channel ID link to inner cable
Abstract base class for different kinds of events.