From 779266ec72a5c76ee52043ab3ae17479ba6a9788 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 27 Aug 2018 10:12:17 -0500 Subject: add code to expand the track of a particle using a KL expansion 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. --- src/random.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/random.h') diff --git a/src/random.h b/src/random.h index 309cd71..733279c 100644 --- a/src/random.h +++ b/src/random.h @@ -4,5 +4,6 @@ #include "mt19937ar.h" double randn(void); +void rand_sphere(double *dir); #endif -- cgit