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 &) 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.

9 { initMe(muonConstants); }

References initMe().

◆ ~GEMNumberingScheme()

GEMNumberingScheme::~GEMNumberingScheme ( )
inlineoverride

Definition at line 13 of file GEMNumberingScheme.h.

13 {};

Member Function Documentation

◆ baseNumberToUnitNumber()

int GEMNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 26 of file GEMNumberingScheme.cc.

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

References relativeConstraints::chamber, triggerObjects_cff::id, personalPlayback::level, GEMDetId::minStationId0, EgammaValidation_cff::num, HLT_2018_cff::region, relativeConstraints::ring, relativeConstraints::station, theRegionLevel, theRingLevel, theRollLevel, theSectorLevel, and theStationLevel.

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

◆ initMe()

void GEMNumberingScheme::initMe ( const MuonGeometryConstants muonConstants)
private

Definition at line 11 of file GEMNumberingScheme.cc.

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 LOCAL_DEBUG
19  edm::LogVerbatim("GEMNumberingScheme") << "Initialize GEMNumberingScheme"
20  << "\ntheRegionLevel " << theRegionLevel << "\ntheStationLevel "
21  << theStationLevel << "\ntheRingLevel " << theRingLevel << "\ntheSectorLevel "
22  << theSectorLevel << "\ntheRollLevel " << theRollLevel;
23 #endif
24 }

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

Referenced by GEMNumberingScheme().

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().

personalPlayback.level
level
Definition: personalPlayback.py:22
relativeConstraints.station
station
Definition: relativeConstraints.py:67
GEMNumberingScheme::theRegionLevel
int theRegionLevel
Definition: GEMNumberingScheme.h:20
GEMDetId::minStationId0
static constexpr int32_t minStationId0
Definition: GEMDetId.h:23
GEMNumberingScheme::theRingLevel
int theRingLevel
Definition: GEMNumberingScheme.h:22
GEMNumberingScheme::theSectorLevel
int theSectorLevel
Definition: GEMNumberingScheme.h:23
edm::LogWarning
Definition: MessageLogger.h:141
GEMDetId
Definition: GEMDetId.h:17
GEMNumberingScheme::theStationLevel
int theStationLevel
Definition: GEMNumberingScheme.h:21
edm::LogVerbatim
Definition: MessageLogger.h:297
MuonGeometryConstants::getValue
int getValue(const std::string &name) const
Definition: MuonGeometryConstants.cc:8
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
GEMNumberingScheme::initMe
void initMe(const MuonGeometryConstants &muonConstants)
Definition: GEMNumberingScheme.cc:11
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
GEMNumberingScheme::theRollLevel
int theRollLevel
Definition: GEMNumberingScheme.h:24
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53