Project

General

Profile

Test38 demonstrator » History » Version 7

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