File indexing completed on 2025-08-06 08:17:54
0001 #ifndef MICROMEGAS_MICROMEGASMAPPING_H
0002 #define MICROMEGAS_MICROMEGASMAPPING_H
0003
0004
0005
0006
0007
0008
0009 #include "MicromegasDefs.h"
0010
0011 #include <trackbase/TrkrDefs.h>
0012
0013 #include <array>
0014 #include <map>
0015 #include <string>
0016 #include <vector>
0017
0018
0019 class MicromegasMapping
0020 {
0021 public:
0022
0023 MicromegasMapping();
0024
0025
0026 std::vector<int> get_fee_id_list() const;
0027
0028
0029 std::vector<int> get_fee_id_list(int ) const;
0030
0031
0032 TrkrDefs::hitsetkey get_hitsetkey(int ) const;
0033
0034
0035
0036 std::string get_detname_saclay(int ) const;
0037
0038
0039
0040 std::string get_detname_sphenix(int ) const;
0041
0042
0043
0044
0045
0046
0047
0048 int get_physical_strip(int , int ) const;
0049
0050
0051 std::string get_detname_saclay_from_hitsetkey(TrkrDefs::hitsetkey) const;
0052
0053
0054 std::string get_detname_sphenix_from_hitsetkey(TrkrDefs::hitsetkey) const;
0055
0056
0057 int get_fee_id_from_hitsetkey(TrkrDefs::hitsetkey) const;
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 int get_new_fee_id( int ) const;
0068
0069 private:
0070
0071
0072 void construct_channel_mapping();
0073
0074
0075
0076
0077
0078 class DetectorId
0079 {
0080 public:
0081
0082 DetectorId(
0083 int packet_id,
0084 int fee_id,
0085 TrkrDefs::hitsetkey hitsetkey,
0086 const std::string& fibername, const std::string& breakoutname,
0087 const std::string& detname_saclay, const std::string& detname_sphenix)
0088 :
0089 m_packet_id(packet_id)
0090 , m_fee_id(fee_id)
0091 , m_hitsetkey(hitsetkey)
0092 , m_fibername(fibername)
0093 , m_breakoutname(breakoutname)
0094 , m_detname_saclay(detname_saclay)
0095 , m_detname_sphenix(detname_sphenix)
0096 {
0097 }
0098
0099
0100 int m_packet_id = 0;
0101
0102
0103 int m_fee_id = 0;
0104
0105
0106 TrkrDefs::hitsetkey m_hitsetkey = 0;
0107
0108
0109 std::string m_fibername;
0110
0111
0112 std::string m_breakoutname;
0113
0114
0115 std::string m_detname_saclay;
0116
0117
0118 std::string m_detname_sphenix;
0119 };
0120
0121
0122 std::vector<DetectorId> m_detectors;
0123
0124
0125 std::map<int, DetectorId> m_detector_map;
0126
0127
0128 std::array<int, MicromegasDefs::m_nchannels_fee> m_fee_to_strip_mapping_z = {{0}};
0129
0130
0131 std::array<int, MicromegasDefs::m_nchannels_fee> m_fee_to_strip_mapping_phi = {{0}};
0132
0133 };
0134
0135 #endif