make scene able to run parallel simulations

This commit is contained in:
AndreaRigoni
2026-03-19 21:51:38 +00:00
parent 85e1f1448f
commit c44a7738c0
12 changed files with 247 additions and 24 deletions

View File

@@ -61,6 +61,12 @@ void EmitterPrimary::GeneratePrimaries(G4Event *anEvent) {
fParticleGun->GeneratePrimaryVertex(anEvent);
}
EmitterPrimary* EmitterPrimary::Clone() const {
auto* clone = new EmitterPrimary();
clone->SetMatrix(this->GetMatrix());
return clone;
}
// -------------------------------------------------------------------------- //
// SkyPlaneEmitterPrimary using EcoMug
@@ -127,6 +133,13 @@ void SkyPlaneEmitterPrimary::GeneratePrimaries(G4Event* anEvent) {
fParticleGun->GeneratePrimaryVertex(anEvent);
}
EmitterPrimary* SkyPlaneEmitterPrimary::Clone() const {
auto* clone = new SkyPlaneEmitterPrimary();
clone->SetSkySize(this->m_Size);
clone->SetMatrix(this->GetMatrix());
return clone;
}
// -------------------------------------------------------------------------- //
// CylinderEmitterPrimary using EcoMug
@@ -188,6 +201,14 @@ void CylinderEmitterPrimary::GeneratePrimaries(G4Event* anEvent) {
fParticleGun->GeneratePrimaryVertex(anEvent);
}
EmitterPrimary* CylinderEmitterPrimary::Clone() const {
auto* clone = new CylinderEmitterPrimary();
clone->SetRadius(this->m_Radius);
clone->SetHeight(this->m_Height);
clone->SetMatrix(this->GetMatrix());
return clone;
}
// -------------------------------------------------------------------------- //
@@ -298,6 +319,12 @@ void QuadMeshEmitterPrimary::GeneratePrimaries(G4Event *anEvent) {
fParticleGun->GeneratePrimaryVertex(anEvent);
}
}
EmitterPrimary* QuadMeshEmitterPrimary::Clone() const {
auto* clone = new QuadMeshEmitterPrimary();
if (m_Mesh) clone->SetMesh(m_Mesh);
clone->SetMatrix(this->GetMatrix());
return clone;
}
} // namespace Geant
} // namespace uLib