CMS 3D CMS Logo

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

Detector ID class for TOTEM Si strip detectors. More...

#include <TotemRPDetId.h>

Inheritance diagram for TotemRPDetId:
CTPPSDetId DetId

Public Member Functions

uint32_t chip () const
 
void chipName (std::string &name, NameFlag flag=nFull) const
 
bool isStripsCoordinateUDirection () const
 
bool isStripsCoordinateVDirection () const
 
uint32_t plane () const
 
uint32_t planeDecimalId () const
 
TotemRPDetId planeId () const
 
void planeName (std::string &name, NameFlag flag=nFull) const
 
uint32_t rpDecimalId () const
 
void setChip (uint32_t chip)
 
void setPlane (uint32_t det)
 
 TotemRPDetId (const CTPPSDetId &id)
 
 TotemRPDetId (uint32_t Arm, uint32_t Station, uint32_t RomanPot=0, uint32_t Plane=0, uint32_t Chip=0)
 Construct from hierarchy indeces. More...
 
 TotemRPDetId (uint32_t id)
 
- 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 Attributes

static const uint32_t lowMaskChip = 0x1FFF
 
static const uint32_t lowMaskPlane = 0x7FFF
 
static const uint32_t maskChip = 0x3
 
static const uint32_t maskPlane = 0xF
 
static const uint32_t maxChip = 3
 
static const uint32_t maxPlane = 9
 
static const uint32_t startChipBit = 13
 
static const uint32_t startPlaneBit = 15
 
- 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
 

Static Private Attributes

static const std::string chipNames [] = {"1", "2", "3", "4"}
 
static const std::string planeNames [] = {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10"}
 

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 TOTEM Si strip detectors.

Beyond the bit assignment in CTPPSDetId, this is the additional structure: Bits [15:18] => plane number from 0 (most near) to 9 (most far) Bits [13:14] => chip (VFAT) number Bits [0:12] => not assigned

Definition at line 29 of file TotemRPDetId.h.

Constructor & Destructor Documentation

◆ TotemRPDetId() [1/3]

TotemRPDetId::TotemRPDetId ( uint32_t  id)
explicit

Construct from a raw id. It is required that the Detector part of id is Totem and the SubDet part is RP, otherwise an exception is thrown.

Definition at line 27 of file TotemRPDetId.cc.

28  : CTPPSDetId(id) {
29  bool inputOK = (det() == DetId::VeryForward && subdetId() == sdTrackingStrip);
30 
31  if (!inputOK) {
32  throw cms::Exception("InvalidDetId") << "TotemRPDetId ctor:"
33  << " det: " << det() << " subdet: " << subdetId()
34  << " is not a valid TotemRP id.";
35  }

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

Referenced by setChip().

◆ TotemRPDetId() [2/3]

TotemRPDetId::TotemRPDetId ( const CTPPSDetId id)
inline

Definition at line 41 of file TotemRPDetId.h.

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

◆ TotemRPDetId() [3/3]

TotemRPDetId::TotemRPDetId ( uint32_t  Arm,
uint32_t  Station,
uint32_t  RomanPot = 0,
uint32_t  Plane = 0,
uint32_t  Chip = 0 
)

Construct from hierarchy indeces.

Definition at line 39 of file TotemRPDetId.cc.

41  : CTPPSDetId(sdTrackingStrip, Arm, Station, RomanPot) {
42  if (Arm > maxArm || Station > maxStation || RomanPot > maxRP || Plane > maxPlane || Chip > maxChip) {
43  throw cms::Exception("InvalidDetId") << "TotemRPDetId ctor:"
44  << " Invalid parameters:"
45  << " arm=" << Arm << " station=" << Station << " rp=" << RomanPot
46  << " plane=" << Plane << " chip=" << Chip << std::endl;
47  }
48 
49  uint32_t ok = 0xfe000000;
50  id_ &= ok;
51 
52  id_ |= ((Arm & maskArm) << startArmBit);
53  id_ |= ((Station & maskStation) << startStationBit);
54  id_ |= ((RomanPot & maskRP) << startRPBit);
55  id_ |= ((Plane & maskPlane) << startPlaneBit);
56  id_ |= ((Chip & maskChip) << startChipBit);

References Exception, DetId::id_, CTPPSDetId::maskArm, maskChip, maskPlane, CTPPSDetId::maskRP, CTPPSDetId::maskStation, CTPPSDetId::maxArm, maxChip, maxPlane, CTPPSDetId::maxRP, CTPPSDetId::maxStation, convertSQLiteXML::ok, CTPPSDetId::startArmBit, startChipBit, startPlaneBit, CTPPSDetId::startRPBit, and CTPPSDetId::startStationBit.

Member Function Documentation

◆ chip()

uint32_t TotemRPDetId::chip ( ) const
inline

Definition at line 58 of file TotemRPDetId.h.

62 { return TotemRPDetId(rawId() & (~lowMaskPlane)); }

Referenced by RawToDigiConverter::run().

◆ chipName()

void TotemRPDetId::chipName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 102 of file TotemRPDetId.h.

102  :
103  planeName(name, flag);
104  name += "_";
105  break;
106  case nPath:
107  planeName(name, flag);
108  name += "/chip ";
109  break;
110  }
111 
112  name += chipNames[chip()];
113  }
114 
115 private:
116  static const std::string planeNames[];
117  static const std::string chipNames[];
118 };

◆ isStripsCoordinateUDirection()

bool TotemRPDetId::isStripsCoordinateUDirection ( ) const
inline

Definition at line 71 of file TotemRPDetId.h.

73 { return rp() + station() * 10 + arm() * 100; }

Referenced by TotemRPDQMSource::analyze(), and planeId().

◆ isStripsCoordinateVDirection()

bool TotemRPDetId::isStripsCoordinateVDirection ( ) const
inline

Definition at line 73 of file TotemRPDetId.h.

73 { return rp() + station() * 10 + arm() * 100; }

References CTPPSDetId::arm(), CTPPSDetId::rp(), and CTPPSDetId::station().

◆ plane()

uint32_t TotemRPDetId::plane ( ) const
inline

◆ planeDecimalId()

uint32_t TotemRPDetId::planeDecimalId ( ) const
inline

Definition at line 80 of file TotemRPDetId.h.

80 {

References Skims_PA_cff::name, and CTPPSDetId::nShort.

◆ planeId()

TotemRPDetId TotemRPDetId::planeId ( ) const
inline

Definition at line 67 of file TotemRPDetId.h.

68 { return !isStripsCoordinateUDirection(); }

References isStripsCoordinateUDirection().

Referenced by RawToDigiConverter::run().

◆ planeName()

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

Definition at line 84 of file TotemRPDetId.h.

84  :
85  rpName(name, flag);
86  name += "_";
87  break;
88  case nPath:
89  rpName(name, flag);
90  name += "/plane ";
91  break;
92  }
93 
94  name += planeNames[plane()];
95  }
96 
97  inline void chipName(std::string& name, NameFlag flag = nFull) const {
98  switch (flag) {
99  case nShort:
100  name = "";

Referenced by TotemRPDQMHarvester::MakePlaneEfficiencyHistograms(), and TotemRPDQMSource::PlanePlots::PlanePlots().

◆ rpDecimalId()

uint32_t TotemRPDetId::rpDecimalId ( ) const
inline

Definition at line 78 of file TotemRPDetId.h.

◆ setChip()

void TotemRPDetId::setChip ( uint32_t  chip)
inline

Definition at line 60 of file TotemRPDetId.h.

62  { return TotemRPDetId(rawId() & (~lowMaskPlane)); }
63 

References lowMaskPlane, DetId::rawId(), and TotemRPDetId().

◆ setPlane()

void TotemRPDetId::setPlane ( uint32_t  det)
inline

Definition at line 53 of file TotemRPDetId.h.

53  { return ((id_ >> startChipBit) & maskChip); }
54 
55  void setChip(uint32_t chip) {
56  id_ &= ~(maskChip << startChipBit);

References DetId::id_, maskChip, and startChipBit.

Referenced by TotemRPDQMSource::analyze(), and TotemTimingDQMSource::analyze().

Member Data Documentation

◆ chipNames

const string TotemRPDetId::chipNames = {"1", "2", "3", "4"}
staticprivate

Definition at line 122 of file TotemRPDetId.h.

◆ lowMaskChip

const uint32_t TotemRPDetId::lowMaskChip = 0x1FFF
static

Definition at line 47 of file TotemRPDetId.h.

◆ lowMaskPlane

const uint32_t TotemRPDetId::lowMaskPlane = 0x7FFF
static

Definition at line 46 of file TotemRPDetId.h.

Referenced by setChip().

◆ maskChip

const uint32_t TotemRPDetId::maskChip = 0x3
static

Definition at line 47 of file TotemRPDetId.h.

Referenced by setPlane(), and TotemRPDetId().

◆ maskPlane

const uint32_t TotemRPDetId::maskPlane = 0xF
static

Definition at line 46 of file TotemRPDetId.h.

Referenced by RPDisplacementGenerator::rawToDecId(), and TotemRPDetId().

◆ maxChip

const uint32_t TotemRPDetId::maxChip = 3
static

Definition at line 47 of file TotemRPDetId.h.

Referenced by TotemRPDetId().

◆ maxPlane

const uint32_t TotemRPDetId::maxPlane = 9
static

Definition at line 46 of file TotemRPDetId.h.

Referenced by TotemRPDetId().

◆ planeNames

const string TotemRPDetId::planeNames = {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10"}
staticprivate

Definition at line 121 of file TotemRPDetId.h.

◆ startChipBit

const uint32_t TotemRPDetId::startChipBit = 13
static

Definition at line 47 of file TotemRPDetId.h.

Referenced by setPlane(), and TotemRPDetId().

◆ startPlaneBit

const uint32_t TotemRPDetId::startPlaneBit = 15
static

Definition at line 46 of file TotemRPDetId.h.

Referenced by RPDisplacementGenerator::rawToDecId(), and TotemRPDetId().

TotemRPDetId::lowMaskPlane
static const uint32_t lowMaskPlane
Definition: TotemRPDetId.h:46
CTPPSDetId::rp
uint32_t rp() const
Definition: CTPPSDetId.h:69
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
TotemRPDetId::maskChip
static const uint32_t maskChip
Definition: TotemRPDetId.h:47
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::nShort
Definition: CTPPSDetId.h:87
TotemRPDetId::plane
uint32_t plane() const
Definition: TotemRPDetId.h:51
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::nPath
Definition: CTPPSDetId.h:87
TotemRPDetId::isStripsCoordinateUDirection
bool isStripsCoordinateUDirection() const
Definition: TotemRPDetId.h:71
TotemRPDetId::planeName
void planeName(std::string &name, NameFlag flag=nFull) const
Definition: TotemRPDetId.h:84
TotemRPDetId::startPlaneBit
static const uint32_t startPlaneBit
Definition: TotemRPDetId.h:46
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
TotemRPDetId::maxPlane
static const uint32_t maxPlane
Definition: TotemRPDetId.h:46
TotemRPDetId::startChipBit
static const uint32_t startChipBit
Definition: TotemRPDetId.h:47
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
TotemRPDetId::chipNames
static const std::string chipNames[]
Definition: TotemRPDetId.h:122
CTPPSDetId::arm
uint32_t arm() const
Definition: CTPPSDetId.h:55
CTPPSDetId::NameFlag
NameFlag
type of name returned by *Name functions
Definition: CTPPSDetId.h:87
TotemRPDetId::chip
uint32_t chip() const
Definition: TotemRPDetId.h:58
DetId::id_
uint32_t id_
Definition: DetId.h:69
TotemRPDetId::planeNames
static const std::string planeNames[]
Definition: TotemRPDetId.h:121
CTPPSDetId::nFull
Definition: CTPPSDetId.h:87
TotemRPDetId::maxChip
static const uint32_t maxChip
Definition: TotemRPDetId.h:47
TotemRPDetId::setChip
void setChip(uint32_t chip)
Definition: TotemRPDetId.h:60
CTPPSDetId::maskStation
static const uint32_t maskStation
Definition: CTPPSDetId.h:50
CTPPSDetId::maxStation
static const uint32_t maxStation
Definition: CTPPSDetId.h:50
TotemRPDetId::TotemRPDetId
TotemRPDetId(uint32_t id)
Definition: TotemRPDetId.cc:27
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
TotemRPDetId::chipName
void chipName(std::string &name, NameFlag flag=nFull) const
Definition: TotemRPDetId.h:102
TotemRPDetId::maskPlane
static const uint32_t maskPlane
Definition: TotemRPDetId.h:46
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
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