CMS 3D CMS Logo

ME0NumberingScheme.cc
Go to the documentation of this file.
7 
8 //#define LOCAL_DEBUG
9 
10 ME0NumberingScheme::ME0NumberingScheme(const MuonGeometryConstants& muonConstants) { initMe(muonConstants); }
11 
13  int theLevelPart = muonConstants.getValue("level");
14  theRegionLevel = muonConstants.getValue("m0_region") / theLevelPart;
15  theLayerLevel = muonConstants.getValue("m0_layer") / theLevelPart;
16  theSectorLevel = muonConstants.getValue("m0_sector") / theLevelPart;
17  theRollLevel = muonConstants.getValue("m0_roll") / theLevelPart;
18  theNEtaPart = muonConstants.getValue("m0_nroll");
19 
20  // Debug using LOCAL_DEBUG
21 #ifdef LOCAL_DEBUG
22  edm::LogVerbatim("ME0NumberingScheme") << "Initialize ME0NumberingScheme"
23  << "\ntheRegionLevel " << theRegionLevel << "\ntheLayerLevel " << theLayerLevel
24  << "\ntheSectorLevel " << theSectorLevel << "\ntheRollLevel " << theRollLevel
25  << "\ntheNEtaPart " << theNEtaPart;
26 #endif
27  // -----------------------
28 }
29 
31  edm::LogVerbatim("ME0NumberingScheme") << "ME0NumberingScheme::baseNumberToUnitNumber BEGIN ";
32  // Debug using LOCAL_DEBUG
33 #ifdef LOCAL_DEBUG
34  edm::LogVerbatim("ME0NumberingScheme") << "ME0Numbering " << num.getLevels();
35  for (int level = 1; level <= num.getLevels(); level++) {
36  edm::LogVerbatim("ME0NumberingScheme")
37  << "level " << level << " " << num.getSuperNo(level) << " " << num.getBaseNo(level);
38  }
39 #endif
40  // -----------------------
41 
42  int maxLevel = theRollLevel;
43  if (num.getLevels() != maxLevel) {
44  throw cms::Exception("MuonNumbering") << "MuonME0NS::BNToUN "
45  << "BaseNumber has " << num.getLevels() << " levels,"
46  << "need " << maxLevel << std::endl;
47  return 0;
48  }
49 
50  int region(0), layer(0), chamber(0), roll(0);
51 
52  //decode significant ME0 levels
53 
54  if (num.getBaseNo(theRegionLevel) == 0)
55  region = 1;
56  else
57  region = -1;
58  layer = num.getBaseNo(theLayerLevel) + 1;
59  chamber = num.getBaseNo(theSectorLevel) + 1;
60  roll = num.getBaseNo(theRollLevel) + 1;
61 
62  // collect all info
63 
64  // Debug using LOCAL_DEBUG
65 #ifdef LOCAL_DEBUG
66  edm::LogVerbatim("ME0NumberingScheme") << "ME0NumberingScheme: Region " << region << " Layer " << layer << " Chamber "
67  << chamber << " Roll " << roll;
68 #endif
69  // -----------------------
70 
71  // Build the actual numbering
72  ME0DetId id(region, layer, chamber, roll);
73 
74  // Debug using LOCAL_DEBUG
75 #ifdef LOCAL_DEBUG
76  edm::LogVerbatim("ME0NumberingScheme") << " DetId " << id;
77 #endif
78  // ---------------------
79 
80  return id.rawId();
81 }
personalPlayback.level
level
Definition: personalPlayback.py:22
MuonGeometryConstants
Definition: MuonGeometryConstants.h:20
MessageLogger.h
ME0DetId.h
MuonGeometryConstants.h
ME0NumberingScheme::ME0NumberingScheme
ME0NumberingScheme(const MuonGeometryConstants &muonConstants)
Definition: ME0NumberingScheme.cc:10
ME0NumberingScheme::theLayerLevel
int theLayerLevel
Definition: ME0NumberingScheme.h:22
ME0NumberingScheme.h
ME0NumberingScheme::theNEtaPart
int theNEtaPart
Definition: ME0NumberingScheme.h:24
MuonBaseNumber.h
edm::LogVerbatim
Definition: MessageLogger.h:297
MuonGeometryConstants::getValue
int getValue(const std::string &name) const
Definition: MuonGeometryConstants.cc:8
ME0DetId
Definition: ME0DetId.h:16
ME0NumberingScheme::theRegionLevel
int theRegionLevel
Definition: ME0NumberingScheme.h:20
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
MuonBaseNumber
Definition: MuonBaseNumber.h:21
ME0NumberingScheme::theRollLevel
int theRollLevel
Definition: ME0NumberingScheme.h:23
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Exception
Definition: hltDiff.cc:246
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
Exception.h
ME0NumberingScheme::theSectorLevel
int theSectorLevel
Definition: ME0NumberingScheme.h:21
ME0NumberingScheme::baseNumberToUnitNumber
int baseNumberToUnitNumber(const MuonBaseNumber &) override
Definition: ME0NumberingScheme.cc:30
ME0NumberingScheme::initMe
void initMe(const MuonGeometryConstants &muonConstants)
Definition: ME0NumberingScheme.cc:12