49 #include "HistoManager.hh"
77 #include "DetectorConstruction.hh"
112 fPrimaryKineticEnergy = 0.0;
116 fHisto =
new Histo();
126 void HistoManager::Initialise()
128 fAbsZ0 = -0.5*fLength;
161 fHisto->
Add1D(
"0",
"Energy deposition (MeV/mm/event) in the target",
162 fNSlices,0.0,fLength/
mm,
MeV/
mm);
163 fHisto->
Add1D(
"1",
"Log10 Energy (GeV) of gammas",fNBinsE,-5.,5.,1.0);
164 fHisto->
Add1D(
"2",
"Log10 Energy (GeV) of electrons",fNBinsE,-5.,5.,1.0);
165 fHisto->
Add1D(
"3",
"Log10 Energy (GeV) of positrons",fNBinsE,-5.,5.,1.0);
166 fHisto->
Add1D(
"4",
"Log10 Energy (GeV) of protons",fNBinsE,-5.,5.,1.0);
167 fHisto->
Add1D(
"5",
"Log10 Energy (GeV) of neutrons",fNBinsE,-5.,5.,1.0);
168 fHisto->
Add1D(
"6",
"Log10 Energy (GeV) of charged pions",fNBinsE,-4.,6.,1.0);
169 fHisto->
Add1D(
"7",
"Log10 Energy (GeV) of pi0",fNBinsE,-4.,6.,1.0);
170 fHisto->
Add1D(
"8",
"Log10 Energy (GeV) of charged kaons",fNBinsE,-4.,6.,1.0);
171 fHisto->
Add1D(
"9",
"Log10 Energy (GeV) of neutral kaons",fNBinsE,-4.,6.,1.0);
172 fHisto->
Add1D(
"10",
"Log10 Energy (GeV) of deuterons and tritons",fNBinsE,-5.,5.,1.0);
173 fHisto->
Add1D(
"11",
"Log10 Energy (GeV) of He3 and alpha",fNBinsE,-5.,5.,1.0);
174 fHisto->
Add1D(
"12",
"Log10 Energy (GeV) of Generic Ions",fNBinsE,-5.,5.,1.0);
175 fHisto->
Add1D(
"13",
"Log10 Energy (GeV) of muons",fNBinsE,-4.,6.,1.0);
176 fHisto->
Add1D(
"14",
"Log10 Energy (GeV) of pi+",fNBinsE,-4.,6.,1.0);
177 fHisto->
Add1D(
"15",
"Log10 Energy (GeV) of pi-",fNBinsE,-4.,6.,1.0);
178 fHisto->
Add1D(
"16",
"X Section (mb) of Secondary Fragments Z with E>1 GeV (mb)",25,0.5,25.5,1.0);
179 fHisto->
Add1D(
"17",
"Secondary Fragment A E>1 GeV",50,0.5,50.5,1.0);
180 fHisto->
Add1D(
"18",
"Secondary Fragment Z E<1 GeV",25,0.5,25.5,1.0);
181 fHisto->
Add1D(
"19",
"Secondary Fragment A E<1 GeV",50,0.5,50.5,1.0);
182 fHisto->
Add1D(
"20",
"X Section (mb) of Secondary Fragments Z (mb) ",25,0.5,25.5,1.0);
183 fHisto->
Add1D(
"21",
"Secondary Fragment A ",50,0.5,50.5,1.0);
195 G4cout <<
"HistoManager: Histograms are booked and run has been started"
205 G4cout <<
"HistoManager: End of run actions are started" <<
G4endl;
208 G4cout<<
"========================================================"<<
G4endl;
211 if(fNevt > 0) { x = 1.0/
x; }
230 fEdepSum2 -= fEdepSum*fEdepSum;
231 if(fEdepSum2 > 0.0) fEdepSum2 = std::sqrt(fEdepSum2);
232 else fEdepSum2 = 0.0;
234 G4cout <<
"Beam particle "
236 G4cout <<
"Beam Energy(GeV) "
239 G4cout << std::setprecision(4) <<
"Average energy deposit (GeV) " << fEdepSum/
GeV
240 <<
" RMS(GeV) " << fEdepSum2/
GeV <<
G4endl;
241 G4cout << std::setprecision(4) <<
"Average number of steps " << xs <<
G4endl;
242 G4cout << std::setprecision(4) <<
"Average number of gamma " << xg <<
G4endl;
243 G4cout << std::setprecision(4) <<
"Average number of e- " << xe <<
G4endl;
244 G4cout << std::setprecision(4) <<
"Average number of e+ " << xp <<
G4endl;
245 G4cout << std::setprecision(4) <<
"Average number of neutrons " << xn <<
G4endl;
246 G4cout << std::setprecision(4) <<
"Average number of protons " << xpn <<
G4endl;
247 G4cout << std::setprecision(4) <<
"Average number of antiprotons " << xap <<
G4endl;
248 G4cout << std::setprecision(4) <<
"Average number of pi+ & pi- " << xpc <<
G4endl;
249 G4cout << std::setprecision(4) <<
"Average number of pi0 " << xp0 <<
G4endl;
250 G4cout << std::setprecision(4) <<
"Average number of kaons " << xpk <<
G4endl;
251 G4cout << std::setprecision(4) <<
"Average number of muons " << xpm <<
G4endl;
252 G4cout << std::setprecision(4) <<
"Average number of deuterons+tritons " << xid <<
G4endl;
253 G4cout << std::setprecision(4) <<
"Average number of He3+alpha " << xia <<
G4endl;
254 G4cout << std::setprecision(4) <<
"Average number of ions " << xio <<
G4endl;
255 G4cout<<
"========================================================"<<
G4endl;
259 for(
G4int i=0; i<fNHisto; i++) {
285 fEdepSum += fEdepEvt;
286 fEdepSum2 += fEdepEvt*fEdepEvt;
300 fPrimaryKineticEnergy =
e;
304 G4cout <<
"### Primary " << name
305 <<
" kinE(GeV)= " << e/
GeV
314 G4cout <<
"=== Secondary " << name
315 <<
" kinE(GeV)= " << e/
GeV
320 e = std::log10(e/
GeV);
323 fHisto->
Fill(1,e,1.0);
326 fHisto->
Fill(2,e,1.0);
329 fHisto->
Fill(3,e,1.0);
332 fHisto->
Fill(4,e,1.0);
333 }
else if ( pd == fNeutron) {
335 fHisto->
Fill(5,e,1.0);
340 fHisto->
Fill(6,e,1.0);
341 fHisto->
Fill(14,e,1.0);
345 fHisto->
Fill(6,e,1.0);
346 fHisto->
Fill(15,e,1.0);
350 fHisto->
Fill(7,e,1.0);
353 fHisto->
Fill(8,e,1.0);
356 fHisto->
Fill(9,e,1.0);
359 fHisto->
Fill(10,e,1.0);
362 fHisto->
Fill(11,e,1.0);
365 fHisto->
Fill(12,e,1.0);
369 fHisto->
Fill(16,Z,1.0);
370 fHisto->
Fill(17,A,1.0);
372 fHisto->
Fill(18,Z,1.0);
373 fHisto->
Fill(19,A,1.0);
375 fHisto->
Fill(20,Z,1.0);
376 fHisto->
Fill(21,A,1.0);
379 fHisto->
Fill(13,e,1.0);
400 fHisto->
Fill(0,z,edep);
404 G4cout <<
"HistoManager::AddEnergy: e(keV)= " << edep/
keV
405 <<
"; z(mm)= " << z/
mm
426 fHisto->
Fill(
id, x, w);
434 G4cout <<
"### HistoManager WARNING: Ion Physics is already defined: <"
435 << nam <<
"> is ignored!" <<
G4endl;
436 }
else if(nam ==
"DPMJET") {
440 G4cout <<
"### SetIonPhysics: Ion Physics DPMJET/Binary is added"
442 }
else if(nam ==
"FTF") {
446 G4cout <<
"### SetIonPhysics: Ion Physics FTFP/Binary is added"
448 }
else if(nam ==
"UrQMD") {
453 G4cout <<
"### SetIonPhysics: Ion Physics UrQMD is added"
456 G4cout <<
"Error: Ion Physics UrQMD is requested but is not available"
460 G4cout <<
"### HistoManager WARNING: Ion Physics <"
461 << nam <<
"> is unknown!" <<
G4endl;