28 G4LogicalVolumeStore* g4_logical_volume_store = G4LogicalVolumeStore::GetInstance();
29 G4PhysicalVolumeStore* g4_physical_volume_store = G4PhysicalVolumeStore::GetInstance();
30 G4RegionStore* g4_region_store = G4RegionStore::GetInstance();
41 std::istringstream in(
line);
46 unsigned int lvs=0,pvs=0,regs=0;
47 in >> lvs >> pvs >> regs;
48 if (lvs!=g4_logical_volume_store->size()){
49 G4ExceptionDescription ed;
50 ed <<
"ERROR! Reference had " << lvs <<
" and this setup has " << g4_logical_volume_store->size() <<
" logical volumes" << G4endl;
51 G4Exception(
"Geant4SetupChecker",
"LogVolMismatch",FatalException,ed);
54 if (pvs!=g4_physical_volume_store->size()){
55 G4ExceptionDescription ed;
56 ed <<
"ERROR! Reference had " << pvs <<
" and this setup has " << g4_physical_volume_store->size() <<
" physical volumes" << G4endl;
57 G4Exception(
"Geant4SetupChecker",
"PhysVolMismatch",FatalException,ed);
60 if (regs!=g4_region_store->size()){
61 G4ExceptionDescription ed;
62 ed <<
"ERROR! Reference had " << regs <<
" and this setup has " << g4_region_store->size() <<
" regions" << G4endl;
63 G4Exception(
"Geant4SetupChecker",
"RegionMismatch",FatalException,ed);
68 G4Region* areg = g4_region_store->GetRegion(
id);
70 G4ExceptionDescription ed;
71 ed <<
"ERROR! Reference had region named " <<
id <<
"that is not in this configuration, or has changed name" << G4endl;
72 G4Exception(
"Geant4SetupChecker",
"RegionNotFound",FatalException,ed);
75 unsigned int nmat=0, nfs=0;
77 if (nmat!=areg->GetNumberOfMaterials()){
78 G4ExceptionDescription ed;
79 ed <<
"ERROR! Region " <<
id <<
" had " << nmat <<
" materials in ref and " << areg->GetNumberOfMaterials() <<
" in this setup" << G4endl;
80 G4Exception(
"Geant4SetupChecker",
"MaterialMismatch",FatalException,ed);
83 if ( (!areg->GetFastSimulationManager() && nfs!=0) ||
84 ( areg->GetFastSimulationManager() && nfs!=areg->GetFastSimulationManager()->GetFastSimulationModelList().size()) ){
85 G4ExceptionDescription ed;
86 ed <<
"ERROR! Region " <<
id <<
" had " << nfs <<
" fast sims in ref and " << (areg->GetFastSimulationManager()?areg->GetFastSimulationManager()->GetFastSimulationModelList().size():0) <<
" in this setup" << G4endl;
87 G4Exception(
"Geant4SetupChecker",
"FastSimMismatch",FatalException,ed);
93 G4cout <<
"All ok!" << G4endl;
97 outfile <<
"Counts " << g4_logical_volume_store->size() <<
" " << g4_physical_volume_store->size() <<
" " << g4_region_store->size() << std::endl;
99 for (
auto* areg : *g4_region_store){
100 outfile << areg->GetName() <<
" " << areg->GetNumberOfMaterials() <<
" " << (areg->GetFastSimulationManager()?areg->GetFastSimulationManager()->GetFastSimulationModelList().size():0) << std::endl;