<html><body>I found a small bug that was still causing non-deterministic behavior. &nbsp;Basically, for ~1% of the events the figure-of-merit of at least one of the&nbsp;DTrackTimeBased objects was calculated incorrectly (see below for more details). &nbsp;Using hd_dump to print the objects from all factories and diff to compare the results, I don't see any more non-deterministic behavior. &nbsp;<div><br></div><div>However, there are other locations where DistToRT is used and there are no checks for NaN, so those still need to be looked into. &nbsp;I'm not entirely convinced that the function should be returning NaN (see below for more details), but I don't really understand the intricacies of the track swimming routines. &nbsp;<div><br></div><div>&nbsp;- Paul</div><div><br><div><div>Begin forwarded message:</div><br class="Apple-interchange-newline"><div><div><font color="#000000" size="3" face="Helvetica"><b>From: </b></font><font size="3" face="Helvetica"><a href="mailto:Hall-D.SVN.Repository@jlab.org">Hall-D.SVN.Repository@jlab.org</a></font></div><div><font color="#000000" size="3" face="Helvetica"><b>Date: </b></font><font size="3" face="Helvetica">July 20, 2011 3:13:23 PM EDT</font></div><div><font color="#000000" size="3" face="Helvetica"><b>To: </b></font><font size="3" face="Helvetica"><a href="mailto:davidl@jlab.org">davidl@jlab.org</a>, <a href="mailto:brash@pcs.cnu.edu">brash@pcs.cnu.edu</a>, <a href="mailto:wolin@jlab.org">wolin@jlab.org</a>, <a href="mailto:zisis@uregina.ca">zisis@uregina.ca</a>, <a href="mailto:mashephe@indiana.edu">mashephe@indiana.edu</a>, <a href="mailto:remitche@indiana.edu">remitche@indiana.edu</a>, <a href="mailto:zihlmann@jlab.org">zihlmann@jlab.org</a>, <a href="mailto:somov@jlab.org">somov@jlab.org</a>, <a href="mailto:staylor@jlab.org">staylor@jlab.org</a>, <a href="mailto:kmoriya@indiana.edu">kmoriya@indiana.edu</a>, <a href="mailto:pmatt@jlab.org">pmatt@jlab.org</a></font></div><div><font color="#000000" size="3" face="Helvetica"><b>Subject: </b></font><font size="3" face="Helvetica"><b>r8088 - trunk/sim-recon/src/libraries/PID</b></font></div><div><br></div> </div><div>Author: pmatt<br>Date: 2011-07-20 15:13:22 -0400 (Wed, 20 Jul 2011)<br>New Revision: 8088<br><br>Modified:<br> &nbsp;&nbsp;trunk/sim-recon/src/libraries/PID/DParticleID.cc<br>Log:<br>Added checks for NaN on the DReferenceTrajectory::DistToRT call in DParticleID::GetdEdx. &nbsp;Without these checks, the figure-of-merit of the DTrackTimeBased objects is sometimes (non-deterministically) calculated incorrectly. &nbsp;This is because the point on the trajectory for the given DCDCTrackHit is then calculated (in DReferenceTrajectory::GetLastDOCAPoint) using the swim-step from the previous DCDCTrackHit because it was never updated by the DistToRT function. &nbsp;<br><br>The DistToRT function returns NaN because the first swim-step on the reference trajectory is the closest to the wire hit. &nbsp;I don't know what the cause of this is, and whether or not it's a bad thing, but the function returns NaN nonetheless. &nbsp;<br><br>This process was non-deterministic because the vector of DCDCTrackHit objects grabbed in GetdEdx are in random order. &nbsp;They are in random order because they are associated objects, and are stored in a map with their pointer address as the key. &nbsp;<br><br><br></div></div><br></div></div></body></html>