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),
65 #ifdef G4ANALYSIS_USE_ROOT
76 #ifdef G4ANALYSIS_USE_ROOT
86 #ifdef G4ANALYSIS_USE_ROOT
94 delete fragmentNtuple;
97 delete theROOTIonTuple;
100 delete theROOTNtuple;
154 void IORTAnalysisManager::SetAnalysisFileName(
G4String aFileName)
156 this->analysisFileName = aFileName;
160 G4bool IORTAnalysisManager::IsTheTFile()
162 return (theTFile) ?
true:
false;
164 void IORTAnalysisManager::book()
168 theTFile =
new TFile(analysisFileName,
"RECREATE");
171 histo1 = createHistogram1D(
"braggPeak",
"slice, energy", 400, 0., 80);
172 histo2 = createHistogram1D(
"h20",
"Secondary protons - slice, energy", 400, 0., 400.);
173 histo3 = createHistogram1D(
"h30",
"Secondary neutrons - slice, energy", 400, 0., 400.);
174 histo4 = createHistogram1D(
"h40",
"Secondary alpha - slice, energy", 400, 0., 400.);
175 histo5 = createHistogram1D(
"h50",
"Secondary gamma - slice, energy", 400, 0., 400.);
176 histo6 = createHistogram1D(
"h60",
"Secondary electron - slice, energy", 400, 0., 400.);
177 histo7 = createHistogram1D(
"h70",
"Secondary triton - slice, energy", 400, 0., 400.);
178 histo8 = createHistogram1D(
"h80",
"Secondary deuteron - slice, energy", 400, 0., 400.);
179 histo9 = createHistogram1D(
"h90",
"Secondary pion - slice, energy", 400, 0., 400.);
180 histo10 = createHistogram1D(
"h100",
"Energy distribution of secondary electrons", 70, 0., 70.);
181 histo11 = createHistogram1D(
"h110",
"Energy distribution of secondary photons", 70, 0., 70.);
182 histo12 = createHistogram1D(
"h120",
"Energy distribution of secondary deuterons", 70, 0., 70.);
183 histo13 = createHistogram1D(
"h130",
"Energy distribution of secondary tritons", 70, 0., 70.);
184 histo14 = createHistogram1D(
"h140",
"Energy distribution of secondary alpha particles", 70, 0., 70.);
185 histo15 = createHistogram1D(
"heliumEnergyAfterPhantom",
"Energy distribution of secondary helium fragments after the phantom",
187 histo16 = createHistogram1D(
"hydrogenEnergyAfterPhantom",
"Energy distribution of secondary helium fragments after the phantom",
190 kinFragNtuple =
new TNtuple(
"kinFragNtuple",
191 "Kinetic energy by voxel & fragment",
192 "i:j:k:A:Z:kineticEnergy");
193 kineticEnergyPrimaryNtuple=
new TNtuple(
"kineticEnergyPrimaryNtuple",
194 "Kinetic energy by voxel of primary",
195 "i:j:k:kineticEnergy");
196 doseFragNtuple =
new TNtuple(
"doseFragNtuple",
197 "Energy deposit by voxel & fragment",
200 fluenceFragNtuple =
new TNtuple(
"fluenceFragNtuple",
201 "Fluence by voxel & fragment",
202 "i:j:k:A:Z:fluence");
204 letFragNtuple =
new TNtuple(
"letFragNtuple",
205 "Let by voxel & fragment",
206 "i:j:k:A:Z:letT:letD");
208 theROOTNtuple =
new TNtuple(
"theROOTNtuple",
209 "Energy deposit by slice",
212 theROOTIonTuple =
new TNtuple(
"theROOTIonTuple",
213 "Generic ion information",
214 "a:z:occupancy:energy");
216 fragmentNtuple =
new TNtuple(
"fragmentNtuple",
218 "A:Z:energy:posX:posY:posZ");
220 metaData =
new TNtuple(
"metaData",
222 "events:detectorDistance:waterThickness:beamEnergy:energyError:phantomCenterDistance");
226 void IORTAnalysisManager::FillEnergyDeposit(
G4int i,
233 theROOTNtuple->Fill(i, j, k, energy);
238 void IORTAnalysisManager::BraggPeak(
G4int slice,
G4double energy)
240 histo1->SetBinContent(slice, energy);
244 void IORTAnalysisManager::SecondaryProtonEnergyDeposit(
G4int slice,
G4double energy)
246 histo2->Fill(slice, energy);
250 void IORTAnalysisManager::SecondaryNeutronEnergyDeposit(
G4int slice,
G4double energy)
252 histo3->Fill(slice, energy);
256 void IORTAnalysisManager::SecondaryAlphaEnergyDeposit(
G4int slice,
G4double energy)
258 histo4->Fill(slice, energy);
262 void IORTAnalysisManager::SecondaryGammaEnergyDeposit(
G4int slice,
G4double energy)
264 histo5->Fill(slice, energy);
268 void IORTAnalysisManager::SecondaryElectronEnergyDeposit(
G4int slice,
G4double energy)
270 histo6->Fill(slice, energy);
274 void IORTAnalysisManager::SecondaryTritonEnergyDeposit(
G4int slice,
G4double energy)
276 histo7->Fill(slice, energy);
280 void IORTAnalysisManager::SecondaryDeuteronEnergyDeposit(
G4int slice,
G4double energy)
282 histo8->Fill(slice, energy);
286 void IORTAnalysisManager::SecondaryPionEnergyDeposit(
G4int slice,
G4double energy)
288 histo9->Fill(slice, energy);
292 void IORTAnalysisManager::electronEnergyDistribution(
G4double energy)
294 histo10->Fill(energy);
298 void IORTAnalysisManager::gammaEnergyDistribution(
G4double energy)
300 histo11->Fill(energy);
304 void IORTAnalysisManager::deuteronEnergyDistribution(
G4double energy)
306 histo12->Fill(energy);
310 void IORTAnalysisManager::tritonEnergyDistribution(
G4double energy)
312 histo13->Fill(energy);
316 void IORTAnalysisManager::alphaEnergyDistribution(
G4double energy)
318 histo14->Fill(energy);
321 void IORTAnalysisManager::heliumEnergy(
G4double secondaryParticleKineticEnergy)
323 histo15->Fill(secondaryParticleKineticEnergy);
327 void IORTAnalysisManager::hydrogenEnergy(
G4double secondaryParticleKineticEnergy)
329 histo16->Fill(secondaryParticleKineticEnergy);
337 kinFragNtuple ->
Fill(i, j, k, A, Z, kinEnergy);
345 kineticEnergyPrimaryNtuple ->
Fill(i, j, k, kinEnergy);
356 doseFragNtuple ->
Fill( i, j, k, A, Z, energy );
360 fluenceFragNtuple ->
Fill( i, j, k, A, Z, fluence );
367 letFragNtuple ->
Fill( i, j, k, A, Z, letT, letD);
373 fragmentNtuple->Fill(A, Z, energy, posX, posY, posZ);
377 void IORTAnalysisManager::genericIonInformation(
G4int a,
379 G4int electronOccupancy,
382 if (theROOTIonTuple) {
383 theROOTIonTuple->Fill(a, z, electronOccupancy, energy);
388 void IORTAnalysisManager::startNewEvent()
393 void IORTAnalysisManager::setGeometryMetaData(
G4double endDetectorPosition,
G4double waterThickness,
G4double phantomCenter)
395 this->detectorDistance = endDetectorPosition;
396 this->phantomDepth = waterThickness;
397 this->phantomCenterDistance = phantomCenter;
399 void IORTAnalysisManager::setBeamMetaData(
G4double meanKineticEnergy,
G4double sigmaEnergy)
401 this->beamEnergy = meanKineticEnergy;
402 this->energyError = sigmaEnergy;
406 void IORTAnalysisManager::flush()
ntupleExperimental Fill(depthExp, EdepExp)
static IORTAnalysisManager * GetInstance()
IORTAnalysisFileMessenger * fMess
static IORTAnalysisManager * instance