-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventAction.cc
56 lines (35 loc) · 1.24 KB
/
EventAction.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "EventAction.hh"
#include "SteppingAction.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4ios.hh"
#include <fstream>
#include <stdlib.h>
#include <iostream>
#include "globalvar.h"
using namespace std ;
EventAction::EventAction()
{}
EventAction::~EventAction()
{}
void EventAction::BeginOfEventAction(const G4Event* evt)
{
G4int event_id = evt->GetEventID();
if(event_id%1000000 == 0) { G4cout << G4endl << "EVENT # " << event_id << " START" << G4endl; }
//ofstream eventNumber (eventNumberFile, ios::trunc);
//G4int event_id = evt->GetEventID();
//eventNumber << event_id << G4endl ;
//ofstream outputHits(hitsFile, ios::app);
//outputHits << "Event # " << evt->GetEventID() << " start" << G4endl;
//G4cout << G4endl << "EVENT # " << evt->GetEventID() << " START" << G4endl;
}
void EventAction::EndOfEventAction(const G4Event* evt)
{
G4int event_id = evt->GetEventID();
if(event_id%1000000 == 0) { G4cout << G4endl << "EVENT # " << event_id << " END" << G4endl; }
//ofstream outputHits(hitsFile, ios::app);
//G4int event_id = evt->GetEventID();
//outputHits << "# numberOfParticles = " << event_id << G4endl ;
}