31 #include "HistoManager.hh"
32 #include "HistoMessenger.hh"
36 #include "AIDA/AIDA.h"
43 : factoryOn(
false),af(0),tree(0)
48 af = AIDA_createAnalysisFactory();
50 G4cout <<
" HistoManager::HistoManager :"
51 <<
" problem creating the AIDA analysis factory."
58 fileOption =
"export=root";
100 AIDA::ITreeFactory* tf = af->createTreeFactory();
104 G4cout <<
" HistoManager::book :"
105 <<
" problem creating the AIDA tree with "
107 <<
" storeType = " << fileType
108 <<
" readOnly = " << readOnly
109 <<
" createNew = " << createNew
116 AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
129 AIDA::ITupleFactory* ntf = af->createTupleFactory(*tree);
150 #ifdef G4ANALYSIS_USE
169 G4cout <<
"---> warning from HistoManager::FillHisto() : histo " << ih
170 <<
" xbin= " << xbin <<
" weight= " << weight <<
G4endl;
173 #ifdef G4ANALYSIS_USE
184 G4cout <<
"---> warning from HistoManager::SetHisto() : histo " << ih
185 <<
"does not exist" <<
G4endl;
189 const G4String id[] = {
"0",
"1",
"2",
"3",
"4",
"5" };
192 "total Evis in Ecal",
193 "total Edep in Ecal",
196 "Nb of Radiation Length"
200 G4double vmin = valmin, vmax = valmax;
203 if (unit !=
"none") {
204 titl = title[ih] +
" (" + unit +
")";
206 vmin = valmin/
Unit[ih]; vmax = valmax/
Unit[ih];
215 Width[ih] = (valmax-valmin)/nbins;
217 G4cout <<
"----> SetHisto " << ih <<
": " << titl <<
"; "
218 << nbins <<
" bins from "
219 << vmin <<
" " << unit <<
" to " << vmax <<
" " << unit <<
G4endl;
228 G4cout <<
"---> warning from HistoManager::Normalize() : histo " << ih
229 <<
" fac= " << fac <<
G4endl;
232 #ifdef G4ANALYSIS_USE
242 G4cout <<
"---> warning from HistoManager::RemoveHisto() : histo " << ih
243 <<
"does not exist" <<
G4endl;
256 G4cout <<
"---> warning from HistoManager::PrintHisto() : histo " << ih
257 <<
"does not exist" <<
G4endl;
266 #ifdef G4ANALYSIS_USE
268 if (!
ascii[0])
return;
271 std::ofstream File(name, std::ios::out);
272 File.setf( std::ios::scientific, std::ios::floatfield );
277 File <<
"\n 1D histogram " << ih <<
": " <<
Title[ih]
278 <<
"\n \n \t X \t\t Y" <<
G4endl;
281 File <<
" " << iBin <<
"\t"
282 << 0.5*(
histo[ih]->axis().binLowerEdge(iBin) +
283 histo[ih]->axis().binUpperEdge(iBin)) <<
"\t"
284 <<
histo[ih]->binHeight(iBin)
297 G4cout <<
"---> warning from HistoManager::SetNtuple() : Ntuple " << nt
298 <<
"does not exist" <<
G4endl;
302 const G4String id[] = {
"100",
"101" };
305 "Energy deposit in subModule"
310 column[0] =
" int dum=0 ";
313 "double Evis0, Evis1, Evis2, Evis3, Evis4, Evis5, Evis6, Evis7, Evis8, Evis9";
315 ", Evis10, Evis11, Evis12, Evis13, Evis14, Evis15, Evis16, Evis17";
317 ", Edep0, Edep1, Edep2, Edep3, Edep4, Edep5, Edep6, Edep7, Edep8, Edep9";
319 ", Edep10, Edep11, Edep12, Edep13, Edep14, Edep15, Edep16, Edep17";
328 G4cout <<
"----> SetNtuple " << nt <<
": " << titl <<
"; " <<
G4endl;
337 G4cout <<
"---> warning from HistoManager::FillNtuple() : Ntuple " << nt
338 <<
" does not exist " << column << value <<
G4endl;
341 #ifdef G4ANALYSIS_USE
351 G4cout <<
"---> warning from HistoManager::AddRowNtuple() : Ntuple " << nt
352 <<
" do not exist" <<
G4endl;
355 #ifdef G4ANALYSIS_USE
void FillNtuple(G4int id, G4int column, G4double value)
static const G4double fac
void AddRowNtuple(G4int id)
void FillHisto(G4int id, G4double bin, G4double weight=1.0)
void Normalize(G4int id, G4double fac)
static G4double GetValueOf(const G4String &)
G4GLOB_DLL std::ostream G4cout
HistoMessenger * histoMessenger
void SetHisto(G4int, G4int, G4double, G4double, const G4String &unit="none")
G4String TitleNt[MaxNtupl]
AIDA::ITuple * ntupl[MaxNtupl]
AIDA::IHistogram1D * histo[MaxHisto]
G4String LabelNt[MaxNtupl]
G4String ColumnNt[MaxNtupl]