StanUtils.cxx
Go to the documentation of this file.
1 #include "TH1.h"
2 
5 
6 #include "Utilities/func/Stan.h"
7 
8 namespace ana
9 {
10  //----------------------------------------------------------------------
12  const Eigen::ArrayXd& obs)
13  {
14  assert(exp.size() >= 2 && exp.size() == obs.size());
15 
16  stan::math::var chi = 0;
17 
18  for (int i = 1; i < exp.size() - 1; ++i)
19  {
20  chi += LogLikelihood(exp[i], obs[i]);
21  }
22 
23  return chi;
24  }
25 }
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
double LogLikelihood(const Eigen::ArrayXd &ea, const Eigen::ArrayXd &oa, bool useOverflow)
The log-likelihood formula from the PDG.
Definition: EigenUtils.cxx:36
fvar< T > exp(const fvar< T > &x)
Definition: exp.hpp:10
Eigen::Array< stan::math::var, Eigen::Dynamic, 1 > ArrayXstan
Definition: Hist.h:20
assert(nhit_max >=nhit_nbins)