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
@@ -1,4 +1,4 @@
$Id: History 103629 2017-04-19 13:33:05Z gcosmo $
$Id: History 109867 2018-05-09 12:23:26Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -14,7 +14,18 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
09-05-18 B.Morgan (testem1-V10-04-02)
- Include G4Types before use of G4MULTITHREADED. For forward
compatibility with move to #defines over -D for G4 preprocessor
symbols.
06-04-18 mma (testem1-V10-04-01)
- testem1.cc : set visualisation only in interactive mode
11-03-18 mma (testem1-V10-04-00)
- testem1.cc : remove G4UI_USE and G4VIS_USE
19-04-17 mma (testem1-V10-03-00)
- BeginOfRunAction() : remove SetRandomNumberStore(true)
@@ -27,10 +27,11 @@
/// \brief Main program of the electromagnetic/TestEm1 example
//
//
// $Id: TestEm1.cc 84815 2014-10-21 12:19:02Z gcosmo $
//
// $Id: TestEm1.cc 109867 2018-05-09 12:23:26Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4Types.hh"
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
@@ -46,22 +47,21 @@
#include "ActionInitialization.hh"
#include "SteppingVerbose.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
#include "G4VisExecutive.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc,char** argv) {
//detect interactive mode (if no arguments) and define UI session
G4UIExecutive* ui = nullptr;
if (argc == 1) ui = new G4UIExecutive(argc,argv);
//choose the Random engine
G4Random::setTheEngine(new CLHEP::RanecuEngine);
// Construct the default run manager
//construct the default run manager
#ifdef G4MULTITHREADED
G4MTRunManager* runManager = new G4MTRunManager;
G4int nThreads = G4Threading::G4GetNumberOfCores();
@@ -72,49 +72,39 @@ int main(int argc,char** argv) {
G4RunManager* runManager = new G4RunManager;
#endif
// set mandatory initialization classes
//set mandatory initialization classes
DetectorConstruction* det = new DetectorConstruction;
runManager->SetUserInitialization(det);
PhysicsList* phys = new PhysicsList(det);
PhysicsList* phys = new PhysicsList(det);
runManager->SetUserInitialization(phys);
// set user action classes
//set user action classes
runManager->SetUserInitialization(new ActionInitialization(det));
// get the pointer to the User Interface manager
G4UImanager* UI = G4UImanager::GetUIpointer();
//initialize visualization
G4VisManager* visManager = nullptr;
if (argc!=1) // batch mode
{
G4String command = "/control/execute ";
G4String fileName = argv[1];
UI->ApplyCommand(command+fileName);
}
else //define visualization and UI terminal for interactive mode
{
#ifdef G4VIS_USE
G4VisManager* visManager = new G4VisExecutive;
//get the pointer to the User Interface manager
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if (ui) {
//interactive mode
visManager = new G4VisExecutive;
visManager->Initialize();
#endif
#ifdef G4UI_USE
G4UIExecutive * ui = new G4UIExecutive(argc,argv);
ui->SessionStart();
delete ui;
#endif
#ifdef G4VIS_USE
delete visManager;
#endif
}
ui->SessionStart();
delete ui;
}
else {
//batch mode
G4String command = "/control/execute ";
G4String fileName = argv[1];
UImanager->ApplyCommand(command+fileName);
}
// job termination
//
//job termination
delete visManager;
delete runManager;
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -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
@@ -295,6 +295,8 @@ Command is ignored.
/run/initialize
The Box is 10 m of Aluminium
GetProcess : RadioactiveDecay
##/globalField/setValue 0 0 5 tesla
#
/testem/gun/setDefault
@@ -350,41 +352,41 @@ Index : 0 used in the geometry : Yes
Run terminated.
Run Summary
Number of events processed : 2000
User=1.85s Real=1.87s Sys=0s
User=1.500000s Real=1.507458s Sys=0.000000s
======================== run summary ======================
The run is: 2000 e- of 100 MeV through 10 m of Aluminium (density: 2.7 g/cm3 )
total energy deposit: 99.781 MeV
total energy deposit: 99.797 MeV
nb tracks/event neutral: 25.178 charged: 137.25
nb steps/event neutral: 139.39 charged: 203.33
nb tracks/event neutral: 25.267 charged: 137.2
nb steps/event neutral: 139.44 charged: 202.97
Process calls frequency :
Rayl= 17642 Transportation= 1868 annihil= 2773
compt= 210791 conv= 2761 eBrem= 45872
eIoni= 357516 msc= 482 phot= 45737
Rayl= 17676 Transportation= 1858 annihil= 2796
compt= 210671 conv= 2778 eBrem= 46001
eIoni= 356685 msc= 446 phot= 45905
---------------------------------------------------------
Primary particle :
true Range = 10.972 cm rms = 3.8209 cm
proj Range = 9.5178 cm rms = 3.5488 cm
proj/true = 0.86749
transverse dispersion at end = 1.5924 cm
mass true Range from simulation = 29.624 g/cm2
true Range = 11.162 cm rms = 3.8982 cm
proj Range = 9.7102 cm rms = 3.5887 cm
proj/true = 0.86992
transverse dispersion at end = 1.6585 cm
mass true Range from simulation = 30.138 g/cm2
from PhysicsTable (csda range) = 32.1 g/cm2
---------------------------------------------------------
--------- Ranecu engine status ---------
Initial seed (index) = 0
Current couple of seeds = 127632317, 894303761
Current couple of seeds = 1927272673, 1717789735
----------------------------------------
G4 kernel has come to Quit state.
================== Deleting memory pools ===================
Number of memory pools allocated: 9 of which, static: 0
Dynamic pools deleted: 9 / Total memory freed: 0.036 MB
Dynamic pools deleted: 9 / Total memory freed: 0.037 MB
============================================================
RunManagerKernel is deleted. Good bye :)
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm1/include/PhysicsList.hh
/// \brief Definition of the PhysicsList class
//
// $Id: PhysicsList.hh 82331 2014-06-16 09:54:40Z gcosmo $
// $Id: PhysicsList.hh 108857 2018-03-12 07:42:27Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
@@ -44,6 +44,7 @@
class DetectorConstruction;
class PhysicsListMessenger;
class G4VPhysicsConstructor;
class G4VProcess;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -62,7 +63,8 @@ class PhysicsList: public G4VModularPhysicsList
void AddStepMax();
void GetRange(G4double);
G4VProcess* GetProcess(const G4String&) const;
private:
G4VPhysicsConstructor* fEmPhysicsList;
G4String fEmName;
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm1/src/HistoManager.cc
/// \brief Implementation of the HistoManager class
//
// $Id: HistoManager.cc 81776 2014-06-05 08:41:01Z gcosmo $
// $Id: HistoManager.cc 109283 2018-04-09 10:00:23Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -64,16 +64,16 @@ void HistoManager::Book()
// Define histograms start values
const G4int kMaxHisto = 6;
const G4String id[] = { "1", "2", "3" , "4", "5", "6"};
const G4String id[] = { "1", "2", "3" , "4", "5", "6" };
const G4String title[] =
{ "total track length of primary particle", //1
"nb steps of primary particle", //2
"step size of primary particle", //3
"total energy deposit", //4
"energy of charged secondaries at creation", //5
"energy of neutral secondaries at creation" //6
"energy of neutral secondaries at creation" //6
};
// Default values (to be reset via /analysis/h1/set command)
// Default values (to be reset via /analysis/h1/set command)
G4int nbins = 100;
G4double vmin = 0.;
G4double vmax = 100.;
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm1/src/PhysicsList.cc
/// \brief Implementation of the PhysicsList class
//
// $Id: PhysicsList.cc 100290 2016-10-17 08:47:55Z gcosmo $
// $Id: PhysicsList.cc 108857 2018-03-12 07:42:27Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -134,7 +134,12 @@ void PhysicsList::ConstructProcess()
// step limitation (as a full process)
//
AddStepMax();
AddStepMax();
// Get process
auto process = GetProcess("RadioactiveDecay");
if (process != nullptr)
G4cout << "\n GetProcess : " << process->GetProcessName() << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -303,3 +308,21 @@ void PhysicsList::GetRange(G4double val)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4Gamma.hh"
#include "G4Electron.hh"
#include "G4Proton.hh"
#include "G4GenericIon.hh"
G4VProcess* PhysicsList::GetProcess(const G4String& processName) const
{
G4ParticleDefinition* particle = G4GenericIon::GenericIon();
G4ProcessVector* procList = particle->GetProcessManager()->GetProcessList();
G4int nbProc = particle->GetProcessManager()->GetProcessListLength();
for (G4int k=0; k<nbProc; k++) {
G4VProcess* process = (*procList)[k];
if (process->GetProcessName() == processName) return process;
}
return nullptr;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -38,6 +38,7 @@
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
#include "G4EmCalculator.hh"
#include "G4ProductionCutsTable.hh"
#include <iomanip>
@@ -140,8 +141,8 @@ void Run::EndOfRun()
<< G4BestUnit(fEkin,"Energy") << " through "
<< G4BestUnit(fDetector->GetSize(),"Length") << " of "
<< material->GetName() << " (density: "
<< G4BestUnit(density,"Volumic Mass") << ")" << G4endl;
<< G4BestUnit(density,"Volumic Mass") << ")" << G4endl;
if (numberOfEvent == 0) { G4cout.precision(dfprec); return;}
G4double dNbOfEvents = double(numberOfEvent);
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm1/src/SteppingAction.cc
/// \brief Implementation of the SteppingAction class
//
// $Id: SteppingAction.cc 98759 2016-08-09 14:03:09Z gcosmo $
// $Id: SteppingAction.cc 109283 2018-04-09 10:00:23Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -56,6 +56,7 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep)
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
G4double EdepStep = aStep->GetTotalEnergyDeposit();
if (EdepStep > 0.) { run->AddEdep(EdepStep);
fEventAction->AddEdep(EdepStep);
}