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 DDCompactView &cpv)
 
 GEMNumberingScheme (const MuonDDDConstants &muonConstants)
 
 ~GEMNumberingScheme () override
 
- Public Member Functions inherited from MuonNumberingScheme
 MuonNumberingScheme ()
 
virtual ~MuonNumberingScheme ()
 

Private Member Functions

void initMe (const MuonDDDConstants &muonConstants)
 

Private Attributes

int theRegionLevel
 
int theRingLevel
 
int theRollLevel
 
int theSectorLevel
 
int theStationLevel
 

Detailed Description

Definition at line 10 of file GEMNumberingScheme.h.

Constructor & Destructor Documentation

GEMNumberingScheme::GEMNumberingScheme ( const DDCompactView cpv)

Definition at line 11 of file GEMNumberingScheme.cc.

References initMe().

11  {
12  MuonDDDConstants muonConstants(cpv);
13  initMe(muonConstants);
14 }
void initMe(const MuonDDDConstants &muonConstants)
GEMNumberingScheme::GEMNumberingScheme ( const MuonDDDConstants muonConstants)

Definition at line 9 of file GEMNumberingScheme.cc.

References initMe().

9 { initMe(muonConstants); }
void initMe(const MuonDDDConstants &muonConstants)
GEMNumberingScheme::~GEMNumberingScheme ( )
inlineoverride

Definition at line 15 of file GEMNumberingScheme.h.

References baseNumberToUnitNumber(), and initMe().

15 {};

Member Function Documentation

int GEMNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 31 of file GEMNumberingScheme.cc.

References relativeConstraints::chamber, MuonBaseNumber::getBaseNo(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), triggerObjects_cff::id, personalPlayback::level, HLT_2018_cff::region, relativeConstraints::ring, relativeConstraints::station, theRegionLevel, theRollLevel, theSectorLevel, and theStationLevel.

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

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

Definition at line 16 of file GEMNumberingScheme.cc.

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

Referenced by GEMNumberingScheme(), and ~GEMNumberingScheme().

16  {
17  int theLevelPart = muonConstants.getValue("level");
18  theRegionLevel = muonConstants.getValue("mg_region") / theLevelPart;
19  theStationLevel = muonConstants.getValue("mg_station") / theLevelPart;
20  theRingLevel = muonConstants.getValue("mg_ring") / theLevelPart;
21  theSectorLevel = muonConstants.getValue("mg_sector") / theLevelPart;
22  theRollLevel = muonConstants.getValue("mg_roll") / theLevelPart;
23 #ifdef LOCAL_DEBUG
24  edm::LogVerbatim("GEMNumberingScheme") << "Initialize GEMNumberingScheme"
25  << "\ntheRegionLevel " << theRegionLevel << "\ntheStationLevel "
26  << theStationLevel << "\ntheRingLevel " << theRingLevel << "\ntheSectorLevel "
27  << theSectorLevel << "\ntheRollLevel " << theRollLevel;
28 #endif
29 }
int getValue(const std::string &name) const

Member Data Documentation

int GEMNumberingScheme::theRegionLevel
private

Definition at line 22 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int GEMNumberingScheme::theRingLevel
private

Definition at line 24 of file GEMNumberingScheme.h.

Referenced by initMe().

int GEMNumberingScheme::theRollLevel
private

Definition at line 26 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int GEMNumberingScheme::theSectorLevel
private

Definition at line 25 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int GEMNumberingScheme::theStationLevel
private

Definition at line 23 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().