Geant4  10.02.p03
B4bEventAction Class Reference

#include <B4bEventAction.hh>

Inheritance diagram for B4bEventAction:
Collaboration diagram for B4bEventAction:

Public Member Functions

 B4bEventAction ()
 
virtual ~B4bEventAction ()
 
virtual void BeginOfEventAction (const G4Event *event)
 
virtual void EndOfEventAction (const G4Event *event)
 
- Public Member Functions inherited from G4UserEventAction
 G4UserEventAction ()
 
virtual ~G4UserEventAction ()
 
virtual void SetEventManager (G4EventManager *value)
 

Private Member Functions

void PrintEventStatistics (G4double absoEdep, G4double absoTrackLength, G4double gapEdep, G4double gapTrackLength) const
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Event action class

In EndOfEventAction(), it prints the accumulated quantities of the energy deposit and track lengths of charged particles in Absober and Gap layers stored in B4bRunData object.

Definition at line 43 of file B4bEventAction.hh.

Constructor & Destructor Documentation

◆ B4bEventAction()

B4bEventAction::B4bEventAction ( )

Definition at line 43 of file B4bEventAction.cc.

◆ ~B4bEventAction()

B4bEventAction::~B4bEventAction ( )
virtual

Definition at line 49 of file B4bEventAction.cc.

50 {}

Member Function Documentation

◆ BeginOfEventAction()

void B4bEventAction::BeginOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

Definition at line 74 of file B4bEventAction.cc.

75 {
76  B4bRunData* runData
77  = static_cast<B4bRunData*>(
79  runData->Reset();
80 }
G4Run * GetNonConstCurrentRun() const
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
void Reset()
Definition: B4bRunData.cc:79
Here is the call graph for this function:

◆ EndOfEventAction()

void B4bEventAction::EndOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

Definition at line 84 of file B4bEventAction.cc.

85 {
86  B4bRunData* runData
87  = static_cast<B4bRunData*>(
89  runData->FillPerEvent();
90 
91  //print per event (modulo n)
92  //
93  G4int eventID = event->GetEventID();
95  if ( ( printModulo > 0 ) && ( eventID % printModulo == 0 ) ) {
96  G4cout << "---> End of event: " << eventID << G4endl;
97 
99  runData->GetEdep(kAbs),
100  runData->GetTrackLength(kAbs),
101  runData->GetEdep(kGap),
102  runData->GetTrackLength(kGap));
103  }
104 }
G4Run * GetNonConstCurrentRun() const
G4int GetPrintProgress()
void PrintEventStatistics(G4double absoEdep, G4double absoTrackLength, G4double gapEdep, G4double gapTrackLength) const
int G4int
Definition: G4Types.hh:78
void FillPerEvent()
Definition: B4bRunData.cc:57
G4double GetTrackLength(G4int id) const
Definition: B4bRunData.hh:95
G4GLOB_DLL std::ostream G4cout
G4double GetEdep(G4int id) const
Definition: B4bRunData.hh:91
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ PrintEventStatistics()

void B4bEventAction::PrintEventStatistics ( G4double  absoEdep,
G4double  absoTrackLength,
G4double  gapEdep,
G4double  gapTrackLength 
) const
private

Definition at line 54 of file B4bEventAction.cc.

57 {
58  // print event statistics
59  G4cout
60  << " Absorber: total energy: "
61  << std::setw(7) << G4BestUnit(absoEdep, "Energy")
62  << " total track length: "
63  << std::setw(7) << G4BestUnit(absoTrackLength, "Length")
64  << G4endl
65  << " Gap: total energy: "
66  << std::setw(7) << G4BestUnit(gapEdep, "Energy")
67  << " total track length: "
68  << std::setw(7) << G4BestUnit(gapTrackLength, "Length")
69  << G4endl;
70 }
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
Here is the caller graph for this function:

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