CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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

virtual int baseNumberToUnitNumber (const MuonBaseNumber num)
 
 DTNumberingScheme (const DDCompactView &cpv)
 
 DTNumberingScheme (const MuonDDDConstants &muonConstants)
 
int getDetId (const MuonBaseNumber num) const
 
 ~DTNumberingScheme ()
 
- 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

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

Date:
2007/09/13 12:33:10
Revision:
1.6
Author
Arno Straessner, CERN arno..nosp@m.stra.nosp@m.essne.nosp@m.r@ce.nosp@m.rn.ch

Definition at line 22 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 ( )
inline

Definition at line 27 of file DTNumberingScheme.h.

27 {}

Member Function Documentation

int DTNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber  num)
virtual

Reimplemented from MuonNumberingScheme.

Definition at line 37 of file DTNumberingScheme.cc.

References gather_cfg::cout, MuonBaseNumber::getBaseNo(), getDetId(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), testEve_cfg::level, and theWireLevel.

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

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

Referenced by getDetId().

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

Definition at line 79 of file DTNumberingScheme.cc.

References gather_cfg::cout, and decode().

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

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

Definition at line 18 of file DTNumberingScheme.cc.

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

Referenced by 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  std::cout << "theRegionLevel " << theRegionLevel <<std::endl;
28  std::cout << "theWheelLevel " << theWheelLevel <<std::endl;
29  std::cout << "theStationLevel " << theStationLevel <<std::endl;
30  std::cout << "theSuperLayerLevel " << theSuperLayerLevel <<std::endl;
31  std::cout << "theLayerLevel " << theLayerLevel <<std::endl;
32  std::cout << "theWireLevel " << theWireLevel <<std::endl;
33  #endif
34 
35 }
int getValue(const std::string &name) const
tuple cout
Definition: gather_cfg.py:41

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

friend class DTGeometryParserFromDDD
friend

Definition at line 56 of file DTNumberingScheme.h.

Member Data Documentation

int DTNumberingScheme::theLayerLevel
private

Definition at line 50 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theRegionLevel
private

Definition at line 46 of file DTNumberingScheme.h.

Referenced by initMe().

int DTNumberingScheme::theStationLevel
private

Definition at line 48 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theSuperLayerLevel
private

Definition at line 49 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theWheelLevel
private

Definition at line 47 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theWireLevel
private

Definition at line 51 of file DTNumberingScheme.h.

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