BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSMultilayerScreen.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSMULTILAYERSCREEN_H
19#define BDSMULTILAYERSCREEN_H
20
21#include <map>
22#include <vector>
23
24#include "globals.hh"
25#include "G4RotationMatrix.hh"
26#include "G4TwoVector.hh"
27#include "G4ThreeVector.hh"
28
29class G4LogicalVolume;
30class G4PVPlacement;
31class G4VSolid;
32
33class BDSColourWheel;
34class BDSScreenLayer;
35
43{
44public:
45 BDSMultilayerScreen(const G4TwoVector& xysizeIn,
46 const G4String& nameIn);
47 virtual ~BDSMultilayerScreen();
48
50 void AddScreenLayer(G4double thickness,
51 G4String material,
52 G4String name,
53 G4int isSampler = 0,
54 G4double grooveWidth = 0,
55 G4double grooveSpatialFrequency = 0);
57 void AddScreenLayer(BDSScreenLayer* layer, G4int isSampler=0);
58
60 inline const G4ThreeVector& GetSize() const {return size;}
62 inline BDSScreenLayer* ScreenLayer(G4int layer) {return screenLayers[layer];}
64 BDSScreenLayer* ScreenLayer(const G4String& layerName);
66 BDSScreenLayer* LastLayer() const {return screenLayers.back();}
68 inline G4int NLayers() const {return (G4int)screenLayers.size();}
69
71 inline void SetPhys(G4PVPlacement* physIn) {phys = physIn;}
72
74 void Build();
75
77 virtual void Place(G4RotationMatrix* rot,
78 const G4ThreeVector& pos,
79 G4LogicalVolume* motherVol);
80
82 void ReflectiveSurface(G4int layer1, G4int layer2);
84 void RoughSurface(G4int layer1, G4int layer2);
85
86private:
93 void ComputeDimensions();
94
96 void BuildMotherVolume();
97
99 void PlaceLayers();
100
101 G4TwoVector xysize;
102 G4String name;
103 G4ThreeVector size;
104
106 G4LogicalVolume* log;
107 G4PVPlacement* phys;
108 G4VSolid* solid;
110 std::vector<BDSScreenLayer*> screenLayers;
111 std::map<G4String, BDSScreenLayer*> screenLayerNames;
112 std::vector<G4double> screenLayerZPos;
113
117};
118
119#endif
Three colours that are supplied sequentially.
An accelerator component for diagnostics screens e.g. OTR. Screen inside beam pipe.
void AddScreenLayer(G4double thickness, G4String material, G4String name, G4int isSampler=0, G4double grooveWidth=0, G4double grooveSpatialFrequency=0)
Construct and add a screen layer.
const G4ThreeVector & GetSize() const
Full size of screen in x,y,z.
std::vector< BDSScreenLayer * > screenLayers
Main storage of all layers.
void RoughSurface(G4int layer1, G4int layer2)
Construct a rough surface between two layers.
BDSMultilayerScreen & operator=(const BDSMultilayerScreen &)=delete
Private default constructor to force use of provided one.
BDSMultilayerScreen(const BDSMultilayerScreen &)=delete
Private default constructor to force use of provided one.
void SetPhys(G4PVPlacement *physIn)
Set a physical placement to member variable.
BDSMultilayerScreen()=delete
Private default constructor to force use of provided one.
G4PVPlacement * phys
Geometrical objects:
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.
G4int NLayers() const
Size of the screen.
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.
BDSScreenLayer * LastLayer() const
Get the last layer of the screen.
void PlaceLayers()
Place each layer in order in the container volume.
An individual screen layer for a multilayer screen.