diff --git a/CMakeLists.txt b/CMakeLists.txt index c919055408e4ec787bb0aac96e5b400f9c5c9e35..71c021c141adc043c5e4e60daa4047580112d95b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/Geant4/G4examples/extended/hadronic/G4Hadr00/doc/release.notes b/Geant4/G4examples/extended/hadronic/G4Hadr00/doc/release.notes index aeae65e8cdacaa82090b7ded7120b9c25acec308..d15136790a96f1f723457fc35dda9589f8edd12a 100644 --- a/Geant4/G4examples/extended/hadronic/G4Hadr00/doc/release.notes +++ b/Geant4/G4examples/extended/hadronic/G4Hadr00/doc/release.notes @@ -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 diff --git a/Geant4/G4examples/extended/hadronic/G4Hadr00/scripts/run_hadronic_tests.py b/Geant4/G4examples/extended/hadronic/G4Hadr00/scripts/run_hadronic_tests.py index 8928521f7743feb0dcd45b50d7ff0c27b343c6e7..c244d859f401fde560fee98a8bdfa8fe956dde62 100755 --- a/Geant4/G4examples/extended/hadronic/G4Hadr00/scripts/run_hadronic_tests.py +++ b/Geant4/G4examples/extended/hadronic/G4Hadr00/scripts/run_hadronic_tests.py @@ -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) diff --git a/cmt/project.cmt b/cmt/project.cmt index e8466e9bf5807cda9f7b9fbb9657903d9ffe24f1..5aefbf43512a740d6fefb5beb365c992cd913a57 100755 --- a/cmt/project.cmt +++ b/cmt/project.cmt @@ -1,6 +1,6 @@ project GEANT4 -use GAUDI GAUDI_v26r3 +use GAUDI GAUDI_v26r4 use PARAM build_strategy with_installarea