Project

General

Profile

Test38 demonstrator » History » Version 4

Version 3 (Robert Hatcher, 11/11/2015 10:23 AM) → Version 4/7 (Robert Hatcher, 11/11/2015 04:22 PM)

h1. test38 demonstrator

h2. Purpose

As the new factory was designed to be a fully compatible drop-in replacement for the old factory the basic test is to see that it performs identically in all the currently supported cases. This program tests that, and compares the two, when run with the @-o@ flag.

In addition the program is designed to exercise some of the new features, especially the ability to extend the list of known lists.

To that end, it (on UNIX systems) tries three cases beyond the pre-defined lists. In one case, @MyPL0@, it incorporates the new physics list into the executable itself. For @MyPL1@ the list's code resides in an external library @g4plft1@ (G4 PhysList Factory Test 1) that is linked to the executable at build time. In the final case @MyPL2@ is in the external library @g4plft2@ that is dynamically loaded at run time after the executable @g4plfactory_test38@ starts.

h2. Running the Program

The code can be
When built "Standalone" (in source) or as part of @ctest@. In the later case the executable currently ends up in @BuildProducts/bin/g4plfactory_test38@ under the build area and libraries in @BuildProducts/lib*/libg4plf*.*@. ctest

<pre>
$ BuildProducts/bin/g4plfactory_test38 -h
BuildProducts/bin/g4plfactory_test38: G4PLFactoryTest - a simplified Geant4 app for testing
the G4PhysListFactory
BuildProducts/bin/g4plfactory_test38 [options] [physList1 physList2[=N]]
-h --help this output
-f print phylist factory status
-F print old phylist factory availability
-c print physics ctor list
-r print physics list registry list
repeat to print before adding 2nd library
-v --verbose increase program verbosity
-V <n> set factory verbosity
-D --defaults add default tests even if user supplied tests
-o --old test old factory
-e --env=PNAME PhysicsList to use as env variable [QGSP_BERT]
use "skip" to skip these 2 tests
--lend try ShieldingLEND (needs special data) in default list
--xyzzy try to add non-existent physics ctor in default list
(will though throw G4Exception w/ --fatal)
--fatal throw exception if new factory can't satisfy request

If given, the list of physics lists to try override the default set.
User can specify if they expect each to work with the
new (1), old (2), both (3) or neither (0) factory;
if unspecified, assumes 3.
</pre>

<pre>
$ BuildProducts/bin/g4plfactory_test38 -f -F

*************************************************************
Geant4 version Name: geant4-10-01-ref-10 (31-October-2015)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
*************************************************************

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BuildProducts/bin/g4plfactory_test38: state of the _old_ factory:-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

old factory base physlists:
[ 0] = FTFP_BERT
[ 1] = FTFP_BERT_TRV
[ 2] = FTFP_BERT_HP
[ 3] = FTFP_INCLXX
[ 4] = FTFP_INCLXX_HP
[ 5] = FTF_BIC
[ 6] = LBE
[ 7] = QBBC
[ 8] = QGSP_BERT
[ 9] = QGSP_BERT_HP
[10] = QGSP_BIC
[11] = QGSP_BIC_HP
[12] = QGSP_BIC_AllHP
[13] = QGSP_FTFP_BERT
[14] = QGSP_INCLXX
[15] = QGSP_INCLXX_HP
[16] = QGS_BIC
[17] = Shielding
[18] = ShieldingLEND
[19] = ShieldingM
[20] = NuBeam
old factory EM extensions:
[ 0] =
[ 1] = _EMV
[ 2] = _EMX
[ 3] = _EMY
[ 4] = _EMZ
[ 5] = _LIV
[ 6] = _PEN
[ 7] = __GS

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

BuildProducts/bin/g4plfactory_test38: (before) phys ctors 60, phys lists 24, ext 8, em 8
BuildProducts/bin/g4plfactory_test38: try to dynamically load 'libg4plft2'
BuildProducts/bin/g4plfactory_test38: successfully loaded 'libg4plft2'
BuildProducts/bin/g4plfactory_test38: now add extensions mappings ALTDK, NEWPHY and XYZZY
BuildProducts/bin/g4plfactory_test38: (after) phys ctors 62, phys lists 26, ext 11, em 11

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BuildProducts/bin/g4plfactory_test38: state of the new factory:-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Base G4VModularPhysicsLists in G4PhysListRegistry are:
[ 0] "FTFP_BERT"
[ 1] "FTFP_BERT_HP"
[ 2] "FTFP_BERT_TRV"
[ 3] "FTFP_INCLXX"
[ 4] "FTFP_INCLXX_HP"
[ 5] "FTF_BIC"
[ 6] "G4GenericPhysicsList"
[ 7] "LBE"
[ 8] "MyPL0"
[ 9] "MyPL1"
[ 10] "MyPL2"
[ 11] "NuBeam"
[ 12] "QBBC"
[ 13] "QGSP_BERT"
[ 14] "QGSP_BERT_HP"
[ 15] "QGSP_BIC"
[ 16] "QGSP_BIC_AllHP"
[ 17] "QGSP_BIC_HP"
[ 18] "QGSP_FTFP_BERT"
[ 19] "QGSP_INCLXX"
[ 20] "QGSP_INCLXX_HP"
[ 21] "QGS_BIC"
[ 22] "Shielding"
[ 23] "ShieldingLEND"
[ 24] "ShieldingM"
[ 25] "myns::MyNSPL3"
Replacement mappings in G4PhysListRegistry are:
ALTDK => G4NewDecayPhysics
EMV => G4EmStandardPhysics_option1
EMX => G4EmStandardPhysics_option2
EMY => G4EmStandardPhysics_option3
EMZ => G4EmStandardPhysics_option4
GS => G4EmStandardPhysicsGS
LIV => G4EmLivermorePhysics
NEWPHY => myns::G4NewExoticPhysics
PEN => G4EmPenelopePhysics
XYZZY => NoSuchPhysics [unregistered physics]
_GS => G4EmStandardPhysicsGS
Use these mapping to extend physics list; append with _EXT or +EXT
to use ReplacePhysics() ("_") or RegisterPhysics() ("+").
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

</pre>

h3. Of note

<pre>
[ 8] "MyPL0"
[ 9] "MyPL1"
[ 10] "MyPL2"

[ 25] "myns::MyNSPL3"

ALTDK => G4NewDecayPhysics
NEWPHY => myns::G4NewExoticPhysics
XYZZY => NoSuchPhysics [unregistered physics]

Use these mapping to extend physics list; append with _EXT or +EXT
to use ReplacePhysics() ("_") or RegisterPhysics() ("+").
</pre>

| @MyPL0@ | this list was compiled in and registered by the main program |
| @MyPL1@ | this list was supplied via @libg4plft1@ linked to exectutable |
| @MyPL2@ | this list was supplied via @libg4plft2@ dynamically loaded at run time |
| @myns::MyNSPL3@ | demonstrates the ability to use namespaces |

| @ALTDK@ | using @AnyPhysList+ALTDK@ would register the @G4NewDecayPhysics@ physics ctor with the @AnyPhysList@ physics list |
| @NEWPHY@ | demonstrates use of namespaces with physics ctors |
| @XYZZY@ | show the result of an attempt to map an extension to an unregistered physics ctor |