Import Geant4 9.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:15:05 +02:00
parent b79225fb37
commit 74cad5e589
3877 changed files with 234205 additions and 167127 deletions
@@ -32,16 +32,18 @@
// * *
// *******************************
//
// $Id: BrachyAnalysisManager.cc,v 1.20 2008/06/05 13:45:39 cirrone Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: BrachyAnalysisManager.cc,v 1.22 2009/11/12 10:32:59 pandola Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
#ifdef G4ANALYSIS_USE
#include <stdlib.h>
#include <fstream>
#include "BrachyAnalysisManager.hh"
#include "G4ios.hh"
#ifdef G4ANALYSIS_USE
#include "AIDA/IHistogram1D.h"
#include "AIDA/IHistogram2D.h"
#include "AIDA/IManagedObject.h"
@@ -51,16 +53,15 @@
#include "AIDA/ITreeFactory.h"
#include "AIDA/ITree.h"
#include "AIDA/ITuple.h"
#endif
BrachyAnalysisManager* BrachyAnalysisManager::instance = 0;
BrachyAnalysisManager::BrachyAnalysisManager():
BrachyAnalysisManager::BrachyAnalysisManager() :
aFact(0), theTree(0), histFact(0), tupFact(0), h1(0),
h2(0), ntuple(0)
{
h2(0), h3(0), ntuple(0)
#ifdef G4ANALYSIS_USE
{
// Instantiate the factories
// The factories manage the analysis objects
@@ -73,13 +74,10 @@ aFact(0), theTree(0), histFact(0), tupFact(0), h1(0),
theTree = treeFact -> create(fileName,"ROOT",false, true);
delete treeFact;
#endif
}
BrachyAnalysisManager::~BrachyAnalysisManager()
{
#ifdef G4ANALYSIS_USE
delete tupFact;
tupFact = 0;
@@ -91,7 +89,6 @@ BrachyAnalysisManager::~BrachyAnalysisManager()
delete aFact;
aFact = 0;
#endif
}
BrachyAnalysisManager* BrachyAnalysisManager::getInstance()
@@ -102,7 +99,6 @@ BrachyAnalysisManager* BrachyAnalysisManager::getInstance()
void BrachyAnalysisManager::book()
{
#ifdef G4ANALYSIS_USE
// Instantiate the histogram and ntuple factories
histFact = aFact -> createHistogramFactory( *theTree );
tupFact = aFact -> createTupleFactory ( *theTree );
@@ -123,14 +119,13 @@ void BrachyAnalysisManager::book()
300,-150.,150.); //bins' number, xmin, xmax
//defining the ntuple columns' name
std::string columnNames = "double energy; double x; double y; double z";
std::string columnNames = "double energy, x , y , z ";
std::string options = "";
//creating a ntuple
if (tupFact) ntuple = tupFact -> create("1","1",columnNames, options);
// check for non-zero ...
if (ntuple) G4cout<<"The Ntuple is non-zero"<<G4endl;
#endif
}
void BrachyAnalysisManager::FillNtupleWithEnergy(G4double xx,
@@ -138,7 +133,6 @@ void BrachyAnalysisManager::FillNtupleWithEnergy(G4double xx,
G4double zz,
G4double en)
{
#ifdef G4ANALYSIS_USE
if (ntuple == 0)
{
G4cout << "AAAAAAAGH..... The Ntuple is 0" << G4endl;
@@ -158,47 +152,39 @@ void BrachyAnalysisManager::FillNtupleWithEnergy(G4double xx,
ntuple -> fill(indexZ, zz);
ntuple->addRow();
#endif
}
void BrachyAnalysisManager::FillHistogramWithEnergy(G4double x,
G4double z,
G4double energyDeposit)
{
#ifdef G4ANALYSIS_USE
// 2DHistogram: energy deposit in a voxel which center is fixed in position (x,z)
h1 -> fill(x,z,energyDeposit);
#endif
}
void BrachyAnalysisManager::PrimaryParticleEnergySpectrum(G4double primaryParticleEnergy)
{
#ifdef G4ANALYSIS_USE
// 1DHistogram: energy spectrum of primary particles
h2 -> fill(primaryParticleEnergy);
#endif
return;
}
void BrachyAnalysisManager::DoseDistribution(G4double x,G4double energy)
{
#ifdef G4ANALYSIS_USE
// 1DHistogram: energy spectrum of primary particles
h3 -> fill(x, energy);
#endif
}
void BrachyAnalysisManager::finish()
{
#ifdef G4ANALYSIS_USE
// write all histograms to file ...
theTree -> commit();
// close (will again commit) ...
theTree -> close();
#endif
}
#endif
@@ -33,11 +33,13 @@
// * *
// ********************************
//
// $Id: BrachyPhantomSD.cc,v 1.13 2006/06/29 15:48:39 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: BrachyPhantomSD.cc,v 1.14 2009/02/23 17:34:26 gunter Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
#include "BrachyPhantomSD.hh"
#ifdef G4ANALYSIS_USE
#include "BrachyAnalysisManager.hh"
#endif
#include "BrachyDetectorConstruction.hh"
#include "G4Track.hh"
#include "G4LogicalVolume.hh"
@@ -35,8 +35,8 @@
// * *
// **********************************
//
// $Id: BrachyPhysicsList.cc,v 1.13 2006/11/15 10:02:17 guatelli Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: BrachyPhysicsList.cc,v 1.14 2009/11/12 02:50:51 cirrone Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
#include "BrachyPhysicsList.hh"
@@ -46,16 +46,27 @@
#include "G4ParticleTypes.hh"
#include "G4UnitsTable.hh"
#include "G4ios.hh"
#include "G4MultipleScattering.hh"
// gamma
#include "G4LowEnergyRayleigh.hh"
#include "G4LowEnergyPhotoElectric.hh"
#include "G4LowEnergyCompton.hh"
#include "G4LowEnergyGammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4LivermorePhotoElectricModel.hh"
#include "G4ComptonScattering.hh"
#include "G4LivermoreComptonModel.hh"
#include "G4GammaConversion.hh"
#include "G4LivermoreGammaConversionModel.hh"
#include "G4RayleighScattering.hh"
#include "G4LivermoreRayleighModel.hh"
// e-
#include "G4LowEnergyIonisation.hh"
#include "G4LowEnergyBremsstrahlung.hh"
#include "G4eMultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4LivermoreIonisationModel.hh"
#include "G4eBremsstrahlung.hh"
#include "G4LivermoreBremsstrahlungModel.hh"
// e+
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
@@ -79,6 +90,7 @@ void BrachyPhysicsList::ConstructParticle()
ConstructBosons();
ConstructLeptons();
}
void BrachyPhysicsList::ConstructBosons()
@@ -113,30 +125,58 @@ void BrachyPhysicsList::ConstructEM()
// Processes
if (particleName == "gamma") {
// Photon
pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh);
pmanager->AddDiscreteProcess(new G4LowEnergyPhotoElectric);
pmanager->AddDiscreteProcess(new G4LowEnergyCompton);
pmanager->AddDiscreteProcess(new G4LowEnergyGammaConversion);
G4RayleighScattering* theRayleigh = new G4RayleighScattering();
theRayleigh->SetModel(new G4LivermoreRayleighModel()); //not strictly necessary
pmanager->AddDiscreteProcess(theRayleigh);
G4PhotoElectricEffect* thePhotoElectricEffect = new G4PhotoElectricEffect();
thePhotoElectricEffect->SetModel(new G4LivermorePhotoElectricModel());
pmanager->AddDiscreteProcess(thePhotoElectricEffect);
G4ComptonScattering* theComptonScattering = new G4ComptonScattering();
theComptonScattering->SetModel(new G4LivermoreComptonModel());
pmanager->AddDiscreteProcess(theComptonScattering);
G4GammaConversion* theGammaConversion = new G4GammaConversion();
theGammaConversion->SetModel(new G4LivermoreGammaConversionModel());
pmanager->AddDiscreteProcess(theGammaConversion);
} else if (particleName == "e-") {
// Electron
G4LowEnergyIonisation* loweIon = new G4LowEnergyIonisation("LowEnergyIoni");
G4eMultipleScattering* msc = new G4eMultipleScattering();
msc->SetStepLimitType(fUseDistanceToBoundary);
pmanager->AddProcess(msc,-1, 1, 1);
G4LowEnergyBremsstrahlung* loweBrem = new G4LowEnergyBremsstrahlung("LowEnBrem");
// Select the Bremsstrahlung angular distribution model (Tsai/2BN/2BS)
loweBrem->SetAngularGenerator("tsai");
pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
pmanager->AddProcess(loweIon, -1, 2,2);
pmanager->AddProcess(loweBrem, -1,-1,3);
// Ionisation
G4eIonisation* eIonisation = new G4eIonisation();
eIonisation->SetEmModel(new G4LivermoreIonisationModel());
eIonisation->SetStepFunction(0.2, 100*um); //improved precision in tracking
pmanager->AddProcess(eIonisation,-1, 2, 2);
// Bremsstrahlung
G4eBremsstrahlung* eBremsstrahlung = new G4eBremsstrahlung();
eBremsstrahlung->SetEmModel(new G4LivermoreBremsstrahlungModel());
pmanager->AddProcess(eBremsstrahlung, -1,-3, 3);
} else if (particleName == "e+") {
// Positron
pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3);
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);
G4eMultipleScattering* msc = new G4eMultipleScattering();
msc->SetStepLimitType(fUseDistanceToBoundary);
pmanager->AddProcess(msc,-1, 1, 1);
// Ionisation
G4eIonisation* eIonisation = new G4eIonisation();
eIonisation->SetStepFunction(0.2, 100*um); //
pmanager->AddProcess(eIonisation, -1, 2, 2);
//Bremsstrahlung (use default, no low-energy available)
pmanager->AddProcess(new G4eBremsstrahlung(), -1,-1, 3);
//Annihilation
pmanager->AddProcess(new G4eplusAnnihilation(),0,-1, 4);
}
}
@@ -37,12 +37,14 @@
// * *
// ********************************************
//
// $Id: BrachyPrimaryGeneratorAction.cc,v 1.18 2006/06/29 15:48:45 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: BrachyPrimaryGeneratorAction.cc,v 1.19 2009/02/23 17:34:26 gunter Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
#include "globals.hh"
#include "BrachyPrimaryGeneratorAction.hh"
#ifdef G4ANALYSIS_USE
#include "BrachyAnalysisManager.hh"
#endif
#include "G4ParticleTable.hh"
#include "Randomize.hh"
#include "G4Event.hh"