Skip to content

Commit

Permalink
Remove the depracated warning about using gconfig.C
Browse files Browse the repository at this point in the history
Use the FairVMCConfig in the simulation macros.

Addresses issue FairRootGroup#1010.
  • Loading branch information
karabowi committed Nov 18, 2020
1 parent 197187c commit 17c32e7
Show file tree
Hide file tree
Showing 23 changed files with 103 additions and 4 deletions.
1 change: 1 addition & 0 deletions examples/MQ/pixelDetector/macros/run_sim.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions examples/MQ/pixelDetector/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ target_link_libraries(${target} PUBLIC
FairRoot::Gen # FairBoxGenerator
FairRoot::GeoBase
FairRoot::ParBase # FairParGenericSet
FairRoot::ExGConfig
FairRoot::ExMCStack
FairRoot::ExPassive # FairCave

Expand Down
3 changes: 2 additions & 1 deletion examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "FairPrimaryGenerator.h"
#include "FairRunSim.h"
#include "FairRuntimeDb.h"
#include "FairVMCConfig.h"

#include <FairMQDevice.h>
#include <FairMQLogger.h>
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions examples/advanced/Tutorial3/macro/run_sim.C
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions examples/advanced/Tutorial3/macro/run_sim_sep.C
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/propagator/macros/runMC.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/propagator/macros/runMM.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion examples/simulation/Tutorial1/macros/run_tutorial1.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions examples/simulation/Tutorial1/macros/run_tutorial1_binary.C
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ using namespace std;
#include "FairSimConfig.h"
#include "FairSystemInfo.h"
#include "FairTutorialDet1.h"
#include "FairVMCConfig.h"

#include <TRandom3.h>
#include <TStopwatch.h>
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions examples/simulation/Tutorial1/macros/run_tutorial1_mesh.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
// ------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions examples/simulation/Tutorial1/macros/run_tutorial1_urqmd.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
// ------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions examples/simulation/Tutorial1/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ target_link_libraries(${target} PUBLIC
FairRoot::FairTools # FairLogger
FairRoot::FairFastSim
FairRoot::ParBase
FairRoot::ExGConfig
FairRoot::ExPassive
FairRoot::ExMCStack
FairRoot::Gen
Expand Down
1 change: 1 addition & 0 deletions examples/simulation/Tutorial2/macros/run_background.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
// ------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions examples/simulation/Tutorial2/macros/run_signal.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
// ------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions examples/simulation/Tutorial2/macros/run_tutorial2.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
40 changes: 40 additions & 0 deletions examples/simulation/Tutorial4/gconfig/g3Config.yaml
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions examples/simulation/Tutorial4/gconfig/g4Config.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions examples/simulation/Tutorial4/macros/run_tutorial4.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions examples/simulation/rutherford/macros/run_rad.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
// ------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions examples/simulation/rutherford/macros/run_rutherford.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 17c32e7

Please sign in to comment.