seems to work with different geometries
This commit is contained in:
@@ -53,9 +53,15 @@
|
||||
#include "G4PVParameterised.hh"
|
||||
#include "G4VPVParameterisation.hh"
|
||||
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
|
||||
|
||||
namespace B4
|
||||
{
|
||||
|
||||
DetectorConstruction* DetectorConstruction::_global_detector_construction=nullptr;
|
||||
//helper
|
||||
|
||||
class LayerParametrisation: public G4VPVParameterisation{
|
||||
@@ -129,6 +135,13 @@ nistManager->FindOrBuildMaterial("G4_AIR");
|
||||
|
||||
G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
|
||||
{
|
||||
|
||||
|
||||
G4GeometryManager::GetInstance()->OpenGeometry();
|
||||
G4PhysicalVolumeStore::GetInstance()->Clean();
|
||||
G4LogicalVolumeStore::GetInstance()->Clean();
|
||||
G4SolidStore::GetInstance()->Clean();
|
||||
|
||||
// Geometry parameters
|
||||
auto & cwLayers = cw->getLayers();
|
||||
G4int nofLayers = cwLayers.size();
|
||||
@@ -201,6 +214,8 @@ G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
|
||||
layer.name = "Layer_"+std::to_string(layerNumber);
|
||||
layerNumber++;
|
||||
|
||||
G4cout << "building layer " << layer.name << G4endl;
|
||||
|
||||
position += layer.thickness / 2 *cm;
|
||||
auto layerS
|
||||
= new G4Box(layer.name, // its name
|
||||
|
||||
Reference in New Issue
Block a user