CMS 3D CMS Logo

FastTimeDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_ForwardDetId_FastTimeDetId_H
2 #define DataFormats_ForwardDetId_FastTimeDetId_H 1
3 
4 #include <iosfwd>
7 
8 class FastTimeDetId : public DetId {
9 public:
10  static const int kFastTimeCellZOffset = 10;
11  static const int kFastTimeCellZMask = 0x3FF;
12  static const int kFastTimeCellPhiOffset = 0;
13  static const int kFastTimeCellPhiMask = 0x3FF;
14  static const int kFastTimeZsideOffset = 20;
15  static const int kFastTimeZsideMask = 0x1;
16  static const int kFastTimeTypeOffset = 21;
17  static const int kFastTimeTypeMask = 0x3;
18  enum { Subdet = FastTime };
21  FastTimeDetId();
23  FastTimeDetId(uint32_t rawid);
25  FastTimeDetId(int type, int module_izeta, int module_iphi, int iz);
27  FastTimeDetId(const DetId& id);
29  FastTimeDetId& operator=(const DetId& id);
30 
32  FastTimeDetId geometryCell() const { return FastTimeDetId(type(), 0, 0, zside()); }
33 
35  ForwardSubdetector subdet() const { return FastTime; }
36 
38  int type() const { return (id_ >> kFastTimeTypeOffset) & kFastTimeTypeMask; }
39 
41  int ieta() const { return (id_ >> kFastTimeCellZOffset) & kFastTimeCellZMask; }
42  int iz() const { return (id_ >> kFastTimeCellZOffset) & kFastTimeCellZMask; }
43 
45  int iphi() const { return (id_ >> kFastTimeCellPhiOffset) & kFastTimeCellPhiMask; }
46 
48  int zside() const { return ((((id_ >> kFastTimeZsideOffset) & kFastTimeZsideMask) > 0) ? 1 : -1); }
49 
51  bool isFastTime() const { return true; }
52  bool isForward() const { return true; }
53 
54  static const FastTimeDetId Undefined;
55 };
56 
57 std::ostream& operator<<(std::ostream&, const FastTimeDetId& id);
58 
59 #endif
static const int kFastTimeTypeMask
Definition: FastTimeDetId.h:17
static const int kFastTimeTypeOffset
Definition: FastTimeDetId.h:16
FastTimeDetId & operator=(const DetId &id)
bool isForward() const
Definition: FastTimeDetId.h:52
int type() const
get the type (barrel vs endcap)
Definition: FastTimeDetId.h:38
static const int kFastTimeZsideMask
Definition: FastTimeDetId.h:15
static const int kFastTimeCellPhiMask
Definition: FastTimeDetId.h:13
static const int kFastTimeCellZOffset
Definition: FastTimeDetId.h:10
ForwardSubdetector subdet() const
get the subdetector
Definition: FastTimeDetId.h:35
ForwardSubdetector
static const FastTimeDetId Undefined
Definition: FastTimeDetId.h:54
static const int kFastTimeCellZMask
Definition: FastTimeDetId.h:11
int iphi() const
get the absolute value of the cell #&#39;s along y-axis (EC) | phi (Barrel)
Definition: FastTimeDetId.h:45
int ieta() const
get the absolute value of the cell #&#39;s along x-axis (EC) | z-axis (Barel)
Definition: FastTimeDetId.h:41
int iz() const
Definition: FastTimeDetId.h:42
static const int kFastTimeZsideOffset
Definition: FastTimeDetId.h:14
std::ostream & operator<<(std::ostream &, const FastTimeDetId &id)
Definition: DetId.h:17
int zside() const
get the z-side of the cell (1/-1)
Definition: FastTimeDetId.h:48
uint32_t id_
Definition: DetId.h:69
static const int kFastTimeCellPhiOffset
Definition: FastTimeDetId.h:12
bool isFastTime() const
consistency check : no bits left => no overhead
Definition: FastTimeDetId.h:51
FastTimeDetId geometryCell() const
Definition: FastTimeDetId.h:32