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) 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

Description: DTNumberingScheme converts the MuonBaseNumber to a unit id for Muon Barrel

Implementation: DTNumberingScheme decode and getDetId are ported from an original DTNumberingScheme class

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

Author
Arno Straessner, CERN arno..nosp@m.stra.nosp@m.essne.nosp@m.r@ce.nosp@m.rn.ch

Definition at line 19 of file DTNumberingScheme.h.

Constructor & Destructor Documentation

◆ DTNumberingScheme()

DTNumberingScheme::DTNumberingScheme ( const MuonGeometryConstants muonConstants)

Definition at line 9 of file DTNumberingScheme.cc.

9 { initMe(muonConstants); }

References initMe().

◆ ~DTNumberingScheme()

DTNumberingScheme::~DTNumberingScheme ( )
inlineoverride

Definition at line 22 of file DTNumberingScheme.h.

22 {}

Member Function Documentation

◆ baseNumberToUnitNumber()

int DTNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 28 of file DTNumberingScheme.cc.

28  {
29 #ifdef LOCAL_DEBUG
30  edm::LogVerbatim("DTNumberingScheme") << "DTNumbering " << num.getLevels();
31  for (int level = 1; level <= num.getLevels(); level++) {
32  edm::LogVerbatim("DTNumberingScheme") << level << " " << num.getSuperNo(level) << " " << num.getBaseNo(level);
33  }
34 #endif
35  if (num.getLevels() != theWireLevel) {
36  edm::LogWarning("DTNumberingScheme") << "DTNumberingScheme::BNToUN: BaseNumber has " << num.getLevels()
37  << " levels, need " << theWireLevel;
38  return 0;
39  }
40 
41  // // Meaningful ranges are enforced by DTWireId, (which
42  // // however allows for 0 in wire, layer, superlayer!!!)
43  //
44  // if ((wire_id < 1) || (wire_id > 100)) {
45  // std::cout << "DTNumberingScheme: ";
46  // std::cout << "wire id out of range: ";
47  // std::cout << wire_id <<std::endl;
48  // }
49 
50  // if ((layer_id < 1) || (layer_id > 4)) {
51  // std::cout << "DTNumberingScheme: ";
52  // std::cout << "layer id out of range: ";
53  // std::cout << layer_id <<std::endl;
54  // }
55 
56  // if ((superlayer_id < 1) || (superlayer_id > 3)) {
57  // std::cout << "DTNumberingScheme: ";
58  // std::cout << "super-layer id out of range: ";
59  // std::cout << superlayer_id <<std::endl;
60  // }
61 
62  return getDetId(num);
63 }

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

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

110  {
111  for (int level = 1; level <= num.getLevels(); level++) {
112  //decode
113  if (level == theWheelLevel) {
114  const int copyno = num.getBaseNo(level);
115  wheel_id = copyno - 2;
116 
117  } else if (level == theStationLevel) {
118  const int station_tag = num.getSuperNo(level);
119  const int copyno = num.getBaseNo(level);
120  station_id = station_tag;
121  sector_id = copyno + 1;
122 
123  } else if (level == theSuperLayerLevel) {
124  const int copyno = num.getBaseNo(level);
125  superlayer_id = copyno + 1;
126 
127  } else if (level == theLayerLevel) {
128  const int copyno = num.getBaseNo(level);
129  layer_id = copyno + 1;
130 
131  } else if (level == theWireLevel) {
132  const int copyno = num.getBaseNo(level);
133  wire_id = copyno + 1;
134  }
135  }
136 }

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

65  {
66  int wire_id = 0;
67  int layer_id = 0;
68  int superlayer_id = 0;
69  int sector_id = 0;
70  int station_id = 0;
71  int wheel_id = 0;
72 
73  //decode significant barrel levels
74  decode(num, wire_id, layer_id, superlayer_id, sector_id, station_id, wheel_id);
75 
76  // These ranges are enforced by DTWireId
77  // if ((sector_id < 1) || (sector_id > 14)) {
78  // std::cout << "DTNumberingScheme: ";
79  // std::cout << "sector id out of range: ";
80  // std::cout << sector_id <<std::endl;
81  // }
82 
83  // if ((station_id < 1) || (station_id > 4)) {
84  // std::cout << "DTNumberingScheme: ";
85  // std::cout << "station id out of range: ";
86  // std::cout << station_id <<std::endl;
87  // }
88 
89  // if ((wheel_id < -2) || (wheel_id > 2)) {
90  // std::cout << "DTNumberingScheme: ";
91  // std::cout << "wheel id out of range: ";
92  // std::cout << wheel_id <<std::endl;
93  // }
94 
95  DTWireId id(wheel_id, station_id, sector_id, superlayer_id, layer_id, wire_id);
96 
97 #ifdef LOCAL_DEBUG
98  edm::LogVerbatim("DTNumberingScheme") << "DTNumberingScheme: " << id;
99 #endif
100 
101  return id.rawId();
102 }

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

11  {
12  int theLevelPart = muonConstants.getValue("level");
13  theRegionLevel = muonConstants.getValue("mb_region") / theLevelPart;
14  theWheelLevel = muonConstants.getValue("mb_wheel") / theLevelPart;
15  theStationLevel = muonConstants.getValue("mb_station") / theLevelPart;
16  theSuperLayerLevel = muonConstants.getValue("mb_superlayer") / theLevelPart;
17  theLayerLevel = muonConstants.getValue("mb_layer") / theLevelPart;
18  theWireLevel = muonConstants.getValue("mb_wire") / theLevelPart;
19 #ifdef LOCAL_DEBUG
20  edm::LogVerbatim("DTNumberingScheme") << "Initialize DTNumberingScheme"
21  << "\ntheRegionLevel " << theRegionLevel << "\ntheWheelLevel " << theWheelLevel
22  << "\ntheStationLevel " << theStationLevel << "\ntheSuperLayerLevel "
23  << theSuperLayerLevel << "\ntheLayerLevel " << theLayerLevel
24  << "\ntheWireLevel " << theWireLevel;
25 #endif
26 }

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 48 of file DTNumberingScheme.h.

◆ DTGeometryParserFromDDD

friend class DTGeometryParserFromDDD
friend

Definition at line 49 of file DTNumberingScheme.h.

Member Data Documentation

◆ theLayerLevel

int DTNumberingScheme::theLayerLevel
private

Definition at line 43 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

◆ theRegionLevel

int DTNumberingScheme::theRegionLevel
private

Definition at line 39 of file DTNumberingScheme.h.

Referenced by initMe().

◆ theStationLevel

int DTNumberingScheme::theStationLevel
private

Definition at line 41 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

◆ theSuperLayerLevel

int DTNumberingScheme::theSuperLayerLevel
private

Definition at line 42 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

◆ theWheelLevel

int DTNumberingScheme::theWheelLevel
private

Definition at line 40 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

◆ theWireLevel

int DTNumberingScheme::theWireLevel
private

Definition at line 44 of file DTNumberingScheme.h.

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

personalPlayback.level
level
Definition: personalPlayback.py:22
DTNumberingScheme::theLayerLevel
int theLayerLevel
Definition: DTNumberingScheme.h:43
DTNumberingScheme::initMe
void initMe(const MuonGeometryConstants &muonConstants)
Definition: DTNumberingScheme.cc:11
DTNumberingScheme::theWireLevel
int theWireLevel
Definition: DTNumberingScheme.h:44
DTNumberingScheme::theStationLevel
int theStationLevel
Definition: DTNumberingScheme.h:41
DTNumberingScheme::getDetId
int getDetId(const MuonBaseNumber &num) const
Definition: DTNumberingScheme.cc:65
DTWireId
Definition: DTWireId.h:12
DTNumberingScheme::theRegionLevel
int theRegionLevel
Definition: DTNumberingScheme.h:39
edm::LogWarning
Definition: MessageLogger.h:141
edm::LogVerbatim
Definition: MessageLogger.h:297
MuonGeometryConstants::getValue
int getValue(const std::string &name) const
Definition: MuonGeometryConstants.cc:8
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
DTNumberingScheme::theSuperLayerLevel
int theSuperLayerLevel
Definition: DTNumberingScheme.h:42
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:104
DTNumberingScheme::theWheelLevel
int theWheelLevel
Definition: DTNumberingScheme.h:40