diff --git a/NPSimulation/Core/MaterialManager.cc b/NPSimulation/Core/MaterialManager.cc index cb9e2933807bc7907dd4bd378f419ab27cbc6be3..3f682d5cdd5dcc4a22af1d1242e605c22877e933 100644 --- a/NPSimulation/Core/MaterialManager.cc +++ b/NPSimulation/Core/MaterialManager.cc @@ -941,10 +941,7 @@ G4Material* MaterialManager::GetMaterialFromLibrary(string Name, = {35. * cm, 35. * cm, 35. * cm, 35. * cm, 35. * cm, 35. * cm, 35. * cm, 35. * cm, 35. * cm, 35. * cm, 35. * cm, 35. * cm, 35. * cm, 35. * cm, 35. * cm}; - /*G4double THICK_ABSL[NUMENTRIES] = - {0.01*mm,0.01*mm,0.01*mm,0.01*mm,0.01*mm,0.01*mm,0.01*mm,0.01*mm, - 0.01*mm,0.01*mm,0.01*mm,0.01*mm,0.01*mm,0.01*mm,0.01*mm};*/ - + G4MaterialPropertiesTable* myMPT2 = new G4MaterialPropertiesTable(); myMPT2->AddProperty("RINDEX", PMMA_PP, PMMA_RIND, NUMENTRIES); myMPT2->AddProperty("ABSLENGTH", PMMA_PP, PMMA_ABSL, NUMENTRIES); @@ -1003,11 +1000,18 @@ G4Material* MaterialManager::GetMaterialFromLibrary(string Name, } else { - G4cout << "ERROR: Material requested \"" << Name - << "\" is not available in the Material Library, trying with NIST" - << G4endl; + cout << "INFO: trying to get " << Name << " material from NIST" << endl; G4NistManager* man = G4NistManager::Instance(); - return man->FindOrBuildMaterial(Name.c_str()); + G4Material* material = man->FindOrBuildMaterial(Name.c_str()); + m_Material[Name] = material; + material->SetName("NPS_"+material->GetName()); + if(!material){ + cout << "ERROR: Material requested \"" << Name + << "\" is not available in the nptool material library or NIST" + << endl; + exit(1); + } + return material; } } @@ -1138,16 +1142,6 @@ G4Material* MaterialManager::GetGasFromLibrary(string Name, double Pressure, dou return material; } - /* if(Name == "mixMINOS"){ */ - /* density = (2*2.0140/Vm)*mg/cm3; */ - /* G4Material* material = new G4Material("NPS_"+newName,density,1,kStateGas,Temperature,Pressure); */ - /* material->AddElement(GetElementFromLibrary("D"), 2); */ - /* //material->AddElement(GetElementFromLibrary("D"), 1); */ - /* m_Material[newName]=material; */ - /* return material; */ - /* } */ - - else{ exit(1); } @@ -1307,7 +1301,7 @@ void MaterialManager::WriteCrossSectionTable(std::set<string> Particle, G4double //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void MaterialManager::CreateSampleVolumes(G4LogicalVolume* world_log) { - // Crate a micrometer big cube for each material + // Create a micrometer size cube for each material G4double SampleSize = 1 * um; G4double WorldSize = 10.0 * m; G4Box* sample_box