55#include "G4BooleanSolid.hh"
58#include "G4CutTubs.hh"
59#include "G4DisplacedSolid.hh"
60#include "G4Ellipsoid.hh"
61#include "G4EllipticalTube.hh"
62#include "G4ExtrudedSolid.hh"
64#include "G4LogicalVolume.hh"
65#include "G4LogicalVolumeStore.hh"
66#include "G4MultiUnion.hh"
67#include "G4PVDivisionFactory.hh"
68#include "G4PVParameterised.hh"
70#include "G4Paraboloid.hh"
71#include "G4Polycone.hh"
72#include "G4Polyhedra.hh"
73#include "G4ReflectedSolid.hh"
74#include "G4ReplicatedSlice.hh"
75#include "G4ScaledSolid.hh"
77#include "G4SystemOfUnits.hh"
78#include "G4TessellatedSolid.hh"
83#include "G4VPhysicalVolume.hh"
88bool Geant4GM::Factory::fgSurfCheck =
false;
100 fgSurfCheck = surfCheck;
150void Geant4GM::Factory::ImportConstituentSolid(
int index, G4BooleanSolid* solid)
154 G4VSolid* consSolid =
162 std::cout <<
" Imported solid: " << *vgmSolid << std::endl;
164 std::cout <<
" Imported solid: "
165 <<
"0x0" << std::endl;
171void Geant4GM::Factory::ImportConstituentSolid(
int index, G4MultiUnion* solid)
175 G4VSolid* consSolid = solid->GetSolid(index);
182 std::cout <<
" Imported solid: " << *vgmSolid << std::endl;
184 std::cout <<
" Imported solid: "
185 <<
"0x0" << std::endl;
191VGM::ISolid* Geant4GM::Factory::ImportSolid(G4VSolid* solid)
198 if (importedSolid)
return importedSolid;
202 std::cout <<
"Importing solid: ";
203 if (Debug() > 1) std::cout << solid <<
" ";
204 std::cout << solid->GetName() << std::endl;
207 G4VSolid* consSolid = solid;
211 G4ReflectedSolid* reflSolid =
dynamic_cast<G4ReflectedSolid*
>(solid);
212 if (reflSolid) consSolid = reflSolid->GetConstituentMovedSolid();
214 G4Box* box =
dynamic_cast<G4Box*
>(consSolid);
219 G4Cons* cons =
dynamic_cast<G4Cons*
>(consSolid);
224 G4CutTubs* ctubs =
dynamic_cast<G4CutTubs*
>(consSolid);
229 G4Ellipsoid* ellipsoid =
dynamic_cast<G4Ellipsoid*
>(consSolid);
234 G4EllipticalTube* eltu =
dynamic_cast<G4EllipticalTube*
>(consSolid);
239 G4ExtrudedSolid* xtru =
dynamic_cast<G4ExtrudedSolid*
>(consSolid);
244 G4Hype* hype =
dynamic_cast<G4Hype*
>(consSolid);
249 G4Para* para =
dynamic_cast<G4Para*
>(consSolid);
254 G4Paraboloid* paraboloid =
dynamic_cast<G4Paraboloid*
>(consSolid);
259 G4Polycone* polycone =
dynamic_cast<G4Polycone*
>(consSolid);
264 G4Polyhedra* polyhedra =
dynamic_cast<G4Polyhedra*
>(consSolid);
269 G4Sphere* sphere =
dynamic_cast<G4Sphere*
>(consSolid);
274 G4TessellatedSolid* tessel =
dynamic_cast<G4TessellatedSolid*
>(consSolid);
279 G4Torus* torus =
dynamic_cast<G4Torus*
>(consSolid);
284 G4Trap* trap =
dynamic_cast<G4Trap*
>(consSolid);
289 G4Trd* trd =
dynamic_cast<G4Trd*
>(consSolid);
294 G4Tubs* tubs =
dynamic_cast<G4Tubs*
>(consSolid);
299 G4DisplacedSolid* displaced =
dynamic_cast<G4DisplacedSolid*
>(consSolid);
301 ImportSolid(displaced->GetConstituentMovedSolid());
305 G4ScaledSolid* scaled =
dynamic_cast<G4ScaledSolid*
>(consSolid);
307 ImportSolid(scaled->GetUnscaledSolid());
311 G4BooleanSolid*
boolean =
dynamic_cast<G4BooleanSolid*
>(consSolid);
313 ImportConstituentSolid(0,
boolean);
314 ImportConstituentSolid(1,
boolean);
317 Register(vgmBoolean);
321 std::cout <<
"Imported Boolean solid: ";
322 if (Debug() > 1) std::cout << vgmBoolean;
323 std::cout << std::endl;
325 std::cout << *vgmBoolean << std::endl;
331 G4MultiUnion* multiUnion =
dynamic_cast<G4MultiUnion*
>(consSolid);
333 for (G4int i = 0; i < multiUnion->GetNumberOfSolids(); ++i) {
334 ImportConstituentSolid(i, multiUnion);
338 Register(vgmMultiUnion);
342 std::cout <<
"Imported MultiUnion solid: ";
343 if (Debug() > 1) std::cout << vgmMultiUnion;
344 std::cout << std::endl;
346 std::cout << *vgmMultiUnion << std::endl;
349 return vgmMultiUnion;
352 std::cerr <<
"Geant4GM::Factory::ImportSolid: " << std::endl;
353 std::cerr <<
"Unsupported solid type (solid \"" << solid->GetName() <<
"\""
354 <<
" type \"" << solid->GetEntityType() <<
"\")" << std::endl;
357 std::cerr <<
"*** Warning: Using a box instead ***" << std::endl;
364 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
370VGM::IVolume* Geant4GM::Factory::ImportLV(G4LogicalVolume* lv)
376 std::cout <<
"Importing LV: " << lv->GetName() << std::endl;
385 std::cout <<
" Imported solid: " << *solid << std::endl;
387 std::cout <<
" Imported solid: "
388 <<
"0x0" << std::endl;
400 G4LogicalVolume* lv,
const std::string& mediumName)
406 std::cout <<
"Importing LV: " << lv->GetName() << std::endl;
419void Geant4GM::Factory::ImportDaughters(G4LogicalVolume* lv)
425 std::cout <<
"ImportDaughters for " << lv->GetName() << std::endl;
437 std::map<std::pair<G4VSolid*, G4Material*>, G4LogicalVolume*> localSolidMaterialStore;
439 for (
size_t i = 0; i < lv->GetNoDaughters(); i++) {
441 G4LogicalVolume* dLV = lv->GetDaughter(i)->GetLogicalVolume();
450 localSolidMaterialStore.insert(
451 std::make_pair(std::make_pair(dLV->GetSolid(), dLV->GetMaterial()), dLV));
454 G4PVParameterised* paraPhysVol =
455 dynamic_cast<G4PVParameterised*
>(lv->GetDaughter(i));
460 std::cout <<
"Processing parameterised daughter " << paraPhysVol->GetName()
461 <<
" (multiplicity = " << paraPhysVol->GetMultiplicity() <<
")"
465 G4LogicalVolume* localLV = paraPhysVol->GetLogicalVolume();
466 std::vector< G4LogicalVolume*> paramVolumes;
469 for (
int k = 0; k < paraPhysVol->GetMultiplicity(); ++k) {
471 G4VPVParameterisation* pParam = paraPhysVol->GetParameterisation();
472 G4VSolid* pSolid = pParam->ComputeSolid(k, paraPhysVol);
473 pSolid->ComputeDimensions(pParam, k, paraPhysVol);
474 G4Material* pMat = pParam->ComputeMaterial(k, paraPhysVol);
478 auto itv = localSolidMaterialStore.find(std::make_pair(pSolid, pMat));
479 if (itv == localSolidMaterialStore.end()) {
483 auto newName = localLV->GetName() +
"_" + std::to_string(k);
487 std::cout <<
" Going to create LV " << newName << std::endl;
490 auto newLV =
new G4LogicalVolume(pSolid, pMat, newName);
491 localSolidMaterialStore.insert(std::make_pair(std::make_pair(pSolid, pMat), newLV));
492 paramVolumes.emplace_back(newLV);
497 auto newName = localLV->GetName() +
"_" + std::to_string(k);
499 std::cout <<
" Skipping creating LV " << newName << std::endl;
501 paramVolumes.emplace_back(itv->second);
510 ImportDaughters(dLV);
516void Geant4GM::Factory::ImportPositions()
522 std::cout <<
"Import positions: " << std::endl;
525 for (
unsigned int i = 0; i < Volumes().size(); i++) {
532 std::cout << i <<
"th volume: " << lv->GetName() <<
" ";
534 std::cout <<
" lv: " << lv <<
" "
535 <<
" vgm: " << volume;
536 std::cout << std::endl;
539 for (
size_t id = 0;
id < lv->GetNoDaughters();
id++) {
541 G4VPhysicalVolume* dPV = lv->GetDaughter(
id);
542 G4LogicalVolume* dLV = dPV->GetLogicalVolume();
546 std::cout <<
" " <<
id <<
"th daughter pv = ";
547 if (Debug() > 1) std::cout << dPV <<
" ";
548 std::cout << dPV->GetName() <<
" lv = ";
549 if (Debug() > 1) std::cout << dLV <<
" ";
550 std::cout << dLV->GetName();
560 std::cout <<
" vgmPl = ";
561 if (Debug() > 1) std::cout << dPlacement <<
" ";
562 std::cout << dPlacement->
Name() <<
" vgmVol = ";
563 if (Debug() > 1) std::cout << dVolume <<
" ";
564 std::cout << dVolume->
Name() << std::endl;
571void Geant4GM::Factory::ImportPositions(G4LogicalVolume* lv)
578 std::cout <<
"ImportPositions for lv " << lv->GetName()
579 <<
" nofDaughters: " << lv->GetNoDaughters() << std::endl;
584 for (
size_t id = 0;
id < lv->GetNoDaughters();
id++) {
586 G4VPhysicalVolume* dPV = lv->GetDaughter(
id);
590 std::cout <<
id <<
"th daugher: " << dPV->GetName() << std::endl;
604 G4LogicalVolume* dLV = dPV->GetLogicalVolume();
611 ImportPositions(dLV);
629 VGM::IVolume* motherVolume, G4PhysicalVolumesPair pvPair)
631 G4ReflectionFactory* g4ReflectionFactory = G4ReflectionFactory::Instance();
634 G4VPhysicalVolume* pv1 = pvPair.first;
635 G4LogicalVolume* lv1 = pv1->GetLogicalVolume();
641 ImportDaughters(lv1);
642 ImportPositions(lv1);
648 G4VPhysicalVolume* pv2 = pvPair.second;
650 G4LogicalVolume* g4MotherLV =
655 G4LogicalVolume* mlv2 = 0;
656 if (g4ReflectionFactory->IsReflected(g4MotherLV))
657 mlv2 = g4ReflectionFactory->GetConstituentLV(g4MotherLV);
658 if (g4ReflectionFactory->IsConstituent(g4MotherLV))
659 mlv2 = g4ReflectionFactory->GetReflectedLV(g4MotherLV);
662 std::cerr <<
" Geant4GM::Factory::CreatePlacement: " << std::endl;
663 std::cerr <<
" Misundersood G4ReflectionFactory behavior "
665 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
672 std::cerr <<
" Geant4GM::Factory::CreatePlacement: " << std::endl;
673 std::cerr <<
" Missing mapping of existing LV to VGM" << std::endl;
674 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
678 G4LogicalVolume* lv2 = pv2->GetLogicalVolume();
684 ImportDaughters(lv2);
685 ImportPositions(lv2);
701bool Geant4GM::Factory::SwitchSolid(
702 VGM::IVolume* volume, G4LogicalVolume* g4LV, G4LogicalVolume* g4MotherLV)
710 if (g4LV->GetSolid()->GetEntityType() ==
"G4Cons" &&
711 g4MotherLV->GetSolid()->GetEntityType() ==
"G4Polycone") {
713 G4Cons* cons =
static_cast<G4Cons*
>(g4LV->GetSolid());
720 if (g4LV->GetSolid()->GetEntityType() ==
"G4Tubs" &&
721 g4MotherLV->GetSolid()->GetEntityType() ==
"G4Polycone") {
723 G4Tubs* tubs =
static_cast<G4Tubs*
>(g4LV->GetSolid());
738 G4VPhysicalVolume* worldPV =
static_cast<G4VPhysicalVolume*
>(topVolume);
740 return Import(worldPV);
744bool Geant4GM::Factory::ImportSolid(
void* solid)
748 G4VSolid* g4Solid =
static_cast<G4VSolid*
>(solid);
750 return Import(g4Solid);
780 const std::string& name,
double hz, std::vector<VGM::TwoVector> vertices)
784 std::cerr <<
"*** Error: Cannot create Twisted Arb8 solid in Geant4 ***"
787 std::cerr <<
"*** Warning: Using a box instead ***" << std::endl;
791 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
801 const std::string& name,
double hx,
double hy,
double hz)
809 double rout1,
double rin2,
double rout2,
double hz,
double sphi,
double dphi)
813 new Geant4GM::Cons(name, rin1, rout1, rin2, rout2, hz, sphi, dphi));
818 double rout,
double hz,
double sphi,
double dphi,
double nxlow,
double nylow,
819 double nzlow,
double nxhigh,
double nyhigh,
double nzhigh)
822 return Register(
new Geant4GM::Ctubs(name, rin, rout, hz, sphi, dphi, nxlow,
823 nylow, nzlow, nxhigh, nyhigh, nzhigh));
828 double dx,
double dy,
double dz,
double zBottomCut,
double zTopCut)
837 const std::string& name,
double dx,
double dy,
double hz)
845 double r2,
double stereo1,
double stereo2,
double hz)
848 return Register(
new Geant4GM::Hype(name, r1, r2, stereo1, stereo2, hz));
853 double dy,
double dz,
double alpha,
double theta,
double phi)
856 return Register(
new Geant4GM::Para(name, dx, dy, dz, alpha, theta, phi));
861 const std::string& name,
double r1,
double r2,
double hz)
869 double sphi,
double dphi,
int nofZplanes,
double* z,
double* rin,
879 double sphi,
double dphi,
int nofSides,
int nofZplanes,
double* z,
880 double* rin,
double* rout)
884 name, sphi, dphi, nofSides, nofZplanes, z, rin, rout));
889 double rin,
double rout,
double sphi,
double dphi,
double stheta,
899 const std::string& name, std::vector<std::vector<VGM::ThreeVector> > facets)
907 double rout,
double rax,
double sphi,
double dphi)
910 return Register(
new Geant4GM::Torus(name, rin, rout, rax, sphi, dphi));
915 double theta,
double phi,
double dy1,
double dx1,
double dx2,
double alpha1,
916 double dy2,
double dx3,
double dx4,
double alpha2)
920 name, hz, theta, phi, dy1, dx1, dx2, alpha1, dy2, dx3, dx4, alpha2));
925 double hx2,
double hy1,
double hy2,
double hz)
928 return Register(
new Geant4GM::Trd(name, hx1, hx2, hy1, hy2, hz));
933 double rout,
double hz,
double sphi,
double dphi)
936 return Register(
new Geant4GM::Tubs(name, rin, rout, hz, sphi, dphi));
941 std::vector<VGM::TwoVector> polygon,
942 std::vector<std::vector<double> > zsections)
954 std::cerr <<
" Geant4GM::Factory::CreateIntersectionSolid:" << std::endl;
955 std::cerr <<
" Reflection in Boolean solid not supported in Geant4."
957 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
973 std::cerr <<
" Geant4GM::Factory::CreateSubtractionSolid:" << std::endl;
974 std::cerr <<
" Reflection in Boolean solid not supported in Geant4."
976 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
991 std::cerr <<
" Geant4GM::Factory::CreateUnionSolid:" << std::endl;
992 std::cerr <<
" Reflection in Boolean solid not supported in Geant4."
994 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
1009 std::cerr <<
" Geant4GM::Factory::CreateDisplacedSolid:" << std::endl;
1010 std::cerr <<
" Reflection in Displaced solid not supported in Geant4."
1012 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
1027 std::cerr <<
" Geant4GM::Factory::CreateDisplacedSolid:" << std::endl;
1028 std::cerr <<
" Reflection in ScaledSolid solid not supported in Geant4."
1030 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
1040 std::vector<VGM::ISolid*> constituents,
1041 std::vector<VGM::Transform> transforms)
1044 std::vector<G4Transform3D> g4Transforms;
1045 for (
auto transform : transforms) {
1047 std::cerr <<
" Geant4GM::Factory::CreateMultiUnion:" << std::endl;
1049 <<
" Reflection in MultiUnion solid is not supported in Geant4."
1051 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
1062 const std::string& name,
VGM::ISolid* solid,
const std::string& mediumName)
1068 std::cerr <<
"Geant4GM::Factory::CreateVolume: " << std::endl;
1069 std::cerr <<
" Medium " << mediumName <<
" not found." << std::endl;
1074 std::cerr <<
"Geant4GM::Factory::CreateVolume: " << std::endl;
1075 std::cerr <<
" No material is defined for medium " << mediumName
1079 std::string materialName = material->
Name();
1084 VolumeStore().push_back(volume);
1103 G4LogicalVolume* g4MotherLV =
1108 G4ReflectionFactory* g4ReflectionFactory = G4ReflectionFactory::Instance();
1110 G4PhysicalVolumesPair pvPair =
1112 g4MotherLV,
false, copyNo, fgSurfCheck);
1115 VGM::IPlacement* placement1 = ImportPVPair(volume, motherVolume, pvPair);
1118 if (!motherVolume) {
1122 std::cerr <<
" Geant4GM::Factory::CreatePlacement:" << std::endl;
1123 std::cerr <<
" Top volume defined twice!" << std::endl;
1124 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
1136 VGM::Axis axis,
int nofItems,
double width,
double offset,
double halfGap)
1141 if (!motherVolume) {
1142 std::cerr <<
"Geant4GM::Factory::CreateMultiplePlacement: "
1143 <<
" Mother volume not defined!" << std::endl;
1144 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
1151 G4LogicalVolume* g4MotherLV =
1158 if (solidType != motherSolidType) {
1159 bool result = SwitchSolid(volume, g4LV, g4MotherLV);
1161 std::cerr <<
" Geant4GM::Factory::CreateMultiplePlacement: "
1163 <<
" Different solid types in volume and mother!"
1165 <<
" volume: " << volume->
Name() <<
" "
1167 <<
" mother: " << motherVolume->
Name() <<
" "
1169 <<
"*** Error: Aborting execution ***" << std::endl;
1179 if (axis ==
VGM::kPhi && offset + nofItems * width > 2 * CLHEP::pi)
1180 offset = offset - 2 * CLHEP::pi;
1183 G4PVDivisionFactory::GetInstance();
1186 G4PhysicalVolumesPair pvPair;
1187 if (halfGap != 0.) {
1188 G4VPhysicalVolume* replicatedSlice =
1189 new G4ReplicatedSlice(name, g4LV, g4MotherLV,
1191 pvPair.first = replicatedSlice;
1197 G4ReflectionFactory* g4ReflectionFactory = G4ReflectionFactory::Instance();
1200 pvPair = g4ReflectionFactory->Divide(name, g4LV, g4MotherLV,
1205 VGM::IPlacement* placement1 = ImportPVPair(volume, motherVolume, pvPair);
1214 const std::vector<VGM::Transform>& transforms,
1215 const std::vector<VGM::IVolume*>& volumes)
1218 bool failure =
false;
1219 std::string failureMessage;
1222 if (!motherVolume) {
1223 failureMessage =
" Mother volume not defined!";
1228 if (transforms.size() != volumes.size()) {
1229 failureMessage =
" Transformations and Volumes vector sizes cannot differ!";
1234 std::cerr <<
" Geant4GM::Factory::CreateParameterisedPlacement:"
1235 << std::endl << failureMessage << std::endl;
1236 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
1240 for (
size_t i = 0; i < transforms.size(); ++i) {
1241 CreatePlacement(name, i, volumes[i], motherVolume, transforms[i]);
1285 std::cout <<
"Geant4GM::Factory::Import started ...";
1286 if (Debug() > 1) std::cout << worldPV;
1287 std::cout << std::endl;
1292 SetSingleMode(
false);
1299 G4LogicalVolume* worldLV = worldPV->GetLogicalVolume();
1305 ImportDaughters(worldLV);
1312 std::cout << std::endl;
1323 std::cout <<
"Geant4GM::Factory::Import finished." << std::endl;
1337 std::cout <<
"Geant4GM::Factory::Import of one solid started ...";
1338 if (Debug() > 1) std::cout << solid;
1339 std::cout << std::endl;
1344 SolidStore().clear();
1348 SetSingleMode(
true);
1351 fSolid = ImportSolid(solid);
1355 std::cout <<
"Geant4GM::Factory::Import of one solid finished."
1359 return (fSolid != 0);
virtual const VGM::IMedium * Medium(const std::string &name) const
Return medium specified by name.
static double Length()
Return CLHEP default length unit in VGM units.
static double AxisUnit(VGM::Axis axis)
Convert CLHEP default unit for given axis type in VGM units.
VGM implementation for Geant4 Arb8 solid, the shape is implemented using G4TessellatedSolid.
static bool IsTwisted(std::vector< VGM::TwoVector > vertices)
VGM implementation for Geant4 Boolean solid.
static G4VSolid * GetConstituentSolid(int index, G4BooleanSolid *booleanSolid)
VGM implementation for Geant4 box solid.
VGM implementation for Geant4 cons solid.
VGM implementation for cut tubs solid in Geant4.
VGM implementation for Geant4 displaced solid.
VGM implementation for Geant4 ellipsoid solid.
VGM implementation for Geant4 elliptical tube solid.
VGM implementation for Geant4 xtru solid.
virtual VGM::ISolid * CreateTrap(const std::string &name, double hz, double theta, double phi, double dy1, double dx1, double dx2, double alpha1, double dy2, double dx3, double dx4, double alpha2)
Create the trap solid = general trapezoid ( Note that of the 11 parameters described below,...
virtual VGM::ISolid * CreateEllipsoid(const std::string &name, double dx, double dy, double dz, double zBottomCut, double zTopCut)
Create the ellipsoid solid.
virtual VGM::ISolid * CreateScaledSolid(const std::string &name, VGM::ISolid *solid, const VGM::Transform &transform)
Create scaled solid.
virtual VGM::ISolid * CreateBox(const std::string &name, double hx, double hy, double hz)
Create the box solid.
virtual VGM::ISolid * CreateMultiUnion(const std::string &name, std::vector< VGM::ISolid * > constituents, std::vector< VGM::Transform > transforms)
Create the multi union of solids.
virtual VGM::IPlacement * CreateParameterisedPlacement(const std::string &name, VGM::IVolume *motherVolume, const std::vector< VGM::Transform > &transforms, const std::vector< VGM::IVolume * > &volumes)
Create the parameterised volume placement.
bool Import(G4VPhysicalVolume *topVolume)
virtual VGM::ISolid * SingleSolid() const
Return solid (if in one solid conversion mode)
virtual VGM::ISolid * CreateSphere(const std::string &name, double rin, double rout, double sphi, double dphi, double stheta, double dtheta)
Create the sphere solid = phi segment of a spherical shell.
virtual VGM::ISolid * CreateEllipticalTube(const std::string &name, double dx, double dy, double hz)
Create the elliptical tube solid.
virtual VGM::ISolid * CreateTorus(const std::string &name, double rin, double rout, double rax, double sphi, double dphi)
Create the torus solid = phi segment of a torus.
virtual VGM::ISolid * CreateExtrudedSolid(const std::string &name, std::vector< VGM::TwoVector > polygon, std::vector< std::vector< double > > zsections)
Create the extruded solid.
virtual VGM::ISolid * CreateArb8(const std::string &name, double hz, std::vector< VGM::TwoVector > vertices)
Create the arbitrary trapezoid with 8 vertices standing on two paralel planes perpendicular to Z axis...
virtual VGM::ISolid * CreateTessellatedSolid(const std::string &name, std::vector< std::vector< VGM::ThreeVector > > facets)
Create tessellated solid = solid composed from triangular and rectangular facets.
virtual VGM::ISolid * CreateDisplacedSolid(const std::string &name, VGM::ISolid *solid, const VGM::Transform &transform)
Create displaced solid.
virtual VGM::ISolid * CreateHype(const std::string &name, double r1, double r2, double stereo1, double stereo2, double hz)
Create the hyperboloid solid.
virtual VGM::IPlacement * Top() const
Return the top volume placement.
virtual VGM::ISolid * CreatePolyhedra(const std::string &name, double sphi, double dphi, int nofSides, int nofZplanes, double *z, double *rin, double *rout)
Create the polyhedra solid = phi segment of a polyhedra (polygone)
virtual VGM::ISolid * CreatePara(const std::string &name, double dx, double dy, double dz, double alpha, double theta, double phi)
Create the para solid = parallelepiped.
virtual VGM::ISolid * CreateIntersectionSolid(const std::string &name, VGM::ISolid *solidA, VGM::ISolid *solidB, const VGM::Transform &transform)
Create the intersection of two solids.
virtual VGM::IPlacement * CreatePlacement(const std::string &name, int copyNo, VGM::IVolume *volume, VGM::IVolume *motherVolume, const VGM::Transform &transform)
Create the simple volume placement.
virtual VGM::ISolid * CreateCons(const std::string &name, double rin1, double rout1, double rin2, double rout2, double hz, double sphi, double dphi)
Create the cons solid = phi segment of a conical tube.
static bool GetSurfCheck()
virtual VGM::ISolid * CreateTrd(const std::string &name, double hx1, double hx2, double hy1, double hy2, double hz)
Create the trd solid = a trapezoid with the x and y dimensions varying along z.
virtual VGM::ISolid * CreateSubtractionSolid(const std::string &name, VGM::ISolid *solidA, VGM::ISolid *solidB, const VGM::Transform &transform)
Create the subtraction of two solids.
virtual void SetSolid(VGM::ISolid *solid)
Set solid (in single mode)
virtual VGM::ISolid * CreateTubs(const std::string &name, double rin, double rout, double hz, double sphi, double dphi)
Create the trd solid = phi segment of a tube.
virtual VGM::IPlacement * CreateMultiplePlacement(const std::string &name, VGM::IVolume *volume, VGM::IVolume *motherVolume, VGM::Axis axis, int nofItems, double width, double offset, double halfGap)
Create the multiple volume placement.
virtual VGM::ISolid * CreateUnionSolid(const std::string &name, VGM::ISolid *solidA, VGM::ISolid *solidB, const VGM::Transform &transform)
Create the union of two solids.
virtual VGM::ISolid * CreateCtubs(const std::string &name, double rin, double rout, double hz, double sphi, double dphi, double nxlow, double nylow, double nzlow, double nxhigh, double nyhigh, double nzhigh)
Create the cut tubs solid = phi segment of a tube cut with two planes.
virtual VGM::IVolume * CreateVolume(const std::string &name, VGM::ISolid *solid, const std::string &mediumName)
Create the volume.
virtual VGM::ISolid * CreatePolycone(const std::string &name, double sphi, double dphi, int nofZplanes, double *z, double *rin, double *rout)
Create the polycone solid = phi segment of a polycone.
static void SetSurfCheck(bool surfCheck)
G4VPhysicalVolume * World() const
virtual VGM::ISolid * CreateParaboloid(const std::string &name, double r1, double r2, double hz)
Create the paraboloid solid.
VGM implementation for Geant4 hyperboloid solid.
VGM material factory for Geant4.
virtual bool Import()
Import native materials.
VGM implementation for Geant4 Boolean solid.
VGM implementation for Geant4 para solid.
VGM implementation for Geant4 paraboloid solid.
static PlacementMap * Instance()
void AddPlacement(VGM::IPlacement *, G4VPhysicalVolume *)
G4VPhysicalVolume * GetPlacement(VGM::IPlacement *iPlacement) const
VGM implementation for Geant4 positions of volumes.
static EAxis GetAxis(VGM::Axis axis)
VGM implementation for Geant4 polycone solid.
VGM implementation for Geant4 polyhedra solid.
VGM implementation for Geant4 Scaled solid.
G4VSolid * GetSolid(VGM::ISolid *iSolid) const
static SolidMap * Instance()
VGM implementation for Geant4 sphere solid.
VGM implementation for Geant4 tessellated solid.
VGM implementation for Geant4 torus solid.
VGM implementation for Geant4 trap solid.
VGM implementation for Geant4 trd solid.
VGM implementation for Geant4 tubs solid.
void AddParamVolume(G4LogicalVolume *, const std::vector< G4LogicalVolume * > &)
static VolumeMap * Instance()
G4LogicalVolume * GetVolume(VGM::IVolume *iVolume) const
VGM implementation for Geant4 volume.
The VGM interface to Boolean solids.
The VGM interface to materials.
virtual std::string Name() const =0
Return the name of this element.
The VGM interface to tracking medium.
virtual IMaterial * Material() const =0
Return its associated material.
The VGM interface to Boolean solids.
The VGM interface to positions of volumes.
virtual std::string Name() const =0
Return the name of this placement.
The VGM interface to solids.
virtual SolidType Type() const =0
Return the type of this solid.
The VGM interface to volumes.
virtual ISolid * Solid() const =0
Return the associated solid.
virtual std::string Name() const =0
Return the name of this volume.
virtual std::string MediumName() const =0
Return the name of the associated medium.
void DebugInfo()
Debug printing.
bool HasReflection(const HepGeom::Transform3D &transform)
VGM::Transform Transform(const CLHEP::HepRotation &rotation, const CLHEP::Hep3Vector &translation)
CLHEP::Hep3Vector Translation(const VGM::Transform &transform)
CLHEP::HepRotation Rotation(const VGM::Transform &transform)
HepGeom::Scale3D Scale(const VGM::Transform &transform)
VGM implementation for Geant4.
std::vector< double > Transform
std::string SolidTypeName(VGM::SolidType typeId)
std::vector< IVolume * > VolumeStore
std::vector< ISolid * > SolidStore