File indexing completed on 2024-04-06 12:04:17
0001 #ifndef HcalCastorDetId_h_included
0002 #define HcalCastorDetId_h_included 1
0003
0004 #include <ostream>
0005 #include "DataFormats/DetId/interface/DetId.h"
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 class HcalCastorDetId : public DetId {
0024 public:
0025 enum Section { Unknown = 0, EM = 1, HAD = 2 };
0026
0027
0028 static const int SubdetectorId = 3;
0029
0030
0031 HcalCastorDetId();
0032
0033
0034 HcalCastorDetId(uint32_t rawid);
0035
0036
0037 HcalCastorDetId(Section section, bool true_for_positive_eta, int sector, int module);
0038
0039
0040 HcalCastorDetId(bool true_for_positive_eta, int sector, int module);
0041
0042
0043 HcalCastorDetId(const DetId& id);
0044
0045
0046 HcalCastorDetId& operator=(const DetId& id);
0047
0048
0049
0050 int zside() const { return 2 * ((id_ >> 8) & 0x1) - 1; }
0051
0052
0053
0054 Section section() const;
0055
0056
0057
0058 int module() const { return (id_ & 0xF); }
0059
0060
0061
0062 int sector() const { return ((id_ >> 4) & 0xF) + 1; }
0063
0064
0065
0066
0067 static constexpr int kNumberModulesPerEnd = 14, kNumberSectorsPerEnd = 16,
0068 kNumberCellsPerEnd = kNumberModulesPerEnd * kNumberSectorsPerEnd,
0069 kSizeForDenseIndexing = kNumberCellsPerEnd;
0070
0071 uint32_t denseIndex() const;
0072
0073 static bool validDetId(Section iSection, bool posEta, int iSector, int iMod);
0074
0075 static bool validDenseIndex(uint32_t din) { return (din < kSizeForDenseIndexing); }
0076
0077 static HcalCastorDetId detIdFromDenseIndex(uint32_t di);
0078
0079 private:
0080 void buildMe(Section section, bool true_for_positive_eta, int sector, int module);
0081 };
0082
0083 std::ostream& operator<<(std::ostream&, const HcalCastorDetId& id);
0084
0085 #endif