Is there a straightforward way to either get a root file per run or combine the GEANT4 data of multiple runs into 1 root file? I have a low amount of data, even with 1e9 events; I just need more.
Getting an output for the single/first run to a root file is fine. It’s when the second run starts I get the caught signal memory error. I’ve tried to rename the root file every run in Beginning of RunAction using the run ID, but I’m having trouble doing so, and am not sure if the data of multiple runs can be combine.
BeginOfRunAction
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
if ( G4Threading::IsMultithreadedApplication() ) analysisManager->SetNtupleMerging(true);
runID = fRun->GetRunID();
rootFileName = "output" + std::to_string(runID) + ".root";
if(runID==0){
analysisManager->OpenFile(rootFileName);
analysisManager->CreateNtuple("Hits","Hits");
analysisManager->CreateNtupleDColumn(0,"fEnergy");
analysisManager->FinishNtuple(0);
}
EndOfRunAction
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
analysisManager->Write();
analysisManager->CloseFile();
if (isMaster) {
fRun->SetNeutronSumCount(nCount);
fRun->EndOfRun();
}
Is there any obvious errors?
Is there a geant4 function such as, analysisManager->Merge()?
Thank you.