|Message: How to implement random engines in GEANT4 projects?||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)|
I am modifying a GEANT4 project in use in my group, but I crashed against this problem in compiling the source
When I gmake my project I get the following:
<>Compiling PrimaryGeneratorAction.cc ... <>In file included from src/PrimaryGeneratorAction.cc:29: <>include/PrimaryGeneratorAction.hh:84: error: `RanecuEngine' does not name a type <>include/PrimaryGeneratorAction.hh:84: error: extra semicolon <>include/PrimaryGeneratorAction.hh:88: error: ISO C++ forbids declaration of `HepVector' with no type <>include/PrimaryGeneratorAction.hh:88: error: expected `;' before '*' token <>include/PrimaryGeneratorAction.hh:89: error: ISO C++ forbids declaration of `HepSymMatrix' with no type <>include/PrimaryGeneratorAction.hh:89: error: expected `;' before '*' token <>include/PrimaryGeneratorAction.hh:90: error: ISO C++ forbids declaration of `HepSymMatrix' with no type <>include/PrimaryGeneratorAction.hh:90: error: expected `;' before '*' token <>include/PrimaryGeneratorAction.hh:91: error: ISO C++ forbids declaration of `RandMultiGauss' with no type <>include/PrimaryGeneratorAction.hh:91: error: expected `;' before '*' token <>include/PrimaryGeneratorAction.hh:92: error: ISO C++ forbids declaration of `RandMultiGauss' with no type <>include/PrimaryGeneratorAction.hh:92: error: expected `;' before '*' token <>include/PrimaryGeneratorAction.hh:93: error: ISO C++ forbids declaration of `RandFlat' with no type <>include/PrimaryGeneratorAction.hh:93: error: expected `;' before '*' token
Corrisponding lines in the code are the following:
private: G4ParticleGun* particleGun; RanecuEngine _newEngine; G4RandGauss *_randgauss; HepVector *_hepv; HepSymMatrix *_hepsm; HepSymMatrix *_hepsm2; RandMultiGauss *_rmg; RandMultiGauss *_rmg2; RandFlat *_rfla;
Of course, all the following os included at the beginning:
#include "Randomize.hh" #include "CLHEP/Random/RandomEngine.h" #include "CLHEP/Random/RanecuEngine.h" #include "CLHEP/Random/RanluxEngine.h" #include "CLHEP/RandomObjects/RandMultiGauss.h" #include "CLHEP/Matrix/Vector.h" #include "CLHEP/Matrix/DiagMatrix.h" #include "CLHEP/Matrix/SymMatrix.h"
NOTE: the PrimaryGeneratorAction class is the only part of the project that contains any reference at the random generators
What is wrong with my code?
I searched for help almost everywhere, in this forum, in the GEANT4's User Guides, in the CLHEP manuals..., but I am still as much confused as the beginning... I am trying, at the same time, to learn something more about random generators, but reading the docums doesn't help very much: sometimes they say the "random lines" (i.e. the part where the random engine is initializated, that actually is missing in my project... or at least am not yet able to find it) must be placed in the main (see http://geant4-hn.slac.stanford.edu:5090/HyperNews/public/get/eventtrackmanage/74/1/2.html), sometimes they say in the PrimaryGeneratorAction (see http://geant4-hn.slac.stanford.edu:5090/HyperNews/public/get/particles/16/2.html), sometimes they say in the RunAction (see http://geant4-hn.slac.stanford.edu:5090/HyperNews/public/get/eventtrackmanage/74/1.html) I tried all the listed case, but no success at all. So... where to put the "Ranecu" actually? Can you suggest me the best way to implement the possibility of calling a random function?
Thank you very much in advance, Giulia
|Inline Depth:||Outline Depth:||Add message:|