Message: Re: Parameterisation and CopyNo Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Parameterisation and CopyNo 

Forum: Geometry
Re: Question Parameterisation and CopyNo (Hanwook Bae)
Date: 12 Sep, 2017
From: John Apostolakis <John Apostolakis>

Dear Hanwook,

Your question and setup are clear.

The answer is simple: you can NOT decide what the first copy number in a 
parameterisation is.  They must be numbered from the lowest permitted 
value (0 or 1) to the copy number ( or max copy number -1 if 0 is first. )

But what you could do is use one parameterisation which describes both 
the upper and lower layer.  I can see two ways of doing this

1) By hand in code for a single parameterisation that handles both 
cases.  It would be less elegant in some ways - it would need to have 
something like "if" statements for all methods which depended on the layer.

2) A different solution would be to create a 'hierarchy' of 
parameterisations - one for the upper and one for the lower layer, and 
then create a composite parameterisation that only knows the number of 
copies in each one, and dispatches to the correct dependent 
parameterisation.   ( The composite would own the other two, and simply 
act as a switch between them.  )  This would make the code more elegant, 
but I am not sure whether there would be a performance penalty.  Likely 
some work would be needed (with templates) to avoid virtual function 
calls, in order to ensure that persformance is not lost.

I think and hope that this clarifies how you should be able to create a 
working program for your setup.

Best regards,
John Apostolakis

On 11.09.17 17:37, Hanwook Bae wrote:
> *** Discussion title: Geometry
>
> Hello, I am trying to use the parameterization class to make my detector
> in the Geant4 framework.
>
> In detail, The detector is consisted of with a number of the same
> geometry and has a multi-layered structure.
>
> However, the bottom layer has different structure slightly, so I divided
> the detector into two parts is that the bottom part and upper one.
>
> The problem is that a sensitive detector that I am using can distinguish
> the geometries only by their copy number and I can't modify the SD.
>
> So, I would like to modify a copy number of the upper parameterization
> volume so that a copy number of the first volume in the upper part leads
> to the last number of the lower one.
>
> Then I googled a way to modify a copy number of each volume in
> parameterization but I can't find anything.
>
> Can I modify the copy number as I said? If it is possible, please tell
> me the way to modify the copy number.
>
> Sorry for my poor English. If you can't understand the meaning of my
> words, please ask me about it.
>
> Thank you.
>
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at:
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/1547.html

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

1 Question: Re: Parameterisation and CopyNo   (Hanwook Bae - 14 Sep, 2017)
 Add Message Add Message
to: "Re: Parameterisation and CopyNo"

 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 ]