QwGeant4
QweakSimRunAction.cc
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 //
7 /**
8 
9  \file QweakSimRunAction.cc
10 
11  $Revision: 1.2 $
12  $Date: 2005/12/27 19:14:28 $
13 
14  \author Klaus Hans Grimm
15 
16 */
17 //=============================================================================
18 
19 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
20 
21 #include "QweakSimRunAction.hh"
22 
23 // geant4 includes
24 #include "G4ios.hh"
25 #include "G4Run.hh"
26 #include "G4UImanager.hh"
27 #include "G4VisManager.hh"
28 
29 // user includes
30 #include "QweakSimAnalysis.hh"
31 
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 : runID(0), analysis(AN)
35 {
36  G4cout << G4endl << "###### Calling/Leaving QweakSimRunAction::QweakSimRunAction()" << G4endl << G4endl;
37 }
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41 {
42  G4cout << G4endl << "###### Calling/Leaving QweakSimRunAction::~QweakSimRunAction()" << G4endl << G4endl;
43 }
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 void QweakSimRunAction::BeginOfRunAction(const G4Run* aRun)
47 {
48  G4cout << G4endl << "###### Calling QweakSimRunAction::BeginOfRunAction()" << G4endl << G4endl;
49 
50  // Get run number
51  runID = aRun->GetRunID();
52 
53  // Print run number
54  G4cout << "### Start of Run " << runID << G4endl;
55 
56  // Start analysis at begin of run
57  analysis->BeginOfRun(aRun);
58  analysis->SetNumberOfEventToBeProcessed(aRun->GetNumberOfEventToBeProcessed());
59 
60  // Visualization
61  if (G4VVisManager::GetConcreteInstance())
62  {
63  G4UImanager* UI = G4UImanager::GetUIpointer();
64  UI->ApplyCommand("/vis/scene/notifyHandlers");
65  }
66 
67  G4cout << G4endl << "###### Leaving QweakSimRunAction::BeginOfRunAction()" << G4endl << G4endl;
68 }
69 
70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
71 void QweakSimRunAction::EndOfRunAction(const G4Run* aRun)
72 {
73  G4cout << G4endl << "###### Calling QweakSimRunAction::EndOfRunAction()" << G4endl << G4endl;
74 
75  // Get run number (
76  if (runID != aRun->GetRunID())
77  {
78  G4cout << "### Run number has changed from " << runID << " to " << aRun->GetRunID() << "." << G4endl;
79  }
80 
81  // Print run number
82  G4cout << "### End of Run " << runID << G4endl;
83 
84  // End analysis procedure at end of run
85  analysis->EndOfRun(aRun);
86 
87  // Visualization
88  if (G4VVisManager::GetConcreteInstance())
89  {
90  G4UImanager* UI = G4UImanager::GetUIpointer();
91  UI->ApplyCommand("/vis/viewer/update");
92  }
93 
94  G4cout << G4endl << "###### Leaving QweakSimRunAction::EndOfRunAction()" << G4endl << G4endl;
95 }
96 
97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99 {
100  return runID;
101 }
102 
103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
104 
105 
void SetNumberOfEventToBeProcessed(G4int n)
void BeginOfRun(const G4Run *aRun)
void BeginOfRunAction(const G4Run *)
Handling of the output ROOT file.
QweakSimRunAction(QweakSimAnalysis *AN)
QweakSimAnalysis * analysis
void EndOfRunAction(const G4Run *)
void EndOfRun(const G4Run *aRun)