source: trunk/source/geometry/solids/test/SurfaceVisTest/src/EventAction.cc @ 1316

Last change on this file since 1316 was 1316, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 3.7 KB
Line 
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//
27//
28//
29
30//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
32
33#include "EventAction.hh"
34
35#include "RunAction.hh"
36
37#include "G4Event.hh"
38#include "G4EventManager.hh"
39#include "G4TrajectoryContainer.hh"
40#include "G4Trajectory.hh"
41#include "G4VVisManager.hh"
42#include "G4ios.hh"
43#include "G4UnitsTable.hh"
44#include "Randomize.hh"
45
46//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
47
48EventAction::EventAction(RunAction* RA)
49 :runaction(RA), verboselevel(0),
50   drawFlag("all"), printModulo(10000)
51{
52  ;
53}
54
55//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
56
57EventAction::~EventAction()
58{
59  ;
60}
61
62//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
63
64void EventAction::BeginOfEventAction(const G4Event* evt)
65{
66  if(verboselevel>1){
67 G4int evtNb = evt->GetEventID();
68
69    if (evtNb%printModulo == 0) {
70    G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
71
72    G4cout << "<<< Event  " << evtNb << " started." << G4endl;
73    }   
74  }
75}
76
77//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
78
79void EventAction::EndOfEventAction(const G4Event* evt)
80{ 
81 
82
83  if(verboselevel>0)
84    G4cout << "<<< Event  " << evt->GetEventID() << " ended." << G4endl;
85
86  // save rndm status
87  if (runaction->GetRndmFreq() == 2)
88    { 
89     CLHEP::HepRandom::saveEngineStatus("endOfEvent.rndm");   
90     G4int evtNb = evt->GetEventID();
91     if (evtNb%printModulo == 0)
92       { 
93        G4cout << "\n---> End of Event: " << evtNb << G4endl;
94        CLHEP::HepRandom::showEngineStatus();
95       }
96    }     
97}
98
99//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
100
101G4int EventAction::GetEventno()
102{
103  G4int evno = fpEventManager->GetConstCurrentEvent()->GetEventID() ;
104  return evno ;
105}
106
107//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
108
109void EventAction::setEventVerbose(G4int level)
110{
111  verboselevel = level ;
112}
113
114//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Note: See TracBrowser for help on using the repository browser.