Geant4  10.02
F04EventAction.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: F04EventAction.cc 90239 2015-05-21 09:07:05Z gcosmo $
27 //
30 //
31 
32 #include "F04EventAction.hh"
33 
34 #include "F04RunAction.hh"
35 
37 
38 #include "G4Event.hh"
39 #include "G4EventManager.hh"
40 #include "G4Trajectory.hh"
41 #include "G4TrajectoryContainer.hh"
42 #include "G4VVisManager.hh"
43 
44 #include "Randomize.hh"
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 
49  : fRunaction(runAction), fVerboseLevel(0)
50 {
52 }
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55 
57 {
58  delete fEventMessenger;
59 }
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
62 
64 {
65  G4int evtNb = evt->GetEventID();
66 
67  if(fVerboseLevel>0)
68  G4cout << "<<< Event " << evtNb << " started." << G4endl;
69 }
70 
71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72 
73 #include "G4Threading.hh"
74 
76 {
77  if (fVerboseLevel>0)
78  G4cout << "<<< Event " << evt->GetEventID() << " ended." << G4endl;
79 
80  if (fRunaction->GetRndmFreq() == 2)
81  {
82  std::ostringstream os;
83  os<<"endOfEvent_"<<G4Threading::G4GetThreadId()<<".rndm";
84  G4Random::saveEngineStatus(os.str().c_str());
85  }
86 }
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89 
91 {
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96 
98 {
99  fVerboseLevel = level ;
100 }
Definition of the F04EventActionMessenger class.
virtual void EndOfEventAction(const G4Event *)
G4int GetRndmFreq()
Definition: F04RunAction.hh:55
G4EventManager * fpEventManager
int G4int
Definition: G4Types.hh:78
G4int GetEventID() const
Definition: G4Event.hh:151
void SetEventVerbose(G4int)
G4GLOB_DLL std::ostream G4cout
virtual void BeginOfEventAction(const G4Event *)
Definition of the F04RunAction class.
Definition of the F04EventAction class.
F04EventActionMessenger * fEventMessenger
F04EventAction(F04RunAction *)
#define G4endl
Definition: G4ios.hh:61
virtual ~F04EventAction()
F04RunAction * fRunaction
const G4Event * GetConstCurrentEvent()
G4int G4GetThreadId()
Definition: G4Threading.cc:128