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 TotemT2DetId 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,
  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 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 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

◆ NameFlag

type of name returned by *Name functions

Enumerator
nShort 
nFull 
nPath 

Definition at line 89 of file CTPPSDetId.h.

◆ SubDetector

CTPPS sub-detectors.

Enumerator
sdTrackingStrip 
sdTrackingPixel 
sdTimingDiamond 
sdTimingFastSilicon 
sdTotemT2 

Definition at line 35 of file CTPPSDetId.h.

Constructor & Destructor Documentation

◆ CTPPSDetId() [1/2]

CTPPSDetId::CTPPSDetId ( uint32_t  id)
explicit

Construct from a raw id.

Definition at line 41 of file CTPPSDetId.cc.

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

Referenced by armId(), rpId(), and stationId().

41  : DetId(id) {
42  bool inputOK = (det() == DetId::VeryForward);
43 
44  if (!inputOK) {
45  throw cms::Exception("InvalidDetId") << "CTPPSDetId ctor:"
46  << " det: " << det() << " subdet: " << subdetId()
47  << " is not a valid CTPPS id.";
48  }
49 }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ 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 53 of file CTPPSDetId.cc.

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

57  throw cms::Exception("InvalidDetId") << "CTPPSDetId ctor: invalid sub-detector " << SubDet << ".";
58  }
59 
60  if (Arm > maxArm || Station > maxStation || RomanPot > maxRP) {
61  throw cms::Exception("InvalidDetId") << "CTPPSDetId ctor:"
62  << " Invalid parameters:"
63  << " arm=" << Arm << " station=" << Station << " rp=" << RomanPot << std::endl;
64  }
65 
66  uint32_t ok = 0xfe000000;
67  id_ &= ok;
68 
69  id_ |= ((Arm & maskArm) << startArmBit);
70  id_ |= ((Station & maskStation) << startStationBit);
71  id_ |= ((RomanPot & maskRP) << startRPBit);
72 }
static const uint32_t maxStation
Definition: CTPPSDetId.h:52
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 const uint32_t maskArm
Definition: CTPPSDetId.h:51
static const uint32_t maxArm
Definition: CTPPSDetId.h:51
static const uint32_t maxRP
Definition: CTPPSDetId.h:53
uint32_t id_
Definition: DetId.h:69
static const uint32_t startStationBit
Definition: CTPPSDetId.h:52
static const uint32_t startArmBit
Definition: CTPPSDetId.h:51
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

Member Function Documentation

◆ arm()

uint32_t CTPPSDetId::arm ( ) const
inline

Definition at line 57 of file CTPPSDetId.h.

References DetId::id_, maskArm, and startArmBit.

Referenced by CTPPSOpticsPlotter::analyze(), CTPPSAcceptancePlotter::analyze(), CTPPSDirectProtonSimulationValidator::analyze(), CTPPSProtonReconstructionValidator::analyze(), CTPPSTrackDistributionPlotter::analyze(), CTPPSProtonReconstructionPlotter::analyze(), CTPPSProtonReconstructionEfficiencyEstimatorMC::analyze(), CTPPSPixelDQMSource::analyze(), CTPPSProtonReconstructionEfficiencyEstimatorData::analyze(), CTPPSDiamondDQMSource::analyze(), armName(), PPSModifySingularModes::beginRun(), DiamondSampicDQMSource::bookHistograms(), DiamondSampicCalibrationDQMSource::bookHistograms(), AlignmentTask::buildEqualMeanUMeanVRotZConstraints(), AlignmentTask::buildOneRotZPerPotConstraints(), AlignmentTask::buildStandardConstraints(), CTPPSDiamondDQMSource::dqmBeginRun(), factorRPFromSensorCorrections(), TotemT2DQMSource::fillErrorFlagsHistogram(), RPixPlaneCombinatoryTracking::findTracks(), DiamondSampicDQMSource::globalEndLuminosityBlock(), TotemTimingDQMSource::globalEndLuminosityBlock(), CTPPSDiamondDQMSource::globalEndLuminosityBlock(), PPSDirectSimulationData::loadEffeciencyHistogramsPerPlane(), printId(), PPSAlignmentWorker::SectorData::process(), StraightTrackAlignment::processEvent(), PPSDirectProtonSimulation::processProton(), CTPPSModifiedOpticalFunctionsESSource::produce(), ProtonProducer::produce(), RPixPlaneCombinatoryTracking::produceAllHitCombination(), ProtonReconstructionAlgorithm::reconstructFromSingleRP(), TotemRPDetId::rpDecimalId(), setArm(), TotemT2DetId::TotemT2DetId(), TotemTimingDetId::TotemTimingDetId(), OpticalFunctionsTransport::transportProton(), CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::UpdateOptics(), and CTPPSRPAlignmentCorrectionsMethods::writeXMLBlock().

57 { return ((id_ >> startArmBit) & maskArm); }
static const uint32_t maskArm
Definition: CTPPSDetId.h:51
uint32_t id_
Definition: DetId.h:69
static const uint32_t startArmBit
Definition: CTPPSDetId.h:51

◆ armId()

CTPPSDetId CTPPSDetId::armId ( ) const
inline

◆ armName()

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

Definition at line 98 of file CTPPSDetId.h.

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

Referenced by CTPPSCommonDQMSource::ArmPlots::ArmPlots(), TotemT2DetId::planeName(), TotemT2DQMSource::SectorPlots::SectorPlots(), DiamondSampicDQMSource::SectorPlots::SectorPlots(), CTPPSDiamondDQMSource::SectorPlots::SectorPlots(), and stationName().

98  {
99  switch (flag) {
100  case nShort:
101  name = "";
102  break;
103  case nFull:
105  name += "_";
106  break;
107  case nPath:
109  name += "/sector ";
110  break;
111  }
112 
113  name += armNames[arm()];
114  }
uint32_t arm() const
Definition: CTPPSDetId.h:57
static const std::string armNames[]
Definition: CTPPSDetId.h:155
void subDetectorName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:91

◆ 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

Definition at line 134 of file CTPPSDetId.h.

References RemoveAddSevLevel::flag, Skims_PA_cff::name, nFull, nPath, nShort, rp(), rpNames, and stationName().

Referenced by CTPPSCommonDQMSource::ArmPlots::ArmPlots(), ElasticPlotDQMSource::DiagonalPlots::DiagonalPlots(), TotemRPDQMHarvester::MakeHitNumberRatios(), TotemRPDQMHarvester::MakePlaneEfficiencyHistograms(), CTPPSDiamondDetId::planeName(), TotemTimingDetId::planeName(), TotemRPDetId::planeName(), TotemRPDQMSource::PotPlots::PotPlots(), ElasticPlotDQMSource::PotPlots::PotPlots(), DiamondSampicCalibrationDQMSource::PotPlots::PotPlots(), DiamondSampicDQMSource::PotPlots::PotPlots(), TotemTimingDQMSource::PotPlots::PotPlots(), and CTPPSDiamondDQMSource::PotPlots::PotPlots().

134  {
135  switch (flag) {
136  case nShort:
137  name = "";
138  break;
139  case nFull:
141  name += "_";
142  break;
143  case nPath:
145  name += "/";
146  break;
147  }
148 
149  name += rpNames[rp()];
150  }
static const std::string rpNames[]
Definition: CTPPSDetId.h:157
uint32_t rp() const
Definition: CTPPSDetId.h:71
void stationName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:116

◆ setArm()

void CTPPSDetId::setArm ( uint32_t  arm)
inline

Definition at line 59 of file CTPPSDetId.h.

References arm(), DetId::id_, maskArm, and startArmBit.

59  {
60  id_ &= ~(maskArm << startArmBit);
61  id_ |= ((arm & maskArm) << startArmBit);
62  }
uint32_t arm() const
Definition: CTPPSDetId.h:57
static const uint32_t maskArm
Definition: CTPPSDetId.h:51
uint32_t id_
Definition: DetId.h:69
static const uint32_t startArmBit
Definition: CTPPSDetId.h:51

◆ setRP()

void CTPPSDetId::setRP ( uint32_t  rp)
inline

Definition at line 73 of file CTPPSDetId.h.

References DetId::id_, maskRP, rp(), and startRPBit.

73  {
74  id_ &= ~(maskRP << startRPBit);
75  id_ |= ((rp & maskRP) << startRPBit);
76  }
static const uint32_t startRPBit
Definition: CTPPSDetId.h:53
static const uint32_t maskRP
Definition: CTPPSDetId.h:53
uint32_t rp() const
Definition: CTPPSDetId.h:71
uint32_t id_
Definition: DetId.h:69

◆ setStation()

void CTPPSDetId::setStation ( uint32_t  station)
inline

Definition at line 66 of file CTPPSDetId.h.

References DetId::id_, maskStation, startStationBit, and station().

66  {
69  }
static const uint32_t maskStation
Definition: CTPPSDetId.h:52
uint32_t id_
Definition: DetId.h:69
uint32_t station() const
Definition: CTPPSDetId.h:64
static const uint32_t startStationBit
Definition: CTPPSDetId.h:52

◆ station()

uint32_t CTPPSDetId::station ( ) const
inline

◆ stationId()

CTPPSDetId CTPPSDetId::stationId ( ) const
inline

Definition at line 82 of file CTPPSDetId.h.

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

82 { return CTPPSDetId(rawId() & (~lowMaskStation)); }
static const uint32_t lowMaskStation
Definition: CTPPSDetId.h:52
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:41

◆ stationName()

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

Definition at line 116 of file CTPPSDetId.h.

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

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

116  {
117  switch (flag) {
118  case nShort:
119  name = "";
120  break;
121  case nFull:
122  armName(name, flag);
123  name += "_";
124  break;
125  case nPath:
126  armName(name, flag);
127  name += "/station ";
128  break;
129  }
130 
131  name += stationNames[station()];
132  }
void armName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:98
uint32_t station() const
Definition: CTPPSDetId.h:64
static const std::string stationNames[]
Definition: CTPPSDetId.h:156

◆ subDetectorName()

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

Definition at line 91 of file CTPPSDetId.h.

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

Referenced by armName().

91  {
92  if (flag == nPath)
94  else
96  }
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 const std::string subDetectorPaths[]
Definition: CTPPSDetId.h:154
static const std::string subDetectorNames[]
Definition: CTPPSDetId.h:153

Member Data Documentation

◆ armNames

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

Definition at line 155 of file CTPPSDetId.h.

Referenced by armName().

◆ lowMaskArm

const uint32_t CTPPSDetId::lowMaskArm = 0xFFFFFF
static

Definition at line 51 of file CTPPSDetId.h.

Referenced by armId().

◆ lowMaskRP

const uint32_t CTPPSDetId::lowMaskRP = 0x7FFFF
static

Definition at line 53 of file CTPPSDetId.h.

Referenced by rpId().

◆ lowMaskStation

const uint32_t CTPPSDetId::lowMaskStation = 0x3FFFFF
static

Definition at line 52 of file CTPPSDetId.h.

Referenced by stationId().

◆ 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 157 of file CTPPSDetId.h.

Referenced by rpName().

◆ 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 156 of file CTPPSDetId.h.

Referenced by stationName().

◆ subDetectorNames

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

Definition at line 153 of file CTPPSDetId.h.

Referenced by subDetectorName().

◆ subDetectorPaths

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

Definition at line 154 of file CTPPSDetId.h.

Referenced by subDetectorName().