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.15 2004/02/19 18:18:33 maire Exp $
# $Id: GNUmakefile,v 1.18 2004/06/21 10:57:09 maire Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -14,18 +14,18 @@ endif
.PHONY: all
all: lib bin
###G4ANALYSIS_USE := true
#### G4ANALYSIS_USE := true
ifdef G4ANALYSIS_USE
CPPFLAGS += -DG4ANALYSIS_USE
endif
include $(G4INSTALL)/config/architecture.gmk
ifdef G4ANALYSIS_USE
# for the aida-config command see the README file
CPPFLAGS += `aida-config --include`
LDFLAGS += `aida-config --lib`
LDFLAGS += `aida-config --lib`
endif
include $(G4INSTALL)/config/binmake.gmk
@@ -33,3 +33,6 @@ include $(G4INSTALL)/config/binmake.gmk
visclean:
rm -f g4*.prim g4*.eps g4*.wrl
rm -f .DAWN_*
histclean:
rm ${G4WORKDIR}/tmp/${G4SYSTEM}/${G4TARGET}/HistoManager.o
@@ -1,4 +1,4 @@
$Id: History,v 1.39 2004/02/19 18:29:10 maire Exp $
$Id: History,v 1.45 2004/06/21 10:57:09 maire Exp $
-------------------------------------------------------------------
=========================================================
@@ -14,6 +14,26 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
21-06-04 mma (testem5-V06-01-04)
- simplifications in HistoManager.
16-06-04 mma (testem5-V06-01-03)
- print rms of projected angle at exit if histo=6 selected.
10-06-04 mma (testem5-V06-01-02)
- modify HistoManager and its Messenger in order to allow a multirun job.
29-04-04 mma (testem5-V06-01-01)
- add physicsLists: HadronElastic, BinaryCascade, IonBinaryCascade (Ivanch.)
- rm physicsLists: Particles, General
31-03-04 mma (testem5-V06-01-00)
- identical to V06-00-01
17-03-04 mma (testem5-V06-00-01)
- new macro dedx.mac
- sign corrected in ComputeMscHighland()
19-02-04 mma (testem5-V06-00-00)
- modify histo 7 : projected position at exit
@@ -1,4 +1,4 @@
$Id: README,v 1.10 2004/02/19 18:18:42 maire Exp $
$Id: README,v 1.12 2004/06/23 11:30:08 maire Exp $
-----------------------------------------------------
=========================================================
@@ -97,6 +97,9 @@ $Id: README,v 1.10 2004/02/19 18:18:42 maire Exp $
16 "(reflect , neutral) : projected angle at exit"
The histograms can be viewed using PAW. See below the note on ANAPHE+AIDA.
One can control the name of the histograms file with the command:
/testem/histo/setFileName name (default testem5.paw)
Note that, by default, histograms are disabled. To activate them, uncomment
the flag G4ANALYSIS_USE in GNUmakefile.
@@ -138,19 +141,41 @@ $Id: README,v 1.10 2004/02/19 18:18:42 maire Exp $
Idle> run/beamOn 5
....
Note - 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.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: TestEm5.cc,v 1.9 2004/02/19 18:18:42 maire Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: TestEm5.cc,v 1.11 2004/06/18 09:47:48 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,36 +54,33 @@ int main(int argc,char** argv) {
//choose the Random engine
HepRandom::setTheEngine(new RanecuEngine);
//my Verbose output class
G4VSteppingVerbose::SetInstance(new SteppingVerbose);
// Construct the default run manager
G4RunManager * runManager = new G4RunManager;
// set mandatory initialization classes
DetectorConstruction* detector;
detector = new DetectorConstruction;
runManager->SetUserInitialization(detector);
runManager->SetUserInitialization(new PhysicsList(detector));
runManager->SetUserInitialization(new PhysicsList());
#ifdef G4VIS_USE
// visualization manager
G4VisManager* visManager = new VisManager;
visManager->Initialize();
#endif
#endif
HistoManager* histo = new HistoManager();
HistoManager* histo = 0;
#ifdef G4ANALYSIS_USE
histo = new HistoManager();
#endif
// set user action classes
//
//primaryGenerator
PrimaryGeneratorAction* primary = new PrimaryGeneratorAction(detector);
runManager->SetUserAction(primary);
//runAction
RunAction* runaction = new RunAction(detector,primary,histo);
runManager->SetUserAction(runaction);
@@ -91,7 +88,7 @@ int main(int argc,char** argv) {
//eventAction
EventAction* eventaction = new EventAction(runaction,histo);
runManager->SetUserAction(eventaction);
//trackAction
TrackingAction* trackingaction = new TrackingAction(detector, runaction,
eventaction, histo);
@@ -1,22 +1,23 @@
# $Id: TestEm5.in,v 1.11 2003/10/27 11:32:38 maire Exp $
# $Id: TestEm5.in,v 1.13 2004/06/21 10:57:09 maire Exp $
#
# macro file for TestEm5.cc
#
/control/verbose 2
/run/verbose 2
#
/testem/det/setAbsMat Silicon
/testem/det/setAbsThick 20.5 mum
/testem/det/setAbsMat Silicon
/testem/det/setAbsThick 20.5 mum
/testem/det/setAbsYZ 1 mm
#
/testem/phys/addPhysics standard
###/testem/phys/addPhysics g4v52
#
/testem/phys/setGCut 2.13 mm
/testem/phys/setGCut 2.13 mm
/testem/phys/setECut 7.0 mum
/testem/phys/setPCut 7.0 mum
#
/run/initialize
###/testem/histo/setHisto 6 100 -0.25 0.25 mrad
#
/testem/gun/setDefault
/gun/particle pi+
@@ -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
*************************************************************
@@ -23,14 +23,15 @@ Current available graphics systems are:
VRML2FILE (VRML2FILE)
/run/verbose 2
#
/testem/det/setAbsMat Silicon
/testem/det/setAbsThick 20.5 mum
/testem/det/setAbsMat Silicon
/testem/det/setAbsThick 20.5 mum
/testem/det/setAbsYZ 1 mm
#
/testem/phys/addPhysics standard
PhysicsList::AddPhysicsList: <standard>
###/testem/phys/addPhysics g4v52
#
/testem/phys/setGCut 2.13 mm
/testem/phys/setGCut 2.13 mm
/testem/phys/setECut 7.0 mum
/testem/phys/setPCut 7.0 mum
#
@@ -53,6 +54,7 @@ physicsList->Construct() start.
phot: Total cross sections from Sandia parametrisation.
physicsList->setCut() start.
PhysicsList::SetCuts:CutLength : 1 mm
###/testem/histo/setHisto 6 100 -0.25 0.25 mrad
#
/testem/gun/setDefault
/gun/particle pi+
@@ -107,8 +109,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.
@@ -117,7 +119,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
@@ -135,7 +137,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
@@ -200,21 +202,21 @@ Start Run processing.
Run terminated.
Run Summary
Number of events processed : 100000
User=46.49s Real=1044.02s Sys=104.53s
User=45.97s Real=1123.29s Sys=85.2s
======================== run summary ======================
Number of Events = 100000
Total energy deposit in absorber per event = 6.698 keV +- 21.79 eV
Total energy deposit in absorber per event = 6.7 keV +- 21.82 eV
Total track length (charged) in absorber per event = 20.97 mum +- 15.28 nm
Total track length (neutral) in absorber per event = 3.612 nm +- 3.107 nm
Total track length (charged) in absorber per event = 20.97 mum +- 15.24 nm
Total track length (neutral) in absorber per event = 1.319 nm +- 9.342 Ang
Number of steps (charged) in absorber per event = 1.079 +- 1.236e-05
Number of steps (neutral) in absorber per event = 3e-05 +- 1.236e-05
Number of steps (charged) in absorber per event = 1.08 +- 1.234e-05
Number of steps (neutral) in absorber per event = 3e-05 +- 1.234e-05
Number of secondaries per event : Gammas = 3e-05; electrons = 0.03757; positrons = 0
Number of secondaries per event : Gammas = 3e-05; electrons = 0.03719; positrons = 0
Number of events with the primary particle transmitted = 100 %
Number of events with at least 1 particle transmitted (same charge as primary) = 100 %
@@ -222,11 +224,9 @@ Run Summary
Number of events with the primary particle reflected = 0 %
Number of events with at least 1 particle reflected (same charge as primary) = 0 %
MultipleScattering: theta0 Highland = 0.02663 mrad
--------- Ranecu engine status ---------
Initial seed (index) = 0
Current couple of seeds = 1147184665, 872245730
Current couple of seeds = 1636731634, 910890274
----------------------------------------
Graphics systems deleted.
Visualization Manager deleting...
@@ -0,0 +1,30 @@
# $Id: dedx.mac,v 1.1 2004/03/17 14:03:38 maire Exp $
#
# macro file for TestEm5.cc
#
# to control dE/dx calculation
#
/control/verbose 2
/run/verbose 2
#
/testem/det/setAbsMat Water
/testem/det/setAbsThick 1 cm
/testem/det/setAbsYZ 1 cm
#
###/testem/phys/addPhysics g4v52
/testem/phys/addPhysics standard
/testem/phys/setCuts 1 km
#
/run/initialize
#
/process/inactivate msc
/process/eLoss/fluct false
#
/testem/gun/setDefault
/gun/particle mu+
/gun/energy 300 MeV
#
/testem/stepMax 1 mm
/tracking/verbose 1
#
/run/beamOn 2
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: DetectorConstruction.hh,v 1.5 2004/06/21 10:57:10 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: DetectorConstruction.hh,v 1.4 2004/02/19 18:18:51 maire Exp $
// GEANT4 tag $Name: geant4-06-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: DetectorMessenger.hh,v 1.3 2004/06/21 10:57:10 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: DetectorMessenger.hh,v 1.2 2003/10/07 11:58:28 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: EventAction.hh,v 1.2 2004/06/21 10:57:10 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: EventAction.hh,v 1.1 2003/08/11 10:13:02 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: EventMessenger.hh,v 1.3 2004/06/21 10:57:10 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: EventMessenger.hh,v 1.2 2003/10/07 11:58:28 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,20 +20,15 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: HistoManager.hh,v 1.6 2004/06/21 10:57:10 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: HistoManager.hh,v 1.3 2003/11/03 12:58:52 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef HistoManager_h
#define HistoManager_h 1
#ifdef G4ANALYSIS_USE
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -42,40 +37,53 @@ namespace AIDA {
class ITree;
class IHistogramFactory;
class IHistogram1D;
}
}
class HistoMessenger;
const G4int MaxHisto = 17;
const G4int MaxHisto = 17;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class HistoManager
{
public:
HistoManager();
~HistoManager();
void SetFactory(G4String);
void SetHisto (G4int, G4int, G4double, G4double, G4String unit="none");
AIDA::ITree* GetTree() {return tree;}
AIDA::IHistogramFactory* GetHistogramFactory() {return hf;}
AIDA::IHistogram1D* GetHisto(G4int id) {return histo[id];}
G4double GetHistoUnit(G4int id) {return histoUnit[id];}
G4double GetBinWidth (G4int id) {return binWidth[id];}
void SetFileName (const G4String& name) { fileName = name;};
void SetFileType (const G4String& name) { fileType = name;};
void book();
void save();
void SetHisto (G4int,G4int,G4double,G4double,const G4String& unit="none");
void FillHisto(G4int id, G4double e, G4double weight = 1.0);
void RemoveHisto (G4int);
G4bool HistoExist (G4int id) {return exist[id];}
G4double GetHistoUnit(G4int id) {return Unit[id];}
G4double GetBinWidth (G4int id) {return Width[id];}
private:
G4String fileName;
G4String fileType;
AIDA::ITree* tree;
AIDA::IHistogramFactory* hf;
AIDA::IHistogramFactory* hf;
AIDA::IHistogram1D* histo[MaxHisto];
G4double histoUnit[MaxHisto];
G4double binWidth[MaxHisto];
G4bool factoryOn;
G4bool exist[MaxHisto];
G4String Label[MaxHisto];
G4String Title[MaxHisto];
G4int Nbins[MaxHisto];
G4double Vmin [MaxHisto];
G4double Vmax [MaxHisto];
G4double Unit [MaxHisto];
G4double Width[MaxHisto];
G4bool factoryOn;
HistoMessenger* histoMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
#endif
@@ -20,21 +20,15 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: HistoMessenger.hh,v 1.5 2004/06/21 10:57:10 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: HistoMessenger.hh,v 1.2 2003/10/07 11:58:29 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef HistoMessenger_h
#define HistoMessenger_h 1
#ifdef G4ANALYSIS_USE
#include "G4UImessenger.hh"
#include "globals.hh"
@@ -44,6 +38,7 @@ class HistoManager;
class G4UIdirectory;
class G4UIcommand;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -62,11 +57,13 @@ class HistoMessenger: public G4UImessenger
G4UIdirectory* histoDir;
G4UIcmdWithAString* factoryCmd;
G4UIcommand* histoCmd;
G4UIcmdWithAString* typeCmd;
G4UIcommand* histoCmd;
G4UIcmdWithAnInteger* rmhistoCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
#endif
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: IonC12.hh,v 1.3 2003/08/11 10:26:24 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: IonC12.hh,v 1.4 2004/06/21 10:57:10 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// Each class inheriting from G4VIon
// corresponds to a particle type; one and only one
@@ -20,46 +20,54 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PhysListBinaryCascade.hh,v 1.2 2004/04/29 13:55:09 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: PhysListParticles.hh,v 1.2 2003/10/07 11:58:29 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// Class Description:
// This class is an derived class of G4VPhysicsConstructor
// It is provide PhysicsList for Binary Cascade for
// protons and neutrons with the energy E<3 GeV
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysListParticles_h
#define PhysListParticles_h 1
#ifndef PhysListBinaryCascade_h
#define PhysListBinaryCascade_h 1
#include "G4VPhysicsConstructor.hh"
#include "globals.hh"
#include "G4ProtonInelasticProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4ProtonInelasticCrossSection.hh"
#include "G4NeutronInelasticCrossSection.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysListParticles : public G4VPhysicsConstructor
class PhysListBinaryCascade : public G4VPhysicsConstructor
{
public:
PhysListParticles(const G4String& name = "particles");
~PhysListParticles();
public:
PhysListBinaryCascade(const G4String& name = "binary");
~PhysListBinaryCascade();
public:
// This method will be invoked in the Construct() method.
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
void ConstructParticle();
// This method is dummy.
void ConstructProcess() {};
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();
private:
G4ProtonInelasticProcess theIPproton;
G4NeutronInelasticProcess theIPneutron;
G4ProtonInelasticCrossSection thePXSec;
G4NeutronInelasticCrossSection theNXSec;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListEmG4v52.hh,v 1.1 2003/10/07 11:58:29 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: PhysListEmG4v52.hh,v 1.3 2004/06/21 10:57:10 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListEmStandard.hh,v 1.2 2003/10/07 11:58:29 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: PhysListEmStandard.hh,v 1.4 2004/06/21 10:57:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,29 +20,34 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PhysListHadronElastic.hh,v 1.3 2004/06/21 10:57:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: PhysListGeneral.hh,v 1.2 2003/10/07 11:58:29 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// Class Description:
// This class is an derived class of G4VPhysicsConstructor
// It is provide PhysicsList for hadron eleastic process
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysListGeneral_h
#define PhysListGeneral_h 1
#ifndef PhysListHadronElastic_h
#define PhysListHadronElastic_h 1
#include "G4VPhysicsConstructor.hh"
#include "G4HadronElasticProcess.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysListGeneral : public G4VPhysicsConstructor
class PhysListHadronElastic : public G4VPhysicsConstructor
{
public:
PhysListGeneral(const G4String& name = "general");
~PhysListGeneral();
PhysListHadronElastic(const G4String& name = "elastic");
virtual ~PhysListHadronElastic();
public:
// This method is dummy for physics
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
void ConstructParticle() {};
// This method will be invoked in the Construct() method.
@@ -50,6 +55,9 @@ class PhysListGeneral : public G4VPhysicsConstructor
// registered to the process manager of each particle type
void ConstructProcess();
private:
// Elastic Process
G4HadronElasticProcess theElasticProcess;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * 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: PhysListIonBinaryCascade.hh,v 1.3 2004/06/21 10:57:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// Class Description:
// This class is an derived class of G4VPhysicsConstructor
// It is provide PhysicsList for Binary Cascade for
// protons and neutrons with the energy E<3 GeV
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysListIonBinaryCascade_h
#define PhysListIonBinaryCascade_h 1
#include "G4VPhysicsConstructor.hh"
#include "globals.hh"
#include "G4DeuteronInelasticProcess.hh"
#include "G4TritonInelasticProcess.hh"
#include "G4AlphaInelasticProcess.hh"
class G4HadronInelasticProcess;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysListIonBinaryCascade : public G4VPhysicsConstructor
{
public:
PhysListIonBinaryCascade(const G4String& name = "binary_ion");
~PhysListIonBinaryCascade();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
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();
private:
G4DeuteronInelasticProcess theIPdeuteron;
G4TritonInelasticProcess theIPtriton;
G4AlphaInelasticProcess theIPalpha;
G4HadronInelasticProcess* theIPHe3;
G4HadronInelasticProcess* theIPIonC12;
G4HadronInelasticProcess* theIPGenericIon;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -20,13 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysicsList.hh,v 1.1 2003/08/11 10:14:07 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// 14.10.02 (V.Ivanchenko) provide modular list on base of old PhysicsList
// $Id: PhysicsList.hh,v 1.4 2004/06/21 10:57:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -38,7 +33,6 @@
#include "globals.hh"
class G4VPhysicsConstructor;
class DetectorConstruction;
class StepMax;
class PhysicsListMessenger;
@@ -47,38 +41,36 @@ class PhysicsListMessenger;
class PhysicsList: public G4VModularPhysicsList
{
public:
PhysicsList(DetectorConstruction*);
PhysicsList();
~PhysicsList();
void ConstructParticle();
void AddPhysicsList(const G4String& name);
void ConstructProcess();
void AddDecay();
void AddStepMax();
StepMax* GetStepMaxProcess() {return stepMaxProcess;};
void SetCuts();
void SetCutForGamma (G4double);
void SetCutForGamma(G4double);
void SetCutForElectron(G4double);
void SetCutForPositron(G4double);
void AddPhysicsList(const G4String& name);
void ConstructProcess();
void AddStepMax();
StepMax* GetStepMaxProcess() {return stepMaxProcess;}
G4double GetRange(G4double);
private:
PhysicsListMessenger* pMessenger;
G4String emName;
G4VPhysicsConstructor* emPhysicsList;
std::vector<G4VPhysicsConstructor*> hadronPhys;
StepMax* stepMaxProcess;
G4double cutForGamma;
G4double cutForElectron;
G4double cutForPositron;
DetectorConstruction* pDet;
PhysicsListMessenger* pMessenger;
G4VPhysicsConstructor* particleList;
G4VPhysicsConstructor* generalPhysicsList;
G4VPhysicsConstructor* emPhysicsList;
G4String emName;
StepMax* stepMaxProcess;
G4double cutForPositron;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PhysicsListMessenger.hh,v 1.5 2004/06/21 10:57:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: PhysicsListMessenger.hh,v 1.2 2003/10/07 11:58:29 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -36,8 +33,8 @@
#include "globals.hh"
class PhysicsList;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithAString;
class G4UIcmdWithADoubleAndUnit;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,13 +51,11 @@ class PhysicsListMessenger: public G4UImessenger
PhysicsList* pPhysicsList;
G4UIcmdWithAString* pListCmd;
G4UIcmdWithADoubleAndUnit* gammaCutCmd;
G4UIcmdWithADoubleAndUnit* electCutCmd;
G4UIcmdWithADoubleAndUnit* positCutCmd;
G4UIcmdWithADoubleAndUnit* allCutCmd;
G4UIcmdWithADoubleAndUnit* rangeCmd;
G4UIcmdWithAString* pListCmd;
G4UIcmdWithADoubleAndUnit* protoCutCmd;
G4UIcmdWithADoubleAndUnit* allCutCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PrimaryGeneratorAction.hh,v 1.3 2004/06/21 10:57:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: PrimaryGeneratorAction.hh,v 1.2 2004/02/19 18:18:51 maire Exp $
// GEANT4 tag $Name: geant4-06-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PrimaryGeneratorMessenger.hh,v 1.2 2004/06/21 10:57:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: PrimaryGeneratorMessenger.hh,v 1.1 2003/08/11 10:14:49 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: RunAction.hh,v 1.5 2004/06/21 10:57:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: RunAction.hh,v 1.2 2004/02/19 18:18:51 maire Exp $
// GEANT4 tag $Name: geant4-06-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -59,45 +56,49 @@ class RunAction : public G4UserRunAction
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
void AddEnergy (G4double edep)
void AddEnergy (G4double edep)
{EnergyDeposit += edep; EnergyDeposit2 += edep*edep;};
void AddTrakLenCharg (G4double length)
{TrakLenCharged += length; TrakLenCharged2 += length*length;};
void AddTrakLenNeutr (G4double length)
{TrakLenNeutral += length; TrakLenNeutral2 += length*length;};
void AddMscProjTheta (G4double theta)
{MscProjecTheta += theta; MscProjecTheta2 += theta*theta;};
void CountStepsCharg (G4int nSteps)
{nbStepsCharged += nSteps; nbStepsCharged2 += nSteps*nSteps;};
void CountStepsNeutr (G4int nSteps)
{nbStepsNeutral += nSteps; nbStepsNeutral2 += nSteps*nSteps;};
void CountParticles (G4ParticleDefinition* part)
{ if (part == G4Gamma::Gamma()) nbGamma++ ;
else if (part == G4Electron::Electron()) nbElect++ ;
else if (part == G4Positron::Positron()) nbPosit++ ; };
void CountTransmit (G4int flag)
{ if (flag == 1) Transmit[0]++;
else if (flag == 2) {Transmit[0]++; Transmit[1]++; }};
else if (flag == 2) {Transmit[0]++; Transmit[1]++; }};
void CountReflect (G4int flag)
{ if (flag == 1) Reflect[0]++;
else if (flag == 2) {Reflect[0]++; Reflect[1]++; }};
else if (flag == 2) {Reflect[0]++; Reflect[1]++; }};
G4double ComputeMscHighland();
private:
G4double EnergyDeposit, EnergyDeposit2;
G4double TrakLenCharged, TrakLenCharged2;
G4double TrakLenNeutral, TrakLenNeutral2;
G4double nbStepsCharged, nbStepsCharged2;
G4double nbStepsNeutral, nbStepsNeutral2;
G4double MscProjecTheta, MscProjecTheta2;
G4int nbGamma, nbElect, nbPosit;
G4int Transmit[2], Reflect[2];
DetectorConstruction* detector;
PrimaryGeneratorAction* primary;
HistoManager* histoManager;
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: StackingAction.hh,v 1.1 2003/08/11 10:15:05 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: StackingAction.hh,v 1.2 2004/06/21 10:57:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: StackingMessenger.hh,v 1.3 2004/06/21 10:57:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: StackingMessenger.hh,v 1.2 2003/10/07 11:58:29 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,11 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: StepMax.hh,v 1.2 2004/06/21 10:57:12 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: StepMax.hh,v 1.1 2003/08/11 10:15:32 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: SteppingAction.hh,v 1.1 2003/08/11 10:15:45 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: SteppingAction.hh,v 1.2 2004/06/21 10:57:12 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: SteppingVerbose.hh,v 1.1 2003/08/11 10:15:51 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: SteppingVerbose.hh,v 1.2 2004/06/21 10:57:12 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// This class manages the verbose outputs in G4SteppingManager.
// It inherits from G4SteppingVerbose.
@@ -20,10 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: TrackingAction.hh,v 1.1 2003/08/11 10:16:04 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
// $Id: TrackingAction.hh,v 1.2 2004/06/21 10:57:12 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: VisManager.hh,v 1.2 2004/06/21 10:57:12 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: VisManager.hh,v 1.1 2003/08/11 10:16:21 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -1,4 +1,4 @@
# $Id: mumsc.mac,v 1.1 2004/02/19 18:18:43 maire Exp $
# $Id: mumsc.mac,v 1.4 2004/06/21 10:57:09 maire Exp $
#
# macro file for TestEm5.cc
#
@@ -7,23 +7,23 @@
/control/verbose 2
/run/verbose 2
#
/testem/det/setAbsMat Iron
/testem/det/setAbsThick 1 m
/testem/det/setAbsMat Iron
/testem/det/setAbsThick 1 m
/testem/det/setAbsYZ 1 m
/testem/det/setWorldX 1 m
/testem/det/setWorldYZ 1 m
#
###/testem/phys/addPhysics g4v52
#### /testem/phys/addPhysics g4v52
#
/testem/phys/setCuts 0.1 mm
#
#
/run/initialize
#
/testem/gun/setDefault
/gun/particle mu+
/gun/particle mu+
/gun/energy 50 GeV
#
/testem/histo/setFileName 50gev.std.paw
/testem/histo/setFileName mumsc.paw
/testem/histo/setHisto 6 200 -20.0 +20.0 mrad #projected angle
/testem/histo/setHisto 7 200 -10.0 +10.0 mm #projected deviation
#
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: DetectorConstruction.cc,v 1.3 2004/06/21 10:57:13 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: DetectorConstruction.cc,v 1.2 2003/11/25 15:19:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: DetectorMessenger.cc,v 1.2 2004/06/21 10:57:13 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: DetectorMessenger.cc,v 1.1 2003/08/11 10:17:17 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: EventAction.cc,v 1.4 2004/06/21 10:57:13 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: EventAction.cc,v 1.2 2004/02/19 18:18:52 maire Exp $
// GEANT4 tag $Name: geant4-06-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -40,10 +37,6 @@
#include "G4Trajectory.hh"
#include "G4VVisManager.hh"
#ifdef G4ANALYSIS_USE
#include "AIDA/IHistogram1D.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventAction::EventAction(RunAction* RA, HistoManager* histo)
@@ -84,19 +77,14 @@ void EventAction::EndOfEventAction(const G4Event* evt)
runaction->AddEnergy(EnergyDeposit);
runaction->AddTrakLenCharg(TrakLenCharged);
runaction->AddTrakLenNeutr(TrakLenNeutral);
runaction->CountStepsCharg(nbStepsCharged);
runaction->CountStepsNeutr(nbStepsNeutral);
runaction->CountTransmit (TransmitFlag);
runaction->CountReflect (ReflectFlag);
#ifdef G4ANALYSIS_USE
if (histoManager->GetHisto(1)) {
G4double unit = histoManager->GetHistoUnit(1);
histoManager->GetHisto(1)->fill(EnergyDeposit/unit);
}
#endif
histoManager->FillHisto(1,EnergyDeposit);
if (G4VVisManager::GetConcreteInstance())
{
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: EventMessenger.cc,v 1.2 2004/06/21 10:57:13 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: EventMessenger.cc,v 1.1 2003/08/11 10:20:23 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,93 +20,125 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: HistoManager.cc,v 1.9 2004/06/21 10:57:14 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: HistoManager.cc,v 1.6 2004/02/19 18:18:53 maire Exp $
// GEANT4 tag $Name: geant4-06-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifdef G4ANALYSIS_USE
#include "HistoManager.hh"
#include "HistoMessenger.hh"
#include "AIDA/AIDA.h"
#include "G4UnitsTable.hh"
#ifdef G4ANALYSIS_USE
#include "AIDA/AIDA.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::HistoManager()
:tree(0),hf(0),factoryOn(false)
{
fileName = "testem5.paw";
fileType = "hbook";
// histograms
for (G4int k=0; k<MaxHisto; k++) {
histo[k] = 0;
exist[k] = false;
Unit[k] = 1.0;
Width[k] = 1.0;
}
histoMessenger = new HistoMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::~HistoManager()
{
if (factoryOn) {
{
delete histoMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::book()
{
#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(fileName, fileType, readOnly, createNew);
// Creating a histogram factory, whose histograms will be handled by the tree
hf = af->createHistogramFactory(*tree);
// create selected histograms
for (G4int k=0; k<MaxHisto; k++) {
if (exist[k]) {
histo[k] = hf->createHistogram1D( Label[k], Title[k],
Nbins[k], Vmin[k], Vmax[k]);
factoryOn = true;
}
}
if(factoryOn)
G4cout << "\n----> Histogram Tree is opened " << G4endl;
delete tf;
delete af;
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::save()
{
#ifdef G4ANALYSIS_USE
if (factoryOn) {
tree->commit(); // Writing the histograms to the file
tree->close(); // and closing the tree (and the file)
delete hf;
G4cout << "\n----> Histogram Tree is saved in " << fileName << G4endl;
delete hf;
delete tree;
factoryOn = false;
}
delete histoMessenger;
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::SetFactory(G4String fileName)
{
if (factoryOn) {
G4cout << "\n--->HistoManager::SetFactory(): factory already exists"
<< G4endl;
void HistoManager::FillHisto(G4int ih, G4double e, G4double weight)
{
if (ih > MaxHisto) {
G4cout << "---> warning from HistoManager::FillHisto() : histo " << ih
<< "does not exist; e= " << e << " w= " << weight << G4endl;
return;
}
// 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(fileName, "hbook", readOnly, createNew);
// Creating a histogram factory, whose histograms will be handled by the tree
hf = af->createHistogramFactory(*tree);
// histograms
for (G4int k=0; k<MaxHisto; k++) { histo[k] = 0; histoUnit[k] = 1.;}
delete tf;
delete af;
factoryOn = true;
#ifdef G4ANALYSIS_USE
if(exist[ih]) histo[ih]->fill(e/Unit[ih], weight);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::SetHisto(G4int ih,
G4int nbBins, G4double valmin, G4double valmax, G4String unit)
{
if (!factoryOn) SetFactory("testem5.paw");
void HistoManager::SetHisto(G4int ih,
G4int nbins, G4double valmin, G4double valmax, const G4String& unit)
{
if (ih > MaxHisto) {
G4cout << "---> warning from HistoManager::SetHisto() : histo " << ih
<< "does not exist" << G4endl;
return;
}
}
const G4String id[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"10","11","12","13","14","15","16"};
const G4String title[] =
const G4String title[] =
{ "dummy", //0
"energy deposit in absorber", //1
"energy of charged secondaries at creation", //2
@@ -125,27 +157,45 @@ void HistoManager::SetHisto(G4int ih,
"(reflect , neutral) : space angle at exit", //15
"(reflect , neutral) : projected angle at exit", //16
};
G4String titl = title[ih];
G4double vmin = valmin, vmax = valmax;
Unit[ih] = 1.;
if (ih == 3) { vmin = log10(valmin/MeV); vmax = log10(valmax/MeV);}
else if (unit != "none") {
titl = title[ih] + " (" + unit + ")";
histoUnit[ih] = G4UnitDefinition::GetValueOf(unit);
vmin = valmin/histoUnit[ih]; vmax = valmax/histoUnit[ih];
Unit[ih] = G4UnitDefinition::GetValueOf(unit);
vmin = valmin/Unit[ih]; vmax = valmax/Unit[ih];
}
histo[ih] = hf->createHistogram1D(id[ih],titl,nbBins,vmin,vmax);
binWidth[ih] = (valmax-valmin)/nbBins;
exist[ih] = true;
Label[ih] = id[ih];
Title[ih] = titl;
Nbins[ih] = nbins;
Vmin[ih] = vmin;
Vmax[ih] = vmax;
Width[ih] = (valmax-valmin)/nbins;
G4cout << "----> SetHisto " << ih << ": " << titl << "; "
<< nbBins << " bins from "
<< nbins << " bins from "
<< vmin << " " << unit << " to " << vmax << " " << unit << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::RemoveHisto(G4int ih)
{
if (ih > MaxHisto) {
G4cout << "---> warning from HistoManager::RemoveHisto() : histo " << ih
<< "does not exist" << G4endl;
return;
}
histo[ih] = 0;
exist[ih] = false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -20,15 +20,12 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: HistoMessenger.cc,v 1.1 2003/08/11 10:20:44 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: HistoMessenger.cc,v 1.4 2004/06/21 10:57:14 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifdef G4ANALYSIS_USE
#include "HistoMessenger.hh"
#include "HistoManager.hh"
@@ -36,6 +33,7 @@
#include "G4UIcommand.hh"
#include "G4UIparameter.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -47,7 +45,10 @@ HistoMessenger::HistoMessenger(HistoManager* manager)
factoryCmd = new G4UIcmdWithAString("/testem/histo/setFileName",this);
factoryCmd->SetGuidance("set name for the histograms file");
typeCmd = new G4UIcmdWithAString("/testem/histo/setFileType",this);
typeCmd->SetGuidance("set histograms file type");
histoCmd = new G4UIcommand("/testem/histo/setHisto",this);
histoCmd->SetGuidance("Set bining of the histo number ih :");
histoCmd->SetGuidance(" nbBins; valMin; valMax; unit (of vmin and vmax)");
@@ -60,8 +61,8 @@ HistoMessenger::HistoMessenger(HistoManager* manager)
G4UIparameter* nbBins = new G4UIparameter("nbBins",'i',false);
nbBins->SetGuidance("number of bins");
nbBins->SetParameterRange("nbBins>0");
histoCmd->SetParameter(nbBins);
//
histoCmd->SetParameter(nbBins);
//
G4UIparameter* valMin = new G4UIparameter("valMin",'d',false);
valMin->SetGuidance("valMin, expressed in unit");
histoCmd->SetParameter(valMin);
@@ -73,25 +74,35 @@ HistoMessenger::HistoMessenger(HistoManager* manager)
G4UIparameter* unit = new G4UIparameter("unit",'s',true);
unit->SetGuidance("if omitted, vmin and vmax are assumed dimensionless");
unit->SetDefaultValue("none");
histoCmd->SetParameter(unit);
histoCmd->SetParameter(unit);
rmhistoCmd = new G4UIcmdWithAnInteger("/testem/histo/removeHisto",this);
rmhistoCmd->SetGuidance("desactivate histo #id");
rmhistoCmd->SetParameterName("id",false);
rmhistoCmd->SetRange("id>0");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoMessenger::~HistoMessenger()
{
delete rmhistoCmd;
delete histoCmd;
delete typeCmd;
delete factoryCmd;
delete histoDir;
delete histoDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
void HistoMessenger::SetNewValue(G4UIcommand* command, G4String newValues)
{
if (command == factoryCmd)
histoManager->SetFactory(newValues);
histoManager->SetFileName(newValues);
if (command == typeCmd)
histoManager->SetFileType(newValues);
if (command == histoCmd)
{ G4int ih,nbBins; G4double vmin,vmax; char unts[30];
const char* t = newValues;
@@ -101,9 +112,11 @@ void HistoMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
G4double vUnit = 1. ;
if (unit != "none") vUnit = G4UIcommand::ValueOf(unit);
histoManager->SetHisto (ih,nbBins,vmin*vUnit,vmax*vUnit,unit);
}
}
if (command == rmhistoCmd)
histoManager->RemoveHisto(rmhistoCmd->GetNewIntValue(newValues));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: IonC12.cc,v 1.4 2003/08/11 10:27:14 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: IonC12.cc,v 1.5 2004/06/21 10:57:14 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,92 @@
//
// ********************************************************************
// * 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: PhysListBinaryCascade.cc,v 1.2 2004/04/29 13:55:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysListBinaryCascade.hh"
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
#include "G4LFission.hh"
#include "G4LCapture.hh"
#include "G4Proton.hh"
#include "G4Neutron.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4BinaryCascade.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListBinaryCascade::PhysListBinaryCascade(const G4String& name)
: G4VPhysicsConstructor(name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListBinaryCascade::~PhysListBinaryCascade()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysListBinaryCascade::ConstructProcess()
{
// Binary Cascade
G4ParticleDefinition* particle = 0;
G4ProcessManager* pmanager = 0;
G4BinaryCascade* theBC = 0;
// proton
particle = G4Proton::Proton();
pmanager = particle->GetProcessManager();
theBC = new G4BinaryCascade();
theIPproton.RegisterMe(theBC);
theIPproton.AddDataSet(&thePXSec);
pmanager->AddDiscreteProcess(&theIPproton);
// neutron
particle = G4Neutron::Neutron();
pmanager = particle->GetProcessManager();
theBC = new G4BinaryCascade();
theIPneutron.RegisterMe(theBC);
theIPneutron.AddDataSet(&theNXSec);
pmanager->AddDiscreteProcess(&theIPneutron);
// fission
G4HadronFissionProcess* theFissionProcess = new G4HadronFissionProcess;
G4LFission* theFissionModel = new G4LFission;
theFissionProcess->RegisterMe(theFissionModel);
pmanager->AddDiscreteProcess(theFissionProcess);
// capture
G4HadronCaptureProcess* theCaptureProcess = new G4HadronCaptureProcess;
G4LCapture* theCaptureModel = new G4LCapture;
theCaptureProcess->RegisterMe(theCaptureModel);
pmanager->AddDiscreteProcess(theCaptureProcess);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListEmG4v52.cc,v 1.1 2003/10/07 11:58:31 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: PhysListEmG4v52.cc,v 1.4 2004/06/21 10:57:14 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -107,14 +106,14 @@ void PhysListEmG4v52::ConstructProcess()
} else if( particleName == "GenericIon" ) {
pmanager->AddProcess(new G4MultipleScattering52,-1,1,1);
pmanager->AddProcess(new G4hIonisation52, -1,2,2);
pmanager->AddProcess(new G4hIonisation52, -1,2,2);
} else if ((!particle->IsShortLived()) &&
(particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")) {
//all others charged particles except geantino
pmanager->AddProcess(new G4MultipleScattering52,-1,1,1);
pmanager->AddProcess(new G4hIonisation52, -1,2,2);
pmanager->AddProcess(new G4hIonisation52, -1,2,2);
}
}
}
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListEmStandard.cc,v 1.3 2003/10/24 12:18:14 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: PhysListEmStandard.cc,v 1.6 2004/06/21 10:57:14 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,52 +20,49 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListGeneral.cc,v 1.2 2003/10/07 11:58:31 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: PhysListHadronElastic.cc,v 1.4 2004/06/21 10:57:14 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysListGeneral.hh"
#include "PhysListHadronElastic.hh"
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
#include "G4Decay.hh"
#include "G4LElastic.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListGeneral::PhysListGeneral(const G4String& name)
PhysListHadronElastic::PhysListHadronElastic(const G4String& name)
: G4VPhysicsConstructor(name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListGeneral::~PhysListGeneral()
PhysListHadronElastic::~PhysListHadronElastic()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysListGeneral::ConstructProcess()
void PhysListHadronElastic::ConstructProcess()
{
// Add Decay Process
// Hadron elastic process
G4Decay* fDecayProcess = new G4Decay();
theElasticProcess.RegisterMe( new G4LElastic() );
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);
G4ProcessManager* pManager = particle->GetProcessManager();
if (particle->GetPDGMass() > 110.*MeV && theElasticProcess.IsApplicable(*particle)) {
pManager->AddDiscreteProcess(&theElasticProcess);
G4cout << "### Elastic model are registered for "
<< particle->GetParticleName()
<< G4endl;
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,171 @@
//
// ********************************************************************
// * 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: PhysListIonBinaryCascade.cc,v 1.2 2004/04/29 13:55:11 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysListIonBinaryCascade.hh"
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
#include "G4LFission.hh"
#include "G4LCapture.hh"
#include "G4Deuteron.hh"
#include "G4Triton.hh"
#include "G4He3.hh"
#include "G4Alpha.hh"
#include "IonC12.hh"
#include "G4GenericIon.hh"
#include "G4ExcitationHandler.hh"
#include "G4Evaporation.hh"
#include "G4FermiBreakUp.hh"
#include "G4StatMF.hh"
#include "G4GeneratorPrecompoundInterface.hh"
#include "G4HadronInelasticProcess.hh"
#include "G4BinaryLightIonReaction.hh"
#include "G4TripathiCrossSection.hh"
#include "G4IonsShenCrossSection.hh"
#include "G4LEDeuteronInelastic.hh"
#include "G4LETritonInelastic.hh"
#include "G4LEAlphaInelastic.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListIonBinaryCascade::PhysListIonBinaryCascade(const G4String& name)
: G4VPhysicsConstructor(name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListIonBinaryCascade::~PhysListIonBinaryCascade()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysListIonBinaryCascade::ConstructProcess()
{
/*
// all models for treatment of thermal nucleus
G4Evaporation * theEvaporation = new G4Evaporation;
G4FermiBreakUp * theFermiBreakUp = new G4FermiBreakUp;
G4StatMF * theMF = new G4StatMF;
// Evaporation logic
G4ExcitationHandler * theHandler = new G4ExcitationHandler;
theHandler->SetEvaporation(theEvaporation);
theHandler->SetFermiModel(theFermiBreakUp);
theHandler->SetMultiFragmentation(theMF);
theHandler->SetMaxAandZForFermiBreakUp(12, 6);
theHandler->SetMinEForMultiFrag(3*MeV);
// Pre equilibrium stage
G4PreCompoundModel * thePreEquilib = new G4PreCompoundModel(theHandler);
// a no-cascade generator-precompound interaface
G4GeneratorPrecompoundInterface * theCascade = new G4GeneratorPrecompoundInterface;
theCascade->SetDeExcitation(thePreEquilib);
*/
// Binary Cascade
G4ParticleDefinition* particle = 0;
G4ProcessManager* pmanager = 0;
G4BinaryLightIonReaction* theBC = new G4BinaryLightIonReaction();
theBC->SetMinEnergy(80*MeV);
theBC->SetMaxEnergy(20*GeV);
G4TripathiCrossSection * TripathiCrossSection= new G4TripathiCrossSection;
G4IonsShenCrossSection * aShen = new G4IonsShenCrossSection;
// deuteron
particle = G4Deuteron::Deuteron();
pmanager = particle->GetProcessManager();
G4LEDeuteronInelastic* theDIModel = new G4LEDeuteronInelastic;
theDIModel->SetMaxEnergy(100*MeV);
theIPdeuteron.AddDataSet(TripathiCrossSection);
theIPdeuteron.AddDataSet(aShen);
theIPdeuteron.RegisterMe(theDIModel);
theIPdeuteron.RegisterMe(theBC);
pmanager->AddDiscreteProcess(&theIPdeuteron);
// triton
particle = G4Triton::Triton();
pmanager = particle->GetProcessManager();
G4LETritonInelastic* theTIModel = new G4LETritonInelastic;
theTIModel->SetMaxEnergy(100*MeV);
theIPtriton.AddDataSet(TripathiCrossSection);
theIPtriton.AddDataSet(aShen);
theIPtriton.RegisterMe(theTIModel);
theIPtriton.RegisterMe(theBC);
pmanager->AddDiscreteProcess(&theIPtriton);
// alpha
particle = G4Alpha::Alpha();
pmanager = particle->GetProcessManager();
G4LEAlphaInelastic* theAIModel = new G4LEAlphaInelastic;
theAIModel->SetMaxEnergy(100*MeV);
theIPalpha.AddDataSet(TripathiCrossSection);
theIPalpha.AddDataSet(aShen);
theIPalpha.RegisterMe(theAIModel);
theIPalpha.RegisterMe(theBC);
pmanager->AddDiscreteProcess(&theIPalpha);
// GenericIon
particle = G4GenericIon::GenericIon();
pmanager = particle->GetProcessManager();
G4HadronInelasticProcess* theIPGenericIon =
new G4HadronInelasticProcess("IonInelastic",particle);
theIPGenericIon->AddDataSet(TripathiCrossSection);
theIPGenericIon->AddDataSet(aShen);
G4BinaryLightIonReaction * theGenIonBC= new G4BinaryLightIonReaction;
theGenIonBC->SetMinEnergy(0*MeV);
theGenIonBC->SetMaxEnergy(10*GeV);
theIPGenericIon->RegisterMe(theGenIonBC);
pmanager->AddDiscreteProcess(theIPGenericIon);
// C12
particle = IonC12::Ion();
pmanager = particle->GetProcessManager();
G4HadronInelasticProcess* theIPIonC12 =
new G4HadronInelasticProcess("IonC12Inelastic",particle);
theIPIonC12->AddDataSet(TripathiCrossSection);
theIPIonC12->AddDataSet(aShen);
theIPIonC12->RegisterMe(theGenIonBC);
pmanager->AddDiscreteProcess(theIPIonC12);
// He3
particle = G4He3::He3();
pmanager = particle->GetProcessManager();
G4HadronInelasticProcess* theIPHe3 =
new G4HadronInelasticProcess("He3Inelastic",particle);
theIPHe3->AddDataSet(TripathiCrossSection);
theIPHe3->AddDataSet(aShen);
theIPHe3->RegisterMe(theGenIonBC);
pmanager->AddDiscreteProcess(theIPHe3);
}
//....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/08/11 10:21:16 maire Exp $
// GEANT4 tag $Name: geant4-06-00-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......
@@ -20,66 +20,153 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PhysicsList.cc,v 1.8 2004/06/21 10:57:14 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: PhysicsList.cc,v 1.5 2004/02/19 18:18:53 maire Exp $
// GEANT4 tag $Name: geant4-06-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysicsList.hh"
#include "PhysicsListMessenger.hh"
#include "PhysListParticles.hh"
#include "PhysListGeneral.hh"
#include "PhysListEmStandard.hh"
#include "PhysListEmG4v52.hh"
#include "DetectorConstruction.hh"
#include "PhysListHadronElastic.hh"
#include "PhysListBinaryCascade.hh"
#include "PhysListIonBinaryCascade.hh"
#include "G4LossTableManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsList::PhysicsList(DetectorConstruction* p)
: G4VModularPhysicsList()
PhysicsList::PhysicsList() : G4VModularPhysicsList()
{
pDet = p;
G4LossTableManager::Instance();
pMessenger = new PhysicsListMessenger(this);
// EM physics
emName = G4String("standard");
emPhysicsList = new PhysListEmStandard(emName);
defaultCutValue = 1.0*mm;
stepMaxProcess = 0;
defaultCutValue = 1.*mm;
cutForGamma = defaultCutValue;
cutForElectron = defaultCutValue;
cutForPositron = defaultCutValue;
pMessenger = new PhysicsListMessenger(this);
stepMaxProcess = 0;
SetVerboseLevel(1);
// Particles
particleList = new PhysListParticles("particles");
// General Physics
generalPhysicsList = new PhysListGeneral("general");
// EM physics
emName = G4String("standard");
emPhysicsList = new PhysListEmStandard(emName);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsList::~PhysicsList()
{
delete pMessenger;
delete emPhysicsList;
for(size_t i=0; i<hadronPhys.size(); i++) delete hadronPhys[i];
delete pMessenger;
}
//....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......
@@ -87,16 +174,72 @@ void PhysicsList::ConstructParticle()
void PhysicsList::ConstructProcess()
{
AddTransportation();
generalPhysicsList->ConstructProcess();
AddDecay();
emPhysicsList->ConstructProcess();
for(size_t i=0; i<hadronPhys.size(); i++) hadronPhys[i]->ConstructProcess();
AddStepMax();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
#include "G4Decay.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::AddDecay()
{
// 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......
#include "StepMax.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::AddStepMax()
{
// Step limitation seen as a process
stepMaxProcess = new StepMax();
theParticleIterator->reset();
while ((*theParticleIterator)()){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (stepMaxProcess->IsApplicable(*particle))
{
pmanager ->AddDiscreteProcess(stepMaxProcess);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::AddPhysicsList(const G4String& name)
{
if (verboseLevel>1) {
if (verboseLevel>-1) {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
}
@@ -114,6 +257,18 @@ void PhysicsList::AddPhysicsList(const G4String& name)
delete emPhysicsList;
emPhysicsList = new PhysListEmG4v52(name);
} else if (name == "elastic") {
hadronPhys.push_back( new PhysListHadronElastic(name));
} else if (name == "binary") {
hadronPhys.push_back( new PhysListBinaryCascade(name));
} else if (name == "binary_ion") {
hadronPhys.push_back( new PhysListIonBinaryCascade(name));
} else {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
@@ -124,49 +279,19 @@ void PhysicsList::AddPhysicsList(const G4String& name)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#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
stepMaxProcess = new StepMax();
theParticleIterator->reset();
while ((*theParticleIterator)()){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (stepMaxProcess->IsApplicable(*particle))
{
pmanager ->AddDiscreteProcess(stepMaxProcess);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4Gamma.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
void PhysicsList::SetCuts()
{
{
if (verboseLevel >0){
G4cout << "PhysicsList::SetCuts:";
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
}
}
// set cut values for gamma at first and for e- second and next for e+,
// because some processes for e+/e- need cut values for gamma
SetCutValue(cutForGamma, "gamma");
SetCutValue(cutForElectron, "e-");
SetCutValue(cutForPositron, "e+");
SetCutValue(cutForPositron, "e+");
if (verboseLevel>0) DumpCutValuesTable();
}
@@ -197,22 +322,3 @@ void PhysicsList::SetCutForPositron(G4double cut)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4LossTableManager.hh"
G4double PhysicsList::GetRange(G4double val)
{
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
const G4MaterialCutsCouple* couple = pDet->GetAbsorbMaterialCut();
G4ParticleDefinition* part = theParticleTable->FindParticle("e-");
G4double range = G4LossTableManager::Instance()->GetRange(part,val,couple);
G4cout << "material : " << couple->GetMaterial()->GetName() << G4endl;
G4cout << "particle : " << part->GetParticleName() << G4endl;
G4cout << "energy : " << G4BestUnit(val, "Energy") << G4endl;
G4cout << "range : " << G4BestUnit(range,"Length") << G4endl;
return range;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,26 +20,28 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PhysicsListMessenger.cc,v 1.4 2004/06/21 10:57:14 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: PhysicsListMessenger.cc,v 1.1 2003/08/11 10:21:23 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysicsListMessenger.hh"
#include "PhysicsList.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
:pPhysicsList(pPhys)
{
{
pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
pListCmd->SetGuidance("Add modula physics list.");
pListCmd->SetParameterName("PList",false);
pListCmd->AvailableForStates(G4State_PreInit);
gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setGCut",this);
gammaCutCmd->SetGuidance("Set gamma cut.");
gammaCutCmd->SetParameterName("Gcut",false);
@@ -54,12 +56,12 @@ PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
electCutCmd->SetRange("Ecut>0.0");
electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
positCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setPCut",this);
positCutCmd->SetGuidance("Set positron cut.");
positCutCmd->SetParameterName("Pcut",false);
positCutCmd->SetUnitCategory("Length");
positCutCmd->SetRange("Pcut>0.0");
positCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
protoCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setPCut",this);
protoCutCmd->SetGuidance("Set positron cut.");
protoCutCmd->SetParameterName("Pcut",false);
protoCutCmd->SetUnitCategory("Length");
protoCutCmd->SetRange("Pcut>0.0");
protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
allCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setCuts",this);
allCutCmd->SetGuidance("Set cut for all.");
@@ -67,45 +69,34 @@ PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
allCutCmd->SetUnitCategory("Length");
allCutCmd->SetRange("cut>0.0");
allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
pListCmd->SetGuidance("Add modula physics list.");
pListCmd->SetParameterName("PList",false);
pListCmd->AvailableForStates(G4State_PreInit);
rangeCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/getRange",this);
rangeCmd->SetGuidance("get the electron range for the current material.");
rangeCmd->SetParameterName("energy",false);
rangeCmd->SetRange("energy>0.");
rangeCmd->SetUnitCategory("Energy");
rangeCmd->AvailableForStates(G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListMessenger::~PhysicsListMessenger()
{
delete pListCmd;
delete gammaCutCmd;
delete electCutCmd;
delete positCutCmd;
delete protoCutCmd;
delete allCutCmd;
delete rangeCmd;
delete pListCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsListMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
void PhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if( command == pListCmd )
{ pPhysicsList->AddPhysicsList(newValue);}
if( command == gammaCutCmd )
{ pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
if( command == electCutCmd )
{ pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
if( command == positCutCmd )
{ pPhysicsList->SetCutForPositron(positCutCmd->GetNewDoubleValue(newValue));}
if( command == protoCutCmd )
{ pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
if( command == allCutCmd )
{
@@ -114,12 +105,6 @@ void PhysicsListMessenger::SetNewValue(G4UIcommand* command,
pPhysicsList->SetCutForElectron(cut);
pPhysicsList->SetCutForPositron(cut);
}
if( command == pListCmd )
{ pPhysicsList->AddPhysicsList(newValue);}
if(command == rangeCmd)
{ pPhysicsList->GetRange(rangeCmd->GetNewDoubleValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PrimaryGeneratorAction.cc,v 1.3 2004/06/21 10:57:14 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: PrimaryGeneratorAction.cc,v 1.2 2004/02/19 18:18:54 maire Exp $
// GEANT4 tag $Name: geant4-06-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PrimaryGeneratorMessenger.cc,v 1.2 2004/06/21 10:57:14 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: PrimaryGeneratorMessenger.cc,v 1.1 2003/08/11 10:21:28 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: RunAction.cc,v 1.7 2004/06/21 10:57:15 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: RunAction.cc,v 1.2 2004/02/19 18:18:54 maire Exp $
// GEANT4 tag $Name: geant4-06-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -57,7 +54,7 @@ RunAction::~RunAction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::BeginOfRunAction(const G4Run* aRun)
{
{
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
//initialisation
@@ -66,11 +63,14 @@ void RunAction::BeginOfRunAction(const G4Run* aRun)
TrakLenNeutral = TrakLenNeutral2 = 0.;
nbStepsCharged = nbStepsCharged2 = 0.;
nbStepsNeutral = nbStepsNeutral2 = 0.;
MscProjecTheta = MscProjecTheta2 = 0.;
nbGamma = nbElect = nbPosit = 0;
Transmit[0] = Transmit[1] = Reflect[0] = Reflect[1] = 0;
histoManager->book();
// save Rndm status
G4RunManager::GetRunManager()->SetRandomNumberStore(true);
HepRandom::showEngineStatus();
@@ -84,95 +84,105 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
//
G4int TotNbofEvents = aRun->GetNumberOfEvent();
if (TotNbofEvents == 0) return;
EnergyDeposit /= TotNbofEvents;
G4double rmsEdep = EnergyDeposit2/TotNbofEvents - EnergyDeposit*EnergyDeposit;
EnergyDeposit /= TotNbofEvents; EnergyDeposit2 /= TotNbofEvents;
G4double rmsEdep = EnergyDeposit2 - EnergyDeposit*EnergyDeposit;
if (rmsEdep>0.) rmsEdep = sqrt(rmsEdep/TotNbofEvents);
else rmsEdep = 0.;
TrakLenCharged /= TotNbofEvents;
G4double rmsTLCh = TrakLenCharged2/TotNbofEvents
- TrakLenCharged*TrakLenCharged;
TrakLenCharged /= TotNbofEvents; TrakLenCharged2 /= TotNbofEvents;
G4double rmsTLCh = TrakLenCharged2 - TrakLenCharged*TrakLenCharged;
if (rmsTLCh>0.) rmsTLCh = sqrt(rmsTLCh/TotNbofEvents);
else rmsTLCh = 0.;
TrakLenNeutral /= TotNbofEvents;
G4double rmsTLNe = TrakLenNeutral2/TotNbofEvents
- TrakLenNeutral*TrakLenNeutral;
TrakLenNeutral /= TotNbofEvents; TrakLenNeutral2 /= TotNbofEvents;
G4double rmsTLNe = TrakLenNeutral2 - TrakLenNeutral*TrakLenNeutral;
if (rmsTLNe>0.) rmsTLNe = sqrt(rmsTLNe/TotNbofEvents);
else rmsTLNe = 0.;
nbStepsCharged /= TotNbofEvents;
G4double rmsStCh = nbStepsCharged2/TotNbofEvents
- nbStepsCharged*nbStepsCharged;
nbStepsCharged /= TotNbofEvents; nbStepsCharged2 /= TotNbofEvents;
G4double rmsStCh = nbStepsCharged2 - nbStepsCharged*nbStepsCharged;
if (rmsStCh>0.) rmsStCh = sqrt(rmsTLCh/TotNbofEvents);
else rmsStCh = 0.;
nbStepsNeutral /= TotNbofEvents;
G4double rmsStNe = nbStepsNeutral2/TotNbofEvents
- nbStepsNeutral*nbStepsNeutral;
else rmsStCh = 0.;
nbStepsNeutral /= TotNbofEvents; nbStepsNeutral2 /= TotNbofEvents;
G4double rmsStNe = nbStepsNeutral2 - nbStepsNeutral*nbStepsNeutral;
if (rmsStNe>0.) rmsStNe = sqrt(rmsTLCh/TotNbofEvents);
else rmsStNe = 0.;
G4double Gamma = (double)nbGamma/TotNbofEvents;
G4double Gamma = (double)nbGamma/TotNbofEvents;
G4double Elect = (double)nbElect/TotNbofEvents;
G4double Posit = (double)nbPosit/TotNbofEvents;
G4double transmit[2];
transmit[0] = 100.*Transmit[0]/TotNbofEvents;
transmit[1] = 100.*Transmit[1]/TotNbofEvents;
G4double reflect[2];
reflect[0] = 100.*Reflect[0]/TotNbofEvents;
reflect[1] = 100.*Reflect[1]/TotNbofEvents;
G4cout << "\n ======================== run summary ======================\n";
G4int prec = G4cout.precision(4);
G4cout << "\n Number of Events = " << TotNbofEvents << G4endl;
G4cout << "\n Total energy deposit in absorber per event = "
<< G4BestUnit(EnergyDeposit,"Energy") << " +- "
<< G4BestUnit(rmsEdep, "Energy") << G4endl;
G4cout << "\n Total track length (charged) in absorber per event = "
<< G4BestUnit(TrakLenCharged,"Length") << " +- "
<< G4BestUnit(rmsTLCh, "Length") << G4endl;
G4cout << " Total track length (neutral) in absorber per event = "
<< G4BestUnit(TrakLenNeutral,"Length") << " +- "
<< G4BestUnit(rmsTLNe, "Length") << G4endl;
G4cout << "\n Number of steps (charged) in absorber per event = "
<< nbStepsCharged << " +- " << rmsStCh << G4endl;
G4cout << " Number of steps (neutral) in absorber per event = "
<< nbStepsNeutral << " +- " << rmsStNe << G4endl;
G4cout << "\n Number of secondaries per event : Gammas = " << Gamma
<< "; electrons = " << Elect
<< "; positrons = " << Posit << G4endl;
G4cout << "\n Number of events with the primary particle transmitted = "
<< transmit[1] << " %" << G4endl;
G4cout << " Number of events with at least 1 particle transmitted "
<< "(same charge as primary) = " << transmit[0] << " %" << G4endl;
G4cout << "\n Number of events with the primary particle reflected = "
<< reflect[1] << " %" << G4endl;
G4cout << " Number of events with at least 1 particle reflected "
<< "(same charge as primary) = " << reflect[0] << " %" << G4endl;
// compute width of the Gaussian central part of the MultipleScattering
//
G4cout << "\n MultipleScattering: theta0 Highland = "
<< ComputeMscHighland()/mrad << " mrad" << G4endl;
G4cout.precision(prec);
G4double rmsMsc = 0.;
if (Transmit[1] > 0) {
MscProjecTheta /= (2*Transmit[1]); MscProjecTheta2 /= (2*Transmit[1]);
rmsMsc = MscProjecTheta2 - MscProjecTheta*MscProjecTheta;
if (rmsMsc > 0.) rmsMsc = sqrt(rmsMsc);
}
G4cout << "\n ======================== run summary ======================\n";
G4int prec = G4cout.precision(4);
G4cout << "\n Number of Events = " << TotNbofEvents << G4endl;
G4cout << "\n Total energy deposit in absorber per event = "
<< G4BestUnit(EnergyDeposit,"Energy") << " +- "
<< G4BestUnit(rmsEdep, "Energy") << G4endl;
G4cout << "\n Total track length (charged) in absorber per event = "
<< G4BestUnit(TrakLenCharged,"Length") << " +- "
<< G4BestUnit(rmsTLCh, "Length") << G4endl;
G4cout << " Total track length (neutral) in absorber per event = "
<< G4BestUnit(TrakLenNeutral,"Length") << " +- "
<< G4BestUnit(rmsTLNe, "Length") << G4endl;
G4cout << "\n Number of steps (charged) in absorber per event = "
<< nbStepsCharged << " +- " << rmsStCh << G4endl;
G4cout << " Number of steps (neutral) in absorber per event = "
<< nbStepsNeutral << " +- " << rmsStNe << G4endl;
G4cout << "\n Number of secondaries per event : Gammas = " << Gamma
<< "; electrons = " << Elect
<< "; positrons = " << Posit << G4endl;
G4cout << "\n Number of events with the primary particle transmitted = "
<< transmit[1] << " %" << G4endl;
G4cout << " Number of events with at least 1 particle transmitted "
<< "(same charge as primary) = " << transmit[0] << " %" << G4endl;
G4cout << "\n Number of events with the primary particle reflected = "
<< reflect[1] << " %" << G4endl;
G4cout << " Number of events with at least 1 particle reflected "
<< "(same charge as primary) = " << reflect[0] << " %" << G4endl;
// compute width of the Gaussian central part of the MultipleScattering
//
if (histoManager->HistoExist(6)) {
G4cout << "\n MultipleScattering: rms proj angle of transmit primary particle = "
<< rmsMsc/mrad << " mrad " << G4endl;
G4cout << " MultipleScattering: computed theta0 (Highland formula) = "
<< ComputeMscHighland()/mrad << " mrad" << G4endl;
}
G4cout.precision(prec);
histoManager->save();
// show Rndm status
HepRandom::showEngineStatus();
}
@@ -184,16 +194,16 @@ G4double RunAction::ComputeMscHighland()
//compute the width of the Gaussian central part of the MultipleScattering
//projected angular distribution.
//Eur. Phys. Jour. C15 (2000) page 166, formule 23.9
G4double t = (detector->GetAbsorberThickness())
/(detector->GetAbsorberMaterial()->GetRadlen());
if (t < DBL_MIN) return 0.;
G4ParticleGun* particle = primary->GetParticleGun();
G4ParticleGun* particle = primary->GetParticleGun();
G4double T = particle->GetParticleEnergy();
G4double M = particle->GetParticleDefinition()->GetPDGMass();
G4double z = particle->GetParticleDefinition()->GetPDGCharge()/eplus;
G4double z = abs(particle->GetParticleDefinition()->GetPDGCharge()/eplus);
G4double bpc = T*(T+2*M)/(T+M);
G4double teta0 = 13.6*MeV*z*sqrt(t)*(1.+0.038*log(t))/bpc;
return teta0;
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: StackingAction.cc,v 1.1 2003/08/11 10:21:33 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: StackingAction.cc,v 1.3 2004/06/21 10:57:15 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -36,17 +35,13 @@
#include "G4Track.hh"
#ifdef G4ANALYSIS_USE
#include "AIDA/IHistogram1D.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingAction::StackingAction(RunAction* RA, EventAction* EA, HistoManager* HM)
:runaction(RA), eventaction(EA), histoManager(HM)
{
killSecondary = false;
stackMessenger = new StackingMessenger(this);
killSecondary = false;
stackMessenger = new StackingMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -58,36 +53,26 @@ StackingAction::~StackingAction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ClassificationOfNewTrack
G4ClassificationOfNewTrack
StackingAction::ClassifyNewTrack(const G4Track* aTrack)
{
//keep primary particle
//keep primary particle
if (aTrack->GetParentID() == 0) return fUrgent;
//count secondary particles
runaction->CountParticles(aTrack->GetDefinition());
#ifdef G4ANALYSIS_USE
//
//
//energy spectrum of secondaries
//
G4double energy = aTrack->GetKineticEnergy();
G4double charge = aTrack->GetDefinition()->GetPDGCharge();
if (charge != 0.) {
if (histoManager->GetHisto(2)) {
G4double unit = histoManager->GetHistoUnit(2);
histoManager->GetHisto(2)->fill(energy/unit);
}
}
if (aTrack->GetDefinition() == G4Gamma::Gamma()) {
if (histoManager->GetHisto(3)) {
histoManager->GetHisto(3)->fill(log10(energy/MeV));
}
}
#endif
if (charge != 0.) histoManager->FillHisto(2,energy);
if (aTrack->GetDefinition() == G4Gamma::Gamma())
histoManager->FillHisto(3, log10(energy/MeV));
//stack or delete secondaries
G4ClassificationOfNewTrack status = fUrgent;
if (killSecondary) status = fKill;
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: StackingMessenger.cc,v 1.2 2004/06/21 10:57:15 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: StackingMessenger.cc,v 1.1 2003/08/11 10:21:37 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,12 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: SteppingAction.cc,v 1.2 2004/06/21 10:57:15 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: SteppingAction.cc,v 1.1 2003/08/11 10:22:10 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -38,10 +35,6 @@
#include "G4Track.hh"
#ifdef G4ANALYSIS_USE
#include "AIDA/IHistogram1D.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingAction::SteppingAction(DetectorConstruction* DET, RunAction* RA,
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: SteppingVerbose.cc,v 1.1 2003/08/11 10:22:17 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: SteppingVerbose.cc,v 1.2 2004/06/21 10:57:15 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,13 +20,10 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: TrackingAction.cc,v 1.3 2004/02/19 18:18:54 maire Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: TrackingAction.cc,v 1.8 2004/06/21 10:57:15 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -38,10 +35,6 @@
#include "HistoManager.hh"
#include "G4Track.hh"
#ifdef G4ANALYSIS_USE
#include "AIDA/IHistogram1D.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -49,13 +42,13 @@ TrackingAction::TrackingAction(DetectorConstruction* DET,RunAction* RA,
EventAction* EA, HistoManager* HM)
:detector(DET), runaction(RA), eventaction(EA), histoManager(HM)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TrackingAction::PreUserTrackingAction(const G4Track* aTrack )
{
{
// few initialisations
//
//
if (aTrack->GetTrackID() == 1) {
worldLimit = 0.5*(detector->GetWorldSizeX());
primaryCharge = aTrack->GetDefinition()->GetPDGCharge();
@@ -79,11 +72,10 @@ void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
if (aTrack->GetTrackID() == 1) flag = 2;
if (transmit) eventaction->SetTransmitFlag(flag);
if (reflect) eventaction->SetReflectFlag(flag);
#ifdef G4ANALYSIS_USE
//
//
//histograms
//
//
G4int id = 0;
G4bool charged = (charge != 0.);
G4bool neutral = !charged;
@@ -94,49 +86,48 @@ void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
else if (transmit && neutral) id = 8;
else if (reflect && charged) id = 11;
else if (reflect && neutral) id = 14;
if (histoManager->GetHisto(id)) {
G4double energy = aTrack->GetKineticEnergy();
G4double unit = histoManager->GetHistoUnit(id);
histoManager->GetHisto(id)->fill(energy/unit);
}
histoManager->FillHisto(id, aTrack->GetKineticEnergy());
//space angle distribution at exit
//
if (transmit && charged) id = 5;
else if (transmit && neutral) id = 9;
else if (reflect && charged) id = 12;
else if (reflect && neutral) id = 15;
if (histoManager->GetHisto(id)) {
G4ThreeVector direction = aTrack->GetMomentumDirection();
G4double theta = acos(abs(direction.x()));
G4ThreeVector direction = aTrack->GetMomentumDirection();
if (histoManager->HistoExist(id)) {
G4double theta = acos(direction.x());
G4double dteta = histoManager->GetBinWidth(id);
G4double weight = 1./(2*pi*sin(theta)*dteta);
G4double weight = 1./(twopi*sin(theta)*dteta);
G4double unit = histoManager->GetHistoUnit(id);
histoManager->GetHisto(id)->fill(theta/unit,weight*unit*unit);
histoManager->FillHisto(id,theta,weight*unit*unit);
}
//projected angle distribution at exit
//projected angles distribution at exit
//
if (transmit && charged) id = 6;
else if (transmit && neutral) id = 10;
else if (reflect && charged) id = 13;
else if (reflect && neutral) id = 16;
if (histoManager->GetHisto(id)) {
G4ThreeVector momentum = aTrack->GetMomentum();
G4double unit = histoManager->GetHistoUnit(id);
histoManager->GetHisto(id)->fill(atan(momentum.y()/abs(momentum.x()))/unit);
histoManager->GetHisto(id)->fill(atan(momentum.z()/abs(momentum.x()))/unit);
if(id>0) {
G4double tet = atan(direction.y()/abs(direction.x()));
histoManager->FillHisto(id,tet);
if (transmit && (flag == 2)) runaction->AddMscProjTheta(tet);
tet = atan(direction.z()/abs(direction.x()));
histoManager->FillHisto(id,tet);
if (transmit && (flag == 2)) runaction->AddMscProjTheta(tet);
}
//projected position at exit
//
if (transmit && charged) id = 7;
if (histoManager->GetHisto(id)) {
G4double unit = histoManager->GetHistoUnit(id);
histoManager->GetHisto(id)->fill(position.y()/unit);
histoManager->GetHisto(id)->fill(position.z()/unit);
}
#endif
if (transmit && charged) {
histoManager->FillHisto(7, position.y());
histoManager->FillHisto(7, position.z());
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,13 +20,9 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: VisManager.cc,v 1.3 2004/06/21 10:57:15 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: VisManager.cc,v 1.2 2003/11/13 15:10:28 johna Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
// John Allison 24th January 1998.
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......