File indexing completed on 2024-09-10 02:58:36
0001 #ifndef DATAFORMATS_ECALDETID_ECALTRIGGERELECTRONICSID_H
0002 #define DATAFORMATS_ECALDETID_ECALTRIGGERELECTRONICSID_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 EcalTriggerElectronicsId {
0019 public:
0020
0021 EcalTriggerElectronicsId();
0022
0023 EcalTriggerElectronicsId(uint32_t);
0024
0025 EcalTriggerElectronicsId(int tccid, int towerid, int pseudostripid, int channelid);
0026
0027 uint32_t operator()() { return EcalTriggerElectronicsId_; }
0028 uint32_t rawId() const { return EcalTriggerElectronicsId_; }
0029
0030
0031 int tccId() const { return (EcalTriggerElectronicsId_ >> 13) & 0x7F; }
0032
0033 int ttId() const { return (EcalTriggerElectronicsId_ >> 6) & 0x7F; }
0034
0035 int pseudoStripId() const { return (EcalTriggerElectronicsId_ >> 3) & 0x7; }
0036
0037 int channelId() const { return (EcalTriggerElectronicsId_ & 0x7); }
0038
0039 int linearIndex() const { return (EcalTriggerElectronicsId_) & 0xFFFFF; }
0040
0041
0042 int zside() const;
0043
0044
0045 EcalSubdetector subdet() const;
0046
0047 static const int MAX_TCCID = 108;
0048 static const int MIN_TCCID = 1;
0049 static const int MAX_TTID = 68;
0050 static const int MIN_TTID = 1;
0051 static const int MAX_PSEUDOSTRIPID = 5;
0052 static const int MIN_PSEUDOSTRIPID = 1;
0053 static const int MAX_CHANNELID = 5;
0054 static const int MIN_CHANNELID = 1;
0055
0056 static const int MIN_TCCID_EEM = 1;
0057 static const int MAX_TCCID_EEM = 36;
0058 static const int MIN_TCCID_EBM = 37;
0059 static const int MAX_TCCID_EBM = 54;
0060 static const int MIN_TCCID_EBP = 55;
0061 static const int MAX_TCCID_EBP = 72;
0062 static const int MIN_TCCID_EEP = 73;
0063 static const int MAX_TCCID_EEP = 108;
0064
0065 static const int TCCID_PHI0_EEM_IN = 1;
0066 static const int TCCID_PHI0_EEM_OUT = 19;
0067 static const int TCCID_PHI0_EEP_IN = 91;
0068 static const int TCCID_PHI0_EEP_OUT = 73;
0069 static const int TCCID_PHI0_EBM = 37;
0070 static const int TCCID_PHI0_EBP = 55;
0071
0072
0073 int operator==(const EcalTriggerElectronicsId& id) const {
0074 return id.EcalTriggerElectronicsId_ == EcalTriggerElectronicsId_;
0075 }
0076
0077 int operator!=(const EcalTriggerElectronicsId& id) const {
0078 return id.EcalTriggerElectronicsId_ != EcalTriggerElectronicsId_;
0079 }
0080
0081 int operator<(const EcalTriggerElectronicsId& id) const {
0082 return EcalTriggerElectronicsId_ < id.EcalTriggerElectronicsId_;
0083 }
0084
0085 private:
0086 uint32_t EcalTriggerElectronicsId_;
0087 };
0088
0089 std::ostream& operator<<(std::ostream&, const EcalTriggerElectronicsId&);
0090
0091 #endif