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

Usage of PMT Envelope double-places the PMT body, breaks GDML persistency #120

Open
JamesJieranShen opened this issue Jan 5, 2024 · 1 comment

Comments

@JamesJieranShen
Copy link
Contributor

This commit changes how the PMT geometry is defined compared to older versions of rat. The PMT geometry logic is currently as follows:

  1. create a volume called the pmt_envelope.
  2. place the pmt body in pmt_envelope, call this placement body_phys. (first placement)
  3. Create daughter volumes (dynodes, waveguides, inner volumes used to carve out the glass shape)
  4. Declare border surfaces (photocathodes, mirrors) between body_phys and the inner volumes.
  5. Take the created pmt, place it in the detector (second placement).

This approach causes issues with the GDML writer. pmt_envelope is not part of the detector geometry and is therefore not written to the geometry. However, the border surface definitions refer to the physical volumes they are defined with, notably body_phys. However, body_phys is never written to the gdml file since it is a placement in pmt_envelope.

Optimal solution is to fix this in the pmt geo factories such that we don't refer to a dangling physical volume that's not part of the actual geometry definition. If this is challenging, the GDMLWriter might be modified somehow to handle this edge case.

@masmiley, do you know anything about this? I am not sure if you were responsible for this change or Morgan, since Morgan committed the change but the PR mentions your name. Thanks in advance!

@MorganAskins
Copy link
Member

The pmt envelope is a hack for geant-4 to help improve the particle propagation speed. The dynamic step size within a volume is loosely based on the smallest elements of that volume, so if you are in a huge detector but have very precise PMTs sitting in that detector then you get very small steps across the whole thing. The envelope tricks geant-4 into thinking the PMTs are just simple cubes up until you hit the envelope and then transport becomes more precise.

Placing the PMT twice does sound like a bug that should be fixed. The main thing to check after any fix is simply:

  • Compare the simulation time of something like a photon bomb and an electron in a huge detector before and after, with and w/o the envelopes.

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

No branches or pull requests

2 participants