CMS 3D CMS Logo

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 using namespace std;
00011 
00012 EcalHodoscopeNumberingScheme::EcalHodoscopeNumberingScheme() : 
00013   EcalNumberingScheme() {
00014 
00015   
00016   edm::LogInfo("EcalTBGeom") << "Creating EcalHodoscopeNumberingScheme";
00017 }
00018 
00019 EcalHodoscopeNumberingScheme::~EcalHodoscopeNumberingScheme() {
00020   edm::LogInfo("EcalTBGeom") << "Deleting EcalHodoscopeNumberingScheme";
00021 }
00022 
00023 uint32_t EcalHodoscopeNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const  {
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       uint32_t iFibr;
00032 
00033       if (baseNumber.getCopyNumber(0) > 32)
00034         iFibr = 2 * (baseNumber.getCopyNumber(0)-33);
00035       else 
00036         iFibr = 2*baseNumber.getCopyNumber(0) - 1;
00037 
00038       const uint32_t iPlane = baseNumber.getCopyNumber(1)-1;
00039 
00040       LogDebug("EcalTBGeom") << "Fibr/plane " << iFibr << " " << iPlane;
00041 
00042       intIndex = HodoscopeDetId( iPlane, iFibr).rawId() ;
00043 
00044       LogDebug("EcalTBGeom") << "Index for fiber volume " << baseNumber.getLevelName(0) << " in plane " << baseNumber.getLevelName(1) << " = " << intIndex;
00045 
00046     }
00047   }
00048 
00049   return intIndex;
00050 
00051 }
00052 

Generated on Tue Jun 9 17:37:27 2009 for CMSSW by  doxygen 1.5.4