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 DDCompactView &cpv)
 
 DTNumberingScheme (const MuonDDDConstants &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 MuonDDDConstants &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 20 of file DTNumberingScheme.h.

Constructor & Destructor Documentation

DTNumberingScheme::DTNumberingScheme ( const DDCompactView cpv)

Definition at line 13 of file DTNumberingScheme.cc.

References initMe().

13  {
14  MuonDDDConstants muonConstants(cpv);
15  initMe(muonConstants);
16 }
void initMe(const MuonDDDConstants &muonConstants)
DTNumberingScheme::DTNumberingScheme ( const MuonDDDConstants muonConstants)

Definition at line 9 of file DTNumberingScheme.cc.

References initMe().

9  {
10  initMe(muonConstants);
11 }
void initMe(const MuonDDDConstants &muonConstants)
DTNumberingScheme::~DTNumberingScheme ( )
inlineoverride

Definition at line 25 of file DTNumberingScheme.h.

References baseNumberToUnitNumber(), decode(), getDetId(), initMe(), and pileupDistInMC::num.

25 {}

Member Function Documentation

int DTNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 39 of file DTNumberingScheme.cc.

References MuonBaseNumber::getBaseNo(), getDetId(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), hcalDigis_cfi::level, and theWireLevel.

Referenced by ~DTNumberingScheme().

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

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

Referenced by getDetId(), and ~DTNumberingScheme().

133  {
134  for (int level=1;level<=num.getLevels();level++) {
135 
136  //decode
137  if (level==theWheelLevel) {
138  const int copyno=num.getBaseNo(level);
139  wheel_id=copyno-2;
140 
141  } else if (level==theStationLevel) {
142  const int station_tag = num.getSuperNo(level);
143  const int copyno = num.getBaseNo(level);
144  station_id=station_tag;
145  sector_id=copyno+1;
146 
147  } else if (level==theSuperLayerLevel) {
148  const int copyno = num.getBaseNo(level);
149  superlayer_id = copyno + 1;
150 
151  } else if (level==theLayerLevel) {
152  const int copyno = num.getBaseNo(level);
153  layer_id=copyno+1;
154 
155  } else if (level==theWireLevel) {
156  const int copyno = num.getBaseNo(level);
157  wire_id = copyno+1;
158  }
159  }
160 }
int getBaseNo(int level) const
int getLevels() const
int getSuperNo(int level) const
int DTNumberingScheme::getDetId ( const MuonBaseNumber num) const

Definition at line 81 of file DTNumberingScheme.cc.

References decode(), and triggerObjects_cff::id.

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

81  {
82 
83  int wire_id=0;
84  int layer_id=0;
85  int superlayer_id=0;
86  int sector_id=0;
87  int station_id=0;
88  int wheel_id=0;
89 
90  //decode significant barrel levels
91  decode(num,
92  wire_id,
93  layer_id,
94  superlayer_id,
95  sector_id,
96  station_id,
97  wheel_id);
98 
99 // These ranges are enforced by DTWireId
100 // if ((sector_id < 1) || (sector_id > 14)) {
101 // std::cout << "DTNumberingScheme: ";
102 // std::cout << "sector id out of range: ";
103 // std::cout << sector_id <<std::endl;
104 // }
105 
106 // if ((station_id < 1) || (station_id > 4)) {
107 // std::cout << "DTNumberingScheme: ";
108 // std::cout << "station id out of range: ";
109 // std::cout << station_id <<std::endl;
110 // }
111 
112 // if ((wheel_id < -2) || (wheel_id > 2)) {
113 // std::cout << "DTNumberingScheme: ";
114 // std::cout << "wheel id out of range: ";
115 // std::cout << wheel_id <<std::endl;
116 // }
117 
118  DTWireId id(wheel_id,station_id,sector_id,superlayer_id,layer_id,wire_id);
119 
120 #ifdef LOCAL_DEBUG
121  edm::LogVerbatim("DTNumberingScheme") << "DTNumberingScheme: " << id;
122 #endif
123 
124  return id.rawId();
125 }
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 MuonDDDConstants muonConstants)
private

Definition at line 18 of file DTNumberingScheme.cc.

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

Referenced by DTNumberingScheme(), and ~DTNumberingScheme().

18  {
19  int theLevelPart=muonConstants.getValue("level");
20  theRegionLevel=muonConstants.getValue("mb_region")/theLevelPart;
21  theWheelLevel=muonConstants.getValue("mb_wheel")/theLevelPart;
22  theStationLevel=muonConstants.getValue("mb_station")/theLevelPart;
23  theSuperLayerLevel=muonConstants.getValue("mb_superlayer")/theLevelPart;
24  theLayerLevel=muonConstants.getValue("mb_layer")/theLevelPart;
25  theWireLevel=muonConstants.getValue("mb_wire")/theLevelPart;
26 #ifdef LOCAL_DEBUG
27  edm::LogVerbatim("DTNumberingScheme")
28  << "Initialize DTNumberingScheme"
29  << "\ntheRegionLevel " << theRegionLevel
30  << "\ntheWheelLevel " << theWheelLevel
31  << "\ntheStationLevel " << theStationLevel
32  << "\ntheSuperLayerLevel " << theSuperLayerLevel
33  << "\ntheLayerLevel " << theLayerLevel
34  << "\ntheWireLevel " << theWireLevel;
35 #endif
36 
37 }
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 53 of file DTNumberingScheme.h.

friend class DTGeometryParserFromDDD
friend

Definition at line 54 of file DTNumberingScheme.h.

Member Data Documentation

int DTNumberingScheme::theLayerLevel
private

Definition at line 48 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theRegionLevel
private

Definition at line 44 of file DTNumberingScheme.h.

Referenced by initMe().

int DTNumberingScheme::theStationLevel
private

Definition at line 46 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theSuperLayerLevel
private

Definition at line 47 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theWheelLevel
private

Definition at line 45 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theWireLevel
private

Definition at line 49 of file DTNumberingScheme.h.

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