Hello everyone. I made some bugs in the .mac file.
I am asking for help how to solve it.
/run/initialize
/gun/particle e-
#
/gun/energy 12 eV
/run/beamOn 100000
/gun/energy 62 eV
/run/beamOn 100000
If I call the /run/beamOn twice times, it would come out a warning that wouldn’t happen when I call the /run/beamOn just for once.
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : Analysis_W001
issued by : G4TNtupleManager<NT,FT>::FillNtupleTColumn
Ntuple 0 does not exist.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
Here copy my RunAction code
RunAction::RunAction()
{
CreateRoot();
}
void RunAction::CreateRoot()
{
G4AnalysisManager* man = G4AnalysisManager::Instance();
man->OpenFile("output.root");
man->CreateNtuple("Benchmark", "Benchmark");
man->CreateNtupleIColumn("fEvent");
......
man->FinishNtuple(0);
man->CreateNtuple("array", "array");
man->CreateNtupleIColumn("X");
......
man->FinishNtuple(1);
}
void RunAction::EndOfRunAction(const G4Run* run)
{
G4AnalysisManager* man = G4AnalysisManager::Instance();
man->Write();
man->CloseFile();
}
If I should add something more to determine when to close the File?
Thank you for your attention!