Message: Re: G4RandExponential" doesn't seem to work -- known, or a bug? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Re: G4RandExponential" doesn't seem to work -- known, or a bug? 

Forum: Documentation and Examples
Re: Warning "G4RandExponential" doesn't seem to work -- known, or a bug? (Michael H. Kelsey)
Date: 28 Apr, 2011
From: Gabriele Cosmo <Gabriele Cosmo>

Hi Mike,

you're referring to code which has been introduced in development versions
and are -not- yet in public releases of Geant4.
There is nothing wrong with the defines... you're probably mixing different
Geant4 installations.

Gabriele

----------------
On Tue, 26 Apr 2011 21:37:21 GMT, Michael H. Kelsey wrote:
> I want to generate random timestamps for events based on the "known"
> strength of my radioactive source and the area of the source visible
> through my collimator.
> 
> I wrote what should be a trivial code fragment to do this:
> 
>   #include "Randomize.hh"
> [...]
>   G4double decayTau = (ActiveVisible[iCan]/ActiveSurface[iCan]
>                        / SourceActivity[iCan]);
>   G4double decayInterval = G4RandExponential::shoot(decayTau);
> [...]
> 
> where "iCan" is just the index of which of my source canisters I'm using
> for this event, ActiveVisible and ActiveSurface are both areas, and
> SourceActivity is in becquerels, so decayTau comes out as an effective
> lifetime in seconds).
> 
> The code does not compile:
> 
>   Compiling Am241SourceHolder.cc ...
>   Am241SourceHolder.cc: In member function 'G4double Am241SourceHolder::GenerateDecayTime(G4int)':
>   Am241SourceHolder.cc:180: error: 'G4RandExponential' has not been declared
>   Am241SourceHolder.cc:180: error: 'shoot' was not declared in this scope
>   make[4]: *** [/Users/kelsey/cdms/cdmsim/tmp/Darwin-g++/CDMSgeometry/Am241SourceHolder.o] Error 1
> 
> If I look in Randomize.hh, I see the use of a #define, rather than a
> typedef:
> 
> [...]
>   #define G4RandGauss CLHEP::RandGaussQ
>   #define G4RandExponential CLHEP::RandExponential
> [...]
> 
> This looks wrong to me. I cannot find ANY bit of code, either in
> "examples" or in "source" where G4RandExponential is actually used. Are
> these #define's left over from some early development work that never
> went through?
> 
>   -- Michael Kelsey

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: G4RandExponential" doesn't seem to work -- known, or a bug?   (Mike Kelsey - 28 Apr, 2011)
 Add Message Add Message
to: "Re: G4RandExponential" doesn't seem to work -- known, or a bug?"

 Subscribe Subscribe

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


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]