Message: Re: How does a step point see a replica? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: How does a step point see a replica? 

Forum: Geometry
Re: Question How does a step point see a replica? (William Donahue)
Date: 03 Jul, 2014
From: John Apostolakis <John Apostolakis>

On Jul 3, 2014, at 6:03 PM, William Donahue <> wrote:

> I am working on a code that uses a stepping action to check if a hit should be stored in my detector. my detector is represented as a replica
> inside my targetVolume
> If i ask the StepPoint for the physical volume pointer does it return the targetVolume pointer or a pointer to a particular replica?

A replica slices its mother (logical/physical) volume fully - there is no part left over which belongs to the mother volume.

So you should see a pointer to the (single) Replica volume.

You need to use the ReplicaNumber to recognise which one of them it represents.

( The same 'thing' is also called Copy Number in case of other types of volumes.  In case you see this term, in the case of Replicas read ReplicaNumber. ) 

I suggest to ask the TouchableHistory for the ReplicaNumber using its method.  This method is guaranteed to work now, and is more correct in case you do it at a different point of the simulation - e.g. if you were to store the Touchable Handle and extract the information later.   It also has the benefit of being more future proof in case of improvements, corrections etc.

( The alternative is to get the physical volume - which is a Replica - and ask that for its CopyNumber / Replica Number.  This is more fragile. )


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

1 None: Re: How does a step point see a replica?   (William Donahue - 03 Jul, 2014)
 Add Message Add Message
to: "Re: How does a step point see a replica?"

 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 ]