CMS 3D CMS Logo

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

#include <GEMNumberingScheme.h>

Inheritance diagram for GEMNumberingScheme:
MuonNumberingScheme

Public Member Functions

int baseNumberToUnitNumber (const MuonBaseNumber &) const override
 
 GEMNumberingScheme (const MuonGeometryConstants &muonConstants)
 
 ~GEMNumberingScheme () override
 
- Public Member Functions inherited from MuonNumberingScheme
 MuonNumberingScheme ()
 
virtual ~MuonNumberingScheme ()
 

Private Member Functions

void initMe (const MuonGeometryConstants &muonConstants)
 

Private Attributes

int theRegionLevel
 
int theRingLevel
 
int theRollLevel
 
int theSectorLevel
 
int theStationLevel
 

Detailed Description

Definition at line 9 of file GEMNumberingScheme.h.

Constructor & Destructor Documentation

◆ GEMNumberingScheme()

GEMNumberingScheme::GEMNumberingScheme ( const MuonGeometryConstants muonConstants)

Definition at line 9 of file GEMNumberingScheme.cc.

References initMe().

9 { initMe(muonConstants); }
void initMe(const MuonGeometryConstants &muonConstants)

◆ ~GEMNumberingScheme()

GEMNumberingScheme::~GEMNumberingScheme ( )
inlineoverride

Definition at line 13 of file GEMNumberingScheme.h.

13 {};

Member Function Documentation

◆ baseNumberToUnitNumber()

int GEMNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num) const
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 26 of file GEMNumberingScheme.cc.

References relativeConstraints::chamber, l1ctLayer2EG_cff::id, phase1PixelTopology::layer, personalPlayback::level, GCP_tree_cfg::levels, GEMDetId::minChamberId, GEMDetId::minLayerId, GEMDetId::minRegionId, GEMDetId::minRingId, GEMDetId::minRollId, GEMDetId::minStationId0, EgammaValidation_cff::num, HLT_2022v15_cff::region, relativeConstraints::ring, relativeConstraints::station, theRegionLevel, theRingLevel, theRollLevel, theSectorLevel, and theStationLevel.

Referenced by GEMGeometryBuilder::build(), and GEMGeometryParsFromDD::buildGeometry().

26  {
27 #ifdef EDM_ML_DEBUG
28  edm::LogVerbatim("MuonGeom") << "GEMNumbering " << num.getLevels();
29  for (int level = 1; level <= num.getLevels(); level++) {
30  edm::LogVerbatim("MuonGeom") << level << " " << num.getSuperNo(level) << " " << num.getBaseNo(level);
31  }
32 #endif
33 
34  int levels = num.getLevels();
35 #ifdef EDM_ML_DEBUG
36  if (levels != theRollLevel)
37  edm::LogVerbatim("MuonGeom") << "MuonGEMNumberingScheme::BNToUN: BaseNumber has " << num.getLevels()
38  << " levels, need at least till " << theRollLevel;
39 #endif
40 
44 
45  //decode significant GEM levels
46 
47  if (levels >= theRegionLevel) {
48  if (num.getBaseNo(theRegionLevel) == 0)
49  region = 1;
50  else
51  region = -1;
52  }
53 
54  // All GEM super chambers in stations 1 and 2 are on ring 1.
55  // The long super chambers in station 2 are assigned *station 3* due
56  // to the current limitation in the definition of the GEMDetId,
57  // i.e. only 2 layers available per station.
58  // ring = num.getSuperNo(theRingLevel);
59  // GEM are only on the first ring
60  ring = 1;
61 
62  // GE0 has the layer encoded in the ring level
63  if (levels > theRingLevel) {
64  if (num.getBaseNo(theRingLevel) == 0) { // 0 => GE1/1, GE2/1
65  station = num.getSuperNo(theStationLevel);
66 #ifdef EDM_ML_DEBUG
67  edm::LogVerbatim("MuonGeom") << "GEMNumbering: Ring " << ring << " Station " << num.getSuperNo(theStationLevel)
68  << ":" << station;
69 #endif
70  if (levels >= theRollLevel)
71  roll = num.getBaseNo(theRollLevel) + 1;
72  if (levels >= theSectorLevel) {
73  const int copyno = num.getBaseNo(theSectorLevel) + 1;
74  // Half the chambers are flipped back to front, this is encoded in
75  // the chamber number, which affects the layer numbering. Layer 1
76  // is always the closest layer to the interaction point.
77  const int layerDemarcation = 50;
78  if (copyno < layerDemarcation) {
79  if (copyno % 2 == 0) {
80  layer = 2;
81  chamber = copyno - 1;
82  } else {
83  layer = 1;
84  chamber = copyno;
85  }
86  } else {
87  int copynp = copyno - layerDemarcation;
88  if (copynp % 2 != 0) {
89  layer = 2;
90  chamber = copynp - 1;
91  } else {
92  layer = 1;
93  chamber = copynp;
94  }
95  }
96  }
97  } else { // GE0 encodes the layer
99  layer = num.getBaseNo(theRingLevel);
100  if (levels >= theSectorLevel)
101  chamber = num.getBaseNo(theSectorLevel) + 1;
102  if (levels >= theRollLevel)
103  roll = num.getBaseNo(theRollLevel) + 1;
104  }
105  } else if (levels == theRingLevel) {
107  layer = 1;
108  }
109 
110  // collect all info
111 
112 #ifdef EDM_ML_DEBUG
113  edm::LogVerbatim("MuonGeom") << "GEMNumberingScheme: Region " << region << " Ring " << ring << " Station " << station
114  << " Layer " << layer << " Chamber " << chamber << " Roll " << roll;
115 #endif
116 
117  // Build the actual numbering
119 
120 #ifdef EDM_ML_DEBUG
121  edm::LogVerbatim("MuonGeom") << id.rawId() << " DetId " << id;
122 #endif
123 
124  return id.rawId();
125 }
Log< level::Info, true > LogVerbatim
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr int32_t minStationId0
Definition: GEMDetId.h:24
static constexpr int32_t minRingId
Definition: GEMDetId.h:22
static constexpr int32_t minRollId
Definition: GEMDetId.h:35
static constexpr int32_t minChamberId
Definition: GEMDetId.h:28
static constexpr int32_t minLayerId
Definition: GEMDetId.h:30
static constexpr int32_t minRegionId
Definition: GEMDetId.h:20

◆ initMe()

void GEMNumberingScheme::initMe ( const MuonGeometryConstants muonConstants)
private

Definition at line 11 of file GEMNumberingScheme.cc.

References MuonGeometryConstants::getValue(), theRegionLevel, theRingLevel, theRollLevel, theSectorLevel, and theStationLevel.

Referenced by GEMNumberingScheme().

11  {
12  int theLevelPart = muonConstants.getValue("level");
13  theRegionLevel = muonConstants.getValue("mg_region") / theLevelPart;
14  theStationLevel = muonConstants.getValue("mg_station") / theLevelPart;
15  theRingLevel = muonConstants.getValue("mg_ring") / theLevelPart;
16  theSectorLevel = muonConstants.getValue("mg_sector") / theLevelPart;
17  theRollLevel = muonConstants.getValue("mg_roll") / theLevelPart;
18 #ifdef EDM_ML_DEBUG
19  edm::LogVerbatim("MuonGeom") << "Initialize GEMNumberingScheme"
20  << "\ntheRegionLevel " << theRegionLevel << "\ntheStationLevel " << theStationLevel
21  << "\ntheRingLevel " << theRingLevel << "\ntheSectorLevel " << theSectorLevel
22  << "\ntheRollLevel " << theRollLevel;
23 #endif
24 }
int getValue(const std::string &name) const
Log< level::Info, true > LogVerbatim

Member Data Documentation

◆ theRegionLevel

int GEMNumberingScheme::theRegionLevel
private

Definition at line 20 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theRingLevel

int GEMNumberingScheme::theRingLevel
private

Definition at line 22 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theRollLevel

int GEMNumberingScheme::theRollLevel
private

Definition at line 24 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theSectorLevel

int GEMNumberingScheme::theSectorLevel
private

Definition at line 23 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theStationLevel

int GEMNumberingScheme::theStationLevel
private

Definition at line 21 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().