Import Geant4 10.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2017-12-08 12:52:30 +01:00
parent 98e455a940
commit fc6af9e721
2166 changed files with 276760 additions and 100873 deletions
@@ -0,0 +1,87 @@
//$Id: .README.txt 107716 2017-11-29 08:16:48Z gcosmo $
///\file "physicslists/genericPL/.README.txt"
///\brief Example genericPL README page
/*! \page ExamplegenericPL Example genericPL
\author W. Pokorski(1), I. Hrivnacova(2) \n
(1) CERN \n
(2) Institut de Physique Nucléaire (IPNO), Université Paris-Sud, CNRS-IN2P3 \n
Examples in the physicslist category show the possible ways how to define
a physics list from Geant4 physics constructors. This example demonstrates
the usage of G4GenericPhysicsList to build the concrete physics list at
the run time.
In Geant4 versions < 10.4, the generic physics list was demonstrated in the
extended/hadronic/Hadr05 example.
The G4GenericPhysicsList class allows to build the physics list at the run
time in two possible ways, either by processing a macro file
containing the 'physics list' or by passing a vector of 'physics
constructors' names to the constructor of the class.
To run the example you can call
\verbatim
./genericPL -m run.mac [ -p FTFP_BERT.mac ]
\endverbatim
where FTFP_BERT.mac is the macro file containing the 'physics list'.
If you run this example by calling
\verbatim
./genericPL -m run.mac
\endverbatim
the physics list will be constructed by using a vector of the names of
the different physics constructor defined in the genericPL.cc file.
The same experimental setup is used for all examples in the physicslist category:
\section genericPL_s1 Detector description
The geometry (defined in the DetectorConstruction class) consists in a box of scintillator material (CsI) followed by a thin box of air (screen) which is used to simplify scoring.
\section genericPL_s2 Primary generator
The primary generator is defined with usage of G4ParticleGun.
The default particle is proton which hits the box perpendicular to the input face.
The type of the particle and its energy are set in the PrimaryGeneratorAction class, and can
be changed via the G4 built-in commands of the G4ParticleGun class.
\section genericPL_s3 Scoring (ntuples)
The screen volume is associated with a sensitive detector, ScreenSD,
which accounts the following particle properties:
- trackID
- particle PDG encoding
- particle kinetic energy
- particle X,Y position
- particle time
The scored quantities are filled in the Screen ntuple, which is defined using G4AnalysisManager
in RunAction class. The ntuple is saved in a Root file, which name is set to be equal to the
example name in main () function.
\section genericPL_s4 How to build
An additional step is needed when building the example with GNUmake
due to using the extra shared directory:
\verbatim
% cd path_to_example/example
% gmake setup
% gmake
\endverbatim
This will copy the files from shared in the example include and src;
to remove these files:
\verbatim
% gmake clean_setup
\endverbatim
*/
@@ -0,0 +1,63 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(genericPL)
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/shared/include
${Geant4_INCLUDE_DIR})
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc
${PROJECT_SOURCE_DIR}/shared/src/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh
${PROJECT_SOURCE_DIR}/shared/include/*.hh)
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(genericPL genericPL.cc
${sources} ${add_sources} ${fortran_sources}
${headers} ${add_headers})
target_link_libraries(genericPL ${Geant4_LIBRARIES} ${HBOOK_LIBRARIES})
#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
# build genericPL. This is so that we can run the executable directly because it
# relies on these scripts being in the current working directory.
#
set(genericPL_SCRIPTS
FTFP_BERT.mac init_vis.mac run.mac vis.mac
)
foreach(_script ${genericPL_SCRIPTS})
configure_file(
${PROJECT_SOURCE_DIR}/${_script}
${PROJECT_BINARY_DIR}/${_script}
COPYONLY
)
endforeach()
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS genericPL DESTINATION bin)
+12
View File
@@ -0,0 +1,12 @@
/PhysicsList/defaultCutValue 0.7
/PhysicsList/SetVerboseLevel 1
/PhysicsList/RegisterPhysics G4EmStandardPhysics
/PhysicsList/RegisterPhysics G4EmExtraPhysics
/PhysicsList/RegisterPhysics G4DecayPhysics
/PhysicsList/RegisterPhysics G4HadronElasticPhysics
/PhysicsList/RegisterPhysics G4HadronPhysicsFTFP_BERT
/PhysicsList/RegisterPhysics G4StoppingPhysics
/PhysicsList/RegisterPhysics G4IonPhysics
/PhysicsList/RegisterPhysics G4NeutronTrackingCut
@@ -0,0 +1,31 @@
# $Id: GNUmakefile 99607 2016-09-28 13:33:42Z gcosmo $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
name := genericPL
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../..
endif
.PHONY: setup clean_setup all
all: lib bin
setup:
@echo "Copying files from shared"
@./shared/scripts/copy_files.sh shared
clean_setup:
@echo "Removing files copied from shared"
@./shared/scripts/clean_files.sh shared
include $(G4INSTALL)/config/binmake.gmk
CPPFLAGS += -I./shared/include
visclean:
rm -f g4*.prim g4*.eps g4*.wrl
rm -f .DAWN_*
@@ -0,0 +1,25 @@
$Id:$
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Example genericPL History file
------------------------------
This file should be used by the G4 example coordinator to briefly
summarize all major modifications introduced in the code and keep
track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
28/11/17 I. Hrivnacova (genericPL-V10-03-01)
- Fixed documentation
26/10/17 I. Hrivnacova (genericPL-V10-03-00)
- Updated documentation, the first tag
25/10/17 I. Hrivnacova
- First version of example
@@ -0,0 +1,85 @@
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Example genericPL
W. Pokorski (1)
I. Hrivnacova (2)
(1) CERN
(2) Institut de Physique Nucléaire (IPNO), Université Paris-Su
Examples in the physicslist category show the possible ways how to define
a physics list from Geant4 physics constructors. This example demonstrates
the usage of G4GenericPhysicsList to build the concrete physics list at
the run time.
In Geant4 versions < 10.4, the generic physics list was demonstrated in the
extended/hadronic/Hadr05 example.
The G4GenericPhysicsList class allows to build the physics list at the run
time in two possible ways, either by processing a macro file
containing the 'physics list' or by passing a vector of 'physics
constructors' names to the constructor of the class.
To run the example you can call
./genericPL -m run.mac [ -p FTFP_BERT.mac ]
where FTFP_BERT.mac is the macro file containing the 'physics list'.
If you run this example by calling
./genericPL -m run.mac
the physics list will be constructed by using a vector of the names of
the different physics constructor defined in the genericPL.cc file.
The same experimental setup is used for all examples in the physicslist category:
1- Detector description
-----------------------
The geometry (defined in the DetectorConstruction class) consists in a box of scintillator material (CsI) followed by a thin box of air (screen) which is used to simplify scoring.
2- Primary generator
--------------------
The primary generator is defined with usage of G4ParticleGun.
The default particle is proton which hits the box perpendicular to the input face.
The type of the particle and its energy are set in the PrimaryGeneratorAction class, and can
be changed via the G4 built-in commands of the G4ParticleGun class.
3- Scoring (ntuples)
--------------------
The screen volume is associated with a sensitive detector, ScreenSD,
which accounts the following particle properties:
- trackID
- particle PDG encoding
- particle kinetic energy
- particle X,Y position
- particle time
The scored quantities are filled in the Screen ntuple, which is defined using G4AnalysisManager
in RunAction class. The ntuple is saved in a Root file, which name is set to be equal to the
example name in main () function.
4- How to build
----------------
An additional step is needed when building the example with GNUmake
due to using the extra shared directory:
% cd path_to_example/example
% gmake setup
% gmake
This will copy the files from shared in the example include and src;
to remove these files:
% gmake clean_setup
@@ -0,0 +1,188 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file hadronic/Hadr00/Hadr00.cc
/// \brief Main program of the hadronic/Hadr00 example
//
//
// $Id: Hadr00.cc 106244 2017-09-26 01:58:00Z gcosmo $
//
// -------------------------------------------------------------
// GEANT4 Hadr00
//
// Application demonstrating Geant4 hadronic cross sections
//
// Author: V.Ivanchenko 20 June 2008
//
// Modified:
//
// -------------------------------------------------------------
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "DetectorConstruction.hh"
#include "ActionInitialization.hh"
#include "PrimaryGeneratorAction.hh"
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
#else
#include "G4RunManager.hh"
#endif
#include "G4GenericPhysicsList.hh"
#include "G4VModularPhysicsList.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
namespace {
void PrintUsage() {
G4cerr << " Usage: " << G4endl;
G4cerr << " factory [-m macro ] [-p physListMacro ] [-u UIsession] [-t nThreads]" << G4endl;
G4cerr << " note: -t option is available only for multi-threaded mode." << G4endl;
G4cerr << G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc,char** argv)
{
// Evaluate arguments
//
if ( argc > 9 ) {
PrintUsage();
return 1;
}
G4String macro;
G4String session;
G4String physListMacro;
G4String gdmlFileName;
#ifdef G4MULTITHREADED
G4int nofThreads = 0;
#endif
for ( G4int i=1; i<argc; i=i+2 ) {
if ( G4String(argv[i]) == "-m" ) macro = argv[i+1];
else if ( G4String(argv[i]) == "-u" ) session = argv[i+1];
else if ( G4String(argv[i]) == "-p" ) physListMacro = argv[i+1];
#ifdef G4MULTITHREADED
else if ( G4String(argv[i]) == "-t" ) {
nofThreads = G4UIcommand::ConvertToInt(argv[i+1]);
}
#endif
else {
PrintUsage();
return 1;
}
}
// Detect interactive mode (if no arguments) and define UI session
//
G4UIExecutive* ui = 0;
if ( ! macro.size() ) {
ui = new G4UIExecutive(argc, argv, session);
}
// Choose the Random engine //choose the Random engine
G4Random::setTheEngine(new CLHEP::RanecuEngine());
// Construct the run manager
#ifdef G4MULTITHREADED
G4MTRunManager * runManager = new G4MTRunManager();
if ( nofThreads > 0 ) {
runManager->SetNumberOfThreads(nofThreads);
}
#else
G4RunManager * runManager = new G4RunManager();
#endif
// Get the pointer to the User Interface manager
G4UImanager* UImanager = G4UImanager::GetUIpointer();
// Physics List
G4VModularPhysicsList* physList = nullptr;
if ( physListMacro.size() ) {
// via macro
physList = new G4GenericPhysicsList();
UImanager->ApplyCommand("/control/execute "+physListMacro);
}
else {
// from vector of physics cobstructor names
std::vector<G4String>* myConstructors = new std::vector<G4String>;
myConstructors->push_back("G4EmStandardPhysics");
myConstructors->push_back("G4EmExtraPhysics");
myConstructors->push_back("G4DecayPhysics");
myConstructors->push_back("G4HadronElasticPhysics");
myConstructors->push_back("G4HadronPhysicsFTFP_BERT");
myConstructors->push_back("G4StoppingPhysics");
myConstructors->push_back("G4IonPhysics");
myConstructors->push_back("G4NeutronTrackingCut");
physList = new G4GenericPhysicsList(myConstructors);
}
// Set mandatory initialization classes
runManager->SetUserInitialization(new DetectorConstruction());
runManager->SetUserInitialization(physList);
// set user action classes
runManager->SetUserInitialization(new ActionInitialization("genericPL"));
// Initialize visualization
G4VisManager* visManager = new G4VisExecutive;
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
// G4VisManager* visManager = new G4VisExecutive("Quiet");
visManager->Initialize();
if ( macro.size() ) {
// batch mode
G4String command = "/control/execute ";
UImanager->ApplyCommand(command+macro);
}
else {
// interactive mode : define UI session
UImanager->ApplyCommand("/control/execute init_vis.mac");
ui->SessionStart();
delete ui;
}
// Job termination
// Free the store: user actions, physics_list and detector_description are
// owned and deleted by the run manager, so they should not be deleted
// in the main() program !
delete visManager;
delete runManager;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,465 @@
############################################
!!! WARNING - FPE detection is activated !!!
############################################
*************************************************************
Geant4 version Name: geant4-10-04-ref-00 (08-December-2017)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
*************************************************************
<<< Geant4 Physics List simulation engine: G4GenericPhysicsList
Using Root
Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...
You have successfully registered the following graphics systems.
Current available graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
OpenGLImmediateQt (OGLIQt, OGLI)
OpenGLStoredQt (OGLSQt, OGL, OGLS)
OpenGLImmediateXm (OGLIXm, OGLIQt_FALLBACK)
OpenGLStoredXm (OGLSXm, OGLSQt_FALLBACK)
OpenGLImmediateX (OGLIX, OGLIQt_FALLBACK, OGLIXm_FALLBACK)
OpenGLStoredX (OGLSX, OGLSQt_FALLBACK, OGLSXm_FALLBACK)
RayTracerX (RayTracerX)
Registering model factories...
You have successfully registered the following model factories.
Registered model factories:
generic
drawByAttribute
drawByCharge
drawByOriginVolume
drawByParticleID
drawByEncounteredVolume
Registered filter factories:
attributeFilter
chargeFilter
originVolumeFilter
particleFilter
encounteredVolumeFilter
You have successfully registered the following user vis actions.
Run Duration User Vis Actions: none
End of Event User Vis Actions: none
End of Run User Vis Actions: none
Some /vis commands (optionally) take a string to specify colour.
"/vis/list" to see available colours.
***** Table : Nb of materials = 2 *****
Material: G4_AIR density: 1.205 mg/cm3 RadL: 303.921 m Nucl.Int.Length: 710.095 m
Imean: 85.700 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: C (C) Z = 6.0 N = 12 A = 12.011 g/mole
---> Isotope: C12 Z = 6 N = 12 A = 12.00 g/mole abundance: 98.930 %
---> Isotope: C13 Z = 6 N = 13 A = 13.00 g/mole abundance: 1.070 %
ElmMassFraction: 0.01 % ElmAbundance 0.02 %
---> Element: N (N) Z = 7.0 N = 14 A = 14.007 g/mole
---> Isotope: N14 Z = 7 N = 14 A = 14.00 g/mole abundance: 99.632 %
---> Isotope: N15 Z = 7 N = 15 A = 15.00 g/mole abundance: 0.368 %
ElmMassFraction: 75.53 % ElmAbundance 78.44 %
---> Element: O (O) Z = 8.0 N = 16 A = 15.999 g/mole
---> Isotope: O16 Z = 8 N = 16 A = 15.99 g/mole abundance: 99.757 %
---> Isotope: O17 Z = 8 N = 17 A = 17.00 g/mole abundance: 0.038 %
---> Isotope: O18 Z = 8 N = 18 A = 18.00 g/mole abundance: 0.205 %
ElmMassFraction: 23.18 % ElmAbundance 21.07 %
---> Element: Ar (Ar) Z = 18.0 N = 40 A = 39.948 g/mole
---> Isotope: Ar36 Z = 18 N = 36 A = 35.97 g/mole abundance: 0.337 %
---> Isotope: Ar38 Z = 18 N = 38 A = 37.96 g/mole abundance: 0.063 %
---> Isotope: Ar40 Z = 18 N = 40 A = 39.96 g/mole abundance: 99.600 %
ElmMassFraction: 1.28 % ElmAbundance 0.47 %
Material: G4_CESIUM_IODIDE density: 4.510 g/cm3 RadL: 1.860 cm Nucl.Int.Length: 39.306 cm
Imean: 553.100 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Cs (Cs) Z = 55.0 N = 133 A = 132.905 g/mole
---> Isotope: Cs133 Z = 55 N = 133 A = 132.91 g/mole abundance: 100.000 %
ElmMassFraction: 51.15 % ElmAbundance 50.00 %
---> Element: I (I) Z = 53.0 N = 127 A = 126.904 g/mole
---> Isotope: I127 Z = 53 N = 127 A = 126.90 g/mole abundance: 100.000 %
ElmMassFraction: 48.85 % ElmAbundance 50.00 %
Checking overlaps for volume Box ... OK!
Checking overlaps for volume Screen ... OK!
FTFP_BERT : new threshold between BERT and FTFP is over the interval
for pions : 3 to 12 GeV
for kaons : 3 to 12 GeV
for proton : 3 to 12 GeV
for neutron : 3 to 12 GeV
====================================================================
HADRONIC PROCESSES SUMMARY (verbose level 1)
---------------------------------------------------
Hadronic Processes for neutron
Process: hadElastic
Model: hElasticCHIPS: 0 eV ---> 100 TeV
Cr_sctns: G4NeutronElasticXS: 0 eV ---> 100 TeV
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: neutronInelastic
Model: FTFP: 3 GeV ---> 100 TeV
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
Cr_sctns: G4NeutronCaptureXS: 0 eV ---> 100 TeV
Cr_sctns: GheishaCaptureXS: 0 eV ---> 100 TeV
Process: nKiller
---------------------------------------------------
Hadronic Processes for GenericIon
Process: ionInelastic
Model: Binary Light Ion Cascade: 0 eV /n ---> 4 GeV/n
Model: FTFP: 2 GeV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov nucleus nucleus: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for He3
Process: hadElastic
Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov nucleus nucleus: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: He3Inelastic
Model: Binary Light Ion Cascade: 0 eV /n ---> 4 GeV/n
Model: FTFP: 2 GeV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov nucleus nucleus: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for alpha
Process: hadElastic
Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: alphaInelastic
Model: Binary Light Ion Cascade: 0 eV /n ---> 4 GeV/n
Model: FTFP: 2 GeV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov nucleus nucleus: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for anti_He3
Process: hadElastic
Model: hElasticLHEP: 0 eV /n ---> 100.1 MeV/n
Model: AntiAElastic: 100 MeV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: anti_He3Inelastic
Model: FTFP: 0 eV /n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
Process: hFritiofCaptureAtRest
---------------------------------------------------
Hadronic Processes for anti_alpha
Process: hadElastic
Model: hElasticLHEP: 0 eV /n ---> 100.1 MeV/n
Model: AntiAElastic: 100 MeV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: anti_alphaInelastic
Model: FTFP: 0 eV /n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
Process: hFritiofCaptureAtRest
---------------------------------------------------
Hadronic Processes for anti_deuteron
Process: hadElastic
Model: hElasticLHEP: 0 eV /n ---> 100.1 MeV/n
Model: AntiAElastic: 100 MeV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: anti_deuteronInelastic
Model: FTFP: 0 eV /n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
Process: hFritiofCaptureAtRest
---------------------------------------------------
Hadronic Processes for anti_neutron
Process: hadElastic
Model: hElasticLHEP: 0 eV ---> 100 TeV
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: anti_neutronInelastic
Model: FTFP: 0 eV ---> 100 TeV
Cr_sctns: AntiAGlauber: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for anti_proton
Process: hadElastic
Model: hElasticLHEP: 0 eV ---> 100.1 MeV
Model: AntiAElastic: 100 MeV ---> 100 TeV
Cr_sctns: AntiAGlauber: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: anti_protonInelastic
Model: FTFP: 0 eV ---> 100 TeV
Cr_sctns: AntiAGlauber: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
Process: hFritiofCaptureAtRest
---------------------------------------------------
Hadronic Processes for anti_triton
Process: hadElastic
Model: hElasticLHEP: 0 eV /n ---> 100.1 MeV/n
Model: AntiAElastic: 100 MeV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: anti_tritonInelastic
Model: FTFP: 0 eV /n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
Process: hFritiofCaptureAtRest
---------------------------------------------------
Hadronic Processes for deuteron
Process: hadElastic
Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: dInelastic
Model: Binary Light Ion Cascade: 0 eV /n ---> 4 GeV/n
Model: FTFP: 2 GeV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov nucleus nucleus: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for e+
Process: positronNuclear
Model: G4ElectroVDNuclearModel: 0 eV ---> 1 PeV
Cr_sctns: ElectroNuclearXS: 0 eV ---> 100 TeV
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for e-
Process: electronNuclear
Model: G4ElectroVDNuclearModel: 0 eV ---> 1 PeV
Cr_sctns: ElectroNuclearXS: 0 eV ---> 100 TeV
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for gamma
Process: photonNuclear
Model: BertiniCascade: 0 eV ---> 3.5 GeV
Model: TheoFSGenerator: 3 GeV ---> 100 TeV
Cr_sctns: PhotoNuclearXS: 0 eV ---> 100 TeV
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for kaon+
Process: hadElastic
Model: hElasticLHEP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: kaon+Inelastic
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 12 GeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 2.88022e+295 J
Cr_sctns: ChipsKaonPlusInelasticXS: 0 eV ---> 100 TeV
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for kaon-
Process: hadElastic
Model: hElasticLHEP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: kaon-Inelastic
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 12 GeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 2.88022e+295 J
Cr_sctns: ChipsKaonMinusInelasticXS: 0 eV ---> 100 TeV
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
Process: hBertiniCaptureAtRest
---------------------------------------------------
Hadronic Processes for lambda
Process: hadElastic
Model: hElasticLHEP: 0 eV ---> 100 TeV
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: lambdaInelastic
Model: BertiniCascade: 0 eV ---> 6 GeV
Model: FTFP: 2 GeV ---> 100 TeV
Cr_sctns: ChipsHyperonInelasticXS: 0 eV ---> 100 TeV
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for mu+
Process: muonNuclear
Model: G4MuonVDNuclearModel: 0 eV ---> 1 PeV
Cr_sctns: KokoulinMuonNuclearXS: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for mu-
Process: muonNuclear
Model: G4MuonVDNuclearModel: 0 eV ---> 1 PeV
Cr_sctns: KokoulinMuonNuclearXS: 0 eV ---> 100 TeV
Process: muMinusCaptureAtRest
---------------------------------------------------
Hadronic Processes for pi+
Process: hadElastic
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
Model: BertiniCascade: 0 eV ---> 12 GeV
Cr_sctns: G4CrossSectionPairGG: 0 eV ---> 100 TeV
G4CrossSectionPairGG: G4PiNuclearCrossSection cross sections
below 91 GeV, Glauber-Gribov above
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for pi-
Process: hadElastic
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
Model: BertiniCascade: 0 eV ---> 12 GeV
Cr_sctns: G4CrossSectionPairGG: 0 eV ---> 100 TeV
G4CrossSectionPairGG: G4PiNuclearCrossSection cross sections
below 91 GeV, Glauber-Gribov above
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
Process: hBertiniCaptureAtRest
---------------------------------------------------
Hadronic Processes for proton
Process: hadElastic
Model: hElasticCHIPS: 0 eV ---> 100 TeV
Cr_sctns: ChipsProtonElasticXS: 0 eV ---> 100 TeV
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: protonInelastic
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
Process: hadElastic
Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
Process: tInelastic
Model: Binary Light Ion Cascade: 0 eV /n ---> 4 GeV/n
Model: FTFP: 2 GeV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov nucleus nucleus: 0 eV ---> 2.88022e+295 J
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
================================================================
=======================================================================
====== Pre-compound/De-excitation Physics Parameters ========
=======================================================================
Type of pre-compound inverse x-section 3
Pre-compound model active 1
Pre-compound low energy (MeV) 0.1
Type of de-excitation inverse x-section 3
Type of de-excitation factory Evaporation
Number of de-excitation channels 8
Min excitation energy (keV) 0.01
Min energy per nucleon for multifragmentation (MeV) 1e+05
Level density (1/MeV) 0.1
Time limit for long lived isomeres (ns) 1e+12
Internal e- conversion flag 1
Store e- internal conversion data 0
Electron internal conversion ID 2
Correlated gamma emission flag 0
Max 2J for sampling of angular correlations 10
=======================================================================
### Run 0 starts.
... open Root analysis file : genericPL.root - done
--> Event 0 starts.
--> Event 100 starts.
--> Event 200 starts.
--> Event 300 starts.
--> Event 400 starts.
--> Event 500 starts.
--> Event 600 starts.
--> Event 700 starts.
--> Event 800 starts.
--> Event 900 starts.
... write Root file : genericPL.root - done
... close Root file : genericPL.root - done
Graphics systems deleted.
Visualization Manager deleting...
@@ -0,0 +1,16 @@
# Macro file for the initialization of the "factory" example
# in interactive session
#
# Set some default verbose
/control/verbose 2
/control/saveHistory
/run/verbose 2
#
# Change the default number of threads (in multi-threaded mode)
#/run/numberOfThreads 4
#
# Initialize kernel
/run/initialize
#
# Visualization setting
/control/execute vis.mac
@@ -0,0 +1,12 @@
# Macro file for the "Factory" example
#
# To be run preferably in batch, without graphics:
# % factory -m run.mac
#
#
#/run/numberOfWorkers 4
#
/run/initialize
#
/run/printProgress 100
/run/beamOn 1000
@@ -0,0 +1,22 @@
$Id:$
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
physicslists/shared History file
--------------------------------
This file should be used by the G4 example coordinator to briefly
summarize all major modifications introduced in the code and keep
track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
26/10/17 I. Hrivnacova (physicslistsShared-V10-03-00)
- The first tag
25/10/17 I. Hrivnacova
- First version of example
@@ -0,0 +1,55 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: ActionInitialization.hh 68058 2013-03-13 14:47:43Z gcosmo $
//
/// \file ActionInitialization.hh
/// \brief Definition of the ActionInitialization class
#ifndef ActionInitialization_h
#define ActionInitialization_h 1
#include "G4VUserActionInitialization.hh"
#include "G4String.hh"
/// Action initialization class.
///
class ActionInitialization : public G4VUserActionInitialization
{
public:
ActionInitialization(const G4String& fileName);
virtual ~ActionInitialization();
virtual void BuildForMaster() const;
virtual void Build() const;
private:
G4String fFileName;
};
#endif
@@ -0,0 +1,38 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: Analysis.hh 100946 2016-11-03 11:28:08Z gcosmo $
//
/// \file Analysis.hh
/// \brief Selection of the analysis technology
#ifndef Analysis_h
#define Analysis_h 1
#include "g4root.hh"
//#include "g4cvs.hh"
//#include "g4xml.hh"
#endif
@@ -0,0 +1,75 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: DetectorConstruction.hh 75215 2013-10-29 16:07:06Z gcosmo $
//
/// \file DetectorConstruction.hh
/// \brief Definition of the DetectorConstruction class
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class G4VPhysicalVolume;
class G4GlobalMagFieldMessenger;
/// Detector construction class to define materials and geometry.
/// The calorimeter is a box made of a given number of layers. A layer consists
/// of an absorber plate and of a detection gap. The layer is replicated.
///
/// Four parameters define the geometry of the calorimeter :
///
/// - the thickness of an absorber plate,
/// - the thickness of a gap,
/// - the number of layers,
/// - the transverse size of the calorimeter (the input face is a square).
///
/// In ConstructSDandField() sensitive detectors of CalorimeterSD type
/// are created and associated with the Absorber and Gap volumes.
/// In addition a transverse uniform magnetic field is defined
/// via G4GlobalMagFieldMessenger class.
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
DetectorConstruction();
virtual ~DetectorConstruction();
public:
virtual G4VPhysicalVolume* Construct();
virtual void ConstructSDandField();
private:
// data members
//
static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: PrimaryGeneratorAction.hh 94808 2015-12-10 08:22:26Z gcosmo $
//
/// \file PrimaryGeneratorAction.hh
/// \brief Definition of the PrimaryGeneratorAction class
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4ParticleGun;
class G4Event;
/// The primary generator action class with particle gum.
///
/// It defines a single particle which hits the calorimeter
/// perpendicular to the input face. The type of the particle
/// can be changed via the G4 build-in commands of G4ParticleGun class
/// (see the macros provided with this example).
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction();
virtual ~PrimaryGeneratorAction();
virtual void GeneratePrimaries(G4Event* event);
// set methods
void SetRandomFlag(G4bool value);
private:
G4ParticleGun* fParticleGun; // G4 particle gun
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RunAction.hh 74265 2013-10-02 14:41:20Z gcosmo $
//
/// \file RunAction.hh
/// \brief Definition of the RunAction class
#ifndef RunAction_h
#define RunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
class G4Run;
/// Run action class
///
/// It accumulates statistic and computes dispersion of the energy deposit
/// and track lengths of charged particles with use of analysis tools:
/// H1D histograms are created in BeginOfRunAction() for the following
/// physics quantities:
/// - Edep in absorber
/// - Edep in gap
/// - Track length in absorber
/// - Track length in gap
/// The same values are also saved in the ntuple.
/// The histograms and ntuple are saved in the output file in a format
/// accoring to a selected technology in Analysis.hh.
///
/// In EndOfRunAction(), the accumulated statistic and computed
/// dispersion is printed.
///
class RunAction : public G4UserRunAction
{
public:
RunAction(const G4String& fileName);
virtual ~RunAction();
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
private:
G4String fFileName;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,52 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
/// \file ScreenSD.hh
/// \brief Definition of the ScreenSD class
//
#ifndef ScreenSD_h
#define ScreenSD_h 1
#include "G4VSensitiveDetector.hh"
class G4Step;
class G4HCofThisEvent;
class G4TouchableHistory;
class ScreenSD : public G4VSensitiveDetector
{
public:
ScreenSD(const G4String& name);
virtual ~ScreenSD();
virtual void Initialize(G4HCofThisEvent* hce);
virtual G4bool ProcessHits(G4Step* step, G4TouchableHistory* history);
virtual void EndOfEvent(G4HCofThisEvent* hce);
};
#endif
@@ -0,0 +1,18 @@
#!/bin/sh
# Script to remove classes copied from shared directory into include and src
# via copy_files.sh
#
# By I. Hrivnacova, IPN Orsay
DIRNAME=$1
for FILE in `ls $DIRNAME/include`; do
rm -f include/$FILE
done
for FILE in `ls $DIRNAME/src`; do
rm -f src/$FILE
done
echo "... clean_files.sh from $1 finished"
@@ -0,0 +1,15 @@
#!/bin/sh
# Script to copy classes from shared directory into include and src
# as it is required by GNUmake build.
# Usage: copy_files.sh directoryName
#
# By I. Hrivnacova, IPN Orsay
DIRNAME=$1
cp -rp $DIRNAME/include/* include
cp -rp $DIRNAME/src/* src
echo "... copy_files.sh from $1 finished"
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: ActionInitialization 68058 2013-03-13 14:47:43Z gcosmo $
//
/// \file ActionInitialization
/// \brief Implementation of the ActionInitialization class
#include "ActionInitialization.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ActionInitialization::ActionInitialization(const G4String& fileName)
: G4VUserActionInitialization(),
fFileName(fileName)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ActionInitialization::~ActionInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ActionInitialization::BuildForMaster() const
{
SetUserAction(new RunAction(fFileName));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ActionInitialization::Build() const
{
SetUserAction(new PrimaryGeneratorAction);
SetUserAction(new RunAction(fFileName));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,181 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: DetectorConstruction 101905 2016-12-07 11:34:39Z gunter $
//
/// \file DetectorConstruction
/// \brief Implementation of the DetectorConstruction class
#include "DetectorConstruction.hh"
#include "ScreenSD.hh"
#include "G4Material.hh"
#include "G4NistManager.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4GlobalMagFieldMessenger.hh"
#include "G4SDManager.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4SystemOfUnits.hh"
#include "G4AutoDelete.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ThreadLocal
G4GlobalMagFieldMessenger* DetectorConstruction::fMagFieldMessenger = 0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::DetectorConstruction()
: G4VUserDetectorConstruction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::~DetectorConstruction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* DetectorConstruction::Construct()
{
// Get nist material manager
G4NistManager* nistManager = G4NistManager::Instance();
// Build materials
G4Material* air = nistManager->FindOrBuildMaterial("G4_AIR");
G4Material* csi = nistManager->FindOrBuildMaterial("G4_CESIUM_IODIDE");
// There is no need to test if materials were built/found
// as G4NistManager would issue an error otherwise
// Try the code with "XYZ".
// Print all materials
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
// Option to switch on/off checking of volumes overlaps
G4bool checkOverlaps = true;
//
// World
//
// The world dimensions
G4double worldHxyz = 2.*m;
// world volume
G4Box* worldS = new G4Box("World", worldHxyz, worldHxyz, worldHxyz);
G4LogicalVolume* worldLV = new G4LogicalVolume(worldS, air, "World");
G4VPhysicalVolume* worldPV
= new G4PVPlacement(
0, G4ThreeVector(), worldLV, "World", 0, false, 0, checkOverlaps);
//
// Box
//
// The box dimensions
G4double boxHxy = 1.*m;
G4double boxHz = 10.*cm;
// box volume
G4Box* boxS = new G4Box("World", boxHxy, boxHxy, boxHz);
G4LogicalVolume* boxLV = new G4LogicalVolume(boxS, csi, "Box");
// The box position
G4double posz = 0.*m;
new G4PVPlacement(
0, G4ThreeVector(0, 0, posz),
boxLV, "Box", worldLV, false, 0, checkOverlaps);
//
// Scoring screen
//
// The screen dimensions
G4double screenHxy = 1.999*m;
G4double screenHz = 1.*mm;
// Screen volume
G4Box* screenS = new G4Box("World", screenHxy, screenHxy, screenHz);
G4LogicalVolume* screenLV = new G4LogicalVolume(screenS, air, "Screen");
// The screen position
posz += boxHz + screenHz;
new G4PVPlacement(
0, G4ThreeVector(0, 0, posz),
screenLV, "Screen", worldLV, false, 0, checkOverlaps);
//
// Visualization attributes
//
worldLV->SetVisAttributes(G4VisAttributes::GetInvisible());
auto simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
simpleBoxVisAtt->SetVisibility(true);
boxLV->SetVisAttributes(simpleBoxVisAtt);
screenLV->SetVisAttributes(simpleBoxVisAtt);
//
// Always return the physical World
//
return worldPV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::ConstructSDandField()
{
// G4SDManager::GetSDMpointer()->SetVerboseLevel(1);
//
// Sensitive detectors
//
auto screenSD = new ScreenSD("ScreenSD");
G4SDManager::GetSDMpointer()->AddNewDetector(screenSD);
SetSensitiveDetector("Screen", screenSD);
//
// Magnetic field
//
// Create global magnetic field messenger.
// Uniform magnetic field is then created automatically if
// the field value is not zero.
G4ThreeVector fieldValue;
fMagFieldMessenger = new G4GlobalMagFieldMessenger(fieldValue);
fMagFieldMessenger->SetVerboseLevel(1);
// Register the field messenger for deleting
G4AutoDelete::Register(fMagFieldMessenger);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,105 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: PrimaryGeneratorAction 100946 2016-11-03 11:28:08Z gcosmo $
//
/// \file PrimaryGeneratorAction
/// \brief Implementation of the PrimaryGeneratorAction class
#include "PrimaryGeneratorAction.hh"
#include "G4RunManager.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4LogicalVolume.hh"
#include "G4Box.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4Proton.hh"
#include "G4SystemOfUnits.hh"
#include "Randomize.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PrimaryGeneratorAction::PrimaryGeneratorAction()
: G4VUserPrimaryGeneratorAction(),
fParticleGun(nullptr)
{
G4int nofParticles = 1;
fParticleGun = new G4ParticleGun(nofParticles);
// default particle kinematic
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
fParticleGun->SetParticleEnergy(1.*GeV);
fParticleGun->SetParticleDefinition(G4Proton::Proton());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
delete fParticleGun;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
// This function is called at the begining of event
// In order to avoid dependence of PrimaryGeneratorAction
// on DetectorConstruction class we get world volume
// from G4LogicalVolumeStore
//
G4double worldZHalfLength = 0.;
auto worldLV = G4LogicalVolumeStore::GetInstance()->GetVolume("World");
// Check that the world volume has box shape
G4Box* worldBox = nullptr;
if ( worldLV ) {
worldBox = dynamic_cast<G4Box*>(worldLV->GetSolid());
}
if ( worldBox ) {
worldZHalfLength = worldBox->GetZHalfLength();
}
else {
G4ExceptionDescription msg;
msg << "World volume of box shape not found." << G4endl;
msg << "Perhaps you have changed geometry." << G4endl;
msg << "The gun will be place in the center.";
G4Exception("PrimaryGeneratorAction::GeneratePrimaries()",
"MyCode0002", JustWarning, msg);
}
// Set gun position
fParticleGun
->SetParticlePosition(G4ThreeVector(0., 0., -worldZHalfLength));
fParticleGun->GeneratePrimaryVertex(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,97 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RunAction 100946 2016-11-03 11:28:08Z gcosmo $
//
/// \file RunAction
/// \brief Implementation of the RunAction class
#include "RunAction.hh"
#include "Analysis.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::RunAction(const G4String& fileName)
: G4UserRunAction(),
fFileName(fileName)
{
// Create analysis manager
// The choice of analysis technology is done via selectin of a namespace
// in Analysis.hh
auto analysisManager = G4AnalysisManager::Instance();
G4cout << "Using " << analysisManager->GetType() << G4endl;
analysisManager->SetVerboseLevel(1);
analysisManager->SetNtupleMerging(true);
// Note: merging ntuples is available only with Root output
// Set default fileName
analysisManager->SetFileName(fFileName);
// Create ntuple
//
analysisManager->CreateNtuple("Screen", "Screen hits");
analysisManager->CreateNtupleIColumn("ID"); // column id = 0
analysisManager->CreateNtupleIColumn("PDG"); // column id = 1
analysisManager->CreateNtupleDColumn("Ekin"); // column id = 2
analysisManager->CreateNtupleDColumn("Xpos"); // column id = 3
analysisManager->CreateNtupleDColumn("Ypos"); // column id = 4
analysisManager->CreateNtupleDColumn("time"); // column id = 5
analysisManager->FinishNtuple();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::~RunAction()
{
delete G4AnalysisManager::Instance();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::BeginOfRunAction(const G4Run* /*run*/)
{
// Get analysis manager
auto analysisManager = G4AnalysisManager::Instance();
// Open an output file
analysisManager->OpenFile();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::EndOfRunAction(const G4Run* /*run*/)
{
// Save ntuple and close file
auto analysisManager = G4AnalysisManager::Instance();
analysisManager->Write();
analysisManager->CloseFile();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,108 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
/// \file ScreenSD.cc
/// \brief Implementation of the ScreenSD class
//
#include "ScreenSD.hh"
#include "Analysis.hh"
#include "G4VTouchable.hh"
#include "G4Step.hh"
#include "G4ios.hh"
#include "G4SystemOfUnits.hh"
#include "G4VProcess.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ScreenSD::ScreenSD(const G4String& name)
: G4VSensitiveDetector(name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ScreenSD::~ScreenSD()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ScreenSD::Initialize(G4HCofThisEvent* /*hce*/)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool ScreenSD::ProcessHits(G4Step* step, G4TouchableHistory* /*history*/)
{
// Current track:
const G4Track* track = step->GetTrack();
// Track ID:
G4int ID = track->GetTrackID();
// code PDG:
G4int pdgCode = track->GetDefinition()->GetPDGEncoding();
// Remember preStepPoint:
G4StepPoint* preStepPoint = step->GetPreStepPoint();
// Ekin:
G4double Ekin = preStepPoint->GetKineticEnergy();
// Obtain local coordinates:
const G4VTouchable* touchable = preStepPoint->GetTouchable();
G4ThreeVector globalPosition = preStepPoint->GetPosition();
G4ThreeVector localPosition
= touchable->GetHistory()->GetTopTransform().TransformPoint(globalPosition);
// // Example for obtaining the local direction:
// G4ThreeVector globalDirection = preStepPoint->GetMomentumDirection();
// G4ThreeVector localDirection
// = touchable->GetHistory()->GetTopTransform().TransformAxis(localDirection);
// Time
G4double time = preStepPoint->GetGlobalTime();
// Store hit in the ntuple
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
analysisManager->FillNtupleIColumn(0, ID);
analysisManager->FillNtupleIColumn(1, pdgCode);
analysisManager->FillNtupleDColumn(2, Ekin/MeV);
analysisManager->FillNtupleDColumn(3, localPosition.x()/cm);
analysisManager->FillNtupleDColumn(4, localPosition.y()/cm);
analysisManager->FillNtupleDColumn(5, time/ns);
analysisManager->AddNtupleRow();
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ScreenSD::EndOfEvent(G4HCofThisEvent* /*hce*/)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,80 @@
/control/verbose 2
/run/verbose 2
#
/testhadr/TargetMat G4_Al
/testhadr/TargetRadius 1 cm
/testhadr/TargetLength 10 cm
#/testhadr/NumberDivZ 100
#/testhadr/CutsAll 1 mm
#/testhadr/Physics QBBC
#
/run/initialize
#
# Use this open statement to create an OpenGL view:
/vis/open OGL 600x600-0+0
#
# Use this open statement to create a .prim file suitable for
# viewing in DAWN:
#/vis/open DAWNFILE
#
# Use this open statement to create a .heprep file suitable for
# viewing in HepRApp:
#/vis/open HepRepFile
#
# Use this open statement to create a .wrl file suitable for
# viewing in a VRML viewer:
#/vis/open VRML2FILE
#
# Disable auto refresh and quieten vis messages whilst scene and
# trajectories are established:
/vis/viewer/set/autoRefresh false
/vis/verbose errors
#
# Draw geometry:
/vis/drawVolume
#
# Specify view angle:
/vis/viewer/set/viewpointThetaPhi 90. 0.
#
# Specify zoom value:
#/vis/viewer/zoom 2.
#
# Specify style (surface or wireframe):
#/vis/viewer/set/style wireframe
#
# Draw coordinate axes:
#/vis/scene/add/axes 0 0 0 1 m
#
# Draw smooth trajectories at end of event, showing trajectory points
# as markers 2 pixels wide:
/vis/scene/add/trajectories smooth
/vis/modeling/trajectories/create/drawByCharge
#/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
#/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
# (if too many tracks cause core dump => /tracking/storeTrajectory 0)
#
# Draw hits at end of event:
#/vis/scene/add/hits
#
# To draw only gammas:
#/vis/filtering/trajectories/create/particleFilter
#/vis/filtering/trajectories/particleFilter-0/add gamma
#
# To invert the above, drawing all particles except gammas,
# keep the above two lines but also add:
#/vis/filtering/trajectories/particleFilter-0/invert true
#
# Many other options are available with /vis/modeling and /vis/filtering.
# For example, to select colour by particle ID:
#/vis/modeling/trajectories/create/drawByParticleID
#/vis/modeling/trajectories/drawByParticleID-0/set e- blue
#
# To superimpose all of the events from a given run:
/vis/scene/endOfEventAction accumulate
#
# Re-establish auto refreshing and verbosity:
/vis/viewer/set/autoRefresh true
/vis/verbose warnings
#
# For file-based drivers, use this to create an empty detector view:
#/vis/viewer/flush