CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ME0NumberingScheme.cc
Go to the documentation of this file.
5 #include <iostream>
6 
7 //#define LOCAL_DEBUG
8 
10  initMe(muonConstants);
11 }
12 
14  MuonDDDConstants muonConstants(cpv);
15  initMe(muonConstants);
16 }
17 
18 void ME0NumberingScheme::initMe ( const MuonDDDConstants& muonConstants ) {
19  int theLevelPart= muonConstants.getValue("level");
20  theRegionLevel = muonConstants.getValue("m0_region")/theLevelPart;
21  theLayerLevel = muonConstants.getValue("m0_layer")/theLevelPart;
22  theSectorLevel = muonConstants.getValue("m0_sector")/theLevelPart;
23  theRollLevel = muonConstants.getValue("m0_roll")/theLevelPart;
24 #ifdef LOCAL_DEBUG
25  std::cout << "Initialize ME0NumberingScheme" <<std::endl;
26  std::cout << "theRegionLevel " << theRegionLevel <<std::endl;
27  std::cout << "theLayerLevel " << theLayerLevel <<std::endl;
28  std::cout << "theSectorLevel " << theSectorLevel <<std::endl;
29  std::cout << "theRollLevel " << theRollLevel <<std::endl;
30 #endif
31 }
32 
34 
35 #ifdef LOCAL_DEBUG
36  std::cout << "ME0Numbering "<<num.getLevels()<<std::endl;
37  for (int level=1;level<=num.getLevels();level++) {
38  std::cout << "level "<<level << " " << num.getSuperNo(level)
39  << " " << num.getBaseNo(level) << std::endl;
40  }
41 #endif
42 
43  int maxLevel = theLayerLevel;
44  if (num.getLevels()!=maxLevel) {
45  std::cout << "MuonME0NS::BNToUN "
46  << "BaseNumber has " << num.getLevels() << " levels,"
47  << "need "<<maxLevel<<std::endl;
48  return 0;
49  }
50 
51  int region(0), layer(0), chamber(0), roll(0);
52 
53  //decode significant ME0 levels
54 
55  if (num.getBaseNo(theRegionLevel) == 0)
56  region = 1;
57  else
58  region =-1;
59  layer = num.getBaseNo(theLayerLevel)+1;
60  roll=1;
61  chamber = num.getBaseNo(theSectorLevel) + 1;
62  // collect all info
63 
64 #ifdef LOCAL_DEBUG
65  std::cout << "ME0NumberingScheme: Region " << region
66  << " Layer " << layer
67  << " Chamber " << chamber << " Roll " << roll << std::endl;
68 #endif
69 
70  // Build the actual numbering
71  ME0DetId id(region,layer,chamber,roll);
72 
73 
74 #ifdef LOCAL_DEBUG
75  std::cout << " DetId " << id << std::endl;
76 #endif
77 
78  return id.rawId();
79 }
80 
81 
82 
83 
int getBaseNo(int level) const
ME0NumberingScheme(const DDCompactView &cpv)
type of data representation of DDCompactView
Definition: DDCompactView.h:77
int getValue(const std::string &name) const
int getLevels() const
int getSuperNo(int level) const
tuple cout
Definition: gather_cfg.py:121
tuple level
Definition: testEve_cfg.py:34
virtual int baseNumberToUnitNumber(const MuonBaseNumber)
void initMe(const MuonDDDConstants &muonConstants)