Open JamesJieranShen opened 8 months ago
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:
This commit changes how the PMT geometry is defined compared to older versions of rat. The PMT geometry logic is currently as follows:
pmt_envelope
.pmt_envelope
, call this placementbody_phys
. (first placement)body_phys
and the inner volumes.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, notablybody_phys
. However,body_phys
is never written to the gdml file since it is a placement inpmt_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!