CMS 3D CMS Logo

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
void setVersion(int version)
static const int kHcalEtaOffset
std::ostream & operator<<(std::ostream &, const HcalTrigTowerDetId &id)
static const int kHcalEtaMask
int iphi() const
get the tower iphi
int depth() const
get the depth (zero for LHC Run 1, may be nonzero for later runs)
HcalSubdetector
Definition: HcalAssistant.h:31
static const int kHcalDepthMask
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int ieta() const
get the tower ieta
static const int kHcalPhiMask
static const int kHcalDepthOffset
Definition: DetId.h:17
HcalTrigTowerDetId & operator=(const DetId &id)
HcalSubdetector subdet() const
get the subdetector
static const int kHcalVersOffset
uint32_t id_
Definition: DetId.h:69
int ietaAbs() const
get the absolute value of the tower ieta
static const HcalTrigTowerDetId Undefined
int zside() const
get the z-side of the tower (1/-1)
static const int kHcalZsideMask
int version() const
get the version code for the trigger tower