CbmRoot
Loading...
Searching...
No Matches
CbmGeant4Settings.h
Go to the documentation of this file.
1/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
10#ifndef CBMGEANT4SETTINGS_H
11#define CBMGEANT4SETTINGS_H 1
12
19#include "CbmVMCSettings.h"
20
21#include <array>
22#include <string>
23#include <vector>
24
25class TVirtualMC;
26
28public:
29 CbmGeant4Settings() = default;
30 ~CbmGeant4Settings() = default;
33
38 void Init(TVirtualMC*);
39
45 void SetG4RunConfig(std::string navigationEngine, std::string physicsLists, std::string specialProcesses)
46 {
47 fG4RunConfig[0] = navigationEngine;
48 fG4RunConfig[1] = physicsLists;
49 fG4RunConfig[2] = specialProcesses;
50 }
51
56 std::array<std::string, 3> GetG4RunConfig() { return fG4RunConfig; }
57
62 Int_t GetG4Seed() { return fRandomSeed; }
63
68 void SetG4Command(std::string command)
69 {
70 fG4Commands.clear();
71 fG4Commands.push_back(command);
72 }
73
78 void AddG4Command(std::string command) { fG4Commands.push_back(command); }
79
84 std::vector<std::string> GetG4Commands() { return fG4Commands; }
85
90 void SetMaximumNumberOfSteps(Int_t numSteps) { fMaxNumSteps = numSteps; }
91
96
97private:
98 std::array<std::string, 3> fG4RunConfig {{"geomRoot", "QGSP_BERT_EMV+optical", "stepLimiter"}};
99
100 /*
101 See https://redmine.cbm.gsi.de/issues/2913
102 As of Geant4-10.5 these commands were changed.
103 Tested for Geant4-11
104 */
105 std::vector<std::string> fG4Commands {"/process/optical/verbose 0",
106 "/process/optical/cerenkov/setMaxPhotons 20",
107 "/process/optical/cerenkov/setMaxBetaChange 0.1",
108 "/process/optical/cerenkov/setTrackSecondariesFirst true",
109 "/process/optical/processActivation Cerenkov true",
110 "/process/optical/processActivation OpAbsorption true",
111 "/process/optical/processActivation OpBoundary true"};
112
113 Int_t fMaxNumSteps {10000000};
114
115 Int_t fRandomSeed {0};
116
118};
119
120#endif /* CBMGEANT4SETTINGS_H */
User interface class to define the Geant4 simulation settings.
Int_t GetMaximumNumberOfSteps()
Get the maximum number of steps.
CbmGeant4Settings(const CbmGeant4Settings &)=delete
std::array< std::string, 3 > GetG4RunConfig()
Get the Geant4 run configuration.
void SetMaximumNumberOfSteps(Int_t numSteps)
Set the maximum number of steps after which the transport is stopped list of commands.
void SetG4Command(std::string command)
Set a new command which should be passsed to Geant4. The call will remove the current list of command...
std::vector< std::string > GetG4Commands()
Get the Geant4 commands.
void Init(TVirtualMC *)
Set all parameters defined in this class.
CbmGeant4Settings()=default
~CbmGeant4Settings()=default
void SetG4RunConfig(std::string navigationEngine, std::string physicsLists, std::string specialProcesses)
Define the Geant4 run configuration.
void AddG4Command(std::string command)
Add a new command which should be passsed to Geant4 to the existing list of commands.
CbmGeant4Settings & operator=(const CbmGeant4Settings &)=delete
Int_t GetG4Seed()
Get the Geant4 random seed.
std::vector< std::string > fG4Commands
std::array< std::string, 3 > fG4RunConfig
ClassDef(CbmGeant4Settings, 4)
User interface class to define the transport simulation settings which are common for both used trans...