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

References initMe().

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

Definition at line 12 of file ME0NumberingScheme.cc.

References initMe().

12  {
13  initMe(muonConstants);
14 }
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 53 of file ME0NumberingScheme.cc.

References relativeConstraints::chamber, gather_cfg::cout, Exception, MuonBaseNumber::getBaseNo(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), hcalTTPDigis_cfi::id, hcalDigis_cfi::level, AlCaHLTBitMon_QueryRunRegistry::string, theLayerLevel, theRegionLevel, theRollLevel, and theSectorLevel.

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

53  {
54 
55  edm::LogVerbatim("ME0NumberingScheme")<<"ME0NumberingScheme::baseNumberToUnitNumber BEGIN "<<std::endl;
56  // Debug using LOCAL_DEBUG
57  #ifdef LOCAL_DEBUG
58  std::cout << "ME0Numbering "<<num.getLevels()<<std::endl;
59  for (int level=1;level<=num.getLevels();level++) {
60  std::cout << "level "<<level << " " << num.getSuperNo(level)
61  << " " << num.getBaseNo(level) << std::endl;
62  }
63  #endif
64  // -----------------------
65 
66  // Debug using LogDebug
67  std::stringstream DebugStringStream;
68  DebugStringStream << "ME0Numbering :: number of levels = "<<num.getLevels()<<std::endl;
69  DebugStringStream << "Level \t SuperNo \t BaseNo"<<std::endl;
70  for (int level=1;level<=num.getLevels();level++) {
71  DebugStringStream <<level << " \t " << num.getSuperNo(level)
72  << " \t " << num.getBaseNo(level) << std::endl;
73  }
74  std::string DebugString = DebugStringStream.str();
75  edm::LogVerbatim("ME0NumberingScheme")<<DebugString;
76  // -----------------------
77 
78 
79 
80  int maxLevel = theRollLevel;
81  if (num.getLevels()!=maxLevel) {
82  throw cms::Exception("MuonNumbering") << "MuonME0NS::BNToUN "
83  << "BaseNumber has " << num.getLevels() << " levels,"
84  << "need "<<maxLevel<<std::endl;
85  return 0;
86  }
87 
88  int region(0), layer(0), chamber(0), roll(0);
89 
90  //decode significant ME0 levels
91 
92  if (num.getBaseNo(theRegionLevel) == 0)
93  region = 1;
94  else
95  region =-1;
96  layer = num.getBaseNo(theLayerLevel)+1;
97  chamber = num.getBaseNo(theSectorLevel) + 1;
98  roll = num.getBaseNo(theRollLevel)+1;
99 
100  // collect all info
101 
102  // Debug using LOCAL_DEBUG
103  #ifdef LOCAL_DEBUG
104  std::cout << "ME0NumberingScheme: Region " << region
105  << " Layer " << layer
106  << " Chamber " << chamber << " Roll " << roll << std::endl;
107  #endif
108  // -----------------------
109 
110  // Debug using LogDebug
111  edm::LogVerbatim("ME0NumberingScheme") << "ME0NumberingScheme: Region " << region
112  << " Layer " << layer
113  << " Chamber " << chamber << " Roll " << roll << std::endl;
114  // -----------------------
115 
116  // Build the actual numbering
117  ME0DetId id(region,layer,chamber,roll);
118 
119  // Debug using LOCAL_DEBUG
120  #ifdef LOCAL_DEBUG
121  std::cout << " DetId " << id << std::endl;
122  #endif
123  // ---------------------
124 
125  // Debug using LogDebug
126  edm::LogVerbatim("ME0NumberingScheme")<< " DetId " << id << std::endl;
127  // -----------------------
128 
129  return id.rawId();
130 }
int getBaseNo(int level) const
int getLevels() const
int getSuperNo(int level) const
void ME0NumberingScheme::initMe ( const MuonDDDConstants muonConstants)
private

Definition at line 21 of file ME0NumberingScheme.cc.

References gather_cfg::cout, MuonDDDConstants::getValue(), AlCaHLTBitMon_QueryRunRegistry::string, theLayerLevel, theNEtaPart, theRegionLevel, theRollLevel, and theSectorLevel.

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

21  {
22  int theLevelPart= muonConstants.getValue("level");
23  theRegionLevel = muonConstants.getValue("m0_region")/theLevelPart;
24  theLayerLevel = muonConstants.getValue("m0_layer")/theLevelPart;
25  theSectorLevel = muonConstants.getValue("m0_sector")/theLevelPart;
26  theRollLevel = muonConstants.getValue("m0_roll")/theLevelPart;
27  theNEtaPart = muonConstants.getValue("m0_nroll");
28 
29  // Debug using LOCAL_DEBUG
30  #ifdef LOCAL_DEBUG
31  std::cout << "Initialize ME0NumberingScheme" <<std::endl;
32  std::cout << "theRegionLevel " << theRegionLevel <<std::endl;
33  std::cout << "theLayerLevel " << theLayerLevel <<std::endl;
34  std::cout << "theSectorLevel " << theSectorLevel <<std::endl;
35  std::cout << "theRollLevel " << theRollLevel <<std::endl;
36  std::cout << "theNEtaPart " << theNEtaPart <<std::endl;
37  #endif
38  // -----------------------
39 
40  // Debug using LogDebug
41  std::stringstream DebugStringStream;
42  DebugStringStream << "Initialize ME0NumberingScheme" <<std::endl;
43  DebugStringStream << "theRegionLevel " << theRegionLevel <<std::endl;
44  DebugStringStream << "theLayerLevel " << theLayerLevel <<std::endl;
45  DebugStringStream << "theSectorLevel " << theSectorLevel <<std::endl;
46  DebugStringStream << "theRollLevel " << theRollLevel <<std::endl;
47  DebugStringStream << "theNEtaPart " << theNEtaPart <<std::endl;
48  std::string DebugString = DebugStringStream.str();
49  edm::LogVerbatim("ME0NumberingScheme")<<DebugString;
50  // --------------------
51 }
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().