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
CSCNumberingScheme Class Reference

#include <CSCNumberingScheme.h>

Inheritance diagram for CSCNumberingScheme:
MuonNumberingScheme

Public Member Functions

virtual int baseNumberToUnitNumber (const MuonBaseNumber &)
 
 CSCNumberingScheme (const MuonDDDConstants &muonConstants)
 
 CSCNumberingScheme (const DDCompactView &cpv)
 
 ~CSCNumberingScheme ()
 
- 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 11 of file CSCNumberingScheme.cc.

References initMe().

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

Definition at line 15 of file CSCNumberingScheme.cc.

References initMe().

16 {
17  MuonDDDConstants muonConstants(cpv);
18  initMe(muonConstants);
19 }
void initMe(const MuonDDDConstants &muonConstants)
CSCNumberingScheme::~CSCNumberingScheme ( )
inline

Definition at line 24 of file CSCNumberingScheme.h.

24 {};

Member Function Documentation

int CSCNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
virtual

Reimplemented from MuonNumberingScheme.

Definition at line 40 of file CSCNumberingScheme.cc.

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

Referenced by CSCGeometryParsFromDD::build().

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

Referenced by baseNumberToUnitNumber().

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

Definition at line 21 of file CSCNumberingScheme.cc.

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

Referenced by CSCNumberingScheme().

21  {
22  int theLevelPart=muonConstants.getValue("level");
23  theRegionLevel=muonConstants.getValue("me_region")/theLevelPart;
24  theStationLevel=muonConstants.getValue("me_station")/theLevelPart;
25  theSubringLevel=muonConstants.getValue("me_subring")/theLevelPart;
26  theSectorLevel=muonConstants.getValue("me_sector")/theLevelPart;
27  theRingLevel=muonConstants.getValue("me_ring")/theLevelPart;
28  theLayerLevel=muonConstants.getValue("me_layer")/theLevelPart;
29 #ifdef LOCAL_DEBUG
30  std::cout << "Initialize CSCNumberingScheme" << std::endl;
31  std::cout << "theRegionLevel " << theRegionLevel <<std::endl;
32  std::cout << "theStationLevel " << theStationLevel <<std::endl;
33  std::cout << "theSubringLevel " << theSubringLevel <<std::endl;
34  std::cout << "theSectorLevel " << theSectorLevel <<std::endl;
35  std::cout << "theRingLevel " << theRingLevel <<std::endl;
36  std::cout << "theLayerLevel " << theLayerLevel <<std::endl;
37 #endif
38 }
int getValue(const std::string &name) const
tuple cout
Definition: gather_cfg.py:145

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