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
HcalCastorDetId::kNumberSectorsPerEnd
Definition: HcalCastorDetId.h:69
HcalCastorDetId::validDetId
static bool validDetId(Section iSection, bool posEta, int iSector, int iMod)
Definition: HcalCastorDetId.cc:69
HcalCastorDetId::operator=
HcalCastorDetId & operator=(const DetId &id)
Definition: HcalCastorDetId.cc:32
HcalCastorDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalCastorDetId.h:28
HcalCastorDetId::kNumberModulesPerEnd
Definition: HcalCastorDetId.h:68
HcalCastorDetId::Section
Section
Definition: HcalCastorDetId.h:25
HcalCastorDetId::Unknown
Definition: HcalCastorDetId.h:25
DetId
Definition: DetId.h:17
HcalCastorDetId::detIdFromDenseIndex
static HcalCastorDetId detIdFromDenseIndex(uint32_t di)
Definition: HcalCastorDetId.cc:73
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
HcalCastorDetId::section
Section section() const
get the section
Definition: HcalCastorDetId.cc:49
HcalCastorDetId
Definition: HcalCastorDetId.h:23
HcalCastorDetId::module
int module() const
get the module (1-2 for EM, 1-12 for HAD)
Definition: HcalCastorDetId.h:58
cropTnPTrees.din
din
Definition: cropTnPTrees.py:30
DetId::id_
uint32_t id_
Definition: DetId.h:69
HcalCastorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalCastorDetId.h:50
HcalCastorDetId::sector
int sector() const
get the sector (1-16)
Definition: HcalCastorDetId.h:62
HcalCastorDetId::buildMe
void buildMe(Section section, bool true_for_positive_eta, int sector, int module)
Definition: HcalCastorDetId.cc:9
operator<<
std::ostream & operator<<(std::ostream &, const HcalCastorDetId &id)
Definition: HcalCastorDetId.cc:78
HcalCastorDetId::kSizeForDenseIndexing
Definition: HcalCastorDetId.h:71
DetId.h
HcalCastorDetId::HAD
Definition: HcalCastorDetId.h:25
HcalCastorDetId::validDenseIndex
static bool validDenseIndex(uint32_t din)
Definition: HcalCastorDetId.h:78
HcalCastorDetId::denseIndex
uint32_t denseIndex() const
Definition: HcalCastorDetId.cc:65
HcalCastorDetId::kNumberCellsPerEnd
Definition: HcalCastorDetId.h:70
HcalCastorDetId::EM
Definition: HcalCastorDetId.h:25
HcalCastorDetId::HcalCastorDetId
HcalCastorDetId()
Definition: HcalCastorDetId.cc:5