CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

GEMNumberingScheme Class Reference

#include <GEMNumberingScheme.h>

Inheritance diagram for GEMNumberingScheme:
MuonNumberingScheme

List of all members.

Public Member Functions

virtual int baseNumberToUnitNumber (const MuonBaseNumber)
 GEMNumberingScheme (const MuonDDDConstants &muonConstants)
 GEMNumberingScheme (const DDCompactView &cpv)
virtual ~GEMNumberingScheme ()

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

                                                                {
  MuonDDDConstants muonConstants(cpv);
  initMe(muonConstants);
}
GEMNumberingScheme::GEMNumberingScheme ( const MuonDDDConstants muonConstants)

Definition at line 9 of file GEMNumberingScheme.cc.

References initMe().

                                                                              {
  initMe(muonConstants);
}
virtual GEMNumberingScheme::~GEMNumberingScheme ( ) [inline, virtual]

Definition at line 17 of file GEMNumberingScheme.h.

{};

Member Function Documentation

int GEMNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber  num) [virtual]

Reimplemented from MuonNumberingScheme.

Definition at line 35 of file GEMNumberingScheme.cc.

References gather_cfg::cout, MuonBaseNumber::getBaseNo(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), testEve_cfg::level, relativeConstraints::ring, relativeConstraints::station, theRegionLevel, theRingLevel, theRollLevel, theSectorLevel, and theStationLevel.

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

                                                                       {

#ifdef LOCAL_DEBUG
  std::cout << "GEMNumbering "<<num.getLevels()<<std::endl;
  for (int level=1;level<=num.getLevels();level++) {
    std::cout << level << " " << num.getSuperNo(level)
              << " " << num.getBaseNo(level) << std::endl;
  }
#endif

  int maxLevel = theRollLevel;
  if (num.getLevels()!=maxLevel) {
    std::cout << "MuonGEMNS::BNToUN "
              << "BaseNumber has " << num.getLevels() << " levels,"
              << "need "<<maxLevel<<std::endl;
    return 0;
  }

  int region(0), ring(0), station(0), layer(0), chamber(0), roll(0);

  //decode significant GEM levels
  
  if (num.getBaseNo(theRegionLevel) == 0) region = 1;
  else                                    region =-1;
  station = num.getBaseNo(theStationLevel)+1;
  ring    = num.getBaseNo(theRingLevel)+1;
  roll    = num.getBaseNo(theRollLevel)+1;
  const int copyno = num.getBaseNo(theSectorLevel) + 1;
  if (copyno < 50) {
    if (copyno%2 == 0) {
      layer   = 2;
      chamber = copyno-1;
    } else {
      layer   = 1;
      chamber = copyno;
    }
  } else {
    int copynp = copyno - 50;
    if (copynp%2 != 0) {
      layer   = 2;
      chamber = copynp-1;
    } else {
      layer   = 1;
      chamber = copynp;
    }
  }

  // collect all info
  
#ifdef LOCAL_DEBUG
  std::cout << "GEMNumberingScheme: Region " << region << " Ring "
            << ring << " Station " << station << " Layer " << layer
            << " Chamber " << chamber << " Roll " << roll << std::endl;
#endif

  // Build the actual numbering
  GEMDetId id(region,ring,station,layer,chamber, roll);
  
  
#ifdef LOCAL_DEBUG
  std::cout << " DetId " << id << std::endl;
#endif
      
  return id.rawId();
}
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().

                                                                        {
  int theLevelPart= muonConstants.getValue("level");
  theRegionLevel  = muonConstants.getValue("mg_region")/theLevelPart;
  theStationLevel = muonConstants.getValue("mg_station")/theLevelPart;
  theRingLevel    = muonConstants.getValue("mg_ring")/theLevelPart;
  theSectorLevel  = muonConstants.getValue("mg_sector")/theLevelPart;
  theRollLevel    = muonConstants.getValue("mg_roll")/theLevelPart;
#ifdef LOCAL_DEBUG
  std::cout << "Initialize GEMNumberingScheme" <<std::endl;
  std::cout << "theRegionLevel " << theRegionLevel <<std::endl;
  std::cout << "theStationLevel "<< theStationLevel<<std::endl;
  std::cout << "theRingLevel "   << theRingLevel   <<std::endl;
  std::cout << "theSectorLevel " << theSectorLevel <<std::endl;
  std::cout << "theRollLevel "   << theRollLevel   <<std::endl;
#endif
}

Member Data Documentation

Definition at line 24 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

Definition at line 26 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

Definition at line 28 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

Definition at line 27 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

Definition at line 25 of file GEMNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().