GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » CBM » CBMROOT » General » Configuration files outside gconfig directory
Configuration files outside gconfig directory [message #7531] Thu, 13 November 2008 15:20 Go to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hi,

As discussed today in the software meeting, I modify the framework to check for the environmental variable CONFIG_DIR, if this is defined (i.e export CONFIG_DIR=/yourpath) the framework will look for the configuration files (g3Config, g4Config, etc..) in this directory if not found the default one will be used and this is done for the single files, i.e. you can define your CONFIG_DIR to a directory which only contains the g3Config.C, then this file is taken from there and all other files (g3Libs, etc) will be taken from the default one.

This is true for all configuration files and decay configuration files, except for the SetCuts.C because it is called from the g3Config.C (and/or g4Config.C , flConfig.C) So in case you use your own directory for the gXConfig files you have to call the SetCuts.C yourself.

At the moment these changes are in fairbase/base/trunk, so to test this please go to your $VMCWORKDIR/base and call:

svn switch https://subversion.gsi.de/fairroot/fairbase/trunk/base .

then recompile.

As soon as many people test this I will move it to the release branch in fairbase

regards

Mohammad
Re: Configuration files outside gconfig directory [message #7548 is a reply to message #7531] Fri, 21 November 2008 18:32 Go to previous messageGo to next message
Volker Friese is currently offline  Volker Friese
Messages: 365
Registered: April 2004
Location: GSI CBM
first-grade participant
From: *gsi.de
Dear Mohammad,

thanks for acting so quickly. I will test this as soon as possible.

However, I would like to propose a more user-friendly way to achieve the flexibility w.r.t. the transport configuration, which I think is easy to be implemented. It would require the user to define the configuration (and SetCut) script in the macro, e.g. by

// -----   Create simulation run  
  CbmRunSim* fRun = new CbmRunSim();
  fRun->SetName("TGeant3");              // Transport engine

  // ---> new
  fRun->SetConfig("myConfigFile.C");
  fRun->SetCuts("myCuts.C")

  fRun->SetOutputFile(outFile);          // Output file
  CbmRuntimeDb* rtdb = fRun->GetRuntimeDb();
// ---------


In my opinion, this is an easier way than defining a path with environment variables, which is somehow error prone. Moreover, all settings are now documented in the run macro. It requires only two additional (string) members in CbmRunSim with the appropriate setters. These variables are then given to the MCApplication at initialisation.

As in your solution, the default files (from VMCWORKDIR) should be taken if these variables are not set in the macro.
Re: Configuration files outside gconfig directory [message #7559 is a reply to message #7548] Mon, 24 November 2008 16:04 Go to previous message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hallo Volker,

It is not that trivial as it looks but any way I have implemented the following:

1. The CbmRunSim following new methods:

SetUserConfig(const TString &Config)
SetUserCuts(const TString &Cuts)
SetPythiaDecayer(const TString & Config )
SetUserDecay(const TString& Config)



these methods can be called from the macro, you can use either the absolute path or simply the name of your macro for configurations and/or cuts. In case the macro name was set without path, the framework will try to find this macro in the $VMCWORKDIR/gconfig or in the $CONFIG_DIR if defined, otherwise it takes the full path as given!

2. In the G3/G4/Fluka config files there is no need to call the cuts any more they are called directly from the run manager

3. The only constrain is that the function name in the config has to be Config() and for the cuts it has to be SetCuts()

4. In case of Geant4 the optional G4 native macro (g4Config.in) has to be called from the G4Config.C, this cannot be generalized because of timing and dependancy issues

5. For Geane the same was implimented except that the user config and cuts are optional argument in the CbmGeane ctor.

6. Pythia and Phase space decayer configuration follow the same logic

7. The library loading macros have to be in $VMCWORKDIR/gconfig or $CONFIG_DIR, they cannot be set by the user directly from the macro!



P.S all this is still in the trunk of fairbase, after testing it I will move it to the release!


regards

Mohammad

[Updated on: Mon, 24 November 2008 16:07]

Report message to a moderator

Previous Topic: New external packages fairsoft_July08
Next Topic: Mass production DEC08 with full ECAL
Goto Forum:
  


Current Time: Wed Apr 24 07:57:42 CEST 2024

Total time taken to generate the page: 0.00517 seconds