File indexing completed on 2024-04-06 12:10:33
0001 #ifndef EventFilter_EcalRawToDigi_interface_ElectronicsIdGPU_h
0002 #define EventFilter_EcalRawToDigi_interface_ElectronicsIdGPU_h
0003
0004 #include <cstdint>
0005
0006 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0007
0008 namespace ecal {
0009 namespace raw {
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 class ElectronicsIdGPU {
0021 public:
0022
0023 constexpr ElectronicsIdGPU() : id_{0xFFFFFFFFu} {}
0024
0025 constexpr ElectronicsIdGPU(uint32_t id) : id_{id} {}
0026
0027 constexpr ElectronicsIdGPU(uint8_t const dccid, uint8_t const towerid, uint8_t const stripid, uint8_t const xtalid)
0028 : id_{static_cast<uint32_t>((xtalid & 0x7) | ((stripid & 0x7) << 3) | ((towerid & 0x7F) << 6) |
0029 ((dccid & 0x7F) << 13))} {}
0030
0031 constexpr uint32_t operator()() { return id_; }
0032 constexpr uint32_t rawId() const { return id_; }
0033
0034
0035 constexpr uint8_t dccId() const { return (id_ >> 13) & 0x7F; }
0036
0037 constexpr uint8_t towerId() const { return (id_ >> 6) & 0x7F; }
0038
0039 constexpr uint8_t stripId() const { return (id_ >> 3) & 0x7; }
0040
0041 constexpr uint8_t xtalId() const { return (id_ & 0x7); }
0042
0043
0044
0045
0046
0047 constexpr uint32_t linearIndex() const { return id_ & 0x3FFFFF; }
0048
0049
0050
0051
0052 static constexpr int kTowersInPhi = 4;
0053 static constexpr int kCrystalsInPhi = 20;
0054
0055 static constexpr uint8_t MAX_DCCID = 54;
0056 static constexpr uint8_t MIN_DCCID = 1;
0057 static constexpr uint8_t MAX_TOWERID = 70;
0058 static constexpr uint8_t MIN_TOWERID = 1;
0059 static constexpr uint8_t MAX_STRIPID = 5;
0060 static constexpr uint8_t MIN_STRIPID = 1;
0061 static constexpr uint8_t MAX_CHANNELID = 25;
0062 static constexpr uint8_t MIN_CHANNELID = 1;
0063 static constexpr uint8_t MAX_XTALID = 5;
0064 static constexpr uint8_t MIN_XTALID = 1;
0065
0066 static constexpr int MIN_DCCID_EEM = 1;
0067 static constexpr int MAX_DCCID_EEM = 9;
0068 static constexpr int MIN_DCCID_EBM = 10;
0069 static constexpr int MAX_DCCID_EBM = 27;
0070 static constexpr int MIN_DCCID_EBP = 28;
0071 static constexpr int MAX_DCCID_EBP = 45;
0072 static constexpr int MIN_DCCID_EEP = 46;
0073 static constexpr int MAX_DCCID_EEP = 54;
0074
0075 static constexpr int DCCID_PHI0_EBM = 10;
0076 static constexpr int DCCID_PHI0_EBP = 28;
0077
0078 static constexpr int kDCCChannelBoundary = 17;
0079 static constexpr int DCC_EBM = 10;
0080 static constexpr int DCC_EBP = 28;
0081 static constexpr int DCC_EEM = 1;
0082 static constexpr int DCC_EEP = 46;
0083
0084 private:
0085 uint32_t id_;
0086 };
0087
0088 }
0089 }
0090
0091 #endif