CMS 3D CMS Logo

CTPPSPixelDetId.cc
Go to the documentation of this file.
1 /*
2  Author: F.Ferro INFN Genova
3  October 2016
4 */
5 
8 
9 // VeryForward =7, Tracker = 4
10 
12 
14  if (!check(id)) {
15  throw cms::Exception("InvalidDetId") << "CTPPSPixelDetId ctor:"
16  << " det: " << det() << " subdet: " << subdetId()
17  << " is not a valid CTPPS Pixel id";
18  }
19 }
20 
21 CTPPSPixelDetId::CTPPSPixelDetId(unsigned int Arm, unsigned int Station, unsigned int RP, unsigned int Plane)
22  : CTPPSDetId(sdTrackingPixel, Arm, Station, RP) {
23  this->init(Arm, Station, RP, Plane);
24 }
25 
26 void CTPPSPixelDetId::init(unsigned int Arm, unsigned int Station, unsigned int RP, unsigned int Plane) {
27  if (Arm > maxArm || Station > maxStation || RP > maxRP || Plane > maxPlane) {
28  throw cms::Exception("InvalidDetId") << "CTPPSPixelDetId ctor:"
29  << " Invalid parameterss: "
30  << " Arm " << Arm << " Station " << Station << " RP " << RP << " Plane "
31  << Plane << std::endl;
32  }
33 
34  uint32_t ok = 0xfe000000;
35  id_ &= ok;
36 
37  id_ |= ((Arm & maskArm) << startArmBit);
38  id_ |= ((Station & maskStation) << startStationBit);
39  id_ |= ((RP & maskRP) << startRPBit);
40  id_ |= ((Plane & maskPlane) << startPlaneBit);
41 }
42 
43 std::ostream& operator<<(std::ostream& os, const CTPPSPixelDetId& id) {
44  os << " Arm " << id.arm() << " Station " << id.station() << " RP " << id.rp() << " Plane " << id.plane();
45 
46  return os;
47 }
CTPPSDetId::maxRP
static const uint32_t maxRP
Definition: CTPPSDetId.h:51
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
CTPPSDetId::maxArm
static const uint32_t maxArm
Definition: CTPPSDetId.h:49
CTPPSPixelDetId.h
CTPPSPixelDetId::maskPlane
static const uint32_t maskPlane
Definition: CTPPSPixelDetId.h:30
CTPPSDetId::startArmBit
static const uint32_t startArmBit
Definition: CTPPSDetId.h:49
CTPPSPixelDetId::check
static bool check(unsigned int raw)
Definition: CTPPSPixelDetId.h:32
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
CTPPSPixelDetId::startPlaneBit
static const uint32_t startPlaneBit
Definition: CTPPSPixelDetId.h:30
CTPPSPixelDetId::maxPlane
static const uint32_t maxPlane
Definition: CTPPSPixelDetId.h:30
operator<<
std::ostream & operator<<(std::ostream &os, const CTPPSPixelDetId &id)
Definition: CTPPSPixelDetId.cc:43
CTPPSDetId::startStationBit
static const uint32_t startStationBit
Definition: CTPPSDetId.h:50
CTPPSPixelDetId::CTPPSPixelDetId
CTPPSPixelDetId(uint32_t id)
Construct from a packed id.
Definition: CTPPSPixelDetId.cc:13
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
CTPPSPixelDetId::init
void init(uint32_t Arm, uint32_t Station, uint32_t RP, uint32_t Plane)
Definition: CTPPSPixelDetId.cc:26
DetId::id_
uint32_t id_
Definition: DetId.h:69
CTPPSDetId
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:31
CTPPSPixelDetId
Definition: CTPPSPixelDetId.h:16
CTPPSDetId::maskStation
static const uint32_t maskStation
Definition: CTPPSDetId.h:50
CTPPSDetId::maxStation
static const uint32_t maxStation
Definition: CTPPSDetId.h:50
CTPPSDetId::startRPBit
static const uint32_t startRPBit
Definition: CTPPSDetId.h:51
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
Exception
Definition: hltDiff.cc:245
Plane
Definition: Plane.h:16
Exception.h
CTPPSDetId::maskArm
static const uint32_t maskArm
Definition: CTPPSDetId.h:49
CTPPSDetId::maskRP
static const uint32_t maskRP
Definition: CTPPSDetId.h:51