33 #include "B4Analysis.hh"
51 auto analysisManager = G4AnalysisManager::Instance();
52 G4cout <<
"Using " << analysisManager->GetType() <<
G4endl;
57 analysisManager->SetVerboseLevel(1);
58 analysisManager->SetNtupleMerging(
true);
65 analysisManager->CreateH1(
"Eabs",
"Edep in absorber", 100, 0., 800*
MeV);
66 analysisManager->CreateH1(
"Egap",
"Edep in gap", 100, 0., 100*
MeV);
67 analysisManager->CreateH1(
"Labs",
"trackL in absorber", 100, 0., 1*
m);
68 analysisManager->CreateH1(
"Lgap",
"trackL in gap", 100, 0., 50*
cm);
72 analysisManager->CreateNtuple(
"B4",
"Edep and TrackL");
73 analysisManager->CreateNtupleDColumn(
"Eabs");
74 analysisManager->CreateNtupleDColumn(
"Egap");
75 analysisManager->CreateNtupleDColumn(
"Labs");
76 analysisManager->CreateNtupleDColumn(
"Lgap");
77 analysisManager->FinishNtuple();
84 delete G4AnalysisManager::Instance();
104 auto analysisManager = G4AnalysisManager::Instance();
109 analysisManager->OpenFile(fileName);
118 auto analysisManager = G4AnalysisManager::Instance();
119 if ( analysisManager->GetH1(1) ) {
120 G4cout <<
G4endl <<
" ----> print histograms statistic ";
128 G4cout <<
" EAbs : mean = "
129 <<
G4BestUnit(analysisManager->GetH1(0)->mean(),
"Energy")
131 <<
G4BestUnit(analysisManager->GetH1(0)->rms(),
"Energy") << G4endl;
133 G4cout <<
" EGap : mean = "
134 <<
G4BestUnit(analysisManager->GetH1(1)->mean(),
"Energy")
136 <<
G4BestUnit(analysisManager->GetH1(1)->rms(),
"Energy") << G4endl;
138 G4cout <<
" LAbs : mean = "
139 <<
G4BestUnit(analysisManager->GetH1(2)->mean(),
"Length")
141 <<
G4BestUnit(analysisManager->GetH1(2)->rms(),
"Length") << G4endl;
143 G4cout <<
" LGap : mean = "
144 <<
G4BestUnit(analysisManager->GetH1(3)->mean(),
"Length")
146 <<
G4BestUnit(analysisManager->GetH1(3)->rms(),
"Length") << G4endl;
151 analysisManager->Write();
152 analysisManager->CloseFile();
void SetPrintProgress(G4int i)
Definition of the B4bRunData class.
virtual void BeginOfRunAction(const G4Run *)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4GLOB_DLL std::ostream G4cout
static constexpr double m
static constexpr double cm
Definition of the B4bRunAction class.
static G4RunManager * GetRunManager()
static constexpr double MeV
virtual void EndOfRunAction(const G4Run *)
virtual G4Run * GenerateRun()