CMS 3D CMS Logo

CTPPSDiamondDetId.cc
Go to the documentation of this file.
1 /****************************************************************************
2  * Author: Seyed Mohsen Etesami
3  * Spetember 2016
4  ****************************************************************************/
5 
7 
9 
10 using namespace std;
11 
12 //----------------------------------------------------------------------------------------------------
13 
18 
19 //----------------------------------------------------------------------------------------------------
20 
22  if (!check(id)) {
23  throw cms::Exception("InvalidDetId") << "CTPPSDiamondDetId ctor:"
24  << " channel: " << channel() << " subdet: " << subdetId()
25  << " is not a valid CTPPS Timing Diamond id";
26  }
27 }
28 
29 //----------------------------------------------------------------------------------------------------
30 
31 CTPPSDiamondDetId::CTPPSDiamondDetId(uint32_t Arm, uint32_t Station, uint32_t RomanPot, uint32_t Plane, uint32_t Channel)
32  : CTPPSDetId(sdTimingDiamond, Arm, Station, RomanPot) {
33  if (Arm > maxArm || Station > maxStation || RomanPot > maxRP || Plane > maxPlane || Channel > maxChannel) {
34  throw cms::Exception("InvalidDetId") << "CTPPSDiamondDetId ctor:"
35  << " Invalid parameters:"
36  << " arm=" << Arm << " station=" << Station << " rp=" << RomanPot
37  << " plane=" << Plane << " detector=" << Channel << std::endl;
38  }
39 
40  uint32_t ok = 0xfe000000;
41  id_ &= ok;
42 
43  id_ |= ((Arm & maskArm) << startArmBit);
44  id_ |= ((Station & maskStation) << startStationBit);
45  id_ |= ((RomanPot & maskRP) << startRPBit);
46  id_ |= ((Plane & maskPlane) << startPlaneBit);
47  id_ |= ((Channel & maskChannel) << startDetBit);
48 }
49 
50 //----------------------------------------------------------------------------------------------------
51 
52 std::ostream& operator<<(std::ostream& os, const CTPPSDiamondDetId& id) {
53  os << "arm=" << id.arm() << " station=" << id.station() << " rp=" << id.rp() << " plane=" << id.plane()
54  << " Detector=" << id.channel();
55 
56  return os;
57 }
CTPPSDiamondDetId::startDetBit
static const uint32_t startDetBit
Definition: CTPPSDiamondDetId.h:37
operator<<
std::ostream & operator<<(std::ostream &os, const CTPPSDiamondDetId &id)
Definition: CTPPSDiamondDetId.cc:51
dqm::me_util::Channel
DQMChannel Channel
Definition: MonitorElement.h:58
CTPPSDetId::maxRP
static const uint32_t maxRP
Definition: CTPPSDetId.h:51
CTPPSDiamondDetId::lowMaskChannel
static const uint32_t lowMaskChannel
Definition: CTPPSDiamondDetId.h:37
CTPPSDiamondDetId::maskChannel
static const uint32_t maskChannel
Definition: CTPPSDiamondDetId.h:37
CTPPSDiamondDetId::maxChannel
static const uint32_t maxChannel
Definition: CTPPSDiamondDetId.h:37
CTPPSDetId::maxArm
static const uint32_t maxArm
Definition: CTPPSDetId.h:49
CTPPSDiamondDetId::CTPPSDiamondDetId
CTPPSDiamondDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDiamondDetId.cc:20
CTPPSDetId::startArmBit
static const uint32_t startArmBit
Definition: CTPPSDetId.h:49
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
CTPPSDetId::startStationBit
static const uint32_t startStationBit
Definition: CTPPSDetId.h:50
CTPPSDiamondDetId::channel
uint32_t channel() const
Definition: CTPPSDiamondDetId.h:53
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
CTPPSDiamondDetId.h
CTPPSDiamondDetId
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
Definition: CTPPSDiamondDetId.h:24
DetId::id_
uint32_t id_
Definition: DetId.h:69
CTPPSDetId
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:31
CTPPSDiamondDetId::lowMaskPlane
static const uint32_t lowMaskPlane
Definition: CTPPSDiamondDetId.h:36
CTPPSDiamondDetId::check
static bool check(unsigned int raw)
returns true if the raw ID is a PPS-timing one
Definition: CTPPSDiamondDetId.h:40
CTPPSDiamondDetId::maxPlane
static const uint32_t maxPlane
Definition: CTPPSDiamondDetId.h:36
CTPPSDiamondDetId::startPlaneBit
static const uint32_t startPlaneBit
Definition: CTPPSDiamondDetId.h:36
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
std
Definition: JetResolutionObject.h:76
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
Exception
Definition: hltDiff.cc:245
Plane
Definition: Plane.h:16
Exception.h
CTPPSDiamondDetId::maskPlane
static const uint32_t maskPlane
Definition: CTPPSDiamondDetId.h:36
CTPPSDetId::maskArm
static const uint32_t maskArm
Definition: CTPPSDetId.h:49
CTPPSDetId::maskRP
static const uint32_t maskRP
Definition: CTPPSDetId.h:51