|
||||
File indexing completed on 2025-01-18 09:14:33
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 /// Framework include files 0015 #include "Parsers/config.h" 0016 #include "Evaluator/Evaluator.h" 0017 #include "Evaluator/detail/Evaluator.h" 0018 #include "Evaluator/DD4hepUnits.h" 0019 0020 /// C/C++ include files 0021 0022 namespace units = dd4hep; 0023 0024 namespace { 0025 0026 dd4hep::tools::Evaluator _cgsUnits() { 0027 // =================================================================================== 0028 // CGS units 0029 return dd4hep::tools::Evaluator(100., 1000., 1.0, 1.0, 1.0, 1.0, 1.0, 1.0); 0030 } 0031 0032 dd4hep::tools::Evaluator _tgeoUnits() { 0033 // =================================================================================== 0034 // DDG4 units (TGeo) 1 sec = 10^9 [nsec] 0035 // 1 Coulomb = 1/e As 0036 // Ampere = C/s = 1/e * As / s = 1. / 1.60217733e-19 0037 // kilogram = joule*s*s/(m*m) 1/e_SI * 1 *1 / 1e2 / 1e2 0038 0039 // e.setSystemOfUnits(1.e+2, 1./1.60217733e-6, 1.0, 1./1.60217733e-19, 1.0, 1.0, 1.0); 0040 // use the units as defined in DD4hepUnits.h: 0041 return dd4hep::tools::Evaluator( units::meter, 0042 units::kilogram, 0043 units::second, 0044 units::ampere, 0045 units::kelvin, 0046 units::mole, 0047 units::candela, 0048 units::rad ); 0049 } 0050 0051 dd4hep::tools::Evaluator _g4Units() { 0052 // =================================================================================== 0053 // Geant4 units 0054 // Geant4: kilogram = joule*s*s/(m*m) 1/e_SI * 1e-6 * 1e9 1e9 / 1e3 / 1e3 = 1. / 1.60217733e-25 0055 return dd4hep::tools::Evaluator(1.e+3, 1./1.60217733e-25, 1.e+9, 1./1.60217733e-10, 1.0, 1.0, 1.0, 1.0); 0056 } 0057 } 0058 0059 /// Namespace for the AIDA detector description toolkit 0060 namespace dd4hep { 0061 0062 const tools::Evaluator& evaluator() { 0063 static const tools::Evaluator e = _tgeoUnits(); 0064 return e; 0065 } 0066 0067 /// Access to G4 evaluator. Note: Uses Geant4 units! 0068 const tools::Evaluator& g4Evaluator() { 0069 static const tools::Evaluator e = _g4Units(); 0070 return e; 0071 } 0072 0073 /// Access to G4 evaluator. Note: Uses cgs units! 0074 const tools::Evaluator& cgsEvaluator() { 0075 static const tools::Evaluator e = _cgsUnits(); 0076 return e; 0077 } 0078 } 0079
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |