12#ifndef ROOSTATS_RooStatsUtils
13#define ROOSTATS_RooStatsUtils
50 return ::ROOT::Math::normal_quantile_c(pvalue,1);
55 return ::ROOT::Math::normal_cdf_c(Z);
64 paramsToChange->
assign(*desiredVals) ;
79 for (
auto *
v : dynamic_range_cast<RooRealVar *>(coll)) {
80 if (
v && (
v->isConstant() != constant)) {
82 v->setConstant(constant);
91 bool randomizeConstants =
true)
95 if (randomizeConstants) {
96 for (
auto *var : static_range_cast<RooRealVar *>(set))
101 for (
auto *var : static_range_cast<RooRealVar *>(set)) {
102 if (!var->isConstant() )
154 const char *mcname,
const char *newmcname,
bool copyData=
true);
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 on
Option_t Option_t TPoint TPoint const char mode
Abstract container object that can hold multiple RooAbsArg objects.
void assign(const RooAbsCollection &other) const
Sets the value, cache and constant attribute of any argument in our set that also appears in the othe...
void removeConstantParameters()
Abstract interface for all probability density functions.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Container class to hold unbinned data.
< A class that holds configuration information for a model using a workspace as a store
Persistable container for RooFit projects.
A TTree represents a columnar dataset.
Namespace for the RooStats classes.
bool SetAllConstant(const RooAbsCollection &coll, bool constant=true)
utility function to set all variable constant in a collection (from G.
TTree * GetAsTTree(TString name, TString desc, const RooDataSet &data)
Create a TTree with the given name and description. All RooRealVars in the RooDataSet are represented...
void SetParameters(const RooArgSet *desiredVals, RooArgSet *paramsToChange)
double PValueToSignificance(double pvalue)
returns one-sided significance corresponding to a p-value
void RemoveConstantParameters(RooArgSet *set)
std::string const & NLLOffsetMode()
Test what offsetting mode RooStats should use by default.
RooAbsPdf * MakeNuisancePdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name)
extract constraint terms from pdf
void FactorizePdf(const RooArgSet &observables, RooAbsPdf &pdf, RooArgList &obsTerms, RooArgList &constraints)
void RandomizeCollection(RooAbsCollection &set, bool randomizeConstants=true)
assuming all values in set are RooRealVars, randomize their values
void SetNLLOffsetMode(std::string const &mode)
Function to set a global flag in RooStats to use NLL offset when performing nll computations.
RooStatsConfig & GetGlobalRooStatsConfig()
Retrieve the config object which can be used to set flags for things like offsetting the likelihood o...
double AsimovSignificance(double s, double b, double sigma_b=0.0)
Compute the Asimov Median significance for a Poisson process with s = expected number of signal event...
void UseNLLOffset(bool on)
Use an offset in NLL calculations.
RooAbsPdf * MakeUnconstrainedPdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name=nullptr)
remove constraints from pdf and return the unconstrained pdf
bool IsNLLOffset()
Function returning if the flag to check if the flag to use NLLOffset is set.
double SignificanceToPValue(double Z)
returns p-value corresponding to a 1-sided significance
RooWorkspace * MakeReducedWorkspace(RooWorkspace *oldWS, const char *newName, bool copySnapshots, const char *mcname, const char *newmcname, bool copyData=true)
function that clones a workspace, copying all needed components and discarding all others
void PrintListContent(const RooArgList &l, std::ostream &os=std::cout)
useful function to print in one line the content of a set with their values
bool useEvalErrorWall
Use the error wall RooFit::EvalErrorWall to drive the fitter away from disallowed parameter values.
std::string useLikelihoodOffset
Offset the likelihood by passing RooFit::Offset to fitTo().