File indexing completed on 2025-08-05 08:16:45
0001
0002
0003
0004 #ifndef MICROMEGAS_MICROMEGASDEFS_H
0005 #define MICROMEGAS_MICROMEGASDEFS_H
0006
0007
0008
0009
0010
0011
0012 #include <trackbase/TrkrDefs.h>
0013
0014 #include <array>
0015 #include <cstdint>
0016
0017 namespace MicromegasDefs
0018 {
0019
0020
0021 enum class SegmentationType: uint8_t
0022 {
0023 SEGMENTATION_Z,
0024 SEGMENTATION_PHI
0025 };
0026
0027
0028
0029 enum class DriftDirection: uint8_t
0030 {
0031 INWARD,
0032 OUTWARD
0033 };
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 TrkrDefs::hitsetkey genHitSetKey(uint8_t layer, SegmentationType segmentation, uint8_t tile );
0045
0046
0047
0048
0049
0050
0051 SegmentationType getSegmentationType(TrkrDefs::hitsetkey);
0052
0053
0054
0055
0056
0057
0058 uint8_t getTileId(TrkrDefs::hitsetkey);
0059
0060
0061
0062
0063
0064 TrkrDefs::hitkey genHitKey(uint16_t strip );
0065
0066
0067 uint16_t getStrip(TrkrDefs::hitkey);
0068
0069
0070
0071
0072
0073
0074 SegmentationType getSegmentationType(TrkrDefs::cluskey);
0075
0076
0077
0078
0079
0080
0081 uint8_t getTileId(TrkrDefs::cluskey);
0082
0083
0084 static constexpr int m_ntiles = 8;
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094 static constexpr int m_npackets = 3;
0095 static constexpr int m_npackets_active = 2;
0096 static constexpr std::array<unsigned int,m_npackets> m_packet_ids = {5000, 5001, 5002};
0097
0098
0099 static constexpr int m_nchannels_fee = 256;
0100
0101
0102 static constexpr int m_nsampa_fee = 8;
0103
0104
0105 static constexpr int m_nfee = 16;
0106
0107
0108 static constexpr int m_nchannels_total = m_nfee*m_nchannels_fee;
0109
0110
0111 static constexpr uint16_t m_adc_max = 1024;
0112
0113
0114 static constexpr uint16_t m_adc_invalid = 65000;
0115
0116
0117
0118 enum SampaDataType
0119 {
0120 HEARTBEAT_T = 0b000,
0121 TRUNCATED_DATA_T = 0b001,
0122 TRUNCATED_TRIG_EARLY_DATA_T = 0b011,
0123 NORMAL_DATA_T = 0b100,
0124 LARGE_DATA_T = 0b101,
0125 TRIG_EARLY_DATA_T = 0b110,
0126 TRIG_EARLY_LARGE_DATA_T = 0b111,
0127 };
0128
0129 }
0130
0131 #endif