Message: Re: Error in Accumulating Square of Hits to a G4THitsMap for Precision Calculation Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Error in Accumulating Square of Hits to a G4THitsMap for Precision Calculation 

Forum: Biasing and Scoring
Re: None Error in Accumulating Square of Hits to a G4THitsMap for Precision Calculation (Matthew Lund)
Date: 31 May, 2014
From: Tsukasa Aso <Tsukasa Aso>

Hi,

 The line:
   fRunMap_Square[key]+=(*(itr->second))*(*(itr->second));

  The type in left side is THitsMap, while the type of right side is double.
Therefore  it means a type mismatch.

  The right way will be:

        G4double vsquare = (*(itr->second)) * (*(itr->second));
        theRunMap_Square[key]->add(itr->first,vsquare);
   

p.s.
 A few years before, I created own Run class for this kind of purpose.
I attached those files.  It takes the EvMap of command line scorer
and calculate RMS per event.
  I am not sure my code works in current geant4 version, but inside
of the code may be good for your reference.

Best regards,
Tsukasa Aso


   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2014/05/31/03.35-4231-SB03Run.hh
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2014/05/31/03.35-9409-SB03RunAction.hh
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2014/05/31/03.35-32760-SB03RunActionMessenger.hh
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2014/05/31/03.35-41956-SB03Run.cc
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2014/05/31/03.35-76272-SB03RunAction.cc
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2014/05/31/03.35-52451-SB03RunActionMessenger.cc

 Add Message Add Message
to: "Re: Error in Accumulating Square of Hits to a G4THitsMap for Precision Calculation"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews