19#include "BDSAcceleratorModel.hh"
21#include "BDSException.hh"
22#include "BDSGeometryExternal.hh"
23#include "BDSGeometryFactorySQL.hh"
24#include "BDSGlobalConstants.hh"
25#include "BDSMaterials.hh"
26#include "BDSMySQLTable.hh"
27#include "BDSMySQLVariable.hh"
28#include "BDSMySQLWrapper.hh"
29#include "BDSSDSampler.hh"
30#include "BDSSampler.hh"
31#include "BDSSamplerRegistry.hh"
32#include "BDSSDManager.hh"
33#include "BDSUtilities.hh"
38#include "G4EllipticalCone.hh"
39#include "G4EllipticalTube.hh"
40#include "G4IntersectionSolid.hh"
41#include "G4LogicalVolume.hh"
42#include "G4Polycone.hh"
43#include "G4PVPlacement.hh"
44#include "G4RotationMatrix.hh"
46#include "G4SubtractionSolid.hh"
50#include "G4UnionSolid.hh"
51#include "G4UserLimits.hh"
52#include "G4Version.hh"
53#include "G4VisAttributes.hh"
54#include "G4VPhysicalVolume.hh"
64#include <unordered_map>
69BDSGeometryFactorySQL::BDSGeometryFactorySQL()
103 Parameterisation =
"";
109 ApproximationRegion = 0;
115 unShiftedExtents.clear();
117 precisionRegionSQL =
nullptr;
118 approximationRegionSQL =
nullptr;
119 rotateComponent =
nullptr;
120 itsMarkerVol =
nullptr;
122 UniformField.clear();
135 sensitiveComponents.clear();
137 alignInVolume =
nullptr;
138 alignOutVolume =
nullptr;
140 uniformFieldVolField.clear();
141 quadVolBgrad.clear();
142 sextVolBgrad.clear();
148 std::map<G4String, G4Colour*>* colourMapping,
150 G4double suggestedLength,
151 G4double suggestedHorizontalWidth,
152 std::vector<G4String>* ,
163 G4cout << __METHOD_NAME__ <<
"loading SQL file: " << fileName << G4endl;
164 G4cout << __METHOD_NAME__ <<
"containing directory: " << containingDir << G4endl;
169 {
throw BDSException(__METHOD_NAME__,
"Cannot open file \"" + fileName +
"\"");}
175 G4double outerR = suggestedHorizontalWidth*0.5;
176 G4VSolid* containerSolid =
new G4Box(
"container_solid",
179 suggestedLength*0.5);
184 itsMarkerVol =
new G4LogicalVolume(containerSolid,
189 VOL_LIST.push_back(itsMarkerVol);
190 G4String fileListLine;
192 while (ifs >> fileListLine)
195 {ifs.getline(buffer,1000);}
197 {BuildSQLObjects(containingDir + fileListLine);}
211 std::set<G4LogicalVolume*> tempVols;
212 for (
auto lv : VOL_LIST)
213 {tempVols.insert(lv);}
226void BDSGeometryFactorySQL::BuildSQLObjects(G4String file)
229 G4cout << __METHOD_NAME__ <<
"loading single file " << file << G4endl;
233 itsSQLTable=sql.ConstructTable();
235 for (G4int i=0; i<(G4int)itsSQLTable.size(); i++)
238 itsSQLTable[i]->Print();
240 TableName = itsSQLTable[i]->GetName();
242 G4cout << __METHOD_NAME__ <<
" i = " << i <<
", TableName = " << TableName << G4endl;
244 G4int pos = TableName.find(
"_");
245 std::string ObjectType = TableName.substr(pos+1,TableName.length() - pos);
246 NVariables = itsSQLTable[i]->GetVariable(0)->GetNVariables();
247 for (G4int k=0; k<NVariables; k++)
249 SetCommonParams(itsSQLTable[i], k);
250 G4LogicalVolume* logVol;
252 {logVol = BuildCone(itsSQLTable[i],k);}
254 {logVol = BuildEllipticalCone(itsSQLTable[i],k);}
256 {logVol = BuildPolyCone(itsSQLTable[i],k);}
258 {logVol = BuildBox(itsSQLTable[i],k);}
260 {logVol = BuildTrap(itsSQLTable[i],k);}
262 {logVol = BuildTorus(itsSQLTable[i],k);}
264 {logVol = BuildSampler(itsSQLTable[i],k);}
266 {logVol = BuildTube(itsSQLTable[i],k);}
268 {logVol = BuildEllipticalTube(itsSQLTable[i],k);}
272 {
throw BDSException(__METHOD_NAME__ + ObjectType +
" not known.");}
274 SetLogVolAtt(logVol, lengthUserLimit);
275 VOL_LIST.push_back(logVol);
276 allLogicalVolumes.insert(logVol);
283void BDSGeometryFactorySQL::AssignVariable<G4double>(
BDSMySQLTable* aSQLTable, G4int k, G4String variableName, G4double& variable)
291void BDSGeometryFactorySQL::AssignVariable<G4int>(
BDSMySQLTable* aSQLTable, G4int k, G4String variableName, G4int& variable)
299void BDSGeometryFactorySQL::AssignVariable<G4String>(
BDSMySQLTable* aSQLTable, G4int k, G4String variableName, G4String& variable)
306void BDSGeometryFactorySQL::SetCommonParams(
BDSMySQLTable* aSQLTable, G4int k)
309 VisRed = VisGreen = VisBlue = 0.5;
315 ApproximationRegion=0;
324 AssignVariable(aSQLTable,k,
"APPROXIMATIONREGION",ApproximationRegion);
328 {Name = TableName+std::to_string(k) +
"_SQL";}
330 {Name = TableName+std::to_string(k);}
331 Name = itsMarkerVol->GetName()+
"_"+Name;
333 G4cout << __METHOD_NAME__ <<
" k = " << k <<
", Name = " << Name << G4endl;
337void BDSGeometryFactorySQL::SetPlacementParams(
BDSMySQLTable* aSQLTable, G4int k)
340 PosX = PosY = PosZ = 0.;
341 RotPsi = RotTheta = RotPhi = 0.;
342 K1 = K2 = K3 = K4 = 0.;
345 Parameterisation =
"";
350 FieldX = FieldY = FieldZ = 0.0;
378 PARENTNAME= itsMarkerVol->GetName() +
"_" + PARENTNAME;
382 {Name = TableName+std::to_string(k) +
"_SQL";}
384 {Name = TableName+std::to_string(k);}
386 Name = itsMarkerVol->GetName()+
"_"+Name;
388 G4cout << __METHOD_NAME__ <<
" k = " << k <<
", Name = " << Name << G4endl;
392G4VisAttributes* BDSGeometryFactorySQL::VisAtt()
394 G4VisAttributes* va =
new G4VisAttributes(G4Colour(VisRed, VisGreen, VisBlue, VisAlpha));
395 char testChar = VisType[0];
398 case 'W': va->SetForceWireframe(
true);
break;
399 case 'I': va->SetVisibility(
false);
break;
400 case 'S': va->SetForceSolid(
true);
break;
401 case 'w': va->SetForceWireframe(
true);
break;
402 case 'i': va->SetVisibility(
false);
break;
403 case 's': va->SetForceSolid(
true);
break;
405 allVisAttributes.insert(va);
409G4UserLimits* BDSGeometryFactorySQL::UserLimits(G4double maxStepLength)
415void BDSGeometryFactorySQL::SetLogVolAtt(G4LogicalVolume* logVol, G4double k)
417 logVol->SetVisAttributes(VisAtt());
418 logVol->SetUserLimits(UserLimits(k));
419 SetLogVolRegion(logVol);
422void BDSGeometryFactorySQL::SetLogVolRegion(G4LogicalVolume* logVol)
424 G4Region* region =
nullptr;
427 G4cout <<
"Approximation region should be define in gmad syntax now!" << G4endl;
428 region = BDSAcceleratorModel::Instance()->
Region(
"precision");
430 if(ApproximationRegion)
432 G4cout <<
"Approximation region should be define in gmad syntax now!" << G4endl;
433 region = BDSAcceleratorModel::Instance()->
Region(
"approximation");
437 logVol->SetRegion(region);
438 region->AddRootLogicalVolume(logVol);
442G4LogicalVolume* BDSGeometryFactorySQL::BuildCone(
BDSMySQLTable* aSQLTable, G4int k)
445 G4double rInnerStart;
447 G4double rOuterStart;
454 dphi = CLHEP::twopi*CLHEP::radian;
455 length = rOuterStart = rOuterEnd = 10.*CLHEP::mm;
456 rInnerStart = rInnerEnd = 0.0;
466 G4Cons* aCone =
new G4Cons(Name+
"_Cone",
474 allSolids.insert(aCone);
476 G4double maxR = std::max(rOuterStart, rOuterEnd);
477 unShiftedExtents[aCone] =
BDSExtent(maxR, maxR, length*0.5);
479 G4LogicalVolume* aConeVol =
new G4LogicalVolume(aCone,
483 lengthUserLimit=length;
487G4LogicalVolume* BDSGeometryFactorySQL::BuildEllipticalCone(
BDSMySQLTable* aSQLTable, G4int k)
489 G4double lengthZ = 0;
490 G4double pxSemiAxis = 0;
491 G4double pySemiAxis = 0;
492 G4double pzTopCut = 0;
495 lengthZ = 10.*CLHEP::mm;
502 G4EllipticalCone* aEllipticalCone =
new G4EllipticalCone(Name+
"_EllipticalCone",
507 allSolids.insert(aEllipticalCone);
509 G4double maxX = pxSemiAxis*lengthZ*0.5;
510 G4double maxY = pySemiAxis*lengthZ*0.5;
511 unShiftedExtents[aEllipticalCone] =
BDSExtent(maxX, maxY, lengthZ*0.5);
513 G4LogicalVolume* aEllipticalConeVol =
514 new G4LogicalVolume(aEllipticalCone,
518 lengthUserLimit=lengthZ*0.5;
519 return aEllipticalConeVol;
522G4LogicalVolume* BDSGeometryFactorySQL::BuildPolyCone(
BDSMySQLTable* aSQLTable, G4int k)
530 dphi = CLHEP::twopi*CLHEP::radian;
535 std::vector<G4double> rInner = std::vector<G4double>(numZplanes+1);
536 std::vector<G4double> rOuter = std::vector<G4double>(numZplanes+1);
537 std::vector<G4double> zPos = std::vector<G4double>(numZplanes+1);
539 for (G4int planenum=0; planenum<numZplanes; planenum++)
541 G4String rInner_ID =
"RINNER" + std::to_string(planenum+1);
542 G4String rOuter_ID =
"ROUTER" + std::to_string(planenum+1);
543 G4String zPos_ID =
"PLANEPOS" + std::to_string(planenum+1);
553 G4Polycone* aPolyCone =
new G4Polycone(Name+
"_PolyCone",
560 allSolids.insert(aPolyCone);
562 G4double maxR = *std::max_element(rOuter.begin(), rOuter.end());
563 G4double maxZ = *std::max_element(zPos.begin(), zPos.end());
564 unShiftedExtents[aPolyCone] =
BDSExtent(maxR, maxR, maxZ);
566 G4LogicalVolume* aPolyConeVol =
567 new G4LogicalVolume(aPolyCone,
571 lengthUserLimit=fabs(zPos[0]-zPos[numZplanes-1])/2;
576G4LogicalVolume* BDSGeometryFactorySQL::BuildBox(
BDSMySQLTable* aSQLTable, G4int k)
582 lengthX = lengthY = lengthZ = 1.*CLHEP::mm;
588 G4Box* aBox =
new G4Box(Name+
"_Box",
592 allSolids.insert(aBox);
594 unShiftedExtents[aBox] =
BDSExtent(lengthX*0.5, lengthY*0.5, lengthZ*0.5);
596 G4LogicalVolume* aBoxVol =
597 new G4LogicalVolume(aBox,
601 lengthUserLimit = lengthZ;
605G4LogicalVolume* BDSGeometryFactorySQL::BuildTrap(
BDSMySQLTable* aSQLTable, G4int k)
608 G4double trapTheta = 0;
609 G4double lengthXPlus = 0;
610 G4double lengthXMinus = 0;
611 G4double lengthYPlus = 0;
612 G4double lengthYMinus = 0;
613 G4double lengthZ = 0;
622 G4Trap* aTrap =
new G4Trap(Name+
"_Trd",
633 allSolids.insert(aTrap);
636 G4LogicalVolume* aTrapVol =
637 new G4LogicalVolume(aTrap,
641 lengthUserLimit = lengthZ*0.5;
645G4LogicalVolume* BDSGeometryFactorySQL::BuildTorus(
BDSMySQLTable* aSQLTable, G4int k)
654 rSwept = 20.*CLHEP::mm;
655 rOuter = 10.*CLHEP::mm;
658 dphi=2*CLHEP::pi*CLHEP::radian;
667 G4Torus* aTorus =
new G4Torus(Name+
"_Torus",
673 allSolids.insert(aTorus);
675 G4LogicalVolume* aTorusVol =
676 new G4LogicalVolume(aTorus,
680 lengthUserLimit = rOuter*0.5;
684G4LogicalVolume* BDSGeometryFactorySQL::BuildSampler(
BDSMySQLTable* aSQLTable, G4int k)
687 G4double rInnerStart;
689 G4double rOuterStart;
693 length = rOuterStart = rOuterEnd = 10.*CLHEP::mm;
694 rInnerStart = rInnerEnd = 0.0;
704 Name = sqlName->GetStrValue(k);
705 sqlName->SetStrValue(k,Name+
"_SQL");
706 Name = sqlName->GetStrValue(k);
709 {Name = TableName+std::to_string(k)+
"_SQL";}
711 Name = itsMarkerVol->GetName()+
"_"+Name;
713 G4Cons* aSampler =
new G4Cons(Name+
"_samp",
720 CLHEP::twopi*CLHEP::radian);
721 allSolids.insert(aSampler);
722 G4LogicalVolume* aSamplerVol =
723 new G4LogicalVolume(aSampler,
727 lengthUserLimit = length*0.5;
729 aSamplerVol->SetSensitiveDetector(BDSSDManager::Instance()->SamplerPlane());
738G4LogicalVolume* BDSGeometryFactorySQL::BuildTube(
BDSMySQLTable* aSQLTable, G4int k)
747 length = 100.*CLHEP::mm;
748 rOuter = 10.*CLHEP::mm;
751 dphi=2*CLHEP::pi*CLHEP::radian;
759 G4Tubs* aTubs =
new G4Tubs(Name+
"_Tubs",
765 allSolids.insert(aTubs);
766 G4LogicalVolume* aTubsVol =
767 new G4LogicalVolume(aTubs,
771 lengthUserLimit = length*0.5;
775G4LogicalVolume* BDSGeometryFactorySQL::BuildEllipticalTube(
BDSMySQLTable* aSQLTable, G4int k)
782 lengthX = 100.*CLHEP::mm;
783 lengthY = 50.*CLHEP::mm;
784 lengthZ = 200.*CLHEP::mm;
790 G4EllipticalTube* aEllipticalTube =
new G4EllipticalTube(Name+
"_EllipticalTube",
796 allSolids.insert(aEllipticalTube);
797 G4LogicalVolume* aEllipticalTubeVol =
798 new G4LogicalVolume(aEllipticalTube,
801 G4double maxLength = lengthX;
802 if (lengthY>lengthX&&lengthY>lengthZ)
803 {maxLength = lengthY;}
804 else if(lengthZ>lengthY&&lengthZ>lengthX)
805 {maxLength = lengthZ;}
806 lengthUserLimit = maxLength*0.5;
807 return aEllipticalTubeVol;
863G4RotationMatrix* BDSGeometryFactorySQL::RotateComponent(G4double psi,G4double phi,G4double theta)
865 rotateComponent =
new G4RotationMatrix;
866 if(psi==0 && phi==0 && theta==0)
867 {
return rotateComponent;}
869 G4RotationMatrix* LocalRotation =
new G4RotationMatrix;
870 G4ThreeVector* localX =
new G4ThreeVector(1.,0.,0.);
871 G4ThreeVector* localY =
new G4ThreeVector(0.,1.,0.);
872 G4ThreeVector* localZ =
new G4ThreeVector(0.,0.,1.);
874 LocalRotation->rotate(psi,*localZ);
875 localX->rotate(psi,*localZ);
876 localY->rotate(psi,*localZ);
878 LocalRotation->rotate(phi,*localY);
879 localX->rotate(phi,*localY);
880 localZ->rotate(phi,*localY);
882 LocalRotation->rotate(theta,*localX);
883 localY->rotate(theta,*localX);
884 localZ->rotate(theta,*localX);
886 rotateComponent->transform(*LocalRotation);
887 rotateComponent->invert();
889 return rotateComponent;
893 std::vector<G4LogicalVolume*> VOL_LISTIn)
895 for (G4int k=0; k<NVariables; k++)
897 SetPlacementParams(aSQLTable, k);
899 if(!PARENTNAME.empty())
901 PARENTNAME+=
"_LogVol";
902 for (G4int i=0; i<(G4int)VOL_LISTIn.size(); i++)
904#if G4VERSION_NUMBER > 1099
905 if (G4StrUtil::icompare(PARENTNAME, VOL_LISTIn[i]->GetName()) == 0)
907 if(PARENTNAME.compareTo(VOL_LISTIn[i]->GetName(), G4String::ignoreCase)==0)
917 G4String tmpname = Name+
"_LogVol";
919 for (G4int i=0; i<(G4int)VOL_LISTIn.size(); i++)
921#if G4VERSION_NUMBER > 1099
922 if (G4StrUtil::icompare(tmpname, VOL_LISTIn[i]->GetName()) == 0)
924 if(tmpname.compareTo(VOL_LISTIn[i]->GetName(), G4String::ignoreCase)==0)
933 {sensitiveComponents.insert(VOL_LISTIn[ID]);}
934 G4ThreeVector PlacementPoint(PosX,PosY,PosZ);
936 if(!InheritStyle.empty())
938#if G4VERSION_NUMBER > 1099
939 if (G4StrUtil::icompare(InheritStyle,
"SUBTRACT") == 0)
941 if(InheritStyle.compareTo(
"SUBTRACT", G4String::ignoreCase)==0)
944 G4VSolid* original = VOL_LISTIn[PARENTID]->GetSolid();
945 G4VSolid* sub = VOL_LISTIn[ID]->GetSolid();
946 VOL_LISTIn[PARENTID]->SetSolid(
new G4SubtractionSolid(VOL_LISTIn[PARENTID]->GetName(),
949 RotateComponent(RotPsi,RotPhi,RotTheta),
953#if G4VERSION_NUMBER > 1099
954 if (G4StrUtil::icompare(InheritStyle,
"INTERSECT") == 0)
956 else if(InheritStyle.compareTo(
"INTERSECT", G4String::ignoreCase)==0)
959 G4VSolid* original = VOL_LISTIn[PARENTID]->GetSolid();
960 G4VSolid* sub = VOL_LISTIn[ID]->GetSolid();
961 VOL_LISTIn[PARENTID]->SetSolid(
new G4IntersectionSolid(VOL_LISTIn[PARENTID]->GetName(),
964 RotateComponent(RotPsi,RotPhi,RotTheta),
968#if G4VERSION_NUMBER > 1099
969 if (G4StrUtil::icompare(InheritStyle,
"UNION") == 0)
971 else if(InheritStyle.compareTo(
"UNION", G4String::ignoreCase)==0)
974 G4VSolid* original = VOL_LISTIn[PARENTID]->GetSolid();
975 G4VSolid* sub = VOL_LISTIn[ID]->GetSolid();
976 VOL_LISTIn[PARENTID]->SetSolid(
new G4UnionSolid(VOL_LISTIn[PARENTID]->GetName(),
979 RotateComponent(RotPsi,RotPhi,RotTheta),
985 G4cout << __METHOD_NAME__ <<
" k = " << k <<
", volume = " << VOL_LISTIn[ID]->GetName() << G4endl;
988 G4LogicalVolume* volume = VOL_LISTIn[ID];
989 G4int copyNumber = 0;
992 {copyNumber = result->second;}
995 G4VSolid* solid = volume->GetSolid();
1000 G4VPhysicalVolume* PhysiComp =
1001 new G4PVPlacement(RotateComponent(RotPsi,RotPhi,RotTheta),
1005 VOL_LISTIn[PARENTID],
1014 G4cerr<<
"\nBDSGeometryFactorySQL.cc:486: Trying to align in-beam to SQL volume to " << PhysiComp->GetName() <<
" but alignment already set to " << alignInVolume->GetName() << G4endl;
1015 G4Exception(
"Aborting Program",
"-1", FatalException,
"");
1019 {alignInVolume = PhysiComp;}
1026 G4cerr<<
"\nBDSGeometryFactorySQL.cc:486: Trying to align out-beam to SQL volume to " << PhysiComp->GetName() <<
" but alignment already set to " << alignOutVolume->GetName() << G4endl;
1027 G4Exception(
"Aborting Program",
"-1", FatalException,
"");
1030 {alignOutVolume = PhysiComp;}
1035#if G4VERSION_NUMBER > 1099
1036 if (G4StrUtil::icompare(MagType,
"QUAD") == 0)
1038 if(MagType.compareTo(
"QUAD", G4String::ignoreCase)==0)
1043 QuadBgrad.push_back(- brho * K1 / CLHEP::m2);
1044 Quadvol.push_back(PhysiComp->GetName());
1045 quadVolBgrad[PhysiComp->GetName()]=(- brho * K1 / CLHEP::m2);
1047#if G4VERSION_NUMBER > 1099
1048 if (G4StrUtil::icompare(MagType,
"SEXT") == 0)
1050 if(MagType.compareTo(
"SEXT", G4String::ignoreCase)==0)
1055 SextBgrad.push_back(- brho * K2 / CLHEP::m3);
1056 Sextvol.push_back(PhysiComp->GetName());
1057 sextVolBgrad[PhysiComp->GetName()]=(- brho * K2 / CLHEP::m3);
1059#if G4VERSION_NUMBER > 1099
1060 if (G4StrUtil::icompare(MagType,
"OCT") == 0)
1062 if(MagType.compareTo(
"OCT", G4String::ignoreCase)==0)
1067 OctBgrad.push_back(- brho * K3 / (CLHEP::m2*CLHEP::m2));
1068 Octvol.push_back(PhysiComp->GetName());
1069 octVolBgrad[PhysiComp->GetName()]=(- brho * K3 / (CLHEP::m2*CLHEP::m2));
1072 if(FieldX || FieldY || FieldZ)
1077 G4cout <<
"BDSGeometryFactorySQL> volume " << PhysiComp->GetName() <<
" has the following uniform field: " << FieldX <<
" " << FieldY <<
" " << FieldZ <<
" " << G4endl;
1079 UniformField.emplace_back(G4ThreeVector(FieldX*CLHEP::tesla,
1080 FieldY*CLHEP::tesla,
1081 FieldZ*CLHEP::tesla));
1082 Fieldvol.push_back(PhysiComp->GetName());
1083 uniformFieldVolField[PhysiComp->GetName()]=G4ThreeVector(FieldX*CLHEP::tesla,
1084 FieldY*CLHEP::tesla,
1085 FieldZ*CLHEP::tesla);
G4Region * Region(const G4String &name) const
Access region information. Will exit if not found.
General exception with possible name of object and message.
Holder for +- extents in 3 dimensions.
BDSExtent Translate(const G4ThreeVector &offset) const
Provide a new copy of this extent with an offset applied.
void RegisterRotationMatrix(G4RotationMatrix *rotationMatrix)
void RegisterLogicalVolume(G4LogicalVolume *logicalVolume)
void RegisterPhysicalVolume(G4VPhysicalVolume *physicalVolume)
void RegisterVisAttributes(G4VisAttributes *visAttribute)
void RegisterSolid(G4VSolid *solid)
A loaded piece of externally provided geometry.
void ExpandExtent(const BDSExtent &extent)
Expand the acuumulated extents using a (possibly asymmetric) extent instance.
virtual void CleanUp()
Virtual clean up that derived classes can override that calls CleanUpBase().
virtual std::set< G4VisAttributes * > ApplyColourMapping(std::set< G4LogicalVolume * > &lvs, std::map< G4String, G4Colour * > *mapping, G4bool autoColour, const G4String &preprocessPrefix="")
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
static BDSGlobalConstants * Instance()
Access method.
static BDSMaterials * Instance()
Singleton pattern access.
G4Material * GetMaterial(G4String material) const
Get material by name.
Representation of a mysql table.
A variable representation for mysql loader.
G4double GetDblValue(G4int itemN) const
Accessor.
G4int GetIntValue(G4int itemN) const
Accessor.
G4String GetStrValue(G4int itemN) const
Accessor.
Wrapper for mysql file handling.
static BDSSamplerRegistry * Instance()
Accessor for registry.
G4int RegisterSampler(const G4String &name, BDSSampler *sampler, const G4Transform3D &transform=G4Transform3D(), G4double S=-1000, const BDSBeamlineElement *element=nullptr, BDSSamplerType type=BDSSamplerType::plane, G4double radius=0)
Improve type-safety of native enum data type in C++.
G4bool StrContains(const G4String &str, const G4String &test)
Utility function to simplify lots of syntax changes for pedantic g4 changes.
G4String GetFullPath(G4String filename, bool excludeNameFromPath=false, bool useCWDForPrefix=false)
G4UserLimits * CreateUserLimits(G4UserLimits *defaultUL, G4double length, G4double fraction=1.6)
G4int StrCompare(const G4String &str, const G4String &, G4String::caseCompare mode=G4String::ignoreCase)
Utility function to simplify lots of syntax changes for pedantic g4 changes.