31 #include "B4RunAction.hh"
32 #include "B4Analysis.hh"
50 auto analysisManager = G4AnalysisManager::Instance();
51 G4cout <<
"Using " << analysisManager->GetType() <<
G4endl;
56 analysisManager->SetVerboseLevel(1);
57 analysisManager->SetNtupleMerging(
true);
64 analysisManager->CreateH1(
"Eabs",
"Edep in absorber", 100, 0., 800*
MeV);
65 analysisManager->CreateH1(
"Egap",
"Edep in gap", 100, 0., 100*
MeV);
66 analysisManager->CreateH1(
"Labs",
"trackL in absorber", 100, 0., 1*
m);
67 analysisManager->CreateH1(
"Lgap",
"trackL in gap", 100, 0., 50*
cm);
71 analysisManager->CreateNtuple(
"B4",
"Edep and TrackL");
72 analysisManager->CreateNtupleDColumn(
"Eabs");
73 analysisManager->CreateNtupleDColumn(
"Egap");
74 analysisManager->CreateNtupleDColumn(
"Labs");
75 analysisManager->CreateNtupleDColumn(
"Lgap");
76 analysisManager->FinishNtuple();
83 delete G4AnalysisManager::Instance();
94 auto analysisManager = G4AnalysisManager::Instance();
99 analysisManager->OpenFile(fileName);
108 auto analysisManager = G4AnalysisManager::Instance();
109 if ( analysisManager->GetH1(1) ) {
110 G4cout <<
G4endl <<
" ----> print histograms statistic ";
118 G4cout <<
" EAbs : mean = "
119 <<
G4BestUnit(analysisManager->GetH1(0)->mean(),
"Energy")
121 <<
G4BestUnit(analysisManager->GetH1(0)->rms(),
"Energy") << G4endl;
123 G4cout <<
" EGap : mean = "
124 <<
G4BestUnit(analysisManager->GetH1(1)->mean(),
"Energy")
126 <<
G4BestUnit(analysisManager->GetH1(1)->rms(),
"Energy") << G4endl;
128 G4cout <<
" LAbs : mean = "
129 <<
G4BestUnit(analysisManager->GetH1(2)->mean(),
"Length")
131 <<
G4BestUnit(analysisManager->GetH1(2)->rms(),
"Length") << G4endl;
133 G4cout <<
" LGap : mean = "
134 <<
G4BestUnit(analysisManager->GetH1(3)->mean(),
"Length")
136 <<
G4BestUnit(analysisManager->GetH1(3)->rms(),
"Length") << G4endl;
141 analysisManager->Write();
142 analysisManager->CloseFile();
void SetPrintProgress(G4int i)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4GLOB_DLL std::ostream G4cout
static constexpr double m
static constexpr double cm
static G4RunManager * GetRunManager()
virtual void EndOfRunAction(const G4Run *)
virtual void BeginOfRunAction(const G4Run *)
static constexpr double MeV