Skip to content
Snippets Groups Projects
Commit 9562515a authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Merge remote branch 'upstream/master'

parents 7f71fa13 d7d6ff1e
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ if(DEFINED ENV{G4_NATIVE_VERSION})
endif()
find_package(GaudiProject)
gaudi_project(Geant4 v96r4p2g1
gaudi_project(Geant4 v96r4p3
DATA Geant4Files VERSION v96r*)
# FIXME: hack for compatibility with CMT build
......
......@@ -3,6 +3,10 @@
! Responsible : James Mccarthy
! Purpose : Examples packages provided my Geant4, used as standalone tests
!-----------------------------------------------------------------------------
! 2015-10-07 - Luca Pescatore
- Fixed TGraph filling that caused not compiling on v95 versions
! 2015-07-01 - Luca Pescatore
- Modified hadronic tests script to also dump results in text form
......
......@@ -18,7 +18,6 @@ from array import array
from ROOT import *
from tempfile import NamedTemporaryFile
phys_lists = ['FTFP', 'FTFP_BERT', 'QGSP_BERT']
particles = ['pi+', 'pi-', 'kaon+', 'kaon-', 'proton', 'anti_proton']
targets = ['Al', 'Be', 'Si']
......@@ -60,6 +59,15 @@ template = '''#================================================
#
'''
def fillGraph(nbins, energy, value) :
gr = TGraph(int(nbins))
for i in range(0,len(energy)) :
gr.SetPoint(i,float(energy[i]),float(value[i]))
return gr
def process(particle, target, phys_list):
print "Producing: ", phys_list, particle, target
......@@ -104,13 +112,13 @@ def process(particle, target, phys_list):
data = {'Elastic': elastic, 'Inelastic': inelastic, 'Total': total}
for key, value in data.iteritems():
gr = TGraph(nbins, energy, value)
gr = fillGraph(nbins, energy, value)
gr.SetName(key)
gr.SetTitle("%s cross section for %s interacting with %s" % (key, particle, target))
gr.GetXaxis().SetTitle("Energy (MeV)")
gr.GetYaxis().SetTitle("%s cross section (b)" % key)
gr.SetLineWidth(2)
gr.Write()
gr.Write()
output.Close()
......@@ -124,6 +132,8 @@ for phys_list in phys_lists :
############# Plotting graphs on pdf
G4version = os.environ["G4VERS"]
c1 = TCanvas()
part = ['pi-', 'kaon-', 'proton']
......@@ -139,7 +149,7 @@ for p,ap in zip(part,apart) :
_file3 = TFile("root/QGSP_BERT_"+ap+"_Al.root");
gr3 = _file3.Get("Total");
gr0.SetTitle("Comparison of physics lists in Geant4 9.6");
gr0.SetTitle("Comparison of physics lists in Geant4 " + G4version);
gr0.GetXaxis().SetTitle("Energy (MeV)");
gr0.GetYaxis().SetTitle("Total cross section (b)");
gr0.SetLineWidth(2)
......
project GEANT4
use GAUDI GAUDI_v26r3
use GAUDI GAUDI_v26r4
use PARAM
build_strategy with_installarea
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment