19#include "BDSColourWheel.hh"
21#include "BDSException.hh"
22#include "BDSGlobalConstants.hh"
23#include "BDSMaterials.hh"
24#include "BDSMultilayerScreen.hh"
25#include "BDSSamplerRegistry.hh"
26#include "BDSScreenLayer.hh"
29#include "G4VisAttributes.hh"
30#include "G4LogicalBorderSurface.hh"
31#include "G4LogicalVolume.hh"
32#include "G4OpticalSurface.hh"
33#include "G4PVPlacement.hh"
35#include "G4Version.hh"
38 const G4String& nameIn):
46 size.setX(xysize.x());
47 size.setY(xysize.y());
51BDSMultilayerScreen::~BDSMultilayerScreen()
63 G4double grooveSpatialFrequency)
69 G4String tempString =
"Sampler_" + std::to_string(nThisSampler);
70 layerName = tempString +
"_" + nameIn;
75 G4ThreeVector layerSize(
xysize.x(),
xysize.y(), thickness);
77 grooveWidth,grooveSpatialFrequency);
95 {
throw BDSException(__METHOD_NAME__,
"screen layer \"" + layerName +
"\" not found");}
97 {
return result->second;}
108 const G4ThreeVector& pos,
109 G4LogicalVolume* motherVol)
124 G4OpticalSurface* OpSurface=
new G4OpticalSurface(
"OpSurface");
126 new G4LogicalBorderSurface(
"LogSurface",
131 OpSurface->SetType(dielectric_metal);
132 OpSurface->SetModel(unified);
133 OpSurface->SetFinish(polished);
135 G4MaterialPropertiesTable* SMPT =
new G4MaterialPropertiesTable();
136#if G4VERSION_NUMBER > 1109
137 SMPT->AddConstProperty(
"REFLECTIVITY",0.8,
true);
139 SMPT->AddConstProperty(
"REFLECTIVITY",0.8);
151 OpSurface->SetMaterialPropertiesTable(SMPT);
156 G4OpticalSurface* OpSurface=
new G4OpticalSurface(
"OpSurface");
157 OpSurface->SetType(dielectric_dielectric);
158 OpSurface->SetFinish(ground);
159 OpSurface->SetModel(unified);
162 new G4LogicalBorderSurface(
"LogSurface",
167 G4double sigma_alpha=0.7;
168 OpSurface->SetSigmaAlpha(sigma_alpha);
169 G4MaterialPropertiesTable* SMPT =
new G4MaterialPropertiesTable();
170#if G4VERSION_NUMBER > 1109
171 SMPT->AddConstProperty(
"REFLECTIVITY",0.0,
true);
173 SMPT->AddConstProperty(
"REFLECTIVITY",0.0);
175 OpSurface->SetMaterialPropertiesTable(SMPT);
181 {
throw BDSException(__METHOD_NAME__,
"Screen \"" +
name +
"\" has no layers.");}
186 {temp += layer->GetSize().z();}
205 solid =
new G4Box((
name+
"_solid").c_str(),
206 size.x()/2.0 + lengthSafety,
207 size.y()/2.0 + lengthSafety,
208 size.z()/2.0 + lengthSafety);
213 (
name+
"_log").c_str());
215 G4VisAttributes* visAtt =
new G4VisAttributes(G4Colour(0.0,0.0,1.0,0.3));
216 visAtt->SetForceWireframe(
true);
217 log->SetVisAttributes(visAtt);
222 G4ThreeVector pos(0,0,0);
228 G4cout << __METHOD_NAME__ <<
": placing screen layer with ID: "
Three colours that are supplied sequentially.
void Spin()
Iterate colour choice from RGB.
G4Colour Colour()
Return current colour.
General exception with possible name of object and message.
static BDSGlobalConstants * Instance()
Access method.
static BDSMaterials * Instance()
Singleton pattern access.
G4Material * GetMaterial(G4String material) const
Get material by name.
void AddScreenLayer(G4double thickness, G4String material, G4String name, G4int isSampler=0, G4double grooveWidth=0, G4double grooveSpatialFrequency=0)
Construct and add a screen layer.
std::vector< BDSScreenLayer * > screenLayers
Main storage of all layers.
void RoughSurface(G4int layer1, G4int layer2)
Construct a rough surface between two layers.
void SetPhys(G4PVPlacement *physIn)
Set a physical placement to member variable.
BDSMultilayerScreen()=delete
Private default constructor to force use of provided one.
G4ThreeVector size
Extent.
G4VSolid * solid
Geometrical objects:
void BuildMotherVolume()
Build a container volume.
std::map< G4String, BDSScreenLayer * > screenLayerNames
Map of names for looking up.
std::vector< G4double > screenLayerZPos
Cache of calculated z locations for layers.
virtual void Place(G4RotationMatrix *rot, const G4ThreeVector &pos, G4LogicalVolume *motherVol)
Place the member logical volume 'log' with a given transform in a given mother volume.
BDSScreenLayer * ScreenLayer(G4int layer)
Get a particular screen layer by index.
BDSColourWheel * colourWheel
void Build()
Construct container, compute dimensions then place layers.
G4LogicalVolume * log
Geometrical objects:
G4TwoVector xysize
X,Y size of multilayer screen.
void ReflectiveSurface(G4int layer1, G4int layer2)
Construct a reflective surface between two layers.
G4String name
Name of multilayer screen.
void PlaceLayers()
Place each layer in order in the container volume.
static BDSSamplerRegistry * Instance()
Accessor for registry.
G4int NumberOfExistingSamplers() const
Get number of registered samplers.
An individual screen layer for a multilayer screen.
void AssignSampler()
Make this plane a sampling plane.
G4String GetName() const
Accessor.