File indexing completed on 2024-04-06 12:04:08
0001 #ifndef DataFormats_ForwardDetId_HGCEEDetId_H
0002 #define DataFormats_ForwardDetId_HGCEEDetId_H 1
0003
0004 #include <iosfwd>
0005 #include "DataFormats/DetId/interface/DetId.h"
0006 #include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h"
0007
0008 class HGCEEDetId : public DetId {
0009 public:
0010 static const int kHGCEECellOffset = 0;
0011 static const int kHGCEECellMask = 0xFFF;
0012 static const int kHGCEESectorOffset = 12;
0013 static const int kHGCEESectorMask = 0x3F;
0014 static const int kHGCEESubSectorOffset = 18;
0015 static const int kHGCEESubSectorMask = 0x1;
0016 static const int kHGCEELayerOffset = 19;
0017 static const int kHGCEELayerMask = 0x1F;
0018 static const int kHGCEEZsideOffset = 24;
0019 static const int kHGCEEZsideMask = 0x1;
0020 enum { Subdet = HGCEE };
0021
0022 HGCEEDetId();
0023
0024 HGCEEDetId(uint32_t rawid);
0025
0026 HGCEEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell);
0027
0028 HGCEEDetId(const DetId& id);
0029
0030 HGCEEDetId& operator=(const DetId& id);
0031
0032
0033 HGCEEDetId geometryCell() const { return HGCEEDetId(subdet(), zside(), layer(), sector(), 0, 0); }
0034
0035
0036 ForwardSubdetector subdet() const { return HGCEE; }
0037
0038
0039 int cell() const { return id_ & kHGCEECellMask; }
0040
0041
0042 int sector() const { return (id_ >> kHGCEESectorOffset) & kHGCEESectorMask; }
0043
0044
0045 int subsector() const { return ((id_ >> kHGCEESubSectorOffset) & kHGCEESubSectorMask ? 1 : -1); }
0046
0047
0048 int layer() const { return (id_ >> kHGCEELayerOffset) & kHGCEELayerMask; }
0049
0050
0051 int zside() const { return ((id_ >> kHGCEEZsideOffset) & kHGCEEZsideMask ? 1 : -1); }
0052
0053
0054 bool isEE() const { return true; }
0055 bool isForward() const { return true; }
0056
0057 static const HGCEEDetId Undefined;
0058 };
0059
0060 std::ostream& operator<<(std::ostream&, const HGCEEDetId& id);
0061
0062 #endif