Import Geant4 9.6.0 source tree
This commit is contained in:
@@ -0,0 +1,147 @@
|
||||
//$Id$
|
||||
|
||||
///\file "electromagnetic/TestEm1/.README"
|
||||
///\brief Example TestEm1 README page
|
||||
|
||||
/*! \page ExampleTestEm1 Example TestEm1
|
||||
|
||||
- How to count processes.
|
||||
- How to activate/inactivate processes.
|
||||
- How to survey the tracking, in perticular the range of charged particles.
|
||||
- How to define a maximum step size.
|
||||
|
||||
\section TestEm1_s1 GEOMETRY DEFINITION
|
||||
|
||||
It is a simple box which represente an 'semi infinite' homogeneous medium.
|
||||
|
||||
Two parameters define the geometry :
|
||||
- the material of the box,
|
||||
- the full size of the box.
|
||||
|
||||
In addition a transverse uniform magnetic field can be applied.
|
||||
|
||||
The default geometry is constructed in DetectorConstruction class, but all of
|
||||
the above parameters can be changed interactively via the commands defined in
|
||||
the DetectorMessenger class.
|
||||
|
||||
\section TestEm1_s2 PHYSICS LIST
|
||||
|
||||
Physics lists can be local (eg. in this example) or from G4 kernel
|
||||
physics_lists subdirectory.
|
||||
|
||||
Local physics list:
|
||||
- "local" standard EM physics with current 'best' options setting.
|
||||
these options are explicited in PhysListEmStandard
|
||||
|
||||
From geant4/source/physics_lists/builders:
|
||||
- "emstandard_opt0" recommended standard EM physics for LHC
|
||||
- "emstandard_opt1" best CPU performance standard physics for LHC
|
||||
- "emstandard_opt2"
|
||||
- "emstandard_opt3" best current advanced EM options.
|
||||
analog to "local" above
|
||||
|
||||
Physics lists and options can be (re)set with UI commands
|
||||
|
||||
Please, notice that options set through G4EmProcessOPtions are global, eg
|
||||
for all particle types. In G4 builders (geant4/source/physics_lists/builders)
|
||||
it is shown how to set options per particle type.
|
||||
|
||||
Few commands have been added to PhysicsList, in order to set the production
|
||||
threshold for secondaries for gamma and e-/e+.
|
||||
|
||||
PhysicsList contains also G4Decay and G4RadioactiveDecay processes
|
||||
|
||||
\section TestEm1_s3 AN EVENT : THE PRIMARY GENERATOR
|
||||
|
||||
The primary kinematic consists of a single particle starting at the left face
|
||||
of the box. The type of the particle and its energy are set in the
|
||||
PrimaryGeneratorAction class, and can be changed via the G4 build-in commands
|
||||
of G4ParticleGun class (see the macros provided with this example).
|
||||
|
||||
In addition one can choose randomly the impact point of the incident particle.
|
||||
The corresponding interactive command is built in PrimaryGeneratorMessenger.
|
||||
|
||||
\section TestEm1_s4 VISUALIZATION
|
||||
|
||||
The Visualization Manager is set in the main () (see TestEm1.cc).
|
||||
The initialisation of the drawing is done via the commands /vis/... in the
|
||||
macro vis.mac. To get visualisation:
|
||||
\verbatim
|
||||
> /control/execute vis.mac
|
||||
\endverbatim
|
||||
|
||||
The detector has a default view which is a longitudinal view of the box.
|
||||
|
||||
The tracks are drawn at the end of event, and erased at the end of run.
|
||||
|
||||
\section TestEm1_s5 PHYSICS SURVEY
|
||||
|
||||
The particle's type and the physic processes which will be available in this
|
||||
example are set in PhysicsList class.
|
||||
|
||||
A set of macros defining various run conditions are provided. The processes
|
||||
are actived/inactived together with differents cuts, in order to survey the
|
||||
processes one by one.
|
||||
|
||||
The number of produced secondaries are counted, the number of steps, and the
|
||||
number of process calls responsible of the step.
|
||||
|
||||
\section TestEm1_s6 HOW TO START ?
|
||||
|
||||
- Execute TestEm1 in 'batch' mode from macro files
|
||||
\verbatim
|
||||
% TestEm1 runs.mac
|
||||
\endverbatim
|
||||
|
||||
- Execute TestEm1 in 'interactive mode' with visualization
|
||||
\verbatim
|
||||
% TestEm1
|
||||
....
|
||||
Idle> type your commands
|
||||
....
|
||||
Idle> exit
|
||||
\endverbatim
|
||||
|
||||
\section TestEm1_s7 TRACKING : StepMax
|
||||
|
||||
In order to control the accuracy of the deposition, the user can limit
|
||||
'by hand' the maximum step size of charged particles.
|
||||
As an example, this limitation is implemented as a 'full' process :
|
||||
see StepMax class and its Messenger. The 'StepMax process' is registered
|
||||
in the Physics List.
|
||||
|
||||
\section TestEm1_s8 HISTOGRAMS
|
||||
|
||||
Testem1 produces several histo which are saved as testem1.root by default.
|
||||
Content of these histo:
|
||||
- 1 : track length of primary particle
|
||||
- 2 : number of steps primary particle
|
||||
- 3 : step size of primary particle
|
||||
- 4 : total energy deposit
|
||||
- 5 : energy of charged secondaries at creation
|
||||
- 6 : energy of neutral secondaries at creation
|
||||
|
||||
The histograms are managed by G4AnalysisManager class and its Messenger.
|
||||
The histos can be individually activated with the command :
|
||||
/analysis/h1/set id nbBins valMin valMax unit
|
||||
where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
|
||||
|
||||
One can control the name of the histograms file with the command:
|
||||
\verbatim
|
||||
/analysis/setFileName name (default testem1)
|
||||
\endverbatim
|
||||
|
||||
It is possible to choose the format of the histogram file : root (default),
|
||||
hbook, xml, csv, by using namespace in HistoManager.hh
|
||||
|
||||
It is also possible to print selected histograms on an ascii file:
|
||||
/analysis/h1/setAscii id
|
||||
All selected histos will be written on a file name.ascii (default testem1)
|
||||
|
||||
\subsection TestEm1_subs1 Using hbook format
|
||||
|
||||
Need a special treatement : the Cern Library must be installed and the
|
||||
environment variable CERNLIB correctly set. Then, *before* compiling,
|
||||
activate G4_USE_HBOOK in GNUmakefile and g4hbook.hh in HistoManager.hh
|
||||
|
||||
*/
|
||||
@@ -1,10 +1,58 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# Setup the project
|
||||
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
||||
project(TestEm1)
|
||||
find_package(Geant4 REQUIRED)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Find Geant4 package, activating all available UI and Vis drivers by default
|
||||
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
|
||||
# to build a batch mode only executable
|
||||
#
|
||||
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
|
||||
if(WITH_GEANT4_UIVIS)
|
||||
find_package(Geant4 REQUIRED ui_all vis_all)
|
||||
else()
|
||||
find_package(Geant4 REQUIRED)
|
||||
endif()
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Setup Geant4 include directories and compile definitions
|
||||
#
|
||||
include(${Geant4_USE_FILE})
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${Geant4_INCLUDE_DIR})
|
||||
file(GLOB sources ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc)
|
||||
#----------------------------------------------------------------------------
|
||||
# Locate sources and headers for this project
|
||||
#
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include
|
||||
${Geant4_INCLUDE_DIR})
|
||||
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(TestEm1 TestEm1.cc ${sources} ${headers})
|
||||
target_link_libraries(TestEm1 ${Geant4_LIBRARIES} )
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Copy all scripts to the build directory, i.e. the directory in which we
|
||||
# build TestEm1. This is so that we can run the executable directly because it
|
||||
# relies on these scripts being in the current working directory.
|
||||
#
|
||||
set(TestEm1_SCRIPTS
|
||||
annihil.mac brems.mac erange.mac gammaconversion.mac geantino.mac photoelec.mac photon.mac radioactive.mac range.mac runs.mac TestEm1.in TestEm1.out vis.mac
|
||||
)
|
||||
|
||||
foreach(_script ${TestEm1_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 TestEm1 DESTINATION bin)
|
||||
|
||||
add_executable(TestEm1 EXCLUDE_FROM_ALL TestEm1.cc ${sources})
|
||||
target_link_libraries(TestEm1 ${Geant4_LIBRARIES})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.14 2008-06-11 22:06:28 maire Exp $
|
||||
# $Id: GNUmakefile,v 1.15 2008-06-11 22:15:20 maire Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
|
||||
# --------------------------------------------------------------
|
||||
@@ -12,16 +12,18 @@ ifndef G4INSTALL
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
all: hbook lib bin
|
||||
|
||||
#### G4ANALYSIS_USE := true
|
||||
#### G4_USE_HBOOK := true
|
||||
include GNUmakefile.tools_hbook
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
|
||||
histclean:
|
||||
rm -f $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(G4TARGET)/HistoManager.o
|
||||
|
||||
visclean:
|
||||
rm -f g4*.prim g4*.eps g4*.wrl
|
||||
rm -f .DAWN_*
|
||||
histclean:
|
||||
rm ${G4WORKDIR}/tmp/${G4SYSTEM}/${G4TARGET}/HistoManager.o
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# $Id$
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for ing4 HBOOK support.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
ifdef G4_USE_HBOOK
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -DG4_USE_HBOOK
|
||||
EXTRALIBS += $(G4TMPDIR)/exe/close.o $(G4TMPDIR)/exe/setpawc.o $(G4TMPDIR)/exe/setntuc.o
|
||||
EXTRALIBS += -L${CERNLIB}/lib -lpacklib -lmathlib -lgfortran -lcrypt
|
||||
|
||||
#FC=gfortran
|
||||
|
||||
hbook: close.o setpawc.o setntuc.o
|
||||
(mv *.o $(G4TMPDIR)/exe);
|
||||
|
||||
close.o : $(G4BASE)/analysis/include/tools/hbook/close.f
|
||||
@echo Compiling close.f
|
||||
ifdef CPPVERBOSE
|
||||
$(FC) -c $(G4BASE)/analysis/include/tools/hbook/close.f
|
||||
else
|
||||
@$(FC) -c $(G4BASE)/analysis/include/tools/hbook/close.f
|
||||
endif
|
||||
|
||||
setpawc.o : $(G4BASE)/analysis/include/tools/hbook/setpawc.f
|
||||
@echo Compiling setpawc.f
|
||||
ifdef CPPVERBOSE
|
||||
$(FC) -c $(G4BASE)/analysis/include/tools/hbook/setpawc.f
|
||||
else
|
||||
@$(FC) -c $(G4BASE)/analysis/include/tools/hbook/setpawc.f
|
||||
endif
|
||||
|
||||
setntuc.o : $(G4BASE)/analysis/include/tools/hbook/setntuc.f
|
||||
@echo Compiling setntuc.f
|
||||
ifdef CPPVERBOSE
|
||||
$(FC) -c $(G4BASE)/analysis/include/tools/hbook/setntuc.f
|
||||
else
|
||||
@$(FC) -c $(G4BASE)/analysis/include/tools/hbook/setntuc.f
|
||||
endif
|
||||
|
||||
else
|
||||
hbook:
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@@ -15,6 +15,62 @@ track of all tags.
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
19-10-12 mma (testem1-V09-05-12)
|
||||
- PhysListEmStandard: use G4UrbanMsc96
|
||||
|
||||
12-10-12 V.Ivant (testem1-V09-05-11)
|
||||
- Migration to the updated analysis tool and inplicit units
|
||||
- do not save random number per event
|
||||
|
||||
10-10-12 mma (testem1-V09-05-10)
|
||||
- PhysicsList: add G4EmstandardPhysics_option4
|
||||
- coding conventions: virtual
|
||||
|
||||
06-09-12 V.Ivant (testem1-V09-05-09)
|
||||
- Ivana Hrivnacova updated CMakeLists.txt
|
||||
|
||||
25-08-12 mma (testem1-V09-05-08)
|
||||
- HistoManager functionalities transfered to G4Analysis and its messenger.
|
||||
- Need analysis-V09-05-09
|
||||
- all userAction classes and all macros affected
|
||||
|
||||
10-07-12 mma (testem1-V09-05-07)
|
||||
- PhysicsList : add G4RadioactiveDecay
|
||||
- associated macro radioactive.mac
|
||||
|
||||
05-04-12 mma (testem1-V09-05-06)
|
||||
- simplify macro TestEm1.in
|
||||
|
||||
29-03-12 mma (testem1-V09-05-05)
|
||||
- all classes : apply G4 coding conventions
|
||||
- DetectorConstruction::SetMaterial() : nist materials
|
||||
|
||||
02-03-12 mma (testem1-V09-05-04)
|
||||
- HistoManager.cc : fileName[0] = "testem1"
|
||||
|
||||
22-02-12 mma (testem1-V09-05-03)
|
||||
- file G4HbookAnalysisManager renamed ExG4HbookAnalysisManager
|
||||
|
||||
18-02-12 mma (testem1-V09-05-02)
|
||||
- HistoManager.hh : add hbook option.
|
||||
New files : GNUmakefile.tools_hbook and G4HbookAnalysisManager.hh .cc
|
||||
|
||||
17-02-12 mma (testem1-V09-05-01)
|
||||
- HistoManager.hh and .cc : migrate to new g4tools histogramming system
|
||||
Do not need aida anymore, nor G4ANALYSIS_USE
|
||||
- HistoMessenger.hh and .cc : suppress fileType command
|
||||
- Update Readme and all macros accordingly
|
||||
|
||||
05-02-12 mma (testem1-V09-05-00)
|
||||
- new histograms :
|
||||
4 "total energy deposit"
|
||||
5 "energy of charged secondaries at creation"
|
||||
6 "energy of neutral secondaries at creation"
|
||||
- add class StackingAction
|
||||
|
||||
25-01-12 mma
|
||||
- add PhysListEmStandardSS
|
||||
|
||||
08-11-11 mma (testem1-V09-04-05)
|
||||
- modify SteppingVerbose for OutOfWorld
|
||||
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
$Id: InstallAida.txt,v 1.2 2008-09-12 16:32:25 maire Exp $
|
||||
-----------------------------------------------------------
|
||||
|
||||
--------------
|
||||
Install AIDA
|
||||
--------------
|
||||
|
||||
To use histograms, at least one of the AIDA implementations should be
|
||||
available.
|
||||
|
||||
You can use various file formats to write histograms (hbook, root, AIDA-XML).
|
||||
|
||||
1 - OpenScientist (lal/in2p3)
|
||||
-------------------------
|
||||
|
||||
OpenScientist is available at http://OpenScientist.lal.in2p3.fr.
|
||||
|
||||
OpenScientist_batch is a small package ( ~ 6MB), easy to install.
|
||||
It provides an AIDA interface to write files in ROOT or PAW format.
|
||||
|
||||
Download and gunzip (for Linux system) :
|
||||
http://openscientist.lal.in2p3.fr/download/16.3/osc_batch-v16r3-Linux-i386-gcc_323.zip
|
||||
|
||||
(or more recent version, or Windows or Mac system)
|
||||
|
||||
Installation:
|
||||
prompt%> cd osc_batch/v16r3 (or more recent version)
|
||||
prompt%> ./install
|
||||
prompt%> source aida-setup.csh
|
||||
|
||||
(on Windows : dos%> call <<OpenScientist install path>/aida-setup.bat)
|
||||
|
||||
|
||||
2 - RAIDA (desy)
|
||||
------------
|
||||
It is a ROOT based AIDA interface. It can be downloaded from
|
||||
http://ilcsoft.desy.de/portal/software_packages/raida/index_eng.html
|
||||
|
||||
|
||||
3 - iAIDA
|
||||
-----
|
||||
Another package including AIDA (an evolution of the former cern PI project)
|
||||
is the iAIDA package: http://iaida.dynalias.net
|
||||
|
||||
Once you have installed iAIDA in a specified local area $MYIAIDA, it is
|
||||
required to add the installation path to $PATH, i.e. for example, for
|
||||
release 1.0.11 of iAIDA:
|
||||
setenv PATH ${PATH}:$MYIAIDA/bin
|
||||
|
||||
Before running the example the command should be issued:
|
||||
eval `aida-config --runtime csh`
|
||||
|
||||
|
||||
4 - JAIDA (slac)
|
||||
------------
|
||||
|
||||
JAIDA is an implementation of AIDA in Java. To use it, one needs Java
|
||||
as well as AIDAJNI, a connector between AIDA-C++ and AIDA-Java.
|
||||
|
||||
Available for: Linux-g++2, Linux-g++3, WIN32-VC, SUN-CC,
|
||||
Darwin-g++2, Darwin-g++3
|
||||
To compile and link with JAIDA using AIDAJNI, make sure you have:
|
||||
|
||||
1. JAIDA version 3.2.0, see http://java.freehep.org/jaida
|
||||
2. set enviroment variable JAIDA_HOME to your JAIDA installation
|
||||
3. source the aida-setup script $JAIDA_HOME/bin/aida-setup.[sh|csh|win32]
|
||||
|
||||
4. AIDAJNI version 3.0.4 or 3.2.0, or better: see http://java.freehep.org/aidajni
|
||||
5. set environment variable AIDAJNI_HOME to your AIDAJNI installation
|
||||
6. set environment variable JDK_HOME to your Java Standard Development Kit (1.4.x or up).
|
||||
7. source the aidajni-setup script $AIDAJNI_HOME/bin/$G4SYSTEM/aidajni-setup.[sh|csh|win32]
|
||||
|
||||
now execute:
|
||||
|
||||
source setup-analysis (.csh, .sh, .win32)
|
||||
gmake clean
|
||||
gmake
|
||||
|
||||
@@ -50,6 +50,8 @@ $Id: README,v 1.28 2010-06-06 04:25:24 perl Exp $
|
||||
|
||||
Few commands have been added to PhysicsList, in order to set the production
|
||||
threshold for secondaries for gamma and e-/e+.
|
||||
|
||||
PhysicsList contains also G4Decay and G4RadioactiveDecay processes
|
||||
|
||||
3 - AN EVENT : THE PRIMARY GENERATOR
|
||||
|
||||
@@ -86,12 +88,8 @@ $Id: README,v 1.28 2010-06-06 04:25:24 perl Exp $
|
||||
|
||||
6 - HOW TO START ?
|
||||
|
||||
- compile and link to generate an executable
|
||||
% cd geant4/examples/extended/electromagnetic/TestEm1
|
||||
% gmake
|
||||
|
||||
- execute TestEm1 in 'batch' mode from macro files
|
||||
% TestEm1 run10.mac
|
||||
% TestEm1 runs.mac
|
||||
|
||||
- execute TestEm1 in 'interactive mode' with visualization
|
||||
% TestEm1
|
||||
@@ -115,31 +113,28 @@ $Id: README,v 1.28 2010-06-06 04:25:24 perl Exp $
|
||||
1 : track length of primary particle
|
||||
2 : number of steps primary particle
|
||||
3 : step size of primary particle
|
||||
4 : total energy deposit
|
||||
5 : energy of charged secondaries at creation
|
||||
6 : energy of neutral secondaries at creation
|
||||
|
||||
The histograms are managed by the HistoManager class and its Messenger.
|
||||
The histograms are managed by G4AnalysisManager class and its Messenger.
|
||||
The histos can be individually activated with the command :
|
||||
/testem/histo/setHisto id nbBins valMin valMax unit
|
||||
/analysis/h1/set id nbBins valMin valMax unit
|
||||
where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
|
||||
|
||||
One can control the name of the histograms file with the command:
|
||||
/testem/histo/setFileName name (default testem1)
|
||||
|
||||
It is possible to choose the format of the histogram file (hbook, root, XML)
|
||||
with the command /testem/histo/setFileType (root by default)
|
||||
/analysis/setFileName name (default testem1)
|
||||
|
||||
It is possible to choose the format of the histogram file : root (default),
|
||||
hbook, xml, csv, by using namespace in HistoManager.hh
|
||||
|
||||
It is also possible to print selected histograms on an ascii file:
|
||||
/testem/histo/printHisto id
|
||||
All selected histos will be written on a file name.ascii (default testem1)
|
||||
|
||||
Note that, by default, histograms are disabled. To activate them, uncomment
|
||||
the flag G4ANALYSIS_USE in GNUmakefile.
|
||||
/analysis/h1/setAscii id
|
||||
All selected histos will be written on a file name.ascii (default testem1)
|
||||
|
||||
Using hbook format
|
||||
------------------
|
||||
|
||||
Before compilation of the example it is optimal to clean up old files:
|
||||
gmake histclean
|
||||
gmake
|
||||
|
||||
9 - USING HISTOGRAMS
|
||||
|
||||
To use histograms, at least one of the AIDA implementations should be
|
||||
available. See the file InstallAida.txt
|
||||
|
||||
Need a special treatement : the Cern Library must be installed and the
|
||||
environment variable CERNLIB correctly set. Then, *before* compiling,
|
||||
activate G4_USE_HBOOK in GNUmakefile and g4hbook.hh in HistoManager.hh
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/TestEm1.cc
|
||||
/// \brief Main program of the electromagnetic/TestEm1 example
|
||||
//
|
||||
// $Id: TestEm1.cc,v 1.16 2010-04-06 11:11:24 maire Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -43,7 +45,7 @@
|
||||
#include "EventAction.hh"
|
||||
#include "TrackingAction.hh"
|
||||
#include "SteppingAction.hh"
|
||||
#include "HistoManager.hh"
|
||||
#include "StackingAction.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "G4VisExecutive.hh"
|
||||
@@ -72,18 +74,17 @@ int main(int argc,char** argv) {
|
||||
runManager->SetUserInitialization(det = new DetectorConstruction);
|
||||
runManager->SetUserInitialization(new PhysicsList(det));
|
||||
runManager->SetUserAction(prim = new PrimaryGeneratorAction(det));
|
||||
|
||||
HistoManager* histo = new HistoManager();
|
||||
|
||||
// set user action classes
|
||||
RunAction* run;
|
||||
EventAction* event;
|
||||
|
||||
runManager->SetUserAction(run = new RunAction(det,prim,histo));
|
||||
runManager->SetUserAction(event = new EventAction);
|
||||
runManager->SetUserAction(new TrackingAction(prim,run,histo));
|
||||
runManager->SetUserAction(new SteppingAction(run,event,histo));
|
||||
|
||||
runManager->SetUserAction(run = new RunAction(det,prim));
|
||||
runManager->SetUserAction(event = new EventAction());
|
||||
runManager->SetUserAction(new TrackingAction(prim,run));
|
||||
runManager->SetUserAction(new SteppingAction(run,event));
|
||||
runManager->SetUserAction(new StackingAction());
|
||||
|
||||
// get the pointer to the User Interface manager
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
@@ -114,7 +115,6 @@ int main(int argc,char** argv) {
|
||||
|
||||
// job termination
|
||||
//
|
||||
delete histo;
|
||||
delete runManager;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -11,24 +11,14 @@
|
||||
/testem/det/setMat Aluminium
|
||||
/testem/det/setSize 10 m
|
||||
#
|
||||
/testem/phys/addPhysics emstandard_opt0
|
||||
###/testem/phys/addPhysics local
|
||||
#
|
||||
/run/initialize
|
||||
#
|
||||
/testem/gun/setDefault
|
||||
/gun/particle e-
|
||||
/gun/energy 100 MeV
|
||||
#
|
||||
/testem/histo/setHisto 1 100 0 50 cm #track length of primary
|
||||
/testem/histo/setHisto 2 100 0 300 none #nb steps of primary
|
||||
/testem/histo/setHisto 3 200 0 20 mm #step size of primary
|
||||
#
|
||||
/testem/histo/setFileType hbook
|
||||
#
|
||||
/testem/phys/setCuts 1 mm
|
||||
/testem/histo/setFileName run0
|
||||
/run/beamOn 2000
|
||||
#
|
||||
/process/eLoss/verbose 0
|
||||
#
|
||||
/testem/phys/setCuts 10 um
|
||||
/testem/histo/setFileName run1
|
||||
/run/beamOn 2000
|
||||
|
||||
@@ -4,61 +4,170 @@
|
||||
############################################
|
||||
|
||||
*************************************************************
|
||||
Geant4 version Name: geant4-09-05-ref-00 (2-December-2011)
|
||||
Geant4 version Name: geant4-09-06-ref-00 (30-November-2012)
|
||||
Copyright : Geant4 Collaboration
|
||||
Reference : NIM A 506 (2003), 250-303
|
||||
WWW : http://cern.ch/geant4
|
||||
*************************************************************
|
||||
|
||||
|
||||
***** Table : Nb of materials = 14 *****
|
||||
***** Table : Nb of materials = 16 *****
|
||||
|
||||
Material: Air density: 1.290 mg/cm3 RadL: 285.161 m Nucl.Int.Length: 662.904 m Imean: 85.703 eV temperature: 273.15 K pressure: 1.00 atm
|
||||
---> Element: Nitrogen (N) Z = 7.0 N = 14.0 A = 14.01 g/mole ElmMassFraction: 70.00 % ElmAbundance 72.71 %
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 30.00 % ElmAbundance 27.29 %
|
||||
---> Element: Nitrogen (N) Z = 7.0 N = 14.0 A = 14.01 g/mole
|
||||
---> Isotope: N14 Z = 7 N = 14 A = 14.00 g/mole abundance: 99.63 %
|
||||
---> Isotope: N15 Z = 7 N = 15 A = 15.00 g/mole abundance: 0.37 %
|
||||
ElmMassFraction: 70.00 % ElmAbundance 72.71 %
|
||||
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole
|
||||
---> Isotope: O16 Z = 8 N = 16 A = 15.99 g/mole abundance: 99.76 %
|
||||
---> Isotope: O17 Z = 8 N = 17 A = 17.00 g/mole abundance: 0.04 %
|
||||
---> Isotope: O18 Z = 8 N = 18 A = 18.00 g/mole abundance: 0.20 %
|
||||
ElmMassFraction: 30.00 % ElmAbundance 27.29 %
|
||||
|
||||
|
||||
Material: H2liquid density: 70.800 mg/cm3 RadL: 8.923 m Nucl.Int.Length: 4.993 m Imean: 19.200 eV
|
||||
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole
|
||||
---> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.99 %
|
||||
---> Isotope: H2 Z = 1 N = 2 A = 2.01 g/mole abundance: 0.01 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
Material: Water density: 1.000 g/cm3 RadL: 36.092 cm Nucl.Int.Length: 75.537 cm Imean: 78.000 eV
|
||||
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 11.21 % ElmAbundance 66.67 %
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 88.79 % ElmAbundance 33.33 %
|
||||
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole
|
||||
---> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.99 %
|
||||
---> Isotope: H2 Z = 1 N = 2 A = 2.01 g/mole abundance: 0.01 %
|
||||
ElmMassFraction: 11.21 % ElmAbundance 66.67 %
|
||||
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole
|
||||
---> Isotope: O16 Z = 8 N = 16 A = 15.99 g/mole abundance: 99.76 %
|
||||
---> Isotope: O17 Z = 8 N = 17 A = 17.00 g/mole abundance: 0.04 %
|
||||
---> Isotope: O18 Z = 8 N = 18 A = 18.00 g/mole abundance: 0.20 %
|
||||
ElmMassFraction: 88.79 % ElmAbundance 33.33 %
|
||||
|
||||
|
||||
Material: CO2 density: 0.001 kg/m3 RadL: 361.873 km Nucl.Int.Length: 858.384 km Imean: 90.958 eV temperature: 273.15 K pressure: 1.00 atm
|
||||
---> Element: Hydrogen (C) Z = 6.0 N = 12.0 A = 12.00 g/mole ElmMassFraction: 27.27 % ElmAbundance 33.33 %
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 72.73 % ElmAbundance 66.67 %
|
||||
---> Element: Hydrogen (C) Z = 6.0 N = 12.0 A = 12.00 g/mole
|
||||
---> Isotope: C12 Z = 6 N = 12 A = 12.00 g/mole abundance: 98.93 %
|
||||
---> Isotope: C13 Z = 6 N = 13 A = 13.00 g/mole abundance: 1.07 %
|
||||
ElmMassFraction: 27.27 % ElmAbundance 33.33 %
|
||||
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole
|
||||
---> Isotope: O16 Z = 8 N = 16 A = 15.99 g/mole abundance: 99.76 %
|
||||
---> Isotope: O17 Z = 8 N = 17 A = 17.00 g/mole abundance: 0.04 %
|
||||
---> Isotope: O18 Z = 8 N = 18 A = 18.00 g/mole abundance: 0.20 %
|
||||
ElmMassFraction: 72.73 % ElmAbundance 66.67 %
|
||||
|
||||
|
||||
Material: D2_gas density: 0.036 kg/m3 RadL: 13.184 km Nucl.Int.Length: 12.336 km Imean: 41.800 eV temperature: 273.15 K pressure: 1.00 atm
|
||||
---> Element: D2_gas ( ) Z = 2.0 N = 2.0 A = 2.01 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
---> Element: D2_gas ( ) Z = 2.0 N = 2.0 A = 2.01 g/mole
|
||||
---> Isotope: 3 Z = 2 N = 3 A = 3.02 g/mole abundance: 0.00 %
|
||||
---> Isotope: 4 Z = 2 N = 4 A = 4.00 g/mole abundance: 100.00 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
Material: liquidArgon density: 1.390 g/cm3 RadL: 14.065 cm Nucl.Int.Length: 86.006 cm Imean: 188.000 eV
|
||||
---> Element: liquidArgon ( ) Z = 18.0 N = 40.0 A = 39.95 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
---> Element: liquidArgon ( ) Z = 18.0 N = 40.0 A = 39.95 g/mole
|
||||
---> Isotope: 36 Z = 18 N = 36 A = 35.97 g/mole abundance: 0.34 %
|
||||
---> Isotope: 38 Z = 18 N = 38 A = 37.96 g/mole abundance: 0.06 %
|
||||
---> Isotope: 40 Z = 18 N = 40 A = 39.96 g/mole abundance: 99.60 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
Material: Aluminium density: 2.700 g/cm3 RadL: 8.893 cm Nucl.Int.Length: 38.860 cm Imean: 166.000 eV
|
||||
---> Element: Aluminium ( ) Z = 13.0 N = 27.0 A = 26.98 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
---> Element: Aluminium ( ) Z = 13.0 N = 27.0 A = 26.98 g/mole
|
||||
---> Isotope: 27 Z = 13 N = 27 A = 26.98 g/mole abundance: 100.00 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
Material: Silicon density: 2.330 g/cm3 RadL: 9.368 cm Nucl.Int.Length: 45.761 cm Imean: 173.000 eV
|
||||
---> Element: Silicon ( ) Z = 14.0 N = 28.1 A = 28.09 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
---> Element: Silicon ( ) Z = 14.0 N = 28.1 A = 28.09 g/mole
|
||||
---> Isotope: 28 Z = 14 N = 28 A = 27.98 g/mole abundance: 92.23 %
|
||||
---> Isotope: 29 Z = 14 N = 29 A = 28.98 g/mole abundance: 4.68 %
|
||||
---> Isotope: 30 Z = 14 N = 30 A = 29.97 g/mole abundance: 3.09 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
Material: Chromium density: 7.140 g/cm3 RadL: 2.093 cm Nucl.Int.Length: 18.293 cm Imean: 257.000 eV
|
||||
---> Element: Chromium ( ) Z = 24.0 N = 52.0 A = 51.99 g/mole
|
||||
---> Isotope: 50 Z = 24 N = 50 A = 49.95 g/mole abundance: 4.34 %
|
||||
---> Isotope: 52 Z = 24 N = 52 A = 51.94 g/mole abundance: 83.79 %
|
||||
---> Isotope: 53 Z = 24 N = 53 A = 52.94 g/mole abundance: 9.50 %
|
||||
---> Isotope: 54 Z = 24 N = 54 A = 53.94 g/mole abundance: 2.37 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
Material: Germanium density: 5.323 g/cm3 RadL: 2.301 cm Nucl.Int.Length: 27.333 cm Imean: 350.000 eV
|
||||
---> Element: Germanium ( ) Z = 32.0 N = 72.6 A = 72.61 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
---> Element: Germanium ( ) Z = 32.0 N = 72.6 A = 72.61 g/mole
|
||||
---> Isotope: 70 Z = 32 N = 70 A = 69.92 g/mole abundance: 20.84 %
|
||||
---> Isotope: 72 Z = 32 N = 72 A = 71.92 g/mole abundance: 27.54 %
|
||||
---> Isotope: 73 Z = 32 N = 73 A = 72.92 g/mole abundance: 7.73 %
|
||||
---> Isotope: 74 Z = 32 N = 74 A = 73.92 g/mole abundance: 36.28 %
|
||||
---> Isotope: 76 Z = 32 N = 76 A = 75.92 g/mole abundance: 7.61 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
Material: BGO density: 7.100 g/cm3 RadL: 1.123 cm Nucl.Int.Length: 22.788 cm Imean: 473.785 eV
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 15.41 % ElmAbundance 63.16 %
|
||||
---> Element: Germanium (Ge) Z = 32.0 N = 72.6 A = 72.59 g/mole ElmMassFraction: 17.48 % ElmAbundance 15.79 %
|
||||
---> Element: Bismuth (Bi) Z = 83.0 N = 209.0 A = 208.98 g/mole ElmMassFraction: 67.10 % ElmAbundance 21.05 %
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole
|
||||
---> Isotope: O16 Z = 8 N = 16 A = 15.99 g/mole abundance: 99.76 %
|
||||
---> Isotope: O17 Z = 8 N = 17 A = 17.00 g/mole abundance: 0.04 %
|
||||
---> Isotope: O18 Z = 8 N = 18 A = 18.00 g/mole abundance: 0.20 %
|
||||
ElmMassFraction: 15.41 % ElmAbundance 63.16 %
|
||||
|
||||
---> Element: Germanium (Ge) Z = 32.0 N = 72.6 A = 72.59 g/mole
|
||||
---> Isotope: Ge70 Z = 32 N = 70 A = 69.92 g/mole abundance: 20.84 %
|
||||
---> Isotope: Ge72 Z = 32 N = 72 A = 71.92 g/mole abundance: 27.54 %
|
||||
---> Isotope: Ge73 Z = 32 N = 73 A = 72.92 g/mole abundance: 7.73 %
|
||||
---> Isotope: Ge74 Z = 32 N = 74 A = 73.92 g/mole abundance: 36.28 %
|
||||
---> Isotope: Ge76 Z = 32 N = 76 A = 75.92 g/mole abundance: 7.61 %
|
||||
ElmMassFraction: 17.48 % ElmAbundance 15.79 %
|
||||
|
||||
---> Element: Bismuth (Bi) Z = 83.0 N = 209.0 A = 208.98 g/mole
|
||||
---> Isotope: Bi209 Z = 83 N = 209 A = 208.98 g/mole abundance: 100.00 %
|
||||
ElmMassFraction: 67.10 % ElmAbundance 21.05 %
|
||||
|
||||
|
||||
Material: Iron density: 7.870 g/cm3 RadL: 1.759 cm Nucl.Int.Length: 16.969 cm Imean: 286.000 eV
|
||||
---> Element: Iron ( ) Z = 26.0 N = 55.8 A = 55.85 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
---> Element: Iron ( ) Z = 26.0 N = 55.8 A = 55.85 g/mole
|
||||
---> Isotope: 54 Z = 26 N = 54 A = 53.94 g/mole abundance: 5.84 %
|
||||
---> Isotope: 56 Z = 26 N = 56 A = 55.93 g/mole abundance: 91.75 %
|
||||
---> Isotope: 57 Z = 26 N = 57 A = 56.94 g/mole abundance: 2.12 %
|
||||
---> Isotope: 58 Z = 26 N = 58 A = 57.93 g/mole abundance: 0.28 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
Material: Tungsten density: 19.300 g/cm3 RadL: 3.504 mm Nucl.Int.Length: 10.306 cm Imean: 727.000 eV
|
||||
---> Element: Tungsten ( ) Z = 74.0 N = 183.8 A = 183.85 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
---> Element: Tungsten ( ) Z = 74.0 N = 183.8 A = 183.85 g/mole
|
||||
---> Isotope: 180 Z = 74 N = 180 A = 179.95 g/mole abundance: 0.12 %
|
||||
---> Isotope: 182 Z = 74 N = 182 A = 181.95 g/mole abundance: 26.50 %
|
||||
---> Isotope: 183 Z = 74 N = 183 A = 182.95 g/mole abundance: 14.31 %
|
||||
---> Isotope: 184 Z = 74 N = 184 A = 183.95 g/mole abundance: 30.64 %
|
||||
---> Isotope: 186 Z = 74 N = 186 A = 185.95 g/mole abundance: 28.43 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
Material: Gold density: 19.320 g/cm3 RadL: 3.344 mm Nucl.Int.Length: 10.539 cm Imean: 790.000 eV
|
||||
---> Element: Gold ( ) Z = 79.0 N = 197.0 A = 196.97 g/mole
|
||||
---> Isotope: 197 Z = 79 N = 197 A = 196.97 g/mole abundance: 100.00 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
Material: Lead density: 11.350 g/cm3 RadL: 5.612 mm Nucl.Int.Length: 18.258 cm Imean: 823.000 eV
|
||||
---> Element: Lead ( ) Z = 82.0 N = 207.2 A = 207.19 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
---> Element: Lead ( ) Z = 82.0 N = 207.2 A = 207.19 g/mole
|
||||
---> Isotope: 204 Z = 82 N = 204 A = 203.97 g/mole abundance: 1.40 %
|
||||
---> Isotope: 206 Z = 82 N = 206 A = 205.97 g/mole abundance: 24.10 %
|
||||
---> Isotope: 207 Z = 82 N = 207 A = 206.98 g/mole abundance: 22.10 %
|
||||
---> Isotope: 208 Z = 82 N = 208 A = 207.98 g/mole abundance: 52.40 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
Material: Uranium density: 18.950 g/cm3 RadL: 3.166 mm Nucl.Int.Length: 11.447 cm Imean: 890.000 eV
|
||||
---> Element: Uranium ( ) Z = 92.0 N = 238.0 A = 238.03 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
---> Element: Uranium ( ) Z = 92.0 N = 238.0 A = 238.03 g/mole
|
||||
---> Isotope: 234 Z = 92 N = 234 A = 234.04 g/mole abundance: 0.01 %
|
||||
---> Isotope: 235 Z = 92 N = 235 A = 235.04 g/mole abundance: 0.72 %
|
||||
---> Isotope: 238 Z = 92 N = 238 A = 238.05 g/mole abundance: 99.27 %
|
||||
ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
|
||||
|
||||
/run/verbose 2
|
||||
@@ -66,6 +175,9 @@
|
||||
/testem/det/setMat Aluminium
|
||||
/testem/det/setSize 10 m
|
||||
#
|
||||
/testem/phys/addPhysics emstandard_opt0
|
||||
###/testem/phys/addPhysics local
|
||||
#
|
||||
/run/initialize
|
||||
userDetector->Construct() start.
|
||||
|
||||
@@ -81,258 +193,9 @@ PhysicsList::SetCuts:CutLength : 1 mm
|
||||
/gun/particle e-
|
||||
/gun/energy 100 MeV
|
||||
#
|
||||
/testem/histo/setHisto 1 100 0 50 cm
|
||||
----> SetHisto 1: total track length of primary particle (cm); 100 bins from 0 cm to 50 cm
|
||||
/testem/histo/setHisto 2 100 0 300 none
|
||||
----> SetHisto 2: nb steps of primary particle; 100 bins from 0 none to 300 none
|
||||
/testem/histo/setHisto 3 200 0 20 mm
|
||||
----> SetHisto 3: step size of primary particle (mm); 200 bins from 0 mm to 20 mm
|
||||
#
|
||||
/testem/histo/setFileType hbook
|
||||
#
|
||||
/testem/phys/setCuts 1 mm
|
||||
/testem/histo/setFileName run0
|
||||
/run/beamOn 2000
|
||||
|
||||
phot: for gamma SubType= 12
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
PhotoElectric : Emin= 0 eV Emax= 10 TeV FluoActive
|
||||
|
||||
compt: for gamma SubType= 13
|
||||
Lambda tables from 10 eV to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
KleinNishina : Emin= 0 eV Emax= 10 TeV FluoActive
|
||||
|
||||
conv: for gamma SubType= 14
|
||||
Lambda tables from 1.022 MeV to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
BetheHeitler : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
msc: for e- SubType= 10
|
||||
Lambda tables from 10 eV to 10 TeV in 120 bins, spline: 1
|
||||
RangeFactor= 0.04, stepLimitType: 1, latDisplacement: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
UrbanMsc95 : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
### === Deexcitation model UAtomDeexcitation is activated for regions:
|
||||
DefaultRegionForTheWorld
|
||||
|
||||
eIoni: for e- SubType= 2
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
finalRange(mm)= 0.1, dRoverRange= 0.1, integral: 1, fluct: 1, linLossLimit= 0.01
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
MollerBhabha : Emin= 0 eV Emax= 10 TeV
|
||||
CSDA range table up to 1 GeV in 100 bins
|
||||
|
||||
eBrem: for e- SubType= 3
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
LPM flag: 1 for E > 1 GeV
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
eBremSB : Emin= 0 eV Emax= 1 GeV AngularGenUrban
|
||||
eBremLPM : Emin= 1 GeV Emax= 10 TeV AngularGenUrban
|
||||
|
||||
eIoni: for e+ SubType= 2
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
finalRange(mm)= 0.1, dRoverRange= 0.1, integral: 1, fluct: 1, linLossLimit= 0.01
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
MollerBhabha : Emin= 0 eV Emax= 10 TeV
|
||||
CSDA range table up to 1 GeV in 100 bins
|
||||
|
||||
eBrem: for e+ SubType= 3
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
LPM flag: 1 for E > 1 GeV
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
eBremSB : Emin= 0 eV Emax= 1 GeV AngularGenUrban
|
||||
eBremLPM : Emin= 1 GeV Emax= 10 TeV AngularGenUrban
|
||||
|
||||
annihil: for e+ SubType= 5
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
eplus2gg : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
msc: for proton SubType= 10
|
||||
Lambda tables from 10 eV to 10 TeV in 120 bins, spline: 1
|
||||
RangeFactor= 0.2, stepLimitType: 1, latDisplacement: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
UrbanMsc90 : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
hIoni: for proton SubType= 2
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
finalRange(mm)= 0.02, dRoverRange= 0.1, integral: 1, fluct: 1, linLossLimit= 0.01
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
Bragg : Emin= 0 eV Emax= 2 MeV
|
||||
BetheBloch : Emin= 2 MeV Emax= 10 TeV
|
||||
CSDA range table up to 1 GeV in 100 bins
|
||||
|
||||
hBrems: for proton SubType= 3
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
hBrem : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
hPairProd: for proton SubType= 4
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
hPairProd : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
msc: for GenericIon SubType= 10
|
||||
RangeFactor= 0.2, stepLimitType: 0, latDisplacement: 0
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
UrbanMsc90 : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
ionIoni: for GenericIon SubType= 2
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
finalRange(mm)= 0.001, dRoverRange= 0.1, integral: 1, fluct: 1, linLossLimit= 0.02
|
||||
Stopping Power data for 17 ion/material pairs
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
ParamICRU73 : Emin= 0 eV Emax= 10 TeV
|
||||
CSDA range table up to 1 GeV in 100 bins
|
||||
|
||||
nuclearStopping: for GenericIon SubType= 8
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
ICRU49NucStopping : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
nuclearStopping: for alpha SubType= 8
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
ICRU49NucStopping : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
hIoni: for anti_proton SubType= 2
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
ICRU73QO : Emin= 0 eV Emax= 2 MeV
|
||||
BetheBloch : Emin= 2 MeV Emax= 10 TeV
|
||||
CSDA range table up to 1 GeV in 100 bins
|
||||
|
||||
msc: for kaon+ SubType= 10
|
||||
Lambda tables from 10 eV to 10 TeV in 120 bins, spline: 1
|
||||
RangeFactor= 0.2, stepLimitType: 1, latDisplacement: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
UrbanMsc90 : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
hIoni: for kaon+ SubType= 2
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
Bragg : Emin= 0 eV Emax= 1.05231 MeV
|
||||
BetheBloch : Emin= 1.05231 MeV Emax= 10 TeV
|
||||
CSDA range table up to 1 GeV in 100 bins
|
||||
|
||||
hIoni: for kaon- SubType= 2
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
ICRU73QO : Emin= 0 eV Emax= 1.05231 MeV
|
||||
BetheBloch : Emin= 1.05231 MeV Emax= 10 TeV
|
||||
CSDA range table up to 1 GeV in 100 bins
|
||||
|
||||
muMsc: for mu+ SubType= 10
|
||||
Lambda tables from 10 eV to 10 TeV in 120 bins, spline: 1
|
||||
RangeFactor= 0.2, step limit type: 1, lateralDisplacement: 1, polarAngleLimit(deg)= 0
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
UrbanMsc90 : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
muIoni: for mu+ SubType= 2
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
finalRange(mm)= 0.05, dRoverRange= 0.1, integral: 1, fluct: 1, linLossLimit= 0.01
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
Bragg : Emin= 0 eV Emax= 200 keV
|
||||
BetheBloch : Emin= 200 keV Emax= 1 GeV
|
||||
MuBetheBloch : Emin= 1 GeV Emax= 10 TeV
|
||||
CSDA range table up to 1 GeV in 100 bins
|
||||
|
||||
muBrems: for mu+ SubType= 3
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
MuBrem : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
muPairProd: for mu+ SubType= 4
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
muPairProd : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
muIoni: for mu- SubType= 2
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
finalRange(mm)= 0.05, dRoverRange= 0.1, integral: 1, fluct: 1, linLossLimit= 0.01
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
ICRU73QO : Emin= 0 eV Emax= 200 keV
|
||||
BetheBloch : Emin= 200 keV Emax= 1 GeV
|
||||
MuBetheBloch : Emin= 1 GeV Emax= 10 TeV
|
||||
CSDA range table up to 1 GeV in 100 bins
|
||||
|
||||
muBrems: for mu- SubType= 3
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
MuBrem : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
muPairProd: for mu- SubType= 4
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
muPairProd : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
hIoni: for pi+ SubType= 2
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
finalRange(mm)= 0.02, dRoverRange= 0.1, integral: 1, fluct: 1, linLossLimit= 0.01
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
Bragg : Emin= 0 eV Emax= 297.505 keV
|
||||
BetheBloch : Emin= 297.505 keV Emax= 10 TeV
|
||||
CSDA range table up to 1 GeV in 100 bins
|
||||
|
||||
hBrems: for pi+ SubType= 3
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
hBrem : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
hPairProd: for pi+ SubType= 4
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
hPairProd : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
msc: for pi- SubType= 10
|
||||
Lambda tables from 10 eV to 10 TeV in 120 bins, spline: 1
|
||||
RangeFactor= 0.2, stepLimitType: 1, latDisplacement: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
UrbanMsc90 : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
hIoni: for pi- SubType= 2
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
finalRange(mm)= 0.02, dRoverRange= 0.1, integral: 1, fluct: 1, linLossLimit= 0.01
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
ICRU73QO : Emin= 0 eV Emax= 297.505 keV
|
||||
BetheBloch : Emin= 297.505 keV Emax= 10 TeV
|
||||
CSDA range table up to 1 GeV in 100 bins
|
||||
|
||||
hBrems: for pi- SubType= 3
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
hBrem : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
hPairProd: for pi- SubType= 4
|
||||
dE/dx and range tables from 10 eV to 10 TeV in 120 bins
|
||||
Lambda tables from threshold to 10 TeV in 120 bins, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
hPairProd : Emin= 0 eV Emax= 10 TeV
|
||||
|
||||
Region <DefaultRegionForTheWorld> -- -- appears in <Aluminium> world volume
|
||||
This region is in the mass world.
|
||||
Root logical volume(s) : Aluminium
|
||||
@@ -374,7 +237,7 @@ Start Run processing.
|
||||
Run terminated.
|
||||
Run Summary
|
||||
Number of events processed : 2000
|
||||
User=4.58s Real=4.64s Sys=0.04s
|
||||
User=2.73s Real=2.74s Sys=0s
|
||||
|
||||
======================== run summary ======================
|
||||
|
||||
@@ -382,114 +245,38 @@ Run Summary
|
||||
|
||||
============================================================
|
||||
|
||||
total energy deposit: 99.802 MeV
|
||||
total energy deposit: 99.807 MeV
|
||||
|
||||
nb tracks/event neutral: 25.517 charged: 138.38
|
||||
nb steps/event neutral: 131.28 charged: 386.21
|
||||
nb tracks/event neutral: 25.379 charged: 137.96
|
||||
nb steps/event neutral: 130.83 charged: 204.45
|
||||
|
||||
nb of process calls per event:
|
||||
Transportation annihil compt conv eBrem eIoni msc phot
|
||||
0.9215 1.425 105.76 1.4245 22.884 361.62 0.2785 23.174
|
||||
CoulombScatTransportation annihil compt conv eBrem eIoni msc phot
|
||||
0.0005 0.9335 1.4215 105.45 1.4205 23.047 179.61 0.375 23.029
|
||||
|
||||
---------------------------------------------------------
|
||||
Primary particle :
|
||||
true Range = 11.019 cm rms = 3.7953 cm
|
||||
proj Range = 9.5813 cm rms = 3.5174 cm
|
||||
proj/true = 0.8695
|
||||
transverse dispersion at end = 1.6105 cm
|
||||
mass true Range from simulation = 29.752 g/cm2
|
||||
from PhysicsTable (csda range) = 32.042 g/cm2
|
||||
true Range = 10.861 cm rms = 3.8239 cm
|
||||
proj Range = 9.4297 cm rms = 3.5568 cm
|
||||
proj/true = 0.86824
|
||||
transverse dispersion at end = 1.623 cm
|
||||
mass true Range from simulation = 29.324 g/cm2
|
||||
from PhysicsTable (csda range) = 32.099 g/cm2
|
||||
---------------------------------------------------------
|
||||
|
||||
|
||||
--------- Ranecu engine status ---------
|
||||
Initial seed (index) = 0
|
||||
Current couple of seeds = 138827511, 607935753
|
||||
----------------------------------------
|
||||
#
|
||||
/process/eLoss/verbose 0
|
||||
#
|
||||
/testem/phys/setCuts 10 um
|
||||
/testem/histo/setFileName run1
|
||||
/run/beamOn 2000
|
||||
|
||||
Region <DefaultRegionForTheWorld> -- -- appears in <Aluminium> world volume
|
||||
This region is in the mass world.
|
||||
Root logical volume(s) : Aluminium
|
||||
Pointers : G4VUserRegionInformation[0], G4UserLimits[0], G4FastSimulationManager[0], G4UserSteppingAction[0]
|
||||
Materials : Aluminium
|
||||
Production cuts : gamma 10 um e- 10 um e+ 10 um proton 1 mm
|
||||
|
||||
Region <DefaultRegionForParallelWorld> -- -- is not associated to any world.
|
||||
Root logical volume(s) :
|
||||
Pointers : G4VUserRegionInformation[0], G4UserLimits[0], G4FastSimulationManager[0], G4UserSteppingAction[0]
|
||||
Materials :
|
||||
Production cuts : gamma 10 um e- 10 um e+ 10 um proton 1 mm
|
||||
|
||||
========= Table of registered couples ==============================
|
||||
|
||||
Index : 0 used in the geometry : Yes recalculation needed : No
|
||||
Material : Aluminium
|
||||
Range cuts : gamma 10 um e- 10 um e+ 10 um proton 1 mm
|
||||
Energy thresholds : gamma 990 eV e- 34.1725 keV e+ 33.9436 keV proton 100 keV
|
||||
Region(s) which use this couple :
|
||||
DefaultRegionForTheWorld
|
||||
|
||||
====================================================================
|
||||
|
||||
### Run 1 start.
|
||||
|
||||
--------- Ranecu engine status ---------
|
||||
Initial seed (index) = 0
|
||||
Current couple of seeds = 138827511, 607935753
|
||||
----------------------------------------
|
||||
Start Run processing.
|
||||
|
||||
---> Begin of Event: 0
|
||||
Run terminated.
|
||||
Run Summary
|
||||
Number of events processed : 2000
|
||||
User=7.64s Real=7.69s Sys=0.05s
|
||||
|
||||
======================== run summary ======================
|
||||
|
||||
The run was: 2000 e- of 100 MeV through 10 m of Aluminium (density: 2.7 g/cm3 )
|
||||
|
||||
============================================================
|
||||
|
||||
total energy deposit: 99.767 MeV
|
||||
|
||||
nb tracks/event neutral: 34.879 charged: 284.48
|
||||
nb steps/event neutral: 142 charged: 673.22
|
||||
|
||||
nb of process calls per event:
|
||||
Transportation annihil compt conv eBrem eIoni msc phot
|
||||
0.925 1.431 107.12 1.431 31.526 639.63 0.625 32.529
|
||||
|
||||
---------------------------------------------------------
|
||||
Primary particle :
|
||||
true Range = 10.849 cm rms = 3.7641 cm
|
||||
proj Range = 9.3887 cm rms = 3.4892 cm
|
||||
proj/true = 0.86538
|
||||
transverse dispersion at end = 1.6661 cm
|
||||
mass true Range from simulation = 29.293 g/cm2
|
||||
from PhysicsTable (csda range) = 32.042 g/cm2
|
||||
---------------------------------------------------------
|
||||
|
||||
|
||||
--------- Ranecu engine status ---------
|
||||
Initial seed (index) = 0
|
||||
Current couple of seeds = 482850438, 1136330073
|
||||
Current couple of seeds = 916914018, 1242014837
|
||||
----------------------------------------
|
||||
G4 kernel has come to Quit state.
|
||||
UserDetectorConstruction deleted.
|
||||
UserPhysicsList deleted.
|
||||
UserRunAction deleted.
|
||||
UserPrimaryGenerator deleted.
|
||||
G4 kernel has come to Quit state.
|
||||
EventManager deleted.
|
||||
UImanager deleted.
|
||||
Units table cleared.
|
||||
StateManager deleted.
|
||||
RunManagerKernel is deleted.
|
||||
RunManager is deleting.
|
||||
|
||||
RunManager is deleted.
|
||||
|
||||
@@ -33,11 +33,10 @@
|
||||
/gun/particle e-
|
||||
/gun/energy 200 MeV
|
||||
#
|
||||
/testem/histo/setFileName brems
|
||||
/testem/histo/setFileType hbook
|
||||
/testem/histo/setHisto 1 100 0 50 cm #track length of primary
|
||||
/testem/histo/setHisto 2 100 0 100 none #nb steps of primary
|
||||
/testem/histo/setHisto 3 200 0 50 mm #step size of primary
|
||||
/analysis/setFileName brems
|
||||
/analysis/h1/set 1 100 0 50 cm #track length of primary
|
||||
/analysis/h1/set 2 100 0 100 none #nb steps of primary
|
||||
/analysis/h1/set 3 200 0 50 mm #step size of primary
|
||||
#
|
||||
/testem/event/printModulo 2000
|
||||
#
|
||||
|
||||
@@ -32,9 +32,8 @@
|
||||
/tracking/verbose 1
|
||||
/run/beamOn 5
|
||||
#
|
||||
###/testem/histo/setFileName std.1km
|
||||
###/testem/histo/setFileType hbook
|
||||
###/testem/histo/setHisto 1 200 0 2000 um # csda range
|
||||
###/testem/histo/setHisto 1 250 0 5000 um
|
||||
###/analysis/setFileName std.1km
|
||||
###/analysis/h1/set 1 200 0 2000 um # csda range
|
||||
###/analysis/h1/set 1 250 0 5000 um
|
||||
#
|
||||
###/run/beamOn 20000
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/include/DetectorConstruction.hh
|
||||
/// \brief Definition of the DetectorConstruction class
|
||||
//
|
||||
// $Id: DetectorConstruction.hh,v 1.2 2006-06-29 16:36:04 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
|
||||
@@ -54,7 +56,7 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
|
||||
public:
|
||||
|
||||
G4VPhysicalVolume* Construct();
|
||||
virtual G4VPhysicalVolume* Construct();
|
||||
|
||||
void SetSize (G4double);
|
||||
void SetMaterial (G4String);
|
||||
@@ -65,23 +67,23 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
public:
|
||||
|
||||
const
|
||||
G4VPhysicalVolume* GetWorld() {return pBox;};
|
||||
G4VPhysicalVolume* GetWorld() {return fPBox;};
|
||||
|
||||
G4double GetSize() {return BoxSize;};
|
||||
G4Material* GetMaterial() {return aMaterial;};
|
||||
G4double GetSize() {return fBoxSize;};
|
||||
G4Material* GetMaterial() {return fMaterial;};
|
||||
|
||||
void PrintParameters();
|
||||
|
||||
private:
|
||||
|
||||
G4VPhysicalVolume* pBox;
|
||||
G4LogicalVolume* lBox;
|
||||
G4VPhysicalVolume* fPBox;
|
||||
G4LogicalVolume* fLBox;
|
||||
|
||||
G4double BoxSize;
|
||||
G4Material* aMaterial;
|
||||
G4UniformMagField* magField;
|
||||
G4double fBoxSize;
|
||||
G4Material* fMaterial;
|
||||
G4UniformMagField* fMagField;
|
||||
|
||||
DetectorMessenger* detectorMessenger;
|
||||
DetectorMessenger* fDetectorMessenger;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: DetectorMessenger.hh,v 1.3 2006-06-29 16:36:07 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/include/DetectorMessenger.hh
|
||||
/// \brief Definition of the DetectorMessenger class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -50,18 +52,18 @@ class DetectorMessenger: public G4UImessenger
|
||||
DetectorMessenger(DetectorConstruction* );
|
||||
~DetectorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
virtual void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
|
||||
DetectorConstruction* Detector;
|
||||
DetectorConstruction* fDetector;
|
||||
|
||||
G4UIdirectory* testemDir;
|
||||
G4UIdirectory* detDir;
|
||||
G4UIcmdWithAString* MaterCmd;
|
||||
G4UIcmdWithADoubleAndUnit* SizeCmd;
|
||||
G4UIcmdWithADoubleAndUnit* MagFieldCmd;
|
||||
G4UIcmdWithoutParameter* UpdateCmd;
|
||||
G4UIdirectory* fTestemDir;
|
||||
G4UIdirectory* fDetDir;
|
||||
G4UIcmdWithAString* fMaterCmd;
|
||||
G4UIcmdWithADoubleAndUnit* fSizeCmd;
|
||||
G4UIcmdWithADoubleAndUnit* fMagFieldCmd;
|
||||
G4UIcmdWithoutParameter* fUpdateCmd;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/include/EventAction.hh
|
||||
/// \brief Definition of the EventAction class
|
||||
//
|
||||
// $Id: EventAction.hh,v 1.3 2006-06-29 16:36:10 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
|
||||
@@ -49,20 +51,21 @@ class EventAction : public G4UserEventAction
|
||||
~EventAction();
|
||||
|
||||
public:
|
||||
void BeginOfEventAction(const G4Event*);
|
||||
void EndOfEventAction(const G4Event*);
|
||||
virtual void BeginOfEventAction(const G4Event*);
|
||||
virtual void EndOfEventAction(const G4Event*);
|
||||
|
||||
void AddEdep(G4double Edep) {TotalEnergyDeposit += Edep;};
|
||||
G4double GetEnergyDeposit() {return TotalEnergyDeposit;};
|
||||
void SetDrawFlag(G4String val) {drawFlag = val;};
|
||||
void SetPrintModulo(G4int val) {printModulo = val;};
|
||||
void AddEdep(G4double Edep) {fTotalEnergyDeposit += Edep;};
|
||||
G4double GetEnergyDeposit() {return fTotalEnergyDeposit;};
|
||||
void SetDrawFlag(G4String val) {fDrawFlag = val;};
|
||||
void SetPrintModulo(G4int val) {fPrintModulo = val;};
|
||||
|
||||
|
||||
private:
|
||||
G4double TotalEnergyDeposit;
|
||||
G4String drawFlag;
|
||||
G4int printModulo;
|
||||
EventActionMessenger* eventMessenger;
|
||||
G4double fTotalEnergyDeposit;
|
||||
G4String fDrawFlag;
|
||||
G4int fPrintModulo;
|
||||
|
||||
EventActionMessenger* fEventMessenger;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: EventActionMessenger.hh,v 1.3 2006-06-29 16:36:13 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/include/EventActionMessenger.hh
|
||||
/// \brief Definition of the EventActionMessenger class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -48,14 +50,14 @@ class EventActionMessenger: public G4UImessenger
|
||||
EventActionMessenger(EventAction*);
|
||||
~EventActionMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
virtual void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
EventAction* eventAction;
|
||||
EventAction* fEventAction;
|
||||
|
||||
G4UIdirectory* eventDir;
|
||||
G4UIcmdWithAString* DrawCmd;
|
||||
G4UIcmdWithAnInteger* PrintCmd;
|
||||
G4UIdirectory* fEventDir;
|
||||
G4UIcmdWithAString* fDrawCmd;
|
||||
G4UIcmdWithAnInteger* fPrintCmd;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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 electromagnetic/TestEm1/include/ExG4HbookAnalysisManager.hh
|
||||
/// \brief Definition of the ExG4HbookAnalysisManager class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
/// \file ExG4HbookAnalysisManager.hh
|
||||
/// \brief Definition of the ExG4HbookAnalysisManager class
|
||||
|
||||
// Author: Ivana Hrivnacova, 15/06/2011 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifdef G4_USE_HBOOK
|
||||
|
||||
#ifndef ExG4HbookAnalysisManager_h
|
||||
#define ExG4HbookAnalysisManager_h 1
|
||||
|
||||
#include "G4VAnalysisManager.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <tools/hbook/wfile>
|
||||
#include <tools/hbook/h1>
|
||||
#include <tools/hbook/h2>
|
||||
#include <tools/hbook/wntuple>
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#define setpawc setpawc_
|
||||
#define setntuc setntuc_
|
||||
//#define ntuc ntuc_
|
||||
|
||||
class ExG4HbookAnalysisManager;
|
||||
|
||||
namespace G4Hbook {
|
||||
|
||||
typedef tools::hbook::h1 G4AnaH1;
|
||||
typedef ExG4HbookAnalysisManager G4AnalysisManager;
|
||||
}
|
||||
|
||||
/// HBook Analysis manager
|
||||
///
|
||||
/// The class implements the G4VAnalysisManager manager for HBook.
|
||||
/// It is provided separately from geant4/source/analysis in order
|
||||
/// to avoid a need of linking Geant4 kernel libraries with cerblib.
|
||||
|
||||
class ExG4HbookAnalysisManager : public G4VAnalysisManager
|
||||
{
|
||||
public:
|
||||
ExG4HbookAnalysisManager();
|
||||
virtual ~ExG4HbookAnalysisManager();
|
||||
|
||||
// static methods
|
||||
static ExG4HbookAnalysisManager* Instance();
|
||||
|
||||
// Methods to manipulate files
|
||||
virtual G4bool OpenFile(const G4String& fileName);
|
||||
virtual G4bool Write();
|
||||
virtual G4bool CloseFile();
|
||||
|
||||
// Methods to create histogrammes, ntuples
|
||||
virtual G4int CreateH1(const G4String& name, const G4String& title,
|
||||
G4int nbins, G4double xmin, G4double xmax);
|
||||
virtual G4int CreateH2(const G4String& name, const G4String& title,
|
||||
G4int nxbins, G4double xmin, G4double xmax,
|
||||
G4int nybins, G4double ymin, G4double ymax);
|
||||
|
||||
virtual void CreateNtuple(const G4String& name, const G4String& title);
|
||||
virtual G4int CreateNtupleIColumn(const G4String& name);
|
||||
virtual G4int CreateNtupleFColumn(const G4String& name);
|
||||
virtual G4int CreateNtupleDColumn(const G4String& name);
|
||||
virtual void FinishNtuple();
|
||||
|
||||
// Methods to fill histogrammes, ntuples
|
||||
virtual G4bool FillH1(G4int id, G4double value, G4double weight = 1.0);
|
||||
virtual G4bool FillH2(G4int id, G4double xvalue, G4double yvalue,
|
||||
G4double weight = 1.0);
|
||||
virtual G4bool FillNtupleIColumn(G4int id, G4int value);
|
||||
virtual G4bool FillNtupleFColumn(G4int id, G4float value);
|
||||
virtual G4bool FillNtupleDColumn(G4int id, G4double value);
|
||||
virtual G4bool AddNtupleRow();
|
||||
|
||||
// Access methods
|
||||
virtual tools::hbook::h1* GetH1(G4int id, G4bool warn = true) const;
|
||||
virtual tools::hbook::h2* GetH2(G4int id, G4bool warn = true) const;
|
||||
virtual tools::hbook::wntuple* GetNtuple() const;
|
||||
//tools::hbook::h1* GetH1(const G4String& name, G4bool warn = true) const;
|
||||
|
||||
// HBOOK does not allow IDs the same IDs for H1 and H2,
|
||||
// and also IDs starting from 0; thats why there is defined an offset
|
||||
// with respect to the G4AnalysisManager generic Ids.
|
||||
// The default values of these offsets can be changed by the user.
|
||||
//
|
||||
// Set the offset of HBOOK ID for H1
|
||||
// ( default value = firstHistoID if firstHistoID > 0; otherwise = 1)
|
||||
G4bool SetH1HbookIdOffset(G4int offset);
|
||||
//
|
||||
// Set the offset of HBOOK ID for H2
|
||||
// ( default value = firstHistoID + 100 if firstHistoID > 0; otherwise = 101 )
|
||||
G4bool SetH2HbookIdOffset(G4int offset);
|
||||
//
|
||||
// Set the HBOOK ID for the ntuple
|
||||
// (default value = 1 )
|
||||
G4bool SetNtupleHbookId(G4int ntupleId);
|
||||
|
||||
G4int GetH1HbookIdOffset() const;
|
||||
G4int GetH2HbookIdOffset() const;
|
||||
G4int GetNtupleHbookId() const;
|
||||
|
||||
private:
|
||||
// static data members
|
||||
//
|
||||
static ExG4HbookAnalysisManager* fgInstance;
|
||||
static const G4int fgkDefaultH2HbookIdOffset;
|
||||
static const G4int fgkDefaultNtupleHbookId;
|
||||
static const G4String fgkDefaultNtupleDirectoryName;
|
||||
|
||||
// methods
|
||||
//
|
||||
tools::hbook::wntuple::column<int>* GetNtupleIColumn(G4int id) const;
|
||||
tools::hbook::wntuple::column<float>* GetNtupleFColumn(G4int id) const;
|
||||
tools::hbook::wntuple::column<double>* GetNtupleDColumn(G4int id) const;
|
||||
|
||||
// data members
|
||||
//
|
||||
G4int fH1HbookIdOffset;
|
||||
G4int fH2HbookIdOffset;
|
||||
G4int fNtupleHbookId;
|
||||
|
||||
tools::hbook::wfile* fFile;
|
||||
|
||||
std::vector<tools::hbook::h1*> fH1Vector;
|
||||
std::map<G4String, tools::hbook::h1*> fH1MapByName;
|
||||
|
||||
std::vector<tools::hbook::h2*> fH2Vector;
|
||||
std::map<G4String, tools::hbook::h2*> fH2MapByName;
|
||||
|
||||
G4String fNtupleName;
|
||||
G4String fNtupleTitle;
|
||||
tools::hbook::wntuple* fNtuple;
|
||||
std::map<G4int, tools::hbook::wntuple::column<int>* > fNtupleIColumnMap;
|
||||
std::map<G4int, tools::hbook::wntuple::column<float>* > fNtupleFColumnMap;
|
||||
std::map<G4int, tools::hbook::wntuple::column<double>* > fNtupleDColumnMap;
|
||||
};
|
||||
|
||||
// inline functions
|
||||
|
||||
inline G4int ExG4HbookAnalysisManager::GetH1HbookIdOffset() const {
|
||||
return fH1HbookIdOffset;
|
||||
}
|
||||
|
||||
inline G4int ExG4HbookAnalysisManager::GetH2HbookIdOffset() const {
|
||||
return fH2HbookIdOffset;
|
||||
}
|
||||
|
||||
inline G4int ExG4HbookAnalysisManager::GetNtupleHbookId() const {
|
||||
return fNtupleHbookId;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -23,75 +23,35 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HistoManager.hh,v 1.6 2007-11-12 15:48:58 maire Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/include/HistoManager.hh
|
||||
/// \brief Definition of the HistoManager class
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef HistoManager_h
|
||||
#define HistoManager_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
namespace AIDA {
|
||||
class IAnalysisFactory;
|
||||
class ITree;
|
||||
class IHistogram1D;
|
||||
}
|
||||
|
||||
class HistoMessenger;
|
||||
|
||||
const G4int MaxHisto = 4;
|
||||
#include "g4root.hh"
|
||||
//#include "g4xml.hh"
|
||||
////#include "g4hbook.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class HistoManager
|
||||
{
|
||||
public:
|
||||
|
||||
HistoManager();
|
||||
~HistoManager();
|
||||
|
||||
void SetFileName (const G4String& name) { fileName[0] = name;};
|
||||
void SetFileType (const G4String& name) { fileType = name;};
|
||||
void SetFileOption (const G4String& name) { fileOption = name;};
|
||||
void book();
|
||||
void save();
|
||||
void SetHisto (G4int,G4int,G4double,G4double,const G4String& unit="none");
|
||||
void FillHisto(G4int id, G4double e, G4double weight = 1.0);
|
||||
void RemoveHisto (G4int);
|
||||
void PrintHisto (G4int);
|
||||
|
||||
G4bool HistoExist (G4int id) {return exist[id];}
|
||||
G4double GetHistoUnit(G4int id) {return Unit[id];}
|
||||
G4double GetBinWidth (G4int id) {return Width[id];}
|
||||
HistoManager();
|
||||
~HistoManager();
|
||||
|
||||
private:
|
||||
|
||||
G4String fileName[2];
|
||||
G4String fileType;
|
||||
G4String fileOption;
|
||||
AIDA::IAnalysisFactory* af;
|
||||
AIDA::ITree* tree;
|
||||
AIDA::IHistogram1D* histo[MaxHisto];
|
||||
G4bool exist[MaxHisto];
|
||||
G4String Label[MaxHisto];
|
||||
G4String Title[MaxHisto];
|
||||
G4int Nbins[MaxHisto];
|
||||
G4double Vmin [MaxHisto];
|
||||
G4double Vmax [MaxHisto];
|
||||
G4double Unit [MaxHisto];
|
||||
G4double Width[MaxHisto];
|
||||
G4bool ascii[MaxHisto];
|
||||
|
||||
G4bool factoryOn;
|
||||
HistoMessenger* histoMessenger;
|
||||
|
||||
private:
|
||||
void saveAscii();
|
||||
void Book();
|
||||
G4String fFileName;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/include/PhysListEmStandard.hh
|
||||
/// \brief Definition of the PhysListEmStandard class
|
||||
//
|
||||
// $Id: PhysListEmStandard.hh,v 1.5 2007-11-12 15:48:58 maire Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -46,12 +48,12 @@ class PhysListEmStandard : public G4VPhysicsConstructor
|
||||
|
||||
public:
|
||||
// This method is dummy for physics
|
||||
void ConstructParticle() {};
|
||||
virtual void ConstructParticle() {};
|
||||
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each physics process will be instantiated and
|
||||
// registered to the process manager of each particle type
|
||||
void ConstructProcess();
|
||||
virtual void ConstructProcess();
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -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 electromagnetic/TestEm1/include/PhysListEmStandardSS.hh
|
||||
/// \brief Definition of the PhysListEmStandardSS class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef PhysListEmStandardSS_h
|
||||
#define PhysListEmStandardSS_h 1
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class PhysListEmStandardSS : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
PhysListEmStandardSS(const G4String& name = "standardSS");
|
||||
virtual ~PhysListEmStandardSS();
|
||||
|
||||
public:
|
||||
// This method is dummy for physics
|
||||
virtual void ConstructParticle() {};
|
||||
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each physics process will be instantiated and
|
||||
// registered to the process manager of each particle type
|
||||
virtual void ConstructProcess();
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/include/PhysicsList.hh
|
||||
/// \brief Definition of the PhysicsList class
|
||||
//
|
||||
// $Id: PhysicsList.hh,v 1.4 2006-06-29 16:36:33 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//
|
||||
@@ -52,30 +54,31 @@ class PhysicsList: public G4VModularPhysicsList
|
||||
PhysicsList(DetectorConstruction*);
|
||||
~PhysicsList();
|
||||
|
||||
void ConstructParticle();
|
||||
void ConstructProcess();
|
||||
virtual void ConstructParticle();
|
||||
virtual void ConstructProcess();
|
||||
void AddPhysicsList(const G4String& name);
|
||||
|
||||
void AddDecay();
|
||||
void AddRadioactiveDecay();
|
||||
void AddStepMax();
|
||||
|
||||
void SetCuts();
|
||||
virtual void SetCuts();
|
||||
void SetCutForGamma(G4double);
|
||||
void SetCutForElectron(G4double);
|
||||
void SetCutForPositron(G4double);
|
||||
void GetRange(G4double);
|
||||
|
||||
private:
|
||||
G4double cutForGamma;
|
||||
G4double cutForElectron;
|
||||
G4double cutForPositron;
|
||||
G4double currentDefaultCut;
|
||||
G4double fCutForGamma;
|
||||
G4double fCutForElectron;
|
||||
G4double fCutForPositron;
|
||||
G4double fCurrentDefaultCut;
|
||||
|
||||
G4VPhysicsConstructor* emPhysicsList;
|
||||
G4String emName;
|
||||
G4VPhysicsConstructor* fEmPhysicsList;
|
||||
G4String fEmName;
|
||||
|
||||
DetectorConstruction* pDet;
|
||||
PhysicsListMessenger* pMessenger;
|
||||
DetectorConstruction* fDet;
|
||||
PhysicsListMessenger* fMessenger;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PhysicsListMessenger.hh,v 1.3 2006-06-29 16:36:35 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/include/PhysicsListMessenger.hh
|
||||
/// \brief Definition of the PhysicsListMessenger class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -49,19 +51,19 @@ class PhysicsListMessenger: public G4UImessenger
|
||||
PhysicsListMessenger(PhysicsList* );
|
||||
~PhysicsListMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
virtual void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
|
||||
PhysicsList* pPhysicsList;
|
||||
PhysicsList* fPhysicsList;
|
||||
|
||||
G4UIdirectory* physDir;
|
||||
G4UIcmdWithADoubleAndUnit* gammaCutCmd;
|
||||
G4UIcmdWithADoubleAndUnit* electCutCmd;
|
||||
G4UIcmdWithADoubleAndUnit* protoCutCmd;
|
||||
G4UIcmdWithADoubleAndUnit* allCutCmd;
|
||||
G4UIcmdWithADoubleAndUnit* rCmd;
|
||||
G4UIcmdWithAString* pListCmd;
|
||||
G4UIdirectory* fPhysDir;
|
||||
G4UIcmdWithADoubleAndUnit* fGammaCutCmd;
|
||||
G4UIcmdWithADoubleAndUnit* fElectCutCmd;
|
||||
G4UIcmdWithADoubleAndUnit* fProtoCutCmd;
|
||||
G4UIcmdWithADoubleAndUnit* fAllCutCmd;
|
||||
G4UIcmdWithADoubleAndUnit* fRCmd;
|
||||
G4UIcmdWithAString* fListCmd;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PrimaryGeneratorAction.hh,v 1.3 2006-06-29 16:36:37 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/include/PrimaryGeneratorAction.hh
|
||||
/// \brief Definition of the PrimaryGeneratorAction class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -50,16 +52,16 @@ class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
|
||||
public:
|
||||
void SetDefaultKinematic(G4int);
|
||||
void SetRndmBeam(G4double val) {rndmBeam = val;}
|
||||
void GeneratePrimaries(G4Event*);
|
||||
void SetRndmBeam(G4double val) {fRndmBeam = val;}
|
||||
virtual void GeneratePrimaries(G4Event*);
|
||||
|
||||
G4ParticleGun* GetParticleGun() {return particleGun;}
|
||||
G4ParticleGun* GetParticleGun() {return fParticleGun;}
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun;
|
||||
DetectorConstruction* Detector;
|
||||
G4double rndmBeam;
|
||||
PrimaryGeneratorMessenger* gunMessenger;
|
||||
G4ParticleGun* fParticleGun;
|
||||
DetectorConstruction* fDetector;
|
||||
G4double fRndmBeam;
|
||||
PrimaryGeneratorMessenger* fGunMessenger;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PrimaryGeneratorMessenger.hh,v 1.3 2006-06-29 16:36:39 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/include/PrimaryGeneratorMessenger.hh
|
||||
/// \brief Definition of the PrimaryGeneratorMessenger class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -48,14 +50,14 @@ class PrimaryGeneratorMessenger: public G4UImessenger
|
||||
PrimaryGeneratorMessenger(PrimaryGeneratorAction*);
|
||||
~PrimaryGeneratorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
virtual void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
PrimaryGeneratorAction* Action;
|
||||
|
||||
G4UIdirectory* gunDir;
|
||||
G4UIcmdWithAnInteger* DefaultCmd;
|
||||
G4UIcmdWithADouble* RndmCmd;
|
||||
G4UIdirectory* fGunDir;
|
||||
G4UIcmdWithAnInteger* fDefaultCmd;
|
||||
G4UIcmdWithADouble* fRndmCmd;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: RunAction.hh,v 1.9 2010-04-06 11:11:24 maire Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/include/RunAction.hh
|
||||
/// \brief Definition of the RunAction class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -48,36 +50,36 @@ class HistoManager;
|
||||
class RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
RunAction(DetectorConstruction*, PrimaryGeneratorAction*, HistoManager*);
|
||||
RunAction(DetectorConstruction*, PrimaryGeneratorAction*);
|
||||
~RunAction();
|
||||
|
||||
public:
|
||||
void BeginOfRunAction(const G4Run*);
|
||||
void EndOfRunAction(const G4Run*);
|
||||
virtual void BeginOfRunAction(const G4Run*);
|
||||
virtual void EndOfRunAction(const G4Run*);
|
||||
|
||||
void CountTraks0(G4int nt) { NbOfTraks0 += nt;}
|
||||
void CountTraks1(G4int nt) { NbOfTraks1 += nt;}
|
||||
void CountSteps0(G4int ns) { NbOfSteps0 += ns;}
|
||||
void CountSteps1(G4int ns) { NbOfSteps1 += ns;}
|
||||
void CountProcesses(G4String procName) { procCounter[procName]++;};
|
||||
void CountTraks0(G4int nt) { fNbOfTraks0 += nt;}
|
||||
void CountTraks1(G4int nt) { fNbOfTraks1 += nt;}
|
||||
void CountSteps0(G4int ns) { fNbOfSteps0 += ns;}
|
||||
void CountSteps1(G4int ns) { fNbOfSteps1 += ns;}
|
||||
void CountProcesses(G4String procName) { fProcCounter[procName]++;};
|
||||
|
||||
void AddEdep(G4double val) { edep += val;}
|
||||
void AddTrueRange (G4double l) { trueRange += l; trueRange2 += l*l;};
|
||||
void AddProjRange (G4double x) { projRange += x; projRange2 += x*x;};
|
||||
void AddTransvDev (G4double y) { transvDev += y; transvDev2 += y*y;};
|
||||
void AddEdep(G4double val) { fEdep += val;}
|
||||
void AddTrueRange (G4double l) { fTrueRange += l; fTrueRange2 += l*l;};
|
||||
void AddProjRange (G4double x) { fProjRange += x; fProjRange2 += x*x;};
|
||||
void AddTransvDev (G4double y) { fTransvDev += y; fTransvDev2 += y*y;};
|
||||
|
||||
private:
|
||||
DetectorConstruction* detector;
|
||||
PrimaryGeneratorAction* primary;
|
||||
HistoManager* histoManager;
|
||||
DetectorConstruction* fDetector;
|
||||
PrimaryGeneratorAction* fPrimary;
|
||||
HistoManager* fHistoManager;
|
||||
|
||||
G4int NbOfTraks0, NbOfTraks1;
|
||||
G4int NbOfSteps0, NbOfSteps1;
|
||||
G4double edep;
|
||||
G4double trueRange, trueRange2;
|
||||
G4double projRange, projRange2;
|
||||
G4double transvDev, transvDev2;
|
||||
std::map<G4String,G4int> procCounter;
|
||||
G4int fNbOfTraks0, fNbOfTraks1;
|
||||
G4int fNbOfSteps0, fNbOfSteps1;
|
||||
G4double fEdep;
|
||||
G4double fTrueRange, fTrueRange2;
|
||||
G4double fProjRange, fProjRange2;
|
||||
G4double fTransvDev, fTransvDev2;
|
||||
std::map<G4String,G4int> fProcCounter;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/include/StackingAction.hh
|
||||
/// \brief Definition of the StackingAction class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef StackingAction_h
|
||||
#define StackingAction_h 1
|
||||
|
||||
#include "G4UserStackingAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class StackingAction : public G4UserStackingAction
|
||||
{
|
||||
public:
|
||||
StackingAction();
|
||||
~StackingAction();
|
||||
|
||||
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track*);
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: StepMax.hh,v 1.2 2006-06-29 16:36:45 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/include/StepMax.hh
|
||||
/// \brief Definition of the StepMax class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -48,26 +50,26 @@ class StepMax : public G4VDiscreteProcess
|
||||
StepMax(const G4String& processName = "UserMaxStep");
|
||||
~StepMax();
|
||||
|
||||
G4bool IsApplicable(const G4ParticleDefinition&);
|
||||
virtual G4bool IsApplicable(const G4ParticleDefinition&);
|
||||
|
||||
void SetMaxStep(G4double);
|
||||
|
||||
G4double GetMaxStep() {return MaxChargedStep;};
|
||||
G4double GetMaxStep() {return fMaxChargedStep;};
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength( const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
|
||||
virtual G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
G4double GetMeanFreePath(const G4Track&, G4double,G4ForceCondition*)
|
||||
virtual G4double GetMeanFreePath(const G4Track&,G4double,G4ForceCondition*)
|
||||
{return DBL_MAX;};
|
||||
|
||||
private:
|
||||
|
||||
G4double MaxChargedStep;
|
||||
G4double fMaxChargedStep;
|
||||
|
||||
StepMaxMessenger* pMess;
|
||||
StepMaxMessenger* fMess;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: StepMaxMessenger.hh,v 1.2 2006-06-29 16:36:47 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/include/StepMaxMessenger.hh
|
||||
/// \brief Definition of the StepMaxMessenger class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -46,11 +48,11 @@ class StepMaxMessenger: public G4UImessenger
|
||||
StepMaxMessenger(StepMax*);
|
||||
~StepMaxMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
virtual void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
StepMax* stepMax;
|
||||
G4UIcmdWithADoubleAndUnit* StepMaxCmd;
|
||||
StepMax* fStepMax;
|
||||
G4UIcmdWithADoubleAndUnit* fStepMaxCmd;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: SteppingAction.hh,v 1.4 2006-06-29 16:36:49 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/include/SteppingAction.hh
|
||||
/// \brief Definition of the SteppingAction class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -36,22 +38,20 @@
|
||||
|
||||
class RunAction;
|
||||
class EventAction;
|
||||
class HistoManager;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
SteppingAction(RunAction*, EventAction*, HistoManager*);
|
||||
SteppingAction(RunAction*, EventAction*);
|
||||
~SteppingAction() {};
|
||||
|
||||
void UserSteppingAction(const G4Step*);
|
||||
virtual void UserSteppingAction(const G4Step*);
|
||||
|
||||
private:
|
||||
RunAction* runAction;
|
||||
EventAction* eventAction;
|
||||
HistoManager* histoManager;
|
||||
RunAction* fRunAction;
|
||||
EventAction* fEventAction;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/include/SteppingVerbose.hh
|
||||
/// \brief Definition of the SteppingVerbose class
|
||||
//
|
||||
// $Id: SteppingVerbose.hh,v 1.2 2006-06-29 16:36:51 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// This class manages the verbose outputs in G4SteppingManager.
|
||||
// It inherits from G4SteppingVerbose.
|
||||
@@ -48,8 +50,8 @@ public:
|
||||
SteppingVerbose();
|
||||
~SteppingVerbose();
|
||||
|
||||
void StepInfo();
|
||||
void TrackingStarted();
|
||||
virtual void StepInfo();
|
||||
virtual void TrackingStarted();
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: TrackingAction.hh,v 1.4 2006-06-29 16:36:53 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/include/TrackingAction.hh
|
||||
/// \brief Definition of the TrackingAction class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -36,23 +38,21 @@
|
||||
|
||||
class PrimaryGeneratorAction;
|
||||
class RunAction;
|
||||
class HistoManager;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class TrackingAction : public G4UserTrackingAction {
|
||||
|
||||
public:
|
||||
TrackingAction(PrimaryGeneratorAction*, RunAction*, HistoManager*);
|
||||
TrackingAction(PrimaryGeneratorAction*, RunAction*);
|
||||
~TrackingAction() {};
|
||||
|
||||
void PreUserTrackingAction(const G4Track*);
|
||||
void PostUserTrackingAction(const G4Track*);
|
||||
virtual void PreUserTrackingAction(const G4Track*);
|
||||
virtual void PostUserTrackingAction(const G4Track*);
|
||||
|
||||
private:
|
||||
PrimaryGeneratorAction* primary;
|
||||
RunAction* runAction;
|
||||
HistoManager* histoManager;
|
||||
PrimaryGeneratorAction* fPrimary;
|
||||
RunAction* fRunAction;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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 electromagnetic/TestEm1/include/g4hbook.hh
|
||||
/// \brief Definition of the g4hbook class
|
||||
//
|
||||
// $Id$
|
||||
|
||||
// Author: Ivana Hrivnacova, 15/06/2011 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef g4hbook_h
|
||||
#define g4hbook_h
|
||||
|
||||
#include "g4hbook_defs.hh"
|
||||
|
||||
using namespace G4Hbook;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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 electromagnetic/TestEm1/include/g4hbook_defs.hh
|
||||
/// \brief Definition of the g4hbook_defs class
|
||||
//
|
||||
// $Id$
|
||||
|
||||
// Author: Ivana Hrivnacova, 15/06/2011 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef g4hbook_defs_h
|
||||
#define g4hbook_defs_h
|
||||
|
||||
#include <tools/hbook/h1>
|
||||
#include <tools/hbook/h2>
|
||||
#include <tools/hbook/wntuple>
|
||||
#include "ExG4HbookAnalysisManager.hh"
|
||||
|
||||
namespace G4Hbook {
|
||||
|
||||
typedef tools::hbook::h1 G4AnaH1;
|
||||
typedef tools::hbook::h2 G4AnaH2;
|
||||
typedef tools::hbook::wntuple G4Ntuple;
|
||||
typedef ExG4HbookAnalysisManager G4AnalysisManager;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -28,15 +28,14 @@
|
||||
/gun/particle e-
|
||||
/gun/energy 200 MeV
|
||||
#
|
||||
/testem/histo/setFileName ionis
|
||||
/testem/histo/setFileType hbook
|
||||
/testem/histo/setHisto 1 100 0 50 cm #track length of primary
|
||||
/testem/histo/setHisto 2 100 0 100 none #nb steps of primary
|
||||
/testem/histo/setHisto 3 200 0 50 mm #step size of primary
|
||||
/analysis/setFileName ionis
|
||||
/analysis/h1/set 1 100 0 50 cm #track length of primary
|
||||
/analysis/h1/set 2 100 0 100 none #nb steps of primary
|
||||
/analysis/h1/set 3 200 0 50 mm #step size of primary
|
||||
#
|
||||
/testem/histo/printHisto 1
|
||||
/testem/histo/printHisto 2
|
||||
/testem/histo/printHisto 3
|
||||
/analysis/h1/setAscii 1
|
||||
/analysis/h1/setAscii 2
|
||||
/analysis/h1/setAscii 3
|
||||
#
|
||||
/testem/event/printModulo 100
|
||||
#
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# $Id: gammaconversion.mac,v 1.2 2009-09-15 12:51:49 maire Exp $
|
||||
#
|
||||
# Macro file for "TestEm1.cc"
|
||||
#
|
||||
# Photon 100 keV; photoelectric effect
|
||||
#
|
||||
/control/verbose 2
|
||||
/run/verbose 2
|
||||
#
|
||||
/testem/det/setMat G4_Gd
|
||||
/testem/det/setSize 100 m
|
||||
#
|
||||
/testem/phys/addPhysics local
|
||||
#
|
||||
/run/initialize
|
||||
#
|
||||
# no Compton nor conversion
|
||||
/process/inactivate compt
|
||||
/process/inactivate conv
|
||||
#
|
||||
/process/em/deexcitation world true true true
|
||||
/process/em/fluo true
|
||||
/process/em/auger true
|
||||
#
|
||||
# prevent ionisation and bremsstrahlung production
|
||||
/testem/phys/setCuts 1 um
|
||||
#
|
||||
# no multiple scattering
|
||||
/process/inactivate msc
|
||||
#
|
||||
/testem/gun/setDefault
|
||||
/gun/particle gamma
|
||||
/gun/energy 80 keV
|
||||
/gun/position 0 0 0 mm
|
||||
#
|
||||
/analysis/setFileName photoelec
|
||||
/analysis/h1/set 4 100 0 100 keV #total edep
|
||||
#
|
||||
/tracking/verbose 0
|
||||
#
|
||||
/run/beamOn 10000
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
// Draw histos filled by Geant4 simulation
|
||||
//
|
||||
TFile f = TFile("run1.root");
|
||||
TFile f = TFile("run1.root");
|
||||
TCanvas* c1 = new TCanvas("c1", " ");
|
||||
|
||||
TH1D* hist1 = (TH1D*)f.Get("1");
|
||||
@@ -16,5 +16,14 @@
|
||||
c1->SetLogy(1);
|
||||
c1->cd();
|
||||
c1->Update();
|
||||
hist3->Draw("HIST");
|
||||
hist3->Draw("HIST");
|
||||
|
||||
TH1D* hist4 = (TH1D*)f.Get("4");
|
||||
hist4->Draw("HIST");
|
||||
|
||||
TH1D* hist5 = (TH1D*)f.Get("5");
|
||||
hist5->Draw("HIST");
|
||||
|
||||
TH1D* hist6 = (TH1D*)f.Get("6");
|
||||
hist6->Draw("HIST");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# $Id: range.mac,v 1.12 2009-09-15 12:51:49 maire Exp $
|
||||
#
|
||||
# Macro file for "TestEm1.cc"
|
||||
#
|
||||
/control/verbose 2
|
||||
/run/verbose 2
|
||||
#
|
||||
/testem/det/setMat Aluminium
|
||||
/testem/det/setSize 100 m
|
||||
#
|
||||
/testem/phys/addPhysics local
|
||||
#
|
||||
/run/initialize
|
||||
#
|
||||
/process/em/fluo true
|
||||
/process/em/auger true
|
||||
#
|
||||
/testem/gun/setDefault
|
||||
/gun/particle ion
|
||||
/gun/ion 82 210 0 0
|
||||
/gun/energy 1 eV
|
||||
/gun/position 0 0 0 mm
|
||||
#
|
||||
/grdm/nucleusLimits 210 210 82 82
|
||||
#
|
||||
/analysis/setFileName rdecay
|
||||
/analysis/h1/set 4 100 0 80 keV #total edep
|
||||
#
|
||||
/testem/event/printModulo 40000
|
||||
#
|
||||
/run/beamOn 400000
|
||||
@@ -31,9 +31,8 @@
|
||||
/gun/particle proton
|
||||
/gun/energy 100 MeV
|
||||
#
|
||||
/testem/histo/setFileName range
|
||||
/testem/histo/setFileType hbook
|
||||
/testem/histo/setHisto 1 150 70 85 mm # csda range
|
||||
/analysis/setFileName range
|
||||
/analysis/h1/set 1 150 70 85 mm # csda range
|
||||
#
|
||||
/testem/event/printModulo 4000
|
||||
#
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# $Id: TestEm1.in,v 1.25 2008-09-12 16:32:25 maire Exp $
|
||||
#
|
||||
# Macro file for "TestEm1.cc"
|
||||
# (can be run in batch, without graphic)
|
||||
#
|
||||
# electron 100 MeV; all processes
|
||||
#
|
||||
/control/verbose 2
|
||||
/run/verbose 2
|
||||
#
|
||||
/testem/det/setMat Aluminium
|
||||
/testem/det/setSize 10 m
|
||||
#
|
||||
/run/initialize
|
||||
#
|
||||
/testem/gun/setDefault
|
||||
/gun/particle e-
|
||||
/gun/energy 100 MeV
|
||||
#
|
||||
/analysis/h1/set 1 100 0 50 cm #track length of primary
|
||||
/analysis/h1/set 2 100 0 300 none #nb steps of primary
|
||||
/analysis/h1/set 3 200 0 20 mm #step size of primary
|
||||
/analysis/h1/set 4 100 50 150 MeV #total energy deposit
|
||||
/analysis/h1/set 5 100 0 100 MeV #sec. chared energy spectrum
|
||||
/analysis/h1/set 6 100 0 100 MeV #sec. neutral energy spectrum
|
||||
/analysis/h1/setAscii 1
|
||||
#
|
||||
/testem/phys/setCuts 1 mm
|
||||
/analysis/setFileName run0
|
||||
/run/beamOn 2000
|
||||
#
|
||||
/process/eLoss/verbose 0
|
||||
#
|
||||
/testem/phys/setCuts 10 um
|
||||
/analysis/setFileName run1
|
||||
/run/beamOn 2000
|
||||
@@ -23,10 +23,12 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/src/DetectorConstruction.cc
|
||||
/// \brief Implementation of the DetectorConstruction class
|
||||
//
|
||||
|
||||
//
|
||||
// $Id: DetectorConstruction.cc,v 1.8 2007-11-12 15:48:58 maire Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
|
||||
@@ -37,6 +39,7 @@
|
||||
#include "DetectorMessenger.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
@@ -48,22 +51,23 @@
|
||||
#include "G4SolidStore.hh"
|
||||
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorConstruction::DetectorConstruction()
|
||||
:pBox(0), lBox(0), aMaterial(0), magField(0)
|
||||
:fPBox(0), fLBox(0), fMaterial(0), fMagField(0)
|
||||
{
|
||||
BoxSize = 10*m;
|
||||
fBoxSize = 10*m;
|
||||
DefineMaterials();
|
||||
SetMaterial("Aluminium");
|
||||
detectorMessenger = new DetectorMessenger(this);
|
||||
fDetectorMessenger = new DetectorMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorConstruction::~DetectorConstruction()
|
||||
{ delete detectorMessenger;}
|
||||
{ delete fDetectorMessenger;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -123,7 +127,9 @@ void DetectorConstruction::DefineMaterials()
|
||||
new G4Material("Aluminium" , z=13., a= 26.98*g/mole, density= 2.700*g/cm3);
|
||||
|
||||
new G4Material("Silicon" , z=14., a= 28.09*g/mole, density= 2.330*g/cm3);
|
||||
|
||||
|
||||
new G4Material("Chromium" , z=24., a= 51.99*g/mole, density= 7.140*g/cm3);
|
||||
|
||||
new G4Material("Germanium" , z=32., a= 72.61*g/mole, density= 5.323*g/cm3);
|
||||
|
||||
G4Material* BGO =
|
||||
@@ -135,7 +141,9 @@ void DetectorConstruction::DefineMaterials()
|
||||
new G4Material("Iron" , z=26., a= 55.85*g/mole, density= 7.870*g/cm3);
|
||||
|
||||
new G4Material("Tungsten" , z=74., a=183.85*g/mole, density= 19.30*g/cm3);
|
||||
|
||||
|
||||
new G4Material("Gold" , z=79., a=196.97*g/mole, density= 19.32*g/cm3);
|
||||
|
||||
new G4Material("Lead" , z=82., a=207.19*g/mole, density= 11.35*g/cm3);
|
||||
|
||||
new G4Material("Uranium" , z=92., a=238.03*g/mole, density= 18.95*g/cm3);
|
||||
@@ -155,34 +163,34 @@ G4VPhysicalVolume* DetectorConstruction::ConstructVolumes()
|
||||
G4SolidStore::GetInstance()->Clean();
|
||||
|
||||
G4Box*
|
||||
sBox = new G4Box("Container", //its name
|
||||
BoxSize/2,BoxSize/2,BoxSize/2); //its dimensions
|
||||
sBox = new G4Box("Container", //its name
|
||||
fBoxSize/2,fBoxSize/2,fBoxSize/2); //its dimensions
|
||||
|
||||
lBox = new G4LogicalVolume(sBox, //its shape
|
||||
aMaterial, //its material
|
||||
aMaterial->GetName()); //its name
|
||||
fLBox = new G4LogicalVolume(sBox, //its shape
|
||||
fMaterial, //its material
|
||||
fMaterial->GetName()); //its name
|
||||
|
||||
pBox = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
lBox, //its logical volume
|
||||
aMaterial->GetName(), //its name
|
||||
0, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
|
||||
fPBox = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLBox, //its logical volume
|
||||
fMaterial->GetName(), //its name
|
||||
0, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
|
||||
PrintParameters();
|
||||
|
||||
//always return the root volume
|
||||
//
|
||||
return pBox;
|
||||
return fPBox;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void DetectorConstruction::PrintParameters()
|
||||
{
|
||||
G4cout << "\n The Box is " << G4BestUnit(BoxSize,"Length")
|
||||
<< " of " << aMaterial->GetName() << G4endl;
|
||||
G4cout << "\n The Box is " << G4BestUnit(fBoxSize,"Length")
|
||||
<< " of " << fMaterial->GetName() << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -190,15 +198,22 @@ void DetectorConstruction::PrintParameters()
|
||||
void DetectorConstruction::SetMaterial(G4String materialChoice)
|
||||
{
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
|
||||
if (pttoMaterial) aMaterial = pttoMaterial;
|
||||
////G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
|
||||
G4Material* pttoMaterial =
|
||||
G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
|
||||
|
||||
if (pttoMaterial) { fMaterial = pttoMaterial;
|
||||
} else {
|
||||
G4cout << "\n--> warning from DetectorConstruction::SetMaterial : "
|
||||
<< materialChoice << " not found" << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void DetectorConstruction::SetSize(G4double value)
|
||||
{
|
||||
BoxSize = value;
|
||||
fBoxSize = value;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -212,18 +227,18 @@ void DetectorConstruction::SetMagField(G4double fieldValue)
|
||||
G4FieldManager* fieldMgr
|
||||
= G4TransportationManager::GetTransportationManager()->GetFieldManager();
|
||||
|
||||
if (magField) delete magField; //delete the existing magn field
|
||||
if (fMagField) delete fMagField; //delete the existing magn field
|
||||
|
||||
if (fieldValue!=0.) // create a new one if non nul
|
||||
if (fieldValue!=0.) // create a new one if non nul
|
||||
{
|
||||
magField = new G4UniformMagField(G4ThreeVector(0.,0.,fieldValue));
|
||||
fieldMgr->SetDetectorField(magField);
|
||||
fieldMgr->CreateChordFinder(magField);
|
||||
fMagField = new G4UniformMagField(G4ThreeVector(0.,0.,fieldValue));
|
||||
fieldMgr->SetDetectorField(fMagField);
|
||||
fieldMgr->CreateChordFinder(fMagField);
|
||||
}
|
||||
else
|
||||
{
|
||||
magField = 0;
|
||||
fieldMgr->SetDetectorField(magField);
|
||||
fMagField = 0;
|
||||
fieldMgr->SetDetectorField(fMagField);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: DetectorMessenger.cc,v 1.3 2006-06-29 16:36:57 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/src/DetectorMessenger.cc
|
||||
/// \brief Implementation of the DetectorMessenger class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -40,67 +42,67 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
:Detector(Det)
|
||||
:fDetector(Det)
|
||||
{
|
||||
testemDir = new G4UIdirectory("/testem/");
|
||||
testemDir->SetGuidance("commands specific to this example");
|
||||
fTestemDir = new G4UIdirectory("/testem/");
|
||||
fTestemDir->SetGuidance("commands specific to this example");
|
||||
|
||||
detDir = new G4UIdirectory("/testem/det/");
|
||||
detDir->SetGuidance("detector construction commands");
|
||||
fDetDir = new G4UIdirectory("/testem/det/");
|
||||
fDetDir->SetGuidance("detector construction commands");
|
||||
|
||||
MaterCmd = new G4UIcmdWithAString("/testem/det/setMat",this);
|
||||
MaterCmd->SetGuidance("Select material of the box.");
|
||||
MaterCmd->SetParameterName("choice",false);
|
||||
MaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fMaterCmd = new G4UIcmdWithAString("/testem/det/setMat",this);
|
||||
fMaterCmd->SetGuidance("Select material of the box.");
|
||||
fMaterCmd->SetParameterName("choice",false);
|
||||
fMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
SizeCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setSize",this);
|
||||
SizeCmd->SetGuidance("Set size of the box");
|
||||
SizeCmd->SetParameterName("Size",false);
|
||||
SizeCmd->SetRange("Size>0.");
|
||||
SizeCmd->SetUnitCategory("Length");
|
||||
SizeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fSizeCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setSize",this);
|
||||
fSizeCmd->SetGuidance("Set size of the box");
|
||||
fSizeCmd->SetParameterName("Size",false);
|
||||
fSizeCmd->SetRange("Size>0.");
|
||||
fSizeCmd->SetUnitCategory("Length");
|
||||
fSizeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setField",this);
|
||||
MagFieldCmd->SetGuidance("Define magnetic field.");
|
||||
MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
MagFieldCmd->SetParameterName("Bz",false);
|
||||
MagFieldCmd->SetUnitCategory("Magnetic flux density");
|
||||
MagFieldCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setField",this);
|
||||
fMagFieldCmd->SetGuidance("Define magnetic field.");
|
||||
fMagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
fMagFieldCmd->SetParameterName("Bz",false);
|
||||
fMagFieldCmd->SetUnitCategory("Magnetic flux density");
|
||||
fMagFieldCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
UpdateCmd = new G4UIcmdWithoutParameter("/testem/det/update",this);
|
||||
UpdateCmd->SetGuidance("Update calorimeter geometry.");
|
||||
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
|
||||
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
|
||||
UpdateCmd->AvailableForStates(G4State_Idle);
|
||||
fUpdateCmd = new G4UIcmdWithoutParameter("/testem/det/update",this);
|
||||
fUpdateCmd->SetGuidance("Update calorimeter geometry.");
|
||||
fUpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
|
||||
fUpdateCmd->SetGuidance("if you changed geometrical value(s).");
|
||||
fUpdateCmd->AvailableForStates(G4State_Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorMessenger::~DetectorMessenger()
|
||||
{
|
||||
delete MaterCmd;
|
||||
delete SizeCmd;
|
||||
delete MagFieldCmd;
|
||||
delete UpdateCmd;
|
||||
delete detDir;
|
||||
delete testemDir;
|
||||
delete fMaterCmd;
|
||||
delete fSizeCmd;
|
||||
delete fMagFieldCmd;
|
||||
delete fUpdateCmd;
|
||||
delete fDetDir;
|
||||
delete fTestemDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if( command == MaterCmd )
|
||||
{ Detector->SetMaterial(newValue);}
|
||||
if( command == fMaterCmd )
|
||||
{ fDetector->SetMaterial(newValue);}
|
||||
|
||||
if( command == SizeCmd )
|
||||
{ Detector->SetSize(SizeCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == fSizeCmd )
|
||||
{ fDetector->SetSize(fSizeCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == MagFieldCmd )
|
||||
{ Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == fMagFieldCmd )
|
||||
{ fDetector->SetMagField(fMagFieldCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == UpdateCmd )
|
||||
{ Detector->UpdateGeometry(); }
|
||||
if( command == fUpdateCmd )
|
||||
{ fDetector->UpdateGeometry(); }
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/src/EventAction.cc
|
||||
/// \brief Implementation of the EventAction class
|
||||
//
|
||||
// $Id: EventAction.cc,v 1.9 2010-06-07 05:40:45 perl Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
|
||||
@@ -35,6 +37,7 @@
|
||||
#include "EventAction.hh"
|
||||
|
||||
#include "EventActionMessenger.hh"
|
||||
#include "HistoManager.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
@@ -42,16 +45,16 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventAction::EventAction()
|
||||
:drawFlag("none"),printModulo(10000),eventMessenger(0)
|
||||
:fDrawFlag("none"),fPrintModulo(10000),fEventMessenger(0)
|
||||
{
|
||||
eventMessenger = new EventActionMessenger(this);
|
||||
fEventMessenger = new EventActionMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventAction::~EventAction()
|
||||
{
|
||||
delete eventMessenger;
|
||||
delete fEventMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -61,21 +64,24 @@ void EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
G4int evtNb = evt->GetEventID();
|
||||
|
||||
//printing survey
|
||||
if (evtNb%printModulo == 0) {
|
||||
if (evtNb%fPrintModulo == 0) {
|
||||
G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
|
||||
}
|
||||
|
||||
//additional initializations
|
||||
TotalEnergyDeposit = 0.;
|
||||
fTotalEnergyDeposit = 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void EventAction::EndOfEventAction(const G4Event*)
|
||||
{
|
||||
if (drawFlag != "none") G4cout << " Energy deposit: "
|
||||
<< G4BestUnit(TotalEnergyDeposit,"Energy")
|
||||
<< G4endl;
|
||||
|
||||
G4AnalysisManager::Instance()->FillH1(4,fTotalEnergyDeposit);
|
||||
|
||||
////if (fDrawFlag != "none") G4cout << " Energy deposit: "
|
||||
//// << G4BestUnit(fTotalEnergyDeposit,"Energy")
|
||||
//// << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: EventActionMessenger.cc,v 1.3 2006-06-29 16:37:01 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/src/EventActionMessenger.cc
|
||||
/// \brief Implementation of the EventActionMessenger class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -39,33 +41,33 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventActionMessenger::EventActionMessenger(EventAction* EvAct)
|
||||
:eventAction(EvAct)
|
||||
:fEventAction(EvAct)
|
||||
{
|
||||
eventDir = new G4UIdirectory("/testem/event/");
|
||||
eventDir->SetGuidance("event control");
|
||||
fEventDir = new G4UIdirectory("/testem/event/");
|
||||
fEventDir->SetGuidance("event control");
|
||||
|
||||
DrawCmd = new G4UIcmdWithAString("/testem/event/drawTracks",this);
|
||||
DrawCmd->SetGuidance("Draw the tracks in the event");
|
||||
DrawCmd->SetGuidance(" Choice : none,charged, all");
|
||||
DrawCmd->SetParameterName("choice",true);
|
||||
DrawCmd->SetDefaultValue("all");
|
||||
DrawCmd->SetCandidates("none charged all");
|
||||
DrawCmd->AvailableForStates(G4State_Idle);
|
||||
fDrawCmd = new G4UIcmdWithAString("/testem/event/drawTracks",this);
|
||||
fDrawCmd->SetGuidance("Draw the tracks in the event");
|
||||
fDrawCmd->SetGuidance(" Choice : none,charged, all");
|
||||
fDrawCmd->SetParameterName("choice",true);
|
||||
fDrawCmd->SetDefaultValue("all");
|
||||
fDrawCmd->SetCandidates("none charged all");
|
||||
fDrawCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
PrintCmd = new G4UIcmdWithAnInteger("/testem/event/printModulo",this);
|
||||
PrintCmd->SetGuidance("Print events modulo n");
|
||||
PrintCmd->SetParameterName("EventNb",false);
|
||||
PrintCmd->SetRange("EventNb>0");
|
||||
PrintCmd->AvailableForStates(G4State_Idle);
|
||||
fPrintCmd = new G4UIcmdWithAnInteger("/testem/event/printModulo",this);
|
||||
fPrintCmd->SetGuidance("Print events modulo n");
|
||||
fPrintCmd->SetParameterName("EventNb",false);
|
||||
fPrintCmd->SetRange("EventNb>0");
|
||||
fPrintCmd->AvailableForStates(G4State_Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventActionMessenger::~EventActionMessenger()
|
||||
{
|
||||
delete DrawCmd;
|
||||
delete PrintCmd;
|
||||
delete eventDir;
|
||||
delete fDrawCmd;
|
||||
delete fPrintCmd;
|
||||
delete fEventDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -73,11 +75,11 @@ EventActionMessenger::~EventActionMessenger()
|
||||
void EventActionMessenger::SetNewValue(G4UIcommand* command,
|
||||
G4String newValue)
|
||||
{
|
||||
if(command == DrawCmd)
|
||||
{eventAction->SetDrawFlag(newValue);}
|
||||
if(command == fDrawCmd)
|
||||
{fEventAction->SetDrawFlag(newValue);}
|
||||
|
||||
if(command == PrintCmd)
|
||||
{eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));}
|
||||
if(command == fPrintCmd)
|
||||
{fEventAction->SetPrintModulo(fPrintCmd->GetNewIntValue(newValue));}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,805 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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 electromagnetic/TestEm1/src/ExG4HbookAnalysisManager.cc
|
||||
/// \brief Implementation of the ExG4HbookAnalysisManager class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
/// \file ExG4HbookAnalysisManager.cc
|
||||
/// \brief Implementation of the ExG4HbookAnalysisManager class
|
||||
|
||||
// Author: Ivana Hrivnacova, 15/06/2011 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifdef G4_USE_HBOOK
|
||||
|
||||
#include "ExG4HbookAnalysisManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
extern "C" int setpawc();
|
||||
extern "C" int setntuc();
|
||||
|
||||
ExG4HbookAnalysisManager* ExG4HbookAnalysisManager::fgInstance = 0;
|
||||
const G4int ExG4HbookAnalysisManager::fgkDefaultH2HbookIdOffset = 100;
|
||||
const G4int ExG4HbookAnalysisManager::fgkDefaultNtupleHbookId = 1;
|
||||
const G4String ExG4HbookAnalysisManager::fgkDefaultNtupleDirectoryName = "ntuple";
|
||||
|
||||
//_____________________________________________________________________________
|
||||
ExG4HbookAnalysisManager* ExG4HbookAnalysisManager::Instance()
|
||||
{
|
||||
if ( fgInstance == 0 ) {
|
||||
fgInstance = new ExG4HbookAnalysisManager();
|
||||
}
|
||||
|
||||
return fgInstance;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
ExG4HbookAnalysisManager::ExG4HbookAnalysisManager()
|
||||
: G4VAnalysisManager("Hbook"),
|
||||
fH1HbookIdOffset(-1),
|
||||
fH2HbookIdOffset(-1),
|
||||
fNtupleHbookId(-1),
|
||||
fFile(0),
|
||||
fH1Vector(),
|
||||
fH1MapByName(),
|
||||
fH2Vector(),
|
||||
fH2MapByName(),
|
||||
fNtupleName(),
|
||||
fNtupleTitle(),
|
||||
fNtuple(0),
|
||||
fNtupleIColumnMap(),
|
||||
fNtupleFColumnMap(),
|
||||
fNtupleDColumnMap()
|
||||
{
|
||||
if ( fgInstance ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " "
|
||||
<< "G4HbookAnalysisManager already exists."
|
||||
<< "Cannot create another instance.";
|
||||
G4Exception("G4HbookAnalysisManager::G4HbookAnalysisManager()",
|
||||
"Analysis_F001", FatalException, description);
|
||||
}
|
||||
|
||||
fgInstance = this;
|
||||
|
||||
// Initialize HBOOK :
|
||||
tools::hbook::CHLIMIT(setpawc());
|
||||
setntuc(); //for ntuple.
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
ExG4HbookAnalysisManager::~ExG4HbookAnalysisManager()
|
||||
{
|
||||
std::vector<tools::hbook::h1*>::iterator it;
|
||||
for ( it = fH1Vector.begin(); it != fH1Vector.end(); it++ ) {
|
||||
delete *it;
|
||||
}
|
||||
std::vector<tools::hbook::h2*>::iterator it2;
|
||||
for ( it2 = fH2Vector.begin(); it2 != fH2Vector.end(); it2++ ) {
|
||||
delete *it2;
|
||||
}
|
||||
delete fNtuple;
|
||||
delete fFile;
|
||||
|
||||
fgInstance = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// private methods
|
||||
//
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::wntuple::column<int>*
|
||||
ExG4HbookAnalysisManager::GetNtupleIColumn(G4int id) const
|
||||
{
|
||||
std::map<G4int, tools::hbook::wntuple::column<int>* >::const_iterator it
|
||||
= fNtupleIColumnMap.find(id);
|
||||
if ( it == fNtupleIColumnMap.end() ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::GetNtupleIColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::wntuple::column<float>*
|
||||
ExG4HbookAnalysisManager::GetNtupleFColumn(G4int id) const
|
||||
{
|
||||
std::map<G4int, tools::hbook::wntuple::column<float>* >::const_iterator it
|
||||
= fNtupleFColumnMap.find(id);
|
||||
if ( it == fNtupleFColumnMap.end() ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::GetNtupleFColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::wntuple::column<double>*
|
||||
ExG4HbookAnalysisManager::GetNtupleDColumn(G4int id) const
|
||||
{
|
||||
std::map<G4int, tools::hbook::wntuple::column<double>* >::const_iterator it
|
||||
= fNtupleDColumnMap.find(id);
|
||||
if ( it == fNtupleDColumnMap.end() ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::GetNtupleDColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
//
|
||||
// public methods
|
||||
//
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::OpenFile(const G4String& fileName)
|
||||
{
|
||||
G4String name(fileName);
|
||||
if ( name.find(".") == std::string::npos ) {
|
||||
name.append(".");
|
||||
name.append(GetFileType());
|
||||
}
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("open", "analysis file", name);
|
||||
#endif
|
||||
|
||||
tools::hbook::CHCDIR("//PAWC"," ");
|
||||
|
||||
unsigned int unit = 1;
|
||||
fFile = new tools::hbook::wfile(std::cout, name, unit);
|
||||
if ( ! fFile->is_valid() ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "Cannot open file " << fileName;
|
||||
G4Exception("G4HbookAnalysisManager::OpenFile()",
|
||||
"Analysis_W001", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
// At this point, in HBOOK, we should have :
|
||||
// - created a //LUN1 directory attached to the file
|
||||
// - created a //PAWC/LUN1 in memory
|
||||
// - be in the directory //PAWC/LUN1.
|
||||
|
||||
// create an "histo" HBOOK directory both in memory and in the file :
|
||||
if ( fHistoDirectoryName != "" ) {
|
||||
tools::hbook::CHCDIR("//PAWC/LUN1"," ");
|
||||
tools::hbook::CHMDIR(fHistoDirectoryName.data()," ");
|
||||
tools::hbook::CHCDIR("//LUN1"," ");
|
||||
tools::hbook::CHMDIR(fHistoDirectoryName.data()," ");
|
||||
}
|
||||
|
||||
fLockHistoDirectoryName = true;
|
||||
|
||||
// the five upper lines could have been done with :
|
||||
//fFile->cd_home();
|
||||
//fFile->mkcd("histo");
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("open", "analysis file", name);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::Write()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("write", "file", "");
|
||||
#endif
|
||||
|
||||
// ntuple
|
||||
//if ( fNtuple ) fNtuple->add_row_end();
|
||||
|
||||
G4bool result = fFile->write();
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("write", "file", "", result);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::CloseFile()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("close", "file", "");
|
||||
#endif
|
||||
|
||||
//WARNING : have to delete the ntuple before closing the file.
|
||||
delete fNtuple;
|
||||
fNtuple = 0;
|
||||
|
||||
G4bool result = fFile->close();
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("close", "file", "", result);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4int ExG4HbookAnalysisManager::CreateH1(const G4String& name, const G4String& title,
|
||||
G4int nbins, G4double xmin, G4double xmax)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "H1", name);
|
||||
#endif
|
||||
|
||||
// Go to histograms directory
|
||||
if ( fHistoDirectoryName != "" ) {
|
||||
G4String histoPath = "//PAWC/LUN1/";
|
||||
histoPath.append(fHistoDirectoryName.data());
|
||||
tools::hbook::CHCDIR(histoPath.data()," ");
|
||||
}
|
||||
|
||||
// Set fH1HbookIdOffset if needed
|
||||
if ( fH1Vector.size() == 0 ) {
|
||||
if ( fH1HbookIdOffset == -1 ) {
|
||||
if ( fFirstHistoId > 0 )
|
||||
fH1HbookIdOffset = 0;
|
||||
else
|
||||
fH1HbookIdOffset = 1;
|
||||
|
||||
if ( fH1HbookIdOffset > 0 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << "H1 will be defined in HBOOK with ID = G4_firstHistoId + 1";
|
||||
G4Exception("ExG4HbookAnalysisManager::CreateH1()",
|
||||
"Analysis_W011", JustWarning, description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create histogram
|
||||
G4int index = fH1Vector.size();
|
||||
G4int hbookIndex = fH1HbookIdOffset + fH1Vector.size() + fFirstHistoId;
|
||||
tools::hbook::h1* h1 = new tools::hbook::h1(hbookIndex, title, nbins, xmin, xmax);
|
||||
fH1Vector.push_back(h1);
|
||||
fH1MapByName[name] = h1;
|
||||
|
||||
if ( fHistoDirectoryName != "" ) {
|
||||
// Return to //PAWC/LUN1 :
|
||||
tools::hbook::CHCDIR("//PAWC/LUN1"," ");
|
||||
}
|
||||
|
||||
fLockFirstHistoId = true;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " name : " << name << " hbook index : " << hbookIndex;
|
||||
fpVerboseL1->Message("create", "H1", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
return index + fFirstHistoId;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4int ExG4HbookAnalysisManager::CreateH2(const G4String& name, const G4String& title,
|
||||
G4int nxbins, G4double xmin, G4double xmax,
|
||||
G4int nybins, G4double ymin, G4double ymax)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "H2", name);
|
||||
#endif
|
||||
|
||||
// Go to histograms directory
|
||||
if ( fHistoDirectoryName != "" ) {
|
||||
G4String histoPath = "//PAWC/LUN1/";
|
||||
histoPath.append(fHistoDirectoryName.data());
|
||||
tools::hbook::CHCDIR(histoPath.data()," ");
|
||||
}
|
||||
|
||||
// Set fH2HbookIdOffset if needed
|
||||
if ( fH2Vector.size() == 0 ) {
|
||||
if ( fH2HbookIdOffset == -1 ) {
|
||||
if ( fFirstHistoId > 0 )
|
||||
fH2HbookIdOffset = fgkDefaultH2HbookIdOffset;
|
||||
else
|
||||
fH2HbookIdOffset = fgkDefaultH2HbookIdOffset + 1;
|
||||
|
||||
if ( fH2HbookIdOffset != fgkDefaultH2HbookIdOffset ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< "H2 will be defined in HBOOK with ID = "
|
||||
<< fgkDefaultH2HbookIdOffset << " + G4_firstHistoId + 1";
|
||||
G4Exception("ExG4HbookAnalysisManager::CreateH2()",
|
||||
"Analysis_W011", JustWarning, description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
G4int index = fH2Vector.size();
|
||||
G4int hbookIndex = fH2HbookIdOffset + fH2Vector.size() + fFirstHistoId;
|
||||
tools::hbook::h2* h2
|
||||
= new tools::hbook::h2(hbookIndex, title, nxbins, xmin, xmax, nybins, ymin, ymax);
|
||||
fH2Vector.push_back(h2);
|
||||
fH2MapByName[name] = h2;
|
||||
|
||||
// Return to //PAWC/LUN1 :
|
||||
if ( fHistoDirectoryName != "" ) {
|
||||
tools::hbook::CHCDIR("//PAWC/LUN1"," ");
|
||||
}
|
||||
|
||||
fLockFirstHistoId = true;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " name : " << name << " hbook index : " << hbookIndex;
|
||||
fpVerboseL1->Message("create", "H2", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
return index + fFirstHistoId;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
void ExG4HbookAnalysisManager::CreateNtuple(const G4String& name,
|
||||
const G4String& title)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "ntuple", name);
|
||||
#endif
|
||||
|
||||
if ( fNtuple ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " "
|
||||
<< "Ntuple already exists. "
|
||||
<< "(Only one ntuple is currently supported.)";
|
||||
G4Exception("G4HbookAnalysisManager::CreateNtuple()",
|
||||
"Analysis_W006", JustWarning, description);
|
||||
return;
|
||||
}
|
||||
|
||||
// Create an "ntuple" directory both in memory and in the file
|
||||
fFile->cd_home(); //go under //PAWC/LUN1
|
||||
if ( fNtupleDirectoryName == "" )
|
||||
fFile->mkcd(fgkDefaultNtupleDirectoryName.data());
|
||||
else
|
||||
fFile->mkcd(fNtupleDirectoryName.data());
|
||||
|
||||
// Define ntuple ID in HBOOK
|
||||
if ( fNtupleHbookId == -1 ) fNtupleHbookId = fgkDefaultNtupleHbookId;
|
||||
|
||||
// We should be under //PAWC/LUN1/ntuple
|
||||
fNtuple = new tools::hbook::wntuple(fNtupleHbookId, name);
|
||||
fNtupleName = name;
|
||||
fNtupleTitle = title;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " name : " << name << " hbook index : " << fNtupleHbookId;
|
||||
fpVerboseL1->Message("create", "ntuple", description);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4int ExG4HbookAnalysisManager::CreateNtupleIColumn(const G4String& name)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "ntuple I column", name);
|
||||
#endif
|
||||
|
||||
G4int index = fNtuple->columns().size();
|
||||
tools::hbook::wntuple::column<int>* column = fNtuple->create_column<int>(name);
|
||||
fNtupleIColumnMap[index] = column;
|
||||
fLockFirstNtupleColumnId = true;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("create", "ntuple I column", name);
|
||||
#endif
|
||||
|
||||
return index + fFirstNtupleColumnId;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4int ExG4HbookAnalysisManager::CreateNtupleFColumn(const G4String& name)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "ntuple F column", name);
|
||||
#endif
|
||||
|
||||
G4int index = fNtuple->columns().size();
|
||||
tools::hbook::wntuple::column<float>* column = fNtuple->create_column<float>(name);
|
||||
fNtupleFColumnMap[index] = column;
|
||||
fLockFirstNtupleColumnId = true;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("create", "ntuple F column", name);
|
||||
#endif
|
||||
|
||||
return index + fFirstNtupleColumnId;
|
||||
}
|
||||
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4int ExG4HbookAnalysisManager::CreateNtupleDColumn(const G4String& name)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "ntuple D column", name);
|
||||
#endif
|
||||
|
||||
G4int index = fNtuple->columns().size();
|
||||
tools::hbook::wntuple::column<double>* column = fNtuple->create_column<double>(name);
|
||||
fNtupleDColumnMap[index] = column;
|
||||
fLockFirstNtupleColumnId = true;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("create", "ntuple D column", name);
|
||||
#endif
|
||||
|
||||
return index + fFirstNtupleColumnId;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
void ExG4HbookAnalysisManager::FinishNtuple()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("finish", "ntuple", fNtupleName);
|
||||
#endif
|
||||
|
||||
// Return to //PAWC/LUN1 :
|
||||
tools::hbook::CHCDIR("//PAWC/LUN1"," ");
|
||||
|
||||
//fNtuple->add_row_beg();
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("finish", "ntuple", fNtupleName);
|
||||
#endif
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::FillH1(G4int id, G4double value, G4double weight)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL3->Message("fill", "H1", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
tools::hbook::h1* h1 = GetH1(id);
|
||||
if ( ! h1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "histogram " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::FillH1()",
|
||||
"Analysis_W007", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
h1->fill(value, weight);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL2->Message("fill", "H1", description);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::FillH2(G4int id,
|
||||
G4double xvalue, G4double yvalue,
|
||||
G4double weight)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id
|
||||
<< " xvalue " << xvalue << " yvalue " << yvalue;
|
||||
fpVerboseL3->Message("fill", "H2", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
tools::hbook::h2* h2 = GetH2(id);
|
||||
if ( ! h2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "histogram " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::FillH2()",
|
||||
"Analysis_W007", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
h2->fill(xvalue, yvalue, weight);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id
|
||||
<< " xvalue " << xvalue << " yvalue " << yvalue;
|
||||
fpVerboseL2->Message("fill", "H2", description);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::FillNtupleIColumn(G4int id, G4int value)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL3->Message("fill", "ntuple I column", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
tools::hbook::wntuple::column<int>* column = GetNtupleIColumn(id);
|
||||
if ( ! column ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::FillNtupleIColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
column->fill(value);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL2->Message("fill", "ntuple I column", description);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::FillNtupleFColumn(G4int id, G4float value)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL3->Message("fill", "ntuple F column", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
tools::hbook::wntuple::column<float>* column = GetNtupleFColumn(id);
|
||||
if ( ! column ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::FillNtupleFColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
column->fill(value);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL2->Message("fill", "ntuple F column", description);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::FillNtupleDColumn(G4int id, G4double value)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL3->Message("fill", "ntuple D column", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
tools::hbook::wntuple::column<double>* column = GetNtupleDColumn(id);
|
||||
if ( ! column ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::FillNtupleDColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
column->fill(value);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL2->Message("fill", "ntuple D column", description);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::AddNtupleRow()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("add", "ntuple row", "");
|
||||
#endif
|
||||
|
||||
//G4cout << "Hbook: Going to add Ntuple row ..." << G4endl;
|
||||
if ( ! fNtuple ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "ntuple does not exist. ";
|
||||
G4Exception("G4HbookAnalysisManager::AddNtupleRow()",
|
||||
"Analysis_W008", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
//fNtuple->add_row_fast();
|
||||
fNtuple->add_row();
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 )
|
||||
fpVerboseL2->Message("add", "ntuple row", "");
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::h1* ExG4HbookAnalysisManager::GetH1(G4int id, G4bool warn) const
|
||||
{
|
||||
G4int index = id - fFirstHistoId;
|
||||
if ( index < 0 || index >= G4int(fH1Vector.size()) ) {
|
||||
if ( warn) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "histo " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::GetH1()",
|
||||
"Analysis_W007", JustWarning, description);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return fH1Vector[index];
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::h2* ExG4HbookAnalysisManager::GetH2(G4int id, G4bool warn) const
|
||||
{
|
||||
G4int index = id - fFirstHistoId;
|
||||
if ( index < 0 || index >= G4int(fH2Vector.size()) ) {
|
||||
if ( warn) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "histo " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::GetH2()",
|
||||
"Analysis_W007", JustWarning, description);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return fH2Vector[index];
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::wntuple* ExG4HbookAnalysisManager::GetNtuple() const
|
||||
{
|
||||
return fNtuple;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::SetH1HbookIdOffset(G4int offset)
|
||||
{
|
||||
if ( fH1Vector.size() ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< "Cannot set H1HbookIdOffset as some H1 histogramms already exist.";
|
||||
G4Exception("G4HbookAnalysisManager::SetH1HbookIdOffset()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( fFirstHistoId + offset < 1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << "The first histogram HBOOK id must be >= 1.";
|
||||
G4Exception("G4HbookAnalysisManager::SetH1HbookIdOffset()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
fH1HbookIdOffset = offset;
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::SetH2HbookIdOffset(G4int offset)
|
||||
{
|
||||
if ( fH2Vector.size() ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< "Cannot set H2HbookIdOffset as some H2 histogramms already exist.";
|
||||
G4Exception("G4HbookAnalysisManager::SetH2HbookIdOffset()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( fFirstHistoId + offset < 1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << "The first histogram HBOOK id must be >= 1.";
|
||||
G4Exception("G4HbookAnalysisManager::SetH1HbookIdOffset()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
fH2HbookIdOffset = offset;
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::SetNtupleHbookId(G4int ntupleId)
|
||||
{
|
||||
if ( fNtuple ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< "Cannot set NtupleHbookId as an ntuple already exists.";
|
||||
G4Exception("G4HbookAnalysisManager::SetNtupleHbookId()",
|
||||
"Analysis_W010", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ntupleId < 1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << "The ntuple HBOOK id must be >= 1.";
|
||||
G4Exception("G4HbookAnalysisManager::SetNtupleHbookId()",
|
||||
"Analysis_W010", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
fNtupleHbookId = ntupleId;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -23,234 +23,68 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HistoManager.cc,v 1.14 2010-11-09 21:00:43 asaim Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/src/HistoManager.cc
|
||||
/// \brief Implementation of the HistoManager class
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "HistoManager.hh"
|
||||
#include "HistoMessenger.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
#ifdef G4ANALYSIS_USE
|
||||
#include "AIDA/AIDA.h"
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
HistoManager::HistoManager()
|
||||
:af(0),tree(0),factoryOn(false)
|
||||
: fFileName("testem1")
|
||||
{
|
||||
#ifdef G4ANALYSIS_USE
|
||||
// Creating the analysis factory
|
||||
af = AIDA_createAnalysisFactory();
|
||||
if(!af) {
|
||||
G4cout << " HistoManager::HistoManager() :"
|
||||
<< " problem creating the AIDA analysis factory."
|
||||
<< G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
fileName[0] = "testem1";
|
||||
fileType = "root";
|
||||
fileOption = "";
|
||||
// histograms
|
||||
for (G4int k=0; k<MaxHisto; k++) {
|
||||
histo[k] = 0;
|
||||
exist[k] = false;
|
||||
Unit[k] = 1.0;
|
||||
Width[k] = 1.0;
|
||||
ascii[k] = false;
|
||||
}
|
||||
|
||||
histoMessenger = new HistoMessenger(this);
|
||||
Book();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
HistoManager::~HistoManager()
|
||||
{
|
||||
delete histoMessenger;
|
||||
delete G4AnalysisManager::Instance();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void HistoManager::Book()
|
||||
{
|
||||
// Create or get analysis manager
|
||||
// The choice of analysis technology is done via selection of a namespace
|
||||
// in HistoManager.hh
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
analysisManager->SetFileName(fFileName);
|
||||
analysisManager->SetVerboseLevel(1);
|
||||
analysisManager->SetFirstHistoId(1); // start histogram numbering from 1
|
||||
analysisManager->SetActivation(true); // enable inactivation of histograms
|
||||
|
||||
#ifdef G4ANALYSIS_USE
|
||||
delete af;
|
||||
#endif
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void HistoManager::book()
|
||||
{
|
||||
#ifdef G4ANALYSIS_USE
|
||||
if(!af) return;
|
||||
|
||||
// Creating a tree mapped to an hbook file.
|
||||
fileName[1] = fileName[0] + "." + fileType;
|
||||
G4bool readOnly = false;
|
||||
G4bool createNew = true;
|
||||
AIDA::ITreeFactory* tf = af->createTreeFactory();
|
||||
tree = tf->create(fileName[1], fileType, readOnly, createNew, fileOption);
|
||||
delete tf;
|
||||
if(!tree) {
|
||||
G4cout << "HistoManager::book() :"
|
||||
<< " problem creating the AIDA tree with "
|
||||
<< " storeName = " << fileName[1]
|
||||
<< " storeType = " << fileType
|
||||
<< " readOnly = " << readOnly
|
||||
<< " createNew = " << createNew
|
||||
<< " options = " << fileOption
|
||||
<< G4endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// Creating a histogram factory, whose histograms will be handled by the tree
|
||||
AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
|
||||
|
||||
// create selected histograms
|
||||
for (G4int k=0; k<MaxHisto; k++) {
|
||||
if (exist[k]) {
|
||||
histo[k] = hf->createHistogram1D( Label[k], Title[k],
|
||||
Nbins[k], Vmin[k], Vmax[k]);
|
||||
factoryOn = true;
|
||||
}
|
||||
}
|
||||
delete hf;
|
||||
if (factoryOn)
|
||||
G4cout << "\n----> Histogram Tree is opened in " << fileName[1] << G4endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void HistoManager::save()
|
||||
{
|
||||
#ifdef G4ANALYSIS_USE
|
||||
if (factoryOn) {
|
||||
saveAscii(); // Write ascii file, if any
|
||||
tree->commit(); // Writing the histograms to the file
|
||||
tree->close(); // and closing the tree (and the file)
|
||||
G4cout << "\n----> Histogram Tree is saved in " << fileName[1] << G4endl;
|
||||
|
||||
delete tree;
|
||||
tree = 0;
|
||||
factoryOn = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void HistoManager::FillHisto(G4int ih, G4double e, G4double weight)
|
||||
{
|
||||
if (ih > MaxHisto) {
|
||||
G4cout << "---> warning from HistoManager::FillHisto() : histo " << ih
|
||||
<< "does not exist; e= " << e << " w= " << weight << G4endl;
|
||||
return;
|
||||
}
|
||||
#ifdef G4ANALYSIS_USE
|
||||
if(exist[ih]) histo[ih]->fill(e/Unit[ih], weight);
|
||||
#endif
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void HistoManager::SetHisto(G4int ih,
|
||||
G4int nbins, G4double valmin, G4double valmax, const G4String& unit)
|
||||
{
|
||||
if (ih > MaxHisto) {
|
||||
G4cout << "---> warning from HistoManager::SetHisto() : histo " << ih
|
||||
<< "does not exist" << G4endl;
|
||||
return;
|
||||
}
|
||||
|
||||
const G4String id[] = { "0", "1", "2", "3" };
|
||||
// Define histograms start values
|
||||
const G4int kMaxHisto = 6;
|
||||
const G4String id[] = { "1", "2", "3" , "4", "5", "6"};
|
||||
const G4String title[] =
|
||||
{ "dummy", //0
|
||||
"total track length of primary particle", //1
|
||||
"nb steps of primary particle", //2
|
||||
"step size of primary particle" //3
|
||||
{ "total track length of primary particle", //1
|
||||
"nb steps of primary particle", //2
|
||||
"step size of primary particle", //3
|
||||
"total energy deposit", //4
|
||||
"energy of charged secondaries at creation", //5
|
||||
"energy of neutral secondaries at creation" //6
|
||||
};
|
||||
// Default values (to be reset via /analysis/h1/set command)
|
||||
G4int nbins = 100;
|
||||
G4double vmin = 0.;
|
||||
G4double vmax = 100.;
|
||||
|
||||
|
||||
G4String titl = title[ih];
|
||||
G4double vmin = valmin, vmax = valmax;
|
||||
Unit[ih] = 1.;
|
||||
|
||||
if (unit != "none") {
|
||||
titl = title[ih] + " (" + unit + ")";
|
||||
Unit[ih] = G4UnitDefinition::GetValueOf(unit);
|
||||
vmin = valmin/Unit[ih]; vmax = valmax/Unit[ih];
|
||||
// Create all histograms as inactivated
|
||||
// as we have not yet set nbins, vmin, vmax
|
||||
for (G4int k=0; k<kMaxHisto; k++) {
|
||||
G4int ih = analysisManager->CreateH1(id[k], title[k], nbins, vmin, vmax);
|
||||
analysisManager->SetActivation(G4VAnalysisManager::kH1, ih, false);
|
||||
}
|
||||
|
||||
exist[ih] = true;
|
||||
Label[ih] = id[ih];
|
||||
Title[ih] = titl;
|
||||
Nbins[ih] = nbins;
|
||||
Vmin[ih] = vmin;
|
||||
Vmax[ih] = vmax;
|
||||
Width[ih] = (valmax-valmin)/nbins;
|
||||
|
||||
G4cout << "----> SetHisto " << ih << ": " << titl << "; "
|
||||
<< nbins << " bins from "
|
||||
<< vmin << " " << unit << " to " << vmax << " " << unit << G4endl;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void HistoManager::RemoveHisto(G4int ih)
|
||||
{
|
||||
if (ih > MaxHisto) {
|
||||
G4cout << "---> warning from HistoManager::RemoveHisto() : histo " << ih
|
||||
<< "does not exist" << G4endl;
|
||||
return;
|
||||
}
|
||||
|
||||
histo[ih] = 0; exist[ih] = false;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void HistoManager::PrintHisto(G4int ih)
|
||||
{
|
||||
if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; }
|
||||
else
|
||||
G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
|
||||
<< "does not exist" << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include <fstream>
|
||||
|
||||
void HistoManager::saveAscii()
|
||||
{
|
||||
#ifdef G4ANALYSIS_USE
|
||||
|
||||
if (!ascii[0]) return;
|
||||
|
||||
G4String name = fileName[0] + ".ascii";
|
||||
std::ofstream File(name, std::ios::out);
|
||||
File.setf( std::ios::scientific, std::ios::floatfield );
|
||||
|
||||
//write selected histograms
|
||||
for (G4int ih=0; ih<MaxHisto; ih++) {
|
||||
if (exist[ih] && ascii[ih]) {
|
||||
File << "\n 1D histogram " << ih << ": " << Title[ih]
|
||||
<< "\n \n \t X \t\t Y" << G4endl;
|
||||
|
||||
for (G4int iBin=0; iBin<Nbins[ih]; iBin++) {
|
||||
File << " " << iBin << "\t"
|
||||
<< 0.5*(histo[ih]->axis().binLowerEdge(iBin) +
|
||||
histo[ih]->axis().binUpperEdge(iBin)) << "\t"
|
||||
<< histo[ih]->binHeight(iBin)
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HistoMessenger.cc,v 1.6 2007-11-12 15:48:58 maire Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "HistoMessenger.hh"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "HistoManager.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIparameter.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
HistoMessenger::HistoMessenger(HistoManager* manager)
|
||||
:histoManager (manager)
|
||||
{
|
||||
histoDir = new G4UIdirectory("/testem/histo/");
|
||||
histoDir->SetGuidance("histograms control");
|
||||
|
||||
factoryCmd = new G4UIcmdWithAString("/testem/histo/setFileName",this);
|
||||
factoryCmd->SetGuidance("set name for the histograms file");
|
||||
|
||||
typeCmd = new G4UIcmdWithAString("/testem/histo/setFileType",this);
|
||||
typeCmd->SetGuidance("set histograms file type: hbook, root, XML");
|
||||
typeCmd->SetCandidates("hbook root XML");
|
||||
|
||||
optionCmd = new G4UIcmdWithAString("/testem/histo/setFileOption",this);
|
||||
optionCmd->SetGuidance("set option for the histograms file");
|
||||
|
||||
histoCmd = new G4UIcommand("/testem/histo/setHisto",this);
|
||||
histoCmd->SetGuidance("Set bining of the histo number ih :");
|
||||
histoCmd->SetGuidance(" nbBins; valMin; valMax; unit (of vmin and vmax)");
|
||||
//
|
||||
G4UIparameter* ih = new G4UIparameter("ih",'i',false);
|
||||
ih->SetGuidance("histo number : from 1 to MaxHisto");
|
||||
ih->SetParameterRange("ih>0");
|
||||
histoCmd->SetParameter(ih);
|
||||
//
|
||||
G4UIparameter* nbBins = new G4UIparameter("nbBins",'i',false);
|
||||
nbBins->SetGuidance("number of bins");
|
||||
nbBins->SetParameterRange("nbBins>0");
|
||||
histoCmd->SetParameter(nbBins);
|
||||
//
|
||||
G4UIparameter* valMin = new G4UIparameter("valMin",'d',false);
|
||||
valMin->SetGuidance("valMin, expressed in unit");
|
||||
histoCmd->SetParameter(valMin);
|
||||
//
|
||||
G4UIparameter* valMax = new G4UIparameter("valMax",'d',false);
|
||||
valMax->SetGuidance("valMax, expressed in unit");
|
||||
histoCmd->SetParameter(valMax);
|
||||
//
|
||||
G4UIparameter* unit = new G4UIparameter("unit",'s',true);
|
||||
unit->SetGuidance("if omitted, vmin and vmax are assumed dimensionless");
|
||||
unit->SetDefaultValue("none");
|
||||
histoCmd->SetParameter(unit);
|
||||
|
||||
prhistoCmd = new G4UIcmdWithAnInteger("/testem/histo/printHisto",this);
|
||||
prhistoCmd->SetGuidance("print histo #id on ascii file");
|
||||
prhistoCmd->SetParameterName("id",false);
|
||||
prhistoCmd->SetRange("id>0");
|
||||
|
||||
rmhistoCmd = new G4UIcmdWithAnInteger("/testem/histo/removeHisto",this);
|
||||
rmhistoCmd->SetGuidance("desactivate histo #id");
|
||||
rmhistoCmd->SetParameterName("id",false);
|
||||
rmhistoCmd->SetRange("id>0");
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
HistoMessenger::~HistoMessenger()
|
||||
{
|
||||
delete rmhistoCmd;
|
||||
delete prhistoCmd;
|
||||
delete histoCmd;
|
||||
delete optionCmd;
|
||||
delete typeCmd;
|
||||
delete factoryCmd;
|
||||
delete histoDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void HistoMessenger::SetNewValue(G4UIcommand* command, G4String newValues)
|
||||
{
|
||||
if (command == factoryCmd)
|
||||
histoManager->SetFileName(newValues);
|
||||
|
||||
if (command == typeCmd)
|
||||
histoManager->SetFileType(newValues);
|
||||
|
||||
if (command == optionCmd)
|
||||
histoManager->SetFileOption(newValues);
|
||||
|
||||
if (command == histoCmd)
|
||||
{ G4int ih,nbBins; G4double vmin,vmax; char unts[30];
|
||||
const char* t = newValues;
|
||||
std::istringstream is(t);
|
||||
is >> ih >> nbBins >> vmin >> vmax >> unts;
|
||||
G4String unit = unts;
|
||||
G4double vUnit = 1. ;
|
||||
if (unit != "none") vUnit = G4UIcommand::ValueOf(unit);
|
||||
histoManager->SetHisto (ih,nbBins,vmin*vUnit,vmax*vUnit,unit);
|
||||
}
|
||||
|
||||
if (command == prhistoCmd)
|
||||
histoManager->PrintHisto(prhistoCmd->GetNewIntValue(newValues));
|
||||
|
||||
if (command == rmhistoCmd)
|
||||
histoManager->RemoveHisto(rmhistoCmd->GetNewIntValue(newValues));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PhysListEmStandard.cc,v 1.24 2009-11-15 22:10:03 maire Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -41,6 +40,7 @@
|
||||
#include "G4KleinNishinaModel.hh"
|
||||
|
||||
#include "G4eMultipleScattering.hh"
|
||||
#include "G4UrbanMscModel96.hh"
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
@@ -65,6 +65,8 @@
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4UAtomicDeexcitation.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PhysListEmStandard::PhysListEmStandard(const G4String& name)
|
||||
@@ -100,20 +102,29 @@ void PhysListEmStandard::ConstructProcess()
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
|
||||
ph->RegisterProcess(new G4eMultipleScattering(), particle);
|
||||
G4eMultipleScattering* msc = new G4eMultipleScattering();
|
||||
msc -> AddEmModel(0, new G4UrbanMscModel96());
|
||||
ph->RegisterProcess(msc, particle);
|
||||
//
|
||||
G4eIonisation* eIoni = new G4eIonisation();
|
||||
eIoni->SetStepFunction(0.1, 100*um);
|
||||
ph->RegisterProcess(eIoni, particle);
|
||||
//
|
||||
ph->RegisterProcess(new G4eBremsstrahlung(), particle);
|
||||
|
||||
|
||||
} else if (particleName == "e+") {
|
||||
|
||||
ph->RegisterProcess(new G4eMultipleScattering(), particle);
|
||||
|
||||
G4eMultipleScattering* msc = new G4eMultipleScattering();
|
||||
msc -> AddEmModel(0, new G4UrbanMscModel96());
|
||||
ph->RegisterProcess(msc, particle);
|
||||
//
|
||||
G4eIonisation* eIoni = new G4eIonisation();
|
||||
eIoni->SetStepFunction(0.1, 100*um);
|
||||
ph->RegisterProcess(eIoni, particle);
|
||||
//
|
||||
ph->RegisterProcess(new G4eBremsstrahlung(), particle);
|
||||
ph->RegisterProcess(new G4eplusAnnihilation(), particle);
|
||||
//
|
||||
ph->RegisterProcess(new G4eplusAnnihilation(), particle);
|
||||
|
||||
} else if (particleName == "mu+" ||
|
||||
particleName == "mu-" ) {
|
||||
@@ -180,7 +191,7 @@ void PhysListEmStandard::ConstructProcess()
|
||||
|
||||
//multiple coulomb scattering
|
||||
//
|
||||
emOptions.SetMscStepLimitation(fUseSafety); //default
|
||||
emOptions.SetMscStepLimitation(fUseDistanceToBoundary); //default=fUseSafety
|
||||
|
||||
// Deexcitation
|
||||
//
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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 electromagnetic/TestEm1/src/PhysListEmStandardSS.cc
|
||||
/// \brief Implementation of the PhysListEmStandardSS class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "PhysListEmStandardSS.hh"
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
|
||||
#include "G4CoulombScattering.hh"
|
||||
#include "G4IonCoulombScatteringModel.hh"
|
||||
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
#include "G4MuIonisation.hh"
|
||||
#include "G4MuBremsstrahlung.hh"
|
||||
#include "G4MuPairProduction.hh"
|
||||
|
||||
#include "G4hIonisation.hh"
|
||||
#include "G4ionIonisation.hh"
|
||||
|
||||
#include "G4EmProcessOptions.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PhysListEmStandardSS::PhysListEmStandardSS(const G4String& name)
|
||||
: G4VPhysicsConstructor(name)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PhysListEmStandardSS::~PhysListEmStandardSS()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void PhysListEmStandardSS::ConstructProcess()
|
||||
{
|
||||
// Add standard EM Processes
|
||||
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma") {
|
||||
// gamma
|
||||
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
|
||||
pmanager->AddDiscreteProcess(new G4ComptonScattering);
|
||||
pmanager->AddDiscreteProcess(new G4GammaConversion);
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
//electron
|
||||
pmanager->AddDiscreteProcess(new G4CoulombScattering);
|
||||
pmanager->AddProcess(new G4eIonisation, -1, 1, 1);
|
||||
pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2);
|
||||
|
||||
} else if (particleName == "e+") {
|
||||
//positron
|
||||
pmanager->AddDiscreteProcess(new G4CoulombScattering);
|
||||
pmanager->AddProcess(new G4eIonisation, -1, 1, 1);
|
||||
pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2);
|
||||
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3);
|
||||
|
||||
} else if (particleName == "mu+" ||
|
||||
particleName == "mu-" ) {
|
||||
//muon
|
||||
pmanager->AddDiscreteProcess(new G4CoulombScattering);
|
||||
pmanager->AddProcess(new G4MuIonisation, -1, 1, 1);
|
||||
pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2);
|
||||
pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3);
|
||||
|
||||
} else if (particleName == "alpha" || particleName == "He3") {
|
||||
pmanager->AddProcess(new G4ionIonisation, -1, 1, 1);
|
||||
G4CoulombScattering* cs = new G4CoulombScattering();
|
||||
cs->AddEmModel(0, new G4IonCoulombScatteringModel());
|
||||
cs->SetBuildTableFlag(false);
|
||||
pmanager->AddDiscreteProcess(cs);
|
||||
|
||||
} else if (particleName == "GenericIon" ) {
|
||||
pmanager->AddProcess(new G4ionIonisation, -1, 1, 1);
|
||||
G4CoulombScattering* cs = new G4CoulombScattering();
|
||||
cs->AddEmModel(0, new G4IonCoulombScatteringModel());
|
||||
cs->SetBuildTableFlag(false);
|
||||
pmanager->AddDiscreteProcess(cs);
|
||||
|
||||
} else if ((!particle->IsShortLived()) &&
|
||||
(particle->GetPDGCharge() != 0.0) &&
|
||||
(particle->GetParticleName() != "chargedgeantino")) {
|
||||
//all others charged particles except geantino
|
||||
pmanager->AddDiscreteProcess(new G4CoulombScattering);
|
||||
pmanager->AddProcess(new G4hIonisation, -1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Em options
|
||||
//
|
||||
// Main options and setting parameters are shown here.
|
||||
// Several of them have default values.
|
||||
//
|
||||
G4EmProcessOptions emOptions;
|
||||
|
||||
//physics tables
|
||||
//
|
||||
emOptions.SetMinEnergy(100*eV); //default
|
||||
emOptions.SetMaxEnergy(100*TeV); //default
|
||||
emOptions.SetDEDXBinning(12*20); //default=12*7
|
||||
emOptions.SetLambdaBinning(12*20); //default=12*7
|
||||
emOptions.SetSplineFlag(true); //default
|
||||
|
||||
//energy loss
|
||||
//
|
||||
emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm)
|
||||
emOptions.SetLinearLossLimit(1.e-2); //default
|
||||
|
||||
//ionization
|
||||
//
|
||||
emOptions.SetSubCutoff(false); //default
|
||||
|
||||
// scattering
|
||||
emOptions.SetPolarAngleLimit(0.0);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/src/PhysicsList.cc
|
||||
/// \brief Implementation of the PhysicsList class
|
||||
//
|
||||
//
|
||||
// $Id: PhysicsList.cc,v 1.12 2009-09-15 12:51:49 maire Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -34,11 +36,13 @@
|
||||
#include "PhysicsListMessenger.hh"
|
||||
|
||||
#include "PhysListEmStandard.hh"
|
||||
#include "PhysListEmStandardSS.hh"
|
||||
|
||||
#include "G4EmStandardPhysics.hh"
|
||||
#include "G4EmStandardPhysics_option1.hh"
|
||||
#include "G4EmStandardPhysics_option2.hh"
|
||||
#include "G4EmStandardPhysics_option3.hh"
|
||||
#include "G4EmStandardPhysics_option4.hh"
|
||||
#include "G4EmLivermorePhysics.hh"
|
||||
#include "G4EmPenelopePhysics.hh"
|
||||
|
||||
@@ -46,6 +50,7 @@
|
||||
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -53,20 +58,20 @@ PhysicsList::PhysicsList(DetectorConstruction* p)
|
||||
: G4VModularPhysicsList()
|
||||
{
|
||||
G4LossTableManager::Instance();
|
||||
pDet = p;
|
||||
fDet = p;
|
||||
|
||||
currentDefaultCut = 1.0*mm;
|
||||
cutForGamma = currentDefaultCut;
|
||||
cutForElectron = currentDefaultCut;
|
||||
cutForPositron = currentDefaultCut;
|
||||
fCurrentDefaultCut = 1.0*mm;
|
||||
fCutForGamma = fCurrentDefaultCut;
|
||||
fCutForElectron = fCurrentDefaultCut;
|
||||
fCutForPositron = fCurrentDefaultCut;
|
||||
|
||||
pMessenger = new PhysicsListMessenger(this);
|
||||
fMessenger = new PhysicsListMessenger(this);
|
||||
|
||||
SetVerboseLevel(1);
|
||||
|
||||
// EM physics
|
||||
emName = G4String("local");
|
||||
emPhysicsList = new PhysListEmStandard(emName);
|
||||
fEmName = G4String("local");
|
||||
fEmPhysicsList = new PhysListEmStandard(fEmName);
|
||||
|
||||
}
|
||||
|
||||
@@ -74,7 +79,7 @@ PhysicsList::PhysicsList(DetectorConstruction* p)
|
||||
|
||||
PhysicsList::~PhysicsList()
|
||||
{
|
||||
delete pMessenger;
|
||||
delete fMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -176,8 +181,6 @@ void PhysicsList::ConstructParticle()
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4EmProcessOptions.hh"
|
||||
#include "G4Decay.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
|
||||
void PhysicsList::ConstructProcess()
|
||||
{
|
||||
@@ -187,7 +190,7 @@ void PhysicsList::ConstructProcess()
|
||||
|
||||
// Electromagnetic physics list
|
||||
//
|
||||
emPhysicsList->ConstructProcess();
|
||||
fEmPhysicsList->ConstructProcess();
|
||||
|
||||
// Em options
|
||||
//
|
||||
@@ -198,6 +201,10 @@ void PhysicsList::ConstructProcess()
|
||||
// Decay Process
|
||||
//
|
||||
AddDecay();
|
||||
|
||||
// Decay Process
|
||||
//
|
||||
AddRadioactiveDecay();
|
||||
|
||||
// step limitation (as a full process)
|
||||
//
|
||||
@@ -212,47 +219,59 @@ void PhysicsList::AddPhysicsList(const G4String& name)
|
||||
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
|
||||
}
|
||||
|
||||
if (name == emName) return;
|
||||
if (name == fEmName) return;
|
||||
|
||||
if (name == "local") {
|
||||
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new PhysListEmStandard(name);
|
||||
fEmName = name;
|
||||
delete fEmPhysicsList;
|
||||
fEmPhysicsList = new PhysListEmStandard(name);
|
||||
|
||||
} else if (name == "emstandard_opt0") {
|
||||
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmStandardPhysics();
|
||||
fEmName = name;
|
||||
delete fEmPhysicsList;
|
||||
fEmPhysicsList = new G4EmStandardPhysics();
|
||||
|
||||
} else if (name == "emstandard_opt1") {
|
||||
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmStandardPhysics_option1();
|
||||
fEmName = name;
|
||||
delete fEmPhysicsList;
|
||||
fEmPhysicsList = new G4EmStandardPhysics_option1();
|
||||
|
||||
} else if (name == "emstandard_opt2") {
|
||||
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmStandardPhysics_option2();
|
||||
fEmName = name;
|
||||
delete fEmPhysicsList;
|
||||
fEmPhysicsList = new G4EmStandardPhysics_option2();
|
||||
|
||||
} else if (name == "emstandard_opt3") {
|
||||
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmStandardPhysics_option3();
|
||||
fEmName = name;
|
||||
delete fEmPhysicsList;
|
||||
fEmPhysicsList = new G4EmStandardPhysics_option3();
|
||||
|
||||
} else if (name == "emstandard_opt4") {
|
||||
|
||||
fEmName = name;
|
||||
delete fEmPhysicsList;
|
||||
fEmPhysicsList = new G4EmStandardPhysics_option4();
|
||||
|
||||
} else if (name == "standardSS") {
|
||||
|
||||
fEmName = name;
|
||||
delete fEmPhysicsList;
|
||||
fEmPhysicsList = new PhysListEmStandardSS(name);
|
||||
|
||||
} else if (name == "emlivermore") {
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmLivermorePhysics();
|
||||
fEmName = name;
|
||||
delete fEmPhysicsList;
|
||||
fEmPhysicsList = new G4EmLivermorePhysics();
|
||||
|
||||
} else if (name == "empenelope") {
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmPenelopePhysics();
|
||||
fEmName = name;
|
||||
delete fEmPhysicsList;
|
||||
fEmPhysicsList = new G4EmPenelopePhysics();
|
||||
|
||||
} else {
|
||||
|
||||
@@ -263,6 +282,7 @@ void PhysicsList::AddPhysicsList(const G4String& name)
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4Decay.hh"
|
||||
|
||||
void PhysicsList::AddDecay()
|
||||
@@ -290,6 +310,22 @@ void PhysicsList::AddDecay()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4PhysicsListHelper.hh"
|
||||
#include "G4RadioactiveDecay.hh"
|
||||
|
||||
void PhysicsList::AddRadioactiveDecay()
|
||||
{
|
||||
G4RadioactiveDecay* radioactiveDecay = new G4RadioactiveDecay();
|
||||
radioactiveDecay->SetHLThreshold(-1.*s);
|
||||
radioactiveDecay->SetICM(true); //Internal Conversion
|
||||
radioactiveDecay->SetARM(true); //Atomic Rearangement
|
||||
|
||||
G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
|
||||
ph->RegisterProcess(radioactiveDecay, G4GenericIon::GenericIon());
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "StepMax.hh"
|
||||
|
||||
void PhysicsList::AddStepMax()
|
||||
@@ -304,7 +340,7 @@ void PhysicsList::AddStepMax()
|
||||
|
||||
if (stepMaxProcess->IsApplicable(*particle))
|
||||
{
|
||||
pmanager ->AddDiscreteProcess(stepMaxProcess);
|
||||
pmanager ->AddDiscreteProcess(stepMaxProcess);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -324,9 +360,9 @@ void PhysicsList::SetCuts()
|
||||
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
SetCutValue(cutForGamma, "gamma");
|
||||
SetCutValue(cutForElectron, "e-");
|
||||
SetCutValue(cutForPositron, "e+");
|
||||
SetCutValue(fCutForGamma, "gamma");
|
||||
SetCutValue(fCutForElectron, "e-");
|
||||
SetCutValue(fCutForPositron, "e+");
|
||||
|
||||
if (verboseLevel>0) DumpCutValuesTable();
|
||||
}
|
||||
@@ -335,24 +371,24 @@ void PhysicsList::SetCuts()
|
||||
|
||||
void PhysicsList::SetCutForGamma(G4double cut)
|
||||
{
|
||||
cutForGamma = cut;
|
||||
SetParticleCuts(cutForGamma, G4Gamma::Gamma());
|
||||
fCutForGamma = cut;
|
||||
SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void PhysicsList::SetCutForElectron(G4double cut)
|
||||
{
|
||||
cutForElectron = cut;
|
||||
SetParticleCuts(cutForElectron, G4Electron::Electron());
|
||||
fCutForElectron = cut;
|
||||
SetParticleCuts(fCutForElectron, G4Electron::Electron());
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void PhysicsList::SetCutForPositron(G4double cut)
|
||||
{
|
||||
cutForPositron = cut;
|
||||
SetParticleCuts(cutForPositron, G4Positron::Positron());
|
||||
fCutForPositron = cut;
|
||||
SetParticleCuts(fCutForPositron, G4Positron::Positron());
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -361,7 +397,7 @@ void PhysicsList::SetCutForPositron(G4double cut)
|
||||
|
||||
void PhysicsList::GetRange(G4double val)
|
||||
{
|
||||
G4LogicalVolume* lBox = pDet->GetWorld()->GetLogicalVolume();
|
||||
G4LogicalVolume* lBox = fDet->GetWorld()->GetLogicalVolume();
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
const G4MaterialCutsCouple* couple = lBox->GetMaterialCutsCouple();
|
||||
const G4Material* currMat = lBox->GetMaterial();
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PhysicsListMessenger.cc,v 1.3 2006-06-29 16:37:19 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/src/PhysicsListMessenger.cc
|
||||
/// \brief Implementation of the PhysicsListMessenger class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -39,63 +41,63 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
|
||||
:pPhysicsList(pPhys)
|
||||
:fPhysicsList(pPhys)
|
||||
{
|
||||
physDir = new G4UIdirectory("/testem/phys/");
|
||||
physDir->SetGuidance("physics list commands");
|
||||
fPhysDir = new G4UIdirectory("/testem/phys/");
|
||||
fPhysDir->SetGuidance("physics list commands");
|
||||
|
||||
gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setGCut",this);
|
||||
gammaCutCmd->SetGuidance("Set gamma cut.");
|
||||
gammaCutCmd->SetParameterName("Gcut",false);
|
||||
gammaCutCmd->SetUnitCategory("Length");
|
||||
gammaCutCmd->SetRange("Gcut>0.0");
|
||||
gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fGammaCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setGCut",this);
|
||||
fGammaCutCmd->SetGuidance("Set gamma cut.");
|
||||
fGammaCutCmd->SetParameterName("Gcut",false);
|
||||
fGammaCutCmd->SetUnitCategory("Length");
|
||||
fGammaCutCmd->SetRange("Gcut>0.0");
|
||||
fGammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
electCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setECut",this);
|
||||
electCutCmd->SetGuidance("Set electron cut.");
|
||||
electCutCmd->SetParameterName("Ecut",false);
|
||||
electCutCmd->SetUnitCategory("Length");
|
||||
electCutCmd->SetRange("Ecut>0.0");
|
||||
electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fElectCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setECut",this);
|
||||
fElectCutCmd->SetGuidance("Set electron cut.");
|
||||
fElectCutCmd->SetParameterName("Ecut",false);
|
||||
fElectCutCmd->SetUnitCategory("Length");
|
||||
fElectCutCmd->SetRange("Ecut>0.0");
|
||||
fElectCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
protoCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setPCut",this);
|
||||
protoCutCmd->SetGuidance("Set positron cut.");
|
||||
protoCutCmd->SetParameterName("Pcut",false);
|
||||
protoCutCmd->SetUnitCategory("Length");
|
||||
protoCutCmd->SetRange("Pcut>0.0");
|
||||
protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fProtoCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setPCut",this);
|
||||
fProtoCutCmd->SetGuidance("Set positron cut.");
|
||||
fProtoCutCmd->SetParameterName("Pcut",false);
|
||||
fProtoCutCmd->SetUnitCategory("Length");
|
||||
fProtoCutCmd->SetRange("Pcut>0.0");
|
||||
fProtoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
allCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setCuts",this);
|
||||
allCutCmd->SetGuidance("Set cut for all.");
|
||||
allCutCmd->SetParameterName("cut",false);
|
||||
allCutCmd->SetUnitCategory("Length");
|
||||
allCutCmd->SetRange("cut>0.0");
|
||||
allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fAllCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setCuts",this);
|
||||
fAllCutCmd->SetGuidance("Set cut for all.");
|
||||
fAllCutCmd->SetParameterName("cut",false);
|
||||
fAllCutCmd->SetUnitCategory("Length");
|
||||
fAllCutCmd->SetRange("cut>0.0");
|
||||
fAllCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
rCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/getRange",this);
|
||||
rCmd->SetGuidance("get the electron cut for the current material.");
|
||||
rCmd->SetParameterName("energy",false);
|
||||
rCmd->SetRange("energy>0.");
|
||||
rCmd->SetUnitCategory("Energy");
|
||||
rCmd->AvailableForStates(G4State_Idle);
|
||||
fRCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/getRange",this);
|
||||
fRCmd->SetGuidance("get the electron cut for the current material.");
|
||||
fRCmd->SetParameterName("energy",false);
|
||||
fRCmd->SetRange("energy>0.");
|
||||
fRCmd->SetUnitCategory("Energy");
|
||||
fRCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
|
||||
pListCmd->SetGuidance("Add modula physics list.");
|
||||
pListCmd->SetParameterName("PList",false);
|
||||
pListCmd->AvailableForStates(G4State_PreInit);
|
||||
fListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
|
||||
fListCmd->SetGuidance("Add modula physics list.");
|
||||
fListCmd->SetParameterName("PList",false);
|
||||
fListCmd->AvailableForStates(G4State_PreInit);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PhysicsListMessenger::~PhysicsListMessenger()
|
||||
{
|
||||
delete gammaCutCmd;
|
||||
delete electCutCmd;
|
||||
delete protoCutCmd;
|
||||
delete allCutCmd;
|
||||
delete rCmd;
|
||||
delete pListCmd;
|
||||
delete physDir;
|
||||
delete fGammaCutCmd;
|
||||
delete fElectCutCmd;
|
||||
delete fProtoCutCmd;
|
||||
delete fAllCutCmd;
|
||||
delete fRCmd;
|
||||
delete fListCmd;
|
||||
delete fPhysDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -103,28 +105,28 @@ PhysicsListMessenger::~PhysicsListMessenger()
|
||||
void PhysicsListMessenger::SetNewValue(G4UIcommand* command,
|
||||
G4String newValue)
|
||||
{
|
||||
if( command == gammaCutCmd )
|
||||
{ pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == fGammaCutCmd )
|
||||
{ fPhysicsList->SetCutForGamma(fGammaCutCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == electCutCmd )
|
||||
{ pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == fElectCutCmd )
|
||||
{ fPhysicsList->SetCutForElectron(fElectCutCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == protoCutCmd )
|
||||
{ pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == fProtoCutCmd )
|
||||
{ fPhysicsList->SetCutForPositron(fProtoCutCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == allCutCmd )
|
||||
if( command == fAllCutCmd )
|
||||
{
|
||||
G4double cut = allCutCmd->GetNewDoubleValue(newValue);
|
||||
pPhysicsList->SetCutForGamma(cut);
|
||||
pPhysicsList->SetCutForElectron(cut);
|
||||
pPhysicsList->SetCutForPositron(cut);
|
||||
G4double cut = fAllCutCmd->GetNewDoubleValue(newValue);
|
||||
fPhysicsList->SetCutForGamma(cut);
|
||||
fPhysicsList->SetCutForElectron(cut);
|
||||
fPhysicsList->SetCutForPositron(cut);
|
||||
}
|
||||
|
||||
if( command == rCmd )
|
||||
{ pPhysicsList->GetRange(rCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == fRCmd )
|
||||
{ fPhysicsList->GetRange(fRCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == pListCmd )
|
||||
{ pPhysicsList->AddPhysicsList(newValue);}
|
||||
if( command == fListCmd )
|
||||
{ fPhysicsList->AddPhysicsList(newValue);}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/src/PrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the PrimaryGeneratorAction class
|
||||
//
|
||||
// $Id: PrimaryGeneratorAction.cc,v 1.4 2006-06-29 16:37:21 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
|
||||
@@ -40,28 +42,29 @@
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction(
|
||||
DetectorConstruction* DC)
|
||||
:Detector(DC)
|
||||
:fDetector(DC)
|
||||
{
|
||||
particleGun = new G4ParticleGun(1);
|
||||
fParticleGun = new G4ParticleGun(1);
|
||||
SetDefaultKinematic(1);
|
||||
rndmBeam = 0.;
|
||||
fRndmBeam = 0.;
|
||||
|
||||
//create a messenger for this class
|
||||
gunMessenger = new PrimaryGeneratorMessenger(this);
|
||||
fGunMessenger = new PrimaryGeneratorMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PrimaryGeneratorAction::~PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
delete gunMessenger;
|
||||
delete fParticleGun;
|
||||
delete fGunMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -70,12 +73,12 @@ void PrimaryGeneratorAction::SetDefaultKinematic(G4int front)
|
||||
{
|
||||
G4ParticleDefinition* particle
|
||||
= G4ParticleTable::GetParticleTable()->FindParticle("e-");
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
|
||||
particleGun->SetParticleEnergy(100*MeV);
|
||||
fParticleGun->SetParticleDefinition(particle);
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
|
||||
fParticleGun->SetParticleEnergy(100*MeV);
|
||||
G4double position = 0.*cm;
|
||||
if (front) position = -0.5*(Detector->GetSize());
|
||||
particleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
|
||||
if (front) position = -0.5*(fDetector->GetSize());
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -85,18 +88,18 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
//this function is called at the begining of event
|
||||
//
|
||||
//randomize the beam, if requested.
|
||||
if (rndmBeam > 0.)
|
||||
if (fRndmBeam > 0.)
|
||||
{
|
||||
G4ThreeVector oldPosition = particleGun->GetParticlePosition();
|
||||
G4double rbeam = 0.5*(Detector->GetSize())*rndmBeam;
|
||||
G4ThreeVector oldPosition = fParticleGun->GetParticlePosition();
|
||||
G4double rbeam = 0.5*(fDetector->GetSize())*fRndmBeam;
|
||||
G4double x0 = oldPosition.x();
|
||||
G4double y0 = oldPosition.y() + (2*G4UniformRand()-1.)*rbeam;
|
||||
G4double z0 = oldPosition.z() + (2*G4UniformRand()-1.)*rbeam;
|
||||
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
particleGun->SetParticlePosition(oldPosition);
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
|
||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
fParticleGun->SetParticlePosition(oldPosition);
|
||||
}
|
||||
else particleGun->GeneratePrimaryVertex(anEvent);
|
||||
else fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PrimaryGeneratorMessenger.cc,v 1.4 2006-06-29 16:37:23 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/src/PrimaryGeneratorMessenger.cc
|
||||
/// \brief Implementation of the PrimaryGeneratorMessenger class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -41,31 +43,31 @@ PrimaryGeneratorMessenger::PrimaryGeneratorMessenger(
|
||||
PrimaryGeneratorAction* Gun)
|
||||
:Action(Gun)
|
||||
{
|
||||
gunDir = new G4UIdirectory("/testem/gun/");
|
||||
gunDir->SetGuidance("gun control");
|
||||
fGunDir = new G4UIdirectory("/testem/gun/");
|
||||
fGunDir->SetGuidance("gun control");
|
||||
|
||||
DefaultCmd = new G4UIcmdWithAnInteger("/testem/gun/setDefault",this);
|
||||
DefaultCmd->SetGuidance("set/reset kinematic defined in PrimaryGenerator");
|
||||
DefaultCmd->SetGuidance("0=boxCenter, else=frontFace");
|
||||
DefaultCmd->SetParameterName("position",true);
|
||||
DefaultCmd->SetDefaultValue(1);
|
||||
DefaultCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fDefaultCmd = new G4UIcmdWithAnInteger("/testem/gun/setDefault",this);
|
||||
fDefaultCmd->SetGuidance("set/reset kinematic defined in PrimaryGenerator");
|
||||
fDefaultCmd->SetGuidance("0=boxCenter, else=frontFace");
|
||||
fDefaultCmd->SetParameterName("position",true);
|
||||
fDefaultCmd->SetDefaultValue(1);
|
||||
fDefaultCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
RndmCmd = new G4UIcmdWithADouble("/testem/gun/rndm",this);
|
||||
RndmCmd->SetGuidance("random lateral extension on the beam");
|
||||
RndmCmd->SetGuidance("in fraction of 0.5*sizeYZ");
|
||||
RndmCmd->SetParameterName("rBeam",false);
|
||||
RndmCmd->SetRange("rBeam>=0.&&rBeam<=1.");
|
||||
RndmCmd->AvailableForStates(G4State_Idle);
|
||||
fRndmCmd = new G4UIcmdWithADouble("/testem/gun/rndm",this);
|
||||
fRndmCmd->SetGuidance("random lateral extension on the beam");
|
||||
fRndmCmd->SetGuidance("in fraction of 0.5*sizeYZ");
|
||||
fRndmCmd->SetParameterName("rBeam",false);
|
||||
fRndmCmd->SetRange("rBeam>=0.&&rBeam<=1.");
|
||||
fRndmCmd->AvailableForStates(G4State_Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PrimaryGeneratorMessenger::~PrimaryGeneratorMessenger()
|
||||
{
|
||||
delete DefaultCmd;
|
||||
delete RndmCmd;
|
||||
delete gunDir;
|
||||
delete fDefaultCmd;
|
||||
delete fRndmCmd;
|
||||
delete fGunDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -73,11 +75,11 @@ PrimaryGeneratorMessenger::~PrimaryGeneratorMessenger()
|
||||
void PrimaryGeneratorMessenger::SetNewValue(G4UIcommand* command,
|
||||
G4String newValue)
|
||||
{
|
||||
if (command == DefaultCmd)
|
||||
{Action->SetDefaultKinematic(DefaultCmd->GetNewIntValue(newValue));}
|
||||
if (command == fDefaultCmd)
|
||||
{Action->SetDefaultKinematic(fDefaultCmd->GetNewIntValue(newValue));}
|
||||
|
||||
if (command == RndmCmd)
|
||||
{Action->SetRndmBeam(RndmCmd->GetNewDoubleValue(newValue));}
|
||||
if (command == fRndmCmd)
|
||||
{Action->SetRndmBeam(fRndmCmd->GetNewDoubleValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: RunAction.cc,v 1.20 2010-04-06 11:11:24 maire Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/src/RunAction.cc
|
||||
/// \brief Implementation of the RunAction class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -44,15 +46,18 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* kin,
|
||||
HistoManager* histo)
|
||||
:detector(det), primary(kin), histoManager(histo)
|
||||
{ }
|
||||
RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* kin)
|
||||
:fDetector(det), fPrimary(kin)
|
||||
{
|
||||
fHistoManager = new HistoManager();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
RunAction::~RunAction()
|
||||
{ }
|
||||
{
|
||||
delete fHistoManager;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -61,18 +66,21 @@ void RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
|
||||
|
||||
// save Rndm status
|
||||
G4RunManager::GetRunManager()->SetRandomNumberStore(true);
|
||||
////G4RunManager::GetRunManager()->SetRandomNumberStore(true);
|
||||
CLHEP::HepRandom::showEngineStatus();
|
||||
|
||||
NbOfTraks0 = NbOfTraks1 = NbOfSteps0 = NbOfSteps1 = 0;
|
||||
edep = 0.;
|
||||
trueRange = trueRange2 = 0.;
|
||||
projRange = projRange2 = 0.;
|
||||
transvDev = transvDev2 = 0.;
|
||||
fNbOfTraks0 = fNbOfTraks1 = fNbOfSteps0 = fNbOfSteps1 = 0;
|
||||
fEdep = 0.;
|
||||
fTrueRange = fTrueRange2 = 0.;
|
||||
fProjRange = fProjRange2 = 0.;
|
||||
fTransvDev = fTransvDev2 = 0.;
|
||||
|
||||
//histograms
|
||||
//
|
||||
histoManager->book();
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
if ( analysisManager->IsActive() ) {
|
||||
analysisManager->OpenFile();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -83,13 +91,13 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
if (NbOfEvents == 0) return;
|
||||
G4double dNbOfEvents = double(NbOfEvents);
|
||||
|
||||
G4ParticleDefinition* particle = primary->GetParticleGun()
|
||||
G4ParticleDefinition* particle = fPrimary->GetParticleGun()
|
||||
->GetParticleDefinition();
|
||||
G4String partName = particle->GetParticleName();
|
||||
G4double energy = primary->GetParticleGun()->GetParticleEnergy();
|
||||
G4double energy = fPrimary->GetParticleGun()->GetParticleEnergy();
|
||||
|
||||
G4double length = detector->GetSize();
|
||||
G4Material* material = detector->GetMaterial();
|
||||
G4double length = fDetector->GetSize();
|
||||
G4Material* material = fDetector->GetMaterial();
|
||||
G4double density = material->GetDensity();
|
||||
|
||||
G4cout << "\n ======================== run summary ======================\n";
|
||||
@@ -98,48 +106,48 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
|
||||
G4cout << "\n The run was: " << NbOfEvents << " " << partName << " of "
|
||||
<< G4BestUnit(energy,"Energy") << " through "
|
||||
<< G4BestUnit(length,"Length") << " of "
|
||||
<< material->GetName() << " (density: "
|
||||
<< G4BestUnit(density,"Volumic Mass") << ")" << G4endl;
|
||||
|
||||
<< G4BestUnit(length,"Length") << " of "
|
||||
<< material->GetName() << " (density: "
|
||||
<< G4BestUnit(density,"Volumic Mass") << ")" << G4endl;
|
||||
|
||||
G4cout << "\n ============================================================\n";
|
||||
|
||||
G4cout << "\n total energy deposit: "
|
||||
<< G4BestUnit(edep/dNbOfEvents, "Energy") << G4endl;
|
||||
|
||||
<< G4BestUnit(fEdep/dNbOfEvents, "Energy") << G4endl;
|
||||
|
||||
//nb of tracks and steps per event
|
||||
//
|
||||
G4cout << "\n nb tracks/event"
|
||||
<< " neutral: " << std::setw(10) << NbOfTraks0/dNbOfEvents
|
||||
<< " charged: " << std::setw(10) << NbOfTraks1/dNbOfEvents
|
||||
<< " neutral: " << std::setw(10) << fNbOfTraks0/dNbOfEvents
|
||||
<< " charged: " << std::setw(10) << fNbOfTraks1/dNbOfEvents
|
||||
<< "\n nb steps/event"
|
||||
<< " neutral: " << std::setw(10) << NbOfSteps0/dNbOfEvents
|
||||
<< " charged: " << std::setw(10) << NbOfSteps1/dNbOfEvents
|
||||
<< " neutral: " << std::setw(10) << fNbOfSteps0/dNbOfEvents
|
||||
<< " charged: " << std::setw(10) << fNbOfSteps1/dNbOfEvents
|
||||
<< G4endl;
|
||||
|
||||
//frequency of processes call
|
||||
std::map<G4String,G4int>::iterator it;
|
||||
G4cout << "\n nb of process calls per event: \n ";
|
||||
for (it = procCounter.begin(); it != procCounter.end(); it++)
|
||||
for (it = fProcCounter.begin(); it != fProcCounter.end(); it++)
|
||||
G4cout << std::setw(12) << it->first;
|
||||
|
||||
G4cout << "\n ";
|
||||
for (it = procCounter.begin(); it != procCounter.end(); it++)
|
||||
for (it = fProcCounter.begin(); it != fProcCounter.end(); it++)
|
||||
G4cout << std::setw(12) << (it->second)/dNbOfEvents;
|
||||
G4cout << G4endl;
|
||||
|
||||
//compute true and projected ranges, and transverse dispersion
|
||||
//
|
||||
trueRange /= NbOfEvents; trueRange2 /= NbOfEvents;
|
||||
G4double trueRms = trueRange2 - trueRange*trueRange;
|
||||
fTrueRange /= NbOfEvents; fTrueRange2 /= NbOfEvents;
|
||||
G4double trueRms = fTrueRange2 - fTrueRange*fTrueRange;
|
||||
if (trueRms>0.) trueRms = std::sqrt(trueRms); else trueRms = 0.;
|
||||
|
||||
projRange /= NbOfEvents; projRange2 /= NbOfEvents;
|
||||
G4double projRms = projRange2 - projRange*projRange;
|
||||
fProjRange /= NbOfEvents; fProjRange2 /= NbOfEvents;
|
||||
G4double projRms = fProjRange2 - fProjRange*fProjRange;
|
||||
if (projRms>0.) projRms = std::sqrt(projRms); else projRms = 0.;
|
||||
|
||||
transvDev /= 2*NbOfEvents; transvDev2 /= 2*NbOfEvents;
|
||||
G4double trvsRms = transvDev2 - transvDev*transvDev;
|
||||
fTransvDev /= 2*NbOfEvents; fTransvDev2 /= 2*NbOfEvents;
|
||||
G4double trvsRms = fTransvDev2 - fTransvDev*fTransvDev;
|
||||
if (trvsRms>0.) trvsRms = std::sqrt(trvsRms); else trvsRms = 0.;
|
||||
|
||||
//compare true range with csda range from PhysicsTables
|
||||
@@ -151,32 +159,36 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
|
||||
G4cout << "\n---------------------------------------------------------\n";
|
||||
G4cout << " Primary particle : " ;
|
||||
G4cout << "\n true Range = " << G4BestUnit(trueRange,"Length")
|
||||
G4cout << "\n true Range = " << G4BestUnit(fTrueRange,"Length")
|
||||
<< " rms = " << G4BestUnit(trueRms, "Length");
|
||||
|
||||
G4cout << "\n proj Range = " << G4BestUnit(projRange,"Length")
|
||||
G4cout << "\n proj Range = " << G4BestUnit(fProjRange,"Length")
|
||||
<< " rms = " << G4BestUnit(projRms, "Length");
|
||||
|
||||
G4cout << "\n proj/true = " << projRange/trueRange;
|
||||
|
||||
|
||||
G4cout << "\n proj/true = " << fProjRange/fTrueRange;
|
||||
|
||||
G4cout << "\n transverse dispersion at end = "
|
||||
<< G4BestUnit(trvsRms,"Length");
|
||||
|
||||
|
||||
G4cout << "\n mass true Range from simulation = "
|
||||
<< G4BestUnit(trueRange*density, "Mass/Surface")
|
||||
<< "\n from PhysicsTable (csda range) = "
|
||||
<< G4BestUnit(rangeTable*density, "Mass/Surface");
|
||||
<< G4BestUnit(fTrueRange*density, "Mass/Surface")
|
||||
<< "\n from PhysicsTable (csda range) = "
|
||||
<< G4BestUnit(rangeTable*density, "Mass/Surface");
|
||||
G4cout << "\n---------------------------------------------------------\n";
|
||||
G4cout << G4endl;
|
||||
|
||||
// reset default precision
|
||||
G4cout.precision(prec);
|
||||
|
||||
// remove all contents in procCounter
|
||||
procCounter.clear();
|
||||
// remove all contents in fProcCounter
|
||||
fProcCounter.clear();
|
||||
|
||||
//save histograms
|
||||
histoManager->save();
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
if ( analysisManager->IsActive() ) {
|
||||
analysisManager->Write();
|
||||
analysisManager->CloseFile();
|
||||
}
|
||||
|
||||
// show Rndm status
|
||||
CLHEP::HepRandom::showEngineStatus();
|
||||
|
||||
+30
-34
@@ -23,52 +23,48 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HistoMessenger.hh,v 1.4 2007-11-12 15:48:58 maire Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/src/StackingAction.cc
|
||||
/// \brief Implementation of the StackingAction class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef HistoMessenger_h
|
||||
#define HistoMessenger_h 1
|
||||
#include "StackingAction.hh"
|
||||
#include "HistoManager.hh"
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4Track.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class HistoManager;
|
||||
class G4UIdirectory;
|
||||
class G4UIcommand;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
StackingAction::StackingAction()
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class HistoMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
|
||||
HistoMessenger(HistoManager* );
|
||||
~HistoMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand* ,G4String );
|
||||
|
||||
private:
|
||||
|
||||
HistoManager* histoManager;
|
||||
|
||||
G4UIdirectory* histoDir;
|
||||
G4UIcmdWithAString* factoryCmd;
|
||||
G4UIcmdWithAString* typeCmd;
|
||||
G4UIcmdWithAString* optionCmd;
|
||||
G4UIcommand* histoCmd;
|
||||
G4UIcmdWithAnInteger* prhistoCmd;
|
||||
G4UIcmdWithAnInteger* rmhistoCmd;
|
||||
|
||||
};
|
||||
StackingAction::~StackingAction()
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
G4ClassificationOfNewTrack
|
||||
StackingAction::ClassifyNewTrack(const G4Track* track)
|
||||
{
|
||||
//keep primary particle
|
||||
if (track->GetParentID() == 0) return fUrgent;
|
||||
|
||||
//
|
||||
//energy spectrum of secondaries
|
||||
//
|
||||
G4double energy = track->GetKineticEnergy();
|
||||
G4double charge = track->GetDefinition()->GetPDGCharge();
|
||||
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
|
||||
if (charge != 0.) analysisManager->FillH1(5,energy);
|
||||
else analysisManager->FillH1(6,energy);
|
||||
return fUrgent;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: StepMax.cc,v 1.2 2006-06-29 16:37:27 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/src/StepMax.cc
|
||||
/// \brief Implementation of the StepMax class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -35,14 +37,14 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
StepMax::StepMax(const G4String& processName)
|
||||
: G4VDiscreteProcess(processName),MaxChargedStep(DBL_MAX)
|
||||
: G4VDiscreteProcess(processName),fMaxChargedStep(DBL_MAX)
|
||||
{
|
||||
pMess = new StepMaxMessenger(this);
|
||||
fMess = new StepMaxMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
StepMax::~StepMax() { delete pMess; }
|
||||
StepMax::~StepMax() { delete fMess; }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -53,7 +55,7 @@ G4bool StepMax::IsApplicable(const G4ParticleDefinition& particle)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void StepMax::SetMaxStep(G4double step) {MaxChargedStep = step;}
|
||||
void StepMax::SetMaxStep(G4double step) {fMaxChargedStep = step;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -64,7 +66,7 @@ G4double StepMax::PostStepGetPhysicalInteractionLength( const G4Track&,
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
return MaxChargedStep;
|
||||
return fMaxChargedStep;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: StepMaxMessenger.cc,v 1.2 2006-06-29 16:37:29 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/src/StepMaxMessenger.cc
|
||||
/// \brief Implementation of the StepMaxMessenger class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -37,28 +39,28 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
StepMaxMessenger::StepMaxMessenger(StepMax* stepM)
|
||||
:stepMax(stepM)
|
||||
:fStepMax(stepM)
|
||||
{
|
||||
StepMaxCmd = new G4UIcmdWithADoubleAndUnit("/testem/stepMax",this);
|
||||
StepMaxCmd->SetGuidance("Set max allowed step length");
|
||||
StepMaxCmd->SetParameterName("mxStep",false);
|
||||
StepMaxCmd->SetRange("mxStep>0.");
|
||||
StepMaxCmd->SetUnitCategory("Length");
|
||||
fStepMaxCmd = new G4UIcmdWithADoubleAndUnit("/testem/stepMax",this);
|
||||
fStepMaxCmd->SetGuidance("Set max allowed step length");
|
||||
fStepMaxCmd->SetParameterName("mxStep",false);
|
||||
fStepMaxCmd->SetRange("mxStep>0.");
|
||||
fStepMaxCmd->SetUnitCategory("Length");
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
StepMaxMessenger::~StepMaxMessenger()
|
||||
{
|
||||
delete StepMaxCmd;
|
||||
delete fStepMaxCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void StepMaxMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if (command == StepMaxCmd)
|
||||
{ stepMax->SetMaxStep(StepMaxCmd->GetNewDoubleValue(newValue));}
|
||||
if (command == fStepMaxCmd)
|
||||
{ fStepMax->SetMaxStep(fStepMaxCmd->GetNewDoubleValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: SteppingAction.cc,v 1.8 2006-06-29 16:37:31 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/src/SteppingAction.cc
|
||||
/// \brief Implementation of the SteppingAction class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -39,25 +41,27 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
SteppingAction::SteppingAction(RunAction* run, EventAction* event, HistoManager* histo)
|
||||
:runAction(run), eventAction(event), histoManager(histo)
|
||||
SteppingAction::SteppingAction(RunAction* run, EventAction* event)
|
||||
:fRunAction(run), fEventAction(event)
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void SteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
{
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
|
||||
G4double EdepStep = aStep->GetTotalEnergyDeposit();
|
||||
if (EdepStep > 0.) { runAction->AddEdep(EdepStep);
|
||||
eventAction->AddEdep(EdepStep);
|
||||
if (EdepStep > 0.) { fRunAction->AddEdep(EdepStep);
|
||||
fEventAction->AddEdep(EdepStep);
|
||||
}
|
||||
const G4VProcess* process = aStep->GetPostStepPoint()->GetProcessDefinedStep();
|
||||
if (process) runAction->CountProcesses(process->GetProcessName());
|
||||
if (process) fRunAction->CountProcesses(process->GetProcessName());
|
||||
|
||||
// step length of primary particle
|
||||
G4int ID = aStep->GetTrack()->GetTrackID();
|
||||
G4double steplen = aStep->GetStepLength();
|
||||
if (ID == 1) histoManager->FillHisto(3,steplen);
|
||||
if (ID == 1) analysisManager->FillH1(3,steplen);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm1/src/SteppingVerbose.cc
|
||||
/// \brief Implementation of the SteppingVerbose class
|
||||
//
|
||||
// $Id: SteppingVerbose.cc,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -58,26 +60,26 @@ void SteppingVerbose::StepInfo()
|
||||
if( verboseLevel >= 3 ){
|
||||
G4cout << G4endl;
|
||||
G4cout << std::setw( 5) << "#Step#" << " "
|
||||
<< std::setw( 6) << "X" << " "
|
||||
<< std::setw( 6) << "Y" << " "
|
||||
<< std::setw( 6) << "Z" << " "
|
||||
<< std::setw( 9) << "KineE" << " "
|
||||
<< std::setw( 9) << "dEStep" << " "
|
||||
<< std::setw(10) << "StepLeng"
|
||||
<< std::setw(10) << "TrakLeng"
|
||||
<< std::setw(10) << "Volume" << " "
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
<< std::setw( 6) << "X" << " "
|
||||
<< std::setw( 6) << "Y" << " "
|
||||
<< std::setw( 6) << "Z" << " "
|
||||
<< std::setw( 9) << "KineE" << " "
|
||||
<< std::setw( 9) << "dEStep" << " "
|
||||
<< std::setw(10) << "StepLeng"
|
||||
<< std::setw(10) << "TrakLeng"
|
||||
<< std::setw(10) << "Volume" << " "
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
}
|
||||
|
||||
G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
||||
<< std::setw(10) << fTrack->GetVolume()->GetName();
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
||||
<< std::setw(10) << fTrack->GetVolume()->GetName();
|
||||
|
||||
const G4VProcess* process
|
||||
= fStep->GetPostStepPoint()->GetProcessDefinedStep();
|
||||
@@ -89,28 +91,28 @@ void SteppingVerbose::StepInfo()
|
||||
|
||||
if( verboseLevel == 2 ){
|
||||
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
|
||||
fN2ndariesAlongStepDoIt +
|
||||
fN2ndariesPostStepDoIt;
|
||||
fN2ndariesAlongStepDoIt +
|
||||
fN2ndariesPostStepDoIt;
|
||||
if(tN2ndariesTot>0){
|
||||
G4cout << "\n :----- List of secondaries ----------------"
|
||||
<< G4endl;
|
||||
G4cout << "\n :----- List of secondaries ----------------"
|
||||
<< G4endl;
|
||||
G4cout.precision(4);
|
||||
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
|
||||
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
|
||||
lp1<(*fSecondary).size(); lp1++){
|
||||
G4cout << " "
|
||||
<< std::setw(13)
|
||||
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
|
||||
<< ": energy ="
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
|
||||
<< " time ="
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time");
|
||||
G4cout << G4endl;
|
||||
}
|
||||
G4cout << " "
|
||||
<< std::setw(13)
|
||||
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
|
||||
<< ": energy ="
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
|
||||
<< " time ="
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time");
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
G4cout << " :------------------------------------------\n"
|
||||
<< G4endl;
|
||||
G4cout << " :------------------------------------------\n"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,25 +131,25 @@ G4int prec = G4cout.precision(3);
|
||||
|
||||
G4cout << std::setw( 5) << "Step#" << " "
|
||||
<< std::setw( 6) << "X" << " "
|
||||
<< std::setw( 6) << "Y" << " "
|
||||
<< std::setw( 6) << "Z" << " "
|
||||
<< std::setw( 9) << "KineE" << " "
|
||||
<< std::setw( 9) << "dEStep" << " "
|
||||
<< std::setw(10) << "StepLeng"
|
||||
<< std::setw(10) << "TrakLeng"
|
||||
<< std::setw(10) << "Volume" << " "
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
<< std::setw( 6) << "Y" << " "
|
||||
<< std::setw( 6) << "Z" << " "
|
||||
<< std::setw( 9) << "KineE" << " "
|
||||
<< std::setw( 9) << "dEStep" << " "
|
||||
<< std::setw(10) << "StepLeng"
|
||||
<< std::setw(10) << "TrakLeng"
|
||||
<< std::setw(10) << "Volume" << " "
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
|
||||
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
||||
<< std::setw(10) << fTrack->GetVolume()->GetName()
|
||||
<< " initStep" << G4endl;
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
||||
<< std::setw(10) << fTrack->GetVolume()->GetName()
|
||||
<< " initStep" << G4endl;
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: TrackingAction.cc,v 1.10 2006-06-29 16:37:36 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
/// \file electromagnetic/TestEm1/src/TrackingAction.cc
|
||||
/// \brief Implementation of the TrackingAction class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -38,9 +40,8 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
TrackingAction::TrackingAction(PrimaryGeneratorAction* prim, RunAction* run,
|
||||
HistoManager* histo)
|
||||
:primary(prim), runAction(run), histoManager(histo)
|
||||
TrackingAction::TrackingAction(PrimaryGeneratorAction* prim, RunAction* run)
|
||||
:fPrimary(prim), fRunAction(run)
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -56,32 +57,33 @@ void TrackingAction::PreUserTrackingAction(const G4Track*)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
|
||||
{
|
||||
{
|
||||
//increase nb of processed tracks
|
||||
//count nb of steps of this track
|
||||
G4int nbSteps = aTrack->GetCurrentStepNumber();
|
||||
G4double Trleng = aTrack->GetTrackLength();
|
||||
|
||||
if (aTrack->GetDefinition()->GetPDGCharge() == 0.) {
|
||||
runAction->CountTraks0(1);
|
||||
runAction->CountSteps0(nbSteps);
|
||||
fRunAction->CountTraks0(1);
|
||||
fRunAction->CountSteps0(nbSteps);
|
||||
|
||||
} else {
|
||||
runAction->CountTraks1(1);
|
||||
runAction->CountSteps1(nbSteps);
|
||||
fRunAction->CountTraks1(1);
|
||||
fRunAction->CountSteps1(nbSteps);
|
||||
}
|
||||
|
||||
//true and projected ranges for primary particle
|
||||
if (aTrack->GetTrackID() == 1) {
|
||||
runAction->AddTrueRange(Trleng);
|
||||
G4ThreeVector vertex = primary->GetParticleGun()->GetParticlePosition();
|
||||
fRunAction->AddTrueRange(Trleng);
|
||||
G4ThreeVector vertex = fPrimary->GetParticleGun()->GetParticlePosition();
|
||||
G4ThreeVector position = aTrack->GetPosition() - vertex;
|
||||
runAction->AddProjRange(position.x());
|
||||
runAction->AddTransvDev(position.y());
|
||||
runAction->AddTransvDev(position.z());
|
||||
fRunAction->AddProjRange(position.x());
|
||||
fRunAction->AddTransvDev(position.y());
|
||||
fRunAction->AddTransvDev(position.z());
|
||||
|
||||
histoManager->FillHisto(1,Trleng);
|
||||
histoManager->FillHisto(2,(float)nbSteps);
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
analysisManager->FillH1(1,Trleng);
|
||||
analysisManager->FillH1(2,(float)nbSteps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@
|
||||
# as markers 2 pixels wide:
|
||||
/vis/scene/add/trajectories smooth
|
||||
/vis/modeling/trajectories/create/drawByCharge
|
||||
#/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
|
||||
#/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
|
||||
/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:
|
||||
|
||||
Reference in New Issue
Block a user