Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove some more unwanted output #168

Merged
merged 3 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/RMGPhysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "G4ParticleHPThermalScattering.hh"
#include "G4ParticleHPThermalScatteringData.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessTable.hh"
#include "G4RadioactiveDecayPhysics.hh"
#include "G4RegionStore.hh"
#include "G4RunManagerKernel.hh"
Expand Down Expand Up @@ -177,6 +178,12 @@ void RMGPhysics::ConstructProcess() {
em_extra_physics->MuonNuclear(true);
em_extra_physics->ConstructProcess();

// G4EmExtraPhysics does not propagate the verbose level...
auto synch_proc = G4ProcessTable::GetProcessTable()->FindProcesses("SynRad");
for (size_t i = 0; i < synch_proc->size(); i++) {
(*synch_proc)[i]->SetVerboseLevel(G4VModularPhysicsList::verboseLevel);
}

if (fConstructOptical) this->ConstructOptical();
else RMGLog::Out(RMGLog::detail, "Processes for optical photons are inactivated");

Expand Down
12 changes: 10 additions & 2 deletions src/RMGRunAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ void RMGRunAction::SetupAnalysisManager() {
if (RMGLog::GetLogLevel() <= RMGLog::debug) ana_man->SetVerboseLevel(10);
else ana_man->SetVerboseLevel(0);

ana_man->SetNtupleMerging(!rmg_man->IsExecSequential());

// do it only for activated detectors (have to ask to the manager)
for (const auto& oscheme : det_cons->GetAllActiveOutputSchemes()) {

Expand All @@ -99,6 +97,16 @@ void RMGRunAction::BeginOfRunAction(const G4Run*) {
auto ana_man = G4AnalysisManager::Instance();
fCurrentOutputFile = BuildOutputFile();
auto fn = fCurrentOutputFile.first.string();

// ntuple merging is only supported for some file types. Unfortunately, the function to
// check for this capability is private, so we have to replicate this here. Also it can only be
// called after opening the file, when setting the flag does not work any more :-(
auto file_type = fCurrentOutputFile.first.extension();
if (file_type != ".csv" && file_type != ".CSV" && file_type != ".xml" && file_type != ".XML" &&
file_type != ".hdf5" && file_type != ".HDF5") {
ana_man->SetNtupleMerging(!manager->IsExecSequential());
}

if (this->IsMaster()) {
std::string orig_fn;
if (fCurrentOutputFile.first != fCurrentOutputFile.second)
Expand Down
3 changes: 2 additions & 1 deletion src/RMGSteppingAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "G4GenericMessenger.hh"
#include "G4Ions.hh"
#include "G4Step.hh"
#include "G4Threading.hh"

#include "RMGEventAction.hh"
#include "RMGLog.hh"
Expand Down Expand Up @@ -59,7 +60,7 @@ void RMGSteppingAction::UserSteppingAction(const G4Step* step) {
void RMGSteppingAction::SetDaughterKillLifetime(double max_lifetime) {

fDaughterKillLifetime = max_lifetime;
if (fDaughterKillLifetime > 0) {
if (fDaughterKillLifetime > 0 && G4Threading::IsMasterThread()) {
RMGLog::OutFormat(RMGLog::summary,
"Enabled killing of daughter nuclei with a lifetime longer than {} us.",
fDaughterKillLifetime / CLHEP::us);
Expand Down