Monte Carlo LYSO
Geant4 simulation for the LYSO calorimeter prototype
Public Member Functions | Private Attributes | List of all members
MyRunAction Class Reference

User action concrete class of G4UserRunAction. It defines procedures to be executed at the start and at the end of the run. More...

#include <run.hh>

Inheritance diagram for MyRunAction:
Inheritance graph
[legend]
Collaboration diagram for MyRunAction:
Collaboration graph
[legend]

Public Member Functions

 MyRunAction (G4int theMCID, MyEventAction *eventAction)
 Constructor of the class. More...
 
 ~MyRunAction () override=default
 Destructor of the class.
 
void BeginOfRunAction (const G4Run *run) override
 Creates and accesses the output root file at the beginning of the run. More...
 
void EndOfRunAction (const G4Run *run) override
 Writes the TTree to the output root file and closes it at the end of the run. More...
 

Private Attributes

G4int fMCID
 The Monte Carlo ID.
 
MyEventActionfEventAction
 Pointer to the MyEventAction object.
 

Detailed Description

User action concrete class of G4UserRunAction. It defines procedures to be executed at the start and at the end of the run.

Definition at line 18 of file run.hh.

Constructor & Destructor Documentation

◆ MyRunAction()

MyRunAction::MyRunAction ( G4int  theMCID,
MyEventAction eventAction 
)

Constructor of the class.

It creates the TTree and its branches to store simulation output.

Parameters
eventActionPointer to a MyEventAction object, necessary for associating data saved in each event with the TTree.

Definition at line 7 of file run.cc.

Member Function Documentation

◆ BeginOfRunAction()

void MyRunAction::BeginOfRunAction ( const G4Run *  run)
override

Creates and accesses the output root file at the beginning of the run.

Parameters
runPointer to the G4Run.

Definition at line 57 of file run.cc.

◆ EndOfRunAction()

void MyRunAction::EndOfRunAction ( const G4Run *  run)
override

Writes the TTree to the output root file and closes it at the end of the run.

Parameters
runPointer to the G4Run.

Definition at line 79 of file run.cc.


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