CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCNumberingScheme Class Reference

#include <CSCNumberingScheme.h>

Inheritance diagram for CSCNumberingScheme:
MuonNumberingScheme

Public Member Functions

int baseNumberToUnitNumber (const MuonBaseNumber &) override
 
 CSCNumberingScheme (const MuonDDDConstants &muonConstants)
 
 CSCNumberingScheme (const DDCompactView &cpv)
 
 ~CSCNumberingScheme () override
 
- Public Member Functions inherited from MuonNumberingScheme
 MuonNumberingScheme ()
 
virtual ~MuonNumberingScheme ()
 

Private Member Functions

int chamberIndex (int, int, int, int) const
 
void initMe (const MuonDDDConstants &muonConstants)
 

Private Attributes

int theLayerLevel
 
int theRegionLevel
 
int theRingLevel
 
int theSectorLevel
 
int theStationLevel
 
int theSubringLevel
 

Detailed Description

implementation of MuonNumberingScheme for muon endcaps, 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 CSCNumberingScheme.h.

Constructor & Destructor Documentation

CSCNumberingScheme::CSCNumberingScheme ( const MuonDDDConstants muonConstants)

Definition at line 9 of file CSCNumberingScheme.cc.

References initMe().

9 { initMe(muonConstants); }
void initMe(const MuonDDDConstants &muonConstants)
CSCNumberingScheme::CSCNumberingScheme ( const DDCompactView cpv)

Definition at line 11 of file CSCNumberingScheme.cc.

References initMe().

11  {
12  MuonDDDConstants muonConstants(cpv);
13  initMe(muonConstants);
14 }
void initMe(const MuonDDDConstants &muonConstants)
CSCNumberingScheme::~CSCNumberingScheme ( )
inlineoverride

Definition at line 23 of file CSCNumberingScheme.h.

References baseNumberToUnitNumber(), chamberIndex(), and initMe().

23 {};

Member Function Documentation

int CSCNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 32 of file CSCNumberingScheme.cc.

References chamberIndex(), MuonBaseNumber::getBaseNo(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), personalPlayback::level, LogDebug, CSCDetId::rawIdMaker(), alignCSCRings::ring_id, theLayerLevel, theRegionLevel, theRingLevel, theSectorLevel, theStationLevel, and theSubringLevel.

Referenced by CSCGeometryParsFromDD::build(), and ~CSCNumberingScheme().

32  {
33 #ifdef LOCAL_DEBUG
34  edm::LogVerbatim("CSCNumbering") << "CSCNumbering " << num.getLevels();
35  for (int level = 1; level <= num.getLevels(); level++) {
36  edm::LogVerbatim("CSCNumbering") << level << " " << num.getSuperNo(level) << " " << num.getBaseNo(level);
37  }
38 #endif
39 
40  int fwbw_id = 0;
41  int station_id = 0;
42  int ring_id = 0;
43  int subring_id = 0;
44  int sector_id = 0;
45  int layer_id = 0;
46 
47  // Decode endcap levels
48  // We should be able to work with 6 (layer-level) or 5 (chamber-level)
49 
50  for (int level = 1; level <= num.getLevels(); level++) {
51  if (level == theRegionLevel) {
52  const int copyno = num.getBaseNo(level);
53  fwbw_id = copyno + 1;
54  LogDebug("CSCNumbering") << "endcap=" << fwbw_id;
55 
56  } else if (level == theStationLevel) {
57  const int station_tag = num.getSuperNo(level);
58  station_id = station_tag;
59  LogDebug("CSCNumbering") << "station=" << station_id;
60 
61  } else if (level == theSubringLevel) {
62  const int copyno = num.getBaseNo(level);
63  subring_id = copyno + 1;
64  LogDebug("CSCNumbering") << "subring=" << subring_id;
65 
66  } else if (level == theSectorLevel) {
67  const int copyno = num.getBaseNo(level);
68  sector_id = copyno + 1;
69  LogDebug("CSCNumbering") << "sector=" << sector_id;
70 
71  } else if (level == theLayerLevel) {
72  const int copyno = num.getBaseNo(level);
73  layer_id = copyno + 1;
74  LogDebug("CSCNumbering") << "layer=" << layer_id;
75 
76  } else if (level == theRingLevel) {
77  const int ring_tag = num.getSuperNo(level);
78  ring_id = ring_tag;
79  LogDebug("CSCNumbering") << "ring=" << ring_id;
80  }
81  }
82 
83  // check validity
84 
85  if ((fwbw_id < 1) || (fwbw_id > 2)) {
86  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
87  << "forward/backward id out of range:" << fwbw_id;
88  }
89 
90  if ((station_id < 1) || (station_id > 4)) {
91  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
92  << "station id out of range:" << station_id;
93  }
94 
95  if ((ring_id < 1) || (ring_id > 4)) {
96  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
97  << "ring id out of range:" << ring_id;
98  }
99 
100  if ((subring_id < 1) || (subring_id > 2)) {
101  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
102  << "subring id out of range:" << subring_id;
103  }
104 
105  if ((sector_id < 1) || (sector_id > 36)) {
106  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
107  << "sector id out of range:" << sector_id;
108  }
109 
110  // Allow id=0 since that means a chamber
111  if ((layer_id < 0) || (layer_id > 6)) {
112  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
113  << "layer id out of range" << layer_id;
114  }
115 
116  // find appropriate chamber label
117 
118  int chamber_id = chamberIndex(station_id, ring_id, subring_id, sector_id);
119 
120  // convert into raw id of appropriate DetId
121 
122  int intIndex = CSCDetId::rawIdMaker(fwbw_id, station_id, ring_id, chamber_id, layer_id);
123 
124 #ifdef LOCAL_DEBUG
125  edm::LogVerbatim("CSCNumbering") << "CSCNumberingScheme : fw/bw " << fwbw_id << " station " << station_id << " ring "
126  << ring_id << " subring " << subring_id << " chamber " << chamber_id << " sector "
127  << sector_id << " layer " << layer_id;
128 #endif
129 
130  return intIndex;
131 }
#define LogDebug(id)
int getBaseNo(int level) const
static int rawIdMaker(int iendcap, int istation, int iring, int ichamber, int ilayer)
Definition: CSCDetId.h:131
int chamberIndex(int, int, int, int) const
int getLevels() const
int getSuperNo(int level) const
int CSCNumberingScheme::chamberIndex ( int  station_id,
int  ring_id,
int  subring_id,
int  sector_id 
) const
private

Tim Cox - IMPORTANT - this is where we set CSC chamber labelling

Definition at line 133 of file CSCNumberingScheme.cc.

Referenced by baseNumberToUnitNumber(), and ~CSCNumberingScheme().

133  {
134  int chamber_id = 0;
135 
136  // chamber label is related to sector_id but we need to
137  // adjust to real hardware labelling
138  // Tim confirms this works properly according to CMS IN 2000/004 Version 2.5 March 2007.
139 
140  if (ring_id == 3) {
141  chamber_id = sector_id;
142  } else {
143  if (subring_id == 1) {
144  chamber_id = 2 * sector_id - 1;
145  } else {
146  chamber_id = 2 * sector_id;
147  }
148  }
149 
150  return chamber_id;
151 }
void CSCNumberingScheme::initMe ( const MuonDDDConstants muonConstants)
private

Definition at line 16 of file CSCNumberingScheme.cc.

References MuonDDDConstants::getValue(), theLayerLevel, theRegionLevel, theRingLevel, theSectorLevel, theStationLevel, and theSubringLevel.

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

16  {
17  int theLevelPart = muonConstants.getValue("level");
18  theRegionLevel = muonConstants.getValue("me_region") / theLevelPart;
19  theStationLevel = muonConstants.getValue("me_station") / theLevelPart;
20  theSubringLevel = muonConstants.getValue("me_subring") / theLevelPart;
21  theSectorLevel = muonConstants.getValue("me_sector") / theLevelPart;
22  theRingLevel = muonConstants.getValue("me_ring") / theLevelPart;
23  theLayerLevel = muonConstants.getValue("me_layer") / theLevelPart;
24 #ifdef LOCAL_DEBUG
25  edm::LogVerbatim("CSCNumbering") << "Initialize CSCNumberingScheme"
26  << "\ntheRegionLevel " << theRegionLevel << "\ntheStationLevel " << theStationLevel
27  << "\ntheSubringLevel " << theSubringLevel << "\ntheSectorLevel " << theSectorLevel
28  << "\ntheRingLevel " << theRingLevel << "\ntheLayerLevel " << theLayerLevel;
29 #endif
30 }
int getValue(const std::string &name) const

Member Data Documentation

int CSCNumberingScheme::theLayerLevel
private

Definition at line 38 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int CSCNumberingScheme::theRegionLevel
private

Definition at line 34 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int CSCNumberingScheme::theRingLevel
private

Definition at line 39 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int CSCNumberingScheme::theSectorLevel
private

Definition at line 37 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int CSCNumberingScheme::theStationLevel
private

Definition at line 35 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int CSCNumberingScheme::theSubringLevel
private

Definition at line 36 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().