<div dir="ltr">Hello Andrew,<div><br></div><div>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.</div><div><br></div><div><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_JeffersonLab_HDGeant4_issues_233&d=DwMFaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Te_hCR4EUlJ6iCDYLJ8Viv2aDOR7D9ZZMoBAvf2H0M4&m=IkRobB9OA7B6duB2kON9Q52xDKNLa8kjAWE4pHW3qMRBeRWS6Gd1CEsOcNebhjFD&s=MVU_wrB47_yvXin5l0vMKxZgorgEnfPSUBQsCp5bXWA&e=">https://github.com/JeffersonLab/HDGeant4/issues/233</a></div><div><br></div><div>-Richard Jones</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Dec 16, 2025 at 5:51 PM Andrew Schick <<a href="mailto:aschick@umass.edu">aschick@umass.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p></p>
<div style="background-color:rgb(255,235,156);width:100%;border-style:none;border-color:rgb(250,235,204);border-width:1pt;padding:10pt;font-size:11pt;line-height:12pt;font-family:Calibri;color:rgb(0,0,0);text-align:left">
<span style="color:rgb(156,101,0)"></span>*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.*</div>
<br>
<p></p>
<div>
<div dir="ltr">Hi Richard,
<div><br>
</div>
<div>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:</div>
<div><a href="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=DwMFaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Te_hCR4EUlJ6iCDYLJ8Viv2aDOR7D9ZZMoBAvf2H0M4&m=IkRobB9OA7B6duB2kON9Q52xDKNLa8kjAWE4pHW3qMRBeRWS6Gd1CEsOcNebhjFD&s=303Lhi1MmPUbDs5wbWzJ1V8k4kWZDGxLU4cgDnvz0ZA&e=" target="_blank">https://github.com/JeffersonLab/HDGeant4/blob/1414d5c3339aceb278674f862ccb866042ad4453/src/GlueXPrimaryGenerator.cc#L154</a><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>-Andrew</div>
</div>
</div>
</div>
</blockquote></div>