forked from R3BRootGroup/R3BRoot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathg4Config.C
69 lines (61 loc) · 3.29 KB
/
g4Config.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/******************************************************************************
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2019 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
* copied verbatim in the file "LICENSE". *
* *
* In applying this license GSI does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
******************************************************************************/
// Configuration macro for Geant4 VirtualMC
void Config()
{
cout << "[g4Config]: Creating TGeant4 VirtualMC ..." << endl;
/* Create the run configuration
*
* In constructor user has to specify the geometry input
* and select geometry navigation via the following options:
* - geomVMCtoGeant4 - geometry defined via VMC, G4 native navigation
* - geomVMCtoRoot - geometry defined via VMC, Root navigation
* - geomRoot - geometry defined via Root, Root navigation
* - geomRootToGeant4 - geometry defined via Root, G4 native navigation
* - geomGeant4 - geometry defined via Geant4, G4 native navigation
*
* The second argument in the constructor selects physics list:
* - emStandard - standard em physics (default)
* - emStandard+optical - standard em physics + optical physics
* - XYZ - selected hadron physics list ( XYZ = LHEP, QGSP, ...)
* - XYZ+optical - selected hadron physics list + optical physics
*
* The third argument activates the special processes in the TG4SpecialPhysicsList,
* which implement VMC features:
* - stepLimiter - step limiter (default)
* - specialCuts - VMC cuts
* - specialControls - VMC controls for activation/inactivation selected processes
* - stackPopper - stackPopper process
*
* When more than one options are selected, they should be separated with '+'
* character: e.g. stepLimit+specialCuts.
*/
// Enable setting the physics list from outside via environment variable
TString physicsList = gSystem->Getenv("PHYSICSLIST");
if (physicsList == "")
{
physicsList = "QGSP_BERT_HP";
}
auto runConfiguration =
new TG4RunConfiguration("geomRoot", physicsList, "stepLimiter+specialCuts+specialControls");
auto geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
auto stack = new R3BStack(1000);
stack->SetDebug(kFALSE);
stack->StoreSecondaries(kTRUE);
stack->SetMinPoints(0);
geant4->SetStack(stack);
geant4->SetMaxNStep(10000);
const TString geant4macro = TString(gSystem->Getenv("VMCWORKDIR")) + TString("/gconfig/g4config.in");
cout << "[g4Config]: Processing additional Geant4 macro file " << geant4macro << endl;
geant4->ProcessGeantMacro(geant4macro);
}