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) 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 BDSCOLLIMATOR_H
19#define BDSCOLLIMATOR_H
20
21#include "BDSAcceleratorComponent.hh"
22
23#include "globals.hh" // geant4 types / globals
24
25class G4Colour;
26class G4Material;
27class G4UserLimits;
28class G4VSolid;
29
37{
38public:
39 BDSCollimator() = delete;
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);
56 virtual ~BDSCollimator();
57
59 virtual G4String Material() const;
60 virtual G4double XApertureIn() const {return xAperture;}
61 virtual G4double XApertureOut() const {return xApertureOut;}
62 virtual G4double YApertureIn() const {return yAperture;}
63 virtual G4double YApertureOut() const {return yApertureOut;}
65
66 virtual void SetMinimumKineticEnergy(G4double minimimumKineticEnergyIn) {minKineticEnergy = minimimumKineticEnergyIn;}
67
68protected:
71 virtual void CheckParameters();
72
73 virtual void Build();
74
75 virtual void BuildContainerLogicalVolume();
76
80 virtual void BuildInnerCollimator() = 0;
81
83 G4UserLimits* CollimatorUserLimits();
84
86 G4VSolid* collimatorSolid;
87 G4VSolid* innerSolid;
88 G4VSolid* vacuumSolid;
90 G4double horizontalWidth;
91 G4Material* collimatorMaterial;
92 G4Material* vacuumMaterial;
93 G4double xAperture;
94 G4double yAperture;
95 G4double xApertureOut;
96 G4double yApertureOut;
97 G4bool tapered;
98 G4Colour* colour;
102};
103
104#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.
G4bool collimatorTypeSensitivity
Whether to use special collimator hits or not.
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.
G4Material * collimatorMaterial
Material.
G4VSolid * collimatorSolid
Geometrical objects:
G4Colour * colour
Colour of collimator.