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) 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 BDSCAVITYFACTORYBASE_H
19#define BDSCAVITYFACTORYBASE_H
20
21#include "BDSFactoryBase.hh"
22#include "BDSSDType.hh"
23
24#include "globals.hh"
25#include "G4String.hh"
26#include "G4RotationMatrix.hh"
27
28#include <map>
29#include <set>
30
31class BDSCavity;
32class BDSCavityInfo;
33class BDSExtent;
34
35class G4LogicalVolume;
36class G4Material;
37class G4UserLimits;
38class G4VisAttributes;
39class G4VPhysicalVolume;
40class G4VSolid;
41
49{
50public:
51 virtual ~BDSCavityFactoryBase(){;}
52
55 BDSCavity* CreateCavity(const G4String& name,
56 G4double totalChordLength,
57 const BDSCavityInfo* info,
58 G4Material* vacuumMaterial);
59
60protected:
62
64 virtual void CleanUp();
65
67 void CleanUpBase();
68
70 virtual G4double CreateSolids(const G4String& name,
71 G4double totalChordLength,
72 const BDSCavityInfo* info) = 0;
73
75 virtual void CreateLogicalVolumes(const G4String& name,
76 const BDSCavityInfo* info,
77 G4Material* vacuumMaterial);
78
81 virtual void SetUserLimits(G4double length);
82
84 virtual void SetVisAttributes(const G4String& colourName = "rfcavity");
85
87 virtual void PlaceComponents(const G4String& name);
88
91
92 std::map<G4LogicalVolume*, BDSSDType> sensitiveVolumes;
93
95 G4VSolid* vacuumSolid;
96 G4VSolid* cavitySolid;
97 G4VSolid* containerSolid;
98 G4LogicalVolume* vacuumLV;
99 G4LogicalVolume* cavityLV;
100 G4LogicalVolume* containerLV;
102
104 G4Material* emptyMaterial;
108};
109
110#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:38
Holder for +- extents in 3 dimensions.
Definition BDSExtent.hh:38
Common temporary storage for all factories no matter what geometry.