Example B3, G4PSDoseDeposit, and G4run

Hi all…

In B3a::EventAction::EndOfEventAction and B3b::Run::RecordEvent(), a pointer to the hits collection in “patient” is obtained and the dose is analysed by iterating over the collection, but it seems not accumulated:

  evtMap = (G4THitsMap<G4double>*)(HCE->GetHC(fCollID_patient));

  for (itr = evtMap->GetMap()->begin(); itr != evtMap->GetMap()->end(); itr++) {
    ///G4int copyNb  = (itr->first);
    dose = *(itr->second);

Is this correct?

By printing all the hits collection (in evtMap) it seems there is always only one hit in it: Is this the nature of the G4PSDoseDeposit? (the dose in the event has already summed over and is stored as a single hit?)

By the way, according to G4run.hh “it is the user’s responsibility to increment numberOfEvent” but it does not seem to be done in B3b::Run::RecordEvent()…


1 Like

Ah, it is done by calling



@ivana san, any comments?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.