BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSCavityFactoryBase.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2024.
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 BDSCAVITYFACTORYBASE_H
20#define BDSCAVITYFACTORYBASE_H
21
22#include "BDSFactoryBase.hh"
23#include "BDSSDType.hh"
24
25#include "globals.hh"
26#include "G4String.hh"
27#include "G4RotationMatrix.hh"
28
29#include <map>
30#include <set>
31
32class BDSCavity;
33class BDSCavityInfo;
34class BDSExtent;
35
36class G4LogicalVolume;
37class G4Material;
38class G4UserLimits;
39class G4VisAttributes;
40class G4VPhysicalVolume;
41class G4VSolid;
42
50{
51public:
52 virtual ~BDSCavityFactoryBase(){;}
53
56 BDSCavity* CreateCavity(const G4String& name,
57 G4double totalChordLength,
58 const BDSCavityInfo* info,
59 G4Material* vacuumMaterial);
60
61protected:
63
65 virtual void CleanUp();
66
68 void CleanUpBase();
69
71 virtual G4double CreateSolids(const G4String& name,
72 G4double totalChordLength,
73 const BDSCavityInfo* info) = 0;
74
76 virtual void CreateLogicalVolumes(const G4String& name,
77 const BDSCavityInfo* info,
78 G4Material* vacuumMaterial);
79
82 virtual void SetUserLimits(G4double length);
83
85 virtual void SetVisAttributes(const G4String& colourName = "rfcavity");
86
88 virtual void PlaceComponents(const G4String& name);
89
92
93 std::map<G4LogicalVolume*, BDSSDType> sensitiveVolumes;
94
96 G4VSolid* vacuumSolid;
97 G4VSolid* cavitySolid;
98 G4VSolid* containerSolid;
99 G4LogicalVolume* vacuumLV;
100 G4LogicalVolume* cavityLV;
101 G4LogicalVolume* containerLV;
103
105 G4Material* emptyMaterial;
109};
110
111#endif
Abstract base class for rf cavity geometry factories.
G4bool sensitiveBeamPipe
Whether the beam pipe will record energy deposition.
G4bool sensitiveVacuum
Whether the vacuum will record energy deposition.
virtual BDSCavity * BuildCavityAndRegisterObjects(const BDSExtent &extent)
Construct output object and register all temporary objects from vectors.
virtual void SetVisAttributes(const G4String &colourName="rfcavity")
Set vis attributes for cavityLV, vacuumLV and containerLV.
G4LogicalVolume * vacuumLV
Cache of particular solid or lv for common functionality in this class.
virtual void SetUserLimits(G4double length)
BDSCavity * CreateCavity(const G4String &name, G4double totalChordLength, const BDSCavityInfo *info, G4Material *vacuumMaterial)
virtual G4double CreateSolids(const G4String &name, G4double totalChordLength, const BDSCavityInfo *info)=0
Create vacuumSolid and cavitySolid. Must return the container radius.
G4LogicalVolume * containerLV
Cache of particular solid or lv for common functionality in this class.
void CleanUpBase()
Non-virtual clean up that can be used in the constructor safely.
G4LogicalVolume * cavityLV
Cache of particular solid or lv for common functionality in this class.
virtual void PlaceComponents(const G4String &name)
Place the vacuum and cavity centrally in the container logical volume.
G4Material * emptyMaterial
Cache of variable from BDSGlobalConstants.
std::map< G4LogicalVolume *, BDSSDType > sensitiveVolumes
Map to sensitivity for volumes.
G4VSolid * vacuumSolid
Cache of particular solid or lv for common functionality in this class.
virtual void CleanUp()
Ensure all internal members are reset before reuse. Calls CleanUpBase.
G4VSolid * containerSolid
Cache of particular solid or lv for common functionality in this class.
virtual void CreateLogicalVolumes(const G4String &name, const BDSCavityInfo *info, G4Material *vacuumMaterial)
Create vacuumLV, cavityLV and containerLV.
G4VSolid * cavitySolid
Cache of particular solid or lv for common functionality in this class.
Holder for all Geometrical information required to create an RF cavity.
A holder class for an RF cavity piece of geometry.
Definition BDSCavity.hh:39
Holder for +- extents in 3 dimensions.
Definition BDSExtent.hh:39
Common temporary storage for all factories no matter what geometry.