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) 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 BDSCOMPONENTFACTORYUSER_H
19#define BDSCOMPONENTFACTORYUSER_H
20
21#include "BDSBeamlineIntegral.hh"
22#include "BDSFieldType.hh"
23#include "BDSMagnetStrength.hh"
24#include "BDSMagnetType.hh"
25#include "BDSIntegratorSetType.hh"
26
27#include "globals.hh"
28#include "G4ThreeVector.hh"
29#include "G4Transform3D.hh"
30
31#include "CLHEP/Units/PhysicalConstants.h"
32
33#include <map>
34
35class G4Colour;
36class G4Material;
37
38namespace GMAD
39{
40 struct Element;
41}
43class BDSBeamPipeInfo;
44class BDSCavityInfo;
46class BDSCrystalInfo;
47class BDSFieldInfo;
49class BDSMagnet;
52class BDSTiltOffset;
53
61{
62public:
65
67 void RegisterComponent(const G4String& componentTypeName,
68 BDSComponentConstructor* componentConstructor);
69
71 G4bool CanConstructComponentByName(const G4String& componentTypeName) const;
72
75 BDSAcceleratorComponent* ConstructComponent(const G4String& componentTypeName,
76 GMAD::Element const* elementIn,
77 GMAD::Element const* prevElementIn,
78 GMAD::Element const* nextElementIn,
79 const BDSBeamlineIntegral& integral);
80
81private:
83 std::map<G4String, BDSComponentConstructor*> userFunctions;
84};
85#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:44
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:47