|Message: Re: G4RandExponential" doesn't seem to work -- known, or a bug?||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
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: *** [/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:||Outline Depth:||Add message:|