CMS 3D CMS Logo

CTPPSPixelDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_CTPPSPixelDetId_h
2 #define DataFormats_CTPPSPixelDetId_h
3 
4 /*
5  Author: F.Ferro INFN Genova
6  October 2016
7 
8 */
9 
12 
13 #include <iosfwd>
14 #include <iostream>
15 
16 class CTPPSPixelDetId : public CTPPSDetId {
17 public:
19  explicit CTPPSPixelDetId(uint32_t id);
20 
23  CTPPSPixelDetId(uint32_t Arm, uint32_t Station, uint32_t RP = 0, uint32_t Plane = 0);
24 
29 
30  static const uint32_t startPlaneBit, maskPlane, maxPlane;
31 
32  static bool check(unsigned int raw) {
33  return (((raw >> DetId::kDetOffset) & 0xF) == DetId::VeryForward &&
34  ((raw >> DetId::kSubdetOffset) & 0x7) == sdTrackingPixel);
35  }
36 
37  uint32_t plane() const { return int((id_ >> startPlaneBit) & maskPlane); }
38 
39  void set(uint32_t a, uint32_t b, uint32_t c, uint32_t d) { this->init(a, b, c, d); }
40 
41  void setPlane(uint32_t pl) {
42  id_ &= ~(maskPlane << startPlaneBit);
43  id_ |= ((pl & maskPlane) << startPlaneBit);
44  }
45 
46 private:
47  void init(uint32_t Arm, uint32_t Station, uint32_t RP, uint32_t Plane);
48 
49 }; // CTPPSPixelDetId
50 
51 std::ostream& operator<<(std::ostream& os, const CTPPSPixelDetId& id);
52 
53 #endif
static bool check(unsigned int raw)
static const uint32_t maskPlane
static const int kSubdetOffset
Definition: DetId.h:22
Definition: Plane.h:16
static const uint32_t maxPlane
static const uint32_t startPlaneBit
uint32_t plane() const
d
Definition: ztail.py:151
void setPlane(uint32_t pl)
CTPPSPixelDetId(const CTPPSDetId &id)
uint32_t id_
Definition: DetId.h:69
double b
Definition: hdecay.h:120
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
void init(uint32_t Arm, uint32_t Station, uint32_t RP, uint32_t Plane)
static const int kDetOffset
Definition: DetId.h:21
double a
Definition: hdecay.h:121
std::ostream & operator<<(std::ostream &os, const CTPPSPixelDetId &id)
CTPPSPixelDetId(uint32_t id)
Construct from a packed id.