Necessary modifications to Geant4 (based on 4.8.2)

Some modifications to Geant4 were necessary to get this wrapper to work. Some mods are SWIG related, some are just plain mistakes in Geant4.

Correction to mistakes in Geant4

  • In source/particles/management/include/G4ParticleTableIterator.hh change all occurrences of "defined" into "isdefined" as "defined" is a keyword for the c++ preprocessor. Recompile geant4's global particles package and re-make the includes directory.
  • In source/geometry/magneticfield/include/G4FieldTrack.hh line 170 change private: into public: and in line 203 add private: just before the member variable of type G4ChargeState. There is a public method GetChargeState returning an object of private nested class G4ChargeState. This class should be public. Recompile geant4's global geometry package and re-make the includes directory.
  • Added empty virtual destructors or changed destructors to virtual in: source/graphics_reps/include/G4VGraphicsScene.hh source/geometry/management/include/G4VPVParameterisation.hh source/processes/hadronic/management/include/G4VLeadingParticleBiasing.hh source/processes/hadronic/models/management/include/G4VIsotopeProduction.hh source/processes/hadronic/models/cascade/cascade/include/G4Collider.hh source/processes/hadronic/models/cascade/cascade/include/G4ElementaryParticleCollider.hh source/processes/hadronic/models/cascade/cascade/include/G4BigBanger.hh source/processes/hadronic/models/cascade/cascade/include/G4Fissioner.hh source/processes/hadronic/models/cascade/cascade/include/G4EquilibriumEvaporator.hh source/processes/hadronic/models/cascade/cascade/include/G4IntraNucleiCascader.hh source/processes/hadronic/models/cascade/cascade/include/G4NonEquilibriumEvaporator.hh source/processes/hadronic/models/cascade/cascade/include/G4InuclCollider.hh source/processes/hadronic/models/isotope_production/include/G4ProtonIsotopeProduction.hh source/processes/hadronic/models/parton_string/qgsm/include/G4VAnnihilationCrossSection.hh source/processes/hadronic/models/parton_string/qgsm/include/G4ASCCrossSection.hh source/parameterisations/gflash/include/GVFlashHomoShowerTuning.hh source/parameterisations/gflash/include/GFlashSamplingShowerTuning.hh

Corrections for limitations in SWIG (based on 1.3.29 and mods)

  • In source/run/include/G4VUserPhysicsList.hh line 116 change protected to public for method AddTransportation. A later version of SWIG may include access to protected member functions, but for now this seems the only solution. Recompile geant4's global run package and re-make the includes directory.
  • Added methods to access protected members in the following classes (all inlined and marked with // G4JAVA). These changes may be unnecessary in the future when SWIG implements access to protected members across languages.
    • source/digits_hits/detector/include/G4VSensitiveDetector.hh
    • source/event/include/G4UserStackingAction.hh
    • source/processes/management/include/G4VProcess.hh
    • source/run/include/G4VPhysicsConstructor.hh
    • source/run/include/G4VUserPhysicsList.hh
    • source/tracking/include/G4SteppingVerbose.hh
    • source/tracking/include/G4UserSteppingAction.hh
    • source/tracking/include/G4UserTrackingAction.hh