Closed AndrewEdmonds11 closed 10 years ago
So, something I'd seen when I installed g4sim last time was that for geant4.10, I had to add:
#include <CLHEP/Units/PhysicalConstants.h>
#include <CLHEP/Units/SystemOfUnits.h>
using namespace CLHEP;
to the files in src/.
In my paper notes I had written: -> Have a sed command to do this
. Luckily, I hadn't deleted my old g4sim folder (I remember considering it) and managed to find it.
The command is this (don't ask me to translate):
sed -i '0,/.hh\"/{s/.hh\"/.hh\"\n\n#include <CLHEP\/Units\/PhysicalConstants.h>\n#include <CLHEP\/Units\/SystemOfUnits.h>\nusing namespace CLHEP;/}' *
I won't commit this change in case we decide that we don't want a common Geant4 install or we decide on installing an older (and possibly more stable) version but I'm leaving it here just in case.
Tested and worked well! Here's another solution:
globals.hh
to myglobals.hh
myglobals.hh
in include/
myglobals.hh
#include "globals.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh
Then it can work with geant4.9 and geant4.10. Shall I commit?
Yes, please do.
Done. Still, do we need a script to install?
I'm not sure. I guess we should discuss this in the meeting
An install-geant4.sh script has been added.
Do we want a geant4 install script like we do for ROOT in AlcapDAQ to ensure we are all using the same version of geant4?
Also, I guess tied into this is the fact that we should make sure we use the version of ROOT in AlcapDAQ