CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Geometry/EcalTestBeam/src/EcalHodoscopeNumberingScheme.cc

Go to the documentation of this file.
00001 
00002 // File: EcalHodoscopeNumberingScheme.cc
00003 // Description: Numbering scheme for TB H4 hodoscope detector
00005 
00006 #include "Geometry/EcalTestBeam/interface/EcalHodoscopeNumberingScheme.h"
00007 #include "SimDataFormats/EcalTestBeam/interface/HodoscopeDetId.h"
00008 
00009 #include <iostream>
00010 
00011 EcalHodoscopeNumberingScheme::EcalHodoscopeNumberingScheme() : 
00012   EcalNumberingScheme() {
00013 
00014   edm::LogInfo("EcalTBGeom") << "Creating EcalHodoscopeNumberingScheme";
00015 }
00016 
00017 EcalHodoscopeNumberingScheme::~EcalHodoscopeNumberingScheme() {
00018   edm::LogInfo("EcalTBGeom") << "Deleting EcalHodoscopeNumberingScheme";
00019 }
00020 
00021 uint32_t 
00022 EcalHodoscopeNumberingScheme::getUnitID( const EcalBaseNumber& baseNumber ) const
00023 {
00024   
00025   int level = baseNumber.getLevels();
00026   uint32_t intIndex = 0; 
00027   if (level > 0) 
00028   {
00029     // depth index - plans and fibers
00030     if(baseNumber.getLevelName(0) == "FIBR") 
00031     {
00032        uint32_t iFibr;
00033 
00034        if (baseNumber.getCopyNumber(0) > 32)
00035           iFibr = 2 * (baseNumber.getCopyNumber(0)-33);
00036        else 
00037           iFibr = 2*baseNumber.getCopyNumber(0) - 1;
00038 
00039        const uint32_t iPlane = baseNumber.getCopyNumber(1)-1;
00040 
00041        LogDebug("EcalTBGeom") << "Fibr/plane " << iFibr << " " << iPlane;
00042        
00043        intIndex = HodoscopeDetId( iPlane, iFibr ).rawId() ;
00044 
00045        LogDebug("EcalTBGeom") << "Index for fiber volume " 
00046                               << baseNumber.getLevelName(0) 
00047                               << " in plane " 
00048                               << baseNumber.getLevelName(1) 
00049                               << " = " << intIndex;
00050     }
00051   }
00052   return intIndex;
00053 }
00054