Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
B4a::EventAction Class Reference
basic » B4 » B4a

Event action class. More...

#include <Doxymodules_basic.h>

Inheritance diagram for B4a::EventAction:
G4UserEventAction

Public Member Functions

 EventAction ()=default
 
 ~EventAction () override=default
 
void BeginOfEventAction (const G4Event *event) override
 
void EndOfEventAction (const G4Event *event) override
 
void AddAbs (G4double de, G4double dl)
 
void AddGap (G4double de, G4double dl)
 

Private Attributes

G4double fEnergyAbs = 0.
 
G4double fEnergyGap = 0.
 
G4double fTrackLAbs = 0.
 
G4double fTrackLGap = 0.
 

Detailed Description

Event action class.

It defines data members to hold the energy deposit and track lengths of charged particles in Absober and Gap layers:

Definition at line 127 of file Doxymodules_basic.h.

Constructor & Destructor Documentation

◆ EventAction()

B4a::EventAction::EventAction ( )
default

◆ ~EventAction()

B4a::EventAction::~EventAction ( )
overridedefault

Member Function Documentation

◆ BeginOfEventAction()

void B4a::EventAction::BeginOfEventAction ( const G4Event event)
override

Definition at line 46 of file EventAction.cc.

47{
48 // initialisation per event
49 fEnergyAbs = 0.;
50 fEnergyGap = 0.;
51 fTrackLAbs = 0.;
52 fTrackLGap = 0.;
53}
G4double fEnergyAbs
G4double fEnergyGap
G4double fTrackLAbs
G4double fTrackLGap

◆ EndOfEventAction()

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

Definition at line 57 of file EventAction.cc.

58{
59 // get analysis manager
60 auto analysisManager = G4AnalysisManager::Instance();
61
62 // fill histograms
63 analysisManager->FillH1(0, fEnergyAbs);
64 analysisManager->FillH1(1, fEnergyGap);
65 analysisManager->FillH1(2, fTrackLAbs);
66 analysisManager->FillH1(3, fTrackLGap);
67
68 // fill ntuple
69 analysisManager->FillNtupleDColumn(0, fEnergyAbs);
70 analysisManager->FillNtupleDColumn(1, fEnergyGap);
71 analysisManager->FillNtupleDColumn(2, fTrackLAbs);
72 analysisManager->FillNtupleDColumn(3, fTrackLGap);
73 analysisManager->AddNtupleRow();
74
75 // Print per event (modulo n)
76 //
77 auto eventID = event->GetEventID();
78 auto printModulo = G4RunManager::GetRunManager()->GetPrintProgress();
79 if ( ( printModulo > 0 ) && ( eventID % printModulo == 0 ) ) {
80 G4cout
81 << " Absorber: total energy: " << std::setw(7)
82 << G4BestUnit(fEnergyAbs,"Energy")
83 << " total track length: " << std::setw(7)
84 << G4BestUnit(fTrackLAbs,"Length")
85 << G4endl
86 << " Gap: total energy: " << std::setw(7)
87 << G4BestUnit(fEnergyGap,"Energy")
88 << " total track length: " << std::setw(7)
89 << G4BestUnit(fTrackLGap,"Length")
90 << G4endl;
91
92 G4cout << "--> End of event " << eventID << "\n" << G4endl;
93 }
94}

◆ AddAbs()

void B4a::EventAction::AddAbs ( G4double  de,
G4double  dl 
)
inline

Definition at line 68 of file EventAction.hh.

68 {
69 fEnergyAbs += de;
70 fTrackLAbs += dl;
71}

◆ AddGap()

void B4a::EventAction::AddGap ( G4double  de,
G4double  dl 
)
inline

Definition at line 73 of file EventAction.hh.

73 {
74 fEnergyGap += de;
75 fTrackLGap += dl;
76}

Member Data Documentation

◆ fEnergyAbs

G4double B4a::EventAction::fEnergyAbs = 0.
private

Definition at line 60 of file EventAction.hh.

◆ fEnergyGap

G4double B4a::EventAction::fEnergyGap = 0.
private

Definition at line 61 of file EventAction.hh.

◆ fTrackLAbs

G4double B4a::EventAction::fTrackLAbs = 0.
private

Definition at line 62 of file EventAction.hh.

◆ fTrackLGap

G4double B4a::EventAction::fTrackLGap = 0.
private

Definition at line 63 of file EventAction.hh.


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

Applications | User Support | Publications | Collaboration