CMS 3D CMS Logo

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::DTNumberingScheme ( const MuonGeometryConstants muonConstants)

Definition at line 19 of file DTNumberingScheme.cc.

19 { initMe(muonConstants); }

References initMe().

◆ ~DTNumberingScheme()

DTNumberingScheme::~DTNumberingScheme ( )
inlineoverride

Definition at line 23 of file DTNumberingScheme.h.

23 {}

Member Function Documentation

◆ baseNumberToUnitNumber()

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

Reimplemented from MuonNumberingScheme.

Definition at line 38 of file DTNumberingScheme.cc.

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

References getDetId(), personalPlayback::level, EgammaValidation_cff::num, and theStationLevel.

Referenced by DTGeometryBuilderFromDD4Hep::buildChamber(), cms::DTGeometryBuilder::buildChamber(), DTGeometryBuilderFromDD4Hep::buildLayer(), cms::DTGeometryBuilder::buildLayer(), DTGeometryBuilderFromDD4Hep::buildSuperLayer(), and cms::DTGeometryBuilder::buildSuperLayer().

◆ decode()

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 114 of file DTNumberingScheme.cc.

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

References personalPlayback::level, EgammaValidation_cff::num, theLayerLevel, theStationLevel, theSuperLayerLevel, theWheelLevel, and theWireLevel.

Referenced by getDetId().

◆ getDetId()

int DTNumberingScheme::getDetId ( const MuonBaseNumber num) const

Definition at line 75 of file DTNumberingScheme.cc.

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

References decode(), triggerObjects_cff::id, and EgammaValidation_cff::num.

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

◆ initMe()

void DTNumberingScheme::initMe ( const MuonGeometryConstants muonConstants)
private

Definition at line 21 of file DTNumberingScheme.cc.

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("DTNumberingScheme") << "Initialize DTNumberingScheme"
31  << "\ntheRegionLevel " << theRegionLevel << "\ntheWheelLevel " << theWheelLevel
32  << "\ntheStationLevel " << theStationLevel << "\ntheSuperLayerLevel "
33  << theSuperLayerLevel << "\ntheLayerLevel " << theLayerLevel
34  << "\ntheWireLevel " << theWireLevel;
35 #endif
36 }

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

Referenced by DTNumberingScheme().

Friends And Related Function Documentation

◆ DTGeometryBuilderFromDDD

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.

◆ DTGeometryParserFromDDD

friend class DTGeometryParserFromDDD
friend

Definition at line 50 of file DTNumberingScheme.h.

Member Data Documentation

◆ theLayerLevel

int DTNumberingScheme::theLayerLevel
private

Definition at line 44 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

◆ theRegionLevel

int DTNumberingScheme::theRegionLevel
private

Definition at line 40 of file DTNumberingScheme.h.

Referenced by initMe().

◆ theStationLevel

int DTNumberingScheme::theStationLevel
private

Definition at line 42 of file DTNumberingScheme.h.

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

◆ theSuperLayerLevel

int DTNumberingScheme::theSuperLayerLevel
private

Definition at line 43 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

◆ theWheelLevel

int DTNumberingScheme::theWheelLevel
private

Definition at line 41 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

◆ theWireLevel

int DTNumberingScheme::theWireLevel
private

Definition at line 45 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

personalPlayback.level
level
Definition: personalPlayback.py:22
DTNumberingScheme::theLayerLevel
int theLayerLevel
Definition: DTNumberingScheme.h:44
DTNumberingScheme::initMe
void initMe(const MuonGeometryConstants &muonConstants)
Definition: DTNumberingScheme.cc:21
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
DTNumberingScheme::theWireLevel
int theWireLevel
Definition: DTNumberingScheme.h:45
DTNumberingScheme::theStationLevel
int theStationLevel
Definition: DTNumberingScheme.h:42
DTNumberingScheme::getDetId
int getDetId(const MuonBaseNumber &num) const
Definition: DTNumberingScheme.cc:75
DTWireId
Definition: DTWireId.h:12
DTNumberingScheme::theRegionLevel
int theRegionLevel
Definition: DTNumberingScheme.h:40
MuonGeometryConstants::getValue
int getValue(const std::string &name) const
Definition: MuonGeometryConstants.cc:8
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
DTNumberingScheme::theSuperLayerLevel
int theSuperLayerLevel
Definition: DTNumberingScheme.h:43
DTNumberingScheme::decode
void decode(const MuonBaseNumber &num, int &wire_id, int &layer_id, int &superlayer_id, int &sector_id, int &station_id, int &wheel_id) const
Definition: DTNumberingScheme.cc:114
DTNumberingScheme::theWheelLevel
int theWheelLevel
Definition: DTNumberingScheme.h:41