Import Geant4 8.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:36:02 +02:00
parent d93e1e39a9
commit 8a51e0bc40
5471 changed files with 99628 additions and 55248 deletions
@@ -40,15 +40,59 @@
HadrontherapyAnalysisManager* HadrontherapyAnalysisManager::instance = 0;
HadrontherapyAnalysisManager::HadrontherapyAnalysisManager() :
aFact(0), theTree(0), histFact(0), tupFact(0), h1(0), ntuple(0)
aFact(0), theTree(0), histFact(0), tupFact(0), h1(0), h2(0), h3(0),
h4(0), h5(0), h6(0), h7(0), h8(0), h9(0), h10(0), h11(0), h12(0), h13(0), h14(0), ntuple(0),
ionTuple(0)
{
}
HadrontherapyAnalysisManager::~HadrontherapyAnalysisManager()
{
delete ionTuple;
ionTuple = 0;
delete ntuple;
ntuple = 0;
delete h14;
h14 = 0;
delete h13;
h13 = 0;
delete h12;
h12 = 0;
delete h11;
h11 = 0;
delete h10;
h10 = 0;
delete h9;
h9 = 0;
delete h8;
h8 = 0;
delete h7;
h7 = 0;
delete h6;
h6 = 0;
delete h5;
h5 = 0;
delete h4;
h4 = 0;
delete h3;
h3 = 0;
delete h2;
h2 = 0;
delete h1;
h1 = 0;
@@ -86,13 +130,44 @@ void HadrontherapyAnalysisManager::book()
histFact = aFact -> createHistogramFactory(*theTree);
tupFact = aFact -> createTupleFactory(*theTree);
// Create the histogram
// Create the histograms with the enrgy deposit along the X axis
h1 = histFact -> createHistogram1D("10","slice, energy", 80, 0., 80. );
h2 = histFact -> createHistogram1D("20","Secondary protons - slice, energy", 80, 0., 80. );
h3 = histFact -> createHistogram1D("30","Secondary neutrons - slice, energy", 80, 0., 80. );
h4 = histFact -> createHistogram1D("40","Secondary alpha - slice, energy", 80, 0., 80. );
h5 = histFact -> createHistogram1D("50","Secondary gamma - slice, energy", 80, 0., 80. );
h6 = histFact -> createHistogram1D("60","Secondary electron - slice, energy", 80, 0., 80. );
h7 = histFact -> createHistogram1D("70","Secondary triton - slice, energy", 80, 0., 80. );
h8 = histFact -> createHistogram1D("80","Secondary deuteron - slice, energy", 80, 0., 80. );
h9 = histFact -> createHistogram1D("90","Secondary pion - slice, energy", 80, 0., 80. );
h10 = histFact -> createHistogram1D("100","Energy distribution of secondary electrons", 70, 0., 70. );
h11 = histFact -> createHistogram1D("110","Energy distribution of secondary photons", 70, 0., 70. );
h12 = histFact -> createHistogram1D("120","Energy distribution of secondary deuterons", 70, 0., 70. );
h13 = histFact -> createHistogram1D("130","Energy distribution of secondary tritons", 70, 0., 70. );
h14 = histFact -> createHistogram1D("140","Energy distribution of secondary alpha particles", 70, 0., 70. );
// Create the ntuple
G4String columnNames = "int i; int j; int k; double energy;";
G4String options = "";
if (tupFact) ntuple = tupFact->create("1","1",columnNames, options);
if (tupFact) ntuple = tupFact -> create("1","1",columnNames, options);
// Create the ntuple
G4String columnNames2 = "int a; double z; int occupancy; double energy;";
G4String options2 = "";
if (tupFact) ionTuple = tupFact -> create("2","2", columnNames2, options2);
}
void HadrontherapyAnalysisManager::FillEnergyDeposit(G4int i,
@@ -121,13 +196,98 @@ void HadrontherapyAnalysisManager::BraggPeak(G4int slice, G4double energy)
h1 -> fill(slice,energy);
}
void HadrontherapyAnalysisManager::SecondaryProtonEnergyDeposit(G4int slice, G4double energy)
{
h2 -> fill(slice,energy);
}
void HadrontherapyAnalysisManager::SecondaryNeutronEnergyDeposit(G4int slice, G4double energy)
{
h3 -> fill(slice,energy);
}
void HadrontherapyAnalysisManager::SecondaryAlphaEnergyDeposit(G4int slice, G4double energy)
{
h4 -> fill(slice,energy);
}
void HadrontherapyAnalysisManager::SecondaryGammaEnergyDeposit(G4int slice, G4double energy)
{
h5 -> fill(slice,energy);
}
void HadrontherapyAnalysisManager::SecondaryElectronEnergyDeposit(G4int slice, G4double energy)
{
h6 -> fill(slice,energy);
}
void HadrontherapyAnalysisManager::SecondaryTritonEnergyDeposit(G4int slice, G4double energy)
{
h7 -> fill(slice,energy);
}
void HadrontherapyAnalysisManager::SecondaryDeuteronEnergyDeposit(G4int slice, G4double energy)
{
h8 -> fill(slice,energy);
}
void HadrontherapyAnalysisManager::SecondaryPionEnergyDeposit(G4int slice, G4double energy)
{
h9 -> fill(slice,energy);
}
void HadrontherapyAnalysisManager::electronEnergyDistribution(G4double energy)
{
h10 -> fill(energy);
}
void HadrontherapyAnalysisManager::gammaEnergyDistribution(G4double energy)
{
h11 -> fill(energy);
}
void HadrontherapyAnalysisManager::deuteronEnergyDistribution(G4double energy)
{
h12 -> fill(energy);
}
void HadrontherapyAnalysisManager::tritonEnergyDistribution(G4double energy)
{
h13 -> fill(energy);
}
void HadrontherapyAnalysisManager::alphaEnergyDistribution(G4double energy)
{
h14 -> fill(energy);
}
void HadrontherapyAnalysisManager::genericIonInformation(G4int a,
G4double z,
G4int electronOccupancy,
G4double energy)
{
if (ionTuple)
{
G4int aIndex = ionTuple -> findColumn("a");
G4int zIndex = ionTuple -> findColumn("z");
G4int electronIndex = ionTuple -> findColumn("occupancy");
G4int energyIndex = ionTuple -> findColumn("energy");
ionTuple -> fill(aIndex,a);
ionTuple -> fill(zIndex,z);
ionTuple -> fill(electronIndex, electronOccupancy);
ionTuple -> fill(energyIndex, energy);
}
ionTuple -> addRow();
}
void HadrontherapyAnalysisManager::finish()
{
// Write all histograms to file
theTree -> commit();
// Write all histograms to file
theTree -> commit();
// Close (will again commit)
theTree ->close();
// Close (will again commit)
theTree ->close();
}
#endif