  Over the past decades Bayesian methods have become increasingly popular in
astronomy and physics as stochastic samplers have enabled efficient
investigation of high-dimensional likelihood surfaces. In this work we develop
a hierarchical Bayesian inference framework to detect the presence of dark
matter annihilation events in data from the Cherenkov Telescope Array (CTA).
Cosmic rays are weighted based on their measured sky position $\hat\Omega_m$
and energy $E_m$ in order to derive a posterior distribution for the dark
matter's velocity averaged cross section $\langle\sigma v\rangle$. The dark
matter signal model and the astrophysical background model are cast as prior
distributions for $(\hat\Omega_m, E_m)$. The shape of these prior distributions
can be fixed based on first-principle models; or one may adopt flexible priors
to include theoretical uncertainty, for example, in the dark matter
annihilation spectrum or the astrophysical distribution of sky location. We
demonstrate the utility of this formalism using simulated data with a
contribution from a scalar singlet dark-matter model. The sensitivity according
to our method is comparable to previous estimates of the CTA sensitivity.
