CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Static Public Member Functions | Static Public Attributes
RPCNameHelper Struct Reference

#include <RPCNameHelper.h>

Static Public Member Functions

static std::string chamberName (const RPCDetId &detId)
 
static std::string name (const RPCDetId &detId, const bool useRoll)
 
static std::string regionName (const int region)
 
static std::string rollName (const RPCDetId &detId)
 

Static Public Attributes

static const std::array
< std::string, 3 > 
regionNames = {{"Endcap-", "Barrel", "Endcap+"}}
 

Detailed Description

Definition at line 8 of file RPCNameHelper.h.

Member Function Documentation

std::string RPCNameHelper::chamberName ( const RPCDetId detId)
static

Definition at line 38 of file RPCNameHelper.cc.

References diffTreeTool::format(), RPCDetId::layer(), phase1PixelTopology::layer, nsub, RPCDetId::region(), HLT_FULL_cff::region, RPCDetId::ring(), relativeConstraints::ring, RPCDetId::sector(), relativeConstraints::station, RPCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, and RPCDetId::subsector().

Referenced by RPCMonitorDigi::bookHistograms(), name(), and rollName().

38  {
39  const int region = detId.region();
40  const int sector = detId.sector();
41  if (region != 0) {
42  // Endcap
43  const int disk = detId.region() * detId.station();
44  const int ring = detId.ring();
45  const int nsub = (ring == 1 and detId.station() > 1) ? 3 : 6;
46  const int segment = detId.subsector() + (detId.sector() - 1) * nsub;
47 
48  return fmt::format("RE{:+2d}_R{}_CH{:02d}", disk, ring, segment);
49  } else {
50  // Barrel
51  const int wheel = detId.ring();
52  const int station = detId.station();
53  const int layer = detId.layer();
54  const int subsector = detId.subsector();
55 
56  std::string roll;
57  if (station <= 2) {
58  roll = (layer == 1) ? "in" : "out";
59  } else if (station == 3) {
60  roll = (subsector == 1) ? "-" : "+";
61  } else { // station == 4
62  if (sector == 4) {
63  const static std::array<std::string, 4> ssarr = {{"--", "-", "+", "++"}};
64  roll = ssarr[subsector - 1];
65  } else if (sector != 9 && sector != 11) {
66  roll = (subsector == 1) ? "-" : "+";
67  }
68  }
69 
70  return fmt::format("W{:+2d}_RB{:d}{}_S{:02d}", wheel, station, roll, sector);
71  }
72 
73  return "";
74 }
const int nsub
constexpr std::array< uint8_t, layerIndexSize > layer
int ring() const
Definition: RPCDetId.h:59
int layer() const
Definition: RPCDetId.h:85
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:88
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
int station() const
Definition: RPCDetId.h:78
std::string RPCNameHelper::name ( const RPCDetId detId,
const bool  useRoll 
)
static
std::string RPCNameHelper::regionName ( const int  region)
static

Definition at line 76 of file RPCNameHelper.cc.

References regionNames.

76  {
77  if (region < -1 or region > 1)
78  return "";
79  return regionNames[region + 1];
80 }
static const std::array< std::string, 3 > regionNames
Definition: RPCNameHelper.h:14
std::string RPCNameHelper::rollName ( const RPCDetId detId)
static

Definition at line 10 of file RPCNameHelper.cc.

References chamberName(), RPCDetId::region(), HLT_FULL_cff::region, RPCDetId::roll(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by RPCMonitorDigi::bookHistograms(), and name().

10  {
11  std::string chName = chamberName(detId);
12  const int region = detId.region();
13  const int roll = detId.roll();
14 
15  if (region == 0) {
16  if (roll == 1)
17  chName += "_Backward";
18  else if (roll == 3)
19  chName += "_Forward";
20  else
21  chName += "_Middle";
22  } else {
23  if (roll == 1)
24  chName += "_A";
25  else if (roll == 2)
26  chName += "_B";
27  else if (roll == 3)
28  chName += "_C";
29  else if (roll == 4)
30  chName += "_D";
31  else if (roll == 5)
32  chName += "_E";
33  }
34 
35  return chName;
36 }
int roll() const
Definition: RPCDetId.h:92
static std::string chamberName(const RPCDetId &detId)
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53

Member Data Documentation

const std::array< std::string, 3 > RPCNameHelper::regionNames = {{"Endcap-", "Barrel", "Endcap+"}}
static

Definition at line 14 of file RPCNameHelper.h.

Referenced by regionName().