-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.cc
48 lines (38 loc) · 1.31 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
#include "run.hh"
RunAction::RunAction()
{}
RunAction::~RunAction()
{}
void RunAction::BeginOfRunAction(const G4Run*)
{
G4AnalysisManager *manager = G4AnalysisManager::Instance();
manager->OpenFile("exp.root");
manager->CreateNtuple("ScintillatorHits","ScintillatorHits");
manager->CreateNtupleIColumn("fEvent");
manager->CreateNtupleDColumn("fX");
manager->CreateNtupleDColumn("fY");
manager->CreateNtupleDColumn("fZ");
manager->FinishNtuple(0);
manager->CreateNtuple("TrackPosition","TrackPosition");
manager->CreateNtupleIColumn("fEvent");
manager->CreateNtupleDColumn("fXTrack");
manager->CreateNtupleDColumn("fYTrack");
manager->CreateNtupleDColumn("fZTrack");
manager->CreateNtupleDColumn("ParticleMomentumX");
manager->CreateNtupleDColumn("ParticleMomentumY");
manager->CreateNtupleDColumn("ParticleMomentumZ");
manager->CreateNtupleDColumn("ParticleMass");
manager->CreateNtupleDColumn("EnergyDeposit");
manager->CreateNtupleIColumn("ParticleCharge");
manager->CreateNtupleIColumn("TrackID");
manager->FinishNtuple(1);
manager->CreateNtuple("Scoring","Scoring");
manager->CreateNtupleDColumn("TotalEnergyDeposit");
manager->FinishNtuple(2);
}
void RunAction::EndOfRunAction(const G4Run*)
{
G4AnalysisManager *manager = G4AnalysisManager::Instance();
manager->Write();
manager->CloseFile();
}