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
65 static RooCmdArg StrategySequence(
const char *stratSeq);
66 static constexpr double OBS = std::numeric_limits<double>::quiet_NaN();
69 static std::pair<double, double> matchPrecision(
const std::pair<double, double> &in);
78 static std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>>
80 static std::shared_ptr<const RooFitResult>
81 fitTo(
RooAbsPdf &pdf,
const std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> &
data,
83 static std::shared_ptr<const RooFitResult> fitTo(
RooAbsPdf &pdf,
84 const std::pair<RooAbsData *, const RooAbsCollection *> &
data,
87 static xRooNLLVar createNLL(
const std::shared_ptr<RooAbsPdf> pdf,
const std::shared_ptr<RooAbsData>
data,
96 static std::shared_ptr<ROOT::Fit::FitConfig> createFitConfig();
97 static std::shared_ptr<RooLinkedList> createNLLOptions();
98 static std::shared_ptr<RooLinkedList> defaultNLLOptions();
99 static std::shared_ptr<ROOT::Fit::FitConfig> defaultFitConfig();
101 static std::shared_ptr<const RooFitResult> minimize(
RooAbsReal &nll,
102 const std::shared_ptr<ROOT::Fit::FitConfig> &fitConfig =
nullptr,
103 const std::shared_ptr<RooLinkedList> &nllOpts =
nullptr);
105 const std::shared_ptr<ROOT::Fit::FitConfig> &_fitConfig =
nullptr);
115 std::shared_ptr<RooFitResult>
fr;
154 std::vector<std::pair<double, int>> out;
155 if (
type == TwoSided) {
157 }
else if (
type == OneSidedPositive) {
158 out.emplace_back(std::make_pair(mu, 0));
159 }
else if (
type == OneSidedNegative) {
160 out.emplace_back(std::make_pair(-std::numeric_limits<double>::infinity(), 0));
161 out.emplace_back(std::make_pair(mu, 1));
162 }
else if (
type == OneSidedAbsolute) {
163 out.emplace_back(std::make_pair(-std::numeric_limits<double>::infinity(), 0));
164 out.emplace_back(std::make_pair(-mu, 1));
165 out.emplace_back(std::make_pair(mu, 0));
166 }
else if (
type == Uncapped) {
167 out.emplace_back(std::make_pair(-std::numeric_limits<double>::infinity(), -1));
168 out.emplace_back(std::make_pair(mu, 1));
170 throw std::runtime_error(
"Unknown PLL Type");
176 static double k(
const IncompatFunc &compatRegions,
double pValue,
double poiVal,
double poiPrimeVal,
177 double sigma_mu = 0,
double mu_low = -std::numeric_limits<double>::infinity(),
178 double mu_high = std::numeric_limits<double>::infinity());
180 static double k(
const PLLType &pllType,
double pValue,
double mu,
double mu_prime,
double sigma_mu = 0,
181 double mu_low = -std::numeric_limits<double>::infinity(),
182 double mu_high = std::numeric_limits<double>::infinity())
184 return k(IncompatibilityFunction(pllType, mu), pValue, mu, mu_prime, sigma_mu, mu_low, mu_high);
188 static double PValue(
const IncompatFunc &compatRegions,
double k,
double mu,
double mu_prime,
double sigma_mu = 0,
189 double mu_low = -std::numeric_limits<double>::infinity(),
190 double mu_high = std::numeric_limits<double>::infinity());
192 static double PValue(
const PLLType &pllType,
double k,
double mu,
double mu_prime,
double sigma_mu = 0,
193 double mu_low = -std::numeric_limits<double>::infinity(),
194 double mu_high = std::numeric_limits<double>::infinity())
196 return PValue(IncompatibilityFunction(pllType, mu), k, mu, mu_prime, sigma_mu, mu_low, mu_high);
199 static double Phi_m(
double mu,
double mu_prime,
double a,
double sigma,
const IncompatFunc &compatRegions);
201 static int CompatFactor(
const IncompatFunc &func,
double mu_hat);
205 return CompatFactor(IncompatibilityFunction((
PLLType)
type, mu), mu_hat);
223 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 std::shared_ptr< RooLinkedList > sDefaultNLLOptions
static TCanvas * hypoTest(RooWorkspace &w, const xRooFit::Asymptotics::PLLType &pllType=xRooFit::Asymptotics::Unknown)
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...
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.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
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