CMS 3D CMS Logo

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

#include <DD4hep_CSCNumberingScheme.h>

Public Member Functions

void baseNumberToUnitNumber (const MuonBaseNumber &)
 
 CSCNumberingScheme (const MuonConstants &muonConstants)
 
int getDetId () const
 

Private Member Functions

int chamberIndex (int, int, int, int) const
 
const int get (const char *, const MuonConstants &) const
 
void initMe (const MuonConstants &muonConstants)
 
void setDetId (int idnew)
 

Private Attributes

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

Detailed Description

Definition at line 20 of file DD4hep_CSCNumberingScheme.h.

Constructor & Destructor Documentation

◆ CSCNumberingScheme()

CSCNumberingScheme::CSCNumberingScheme ( const MuonConstants muonConstants)

Definition at line 21 of file DD4hep_CSCNumberingScheme.cc.

21 { initMe(muonConstants); }

References initMe().

Member Function Documentation

◆ baseNumberToUnitNumber()

void CSCNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)

Definition at line 34 of file DD4hep_CSCNumberingScheme.cc.

34  {
35  int fwbw_id = 0;
36  int station_id = 0;
37  int ring_id = 0;
38  int subring_id = 0;
39  int sector_id = 0;
40  int layer_id = 0;
41 
42  // Decode endcap levels
43  // We should be able to work with 6 (layer-level) or 5 (chamber-level)
44 
45  for (int level = 1; level <= num.getLevels(); level++) {
46  if (level == theRegionLevel) {
47  const int copyno = num.getBaseNo(level);
48  fwbw_id = copyno + 1;
49  } else if (level == theStationLevel) {
50  const int station_tag = num.getSuperNo(level);
51  station_id = station_tag;
52  } else if (level == theSubringLevel) {
53  const int copyno = num.getBaseNo(level);
54  subring_id = copyno + 1;
55  } else if (level == theSectorLevel) {
56  const int copyno = num.getBaseNo(level);
57  sector_id = copyno + 1;
58  } else if (level == theLayerLevel) {
59  const int copyno = num.getBaseNo(level);
60  layer_id = copyno + 1;
61  } else if (level == theRingLevel) {
62  const int ring_tag = num.getSuperNo(level);
63  ring_id = ring_tag;
64  }
65  }
66 
67  // find appropriate chamber label
68 
69  int chamber_id = chamberIndex(station_id, ring_id, subring_id, sector_id);
70 
71  // convert into raw id of appropriate DetId
72 
73  int intIndex = CSCDetId::rawIdMaker(fwbw_id, station_id, ring_id, chamber_id, layer_id);
74 
75  setDetId(intIndex);
76 }

References chamberIndex(), personalPlayback::level, EgammaValidation_cff::num, CSCDetId::rawIdMaker(), alignCSCRings::ring_id, setDetId(), 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

Definition at line 78 of file DD4hep_CSCNumberingScheme.cc.

78  {
79  int chamber_id = 0;
80 
81  // chamber label is related to sector_id but we need to
82  // adjust to real hardware labelling
83  // Tim confirms this works properly according to CMS IN 2000/004 Version 2.5 March 2007.
84 
85  if (ring_id == 3) {
86  chamber_id = sector_id;
87  } else {
88  if (subring_id == 1) {
89  chamber_id = 2 * sector_id - 1;
90  } else {
91  chamber_id = 2 * sector_id;
92  }
93  }
94 
95  return chamber_id;
96 }

References alignCSCRings::ring_id.

Referenced by baseNumberToUnitNumber().

◆ get()

const int CSCNumberingScheme::get ( const char *  key,
const MuonConstants muonConstants 
) const
private

◆ getDetId()

int cms::CSCNumberingScheme::getDetId ( void  ) const
inline

Definition at line 24 of file DD4hep_CSCNumberingScheme.h.

24 { return detId; }

References detId.

◆ initMe()

void CSCNumberingScheme::initMe ( const MuonConstants muonConstants)
private

Definition at line 23 of file DD4hep_CSCNumberingScheme.cc.

23  {
24  int theLevelPart = get("level", muonConstants);
25  assert(theLevelPart != 0);
26  theRegionLevel = get("me_region", muonConstants) / theLevelPart;
27  theStationLevel = get("me_station", muonConstants) / theLevelPart;
28  theSubringLevel = get("me_subring", muonConstants) / theLevelPart;
29  theSectorLevel = get("me_sector", muonConstants) / theLevelPart;
30  theRingLevel = get("me_ring", muonConstants) / theLevelPart;
31  theLayerLevel = get("me_layer", muonConstants) / theLevelPart;
32 }

References cms::cuda::assert(), get(), theLayerLevel, theRegionLevel, theRingLevel, theSectorLevel, theStationLevel, and theSubringLevel.

Referenced by CSCNumberingScheme().

◆ setDetId()

void cms::CSCNumberingScheme::setDetId ( int  idnew)
inlineprivate

Definition at line 29 of file DD4hep_CSCNumberingScheme.h.

29 { detId = idnew; }

References detId.

Referenced by baseNumberToUnitNumber().

Member Data Documentation

◆ detId

int cms::CSCNumberingScheme::detId
private

Definition at line 40 of file DD4hep_CSCNumberingScheme.h.

Referenced by getDetId(), and setDetId().

◆ theLayerLevel

int cms::CSCNumberingScheme::theLayerLevel
private

Definition at line 37 of file DD4hep_CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theRegionLevel

int cms::CSCNumberingScheme::theRegionLevel
private

Definition at line 33 of file DD4hep_CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theRingLevel

int cms::CSCNumberingScheme::theRingLevel
private

Definition at line 38 of file DD4hep_CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theSectorLevel

int cms::CSCNumberingScheme::theSectorLevel
private

Definition at line 36 of file DD4hep_CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theStationLevel

int cms::CSCNumberingScheme::theStationLevel
private

Definition at line 34 of file DD4hep_CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theSubringLevel

int cms::CSCNumberingScheme::theSubringLevel
private

Definition at line 35 of file DD4hep_CSCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

personalPlayback.level
level
Definition: personalPlayback.py:22
cms::CSCNumberingScheme::chamberIndex
int chamberIndex(int, int, int, int) const
Definition: DD4hep_CSCNumberingScheme.cc:78
cms::CSCNumberingScheme::initMe
void initMe(const MuonConstants &muonConstants)
Definition: DD4hep_CSCNumberingScheme.cc:23
cms::cuda::assert
assert(be >=bs)
cms::CSCNumberingScheme::theRegionLevel
int theRegionLevel
Definition: DD4hep_CSCNumberingScheme.h:33
CSCDetId::rawIdMaker
static int rawIdMaker(int iendcap, int istation, int iring, int ichamber, int ilayer)
Definition: CSCDetId.h:131
end
#define end
Definition: vmac.h:39
cms::CSCNumberingScheme::detId
int detId
Definition: DD4hep_CSCNumberingScheme.h:40
cms::CSCNumberingScheme::theStationLevel
int theStationLevel
Definition: DD4hep_CSCNumberingScheme.h:34
alignCSCRings.ring_id
string ring_id
Definition: alignCSCRings.py:79
cms::CSCNumberingScheme::setDetId
void setDetId(int idnew)
Definition: DD4hep_CSCNumberingScheme.h:29
cms::CSCNumberingScheme::theLayerLevel
int theLayerLevel
Definition: DD4hep_CSCNumberingScheme.h:37
cms::CSCNumberingScheme::theRingLevel
int theRingLevel
Definition: DD4hep_CSCNumberingScheme.h:38
cms::CSCNumberingScheme::theSubringLevel
int theSubringLevel
Definition: DD4hep_CSCNumberingScheme.h:35
cms::CSCNumberingScheme::theSectorLevel
int theSectorLevel
Definition: DD4hep_CSCNumberingScheme.h:36
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
mps_fire.result
result
Definition: mps_fire.py:303
crabWrapper.key
key
Definition: crabWrapper.py:19
cms::CSCNumberingScheme::get
const int get(const char *, const MuonConstants &) const
Definition: DD4hep_CSCNumberingScheme.cc:98