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