40 #include "HistoManager.hh"
46 :rootFile(0),ntupl(0), Eabs(0), Egap(0) ,Labs(0), Lgap(0)
60 if ( rootFile )
delete rootFile;
71 rootFile =
new TFile(fileName,
"RECREATE");
73 G4cout <<
" HistoManager::book :"
74 <<
" problem creating the ROOT TFile "
79 histo[1] =
new TH1D(
"1",
"Edep in absorber", 100, 0., 800*CLHEP::MeV);
80 if (!histo[1])
G4cout <<
"\n can't create histo 1" <<
G4endl;
81 histo[2] =
new TH1D(
"2",
"Edep in gap", 100, 0., 100*CLHEP::MeV);
82 if (!histo[2])
G4cout <<
"\n can't create histo 2" <<
G4endl;
83 histo[3] =
new TH1D(
"3",
"trackL in absorber", 100, 0., 1*CLHEP::m);
84 if (!histo[3])
G4cout <<
"\n can't create histo 3" <<
G4endl;
85 histo[4] =
new TH1D(
"4",
"trackL in gap", 100, 0., 50*CLHEP::cm);
86 if (!histo[4])
G4cout <<
"\n can't create histo 4" <<
G4endl;
90 ntupl =
new TTree(
"101",
"Edep and TrackL");
91 ntupl->Branch(
"Eabs", &Eabs,
"Eabs/D");
92 ntupl->Branch(
"Egap", &Egap,
"Egap/D");
93 ntupl->Branch(
"Labs", &Labs,
"Labs/D");
94 ntupl->Branch(
"Lgap", &Lgap,
"Lgap/D");
97 G4cout <<
"\n----> Histogram file is opened in " << fileName <<
G4endl;
107 G4cout <<
"\n----> Histogram Tree is saved \n" <<
G4endl;
116 G4cout <<
"---> warning from HistoManager::FillHisto() : histo " << ih
117 <<
" does not exist. (xbin=" << xbin <<
" weight=" << weight <<
")"
121 if (histo[ih]) { histo[ih]->Fill(xbin, weight); }
129 G4cout <<
"---> warning from HistoManager::Normalize() : histo " << ih
130 <<
" does not exist. (fac=" << fac <<
")" <<
G4endl;
133 if (histo[ih]) histo[ih]->Scale(fac);
146 if (ntupl) ntupl->Fill();
154 G4cout <<
"\n ----> print histograms statistic \n" <<
G4endl;
157 <<
" EAbs : mean = " <<
G4BestUnit(histo[1]->GetMean(),
"Energy")
160 <<
" EGap : mean = " <<
G4BestUnit(histo[2]->GetMean(),
"Energy")
163 <<
" LAbs : mean = " <<
G4BestUnit(histo[3]->GetMean(),
"Length")
166 <<
" LGap : mean = " <<
G4BestUnit(histo[4]->GetMean(),
"Length")