CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
TotemTimingDetId Class Reference

Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits [17:18] : 2 bits for UFSD plane 0,1,2,3 Bits [12:16] : 5 bits for UFSD channel numbers 1,2,3,..16 Bits [0:11] : unspecified yet. More...

#include <TotemTimingDetId.h>

Inheritance diagram for TotemTimingDetId:
CTPPSDetId DetId

Public Types

enum  { ID_NOT_SET = 28 }
 
- Public Types inherited from CTPPSDetId
enum  NameFlag { nShort, nFull, nPath }
 type of name returned by *Name functions More...
 
enum  SubDetector {
  sdTrackingStrip = 3, sdTrackingPixel = 4, sdTimingDiamond = 5, sdTimingFastSilicon = 6,
  sdTotemT2 = 7
}
 CTPPS sub-detectors. More...
 
- Public Types inherited from DetId
enum  Detector {
  Tracker = 1, Muon = 2, Ecal = 3, Hcal = 4,
  Calo = 5, Forward = 6, VeryForward = 7, HGCalEE = 8,
  HGCalHSi = 9, HGCalHSc = 10, HGCalTrigger = 11
}
 

Public Member Functions

uint32_t channel () const
 
void channelName (std::string &name, NameFlag flag=nFull) const
 
uint32_t plane () const
 
TotemTimingDetId planeId () const
 
void planeName (std::string &name, NameFlag flag=nFull) const
 
void setChannel (uint32_t channel)
 
void setPlane (uint32_t channel)
 
 TotemTimingDetId (uint32_t id)
 Construct from a raw id. More...
 
 TotemTimingDetId (const CTPPSDetId &id)
 
 TotemTimingDetId (uint32_t arm, uint32_t station, uint32_t romanPot=0, uint32_t plane=0, uint32_t channel=0, uint32_t subdet=sdTimingFastSilicon)
 Construct from hierarchy indices. More...
 
- Public Member Functions inherited from CTPPSDetId
uint32_t arm () const
 
CTPPSDetId armId () const
 
void armName (std::string &name, NameFlag flag=nFull) const
 
 CTPPSDetId (uint32_t id)
 Construct from a raw id. More...
 
 CTPPSDetId (uint32_t SubDet, uint32_t Arm, uint32_t Station, uint32_t RomanPot=0)
 Construct from hierarchy indeces. More...
 
uint32_t rp () const
 
CTPPSDetId rpId () const
 
void rpName (std::string &name, NameFlag flag=nFull) const
 
void setArm (uint32_t arm)
 
void setRP (uint32_t rp)
 
void setStation (uint32_t station)
 
uint32_t station () const
 
CTPPSDetId stationId () const
 
void stationName (std::string &name, NameFlag flag=nFull) const
 
void subDetectorName (std::string &name, NameFlag flag=nFull) const
 
- Public Member Functions inherited from DetId
constexpr Detector det () const
 get the detector field from this detid More...
 
constexpr DetId ()
 Create an empty or null id (also for persistence) More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. More...
 
constexpr DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr bool null () const
 is this a null id ? More...
 
constexpr operator uint32_t () const
 
constexpr bool operator!= (DetId id) const
 inequality More...
 
constexpr uint32_t operator() () const
 
constexpr bool operator< (DetId id) const
 comparison More...
 
constexpr bool operator== (DetId id) const
 equality More...
 
constexpr uint32_t rawId () const
 get the raw id More...
 
constexpr int subdetId () const
 get the contents of the subdetector field (not cast into any detector's numbering enum) More...
 

Static Public Member Functions

static bool check (unsigned int raw)
 returns true if the raw ID is a PPS-timing one More...
 

Static Public Attributes

static constexpr uint32_t lowMaskChannel = 0xFFF
 
static constexpr uint32_t lowMaskPlane = 0x1FFFF
 
static constexpr uint32_t maskChannel = 0x1F
 
static constexpr uint32_t maskPlane = 0x3
 
static constexpr uint32_t maxChannel = 31
 
static constexpr uint32_t maxPlane = 3
 
static constexpr uint32_t startDetBit = 12
 
static constexpr uint32_t startPlaneBit = 17
 
- Static Public Attributes inherited from CTPPSDetId
static const uint32_t lowMaskArm = 0xFFFFFF
 
static const uint32_t lowMaskRP = 0x7FFFF
 
static const uint32_t lowMaskStation = 0x3FFFFF
 
static const uint32_t maskArm = 0x1
 
static const uint32_t maskRP = 0x7
 
static const uint32_t maskStation = 0x3
 
static const uint32_t maxArm = 1
 
static const uint32_t maxRP = 6
 
static const uint32_t maxStation = 2
 
static const uint32_t startArmBit = 24
 
static const uint32_t startRPBit = 19
 
static const uint32_t startStationBit = 22
 
- Static Public Attributes inherited from DetId
static const int kDetMask = 0xF
 
static const int kDetOffset = 28
 
static const int kSubdetMask = 0x7
 
static const int kSubdetOffset = 25
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits [17:18] : 2 bits for UFSD plane 0,1,2,3 Bits [12:16] : 5 bits for UFSD channel numbers 1,2,3,..16 Bits [0:11] : unspecified yet.

This class is very similar to CTPPSDiamondDetId; however the detector is completely separated, therefore it is useful to keep them separate and independent.

Definition at line 27 of file TotemTimingDetId.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ID_NOT_SET 

Definition at line 29 of file TotemTimingDetId.h.

Constructor & Destructor Documentation

◆ TotemTimingDetId() [1/3]

TotemTimingDetId::TotemTimingDetId ( uint32_t  id)
explicit

Construct from a raw id.

Definition at line 11 of file TotemTimingDetId.cc.

References channel(), check(), Exception, and DetId::subdetId().

Referenced by planeId().

11  : CTPPSDetId(id) {
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 }
uint32_t channel() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static bool check(unsigned int raw)
returns true if the raw ID is a PPS-timing one
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:41

◆ TotemTimingDetId() [2/3]

TotemTimingDetId::TotemTimingDetId ( const CTPPSDetId id)
inline

Definition at line 33 of file TotemTimingDetId.h.

33 : CTPPSDetId(id) {}
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:41

◆ TotemTimingDetId() [3/3]

TotemTimingDetId::TotemTimingDetId ( uint32_t  arm,
uint32_t  station,
uint32_t  romanPot = 0,
uint32_t  plane = 0,
uint32_t  channel = 0,
uint32_t  subdet = sdTimingFastSilicon 
)

Construct from hierarchy indices.

Definition at line 21 of file TotemTimingDetId.cc.

References CTPPSDetId::arm(), channel(), Exception, DetId::id_, CTPPSDetId::maskArm, maskChannel, maskPlane, CTPPSDetId::maskRP, CTPPSDetId::maskStation, CTPPSDetId::maxArm, maxChannel, maxPlane, CTPPSDetId::maxRP, CTPPSDetId::maxStation, convertSQLiteXML::ok, plane(), CTPPSDetId::startArmBit, startDetBit, startPlaneBit, CTPPSDetId::startRPBit, CTPPSDetId::startStationBit, and CTPPSDetId::station().

23  : CTPPSDetId(subdet, arm, station, romanPot) {
24  if (arm > maxArm || station > maxStation || romanPot > maxRP || plane > maxPlane || channel > maxChannel) {
25  throw cms::Exception("InvalidDetId") << "TotemTimingDetId ctor:"
26  << " Invalid parameters:"
27  << " arm=" << arm << " station=" << station << " rp=" << romanPot
28  << " plane=" << plane << " detector=" << channel << std::endl;
29  }
30 
31  uint32_t ok = 0xfe000000;
32  id_ &= ok;
33 
34  id_ |= ((arm & maskArm) << startArmBit);
36  id_ |= ((romanPot & maskRP) << startRPBit);
37  id_ |= ((plane & maskPlane) << startPlaneBit);
38  id_ |= ((channel & maskChannel) << startDetBit);
39 }
static const uint32_t maxStation
Definition: CTPPSDetId.h:52
uint32_t arm() const
Definition: CTPPSDetId.h:57
static constexpr uint32_t maskPlane
static const uint32_t startRPBit
Definition: CTPPSDetId.h:53
static const uint32_t maskStation
Definition: CTPPSDetId.h:52
static const uint32_t maskRP
Definition: CTPPSDetId.h:53
static constexpr uint32_t maskChannel
static const uint32_t maskArm
Definition: CTPPSDetId.h:51
static constexpr uint32_t startDetBit
uint32_t channel() const
static constexpr uint32_t maxPlane
static const uint32_t maxArm
Definition: CTPPSDetId.h:51
static constexpr uint32_t maxChannel
static constexpr uint32_t startPlaneBit
static const uint32_t maxRP
Definition: CTPPSDetId.h:53
uint32_t id_
Definition: DetId.h:69
uint32_t station() const
Definition: CTPPSDetId.h:64
static const uint32_t startStationBit
Definition: CTPPSDetId.h:52
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:41
uint32_t plane() const
static const uint32_t startArmBit
Definition: CTPPSDetId.h:51

Member Function Documentation

◆ channel()

uint32_t TotemTimingDetId::channel ( ) const
inline

Definition at line 61 of file TotemTimingDetId.h.

References DetId::id_, maskChannel, and startDetBit.

Referenced by channelName(), CTPPSGeometryInfo::formatDetId(), TotemTimingDQMSource::globalEndLuminosityBlock(), setChannel(), setPlane(), and TotemTimingDetId().

61 { return ((id_ >> startDetBit) & maskChannel); }
static constexpr uint32_t maskChannel
static constexpr uint32_t startDetBit
uint32_t id_
Definition: DetId.h:69

◆ channelName()

void TotemTimingDetId::channelName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 91 of file TotemTimingDetId.h.

References channel(), RemoveAddSevLevel::flag, Skims_PA_cff::name, CTPPSDetId::nFull, CTPPSDetId::nPath, CTPPSDetId::nShort, planeName(), and to_string().

Referenced by TotemTimingDQMSource::ChannelPlots::ChannelPlots().

91  {
92  switch (flag) {
93  case nShort:
94  name = "";
95  break;
96  case nFull:
98  name += "_";
99  break;
100  case nPath:
101  planeName(name, flag);
102  name += "/channel ";
103  break;
104  }
106  }
static std::string to_string(const XMLCh *ch)
void planeName(std::string &name, NameFlag flag=nFull) const
uint32_t channel() const

◆ check()

static bool TotemTimingDetId::check ( unsigned int  raw)
inlinestatic

returns true if the raw ID is a PPS-timing one

Definition at line 47 of file TotemTimingDetId.h.

References DetId::kDetOffset, DetId::kSubdetOffset, CTPPSDetId::sdTimingDiamond, CTPPSDetId::sdTimingFastSilicon, and DetId::VeryForward.

Referenced by TotemTimingDetId().

47  {
48  return (((raw >> DetId::kDetOffset) & 0xF) == DetId::VeryForward &&
49  (((raw >> DetId::kSubdetOffset) & 0x7) == sdTimingFastSilicon ||
50  ((raw >> DetId::kSubdetOffset) & 0x7) == sdTimingDiamond));
51  }
static const int kSubdetOffset
Definition: DetId.h:22
static const int kDetOffset
Definition: DetId.h:21

◆ plane()

uint32_t TotemTimingDetId::plane ( ) const
inline

Definition at line 54 of file TotemTimingDetId.h.

References DetId::id_, maskPlane, and startPlaneBit.

Referenced by CTPPSGeometryInfo::formatDetId(), TotemTimingDQMSource::globalEndLuminosityBlock(), planeName(), and TotemTimingDetId().

54 { return ((id_ >> startPlaneBit) & maskPlane); }
static constexpr uint32_t maskPlane
static constexpr uint32_t startPlaneBit
uint32_t id_
Definition: DetId.h:69

◆ planeId()

TotemTimingDetId TotemTimingDetId::planeId ( ) const
inline

Definition at line 70 of file TotemTimingDetId.h.

References lowMaskPlane, DetId::rawId(), and TotemTimingDetId().

70 { return TotemTimingDetId(rawId() & (~lowMaskPlane)); }
static constexpr uint32_t lowMaskPlane
TotemTimingDetId(uint32_t id)
Construct from a raw id.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ planeName()

void TotemTimingDetId::planeName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 74 of file TotemTimingDetId.h.

References RemoveAddSevLevel::flag, Skims_PA_cff::name, CTPPSDetId::nFull, CTPPSDetId::nPath, CTPPSDetId::nShort, plane(), CTPPSDetId::rpName(), and to_string().

Referenced by channelName(), and TotemTimingDQMSource::PlanePlots::PlanePlots().

74  {
75  switch (flag) {
76  case nShort:
77  name = "";
78  break;
79  case nFull:
80  rpName(name, flag);
81  name += "_";
82  break;
83  case nPath:
84  rpName(name, flag);
85  name += "/plane ";
86  break;
87  }
89  }
static std::string to_string(const XMLCh *ch)
void rpName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:134
uint32_t plane() const

◆ setChannel()

void TotemTimingDetId::setChannel ( uint32_t  channel)
inline

Definition at line 63 of file TotemTimingDetId.h.

References channel(), DetId::id_, maskChannel, and startDetBit.

Referenced by TotemTimingDQMSource::analyze().

63  {
64  id_ &= ~(maskChannel << startDetBit);
65  id_ |= ((channel & maskChannel) << startDetBit);
66  }
static constexpr uint32_t maskChannel
static constexpr uint32_t startDetBit
uint32_t channel() const
uint32_t id_
Definition: DetId.h:69

◆ setPlane()

void TotemTimingDetId::setPlane ( uint32_t  channel)
inline

Definition at line 56 of file TotemTimingDetId.h.

References channel(), DetId::id_, maskPlane, and startPlaneBit.

Referenced by TotemTimingDQMSource::analyze().

56  {
57  id_ &= ~(maskPlane << startPlaneBit);
58  id_ |= ((channel & maskPlane) << startPlaneBit);
59  }
static constexpr uint32_t maskPlane
uint32_t channel() const
static constexpr uint32_t startPlaneBit
uint32_t id_
Definition: DetId.h:69

Member Data Documentation

◆ lowMaskChannel

constexpr uint32_t TotemTimingDetId::lowMaskChannel = 0xFFF
static

Definition at line 44 of file TotemTimingDetId.h.

◆ lowMaskPlane

constexpr uint32_t TotemTimingDetId::lowMaskPlane = 0x1FFFF
static

Definition at line 43 of file TotemTimingDetId.h.

Referenced by planeId().

◆ maskChannel

constexpr uint32_t TotemTimingDetId::maskChannel = 0x1F
static

Definition at line 44 of file TotemTimingDetId.h.

Referenced by channel(), setChannel(), and TotemTimingDetId().

◆ maskPlane

constexpr uint32_t TotemTimingDetId::maskPlane = 0x3
static

Definition at line 43 of file TotemTimingDetId.h.

Referenced by plane(), setPlane(), and TotemTimingDetId().

◆ maxChannel

constexpr uint32_t TotemTimingDetId::maxChannel = 31
static

Definition at line 44 of file TotemTimingDetId.h.

Referenced by TotemTimingDetId().

◆ maxPlane

constexpr uint32_t TotemTimingDetId::maxPlane = 3
static

Definition at line 43 of file TotemTimingDetId.h.

Referenced by TotemTimingDetId().

◆ startDetBit

constexpr uint32_t TotemTimingDetId::startDetBit = 12
static

Definition at line 44 of file TotemTimingDetId.h.

Referenced by channel(), setChannel(), and TotemTimingDetId().

◆ startPlaneBit

constexpr uint32_t TotemTimingDetId::startPlaneBit = 17
static

Definition at line 43 of file TotemTimingDetId.h.

Referenced by plane(), setPlane(), and TotemTimingDetId().