diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a1e0f4d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,67 @@ +#---------------------------------------------------------------------------- +# Setup the project +# +cmake_minimum_required(VERSION 3.16...3.21) +project(B4a) + +#---------------------------------------------------------------------------- +# 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 +# Setup include directory for this project +# +include(${Geant4_USE_FILE}) +include_directories(${PROJECT_SOURCE_DIR}/include) + +#---------------------------------------------------------------------------- +# Locate sources and headers for this project +# NB: headers are included so they will show up in IDEs +# +file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc) +file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh) + +#---------------------------------------------------------------------------- +# Add the executable, and link it to the Geant4 libraries +# +add_executable(exampleB4a exampleB4a.cc ${sources} ${headers}) +target_link_libraries(exampleB4a ${Geant4_LIBRARIES}) + +#---------------------------------------------------------------------------- +# Copy all scripts to the build directory, i.e. the directory in which we +# build B4a. This is so that we can run the executable directly because it +# relies on these scripts being in the current working directory. +# +set(EXAMPLEB4A_SCRIPTS + exampleB4a.out + exampleB4.in + gui.mac + init_vis.mac + plotHisto.C + plotNtuple.C + run1.mac + run2.mac + vis.mac + ) + +foreach(_script ${EXAMPLEB4A_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 exampleB4a DESTINATION bin) diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..c84b365 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,21 @@ +# -------------------------------------------------------------- +# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. +# -------------------------------------------------------------- + +name := exampleB4a +G4TARGET := $(name) +G4EXLIB := true + +ifndef G4INSTALL + G4INSTALL = ../../.. +endif + +.PHONY: all +all: lib bin + +include $(G4INSTALL)/config/binmake.gmk + +visclean: + rm -f g4*.prim g4*.eps g4*.wrl + rm -f .DAWN_* + diff --git a/exampleB4.in b/exampleB4.in new file mode 100644 index 0000000..02052f0 --- /dev/null +++ b/exampleB4.in @@ -0,0 +1,23 @@ +# Macro file for example B4 test + +/run/initialize + +# e+ 300MeV +/gun/particle e+ +/gun/energy 300 MeV +/run/beamOn 1 +# +# list the existing physics processes +/process/list +# +# switch off MultipleScattering +/process/inactivate msc +/run/beamOn 1 +# +# switch on MultipleScattering +/process/activate msc +# +# change detector parameter +/gun/particle gamma +/gun/energy 500 MeV +/run/beamOn 1 diff --git a/exampleB4a.cc b/exampleB4a.cc new file mode 100644 index 0000000..bc988bd --- /dev/null +++ b/exampleB4a.cc @@ -0,0 +1,162 @@ +// +// ******************************************************************** +// * 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 exampleB4a.cc +/// \brief Main program of the B4a example + +#include "DetectorConstruction.hh" +#include "ActionInitialization.hh" + +#include "G4RunManagerFactory.hh" +#include "G4SteppingVerbose.hh" +#include "G4UIcommand.hh" +#include "G4UImanager.hh" +#include "G4UIExecutive.hh" +#include "G4VisExecutive.hh" +#include "FTFP_BERT.hh" +#include "Randomize.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +namespace { + void PrintUsage() { + G4cerr << " Usage: " << G4endl; + G4cerr << " exampleB4a [-m macro ] [-u UIsession] [-t nThreads] [-vDefault]" + << G4endl; + G4cerr << " note: -t option is available only for multi-threaded mode." + << G4endl; + } +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +int main(int argc,char** argv) +{ + // Evaluate arguments + // + if ( argc > 7 ) { + PrintUsage(); + return 1; + } + + G4String macro; + G4String session; + G4bool verboseBestUnits = true; +#ifdef G4MULTITHREADED + G4int nThreads = 0; +#endif + for ( G4int i=1; i 0 ) { + runManager->SetNumberOfThreads(nThreads); + } +#endif + + // Set mandatory initialization classes + // + auto detConstruction = new B4::DetectorConstruction(); + runManager->SetUserInitialization(detConstruction); + + auto physicsList = new FTFP_BERT; + runManager->SetUserInitialization(physicsList); + + auto actionInitialization = new B4a::ActionInitialization(detConstruction); + runManager->SetUserInitialization(actionInitialization); + + // Initialize visualization + // + auto visManager = new G4VisExecutive; + // G4VisExecutive can take a verbosity argument - see /vis/verbose guidance. + // G4VisManager* visManager = new G4VisExecutive("Quiet"); + visManager->Initialize(); + + // Get the pointer to the User Interface manager + auto UImanager = G4UImanager::GetUIpointer(); + + // Process macro or start UI session + // + 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"); + if (ui->IsGUI()) { + UImanager->ApplyCommand("/control/execute gui.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..... diff --git a/exampleB4a.out b/exampleB4a.out new file mode 100644 index 0000000..2c978fa --- /dev/null +++ b/exampleB4a.out @@ -0,0 +1,1111 @@ +Environment variable "G4FORCE_RUN_MANAGER_TYPE" enabled with value == Serial. Forcing G4RunManager type... + + ############################################ + !!! WARNING - FPE detection is activated !!! + ############################################ + + + ################################ + !!! G4Backtrace is activated !!! + ################################ + + +************************************************************** + Geant4 version Name: geant4-11-01-patch-02 (15-June-2023) + Copyright : Geant4 Collaboration + References : NIM A 506 (2003), 250-303 + : IEEE-TNS 53 (2006), 270-278 + : NIM A 835 (2016), 186-225 + WWW : http://geant4.org/ +************************************************************** + +<<< Geant4 Physics List simulation engine: FTFP_BERT + +Visualization Manager instantiating with verbosity "warnings (3)"... +Visualization Manager initialising... +Registering graphics systems... + +You have successfully registered the following graphics systems. +Registered graphics systems are: + ASCIITree (ATree) + DAWNFILE (DAWNFILE) + G4HepRepFile (HepRepFile) + RayTracer (RayTracer) + VRML2FILE (VRML2FILE) + gMocrenFile (gMocrenFile) + TOOLSSG_OFFSCREEN (TSG_OFFSCREEN) + TOOLSSG_OFFSCREEN (TSG_OFFSCREEN, TSG_FILE) + 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) + Qt3D (Qt3D) + TOOLSSG_X11_GLES (TSG_X11_GLES, TSGX11, TSG_XT_GLES_FALLBACK) + TOOLSSG_XT_GLES (TSG_XT_GLES, TSGXt, TSG_QT_GLES_FALLBACK) + TOOLSSG_QT_GLES (TSG_QT_GLES, TSGQt, TSG) + +Registering model factories... + +You have successfully registered the following model factories. +Registered model factories: + generic + drawByAttribute + drawByCharge + drawByOriginVolume + drawByParticleID + drawByEncounteredVolume + +Registered models: + None + +Registered filter factories: + attributeFilter + chargeFilter + originVolumeFilter + particleFilter + encounteredVolumeFilter + +Registered filters: + None + +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 = 3 ***** + + Material: G4_Pb density: 11.350 g/cm3 RadL: 5.613 mm Nucl.Int.Length: 18.248 cm + Imean: 823.000 eV temperature: 293.15 K pressure: 1.00 atm + + ---> Element: Pb (Pb) Z = 82.0 N = 207 A = 207.217 g/mole + ---> Isotope: Pb204 Z = 82 N = 204 A = 203.97 g/mole abundance: 1.400 % + ---> Isotope: Pb206 Z = 82 N = 206 A = 205.97 g/mole abundance: 24.100 % + ---> Isotope: Pb207 Z = 82 N = 207 A = 206.98 g/mole abundance: 22.100 % + ---> Isotope: Pb208 Z = 82 N = 208 A = 207.98 g/mole abundance: 52.400 % + ElmMassFraction: 100.00 % ElmAbundance 100.00 % + + + Material: liquidArgon density: 1.390 g/cm3 RadL: 14.064 cm Nucl.Int.Length: 86.076 cm + Imean: 188.000 eV temperature: 293.15 K pressure: 1.00 atm + + ---> 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: 100.00 % ElmAbundance 100.00 % + + + Material: Galactic density: 0.000 mg/cm3 RadL: 204310098.490 pc Nucl.Int.Length: 113427284.261 pc + Imean: 19.200 eV temperature: 2.73 K pressure: 0.00 atm + + ---> Element: H (H) Z = 1.0 N = 1 A = 1.008 g/mole + ---> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.989 % + ---> Isotope: H2 Z = 1 N = 2 A = 2.01 g/mole abundance: 0.011 % + ElmMassFraction: 100.00 % ElmAbundance 100.00 % + + + +Checking overlaps for volume Calorimeter:0 (G4Box) ... OK! +Checking overlaps for volume Abso:0 (G4Box) ... OK! +Checking overlaps for volume Gap:0 (G4Box) ... OK! + +------------------------------------------------------------ +---> The calorimeter is 10 layers of: [ 10mm of G4_Pb + 5mm of liquidArgon ] +------------------------------------------------------------ + + hInelastic FTFP_BERT : threshold between BERT and FTFP is over the interval + for pions : 3 to 6 GeV + for kaons : 3 to 6 GeV + for proton : 3 to 6 GeV + for neutron : 3 to 6 GeV + +### Adding tracking cuts for neutron TimeCut(ns)= 10000 KinEnergyCut(MeV)= 0 +======================================================================= +====== Electromagnetic Physics Parameters ======== +======================================================================= +LPM effect enabled 1 +Enable creation and use of sampling tables 0 +Apply cuts on all EM processes 0 +Use combined TransportationWithMsc Disabled +Use general process 1 +Enable linear polarisation for gamma 0 +Enable photoeffect sampling below K-shell 1 +Enable sampling of quantum entanglement 0 +X-section factor for integral approach 0.8 +Min kinetic energy for tables 100 eV +Max kinetic energy for tables 100 TeV +Number of bins per decade of a table 7 +Verbose level 1 +Verbose level for worker thread 0 +Bremsstrahlung energy threshold above which + primary e+- is added to the list of secondary 100 TeV +Bremsstrahlung energy threshold above which primary + muon/hadron is added to the list of secondary 100 TeV +Lowest triplet kinetic energy 1 MeV +Enable sampling of gamma linear polarisation 0 +5D gamma conversion model type 0 +5D gamma conversion model on isolated ion 0 +Livermore data directory epics_2017 +======================================================================= +====== Ionisation Parameters ======== +======================================================================= +Step function for e+- (0.2, 1 mm) +Step function for muons/hadrons (0.2, 0.1 mm) +Step function for light ions (0.2, 0.1 mm) +Step function for general ions (0.2, 0.1 mm) +Lowest e+e- kinetic energy 1 keV +Lowest muon/hadron kinetic energy 1 keV +Use ICRU90 data 0 +Fluctuations of dE/dx are enabled 1 +Type of fluctuation model for leptons and hadrons Urban +Use built-in Birks satuaration 0 +Build CSDA range enabled 0 +Use cut as a final range enabled 0 +Enable angular generator interface 0 +Max kinetic energy for CSDA tables 1 GeV +Max kinetic energy for NIEL computation 0 eV +Linear loss limit 0.01 +Read data from file for e+e- pair production by mu 0 +======================================================================= +====== Multiple Scattering Parameters ======== +======================================================================= +Type of msc step limit algorithm for e+- 1 +Type of msc step limit algorithm for muons/hadrons 0 +Msc lateral displacement for e+- enabled 1 +Msc lateral displacement for muons and hadrons 0 +Urban msc model lateral displacement alg96 1 +Range factor for msc step limit for e+- 0.04 +Range factor for msc step limit for muons/hadrons 0.2 +Geometry factor for msc step limitation of e+- 2.5 +Safety factor for msc step limit for e+- 0.6 +Skin parameter for msc step limitation of e+- 1 +Lambda limit for msc step limit for e+- 1 mm +Use Mott correction for e- scattering 0 +Factor used for dynamic computation of angular + limit between single and multiple scattering 1 +Fixed angular limit between single + and multiple scattering 3.1416 rad +Upper energy limit for e+- multiple scattering 100 MeV +Type of electron single scattering model 0 +Type of nuclear form-factor 1 +Screening factor 1 +======================================================================= + +phot: for gamma SubType=12 BuildTable=0 + LambdaPrime table from 200 keV to 100 TeV in 61 bins + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + LivermorePhElectric : Emin= 0 eV Emax= 100 TeV SauterGavrila Fluo + +compt: for gamma SubType=13 BuildTable=1 + Lambda table from 100 eV to 1 MeV, 7 bins/decade, spline: 1 + LambdaPrime table from 1 MeV to 100 TeV in 56 bins + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + Klein-Nishina : Emin= 0 eV Emax= 100 TeV + +conv: for gamma SubType=14 BuildTable=1 + Lambda table from 1.022 MeV to 100 TeV, 18 bins/decade, spline: 1 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + BetheHeitlerLPM : Emin= 0 eV Emax= 100 TeV ModifiedTsai + +Rayl: for gamma SubType=11 BuildTable=1 + Lambda table from 100 eV to 150 keV, 7 bins/decade, spline: 0 + LambdaPrime table from 150 keV to 100 TeV in 62 bins + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + LivermoreRayleigh : Emin= 0 eV Emax= 100 TeV CullenGenerator + +msc: for e- SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + UrbanMsc : Emin= 0 eV Emax= 100 MeV Nbins=42 100 eV - 100 MeV + StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llim=1 mm + WentzelVIUni : Emin= 100 MeV Emax= 100 TeV Nbins=42 100 MeV - 100 TeV + StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llim=1 mm + +eIoni: for e- XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 1 mm), integ: 3, fluct: 1, linLossLim= 0.01 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + MollerBhabha : Emin= 0 eV Emax= 100 TeV + +eBrem: for e- XStype:4 SubType=3 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + LPM flag: 1 for E > 1 GeV, VertexHighEnergyTh(GeV)= 100000 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eBremSB : Emin= 0 eV Emax= 1 GeV ModifiedTsai + eBremLPM : Emin= 1 GeV Emax= 100 TeV ModifiedTsai + +CoulombScat: for e- XStype:1 SubType=1 BuildTable=1 + Lambda table from 100 MeV to 100 TeV, 7 bins/decade, spline: 0 + ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eCoulombScattering : Emin= 100 MeV Emax= 100 TeV + +msc: for e+ SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + UrbanMsc : Emin= 0 eV Emax= 100 MeV Nbins=42 100 eV - 100 MeV + StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llim=1 mm + WentzelVIUni : Emin= 100 MeV Emax= 100 TeV Nbins=42 100 MeV - 100 TeV + StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llim=1 mm + +eIoni: for e+ XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 1 mm), integ: 3, fluct: 1, linLossLim= 0.01 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + MollerBhabha : Emin= 0 eV Emax= 100 TeV + +eBrem: for e+ XStype:4 SubType=3 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + LPM flag: 1 for E > 1 GeV, VertexHighEnergyTh(GeV)= 100000 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eBremSB : Emin= 0 eV Emax= 1 GeV ModifiedTsai + eBremLPM : Emin= 1 GeV Emax= 100 TeV ModifiedTsai + +annihil: for e+ XStype:2 SubType=5 BuildTable=0 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eplus2gg : Emin= 0 eV Emax= 100 TeV + +CoulombScat: for e+ XStype:1 SubType=1 BuildTable=1 + Lambda table from 100 MeV to 100 TeV, 7 bins/decade, spline: 0 + ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eCoulombScattering : Emin= 100 MeV Emax= 100 TeV + +msc: for proton SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm + +hIoni: for proton XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 0.1 mm), integ: 3, fluct: 1, linLossLim= 0.01 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + Bragg : Emin= 0 eV Emax= 2 MeV + BetheBloch : Emin= 2 MeV Emax= 100 TeV + +hBrems: for proton XStype:1 SubType=3 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +hPairProd: for proton XStype:1 SubType=4 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + Sampling table 17x1001 from 7.50618 GeV to 100 TeV + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +CoulombScat: for proton XStype:1 SubType=1 BuildTable=1 + Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 0 + ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eCoulombScattering : Emin= 0 eV Emax= 100 TeV + +msc: for GenericIon SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + UrbanMsc : Emin= 0 eV Emax= 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm + +ionIoni: for GenericIon XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 0.1 mm), integ: 3, fluct: 1, linLossLim= 0.02 + Stopping Power data for 17 ion/material pairs + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + BraggIon : Emin= 0 eV Emax= 2 MeV + BetheBloch : Emin= 2 MeV Emax= 100 TeV + +msc: for alpha SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + UrbanMsc : Emin= 0 eV Emax= 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm + +ionIoni: for alpha XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 0.1 mm), integ: 3, fluct: 1, linLossLim= 0.02 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + BraggIon : Emin= 0 eV Emax=7.9452 MeV + BetheBloch : Emin=7.9452 MeV Emax= 100 TeV + +msc: for anti_proton SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm + +hIoni: for anti_proton XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 0.1 mm), integ: 3, fluct: 1, linLossLim= 0.01 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + ICRU73QO : Emin= 0 eV Emax= 2 MeV + BetheBloch : Emin= 2 MeV Emax= 100 TeV + +hBrems: for anti_proton XStype:1 SubType=3 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +hPairProd: for anti_proton XStype:1 SubType=4 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + Sampling table 17x1001 from 7.50618 GeV to 100 TeV + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +CoulombScat: for anti_proton XStype:1 SubType=1 BuildTable=1 + Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 0 + ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eCoulombScattering : Emin= 0 eV Emax= 100 TeV + +msc: for kaon+ SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm + +hIoni: for kaon+ XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 0.1 mm), integ: 3, fluct: 1, linLossLim= 0.01 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + Bragg : Emin= 0 eV Emax=1.05231 MeV + BetheBloch : Emin=1.05231 MeV Emax= 100 TeV + +hBrems: for kaon+ XStype:1 SubType=3 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +hPairProd: for kaon+ XStype:1 SubType=4 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + Sampling table 18x1001 from 3.94942 GeV to 100 TeV + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +CoulombScat: for kaon+ XStype:1 SubType=1 BuildTable=1 + Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 0 + ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eCoulombScattering : Emin= 0 eV Emax= 100 TeV + +msc: for kaon- SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm + +hIoni: for kaon- XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 0.1 mm), integ: 3, fluct: 1, linLossLim= 0.01 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + ICRU73QO : Emin= 0 eV Emax=1.05231 MeV + BetheBloch : Emin=1.05231 MeV Emax= 100 TeV + +hBrems: for kaon- XStype:1 SubType=3 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +hPairProd: for kaon- XStype:1 SubType=4 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + Sampling table 18x1001 from 3.94942 GeV to 100 TeV + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +CoulombScat: for kaon- XStype:1 SubType=1 BuildTable=1 + Used Lambda table of kaon+ + ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eCoulombScattering : Emin= 0 eV Emax= 100 TeV + +msc: for mu+ SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm + +muIoni: for mu+ XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 0.1 mm), integ: 3, fluct: 1, linLossLim= 0.01 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + Bragg : Emin= 0 eV Emax= 200 keV + MuBetheBloch : Emin= 200 keV Emax= 100 TeV + +muBrems: for mu+ XStype:1 SubType=3 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + MuBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +muPairProd: for mu+ XStype:1 SubType=4 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + Sampling table 21x1001 from 0.85 GeV to 100 TeV + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + muPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +CoulombScat: for mu+ XStype:1 SubType=1 BuildTable=1 + Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 0 + ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eCoulombScattering : Emin= 0 eV Emax= 100 TeV + +msc: for mu- SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm + +muIoni: for mu- XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 0.1 mm), integ: 3, fluct: 1, linLossLim= 0.01 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + ICRU73QO : Emin= 0 eV Emax= 200 keV + MuBetheBloch : Emin= 200 keV Emax= 100 TeV + +muBrems: for mu- XStype:1 SubType=3 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + MuBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +muPairProd: for mu- XStype:1 SubType=4 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + Sampling table 21x1001 from 0.85 GeV to 100 TeV + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + muPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +CoulombScat: for mu- XStype:1 SubType=1 BuildTable=1 + Used Lambda table of mu+ + ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eCoulombScattering : Emin= 0 eV Emax= 100 TeV + +msc: for pi+ SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm + +hIoni: for pi+ XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 0.1 mm), integ: 3, fluct: 1, linLossLim= 0.01 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + Bragg : Emin= 0 eV Emax=297.505 keV + BetheBloch : Emin=297.505 keV Emax= 100 TeV + +hBrems: for pi+ XStype:1 SubType=3 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +hPairProd: for pi+ XStype:1 SubType=4 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + Sampling table 20x1001 from 1.11656 GeV to 100 TeV + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +CoulombScat: for pi+ XStype:1 SubType=1 BuildTable=1 + Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 0 + ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eCoulombScattering : Emin= 0 eV Emax= 100 TeV + +msc: for pi- SubType= 10 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm + +hIoni: for pi- XStype:3 SubType=2 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + StepFunction=(0.2, 0.1 mm), integ: 3, fluct: 1, linLossLim= 0.01 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + ICRU73QO : Emin= 0 eV Emax=297.505 keV + BetheBloch : Emin=297.505 keV Emax= 100 TeV + +hBrems: for pi- XStype:1 SubType=3 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +hPairProd: for pi- XStype:1 SubType=4 + dE/dx and range tables from 100 eV to 100 TeV in 84 bins + Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1 + Sampling table 20x1001 from 1.11656 GeV to 100 TeV + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi + +CoulombScat: for pi- XStype:1 SubType=1 BuildTable=1 + Used Lambda table of pi+ + ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531 + ===== EM models for the G4Region DefaultRegionForTheWorld ====== + eCoulombScattering : Emin= 0 eV Emax= 100 TeV + +==================================================================== + 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 + + + Process: neutronInelastic + Model: FTFP: 3 GeV ---> 100 TeV + Model: BertiniCascade: 0 eV ---> 6 GeV + Cr_sctns: G4NeutronInelasticXS: 0 eV ---> 100 TeV + + + Process: nCapture + Model: nRadCapture: 0 eV ---> 100 TeV + Cr_sctns: G4NeutronCaptureXS: 0 eV ---> 100 TeV + + + Process: nKiller + +--------------------------------------------------- + Hadronic Processes for B- + + Process: hadElastic + Model: hElasticLHEP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + + Process: B-Inelastic + Model: FTFP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + +--------------------------------------------------- + Hadronic Processes for D- + + Process: hadElastic + Model: hElasticLHEP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + + Process: D-Inelastic + Model: FTFP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + +--------------------------------------------------- + Hadronic Processes for GenericIon + + Process: ionInelastic + Model: Binary Light Ion Cascade: 0 eV /n ---> 6 GeV/n + Model: FTFP: 3 GeV/n ---> 100 TeV/n + Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV + + +--------------------------------------------------- + Hadronic Processes for He3 + + Process: hadElastic + Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n + Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV + + + Process: He3Inelastic + Model: Binary Light Ion Cascade: 0 eV /n ---> 6 GeV/n + Model: FTFP: 3 GeV/n ---> 100 TeV/n + Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV + + +--------------------------------------------------- + Hadronic Processes for alpha + + Process: hadElastic + Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n + Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV + + + Process: alphaInelastic + Model: Binary Light Ion Cascade: 0 eV /n ---> 6 GeV/n + Model: FTFP: 3 GeV/n ---> 100 TeV/n + Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV + + +--------------------------------------------------- + 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 ---> 25.6 PeV + + + Process: anti_He3Inelastic + Model: FTFP: 0 eV /n ---> 100 TeV/n + Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV + + + 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 ---> 25.6 PeV + + + Process: anti_alphaInelastic + Model: FTFP: 0 eV /n ---> 100 TeV/n + Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV + + + 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 ---> 25.6 PeV + + + Process: anti_deuteronInelastic + Model: FTFP: 0 eV /n ---> 100 TeV/n + Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV + + + Process: hFritiofCaptureAtRest + +--------------------------------------------------- + Hadronic Processes for anti_hypertriton + + Process: hFritiofCaptureAtRest + +--------------------------------------------------- + Hadronic Processes for anti_lambda + + Process: hadElastic + Model: hElasticLHEP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + + Process: anti_lambdaInelastic + Model: FTFP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + + Process: hFritiofCaptureAtRest + +--------------------------------------------------- + Hadronic Processes for anti_neutron + + Process: hadElastic + Model: hElasticLHEP: 0 eV ---> 100.1 MeV + Model: AntiAElastic: 100 MeV ---> 100 TeV + Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV + + + Process: anti_neutronInelastic + Model: FTFP: 0 eV ---> 100 TeV + Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV + + + Process: hFritiofCaptureAtRest + +--------------------------------------------------- + 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 ---> 25.6 PeV + + + Process: anti_protonInelastic + Model: FTFP: 0 eV ---> 100 TeV + Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV + + + 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 ---> 25.6 PeV + + + Process: anti_tritonInelastic + Model: FTFP: 0 eV /n ---> 100 TeV/n + Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV + + + Process: hFritiofCaptureAtRest + +--------------------------------------------------- + Hadronic Processes for deuteron + + Process: hadElastic + Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n + Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV + + + Process: dInelastic + Model: Binary Light Ion Cascade: 0 eV /n ---> 6 GeV/n + Model: FTFP: 3 GeV/n ---> 100 TeV/n + Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV + + +--------------------------------------------------- + Hadronic Processes for e+ + + Process: positronNuclear + Model: G4ElectroVDNuclearModel: 0 eV ---> 1 PeV + Cr_sctns: ElectroNuclearXS: 0 eV ---> 100 TeV + + +--------------------------------------------------- + Hadronic Processes for e- + + Process: electronNuclear + Model: G4ElectroVDNuclearModel: 0 eV ---> 1 PeV + Cr_sctns: ElectroNuclearXS: 0 eV ---> 100 TeV + + +--------------------------------------------------- + Hadronic Processes for gamma + + Process: photonNuclear + Model: GammaNPreco: 0 eV ---> 200 MeV + Model: BertiniCascade: 199 MeV ---> 6 GeV + Model: TheoFSGenerator: 3 GeV ---> 100 TeV + Cr_sctns: GammaNuclearXS: 0 eV ---> 100 TeV + + +--------------------------------------------------- + Hadronic Processes for kaon+ + + Process: hadElastic + Model: hElasticLHEP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + + Process: kaon+Inelastic + Model: FTFP: 3 GeV ---> 100 TeV + Model: BertiniCascade: 0 eV ---> 6 GeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + +--------------------------------------------------- + Hadronic Processes for kaon- + + Process: hadElastic + Model: hElasticLHEP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + + Process: kaon-Inelastic + Model: FTFP: 3 GeV ---> 100 TeV + Model: BertiniCascade: 0 eV ---> 6 GeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + + Process: hBertiniCaptureAtRest + +--------------------------------------------------- + Hadronic Processes for lambda + + Process: hadElastic + Model: hElasticLHEP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + + Process: lambdaInelastic + Model: FTFP: 3 GeV ---> 100 TeV + Model: BertiniCascade: 0 eV ---> 6 GeV + Cr_sctns: Glauber-Gribov: 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: hElasticGlauber: 0 eV ---> 100 TeV + Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV + + + Process: pi+Inelastic + Model: FTFP: 3 GeV ---> 100 TeV + Model: BertiniCascade: 0 eV ---> 6 GeV + Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV + + +--------------------------------------------------- + Hadronic Processes for pi- + + Process: hadElastic + Model: hElasticGlauber: 0 eV ---> 100 TeV + Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV + + + Process: pi-Inelastic + Model: FTFP: 3 GeV ---> 100 TeV + Model: BertiniCascade: 0 eV ---> 6 GeV + Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV + + + Process: hBertiniCaptureAtRest + +--------------------------------------------------- + Hadronic Processes for proton + + Process: hadElastic + Model: hElasticCHIPS: 0 eV ---> 100 TeV + Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV + + + Process: protonInelastic + Model: FTFP: 3 GeV ---> 100 TeV + Model: BertiniCascade: 0 eV ---> 6 GeV + Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV + + +--------------------------------------------------- + Hadronic Processes for sigma- + + Process: hadElastic + Model: hElasticLHEP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + + Process: sigma-Inelastic + Model: FTFP: 3 GeV ---> 100 TeV + Model: BertiniCascade: 0 eV ---> 6 GeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + + Process: hBertiniCaptureAtRest + +--------------------------------------------------- + Hadronic Processes for triton + + Process: hadElastic + Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n + Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV + + + Process: tInelastic + Model: Binary Light Ion Cascade: 0 eV /n ---> 6 GeV/n + Model: FTFP: 3 GeV/n ---> 100 TeV/n + Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV + + +================================================================ +======================================================================= +====== Pre-compound/De-excitation Physics Parameters ======== +======================================================================= +Type of pre-compound inverse x-section 3 +Pre-compound model active 1 +Pre-compound excitation low energy 100 keV +Pre-compound excitation high energy 30 MeV +Type of de-excitation inverse x-section 3 +Type of de-excitation factory Evaporation+GEM +Number of de-excitation channels 68 +Min excitation energy 10 eV +Min energy per nucleon for multifragmentation 200 GeV +Limit excitation energy for Fermi BreakUp 20 MeV +Level density (1/MeV) 0.075 +Use simple level density model 1 +Use discrete excitation energy of the residual 1 +Time limit for long lived isomeres 1 ns +Isomer production flag 1 +Internal e- conversion flag 1 +Store e- internal conversion data 0 +Correlated gamma emission flag 0 +Max 2J for sampling of angular correlations 10 +======================================================================= +G4VisManager: Using G4TrajectoryDrawByCharge as fallback trajectory model. +See commands in /vis/modeling/trajectories/ for other options. +### Run 0 starts. + +-------- WWWW ------- G4Exception-START -------- WWWW ------- +*** G4Exception : Analysis_W001 + issued by : G4RootNtupleFileManager::SetNtupleMergingMode +Merging ntuples is not applicable in sequential application. +Setting was ignored. +*** This is just a warning message. *** +-------- WWWW -------- G4Exception-END --------- WWWW ------- + +... set ntuple merging row mode : row-wise - done +... create file : B4.root - done +... open analysis file : B4.root - done +... open analysis file : B4.root - done +Using +--> Event 0 starts. +---> End of event: 0 + Absorber: total energy: 259.894 MeV total track length: 18.9569 cm + Gap: total energy: 17.4244 MeV total track length: 8.74398 cm + + ----> print histograms statistic for the entire run + + EAbs : mean = 259.894 MeV rms = 0 eV + EGap : mean = 17.4244 MeV rms = 0 eV + LAbs : mean = 18.9569 cm rms = 0 fm + LGap : mean = 8.74398 cm rms = 0 fm +... write file : B4.root - done +... close file : B4.root - done +There are 4 h1 histograms + 0 with 0 entries: Edep in absorber + 1 with 0 entries: Edep in gap + 2 with 0 entries: trackL in absorber + 3 with 0 entries: trackL in gap +List them with "/analysis/list". +View them with "/vis/plot" or "/vis/reviewPlots". + Transportation, GammaGeneralProc, msc, eIoni + eBrem, CoulombScat, msc, eIoni + eBrem, annihil, CoulombScat, msc + ionIoni, msc, muIoni, muBrems + muPairProd, CoulombScat, muIoni, msc + hIoni, hBrems, hPairProd, CoulombScat + hIoni, msc, hIoni, hBrems + hPairProd, CoulombScat, hIoni, msc + hIoni, hBrems, hPairProd, CoulombScat + msc, hIoni, CoulombScat, hIoni + hIoni, msc, ionIoni, msc + ionIoni, hIoni, hIoni, hIoni + hIoni, hIoni, hIoni, hIoni + hIoni, hIoni, hIoni, hIoni + hIoni, hIoni, hIoni, hIoni + hIoni, hIoni, hIoni, hIoni + hIoni, hIoni, hIoni, hIoni + hIoni, hIoni, hIoni, hIoni + hIoni, hIoni, hIoni, hIoni + hIoni, hIoni, hIoni, hIoni + hIoni, hIoni, hIoni, electronNuclear + positronNuclear, muonNuclear, Decay, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, hadElastic + hadElastic, hadElastic, hadElastic, neutronInelastic + nCapture, protonInelastic, pi+Inelastic, pi-Inelastic + kaon+Inelastic, kaon-Inelastic, kaon0LInelastic, kaon0SInelastic +anti_protonInelastic,anti_neutronInelastic,anti_deuteronInelastic,anti_tritonInelastic + anti_He3Inelastic,anti_alphaInelastic, lambdaInelastic, sigma+Inelastic + sigma-Inelastic, xi0Inelastic, xi-Inelastic, omega-Inelastic +anti_lambdaInelastic,anti_sigma+Inelastic,anti_sigma-Inelastic, anti_xi0Inelastic + anti_xi-Inelastic,anti_omega-Inelastic, D+Inelastic, D0Inelastic + D-Inelastic, anti_D0Inelastic, Ds+Inelastic, Ds-Inelastic + B+Inelastic, B0Inelastic, B-Inelastic, anti_B0Inelastic + Bs0Inelastic, anti_Bs0Inelastic, Bc+Inelastic, Bc-Inelastic + lambda_c+Inelastic, xi_c+Inelastic, xi_c0Inelastic, omega_c0Inelastic + lambda_bInelastic, xi_b0Inelastic, xi_b-Inelastic, omega_b-Inelastic +anti_lambda_c+Inelastic,anti_xi_c+Inelastic,anti_xi_c0Inelastic,anti_omega_c0Inelastic +anti_lambda_bInelastic,anti_xi_b0Inelastic,anti_xi_b-Inelastic,anti_omega_b-Inelastic +hFritiofCaptureAtRest,hBertiniCaptureAtRest,muMinusCaptureAtRest, dInelastic + tInelastic, He3Inelastic, alphaInelastic, ionInelastic + nKiller +### Run 1 starts. +... create file : B4.root - done +... open analysis file : B4.root - done +... open analysis file : B4.root - done +Using +--> Event 0 starts. +---> End of event: 0 + Absorber: total energy: 278.136 MeV total track length: 20.1737 cm + Gap: total energy: 19.9095 MeV total track length: 10.0917 cm + + ----> print histograms statistic for the entire run + + EAbs : mean = 278.136 MeV rms = 0 eV + EGap : mean = 19.9095 MeV rms = 0 eV + LAbs : mean = 20.1737 cm rms = 0 fm + LGap : mean = 10.0917 cm rms = 0 fm +... write file : B4.root - done +... close file : B4.root - done +There are 4 h1 histograms + 0 with 0 entries: Edep in absorber + 1 with 0 entries: Edep in gap + 2 with 0 entries: trackL in absorber + 3 with 0 entries: trackL in gap +List them with "/analysis/list". +View them with "/vis/plot" or "/vis/reviewPlots". +### Run 2 starts. +... create file : B4.root - done +... open analysis file : B4.root - done +... open analysis file : B4.root - done +Using +--> Event 0 starts. +---> End of event: 0 + Absorber: total energy: 435.043 MeV total track length: 31.1955 cm + Gap: total energy: 37.3961 MeV total track length: 18.5223 cm + + ----> print histograms statistic for the entire run + + EAbs : mean = 435.043 MeV rms = 0 eV + EGap : mean = 37.3961 MeV rms = 0 eV + LAbs : mean = 31.1955 cm rms = 0 fm + LGap : mean = 18.5223 cm rms = 0 fm +... write file : B4.root - done +... close file : B4.root - done +There are 4 h1 histograms + 0 with 0 entries: Edep in absorber + 1 with 0 entries: Edep in gap + 2 with 0 entries: trackL in absorber + 3 with 0 entries: trackL in gap +List them with "/analysis/list". +View them with "/vis/plot" or "/vis/reviewPlots". +Graphics systems deleted. +Visualization Manager deleting... diff --git a/gui.mac b/gui.mac new file mode 100644 index 0000000..d7bb656 --- /dev/null +++ b/gui.mac @@ -0,0 +1,37 @@ +# +# This file permits to customize, with commands, +# the menu bar of the G4UIXm, G4UIQt, G4UIWin32 sessions. +# It has no effect with G4UIterminal. +# +# File menu : +/gui/addMenu file File +/gui/addButton file Quit exit +# +# Run menu : +/gui/addMenu run Run +/gui/addButton run "beamOn 1" "/run/beamOn 1" +/gui/addButton run run1 "/control/execute run1.mac" +# +# Gun menu : +/gui/addMenu gun Gun +/gui/addButton gun "50 MeV" "/gun/energy 50 MeV" +/gui/addButton gun "1 GeV" "/gun/energy 1 GeV" +/gui/addButton gun "10 GeV" "/gun/energy 10 GeV" +/gui/addButton gun "e-" "/gun/particle e-" +/gui/addButton gun "pi0" "/gun/particle pi0" +/gui/addButton gun "pi+" "/gun/particle pi+" +/gui/addButton gun "neutron" "/gun/particle neutron" +/gui/addButton gun "proton" "/gun/particle proton" +# +# Viewer menu : +/gui/addMenu viewer Viewer +/gui/addButton viewer "Set style surface" "/vis/viewer/set/style surface" +/gui/addButton viewer "Set style wireframe" "/vis/viewer/set/style wireframe" +/gui/addButton viewer "Refresh viewer" "/vis/viewer/refresh" +/gui/addButton viewer "Update viewer (interaction or end-of-file)" "/vis/viewer/update" +/gui/addButton viewer "Flush viewer (= refresh + update)" "/vis/viewer/flush" +/gui/addButton viewer "Update scene" "/vis/scene/notifyHandlers" +# +# To limit the output flow in the "dump" widget : +/run/printProgress 100 +# diff --git a/include/ActionInitialization.hh b/include/ActionInitialization.hh new file mode 100644 index 0000000..f68bc4d --- /dev/null +++ b/include/ActionInitialization.hh @@ -0,0 +1,63 @@ +// +// ******************************************************************** +// * 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 B4/B4a/include/ActionInitialization.hh +/// \brief Definition of the B4a::ActionInitialization class + +#ifndef B4aActionInitialization_h +#define B4aActionInitialization_h 1 + +#include "G4VUserActionInitialization.hh" + + +namespace B4 +{ + class DetectorConstruction; +} + +namespace B4a +{ + +/// Action initialization class. + +class ActionInitialization : public G4VUserActionInitialization +{ + public: + ActionInitialization(B4::DetectorConstruction*); + ~ActionInitialization() override = default; + + void BuildForMaster() const override; + void Build() const override; + + private: + B4::DetectorConstruction* fDetConstruction = nullptr; +}; + +} + +#endif + + diff --git a/include/DetectorConstruction.hh b/include/DetectorConstruction.hh new file mode 100644 index 0000000..681b295 --- /dev/null +++ b/include/DetectorConstruction.hh @@ -0,0 +1,103 @@ +// +// ******************************************************************** +// * 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 B4/B4a/include/DetectorConstruction.hh +/// \brief Definition of the B4::DetectorConstruction class + +#ifndef B4DetectorConstruction_h +#define B4DetectorConstruction_h 1 + +#include "G4VUserDetectorConstruction.hh" +#include "globals.hh" + +class G4VPhysicalVolume; +class G4GlobalMagFieldMessenger; + +namespace B4 +{ + +/// 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 addition a transverse uniform magnetic field is defined +/// via G4GlobalMagFieldMessenger class. + +class DetectorConstruction : public G4VUserDetectorConstruction +{ + public: + DetectorConstruction() = default; + ~DetectorConstruction() override = default; + + public: + G4VPhysicalVolume* Construct() override; + void ConstructSDandField() override; + + // get methods + // + const G4VPhysicalVolume* GetAbsorberPV() const; + const G4VPhysicalVolume* GetGapPV() const; + + private: + // methods + // + void DefineMaterials(); + G4VPhysicalVolume* DefineVolumes(); + + // data members + // + static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger; + // magnetic field messenger + + G4VPhysicalVolume* fAbsorberPV = nullptr; // the absorber physical volume + G4VPhysicalVolume* fGapPV = nullptr; // the gap physical volume + + G4bool fCheckOverlaps = true; // option to activate checking of volumes overlaps +}; + +// inline functions + +inline const G4VPhysicalVolume* DetectorConstruction::GetAbsorberPV() const { + return fAbsorberPV; +} + +inline const G4VPhysicalVolume* DetectorConstruction::GetGapPV() const { + return fGapPV; +} + +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif + diff --git a/include/EventAction.hh b/include/EventAction.hh new file mode 100644 index 0000000..0f734ed --- /dev/null +++ b/include/EventAction.hh @@ -0,0 +1,84 @@ +// +// ******************************************************************** +// * 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 B4/B4a/include/EventAction.hh +/// \brief Definition of the B4a::EventAction class + +#ifndef B4aEventAction_h +#define B4aEventAction_h 1 + +#include "G4UserEventAction.hh" +#include "globals.hh" + +namespace B4a +{ + +/// Event action class +/// +/// It defines data members to hold the energy deposit and track lengths +/// of charged particles in Absober and Gap layers: +/// - fEnergyAbs, fEnergyGap, fTrackLAbs, fTrackLGap +/// which are collected step by step via the functions +/// - AddAbs(), AddGap() + +class EventAction : public G4UserEventAction +{ + public: + EventAction() = default; + ~EventAction() override = default; + + void BeginOfEventAction(const G4Event* event) override; + void EndOfEventAction(const G4Event* event) override; + + void AddAbs(G4double de, G4double dl); + void AddGap(G4double de, G4double dl); + + private: + G4double fEnergyAbs = 0.; + G4double fEnergyGap = 0.; + G4double fTrackLAbs = 0.; + G4double fTrackLGap = 0.; +}; + +// inline functions + +inline void EventAction::AddAbs(G4double de, G4double dl) { + fEnergyAbs += de; + fTrackLAbs += dl; +} + +inline void EventAction::AddGap(G4double de, G4double dl) { + fEnergyGap += de; + fTrackLGap += dl; +} + +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif + + diff --git a/include/PrimaryGeneratorAction.hh b/include/PrimaryGeneratorAction.hh new file mode 100644 index 0000000..7240a83 --- /dev/null +++ b/include/PrimaryGeneratorAction.hh @@ -0,0 +1,68 @@ +// +// ******************************************************************** +// * 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 B4/B4a/include/PrimaryGeneratorAction.hh +/// \brief Definition of the B4::PrimaryGeneratorAction class + +#ifndef B4PrimaryGeneratorAction_h +#define B4PrimaryGeneratorAction_h 1 + +#include "G4VUserPrimaryGeneratorAction.hh" +#include "globals.hh" + +class G4ParticleGun; +class G4Event; + +namespace B4 +{ + +/// 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(); + ~PrimaryGeneratorAction() override; + + void GeneratePrimaries(G4Event* event) override; + + // set methods + void SetRandomFlag(G4bool value); + +private: + G4ParticleGun* fParticleGun = nullptr; // G4 particle gun +}; + +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif diff --git a/include/RunAction.hh b/include/RunAction.hh new file mode 100644 index 0000000..97cae21 --- /dev/null +++ b/include/RunAction.hh @@ -0,0 +1,74 @@ +// +// ******************************************************************** +// * 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 B4/B4a/include/RunAction.hh +/// \brief Definition of the B4::RunAction class + +#ifndef B4RunAction_h +#define B4RunAction_h 1 + +#include "G4UserRunAction.hh" +#include "globals.hh" + +class G4Run; + +namespace B4 +{ + +/// 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 +/// according to a specified file extension. +/// +/// In EndOfRunAction(), the accumulated statistic and computed +/// dispersion is printed. +/// + +class RunAction : public G4UserRunAction +{ + public: + RunAction(); + ~RunAction() override = default; + + void BeginOfRunAction(const G4Run*) override; + void EndOfRunAction(const G4Run*) override; +}; + +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif + diff --git a/include/SteppingAction.hh b/include/SteppingAction.hh new file mode 100644 index 0000000..8b2ddd1 --- /dev/null +++ b/include/SteppingAction.hh @@ -0,0 +1,69 @@ +// +// ******************************************************************** +// * 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 B4/B4a/include/SteppingAction.hh +/// \brief Definition of the B4a::SteppingAction class + +#ifndef B4aSteppingAction_h +#define B4aSteppingAction_h 1 + +#include "G4UserSteppingAction.hh" + +namespace B4 +{ + class DetectorConstruction; +} + +namespace B4a +{ + +class EventAction; + +/// Stepping action class. +/// +/// In UserSteppingAction() there are collected the energy deposit and track +/// lengths of charged particles in Absober and Gap layers and +/// updated in EventAction. + +class SteppingAction : public G4UserSteppingAction +{ +public: + SteppingAction(const B4::DetectorConstruction* detConstruction, + EventAction* eventAction); + ~SteppingAction() override = default; + + void UserSteppingAction(const G4Step* step) override; + +private: + const B4::DetectorConstruction* fDetConstruction = nullptr; + EventAction* fEventAction = nullptr; +}; + +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif diff --git a/init_vis.mac b/init_vis.mac new file mode 100644 index 0000000..bcf4ae0 --- /dev/null +++ b/init_vis.mac @@ -0,0 +1,17 @@ +# Macro file for the initialization of example B4 +# 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 diff --git a/plotHisto.C b/plotHisto.C new file mode 100644 index 0000000..868a742 --- /dev/null +++ b/plotHisto.C @@ -0,0 +1,43 @@ +// ROOT macro file for plotting example B4 histograms +// +// Can be run from ROOT session: +// root[0] .x plotHisto.C + +{ + gROOT->Reset(); + gROOT->SetStyle("Plain"); + + // Draw histos filled by Geant4 simulation + // + + // Open file filled by Geant4 simulation + TFile f("B4.root"); + + // Create a canvas and divide it into 2x2 pads + TCanvas* c1 = new TCanvas("c1", "", 20, 20, 1000, 1000); + c1->Divide(2,2); + + // Draw Eabs histogram in the pad 1 + c1->cd(1); + TH1D* hist1 = (TH1D*)f.Get("Eabs"); + hist1->Draw("HIST"); + + // Draw Labs histogram in the pad 2 + c1->cd(2); + TH1D* hist2 = (TH1D*)f.Get("Labs"); + hist2->Draw("HIST"); + + // Draw Egap histogram in the pad 3 + // with logaritmic scale for y + TH1D* hist3 = (TH1D*)f.Get("Egap"); + c1->cd(3); + gPad->SetLogy(1); + hist3->Draw("HIST"); + + // Draw Lgap histogram in the pad 4 + // with logaritmic scale for y + c1->cd(4); + gPad->SetLogy(1); + TH1D* hist4 = (TH1D*)f.Get("Lgap"); + hist4->Draw("HIST"); +} diff --git a/plotNtuple.C b/plotNtuple.C new file mode 100644 index 0000000..086bbd4 --- /dev/null +++ b/plotNtuple.C @@ -0,0 +1,42 @@ +// ROOT macro file for plotting example B4 ntuple +// +// Can be run from ROOT session: +// root[0] .x plotNtuple.C + +{ + gROOT->Reset(); + gROOT->SetStyle("Plain"); + + // Draw histos filled by Geant4 simulation + // + + // Open file filled by Geant4 simulation + TFile f("B4.root"); + + // Create a canvas and divide it into 2x2 pads + TCanvas* c1 = new TCanvas("c1", "", 20, 20, 1000, 1000); + c1->Divide(2,2); + + // Get ntuple + TNtuple* ntuple = (TNtuple*)f.Get("B4"); + + // Draw Eabs histogram in the pad 1 + c1->cd(1); + ntuple->Draw("Eabs"); + + // Draw Labs histogram in the pad 2 + c1->cd(2); + ntuple->Draw("Labs"); + + // Draw Egap histogram in the pad 3 + // with logaritmic scale for y ?? how to do this? + c1->cd(3); + gPad->SetLogy(1); + ntuple->Draw("Egap"); + + // Draw Lgap histogram in the pad 4 + // with logaritmic scale for y ?? how to do this? + c1->cd(4); + gPad->SetLogy(1); + ntuple->Draw("Egap"); +} diff --git a/run1.mac b/run1.mac new file mode 100644 index 0000000..1898371 --- /dev/null +++ b/run1.mac @@ -0,0 +1,44 @@ +# Macro file for example B4 +# +# Can be run in batch, without graphic +# or interactively: Idle> /control/execute run1.mac +# +# Change the default number of workers (in multi-threading mode) +#/run/numberOfThreads 4 +# +# Initialize kernel +/run/initialize +# +# Default kinematics: +# electron 50 MeV in direction (0.,0.,1.) +# 1 event with tracking/verbose +# +/tracking/verbose 1 +/run/beamOn 1 +# +# +# muon 300 MeV in direction (0.,0.,1.) +# 3 events +# +/gun/particle mu+ +/gun/energy 3 MeV +/run/beamOn 3 +# +# 20 events +# +/tracking/verbose 0 +/run/printProgress 5 +/run/beamOn 20 +# +# Magnetic field +# +/globalField/setValue 0.2 0 0 tesla +/run/beamOn 3 +# +# Activate/inactivate physics processes +# +/process/list +/process/inactivate eBrem +# +/run/beamOn 20 +# diff --git a/run2.mac b/run2.mac new file mode 100644 index 0000000..35e16a6 --- /dev/null +++ b/run2.mac @@ -0,0 +1,17 @@ +# Macro file for example B4 +# +# To be run preferably in batch, without graphics: +# % exampleB4[a,b,c,d] run2.mac +# +#/run/numberOfThreads 4 +#/control/cout/ignoreThreadsExcept 0 +# +/run/initialize +# +# Default kinemtics: +# electron 50 MeV in direction (0.,0.,1.) +# 1000 events +# +/run/printProgress 100 +/run/beamOn 1000 + diff --git a/src/ActionInitialization.cc b/src/ActionInitialization.cc new file mode 100644 index 0000000..4f97a02 --- /dev/null +++ b/src/ActionInitialization.cc @@ -0,0 +1,68 @@ +// +// ******************************************************************** +// * 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 B4/B4a/src/ActionInitialization.cc +/// \brief Implementation of the B4a::ActionInitialization class + +#include "ActionInitialization.hh" +#include "PrimaryGeneratorAction.hh" +#include "RunAction.hh" +#include "EventAction.hh" +#include "SteppingAction.hh" +#include "DetectorConstruction.hh" + +using namespace B4; + +namespace B4a +{ + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +ActionInitialization::ActionInitialization(DetectorConstruction* detConstruction) + : fDetConstruction(detConstruction) +{} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void ActionInitialization::BuildForMaster() const +{ + SetUserAction(new RunAction); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void ActionInitialization::Build() const +{ + SetUserAction(new PrimaryGeneratorAction); + SetUserAction(new RunAction); + auto eventAction = new EventAction; + SetUserAction(eventAction); + SetUserAction(new SteppingAction(fDetConstruction,eventAction)); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +} diff --git a/src/DetectorConstruction.cc b/src/DetectorConstruction.cc new file mode 100644 index 0000000..3d19716 --- /dev/null +++ b/src/DetectorConstruction.cc @@ -0,0 +1,276 @@ +// +// ******************************************************************** +// * 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 B4/B4a/src/DetectorConstruction.cc +/// \brief Implementation of the B4::DetectorConstruction class + +#include "DetectorConstruction.hh" + +#include "G4Material.hh" +#include "G4NistManager.hh" + +#include "G4Box.hh" +#include "G4LogicalVolume.hh" +#include "G4PVPlacement.hh" +#include "G4PVReplica.hh" +#include "G4GlobalMagFieldMessenger.hh" +#include "G4AutoDelete.hh" + +#include "G4GeometryManager.hh" +#include "G4PhysicalVolumeStore.hh" +#include "G4LogicalVolumeStore.hh" +#include "G4SolidStore.hh" + +#include "G4VisAttributes.hh" +#include "G4Colour.hh" + +#include "G4PhysicalConstants.hh" +#include "G4SystemOfUnits.hh" + +namespace B4 +{ + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4ThreadLocal +G4GlobalMagFieldMessenger* DetectorConstruction::fMagFieldMessenger = nullptr; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4VPhysicalVolume* DetectorConstruction::Construct() +{ + // Define materials + DefineMaterials(); + + // Define volumes + return DefineVolumes(); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void DetectorConstruction::DefineMaterials() +{ + // Lead material defined using NIST Manager + auto nistManager = G4NistManager::Instance(); + nistManager->FindOrBuildMaterial("G4_Pb"); + + // Liquid argon material + G4double a; // mass of a mole; + G4double z; // z=mean number of protons; + G4double density; + new G4Material("liquidArgon", z=18., a= 39.95*g/mole, density= 1.390*g/cm3); + // The argon by NIST Manager is a gas with a different density + + // Vacuum + new G4Material("Galactic", z=1., a=1.01*g/mole,density= universe_mean_density, + kStateGas, 2.73*kelvin, 3.e-18*pascal); + + // Print materials + G4cout << *(G4Material::GetMaterialTable()) << G4endl; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4VPhysicalVolume* DetectorConstruction::DefineVolumes() +{ + // Geometry parameters + G4int nofLayers = 10; + G4double absoThickness = 10.*mm; + G4double gapThickness = 5.*mm; + G4double calorSizeXY = 10.*cm; + + auto layerThickness = absoThickness + gapThickness; + auto calorThickness = nofLayers * layerThickness; + auto worldSizeXY = 1.2 * calorSizeXY; + auto worldSizeZ = 1.2 * calorThickness; + + // Get materials + auto defaultMaterial = G4Material::GetMaterial("Galactic"); + auto absorberMaterial = G4Material::GetMaterial("G4_Pb"); + auto gapMaterial = G4Material::GetMaterial("liquidArgon"); + + if ( ! defaultMaterial || ! absorberMaterial || ! gapMaterial ) { + G4ExceptionDescription msg; + msg << "Cannot retrieve materials already defined."; + G4Exception("DetectorConstruction::DefineVolumes()", + "MyCode0001", FatalException, msg); + } + + // + // World + // + auto worldS + = new G4Box("World", // its name + worldSizeXY/2, worldSizeXY/2, worldSizeZ/2); // its size + + auto worldLV + = new G4LogicalVolume( + worldS, // its solid + defaultMaterial, // its material + "World"); // its name + + auto worldPV = new G4PVPlacement(nullptr, // no rotation + G4ThreeVector(), // at (0,0,0) + worldLV, // its logical volume + "World", // its name + nullptr, // its mother volume + false, // no boolean operation + 0, // copy number + fCheckOverlaps); // checking overlaps + + // + // Calorimeter + // + auto calorimeterS + = new G4Box("Calorimeter", // its name + calorSizeXY/2, calorSizeXY/2, calorThickness/2); // its size + + auto calorLV + = new G4LogicalVolume( + calorimeterS, // its solid + defaultMaterial, // its material + "Calorimeter"); // its name + + new G4PVPlacement(nullptr, // no rotation + G4ThreeVector(), // at (0,0,0) + calorLV, // its logical volume + "Calorimeter", // its name + worldLV, // its mother volume + false, // no boolean operation + 0, // copy number + fCheckOverlaps); // checking overlaps + + // + // Layer + // + auto layerS + = new G4Box("Layer", // its name + calorSizeXY/2, calorSizeXY/2, layerThickness/2); // its size + + auto layerLV + = new G4LogicalVolume( + layerS, // its solid + defaultMaterial, // its material + "Layer"); // its name + + new G4PVReplica( + "Layer", // its name + layerLV, // its logical volume + calorLV, // its mother + kZAxis, // axis of replication + nofLayers, // number of replica + layerThickness); // witdth of replica + + // + // Absorber + // + auto absorberS + = new G4Box("Abso", // its name + calorSizeXY/2, calorSizeXY/2, absoThickness/2); // its size + + auto absorberLV + = new G4LogicalVolume( + absorberS, // its solid + absorberMaterial, // its material + "Abso"); // its name + + fAbsorberPV = new G4PVPlacement(nullptr, // no rotation + G4ThreeVector(0., 0., -gapThickness / 2), // its position + absorberLV, // its logical volume + "Abso", // its name + layerLV, // its mother volume + false, // no boolean operation + 0, // copy number + fCheckOverlaps); // checking overlaps + + // + // Gap + // + auto gapS + = new G4Box("Gap", // its name + calorSizeXY/2, calorSizeXY/2, gapThickness/2); // its size + + auto gapLV + = new G4LogicalVolume( + gapS, // its solid + gapMaterial, // its material + "Gap"); // its name + + fGapPV = new G4PVPlacement(nullptr, // no rotation + G4ThreeVector(0., 0., absoThickness / 2), // its position + gapLV, // its logical volume + "Gap", // its name + layerLV, // its mother volume + false, // no boolean operation + 0, // copy number + fCheckOverlaps); // checking overlaps + + // + // print parameters + // + G4cout + << G4endl + << "------------------------------------------------------------" << G4endl + << "---> The calorimeter is " << nofLayers << " layers of: [ " + << absoThickness/mm << "mm of " << absorberMaterial->GetName() + << " + " + << gapThickness/mm << "mm of " << gapMaterial->GetName() << " ] " << G4endl + << "------------------------------------------------------------" << G4endl; + + // + // Visualization attributes + // + worldLV->SetVisAttributes (G4VisAttributes::GetInvisible()); + + auto simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0)); + simpleBoxVisAtt->SetVisibility(true); + calorLV->SetVisAttributes(simpleBoxVisAtt); + + // + // Always return the physical World + // + return worldPV; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void DetectorConstruction::ConstructSDandField() +{ + // 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...... + +} + diff --git a/src/EventAction.cc b/src/EventAction.cc new file mode 100644 index 0000000..30b804e --- /dev/null +++ b/src/EventAction.cc @@ -0,0 +1,101 @@ +// +// ******************************************************************** +// * 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 B4/B4a/src/EventAction.cc +/// \brief Implementation of the B4a::EventAction class + +#include "EventAction.hh" +#include "RunAction.hh" + +#include "G4AnalysisManager.hh" +#include "G4RunManager.hh" +#include "G4Event.hh" +#include "G4UnitsTable.hh" + +#include "Randomize.hh" +#include + +namespace B4a +{ + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void EventAction::BeginOfEventAction(const G4Event* /*event*/) +{ + // initialisation per event + fEnergyAbs = 0.; + fEnergyGap = 0.; + fTrackLAbs = 0.; + fTrackLGap = 0.; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void EventAction::EndOfEventAction(const G4Event* event) +{ + // Accumulate statistics + // + + // get analysis manager + auto analysisManager = G4AnalysisManager::Instance(); + + // fill histograms + analysisManager->FillH1(0, fEnergyAbs); + analysisManager->FillH1(1, fEnergyGap); + analysisManager->FillH1(2, fTrackLAbs); + analysisManager->FillH1(3, fTrackLGap); + + // fill ntuple + analysisManager->FillNtupleDColumn(0, fEnergyAbs); + analysisManager->FillNtupleDColumn(1, fEnergyGap); + analysisManager->FillNtupleDColumn(2, fTrackLAbs); + analysisManager->FillNtupleDColumn(3, fTrackLGap); + analysisManager->AddNtupleRow(); + + // Print per event (modulo n) + // + auto eventID = event->GetEventID(); + auto printModulo = G4RunManager::GetRunManager()->GetPrintProgress(); + if ( ( printModulo > 0 ) && ( eventID % printModulo == 0 ) ) { + G4cout << "---> End of event: " << eventID << G4endl; + + G4cout + << " Absorber: total energy: " << std::setw(7) + << G4BestUnit(fEnergyAbs,"Energy") + << " total track length: " << std::setw(7) + << G4BestUnit(fTrackLAbs,"Length") + << G4endl + << " Gap: total energy: " << std::setw(7) + << G4BestUnit(fEnergyGap,"Energy") + << " total track length: " << std::setw(7) + << G4BestUnit(fTrackLGap,"Length") + << G4endl; + } +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +} diff --git a/src/PrimaryGeneratorAction.cc b/src/PrimaryGeneratorAction.cc new file mode 100644 index 0000000..793ee4e --- /dev/null +++ b/src/PrimaryGeneratorAction.cc @@ -0,0 +1,109 @@ +// +// ******************************************************************** +// * 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 B4/B4a/src/PrimaryGeneratorAction.cc +/// \brief Implementation of the B4::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 "G4ParticleDefinition.hh" +#include "G4SystemOfUnits.hh" +#include "Randomize.hh" + +namespace B4 +{ + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +PrimaryGeneratorAction::PrimaryGeneratorAction() +{ + G4int nofParticles = 1; + fParticleGun = new G4ParticleGun(nofParticles); + + // default particle kinematic + // + auto particleDefinition + = G4ParticleTable::GetParticleTable()->FindParticle("e-"); + fParticleGun->SetParticleDefinition(particleDefinition); + fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.)); + fParticleGun->SetParticleEnergy(50.*MeV); +} + +//....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(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...... + +} diff --git a/src/RunAction.cc b/src/RunAction.cc new file mode 100644 index 0000000..ba1bcb3 --- /dev/null +++ b/src/RunAction.cc @@ -0,0 +1,145 @@ +// +// ******************************************************************** +// * 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 B4/B4a/src/RunAction.cc +/// \brief Implementation of the B4::RunAction class + +#include "RunAction.hh" + +#include "G4AnalysisManager.hh" +#include "G4Run.hh" +#include "G4RunManager.hh" +#include "G4UnitsTable.hh" +#include "G4SystemOfUnits.hh" + +namespace B4 +{ + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +RunAction::RunAction() +{ + // set printing event number per each event + G4RunManager::GetRunManager()->SetPrintProgress(1); + + // Create analysis manager + // The choice of the output format is done via the specified + // file extension. + auto analysisManager = G4AnalysisManager::Instance(); + + // Create directories + //analysisManager->SetHistoDirectoryName("histograms"); + //analysisManager->SetNtupleDirectoryName("ntuple"); + analysisManager->SetVerboseLevel(1); + analysisManager->SetNtupleMerging(true); + // Note: merging ntuples is available only with Root output + + // Book histograms, ntuple + // + + // Creating histograms + analysisManager->CreateH1("Eabs","Edep in absorber", 100, 0., 800*MeV); + analysisManager->CreateH1("Egap","Edep in gap", 100, 0., 100*MeV); + analysisManager->CreateH1("Labs","trackL in absorber", 100, 0., 1*m); + analysisManager->CreateH1("Lgap","trackL in gap", 100, 0., 50*cm); + + // Creating ntuple + // + analysisManager->CreateNtuple("B4", "Edep and TrackL"); + analysisManager->CreateNtupleDColumn("Eabs"); + analysisManager->CreateNtupleDColumn("Egap"); + analysisManager->CreateNtupleDColumn("Labs"); + analysisManager->CreateNtupleDColumn("Lgap"); + analysisManager->FinishNtuple(); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void RunAction::BeginOfRunAction(const G4Run* /*run*/) +{ + //inform the runManager to save random number seed + //G4RunManager::GetRunManager()->SetRandomNumberStore(true); + + // Get analysis manager + auto analysisManager = G4AnalysisManager::Instance(); + + // Open an output file + // + G4String fileName = "B4.root"; + // Other supported output types: + // G4String fileName = "B4.csv"; + // G4String fileName = "B4.hdf5"; + // G4String fileName = "B4.xml"; + analysisManager->OpenFile(fileName); + G4cout << "Using " << analysisManager->GetType() << G4endl; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void RunAction::EndOfRunAction(const G4Run* /*run*/) +{ + // print histogram statistics + // + auto analysisManager = G4AnalysisManager::Instance(); + if ( analysisManager->GetH1(1) ) { + G4cout << G4endl << " ----> print histograms statistic "; + if(isMaster) { + G4cout << "for the entire run " << G4endl << G4endl; + } + else { + G4cout << "for the local thread " << G4endl << G4endl; + } + + G4cout << " EAbs : mean = " + << G4BestUnit(analysisManager->GetH1(0)->mean(), "Energy") + << " rms = " + << G4BestUnit(analysisManager->GetH1(0)->rms(), "Energy") << G4endl; + + G4cout << " EGap : mean = " + << G4BestUnit(analysisManager->GetH1(1)->mean(), "Energy") + << " rms = " + << G4BestUnit(analysisManager->GetH1(1)->rms(), "Energy") << G4endl; + + G4cout << " LAbs : mean = " + << G4BestUnit(analysisManager->GetH1(2)->mean(), "Length") + << " rms = " + << G4BestUnit(analysisManager->GetH1(2)->rms(), "Length") << G4endl; + + G4cout << " LGap : mean = " + << G4BestUnit(analysisManager->GetH1(3)->mean(), "Length") + << " rms = " + << G4BestUnit(analysisManager->GetH1(3)->rms(), "Length") << G4endl; + } + + // save histograms & ntuple + // + analysisManager->Write(); + analysisManager->CloseFile(); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +} diff --git a/src/SteppingAction.cc b/src/SteppingAction.cc new file mode 100644 index 0000000..0678b73 --- /dev/null +++ b/src/SteppingAction.cc @@ -0,0 +1,79 @@ +// +// ******************************************************************** +// * 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 B4/B4a/src/SteppingAction.cc +/// \brief Implementation of the B4a::SteppingAction class + +#include "SteppingAction.hh" +#include "EventAction.hh" +#include "DetectorConstruction.hh" + +#include "G4Step.hh" +#include "G4RunManager.hh" + +using namespace B4; + +namespace B4a +{ + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +SteppingAction::SteppingAction(const DetectorConstruction* detConstruction, + EventAction* eventAction) + : fDetConstruction(detConstruction), + fEventAction(eventAction) +{} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void SteppingAction::UserSteppingAction(const G4Step* step) +{ +// Collect energy and track length step by step + + // get volume of the current step + auto volume = step->GetPreStepPoint()->GetTouchableHandle()->GetVolume(); + + // energy deposit + auto edep = step->GetTotalEnergyDeposit(); + + // step length + G4double stepLength = 0.; + if ( step->GetTrack()->GetDefinition()->GetPDGCharge() != 0. ) { + stepLength = step->GetStepLength(); + } + + if ( volume == fDetConstruction->GetAbsorberPV() ) { + fEventAction->AddAbs(edep,stepLength); + } + + if ( volume == fDetConstruction->GetGapPV() ) { + fEventAction->AddGap(edep,stepLength); + } +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +} diff --git a/vis.mac b/vis.mac new file mode 100644 index 0000000..a4df708 --- /dev/null +++ b/vis.mac @@ -0,0 +1,82 @@ +# Macro file for the visualization setting for the initialization phase +# of the B4 example when running in interactive mode +# + +# Use these open statements to open selected visualization +# +# Use this open statement to create an OpenGL view: +/vis/open OGL 600x600-0+0 +# +# Use this open statement to create an OpenInventor view: +#/vis/open OIX +# +# 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. 180. +# +# Specify zoom value: +#/vis/viewer/zoom 2. +# +# Specify style (surface, wireframe, auxiliary edges,...) +#/vis/viewer/set/style wireframe +#/vis/viewer/set/auxiliaryEdge true +#/vis/viewer/set/lineSegmentsPerCircle 100 +# +# 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 1 +# (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/default/setDrawStepPts true +# To select or override default colours (note: e+ is blue by default): +#/vis/modeling/trajectories/list +#/vis/modeling/trajectories/drawByParticleID-0/set e+ yellow +# +# 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