-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.cc
37 lines (32 loc) · 915 Bytes
/
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
#include "run.hh"
MyRunAction::MyRunAction()
{
G4AnalysisManager *man = G4AnalysisManager::Instance();
man->SetNtupleMerging(true);
man->CreateNtuple("mirror_photons", "mirror_photons");
man->CreateNtupleDColumn("kin_E");
man->CreateNtupleDColumn("x");
man->CreateNtupleDColumn("y");
man->CreateNtupleDColumn("z");
man->CreateNtupleDColumn("px");
man->CreateNtupleDColumn("py");
man->CreateNtupleDColumn("pz");
man->CreateNtupleDColumn("t");
man->FinishNtuple(0);
}
MyRunAction::~MyRunAction()
{}
void MyRunAction::BeginOfRunAction(const G4Run* run)
{
G4AnalysisManager* man = G4AnalysisManager::Instance();
G4int runID = run->GetRunID();
std::stringstream strRunID;
strRunID << runID;
man->OpenFile("new_layers_mirror" + strRunID.str() + ".root");
}
void MyRunAction::EndOfRunAction(const G4Run*)
{
G4AnalysisManager *man = G4AnalysisManager::Instance();
man->Write();
man->CloseFile();
}