How to produce many SolidVolume, G4LogicalVolume, G4VPhysicalVolume in a "for" loop?

How to produce many SolidVolume, G4LogicalVolume, G4VPhysicalVolume in a “for” loop in a projection?

Could you elaborate further on what your needs are? Do you need to place many objects, but they have differing sizes and materials? If so, a G4VPVParameterisation or G4VNestedParameterisation may be more appropriate than manually running a for loop.

Joseph

I wanted to spit a sphere volume into a few sphere shells for geometric splitting and Russian roulette, so radii of the spheres are different, in my opinion, it is convenient to run a for loop.

I’m not sure that I understand your question specifically. Is the difficulty you’re encountering with implementing a for loop? If so, your question might be better suited for a C++ forum.

In general, you will be able to create many G4VSolids, G4LogicalVolumes, and many G4VPhysicalVolumes in a for loop the same way that you create them outside of a for loop. You should parameterize the names of each object and the dimensions of the G4VSolids in terms of the parameter you are looping over in the for loop.

yes, Maybe, a C++ forum is more suited for my question.
thank you anyway!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.