34 #include "HistoManager.hh"
35 #include "HistoMessenger.hh"
39 #include "AIDA/AIDA.h"
46 :af(0),tree(0),factoryOn(
false)
51 af = AIDA_createAnalysisFactory();
53 G4cout <<
" HistoManager::HistoManager() :"
54 <<
" problem creating the AIDA analysis factory."
59 fileName[0] =
"Pol01.aida";
92 if (
fileName[0].find(
".")==G4String::npos) {
101 AIDA::ITreeFactory* tf = af->createTreeFactory();
105 G4cout <<
"HistoManager::book() :"
106 <<
" problem creating the AIDA tree with "
109 <<
" readOnly = " << readOnly
110 <<
" createNew = " << createNew
117 AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
137 #ifdef G4ANALYSIS_USE
158 if (particleName==
"gamma")
id=1;
159 else if (particleName==
"e-")
id=5;
160 else if (particleName==
"e+")
id=9;
163 if (costheta>=1.) costheta=.99999999;
164 if (costheta<-1.) costheta=-1.;
168 FillHisto(
id+3,longitudinalPolarization);
174 G4cout <<
"---> warning from HistoManager::FillHisto() : histo " << ih
175 <<
"does not exist; e= " << e <<
" w= " << weight <<
G4endl;
178 #ifdef G4ANALYSIS_USE
189 G4cout <<
"---> warning from HistoManager::SetHisto() : histo " << ih
190 <<
"does not exist" <<
G4endl;
194 const G4String id[] = {
"0",
"1",
"2",
"3",
"4",
"5",
195 "6",
"7",
"8",
"9",
"10",
"11",
"12"};
198 "Gamma Energy distribution",
199 "Gamma Cos(Theta) distribution",
200 "Gamma Phi angular distribution",
201 "Gamma longitudinal Polarization",
202 "Electron Energy distribution",
203 "Electron Cos(Theta) distribution",
204 "Electron Phi angular distribution",
205 "Electron longitudinal Polarization",
206 "Positron Energy distribution",
207 "Positron Cos(Theta) distribution",
208 "Positron Phi angular distribution",
209 "Positron longitudinal Polarization"
214 G4double vmin = valmin, vmax = valmax;
217 if (unit !=
"none") {
218 titl = title[ih] +
" (" + unit +
")";
220 vmin = valmin/
Unit[ih]; vmax = valmax/
Unit[ih];
229 Width[ih] = (valmax-valmin)/nbins;
231 G4cout <<
"----> SetHisto " << ih <<
": " << titl <<
"; "
232 << nbins <<
" bins from "
233 << vmin <<
" " << unit <<
" to " << vmax <<
" " << unit <<
G4endl;
242 G4cout <<
"---> warning from HistoManager::RemoveHisto() : histo " << ih
243 <<
"does not exist" <<
G4endl;
void FillHisto(G4int id, G4double bin, G4double weight=1.0)
void FillHistos(const G4String &particleName, G4double kinEnergy, G4double costheta, G4double phi, G4double longitudinalPolarization)
static G4double GetValueOf(const G4String &)
G4GLOB_DLL std::ostream G4cout
HistoMessenger * histoMessenger
void SetHisto(G4int, G4int, G4double, G4double, const G4String &unit="none")
AIDA::IHistogram1D * histo[MaxHisto]