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
CTPPSPixelDetId::set
void set(uint32_t a, uint32_t b, uint32_t c, uint32_t d)
Definition: CTPPSPixelDetId.h:39
CTPPSPixelDetId::CTPPSPixelDetId
CTPPSPixelDetId(const CTPPSDetId &id)
Definition: CTPPSPixelDetId.h:21
CTPPSPixelDetId::maskPlane
static const uint32_t maskPlane
Definition: CTPPSPixelDetId.h:30
operator<<
std::ostream & operator<<(std::ostream &os, const CTPPSPixelDetId &id)
Definition: CTPPSPixelDetId.cc:43
DetId::VeryForward
Definition: DetId.h:31
CTPPSPixelDetId::check
static bool check(unsigned int raw)
Definition: CTPPSPixelDetId.h:32
CTPPSPixelDetId::startPlaneBit
static const uint32_t startPlaneBit
Definition: CTPPSPixelDetId.h:30
CTPPSPixelDetId::maxPlane
static const uint32_t maxPlane
Definition: CTPPSPixelDetId.h:30
DetId::kSubdetOffset
static const int kSubdetOffset
Definition: DetId.h:22
CTPPSPixelDetId::CTPPSPixelDetId
CTPPSPixelDetId(uint32_t id)
Construct from a packed id.
Definition: CTPPSPixelDetId.cc:13
CTPPSDetId::sdTrackingPixel
Definition: CTPPSDetId.h:44
b
double b
Definition: hdecay.h:118
CTPPSPixelDetId::setPlane
void setPlane(uint32_t pl)
Definition: CTPPSPixelDetId.h:41
CTPPSPixelDetId::init
void init(uint32_t Arm, uint32_t Station, uint32_t RP, uint32_t Plane)
Definition: CTPPSPixelDetId.cc:26
a
double a
Definition: hdecay.h:119
DetId::id_
uint32_t id_
Definition: DetId.h:69
CTPPSDetId
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:31
createfilelist.int
int
Definition: createfilelist.py:10
CTPPSPixelDetId::plane
uint32_t plane() const
Definition: CTPPSPixelDetId.h:37
CTPPSPixelDetId
Definition: CTPPSPixelDetId.h:16
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
DetId::kDetOffset
static const int kDetOffset
Definition: DetId.h:21
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Plane
Definition: Plane.h:16
CTPPSDetId.h
Exception.h
ztail.d
d
Definition: ztail.py:151