|Message: Re: Retrieve physical volumes when a G4AssemblyVolume is used||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
G4AssemblyVolume keeps track of all the volumes it has created for each imprint made. You can choose the starting index for each physical volume copy so you know the mother logical volume where the assembly imprint has been made and you know the starting index for each physical volume copy.
Having this information you can retrieve from a logical volume instance any daughter physical volume copy it contains by index using call to
G4VPhysicalVolume* GetDaughter(const G4int i) const
G4AssemblyVoume creates PV copies in the order they have been added into the assembly instance so you can guess from that which one has the particular index.
There is one caveat however. You have to remeber the starting index for each imprint you have made unless you use the same starting index for each imprint. Pay also your attention when making multiple imprints inside the same mother volume as all physical volume copies share the same index sequence, e.g. using the same starting index you end up having identical copies with the same index but they have different names (automatically generated by MakeImprint(...) methods.
Basically follow 2 rules:
1. If you make single imprints in different mother volumes remember each time the starting index which if set to 0 means that if there are no daughter volumes, start from 0 and if it contains already some daughter volumes count them first and use the number+1 as the starting index.
2. If you make imprints inside the same mother volume then make sure you either use default, e.g. starting index 0 for each imprint or you provide your starting index and you thus steer PV creation.
In both cases I would check first the current number of PVs inside the mother volume so I can steer or remember the starting index.
In case of doubts, plese see the G4AssemblyVolume.cc code at:
|Inline Depth:||Outline Depth:||Add message:|