Message: Re: Question about getcopyNo() and getcopyNumber() Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: Question about getcopyNo() and getcopyNumber() 

Forum: Event and Track Management
Re: Question Question about getcopyNo() and getcopyNumber() (Xiaosong Yan)
Date: 27 Nov, 2014
From: Gabriele Cosmo <Gabriele Cosmo>

Hi Xiaosong,

you should use GetCopyNumber() from the touchable, as explained in the
documentation.
GetCopyNo() from the physical-volume only applies for 'flat' geometries
composed only by G4PVPlacement volumes without multiple hierarchical
placements.

Cheers, Gabriele

----------------
On Thu, 20 Nov 2014 03:06:30 GMT, Xiaosong Yan wrote:
> Hello all:
>      I'm doing some simulation about an imaging system which consists of 20 stacks of 50-strip silicon detectors, and I want to calculate the energy spectra and count distribution in each strip.
>      In the detectorconstruction class, I define a layer silicon detector which consists of 50 strips and other insensitive region with the G4VPVParameterisation method, and then I use for loop to copy one layer for 20 times. I use sensitivedetector to extract information. I tried two methods to identify each strip of all 1000 strips by using the touchable:
> the first is like:
>     G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
>   G4TouchableHistory* theTouchable = (G4TouchableHistory*)(preStepPoint->GetTouchable());
> 
> G4VPhysicalVolume* thePhysical = theTouchable->GetVolume(); G4int copyNo
> = theTouchable->GetCopyNumber(); G4int mothercopyNo =
> theTouchable->GetCopyNumber(1);
> 
> and the second is like:
> 
>   G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
>   G4TouchableHistory* theTouchable = (G4TouchableHistory*)(preStepPoint->GetTouchable());
> 
> G4VPhysicalVolume* thePhysical = theTouchable->GetVolume(); G4int copyNo
> = theTouchable->GetVolume()->GetCopyNo(); G4int mothercopyNo =
> theTouchable->GetVolume(1)->GetCopyNo();
> 
> The only difference is just to use GetcopyNo() or GetcopyNumber(), but
> the result is greatly different, and I don't know which method is right.
> 
> Though it's mentioned in geant4 bookFAQ as:
> 
> G4Step* aStep = ..; G4StepPoint* preStepPoint =
> aStep->GetPreStepPoint(); G4TouchableHandle theTouchable =
> preStepPoint->GetTouchableHandle(); G4int copyNo =
> theTouchable->GetCopyNumber(); G4int motherCopyNo =
> theTouchable->GetCopyNumber(1); where Copyhere stays for any duplicated
> instance of a physical volume, either if it is a G4PVPlacement (multiple
> placements of the same logical volume) or a
> G4PVReplica/G4PVParameterised. The method GetCopyNo()is meant to return
> only the serial number of placements not duplicated in the geom-etry
> tree.
> 
> But I still don't understand the difference and which is the right one
> for my simulation. Would you please help me and also explain the
> difference to my?
> 
> Thank you so much.
> 
> Xiaosong Yan

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

1 Question: Re: Question about getcopyNo() and getcopyNumber()   (Xiaosong Yan - 28 Nov, 2014)
(_ More: Re: Question about getcopyNo() and getcopyNumber()   (Gabriele Cosmo - 02 Dec, 2014)
 Add Message Add Message
to: "Re: Question about getcopyNo() and getcopyNumber()"

 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 ]