BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSDegrader.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 BDSDEGRADER_H
20#define BDSDEGRADER_H
21
22#include "globals.hh"
23#include "BDSAcceleratorComponent.hh"
24
25class G4Colour;
26class G4Material;
27
35{
36public:
37 BDSDegrader(const G4String& nameIn,
38 G4double lengthIn,
39 G4double horizontalWidthIn,
40 G4int numberWedgesIn,
41 G4double wedgeLengthIn,
42 G4double degraderHeightIn,
43 G4double degraderOffsetIn,
44 G4double baseWidthIn,
45 G4Material* degraderMaterialIn,
46 G4Material* vacuumMaterialIn,
47 G4Colour* colourIn);
48 virtual ~BDSDegrader();
49
50protected:
51 virtual void Build();
52
53 virtual void BuildContainerLogicalVolume();
54
55 G4double horizontalWidth;
56 G4int numberWedges;
57 G4double wedgeLength;
58 G4double degraderHeight;
59 G4double degraderOffset;
60 G4double baseWidth;
61 G4Material* degraderMaterial;
62 G4Material* vacuumMaterial;
63 G4Colour* colour;
64
65 inline G4bool IsOdd(G4int integer) const {return integer % 2 != 0;}
66 inline G4bool IsEven(G4int integer)const {return integer % 2 == 0;}
67
68private:
70 BDSDegrader() = delete;
71
76
79 void PlaceWedge(G4bool placeRight,
80 G4double zOffset,
81 const G4String& placementName,
82 G4LogicalVolume* lv,
83 G4RotationMatrix* rotation);
84};
85
86#endif
Abstract class that represents a component of an accelerator.
Degrader based on wedge design used in the PSI medical accelerator.
Definition: BDSDegrader.hh:35
void PlaceWedge(G4bool placeRight, G4double zOffset, const G4String &placementName, G4LogicalVolume *lv, G4RotationMatrix *rotation)
Definition: BDSDegrader.cc:210
BDSDegrader & operator=(const BDSDegrader &)=delete
Assignment and copy constructor not implemented nor used.
virtual void Build()
Definition: BDSDegrader.cc:106
BDSDegrader(BDSDegrader &)=delete
Assignment and copy constructor not implemented nor used.
BDSDegrader()=delete
Private default constructor to force the use of the supplied one.
virtual void BuildContainerLogicalVolume()
Definition: BDSDegrader.cc:66