CMS 3D CMS Logo

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

Detector ID class for Totem T2 detectors. Bits [19:31] : Base CTPPSDetId class attributes Bits [16:18] : 3 bits for T2 plane [0-7] Bits [14:15] : 2 bits for T2 tile numbers [0-3] Bits [0:13] : unspecified yet. More...

#include <TotemT2DetId.h>

Inheritance diagram for TotemT2DetId:
CTPPSDetId DetId

Public Member Functions

uint32_t channel () const
 
void channelName (std::string &name, NameFlag flag=nFull) const
 
uint32_t plane () const
 
TotemT2DetId planeId () const
 
void planeName (std::string &name, NameFlag flag=nFull) const
 
void setChannel (uint32_t channel)
 
void setPlane (uint32_t channel)
 
 TotemT2DetId (uint32_t id)
 Construct from a raw id. More...
 
 TotemT2DetId (const CTPPSDetId &id)
 
 TotemT2DetId (uint32_t arm, uint32_t plane, uint32_t channel=0)
 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 = 0x1fff
 
static constexpr uint32_t lowMaskPlane = 0xffff
 
static constexpr uint32_t maskChannel = 0x3
 
static constexpr uint32_t maskPlane = 0x7
 
static constexpr uint32_t maxChannel = 3
 
static constexpr uint32_t maxPlane = 7
 
static constexpr uint32_t startChannelBit = 14
 
static constexpr uint32_t startPlaneBit = 16
 
- 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

- 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
}
 
- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Detector ID class for Totem T2 detectors. Bits [19:31] : Base CTPPSDetId class attributes Bits [16:18] : 3 bits for T2 plane [0-7] Bits [14:15] : 2 bits for T2 tile numbers [0-3] Bits [0:13] : unspecified yet.

Definition at line 25 of file TotemT2DetId.h.

Constructor & Destructor Documentation

◆ TotemT2DetId() [1/3]

TotemT2DetId::TotemT2DetId ( uint32_t  id)
explicit

Construct from a raw id.

Definition at line 14 of file TotemT2DetId.cc.

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

Referenced by planeId().

14  : CTPPSDetId(id) {
15  if (!check(id))
16  throw cms::Exception("InvalidDetId") << "TotemT2DetId ctor:"
17  << " channel: " << channel() << " subdet: " << subdetId()
18  << " is not a valid Totem nT2 id";
19 }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:41
static bool check(unsigned int raw)
returns true if the raw ID is a PPS-timing one
Definition: TotemT2DetId.h:38
uint32_t channel() const
Definition: TotemT2DetId.h:51

◆ TotemT2DetId() [2/3]

TotemT2DetId::TotemT2DetId ( const CTPPSDetId id)
inline

Definition at line 29 of file TotemT2DetId.h.

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

◆ TotemT2DetId() [3/3]

TotemT2DetId::TotemT2DetId ( uint32_t  arm,
uint32_t  plane,
uint32_t  channel = 0 
)

Construct from hierarchy indices.

Definition at line 23 of file TotemT2DetId.cc.

References CTPPSDetId::arm(), channel(), Exception, DetId::id_, CTPPSDetId::maskArm, maskChannel, maskPlane, CTPPSDetId::maxArm, maxChannel, maxPlane, convertSQLiteXML::ok, plane(), CTPPSDetId::startArmBit, startChannelBit, and startPlaneBit.

23  : CTPPSDetId(sdTotemT2, arm, 0, 0) {
24  if (arm > maxArm || plane > maxPlane || channel > maxChannel)
25  throw cms::Exception("InvalidDetId") << "TotemT2DetId ctor:"
26  << " Invalid parameters:"
27  << " arm=" << arm << " plane=" << plane << " detector=" << channel;
28 
29  uint32_t ok = 0xfe000000;
30  id_ &= ok;
31 
32  id_ |= ((arm & maskArm) << startArmBit);
33  id_ |= ((plane & maskPlane) << startPlaneBit);
35 }
uint32_t arm() const
Definition: CTPPSDetId.h:57
static constexpr uint32_t startChannelBit
Definition: TotemT2DetId.h:35
static constexpr uint32_t maxChannel
Definition: TotemT2DetId.h:35
static constexpr uint32_t maskChannel
Definition: TotemT2DetId.h:35
static constexpr uint32_t maxPlane
Definition: TotemT2DetId.h:34
uint32_t plane() const
Definition: TotemT2DetId.h:44
static const uint32_t maskArm
Definition: CTPPSDetId.h:51
static const uint32_t maxArm
Definition: CTPPSDetId.h:51
static constexpr uint32_t maskPlane
Definition: TotemT2DetId.h:34
uint32_t id_
Definition: DetId.h:69
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:41
static const uint32_t startArmBit
Definition: CTPPSDetId.h:51
static constexpr uint32_t startPlaneBit
Definition: TotemT2DetId.h:34
uint32_t channel() const
Definition: TotemT2DetId.h:51

Member Function Documentation

◆ channel()

uint32_t TotemT2DetId::channel ( ) const
inline

Definition at line 51 of file TotemT2DetId.h.

References DetId::id_, maskChannel, and startChannelBit.

Referenced by channelName(), setChannel(), setPlane(), and TotemT2DetId().

51 { return ((id_ >> startChannelBit) & maskChannel); }
static constexpr uint32_t startChannelBit
Definition: TotemT2DetId.h:35
static constexpr uint32_t maskChannel
Definition: TotemT2DetId.h:35
uint32_t id_
Definition: DetId.h:69

◆ channelName()

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

Definition at line 58 of file TotemT2DetId.cc.

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

Referenced by TotemT2DQMSource::ChannelPlots::ChannelPlots().

58  {
59  switch (flag) {
60  case nShort:
61  name = "";
62  break;
63  case nFull:
65  name += "_";
66  break;
67  case nPath:
69  name += "/channel ";
70  break;
71  }
73 }
static std::string to_string(const XMLCh *ch)
void planeName(std::string &name, NameFlag flag=nFull) const
Definition: TotemT2DetId.cc:39
uint32_t channel() const
Definition: TotemT2DetId.h:51

◆ check()

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

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

Definition at line 38 of file TotemT2DetId.h.

References DetId::kDetOffset, DetId::kSubdetOffset, CTPPSDetId::sdTotemT2, and DetId::VeryForward.

Referenced by TotemT2DetId().

38  {
39  return (((raw >> DetId::kDetOffset) & 0xF) == DetId::VeryForward &&
40  ((raw >> DetId::kSubdetOffset) & 0x7) == sdTotemT2);
41  }
static const int kSubdetOffset
Definition: DetId.h:22
static const int kDetOffset
Definition: DetId.h:21

◆ plane()

uint32_t TotemT2DetId::plane ( ) const
inline

Definition at line 44 of file TotemT2DetId.h.

References DetId::id_, maskPlane, and startPlaneBit.

Referenced by planeName(), and TotemT2DetId().

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

◆ planeId()

TotemT2DetId TotemT2DetId::planeId ( ) const
inline

Definition at line 60 of file TotemT2DetId.h.

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

60 { return TotemT2DetId(rawId() & (~lowMaskPlane)); }
static constexpr uint32_t lowMaskPlane
Definition: TotemT2DetId.h:34
TotemT2DetId(uint32_t id)
Construct from a raw id.
Definition: TotemT2DetId.cc:14
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ planeName()

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

Definition at line 39 of file TotemT2DetId.cc.

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

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

39  {
40  switch (flag) {
41  case nShort:
42  name = "";
43  break;
44  case nFull:
45  armName(name, flag);
46  name += "_";
47  break;
48  case nPath:
49  armName(name, flag);
50  name += "/plane ";
51  break;
52  }
54 }
static std::string to_string(const XMLCh *ch)
uint32_t plane() const
Definition: TotemT2DetId.h:44
void armName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:98

◆ setChannel()

void TotemT2DetId::setChannel ( uint32_t  channel)
inline

Definition at line 53 of file TotemT2DetId.h.

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

53  {
56  }
static constexpr uint32_t startChannelBit
Definition: TotemT2DetId.h:35
static constexpr uint32_t maskChannel
Definition: TotemT2DetId.h:35
uint32_t id_
Definition: DetId.h:69
uint32_t channel() const
Definition: TotemT2DetId.h:51

◆ setPlane()

void TotemT2DetId::setPlane ( uint32_t  channel)
inline

Definition at line 46 of file TotemT2DetId.h.

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

46  {
47  id_ &= ~(maskPlane << startPlaneBit);
48  id_ |= ((channel & maskPlane) << startPlaneBit);
49  }
static constexpr uint32_t maskPlane
Definition: TotemT2DetId.h:34
uint32_t id_
Definition: DetId.h:69
static constexpr uint32_t startPlaneBit
Definition: TotemT2DetId.h:34
uint32_t channel() const
Definition: TotemT2DetId.h:51

Member Data Documentation

◆ lowMaskChannel

constexpr uint32_t TotemT2DetId::lowMaskChannel = 0x1fff
static

Definition at line 35 of file TotemT2DetId.h.

◆ lowMaskPlane

constexpr uint32_t TotemT2DetId::lowMaskPlane = 0xffff
static

Definition at line 34 of file TotemT2DetId.h.

Referenced by planeId().

◆ maskChannel

constexpr uint32_t TotemT2DetId::maskChannel = 0x3
static

Definition at line 35 of file TotemT2DetId.h.

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

◆ maskPlane

constexpr uint32_t TotemT2DetId::maskPlane = 0x7
static

Definition at line 34 of file TotemT2DetId.h.

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

◆ maxChannel

constexpr uint32_t TotemT2DetId::maxChannel = 3
static

◆ maxPlane

constexpr uint32_t TotemT2DetId::maxPlane = 7
static

◆ startChannelBit

constexpr uint32_t TotemT2DetId::startChannelBit = 14
static

Definition at line 35 of file TotemT2DetId.h.

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

◆ startPlaneBit

constexpr uint32_t TotemT2DetId::startPlaneBit = 16
static

Definition at line 34 of file TotemT2DetId.h.

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