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
 
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...
 
CTPPSDetId getArmId () const
 
CTPPSDetId getRPId () const
 
CTPPSDetId getStationId () const
 
uint32_t rp () 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
 
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 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 32 of file CTPPSDetId.h.

Member Enumeration Documentation

type of name returned by *Name functions

Enumerator
nShort 
nFull 
nPath 

Definition at line 83 of file CTPPSDetId.h.

CTPPS sub-detectors.

Enumerator
sdTrackingStrip 
sdTrackingPixel 
sdTimingDiamond 
sdTimingFastSilicon 

Definition at line 35 of file CTPPSDetId.h.

Constructor & Destructor Documentation

CTPPSDetId::CTPPSDetId ( uint32_t  id)
explicit

Construct from a raw id.

Definition at line 35 of file CTPPSDetId.cc.

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

Referenced by CTPPSPixelDetId::CTPPSPixelDetId(), getArmId(), getRPId(), and getStationId().

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  }
43 }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
CTPPSDetId::CTPPSDetId ( uint32_t  SubDet,
uint32_t  Arm,
uint32_t  Station,
uint32_t  RomanPot = 0 
)

Construct from hierarchy indeces.

Definition at line 47 of file CTPPSDetId.cc.

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

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);
66 }
static const uint32_t maxStation
Definition: CTPPSDetId.h:46
static const uint32_t startRPBit
Definition: CTPPSDetId.h:47
static const uint32_t maskStation
Definition: CTPPSDetId.h:46
static const uint32_t maskRP
Definition: CTPPSDetId.h:47
static const uint32_t maskArm
Definition: CTPPSDetId.h:45
static const uint32_t maxArm
Definition: CTPPSDetId.h:45
static const uint32_t maxRP
Definition: CTPPSDetId.h:47
uint32_t id_
Definition: DetId.h:62
static const uint32_t startStationBit
Definition: CTPPSDetId.h:46
static const uint32_t startArmBit
Definition: CTPPSDetId.h:45
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30

Member Function Documentation

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

Definition at line 92 of file CTPPSDetId.h.

References arm(), armNames, RemoveAddSevLevel::flag, nFull, nShort, and subDetectorName().

Referenced by CTPPSCommonDQMSource::ArmPlots::ArmPlots(), CTPPSPixelDQMSource::bookHistograms(), and stationName().

92  {
93  switch (flag) {
94  case nShort:
95  name = "";
96  break;
97  case nFull:
99  name += "_";
100  break;
101  case nPath:
103  name += "/sector ";
104  break;
105  }
106 
107  name += armNames[arm()];
108  }
static const std::string armNames[]
Definition: CTPPSDetId.h:149
uint32_t arm() const
Definition: CTPPSDetId.h:51
void subDetectorName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:85
CTPPSDetId CTPPSDetId::getArmId ( ) const
inline

Definition at line 74 of file CTPPSDetId.h.

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

Referenced by CTPPSGeometry::build().

74 { return CTPPSDetId(rawId() & (~lowMaskArm)); }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:35
static const uint32_t lowMaskArm
Definition: CTPPSDetId.h:45
CTPPSDetId CTPPSDetId::getRPId ( ) const
inline
CTPPSDetId CTPPSDetId::getStationId ( ) const
inline

Definition at line 76 of file CTPPSDetId.h.

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

Referenced by CTPPSPixelDQMSource::bookHistograms(), and CTPPSGeometry::build().

76 { return CTPPSDetId(rawId() & (~lowMaskStation)); }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
static const uint32_t lowMaskStation
Definition: CTPPSDetId.h:46
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:35
uint32_t CTPPSDetId::rp ( ) const
inline
void CTPPSDetId::rpName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline
void CTPPSDetId::setArm ( uint32_t  arm)
inline

Definition at line 53 of file CTPPSDetId.h.

References DetId::id_, maskArm, and startArmBit.

53  {
54  id_ &= ~(maskArm << startArmBit);
55  id_ |= ((arm & maskArm) << startArmBit);
56  }
static const uint32_t maskArm
Definition: CTPPSDetId.h:45
uint32_t arm() const
Definition: CTPPSDetId.h:51
uint32_t id_
Definition: DetId.h:62
static const uint32_t startArmBit
Definition: CTPPSDetId.h:45
void CTPPSDetId::setRP ( uint32_t  rp)
inline

Definition at line 67 of file CTPPSDetId.h.

References DetId::id_, maskRP, and startRPBit.

Referenced by CTPPSPixelDQMSource::bookHistograms().

67  {
68  id_ &= ~(maskRP << startRPBit);
69  id_ |= ((rp & maskRP) << startRPBit);
70  }
static const uint32_t startRPBit
Definition: CTPPSDetId.h:47
static const uint32_t maskRP
Definition: CTPPSDetId.h:47
uint32_t id_
Definition: DetId.h:62
uint32_t rp() const
Definition: CTPPSDetId.h:65
void CTPPSDetId::setStation ( uint32_t  station)
inline

Definition at line 60 of file CTPPSDetId.h.

References DetId::id_, maskStation, and startStationBit.

Referenced by CTPPSPixelDQMSource::bookHistograms(), and TotemTimingLocalTrackFitter::produce().

60  {
63  }
uint32_t station() const
Definition: CTPPSDetId.h:58
static const uint32_t maskStation
Definition: CTPPSDetId.h:46
uint32_t id_
Definition: DetId.h:62
static const uint32_t startStationBit
Definition: CTPPSDetId.h:46
uint32_t CTPPSDetId::station ( ) const
inline
void CTPPSDetId::stationName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 110 of file CTPPSDetId.h.

References armName(), RemoveAddSevLevel::flag, nFull, nShort, station(), and stationNames.

Referenced by CTPPSCommonDQMSource::ArmPlots::ArmPlots(), and rpName().

110  {
111  switch (flag) {
112  case nShort:
113  name = "";
114  break;
115  case nFull:
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  }
uint32_t station() const
Definition: CTPPSDetId.h:58
void armName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:92
static const std::string stationNames[]
Definition: CTPPSDetId.h:150
void CTPPSDetId::subDetectorName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 85 of file CTPPSDetId.h.

References RemoveAddSevLevel::flag, subDetectorNames, subDetectorPaths, and DetId::subdetId().

Referenced by armName().

85  {
86  if (flag == nPath)
88  else
90  }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
static const std::string subDetectorPaths[]
Definition: CTPPSDetId.h:148
static const std::string subDetectorNames[]
Definition: CTPPSDetId.h:147

Member Data Documentation

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

Definition at line 149 of file CTPPSDetId.h.

Referenced by armName().

const uint32_t CTPPSDetId::lowMaskArm = 0xFFFFFF
static

Definition at line 45 of file CTPPSDetId.h.

const uint32_t CTPPSDetId::lowMaskRP = 0x7FFFF
static

Definition at line 47 of file CTPPSDetId.h.

const uint32_t CTPPSDetId::lowMaskStation = 0x3FFFFF
static

Definition at line 46 of file CTPPSDetId.h.

const uint32_t CTPPSDetId::maskArm = 0x1
static
const uint32_t CTPPSDetId::maskRP = 0x7
static
const uint32_t CTPPSDetId::maskStation = 0x3
static
const uint32_t CTPPSDetId::maxArm = 1
static
const uint32_t CTPPSDetId::maxRP = 6
static
const uint32_t CTPPSDetId::maxStation = 2
static
const string CTPPSDetId::rpNames = {"nr_tp", "nr_bt", "nr_hr", "fr_hr", "fr_tp", "fr_bt", "cyl_hr"}
staticprivate

Definition at line 151 of file CTPPSDetId.h.

Referenced by rpName().

const uint32_t CTPPSDetId::startArmBit = 24
static
const uint32_t CTPPSDetId::startRPBit = 19
static
const uint32_t CTPPSDetId::startStationBit = 22
static
const string CTPPSDetId::stationNames = {"210", "220cyl", "220"}
staticprivate

Definition at line 150 of file CTPPSDetId.h.

Referenced by stationName().

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

Definition at line 147 of file CTPPSDetId.h.

Referenced by subDetectorName().

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

Definition at line 148 of file CTPPSDetId.h.

Referenced by subDetectorName().