CMS 3D CMS Logo

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

Base class for CTPPS detector IDs. More...

#include <CTPPSDetId.h>

Inheritance diagram for CTPPSDetId:
DetId CTPPSDiamondDetId CTPPSPixelDetId TotemRPDetId TotemTimingDetId

Public Types

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
}
 

Public Member Functions

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 Attributes

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
 

Static Private Attributes

static const std::string armNames [] = {"45", "56"}
 
static const std::string rpNames [] = {"nr_tp", "nr_bt", "nr_hr", "fr_hr", "fr_tp", "fr_bt", "cyl_hr"}
 
static const std::string stationNames [] = {"210", "220cyl", "220"}
 
static const std::string subDetectorNames []
 
static const std::string subDetectorPaths []
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Base class for CTPPS detector IDs.

The bit structure is as follows: bits [24:24] => arm: 0 (sector 45), 1 (sector 56) bits [22:23] => station: 0 (210m), 1 (cylyndrical pots), 2 (220m) bits [19:21] => Roman Pot: 0 (near top), 1 (near bottom), 2 (near horizontal), 3 (far horizontal), 4 (far top), 5 (far bottom) bits [0:18] => available for derived classes

The ...Name() methods implement the official naming scheme based on EDMS 906715.

Definition at line 31 of file CTPPSDetId.h.

Member Enumeration Documentation

◆ NameFlag

type of name returned by *Name functions

Enumerator
nShort 
nFull 
nPath 

Definition at line 87 of file CTPPSDetId.h.

◆ SubDetector

CTPPS sub-detectors.

Enumerator
sdTrackingStrip 
sdTrackingPixel 
sdTimingDiamond 
sdTimingFastSilicon 

Definition at line 39 of file CTPPSDetId.h.

51 { return ((id_ >> startArmBit) & maskArm); }

Constructor & Destructor Documentation

◆ CTPPSDetId() [1/2]

CTPPSDetId::CTPPSDetId ( uint32_t  id)
explicit

Construct from a raw id.

Definition at line 34 of file CTPPSDetId.cc.

35  : DetId(id) {
36  bool inputOK = (det() == DetId::VeryForward);
37 
38  if (!inputOK) {
39  throw cms::Exception("InvalidDetId") << "CTPPSDetId ctor:"
40  << " det: " << det() << " subdet: " << subdetId()
41  << " is not a valid CTPPS id.";
42  }

References DetId::det(), Exception, DetId::subdetId(), and DetId::VeryForward.

Referenced by armId(), and setRP().

◆ CTPPSDetId() [2/2]

CTPPSDetId::CTPPSDetId ( uint32_t  SubDet,
uint32_t  Arm,
uint32_t  Station,
uint32_t  RomanPot = 0 
)

Construct from hierarchy indeces.

Definition at line 46 of file CTPPSDetId.cc.

51  throw cms::Exception("InvalidDetId") << "CTPPSDetId ctor: invalid sub-detector " << SubDet << ".";
52  }
53 
54  if (Arm > maxArm || Station > maxStation || RomanPot > maxRP) {
55  throw cms::Exception("InvalidDetId") << "CTPPSDetId ctor:"
56  << " Invalid parameters:"
57  << " arm=" << Arm << " station=" << Station << " rp=" << RomanPot << std::endl;
58  }
59 
60  uint32_t ok = 0xfe000000;
61  id_ &= ok;
62 
63  id_ |= ((Arm & maskArm) << startArmBit);
64  id_ |= ((Station & maskStation) << startStationBit);
65  id_ |= ((RomanPot & maskRP) << startRPBit);

References Exception, DetId::id_, maskArm, maskRP, maskStation, maxArm, maxRP, maxStation, convertSQLiteXML::ok, sdTimingDiamond, sdTimingFastSilicon, sdTrackingPixel, sdTrackingStrip, startArmBit, startRPBit, startStationBit, and ntupleEnum::SubDet.

Member Function Documentation

◆ arm()

uint32_t CTPPSDetId::arm ( ) const
inline

◆ armId()

CTPPSDetId CTPPSDetId::armId ( ) const
inline

Definition at line 78 of file CTPPSDetId.h.

78 { return CTPPSDetId(rawId() & (~lowMaskRP)); }

References CTPPSDetId(), lowMaskRP, and DetId::rawId().

Referenced by CTPPSGeometry::build().

◆ armName()

void CTPPSDetId::armName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 96 of file CTPPSDetId.h.

97  :
99  name += "_";
100  break;
101  case nPath:
103  name += "/sector ";
104  break;
105  }
106 
107  name += armNames[arm()];
108  }
109 
110  inline void stationName(std::string &name, NameFlag flag = nFull) const {
111  switch (flag) {
112  case nShort:

Referenced by CTPPSCommonDQMSource::ArmPlots::ArmPlots().

◆ rp()

uint32_t CTPPSDetId::rp ( ) const
inline

◆ rpId()

CTPPSDetId CTPPSDetId::rpId ( ) const
inline

◆ rpName()

void CTPPSDetId::rpName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

◆ setArm()

void CTPPSDetId::setArm ( uint32_t  arm)
inline

Definition at line 57 of file CTPPSDetId.h.

58  { return ((id_ >> startStationBit) & maskStation); }
59 
60  void setStation(uint32_t station) {

References DetId::id_, maskStation, and startStationBit.

◆ setRP()

void CTPPSDetId::setRP ( uint32_t  rp)
inline

Definition at line 71 of file CTPPSDetId.h.

74  { return CTPPSDetId(rawId() & (~lowMaskArm)); }

References CTPPSDetId(), lowMaskArm, and DetId::rawId().

◆ setStation()

void CTPPSDetId::setStation ( uint32_t  station)
inline

Definition at line 64 of file CTPPSDetId.h.

65  { return ((id_ >> startRPBit) & maskRP); }
66 
67  void setRP(uint32_t rp) {

References DetId::id_, maskRP, and startRPBit.

◆ station()

uint32_t CTPPSDetId::station ( ) const
inline

◆ stationId()

CTPPSDetId CTPPSDetId::stationId ( ) const
inline

Definition at line 80 of file CTPPSDetId.h.

83 { nShort, nFull, nPath };

References nFull, nPath, and nShort.

Referenced by CTPPSGeometry::build().

◆ stationName()

void CTPPSDetId::stationName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 114 of file CTPPSDetId.h.

115  :
116  armName(name, flag);
117  name += "_";
118  break;
119  case nPath:
120  armName(name, flag);
121  name += "/station ";
122  break;
123  }
124 
125  name += stationNames[station()];
126  }
127 
128  inline void rpName(std::string &name, NameFlag flag = nFull) const {
129  switch (flag) {
130  case nShort:

◆ subDetectorName()

void CTPPSDetId::subDetectorName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 89 of file CTPPSDetId.h.

92  {
93  switch (flag) {
94  case nShort:

Member Data Documentation

◆ armNames

const string CTPPSDetId::armNames = {"45", "56"}
staticprivate

Definition at line 153 of file CTPPSDetId.h.

◆ lowMaskArm

const uint32_t CTPPSDetId::lowMaskArm = 0xFFFFFF
static

Definition at line 49 of file CTPPSDetId.h.

Referenced by setRP().

◆ lowMaskRP

const uint32_t CTPPSDetId::lowMaskRP = 0x7FFFF
static

Definition at line 51 of file CTPPSDetId.h.

Referenced by armId().

◆ lowMaskStation

const uint32_t CTPPSDetId::lowMaskStation = 0x3FFFFF
static

Definition at line 50 of file CTPPSDetId.h.

◆ maskArm

const uint32_t CTPPSDetId::maskArm = 0x1
static

◆ maskRP

const uint32_t CTPPSDetId::maskRP = 0x7
static

◆ maskStation

const uint32_t CTPPSDetId::maskStation = 0x3
static

◆ maxArm

const uint32_t CTPPSDetId::maxArm = 1
static

◆ maxRP

const uint32_t CTPPSDetId::maxRP = 6
static

◆ maxStation

const uint32_t CTPPSDetId::maxStation = 2
static

◆ rpNames

const string CTPPSDetId::rpNames = {"nr_tp", "nr_bt", "nr_hr", "fr_hr", "fr_tp", "fr_bt", "cyl_hr"}
staticprivate

Definition at line 155 of file CTPPSDetId.h.

◆ startArmBit

const uint32_t CTPPSDetId::startArmBit = 24
static

◆ startRPBit

const uint32_t CTPPSDetId::startRPBit = 19
static

◆ startStationBit

const uint32_t CTPPSDetId::startStationBit = 22
static

◆ stationNames

const string CTPPSDetId::stationNames = {"210", "220cyl", "220"}
staticprivate

Definition at line 154 of file CTPPSDetId.h.

◆ subDetectorNames

const string CTPPSDetId::subDetectorNames
staticprivate
Initial value:
= {
"", "", "", "ctpps_tr_strip", "ctpps_tr_pixel", "ctpps_ti_diamond", "ctpps_ti_fastsilicon"}

Definition at line 151 of file CTPPSDetId.h.

◆ subDetectorPaths

const string CTPPSDetId::subDetectorPaths
staticprivate
Initial value:
= {
"", "", "", "CTPPS/TrackingStrip", "CTPPS/TrackingPixel", "CTPPS/TimingDiamond", "CTPPS/TimingFastSilicon"}

Definition at line 152 of file CTPPSDetId.h.

CTPPSDetId::subDetectorPaths
static const std::string subDetectorPaths[]
Definition: CTPPSDetId.h:152
CTPPSDetId::rp
uint32_t rp() const
Definition: CTPPSDetId.h:69
CTPPSDetId::maxRP
static const uint32_t maxRP
Definition: CTPPSDetId.h:51
CTPPSDetId::subDetectorNames
static const std::string subDetectorNames[]
Definition: CTPPSDetId.h:151
CTPPSDetId::CTPPSDetId
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:34
CTPPSDetId::stationName
void stationName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:114
CTPPSDetId::rpNames
static const std::string rpNames[]
Definition: CTPPSDetId.h:155
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
CTPPSDetId::maxArm
static const uint32_t maxArm
Definition: CTPPSDetId.h:49
CTPPSDetId::sdTimingFastSilicon
Definition: CTPPSDetId.h:44
CTPPSDetId::nShort
Definition: CTPPSDetId.h:87
CTPPSDetId::lowMaskArm
static const uint32_t lowMaskArm
Definition: CTPPSDetId.h:49
CTPPSDetId::startArmBit
static const uint32_t startArmBit
Definition: CTPPSDetId.h:49
DetId::VeryForward
Definition: DetId.h:31
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
CTPPSDetId::setStation
void setStation(uint32_t station)
Definition: CTPPSDetId.h:64
CTPPSDetId::nPath
Definition: CTPPSDetId.h:87
CTPPSDetId::subDetectorName
void subDetectorName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:89
CTPPSDetId::sdTrackingStrip
Definition: CTPPSDetId.h:44
CTPPSDetId::station
uint32_t station() const
Definition: CTPPSDetId.h:62
CTPPSDetId::startStationBit
static const uint32_t startStationBit
Definition: CTPPSDetId.h:50
CTPPSDetId::lowMaskRP
static const uint32_t lowMaskRP
Definition: CTPPSDetId.h:51
ntupleEnum.SubDet
SubDet
Definition: ntupleEnum.py:15
CTPPSDetId::sdTimingDiamond
Definition: CTPPSDetId.h:44
CTPPSDetId::sdTrackingPixel
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSDetId::stationNames
static const std::string stationNames[]
Definition: CTPPSDetId.h:154
CTPPSDetId::arm
uint32_t arm() const
Definition: CTPPSDetId.h:55
CTPPSDetId::NameFlag
NameFlag
type of name returned by *Name functions
Definition: CTPPSDetId.h:87
DetId::id_
uint32_t id_
Definition: DetId.h:69
CTPPSDetId::nFull
Definition: CTPPSDetId.h:87
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
CTPPSDetId::setRP
void setRP(uint32_t rp)
Definition: CTPPSDetId.h:71
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Exception
Definition: hltDiff.cc:246
DetId::DetId
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CTPPSDetId::armNames
static const std::string armNames[]
Definition: CTPPSDetId.h:153
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
CTPPSDetId::maskArm
static const uint32_t maskArm
Definition: CTPPSDetId.h:49
CTPPSDetId::armName
void armName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:96
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