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  //----------------------------------------------------------------------
11  stan::math::var LogLikelihood(const std::vector <stan::math::var> &exp, const TH1 *obs)
12  {
13  assert(exp.size() >= 2 && int(exp.size() - 2) == obs->GetNbinsX()); // exp includes under- and overflow
14 
15  stan::math::var chi = 0;
16 
17  for (std::size_t i = 1; i < exp.size() - 1; ++i)
18  {
19  auto e = exp[i];
20  auto o = obs->GetBinContent(i);
21 
22  chi += LogLikelihood(e, o);
23  }
24 
25  return chi;
26  }
27 }
Oscillation analysis framework, runs over CAF files outside of ART.
var
stan::math::var LogLikelihood(const std::vector< stan::math::var > &exp, const TH1 *obs)
Variant that handles the prediction in the form of Stan vars.
Definition: StanUtils.cxx:11
Float_t e
Definition: plot.C:35