DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
RZBuilder Class Referencefinal

#include <RZBuilder.hh>

Collaboration diagram for RZBuilder:
[legend]

Public Member Functions

virtual RZBuilderPtr SetNumSides (G4double N)
 
RZBuilderPtr AddPlane (const RZPlane &plane)
 
RZBuilderPtr AddPlane (G4double IR, G4double OR, G4double z)
 
RZBuilderPtr AddPlane (G4double unit, G4double IR, G4double OR, G4double z)
 
RZBuilderPtr AddPlanes (const std::vector< RZPlane > &planes)
 
RZBuilderPtr AddPlanes (const std::vector< RZPlaneUnitless > &planes)
 
RZBuilderPtr AddPlanes (G4double unit, const std::vector< RZPlaneUnitless > &planes)
 
RZBuilderPtr ReflectZSolidConfig ()
 
RZBuilderPtr FillSolidConfig ()
 
G4VPhysicalVolume * GetPlacement () final
 
DerivedPtr MakePlacement ()
 
DerivedPtr PlaceAndFork ()
 
G4LogicalVolume * GetLogicalVolume () final
 
G4VSolid * GetBaseSolid () final
 
G4VSolid * GetFinalSolid () final
 
DerivedPtr MakeLogicalVolume (G4Material *material=nullptr, G4String name=std::string())
 
DerivedPtr MakeSolid ()
 
DerivedPtr SetName (const G4String &name)
 
DerivedPtr AddUnion (const BuilderView &other, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr)
 
DerivedPtr AddSubtraction (const BuilderView &other, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr)
 
DerivedPtr AddIntersection (const BuilderView &other, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr)
 
DerivedPtr AddBoolean (const BuilderView &other, bool is_subtraction=false, bool is_intersection=false, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr)
 
DerivedPtr SetMaterial (G4Material *material)
 
DerivedPtr SetColor (double r=0.5, double g=0.5, double b=0.5, double alpha=1.0)
 
DerivedPtr SetColor (const G4Colour &color)
 
DerivedPtr SetAlpha (G4double alpha)
 
DerivedPtr ForceSolid (bool x=true)
 
DerivedPtr SetVisibility (bool x=true)
 
DerivedPtr SetLogicalVolume (G4LogicalVolume *logical_volume)
 
DerivedPtr SetBooleanName (const G4String &name)
 
DerivedPtr SetPhysRotation (const G4RotationMatrix &rot)
 
DerivedPtr StackPhysRotation (const G4RotationMatrix &stacked_rot)
 
DerivedPtr SetPhysOffset (const Unit3Vec &offset={CLHEP::mm, 0, 0, 0})
 
DerivedPtr StackPhysOffset (const Unit3Vec &offset={CLHEP::mm, 0, 0, 0})
 
DerivedPtr SetPhysTransform (const UnitlessG4Transform3D &new_transform)
 
DerivedPtr StackPhysTransform (const UnitlessG4Transform3D &new_transform)
 
G4Transform3D GetPhysTransform () const final
 
DerivedPtr OverridePlacementName (const G4String &pName)
 
DerivedPtr SetCopyNo (G4int pCopyNo)
 
DerivedPtr SetSurfaceCheck (G4bool pSurfChk)
 
DerivedPtr SetMother (const BuilderView &mother)
 
DerivedPtr SetAutoPlacementNaming (bool set)
 
DerivedPtr SetAutoCopyNo (bool set)
 
DerivedPtr ReflectZFinalSolid ()
 
DerivedPtr ReflectZBaseSolid ()
 
virtual DerivedPtr ForkAndReset (const G4String &new_name) const
 
DerivedPtr ForkForFinalSolid (const G4String &new_name)
 
DerivedPtr ForkForLogicalVolume (const G4String &new_name)
 
DerivedPtr ForkForPlacement (std::optional< int > copy_no=std::nullopt, const G4String &name_override="", bool parent_name_was_set=false)
 
DerivedPtr CopyPlacementConfigsFrom (const BuilderView &other)
 
DerivedPtr CopyVolumeConfigsFrom (const BuilderView &other)
 
DerivedPtr SetDefaultUnit (G4double unit)
 
G4double GetEffectiveDefaultUnit () const
 
DerivedPtr AddTo (BuilderViewList &list) const
 
DerivedPtr AddTo (StructureViewList &list) const
 
DerivedPtr AddTo (AssemblyPtr &assembly) const
 
BuilderView ToBuilderView () const override
 
StructureView ToStructureView () const override
 
G4String GetBuilderName () const
 
std::shared_ptr< T > shared_from_this ()
 
std::shared_ptr< const T > shared_from_this () const
 
void set_shared_from_this_enabled (bool enabled)
 

Protected Member Functions

G4VSolid * SolidConstructor (const G4String &name) override
 
SharedPtr< IStructureBuilderclone_impl () const override
 

Protected Attributes

std::atomic< bool > is_enabled_ {true}
 

Friends

class VolumeBuilderReference
 
class VolumeBuilder< RZBuilder >
 
template<typename T >
class i_shared_ptr
 
RZBuilderPtr CreatePolyhedraBuilder (const G4String &name, int sides, G4double phi_start, G4double phi_tot)
 
RZBuilderPtr CreatePolyconeBuilder (const G4String &name, G4double phi_start, G4double phi_tot)
 
RZBuilderPtr CreateCylinderBuilder (G4double unit, const G4String &name, G4double endz, G4double height, G4double OR, G4double IR)
 
RZBuilderPtr CreateCylinderBuilder (const G4String &name, G4double endz, G4double height, G4double OR, G4double IR)
 

Detailed Description

Builder class for RZ mult-plane defined solids.

Use the CreateXXX() factory methods to create the buiders.

See also
VolumeBuilder for inherited methods.

Definition at line 132 of file RZBuilder.hh.

Member Function Documentation

◆ AddBoolean()

VolumeBuilder< RZBuilder >::DerivedPtr AddBoolean ( const BuilderView other,
bool  is_subtraction = false,
bool  is_intersection = false,
const Unit3Vec offset = {CLHEP::mm, 0, 0, 0},
G4RotationMatrix *  rotation = nullptr 
)
inherited

Add a boolean operation.

This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.

Parameters
otherA VolumeBuilder, G4VSolid, or anything constructable by a VolumeReferencePtr
is_subtractiontrue for subtraction, false for union
is_intersectiontrue for intersection, false for union
offsetOffset applied to solid
rotationApplied to solid
Returns
The builder

Definition at line 218 of file VolumeBuilder.hpp.

283 {
284 auto offset = ProvisionUnits(new_offset);
285
286 if (other) {
287 boolean_configs_->booleans.emplace_back(
288 BooleanSolid{other, is_subtraction, is_intersection, offset, rotation});
289 } else {
290 throw std::runtime_error("Error in AddBoolean() "
291 "for builder named: \"" + builder_configs_->name + "\"\n"
292 " volume is invalid (null)");
293 }
294 return this->shared_from_this();
295 }

◆ AddIntersection()

VolumeBuilder< RZBuilder >::DerivedPtr AddIntersection ( const BuilderView other,
const Unit3Vec offset = {CLHEP::mm, 0, 0, 0},
G4RotationMatrix *  rotation = nullptr 
)
inherited

Define combination another volume with present one, This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.

Parameters
otherA VolumeBuilder, G4VSolid, or anything constructable by a VolumeReferencePtr
offsetOffset applied to solid
rotationApplied to solid
Returns
The builder

Definition at line 202 of file VolumeBuilder.hpp.

268 {
269 if (other) {
270 bool is_subtraction = false;
271 bool is_intersection = true;
272 AddBoolean(other, is_subtraction, is_intersection, new_offset, rotation);
273 } else {
274 throw std::runtime_error("Error in AddBoolean() "
275 "for builder named: \"" + builder_configs_->name + "\"\n"
276 " volume is invalid (null)");
277 }
278 return this->shared_from_this();
279 }
DerivedPtr AddBoolean(const BuilderView &other, bool is_subtraction=false, bool is_intersection=false, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr)
Add a boolean operation.

◆ AddSubtraction()

VolumeBuilder< RZBuilder >::DerivedPtr AddSubtraction ( const BuilderView other,
const Unit3Vec offset = {CLHEP::mm, 0, 0, 0},
G4RotationMatrix *  rotation = nullptr 
)
inherited

Define combination another volume with present one, This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.

Parameters
otherA VolumeBuilder, G4VSolid, or anything constructable by a VolumeReferencePtr
offsetOffset applied to solid
rotationApplied to solid
Returns
The builder

Definition at line 198 of file VolumeBuilder.hpp.

253 {
254 if (other) {
255 bool is_subtraction = true;
256 bool is_intersection = false;
257 AddBoolean(other, is_subtraction, is_intersection, new_offset, rotation);
258 } else {
259 throw std::runtime_error("Error in AddBoolean(): "
260 "for builder named: \"" + builder_configs_->name + "\"\n"
261 "volume is invalid (null)");
262 }
263 return this->shared_from_this();
264 }

◆ AddTo() [1/3]

VolumeBuilder< RZBuilder >::DerivedPtr AddTo ( AssemblyPtr assembly) const
inherited

Add the builder an assembly geometrically joined manipulation.

Parameters
assemblyThe assembly to add to.
Returns
the builder

Definition at line 625 of file VolumeBuilder.hpp.

1019 {
1020 assembly->AddStructure(this->ToStructureView());
1021 auto retval = shared_mutable_this(this);
1022 return retval;
1023 }
std::shared_ptr< T > shared_mutable_this(const std::enable_shared_from_this< T > *obj)

◆ AddTo() [2/3]

VolumeBuilder< RZBuilder >::DerivedPtr AddTo ( BuilderViewList list) const
inherited

Definition at line 607 of file VolumeBuilder.hpp.

1005 {
1006 list.emplace_back(this->ToBuilderView());
1007 auto retval = shared_mutable_this(this);
1008 return retval;
1009 }

◆ AddTo() [3/3]

VolumeBuilder< RZBuilder >::DerivedPtr AddTo ( StructureViewList list) const
inherited

Add the builder a list for group/batch manipulations.

Parameters
listThe list to add to.
Returns
the builder

Definition at line 616 of file VolumeBuilder.hpp.

1012 {
1013 list.emplace_back(this->ToStructureView());
1014 auto retval = shared_mutable_this(this);
1015 return retval;
1016 }

◆ AddUnion()

VolumeBuilder< RZBuilder >::DerivedPtr AddUnion ( const BuilderView other,
const Unit3Vec offset = {CLHEP::mm, 0, 0, 0},
G4RotationMatrix *  rotation = nullptr 
)
inherited

Define combination another volume with present one, This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.

Parameters
otherA VolumeBuilder, G4VSolid, or anything constructable by a VolumeReferencePtr
offsetOffset applied to solid
rotationApplied to solid
Returns
The builder

Definition at line 194 of file VolumeBuilder.hpp.

244 {
245 bool is_subtraction = false;
246 bool is_intersection = false;
247 AddBoolean(other, is_subtraction, is_intersection, new_offset, rotation);
248 return this->shared_from_this();
249 }

◆ clone_impl()

SharedPtr< IStructureBuilder > clone_impl ( ) const
overrideprotectedvirtualinherited

Implements IStructureBuilder.

Definition at line 644 of file VolumeBuilder.hpp.

997 {
998 const U &derived_ref = static_cast<const U &>(*this); // downcast
999 auto retval = new U(derived_ref); // copy
1000 auto shared_ptr = i_shared_ptr<U>(retval);
1001 return shared_mutable_this(retval); // wrap and return.
1002 }

◆ CopyPlacementConfigsFrom()

VolumeBuilder< RZBuilder >::DerivedPtr CopyPlacementConfigsFrom ( const BuilderView other)
inherited

This may help if reusing placement configs for a different shape.

Copies the placement configuration (rotation, translation, mother, etc.) from another builder. Does NOT copy any naming, as that would conflict. Also does NOT copy any products. Use CopyPlacement Builder for that. Names will derive from present object, or you can override with Setters as usual.

Parameters
otherThe builder instance to copy placement configuration from.
Returns
This builder for chaining.

Definition at line 560 of file VolumeBuilder.hpp.

775 {
776 this->placement_configs_ = other->placement_configs_;
777 // receiver is responsible for unique naming/numbering.
778 // we can't clobber auto-name/number incrementing from another config:
779 // Does not copy the solid/boolean, just to get configs ONLY
780 return this->shared_from_this();
781 }

◆ CopyVolumeConfigsFrom()

VolumeBuilder< RZBuilder >::DerivedPtr CopyVolumeConfigsFrom ( const BuilderView other)
inherited

Copies the LogicalVolume configuration (material, VisAttributes, etc.) from another builder.

This DOES NOT include copying any booleans. This is useful for setting up multiple placements with similar configurations.

Parameters
otherThe builder instance to copy placement configuration from.
Returns
This builder for chaining.

Definition at line 571 of file VolumeBuilder.hpp.

784 {
785 // Booleans are NOT considered as part of Volume Configs.
786 // We keep our booleans.
787 auto name = this->builder_configs_->name; // backup our name
788 auto booleans = this->boolean_configs_->booleans;
789 this->lv_configs_ = other->lv_configs_;
790 // restor name. This is easier than keeping name separately. :P
791 this->builder_configs_->name = name;
792 this->boolean_configs_->booleans = booleans; // restore ours.
793 return this->shared_from_this();
794 }

◆ ForceSolid()

VolumeBuilder< RZBuilder >::DerivedPtr ForceSolid ( bool  x = true)
inherited
Returns
The builder

Definition at line 263 of file VolumeBuilder.hpp.

436 {
437 lv_configs_->force_solid = x;
438 ApplyAttributes_();
439 return this->shared_from_this();
440 }

◆ ForkAndReset()

VolumeBuilder< RZBuilder >::DerivedPtr ForkAndReset ( const G4String &  new_name) const
virtualinherited

Copy a configured/unbuilt Builder, with a new name.

This is the most generic all-purpose copier, but can result in some duplication of constituent solids, etc.

Copies all configurations. You can modify and rebuild all products. Copying-Transformations are not remembered. Base implementation is in VolumeBuilder, but can be overridden for Solid-Builder specific needs.

Parameters
new_name
Returns

Definition at line 494 of file VolumeBuilder.hpp.

659 {
660 NoNameCheck(new_name, "CopySolidBuilder");
661 DerivedPtr copy = this->Clone();
662 copy->SetName(new_name); // Set base name for derived class
663 copy->SetBooleanName("");
664 return copy;
665 }

◆ ForkForFinalSolid()

VolumeBuilder< RZBuilder >::DerivedPtr ForkForFinalSolid ( const G4String &  new_name)
inherited

Calls MakeSolid() and copies builder with products cleared for further construction.

Configurations from ALL stages (including later) are kept.

Parameters
new_nameThe base name for the new builder's Geant products.
Returns
A shared pointer to the new builder instance.

Definition at line 505 of file VolumeBuilder.hpp.

668 {
669 NoNameCheck(new_name, "ForkForFinalSolid");
670 if (!solid_ptr_) {
671 MakeSolid();
672 }
673 DerivedPtr copy = this->Clone();
674 copy->SetName(new_name); // Set base name for derived class
675 copy->SetBooleanName("");
676 // all products are cleared by default, (re)build up to Solid
677 copy->solid_ptr_.Link(this->solid_ptr_);
678 return copy;
679 }

◆ ForkForLogicalVolume()

VolumeBuilder< RZBuilder >::DerivedPtr ForkForLogicalVolume ( const G4String &  new_name)
inherited

Makes final solid (including booleans) if unbuilt and copies builder with products cleared for further construction.

Configurations from ALL stages (including later) are kept.

This one seems pretty specific, but could be useful for extending a boolean build more easily possibly

Parameters
new_nameThe base name for the new builder's logical and physical volumes.
Returns
A shared pointer to the new builder instance.

Definition at line 520 of file VolumeBuilder.hpp.

682 {
683 NoNameCheck(new_name, "ForkForLogicalVolume");
684 if (!final_solid_ptr_ && placement_configs_->is_builder) {
685 [[maybe_unused]] auto discard = GetFinalSolid();
686 }
687 DerivedPtr copy = this->Clone();
688 copy->SetName(new_name); // Set base name for derived class
689 copy->SetBooleanName("");
690 // all products are cleared by default, (re)build up to Solid
691 if (solid_ptr_ && placement_configs_->is_builder) {
692 copy->solid_ptr_.Link(this->solid_ptr_);
693 }
694 if (final_solid_ptr_ && placement_configs_->is_builder) {
695 copy->final_solid_ptr_.Link(this->final_solid_ptr_);
696 }
697 return copy;
698 }
G4VSolid * GetFinalSolid() final
Gets a complete final built Solid, including configured Boolean operaions if any.

◆ ForkForPlacement()

VolumeBuilder< RZBuilder >::DerivedPtr ForkForPlacement ( std::optional< int >  copy_no = std::nullopt,
const G4String &  name_override = "",
bool  parent_name_was_set = false 
)
inherited

Calls MakeLogicalVolume() and creates a new builder instance with a copy of all placement-related configs.


This will be called automatically by consecutive calls to MakePlacement(). All physical volume and (future?) derived products are reset to be rebuilt. Copy_no and placement name can be auto incremented (number only by default) or overridden.

The copy_no will be incremented.

Parameters
copy_nono arguments or std::nullopt to leave as auto. Must set on every use to get manual numbering.
name_overrideAn optional name override for the physical volume. Leave blank to use auto controls instead.
Returns
A shared pointer to the new builder instance.

Definition at line 537 of file VolumeBuilder.hpp.

702 {
703 // really a clone of logical volume:
704 if (!logicvol_ptr_ && placement_configs_->is_builder) {
706 }
707 DerivedPtr copy = this->Clone();
708 copy->explicit_copyno_set_ = static_cast<bool>(copy_no);
709 copy->explicit_physical_copy_name_set_ = !name_override.empty() || parent_name_was_set;
710 copy->placement_name_override_ = name_override;
711 // register name and get provisional copy_no:
712 copy->placement_configs_->copy_no = PlacementNameRegistry::IncrementNameCount(
713 GetPlacementBaseName());
714 //Override if copy_no was passed:
715 copy->placement_configs_->copy_no = copy_no.value_or(copy->placement_configs_->copy_no);
716
717 // Restore logical_volume pointer and below
718 copy->solid_ptr_.Link(this->solid_ptr_);
719 copy->final_solid_ptr_.Link(this->final_solid_ptr_);
720 copy->logicvol_ptr_.Link(this->logicvol_ptr_);
721
722 return copy;
723 }
DerivedPtr MakeLogicalVolume(G4Material *material=nullptr, G4String name=std::string())
Basically never needed now.

◆ GetBaseSolid()

G4VSolid * GetBaseSolid ( )
finalvirtualinherited

You probably want GetSolid() instead!!! This Gets a built Solid, BUT NOT final Boolean.

Builds default if not built yet.

Even if you aren't doing boolean now, if you add it later, this method will miss it. GetFinalSolid() is more general.

Returns
Raw visitor pointer to the solid. (DON'T DELETE IT!)

Implements IVolumeBuilder.

Definition at line 135 of file VolumeBuilder.hpp.

165 {
166 if (!this->solid_ptr_) {
167 MakeSolid();
168 }
169 return solid_ptr_.get_mutable();
170 }
T * get_mutable() const
Definition Linkable.hh:287

◆ GetBuilderName()

G4String GetBuilderName ( ) const
inherited

Definition at line 637 of file VolumeBuilder.hpp.

973 {
974 return this->builder_configs_->name;
975 }

◆ GetEffectiveDefaultUnit()

G4double GetEffectiveDefaultUnit ( ) const
inherited

Get the builder default unit or global if not set.

Returns
The active default unit.

Definition at line 597 of file VolumeBuilder.hpp.

908 {
909 auto temp = builder_configs_.get();
910 auto local = temp->default_unit;
911 // auto local = builder_configs_->default_unit;
912 auto global = BuilderConfigs::global_default_unit;
913 G4double default_unit = local.value_or(global);
914 return default_unit;
915 }

◆ GetFinalSolid()

G4VSolid * GetFinalSolid ( )
finalvirtualinherited

Gets a complete final built Solid, including configured Boolean operaions if any.

Builds default if not built yet.

Returns
Raw visitor pointer to the solid. (DON'T DELETE IT!)

Implements IVolumeBuilder.

Definition at line 143 of file VolumeBuilder.hpp.

298 {
299 if (!final_solid_ptr_ && placement_configs_->is_builder) {
300 MakeFinalSolid(std::string("")); // checks are done in there.
301 }
302 // should probably have a check here, although it's a bug anyway if not built now.
303 return this->final_solid_ptr_;
304 }

◆ GetLogicalVolume()

G4LogicalVolume * GetLogicalVolume ( )
finalvirtualinherited

Gets a built LogicalVolume, builds default if not built yet.

Returns
Raw visitor pointer to the logical volume (DON'T DELETE IT!)

Implements IVolumeBuilder.

Definition at line 123 of file VolumeBuilder.hpp.

181 {
182 if (!logicvol_ptr_) {
183 BASE::MakeLogicalVolume();
184 }
185 return logicvol_ptr_.get_mutable();
186 }

◆ GetPhysTransform()

G4Transform3D GetPhysTransform ( ) const
inlinefinalvirtualinherited

A helper to get the Physical Volume transform with units applied This is built from rotation and translatin if they were provided, or from a transform if it was provided, with units applied as specified.

Basically allows you to get the unit-multiplied version for use in direct Geant calls.

Returns
The Physical volume G4Transform3D with units applied.

Implements IVolumeBuilder.

Definition at line 383 of file VolumeBuilder.hh.

383 {
384 return {placement_configs_->rotation, placement_configs_->translation};
385 }

◆ GetPlacement()

G4VPhysicalVolume * GetPlacement ( )
finalvirtualinherited

Gets the (last) placed physical volume.

Constructs it if not built yet. Unlike MakePlacement(), this will NOT auto-trigger consecutive placments from copied builders. But you can call it again after MakePlacement() to get those.

Returns
Raw visitor pointer to physical volume. (DON'T DELETE IT).

Implements IVolumeBuilder.

Definition at line 88 of file VolumeBuilder.hpp.

173 {
174 if (!this->placement_) {
175 BASE::MakePlacement();
176 }
177 return this->placement_.get_mutable();
178 }

◆ MakeLogicalVolume()

VolumeBuilder< RZBuilder >::DerivedPtr MakeLogicalVolume ( G4Material *  material = nullptr,
G4String  name = std::string() 
)
inherited

Basically never needed now.


Builds the logical volume and returns the builder. GetLogicalVolume(), or passing the builder to any consumer will trigger the build anyway.

Parameters
materialPointer to material to use.
nameOptional explicit name for logical volume. Normally already derived from builder/solid name.
Returns
This builder.

Definition at line 157 of file VolumeBuilder.hpp.

129 {
130 ValidateForVolumeBuild(STRINGIFY(BASE) "MakeLogicalVolume");
131 //if no volume was previously built, should be safe to reset material.
132 if (material) {
133 lv_configs_->material = material;
134 }
135 if (name.empty()) {
136 name = this->GetLogicVolName() + "_L";
137 }
138 // Implicit construction through
139 // ctor args..
140 logicvol_ptr_.ConstructAndLink(final_solid_ptr_,
141 lv_configs_->material,
142 name);
143
144 ApplyAttributes_();
145 return this->shared_from_this();
146 }
#define STRINGIFY(x)
#define BASE
void ConstructAndLink(Args &&... args)
Link and own a T and link to it.
Definition Linkable.hh:278

◆ MakePlacement()

VolumeBuilder< RZBuilder >::DerivedPtr MakePlacement ( )
inherited

Make a placed physical volume.

Retrieve it or make and retrieve with GetPlacement() Fails (throws) if already built. Make a copy first.

Returns
The builder

Definition at line 98 of file VolumeBuilder.hpp.

463 {
464 // the copy part comes from validate below, if we're already built:
465 ValidateForPVBuild(STRINGIFY(BASE) "MakePlacement");
466 // 1. Get the logical volume for *this* builder
467 auto *currentLogical = this->GetLogicalVolume();
468 if (!(explicit_physical_copy_name_set_
469 || explicit_copyno_set_
470 || placement_configs_->auto_copy_name
471 || placement_configs_->auto_copyno)
472 ) {
473 G4cout << "Warning: Placement Builder for " + builder_configs_->name +
474 " copied without setting name or copy number and auto naming and numbering have been disabled \n"
475 "Copy number auto-incrementing will be re-enabled \n"
476 " Use SetAutoCopyNo(true), SetAuCopyName(true), OverridePlacementName(\"name\"), SetCopyNo(num) \n"
477 " to pass a name or number to MakePlacement()" << G4endl;
478 placement_configs_->copy_no = PlacementNameRegistry::GetNameCount(
479 GetPlacementBaseName());
480 }
481
482 // 2. Resolve the Mother Logical Volume
483 G4LogicalVolume *effectiveMotherLogical = nullptr;
484
485 G4String base_name = this->GetPlacementBaseName();
486 G4String final_name;
487 if (placement_configs_->auto_copy_name) {
488 // auto naming incrementing
489 final_name = base_name + "_P" +
490 std::to_string(
491 PlacementNameRegistry::GetNameCount(GetPlacementBaseName()));
492 } else {
493 final_name = GetPlacementBaseName() + "_P";
494 }
495 // unless an override was set, then take it verbatim, user's blame :):
496 if (!placement_name_override_.empty()) {
497 final_name = placement_name_override_;
498 }
499
500 if (placement_configs_->mother == nullptr || !placement_configs_->mother->
502 // will lazay trigger mother build if needed
503 G4cout << "WARNING in MakePlacement of " + final_name +
504 ". No mother volume was set or constructable.\n"
505 "Defaulting to world volume" << G4endl;
506 }
507
508 if (placement_configs_->mother) {
509 effectiveMotherLogical = placement_configs_->mother->GetLogicalVolume();
510 } else {
511 effectiveMotherLogical = nullptr; // world placement
512 }
513
514 auto transform = G4Transform3D(placement_configs_->total_rotation,
515 placement_configs_->total_translation);
516 // 4. Create the G4PVPlacement
517 // placement is <G4VPhysicalVolume> and can construct itself:
518 placement_.LinkToRaw(new G4PVPlacement(
519 transform, // G4Transform3D transform
520 currentLogical, // pCurrentLogical
521 final_name, // pName
522 effectiveMotherLogical, // pMotherLogical
523 false, // many option, only false allowed (unless you remember Geant3 :))
524 placement_configs_->copy_no, // pCopyNo
525 placement_configs_->surface_check // pSurfChk
526 ));
527 if (!placement_) {
528 throw std::runtime_error(
529 "MakeLogicalPlacement failed "
530 "for builder named: \"" + builder_configs_->name + "\"\n"
531 " pointer is null after calling G4PVPlacement().");
532 }
533 return this->shared_from_this();
534 }
void LinkToRaw(T *ptr)
Link to an existing T object via pointer (non-owning)
Definition Linkable.hh:243
G4LogicalVolume * GetLogicalVolume() final
Gets a built LogicalVolume, builds default if not built yet.

◆ MakeSolid()

VolumeBuilder< RZBuilder >::DerivedPtr MakeSolid ( )
inherited

Make the G4VSolid.

Returns the builder. Use GetBaseSolid() to retrieve or make and retrieve it.

Returns
The builder

Definition at line 165 of file VolumeBuilder.hpp.

938 {
939 G4VSolid *solid;
940 G4String final_name = GetBuilderName();
941 if (builder_configs_->reflect_base_solid_z) {
942 solid = SolidConstructor(final_name + "_proto_solid");
943 solid = new G4ReflectedSolid(final_name, solid, G4ReflectZ3D(0));
944 } else {
945 solid = SolidConstructor(final_name);
946 }
947 solid_ptr_.LinkToRaw(solid);
948 return this->shared_from_this();
949 }
G4VSolid * SolidConstructor(const G4String &name) override=0
polymorphic access to solid construction

◆ OverridePlacementName()

VolumeBuilder< RZBuilder >::DerivedPtr OverridePlacementName ( const G4String &  pName)
inherited

Set the placement name for the volume.


Parameters
pNameName for the placement.
Returns
This builder for chaining.

Definition at line 394 of file VolumeBuilder.hpp.

622 {
623 explicit_physical_copy_name_set_ = static_cast<bool>(pName);
624 this->placement_name_override_ = pName;
625 return this->shared_from_this();
626 }

◆ PlaceAndFork()

DerivedPtr PlaceAndFork ( )
inlineinherited

An alias for MakePlacement and ForkForPlacement Used for one or many unaltered placments in sequence, usually with auto naming and/or numbering.

Returns
The builder

Definition at line 109 of file VolumeBuilder.hh.

109 {
110 this->MakePlacement();
111 auto clone = this->ForkForPlacement(); // default/preset options
112 return clone;
113 }
DerivedPtr MakePlacement()
Make a placed physical volume.
DerivedPtr ForkForPlacement(std::optional< int > copy_no=std::nullopt, const G4String &name_override="", bool parent_name_was_set=false)
Calls MakeLogicalVolume() and creates a new builder instance with a copy of all placement-related con...

◆ ReflectZBaseSolid()

VolumeBuilder< RZBuilder >::DerivedPtr ReflectZBaseSolid ( )
inherited

Configure base solid to be flipped BEFORE applying booleans.

See also
ReflectZFinalSolid() to flip entire solid with or without Booleans.
Returns
The same builder (allows chaining)

Definition at line 478 of file VolumeBuilder.hpp.

928 {
929 if (final_solid_ptr_) {
930 throw std::runtime_error("Error VolumeBuilder::ReflectZBaseSolid, \n"
931 "The base solid is already built. \n");
932 }
933 builder_configs_->reflect_base_solid_z = true;
934 return this->shared_from_this();
935 }

◆ ReflectZFinalSolid()

VolumeBuilder< RZBuilder >::DerivedPtr ReflectZFinalSolid ( )
inherited

Configure final solid to be flipped in z.

Definition at line 468 of file VolumeBuilder.hpp.

918 {
919 if (final_solid_ptr_) {
920 throw std::runtime_error("Error VolumeBuilder::ReflectZFinalSolid, \n"
921 "The final solid is already built. \n");
922 }
923 boolean_configs_->reflect_z = true;
924 return this->shared_from_this();
925 }

◆ set_shared_from_this_enabled()

template<typename T >
void set_shared_from_this_enabled ( bool  enabled)
inlineinherited

Definition at line 60 of file disableable_shared_from_this.hh.

60 {
61 is_enabled_ = enabled;
62 }

◆ SetAlpha()

VolumeBuilder< RZBuilder >::DerivedPtr SetAlpha ( G4double  alpha)
inherited
Parameters
alpha
Returns
The builder

Definition at line 256 of file VolumeBuilder.hpp.

422 {
423 lv_configs_->color.SetAlpha(alpha);
424 ApplyAttributes_();
425 return this->shared_from_this();
426 }

◆ SetAutoCopyNo()

VolumeBuilder< RZBuilder >::DerivedPtr SetAutoCopyNo ( bool  set)
inherited

Enable (disable for false) auto Physical Volume numbering, on by default.


Adds a copy number to every name. By default copy numbers auto increment. Or you can set explicit names and numbers in ClonePlacement.

Parameters
setTrue before setting.
Returns

Definition at line 451 of file VolumeBuilder.hpp.

736 {
737 placement_configs_->auto_copyno = set;
738 if (set) {
739 placement_configs_->auto_copy_name = false;
740 }
741 return this->shared_from_this();
742 }

◆ SetAutoPlacementNaming()

VolumeBuilder< RZBuilder >::DerivedPtr SetAutoPlacementNaming ( bool  set)
inherited

Enable auto Physical Volume naming.


Adds a copy number to every name. By default copy numbers auto increment.
This will turn that off. Both makes no sense.
Or you can set explicit names and numbers in ClonePlacement.

Parameters
setFalse before setting.
Returns

Definition at line 438 of file VolumeBuilder.hpp.

727 {
728 placement_configs_->auto_copy_name = set;
729 if (set) {
730 placement_configs_->auto_copyno = false;
731 }
732 return this->shared_from_this();
733 }

◆ SetBooleanName()

VolumeBuilder< RZBuilder >::DerivedPtr SetBooleanName ( const G4String &  name)
inherited

Pre-set base name for logical and physical volumes.

_L and _P will be appended, respectively.

If not set, the builder will take it from the builder name. But this is useful for unions where the starting solid name may be more specific.

Parameters
name

Definition at line 299 of file VolumeBuilder.hpp.

159 {
160 this->boolean_configs_->boolean_name = name;
161 return this->shared_from_this();
162 }

◆ SetColor() [1/2]

VolumeBuilder< RZBuilder >::DerivedPtr SetColor ( const G4Colour &  color)
inherited
Parameters
color
Returns
The builder

Definition at line 248 of file VolumeBuilder.hpp.

429 {
430 lv_configs_->color = color;
431 ApplyAttributes_();
432 return this->shared_from_this();
433 }

◆ SetColor() [2/2]

VolumeBuilder< RZBuilder >::DerivedPtr SetColor ( double  r = 0.5,
double  g = 0.5,
double  b = 0.5,
double  alpha = 1.0 
)
inherited
Returns
The builder

Definition at line 240 of file VolumeBuilder.hpp.

415 {
416 lv_configs_->color = G4Colour(r, g, b, alpha);
417 ApplyAttributes_();
418 return this->shared_from_this();
419 }

◆ SetCopyNo()

VolumeBuilder< RZBuilder >::DerivedPtr SetCopyNo ( G4int  pCopyNo)
inherited

Set the copy number for the placement.


Parameters
pCopyNoCopy number.
Returns
This builder for chaining.

Definition at line 403 of file VolumeBuilder.hpp.

630 {
631 explicit_copyno_set_ = static_cast<bool>(pCopyNo);
632 this->placement_configs_->copy_no = pCopyNo;
633 return this->shared_from_this();
634 }

◆ SetDefaultUnit()

VolumeBuilder< RZBuilder >::DerivedPtr SetDefaultUnit ( G4double  unit)
inherited

Set the per-Builder default unit for all later non-factory offsets.

Use DLG4::VolumeBuilders::SetGlobalDefaultUnit() to set a default for all builders, or fall back to the initial default of CLHEP::mm.

  • May not apply to values set before this is called.
  • Does not apply to factory units like CreateCenteredBoxBuilder();
    But should not be set and changed. Just use it once, early.
    Parameters
    unitThe unit to set, ex: CLHEP::mm
    Returns
    The builder (allows chaining)

Definition at line 590 of file VolumeBuilder.hpp.

902 {
903 this->builder_configs_->default_unit = unit;
904 return this->shared_from_this();
905 }

◆ SetLogicalVolume()

VolumeBuilder< RZBuilder >::DerivedPtr SetLogicalVolume ( G4LogicalVolume *  logical_volume)
inherited

Directly Provide a Logical Volume Instead of using the builder.

Parameters
logical_volume

Definition at line 288 of file VolumeBuilder.hpp.

192 {
193 SetLogicalVolume_impl(logical_volume);
194 return this->shared_from_this();
195 }

◆ SetMaterial()

VolumeBuilder< RZBuilder >::DerivedPtr SetMaterial ( G4Material *  material)
inherited

/**

Parameters
material
Returns
The builder

Definition at line 233 of file VolumeBuilder.hpp.

409 {
410 lv_configs_->material = material;
411 return this->shared_from_this();
412 }

◆ SetMother()

VolumeBuilder< RZBuilder >::DerivedPtr SetMother ( const BuilderView mother)
inherited

Set the mother volume with a builder, or G4VPhysicalVolume or G4VLogicalVolume through implicit conversion.


This does NOT immediately force a build the mother builder, just pre-sets the relationship.

Parameters
motherolumeReferencePtrparameter accepts a builder or a G4VSolid through implicit ctor
Returns
This builder for chaining.

Definition at line 425 of file VolumeBuilder.hpp.

645 {
646 if (!mother) {
647 throw std::runtime_error("Error in VolumeBuilder::SetMother,"
648 "for builder named: \"" + builder_configs_->name + "\"\n"
649 " no valid mother physical volume provided");
650 // We cannot actually fully check this yet because we allow this to be a forward association
651 // The logical volume is not required to be constructable before we make a placement.
652 }
653 this->placement_configs_->mother = mother;
654 return this->shared_from_this();
655 }

◆ SetName()

VolumeBuilder< RZBuilder >::DerivedPtr SetName ( const G4String &  name)
inherited

SetName Sets name used for solid and derived product names.

Parameters
nameThe name
Returns
The builder

Definition at line 172 of file VolumeBuilder.hpp.

403 {
404 this->builder_configs_->name = name;
405 return this->shared_from_this();
406 }

◆ SetPhysOffset()

VolumeBuilder< RZBuilder >::DerivedPtr SetPhysOffset ( const Unit3Vec offset = {CLHEP::mm, 0, 0, 0})
inherited

Set the translation vector for placement.

Using Set, rotation applies before translation, regardless of order set, just as in G4PVPlacement() You can pass (unit, x, y, z) or use the default unit with (x, y, z).

Examples: SetPhysOffset({CLHEP::cm, 1, 2, 3}) // 1cm, 2cm, 3cm SetPhysOffset({1, 2, 3}) // Uses default default unit (usually mm) SetDefaultUnit(CLHEP::cm); SetPhysOffset({1, 2, 3}) // 1cm, 2cm, 3cm SetDefaultUnit(1); SetPhysOffset({10*CLHEP::mm, 20*CLHEP::mm, 30*CLHEP::mm}) // Values already have units

Parameters
offsetTranslation vector. See method description for details.
Returns
This builder for chaining.

Definition at line 338 of file VolumeBuilder.hpp.

561 {
562 const auto &offset = ProvisionUnits(new_offset);
563 placement_configs_->translation = offset;
564 PropagateTransform();
565 return this->shared_from_this();
566 }

◆ SetPhysRotation()

VolumeBuilder< RZBuilder >::DerivedPtr SetPhysRotation ( const G4RotationMatrix &  rot)
inherited

Set the rotation matrix for placement.

Using Set, rotation applies before translation, regardless of order set, just as in G4PVPlacement()

Parameters
rotPointer to the rotation matrix.
Returns
This builder for chaining.

Definition at line 308 of file VolumeBuilder.hpp.

538 {
539 G4RotationMatrix nullrot;
540 this->placement_configs_->rotation = rot;
541 PropagateTransform();
542 return this->shared_from_this();
543 }

◆ SetPhysTransform()

VolumeBuilder< RZBuilder >::DerivedPtr SetPhysTransform ( const UnitlessG4Transform3D new_transform)
inherited

Set the G4Transform3D for placment The tranformation provided is meant to be UNITLESS unless you SetDefaultUnit(1).

Otherwise ex: SetDefaultUnit(CLHEP::cm) and proivde a UNITLESS transform. To supply units for each G4Tranform3D separately, just call SetDefaultUnit(unit) before each call. Will overwite/replace rotation and translation.

Parameters
new_transformTranslation vector.
Returns
This builder for chaining.

Definition at line 364 of file VolumeBuilder.hpp.

578 {
579 SetPhysRotation(new_transform.getRotation()); // gets a copy on stack
580 SetPhysOffset({GetEffectiveDefaultUnit(), new_transform.getTranslation()});
581 PropagateTransform();
582 return this->shared_from_this();
583 }
DerivedPtr SetPhysOffset(const Unit3Vec &offset={CLHEP::mm, 0, 0, 0})
Set the translation vector for placement.
DerivedPtr SetPhysRotation(const G4RotationMatrix &rot)
Set the rotation matrix for placement.
G4double GetEffectiveDefaultUnit() const
Get the builder default unit or global if not set.

◆ SetSurfaceCheck()

VolumeBuilder< RZBuilder >::DerivedPtr SetSurfaceCheck ( G4bool  pSurfChk)
inherited

Set the surface check flag for the placement.


Parameters
pSurfChkBoolean flag for surface check.
Returns
This builder for chaining.

Definition at line 411 of file VolumeBuilder.hpp.

638 {
639 this->placement_configs_->surface_check = pSurfChk;
640 return this->shared_from_this();
641 }

◆ SetVisibility()

VolumeBuilder< RZBuilder >::DerivedPtr SetVisibility ( bool  x = true)
inherited
Parameters
x
Returns
The builder

Definition at line 271 of file VolumeBuilder.hpp.

443 {
444 lv_configs_->is_visible = x;
445 ApplyAttributes_();
446 return this->shared_from_this();
447 }

◆ shared_from_this() [1/2]

template<typename T >
std::shared_ptr< T > shared_from_this ( )
inlineinherited

Definition at line 44 of file disableable_shared_from_this.hh.

44 {
45 if (is_enabled_) {
46 return std::enable_shared_from_this<T>::shared_from_this();
47 } else {
48 return nullptr;
49 }
50 }

◆ shared_from_this() [2/2]

template<typename T >
std::shared_ptr< const T > shared_from_this ( ) const
inlineinherited

Definition at line 52 of file disableable_shared_from_this.hh.

52 {
53 if (is_enabled_) {
54 return std::enable_shared_from_this<T>::shared_from_this();
55 } else {
56 return nullptr;
57 }
58 }

◆ SolidConstructor()

G4VSolid * SolidConstructor ( const G4String &  name)
inlineoverrideprotectedvirtual

The polymorphic Solid constructor.

Implements VolumeBuilder< RZBuilder >.

Definition at line 252 of file RZBuilder.hh.

252 {
253 return (this->*MakeSolidFunctionPtr_)(name);
254 }

◆ StackPhysOffset()

VolumeBuilder< RZBuilder >::DerivedPtr StackPhysOffset ( const Unit3Vec offset = {CLHEP::mm, 0, 0, 0})
inherited

Like SetPhysOffset but stacks with previous transformations in order applied.

Unlike with G4Transform multiplication, stacking is done in a way that allows mutiple objects to move together. The first transformations can set individual objects, and a uniform transformation can be applied to them all to create a rigid motion of the collection.

Parameters
offset
Returns
The builder

Definition at line 349 of file VolumeBuilder.hpp.

570 {
571 const auto &offset = ProvisionUnits(stacked_offset);
572 placement_configs_->translation += offset; // add translation
573 PropagateTransform();
574 return this->shared_from_this();
575 }

◆ StackPhysRotation()

VolumeBuilder< RZBuilder >::DerivedPtr StackPhysRotation ( const G4RotationMatrix &  stacked_rot)
inherited

Like SetPhysRotation but stacks with previous transformations in order applied.

Unlike with G4Transform multiplication, stacking is done in a way that allows mutiple objects to move together. The first transformations can set individual objects, and a uniform transformation can be applied to them all to create a rigid motion of the collection.

Parameters
stacked_rot
Returns
The builder

Definition at line 320 of file VolumeBuilder.hpp.

546 {
547 // some aliases
548 const auto &old_rot = placement_configs_->rotation;
549 const auto &old_trans = placement_configs_->translation;
550 // sanitize input
551 auto new_rot = rot * old_rot; // order matters.
552 auto new_trans = rot * old_trans;
553 this->placement_configs_->rotation = new_rot;
554 this->placement_configs_->translation = new_trans;
555 PropagateTransform();
556 return this->shared_from_this();
557 }

◆ StackPhysTransform()

VolumeBuilder< RZBuilder >::DerivedPtr StackPhysTransform ( const UnitlessG4Transform3D new_transform)
inherited

Like SetPhysTransform but stacks with previous transformations in order applied.

Parameters
new_transform
Returns
The builder

Definition at line 371 of file VolumeBuilder.hpp.

586 {
587 //order matters when stacking. Not when "setting"
588 StackPhysRotation(new_transform.getRotation()); // gets a copy on stack
589 StackPhysOffset({GetEffectiveDefaultUnit(), new_transform.getTranslation()});
590 PropagateTransform();
591 return this->shared_from_this();
592 }
DerivedPtr StackPhysOffset(const Unit3Vec &offset={CLHEP::mm, 0, 0, 0})
Like SetPhysOffset but stacks with previous transformations in order applied.
DerivedPtr StackPhysRotation(const G4RotationMatrix &stacked_rot)
Like SetPhysRotation but stacks with previous transformations in order applied.

◆ ToBuilderView()

BuilderView ToBuilderView ( ) const
overridevirtualinherited

Implements IStructureBuilder.

Definition at line 633 of file VolumeBuilder.hpp.

978 {
979 // calls the BuilderView copy/convert ctor::
980 // presently the i_shared converter only works with l-value.
981 std::shared_ptr<U> builder_std_ptr =
982 std::const_pointer_cast<U>(this->shared_from_this());
983 auto x = DerivedPtr(builder_std_ptr);
984 return BuilderView(x);
985 }
SharedPtr< VolumeBuilderReference > BuilderView
Common interface for all volume builder types.

◆ ToStructureView()

StructureView ToStructureView ( ) const
overridevirtualinherited

Implements IStructureBuilder.

Definition at line 635 of file VolumeBuilder.hpp.

988 {
989 // calls the structure view copy/convert ctor:
990 std::shared_ptr<U> builder_std_ptr =
991 std::const_pointer_cast<U>(this->shared_from_this());
992 auto x = DerivedPtr(builder_std_ptr);
993 return StructureView(x);
994 }
SharedPtr< StructureBuilderReference > StructureView
Common interface for all structure types.

Friends And Related Symbol Documentation

◆ CreateCylinderBuilder [1/2]

RZBuilderPtr CreateCylinderBuilder ( const G4String &  name,
G4double  endz,
G4double  height,
G4double  OR,
G4double  IR = 0 
)
friend

Create a simple cylinder builder using global default unit.

Parameters
nameName used to derive all product names.
endzThe z reference of one end (either one)
heightHeight, can be positive or negative (from z reference)
OROuter radius.
IROptional inner radius. Default=0
Returns
The builder. Set configurations and then call .MakeSolid() and .MakeLogicalVolume() on it. See VolumeBuilder for inherited public methods including Union/Subtraction.

Definition at line 60 of file RZBuilder.cc.

61 {
63 }
friend RZBuilderPtr CreateCylinderBuilder(G4double unit, const G4String &name, G4double endz, G4double height, G4double OR, G4double IR)
Create a simple cylinder builder.
Definition RZBuilder.cc:44

◆ CreateCylinderBuilder [2/2]

RZBuilderPtr CreateCylinderBuilder ( G4double  unit,
const G4String &  name,
G4double  endz,
G4double  height,
G4double  OR,
G4double  IR = 0 
)
friend

Create a simple cylinder builder.

Parameters
nameName used to derive all product names.
unitUnit applied to all values.
endzThe z reference of one end (either one)
heightHeight, can be positive or negative (from z reference)
OROuter radius.
IROptional inner radius. Default=0
Returns
The builder. Set configurations and then call .MakeSolid() and .MakeLogicalVolume() on it. See VolumeBuilder for inherited public methods including Union/Subtraction.

Definition at line 44 of file RZBuilder.cc.

45 {
46 // ReSharper disable once CppDFAMemoryLeak
47 auto object = RZBuilderPtr(new RZBuilder(name));
48 object->MakeSolidFunctionPtr_ = &RZBuilder::MakePolycone;
49 RZPlane plane;
50 plane.unit = unit;
51 plane.z = endz;
52 plane.IR = IR;
53 plane.OR = OR;
54 object->AddPlane(plane);
55 plane.z += h;
56 object->AddPlane(plane);
57 return RZBuilderPtr(object);
58 }
SharedPtr< RZBuilder > RZBuilderPtr
Definition RZBuilder.hh:68

◆ CreatePolyconeBuilder

RZBuilderPtr CreatePolyconeBuilder ( const G4String &  name,
G4double  phi_start = 0.,
G4double  phi_tot = 360 
)
friend

Create a builder for associated IR,OR,Z defined object.

Parameters
nameBase name to derive geometry object names from.
phi_startOptional Start angle
phi_totOptional Total degrees
sidesOptional number of sides, for CreatePoyhedra only, (can set it later, dflt = 4 )
Returns
The builder. Set configurations and then call .MakeSolid() and .MakeLogicalVolume() on it. See VolumeBuilder for inherited public methods including Union/Subtraction.

Definition at line 26 of file RZBuilder.cc.

26 {
27 // We could actually construct these as RZBuilderPtr without using new, vis i_shared_ptr constructor.
28 // But maybe we can unfriend i_shared_ptr in the future if we use new here, and avoid exposing
29 // a backdoor to the general ctor, which doesn't select a MakeSolidFunctionPtr.
30 // ReSharper disable once CppDFAMemoryLeak
31 auto object = RZBuilderPtr(new RZBuilder(name, phi_start, phi_tot, 0));
32 object->MakeSolidFunctionPtr_ = &RZBuilder::MakePolycone;
33 return RZBuilderPtr(object);
34 }

◆ CreatePolyhedraBuilder

RZBuilderPtr CreatePolyhedraBuilder ( const G4String &  name,
int  sides,
G4double  phi_start = 0.,
G4double  phi_tot = 360 
)
friend

Create a builder for associated IR,OR,Z defined object.

Parameters
nameBase name to derive geometry object names from.
phi_startOptional Start angle
phi_totOptional Total degrees
sidesOptional number of sides, for CreatePoyhedra only, (can set it later, dflt = 4 )
Returns
The builder. Set configurations and then call .MakeSolid() and .MakeLogicalVolume() on it. See VolumeBuilder for inherited public methods including Union/Subtraction.

Definition at line 36 of file RZBuilder.cc.

37 {
38 // ReSharper disable once CppDFAMemoryLeak
39 auto object = new RZBuilder(name, phi_start, phi_tot, sides);
40 object->MakeSolidFunctionPtr_ = &RZBuilder::MakePolyhedra;
41 return RZBuilderPtr(object);
42 }

◆ i_shared_ptr

template<typename T >
friend class i_shared_ptr
friend

Definition at line 138 of file RZBuilder.hh.

◆ VolumeBuilder< RZBuilder >

friend class VolumeBuilder< RZBuilder >
friend

Definition at line 135 of file RZBuilder.hh.

◆ VolumeBuilderReference

friend class VolumeBuilderReference
friend

Definition at line 135 of file RZBuilder.hh.

Member Data Documentation

◆ is_enabled_

template<typename T >
std::atomic<bool> is_enabled_ {true}
protectedinherited

Definition at line 37 of file disableable_shared_from_this.hh.

37{true};

The documentation for this class was generated from the following files: