48 IORTAnalysisManager::IORTAnalysisManager()
49 #ifdef G4ANALYSIS_USE_ROOT
51 analysisFileName(
"DoseDistribution.root"),theTFile(0), histo1(0), histo2(0), histo3(0),
52 histo4(0), histo5(0), histo6(0), histo7(0), histo8(0), histo9(0), histo10(0), histo11(0), histo12(0), histo13(0), histo14(0), histo15(0), histo16(0),
54 kineticEnergyPrimaryNtuple(0),
72 #ifdef G4ANALYSIS_USE_ROOT
82 #ifdef G4ANALYSIS_USE_ROOT
90 delete fragmentNtuple;
93 delete theROOTIonTuple;
150 void IORTAnalysisManager::SetAnalysisFileName(
G4String aFileName)
152 this->analysisFileName = aFileName;
156 G4bool IORTAnalysisManager::IsTheTFile()
158 return (theTFile) ?
true:
false;
160 void IORTAnalysisManager::book()
164 theTFile =
new TFile(analysisFileName,
"RECREATE");
167 histo1 = createHistogram1D(
"braggPeak",
"slice, energy", 400, 0., 80);
168 histo2 = createHistogram1D(
"h20",
"Secondary protons - slice, energy", 400, 0., 400.);
169 histo3 = createHistogram1D(
"h30",
"Secondary neutrons - slice, energy", 400, 0., 400.);
170 histo4 = createHistogram1D(
"h40",
"Secondary alpha - slice, energy", 400, 0., 400.);
171 histo5 = createHistogram1D(
"h50",
"Secondary gamma - slice, energy", 400, 0., 400.);
172 histo6 = createHistogram1D(
"h60",
"Secondary electron - slice, energy", 400, 0., 400.);
173 histo7 = createHistogram1D(
"h70",
"Secondary triton - slice, energy", 400, 0., 400.);
174 histo8 = createHistogram1D(
"h80",
"Secondary deuteron - slice, energy", 400, 0., 400.);
175 histo9 = createHistogram1D(
"h90",
"Secondary pion - slice, energy", 400, 0., 400.);
176 histo10 = createHistogram1D(
"h100",
"Energy distribution of secondary electrons", 70, 0., 70.);
177 histo11 = createHistogram1D(
"h110",
"Energy distribution of secondary photons", 70, 0., 70.);
178 histo12 = createHistogram1D(
"h120",
"Energy distribution of secondary deuterons", 70, 0., 70.);
179 histo13 = createHistogram1D(
"h130",
"Energy distribution of secondary tritons", 70, 0., 70.);
180 histo14 = createHistogram1D(
"h140",
"Energy distribution of secondary alpha particles", 70, 0., 70.);
181 histo15 = createHistogram1D(
"heliumEnergyAfterPhantom",
"Energy distribution of secondary helium fragments after the phantom",
183 histo16 = createHistogram1D(
"hydrogenEnergyAfterPhantom",
"Energy distribution of secondary helium fragments after the phantom",
186 kinFragNtuple =
new TNtuple(
"kinFragNtuple",
187 "Kinetic energy by voxel & fragment",
188 "i:j:k:A:Z:kineticEnergy");
189 kineticEnergyPrimaryNtuple=
new TNtuple(
"kineticEnergyPrimaryNtuple",
190 "Kinetic energy by voxel of primary",
191 "i:j:k:kineticEnergy");
192 doseFragNtuple =
new TNtuple(
"doseFragNtuple",
193 "Energy deposit by voxel & fragment",
196 fluenceFragNtuple =
new TNtuple(
"fluenceFragNtuple",
197 "Fluence by voxel & fragment",
198 "i:j:k:A:Z:fluence");
200 letFragNtuple =
new TNtuple(
"letFragNtuple",
201 "Let by voxel & fragment",
202 "i:j:k:A:Z:letT:letD");
204 theROOTNtuple =
new TNtuple(
"theROOTNtuple",
205 "Energy deposit by slice",
208 theROOTIonTuple =
new TNtuple(
"theROOTIonTuple",
209 "Generic ion information",
210 "a:z:occupancy:energy");
212 fragmentNtuple =
new TNtuple(
"fragmentNtuple",
214 "A:Z:energy:posX:posY:posZ");
216 metaData =
new TNtuple(
"metaData",
218 "events:detectorDistance:waterThickness:beamEnergy:energyError:phantomCenterDistance");
222 void IORTAnalysisManager::FillEnergyDeposit(
G4int i,
229 theROOTNtuple->Fill(i, j, k, energy);
234 void IORTAnalysisManager::BraggPeak(
G4int slice,
G4double energy)
236 histo1->SetBinContent(slice, energy);
240 void IORTAnalysisManager::SecondaryProtonEnergyDeposit(
G4int slice,
G4double energy)
242 histo2->Fill(slice, energy);
246 void IORTAnalysisManager::SecondaryNeutronEnergyDeposit(
G4int slice,
G4double energy)
248 histo3->Fill(slice, energy);
252 void IORTAnalysisManager::SecondaryAlphaEnergyDeposit(
G4int slice,
G4double energy)
254 histo4->Fill(slice, energy);
258 void IORTAnalysisManager::SecondaryGammaEnergyDeposit(
G4int slice,
G4double energy)
260 histo5->Fill(slice, energy);
264 void IORTAnalysisManager::SecondaryElectronEnergyDeposit(
G4int slice,
G4double energy)
266 histo6->Fill(slice, energy);
270 void IORTAnalysisManager::SecondaryTritonEnergyDeposit(
G4int slice,
G4double energy)
272 histo7->Fill(slice, energy);
276 void IORTAnalysisManager::SecondaryDeuteronEnergyDeposit(
G4int slice,
G4double energy)
278 histo8->Fill(slice, energy);
282 void IORTAnalysisManager::SecondaryPionEnergyDeposit(
G4int slice,
G4double energy)
284 histo9->Fill(slice, energy);
288 void IORTAnalysisManager::electronEnergyDistribution(
G4double energy)
290 histo10->Fill(energy);
294 void IORTAnalysisManager::gammaEnergyDistribution(
G4double energy)
296 histo11->Fill(energy);
300 void IORTAnalysisManager::deuteronEnergyDistribution(
G4double energy)
302 histo12->Fill(energy);
306 void IORTAnalysisManager::tritonEnergyDistribution(
G4double energy)
308 histo13->Fill(energy);
312 void IORTAnalysisManager::alphaEnergyDistribution(
G4double energy)
314 histo14->Fill(energy);
317 void IORTAnalysisManager::heliumEnergy(
G4double secondaryParticleKineticEnergy)
319 histo15->Fill(secondaryParticleKineticEnergy);
323 void IORTAnalysisManager::hydrogenEnergy(
G4double secondaryParticleKineticEnergy)
325 histo16->Fill(secondaryParticleKineticEnergy);
333 kinFragNtuple ->
Fill(i, j, k, A, Z, kinEnergy);
341 kineticEnergyPrimaryNtuple ->
Fill(i, j, k, kinEnergy);
352 doseFragNtuple ->
Fill( i, j, k, A, Z, energy );
356 fluenceFragNtuple ->
Fill( i, j, k, A, Z, fluence );
363 letFragNtuple ->
Fill( i, j, k, A, Z, letT, letD);
369 fragmentNtuple->Fill(A, Z, energy, posX, posY, posZ);
373 void IORTAnalysisManager::genericIonInformation(
G4int a,
375 G4int electronOccupancy,
378 if (theROOTIonTuple) {
379 theROOTIonTuple->Fill(a, z, electronOccupancy, energy);
384 void IORTAnalysisManager::startNewEvent()
389 void IORTAnalysisManager::setGeometryMetaData(
G4double endDetectorPosition,
G4double waterThickness,
G4double phantomCenter)
391 this->detectorDistance = endDetectorPosition;
392 this->phantomDepth = waterThickness;
393 this->phantomCenterDistance = phantomCenter;
395 void IORTAnalysisManager::setBeamMetaData(
G4double meanKineticEnergy,
G4double sigmaEnergy)
397 this->beamEnergy = meanKineticEnergy;
398 this->energyError = sigmaEnergy;
402 void IORTAnalysisManager::flush()