CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
16 class HcalDetId : public DetId {
17 public:
18  static const int kHcalPhiMask1 = 0x7F;
19  static const int kHcalPhiMask2 = 0x3FF;
20  static const int kHcalEtaOffset1 = 7;
21  static const int kHcalEtaOffset2 = 10;
22  static const int kHcalEtaMask1 = 0x3F;
23  static const int kHcalEtaMask2 = 0x1FF;
24  static const int kHcalZsideMask1 = 0x2000;
25  static const int kHcalZsideMask2 = 0x80000;
26  static const int kHcalDepthOffset1 = 14;
27  static const int kHcalDepthOffset2 = 20;
28  static const int kHcalDepthMask1 = 0x1F;
29  static const int kHcalDepthMask2 = 0xF;
30  static const int kHcalDepthSet1 = 0x1C000;
31  static const int kHcalDepthSet2 = 0xF00000;
32  static const int kHcalIdFormat2 = 0x1000000;
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);
43 
47  int zside() const { return (id_&kHcalZsideMask1)?(1):(-1); }
49  int ietaAbs() const { return (id_>>kHcalEtaOffset1)&kHcalEtaMask1; }
51  int ieta() const { return zside()*ietaAbs(); }
53  int iphi() const { return id_&kHcalPhiMask1; }
55  int depth() const { return (id_>>kHcalDepthOffset1)&kHcalDepthMask1; }
57  uint32_t maskDepth() const { return (id_ | kHcalDepthSet1); }
59  int crystal_ieta_low() const { return ((ieta()-zside())*5)+zside(); }
61  int crystal_ieta_high() const { return ((ieta()-zside())*5)+5*zside(); }
63  int crystal_iphi_low() const;
65  int crystal_iphi_high() const;
66 
67  static const HcalDetId Undefined;
68 
69 };
70 
71 std::ostream& operator<<(std::ostream&,const HcalDetId& id);
72 
73 #endif
static const HcalDetId Undefined
Definition: HcalDetId.h:67
HcalDetId & operator=(const DetId &id)
Definition: HcalDetId.cc:33
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:45
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:47
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:47
static const int kHcalDepthMask1
Definition: HcalDetId.h:28
static const int kHcalDepthSet2
Definition: HcalDetId.h:31
static const int kHcalDepthSet1
Definition: HcalDetId.h:30
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
uint32_t maskDepth() const
get the tower depth
Definition: HcalDetId.h:57
static const int kHcalDepthMask2
Definition: HcalDetId.h:29
HcalDetId()
Definition: HcalDetId.cc:7
int depth() const
get the tower depth
Definition: HcalDetId.h:55
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:59
int ieta() const
get the cell ieta
Definition: HcalDetId.h:51
HcalSubdetector
Definition: HcalAssistant.h:31
static const int kHcalDepthOffset1
Definition: HcalDetId.h:26
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:49
int iphi() const
get the cell iphi
Definition: HcalDetId.h:53
static const int kHcalPhiMask2
Definition: HcalDetId.h:19
Definition: DetId.h:18
static const int kHcalIdFormat2
Definition: HcalDetId.h:32
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:61
static const int kHcalZsideMask1
Definition: HcalDetId.h:24
static const int kHcalEtaOffset2
Definition: HcalDetId.h:21
static const int kHcalZsideMask2
Definition: HcalDetId.h:25
static const int kHcalEtaMask2
Definition: HcalDetId.h:23
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:53
static const int kHcalEtaMask1
Definition: HcalDetId.h:22
static const int kHcalPhiMask1
Definition: HcalDetId.h:18
static const int kHcalDepthOffset2
Definition: HcalDetId.h:27
static const int kHcalEtaOffset1
Definition: HcalDetId.h:20