CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

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
}
 

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
Detector det () const
 get the detector field from this detid More...
 
 DetId ()
 Create an empty or null id (also for persistence) More...
 
 DetId (uint32_t id)
 Create an id from a raw number. More...
 
 DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
bool null () const
 is this a null id ? More...
 
 operator uint32_t () const
 
bool operator!= (DetId id) const
 inequality More...
 
uint32_t operator() () const
 
bool operator< (DetId id) const
 comparison More...
 
bool operator== (DetId id) const
 equality More...
 
uint32_t rawId () const
 get the raw id More...
 
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 kDetOffset = 28
 
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 [] = { "", "", "", "ctpps_tr_strip", "ctpps_tr_pixel", "ctpps_ti_diamond", "ctpps_ti_fastsilicon" }
 
static const std::string subDetectorPaths [] = { "", "", "", "CTPPS/TrackingStrip", "CTPPS/TrackingPixel", "CTPPS/TimingDiamond", "CTPPS/TimingFastSilicon" }
 

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

CTPPS sub-detectors.

Enumerator
sdTrackingStrip 
sdTrackingPixel 
sdTimingDiamond 
sdTimingFastSilicon 

Definition at line 36 of file CTPPSDetId.h.

Constructor & Destructor Documentation

CTPPSDetId::CTPPSDetId ( uint32_t  id)
explicit

Construct from a raw id.

Definition at line 31 of file CTPPSDetId.cc.

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

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

31  : DetId(id)
32 {
33  bool inputOK = (det() == DetId::VeryForward);
34 
35  if (!inputOK)
36  {
37  throw cms::Exception("InvalidDetId") << "CTPPSDetId ctor:"
38  << " det: " << det()
39  << " subdet: " << subdetId()
40  << " is not a valid CTPPS id.";
41  }
42 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
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.

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

46  :
47  DetId(DetId::VeryForward, SubDet)
48 {
49  if (SubDet != sdTrackingStrip && SubDet != sdTrackingPixel && SubDet != sdTimingDiamond && SubDet != sdTimingFastSilicon)
50  {
51  throw cms::Exception("InvalidDetId") << "CTPPSDetId ctor: invalid sub-detector " << SubDet << ".";
52  }
53 
54  if (Arm > maxArm || Station > maxStation || RomanPot > maxRP)
55  {
56  throw cms::Exception("InvalidDetId") << "CTPPSDetId ctor:"
57  << " Invalid parameters:"
58  << " arm=" << Arm
59  << " station=" << Station
60  << " rp=" << RomanPot
61  << std::endl;
62  }
63 
64  uint32_t ok=0xfe000000;
65  id_ &= ok;
66 
67  id_ |= ((Arm & maskArm) << startArmBit);
68  id_ |= ((Station & maskStation) << startStationBit);
69  id_ |= ((RomanPot & maskRP) << startRPBit);
70 }
static const uint32_t maxStation
Definition: CTPPSDetId.h:47
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
static const uint32_t startRPBit
Definition: CTPPSDetId.h:48
static const uint32_t maskStation
Definition: CTPPSDetId.h:47
static const uint32_t maskRP
Definition: CTPPSDetId.h:48
static const uint32_t maskArm
Definition: CTPPSDetId.h:46
static const uint32_t maxArm
Definition: CTPPSDetId.h:46
static const uint32_t maxRP
Definition: CTPPSDetId.h:48
uint32_t id_
Definition: DetId.h:55
static const uint32_t startStationBit
Definition: CTPPSDetId.h:47
static const uint32_t startArmBit
Definition: CTPPSDetId.h:46

Member Function Documentation

uint32_t CTPPSDetId::arm ( ) const
inline

Definition at line 52 of file CTPPSDetId.h.

References DetId::id_, maskArm, and startArmBit.

Referenced by armName(), and TotemRPDetId::getRPDecimalId().

53  {
54  return ((id_>>startArmBit) & maskArm);
55  }
static const uint32_t maskArm
Definition: CTPPSDetId.h:46
uint32_t id_
Definition: DetId.h:55
static const uint32_t startArmBit
Definition: CTPPSDetId.h:46
void CTPPSDetId::armName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 115 of file CTPPSDetId.h.

References arm(), armNames, nFull, nPath, nShort, and subDetectorName().

Referenced by TotemRPDQMSource::ArmPlots::ArmPlots(), and stationName().

116  {
117  switch (flag)
118  {
119  case nShort: name = ""; break;
120  case nFull: subDetectorName(name, flag); name += "_"; break;
121  case nPath: subDetectorName(name, flag); name += "/sector "; break;
122  }
123 
124  name += armNames[arm()];
125  }
static const std::string armNames[]
Definition: CTPPSDetId.h:154
uint32_t arm() const
Definition: CTPPSDetId.h:52
void subDetectorName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:107
CTPPSDetId CTPPSDetId::getArmId ( ) const
inline

Definition at line 87 of file CTPPSDetId.h.

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

Referenced by TotemRPDQMSource::analyze(), and TotemRPGeometry::BuildSets().

88  {
89  return CTPPSDetId( rawId() & (~lowMaskArm) );
90  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:31
static const uint32_t lowMaskArm
Definition: CTPPSDetId.h:46
CTPPSDetId CTPPSDetId::getRPId ( ) const
inline

Definition at line 97 of file CTPPSDetId.h.

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

Referenced by TotemRPDQMSource::analyze(), TotemRPGeometry::BuildSets(), TotemRPDQMHarvester::MakePlaneEfficiencyHistograms(), and TotemRPUVPatternFinder::produce().

98  {
99  return CTPPSDetId( rawId() & (~lowMaskRP) );
100  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:31
static const uint32_t lowMaskRP
Definition: CTPPSDetId.h:48
CTPPSDetId CTPPSDetId::getStationId ( ) const
inline

Definition at line 92 of file CTPPSDetId.h.

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

Referenced by TotemRPGeometry::BuildSets().

93  {
94  return CTPPSDetId( rawId() & (~lowMaskStation) );
95  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
static const uint32_t lowMaskStation
Definition: CTPPSDetId.h:47
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:31
uint32_t CTPPSDetId::rp ( ) const
inline

Definition at line 74 of file CTPPSDetId.h.

References DetId::id_, maskRP, and startRPBit.

Referenced by TotemRPDQMSource::analyze(), TotemRPDetId::getRPDecimalId(), and rpName().

75  {
76  return ((id_>>startRPBit) & maskRP);
77  }
static const uint32_t startRPBit
Definition: CTPPSDetId.h:48
static const uint32_t maskRP
Definition: CTPPSDetId.h:48
uint32_t id_
Definition: DetId.h:55
void CTPPSDetId::rpName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 139 of file CTPPSDetId.h.

References nFull, nPath, nShort, rp(), rpNames, and stationName().

Referenced by TotemRPDQMHarvester::MakeHitNumberRatios(), TotemRPDQMHarvester::MakePlaneEfficiencyHistograms(), CTPPSDiamondDetId::planeName(), TotemRPDetId::planeName(), and TotemRPDQMSource::PotPlots::PotPlots().

140  {
141  switch (flag)
142  {
143  case nShort: name = ""; break;
144  case nFull: stationName(name, flag); name += "_"; break;
145  case nPath: stationName(name, flag); name += "/"; break;
146  }
147 
148  name += rpNames[rp()];
149  }
static const std::string rpNames[]
Definition: CTPPSDetId.h:156
void stationName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:127
uint32_t rp() const
Definition: CTPPSDetId.h:74
void CTPPSDetId::setArm ( uint32_t  arm)
inline

Definition at line 57 of file CTPPSDetId.h.

References DetId::id_, maskArm, and startArmBit.

58  {
59  id_ &= ~(maskArm << startArmBit);
60  id_ |= ((arm & maskArm) << startArmBit);
61  }
static const uint32_t maskArm
Definition: CTPPSDetId.h:46
uint32_t arm() const
Definition: CTPPSDetId.h:52
uint32_t id_
Definition: DetId.h:55
static const uint32_t startArmBit
Definition: CTPPSDetId.h:46
void CTPPSDetId::setRP ( uint32_t  rp)
inline

Definition at line 79 of file CTPPSDetId.h.

References DetId::id_, maskRP, and startRPBit.

80  {
81  id_ &= ~(maskRP << startRPBit);
82  id_ |= ((rp & maskRP) << startRPBit);
83  }
static const uint32_t startRPBit
Definition: CTPPSDetId.h:48
static const uint32_t maskRP
Definition: CTPPSDetId.h:48
uint32_t id_
Definition: DetId.h:55
uint32_t rp() const
Definition: CTPPSDetId.h:74
void CTPPSDetId::setStation ( uint32_t  station)
inline

Definition at line 68 of file CTPPSDetId.h.

References DetId::id_, maskStation, and startStationBit.

69  {
72  }
uint32_t station() const
Definition: CTPPSDetId.h:63
static const uint32_t maskStation
Definition: CTPPSDetId.h:47
uint32_t id_
Definition: DetId.h:55
static const uint32_t startStationBit
Definition: CTPPSDetId.h:47
uint32_t CTPPSDetId::station ( ) const
inline

Definition at line 63 of file CTPPSDetId.h.

References DetId::id_, maskStation, and startStationBit.

Referenced by TotemRPDetId::getRPDecimalId(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), and stationName().

64  {
65  return ((id_>>startStationBit) & maskStation);
66  }
static const uint32_t maskStation
Definition: CTPPSDetId.h:47
uint32_t id_
Definition: DetId.h:55
static const uint32_t startStationBit
Definition: CTPPSDetId.h:47
void CTPPSDetId::stationName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 127 of file CTPPSDetId.h.

References armName(), nFull, nPath, nShort, station(), and stationNames.

Referenced by rpName(), and TotemRPDQMSource::StationPlots::StationPlots().

128  {
129  switch (flag)
130  {
131  case nShort: name = ""; break;
132  case nFull: armName(name, flag); name += "_"; break;
133  case nPath: armName(name, flag); name += "/station "; break;
134  }
135 
136  name += stationNames[station()];
137  }
uint32_t station() const
Definition: CTPPSDetId.h:63
void armName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:115
static const std::string stationNames[]
Definition: CTPPSDetId.h:155
void CTPPSDetId::subDetectorName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 107 of file CTPPSDetId.h.

References nPath, subDetectorNames, subDetectorPaths, and DetId::subdetId().

Referenced by armName().

108  {
109  if (flag == nPath)
111  else
113  }
static const std::string subDetectorPaths[]
Definition: CTPPSDetId.h:153
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
static const std::string subDetectorNames[]
Definition: CTPPSDetId.h:152

Member Data Documentation

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

Definition at line 154 of file CTPPSDetId.h.

Referenced by armName().

const uint32_t CTPPSDetId::lowMaskArm = 0xFFFFFF
static

Definition at line 46 of file CTPPSDetId.h.

Referenced by getArmId().

const uint32_t CTPPSDetId::lowMaskRP = 0x7FFFF
static

Definition at line 48 of file CTPPSDetId.h.

Referenced by getRPId().

const uint32_t CTPPSDetId::lowMaskStation = 0x3FFFFF
static

Definition at line 47 of file CTPPSDetId.h.

Referenced by getStationId().

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

Referenced by stationName().

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

Definition at line 152 of file CTPPSDetId.h.

Referenced by subDetectorName().

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

Definition at line 153 of file CTPPSDetId.h.

Referenced by subDetectorName().