Bayesian1DMarginal.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "TSpline.h"
4 
6 
7 namespace ana
8 {
9  class IFitVar;
10  class MCMCSamples;
11 
13  {
14  public:
15  /// \brief Build a 1D marginal distribution from the output of an MCMC fit.
16  ///
17  /// \param samples \a MCMCSamples object from the fit.
18  /// \param var IFitVar to retain (all others will be marginalized)
20 
21  /// \brief Build a 1D marginal distribution from the output of an MCMC fit.
22  ///
23  /// \param samples \a MCMCSamples object from the fit.
24  /// \param syst ISyst to retain (all others will be marginalized)
26 
27  /// \brief Return a list of ranges of the variable where LL is above the specified quantile
28  ///
29  /// \param quantile Fraction of LLs for threshold (e.g., 0.9 -> range of upper 90% of LLs)
30  /// \param bins The range of interest must be subdivided somehow to sample the kNN. You tell me how...
31  /// \return Vector of ranges (begin, end).
32  std::vector<std::pair<double, double>> QuantileRanges(Quantile quantile, const Binning& bins) const;
33 
34  TH1D ToTH1(const Binning & bins) const;
35  private:
36  mutable std::unique_ptr<Binning> fCachedBinning;
37  mutable std::unique_ptr<TH1D> fCachedHist;
38  };
39 
40 }
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
std::unique_ptr< Binning > fCachedBinning
Bayesian1DMarginal(const MCMCSamples &samples, const IFitVar *var, MarginalMode mode=MarginalMode::kHistogram)
Build a 1D marginal distribution from the output of an MCMC fit.
std::vector< std::pair< double, double > > QuantileRanges(Quantile quantile, const Binning &bins) const
Return a list of ranges of the variable where LL is above the specified quantile. ...
std::unique_ptr< TH1D > fCachedHist
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
MarginalMode
How to construct marginal distributions.
Quantile
Type to specify quantile values, so that we don&#39;t run into floating-point matching issues...
unsigned int quantile(std::vector< std::vector< double >> v, float E, float hadEfrac)
Definition: Toy_analyses.C:480
const Binning bins
Definition: NumuCC_CPiBin.h:8
The result of marginalizing over a set of Bayesian MCMC samples down to a few dimensions.
Interface definition for fittable variables.
Definition: IFitVar.h:16
TH1D ToTH1(const Binning &bins) const