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 13 of file GEMNumberingScheme.cc.

References initMe().

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

Definition at line 9 of file GEMNumberingScheme.cc.

References initMe().

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

Definition at line 17 of file GEMNumberingScheme.h.

References baseNumberToUnitNumber(), and initMe().

17 {};

Member Function Documentation

int GEMNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 36 of file GEMNumberingScheme.cc.

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

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

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

Definition at line 18 of file GEMNumberingScheme.cc.

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

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

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

Member Data Documentation

int GEMNumberingScheme::theRegionLevel
private

Definition at line 24 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int GEMNumberingScheme::theRingLevel
private

Definition at line 26 of file GEMNumberingScheme.h.

Referenced by initMe().

int GEMNumberingScheme::theRollLevel
private

Definition at line 28 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int GEMNumberingScheme::theSectorLevel
private

Definition at line 27 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int GEMNumberingScheme::theStationLevel
private

Definition at line 25 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().