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 &) const override
 
 CSCNumberingScheme (const MuonGeometryConstants &muonConstants)
 
 ~CSCNumberingScheme () override
 
- Public Member Functions inherited from MuonNumberingScheme
 MuonNumberingScheme ()
 
virtual ~MuonNumberingScheme ()
 

Private Member Functions

int chamberIndex (int, int, int, int) const
 
void initMe (const MuonGeometryConstants &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 18 of file CSCNumberingScheme.h.

Constructor & Destructor Documentation

◆ CSCNumberingScheme()

CSCNumberingScheme::CSCNumberingScheme ( const MuonGeometryConstants muonConstants)

Definition at line 9 of file CSCNumberingScheme.cc.

References initMe().

9 { initMe(muonConstants); }
void initMe(const MuonGeometryConstants &muonConstants)

◆ ~CSCNumberingScheme()

CSCNumberingScheme::~CSCNumberingScheme ( )
inlineoverride

Definition at line 21 of file CSCNumberingScheme.h.

21 {}

Member Function Documentation

◆ baseNumberToUnitNumber()

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

Reimplemented from MuonNumberingScheme.

Definition at line 27 of file CSCNumberingScheme.cc.

References chamberIndex(), gammaJetAnalysis_CHSJECs_cff::level, EgammaValidation_cff::num, CSCDetId::rawIdMaker(), alignCSCRings::ring_id, theLayerLevel, theRegionLevel, theRingLevel, theSectorLevel, theStationLevel, and theSubringLevel.

Referenced by CSCGeometryParsFromDD::build().

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

◆ chamberIndex()

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 134 of file CSCNumberingScheme.cc.

References alignCSCRings::ring_id.

Referenced by baseNumberToUnitNumber().

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

◆ initMe()

void CSCNumberingScheme::initMe ( const MuonGeometryConstants muonConstants)
private

Definition at line 11 of file CSCNumberingScheme.cc.

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

Referenced by CSCNumberingScheme().

11  {
12  int theLevelPart = muonConstants.getValue("level");
13  theRegionLevel = muonConstants.getValue("me_region") / theLevelPart;
14  theStationLevel = muonConstants.getValue("me_station") / theLevelPart;
15  theSubringLevel = muonConstants.getValue("me_subring") / theLevelPart;
16  theSectorLevel = muonConstants.getValue("me_sector") / theLevelPart;
17  theRingLevel = muonConstants.getValue("me_ring") / theLevelPart;
18  theLayerLevel = muonConstants.getValue("me_layer") / theLevelPart;
19 #ifdef EDM_ML_DEBUG
20  edm::LogVerbatim("MuonGeom") << "Initialize CSCNumberingScheme"
21  << "\ntheRegionLevel " << theRegionLevel << "\ntheStationLevel " << theStationLevel
22  << "\ntheSubringLevel " << theSubringLevel << "\ntheSectorLevel " << theSectorLevel
23  << "\ntheRingLevel " << theRingLevel << "\ntheLayerLevel " << theLayerLevel;
24 #endif
25 }
int getValue(const std::string &name) const
Log< level::Info, true > LogVerbatim

Member Data Documentation

◆ theLayerLevel

int CSCNumberingScheme::theLayerLevel
private

Definition at line 36 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theRegionLevel

int CSCNumberingScheme::theRegionLevel
private

Definition at line 32 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theRingLevel

int CSCNumberingScheme::theRingLevel
private

Definition at line 37 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theSectorLevel

int CSCNumberingScheme::theSectorLevel
private

Definition at line 35 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theStationLevel

int CSCNumberingScheme::theStationLevel
private

Definition at line 33 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theSubringLevel

int CSCNumberingScheme::theSubringLevel
private

Definition at line 34 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().