Import Geant4 10.3.1 source tree

This commit is contained in:
Gabriele Cosmo
2017-02-28 16:16:20 +01:00
parent a3452e42ac
commit 4597adb7c4
267 changed files with 14761 additions and 24650 deletions
+7 -2
View File
@@ -1,4 +1,4 @@
$Id: History 99838 2016-10-07 10:06:37Z gcosmo $
$Id: History 102562 2017-02-09 08:27:31Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,7 +17,12 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
7 Oct, 2016 Laurent Garnier (intercoms-V10-02-05)
8 February, 2017 Makoto Asai (intercoms-V10-02-06)
- Introducing /control/useDoublePrecision command to use 17 digits
print out for the current parameter values. Addressing to bug
report #1921.
7 October, 2016 Laurent Garnier (intercoms-V10-02-05)
- G4UIcommandTree : Set GetFirstMatchedString() public method
8 August, 2016 Makoto Asai (intercoms-V10-02-04)
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIcontrolMessenger.hh 98731 2016-08-09 10:49:49Z gcosmo $
// $Id: G4UIcontrolMessenger.hh 102562 2017-02-09 08:27:31Z gcosmo $
//
#ifndef G4UIcontrolMessenger_h
@@ -34,6 +34,7 @@
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithABool;
class G4UIcmdWithAnInteger;
class G4UIcmdWithoutParameter;
class G4UIcommand;
@@ -49,6 +50,7 @@ class G4UIcommand;
// /control/foreach
// /control/suppressAbortion
// /control/verbose
// /control/useDoublePrecision
// /control/saveHistory
// /control/stopSavingHistory
// /control/alias
@@ -88,6 +90,7 @@ class G4UIcontrolMessenger : public G4UImessenger
G4UIcmdWithAString * ExecuteCommand;
G4UIcmdWithAnInteger * suppressAbortionCommand;
G4UIcmdWithAnInteger * verboseCommand;
G4UIcmdWithABool * doublePrecCommand;
G4UIcmdWithAString * historyCommand;
G4UIcmdWithoutParameter * stopStoreHistoryCommand;
G4UIcommand * aliasCommand;
+8 -1
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UImanager.hh 85249 2014-10-27 08:28:57Z gcosmo $
// $Id: G4UImanager.hh 102562 2017-02-09 08:27:31Z gcosmo $
//
#ifndef G4UImanager_h
@@ -293,6 +293,13 @@ class G4UImanager : public G4VStateDependent
void SetThreadIgnoreInit(G4bool flg = true);
inline G4MTcoutDestination* GetThreadCout() {return threadCout;};
private:
static G4bool doublePrecisionStr;
public:
inline static void UseDoublePrecisionStr(G4bool val) { doublePrecisionStr = val; }
inline static G4bool DoublePrecisionStr() { return doublePrecisionStr; }
};
#endif
+18 -6
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIcommand.cc 89953 2015-05-06 08:09:12Z gcosmo $
// $Id: G4UIcommand.cc 102562 2017-02-09 08:27:31Z gcosmo $
//
//
@@ -37,6 +37,7 @@
#include "G4Tokenizer.hh"
#include "G4ios.hh"
#include <sstream>
#include <iomanip>
G4UIcommand::G4UIcommand()
: messenger(0), toBeBroadcasted(false), toBeFlushed(false), workerThreadOnly(false),
@@ -386,7 +387,10 @@ G4String G4UIcommand::ConvertToString(G4int intValue)
G4String G4UIcommand::ConvertToString(G4double doubleValue)
{
std::ostringstream os;
os << doubleValue;
if(G4UImanager::DoublePrecisionStr())
{ os << std::setprecision(17) << doubleValue; }
else
{ os << doubleValue; }
G4String vl = os.str();
return vl;
}
@@ -397,7 +401,10 @@ G4String G4UIcommand::ConvertToString(G4double doubleValue,const char* unitName)
G4double uv = ValueOf(unitName);
std::ostringstream os;
os << doubleValue/uv << " " << unitName;
if(G4UImanager::DoublePrecisionStr())
{ os << std::setprecision(17) << doubleValue/uv << " " << unitName; }
else
{ os << doubleValue/uv << " " << unitName; }
G4String vl = os.str();
return vl;
}
@@ -405,7 +412,10 @@ G4String G4UIcommand::ConvertToString(G4double doubleValue,const char* unitName)
G4String G4UIcommand::ConvertToString(G4ThreeVector vec)
{
std::ostringstream os;
os << vec.x() << " " << vec.y() << " " << vec.z();
if(G4UImanager::DoublePrecisionStr())
{ os << std::setprecision(17) << vec.x() << " " << vec.y() << " " << vec.z(); }
else
{ os << vec.x() << " " << vec.y() << " " << vec.z(); }
G4String vl = os.str();
return vl;
}
@@ -416,8 +426,10 @@ G4String G4UIcommand::ConvertToString(G4ThreeVector vec,const char* unitName)
G4double uv = ValueOf(unitName);
std::ostringstream os;
os << vec.x()/uv << " " << vec.y()/uv << " " << vec.z()/uv
<< " " << unitName;
if(G4UImanager::DoublePrecisionStr())
{ os << std::setprecision(17) << vec.x()/uv << " " << vec.y()/uv << " " << vec.z()/uv << " " << unitName; }
else
{ os << vec.x()/uv << " " << vec.y()/uv << " " << vec.z()/uv << " " << unitName; }
G4String vl = os.str();
return vl;
}
+16 -1
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIcontrolMessenger.cc 98731 2016-08-09 10:49:49Z gcosmo $
// $Id: G4UIcontrolMessenger.cc 102562 2017-02-09 08:27:31Z gcosmo $
//
#include <stdlib.h>
@@ -34,6 +34,7 @@
#include "G4UIcommand.hh"
#include "G4UIparameter.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithABool.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithoutParameter.hh"
#include "G4UIaliasList.hh"
@@ -107,6 +108,11 @@ G4UIcontrolMessenger::G4UIcontrolMessenger()
verboseCommand->SetRange("switch >= 0 && switch <=2");
verboseCommand->SetDefaultValue(2);
doublePrecCommand = new G4UIcmdWithABool("/control/useDoublePrecision",this);
doublePrecCommand->SetGuidance("Use double precision for printing out the current parameter value(s).");
doublePrecCommand->SetParameterName("useDoublePrecision",true);
doublePrecCommand->SetDefaultValue(true);
historyCommand = new G4UIcmdWithAString("/control/saveHistory",this);
historyCommand->SetGuidance("Store command history to a file.");
historyCommand->SetGuidance("Defaul file name is G4history.macro.");
@@ -327,6 +333,7 @@ G4UIcontrolMessenger::~G4UIcontrolMessenger()
delete ExecuteCommand;
delete suppressAbortionCommand;
delete verboseCommand;
delete doublePrecCommand;
delete historyCommand;
delete stopStoreHistoryCommand;
delete ManualCommand;
@@ -378,6 +385,10 @@ void G4UIcontrolMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
UI->SetVerboseLevel(verboseCommand->GetNewIntValue(newValue));
}
if(command==doublePrecCommand)
{
G4UImanager::UseDoublePrecisionStr(doublePrecCommand->GetNewBoolValue(newValue));
}
if(command==historyCommand)
{
UI->StoreHistory(newValue);
@@ -639,6 +650,10 @@ G4String G4UIcontrolMessenger::GetCurrentValue(G4UIcommand * command)
{
currentValue = verboseCommand->ConvertToString(UI->GetVerboseLevel());
}
if(command==doublePrecCommand)
{
currentValue = doublePrecCommand->ConvertToString(G4UImanager::DoublePrecisionStr());
}
if(command==suppressAbortionCommand)
{
currentValue = suppressAbortionCommand->ConvertToString(G4StateManager::GetStateManager()->GetSuppressAbortion());
+2 -1
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UImanager.cc 94366 2015-11-13 08:15:49Z gcosmo $
// $Id: G4UImanager.cc 102562 2017-02-09 08:27:31Z gcosmo $
//
//
// ---------------------------------------------------------------------
@@ -52,6 +52,7 @@
G4ThreadLocal G4UImanager * G4UImanager::fUImanager = 0;
G4ThreadLocal G4bool G4UImanager::fUImanagerHasBeenKilled = false;
G4UImanager * G4UImanager::fMasterUImanager = 0;
G4bool G4UImanager::doublePrecisionStr = false;
G4int G4UImanager::igThreadID = -1;