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  public:
28  HcalTrigTowerDetId(uint32_t rawid);
31  HcalTrigTowerDetId(int ieta, int iphi);
34  HcalTrigTowerDetId(int ieta, int iphi, int depth);
37  HcalTrigTowerDetId(int ieta, int iphi, int depth, int version);
38 
40  HcalTrigTowerDetId(const DetId& id);
43 
44  void setVersion(int version);
45 
49  int zside() const { return (id_&kHcalZsideMask)?(1):(-1); }
51  int ietaAbs() const { return (id_>>kHcalEtaOffset)&kHcalEtaMask; }
53  int ieta() const { return zside()*ietaAbs(); }
55  int iphi() const { return id_&kHcalPhiMask; }
57  int depth() const { return (id_>>kHcalDepthOffset)&kHcalDepthMask; }
59  int version() const { return (id_>>kHcalVersOffset)&kHcalVersMask; }
60 
62 
63 };
64 
65 std::ostream& operator<<(std::ostream&,const HcalTrigTowerDetId& id);
66 
67 
68 #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 &, const HcalTrigTowerDetId &id)
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)
HcalSubdetector
Definition: HcalAssistant.h:31
static const int kHcalDepthMask
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:38
static const int kHcalPhiMask
static const int kHcalDepthOffset
Definition: DetId.h:18
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:56
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