CMS 3D CMS Logo

HFNoseTriggerDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_ForwardDetId_HFNoseTriggerDetId_H
2 #define DataFormats_ForwardDetId_HFNoseTriggerDetId_H 1
3 
4 #include <iosfwd>
5 #include <vector>
9 
10 /* \brief description of the bit assigment
11  [0:3] u-coordinate of the cell (measured from the lower left
12  [4:7] v-coordinate of the cell corner of the wafer)
13  [8:11] abs(u) of the wafer (u-axis points along -x axis)
14  [12:12] sign of u (0:+u; 1:-u) (u=0 is at the center of beam line)
15  [13:16] abs(v) of the wafer (v-axis points 60-degree wrt x-axis)
16  [17:17] sign of v (0:+v; 1:-v) (v=0 is at the center of beam line)
17  [18:22] layer number
18  [23:24] Type (0 fine divisions of wafer with 120 mum thick silicon
19  1 coarse divisions of wafer with 200 mum thick silicon
20  2 coarse divisions of wafer with 300 mum thick silicon)
21  [25:26] Subdetector Type (HFNoseTrigger)
22  [27:27] z-side (0 for +z; 1 for -z)
23  [28:31] Detector type (HGCalTrigger)
24 */
25 
26 class HFNoseTriggerDetId : public DetId {
27 public:
28  static const int HFNoseTriggerCell = 4;
29 
33  HFNoseTriggerDetId(uint32_t rawid);
35  HFNoseTriggerDetId(int subdet, int zp, int type, int layer, int waferU, int waferV, int cellU, int cellV);
37  HFNoseTriggerDetId(const DetId& id);
40 
44  }
45 
47  int type() const { return (id_ >> kHFNoseTypeOffset) & kHFNoseTypeMask; }
48 
50  int zside() const { return (((id_ >> kHFNoseZsideOffset) & kHFNoseZsideMask) ? -1 : 1); }
51 
53  int layer() const { return (id_ >> kHFNoseLayerOffset) & kHFNoseLayerMask; }
54 
56  HFNoseDetId geometryCell() const { return HFNoseDetId(zside(), 0, layer(), waferU(), waferV(), 0, 0); }
57  HFNoseDetId moduleId() const { return HFNoseDetId(zside(), type(), layer(), waferU(), waferV(), 0, 0); }
58 
60  int triggerCellU() const { return (id_ >> kHFNoseCellUOffset) & kHFNoseCellUMask; }
61  int triggerCellV() const { return (id_ >> kHFNoseCellVOffset) & kHFNoseCellVMask; }
62  std::pair<int, int> triggerCellUV() const { return std::pair<int, int>(triggerCellU(), triggerCellV()); }
63  int triggerCellX() const;
64  int triggerCellY() const;
65  std::pair<int, int> triggerCellXY() const { return std::pair<int, int>(triggerCellX(), triggerCellY()); }
66 
68  int waferUAbs() const { return (id_ >> kHFNoseWaferUOffset) & kHFNoseWaferUMask; }
69  int waferVAbs() const { return (id_ >> kHFNoseWaferVOffset) & kHFNoseWaferVMask; }
70  int waferU() const {
72  }
73  int waferV() const {
75  }
76  std::pair<int, int> waferUV() const { return std::pair<int, int>(waferU(), waferV()); }
77  int waferX() const { return (-2 * waferU() + waferV()); }
78  int waferY() const { return (2 * waferV()); }
79  std::pair<int, int> waferXY() const { return std::pair<int, int>(waferX(), waferY()); }
80 
81  // get trigger cell u,v
82  std::vector<int> cellU() const;
83  std::vector<int> cellV() const;
84  std::vector<std::pair<int, int> > cellUV() const;
85 
87  bool isEE() const { return (layer() <= kHFNoseMaxEELayer); }
88  bool isHSilicon() const { return (layer() > kHFNoseMaxEELayer); }
89  bool isForward() const { return true; }
90 
92 
93  static const int kHFNoseCellUOffset = 0;
94  static const int kHFNoseCellUMask = 0xF;
95  static const int kHFNoseCellVOffset = 4;
96  static const int kHFNoseCellVMask = 0xF;
97  static const int kHFNoseWaferUOffset = 8;
98  static const int kHFNoseWaferUMask = 0xF;
99  static const int kHFNoseWaferUSignOffset = 12;
100  static const int kHFNoseWaferUSignMask = 0x1;
101  static const int kHFNoseWaferVOffset = 13;
102  static const int kHFNoseWaferVMask = 0xF;
103  static const int kHFNoseWaferVSignOffset = 17;
104  static const int kHFNoseWaferVSignMask = 0x1;
105  static const int kHFNoseLayerOffset = 18;
106  static const int kHFNoseLayerMask = 0x1F;
107  static const int kHFNoseTypeOffset = 23;
108  static const int kHFNoseTypeMask = 0x3;
109  static const int kHFNoseZsideOffset = 27;
110  static const int kHFNoseZsideMask = 0x1;
111  static const int kHFNoseSubdetOffset = 25;
112  static const int kHFNoseSubdetMask = 0x3;
113  static const int kHFNoseMaxEELayer = 6;
114 };
115 
116 std::ostream& operator<<(std::ostream&, const HFNoseTriggerDetId& id);
117 
118 #endif
HFNoseTriggerDetId::kHFNoseLayerOffset
static const int kHFNoseLayerOffset
Definition: HFNoseTriggerDetId.h:105
HFNoseTriggerDetId::waferUAbs
int waferUAbs() const
get the wafer #'s in u,v or in x,y
Definition: HFNoseTriggerDetId.h:68
HFNoseTriggerDetId::kHFNoseCellVOffset
static const int kHFNoseCellVOffset
Definition: HFNoseTriggerDetId.h:95
HFNoseTriggerDetId::kHFNoseWaferUSignMask
static const int kHFNoseWaferUSignMask
Definition: HFNoseTriggerDetId.h:100
HFNoseTriggerDetId::isHSilicon
bool isHSilicon() const
Definition: HFNoseTriggerDetId.h:88
HFNoseTriggerDetId::kHFNoseWaferUMask
static const int kHFNoseWaferUMask
Definition: HFNoseTriggerDetId.h:98
HFNoseTriggerDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HFNoseTriggerDetId.h:50
HFNoseTriggerDetId::triggerCellU
int triggerCellU() const
get the cell #'s in u,v or in x,y
Definition: HFNoseTriggerDetId.h:60
HFNoseTriggerDetId::kHFNoseCellUMask
static const int kHFNoseCellUMask
Definition: HFNoseTriggerDetId.h:94
HFNoseTriggerDetId::subdet
HGCalTriggerSubdetector subdet() const
get the subdetector
Definition: HFNoseTriggerDetId.h:42
HGCalTriggerSubdetector
HGCalTriggerSubdetector
Definition: ForwardSubdetector.h:14
HFNoseTriggerDetId::waferUV
std::pair< int, int > waferUV() const
Definition: HFNoseTriggerDetId.h:76
HFNoseTriggerDetId::cellU
std::vector< int > cellU() const
Definition: HFNoseTriggerDetId.cc:73
HFNoseTriggerDetId::type
int type() const
get the type
Definition: HFNoseTriggerDetId.h:47
HFNoseDetId.h
HFNoseTriggerDetId::kHFNoseWaferUSignOffset
static const int kHFNoseWaferUSignOffset
Definition: HFNoseTriggerDetId.h:99
HFNoseTriggerDetId::waferXY
std::pair< int, int > waferXY() const
Definition: HFNoseTriggerDetId.h:79
operator<<
std::ostream & operator<<(std::ostream &, const HFNoseTriggerDetId &id)
Definition: HFNoseTriggerDetId.cc:141
HFNoseDetId
Definition: HFNoseDetId.h:22
HFNoseTriggerDetId
Definition: HFNoseTriggerDetId.h:26
HFNoseTriggerDetId::HFNoseTriggerDetId
HFNoseTriggerDetId()
Definition: HFNoseTriggerDetId.cc:9
ForwardSubdetector.h
HFNoseTriggerDetId::waferX
int waferX() const
Definition: HFNoseTriggerDetId.h:77
DetId
Definition: DetId.h:17
HFNoseTriggerDetId::moduleId
HFNoseDetId moduleId() const
Definition: HFNoseTriggerDetId.h:57
HFNoseTriggerDetId::kHFNoseCellUOffset
static const int kHFNoseCellUOffset
Definition: HFNoseTriggerDetId.h:93
HFNoseTriggerDetId::kHFNoseSubdetMask
static const int kHFNoseSubdetMask
Definition: HFNoseTriggerDetId.h:112
HFNoseTriggerDetId::kHFNoseZsideOffset
static const int kHFNoseZsideOffset
Definition: HFNoseTriggerDetId.h:109
HFNoseTriggerDetId::triggerCellV
int triggerCellV() const
Definition: HFNoseTriggerDetId.h:61
HFNoseTriggerDetId::waferY
int waferY() const
Definition: HFNoseTriggerDetId.h:78
HFNoseTriggerDetId::triggerCellXY
std::pair< int, int > triggerCellXY() const
Definition: HFNoseTriggerDetId.h:65
HFNoseTriggerDetId::waferU
int waferU() const
Definition: HFNoseTriggerDetId.h:70
HFNoseTriggerDetId::kHFNoseZsideMask
static const int kHFNoseZsideMask
Definition: HFNoseTriggerDetId.h:110
HFNoseTriggerDetId::kHFNoseSubdetOffset
static const int kHFNoseSubdetOffset
Definition: HFNoseTriggerDetId.h:111
HFNoseTriggerDetId::kHFNoseWaferVSignMask
static const int kHFNoseWaferVSignMask
Definition: HFNoseTriggerDetId.h:104
HFNoseTriggerDetId::kHFNoseWaferVOffset
static const int kHFNoseWaferVOffset
Definition: HFNoseTriggerDetId.h:101
HFNoseTriggerDetId::kHFNoseWaferUOffset
static const int kHFNoseWaferUOffset
Definition: HFNoseTriggerDetId.h:97
HFNoseTriggerDetId::kHFNoseCellVMask
static const int kHFNoseCellVMask
Definition: HFNoseTriggerDetId.h:96
HFNoseTriggerDetId::HFNoseTriggerCell
static const int HFNoseTriggerCell
Definition: HFNoseTriggerDetId.h:28
HFNoseTriggerDetId::kHFNoseTypeMask
static const int kHFNoseTypeMask
Definition: HFNoseTriggerDetId.h:108
DetId::id_
uint32_t id_
Definition: DetId.h:69
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
HFNoseTriggerDetId::kHFNoseTypeOffset
static const int kHFNoseTypeOffset
Definition: HFNoseTriggerDetId.h:107
HFNoseTriggerDetId::cellV
std::vector< int > cellV() const
Definition: HFNoseTriggerDetId.cc:102
HFNoseTriggerDetId::cellUV
std::vector< std::pair< int, int > > cellUV() const
Definition: HFNoseTriggerDetId.cc:131
HFNoseTriggerDetId::kHFNoseWaferVMask
static const int kHFNoseWaferVMask
Definition: HFNoseTriggerDetId.h:102
HFNoseTriggerDetId::Undefined
static const HFNoseTriggerDetId Undefined
Definition: HFNoseTriggerDetId.h:91
HFNoseTriggerDetId::kHFNoseMaxEELayer
static const int kHFNoseMaxEELayer
Definition: HFNoseTriggerDetId.h:113
HFNoseTriggerDetId::triggerCellX
int triggerCellX() const
Definition: HFNoseTriggerDetId.cc:50
HFNoseTriggerDetId::operator=
HFNoseTriggerDetId & operator=(const DetId &id)
Definition: HFNoseTriggerDetId.cc:39
DetId.h
HFNoseTriggerDetId::waferV
int waferV() const
Definition: HFNoseTriggerDetId.h:73
HFNoseTriggerDetId::waferVAbs
int waferVAbs() const
Definition: HFNoseTriggerDetId.h:69
HFNoseTriggerDetId::triggerCellY
int triggerCellY() const
Definition: HFNoseTriggerDetId.cc:61
HFNoseTriggerDetId::kHFNoseWaferVSignOffset
static const int kHFNoseWaferVSignOffset
Definition: HFNoseTriggerDetId.h:103
HFNoseTriggerDetId::layer
int layer() const
get the layer #
Definition: HFNoseTriggerDetId.h:53
HFNoseTriggerDetId::isForward
bool isForward() const
Definition: HFNoseTriggerDetId.h:89
HFNoseTriggerDetId::geometryCell
HFNoseDetId geometryCell() const
Definition: HFNoseTriggerDetId.h:56
HFNoseTriggerDetId::isEE
bool isEE() const
consistency check : no bits left => no overhead
Definition: HFNoseTriggerDetId.h:87
HFNoseTriggerDetId::kHFNoseLayerMask
static const int kHFNoseLayerMask
Definition: HFNoseTriggerDetId.h:106
HFNoseTriggerDetId::triggerCellUV
std::pair< int, int > triggerCellUV() const
Definition: HFNoseTriggerDetId.h:62