[Halld-offline] [EXTERNAL] Re: Float64 to Float32 conversion when making hddm file
Richard T. Jones
richard.t.jones at uconn.edu
Wed Dec 24 12:04:49 EST 2025
Hello Andrew,
Thank you for this detailed report. I think you just raised the bar in
terms of the amount of detail and justification you provided for this
change. I started working on it a couple days ago, and it has turned out to
be quite a bit more involved than I first thought, but it is well justified
and overdue. Please follow this issue to see my progress, together with
early access to development branches where all of the new code to support
double-precision <momentum> tags all the way down the chain from generator
through hdgeant4, mcsmear, to reconstruction. All of this code is now ready
for you to test, but I will require you to build your own HDDM (contains
fixes for the built-in support for double floats), checkout development
branches of HDGeant4 and halld_recon, and of course, add support to the
hddm writer that you created to convert the output from Rory's generator
into hddm_s format so that it adds the <momentum_double> tag below the
<momentum> tag throughout the hddm_s event structure wherever the
additional precision is wanted. All of these changes are backward
compatible in the sense that all old code will read the new generation of
mc events (of course only the single precision momentum components will be
visible to the old code) and the new code will still read old events (of
course the double precision momentum components will not be there, so they
will read in single precision) but everything will interoperate.
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_JeffersonLab_HDGeant4_issues_233&d=DwIFaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Te_hCR4EUlJ6iCDYLJ8Viv2aDOR7D9ZZMoBAvf2H0M4&m=IkRobB9OA7B6duB2kON9Q52xDKNLa8kjAWE4pHW3qMRBeRWS6Gd1CEsOcNebhjFD&s=MVU_wrB47_yvXin5l0vMKxZgorgEnfPSUBQsCp5bXWA&e=
-Richard Jones
On Tue, Dec 16, 2025 at 5:51 PM Andrew Schick <aschick at umass.edu> wrote:
> *External sender: This message was not sent through the UConn email
> system. It might be safe, but use caution before interacting with links,
> attachments, or requests.*
>
> Hi Richard,
>
> I am encountering a problem with Rory's Bethe-Heitler pair generator that
> is preventing me from submitting farm jobs. In short, the hddm file format
> forces a conversion from the 64 bit precision output of Rory's generator to
> the 32 bit precision that GEANT4 requires. This conversion interacts poorly
> with the check in HDGeant4/src/GlueXPrimaryGenerator.cc:
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_JeffersonLab_HDGeant4_blob_1414d5c3339aceb278674f862ccb866042ad4453_src_GlueXPrimaryGenerator.cc-23L154&d=DwIFaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Te_hCR4EUlJ6iCDYLJ8Viv2aDOR7D9ZZMoBAvf2H0M4&m=IkRobB9OA7B6duB2kON9Q52xDKNLa8kjAWE4pHW3qMRBeRWS6Gd1CEsOcNebhjFD&s=OXWSVlHvCidx-Hpsr0mS0lC-Ybt0P9f85xIOPreZDB4&e=
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__nam10.safelinks.protection.outlook.com_-3Furl-3Dhttps-253A-252F-252Fgithub.com-252FJeffersonLab-252FHDGeant4-252Fblob-252F1414d5c3339aceb278674f862ccb866042ad4453-252Fsrc-252FGlueXPrimaryGenerator.cc-2523L154-26data-3D05-257C02-257Crichard.t.jones-2540uconn.edu-257C4f5927d5826442758db908de3cf5a656-257C17f1a87e2a254eaab9df9d439034b080-257C0-257C0-257C639015223131301425-257CUnknown-257CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ-253D-253D-257C0-257C-257C-257C-26sdata-3DTt4X1QIP-252BIt4gqzb8PKLLdxu-252Fuo9Ni-252F5ZGhC5TmJDwk-253D-26reserved-3D0&d=DwIFaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Te_hCR4EUlJ6iCDYLJ8Viv2aDOR7D9ZZMoBAvf2H0M4&m=IkRobB9OA7B6duB2kON9Q52xDKNLa8kjAWE4pHW3qMRBeRWS6Gd1CEsOcNebhjFD&s=303Lhi1MmPUbDs5wbWzJ1V8k4kWZDGxLU4cgDnvz0ZA&e= >
> which then fills up my allotted space in farm_out for the jobs and causes
> all jobs, even ones that aren't simulation, to stall indefinitely.
>
> I thought maybe I could make a version of Rory's generator that did
> everything using float32's and enforced energy conservation at that level,
> so that no such problem would arise from the forced conversion. I now
> believe it is a problem inherent with trying to produce an electron mass if
> the energy scale of your events is in the GeV energy range. I made a
> writeup detailing the problem which is attached.
>
> I know you have made Bethe-Heitler generators and have done simulation
> with them. How did you get around this problem? Is the math that I do in
> that attached document, or any of the assumptions I make there incorrect?
> Any help here would be much appreciated.
>
> -Andrew
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jlab.org/pipermail/halld-offline/attachments/20251224/06d99a2d/attachment-0001.htm>
More information about the Halld-offline
mailing list