17#ifdef XROOFIT_USE_PRAGMA_ONCE
20#if (!defined(XROOFIT_USE_PRAGMA_ONCE) && !defined(XROOFIT_XROOFIT_H)) || \
21 (defined(XROOFIT_USE_PRAGMA_ONCE) && !defined(XROOFIT_XROOFIT_H_XROOFIT))
22#ifndef XROOFIT_USE_PRAGMA_ONCE
23#define XROOFIT_XROOFIT_H
25#define XROOFIT_XROOFIT_H_XROOFIT
62 static const char *GetVersion();
63 static const char *GetVersionDate();
68 static RooCmdArg StrategySequence(
const char *stratSeq);
69 static constexpr double OBS = std::numeric_limits<double>::quiet_NaN();
72 static std::pair<double, double> matchPrecision(
const std::pair<double, double> &in);
81 static std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>>
83 static std::shared_ptr<const RooFitResult>
84 fitTo(
RooAbsPdf &pdf,
const std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> &
data,
86 static std::shared_ptr<const RooFitResult> fitTo(
RooAbsPdf &pdf,
87 const std::pair<RooAbsData *, const RooAbsCollection *> &
data,
90 static xRooNLLVar createNLL(
const std::shared_ptr<RooAbsPdf> pdf,
const std::shared_ptr<RooAbsData>
data,
99 static std::shared_ptr<ROOT::Fit::FitConfig> createFitConfig();
100 static std::shared_ptr<RooLinkedList> createNLLOptions();
101 static std::shared_ptr<RooLinkedList> defaultNLLOptions();
102 static std::shared_ptr<ROOT::Fit::FitConfig> defaultFitConfig();
105 static std::shared_ptr<const RooFitResult> minimize(
RooAbsReal &nll,
106 const std::shared_ptr<ROOT::Fit::FitConfig> &fitConfig =
nullptr,
107 const std::shared_ptr<RooLinkedList> &nllOpts =
nullptr);
109 const std::shared_ptr<ROOT::Fit::FitConfig> &_fitConfig =
nullptr);
119 std::shared_ptr<RooFitResult>
fr;
159 std::vector<std::pair<double, int>> out;
160 if (
type == TwoSided) {
162 }
else if (
type == OneSidedPositive) {
163 out.emplace_back(std::make_pair(mu, 0));
164 }
else if (
type == OneSidedNegative) {
165 out.emplace_back(std::make_pair(-std::numeric_limits<double>::infinity(), 0));
166 out.emplace_back(std::make_pair(mu, 1));
167 }
else if (
type == OneSidedAbsolute) {
168 out.emplace_back(std::make_pair(-std::numeric_limits<double>::infinity(), 0));
169 out.emplace_back(std::make_pair(-mu, 1));
170 out.emplace_back(std::make_pair(mu, 0));
171 }
else if (
type == Uncapped) {
172 out.emplace_back(std::make_pair(-std::numeric_limits<double>::infinity(), -1));
173 out.emplace_back(std::make_pair(mu, 1));
175 throw std::runtime_error(
"Unknown PLL Type");
181 static double k(
const IncompatFunc &compatRegions,
double pValue,
double poiVal,
double poiPrimeVal,
182 double sigma_mu = 0,
double mu_low = -std::numeric_limits<double>::infinity(),
183 double mu_high = std::numeric_limits<double>::infinity());
185 static double k(
const PLLType &pllType,
double pValue,
double mu,
double mu_prime,
double sigma_mu = 0,
186 double mu_low = -std::numeric_limits<double>::infinity(),
187 double mu_high = std::numeric_limits<double>::infinity())
189 return k(IncompatibilityFunction(pllType, mu), pValue, mu, mu_prime, sigma_mu, mu_low, mu_high);
193 static double PValue(
const IncompatFunc &compatRegions,
double k,
double mu,
double mu_prime,
double sigma_mu = 0,
194 double mu_low = -std::numeric_limits<double>::infinity(),
195 double mu_high = std::numeric_limits<double>::infinity());
197 static double PValue(
const PLLType &pllType,
double k,
double mu,
double mu_prime,
double sigma_mu = 0,
198 double mu_low = -std::numeric_limits<double>::infinity(),
199 double mu_high = std::numeric_limits<double>::infinity())
201 return PValue(IncompatibilityFunction(pllType, mu), k, mu, mu_prime, sigma_mu, mu_low, mu_high);
204 static double Phi_m(
double mu,
double mu_prime,
double a,
double sigma,
const IncompatFunc &compatRegions);
206 static int CompatFactor(
const IncompatFunc &func,
double mu_hat);
210 return CompatFactor(IncompatibilityFunction((
PLLType)
type, mu), mu_hat);
228 return hypoTest(
w, 0, 0, pllType);
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
static double k(const IncompatFunc &compatRegions, double pValue, double poiVal, double poiPrimeVal, double sigma_mu=0, double mu_low=-std::numeric_limits< double >::infinity(), double mu_high=std::numeric_limits< double >::infinity())
static double PValue(const PLLType &pllType, double k, double mu, double mu_prime, double sigma_mu=0, double mu_low=-std::numeric_limits< double >::infinity(), double mu_high=std::numeric_limits< double >::infinity())
static int CompatFactor(int type, double mu, double mu_hat)
static IncompatFunc IncompatibilityFunction(const PLLType &type, double mu)
std::vector< std::pair< double, int > > IncompatFunc
static double k(const PLLType &pllType, double pValue, double mu, double mu_prime, double sigma_mu=0, double mu_low=-std::numeric_limits< double >::infinity(), double mu_high=std::numeric_limits< double >::infinity())
static double PValue(const IncompatFunc &compatRegions, double k, double mu, double mu_prime, double sigma_mu=0, double mu_low=-std::numeric_limits< double >::infinity(), double mu_high=std::numeric_limits< double >::infinity())
std::shared_ptr< RooFitResult > fr
static TCanvas * hypoTest(RooWorkspace &w, const xRooFit::Asymptotics::PLLType &pllType=xRooFit::Asymptotics::Unknown)
static std::shared_ptr< RooLinkedList > sDefaultNLLOptions
static std::shared_ptr< ROOT::Fit::FitConfig > sDefaultFitConfig
static TCanvas * hypoTest(RooWorkspace &w, int nToysNull, int nToysAlt, const xRooFit::Asymptotics::PLLType &pllType=xRooFit::Asymptotics::Unknown)
This xRooNLLVar object has several special methods, e.g.
Class describing the configuration of the fit, options and parameter settings using the ROOT::Fit::Pa...
Generic interface for defining configuration options of a numerical algorithm.
Abstract container object that can hold multiple RooAbsArg objects.
Abstract base class for binned and unbinned datasets.
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value and implements functionality common to al...
Named container for two doubles, two integers two object points and three string pointers that can be...
static const RooCmdArg & none()
Return reference to null argument.
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
Persistable container for RooFit projects.
The TNamed class is the base class for all named ROOT classes.
#define BEGIN_XROOFIT_NAMESPACE
#define END_XROOFIT_NAMESPACE