185inline double getLog(
double prob,
RooAbsReal const *caller)
189 caller->
logEvalError(
"getLogVal() top-level p.d.f evaluates to a negative number");
193 if (std::isinf(prob)) {
194 oocoutW(caller, Eval) <<
"RooAbsPdf::getLogVal(" << caller->
GetName()
195 <<
") WARNING: top-level pdf has an infinite value" << std::endl;
199 caller->
logEvalError(
"getLogVal() top-level p.d.f evaluates to zero");
201 return -std::numeric_limits<double>::infinity();
205 caller->
logEvalError(
"getLogVal() top-level p.d.f evaluates to NaN");
210 return std::log(prob);
224using std::endl, std::string, std::ostream, std::vector, std::pair, std::make_pair;
255 double plotMin,
double plotMax) :
315 bool nintChanged(
false) ;
327 const double normVal =
_norm->getVal();
347 cxcoutD(Eval) <<
"RooAbsPdf::analyticalIntegralWN(" <<
GetName() <<
") code = " << code <<
" normset = " << (normSet?*normSet:
RooArgSet()) << std::endl ;
350 if (code==0)
return getVal(normSet) ;
370 logEvalError(
Form(
"p.d.f value is Not-a-Number (%f), forcing value to zero",value)) ;
374 logEvalError(
Form(
"p.d.f value is less than zero (%f), forcing value to zero",value)) ;
379 if(!error)
return error ;
402 if (!nset)
return 1 ;
410 coutW(Eval) <<
"RooAbsPdf::getNorm(" <<
GetName() <<
":: WARNING normalization is zero, nset = " ; nset->
Print(
"1") ;
411 if(
_errorCount == 10)
coutW(Eval) <<
"RooAbsPdf::getNorm(" <<
GetName() <<
") INFO: no more messages will be printed " << std::endl ;
429 return cache->
_norm.get();
470 bool nintChanged = (
_norm != cache->
_norm.get());
499 <<
") recreating normalization integral " << std::endl;
503 <<
") selfNormalized, creating unit norm" << std::endl;
509 auto ntitle = std::string(
GetTitle()) +
" Unit Normalization";
510 auto nname = std::string(
GetName()) +
"_UnitNorm";
526 static_cast<RooRealIntegral *
>(normInt)->setAllowComponentSelection(
false);
531 if (cacheParamsStr && strlen(cacheParamsStr)) {
533 std::unique_ptr<RooArgSet> intParams{normInt->
getVariables()};
537 if (!cacheParams.
empty()) {
538 cxcoutD(Caching) <<
"RooAbsReal::createIntObj(" <<
GetName() <<
") INFO: constructing "
539 << cacheParams.
size() <<
"-dim value cache for integral over " << depList
540 <<
" as a function of " << cacheParams <<
" in range " << (nr ? nr :
"<default>")
550 normInt = cachedIntegral;
592 if (pdf) pdf->setTraceCounter(value,
false) ;
607 return getLog(
getVal(nset),
this);
624bool checkInfNaNNeg(
const T& inputs) {
630 for (
double val : inputs) {
631 inf |= !std::isfinite(val);
636 return inf || nan || neg;
647 for (
unsigned int i=0; i<outputs.size(); ++i) {
648 const double value = outputs[i];
652 }
else if (!std::isfinite(outputs[i])){
655 }
else if (outputs[i] < 0.) {
656 logEvalError(
Form(
"p.d.f value of (%s) is less than zero (%f) for entry %zu",
664 for (std::size_t i = 0; i < pdfValues.size(); ++i) {
665 output[i] = getLog(pdfValues[i],
this);
726 coutE(InputArguments) <<
GetName() <<
": this PDF does not support extended maximum likelihood"
732 coutE(InputArguments) <<
GetName() <<
": calculated negative expected events: " << expected
734 logEvalError(
"extendedTerm #expected events is <0 return a NaN");
740 if (std::abs(expected)<1
e-10 && std::abs(sumEntries)<1
e-10) {
746 logEvalError(
"extendedTerm #expected events is a NaN") ;
750 double extra = doOffset
751 ? (expected - sumEntries) - sumEntries * (std::log(expected) - std::log(sumEntries))
752 : expected - sumEntries * std::log(expected);
754 if(sumEntriesW2 != 0.0) {
755 extra *= sumEntriesW2 / sumEntries;
786 double sumW = data.sumEntries();
789 sumW2 = data.sumEntriesW2();
935 return RooFit::FitHelpers::createNLL(*
this, data, cmdList);
1065 return RooFit::FitHelpers::fitTo(*
this, data, cmdList,
false);
1094 os <<
indent <<
"--- RooAbsPdf ---" << std::endl;
1095 os <<
indent <<
"Cached value = " <<
_value << std::endl ;
1097 os <<
indent <<
" Normalization integral: " << std::endl ;
1098 auto moreIndent = std::string(
indent.Data()) +
" " ;
1119 const RooArgSet* auxProto,
bool verbose)
const
1121 return new RooGenContext(*
this,vars,prototype,auxProto,verbose) ;
1128 bool verbose,
bool autoBinned,
const char* binnedTag)
const
1130 if (prototype || (auxProto && !auxProto->
empty())) {
1131 return genContext(vars,prototype,auxProto,verbose);
1138 context=
genContext(vars,
nullptr,
nullptr,verbose);
1208 pc.
defineInt(
"randProto",
"PrototypeData",0,0) ;
1209 pc.
defineInt(
"resampleProto",
"PrototypeData",1,0) ;
1211 pc.
defineInt(
"extended",
"Extended",0,0) ;
1212 pc.
defineInt(
"nEvents",
"NumEvents",0,0) ;
1213 pc.
defineInt(
"autoBinned",
"AutoBinned",0,1) ;
1214 pc.
defineInt(
"expectedData",
"ExpectedData",0,0) ;
1221 pc.
process(arg1,arg2,arg3,arg4,arg5,arg6) ;
1228 const char* dsetName = pc.
getString(
"dsetName") ;
1229 bool verbose = pc.
getInt(
"verbose") ;
1230 bool randProto = pc.
getInt(
"randProto") ;
1231 bool resampleProto = pc.
getInt(
"resampleProto") ;
1232 bool extended = pc.
getInt(
"extended") ;
1233 bool autoBinned = pc.
getInt(
"autoBinned") ;
1234 const char* binnedTag = pc.
getString(
"binnedTag") ;
1236 double nEventsD = pc.
getInt(
"nEventsD") ;
1238 bool expectedData = pc.
getInt(
"expectedData") ;
1240 double nEvents = (nEventsD>0) ? nEventsD :
double(nEventsI);
1249 }
else if (nEvents==0) {
1250 cxcoutI(Generation) <<
"No number of events specified , number of events generated is "
1254 if (extended && protoData && !randProto) {
1255 cxcoutI(Generation) <<
"WARNING Using generator option Extended() (Poisson distribution of #events) together "
1256 <<
"with a prototype dataset implies incomplete sampling or oversampling of proto data. "
1257 <<
"Set randomize flag in ProtoData() option to randomize prototype dataset order and thus "
1258 <<
"to randomize the set of over/undersampled prototype events for each generation cycle." << std::endl ;
1263 std::unique_ptr<RooDataSet> data;
1265 data = std::unique_ptr<RooDataSet>{
generate(whatVars,*protoData,
Int_t(nEvents),verbose,randProto,resampleProto)};
1267 data = std::unique_ptr<RooDataSet>{
generate(whatVars,nEvents,verbose,autoBinned,binnedTag,expectedData, extended)};
1271 if (dsetName && strlen(dsetName)>0) {
1272 data->SetName(dsetName) ;
1300 pc.
defineInt(
"randProto",
"PrototypeData",0,0) ;
1301 pc.
defineInt(
"resampleProto",
"PrototypeData",1,0) ;
1303 pc.
defineInt(
"extended",
"Extended",0,0) ;
1304 pc.
defineInt(
"nEvents",
"NumEvents",0,0) ;
1305 pc.
defineInt(
"autoBinned",
"AutoBinned",0,1) ;
1311 pc.
process(arg1,arg2,arg3,arg4,arg5,arg6) ;
1318 const char* dsetName = pc.
getString(
"dsetName") ;
1320 bool verbose = pc.
getInt(
"verbose") ;
1321 bool randProto = pc.
getInt(
"randProto") ;
1322 bool resampleProto = pc.
getInt(
"resampleProto") ;
1323 bool extended = pc.
getInt(
"extended") ;
1324 bool autoBinned = pc.
getInt(
"autoBinned") ;
1325 const char* binnedTag = pc.
getString(
"binnedTag") ;
1329 return new GenSpec(cx,whatVars,protoData,nEvents,extended,randProto,resampleProto,dsetName) ;
1383 std::unique_ptr<RooAbsGenContext> context{
autoGenContext(whatVars,
nullptr,
nullptr,verbose,autoBinned,binnedTag)};
1385 context->setExpectedData(
true) ;
1388 std::unique_ptr<RooDataSet> generated;
1389 if(
nullptr != context && context->isValid()) {
1390 generated = std::unique_ptr<RooDataSet>{context->generate(nEvents,
false, extended)};
1393 coutE(Generation) <<
"RooAbsPdf::generate(" <<
GetName() <<
") cannot create a valid context" << std::endl;
1405 double nEvents,
bool ,
bool randProtoOrder,
bool resampleProto,
1406 bool skipInit,
bool extended)
const
1408 if (nEvents==0 && (prototype==
nullptr || prototype->
numEntries()==0)) {
1409 return std::make_unique<RooDataSet>(
"emptyData",
"emptyData",whatVars);
1412 std::unique_ptr<RooDataSet> generated;
1415 if (resampleProto) {
1416 randProtoOrder=true ;
1419 if (randProtoOrder && prototype && prototype->
numEntries()!=nEvents) {
1420 coutI(Generation) <<
"RooAbsPdf::generate (Re)randomizing event order in prototype dataset (Nevt=" << nEvents <<
")" << std::endl ;
1427 generated = std::unique_ptr<RooDataSet>{context.
generate(nEvents,skipInit,extended)};
1430 coutE(Generation) <<
"RooAbsPdf::generate(" <<
GetName() <<
") do not have a valid generator context" << std::endl;
1461 Int_t nEvents,
bool verbose,
bool randProtoOrder,
bool resampleProto)
const
1463 std::unique_ptr<RooAbsGenContext> context{
genContext(whatVars,&prototype,
nullptr,verbose)};
1467 coutE(Generation) <<
"RooAbsPdf::generate(" <<
GetName() <<
") ERROR creating generator context" << std::endl ;
1482 if (!resampleProto) {
1484 std::iota(lut, lut + nProto, 0);
1490 for (
int i = nProto-1; i > 0; --i) {
1555 if(server == &arg)
continue;
1556 if(server->dependsOn(arg)) {
1597 pc.
defineInt(
"extended",
"Extended",0,0) ;
1598 pc.
defineInt(
"nEvents",
"NumEvents",0,0) ;
1600 pc.
defineInt(
"expectedData",
"ExpectedData",0,0) ;
1603 pc.
process(arg1,arg2,arg3,arg4,arg5,arg6) ;
1609 double nEvents = pc.
getDouble(
"nEventsD") ;
1611 nEvents = pc.
getInt(
"nEvents") ;
1614 bool extended = pc.
getInt(
"extended") ;
1615 bool expectedData = pc.
getInt(
"expectedData") ;
1616 const char* dsetName = pc.
getString(
"dsetName") ;
1621 cxcoutI(Generation) <<
" Extended mode active, number of events generated (" << nEvents <<
") is Poisson fluctuation on "
1622 <<
GetName() <<
"::expectedEvents() = " << nEvents << std::endl ;
1627 }
else if (nEvents==0) {
1628 cxcoutI(Generation) <<
"No number of events specified , number of events generated is "
1633 auto data =
generateBinned(whatVars,nEvents,expectedData,extended);
1636 if (dsetName && strlen(dsetName)>0) {
1637 data->SetName(dsetName) ;
1674 auto hist = std::make_unique<RooDataHist>(
"genData",
"genData",whatVars);
1679 coutE(InputArguments) <<
"RooAbsPdf::generateBinned(" <<
GetName() <<
") ERROR: No event count provided and p.d.f does not provide expected number of events" << std::endl ;
1684 if (expectedData || extended) {
1695 vector<int> histOut(hist->numEntries()) ;
1696 double histMax(-1) ;
1697 Int_t histOutSum(0) ;
1698 for (
int i=0 ; i<hist->numEntries() ; i++) {
1700 const double wi = hist->weight(i) ;
1704 double w=wi*nEvents ;
1705 hist->set(i, w, sqrt(w));
1707 }
else if (extended) {
1711 hist->set(i, w, sqrt(w)) ;
1721 histOutSum += histOut[i] ;
1726 if (!expectedData && !extended) {
1731 Int_t nEvtExtra = std::abs(
Int_t(nEvents)-histOutSum) ;
1732 Int_t wgt = (histOutSum>nEvents) ? -1 : 1 ;
1735 std::size_t counter = 0;
1736 bool havePrintedInfo =
false;
1737 while(nEvtExtra>0) {
1740 hist->get(ibinRand) ;
1743 if (ranY<hist->weight(ibinRand)) {
1745 histOut[ibinRand]++ ;
1748 if (histOut[ibinRand]>0) {
1749 histOut[ibinRand]-- ;
1757 if ((counter++ > 10*nEvents || nEvents > 1.E7) && !havePrintedInfo) {
1758 havePrintedInfo =
true;
1759 coutP(Generation) <<
"RooAbsPdf::generateBinned(" <<
GetName() <<
") Performing costly accept/reject sampling. If this takes too long, use "
1760 <<
"extended mode to speed up the process." << std::endl;
1765 for (
int i=0 ; i<hist->numEntries() ; i++) {
1766 hist->set(i, histOut[i], sqrt(1.0*histOut[i])) ;
1769 }
else if (expectedData) {
1774 double corr = nEvents/hist->sumEntries() ;
1775 for (
int i=0 ; i<hist->numEntries() ; i++) {
1776 const double wnew = hist->weight(i)*corr ;
1777 hist->set(i, wnew, sqrt(wnew)) ;
1792 return generate(whatVars,nEvents) ;
1796void removeRangeOverlap(std::vector<std::pair<double, double>>& ranges) {
1798 std::sort(ranges.begin(), ranges.end());
1800 for (
auto it = ranges.begin(); it != ranges.end(); ++it) {
1801 double& startL = it->first;
1802 double& endL = it->second;
1804 for (
auto innerIt = it+1; innerIt != ranges.end(); ++innerIt) {
1805 const double startR = innerIt->first;
1806 const double endR = innerIt->second;
1808 if (startL <= startR && startR <= endL) {
1810 endL = std::max(endL, endR);
1811 *innerIt = make_pair(0., 0.);
1816 auto newEnd = std::remove_if(ranges.begin(), ranges.end(),
1817 [](
const std::pair<double,double>& input){
1818 return input.first == input.second;
1820 ranges.erase(newEnd, ranges.end());
1933 std::unique_ptr<RooCmdArg> plotRange;
1934 std::unique_ptr<RooCmdArg> normRange2;
1938 cmdList.
Add(plotRange.get());
1943 cmdList.
Add(normRange2.get());
1946 if (plotRange || normRange2) {
1947 coutI(Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") p.d.f was fitted in a subrange and no explicit "
1948 << (plotRange?
"Range()":
"") << ((plotRange&&normRange2)?
" and ":
"")
1949 << (normRange2?
"NormRange()":
"") <<
" was specified. Plotting / normalising in fit range. To override, do one of the following"
1950 <<
"\n\t- Clear the automatic fit range attribute: <pdf>.removeStringAttribute(\"fitrange\");"
1951 <<
"\n\t- Explicitly specify the plotting range: Range(\"<rangeName>\")."
1952 <<
"\n\t- Explicitly specify where to compute the normalisation: NormRange(\"<rangeName>\")."
1953 <<
"\n\tThe default (full) range can be denoted with Range(\"\") / NormRange(\"\")."<< std::endl ;
1963 pc.
defineSet(
"compSet",
"SelectCompSet",0) ;
1970 pc.
defineInt(
"rangeAdjustNorm",
"Range",0,0) ;
1971 pc.
defineInt(
"rangeWNAdjustNorm",
"RangeWithName",0,0) ;
1972 pc.
defineMutex(
"SelectCompSet",
"SelectCompSpec") ;
1984 double scaleFactor = pc.
getDouble(
"scaleFactor") ;
1986 const char* compSpec = pc.
getString(
"compSpec") ;
1988 bool haveCompSel = ( (compSpec && strlen(compSpec)>0) || compSet) ;
1991 std::stringstream nameSuffix;
1992 if (compSpec && strlen(compSpec)>0) {
1993 nameSuffix <<
"_Comp[" << compSpec <<
"]";
1994 }
else if (compSet) {
2003 RooCmdArg cnsuffix(
"CurveNameSuffix", 0, 0, 0, 0, nameSuffix.str().c_str(),
nullptr,
nullptr,
nullptr);
2004 cmdList.
Add(&cnsuffix);
2009 double nExpected(1) ;
2013 <<
"): ERROR the 'Expected' scale option can only be used on extendable PDFs" << std::endl ;
2024 bool hasCustomRange(
false);
2025 bool adjustNorm(
false);
2027 std::vector<pair<double,double> > rangeLim;
2032 double rangeLo = pc.
getDouble(
"rangeLo") ;
2033 double rangeHi = pc.
getDouble(
"rangeHi") ;
2034 rangeLim.push_back(make_pair(rangeLo,rangeHi)) ;
2035 adjustNorm = pc.
getInt(
"rangeAdjustNorm") ;
2036 hasCustomRange = true ;
2038 coutI(Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") only plotting range ["
2039 << rangeLo <<
"," << rangeHi <<
"]" ;
2041 ccoutI(Plotting) <<
", curve is normalized to data in " << (adjustNorm?
"given":
"full") <<
" range" << std::endl ;
2043 ccoutI(Plotting) << std::endl ;
2046 nameSuffix <<
"_Range[" << rangeLo <<
"_" << rangeHi <<
"]";
2050 for (
const std::string& rangeNameToken :
ROOT::Split(pc.
getString(
"rangeName",
"",
false),
",")) {
2051 const char* thisRangeName = rangeNameToken.empty() ? nullptr : rangeNameToken.c_str();
2053 coutE(Plotting) <<
"Range '" << rangeNameToken <<
"' not defined for variable '"
2059 adjustNorm = pc.
getInt(
"rangeWNAdjustNorm") ;
2060 hasCustomRange = true ;
2062 coutI(Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") only plotting range '" << pc.
getString(
"rangeName",
"",
false) <<
"'" ;
2064 ccoutI(Plotting) <<
", curve is normalized to data in " << (adjustNorm?
"given":
"full") <<
" range" << std::endl ;
2066 ccoutI(Plotting) << std::endl ;
2069 nameSuffix <<
"_Range[" << pc.
getString(
"rangeName") <<
"]";
2074 for (
const auto& rangeNameToken :
ROOT::Split(pc.
getString(
"normRangeName",
"",
false),
",")) {
2075 const char* thisRangeName = rangeNameToken.empty() ? nullptr : rangeNameToken.c_str();
2077 coutE(Plotting) <<
"Range '" << rangeNameToken <<
"' not defined for variable '"
2084 hasCustomRange = true ;
2085 coutI(Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") p.d.f. curve is normalized using explicit choice of ranges '" << pc.
getString(
"normRangeName",
"",
false) <<
"'" << std::endl ;
2087 nameSuffix <<
"_NormRange[" << pc.
getString(
"rangeName") <<
"]";
2090 if (hasCustomRange && adjustNorm) {
2092 const std::size_t oldSize = rangeLim.size();
2093 removeRangeOverlap(rangeLim);
2095 if (oldSize != rangeLim.size() && !pc.
hasProcessed(
"NormRange")) {
2099 coutE(Plotting) <<
"Requested plot/integration ranges overlap. For correct plotting, new ranges "
2100 "will be defined." << std::endl;
2103 std::string rangesNoOverlap;
2104 for (
auto it = rangeLim.begin(); it != rangeLim.end(); ++it) {
2105 std::stringstream rangeName;
2106 rangeName <<
"Remove_overlap_range_" << it - rangeLim.begin();
2107 plotVar->setRange(rangeName.str().c_str(), it->first, it->second);
2108 if (!rangesNoOverlap.empty())
2109 rangesNoOverlap +=
",";
2110 rangesNoOverlap += rangeName.str();
2115 rangeArg->setString(0, rangesNoOverlap.c_str());
2117 plotRange = std::make_unique<RooCmdArg>(
RooFit::Range(rangesNoOverlap.c_str()));
2118 cmdList.
Add(plotRange.get());
2122 double rangeNevt(0) ;
2123 for (
const auto& riter : rangeLim) {
2128 scaleFactor *= rangeNevt/nExpected ;
2137 scaleFactor *= nExp / nExpected;
2148 scaleFactor *= nExpected ;
2150 scaleFactor /= nExpected ;
2159 replaceOrAdd(cmdList, tmp);
2169 for (
const auto arg : branchNodeSet) {
2171 branchNodeSet.
remove(*arg) ;
2176 std::unique_ptr<RooArgSet> dirSelNodes;
2178 dirSelNodes = std::unique_ptr<RooArgSet>{branchNodeSet.
selectCommon(*compSet)};
2180 dirSelNodes = std::unique_ptr<RooArgSet>{branchNodeSet.
selectByName(compSpec)};
2182 if (!dirSelNodes->empty()) {
2183 coutI(Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") directly selected PDF components: " << *dirSelNodes << std::endl ;
2189 coutE(Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") ERROR: component selection set " << *compSet <<
" does not match any components of p.d.f." << std::endl ;
2191 coutE(Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") ERROR: component selection expression '" << compSpec <<
"' does not select any components of p.d.f." << std::endl ;
2197 RooCmdArg cnsuffix(
"CurveNameSuffix", 0, 0, 0, 0, nameSuffix.str().c_str(),
nullptr,
nullptr,
nullptr);
2198 cmdList.
Add(&cnsuffix);
2229 double nExpected(1) ;
2233 <<
"): ERROR the 'Expected' scale option can only be used on extendable PDFs" << std::endl ;
2303 pc.
defineInt(
"showc",
"ShowConstants",0,0) ;
2304 pc.
defineSet(
"params",
"Parameters",0,
nullptr) ;
2305 pc.
defineInt(
"dummy",
"FormatArgs",0,0) ;
2315 const char* label = pc.
getString(
"label") ;
2319 int showc = pc.
getInt(
"showc") ;
2324 params = std::unique_ptr<RooArgSet>{params->selectCommon(*requestedParams)};
2346 bool showLabel= (label !=
nullptr && strlen(label) > 0);
2352 for (
const auto param : params) {
2354 if(showConstants || !var->isConstant())
ymin-= dy;
2357 std::string labelString = label;
2358 unsigned int numLines = std::count(labelString.begin(), labelString.end(),
'\n') + 1;
2359 if (showLabel)
ymin -= numLines * dy;
2363 if(!
box)
return nullptr;
2364 box->SetName((std::string(
GetName()) +
"_paramBox").c_str());
2365 box->SetFillColor(0);
2366 box->SetBorderSize(0);
2367 box->SetTextAlign(12);
2368 box->SetTextSize(0.04F);
2369 box->SetFillStyle(0);
2371 for (
const auto param : params) {
2372 auto var =
static_cast<const RooRealVar*
>(param);
2373 if(var->isConstant() && !showConstants)
continue;
2375 box->AddText((formatCmd ? var->format(*formatCmd) : var->format(2,
"NELU")).c_str());
2436 pdfOwner->
_norm = nullptr ;
2496 pc.
defineSet(
"supNormSet",
"SupNormSet",0,
nullptr) ;
2497 pc.
defineInt(
"numScanBins",
"ScanParameters",0,1000) ;
2498 pc.
defineInt(
"intOrder",
"ScanParameters",1,2) ;
2499 pc.
defineInt(
"doScanNum",
"ScanNumCdf",0,1) ;
2500 pc.
defineInt(
"doScanAll",
"ScanAllCdf",0,0) ;
2501 pc.
defineInt(
"doScanNon",
"ScanNoCdf",0,0) ;
2502 pc.
defineMutex(
"ScanNumCdf",
"ScanAllCdf",
"ScanNoCdf") ;
2505 pc.
process(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
2534 coutI(NumericIntegration) <<
"RooAbsPdf::createCdf(" <<
GetName() <<
") integration over observable(s) " << iset <<
" involves numeric integration," << std::endl
2535 <<
" constructing cdf though numeric integration of sampled pdf in " << numScanBins <<
" bins and applying order "
2536 << intOrder <<
" interpolation on integrated histogram." << std::endl
2537 <<
" To override this choice of technique use argument ScanNone(), to change scan parameters use ScanParameters(nbins,order) argument" << std::endl ;
2549 ivar->
setBins(numScanBins,
"numcdf") ;
2550 auto ret = std::make_unique<RooNumCdf>(
name.c_str(),
name.c_str(),*
this,*ivar,
"numcdf");
2551 ret->setInterpolationOrder(intOrder) ;
2562std::unique_ptr<RooArgSet>
2569 for (
const auto arg : *comps) {
2570 auto pdf =
dynamic_cast<const RooAbsPdf*
>(arg) ;
2571 if (pdf && !constraints.
find(pdf->GetName())) {
2572 if (
auto compRet = pdf->getConstraints(observables,constrainedParams, pdfParams)) {
2573 constraints.
add(*compRet,
false) ;
2581 auto finalConstraints = std::make_unique<RooArgSet>(
"AllConstraints");
2585 pdf->getParameters(
nullptr, tmp);
2586 conParams.
add(tmp,
true) ;
2588 if (pdf->dependsOnValue(pdfParams) || !stripDisconnected) {
2589 finalConstraints->add(*pdf) ;
2591 coutI(Minimization) <<
"RooAbsPdf::getAllConstraints(" <<
GetName() <<
") omitting term " << pdf->GetName()
2592 <<
" as constraint term as it does not share any parameters with the other pdfs in product. "
2593 <<
"To force inclusion in likelihood, add an explicit Constrain() argument for the target parameter" << std::endl ;
2601 cexl.
remove(pdfParams,
true,
true) ;
2602 constrainedParams.
remove(cexl,
true,
true) ;
2604 return finalConstraints ;
2683 bool extended,
bool randProto,
bool resampleProto,
TString dsetName,
bool init) :
2692void sterilizeClientCaches(
RooAbsArg & arg) {
2694 for(std::size_t iClient = 0; iClient <
clients.size(); ++iClient) {
2696 const std::size_t oldClientsSize =
clients.size();
2699 for(
int iCache = 0; iCache < client->
numCaches(); ++iCache) {
2701 cacheMgr->sterilize();
2708 if(
clients.size() != oldClientsSize) {
2709 auto clientIter = std::find(
clients.begin(),
clients.end(), client);
2710 if(clientIter ==
clients.end()) {
2711 throw std::runtime_error(
"After a clients caches were cleared, the client was gone! This should not happen.");
2713 iClient = std::distance(
clients.begin(), clientIter);
2728 sterilizeClientCaches(*
this);
2744 sterilizeClientCaches(*
this);
2758 bool nameChange,
bool isRecursiveStep)
2776std::unique_ptr<RooAbsArg>
2782 std::unique_ptr<RooAbsPdf> pdfClone(
static_cast<RooAbsPdf *
>(this->
Clone()));
2785 auto newArg = std::make_unique<RooFit::Detail::RooNormalizedPdf>(*pdfClone, normSet);
2790 newArg->addOwnedComponents(std::move(pdfClone));
2800 std::stringstream errMsg;
2802 <<
" did not overload RooAbsPdf::createExpectedEventsFunc()!";
2803 coutE(InputArguments) << errMsg.str() << std::endl;
ROOT::RRangeCast< T, true, Range_t > dynamic_range_cast(Range_t &&coll)
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
int Int_t
Signed integer 4 bytes (int).
static void indent(ostringstream &buf, int indent_level)
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
void clearValueAndShapeDirty() const
void Print(Option_t *options=nullptr) const override
Print the object to the defaultPrintStream().
void setOperMode(OperMode mode, bool recurseADirty=true)
Set the operation mode of this node.
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.
bool addOwnedComponents(const RooAbsCollection &comps)
Take ownership of the contents of 'comps'.
const Text_t * getStringAttribute(const Text_t *key) const
Get string attribute mapped under key 'key'.
virtual std::unique_ptr< RooAbsArg > compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext &ctx) const
friend class RooRealIntegral
RooFit::OwningPtr< RooArgSet > getComponents() const
Create a RooArgSet with all components (branch nodes) of the expression tree headed by this object.
bool getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
RooFit::OwningPtr< RooArgSet > getVariables(bool stripDisconnected=true) const
Return RooArgSet with all variables (tree leaf nodes of expression tree).
RooAbsCache * getCache(Int_t index) const
Return registered cache object by index.
const RefCountList_t & clients() const
List of all clients of this object.
bool isValueDirty() const
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.
TObject * Clone(const char *newname=nullptr) const override
Make a clone of an object using the Streamer facility.
RefCountList_t _serverList
Int_t numCaches() const
Return number of registered caches.
RooAbsArg()
Default constructor.
friend class RooAbsCollection
RooAbsArg * findServer(const char *name) const
Return server of this with name name. Returns nullptr if not found.
OperMode operMode() const
Query the operation mode of this node.
RooAbsArg * _owner
! Pointer to owning RooAbsArg
void setInterpolationOrder(Int_t order)
Set interpolation order of RooHistFunct representing cache histogram.
Abstract base class for objects that represent a discrete value that can be set from the outside,...
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
RooAbsArg * first() const
std::string contentsString() const
Return comma separated list of contained object names as STL string.
RooAbsArg * find(const char *name) const
Find object with given name in list.
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
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 base class for generator contexts of RooAbsPdf objects.
virtual RooDataSet * generate(double nEvents=0, bool skipInit=false, bool extendedMode=false)
Generate the specified number of events with nEvents>0 and and return a dataset containing the genera...
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of prototype data to that in the lookup tables passed as argument.
std::unique_ptr< RooAbsReal > _norm
~CacheElem() override
Destructor of normalization cache element.
std::unique_ptr< RooAbsGenContext > _genContext
virtual bool syncNormalization(const RooArgSet *dset, bool adjustProxies=true) const
Verify that the normalization integral cached with this PDF is valid for given set of normalization o...
double getNorm(const RooArgSet &nset) const
Get normalisation term needed to normalise the raw values returned by getVal().
std::unique_ptr< RooAbsArg > compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext &ctx) const override
RooObjCacheManager _normMgr
! The cache manager
std::unique_ptr< RooNumGenConfig > _specGeneratorConfig
! MC generator configuration specific for this object
double getValV(const RooArgSet *set=nullptr) const override
Return current value, normalized by integrating over the observables in nset.
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 override
Helper calling plotOn(RooPlot*, RooLinkedList&) const.
virtual std::unique_ptr< RooFitResult > fitToImpl(RooAbsData &data, const RooLinkedList &cmdList)
Protected implementation of the likelihood fitting routine.
bool _selectComp
Component selection flag for RooAbsPdf::plotCompOn.
virtual void generateEvent(Int_t code)
Interface for generation of an event using the algorithm corresponding to the specified code.
RooFit::OwningPtr< RooAbsReal > createScanCdf(const RooArgSet &iset, const RooArgSet &nset, Int_t numScanBins, Int_t intOrder)
void setGeneratorConfig()
Remove the specialized numeric MC generator configuration associated with this object.
virtual void resetErrorCounters(Int_t resetValue=10)
Reset error counter to given value, limiting the number of future error messages for this pdf to 'res...
std::unique_ptr< RooArgSet > getAllConstraints(const RooArgSet &observables, RooArgSet &constrainedParams, bool stripDisconnected=true) const
This helper function finds and collects all constraints terms of all component p.d....
static int verboseEval()
Return global level of verbosity for p.d.f. evaluations.
RooFit::OwningPtr< RooAbsReal > createCdf(const RooArgSet &iset, const RooArgSet &nset=RooArgSet())
Create a cumulative distribution function of this p.d.f in terms of the observables listed in iset.
bool isActiveNormSet(RooArgSet const *normSet) const
Checks if normSet is the currently active normalization set of this PDF, meaning is exactly the same ...
virtual double expectedEvents(const RooArgSet *nset) const
Return expected number of events to be used in calculation of extended likelihood.
virtual RooAbsGenContext * binnedGenContext(const RooArgSet &vars, bool verbose=false) const
Return a binned generator context.
TString _normRange
Normalization range.
virtual bool isDirectGenSafe(const RooAbsArg &arg) const
Check if given observable can be safely generated using the pdfs internal generator mechanism (if tha...
Int_t * randomizeProtoOrder(Int_t nProto, Int_t nGen, bool resample=false) const
Return lookup table with randomized order for nProto prototype events.
void setNormRange(const char *rangeName)
~RooAbsPdf() override
Destructor.
RooArgSet const * _normSet
! Normalization set with for above integral
RooNumGenConfig * specialGeneratorConfig() const
Returns the specialized integrator configuration for this RooAbsReal.
virtual bool selfNormalized() const
Shows if a PDF is self-normalized, which means that no attempt is made to add a normalization term.
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Print multi line detailed information of this RooAbsPdf.
virtual double getCorrection() const
This function returns the penalty term.
Int_t _traceCount
Number of traces remaining to print.
bool canBeExtended() const
If true, PDF can provide extended likelihood term.
RooAbsReal * _norm
! Normalization integral (owned by _normMgr)
GenSpec * prepareMultiGen(const RooArgSet &whatVars, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={})
Prepare GenSpec configuration object for efficient generation of multiple datasets from identical spe...
void setTraceCounter(Int_t value, bool allNodes=false)
Reset trace counter to given value, limiting the number of future trace messages for this pdf to 'val...
Int_t _errorCount
Number of errors remaining to print.
virtual std::unique_ptr< RooAbsReal > createExpectedEventsFunc(const RooArgSet *nset) const
Returns an object that represents the expected number of events for a given normalization set,...
Int_t _negCount
Number of negative probabilities remaining to print.
virtual RooPlot * paramOn(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={})
Add a box with parameter values (and errors) to the specified frame.
RooFit::OwningPtr< RooDataSet > generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={})
See RooAbsPdf::generate(const RooArgSet&,const RooCmdArg&,const RooCmdArg&,const RooCmdArg&,...
virtual const RooAbsReal * getNormObj(const RooArgSet *set, const RooArgSet *iset, const TNamed *rangeName=nullptr) const
Return pointer to RooAbsReal object that implements calculation of integral over observables iset in ...
void setActiveNormSet(RooArgSet const *normSet) const
Setter for the _normSet member, which should never be set directly.
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Analytical integral with normalization (see RooAbsReal::analyticalIntegralWN() for further informatio...
void setNormRangeOverride(const char *rangeName)
virtual RooFit::OwningPtr< RooDataSet > generateSimGlobal(const RooArgSet &whatVars, Int_t nEvents)
Special generator interface for generation of 'global observables' – for RooStats tools.
virtual RooAbsGenContext * autoGenContext(const RooArgSet &vars, const RooDataSet *prototype=nullptr, const RooArgSet *auxProto=nullptr, bool verbose=false, bool autoBinned=true, const char *binnedTag="") const
const RooNumGenConfig * getGeneratorConfig() const
Return the numeric MC generator configuration used for this object.
virtual void initGenerator(Int_t code)
Interface for one-time initialization to setup the generator for the specified code.
virtual ExtendMode extendMode() const
Returns ability of PDF to provide extended likelihood terms.
RooAbsPdf()
Default constructor.
virtual RooFit::OwningPtr< RooDataHist > generateBinned(const RooArgSet &whatVars, double nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}) const
As RooAbsPdf::generateBinned(const RooArgSet&, const RooCmdArg&,const RooCmdArg&, const RooCmdArg&,...
bool traceEvalPdf(double value) const
Check that passed value is positive and not 'not-a-number'.
static RooNumGenConfig * defaultGeneratorConfig()
Returns the default numeric MC generator configuration for all RooAbsReals.
bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursiveStep) override
Hook function intercepting redirectServer calls.
void printValue(std::ostream &os) const override
Print value of p.d.f, also print normalization integral that was last used, if any.
virtual std::unique_ptr< RooAbsReal > createNLLImpl(RooAbsData &data, const RooLinkedList &cmdList)
Protected implementation of the NLL creation routine.
void logBatchComputationErrors(std::span< const double > &outputs, std::size_t begin) const
Scan through outputs and fix+log all nans and negative values.
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=nullptr, const RooArgSet *auxProto=nullptr, bool verbose=false) const
Interface function to create a generator context from a p.d.f.
void getLogProbabilities(std::span< const double > pdfValues, double *output) const
static TString _normRangeOverride
static Int_t _verboseEval
double extendedTerm(double sumEntries, double expected, double sumEntriesW2=0.0, bool doOffset=false) const
virtual Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, bool staticInitOK=true) const
Load generatedVars with the subset of directVars that we can generate events for, and return a code t...
virtual RooAbsPdf * createProjection(const RooArgSet &iset)
Return a p.d.f that represent a projection of this p.d.f integrated over given observables.
virtual double getLogVal(const RooArgSet *set=nullptr) const
Return the log of the current value with given normalization An error message is printed if the argum...
bool hasRange(const char *name) const override
Check if variable has a binning with given name.
std::pair< double, double > getRange(const char *name=nullptr) const
Get low and high bound of the variable.
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.
void plotOnCompSelect(RooArgSet *selNodes) const
Helper function for plotting of composite p.d.fs.
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
bool plotSanityChecks(RooPlot *frame) const
Utility function for plotOn(), perform general sanity check on frame to ensure safe plotting operatio...
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Structure printing.
bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursiveStep) override
Function that is called at the end of redirectServers().
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.
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.
void logEvalError(const char *message, const char *serverValueString=nullptr) const
Log evaluation error message.
const RooNumIntConfig * getIntegratorConfig() const
Return the numeric integration configuration used for this object.
virtual bool isBinnedDistribution(const RooArgSet &) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
RooFit::OwningPtr< RooAbsReal > createIntRI(const RooArgSet &iset, const RooArgSet &nset={})
Utility function for createRunningIntegral.
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.
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 ...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * selectByName(const char *nameList, bool verbose=false) const
Use RooAbsCollection::selectByName(), but return as RooArgSet.
RooArgSet * selectCommon(const RooAbsCollection &refColl) const
Use RooAbsCollection::selecCommon(), but return as RooArgSet.
Efficient implementation of the generator context specific for binned pdfs.
Implementation of RooAbsCachedReal that can cache any external RooAbsReal input function provided in ...
void setCacheSource(bool flag)
Named container for two doubles, two integers two object points and three string pointers that can be...
void setInt(Int_t idx, Int_t value)
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...
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'.
void compileServers(RooAbsArg &arg, RooArgSet const &normSet)
void markSubtreeAsCompiled(RooAbsArg &arg) const
Mark arg and every branch node reachable through its server tree as already compiled.
Implements a universal generator context for all RooAbsPdf classes that do not have or need a special...
Switches the message service to a different level while the instance is alive.
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
bool Replace(const TObject *oldArg, const TObject *newArg)
Replace object 'oldArg' in collection with new object 'newArg'.
virtual void Add(TObject *arg)
TObject * FindObject(const char *name) const override
Return pointer to object with given name.
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
static RooNumGenConfig & defaultConfig()
Return reference to instance of default numeric integrator configuration object.
Implementation of a RooCacheManager<RooAbsCacheElement> that specializes in the storage of cache elem...
Plot frame and a container for graphics objects within that frame.
void addObject(TObject *obj, Option_t *drawOptions="", bool invisible=false)
Add a generic object to this plot.
double getFitRangeNEvt() const
Return the number of events in the fit range.
const RooArgSet * getNormVars() const
RooAbsRealLValue * getPlotVar() const
void updateNormVars(const RooArgSet &vars)
Install the given set of observables are reference normalization variables for this frame.
double getFitRangeBinW() const
Return the bin width that is being used to normalise the PDF.
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,...
A RooAbsPdf implementation that represent a projection of a given input p.d.f and the object returned...
static UInt_t integer(UInt_t max, TRandom *generator=randomGenerator())
Return an integer uniformly distributed from [0,n-1].
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Variable that can be changed from the outside.
void setBins(Int_t nBins, const char *name=nullptr, bool shared=true)
Create a uniform binning under name 'name' for this variable.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
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.
virtual ULong64_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
const char * Data() const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
RooCmdArg SupNormSet(const RooArgSet &nset)
RooCmdArg NormRange(const char *rangeNameList)
RooCmdArg Range(const char *rangeName, bool adjustNorm=true)
RooCmdArg Normalization(double scaleFactor)
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
double normalizeWithNaNPacking(RooAbsPdf const &pdf, double rawVal, double normVal)
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)
std::string getColonSeparatedNameString(RooArgSet const &argSet, char delim=':')
Double_t QuietNaN()
Returns a quiet NaN as defined by IEEE 754.
static double packFloatIntoNaN(float payload)
Pack float into mantissa of a NaN.