CMS 3D CMS Logo

HcalDetId.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_HCALDETID_HCALDETID_H
2 #define DATAFORMATS_HCALDETID_HCALDETID_H 1
3 
4 #include <iosfwd>
7 
8 
12 class HcalDetId : public DetId {
13 
14 public:
15  static const int kHcalPhiMask1 = 0x7F;
16  static const int kHcalPhiMask2 = 0x3FF;
17  static const int kHcalEtaOffset1 = 7;
18  static const int kHcalEtaOffset2 = 10;
19  static const int kHcalEtaMask1 = 0x3F;
20  static const int kHcalEtaMask2 = 0x1FF;
21  static const int kHcalZsideMask1 = 0x2000;
22  static const int kHcalZsideMask2 = 0x80000;
23  static const int kHcalDepthOffset1 = 14;
24  static const int kHcalDepthOffset2 = 20;
25  static const int kHcalDepthMask1 = 0x1F;
26  static const int kHcalDepthMask2 = 0xF;
27  static const int kHcalDepthSet1 = 0x1C000;
28  static const int kHcalDepthSet2 = 0xF00000;
29  static const int kHcalIdFormat2 = 0x1000000;
30  static const int kHcalIdMask = 0xFE000000;
31 
32 public:
34  HcalDetId();
36  HcalDetId(uint32_t rawid);
38  HcalDetId(HcalSubdetector subdet, int tower_ieta, int tower_iphi, int depth);
40  HcalDetId(const DetId& id);
42  HcalDetId& operator=(const DetId& id);
44  bool operator==(DetId id) const;
45  bool operator!=(DetId id) const;
46  bool operator<(DetId id) const;
47 
50  bool oldFormat() const { return ((id_&kHcalIdFormat2)==0)?(true):(false); }
52  int zside() const;
54  int ietaAbs() const;
56  int ieta() const { return zside()*ietaAbs(); }
58  int iphi() const;
60  int depth() const;
62  int hfdepth() const;
64  uint32_t maskDepth() const;
66  uint32_t otherForm() const;
67  void changeForm();
68  uint32_t newForm() const;
69  static uint32_t newForm(const uint32_t&);
71  bool sameBaseDetId(const DetId&) const;
72  HcalDetId baseDetId() const;
74  HcalDetId secondAnodeId() const;
75 
77  int crystal_ieta_low() const { return ((ieta()-zside())*5)+zside(); }
79  int crystal_ieta_high() const { return ((ieta()-zside())*5)+5*zside(); }
81  int crystal_iphi_low() const;
83  int crystal_iphi_high() const;
84 
85  static const HcalDetId Undefined;
86 
87 private:
88 
89  void newFromOld(const uint32_t&);
90  static void unpackId(const uint32_t&, int&, int&, int&, int&);
91 };
92 
93 std::ostream& operator<<(std::ostream&,const HcalDetId& id);
94 
95 #endif
static const HcalDetId Undefined
Definition: HcalDetId.h:85
HcalDetId & operator=(const DetId &id)
Definition: HcalDetId.cc:52
bool sameBaseDetId(const DetId &) const
base detId for HF dual channels
Definition: HcalDetId.cc:180
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.cc:114
int crystal_iphi_low() const
get the smallest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only) ...
Definition: HcalDetId.cc:222
static const int kHcalDepthMask1
Definition: HcalDetId.h:25
static const int kHcalDepthSet2
Definition: HcalDetId.h:28
static const int kHcalDepthSet1
Definition: HcalDetId.h:27
uint32_t maskDepth() const
get the tower depth
Definition: HcalDetId.cc:142
bool operator!=(DetId id) const
Definition: HcalDetId.cc:83
int hfdepth() const
get full depth information for HF
Definition: HcalDetId.cc:134
static const int kHcalDepthMask2
Definition: HcalDetId.h:26
HcalDetId()
Definition: HcalDetId.cc:8
int depth() const
get the tower depth
Definition: HcalDetId.cc:129
bool operator<(DetId id) const
Definition: HcalDetId.cc:93
int crystal_ieta_low() const
get the smallest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only) ...
Definition: HcalDetId.h:77
std::ostream & operator<<(std::ostream &, const HcalDetId &id)
Definition: HcalDetId.cc:253
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
HcalSubdetector
Definition: HcalAssistant.h:31
HcalDetId baseDetId() const
Definition: HcalDetId.cc:192
static const int kHcalDepthOffset1
Definition: HcalDetId.h:23
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
void newFromOld(const uint32_t &)
Definition: HcalDetId.cc:234
bool oldFormat() const
Definition: HcalDetId.h:50
static const int kHcalIdMask
Definition: HcalDetId.h:30
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.cc:119
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:124
static const int kHcalPhiMask2
Definition: HcalDetId.h:16
Definition: DetId.h:18
uint32_t otherForm() const
change format
Definition: HcalDetId.cc:147
static const int kHcalIdFormat2
Definition: HcalDetId.h:29
uint32_t id_
Definition: DetId.h:55
int crystal_ieta_high() const
get the largest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only) ...
Definition: HcalDetId.h:79
uint32_t newForm() const
Definition: HcalDetId.cc:163
static const int kHcalZsideMask1
Definition: HcalDetId.h:21
static const int kHcalEtaOffset2
Definition: HcalDetId.h:18
bool operator==(DetId id) const
Definition: HcalDetId.cc:73
static const int kHcalZsideMask2
Definition: HcalDetId.h:22
static const int kHcalEtaMask2
Definition: HcalDetId.h:20
void changeForm()
Definition: HcalDetId.cc:159
int crystal_iphi_high() const
get the largest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only) ...
Definition: HcalDetId.cc:228
static void unpackId(const uint32_t &, int &, int &, int &, int &)
Definition: HcalDetId.cc:238
HcalDetId secondAnodeId() const
second PMT anode detId for HF dual channels
Definition: HcalDetId.cc:207
static const int kHcalEtaMask1
Definition: HcalDetId.h:19
static const int kHcalPhiMask1
Definition: HcalDetId.h:15
static const int kHcalDepthOffset2
Definition: HcalDetId.h:24
static const int kHcalEtaOffset1
Definition: HcalDetId.h:17