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

#include <G4MultiRunAction.hh>

Inheritance diagram for G4MultiRunAction:
Collaboration diagram for G4MultiRunAction:

Public Member Functions

 G4MultiRunAction ()=default
 
virtual ~G4MultiRunAction ()=default
 
virtual G4RunGenerateRun () override
 
virtual void BeginOfRunAction (const G4Run *aRun) override
 
virtual void EndOfRunAction (const G4Run *aRun) override
 
virtual void SetMaster (G4bool val=true) override
 
- Public Member Functions inherited from G4UserRunAction
 G4UserRunAction ()
 
virtual ~G4UserRunAction ()
 
G4bool IsMaster () const
 

Additional Inherited Members

- Protected Attributes inherited from G4UserRunAction
G4bool isMaster
 

Detailed Description

Definition at line 65 of file G4MultiRunAction.hh.

Constructor & Destructor Documentation

G4MultiRunAction::G4MultiRunAction ( )
default
virtual G4MultiRunAction::~G4MultiRunAction ( )
virtualdefault

Member Function Documentation

void G4MultiRunAction::BeginOfRunAction ( const G4Run aRun)
overridevirtual

Reimplemented from G4UserRunAction.

Definition at line 58 of file G4MultiRunAction.cc.

58  {
59  std::for_each( begin() , end() ,
60  [run](G4UserRunActionUPtr& e) { e->BeginOfRunAction(run); }
61  );
62 }
std::unique_ptr< G4UserRunAction > G4UserRunActionUPtr
void G4MultiRunAction::EndOfRunAction ( const G4Run aRun)
overridevirtual

Reimplemented from G4UserRunAction.

Definition at line 64 of file G4MultiRunAction.cc.

64  {
65  std::for_each( begin() , end() ,
66  [run](G4UserRunActionUPtr& e) { e->EndOfRunAction(run); }
67  );
68 }
std::unique_ptr< G4UserRunAction > G4UserRunActionUPtr
G4Run * G4MultiRunAction::GenerateRun ( )
overridevirtual

Reimplemented from G4UserRunAction.

Definition at line 43 of file G4MultiRunAction.cc.

43  {
44  G4Run* aRun = nullptr;
45  for ( auto& ru : *this ) {
46  auto anotherRun = ru->GenerateRun();
47  if ( aRun != nullptr && anotherRun != nullptr ) {
48  G4Exception("G4MultiRunAction::GenerateRun()","Run0036",FatalException,
49  "More than one registered UserRunAction return an instance"\
50  " of G4Run, not allowed.");
51  return nullptr;
52  }
53  aRun = anotherRun;
54  }
55  return aRun;
56 }
Definition: G4Run.hh:46
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Here is the call graph for this function:

void G4MultiRunAction::SetMaster ( G4bool  val = true)
overridevirtual

Reimplemented from G4UserRunAction.

Definition at line 70 of file G4MultiRunAction.cc.

70  {
72  std::for_each( begin() , end() ,
73  [val](G4UserRunActionUPtr& e) { e->SetMaster(val); }
74  );
75 
76 }
std::unique_ptr< G4UserRunAction > G4UserRunActionUPtr
virtual void SetMaster(G4bool val=true)

Here is the call graph for this function:


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