|
||||
File indexing completed on 2025-01-18 09:14:37
0001 //========================================================================== 0002 // AIDA Detector description implementation 0003 //-------------------------------------------------------------------------- 0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) 0005 // All rights reserved. 0006 // 0007 // For the licensing terms see $DD4hepINSTALL/LICENSE. 0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS. 0009 // 0010 // Author : M.Frank 0011 // 0012 //========================================================================== 0013 0014 #include "XML/Evaluator.h" 0015 0016 namespace { 0017 void _init(XmlTools::Evaluator& e) { 0018 // Initialize numerical expressions parser with the standard math functions 0019 // and the system of units used by Gaudi (Geant4) 0020 e.setStdMath(); 0021 } 0022 void _g4Units(XmlTools::Evaluator& e) { 0023 // =================================================================================== 0024 // Geant4 units 0025 // Geant4: kilogram = joule*s*s/(m*m) 1/e_SI * 1e-6 * 1e9 1e9 / 1e3 / 1e3 = 1. / 1.60217733e-25 0026 e.setSystemOfUnits(1.e+3, 1./1.60217733e-25, 1.e+9, 1./1.60217733e-10, 1.0, 1.0, 1.0); 0027 } 0028 } 0029 0030 namespace dd4hep { 0031 XmlTools::Evaluator& evaluator() { 0032 static XmlTools::Evaluator* e = 0; 0033 if ( !e ) { 0034 static XmlTools::Evaluator ev; 0035 _init(ev); 0036 _g4Units(ev); 0037 e = &ev; 0038 } 0039 return *e; 0040 } 0041 } 0042
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |