Without creating a root file when using detectors to collect particle information, the program cannot continue to run

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

_Geant4 Version:_11.1.1
_Operating System:_linux
CMake Version:

—When using a detector to collect particle information, I do not want to create a root file, but the program cannot run without creating a root file. The specific situation is:
void muonSimRunAction::BeginOfRunAction(const G4Run *run){

G4int runID = run->GetRunID();

G4cout << “### Run " << runID << " start.” << G4endl;

G4AnalysisManager *analysisManager = G4AnalysisManager::Instance();

std::string fileName = “muonSim_” + std::to_string(runID) + “.root”;
After deleting these few lines of program(G4AnalysisManager *analysisManager = G4AnalysisManager::Instance();

std::string fileName = “muonSim_” + std::to_string(runID) + “.root”;
The following results have occurred:
截图 2024-04-24 20-38-12
Is there any solution to this problem