Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4UserWorkerThreadInitialization Class Reference

#include <G4UserWorkerThreadInitialization.hh>

Public Member Functions

 G4UserWorkerThreadInitialization ()
 
virtual ~G4UserWorkerThreadInitialization ()
 
virtual G4ThreadCreateAndStartWorker (G4WorkerThread *workerThreadContext)
 
virtual void SetupRNGEngine (const CLHEP::HepRandomEngine *aRNGEngine) const
 
virtual void JoinWorker (G4Thread *aThread)
 
virtual G4WorkerRunManagerCreateWorkerRunManager () const
 

Detailed Description

Definition at line 47 of file G4UserWorkerThreadInitialization.hh.

Constructor & Destructor Documentation

G4UserWorkerThreadInitialization::G4UserWorkerThreadInitialization ( )

Definition at line 74 of file G4UserWorkerThreadInitialization.cc.

75 {;}
G4UserWorkerThreadInitialization::~G4UserWorkerThreadInitialization ( )
virtual

Definition at line 77 of file G4UserWorkerThreadInitialization.cc.

78 {;}

Member Function Documentation

G4Thread * G4UserWorkerThreadInitialization::CreateAndStartWorker ( G4WorkerThread workerThreadContext)
virtual

Definition at line 56 of file G4UserWorkerThreadInitialization.cc.

57 {
58  return new G4Thread;
59 }
G4int G4Thread
Definition: G4Threading.hh:174

Here is the caller graph for this function:

G4WorkerRunManager * G4UserWorkerThreadInitialization::CreateWorkerRunManager ( ) const
virtual

Definition at line 135 of file G4UserWorkerThreadInitialization.cc.

136 {
137  return new G4WorkerRunManager();
138 }

Here is the caller graph for this function:

void G4UserWorkerThreadInitialization::JoinWorker ( G4Thread aThread)
virtual

Definition at line 69 of file G4UserWorkerThreadInitialization.cc.

70 {
71 }

Here is the caller graph for this function:

void G4UserWorkerThreadInitialization::SetupRNGEngine ( const CLHEP::HepRandomEngine aRNGEngine) const
virtual

Definition at line 85 of file G4UserWorkerThreadInitialization.cc.

86 {
87  G4AutoLock l(&rngCreateMutex);
88  //No default available, let's create the instance of random stuff
89  //A Call to this just forces the creation to defaults
90  G4Random::getTheEngine();
91  //Poor man's solution to check which RNG Engine is used in master thread
92  CLHEP::HepRandomEngine* retRNG= 0;
93 
94  // Need to make these calls thread safe
95  if ( dynamic_cast<const CLHEP::HepJamesRandom*>(aNewRNG) ) {
96  retRNG= new CLHEP::HepJamesRandom;
97  }
98  if ( dynamic_cast<const CLHEP::MixMaxRng*>(aNewRNG) ) {
99  retRNG= new CLHEP::MixMaxRng;
100  }
101  if ( dynamic_cast<const CLHEP::RanecuEngine*>(aNewRNG) ) {
102  retRNG= new CLHEP::RanecuEngine;
103  }
104  if ( dynamic_cast<const CLHEP::Ranlux64Engine*>(aNewRNG) ) {
105  retRNG= new CLHEP::Ranlux64Engine;
106  }
107  if ( dynamic_cast<const CLHEP::MTwistEngine*>(aNewRNG) ) {
108  retRNG= new CLHEP::MTwistEngine;
109  }
110  if ( dynamic_cast<const CLHEP::DualRand*>(aNewRNG) ) {
111  retRNG= new CLHEP::DualRand;
112  }
113  if ( dynamic_cast<const CLHEP::RanluxEngine*>(aNewRNG) ) {
114  retRNG= new CLHEP::RanluxEngine;
115  }
116  if ( dynamic_cast<const CLHEP::RanshiEngine*>(aNewRNG) ) {
117  retRNG= new CLHEP::RanshiEngine;
118  }
119 
120  if( retRNG != 0 ) {
121  G4Random::setTheEngine( retRNG );
122  }else{
123  // Does a new method, such as aNewRng->newEngine() exist to clone it ?
125  msg<< " Unknown type of RNG Engine - " << G4endl
126  << " Can cope only with HepJamesRandom, MixMaxRng, Ranecu, Ranlux64, MTwistEngine, DualRand, Ranlux or Ranshi."
127  << G4endl
128  << " Cannot clone this type of RNG engine, as required for this thread" << G4endl
129  << " Aborting " << G4endl;
130  G4Exception("G4UserWorkerInitializition::SetupRNGEngine()",
131  "Run0122",FatalException,msg);
132  }
133 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: