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
+4 -1
View File
@@ -1,4 +1,4 @@
$Id: History 77941 2013-11-29 15:22:58Z gcosmo $
$Id: History 109623 2018-05-03 13:05:02Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -15,6 +15,9 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
2nd May 2018 Ivana Hrivnacova (BlineTracer-V10-04-00)
- Fixed compilation error (missing include)
29th November 2012 Ivana Hrivnacova (BlineTracer-V09-06-00)
- Fixed shadowed declarations
@@ -27,7 +27,7 @@
/// \brief Implementation of the G4BlineTracer class
//
//
// $Id: G4BlineTracer.cc 77941 2013-11-29 15:22:58Z gcosmo $
// $Id: G4BlineTracer.cc 109623 2018-05-03 13:05:02Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -50,6 +50,7 @@
#include "G4TransportationManager.hh"
#include "G4FieldManager.hh"
#include "G4PropagatorInField.hh"
#include "G4MagIntegratorDriver.hh"
#include "G4CashKarpRKF45.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4ChordFinder.hh"
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: testBlineTracer.cc 68021 2013-03-13 13:36:07Z gcosmo $
// $Id: testBlineTracer.cc 109623 2018-05-03 13:05:02Z gcosmo $
//
/// \file testBlineTracer.cc
/// \brief Test program for the G4BlineTracer class
@@ -47,8 +47,6 @@ int main()
// delete it
delete theBlineTool;
return 0;
}
+13 -1
View File
@@ -1,4 +1,4 @@
$Id: History 104350 2017-05-26 07:20:25Z gcosmo $
$Id: History 110139 2018-05-16 07:33:34Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -14,6 +14,18 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 15, 2018 J.Allison - fieldex01-V10-04-01
- Remove G4UI_USE and G4VIS_USE.
- Move instantiation of G4UIExecutive to start of main.
- vis.mac, gui.mac: Clean up.
- F01RunAction.cc: Remove vis commands.
May 09, 2018 B.Morgan - fieldex01-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 - fieldex01-V10-03-00
- Fixed valgrind error in F01FieldSetup CreateStepperAndChordFinder() method.
first delete all dependent objects, then create new ones.
+12 -15
View File
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: field01.cc 100688 2016-10-31 11:21:51Z gcosmo $
// $Id: field01.cc 110139 2018-05-16 07:33:34Z gcosmo $
//
/// \file field/field01/field01.cc
/// \brief Main program of the field/field01 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,11 @@ 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");
UImanager->ApplyCommand("/control/execute gui.mac");
UImanager->ApplyCommand("/control/execute vis.mac");
ui->SessionStart();
delete ui;
#endif
}
// Job termination
@@ -125,9 +124,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;
+13 -38
View File
@@ -4,7 +4,7 @@
############################################
**************************************************************
Geant4 version Name: geant4-10-04-patch-02 (25-May-2018)
Geant4 version Name: geant4-10-05-beta-01 (29-June-2018)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
@@ -285,8 +285,8 @@ compt: for gamma SubType= 13 BuildTable= 1
conv: for gamma SubType= 14 BuildTable= 1
Lambda table from 1.022 MeV to 100 TeV, 18 bins per decade, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
BetheHeitler : Emin= 0 eV Emax= 80 GeV
BetheHeitlerLPM : Emin= 80 GeV Emax= 100 TeV
BetheHeitler : Emin= 0 eV Emax= 80 GeV AngularGenUrban
BetheHeitlerLPM : Emin= 80 GeV Emax= 100 TeV AngularGenUrban
Rayl: for gamma SubType= 11 BuildTable= 1
Lambda table from 100 eV to 100 keV, 7 bins per decade, spline: 0
@@ -653,7 +653,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
Model: BertiniCascade: 0 eV ---> 12 GeV
Cr_sctns: G4NeutronInelasticXS: 0 eV ---> 100 TeV
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
Process: nCapture
Model: nRadCapture: 0 eV ---> 100 TeV
@@ -896,7 +895,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
Model: hElasticLHEP: 0 eV ---> 1.0001 GeV
Model: hElasticGlauber: 1 GeV ---> 100 TeV
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: pi+Inelastic
Model: FTFP: 3 GeV ---> 100 TeV
@@ -913,7 +911,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
Model: hElasticLHEP: 0 eV ---> 1.0001 GeV
Model: hElasticGlauber: 1 GeV ---> 100 TeV
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: pi-Inelastic
Model: FTFP: 3 GeV ---> 100 TeV
@@ -937,7 +934,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 12 GeV
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for triton
@@ -985,8 +981,6 @@ Index : 0 used in the geometry : Yes
====================================================================
### Run 0 starts.
WARNING: Scene "none" not found.
/vis/scene/list to see scenes.
*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
@@ -1000,8 +994,7 @@ Step# X Y Z Direction x dir y dir
Run terminated.
Run Summary
Number of events processed : 1
User=0s Real=0s Sys=0s
WARNING: command "/vis/viewer/update" could not be applied: no current viewer.
User=0.010000s Real=0.002604s Sys=0.000000s
========= Table of registered couples ==============================
@@ -1015,8 +1008,6 @@ Index : 0 used in the geometry : Yes
====================================================================
### Run 1 starts.
WARNING: Scene "none" not found.
/vis/scene/list to see scenes.
*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
@@ -1030,8 +1021,7 @@ Step# X Y Z Direction x dir y dir
Run terminated.
Run Summary
Number of events processed : 1
User=0s Real=0s Sys=0s
WARNING: command "/vis/viewer/update" could not be applied: no current viewer.
User=0.000000s Real=0.000171s Sys=0.000000s
========= Table of registered couples ==============================
@@ -1045,8 +1035,6 @@ Index : 0 used in the geometry : Yes
====================================================================
### Run 2 starts.
WARNING: Scene "none" not found.
/vis/scene/list to see scenes.
*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
@@ -1060,8 +1048,7 @@ Step# X Y Z Direction x dir y dir
Run terminated.
Run Summary
Number of events processed : 1
User=0s Real=0s Sys=0s
WARNING: command "/vis/viewer/update" could not be applied: no current viewer.
User=0.000000s Real=0.000137s Sys=0.000000s
========= Table of registered couples ==============================
@@ -1075,8 +1062,6 @@ Index : 0 used in the geometry : Yes
====================================================================
### Run 3 starts.
WARNING: Scene "none" not found.
/vis/scene/list to see scenes.
*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
@@ -1086,12 +1071,11 @@ Step# X Y Z Direction x dir y dir
0 0 fm 0 fm 21.9895 m 0 0 -1 100 MeV 0 eV 0 fm 0 fm World initStep
1 0 fm 20.319 cm 21.9895 m 5.03276e-08 3.3909e-08 1 100 MeV0.00067661 eV 31.9171 cm 31.9171 cm World Transportation
2 50328.4 fm 20.3185 cm 21.9905 m 5.03276e-08 -0.00984295 0.999952 100 MeV2.22178e-06 eV 1.04806 mm 32.0219 cm Absorber Transportation
3 5.29388 Ang 20.2645 cm 22 m 5.03276e-08 -0.103352 0.994645 100 MeV2.0179e-05 eV 9.51883 mm 32.9738 cm OutOfWorld Transportation
3 5.29388 Ang 20.2645 cm 22 m 3.6767e-08 -0.103352 0.994645 100 MeV2.0179e-05 eV 9.51883 mm 32.9738 cm OutOfWorld Transportation
Run terminated.
Run Summary
Number of events processed : 1
User=0s Real=0s Sys=0s
WARNING: command "/vis/viewer/update" could not be applied: no current viewer.
User=0.000000s Real=0.000249s Sys=0.000000s
========= Table of registered couples ==============================
@@ -1105,8 +1089,6 @@ Index : 0 used in the geometry : Yes
====================================================================
### Run 4 starts.
WARNING: Scene "none" not found.
/vis/scene/list to see scenes.
*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
@@ -1115,13 +1097,12 @@ WARNING: Scene "none" not found.
Step# X Y Z Direction x dir y dir z KineE dEStep StepLeng TrakLeng Volume Process
0 0 fm 0 fm 21.9895 m 0 0 -1 50 MeV 0 eV 0 fm 0 fm World initStep
1 0 fm 10.2108 cm 21.9895 m 1.27649e-07 1.94226e-07 1 50 MeV0.000318179 eV 16.0395 cm 16.0395 cm World Transportation
2 1.27658 Ang 10.2098 cm 21.9905 m 1.06828e-07 -0.0195869 0.999808 50 MeV2.02662e-06 eV 1.02162 mm 16.1417 cm Absorber Transportation
3 1.15059 nm 10.1016 cm 22 m 1.01351e-07 -0.205667 0.978622 50 MeV1.90326e-05 eV 9.59439 mm 17.1011 cm OutOfWorld Transportation
2 1.27658 Ang 10.2098 cm 21.9905 m 1.40166e-07 -0.019587 0.999808 50 MeV2.02662e-06 eV 1.02162 mm 16.1417 cm Absorber Transportation
3 1.46981 nm 10.1016 cm 22 m 1.40166e-07 -0.205667 0.978622 50 MeV1.90326e-05 eV 9.59439 mm 17.1011 cm OutOfWorld Transportation
Run terminated.
Run Summary
Number of events processed : 1
User=0s Real=0s Sys=0s
WARNING: command "/vis/viewer/update" could not be applied: no current viewer.
User=0.000000s Real=0.000150s Sys=0.000000s
F01FieldSetup::CreateStepperAndChordFinder() called.
1. Creating Stepper.
G4ClassicalRK4 (default) is chosen
@@ -1142,8 +1123,6 @@ Index : 0 used in the geometry : Yes
====================================================================
### Run 5 starts.
WARNING: Scene "none" not found.
/vis/scene/list to see scenes.
*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
@@ -1155,8 +1134,7 @@ Step# X Y Z Direction x dir y dir
Run terminated.
Run Summary
Number of events processed : 1
User=0s Real=0s Sys=0s
WARNING: command "/vis/viewer/update" could not be applied: no current viewer.
User=0.000000s Real=0.000084s Sys=0.000000s
========= Table of registered couples ==============================
@@ -1170,8 +1148,6 @@ Index : 0 used in the geometry : Yes
====================================================================
### Run 6 starts.
WARNING: Scene "none" not found.
/vis/scene/list to see scenes.
--> Event 0 starts.
--> Event 10 starts.
--> Event 20 starts.
@@ -1185,8 +1161,7 @@ WARNING: Scene "none" not found.
Run terminated.
Run Summary
Number of events processed : 100
User=0s Real=0.01s Sys=0s
WARNING: command "/vis/viewer/update" could not be applied: no current viewer.
User=0.000000s Real=0.000911s Sys=0.000000s
Graphics systems deleted.
Visualization Manager deleting...
G4 kernel has come to Quit state.
-4
View File
@@ -3,10 +3,6 @@
# the menu bar of the G4UIXm, G4UIQt, G4UIWin32 sessions.
# It has no effect with G4UIterminal.
#
# Process vis.mac (and draw geometry)
#
/control/execute vis.mac
#
# File menu :
/gui/addMenu file File
/gui/addButton file Quit exit
@@ -27,7 +27,7 @@
/// \brief Implementation of the F01RunAction class
//
//
// $Id: F01RunAction.cc 92496 2015-09-02 07:22:25Z gcosmo $
// $Id: F01RunAction.cc 110139 2018-05-16 07:33:34Z gcosmo $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -69,22 +69,12 @@ void F01RunAction::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 F01RunAction::EndOfRunAction(const G4Run*)
{
if (G4VVisManager::GetConcreteInstance())
{
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
}
// save Rndm status
if (fSaveRndm == 1)
-2
View File
@@ -94,5 +94,3 @@
#
# For file-based drivers, use this to create an empty detector view:
#/vis/viewer/flush
/run/beamOn 1
+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)
+16 -1
View File
@@ -1,4 +1,4 @@
$Id: History 104351 2017-05-26 07:23:04Z gcosmo $
$Id: History 110100 2018-05-15 11:30:23Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -14,6 +14,21 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 15, 2018 J.Allison - fieldex03-V10-04-01
- Remove G4UI_USE and G4VIS_USE.
- Move instantiation of G4UIExecutive to start of main.
- vis.mac, gui.mac: Clean up.
- F03RunAction.cc: Remove vis commands.
May 09, 2018 B.Morgan - fieldex03-V10-04-00
- Include G4Types before use of G4MULTITHREADED. For forward
compatibility with move to #defines over -D for G4 preprocessor
symbols.
Jun 2, 2017 - J.Apostolakis - fieldex03-V10-03-01
- renamed SetStepper() method to CreateSteppers()
May 24, 2017 - J.Apostolakis - fieldex03-V10-03-00
- fixed valgrind issues in field setup's update method: first
delete all dependent objects, then create new ones.
+13 -16
View File
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: field03.cc 98065 2016-07-01 16:30:19Z gcosmo $
// $Id: field03.cc 110100 2018-05-15 11:30:23Z gcosmo $
//
/// \file field/field03/field03.cc
/// \brief Main program of the field/field03 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,34 +93,30 @@ 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];
UImanager->ApplyCommand(command+fileName);
}
else
{ // interactive mode : define UI session
#ifdef G4UI_USE
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
{
if (ui->IsGUI())
UImanager->ApplyCommand("/control/execute gui.mac");
UImanager->ApplyCommand("/control/execute gui.mac");
UImanager->ApplyCommand("/control/execute vis.mac");
ui->SessionStart();
delete ui;
#endif
}
// Job termination
@@ -125,9 +124,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;
+6 -19
View File
@@ -4,7 +4,7 @@
############################################
**************************************************************
Geant4 version Name: geant4-10-04-patch-02 (25-May-2018)
Geant4 version Name: geant4-10-05-beta-01 (29-June-2018)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
@@ -285,8 +285,8 @@ compt: for gamma SubType= 13 BuildTable= 1
conv: for gamma SubType= 14 BuildTable= 1
Lambda table from 1.022 MeV to 100 TeV, 18 bins per decade, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
BetheHeitler : Emin= 0 eV Emax= 80 GeV
BetheHeitlerLPM : Emin= 80 GeV Emax= 100 TeV
BetheHeitler : Emin= 0 eV Emax= 80 GeV AngularGenUrban
BetheHeitlerLPM : Emin= 80 GeV Emax= 100 TeV AngularGenUrban
Rayl: for gamma SubType= 11 BuildTable= 1
Lambda table from 100 eV to 100 keV, 7 bins per decade, spline: 0
@@ -653,7 +653,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
Model: BertiniCascade: 0 eV ---> 12 GeV
Cr_sctns: G4NeutronInelasticXS: 0 eV ---> 100 TeV
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
Process: nCapture
Model: nRadCapture: 0 eV ---> 100 TeV
@@ -896,7 +895,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
Model: hElasticLHEP: 0 eV ---> 1.0001 GeV
Model: hElasticGlauber: 1 GeV ---> 100 TeV
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: pi+Inelastic
Model: FTFP: 3 GeV ---> 100 TeV
@@ -913,7 +911,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
Model: hElasticLHEP: 0 eV ---> 1.0001 GeV
Model: hElasticGlauber: 1 GeV ---> 100 TeV
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: pi-Inelastic
Model: FTFP: 3 GeV ---> 100 TeV
@@ -937,7 +934,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 12 GeV
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for triton
@@ -985,8 +981,6 @@ Index : 0 used in the geometry : Yes
====================================================================
### Run 0 starts.
WARNING: Scene "none" not found.
/vis/scene/list to see scenes.
*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
@@ -1006,8 +1000,7 @@ Step# X Y Z KineE dEStep StepLeng TrakLeng
Run terminated.
Run Summary
Number of events processed : 1
User=0s Real=0s Sys=0s
WARNING: command "/vis/viewer/update" could not be applied: no current viewer.
User=0.000000s Real=0.002200s Sys=0.000000s
========= Table of registered couples ==============================
@@ -1021,15 +1014,12 @@ Index : 0 used in the geometry : Yes
====================================================================
### Run 1 starts.
WARNING: Scene "none" not found.
/vis/scene/list to see scenes.
--> Event 0 starts.
--> Event 50 starts.
Run terminated.
Run Summary
Number of events processed : 100
User=0.01s Real=0.01s Sys=0s
WARNING: command "/vis/viewer/update" could not be applied: no current viewer.
User=0.010000s Real=0.010248s Sys=0.000000s
Set field value to (0,0,1000) Gauss
========= Table of registered couples ==============================
@@ -1044,14 +1034,11 @@ Index : 0 used in the geometry : Yes
====================================================================
### Run 2 starts.
WARNING: Scene "none" not found.
/vis/scene/list to see scenes.
--> Event 0 starts.
Run terminated.
Run Summary
Number of events processed : 10
User=0s Real=0s Sys=0s
WARNING: command "/vis/viewer/update" could not be applied: no current viewer.
User=0.000000s Real=0.001442s Sys=0.000000s
Graphics systems deleted.
Visualization Manager deleting...
G4 kernel has come to Quit state.
-4
View File
@@ -3,10 +3,6 @@
# the menu bar of the G4UIXm, G4UIQt, G4UIWin32 sessions.
# It has no effect with G4UIterminal.
#
# Process vis.mac (and draw geometry)
#
/control/execute vis.mac
#
# File menu :
/gui/addMenu file File
/gui/addButton file Quit exit
@@ -27,7 +27,7 @@
/// \brief Definition of the F03FieldSetup class
//
//
// $Id: F03FieldSetup.hh 77294 2013-11-22 11:01:00Z gcosmo $
// $Id: F03FieldSetup.hh 109870 2018-05-09 12:39:45Z gcosmo $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -61,7 +61,7 @@ public:
void SetStepperType( G4int i ) { fStepperType = i; }
void SetStepper();
void CreateSteppers();
void SetMinStep(G4double s) { fMinStep = s; }
@@ -27,7 +27,7 @@
/// \brief Implementation of the F03FieldSetup class
//
//
// $Id: F03FieldSetup.cc 104351 2017-05-26 07:23:04Z gcosmo $
// $Id: F03FieldSetup.cc 109870 2018-05-09 12:39:45Z gcosmo $
//
//
// Field Setup class implementation.
@@ -126,7 +126,8 @@ void F03FieldSetup::UpdateField()
<< G4endl;
// 2. Create the steppers ( Note: this also deletes the previous ones. )
SetStepper();
CreateSteppers();
// 3. Create the chord finder(s)
fChordFinder = new G4ChordFinder(fMagneticField, fMinStep, fStepper);
@@ -143,7 +144,7 @@ void F03FieldSetup::UpdateField()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void F03FieldSetup::SetStepper()
void F03FieldSetup::CreateSteppers()
{
delete fStepper;
fStepper= nullptr;
@@ -27,7 +27,7 @@
/// \brief Implementation of the F03RunAction class
//
//
// $Id: F03RunAction.cc 92498 2015-09-02 07:24:12Z gcosmo $
// $Id: F03RunAction.cc 110100 2018-05-15 11:30:23Z gcosmo $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -38,7 +38,6 @@
#include "G4Run.hh"
#include "G4UImanager.hh"
#include "G4VVisManager.hh"
#include "Randomize.hh"
@@ -69,22 +68,12 @@ void F03RunAction::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 F03RunAction::EndOfRunAction(const G4Run*)
{
if (G4VVisManager::GetConcreteInstance())
{
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
}
// save Rndm status
if (fSaveRndm == 1)
+1 -3
View File
@@ -87,6 +87,4 @@
/vis/verbose warnings
#
# For file-based drivers, use this to create an empty detector view:
#/vis/viewer/flush
/run/beamOn 1
#/vis/viewer/flush
@@ -40,7 +40,7 @@ target_link_libraries(field04 ${Geant4_LIBRARIES} )
# relies on these scripts being in the current working directory.
#
set(field04_SCRIPTS
field04.in field04.out vis.mac gui.mac icons.mac run.png
field04.in field04.out vis.mac gui.mac
)
foreach(_script ${field04_SCRIPTS})
+13
View File
@@ -15,6 +15,19 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 15, 2018 J.Allison - fieldex04-V10-04-01
- Remove G4UI_USE and G4VIS_USE.
- Move instantiation of G4UIExecutive to start of main.
- vis.mac, gui.mac: Clean up.
May 09, 2018 B.Morgan - fieldex04-V10-04-00
- Include G4Types before use of G4MULTITHREADED. For forward
compatibility with move to #defines over -D for G4 preprocessor
symbols.
Nov 02, 2016 L.Garnier (fieldex04-V10-02-03)
- remove icons.mac. Automatically include since interfaces-V10-02-07
Oct 14, 2016 P.Gumplinger - (fieldex04-V10-02-02)
- remove direct use of theParticleIterator, use GetParticleTableIterator().
fix required by clang39 on Linux and MAC
+10 -17
View File
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: field04.cc 78551 2014-01-07 09:45:08Z gcosmo $
// $Id: field04.cc 110170 2018-05-17 07:28:42Z gcosmo $
//
/// \file field/field04/field04.cc
/// \brief Main program of the field/field04 example
@@ -43,6 +43,8 @@
#include <unistd.h>
#endif
#include "G4Types.hh"
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
#else
@@ -59,13 +61,8 @@
#include "Randomize.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
// argc holds the number of arguments (including the name) on the command line
// -> it is ONE when only the name is given !!!
@@ -76,6 +73,12 @@
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);
@@ -129,14 +132,12 @@ 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
//
@@ -156,7 +157,7 @@ int main(int argc,char** argv)
}
}
#else // Simple UI for Windows runs, no possibility of additional arguments
if (argc!=1) // batch mode
if (!ui) // batch mode
{
G4String command = "/control/execute ";
G4String fileName = argv[1];
@@ -165,10 +166,6 @@ int main(int argc,char** argv)
#endif
else
{
// Define (G)UI terminal for interactive mode
#ifdef G4UI_USE
G4UIExecutive * ui = new G4UIExecutive(argc,argv);
#ifdef G4VIS_USE
// UImanager->ApplyCommand("/control/execute vis.mac");
G4cout << "At the prompt, issue commands to set up detector & field, then:"
<< G4endl;
@@ -177,12 +174,10 @@ int main(int argc,char** argv)
G4cout << "/control/execute vis.mac" << G4endl;
G4cout << "Then: " << G4endl;
G4cout << "/run/beamOn … etc." << G4endl;
#endif
if (ui->IsGUI())
UImanager->ApplyCommand("/control/execute gui.mac");
ui->SessionStart();
delete ui;
#endif
}
// Job termination
@@ -190,9 +185,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
-10
View File
@@ -3,14 +3,6 @@
# the menu bar of the G4UIXm, G4UIQt, G4UIWin32 sessions.
# It has no effect with G4UIterminal.
#
# Process vis.mac (and draw geometry)
#
/control/execute vis.mac
#
# Add icons of general interest
#
/control/execute icons.mac
#
# File menu :
/gui/addMenu file File
/gui/addButton file Quit exit
@@ -47,5 +39,3 @@
/gui/addButton viewer "Flush viewer (= refresh + update)" "/vis/viewer/flush"
/gui/addButton viewer "Update scene" "/vis/scene/notifyHandlers"
#
# User defined icon :
/gui/addIcon "Run beam on" user_icon "/run/beamOn 1" run.png
-26
View File
@@ -1,26 +0,0 @@
#
# This file permits to customize, with commands,
# the icon menu bar of the G4UIQt sessions not yet implemented other UI drivers (geant4-09-05-ref-09)
# It has no effect with G4UIterminal.
# open/save icons
/gui/addIcon "Open macro file" open /control/execute
/gui/addIcon "Save viewer state" save /vis/viewer/save
# Cursors style icons
/gui/addIcon "Move" move
/gui/addIcon "Pick" pick
/gui/addIcon "Zoom out" zoom_out
/gui/addIcon "Zoom in" zoom_in
/gui/addIcon "Rotate" rotate
# Surface Style icons
# Surface Style icons
/gui/addIcon "Hidden line removal" hidden_line_removal
/gui/addIcon "Hidden line and hidden surface removal" hidden_line_and_surface_removal
/gui/addIcon "Surfaces" solid
/gui/addIcon "Wireframe" wireframe
# Perspective/Ortho icons
/gui/addIcon "Perspective" perspective
/gui/addIcon "Orthographic" ortho
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

+3 -2
View File
@@ -10,6 +10,9 @@
#
/vis/open OGL 600x600-0+0
#
# Create an empty scene and add the detector geometry to it
/vis/drawVolume
#
#/vis/viewer/set/style surface
/vis/viewer/set/style wireframe
#
@@ -24,8 +27,6 @@
# /vis/scene/create
# /vis/scene/add/volume
# /vis/sceneHandler/attach
# Create an empty scene and add the detector geometry to it
/vis/drawVolume
#
# Store particle trajectories for visualization
# (if too many tracks cause core dump => storeTrajectory 0)
+11 -1
View File
@@ -1,4 +1,4 @@
// $Id: History 100918 2016-11-03 10:38:27Z gcosmo $
// $Id: History 110102 2018-05-15 11:32:36Z gcosmo $
// ------------------------------------------------------------------
=========================================================
@@ -15,6 +15,16 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 15, 2018 J.Allison - fieldex05-V10-04-01
- Remove G4UI_USE and G4VIS_USE.
- Move instantiation of G4UIExecutive to start of main.
- vis.mac, gui.mac: Clean up.
May 09, 2018 B.Morgan - fieldex05-V10-04-00
- Include G4Types before use of G4MULTITHREADED. For forward
compatibility with move to #defines over -D for G4 preprocessor
symbols.
Nov 03, 2016 L.Garnier - fieldex05-V10-02-01
- remove icons.mac. Automatically include since interfaces-V10-02-07
+13 -21
View File
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: field05.cc 78053 2013-12-03 08:25:13Z gcosmo $
// $Id: field05.cc 110102 2018-05-15 11:32:36Z gcosmo $
//
/// \file field/field05/field05.cc
/// \brief Main program of the field/field05 example
@@ -38,6 +38,8 @@
#include <unistd.h>
#endif
#include "G4Types.hh"
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
#else
@@ -54,18 +56,19 @@
#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);
@@ -97,39 +100,30 @@ 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];
UImanager->ApplyCommand(command+fileName);
UImanager->ApplyCommand(command+fileName);
}
else
{ // interactive mode : define UI session
#ifdef G4UI_USE
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
#ifdef G4VIS_USE
UImanager->ApplyCommand("/control/execute vis.mac");
#else
UImanager->ApplyCommand("/control/execute field05.in");
#endif
if (ui->IsGUI())
UImanager->ApplyCommand("/control/execute gui.mac");
ui->SessionStart();
delete ui;
#endif
}
// Job termination
@@ -137,9 +131,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;
+1 -1
View File
@@ -4,7 +4,7 @@
############################################
**************************************************************
Geant4 version Name: geant4-10-04-patch-02 (25-May-2018)
Geant4 version Name: geant4-10-05-beta-01 (29-June-2018)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
-4
View File
@@ -3,10 +3,6 @@
# the menu bar of the G4UIXm, G4UIQt, G4UIWin32 sessions.
# It has no effect with G4UIterminal.
#
# Process vis.mac (and draw geometry)
#
/control/execute vis.mac
#
# File menu :
/gui/addMenu file File
/gui/addButton file Quit exit
+2 -8
View File
@@ -8,18 +8,12 @@
/control/saveHistory
/run/verbose 2
#
# create empty scene
#
/vis/scene/create
#
# Create a scene handler for a specific graphics system
# (Edit the next line(s) to choose another graphic system)
#
# Use this open statement instead for OpenGL in immediate mode.
/vis/open OGL 600x600-0+0
#
# Output an empty detector
#/vis/viewer/flush
# Draw detector
/vis/drawVolume
#
# Draw trajectories at end of event, showing trajectory points as
# markers of size 2 pixels
+7 -1
View File
@@ -1,4 +1,4 @@
// $Id: History 100948 2016-11-03 11:30:18Z gcosmo $
// $Id: History 110099 2018-05-15 11:29:56Z gcosmo $
// ------------------------------------------------------------------
=========================================================
@@ -15,6 +15,12 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 15, 2018 J.Allison - fieldex06-V10-04-00
- Add #include "G4Types.hh".
- Remove G4UI_USE and G4VIS_USE.
- Move instantiation of G4UIExecutive to start of main.
- vis.mac, gui.mac: Clean up.
Nov 03, 2016 L.Garnier - fieldex06-V10-02-02
- remove icons.mac. Automatically include since interfaces-V10-02-07
+11 -19
View File
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: field06.cc 75572 2013-11-04 11:46:08Z gcosmo $
// $Id: field06.cc 110099 2018-05-15 11:29:56Z gcosmo $
//
/// \file field/field06/field06.cc
/// \brief Main program of the field/field06 example
@@ -38,6 +38,8 @@
#include <unistd.h>
#endif
#include "G4Types.hh"
#include "F06PhysicsList.hh"
#include "F06DetectorConstruction.hh"
#include "F06ActionInitialization.hh"
@@ -53,13 +55,8 @@
#include "Randomize.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
namespace {
@@ -105,6 +102,12 @@ int main(int argc,char** argv)
}
}
// Instantiate G4UIExecutive for interactive mode
G4UIExecutive* ui = nullptr;
if ( macro.size() == 0 ) {
ui = new G4UIExecutive(argc, argv, session);
}
// Choose the Random engine
//
G4Random::setTheEngine(new CLHEP::RanecuEngine);
@@ -134,38 +137,29 @@ 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 ( macro.size() ) {
if ( !ui ) {
// batch mode
G4String command = "/control/execute ";
UImanager->ApplyCommand(command+macro);
}
else
{ // interactive mode : define UI session
#ifdef G4UI_USE
G4UIExecutive* ui = new G4UIExecutive(argc, argv, session);
#ifdef G4VIS_USE
{
UImanager->ApplyCommand("/control/execute vis.mac");
#else
UImanager->ApplyCommand("/control/execute field06.in");
#endif
if (ui->IsGUI())
UImanager->ApplyCommand("/control/execute gui.mac");
ui->SessionStart();
delete ui;
#endif
}
// Job termination
@@ -173,9 +167,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;
+2 -2
View File
@@ -4,7 +4,7 @@
############################################
**************************************************************
Geant4 version Name: geant4-10-04-patch-02 (25-May-2018)
Geant4 version Name: geant4-10-05-beta-01 (29-June-2018)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
@@ -2301,7 +2301,7 @@ Terminate current event processing.
Run terminated.
Run Summary
Number of events processed : 1
User=0.01s Real=0.02s Sys=0.01s
User=0.020000s Real=0.020707s Sys=0.000000s
#
Graphics systems deleted.
Visualization Manager deleting...
-4
View File
@@ -3,10 +3,6 @@
# the menu bar of the G4UIXm, G4UIQt, G4UIWin32 sessions.
# It has no effect with G4UIterminal.
#
# Process vis.mac (and draw geometry)
#
/control/execute vis.mac
#
# File menu :
/gui/addMenu file File
/gui/addButton file Quit exit
+2 -6
View File
@@ -8,18 +8,14 @@
/control/saveHistory
/run/verbose 2
#
# create empty scene
#
/vis/scene/create
#
# Create a scene handler for a specific graphics system
# (Edit the next line(s) to choose another graphic system)
#
# Use this open statement instead for OpenGL in immediate mode.
/vis/open OGL 600x600-0+0
#
# Output an empty detector
#/vis/viewer/flush
# Draw detector
/vis/drawVolume
#
# Draw trajectories at end of event, showing trajectory points as
# markers of size 2 pixels