Import Geant4 9.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:25:56 +02:00
parent 74cad5e589
commit 89a9605df1
4440 changed files with 379508 additions and 189225 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.48 2009/12/02 22:45:09 perl Exp $
$Id: History,v 1.50 2010/06/06 04:21:04 perl Exp $
-------------------------------------------------------------------
=========================================================
@@ -11,6 +11,9 @@ $Id: History,v 1.48 2009/12/02 22:45:09 perl Exp $
---------------------------------------------------------------------------
4 June 2010 Joseph Perl (exampleA01-V09-03-00)
- Updated vis usage.
2 Dec 2009 Joseph Perl (exampleA01-V09-02-02)
- A01MuonPhysics: change hMultipleScattering to MuMultipleScattering.
+1 -1
View File
@@ -10,7 +10,7 @@
# /vis/sceneHandler/create
# /vis/viewer/create
#
/vis/open OGLIX
/vis/open OGL
#
# Create a scene. One could use /vis/drawVolume, which is equivalent to:
# /vis/scene/create
+60 -9
View File
@@ -4,24 +4,75 @@
# Set verbosity
#
/control/verbose 2
# /vis/verbose confirmations
#
# Create a scene handler and viewer for HepRep
# Use this open statement to create an OpenGL view:
/vis/open OGL 600x600-0+0
#
/vis/open HepRepFile
# Use this open statement to create a .prim file suitable for
# viewing in DAWN:
#/vis/open DAWNFILE
#
# Draw detector
# Use this open statement to create a .heprep file suitable for
# viewing in HepRApp:
#/vis/open HepRepFile
#
# Use this open statement to create a .wrl file suitable for
# viewing in a VRML viewer:
#/vis/open VRML2FILE
#
# Disable auto refresh and quieten vis messages whilst scene and
# trajectories are established:
/vis/viewer/set/autoRefresh false
/vis/verbose errors
#
# Draw geometry:
/vis/drawVolume
#
# Declare that trajectories and hits should be added to the scene
# Specify view angle:
#/vis/viewer/set/viewpointThetaPhi 90. 0.
#
/vis/scene/add/trajectories
/vis/scene/add/hits
# Specify zoom value:
/vis/viewer/zoom 1.6
#
# Execute the visualization via the /vis/viewer/flush that comes
# automatically at the end of each /run.
# Specify style (surface or wireframe):
#/vis/viewer/set/style wireframe
#
# Draw coordinate axes:
#/vis/scene/add/axes 0 0 0 1 m
#
# Draw smooth trajectories at end of event, showing trajectory points
# as markers 2 pixels wide:
/vis/scene/add/trajectories smooth
/vis/modeling/trajectories/create/drawByCharge
/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
# (if too many tracks cause core dump => /tracking/storeTrajectory 0)
#
# Draw hits at end of event:
#/vis/scene/add/hits
#
# To draw only gammas:
#/vis/filtering/trajectories/create/particleFilter
#/vis/filtering/trajectories/particleFilter-0/add gamma
#
# To invert the above, drawing all particles except gammas,
# keep the above two lines but also add:
#/vis/filtering/trajectories/particleFilter-0/invert true
#
# Many other options are available with /vis/modeling and /vis/filtering.
# For example, to select colour by particle ID:
#/vis/modeling/trajectories/create/drawByParticleID
#/vis/modeling/trajectories/drawByParticleID-0/set e- blue
#
# To superimpose all of the events from a given run:
#/vis/scene/endOfEventAction accumulate
#
# Re-establish auto refreshing and verbosity:
/vis/viewer/set/autoRefresh true
/vis/verbose warnings
#
# For file-based drivers, use this to create an empty detector view:
#/vis/viewer/flush
#
/mydet/armAngle 60. deg
/mydet/fieldValue 2. tesla
+81 -64
View File
@@ -24,89 +24,106 @@
// ********************************************************************
//
//
// $Id: AnaEx01.cc,v 1.14 2006/06/29 16:33:13 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: AnaEx01.cc,v 1.15 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// --------------------------------------------------------------
// GEANT 4 - AnaEx01
//
// --------------------------------------------------------------
// Comments
// Example of histogram and tuple manipulations using an AIDA compliant
// system. All analysis manipulations (hooking an AIDA implementation,
// histo booking, filling, etc...) are concentrated in one
// class : AnaEx01AnalysisManager.
// See the README file within the same directory to have more infos.
// --------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Geant4 :
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
#include "EventAction.hh"
#include "SteppingAction.hh"
#include "HistoManager.hh"
// AIDA :
#ifdef G4ANALYSIS_USE
#include <AIDA/IAnalysisFactory.h>
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
// AnaEx01 :
#include "AnaEx01AnalysisManager.hh"
#include "AnaEx01DetectorConstruction.hh"
#include "AnaEx01PhysicsList.hh"
#include "AnaEx01PrimaryGeneratorAction.hh"
#include "AnaEx01RunAction.hh"
#include "AnaEx01EventAction.hh"
#include "AnaEx01SteppingAction.hh"
#include "AnaEx01SteppingVerbose.hh"
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
int main(int,char**) {
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// choose the Random engine
CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
//my Verbose output class
G4VSteppingVerbose::SetInstance(new AnaEx01SteppingVerbose);
int main(int argc,char** argv)
{
// Construct the default run manager
//
G4RunManager * runManager = new G4RunManager;
// set mandatory initialization classes
AnaEx01DetectorConstruction* detector = new AnaEx01DetectorConstruction;
// Set mandatory initialization classes
//
DetectorConstruction* detector = new DetectorConstruction;
runManager->SetUserInitialization(detector);
runManager->SetUserInitialization(new AnaEx01PhysicsList);
runManager->SetUserAction(new AnaEx01PrimaryGeneratorAction(detector));
AnaEx01AnalysisManager* analysisManager = 0;
#ifdef G4ANALYSIS_USE
AIDA::IAnalysisFactory* aida = AIDA_createAnalysisFactory();
analysisManager = new AnaEx01AnalysisManager(aida);
#endif
runManager->SetUserAction(new AnaEx01RunAction(analysisManager));
runManager->SetUserAction(new AnaEx01EventAction(analysisManager));
runManager->SetUserAction(new AnaEx01SteppingAction(analysisManager));
//Initialize G4 kernel
//
PhysicsList* physics = new PhysicsList;
runManager->SetUserInitialization(physics);
// set an HistoManager
//
HistoManager* histo = new HistoManager();
// Set user action classes
//
PrimaryGeneratorAction* gen_action =
new PrimaryGeneratorAction(detector);
runManager->SetUserAction(gen_action);
//
RunAction* run_action = new RunAction(histo);
runManager->SetUserAction(run_action);
//
EventAction* event_action = new EventAction(run_action,histo);
runManager->SetUserAction(event_action);
//
SteppingAction* stepping_action =
new SteppingAction(detector, event_action);
runManager->SetUserAction(stepping_action);
// Initialize G4 kernel
//
runManager->Initialize();
// get the pointer to the User Interface manager
G4UImanager* UI = G4UImanager::GetUIpointer();
// Batch mode
UI->ApplyCommand("/control/execute run.mac");
// job termination
#ifdef G4ANALYSIS_USE
delete analysisManager;
// Get the pointer to the User Interface manager
//
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if (argc!=1) // batch mode
{
G4String command = "/control/execute ";
G4String fileName = argv[1];
UImanager->ApplyCommand(command+fileName);
}
else
{ // interactive mode : define visualization and UI terminal
#ifdef G4VIS_USE
G4VisManager* visManager = new G4VisExecutive;
visManager->Initialize();
UImanager->ApplyCommand("/control/execute vis.mac");
#endif
#ifdef G4UI_USE
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
ui->SessionStart();
delete ui;
#endif
#ifdef G4VIS_USE
delete visManager;
#endif
}
// Job termination
delete histo;
delete runManager;
#ifdef G4ANALYSIS_USE
delete aida;
#endif
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,5 @@
# e- 500MeV
/gun/particle e-
/gun/energy 500 MeV
/run/beamOn 1000
+11 -2
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.3 2009/03/05 09:20:52 gbarrand Exp $
# $Id: GNUmakefile,v 1.4 2010/11/08 10:38:44 maire Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -8,10 +8,19 @@ G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../../..
G4INSTALL = ../../..
endif
.PHONY: all
all: lib bin
#### G4ANALYSIS_USE := true
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
+5 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.18 2009/05/13 08:46:37 gbarrand Exp $
$Id: History,v 1.19 2010/11/08 10:38:44 maire Exp $
--------------------------------------------------
=========================================================
@@ -14,6 +14,10 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
08 November 2010 Michel Maire (AnaEx01-V09-03-00)
- revised version of example :
class HistoManager to replace AnaEx01AnalysisManager
13 May 2009 Guy Barrand (AnaEx01-V09-02-00)
- Tagged all changes.
@@ -0,0 +1,78 @@
$Id: InstallAida.txt,v 1.1 2010/11/08 10:38:44 maire Exp $
-----------------------------------------------------------
--------------
Install AIDA
--------------
To use histograms, at least one of the AIDA implementations should be
available.
You can use various file formats to write histograms (hbook, root, AIDA-XML).
1 - OpenScientist (lal/in2p3)
-------------------------
OpenScientist is available at http://OpenScientist.lal.in2p3.fr.
OpenScientist_batch is a small package ( ~ 6MB), easy to install.
It provides an AIDA interface to write files in ROOT or PAW format.
Download and gunzip (for Linux system) :
http://openscientist.lal.in2p3.fr/download/16.3/osc_batch-v16r3-Linux-i386-gcc_323.zip
(or more recent version, or Windows or Mac system)
Installation:
prompt%> cd osc_batch/v16r3 (or more recent version)
prompt%> ./install
prompt%> source aida-setup.csh
(on Windows : dos%> call <<OpenScientist install path>/aida-setup.bat)
2 - RAIDA (desy)
------------
It is a ROOT based AIDA interface. It can be downloaded from
http://ilcsoft.desy.de/portal/software_packages/raida/index_eng.html
3 - iAIDA
-----
Another package including AIDA (an evolution of the former cern PI project)
is the iAIDA package: http://iaida.dynalias.net
Once you have installed iAIDA in a specified local area $MYIAIDA, it is
required to add the installation path to $PATH, i.e. for example, for
release 1.0.11 of iAIDA:
setenv PATH ${PATH}:$MYIAIDA/bin
Before running the example the command should be issued:
eval `aida-config --runtime csh`
4 - JAIDA (slac)
------------
JAIDA is an implementation of AIDA in Java. To use it, one needs Java
as well as AIDAJNI, a connector between AIDA-C++ and AIDA-Java.
Available for: Linux-g++2, Linux-g++3, WIN32-VC, SUN-CC,
Darwin-g++2, Darwin-g++3
To compile and link with JAIDA using AIDAJNI, make sure you have:
1. JAIDA version 3.2.0, see http://java.freehep.org/jaida
2. set enviroment variable JAIDA_HOME to your JAIDA installation
3. source the aida-setup script $JAIDA_HOME/bin/aida-setup.[sh|csh|win32]
4. AIDAJNI version 3.0.4 or 3.2.0, or better: see http://java.freehep.org/aidajni
5. set environment variable AIDAJNI_HOME to your AIDAJNI installation
6. set environment variable JDK_HOME to your Java Standard Development Kit (1.4.x or up).
7. source the aidajni-setup script $AIDAJNI_HOME/bin/$G4SYSTEM/aidajni-setup.[sh|csh|win32]
now execute:
source setup-analysis (.csh, .sh, .win32)
gmake clean
gmake
+84 -68
View File
@@ -1,5 +1,5 @@
$Id: README,v 1.16 2009/05/13 08:32:36 gbarrand Exp $
-------------------------------------------------------------------
$Id: README,v 1.17 2010/11/08 10:38:44 maire Exp $
--------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
@@ -7,74 +7,90 @@ $Id: README,v 1.16 2009/05/13 08:32:36 gbarrand Exp $
AnaEx01
-------
This example shows the usage of histogram and tuple manipulations using
an AIDA compliant system. In this example, all analysis manipulations
This example shows the usage of histogram and tuple manipulations using
an AIDA compliant system. All analysis manipulations
(attaching an AIDA implementation, histo booking, filling, saving
histos in a file, etc...) are concentrated in one class :
AnaEx01AnalysisManager.
To include the analysis code, the environment variable
G4ANALYSIS_USE
must be defined before doing "make". If not, at run time, no
histograms and file will be created.
For example, a typical session from a UNIX csh flavoured shell is :
csh> source <aida tool>/aida-setup.csh
csh> setenv G4ANALYSIS_USE 1
csh> make
csh> ${G4BIN}/${G4SYSTEM}/AnaEx01
After execution, a file AnaEx01.aida should have been created.
Someone can change the default file format by changing the
value of the std::string variable format in the AnaEx01AnalysisManager
constructor :
// File format :
std::string format("xml");
//std::string format("hbook");
//std::string format("root");
histos in a file, etc...) are located in one class : HistoManager.
Working with the OpenScientist packages :
---------------------------------------
To create the analysis file, you can install the light "osc_batch"
binary kit (See http://OpenScientist.lal.in2p3.fr ). For example
from a UNIX sh flavoured shell :
sh> cd /usr/local
sh> <arrange to be su>
sh> <get an osc_batch binary kit>
sh> unzip -q osc_batch<platform>.zip
sh> cd osc_batch/<version>
sh> ./install
The example is an adaptation of examples/novice/N03. It describes a simple
sampling calorimeter setup.
1- Detector description
-----------------------
The calorimeter is a box made of a given number of layers. A layer
consists of an absorber plate and of a detection gap. The layer is
replicated.
Six parameters define the calorimeter :
- the material of the absorber,
- the thickness of an absorber plate,
- the material of the detection gap,
- the thickness of a gap,
- the number of layers,
- the transverse size of the calorimeter (the input face is a square).
The default geometry is constructed in DetectorConstruction class,
but all of the above parameters can be modified interactively via
the commands defined in the DetectorMessenger class.
|<----layer 0---------->|<----layer 1---------->|<----layer 2---------->|
| | | |
==========================================================================
|| | || | || | ||
|| | || | || | ||
|| absorber | gap || absorber | gap || absorber | gap ||
|| | || | || | ||
|| | || | || | ||
beam || | || | || | ||
======> || | || | || | ||
|| | || | || | ||
|| | || | || | ||
|| | || | || | ||
|| | || | || | ||
|| | || | || | ||
==========================================================================
2- An event : PrimaryGeneratorAction
------------------------------------
The primary kinematic consists of a single particle which hits the
calorimeter perpendicular to the input face. The type of the particle
and its energy are set in the PrimaryGeneratorAction class, and can
be changed via the G4 build-in commands of ParticleGun class.
3- Histograms
-------------
To produce histograms, at least one of the AIDA implementations should be
available. See the file InstallAida.txt
AnaEx01 can produce 4 histograms :
Then you build the example with :
<create another terminal>
csh> source /usr/local/osc_batch/<version>/aida-setup.csh
csh> <source setup Geant4>
csh> setenv G4ANALYSIS_USE 1
csh> cd <G4_install_path>/examples/extended/analysis/AnaEx01
csh> make
csh> ${G4BIN}/${G4SYSTEM}/AnaEx01
histo 1 : total energy deposit in absorber per event
histo 2 : total energy deposit in gap per event
histo 3 : total track length of charged particles in absorber per event
histo 4 : total track length of charged particles in gap per event
And 1 Ntuple :
one raw per event : EnergyAbs EnergyGap TrackLAbs TrackLGap
These histos are booked in HistoManager and filled from EventAction.
One can control the name of the histograms file and its format:
default name : AnaEx01
possible formats : hbook root (default) xml
See HistoManager constructor
Note that, by default, histograms are disabled. To activate them, uncomment
the flag G4ANALYSIS_USE in GNUmakefile, *before* compilation.
Depending of the file format, you can visualize the produced
file with various interactive tools (CERN/PAW, CERN/ROOT, jas).
But if installing also an OpenScientist osc_vis binary kit,
you shall be able to visualize all formats by using
the osc-plot program. To install an osc_vis kit :
sh> cd /usr/local
sh> <arrange to be su>
sh> <get an osc_vis binary kit>
sh> unzip -q osc_vis<platform>.zip
sh> cd osc_vis/<version>
sh> ./install
Then to browse the AnaEx01.<format> file (for exa from an UNIX sh shell) :
<create another terminal>
sh> . /usr/local/osc_vis/<version>/setup.sh
sh> <setenv DISPLAY if needed>
sh> osc-plot AnaEx01.[aida,root,hbook]
The OpenScientist URL is :
http://OpenScientist.lal.in2p3.fr.
Note that OpenScientist is installed on CERN/lxplus under :
/afs/cern.ch/sw/contrib/[osc_batch,osc_vis].
4- OpenScientist
----------------
The file UseOpenScientist.txt gives some indications how to use this system to
visualize and handle histogram files.
@@ -0,0 +1,46 @@
Working with the OpenScientist packages :
---------------------------------------
To create the analysis file, you can install the light "osc_batch"
binary kit (See http://OpenScientist.lal.in2p3.fr ). For example
from a UNIX sh flavoured shell :
sh> cd /usr/local
sh> <arrange to be su>
sh> <get an osc_batch binary kit>
sh> unzip -q osc_batch<platform>.zip
sh> cd osc_batch/<version>
sh> ./install
Then you build the example with :
<create another terminal>
csh> source /usr/local/osc_batch/<version>/aida-setup.csh
csh> <source setup Geant4>
csh> setenv G4ANALYSIS_USE 1
csh> cd <G4_install_path>/examples/extended/analysis/AnaEx01
csh> make
csh> ${G4BIN}/${G4SYSTEM}/AnaEx01
Depending of the file format, you can visualize the produced
file with various interactive tools (CERN/PAW, CERN/ROOT, jas).
But if installing also an OpenScientist osc_vis binary kit,
you shall be able to visualize all formats by using
the osc-plot program. To install an osc_vis kit :
sh> cd /usr/local
sh> <arrange to be su>
sh> <get an osc_vis binary kit>
sh> unzip -q osc_vis<platform>.zip
sh> cd osc_vis/<version>
sh> ./install
Then to browse the AnaEx01.<format> file (for exa from an UNIX sh shell) :
<create another terminal>
sh> . /usr/local/osc_vis/<version>/setup.sh
sh> <setenv DISPLAY if needed>
sh> osc-plot AnaEx01.[aida,root,hbook]
The OpenScientist URL is :
http://OpenScientist.lal.in2p3.fr.
Note that OpenScientist is installed on CERN/lxplus under :
/afs/cern.ch/sw/contrib/[osc_batch,osc_vis].
@@ -1,75 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: AnaEx01AnalysisManager.hh,v 1.9 2006/06/29 16:33:15 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
#ifndef AnaEx01AnalysisManager_h
#define AnaEx01AnalysisManager_h 1
#ifdef G4ANALYSIS_USE
class G4Run;
class G4Event;
class G4Step;
namespace AIDA {
class IAnalysisFactory;
class ITree;
class IHistogram1D;
class ITuple;
}
class AnaEx01AnalysisManager {
public:
AnaEx01AnalysisManager(AIDA::IAnalysisFactory*);
virtual ~AnaEx01AnalysisManager();
public:
virtual void BeginOfRun(const G4Run*);
virtual void EndOfRun(const G4Run*);
virtual void BeginOfEvent(const G4Event*);
virtual void EndOfEvent(const G4Event*);
virtual void Step(const G4Step*);
private:
int fCalorimeterCollID;
AIDA::IAnalysisFactory* fAIDA;
AIDA::ITree* fTree;
AIDA::IHistogram1D* fEAbs;
AIDA::IHistogram1D* fLAbs;
AIDA::IHistogram1D* fEGap;
AIDA::IHistogram1D* fLGap;
AIDA::ITuple* fTuple;
};
#else
class AnaEx01AnalysisManager;
#endif
#endif
@@ -1,101 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: AnaEx01CalorHit.hh,v 1.4 2006/06/29 16:33:17 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01CalorHit_h
#define AnaEx01CalorHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01CalorHit : public G4VHit
{
public:
AnaEx01CalorHit();
~AnaEx01CalorHit();
AnaEx01CalorHit(const AnaEx01CalorHit&);
const AnaEx01CalorHit& operator=(const AnaEx01CalorHit&);
int operator==(const AnaEx01CalorHit&) const;
inline void* operator new(size_t);
inline void operator delete(void*);
void Draw();
void Print();
public:
void AddAbs(G4double de, G4double dl) {EdepAbs += de; TrackLengthAbs += dl;};
void AddGap(G4double de, G4double dl) {EdepGap += de; TrackLengthGap += dl;};
G4double GetEdepAbs() { return EdepAbs; };
G4double GetTrakAbs() { return TrackLengthAbs; };
G4double GetEdepGap() { return EdepGap; };
G4double GetTrakGap() { return TrackLengthGap; };
private:
G4double EdepAbs, TrackLengthAbs;
G4double EdepGap, TrackLengthGap;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
typedef G4THitsCollection<AnaEx01CalorHit> AnaEx01CalorHitsCollection;
extern G4Allocator<AnaEx01CalorHit> AnaEx01CalorHitAllocator;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void* AnaEx01CalorHit::operator new(size_t)
{
void* aHit;
aHit = (void*) AnaEx01CalorHitAllocator.MallocSingle();
return aHit;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void AnaEx01CalorHit::operator delete(void* aHit)
{
AnaEx01CalorHitAllocator.FreeSingle((AnaEx01CalorHit*) aHit);
}
#endif
@@ -1,70 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: AnaEx01CalorimeterSD.hh,v 1.4 2006/06/29 16:33:19 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01CalorimeterSD_h
#define AnaEx01CalorimeterSD_h 1
#include "G4VSensitiveDetector.hh"
#include "globals.hh"
class AnaEx01DetectorConstruction;
class G4HCofThisEvent;
class G4Step;
#include "AnaEx01CalorHit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01CalorimeterSD : public G4VSensitiveDetector
{
public:
AnaEx01CalorimeterSD(G4String, AnaEx01DetectorConstruction* );
~AnaEx01CalorimeterSD();
void Initialize(G4HCofThisEvent*);
G4bool ProcessHits(G4Step*,G4TouchableHistory*);
void EndOfEvent(G4HCofThisEvent*);
void clear();
void DrawAll();
void PrintAll();
private:
AnaEx01CalorHitsCollection* CalCollection;
AnaEx01DetectorConstruction* Detector;
G4int* HitID;
};
#endif
@@ -1,52 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: AnaEx01EventAction.hh,v 1.6 2006/06/29 16:33:27 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
#ifndef AnaEx01EventAction_h
#define AnaEx01EventAction_h
#include "G4UserEventAction.hh"
class AnaEx01AnalysisManager;
class AnaEx01EventAction : public G4UserEventAction {
public:
AnaEx01EventAction(AnaEx01AnalysisManager* = 0);
virtual ~AnaEx01EventAction();
public:
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
private:
AnaEx01AnalysisManager* fAnalysisManager;
};
#endif
@@ -1,87 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: AnaEx01PhysicsList.hh,v 1.4 2006/06/29 16:33:29 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01PhysicsList_h
#define AnaEx01PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01PhysicsList: public G4VUserPhysicsList
{
public:
AnaEx01PhysicsList();
~AnaEx01PhysicsList();
protected:
// Construct particle and physics
void ConstructParticle();
void ConstructProcess();
void SetCuts();
public:
// Set/Get cut values
void SetCutForGamma(G4double);
void SetCutForElectron(G4double);
void SetCutForProton(G4double);
G4double GetCutForGamma() const;
G4double GetCutForElectron() const;
G4double GetCutForProton() const;
protected:
// these methods Construct particles
void ConstructBosons();
void ConstructLeptons();
void ConstructMesons();
void ConstructBaryons();
protected:
// these methods Construct physics processes and register them
void ConstructGeneral();
void ConstructEM();
private:
G4double cutForGamma;
G4double cutForElectron;
G4double cutForProton;
G4double currentDefaultCut;
};
#endif
@@ -1,61 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: AnaEx01SteppingVerbose.hh,v 1.4 2006/06/29 16:33:40 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
//---------------------------------------------------------------
//
// AnaEx01SteppingVerbose.hh
//
// Description:
// This class manages the verbose outputs in G4SteppingManager.
// It inherits from G4SteppingVerbose
//
//---------------------------------------------------------------
class AnaEx01SteppingVerbose;
#ifndef AnaEx01SteppingVerbose_h
#define AnaEx01SteppingVerbose_h 1
#include "G4SteppingVerbose.hh"
class AnaEx01SteppingVerbose : public G4SteppingVerbose {
public:
// Constructor/Destructor
AnaEx01SteppingVerbose();
~AnaEx01SteppingVerbose();
//
void StepInfo();
void TrackingStarted();
//
};
#endif
@@ -24,16 +24,16 @@
// ********************************************************************
//
//
// $Id: AnaEx01DetectorConstruction.hh,v 1.4 2006/06/29 16:33:22 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: DetectorConstruction.hh,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef AnaEx01DetectorConstruction_h
#define AnaEx01DetectorConstruction_h 1
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
@@ -42,18 +42,16 @@ class G4Box;
class G4LogicalVolume;
class G4VPhysicalVolume;
class G4Material;
class G4UniformMagField;
class AnaEx01DetectorMessenger;
class AnaEx01CalorimeterSD;
class DetectorMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class AnaEx01DetectorConstruction : public G4VUserDetectorConstruction
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
AnaEx01DetectorConstruction();
~AnaEx01DetectorConstruction();
DetectorConstruction();
~DetectorConstruction();
public:
@@ -65,8 +63,6 @@ class AnaEx01DetectorConstruction : public G4VUserDetectorConstruction
void SetCalorSizeYZ(G4double);
void SetNbOfLayers (G4int);
void SetMagField(G4double);
G4VPhysicalVolume* Construct();
@@ -132,10 +128,7 @@ class AnaEx01DetectorConstruction : public G4VUserDetectorConstruction
G4LogicalVolume* logicGap; //pointer to the logical Gap
G4VPhysicalVolume* physiGap; //pointer to the physical Gap
G4UniformMagField* magField; //pointer to the magnetic field
AnaEx01DetectorMessenger* detectorMessenger; //pointer to the Messenger
AnaEx01CalorimeterSD* calorimeterSD; //pointer to the sensitive detector
DetectorMessenger* detectorMessenger; //pointer to the Messenger
private:
@@ -144,9 +137,9 @@ class AnaEx01DetectorConstruction : public G4VUserDetectorConstruction
G4VPhysicalVolume* ConstructCalorimeter();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline void AnaEx01DetectorConstruction::ComputeCalorParameters()
inline void DetectorConstruction::ComputeCalorParameters()
{
// Compute derived parameters of the calorimeter
LayerThickness = AbsorberThickness + GapThickness;
@@ -155,5 +148,7 @@ inline void AnaEx01DetectorConstruction::ComputeCalorParameters()
WorldSizeX = 1.2*CalorThickness; WorldSizeYZ = 1.2*CalorSizeYZ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -24,50 +24,52 @@
// ********************************************************************
//
//
// $Id: AnaEx01DetectorMessenger.hh,v 1.4 2006/06/29 16:33:25 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: DetectorMessenger.hh,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef AnaEx01DetectorMessenger_h
#define AnaEx01DetectorMessenger_h 1
#ifndef DetectorMessenger_h
#define DetectorMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class AnaEx01DetectorConstruction;
class DetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class AnaEx01DetectorMessenger: public G4UImessenger
class DetectorMessenger: public G4UImessenger
{
public:
AnaEx01DetectorMessenger(AnaEx01DetectorConstruction* );
~AnaEx01DetectorMessenger();
DetectorMessenger(DetectorConstruction* );
~DetectorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
AnaEx01DetectorConstruction* AnaEx01Detector;
DetectorConstruction* Detector;
G4UIdirectory* AnaEx01detDir;
G4UIdirectory* N03Dir;
G4UIdirectory* detDir;
G4UIcmdWithAString* AbsMaterCmd;
G4UIcmdWithAString* GapMaterCmd;
G4UIcmdWithADoubleAndUnit* AbsThickCmd;
G4UIcmdWithADoubleAndUnit* GapThickCmd;
G4UIcmdWithADoubleAndUnit* SizeYZCmd;
G4UIcmdWithAnInteger* NbLayersCmd;
G4UIcmdWithADoubleAndUnit* MagFieldCmd;
G4UIcmdWithoutParameter* UpdateCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: EventAction.hh,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef EventAction_h
#define EventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
class RunAction;
class HistoManager;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class EventAction : public G4UserEventAction
{
public:
EventAction(RunAction*, HistoManager*);
virtual ~EventAction();
void BeginOfEventAction(const G4Event*);
void EndOfEventAction(const G4Event*);
void AddAbs(G4double de, G4double dl) {EnergyAbs += de; TrackLAbs += dl;};
void AddGap(G4double de, G4double dl) {EnergyGap += de; TrackLGap += dl;};
private:
RunAction* runAct;
HistoManager* histoManager;
G4double EnergyAbs, EnergyGap;
G4double TrackLAbs, TrackLGap;
G4int printModulo;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,79 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: HistoManager.hh,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef HistoManager_h
#define HistoManager_h 1
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
namespace AIDA {
class IAnalysisFactory;
class ITree;
class IHistogram1D;
class ITuple;
}
const G4int MaxHisto = 5;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class HistoManager
{
public:
HistoManager();
~HistoManager();
void book();
void save();
void FillHisto(G4int id, G4double bin, G4double weight = 1.0);
void Normalize(G4int id, G4double fac);
void FillNtuple(G4int column, G4double value);
void AddRowNtuple();
void PrintStatistic();
private:
AIDA::IAnalysisFactory* af;
AIDA::ITree* tree;
AIDA::IHistogram1D* histo[MaxHisto];
AIDA::ITuple* ntupl;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -23,44 +23,45 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: ProcessesCount.hh,v 1.2 2006/06/29 16:44:16 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// $Id: PhysicsList.hh,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef ProcessesCount_HH
#define ProcessesCount_HH
#ifndef PhysicsList_h
#define PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
#include <vector>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OneProcessCount
class PhysicsList: public G4VUserPhysicsList
{
public:
OneProcessCount(G4String name) {Name=name; Counter=0;};
~OneProcessCount() {};
PhysicsList();
virtual ~PhysicsList();
// Construct particle and physics
void ConstructParticle();
void ConstructProcess();
void SetCuts();
public:
G4String GetName() {return Name;};
G4int GetCounter() {return Counter;};
void Count() {Counter++;};
private:
G4String Name; // process name
G4int Counter; // process counter
// these methods Construct physics processes and register them
void ConstructDecay();
void ConstructEM();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
typedef std::vector<OneProcessCount*> ProcessesCount;
#endif
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: PrimaryGeneratorAction.hh,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4ParticleGun;
class G4Event;
class DetectorConstruction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction(DetectorConstruction*);
virtual ~PrimaryGeneratorAction();
void GeneratePrimaries(G4Event*);
private:
G4ParticleGun* particleGun; //pointer a to G4 class
DetectorConstruction* Detector; //pointer to the geometry
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: RunAction.hh,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef RunAction_h
#define RunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4Run;
class HistoManager;
class RunAction : public G4UserRunAction
{
public:
RunAction(HistoManager*);
virtual ~RunAction();
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
void fillPerEvent(G4double, G4double, G4double, G4double);
private:
HistoManager* histoManager;
G4double sumEAbs, sum2EAbs;
G4double sumEGap, sum2EGap;
G4double sumLAbs, sum2LAbs;
G4double sumLGap, sum2LGap;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -24,35 +24,35 @@
// ********************************************************************
//
//
// $Id: ExN03SteppingAction.hh,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: SteppingAction.hh,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef ExN03SteppingAction_h
#define ExN03SteppingAction_h 1
#ifndef SteppingAction_h
#define SteppingAction_h 1
#include "G4UserSteppingAction.hh"
class ExN03DetectorConstruction;
class ExN03EventAction;
class DetectorConstruction;
class EventAction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class ExN03SteppingAction : public G4UserSteppingAction
class SteppingAction : public G4UserSteppingAction
{
public:
ExN03SteppingAction(ExN03DetectorConstruction*, ExN03EventAction*);
~ExN03SteppingAction();
public:
SteppingAction(DetectorConstruction*, EventAction*);
virtual ~SteppingAction();
void UserSteppingAction(const G4Step*);
void UserSteppingAction(const G4Step*);
private:
ExN03DetectorConstruction* detector;
ExN03EventAction* eventaction;
private:
DetectorConstruction* detector;
EventAction* eventaction;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,20 @@
{
gROOT->Reset();
// Draw histos filled by Geant4 simulation
//
TFile f = TFile("AnaEx01.root");
TCanvas* c1 = new TCanvas("c1", " ");
TH1D* hist1 = (TH1D*)f.Get("1");
hist1->Draw("HIST");
TH1D* hist2 = (TH1D*)f.Get("2");
hist2->Draw("HIST");
TH1D* hist3 = (TH1D*)f.Get("3");
c1->SetLogy(1);
c1->cd();
c1->Update();
hist3->Draw("HIST");
}
+11 -15
View File
@@ -1,19 +1,15 @@
# $Id: run.mac,v 1.5 2010/11/08 11:01:47 maire Exp $
#
# Macro file for "AnEx01.cc"
# Macro file for "AnaEx01.cc"
#
# (can be run in batch, without graphic)
# can be run in batch, without graphic
# or interactively: Idle> /control/execute run.mac
#
#/control/verbose 2
#/control/saveHistory
/control/verbose 2
/run/verbose 2
/event/verbose 0
/tracking/verbose 0
#
#/run/verbose 2
#/event/verbose 0
#/tracking/verbose 1
#
# muon 300 MeV to the direction (1.,0.,0.)
# 3 events
#
#/gun/particle mu+
/gun/particle e+
/gun/energy 300 MeV
/run/beamOn 100
/gun/particle e-
/gun/energy 500 MeV
/run/beamOn 1000
@@ -1,219 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: AnaEx01AnalysisManager.cc,v 1.18 2009/05/13 08:33:17 gbarrand Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
//
// Guy Barrand 14th Septembre 2000.
#ifdef G4ANALYSIS_USE
#include "G4ios.hh"
#include "G4SDManager.hh"
#include "G4Run.hh"
#include "G4Event.hh"
#include "G4HCofThisEvent.hh"
#include <AIDA/IAnalysisFactory.h>
#include <AIDA/ITreeFactory.h>
#include <AIDA/ITupleFactory.h>
#include <AIDA/IHistogramFactory.h>
#include <AIDA/ITree.h>
#include <AIDA/IHistogram1D.h>
#include <AIDA/ITuple.h>
#include "AnaEx01CalorHit.hh"
#include "AnaEx01AnalysisManager.hh"
AnaEx01AnalysisManager::AnaEx01AnalysisManager(AIDA::IAnalysisFactory* aAIDA)
:fCalorimeterCollID(-1)
,fAIDA(aAIDA)
,fTree(0)
,fEAbs(0)
,fLAbs(0)
,fEGap(0)
,fLGap(0)
,fTuple(0)
{
// Could fail if no AIDA implementation found :
if(!fAIDA) {
G4cout << "AIDA analysis factory not found." << G4endl;
return;
}
AIDA::ITreeFactory* treeFactory = fAIDA->createTreeFactory();
if(!treeFactory) return;
// Create a tree-like container to handle histograms.
// This tree is associated to a AnaEx01.<format> file.
std::string h_name_EAbs("EAbs");
std::string h_name_LAbs("LAbs");
std::string h_name_EGap("EGap");
std::string h_name_LGap("LGap");
std::string t_name("AnaEx01");
// File format :
std::string format("xml");
//std::string format("hbook");
//std::string format("root");
std::string file("AnaEx01");
std::string ext;
ext = "."+format;
std::string opts;
if(format=="hbook") {
opts = "compress=no";
h_name_EAbs = "1";
h_name_LAbs = "2";
h_name_EGap = "3";
h_name_LGap = "4";
t_name = "101";
} else if(format=="root") {
opts = "compress=yes";
} else if(format=="xml") {
ext = ".aida";
opts = "compress=no";
} else {
G4cout << "storage format \"" << format << "\""
<< " not handled in this example."
<< G4endl;
return;
}
file += ext;
fTree = treeFactory->create(file,format,false,true,opts);
// Factories are not "managed" by an AIDA analysis system.
// They must be deleted by the AIDA user code.
delete treeFactory;
if(!fTree) {
G4cout << "can't create tree associated to file \"" << file << "\"."
<< G4endl;
return;
}
fTree->mkdir("histograms");
fTree->cd("histograms");
// Create an histo factory that will create histo in the tree :
AIDA::IHistogramFactory* histoFactory =
fAIDA->createHistogramFactory(*fTree);
if(histoFactory) {
fEAbs = histoFactory->createHistogram1D(h_name_EAbs,"EAbs",100,0,100);
if(!fEAbs) G4cout << "can't create histo EAbs." << G4endl;
fLAbs = histoFactory->createHistogram1D(h_name_LAbs,"LAbs",100,0,100);
if(!fLAbs) G4cout << "can't create histo LAbs." << G4endl;
fEGap = histoFactory->createHistogram1D(h_name_EGap,"EGap",100,0,10);
if(!fEGap) G4cout << "can't create histo EGap." << G4endl;
fLGap = histoFactory->createHistogram1D(h_name_LGap,"LGap",100,0,100);
if(!fLGap) G4cout << "can't create histo LGap." << G4endl;
delete histoFactory;
}
fTree->cd("..");
fTree->mkdir("tuples");
fTree->cd("tuples");
// Get a tuple factory :
AIDA::ITupleFactory* tupleFactory = fAIDA->createTupleFactory(*fTree);
if(tupleFactory) {
// Create a tuple :
fTuple = tupleFactory->create(t_name,"AnaEx01",
"double EAbs,double LAbs,double EGap,double LGap");
if(!fTuple) G4cout << "can't create tuple." << G4endl;
delete tupleFactory;
}
fTree->cd("..");
}
AnaEx01AnalysisManager::~AnaEx01AnalysisManager() {
}
void AnaEx01AnalysisManager::BeginOfRun(const G4Run* aRun){
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
}
void AnaEx01AnalysisManager::EndOfRun(const G4Run*){
if(fTree) fTree->commit();
if(fEAbs) {
G4cout << "Histo : EAbs : mean " << fEAbs->mean() << " rms : " << fEAbs->rms() << G4endl;
G4cout << "Histo : LAbs : mean " << fLAbs->mean() << " rms : " << fLAbs->rms() << G4endl;
G4cout << "Histo : EGap : mean " << fEGap->mean() << " rms : " << fEGap->rms() << G4endl;
G4cout << "Histo : LGap : mean " << fLGap->mean() << " rms : " << fLGap->rms() << G4endl;
}
}
void AnaEx01AnalysisManager::BeginOfEvent(const G4Event*){
if(fCalorimeterCollID==-1) {
G4SDManager* SDman = G4SDManager::GetSDMpointer();
fCalorimeterCollID = SDman->GetCollectionID("CalCollection");
}
}
void AnaEx01AnalysisManager::EndOfEvent(const G4Event* aEvent){
if(!fEAbs) return; // No histo booked !
if(!fTuple) return; // No tuple booked !
//G4int evtNb = aEvent->GetEventID();
G4HCofThisEvent* HCE = aEvent->GetHCofThisEvent();
AnaEx01CalorHitsCollection* CHC =
HCE ? (AnaEx01CalorHitsCollection*)(HCE->GetHC(fCalorimeterCollID)) : 0;
if(CHC) {
G4int n_hit = CHC->entries();
for (G4int i=0;i<n_hit;i++) {
G4double EAbs = (*CHC)[i]->GetEdepAbs();
G4double LAbs = (*CHC)[i]->GetTrakAbs();
G4double EGap = (*CHC)[i]->GetEdepGap();
G4double LGap = (*CHC)[i]->GetTrakGap();
fEAbs->fill(EAbs);
fLAbs->fill(LAbs);
fEGap->fill(EGap);
fLGap->fill(LGap);
fTuple->fill(0,EAbs);
fTuple->fill(1,LAbs);
fTuple->fill(2,EGap);
fTuple->fill(3,LGap);
fTuple->addRow();
}
}
}
void AnaEx01AnalysisManager::Step(const G4Step*){}
#endif
@@ -1,142 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: AnaEx01CalorimeterSD.cc,v 1.5 2006/06/29 16:33:46 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "AnaEx01CalorimeterSD.hh"
#include "AnaEx01CalorHit.hh"
#include "AnaEx01DetectorConstruction.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Step.hh"
#include "G4VTouchable.hh"
#include "G4TouchableHistory.hh"
#include "G4SDManager.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01CalorimeterSD::AnaEx01CalorimeterSD(G4String name,
AnaEx01DetectorConstruction* det)
:G4VSensitiveDetector(name),Detector(det)
{
collectionName.insert("CalCollection");
HitID = new G4int[500];
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01CalorimeterSD::~AnaEx01CalorimeterSD()
{
delete [] HitID;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorimeterSD::Initialize(G4HCofThisEvent*)
{
CalCollection = new AnaEx01CalorHitsCollection
(SensitiveDetectorName,collectionName[0]);
for (G4int j=0;j<Detector->GetNbOfLayers();j++) {HitID[j] = -1;};
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool AnaEx01CalorimeterSD::ProcessHits(G4Step* aStep,G4TouchableHistory*)
{
G4double edep = aStep->GetTotalEnergyDeposit();
G4double stepl = 0.;
if (aStep->GetTrack()->GetDefinition()->GetPDGCharge() != 0.)
stepl = aStep->GetStepLength();
if ((edep==0.)&&(stepl==0.)) return false;
G4TouchableHistory* theTouchable
= (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
G4VPhysicalVolume* physVol = theTouchable->GetVolume();
//theTouchable->MoveUpHistory();
G4int LayerNumber = 0;
if (Detector->GetNbOfLayers()>1) LayerNumber=theTouchable->GetReplicaNumber(1);
if (HitID[LayerNumber]==-1)
{
AnaEx01CalorHit* calHit = new AnaEx01CalorHit();
if (physVol == Detector->GetAbsorber()) calHit->AddAbs(edep,stepl);
if (physVol == Detector->GetGap ()) calHit->AddGap(edep,stepl);
HitID[LayerNumber] = CalCollection->insert(calHit) - 1;
if (verboseLevel>0)
G4cout << " New Calorimeter Hit on layer: " << LayerNumber << G4endl;
}
else
{
if (physVol == Detector->GetAbsorber())
(*CalCollection)[HitID[LayerNumber]]->AddAbs(edep,stepl);
if (physVol == Detector->GetGap())
(*CalCollection)[HitID[LayerNumber]]->AddGap(edep,stepl);
if (verboseLevel>0)
G4cout << " Energy added to Layer: " << LayerNumber << G4endl;
}
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorimeterSD::EndOfEvent(G4HCofThisEvent* HCE)
{
static G4int HCID = -1;
if(HCID<0)
{ HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
HCE->AddHitsCollection(HCID,CalCollection);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorimeterSD::clear()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorimeterSD::DrawAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorimeterSD::PrintAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -1,55 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: AnaEx01EventAction.cc,v 1.6 2006/06/29 16:33:53 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
#ifdef G4ANALYSIS_USE
#include "AnaEx01AnalysisManager.hh"
#endif
#include "AnaEx01EventAction.hh"
AnaEx01EventAction::AnaEx01EventAction(
AnaEx01AnalysisManager* aAnalysisManager
):fAnalysisManager(aAnalysisManager){}
AnaEx01EventAction::~AnaEx01EventAction(){}
void AnaEx01EventAction::BeginOfEventAction(const G4Event* aEvent){
#ifdef G4ANALYSIS_USE
if(fAnalysisManager) fAnalysisManager->BeginOfEvent(aEvent);
#endif
}
void AnaEx01EventAction::EndOfEventAction(const G4Event* aEvent) {
#ifdef G4ANALYSIS_USE
if(fAnalysisManager) fAnalysisManager->EndOfEvent(aEvent);
#endif
}
@@ -1,375 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: AnaEx01PhysicsList.cc,v 1.5 2006/06/29 16:33:55 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "AnaEx01PhysicsList.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleWithCuts.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4Material.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01PhysicsList::AnaEx01PhysicsList(): G4VUserPhysicsList()
{
currentDefaultCut = defaultCutValue = 1.0*mm;
cutForGamma = defaultCutValue;
cutForElectron = defaultCutValue;
cutForProton = defaultCutValue;
SetVerboseLevel(1);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01PhysicsList::~AnaEx01PhysicsList()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructParticle()
{
// In this method, static member functions should be called
// for all particles which you want to use.
// This ensures that objects of these particle types will be
// created in the program.
ConstructBosons();
ConstructLeptons();
ConstructMesons();
ConstructBaryons();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructBosons()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructLeptons()
{
// leptons
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructMesons()
{
// mesons
G4PionPlus::PionPlusDefinition();
G4PionMinus::PionMinusDefinition();
G4PionZero::PionZeroDefinition();
G4Eta::EtaDefinition();
G4EtaPrime::EtaPrimeDefinition();
G4KaonPlus::KaonPlusDefinition();
G4KaonMinus::KaonMinusDefinition();
G4KaonZero::KaonZeroDefinition();
G4AntiKaonZero::AntiKaonZeroDefinition();
G4KaonZeroLong::KaonZeroLongDefinition();
G4KaonZeroShort::KaonZeroShortDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructBaryons()
{
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
G4Neutron::NeutronDefinition();
G4AntiNeutron::AntiNeutronDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructProcess()
{
AddTransportation();
ConstructEM();
ConstructGeneral();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hIonisation.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructEM()
{
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (particleName == "gamma") {
// gamma
pmanager->AddDiscreteProcess(new G4GammaConversion());
pmanager->AddDiscreteProcess(new G4ComptonScattering());
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
} else if (particleName == "e-") {
//electron
G4VProcess* theeminusMultipleScattering = new G4MultipleScattering();
G4VProcess* theeminusIonisation = new G4eIonisation();
G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
//
// add processes
pmanager->AddProcess(theeminusMultipleScattering);
pmanager->AddProcess(theeminusIonisation);
pmanager->AddProcess(theeminusBremsstrahlung);
//
// set ordering for AlongStepDoIt
pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep,1);
pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep,2);
//
// set ordering for PostStepDoIt
pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep,1);
pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep,2);
pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep,3);
} else if (particleName == "e+") {
//positron
G4VProcess* theeplusMultipleScattering = new G4MultipleScattering();
G4VProcess* theeplusIonisation = new G4eIonisation();
G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
//
// add processes
pmanager->AddProcess(theeplusMultipleScattering);
pmanager->AddProcess(theeplusIonisation);
pmanager->AddProcess(theeplusBremsstrahlung);
pmanager->AddProcess(theeplusAnnihilation);
//
// set ordering for AtRestDoIt
pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
//
// set ordering for AlongStepDoIt
pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep,1);
pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep,2);
//
// set ordering for PostStepDoIt
pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep,1);
pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep,2);
pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep,3);
pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep,4);
} else if( particleName == "mu+" ||
particleName == "mu-" ) {
//muon
G4VProcess* aMultipleScattering = new G4MultipleScattering();
G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
G4VProcess* aPairProduction = new G4MuPairProduction();
G4VProcess* anIonisation = new G4MuIonisation();
//
// add processes
pmanager->AddProcess(anIonisation);
pmanager->AddProcess(aMultipleScattering);
pmanager->AddProcess(aBremsstrahlung);
pmanager->AddProcess(aPairProduction);
//
// set ordering for AlongStepDoIt
pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
//
// set ordering for PostStepDoIt
pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep,3);
pmanager->SetProcessOrdering(aPairProduction, idxPostStep,4);
} else if ((!particle->IsShortLived()) &&
(particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")) {
// all others charged particles except geantino
G4VProcess* aMultipleScattering = new G4MultipleScattering();
G4VProcess* anIonisation = new G4hIonisation();
//
// add processes
pmanager->AddProcess(anIonisation);
pmanager->AddProcess(aMultipleScattering);
//
// set ordering for AlongStepDoIt
pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
//
// set ordering for PostStepDoIt
pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4Decay.hh"
void AnaEx01PhysicsList::ConstructGeneral()
{
// Add Decay Process
G4Decay* theDecayProcess = new G4Decay();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (theDecayProcess->IsApplicable(*particle)) {
pmanager ->AddProcess(theDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt
pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::SetCuts()
{
// reactualise cutValues
if (currentDefaultCut != defaultCutValue)
{
if(cutForGamma == currentDefaultCut) cutForGamma = defaultCutValue;
if(cutForElectron == currentDefaultCut) cutForElectron = defaultCutValue;
if(cutForProton == currentDefaultCut) cutForProton = defaultCutValue;
currentDefaultCut = defaultCutValue;
}
if (verboseLevel >0){
G4cout << "AnaEx01PhysicsList::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(cutForElectron, "e+");
// set cut values for proton and anti_proton before all other hadrons
// because some processes for hadrons need cut values for proton/anti_proton
SetCutValue(cutForProton, "proton");
SetCutValue(cutForProton, "anti_proton");
SetCutValueForOthers(defaultCutValue);
if (verboseLevel>0) DumpCutValuesTable();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::SetCutForGamma(G4double cut)
{
ResetCuts();
cutForGamma = cut;
}
void AnaEx01PhysicsList::SetCutForElectron(G4double cut)
{
ResetCuts();
cutForElectron = cut;
}
void AnaEx01PhysicsList::SetCutForProton(G4double cut)
{
ResetCuts();
cutForProton = cut;
}
G4double AnaEx01PhysicsList::GetCutForGamma() const
{
return cutForGamma;
}
G4double AnaEx01PhysicsList::GetCutForElectron() const
{
return cutForElectron;
}
G4double AnaEx01PhysicsList::GetCutForProton() const
{
return cutForGamma;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -1,55 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: AnaEx01RunAction.cc,v 1.7 2006/06/29 16:34:01 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
#ifdef G4ANALYSIS_USE
#include "AnaEx01AnalysisManager.hh"
#endif
#include "AnaEx01RunAction.hh"
AnaEx01RunAction::AnaEx01RunAction(
AnaEx01AnalysisManager* aAnalysisManager
):fAnalysisManager(aAnalysisManager){}
AnaEx01RunAction::~AnaEx01RunAction(){}
void AnaEx01RunAction::BeginOfRunAction(const G4Run* aRun) {
#ifdef G4ANALYSIS_USE
if(fAnalysisManager) fAnalysisManager->BeginOfRun(aRun);
#endif
}
void AnaEx01RunAction::EndOfRunAction(const G4Run* aRun){
#ifdef G4ANALYSIS_USE
if(fAnalysisManager) fAnalysisManager->EndOfRun(aRun);
#endif
}
@@ -24,58 +24,42 @@
// ********************************************************************
//
//
// $Id: AnaEx01DetectorConstruction.cc,v 1.5 2006/06/29 16:33:49 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: DetectorConstruction.cc,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "AnaEx01DetectorConstruction.hh"
#include "AnaEx01DetectorMessenger.hh"
#include "AnaEx01CalorimeterSD.hh"
#include "DetectorConstruction.hh"
#include "DetectorMessenger.hh"
#include "G4Material.hh"
#include "G4NistManager.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4PVReplica.hh"
#include "G4UniformMagField.hh"
#include "G4FieldManager.hh"
#include "G4TransportationManager.hh"
#include "G4SDManager.hh"
#include "G4RunManager.hh"
#include "G4GeometryManager.hh"
#include "G4PhysicalVolumeStore.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4SolidStore.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01DetectorConstruction::AnaEx01DetectorConstruction()
:AbsorberMaterial(NULL)
,GapMaterial(NULL)
,defaultMaterial(NULL)
,solidWorld(NULL)
,logicWorld(NULL)
,physiWorld(NULL)
,solidCalor(NULL)
,logicCalor(NULL)
,physiCalor(NULL)
,solidLayer(NULL)
,logicLayer(NULL)
,physiLayer(NULL)
,solidAbsorber(NULL)
,logicAbsorber(NULL)
,physiAbsorber(NULL)
,solidGap(NULL)
,logicGap(NULL)
,physiGap(NULL)
,magField(NULL)
,calorimeterSD(NULL)
DetectorConstruction::DetectorConstruction()
:AbsorberMaterial(0),GapMaterial(0),defaultMaterial(0),
solidWorld(0),logicWorld(0),physiWorld(0),
solidCalor(0),logicCalor(0),physiCalor(0),
solidLayer(0),logicLayer(0),physiLayer(0),
solidAbsorber(0),logicAbsorber(0),physiAbsorber(0),
solidGap (0),logicGap (0),physiGap (0)
{
// default parameter values of the calorimeter
AbsorberThickness = 10.*mm;
@@ -83,168 +67,57 @@ AnaEx01DetectorConstruction::AnaEx01DetectorConstruction()
NbOfLayers = 10;
CalorSizeYZ = 10.*cm;
ComputeCalorParameters();
// create commands for interactive definition of the calorimeter
detectorMessenger = new AnaEx01DetectorMessenger(this);
// materials
DefineMaterials();
SetAbsorberMaterial("G4_Pb");
SetGapMaterial("G4_lAr");
// create commands for interactive definition of the calorimeter
detectorMessenger = new DetectorMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
AnaEx01DetectorConstruction::~AnaEx01DetectorConstruction()
DetectorConstruction::~DetectorConstruction()
{ delete detectorMessenger;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* AnaEx01DetectorConstruction::Construct()
G4VPhysicalVolume* DetectorConstruction::Construct()
{
DefineMaterials();
return ConstructCalorimeter();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AnaEx01DetectorConstruction::DefineMaterials()
void DetectorConstruction::DefineMaterials()
{
//This function illustrates the possible ways to define materials
G4String name, symbol; //a=mass of a mole;
G4double a, z, density; //z=mean number of protons;
G4int iz, n; //iz=number of protons in an isotope;
// n=number of nucleons in an isotope;
G4int ncomponents, natoms;
G4double abundance, fractionmass;
G4double temperature, pressure;
// use G4-NIST materials data base
//
// define Elements
G4NistManager* man = G4NistManager::Instance();
defaultMaterial = man->FindOrBuildMaterial("G4_Galactic");
man->FindOrBuildMaterial("G4_Pb");
man->FindOrBuildMaterial("G4_lAr");
// print table
//
a = 1.01*g/mole;
G4Element* H = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
a = 12.01*g/mole;
G4Element* C = new G4Element(name="Carbon" ,symbol="C" , z= 6., a);
a = 14.01*g/mole;
G4Element* N = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
a = 16.00*g/mole;
G4Element* O = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
a = 28.09*g/mole;
G4Element* Si = new G4Element(name="Silicon",symbol="Si" , z= 14., a);
//
// define an Element from isotopes, by relative abundance
//
G4Isotope* U5 = new G4Isotope(name="U235", iz=92, n=235, a=235.01*g/mole);
G4Isotope* U8 = new G4Isotope(name="U238", iz=92, n=238, a=238.03*g/mole);
G4Element* U = new G4Element(name="enriched Uranium", symbol="U", ncomponents=2);
U->AddIsotope(U5, abundance= 90.*perCent);
U->AddIsotope(U8, abundance= 10.*perCent);
//
// define simple materials
//
density = 1.390*g/cm3;
a = 39.95*g/mole;
G4Material* lAr = new G4Material(name="liquidArgon", z=18., a, density);
density = 11.35*g/cm3;
a = 207.19*g/mole;
G4Material* Pb = new G4Material(name="Lead" , z=82., a, density);
//
// define a material from elements. case 1: chemical molecule
//
density = 1.000*g/cm3;
G4Material* H2O = new G4Material(name="Water", density, ncomponents=2);
H2O->AddElement(H, natoms=2);
H2O->AddElement(O, natoms=1);
density = 1.032*g/cm3;
G4Material* Sci = new G4Material(name="Scintillator", density, ncomponents=2);
Sci->AddElement(C, natoms=9);
Sci->AddElement(H, natoms=10);
density = 2.200*g/cm3;
G4Material* SiO2 = new G4Material(name="quartz", density, ncomponents=2);
SiO2->AddElement(Si, natoms=1);
SiO2->AddElement(O , natoms=2);
//
// define a material from elements. case 2: mixture by fractional mass
//
density = 1.290*mg/cm3;
G4Material* Air = new G4Material(name="Air" , density, ncomponents=2);
Air->AddElement(N, fractionmass=0.7);
Air->AddElement(O, fractionmass=0.3);
//
// define a material from elements and/or others materials (mixture of mixtures)
//
density = 0.200*g/cm3;
G4Material* Aerog = new G4Material(name="Aerogel", density, ncomponents=3);
Aerog->AddMaterial(SiO2, fractionmass=62.5*perCent);
Aerog->AddMaterial(H2O , fractionmass=37.4*perCent);
Aerog->AddElement (C , fractionmass= 0.1*perCent);
//
// examples of gas in non STP conditions
//
density = 27.*mg/cm3;
pressure = 50.*atmosphere;
temperature = 325.*kelvin;
G4Material* CO2 = new G4Material(name="CarbonicGas", density, ncomponents=2,
kStateGas,temperature,pressure);
CO2->AddElement(C, natoms=1);
CO2->AddElement(O, natoms=2);
density = 0.3*mg/cm3;
pressure = 2.*atmosphere;
temperature = 500.*kelvin;
G4Material* steam = new G4Material(name="WaterSteam", density, ncomponents=1,
kStateGas,temperature,pressure);
steam->AddMaterial(H2O, fractionmass=1.);
//
// examples of vacuum
//
density = universe_mean_density; //from PhysicalConstants.h
pressure = 3.e-18*pascal;
temperature = 2.73*kelvin;
new G4Material(name="Galactic", z=1., a=1.01*g/mole, density,
kStateGas,temperature,pressure);
density = 1.e-5*g/cm3;
pressure = 2.e-2*bar;
temperature = STP_Temperature; //from PhysicalConstants.h
G4Material* beam = new G4Material(name="Beam", density, ncomponents=1,
kStateGas,temperature,pressure);
beam->AddMaterial(Air, fractionmass=1.);
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
//default materials of the calorimeter
AbsorberMaterial = Pb;
GapMaterial = lAr;
defaultMaterial = Air;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4VPhysicalVolume* AnaEx01DetectorConstruction::ConstructCalorimeter()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
{
// complete the Calor parameters definition
// Clean old geometry, if any
//
G4GeometryManager::GetInstance()->OpenGeometry();
G4PhysicalVolumeStore::GetInstance()->Clean();
G4LogicalVolumeStore::GetInstance()->Clean();
G4SolidStore::GetInstance()->Clean();
// complete the Calor parameters definition
ComputeCalorParameters();
//
@@ -259,17 +132,17 @@ G4VPhysicalVolume* AnaEx01DetectorConstruction::ConstructCalorimeter()
physiWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicWorld, //its logical volume
"World", //its name
logicWorld, //its logical volume
NULL, //its mother volume
0, //its mother volume
false, //no boolean operation
0); //copy number
//
// Calorimeter
//
solidCalor=NULL; logicCalor=NULL; physiCalor=NULL;
solidLayer=NULL; logicLayer=NULL; physiLayer=NULL;
solidCalor=0; logicCalor=0; physiCalor=0;
solidLayer=0; logicLayer=0; physiLayer=0;
if (CalorThickness > 0.)
{ solidCalor = new G4Box("Calorimeter", //its name
@@ -281,9 +154,9 @@ G4VPhysicalVolume* AnaEx01DetectorConstruction::ConstructCalorimeter()
physiCalor = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
"Calorimeter", //its name
logicCalor, //its logical volume
physiWorld, //its mother volume
"Calorimeter", //its name
logicWorld, //its mother volume
false, //no boolean operation
0); //copy number
@@ -299,16 +172,16 @@ G4VPhysicalVolume* AnaEx01DetectorConstruction::ConstructCalorimeter()
if (NbOfLayers > 1)
physiLayer = new G4PVReplica("Layer", //its name
logicLayer, //its logical volume
physiCalor, //its mother
logicCalor, //its mother
kXAxis, //axis of replication
NbOfLayers, //number of replica
LayerThickness); //witdth of replica
else
physiLayer = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicLayer, //its logical volume
"Layer", //its name
logicLayer, //its logical volume
physiCalor, //its mother volume
logicCalor, //its mother volume
false, //no boolean operation
0); //copy number
}
@@ -316,7 +189,7 @@ G4VPhysicalVolume* AnaEx01DetectorConstruction::ConstructCalorimeter()
//
// Absorber
//
solidAbsorber=NULL; logicAbsorber=NULL; physiAbsorber=NULL;
solidAbsorber=0; logicAbsorber=0; physiAbsorber=0;
if (AbsorberThickness > 0.)
{ solidAbsorber = new G4Box("Absorber", //its name
@@ -324,13 +197,13 @@ G4VPhysicalVolume* AnaEx01DetectorConstruction::ConstructCalorimeter()
logicAbsorber = new G4LogicalVolume(solidAbsorber, //its solid
AbsorberMaterial, //its material
"Absorber"); //its name
AbsorberMaterial->GetName()); //name
physiAbsorber = new G4PVPlacement(0, //no rotation
G4ThreeVector(-GapThickness/2,0.,0.), //its position
"Absorber", //its name
logicAbsorber, //its logical volume
physiLayer, //its mother
logicAbsorber, //its logical volume
AbsorberMaterial->GetName(), //its name
logicLayer, //its mother
false, //no boulean operat
0); //copy number
@@ -339,7 +212,7 @@ G4VPhysicalVolume* AnaEx01DetectorConstruction::ConstructCalorimeter()
//
// Gap
//
solidGap=NULL; logicGap=NULL; physiGap=NULL;
solidGap=0; logicGap=0; physiGap=0;
if (GapThickness > 0.)
{ solidGap = new G4Box("Gap",
@@ -347,50 +220,37 @@ G4VPhysicalVolume* AnaEx01DetectorConstruction::ConstructCalorimeter()
logicGap = new G4LogicalVolume(solidGap,
GapMaterial,
"Gap");
GapMaterial->GetName());
physiGap = new G4PVPlacement(0, //no rotation
G4ThreeVector(AbsorberThickness/2,0.,0.), //its position
"Gap", //its name
logicGap, //its logical volume
physiLayer, //its mother
logicGap, //its logical volume
GapMaterial->GetName(), //its name
logicLayer, //its mother
false, //no boulean operat
0); //copy number
}
//
// Sensitive Detectors: Absorber and Gap
//
G4SDManager* SDman = G4SDManager::GetSDMpointer();
if(!calorimeterSD)
{
calorimeterSD = new AnaEx01CalorimeterSD("CalorSD",this);
SDman->AddNewDetector( calorimeterSD );
}
if (logicAbsorber)
logicAbsorber->SetSensitiveDetector(calorimeterSD);
if (logicGap)
logicGap ->SetSensitiveDetector(calorimeterSD);
}
PrintCalorParameters();
//
// Visualization attributes
//
logicWorld->SetVisAttributes (G4VisAttributes::Invisible);
G4VisAttributes* simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
simpleBoxVisAtt->SetVisibility(true);
logicCalor->SetVisAttributes(simpleBoxVisAtt);
//
//always return the physical World
//
PrintCalorParameters();
return physiWorld;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AnaEx01DetectorConstruction::PrintCalorParameters()
void DetectorConstruction::PrintCalorParameters()
{
G4cout << "\n------------------------------------------------------------"
<< "\n---> The calorimeter is " << NbOfLayers << " layers of: [ "
@@ -400,88 +260,64 @@ void AnaEx01DetectorConstruction::PrintCalorParameters()
<< "\n------------------------------------------------------------\n";
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AnaEx01DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
void DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial)
{AbsorberMaterial = pttoMaterial;
logicAbsorber->SetMaterial(pttoMaterial);
PrintCalorParameters();
}
G4Material* pttoMaterial =
G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
if (pttoMaterial) AbsorberMaterial = pttoMaterial;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AnaEx01DetectorConstruction::SetGapMaterial(G4String materialChoice)
void DetectorConstruction::SetGapMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial)
{GapMaterial = pttoMaterial;
logicGap->SetMaterial(pttoMaterial);
PrintCalorParameters();
}
// search the material by its name
G4Material* pttoMaterial =
G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
if (pttoMaterial) GapMaterial = pttoMaterial;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AnaEx01DetectorConstruction::SetAbsorberThickness(G4double val)
void DetectorConstruction::SetAbsorberThickness(G4double val)
{
// change Absorber thickness and recompute the calorimeter parameters
AbsorberThickness = val;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AnaEx01DetectorConstruction::SetGapThickness(G4double val)
void DetectorConstruction::SetGapThickness(G4double val)
{
// change Gap thickness and recompute the calorimeter parameters
GapThickness = val;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AnaEx01DetectorConstruction::SetCalorSizeYZ(G4double val)
void DetectorConstruction::SetCalorSizeYZ(G4double val)
{
// change the transverse size and recompute the calorimeter parameters
CalorSizeYZ = val;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AnaEx01DetectorConstruction::SetNbOfLayers(G4int val)
void DetectorConstruction::SetNbOfLayers(G4int val)
{
NbOfLayers = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AnaEx01DetectorConstruction::SetMagField(G4double fieldValue)
{
//apply a global uniform magnetic field along Z axis
G4FieldManager* fieldMgr
= G4TransportationManager::GetTransportationManager()->GetFieldManager();
if(magField) delete magField; //delete the existing magn field
if(fieldValue!=0.) // create a new one if non nul
{ magField = new G4UniformMagField(G4ThreeVector(0.,0.,fieldValue));
fieldMgr->SetDetectorField(magField);
fieldMgr->CreateChordFinder(magField);
} else {
magField = NULL;
fieldMgr->SetDetectorField(magField);
}
}
#include "G4RunManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorConstruction::UpdateGeometry()
void DetectorConstruction::UpdateGeometry()
{
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,121 +24,115 @@
// ********************************************************************
//
//
// $Id: AnaEx01DetectorMessenger.cc,v 1.5 2006/06/29 16:33:51 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: DetectorMessenger.cc,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "AnaEx01DetectorMessenger.hh"
#include "DetectorMessenger.hh"
#include "AnaEx01DetectorConstruction.hh"
#include "DetectorConstruction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithoutParameter.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
AnaEx01DetectorMessenger::AnaEx01DetectorMessenger(AnaEx01DetectorConstruction * AnaEx01Det)
:AnaEx01Detector(AnaEx01Det)
DetectorMessenger::DetectorMessenger( DetectorConstruction* Det)
:Detector(Det)
{
AnaEx01detDir = new G4UIdirectory("/calor/");
AnaEx01detDir->SetGuidance("AnaEx01 detector control.");
AbsMaterCmd = new G4UIcmdWithAString("/calor/setAbsMat",this);
N03Dir = new G4UIdirectory("/N03/");
N03Dir->SetGuidance("UI commands of this example");
detDir = new G4UIdirectory("/N03/det/");
detDir->SetGuidance("detector control");
AbsMaterCmd = new G4UIcmdWithAString("/N03/det/setAbsMat",this);
AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
AbsMaterCmd->SetParameterName("choice",false);
AbsMaterCmd->AvailableForStates(G4State_Idle);
AbsMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
GapMaterCmd = new G4UIcmdWithAString("/calor/setGapMat",this);
GapMaterCmd = new G4UIcmdWithAString("/N03/det/setGapMat",this);
GapMaterCmd->SetGuidance("Select Material of the Gap.");
GapMaterCmd->SetParameterName("choice",false);
GapMaterCmd->AvailableForStates(G4State_Idle);
GapMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsThick",this);
AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setAbsThick",this);
AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
AbsThickCmd->SetParameterName("Size",false);
AbsThickCmd->SetRange("Size>=0.");
AbsThickCmd->SetUnitCategory("Length");
AbsThickCmd->AvailableForStates(G4State_Idle);
AbsThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
GapThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setGapThick",this);
GapThickCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setGapThick",this);
GapThickCmd->SetGuidance("Set Thickness of the Gap");
GapThickCmd->SetParameterName("Size",false);
GapThickCmd->SetRange("Size>=0.");
GapThickCmd->SetUnitCategory("Length");
GapThickCmd->AvailableForStates(G4State_Idle);
GapThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
SizeYZCmd = new G4UIcmdWithADoubleAndUnit("/calor/setSizeYZ",this);
SizeYZCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setSizeYZ",this);
SizeYZCmd->SetGuidance("Set tranverse size of the calorimeter");
SizeYZCmd->SetParameterName("Size",false);
SizeYZCmd->SetRange("Size>0.");
SizeYZCmd->SetUnitCategory("Length");
SizeYZCmd->AvailableForStates(G4State_Idle);
SizeYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
NbLayersCmd = new G4UIcmdWithAnInteger("/calor/setNbOfLayers",this);
NbLayersCmd = new G4UIcmdWithAnInteger("/N03/det/setNbOfLayers",this);
NbLayersCmd->SetGuidance("Set number of layers.");
NbLayersCmd->SetParameterName("NbLayers",false);
NbLayersCmd->SetRange("NbLayers>0 && NbLayers<500");
NbLayersCmd->AvailableForStates(G4State_Idle);
NbLayersCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
UpdateCmd = new G4UIcmdWithoutParameter("/calor/update",this);
UpdateCmd = new G4UIcmdWithoutParameter("/N03/det/update",this);
UpdateCmd->SetGuidance("Update calorimeter geometry.");
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
UpdateCmd->AvailableForStates(G4State_Idle);
MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/calor/setField",this);
MagFieldCmd->SetGuidance("Define magnetic field.");
MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
MagFieldCmd->SetParameterName("Bz",false);
MagFieldCmd->SetUnitCategory("Magnetic flux density");
MagFieldCmd->AvailableForStates(G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
AnaEx01DetectorMessenger::~AnaEx01DetectorMessenger()
DetectorMessenger::~DetectorMessenger()
{
delete NbLayersCmd;
delete AbsMaterCmd; delete GapMaterCmd;
delete AbsThickCmd; delete GapThickCmd;
delete SizeYZCmd; delete UpdateCmd;
delete MagFieldCmd;
delete AnaEx01detDir;
delete detDir;
delete N03Dir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AnaEx01DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if( command == AbsMaterCmd )
{ AnaEx01Detector->SetAbsorberMaterial(newValue);}
{ Detector->SetAbsorberMaterial(newValue);}
if( command == GapMaterCmd )
{ AnaEx01Detector->SetGapMaterial(newValue);}
{ Detector->SetGapMaterial(newValue);}
if( command == AbsThickCmd )
{ AnaEx01Detector->SetAbsorberThickness(AbsThickCmd->GetNewDoubleValue(newValue));}
{ Detector->SetAbsorberThickness(AbsThickCmd
->GetNewDoubleValue(newValue));}
if( command == GapThickCmd )
{ AnaEx01Detector->SetGapThickness(GapThickCmd->GetNewDoubleValue(newValue));}
{ Detector->SetGapThickness(GapThickCmd->GetNewDoubleValue(newValue));}
if( command == SizeYZCmd )
{ AnaEx01Detector->SetCalorSizeYZ(SizeYZCmd->GetNewDoubleValue(newValue));}
{ Detector->SetCalorSizeYZ(SizeYZCmd->GetNewDoubleValue(newValue));}
if( command == NbLayersCmd )
{ AnaEx01Detector->SetNbOfLayers(NbLayersCmd->GetNewIntValue(newValue));}
{ Detector->SetNbOfLayers(NbLayersCmd->GetNewIntValue(newValue));}
if( command == UpdateCmd )
{ AnaEx01Detector->UpdateGeometry(); }
if( command == MagFieldCmd )
{ AnaEx01Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
{ Detector->UpdateGeometry(); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,91 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: EventAction.cc,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "EventAction.hh"
#include "RunAction.hh"
#include "HistoManager.hh"
#include "G4Event.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventAction::EventAction(RunAction* run, HistoManager* histo)
:runAct(run),histoManager(histo)
{
printModulo = 100; }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventAction::~EventAction()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::BeginOfEventAction(const G4Event* evt)
{
G4int evtNb = evt->GetEventID();
if (evtNb%printModulo == 0)
G4cout << "\n---> Begin of event: " << evtNb << G4endl;
// initialisation per event
EnergyAbs = EnergyGap = 0.;
TrackLAbs = TrackLGap = 0.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::EndOfEventAction(const G4Event*)
{
//accumulates statistic
//
runAct->fillPerEvent(EnergyAbs, EnergyGap, TrackLAbs, TrackLGap);
//fill histograms
//
histoManager->FillHisto(1, EnergyAbs);
histoManager->FillHisto(2, EnergyGap);
histoManager->FillHisto(3, TrackLAbs);
histoManager->FillHisto(4, TrackLGap);
//fill ntuple
//
histoManager->FillNtuple(0, EnergyAbs);
histoManager->FillNtuple(1, EnergyGap);
histoManager->FillNtuple(2, TrackLAbs);
histoManager->FillNtuple(3, TrackLGap);
histoManager->AddRowNtuple();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,239 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: HistoManager.cc,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "HistoManager.hh"
#include "G4UnitsTable.hh"
#ifdef G4ANALYSIS_USE
#include "AIDA/AIDA.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::HistoManager()
:af(0),tree(0)
{
#ifdef G4ANALYSIS_USE
// Creating the analysis factory
//
af = AIDA_createAnalysisFactory();
if(!af) {
G4cout << " HistoManager::HistoManager :"
<< " problem creating the AIDA analysis factory."
<< G4endl;
}
#endif
// histograms
for (G4int k=0; k<MaxHisto; k++) histo[k] = 0;
// ntuple
ntupl = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::~HistoManager()
{
#ifdef G4ANALYSIS_USE
delete af;
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::book()
{
#ifdef G4ANALYSIS_USE
if(!af) return;
// Creating a tree container to handle histograms and ntuples.
// This tree is associated to an output file.
//
G4String fileName = "AnaEx01";
G4String fileType = "root"; // hbook root xml
G4String fileOption = " ";
//// G4String fileOption = "uncompress compress=no"; //for xml
//// G4String fileOption = "--noErrors"; //for hbook
fileName = fileName + "." + fileType;
G4bool readOnly = false;
G4bool createNew = true;
AIDA::ITreeFactory* tf = af->createTreeFactory();
tree = tf->create(fileName, fileType, readOnly, createNew, fileOption);
delete tf;
if(!tree) {
G4cout << " HistoManager::book :"
<< " problem creating the AIDA tree with "
<< " storeName = " << fileName
<< " storeType = " << fileType
<< " readOnly = " << readOnly
<< " createNew = " << createNew
<< " options = " << fileOption
<< G4endl;
return;
}
// Creating a histogram factory, whose histograms will be handled by the tree
//
AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
// create histos in subdirectory "histograms"
//
tree->mkdir("histograms");
tree->cd("histograms");
histo[1] = hf->createHistogram1D("1", "Edep in absorber", 100, 0., 800*MeV);
if (!histo[1]) G4cout << "\n can't create histo 1" << G4endl;
histo[2] = hf->createHistogram1D("2", "Edep in gap", 100, 0., 100*MeV);
if (!histo[2]) G4cout << "\n can't create histo 2" << G4endl;
histo[3] = hf->createHistogram1D("3", "trackL in absorber", 100, 0., 1*m);
if (!histo[3]) G4cout << "\n can't create histo 3" << G4endl;
histo[4] = hf->createHistogram1D("4", "trackL in gap", 100, 0., 50*cm);
if (!histo[4]) G4cout << "\n can't create histo 4" << G4endl;
delete hf;
tree->cd("..");
// Creating a ntuple factory, handled by the tree
//
AIDA::ITupleFactory* ntf = af->createTupleFactory(*tree);
// create 1 ntuple in subdirectory "tuples"
//
tree->mkdir("tuples");
tree->cd("tuples");
ntupl = ntf->create("101", "Edep and TrackL", "double Eabs, Egap, Labs, Lgap");
delete ntf;
tree->cd("..");
G4cout << "\n----> Histogram Tree is opened in " << fileName << G4endl;
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::save()
{
#ifdef G4ANALYSIS_USE
if (af && tree) {
tree->commit(); // Writing the histograms to the file
tree->close(); // and closing the tree (and the file)
G4cout << "\n----> Histogram Tree is saved \n" << G4endl;
delete tree;
tree = 0;
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::FillHisto(G4int ih, G4double xbin, G4double weight)
{
if (ih >= MaxHisto) {
G4cout << "---> warning from HistoManager::FillHisto() : histo " << ih
<< " does not exist. (xbin=" << xbin << " weight=" << weight << ")"
<< G4endl;
return;
}
#ifdef G4ANALYSIS_USE
if (histo[ih]) histo[ih]->fill(xbin, weight);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::Normalize(G4int ih, G4double fac)
{
if (ih >= MaxHisto) {
G4cout << "---> warning from HistoManager::Normalize() : histo " << ih
<< " does not exist. (fac=" << fac << ")" << G4endl;
return;
}
#ifdef G4ANALYSIS_USE
if (histo[ih]) histo[ih]->scale(fac);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::FillNtuple(G4int column, G4double value)
{
if (column > 3) {
G4cout << "---> warning from HistoManager::FillNtuple : "
<< "column=" << column << " value=" << value << G4endl;
return;
}
#ifdef G4ANALYSIS_USE
if (ntupl) ntupl->fill(column, value);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::AddRowNtuple()
{
#ifdef G4ANALYSIS_USE
if (ntupl) ntupl->addRow();
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::PrintStatistic()
{
#ifdef G4ANALYSIS_USE
if(histo[1]) {
G4cout << "\n ----> print histograms statistic \n" << G4endl;
G4cout
<< " EAbs : mean = " << G4BestUnit(histo[1]->mean(), "Energy")
<< " rms = " << G4BestUnit(histo[1]->rms(), "Energy") << G4endl;
G4cout
<< " EGap : mean = " << G4BestUnit(histo[2]->mean(), "Energy")
<< " rms = " << G4BestUnit(histo[2]->rms(), "Energy") << G4endl;
G4cout
<< " LAbs : mean = " << G4BestUnit(histo[3]->mean(), "Length")
<< " rms = " << G4BestUnit(histo[3]->rms(), "Length") << G4endl;
G4cout
<< " LGap : mean = " << G4BestUnit(histo[4]->mean(), "Length")
<< " rms = " << G4BestUnit(histo[4]->rms(), "Length") << G4endl;
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,115 +24,70 @@
// ********************************************************************
//
//
// $Id: ExN03PhysicsList.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: PhysicsList.cc,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN03PhysicsList.hh"
#include "PhysicsList.hh"
#include "G4ProcessManager.hh"
#include "G4ParticleTypes.hh"
#include "G4BosonConstructor.hh"
#include "G4LeptonConstructor.hh"
#include "G4MesonConstructor.hh"
#include "G4BosonConstructor.hh"
#include "G4BaryonConstructor.hh"
#include "G4IonConstructor.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03PhysicsList::ExN03PhysicsList(): G4VUserPhysicsList()
PhysicsList::PhysicsList(): G4VUserPhysicsList()
{
defaultCutValue = 1.0*mm;
SetVerboseLevel(1);
defaultCutValue = 1.0*mm;
SetVerboseLevel(0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03PhysicsList::~ExN03PhysicsList()
PhysicsList::~PhysicsList()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03PhysicsList::ConstructParticle()
void PhysicsList::ConstructParticle()
{
// In this method, static member functions should be called
// for all particles which you want to use.
// This ensures that objects of these particle types will be
// created in the program.
ConstructBosons();
ConstructLeptons();
ConstructMesons();
ConstructBaryons();
G4BosonConstructor pBosonConstructor;
pBosonConstructor.ConstructParticle();
G4LeptonConstructor pLeptonConstructor;
pLeptonConstructor.ConstructParticle();
G4MesonConstructor pMesonConstructor;
pMesonConstructor.ConstructParticle();
G4BaryonConstructor pBaryonConstructor;
pBaryonConstructor.ConstructParticle();
G4IonConstructor pIonConstructor;
pIonConstructor.ConstructParticle();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03PhysicsList::ConstructBosons()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03PhysicsList::ConstructLeptons()
{
// leptons
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03PhysicsList::ConstructMesons()
{
// mesons
G4PionPlus::PionPlusDefinition();
G4PionMinus::PionMinusDefinition();
G4PionZero::PionZeroDefinition();
G4Eta::EtaDefinition();
G4EtaPrime::EtaPrimeDefinition();
G4KaonPlus::KaonPlusDefinition();
G4KaonMinus::KaonMinusDefinition();
G4KaonZero::KaonZeroDefinition();
G4AntiKaonZero::AntiKaonZeroDefinition();
G4KaonZeroLong::KaonZeroLongDefinition();
G4KaonZeroShort::KaonZeroShortDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03PhysicsList::ConstructBaryons()
{
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
G4Neutron::NeutronDefinition();
G4AntiNeutron::AntiNeutronDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03PhysicsList::ConstructProcess()
void PhysicsList::ConstructProcess()
{
AddTransportation();
ConstructEM();
ConstructGeneral();
ConstructDecay();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -141,21 +96,26 @@ void ExN03PhysicsList::ConstructProcess()
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh"
#include "G4eMultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuMultipleScattering.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hMultipleScattering.hh"
#include "G4hIonisation.hh"
#include "G4hBremsstrahlung.hh"
#include "G4hPairProduction.hh"
#include "G4ionIonisation.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03PhysicsList::ConstructEM()
void PhysicsList::ConstructEM()
{
theParticleIterator->reset();
while( (*theParticleIterator)() ){
@@ -171,32 +131,52 @@ void ExN03PhysicsList::ConstructEM()
} else if (particleName == "e-") {
//electron
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
pmanager->AddProcess(new G4eMultipleScattering,-1, 1, 1);
pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
} else if (particleName == "e+") {
//positron
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);
pmanager->AddProcess(new G4eMultipleScattering,-1, 1, 1);
pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4);
} else if( particleName == "mu+" ||
particleName == "mu-" ) {
//muon
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
pmanager->AddProcess(new G4MuIonisation, -1, 2,2);
pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);
pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);
pmanager->AddProcess(new G4MuMultipleScattering,-1, 1, 1);
pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4);
} else if( particleName == "proton" ||
particleName == "pi-" ||
particleName == "pi+" ) {
//proton
pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
} else if ((!particle->IsShortLived()) &&
} else if( particleName == "alpha" ||
particleName == "He3" ) {
//alpha
pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
} else if( particleName == "GenericIon" ) {
//Ions
pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
} else if ((!particle->IsShortLived()) &&
(particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")) {
//all others charged particles except geantino
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
pmanager->AddProcess(new G4hIonisation, -1, 2,2);
}
pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
}
}
}
@@ -204,10 +184,10 @@ void ExN03PhysicsList::ConstructEM()
#include "G4Decay.hh"
void ExN03PhysicsList::ConstructGeneral()
void PhysicsList::ConstructDecay()
{
// Add Decay Process
G4Decay* theDecayProcess = new G4Decay();
G4Decay* theDecayProcess = new G4Decay();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
@@ -223,10 +203,10 @@ void ExN03PhysicsList::ConstructGeneral()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03PhysicsList::SetCuts()
void PhysicsList::SetCuts()
{
if (verboseLevel >0){
G4cout << "ExN03PhysicsList::SetCuts:";
G4cout << "PhysicsList::SetCuts:";
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
}
@@ -236,6 +216,7 @@ void ExN03PhysicsList::SetCuts()
SetCutValue(defaultCutValue, "gamma");
SetCutValue(defaultCutValue, "e-");
SetCutValue(defaultCutValue, "e+");
SetCutValue(defaultCutValue, "proton");
if (verboseLevel>0) DumpCutValuesTable();
}
@@ -24,36 +24,29 @@
// ********************************************************************
//
//
// $Id: AnaEx01PrimaryGeneratorAction.cc,v 1.5 2006/06/29 16:33:57 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: PrimaryGeneratorAction.cc,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "PrimaryGeneratorAction.hh"
#include "AnaEx01PrimaryGeneratorAction.hh"
#include "AnaEx01DetectorConstruction.hh"
#include "AnaEx01PrimaryGeneratorMessenger.hh"
#include "DetectorConstruction.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "Randomize.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
AnaEx01PrimaryGeneratorAction::AnaEx01PrimaryGeneratorAction(
AnaEx01DetectorConstruction* AnaEx01DC)
:AnaEx01Detector(AnaEx01DC),rndmFlag("off")
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* DC)
:Detector(DC)
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
//create a messenger for this class
gunMessenger = new AnaEx01PrimaryGeneratorMessenger(this);
// default particle kinematic
@@ -63,36 +56,27 @@ AnaEx01PrimaryGeneratorAction::AnaEx01PrimaryGeneratorAction(
= particleTable->FindParticle(particleName="e-");
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
particleGun->SetParticleEnergy(30.*MeV);
G4double position = -0.5*(AnaEx01Detector->GetWorldSizeX());
particleGun->SetParticleEnergy(500.*MeV);
G4double position = -0.5*(Detector->GetWorldSizeX());
particleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
AnaEx01PrimaryGeneratorAction::~AnaEx01PrimaryGeneratorAction()
PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
delete particleGun;
delete gunMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AnaEx01PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
//this function is called at the begining of event
//
G4double x0 = -0.5*(AnaEx01Detector->GetWorldSizeX());
G4double y0 = 0.*cm, z0 = 0.*cm;
if (rndmFlag == "on")
{y0 = (AnaEx01Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
z0 = (AnaEx01Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
}
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
particleGun->GeneratePrimaryVertex(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,130 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: RunAction.cc,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RunAction.hh"
#include "HistoManager.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::RunAction(HistoManager* histo)
:histoManager(histo)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::~RunAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
//initialize cumulative quantities
//
sumEAbs = sum2EAbs =sumEGap = sum2EGap = 0.;
sumLAbs = sum2LAbs =sumLGap = sum2LGap = 0.;
//histograms
//
histoManager->book();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::fillPerEvent(G4double EAbs, G4double EGap,
G4double LAbs, G4double LGap)
{
//accumulate statistic
//
sumEAbs += EAbs; sum2EAbs += EAbs*EAbs;
sumEGap += EGap; sum2EGap += EGap*EGap;
sumLAbs += LAbs; sum2LAbs += LAbs*LAbs;
sumLGap += LGap; sum2LGap += LGap*LGap;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::EndOfRunAction(const G4Run* aRun)
{
G4int NbOfEvents = aRun->GetNumberOfEvent();
if (NbOfEvents == 0) return;
//compute statistics: mean and rms
//
sumEAbs /= NbOfEvents; sum2EAbs /= NbOfEvents;
G4double rmsEAbs = sum2EAbs - sumEAbs*sumEAbs;
if (rmsEAbs >0.) rmsEAbs = std::sqrt(rmsEAbs); else rmsEAbs = 0.;
sumEGap /= NbOfEvents; sum2EGap /= NbOfEvents;
G4double rmsEGap = sum2EGap - sumEGap*sumEGap;
if (rmsEGap >0.) rmsEGap = std::sqrt(rmsEGap); else rmsEGap = 0.;
sumLAbs /= NbOfEvents; sum2LAbs /= NbOfEvents;
G4double rmsLAbs = sum2LAbs - sumLAbs*sumLAbs;
if (rmsLAbs >0.) rmsLAbs = std::sqrt(rmsLAbs); else rmsLAbs = 0.;
sumLGap /= NbOfEvents; sum2LGap /= NbOfEvents;
G4double rmsLGap = sum2LGap - sumLGap*sumLGap;
if (rmsLGap >0.) rmsLGap = std::sqrt(rmsLGap); else rmsLGap = 0.;
//print
//
G4cout
<< "\n--------------------End of Run------------------------------\n"
<< "\n mean Energy in Absorber : " << G4BestUnit(sumEAbs,"Energy")
<< " +- " << G4BestUnit(rmsEAbs,"Energy")
<< "\n mean Energy in Gap : " << G4BestUnit(sumEGap,"Energy")
<< " +- " << G4BestUnit(rmsEGap,"Energy")
<< G4endl;
G4cout
<< "\n mean trackLength in Absorber : " << G4BestUnit(sumLAbs,"Length")
<< " +- " << G4BestUnit(rmsLAbs,"Length")
<< "\n mean trackLength in Gap : " << G4BestUnit(sumLGap,"Length")
<< " +- " << G4BestUnit(rmsLGap,"Length")
<< "\n------------------------------------------------------------\n"
<< G4endl;
//save histograms
//
histoManager->PrintStatistic();
histoManager->save();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: SteppingAction.cc,v 1.1 2010/11/08 10:38:44 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "SteppingAction.hh"
#include "DetectorConstruction.hh"
#include "EventAction.hh"
#include "G4Step.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingAction::SteppingAction(DetectorConstruction* det,
EventAction* evt)
:detector(det), eventaction(evt)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingAction::~SteppingAction()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SteppingAction::UserSteppingAction(const G4Step* aStep)
{
// get volume of the current step
G4VPhysicalVolume* volume
= aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
// collect energy and track length step by step
G4double edep = aStep->GetTotalEnergyDeposit();
G4double stepl = 0.;
if (aStep->GetTrack()->GetDefinition()->GetPDGCharge() != 0.)
stepl = aStep->GetStepLength();
if (volume == detector->GetAbsorber()) eventaction->AddAbs(edep,stepl);
if (volume == detector->GetGap()) eventaction->AddGap(edep,stepl);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,76 @@
# Macro file for the initialization phase of "exampleN03.cc"
# when running in interactive mode
#
# Sets some default verbose
#
/control/verbose 2
/run/verbose 2
#
# Use this open statement to create an OpenGL view:
/vis/open OGL 600x600-0+0
#
# Use this open statement to create a .prim file suitable for
# viewing in DAWN:
#/vis/open DAWNFILE
#
# Use this open statement to create a .heprep file suitable for
# viewing in HepRApp:
#/vis/open HepRepFile
#
# Use this open statement to create a .wrl file suitable for
# viewing in a VRML viewer:
#/vis/open VRML2FILE
#
# Disable auto refresh and quieten vis messages whilst scene and
# trajectories are established:
/vis/viewer/set/autoRefresh false
/vis/verbose errors
#
# Draw geometry:
/vis/drawVolume
#
# Specify view angle:
#/vis/viewer/set/viewpointThetaPhi 90. 0.
#
# Specify zoom value:
#/vis/viewer/zoom 2.
#
# Specify style (surface or wireframe):
#/vis/viewer/set/style wireframe
#
# Draw coordinate axes:
#/vis/scene/add/axes 0 0 0 1 m
#
# Draw smooth trajectories at end of event, showing trajectory points
# as markers 2 pixels wide:
/vis/scene/add/trajectories smooth
/vis/modeling/trajectories/create/drawByCharge
/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
# (if too many tracks cause core dump => /tracking/storeTrajectory 0)
#
# Draw hits at end of event:
#/vis/scene/add/hits
#
# To draw only gammas:
#/vis/filtering/trajectories/create/particleFilter
#/vis/filtering/trajectories/particleFilter-0/add gamma
#
# To invert the above, drawing all particles except gammas,
# keep the above two lines but also add:
#/vis/filtering/trajectories/particleFilter-0/invert true
#
# Many other options are available with /vis/modeling and /vis/filtering.
# For example, to select colour by particle ID:
#/vis/modeling/trajectories/create/drawByParticleID
#/vis/modeling/trajectories/drawByParticleID-0/set e- blue
#
# To superimpose all of the events from a given run:
/vis/scene/endOfEventAction accumulate
#
# Re-establish auto refreshing and verbosity:
/vis/viewer/set/autoRefresh true
/vis/verbose warnings
#
# For file-based drivers, use this to create an empty detector view:
#/vis/viewer/flush
+5 -3
View File
@@ -1,15 +1,17 @@
$Id: History,v 1.2 2005/05/03 10:05:48 allison Exp $
$Id: History,v 1.3 2010/11/08 11:31:23 maire Exp $
-------------------------------------------------------------------
=========================================================
A01 History File
Analysis History File
=========================================================
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
---------------------------------------------------------------------------
8rd November 2010 Michel Maire
- add README
3rd May 2005 John Allison (examples-V07-00-03)
- Replaced vis manager with G4VisExecutive.
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.1 2007/05/26 00:18:27 tkoi Exp $
# $Id: GNUmakefile,v 1.2 2010/01/11 16:22:59 gcosmo Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -8,7 +8,7 @@ G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../..
G4INSTALL = ../../../..
endif
.PHONY: all
+14 -1
View File
@@ -13,7 +13,20 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
12-11-10 mma (exampleN03Con-V09-03-03)
- change classe mames : suppress ExN03
- DetectorConstruction : introduce nist materials
- add vis.mac
12-10-10 G. Cosmo exampleN03Con-V09-03-02
- Moved G4ConvergenceTester to kernel inside global/HEPNumerics.
12-05-10 J. Allison exampleN03Con-V09-03-01
- Introduced G4UIExecutive.
31-03-10 T. Koi exampleN03Con-V09-03-00
- Updated physics-list as in exampleN03.
25-05-07 T. Koi exampleN03Con-V08-03-01
- Created.
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: exampleN03Con.cc,v 1.2 2007/05/26 00:24:09 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: exampleN03Con.cc,v 1.5 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -33,30 +33,24 @@
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#ifdef G4UI_USE_XM
#include "G4UIXm.hh"
#endif
#ifdef G4UI_USE_WIN32
#include "G4UIWin32.hh"
#endif
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
#include "EventAction.hh"
#include "SteppingAction.hh"
#include "SteppingVerbose.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
#include "ExN03DetectorConstruction.hh"
#include "ExN03PhysicsList.hh"
#include "ExN03PrimaryGeneratorAction.hh"
#include "ExN03RunAction.hh"
#include "ExN03EventAction.hh"
#include "ExN03SteppingAction.hh"
#include "ExN03SteppingVerbose.hh"
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -68,8 +62,7 @@ int main(int argc,char** argv)
// User Verbose output class
//
G4VSteppingVerbose* verbosity = new ExN03SteppingVerbose;
G4VSteppingVerbose::SetInstance(verbosity);
G4VSteppingVerbose::SetInstance(new SteppingVerbose);
// Construct the default run manager
//
@@ -77,92 +70,71 @@ int main(int argc,char** argv)
// Set mandatory initialization classes
//
ExN03DetectorConstruction* detector = new ExN03DetectorConstruction;
DetectorConstruction* detector = new DetectorConstruction;
runManager->SetUserInitialization(detector);
//
G4VUserPhysicsList* physics = new ExN03PhysicsList;
PhysicsList* physics = new PhysicsList;
runManager->SetUserInitialization(physics);
G4UIsession* session=0;
if (argc==1) // Define UI session for interactive mode.
{
// G4UIterminal is a (dumb) terminal
//
#if defined(G4UI_USE_XM)
session = new G4UIXm(argc,argv);
#elif defined(G4UI_USE_WIN32)
session = new G4UIWin32();
#elif defined(G4UI_USE_TCSH)
session = new G4UIterminal(new G4UItcsh);
#else
session = new G4UIterminal();
#endif
}
#ifdef G4VIS_USE
// Visualization manager
//
G4VisManager* visManager = new G4VisExecutive;
visManager->Initialize();
#endif
// Set user action classes
//
G4VUserPrimaryGeneratorAction* gen_action = new ExN03PrimaryGeneratorAction(detector);
PrimaryGeneratorAction* gen_action =
new PrimaryGeneratorAction(detector);
runManager->SetUserAction(gen_action);
//
ExN03RunAction* run_action = new ExN03RunAction;
RunAction* run_action = new RunAction;
runManager->SetUserAction(run_action);
//
ExN03EventAction* event_action = new ExN03EventAction(run_action);
EventAction* event_action = new EventAction(run_action);
runManager->SetUserAction(event_action);
//
G4UserSteppingAction* stepping_action =
new ExN03SteppingAction(detector, event_action);
SteppingAction* stepping_action =
new SteppingAction(detector, event_action);
runManager->SetUserAction(stepping_action);
// Initialize G4 kernel
//
runManager->Initialize();
#ifdef G4VIS_USE
// Initialize visualization
//
G4VisManager* visManager = new G4VisExecutive;
visManager->Initialize();
#endif
// Get the pointer to the User Interface manager
//
G4UImanager* UI = G4UImanager::GetUIpointer();
if (session) // Define UI session for interactive mode
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if (argc!=1) // batch mode
{
// G4UIterminal is a (dumb) terminal
//
// UI->ApplyCommand("/control/execute vis.mac");
#if defined(G4UI_USE_XM) || defined(G4UI_USE_WIN32)
// Customize the G4UIXm,Win32 menubar with a macro file
//
// UI->ApplyCommand("/control/execute visTutor/gui.mac");
#endif
session->SessionStart();
delete session;
}
else // Batch mode
{
#ifdef G4VIS_USE
visManager->SetVerboseLevel("quiet");
#endif
G4String command = "/control/execute ";
G4String fileName = argv[1];
UI->ApplyCommand(command+fileName);
UImanager->ApplyCommand(command+fileName);
}
else
{ // interactive mode : define UI session
#ifdef G4UI_USE
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
#ifdef G4VIS_USE
UImanager->ApplyCommand("/control/execute vis.mac");
#endif
if (ui->IsGUI())
UImanager->ApplyCommand("/control/execute visTutor/gui.mac");
ui->SessionStart();
delete ui;
#endif
}
// Job termination
// Free the store: user actions, physics_list and detector_description are
// owned and deleted by the run manager, so they should not
// be deleted in the main() program !
#ifdef G4VIS_USE
delete visManager;
#endif
#endif
delete runManager;
delete verbosity;
return 0;
}
@@ -24,16 +24,16 @@
// ********************************************************************
//
//
// $Id: ExN03DetectorConstruction.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: DetectorConstruction.hh,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef ExN03DetectorConstruction_h
#define ExN03DetectorConstruction_h 1
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
@@ -43,16 +43,16 @@ class G4LogicalVolume;
class G4VPhysicalVolume;
class G4Material;
class G4UniformMagField;
class ExN03DetectorMessenger;
class DetectorMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class ExN03DetectorConstruction : public G4VUserDetectorConstruction
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
ExN03DetectorConstruction();
~ExN03DetectorConstruction();
DetectorConstruction();
~DetectorConstruction();
public:
@@ -133,7 +133,7 @@ class ExN03DetectorConstruction : public G4VUserDetectorConstruction
G4UniformMagField* magField; //pointer to the magnetic field
ExN03DetectorMessenger* detectorMessenger; //pointer to the Messenger
DetectorMessenger* detectorMessenger; //pointer to the Messenger
private:
@@ -144,7 +144,7 @@ class ExN03DetectorConstruction : public G4VUserDetectorConstruction
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline void ExN03DetectorConstruction::ComputeCalorParameters()
inline void DetectorConstruction::ComputeCalorParameters()
{
// Compute derived parameters of the calorimeter
LayerThickness = AbsorberThickness + GapThickness;
@@ -24,21 +24,21 @@
// ********************************************************************
//
//
// $Id: ExN03DetectorMessenger.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: DetectorMessenger.hh,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef ExN03DetectorMessenger_h
#define ExN03DetectorMessenger_h 1
#ifndef DetectorMessenger_h
#define DetectorMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class ExN03DetectorConstruction;
class DetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
@@ -47,16 +47,16 @@ class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class ExN03DetectorMessenger: public G4UImessenger
class DetectorMessenger: public G4UImessenger
{
public:
ExN03DetectorMessenger(ExN03DetectorConstruction* );
~ExN03DetectorMessenger();
DetectorMessenger(DetectorConstruction* );
~DetectorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
ExN03DetectorConstruction* ExN03Detector;
DetectorConstruction* Detector;
G4UIdirectory* N03Dir;
G4UIdirectory* detDir;
@@ -24,49 +24,48 @@
// ********************************************************************
//
//
// $Id: ExN03EventAction.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: EventAction.hh,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef ExN03EventAction_h
#define ExN03EventAction_h 1
#ifndef EventAction_h
#define EventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
class ExN03RunAction;
class ExN03EventActionMessenger;
class RunAction;
class EventActionMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class ExN03EventAction : public G4UserEventAction
class EventAction : public G4UserEventAction
{
public:
ExN03EventAction(ExN03RunAction*);
~ExN03EventAction();
public:
EventAction(RunAction*);
virtual ~EventAction();
public:
void BeginOfEventAction(const G4Event*);
void EndOfEventAction(const G4Event*);
void BeginOfEventAction(const G4Event*);
void EndOfEventAction(const G4Event*);
void AddAbs(G4double de, G4double dl) {EnergyAbs += de; TrackLAbs += dl;};
void AddGap(G4double de, G4double dl) {EnergyGap += de; TrackLGap += dl;};
void AddAbs(G4double de, G4double dl) {EnergyAbs += de; TrackLAbs += dl;};
void AddGap(G4double de, G4double dl) {EnergyGap += de; TrackLGap += dl;};
void SetPrintModulo(G4int val) {printModulo = val;};
void SetPrintModulo(G4int val) {printModulo = val;};
private:
ExN03RunAction* runAct;
private:
RunAction* runAct;
G4double EnergyAbs, EnergyGap;
G4double TrackLAbs, TrackLGap;
G4int printModulo;
ExN03EventActionMessenger* eventMessenger;
EventActionMessenger* eventMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,44 +23,41 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: ProcessesCount.hh,v 1.3 2006/06/29 16:45:22 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// $Id: EventActionMessenger.hh,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef ProcessesCount_HH
#define ProcessesCount_HH
#ifndef EventActionMessenger_h
#define EventActionMessenger_h 1
#include "globals.hh"
#include <vector>
#include "G4UImessenger.hh"
class EventAction;
class G4UIdirectory;
class G4UIcmdWithAnInteger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OneProcessCount
class EventActionMessenger: public G4UImessenger
{
public:
OneProcessCount(G4String name) {Name=name; Counter=0;};
~OneProcessCount() {};
public:
G4String GetName() {return Name;};
G4int GetCounter() {return Counter;};
void Count() {Counter++;};
EventActionMessenger(EventAction*);
virtual ~EventActionMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
G4String Name; // process name
G4int Counter; // process counter
EventAction* eventAction;
G4UIdirectory* eventDir;
G4UIcmdWithAnInteger* PrintCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
typedef std::vector<OneProcessCount*> ProcessesCount;
#endif
@@ -1,150 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// Convergence Tests for Monte Carlo resut.
//
// Reference
// MCNP(TM) -A General Monte Carlo N-Particle Transport Code
// Version 4B
// Judith F. Briesmeister, Editor
// LA-12625-M, Issued: March 1997, UC 705 and UC 700
// CHAPTER 2. GEOMETRY, DATA, PHYSICS, AND MATHEMATICS
// VI. ESTIMATION OF THE MONTE CARLO PRECISION
//
// Positives numbers are assumed for input values
//
// Koi, Tatsumi (SLAC/SCCS)
//
#ifndef G4ConvergenceTester
#define G4ConvergenceTester_h 1
#include "G4SimplexDownhill.hh"
#include "G4Timer.hh"
#include "globals.hh"
#include <map>
#include <vector>
class G4ConvergenceTester
{
public:
G4ConvergenceTester();
~G4ConvergenceTester();
G4ConvergenceTester( G4double );
public:
void AddScore( G4double );
void ShowHistory();
void ShowResult();
G4double GetValueOfMinimizingFunction( std::vector< G4double > x ){ return slope_fitting_function( x ); };
private:
void calStat();
G4double GetMean() { return mean; };
G4double GetStandardDeviation() { return sd; };
G4double GetVariance() { return var; };
G4double GetR() { return r; };
G4double GetEfficiency() { return efficiency; };
G4double GetR2eff() { return r2eff; };
G4double GetR2int() { return r2int; };
G4double GetShift() { return shift; };
G4double GetVOV() { return vov; };
G4double GetFOM() { return fom; };
std::map< G4int , G4double > nonzero_histories; // (ith-history , score value)
G4int n; // number of history;
G4double sum; // sum of scores;
G4Timer* timer;
std::vector<G4double> cpu_time;
private:
G4double mean;
G4double var;
G4double sd;
G4double r; // relative err sd/mean/sqrt(n)
G4double efficiency; // rate of non zero score
G4double r2eff;
G4double r2int;
G4double shift;
G4double vov;
G4double fom;
G4double largest;
G4int largest_score_happened;
G4double mean_1;
G4double var_1;
G4double sd_1;
G4double r_1; // relative err sd/mean/sqrt(n)
G4double shift_1;
G4double vov_1;
G4double fom_1;
void calc_grid_point_of_history();
void calc_stat_history();
G4int noBinOfHistory;
std::vector< G4int > history_grid;
std::vector< G4double > mean_history;
std::vector< G4double > var_history;
std::vector< G4double > sd_history;
std::vector< G4double > r_history;
std::vector< G4double > vov_history;
std::vector< G4double > fom_history;
std::vector< G4double > shift_history;
std::vector< G4double > e_history;
std::vector< G4double > r2eff_history;
std::vector< G4double > r2int_history;
void check_stat_history();
G4double calc_Pearson_r( G4int , std::vector<G4double> , std::vector<G4double> );
G4bool is_monotonically_decrease( std::vector<G4double> );
G4double slope;
std::vector< G4double > largest_scores;
void calc_slope_fit( std::vector< G4double > );
std::vector< G4double > f_xi;
std::vector< G4double > f_yi;
G4int noBinOfPDF;
G4SimplexDownhill<G4ConvergenceTester>* minimizer;
G4double slope_fitting_function( std::vector< G4double > );
G4int noPass;
G4int noTotal; // Total number of tests
};
#endif
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: PhysicsList.hh,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysicsList_h
#define PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysicsList: public G4VUserPhysicsList
{
public:
PhysicsList();
virtual ~PhysicsList();
// Construct particle and physics
void ConstructParticle();
void ConstructProcess();
void SetCuts();
private:
// these methods Construct physics processes and register them
void ConstructDecay();
void ConstructEM();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: PrimaryGeneratorAction.hh,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4ParticleGun;
class G4Event;
class DetectorConstruction;
class PrimaryGeneratorMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction(DetectorConstruction*);
virtual ~PrimaryGeneratorAction();
void GeneratePrimaries(G4Event*);
void SetRndmFlag(G4String val) { rndmFlag = val;}
private:
G4ParticleGun* particleGun; //pointer a to G4 class
DetectorConstruction* Detector; //pointer to the geometry
PrimaryGeneratorMessenger* gunMessenger; //messenger of this class
G4String rndmFlag; //flag for a rndm impact point
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: PrimaryGeneratorMessenger.hh,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PrimaryGeneratorMessenger_h
#define PrimaryGeneratorMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class PrimaryGeneratorAction;
class G4UIdirectory;
class G4UIcmdWithAString;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PrimaryGeneratorMessenger: public G4UImessenger
{
public:
PrimaryGeneratorMessenger(PrimaryGeneratorAction*);
virtual ~PrimaryGeneratorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
PrimaryGeneratorAction* Action;
G4UIdirectory* gunDir;
G4UIcmdWithAString* RndmCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: RunAction.hh,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef RunAction_h
#define RunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4Run;
class G4ConvergenceTester;
class RunAction : public G4UserRunAction
{
public:
RunAction();
virtual ~RunAction();
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
void fillPerEvent(G4double, G4double, G4double, G4double);
private:
G4double sumEAbs, sum2EAbs;
G4double sumEGap, sum2EGap;
G4double sumLAbs, sum2LAbs;
G4double sumLGap, sum2LGap;
G4ConvergenceTester* Eabs_tally;
G4ConvergenceTester* Egap_tally;
G4ConvergenceTester* Labs_tally;
G4ConvergenceTester* Lgap_tally;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: SteppingAction.hh,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef SteppingAction_h
#define SteppingAction_h 1
#include "G4UserSteppingAction.hh"
class DetectorConstruction;
class EventAction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class SteppingAction : public G4UserSteppingAction
{
public:
SteppingAction(DetectorConstruction*, EventAction*);
virtual ~SteppingAction();
void UserSteppingAction(const G4Step*);
private:
DetectorConstruction* detector;
EventAction* eventaction;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -24,28 +24,28 @@
// ********************************************************************
//
//
// $Id: ExN03SteppingVerbose.hh,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: SteppingVerbose.hh,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class ExN03SteppingVerbose;
class SteppingVerbose;
#ifndef ExN03SteppingVerbose_h
#define ExN03SteppingVerbose_h 1
#ifndef SteppingVerbose_h
#define SteppingVerbose_h 1
#include "G4SteppingVerbose.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class ExN03SteppingVerbose : public G4SteppingVerbose
class SteppingVerbose : public G4SteppingVerbose
{
public:
ExN03SteppingVerbose();
~ExN03SteppingVerbose();
SteppingVerbose();
~SteppingVerbose();
void StepInfo();
void TrackingStarted();
@@ -24,18 +24,20 @@
// ********************************************************************
//
//
// $Id: ExN03DetectorConstruction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: DetectorConstruction.cc,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN03DetectorConstruction.hh"
#include "ExN03DetectorMessenger.hh"
#include "DetectorConstruction.hh"
#include "DetectorMessenger.hh"
#include "G4Material.hh"
#include "G4NistManager.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
@@ -52,7 +54,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03DetectorConstruction::ExN03DetectorConstruction()
DetectorConstruction::DetectorConstruction()
:AbsorberMaterial(0),GapMaterial(0),defaultMaterial(0),
solidWorld(0),logicWorld(0),physiWorld(0),
solidCalor(0),logicCalor(0),physiCalor(0),
@@ -74,24 +76,24 @@ ExN03DetectorConstruction::ExN03DetectorConstruction()
SetGapMaterial("liquidArgon");
// create commands for interactive definition of the calorimeter
detectorMessenger = new ExN03DetectorMessenger(this);
detectorMessenger = new DetectorMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03DetectorConstruction::~ExN03DetectorConstruction()
DetectorConstruction::~DetectorConstruction()
{ delete detectorMessenger;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* ExN03DetectorConstruction::Construct()
G4VPhysicalVolume* DetectorConstruction::Construct()
{
return ConstructCalorimeter();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03DetectorConstruction::DefineMaterials()
void DetectorConstruction::DefineMaterials()
{
//This function illustrates the possible ways to define materials
@@ -183,7 +185,7 @@ Aerog->AddElement (C , fractionmass= 0.1*perCent);
//
G4Material* CO2 =
new G4Material("CarbonicGas", density= 27.*mg/cm3, ncomponents=2,
new G4Material("CarbonicGas", density= 1.842*mg/cm3, ncomponents=2,
kStateGas, 325.*kelvin, 50.*atmosphere);
CO2->AddElement(C, natoms=1);
CO2->AddElement(O, natoms=2);
@@ -206,6 +208,14 @@ new G4Material("Beam", density= 1.e-5*g/cm3, ncomponents=1,
kStateGas, STP_Temperature, 2.e-2*bar);
beam->AddMaterial(Air, fractionmass=1.);
//
// or use G4-NIST materials data base
//
G4NistManager* man = G4NistManager::Instance();
man->FindOrBuildMaterial("G4_SODIUM_IODIDE");
// print table
//
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
//default materials of the World
@@ -214,7 +224,7 @@ defaultMaterial = Vacuum;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* ExN03DetectorConstruction::ConstructCalorimeter()
G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
{
// Clean old geometry, if any
@@ -379,7 +389,7 @@ G4VPhysicalVolume* ExN03DetectorConstruction::ConstructCalorimeter()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03DetectorConstruction::PrintCalorParameters()
void DetectorConstruction::PrintCalorParameters()
{
G4cout << "\n------------------------------------------------------------"
<< "\n---> The calorimeter is " << NbOfLayers << " layers of: [ "
@@ -391,7 +401,7 @@ void ExN03DetectorConstruction::PrintCalorParameters()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
void DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
@@ -400,7 +410,7 @@ void ExN03DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03DetectorConstruction::SetGapMaterial(G4String materialChoice)
void DetectorConstruction::SetGapMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
@@ -409,7 +419,7 @@ void ExN03DetectorConstruction::SetGapMaterial(G4String materialChoice)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03DetectorConstruction::SetAbsorberThickness(G4double val)
void DetectorConstruction::SetAbsorberThickness(G4double val)
{
// change Absorber thickness and recompute the calorimeter parameters
AbsorberThickness = val;
@@ -417,7 +427,7 @@ void ExN03DetectorConstruction::SetAbsorberThickness(G4double val)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03DetectorConstruction::SetGapThickness(G4double val)
void DetectorConstruction::SetGapThickness(G4double val)
{
// change Gap thickness and recompute the calorimeter parameters
GapThickness = val;
@@ -425,7 +435,7 @@ void ExN03DetectorConstruction::SetGapThickness(G4double val)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03DetectorConstruction::SetCalorSizeYZ(G4double val)
void DetectorConstruction::SetCalorSizeYZ(G4double val)
{
// change the transverse size and recompute the calorimeter parameters
CalorSizeYZ = val;
@@ -433,7 +443,7 @@ void ExN03DetectorConstruction::SetCalorSizeYZ(G4double val)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03DetectorConstruction::SetNbOfLayers(G4int val)
void DetectorConstruction::SetNbOfLayers(G4int val)
{
NbOfLayers = val;
}
@@ -443,7 +453,7 @@ void ExN03DetectorConstruction::SetNbOfLayers(G4int val)
#include "G4FieldManager.hh"
#include "G4TransportationManager.hh"
void ExN03DetectorConstruction::SetMagField(G4double fieldValue)
void DetectorConstruction::SetMagField(G4double fieldValue)
{
//apply a global uniform magnetic field along Z axis
G4FieldManager* fieldMgr
@@ -465,7 +475,7 @@ void ExN03DetectorConstruction::SetMagField(G4double fieldValue)
#include "G4RunManager.hh"
void ExN03DetectorConstruction::UpdateGeometry()
void DetectorConstruction::UpdateGeometry()
{
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
}
@@ -24,17 +24,17 @@
// ********************************************************************
//
//
// $Id: ExN03DetectorMessenger.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: DetectorMessenger.cc,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN03DetectorMessenger.hh"
#include "DetectorMessenger.hh"
#include "ExN03DetectorConstruction.hh"
#include "DetectorConstruction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
@@ -43,9 +43,9 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03DetectorMessenger::ExN03DetectorMessenger(
ExN03DetectorConstruction* ExN03Det)
:ExN03Detector(ExN03Det)
DetectorMessenger::DetectorMessenger(
DetectorConstruction* Det)
:Detector(Det)
{
N03Dir = new G4UIdirectory("/N03/");
N03Dir->SetGuidance("UI commands of this example");
@@ -106,7 +106,7 @@ ExN03DetectorMessenger::ExN03DetectorMessenger(
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03DetectorMessenger::~ExN03DetectorMessenger()
DetectorMessenger::~DetectorMessenger()
{
delete NbLayersCmd;
delete AbsMaterCmd; delete GapMaterCmd;
@@ -119,32 +119,32 @@ ExN03DetectorMessenger::~ExN03DetectorMessenger()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if( command == AbsMaterCmd )
{ ExN03Detector->SetAbsorberMaterial(newValue);}
{ Detector->SetAbsorberMaterial(newValue);}
if( command == GapMaterCmd )
{ ExN03Detector->SetGapMaterial(newValue);}
{ Detector->SetGapMaterial(newValue);}
if( command == AbsThickCmd )
{ ExN03Detector->SetAbsorberThickness(AbsThickCmd
{ Detector->SetAbsorberThickness(AbsThickCmd
->GetNewDoubleValue(newValue));}
if( command == GapThickCmd )
{ ExN03Detector->SetGapThickness(GapThickCmd->GetNewDoubleValue(newValue));}
{ Detector->SetGapThickness(GapThickCmd->GetNewDoubleValue(newValue));}
if( command == SizeYZCmd )
{ ExN03Detector->SetCalorSizeYZ(SizeYZCmd->GetNewDoubleValue(newValue));}
{ Detector->SetCalorSizeYZ(SizeYZCmd->GetNewDoubleValue(newValue));}
if( command == NbLayersCmd )
{ ExN03Detector->SetNbOfLayers(NbLayersCmd->GetNewIntValue(newValue));}
{ Detector->SetNbOfLayers(NbLayersCmd->GetNewIntValue(newValue));}
if( command == UpdateCmd )
{ ExN03Detector->UpdateGeometry(); }
{ Detector->UpdateGeometry(); }
if( command == MagFieldCmd )
{ ExN03Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
{ Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,23 +24,20 @@
// ********************************************************************
//
//
// $Id: ExN03EventAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: EventAction.cc,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN03EventAction.hh"
#include "EventAction.hh"
#include "ExN03RunAction.hh"
#include "ExN03EventActionMessenger.hh"
#include "RunAction.hh"
#include "EventActionMessenger.hh"
#include "G4Event.hh"
#include "G4TrajectoryContainer.hh"
#include "G4VTrajectory.hh"
#include "G4VVisManager.hh"
#include "G4UnitsTable.hh"
#include "Randomize.hh"
@@ -48,28 +45,28 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03EventAction::ExN03EventAction(ExN03RunAction* run)
EventAction::EventAction(RunAction* run)
:runAct(run),printModulo(1),eventMessenger(0)
{
eventMessenger = new ExN03EventActionMessenger(this);
eventMessenger = new EventActionMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03EventAction::~ExN03EventAction()
EventAction::~EventAction()
{
delete eventMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03EventAction::BeginOfEventAction(const G4Event* evt)
void EventAction::BeginOfEventAction(const G4Event* evt)
{
G4int evtNb = evt->GetEventID();
if (evtNb%printModulo == 0) {
G4cout << "\n---> Begin of event: " << evtNb << G4endl;
CLHEP::HepRandom::showEngineStatus();
}
G4int evtNb = evt->GetEventID();
if (evtNb%printModulo == 0) {
G4cout << "\n---> Begin of event: " << evtNb << G4endl;
CLHEP::HepRandom::showEngineStatus();
}
// initialisation per event
EnergyAbs = EnergyGap = 0.;
@@ -78,7 +75,7 @@ void ExN03EventAction::BeginOfEventAction(const G4Event* evt)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03EventAction::EndOfEventAction(const G4Event* evt)
void EventAction::EndOfEventAction(const G4Event* evt)
{
//accumulates statistic
//
@@ -102,7 +99,7 @@ void ExN03EventAction::EndOfEventAction(const G4Event* evt)
<< G4BestUnit(TrackLGap,"Length")
<< G4endl;
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,24 +24,24 @@
// ********************************************************************
//
//
// $Id: ExN03EventActionMessenger.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: EventActionMessenger.cc,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN03EventActionMessenger.hh"
#include "EventActionMessenger.hh"
#include "ExN03EventAction.hh"
#include "EventAction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03EventActionMessenger::ExN03EventActionMessenger(ExN03EventAction* EvAct)
EventActionMessenger::EventActionMessenger(EventAction* EvAct)
:eventAction(EvAct)
{
eventDir = new G4UIdirectory("/N03/event/");
@@ -55,7 +55,7 @@ ExN03EventActionMessenger::ExN03EventActionMessenger(ExN03EventAction* EvAct)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03EventActionMessenger::~ExN03EventActionMessenger()
EventActionMessenger::~EventActionMessenger()
{
delete PrintCmd;
delete eventDir;
@@ -63,7 +63,7 @@ ExN03EventActionMessenger::~ExN03EventActionMessenger()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03EventActionMessenger::SetNewValue(
void EventActionMessenger::SetNewValue(
G4UIcommand* command,G4String newValue)
{
if(command == PrintCmd)
@@ -1,696 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// Convergence Tests for Monte Carlo resut.
//
// Reference
// MCNP(TM) -A General Monte Carlo N-Particle Transport Code
// Version 4B
// Judith F. Briesmeister, Editor
// LA-12625-M, Issued: March 1997, UC 705 and UC 700
// CHAPTER 2. GEOMETRY, DATA, PHYSICS, AND MATHEMATICS
// VI. ESTIMATION OF THE MONTE CARLO PRECISION
//
// Positives numbers are assumed for inputs
//
// Koi, Tatsumi (SLAC/SCCS)
//
#include "G4ConvergenceTester.hh"
G4ConvergenceTester::G4ConvergenceTester()
{
nonzero_histories.clear();
largest_scores.clear();
largest_scores.push_back( 0.0 );
n=0;
sum=0;
noBinOfHistory = 16;
history_grid.resize( noBinOfHistory , 0 );
mean_history.resize( noBinOfHistory , 0.0 );
var_history.resize( noBinOfHistory , 0.0 );
sd_history.resize( noBinOfHistory , 0.0 );
r_history.resize( noBinOfHistory , 0.0 );
vov_history.resize( noBinOfHistory , 0.0 );
fom_history.resize( noBinOfHistory , 0.0 );
shift_history.resize( noBinOfHistory , 0.0 );
e_history.resize( noBinOfHistory , 0.0 );
r2eff_history.resize( noBinOfHistory , 0.0 );
r2int_history.resize( noBinOfHistory , 0.0 );
timer = new G4Timer();
timer->Start();
cpu_time.clear();
cpu_time.push_back( 0.0 );
noBinOfPDF = 10; // this will be used calculating SLOPE
noPass = 0;
noTotal = 8;
}
G4ConvergenceTester::~G4ConvergenceTester()
{
delete timer;
}
void G4ConvergenceTester::AddScore( G4double x )
{
//G4cout << x << G4endl;
timer->Stop();
cpu_time.push_back( timer->GetSystemElapsed() + timer->GetUserElapsed() );
if ( x == 0.0 )
{
}
else
{
nonzero_histories.insert( std::pair< G4int , G4double > ( n , x ) );
if ( x > largest_scores.back() )
{
// Following serch should become faster if begin from bottom.
std::vector< G4double >::iterator it;
for ( it = largest_scores.begin() ; it != largest_scores.end() ; it++ )
{
if ( x > *it )
{
largest_scores.insert( it , x );
break;
}
}
if ( largest_scores.size() > 201 )
{
largest_scores.pop_back();
}
//G4cout << largest_scores.size() << " " << largest_scores.front() << " " << largest_scores.back() << G4endl;
}
sum += x;
}
n++;
return;
}
void G4ConvergenceTester::calStat()
{
efficiency = double( nonzero_histories.size() ) / n;
mean = sum / n;
G4double sum_x2 = 0.0;
var = 0.0;
shift = 0.0;
vov = 0.0;
G4double xi;
std::map< G4int , G4double >::iterator it;
for ( it = nonzero_histories.begin() ; it != nonzero_histories.end() ; it++ )
{
xi = it->second;
sum_x2 += xi * xi;
var += ( xi - mean ) * ( xi - mean );
shift += ( xi - mean ) * ( xi - mean ) * ( xi - mean );
vov += ( xi - mean ) * ( xi - mean ) * ( xi - mean ) * ( xi - mean );
}
var += ( n - nonzero_histories.size() ) * mean * mean;
shift += ( n - nonzero_histories.size() ) * mean * mean * mean * ( -1 );
vov += ( n - nonzero_histories.size() ) * mean * mean * mean * mean;
vov = vov / ( var * var ) - 1.0 / n;
var = var/(n-1);
sd = std::sqrt ( var );
r = sd / mean / std::sqrt ( n );
r2eff = ( 1 - efficiency ) / ( efficiency * n );
r2int = sum_x2 / ( sum * sum ) - 1 / ( efficiency * n );
shift = shift / ( 2 * var * n );
fom = 1 / (r*r) / cpu_time.back();
// Find Largest History
//G4double largest = 0.0;
largest = 0.0;
largest_score_happened = 0;
G4double spend_time_of_largest = 0.0;
for ( it = nonzero_histories.begin() ; it != nonzero_histories.end() ; it++ )
{
if ( std::abs ( it->second ) > largest )
{
largest = it->second;
largest_score_happened = it->first;
spend_time_of_largest = cpu_time [ it->first ] - cpu_time [ it->first - 1 ];
}
}
mean_1 = 0.0;
var_1 = 0.0;
shift_1 = 0.0;
vov_1 = 0.0;
sd_1 = 0.0;
r_1 = 0.0;
vov_1 = 0.0;
// G4cout << "The largest history = " << largest << G4endl;
mean_1 = ( sum + largest ) / ( n + 1 );
sum_x2 = 0.0;
for ( it = nonzero_histories.begin() ; it != nonzero_histories.end() ; it++ )
{
xi = it->second;
sum_x2 += xi * xi;
var_1 += ( xi - mean_1 ) * ( xi - mean_1 );
shift_1 += ( xi - mean_1 ) * ( xi - mean_1 ) * ( xi - mean_1 );
vov_1 += ( xi - mean_1 ) * ( xi - mean_1 ) * ( xi - mean_1 ) * ( xi - mean_1 );
}
xi = largest;
sum_x2 += xi * xi;
var_1 += ( xi - mean_1 ) * ( xi - mean_1 );
shift_1 += ( xi - mean_1 ) * ( xi - mean_1 ) * ( xi - mean_1 );
vov_1 += ( xi - mean_1 ) * ( xi - mean_1 ) * ( xi - mean_1 ) * ( xi - mean_1 );
var_1 += ( n - nonzero_histories.size() ) * mean_1 * mean_1;
shift_1 += ( n - nonzero_histories.size() ) * mean_1 * mean_1 * mean_1 * ( -1 );
vov_1 += ( n - nonzero_histories.size() ) * mean_1 * mean_1 * mean_1 * mean_1;
vov_1 = vov_1 / ( var_1 * var_1 ) - 1.0 / ( n + 1 );
var_1 = var_1 / n ;
sd_1 = std::sqrt ( var_1 );
r_1 = sd_1 / mean_1 / std::sqrt ( n + 1 );
shift_1 = shift_1 / ( 2 * var_1 * ( n + 1 ) );
fom_1 = 1 / ( r * r ) / ( cpu_time.back() + spend_time_of_largest );
if ( nonzero_histories.size() < 500 )
{
G4cout << "Number of non zero history too small to calcuarte SLOPE" << G4endl;
}
else
{
G4int i = int ( nonzero_histories.size() );
// 5% criterion
G4int j = int ( i * 0.05 );
while ( int( largest_scores.size() ) > j )
{
largest_scores.pop_back();
}
calc_slope_fit( largest_scores );
}
calc_grid_point_of_history();
calc_stat_history();
}
void G4ConvergenceTester::calc_grid_point_of_history()
{
// histroy_grid [ 0,,,15 ]
// history_grid [0] 1/16 ,,, history_grid [15] 16/16
// if number of event is x then history_grid [15] become x-1.
// 16 -> noBinOfHisotry
G4int i;
for ( i = 1 ; i <= noBinOfHistory ; i++ )
{
history_grid [ i-1 ] = int ( n / ( double( noBinOfHistory ) ) * i - 0.1 );
//G4cout << "history_grid " << i-1 << " " << history_grid [ i-1 ] << G4endl;
}
}
void G4ConvergenceTester::calc_stat_history()
{
// G4cout << "i/16 till_ith mean var sd r vov fom shift e r2eff r2int" << G4endl;
G4int i;
for ( i = 1 ; i <= noBinOfHistory ; i++ )
{
G4int ith = history_grid [ i-1 ];
G4int nonzero_till_ith = 0;
G4double xi;
G4double mean_till_ith = 0.0;
std::map< G4int , G4double >::iterator it;
for ( it = nonzero_histories.begin() ; it !=nonzero_histories.end() ; it++ )
{
if ( it->first <= ith )
{
xi = it->second;
mean_till_ith += xi;
nonzero_till_ith++;
}
}
mean_till_ith = mean_till_ith / ( ith+1 );
mean_history [ i-1 ] = mean_till_ith;
G4double sum_x2_till_ith = 0.0;
G4double var_till_ith = 0.0;
G4double vov_till_ith = 0.0;
G4double shift_till_ith = 0.0;
for ( it = nonzero_histories.begin() ; it !=nonzero_histories.end() ; it++ )
{
if ( it->first <= ith )
{
xi = it->second;
sum_x2_till_ith += xi * xi;
var_till_ith += ( xi - mean_till_ith ) * ( xi - mean_till_ith );
shift_till_ith += ( xi - mean_till_ith ) * ( xi - mean_till_ith ) * ( xi - mean_till_ith );
vov_till_ith += ( xi - mean_till_ith ) * ( xi - mean_till_ith ) * ( xi - mean_till_ith ) * ( xi - mean_till_ith );
}
}
var_till_ith += ( (ith+1) - nonzero_till_ith ) * mean_till_ith * mean_till_ith;
vov_till_ith += ( (ith+1) - nonzero_till_ith ) * mean_till_ith * mean_till_ith * mean_till_ith * mean_till_ith ;
vov_till_ith = vov_till_ith / ( var_till_ith * var_till_ith ) - 1.0 / (ith+1);
vov_history [ i-1 ] = vov_till_ith;
var_till_ith = var_till_ith / ( ith+1 - 1 );
var_history [ i-1 ] = var_till_ith;
sd_history [ i-1 ] = std::sqrt( var_till_ith );
r_history [ i-1 ] = std::sqrt( var_till_ith ) / mean_till_ith / std::sqrt ( 1.0*(ith+1) );
fom_history [ i-1 ] = 1 / ( r_history [ i-1 ] * r_history [ i-1 ] ) / cpu_time [ ith ];
shift_till_ith += ( (ith+1) - nonzero_till_ith ) * mean_till_ith * mean_till_ith * mean_till_ith * ( -1 );
shift_till_ith = shift_till_ith / ( 2 * var_till_ith * (ith+1) );
shift_history [ i-1 ] = shift_till_ith;
e_history [ i-1 ] = 1.0*nonzero_till_ith / (ith+1);
r2eff_history [ i-1 ] = ( 1 - e_history [ i-1 ] ) / ( e_history [ i-1 ] * (ith+1) );
G4double sum_till_ith = mean_till_ith * (ith+1);
r2int_history [ i-1 ] = ( sum_x2_till_ith ) / ( sum_till_ith * sum_till_ith ) - 1 / ( e_history [ i-1 ] * (ith+1) );
}
}
void G4ConvergenceTester::ShowResult()
{
calStat();
G4cout << "EFFICIENCY = " << efficiency << G4endl;
G4cout << "MEAN = " << mean << G4endl;
G4cout << "VAR = " << var << G4endl;
G4cout << "SD = " << sd << G4endl;
G4cout << "R = "<< r << G4endl;
G4cout << "SHIFT = "<< shift << G4endl;
G4cout << "VOV = "<< vov << G4endl;
G4cout << "FOM = "<< fom << G4endl;
G4cout << "THE LARGEST SCORE = " << largest << " and it happend at " << largest_score_happened << "th event" << G4endl;
G4cout << "Affected Mean = " << mean_1 << " and its ratio to orignal is " << mean_1/mean << G4endl;
G4cout << "Affected VAR = " << var_1 << " and its ratio to orignal is " << var_1/var << G4endl;
G4cout << "Affected R = " << r_1 << " and its ratio to orignal is " << r_1/r << G4endl;
G4cout << "Affected SHIFT = " << shift_1 << " and its ratio to orignal is " << shift_1/shift << G4endl;
G4cout << "Affected FOM = " << fom_1 << " and its ratio to orignal is " << fom_1/fom << G4endl;
check_stat_history();
// check SLOPE and output result
if ( slope >= 3 )
{
noPass++;
G4cout << "SLOPE is large enough" << G4endl;
}
else
{
G4cout << "SLOPE is not large enough" << G4endl;
}
G4cout << "This result passes " << noPass << " / "<< noTotal << " Convergence Test." << G4endl;
G4cout << G4endl;
}
void G4ConvergenceTester::ShowHistory()
{
G4cout << "i/" << noBinOfHistory << " till_ith mean var sd r vov fom shift e r2eff r2int" << G4endl;
for ( G4int i = 1 ; i <= noBinOfHistory ; i++ )
{
G4cout << i << " "
<< history_grid [ i-1 ] << " "
<< mean_history [ i-1 ] << " "
<< var_history [ i-1 ] << " "
<< sd_history [ i-1 ] << " "
<< r_history [ i-1 ] << " "
<< vov_history [ i-1 ] << " "
<< fom_history [ i-1 ] << " "
<< shift_history [ i-1 ] << " "
<< e_history [ i-1 ] << " "
<< r2eff_history [ i-1 ] << " "
<< r2int_history [ i-1 ] << " "
<< G4endl;
}
}
void G4ConvergenceTester::check_stat_history()
{
// 1 sigma rejection for null hypothesis
std::vector<G4double> first_ally;
std::vector<G4double> second_ally;
// use 2nd half of hisories
G4int N = mean_history.size() / 2;
G4int i;
G4double pearson_r;
G4double t;
first_ally.resize( N );
second_ally.resize( N );
// Mean
for ( i = 0 ; i < N ; i++ )
{
first_ally [ i ] = history_grid [ N + i ];
second_ally [ i ] = mean_history [ N + i ];
}
pearson_r = calc_Pearson_r ( N , first_ally , second_ally );
t = pearson_r * std::sqrt ( ( N - 2 ) / ( 1 - pearson_r * pearson_r ) );
if ( t < 0.429318 ) // Student t of (Degree of freedom = N-2 )
{
G4cout << "MEAN distribution is RANDOM" << G4endl;
noPass++;
}
else
{
G4cout << "MEAN distribution is not RANDOM" << G4endl;
}
// R
for ( i = 0 ; i < N ; i++ )
{
first_ally [ i ] = 1.0 / std::sqrt ( history_grid [ N + i ] );
second_ally [ i ] = r_history [ N + i ];
}
pearson_r = calc_Pearson_r ( N , first_ally , second_ally );
t = pearson_r * std::sqrt ( ( N - 2 ) / ( 1 - pearson_r * pearson_r ) );
if ( t > 1.090546 )
{
G4cout << "r follows 1/std::sqrt(N)" << G4endl;
noPass++;
}
else
{
G4cout << "r does not follow 1/std::sqrt(N)" << G4endl;
}
G4cout << "r is monotonically decrease " << is_monotonically_decrease( second_ally ) << G4endl;
if ( r_history.back() < 0.1 )
{
G4cout << "r is less than 0.1. r = " << r_history.back() << G4endl;
noPass++;
}
else
{
G4cout << "r is NOT less than 0.1. r = " << r_history.back() << G4endl;
}
// VOV
for ( i = 0 ; i < N ; i++ )
{
first_ally [ i ] = 1.0 / history_grid [ N + i ];
second_ally [ i ] = vov_history [ N + i ];
}
pearson_r = calc_Pearson_r ( N , first_ally , second_ally );
t = pearson_r * std::sqrt ( ( N - 2 ) / ( 1 - pearson_r * pearson_r ) );
if ( t > 1.090546 )
{
G4cout << "VOV follows 1/std::sqrt(N)" << G4endl;
noPass++;
}
else
{
G4cout << "VOV does not follow 1/std::sqrt(N)" << G4endl;
}
G4cout << "VOV is monotonically decrease " << is_monotonically_decrease( second_ally ) << G4endl;
// FOM
for ( i = 0 ; i < N ; i++ )
{
first_ally [ i ] = history_grid [ N + i ];
second_ally [ i ] = fom_history [ N + i ];
}
pearson_r = calc_Pearson_r ( N , first_ally , second_ally );
t = pearson_r * std::sqrt ( ( N - 2 ) / ( 1 - pearson_r * pearson_r ) );
if ( t < 0.429318 )
{
G4cout << "FOM distribution is RANDOM" << G4endl;
noPass++;
}
else
{
G4cout << "FOM distribution is not RANDOM" << G4endl;
}
}
G4double G4ConvergenceTester::calc_Pearson_r ( G4int N , std::vector<G4double> first_ally , std::vector<G4double> second_ally )
{
G4double first_mean = 0.0;
G4double second_mean = 0.0;
G4int i;
for ( i = 0 ; i < N ; i++ )
{
first_mean += first_ally [ i ];
second_mean += second_ally [ i ];
}
first_mean = first_mean / N;
second_mean = second_mean / N;
G4double a = 0.0;
for ( i = 0 ; i < N ; i++ )
{
a += ( first_ally [ i ] - first_mean ) * ( second_ally [ i ] - second_mean );
}
G4double b1 = 0.0;
G4double b2 = 0.0;
for ( i = 0 ; i < N ; i++ )
{
b1 += ( first_ally [ i ] - first_mean ) * ( first_ally [ i ] - first_mean );
b2 += ( second_ally [ i ] - second_mean ) * ( second_ally [ i ] - second_mean );
}
G4double r = a / std::sqrt ( b1 * b2 );
return r;
}
G4bool G4ConvergenceTester::is_monotonically_decrease ( std::vector<G4double> ally )
{
std::vector<G4double>::iterator it;
for ( it = ally.begin() ; it != ally.end() - 1 ; it++ )
{
if ( *it < *(it+1) ) return FALSE;
}
noPass++;
return TRUE;
}
//void G4ConvergenceTester::calc_slope_fit ( std::vector<G4double> largest_socres )
void G4ConvergenceTester::calc_slope_fit ( std::vector<G4double> )
{
// create PDF bins
G4double max = largest_scores.front();
G4int last = int ( largest_scores.size() );
G4double min = 0.0;
if ( largest_scores.back() != 0 )
{
min = largest_scores.back();
}
else
{
min = largest_scores[ last-1 ];
last = last - 1;
}
//G4cout << "largest " << max << G4endl;
//G4cout << "last " << min << G4endl;
if ( max*0.99 < min )
{
// upper limit is assumed to have been reached
slope = 10.0;
return;
}
std::vector < G4double > pdf_grid;
pdf_grid.resize( noBinOfPDF+1 ); // no grid = no bins + 1
pdf_grid[ 0 ] = max;
pdf_grid[ noBinOfPDF ] = min;
G4double log10_max = std::log10( max );
G4double log10_min = std::log10( min );
G4double log10_delta = log10_max - log10_min;
for ( G4int i = 1 ; i < noBinOfPDF ; i++ )
{
pdf_grid[i] = std::pow ( 10.0 , log10_max - log10_delta/10.0*(i) );
//G4cout << "pdf i " << i << " " << pdf_grid[i] << G4endl;
}
std::vector < G4double > pdf;
pdf.resize( noBinOfPDF );
for ( G4int j=0 ; j < last ; j ++ )
{
for ( G4int i = 0 ; i < 11 ; i++ )
{
if ( largest_scores[j] >= pdf_grid[i+1] )
{
pdf[i] += 1.0 / ( pdf_grid[i] - pdf_grid[i+1] ) / n;
//G4cout << "pdf " << j << " " << i << " " << largest_scores[j] << " " << G4endl;
break;
}
}
}
f_xi.resize( noBinOfPDF );
f_yi.resize( noBinOfPDF );
for ( G4int i = 0 ; i < noBinOfPDF ; i++ )
{
//G4cout << "pdf i " << i << " " << (pdf_grid[i]+pdf_grid[i+1])/2 << " " << pdf[i] << G4endl;
f_xi[i] = (pdf_grid[i]+pdf_grid[i+1])/2;
f_yi[i] = pdf[i];
}
// number of variables ( a and k )
minimizer = new G4SimplexDownhill<G4ConvergenceTester> ( this , 2 );
//G4double minimum = minimizer->GetMinimum();
std::vector<G4double> mp = minimizer->GetMinimumPoint();
G4double k = mp[1];
//G4cout << "SLOPE " << 1/mp[1]+1 << G4endl;
//G4cout << "SLOPE a " << mp[0] << G4endl;
//G4cout << "SLOPE k " << mp[1] << G4endl;
//G4cout << "SLOPE minimum " << minimizer->GetMinimum() << G4endl;
slope = 1/mp[1]+1;
if ( k < 1.0/9 ) // Please look Pareto distribution with "sigma=a" and "k"
{
slope = 10;
}
if ( slope > 10 )
{
slope = 10;
}
}
G4double G4ConvergenceTester::slope_fitting_function ( std::vector< G4double > x )
{
G4double a = x[0];
G4double k = x[1];
if ( a <= 0 )
{
return 3.402823466e+38; // FLOAT_MAX
}
if ( k == 0 )
{
return 3.402823466e+38; // FLOAT_MAX
}
// f_xi and f_yi is filled at "calc_slope_fit"
G4double y = 0.0;
G4int i;
for ( i = 0 ; i < int ( f_yi.size() ) ; i++ )
{
//if ( 1/a * ( 1 + k * f_xi [ i ] / a ) < 0 )
if ( ( 1 + k * f_xi [ i ] / a ) < 0 )
{
//return 3.402823466e+38; // FLOAT_MAX
y +=3.402823466e+38; // FLOAT_MAX
}
y += ( f_yi [ i ] - 1/a*std::pow ( ( 1 + k * f_xi [ i ] / a ) , - 1/k - 1 ) ) * ( f_yi [ i ] - 1/a*std::pow ( ( 1 + k * f_xi [ i ] / a ) , - 1/k - 1 ) );
}
// G4cout << "y = " << y << G4endl;
return y;
}
@@ -24,115 +24,70 @@
// ********************************************************************
//
//
// $Id: H02PhysicsList.cc,v 1.5 2006/07/05 12:04:13 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: PhysicsList.cc,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "globals.hh"
#include "H02PhysicsList.hh"
#include "PhysicsList.hh"
#include "G4ProcessManager.hh"
#include "G4ParticleTypes.hh"
#include "G4BosonConstructor.hh"
#include "G4LeptonConstructor.hh"
#include "G4MesonConstructor.hh"
#include "G4BosonConstructor.hh"
#include "G4BaryonConstructor.hh"
#include "G4IonConstructor.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
H02PhysicsList::H02PhysicsList(): G4VUserPhysicsList()
PhysicsList::PhysicsList(): G4VUserPhysicsList()
{
defaultCutValue = 1.0*cm;
SetVerboseLevel(1);
defaultCutValue = 1.0*mm;
SetVerboseLevel(1);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
H02PhysicsList::~H02PhysicsList()
PhysicsList::~PhysicsList()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void H02PhysicsList::ConstructParticle()
void PhysicsList::ConstructParticle()
{
// In this method, static member functions should be called
// for all particles which you want to use.
// This ensures that objects of these particle types will be
// created in the program.
ConstructBosons();
ConstructLeptons();
ConstructMesons();
ConstructBaryons();
G4BosonConstructor pBosonConstructor;
pBosonConstructor.ConstructParticle();
G4LeptonConstructor pLeptonConstructor;
pLeptonConstructor.ConstructParticle();
G4MesonConstructor pMesonConstructor;
pMesonConstructor.ConstructParticle();
G4BaryonConstructor pBaryonConstructor;
pBaryonConstructor.ConstructParticle();
G4IonConstructor pIonConstructor;
pIonConstructor.ConstructParticle();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void H02PhysicsList::ConstructBosons()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void H02PhysicsList::ConstructLeptons()
{
// leptons
// e+/-
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
// mu+/-
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
// nu_e
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
// nu_mu
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void H02PhysicsList::ConstructMesons()
{
// mesons
// light mesons
G4PionPlus::PionPlusDefinition();
G4PionMinus::PionMinusDefinition();
G4PionZero::PionZeroDefinition();
G4Eta::EtaDefinition();
G4EtaPrime::EtaPrimeDefinition();
G4KaonPlus::KaonPlusDefinition();
G4KaonMinus::KaonMinusDefinition();
G4KaonZero::KaonZeroDefinition();
G4AntiKaonZero::AntiKaonZeroDefinition();
G4KaonZeroLong::KaonZeroLongDefinition();
G4KaonZeroShort::KaonZeroShortDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void H02PhysicsList::ConstructBaryons()
{
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
G4Neutron::NeutronDefinition();
G4AntiNeutron::AntiNeutronDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void H02PhysicsList::ConstructProcess()
void PhysicsList::ConstructProcess()
{
AddTransportation();
ConstructEM();
ConstructGeneral();
ConstructDecay();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -141,31 +96,33 @@ void H02PhysicsList::ConstructProcess()
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh"
#include "G4eMultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuMultipleScattering.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hMultipleScattering.hh"
#include "G4hIonisation.hh"
#include "G4hBremsstrahlung.hh"
#include "G4hPairProduction.hh"
#include "G4StepLimiter.hh"
#include "G4UserSpecialCuts.hh"
#include "G4ionIonisation.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void H02PhysicsList::ConstructEM()
void PhysicsList::ConstructEM()
{
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (particleName == "gamma") {
// gamma
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
@@ -174,42 +131,60 @@ void H02PhysicsList::ConstructEM()
} else if (particleName == "e-") {
//electron
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
pmanager->AddProcess(new G4eMultipleScattering,-1, 1, 1);
pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
} else if (particleName == "e+") {
//positron
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);
pmanager->AddProcess(new G4eMultipleScattering,-1, 1, 1);
pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4);
} else if( particleName == "mu+" ||
particleName == "mu-" ) {
//muon
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
pmanager->AddProcess(new G4MuIonisation, -1, 2,2);
pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);
pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);
pmanager->AddProcess(new G4MuMultipleScattering,-1, 1, 1);
pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4);
} else if( particleName == "proton" ||
particleName == "pi-" ||
particleName == "pi+" ) {
//proton
pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
} else if ((!particle->IsShortLived()) &&
} else if( particleName == "alpha" ||
particleName == "He3" ) {
//alpha
pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
} else if( particleName == "GenericIon" ) {
//Ions
pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
} else if ((!particle->IsShortLived()) &&
(particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")) {
//all others charged particles except geantino
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
pmanager->AddProcess(new G4hIonisation, -1, 2,2);
//step limit
pmanager->AddProcess(new G4StepLimiter, -1,-1,3);
///pmanager->AddProcess(new G4UserSpecialCuts, -1,-1,4);
}
pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4Decay.hh"
void H02PhysicsList::ConstructGeneral()
void PhysicsList::ConstructDecay()
{
// Add Decay Process
G4Decay* theDecayProcess = new G4Decay();
@@ -228,13 +203,21 @@ void H02PhysicsList::ConstructGeneral()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void H02PhysicsList::SetCuts()
void PhysicsList::SetCuts()
{
//G4VUserPhysicsList::SetCutsWithDefault method sets
//the default cut value for all particle types
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
//
SetCutsWithDefault();
SetCutValue(defaultCutValue, "gamma");
SetCutValue(defaultCutValue, "e-");
SetCutValue(defaultCutValue, "e+");
SetCutValue(defaultCutValue, "proton");
if (verboseLevel>0) DumpCutValuesTable();
}
@@ -24,18 +24,18 @@
// ********************************************************************
//
//
// $Id: ExN03PrimaryGeneratorAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: PrimaryGeneratorAction.cc,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN03PrimaryGeneratorAction.hh"
#include "PrimaryGeneratorAction.hh"
#include "ExN03DetectorConstruction.hh"
#include "ExN03PrimaryGeneratorMessenger.hh"
#include "DetectorConstruction.hh"
#include "PrimaryGeneratorMessenger.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
@@ -45,15 +45,15 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03PrimaryGeneratorAction::ExN03PrimaryGeneratorAction(
ExN03DetectorConstruction* ExN03DC)
:ExN03Detector(ExN03DC),rndmFlag("off")
PrimaryGeneratorAction::PrimaryGeneratorAction(
DetectorConstruction* DC)
:Detector(DC),rndmFlag("off")
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
//create a messenger for this class
gunMessenger = new ExN03PrimaryGeneratorMessenger(this);
gunMessenger = new PrimaryGeneratorMessenger(this);
// default particle kinematic
@@ -64,14 +64,14 @@ ExN03PrimaryGeneratorAction::ExN03PrimaryGeneratorAction(
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
particleGun->SetParticleEnergy(50.*MeV);
G4double position = -0.5*(ExN03Detector->GetWorldSizeX());
G4double position = -0.5*(Detector->GetWorldSizeX());
particleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03PrimaryGeneratorAction::~ExN03PrimaryGeneratorAction()
PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
delete particleGun;
delete gunMessenger;
@@ -79,15 +79,15 @@ ExN03PrimaryGeneratorAction::~ExN03PrimaryGeneratorAction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
//this function is called at the begining of event
//
G4double x0 = -0.5*(ExN03Detector->GetWorldSizeX());
G4double x0 = -0.5*(Detector->GetWorldSizeX());
G4double y0 = 0.*cm, z0 = 0.*cm;
if (rndmFlag == "on")
{y0 = (ExN03Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
z0 = (ExN03Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
{y0 = (Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
z0 = (Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
}
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
@@ -24,25 +24,25 @@
// ********************************************************************
//
//
// $Id: ExN03PrimaryGeneratorMessenger.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: PrimaryGeneratorMessenger.cc,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN03PrimaryGeneratorMessenger.hh"
#include "PrimaryGeneratorMessenger.hh"
#include "ExN03PrimaryGeneratorAction.hh"
#include "PrimaryGeneratorAction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03PrimaryGeneratorMessenger::ExN03PrimaryGeneratorMessenger(
ExN03PrimaryGeneratorAction* ExN03Gun)
:ExN03Action(ExN03Gun)
PrimaryGeneratorMessenger::PrimaryGeneratorMessenger(
PrimaryGeneratorAction* Gun)
:Action(Gun)
{
gunDir = new G4UIdirectory("/N03/gun/");
gunDir->SetGuidance("PrimaryGenerator control");
@@ -58,7 +58,7 @@ ExN03PrimaryGeneratorMessenger::ExN03PrimaryGeneratorMessenger(
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03PrimaryGeneratorMessenger::~ExN03PrimaryGeneratorMessenger()
PrimaryGeneratorMessenger::~PrimaryGeneratorMessenger()
{
delete RndmCmd;
delete gunDir;
@@ -66,11 +66,11 @@ ExN03PrimaryGeneratorMessenger::~ExN03PrimaryGeneratorMessenger()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03PrimaryGeneratorMessenger::SetNewValue(
void PrimaryGeneratorMessenger::SetNewValue(
G4UIcommand* command, G4String newValue)
{
if( command == RndmCmd )
{ ExN03Action->SetRndmFlag(newValue);}
{ Action->SetRndmFlag(newValue);}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,51 +24,52 @@
// ********************************************************************
//
//
// $Id: ExN03RunAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: RunAction.cc,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN03RunAction.hh"
#include "RunAction.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4ConvergenceTester.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03RunAction::ExN03RunAction()
RunAction::RunAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03RunAction::~ExN03RunAction()
RunAction::~RunAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03RunAction::BeginOfRunAction(const G4Run* aRun)
void RunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
//inform the runManager to save random number seed
//G4RunManager::GetRunManager()->SetRandomNumberStore(true);
G4RunManager::GetRunManager()->SetRandomNumberStore(false);
//initialize cumulative quantities
//
sumEAbs = sum2EAbs =sumEGap = sum2EGap = 0.;
sumLAbs = sum2LAbs =sumLGap = sum2LGap = 0.;
sumLAbs = sum2LAbs =sumLGap = sum2LGap = 0.;
Eabs_tally = new G4ConvergenceTester();
Egap_tally = new G4ConvergenceTester();
Labs_tally = new G4ConvergenceTester();
Lgap_tally = new G4ConvergenceTester();
Eabs_tally = new G4ConvergenceTester();
Egap_tally = new G4ConvergenceTester();
Labs_tally = new G4ConvergenceTester();
Lgap_tally = new G4ConvergenceTester();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03RunAction::fillPerEvent(G4double EAbs, G4double EGap,
void RunAction::fillPerEvent(G4double EAbs, G4double EGap,
G4double LAbs, G4double LGap)
{
//accumulate statistic
@@ -77,17 +78,17 @@ void ExN03RunAction::fillPerEvent(G4double EAbs, G4double EGap,
sumEGap += EGap; sum2EGap += EGap*EGap;
sumLAbs += LAbs; sum2LAbs += LAbs*LAbs;
sumLGap += LGap; sum2LGap += LGap*LGap;
sumLGap += LGap; sum2LGap += LGap*LGap;
Eabs_tally->AddScore( EAbs );
Egap_tally->AddScore( EGap );
Labs_tally->AddScore( LAbs );
Lgap_tally->AddScore( LGap );
Eabs_tally->AddScore( EAbs );
Egap_tally->AddScore( EGap );
Labs_tally->AddScore( LAbs );
Lgap_tally->AddScore( LGap );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03RunAction::EndOfRunAction(const G4Run* aRun)
void RunAction::EndOfRunAction(const G4Run* aRun)
{
G4int NbOfEvents = aRun->GetNumberOfEvent();
if (NbOfEvents == 0) return;
@@ -126,18 +127,17 @@ void ExN03RunAction::EndOfRunAction(const G4Run* aRun)
<< "\n mean trackLength in Gap : " << G4BestUnit(sumLGap,"Length")
<< " +- " << G4BestUnit(rmsLGap,"Length")
<< "\n------------------------------------------------------------\n"
<< G4endl;
<< G4endl;
Eabs_tally->ShowResult();
Eabs_tally->ShowHistory();
Egap_tally->ShowResult();
Egap_tally->ShowHistory();
Labs_tally->ShowResult();
Labs_tally->ShowHistory();
Lgap_tally->ShowResult();
Lgap_tally->ShowHistory();
Eabs_tally->ShowResult();
Eabs_tally->ShowHistory();
Egap_tally->ShowResult();
Egap_tally->ShowHistory();
Labs_tally->ShowResult();
Labs_tally->ShowHistory();
Lgap_tally->ShowResult();
Lgap_tally->ShowHistory();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,18 +24,18 @@
// ********************************************************************
//
//
// $Id: ExN03SteppingAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: SteppingAction.cc,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN03SteppingAction.hh"
#include "SteppingAction.hh"
#include "ExN03DetectorConstruction.hh"
#include "ExN03EventAction.hh"
#include "DetectorConstruction.hh"
#include "EventAction.hh"
#include "G4Step.hh"
@@ -43,19 +43,19 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03SteppingAction::ExN03SteppingAction(ExN03DetectorConstruction* det,
ExN03EventAction* evt)
SteppingAction::SteppingAction(DetectorConstruction* det,
EventAction* evt)
:detector(det), eventaction(evt)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03SteppingAction::~ExN03SteppingAction()
SteppingAction::~SteppingAction()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03SteppingAction::UserSteppingAction(const G4Step* aStep)
void SteppingAction::UserSteppingAction(const G4Step* aStep)
{
// get volume of the current step
G4VPhysicalVolume* volume
@@ -24,30 +24,30 @@
// ********************************************************************
//
//
// $Id: ExN03SteppingVerbose.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: SteppingVerbose.cc,v 1.1 2010/11/12 19:16:31 maire Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN03SteppingVerbose.hh"
#include "SteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03SteppingVerbose::ExN03SteppingVerbose()
SteppingVerbose::SteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN03SteppingVerbose::~ExN03SteppingVerbose()
SteppingVerbose::~SteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03SteppingVerbose::StepInfo()
void SteppingVerbose::StepInfo()
{
CopyState();
@@ -141,7 +141,7 @@ void ExN03SteppingVerbose::StepInfo()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN03SteppingVerbose::TrackingStarted()
void SteppingVerbose::TrackingStarted()
{
CopyState();
+76
View File
@@ -0,0 +1,76 @@
# Macro file for the initialization phase of "exampleN03.cc"
# when running in interactive mode
#
# Sets some default verbose
#
/control/verbose 2
/run/verbose 2
#
# Use this open statement to create an OpenGL view:
/vis/open OGL 600x600-0+0
#
# Use this open statement to create a .prim file suitable for
# viewing in DAWN:
#/vis/open DAWNFILE
#
# Use this open statement to create a .heprep file suitable for
# viewing in HepRApp:
#/vis/open HepRepFile
#
# Use this open statement to create a .wrl file suitable for
# viewing in a VRML viewer:
#/vis/open VRML2FILE
#
# Disable auto refresh and quieten vis messages whilst scene and
# trajectories are established:
/vis/viewer/set/autoRefresh false
/vis/verbose errors
#
# Draw geometry:
/vis/drawVolume
#
# Specify view angle:
#/vis/viewer/set/viewpointThetaPhi 90. 0.
#
# Specify zoom value:
#/vis/viewer/zoom 2.
#
# Specify style (surface or wireframe):
#/vis/viewer/set/style wireframe
#
# Draw coordinate axes:
#/vis/scene/add/axes 0 0 0 1 m
#
# Draw smooth trajectories at end of event, showing trajectory points
# as markers 2 pixels wide:
/vis/scene/add/trajectories smooth
/vis/modeling/trajectories/create/drawByCharge
/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
# (if too many tracks cause core dump => /tracking/storeTrajectory 0)
#
# Draw hits at end of event:
#/vis/scene/add/hits
#
# To draw only gammas:
#/vis/filtering/trajectories/create/particleFilter
#/vis/filtering/trajectories/particleFilter-0/add gamma
#
# To invert the above, drawing all particles except gammas,
# keep the above two lines but also add:
#/vis/filtering/trajectories/particleFilter-0/invert true
#
# Many other options are available with /vis/modeling and /vis/filtering.
# For example, to select colour by particle ID:
#/vis/modeling/trajectories/create/drawByParticleID
#/vis/modeling/trajectories/drawByParticleID-0/set e- blue
#
# To superimpose all of the events from a given run:
/vis/scene/endOfEventAction accumulate
#
# Re-establish auto refreshing and verbosity:
/vis/viewer/set/autoRefresh true
/vis/verbose warnings
#
# For file-based drivers, use this to create an empty detector view:
#/vis/viewer/flush
+22
View File
@@ -0,0 +1,22 @@
Geant4 extended examples - analysis
-----------------------------------
Examples in this directory demonstrate how to make histograms and ntuples
AnaEx01
--------
Simple example showing basic features common to all AIDA implementations.
A01
---
Rather complete example dedicaced to Jaida/Jas3 and HepRep
N03Con
------
N03Con shows how to use the statistical tool G4ConvergenceTester.
It does not make histograms.
It has the same geometry as N03 and AnaEx01.
+2 -5
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.7 2002/11/07 13:47:59 dressel Exp $
# $Id: GNUmakefile,v 1.8 2010/01/11 16:24:22 gcosmo Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -8,13 +8,10 @@ G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../..
G4INSTALL = ../../../..
endif
.PHONY: all
all: lib bin
CPPFLAGS +=
include $(G4INSTALL)/config/binmake.gmk
+4 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.2 2007/06/22 13:24:36 ahoward Exp $
$Id: History,v 1.3 2010/03/24 21:04:23 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Mar 25th, 2010 G.Cosmo - B01-V09-03-00
- Migrated physics list to use particle-based multiple-scattering processes.
June 22nd, 2007 A.Howard - B01-V08-03-01
- Removed B01PSScoringDetectorConstruction as part of clean-up.
+70 -304
View File
@@ -4,246 +4,12 @@
############################################
*************************************************************
Geant4 version Name: geant4-09-03-ref-00 (18-December-2009)
Geant4 version Name: geant4-09-04-ref-00 (17-December-2010)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
*************************************************************
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
!!! G4MultipleScattering class is obsolete and will be removed for the next major Geant4 release !!!
!!! Please use G4eMultipleScattering for e+ and e- !!!
!!! Please use G4MuMultipleScattering for mu+ and mu- !!!
!!! Please use G4hMultipleScattering for hadrons and ions !!!
B01PhysicsList::SetCuts:CutLength : 1 (mm)
Going to assign importance: 1, to volume: cell_01
Going to assign importance: 2, to volume: cell_02
@@ -327,176 +93,176 @@ DoIt Vector:
conv: for gamma SubType= 14
Lambda tables from 1.022 MeV to 10 TeV in 77 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bethe-Heitler : Emin= 0 eV Emax= 10 TeV
BetheHeitler : Emin= 0 eV Emax= 10 TeV
compt: for gamma SubType= 13
Lambda tables from 100 eV to 10 TeV in 77 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
Klein-Nishina : Emin= 0 eV Emax= 10 TeV
Klein-Nishina : Emin= 0 eV Emax= 10 TeV
phot: for gamma SubType= 12
===== EM models for the G4Region DefaultRegionForTheWorld ======
PhotoElectric : Emin= 0 eV Emax= 10 TeV
PhotoElectric : Emin= 0 eV Emax= 10 TeV
msc: for e- SubType= 10
Lambda tables from 100 eV to 10 TeV in 77 bins, spline: 1
RangeFactor= 0.04, step limit type: 1, lateralDisplacement: 1, skin= 3, geomFactor= 2.5
RangeFactor= 0.04, stepLimitType: 1, latDisplacement: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc92 : Emin= 0 eV Emax= 10 TeV
UrbanMsc93 : Emin= 0 eV Emax= 10 TeV
eIoni: for e- SubType= 2
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
finalRange(mm)= 1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
MollerBhabha : Emin= 0 eV Emax= 10 TeV
MollerBhabha : Emin= 0 eV Emax= 10 TeV
eBrem: for e- SubType= 3
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
LPM flag: 1 for E > 1 GeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
eBrem : Emin= 0 eV Emax= 1 GeV
eBremRel : Emin= 1 GeV Emax= 10 TeV
eBrem : Emin= 0 eV Emax= 1 GeV AngularGenUrban
eBremLPM : Emin= 1 GeV Emax= 10 TeV AngularGenUrban
eIoni: for e+ SubType= 2
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
finalRange(mm)= 1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
MollerBhabha : Emin= 0 eV Emax= 10 TeV
MollerBhabha : Emin= 0 eV Emax= 10 TeV
eBrem: for e+ SubType= 3
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
LPM flag: 1 for E > 1 GeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
eBrem : Emin= 0 eV Emax= 1 GeV
eBremRel : Emin= 1 GeV Emax= 10 TeV
eBrem : Emin= 0 eV Emax= 1 GeV AngularGenUrban
eBremLPM : Emin= 1 GeV Emax= 10 TeV AngularGenUrban
annihil: for e+ SubType= 5
Lambda tables from 100 eV to 10 TeV in 77 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
eplus2gg : Emin= 0 eV Emax= 10 TeV
eplus2gg : Emin= 0 eV Emax= 10 TeV
msc: for proton SubType= 10
Lambda tables from 100 eV to 10 TeV in 77 bins, spline: 1
RangeFactor= 0.04, step limit type: 1, lateralDisplacement: 1, skin= 3, geomFactor= 2.5
RangeFactor= 0.2, stepLimitType: 0, latDisplacement: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc92 : Emin= 0 eV Emax= 10 TeV
UrbanMsc90 : Emin= 0 eV Emax= 10 TeV
hIoni: for proton SubType= 2
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
finalRange(mm)= 1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 10 TeV
Bragg : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 10 TeV
msc: for GenericIon SubType= 10
RangeFactor= 0.2, step limit type: 0, lateralDisplacement: 0, skin= 3, geomFactor= 2.5
RangeFactor= 0.2, stepLimitType: 0, latDisplacement: 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc92 : Emin= 0 eV Emax= 10 TeV
UrbanMsc90 : Emin= 0 eV Emax= 10 TeV
hIoni: for anti_proton SubType= 2
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
finalRange(mm)= 1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 10 TeV
ICRU73QO : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 10 TeV
msc: for kaon+ SubType= 10
Lambda tables from 100 eV to 10 TeV in 77 bins, spline: 1
RangeFactor= 0.2, stepLimitType: 0, latDisplacement: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc90 : Emin= 0 eV Emax= 10 TeV
hIoni: for kaon+ SubType= 2
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
finalRange(mm)= 1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 1.05231 MeV
BetheBloch : Emin= 1.05231 MeV Emax= 10 TeV
Bragg : Emin= 0 eV Emax= 1.05231 MeV
BetheBloch : Emin= 1.05231 MeV Emax= 10 TeV
hIoni: for kaon- SubType= 2
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
finalRange(mm)= 1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 1.05231 MeV
BetheBloch : Emin= 1.05231 MeV Emax= 10 TeV
ICRU73QO : Emin= 0 eV Emax= 1.05231 MeV
BetheBloch : Emin= 1.05231 MeV Emax= 10 TeV
msc: for mu+ SubType= 10
muMsc: for mu+ SubType= 10
Lambda tables from 100 eV to 10 TeV in 77 bins, spline: 1
RangeFactor= 0.04, step limit type: 1, lateralDisplacement: 1, skin= 3, geomFactor= 2.5
RangeFactor= 0.2, step limit type: 0, lateralDisplacement: 1, polarAngleLimit(deg)= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc92 : Emin= 0 eV Emax= 10 TeV
UrbanMsc90 : Emin= 0 eV Emax= 10 TeV
muIoni: for mu+ SubType= 2
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
finalRange(mm)= 1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 200 keV
BetheBloch : Emin= 200 keV Emax= 1 GeV
MuBetheBloch : Emin= 1 GeV Emax= 10 TeV
Bragg : Emin= 0 eV Emax= 200 keV
BetheBloch : Emin= 200 keV Emax= 1 GeV
MuBetheBloch : Emin= 1 GeV Emax= 10 TeV
muBrems: for mu+ SubType= 3
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
MuBrem : Emin= 0 eV Emax= 10 TeV
MuBrem : Emin= 0 eV Emax= 10 TeV
muPairProd: for mu+ SubType= 4
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
muPairProd : Emin= 0 eV Emax= 10 TeV
muPairProd : Emin= 0 eV Emax= 10 TeV
muIoni: for mu- SubType= 2
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
finalRange(mm)= 1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 200 keV
BetheBloch : Emin= 200 keV Emax= 1 GeV
MuBetheBloch : Emin= 1 GeV Emax= 10 TeV
ICRU73QO : Emin= 0 eV Emax= 200 keV
BetheBloch : Emin= 200 keV Emax= 1 GeV
MuBetheBloch : Emin= 1 GeV Emax= 10 TeV
muBrems: for mu- SubType= 3
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
MuBrem : Emin= 0 eV Emax= 10 TeV
MuBrem : Emin= 0 eV Emax= 10 TeV
muPairProd: for mu- SubType= 4
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
muPairProd : Emin= 0 eV Emax= 10 TeV
muPairProd : Emin= 0 eV Emax= 10 TeV
hIoni: for pi+ SubType= 2
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
finalRange(mm)= 1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 297.504 keV
BetheBloch : Emin= 297.504 keV Emax= 10 TeV
Bragg : Emin= 0 eV Emax= 297.505 keV
BetheBloch : Emin= 297.505 keV Emax= 10 TeV
msc: for pi- SubType= 10
Lambda tables from 100 eV to 10 TeV in 77 bins, spline: 1
RangeFactor= 0.04, step limit type: 1, lateralDisplacement: 1, skin= 3, geomFactor= 2.5
RangeFactor= 0.2, stepLimitType: 0, latDisplacement: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc92 : Emin= 0 eV Emax= 10 TeV
UrbanMsc90 : Emin= 0 eV Emax= 10 TeV
hIoni: for pi- SubType= 2
dE/dx and range tables from 100 eV to 10 TeV in 77 bins
Lambda tables from threshold to 10 TeV in 77 bins, spline: 1
finalRange(mm)= 1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 297.504 keV
BetheBloch : Emin= 297.504 keV Emax= 10 TeV
ICRU73QO : Emin= 0 eV Emax= 297.505 keV
BetheBloch : Emin= 297.505 keV Emax= 10 TeV
============================================================================================
HADRONIC PROCESSES SUMMARY (verbose level 1)
@@ -562,26 +328,26 @@ hIoni: for pi- SubType= 2
Number of event processed : 100
=============================================================
Volume | Tr.Entering | Population | Collisions | Coll*WGT | NumWGTedE | FluxWGTedE | Av.Tr.WGT | SL | SLW | SLW_v | SLWE | SLWE_v |
cell_00 | 13 | 113 | 0 | 0 | 5.61232 | 7.4371885 | 1 | 2916.5495 | 2916.5495 | 99.426314 | 21690.928 | 558.01229 |
cell_01 | 108 | 132 | 136 | 136 | 7.0757781 | 8.6292831 | 1 | 11502.96 | 11502.96 | 339.48587 | 99262.301 | 2402.1267 |
cell_02 | 71 | 166 | 190 | 95 | 7.6018819 | 8.5492627 | 0.5 | 15695.343 | 7847.6713 | 215.9572 | 67091.804 | 1641.6811 |
cell_03 | 81 | 175 | 224 | 56 | 6.5054625 | 7.7824432 | 0.25 | 17460.464 | 4365.1159 | 132.02292 | 33971.267 | 858.87014 |
cell_04 | 89 | 205 | 215 | 26.875 | 6.6073208 | 7.8888608 | 0.125 | 20939.742 | 2617.4677 | 78.9244 | 20648.839 | 521.47883 |
cell_05 | 109 | 241 | 313 | 19.5625 | 5.7494783 | 7.6812676 | 0.0625 | 25441.48 | 1590.0925 | 53.857143 | 12213.926 | 309.65047 |
cell_06 | 140 | 301 | 407 | 12.71875 | 5.4403433 | 7.4495959 | 0.03125 | 31598.471 | 987.45221 | 34.66688 | 7356.1199 | 188.59973 |
cell_07 | 151 | 347 | 498 | 7.78125 | 0.088116031 | 7.1492903 | 0.015625 | 36382.686 | 568.47947 | 1208.7925 | 4064.2247 | 106.51399 |
cell_08 | 155 | 361 | 531 | 4.1484375 | 1.4680023 | 6.7995311 | 0.0078125 | 38716.694 | 302.47417 | 37.475934 | 2056.6825 | 55.014755 |
cell_09 | 179 | 424 | 677 | 2.6445312 | 4.5133063 | 6.2518413 | 0.00390625 | 45265.981 | 176.82024 | 6.7640535 | 1105.4521 | 30.528245 |
cell_10 | 202 | 455 | 753 | 1.4707031 | 3.8733446 | 5.8949275 | 0.001953125 | 48997.89 | 95.699004 | 4.0969015 | 564.13869 | 15.868711 |
cell_11 | 231 | 535 | 856 | 0.8359375 | 3.6383551 | 5.7422032 | 0.0009765625 | 54743.91 | 53.460849 | 2.4056525 | 306.98306 | 8.752618 |
cell_12 | 280 | 581 | 1124 | 0.54882812 | 3.4327816 | 5.3593515 | 0.00048828125 | 69300.808 | 33.838285 | 1.5475193 | 181.35126 | 5.312296 |
cell_13 | 322 | 679 | 1269 | 0.30981445 | 3.2951856 | 5.1867546 | 0.00024414062 | 76063.426 | 18.570172 | 0.86847764 | 96.318927 | 2.861795 |
cell_14 | 341 | 721 | 1388 | 0.16943359 | 0.11698079 | 5.0065733 | 0.00012207031 | 84149.054 | 10.272101 | 13.259503 | 51.428028 | 1.551107 |
cell_15 | 381 | 818 | 1645 | 0.10040283 | 2.8460701 | 4.7402406 | 6.1035156e-05 | 94156.643 | 5.7468654 | 0.29552248 | 27.241525 | 0.84107769 |
cell_16 | 432 | 949 | 1887 | 0.05758667 | 2.6077252 | 4.6240132 | 3.0517578e-05 | 110208.38 | 3.3632929 | 0.18522521 | 15.551911 | 0.48301645 |
cell_17 | 450 | 994 | 2040 | 0.03112793 | 0.081788968 | 4.4480586 | 1.5258789e-05 | 113451.07 | 1.731126 | 2.9660188 | 7.7001498 | 0.24258762 |
cell_18 | 452 | 1048 | 2101 | 0.016029358 | 2.1453345 | 4.3717818 | 7.6293945e-06 | 114883.29 | 0.87648992 | 0.056295804 | 3.8318227 | 0.12077333 |
cell_19 | 523 | 523 | 0 | 0 | 1.9486462 | 4.2943207 | 7.6293945e-06 | 73499.256 | 0.56075482 | 0.038803644 | 2.408061 | 0.075614574 |
cell_00 | 12 | 110 | 0 | 0 | 3.54549 | 6.36644 | 1 | 2208.05 | 2208.05 | 107.407 | 14057.4 | 380.81 |
cell_01 | 111 | 131 | 147 | 147 | 5.29309 | 8.51705 | 1 | 11932.1 | 11932.1 | 463.061 | 101627 | 2451.02 |
cell_02 | 84 | 183 | 219 | 109.5 | 4.90694 | 7.93625 | 0.5 | 19027.8 | 9513.92 | 383.872 | 75504.9 | 1883.64 |
cell_03 | 96 | 232 | 265 | 66.25 | 6.39056 | 8.15035 | 0.25 | 22586.5 | 5646.63 | 179.815 | 46022 | 1149.12 |
cell_04 | 99 | 244 | 282 | 35.25 | 6.53407 | 8.25011 | 0.125 | 23554.3 | 2944.28 | 91.9055 | 24290.7 | 600.517 |
cell_05 | 119 | 275 | 349 | 21.8125 | 6.5135 | 8.08306 | 0.0625 | 26898.6 | 1681.16 | 52.1252 | 13588.9 | 339.517 |
cell_06 | 122 | 283 | 356 | 11.125 | 0.235982 | 7.78554 | 0.03125 | 30507.2 | 953.35 | 798.724 | 7422.35 | 188.485 |
cell_07 | 155 | 340 | 465 | 7.26562 | 5.7888 | 7.61331 | 0.015625 | 36772.9 | 574.577 | 19.3048 | 4374.44 | 111.752 |
cell_08 | 170 | 392 | 500 | 3.90625 | 5.76393 | 7.42877 | 0.0078125 | 40461 | 316.102 | 10.5324 | 2348.25 | 60.7078 |
cell_09 | 199 | 457 | 613 | 2.39453 | 5.06434 | 7.00493 | 0.00390625 | 47339.6 | 184.92 | 6.77585 | 1295.35 | 34.3152 |
cell_10 | 223 | 526 | 802 | 1.56641 | 0.513888 | 6.72099 | 0.00195312 | 56401.6 | 110.159 | 38.8938 | 740.381 | 19.9871 |
cell_11 | 230 | 530 | 762 | 0.744141 | 0.172789 | 6.47699 | 0.000976562 | 57321.5 | 55.9781 | 57.8205 | 362.57 | 9.99072 |
cell_12 | 266 | 610 | 923 | 0.450684 | 0.0398895 | 6.22794 | 0.000488281 | 64311.2 | 31.402 | 136.841 | 195.569 | 5.45852 |
cell_13 | 292 | 642 | 968 | 0.236328 | 0.377494 | 5.99031 | 0.000244141 | 74736.8 | 18.2463 | 8.25734 | 109.301 | 3.11709 |
cell_14 | 347 | 785 | 1287 | 0.157104 | 3.52879 | 5.72765 | 0.00012207 | 90154.8 | 11.0052 | 0.51839 | 63.034 | 1.82929 |
cell_15 | 403 | 913 | 1496 | 0.0913086 | 1.15807 | 5.53113 | 6.10352e-05 | 100279 | 6.12053 | 0.86102 | 33.8535 | 0.997118 |
cell_16 | 437 | 989 | 1647 | 0.0502625 | 3.53675 | 5.21223 | 3.05176e-05 | 112886 | 3.44501 | 0.152412 | 17.9562 | 0.539044 |
cell_17 | 501 | 1156 | 2048 | 0.03125 | 0.0872948 | 4.83994 | 1.52588e-05 | 125682 | 1.91775 | 3.28663 | 9.28182 | 0.286906 |
cell_18 | 499 | 1190 | 2128 | 0.0162354 | 0.660028 | 4.77121 | 7.62939e-06 | 130905 | 0.998722 | 0.224861 | 4.76512 | 0.148415 |
cell_19 | 537 | 537 | 0 | 0 | 3.20091 | 4.70408 | 7.62939e-06 | 75462.8 | 0.575735 | 0.0264912 | 2.7083 | 0.0847961 |
=============================================
=== G4ProcessPlacer::RemoveProcess: for: neutron
ProcessName: ImportanceProcess, will be removed!
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: B01PhysicsList.cc,v 1.8 2007/06/05 18:20:09 ahoward Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: B01PhysicsList.cc,v 1.9 2010/03/24 21:04:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
//
#include "globals.hh"
@@ -131,7 +131,9 @@ void B01PhysicsList::ConstructProcess()
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh"
#include "G4eMultipleScattering.hh"
#include "G4MuMultipleScattering.hh"
#include "G4hMultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
@@ -161,14 +163,14 @@ void B01PhysicsList::ConstructEM()
} else if (particleName == "e-") {
//electron
// Construct processes for electron
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eMultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
} else if (particleName == "e+") {
//positron
// Construct processes for positron
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eMultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
@@ -178,20 +180,20 @@ void B01PhysicsList::ConstructEM()
particleName == "mu-" ) {
//muon
// Construct processes for muon+
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4MuMultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4MuIonisation(),-1,2,2);
pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
} else if( particleName == "GenericIon" ) {
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hIonisation(),-1,2,2);
} else {
if ((particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")&&
(!particle->IsShortLived()) ) {
// all others charged particles except geantino
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hIonisation(),-1,2,2);
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.10 2009/03/06 09:49:18 gbarrand Exp $
# $Id: GNUmakefile,v 1.11 2010/01/11 16:25:08 gcosmo Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -15,7 +15,7 @@ G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../..
G4INSTALL = ../../../..
endif
.PHONY: all
+4 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.9 2009/03/16 09:44:12 gcosmo Exp $
$Id: History,v 1.10 2010/12/03 14:48:06 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
30 November 2010 Ivana Hrivnacova - B02-V09-03-00
- Migrated to use particle-based multiple-scattering.
6 March 2009 Guy Barrand - B02-V09-02-00
- GNUmakefile: removed logic for setting AIDA with G4ANALYSIS_USE.
since it already handled in the internal configuration scripts.
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: B02PhysicsList.cc,v 1.7 2007/06/22 13:38:55 ahoward Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: B02PhysicsList.cc,v 1.8 2010/11/30 11:41:14 ivana Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
#include "globals.hh"
@@ -130,16 +130,17 @@ void B02PhysicsList::ConstructProcess()
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh"
#include "G4eMultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuMultipleScattering.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hMultipleScattering.hh"
#include "G4hIonisation.hh"
void B02PhysicsList::ConstructEM()
@@ -160,14 +161,14 @@ void B02PhysicsList::ConstructEM()
} else if (particleName == "e-") {
//electron
// Construct processes for electron
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eMultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
} else if (particleName == "e+") {
//positron
// Construct processes for positron
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eMultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
@@ -177,20 +178,20 @@ void B02PhysicsList::ConstructEM()
particleName == "mu-" ) {
//muon
// Construct processes for muon+
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4MuMultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4MuIonisation(),-1,2,2);
pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
} else if( particleName == "GenericIon" ) {
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hIonisation(),-1,2,2);
} else {
if ((particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")&&
(!particle->IsShortLived()) ) {
// all others charged particles except geantino
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hIonisation(),-1,2,2);
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.10 2007/06/13 14:45:49 ahoward Exp $
# $Id: GNUmakefile,v 1.11 2010/01/11 16:27:16 gcosmo Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 08/04/02.
# --------------------------------------------------------------
@@ -9,7 +9,7 @@ endif
include $(G4INSTALL)/config/architecture.gmk
SUBDIRS = B01 B02
SUBDIRS = B01 B02 ReverseMC01
.PHONY : all clean clean_libs
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.1 2009/11/19 22:41:18 ldesorgh Exp $
# $Id: GNUmakefile,v 1.2 2010/01/11 16:25:59 gcosmo Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -14,7 +14,4 @@ endif
.PHONY: all
all: lib bin
CPPFLAGS +=
include $(G4INSTALL)/config/binmake.gmk
+22 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.4 2009/12/10 13:05:09 ldesorgh Exp $
$Id: History,v 1.9 2010/11/11 14:39:42 ldesorgh Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,27 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
11-November, 2010 L. Desorgher (ReverseMC01-V09-03-04)
- Add initialisation of thepIonisation in G4AdjointPhysicsList constructor.
- Modify some test on nb_event in RMC01AnalysisManager::ComputeMeanEdepAndError
and inRMC01AnalysisManager::EndOfEvent.
- Correct the density of Si in RMC01DetectorConstruction
and correct the position of the lower Ta plate.
21-October-2010, Gunter Folger (ReverseMC01-V09-03-03)
- fix compilation error on ambigous std::sqrt on Windows
19-October-2010, Gunter Folger (ReverseMC01-V09-03-02)
- src/RMC01AnalysisManager.cc: explicit conversion to G4int, to avoid compiler
warning
June 4th, 2010 J.Perl (ReverseMC01-V09-03-01)
- Updated vis usage.
May 12th, 2010 J.Allison (ReverseMC01-V09-03-00)
- Introduced G4Executive.
December 10th, 2009 L.Desorgher (ReverseMC01-V09-02-02)
-Update of the README file
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: exampleRMC01.cc,v 1.1 2009/11/19 22:41:18 ldesorgh Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: exampleRMC01.cc,v 1.2 2010/05/12 12:42:51 allison Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
//
//
// --------------------------------------------------------------
@@ -40,16 +40,6 @@
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#ifdef G4UI_USE_XM
#include "G4UIXm.hh"
#endif
#ifdef G4UI_USE_WIN32
#include "G4UIWin32.hh"
#endif
#include "Randomize.hh"
@@ -57,6 +47,9 @@
#include "G4VisExecutive.hh"
#endif
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
#include "G4AdjointSimManager.hh"
#include "RMC01DetectorConstruction.hh"
@@ -106,14 +99,6 @@ int main(int argc,char** argv) {
theAdjointSimManager->SetAdjointRunAction(theRunAction);
theAdjointSimManager->SetAdjointEventAction(new RMC01AdjointEventAction);
G4UIsession* session=0;
if (argc==1) // Define UI session for interactive mode.
{
session = new G4UIterminal(new G4UItcsh);
}
#ifdef G4VIS_USE
// visualization manager
G4VisManager* visManager = new G4VisExecutive;
@@ -122,19 +107,21 @@ int main(int argc,char** argv) {
#endif
// get the pointer to the User Interface manager
G4UImanager* UI = G4UImanager::GetUIpointer();
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if (session) // Define UI session for interactive mode.
if (argc!=1) // batch mode
{
// G4UIterminal is a (dumb) terminal.
session->SessionStart();
delete session;
}
else // Batch mode
{
G4String command = "/control/execute ";
G4String fileName = argv[1];
UI->ApplyCommand(command+fileName);
UImanager->ApplyCommand(command+fileName);
}
else
{ // interactive mode : define UI session
#ifdef G4UI_USE
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
ui->SessionStart();
delete ui;
#endif
}
// job termination
@@ -114,7 +114,7 @@ class VariableLengthPartition
side *ep_conv, size_t ep_conv_len);
VariableLengthPartition ();
~VariableLengthPartition () {};
const long get_elem_bin (double *data_point);
long get_elem_bin (double *data_point);
double get_bin_position (size_t bin_id);
size_t total_bins () {return nbin;}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AdjointPhysicsList.cc,v 1.2 2009/11/27 14:43:25 ldesorgh Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4AdjointPhysicsList.cc,v 1.3 2010/11/11 14:39:42 ldesorgh Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//////////////////////////////////////////////////////////////
// Class Name: G4AdjointPhysicsList
@@ -45,7 +45,7 @@ G4AdjointPhysicsList::G4AdjointPhysicsList(): G4VUserPhysicsList()
defaultCutValue = 1.0*mm;
SetVerboseLevel(1);
theeminusIonisation =0;
thepIonisation =0;
use_eionisation = true;
use_pionisation = false;
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01AnalysisManager.cc,v 1.4 2009/12/16 17:54:09 gunter Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: RMC01AnalysisManager.cc,v 1.7 2010/11/11 14:39:42 ldesorgh Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01AnalysisManager
@@ -316,7 +316,7 @@ void RMC01AnalysisManager::EndOfEvent(const G4Event* anEvent)
G4double n_adj_evt= nb_event/nb_evt_per_adj_evt;
// nb_event/nb_evt_per_adj_evt;
if (n_adj_evt*nb_evt_per_adj_evt == nb_event) {
nb_event =n_adj_evt;
nb_event =static_cast<G4int>(n_adj_evt);
factor=1.*G4AdjointSimManager::GetInstance()->GetNbEvtOfLastRun();
}
else nb_event=0;
@@ -325,7 +325,7 @@ void RMC01AnalysisManager::EndOfEvent(const G4Event* anEvent)
if (nb_event>0 && stop_run_if_precision_reached && precision_to_reach >relative_error) {
if (nb_event>100 && stop_run_if_precision_reached && precision_to_reach >relative_error) {
G4cout<<precision_to_reach*100.<<"% Precision reached!"<<std::endl;
theTimer->Stop();
elapsed_time+=theTimer->GetRealElapsed();
@@ -623,10 +623,10 @@ void RMC01AnalysisManager::ComputeMeanEdepAndError(const G4Event* anEvent,G4doub
}
//error computation
if (nb_event>0) {
if (nb_event>1) {
mean = accumulated_edep/nb_event;
G4double mean_x2 =accumulated_edep2/nb_event;
error = factor*std::sqrt(mean_x2-mean*mean)/std::sqrt(nb_event);
error = factor*std::sqrt(mean_x2-mean*mean)/std::sqrt(G4double(nb_event));
mean *=factor;
}
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01DetectorConstruction.cc,v 1.1 2009/11/19 22:41:18 ldesorgh Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: RMC01DetectorConstruction.cc,v 1.2 2010/11/11 14:39:42 ldesorgh Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01DetectorConstruction
@@ -109,7 +109,7 @@ void RMC01DetectorConstruction::DefineMaterials()
//
new G4Material("Aluminum", z=13., a=26.98*g/mole, density=2.700*g/cm3);
new G4Material("Silicon", z=14., a=28.09*g/mole, density=2.700*g/cm3);
new G4Material("Silicon", z=14., a=28.09*g/mole, density=2.33*g/cm3);
new G4Material("Tantalum", z=73., a=180.9479*g/mole, density=16.654*g/cm3);
@@ -251,7 +251,7 @@ G4VPhysicalVolume* RMC01DetectorConstruction::ConstructSimpleGeometry()
0);
new G4PVPlacement(0, //no rotation
G4ThreeVector(0.,0.,6.*cm), //at (0,0,0)
G4ThreeVector(0.,0.,-6.*cm), //at (0,0,0)
logicPlate, //its logical volume
"TantalumPlate2", //its name
logicBulkSphere, //its mother volume
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01EventAction.cc,v 1.1 2009/11/19 22:41:18 ldesorgh Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: RMC01EventAction.cc,v 1.2 2010/06/06 04:22:20 perl Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01EventAction
@@ -35,25 +35,6 @@
//////////////////////////////////////////////////////////////
#include "RMC01EventAction.hh"
#include "G4Event.hh"
#include "G4PrimaryVertex.hh"
#include "G4PrimaryParticle.hh"
#include "G4TrajectoryContainer.hh"
#include "G4VTrajectory.hh"
#include "G4VVisManager.hh"
#include "G4Polyline.hh"
#include "G4Polymarker.hh"
#include "G4Colour.hh"
#include "G4VisAttributes.hh"
#include "G4Trajectory.hh"
#include "G4TrajectoryPoint.hh"
#include "G4UnitsTable.hh"
#include "G4SDManager.hh"
#include "Randomize.hh"
#include <iomanip>
#include "RMC01SD.hh"
#include "RMC01AnalysisManager.hh"
RMC01EventAction::RMC01EventAction()
{;
@@ -82,7 +82,7 @@ VariableLengthPartition::VariableLengthPartition ()
}
////////////////////////////////////////////////////////////////////////////////
//
const long VariableLengthPartition::get_elem_bin (double *data_point)
long VariableLengthPartition::get_elem_bin (double *data_point)
{
//
//
@@ -0,0 +1,126 @@
#Define some geometrical parameters
###############################################
/RMC01/geometry/SetSensitiveVolumeHeight 1. mm
/RMC01/geometry/SetSensitiveVolumeRadius 1. mm
/RMC01/geometry/SetShieldingThickness 2. mm
#
#Select physics list
###############################################
#/adjoint_physics/UseProtonIonisation true
/adjoint_physics/UseGammaConversion false
/adjoint_physics/SetEminForAdjointModels 1. keV
/adjoint_physics/SetEmaxForAdjointModels 10. MeV
#
#Initialize geometry and physics
###############################################
/run/initialize
#
#Set cut
###############################################
/run/setCut 1.000e-02 mm
/control/verbose 1
#
#Definition of parameters for the Adjoint simulation
##################################
#Definition of the external source
/adjoint/DefineExtSourceOnExtSurfaceOfAVolume Shielding
/adjoint/SetExtSourceEmax 10. MeV
#Definition of the adjoint source
/adjoint/DefineAdjSourceOnExtSurfaceOfAVolume SensitiveVolume
/adjoint/SetAdjSourceEmin 1. keV
/adjoint/SetAdjSourceEmax 10. MeV
#Definition of the primary spectrum to which
#the results of the adjoint/reverse simulation will be normalised
/RMC01/analysis/SetExponentialSpectrumForAdjointSim e- 1. cm-2 1. 1e-3 10. MeV
#Definition of the precision in % that the computed energy deposited should reach
#before aborting the run.
/RMC01/analysis/SetExpectedPrecisionOfResults 1.
# Use this open statement to create an OpenGL view:
/vis/open OGL 600x600-0+0
#
# Use this open statement to create a .prim file suitable for
# viewing in DAWN:
#/vis/open DAWNFILE
#
# Use this open statement to create a .heprep file suitable for
# viewing in HepRApp:
#/vis/open HepRepFile
#
# Use this open statement to create a .wrl file suitable for
# viewing in a VRML viewer:
#/vis/open VRML2FILE
#
# Disable auto refresh and quieten vis messages whilst scene and
# trajectories are established:
/vis/viewer/set/autoRefresh false
/vis/verbose errors
#
# Draw geometry:
/vis/drawVolume
#
# Specify view angle:
#/vis/viewer/set/viewpointThetaPhi 90. 0.
#
# Specify zoom value:
#/vis/viewer/zoom 2.
#
# Specify style (surface or wireframe):
#/vis/viewer/set/style wireframe
#
# Draw coordinate axes:
#/vis/scene/add/axes 0 0 0 1 m
#
# Draw smooth trajectories at end of event, showing trajectory points
# as markers 2 pixels wide:
/vis/scene/add/trajectories smooth
/vis/modeling/trajectories/create/drawByCharge
/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
# (if too many tracks cause core dump => /tracking/storeTrajectory 0)
#
# Draw hits at end of event:
#/vis/scene/add/hits
#
# To draw only gammas:
#/vis/filtering/trajectories/create/particleFilter
#/vis/filtering/trajectories/particleFilter-0/add gamma
#
# To invert the above, drawing all particles except gammas,
# keep the above two lines but also add:
#/vis/filtering/trajectories/particleFilter-0/invert true
#
# Many other options are available with /vis/modeling and /vis/filtering.
# For example, to select colour by particle ID:
#/vis/modeling/trajectories/create/drawByParticleID
#/vis/modeling/trajectories/drawByParticleID-0/set e- blue
#
# To superimpose all of the events from a given run:
#/vis/scene/endOfEventAction accumulate
#
# Re-establish auto refreshing and verbosity:
/vis/viewer/set/autoRefresh true
/vis/verbose warnings
#
# For file-based drivers, use this to create an empty detector view:
/vis/viewer/flush
/run/verbose 1
/tracking/verbose 0
/adjoint/start_run 10
@@ -1,11 +1,11 @@
$Id: History,v 1.16 2009/11/17 22:48:26 maire Exp $
$Id: History,v 1.23 2010/11/02 15:00:30 allison Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
TestEm1 History file
TestEm0 History file
--------------------
This file should be used by the G4 example coordinator to briefly
summarize all major modifications introduced in the code and keep
@@ -15,6 +15,26 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
02-02-10 ja (testem0-V09-03-05)
- TestEm0.cc :
Removal of #include "G4UIterminal.hh" and #include "G4UItcsh.hh".
17-05-10 mma (testem0-V09-03-04)
- TestEm0.cc : introduction of G4UIExecutive
10-05-10 mma (testem0-V09-03-03)
- RunAction - reverse order: ComputeCrossSection, then GetCrossSection
06-04-10 V.Ivant (testem0-V09-03-02)
- RunAction - printout both GetCrossSection and ComputeCrossSection
29-03-10 mma (testem0-V09-03-01)
- RunAction - come back to "Get.." methods
23-03-10 V.Ivant (testem0-V09-03-00)
- new PhysicsLists : emstandard_opt0,1,2,3
- RunAction - use calculator methods "Compute.." instead of "Get.."
17-11-09 mma (testem0-V09-02-01)
- new PhysicsLists : livermore, penelope
remove runManger->Initialize() from TestEm0.cc
@@ -24,22 +24,24 @@
// ********************************************************************
//
//
// $Id: TestEm0.cc,v 1.5 2009/11/17 22:48:26 maire Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: TestEm0.cc,v 1.7 2010/11/02 15:00:31 allison Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc,char** argv) {
@@ -66,16 +68,12 @@ int main(int argc,char** argv) {
else // define UI terminal for interactive mode
{
G4UIsession * session = 0;
#ifdef G4UI_USE_TCSH
session = new G4UIterminal(new G4UItcsh);
#else
session = new G4UIterminal();
#endif
session->SessionStart();
delete session;
#ifdef G4UI_USE
G4UIExecutive * ui = new G4UIExecutive(argc,argv);
ui->SessionStart();
delete ui;
#endif
}
// job termination
//
delete runManager;
@@ -1,11 +1,11 @@
# $Id: TestEm0.in,v 1.3 2009/11/17 22:48:26 maire Exp $
# $Id: TestEm0.in,v 1.4 2010/03/23 09:17:42 vnivanch Exp $
#
# Macro file for "TestEm0.cc"
#
/control/verbose 0
/run/verbose 0
#
/testem/phys/addPhysics standard
/testem/phys/addPhysics emstandard_opt0
/run/initialize
#
/testem/det/setMat Germanium
@@ -4,7 +4,7 @@
############################################
*************************************************************
Geant4 version Name: geant4-09-03-ref-00 (18-December-2009)
Geant4 version Name: geant4-09-04-ref-00 (17-December-2010)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
@@ -13,63 +13,63 @@
***** Table : Nb of materials = 16 *****
Material: Air density: 1.290 mg/cm3 RadL: 285.161 m Nucl.Int.Length: 662.680 m Imean: 85.684 eV temperature: 273.15 K pressure: 1.00 atm
Material: Air density: 1.290 mg/cm3 RadL: 285.161 m Nucl.Int.Length: 662.904 m Imean: 85.703 eV temperature: 273.15 K pressure: 1.00 atm
---> Element: Nitrogen (N) Z = 7.0 N = 14.0 A = 14.01 g/mole ElmMassFraction: 70.00 % ElmAbundance 72.71 %
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 30.00 % ElmAbundance 27.29 %
Material: H2liquid density: 70.800 mg/cm3 RadL: 8.923 m Nucl.Int.Length: 4.960 m Imean: 21.800 eV
Material: H2liquid density: 70.800 mg/cm3 RadL: 8.923 m Nucl.Int.Length: 4.993 m Imean: 19.200 eV
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Water density: 1.000 g/cm3 RadL: 36.092 cm Nucl.Int.Length: 75.416 cm Imean: 75.000 eV
Material: Water density: 1.000 g/cm3 RadL: 36.092 cm Nucl.Int.Length: 75.537 cm Imean: 75.000 eV
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 11.21 % ElmAbundance 66.67 %
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 88.79 % ElmAbundance 33.33 %
Material: WaterSteam density: 1.000 mg/cm3 RadL: 360.924 m Nucl.Int.Length: 754.163 m Imean: 71.600 eV temperature: 273.15 K pressure: 1.00 atm
Material: WaterSteam density: 1.000 mg/cm3 RadL: 360.924 m Nucl.Int.Length: 755.365 m Imean: 71.600 eV temperature: 273.15 K pressure: 1.00 atm
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 11.21 % ElmAbundance 66.67 %
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 88.79 % ElmAbundance 33.33 %
Material: BGO density: 7.100 g/cm3 RadL: 1.123 cm Nucl.Int.Length: 22.806 cm Imean: 469.142 eV
Material: BGO density: 7.100 g/cm3 RadL: 1.123 cm Nucl.Int.Length: 22.788 cm Imean: 473.785 eV
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 15.41 % ElmAbundance 63.16 %
---> Element: Germanium (Ge) Z = 32.0 N = 72.6 A = 72.59 g/mole ElmMassFraction: 17.48 % ElmAbundance 15.79 %
---> Element: Bismuth (Bi) Z = 83.0 N = 209.0 A = 208.98 g/mole ElmMassFraction: 67.10 % ElmAbundance 21.05 %
Material: Aluminium density: 2.700 g/cm3 RadL: 8.893 cm Nucl.Int.Length: 38.879 cm Imean: 166.400 eV
Material: Aluminium density: 2.700 g/cm3 RadL: 8.893 cm Nucl.Int.Length: 38.860 cm Imean: 166.000 eV
---> Element: Aluminium ( ) Z = 13.0 N = 27.0 A = 26.98 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Silicon density: 2.330 g/cm3 RadL: 9.368 cm Nucl.Int.Length: 45.663 cm Imean: 173.600 eV
Material: Silicon density: 2.330 g/cm3 RadL: 9.368 cm Nucl.Int.Length: 45.761 cm Imean: 173.000 eV
---> Element: Silicon ( ) Z = 14.0 N = 28.1 A = 28.09 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: liquidArgon density: 1.390 g/cm3 RadL: 14.065 cm Nucl.Int.Length: 86.078 cm Imean: 187.200 eV
Material: liquidArgon density: 1.390 g/cm3 RadL: 14.065 cm Nucl.Int.Length: 86.006 cm Imean: 188.000 eV
---> Element: liquidArgon ( ) Z = 18.0 N = 40.0 A = 39.95 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Iron density: 7.870 g/cm3 RadL: 1.759 cm Nucl.Int.Length: 16.999 cm Imean: 286.000 eV
Material: Iron density: 7.870 g/cm3 RadL: 1.759 cm Nucl.Int.Length: 16.969 cm Imean: 286.000 eV
---> Element: Iron ( ) Z = 26.0 N = 55.8 A = 55.85 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Copper density: 8.960 g/cm3 RadL: 1.436 cm Nucl.Int.Length: 15.588 cm Imean: 321.900 eV
Material: Copper density: 8.960 g/cm3 RadL: 1.436 cm Nucl.Int.Length: 15.515 cm Imean: 322.000 eV
---> Element: Copper ( ) Z = 29.0 N = 63.5 A = 63.55 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Germanium density: 5.323 g/cm3 RadL: 2.301 cm Nucl.Int.Length: 27.431 cm Imean: 332.800 eV
Material: Germanium density: 5.323 g/cm3 RadL: 2.301 cm Nucl.Int.Length: 27.333 cm Imean: 350.000 eV
---> Element: Germanium ( ) Z = 32.0 N = 72.6 A = 72.61 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Silver density: 10.500 g/cm3 RadL: 8.543 mm Nucl.Int.Length: 15.868 cm Imean: 470.000 eV
Material: Silver density: 10.500 g/cm3 RadL: 8.543 mm Nucl.Int.Length: 15.855 cm Imean: 470.000 eV
---> Element: Silver ( ) Z = 47.0 N = 107.9 A = 107.87 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Tungsten density: 19.300 g/cm3 RadL: 3.504 mm Nucl.Int.Length: 10.312 cm Imean: 725.200 eV
Material: Tungsten density: 19.300 g/cm3 RadL: 3.504 mm Nucl.Int.Length: 10.306 cm Imean: 727.000 eV
---> Element: Tungsten ( ) Z = 74.0 N = 183.8 A = 183.85 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Lead density: 11.350 g/cm3 RadL: 5.612 mm Nucl.Int.Length: 18.247 cm Imean: 820.000 eV
Material: Lead density: 11.350 g/cm3 RadL: 5.612 mm Nucl.Int.Length: 18.258 cm Imean: 823.000 eV
---> Element: Lead ( ) Z = 82.0 N = 207.2 A = 207.19 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Uranium density: 18.950 g/cm3 RadL: 3.166 mm Nucl.Int.Length: 11.446 cm Imean: 892.400 eV
Material: Uranium density: 18.950 g/cm3 RadL: 3.166 mm Nucl.Int.Length: 11.447 cm Imean: 890.000 eV
---> Element: Uranium ( ) Z = 92.0 N = 238.0 A = 238.03 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: ams density: 7.409 g/cm3 RadL: 8.996 mm Nucl.Int.Length: 25.517 cm Imean: 688.154 eV
Material: ams density: 7.409 g/cm3 RadL: 8.996 mm Nucl.Int.Length: 25.536 cm Imean: 691.183 eV
---> Element: Lead (Pb) Z = 82.0 N = 207.2 A = 207.19 g/mole ElmMassFraction: 94.81 % ElmAbundance 36.54 %
---> Element: Carbon (C) Z = 6.0 N = 12.0 A = 12.01 g/mole ElmMassFraction: 4.79 % ElmAbundance 31.84 %
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 0.40 % ElmAbundance 31.62 %
PhysicsList::AddPhysicsList: <standard>
PhysicsList::AddPhysicsList: <emstandard_opt0>
========= Table of registered couples ==============================
@@ -87,14 +87,15 @@ Index : 0 used in the geometry : Yes recalculation needed : No
processes : phot compt conv total
cross section per atom : 1.71686 barn 11.0976 barn 0 pbarn 12.8145 barn
cross section per atom : 1.71686 barn 11.0976 barn 0 pbarn 12.8145 barn
cross section per volume : 0.075796 cm^-1 0.489937 cm^-1 0 cm^-1 0.565733 cm^-1
cross section per mass : 0.0142393 cm2/g 0.0920415 cm2/g 0 cm2/g 0.106281 cm2/g
compCrossSectionPerVolume : 0.075796 cm^-1 0.489937 cm^-1 0 cm^-1 0.565733 cm^-1
cross section per volume : 0 cm^-1 0.489922 cm^-1 0 cm^-1 0.489922 cm^-1
cross section per mass : 0 cm2/g 0.0920387 cm2/g 0 cm2/g 0.0920387 cm2/g
mean free path : 13.1933 cm 2.04108 cm 5.82593e+288 pc 1.76762 cm
(g/cm2) : 70.228 g/cm2 10.8647 g/cm2 2.88022e+285 kg/cm2 9.40904 g/cm2
mean free path : 5.82593e+288 pc 2.04114 cm 5.82593e+288 pc 2.04114 cm
(g/cm2) : 2.88022e+285 kg/cm2 10.865 g/cm2 2.88022e+285 kg/cm2 10.865 g/cm2
-------------------------------------------------------------
@@ -104,24 +105,25 @@ Index : 0 used in the geometry : Yes recalculation needed : No
Range cuts : gamma 100 um e- 100 um
Energy cuts : gamma 1.11344 keV e- 85.1138 keV
Max_energy _transferable : 10 MeV (4.9049 cm )
Max_energy _transferable : 10 MeV (4.90425 cm )
processes : eIoni eBrem total
cross section per volume : 0.994761 cm^-1 0.343859 cm^-1 1.33862 cm^-1
cross section per mass : 0.994761 cm2/g 0.343859 cm2/g 1.33862 cm2/g
compCrossSectionPerVolume : 0.994761 cm^-1 0.342573 cm^-1 1.33733 cm^-1
cross section per volume : 0.994761 cm^-1 0.342573 cm^-1 1.33733 cm^-1
cross section per mass : 0.994761 cm2/g 0.342573 cm2/g 1.33733 cm2/g
mean free path : 1.00527 cm 2.90817 cm 7.47038 mm
(g/cm2) : 1.00527 g/cm2 2.90817 g/cm2 747.038 mg/cm2
mean free path : 1.00527 cm 2.91908 cm 7.47756 mm
(g/cm2) : 1.00527 g/cm2 2.91908 g/cm2 747.756 mg/cm2
restricted dE/dx : 1.61536 MeV/cm 12.5324 eV/cm 1.61538 MeV/cm
(MeV/g/cm2) : 1.61536 MeV*cm2/g 12.5324 eV*cm2/g 1.61538 MeV*cm2/g
range from restrict dE/dx: 6.05854 cm ( 6.05854 g/cm2 )
range from full dE/dx : 4.9049 cm ( 4.9049 g/cm2 )
range from restrict dE/dx: 6.05865 cm ( 6.05865 g/cm2 )
range from full dE/dx : 4.90425 cm ( 4.90425 g/cm2 )
transport mean free path : 28.2437 cm ( 28.2437 g/cm2 )
transport mean free path : 27.9107 cm ( 27.9107 g/cm2 )
critical energy (Rossi) : 78.7733 MeV
Moliere radius : 0.269193 X0 = 9.71583 cm
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: PhysicsList.cc,v 1.8 2009/11/17 22:48:26 maire Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: PhysicsList.cc,v 1.9 2010/03/21 19:07:53 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -34,6 +34,10 @@
#include "PhysicsListMessenger.hh"
#include "PhysListEmStandard.hh"
#include "G4EmStandardPhysics.hh"
#include "G4EmStandardPhysics_option1.hh"
#include "G4EmStandardPhysics_option2.hh"
#include "G4EmStandardPhysics_option3.hh"
#include "G4EmLivermorePhysics.hh"
#include "G4EmPenelopePhysics.hh"
@@ -57,7 +61,7 @@ PhysicsList::PhysicsList()
SetVerboseLevel(1);
// EM physics
emName = G4String("standard");
emName = G4String("local");
emPhysicsList = new PhysListEmStandard(emName);
}
@@ -188,16 +192,16 @@ void PhysicsList::ConstructProcess()
//physics tables
//
emOptions.SetMinEnergy(100*eV); //default
emOptions.SetMaxEnergy(100*TeV); //default
emOptions.SetDEDXBinning(12*20); //default=12*7
emOptions.SetLambdaBinning(12*20); //default=12*7
//emOptions.SetMinEnergy(100*eV); //default
//emOptions.SetMaxEnergy(100*TeV); //default
//emOptions.SetDEDXBinning(12*20); //default=12*7
//emOptions.SetLambdaBinning(12*20); //default=12*7
emOptions.SetBuildCSDARange(true);
emOptions.SetMaxEnergyForCSDARange(100*TeV);
emOptions.SetDEDXBinningForCSDARange(12*20);
//emOptions.SetMaxEnergyForCSDARange(100*TeV);
//emOptions.SetDEDXBinningForCSDARange(12*20);
emOptions.SetSplineFlag(true); //default
//emOptions.SetSplineFlag(true); //default
emOptions.SetVerbose(0);
}
@@ -212,18 +216,38 @@ void PhysicsList::AddPhysicsList(const G4String& name)
if (name == emName) return;
if (name == "standard") {
if (name == "local") {
emName = name;
delete emPhysicsList;
emPhysicsList = new PhysListEmStandard(name);
} else if (name == "penelope"){
} else if (name == "emstandard_opt0"){
emName = name;
delete emPhysicsList;
emPhysicsList = new G4EmStandardPhysics();
} else if (name == "emstandard_opt1"){
emName = name;
delete emPhysicsList;
emPhysicsList = new G4EmStandardPhysics_option1();
} else if (name == "emstandard_opt2"){
emName = name;
delete emPhysicsList;
emPhysicsList = new G4EmStandardPhysics_option2();
} else if (name == "emstandard_opt3"){
emName = name;
delete emPhysicsList;
emPhysicsList = new G4EmStandardPhysics_option3();
} else if (name == "empenelope"){
emName = name;
delete emPhysicsList;
emPhysicsList = new G4EmPenelopePhysics();
} else if (name == "livermore"){
} else if (name == "emlivermore"){
emName = name;
delete emPhysicsList;
emPhysicsList = new G4EmLivermorePhysics();
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RunAction.cc,v 1.10 2007/12/17 17:22:44 maire Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: RunAction.cc,v 1.15 2010/05/10 13:45:49 maire Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -103,7 +103,7 @@ void RunAction::BeginOfRunAction(const G4Run*)
(2*electron_mass_c2*gamM1*gamP1)/(1.+2*gam*moverM+moverM*moverM);
G4double range = emCal.GetCSDARange(Tmax,G4Electron::Electron(),material);
G4cout << "\n Max_energy _transferable : " << G4BestUnit(Tmax,"Energy")
G4cout << "\n Max_energy _transferable : " << G4BestUnit(Tmax,"Energy")
<< " (" << G4BestUnit(range,"Length") << ")" << G4endl;
}
@@ -147,7 +147,7 @@ void RunAction::BeginOfRunAction(const G4Run*)
}
sigma0.push_back(sigtot);
G4cout << "\n \n cross section per atom : ";
G4cout << "\n \n cross section per atom : ";
for (size_t j=0; j<sigma0.size();j++) {
G4cout << "\t" << std::setw(13) << G4BestUnit(sigma0[j], "Surface");
}
@@ -155,30 +155,39 @@ void RunAction::BeginOfRunAction(const G4Run*)
}
//get cross section per volume
std::vector<G4double> sigma0;
std::vector<G4double> sigma1;
std::vector<G4double> sigma2;
G4double Sig, Sigtot = 0.;
std::vector<G4double> sigma2;
G4double Sig, SigtotComp = 0., Sigtot = 0.;
for (size_t j=0; j<emName.size();j++) {
Sig = emCal.GetCrossSectionPerVolume(energy,particle,emName[j],material);
if (Sig == 0.) Sig = emCal.ComputeCrossSectionPerVolume
(energy,particle,emName[j],material,enerCut[j]);
Sigtot += Sig;
Sig = emCal.ComputeCrossSectionPerVolume
(energy,particle,emName[j],material,enerCut[j]);
SigtotComp += Sig;
sigma0.push_back(Sig);
Sig = emCal.GetCrossSectionPerVolume(energy,particle,emName[j],material);
Sigtot += Sig;
sigma1.push_back(Sig);
sigma2.push_back(Sig/density);
}
sigma0.push_back(SigtotComp);
sigma1.push_back(Sigtot);
sigma2.push_back(Sigtot/density);
//print cross sections
G4cout << "\n \n cross section per volume : ";
G4cout << "\n \n compCrossSectionPerVolume : ";
for (size_t j=0; j<sigma0.size();j++) {
G4cout << "\t" << std::setw(13) << sigma0[j]*cm << " cm^-1";
}
G4cout << "\n cross section per volume : ";
for (size_t j=0; j<sigma1.size();j++) {
G4cout << "\t" << std::setw(13) << sigma1[j]*cm << " cm^-1";
}
G4cout << "\n cross section per mass : ";
for (size_t j=0; j<sigma2.size();j++) {
G4cout << "\t" << std::setw(13) << G4BestUnit(sigma2[j], "Surface/Mass");
G4cout << "\t" << std::setw(13)
<< G4BestUnit(sigma2[j], "Surface/Mass");
}
//print mean free path
@@ -1,4 +1,4 @@
$Id: History,v 1.93 2009/11/13 15:44:28 maire Exp $
$Id: History,v 1.97 2010/11/09 21:00:43 asaim Exp $
-------------------------------------------------------------------
=========================================================
@@ -14,6 +14,19 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
09-11-10 M.Asai (testem1-V09-03-03)
- Fix AIDA file option.
06-06-10 J.Perl (testem1-V09-03-02)
- Remove unused variable in EventAction
03-06-10 J.Perl (testem1-V09-03-01)
- Updated vis usage
06-04-10 mma (testem1-V09-03-00)
- RunAction: replace ProcessCount by map<string, int>
- TestEm1.cc : introduction of G4UIExecutive
13-11-09 mma (testem1-V09-02-01)
- PhysListEmStandard.cc (local): eMultipleScattering -> UrbanMscModel93
@@ -1,4 +1,4 @@
$Id: README,v 1.27 2009/09/15 12:51:49 maire Exp $
$Id: README,v 1.28 2010/06/06 04:25:24 perl Exp $
-------------------------------------------------------------------
=========================================================
@@ -71,8 +71,6 @@ $Id: README,v 1.27 2009/09/15 12:51:49 maire Exp $
The detector has a default view which is a longitudinal view of the box.
The tracks are drawn at the end of event, and erased at the end of run.
Optionaly one can choose to draw all particles, only the charged, or none.
This command is defined in EventActionMessenger class.
5 - PHYSICS SURVEY
@@ -24,16 +24,14 @@
// ********************************************************************
//
//
// $Id: TestEm1.cc,v 1.15 2007/06/21 17:10:11 maire Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: TestEm1.cc,v 1.16 2010/04/06 11:11:24 maire Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
@@ -51,6 +49,10 @@
#include "G4VisExecutive.hh"
#endif
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc,char** argv) {
@@ -99,15 +101,12 @@ int main(int argc,char** argv) {
visManager->Initialize();
#endif
G4UIsession * session = 0;
#ifdef G4UI_USE_TCSH
session = new G4UIterminal(new G4UItcsh);
#else
session = new G4UIterminal();
#endif
session->SessionStart();
delete session;
#ifdef G4UI_USE
G4UIExecutive * ui = new G4UIExecutive(argc,argv);
ui->SessionStart();
delete ui;
#endif
#ifdef G4VIS_USE
delete visManager;
#endif
@@ -4,7 +4,7 @@
############################################
*************************************************************
Geant4 version Name: geant4-09-03-ref-00 (18-December-2009)
Geant4 version Name: geant4-09-04-ref-00 (17-December-2010)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
@@ -13,51 +13,51 @@
***** Table : Nb of materials = 14 *****
Material: Air density: 1.290 mg/cm3 RadL: 285.161 m Nucl.Int.Length: 662.680 m Imean: 85.684 eV temperature: 273.15 K pressure: 1.00 atm
Material: Air density: 1.290 mg/cm3 RadL: 285.161 m Nucl.Int.Length: 662.904 m Imean: 85.703 eV temperature: 273.15 K pressure: 1.00 atm
---> Element: Nitrogen (N) Z = 7.0 N = 14.0 A = 14.01 g/mole ElmMassFraction: 70.00 % ElmAbundance 72.71 %
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 30.00 % ElmAbundance 27.29 %
Material: H2liquid density: 70.800 mg/cm3 RadL: 8.923 m Nucl.Int.Length: 4.960 m Imean: 21.800 eV
Material: H2liquid density: 70.800 mg/cm3 RadL: 8.923 m Nucl.Int.Length: 4.993 m Imean: 19.200 eV
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Water density: 1.000 g/cm3 RadL: 36.092 cm Nucl.Int.Length: 75.416 cm Imean: 75.000 eV
Material: Water density: 1.000 g/cm3 RadL: 36.092 cm Nucl.Int.Length: 75.537 cm Imean: 75.000 eV
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 11.21 % ElmAbundance 66.67 %
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 88.79 % ElmAbundance 33.33 %
Material: CO2 density: 0.001 kg/m3 RadL: 361.873 km Nucl.Int.Length: 858.384 km Imean: 90.164 eV temperature: 273.15 K pressure: 1.00 atm
Material: CO2 density: 0.001 kg/m3 RadL: 361.873 km Nucl.Int.Length: 858.384 km Imean: 90.958 eV temperature: 273.15 K pressure: 1.00 atm
---> Element: Hydrogen (C) Z = 6.0 N = 12.0 A = 12.00 g/mole ElmMassFraction: 27.27 % ElmAbundance 33.33 %
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 72.73 % ElmAbundance 66.67 %
Material: D2_gas density: 0.036 kg/m3 RadL: 13.184 km Nucl.Int.Length: 12.278 km Imean: 41.800 eV temperature: 273.15 K pressure: 1.00 atm
Material: D2_gas density: 0.036 kg/m3 RadL: 13.184 km Nucl.Int.Length: 12.336 km Imean: 41.800 eV temperature: 273.15 K pressure: 1.00 atm
---> Element: D2_gas ( ) Z = 2.0 N = 2.0 A = 2.01 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: liquidArgon density: 1.390 g/cm3 RadL: 14.065 cm Nucl.Int.Length: 86.078 cm Imean: 187.200 eV
Material: liquidArgon density: 1.390 g/cm3 RadL: 14.065 cm Nucl.Int.Length: 86.006 cm Imean: 188.000 eV
---> Element: liquidArgon ( ) Z = 18.0 N = 40.0 A = 39.95 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Aluminium density: 2.700 g/cm3 RadL: 8.893 cm Nucl.Int.Length: 38.879 cm Imean: 166.400 eV
Material: Aluminium density: 2.700 g/cm3 RadL: 8.893 cm Nucl.Int.Length: 38.860 cm Imean: 166.000 eV
---> Element: Aluminium ( ) Z = 13.0 N = 27.0 A = 26.98 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Silicon density: 2.330 g/cm3 RadL: 9.368 cm Nucl.Int.Length: 45.663 cm Imean: 173.600 eV
Material: Silicon density: 2.330 g/cm3 RadL: 9.368 cm Nucl.Int.Length: 45.761 cm Imean: 173.000 eV
---> Element: Silicon ( ) Z = 14.0 N = 28.1 A = 28.09 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Germanium density: 5.323 g/cm3 RadL: 2.301 cm Nucl.Int.Length: 27.431 cm Imean: 332.800 eV
Material: Germanium density: 5.323 g/cm3 RadL: 2.301 cm Nucl.Int.Length: 27.333 cm Imean: 350.000 eV
---> Element: Germanium ( ) Z = 32.0 N = 72.6 A = 72.61 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: BGO density: 7.100 g/cm3 RadL: 1.123 cm Nucl.Int.Length: 22.806 cm Imean: 469.142 eV
Material: BGO density: 7.100 g/cm3 RadL: 1.123 cm Nucl.Int.Length: 22.788 cm Imean: 473.785 eV
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 15.41 % ElmAbundance 63.16 %
---> Element: Germanium (Ge) Z = 32.0 N = 72.6 A = 72.59 g/mole ElmMassFraction: 17.48 % ElmAbundance 15.79 %
---> Element: Bismuth (Bi) Z = 83.0 N = 209.0 A = 208.98 g/mole ElmMassFraction: 67.10 % ElmAbundance 21.05 %
Material: Iron density: 7.870 g/cm3 RadL: 1.759 cm Nucl.Int.Length: 16.999 cm Imean: 286.000 eV
Material: Iron density: 7.870 g/cm3 RadL: 1.759 cm Nucl.Int.Length: 16.969 cm Imean: 286.000 eV
---> Element: Iron ( ) Z = 26.0 N = 55.8 A = 55.85 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Tungsten density: 19.300 g/cm3 RadL: 3.504 mm Nucl.Int.Length: 10.312 cm Imean: 725.200 eV
Material: Tungsten density: 19.300 g/cm3 RadL: 3.504 mm Nucl.Int.Length: 10.306 cm Imean: 727.000 eV
---> Element: Tungsten ( ) Z = 74.0 N = 183.8 A = 183.85 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Lead density: 11.350 g/cm3 RadL: 5.612 mm Nucl.Int.Length: 18.247 cm Imean: 820.000 eV
Material: Lead density: 11.350 g/cm3 RadL: 5.612 mm Nucl.Int.Length: 18.258 cm Imean: 823.000 eV
---> Element: Lead ( ) Z = 82.0 N = 207.2 A = 207.19 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
Material: Uranium density: 18.950 g/cm3 RadL: 3.166 mm Nucl.Int.Length: 11.446 cm Imean: 892.400 eV
Material: Uranium density: 18.950 g/cm3 RadL: 3.166 mm Nucl.Int.Length: 11.447 cm Imean: 890.000 eV
---> Element: Uranium ( ) Z = 92.0 N = 238.0 A = 238.03 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
@@ -96,30 +96,30 @@ PhysicsList::SetCuts:CutLength : 1 mm
phot: for gamma SubType= 12
===== EM models for the G4Region DefaultRegionForTheWorld ======
PhotoElectric : Emin= 0 eV Emax= 100 TeV
PhotoElectric : Emin= 0 eV Emax= 100 TeV
compt: for gamma SubType= 13
Lambda tables from 100 eV to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
Klein-Nishina : Emin= 0 eV Emax= 100 TeV
Klein-Nishina : Emin= 0 eV Emax= 100 TeV
conv: for gamma SubType= 14
Lambda tables from 1.022 MeV to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bethe-Heitler : Emin= 0 eV Emax= 100 TeV
BetheHeitler : Emin= 0 eV Emax= 100 TeV
msc: for e- SubType= 10
Lambda tables from 100 eV to 100 TeV in 240 bins, spline: 1
RangeFactor= 0.04, step limit type: 2, lateralDisplacement: 1, skin= 3, geomFactor= 2.5
RangeFactor= 0.04, stepLimitType: 2, latDisplacement: 1, skin= 3, geomFactor= 2.5
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc93 : Emin= 0 eV Emax= 100 TeV
UrbanMsc93 : Emin= 0 eV Emax= 100 TeV
eIoni: for e- SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
MollerBhabha : Emin= 0 eV Emax= 100 TeV
MollerBhabha : Emin= 0 eV Emax= 100 TeV
CSDA range table up to 1 GeV in 160 bins
eBrem: for e- SubType= 3
@@ -127,15 +127,15 @@ eBrem: for e- SubType= 3
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
LPM flag: 1 for E > 1 GeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
eBrem : Emin= 0 eV Emax= 1 GeV
eBremRel : Emin= 1 GeV Emax= 100 TeV
eBrem : Emin= 0 eV Emax= 1 GeV AngularGenUrban
eBremLPM : Emin= 1 GeV Emax= 100 TeV AngularGenUrban
eIoni: for e+ SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
MollerBhabha : Emin= 0 eV Emax= 100 TeV
MollerBhabha : Emin= 0 eV Emax= 100 TeV
CSDA range table up to 1 GeV in 160 bins
eBrem: for e+ SubType= 3
@@ -143,186 +143,186 @@ eBrem: for e+ SubType= 3
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
LPM flag: 1 for E > 1 GeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
eBrem : Emin= 0 eV Emax= 1 GeV
eBremRel : Emin= 1 GeV Emax= 100 TeV
eBrem : Emin= 0 eV Emax= 1 GeV AngularGenUrban
eBremLPM : Emin= 1 GeV Emax= 100 TeV AngularGenUrban
annihil: for e+ SubType= 5
Lambda tables from 100 eV to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
eplus2gg : Emin= 0 eV Emax= 100 TeV
eplus2gg : Emin= 0 eV Emax= 100 TeV
msc: for proton SubType= 10
Lambda tables from 100 eV to 100 TeV in 240 bins, spline: 1
RangeFactor= 0.04, stepLimitType: 2, latDisplacement: 1, skin= 3, geomFactor= 2.5
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc90 : Emin= 0 eV Emax= 100 TeV
UrbanMsc90 : Emin= 0 eV Emax= 100 TeV
hIoni: for proton SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 100 TeV
Bragg : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 100 TeV
CSDA range table up to 1 GeV in 160 bins
hBrems: for proton SubType= 3
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
hBrem : Emin= 0 eV Emax= 100 TeV
hBrem : Emin= 0 eV Emax= 100 TeV
hPairProd: for proton SubType= 4
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV
hPairProd : Emin= 0 eV Emax= 100 TeV
msc: for GenericIon SubType= 10
RangeFactor= 0.2, stepLimitType: 0, latDisplacement: 0, skin= 3, geomFactor= 2.5
RangeFactor= 0.2, stepLimitType: 0, latDisplacement: 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc90 : Emin= 0 eV Emax= 100 TeV
UrbanMsc90 : Emin= 0 eV Emax= 100 TeV
ionIoni: for GenericIon SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
Stopping Power data for 17 ion/material pairs, nuclearStopping: 1
Stopping Power data for 17 ion/material pairs
===== EM models for the G4Region DefaultRegionForTheWorld ======
BraggIon : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 100 TeV
BraggIon : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 100 TeV
CSDA range table up to 1 GeV in 160 bins
hIoni: for anti_proton SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 100 TeV
ICRU73QO : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 100 TeV
CSDA range table up to 1 GeV in 160 bins
msc: for kaon+ SubType= 10
Lambda tables from 100 eV to 100 TeV in 240 bins, spline: 1
RangeFactor= 0.04, stepLimitType: 2, latDisplacement: 1, skin= 3, geomFactor= 2.5
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc90 : Emin= 0 eV Emax= 100 TeV
hIoni: for kaon+ SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 1.05231 MeV
BetheBloch : Emin= 1.05231 MeV Emax= 100 TeV
Bragg : Emin= 0 eV Emax= 1.05231 MeV
BetheBloch : Emin= 1.05231 MeV Emax= 100 TeV
CSDA range table up to 1 GeV in 160 bins
hIoni: for kaon- SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 1.05231 MeV
BetheBloch : Emin= 1.05231 MeV Emax= 100 TeV
ICRU73QO : Emin= 0 eV Emax= 1.05231 MeV
BetheBloch : Emin= 1.05231 MeV Emax= 100 TeV
CSDA range table up to 1 GeV in 160 bins
muMsc: for mu+ SubType= 10
Lambda tables from 100 eV to 100 TeV in 240 bins, spline: 1
RangeFactor= 0.04, step limit type: 2, lateralDisplacement: 1, polarAngleLimit(deg)= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc90 : Emin= 0 eV Emax= 100 TeV
UrbanMsc90 : Emin= 0 eV Emax= 100 TeV
muIoni: for mu+ SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 200 keV
BetheBloch : Emin= 200 keV Emax= 1 GeV
MuBetheBloch : Emin= 1 GeV Emax= 100 TeV
Bragg : Emin= 0 eV Emax= 200 keV
BetheBloch : Emin= 200 keV Emax= 1 GeV
MuBetheBloch : Emin= 1 GeV Emax= 100 TeV
CSDA range table up to 1 GeV in 160 bins
muBrems: for mu+ SubType= 3
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
MuBrem : Emin= 0 eV Emax= 100 TeV
MuBrem : Emin= 0 eV Emax= 100 TeV
muPairProd: for mu+ SubType= 4
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
muPairProd : Emin= 0 eV Emax= 100 TeV
muPairProd : Emin= 0 eV Emax= 100 TeV
muIoni: for mu- SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 200 keV
BetheBloch : Emin= 200 keV Emax= 1 GeV
MuBetheBloch : Emin= 1 GeV Emax= 100 TeV
ICRU73QO : Emin= 0 eV Emax= 200 keV
BetheBloch : Emin= 200 keV Emax= 1 GeV
MuBetheBloch : Emin= 1 GeV Emax= 100 TeV
CSDA range table up to 1 GeV in 160 bins
muBrems: for mu- SubType= 3
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
MuBrem : Emin= 0 eV Emax= 100 TeV
MuBrem : Emin= 0 eV Emax= 100 TeV
muPairProd: for mu- SubType= 4
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
muPairProd : Emin= 0 eV Emax= 100 TeV
muPairProd : Emin= 0 eV Emax= 100 TeV
hIoni: for pi+ SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 297.504 keV
BetheBloch : Emin= 297.504 keV Emax= 100 TeV
Bragg : Emin= 0 eV Emax= 297.505 keV
BetheBloch : Emin= 297.505 keV Emax= 100 TeV
CSDA range table up to 1 GeV in 160 bins
hBrems: for pi+ SubType= 3
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
hBrem : Emin= 0 eV Emax= 100 TeV
hBrem : Emin= 0 eV Emax= 100 TeV
hPairProd: for pi+ SubType= 4
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV
hPairProd : Emin= 0 eV Emax= 100 TeV
msc: for pi- SubType= 10
Lambda tables from 100 eV to 100 TeV in 240 bins, spline: 1
RangeFactor= 0.04, stepLimitType: 2, latDisplacement: 1, skin= 3, geomFactor= 2.5
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc90 : Emin= 0 eV Emax= 100 TeV
UrbanMsc90 : Emin= 0 eV Emax= 100 TeV
hIoni: for pi- SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
NuclearStopping= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 eV Emax= 297.504 keV
BetheBloch : Emin= 297.504 keV Emax= 100 TeV
ICRU73QO : Emin= 0 eV Emax= 297.505 keV
BetheBloch : Emin= 297.505 keV Emax= 100 TeV
CSDA range table up to 1 GeV in 160 bins
hBrems: for pi- SubType= 3
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
hBrem : Emin= 0 eV Emax= 100 TeV
hBrem : Emin= 0 eV Emax= 100 TeV
hPairProd: for pi- SubType= 4
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV in 240 bins, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV
hPairProd : Emin= 0 eV Emax= 100 TeV
Region <DefaultRegionForTheWorld> -- appears in <Aluminium> world volume
Root logical volume(s) : Aluminium
@@ -358,7 +358,7 @@ Start Run processing.
Run terminated.
Run Summary
Number of events processed : 2000
User=7.58s Real=7.61s Sys=0.04s
User=6.12s Real=6.28s Sys=0.06s
======================== run summary ======================
@@ -366,29 +366,29 @@ Run Summary
============================================================
total energy deposit: 99.804 MeV
total energy deposit: 99.79 MeV
nb tracks/event neutral: 27.68 charged: 148
nb steps/event neutral: 140.95 charged: 475.54
nb tracks/event neutral: 27.592 charged: 147.69
nb steps/event neutral: 140.59 charged: 474.71
nb of process calls per event:
msc eBrem eIoni phot comptTransportation conv annihil
148.31 25.075 300.73 25.293 113.27 0.9665 1.425 1.425
Transportation annihil compt conv eBrem eIoni msc phot
0.9495 1.437 113 1.437 24.989 300.23 148.05 25.21
---------------------------------------------------------
Primary particle :
true Range = 10.987 cm rms = 3.8234 cm
proj Range = 9.5776 cm rms = 3.5627 cm
proj/true = 0.87176
transverse dispersion at end = 1.6319 cm
mass true Range from simulation = 29.664 g/cm2
from PhysicsTable (csda range) = 31.821 g/cm2
true Range = 11.014 cm rms = 3.7844 cm
proj Range = 9.6111 cm rms = 3.5206 cm
proj/true = 0.87261
transverse dispersion at end = 1.6361 cm
mass true Range from simulation = 29.739 g/cm2
from PhysicsTable (csda range) = 31.721 g/cm2
---------------------------------------------------------
--------- Ranecu engine status ---------
Initial seed (index) = 0
Current couple of seeds = 1375807554, 1269164770
Current couple of seeds = 428538573, 1905044086
----------------------------------------
#
/process/eLoss/verbose 0
@@ -408,7 +408,7 @@ Region <DefaultRegionForTheWorld> -- appears in <Aluminium> world volume
Index : 0 used in the geometry : Yes recalculation needed : No
Material : Aluminium
Range cuts : gamma 10 um e- 10 um e+ 10 um proton 0 fm
Energy thresholds : gamma 990 eV e- 34.172517 keV e+ 33.943645 keV proton 0 eV
Energy thresholds : gamma 990 eV e- 34.1725 keV e+ 33.9436 keV proton 0 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
@@ -418,7 +418,7 @@ Index : 0 used in the geometry : Yes recalculation needed : No
--------- Ranecu engine status ---------
Initial seed (index) = 0
Current couple of seeds = 1375807554, 1269164770
Current couple of seeds = 428538573, 1905044086
----------------------------------------
Start Run processing.
@@ -426,7 +426,7 @@ Start Run processing.
Run terminated.
Run Summary
Number of events processed : 2000
User=13.9s Real=13.95s Sys=0.05s
User=11.22s Real=13.7s Sys=0.06s
======================== run summary ======================
@@ -434,29 +434,29 @@ Run Summary
============================================================
total energy deposit: 99.81 MeV
total energy deposit: 99.825 MeV
nb tracks/event neutral: 35.065 charged: 288.91
nb steps/event neutral: 145.41 charged: 898.27
nb tracks/event neutral: 34.682 charged: 286.8
nb steps/event neutral: 144.08 charged: 892.78
nb of process calls per event:
eIoni eBrem phot msc compt conv annihilTransportation
579.81 33.178 32.715 283.87 110.35 1.407 1.407 0.9465
Transportation annihil compt conv eBrem eIoni msc phot
0.945 1.419 109.4 1.419 32.825 576.81 281.72 32.322
---------------------------------------------------------
Primary particle :
true Range = 11.154 cm rms = 3.8454 cm
proj Range = 9.6831 cm rms = 3.573 cm
proj/true = 0.86815
transverse dispersion at end = 1.7408 cm
mass true Range from simulation = 30.115 g/cm2
from PhysicsTable (csda range) = 31.821 g/cm2
true Range = 11.019 cm rms = 3.8095 cm
proj Range = 9.6137 cm rms = 3.5618 cm
proj/true = 0.87245
transverse dispersion at end = 1.6658 cm
mass true Range from simulation = 29.752 g/cm2
from PhysicsTable (csda range) = 31.721 g/cm2
---------------------------------------------------------
--------- Ranecu engine status ---------
Initial seed (index) = 0
Current couple of seeds = 885076725, 250399748
Current couple of seeds = 3934508, 1790137630
----------------------------------------
UserDetectorConstruction deleted.
UserPhysicsList deleted.
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RunAction.hh,v 1.8 2006/06/29 16:36:43 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: RunAction.hh,v 1.9 2010/04/06 11:11:24 maire Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -33,8 +33,8 @@
#define RunAction_h 1
#include "G4UserRunAction.hh"
#include "ProcessesCount.hh"
#include "globals.hh"
#include <map>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -59,7 +59,7 @@ class RunAction : public G4UserRunAction
void CountTraks1(G4int nt) { NbOfTraks1 += nt;}
void CountSteps0(G4int ns) { NbOfSteps0 += ns;}
void CountSteps1(G4int ns) { NbOfSteps1 += ns;}
void CountProcesses(G4String);
void CountProcesses(G4String procName) { procCounter[procName]++;};
void AddEdep(G4double val) { edep += val;}
void AddTrueRange (G4double l) { trueRange += l; trueRange2 += l*l;};
@@ -67,17 +67,17 @@ class RunAction : public G4UserRunAction
void AddTransvDev (G4double y) { transvDev += y; transvDev2 += y*y;};
private:
DetectorConstruction* detector;
PrimaryGeneratorAction* primary;
HistoManager* histoManager;
G4int NbOfTraks0, NbOfTraks1;
G4int NbOfSteps0, NbOfSteps1;
G4double edep;
G4double trueRange, trueRange2;
G4double projRange, projRange2;
G4double transvDev, transvDev2;
DetectorConstruction* detector;
PrimaryGeneratorAction* primary;
ProcessesCount* ProcCounter;
HistoManager* histoManager;
std::map<G4String,G4int> procCounter;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: EventAction.cc,v 1.7 2007/11/12 15:48:58 maire Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: EventAction.cc,v 1.9 2010/06/07 05:40:45 perl Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
//
//
@@ -37,9 +37,6 @@
#include "EventActionMessenger.hh"
#include "G4Event.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4VVisManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -74,25 +71,11 @@ void EventAction::BeginOfEventAction(const G4Event* evt)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::EndOfEventAction(const G4Event* evt)
void EventAction::EndOfEventAction(const G4Event*)
{
if (drawFlag != "none") G4cout << " Energy deposit: "
<< G4BestUnit(TotalEnergyDeposit,"Energy")
<< G4endl;
if (G4VVisManager::GetConcreteInstance())
{
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
G4int n_trajectories = 0;
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
for(G4int i=0; i<n_trajectories; i++)
{ G4Trajectory* trj = (G4Trajectory*)
((*(evt->GetTrajectoryContainer()))[i]);
if (drawFlag == "all") trj->DrawTrajectory(100);
else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))
trj->DrawTrajectory(100);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: HistoManager.cc,v 1.13 2008/09/12 16:32:25 maire Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: HistoManager.cc,v 1.14 2010/11/09 21:00:43 asaim Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,7 +54,7 @@ HistoManager::HistoManager()
fileName[0] = "testem1";
fileType = "root";
fileOption = "export=root";
fileOption = "";
// histograms
for (G4int k=0; k<MaxHisto; k++) {
histo[k] = 0;
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RunAction.cc,v 1.19 2006/06/29 16:37:25 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: RunAction.cc,v 1.20 2010/04/06 11:11:24 maire Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -46,7 +46,7 @@
RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* kin,
HistoManager* histo)
:detector(det), primary(kin), ProcCounter(0), histoManager(histo)
:detector(det), primary(kin), histoManager(histo)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -69,7 +69,6 @@ void RunAction::BeginOfRunAction(const G4Run* aRun)
trueRange = trueRange2 = 0.;
projRange = projRange2 = 0.;
transvDev = transvDev2 = 0.;
ProcCounter = new ProcessesCount;
//histograms
//
@@ -78,19 +77,6 @@ void RunAction::BeginOfRunAction(const G4Run* aRun)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::CountProcesses(G4String procName)
{
//does the process already encounted ?
size_t nbProc = ProcCounter->size();
size_t i = 0;
while ((i<nbProc)&&((*ProcCounter)[i]->GetName()!=procName)) i++;
if (i == nbProc) ProcCounter->push_back( new OneProcessCount(procName));
(*ProcCounter)[i]->Count();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::EndOfRunAction(const G4Run* aRun)
{
G4int NbOfEvents = aRun->GetNumberOfEvent();
@@ -131,14 +117,15 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
<< " charged: " << std::setw(10) << NbOfSteps1/dNbOfEvents
<< G4endl;
//frequency of processes call
G4cout << "\n nb of process calls per event: \n ";
for (size_t i=0; i< ProcCounter->size();i++)
G4cout << std::setw(12) << (*ProcCounter)[i]->GetName();
//frequency of processes call
std::map<G4String,G4int>::iterator it;
G4cout << "\n nb of process calls per event: \n ";
for (it = procCounter.begin(); it != procCounter.end(); it++)
G4cout << std::setw(12) << it->first;
G4cout << "\n ";
for (size_t j=0; j< ProcCounter->size();j++)
G4cout << std::setw(12) << ((*ProcCounter)[j]->GetCounter())/dNbOfEvents;
for (it = procCounter.begin(); it != procCounter.end(); it++)
G4cout << std::setw(12) << (it->second)/dNbOfEvents;
G4cout << G4endl;
//compute true and projected ranges, and transverse dispersion
@@ -185,14 +172,9 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
// reset default precision
G4cout.precision(prec);
// delete and remove all contents in ProcCounter
while (ProcCounter->size()>0){
OneProcessCount* aProcCount=ProcCounter->back();
ProcCounter->pop_back();
delete aProcCount;
}
delete ProcCounter;
// remove all contents in procCounter
procCounter.clear();
//save histograms
histoManager->save();

Some files were not shown because too many files have changed in this diff Show More