19#ifndef BDSGEOMETRYFACTORYSQL_H
20#define BDSGEOMETRYFACTORYSQL_H
22#include "BDSGeometryFactoryBase.hh"
25#include "G4ThreeVector.hh"
26#include "G4RotationMatrix.hh"
30#include <unordered_map>
57 static void SetDefaultRigidity(G4double rigidityIn) {
defaultRigidity = rigidityIn;}
63 std::map<G4String, G4Colour*>* colourMapping =
nullptr,
64 G4bool autoColour =
true,
65 G4double suggestedLength = 0,
66 G4double suggestedHorizontalWidth = 0,
67 std::vector<G4String>* vacuumBiasVolumeNames =
nullptr,
68 G4UserLimits* userLimitsToAttachToAllLVs =
nullptr);
78 std::unordered_map<G4VSolid*, BDSExtent> unShiftedExtents;
81 std::list<G4ThreeVector> UniformField;
82 std::list<G4String> Fieldvol;
85 std::list<G4double> QuadBgrad;
86 std::list<G4String> Quadvol;
87 std::list<G4double> SextBgrad;
88 std::list<G4String> Sextvol;
89 std::list<G4double> OctBgrad;
90 std::list<G4String> Octvol;
92 std::vector<G4LogicalVolume*> VOL_LIST;
110 G4double K1,K2,K3,K4;
112 G4String InheritStyle;
113 G4String Parameterisation;
118 G4int PrecisionRegion;
119 G4int ApproximationRegion;
120 G4double FieldX, FieldY, FieldZ;
122 G4double lengthUserLimit;
124 G4Region* precisionRegionSQL;
125 G4Region* approximationRegionSQL;
127 void BuildSQLObjects(G4String file);
130 G4VisAttributes* VisAtt();
131 G4UserLimits* UserLimits(G4double);
132 void SetLogVolAtt(G4LogicalVolume*, G4double);
133 void SetLogVolRegion(G4LogicalVolume*);
134 G4LogicalVolume* BuildCone(
BDSMySQLTable* aSQLTable, G4int k);
135 G4LogicalVolume* BuildEllipticalCone(
BDSMySQLTable* aSQLTable, G4int k);
136 G4LogicalVolume* BuildPolyCone(
BDSMySQLTable* aSQLTable, G4int k);
137 G4LogicalVolume* BuildBox(
BDSMySQLTable* aSQLTable, G4int k);
138 G4LogicalVolume* BuildTrap(
BDSMySQLTable* aSQLTable, G4int k);
139 G4LogicalVolume* BuildTorus(
BDSMySQLTable* aSQLTable, G4int k);
140 G4LogicalVolume* BuildSampler(
BDSMySQLTable* aSQLTable, G4int k);
141 G4LogicalVolume* BuildTube(
BDSMySQLTable* aSQLTable, G4int k);
142 G4LogicalVolume* BuildEllipticalTube(
BDSMySQLTable* aSQLTable, G4int k);
144 G4RotationMatrix* RotateComponent(G4double psi,
147 G4RotationMatrix* rotateComponent;
150 G4LogicalVolume* itsMarkerVol;
151 std::vector<BDSMySQLTable*> itsSQLTable;
155 void SetMultiplePhysicalVolumes(G4VPhysicalVolume* aPhysVol);
158 template <
typename T>
166 std::set<G4LogicalVolume*> sensitiveComponents;
168 G4VPhysicalVolume* alignInVolume;
169 G4VPhysicalVolume* alignOutVolume;
171 std::map<G4String, G4ThreeVector> uniformFieldVolField;
172 std::map<G4String, G4double> quadVolBgrad;
173 std::map<G4String, G4double> sextVolBgrad;
174 std::map<G4String, G4double> octVolBgrad;
A loaded piece of externally provided geometry.
Base class for external geometry loading factories.
Geometry factory for SQL geometry.
void PlaceComponents(BDSMySQLTable *aSQLTable, std::vector< G4LogicalVolume * > VOL_LIST)
void CleanUpSQL()
Non-virtual clean up as used in constructor.
virtual BDSGeometryExternal * Build(G4String componentName, G4String fileName, std::map< G4String, G4Colour * > *colourMapping=nullptr, G4bool autoColour=true, G4double suggestedLength=0, G4double suggestedHorizontalWidth=0, std::vector< G4String > *vacuumBiasVolumeNames=nullptr, G4UserLimits *userLimitsToAttachToAllLVs=nullptr)
void AssignVariable(BDSMySQLTable *aSQLTable, G4int k, G4String variableName, T &variable)
Search SQL table for variableName and if exists assign to variable.
virtual void CleanUp()
Clean up members.
static G4double defaultRigidity
Cache of default rigidity for possibly constructing fields (only SQL)
std::map< G4LogicalVolume *, G4int > samplerIDs
Representation of a mysql table.