History by history uncertainties with multithreading

Hi, I was wondering how to record the values of estimated uncertainty on a history by history basis - similar to Walters 2002 History by history statistical estimators in the BEAM code system.

I am trying to make a primitive scorer class that would be able to accumulate the values of three scored quantities x, x_squared, and the variance using them both could be accessible in multithreaded mode. Such that after N primary histories the variance on the scored quantity x can be estimated.

I know that in the RE02 example the primitive scorers can deal with accumulating a value e.g. the quantity y in the event map G4THitsMap class.

EvtMap->add(index, y);

So I was wondering if there was a way to perhaps make the EvtMap quantity y a vector of {x and x_squared}. This may involve changing:

G4THitsMap<G4double>* EvtMap;

to something like:

G4THitsMap<std::vector<G4double>>* EvtMap;

or instead have a couple of G4THitsMaps (defined in the header file with

G4PS_MY_CUSTOM_SCORER : public G4VPrimitiveScorer

which change in ProcessHits and only returns EvtMap at the conclusion of the RunAction.cc,

G4THitsMap<G4double>* end_x_value = re02Run->GetHitsMap("HitsMapName")

So that in the header you find:

  G4THitsMap<G4double>* x_Map;
  G4THitsMap<G4double>* x_square_Map;
  G4THitsMap<G4double>* EvtMap;

I would greatly appreciate any advice you have on which type of implementation would work best when using multithreaded mode.

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