From 17c32e7d4d1f6d08eaeb33f2e6c8661fcc982519 Mon Sep 17 00:00:00 2001 From: Radoslaw Karabowicz Date: Tue, 15 Sep 2020 14:57:32 +0200 Subject: [PATCH] Remove the depracated warning about using gconfig.C Use the FairVMCConfig in the simulation macros. Addresses issue #1010. --- examples/MQ/pixelDetector/macros/run_sim.C | 1 + examples/MQ/pixelDetector/src/CMakeLists.txt | 1 + .../src/devices/FairMQSimDevice.cxx | 3 +- examples/advanced/Tutorial3/macro/run_sim.C | 1 + .../advanced/Tutorial3/macro/run_sim_sep.C | 1 + examples/advanced/propagator/macros/runMC.C | 2 +- examples/advanced/propagator/macros/runMM.C | 2 +- .../Tutorial1/macros/run_tutorial1.C | 2 +- .../Tutorial1/macros/run_tutorial1_binary.C | 2 + .../Tutorial1/macros/run_tutorial1_fastsim.C | 1 + .../Tutorial1/macros/run_tutorial1_mesh.C | 1 + .../Tutorial1/macros/run_tutorial1_pythia6.C | 1 + .../Tutorial1/macros/run_tutorial1_pythia8.C | 1 + .../Tutorial1/macros/run_tutorial1_urqmd.C | 1 + .../simulation/Tutorial1/src/CMakeLists.txt | 1 + .../Tutorial2/macros/run_background.C | 1 + .../simulation/Tutorial2/macros/run_signal.C | 1 + .../Tutorial2/macros/run_tutorial2.C | 1 + .../Tutorial4/gconfig/g3Config.yaml | 40 +++++++++++++++++++ .../Tutorial4/gconfig/g4Config.yaml | 40 +++++++++++++++++++ .../Tutorial4/macros/run_tutorial4.C | 1 + .../simulation/rutherford/macros/run_rad.C | 1 + .../rutherford/macros/run_rutherford.C | 1 + 23 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 examples/simulation/Tutorial4/gconfig/g3Config.yaml create mode 100644 examples/simulation/Tutorial4/gconfig/g4Config.yaml diff --git a/examples/MQ/pixelDetector/macros/run_sim.C b/examples/MQ/pixelDetector/macros/run_sim.C index 106793b803..c282be5a79 100644 --- a/examples/MQ/pixelDetector/macros/run_sim.C +++ b/examples/MQ/pixelDetector/macros/run_sim.C @@ -49,6 +49,7 @@ void run_sim(Int_t nEvents = 10, TString mcEngine = "TGeant3", Int_t fileId = 0, // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine + run->SetSimulationConfig(new FairVMCConfig()); run->SetIsMT(isMT); // Multi-threading mode (Geant4 only) run->SetSink(new FairRootFileSink(outFile)); FairRuntimeDb* rtdb = run->GetRuntimeDb(); diff --git a/examples/MQ/pixelDetector/src/CMakeLists.txt b/examples/MQ/pixelDetector/src/CMakeLists.txt index bb72078c1e..9684fc8193 100644 --- a/examples/MQ/pixelDetector/src/CMakeLists.txt +++ b/examples/MQ/pixelDetector/src/CMakeLists.txt @@ -78,6 +78,7 @@ target_link_libraries(${target} PUBLIC FairRoot::Gen # FairBoxGenerator FairRoot::GeoBase FairRoot::ParBase # FairParGenericSet + FairRoot::ExGConfig FairRoot::ExMCStack FairRoot::ExPassive # FairCave diff --git a/examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx b/examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx index c5a085d855..4de2231e63 100644 --- a/examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx +++ b/examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx @@ -19,6 +19,7 @@ #include "FairPrimaryGenerator.h" #include "FairRunSim.h" #include "FairRuntimeDb.h" +#include "FairVMCConfig.h" #include #include @@ -63,7 +64,7 @@ void FairMQSimDevice::InitTask() } fRunSim->SetName(fTransportName.data()); - // fRunSim->SetSimulationConfig(new FairVMCConfig()); + fRunSim->SetSimulationConfig(new FairVMCConfig()); fRunSim->SetIsMT(kFALSE); if (fUserConfig.Length() > 0) diff --git a/examples/advanced/Tutorial3/macro/run_sim.C b/examples/advanced/Tutorial3/macro/run_sim.C index 8b92de2444..ae5f88840d 100644 --- a/examples/advanced/Tutorial3/macro/run_sim.C +++ b/examples/advanced/Tutorial3/macro/run_sim.C @@ -29,6 +29,7 @@ void run_sim(Int_t nEvents = 100, TString mcEngine = "TGeant3") // ------------------------ fRun->SetName(mcEngine); + fRun->SetSimulationConfig(new FairVMCConfig()); 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 cca86f2520..24a042bc91 100644 --- a/examples/advanced/Tutorial3/macro/run_sim_sep.C +++ b/examples/advanced/Tutorial3/macro/run_sim_sep.C @@ -23,6 +23,7 @@ void run_sim_sep(Int_t fileId, Int_t nEvents = 1000, TString mcEngine = "TGeant3 // ------------------------ fRun->SetName(mcEngine); + fRun->SetSimulationConfig(new FairVMCConfig()); 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 3460ab1cb7..9a3e9f27c6 100644 --- a/examples/advanced/propagator/macros/runMC.C +++ b/examples/advanced/propagator/macros/runMC.C @@ -50,7 +50,7 @@ int runMC(Int_t nEvents = 1000, TString mcEngine = "TGeant4", Bool_t isMT = fals // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine - // run->SetSimulationConfig(new FairVMCConfig()); + run->SetSimulationConfig(new FairVMCConfig()); run->SetIsMT(isMT); // Multi-threading mode (Geant4 only) run->SetSink(new FairRootFileSink(outFile)); // Output file FairRuntimeDb* rtdb = run->GetRuntimeDb(); diff --git a/examples/advanced/propagator/macros/runMM.C b/examples/advanced/propagator/macros/runMM.C index db3aeec1a7..40ee0a681f 100644 --- a/examples/advanced/propagator/macros/runMM.C +++ b/examples/advanced/propagator/macros/runMM.C @@ -43,7 +43,7 @@ int runMM(Int_t nEvents = 1000, TString mcEngine = "TGeant4", Bool_t isMT = fals // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine - // run->SetSimulationConfig(new FairVMCConfig()); + run->SetSimulationConfig(new FairVMCConfig()); 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.C b/examples/simulation/Tutorial1/macros/run_tutorial1.C index 4e131a9d45..31a1f61f0f 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1.C @@ -62,7 +62,7 @@ void run_tutorial1(Int_t nEvents = 10, TString mcEngine = "TGeant3", Bool_t isMT // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine - // run->SetSimulationConfig(new FairVMCConfig()); + run->SetSimulationConfig(new FairVMCConfig()); 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_binary.C b/examples/simulation/Tutorial1/macros/run_tutorial1_binary.C index f6704c527f..c095c6660a 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_binary.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_binary.C @@ -18,6 +18,7 @@ using namespace std; #include "FairSimConfig.h" #include "FairSystemInfo.h" #include "FairTutorialDet1.h" +#include "FairVMCConfig.h" #include #include @@ -76,6 +77,7 @@ void run_tutorial1_main(const FairSimConfig& config) // ----- Create simulation run ---------------------------------------- FairRunSim run; run.SetName(config.GetEngine()); // Transport engine + run.SetSimulationConfig(new FairVMCConfig()); run.SetIsMT(config.IsMultiThreaded()); // 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_fastsim.C b/examples/simulation/Tutorial1/macros/run_tutorial1_fastsim.C index a1564d518a..acf92df1b8 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_fastsim.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_fastsim.C @@ -62,6 +62,7 @@ void run_tutorial1_fastsim(Int_t nEvents = 10, TString mcEngine = "TGeant3", Boo // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine + run->SetSimulationConfig(new FairVMCConfig()); 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 ba40e573ce..6cc867c974 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_mesh.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_mesh.C @@ -60,6 +60,7 @@ void run_tutorial1_mesh(Int_t nEvents = 10, TString mcEngine = "TGeant3") // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine + run->SetSimulationConfig(new FairVMCConfig()); run->SetSink(new FairRootFileSink(outFile)); // Output file 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 029ca1fbcd..7f38c54518 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_pythia6.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_pythia6.C @@ -64,6 +64,7 @@ void run_tutorial1_pythia6(Int_t nEvents = 10, TString mcEngine = "TGeant3") // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine + run->SetSimulationConfig(new FairVMCConfig()); run->SetSink(new FairRootFileSink(outFile)); // Output file 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 f7b741f56d..480cc6c8d3 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_pythia8.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_pythia8.C @@ -64,6 +64,7 @@ void run_tutorial1_pythia8(Int_t nEvents = 10, TString mcEngine = "TGeant3") // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine + run->SetSimulationConfig(new FairVMCConfig()); run->SetSink(new FairRootFileSink(outFile)); // Output file 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 d7b978eedc..f6fcac959f 100644 --- a/examples/simulation/Tutorial1/macros/run_tutorial1_urqmd.C +++ b/examples/simulation/Tutorial1/macros/run_tutorial1_urqmd.C @@ -46,6 +46,7 @@ void run_tutorial1_urqmd(Int_t nEvents = 2, TString mcEngine = "TGeant3") // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine + run->SetSimulationConfig(new FairVMCConfig()); run->SetSink(new FairRootFileSink(outFile)); // Output file FairRuntimeDb* rtdb = run->GetRuntimeDb(); // ------------------------------------------------------------------------ diff --git a/examples/simulation/Tutorial1/src/CMakeLists.txt b/examples/simulation/Tutorial1/src/CMakeLists.txt index 93c8b71de8..86619850c0 100644 --- a/examples/simulation/Tutorial1/src/CMakeLists.txt +++ b/examples/simulation/Tutorial1/src/CMakeLists.txt @@ -42,6 +42,7 @@ target_link_libraries(${target} PUBLIC FairRoot::FairTools # FairLogger FairRoot::FairFastSim FairRoot::ParBase + FairRoot::ExGConfig FairRoot::ExPassive FairRoot::ExMCStack FairRoot::Gen diff --git a/examples/simulation/Tutorial2/macros/run_background.C b/examples/simulation/Tutorial2/macros/run_background.C index 6ed06e0f6f..988d198794 100644 --- a/examples/simulation/Tutorial2/macros/run_background.C +++ b/examples/simulation/Tutorial2/macros/run_background.C @@ -50,6 +50,7 @@ void run_background(Int_t nEvents = 130) // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName("TGeant3"); // Transport engine + run->SetSimulationConfig(new FairVMCConfig()); run->SetSink(new FairRootFileSink(outFile)); // Output file FairRuntimeDb* rtdb = run->GetRuntimeDb(); // ------------------------------------------------------------------------ diff --git a/examples/simulation/Tutorial2/macros/run_signal.C b/examples/simulation/Tutorial2/macros/run_signal.C index d55ff3076b..b1588a6aeb 100644 --- a/examples/simulation/Tutorial2/macros/run_signal.C +++ b/examples/simulation/Tutorial2/macros/run_signal.C @@ -52,6 +52,7 @@ void run_signal(Int_t fileNr, Int_t nEvents = 10) // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName("TGeant3"); // Transport engine + run->SetSimulationConfig(new FairVMCConfig()); run->SetSink(new FairRootFileSink(outFile)); // Output file FairRuntimeDb* rtdb = run->GetRuntimeDb(); // ------------------------------------------------------------------------ diff --git a/examples/simulation/Tutorial2/macros/run_tutorial2.C b/examples/simulation/Tutorial2/macros/run_tutorial2.C index b5155648e2..7fd39a31d3 100644 --- a/examples/simulation/Tutorial2/macros/run_tutorial2.C +++ b/examples/simulation/Tutorial2/macros/run_tutorial2.C @@ -61,6 +61,7 @@ void run_tutorial2(Int_t nEvents = 10, TString mcEngine = "TGeant3", Bool_t isMT // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine + run->SetSimulationConfig(new FairVMCConfig()); 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/gconfig/g3Config.yaml b/examples/simulation/Tutorial4/gconfig/g3Config.yaml new file mode 100644 index 0000000000..dcff81f6e4 --- /dev/null +++ b/examples/simulation/Tutorial4/gconfig/g3Config.yaml @@ -0,0 +1,40 @@ +G3_TRIG: 1 +G3_SWIT: [4, 100] +G3_DEBU: [0, 0, 1] +G3_RAYL: 1 +G3_STRA: 1 +G3_AUTO: 0 #Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0) +G3_ABAN: 0 #Restore 3.16 behaviour for abandoned tracks +G3_OPTI: 2 #Select optimisation level for GEANT geometry searches (0,1,2) +G3_ERAN: 5.e-7 +G3_CKOV: 1 #Cerenkov photons + +MonteCarlo_Process: + PAIR: 1 #pair production + COMP: 1 #Compton scattering + PHOT: 1 #photo electric effect + PFIS: 0 #photofission + DRAY: 1 #delta-ray + ANNI: 1 #annihilation + BREM: 1 #bremsstrahlung + HADR: 1 #hadronic process + MUNU: 1 #muon nuclear interaction + DCAY: 1 #decay + LOSS: 1 #energy loss + MULS: 0 #multiple scattering + +MonteCarlo_Cut: + CUTGAM: 1.0E-3 #gammas (GeV) + CUTELE: 1.0E-3 #electrons (GeV) + CUTNEU: 1.0E-3 #neutral hadrons (GeV) + CUTHAD: 1.0E-3 #charged hadrons (GeV) + CUTMUO: 1.0E-3 #muons (GeV) + BCUTE: 1.0E-3 #electron bremsstrahlung (GeV) + BCUTM: 1.0E-3 #muon and hadron bremsstrahlung (GeV) + DCUTE: 1.0E-3 #delta-rays by electrons (GeV) + DCUTM: 1.0E-3 #delta-rays by muons (GeV) + PPCUTM: 1.0E-3 #direct pair production by muons (GeV) + TOFMAX: 1.E10 #time of flight cut in seconds + +FairStack_StoreSecondaries: true +FairStack_MinPoints: 0 diff --git a/examples/simulation/Tutorial4/gconfig/g4Config.yaml b/examples/simulation/Tutorial4/gconfig/g4Config.yaml new file mode 100644 index 0000000000..268a87fda0 --- /dev/null +++ b/examples/simulation/Tutorial4/gconfig/g4Config.yaml @@ -0,0 +1,40 @@ +Geant4_UserGeometry: "geomRoot" +Geant4_PhysicsList: "QGSP_BERT_EMV" +Geant4_SpecialProcess: "stepLimiter+specialCuts+specialControls" +Geant4_SpecialStacking: false +Geant4_Multithreaded: false + +Geant4_MaxNStep: 10000 #default is 30000 +Geant4_Commands: + - /cuts/setHighEdge 100 GeV + - /tracking/verbose 0 + +MonteCarlo_Process: + PAIR: 1 #pair production + COMP: 1 #Compton scattering + PHOT: 1 #photo electric effect + PFIS: 0 #photofission + DRAY: 1 #delta-ray + ANNI: 1 #annihilation + BREM: 1 #bremsstrahlung + HADR: 1 #hadronic process + MUNU: 1 #muon nuclear interaction + DCAY: 1 #decay + LOSS: 1 #energy loss + MULS: 1 #multiple scattering + +MonteCarlo_Cut: + CUTGAM: 1.0E-3 #gammas (GeV) + CUTELE: 1.0E-3 #electrons (GeV) + CUTNEU: 1.0E-3 #neutral hadrons (GeV) + CUTHAD: 1.0E-3 #charged hadrons (GeV) + CUTMUO: 1.0E-3 #muons (GeV) + BCUTE: 1.0E-3 #electron bremsstrahlung (GeV) + BCUTM: 1.0E-3 #muon and hadron bremsstrahlung (GeV) + DCUTE: 1.0E-3 #delta-rays by electrons (GeV) + DCUTM: 1.0E-3 #delta-rays by muons (GeV) + PPCUTM: 1.0E-3 #direct pair production by muons (GeV) + TOFMAX: 1.E10 #time of flight cut in seconds + +FairStack_StoreSecondaries: true +FairStack_MinPoints: 0 diff --git a/examples/simulation/Tutorial4/macros/run_tutorial4.C b/examples/simulation/Tutorial4/macros/run_tutorial4.C index d24fb7d38f..7435286944 100644 --- a/examples/simulation/Tutorial4/macros/run_tutorial4.C +++ b/examples/simulation/Tutorial4/macros/run_tutorial4.C @@ -65,6 +65,7 @@ void run_tutorial4(Int_t nEvents = 10, TString mcEngine = "TGeant3", Bool_t doAl // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine + run->SetSimulationConfig(new FairVMCConfig()); 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 d636dd08af..a4dfa3ad55 100644 --- a/examples/simulation/rutherford/macros/run_rad.C +++ b/examples/simulation/rutherford/macros/run_rad.C @@ -51,6 +51,7 @@ void run_rad(Int_t nEvents = 100, TString mcEngine = "TGeant3") // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine + run->SetSimulationConfig(new FairVMCConfig()); run->SetSink(new FairRootFileSink(outFile)); // Output file FairRuntimeDb* rtdb = run->GetRuntimeDb(); // ------------------------------------------------------------------------ diff --git a/examples/simulation/rutherford/macros/run_rutherford.C b/examples/simulation/rutherford/macros/run_rutherford.C index df59fd85a9..7c9f87299c 100644 --- a/examples/simulation/rutherford/macros/run_rutherford.C +++ b/examples/simulation/rutherford/macros/run_rutherford.C @@ -53,6 +53,7 @@ void run_rutherford(Int_t nEvents = 10, TString mcEngine = "TGeant4", Bool_t isM // ----- Create simulation run ---------------------------------------- FairRunSim* run = new FairRunSim(); run->SetName(mcEngine); // Transport engine + // run->SetSimulationConfig(new FairVMCConfig()); run->SetIsMT(isMT); // Multi-threading mode (Geant4 only) run->SetSink(new FairRootFileSink(outFile)); // Output file FairRuntimeDb* rtdb = run->GetRuntimeDb();