File indexing completed on 2023-03-17 10:50:01
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 enum {
0068 kNumberModulesPerEnd = 14,
0069 kNumberSectorsPerEnd = 16,
0070 kNumberCellsPerEnd = kNumberModulesPerEnd * kNumberSectorsPerEnd,
0071 kSizeForDenseIndexing = kNumberCellsPerEnd
0072 };
0073
0074 uint32_t denseIndex() const;
0075
0076 static bool validDetId(Section iSection, bool posEta, int iSector, int iMod);
0077
0078 static bool validDenseIndex(uint32_t din) { return (din < kSizeForDenseIndexing); }
0079
0080 static HcalCastorDetId detIdFromDenseIndex(uint32_t di);
0081
0082 private:
0083 void buildMe(Section section, bool true_for_positive_eta, int sector, int module);
0084 };
0085
0086 std::ostream& operator<<(std::ostream&, const HcalCastorDetId& id);
0087
0088 #endif