geant events for multiple scattering
This commit is contained in:
@@ -62,16 +62,18 @@ Solid::Solid(const char *name)
|
||||
|
||||
void Solid::SetNistMaterial(const char *name) {
|
||||
G4NistManager *nist = G4NistManager::Instance();
|
||||
m_Material = nist->FindOrBuildMaterial(name);
|
||||
if (m_Logical)
|
||||
m_Logical->SetMaterial(m_Material);
|
||||
G4Material *mat = nist->FindOrBuildMaterial(name);
|
||||
if (mat) SetMaterial(mat);
|
||||
}
|
||||
|
||||
void Solid::SetMaterial(G4Material *material) {
|
||||
if (material) {
|
||||
m_Material = material;
|
||||
if (m_Logical)
|
||||
if (m_Logical) {
|
||||
m_Logical->SetMaterial(material);
|
||||
} else if (GetG4Solid()) {
|
||||
m_Logical = new G4LogicalVolume(GetG4Solid(), m_Material, GetName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +151,9 @@ void TessellatedSolid::SetMesh(TriangleMesh &mesh) {
|
||||
DetectorsSolidImpl::getG4Vector3f(mesh.Points().at(trg(2))), ABSOLUTE);
|
||||
ts->AddFacet((G4VFacet *)facet);
|
||||
}
|
||||
this->m_Logical->SetSolid(ts);
|
||||
if (this->m_Logical) {
|
||||
this->m_Logical->SetSolid(ts);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +164,9 @@ BoxSolid::BoxSolid(const char *name, ContainerBox *box) : BaseClass(name) {
|
||||
m_Solid = new G4Box(name, 0.5, 0.5, 0.5);
|
||||
m_Object = box;
|
||||
Object::connect(box, &ContainerBox::Updated, this, &BoxSolid::Update);
|
||||
this->m_Logical->SetSolid(m_Solid);
|
||||
if (m_Logical) {
|
||||
m_Logical->SetSolid(m_Solid);
|
||||
}
|
||||
}
|
||||
|
||||
void BoxSolid::Update() {
|
||||
|
||||
Reference in New Issue
Block a user