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 G4bool makeSensitive =
true,
69 BDSSDType sensitivityType = BDSSDType::energydep,
70 BDSSDType vacuumSensitivityType = BDSSDType::energydepvacuum,
71 G4UserLimits* userLimitsToAttachToAllLVs =
nullptr);
81 std::unordered_map<G4VSolid*, BDSExtent> unShiftedExtents;
84 std::list<G4ThreeVector> UniformField;
85 std::list<G4String> Fieldvol;
88 std::list<G4double> QuadBgrad;
89 std::list<G4String> Quadvol;
90 std::list<G4double> SextBgrad;
91 std::list<G4String> Sextvol;
92 std::list<G4double> OctBgrad;
93 std::list<G4String> Octvol;
95 std::vector<G4LogicalVolume*> VOL_LIST;
113 G4double K1,K2,K3,K4;
115 G4String InheritStyle;
116 G4String Parameterisation;
121 G4int PrecisionRegion;
122 G4int ApproximationRegion;
123 G4double FieldX, FieldY, FieldZ;
125 G4double lengthUserLimit;
127 G4Region* precisionRegionSQL;
128 G4Region* approximationRegionSQL;
130 void BuildSQLObjects(G4String file);
133 G4VisAttributes* VisAtt();
134 G4UserLimits* UserLimits(G4double);
135 void SetLogVolAtt(G4LogicalVolume*, G4double);
136 void SetLogVolRegion(G4LogicalVolume*);
137 G4LogicalVolume* BuildCone(
BDSMySQLTable* aSQLTable, G4int k);
138 G4LogicalVolume* BuildEllipticalCone(
BDSMySQLTable* aSQLTable, G4int k);
139 G4LogicalVolume* BuildPolyCone(
BDSMySQLTable* aSQLTable, G4int k);
140 G4LogicalVolume* BuildBox(
BDSMySQLTable* aSQLTable, G4int k);
141 G4LogicalVolume* BuildTrap(
BDSMySQLTable* aSQLTable, G4int k);
142 G4LogicalVolume* BuildTorus(
BDSMySQLTable* aSQLTable, G4int k);
143 G4LogicalVolume* BuildSampler(
BDSMySQLTable* aSQLTable, G4int k);
144 G4LogicalVolume* BuildTube(
BDSMySQLTable* aSQLTable, G4int k);
145 G4LogicalVolume* BuildEllipticalTube(
BDSMySQLTable* aSQLTable, G4int k);
147 G4RotationMatrix* RotateComponent(G4double psi,
150 G4RotationMatrix* rotateComponent;
153 G4LogicalVolume* itsMarkerVol;
154 std::vector<BDSMySQLTable*> itsSQLTable;
158 void SetMultiplePhysicalVolumes(G4VPhysicalVolume* aPhysVol);
161 template <
typename T>
169 std::set<G4LogicalVolume*> sensitiveComponents;
171 G4VPhysicalVolume* alignInVolume;
172 G4VPhysicalVolume* alignOutVolume;
174 std::map<G4String, G4ThreeVector> uniformFieldVolField;
175 std::map<G4String, G4double> quadVolBgrad;
176 std::map<G4String, G4double> sextVolBgrad;
177 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, G4bool makeSensitive=true, BDSSDType sensitivityType=BDSSDType::energydep, BDSSDType vacuumSensitivityType=BDSSDType::energydepvacuum, 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.
Improve type-safety of native enum data type in C++.