Loading...
Searching...
No Matches
Public Member Functions | List of all members
B2::EventAction Class Reference
basic » B2 » B2a | basic » B2 » B2b

Event action class. More...

#include <Doxymodules_basic.h>

Inheritance diagram for B2::EventAction:
G4UserEventAction

Public Member Functions

 EventAction ()=default
 
 ~EventAction () override=default
 
void BeginOfEventAction (const G4Event *) override
 
void EndOfEventAction (const G4Event *) override
 

Detailed Description

Event action class.

Definition at line 43 of file Doxymodules_basic.h.

Constructor & Destructor Documentation

◆ EventAction()

B2::EventAction::EventAction ( )
default

◆ ~EventAction()

B2::EventAction::~EventAction ( )
overridedefault

Member Function Documentation

◆ BeginOfEventAction()

void B2::EventAction::BeginOfEventAction ( const G4Event )
override

Definition at line 43 of file EventAction.cc.

44{}

◆ EndOfEventAction()

void B2::EventAction::EndOfEventAction ( const G4Event event)
override

Definition at line 48 of file EventAction.cc.

49{
50 // get number of stored trajectories
51
52 G4TrajectoryContainer* trajectoryContainer = event->GetTrajectoryContainer();
53 std::size_t n_trajectories = 0;
54 if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
55
56 // periodic printing
57
58 G4int eventID = event->GetEventID();
59 if ( eventID < 100 || eventID % 100 == 0) {
60 G4cout << ">>> Event: " << eventID << G4endl;
61 if ( trajectoryContainer ) {
62 G4cout << " " << n_trajectories
63 << " trajectories stored in this event." << G4endl;
64 }
65 G4VHitsCollection* hc = event->GetHCofThisEvent()->GetHC(0);
66 G4cout << " "
67 << hc->GetSize() << " hits stored in this event" << G4endl;
68 }
69}

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

Applications | User Support | Publications | Collaboration