evtNb = evt->GetEventID();
NevTot=G4RunManager::GetRunManager()->GetCurrentRun()->GetNumberOfEventToBeProcessed();
if ((100/fPrintModulo*evtNb)%NevTot==0) G4cout <<"\n---> Begin of Event:"<<evtNb<<" of "<<NevTot<<" Progress % is "<<(100*evtNb)/NevTot<<G4endl;
In the B1Eventaction.hh I wrote virtual void BeginOfEventAction(const G4Event* evt); G4int fPrintModulo;
Hello,
I’m not sure I completely understand the Italian error message, but from what I get it might be as simple as putting a comma between fEdep(0.) and fPrintModulo(10000).
That being said, to print the progress I would usually just write something like
Thank you for your help, but it is still no working. However I found another method that is working fine now. My next step is trying to print it on the same place instead of having it span in bunch of lines like this. I have tried to use “\r”, but it is not working.
Hey. I was able to write a code that print out the percentage of my progress at the command line. However, my code has some limitation. It only works if you are running number with only zeros such like “1000”. Otherwise, the calculation is messed up. Does anyone have an advice for me?
Hi all,
sorry for the intrusion but I’m trying to understand somethinh basic of geant4, for example the difference bettween fPrintModulo and EventID. Could anyone tell me this difference?
Is EventID a characteristic of a primary particle? I mean, could I distinguish different primary particles exploiting the EventID value?
It could be a nonsense question, but geant4 is really difficult for me to understand. Sorry in advance.
An “event” in Geant4 starts with one or more primary particles. These are tracked through your geometry, interacting and maybe making secondaries. If you want to get high statistics to compare with reality, you will generate many, many events in your simulation.
Within an event, you distinguish the different tracks using the track ID, not the event ID.