Geant4  10.02.p03
B4aEventAction Class Reference

#include <B4aEventAction.hh>

Inheritance diagram for B4aEventAction:
Collaboration diagram for B4aEventAction:

Public Member Functions

 B4aEventAction ()
 
virtual ~B4aEventAction ()
 
virtual void BeginOfEventAction (const G4Event *event)
 
virtual void EndOfEventAction (const G4Event *event)
 
void AddAbs (G4double de, G4double dl)
 
void AddGap (G4double de, G4double dl)
 
- Public Member Functions inherited from G4UserEventAction
 G4UserEventAction ()
 
virtual ~G4UserEventAction ()
 
virtual void SetEventManager (G4EventManager *value)
 

Private Attributes

G4double fEnergyAbs
 
G4double fEnergyGap
 
G4double fTrackLAbs
 
G4double fTrackLGap
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

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:

  • fEnergyAbs, fEnergyGap, fTrackLAbs, fTrackLGap which are collected step by step via the functions
  • AddAbs(), AddGap()

Definition at line 45 of file B4aEventAction.hh.

Constructor & Destructor Documentation

◆ B4aEventAction()

B4aEventAction::B4aEventAction ( )

Definition at line 44 of file B4aEventAction.cc.

46  fEnergyAbs(0.),
47  fEnergyGap(0.),
48  fTrackLAbs(0.),
49  fTrackLGap(0.)
50 {}
G4double fEnergyAbs
G4double fTrackLGap
G4double fEnergyGap
G4double fTrackLAbs

◆ ~B4aEventAction()

B4aEventAction::~B4aEventAction ( )
virtual

Definition at line 54 of file B4aEventAction.cc.

55 {}

Member Function Documentation

◆ AddAbs()

void B4aEventAction::AddAbs ( G4double  de,
G4double  dl 
)
inline

Definition at line 66 of file B4aEventAction.hh.

66  {
67  fEnergyAbs += de;
68  fTrackLAbs += dl;
69 }
G4double fEnergyAbs
G4double fTrackLAbs
Here is the caller graph for this function:

◆ AddGap()

void B4aEventAction::AddGap ( G4double  de,
G4double  dl 
)
inline

Definition at line 71 of file B4aEventAction.hh.

71  {
72  fEnergyGap += de;
73  fTrackLGap += dl;
74 }
G4double fTrackLGap
G4double fEnergyGap
Here is the caller graph for this function:

◆ BeginOfEventAction()

void B4aEventAction::BeginOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

Definition at line 59 of file B4aEventAction.cc.

60 {
61  // initialisation per event
62  fEnergyAbs = 0.;
63  fEnergyGap = 0.;
64  fTrackLAbs = 0.;
65  fTrackLGap = 0.;
66 }
G4double fEnergyAbs
G4double fTrackLGap
G4double fEnergyGap
G4double fTrackLAbs

◆ EndOfEventAction()

void B4aEventAction::EndOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

Definition at line 70 of file B4aEventAction.cc.

71 {
72  // Accumulate statistics
73  //
74 
75  // get analysis manager
76  G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
77 
78  // fill histograms
79  analysisManager->FillH1(1, fEnergyAbs);
80  analysisManager->FillH1(2, fEnergyGap);
81  analysisManager->FillH1(3, fTrackLAbs);
82  analysisManager->FillH1(4, fTrackLGap);
83 
84  // fill ntuple
85  analysisManager->FillNtupleDColumn(0, fEnergyAbs);
86  analysisManager->FillNtupleDColumn(1, fEnergyGap);
87  analysisManager->FillNtupleDColumn(2, fTrackLAbs);
88  analysisManager->FillNtupleDColumn(3, fTrackLGap);
89  analysisManager->AddNtupleRow();
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 
98  G4cout
99  << " Absorber: total energy: " << std::setw(7)
100  << G4BestUnit(fEnergyAbs,"Energy")
101  << " total track length: " << std::setw(7)
102  << G4BestUnit(fTrackLAbs,"Length")
103  << G4endl
104  << " Gap: total energy: " << std::setw(7)
105  << G4BestUnit(fEnergyGap,"Energy")
106  << " total track length: " << std::setw(7)
107  << G4BestUnit(fTrackLGap,"Length")
108  << G4endl;
109  }
110 }
G4int GetPrintProgress()
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
G4double fEnergyAbs
G4GLOB_DLL std::ostream G4cout
G4double fTrackLGap
ExG4HbookAnalysisManager G4AnalysisManager
Definition: g4hbook_defs.hh:66
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4double fEnergyGap
G4double fTrackLAbs
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

Member Data Documentation

◆ fEnergyAbs

G4double B4aEventAction::fEnergyAbs
private

Definition at line 58 of file B4aEventAction.hh.

◆ fEnergyGap

G4double B4aEventAction::fEnergyGap
private

Definition at line 59 of file B4aEventAction.hh.

◆ fTrackLAbs

G4double B4aEventAction::fTrackLAbs
private

Definition at line 60 of file B4aEventAction.hh.

◆ fTrackLGap

G4double B4aEventAction::fTrackLGap
private

Definition at line 61 of file B4aEventAction.hh.


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