CMS 3D CMS Logo

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

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

#include <CTPPSDiamondDetId.h>

Inheritance diagram for CTPPSDiamondDetId:
CTPPSDetId DetId

Public Member Functions

uint32_t channel () const
 
void channelName (std::string &name, NameFlag flag=nFull) const
 
 CTPPSDiamondDetId (const CTPPSDetId &id)
 
 CTPPSDiamondDetId (uint32_t Arm, uint32_t Station, uint32_t RomanPot=0, uint32_t Plane=0, uint32_t Channel=0)
 Construct from hierarchy indeces. More...
 
 CTPPSDiamondDetId (uint32_t id)
 Construct from a raw id. More...
 
uint32_t plane () const
 
CTPPSDiamondDetId planeId () const
 
void planeName (std::string &name, NameFlag flag=nFull) const
 
void setChannel (uint32_t channel)
 
void setPlane (uint32_t channel)
 
- 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 (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. 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 const uint32_t lowMaskChannel = 0xFFF
 
static const uint32_t lowMaskPlane = 0x1FFFF
 
static const uint32_t maskChannel = 0x1F
 
static const uint32_t maskPlane = 0x3
 
static const uint32_t maxChannel = 31
 
static const uint32_t maxPlane = 3
 
static const uint32_t startDetBit = 12
 
static const 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

- 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 }
 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 CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits [17:18] : 2 bits for diamond plane 0,1,2,3 Bits [12:16] : 5 bits for Diamond channel numbers 1,2,3,..16 Bits [0:11] : unspecified yet.

Definition at line 24 of file CTPPSDiamondDetId.h.

Constructor & Destructor Documentation

◆ CTPPSDiamondDetId() [1/3]

CTPPSDiamondDetId::CTPPSDiamondDetId ( uint32_t  id)
explicit

Construct from a raw id.

Definition at line 20 of file CTPPSDiamondDetId.cc.

21  : CTPPSDetId(id) {
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  }

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

◆ CTPPSDiamondDetId() [2/3]

CTPPSDiamondDetId::CTPPSDiamondDetId ( const CTPPSDetId id)
inline

Definition at line 31 of file CTPPSDiamondDetId.h.

39 {

◆ CTPPSDiamondDetId() [3/3]

CTPPSDiamondDetId::CTPPSDiamondDetId ( uint32_t  Arm,
uint32_t  Station,
uint32_t  RomanPot = 0,
uint32_t  Plane = 0,
uint32_t  Channel = 0 
)

Construct from hierarchy indeces.

Definition at line 30 of file CTPPSDiamondDetId.cc.

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);

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

Member Function Documentation

◆ channel()

uint32_t CTPPSDiamondDetId::channel ( ) const
inline

◆ channelName()

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

Definition at line 84 of file CTPPSDiamondDetId.h.

84  {
85  case nShort:
86  name = "";
87  break;
88  case nFull:
90  name += "_";
91  break;
92  case nPath:
94  name += "/channel ";
95  break;
96  }
97 
98  name += std::to_string(channel());
99  }
100 };

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

Referenced by PPSTimingCalibrationPCLWorker::bookHistograms(), and CTPPSDiamondDQMSource::ChannelPlots::ChannelPlots().

◆ check()

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

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

Definition at line 40 of file CTPPSDiamondDetId.h.

45  { return ((id_ >> startPlaneBit) & maskPlane); }

Referenced by PPSTimingCalibrationPCLHarvester::beginRun(), PPSTimingCalibrationPCLWorker::bookHistograms(), and CTPPSDiamondDetId().

◆ plane()

uint32_t CTPPSDiamondDetId::plane ( ) const
inline

◆ planeId()

CTPPSDiamondDetId CTPPSDiamondDetId::planeId ( ) const
inline

Definition at line 62 of file CTPPSDiamondDetId.h.

◆ planeName()

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

Definition at line 66 of file CTPPSDiamondDetId.h.

66  {
67  case nShort:
68  name = "";
69  break;
70  case nFull:
71  rpName(name, flag);
72  name += "_";
73  break;
74  case nPath:
75  rpName(name, flag);
76  name += "/plane ";
77  break;
78  }
79 
80  name += std::to_string(plane());
81  }
82 

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

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

◆ setChannel()

void CTPPSDiamondDetId::setChannel ( uint32_t  channel)
inline

Definition at line 55 of file CTPPSDiamondDetId.h.

61  { return CTPPSDiamondDetId(rawId() & (~lowMaskPlane)); }

Referenced by CTPPSDiamondDQMSource::analyze().

◆ setPlane()

void CTPPSDiamondDetId::setPlane ( uint32_t  channel)
inline

Member Data Documentation

◆ lowMaskChannel

const uint32_t CTPPSDiamondDetId::lowMaskChannel = 0xFFF
static

Definition at line 37 of file CTPPSDiamondDetId.h.

◆ lowMaskPlane

const uint32_t CTPPSDiamondDetId::lowMaskPlane = 0x1FFFF
static

Definition at line 36 of file CTPPSDiamondDetId.h.

◆ maskChannel

const uint32_t CTPPSDiamondDetId::maskChannel = 0x1F
static

Definition at line 37 of file CTPPSDiamondDetId.h.

Referenced by CTPPSDiamondDetId().

◆ maskPlane

const uint32_t CTPPSDiamondDetId::maskPlane = 0x3
static

Definition at line 36 of file CTPPSDiamondDetId.h.

Referenced by CTPPSDiamondDetId().

◆ maxChannel

const uint32_t CTPPSDiamondDetId::maxChannel = 31
static

Definition at line 37 of file CTPPSDiamondDetId.h.

Referenced by CTPPSDiamondDetId().

◆ maxPlane

const uint32_t CTPPSDiamondDetId::maxPlane = 3
static

Definition at line 36 of file CTPPSDiamondDetId.h.

Referenced by CTPPSDiamondDetId().

◆ startDetBit

const uint32_t CTPPSDiamondDetId::startDetBit = 12
static

Definition at line 37 of file CTPPSDiamondDetId.h.

Referenced by CTPPSDiamondDetId().

◆ startPlaneBit

const uint32_t CTPPSDiamondDetId::startPlaneBit = 17
static

Definition at line 36 of file CTPPSDiamondDetId.h.

Referenced by CTPPSDiamondDetId().

CTPPSDiamondDetId::startDetBit
static const uint32_t startDetBit
Definition: CTPPSDiamondDetId.h:37
dqm::me_util::Channel
DQMChannel Channel
Definition: MonitorElement.h:58
CTPPSDetId::maxRP
static const uint32_t maxRP
Definition: CTPPSDetId.h:51
CTPPSDetId::CTPPSDetId
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:34
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::nShort
Definition: CTPPSDetId.h:87
CTPPSDetId::startArmBit
static const uint32_t startArmBit
Definition: CTPPSDetId.h:49
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
CTPPSDetId::nPath
Definition: CTPPSDetId.h:87
CTPPSDiamondDetId::plane
uint32_t plane() const
Definition: CTPPSDiamondDetId.h:46
CTPPSDetId::startStationBit
static const uint32_t startStationBit
Definition: CTPPSDetId.h:50
CTPPSDiamondDetId::channel
uint32_t channel() const
Definition: CTPPSDiamondDetId.h:53
CTPPSDiamondDetId::planeName
void planeName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDiamondDetId.h:66
CTPPSDetId::sdTimingDiamond
Definition: CTPPSDetId.h:44
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
DetId::id_
uint32_t id_
Definition: DetId.h:69
CTPPSDetId::nFull
Definition: CTPPSDetId.h:87
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
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Exception
Definition: hltDiff.cc:245
Plane
Definition: Plane.h:16
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CTPPSDiamondDetId::maskPlane
static const uint32_t maskPlane
Definition: CTPPSDiamondDetId.h:36
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117
CTPPSDetId::maskArm
static const uint32_t maskArm
Definition: CTPPSDetId.h:49
CTPPSDetId::rpName
void rpName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:132
CTPPSDetId::maskRP
static const uint32_t maskRP
Definition: CTPPSDetId.h:51