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) ;
69 for (
auto const *myarg : static_range_cast<RooRealVar *>(*set)) {
70 if(myarg->isConstant()) constSet.
add(*myarg);
77 for (
auto const *myarg : static_range_cast<RooRealVar *>(set)) {
78 if(myarg->isConstant()) constSet.
add(*myarg);
87 for (
auto *
v : dynamic_range_cast<RooRealVar *>(coll)) {
88 if (
v && (
v->isConstant() != constant)) {
90 v->setConstant(constant);
99 bool randomizeConstants =
true)
103 if (randomizeConstants) {
104 for (
auto *var : static_range_cast<RooRealVar *>(set))
109 for (
auto *var : static_range_cast<RooRealVar *>(set))
110 if (!var->isConstant() )
142 const char *mcname,
const char *newmcname);
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
Abstract container object that can hold multiple RooAbsArg objects.
virtual bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
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...
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.
RooDataSet is a container class to hold unbinned data.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
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)
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
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)
function to set a global flag in RooStats to use NLL offset when performing nll computations Note tha...
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
RooWorkspace * MakeCleanWorkspace(RooWorkspace *oldWS, const char *newName, bool copySnapshots, const char *mcname, const char *newmcname)
function that clones a workspace, copying all needed components and discarding all others
double SignificanceToPValue(double Z)
returns p-value corresponding to a 1-sided significance
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.
bool useLikelihoodOffset
Offset the likelihood by passing RooFit::Offset to fitTo().