BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSComponentFactoryUser.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 BDSCOMPONENTFACTORYUSER_H
20#define BDSCOMPONENTFACTORYUSER_H
21
22#include "BDSBeamlineIntegral.hh"
23#include "BDSFieldType.hh"
24#include "BDSMagnetStrength.hh"
25#include "BDSMagnetType.hh"
26#include "BDSIntegratorSetType.hh"
27
28#include "globals.hh"
29#include "G4ThreeVector.hh"
30#include "G4Transform3D.hh"
31
32#include "CLHEP/Units/PhysicalConstants.h"
33
34#include <map>
35
36class G4Colour;
37class G4Material;
38
39namespace GMAD
40{
41 struct Element;
42}
44class BDSBeamPipeInfo;
45class BDSCavityInfo;
47class BDSCrystalInfo;
48class BDSFieldInfo;
50class BDSMagnet;
53class BDSTiltOffset;
54
62{
63public:
66
68 void RegisterComponent(const G4String& componentTypeName,
69 BDSComponentConstructor* componentConstructor);
70
72 G4bool CanConstructComponentByName(const G4String& componentTypeName) const;
73
76 BDSAcceleratorComponent* ConstructComponent(const G4String& componentTypeName,
77 GMAD::Element const* elementIn,
78 GMAD::Element const* prevElementIn,
79 GMAD::Element const* nextElementIn,
80 const BDSBeamlineIntegral& integral);
81
82private:
84 std::map<G4String, BDSComponentConstructor*> userFunctions;
85};
86#endif
Abstract class that represents a component of an accelerator.
Holder class for all information required to describe a beam pipe model.
A class that holds the current integrated quantities along a beam line.
Holder for all Geometrical information required to create an RF cavity.
Interface class the developer should derive to construct their element.
Factory for user specified accelerator components.
G4bool CanConstructComponentByName(const G4String &componentTypeName) const
Check whether a component can be constructed - ie if the name exists.
void RegisterComponent(const G4String &componentTypeName, BDSComponentConstructor *componentConstructor)
Register a constructor instance by a given name.
std::map< G4String, BDSComponentConstructor * > userFunctions
Map of user component name with constructors to build a component.
BDSAcceleratorComponent * ConstructComponent(const G4String &componentTypeName, GMAD::Element const *elementIn, GMAD::Element const *prevElementIn, GMAD::Element const *nextElementIn, const BDSBeamlineIntegral &integral)
Holder for all information required to create a crystal.
All info required to build complete field of any type.
Which integrator to use for each type of magnet / field object.
Holder struct of all information required to create the outer geometry of a magnet.
Abstract base class that implements features common to all magnets.
Definition BDSMagnet.hh:45
Wrapper for particle definition.
A holder for any placement offsets and rotations for a BDSAcceleratorComponent.
Parser namespace for GMAD language. Combination of Geant4 and MAD.
Element class.
Definition element.h:45