Message: CopyNo using G4PVPlacement Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None CopyNo using G4PVPlacement 

Forum: Event and Track Management
Date: 22 Mar, 2016
From: <Nicolas78>

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

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

1 None: Re: CopyNo using G4PVPlacement   (Artem Zontikov - 22 Mar, 2016)
(_ None: Re: CopyNo using G4PVPlacement   (Nicolas78 - 22 Mar, 2016)
 Add Message Add Message
to: "CopyNo 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 ]