40 #include "HistoManager.hh"
47 fNtuple1(0), fNtuple2(0),
48 fEabs(0.), fEgap(0.) ,fLabs(0.), fLgap(0.)
74 fRootFile =
new TFile(fileName,
"RECREATE");
76 G4cout <<
" HistoManager::Book :"
77 <<
" problem creating the ROOT TFile "
83 fHisto[0] =
new TH1D(
"EAbs",
"Edep in absorber (MeV)", 100, 0., 800*
CLHEP::MeV);
87 fHisto[2] =
new TH1D(
"LAbs",
"trackL in absorber (mm)", 100, 0., 1*
CLHEP::m);
89 fHisto[3] =
new TH1D(
"LGap",
"trackL in gap (mm)", 100, 0., 50*
CLHEP::cm);
96 fNtuple1 =
new TTree(
"Ntuple1",
"Edep");
101 fNtuple2 =
new TTree(
"Ntuple2",
"TrackL");
105 G4cout <<
"\n----> Output file is open in " << fileName <<
G4endl;
117 G4cout <<
"\n----> Histograms and ntuples are saved\n" <<
G4endl;
124 if (ih >= kMaxHisto) {
125 G4cerr <<
"---> warning from HistoManager::FillHisto() : histo " << ih
126 <<
" does not exist. (xbin=" << xbin <<
" weight=" << weight <<
")"
137 if (ih >= kMaxHisto) {
138 G4cout <<
"---> warning from HistoManager::Normalize() : histo " << ih
139 <<
" does not exist. (fac=" << fac <<
")" <<
G4endl;
163 G4cout <<
"\n ----> print histograms statistic \n" <<
G4endl;
169 if (name[0] ==
'E' ) unitCategory =
"Energy";
170 if (name[0] ==
'L' ) unitCategory =
"Length";
173 <<
": mean = " <<
G4BestUnit(h1->GetMean(), unitCategory)
174 <<
" rms = " <<
G4BestUnit(h1->GetRMS(), unitCategory )
void Normalize(G4int id, G4double fac)
void FillNtuple(G4double EnergyAbs, G4double EnergyGap, G4double TrackLAbs, G4double TrackLGap)
void FillHisto(G4int id, G4double e, G4double weight=1.0)
static constexpr double cm
static constexpr double MeV
G4GLOB_DLL std::ostream G4cerr
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static constexpr double m
static const G4double fac
G4GLOB_DLL std::ostream G4cout