CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
HGCalTriggerSubdetector
bool isHSilicon() const
static const int kHFNoseWaferUOffset
static const int kHFNoseCellVMask
static const int kHFNoseWaferVSignOffset
std::pair< int, int > triggerCellUV() const
static const int kHFNoseTypeOffset
bool isEE() const
consistency check : no bits left =&gt; no overhead
std::vector< int > cellV() const
std::pair< int, int > waferUV() const
static const int kHFNoseWaferVOffset
std::pair< int, int > triggerCellXY() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
int triggerCellU() const
get the cell #&#39;s in u,v or in x,y
std::vector< std::pair< int, int > > cellUV() const
HGCalTriggerSubdetector subdet() const
get the subdetector
bool isForward() const
int type() const
get the type
static const int kHFNoseLayerOffset
static const int kHFNoseWaferUSignOffset
static const int kHFNoseMaxEELayer
int zside() const
get the z-side of the cell (1/-1)
static const int kHFNoseCellVOffset
HFNoseDetId moduleId() const
static const int kHFNoseSubdetMask
static const int kHFNoseCellUMask
int triggerCellV() const
Definition: DetId.h:17
std::vector< int > cellU() const
static const int kHFNoseWaferVSignMask
static const int HFNoseTriggerCell
uint32_t id_
Definition: DetId.h:69
std::pair< int, int > waferXY() const
int layer() const
get the layer #
static const int kHFNoseLayerMask
static const int kHFNoseWaferUSignMask
static const int kHFNoseZsideOffset
static const int kHFNoseWaferVMask
static const int kHFNoseWaferUMask
static const int kHFNoseZsideMask
HFNoseDetId geometryCell() const
static const HFNoseTriggerDetId Undefined
static const int kHFNoseCellUOffset
int waferUAbs() const
get the wafer #&#39;s in u,v or in x,y
HFNoseTriggerDetId & operator=(const DetId &id)
static const int kHFNoseSubdetOffset
static const int kHFNoseTypeMask