CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

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

Private Member Functions

void initMe (const MuonDDDConstants &muonConstants)
 

Private Attributes

int theLayerLevel
 
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 15 of file ME0NumberingScheme.cc.

References initMe().

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

Definition at line 11 of file ME0NumberingScheme.cc.

References initMe().

11  {
12  initMe(muonConstants);
13 }
void initMe(const MuonDDDConstants &muonConstants)
virtual ME0NumberingScheme::~ME0NumberingScheme ( )
inlinevirtual

Definition at line 17 of file ME0NumberingScheme.h.

17 {};

Member Function Documentation

int ME0NumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
virtual

Reimplemented from MuonNumberingScheme.

Definition at line 49 of file ME0NumberingScheme.cc.

References gather_cfg::cout, MuonBaseNumber::getBaseNo(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), testEve_cfg::level, HLT_25ns10e33_v2_cff::region, AlCaHLTBitMon_QueryRunRegistry::string, theLayerLevel, theRegionLevel, and theSectorLevel.

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

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

Definition at line 20 of file ME0NumberingScheme.cc.

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

Referenced by ME0NumberingScheme().

20  {
21  int theLevelPart= muonConstants.getValue("level");
22  theRegionLevel = muonConstants.getValue("m0_region")/theLevelPart;
23  theLayerLevel = muonConstants.getValue("m0_layer")/theLevelPart;
24  theSectorLevel = muonConstants.getValue("m0_sector")/theLevelPart;
25  theRollLevel = muonConstants.getValue("m0_roll")/theLevelPart;
26 
27  // Debug using LOCAL_DEBUG
28  #ifdef LOCAL_DEBUG
29  std::cout << "Initialize ME0NumberingScheme" <<std::endl;
30  std::cout << "theRegionLevel " << theRegionLevel <<std::endl;
31  std::cout << "theLayerLevel " << theLayerLevel <<std::endl;
32  std::cout << "theSectorLevel " << theSectorLevel <<std::endl;
33  std::cout << "theRollLevel " << theRollLevel <<std::endl;
34  #endif
35  // -----------------------
36 
37  // Debug using LogDebug
38  std::stringstream DebugStringStream;
39  DebugStringStream << "Initialize ME0NumberingScheme" <<std::endl;
40  DebugStringStream << "theRegionLevel " << theRegionLevel <<std::endl;
41  DebugStringStream << "theLayerLevel " << theLayerLevel <<std::endl;
42  DebugStringStream << "theSectorLevel " << theSectorLevel <<std::endl;
43  DebugStringStream << "theRollLevel " << theRollLevel <<std::endl;
44  std::string DebugString = DebugStringStream.str();
45  edm::LogVerbatim("ME0NumberingScheme")<<DebugString;
46  // --------------------
47 }
int getValue(const std::string &name) const
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

int ME0NumberingScheme::theLayerLevel
private

Definition at line 26 of file ME0NumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and 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 initMe().

int ME0NumberingScheme::theSectorLevel
private

Definition at line 25 of file ME0NumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().