I want to build some compound material,such as Polystyrene and POP materials. I using the AddElement method to build it like the exampleB3a. But when I collecting data,I find a strange peak.
G4Element* elC = new G4Element("Carbon", "C", 6., 12.0107 * g / mole);
G4Element* elH = new G4Element("Hydrogen", "H", 1., 1.0079 * g / mole);
G4Element* elO = new G4Element("Oxygen", "O", 8., 15.9994 * g / mole);
G4Material* ppoMaterial = new G4Material("PPO", 1.08 * g / cm3, 3);
ppoMaterial->AddElement(elC, 30);
ppoMaterial->AddElement(elH, 22);
ppoMaterial->AddElement(elO, 4);
// 定义 POPOP 荧光剂材料
elC = new G4Element("Carbon", "C", 6., 12.0107 * g / mole);
elH = new G4Element("Hydrogen", "H", 1., 1.0079 * g / mole);
elO = new G4Element("Oxygen", "O", 8., 15.9994 * g / mole);
G4Element* elN = new G4Element("Nitrogen", "N", 7., 28. * g / mole);
G4Material* popopMaterial = new G4Material("POPOP", 1.08 * g / cm3, 4);
popopMaterial->AddElement(elC, 24);
popopMaterial->AddElement(elH, 16);
popopMaterial->AddElement(elO, 2);
popopMaterial->AddElement(elN, 2);
// 创建组合材料,将 PPO,POPOP 荧光剂掺杂到 PS 中
G4double psFraction = 98.485 * perCent; // PS 占比
G4double ppoFraction = 1.5 * perCent; // PPO 占比
G4double popopFraction = 0.015 * perCent; // POPOP 占比
psWithPPOandPOPOP = new G4Material("PS_with_PPOandPOPOP", 1.06 * g / cm3, 3);
psWithPPOandPOPOP->AddMaterial(psMaterial, psFraction);
psWithPPOandPOPOP->AddMaterial(ppoMaterial, ppoFraction);
psWithPPOandPOPOP->AddMaterial(popopMaterial, popopFraction);`
It doesn’t match the image I measured. I think it can`t appear two peaks.
Then I change to the method of elements.pushback.And I change the mixture of three compound to the Ps material. And I get an idea result.
elements.push_back("C"); natoms.push_back(8);
elements.push_back("H"); natoms.push_back(8);
density = 1.050*g/cm3;
psWithPPOandPOPOP = fNistMan->
ConstructNewMaterial("Polystyrene1", elements, natoms, density);
elements.clear();
natoms.clear();
To judge the reason of the peak, I conduct some experiments then.
// // 定义基础材料
// G4Material* psMaterial = fNistMan->FindOrBuildMaterial("G4_POLYSTYRENE");
// // 定义 PS材料
density = 1.05* g/cm3;
elC = new G4Element("Carbon ", "C", 6., 12.01070 * g / mole);
G4Element* elH = new G4Element("Hydrogen ", "H", 1., 1.0079 * g / mole);
G4Material* psMaterial = new G4Material(name="Ps", density, ncomponents=2);
psMaterial->AddElement(elC, natom=8);
psMaterial->AddElement(elH, natom=8);
// 定义 PPO 荧光剂材料
density = 1.08* g/cm3;
G4Element* elO = new G4Element("Oxygen", "O", 8., 15.9994 * g / mole);
G4Material* ppoMaterial = new G4Material(name="PPO", density, ncomponents=2);
ppoMaterial->AddElement(elC, natom=30);
ppoMaterial->AddElement(elH, natom=22);
// ppoMaterial->AddElement(elO, natom=4);
// 定义 POPOP 荧光剂材料
G4Element* elN = new G4Element("Nitrogen", "N", 7., 28. * g / mole);
G4Material* popopMaterial = new G4Material("POPOP", 1.08 * g / cm3, 2);
popopMaterial->AddElement(elC, 24);
popopMaterial->AddElement(elH, 16);
//popopMaterial->AddElement(elO, 2);
// popopMaterial->AddElement(elN, 2);
// 创建组合材料,将 PPO,POPOP 荧光剂掺杂到 PS 中
G4double psFraction = 98.485 * perCent; // PS 占比
G4double ppoFraction = 1.5 * perCent; // PPO 占比
G4double popopFraction = 0.015 * perCent; // POPOP 占比
density = 1.06 *g/cm3;
G4Material* psWithPPOandPOPOP = new G4Material(name="PS_with_PPOandPOPOP", density, ncomponents=3);
psWithPPOandPOPOP->AddMaterial(psMaterial, psFraction);
psWithPPOandPOPOP->AddMaterial(ppoMaterial, ppoFraction);
psWithPPOandPOPOP->AddMaterial(popopMaterial, popopFraction);
//====================================================================
// elements.push_back("C"); natoms.push_back(8);
// elements.push_back("H"); natoms.push_back(8);
To avoid the N and O effect. And the result is
Another method:
G4bool isotopes=false;
G4Element* elC = fNistMan->FindOrBuildElement("C" , isotopes);
G4Element* elH = fNistMan->FindOrBuildElement("H", isotopes);
G4Element* elO = fNistMan->FindOrBuildElement("O", isotopes);
G4Element* elN = fNistMan->FindOrBuildElement("N", isotopes);
density = 1.05* g/cm3;
// elC = new G4Element("Carbon ", "C", 6., 12.01070 * g / mole);
// G4Element* elH = new G4Element("Hydrogen ", "H", 1., 1.0079 * g / mole);
psMaterial = new G4Material(name="Ps", 1.05* g/cm3, ncomponents=2);
if(psMaterial==nullptr){
G4cout<<"chengyu_error"<<G4endl;
}
psMaterial->AddElement(elH, 8);
psMaterial->AddElement(elC, 8);
if(psMaterial->GetElement(0)!=nullptr){
G4cout<<psMaterial->GetElement(0)->GetName()<<G4endl;
G4cout<<psMaterial->GetElement(1)->GetName()<<G4endl;
}
As a master’s student, I really need this simulation to get a reasonable result, and I hope you can help me. Because I need to use a mixture composed of three compounds as the main body of the simulation, if I can’t solve this problem, can you provide other methods to achieve this goal? I’m only using addmaterial for now. Looking forward to your reply.
_Geant4 Version:_11.2.1
_Operating System:_ubuntu
Compiler/Version:
CMake Version: