CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/DetectorDescription/Core/src/DDAxes.cc

Go to the documentation of this file.
00001 #include "DetectorDescription/Core/interface/DDAxes.h"
00002 
00003 namespace DDI { } using namespace DDI;
00004 
00005 AxesNames::AxesNames() {
00006   axesmap_["x"] = x;
00007   axesmap_["y"] = y;
00008   axesmap_["z"] = z;
00009   axesmap_["rho"] = rho;
00010   axesmap_["radial3D"] = radial3D;
00011   axesmap_["phi"] = phi;
00012   axesmap_["undefined"] = undefined;
00013 }
00014 
00015 AxesNames::~AxesNames() { }
00016 
00017 const std::string
00018 AxesNames::name(const DDAxes& s) 
00019 {
00020   std::map<std::string, DDAxes>::const_iterator it;
00021 
00022   for(it = axesmap_.begin(); it != axesmap_.end(); ++it)
00023   {
00024     if(it->second == s)
00025       break;
00026   }
00027   return it->first;
00028 }
00029 
00030 DDAxes
00031 AxesNames::index(const std::string & s)
00032 {
00033   return axesmap_[s];
00034 }
00035 
00036 const std::string
00037 DDAxesNames::name(const DDAxes& s) 
00038 {
00039   return instance().name(s);
00040 }
00041 
00042 DDAxes
00043 DDAxesNames::index(const std::string & s) 
00044 {
00045   return instance().index(s);
00046 }