Message: Re: Copy number using G4PVPlacement Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: Copy number using G4PVPlacement 

Forum: Geometry
Re: None Copy number using G4PVPlacement
Date: 05 Apr, 2016
From: Gabriele Cosmo <Gabriele Cosmo>

You have a nested loop on rows and columns, but you're setting the copy
number only for rows (index 'i'), therefore the same copyNo is set for each
column... You should eventually use 'i+n' instead...

--------------
On Tue, 22 Mar 2016 10:39:00 GMT, Nicolas78 wrote:
> Hi everyone, I'm placing multiple copies of a certain volume using
> G4PVPlacement and more precisely, a double for loop to place them along
> X and Y axis to cover a surface.
> 
> Here's my code to make the placements:
> 
>     // Loop on all the lines
>     for(G4int i=0;i<100;i++)
>     {
>         G4double x=(i-50)*25*um;
>         // Loop on all the columns
>         for(G4int n=0;n<100;n++)
>         {
>             // We are at line i and column j -> case[i,j]
>             G4double y=(n-50)*25*um;
>             new G4PVPlacement(0,  //no rotation
>                               G4ThreeVector(x,y,0),  
>                               logiccell,  //its logical volume
>                               "cell",  //its name
>                               logicWorld,  //its mother  volume
>                               false,
>                               i
>                               );           //copy number
> Then I want to know the copy number of my volume when there is an energy deposit in it.
> 
> I'm using:
> 
>   const G4StepPoint* prePoint = step->GetPreStepPoint();
>   G4TouchableHandle theTouchable = prePoint->GetTouchableHandle();
>   G4int copyNo = theTouchable->GetCopyNumber();
> But when I use this method to get the copy number, it seems like I only get the copy number
> of my volume just in X axis (or Y) but not both at the same time. It is true that i'm placing 100
> cells in X axis and 100 others in Y axis so I have in total 10000 cells. I should get copy number
> from 0 to 10000 but I only get No from 0 to 100. I've tried to use depth level just like in
> replicas but it didn't work either.
> 
> Any suggestions ?
> 
> Thanks in advance ! Nicolas
> 

 Add Message Add Message
to: "Re: Copy number using G4PVPlacement"

 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 ]