CMS 3D CMS Logo

TotemTimingDetId.cc
Go to the documentation of this file.
1 /****************************************************************************
2  * Author: Nicola Minafra
3  * March 2018
4  ****************************************************************************/
5 
8 
9 //----------------------------------------------------------------------------------------------------
10 
12  if (!check(id)) {
13  throw cms::Exception("InvalidDetId") << "TotemTimingDetId ctor:"
14  << " channel: " << channel() << " subdet: " << subdetId()
15  << " is not a valid Totem Timing id";
16  }
17 }
18 
19 //----------------------------------------------------------------------------------------------------
20 
21 TotemTimingDetId::TotemTimingDetId(uint32_t arm, uint32_t station, uint32_t romanPot, uint32_t plane, uint32_t channel)
22  : CTPPSDetId(sdTimingFastSilicon, arm, station, romanPot) {
23  if (arm > maxArm || station > maxStation || romanPot > maxRP || plane > maxPlane || channel > maxChannel) {
24  throw cms::Exception("InvalidDetId") << "TotemTimingDetId ctor:"
25  << " Invalid parameters:"
26  << " arm=" << arm << " station=" << station << " rp=" << romanPot
27  << " plane=" << plane << " detector=" << channel << std::endl;
28  }
29 
30  uint32_t ok = 0xfe000000;
31  id_ &= ok;
32 
33  id_ |= ((arm & maskArm) << startArmBit);
35  id_ |= ((romanPot & maskRP) << startRPBit);
36  id_ |= ((plane & maskPlane) << startPlaneBit);
37  id_ |= ((channel & maskChannel) << startDetBit);
38 }
39 
40 //----------------------------------------------------------------------------------------------------
41 
42 std::ostream& operator<<(std::ostream& os, const TotemTimingDetId& id) {
43  return os << "arm=" << id.arm() << " station=" << id.station() << " rp=" << id.rp() << " plane=" << id.plane()
44  << " Detector=" << id.channel();
45 }
TotemTimingDetId::channel
uint32_t channel() const
Definition: TotemTimingDetId.h:56
CTPPSDetId::maxRP
static const uint32_t maxRP
Definition: CTPPSDetId.h:51
TotemTimingDetId::startDetBit
static constexpr uint32_t startDetBit
Definition: TotemTimingDetId.h:40
TotemTimingDetId::maxChannel
static constexpr uint32_t maxChannel
Definition: TotemTimingDetId.h:40
relativeConstraints.station
station
Definition: relativeConstraints.py:67
TotemTimingDetId::TotemTimingDetId
TotemTimingDetId(uint32_t id)
Construct from a raw id.
Definition: TotemTimingDetId.cc:10
CTPPSDetId::maxArm
static const uint32_t maxArm
Definition: CTPPSDetId.h:49
TotemTimingDetId::check
static bool check(unsigned int raw)
returns true if the raw ID is a PPS-timing one
Definition: TotemTimingDetId.h:43
TotemTimingDetId::plane
uint32_t plane() const
Definition: TotemTimingDetId.h:49
CTPPSDetId::startArmBit
static const uint32_t startArmBit
Definition: CTPPSDetId.h:49
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
CTPPSDetId::station
uint32_t station() const
Definition: CTPPSDetId.h:62
CTPPSDetId::startStationBit
static const uint32_t startStationBit
Definition: CTPPSDetId.h:50
TotemTimingDetId.h
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
CTPPSDetId::arm
uint32_t arm() const
Definition: CTPPSDetId.h:55
TotemTimingDetId
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...
Definition: TotemTimingDetId.h:26
DetId::id_
uint32_t id_
Definition: DetId.h:69
CTPPSDetId
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:31
TotemTimingDetId::maskPlane
static constexpr uint32_t maskPlane
Definition: TotemTimingDetId.h:39
CTPPSDetId::maskStation
static const uint32_t maskStation
Definition: CTPPSDetId.h:50
CTPPSDetId::maxStation
static const uint32_t maxStation
Definition: CTPPSDetId.h:50
protons_cff.arm
arm
Definition: protons_cff.py:39
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
Exception.h
TotemTimingDetId::maxPlane
static constexpr uint32_t maxPlane
Definition: TotemTimingDetId.h:39
TotemTimingDetId::startPlaneBit
static constexpr uint32_t startPlaneBit
Definition: TotemTimingDetId.h:39
operator<<
std::ostream & operator<<(std::ostream &os, const TotemTimingDetId &id)
Definition: TotemTimingDetId.cc:41
TotemTimingDetId::maskChannel
static constexpr uint32_t maskChannel
Definition: TotemTimingDetId.h:40
CTPPSDetId::maskArm
static const uint32_t maskArm
Definition: CTPPSDetId.h:49
CTPPSDetId::maskRP
static const uint32_t maskRP
Definition: CTPPSDetId.h:51