CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
DTNumberingScheme Class Reference

#include <DTNumberingScheme.h>

Inheritance diagram for DTNumberingScheme:
MuonNumberingScheme

Public Member Functions

int baseNumberToUnitNumber (const MuonBaseNumber &num) const override
 
 DTNumberingScheme (const MuonGeometryConstants &muonConstants)
 
int getDetId (const MuonBaseNumber &num) const
 
 ~DTNumberingScheme () override
 
- Public Member Functions inherited from MuonNumberingScheme
 MuonNumberingScheme ()
 
virtual ~MuonNumberingScheme ()
 

Private Member Functions

void decode (const MuonBaseNumber &num, int &wire_id, int &layer_id, int &superlayer_id, int &sector_id, int &station_id, int &wheel_id) const
 
void initMe (const MuonGeometryConstants &muonConstants)
 

Private Attributes

int theLayerLevel
 
int theRegionLevel
 
int theStationLevel
 
int theSuperLayerLevel
 
int theWheelLevel
 
int theWireLevel
 

Friends

class DTGeometryBuilderFromDDD
 
class DTGeometryParserFromDDD
 

Detailed Description

implementation of MuonNumberingScheme for muon barrel, converts the MuonBaseNumber to a unit id

Original

Author
Arno Straessner, CERN arno..nosp@m.stra.nosp@m.essne.nosp@m.r@ce.nosp@m.rn.ch Modified by Sunanda B. in different PRs (the last one is #30971)

Definition at line 20 of file DTNumberingScheme.h.

Constructor & Destructor Documentation

DTNumberingScheme::DTNumberingScheme ( const MuonGeometryConstants muonConstants)

Definition at line 19 of file DTNumberingScheme.cc.

References initMe().

19 { initMe(muonConstants); }
void initMe(const MuonGeometryConstants &muonConstants)
DTNumberingScheme::~DTNumberingScheme ( )
inlineoverride

Definition at line 23 of file DTNumberingScheme.h.

23 {}

Member Function Documentation

int DTNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num) const
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 37 of file DTNumberingScheme.cc.

References MuonBaseNumber::getBaseNo(), getDetId(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), testEve_cfg::level, and theStationLevel.

Referenced by DTGeometryBuilderFromDD4hep::buildChamber(), cms::DTGeometryBuilder::buildChamber(), DTGeometryBuilderFromDD4hep::buildLayer(), cms::DTGeometryBuilder::buildLayer(), DTGeometryBuilderFromDD4hep::buildSuperLayer(), cms::DTGeometryBuilder::buildSuperLayer(), DTGeometryParsFromDD::insertChamber(), DTGeometryParsFromDD::insertLayer(), and DTGeometryParsFromDD::insertSuperLayer().

37  {
38 #ifdef EDM_ML_DEBUG
39  edm::LogVerbatim("MuonGeom") << "DTNumbering " << num.getLevels();
40  for (int level = 1; level <= num.getLevels(); level++) {
41  edm::LogVerbatim("MuonGeom") << level << " " << num.getSuperNo(level) << " " << num.getBaseNo(level);
42  }
43 #endif
44  if (num.getLevels() < theStationLevel) { // it was if (num.getLevels() != theWireLevel) {
45  edm::LogWarning("MuonGeom") << "DTNumberingScheme::BNToUN: BaseNumber has " << num.getLevels() << " levels, need "
46  << theStationLevel; //it was theWireLevel;
47  return 0;
48  }
49 
50  // // Meaningful ranges are enforced by DTWireId, (which
51  // // however allows for 0 in wire, layer, superlayer!!!)
52  //
53  // if ((wire_id < 1) || (wire_id > 100)) {
54  // std::cout << "DTNumberingScheme: ";
55  // std::cout << "wire id out of range: ";
56  // std::cout << wire_id <<std::endl;
57  // }
58 
59  // if ((layer_id < 1) || (layer_id > 4)) {
60  // std::cout << "DTNumberingScheme: ";
61  // std::cout << "layer id out of range: ";
62  // std::cout << layer_id <<std::endl;
63  // }
64 
65  // if ((superlayer_id < 1) || (superlayer_id > 3)) {
66  // std::cout << "DTNumberingScheme: ";
67  // std::cout << "super-layer id out of range: ";
68  // std::cout << superlayer_id <<std::endl;
69  // }
70 
71  return getDetId(num);
72 }
Log< level::Info, true > LogVerbatim
int getBaseNo(int level) const
int getLevels() const
int getSuperNo(int level) const
int getDetId(const MuonBaseNumber &num) const
tuple level
Definition: testEve_cfg.py:47
Log< level::Warning, false > LogWarning
void DTNumberingScheme::decode ( const MuonBaseNumber num,
int &  wire_id,
int &  layer_id,
int &  superlayer_id,
int &  sector_id,
int &  station_id,
int &  wheel_id 
) const
private

Definition at line 113 of file DTNumberingScheme.cc.

References MuonBaseNumber::getBaseNo(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), testEve_cfg::level, theLayerLevel, theStationLevel, theSuperLayerLevel, theWheelLevel, and theWireLevel.

Referenced by getDetId().

119  {
120  for (int level = 1; level <= num.getLevels(); level++) {
121  //decode
122  if (level == theWheelLevel) {
123  const int copyno = num.getBaseNo(level);
124  wheel_id = copyno - 2;
125 
126  } else if (level == theStationLevel) {
127  const int station_tag = num.getSuperNo(level);
128  const int copyno = num.getBaseNo(level);
129  station_id = station_tag;
130  sector_id = copyno + 1;
131 
132  } else if (level == theSuperLayerLevel) {
133  const int copyno = num.getBaseNo(level);
134  superlayer_id = copyno + 1;
135 
136  } else if (level == theLayerLevel) {
137  const int copyno = num.getBaseNo(level);
138  layer_id = copyno + 1;
139 
140  } else if (level == theWireLevel) {
141  const int copyno = num.getBaseNo(level);
142  wire_id = copyno + 1;
143  }
144  }
145 }
int getBaseNo(int level) const
int getLevels() const
int getSuperNo(int level) const
tuple level
Definition: testEve_cfg.py:47
int DTNumberingScheme::getDetId ( const MuonBaseNumber num) const

Definition at line 74 of file DTNumberingScheme.cc.

References decode(), and gpuClustering::id.

Referenced by baseNumberToUnitNumber(), DTGeometryBuilderFromDDD::buildChamber(), DTGeometryParserFromDDD::buildLayer(), DTGeometryBuilderFromDDD::buildLayer(), DTGeometryBuilderFromDDD::buildSuperLayer(), DTGeometryParsFromDD::insertLayer(), and DTGeometryParsFromDD::insertSuperLayer().

74  {
75  int wire_id = 0;
76  int layer_id = 0;
77  int superlayer_id = 0;
78  int sector_id = 0;
79  int station_id = 0;
80  int wheel_id = 0;
81 
82  //decode significant barrel levels
83  decode(num, wire_id, layer_id, superlayer_id, sector_id, station_id, wheel_id);
84 
85  // These ranges are enforced by DTWireId
86  // if ((sector_id < 1) || (sector_id > 14)) {
87  // std::cout << "DTNumberingScheme: ";
88  // std::cout << "sector id out of range: ";
89  // std::cout << sector_id <<std::endl;
90  // }
91 
92  // if ((station_id < 1) || (station_id > 4)) {
93  // std::cout << "DTNumberingScheme: ";
94  // std::cout << "station id out of range: ";
95  // std::cout << station_id <<std::endl;
96  // }
97 
98  // if ((wheel_id < -2) || (wheel_id > 2)) {
99  // std::cout << "DTNumberingScheme: ";
100  // std::cout << "wheel id out of range: ";
101  // std::cout << wheel_id <<std::endl;
102  // }
103 
104  DTWireId id(wheel_id, station_id, sector_id, superlayer_id, layer_id, wire_id);
105 
106 #ifdef EDM_ML_DEBUG
107  edm::LogVerbatim("MuonGeom") << "DTNumberingScheme: " << id;
108 #endif
109 
110  return id.rawId();
111 }
Log< level::Info, true > LogVerbatim
uint16_t *__restrict__ id
void decode(const MuonBaseNumber &num, int &wire_id, int &layer_id, int &superlayer_id, int &sector_id, int &station_id, int &wheel_id) const
void DTNumberingScheme::initMe ( const MuonGeometryConstants muonConstants)
private

Definition at line 21 of file DTNumberingScheme.cc.

References MuonGeometryConstants::getValue(), theLayerLevel, theRegionLevel, theStationLevel, theSuperLayerLevel, theWheelLevel, and theWireLevel.

Referenced by DTNumberingScheme().

21  {
22  int theLevelPart = muonConstants.getValue("level");
23  theRegionLevel = muonConstants.getValue("mb_region") / theLevelPart;
24  theWheelLevel = muonConstants.getValue("mb_wheel") / theLevelPart;
25  theStationLevel = muonConstants.getValue("mb_station") / theLevelPart;
26  theSuperLayerLevel = muonConstants.getValue("mb_superlayer") / theLevelPart;
27  theLayerLevel = muonConstants.getValue("mb_layer") / theLevelPart;
28  theWireLevel = muonConstants.getValue("mb_wire") / theLevelPart;
29 #ifdef EDM_ML_DEBUG
30  edm::LogVerbatim("MuonGeom") << "Initialize DTNumberingScheme\ntheRegionLevel " << theRegionLevel
31  << "\ntheWheelLevel " << theWheelLevel << "\ntheStationLevel " << theStationLevel
32  << "\ntheSuperLayerLevel " << theSuperLayerLevel << "\ntheLayerLevel " << theLayerLevel
33  << "\ntheWireLevel " << theWireLevel;
34 #endif
35 }
Log< level::Info, true > LogVerbatim
int getValue(const std::string &name) const

Friends And Related Function Documentation

friend class DTGeometryBuilderFromDDD
friend

Same as BaseNumberToUnitNumber but w/o check: used by MuBarDetBuilder class to build the geometry from DDD

Definition at line 49 of file DTNumberingScheme.h.

friend class DTGeometryParserFromDDD
friend

Definition at line 50 of file DTNumberingScheme.h.

Member Data Documentation

int DTNumberingScheme::theLayerLevel
private

Definition at line 44 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theRegionLevel
private

Definition at line 40 of file DTNumberingScheme.h.

Referenced by initMe().

int DTNumberingScheme::theStationLevel
private

Definition at line 42 of file DTNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), decode(), and initMe().

int DTNumberingScheme::theSuperLayerLevel
private

Definition at line 43 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theWheelLevel
private

Definition at line 41 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theWireLevel
private

Definition at line 45 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().