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 EcalHodoscopeNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const { 00022 00023 int level = baseNumber.getLevels(); 00024 uint32_t intIndex = 0; 00025 if (level > 0) { 00026 00027 // depth index - plans and fibers 00028 if(baseNumber.getLevelName(0) == "FIBR") { 00029 uint32_t iFibr; 00030 00031 if (baseNumber.getCopyNumber(0) > 32) 00032 iFibr = 2 * (baseNumber.getCopyNumber(0)-33); 00033 else 00034 iFibr = 2*baseNumber.getCopyNumber(0) - 1; 00035 00036 const uint32_t iPlane = baseNumber.getCopyNumber(1)-1; 00037 00038 LogDebug("EcalTBGeom") << "Fibr/plane " << iFibr << " " << iPlane; 00039 00040 intIndex = HodoscopeDetId( iPlane, iFibr).rawId() ; 00041 00042 LogDebug("EcalTBGeom") << "Index for fiber volume " << baseNumber.getLevelName(0) << " in plane " << baseNumber.getLevelName(1) << " = " << intIndex; 00043 00044 } 00045 } 00046 00047 return intIndex; 00048 00049 } 00050