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 
17 class CTPPSPixelDetId :public CTPPSDetId {
18 
19 public:
20 
22  explicit CTPPSPixelDetId(uint32_t id);
23 
25  {
26  }
28  CTPPSPixelDetId(uint32_t Arm, uint32_t Station, uint32_t RP=0, uint32_t Plane=0);
29 
34 
35  static const uint32_t startPlaneBit, maskPlane, maxPlane;
36 
37  static bool check(unsigned int raw)
38  {
39  return (((raw >>DetId::kDetOffset) & 0xF) == DetId::VeryForward &&
40  ((raw >> DetId::kSubdetOffset) & 0x7) == sdTrackingPixel);
41  }
42 
43  uint32_t plane() const{
44  return int((id_>>startPlaneBit) & maskPlane);
45  }
46 
47  void set(uint32_t a, uint32_t b, uint32_t c,uint32_t d ){
48  this->init(a,b,c,d);
49  }
50 
51  void setPlane(uint32_t pl)
52  {
53  id_ &= ~(maskPlane << startPlaneBit);
54  id_ |= ((pl & maskPlane) << startPlaneBit);
55  }
56 
57 
58 private:
59  void init(uint32_t Arm, uint32_t Station,uint32_t RP, uint32_t Plane);
60 
61 
62 }; // CTPPSPixelDetId
63 
64 std::ostream& operator<<( std::ostream& os, const CTPPSPixelDetId& id );
65 
66 #endif
67 
68 
uint32_t plane() const
static bool check(unsigned int raw)
static const uint32_t maskPlane
static const int kSubdetOffset
Definition: DetId.h:21
Definition: Plane.h:17
static const uint32_t maxPlane
static const uint32_t startPlaneBit
void setPlane(uint32_t pl)
CTPPSPixelDetId(const CTPPSDetId &id)
uint32_t id_
Definition: DetId.h:55
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:20
double a
Definition: hdecay.h:121
std::ostream & operator<<(std::ostream &os, const CTPPSPixelDetId &id)
CTPPSPixelDetId(uint32_t id)
Construct from a packed id.