Import Geant4 9.0.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.41 2006/11/14 07:11:18 perl Exp $
|
||||
$Id: History,v 1.43 2007/05/17 09:55:13 duns Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -10,6 +10,11 @@ $Id: History,v 1.41 2006/11/14 07:11:18 perl Exp $
|
||||
----------------------------------------------------------
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
17 May 2007 - Mark Donszelmann (exampleA01-V08-03-01)
|
||||
- Fixed memory leak for plotter
|
||||
|
||||
16 May 2007 - Mark Donszelmann
|
||||
- Fixed warning message about JAS-JAIDA window on exit.
|
||||
|
||||
13 November 2006 - Joseph Perl (exampleA01-V08-01-02)
|
||||
- Remove unused attributes from hit classes.
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
|
||||
IHistogramFactory* getHistogramFactory();
|
||||
ITupleFactory* getTupleFactory();
|
||||
IPlotter* createPlotter();
|
||||
IPlotter* getPlotter();
|
||||
|
||||
private:
|
||||
|
||||
@@ -80,6 +80,7 @@ private:
|
||||
IAnalysisFactory* analysisFactory;
|
||||
IHistogramFactory* hFactory;
|
||||
ITupleFactory* tFactory;
|
||||
IPlotter* plotter;
|
||||
ITree* tree;
|
||||
};
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
A01AnalysisManager* A01AnalysisManager::instance = 0;
|
||||
|
||||
A01AnalysisManager::A01AnalysisManager()
|
||||
:analysisFactory(0), hFactory(0), tFactory(0)
|
||||
:analysisFactory(0), hFactory(0), tFactory(0), plotter(0)
|
||||
{
|
||||
// Hooking an AIDA compliant analysis system.
|
||||
analysisFactory = AIDA_createAnalysisFactory();
|
||||
@@ -72,6 +72,11 @@ A01AnalysisManager::A01AnalysisManager()
|
||||
tree = treeFactory->create("A01.aida","xml",false,true,"compress=yes");
|
||||
hFactory = analysisFactory->createHistogramFactory(*tree);
|
||||
tFactory = analysisFactory->createTupleFactory(*tree);
|
||||
IPlotterFactory* pf = analysisFactory->createPlotterFactory(0,0);
|
||||
if (pf) {
|
||||
plotter = pf->create("Plotter");
|
||||
delete pf;
|
||||
}
|
||||
delete treeFactory; // Will not delete the ITree.
|
||||
}
|
||||
}
|
||||
@@ -84,7 +89,8 @@ A01AnalysisManager::~A01AnalysisManager()
|
||||
delete tree;
|
||||
delete tFactory;
|
||||
delete hFactory;
|
||||
G4cout << "Warning: Geant4 will NOT exit unless you close the JAS-AIDA window." << G4endl;
|
||||
delete plotter;
|
||||
G4cout << "Warning: In case of working with JAS-AIDA, Geant4 will NOT exit unless you close the JAS-AIDA window." << G4endl;
|
||||
delete analysisFactory;
|
||||
}
|
||||
}
|
||||
@@ -96,14 +102,9 @@ ITupleFactory* A01AnalysisManager::getTupleFactory()
|
||||
{
|
||||
return tFactory;
|
||||
}
|
||||
IPlotter* A01AnalysisManager::createPlotter()
|
||||
IPlotter* A01AnalysisManager::getPlotter()
|
||||
{
|
||||
if (analysisFactory)
|
||||
{
|
||||
IPlotterFactory* pf = analysisFactory->createPlotterFactory(0,0);
|
||||
if (pf) return pf->create("Plotter");
|
||||
}
|
||||
return 0;
|
||||
return plotter;
|
||||
}
|
||||
|
||||
A01AnalysisManager* A01AnalysisManager::getInstance()
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: A01EventAction.cc,v 1.9 2006/11/10 21:04:51 duns Exp $
|
||||
// $Id: A01EventAction.cc,v 1.10 2007/05/17 09:55:14 duns Exp $
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -90,7 +90,7 @@ A01EventAction::A01EventAction()
|
||||
dc2XY = hFactory->createCloud2D("Drift Chamber 2 X vs Y");
|
||||
evstof = hFactory->createCloud2D("EDep vs Time-of-flight");
|
||||
|
||||
plotter = analysisManager->createPlotter();
|
||||
plotter = analysisManager->getPlotter();
|
||||
if (plotter)
|
||||
{
|
||||
plotter->createRegions(3,2);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
*************************************************************
|
||||
Geant4 version $Name: geant4-08-02 $ (25-June-2004)
|
||||
Geant4 version $Name: geant4-09-00 $ (25-June-2004)
|
||||
Copyright : Geant4 Collaboration
|
||||
Reference : NIM A 506 (2003), 250-303
|
||||
WWW : http://cern.ch/geant4
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01.cc,v 1.14 2006/06/29 16:33:13 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01AnalysisManager.hh,v 1.9 2006/06/29 16:33:15 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01CalorHit.hh,v 1.4 2006/06/29 16:33:17 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01CalorimeterSD.hh,v 1.4 2006/06/29 16:33:19 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01DetectorConstruction.hh,v 1.4 2006/06/29 16:33:22 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01DetectorMessenger.hh,v 1.4 2006/06/29 16:33:25 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01EventAction.hh,v 1.6 2006/06/29 16:33:27 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PhysicsList.hh,v 1.4 2006/06/29 16:33:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PrimaryGeneratorAction.hh,v 1.4 2006/06/29 16:33:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PrimaryGeneratorMessenger.hh,v 1.4 2006/06/29 16:33:33 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01RunAction.hh,v 1.6 2006/06/29 16:33:36 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01SteppingAction.hh,v 1.6 2006/06/29 16:33:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01SteppingVerbose.hh,v 1.4 2006/06/29 16:33:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01AnalysisManager.cc,v 1.16 2006/06/29 16:33:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 14th Septembre 2000.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01CalorHit.cc,v 1.6 2006/06/29 16:33:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01CalorimeterSD.cc,v 1.5 2006/06/29 16:33:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01DetectorConstruction.cc,v 1.5 2006/06/29 16:33:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01DetectorMessenger.cc,v 1.5 2006/06/29 16:33:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01EventAction.cc,v 1.6 2006/06/29 16:33:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PhysicsList.cc,v 1.5 2006/06/29 16:33:55 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PrimaryGeneratorAction.cc,v 1.5 2006/06/29 16:33:57 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PrimaryGeneratorMessenger.cc,v 1.5 2006/06/29 16:33:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01RunAction.cc,v 1.7 2006/06/29 16:34:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01SteppingAction.cc,v 1.7 2006/06/29 16:34:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01SteppingVerbose.cc,v 1.7 2006/06/29 16:34:05 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# $Id: GNUmakefile,v 1.1 2007/05/26 00:18:27 tkoi Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
name := exampleN03Con
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../..
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
|
||||
visclean:
|
||||
rm -f g4*.prim g4*.eps g4*.wrl
|
||||
rm -f .DAWN_*
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
Example N03Con History file
|
||||
------------------------
|
||||
This file should be used by the G4 example coordinator to briefly
|
||||
summarize all major modifications introduced in the code and keep
|
||||
track of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
25-05-07 T. Koi exampleN03Con-V08-03-01
|
||||
|
||||
- Created.
|
||||
@@ -0,0 +1,467 @@
|
||||
$Id: History.N03,v 1.1 2007/05/26 00:18:27 tkoi Exp $
|
||||
--------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
Example N03 History file
|
||||
------------------------
|
||||
This file should be used by the G4 example coordinator to briefly
|
||||
summarize all major modifications introduced in the code and keep
|
||||
track of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
26-10-06 John Allison (exampleN03-V08-01-04)
|
||||
- Migrate to new trajectory modeling commands:
|
||||
o vis.mac: Add new trajectory commands and helpful comments.
|
||||
o ExN03EventActionMessenger: Remove /N03/event/drawTracks.
|
||||
o ExN03EventAction: Remove SetDrawFlag and code for drawing
|
||||
trajectories in EndOfEventAction.
|
||||
o ExN03TrackingAction: Remove. (Trajectory choice now available
|
||||
by vis commands - see exN03Vis12.mac and exN03Vis13.mac.)
|
||||
o exN03Vis12.mac and exN03Vis13.mac: Further refinement.
|
||||
|
||||
19-09-06 John Allison (exampleN03-V08-01-03)
|
||||
- exN03Vis12.mac and exN03Vis13.mac: Further refinement.
|
||||
|
||||
12-09-06 John Allison (exampleN03-V08-01-02)
|
||||
- exN03Vis12.mac and exN03Vis13.mac: Switched off local trajectory
|
||||
drawing (/N03/event/drawTracks none) so as not to interfere with
|
||||
drawing from /vis/scene/add/trajectories.
|
||||
|
||||
31-08-06 mma
|
||||
- Code tidy.
|
||||
|
||||
30-08-06 John Allison (exampleN03-V08-01-01)
|
||||
- Improved visTutor/exN03Vis12.mac.
|
||||
- Added visTutor/exN03Vis13.mac: Further demonstration of time slicing.
|
||||
|
||||
16-08-06 John Allison (exampleN03-V08-01-00)
|
||||
- Added ExN03TrackingAction. Active code is commented out so it
|
||||
continues to use G4Trajectory. Introduced so that the code can
|
||||
easily be instated to get G4RichTrajectory for exN03Vis12.mac.
|
||||
- Added visTutor/exN03Vis12.mac: demonstration of time slicing.
|
||||
|
||||
16-06-06 Gabriele Cosmo (exampleN03-V08-00-06)
|
||||
- Use coherent allocation scheme for user-classes and
|
||||
initialisation in main().
|
||||
|
||||
15-06-06 Gabriele Cosmo (exampleN03-V08-00-05)
|
||||
- Separate instantiation of the user-stepping-verbose class from
|
||||
initialisation of the G4VSteppingVerbose singleton.
|
||||
|
||||
06-06-06 mma (exampleN03-V08-00-04)
|
||||
- gui.mac : /N03/event/printModulo
|
||||
|
||||
02-06-06 mma (exampleN03-V08-00-03)
|
||||
- stepping action: replace Touchable by TouchableHandle
|
||||
|
||||
29-05-06 mma (exampleN03-V08-00-02)
|
||||
- stepping action: prePoint->GetTouchable()->GetVolume()
|
||||
|
||||
24-05-06 mma (exampleN03-V08-00-01)
|
||||
- cosmetic in stepping action
|
||||
|
||||
23-05-06 Vladimir Ivanchenko (exampleN03-V08-00-00)
|
||||
- use PrePoint in stepping action
|
||||
|
||||
06-12-05 Gabriele Cosmo
|
||||
- Trivial changes for support of CLHEP-2.0.X series.
|
||||
|
||||
03-12-05 John Allison (exampleN03-V07-01-04)
|
||||
- Quietened vis manager in batch mode.
|
||||
|
||||
22-11-05 mma (exampleN03-V07-01-03)
|
||||
- Update README
|
||||
|
||||
14-11-05 mma (exampleN03-V07-01-02)
|
||||
- DetectorConstruction: correct definition of Vacuum
|
||||
|
||||
15-10-05 mma (exampleN03-V07-01-01)
|
||||
- PhysicsList: AddProcess(new G4eBremsstrahlung,-1,3,3) ..etc..
|
||||
|
||||
22-07-05 mma (exampleN03-V07-01-00)
|
||||
- RunAction: compute and print statistic at end of run.
|
||||
|
||||
31-05-05 mma (exampleN03-V07-00-03)
|
||||
- EventAction: decrease size of trajectory points.
|
||||
|
||||
30-05-05 John Allison (exampleN03-V07-00-02)
|
||||
- Completed replacment of vis manager with G4VisExecutive.
|
||||
|
||||
26-05-05 Gabriele Cosmo (exampleN03-V07-00-01)
|
||||
- Fixed compilation error in exampleN03.cc (no tracking-action existing...).
|
||||
|
||||
03-05-05 John Allison (examples-V07-00-03)
|
||||
- Replaced vis manager with G4VisExecutive.
|
||||
|
||||
02-02-05 Michel Maire (exampleN03-V07-00-00)
|
||||
- SteppingAction: sum stepLenght of charged particle even if edep=0.
|
||||
|
||||
21-11-04 Guy Barrand
|
||||
- visTutor/exN03Vis[5,10].mac : reverse notifyHandler and viewer/update
|
||||
so that someone using G4UIterminal see the detector at the moment
|
||||
of the /vis/viewer/update.
|
||||
Have /control/verbose 2 to dump viewer controls.
|
||||
|
||||
18-11-04 Guy Barrand
|
||||
- visTutor/gui.mac : have a Viewer pulldown menu.
|
||||
|
||||
15-11-04 Guy Barrand (exampleN03-V06-02-00)
|
||||
- visTutor/exN03Vis[5,10].mac : have commented examples
|
||||
on how to request the visualization of a particular volume.
|
||||
- visTutor/exN03Vis9.mac : WIN32 : having something with only
|
||||
OGLIWin32 in order to test that geometry and trajectories work.
|
||||
|
||||
14-11-04 Guy Barrand
|
||||
- ExN03DetectorConstruction.cc : in commented vis attributes ;
|
||||
have transparency = 0.6 for the logicGap.
|
||||
|
||||
12-11-04 Guy Barrand
|
||||
- exN03Vis[5,10.mac] : correct comments "an volume" -> "a volume".
|
||||
|
||||
11-11-04 Guy Barrand
|
||||
- ExN03DetectorConstruction.cc : add commented vis attributes
|
||||
in order that someone can test / play with the interactive
|
||||
expansion / contraction geometry system of the vis/OpenInventor driver.
|
||||
- gui.mac : gun pulldown menu.
|
||||
- exN03Vis[5,10.mac] : rm an unnecessary update and bad comments.
|
||||
|
||||
08-04-04 Guy Barrand (exampleN03-V06-01-00)
|
||||
- exampleN03.cc : Windows : Have G4UI_USE_WIN32 in order to have
|
||||
a default Windows GUI coworking with the OpenGL Windows driver.
|
||||
- exN03Vis9.mac : demo of the OpenGL Windows driver.
|
||||
- gui.mac : change menu items in order to reflect the used vis driver.
|
||||
|
||||
19-03-04 M.Maire (exampleN03-V06-00-00)
|
||||
- ExN03PhysicsList: cleanup of include.
|
||||
|
||||
01-12-03 J.Perl (exampleN03-V05-02-08)
|
||||
- Removed extraneous flushes from visTutor/heprep.mac to match new
|
||||
endOfRunAction behavior.
|
||||
- Cleaned up vis.mac.
|
||||
- Cleaned up vis part of README.
|
||||
|
||||
27-11-03 G.Cosmo (exampleN03-V05-02-07)
|
||||
- Removed OPACS script from visTutor. renamed scripts 6/7/8/9 to
|
||||
5/6/7/8 respectively. Added scripts to gui.mac.
|
||||
|
||||
25-11-03 G.Cosmo (exampleN03-V05-02-06)
|
||||
- Open the geometry before cleaning stores in ConstructCalorimeter().
|
||||
|
||||
12-11-03 J.Allison (exampleN03-V05-02-05)
|
||||
- ExN03EventAction: changed drawing mode from 2000 to 1000.
|
||||
|
||||
06-11-03 J.Allison (exampleN03-V05-02-04)
|
||||
- ExN03RunAction: removed ApplyCommand("/vis/...") statements.
|
||||
|
||||
06-11-03 J.Allison (exampleN03-V05-02-03)
|
||||
- ExN03EventAction:
|
||||
o changed to use G4VVisManager::Draw(const G4VTrajectory&, G4int draw_mode).
|
||||
o increased drawing mode from 50 to 2000.
|
||||
|
||||
06-11-03 J.Allison (exampleN03-V05-02-02)
|
||||
- Removed OPACS from ExN03VisManager.
|
||||
|
||||
24-10-03 mma (exampleN03-V05-02-01)
|
||||
- PhysicsList: AddProcess(Bremsstrahlung,-1,3,3) ..etc..
|
||||
|
||||
15-09-03 mma (exampleN03-V05-02-00)
|
||||
- suppresion of sensitive detector and hits.
|
||||
- DetectorConstruction::DefineMaterials() invoked in constructor.
|
||||
The UI commands /N03/det work in preInit state as well in Idle.
|
||||
- suppression of specific code for curvated trajectories.
|
||||
|
||||
10-06-03 mma (exampleN03-V05-01-02)
|
||||
- mv heprep.mac in visTutor
|
||||
- back to eventAction.cc 1.17
|
||||
|
||||
28-05-03 G.Cosmo (exampleN03-V05-01-01)
|
||||
- Get rid of pedantic warnings ...
|
||||
|
||||
21-05-03 V.Ivant (exampleN03-V05-01-00)
|
||||
- ExN03DetectorConstruction: properly delete volumes and solids
|
||||
when geometry setup is updated.
|
||||
|
||||
08-04-03 mma (exampleN03-V05-00-06)
|
||||
- DefineMaterials: H2O->SetMeanExcitationEnergy(75*eV)
|
||||
|
||||
25-03-03 mma (exampleN03-V05-00-05)
|
||||
- Use G4PVPlacement and G4PVReplica constructors in logical mother.
|
||||
|
||||
20-02-03 V.Ivant (exampleN03-V05-00-04)
|
||||
- Migrade to cut per region
|
||||
|
||||
11-02-03 mma (exampleN03-V05-00-03)
|
||||
- DetectorConstruction : change names of volumes
|
||||
|
||||
30-01-03 mma (exampleN03-V05-00-02)
|
||||
- save random number seed. In README explain the rndm handling.
|
||||
commit rndmSeed.mac to show how to save and reset rndm seed
|
||||
|
||||
18-12-02 mma (exampleN03-V05-00-01)
|
||||
- code for smooth trajectory put in DetectorContruction::SetMagField()
|
||||
and TrackingAction::PreUserTrackingAction()
|
||||
|
||||
16-12-02 mma (exampleN03-V05-00-00)
|
||||
- UI directory /N03/
|
||||
|
||||
19-11-02 jacek
|
||||
- introducing smooth trajectory display
|
||||
|
||||
25-06-02 ribon (exampleN03-V04-00-02)
|
||||
- fixed paths to macros in visTutor/gui.mac.
|
||||
|
||||
07-03-02 mma (exampleN03-V04-00-01)
|
||||
- remove cutForGamma, cutForElectron ..etc..
|
||||
|
||||
14-02-02 mma (exampleN03-V04-00-00)
|
||||
- macros for em exercices
|
||||
|
||||
27-11-01 mma (exampleN03-V03-02-07)
|
||||
- DetectorConstruction: Vacuum is the default material.
|
||||
- newgeom.mac: a box of 40 cm of water.
|
||||
|
||||
19-11-01 John (exampleN03-V03-02-06)
|
||||
- Updated ExN03VisManager.cc for new graphics systems and defaults.
|
||||
|
||||
14-11-01 Satoshi Tanaka (exampleN03-V03-02-05)
|
||||
- exN03Vis8.mac : Batch visualization with the DAWNFILE driver
|
||||
- exN03Vis9.mac : Multi-page PostScript file generation (old exN03Vis8.mac)
|
||||
|
||||
07-11-01 Satoshi (exampleN03-V03-02-04a)
|
||||
- /vis/viewer/viewpointThetaPhi ==> /vis/viewer/set/viewpointThetaPhi
|
||||
|
||||
07-11-01 Satoshi (exampleN03-V03-02-04)
|
||||
- visTutor/exN03VisXX.mac's are rewritten with /vis/viewer/flush.
|
||||
- Some refinements of command sequences and comments.
|
||||
- Note that /vis/flushAll's are described but commented out.
|
||||
|
||||
07-11-01 Satoshi (exampleN03-V03-02-03)
|
||||
- vis.mac: /vis/viewer/refresh + /vis/viewer/update is replaced
|
||||
with their equivalent command /vis/viewer/flush.
|
||||
|
||||
24-10-01 mma (exampleN03-V03-02-02)
|
||||
- initInter.mac renamed vis.mac : OpenGL and DAWNFILE opened simultaneously.
|
||||
|
||||
19-10-01 Steve O'Neale (examples-V03-02-00)
|
||||
- Update reference output
|
||||
|
||||
10-10-01 mma (exampleN03-V03-02-01)
|
||||
- /vis/scene/endOfEventAction accumulate
|
||||
/vis/viewer/zoom (in newgeom.mac)
|
||||
- 80 columns everywhere
|
||||
|
||||
18-09-01 Satoshi Tanaka (exampleN03-V03-02-00)
|
||||
- Updation for automatic visualization at Hebden Bridge mini-workshop.
|
||||
- /vis/viewer/flush and /vis/flushAll are not included yet.
|
||||
(To be included in the next tag.)
|
||||
- /vis/drawTree may still require /vis/scene/notifyHandlers.
|
||||
(John Allison will revise the /vis/drawTree command soon.)
|
||||
|
||||
21-06-01 Satoshi Tanaka (exampleN03-V03-00-02)
|
||||
- visTutor/*.mac updated
|
||||
- Commands /vis/set/XXX's are replaced with /vis/viewer/set/XXX
|
||||
- Commands /vis/camera/XXX's are replaced with /vis/viewer/XXX
|
||||
except for /vis/camera/spin.
|
||||
- exN03Tree0.mac for ASCII DTREE and exN03Tree1.mac for GAG DTREE
|
||||
are created.
|
||||
|
||||
|
||||
06-02-01 M.Asai (exampleN03-V03-00-01)
|
||||
- Migration to STL vector classes
|
||||
affected : ExN03SteppingVerbose.cc
|
||||
|
||||
4th February 2001 Steve O'Neale (tagset254)
|
||||
|
||||
21-11-27, Satoshi Tanake (exampleN03-V02-00-04)
|
||||
- The macro initInter.mac (by Michel) is revised.
|
||||
1) The command "/vis/scene/create" is removed,
|
||||
since it is already included in "/vis/drawVolume".
|
||||
2) /vis/viewer/update is added, since it becomes necessary
|
||||
when the OpenGL driver is switched to another driver.
|
||||
- In visTutor/exN03Vis5,6.mac (by Guy)
|
||||
"/vis/include/trajectories" is renamed into
|
||||
"/vis/scene/add/trajectories" and also commented out.
|
||||
(All other "/vis/scene/add/trajectories"'s are already commented out
|
||||
by Michel, since the C++ method DrawTrajectory() is now described
|
||||
in the event action.
|
||||
- Unnecessary "/vis/scene/create" are removed from
|
||||
visTutor/exN03VisX.mac when it is already included in
|
||||
"/vis/drawVolume" or "/vis/specify".
|
||||
- The command /vis/camera/viewpoint is removed from visTutor/exN03Vis0.mac
|
||||
in order to avoid crushing in reading it in execution of
|
||||
the G4 executable: $(G4BINDIR)/exampleN03 exN03Vis0.mac .
|
||||
- Comments updated in visTutor/exN03VisX.mac.
|
||||
|
||||
|
||||
25th November 2000 Steve O'Neale (tagset210)
|
||||
- Update test outputs for min.delta energy cut
|
||||
- Update test outputs for energy cut table only for e- and gamma
|
||||
- Update test outputs for new tags in em processes.
|
||||
Note we skip round work in progress
|
||||
|
||||
21-11-00, mma (exampleN03-V02-00-02)
|
||||
- introduce G4UItcsh in exampleN03.cc
|
||||
- put all vis macros in a new subdirectory visTutor
|
||||
- prerunN03 simplified (compound vis commands) and renamed initInter.mac
|
||||
- code to control the drawing of tracks reinstalled in eventAction
|
||||
- bug corrected in PhysicsList::GetCutForProton()
|
||||
- PrimaryGenerator : default particle e- 50 MeV
|
||||
|
||||
October 19, 2000 Satoshi Tanaka (exampleN03-V02-00-01)
|
||||
- Updated exN03Vis0-4.mac, incorporating recent development
|
||||
of vis commands
|
||||
- Updated format of comments in exN03Vis0-4.mac.
|
||||
- Created exN03Vis7.mac: demo of the VRMLFILE driver
|
||||
- Created exN03Vis8.mac: demo of multi-page PS file generation
|
||||
|
||||
June 24, 2000 John Allison (exampleN03-V01-01-09)
|
||||
- Updated exampleN03.out for stand-V01-01-05 and utils-V01-01-03.
|
||||
|
||||
June 17, 2000 John Allison (exampleN03-V01-01-08)
|
||||
- Updated exampleN03.out for geant4-01-01-ref-06.
|
||||
|
||||
14 June 2000 John Allison (exampleN03-V01-01-07)
|
||||
- Added #ifdef G4UI_USE_XM to protect #include "G4UIXm.hh" in exampleN03.cc.
|
||||
- Limit output in gui.mac (Guy Barrand).
|
||||
|
||||
13 June 2000 Guy Barrand (exampleN03-V01-01-06)
|
||||
- exampleN03.cc, prerunN03.mac :
|
||||
put execution of the gui.mac in exampleN03.cc
|
||||
with an #ifdef G4UI_USE_XM protection and
|
||||
remove it from preunN03.mac. This will gurantee
|
||||
no effect of the gui.mac on other G4UI sessions.
|
||||
- g4Xt.xrm : add a resource to limit contant
|
||||
of XmText widgets (in particular the one used
|
||||
to dump G4cout things).
|
||||
- exaN03Vis5.6.mac : remove commands that are
|
||||
in fact not supported by Xo and Invnetor
|
||||
drivers.
|
||||
|
||||
09 June 2000 Satoshi Tanaka (exampleN03-V01-01-05) :
|
||||
- In prerunN03,
|
||||
< /vis/scene/include/trajectories
|
||||
---
|
||||
> /vis/scene/add/trajectories
|
||||
09 June 2000 Guy Barrand (exampleN03-V01-01-04) :
|
||||
- correct some comments in exN03Vis5,6.mac.
|
||||
- add gui.mac.
|
||||
- trigger execution of gui.mac at end of prerunN03.mac.
|
||||
|
||||
09 June 2000 Guy Barrand (exampleN03-V01-01-02) :
|
||||
- add exN03Vis4,5.mac for a simple example
|
||||
of OPACS/Xo and Inventor driver.
|
||||
|
||||
09th June 2000 Satoshi Tanaka (exampleN03-V01-01-01)
|
||||
- exNO3VisX.mac's are updated corresponding to recent
|
||||
development of the new vis commands:
|
||||
(1) Compound commands are used wherever possible.
|
||||
(2) Ordering of commands and comments are rewritten
|
||||
to improve readability.
|
||||
(3) exN03Vis4.mac is created to demonstrate
|
||||
the compound command "/vis/specify".
|
||||
|
||||
05-06-00 M.Maire
|
||||
- cleanup of ExN03EventAction to limit the amount of output with
|
||||
exampleN03.large_N.in
|
||||
|
||||
20th May 2000 Satoshi Tanaka
|
||||
- exNO3VisX.mac's are updated corresponding to development
|
||||
of the new vis commands.
|
||||
- The command /vis/add/trajectories is added to exNO3VisX.mac's.
|
||||
Instead the C++ method "DrawTrajectory()" is removed from
|
||||
ExN03EventAction::EndOfEventAction().
|
||||
|
||||
19th May 2000 Satoshi Tanaka
|
||||
- g4.xrm (Xt resource file for UI) is renamed to g4Xt.xrm
|
||||
|
||||
11th May 2000 Satoshi Tanaka (examples-V01-01-03)
|
||||
- Comments in examples/novice/N03/exN03VisX.mac 's are
|
||||
updated for DAWN Version 3.85a
|
||||
- Small changes to comments in SteppingVerbose.
|
||||
|
||||
25-02-00 H.Kurashige
|
||||
- removed RhoZeroDefinition from PhysicsList
|
||||
|
||||
10th November 1999 Satoshi Tanaka (examples-V00-01-12)
|
||||
- novice/N03 is updated
|
||||
- Vis macros for N03 are updated for the latest updation of vis commands
|
||||
(Introduction of /vis/viewer/update etc)
|
||||
|
||||
09-11-99 Satoshi Tanaka (examples-V00-01-11)
|
||||
prerunN03.mac : /vis/viewer/update is appended
|
||||
src/ExN03RunAction.cc: /vis/scene/notifyHandlers is in BeginOfRunAction()
|
||||
/vis/viewer/update is in EndOfRunAction()
|
||||
|
||||
14-08-99 Satoshi Tanaka
|
||||
TAG: examples-V00-01-02
|
||||
Visualization tutorial macros are committed.
|
||||
(exN03Vis0.mac,..., exN03Vis3.mac)
|
||||
|
||||
19-08-99 Michel Maire
|
||||
- modify ExN03PhysicsList to keep the command setCut compatible
|
||||
with cutForGamma ..etc ..
|
||||
|
||||
31-05-99 Guy Barrand, Michel Maire
|
||||
- introduce a command interface based on Motif: G4UIXm
|
||||
|
||||
16th April 1999 H.Kurashige
|
||||
- modify ExN03SteppingAction::UserSteppingAction
|
||||
- modify ExN03EventAction
|
||||
- modify ExN03RunAction::BeginOfRunAction/EndOfRunAction
|
||||
- Add cutForGamma/cutForElectron/cutForProton in ExN03PhysicsList
|
||||
- modify ExN03PhysicsList::SetCuts
|
||||
|
||||
10-03-99 Michel Maire
|
||||
- Choose RaneCu as the default random number generator.
|
||||
- print the seed event%n
|
||||
|
||||
9-10-98 John Apostolakis
|
||||
- This used to be example N02. It is now N03.
|
||||
|
||||
25-02-98 Michel Maire
|
||||
- add a macro 'newgeom.mac' which gives an example of
|
||||
interactive redefinition of the geometry
|
||||
|
||||
11-09-98 Michel Maire
|
||||
- removed the function SetEmProcess() ( contained cin)
|
||||
and the class ExN02PhysicsListMessenger
|
||||
|
||||
27-08-98 John Allison
|
||||
- Removed /vis~/camera/zoom 3 - coworks with vis-00-02-05.
|
||||
|
||||
12-08-98 Michel Maire
|
||||
- Changed all the class name:N02 -> ExN02.
|
||||
|
||||
9-08-98 John Allison
|
||||
- Changed G4UIterminal to G4UIGAG.
|
||||
|
||||
20-07-98 Michel Maire
|
||||
storeTrajectory command move to prerun.mac
|
||||
|
||||
16-07-98 John Allison
|
||||
- Changed /vis~/Draw... to /vis~/draw.
|
||||
|
||||
9-07-98 John Allison
|
||||
- Added G4VIS_USE_DAWNFILE and G4VIS_USE_OPENGLWIN32 to N02VisManager.cc.
|
||||
|
||||
8th July 1998 G.Cosmo
|
||||
- Protected visualization code with G4VIS_USE.
|
||||
|
||||
6th July 1998 John Allison
|
||||
- Simplified N02VisManager.
|
||||
|
||||
16th June 1998 Michel Maire
|
||||
- Added G4_SOLVE_VIS_TEMPLATES to exampleN02.cc
|
||||
|
||||
10th June 1998 John Allison
|
||||
- Added template instantiation requests to exampleN02.cc for GNU_GCC.
|
||||
|
||||
April 09, 98 G. Cosmo
|
||||
|
||||
- Created.
|
||||
@@ -0,0 +1,88 @@
|
||||
|
||||
Example of Convergence Tester
|
||||
|
||||
Koi, Tatsumi
|
||||
SLAC / SCCS
|
||||
tkoi@slac.stanford.eedu
|
||||
|
||||
This example shows how to use convergece tester in Geant4.
|
||||
The aim of Convergence Tester
|
||||
After a Monte Carlo simulation, we get an answer. However how to estimate quality of the answer.
|
||||
What we must remember is
|
||||
Large number of history does not valid result of simulation.
|
||||
Small Relative Error does not valid result of simulation
|
||||
To provide statistical information to assist establishing valid confidence intervals for Monte Carlo results for users.
|
||||
|
||||
Geometry and Physics are same to exampleN03. Please see README.N03
|
||||
|
||||
***********************************************************************************************************************
|
||||
Output example
|
||||
|
||||
// Part I.A
|
||||
// Basic statistics values
|
||||
|
||||
EFFICIENCY = 0.99438477
|
||||
MEAN = 78.477718
|
||||
VAR = 225.50178
|
||||
SD = 15.016717
|
||||
R = 0.0029898448
|
||||
SHIFT = -13.902917
|
||||
VOV = 0.0019924127
|
||||
FOM = 909.19362
|
||||
|
||||
// Part I.B
|
||||
// If the largeset scored events happen at next to the last event,
|
||||
// then how much the event effects the statistics values of the calculation
|
||||
|
||||
THE LARGEST SCORE = 117.3797 and it happend at 510th event
|
||||
Affected Mean = 78.487213 and its ratio to orignal is 1.000121
|
||||
Affected VAR = 225.81611 and its ratio to orignal is 1.0013939
|
||||
Affected R = 0.0029912008 and its ratio to orignal is 1.0004535
|
||||
Affected SHIFT = -13.862598 and its ratio to orignal is 0.99709995
|
||||
Affected FOM = 908.89814 and its ratio to orignal is 0.99967501
|
||||
|
||||
// Part I.C
|
||||
// Convergence tests results
|
||||
|
||||
MEAN distribution is not RANDOM
|
||||
r follows 1/sqrt(N)
|
||||
r is monotonically decrease 1
|
||||
r is less than 0.1. r = 0.0029898448
|
||||
VOV follows 1/sqrt(N)
|
||||
VOV is monotonically decrease 1
|
||||
FOM distribution is RANDOM
|
||||
SLOPE is large enough
|
||||
This result passes 7 / 8 Convergence Test.
|
||||
|
||||
// Part II
|
||||
// Profile of statistics values in the history
|
||||
|
||||
i/16 till_ith mean var sd r vov fom shift e r2eff r2int
|
||||
1 255 76.935633 252.45045 15.888689 0.012907453 0.038596366 787.70557 -17.661167 0.984375 6.2003968e-05 0.00010394759
|
||||
2 511 77.389232 257.4632 16.04566 0.0091630923 0.017298474 773.88648 -16.441348 0.98632812 2.707302e-05 5.6725251e-05
|
||||
3 767 77.665817 248.62651 15.767895 0.0073259372 0.012144321 826.64625 -16.585523 0.98828125 1.5439723e-05 3.8159751e-05
|
||||
4 1023 77.969112 245.54395 15.669842 0.0062804686 0.0086792682 841.98653 -16.027547 0.99023438 9.6307939e-06 2.9774973e-05
|
||||
5 1279 78.061919 228.9236 15.130221 0.0054175269 0.0067481801 897.34046 -14.687306 0.9921875 6.1515748e-06 2.3175093e-05
|
||||
6 1535 77.870133 231.84589 15.226486 0.004989226 0.0054405699 879.44272 -14.43874 0.99283854 4.6960383e-06 2.0180132e-05
|
||||
7 1791 78.045703 224.72573 14.990855 0.004537414 0.0046643478 908.22153 -14.045519 0.99386161 3.446599e-06 1.7130038e-05
|
||||
8 2047 78.107287 226.09338 15.036402 0.0042539011 0.0041397452 902.08658 -14.202387 0.99365234 3.1192414e-06 1.4967598e-05
|
||||
9 2303 78.129941 222.08125 14.902391 0.0039737195 0.0036662056 916.62223 -13.945849 0.99392361 2.6534449e-06 1.3130148e-05
|
||||
10 2559 78.225505 223.59764 14.953181 0.0037780287 0.0032772248 910.22344 -13.934949 0.99414062 2.3023084e-06 1.1965617e-05
|
||||
11 2815 78.250797 222.51845 14.917052 0.003592344 0.0029353727 915.19704 -13.768958 0.99431818 2.0292208e-06 1.0871132e-05
|
||||
12 3071 78.377339 220.83103 14.860385 0.0034208098 0.002628038 928.36413 -13.3624 0.99479167 1.7042976e-06 9.9938329e-06
|
||||
13 3327 78.364284 221.49591 14.882739 0.0032921001 0.0024634602 923.51719 -13.660307 0.99489183 1.5427886e-06 9.2918778e-06
|
||||
14 3583 78.464175 220.63749 14.853871 0.0031621629 0.0022668889 928.57248 -13.539324 0.99497768 1.4083908e-06 8.5880937e-06
|
||||
15 3839 78.420541 224.71581 14.990524 0.0030847599 0.002080651 911.9934 -13.68267 0.99479167 1.363438e-06 8.1498278e-06
|
||||
16 4095 78.477718 225.50178 15.016717 0.0029898448 0.0019924127 909.4893 -13.902917 0.99438477 1.3786483e-06 7.5583414e-06
|
||||
|
||||
|
||||
**************************************************************************************************************************
|
||||
|
||||
Reference of this Convergence tests
|
||||
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
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
$Id: README.N03,v 1.1 2007/05/26 00:18:27 tkoi Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
ExampleN03
|
||||
----------
|
||||
|
||||
This example simulates a simple Sampling Calorimeter setup.
|
||||
|
||||
1- GEOMETRY DEFINITION
|
||||
|
||||
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).
|
||||
|
||||
In addition a transverse uniform magnetic field can be applied.
|
||||
|
||||
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 || | || | || | ||
|
||||
======> || | || | || | ||
|
||||
|| | || | || | ||
|
||||
|| | || | || | ||
|
||||
|| | || | || | ||
|
||||
|| | || | || | ||
|
||||
|| | || | || | ||
|
||||
==========================================================================
|
||||
|
||||
NB. The thickness of the absorber or of the gap can be set to zero
|
||||
(but not together), and the number of layers to 1. In this case we
|
||||
have a unique homogeneous block of matter, which looks like
|
||||
a bubble chamber rather than a calorimeter ...
|
||||
(see the macro of commands: newgeom.mac)
|
||||
|
||||
2- AN EVENT : THE PRIMARY GENERATOR
|
||||
|
||||
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 (see
|
||||
the macros provided with this example).
|
||||
|
||||
In addition one can choose randomly the impact point of the incident
|
||||
particle. The corresponding interactive command is built in
|
||||
PrimaryGeneratorMessenger class (see run2.mac).
|
||||
|
||||
A RUN is a set of events.
|
||||
|
||||
|
||||
3- VISUALIZATION
|
||||
|
||||
The Visualization Manager is set in the main().
|
||||
The initialisation of the drawing is done via a set of /vis/ commands
|
||||
in the macro vis.mac. This macro is automatically read from
|
||||
the main in case of interactive running mode.
|
||||
|
||||
By default, vis.mac opens a DAWNFILE, suitable for viewing in DAWN,
|
||||
and an OGLX for OpenGl.
|
||||
You can switch to other graphics systems by commenting out this line
|
||||
and instead uncommenting one of the other /vis/open statements, such as
|
||||
HepRepFile or HepRepXML.
|
||||
|
||||
The DAWNFILE, HepRepFile and HepRepXML drivers are always available
|
||||
(since they require no external libraries), but the OGLIX driver
|
||||
requires:
|
||||
1- the visualisation & interfaces categories have been compiled
|
||||
with the environment variable G4VIS_BUILD_OPENGLX_DRIVER.
|
||||
2- exampleN03.cc has been compiled with G4VIS_USE_OPENGLX.
|
||||
|
||||
The HepRepXML driver outputs a zip file that can be unzipped into
|
||||
several individual HepRep files, each viewable in WIRED.
|
||||
|
||||
For more information on visualization, including information on how to
|
||||
install and run DAWN, OpenGL and WIRED, see the visualization tutorials
|
||||
on the Geant4 Workshop Tutorial CD available at:
|
||||
http://geant4.slac.stanford.edu/g4cd/Welcome.html
|
||||
|
||||
The detector has a default view which is a longitudinal view of the
|
||||
calorimeter.
|
||||
|
||||
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 neutral or none. This command is build in EventActionMessenger class.
|
||||
|
||||
Additional visualization tutorial macros are available in the visTutor
|
||||
subdirectory. They can be tried as:
|
||||
% $G4BINDIR/exampleN03
|
||||
idle > /control/execute visTutor/exN03VisX.mac
|
||||
For details, see comment lines described in the macro files.
|
||||
These macros are designed to help your understanding the User's Guide.
|
||||
|
||||
|
||||
4- PHYSICS DEMO
|
||||
|
||||
The particle's type and the physic processes which will be available
|
||||
in this example are set in PhysicsList class.
|
||||
|
||||
In addition the build-in interactive command:
|
||||
/process/(in)activate processName
|
||||
allows to activate/inactivate the processes one by one.
|
||||
Then one can well visualize the processes one by one, especially
|
||||
in the bubble chamber setup with a transverse magnetic field.
|
||||
(see run2.mac and newgeom.mac)
|
||||
|
||||
As a homework try to visualize a gamma conversion alone,
|
||||
or the effect of the multiple scattering.
|
||||
|
||||
5- RANDOM NUMBERS HANDLING
|
||||
|
||||
CLHEP provides several random number engines. In this example the Ranecu
|
||||
engine is choosen at beginning of the main (exampleN03.cc).
|
||||
|
||||
By default, G4RunManager does not save the rndm seed.
|
||||
To do so the user must set in BeginOfRunAction:
|
||||
G4RunManager::GetRunManager()->SetRandomNumberStore(true);
|
||||
|
||||
Then the rndm seed is systematically saved at beginning of run
|
||||
(currentRun.rndm) and beginning of event (currentEvent.rndm)
|
||||
Therefore, in case of abnormal end, the seed of the last event processed
|
||||
is available in currentEvent.rndm
|
||||
|
||||
Even in case of normal run processing, the user may wish to preserve the
|
||||
rndm seed of selected events. At any time in the event, put the
|
||||
following statement:
|
||||
if (condition) G4RunManager::GetRunManager()->rndmSaveThisEvent();
|
||||
currentEvent.rndm will be copied to runXXevntYY.rndm
|
||||
(see ExN03SteppingAction::UserSteppingAction() )
|
||||
|
||||
To restart a run from a given rndm seed, use the UI command :
|
||||
/random/resetEngineFrom fileName
|
||||
|
||||
The macro rndmSeed.mac shows how to save and reset the random number
|
||||
seed between runs, from UI commands.
|
||||
|
||||
6- USER INTERFACES
|
||||
|
||||
The default command interface, called G4UIterminal, is done via
|
||||
standart cin/G4cout.
|
||||
On Linux and Sun-cc on can use a smarter command interface G4UItcsh.
|
||||
It is enough to set the environment variable G4UI_USE_TCSH
|
||||
|
||||
On can use a Motif driven command interface (called G4UIXm) if:
|
||||
1- interfaces category has been compiled with G4UI_BUILD_XM_SESSION
|
||||
2- exampleN03.cc has been compiled with G4UI_USE_XM.
|
||||
|
||||
|
||||
7- HOW TO START ?
|
||||
|
||||
- compile and link to generate an executable
|
||||
% cd N03
|
||||
% gmake
|
||||
|
||||
- execute N03 in 'batch' mode from macro files
|
||||
% exampleN03 run1.mac
|
||||
|
||||
- execute N03 in 'interactive mode' with visualization
|
||||
% exampleN03
|
||||
....
|
||||
Idle> ---> type your commands. For instance:
|
||||
Idle> /run/beamOn
|
||||
....
|
||||
Idle> /run/beamOn 10
|
||||
....
|
||||
Idle> /control/execute newgeom.mac
|
||||
....
|
||||
Idle> exit
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: exampleN03Con.cc,v 1.2 2007/05/26 00:24:09 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#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"
|
||||
|
||||
#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"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
// Choose the Random engine
|
||||
//
|
||||
CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
|
||||
|
||||
// User Verbose output class
|
||||
//
|
||||
G4VSteppingVerbose* verbosity = new ExN03SteppingVerbose;
|
||||
G4VSteppingVerbose::SetInstance(verbosity);
|
||||
|
||||
// Construct the default run manager
|
||||
//
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
|
||||
// Set mandatory initialization classes
|
||||
//
|
||||
ExN03DetectorConstruction* detector = new ExN03DetectorConstruction;
|
||||
runManager->SetUserInitialization(detector);
|
||||
//
|
||||
G4VUserPhysicsList* physics = new ExN03PhysicsList;
|
||||
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);
|
||||
runManager->SetUserAction(gen_action);
|
||||
//
|
||||
ExN03RunAction* run_action = new ExN03RunAction;
|
||||
runManager->SetUserAction(run_action);
|
||||
//
|
||||
ExN03EventAction* event_action = new ExN03EventAction(run_action);
|
||||
runManager->SetUserAction(event_action);
|
||||
//
|
||||
G4UserSteppingAction* stepping_action =
|
||||
new ExN03SteppingAction(detector, event_action);
|
||||
runManager->SetUserAction(stepping_action);
|
||||
|
||||
// Initialize G4 kernel
|
||||
//
|
||||
runManager->Initialize();
|
||||
|
||||
// Get the pointer to the User Interface manager
|
||||
//
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
if (session) // Define UI session for interactive 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);
|
||||
}
|
||||
|
||||
// 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
|
||||
delete runManager;
|
||||
delete verbosity;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
/control/verbose 2
|
||||
/run/verbose 2
|
||||
|
||||
# e+ 300MeV
|
||||
#/gun/particle e+
|
||||
#/gun/energy 300 MeV
|
||||
#/run/beamOn 1
|
||||
#
|
||||
# list the existing physics processes
|
||||
/process/list
|
||||
#
|
||||
# switch off MultipleScattering
|
||||
#/process/inactivate msc
|
||||
#/run/beamOn 1
|
||||
#
|
||||
# switch on MultipleScattering
|
||||
#/process/activate msc
|
||||
#
|
||||
# change detector parameter
|
||||
/N03/det/setAbsMat Aluminium
|
||||
/N03/det/setGapMat Aerogel
|
||||
/N03/det/setAbsThick 2. cm
|
||||
/N03/det/setGapThick 5. cm
|
||||
/N03/det/setNbOfLayers 30
|
||||
/N03/det/setSizeYZ 1.5 m
|
||||
/N03/det/update
|
||||
#
|
||||
/gun/particle gamma
|
||||
/gun/energy 500 MeV
|
||||
/N03/event/printModulo 1024
|
||||
#/run/beamOn 1024
|
||||
/run/beamOn 4096
|
||||
#/run/beamOn 16384
|
||||
#/run/beamOn 65536
|
||||
exit
|
||||
@@ -0,0 +1,554 @@
|
||||
|
||||
*************************************************************
|
||||
Geant4 version Name: geant4-08-03 (5-May-2007)
|
||||
Copyright : Geant4 Collaboration
|
||||
Reference : NIM A 506 (2003), 250-303
|
||||
WWW : http://cern.ch/geant4
|
||||
*************************************************************
|
||||
|
||||
|
||||
***** Table : Nb of materials = 13 *****
|
||||
|
||||
Material: Aluminium density: 2.700 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 8.893 cm
|
||||
---> Element: Aluminium ( ) Z = 13.0 N = 27.0 A = 26.98 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
Material: liquidArgon density: 1.390 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 14.065 cm
|
||||
---> Element: liquidArgon ( ) Z = 18.0 N = 40.0 A = 39.95 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
Material: Lead density: 11.350 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 5.612 mm
|
||||
---> Element: Lead ( ) Z = 82.0 N = 207.2 A = 207.19 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
Material: Water density: 1.000 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 36.092 cm
|
||||
---> 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: Scintillator density: 1.032 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 42.549 cm
|
||||
---> Element: Carbon (C) Z = 6.0 N = 12.0 A = 12.01 g/mole ElmMassFraction: 91.45 % ElmAbundance 47.37 %
|
||||
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 8.55 % ElmAbundance 52.63 %
|
||||
|
||||
Material: Mylar density: 1.397 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 28.599 cm
|
||||
---> Element: Carbon (C) Z = 6.0 N = 12.0 A = 12.01 g/mole ElmMassFraction: 62.49 % ElmAbundance 45.45 %
|
||||
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 4.20 % ElmAbundance 36.36 %
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 33.30 % ElmAbundance 18.18 %
|
||||
|
||||
Material: quartz density: 2.200 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 12.295 cm
|
||||
---> Element: Silicon (Si) Z = 14.0 N = 28.1 A = 28.09 g/mole ElmMassFraction: 46.75 % ElmAbundance 33.33 %
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 53.25 % ElmAbundance 66.67 %
|
||||
|
||||
Material: Air density: 1.290 kg/m3 temperature: 273.15 K pressure: 1.00 atm RadLength: 285.161 m
|
||||
---> 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: Aerogel density: 200.000 kg/m3 temperature: 273.15 K pressure: 1.00 atm RadLength: 1.493 m
|
||||
---> Element: Silicon (Si) Z = 14.0 N = 28.1 A = 28.09 g/mole ElmMassFraction: 29.22 % ElmAbundance 11.12 %
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 66.49 % ElmAbundance 44.42 %
|
||||
---> Element: Hydrogen (H) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 4.19 % ElmAbundance 44.37 %
|
||||
---> Element: Carbon (C) Z = 6.0 N = 12.0 A = 12.01 g/mole ElmMassFraction: 0.10 % ElmAbundance 0.09 %
|
||||
|
||||
Material: CarbonicGas density: 27.000 kg/m3 temperature: 325.00 K pressure: 50.00 atm RadLength: 13.406 m
|
||||
---> Element: Carbon (C) Z = 6.0 N = 12.0 A = 12.01 g/mole ElmMassFraction: 27.29 % ElmAbundance 33.33 %
|
||||
---> Element: Oxygen (O) Z = 8.0 N = 16.0 A = 16.00 g/mole ElmMassFraction: 72.71 % ElmAbundance 66.67 %
|
||||
|
||||
Material: WaterSteam density: 0.300 mg/cm3 temperature: 500.00 K pressure: 2.00 atm RadLength: 1.203 km
|
||||
---> 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: Galactic density: 0.000 kg/m3 temperature: 2.73 K pressure: 0.00 atm RadLength: 204727576.737 pc
|
||||
---> Element: Galactic ( ) Z = 1.0 N = 1.0 A = 1.01 g/mole ElmMassFraction: 100.00 % ElmAbundance 100.00 %
|
||||
|
||||
Material: Beam density: 0.010 mg/cm3 temperature: 273.15 K pressure: 0.02 atm RadLength: 36.786 km
|
||||
---> 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 %
|
||||
|
||||
|
||||
Visualization Manager instantiating...
|
||||
Visualization Manager initialising...
|
||||
Registering graphics systems...
|
||||
|
||||
You have successfully registered the following graphics systems.
|
||||
Current available graphics systems are:
|
||||
ASCIITree (ATree)
|
||||
DAWNFILE (DAWNFILE)
|
||||
GAGTree (GAGTree)
|
||||
G4HepRep (HepRepXML)
|
||||
G4HepRepFile (HepRepFile)
|
||||
RayTracer (RayTracer)
|
||||
VRML1FILE (VRML1FILE)
|
||||
VRML2FILE (VRML2FILE)
|
||||
FukuiRenderer (DAWN)
|
||||
OpenGLImmediateX (OGLIX)
|
||||
OpenGLStoredX (OGLSX)
|
||||
VRML1 (VRML1)
|
||||
VRML2 (VRML2)
|
||||
|
||||
Registering model factories...
|
||||
|
||||
You have successfully registered the following model factories.
|
||||
Registered model factories:
|
||||
generic
|
||||
drawByCharge
|
||||
drawByParticleID
|
||||
drawByOriginVolume
|
||||
drawByAttribute
|
||||
|
||||
Registered filter factories:
|
||||
chargeFilter
|
||||
particleFilter
|
||||
originVolumeFilter
|
||||
attributeFilter
|
||||
|
||||
|
||||
------------------------------------------------------------
|
||||
---> The calorimeter is 10 layers of: [ 10mm of Lead + 5mm of liquidArgon ]
|
||||
------------------------------------------------------------
|
||||
ExN03PhysicsList::SetCuts:CutLength : 1 mm
|
||||
/run/verbose 2
|
||||
# e+ 300MeV
|
||||
#/gun/particle e+
|
||||
#/gun/energy 300 MeV
|
||||
#/run/beamOn 1
|
||||
#
|
||||
# list the existing physics processes
|
||||
/process/list
|
||||
Transportation, msc, hIoni, eIoni
|
||||
eBrem, annihil, phot, compt
|
||||
conv, muIoni, muBrems, muPairProd
|
||||
Decay
|
||||
#
|
||||
# switch off MultipleScattering
|
||||
#/process/inactivate msc
|
||||
#/run/beamOn 1
|
||||
#
|
||||
# switch on MultipleScattering
|
||||
#/process/activate msc
|
||||
#
|
||||
# change detector parameter
|
||||
/N03/det/setAbsMat Aluminium
|
||||
/N03/det/setGapMat Aerogel
|
||||
/N03/det/setAbsThick 2. cm
|
||||
/N03/det/setGapThick 5. cm
|
||||
/N03/det/setNbOfLayers 30
|
||||
/N03/det/setSizeYZ 1.5 m
|
||||
/N03/det/update
|
||||
|
||||
------------------------------------------------------------
|
||||
---> The calorimeter is 30 layers of: [ 20mm of Aluminium + 50mm of Aerogel ]
|
||||
------------------------------------------------------------
|
||||
World is removed from the default region.
|
||||
World is registered to the default region.
|
||||
#
|
||||
/gun/particle gamma
|
||||
/gun/energy 500 MeV
|
||||
/N03/event/printModulo 1024
|
||||
#/run/beamOn 1024
|
||||
/run/beamOn 4096
|
||||
|
||||
phot: Total cross sections from Sandia parametrisation.
|
||||
Sampling according PhotoElectric model
|
||||
|
||||
compt: Total cross sections has a good parametrisation from 10 KeV to (100/Z) GeV
|
||||
Sampling according Klein-Nishina model
|
||||
tables are built for gamma
|
||||
Lambda tables from 100 eV to 100 GeV in 90 bins.
|
||||
|
||||
conv: Total cross sections has a good parametrisation from 1.5 MeV to 100 GeV for all Z;
|
||||
sampling secondary e+e- according Bethe-Heitler model
|
||||
tables are built for gamma
|
||||
Lambda tables from 1.022 MeV to 100 GeV in 100 bins.
|
||||
|
||||
msc: Model variant of multiple scattering for e-
|
||||
Lambda tables from 100 eV to 100 TeV in 120 bins.
|
||||
LateralDisplacementFlag= 1 Skin= 0
|
||||
Boundary/stepping algorithm is active with facrange= 0.02 Step limitation 1
|
||||
|
||||
eIoni: tables are built for e-
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Delta cross sections and sampling from MollerBhabha model
|
||||
Good description from 1 KeV to 100 GeV.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
|
||||
|
||||
eBrem: tables are built for e-
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Total cross sections and sampling from StandBrem model (based on the EEDL data library)
|
||||
Good description from 1 KeV to 100 GeV, log scale extrapolation above 100 GeV.
|
||||
|
||||
eIoni: tables are built for e+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Delta cross sections and sampling from MollerBhabha model
|
||||
Good description from 1 KeV to 100 GeV.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
|
||||
|
||||
eBrem: tables are built for e+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Total cross sections and sampling from StandBrem model (based on the EEDL data library)
|
||||
Good description from 1 KeV to 100 GeV, log scale extrapolation above 100 GeV.
|
||||
|
||||
annihil: Sampling according eplus2gg model
|
||||
tables are built for e+
|
||||
Lambda tables from 100 eV to 100 TeV in 120 bins.
|
||||
|
||||
msc: Model variant of multiple scattering for proton
|
||||
Lambda tables from 100 eV to 100 TeV in 120 bins.
|
||||
LateralDisplacementFlag= 1 Skin= 0
|
||||
Boundary/stepping algorithm is active with facrange= 0.02 Step limitation 1
|
||||
|
||||
hIoni: tables are built for proton
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Scaling relation is used from proton dE/dx and range.
|
||||
Delta cross sections and sampling from BetheBloch model for scaled energy > 2 MeV
|
||||
Parametrisation from Bragg for protons below.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
|
||||
|
||||
hIoni: tables are built for anti_proton
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Scaling relation is used from proton dE/dx and range.
|
||||
Delta cross sections and sampling from BetheBloch model for scaled energy > 2 MeV
|
||||
Parametrisation from Bragg for protons below.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
|
||||
|
||||
msc: Model variant of multiple scattering for mu+
|
||||
Lambda tables from 100 eV to 100 TeV in 120 bins.
|
||||
LateralDisplacementFlag= 1 Skin= 0
|
||||
Boundary/stepping algorithm is active with facrange= 0.02 Step limitation 1
|
||||
|
||||
muIoni: tables are built for mu+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Bether-Bloch model for E > 0.2 MeV, parametrisation of Bragg peak below,
|
||||
radiative corrections for E > 1 GeV
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
|
||||
|
||||
muBrems: tables are built for mu+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Parametrised model
|
||||
|
||||
muPairProd: tables are built for mu+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Parametrised model
|
||||
|
||||
muIoni: tables are built for mu-
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Bether-Bloch model for E > 0.2 MeV, parametrisation of Bragg peak below,
|
||||
radiative corrections for E > 1 GeV
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
|
||||
|
||||
muBrems: tables are built for mu-
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Parametrised model
|
||||
|
||||
muPairProd: tables are built for mu-
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Parametrised model
|
||||
|
||||
hIoni: tables are built for pi+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Scaling relation is used from proton dE/dx and range.
|
||||
Delta cross sections and sampling from BetheBloch model for scaled energy > 0.297504 MeV
|
||||
Parametrisation from Bragg for protons below.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
|
||||
|
||||
msc: Model variant of multiple scattering for pi-
|
||||
Lambda tables from 100 eV to 100 TeV in 120 bins.
|
||||
LateralDisplacementFlag= 1 Skin= 0
|
||||
Boundary/stepping algorithm is active with facrange= 0.02 Step limitation 1
|
||||
|
||||
hIoni: tables are built for pi-
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Scaling relation is used from proton dE/dx and range.
|
||||
Delta cross sections and sampling from BetheBloch model for scaled energy > 0.297504 MeV
|
||||
Parametrisation from Bragg for protons below.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
|
||||
|
||||
Region <DefaultRegionForTheWorld> -- appears in <World> world volume
|
||||
Materials : Galactic Aluminium Aerogel
|
||||
Production cuts : gamma 1 mm e- 1 mm e+ 1 mm
|
||||
|
||||
========= Table of registered couples ==============================
|
||||
|
||||
Index : 0 used in the geometry : Yes recalculation needed : No
|
||||
Material : Galactic
|
||||
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm
|
||||
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV
|
||||
Region(s) which use this couple :
|
||||
DefaultRegionForTheWorld
|
||||
|
||||
Index : 1 used in the geometry : Yes recalculation needed : No
|
||||
Material : Aluminium
|
||||
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm
|
||||
Energy thresholds : gamma 6.88731 keV e- 596.68 keV e+ 568.011 keV
|
||||
Region(s) which use this couple :
|
||||
DefaultRegionForTheWorld
|
||||
|
||||
Index : 2 used in the geometry : Yes recalculation needed : No
|
||||
Material : Aerogel
|
||||
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm
|
||||
Energy thresholds : gamma 1.70631 keV e- 118.951 keV e+ 116.058 keV
|
||||
Region(s) which use this couple :
|
||||
DefaultRegionForTheWorld
|
||||
|
||||
====================================================================
|
||||
|
||||
Start closing geometry.
|
||||
G4GeometryManager::ReportVoxelStats -- Voxel Statistics
|
||||
|
||||
Total memory consumed for geometry optimisation: 1 kByte
|
||||
Total CPU time elapsed for geometry optimisation: 0 seconds
|
||||
|
||||
Voxelisation: top CPU users:
|
||||
Percent Total CPU System CPU Memory Volume
|
||||
------- ---------- ---------- -------- ----------
|
||||
0.00 0.00 0.00 1k Calorimeter
|
||||
0.00 0.00 0.00 0k Layer
|
||||
|
||||
Voxelisation: top memory users:
|
||||
Percent Memory Heads Nodes Pointers Total CPU Volume
|
||||
------- -------- ------ ------ -------- ---------- ----------
|
||||
86.94 0k 1 30 30 0.00 Calorimeter
|
||||
13.06 0k 1 3 4 0.00 Layer
|
||||
### Run 0 start.
|
||||
Start Run processing.
|
||||
|
||||
---> Begin of event: 0
|
||||
|
||||
--------- Ranecu engine status ---------
|
||||
Initial seed (index) = 0
|
||||
Current couple of seeds = 9876, 54321
|
||||
----------------------------------------
|
||||
---> End of event: 0
|
||||
Absorber: total energy: 283.25731 MeV total track length: 67.769363 cm
|
||||
Gap: total energy: 68.38224 MeV total track length: 1.8803601 m
|
||||
|
||||
---> Begin of event: 1024
|
||||
|
||||
--------- Ranecu engine status ---------
|
||||
Initial seed (index) = 0
|
||||
Current couple of seeds = 1416617493, 1758921592
|
||||
----------------------------------------
|
||||
---> End of event: 1024
|
||||
Absorber: total energy: 409.9527 MeV total track length: 96.615784 cm
|
||||
Gap: total energy: 83.253761 MeV total track length: 2.3460079 m
|
||||
|
||||
---> Begin of event: 2048
|
||||
|
||||
--------- Ranecu engine status ---------
|
||||
Initial seed (index) = 0
|
||||
Current couple of seeds = 2100749244, 1483535160
|
||||
----------------------------------------
|
||||
---> End of event: 2048
|
||||
Absorber: total energy: 358.55591 MeV total track length: 84.409873 cm
|
||||
Gap: total energy: 73.33255 MeV total track length: 2.0270683 m
|
||||
|
||||
---> Begin of event: 3072
|
||||
|
||||
--------- Ranecu engine status ---------
|
||||
Initial seed (index) = 0
|
||||
Current couple of seeds = 91156885, 1490904840
|
||||
----------------------------------------
|
||||
---> End of event: 3072
|
||||
Absorber: total energy: 327.39408 MeV total track length: 78.469165 cm
|
||||
Gap: total energy: 82.857064 MeV total track length: 2.3756107 m
|
||||
Run terminated.
|
||||
Run Summary
|
||||
Number of events processed : 4096
|
||||
User=122.98s Real=125.18s Sys=0.06s
|
||||
|
||||
--------------------End of Run------------------------------
|
||||
|
||||
mean Energy in Absorber : 367.36474 MeV +- 63.119832 MeV
|
||||
mean Energy in Gap : 78.477718 MeV +- 15.014884 MeV
|
||||
|
||||
mean trackLength in Absorber : 86.905156 cm +- 14.807223 cm
|
||||
mean trackLength in Gap : 2.1938518 m +- 42.051723 cm
|
||||
------------------------------------------------------------
|
||||
|
||||
EFFICIENCY = 0.99414062
|
||||
MEAN = 367.36474
|
||||
VAR = 3985.0861
|
||||
SD = 63.127539
|
||||
R = 0.0026849822
|
||||
SHIFT = -93.076864
|
||||
VOV = 0.003182594
|
||||
FOM = 1127.3814
|
||||
THE LARGEST SCORE = 432.17571 and it happend at 2089th event
|
||||
Affected Mean = 367.38056 and its ratio to orignal is 1.0000431
|
||||
Affected VAR = 3985.1385 and its ratio to orignal is 1.0000131
|
||||
Affected R = 0.0026845566 and its ratio to orignal is 0.99984146
|
||||
Affected SHIFT = -93.06831 and its ratio to orignal is 0.99990809
|
||||
Affected FOM = 1127.1981 and its ratio to orignal is 0.99983748
|
||||
MEAN distribution is not RANDOM
|
||||
r follows 1/sqrt(N)
|
||||
r is monotonically decrease 1
|
||||
r is less than 0.1. r = 0.0026849822
|
||||
VOV follows 1/sqrt(N)
|
||||
VOV is monotonically decrease 1
|
||||
FOM distribution is RANDOM
|
||||
SLOPE is large enough
|
||||
This result passes 7 / 8 Convergence Test.
|
||||
|
||||
i/16 till_ith mean var sd r vov fom shift e r2eff r2int
|
||||
1 255 363.69563 4842.0051 69.584518 0.01195789 0.056002987 917.77436 -110.35431 0.984375 6.2003968e-05 8.0428606e-05
|
||||
2 511 363.58843 4749.7359 68.918328 0.0083770227 0.025419456 925.93819 -102.91971 0.98632812 2.707302e-05 4.2964429e-05
|
||||
3 767 364.42855 4544.2168 67.410807 0.0066747733 0.018336314 995.80213 -104.31098 0.98828125 1.5439723e-05 2.9054864e-05
|
||||
4 1023 365.10707 4393.1003 66.280467 0.0056730334 0.013420174 1031.9498 -101.03049 0.99023438 9.6307939e-06 2.2521085e-05
|
||||
5 1279 366.02106 4083.8816 63.905255 0.0048800639 0.01065566 1105.881 -95.586858 0.9921875 6.1515748e-06 1.7644843e-05
|
||||
6 1535 365.9273 4180.3188 64.655385 0.0045083153 0.0086705565 1077.0735 -96.06075 0.99283854 4.6960383e-06 1.5615636e-05
|
||||
7 1791 366.45161 4031.9307 63.497486 0.0040932747 0.0074700364 1116.0068 -94.449401 0.99386161 3.446599e-06 1.3298949e-05
|
||||
8 2047 366.85003 4019.5466 63.399895 0.0038188711 0.0066935636 1119.3168 -95.675698 0.99365234 3.1192414e-06 1.1457414e-05
|
||||
9 2303 367.29667 3935.3014 62.73198 0.0035582034 0.0059453164 1143.2028 -94.30888 0.99392361 2.6534449e-06 1.0001871e-05
|
||||
10 2559 367.20252 3939.3158 62.763969 0.0033781954 0.0053236784 1138.4369 -93.986262 0.99375 2.456761e-06 8.9509854e-06
|
||||
11 2815 367.18776 3923.8609 62.640729 0.0032147876 0.004764987 1142.7885 -92.933911 0.99396307 2.1568174e-06 8.1743718e-06
|
||||
12 3071 367.45252 3874.3851 62.244559 0.0030562548 0.0042984072 1163.0465 -91.357182 0.99446615 1.8114089e-06 7.526244e-06
|
||||
13 3327 367.46316 3919.3176 62.604453 0.0029532469 0.0039628182 1147.6026 -92.378714 0.99459135 1.6340344e-06 7.0850122e-06
|
||||
14 3583 367.67356 3884.2471 62.323728 0.0028314377 0.0036583059 1158.1645 -91.590867 0.99469866 1.4870517e-06 6.5277511e-06
|
||||
15 3839 367.36349 3979.2159 63.081026 0.002771004 0.0033338321 1130.2126 -91.977413 0.99453125 1.4319848e-06 6.2444786e-06
|
||||
16 4095 367.36474 3985.0861 63.127539 0.0026849822 0.003182594 1127.748 -93.076864 0.99414062 1.4389428e-06 5.7684267e-06
|
||||
EFFICIENCY = 0.99438477
|
||||
MEAN = 78.477718
|
||||
VAR = 225.50178
|
||||
SD = 15.016717
|
||||
R = 0.0029898448
|
||||
SHIFT = -13.902917
|
||||
VOV = 0.0019924127
|
||||
FOM = 909.19362
|
||||
THE LARGEST SCORE = 117.3797 and it happend at 510th event
|
||||
Affected Mean = 78.487213 and its ratio to orignal is 1.000121
|
||||
Affected VAR = 225.81611 and its ratio to orignal is 1.0013939
|
||||
Affected R = 0.0029912008 and its ratio to orignal is 1.0004535
|
||||
Affected SHIFT = -13.862598 and its ratio to orignal is 0.99709995
|
||||
Affected FOM = 908.89814 and its ratio to orignal is 0.99967501
|
||||
MEAN distribution is not RANDOM
|
||||
r follows 1/sqrt(N)
|
||||
r is monotonically decrease 1
|
||||
r is less than 0.1. r = 0.0029898448
|
||||
VOV follows 1/sqrt(N)
|
||||
VOV is monotonically decrease 1
|
||||
FOM distribution is RANDOM
|
||||
SLOPE is large enough
|
||||
This result passes 7 / 8 Convergence Test.
|
||||
|
||||
i/16 till_ith mean var sd r vov fom shift e r2eff r2int
|
||||
1 255 76.935633 252.45045 15.888689 0.012907453 0.038596366 787.70557 -17.661167 0.984375 6.2003968e-05 0.00010394759
|
||||
2 511 77.389232 257.4632 16.04566 0.0091630923 0.017298474 773.88648 -16.441348 0.98632812 2.707302e-05 5.6725251e-05
|
||||
3 767 77.665817 248.62651 15.767895 0.0073259372 0.012144321 826.64625 -16.585523 0.98828125 1.5439723e-05 3.8159751e-05
|
||||
4 1023 77.969112 245.54395 15.669842 0.0062804686 0.0086792682 841.98653 -16.027547 0.99023438 9.6307939e-06 2.9774973e-05
|
||||
5 1279 78.061919 228.9236 15.130221 0.0054175269 0.0067481801 897.34046 -14.687306 0.9921875 6.1515748e-06 2.3175093e-05
|
||||
6 1535 77.870133 231.84589 15.226486 0.004989226 0.0054405699 879.44272 -14.43874 0.99283854 4.6960383e-06 2.0180132e-05
|
||||
7 1791 78.045703 224.72573 14.990855 0.004537414 0.0046643478 908.22153 -14.045519 0.99386161 3.446599e-06 1.7130038e-05
|
||||
8 2047 78.107287 226.09338 15.036402 0.0042539011 0.0041397452 902.08658 -14.202387 0.99365234 3.1192414e-06 1.4967598e-05
|
||||
9 2303 78.129941 222.08125 14.902391 0.0039737195 0.0036662056 916.62223 -13.945849 0.99392361 2.6534449e-06 1.3130148e-05
|
||||
10 2559 78.225505 223.59764 14.953181 0.0037780287 0.0032772248 910.22344 -13.934949 0.99414062 2.3023084e-06 1.1965617e-05
|
||||
11 2815 78.250797 222.51845 14.917052 0.003592344 0.0029353727 915.19704 -13.768958 0.99431818 2.0292208e-06 1.0871132e-05
|
||||
12 3071 78.377339 220.83103 14.860385 0.0034208098 0.002628038 928.36413 -13.3624 0.99479167 1.7042976e-06 9.9938329e-06
|
||||
13 3327 78.364284 221.49591 14.882739 0.0032921001 0.0024634602 923.51719 -13.660307 0.99489183 1.5427886e-06 9.2918778e-06
|
||||
14 3583 78.464175 220.63749 14.853871 0.0031621629 0.0022668889 928.57248 -13.539324 0.99497768 1.4083908e-06 8.5880937e-06
|
||||
15 3839 78.420541 224.71581 14.990524 0.0030847599 0.002080651 911.9934 -13.68267 0.99479167 1.363438e-06 8.1498278e-06
|
||||
16 4095 78.477718 225.50178 15.016717 0.0029898448 0.0019924127 909.4893 -13.902917 0.99438477 1.3786483e-06 7.5583414e-06
|
||||
EFFICIENCY = 0.99414062
|
||||
MEAN = 869.05156
|
||||
VAR = 21930.74
|
||||
SD = 148.09031
|
||||
R = 0.0026625706
|
||||
SHIFT = -219.82454
|
||||
VOV = 0.0032422354
|
||||
FOM = 1146.4402
|
||||
THE LARGEST SCORE = 1027.1443 and it happend at 3814th event
|
||||
Affected Mean = 869.09015 and its ratio to orignal is 1.0000444
|
||||
Affected VAR = 21931.486 and its ratio to orignal is 1.000034
|
||||
Affected R = 0.0026621727 and its ratio to orignal is 0.99985057
|
||||
Affected SHIFT = -219.79928 and its ratio to orignal is 0.99988512
|
||||
Affected FOM = 1146.1608 and its ratio to orignal is 0.99975624
|
||||
MEAN distribution is not RANDOM
|
||||
r follows 1/sqrt(N)
|
||||
r is monotonically decrease 1
|
||||
r is less than 0.1. r = 0.0026625706
|
||||
VOV follows 1/sqrt(N)
|
||||
VOV is monotonically decrease 1
|
||||
FOM distribution is RANDOM
|
||||
SLOPE is large enough
|
||||
This result passes 7 / 8 Convergence Test.
|
||||
|
||||
i/16 till_ith mean var sd r vov fom shift e r2eff r2int
|
||||
1 255 861.69435 26843.051 163.83849 0.011883455 0.056992789 929.30787 -261.77551 0.984375 6.2003968e-05 7.8660896e-05
|
||||
2 511 860.79291 26203.188 161.87399 0.008310811 0.025999392 940.75075 -244.30029 0.98632812 2.707302e-05 4.1861658e-05
|
||||
3 767 862.6567 25165.992 158.63793 0.0066357256 0.018648001 1007.5561 -247.39142 0.98828125 1.5439723e-05 2.8535796e-05
|
||||
4 1023 864.30516 24375.56 156.12674 0.0056449516 0.013579709 1042.2426 -239.09024 0.99023438 9.6307939e-06 2.2203565e-05
|
||||
5 1279 866.26907 22638.47 150.46086 0.0048547374 0.010784744 1117.4495 -226.02039 0.9921875 6.1515748e-06 1.7398488e-05
|
||||
6 1535 865.84122 23148.783 152.14724 0.0044836347 0.0087734476 1088.9638 -226.82282 0.99283854 4.6960383e-06 1.5393854e-05
|
||||
7 1791 867.159 22318.346 149.39326 0.0040697081 0.0075531817 1128.9691 -222.78426 0.99386161 3.446599e-06 1.3106683e-05
|
||||
8 2047 867.96874 22251.061 149.1679 0.0037975745 0.0067720602 1131.9061 -225.8556 0.99365234 3.1192414e-06 1.1295289e-05
|
||||
9 2303 869.08068 21767.979 147.53976 0.0035367774 0.0060219798 1157.0959 -222.63442 0.99392361 2.6534449e-06 9.8499201e-06
|
||||
10 2559 868.69511 21767.631 147.53857 0.003356744 0.0054034157 1153.0339 -222.0616 0.99375 2.456761e-06 8.8065678e-06
|
||||
11 2815 868.66303 21656.962 147.16305 0.0031925015 0.004844182 1158.7993 -219.6029 0.99396307 2.1568174e-06 8.0316288e-06
|
||||
12 3071 869.31174 21362.273 146.15838 0.0030334552 0.0043726635 1180.5953 -215.78394 0.99446615 1.8114089e-06 7.3874459e-06
|
||||
13 3327 869.27849 21608.366 146.99784 0.0029313007 0.0040300166 1164.8508 -218.22222 0.99459135 1.6340344e-06 6.9559075e-06
|
||||
14 3583 869.75188 21383.902 146.23235 0.0028084332 0.0037266284 1177.2159 -216.34151 0.99469866 1.4870517e-06 6.3980446e-06
|
||||
15 3839 869.07806 21900.952 147.9897 0.002747939 0.0033957938 1149.2652 -217.22849 0.99453125 1.4319848e-06 6.1172176e-06
|
||||
16 4095 869.05156 21930.74 148.09031 0.0026625706 0.0032422354 1146.8131 -219.82454 0.99414062 1.4389428e-06 5.6486085e-06
|
||||
EFFICIENCY = 0.99438477
|
||||
MEAN = 2193.8518
|
||||
VAR = 176877.92
|
||||
SD = 420.56857
|
||||
R = 0.0029953636
|
||||
SHIFT = -381.00068
|
||||
VOV = 0.0019642012
|
||||
FOM = 905.84641
|
||||
THE LARGEST SCORE = 3342.1446 and it happend at 510th event
|
||||
Affected Mean = 2194.1321 and its ratio to orignal is 1.0001278
|
||||
Affected VAR = 177156.58 and its ratio to orignal is 1.0015754
|
||||
Affected R = 0.0029969734 and its ratio to orignal is 1.0005374
|
||||
Affected SHIFT = -379.68581 and its ratio to orignal is 0.99654889
|
||||
Affected FOM = 905.55202 and its ratio to orignal is 0.99967501
|
||||
MEAN distribution is not RANDOM
|
||||
r follows 1/sqrt(N)
|
||||
r is monotonically decrease 1
|
||||
r is less than 0.1. r = 0.0029953636
|
||||
VOV follows 1/sqrt(N)
|
||||
VOV is monotonically decrease 1
|
||||
FOM distribution is RANDOM
|
||||
SLOPE is large enough
|
||||
This result passes 7 / 8 Convergence Test.
|
||||
|
||||
i/16 till_ith mean var sd r vov fom shift e r2eff r2int
|
||||
1 255 2151.5475 198324.33 445.3362 0.012936509 0.037983865 784.17115 -485.5417 0.984375 6.2003968e-05 0.00010469556
|
||||
2 511 2163.8396 202042.18 449.49103 0.0091803868 0.017034269 770.97345 -450.67455 0.98632812 2.707302e-05 5.7041873e-05
|
||||
3 767 2171.0637 195014.7 441.60469 0.0073397371 0.011969743 823.54072 -455.57391 0.98828125 1.5439723e-05 3.8361872e-05
|
||||
4 1023 2179.4431 192970.03 439.28354 0.0062986782 0.0085220689 837.12516 -439.35363 0.99023438 9.6307939e-06 3.000381e-05
|
||||
5 1279 2182.0842 179945.56 424.19991 0.0054336802 0.0066285985 892.01315 -402.04808 0.9921875 6.1515748e-06 2.3350239e-05
|
||||
6 1535 2177.0042 182127.31 426.76377 0.0050018729 0.0053600627 875.00109 -396.25674 0.99283854 4.6960383e-06 2.0306406e-05
|
||||
7 1791 2181.7945 176401.6 420.00191 0.0045474551 0.0045955059 904.21513 -385.65985 0.99386161 3.446599e-06 1.7221209e-05
|
||||
8 2047 2183.614 177518.81 421.32981 0.004263648 0.0040792702 897.96688 -389.87024 0.99365234 3.1192414e-06 1.5050577e-05
|
||||
9 2303 2184.0604 174066.09 417.21229 0.003979708 0.0036267829 913.86573 -383.82636 0.99392361 2.6534449e-06 1.3177757e-05
|
||||
10 2559 2186.6213 175388.85 418.79452 0.0037853622 0.0032378986 906.70004 -383.10592 0.99414062 2.3023084e-06 1.2021061e-05
|
||||
11 2815 2187.5558 174760.73 418.04393 0.0036011935 0.0028953572 910.70461 -378.32363 0.99431818 2.0292208e-06 1.0934768e-05
|
||||
12 3071 2191.0798 173383.37 416.39329 0.003428743 0.0025916378 924.07314 -367.0535 0.99479167 1.7042976e-06 1.0048154e-05
|
||||
13 3327 2190.6932 173982.37 417.11194 0.0033004974 0.0024267277 918.82384 -374.97139 0.99489183 1.5427886e-06 9.3472211e-06
|
||||
14 3583 2193.4584 173261.32 416.24671 0.0031698405 0.0022327559 924.07983 -371.21284 0.99497768 1.4083908e-06 8.6366942e-06
|
||||
15 3839 2192.2379 176250.34 419.8218 0.0030903786 0.0020511909 908.68019 -374.98467 0.99479167 1.363438e-06 8.1845148e-06
|
||||
16 4095 2193.8518 176877.92 420.56857 0.0029953636 0.0019642012 906.14099 -381.00068 0.99438477 1.3786483e-06 7.5913646e-06
|
||||
#/run/beamOn 16384
|
||||
#/run/beamOn 65536
|
||||
UserDetectorConstruction deleted.
|
||||
UserPhysicsList deleted.
|
||||
UserRunAction deleted.
|
||||
UserPrimaryGenerator deleted.
|
||||
G4 kernel has come to Quit state.
|
||||
EventManager deleted.
|
||||
Default detector region deleted.
|
||||
UImanager deleted.
|
||||
Units table cleared.
|
||||
StateManager deleted.
|
||||
RunManagerKernel is deleted.
|
||||
RunManager is deleting.
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
/control/verbose 2
|
||||
/run/verbose 2
|
||||
|
||||
# e+ 300MeV
|
||||
#/gun/particle e+
|
||||
#/gun/energy 300 MeV
|
||||
#/run/beamOn 1
|
||||
#
|
||||
# list the existing physics processes
|
||||
/process/list
|
||||
#
|
||||
# switch off MultipleScattering
|
||||
#/process/inactivate msc
|
||||
#/run/beamOn 1
|
||||
#
|
||||
# switch on MultipleScattering
|
||||
#/process/activate msc
|
||||
#
|
||||
# change detector parameter
|
||||
/N03/det/setAbsMat Aluminium
|
||||
/N03/det/setGapMat Aerogel
|
||||
/N03/det/setAbsThick 2. cm
|
||||
/N03/det/setGapThick 5. cm
|
||||
/N03/det/setNbOfLayers 30
|
||||
/N03/det/setSizeYZ 1.5 m
|
||||
/N03/det/update
|
||||
#
|
||||
/gun/particle gamma
|
||||
/gun/energy 500 MeV
|
||||
/N03/event/printModulo 1024
|
||||
#/run/beamOn 1024
|
||||
#/run/beamOn 4096
|
||||
/run/beamOn 16384
|
||||
#/run/beamOn 65536
|
||||
exit
|
||||
@@ -0,0 +1,159 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03DetectorConstruction.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03DetectorConstruction_h
|
||||
#define ExN03DetectorConstruction_h 1
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Box;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
class G4Material;
|
||||
class G4UniformMagField;
|
||||
class ExN03DetectorMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
|
||||
ExN03DetectorConstruction();
|
||||
~ExN03DetectorConstruction();
|
||||
|
||||
public:
|
||||
|
||||
void SetAbsorberMaterial (G4String);
|
||||
void SetAbsorberThickness(G4double);
|
||||
|
||||
void SetGapMaterial (G4String);
|
||||
void SetGapThickness(G4double);
|
||||
|
||||
void SetCalorSizeYZ(G4double);
|
||||
void SetNbOfLayers (G4int);
|
||||
|
||||
void SetMagField(G4double);
|
||||
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
void UpdateGeometry();
|
||||
|
||||
public:
|
||||
|
||||
void PrintCalorParameters();
|
||||
|
||||
G4double GetWorldSizeX() {return WorldSizeX;};
|
||||
G4double GetWorldSizeYZ() {return WorldSizeYZ;};
|
||||
|
||||
G4double GetCalorThickness() {return CalorThickness;};
|
||||
G4double GetCalorSizeYZ() {return CalorSizeYZ;};
|
||||
|
||||
G4int GetNbOfLayers() {return NbOfLayers;};
|
||||
|
||||
G4Material* GetAbsorberMaterial() {return AbsorberMaterial;};
|
||||
G4double GetAbsorberThickness() {return AbsorberThickness;};
|
||||
|
||||
G4Material* GetGapMaterial() {return GapMaterial;};
|
||||
G4double GetGapThickness() {return GapThickness;};
|
||||
|
||||
const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
|
||||
const G4VPhysicalVolume* GetAbsorber() {return physiAbsorber;};
|
||||
const G4VPhysicalVolume* GetGap() {return physiGap;};
|
||||
|
||||
private:
|
||||
|
||||
G4Material* AbsorberMaterial;
|
||||
G4double AbsorberThickness;
|
||||
|
||||
G4Material* GapMaterial;
|
||||
G4double GapThickness;
|
||||
|
||||
G4int NbOfLayers;
|
||||
G4double LayerThickness;
|
||||
|
||||
G4double CalorSizeYZ;
|
||||
G4double CalorThickness;
|
||||
|
||||
G4Material* defaultMaterial;
|
||||
G4double WorldSizeYZ;
|
||||
G4double WorldSizeX;
|
||||
|
||||
G4Box* solidWorld; //pointer to the solid World
|
||||
G4LogicalVolume* logicWorld; //pointer to the logical World
|
||||
G4VPhysicalVolume* physiWorld; //pointer to the physical World
|
||||
|
||||
G4Box* solidCalor; //pointer to the solid Calor
|
||||
G4LogicalVolume* logicCalor; //pointer to the logical Calor
|
||||
G4VPhysicalVolume* physiCalor; //pointer to the physical Calor
|
||||
|
||||
G4Box* solidLayer; //pointer to the solid Layer
|
||||
G4LogicalVolume* logicLayer; //pointer to the logical Layer
|
||||
G4VPhysicalVolume* physiLayer; //pointer to the physical Layer
|
||||
|
||||
G4Box* solidAbsorber; //pointer to the solid Absorber
|
||||
G4LogicalVolume* logicAbsorber; //pointer to the logical Absorber
|
||||
G4VPhysicalVolume* physiAbsorber; //pointer to the physical Absorber
|
||||
|
||||
G4Box* solidGap; //pointer to the solid Gap
|
||||
G4LogicalVolume* logicGap; //pointer to the logical Gap
|
||||
G4VPhysicalVolume* physiGap; //pointer to the physical Gap
|
||||
|
||||
G4UniformMagField* magField; //pointer to the magnetic field
|
||||
|
||||
ExN03DetectorMessenger* detectorMessenger; //pointer to the Messenger
|
||||
|
||||
private:
|
||||
|
||||
void DefineMaterials();
|
||||
void ComputeCalorParameters();
|
||||
G4VPhysicalVolume* ConstructCalorimeter();
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void ExN03DetectorConstruction::ComputeCalorParameters()
|
||||
{
|
||||
// Compute derived parameters of the calorimeter
|
||||
LayerThickness = AbsorberThickness + GapThickness;
|
||||
CalorThickness = NbOfLayers*LayerThickness;
|
||||
|
||||
WorldSizeX = 1.2*CalorThickness; WorldSizeYZ = 1.2*CalorSizeYZ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03DetectorMessenger.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03DetectorMessenger_h
|
||||
#define ExN03DetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class ExN03DetectorConstruction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithoutParameter;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03DetectorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
ExN03DetectorMessenger(ExN03DetectorConstruction* );
|
||||
~ExN03DetectorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
ExN03DetectorConstruction* ExN03Detector;
|
||||
|
||||
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,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03EventAction.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03EventAction_h
|
||||
#define ExN03EventAction_h 1
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN03RunAction;
|
||||
class ExN03EventActionMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
ExN03EventAction(ExN03RunAction*);
|
||||
~ExN03EventAction();
|
||||
|
||||
public:
|
||||
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 SetPrintModulo(G4int val) {printModulo = val;};
|
||||
|
||||
private:
|
||||
ExN03RunAction* runAct;
|
||||
|
||||
G4double EnergyAbs, EnergyGap;
|
||||
G4double TrackLAbs, TrackLGap;
|
||||
|
||||
G4int printModulo;
|
||||
|
||||
ExN03EventActionMessenger* eventMessenger;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03EventActionMessenger.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03EventActionMessenger_h
|
||||
#define ExN03EventActionMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class ExN03EventAction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAnInteger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03EventActionMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
ExN03EventActionMessenger(ExN03EventAction*);
|
||||
~ExN03EventActionMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
ExN03EventAction* eventAction;
|
||||
G4UIdirectory* eventDir;
|
||||
G4UIcmdWithAnInteger* PrintCmd;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03PhysicsList.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03PhysicsList_h
|
||||
#define ExN03PhysicsList_h 1
|
||||
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03PhysicsList: public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
ExN03PhysicsList();
|
||||
~ExN03PhysicsList();
|
||||
|
||||
protected:
|
||||
// Construct particle and physics
|
||||
void ConstructParticle();
|
||||
void ConstructProcess();
|
||||
|
||||
void SetCuts();
|
||||
|
||||
|
||||
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();
|
||||
};
|
||||
|
||||
//....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: ExN03PrimaryGeneratorAction.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03PrimaryGeneratorAction_h
|
||||
#define ExN03PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
class ExN03DetectorConstruction;
|
||||
class ExN03PrimaryGeneratorMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
ExN03PrimaryGeneratorAction(ExN03DetectorConstruction*);
|
||||
~ExN03PrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
void GeneratePrimaries(G4Event*);
|
||||
void SetRndmFlag(G4String val) { rndmFlag = val;}
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun; //pointer a to G4 class
|
||||
ExN03DetectorConstruction* ExN03Detector; //pointer to the geometry
|
||||
|
||||
ExN03PrimaryGeneratorMessenger* 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: ExN03PrimaryGeneratorMessenger.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03PrimaryGeneratorMessenger_h
|
||||
#define ExN03PrimaryGeneratorMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN03PrimaryGeneratorAction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03PrimaryGeneratorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
ExN03PrimaryGeneratorMessenger(ExN03PrimaryGeneratorAction*);
|
||||
~ExN03PrimaryGeneratorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
ExN03PrimaryGeneratorAction* ExN03Action;
|
||||
G4UIdirectory* gunDir;
|
||||
G4UIcmdWithAString* RndmCmd;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03RunAction.hh,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03RunAction_h
|
||||
#define ExN03RunAction_h 1
|
||||
|
||||
#include "G4ConvergenceTester.hh"
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class G4Run;
|
||||
|
||||
class ExN03RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
ExN03RunAction();
|
||||
~ExN03RunAction();
|
||||
|
||||
public:
|
||||
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: ExN03SteppingAction.hh,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03SteppingAction_h
|
||||
#define ExN03SteppingAction_h 1
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
|
||||
class ExN03DetectorConstruction;
|
||||
class ExN03EventAction;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
ExN03SteppingAction(ExN03DetectorConstruction*, ExN03EventAction*);
|
||||
~ExN03SteppingAction();
|
||||
|
||||
void UserSteppingAction(const G4Step*);
|
||||
|
||||
private:
|
||||
ExN03DetectorConstruction* detector;
|
||||
ExN03EventAction* eventaction;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03SteppingVerbose.hh,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03SteppingVerbose;
|
||||
|
||||
#ifndef ExN03SteppingVerbose_h
|
||||
#define ExN03SteppingVerbose_h 1
|
||||
|
||||
#include "G4SteppingVerbose.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03SteppingVerbose : public G4SteppingVerbose
|
||||
{
|
||||
public:
|
||||
|
||||
ExN03SteppingVerbose();
|
||||
~ExN03SteppingVerbose();
|
||||
|
||||
void StepInfo();
|
||||
void TrackingStarted();
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,150 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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,473 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03DetectorConstruction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03DetectorConstruction.hh"
|
||||
#include "ExN03DetectorMessenger.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4PVReplica.hh"
|
||||
#include "G4UniformMagField.hh"
|
||||
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03DetectorConstruction::ExN03DetectorConstruction()
|
||||
: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),
|
||||
magField(0)
|
||||
{
|
||||
// default parameter values of the calorimeter
|
||||
AbsorberThickness = 10.*mm;
|
||||
GapThickness = 5.*mm;
|
||||
NbOfLayers = 10;
|
||||
CalorSizeYZ = 10.*cm;
|
||||
ComputeCalorParameters();
|
||||
|
||||
// materials
|
||||
DefineMaterials();
|
||||
SetAbsorberMaterial("Lead");
|
||||
SetGapMaterial("liquidArgon");
|
||||
|
||||
// create commands for interactive definition of the calorimeter
|
||||
detectorMessenger = new ExN03DetectorMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03DetectorConstruction::~ExN03DetectorConstruction()
|
||||
{ delete detectorMessenger;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VPhysicalVolume* ExN03DetectorConstruction::Construct()
|
||||
{
|
||||
return ConstructCalorimeter();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03DetectorConstruction::DefineMaterials()
|
||||
{
|
||||
//This function illustrates the possible ways to define materials
|
||||
|
||||
G4String 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;
|
||||
|
||||
//
|
||||
// define Elements
|
||||
//
|
||||
|
||||
G4Element* H = new G4Element("Hydrogen",symbol="H" , z= 1., a= 1.01*g/mole);
|
||||
G4Element* C = new G4Element("Carbon" ,symbol="C" , z= 6., a= 12.01*g/mole);
|
||||
G4Element* N = new G4Element("Nitrogen",symbol="N" , z= 7., a= 14.01*g/mole);
|
||||
G4Element* O = new G4Element("Oxygen" ,symbol="O" , z= 8., a= 16.00*g/mole);
|
||||
G4Element* Si = new G4Element("Silicon",symbol="Si" , z= 14., a= 28.09*g/mole);
|
||||
|
||||
//
|
||||
// define an Element from isotopes, by relative abundance
|
||||
//
|
||||
|
||||
G4Isotope* U5 = new G4Isotope("U235", iz=92, n=235, a=235.01*g/mole);
|
||||
G4Isotope* U8 = new G4Isotope("U238", iz=92, n=238, a=238.03*g/mole);
|
||||
|
||||
G4Element* U = new G4Element("enriched Uranium",symbol="U",ncomponents=2);
|
||||
U->AddIsotope(U5, abundance= 90.*perCent);
|
||||
U->AddIsotope(U8, abundance= 10.*perCent);
|
||||
|
||||
//
|
||||
// define simple materials
|
||||
//
|
||||
|
||||
new G4Material("Aluminium", z=13., a=26.98*g/mole, density=2.700*g/cm3);
|
||||
new G4Material("liquidArgon", z=18., a= 39.95*g/mole, density= 1.390*g/cm3);
|
||||
new G4Material("Lead" , z=82., a= 207.19*g/mole, density= 11.35*g/cm3);
|
||||
|
||||
//
|
||||
// define a material from elements. case 1: chemical molecule
|
||||
//
|
||||
|
||||
G4Material* H2O =
|
||||
new G4Material("Water", density= 1.000*g/cm3, ncomponents=2);
|
||||
H2O->AddElement(H, natoms=2);
|
||||
H2O->AddElement(O, natoms=1);
|
||||
// overwrite computed meanExcitationEnergy with ICRU recommended value
|
||||
H2O->GetIonisation()->SetMeanExcitationEnergy(75.0*eV);
|
||||
|
||||
G4Material* Sci =
|
||||
new G4Material("Scintillator", density= 1.032*g/cm3, ncomponents=2);
|
||||
Sci->AddElement(C, natoms=9);
|
||||
Sci->AddElement(H, natoms=10);
|
||||
|
||||
G4Material* Myl =
|
||||
new G4Material("Mylar", density= 1.397*g/cm3, ncomponents=3);
|
||||
Myl->AddElement(C, natoms=10);
|
||||
Myl->AddElement(H, natoms= 8);
|
||||
Myl->AddElement(O, natoms= 4);
|
||||
|
||||
G4Material* SiO2 =
|
||||
new G4Material("quartz",density= 2.200*g/cm3, ncomponents=2);
|
||||
SiO2->AddElement(Si, natoms=1);
|
||||
SiO2->AddElement(O , natoms=2);
|
||||
|
||||
//
|
||||
// define a material from elements. case 2: mixture by fractional mass
|
||||
//
|
||||
|
||||
G4Material* Air =
|
||||
new G4Material("Air" , density= 1.290*mg/cm3, 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)
|
||||
//
|
||||
|
||||
G4Material* Aerog =
|
||||
new G4Material("Aerogel", density= 0.200*g/cm3, 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
|
||||
//
|
||||
|
||||
G4Material* CO2 =
|
||||
new G4Material("CarbonicGas", density= 27.*mg/cm3, ncomponents=2,
|
||||
kStateGas, 325.*kelvin, 50.*atmosphere);
|
||||
CO2->AddElement(C, natoms=1);
|
||||
CO2->AddElement(O, natoms=2);
|
||||
|
||||
G4Material* steam =
|
||||
new G4Material("WaterSteam", density= 0.3*mg/cm3, ncomponents=1,
|
||||
kStateGas, 500.*kelvin, 2.*atmosphere);
|
||||
steam->AddMaterial(H2O, fractionmass=1.);
|
||||
|
||||
//
|
||||
// examples of vacuum
|
||||
//
|
||||
|
||||
G4Material* Vacuum =
|
||||
new G4Material("Galactic", z=1., a=1.01*g/mole,density= universe_mean_density,
|
||||
kStateGas, 2.73*kelvin, 3.e-18*pascal);
|
||||
|
||||
G4Material* beam =
|
||||
new G4Material("Beam", density= 1.e-5*g/cm3, ncomponents=1,
|
||||
kStateGas, STP_Temperature, 2.e-2*bar);
|
||||
beam->AddMaterial(Air, fractionmass=1.);
|
||||
|
||||
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
|
||||
|
||||
//default materials of the World
|
||||
defaultMaterial = Vacuum;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VPhysicalVolume* ExN03DetectorConstruction::ConstructCalorimeter()
|
||||
{
|
||||
|
||||
// Clean old geometry, if any
|
||||
//
|
||||
G4GeometryManager::GetInstance()->OpenGeometry();
|
||||
G4PhysicalVolumeStore::GetInstance()->Clean();
|
||||
G4LogicalVolumeStore::GetInstance()->Clean();
|
||||
G4SolidStore::GetInstance()->Clean();
|
||||
|
||||
// complete the Calor parameters definition
|
||||
ComputeCalorParameters();
|
||||
|
||||
//
|
||||
// World
|
||||
//
|
||||
solidWorld = new G4Box("World", //its name
|
||||
WorldSizeX/2,WorldSizeYZ/2,WorldSizeYZ/2); //its size
|
||||
|
||||
logicWorld = new G4LogicalVolume(solidWorld, //its solid
|
||||
defaultMaterial, //its material
|
||||
"World"); //its name
|
||||
|
||||
physiWorld = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
logicWorld, //its logical volume
|
||||
"World", //its name
|
||||
0, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
|
||||
//
|
||||
// Calorimeter
|
||||
//
|
||||
solidCalor=0; logicCalor=0; physiCalor=0;
|
||||
solidLayer=0; logicLayer=0; physiLayer=0;
|
||||
|
||||
if (CalorThickness > 0.)
|
||||
{ solidCalor = new G4Box("Calorimeter", //its name
|
||||
CalorThickness/2,CalorSizeYZ/2,CalorSizeYZ/2);//size
|
||||
|
||||
logicCalor = new G4LogicalVolume(solidCalor, //its solid
|
||||
defaultMaterial, //its material
|
||||
"Calorimeter"); //its name
|
||||
|
||||
physiCalor = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
logicCalor, //its logical volume
|
||||
"Calorimeter", //its name
|
||||
logicWorld, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
|
||||
//
|
||||
// Layer
|
||||
//
|
||||
solidLayer = new G4Box("Layer", //its name
|
||||
LayerThickness/2,CalorSizeYZ/2,CalorSizeYZ/2); //size
|
||||
|
||||
logicLayer = new G4LogicalVolume(solidLayer, //its solid
|
||||
defaultMaterial, //its material
|
||||
"Layer"); //its name
|
||||
if (NbOfLayers > 1)
|
||||
physiLayer = new G4PVReplica("Layer", //its name
|
||||
logicLayer, //its logical volume
|
||||
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
|
||||
logicCalor, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
}
|
||||
|
||||
//
|
||||
// Absorber
|
||||
//
|
||||
solidAbsorber=0; logicAbsorber=0; physiAbsorber=0;
|
||||
|
||||
if (AbsorberThickness > 0.)
|
||||
{ solidAbsorber = new G4Box("Absorber", //its name
|
||||
AbsorberThickness/2,CalorSizeYZ/2,CalorSizeYZ/2);
|
||||
|
||||
logicAbsorber = new G4LogicalVolume(solidAbsorber, //its solid
|
||||
AbsorberMaterial, //its material
|
||||
AbsorberMaterial->GetName()); //name
|
||||
|
||||
physiAbsorber = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(-GapThickness/2,0.,0.), //its position
|
||||
logicAbsorber, //its logical volume
|
||||
AbsorberMaterial->GetName(), //its name
|
||||
logicLayer, //its mother
|
||||
false, //no boulean operat
|
||||
0); //copy number
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Gap
|
||||
//
|
||||
solidGap=0; logicGap=0; physiGap=0;
|
||||
|
||||
if (GapThickness > 0.)
|
||||
{ solidGap = new G4Box("Gap",
|
||||
GapThickness/2,CalorSizeYZ/2,CalorSizeYZ/2);
|
||||
|
||||
logicGap = new G4LogicalVolume(solidGap,
|
||||
GapMaterial,
|
||||
GapMaterial->GetName());
|
||||
|
||||
physiGap = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(AbsorberThickness/2,0.,0.), //its position
|
||||
logicGap, //its logical volume
|
||||
GapMaterial->GetName(), //its name
|
||||
logicLayer, //its mother
|
||||
false, //no boulean operat
|
||||
0); //copy number
|
||||
}
|
||||
|
||||
PrintCalorParameters();
|
||||
|
||||
//
|
||||
// Visualization attributes
|
||||
//
|
||||
logicWorld->SetVisAttributes (G4VisAttributes::Invisible);
|
||||
|
||||
G4VisAttributes* simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
|
||||
simpleBoxVisAtt->SetVisibility(true);
|
||||
logicCalor->SetVisAttributes(simpleBoxVisAtt);
|
||||
|
||||
/*
|
||||
// Below are vis attributes that permits someone to test / play
|
||||
// with the interactive expansion / contraction geometry system of the
|
||||
// vis/OpenInventor driver :
|
||||
{G4VisAttributes* simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,0.0));
|
||||
simpleBoxVisAtt->SetVisibility(true);
|
||||
delete logicCalor->GetVisAttributes();
|
||||
logicCalor->SetVisAttributes(simpleBoxVisAtt);}
|
||||
|
||||
{G4VisAttributes* atb= new G4VisAttributes(G4Colour(1.0,0.0,0.0));
|
||||
logicLayer->SetVisAttributes(atb);}
|
||||
|
||||
{G4VisAttributes* atb= new G4VisAttributes(G4Colour(0.0,1.0,0.0));
|
||||
atb->SetForceSolid(true);
|
||||
logicAbsorber->SetVisAttributes(atb);}
|
||||
|
||||
{//Set opacity = 0.2 then transparency = 1 - 0.2 = 0.8
|
||||
G4VisAttributes* atb= new G4VisAttributes(G4Colour(0.0,0.0,1.0,0.2));
|
||||
atb->SetForceSolid(true);
|
||||
logicGap->SetVisAttributes(atb);}
|
||||
*/
|
||||
|
||||
//
|
||||
//always return the physical World
|
||||
//
|
||||
return physiWorld;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03DetectorConstruction::PrintCalorParameters()
|
||||
{
|
||||
G4cout << "\n------------------------------------------------------------"
|
||||
<< "\n---> The calorimeter is " << NbOfLayers << " layers of: [ "
|
||||
<< AbsorberThickness/mm << "mm of " << AbsorberMaterial->GetName()
|
||||
<< " + "
|
||||
<< GapThickness/mm << "mm of " << GapMaterial->GetName() << " ] "
|
||||
<< "\n------------------------------------------------------------\n";
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
|
||||
{
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
|
||||
if (pttoMaterial) AbsorberMaterial = pttoMaterial;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03DetectorConstruction::SetGapMaterial(G4String materialChoice)
|
||||
{
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
|
||||
if (pttoMaterial) GapMaterial = pttoMaterial;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03DetectorConstruction::SetAbsorberThickness(G4double val)
|
||||
{
|
||||
// change Absorber thickness and recompute the calorimeter parameters
|
||||
AbsorberThickness = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03DetectorConstruction::SetGapThickness(G4double val)
|
||||
{
|
||||
// change Gap thickness and recompute the calorimeter parameters
|
||||
GapThickness = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03DetectorConstruction::SetCalorSizeYZ(G4double val)
|
||||
{
|
||||
// change the transverse size and recompute the calorimeter parameters
|
||||
CalorSizeYZ = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03DetectorConstruction::SetNbOfLayers(G4int val)
|
||||
{
|
||||
NbOfLayers = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
void ExN03DetectorConstruction::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 = 0;
|
||||
fieldMgr->SetDetectorField(magField);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
void ExN03DetectorConstruction::UpdateGeometry()
|
||||
{
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,150 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03DetectorMessenger.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03DetectorMessenger.hh"
|
||||
|
||||
#include "ExN03DetectorConstruction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03DetectorMessenger::ExN03DetectorMessenger(
|
||||
ExN03DetectorConstruction* ExN03Det)
|
||||
:ExN03Detector(ExN03Det)
|
||||
{
|
||||
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_PreInit,G4State_Idle);
|
||||
|
||||
GapMaterCmd = new G4UIcmdWithAString("/N03/det/setGapMat",this);
|
||||
GapMaterCmd->SetGuidance("Select Material of the Gap.");
|
||||
GapMaterCmd->SetParameterName("choice",false);
|
||||
GapMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
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_PreInit,G4State_Idle);
|
||||
|
||||
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_PreInit,G4State_Idle);
|
||||
|
||||
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_PreInit,G4State_Idle);
|
||||
|
||||
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_PreInit,G4State_Idle);
|
||||
|
||||
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("/N03/det/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_PreInit,G4State_Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03DetectorMessenger::~ExN03DetectorMessenger()
|
||||
{
|
||||
delete NbLayersCmd;
|
||||
delete AbsMaterCmd; delete GapMaterCmd;
|
||||
delete AbsThickCmd; delete GapThickCmd;
|
||||
delete SizeYZCmd; delete UpdateCmd;
|
||||
delete MagFieldCmd;
|
||||
delete detDir;
|
||||
delete N03Dir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if( command == AbsMaterCmd )
|
||||
{ ExN03Detector->SetAbsorberMaterial(newValue);}
|
||||
|
||||
if( command == GapMaterCmd )
|
||||
{ ExN03Detector->SetGapMaterial(newValue);}
|
||||
|
||||
if( command == AbsThickCmd )
|
||||
{ ExN03Detector->SetAbsorberThickness(AbsThickCmd
|
||||
->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == GapThickCmd )
|
||||
{ ExN03Detector->SetGapThickness(GapThickCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == SizeYZCmd )
|
||||
{ ExN03Detector->SetCalorSizeYZ(SizeYZCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == NbLayersCmd )
|
||||
{ ExN03Detector->SetNbOfLayers(NbLayersCmd->GetNewIntValue(newValue));}
|
||||
|
||||
if( command == UpdateCmd )
|
||||
{ ExN03Detector->UpdateGeometry(); }
|
||||
|
||||
if( command == MagFieldCmd )
|
||||
{ ExN03Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03EventAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03EventAction.hh"
|
||||
|
||||
#include "ExN03RunAction.hh"
|
||||
#include "ExN03EventActionMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4VTrajectory.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
#include "Randomize.hh"
|
||||
#include <iomanip>
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03EventAction::ExN03EventAction(ExN03RunAction* run)
|
||||
:runAct(run),printModulo(1),eventMessenger(0)
|
||||
{
|
||||
eventMessenger = new ExN03EventActionMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03EventAction::~ExN03EventAction()
|
||||
{
|
||||
delete eventMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%printModulo == 0) {
|
||||
G4cout << "\n---> Begin of event: " << evtNb << G4endl;
|
||||
CLHEP::HepRandom::showEngineStatus();
|
||||
}
|
||||
|
||||
// initialisation per event
|
||||
EnergyAbs = EnergyGap = 0.;
|
||||
TrackLAbs = TrackLGap = 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03EventAction::EndOfEventAction(const G4Event* evt)
|
||||
{
|
||||
//accumulates statistic
|
||||
//
|
||||
runAct->fillPerEvent(EnergyAbs, EnergyGap, TrackLAbs, TrackLGap);
|
||||
|
||||
//print per event (modulo n)
|
||||
//
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%printModulo == 0) {
|
||||
G4cout << "---> End of event: " << evtNb << G4endl;
|
||||
|
||||
G4cout
|
||||
<< " Absorber: total energy: " << std::setw(7)
|
||||
<< G4BestUnit(EnergyAbs,"Energy")
|
||||
<< " total track length: " << std::setw(7)
|
||||
<< G4BestUnit(TrackLAbs,"Length")
|
||||
<< G4endl
|
||||
<< " Gap: total energy: " << std::setw(7)
|
||||
<< G4BestUnit(EnergyGap,"Energy")
|
||||
<< " total track length: " << std::setw(7)
|
||||
<< G4BestUnit(TrackLGap,"Length")
|
||||
<< G4endl;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -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: ExN03EventActionMessenger.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03EventActionMessenger.hh"
|
||||
|
||||
#include "ExN03EventAction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03EventActionMessenger::ExN03EventActionMessenger(ExN03EventAction* EvAct)
|
||||
:eventAction(EvAct)
|
||||
{
|
||||
eventDir = new G4UIdirectory("/N03/event/");
|
||||
eventDir->SetGuidance("event control");
|
||||
|
||||
PrintCmd = new G4UIcmdWithAnInteger("/N03/event/printModulo",this);
|
||||
PrintCmd->SetGuidance("Print events modulo n");
|
||||
PrintCmd->SetParameterName("EventNb",false);
|
||||
PrintCmd->SetRange("EventNb>0");
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03EventActionMessenger::~ExN03EventActionMessenger()
|
||||
{
|
||||
delete PrintCmd;
|
||||
delete eventDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03EventActionMessenger::SetNewValue(
|
||||
G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if(command == PrintCmd)
|
||||
{eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,244 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03PhysicsList.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03PhysicsList.hh"
|
||||
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PhysicsList::ExN03PhysicsList(): G4VUserPhysicsList()
|
||||
{
|
||||
defaultCutValue = 1.0*mm;
|
||||
SetVerboseLevel(1);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PhysicsList::~ExN03PhysicsList()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PhysicsList::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 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()
|
||||
{
|
||||
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 ExN03PhysicsList::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);
|
||||
pmanager->AddDiscreteProcess(new G4ComptonScattering);
|
||||
pmanager->AddDiscreteProcess(new G4GammaConversion);
|
||||
|
||||
} 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);
|
||||
|
||||
} 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);
|
||||
|
||||
} 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);
|
||||
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4Decay.hh"
|
||||
|
||||
void ExN03PhysicsList::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 ExN03PhysicsList::SetCuts()
|
||||
{
|
||||
if (verboseLevel >0){
|
||||
G4cout << "ExN03PhysicsList::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(defaultCutValue, "gamma");
|
||||
SetCutValue(defaultCutValue, "e-");
|
||||
SetCutValue(defaultCutValue, "e+");
|
||||
|
||||
if (verboseLevel>0) DumpCutValuesTable();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03PrimaryGeneratorAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "ExN03DetectorConstruction.hh"
|
||||
#include "ExN03PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PrimaryGeneratorAction::ExN03PrimaryGeneratorAction(
|
||||
ExN03DetectorConstruction* ExN03DC)
|
||||
:ExN03Detector(ExN03DC),rndmFlag("off")
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
//create a messenger for this class
|
||||
gunMessenger = new ExN03PrimaryGeneratorMessenger(this);
|
||||
|
||||
// default particle kinematic
|
||||
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4String particleName;
|
||||
G4ParticleDefinition* particle
|
||||
= particleTable->FindParticle(particleName="e-");
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
|
||||
particleGun->SetParticleEnergy(50.*MeV);
|
||||
G4double position = -0.5*(ExN03Detector->GetWorldSizeX());
|
||||
particleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PrimaryGeneratorAction::~ExN03PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
delete gunMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
//this function is called at the begining of event
|
||||
//
|
||||
G4double x0 = -0.5*(ExN03Detector->GetWorldSizeX());
|
||||
G4double y0 = 0.*cm, z0 = 0.*cm;
|
||||
if (rndmFlag == "on")
|
||||
{y0 = (ExN03Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
|
||||
z0 = (ExN03Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
|
||||
}
|
||||
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
|
||||
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03PrimaryGeneratorMessenger.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "ExN03PrimaryGeneratorAction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PrimaryGeneratorMessenger::ExN03PrimaryGeneratorMessenger(
|
||||
ExN03PrimaryGeneratorAction* ExN03Gun)
|
||||
:ExN03Action(ExN03Gun)
|
||||
{
|
||||
gunDir = new G4UIdirectory("/N03/gun/");
|
||||
gunDir->SetGuidance("PrimaryGenerator control");
|
||||
|
||||
RndmCmd = new G4UIcmdWithAString("/N03/gun/rndm",this);
|
||||
RndmCmd->SetGuidance("Shoot randomly the incident particle.");
|
||||
RndmCmd->SetGuidance(" Choice : on(default), off");
|
||||
RndmCmd->SetParameterName("choice",true);
|
||||
RndmCmd->SetDefaultValue("on");
|
||||
RndmCmd->SetCandidates("on off");
|
||||
RndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PrimaryGeneratorMessenger::~ExN03PrimaryGeneratorMessenger()
|
||||
{
|
||||
delete RndmCmd;
|
||||
delete gunDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PrimaryGeneratorMessenger::SetNewValue(
|
||||
G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if( command == RndmCmd )
|
||||
{ ExN03Action->SetRndmFlag(newValue);}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03RunAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03RunAction.hh"
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03RunAction::ExN03RunAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03RunAction::~ExN03RunAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
|
||||
|
||||
//inform the runManager to save random number seed
|
||||
//G4RunManager::GetRunManager()->SetRandomNumberStore(true);
|
||||
|
||||
//initialize cumulative quantities
|
||||
//
|
||||
sumEAbs = sum2EAbs =sumEGap = sum2EGap = 0.;
|
||||
sumLAbs = sum2LAbs =sumLGap = sum2LGap = 0.;
|
||||
|
||||
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,
|
||||
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;
|
||||
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
||||
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......
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03SteppingAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03SteppingAction.hh"
|
||||
|
||||
#include "ExN03DetectorConstruction.hh"
|
||||
#include "ExN03EventAction.hh"
|
||||
|
||||
#include "G4Step.hh"
|
||||
|
||||
////#include "G4RunManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03SteppingAction::ExN03SteppingAction(ExN03DetectorConstruction* det,
|
||||
ExN03EventAction* evt)
|
||||
:detector(det), eventaction(evt)
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03SteppingAction::~ExN03SteppingAction()
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03SteppingAction::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);
|
||||
|
||||
//example of saving random number seed of this event, under condition
|
||||
//// if (condition) G4RunManager::GetRunManager()->rndmSaveThisEvent();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,182 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: ExN03SteppingVerbose.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03SteppingVerbose.hh"
|
||||
|
||||
#include "G4SteppingManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03SteppingVerbose::ExN03SteppingVerbose()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03SteppingVerbose::~ExN03SteppingVerbose()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03SteppingVerbose::StepInfo()
|
||||
{
|
||||
CopyState();
|
||||
|
||||
G4int prec = G4cout.precision(3);
|
||||
|
||||
if( verboseLevel >= 1 ){
|
||||
if( verboseLevel >= 4 ) VerboseTrack();
|
||||
if( verboseLevel >= 3 ){
|
||||
G4cout << G4endl;
|
||||
G4cout << std::setw( 5) << "#Step#" << " "
|
||||
<< std::setw( 6) << "X" << " "
|
||||
<< std::setw( 6) << "Y" << " "
|
||||
<< std::setw( 6) << "Z" << " "
|
||||
<< std::setw( 9) << "KineE" << " "
|
||||
<< std::setw( 9) << "dEStep" << " "
|
||||
<< std::setw(10) << "StepLeng"
|
||||
<< std::setw(10) << "TrakLeng"
|
||||
<< std::setw(10) << "Volume" << " "
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
}
|
||||
|
||||
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
||||
<< " ";
|
||||
|
||||
// if( fStepStatus != fWorldBoundary){
|
||||
if( fTrack->GetNextVolume() != 0 ) {
|
||||
G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
|
||||
} else {
|
||||
G4cout << std::setw(10) << "OutOfWorld";
|
||||
}
|
||||
|
||||
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){
|
||||
G4cout << " "
|
||||
<< std::setw(10)
|
||||
<< fStep->GetPostStepPoint()->GetProcessDefinedStep()
|
||||
->GetProcessName();
|
||||
} else {
|
||||
G4cout << " UserLimit";
|
||||
}
|
||||
|
||||
G4cout << G4endl;
|
||||
|
||||
if( verboseLevel == 2 ){
|
||||
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
|
||||
fN2ndariesAlongStepDoIt +
|
||||
fN2ndariesPostStepDoIt;
|
||||
if(tN2ndariesTot>0){
|
||||
G4cout << " :----- List of 2ndaries - "
|
||||
<< "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
|
||||
<< "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
|
||||
<< ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
|
||||
<< ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
|
||||
<< "), "
|
||||
<< "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
|
||||
<< " ---------------"
|
||||
<< G4endl;
|
||||
|
||||
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
|
||||
lp1<(*fSecondary).size(); lp1++){
|
||||
G4cout << " : "
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
|
||||
<< std::setw(10)
|
||||
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
G4cout << " :-----------------------------"
|
||||
<< "----------------------------------"
|
||||
<< "-- EndOf2ndaries Info ---------------"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03SteppingVerbose::TrackingStarted()
|
||||
{
|
||||
|
||||
CopyState();
|
||||
G4int prec = G4cout.precision(3);
|
||||
if( verboseLevel > 0 ){
|
||||
|
||||
G4cout << std::setw( 5) << "Step#" << " "
|
||||
<< std::setw( 6) << "X" << " "
|
||||
<< std::setw( 6) << "Y" << " "
|
||||
<< std::setw( 6) << "Z" << " "
|
||||
<< std::setw( 9) << "KineE" << " "
|
||||
<< std::setw( 9) << "dEStep" << " "
|
||||
<< std::setw(10) << "StepLeng"
|
||||
<< std::setw(10) << "TrakLeng"
|
||||
<< std::setw(10) << "Volume" << " "
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
|
||||
G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
||||
<< " ";
|
||||
|
||||
if(fTrack->GetNextVolume()){
|
||||
G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
|
||||
} else {
|
||||
G4cout << "OutOfWorld";
|
||||
}
|
||||
G4cout << " initStep" << G4endl;
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,696 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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;
|
||||
}
|
||||
Reference in New Issue
Block a user