  We study the asymptotics related to the following matching criteria for two
independent realizations of point processes X\sim X and Y\sim Y. Given l>0,
X\cap [0,l) serves as a template. For each t>0, the matching score between the
template and Y\cap [t,t+l) is a weighted sum of the Euclidean distances from
y-t to the template over all y\in Y\cap [t,t+l). The template matching criteria
are used in neuroscience to detect neural activity with certain patterns. We
first consider W_l(\theta), the waiting time until the matching score is above
a given threshold \theta. We show that whether the score is scalar- or
vector-valued, (1/l)\log W_l(\theta) converges almost surely to a constant
whose explicit form is available, when X is a stationary ergodic process and Y
is a homogeneous Poisson point process. Second, as l\to\infty, a strong
approximation for -\log [\Pr{W_l(\theta)=0}] by its rate function is
established, and in the case where X is sufficiently mixing, the rates, after
being centered and normalized by \sqrtl, satisfy a central limit theorem and
almost sure invariance principle. The explicit form of the variance of the
normal distribution is given for the case where X is a homogeneous Poisson
process as well.
