-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.cc
63 lines (55 loc) · 1.7 KB
/
run.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
63
#include "run.hh"
MyRunAction::MyRunAction()
{
G4AnalysisManager *man = G4AnalysisManager::Instance();
man->SetNtupleMerging(true);
man->CreateNtuple("First_step_neutrons", "First_step_neutrons");
man->CreateNtupleDColumn("kin_E");
man->CreateNtupleDColumn("x");
man->CreateNtupleDColumn("y");
man->CreateNtupleDColumn("z");
man->CreateNtupleDColumn("t");
man->FinishNtuple(0);
man->CreateNtuple("Last_step_neutrons", "Last_step_neutrons");
man->CreateNtupleDColumn("kin_E");
man->CreateNtupleDColumn("x");
man->CreateNtupleDColumn("y");
man->CreateNtupleDColumn("z");
man->CreateNtupleDColumn("t");
man->FinishNtuple(1);
man->CreateNtuple("First_step_alpha", "First_step_alpha");
man->CreateNtupleDColumn("deposit_E");
man->CreateNtupleDColumn("kin_E");
man->CreateNtupleDColumn("x");
man->CreateNtupleDColumn("y");
man->CreateNtupleDColumn("z");
man->CreateNtupleDColumn("t");
man->FinishNtuple(2);
man->CreateNtuple("Last_step_alpha", "Last_step_alpha");
man->CreateNtupleDColumn("deposit_E");
man->CreateNtupleDColumn("kin_E");
man->CreateNtupleDColumn("x");
man->CreateNtupleDColumn("y");
man->CreateNtupleDColumn("z");
man->CreateNtupleDColumn("t");
man->FinishNtuple(3);
man->CreateNtuple("events", "events");
man->CreateNtupleIColumn("n_Event");
man->FinishNtuple(4);
}
MyRunAction::~MyRunAction()
{}
void MyRunAction::BeginOfRunAction(const G4Run* run)
{
G4AnalysisManager* man = G4AnalysisManager::Instance();
G4int runID = run->GetRunID();
std::stringstream strRunID;
strRunID << runID;
man->OpenFile("output" + strRunID.str() + ".root");
}
void MyRunAction::EndOfRunAction(const G4Run*)
{
G4AnalysisManager *man = G4AnalysisManager::Instance();
man->Write();
man->CloseFile();
}