36#include "G4RunManager.hh"
37#include "G4UnitsTable.hh"
38#include "G4SystemOfUnits.hh"
45 G4RunManager::GetRunManager()->SetPrintProgress(1);
50 G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
51 G4cout <<
"Using " << analysisManager->GetType() << G4endl;
56 analysisManager->SetVerboseLevel(1);
57 analysisManager->SetFirstHistoId(1);
63 analysisManager->CreateH1(
"1",
"Edep in absorber", 100, 0., 800 * MeV);
64 analysisManager->CreateH1(
"2",
"trackL in absorber", 100, 0., 1 * m);
65 analysisManager->CreateH1(
"3",
"Edep in gas", 1000, 0., 100 * keV);
67 analysisManager->CreateH1(
"4",
"Avalanche size in gas", 10000,0, 10000);
68 analysisManager->CreateH1(
"5",
"gain", 1000, 0., 100);
69 analysisManager->CreateH3(
"1",
"Track position",200, -10*cm, 10*cm, 29, -1.45*cm, 1.45*cm, 29,-1.45*cm, 1.45*cm);
73 analysisManager->CreateNtuple(
"Garfield",
"Edep and TrackL");
74 analysisManager->CreateNtupleDColumn(
"Eabs");
75 analysisManager->CreateNtupleDColumn(
"Labs");
76 analysisManager->CreateNtupleDColumn(
"Egas");
77 analysisManager->CreateNtupleDColumn(
"AvalancheSize");
78 analysisManager->CreateNtupleDColumn(
"Gain");
79 analysisManager->FinishNtuple();
88 delete G4AnalysisManager::Instance();
98 G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
102 G4String fileName =
"Garfield";
103 analysisManager->OpenFile(fileName);
111 G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
112 if (analysisManager->GetH1(1)) {
113 G4cout << G4endl <<
" ----> print histograms statistic ";
115 G4cout <<
"for the entire run " << G4endl << G4endl;
117 G4cout <<
"for the local thread " << G4endl << G4endl;
120 G4cout <<
" EAbs : mean = "
121 << G4BestUnit(analysisManager->GetH1(1)->mean(),
"Energy")
123 << G4BestUnit(analysisManager->GetH1(1)->rms(),
"Energy")
126 G4cout <<
" LAbs : mean = "
127 << G4BestUnit(analysisManager->GetH1(2)->mean(),
"Length")
129 << G4BestUnit(analysisManager->GetH1(2)->rms(),
"Length")
132 G4cout <<
" EGas : mean = "
133 << G4BestUnit(analysisManager->GetH1(3)->mean(),
"Energy")
135 << G4BestUnit(analysisManager->GetH1(3)->rms(),
"Energy")
138 G4cout <<
" Avalanche size : mean = "
139 << analysisManager->GetH1(4)->mean()
141 << analysisManager->GetH1(4)->rms()
144 G4cout <<
" Gain : mean = "
145 << analysisManager->GetH1(5)->mean()
147 << analysisManager->GetH1(5)->rms()
153 analysisManager->Write();
154 analysisManager->CloseFile();
Selection of the analysis technology.
Definition of the GarfieldRunAction class.
virtual void BeginOfRunAction(const G4Run *)
virtual void EndOfRunAction(const G4Run *)
virtual ~GarfieldRunAction()