diff --git a/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorFactory.cxx b/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorFactory.cxx index ab0496f70daf397e55b06a4e177f0a2f9b7d971b..fae5b405f735c6a0c8f540922cf97d1971a3bb2b 100755 --- a/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorFactory.cxx +++ b/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorFactory.cxx @@ -6,7 +6,6 @@ #include "CentralScrutinizer.h" #include "GeoModelInterfaces/AbsMaterialManager.h" #include "GeoModelKernel/GeoDefinitions.h" -#include "GeoModelKernel/Units.h" #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/GeoBox.h" #include "GeoModelKernel/GeoTube.h" @@ -23,6 +22,7 @@ #include "GeoGenericFunctions/Sin.h" #include "GeoGenericFunctions/Cos.h" #include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/SystemOfUnits.h" #include "GeoModelInterfaces/StoredMaterialManager.h" using namespace GeoGenfun; @@ -67,7 +67,7 @@ void ToyDetectorFactory::create(GeoPhysVol *world) //-----------------------------------------------------------------------------------// // Next make the box that describes the shape of the toy volume: // // // - const GeoBox *toyBox = new GeoBox(800*GeoModelKernelUnits::cm,800*GeoModelKernelUnits::cm, 1000*GeoModelKernelUnits::cm); // + const GeoBox *toyBox = new GeoBox(800*Gaudi::Units::cm,800*Gaudi::Units::cm, 1000*Gaudi::Units::cm); // // // // Bundle this with a material into a logical volume: // // // @@ -86,7 +86,7 @@ void ToyDetectorFactory::create(GeoPhysVol *world) // Daughters // // // // // - const GeoTube *ringTube = new GeoTube(500*GeoModelKernelUnits::cm, 1000*GeoModelKernelUnits::cm, 5.0*GeoModelKernelUnits::cm); // + const GeoTube *ringTube = new GeoTube(500*Gaudi::Units::cm, 1000*Gaudi::Units::cm, 5.0*Gaudi::Units::cm); // // // // Bundle this with a material into a logical volume: // // // @@ -98,7 +98,7 @@ void ToyDetectorFactory::create(GeoPhysVol *world) toyPhys->add(ringName); // for (int i=0;i<100;i++) { // GeoFullPhysVol *ringPhys = new GeoFullPhysVol(ringLog); // - GeoAlignableTransform *xform = new GeoAlignableTransform(GeoTrf::TranslateZ3D((i-50)*20*GeoModelKernelUnits::cm)); + GeoAlignableTransform *xform = new GeoAlignableTransform(GeoTrf::TranslateZ3D((i-50)*20*Gaudi::Units::cm)); toyPhys->add(xform); // toyPhys->add(ringPhys); // m_detectorManager->addCentralScrutinizer(new CentralScrutinizer(ringPhys)); // @@ -113,11 +113,11 @@ void ToyDetectorFactory::create(GeoPhysVol *world) // parametrizations in the Toy // //-----------------------------------------------------------------------------------// - GeoBox *sPass = new GeoBox(5.0*GeoModelKernelUnits::cm, 30*GeoModelKernelUnits::cm, 30*GeoModelKernelUnits::cm); + GeoBox *sPass = new GeoBox(5.0*Gaudi::Units::cm, 30*Gaudi::Units::cm, 30*Gaudi::Units::cm); GeoLogVol *lPass = new GeoLogVol("Passive", sPass, poly); GeoPhysVol *pPass = new GeoPhysVol(lPass); - GeoBox *sIPass = new GeoBox(4*GeoModelKernelUnits::cm, 25*GeoModelKernelUnits::cm, 25*GeoModelKernelUnits::cm); + GeoBox *sIPass = new GeoBox(4*Gaudi::Units::cm, 25*Gaudi::Units::cm, 25*Gaudi::Units::cm); GeoLogVol *lIPass = new GeoLogVol("InnerPassive", sIPass, air); GeoPhysVol *pIPass = new GeoPhysVol(lIPass); @@ -126,11 +126,11 @@ void ToyDetectorFactory::create(GeoPhysVol *world) const unsigned int NPLATES=100; Variable i; Sin sin; - GENFUNCTION f = 360*GeoModelKernelUnits::deg/NPLATES*i; + GENFUNCTION f = 360*Gaudi::Units::deg/NPLATES*i; GENFUNCTION g = sin(4*f); GENFUNCTION h = -g; - TRANSFUNCTION t1 = Pow(GeoTrf::RotateZ3D(1.0),f)*GeoTrf::TranslateX3D(1100*GeoModelKernelUnits::cm)*Pow(GeoTrf::TranslateZ3D(800*GeoModelKernelUnits::cm),g); - TRANSFUNCTION t2 = Pow(GeoTrf::RotateZ3D(1.0),f)*GeoTrf::TranslateX3D(1100*GeoModelKernelUnits::cm)*Pow(GeoTrf::TranslateZ3D(800*GeoModelKernelUnits::cm),h); + TRANSFUNCTION t1 = Pow(GeoTrf::RotateZ3D(1.0),f)*GeoTrf::TranslateX3D(1100*Gaudi::Units::cm)*Pow(GeoTrf::TranslateZ3D(800*Gaudi::Units::cm),g); + TRANSFUNCTION t2 = Pow(GeoTrf::RotateZ3D(1.0),f)*GeoTrf::TranslateX3D(1100*Gaudi::Units::cm)*Pow(GeoTrf::TranslateZ3D(800*Gaudi::Units::cm),h); //-----------------------------------------------------------------------------------// // Inside, by the way, the serial transformer will evaluate the functions: // diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx index 87e010c774e9ff512bad3e28299a6f7a01c24f5c..c9ae564e96bdac6eb14641ee8f57f5b105ed8b36 100755 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx @@ -7,7 +7,6 @@ #include "GeoModelKernel/GeoPhysVol.h" #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/GeoVolumeCursor.h" -#include "GeoModelKernel/Units.h" #include "GeoModelUtilities/GeoModelExperiment.h" #include "GeoModelSvc.h" #include "RDBMaterialManager.h" @@ -15,6 +14,7 @@ #include "GeoModelInterfaces/IGeoAlignTool.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IConversionSvc.h" +#include "GaudiKernel/SystemOfUnits.h" #include "CxxUtils/make_unique.h" #include "RDBAccessSvc/IRDBAccessSvc.h" @@ -315,7 +315,7 @@ StatusCode GeoModelSvc::geoInit() // Build the world node from which everything else will be suspended const GeoMaterial* air = theMaterialManager->getMaterial("std::Air"); - const GeoBox* worldBox = new GeoBox(1000*GeoModelKernelUnits::cm,1000*GeoModelKernelUnits::cm, 1000*GeoModelKernelUnits::cm); + const GeoBox* worldBox = new GeoBox(1000*Gaudi::Units::cm,1000*Gaudi::Units::cm, 1000*Gaudi::Units::cm); const GeoLogVol* worldLog = new GeoLogVol("WorldLog", worldBox, air); GeoPhysVol *worldPhys=new GeoPhysVol(worldLog); diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx index ba8282f9c873f7a57455bf1790f8665faeb50ea2..6ac92b19d5fe5e8462498378664f49cbe545ab0a 100755 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx @@ -21,6 +21,7 @@ #include "GaudiKernel/IMessageSvc.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/SystemOfUnits.h" #include "AthenaBaseComps/AthCheckMacros.h" #include <algorithm> @@ -68,7 +69,7 @@ int printElement ( GeoElement* &p_element) std::cout << " ***** CheckElement(): Print the Element: " << name << std::endl; std::cout << " ***** The Element: name, symbol, A, Z " << std::endl; - std::cout << " ***** "<<name <<" "<<symbol <<" "<< a * (GeoModelKernelUnits::mole / GeoModelKernelUnits::gram) <<" "<< z <<" " << std::endl; + std::cout << " ***** "<<name <<" "<<symbol <<" "<< a * (Gaudi::Units::mole / GeoModelKernelUnits::gram) <<" "<< z <<" " << std::endl; return 1; } @@ -82,7 +83,7 @@ int printElement ( const GeoElement* &p_element) std::cout << " ***** PrintElement(): Print the Element: " << name << std::endl; std::cout << " ***** The Element: name, symbol, A, Z " << std::endl; - std::cout << " ***** "<<name <<" "<<symbol <<" "<< a * (GeoModelKernelUnits::mole / GeoModelKernelUnits::gram) <<" "<< z <<" " << std::endl; + std::cout << " ***** "<<name <<" "<<symbol <<" "<< a * (Gaudi::Units::mole / GeoModelKernelUnits::gram) <<" "<< z <<" " << std::endl; return 1; } @@ -90,7 +91,7 @@ int printElement ( const GeoElement* &p_element) int printMaterial ( GeoMaterial* &p_material) { std::string name = p_material->getName(); - double density = p_material->getDensity() * (GeoModelKernelUnits::cm3 / GeoModelKernelUnits::gram); + double density = p_material->getDensity() * (Gaudi::Units::cm3 / GeoModelKernelUnits::gram); std::cout << " ***** PrintMaterial(): Print the Material: " << name << std::endl; std::cout << " ***** The Material: name, density " << std::endl; @@ -102,7 +103,7 @@ int printMaterial ( GeoMaterial* &p_material) int printFullMaterial ( GeoMaterial* &p_material) { std::string name = p_material->getName(); - double density = p_material->getDensity() * (GeoModelKernelUnits::cm3 / GeoModelKernelUnits::gram); + double density = p_material->getDensity() * (Gaudi::Units::cm3 / GeoModelKernelUnits::gram); std::cout << " ***** PrintFullMaterial(): Print the Material: " << name << std::endl; std::cout << " ***** The Material: name, density" << std::endl; @@ -589,7 +590,7 @@ GeoMaterial* RDBMaterialManager::getMaterial(const std::string & name) { if (ind == tmp_materials->size()) return NULL; - pmaterial = new GeoMaterial( material_name,material_density * (GeoModelKernelUnits::gram / GeoModelKernelUnits::cm3)); + pmaterial = new GeoMaterial( material_name,material_density * (GeoModelKernelUnits::gram / Gaudi::Units::cm3)); bool firstComponent = true; @@ -803,7 +804,7 @@ const GeoMaterial* RDBMaterialManager:: getMaterial(const std::string &name) co if (ind == tmp_materials->size()) return NULL; - pmaterial = new GeoMaterial( material_name,material_density * (GeoModelKernelUnits::gram / GeoModelKernelUnits::cm3)); + pmaterial = new GeoMaterial( material_name,material_density * (GeoModelKernelUnits::gram / Gaudi::Units::cm3)); bool firstComponent = true; bool hasSubMaterial = false; @@ -904,7 +905,7 @@ const GeoElement *RDBMaterialManager::getElement(const std::string & name) const element_a = rec->getDouble("A"); element_z = rec->getDouble("Z"); - pelement = new GeoElement( element_name , element_symbol ,element_z , element_a *(GeoModelKernelUnits::gram/GeoModelKernelUnits::mole)); + pelement = new GeoElement( element_name , element_symbol ,element_z , element_a *(GeoModelKernelUnits::gram/Gaudi::Units::mole)); // a table to keep the memory allocation, and easy for delete pelement->ref(); @@ -947,7 +948,7 @@ const GeoElement *RDBMaterialManager::getElement(unsigned int atomicNumber) cons element_a = rec->getDouble("A"); element_z = rec->getDouble("Z"); - pelement = new GeoElement( element_name , element_symbol ,element_z , element_a *(GeoModelKernelUnits::gram/GeoModelKernelUnits::mole)); + pelement = new GeoElement( element_name , element_symbol ,element_z , element_a *(GeoModelKernelUnits::gram/Gaudi::Units::mole)); // a table to keep the memory allocation, and easy for delete pelement->ref(); @@ -997,7 +998,7 @@ GeoElement *RDBMaterialManager::getElement(const std::string & name) { element_a = rec->getDouble("A"); element_z = rec->getDouble("Z"); - pelement = new GeoElement( element_name , element_symbol ,element_z , element_a *(GeoModelKernelUnits::gram/GeoModelKernelUnits::mole)); + pelement = new GeoElement( element_name , element_symbol ,element_z , element_a *(GeoModelKernelUnits::gram/Gaudi::Units::mole)); // a table to keep the memory allocation, and easy for delete pelement->ref(); @@ -1039,7 +1040,7 @@ GeoElement *RDBMaterialManager::getElement(unsigned int atomicNumber) { element_a = rec->getDouble("A"); element_z = rec->getDouble("Z"); - pelement = new GeoElement( element_name , element_symbol ,element_z , element_a *(GeoModelKernelUnits::gram/GeoModelKernelUnits::mole)); + pelement = new GeoElement( element_name , element_symbol ,element_z , element_a *(GeoModelKernelUnits::gram/Gaudi::Units::mole)); // a table to keep the memory allocation, and easy for delete pelement->ref(); @@ -1108,13 +1109,13 @@ std::ostream & RDBMaterialManager::printAll(std::ostream & o) const std::vector<GeoElement *>::const_iterator e; for (e=m_elementVector.begin();e!= m_elementVector.end();e++) { - o << (*e)->getSymbol() << '\t' << (*e)->getZ() << '\t' << (*e)->getA() * (GeoModelKernelUnits::mole / GeoModelKernelUnits::gram) << '\t' << (*e)->getName() << std::endl; + o << (*e)->getSymbol() << '\t' << (*e)->getZ() << '\t' << (*e)->getA() * (Gaudi::Units::mole / GeoModelKernelUnits::gram) << '\t' << (*e)->getName() << std::endl; } std::map<std::string, GeoMaterial *>::const_iterator m; for (m=m_materialMap.begin();m!=m_materialMap.end();m++) { - o << "Material: " << (*m).first << " Density " << (*m).second->getDensity() * (GeoModelKernelUnits::cm3 / GeoModelKernelUnits::gram) << std::endl; + o << "Material: " << (*m).first << " Density " << (*m).second->getDensity() * (Gaudi::Units::cm3 / GeoModelKernelUnits::gram) << std::endl; for (size_t i = 0; i< (*m).second->getNumElements();i++) { o <<" ***** ***** "<< int ((*m).second->getFraction(i)*100) << "% \t" << (*m).second->getElement(i)->getName() << std::endl; diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoDBUtils.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoDBUtils.h index ce79227f837669a4239694b0d8bb4216db1972c0..fe591d09e404f29de76828c3616c4174e4c3affe 100755 --- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoDBUtils.h +++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoDBUtils.h @@ -9,7 +9,7 @@ #include "RDBAccessSvc/IRDBRecord.h" #include <string> #include "GeoModelKernel/GeoDefinitions.h" -#include "GeoModelKernel/Units.h" +#include "GaudiKernel/SystemOfUnits.h" class GeoDBUtils { @@ -27,12 +27,12 @@ class GeoDBUtils { } inline static GeoTrf::Transform3D getTransform (const IRDBRecord *currentRec) { - double x = currentRec->getDouble("TRANSX")*GeoModelKernelUnits::mm; - double y = currentRec->getDouble("TRANSY")*GeoModelKernelUnits::mm; - double z = currentRec->getDouble("TRANSZ")*GeoModelKernelUnits::mm; - double theta = currentRec->getDouble("THETA")*GeoModelKernelUnits::rad; - double phi = currentRec->getDouble("PHI")*GeoModelKernelUnits::rad; - double rotationAngle = currentRec->getDouble("ROTATIONANGLE")*GeoModelKernelUnits::rad; + double x = currentRec->getDouble("TRANSX")*Gaudi::Units::mm; + double y = currentRec->getDouble("TRANSY")*Gaudi::Units::mm; + double z = currentRec->getDouble("TRANSZ")*Gaudi::Units::mm; + double theta = currentRec->getDouble("THETA")*Gaudi::Units::rad; + double phi = currentRec->getDouble("PHI")*Gaudi::Units::rad; + double rotationAngle = currentRec->getDouble("ROTATIONANGLE")*Gaudi::Units::rad; GeoTrf::Vector3D axis(sin(theta)*cos(phi), sin(theta)*sin(phi),cos(theta)); return GeoTrf::Translate3D(x,y,z)*GeoTrf::Rotate3D(rotationAngle,axis); diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.h index 1bd84a6a1930a9413c85531810ef9585c6738cf7..6c7ce0654f5fe5a6aa11667793252a987918d3ee 100755 --- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.h +++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.h @@ -6,7 +6,7 @@ #define GeoExtendedMaterial_h 1 #include "GeoModelKernel/GeoMaterial.h" -#include "GeoModelKernel/Units.h" +#include "GaudiKernel/PhysicalConstants.h" #include "GeoModelUtilities/GeoMaterialPropertiesTable.h" @@ -18,8 +18,8 @@ class GeoExtendedMaterial : public GeoMaterial GeoExtendedMaterial(const std::string &Name, double Density, GeoMaterialState State = stateUndefined, - double Temperature = GeoModelKernelUnits::STP_Temperature, - double Pressure = GeoModelKernelUnits::STP_Pressure); + double Temperature = Gaudi::Units::STP_Temperature, + double Pressure = Gaudi::Units::STP_Pressure); virtual ~GeoExtendedMaterial();