CMS 3D CMS Logo

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

#include <ME0NumberingScheme.h>

Inheritance diagram for ME0NumberingScheme:
MuonNumberingScheme

Public Member Functions

int baseNumberToUnitNumber (const MuonBaseNumber &) override
 
 ME0NumberingScheme (const DDCompactView &cpv)
 
 ME0NumberingScheme (const MuonDDDConstants &muonConstants)
 
 ~ME0NumberingScheme () override
 
- Public Member Functions inherited from MuonNumberingScheme
 MuonNumberingScheme ()
 
virtual ~MuonNumberingScheme ()
 

Private Member Functions

void initMe (const MuonDDDConstants &muonConstants)
 

Private Attributes

int theLayerLevel
 
int theNEtaPart
 
int theRegionLevel
 
int theRollLevel
 
int theSectorLevel
 

Detailed Description

Definition at line 10 of file ME0NumberingScheme.h.

Constructor & Destructor Documentation

ME0NumberingScheme::ME0NumberingScheme ( const DDCompactView cpv)

Definition at line 12 of file ME0NumberingScheme.cc.

References initMe().

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

Definition at line 10 of file ME0NumberingScheme.cc.

References initMe().

10 { initMe(muonConstants); }
void initMe(const MuonDDDConstants &muonConstants)
ME0NumberingScheme::~ME0NumberingScheme ( )
inlineoverride

Definition at line 15 of file ME0NumberingScheme.h.

References baseNumberToUnitNumber(), and initMe().

15 {};

Member Function Documentation

int ME0NumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 35 of file ME0NumberingScheme.cc.

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

Referenced by ME0GeometryParsFromDD::buildGeometry(), ME0GeometryBuilderFromDDD::buildGeometry(), and ~ME0NumberingScheme().

35  {
36  edm::LogVerbatim("ME0NumberingScheme") << "ME0NumberingScheme::baseNumberToUnitNumber BEGIN ";
37  // Debug using LOCAL_DEBUG
38 #ifdef LOCAL_DEBUG
39  edm::LogVerbatim("ME0NumberingScheme") << "ME0Numbering " << num.getLevels();
40  for (int level = 1; level <= num.getLevels(); level++) {
41  edm::LogVerbatim("ME0NumberingScheme")
42  << "level " << level << " " << num.getSuperNo(level) << " " << num.getBaseNo(level);
43  }
44 #endif
45  // -----------------------
46 
47  int maxLevel = theRollLevel;
48  if (num.getLevels() != maxLevel) {
49  throw cms::Exception("MuonNumbering") << "MuonME0NS::BNToUN "
50  << "BaseNumber has " << num.getLevels() << " levels,"
51  << "need " << maxLevel << std::endl;
52  return 0;
53  }
54 
55  int region(0), layer(0), chamber(0), roll(0);
56 
57  //decode significant ME0 levels
58 
59  if (num.getBaseNo(theRegionLevel) == 0)
60  region = 1;
61  else
62  region = -1;
63  layer = num.getBaseNo(theLayerLevel) + 1;
64  chamber = num.getBaseNo(theSectorLevel) + 1;
65  roll = num.getBaseNo(theRollLevel) + 1;
66 
67  // collect all info
68 
69  // Debug using LOCAL_DEBUG
70 #ifdef LOCAL_DEBUG
71  edm::LogVerbatim("ME0NumberingScheme") << "ME0NumberingScheme: Region " << region << " Layer " << layer << " Chamber "
72  << chamber << " Roll " << roll;
73 #endif
74  // -----------------------
75 
76  // Build the actual numbering
77  ME0DetId id(region, layer, chamber, roll);
78 
79  // Debug using LOCAL_DEBUG
80 #ifdef LOCAL_DEBUG
81  edm::LogVerbatim("ME0NumberingScheme") << " DetId " << id;
82 #endif
83  // ---------------------
84 
85  return id.rawId();
86 }
int getBaseNo(int level) const
int getLevels() const
int getSuperNo(int level) const
void ME0NumberingScheme::initMe ( const MuonDDDConstants muonConstants)
private

Definition at line 17 of file ME0NumberingScheme.cc.

References MuonDDDConstants::getValue(), theLayerLevel, theNEtaPart, theRegionLevel, theRollLevel, and theSectorLevel.

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

17  {
18  int theLevelPart = muonConstants.getValue("level");
19  theRegionLevel = muonConstants.getValue("m0_region") / theLevelPart;
20  theLayerLevel = muonConstants.getValue("m0_layer") / theLevelPart;
21  theSectorLevel = muonConstants.getValue("m0_sector") / theLevelPart;
22  theRollLevel = muonConstants.getValue("m0_roll") / theLevelPart;
23  theNEtaPart = muonConstants.getValue("m0_nroll");
24 
25  // Debug using LOCAL_DEBUG
26 #ifdef LOCAL_DEBUG
27  edm::LogVerbatim("ME0NumberingScheme") << "Initialize ME0NumberingScheme"
28  << "\ntheRegionLevel " << theRegionLevel << "\ntheLayerLevel " << theLayerLevel
29  << "\ntheSectorLevel " << theSectorLevel << "\ntheRollLevel " << theRollLevel
30  << "\ntheNEtaPart " << theNEtaPart;
31 #endif
32  // -----------------------
33 }
int getValue(const std::string &name) const

Member Data Documentation

int ME0NumberingScheme::theLayerLevel
private

Definition at line 24 of file ME0NumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int ME0NumberingScheme::theNEtaPart
private

Definition at line 26 of file ME0NumberingScheme.h.

Referenced by initMe().

int ME0NumberingScheme::theRegionLevel
private

Definition at line 22 of file ME0NumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int ME0NumberingScheme::theRollLevel
private

Definition at line 25 of file ME0NumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int ME0NumberingScheme::theSectorLevel
private

Definition at line 23 of file ME0NumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().