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  {
10  initMe(muonConstants);
11 }
void initMe(const MuonDDDConstants &muonConstants)
CSCNumberingScheme::CSCNumberingScheme ( const DDCompactView cpv)

Definition at line 13 of file CSCNumberingScheme.cc.

References initMe().

14 {
15  MuonDDDConstants muonConstants(cpv);
16  initMe(muonConstants);
17 }
void initMe(const MuonDDDConstants &muonConstants)
CSCNumberingScheme::~CSCNumberingScheme ( )
inlineoverride

Definition at line 24 of file CSCNumberingScheme.h.

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

24 {};

Member Function Documentation

int CSCNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 39 of file CSCNumberingScheme.cc.

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

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

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

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

141  {
142 
143  int chamber_id=0;
144 
145  // chamber label is related to sector_id but we need to
146  // adjust to real hardware labelling
147  // Tim confirms this works properly according to CMS IN 2000/004 Version 2.5 March 2007.
148 
149  if (ring_id == 3) {
150  chamber_id=sector_id;
151  } else {
152  if (subring_id == 1) {
153  chamber_id=2*sector_id-1;
154  } else {
155  chamber_id=2*sector_id;
156  }
157  }
158 
159  return chamber_id;
160 
161 }
void CSCNumberingScheme::initMe ( const MuonDDDConstants muonConstants)
private

Definition at line 19 of file CSCNumberingScheme.cc.

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

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

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

Member Data Documentation

int CSCNumberingScheme::theLayerLevel
private

Definition at line 40 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int CSCNumberingScheme::theRegionLevel
private

Definition at line 36 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int CSCNumberingScheme::theRingLevel
private

Definition at line 41 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int CSCNumberingScheme::theSectorLevel
private

Definition at line 39 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int CSCNumberingScheme::theStationLevel
private

Definition at line 37 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int CSCNumberingScheme::theSubringLevel
private

Definition at line 38 of file CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().