Feature #6518

Allow user to specify the UserPhysicsOptions name/location.

Added by Gabriel Perdue over 6 years ago. Updated over 5 years ago.

Start date:
Due date:
% Done:


Estimated time:
Duration: 531


Rather than only having a hard-coded default for the location and name of the "UserPhysicsOptions.xml" configuration file, consider making this something users can set via an environment variable or a command-line flag.


#1 Updated by Gabriel Perdue over 6 years ago

  • Due date changed from 09/18/2014 to 03/31/2015

#2 Updated by Gabriel Perdue over 5 years ago

  • Due date changed from 03/31/2015 to 11/30/2015

Does this already exist?

#3 Updated by Robert Hatcher over 5 years ago

While it is true that the name UserPhysicsOptions.xml is hardcoded into place, the location is not:

./Algorithm/AlgConfigPool.cxx:  string glob_params = utils::xml::GetXMLFilePath("UserPhysicsOptions.xml");

The GetXMLFilePath() function searches the in the following order:

  • $GXMLPATHS # due to early confusion about existence of 'S'
  • $GALGCONF # Hugh's special path
  • $GENIE/config
  • $GENIE/src/FluxDrivers/GNuMINtuple # special for finding flux driver config

NOvA/LArSoft make use of this ability by using a specialized UserPhysicsOptions.xml that forced GENIE to decay (via Pythia) charmed hadrons and tau leptons by setting up a UPS product, ala: setup genie_phyopt v2_8_6 -q dkcharmtau (or dkcharm). They do this because out-of-the-box Geant4 doesn't properly generate decay products for charmed hadrons (and at one point didn't do taus either).

What the system doesn't support is partial & chained UserPhysicsOptions.xml. That is one can't modify only part of the file and then have it read the base and then override some sections with a partial file. This makes it awkward to support multiple distinct changes (say both something like M_A and the charm decay). To do this properly one would need to be able to specify alternative names.

Also available in: Atom PDF