CMS 3D CMS Logo

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

◆ chamberName()

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

Definition at line 38 of file RPCNameHelper.cc.

References hcalRecHitTable_cff::detId, dqm-mbProfile::format, nano_mu_digi_cff::layer, nsub, nano_mu_digi_cff::region, relativeConstraints::ring, nano_mu_digi_cff::roll, nano_mu_digi_cff::sector, relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, nano_mu_digi_cff::subsector, and makeMuonMisalignmentScenario::wheel.

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

◆ name()

std::string RPCNameHelper::name ( const RPCDetId detId,
const bool  useRoll 
)
static

◆ regionName()

std::string RPCNameHelper::regionName ( const int  region)
static

Definition at line 76 of file RPCNameHelper.cc.

References nano_mu_digi_cff::region, and 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

◆ rollName()

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

Definition at line 10 of file RPCNameHelper.cc.

References chamberName(), hcalRecHitTable_cff::detId, nano_mu_digi_cff::region, nano_mu_digi_cff::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 }
static std::string chamberName(const RPCDetId &detId)

Member Data Documentation

◆ regionNames

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

Definition at line 14 of file RPCNameHelper.h.

Referenced by regionName().