CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
GEMNumberingScheme Class Reference

#include <GEMNumberingScheme.h>

Inheritance diagram for GEMNumberingScheme:
MuonNumberingScheme

Public Member Functions

virtual int baseNumberToUnitNumber (const MuonBaseNumber &)
 
 GEMNumberingScheme (const DDCompactView &cpv)
 
 GEMNumberingScheme (const MuonDDDConstants &muonConstants)
 
virtual ~GEMNumberingScheme ()
 
- Public Member Functions inherited from MuonNumberingScheme
 MuonNumberingScheme ()
 
virtual ~MuonNumberingScheme ()
 

Private Member Functions

void initMe (const MuonDDDConstants &muonConstants)
 

Private Attributes

int theRegionLevel
 
int theRingLevel
 
int theRollLevel
 
int theSectorLevel
 
int theStationLevel
 

Detailed Description

Definition at line 10 of file GEMNumberingScheme.h.

Constructor & Destructor Documentation

GEMNumberingScheme::GEMNumberingScheme ( const DDCompactView cpv)

Definition at line 13 of file GEMNumberingScheme.cc.

References initMe().

13  {
14  MuonDDDConstants muonConstants(cpv);
15  initMe(muonConstants);
16 }
void initMe(const MuonDDDConstants &muonConstants)
GEMNumberingScheme::GEMNumberingScheme ( const MuonDDDConstants muonConstants)

Definition at line 9 of file GEMNumberingScheme.cc.

References initMe().

9  {
10  initMe(muonConstants);
11 }
void initMe(const MuonDDDConstants &muonConstants)
virtual GEMNumberingScheme::~GEMNumberingScheme ( )
inlinevirtual

Definition at line 17 of file GEMNumberingScheme.h.

References baseNumberToUnitNumber(), and initMe().

17 {};

Member Function Documentation

int GEMNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
virtual

Reimplemented from MuonNumberingScheme.

Definition at line 35 of file GEMNumberingScheme.cc.

References relativeConstraints::chamber, gather_cfg::cout, MuonBaseNumber::getBaseNo(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), hcalTTPDigis_cfi::id, hcalDigis_cfi::level, relativeConstraints::ring, relativeConstraints::station, theRegionLevel, theRollLevel, theSectorLevel, and theStationLevel.

Referenced by GEMGeometryParsFromDD::buildGeometry(), GEMGeometryBuilderFromDDD::buildGeometry(), and ~GEMNumberingScheme().

35  {
36 
37 #ifdef LOCAL_DEBUG
38  std::cout << "GEMNumbering "<<num.getLevels()<<std::endl;
39  for (int level=1;level<=num.getLevels();level++) {
40  std::cout << level << " " << num.getSuperNo(level)
41  << " " << num.getBaseNo(level) << std::endl;
42  }
43 #endif
44 
45  int maxLevel = theRollLevel;
46  if (num.getLevels()!=maxLevel) {
47  std::cout << "MuonGEMNS::BNToUN "
48  << "BaseNumber has " << num.getLevels() << " levels,"
49  << "need "<<maxLevel<<std::endl;
50  return 0;
51  }
52 
53  int region(0), ring(0), station(0), layer(0), chamber(0), roll(0);
54 
55  //decode significant GEM levels
56 
57  if (num.getBaseNo(theRegionLevel) == 0) region = 1;
58  else region =-1;
59 
60  // All GEM super chambers in stations 1 and 2 are on ring 1.
61  // The long super chambers in station 2 are assigned *station 3* due
62  // to the current limitation in the definition of the GEMDetId,
63  // i.e. only 2 layers available per station.
64  // ring = num.getSuperNo(theRingLevel);
65  // GEM are only on the first ring
66  ring = 1;
68 #ifdef LOCAL_DEBUG
69  std::cout << "GEMNumbering: Ring " << ring << " Station "
70  << num.getSuperNo(theStationLevel) << ":" << station << std::endl;
71 #endif
72 
73  roll = num.getBaseNo(theRollLevel)+1;
74  const int copyno = num.getBaseNo(theSectorLevel) + 1;
75  if (copyno < 50) {
76  if (copyno%2 == 0) {
77  layer = 2;
78  chamber = copyno-1;
79  } else {
80  layer = 1;
81  chamber = copyno;
82  }
83  } else {
84  int copynp = copyno - 50;
85  if (copynp%2 != 0) {
86  layer = 2;
87  chamber = copynp-1;
88  } else {
89  layer = 1;
90  chamber = copynp;
91  }
92  }
93 
94  // collect all info
95 
96 #ifdef LOCAL_DEBUG
97  std::cout << "GEMNumberingScheme: Region " << region << " Ring "
98  << ring << " Station " << station << " Layer " << layer
99  << " Chamber " << chamber << " Roll " << roll << std::endl;
100 #endif
101 
102  // Build the actual numbering
103  GEMDetId id(region,ring,station,layer,chamber, roll);
104 
105 
106 #ifdef LOCAL_DEBUG
107  std::cout << id.rawId() << " DetId " << id << std::endl;
108 #endif
109 
110  return id.rawId();
111 }
int getBaseNo(int level) const
int getLevels() const
int getSuperNo(int level) const
void GEMNumberingScheme::initMe ( const MuonDDDConstants muonConstants)
private

Definition at line 18 of file GEMNumberingScheme.cc.

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

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

18  {
19  int theLevelPart= muonConstants.getValue("level");
20  theRegionLevel = muonConstants.getValue("mg_region")/theLevelPart;
21  theStationLevel = muonConstants.getValue("mg_station")/theLevelPart;
22  theRingLevel = muonConstants.getValue("mg_ring")/theLevelPart;
23  theSectorLevel = muonConstants.getValue("mg_sector")/theLevelPart;
24  theRollLevel = muonConstants.getValue("mg_roll")/theLevelPart;
25 #ifdef LOCAL_DEBUG
26  std::cout << "Initialize GEMNumberingScheme" <<std::endl;
27  std::cout << "theRegionLevel " << theRegionLevel <<std::endl;
28  std::cout << "theStationLevel "<< theStationLevel<<std::endl;
29  std::cout << "theRingLevel " << theRingLevel <<std::endl;
30  std::cout << "theSectorLevel " << theSectorLevel <<std::endl;
31  std::cout << "theRollLevel " << theRollLevel <<std::endl;
32 #endif
33 }
int getValue(const std::string &name) const

Member Data Documentation

int GEMNumberingScheme::theRegionLevel
private

Definition at line 24 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int GEMNumberingScheme::theRingLevel
private

Definition at line 26 of file GEMNumberingScheme.h.

Referenced by initMe().

int GEMNumberingScheme::theRollLevel
private

Definition at line 28 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int GEMNumberingScheme::theSectorLevel
private

Definition at line 27 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int GEMNumberingScheme::theStationLevel
private

Definition at line 25 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().