Message: Re: Can Copies of Physical Volume (G4PVPlacement) Have Different Dimensions? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Can Copies of Physical Volume (G4PVPlacement) Have Different Dimensions? 

Forum: Geometry
Re: Question Can Copies of Physical Volume (G4PVPlacement) Have Different Dimensions? (Emil Frlez)
Date: 24 Jan, 2011
From: Gabriele Cosmo <Gabriele Cosmo>

Hi Emil,

what you're doing is correct, you create a solid, a logical and a physical volume
for each wire. However, if you want to optimize the number of objects you
create, and define a single triplet of solid and volumes, you can make use
of parameterised volumes (G4PVParameterised instead of G4PVPlacement)
and define a simple parameterisation in place of the for-loop.
You can take a look at examples/novice/N02 which implements something
similar to what you need, i.e. a parameterisation in dimension and position
of the various volumes.

Cheers, Gabriele

----------------
On Sun, 23 Jan 2011 16:10:48 GMT, Emil Frlez wrote:
>  Hi -
> 
>  I want to define a set of thin parallel wires that make a grid on the face
>  of a disk-shaped detector.  
> 
>  I have created a single G4 Box (solid_z_upplane) and a single G4LogicalVolume 
>  (logic_z_upplane) in a loop and then placed parallel copies of that wire 
>  in my setup. But, is this legal? The length of the wires (rlenght) changes
>  inside the loop, so all the placed copies of the wire don't have identical dimensions.
>  I don't know enough of C++ to answer the question. The code compiles and runs OK.)
> 
>  Or do I, in this case have to create 32 different G4Boxes, 32
>  different G4LogicalVolumes and have just one copy of the each
>  placed in my setup?
> 
>  Below is the relevant snippet of the code:
> 
>  // Grid wires parallel to z axis, in y-z plane, UP detector
>  for (int i=0; i<31; i++) {
>      int j=i-15;
>      G4double rlength=sqrt(si_up_tot_rad*si_up_tot_rad-(4*j)*(4*j))*mm;  
>      solid_z_upplane = new G4Box("z_upplane",           //its name
>                                   width/2,height/2,rlength);   //its size
>      logic_z_upplane = new G4LogicalVolume(solid_z_upplane,  //its solid
>                                    AbsorberMaterial,          //its material
>                                    "z_upplane");              //its name      
>      physi_z_upplane = new G4PVPlacement(0,   //rotation                       G4ThreeVector(si_up_xoff-width/2,pitch*j,0),  // translation
>                                logic_z_upplane,            //its logical volume
>                                "z_upplane",               //its name
>                                logicWorld,                //its mother  volume
>                                false,                 //no boolean operation
>                                i);//copy number, Aluminum wire, y-z plane, along z
>    }
> 
>                                              Thanks, Emil

 Add Message Add Message
to: "Re: Can Copies of Physical Volume (G4PVPlacement) Have Different Dimensions?"

 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 ]