Import Geant4 9.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:25:56 +02:00
parent 74cad5e589
commit 89a9605df1
4440 changed files with 379508 additions and 189225 deletions
@@ -23,25 +23,20 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// HadrontherapyAnalysisManager.hh; May 2005
// This is the *BASIC* version of Hadrontherapy, a Geant4-based application
// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
//
// Visit the Hadrontherapy web site (http://www.lns.infn.it/link/Hadrontherapy) to request
// the *COMPLETE* version of this program, together with its documentation;
// Hadrontherapy (both basic and full version) are supported by the Italian INFN
// Institute in the framework of the MC-INFN Group
//
#ifndef HADRONTHERAPYANALYSISMANAGER_HH
#define HADRONTHERAPYANALYSISMANAGER_HH 1
#include "globals.hh"
#ifdef ANALYSIS_USE ///< If we use analysis
#ifdef G4ANALYSIS_USE ///< If analysis is done via AIDA
#include <AIDA/AIDA.h>
namespace AIDA{
class ITree;
class IAnalysisFactory;
class ITreeFactory;
}
#endif
#ifdef G4ANALYSIS_USE_ROOT ///< If analysis is done directly with ROOT
#include "TROOT.h"
@@ -49,7 +44,6 @@ namespace AIDA{
#include "TNtuple.h"
#include "TH1F.h"
#endif
/**
* Messenger class for analysis-settings for HadronTherapyAnalysisManager
*/
@@ -61,144 +55,136 @@ class HadrontherapyAnalysisFileMessenger;
class HadrontherapyAnalysisManager
{
private:
/**
* Analysis manager is a singleton object (there is only one instance).
* The pointer to this object is available through the use of the method getInstance();
*
* @see getInstance
*/
/**
* Analysis manager is a singleton object (there is only one instance).
* The pointer to this object is available through the use of the method GetInstance();
*
* @see GetInstance
*/
HadrontherapyAnalysisManager();
public:
~HadrontherapyAnalysisManager();
/**
* Get the pointer to the analysis manager.
*/
static HadrontherapyAnalysisManager* getInstance();
static HadrontherapyAnalysisManager* GetInstance();
#ifdef G4ANALYSIS_USE_ROOT
/**
* Book the histograms and ntuples in an AIDA or ROOT file.
*/
* Clear analysis manager heap.
*/
void Clear();
/**
* Check if TFile is there!
*/
G4bool IsTheTFile();
/**
* Book the histograms and ntuples in an AIDA or ROOT file.
*/
void book();
/**
* Set name for the analysis file .root (used by macro)
*/
void SetAnalysisFileName(G4String);
/**
* Fill the ntuple with the energy deposit in the phantom
*/
* Fill the ntuple with the energy deposit in the phantom
*/
void FillEnergyDeposit(G4int voxelXId, G4int voxelYId, G4int voxelZId,
G4double energyDeposit);
G4double energyDeposit);
void BraggPeak(G4int, G4double); ///< Fill 1D histogram with the Bragg peak in the phantom
void SecondaryProtonEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary protons
void SecondaryNeutronEnergyDeposit(G4int slice, G4double energy);
void SecondaryNeutronEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary neutrons
void SecondaryAlphaEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary alpha particles
void SecondaryGammaEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary gamma
void SecondaryElectronEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary electrons
void SecondaryTritonEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary tritons
void SecondaryDeuteronEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary deuterons
void SecondaryPionEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary pions
void electronEnergyDistribution(G4double secondaryParticleKineticEnergy);
///< Energy distribution of secondary electrons originated in the phantom
void gammaEnergyDistribution(G4double secondaryParticleKineticEnergy);
///< Energy distribution of secondary gamma originated in the phantom
void deuteronEnergyDistribution(G4double secondaryParticleKineticEnergy);
///< Energy distribution of secondary deuterons originated in the phantom
void tritonEnergyDistribution(G4double secondaryParticleKineticEnergy);
///< Energy distribution of secondary tritons originated in the phantom
void alphaEnergyDistribution(G4double secondaryParticleKineticEnergy);
///< Energy distribution of secondary alpha originated in the phantom
void heliumEnergy(G4double secondaryParticleKineticEnergy);
///< Energy distribution of the helium (He3 and alpha) particles after the phantom
void hydrogenEnergy(G4double secondaryParticleKineticEnergy);
///< Energy distribution of the hydrogen (proton, d, t) particles after the phantom
void fillFragmentTuple(G4int A, G4double Z, G4double energy, G4double posX, G4double posY, G4double posZ);
//Kinetic energy by voxel, mass number A and atomic number Z.
void FillKineticFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double kinEnergy);
//Kinetic energy by voxel, mass number A and atomic number Z of only primary particles
void FillKineticEnergyPrimaryNTuple(G4int i, G4int j, G4int k, G4double kinEnergy);
///< Energy by voxel, mass number A and atomic number Z.
void FillVoxelFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double energy, G4double fluence);
void FillFragmentTuple(G4int A, G4double Z, G4double energy, G4double posX, G4double posY, G4double posZ);
///< Energy ntuple
void FillLetFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double letT, G4double letD);
///< let ntuple
void genericIonInformation(G4int, G4double, G4int, G4double);
void ThintargetBeamDisp(G4double,G4double);
void startNewEvent();
///< Tell the analysis manager that a new event is starting
void setGeometryMetaData(G4double, G4double, G4double);
///< from the detector construction information about the geometry can be written as metadata
void setBeamMetaData(G4double, G4double);
///< metadata about the beam can be written this way
void finish();
void flush();
///< Close the .hbk file with the histograms and the ntuples
void flush();
#ifdef G4ANALYSIS_USE_ROOT
private:
TH1F *createHistogram1D(const TString name, const TString title, int bins, double xmin, double xmax) {
TH1F *histo = new TH1F(name, title, bins, xmin, xmax);
histo->SetLineWidth(2);
return histo;
}
#endif
private:
#endif
static HadrontherapyAnalysisManager* instance;
HadrontherapyAnalysisFileMessenger* fMess;
#ifdef G4ANALYSIS_USE_ROOT
G4String analysisFileName;
#ifdef G4ANALYSIS_USE
AIDA::IAnalysisFactory* aFact;
AIDA::ITree* theTree;
AIDA::IHistogramFactory *histFact;
AIDA::ITupleFactory *tupFact;
AIDA::IHistogram1D *h1;
AIDA::IHistogram1D *h2;
AIDA::IHistogram1D *h3;
AIDA::IHistogram1D *h4;
AIDA::IHistogram1D *h5;
AIDA::IHistogram1D *h6;
AIDA::IHistogram1D *h7;
AIDA::IHistogram1D *h8;
AIDA::IHistogram1D *h9;
AIDA::IHistogram1D *h10;
AIDA::IHistogram1D *h11;
AIDA::IHistogram1D *h12;
AIDA::IHistogram1D *h13;
AIDA::IHistogram1D *h14;
AIDA::IHistogram1D *h15;
AIDA::IHistogram1D *h16;
AIDA::ITuple *ntuple;
AIDA::ITuple *ionTuple;
AIDA::ITuple *fragmentTuple;
#endif
#ifdef G4ANALYSIS_USE_ROOT
TFile *theTFile;
TH1F *histo1;
TH1F *histo2;
@@ -216,20 +202,32 @@ private:
TH1F *histo14;
TH1F *histo15;
TH1F *histo16;
TNtuple *kinFragNtuple;
TNtuple *kineticEnergyPrimaryNtuple;
// ntuple containing the fluence of all the particle in any voxel
TNtuple *doseFragNtuple;
// ntuple containing the fluence of all the particle in any voxel
TNtuple *fluenceFragNtuple;
// ntuple containing the fluence of all the particle in any voxel
TNtuple *letFragNtuple;
TNtuple *theROOTNtuple;
TNtuple *theROOTIonTuple;
TNtuple *fragmentNtuple; // fragments
TNtuple *metaData;
#endif
G4long eventCounter; // Simulation metadata
G4double detectorDistance;
G4double phantomDepth;
G4double beamEnergy;
G4double energyError;
G4double phantomCenterDistance;
#endif
};
#endif
#endif