198 coutE(InputArguments) <<
"SPlot::SPlot(" <<
GetName() <<
") input argument "
199 << arg->GetName() <<
" is not of type RooRealVar (or RooLinearVar)."
200 <<
"\nRooStats must be able to set it to 0 and to 1 to probe the PDF." << std::endl ;
201 throw std::invalid_argument(
Form(
"SPlot::SPlot(%s) input argument %s is not of type RooRealVar/RooLinearVar",
GetName(),arg->GetName())) ;
239 coutE(InputArguments) <<
"Invalid Entry Number" << std::endl;
245 coutE(InputArguments) <<
"Invalid Entry Number" << std::endl;
273 coutE(InputArguments) <<
"InputVariable not in list of sWeighted variables" << std::endl;
288 coutE(InputArguments) <<
"Invalid Entry Number" << std::endl;
294 coutE(InputArguments) <<
"Invalid Entry Number" << std::endl;
347 coutE(InputArguments) <<
"InputVariable not in list of sWeighted variables" << std::endl;
413 auto& par = *(*constParameters)[i];
441 vars.
remove(projDeps,
true,
true);
447 for(std::size_t i = 0; i <
yieldsTmp.size(); i++) {
455 coutI(InputArguments) <<
"Printing Yields" << std::endl;
461 std::vector<RooAbsRealLValue*>
yieldvars ;
490 if (
theVar->getMin() > 0) {
491 coutE(InputArguments) <<
"Yield variables need to have a range that includes at least [0, 1]. Minimum for "
492 <<
theVar->GetName() <<
" is " <<
theVar->getMin() << std::endl;
494 coutE(InputArguments) <<
"Setting min range to 0" << std::endl;
497 throw std::invalid_argument(std::string(
"Yield variable ") +
theVar->GetName() +
" must have a range that includes 0.");
501 if (
theVar->getMax() < 1) {
502 coutW(InputArguments) <<
"Yield variables need to have a range that includes at least [0, 1]. Maximum for "
503 <<
theVar->GetName() <<
" is " <<
theVar->getMax() << std::endl;
505 coutE(InputArguments) <<
"Setting max range to 1" << std::endl;
508 throw std::invalid_argument(std::string(
"Yield variable ") +
theVar->GetName() +
" must have a range that includes 1.");
538 coutW(InputArguments) <<
"Strange pdf value: " <<
ievt <<
" " << k <<
" " <<
f_k << std::endl ;
552 coutI(Contents) <<
"likelihood norms: " ;
555 coutI(Contents) << std::endl ;
561 coutI(Contents) <<
"Calculating covariance matrix";
596 if (
covInv.Determinant() <=0)
598 coutE(Eval) <<
"SPlot Error: covariance matrix is singular; I can't invert it!" << std::endl;
607 coutI(Eval) <<
"Checking Likelihood normalization: " << std::endl;
608 coutI(Eval) <<
"Yield of specie Sum of Row in Matrix Norm" << std::endl;
620 coutI(Eval) <<
"Calculating sWeight" << std::endl;
622 std::vector<RooRealVar*>
pdfvec ;
693 for(std::size_t i = 0; i <
yieldsTmp.size(); i++)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
const_iterator begin() const
const_iterator end() const
Common abstract base class for objects that represent a value and a "shape" in RooFit.
bool dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=nullptr, bool valueOnly=false) const
Test whether we depend on (ie, are served by) any object in the specified collection.
RooFit::OwningPtr< RooArgSet > getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
RooFit::OwningPtr< RooArgSet > getVariables(bool stripDisconnected=true) const
Return RooArgSet with all variables (tree leaf nodes of expression tree)
void treeNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=nullptr, bool doBranch=true, bool doLeaf=true, bool valueOnly=false, bool recurseNonDerived=false) const
Fill supplied list with nodes of the arg tree, following all server links, starting with ourself as t...
double getRealValue(const char *name, double defVal=0.0, bool verbose=false) const
Get value of a RooAbsReal stored in set with given name.
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...
Storage_t::size_type size() const
virtual RooAbsArg * addClone(const RooAbsArg &var, bool silent=false)
Add a clone of the specified argument to list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
Abstract interface for all probability density functions.
RooFit::OwningPtr< RooFitResult > fitTo(RooAbsData &data, CmdArgs_t const &... cmdArgs)
Fit PDF to given dataset.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
virtual void setVal(double value)=0
Set the current value of the object. Needs to be overridden by implementations.
Abstract base class for objects that represent a real value and implements functionality common to al...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Named container for two doubles, two integers two object points and three string pointers that can be...
Container class to hold unbinned data.
const RooArgSet * get(Int_t index) const override
Return RooArgSet with coordinates of event 'index'.
bool merge(RooDataSet *data1, RooDataSet *data2=nullptr, RooDataSet *data3=nullptr, RooDataSet *data4=nullptr, RooDataSet *data5=nullptr, RooDataSet *data6=nullptr)
double weight() const override
Return event weight of current event.
static RooMsgService & instance()
Return reference to singleton instance.
Variable that can be changed from the outside.
A class to calculate "sWeights" used to create an "sPlot".
double GetSWeight(Int_t numEvent, const char *sVariable) const
Retrieve an s weight.
void AddSWeight(RooAbsPdf *pdf, const RooArgList &yieldsTmp, const RooArgSet &projDeps=RooArgSet(), bool includeWeights=true, const RooCmdArg &fitToarg5={}, const RooCmdArg &fitToarg6={}, const RooCmdArg &fitToarg7={}, const RooCmdArg &fitToarg8={})
Method which adds the sWeights to the dataset.
RooArgList GetSWeightVars() const
Return a RooArgList containing all parameters that have s weights.
double GetSumOfEventSWeight(Int_t numEvent) const
Sum the SWeights for a particular event.
SPlot()
Default constructor.
Int_t GetNumSWeightVars() const
Return the number of SWeights In other words, return the number of species that we are trying to extr...
RooDataSet * SetSData(RooDataSet *data)
Set dataset (if not passed in constructor).
RooDataSet * GetSDataSet() const
Retrieve s-weighted data.
double GetYieldFromSWeight(const char *sVariable) const
Sum the SWeights for a particular species over all events.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
virtual void Clear(Option_t *="")
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
RooCmdArg SumW2Error(bool flag)
RooCmdArg PrintEvalErrors(Int_t numErrors)
RooCmdArg PrintLevel(Int_t code)
RooCmdArg Extended(bool flag=true)
Namespace for the RooStats classes.