Import Geant4 6.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:56:29 +02:00
parent 1d812b78b1
commit e083ffb441
1415 changed files with 111223 additions and 21207 deletions
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.2 2003/10/10 16:21:04 maire Exp $
# $Id: GNUmakefile,v 1.5 2004/03/31 17:09:45 maire Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -17,12 +17,16 @@ all: lib bin
#### G4ANALYSIS_USE := true
ifdef G4ANALYSIS_USE
CPPFLAGS += -DG4ANALYSIS_USE
USE_AIDA := true
endif
ifdef USE_AIDA
CPPFLAGS += -DUSE_AIDA
endif
include $(G4INSTALL)/config/architecture.gmk
ifdef G4ANALYSIS_USE
ifdef USE_AIDA
# for the aida-config command see the README file
CPPFLAGS += `aida-config --include`
LDFLAGS += `aida-config --lib`
@@ -1,4 +1,4 @@
$Id: History,v 1.14 2004/02/06 17:12:45 vnivanch Exp $
$Id: History,v 1.18 2004/06/09 16:20:28 maire Exp $
-------------------------------------------------------------------
=========================================================
@@ -14,6 +14,18 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
09-06-04 mma (testem7-V06-01-01)
- remove PhysicsList Particles and General
31-03-04 mma (testem7-V06-01-00)
- remove direct root interface
15-03-04 mma (testem7-V06-00-02)
- put back G4ANALYSIS_USE in GNUmakefile
10-03-04 mma (testem7-V06-00-01)
- example of histogram with ROOT: USE_ROOT
06-02-04 V.Ivanchenko (testem7-V06-00-00)
- Remove "add binary" from TestEm7.in macro
@@ -1,4 +1,4 @@
$Id: README,v 1.2 2003/10/10 16:21:19 maire Exp $
$Id: README,v 1.7 2004/06/23 11:29:50 maire Exp $
-------------------------------------------------------------------
=========================================================
@@ -103,15 +103,17 @@ $Id: README,v 1.2 2003/10/10 16:21:19 maire Exp $
the maximum allowed for the step size of charged particles.
(command /testem/stepMax )
The result is a 1D histogram (saved as testem7.paw) which is the total
energy deposited along the trajectory of the incident particle.
The result is a 1D histogram which is the total energy deposited along
the trajectory of the incident particle.
The histogram is saved in paw (testem7.paw)
The bin size is egal to stepMax. The number of bins is determined by
the thickness of the absorber (with a minimum of 100 bins).
The total energy deposited is plotted in MeV/mm.
Note that, by default, histograms are disabled. To activate them, uncomment
the flag G4ANALYSIS_USE in GNUmakefile.
G4ANALYSIS_USE in GNUmakefile.
7- DOSE IN 'TEST-VOLUMES'
@@ -121,19 +123,41 @@ $Id: README,v 1.2 2003/10/10 16:21:19 maire Exp $
Notice that the doses are not re initialized between runs, i.e. they are
cumulative over the runs. (idem for the histogram of the Bragg peak.)
8- Using the Anaphe implementation of the AIDA 3.0 histograms:
--------------------------------------------------------------
In order to use the Anaphe implementation of the AIDA 3.0 interfaces,
the 'aida-config' command (which is used in the GNUmakefile) is
available at:
/afs/cern.ch/sw/lhcxx/share/LHCXX/latest/scripts/aida-config
8- Using histograms
-------------------
In order to run the executable, you need to source the following
script (once):
$HOME/bin/setupAnaphe.csh (or $HOME/bin/setupAnaphe)
By default the histograms are not activated. To activate histograms
the environment variable G4ANALYSIS_USE should be defined. For instance
uncomment the flag G4ANALYSIS_USE in GNUmakefile.
At cern 'setupAnaphe' is available at:
/afs/cern.ch/sw/lhcxx/share/LHCXX/latest/scripts/setupAnaphe.csh
(or /afs/cern.ch/sw/lhcxx/share/LHCXX/latest/scripts/setupAnaphe)
To use histograms any of implementations of AIDA interfaces should
be available (see http://aida.freehep.org).
A package including AIDA and extended interfaces also using Python
is PI, available from: http://cern.ch/pi .
Once installed PI or PI-Lite in a specified local area $MYPY, it is
required to add the installation path to $PATH, i.e. for example,
for release 1.2.1 of PI:
setenv PATH ${PATH}:$MYPI/1.2.1/app/releases/PI/PI_1_2_1/rh73_gcc32/bin
CERN users can use the PATH to the LCG area on AFS.
Before compilation of the example it is optimal to clean up old
files:
gmake histclean
gmake
Before running the example the command should be issued:
eval `aida-config --runtime csh`
It is possible to choose the format of the output file with
histograms using UI command:
/testem/histo/setFileType type
The following types are available: hbook, root, xml.
@@ -1,4 +1,4 @@
# $Id: TestEm7.in,v 1.6 2004/02/06 17:12:45 vnivanch Exp $
# $Id: TestEm7.in,v 1.7 2004/03/10 12:32:19 maire Exp $
#
# Macro file for "TestEm7.cc"
# (can be run in batch, without graphic)
@@ -20,7 +20,7 @@
#
/testem/phys/addPhysics standard # em physics
###/testem/phys/addPhysics g4v52 # em physics
#/testem/phys/addPhysics binary # hadronic physics
###/testem/phys/addPhysics binary # hadronic physics
#
/run/initialize
#
@@ -1,8 +1,8 @@
*************************************************************
Geant4 version $Name: geant4-06-01 $ (25-March-2004)
Geant4 version $Name: geant4-06-02 $ (25-June-2004)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303.
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
*************************************************************
@@ -52,7 +52,7 @@ Current available graphics systems are:
/testem/phys/addPhysics standard # em physics
PhysicsList::AddPhysicsList: <standard>
###/testem/phys/addPhysics g4v52 # em physics
#/testem/phys/addPhysics binary # hadronic physics
###/testem/phys/addPhysics binary # hadronic physics
#
/run/initialize
userDetector->Construct() start.
@@ -132,8 +132,8 @@ msc: Model variant of multiple scattering for proton
hIoni: tables are built for proton
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
Lambda tables from threshold to 100 TeV in 120 bins.
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 0
Bether-Bloch model for Escaled > 2 MeV, parametrisation of Bragg peak below, Integral mode 0
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
Bether-Bloch model for Escaled > 2 MeV, parametrisation of Bragg peak below, Integral mode 1
msc: Model variant of multiple scattering for mu+
Lambda tables from 100 eV to 100 TeV in 120 bins.
@@ -142,7 +142,7 @@ msc: Model variant of multiple scattering for mu+
MuIoni: tables are built for mu+
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
Lambda tables from threshold to 100 TeV in 120 bins.
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 0
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
Bether-Bloch model for E > 0.2 MeV, parametrisation of Bragg peak below,
radiative corrections for E > 1 GeV
@@ -160,7 +160,7 @@ MuPairProd: tables are built for mu+
MuIoni: tables are built for mu-
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
Lambda tables from threshold to 100 TeV in 120 bins.
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 0
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
Bether-Bloch model for E > 0.2 MeV, parametrisation of Bragg peak below,
radiative corrections for E > 1 GeV
@@ -235,20 +235,20 @@ Start Run processing.
Run terminated.
Run Summary
Number of events processed : 10000
User=157.8s Real=351.83s Sys=76.83s
User=154.28s Real=375.56s Sys=54.77s
---------------------------------------------------------
Cumulated Doses : Edep Edep/Ebeam Dose
tally 0: 10.392776 GeV 0.64954851 % 0.00020813838 Gy
tally 1: 7.8411972 GeV 0.49007483 % 0.00015703736 Gy
tally 2: 3.5135969 GeV 0.2195998 % 7.0367565e-05 Gy
tally 3: 1.7251868 GeV 0.10782418 % 3.4550691e-05 Gy
tally 0: 10.400219 GeV 0.65001367 % 0.00020828743 Gy
tally 1: 7.9906299 GeV 0.49941437 % 0.00016003008 Gy
tally 2: 3.6423712 GeV 0.2276482 % 7.2946557e-05 Gy
tally 3: 1.8338852 GeV 0.11461782 % 3.6727615e-05 Gy
---------------------------------------------------------
--------- Ranecu engine status ---------
Initial seed (index) = 0
Current couple of seeds = 1526069608, 646338923
Current couple of seeds = 1800509887, 111688235
----------------------------------------
Graphics systems deleted.
Visualization Manager deleting...
@@ -1,65 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListGeneral.hh,v 1.2 2003/10/10 16:21:26 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysListGeneral_h
#define PhysListGeneral_h 1
#include "G4VPhysicsConstructor.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysListGeneral : public G4VPhysicsConstructor
{
public:
PhysListGeneral(const G4String& name = "general");
~PhysListGeneral();
public:
// This method is dummy for physics
void ConstructParticle() {};
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
void ConstructProcess();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -1,65 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListParticles.hh,v 1.2 2003/10/10 16:21:27 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysListParticles_h
#define PhysListParticles_h 1
#include "G4VPhysicsConstructor.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysListParticles : public G4VPhysicsConstructor
{
public:
PhysListParticles(const G4String& name = "particles");
~PhysListParticles();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
void ConstructParticle();
// This method is dummy.
void ConstructProcess() {};
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: PhysicsList.hh,v 1.3 2003/06/16 16:47:56 gunter Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: PhysicsList.hh,v 1.4 2004/06/09 16:20:29 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
@@ -66,12 +66,10 @@ class PhysicsList: public G4VModularPhysicsList
G4double cutForGamma;
G4double cutForElectron;
G4double cutForPositron;
G4VPhysicsConstructor* emPhysicsList;
G4VPhysicsConstructor* generalPhysicsList;
G4VPhysicsConstructor* particleList;
G4String emName;
G4VPhysicsConstructor* emPhysicsList;
std::vector<G4VPhysicsConstructor*> hadronPhys;
G4String emName;
StepMax* stepMaxProcess;
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: RunAction.hh,v 1.2 2003/10/10 16:21:27 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: RunAction.hh,v 1.4 2004/03/31 17:09:45 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -37,7 +37,7 @@ class PhysicsList;
class PrimaryGeneratorAction;
class G4Run;
#ifdef G4ANALYSIS_USE
#ifdef USE_AIDA
namespace AIDA {
class ITree;
class IHistogram1D;
@@ -58,12 +58,12 @@ class RunAction : public G4UserRunAction
G4double* GetTallyEdep() {return tallyEdep;};
#ifdef G4ANALYSIS_USE
#ifdef USE_AIDA
AIDA::IHistogram1D* GetHisto(G4int id) {return histo[id];}
#endif
G4double GetBinLength() {return binLength;};
G4double GetOffsetX() {return offsetX;}
#endif
private:
void bookHisto();
@@ -75,14 +75,14 @@ class RunAction : public G4UserRunAction
PrimaryGeneratorAction* kinematic;
G4double* tallyEdep;
#ifdef G4ANALYSIS_USE
private:
private:
#ifdef USE_AIDA
AIDA::ITree* tree;
AIDA::IHistogram1D* histo[1];
#endif
G4double binLength;
G4double offsetX;
#endif
G4double offsetX;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -1,4 +1,4 @@
# $Id: ionC12.mac,v 1.5 2003/12/05 11:17:15 vnivanch Exp $
# $Id: ionC12.mac,v 1.6 2004/03/10 10:48:11 maire Exp $
#
# Macro file for "TestEm7.cc"
# (can be run in batch, without graphic)
@@ -6,7 +6,6 @@
#
/control/verbose 2
/run/verbose 2
/tracking/verbose 0
#
/testem/det/setMat Water
/testem/det/setSizeX 20 cm
@@ -19,17 +18,18 @@
/testem/det/tallyPosition 0. 0. 0. cm
/testem/det/tallyPosition 5. 0. 0. cm
#
/testem/phys/addPhysics standard #em physics
####/testem/phys/addPhysics g4v52 #em physics
/testem/phys/addPhysics standard #em physics
####/testem/phys/addPhysics g4v52 #em physics
#
/testem/phys/addPhysics binary #hadronic physics
/testem/phys/addPhysics binary_ion #hadronic physics
/testem/phys/addPhysics elastic #hadronic physics
####/testem/phys/addPhysics binary #hadronic physics
####/testem/phys/addPhysics binary_ion #hadronic physics
####/testem/phys/addPhysics elastic #hadronic physics
#
/run/initialize
#
/gun/particle ion #GenericIon C12
/gun/ion 6 12 6
####/gun/particle ion
####/gun/ion 6 12
/gun/particle ionC12
/gun/energy 3.5 GeV
#
/testem/event/printModulo 1000
@@ -1,72 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListGeneral.cc,v 1.2 2003/10/10 16:21:31 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysListGeneral.hh"
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
#include "G4Decay.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListGeneral::PhysListGeneral(const G4String& name)
: G4VPhysicsConstructor(name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListGeneral::~PhysListGeneral()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysListGeneral::ConstructProcess()
{
// Add Decay Process
G4Decay* fDecayProcess = new G4Decay();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (fDecayProcess->IsApplicable(*particle)) {
pmanager ->AddProcess(fDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt
pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -1,144 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListParticles.cc,v 1.1 2003/04/22 16:25:07 maire Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysListParticles.hh"
// Bosons
#include "G4ChargedGeantino.hh"
#include "G4Geantino.hh"
#include "G4Gamma.hh"
#include "G4OpticalPhoton.hh"
// leptons
#include "G4MuonPlus.hh"
#include "G4MuonMinus.hh"
#include "G4NeutrinoMu.hh"
#include "G4AntiNeutrinoMu.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4NeutrinoE.hh"
#include "G4AntiNeutrinoE.hh"
// Mesons
#include "G4PionPlus.hh"
#include "G4PionMinus.hh"
#include "G4PionZero.hh"
#include "G4Eta.hh"
#include "G4EtaPrime.hh"
#include "G4KaonPlus.hh"
#include "G4KaonMinus.hh"
#include "G4KaonZero.hh"
#include "G4AntiKaonZero.hh"
#include "G4KaonZeroLong.hh"
#include "G4KaonZeroShort.hh"
// Baryons
#include "G4Proton.hh"
#include "G4AntiProton.hh"
#include "G4Neutron.hh"
#include "G4AntiNeutron.hh"
// Nuclei
#include "G4Alpha.hh"
#include "G4Deuteron.hh"
#include "G4Triton.hh"
#include "G4He3.hh"
#include "G4GenericIon.hh"
#include "IonC12.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListParticles::PhysListParticles(const G4String& name)
: G4VPhysicsConstructor(name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListParticles::~PhysListParticles()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysListParticles::ConstructParticle()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
// leptons
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
// mesons
G4PionPlus::PionPlusDefinition();
G4PionMinus::PionMinusDefinition();
G4PionZero::PionZeroDefinition();
G4Eta::EtaDefinition();
G4EtaPrime::EtaPrimeDefinition();
G4KaonPlus::KaonPlusDefinition();
G4KaonMinus::KaonMinusDefinition();
G4KaonZero::KaonZeroDefinition();
G4AntiKaonZero::AntiKaonZeroDefinition();
G4KaonZeroLong::KaonZeroLongDefinition();
G4KaonZeroShort::KaonZeroShortDefinition();
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
G4Neutron::NeutronDefinition();
G4AntiNeutron::AntiNeutronDefinition();
// ions
G4Deuteron::DeuteronDefinition();
G4Triton::TritonDefinition();
G4He3::He3Definition();
G4Alpha::AlphaDefinition();
G4GenericIon::GenericIonDefinition();
IonC12::IonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: PhysicsList.cc,v 1.9 2003/11/19 10:16:18 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: PhysicsList.cc,v 1.10 2004/06/09 16:20:31 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -31,8 +31,6 @@
#include "PhysicsList.hh"
#include "PhysicsListMessenger.hh"
#include "PhysListParticles.hh"
#include "PhysListGeneral.hh"
#include "PhysListEmStandard.hh"
#include "PhysListEmG4v52.hh"
#include "PhysListHadronElastic.hh"
@@ -58,15 +56,8 @@ PhysicsList::PhysicsList() : G4VModularPhysicsList()
SetVerboseLevel(1);
// Particles
particleList = new PhysListParticles("particles");
// General Physics
generalPhysicsList = new PhysListGeneral("general");
// EM physics
emName = G4String("standard");
emPhysicsList = new PhysListEmStandard(emName);
emPhysicsList = new PhysListEmStandard(emName = "standard");
}
@@ -75,26 +66,151 @@ PhysicsList::PhysicsList() : G4VModularPhysicsList()
PhysicsList::~PhysicsList()
{
delete pMessenger;
delete generalPhysicsList;
delete emPhysicsList;
for(size_t i=0; i<hadronPhys.size(); i++) delete hadronPhys[i];
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Bosons
#include "G4ChargedGeantino.hh"
#include "G4Geantino.hh"
#include "G4Gamma.hh"
#include "G4OpticalPhoton.hh"
// leptons
#include "G4MuonPlus.hh"
#include "G4MuonMinus.hh"
#include "G4NeutrinoMu.hh"
#include "G4AntiNeutrinoMu.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4NeutrinoE.hh"
#include "G4AntiNeutrinoE.hh"
// Mesons
#include "G4PionPlus.hh"
#include "G4PionMinus.hh"
#include "G4PionZero.hh"
#include "G4Eta.hh"
#include "G4EtaPrime.hh"
#include "G4KaonPlus.hh"
#include "G4KaonMinus.hh"
#include "G4KaonZero.hh"
#include "G4AntiKaonZero.hh"
#include "G4KaonZeroLong.hh"
#include "G4KaonZeroShort.hh"
// Baryons
#include "G4Proton.hh"
#include "G4AntiProton.hh"
#include "G4Neutron.hh"
#include "G4AntiNeutron.hh"
// Nuclei
#include "G4Alpha.hh"
#include "G4Deuteron.hh"
#include "G4Triton.hh"
#include "G4He3.hh"
#include "G4GenericIon.hh"
#include "IonC12.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::ConstructParticle()
{
particleList->ConstructParticle();
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
// leptons
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
// mesons
G4PionPlus::PionPlusDefinition();
G4PionMinus::PionMinusDefinition();
G4PionZero::PionZeroDefinition();
G4Eta::EtaDefinition();
G4EtaPrime::EtaPrimeDefinition();
G4KaonPlus::KaonPlusDefinition();
G4KaonMinus::KaonMinusDefinition();
G4KaonZero::KaonZeroDefinition();
G4AntiKaonZero::AntiKaonZeroDefinition();
G4KaonZeroLong::KaonZeroLongDefinition();
G4KaonZeroShort::KaonZeroShortDefinition();
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
G4Neutron::NeutronDefinition();
G4AntiNeutron::AntiNeutronDefinition();
// ions
G4Deuteron::DeuteronDefinition();
G4Triton::TritonDefinition();
G4He3::He3Definition();
G4Alpha::AlphaDefinition();
G4GenericIon::GenericIonDefinition();
IonC12::IonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ProcessManager.hh"
#include "G4Decay.hh"
void PhysicsList::ConstructProcess()
{
// transportation
//
AddTransportation();
generalPhysicsList->ConstructProcess();
// electromagnetic physics list
//
emPhysicsList->ConstructProcess();
// hadronic physics lists
for(size_t i=0; i<hadronPhys.size(); i++) hadronPhys[i]->ConstructProcess();
// decay process
//
G4Decay* fDecayProcess = new G4Decay();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (fDecayProcess->IsApplicable(*particle)) {
pmanager ->AddProcess(fDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt
pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
}
}
// step limitation (as a full process)
//
AddStepMax();
}
@@ -144,12 +260,6 @@ void PhysicsList::AddPhysicsList(const G4String& name)
#include "StepMax.hh"
#include "G4ProcessManager.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::AddStepMax()
{
// Step limitation seen as a process
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: RunAction.cc,v 1.4 2003/11/19 10:16:18 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: RunAction.cc,v 1.6 2004/03/31 17:09:46 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -34,14 +34,12 @@
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4VVisManager.hh"
#include "G4UnitsTable.hh"
#include "G4ios.hh"
#include "Randomize.hh"
#ifdef G4ANALYSIS_USE
#ifdef USE_AIDA
#include "AIDA/AIDA.h"
#endif
@@ -52,6 +50,7 @@ RunAction::RunAction(DetectorConstruction* det, PhysicsList* phys,
:detector(det), physics(phys), kinematic(kin)
{
tallyEdep = new G4double[MaxTally];
binLength = offsetX = 0.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -66,22 +65,7 @@ RunAction::~RunAction()
void RunAction::bookHisto()
{
#ifdef G4ANALYSIS_USE
// Creating the analysis factory
AIDA::IAnalysisFactory* af = AIDA_createAnalysisFactory();
// Creating the tree factory
AIDA::ITreeFactory* tf = af->createTreeFactory();
// Creating a tree mapped to an hbook file.
G4bool readOnly = false;
G4bool createNew = true;
tree = tf->create("testem7.paw", "hbook", readOnly, createNew);
// Creating a histogram factory, whose histograms will be handled by the tree
AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
// Creating histograms
G4double length = detector->GetAbsorSizeX();
G4double stepMax = physics->GetStepMaxProcess()->GetMaxStep();
const G4int nbmin = 100;
@@ -89,6 +73,23 @@ void RunAction::bookHisto()
if (nbBins < nbmin) nbBins = nbmin;
binLength = length/nbBins;
offsetX = 0.5*length;
#ifdef USE_AIDA
// Create the analysis factory
AIDA::IAnalysisFactory* af = AIDA_createAnalysisFactory();
// Create the tree factory
AIDA::ITreeFactory* tf = af->createTreeFactory();
// Create a tree mapped to an hbook file.
G4bool readOnly = false;
G4bool createNew = true;
tree = tf->create("testem7.paw", "hbook", readOnly, createNew);
// Create a histogram factory, whose histograms will be handled by the tree
AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
// Create histograms
histo[0] = hf->createHistogram1D("1","Edep (MeV/mm)",nbBins, 0,length);
delete hf;
@@ -101,11 +102,10 @@ void RunAction::bookHisto()
void RunAction::cleanHisto()
{
#ifdef G4ANALYSIS_USE
#ifdef USE_AIDA
tree->commit(); // Writing the histograms to the file
tree->close(); // and closing the tree (and the file)
// delete tree;
delete tree;
#endif
}
@@ -125,11 +125,6 @@ void RunAction::BeginOfRunAction(const G4Run* aRun)
bookHisto();
for (G4int j=0; j<MaxTally; j++) tallyEdep[j] = 0.;
}
//refresh visualisation
//
if (G4VVisManager::GetConcreteInstance())
G4UImanager::GetUIpointer()->ApplyCommand("/vis/scene/notifyHandlers");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -154,10 +149,6 @@ void RunAction::EndOfRunAction(const G4Run*)
}
G4cout << "\n---------------------------------------------------------\n";
}
//draw the events
if (G4VVisManager::GetConcreteInstance())
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
// show Rndm status
HepRandom::showEngineStatus();
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: SteppingAction.cc,v 1.2 2003/10/10 16:21:32 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: SteppingAction.cc,v 1.4 2004/03/31 17:09:46 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -33,7 +33,7 @@
#include "G4VProcess.hh"
#include "G4ParticleTypes.hh"
#ifdef G4ANALYSIS_USE
#ifdef USE_AIDA
#include "AIDA/IHistogram1D.h"
#endif
@@ -55,12 +55,12 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep)
G4double edep = aStep->GetTotalEnergyDeposit();
if (edep <= 0.) return;
#ifdef G4ANALYSIS_USE
#ifdef USE_AIDA
G4double x = aStep->GetTrack()->GetPosition().x() + runAction->GetOffsetX();
G4double binLength = runAction->GetBinLength();
runAction->GetHisto(0)->fill(x, (edep/binLength)/(MeV/mm));
#endif
//fill tallies
//
G4VPhysicalVolume* pVolume = aStep->GetTrack()->GetVolume();