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