Show process progress during the run

Hello, I’m trying to write a function tu show the percent of the running progress

  1. In the B1EventAction.cc I wrote:
    a.

       B1EventAction::B1EventAction(B1RunAction* runAction)
             : G4UserEventAction(),
               fRunAction(runAction),
               fEdep(0.)
               fPrintModulo(10000)
             {} 
    

b.
fPrintModulo= 10000;
c.

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;
  1. In the B1Eventaction.hh I wrote
    virtual void BeginOfEventAction(const G4Event* evt);
    G4int fPrintModulo;

but I get error

Notice that I assigned to fPrintModulo the number of events that I want to simulate

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

if( evt->GetEventID()%10000==0 ) G4cout << evt->GetEventID() << G4endl;

in the EventAction.cc.

Thank you @swagner

Yes, that was the bug!

Thank you! it is easier!