Skip to content

Commit

Permalink
refactor: Suppress large printout of Geant4 (#1791)
Browse files Browse the repository at this point in the history
This PR suppresses the large printout of physics parameters at the beginning of each Sequencer run by default.
  • Loading branch information
benjaminhuth committed Feb 1, 2023
1 parent 38926ae commit 917eeec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Examples/Algorithms/Geant4/src/Geant4Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
#include <iostream>
#include <stdexcept>

#include <G4EmParameters.hh>
#include <G4FieldManager.hh>
#include <G4HadronicParameters.hh>
#include <G4HadronicProcessStore.hh>
#include <G4MagneticField.hh>
#include <G4RunManager.hh>
#include <G4TransportationManager.hh>
Expand All @@ -29,6 +32,7 @@
#include <G4UserTrackingAction.hh>
#include <G4VUserDetectorConstruction.hh>
#include <G4VUserPhysicsList.hh>
#include <G4Version.hh>

namespace {
/// Helper method to add the user actions
Expand Down Expand Up @@ -84,6 +88,13 @@ ActsExamples::Geant4Simulation::Geant4Simulation(
G4EventManager::GetEventManager()->GetStackManager()->SetVerboseLevel(
geantVerboseLevel);

// Suppress the printing of physics information.
#if G4VERSION_NUMBER >= 1100
G4HadronicParameters::Instance()->SetVerboseLevel(0);
G4HadronicProcessStore::Instance()->SetVerbose(0);
G4EmParameters::Instance()->SetIsPrintedFlag(true);
#endif

// Set the detector construction
m_cfg.runManager->SetUserInitialization(m_cfg.detectorConstruction);

Expand Down

0 comments on commit 917eeec

Please sign in to comment.