Project

General

Profile

Actions

Sim-Development #1423

closed

Configuration of transport with TGeant4

Added by Volker Friese almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
11/02/2019
Due date:
02/07/2020
% Done:

100%

Estimated time:
20.00 h
Spent time:

Description

The introduction of the CbmTransport class has replaced the usage of the configuration macros g3config.C and g4config.C, which have been moved to compiled code. This goes on the expense of loss of flexibility. All flexibility needed by the PWGs shall be provided, either by setters to CbmTransport or, if that is not feasible, again by configuration scripts.

It should be noted in this context that the FairRoot group (R. Karabowicz) is also working on a better configuration method for the transport simulation. We should keep in touch to avoid parallel or diverging implementations.

To start, the PWGs should specify what they would like to be able to configure for Geant4.


Related issues

Related to CbmRoot - Development #1409: GEANT4 configuraion within CbmTransport classClosedOleg Golosov10/17/201910/26/2019

Actions
Actions #1

Updated by Volker Friese almost 3 years ago

Actions #2

Updated by Florian Uhlig over 2 years ago

  • Due date changed from 12/20/2019 to 02/07/2020
  • Assignee changed from Oleg Golosov to Florian Uhlig
  • % Done changed from 0 to 50

With the commit 15617 it is possible again to change the settings for our transport engines from the macros. In the moment the Gent3 settings are completely implemented. For Geant4 only the seeings common with Geant3 are implemented yet. Here we have to find out which settings are available and how to use them properly.

The next step to implement is to make the G4RunConfiguration accessible from the macro. This should be a rather small change which I will do on monday.

Actions #3

Updated by Florian Uhlig over 2 years ago

  • Status changed from Assigned to Resolved
  • Assignee changed from Florian Uhlig to Oleg Golosov
  • % Done changed from 50 to 100

With r15701 it is possible to define the Geant4 run configuration from the command line. With r15703 it is possible to set Geant4 commands which will be executed by Geant4 during the initialization. The current interface allows you (or force you) to use the low level Geant4 commands. If you come up with useful sets of commands one can implement a better interface which shields the user from the complexity of Geant4 commands but in my opinion for the time being it is good to have direct access to the Geant4 command line.

Please test and let me know if the current interface is what you need or propose changes.

Actions #4

Updated by Florian Uhlig over 2 years ago

To use the functionality from the macro you need to create an instance of CbmGeant4Settings and pass it to CbmTransport as shown in the example below

CbmGeant4Settings* g4Settings = new CbmGeant4Settings();
g4Settings->SetG4RunConfig("geomRoot","QGSP_BERT_EMV+optical","stepLimiter+specialCuts");
g4Settings->AddG4Command("/mcVerbose/all 2");
run.SetGeant4Settings(g4Settings);
Actions #5

Updated by Oleg Golosov over 2 years ago

  • Status changed from Resolved to In Progress
  • Assignee changed from Oleg Golosov to Florian Uhlig

Thanks, Florian, everything seems to be working.

Still, I would propose to get back to reading Geant4 settings from the g4config.in file and add a method to set the path to user defined config file.
The latter could either replace or complement the default one - I'm not sure which way is preferable.
This would help to store the settings and pass them more safely than adding string-by-string in the macro (though we could keep this possibility as well).

Another thing missing at the moment is the setting of MaxNStep (CbmGeant4Settings.cxx:31).

And the last question is weather it is possible (needed?) to implement our own Geant4 UI commands.
For instance, this seems to be the only way to deal with the recently found bug affecting transport of large nuclei in Geant4 (besides editing its source code or moving to an older version):
https://bugzilla-geant4.kek.jp/show_bug.cgi?id=2226#c8
The temporary solution requires access to global Geant4 variables. May be there is some way but I could not find any.

Actions #6

Updated by Florian Uhlig over 2 years ago

Still, I would propose to get back to reading Geant4 settings from the g4config.in file and add a method to set the path to user defined config file.
The latter could either replace or complement the default one - I'm not sure which way is preferable.
This would help to store the settings and pass them more safely than adding string-by-string in the macro (though we could keep this possibility as well).

With the current implementation it is possible to store all settings in the output file. So it is easily possible to check at a later stage what was done in the transport. when using a file the only information stored is the filename/location but there is no clue what was actually set. So I consider reading a file as no option.

Another thing missing at the moment is the setting of MaxNStep (CbmGeant4Settings.cxx:31).

Implemented in r15875

And the last question is weather it is possible (needed?) to implement our own Geant4 UI commands.
For instance, this seems to be the only way to deal with the recently found bug affecting transport of large nuclei in Geant4 (besides editing its source code or moving to an older version):
https://bugzilla-geant4.kek.jp/show_bug.cgi?id=2226#c8
The temporary solution requires access to global Geant4 variables. May be there is some way but I could not find any.

Here I have no idea how to implement our own Geant4 UI command. If you come up with a solution this can probably be added.

Actions #7

Updated by Florian Uhlig over 2 years ago

  • Assignee changed from Florian Uhlig to Oleg Golosov
  • % Done changed from 100 to 90
Actions #8

Updated by Oleg Golosov over 2 years ago

Sorry, I did not notice that the config is written to the transport file.
It's a nice solution, but one should impelement a method to get the contents of fG4RunConfig and fG4Commands and have them printed with the 'Dump()' method.

Another wish would be to give the object a different name than the class name. It will let you access it easier through the command line.

And finally, if you do not mind, I would ask for a convenient method to use a config from a file. Something like CbmTransport::SetGeant4SettingsFromFile(string filePath, string objectName).

Thanks!

Actions #9

Updated by Oleg Golosov over 2 years ago

  • Assignee changed from Oleg Golosov to Florian Uhlig
Actions #10

Updated by Volker Friese over 2 years ago

Dear Florian,

please update the issue w.r.t. APR20. I think no further development can be done for the release. It seems to me we need some discussion on the general strategy here.

Actions #11

Updated by Volker Friese over 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

Discussed in the software meeting of 28 May 2020. Should not be a stopper for APR20 since the needed functionality is available from the macro level. We can pick the issue up if needed.

Actions

Also available in: Atom PDF