Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -8,13 +8,13 @@
|
||||
|
||||
# This example needs python2.2 http://www.python.org or later.
|
||||
#
|
||||
# This script may be used without or with ANAPHE e.g. lizard.
|
||||
# Without lizard: just execute this file.
|
||||
# With lizard: start lizard and than do
|
||||
# This script may be used without or with PI.
|
||||
# Without python: just execute this file.
|
||||
# With python: start python2.2 and then do
|
||||
# execfile("B03RunApplication.py")
|
||||
|
||||
import string
|
||||
|
||||
from PyAida import *
|
||||
|
||||
execfile("B03Application.py")
|
||||
#executing the application could be done "by hand"
|
||||
@@ -27,19 +27,17 @@ Bapp.setupSampler()
|
||||
|
||||
Bapp.run(30)
|
||||
|
||||
# using lizard and ANAPHE to create a histogram
|
||||
# check if lizrd is loaded by looking for the af instance of the AnalysisFactory
|
||||
if 'af' in dir():
|
||||
tr = tf.create()
|
||||
hf = af.createHistogramFactory(tr)
|
||||
n = Bapp.nevents
|
||||
minm = int(min(Bapp.messurements))-0.5
|
||||
maxm = int(max(Bapp.messurements)+1)+0.5
|
||||
h = hf.createHistogram1D ("10","Tracks entering in " +
|
||||
'%(n)d' % vars() +
|
||||
" events",30, minm, maxm)
|
||||
for v in Bapp.messurements:
|
||||
h.fill(v)
|
||||
|
||||
hplot(h)
|
||||
# using PI to create a histogram
|
||||
if 'af' in dir():
|
||||
tr = tf.create("TracksEntering.hbook","hbook")
|
||||
hf = af.createHistogramFactory(tr)
|
||||
n = Bapp.nevents
|
||||
minm = int(min(Bapp.messurements))-0.5
|
||||
maxm = int(max(Bapp.messurements)+1)+0.5
|
||||
h = hf.createHistogram1D ("10","Tracks entering in " + '%(n)d' % vars() + " events",30, minm, maxm)
|
||||
for v in Bapp.messurements:
|
||||
h.fill(v)
|
||||
# hplot(h)
|
||||
tr.commit()
|
||||
tr.close()
|
||||
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
# $Id: GNUmakefile,v 1.11 2003/06/30 16:40:27 dressel Exp $
|
||||
# $Id: GNUmakefile,v 1.12 2004/06/20 17:26:13 daquinog Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
|
||||
# --------------------------------------------------------------
|
||||
#
|
||||
# The variable PYTHON_DIR has to be setup. See ../README.
|
||||
# The variable PI_BASE_DIR has to be setup. See ../README.
|
||||
#
|
||||
|
||||
name := exampleB03
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../..
|
||||
endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
|
||||
SWIGINC = include/B03App.i
|
||||
SWIGCC = src/B03App_wrap.cc
|
||||
SWIGD = $(G4WORKDIR)/tmp/$(G4SYSTEM)/exampleB03/B03App_wrap.d
|
||||
@@ -26,27 +24,29 @@ SWIGSO = $(G4WORKDIR)/tmp/$(G4SYSTEM)/exampleB03/_B03App.so
|
||||
|
||||
moduleName = B03App
|
||||
|
||||
|
||||
MYLIBS = $(subst -l$(name),,$(LDLIBS))
|
||||
|
||||
SWIG = $(ANAPHETOP)/specific/$(PLATF)/PublicDomainPackages/2.0.0/bin/swig-1.3.15
|
||||
SWIG = ${SWIG_BASE_DIR}/bin/swig-${SWIGVERSION}
|
||||
|
||||
|
||||
.PHONY: all
|
||||
.PHONY: clean_all all
|
||||
all: $(SWIGD) $(SWIGCC) lib $(SWIGSO) bin
|
||||
|
||||
|
||||
CPPFLAGS += -I$(ANAPHETOP)/specific/$(PLATF)/PublicDomainPackages/2.0.0/include/python$(PYTHON_VERSION)
|
||||
CPPFLAGS += -I${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PLATF}/include/python${PYTHONVERSION}
|
||||
CXXFLAGS += -w
|
||||
|
||||
|
||||
LDFLAGS += \
|
||||
-L$(ANAPHETOP)/specific/$(PLATF)/PublicDomainPackages/2.0.0/lib/python$(PYTHON_VERSION)/config \
|
||||
-L${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PLATF}/lib/python${PYTHONVERSION}/config \
|
||||
-L/lib \
|
||||
-lnsl -ldl -lreadline /lib/libtermcap.so.2 -lieee -lpthread -lutil -lexampleB03 -lpython$(PYTHON_VERSION)
|
||||
-lnsl -ldl -lreadline /lib/libtermcap.so.2 -lieee -lpthread -lutil -lexampleB03 -lpython$(PYTHONVERSION)
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
|
||||
ifdef G4ANALYSIS_USE
|
||||
CPPFLAGS += `aida-config --include`
|
||||
LDFLAGS += `aida-config --lib`
|
||||
endif
|
||||
|
||||
$(SWIGSO): $(objectfilesWrapper)
|
||||
@echo Creating shared library: $@
|
||||
$(CXX) -Wl,-soname,$(@F) -shared $(LDFLAGS) $(objectfilesWrapper) $(MYLIBS) -lc -o $(SWIGSO)
|
||||
@@ -60,6 +60,12 @@ ${G4WORKDIR}/tmp/${G4SYSTEM}/$(name):
|
||||
@mkdir ${G4WORKDIR}/tmp/${G4SYSTEM}/$(name)
|
||||
|
||||
|
||||
clean_all: clean
|
||||
@rm -f B03App.pyc
|
||||
@rm B03App.py
|
||||
@rm src/B03App_wrap.cc
|
||||
|
||||
|
||||
#libdir = $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)
|
||||
#objectfiles = $(shell /bin/ls $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/*.o)
|
||||
#_B03App.so:
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
$Id: History,v 1.1 2004/06/20 17:26:14 daquinog Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
Category History file
|
||||
---------------------
|
||||
This file should be used by G4 developers and category coordinators
|
||||
to briefly summarize all major modifications introduced in the code
|
||||
and keep track of all category-tags.
|
||||
It DOES NOT substitute the CVS log-message one should put at every
|
||||
committal in the CVS repository !
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Jun 20th, 2004 G.Daquino - B03-V06-01-00
|
||||
- porting B03 from Anaphe (Lizard) to PI. Actually, PI 1.2.1 still DOES NOT
|
||||
allow the plotting in the same way, previously set in Anaphe. Therefore the
|
||||
HBOOk file produced at the end of the example still needs other packages to
|
||||
be displayed. However, future PI releases could contain python modules with
|
||||
this property.
|
||||
README file has been updated accordingly.
|
||||
@@ -0,0 +1,73 @@
|
||||
# #Id: setupPI.csh,v 1.6 2004/06/19 17:22:46 daquinog Exp $
|
||||
# -------------------------------------------------------------------
|
||||
# GEANT4 tag $Name: geant4-06-02 $
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
# before sourcing this script make sure you have set the
|
||||
# environment variables according to the description in README
|
||||
|
||||
# setting in case PI and analysis is used
|
||||
if (${?PI_BASE_DIR} == 1) then
|
||||
setenv PI_VERSION 1_2_1
|
||||
setenv PI_VER 1.2.1
|
||||
setenv PLATF rh73_gcc32
|
||||
setenv PATH ${PATH}:${PI_BASE_DIR}/${PI_VER}/app/releases/PI/PI_${PI_VER}/${PLATF}/bin
|
||||
setenv PATH ${PI_BASE_DIR}/Linux-g++/bin:$PATH
|
||||
eval `aida-config -r csh`
|
||||
#
|
||||
# python from PI
|
||||
#
|
||||
setenv PYTHONVERSION 2.2
|
||||
setenv PYTHON_INCLUDE_DIR ${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PLATF}/include/python${PYTHONVERSION}
|
||||
setenv PYTHON_LIB_DIR ${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PLATF}/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/${PLATF}/lib:$PYTHONPATH
|
||||
#
|
||||
# SWIG settings
|
||||
setenv SWIGVERSION 1.3.15
|
||||
#
|
||||
else # not using PI
|
||||
|
||||
echo "-- WARNING: histograms are not activated !"
|
||||
echo " Either PI_BASE_DIR are not set."
|
||||
#
|
||||
if ( ${?PYTHONVERSION} == 1 && \
|
||||
${?PYTHON_BASE_DIR} == 1 && \
|
||||
${?SWIG_BASE_DIR} == 1 && \
|
||||
${?SWIG_VERSION} == 1 && \
|
||||
${?CLHEP_BASE_DIR} == 1) then # settings without PI
|
||||
setenv PYTHON_LIB_DIR ${PYTHON_BASE_DIR}/lib/python${PYTHONVERSION}/config
|
||||
setenv PYTHON_INCLUDE_DIR ${PYTHON_BASE_DIR}/include/python${PYTHONVERSION}
|
||||
#
|
||||
if ( ! -d $PYTHON_LIB_DIR ) then
|
||||
echo -- ERROR: no pyhton lib/config directory: $PYTHON_LIB_DIR
|
||||
endif
|
||||
if ( ! -d $PYTHON_INCLUDE_DIR ) then
|
||||
echo -- ERROR: no pyhton include directory: $PYTHON_INCLUDE_DIR
|
||||
endif
|
||||
else # environment not completed in case no PI is used
|
||||
echo "-- ERROR: PYTHONVERSION or PYTHON_BASE_DIR or CLHEP_BASE_DIR or SWIG_VERSION or SWIG_BASE_DIR not set!"
|
||||
exit
|
||||
endif
|
||||
|
||||
endif # end settings for not using PI
|
||||
#
|
||||
if ( ${?LD_LIBRARY_PATH} == 0 ) then
|
||||
setenv LD_LIBRARY_PATH
|
||||
endif
|
||||
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${G4WORKDIR}/lib/${G4SYSTEM}:${G4WORKDIR}/tmp/${G4SYSTEM}/exampleB03
|
||||
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 B03_BASE `pwd`
|
||||
if (${?PYTHONPATH} == 0) then
|
||||
setenv PYTHONPATH
|
||||
endif
|
||||
setenv PYTHONPATH ${PYTHONPATH}:${LD_LIBRARY_PATH}
|
||||
setenv PYTHONPATH ${PYTHONPATH}:${B03_BASE}
|
||||
Reference in New Issue
Block a user