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
 
uint32_t getPlaneDecimalId () const
 
TotemRPDetId getPlaneId () const
 
uint32_t getRPDecimalId () const
 
bool isStripsCoordinateUDirection () const
 
bool isStripsCoordinateVDirection () const
 
uint32_t plane () const
 
void planeName (std::string &name, NameFlag flag=nFull) const
 
void setChip (uint32_t chip)
 
void setPlane (uint32_t det)
 
 TotemRPDetId (uint32_t id)
 
 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...
 
- Public Member Functions inherited from CTPPSDetId
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 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 kDetOffset = 28
 
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
}
 
- 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 30 of file TotemRPDetId.h.

Constructor & Destructor Documentation

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.

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

Referenced by getPlaneId(), and TotemRPDetId().

27  : CTPPSDetId(id)
28 {
29  bool inputOK = (det() == DetId::VeryForward && subdetId() == sdTrackingStrip);
30 
31  if (!inputOK)
32  {
33  throw cms::Exception("InvalidDetId") << "TotemRPDetId ctor:"
34  << " det: " << det()
35  << " subdet: " << subdetId()
36  << " is not a valid TotemRP id.";
37  }
38 }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:38
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:31
Detector det() const
get the detector field from this detid
Definition: DetId.h:36
TotemRPDetId::TotemRPDetId ( const CTPPSDetId id)
inline

Definition at line 37 of file TotemRPDetId.h.

References TotemRPDetId().

37  : CTPPSDetId(id)
38  {
39  }
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:31
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 42 of file TotemRPDetId.cc.

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.

42  :
43  CTPPSDetId(sdTrackingStrip, Arm, Station, RomanPot)
44 {
45  if (Arm > maxArm || Station > maxStation || RomanPot > maxRP || Plane > maxPlane || Chip > maxChip)
46  {
47  throw cms::Exception("InvalidDetId") << "TotemRPDetId ctor:"
48  << " Invalid parameters:"
49  << " arm=" << Arm
50  << " station=" << Station
51  << " rp=" << RomanPot
52  << " plane=" << Plane
53  << " chip=" << Chip
54  << std::endl;
55  }
56 
57  uint32_t ok=0xfe000000;
58  id_ &= ok;
59 
60  id_ |= ((Arm & maskArm) << startArmBit);
61  id_ |= ((Station & maskStation) << startStationBit);
62  id_ |= ((RomanPot & maskRP) << startRPBit);
63  id_ |= ((Plane & maskPlane) << startPlaneBit);
64  id_ |= ((Chip & maskChip) << startChipBit);
65 }
static const uint32_t maskChip
Definition: TotemRPDetId.h:45
static const uint32_t startChipBit
Definition: TotemRPDetId.h:45
static const uint32_t maxStation
Definition: CTPPSDetId.h:47
static const uint32_t startRPBit
Definition: CTPPSDetId.h:48
Definition: Plane.h:17
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:56
static const uint32_t startStationBit
Definition: CTPPSDetId.h:47
CTPPSDetId(uint32_t id)
Construct from a raw id.
Definition: CTPPSDetId.cc:31
static const uint32_t startPlaneBit
Definition: TotemRPDetId.h:44
static const uint32_t startArmBit
Definition: CTPPSDetId.h:46
static const uint32_t maxChip
Definition: TotemRPDetId.h:45
static const uint32_t maskPlane
Definition: TotemRPDetId.h:44
static const uint32_t maxPlane
Definition: TotemRPDetId.h:44

Member Function Documentation

uint32_t TotemRPDetId::chip ( ) const
inline

Definition at line 60 of file TotemRPDetId.h.

References DetId::id_.

Referenced by chipName(), and RawToDigiConverter::Run().

61  {
62  return ((id_>>startChipBit) & maskChip);
63  }
static const uint32_t maskChip
Definition: TotemRPDetId.h:45
static const uint32_t startChipBit
Definition: TotemRPDetId.h:45
uint32_t id_
Definition: DetId.h:56
void TotemRPDetId::chipName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 117 of file TotemRPDetId.h.

References chip(), chipNames, RemoveAddSevLevel::flag, CTPPSDetId::nFull, CTPPSDetId::nPath, CTPPSDetId::nShort, and planeName().

118  {
119  switch (flag)
120  {
121  case nShort: name = ""; break;
122  case nFull: planeName(name, flag); name += "_"; break;
123  case nPath: planeName(name, flag); name += "/chip "; break;
124  }
125 
126  name += chipNames[chip()];
127  }
uint32_t chip() const
Definition: TotemRPDetId.h:60
void planeName(std::string &name, NameFlag flag=nFull) const
Definition: TotemRPDetId.h:105
static const std::string chipNames[]
Definition: TotemRPDetId.h:131
uint32_t TotemRPDetId::getPlaneDecimalId ( ) const
inline

Definition at line 98 of file TotemRPDetId.h.

References getRPDecimalId(), and plane().

99  {
100  return plane() + getRPDecimalId()*10;
101  }
uint32_t getRPDecimalId() const
Definition: TotemRPDetId.h:93
uint32_t plane() const
Definition: TotemRPDetId.h:49
TotemRPDetId TotemRPDetId::getPlaneId ( ) const
inline

Definition at line 73 of file TotemRPDetId.h.

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

Referenced by RawToDigiConverter::Run().

74  {
75  return TotemRPDetId( rawId() & (~lowMaskPlane) );
76  }
TotemRPDetId(uint32_t id)
Definition: TotemRPDetId.cc:27
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
static const uint32_t lowMaskPlane
Definition: TotemRPDetId.h:44
uint32_t TotemRPDetId::getRPDecimalId ( ) const
inline

Definition at line 93 of file TotemRPDetId.h.

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

Referenced by getPlaneDecimalId().

94  {
95  return rp() + station()*10 + arm()*100;
96  }
uint32_t station() const
Definition: CTPPSDetId.h:63
uint32_t arm() const
Definition: CTPPSDetId.h:52
uint32_t rp() const
Definition: CTPPSDetId.h:74
bool TotemRPDetId::isStripsCoordinateUDirection ( ) const
inline

Definition at line 80 of file TotemRPDetId.h.

References plane().

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

81  {
82  return plane() % 2;
83  }
uint32_t plane() const
Definition: TotemRPDetId.h:49
bool TotemRPDetId::isStripsCoordinateVDirection ( ) const
inline

Definition at line 85 of file TotemRPDetId.h.

References isStripsCoordinateUDirection().

86  {
88  }
bool isStripsCoordinateUDirection() const
Definition: TotemRPDetId.h:80
uint32_t TotemRPDetId::plane ( ) const
inline
void TotemRPDetId::planeName ( std::string &  name,
NameFlag  flag = nFull 
) const
inline

Definition at line 105 of file TotemRPDetId.h.

References RemoveAddSevLevel::flag, CTPPSDetId::nFull, CTPPSDetId::nPath, CTPPSDetId::nShort, plane(), planeNames, and CTPPSDetId::rpName().

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

106  {
107  switch (flag)
108  {
109  case nShort: name = ""; break;
110  case nFull: rpName(name, flag); name += "_"; break;
111  case nPath: rpName(name, flag); name += "/plane "; break;
112  }
113 
114  name += planeNames[plane()];
115  }
uint32_t plane() const
Definition: TotemRPDetId.h:49
void rpName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:139
static const std::string planeNames[]
Definition: TotemRPDetId.h:130
void TotemRPDetId::setChip ( uint32_t  chip)
inline

Definition at line 65 of file TotemRPDetId.h.

References DetId::id_, maskChip, and startChipBit.

66  {
67  id_ &= ~(maskChip << startChipBit);
68  id_ |= ((chip & maskChip) << startChipBit);
69  }
static const uint32_t maskChip
Definition: TotemRPDetId.h:45
static const uint32_t startChipBit
Definition: TotemRPDetId.h:45
uint32_t chip() const
Definition: TotemRPDetId.h:60
uint32_t id_
Definition: DetId.h:56
void TotemRPDetId::setPlane ( uint32_t  det)
inline

Definition at line 54 of file TotemRPDetId.h.

References DetId::id_, maskPlane, and startPlaneBit.

Referenced by TotemRPDQMSource::analyze().

55  {
56  id_ &= ~(maskPlane << startPlaneBit);
57  id_ |= ((det & maskPlane) << startPlaneBit);
58  }
uint32_t id_
Definition: DetId.h:56
static const uint32_t startPlaneBit
Definition: TotemRPDetId.h:44
static const uint32_t maskPlane
Definition: TotemRPDetId.h:44
Detector det() const
get the detector field from this detid
Definition: DetId.h:36

Member Data Documentation

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

Definition at line 131 of file TotemRPDetId.h.

Referenced by chipName().

const uint32_t TotemRPDetId::lowMaskChip = 0x1FFF
static

Definition at line 45 of file TotemRPDetId.h.

const uint32_t TotemRPDetId::lowMaskPlane = 0x7FFF
static

Definition at line 44 of file TotemRPDetId.h.

const uint32_t TotemRPDetId::maskChip = 0x3
static

Definition at line 45 of file TotemRPDetId.h.

Referenced by setChip(), and TotemRPDetId().

const uint32_t TotemRPDetId::maskPlane = 0xF
static

Definition at line 44 of file TotemRPDetId.h.

Referenced by setPlane(), and TotemRPDetId().

const uint32_t TotemRPDetId::maxChip = 3
static

Definition at line 45 of file TotemRPDetId.h.

Referenced by TotemRPDetId().

const uint32_t TotemRPDetId::maxPlane = 9
static

Definition at line 44 of file TotemRPDetId.h.

Referenced by TotemRPDetId().

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

Definition at line 130 of file TotemRPDetId.h.

Referenced by planeName().

const uint32_t TotemRPDetId::startChipBit = 13
static

Definition at line 45 of file TotemRPDetId.h.

Referenced by setChip(), and TotemRPDetId().

const uint32_t TotemRPDetId::startPlaneBit = 15
static

Definition at line 44 of file TotemRPDetId.h.

Referenced by setPlane(), and TotemRPDetId().