Message: Re: Retrieve physical volumes when a G4AssemblyVolume is used Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Retrieve physical volumes when a G4AssemblyVolume is used 

Forum: Geometry
Re: Question Retrieve physical volumes when a G4AssemblyVolume is used (Enrico Farnea)
Date: 27 Jan, 2006
From: Radovan Chytracek <Radovan Chytracek>

Hi,

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:

http://www-geant4.kek.jp/lxr/source/geometry/volumes/src/G4AssemblyVolume.cc

Cheers

      Radovan

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

 Add Message Add Message
to: "Re: Retrieve physical volumes when a G4AssemblyVolume is used"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]