Import Geant4 10.5.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2018-06-29 10:58:11 +02:00
parent fe81a77428
commit 6aa23be517
1581 changed files with 124288 additions and 83758 deletions
+11 -2
View File
@@ -17,16 +17,25 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 8th, 2018 B. Morgan - B03-V10-04-01
- Include G4Types before use of G4MULTITHREADED. For forward
compatibility with move to #defines over -D for G4 preprocessor
symbols.
Feb 15th, 2018 A. Howard - B03-V10-04-00
- Removed parallel geometry setting directly from main - created a data-race
in MT mode. Now everything is handled with B03PhysicsList.cc
Mar 8th, 2017 A. Howard - B03-V10-03-01
- B03PhysicsList - removed obsolete unnececssary instantiation of
de-excitation sub-models
de-excitation sub-models
Mar 7th, 2017 A. Howard - B03-V10-03-00
- Removed unnecessary clear sampling from B03
October 14th, 2016 G.Folger - B03-V10-02-01
- remove direct use of theParticleIterator, use GetParticleTableIterator().
fix required by clang39 on Linux and MAC
fix required by clang39 on Linux and MAC
Jul 20th, 2016 I. Hrivnacova
- Coding guidelines (redundant empty lines)
+31 -25
View File
@@ -29,7 +29,7 @@
//
// $Id: exampleB03.cc 70528 2013-05-31 16:50:36Z gcosmo $
//
//
//
// --------------------------------------------------------------
// GEANT 4 - exampleB03
//
@@ -39,23 +39,25 @@
// This example intends to show how to use both importance sampling and a
// customized scoring making use of the scoring framework
// in a parallel geometry.
//
//
// A simple geometry consisting of a 180 cm high concrete cylinder
// is constructed in the mass geometry.
// A geometry is constructed in the parallel geometry
// in order to assign importance values to slabs
// of width 10cm and for scoring. The parallel world volume should
// overlap the mass world volume and the radii of the slabs is larger
// of width 10cm and for scoring. The parallel world volume should
// overlap the mass world volume and the radii of the slabs is larger
// than the radius of the concrete cylinder in the mass geometry.
// Pairs of G4GeometryCell and importance values are stored in
// the importance store.
// The scoring uses the primitive scorers via the Multi Functional Detector
//
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include <iostream>
#include "G4Types.hh"
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
#else
@@ -78,13 +80,13 @@
// Files specific for biasing and scoring
//#include "G4Scorer.hh"
#include "G4GeometrySampler.hh"
// #include "G4GeometrySampler.hh"
#include "G4IStore.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int , char **)
{
{
G4int numberOfEvents = 100;
G4long myseed = 345354;
@@ -108,16 +110,20 @@ int main(int , char **)
// create a parallel detector
G4String parallelName("ParallelBiasingWorld");
B03ImportanceDetectorConstruction *pdet =
B03ImportanceDetectorConstruction *pdet =
new B03ImportanceDetectorConstruction(parallelName);
detector->RegisterParallelWorld(pdet);
G4GeometrySampler pgs(pdet->GetWorldVolume(),"neutron");
B03PhysicsList* physlist = new B03PhysicsList;
physlist->AddParallelWorldName(parallelName);
// G4GeometrySampler pgs(pdet->GetWorldVolume(),"neutron");
// B03PhysicsList* physlist = new B03PhysicsList;
// name of first parallel world:
B03PhysicsList* physlist = new B03PhysicsList(parallelName);
// push parallel world to store in case of multiple worlds:
physlist->AddParallelWorldName(parallelName);
// physlist->AddParallelWorldName(parallelName);
//physlist->AddParallelWorldName(sparallelName);
physlist->AddBiasing(&pgs,parallelName);
// physlist->AddBiasing(&pgs,parallelName);
runManager->SetUserInitialization(physlist);
// Set user action classes through Worker Initialization
@@ -134,7 +140,7 @@ int main(int , char **)
G4VPhysicalVolume& aghostWorld = pdet->GetWorldVolumeAddress();
G4cout << " ghost world: " << pdet->GetName() << G4endl;
// create an importance
// create an importance
G4IStore *aIstore = G4IStore::GetInstance(pdet->GetName());
// create a geometry cell for the world volume replpicanumber is 0!
@@ -142,12 +148,12 @@ int main(int , char **)
// set world volume importance to 1
aIstore->AddImportanceGeometryCell(1, gWorldVolumeCell);
// set importance values and create scorers
// set importance values and create scorers
G4int cell(1);
for (cell=1; cell<=18; cell++) {
G4GeometryCell gCell = pdet->GetGeometryCell(cell);
G4cout << " adding cell: " << cell
<< " replica: " << gCell.GetReplicaNumber()
G4cout << " adding cell: " << cell
<< " replica: " << gCell.GetReplicaNumber()
<< " name: " << gCell.GetPhysicalVolume().GetName() << G4endl;
G4double imp = std::pow(2.0,cell-1);
//x aIstore.AddImportanceGeometryCell(imp, gCell);
@@ -158,18 +164,18 @@ int main(int , char **)
// G4GeometryCell gCell = pdet->GetGeometryCell(18);
// create importance geometry cell pair for the "rest"cell
// with the same importance as the last concrete cell
// with the same importance as the last concrete cell
G4GeometryCell gCell = pdet->GetGeometryCell(19);
// G4double imp = std::pow(2.0,18);
G4double imp = std::pow(2.0,17);
// G4double imp = std::pow(2.0,18);
G4double imp = std::pow(2.0,17);
aIstore->AddImportanceGeometryCell(imp, gCell.GetPhysicalVolume(), 19);
//temporary fix before runManager->BeamOn works...
G4UImanager* UImanager = G4UImanager::GetUIpointer();
G4UImanager* UImanager = G4UImanager::GetUIpointer();
G4String command1 = "/control/cout/setCoutFile fileName";
UImanager->ApplyCommand(command1);
G4String command2 = "/run/beamOn "
G4String command2 = "/run/beamOn "
+ G4UIcommand::ConvertToString(numberOfEvents);;
UImanager->ApplyCommand(command2);
@@ -178,7 +184,7 @@ int main(int , char **)
// pgs.ClearSampling();
delete runManager;
return 0;
}
+26 -26
View File
@@ -4,7 +4,7 @@
############################################
**************************************************************
Geant4 version Name: geant4-10-04-patch-02 (25-May-2018)
Geant4 version Name: geant4-10-05-beta-01 (29-June-2018)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
@@ -19,8 +19,8 @@
G4IStore:: Creating new Parallel IStore ParallelBiasingWorld
G4IStore:: ParallelWorldName = ParallelBiasingWorld
G4IStore:: fParallelWorldVolume = ParallelBiasingWorld
G4GeometrySampler:: preparing importance sampling WorldName is
G4ImportanceConfigurator:: setting world name:
G4GeometrySampler:: preparing importance sampling WorldName is ParallelBiasingWorld
G4ImportanceConfigurator:: setting world name: ParallelBiasingWorld
G4ImportanceConfigurator:: entering importance configure, paraflag 1
@@ -93,8 +93,8 @@ B03PhysicsList::SetCuts:CutLength : 1 (mm)
conv: for gamma SubType= 14 BuildTable= 1
Lambda table from 1.022 MeV to 100 TeV, 18 bins per decade, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
BetheHeitler : Emin= 0 eV Emax= 80 GeV
BetheHeitlerLPM : Emin= 80 GeV Emax= 100 TeV
BetheHeitler : Emin= 0 eV Emax= 80 GeV AngularGenUrban
BetheHeitlerLPM : Emin= 80 GeV Emax= 100 TeV AngularGenUrban
compt: for gamma SubType= 13 BuildTable= 1
Lambda table from 100 eV to 1 MeV, 7 bins per decade, spline: 1
@@ -525,7 +525,7 @@ Max 2J for sampling of angular correlations 10
*** G4Exception : GeomBias1001
issued by : G4ImportanceAlgorithm::Warning()
Calculate() - ipre_over_ipost ! in [0.25, 4].
ipre_over_ipost = 8192.
ipre_over_ipost = 131072.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
@@ -545,24 +545,24 @@ ipre_over_ipost = 8192.
=============================================================
=============================================================
Volume | Tr.Entering | Population | Collisions | Coll*WGT | NumWGTedE | FluxWGTedE | Av.Tr.WGT | SL | SLW | SLW_v | SLWE | SLWE_v |
cell_00 | 31 | 129 | 0 | 0 | 0.534326 | 1.74782 | 1 | 5791.85 | 5791.85 | 929.432 | 10123.1 | 496.62 |
cell_01 | 138 | 187 | 471 | 471 | 0.686917 | 4.52128 | 1 | 23183 | 23183 | 4361.23 | 104817 | 2995.8 |
cell_02 | 196 | 301 | 1392 | 696 | 0.255351 | 2.68603 | 0.5 | 47904.1 | 23952.1 | 8131.59 | 64335.8 | 2076.41 |
cell_03 | 265 | 406 | 2240 | 560 | 0.150434 | 1.82021 | 0.25 | 70671.1 | 17667.8 | 7685.8 | 32159 | 1156.2 |
cell_04 | 277 | 441 | 2358 | 294.75 | 0.140877 | 1.6999 | 0.125 | 72856.8 | 9107.1 | 4062.42 | 15481.1 | 572.301 |
cell_05 | 257 | 435 | 2246 | 140.375 | 0.151716 | 1.73836 | 0.0625 | 71376.2 | 4461.01 | 1878.8 | 7754.83 | 285.043 |
cell_06 | 267 | 422 | 2402 | 75.0625 | 0.110526 | 1.45753 | 0.03125 | 72153.6 | 2254.8 | 1138.59 | 3286.45 | 125.843 |
cell_07 | 250 | 400 | 2162 | 33.7812 | 0.141267 | 1.59481 | 0.015625 | 69304.8 | 1082.89 | 473.851 | 1727 | 66.9392 |
cell_08 | 231 | 366 | 1811 | 14.1484 | 0.167754 | 1.82952 | 0.0078125 | 60050.9 | 469.148 | 190.276 | 858.314 | 31.9196 |
cell_09 | 247 | 398 | 2104 | 8.21875 | 0.174693 | 1.59253 | 0.00390625 | 67841.3 | 265.005 | 97.5597 | 422.029 | 17.043 |
cell_10 | 256 | 423 | 2313 | 4.51758 | 0.144169 | 1.64423 | 0.00195312 | 71735 | 140.107 | 61.2612 | 230.368 | 8.83195 |
cell_11 | 274 | 396 | 2383 | 2.32715 | 0.121508 | 1.61002 | 0.000976562 | 72474.1 | 70.7755 | 34.8874 | 113.95 | 4.23911 |
cell_12 | 274 | 445 | 2446 | 1.19434 | 0.114649 | 1.40995 | 0.000488281 | 74472.8 | 36.3637 | 17.5739 | 51.2708 | 2.01483 |
cell_13 | 268 | 415 | 2281 | 0.556885 | 0.131622 | 1.56155 | 0.000244141 | 70517.2 | 17.2161 | 7.99014 | 26.8838 | 1.05168 |
cell_14 | 268 | 406 | 2523 | 0.307983 | 0.112905 | 1.27507 | 0.00012207 | 79221.7 | 9.67062 | 4.66185 | 12.3307 | 0.526345 |
cell_15 | 253 | 402 | 2295 | 0.140076 | 0.112027 | 1.27071 | 6.10352e-05 | 71983.2 | 4.39351 | 2.14411 | 5.58287 | 0.240198 |
cell_16 | 217 | 339 | 2095 | 0.0639343 | 0.0932734 | 1.03489 | 3.05176e-05 | 61939.2 | 1.89024 | 0.967455 | 1.95619 | 0.0902378 |
cell_17 | 214 | 318 | 1910 | 0.0291443 | 0.102657 | 1.0284 | 1.52588e-05 | 55898.8 | 0.852949 | 0.405486 | 0.87717 | 0.0416258 |
cell_18 | 126 | 247 | 1407 | 0.0107346 | 0.10947 | 1.10822 | 7.62939e-06 | 42660 | 0.32547 | 0.150884 | 0.360692 | 0.0165173 |
cell_19 | 78 | 78 | 0 | 0 | 0.25497 | 2.0042 | 7.62939e-06 | 11723.7 | 0.0894449 | 0.0266877 | 0.179266 | 0.00680455 |
cell_00 | 32 | 127 | 0 | 0 | 0.593306 | 1.95909 | 1 | 6279.53 | 6279.53 | 881.972 | 12302.2 | 523.279 |
cell_01 | 154 | 181 | 524 | 524 | 0.547197 | 4.12749 | 1 | 23011.1 | 23011.1 | 4939.89 | 94977.8 | 2703.1 |
cell_02 | 187 | 286 | 1170 | 585 | 0.313165 | 3.07217 | 0.5 | 41939.7 | 20969.9 | 6296.47 | 64423.1 | 1971.84 |
cell_03 | 260 | 437 | 2075 | 518.75 | 0.24692 | 2.46756 | 0.25 | 70514.2 | 17628.6 | 5856.17 | 43499.4 | 1446 |
cell_04 | 325 | 519 | 2633 | 329.125 | 0.181556 | 2.01538 | 0.125 | 91166.2 | 11395.8 | 4492.49 | 22966.8 | 815.638 |
cell_05 | 355 | 565 | 3175 | 198.438 | 0.144475 | 1.73798 | 0.0625 | 102685 | 6417.8 | 2863.85 | 11154 | 413.756 |
cell_06 | 420 | 606 | 3394 | 106.062 | 0.147559 | 1.66185 | 0.03125 | 105987 | 3312.1 | 1408.32 | 5504.21 | 207.811 |
cell_07 | 424 | 667 | 4041 | 63.1406 | 0.133434 | 1.50288 | 0.015625 | 125790 | 1965.47 | 864.069 | 2953.86 | 115.296 |
cell_08 | 368 | 590 | 3231 | 25.2422 | 0.116068 | 1.4137 | 0.0078125 | 99015.7 | 773.56 | 375.037 | 1093.58 | 43.5299 |
cell_09 | 319 | 512 | 3039 | 11.8711 | 0.102887 | 1.27181 | 0.00390625 | 89430.7 | 349.339 | 177.162 | 444.291 | 18.2278 |
cell_10 | 293 | 462 | 2617 | 5.11133 | 0.115569 | 1.43395 | 0.00195312 | 78429.6 | 153.183 | 74.8065 | 219.656 | 8.6453 |
cell_11 | 278 | 437 | 2407 | 2.35059 | 0.138263 | 1.52835 | 0.000976562 | 74562.6 | 72.815 | 32.2267 | 111.287 | 4.45576 |
cell_12 | 290 | 415 | 2410 | 1.17676 | 0.110652 | 1.23252 | 0.000488281 | 73158 | 35.7217 | 17.2477 | 44.0276 | 1.9085 |
cell_13 | 294 | 414 | 2360 | 0.576172 | 0.106277 | 1.14182 | 0.000244141 | 70384 | 17.1836 | 8.23382 | 19.6206 | 0.875063 |
cell_14 | 254 | 386 | 2372 | 0.289551 | 0.0990127 | 1.23349 | 0.00012207 | 70702.3 | 8.63065 | 4.5553 | 10.6458 | 0.451033 |
cell_15 | 223 | 315 | 2036 | 0.124268 | 0.106262 | 1.10229 | 6.10352e-05 | 63270 | 3.8617 | 1.83807 | 4.25672 | 0.195318 |
cell_16 | 204 | 297 | 1902 | 0.0580444 | 0.121743 | 1.24257 | 3.05176e-05 | 55708.3 | 1.70008 | 0.756269 | 2.11248 | 0.0920704 |
cell_17 | 170 | 266 | 1544 | 0.0235596 | 0.124343 | 1.30729 | 1.52588e-05 | 46864.7 | 0.715099 | 0.3242 | 0.934843 | 0.040312 |
cell_18 | 104 | 208 | 1047 | 0.00798798 | 0.135573 | 1.47168 | 7.62939e-06 | 33237.9 | 0.253585 | 0.115103 | 0.373196 | 0.0156048 |
cell_19 | 60 | 60 | 0 | 0 | 0.373423 | 2.41136 | 7.62939e-06 | 9768.85 | 0.0745304 | 0.0183939 | 0.17972 | 0.00686869 |
=============================================
@@ -41,15 +41,15 @@
class B03PhysicsList: public G4VUserPhysicsList
{
public:
B03PhysicsList();
B03PhysicsList(G4String);
virtual ~B03PhysicsList();
public:
void AddParallelWorldName(G4String& pname)
{fParaWorldName.push_back(pname);}
void AddBiasing(G4GeometrySampler *mgs, G4String& pname)
{fGeomSampler = mgs; fBiasWorldName = pname;}
// void AddBiasing(G4GeometrySampler *mgs, G4String& pname)
// {fGeomSampler = mgs; fBiasWorldName = pname;}
protected:
// Construct particle and physics
@@ -79,8 +79,8 @@ class B03PhysicsList: public G4VUserPhysicsList
private:
std::vector<G4String> fParaWorldName;
G4String fBiasWorldName;
G4GeometrySampler* fGeomSampler;
G4String fBiasWorldName;
// G4GeometrySampler* fGeomSampler;
};
@@ -53,7 +53,9 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B03PhysicsList::B03PhysicsList(): G4VUserPhysicsList()
B03PhysicsList::B03PhysicsList(G4String parallelname):
G4VUserPhysicsList(),
fBiasWorldName(parallelname)
{
fParaWorldName.clear();
SetVerboseLevel(1);
@@ -661,25 +663,26 @@ void B03PhysicsList::AddScoringProcess(){
#include "G4IStore.hh"
void B03PhysicsList::AddBiasingProcess(){
G4cout << " Preparing Importance Sampling with GhostWorld "
<< fBiasWorldName << G4endl;
fGeomSampler->SetParallel(true); // parallelworld
G4IStore* iStore = G4IStore::GetInstance(fBiasWorldName);
fGeomSampler->SetWorld(iStore->GetParallelWorldVolumePointer());
G4GeometrySampler fGeomSampler(fBiasWorldName,"neutron");
fGeomSampler.SetParallel(true); // parallelworld
// fGeomSampler.SetWorld(iStore->GetParallelWorldVolumePointer());
// fGeomSampler->PrepareImportanceSampling(G4IStore::
// GetInstance(fBiasWorldName), 0);
static G4bool first = true;
if(first) {
fGeomSampler->PrepareImportanceSampling(iStore, 0);
fGeomSampler.PrepareImportanceSampling(iStore, 0);
fGeomSampler->Configure();
fGeomSampler.Configure();
G4cout << " GeomSampler Configured!!! " << G4endl;
first = false;
}
#ifdef G4MULTITHREADED
fGeomSampler->AddProcess();
if(!G4Threading::IsMasterThread()) fGeomSampler.AddProcess();
#else
G4cout << " Running in singlethreaded mode!!! " << G4endl;
#endif