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 
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&);
70 
72  int crystal_ieta_low() const { return ((ieta()-zside())*5)+zside(); }
74  int crystal_ieta_high() const { return ((ieta()-zside())*5)+5*zside(); }
76  int crystal_iphi_low() const;
78  int crystal_iphi_high() const;
79 
80  static const HcalDetId Undefined;
81 
82 private:
83 
84  void newFromOld(const uint32_t&);
85  static void unpackId(const uint32_t&, int&, int&, int&, int&);
86 };
87 
88 std::ostream& operator<<(std::ostream&,const HcalDetId& id);
89 
90 #endif
static const HcalDetId Undefined
Definition: HcalDetId.h:80
HcalDetId & operator=(const DetId &id)
Definition: HcalDetId.cc:52
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:180
static const int kHcalDepthMask1
Definition: HcalDetId.h:25
static const int kHcalDepthSet2
Definition: HcalDetId.h:28
static const int kHcalDepthSet1
Definition: HcalDetId.h:27
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
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:72
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
HcalSubdetector
Definition: HcalAssistant.h:31
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:192
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:74
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:186
static void unpackId(const uint32_t &, int &, int &, int &, int &)
Definition: HcalDetId.cc:196
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