CMS 3D CMS Logo

HcalCastorDetId.h
Go to the documentation of this file.
1 #ifndef HcalCastorDetId_h_included
2 #define HcalCastorDetId_h_included 1
3 
4 #include <ostream>
6 
23 class HcalCastorDetId : public DetId {
24 public:
25  enum Section { Unknown = 0, EM = 1, HAD = 2 };
26 
27  // 1 => CaloTower, 2 => ZDC, 3 => Castor
28  static const int SubdetectorId = 3;
29 
32 
34  HcalCastorDetId(uint32_t rawid);
35 
37  HcalCastorDetId(Section section, bool true_for_positive_eta, int sector, int module);
38 
39  // constructor without section
40  HcalCastorDetId(bool true_for_positive_eta, int sector, int module);
41 
43  HcalCastorDetId(const DetId& id);
44 
46  HcalCastorDetId& operator=(const DetId& id);
47 
49  //int zside() const { return (id_&0x40)?(1):(-1); }
50  int zside() const { return 2 * ((id_ >> 8) & 0x1) - 1; }
51 
53  //Section section() const { return (Section)((id_>>7)&0x3); }
54  Section section() const;
55 
57  //int module() const { return id_&0xF; }
58  int module() const { return (id_ & 0xF); }
59 
61  //int sector() const { return (id_>>6)&0x3; }
62  int sector() const { return ((id_ >> 4) & 0xF) + 1; }
63 
64  // get the individual cell id
65  // int channel() const;
66 
70 
71  uint32_t denseIndex() const;
72 
73  static bool validDetId(Section iSection, bool posEta, int iSector, int iMod);
74 
75  static bool validDenseIndex(uint32_t din) { return (din < kSizeForDenseIndexing); }
76 
77  static HcalCastorDetId detIdFromDenseIndex(uint32_t di);
78 
79 private:
80  void buildMe(Section section, bool true_for_positive_eta, int sector, int module);
81 };
82 
83 std::ostream& operator<<(std::ostream&, const HcalCastorDetId& id);
84 
85 #endif // HcalCastorDetId_h_included
static bool validDetId(Section iSection, bool posEta, int iSector, int iMod)
static constexpr int kNumberModulesPerEnd
static constexpr int kNumberCellsPerEnd
void buildMe(Section section, bool true_for_positive_eta, int sector, int module)
static HcalCastorDetId detIdFromDenseIndex(uint32_t di)
static constexpr int kNumberSectorsPerEnd
int module() const
get the module (1-2 for EM, 1-12 for HAD)
int zside() const
get the z-side of the cell (1/-1)
static bool validDenseIndex(uint32_t din)
int sector() const
get the sector (1-16)
static const int SubdetectorId
HcalCastorDetId & operator=(const DetId &id)
Definition: DetId.h:17
uint32_t id_
Definition: DetId.h:69
Section section() const
get the section
std::ostream & operator<<(std::ostream &, const HcalCastorDetId &id)
static constexpr int kSizeForDenseIndexing
uint32_t denseIndex() const