CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HcalTrigTowerDetId.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_HCALDETID_HCALTRIGTOWERDETID_H
2 #define DATAFORMATS_HCALDETID_HCALTRIGTOWERDETID_H 1
3 
4 #include <ostream>
7 
14 class HcalTrigTowerDetId : public DetId {
15 public:
16  static const int kHcalPhiMask = 0x7F;
17  static const int kHcalEtaOffset = 7;
18  static const int kHcalEtaMask = 0x3F;
19  static const int kHcalZsideMask = 0x2000;
20  static const int kHcalDepthOffset = 14;
21  static const int kHcalDepthMask = 0x7;
22  static const int kHcalVersOffset = 17;
23  static const int kHcalVersMask = 0x7;
24 
25 public:
29  HcalTrigTowerDetId(uint32_t rawid);
32  HcalTrigTowerDetId(int ieta, int iphi);
35  HcalTrigTowerDetId(int ieta, int iphi, int depth);
38  HcalTrigTowerDetId(int ieta, int iphi, int depth, int version);
39 
41  HcalTrigTowerDetId(const DetId& id);
44 
45  void setVersion(int version);
46 
50  int zside() const { return (id_ & kHcalZsideMask) ? (1) : (-1); }
52  int ietaAbs() const { return (id_ >> kHcalEtaOffset) & kHcalEtaMask; }
54  int ieta() const { return zside() * ietaAbs(); }
56  int iphi() const { return id_ & kHcalPhiMask; }
58  int depth() const { return (id_ >> kHcalDepthOffset) & kHcalDepthMask; }
60  int version() const { return (id_ >> kHcalVersOffset) & kHcalVersMask; }
61 
63 };
64 
65 std::ostream& operator<<(std::ostream&, const HcalTrigTowerDetId& id);
66 
67 #endif
static const int kHcalVersMask
int zside() const
get the z-side of the tower (1/-1)
void setVersion(int version)
HcalSubdetector subdet() const
get the subdetector
static const int kHcalEtaOffset
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
static const int kHcalEtaMask
int ieta() const
get the tower ieta
int depth() const
get the depth (zero for LHC Run 1, may be nonzero for later runs)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
HcalSubdetector
Definition: HcalAssistant.h:31
static const int kHcalDepthMask
static const int kHcalPhiMask
static const int kHcalDepthOffset
Definition: DetId.h:17
HcalTrigTowerDetId & operator=(const DetId &id)
static const int kHcalVersOffset
int version() const
get the version code for the trigger tower
uint32_t id_
Definition: DetId.h:69
static const HcalTrigTowerDetId Undefined
static const int kHcalZsideMask
int ietaAbs() const
get the absolute value of the tower ieta
int iphi() const
get the tower iphi