-
Notifications
You must be signed in to change notification settings - Fork 2
/
RunAction.cc
63 lines (44 loc) · 1 KB
/
RunAction.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
57
58
59
60
61
62
// Geant4 Libraries
//
#include "G4Timer.hh"
#include "G4Run.hh"
#include "g4root.hh"
#include "G4AccumulableManager.hh"
// Root Libraries
//
#include <TFile.h>
// Local Libraries
//
#include "RunAction.hh"
RunAction::RunAction()
: G4UserRunAction(),
fTimer(0)
{
G4cout << "...RunAction..." << G4endl;
fTimer = new G4Timer;
// -----------------------
// Histogram for One Pulse
analysisManager->CreateH1("0","Time at Pmt", 1000, 0., 1000.);
if( histRunOk )
{
histRun = new histosRun();
}
}
RunAction::~RunAction()
{
delete fTimer;
}
void RunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
fTimer->Start();
G4AccumulableManager* accumulableManager = G4AccumulableManager::Instance();
accumulableManager->Merge();
}
void RunAction::EndOfRunAction(const G4Run* aRun)
{
fTimer->Stop();
G4cout << "number of event = " << aRun->GetNumberOfEvent()
<< " " << *fTimer << G4endl;
histRun->~histosRun();
}