Import Geant4 10.5.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2018-06-29 10:58:11 +02:00
parent fe81a77428
commit 6aa23be517
1581 changed files with 124288 additions and 83758 deletions
+12 -1
View File
@@ -1,4 +1,4 @@
$Id: History 104352 2017-05-26 07:23:36Z gcosmo $
$Id: History 110101 2018-05-15 11:31:37Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -14,6 +14,17 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 15, 2018 J.Allison - fieldex02-V10-04-01
- Remove G4UI_USE and G4VIS_USE.
- Move instantiation of G4UIExecutive to start of main.
- F02RunAction.cc: Remove vis commands.
May 09, 2018 B.Morgan - fieldex02-V10-04-00
- Include G4Types before use of G4MULTITHREADED. For forward
compatibility with move to #defines over -D for G4 preprocessor
symbols.
May 24, 2017 J.Apostolakis - fieldex02-V10-03-02
- Fixed F02ElectricFieldSetup UpdateIntegrator() method (avoid double
deletion of driver - done by chord finder already. )
+10 -14
View File
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: field02.cc 98066 2016-07-01 16:31:42Z gcosmo $
// $Id: field02.cc 110101 2018-05-15 11:31:37Z gcosmo $
//
/// \file field/field02/field02.cc
/// \brief Main program of the field/field02 example
@@ -34,6 +34,8 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4Types.hh"
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
#else
@@ -49,18 +51,19 @@
#include "G4StepLimiterPhysics.hh"
#include "Randomize.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc,char** argv)
{
// Instantiate G4UIExecutive if there are no arguments (interactive mode)
G4UIExecutive* ui = nullptr;
if ( argc == 1 ) {
ui = new G4UIExecutive(argc, argv);
}
// Choose the Random engine
//
G4Random::setTheEngine(new CLHEP::RanecuEngine);
@@ -90,20 +93,18 @@ int main(int argc,char** argv)
//
runManager->Initialize();
#ifdef G4VIS_USE
// Initialize visualization
//
G4VisManager* visManager = new G4VisExecutive;
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
// G4VisManager* visManager = new G4VisExecutive("Quiet");
visManager->Initialize();
#endif
// Get the pointer to the User Interface manager
//
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if (argc!=1) // batch mode
if (!ui) // batch mode
{
G4String command = "/control/execute ";
G4String fileName = argv[1];
@@ -111,13 +112,10 @@ int main(int argc,char** argv)
}
else
{ // interactive mode : define UI session
#ifdef G4UI_USE
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
if (ui->IsGUI())
UImanager->ApplyCommand("/control/execute gui.mac");
ui->SessionStart();
delete ui;
#endif
}
// Job termination
@@ -125,9 +123,7 @@ int main(int argc,char** argv)
// owned and deleted by the run manager, so they should not
// be deleted in the main() program !
#ifdef G4VIS_USE
delete visManager;
#endif
delete runManager;
return 0;
File diff suppressed because it is too large Load Diff
@@ -27,7 +27,7 @@
/// \brief Implementation of the F02ElectricFieldSetup class
//
//
// $Id: F02ElectricFieldSetup.cc 104352 2017-05-26 07:23:36Z gcosmo $
// $Id: F02ElectricFieldSetup.cc 109871 2018-05-09 12:40:14Z gcosmo $
//
// User Field class implementation.
//
@@ -117,7 +117,7 @@ F02ElectricFieldSetup::F02ElectricFieldSetup(G4ThreeVector fieldVector)
F02ElectricFieldSetup::~F02ElectricFieldSetup()
{
G4cout << " F02ElectricFieldSetup - dtor called. " << G4endl;
// G4cout << " F02ElectricFieldSetup - dtor called. " << G4endl;
delete fFieldMessenger; fFieldMessenger= nullptr;
// Delete the messenger first, to avoid messages to deleted classes!
@@ -161,12 +161,18 @@ void F02ElectricFieldSetup::UpdateIntegrator()
// -- Careful to call this after all old objects are destroyed, and
// pointers nullified.
CreateStepper(); // Note that this method deleted the existing Stepper!
fIntgrDriver = new G4MagInt_Driver(fMinStep,
fStepper,
fStepper->GetNumberOfVariables());
// G4cout << "F02ElectricFieldSetup::UpdateIntegrator> "
// << "New value of stepper ptr= " << fStepper << G4endl;
assert(fStepper != nullptr);
fChordFinder = new G4ChordFinder(fIntgrDriver);
if( fStepper ) {
fIntgrDriver = new G4MagInt_Driver(fMinStep,
fStepper,
fStepper->GetNumberOfVariables());
if( fIntgrDriver ){
fChordFinder = new G4ChordFinder(fIntgrDriver);
}
}
fFieldManager->SetChordFinder(fChordFinder);
fFieldManager->SetDetectorField(fEMfield);
@@ -203,7 +209,7 @@ void F02ElectricFieldSetup::CreateStepper()
break;
case 4:
fStepper = new G4ClassicalRK4( fEquation, nvar );
G4cout<<"G4ClassicalRK4 (default) is called"<<G4endl;
G4cout<<"G4ClassicalRK4 is called"<<G4endl;
break;
case 5:
fStepper = new G4CashKarpRKF45( fEquation, nvar );
@@ -226,7 +232,10 @@ void F02ElectricFieldSetup::CreateStepper()
fStepper = 0; // new G4HelixSimpleRunge( fEquation );
G4cout<<"G4HelixSimpleRunge is not valid for Electric Field"<<G4endl;
break;
default: fStepper = 0;
default: /* fStepper = 0; // Older code */
fStepper = new G4ClassicalRK4( fEquation, nvar );
G4cout<<"G4ClassicalRK4 (default) is called"<<G4endl;
break;
}
delete oldStepper;
@@ -27,7 +27,7 @@
/// \brief Implementation of the F02RunAction class
//
//
// $Id: F02RunAction.cc 92497 2015-09-02 07:23:12Z gcosmo $
// $Id: F02RunAction.cc 110101 2018-05-15 11:31:37Z gcosmo $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -69,22 +69,12 @@ void F02RunAction::BeginOfRunAction(const G4Run*)
G4Random::showEngineStatus();
G4Random::saveEngineStatus("beginOfRun.rndm");
}
G4UImanager* ui = G4UImanager::GetUIpointer();
G4VVisManager* visManager = G4VVisManager::GetConcreteInstance();
if (visManager) ui->ApplyCommand("/vis/scene/notifyHandlers");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void F02RunAction::EndOfRunAction(const G4Run*)
{
if (G4VVisManager::GetConcreteInstance())
{
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
}
// save Rndm status
if (fSaveRndm == 1)