Project

General

Profile

Test38 demonstrator » History » Version 4

Robert Hatcher, 11/11/2015 04:22 PM

1 1 Robert Hatcher
h1. test38 demonstrator
2 1 Robert Hatcher
3 2 Robert Hatcher
h2. Purpose
4 2 Robert Hatcher
5 2 Robert Hatcher
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.
6 2 Robert Hatcher
7 2 Robert Hatcher
In addition the program is designed to exercise some of the new features, especially the ability to extend the list of known lists.
8 2 Robert Hatcher
9 2 Robert Hatcher
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.
10 2 Robert Hatcher
11 4 Robert Hatcher
h2. Running the Program
12 4 Robert Hatcher
13 4 Robert Hatcher
The code can be 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*.*@.
14 2 Robert Hatcher
15 1 Robert Hatcher
<pre>
16 1 Robert Hatcher
$ BuildProducts/bin/g4plfactory_test38  -h
17 1 Robert Hatcher
BuildProducts/bin/g4plfactory_test38:  G4PLFactoryTest - a simplified Geant4 app for testing 
18 1 Robert Hatcher
the G4PhysListFactory
19 1 Robert Hatcher
   BuildProducts/bin/g4plfactory_test38 [options] [physList1 physList2[=N]]
20 1 Robert Hatcher
  -h --help       this output
21 1 Robert Hatcher
  -f              print phylist factory status
22 1 Robert Hatcher
  -F              print old phylist factory availability
23 1 Robert Hatcher
  -c              print physics ctor list
24 1 Robert Hatcher
  -r              print physics list registry list
25 1 Robert Hatcher
                    repeat to print before adding 2nd library
26 1 Robert Hatcher
  -v --verbose    increase program verbosity
27 1 Robert Hatcher
  -V <n>          set factory verbosity
28 1 Robert Hatcher
  -D --defaults   add default tests even if user supplied tests
29 1 Robert Hatcher
  -o --old        test old factory
30 1 Robert Hatcher
  -e --env=PNAME  PhysicsList to use as env variable [QGSP_BERT]
31 1 Robert Hatcher
                       use "skip" to skip these 2 tests
32 1 Robert Hatcher
     --lend       try ShieldingLEND (needs special data) in default list
33 1 Robert Hatcher
     --xyzzy      try to add non-existent physics ctor in default list
34 1 Robert Hatcher
                   (will though throw G4Exception w/ --fatal)
35 1 Robert Hatcher
     --fatal      throw exception if new factory can't satisfy request
36 1 Robert Hatcher
 
37 1 Robert Hatcher
  If given, the list of physics lists to try override the default set.
38 1 Robert Hatcher
  User can specify if they expect each to work with the 
39 1 Robert Hatcher
    new (1), old (2), both (3) or neither (0) factory;
40 1 Robert Hatcher
    if unspecified, assumes 3.
41 1 Robert Hatcher
</pre>
42 1 Robert Hatcher
43 1 Robert Hatcher
<pre>
44 1 Robert Hatcher
$ BuildProducts/bin/g4plfactory_test38  -f -F
45 1 Robert Hatcher
46 1 Robert Hatcher
*************************************************************
47 1 Robert Hatcher
 Geant4 version Name: geant4-10-01-ref-10    (31-October-2015)
48 1 Robert Hatcher
                      Copyright : Geant4 Collaboration
49 1 Robert Hatcher
                      Reference : NIM A 506 (2003), 250-303
50 1 Robert Hatcher
                            WWW : http://cern.ch/geant4
51 1 Robert Hatcher
*************************************************************
52 1 Robert Hatcher
53 1 Robert Hatcher
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54 1 Robert Hatcher
BuildProducts/bin/g4plfactory_test38: state of the _old_ factory:-
55 1 Robert Hatcher
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 1 Robert Hatcher
57 1 Robert Hatcher
old factory base physlists:
58 1 Robert Hatcher
  [ 0] = FTFP_BERT
59 1 Robert Hatcher
  [ 1] = FTFP_BERT_TRV
60 1 Robert Hatcher
  [ 2] = FTFP_BERT_HP
61 1 Robert Hatcher
  [ 3] = FTFP_INCLXX
62 1 Robert Hatcher
  [ 4] = FTFP_INCLXX_HP
63 1 Robert Hatcher
  [ 5] = FTF_BIC
64 1 Robert Hatcher
  [ 6] = LBE
65 1 Robert Hatcher
  [ 7] = QBBC
66 1 Robert Hatcher
  [ 8] = QGSP_BERT
67 1 Robert Hatcher
  [ 9] = QGSP_BERT_HP
68 1 Robert Hatcher
  [10] = QGSP_BIC
69 1 Robert Hatcher
  [11] = QGSP_BIC_HP
70 1 Robert Hatcher
  [12] = QGSP_BIC_AllHP
71 1 Robert Hatcher
  [13] = QGSP_FTFP_BERT
72 1 Robert Hatcher
  [14] = QGSP_INCLXX
73 1 Robert Hatcher
  [15] = QGSP_INCLXX_HP
74 1 Robert Hatcher
  [16] = QGS_BIC
75 1 Robert Hatcher
  [17] = Shielding
76 1 Robert Hatcher
  [18] = ShieldingLEND
77 1 Robert Hatcher
  [19] = ShieldingM
78 1 Robert Hatcher
  [20] = NuBeam
79 1 Robert Hatcher
old factory EM extensions:
80 1 Robert Hatcher
  [ 0] = 
81 1 Robert Hatcher
  [ 1] = _EMV
82 1 Robert Hatcher
  [ 2] = _EMX
83 1 Robert Hatcher
  [ 3] = _EMY
84 1 Robert Hatcher
  [ 4] = _EMZ
85 1 Robert Hatcher
  [ 5] = _LIV
86 1 Robert Hatcher
  [ 6] = _PEN
87 1 Robert Hatcher
  [ 7] = __GS
88 1 Robert Hatcher
89 1 Robert Hatcher
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
90 1 Robert Hatcher
91 1 Robert Hatcher
BuildProducts/bin/g4plfactory_test38: (before) phys ctors 60, phys lists 24, ext 8, em 8
92 1 Robert Hatcher
BuildProducts/bin/g4plfactory_test38: try to dynamically load 'libg4plft2'
93 1 Robert Hatcher
BuildProducts/bin/g4plfactory_test38: successfully loaded 'libg4plft2'
94 1 Robert Hatcher
BuildProducts/bin/g4plfactory_test38: now add extensions mappings ALTDK, NEWPHY and XYZZY 
95 1 Robert Hatcher
BuildProducts/bin/g4plfactory_test38: (after)  phys ctors 62, phys lists 26, ext 11, em 11
96 1 Robert Hatcher
97 1 Robert Hatcher
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
98 1 Robert Hatcher
BuildProducts/bin/g4plfactory_test38: state of the new factory:-
99 1 Robert Hatcher
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
100 1 Robert Hatcher
101 1 Robert Hatcher
Base G4VModularPhysicsLists in G4PhysListRegistry are:
102 1 Robert Hatcher
 [  0]  "FTFP_BERT"
103 1 Robert Hatcher
 [  1]  "FTFP_BERT_HP"
104 1 Robert Hatcher
 [  2]  "FTFP_BERT_TRV"
105 1 Robert Hatcher
 [  3]  "FTFP_INCLXX"
106 1 Robert Hatcher
 [  4]  "FTFP_INCLXX_HP"
107 1 Robert Hatcher
 [  5]  "FTF_BIC"
108 1 Robert Hatcher
 [  6]  "G4GenericPhysicsList"
109 1 Robert Hatcher
 [  7]  "LBE"
110 1 Robert Hatcher
 [  8]  "MyPL0"
111 1 Robert Hatcher
 [  9]  "MyPL1"
112 1 Robert Hatcher
 [ 10]  "MyPL2"
113 1 Robert Hatcher
 [ 11]  "NuBeam"
114 1 Robert Hatcher
 [ 12]  "QBBC"
115 1 Robert Hatcher
 [ 13]  "QGSP_BERT"
116 1 Robert Hatcher
 [ 14]  "QGSP_BERT_HP"
117 1 Robert Hatcher
 [ 15]  "QGSP_BIC"
118 1 Robert Hatcher
 [ 16]  "QGSP_BIC_AllHP"
119 1 Robert Hatcher
 [ 17]  "QGSP_BIC_HP"
120 1 Robert Hatcher
 [ 18]  "QGSP_FTFP_BERT"
121 1 Robert Hatcher
 [ 19]  "QGSP_INCLXX"
122 1 Robert Hatcher
 [ 20]  "QGSP_INCLXX_HP"
123 1 Robert Hatcher
 [ 21]  "QGS_BIC"
124 1 Robert Hatcher
 [ 22]  "Shielding"
125 1 Robert Hatcher
 [ 23]  "ShieldingLEND"
126 1 Robert Hatcher
 [ 24]  "ShieldingM"
127 1 Robert Hatcher
 [ 25]  "myns::MyNSPL3"
128 1 Robert Hatcher
Replacement mappings in G4PhysListRegistry are:
129 1 Robert Hatcher
         ALTDK =>              G4NewDecayPhysics 
130 1 Robert Hatcher
           EMV =>    G4EmStandardPhysics_option1 
131 1 Robert Hatcher
           EMX =>    G4EmStandardPhysics_option2 
132 1 Robert Hatcher
           EMY =>    G4EmStandardPhysics_option3 
133 1 Robert Hatcher
           EMZ =>    G4EmStandardPhysics_option4 
134 1 Robert Hatcher
            GS =>          G4EmStandardPhysicsGS 
135 1 Robert Hatcher
           LIV =>           G4EmLivermorePhysics 
136 1 Robert Hatcher
        NEWPHY =>       myns::G4NewExoticPhysics 
137 1 Robert Hatcher
           PEN =>            G4EmPenelopePhysics 
138 1 Robert Hatcher
         XYZZY =>                  NoSuchPhysics [unregistered physics]
139 1 Robert Hatcher
           _GS =>          G4EmStandardPhysicsGS 
140 1 Robert Hatcher
Use these mapping to extend physics list; append with _EXT or +EXT
141 1 Robert Hatcher
   to use ReplacePhysics() ("_") or RegisterPhysics() ("+").
142 1 Robert Hatcher
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
143 1 Robert Hatcher
144 1 Robert Hatcher
</pre>
145 3 Robert Hatcher
146 3 Robert Hatcher
h3. Of note
147 3 Robert Hatcher
148 3 Robert Hatcher
<pre>
149 3 Robert Hatcher
 [  8]  "MyPL0"
150 3 Robert Hatcher
 [  9]  "MyPL1"
151 3 Robert Hatcher
 [ 10]  "MyPL2"
152 3 Robert Hatcher
153 3 Robert Hatcher
 [ 25]  "myns::MyNSPL3"
154 3 Robert Hatcher
155 3 Robert Hatcher
         ALTDK =>              G4NewDecayPhysics 
156 3 Robert Hatcher
        NEWPHY =>       myns::G4NewExoticPhysics
157 3 Robert Hatcher
         XYZZY =>                  NoSuchPhysics [unregistered physics] 
158 3 Robert Hatcher
159 3 Robert Hatcher
Use these mapping to extend physics list; append with _EXT or +EXT
160 3 Robert Hatcher
   to use ReplacePhysics() ("_") or RegisterPhysics() ("+").
161 3 Robert Hatcher
</pre>
162 3 Robert Hatcher
163 3 Robert Hatcher
| @MyPL0@ | this list was compiled in and registered by the main program |
164 3 Robert Hatcher
| @MyPL1@ | this list was supplied via @libg4plft1@ linked to exectutable |
165 3 Robert Hatcher
| @MyPL2@ | this list was supplied via @libg4plft2@ dynamically loaded at run time |
166 3 Robert Hatcher
| @myns::MyNSPL3@ | demonstrates the ability to use namespaces |
167 3 Robert Hatcher
168 3 Robert Hatcher
| @ALTDK@  | using @AnyPhysList+ALTDK@ would register the @G4NewDecayPhysics@ physics ctor with the @AnyPhysList@ physics list |
169 3 Robert Hatcher
| @NEWPHY@ | demonstrates use of namespaces with physics ctors |
170 3 Robert Hatcher
| @XYZZY@  | show the result of an attempt to map an extension to an unregistered physics ctor |