CMS 3D CMS Logo

EcalElectronicsId.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_ECALDETID_ECALELECTRONICSID_H
2 #define DATAFORMATS_ECALDETID_ECALELECTRONICSID_H 1
3 
4 #include <ostream>
5 #include <cstdint>
6 
8 
19 public:
23  EcalElectronicsId(uint32_t);
25  EcalElectronicsId(int dccid, int towerid, int stripid, int xtalid);
26 
27  uint32_t operator()() { return EcalElectronicsId_; }
28  uint32_t rawId() const { return EcalElectronicsId_; }
29 
31  int dccId() const { return (EcalElectronicsId_ >> 13) & 0x7F; }
33  int towerId() const { return (EcalElectronicsId_ >> 6) & 0x7F; }
35  int stripId() const { return (EcalElectronicsId_ >> 3) & 0x7; }
37  int xtalId() const { return (EcalElectronicsId_ & 0x7); }
38 
40  int zside() const;
41 
43  EcalSubdetector subdet() const;
44 
46  int linearIndex() const { return (EcalElectronicsId_)&0x3FFFFF; }
47 
49  int channelId() const; // xtal id between 1 and 25
50 
51  static const int MAX_DCCID = 54; //To be updated with correct and final number
52  static const int MIN_DCCID = 1;
53  static const int MAX_TOWERID = 70;
54  static const int MIN_TOWERID = 1;
55  static const int MAX_STRIPID = 5;
56  static const int MIN_STRIPID = 1;
57  static const int MAX_CHANNELID = 25;
58  static const int MIN_CHANNELID = 1;
59  static const int MAX_XTALID = 5;
60  static const int MIN_XTALID = 1;
61 
62  static const int MIN_DCCID_EEM = 1;
63  static const int MAX_DCCID_EEM = 9;
64  static const int MIN_DCCID_EBM = 10;
65  static const int MAX_DCCID_EBM = 27;
66  static const int MIN_DCCID_EBP = 28;
67  static const int MAX_DCCID_EBP = 45;
68  static const int MIN_DCCID_EEP = 46;
69  static const int MAX_DCCID_EEP = 54;
70 
71  static const int DCCID_PHI0_EBM = 10;
72  static const int DCCID_PHI0_EBP = 28;
73 
74  static const int kDCCChannelBoundary = 17;
75  static const int DCC_EBM = 10; // id of the DCC in EB- which contains phi=0 deg.
76  static const int DCC_EBP = 28; // id of the DCC in EB+ which contains phi=0 deg.
77  static const int DCC_EEM = 1; // id of the DCC in EE- which contains phi=0 deg.
78  static const int DCC_EEP = 46; // id of the DCC in EE+ which contains phi=0 deg.
79 
81  int operator==(const EcalElectronicsId& id) const { return id.EcalElectronicsId_ == EcalElectronicsId_; }
83  int operator!=(const EcalElectronicsId& id) const { return id.EcalElectronicsId_ != EcalElectronicsId_; }
85  int operator<(const EcalElectronicsId& id) const { return EcalElectronicsId_ < id.EcalElectronicsId_; }
86 
87 private:
89 };
90 
91 std::ostream& operator<<(std::ostream&, const EcalElectronicsId&);
92 
93 #endif
EcalElectronicsId::MIN_CHANNELID
static const int MIN_CHANNELID
Definition: EcalElectronicsId.h:58
EcalElectronicsId::MIN_XTALID
static const int MIN_XTALID
Definition: EcalElectronicsId.h:60
EcalElectronicsId::MIN_TOWERID
static const int MIN_TOWERID
Definition: EcalElectronicsId.h:54
EcalElectronicsId::zside
int zside() const
zside = +1 or -1
Definition: EcalElectronicsId.cc:27
EcalElectronicsId::operator()
uint32_t operator()()
Definition: EcalElectronicsId.h:27
EcalElectronicsId::MIN_STRIPID
static const int MIN_STRIPID
Definition: EcalElectronicsId.h:56
EcalElectronicsId::MAX_XTALID
static const int MAX_XTALID
Definition: EcalElectronicsId.h:59
EcalSubdetector
EcalSubdetector
Definition: EcalSubdetector.h:10
EcalElectronicsId::dccId
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
Definition: EcalElectronicsId.h:31
EcalElectronicsId::MIN_DCCID
static const int MIN_DCCID
Definition: EcalElectronicsId.h:52
EcalElectronicsId::towerId
int towerId() const
get the tower id
Definition: EcalElectronicsId.h:33
EcalElectronicsId::MIN_DCCID_EBM
static const int MIN_DCCID_EBM
Definition: EcalElectronicsId.h:64
EcalElectronicsId::operator<
int operator<(const EcalElectronicsId &id) const
Compare the id to another id for use in a map.
Definition: EcalElectronicsId.h:85
EcalElectronicsId::channelId
int channelId() const
so far for EndCap only :
Definition: EcalElectronicsId.cc:71
EcalElectronicsId::MAX_DCCID
static const int MAX_DCCID
Definition: EcalElectronicsId.h:51
EcalElectronicsId
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
Definition: EcalElectronicsId.h:18
EcalElectronicsId::DCC_EEP
static const int DCC_EEP
Definition: EcalElectronicsId.h:78
EcalSubdetector.h
EcalElectronicsId::linearIndex
int linearIndex() const
get a fast, compact, unique index for linear lookups (maximum value = 4194303)
Definition: EcalElectronicsId.h:46
EcalElectronicsId::MAX_DCCID_EBP
static const int MAX_DCCID_EBP
Definition: EcalElectronicsId.h:67
EcalElectronicsId::rawId
uint32_t rawId() const
Definition: EcalElectronicsId.h:28
EcalElectronicsId::MAX_DCCID_EEM
static const int MAX_DCCID_EEM
Definition: EcalElectronicsId.h:63
EcalElectronicsId::MAX_STRIPID
static const int MAX_STRIPID
Definition: EcalElectronicsId.h:55
EcalElectronicsId::operator!=
int operator!=(const EcalElectronicsId &id) const
Definition: EcalElectronicsId.h:83
EcalElectronicsId::MAX_TOWERID
static const int MAX_TOWERID
Definition: EcalElectronicsId.h:53
EcalElectronicsId::DCC_EBM
static const int DCC_EBM
Definition: EcalElectronicsId.h:75
EcalElectronicsId::DCCID_PHI0_EBM
static const int DCCID_PHI0_EBM
Definition: EcalElectronicsId.h:71
EcalElectronicsId::subdet
EcalSubdetector subdet() const
get the subdet
Definition: EcalElectronicsId.cc:19
EcalElectronicsId::DCCID_PHI0_EBP
static const int DCCID_PHI0_EBP
Definition: EcalElectronicsId.h:72
EcalElectronicsId::DCC_EEM
static const int DCC_EEM
Definition: EcalElectronicsId.h:77
EcalElectronicsId::MAX_DCCID_EEP
static const int MAX_DCCID_EEP
Definition: EcalElectronicsId.h:69
EcalElectronicsId::kDCCChannelBoundary
static const int kDCCChannelBoundary
Definition: EcalElectronicsId.h:74
EcalElectronicsId::EcalElectronicsId
EcalElectronicsId()
Definition: EcalElectronicsId.cc:6
EcalElectronicsId::MAX_DCCID_EBM
static const int MAX_DCCID_EBM
Definition: EcalElectronicsId.h:65
EcalElectronicsId::stripId
int stripId() const
get the tower id
Definition: EcalElectronicsId.h:35
EcalElectronicsId::MIN_DCCID_EEM
static const int MIN_DCCID_EEM
Definition: EcalElectronicsId.h:62
EcalElectronicsId::DCC_EBP
static const int DCC_EBP
Definition: EcalElectronicsId.h:76
EcalElectronicsId::MIN_DCCID_EEP
static const int MIN_DCCID_EEP
Definition: EcalElectronicsId.h:68
operator<<
std::ostream & operator<<(std::ostream &, const EcalElectronicsId &)
Definition: EcalElectronicsId.cc:109
EcalElectronicsId::EcalElectronicsId_
uint32_t EcalElectronicsId_
Definition: EcalElectronicsId.h:88
EcalElectronicsId::xtalId
int xtalId() const
get the channel id
Definition: EcalElectronicsId.h:37
EcalElectronicsId::MIN_DCCID_EBP
static const int MIN_DCCID_EBP
Definition: EcalElectronicsId.h:66
EcalElectronicsId::operator==
int operator==(const EcalElectronicsId &id) const
Definition: EcalElectronicsId.h:81
EcalElectronicsId::MAX_CHANNELID
static const int MAX_CHANNELID
Definition: EcalElectronicsId.h:57