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 14 of file ME0NumberingScheme.cc.

References initMe().

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

Definition at line 10 of file ME0NumberingScheme.cc.

References initMe().

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

Definition at line 17 of file ME0NumberingScheme.h.

References baseNumberToUnitNumber(), and initMe().

17 {};

Member Function Documentation

int ME0NumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 40 of file ME0NumberingScheme.cc.

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

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

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

Definition at line 19 of file ME0NumberingScheme.cc.

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

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

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

Member Data Documentation

int ME0NumberingScheme::theLayerLevel
private

Definition at line 26 of file ME0NumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int ME0NumberingScheme::theNEtaPart
private

Definition at line 28 of file ME0NumberingScheme.h.

Referenced by initMe().

int ME0NumberingScheme::theRegionLevel
private

Definition at line 24 of file ME0NumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int ME0NumberingScheme::theRollLevel
private

Definition at line 27 of file ME0NumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int ME0NumberingScheme::theSectorLevel
private

Definition at line 25 of file ME0NumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().