CMS 3D CMS Logo

Public Member Functions | Private Attributes

ESTBNumberingScheme Class Reference

#include <ESTBNumberingScheme.h>

Inheritance diagram for ESTBNumberingScheme:
EcalNumberingScheme CaloNumberingScheme

List of all members.

Public Member Functions

 ESTBNumberingScheme ()
virtual uint32_t getUnitID (const EcalBaseNumber &baseNumber) const
 ~ESTBNumberingScheme ()

Private Attributes

int iX [30]
int iY [30]

Detailed Description

Definition at line 6 of file ESTBNumberingScheme.h.


Constructor & Destructor Documentation

ESTBNumberingScheme::ESTBNumberingScheme ( )

Definition at line 6 of file ESTBNumberingScheme.cc.

References i, iX, and iY.

                                         : 
  EcalNumberingScheme() {

  int ix[30] = {3, 2, 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 1,
                1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4};
  int iy[30] = {4, 4, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1,
                2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4};

  int i;
  for(i=0; i<30; ++i) {
    iX[i] = ix[i];
    iY[i] = iy[i];
  }
    
  edm::LogInfo("EcalGeom") << "Creating ESTBNumberingScheme";
}
ESTBNumberingScheme::~ESTBNumberingScheme ( )

Definition at line 23 of file ESTBNumberingScheme.cc.

                                          {
  edm::LogInfo("EcalGeom") << "Deleting ESTBNumberingScheme";
}

Member Function Documentation

uint32_t ESTBNumberingScheme::getUnitID ( const EcalBaseNumber baseNumber) const [virtual]

Implements EcalNumberingScheme.

Definition at line 27 of file ESTBNumberingScheme.cc.

References EcalBaseNumber::getCopyNumber(), EcalBaseNumber::getLevelName(), EcalBaseNumber::getLevels(), iX, iY, testEve_cfg::level, LogDebug, DetId::rawId(), strip(), x, and detailsBasic3DVector::y.

                                                                               {
  int level = baseNumber.getLevels();
  uint32_t intIndex = 0; 
  if (level > 0) {

    // depth index - silicon layer 1-st or 2-nd
    int layer = 0;
    if(baseNumber.getLevelName(0) == "SFSX") {
      layer = 1;
    } else if (baseNumber.getLevelName(0) == "SFSY") {
      layer = 2;
    } else {
      edm::LogWarning("EcalGeom") << "ESTBNumberingScheme: Wrong name"
                                 << " of Presh. Si. Strip : " 
                                 << baseNumber.getLevelName(0);
    }

    // Z index +Z = 1 ; -Z = 2
    int zside   = baseNumber.getCopyNumber("EREG");
    zside=2*(1-zside)+1;
    // wafer number
    int wafer = baseNumber.getCopyNumber(3);
    int x=0,y=0;
    // strip number inside wafer
    int strip = baseNumber.getCopyNumber(0);

    x = iX[wafer];
    y = iY[wafer];
    
    intIndex =  ESDetId(strip, x, y, layer, zside).rawId(); 
    
    LogDebug("EcalGeom") << "ESTBNumberingScheme : zside " << zside 
                        << " layer " << layer << " wafer " << wafer << " X " 
                        << x << " Y "<< y << " strip " << strip 
                        << " UnitID 0x" << std::hex << intIndex << std::dec;
    for (int ich = 0; ich < level; ich++) {
      LogDebug("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) 
                          << " copy = " << baseNumber.getCopyNumber(ich);
    }
  }

  return intIndex;
}

Member Data Documentation

int ESTBNumberingScheme::iX[30] [private]

Definition at line 16 of file ESTBNumberingScheme.h.

Referenced by ESTBNumberingScheme(), and getUnitID().

int ESTBNumberingScheme::iY[30] [private]

Definition at line 17 of file ESTBNumberingScheme.h.

Referenced by ESTBNumberingScheme(), and getUnitID().