Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repetition of sub-detector consisting of slices of different shapes #1091

Closed
Gongzi-Zhang opened this issue Apr 19, 2023 · 7 comments
Closed
Labels

Comments

@Gongzi-Zhang
Copy link

Gongzi-Zhang commented Apr 19, 2023

Hi:

I am trying to repeat a sub-detector consisting of slices of different shapes, and was prompted that 'Wrong bounding box for volume HCAL5_envelope' . I want to ask is there a way to do the job without typing each sub-detector separately?

Many thanks.

Here is my code and sorry for the mess, it looks good in the editor panel, I don't know why the terrible display.

(edit: you have to use triple tick marks ```, not just one around code blocks... (and optionally add the language for highlighting) look at your post after my edits)

 <detector id="5" name="HCAL5" type="ZDC_Sampling" readout="HCALHits" vis="GreenVis">
     <position x="2.37*cm" y="2.37*cm" z="511.28*cm"/>                         
      <rotation x="0" y="0" z="0"/>                                             
      <dimensions x="4.74*cm" y="4.74*cm" z="16.92*cm"/>                        
      <layer repeat="6">                                                        
        <box name="Absorber" material="Steel235" x="4.74*cm" y="4.74*cm" z="2*cm"  vis="AnlGray" sensitive="false"/>
        <box name="Air_gap"  material="Air"      x="4.74*cm" y="4.74*cm" z="0.52*cm" sensitive="false"/>
        <polyhedra name="Scint" material="Polystyrene" numsides="6" rmin="0*cm" rmax="2*cm" dz="0.3*cm"  vis="AnlOrange" sensitive="true"/>
      </layer>                                                                  
    </detector>    
@MarkusFrankATcernch
Copy link
Contributor

@Gongzi-Zhang Sorry for the late reply.....
If I understand correctly these are actually 2 questions:

  1. Why does the envelope cause overlaps (Bounding box errors).

  2. Does one have to describe every HCALX (X=1,...n) as a separate subdetector?

add 1) Can it be that the envelope has "touching surfaces"?
Even if these are mathematically correct, tiny numerically differences can cause such overlaps.
Try to make either the inside volumes some epsilon smaller (~1e-10 or so) or the envelopes bigger.
1e-10 does not change any physics.

add 2) In principle you can describe anything as coarse as you want. Inside the <detector/> tag you only have to supply the
necessary constants to parametrize what you want to describe. If these are many HCAL(1....N), 1 single one or a few is
your decision...and depends on what the result is supposed to do. Just try to have sort of "balanced" volumes: there
should be a manageable number of daughter volumes inside. Otherwise Geant4 is slowing down.

Does this answer the questions?

@Gongzi-Zhang
Copy link
Author

@MarkusFrankATcernch Thank you for your answer. The problem is that the detector dimension I defined (with the dimension tag) is larger than the polyhedra layer. I do it this way because I want to repeat this detector 6 times, instead of writing each layer 6 times. So the question is how to repeat such a detector composing of layers of different shapes (dimensions).

@MarkusFrankATcernch
Copy link
Contributor

@Gongzi-Zhang This is a perfectly valid approach.
You could also define multiple layer definitions within the detector tag and place them all inside the envelope.
The thing is to make the envelope large enough that no layer touches the envelope. I think here in (x,y) your layer elements touch the envelope...not ? They all have identical dimensions in (x,y).

@Gongzi-Zhang
Copy link
Author

Gongzi-Zhang commented Apr 25, 2023

@MarkusFrankATcernch I don't think so, I changed the size of the detector and each layer to make the detector obviously larger than that of the layers, and still got the error message when I tried to view it with dd_web_display:

Error in <TGeoVoxelFinder::SortAll>: Cannot voxelize world_volume :less than 2 boundaries on Z
Error in <TGeoVoxelFinder::SortAll>: Wrong bounding box for volume [HCAL1_envelope

test.txt

I attache my geometry file here, please check it if you can. Thank you very much.

@Gongzi-Zhang
Copy link
Author

Gongzi-Zhang commented Apr 26, 2023

@MarkusFrankATcernch I think I figure out the problem, the detector type I quoted "ZDC_Sampling" doesn't support the polyhedra shape. Thank you for your help.

@MarkusFrankATcernch
Copy link
Contributor

@Gongzi-Zhang Good thing though is: it is not DD4hep's fault :-)))

@MarkusFrankATcernch
Copy link
Contributor

Closing issue. This is not a DD4hep issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants