dr4kan / EcoMug

Efficient COsmic MUon Generator
GNU General Public License v3.0
17 stars 6 forks source link

Problem with implementation of EcoMug2.0 with Geant4.11 #4

Closed mariabossa closed 9 months ago

mariabossa commented 1 year ago

Hi everyone, I've implemented EcoMug2.0 as particle generator in my Geant4 simulation. I received this error messages after compilation:

usr/bin/ld: CMakeFiles/nuscale1.dir/src/CilSteppingAction.cc.o:(.data+0x0): multiple definition of `EMLog::ReportingLevel'; CMakeFiles/nuscale1.dir/src/CilPrimaryGeneratorAction.cc.o:(.data+0x0): first defined here collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/nuscale1.dir/build.make:220: nuscale1] Error 1 make[1]: [CMakeFiles/Makefile2:104: CMakeFiles/nuscale1.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

What is the problem? Thank you very much

dr4kan commented 1 year ago

Hi, try with the release v2.1

https://github.com/dr4kan/EcoMug/releases/tag/v2.1

Ciao, Davide.

zz37 commented 1 year ago

Just a general question what are the basic unit for the SetMinimumMomentum() and SetMaximumMomentum(), is the default units GeV/c? Thanks.

dr4kan commented 1 year ago

Default units are

  // meter              (m)
  // second             (s)
  // Giga electron Volt (GeV)
  // radian             (rad)

They are listed in the code. However you can use EMUnits to specify the units, like

 EcoMug genPlane;
 genPlane.SetUseSky();
 genPlane.SetSkySize({{200.*EMUnits::cm, 200.*EMUnits::cm}});
 genPlane.SetSkyCenterPosition({0., 0., 1.*EMUnits::mm});
 genPlane.SetMaximumMomentum(800.*EMUnits::GeV);
 double genArea = genPlane.GetGenSurfaceArea()/EMUnits::m2;
 double genRate = genPlane.GetAverageGenRate()/EMUnits::hertz*EMUnits::m2;

Please take a look at namespace EMUnits.