GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » Fairroot » General Discussion » Re-Run in FairRunSim (Run a FairRunSim several times.)
Re-Run in FairRunSim [message #25252] Wed, 28 October 2020 17:12 Go to next message
GGarJim is currently offline  GGarJim
Messages: 3
Registered: October 2020
Location: Santiago de Compostela
occasional visitor
From: *usc.es
Hi all,

I need to run several iterations of a simulation with the same instance of FairRunSim, but it crashes while entering in the second iteration (first iteration is fine). I think the problem is that Init() is trying to create a second instance of a singleton (FairGeoLoader). If I not define Init() it crashes without further explanations. Example:


// -----   Initialize simulation run   ------------------------------------
    run->Init();

    Bool_t kParameterMerged = kTRUE;
    FairParRootFileIo* parOut = new FairParRootFileIo(kParameterMerged);
    parOut->open(ParFile.Data());
    rtdb->setOutput(parOut);
    rtdb->saveOutput();
    rtdb->print();

    // -----   Start run   ----------------------------------------------------
    if (nEvents > 0)
        run->Run(nEvents);
  
   // ---- Fine until here -------

    run->Init();

    if (nEvents > 0)
        run->Run(nEvents);

//--------  Crashes -------



Any idea of how to solve this?
Many thanks!
Re: Re-Run in FairRunSim [message #25260 is a reply to message #25252] Wed, 28 October 2020 18:26 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *dip0.t-ipconnect.de
Hi,

This functionality is not foreseen. What do you change in the second init?
In analysis (FairRunAna) there is a reinit function which is used when parameters change for example between different files.

best,

Mohammad
Re: Re-Run in FairRunSim [message #25264 is a reply to message #25260] Wed, 28 October 2020 18:37 Go to previous messageGo to next message
GGarJim is currently offline  GGarJim
Messages: 3
Registered: October 2020
Location: Santiago de Compostela
occasional visitor
From: *usc.es
Hi,

We have prepared a root file with several versions of the same set of parameters, so the idea was to generate simulated events using those parameters, changing the version before each Init(). Of course we could just generate several simulated files and merge them after, but it would be great if this could be done in a single step. Btw, we can just use FairRunAna to check this.

Re: Re-Run in FairRunSim [message #25265 is a reply to message #25252] Wed, 28 October 2020 18:51 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *dip0.t-ipconnect.de
Hi,

I assume you mean simulation parameters? Unfortunately this is not supported in the simulation, however instead of merging you can chain your single files (produced with different parameters sets) for the next step.

best,

Mohammad
Re: Re-Run in FairRunSim [message #25269 is a reply to message #25265] Thu, 29 October 2020 10:29 Go to previous message
GGarJim is currently offline  GGarJim
Messages: 3
Registered: October 2020
Location: Santiago de Compostela
occasional visitor
From: *usc.es
That's a good idea. Thank you very much for your help.

Cheers!
Previous Topic: Remove hits from removed tracks
Next Topic: Visualization of trajectories from simulation
Goto Forum:
  


Current Time: Thu Dec 02 20:24:35 CET 2021

Total time taken to generate the page: 0.02035 seconds