aboutsummaryrefslogtreecommitdiff
path: root/src/path.c
AgeCommit message (Collapse)Author
2019-03-16add GPLv3 licensetlatorre
2019-03-07fix a bug in path_init() when the direction was equal to (0,0,1)tlatorre
2018-11-17speed up likelihood function and switch to using fixed dxtlatorre
This commit speeds up the likelihood function by about ~20% by using the precomputed track positions, directions, times, etc. instead of interpolating them on the fly. It also switches to computing the number of points to integrate along the track by dividing the track length by a specified distance, currently set to 1 cm. This should hopefully speed things up for lower energies and result in more stable fits at high energies.
2018-10-18update path_init() to check for a divide by zerotlatorre
This commit updates path_init() to check that beta > 0 before dividing by it to compute the time. Previously when fitting electrons it would occasionally divide by zero which would cause the inf to propagate all the way through the likelihood function.
2018-10-18update fit to fit for electrons and protonstlatorre
2018-10-17fix a bug in the theta0 calculation for a pathtlatorre
This commit fixes a bug in the calculation of the average rms width of the angular distribution for a path with a KL expansion. I also made a lot of updates to the test-path program: - plot the distribution of the KL expansion coefficients - plot the standard deviation of the angular distribution as a function of distance along with the prediction - plot the simulated and reconstructed path in 3D
2018-10-01fall back to old scattering rms calculation when n = 0tlatorre
2018-09-20make sure direction vector is normalized in path_eval()tlatorre
2018-09-17update muon kinetic energy calculationtlatorre
This commit updates the calculation of the muon kinetic energy as a function of distance along the track. Previously I was using an approximation from the PDG, but it doesn't seem to be very accurate and won't generalize to the case of electrons. The kinetic energy is now calculated using the tabulated values of dE/dx as a function of energy.
2018-09-06compute theta0 in path_init() to speed things uptlatorre
2018-09-06update theta0 calculationtlatorre
This commit updates path_eval() to calculate theta0 using the residual scattering RMS for a truncated KL expansion. Since there isn't a nice closed form solution for this, we instead compute a rough approximation by evaluating the residual scattering RMS at the center of the track.
2018-09-06introduce a minimum value for the scattering RMS theta0tlatorre
2018-09-04update fit to guess energy, direction, and t0tlatorre
This commit updates the initial guess for the energy using a simple heuristic of ~6 hits/MeV. I also updated the initial phase where we do a bunch of "quick" minimizations to loop over a series of starting positions and automatically calculate the approximate direction and t0 for the event.
2018-08-31use interp1d() to interpolate path to speed things uptlatorre
2018-08-31rotate and translate the path in path_init to speed things uptlatorre
2018-08-28add path to the likelihood fittlatorre
This commit updates the likelihood fit to use the KL path expansion. Currently, I'm just using one coefficient for the path in both x and y.
2018-08-27add code to expand the track of a particle using a KL expansiontlatorre
To fit the path of muons and electrons I use the Karhunen-Loeve expansion of a random 2D walk in the polar angle in x and y. This allows you to decompose the path into a sum over sine functions whose coefficients become random variables. The nice thing about fitting the path in this way is that you can capture *most* of the variation in the path using a small number of variables by only summing over the first N terms in the expansion and it is easy to calculate the probability of the coefficients since they are all uncorrelated.