-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0815808
commit 00b6ca7
Showing
31 changed files
with
393 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef OMSimActionInitialization_h | ||
#define OMSimActionInitialization_h 1 | ||
|
||
#include "G4VUserActionInitialization.hh" | ||
|
||
class OMSimActionInitialization : public G4VUserActionInitialization | ||
{ | ||
public: | ||
OMSimActionInitialization(long pSeed); | ||
virtual ~OMSimActionInitialization(); | ||
|
||
virtual void BuildForMaster() const; | ||
virtual void Build() const; | ||
|
||
private: | ||
long mMasterSeed; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "OMSimActionInitialization.hh" | ||
#include "OMSimPrimaryGeneratorAction.hh" | ||
#include "OMSimRunAction.hh" | ||
#include "OMSimEventAction.hh" | ||
#include "OMSimTrackingAction.hh" | ||
#include "OMSimSteppingAction.hh" | ||
#include <G4RandomTools.hh> | ||
|
||
OMSimActionInitialization::OMSimActionInitialization(long pSeed) | ||
: G4VUserActionInitialization(), mMasterSeed(pSeed) | ||
{ | ||
} | ||
|
||
OMSimActionInitialization::~OMSimActionInitialization() | ||
{ | ||
} | ||
|
||
void OMSimActionInitialization::BuildForMaster() const | ||
{ | ||
SetUserAction(new OMSimRunAction); | ||
} | ||
|
||
void OMSimActionInitialization::Build() const | ||
{ | ||
SetUserAction(new OMSimPrimaryGeneratorAction); | ||
SetUserAction(new OMSimRunAction); | ||
SetUserAction(new OMSimEventAction); | ||
SetUserAction(new OMSimTrackingAction); | ||
SetUserAction(new OMSimSteppingAction); | ||
const long lPrime = 2147483647; | ||
long lSeed = (mMasterSeed + (G4Threading::G4GetThreadId()+1) * lPrime); | ||
lSeed = lSeed % std::numeric_limits<long>::max(); | ||
log_debug("Random engine of thread {} was assigned seed {}", G4Threading::G4GetThreadId(), lSeed); | ||
G4Random::setTheSeed(lSeed); | ||
G4Random::setTheEngine(new CLHEP::RanluxEngine); | ||
} |
Oops, something went wrong.