104#include <sys/types.h>
110class ScaledDataWeightedAverage :
public RooAbsFunc {
113 :
RooAbsFunc{1}, _var{var}, _dataWeights{
data.getWeightBatch(0,
data.numEntries())}, _scaleFactor{scaleFactor}
116 _arg->recursiveRedirectServers(
RooArgList{var});
117 _evaluator = std::make_unique<RooFit::Evaluator>(*_arg);
118 std::stack<std::vector<double>>{}.swap(_vectorBuffers);
119 auto dataSpans = RooFit::BatchModeDataHelpers::getDataSpans(
data,
"",
nullptr,
false,
123 _evaluator->setInput(item.first->GetName(), item.second,
false);
129 double oldVal = _var.getVal();
133 std::span<const double>
pdfValues = _evaluator->run();
134 if (_dataWeights.empty()) {
138 for (std::size_t i = 0; i <
pdfValues.size(); ++i) {
149 double getMinLimit(
UInt_t )
const override {
return _var.getMin(); }
150 double getMaxLimit(
UInt_t )
const override {
return _var.getMax(); }
154 std::unique_ptr<RooAbsReal> _arg;
155 std::span<const double> _dataWeights;
157 std::unique_ptr<RooFit::Evaluator> _evaluator;
158 std::stack<std::vector<double>> _vectorBuffers;
161struct EvalErrorData {
162 using ErrorList = std::map<const RooAbsArg *, std::pair<std::string, std::list<RooAbsReal::EvalError>>>;
170 static EvalErrorData
data;
213 double inMaxVal,
const char *unit) :
226 _forceNumInt(
other._forceNumInt), _selectComp(
other._selectComp)
228 if (
other._specIntegratorConfig) {
331 <<
"): validation failed: " <<
value << std::endl ;
351 const RooArgSet* ,
const char* rangeName)
const
396 coutF(Eval) <<
"RooAbsReal::analyticalIntegral(" <<
GetName() <<
") code " << code <<
" not implemented" << std::endl ;
457 os <<
indent <<
"--- RooAbsReal ---" << std::endl;
487 return RooFit::makeOwningPtr<RooAbsReal>(std::move(out));
519 pc.
defineString(
"rangeName",
"RangeWithName",0,
"",
true) ;
520 pc.
defineSet(
"normSet",
"NormSet",0,
nullptr) ;
521 pc.
defineObject(
"numIntConfig",
"NumIntConfig",0,
nullptr) ;
530 const char* rangeName = pc.
getString(
"rangeName",
nullptr,
true) ;
555 if (!rangeName ||
strchr(rangeName,
',')==
nullptr) {
565 errMsg <<
GetName() <<
" : integrating with respect to the variables " <<
iset <<
" on the ranges \"" << rangeName
566 <<
"\" is not possible because the ranges are overlapping";
577 const std::string title = std::string(
"Integral of ") +
GetTitle();
580 auto out = std::make_unique<RooAddition>(
fullName.c_str(), title.c_str(), components);
581 out->addOwnedComponents(std::move(components));
582 return RooFit::makeOwningPtr<RooAbsReal>(std::move(out));
600 std::unique_ptr<RooAbsReal> integral;
605 const std::string title = std::string(
"Integral of ") +
GetTitle();
608 auto out = std::make_unique<RooRealIntegral>(
name.c_str(), title.c_str(), *
this,
iset, nset, cfg, rangeName);
609 return RooFit::makeOwningPtr<RooAbsReal>(std::move(out));
613 while(!
iset.empty()) {
628 const std::string title = std::string(
"Integral of ") + integrand->
GetTitle();
631 std::unique_ptr<RooAbsReal>
innerIntegral = std::move(integral);
634 integral = std::make_unique<RooRealIntegral>(
name.c_str(),title.c_str(),*integrand,
innerSet,nset,cfg,rangeName);
645 if (integrand ==
this && !
iset.empty()) {
646 coutI(Integration) <<
GetName() <<
" : multidimensional integration over observables with parameterized ranges in terms of other integrated observables detected, using recursive integration strategy to construct final integral" << std::endl ;
650 integrand = integral.get();
658 coutE(Integration) <<
GetName() <<
" : ERROR while defining recursive integral over observables with parameterized integration ranges, please check that integration rangs specify uniquely defined integral " << std::endl;
667 std::unique_ptr<RooArgSet>
intParams{integral->getVariables()};
673 <<
"-dim value cache for integral over " <<
iset2 <<
" as a function of " <<
cacheParams <<
" in range " << (rangeName?rangeName:
"<none>") << std::endl ;
674 std::string
name =
Form(
"%s_CACHE_[%s]",integral->GetName(),
cacheParams.contentsString().c_str()) ;
679 if (integral->operMode()==
ADirty) {
683 return RooFit::makeOwningPtr<RooAbsReal>(std::move(
cachedIntegral));
760 name.Append(
"|" + std::string{rangeName});
764 name.Append(
"_Int[]") ;
767 if (nset && !nset->
empty()) {
771 name.Append(
"|" + std::string{
thisPdf->normRange()}) ;
831 <<
"\" of wrong type: " << arg->
ClassName() << std::endl;
838 <<
"\" is not a dependent and will be ignored." << std::endl;
863 <<
"\" cannot be both a dependent and a projected variable." << std::endl;
874 coutE(Plotting) <<
"RooAbsPdf::createPlotProjection(" <<
GetName() <<
") Couldn't deep-clone PDF, abort," << std::endl ;
904 std::string title = std::string{
"Projection of "} +
GetTitle();
909 coutE(Plotting) <<
ClassName() <<
"::" <<
GetName() <<
":createPlotProjection: cannot integrate out ";
951 if(
nullptr == hist) {
952 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillHistogram: no valid histogram to fill" << std::endl;
959 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillHistogram: plotVars has the wrong dimension" << std::endl;
972 <<
"\" of type " << var->
ClassName() << std::endl;
977 <<
":fillHistogram: WARNING: variable is not an explicit dependent: " <<
realVar->GetName() << std::endl;
984 pc->recursiveRedirectServers(
plotClones,
false,
false,
true) ;
993 coutE(InputArguments) <<
"RooAbsReal::fillHistogram(" <<
GetName() <<
") error in checkObservables, abort" << std::endl ;
1001 cxcoutD(Plotting) <<
"RooAbsReal::fillHistogram(" <<
GetName() <<
") plot projection object is " <<
projected->GetName() << std::endl ;
1038 scaleFactor*= (
xaxis->GetXmax() -
xaxis->GetXmin())/xbins;
1042 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillHistogram: cannot fill histogram with "
1043 <<
hdim <<
" dimensions" << std::endl;
1054 for(
Int_t bin= 0; bin < bins; bin++) {
1057 if(bin % (xbins*
ybins) == 0) {
1063 if(bin % xbins == 0) {
1073 coutE(InputArguments) <<
"RooAbsReal::fillHistogram: Internal Error!" << std::endl;
1079 coutW(Plotting) <<
"WARNING: Function evaluation error(s) at coordinates [x]=" <<
xvar->getVal() ;
1082 ccoutW(Plotting) << std::endl ;
1127 if(
nullptr == hist) {
1128 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillDataHist: no valid RooDataHist to fill" << std::endl;
1135 coutE(InputArguments) <<
"RooAbsReal::fillDataHist(" <<
GetName() <<
") error in checkObservables, abort" << std::endl ;
1144 theClone->recursiveRedirectServers(*hist->
get()) ;
1154 ccoutP(Eval) <<
"." << std::flush ;
1187 std::vector<RooRealVar*>
histVars(3,
nullptr);
1192 std::stringstream
errMsg;
1193 errMsg <<
"RooAbsPdf::createHistogram(" <<
GetName() <<
") ERROR more than three variable names passed, but maximum number of supported variables is three";
1195 throw std::invalid_argument(
errMsg.str());
1199 std::stringstream
errMsg;
1200 errMsg <<
"RooAbsPdf::createHistogram(" <<
GetName() <<
") ERROR variable " <<
varNames[
iVar] <<
" does not exist in argset: " << *vars;
1202 throw std::runtime_error(
errMsg.str());
1286 pc.
defineInt(
"intBinning",
"IntrinsicBinning",0,2) ;
1287 pc.
defineInt(
"extended",
"Extended",0,2) ;
1289 pc.
defineSet(
"compSet",
"SelectCompSet",0);
1291 pc.
defineSet(
"projObs",
"ProjectedObservables",0,
nullptr) ;
1294 pc.
defineMutex(
"SelectCompSet",
"SelectCompSpec") ;
1296 pc.
defineMutex(
"IntrinsicBinning",
"BinningName") ;
1297 pc.
defineMutex(
"IntrinsicBinning",
"BinningSpec") ;
1326 coutW(InputArguments) <<
"RooAbsReal::createHistogram(" <<
GetName() <<
") WARNING extended mode requested for a non-pdf object, ignored" << std::endl ;
1330 coutW(InputArguments) <<
"RooAbsReal::createHistogram(" <<
GetName() <<
") WARNING extended mode requested for a non-extendable pdf, ignored" << std::endl ;
1350 coutW(InputArguments) <<
"RooAbsReal::createHistogram(" <<
GetName()
1351 <<
") WARNING, intrinsic model binning requested for histogram, but model does not define bin boundaries, reverting to default binning"<< std::endl ;
1355 coutI(InputArguments) <<
"RooAbsReal::createHistogram(" <<
GetName()
1356 <<
") INFO: Model has intrinsic binning definition, selecting that binning for the histogram"<< std::endl ;
1358 std::vector<double> edges(
bl->size());
1360 for (
auto const&
elem : *
bl) { edges[i++] =
elem ; }
1361 intBinning = std::make_unique<RooBinning>(
bl->size()-1,edges.data()) ;
1368 TH1* histo(
nullptr) ;
1398 coutI(Plotting) <<
"RooAbsPdf::createHistogram(" <<
GetName() <<
") directly selected PDF components: " << *
dirSelNodes << std::endl ;
1404 coutE(Plotting) <<
"RooAbsPdf::createHistogram(" <<
GetName() <<
") ERROR: component selection set " << *
compSet <<
" does not match any components of p.d.f." << std::endl ;
1406 coutE(Plotting) <<
"RooAbsPdf::createHistogram(" <<
GetName() <<
") ERROR: component selection expression '" <<
compSpec <<
"' does not select any components of p.d.f." << std::endl ;
1412 double scaleFactor(1.0) ;
1414 scaleFactor =
pdfSelf->expectedEvents(vars) ;
1466 if (
selNode->dependsOn(*arg,
nullptr,
true)) {
1482 coutI(Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") indirectly selected PDF components: " << tmp << std::endl ;
1654 pc.
defineString(
"projectionRangeName",
"ProjectionRange",0,
"",
true) ;
1655 pc.
defineString(
"curveNameSuffix",
"CurveNameSuffix",0,
"") ;
1656 pc.
defineString(
"sliceCatState",
"SliceCat",0,
"",
true) ;
1659 pc.
defineSet(
"sliceSet",
"SliceVars",0) ;
1660 pc.
defineObject(
"sliceCatList",
"SliceCat",0,
nullptr,
true) ;
1669 pc.
defineInt(
"doEvalError",
"EvalErrorValue",0,0) ;
1670 pc.
defineInt(
"shiftToZero",
"ShiftToZero",0,0) ;
1671 pc.
defineSet(
"projDataSet",
"ProjData",0) ;
1675 pc.
defineSet(
"errorPars",
"VisualizeError",0) ;
1676 pc.
defineInt(
"linearMethod",
"VisualizeError",0,0) ;
1677 pc.
defineInt(
"binProjData",
"ProjData",0,0) ;
1680 pc.
defineInt(
"numee",
"PrintEvalErrors",0,10) ;
1681 pc.
defineInt(
"rangeAdjustNorm",
"Range",0,0) ;
1682 pc.
defineInt(
"rangeWNAdjustNorm",
"RangeWithName",0,0) ;
1686 pc.
defineInt(
"markerColor",
"MarkerColor",0,-999) ;
1687 pc.
defineInt(
"markerStyle",
"MarkerStyle",0,-999) ;
1689 pc.
defineInt(
"lineColor",
"LineColor",0,-999) ;
1690 pc.
defineInt(
"lineStyle",
"LineStyle",0,-999) ;
1691 pc.
defineInt(
"lineWidth",
"LineWidth",0,-999) ;
1692 pc.
defineInt(
"fillColor",
"FillColor",0,-999) ;
1693 pc.
defineInt(
"fillStyle",
"FillStyle",0,-999) ;
1695 pc.
defineInt(
"curveInvisible",
"Invisible",0,0) ;
1696 pc.
defineInt(
"showProg",
"ShowProgress",0,0) ;
1698 pc.
defineInt(
"interleave",
"NumCPU",1,0) ;
1702 pc.
defineInt(
"moveToBack",
"MoveToBack",0,0) ;
1706 pc.
defineMutex(
"VisualizeError",
"VisualizeErrorData") ;
1719 pc.
getInt(
"linearMethod"));
1750 sliceSet = std::make_unique<RooArgSet>();
1799 coutE(InputArguments) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") cannot find existing curve " << o.
addToCurveName <<
" to add to in RooPlot" << std::endl ;
1805 cxcoutD(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Preprocessing: have slice " << *
sliceSet << std::endl ;
1814 coutI(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") slice variable "
1815 <<
sliceArg->GetName() <<
" was not projected anyway" << std::endl ;
1818 }
else if (projSet) {
1819 cxcoutD(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Preprocessing: have projSet " << *projSet << std::endl ;
1822 cxcoutD(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Preprocessing: have neither sliceSet nor projSet " << std::endl ;
1852 coutW(Plotting) <<
"Fill color or style was set for plotting \"" <<
GetName()
1853 <<
"\", but these only have an effect when 'DrawOption(\"F\")' for fill is used at the same time." << std::endl;
1890 cxcoutD(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") have ProjData with observables = " << *o.
projData->get() << std::endl ;
1893 cxcoutD(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") have ProjDataSet = " << *o.
projDataSet <<
" will only use this subset of projData" << std::endl ;
1895 cxcoutD(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") using full ProjData" << std::endl ;
1906 cxcoutD(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") have input projSet = " << *o.
projSet << std::endl ;
1908 cxcoutD(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") calculated projectedVars = " << *o.
projSet << std::endl ;
1915 cxcoutD(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") frame->getNormVars() that are also observables = " <<
sliceSetTmp << std::endl ;
1926 coutI(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") plot on "
1951 coutI(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") plot on " <<
plotVar->GetName()
1956 coutI(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") plot on " <<
plotVar->GetName()
1976 coutE(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") error in checkObservables, abort" << std::endl ;
1982 cxcoutD(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") plot projection object is " <<
projection->GetName() << std::endl ;
2033 coutI(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") reducing given projection dataset to entries with " <<
cutString << std::endl ;
2038 <<
") only the following components of the projection data will be used: " << *
projDataNeededVars << std::endl ;
2051 coutI(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") unbinned projection dataset consist only of discrete variables,"
2052 <<
" performing projection with binned copy for optimization." << std::endl ;
2073 std::string curveName(
projection->GetName()) ;
2074 curveName.append(
"_DataAvg[" +
projDataSel->get()->contentsString() +
"]");
2077 curveName.append(
"_Slice[" +
sliceSet.contentsString() +
"]");
2090 curve->SetName(curveName.c_str()) ;
2141 std::string curveName(
projection->GetName()) ;
2143 curveName.append(
"_Slice[" +
sliceSet.contentsString() +
"]");
2168 curve->SetName(curveName.c_str()) ;
2230 coutE(Plotting) <<
"RooAbsReal::plotAsymOn(" <<
GetName()
2231 <<
") function doesn't depend on asymmetry category " <<
asymCat.GetName() << std::endl ;
2237 coutE(Plotting) <<
"RooAbsReal::plotAsymOn(" <<
GetName()
2238 <<
") asymmetry category must have 2 or 3 states with index values -1,0,1" << std::endl ;
2261 coutI(Plotting) <<
"RooAbsReal::plotAsymOn(" <<
GetName() <<
") plot on "
2289 coutI(Plotting) <<
"RooAbsReal::plotAsymOn(" <<
GetName() <<
") plot on " <<
plotVar->GetName()
2293 coutI(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") plot on " <<
plotVar->GetName()
2326 coutE(Plotting) <<
"RooAbsReal::plotAsymOn(" <<
GetName() <<
") Unable to create projections, abort" << std::endl ;
2371 coutI(Plotting) <<
"RooAbsReal::plotAsymOn(" <<
GetName()
2372 <<
") reducing given projection dataset to entries with " <<
cutString << std::endl ;
2376 coutI(Plotting) <<
"RooAbsReal::plotAsymOn(" <<
GetName()
2377 <<
") only the following components of the projection data will be used: " << *
projDataNeededVars << std::endl ;
2412 ccoutW(Eval) << std::endl ;
2488 if (
rrvFitRes->getError() <= std::abs(
rrvFitRes->getVal()) * std::numeric_limits<double>::epsilon())
continue;
2496 std::stringstream
errMsg;
2497 errMsg <<
"RooAbsReal::getPropagatedError(): the parameters of the RooAbsReal don't have"
2498 <<
" the same values as in the fit result! The logic of getPropagatedError is broken in this case.";
2500 throw std::runtime_error(
errMsg.str());
2544 std::vector<double>
errVec(paramList.
size()) ;
2545 for (std::size_t i=0 ; i<paramList.
size() ; i++) {
2546 errVec[i] = std::sqrt(V(i,i)) ;
2547 for (std::size_t
j=i ;
j<paramList.
size() ;
j++) {
2548 C(i,
j) = V(i,
j) / std::sqrt(V(i,i)*V(
j,
j));
2555 for (std::size_t
j=0 ;
j<
plusVar.size() ;
j++) {
2560 double sum = F*(C*
F) ;
2608 if (std::string(
"Normalization")==
cmd->GetName()) {
2631 coutE(Plotting) <<
ClassName() <<
"::" <<
GetName() <<
":plotOnWithErrorBand: no curve for central value available" << std::endl;
2634 frame->
remove(
nullptr,
false) ;
2658 coutI(Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") INFO: visualizing " << Z <<
"-sigma uncertainties in parameters "
2659 <<
errorParams <<
" from fit result " << fr.
GetName() <<
" using " <<
n <<
" samplings." << std::endl ;
2665 std::vector<RooCurve*>
cvec ;
2670 frame->
remove(
nullptr,
false) ;
2682 for (std::vector<RooCurve*>::iterator i=
cvec.
begin() ; i!=
cvec.
end() ; ++i) {
2701 if (
frv->getError() >
frv->getVal() * std::numeric_limits<double>::epsilon()) {
2721 for (std::size_t i=0 ; i<
fpf.size() ; i++) {
2724 paramList.
add(*par) ;
2729 std::vector<RooCurve *>
plusVar;
2752 frame->
remove(
nullptr,
false) ;
2759 frame->
remove(
nullptr,
false) ;
2765 std::vector<double>
errVec(paramList.
size()) ;
2766 for (std::size_t i=0 ; i<paramList.
size() ; i++) {
2767 errVec[i] = sqrt(V(i,i)) ;
2768 for (std::size_t
j=i ;
j<paramList.
size() ;
j++) {
2769 C(i,
j) = V(i,
j)/sqrt(V(i,i)*V(
j,
j)) ;
2789 if (!
band)
return frame ;
2794 pc.
defineString(
"curveNameSuffix",
"CurveNameSuffix",0,
"") ;
2795 pc.
defineInt(
"lineColor",
"LineColor",0,-999) ;
2796 pc.
defineInt(
"lineStyle",
"LineStyle",0,-999) ;
2797 pc.
defineInt(
"lineWidth",
"LineWidth",0,-999) ;
2798 pc.
defineInt(
"markerColor",
"MarkerColor",0,-999) ;
2799 pc.
defineInt(
"markerStyle",
"MarkerStyle",0,-999) ;
2801 pc.
defineInt(
"fillColor",
"FillColor",0,-999) ;
2802 pc.
defineInt(
"fillStyle",
"FillStyle",0,-999) ;
2804 pc.
defineInt(
"curveInvisible",
"Invisible",0,0) ;
2805 pc.
defineInt(
"moveToBack",
"MoveToBack",0,0) ;
2836 if (pc.
getString(
"curveName",
nullptr,
true)) {
2838 }
else if (pc.
getString(
"curveNameSuffix",
nullptr,
true)) {
2862 if(
nullptr == frame) {
2871 <<
":plotOn: frame does not specify a plot variable" << std::endl;
2884 coutE(Plotting) <<
ClassName() <<
"::" <<
GetName() <<
":plotOn: WARNING: variable is not an explicit dependent: "
2885 << var->
GetName() << std::endl;
2905 cxcoutD(Plotting) <<
"RooAbsReal::makeProjectionSet(" <<
GetName() <<
") plotVar = " <<
plotVar->GetName()
2906 <<
" allVars = " << (allVars?(*allVars):
RooArgSet()) << std::endl ;
2924 cxcoutD(Plotting) <<
"RooAbsReal::makeProjectionSet(" <<
GetName() <<
") removing " << tmp->GetName()
2925 <<
" from projection set because it a server of " <<
plotVar->GetName() << std::endl ;
2932 <<
") WARNING: cannot project out frame variable ("
2933 << found->
GetName() <<
"), ignoring" << std::endl ;
2943 <<
") function doesn't depend on projection variable "
2944 << arg->
GetName() <<
", ignoring" << std::endl ;
2981 auto binding = std::make_unique<RooRealBinding>(*
this,vars,nset,
clipInvalid);
2982 if(!binding->isValid()) {
2983 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":bindVars: cannot bind to " << vars << std::endl ;
3041 coutE(Eval) <<
"RooAbsReal::attachToTree(" <<
GetName() <<
") ERROR: TTree branch " <<
GetName()
3042 <<
" is an array and cannot be attached to a RooAbsReal" << std::endl ;
3052 std::map<std::string, std::pair<std::string, std::function<std::unique_ptr<TreeReadBuffer>()>>>
typeMap {
3068 <<
" will be converted to double precision." << std::endl ;
3081 coutE(InputArguments) <<
"RooAbsReal::attachToTree(" <<
GetName() <<
") data type " << typeName <<
" is not supported." << std::endl ;
3103 coutE(Eval) <<
"RooAbsReal::fillTreeBranch(" <<
GetName() <<
") ERROR: not attached to tree: " <<
cleanBranchName() << std::endl ;
3132 fund->removeRange();
3134 fund->setAttribute(
"fundamentalCopy");
3135 return RooFit::makeOwningPtr<RooAbsArg>(std::move(
fund));
3311 if (config)
return config ;
3324 if (config)
return config ;
3426 ee.setMessage(message) ;
3433 oocoutE(
nullptr,Eval) <<
"RooAbsReal::logEvalError(" <<
"<STATIC>" <<
") evaluation error, " << std::endl
3434 <<
" origin : " <<
origName << std::endl
3435 <<
" message : " <<
ee._msg << std::endl
3436 <<
" server values: " <<
ee._srvval << std::endl ;
3482 ee.setMessage(message) ;
3488 std::ostringstream
oss ;
3499 p->print(
oss,
true) ;
3501 ee.setServerValues(
oss.str().c_str()) ;
3504 std::ostringstream
oss2 ;
3508 coutE(Eval) <<
"RooAbsReal::logEvalError(" <<
GetName() <<
") evaluation error, " << std::endl
3509 <<
" origin : " <<
oss2.str() << std::endl
3510 <<
" message : " <<
ee._msg << std::endl
3511 <<
" server values: " <<
ee._srvval << std::endl ;
3521 <<
") delayed evaluation error, " << std::endl
3522 <<
" origin : " <<
oss2.str() << std::endl
3523 <<
" message : " <<
oee._msg << std::endl
3524 <<
" server values: " <<
oee._srvval << std::endl ;
3584 os <<
evalErrorData().count <<
" errors counted" << std::endl;
3594 os << item.second.first;
3596 os <<
" has " << item.second.second.size() <<
" errors" << std::endl;
3601 os << item.second.first << std::endl;
3605 for (
auto const &
item2 : item.second.second) {
3606 os <<
" " <<
item2._msg <<
" @ " <<
item2._srvval << std::endl;
3608 os <<
" ... (remaining " << item.second.second.size() -
maxPerNode <<
" messages suppressed)"
3657 pdf->selectNormalization(
nullptr,
force) ;
3679 pdf->selectNormalizationRange(rangeName,
force) ;
3755 pc.
defineSet(
"supNormSet",
"SupNormSet",0,
nullptr) ;
3756 pc.
defineInt(
"numScanBins",
"ScanParameters",0,1000) ;
3757 pc.
defineInt(
"intOrder",
"ScanParameters",1,2) ;
3758 pc.
defineInt(
"doScanNum",
"ScanNum",0,1) ;
3759 pc.
defineInt(
"doScanAll",
"ScanAll",0,0) ;
3760 pc.
defineInt(
"doScanNon",
"ScanNone",0,0) ;
3792 coutI(NumIntegration) <<
"RooAbsPdf::createRunningIntegral(" <<
GetName() <<
") integration over observable(s) " <<
iset <<
" involves numeric integration," << std::endl
3793 <<
" constructing cdf though numeric integration of sampled pdf in " <<
numScanBins <<
" bins and applying order "
3794 <<
intOrder <<
" interpolation on integrated histogram." << std::endl
3795 <<
" To override this choice of technique use argument ScanNone(), to change scan parameters use ScanParameters(nbins,order) argument" << std::endl ;
3814 auto ret = std::make_unique<RooNumRunningInt>(
name.c_str(),
name.c_str(),*
this,*
ivar,
"numrunint") ;
3816 return RooFit::makeOwningPtr<RooAbsReal>(std::move(
ret));
3834 coutW(InputArguments) <<
"RooAbsPdf::createRunningIntegral(" <<
GetName() <<
") WARNING ignoring non-RooRealVar input argument " << arg->
GetName() << std::endl ;
3845 cust.setOwning(
false) ;
3874 cdf->addOwnedComponents(*tmp) ;
3891 coutE(InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified observables are not variables of this p.d.f" << std::endl ;
3897 coutE(InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified parameters are not variables of this p.d.f" << std::endl ;
3916 coutE(InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified observables are not variables of this p.d.f" << std::endl ;
3922 coutE(InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified parameters are not variables of this p.d.f" << std::endl ;
3927 for (std::size_t i=0 ; i<obs.
size() ; i++) {
3929 coutE(ObjectHandling) <<
"RooAbsReal::asTF(" <<
GetName() <<
") ERROR: proposed observable " << obs.
at(0)->
GetName() <<
" is not of type RooRealVar" << std::endl ;
3933 for (std::size_t i=0 ; i<pars.
size() ; i++) {
3935 coutE(ObjectHandling) <<
"RooAbsReal::asTF(" <<
GetName() <<
") ERROR: proposed parameter " << pars.
at(0)->
GetName() <<
" is not of type RooRealVar" << std::endl ;
3943 switch(obs.
size()) {
3966 coutE(InputArguments) <<
"RooAbsReal::asTF(" <<
GetName() <<
") ERROR: " << obs.
size()
3967 <<
" observables specified, but a ROOT TFx can only have 1,2 or 3 observables" << std::endl ;
3972 for (std::size_t i=0 ; i<pars.
size() ; i++) {
3974 tf->SetParameter(i,
p->getVal()) ;
3975 tf->SetParName(i,
p->GetName()) ;
4017 std::string title=
Form(
"%sMoment of order %d of %s w.r.t %s ",(central?
"Central ":
""),order,
GetName(),obs.
GetName()) ;
4036 std::string title=
Form(
"%sMoment of order %d of %s w.r.t %s ",(central?
"Central ":
""),order,
GetName(),obs.
GetName()) ;
4328 coutW(InputArguments) <<
"RooAbsReal::setParameterizeIntegral(" <<
GetName()
4329 <<
") function does not depend on listed parameter " << arg->
GetName() <<
", ignoring" << std::endl ;
4350 std::span<const double>
batch;
4382 _servers{servers} { }
4393 std::vector<ServerData>& _servers;
4400 coutI(FastEvaluations) <<
"The class " <<
ClassName() <<
" does not implement the faster batch evaluation interface."
4401 <<
" Consider requesting or implementing it to benefit from a speed up." << std::endl;
4407 for (std::size_t i=0; i <
output.size(); ++i) {
4409 serv.server->setCachedValue(
serv.batch[std::min(i,
serv.batch.size()-1)],
false);
4419 const double tmp =
_value;
4437 formatter <<
"--> (Scalar computation wrong here:)\n"
4439 <<
"\n\tcached _value=" << std::setprecision(16) << tmp
4440 <<
"\n\treturning =" <<
ret
4442 <<
"\n\tnew _value =" <<
_value <<
"] ";
4496 std::stringstream
errMsg;
4497 errMsg <<
"calling RooAbsReal::getVal() with r-value references to the normalization set is not allowed, because "
4498 "it breaks RooFits caching logic and potentially introduces significant overhead. Please explicitly "
4499 "create the RooArgSet outside the call to getVal().";
4501 throw std::runtime_error(
errMsg.str());
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
static void indent(ostringstream &buf, int indent_level)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
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 char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t SetLineColor
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 mode
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 format
TRObject operator()(const T1 &t1) const
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
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.
const TNamed * namePtr() const
De-duplicated pointer to this object's name.
void setShapeDirty()
Notify that a shape-like property (e.g. binning) has changed.
void setStringAttribute(const Text_t *key, const Text_t *value)
Associate string 'value' to this object under key 'key'.
bool isValueDirtyAndClear() const
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 > getObservables(const RooArgSet &set, bool valueOnly=true) const
Given a set of possible observables, return the observables that this PDF depends on.
const Text_t * getStringAttribute(const Text_t *key) const
Get string attribute mapped under key 'key'.
RooFit::OwningPtr< RooArgSet > getComponents() const
Create a RooArgSet with all components (branch nodes) of the expression tree headed by this object.
const RefCountList_t & servers() const
List of all servers of this object.
bool dependsOnValue(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=nullptr) const
Check whether this object depends on values from an element in the serverList.
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
RooFit::OwningPtr< RooArgSet > getVariables(bool stripDisconnected=true) const
Return RooArgSet with all variables (tree leaf nodes of expression tree)
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Implement multi-line detailed printing.
virtual RooAbsArg * cloneTree(const char *newname=nullptr) const
Clone tree expression of objects.
TString cleanBranchName() const
Construct a mangled name from the actual name that is free of any math symbols that might be interpre...
Int_t numProxies() const
Return the number of registered proxies.
static bool _inhibitDirty
void setAttribute(const Text_t *name, bool value=true)
Set (default) or clear a named boolean attribute of this object.
void setProxyNormSet(const RooArgSet *nset)
Forward a change in the cached normalization argset to all the registered proxies.
void branchNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=nullptr, bool recurseNonDerived=false) const
Fill supplied list with all branch nodes of the arg tree starting with ourself as top node.
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
TObject * Clone(const char *newname=nullptr) const override
Make a clone of an object using the Streamer facility.
RefCountList_t _serverList
void leafNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=nullptr, bool recurseNonDerived=false) const
Fill supplied list with all leaf nodes of the arg tree, starting with ourself as top node.
virtual bool isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
virtual bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursiveStep)
Function that is called at the end of redirectServers().
virtual bool checkObservables(const RooArgSet *nset) const
Overloadable function in which derived classes can implement consistency checks of the variables.
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...
Abstract base class for RooRealVar binning definitions.
virtual bool isParameterized() const
Interface function.
virtual RooAbsReal * highBoundFunc() const
Return pointer to RooAbsReal parameterized upper bound, if any.
virtual RooAbsReal * lowBoundFunc() const
Return pointer to RooAbsReal parameterized lower bound, if any.
Abstract base class for objects that represent a discrete value that can be set from the outside,...
A space to attach TBranches.
virtual value_type getCurrentIndex() const
Return index number of current state.
Abstract container object that can hold multiple RooAbsArg objects.
RooFit::UniqueId< RooAbsCollection > const & uniqueId() const
Returns a unique ID that is different for every instantiated RooAbsCollection.
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.
Storage_t::size_type size() const
virtual bool addOwned(RooAbsArg &var, bool silent=false)
Add an argument and transfer the ownership to the collection.
Abstract base class for binned and unbinned datasets.
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Abstract base class for objects that are lvalues, i.e.
Abstract interface for all probability density functions.
Abstract interface for proxy classes.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
virtual double getMax(const char *name=nullptr) const
Get maximum of currently defined range.
virtual double getMin(const char *name=nullptr) const
Get minimum of currently defined range.
Abstract base class for objects that represent a real value and implements functionality common to al...
RooDataHist * fillDataHist(RooDataHist *hist, const RooArgSet *nset, double scaleFactor, bool correctForBinVolume=false, bool showProgress=false) const
Fill a RooDataHist with values sampled from this function at the bin centers.
virtual void selectNormalizationRange(const char *rangeName=nullptr, bool force=false)
Interface function to force use of a given normalization range to interpret function value.
void plotOnCompSelect(RooArgSet *selNodes) const
Helper function for plotting of composite p.d.fs.
bool isSelectedComp() const
If true, the current pdf is a selected component (for use in plotting)
virtual std::list< double > * binBoundaries(RooAbsRealLValue &obs, double xlo, double xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
void selectComp(bool flag)
TString _label
Plot label for objects value.
bool _selectComp
A buffer for reading values from trees.
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
double findRoot(RooRealVar &x, double xmin, double xmax, double yval)
Return value of x (in range xmin,xmax) at which function equals yval.
TreeReadBuffer * _treeReadBuffer
virtual double getValV(const RooArgSet *normalisationSet=nullptr) const
Return value of object.
static Int_t numEvalErrorItems()
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
friend class RooRealBinding
virtual void fixAddCoefNormalization(const RooArgSet &addNormSet=RooArgSet(), bool force=true)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=nullptr) const
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
bool _forceNumInt
Force numerical integration if flag set.
~RooAbsReal() override
Destructor.
void setParameterizeIntegral(const RooArgSet ¶mVars)
bool matchArgsByName(const RooArgSet &allArgs, RooArgSet &matchedArgs, const TList &nameList) const
Check if allArgs contains matching elements for each name in nameList.
void setTreeBranchStatus(TTree &t, bool active) override
(De)Activate associated tree branch
TH1 * fillHistogram(TH1 *hist, const RooArgList &plotVars, double scaleFactor=1, const RooArgSet *projectedVars=nullptr, bool scaling=true, const RooArgSet *condObs=nullptr, bool setError=true) const
Fill the ROOT histogram 'hist' with values sampled from this function at the bin centers.
RooFit::OwningPtr< RooAbsReal > createScanRI(const RooArgSet &iset, const RooArgSet &nset, Int_t numScanBins, Int_t intOrder)
Utility function for createRunningIntegral that construct an object implementing the numeric scanning...
double _DEBUG_getVal(const RooArgSet *normalisationSet) const
Debug version of getVal(), which is slow and does error checking.
RooFit::OwningPtr< RooAbsArg > createFundamental(const char *newname=nullptr) const override
Create a RooRealVar fundamental object with our properties.
bool plotSanityChecks(RooPlot *frame) const
Utility function for plotOn(), perform general sanity check on frame to ensure safe plotting operatio...
RooFit::OwningPtr< RooAbsFunc > bindVars(const RooArgSet &vars, const RooArgSet *nset=nullptr, bool clipInvalid=false) const
Create an interface adaptor f(vars) that binds us to the specified variables (in arbitrary order).
virtual void selectNormalization(const RooArgSet *depSet=nullptr, bool force=false)
Interface function to force use of a given set of observables to interpret function value.
RooDerivative * derivative(RooRealVar &obs, Int_t order=1, double eps=0.001)
Return function representing first, second or third order derivative of this function.
virtual RooFit::OwningPtr< RooFitResult > chi2FitTo(RooDataHist &data, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={})
Perform a fit to given histogram.
TF1 * asTF(const RooArgList &obs, const RooArgList &pars=RooArgList(), const RooArgSet &nset=RooArgSet()) const
Return a ROOT TF1,2,3 object bound to this RooAbsReal with given definition of observables and parame...
TString _unit
Unit for objects value.
static RooNumIntConfig * defaultIntegratorConfig()
Returns the default numeric integration configuration for all RooAbsReals.
bool readFromStream(std::istream &is, bool compact, bool verbose=false) override
Read object contents from stream (dummy for now)
bool matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
void fillTreeBranch(TTree &t) override
Fill the tree branch that associated with this object with its current value.
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Structure printing.
virtual RooPlot * plotAsymOn(RooPlot *frame, const RooAbsCategoryLValue &asymCat, PlotOpt o) const
bool operator==(double value) const
Equality operator comparing to a double.
static ErrorLoggingMode evalErrorLoggingMode()
Return current evaluation error logging mode.
bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursiveStep) override
Function that is called at the end of redirectServers().
virtual bool isValidReal(double, bool printError=false) const
Interface function to check if given value is a valid value for this object. Returns true unless over...
void setIntegratorConfig()
Remove the specialized numeric integration configuration associated with this object.
void printValue(std::ostream &os) const override
Print object value.
bool isIdentical(const RooAbsArg &other, bool assumeSameType=false) const override
virtual RooFit::OwningPtr< RooAbsReal > createProfile(const RooArgSet ¶msOfInterest)
Create a RooProfileLL object that eliminates all nuisance parameters in the present function.
static bool _hideOffset
Offset hiding flag.
void attachToVStore(RooVectorDataStore &vstore) override
void copyCache(const RooAbsArg *source, bool valueOnly=false, bool setValDirty=true) override
Copy the cached value of another RooAbsArg to our cache.
TH1 * createHistogram(RooStringView varNameList, Int_t xbins=0, Int_t ybins=0, Int_t zbins=0) const
Create and fill a ROOT histogram TH1, TH2 or TH3 with the values of this function for the variables w...
virtual void fixAddCoefRange(const char *rangeName=nullptr, bool force=true)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
double _value
Cache for current value of object.
virtual double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
void attachToTree(TTree &t, Int_t bufSize=32000) override
Attach object to a branch of given TTree.
RooNumIntConfig * specialIntegratorConfig() const
Returns the specialized integrator configuration for this RooAbsReal.
void writeToStream(std::ostream &os, bool compact) const override
Write object contents to stream (dummy for now)
double traceEval(const RooArgSet *set) const
Calculate current value of object, with error tracing wrapper.
double getPropagatedError(const RooFitResult &fr, const RooArgSet &nset={}) const
Propagates parameter uncertainties to an uncertainty estimate for this RooAbsReal.
static void setHideOffset(bool flag)
static void globalSelectComp(bool flag)
Global switch controlling the activation of the selectComp() functionality.
RooAbsMoment * moment(RooRealVar &obs, Int_t order, bool central, bool takeRoot)
Return function representing moment of function of given order.
RooPlot * plotOnWithErrorBand(RooPlot *frame, const RooFitResult &fr, double Z, const RooArgSet *params, const RooLinkedList &argList, bool method1) const
Plot function or PDF on frame with support for visualization of the uncertainty encoded in the given ...
RooFit::UniqueId< RooArgSet >::Value_t _lastNormSetId
Component selection flag for RooAbsPdf::plotCompOn.
const char * getPlotLabel() const
Get the label associated with the variable.
RooFit::OwningPtr< RooAbsReal > createRunningIntegral(const RooArgSet &iset, const RooArgSet &nset={})
Calls createRunningIntegral(const RooArgSet&, const RooCmdArg&, const RooCmdArg&, const RooCmdArg&,...
std::unique_ptr< RooNumIntConfig > _specIntegratorConfig
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
static std::map< constRooAbsArg *, std::pair< std::string, std::list< RooAbsReal::EvalError > > >::iterator evalErrorIter()
static Int_t numEvalErrors()
Return the number of logged evaluation errors since the last clearing.
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
virtual void preferredObservableScanOrder(const RooArgSet &obs, RooArgSet &orderedObs) const
Interface method for function objects to indicate their preferred order of observables for scanning t...
virtual double maxVal(Int_t code) const
Return maximum value for set of observables identified by code assigned in getMaxVal.
void findInnerMostIntegration(const RooArgSet &allObs, RooArgSet &innerObs, const char *rangeName) const
Utility function for createIntObj() that aids in the construct of recursive integrals over functions ...
TString integralNameSuffix(const RooArgSet &iset, const RooArgSet *nset=nullptr, const char *rangeName=nullptr, bool omitEmpty=false) const
Construct string with unique suffix name to give to integral object that encodes integrated observabl...
virtual double evaluate() const =0
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
TString getTitle(bool appendUnit=false) const
Return this variable's title string.
void logEvalError(const char *message, const char *serverValueString=nullptr) const
Log evaluation error message.
virtual double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
const Text_t * getUnit() const
const RooNumIntConfig * getIntegratorConfig() const
Return the numeric integration configuration used for this object.
static void printEvalErrors(std::ostream &os=std::cout, Int_t maxPerNode=10000000)
Print all outstanding logged evaluation error on the given ostream.
RooFit::OwningPtr< RooAbsReal > createIntRI(const RooArgSet &iset, const RooArgSet &nset={})
Utility function for createRunningIntegral.
virtual void enableOffsetting(bool)
static void clearEvalErrorLog()
Clear the stack of evaluation error messages.
RooFit::OwningPtr< RooAbsReal > createIntObj(const RooArgSet &iset, const RooArgSet *nset, const RooNumIntConfig *cfg, const char *rangeName) const
Internal utility function for createIntegral() that creates the actual integral object.
RooFunctor * functor(const RooArgList &obs, const RooArgList &pars=RooArgList(), const RooArgSet &nset=RooArgSet()) const
Return a RooFunctor object bound to this RooAbsReal with given definition of observables and paramete...
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}, const RooCmdArg &arg9={}, const RooCmdArg &arg10={}) const
Plot (project) PDF on specified frame.
const RooAbsReal * createPlotProjection(const RooArgSet &depVars, const RooArgSet &projVars, RooArgSet *&cloneSet) const
Utility function for plotOn() that creates a projection of a function or p.d.f to be plotted on a Roo...
virtual std::list< double > * plotSamplingHint(RooAbsRealLValue &obs, double xlo, double xhi) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
void setPlotLabel(const char *label)
Set the label associated with this variable.
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Create an object that represents the integral of the function over one or more observables listed in ...
virtual void doEval(RooFit::EvalContext &) const
Base function for computing multiple values of a RooAbsReal.
void makeProjectionSet(const RooAbsArg *plotVar, const RooArgSet *allVars, RooArgSet &projectedVars, bool silent) const
Utility function for plotOn() that constructs the set of observables to project when plotting ourselv...
virtual Int_t getMaxVal(const RooArgSet &vars) const
Advertise capability to determine maximum value of function for given set of observables.
virtual RooFit::OwningPtr< RooAbsReal > createChi2(RooDataHist &data, const RooLinkedList &cmdList)
virtual double offset() const
static bool _globalSelectComp
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.
Abstract interface for RooAbsArg proxy classes.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
Implement the abstract 1-dimensional root finding interface using the Brent-Decker method.
bool findRoot(double &result, double xlo, double xhi, double value=0) const
Do the root finding using the Brent-Decker method.
Object to represent discrete states.
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.
Configurable parser for RooCmdArg named arguments.
void defineMutex(const char *head, Args_t &&... tail)
Define arguments where any pair is mutually exclusive.
bool process(const RooCmdArg &arg)
Process given RooCmdArg.
bool hasProcessed(const char *cmdName) const
Return true if RooCmdArg with name 'cmdName' has been processed.
double getDouble(const char *name, double defaultValue=0.0) const
Return double property registered with name 'name'.
bool defineDouble(const char *name, const char *argName, int doubleNum, double defValue=0.0)
Define double property name 'name' mapped to double in slot 'doubleNum' in RooCmdArg with name argNam...
static void stripCmdList(RooLinkedList &cmdList, const char *cmdsToPurge)
Utility function that strips command names listed (comma separated) in cmdsToPurge from cmdList.
RooArgSet * getSet(const char *name, RooArgSet *set=nullptr) const
Return RooArgSet property registered with name 'name'.
bool defineSet(const char *name, const char *argName, int setNum, const RooArgSet *set=nullptr)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
bool ok(bool verbose) const
Return true of parsing was successful.
bool defineObject(const char *name, const char *argName, int setNum, const TObject *obj=nullptr, bool isArray=false)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
const char * getString(const char *name, const char *defaultValue="", bool convEmptyToNull=false) const
Return string property registered with name 'name'.
bool defineString(const char *name, const char *argName, int stringNum, const char *defValue="", bool appendMode=false)
Define double property name 'name' mapped to double in slot 'stringNum' in RooCmdArg with name argNam...
const RooLinkedList & getObjectList(const char *name) const
Return list of objects registered with name 'name'.
bool defineInt(const char *name, const char *argName, int intNum, int defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
void allowUndefined(bool flag=true)
If flag is true the processing of unrecognized RooCmdArgs is not considered an error.
int getInt(const char *name, int defaultValue=0) const
Return integer property registered with name 'name'.
TObject * getObject(const char *name, TObject *obj=nullptr) const
Return TObject property registered with name 'name'.
One-dimensional graphical representation of a real-valued function.
RooCustomizer is a factory class to produce clones of a prototype composite PDF object with the same ...
Container class to hold N-dimensional binned data.
void set(std::size_t binNumber, double weight, double wgtErr)
Set bin content of bin that was last loaded with get(std::size_t).
double binVolume(std::size_t i) const
Return bin volume of i-th bin.
const RooArgSet * get() const override
Get bin centre of current bin.
Container class to hold unbinned data.
Represents the first, second, or third order derivative of any RooAbsReal as calculated (numerically)...
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
const TMatrixDSym & covarianceMatrix() const
Return covariance matrix.
TMatrixDSym reducedCovarianceMatrix(const RooArgList ¶ms) const
Return a reduced covariance matrix (Note that Vred is a simple sub-matrix of V, row/columns are order...
const RooArgList & floatParsFinal() const
Return list of floating parameters after fit.
RooAbsPdf * createHessePdf(const RooArgSet ¶ms) const
Return a p.d.f that represents the fit result as a multi-variate probability densisty function on the...
std::span< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
std::span< double > output()
Lightweight interface adaptor that exports a RooAbsPdf as a functor.
Graphical representation of binned data based on the TGraphAsymmErrors class.
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
void Delete(Option_t *o=nullptr) override
Remove all elements in collection and delete all elements NB: Collection does not own elements,...
virtual void Add(TObject *arg)
TObject * FindObject(const char *name) const override
Return pointer to object with given name.
static RooMsgService & instance()
Return reference to singleton instance.
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
static RooNumIntConfig & defaultConfig()
Return reference to instance of default numeric integrator configuration object.
Implementation of RooAbsBinning that constructs a binning with a range definition that depends on ext...
Plot frame and a container for graphics objects within that frame.
void remove(const char *name=nullptr, bool deleteToo=true)
Remove object with given name, or last object added if no name is given.
bool drawBefore(const char *before, const char *target)
Change the order in which our contained objects are drawn so that the target object is drawn just bef...
TObject * findObject(const char *name, const TClass *tClass=nullptr) const
Find the named object in our list of items and return a pointer to it.
virtual void SetMinimum(double minimum=-1111)
Set minimum value of Y axis.
const RooArgSet * getNormVars() const
double GetMaximum(double maxval=FLT_MAX) const
TAttLine * getAttLine(const char *name=nullptr) const
Return a pointer to the line attributes of the named object in this plot, or zero if the named object...
TAttFill * getAttFill(const char *name=nullptr) const
Return a pointer to the fill attributes of the named object in this plot, or zero if the named object...
TObject * getObject(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
virtual void SetMaximum(double maximum=-1111)
Set maximum value of Y axis.
RooAbsRealLValue * getPlotVar() const
TAttMarker * getAttMarker(const char *name=nullptr) const
Return a pointer to the marker attributes of the named object in this plot, or zero if the named obje...
RooCurve * getCurve(const char *name=nullptr) const
Return a RooCurve pointer of the named object in this plot, or zero if the named object does not exis...
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", bool invisible=false, bool refreshNorm=false)
Add the specified plotable object to our plot.
double GetMinimum(double minval=-FLT_MAX) const
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
Performs hybrid numerical/analytical integrals of RooAbsReal objects.
const RooArgSet & numIntRealVars() const
void setAllowComponentSelection(bool allow)
Set component selection to be allowed/forbidden.
Variable that can be changed from the outside.
The RooStringView is a wrapper around a C-style string that can also be constructed from a std::strin...
Uses std::vector to store data columns.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Class to manage histogram axis.
A TTree is a list of TBranches.
A 2-Dim function with parameters.
A 3-Dim function with parameters.
void SetName(const char *name="") override
Set graph name.
TH1 is the base class of all histogram classes in ROOT.
virtual Int_t GetNbinsY() const
virtual Int_t GetNbinsZ() const
virtual Int_t GetDimension() const
virtual Int_t GetBin(Int_t binx, Int_t biny=0, Int_t binz=0) const
Return Global bin number corresponding to binx,y,z.
virtual Int_t GetNbinsX() const
virtual void SetBinError(Int_t bin, Double_t error)
Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empt...
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Collectable string class.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
const char * Data() const
TString & Prepend(const char *cs)
TString & Append(const char *cs)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void StackTrace()
Print a stack trace.
A TTree represents a columnar dataset.
virtual void SetBranchStatus(const char *bname, bool status=true, UInt_t *found=nullptr)
Set branch status to Process or DoNotProcess.
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=nullptr)
Change branch address, dealing with clone trees properly.
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
RooCmdArg ZVar(const RooAbsRealLValue &var, const RooCmdArg &arg={})
RooCmdArg SupNormSet(const RooArgSet &nset)
RooCmdArg YVar(const RooAbsRealLValue &var, const RooCmdArg &arg={})
RooCmdArg Binning(const RooAbsBinning &binning)
RooCmdArg NormRange(const char *rangeNameList)
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
std::unique_ptr< T > compileForNormSet(T const &arg, RooArgSet const &normSet)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
OwningPtr< T > makeOwningPtr(std::unique_ptr< T > &&ptr)
Internal helper to turn a std::unique_ptr<T> into an OwningPtr.
RooArgSet selectFromArgSet(RooArgSet const &, std::string const &names)
bool checkIfRangesOverlap(RooArgSet const &observables, std::vector< std::string > const &rangeNames)
std::string getColonSeparatedNameString(RooArgSet const &argSet, char delim=':')
Double_t Erfc(Double_t x)
Computes the complementary error function erfc(x).
const char * normRangeName
RooFit::MPSplit interleave
const char * projectionRangeName
const RooArgSet * projDataSet
const char * curveNameSuffix
const char * addToCurveName
const RooFitResult * errorFR
const RooArgSet * projSet
const RooAbsData * projData
A UniqueId can be added as a class member to enhance any class with a unique identifier for each inst...
constexpr Value_t value() const
Return numerical value of ID.
static uint64_t sum(uint64_t i)