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.

9 { initMe(muonConstants); }

References initMe().

◆ ~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.

27  {
28 #ifdef EDM_ML_DEBUG
29  edm::LogVerbatim("CSCNumbering") << "CSCNumbering " << num.getLevels();
30  for (int level = 1; level <= num.getLevels(); level++) {
31  edm::LogVerbatim("CSCNumbering") << 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  LogDebug("CSCNumbering") << "endcap=" << fwbw_id;
49 
50  } else if (level == theStationLevel) {
51  const int station_tag = num.getSuperNo(level);
52  station_id = station_tag;
53  LogDebug("CSCNumbering") << "station=" << station_id;
54  } else if (level == theSubringLevel) {
55  const int copyno = num.getBaseNo(level);
56  subring_id = copyno + 1;
57  LogDebug("CSCNumbering") << "subring=" << subring_id;
58  } else if (level == theSectorLevel) {
59  const int copyno = num.getBaseNo(level);
60  sector_id = copyno + 1;
61  LogDebug("CSCNumbering") << "sector=" << sector_id;
62  } else if (level == theLayerLevel) {
63  const int copyno = num.getBaseNo(level);
64  layer_id = copyno + 1;
65  LogDebug("CSCNumbering") << "layer=" << layer_id;
66  } else if (level == theRingLevel) {
67  const int ring_tag = num.getSuperNo(level);
68  ring_id = ring_tag;
69  LogDebug("CSCNumbering") << "ring=" << ring_id;
70  }
71  }
72 
73  // check validity
74 
75  if ((fwbw_id < 1) || (fwbw_id > 2)) {
76  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
77  << "forward/backward id out of range:" << fwbw_id;
78  }
79 
80  if ((station_id < 1) || (station_id > 4)) {
81  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
82  << "station id out of range:" << station_id;
83  }
84 
85  if ((ring_id < 1) || (ring_id > 4)) {
86  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
87  << "ring id out of range:" << ring_id;
88  }
89 
90  if ((subring_id < 1) || (subring_id > 2)) {
91  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
92  << "subring id out of range:" << subring_id;
93  }
94 
95  if ((sector_id < 1) || (sector_id > 36)) {
96  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
97  << "sector id out of range:" << sector_id;
98  }
99 
100  // Allow id=0 since that means a chamber
101  if ((layer_id < 0) || (layer_id > 6)) {
102  edm::LogError("CSCNumbering") << "@SUB=CSCNumberingScheme::baseNumberToUnitNumber"
103  << "layer id out of range" << layer_id;
104  }
105 
106  // find appropriate chamber label
107 
108  int chamber_id = chamberIndex(station_id, ring_id, subring_id, sector_id);
109 
110  // convert into raw id of appropriate DetId
111 
112  int intIndex = CSCDetId::rawIdMaker(fwbw_id, station_id, ring_id, chamber_id, layer_id);
113 
114 #ifdef EDM_ML_DEBUG
115  edm::LogVerbatim("CSCNumbering") << "CSCNumberingScheme : fw/bw " << fwbw_id << " station " << station_id << " ring "
116  << ring_id << " subring " << subring_id << " chamber " << chamber_id << " sector "
117  << sector_id << " layer " << layer_id;
118 #endif
119 
120  return intIndex;
121 }

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

Referenced by CSCGeometryParsFromDD::build().

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

123  {
124  int chamber_id = 0;
125 
126  // chamber label is related to sector_id but we need to
127  // adjust to real hardware labelling
128  // Tim confirms this works properly according to CMS IN 2000/004 Version 2.5 March 2007.
129 
130  if (ring_id == 3) {
131  chamber_id = sector_id;
132  } else {
133  if (subring_id == 1) {
134  chamber_id = 2 * sector_id - 1;
135  } else {
136  chamber_id = 2 * sector_id;
137  }
138  }
139 
140  return chamber_id;
141 }

References alignCSCRings::ring_id.

Referenced by baseNumberToUnitNumber().

◆ initMe()

void CSCNumberingScheme::initMe ( const MuonGeometryConstants muonConstants)
private

Definition at line 11 of file CSCNumberingScheme.cc.

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("CSCNumbering") << "Initialize CSCNumberingScheme"
21  << "\ntheRegionLevel " << theRegionLevel << "\ntheStationLevel " << theStationLevel
22  << "\ntheSubringLevel " << theSubringLevel << "\ntheSectorLevel " << theSectorLevel
23  << "\ntheRingLevel " << theRingLevel << "\ntheLayerLevel " << theLayerLevel;
24 #endif
25 }

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

Referenced by CSCNumberingScheme().

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

personalPlayback.level
level
Definition: personalPlayback.py:22
CSCNumberingScheme::initMe
void initMe(const MuonGeometryConstants &muonConstants)
Definition: CSCNumberingScheme.cc:11
CSCNumberingScheme::theStationLevel
int theStationLevel
Definition: CSCNumberingScheme.h:33
CSCDetId::rawIdMaker
static int rawIdMaker(int iendcap, int istation, int iring, int ichamber, int ilayer)
Definition: CSCDetId.h:131
alignCSCRings.ring_id
string ring_id
Definition: alignCSCRings.py:79
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
CSCNumberingScheme::theRegionLevel
int theRegionLevel
Definition: CSCNumberingScheme.h:32
MuonGeometryConstants::getValue
int getValue(const std::string &name) const
Definition: MuonGeometryConstants.cc:8
CSCNumberingScheme::chamberIndex
int chamberIndex(int, int, int, int) const
Definition: CSCNumberingScheme.cc:123
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
CSCNumberingScheme::theSectorLevel
int theSectorLevel
Definition: CSCNumberingScheme.h:35
CSCNumberingScheme::theRingLevel
int theRingLevel
Definition: CSCNumberingScheme.h:37
CSCNumberingScheme::theLayerLevel
int theLayerLevel
Definition: CSCNumberingScheme.h:36
CSCNumberingScheme::theSubringLevel
int theSubringLevel
Definition: CSCNumberingScheme.h:34