Skip to content
Snippets Groups Projects
Commit 49bbacb4 authored by Administrator's avatar Administrator Committed by Pierre-Alain Loizeau
Browse files

Fix geant4 settings in gconfig scripts

The scripts are the old way to define settings fro geant3 and geant4 and are
still used in some of the test macros. With this commit the changes already
implemented in the new class CbmGeant4Settings some time ago with commits
cb453d4b and 982c4b76 are added to fix errors during Geant4 initilisation.
parent ed99bb35
No related branches found
No related tags found
1 merge request!1706Fix geant4 settings in gconfig scripts
Pipeline #27896 passed
......@@ -61,11 +61,17 @@ void Config()
if (cut == 0) gInterpreter->ProcessLine("SetCuts()");
//set geant4 specific stuff
// --- Random seed and maximum number of steps
size_t buf_size = 100;
Text_t buffer[buf_size];
// Get the infomation about the seed value defined by SetSeed from the base class.
// Since ROOT 6.24 the derived classes return a differnt value.
Text_t buffer[50];
sprintf(buffer, "/random/setSeeds %i %i ", gRandom->TRandom::GetSeed(), gRandom->TRandom::GetSeed());
// Since ROOT 6.24 the derrived classes return a differnt value.
Int_t randomSeed = gRandom->TRandom::GetSeed();
LOG(info) << "Set Geant4 random seed to " << randomSeed;
int result_length = snprintf(buffer, buf_size - 1, "/random/setSeeds %i %i ", randomSeed, randomSeed);
if (!(result_length > 0 && result_length < static_cast<int>(buf_size))) {
LOG(fatal) << "Buffer overrun. Random seed for Geant4 would be improper.";
}
geant4->ProcessGeantCommand(buffer);
geant4->SetMaxNStep(10000); // default is 30000
......
......@@ -40,8 +40,9 @@
# (Needed as Cerenkov process does not limit step itself)
#
/process/optical/verbose 0
/process/optical/defaults/cerenkov/setMaxPhotons 20
/process/optical/defaults/cerenkov/setMaxBetaChange 0.1
/process/optical/setTrackSecondariesFirst Cerenkov false
/process/optical/cerenkov/setMaxPhotons 20
/process/optical/cerenkov/setMaxBetaChange 0.1
/process/optical/cerenkov/setTrackSecondariesFirst true
/process/optical/processActivation Cerenkov true
/process/optical/processActivation OpAbsorption true
/process/optical/processActivation OpBoundary true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment