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 
67  enum {
72  };
73 
74  uint32_t denseIndex() const;
75 
76  static bool validDetId(Section iSection, bool posEta, int iSector, int iMod);
77 
78  static bool validDenseIndex(uint32_t din) { return (din < kSizeForDenseIndexing); }
79 
80  static HcalCastorDetId detIdFromDenseIndex(uint32_t di);
81 
82 private:
83  void buildMe(Section section, bool true_for_positive_eta, int sector, int module);
84 };
85 
86 std::ostream& operator<<(std::ostream&, const HcalCastorDetId& id);
87 
88 #endif // HcalCastorDetId_h_included
static bool validDetId(Section iSection, bool posEta, int iSector, int iMod)
void buildMe(Section section, bool true_for_positive_eta, int sector, int module)
static HcalCastorDetId detIdFromDenseIndex(uint32_t di)
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)
uint32_t denseIndex() const