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 
9 class FastTimeDetId : public DetId {
10 public:
11  static const int kFastTimeCellZOffset = 10;
12  static const int kFastTimeCellZMask = 0x3FF;
13  static const int kFastTimeCellPhiOffset = 0;
14  static const int kFastTimeCellPhiMask = 0x3FF;
15  static const int kFastTimeZsideOffset = 20;
16  static const int kFastTimeZsideMask = 0x1;
17  static const int kFastTimeTypeOffset = 21;
18  static const int kFastTimeTypeMask = 0x3;
19  enum {Subdet=FastTime};
22  FastTimeDetId();
24  FastTimeDetId(uint32_t rawid);
26  FastTimeDetId(int type, int module_izeta, int module_iphi, int iz);
28  FastTimeDetId(const DetId& id);
30  FastTimeDetId& operator=(const DetId& id);
31 
33  FastTimeDetId geometryCell () const {return FastTimeDetId (type(), 0, 0, zside());}
34 
36  ForwardSubdetector subdet() const { return FastTime; }
37 
39  int type() const { return (id_>>kFastTimeTypeOffset)&kFastTimeTypeMask; }
40 
42  int ieta() const { return (id_>>kFastTimeCellZOffset)&kFastTimeCellZMask; }
43  int iz() const { return (id_>>kFastTimeCellZOffset)&kFastTimeCellZMask; }
44 
46  int iphi() const { return (id_>>kFastTimeCellPhiOffset)&kFastTimeCellPhiMask; }
47 
49  int zside() const { return ((((id_>>kFastTimeZsideOffset)&kFastTimeZsideMask) > 0) ? 1 : -1); }
50 
52  bool isFastTime() const { return true; }
53  bool isForward() const { return true; }
54 
55  static const FastTimeDetId Undefined;
56 
57 };
58 
59 std::ostream& operator<<(std::ostream&,const FastTimeDetId& id);
60 
61 #endif
type
Definition: HCALResponse.h:21
static const int kFastTimeTypeMask
Definition: FastTimeDetId.h:18
int iz() const
Definition: FastTimeDetId.h:43
static const int kFastTimeTypeOffset
Definition: FastTimeDetId.h:17
int ieta() const
get the absolute value of the cell #&#39;s along x-axis (EC) | z-axis (Barel)
Definition: FastTimeDetId.h:42
bool isForward() const
Definition: FastTimeDetId.h:53
FastTimeDetId & operator=(const DetId &id)
FastTimeDetId geometryCell() const
Definition: FastTimeDetId.h:33
ForwardSubdetector subdet() const
get the subdetector
Definition: FastTimeDetId.h:36
static const int kFastTimeZsideMask
Definition: FastTimeDetId.h:16
static const int kFastTimeCellPhiMask
Definition: FastTimeDetId.h:14
static const int kFastTimeCellZOffset
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:46
int zside() const
get the z-side of the cell (1/-1)
Definition: FastTimeDetId.h:49
ForwardSubdetector
static const FastTimeDetId Undefined
Definition: FastTimeDetId.h:55
bool isFastTime() const
consistency check : no bits left => no overhead
Definition: FastTimeDetId.h:52
static const int kFastTimeCellZMask
Definition: FastTimeDetId.h:12
int type() const
get the type (barrel vs endcap)
Definition: FastTimeDetId.h:39
static const int kFastTimeZsideOffset
Definition: FastTimeDetId.h:15
std::ostream & operator<<(std::ostream &, const FastTimeDetId &id)
Definition: DetId.h:18
uint32_t id_
Definition: DetId.h:56
static const int kFastTimeCellPhiOffset
Definition: FastTimeDetId.h:13