alcap-org / g4sim

Simulation toolkit based on Geant4 and ROOT
http://wuchen1106.github.io/g4sim/
2 stars 2 forks source link

Do we want a Geant4 install with this? #2

Closed AndrewEdmonds11 closed 10 years ago

AndrewEdmonds11 commented 10 years ago

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

AndrewEdmonds11 commented 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.

wuchen1106 commented 10 years ago

Tested and worked well! Here's another solution:

  1. change globals.hh to myglobals.hh
  2. create myglobals.hh in include/
  3. Add 3 lines to myglobals.hh
#include "globals.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh

Then it can work with geant4.9 and geant4.10. Shall I commit?

AndrewEdmonds11 commented 10 years ago

Yes, please do.

wuchen1106 commented 10 years ago

Done. Still, do we need a script to install?

AndrewEdmonds11 commented 10 years ago

I'm not sure. I guess we should discuss this in the meeting

AndrewEdmonds11 commented 10 years ago

An install-geant4.sh script has been added.