How to understand the SetZStop(G4double zValue) function in the phase space file

Hi
I’m recently learning to use phase space files, but I have some questions about the SetZStop(G4double zValue) function.

I added the relevant file to my B1 program, and then called the SetZStop(G4double zValue) function in BeginOfRunAction.

The official manual describes this function as follows: it defines a new scoring plane at z = zValue. This method must be called at least once before the Geant4 run starts.

At first I set this parameter to 10cm, in this case I can only launch one particle, if I launch more than one particle the program will quit. If I set this parameter to 90cm, then I can launch more particles.

I never quite understand this question and would like to ask you how this function should be used if I want to generate my own phase space file.

Thank you all for your replies

1 Like

Dear Jodie,

Could you please provide more details regarding the class of that method, phase-space format, what the “relevant file” is, etc.?

Regards,

Miguel

hi mcortes:

Thank you for your reply, I am sorry I did not describe it clearly, the relevant documents refer to the following documents.

• iaea_config.h
• iaea_header.h and iaea_header.cc
• iaea_phsp.h and iaea_phsp.cc
• iaea_record.h and iaea_record.cc
• utilities.h and utilities.cc

These files are some dependency files and changes to the B1 program only appear in RunAction, Event Action, Stepping Action.Here is my program

void RunAction::BeginOfRunAction(const G4Run*aRun)
{
  // inform the runManager to save random number seed
  G4RunManager::GetRunManager()->SetRandomNumberStore(false);

  // reset accumulables to their initial values
  G4AccumulableManager* accumulableManager = G4AccumulableManager::Instance();
  accumulableManager->Reset();


  G4IAEAphspWriter*IAEAWriter = G4IAEAphspWriter::GetInstance();
  IAEAWriter->SetZStop(90.*cm);
  IAEAWriter->SetFileName("test");
  IAEAWriter->BeginOfRunAction(aRun);

}

void RunAction::EndOfRunAction(const G4Run* aRun)
{
 G4IAEAphspWriter::GetInstance()->EndOfRunAction(aRun);
}

void EventAction::BeginOfEventAction(const G4Event*aEvent)
{
  fEdep = 0.;
  G4IAEAphspWriter::GetInstance()->BeginOfEventAction(aEvent);
}

void SteppingAction::UserSteppingAction(const G4Step* aStep)
{
 G4IAEAphspWriter::GetInstance()->UserSteppingAction(aStep);
}

Thanks for your reply.
Cheers!