Import Geant4 6.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:56:29 +02:00
parent 1d812b78b1
commit e083ffb441
1415 changed files with 111223 additions and 21207 deletions
+13 -4
View File
@@ -1,6 +1,6 @@
# $Id: GNUmakefile,v 1.5 2003/12/08 17:53:25 gcosmo Exp $
# $Id: GNUmakefile,v 1.6 2004/06/09 15:04:34 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-06-00-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# --------------------------------------------------------------
@@ -10,17 +10,26 @@ TIARA_SRC_SWIG_DIRS = CLHEPWrapper G4KernelWrapper TiaraWrapper
include $(G4INSTALL)/config/architecture.gmk
.PHONY: Tiara tiaraClean swigClean all
.PHONY: Tiara tiaraClean swigClean clean_all all
all: Tiara
#ifdef G4ANALYSIS_USE
# CPPFLAGS += `aida-config --include`
# LDFLAGS += `aida-config --lib`
# LDLIBS += `aida-config --lib`
#endif
Tiara:
@for dir in $(TIARA_SRC_DIRS); do ( cd source/$$dir && $(MAKE)); done;:
@for dir in $(TIARA_SRC_SWIG_DIRS); do ( cd source/$$dir && $(MAKE)); done;:
clean_all: swigClean tiaraClean
@rm -f source/py_modules/*.pyc
@rm -rf run/simData
tiaraClean:
@for dir in $(TIARA_SRC_DIRS); do ( cd source/$$dir && $(MAKE) tiaraClean); done;:
@for dir in $(TIARA_SRC_SWIG_DIRS); do ( cd source/$$dir && $(MAKE) tiaraClean); done;:
swigClean:
@for dir in $(TIARA_SRC_SWIG_DIRS); do ( cd source/$$dir && $(MAKE) swigClean); done;:
+7 -2
View File
@@ -1,6 +1,6 @@
# $Id: History,v 1.18 2003/12/09 08:48:33 daquinog Exp $
# $Id: History,v 1.19 2004/06/09 15:04:34 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-06-00-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
=========================================================
@@ -18,6 +18,11 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Jun 9th, 2004 G.Daquino - Tiara-V06-01-00
- Passing from Anaphe to PI, Tiara has been partly fixed. Still problems
are present on the compatibility between the PI and Anaphe pointers for hf.
However, runSimNoAnalysis.py works correctly, being independent of the
analysis tool.
Dec 9th, 2003 G.Daquino - Tiara-V05-02-06
- Fixed implementation of TiaraPrimaryGeneratorAction, where copy
+37 -43
View File
@@ -1,6 +1,6 @@
# $Id: README,v 1.15 2003/12/08 17:53:25 gcosmo Exp $
# $Id: README,v 1.18 2004/06/13 13:35:12 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-06-00-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
Simulation of the TIARA experiment using importance sampling
@@ -16,7 +16,7 @@ created by 43 MeV and 68 MeV protons bombarding a 7Li target are measured
behind several shields. The simulation starts from the neutron spectra.
In this example the interactions of the neutrons with the (concrete)
shields are simulated and energy dependent neutron fluxes are measured
behind the shields. Users may chose to run the simulation for different
behind the shields. Users may choose to run the simulation for different
shielding configuration with or without importance sampling.
The simulated neutron fluxes are compared to the published
experimental data. The efficiency of applying importance sampling
@@ -28,9 +28,9 @@ For Application Developers", Chapter "Toolkit Fundamentals"
Section "Event Biasing Techniques" and references there.
The example has been tested on CERN RH 7.3 with the
gcc-3.2 and gcc-2.95.2 compilers.
gcc-3.2.3 and gcc-2.95.2 compilers.
Note for system testing without analysis: see points 1, 1.3 and 3.2.
Note for system testing without analysis: see points 1.1, 1.3 and 3.2.
@@ -41,51 +41,43 @@ Note for system testing without analysis: see points 1, 1.3 and 3.2.
You must compile Geant4 with:
"G4LIB_BUILD_SHARED" set to 1.
You need to set:
"NeutronHPCrossSections" (e.g. to ${G4INSTALL}/data/G4NDL3.7)
"NeutronHPCrossSections" (e.g. pointing to a directory containing G4NDL3.7)
Three examples are given of how to set environment variables
in the three cases:
1.1) Anaphe via AFS (most simple):
1.1) PI via AFS (most simple):
--------------------
You have access to afs and you want to use Anaphe for the
You have access to afs and you want to use PI for the
analysis:
Set the following environment variables:
"G4ANALYSIS_USE"
"PI_BASE_DIR" (where PI has been installed)
"SWIG_BASE_DIR" (where SWIG has been installed)
"ANAPHETOP" (e.g. /afs/cern.ch/sw/lhcxx)
"AIDA_DIR" (e.g. /afs/cern.ch/sw/contrib/AIDA/3.0/src/cpp)
"ANAPHE_SCRIPTS" (e.g. /afs/cern.ch/sw/lhcxx/share/LHCXX/5.0.6/scripts)
Finally source the script envCommon.csh from the directory
you have Tiara installed, e.g. ${G4INSTALL}/examples/advanced/Tiara
Finally source the script envCommon.csh from the directory where you have Tiara
installed, e.g. ${G4INSTALL}/examples/advanced/Tiara
1.2) No afs but a local Anaphe and AIDA installation:
1.2) No afs but a local PI and SWIG installation:
-----------------------------------------------------
You don't use afs but you have a local installation of Anaphe and AIDA
(e.g. from http://anaphe.web.cern.ch/anaphe/.
You don't use afs but you have a local installation of SWIG and PI
Set the following environment variables:
"G4ANALYSIS_USE"
"ANAPHETOP" (e.g. <directory>/Anaphe/release)
"AIDA_DIR" (e.g. <directory>/AIDA/3.0.0/3.0.0/AIDA/3.0/src/cpp)
"ANAPHE_SCRIPTS" (e.g. ${ANAPHETOP}/share/LHCXX/5.0.6/scripts)
"PI_BASE_DIR"
"SWIG_BASE_DIR"
here <directory> is a place holder for your directory with the
respective installations of Anaphe and AIDA
Finally source the script envCommon.csh from the directory
Finally source the script envCommon.csh from the directory where
you have Tiara installed, e.g. ${G4INSTALL}/examples/advanced/Tiara
1.3) No afs, no Anaphe and no AIDA (e.g. for system testing):
1.3) No afs, no PI and no SWIG (e.g. for system testing):
-------------------------------------------------------------
You don't want to use Anaphe and AIDA and you don't have afs access.
Make sure "G4ANALYSIS_USE" is unset (e.g. unsetenv G4ANALYSIS_USE).
Note: python must be built against a "libc".
You don't want to use PI and SWIG and you don't have afs access.
Make sure "G4ANALYSIS_USE" is unset (e.g. unsetenv G4ANALYSIS_USE)
Note 1: python must be built against a "libc".
You may do this by creating a shared library by a command
similar to this
"ld -shared -o libpython2.2.so --whole-archive libpython2.2.a /usr/lib/libc.so"
@@ -97,16 +89,21 @@ in the three cases:
"SWIG_BASE_DIR" (e.g. /usr)
"CLHEP_BASE_DIR" (e.g. to /opt/local)
Finally source the script envCommon.csh from the directory
Finally source the script envCommon.csh from the directory where
you have Tiara installed, e.g. ${G4INSTALL}/examples/advanced/Tiara
Note 2: Passing from a simulation WITH to another WITHOUT analysis implies
that the G4ANALYSIS_use should be unset and that the SWIG-wrapper scripts
in the directory TiaraWrapper should be deleted. Normally, the whole code
should be compiled again using gmake tiaraClean and, afterwards, gmake.
The same procedure should be followed also passing from a simulation WITHOUT
to another WITH analysis.
2) Building the example
=======================
Geant4 has to be compiled using G4LIB_BUILD_SHARED 1 and the one of the
above environment settings have to be set.
Type "gmake".
@@ -116,10 +113,7 @@ Type "gmake".
Geant4 must be compiled into granular shared libraries.
Therefore before compiling Geant4 set "G4LIB_BUILD_SHARED" to "1".
External packages used in this example are Anaphe, SWIG and Python.
The Anaphe package comes with SWIG and Python versions used to build
Anaphe itself. These SWIG and Python versions should also be used with
this example if Anaphe is used.
External packages used in this example are PI, SWIG and Python.
2.2) Cleaning up
@@ -134,10 +128,10 @@ $G4WORKDIR/tmp/$G4SYSTEM/ use "gmake tiaraClean".
=======================
3.1) Using Anaphe
3.1) Using PI
-----------------
Change to the sub directory "run" and execute "runSim.py".
"runSim.py" runs an example configuration which nay be
"runSim.py" runs an example configuration which may be
changed by the user. The results of the simulation are stored in
the directory "simData".
The script "runSim.py" periodically prints scoring information to the
@@ -146,8 +140,8 @@ It also prints out the relative path of a ".shelve" file.
This file can be used to access results of the simulation.
In case the example was build using analysis
results may be viewed e.g. using lizard and scripts:
1) Start python2.2 or lizard
results may be viewed e.g. using python or ROOT:
1) Start python2.2
2) type: import dataAcess
3) type: p = dataAcess.ExpMcPlot (shelveFileName,detectorposition)
where "shelveFileName" is the name (enclosed in quotes) of the
@@ -184,7 +178,7 @@ set the print out period to 30 minutes by setting:
3.2) Not using Anaphe (mainly for system testing)
3.2) Not using PI (mainly for system testing)
-------------------------------------------------
Change to the sub directory "run" and execute
runSimNoAnalysis.py.
@@ -197,7 +191,7 @@ runSimNoAnalysis.py.
============================
simCommon.csh - a script to setup environment variables
envCommon.csh - a script to setup environment variables
in case the above one of the above environment settings have been
done beforehand.
+25 -27
View File
@@ -1,6 +1,6 @@
# $Id: envCommon.csh,v 1.8 2003/12/08 17:53:26 gcosmo Exp $
# $Id: envCommon.csh,v 1.9 2004/06/09 15:04:34 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-06-00-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
# Before sourcing this script make sure you have set the
# environment variables according to the description in README.
@@ -8,44 +8,38 @@
# setup in case Anaphe is used --------------------------------------
if (${?ANAPHE_SCRIPTS} == 1 && ${?ANAPHETOP} == 1 && ${?AIDA_DIR} == 1 ) then
if (${?PI_BASE_DIR} == 1 && ${?SWIG_BASE_DIR} == 1) then
if ( -f $ANAPHE_SCRIPTS/setupAnaphe.csh ) then
source $ANAPHE_SCRIPTS/setupAnaphe.csh
else if ( -f $ANAPHE_SCRIPTS/setup-Anaphe.csh) then
source $ANAPHE_SCRIPTS/setup-Anaphe.csh
else
echo "envCommon.csh: ERROR: could not find a setup file for anaphe"
exit
endif
setenv PATH ${ANAPHE_SCRIPTS}:$PATH
setenv ANAPHESPECDIR `(cd $ANAPHE_REL_DIR/../; pwd)`
setenv PI_VERSION 1_2_1
setenv PI_VER 1.2.1
setenv PI_ARCH rh73_gcc32
setenv PATH ${PATH}:${PI_BASE_DIR}/${PI_VER}/app/releases/PI/PI_${PI_VER}/${PI_ARCH}/bin
setenv PATH ${PI_BASE_DIR}/Linux-g++/bin:$PATH
eval `aida-config -r csh`
#
# python from Anaphe
# python from PI
#
setenv PYTHONVERSION 2.2
setenv PYTHON_INCLUDE_DIR ${ANAPHESPECDIR}/PublicDomainPackages/2.0.0/include/python${PYTHONVERSION}
setenv PYTHON_LIB_DIR ${ANAPHESPECDIR}/PublicDomainPackages/2.0.0/lib/python${PYTHONVERSION}/config
setenv PYTHON_INCLUDE_DIR ${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PI_ARCH}/include/python${PYTHONVERSION}
setenv PYTHON_LIB_DIR ${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PI_ARCH}/lib/python${PYTHONVERSION}/config
#
# python for PI
if (${?PYTHONPATH} == 0) then
setenv PYTHONPATH
endif
setenv PYTHONPATH ${PI_BASE_DIR}/Linux-g++/python:$PYTHONPATH
setenv PYTHONPATH ${PI_BASE_DIR}/${PI_VER}/app/releases/SEAL/SEAL_1_3_4/rh73_gcc32/lib:$PYTHONPATH
#
# setup the swig command
#
setenv SWIG_VERSION 1.3.15
setenv SWIG_BASE_DIR ${ANAPHESPECDIR}/PublicDomainPackages/2.0.0
setenv SWIG_INCDIRS "-I${SWIG_BASE_DIR}/lib/swig-${SWIG_VERSION} -I${SWIG_BASE_DIR}/lib/swig-${SWIG_VERSION}/python"
setenv SWIG ${SWIG_BASE_DIR}/bin/swig-${SWIG_VERSION}
#
# CLHEP from Anaphe (shared libraries are required)
#
setenv CLHEP_BASE_DIR ${ANAPHETOP}/specific/${PLATF}/CLHEP/1.8.0.0
#
# add scripts path to PATH
#
setenv PATH ${ANAPHETOP}/share/LHCXX/${ANAPHE_VERSION}/scripts:${PATH}
else # not using Anaphe
echo "-- WARNING: histograms are not activated !"
echo " Either ANAPHE_SCRIPTS, ANAPHETOP or AIDA_DIR are not set."
echo " Either PI_BASE_DIR or SWIG_BASE_DIR are not set."
#
if ( ${?PYTHONVERSION} == 1 && \
${?PYTHON_BASE_DIR} == 1 && \
@@ -75,7 +69,7 @@ else # not using Anaphe
exit
endif
endif # end settings for not using Anaphe
endif # end settings for not using PI
#
# common settings
@@ -92,6 +86,9 @@ setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${G4WORKDIR}/tmp/${G4SYSTEM}/tiaraPhys
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${G4WORKDIR}/tmp/${G4SYSTEM}/tiaraPhysicsLists
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${G4WORKDIR}/lib/${G4SYSTEM}
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${PYTHON_LIB_DIR}
setenv LD_LIBRARY_PATH ${PI_BASE_DIR}/${PI_VER}/app/releases/SEAL/SEAL_1_3_4/rh73_gcc32/lib:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH /afs/cern.ch/sw/lcg/external/Python/2.2.2/rh73_gcc32/lib:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH ${PI_BASE_DIR}/${PI_VER}/external/Boost/1.30.2/rh73_gcc32/lib:$LD_LIBRARY_PATH
setenv TIARA_BASE `pwd`
setenv TIARASCRIPTS ${TIARA_BASE}/source/py_modules
if (${?PYTHONPATH} == 0) then
@@ -102,3 +99,4 @@ setenv PYTHONPATH ${PYTHONPATH}:${TIARA_BASE}/run:${TIARASCRIPTS}
setenv PYTHONPATH ${PYTHONPATH}:${TIARA_BASE}/source/TiaraWrapper
setenv PYTHONPATH ${PYTHONPATH}:${TIARA_BASE}/source/G4KernelWrapper
setenv PYTHONPATH ${PYTHONPATH}:${TIARA_BASE}/source/CLHEPWrapper
#
+2 -9
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env python2.2
#
# $Id: runSim.py,v 1.7 2003/06/20 12:41:06 dressel Exp $
# $Id: runSim.py,v 1.8 2004/06/09 15:04:35 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-05-02-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
# importing python libraries
@@ -96,7 +96,6 @@ comment = ""
##########################################################################
# this should be fine for most settings
experiment = tiaraSpecifications.Experiment(beamEnergy,
particleCut["neutron"],
particleCut,
@@ -159,10 +158,8 @@ impScorer = G4Kernel.G4Scorer()
##########################################################################
# this and the remaining part should be fine for most settings
tApp = tiaraApplication.TiaraApplet(tiaraSpecs,
Tiara.TiaraSim_GetTiaraSim())
if totalTime == 0:
tApp.visMode()
else:
@@ -173,18 +170,14 @@ tApp.specifyPhysicsList(physList, particleCut)
# detectors
tApp.setScoreDetectorCreator(scoreDetectorCreator)
tApp.buildGeometry()
tiara_dir = os.environ["TIARA_BASE"]
primGenBuilder = tiaraGenerators.\
TiaraDPSEnergyGenerator(tiaraSpecs,
tiara_dir +
"/data/expDataConverted/dpsSource.xml")
#primGenBuilder = tiaraGenerators.TiaraPrimaryGenerator(tiaraSpecs)
#primGenBuilder = tiaraGenerators.FixedEnergyPrimaryGenerator(tiaraSpecs)
tApp.setPrimaryGenerator(primGenBuilder.primGen)
@@ -1,8 +1,8 @@
#!/usr/bin/env python2.2
#
# $Id: runSimNoAnalysis.py,v 1.3 2003/06/20 12:41:06 dressel Exp $
# $Id: runSimNoAnalysis.py,v 1.4 2004/06/09 15:04:35 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-05-02-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
@@ -124,7 +124,7 @@ impScorer = G4Kernel.G4Scorer()
##########################################################################
tApp = tiaraApplication.TiaraApplet(tiaraSpecs = tiaraSpecs,
tSim = Tiara.TiaraSim_GetTiaraSim(),
useLizard = False)
usePI = False)
#tApp.visMode()
@@ -190,7 +190,7 @@ rc.impScorer = impScorer
rc.totalTime = totalTime
rc.comment = comment
rs = runSequence.RunSequence(runConfig=rc, useLizard = False)
rs = runSequence.RunSequence(runConfig=rc, usePI = False)
rs.runNevents(100)
rs.runLoop()
+3 -2
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env python2.2
#
# $Id: runVisMode.py,v 1.3 2003/06/20 12:41:06 dressel Exp $
# $Id: runVisMode.py,v 1.4 2004/06/09 15:04:35 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-05-02-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
@@ -11,6 +11,7 @@ import os
# importing wrapper modules (see the source/*Wrapper directories)
# created by swig (from the source/*Wrapper/*.i files).
import CLHEP
import Tiara
import G4Kernel
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.1.1.1 2003/06/12 13:08:24 dressel Exp $
# $Id: GNUmakefile,v 1.2 2004/06/09 15:04:35 daquinog Exp $
# --------------------------------------------------------------
# GNUmakefile Michael Dressel
# --------------------------------------------------------------
@@ -46,3 +46,4 @@ LDLIBS += -lpython$(PYTHONVERSION) \
tiaraClean:
@echo Cleaning up $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)
@rm -rf $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)
@rm -f *.pyc
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.5 2003/12/08 17:53:26 gcosmo Exp $
# $Id: GNUmakefile,v 1.6 2004/06/09 15:04:35 daquinog Exp $
# --------------------------------------------------------------
# GNUmakefile Michael Dressel
# --------------------------------------------------------------
@@ -43,4 +43,4 @@ LDLIBS += -lpython$(PYTHONVERSION) \
tiaraClean:
@echo Cleaning up $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)
@rm -rf $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)
@rm -f *.pyc
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.6 2003/12/08 17:53:26 gcosmo Exp $
# $Id: GNUmakefile,v 1.7 2004/06/09 15:04:35 daquinog Exp $
# --------------------------------------------------------------
# GNUmakefile Michael Dressel
# --------------------------------------------------------------
@@ -46,10 +46,10 @@ all: $(copyDeps) $(SWIGSO)
include $(G4INSTALL)/config/binmake.gmk
ifdef G4ANALYSIS_USE
CPPFLAGS += `$(ANAPHE_SCRIPTS)/aida-config -i`
CPPFLAGS += `aida-config --include`
# LDFLAGS += `aida-config --lib`
endif
CPPFLAGS += -I$(TIARA_BASE)/source/tiara/include\
-I$(PYTHON_INCLUDE_DIR) \
-I$(TIARA_BASE)/source/tiaraPhysicsPackaging/include \
@@ -65,7 +65,7 @@ LDLIBS1 += -ltiaraPhysicsLists \
-ltiaraPhysicsPackaging-handMade
ifdef G4ANALYSIS_USE
LDLIBS += `$(ANAPHE_SCRIPTS)/aida-config -l`
LDLIBS += `aida-config --lib`
endif
LDLIBS += -lpython$(PYTHONVERSION) \
@@ -89,4 +89,4 @@ tiaraClean:
@echo Cleaning up $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)
@echo $(tiaraDeps)
@rm -rf $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)
@rm -f *.pyc
@@ -1,445 +0,0 @@
# $Id: liz.py,v 1.2 2003/06/16 17:06:44 dressel Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-05-02-patch-01 $
# -------------------------------------------------------------------
#
import os, sys, string
if ( not os.environ.has_key("ANAPHETOP") ) :
os.environ["ANAPHETOP"] = "/afs/cern.ch/sw/lhcxx"
if ( not os.environ.has_key("PLATF") ) :
os.environ["PLATF"] = "redhat73/gcc-3.2"
if ( not os.environ.has_key("ANAPHE_VERSION") ) :
if ( not os.environ.has_key("ANAPHEVERS") ) :
os.environ["ANAPHEVERS"] = "5.0.4"
else :
os.environ["ANAPHEVERS"] = os.environ["ANAPHE_VERSION"]
if ( not os.environ.has_key("PUBDOMVERS") ) :
os.environ["PUBDOMVERS"] = "2.0.0"
if ( not os.environ.has_key("ANAPHE_REL_DIR") ) :
os.environ["ANAPHE_REL_DIR"] = os.environ["ANAPHETOP"]+"/specific/"+os.environ["PLATF"]+"/"+os.environ["ANAPHEVERS"]
if ( not os.environ.has_key("OS") ) :
os.environ["OS"] = "Linux" # for now !!!
# for debugging purposes this might be set differently ...
if ( not os.environ.has_key("LIZARD_ROOT") ) :
os.environ["LIZARD_ROOT"] = os.environ["ANAPHE_REL_DIR"] + "/python"
os.environ["LIZARD_LIB"] = os.environ["LIZARD_ROOT"] + "/lib"
#-toDo: clean up the LD_LIBRARY_PATH, PATH and PYTHONPATH variables from wrong versions
# of Anaphe s/w
#export LD_LIBRARY_PATH=`${LIZARD_ROOT}/bin/cleanupPath.py LD_LIBRARY_PATH`
#export PATH=`${LIZARD_ROOT}/bin/cleanupPath.py PATH`
#export PYTHONPATH=`${LIZARD_ROOT}/bin/cleanupPath.py PYTHONPATH`
# add to path in order to find xmgrace ...
if (not os.environ.has_key("GRACE_DIR") ) :
os.environ["GRACE_DIR"] = os.environ["ANAPHETOP"]+"/specific/"+os.environ["PLATF"]+"/PublicDomainPackages/" + os.environ["PUBDOMVERS"] + "/grace"
os.environ["PATH"] = os.environ["GRACE_DIR"] + "/bin:" + os.environ["PATH"]
os.environ["LD_LIBRARY_PATH"] = os.environ["LD_LIBRARY_PATH"] + ":" + os.environ["LIZARD_LIB"] + ":" + os.environ["ANAPHE_REL_DIR"] + "/lib"
# toDo:
# if [ `uname` = "SunOS" ] ; then
# SUN_CC_DIR=/afs/cern.ch/project/sun/solaris/opt/SUNWspro62Apr02
# export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${SUN_CC_DIR}/lib:/usr/local/lib # /opt/SUNWspro/lib:/usr/local/lib:/opt/SUNWspro/WS6U1/lib
# fi
#
# to find the proper versions of libs for python-2.0 and swig-1.3a5
# (it should be SWIG_DIR)
if (not os.environ.has_key("SWIG_DIR")) :
os.environ["SWIG_DIR"] = os.environ["ANAPHETOP"]+"/specific/"+os.environ["PLATF"]+"/PublicDomainPackages/" + os.environ["PUBDOMVERS"]
os.environ["LD_LIBRARY_PATH"] = os.environ["SWIG_DIR"] + "/lib:" + os.environ["LD_LIBRARY_PATH"]
# need to add "." for automatic code compilation (ntuples et al)
os.environ["LD_LIBRARY_PATH"] = os.environ["LD_LIBRARY_PATH"] + ":" + os.environ["LIZARD_ROOT"] + "/" + os.environ["PLATF"] + ":."
# add to PYTHONPATH
sys.path.append(os.environ["LIZARD_LIB"])
sys.path.append(os.environ["LIZARD_ROOT"] + "/" + os.environ["PLATF"])
sys.path.append(os.environ["LIZARD_ROOT"] + "/src")
sys.path.append(os.environ["HOME"])
sys.path.append(os.environ["LIZARD_ROOT"] + "/contrib")
# toDo
#if [ -z $LIZARD_NO_PUBLIC_CONTRIB ] ; then
# export PYTHONPATH=${PYTHONPATH}:${ANAPHETOP}/share/PythonContrib
#fi
# # define location of python
# if [ -z $PYDIR ] ; then
# export PYDIR=${ANAPHETOP}/specific/${PLATF}/PublicDomainPackages/${PUBDOMVERS}
# fi
#
# if [ -z $PYTHON ] ; then
# export PYTHON=${PYDIR}/bin/python2.2
# fi
#
# create a local temporary file (with the PID as part of the name) to
# speed up access from Nag fitter if starting directory is in AFS:
if (not os.environ.has_key("LIZARD_KEEP_FITRESULT")) :
os.system("rm -f e04ucc.r")
os.system("ln -s /tmp/pid-$$-e04ucc.r e04ucc.r")
# $PYTHON -i ${LIZARD_ROOT}/bin/.Lizardrc $*
print "executing startup from'"+os.environ["LIZARD_ROOT"] + "/bin/.Lizardrc"+"'"
# execfile(os.environ["LIZARD_ROOT"] + "/bin/.Lizardrc")
# Settings for Lizard
lizardVersion = "3.0.0.5"
lizardVersionDate = "20 Dec 2002"
lizardBatch = None
lizardObjy = None
lizardNag = None
lizardNoGraphics = None
from math import *
from time import *
import string
import os
import sys
import random
import atexit
import gc
# the following works only for python-2.0 (or later)
# for command-line completion :
import rlcompleter
rlcompleter.readline.parse_and_bind("tab: complete")
try :
if (sys.version_info[0] == 2) :
# for history (across-sessions)
import readline
# limit history file to 1000 lines
readline.set_history_length(1000)
# read previous file (if existing)
histfile = os.path.join(os.environ["HOME"], ".LizHist")
try:
readline.read_history_file(histfile)
except IOError:
print "cannot read command history file ", histfile
pass
# register function to write history file at exit
atexit.register(readline.write_history_file, histfile)
del histfile
# end history
except :
print "\nerror while accessing command history file"
raise
# end python-2.0 specific part ...
# --------------------------------------------------------------------------------
def usage ():
print """
usage: startLizard.sh [<options>] [<file1> <file2> ...]
where the optional <options> can be one of the following:
-?, -h, --help : print this text
-v, --version : print version info
-b, --batch : run in batch mode and execute the scripts passed after all options
--noGraphics : don't instantiate a Plotter (use this if your DISPLAY variable is not set)
--useNag : use minimizer engine from Nag-C library
--useObjy : use Objectivity/DB for persistent Histograms and (row-wise) Ntuples
default : use FML with Minuit minimizer engine
the (optional) list of files will be executed after startup
NOTE: the options need to be _before_ any script file
"""
# --------------------------------------------------------------------------------
# set some defaults: use FML, Objy, Nag-C
# --------------------------------------------------------------------------------
lizardFML = 1
lizardHBook = 0
lizardNag = 0
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
def lizardVersionInfo() :
print "\nThis is Lizard version " + lizardVersion + "\n"
# --------------------------------------------------------------------------------
# check if we got any flags:
# --------------------------------------------------------------------------------
import getopt
#optlist = []
#args = []
try:
optlist, args = getopt.getopt(sys.argv[1:], ['?', 'h', 'v', 'b'],
['help', 'version', 'batch', 'noGraphics',
'useNag', 'useNag', 'useObjy', 'objy' ])
except :
print "\nunknown option:",o,"\n"
usage()
sys.exit()
# --------------------------------------------------------------------------------
# have a first look at options now, see if the user wants some info without
# the need to start the system ...
# --------------------------------------------------------------------------------
for o, a in optlist:
if o in ("-?", "-h", "--help"):
usage()
sys.exit()
elif o in ("-v", "--version",):
lizardVersionInfo()
sys.exit()
elif o in ("", "--useObjy", "--objy",):
lizardObjy = 1
import dl
# --------------------------------------------------------------------------------
# check if Objectivity can be used, if requested
# --------------------------------------------------------------------------------
if (lizardObjy == 1) :
try:
dl.open( "liboo.so" )
except:
print "Objectivity requested, but liboo not found in LD_LIBRARY_PATH !! Aborting !"
sys.exit()
# --------------------------------------------------------------------------------
# check if Nag_C can be used,
# --------------------------------------------------------------------------------
if (lizardNag == 1 ) :
try:
dl.open( "libnagc.so" )
except:
print "Minimizer from NAG requested, but libnagc not found in LD_LIBRARY_PATH !! Aborting !"
sys.exit()
# --------------------------------------------------------------------------------
# check the other possible flags:
# --------------------------------------------------------------------------------
for o, a in optlist:
if o in ("-b", "--batch",):
lizardBatch = 1
elif o in ("--noGraphics",):
lizardNoGraphics = 1
elif o in ("--nag", "--useNag"):
lizardNag = 1
# --------------------------------------------------------------------------------
print "\n"
# --------------------------------------------------------------------------------
# check now whether DISPLAY is set.
# --------------------------------------------------------------------------------
if (lizardNoGraphics != 1) :
try:
disp = os.environ["DISPLAY"]
except:
print "\n==========> no DISPLAY set, switching to no-graphics mode."
lizardNoGraphics = 1
# prompt
sys.ps1=":-) "
# --------------------------------------------------------------------------------
# welcome message parameters
lizMsgWelcome = "Welcome to Lizard"
lizMsgID = "Version "+ lizardVersion + " (" + lizardVersionDate + ")"
lizMsgURL = "http://cern.ch/Anaphe"
lizMsgSide = "|"
lizMsgCorner = "+"
lizMsgTop = "-"
lizMsgWidth = 50
lizMsgSideIndent = 8
lizMsgTopIndent = 1
# generate welcome message
lizMsgBar = ""
for i in range (0,lizMsgWidth) :
lizMsgBar = lizMsgBar + lizMsgTop
lizMsgPad = ""
for i in range (0,lizMsgSideIndent) :
lizMsgPad = lizMsgPad + " "
lizMsgBlank = lizMsgSide + string.center("",lizMsgWidth) + lizMsgSide
for i in range (0, lizMsgTopIndent) :
print ""
print lizMsgPad + lizMsgCorner + lizMsgBar + lizMsgCorner
print lizMsgPad + lizMsgBlank
print lizMsgPad + lizMsgSide + string.center(lizMsgWelcome,lizMsgWidth) + lizMsgSide
print lizMsgPad + lizMsgBlank
print lizMsgPad + lizMsgSide + string.center(lizMsgID,lizMsgWidth) + lizMsgSide
print lizMsgPad + lizMsgBlank
print lizMsgPad + lizMsgSide + string.center(lizMsgURL,lizMsgWidth) + lizMsgSide
print lizMsgPad + lizMsgBlank
print lizMsgPad + lizMsgCorner + lizMsgBar + lizMsgCorner
for i in range (0, lizMsgTopIndent) :
print ""
# --------------------------------------------------------------------------------
print "Chosen configuration: ",
if ( lizardObjy == 1 ) :
print "Objectivity",
else:
print "HBook and XML",
print " persistency and ",
if ( lizardNag == 1 ) :
print "Nag-C",
else:
print "Minuit",
print "minimizer engine"
print "\nType help() for help\n"
sys.stdout.flush()
# --------------------------------------------------------------------------------
# global startup files ...
# --------------------------------------------------------------------------------
# remember where we started from ...
curDir = os.getcwd()
# check for global StartupFiles (so far, the order doesn't matter):
startDir = os.environ['LIZARD_ROOT']+"/startUpFiles/"
fileList = os.listdir(startDir)
# change to directory containing the startup files and exec them one by one:
os.chdir(startDir)
try:
for file in fileList :
if (string.find(file,".py") == -1) :
continue;
if (file == "constants.py") :
continue;
if (os.path.isfile(file)) :
# print "loading startUp file ", file
execfile(file)
else :
print "Strange: cannot \"execfile\" startUp file ", file, " in ", startDir, " !?!?"
except:
raise
#-ap execfile("constants.py")
# return to where we left from ...
os.chdir(curDir)
LizardIsInitialized = 1
print "\n\nLizard initialised\n"
# --------------------------------------------------------------------------------
# local/user-specific startup files ...
# --------------------------------------------------------------------------------
# check for local initfiles:
homeStart = os.environ['HOME']+"/.Lizardrc"
if os.path.isfile(homeStart):
execfile(homeStart)
# avoid reading it twice ...
if (os.getcwd() != os.environ['HOME'] and
os.getcwd() != os.environ['LIZARD_ROOT']+"/bin" ) :
localStart = "./.Lizardrc"
if os.path.isfile(localStart):
execfile(localStart)
# --------------------------------------------------------------------------------
def lizardCleanUp() :
global af, tf, pf, pl
# in reverse order of construction
if (lizardNoGraphics != 1) :
pl.thisown = 1 ; del pl
pf.thisown = 1 ; del pf
tf.thisown = 1 ; del tf
af.thisown = 1 ; del af
# print "global objects deleted ... " ; sys.stdout.flush()
for lib in theListOfLoadedLibraries.keys() :
sys.stdout.flush()
theListOfLoadedLibraries[lib].close()
# print "\nall libs unloaded ... " ; sys.stdout.flush()
print "\nobjects deleted and libs unloaded, exiting python ... " ; sys.stdout.flush()
return
# --------------------------------------------------------------------------------
def exit() :
lizardCleanUp()
sys.exit()
# --------------------------------------------------------------------------------
# execute file given at input (ignoring startup file .Lizardrc) ...
# --------------------------------------------------------------------------------
if (len(args) > 0 ) :
args[0] = os.path.abspath(args[0])
file = args[0]
# reset the environment ... the scripts will now look as if invoked from the shell ...
sys.argv = args
print "executing ", file
if (os.path.isfile(file)) :
try :
execfile(file)
except:
# if something goes wrong in batch mode, clean up and exit ...
if (lizardBatch == 1) :
lizardCleanUp()
sys.exit(2)
else :
raise
else :
print "file ", file, " not found."
if (lizardBatch == 1) :
# clean up (explicitly destroy some objects)
lizardCleanUp()
sys.exit()
@@ -1,10 +1,11 @@
# $Id: myLiz.py,v 1.2 2003/06/16 17:06:44 dressel Exp $
# $Id: myPI.py,v 1.1 2004/06/09 15:04:36 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-05-02-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
#
import sys
origArgv = sys.argv
sys.argv = ["","--noGraphics"]
from liz import *
from PyAida import *
sys.argv = origArgv
@@ -1,6 +1,6 @@
# $Id: myUtils.py,v 1.4 2003/06/20 12:41:06 dressel Exp $
# $Id: myUtils.py,v 1.5 2004/06/09 15:04:36 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-05-02-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
#
import CLHEP
@@ -13,7 +13,7 @@ import shelve
G4analysisUse = os.environ.has_key("G4ANALYSIS_USE")
if G4analysisUse:
import myLiz
import myPI
def createParallelSampler(impGeo, impScorer):
@@ -48,7 +48,7 @@ def saveResults(tApp, path, shelveName, impScorer, impGeo):
table.Print(tApp.cellScorerStore.GetMapGeometryCellCellScorer())
if G4analysisUse:
storePath = path + "/" + myShelve["xmlStoreName"]
persistantStore = myLiz.tf.create(storePath,"xml",0,1)
persistantStore = myPI.tf.create(storePath,"xml",0,1)
coppyTrees(tApp.tree, persistantStore)
persistantStore.commit()
persistantStore.close()
@@ -187,7 +187,7 @@ if G4analysisUse:
def addToXML(mergedXMLStore, xmlStore):
objNames = xmlStore.listObjectNames()
objTypes = xmlStore.listObjectTypes()
hf = myLiz.af.createHistogramFactory(mergedXMLStore)
hf = myPI.af.createHistogramFactory(mergedXMLStore)
for i in range(len(objNames)):
oName = objNames[i]
oType = objTypes[i]
@@ -230,11 +230,11 @@ def addToShelve(mergedShelve, she, shelveNameToBeAdded):
if G4analysisUse:
def mergeData(mergedName, shelveList):
mergedShelveName = mergedName + ".shelve"
print "createing merged shelve: ", mergedShelveName
print "creating merged shelve: ", mergedShelveName
mergedShelve = shelve.open(mergedShelveName)
mergedXMLname = mergedName + ".xml"
print "createing merged XML store: ", mergedXMLname
mergedXMLStore = myLiz.tf.create(mergedXMLname, "xml", 0, 1)
print "creating merged XML store: ", mergedXMLname
mergedXMLStore = myPI.tf.create(mergedXMLname, "xml", 0, 1)
for i in range(len(shelveList)):
@@ -243,7 +243,7 @@ if G4analysisUse:
she = shelve.open(shelveName,"r")
xmlStoreName = she["xmlStoreName"]
print "opening: ", xmlStoreName
xmlStore = myLiz.tf.create(xmlStoreName,"xml",1,0)
xmlStore = myPI.tf.create(xmlStoreName,"xml",1,0)
if i == 0:
if mergedXMLStore.listObjectNames() == ():
setUpMergedShelve(she, mergedShelve, mergedXMLname, shelveName)
@@ -1,6 +1,6 @@
# $Id: runSequence.py,v 1.3 2003/06/16 17:06:44 dressel Exp $
# $Id: runSequence.py,v 1.4 2004/06/09 15:04:36 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-05-02-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
#
import Tiara
@@ -31,9 +31,9 @@ class RunConfig(object):
class RunSequence(object):
# methods to be used public
def __init__(self, runConfig, useLizard = True):
def __init__(self, runConfig, usePI = True):
self.rc = runConfig
self.useLizard = useLizard
self.usePI = usePI
self.runNum = -1
self.confInfo = self.rc.getConfInfo()
self.storeName = myUtils.getStoreName()
@@ -74,7 +74,7 @@ class RunSequence(object):
def report(self):
print "\n\nRunSequence.report:"
print self.confInfo
if self.useLizard:
if self.usePI:
print "the xml store will be named: "
print " ", self.pathXMLName
print "the shelve name: "
@@ -97,7 +97,7 @@ class RunSequence(object):
rns = string.rjust(rns, 5)
rns = string.replace(rns,' ','0')
rId = "_run" + rns
if self.useLizard:
if self.usePI:
self.xmlStore = self.storeName + rId + ".xml"
self.pathXMLName = self.path + "/" + self.xmlStore
@@ -108,7 +108,7 @@ class RunSequence(object):
def mkShelve(self):
myShelve = shelve.open(self.pathShelveName)
if self.useLizard:
if self.usePI:
myShelve["xmlStoreName"] = self.xmlStore
for info in self.confInfo:
myShelve[info] = self.confInfo[info]
@@ -1,10 +1,9 @@
# $Id: tiaraApplication.py,v 1.3 2003/06/16 17:06:44 dressel Exp $
# $Id: tiaraApplication.py,v 1.4 2004/06/09 15:04:36 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-05-02-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
#
import string
import CLHEP
import G4Kernel
import Tiara
@@ -16,11 +15,27 @@ import tallyData
class TiaraApplet(object):
tiaraSim = None
def __init__(self, tiaraSpecs, tSim = None, useLizard = True):
if useLizard:
import myLiz
self.tree = myLiz.tf.create()
self.hf = myLiz.af.createHistogramFactory (self.tree)
def __init__(self, tiaraSpecs, tSim = None, usePI = True):
if usePI:
import myPI
self.tree = myPI.tf.create()
self.hf = myPI.af.createHistogramFactory (self.tree)
print self.hf
print "hf"
hf_ptr = str(self.hf._theObject)
print hf_ptr
print "hf_ptr before split"
hf_ptr = string.split(str(self.hf._theObject))[-1]
print hf_ptr
print "hf_ptr after split"
hf_ptr2 = hf_ptr.split('x')[1]
for i in range(len(hf_ptr2),8) :
hf_ptr2 = '0'+hf_ptr2
self.hf.this='_' + hf_ptr2 + '_p_AIDA__IHistogramFactory'
self.hf.thisown = 1
print self.hf.this
print "hf.this after split"
else:
self.tree = None
self.hf = None
@@ -160,6 +175,7 @@ class TiaraApplet(object):
self.tiaraSpecs.
experiment.binEdgesBonner,
tally)
else:
self.scSrc = Tiara.\
TiaraCellScorer("source_detector",
@@ -220,4 +236,3 @@ class TiaraApplet(object):
self.sampler.Configure()
@@ -1,6 +1,6 @@
# $Id: tiaraDetectors.py,v 1.3 2003/06/20 12:41:07 dressel Exp $
# $Id: tiaraDetectors.py,v 1.4 2004/06/09 15:04:36 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-05-02-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
#
import CLHEP
@@ -1,6 +1,6 @@
# $Id: tiaraGenerators.py,v 1.2 2003/06/16 17:06:44 dressel Exp $
# $Id: tiaraGenerators.py,v 1.3 2004/06/09 15:04:36 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-05-02-patch-01 $
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
#
import string
@@ -36,7 +36,6 @@ class TiaraPrimaryGenerator(object):
class TiaraDPSEnergyGenerator(object):
def __init__(self, tiaraSpecs, xmlName):
self.Name = "dpsSource"
self.eSamp = Tiara.\
TiaraDPSSampledEnergy(tiaraSpecs.
experiment.energy,
@@ -45,7 +44,6 @@ class TiaraDPSEnergyGenerator(object):
xmlName,
"")
self.tally = Tiara.TiaraTally()
if string.find(xmlName,"other") > -1:
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.5 2003/12/08 17:53:26 gcosmo Exp $
# $Id: GNUmakefile,v 1.6 2004/06/09 15:04:37 daquinog Exp $
# --------------------------------------------------------------
# GNUmakefile Michael Dressel
# --------------------------------------------------------------
@@ -27,9 +27,11 @@ all: lib bin
include $(G4INSTALL)/config/binmake.gmk
ifdef G4ANALYSIS_USE
CPPFLAGS += `$(ANAPHE_SCRIPTS)/aida-config -i`
CPPFLAGS += `aida-config --include`
# LDFLAGS += `aida-config --lib`
endif
CPPFLAGS += -I$(PYTHON_INCLUDE_DIR) \
-I$(TIARA_BASE)/source/tiaraPhysicsPackaging/include \
-I$(TIARA_BASE)/source/tiaraPhysicsLists/include
@@ -37,7 +39,7 @@ CPPFLAGS += -I$(PYTHON_INCLUDE_DIR) \
LDFLAGS += -L$(PYTHON_LIB_DIR)
ifdef G4ANALYSIS_USE
LDLIBS += `$(ANAPHE_SCRIPTS)/aida-config -l`
LDLIBS += `aida-config --lib`
endif
LDLIBS += -lpython$(PYTHONVERSION) \
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: TiaraDPSSampledEnergy.hh,v 1.5 2003/06/25 09:12:37 gunter Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: TiaraDPSSampledEnergy.hh,v 1.6 2004/06/09 15:04:37 daquinog Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// ----------------------------------------------------------------------
//
@@ -61,8 +61,13 @@ private:
void getBounds(G4int &cL, G4int &cH, G4double v);
std::auto_ptr<AIDA::ITree> fTree;
std::auto_ptr<AIDA::IDataPointSet> fSampleDPS;
//std::auto_ptr<AIDA::ITree> fTree;
// std::auto_ptr<AIDA::IDataPointSet> fSampleDPS;
// /////
AIDA::ITree* fTree;
AIDA::IDataPointSet* fSampleDPS;
//////
G4double fMinEnergyCut;
std::map<int, double> fEnergy_Flux;
G4double fMaxProb;
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: TiaraCellScorer.cc,v 1.3 2003/06/18 16:40:28 gunter Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: TiaraCellScorer.cc,v 1.4 2004/06/09 15:04:37 daquinog Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -48,22 +48,37 @@ TiaraCellScorer::TiaraCellScorer(AIDA::IHistogramFactory *hf,
&binEdgesBonner,
const TiaraTally &tally) :
fBaseName(histBaseName),
fEnergyHisto(hf->createHistogram1D(histBaseName,
histBaseName + ": flux vs. energy",
binEdgesScinti)),
fEnergyFluxHisto(hf->createHistogram1D(histBaseName + "Eflux",
histBaseName + ": energy flux vs. energy",
binEdgesScinti)),
// fEnergyHisto(hf->createHistogram1D(histBaseName,
// histBaseName + ": flux vs. energy",
// binEdgesScinti)),
//fEnergyFluxHisto(hf->createHistogram1D(histBaseName + "Eflux",
// histBaseName + ": energy flux vs. energy",
// binEdgesScinti)),
fEnergyHistoBonner(hf->createHistogram1D(histBaseName + "Bonner",
histBaseName + ": flux vs. energy",
binEdgesBonner)),
fEnergyFluxHistoBonner(hf->createHistogram1D(histBaseName + "BonnerEflux",
histBaseName + ": energy flux vs. energy",
binEdgesBonner)),
//fEnergyHistoBonner(hf->createHistogram1D(histBaseName + "Bonner",
// histBaseName + ": flux vs. energy",
// binEdgesBonner)),
//fEnergyFluxHistoBonner(hf->createHistogram1D(histBaseName + "BonnerEflux",
// histBaseName + ": energy flux vs. energy",
// binEdgesBonner)),
fTally(tally)
{}
{
//G4cout << "porca troia" << G4endl;
G4cout << hf << " hf in G4" << G4endl;
fEnergyHisto = hf->createHistogram1D(histBaseName,
histBaseName + ": flux vs. energy",
binEdgesScinti);
fEnergyFluxHisto = hf->createHistogram1D(histBaseName + "Eflux",
histBaseName + ": energy flux vs. energy",
binEdgesScinti);
fEnergyHistoBonner = hf->createHistogram1D(histBaseName + "Bonner",
histBaseName + ": flux vs. energy",
binEdgesBonner);
fEnergyFluxHistoBonner = hf->createHistogram1D(histBaseName + "BonnerEflux",
histBaseName + ": energy flux vs. energy",
binEdgesBonner);
}
#else
TiaraCellScorer::TiaraCellScorer(const G4String &histBaseName,
const TiaraTally &tally) :
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: TiaraDPSSampledEnergy.cc,v 1.7 2003/12/08 17:53:27 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: TiaraDPSSampledEnergy.cc,v 1.8 2004/06/09 15:04:37 daquinog Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
#include "TiaraDPSSampledEnergy.hh"
@@ -40,16 +40,34 @@ TiaraDPSSampledEnergy::TiaraDPSSampledEnergy(const G4String &eng,
const G4String &sourceTree,
const G4String &nameExt)
:
fTree( (checkFileIsReadable(sourceTree, "TiaraDPSSampledEnergy::TiaraDPSSampledEnergy"),
AIDA_createAnalysisFactory()
->createTreeFactory()
->create(sourceTree, "xml",true,false)) ),
fSampleDPS(dynamic_cast<AIDA::IDataPointSet *>(fTree->find(G4String("dps" + eng + nameExt)))),
// fTree( (checkFileIsReadable(sourceTree, "TiaraDPSSampledEnergy::TiaraDPSSampledEnergy"),
// AIDA_createAnalysisFactory()
// ->createTreeFactory()
// ->create(sourceTree, "xml",true,false)) ),
//fSampleDPS(dynamic_cast<AIDA::IDataPointSet *>(fTree->find(G4String("dps" + eng + nameExt)))),
fMinEnergyCut(minEnergyCut),
fMaxProb(0),
fMinE(fSampleDPS->point(0)->coordinate(0)->value()),
fMaxE(fSampleDPS->point(fSampleDPS->size()-1)->coordinate(0)->value())
fMaxProb(0)
// fMinE(fSampleDPS->point(0)->coordinate(0)->value()),
//fMaxE(fSampleDPS->point(fSampleDPS->size()-1)->coordinate(0)->value())
{
/////////////////////////////////////////
AIDA::IAnalysisFactory* aFact = AIDA_createAnalysisFactory();
AIDA::ITreeFactory *treeFact = aFact->createTreeFactory();
fTree = treeFact -> create(sourceTree, "xml",true,false);
AIDA::IManagedObject* object = fTree->find("dps" + eng + nameExt);
if(object) {
AIDA::IDataPointSet* sample = object->cast("AIDA::IDataPointSet");
fSampleDPS = sample;
}
fMinE = fSampleDPS->point(0)->coordinate(0)->value();
fMaxE = fSampleDPS->point(fSampleDPS->size()-1)->coordinate(0)->value();
/////////////////////////////////////////
for (G4int i=0; i < fSampleDPS->size(); i++) {
AIDA::IDataPoint *p = fSampleDPS->point(i);
G4double prob(p->coordinate(1)->value());