Skip to content

Commit c2f7a81

Browse files
committed
Remove the depracated warning about using gconfig.C
Use the FairVMCConfig in the simulation macros. Addresses issue #1010.
1 parent 5fab55d commit c2f7a81

25 files changed

+107
-4
lines changed

examples/MQ/pixelDetector/macros/run_sim.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ void run_sim(Int_t nEvents = 10, TString mcEngine = "TGeant3", Int_t fileId = 0,
6161
// ----- Create simulation run ----------------------------------------
6262
auto run = std::make_unique<FairRunSim>();
6363
run->SetName(mcEngine); // Transport engine
64+
run->SetSimulationConfig(new FairVMCConfig());
6465
run->SetIsMT(isMT); // Multi-threading mode (Geant4 only)
6566
run->SetSink(new FairRootFileSink(outFile));
6667
FairRuntimeDb* rtdb = run->GetRuntimeDb();

examples/MQ/pixelDetector/src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ list(APPEND headers
5757
add_library(${target} SHARED ${sources} ${no_dict_sources} ${headers} ${no_dict_headers})
5858
add_library(FairRoot::${target} ALIAS ${target})
5959
set_target_properties(${target} PROPERTIES ${PROJECT_LIBRARY_PROPERTIES})
60+
set_property(TARGET ${target} PROPERTY POSITION_INDEPENDENT_CODE ON)
6061

6162
target_include_directories(${target} PUBLIC
6263
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
@@ -71,6 +72,7 @@ target_link_libraries(${target} PUBLIC
7172
FairRoot::Gen # FairBoxGenerator
7273
FairRoot::GeoBase
7374
FairRoot::ParBase # FairParGenericSet
75+
FairRoot::ExGConfig
7476
FairRoot::ExMCStack
7577
FairRoot::ExPassive # FairCave
7678
FairRoot::FairMQ
@@ -84,6 +86,7 @@ target_link_libraries(${target} PUBLIC
8486
ROOT::Physics
8587
ROOT::Geom
8688
ROOT::Hist
89+
8790
${VMCLIB}
8891
)
8992

examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "FairPrimaryGenerator.h"
2020
#include "FairRunSim.h"
2121
#include "FairRuntimeDb.h"
22+
#include "FairVMCConfig.h"
2223

2324
#include <TCollection.h>
2425
#include <TList.h>
@@ -60,7 +61,7 @@ void FairMQSimDevice::InitTask()
6061
}
6162

6263
fRunSim->SetName(fTransportName.data());
63-
// fRunSim->SetSimulationConfig(new FairVMCConfig());
64+
fRunSim->SetSimulationConfig(new FairVMCConfig());
6465
fRunSim->SetIsMT(kFALSE);
6566

6667
if (fUserConfig.Length() > 0)

examples/advanced/Tutorial3/macro/run_sim.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ void run_sim(Int_t nEvents = 100, TString mcEngine = "TGeant3")
2929
// ------------------------
3030

3131
fRun->SetName(mcEngine);
32+
fRun->SetSimulationConfig(new FairVMCConfig());
3233

3334
TString outFile = "data/testrun_";
3435
outFile = outFile + mcEngine + ".root";

examples/advanced/Tutorial3/macro/run_sim_sep.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ void run_sim_sep(Int_t fileId, Int_t nEvents = 1000, TString mcEngine = "TGeant3
2323
// ------------------------
2424

2525
fRun->SetName(mcEngine);
26+
fRun->SetSimulationConfig(new FairVMCConfig());
2627

2728
TString outfile = Form("data/testrun_%s_f%d.root", mcEngine.Data(), fileId);
2829
TString outparam = Form("data/testpar_%s_f%d.root", mcEngine.Data(), fileId);

examples/advanced/propagator/macros/runMC.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int runMC(Int_t nEvents = 1000, TString mcEngine = "TGeant4", Bool_t isMT = fals
5050
// ----- Create simulation run ----------------------------------------
5151
FairRunSim* run = new FairRunSim();
5252
run->SetName(mcEngine); // Transport engine
53-
// run->SetSimulationConfig(new FairVMCConfig());
53+
run->SetSimulationConfig(new FairVMCConfig());
5454
run->SetIsMT(isMT); // Multi-threading mode (Geant4 only)
5555
run->SetSink(new FairRootFileSink(outFile)); // Output file
5656
FairRuntimeDb* rtdb = run->GetRuntimeDb();

examples/advanced/propagator/macros/runMM.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int runMM(Int_t nEvents = 1000, TString mcEngine = "TGeant4", Bool_t isMT = fals
4343
// ----- Create simulation run ----------------------------------------
4444
FairRunSim* run = new FairRunSim();
4545
run->SetName(mcEngine); // Transport engine
46-
// run->SetSimulationConfig(new FairVMCConfig());
46+
run->SetSimulationConfig(new FairVMCConfig());
4747
run->SetIsMT(isMT); // Multi-threading mode (Geant4 only)
4848
run->SetSink(new FairRootFileSink(outFile)); // Output file
4949
FairRuntimeDb* rtdb = run->GetRuntimeDb();

examples/simulation/Tutorial1/macros/run_tutorial1.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void run_tutorial1(Int_t nEvents = 10,
6565
// ----- Create simulation run ----------------------------------------
6666
FairRunSim* run = new FairRunSim();
6767
run->SetName(mcEngine); // Transport engine
68-
FairGenericVMCConfig* config = new FairGenericVMCConfig();
68+
FairVMCConfig* config = new FairVMCConfig();
6969
if (loadPostInitConfig)
7070
config->UsePostInitConfig();
7171
run->SetSimulationConfig(config);

examples/simulation/Tutorial1/macros/run_tutorial1_binary.C

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "FairSimConfig.h"
1818
#include "FairSystemInfo.h"
1919
#include "FairTutorialDet1.h"
20+
#include "FairVMCConfig.h"
2021

2122
#include <TRandom3.h>
2223
#include <TStopwatch.h>
@@ -78,6 +79,7 @@ void run_tutorial1_main(const FairSimConfig& config)
7879
// ----- Create simulation run ----------------------------------------
7980
FairRunSim run;
8081
run.SetName(config.GetEngine()); // Transport engine
82+
run.SetSimulationConfig(new FairVMCConfig());
8183
run.SetIsMT(config.IsMultiThreaded()); // Multi-threading mode (Geant4 only)
8284
run.SetSink(new FairRootFileSink(outFile)); // Output file
8385
FairRuntimeDb* rtdb = run.GetRuntimeDb();

examples/simulation/Tutorial1/macros/run_tutorial1_fastsim.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ void run_tutorial1_fastsim(Int_t nEvents = 10, TString mcEngine = "TGeant3", Boo
6262
// ----- Create simulation run ----------------------------------------
6363
FairRunSim* run = new FairRunSim();
6464
run->SetName(mcEngine); // Transport engine
65+
run->SetSimulationConfig(new FairVMCConfig());
6566
run->SetIsMT(isMT); // Multi-threading mode (Geant4 only)
6667
run->SetSink(new FairRootFileSink(outFile)); // Output file
6768
FairRuntimeDb* rtdb = run->GetRuntimeDb();

examples/simulation/Tutorial1/macros/run_tutorial1_mesh.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ void run_tutorial1_mesh(Int_t nEvents = 10, TString mcEngine = "TGeant3")
6060
// ----- Create simulation run ----------------------------------------
6161
FairRunSim* run = new FairRunSim();
6262
run->SetName(mcEngine); // Transport engine
63+
run->SetSimulationConfig(new FairVMCConfig());
6364
run->SetSink(new FairRootFileSink(outFile)); // Output file
6465
FairRuntimeDb* rtdb = run->GetRuntimeDb();
6566
// ------------------------------------------------------------------------

examples/simulation/Tutorial1/macros/run_tutorial1_pythia6.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ void run_tutorial1_pythia6(Int_t nEvents = 10, TString mcEngine = "TGeant3")
6464
// ----- Create simulation run ----------------------------------------
6565
FairRunSim* run = new FairRunSim();
6666
run->SetName(mcEngine); // Transport engine
67+
run->SetSimulationConfig(new FairVMCConfig());
6768
run->SetSink(new FairRootFileSink(outFile)); // Output file
6869
run->SetPythiaDecayer(pythia6Config); // Define Pythia6 as decayer
6970

examples/simulation/Tutorial1/macros/run_tutorial1_pythia8.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ void run_tutorial1_pythia8(Int_t nEvents = 10, TString mcEngine = "TGeant3")
6464
// ----- Create simulation run ----------------------------------------
6565
FairRunSim* run = new FairRunSim();
6666
run->SetName(mcEngine); // Transport engine
67+
run->SetSimulationConfig(new FairVMCConfig());
6768
run->SetSink(new FairRootFileSink(outFile)); // Output file
6869
run->SetPythiaDecayer(pythia8Config); // Define Pythia8 as decayer
6970

examples/simulation/Tutorial1/macros/run_tutorial1_urqmd.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ void run_tutorial1_urqmd(Int_t nEvents = 2, TString mcEngine = "TGeant3")
4646
// ----- Create simulation run ----------------------------------------
4747
FairRunSim* run = new FairRunSim();
4848
run->SetName(mcEngine); // Transport engine
49+
run->SetSimulationConfig(new FairVMCConfig());
4950
run->SetSink(new FairRootFileSink(outFile)); // Output file
5051
FairRuntimeDb* rtdb = run->GetRuntimeDb();
5152
// ------------------------------------------------------------------------

examples/simulation/Tutorial1/src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ target_link_libraries(${target} PUBLIC
3535
FairRoot::FairTools # FairLogger
3636
FairRoot::FairFastSim
3737
FairRoot::ParBase
38+
FairRoot::ExGConfig
3839
FairRoot::ExPassive
3940
FairRoot::ExMCStack
4041
FairRoot::Gen

examples/simulation/Tutorial2/macros/run_background.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ void run_background(Int_t nEvents = 130)
5151
// ----- Create simulation run ----------------------------------------
5252
auto run = std::make_unique<FairRunSim>();
5353
run->SetName("TGeant4"); // Transport engine
54+
run->SetSimulationConfig(new FairVMCConfig());
5455
run->SetSink(new FairRootFileSink(outFile)); // Output file
5556
FairRuntimeDb* rtdb = run->GetRuntimeDb();
5657
// ------------------------------------------------------------------------

examples/simulation/Tutorial2/macros/run_signal.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ void run_signal(Int_t fileNr, Int_t nEvents = 10)
5353
// ----- Create simulation run ----------------------------------------
5454
auto run = std::make_unique<FairRunSim>();
5555
run->SetName("TGeant4"); // Transport engine
56+
run->SetSimulationConfig(new FairVMCConfig());
5657
run->SetSink(new FairRootFileSink(outFile)); // Output file
5758
FairRuntimeDb* rtdb = run->GetRuntimeDb();
5859
// ------------------------------------------------------------------------

examples/simulation/Tutorial2/macros/run_tutorial2.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ void run_tutorial2(Int_t nEvents = 10, TString mcEngine = "TGeant4", Bool_t isMT
6161
// ----- Create simulation run ----------------------------------------
6262
auto run = std::make_unique<FairRunSim>();
6363
run->SetName(mcEngine); // Transport engine
64+
run->SetSimulationConfig(new FairVMCConfig());
6465
run->SetIsMT(isMT); // Multi-threading mode (Geant4 only)
6566
run->SetSink(new FairRootFileSink(outFile)); // Output file
6667
FairRuntimeDb* rtdb = run->GetRuntimeDb();
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
G3_TRIG: 1
2+
G3_SWIT: [4, 100]
3+
G3_DEBU: [0, 0, 1]
4+
G3_RAYL: 1
5+
G3_STRA: 1
6+
G3_AUTO: 0 #Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
7+
G3_ABAN: 0 #Restore 3.16 behaviour for abandoned tracks
8+
G3_OPTI: 2 #Select optimisation level for GEANT geometry searches (0,1,2)
9+
G3_ERAN: 5.e-7
10+
G3_CKOV: 1 #Cerenkov photons
11+
12+
MonteCarlo_Process:
13+
PAIR: 1 #pair production
14+
COMP: 1 #Compton scattering
15+
PHOT: 1 #photo electric effect
16+
PFIS: 0 #photofission
17+
DRAY: 1 #delta-ray
18+
ANNI: 1 #annihilation
19+
BREM: 1 #bremsstrahlung
20+
HADR: 1 #hadronic process
21+
MUNU: 1 #muon nuclear interaction
22+
DCAY: 1 #decay
23+
LOSS: 1 #energy loss
24+
MULS: 0 #multiple scattering
25+
26+
MonteCarlo_Cut:
27+
CUTGAM: 1.0E-3 #gammas (GeV)
28+
CUTELE: 1.0E-3 #electrons (GeV)
29+
CUTNEU: 1.0E-3 #neutral hadrons (GeV)
30+
CUTHAD: 1.0E-3 #charged hadrons (GeV)
31+
CUTMUO: 1.0E-3 #muons (GeV)
32+
BCUTE: 1.0E-3 #electron bremsstrahlung (GeV)
33+
BCUTM: 1.0E-3 #muon and hadron bremsstrahlung (GeV)
34+
DCUTE: 1.0E-3 #delta-rays by electrons (GeV)
35+
DCUTM: 1.0E-3 #delta-rays by muons (GeV)
36+
PPCUTM: 1.0E-3 #direct pair production by muons (GeV)
37+
TOFMAX: 1.E10 #time of flight cut in seconds
38+
39+
FairStack_StoreSecondaries: true
40+
FairStack_MinPoints: 0
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Geant4_UserGeometry: "geomRoot"
2+
Geant4_PhysicsList: "QGSP_BERT_EMV"
3+
Geant4_SpecialProcess: "stepLimiter+specialCuts+specialControls"
4+
Geant4_SpecialStacking: false
5+
Geant4_Multithreaded: false
6+
7+
Geant4_MaxNStep: 10000 #default is 30000
8+
Geant4_Commands:
9+
- /cuts/setHighEdge 100 GeV
10+
- /tracking/verbose 0
11+
12+
MonteCarlo_Process:
13+
PAIR: 1 #pair production
14+
COMP: 1 #Compton scattering
15+
PHOT: 1 #photo electric effect
16+
PFIS: 0 #photofission
17+
DRAY: 1 #delta-ray
18+
ANNI: 1 #annihilation
19+
BREM: 1 #bremsstrahlung
20+
HADR: 1 #hadronic process
21+
MUNU: 1 #muon nuclear interaction
22+
DCAY: 1 #decay
23+
LOSS: 1 #energy loss
24+
MULS: 1 #multiple scattering
25+
26+
MonteCarlo_Cut:
27+
CUTGAM: 1.0E-3 #gammas (GeV)
28+
CUTELE: 1.0E-3 #electrons (GeV)
29+
CUTNEU: 1.0E-3 #neutral hadrons (GeV)
30+
CUTHAD: 1.0E-3 #charged hadrons (GeV)
31+
CUTMUO: 1.0E-3 #muons (GeV)
32+
BCUTE: 1.0E-3 #electron bremsstrahlung (GeV)
33+
BCUTM: 1.0E-3 #muon and hadron bremsstrahlung (GeV)
34+
DCUTE: 1.0E-3 #delta-rays by electrons (GeV)
35+
DCUTM: 1.0E-3 #delta-rays by muons (GeV)
36+
PPCUTM: 1.0E-3 #direct pair production by muons (GeV)
37+
TOFMAX: 1.E10 #time of flight cut in seconds
38+
39+
FairStack_StoreSecondaries: true
40+
FairStack_MinPoints: 0

examples/simulation/Tutorial4/macros/run_tutorial4.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ void run_tutorial4(Int_t nEvents = 10, TString mcEngine = "TGeant3", Bool_t doAl
7070
// ----- Create simulation run ----------------------------------------
7171
FairRunSim* run = new FairRunSim();
7272
run->SetName(mcEngine); // Transport engine
73+
run->SetSimulationConfig(new FairVMCConfig());
7374
run->SetIsMT(isMT); // Multi-threading mode (Geant4 only)
7475
run->SetSink(new FairRootFileSink(outFile)); // Output file
7576
FairRuntimeDb* rtdb = run->GetRuntimeDb();

examples/simulation/rutherford/macros/run_rad.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ void run_rad(Int_t nEvents = 100, TString mcEngine = "TGeant4")
5151
// ----- Create simulation run ----------------------------------------
5252
FairRunSim* run = new FairRunSim();
5353
run->SetName(mcEngine); // Transport engine
54+
run->SetSimulationConfig(new FairVMCConfig());
5455
run->SetSink(new FairRootFileSink(outFile)); // Output file
5556
FairRuntimeDb* rtdb = run->GetRuntimeDb();
5657
// ------------------------------------------------------------------------

examples/simulation/rutherford/macros/run_rutherford.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ void run_rutherford(Int_t nEvents = 10, TString mcEngine = "TGeant4", Bool_t isM
5353
// ----- Create simulation run ----------------------------------------
5454
FairRunSim* run = new FairRunSim();
5555
run->SetName(mcEngine); // Transport engine
56+
// run->SetSimulationConfig(new FairVMCConfig());
5657
run->SetIsMT(isMT); // Multi-threading mode (Geant4 only)
5758
run->SetSink(new FairRootFileSink(outFile)); // Output file
5859
FairRuntimeDb* rtdb = run->GetRuntimeDb();

fairtools/MCConfigurator/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ target_link_libraries(${target} PUBLIC
2929

3030
geant321
3131
geant4vmc
32+
Pythia6
3233
yaml-cpp
3334

3435
ROOT::Core

fairtools/MCConfigurator/FairYamlVMCConfig.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ void FairYamlVMCConfig::SetupPostInit(const char* mcEngine)
6969
if (!((strcmp(mcEngine, "TGeant4") == 0))) {
7070
LOG(fatal) << "FairYamlVMCConfig::SetupPostInit() only valid for TGeant4.";
7171
}
72+
LOG(info) << "Loading Geant4 PostInit Config." << endl;
7273

7374
TString work = getenv("VMCWORKDIR");
7475
TString work_config = work + "/gconfig/";

0 commit comments

Comments
 (0)