Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
B4aEventAction Class Reference

#include <B4aEventAction.hh>

Inheritance diagram for B4aEventAction:
G4UserEventAction

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 ()
 
void SetEventManager (G4EventManager *value)
 

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:

Definition at line 45 of file B4aEventAction.hh.

Constructor & Destructor Documentation

B4aEventAction::B4aEventAction ( )

Definition at line 44 of file B4aEventAction.cc.

46  fEnergyAbs(0.),
47  fEnergyGap(0.),
48  fTrackLAbs(0.),
49  fTrackLGap(0.)
50 {}
B4aEventAction::~B4aEventAction ( )
virtual

Definition at line 54 of file B4aEventAction.cc.

55 {}

Member Function Documentation

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

Definition at line 66 of file B4aEventAction.hh.

Referenced by B4aSteppingAction::UserSteppingAction().

66  {
67  fEnergyAbs += de;
68  fTrackLAbs += dl;
69 }
void B4aEventAction::AddGap ( G4double  de,
G4double  dl 
)
inline

Definition at line 71 of file B4aEventAction.hh.

Referenced by B4aSteppingAction::UserSteppingAction().

71  {
72  fEnergyGap += de;
73  fTrackLGap += dl;
74 }
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 }
void B4aEventAction::EndOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

Definition at line 70 of file B4aEventAction.cc.

References G4BestUnit, G4cout, G4endl, G4RunManager::GetPrintProgress(), and G4RunManager::GetRunManager().

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
G4GLOB_DLL std::ostream G4cout
ExG4HbookAnalysisManager G4AnalysisManager
Definition: g4hbook_defs.hh:46
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
#define G4endl
Definition: G4ios.hh:61

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