BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSCollimator.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSCOLLIMATOR_H
20#define BDSCOLLIMATOR_H
21
22#include "BDSAcceleratorComponent.hh"
23
24#include "globals.hh" // geant4 types / globals
25
26class G4Colour;
27class G4Material;
28class G4UserLimits;
29class G4VSolid;
30
38{
39public:
40 BDSCollimator(const G4String& name,
41 G4double length,
42 G4double horizontalWidth,
43 const G4String& type,
44 G4Material* collimatorMaterial,
45 G4Material* vacuumMaterial,
46 G4double xApertureIn = 0,
47 G4double yApertureIn = 0,
48 G4double xApertureOutIn = 0,
49 G4double yApertureOutIn = 0,
50 G4Colour* colourIn = nullptr,
51 G4bool circularOuterIn = false);
52 virtual ~BDSCollimator();
53
55 virtual G4String Material() const;
56 virtual G4double XApertureIn() const {return xAperture;}
57 virtual G4double XApertureOut() const {return xApertureOut;}
58 virtual G4double YApertureIn() const {return yAperture;}
59 virtual G4double YApertureOut() const {return yApertureOut;}
61
62 virtual void SetMinimumKineticEnergy(G4double minimimumKineticEnergyIn) {minKineticEnergy = minimimumKineticEnergyIn;}
63
64protected:
67 virtual void CheckParameters();
68
69 virtual void Build();
70
71 virtual void BuildContainerLogicalVolume();
72
76 virtual void BuildInnerCollimator() = 0;
77
79 G4UserLimits* CollimatorUserLimits();
80
82 G4VSolid* collimatorSolid;
83 G4VSolid* innerSolid;
84 G4VSolid* vacuumSolid;
86 G4double horizontalWidth;
87 G4Material* collimatorMaterial;
88 G4Material* vacuumMaterial;
89 G4double xAperture;
90 G4double yAperture;
91 G4double xApertureOut;
92 G4double yApertureOut;
93 G4bool tapered;
94 G4Colour* colour;
97private:
99 BDSCollimator() = delete;
100
105};
106
107#endif
Abstract class that represents a component of an accelerator.
const G4String name
Const protected member variable that may not be changed by derived classes.
const G4String type
Const protected member variable that may not be changed by derived classes.
Base class for collimators with common construction.
G4bool circularOuter
Aperture type of the collimator.
G4double minKineticEnergy
Optional minimum kinetic energy for collimator materials.
virtual G4double XApertureOut() const
Accessor.
G4double xAperture
Aperture at entrance in x dimension.
virtual G4double XApertureIn() const
Accessor.
G4UserLimits * CollimatorUserLimits()
Return either default user limits or custom ones based on optional minimumKineticEnergy.
G4bool tapered
Flag for tapered collimator.
virtual void BuildInnerCollimator()=0
G4double yApertureOut
Aperture at exit in y dimension.
G4VSolid * innerSolid
Geometrical objects:
virtual void CheckParameters()
G4double xApertureOut
Aperture at exit in x dimension.
virtual G4double YApertureIn() const
Accessor.
virtual G4String Material() const
Accessor.
G4Material * vacuumMaterial
Vacuum material.
G4double horizontalWidth
Horizontal width.
G4VSolid * vacuumSolid
Geometrical objects:
G4double yAperture
Aperture at entrance in y dimension.
virtual void BuildContainerLogicalVolume()
virtual void Build()
BDSCollimator(BDSCollimator &)=delete
Assignment and copy constructor not implemented nor used.
virtual G4double YApertureOut() const
Accessor.
virtual void SetMinimumKineticEnergy(G4double minimimumKineticEnergyIn)
BDSCollimator & operator=(const BDSCollimator &)=delete
Assignment and copy constructor not implemented nor used.
BDSCollimator()=delete
Private default constructor to force the use of the supplied one.
G4Material * collimatorMaterial
Material.
G4VSolid * collimatorSolid
Geometrical objects:
G4Colour * colour
Colour of collimator.