Skip to content

Commit

Permalink
Required changes to make Gate compatible with Geant4 10.3 (and still …
Browse files Browse the repository at this point in the history
…backward compatible with previous Geant4 distributions)
  • Loading branch information
adubois committed Feb 24, 2017
1 parent 033d48f commit 8eadf35
Show file tree
Hide file tree
Showing 28 changed files with 101 additions and 56 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ STRING(REGEX REPLACE "(.*)[.](.*)[.](.*)" "\\3" G4VERSION_PATCH ${Geant4_VERSION
#MESSAGE(${G4VERSION_MAJOR})
#MESSAGE(${G4VERSION_MINOR})
#MESSAGE(${G4VERSION_PATCH})
IF(NOT ${G4VERSION_MAJOR}.${G4VERSION_MINOR} EQUAL 10.1 AND NOT ${G4VERSION_MAJOR}.${G4VERSION_MINOR} EQUAL 10.2)
MESSAGE("Warning! GATE version 7.2 is not validated for Geant4 ${G4VERSION_MAJOR}.${G4VERSION_MINOR} distribution. Please use Geant4 10.1 or 10.2 distribution instead.")
IF(NOT ${G4VERSION_MAJOR}.${G4VERSION_MINOR} EQUAL 10.2 AND NOT ${G4VERSION_MAJOR}.${G4VERSION_MINOR} EQUAL 10.3)
MESSAGE("Warning! GATE version 8.0 is not validated for Geant4 ${G4VERSION_MAJOR}.${G4VERSION_MINOR} distribution. Please use Geant4 10.2 or 10.3 distribution instead.")
ENDIF()

#=========================================================
Expand Down
4 changes: 2 additions & 2 deletions Gate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void welcome()
{
GateMessage("Core", 0, G4endl);
GateMessage("Core", 0, "**********************************************************************" << G4endl);
GateMessage("Core", 0, " GATE version name: gate_v7.2 " << G4endl);
GateMessage("Core", 0, " GATE version name: gate_v8.0 " << G4endl);
GateMessage("Core", 0, " Copyright : OpenGATE Collaboration " << G4endl);
GateMessage("Core", 0, " Reference : Phys. Med. Biol. 49 (2004) 4543-4561 " << G4endl);
GateMessage("Core", 0, " Reference : Phys. Med. Biol. 56 (2011) 881-901 " << G4endl);
Expand Down Expand Up @@ -252,7 +252,7 @@ int main( int argc, char* argv[] )
printHelpAndQuit("Gate command line help" );
break;
case 'v':
std::cout << "Gate version is 7.2" << std::endl;
std::cout << "Gate version is 8.0" << std::endl;
exit(0);
break;
case 'a':
Expand Down
16 changes: 8 additions & 8 deletions benchmarks/benchImaging/mac/optical.mac
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@

/gate/detector/attachCrystalSD

# Definition of surfaces
/gate/detector/surfaces/name Detection1
/gate/detector/surfaces/insert Electronics
/gate/detector/surfaces/Detection1/setSurface perfect_apd
/gate/Electronics/surfaces/name Detection2
/gate/Electronics/surfaces/insert detector
/gate/Electronics/surfaces/Detection2/setSurface perfect_apd

# Phantom
/gate/world/daughters/name waterBox
/gate/world/daughters/insert box
Expand Down Expand Up @@ -97,6 +89,14 @@

/gate/run/initialize

# Definition of surfaces
/gate/detector/surfaces/name Detection1
/gate/detector/surfaces/insert Electronics
/gate/detector/surfaces/Detection1/setSurface perfect_apd
/gate/Electronics/surfaces/name Detection2
/gate/Electronics/surfaces/insert detector
/gate/Electronics/surfaces/Detection2/setSurface perfect_apd

#=====================================================
# DIGITIZER
#=====================================================
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/benchImaging/output/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
/pet_results.root
/pet_sinogram_frame0.ra.s
/pet_sinogram_frame0.ra.s.hdr
/output/pet_sinogram_frame0.s
/output/pet_sinogram_frame0.s.hdr
/pet_sinogram_frame0.s
/pet_sinogram_frame0.s.hdr
/pet_sinogram_frame0.sc.s
/pet_sinogram_frame0.sc.s.hdr
/spect_projection.hdr
Expand Down
Empty file modified benchmarks/benchImaging/output/benchAnalysePet_1.C
100644 → 100755
Empty file.
Empty file modified benchmarks/benchImaging/output/benchAnalysePet_2.C
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions benchmarks/benchImaging/reference/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ benchImaging_petCylindrical-reference.tgz
/pet_results.root
/pet_sinogram_frame0.ra.s
/pet_sinogram_frame0.ra.s.hdr
/output/pet_sinogram_frame0.s
/output/pet_sinogram_frame0.s.hdr
/pet_sinogram_frame0.s
/pet_sinogram_frame0.s.hdr
/pet_sinogram_frame0.sc.s
/pet_sinogram_frame0.sc.s.hdr
/spect_projection.hdr
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18d0e811bb6d5470ea86e237620a42e0
098ac5746eee42cac0cccafd4130b078
8 changes: 4 additions & 4 deletions benchmarks/benchImaging/reference/benchImaging_ct_ref.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
This reference was created by launching a Gate simulation on
Mon Oct 3 15:16:52 BST 2016
Thu Feb 23 16:28:04 UTC 2017
with the configuration file benchmarks/benchImaging/mac/ct.mac
from the commit
commit 071dd73d910f3ddb6eb1c2beb56c79a41bed764c
commit 033d48fd215671bc0c06d43b24a86cdf74a7e0b3
with the version of gcc
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
on the architecture Linux
Linux IMNC-EURYDICE 3.19.0-39-generic #44~14.04.1-Ubuntu SMP Wed Dec 2 10:00:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Linux IMNC-EURYDICE 4.4.0-59-generic #80~14.04.1-Ubuntu SMP Fri Jan 6 18:02:02 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2b51f79d6b56b5c669242a142a0c11ac
8ec1b31ae2e76283930e8a4dae36bb81
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
This reference was created by launching a Gate simulation on
Mon Oct 3 15:16:34 BST 2016
Thu Feb 23 16:27:49 UTC 2017
with the configuration file benchmarks/benchImaging/mac/optical.mac
from the commit
commit 071dd73d910f3ddb6eb1c2beb56c79a41bed764c
commit 033d48fd215671bc0c06d43b24a86cdf74a7e0b3
with the version of gcc
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
on the architecture Linux
Linux IMNC-EURYDICE 3.19.0-39-generic #44~14.04.1-Ubuntu SMP Wed Dec 2 10:00:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Linux IMNC-EURYDICE 4.4.0-59-generic #80~14.04.1-Ubuntu SMP Fri Jan 6 18:02:02 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Original file line number Diff line number Diff line change
@@ -1 +1 @@
59841e0cc74ee930f98812a75731d1d9
e731644ec8557f0aaf1bf6cf067a6083
8 changes: 4 additions & 4 deletions benchmarks/benchImaging/reference/benchImaging_pet_ref.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
This reference was created by launching a Gate simulation on
Mon Oct 3 15:16:45 BST 2016
Thu Feb 23 16:27:53 UTC 2017
with the configuration file benchmarks/benchImaging/mac/pet.mac
from the commit
commit 071dd73d910f3ddb6eb1c2beb56c79a41bed764c
commit 033d48fd215671bc0c06d43b24a86cdf74a7e0b3
with the version of gcc
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
on the architecture Linux
Linux IMNC-EURYDICE 3.19.0-39-generic #44~14.04.1-Ubuntu SMP Wed Dec 2 10:00:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Linux IMNC-EURYDICE 4.4.0-59-generic #80~14.04.1-Ubuntu SMP Fri Jan 6 18:02:02 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5519af2f901d3bce9c925364a8c650d8
33fd411c12f8eafc5e840199404fe327
8 changes: 4 additions & 4 deletions benchmarks/benchImaging/reference/benchImaging_spect_ref.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
This reference was created by launching a Gate simulation on
Mon Oct 3 15:17:00 BST 2016
Thu Feb 23 16:27:59 UTC 2017
with the configuration file benchmarks/benchImaging/mac/spect.mac
from the commit
commit 071dd73d910f3ddb6eb1c2beb56c79a41bed764c
commit 033d48fd215671bc0c06d43b24a86cdf74a7e0b3
with the version of gcc
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
on the architecture Linux
Linux IMNC-EURYDICE 3.19.0-39-generic #44~14.04.1-Ubuntu SMP Wed Dec 2 10:00:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Linux IMNC-EURYDICE 4.4.0-59-generic #80~14.04.1-Ubuntu SMP Fri Jan 6 18:02:02 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
5 changes: 5 additions & 0 deletions benchmarks/benchPET/physics.mac
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@

/gate/physics/addProcess RadioactiveDecay

/gate/physics/addAtomDeexcitation
#/process/em/fluo false
#/process/em/auger false
#/process/em/pixe false

/gate/physics/processList Enabled
/gate/physics/processList Initialized

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3c6276e1ab7b193908c1c2e44f8a8dac
a403e226eeab1820e9fe4b14d7064e94
8 changes: 4 additions & 4 deletions benchmarks/benchRT/reference/benchRT_carbon_ref.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
This reference was created by launching a Gate simulation on
Fri Mar 18 13:58:53 CET 2016
Thu Feb 23 16:22:06 UTC 2017
with the configuration file benchmarks/benchRT/mac/carbon.mac
from the commit
commit 946702bd29ba2099788c64fb85d97dbd3b9f72fb
commit 033d48fd215671bc0c06d43b24a86cdf74a7e0b3
with the version of gcc
gcc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064]
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
on the architecture Linux
Linux psilocybe 3.16.7-29-desktop #1 SMP PREEMPT Fri Oct 23 00:46:04 UTC 2015 (6be6a97) x86_64 x86_64 x86_64 GNU/Linux
Linux IMNC-EURYDICE 4.4.0-59-generic #80~14.04.1-Ubuntu SMP Fri Jan 6 18:02:02 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Original file line number Diff line number Diff line change
@@ -1 +1 @@
40aeb8395097c9318524a3cb79b8eb26
9af40d5d88369596f5ee7f162872cdbd
8 changes: 4 additions & 4 deletions benchmarks/benchRT/reference/benchRT_gamma_ref.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
This reference was created by launching a Gate simulation on
Fri Mar 18 13:52:33 CET 2016
Thu Feb 23 16:21:55 UTC 2017
with the configuration file benchmarks/benchRT/mac/gamma.mac
from the commit
commit 946702bd29ba2099788c64fb85d97dbd3b9f72fb
commit 033d48fd215671bc0c06d43b24a86cdf74a7e0b3
with the version of gcc
gcc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064]
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
on the architecture Linux
Linux psilocybe 3.16.7-29-desktop #1 SMP PREEMPT Fri Oct 23 00:46:04 UTC 2015 (6be6a97) x86_64 x86_64 x86_64 GNU/Linux
Linux IMNC-EURYDICE 4.4.0-59-generic #80~14.04.1-Ubuntu SMP Fri Jan 6 18:02:02 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fcdee31803870b694f207848a9516838
59a2ee23acef4a695eb82cd625630656
8 changes: 4 additions & 4 deletions benchmarks/benchRT/reference/benchRT_proton_ref.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
This reference was created by launching a Gate simulation on
Fri Mar 18 13:58:50 CET 2016
Thu Feb 23 16:22:01 UTC 2017
with the configuration file benchmarks/benchRT/mac/proton.mac
from the commit
commit 946702bd29ba2099788c64fb85d97dbd3b9f72fb
commit 033d48fd215671bc0c06d43b24a86cdf74a7e0b3
with the version of gcc
gcc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064]
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
on the architecture Linux
Linux psilocybe 3.16.7-29-desktop #1 SMP PREEMPT Fri Oct 23 00:46:04 UTC 2015 (6be6a97) x86_64 x86_64 x86_64 GNU/Linux
Linux IMNC-EURYDICE 4.4.0-59-generic #80~14.04.1-Ubuntu SMP Fri Jan 6 18:02:02 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
1 change: 1 addition & 0 deletions source/physics/src/GateDecayPB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ See GATE/LICENSE.txt for further details


#include "GateDecayPB.hh"
#include "G4SystemOfUnits.hh"

//Even though the decay process may be assigned to neutrons, anti_neutrons, mu+ and mu-, these particles are treated as stable by G4Decay.
//To make a particle unstable (with the correct lifetime) use the method SetPDGStable(false) of the particle.
Expand Down
11 changes: 9 additions & 2 deletions source/physics/src/GateFakePhysicsList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ See GATE/LICENSE.txt for further details
* \brief fGate Fake Physicslist class for development
*/

#include "G4Version.hh"
#include "GateFakePhysicsList.hh"

#include "G4ProcessManager.hh"
Expand Down Expand Up @@ -86,7 +87,10 @@ void GateFakePhysicsList::ConstructProcess()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

void GateFakePhysicsList::ConstructEM()
{
{
#if G4VERSION_NUMBER >= 1030
auto theParticleIterator=GetParticleIterator();
#endif
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
Expand Down Expand Up @@ -123,7 +127,10 @@ void GateFakePhysicsList::ConstructEM()
void GateFakePhysicsList::ConstructGeneral()
{
// Add Decay Process
G4Decay* theDecayProcess = new G4Decay();
G4Decay* theDecayProcess = new G4Decay();
#if G4VERSION_NUMBER >= 1030
auto theParticleIterator=GetParticleIterator();
#endif
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
Expand Down
1 change: 1 addition & 0 deletions source/physics/src/GateFictitiousProcessPB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ See GATE/LICENSE.txt for further details

#include "GateFictitiousProcessPB.hh"
#include "G4FastSimulationManagerProcess.hh"
#include "G4SystemOfUnits.hh"

#include "GateEMStandardProcessMessenger.hh"

Expand Down
11 changes: 10 additions & 1 deletion source/physics/src/GateMixedDNAPhysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ void GateMixedDNAPhysics::ConstructEM()
void GateMixedDNAPhysics::setDefaultModelsInWorld(G4String NPM) {
if (NPM == "emstandard_opt3_mixed_emdna") {

#if ( G4VERSION_NUMBER >= 1030 )
auto theParticleIterator=GetParticleIterator();
#endif
theParticleIterator->reset();
while( (*theParticleIterator)() )
{
Expand Down Expand Up @@ -266,7 +269,10 @@ void GateMixedDNAPhysics::setDefaultModelsInWorld(G4String NPM) {
}
}
} else if (NPM == "emlivermore_mixed_emdna") {


#if G4VERSION_NUMBER >= 1030
auto theParticleIterator=GetParticleIterator();
#endif
theParticleIterator->reset();
while( (*theParticleIterator)() )
{
Expand Down Expand Up @@ -368,6 +374,9 @@ void GateMixedDNAPhysics::setDefaultModelsInWorld(G4String NPM) {
// Set DNA In World
void GateMixedDNAPhysics::setDNAInWorld() {

#if G4VERSION_NUMBER >= 1030
auto theParticleIterator=GetParticleIterator();
#endif
theParticleIterator->reset();
while( (*theParticleIterator)() )
{
Expand Down
25 changes: 23 additions & 2 deletions source/physics/src/GatePhysicsList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#ifndef GATEPHYSICSLIST_CC
#define GATEPHYSICSLIST_CC

#include "G4Version.hh"
#include "GatePhysicsList.hh"
#include "G4ParticleDefinition.hh"
#include "G4Hybridino.hh"
Expand Down Expand Up @@ -118,9 +119,13 @@ GatePhysicsList::~GatePhysicsList()

// delete the transportation process (should be done in ~G4VUserPhysicsList())
bool isTransportationDelete = false;
#if G4VERSION_NUMBER >= 1030
auto theParticleIterator=GetParticleIterator();
#else
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
//G4ParticleTable::G4PTblDicIterator *
theParticleIterator = theParticleTable->GetIterator();
#endif
theParticleIterator->reset();
while( (*theParticleIterator)() ){//&& !isTransportationDelete){
G4ParticleDefinition* particle = theParticleIterator->value();
Expand Down Expand Up @@ -500,7 +505,11 @@ void GatePhysicsList::Print(G4String name)

if(name=="All")
{
#if G4VERSION_NUMBER >= 1030
auto theParticleIterator=GetParticleIterator();
#else
theParticleIterator = theParticleTable->GetIterator();
#endif
theParticleIterator -> reset();
while( (*theParticleIterator)() ) {
particle = theParticleIterator->value();
Expand Down Expand Up @@ -660,7 +669,7 @@ void GatePhysicsList::PurgeIfFictitious()
void GatePhysicsList::Write(G4String file)
{
G4ParticleDefinition* particle=0;
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
//G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
G4ProcessManager* manager = 0;
G4ProcessVector * processvector = 0;
//G4ParticleTable::G4PTblDicIterator *
Expand All @@ -674,8 +683,12 @@ void GatePhysicsList::Write(G4String file)

os<<"List of particles with their associated processes\n\n";
if(mLoadState<2) os<<"<!> *** Warning *** <!> Processes not yet initialized!\n\n";

#if G4VERSION_NUMBER >= 1030
auto theParticleIterator=GetParticleIterator();
#else
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
theParticleIterator = theParticleTable->GetIterator();
#endif
theParticleIterator -> reset();
while( (*theParticleIterator)() ) {
particle = theParticleIterator->value();
Expand Down Expand Up @@ -924,9 +937,13 @@ void GatePhysicsList::DefineCuts(G4VUserPhysicsList * phys)
//FIXME
//DD(mListOfStepLimiter.size());
if (mListOfStepLimiter.size()!=0) {
#if G4VERSION_NUMBER >= 1030
auto theParticleIterator=GetParticleIterator();
#else
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
//G4ParticleTable::G4PTblDicIterator *
theParticleIterator = theParticleTable->GetIterator();
#endif
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
Expand All @@ -943,9 +960,13 @@ void GatePhysicsList::DefineCuts(G4VUserPhysicsList * phys)

//DD(mListOfG4UserSpecialCut.size());
if (mListOfG4UserSpecialCut.size()!=0) {
#if ( G4VERSION_NUMBER >= 1030 )
auto theParticleIterator=GetParticleIterator();
#else
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
//G4ParticleTable::G4PTblDicIterator *
theParticleIterator = theParticleTable->GetIterator();
#endif
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
Expand Down
1 change: 1 addition & 0 deletions source/physics/src/GateVProcessMessenger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See GATE/LICENSE.txt for further details

#include "GateVProcess.hh"
#include "GateVProcessMessenger.hh"
#include "G4SystemOfUnits.hh"

#include "G4UIdirectory.hh"

Expand Down

0 comments on commit 8eadf35

Please sign in to comment.