From 6cc68631fe53e2bf5a9c5e2f165fc72447c14119 Mon Sep 17 00:00:00 2001 From: Christian Tacke <58549698+ChristianTackeGSI@users.noreply.github.com> Date: Thu, 20 Jul 2023 23:20:43 +0200 Subject: [PATCH] Introduce FairExampleRunSim --- examples/MQ/pixelDetector/macros/run_sim.C | 5 ++-- .../src/devices/FairMQSimDevice.cxx | 4 +-- .../src/devices/FairMQTransportDevice.cxx | 5 ++-- examples/advanced/Tutorial3/macro/run_sim.C | 4 +-- .../advanced/Tutorial3/macro/run_sim_sep.C | 7 +---- examples/advanced/propagator/macros/runMC.C | 3 +- examples/advanced/propagator/macros/runMM.C | 3 +- examples/common/mcstack/CMakeLists.txt | 1 + examples/common/mcstack/FairExampleRunSim.cxx | 15 ++++++++++ examples/common/mcstack/FairExampleRunSim.h | 28 +++++++++++++++++++ examples/common/mcstack/LinkDef.h | 8 +++--- .../Tutorial1/macros/run_tutorial1.C | 3 +- .../Tutorial1/macros/run_tutorial1_binary.C | 11 ++++---- .../Tutorial1/macros/run_tutorial1_fastsim.C | 3 +- .../Tutorial1/macros/run_tutorial1_mesh.C | 3 +- .../Tutorial1/macros/run_tutorial1_pythia6.C | 3 +- .../Tutorial1/macros/run_tutorial1_pythia8.C | 3 +- .../Tutorial1/macros/run_tutorial1_urqmd.C | 3 +- .../simulation/Tutorial1/src/CMakeLists.txt | 5 +++- .../Tutorial2/macros/CMakeLists.txt | 1 + .../Tutorial2/macros/run_background.C | 5 ++-- .../simulation/Tutorial2/macros/run_signal.C | 5 ++-- .../Tutorial2/macros/run_tutorial2.C | 7 ++--- .../Tutorial4/macros/run_tutorial4.C | 5 ++-- .../macros/run_tutorial4_createGeometryFile.C | 3 +- .../macros/run_tutorial4_createMatrices.C | 3 +- .../simulation/rutherford/macros/run_rad.C | 3 +- .../rutherford/macros/run_rutherford.C | 5 ++-- 28 files changed, 88 insertions(+), 66 deletions(-) create mode 100644 examples/common/mcstack/FairExampleRunSim.cxx create mode 100644 examples/common/mcstack/FairExampleRunSim.h diff --git a/examples/MQ/pixelDetector/macros/run_sim.C b/examples/MQ/pixelDetector/macros/run_sim.C index 64ae764724..dd42972fdb 100644 --- a/examples/MQ/pixelDetector/macros/run_sim.C +++ b/examples/MQ/pixelDetector/macros/run_sim.C @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence (LGPL) version 3, * @@ -59,8 +59,7 @@ void run_sim(Int_t nEvents = 10, TString mcEngine = "TGeant3", Int_t fileId = 0, // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - auto run = std::make_unique(); - run->SetName(mcEngine); // Transport engine + auto run = std::make_unique(mcEngine); run->SetIsMT(isMT); // Multi-threading mode (Geant4 only) run->SetSink(std::make_unique(outFile)); FairRuntimeDb* rtdb = run->GetRuntimeDb(); diff --git a/examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx b/examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx index 0d7a54ec09..4882b2e9e6 100644 --- a/examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx +++ b/examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx @@ -14,6 +14,7 @@ #include "FairMQSimDevice.h" +#include "FairExampleRunSim.h" #include "FairModule.h" #include "FairParSet.h" #include "FairPrimaryGenerator.h" @@ -44,7 +45,7 @@ FairMQSimDevice::FairMQSimDevice() void FairMQSimDevice::InitTask() { - fRunSim = std::make_unique(); + fRunSim = std::make_unique(fTransportName.c_str()); SetupRunSink(*fRunSim); @@ -56,7 +57,6 @@ void FairMQSimDevice::InitTask() rtdb->setSecondInput(fSecondParameter); } - fRunSim->SetName(fTransportName.c_str()); // fRunSim->SetSimulationConfig(new FairVMCConfig()); fRunSim->SetIsMT(kFALSE); diff --git a/examples/MQ/pixelSimSplit/src/devices/FairMQTransportDevice.cxx b/examples/MQ/pixelSimSplit/src/devices/FairMQTransportDevice.cxx index 50dad46f94..173324f79f 100644 --- a/examples/MQ/pixelSimSplit/src/devices/FairMQTransportDevice.cxx +++ b/examples/MQ/pixelSimSplit/src/devices/FairMQTransportDevice.cxx @@ -14,6 +14,7 @@ #include "FairMQTransportDevice.h" +#include "FairExampleRunSim.h" #include "FairGenericStack.h" #include "FairMCApplication.h" #include "FairMCSplitEventHeader.h" @@ -65,7 +66,7 @@ void FairMQTransportDevice::Init() void FairMQTransportDevice::InitTask() { - fRunSim = std::make_unique(); + fRunSim = std::make_unique(fTransportName.c_str()); fMCSplitEventHeader = new FairMCSplitEventHeader(fRunId, 0, 0, 0); fRunSim->SetMCEventHeader(fMCSplitEventHeader); @@ -81,8 +82,6 @@ void FairMQTransportDevice::InitTask() rtdb->setSecondInput(fSecondParameter); } - fRunSim->SetName(fTransportName.c_str()); - if (fUserConfig.Length() > 0) fRunSim->SetUserConfig(fUserConfig); if (fUserCuts.Length() > 0) diff --git a/examples/advanced/Tutorial3/macro/run_sim.C b/examples/advanced/Tutorial3/macro/run_sim.C index 6ed63c1278..914d4cc076 100644 --- a/examples/advanced/Tutorial3/macro/run_sim.C +++ b/examples/advanced/Tutorial3/macro/run_sim.C @@ -32,14 +32,12 @@ void run_sim(Int_t nEvents = 100, TString mcEngine = "TGeant4") gSystem->Setenv("CONFIG_DIR", tut_configdir.Data()); // create Instance of Run Manager class - FairRunSim run{}; + FairExampleRunSim run{mcEngine}; run.SetUseFairLinks(kTRUE); // FairLinkManager::Instance()->AddIncludeType(0); // set the MC version used // ------------------------ - run.SetName(mcEngine); - TString outFile = "data/testrun_"; outFile = outFile + mcEngine + ".root"; diff --git a/examples/advanced/Tutorial3/macro/run_sim_sep.C b/examples/advanced/Tutorial3/macro/run_sim_sep.C index 518c4d1da6..8732fd01b6 100644 --- a/examples/advanced/Tutorial3/macro/run_sim_sep.C +++ b/examples/advanced/Tutorial3/macro/run_sim_sep.C @@ -30,12 +30,7 @@ void run_sim_sep(Int_t fileId, Int_t nEvents = 1000, TString mcEngine = "TGeant3 gSystem->Setenv("CONFIG_DIR", tut_configdir.Data()); // create Instance of Run Manager class - FairRunSim run{}; - - // set the MC version used - // ------------------------ - - run.SetName(mcEngine); + FairExampleRunSim run{mcEngine}; TString outfile = Form("data/testrun_%s_f%d.root", mcEngine.Data(), fileId); TString outparam = Form("data/testpar_%s_f%d.root", mcEngine.Data(), fileId); diff --git a/examples/advanced/propagator/macros/runMC.C b/examples/advanced/propagator/macros/runMC.C index e4d258abb6..abf3d0f77c 100644 --- a/examples/advanced/propagator/macros/runMC.C +++ b/examples/advanced/propagator/macros/runMC.C @@ -55,8 +55,7 @@ int runMC(Int_t nEvents = 1000, TString mcEngine = "TGeant4", Bool_t isMT = fals // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine + FairExampleRunSim run{mcEngine}; // run.SetSimulationConfig(new FairVMCConfig()); run.SetIsMT(isMT); // Multi-threading mode (Geant4 only) run.SetSink(std::make_unique(outFile)); diff --git a/examples/advanced/propagator/macros/runMM.C b/examples/advanced/propagator/macros/runMM.C index 652cff0369..faa9cdfa2e 100644 --- a/examples/advanced/propagator/macros/runMM.C +++ b/examples/advanced/propagator/macros/runMM.C @@ -47,8 +47,7 @@ int runMM(Int_t nEvents = 1000, TString mcEngine = "TGeant4", Bool_t isMT = fals // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine + FairExampleRunSim run{mcEngine}; // run.SetSimulationConfig(new FairVMCConfig()); run.SetIsMT(isMT); // Multi-threading mode (Geant4 only) run.SetSink(new FairRootFileSink(outFile)); // Output file diff --git a/examples/common/mcstack/CMakeLists.txt b/examples/common/mcstack/CMakeLists.txt index 9cebc30630..0fe55e593f 100644 --- a/examples/common/mcstack/CMakeLists.txt +++ b/examples/common/mcstack/CMakeLists.txt @@ -9,6 +9,7 @@ set(target ExMCStack) set(sources + FairExampleRunSim.cxx FairMCTrack.cxx FairStack.cxx ) diff --git a/examples/common/mcstack/FairExampleRunSim.cxx b/examples/common/mcstack/FairExampleRunSim.cxx new file mode 100644 index 0000000000..381b91a1ec --- /dev/null +++ b/examples/common/mcstack/FairExampleRunSim.cxx @@ -0,0 +1,15 @@ +/******************************************************************************** + * Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence (LGPL) version 3, * + * copied verbatim in the file "LICENSE" * + ********************************************************************************/ + +#include "FairExampleRunSim.h" + +FairExampleRunSim::FairExampleRunSim(const char* mcEngine) + : FairRunSim() +{ + SetName(mcEngine); +} diff --git a/examples/common/mcstack/FairExampleRunSim.h b/examples/common/mcstack/FairExampleRunSim.h new file mode 100644 index 0000000000..fd11b43357 --- /dev/null +++ b/examples/common/mcstack/FairExampleRunSim.h @@ -0,0 +1,28 @@ +/******************************************************************************** + * Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence (LGPL) version 3, * + * copied verbatim in the file "LICENSE" * + ********************************************************************************/ +#ifndef FAIREXAMPLERUNSIM_H +#define FAIREXAMPLERUNSIM_H + +#include "FairRunSim.h" + +/** + * \brief RunSim with specific behaviour for an experiment + * + * One can derive from the FairRun classes. + * But please only call public APIs from inside any member + * functions. + */ +class FairExampleRunSim : public FairRunSim +{ + public: + explicit FairExampleRunSim(const char* mcEngine); + ~FairExampleRunSim() override = default; + ClassDefOverride(FairExampleRunSim, 0); +}; + +#endif diff --git a/examples/common/mcstack/LinkDef.h b/examples/common/mcstack/LinkDef.h index bece7e043d..dc9b2f13df 100644 --- a/examples/common/mcstack/LinkDef.h +++ b/examples/common/mcstack/LinkDef.h @@ -1,8 +1,8 @@ /******************************************************************************** - * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * - * This software is distributed under the terms of the * - * GNU Lesser General Public Licence (LGPL) version 3, * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // $Id: ZdcLinkDef.h,v 1.1.1.1 @@ -14,8 +14,8 @@ #pragma link off all classes; #pragma link off all functions; +#pragma link C++ class FairExampleRunSim+; #pragma link C++ class FairStack+; #pragma link C++ class FairMCTrack+; #endif - diff --git a/examples/simulation/Tutorial1/macros/run_tutorial1.C b/examples/simulation/Tutorial1/macros/run_tutorial1.C index ac18abbf35..1d49b6f895 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1.C @@ -68,8 +68,7 @@ int run_tutorial1(int nEvents = 10, string mcEngine = "TGeant3", bool isMT = tru // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - auto run = std::make_unique(); - run->SetName(mcEngine.c_str()); // Transport engine + auto run = std::make_unique(mcEngine.c_str()); auto config = std::make_unique(); if (loadPostInitConfig) config->UsePostInitConfig(); diff --git a/examples/simulation/Tutorial1/macros/run_tutorial1_binary.C b/examples/simulation/Tutorial1/macros/run_tutorial1_binary.C index 23cd7e591a..d592ef3f69 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_binary.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_binary.C @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence (LGPL) version 3, * @@ -7,23 +7,23 @@ ********************************************************************************/ #if !defined(__CLING__) || defined(__ROOTCLING__) -#include #include "FairBoxGenerator.h" #include "FairCave.h" +#include "FairExampleRunSim.h" #include "FairParRootFileIo.h" #include "FairPrimaryGenerator.h" #include "FairRootFileSink.h" -#include "FairRunSim.h" #include "FairSimConfig.h" #include "FairSystemInfo.h" #include "FairTutorialDet1.h" +#endif #include #include +#include using std::cout; using std::endl; -#endif void run_tutorial1_main(const FairSimConfig& config); @@ -76,8 +76,7 @@ void run_tutorial1_main(const FairSimConfig& config) // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - FairRunSim run; - run.SetName(config.GetEngine()); // Transport engine + FairExampleRunSim run(config.GetEngine()); run.SetIsMT(config.IsMultiThreaded()); // Multi-threading mode (Geant4 only) run.SetSink(std::make_unique(outFile)); FairRuntimeDb* rtdb = run.GetRuntimeDb(); diff --git a/examples/simulation/Tutorial1/macros/run_tutorial1_fastsim.C b/examples/simulation/Tutorial1/macros/run_tutorial1_fastsim.C index c83c6bd64a..5da991b959 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_fastsim.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_fastsim.C @@ -64,8 +64,7 @@ void run_tutorial1_fastsim(Int_t nEvents = 10, TString mcEngine = "TGeant3", Boo // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine + FairExampleRunSim run{mcEngine}; run.SetIsMT(isMT); // Multi-threading mode (Geant4 only) run.SetSink(new FairRootFileSink(outFile)); // Output file FairRuntimeDb* rtdb = run.GetRuntimeDb(); diff --git a/examples/simulation/Tutorial1/macros/run_tutorial1_mesh.C b/examples/simulation/Tutorial1/macros/run_tutorial1_mesh.C index 67ac1baa81..f158772025 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_mesh.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_mesh.C @@ -63,8 +63,7 @@ void run_tutorial1_mesh(Int_t nEvents = 10, TString mcEngine = "TGeant3") // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine + FairExampleRunSim run{mcEngine}; run.SetSink(std::make_unique(outFile)); FairRuntimeDb* rtdb = run.GetRuntimeDb(); // ------------------------------------------------------------------------ diff --git a/examples/simulation/Tutorial1/macros/run_tutorial1_pythia6.C b/examples/simulation/Tutorial1/macros/run_tutorial1_pythia6.C index 5e6d568777..3b01f76ef1 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_pythia6.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_pythia6.C @@ -67,8 +67,7 @@ void run_tutorial1_pythia6(Int_t nEvents = 10, TString mcEngine = "TGeant3") // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine + FairExampleRunSim run{mcEngine}; run.SetSink(std::make_unique(outFile)); run.SetPythiaDecayer(pythia6Config); // Define Pythia6 as decayer diff --git a/examples/simulation/Tutorial1/macros/run_tutorial1_pythia8.C b/examples/simulation/Tutorial1/macros/run_tutorial1_pythia8.C index a7f4e20f87..35e9665315 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_pythia8.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_pythia8.C @@ -67,8 +67,7 @@ void run_tutorial1_pythia8(Int_t nEvents = 10, TString mcEngine = "TGeant3") // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine + FairExampleRunSim run{mcEngine}; run.SetSink(std::make_unique(outFile)); run.SetPythiaDecayer(pythia8Config); // Define Pythia8 as decayer diff --git a/examples/simulation/Tutorial1/macros/run_tutorial1_urqmd.C b/examples/simulation/Tutorial1/macros/run_tutorial1_urqmd.C index 972cddd6c8..7f744de18e 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_urqmd.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_urqmd.C @@ -53,8 +53,7 @@ void run_tutorial1_urqmd(Int_t nEvents = 2, TString mcEngine = "TGeant3") // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine + FairExampleRunSim run{mcEngine}; run.SetSink(std::make_unique(outFile)); FairRuntimeDb* rtdb = run.GetRuntimeDb(); // ------------------------------------------------------------------------ diff --git a/examples/simulation/Tutorial1/src/CMakeLists.txt b/examples/simulation/Tutorial1/src/CMakeLists.txt index c92cb469fe..76e88e8c2e 100644 --- a/examples/simulation/Tutorial1/src/CMakeLists.txt +++ b/examples/simulation/Tutorial1/src/CMakeLists.txt @@ -63,7 +63,10 @@ install(TARGETS ${target} LIBRARY DESTINATION ${PROJECT_INSTALL_LIBDIR}) install(FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) add_executable(tut1 runTutorial1.cxx) -target_link_libraries(tut1 PRIVATE ExSimulation1) +target_link_libraries(tut1 + PRIVATE + ExSimulation1 + FairRoot::ExMCStack) install(TARGETS tut1 RUNTIME DESTINATION ${PROJECT_INSTALL_DATADIR}/examples/simulation/Tutorial1/bin diff --git a/examples/simulation/Tutorial2/macros/CMakeLists.txt b/examples/simulation/Tutorial2/macros/CMakeLists.txt index 8873b91e40..df1e211938 100644 --- a/examples/simulation/Tutorial2/macros/CMakeLists.txt +++ b/examples/simulation/Tutorial2/macros/CMakeLists.txt @@ -25,6 +25,7 @@ endforeach() add_library(${prefix}_check_compile OBJECT ${macrofiles}) target_link_libraries(${prefix}_check_compile PRIVATE FairRoot::ExSimulation2 + FairRoot::ExMCStack FairRoot::ExPassive FairRoot::Generators) diff --git a/examples/simulation/Tutorial2/macros/run_background.C b/examples/simulation/Tutorial2/macros/run_background.C index 478aba20e7..adf8ae30d6 100644 --- a/examples/simulation/Tutorial2/macros/run_background.C +++ b/examples/simulation/Tutorial2/macros/run_background.C @@ -10,11 +10,11 @@ #include "FairBoxGenerator.h" #include "FairCave.h" #include "FairDetector.h" +#include "FairExampleRunSim.h" #include "FairModule.h" #include "FairParRootFileIo.h" #include "FairPrimaryGenerator.h" #include "FairRootFileSink.h" -#include "FairRunSim.h" #include "FairRuntimeDb.h" #include "FairSystemInfo.h" #include "FairTutorialDet2.h" @@ -79,8 +79,7 @@ void run_background(Int_t nEvents = 130) // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - auto run = std::make_unique(); - run->SetName("TGeant4"); // Transport engine + auto run = std::make_unique("TGeant4"); run->SetSink(std::make_unique(outFile)); FairRuntimeDb* rtdb = run->GetRuntimeDb(); // ------------------------------------------------------------------------ diff --git a/examples/simulation/Tutorial2/macros/run_signal.C b/examples/simulation/Tutorial2/macros/run_signal.C index 3916ad5740..aa310bd6ab 100644 --- a/examples/simulation/Tutorial2/macros/run_signal.C +++ b/examples/simulation/Tutorial2/macros/run_signal.C @@ -10,11 +10,11 @@ #include "FairBoxGenerator.h" #include "FairCave.h" #include "FairDetector.h" +#include "FairExampleRunSim.h" #include "FairModule.h" #include "FairParRootFileIo.h" #include "FairPrimaryGenerator.h" #include "FairRootFileSink.h" -#include "FairRunSim.h" #include "FairRuntimeDb.h" #include "FairSystemInfo.h" #include "FairTutorialDet2.h" @@ -80,8 +80,7 @@ void run_signal(Int_t fileNr, Int_t nEvents = 10) // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - auto run = std::make_unique(); - run->SetName("TGeant4"); // Transport engine + auto run = std::make_unique("TGeant4"); run->SetSink(std::make_unique(outFile)); FairRuntimeDb* rtdb = run->GetRuntimeDb(); // ------------------------------------------------------------------------ diff --git a/examples/simulation/Tutorial2/macros/run_tutorial2.C b/examples/simulation/Tutorial2/macros/run_tutorial2.C index ea8b51399b..fcd1f6f4b3 100644 --- a/examples/simulation/Tutorial2/macros/run_tutorial2.C +++ b/examples/simulation/Tutorial2/macros/run_tutorial2.C @@ -10,11 +10,11 @@ #include "FairBoxGenerator.h" #include "FairCave.h" #include "FairDetector.h" +#include "FairExampleRunSim.h" #include "FairModule.h" #include "FairParRootFileIo.h" #include "FairPrimaryGenerator.h" #include "FairRootFileSink.h" -#include "FairRunSim.h" #include "FairRuntimeDb.h" #include "FairSystemInfo.h" #include "FairTutorialDet2.h" @@ -79,9 +79,8 @@ void run_tutorial2(Int_t nEvents = 10, TString mcEngine = "TGeant4", Bool_t isMT // ------------------------------------------------------------------------ // ----- Create simulation run ---------------------------------------- - auto run = std::make_unique(); - run->SetName(mcEngine); // Transport engine - run->SetIsMT(isMT); // Multi-threading mode (Geant4 only) + auto run = std::make_unique(mcEngine); + run->SetIsMT(isMT); // Multi-threading mode (Geant4 only) run->SetSink(std::make_unique(outFile)); FairRuntimeDb* rtdb = run->GetRuntimeDb(); // ------------------------------------------------------------------------ diff --git a/examples/simulation/Tutorial4/macros/run_tutorial4.C b/examples/simulation/Tutorial4/macros/run_tutorial4.C index d033ac6117..7007f1e1b3 100644 --- a/examples/simulation/Tutorial4/macros/run_tutorial4.C +++ b/examples/simulation/Tutorial4/macros/run_tutorial4.C @@ -73,9 +73,8 @@ void run_tutorial4(Int_t nEvents = 10, TString mcEngine = "TGeant3", Bool_t doAl // gLogger->SetLogScreenLevel("INFO"); // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine - run.SetIsMT(isMT); // Multi-threading mode (Geant4 only) + FairExampleRunSim run{mcEngine}; + run.SetIsMT(isMT); // Multi-threading mode (Geant4 only) run.SetSink(std::make_unique(outFile)); FairRuntimeDb* rtdb = run.GetRuntimeDb(); // ------------------------------------------------------------------------ diff --git a/examples/simulation/Tutorial4/macros/run_tutorial4_createGeometryFile.C b/examples/simulation/Tutorial4/macros/run_tutorial4_createGeometryFile.C index d52b6c36dc..ecdbbac77f 100644 --- a/examples/simulation/Tutorial4/macros/run_tutorial4_createGeometryFile.C +++ b/examples/simulation/Tutorial4/macros/run_tutorial4_createGeometryFile.C @@ -66,8 +66,7 @@ void run_tutorial4_createGeometryFile(Int_t nEvents = 1, TString mcEngine = "TGe // gLogger->SetLogScreenLevel("INFO"); // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine + FairExampleRunSim run{mcEngine}; run.SetIsMT(isMT); // Multi-threading mode (Geant4 only) run.SetSink(new FairRootFileSink(outFile)); // Output file FairRuntimeDb* rtdb = run.GetRuntimeDb(); diff --git a/examples/simulation/Tutorial4/macros/run_tutorial4_createMatrices.C b/examples/simulation/Tutorial4/macros/run_tutorial4_createMatrices.C index 63274bcff1..75ea581f76 100644 --- a/examples/simulation/Tutorial4/macros/run_tutorial4_createMatrices.C +++ b/examples/simulation/Tutorial4/macros/run_tutorial4_createMatrices.C @@ -63,8 +63,7 @@ void run_tutorial4_createMatrices(Int_t nEvents = 10, TString mcEngine = "TGeant // gLogger->SetLogScreenLevel("INFO"); // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine + FairExampleRunSim run{mcEngine}; run.SetIsMT(isMT); // Multi-threading mode (Geant4 only) run.SetSink(new FairRootFileSink(outFile)); // Output file FairRuntimeDb* rtdb = run.GetRuntimeDb(); diff --git a/examples/simulation/rutherford/macros/run_rad.C b/examples/simulation/rutherford/macros/run_rad.C index 8f4d058a90..3feb88d986 100644 --- a/examples/simulation/rutherford/macros/run_rad.C +++ b/examples/simulation/rutherford/macros/run_rad.C @@ -58,8 +58,7 @@ void run_rad(Int_t nEvents = 100, TString mcEngine = "TGeant4") logger->SetLogVerbosityLevel("HIGH"); // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine + FairExampleRunSim run{mcEngine}; run.SetSink(std::make_unique(outFile)); FairRuntimeDb* rtdb = run.GetRuntimeDb(); // ------------------------------------------------------------------------ diff --git a/examples/simulation/rutherford/macros/run_rutherford.C b/examples/simulation/rutherford/macros/run_rutherford.C index 3a82c1c5ce..37c963f767 100644 --- a/examples/simulation/rutherford/macros/run_rutherford.C +++ b/examples/simulation/rutherford/macros/run_rutherford.C @@ -63,9 +63,8 @@ void run_rutherford(Int_t nEvents = 10, TString mcEngine = "TGeant4", Bool_t isM logger->SetLogVerbosityLevel("HIGH"); // ----- Create simulation run ---------------------------------------- - FairRunSim run{}; - run.SetName(mcEngine); // Transport engine - run.SetIsMT(isMT); // Multi-threading mode (Geant4 only) + FairExampleRunSim run{mcEngine}; + run.SetIsMT(isMT); // Multi-threading mode (Geant4 only) run.SetSink(std::make_unique(outFile)); FairRuntimeDb* rtdb = run.GetRuntimeDb(); // ------------------------------------------------------------------------