72#include <unordered_map>
73#include <unordered_set>
79using std::endl, std::string, std::vector, std::list, std::ostream, std::map, std::ostringstream;
116 _pdfList(
"!pdfs",
"List of PDFs",this)
119 _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(
"nset")) ;
125 _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(
"nset")) ;
130 coutW(InputArguments) <<
"RooProdPdf::RooProdPdf(" <<
GetName()
131 <<
") multiple components with extended terms detected,"
132 <<
" product will not be extendable." << std::endl ;
163 _pdfList(
"!pdfs",
"List of PDFs",this)
210 _pdfList(
"!pdfs",
"List of PDFs",this)
233 _pdfList(
"!pdfList",
"List of PDFs",this)
252 _pdfList(
"!pdfs",
"List of PDFs",this)
264 _cacheMgr(other._cacheMgr,this),
265 _genCode(other._genCode),
266 _cutOff(other._cutOff),
267 _pdfList(
"!pdfs",this,other._pdfList),
268 _extendedIndex(other._extendedIndex),
269 _useDefaultGen(other._useDefaultGen),
270 _refRangeName(other._refRangeName),
271 _selfNorm(other._selfNorm),
272 _defNormSet(other._defNormSet)
275 for(
auto const& nset : other._pdfNSetList) {
276 _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(nset->GetName()));
289 Int_t numExtended(0) ;
292 for(
auto const* pdf : static_range_cast<RooAbsPdf*>(fullPdfSet)) {
294 _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(
"nset")) ;
296 if (pdf->canBeExtended()) {
304 for(
auto * carg : static_range_cast<RooCmdArg*>(
l)) {
306 if (0 == strcmp(carg->GetName(),
"Conditional")) {
308 Int_t argType = carg->getInt(0) ;
309 auto pdfSet =
static_cast<RooArgSet const*
>(carg->getSet(0));
310 auto normSet =
static_cast<RooArgSet const*
>(carg->getSet(1));
312 for(
auto * thePdf : static_range_cast<RooAbsPdf*>(*pdfSet)) {
315 _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(0 == argType ?
"nset" :
"cset"));
318 if (thePdf->canBeExtended()) {
325 }
else if (0 != strlen(carg->GetName())) {
326 coutW(InputArguments) <<
"Unknown arg: " << carg->GetName() << std::endl ;
332 coutW(InputArguments) <<
"RooProdPdf::RooProdPdf(" <<
GetName()
333 <<
") WARNING: multiple components with extended terms detected,"
334 <<
" product will not be extendable." << std::endl ;
382 cxcoutD(Eval) <<
"RooProdPdf::calculate(" <<
GetName() <<
") rearranged product calculation"
396 const auto normSet = cache.
_normList[i].get();
398 const double piVal = partInt.getVal(!normSet->empty() ? normSet :
nullptr);
410void eraseNullptrs(std::vector<T*>&
v) {
411 v.erase(std::remove_if(
v.begin(),
v.end(), [](T*
x){ return x == nullptr; } ),
v.end());
414void removeCommon(std::vector<RooAbsArg*> &
v, std::span<RooAbsArg * const> other) {
416 for (
auto const& arg : other) {
417 auto namePtrMatch = [&arg](
const RooAbsArg* elm) {
418 return elm !=
nullptr && elm->namePtr() == arg->namePtr();
421 auto found = std::find_if(
v.begin(),
v.end(), namePtrMatch);
422 if(found !=
v.end()) {
429void addCommon(std::vector<RooAbsArg*> &
v, std::vector<RooAbsArg*>
const& o1, std::vector<RooAbsArg*>
const& o2) {
431 for (
auto const& arg : o1) {
432 auto namePtrMatch = [&arg](
const RooAbsArg* elm) {
433 return elm->namePtr() == arg->namePtr();
436 if(std::find_if(o2.begin(), o2.end(), namePtrMatch) != o2.end()) {
445 const char *range = normRange.
Length() > 0 ? normRange.
Data() :
nullptr;
448 if (normObs->getMin(range) != normObs->getMin(refRange) || normObs->getMax(range) != normObs->getMax(refRange))
463 std::vector<RooArgSet> depAllList;
464 std::vector<RooArgSet> depIntNoNormList;
471 std::vector<RooAbsArg*> pdfIntNoNormDeps;
472 std::vector<RooAbsArg*> pdfIntSet;
473 std::vector<RooAbsArg*> pdfNSet;
474 std::vector<RooAbsArg*> pdfCSet;
475 std::vector<RooAbsArg*> pdfNormDeps;
476 std::vector<RooAbsArg*> pdfAllDeps;
479 for(std::size_t iPdf = 0; iPdf <
_pdfList.
size(); ++iPdf) {
490 RooArgSet pdfLeafList(
"leafNodeServerList") ;
492 auto getObservablesOfCurrentPdf = [&pdfLeafList](
493 std::vector<RooAbsArg*> & out,
495 for (
const auto arg : pdfLeafList) {
496 if (arg->dependsOnValue(dataList) && arg->isLValue()) {
503 if (0 == strcmp(
"cset", pdfNSetOrig.GetName())) {
504 getObservablesOfCurrentPdf(pdfNSet, normSet);
505 removeCommon(pdfNSet, pdfNSetOrig.get());
506 pdfCSet = pdfNSetOrig.get();
509 getObservablesOfCurrentPdf(pdfNSet, pdfNSetOrig);
517 getObservablesOfCurrentPdf(pdfAllDeps, normSet);
521 if (!pdfNSet.empty()) {
523 addCommon(pdfNormDeps, pdfAllDeps, pdfNSet);
526 pdfNormDeps = pdfAllDeps;
530 getObservablesOfCurrentPdf(pdfIntSet, intSet) ;
533 if (pdfNormDeps.empty() && !pdfCSet.empty()) {
534 removeCommon(pdfIntSet, pdfCSet);
537 pdfIntNoNormDeps.clear();
538 pdfIntNoNormDeps = pdfIntSet;
539 removeCommon(pdfIntNoNormDeps, pdfNormDeps);
544 auto lIter = factorized.terms.begin();
545 auto ldIter = factorized.norms.begin();
546 for(;lIter != factorized.terms.end(); (++lIter, ++ldIter, ++j)) {
555 bool normOverlap = termNormDeps->
overlaps(pdfNormDeps.begin(), pdfNormDeps.end());
560 termNormDeps->
add(pdfNormDeps.begin(), pdfNormDeps.end(),
false);
561 depAllList[j].add(pdfAllDeps.begin(), pdfAllDeps.end(),
false);
563 termIntDeps->
add(pdfIntSet.begin(), pdfIntSet.end(),
false);
565 if (termIntNoNormDeps) {
566 termIntNoNormDeps->add(pdfIntNoNormDeps.begin(), pdfIntNoNormDeps.end(),
false);
568 termIntNoNormDeps->add(pdfIntNoNormDeps.begin(), pdfIntNoNormDeps.end(),
false);
575 if (!(pdfNormDeps.empty() && pdfAllDeps.empty() &&
576 pdfIntSet.empty()) || normSet.empty()) {
579 depAllList.emplace_back(pdfAllDeps.begin(), pdfAllDeps.end(),
"termAllDeps");
580 termIntDeps =
new RooArgSet(pdfIntSet.begin(), pdfIntSet.end(),
"termIntDeps");
581 depIntNoNormList.emplace_back(pdfIntNoNormDeps.begin(), pdfIntNoNormDeps.end(),
"termIntNoNormDeps");
582 termIntNoNormDeps = &depIntNoNormList.back();
585 termNormDeps->
add(pdfNormDeps.begin(), pdfNormDeps.end(),
false);
587 factorized.terms.Add(term);
588 factorized.norms.Add(termNormDeps);
589 factorized.ints.Add(termIntDeps);
598 auto lIter = factorized.terms.
begin();
599 auto ldIter = factorized.norms.begin();
600 for(;lIter != factorized.terms.end(); (++lIter, ++ldIter, ++i)) {
601 normDeps =
static_cast<RooArgSet*
>(*ldIter);
605 impDeps.remove(*normDeps,
true,
true);
608 factorized.imps.Add(snap);
612 auto crossDeps = std::unique_ptr<RooAbsCollection>{depIntNoNormList[i].
selectCommon(*normDeps)};
615 factorized.cross.Add(snap);
631 Int_t sterileIdx(-1);
637 std::unique_ptr<CacheElem> cache =
createCacheElem(nset, iset, isetRangeName);
647 const char* isetRangeName)
const
650 auto cache = std::make_unique<CacheElem>();
661 std::list<std::vector<RooArgSet*>> groupedList;
667 std::map<std::string, RooArgSet> ratioTerms;
668 for (
auto const&
group : groupedList) {
669 if (1 ==
group.size()) {
672 Int_t termIdx = factorized.terms.IndexOf(term);
684 std::ostringstream str; termImpSet.printValue(str);
685 ratioTerms[str.str()].addOwned(std::move(ratio));
690 for (
auto const& term :
group) {
692 Int_t termIdx = factorized.terms.IndexOf(term);
703 std::ostringstream str; termImpSet.printValue(str);
704 ratioTerms[str.str()].addOwned(std::move(ratio));
714 for (
auto const&
group : groupedList) {
715 for (
auto const& term :
group) {
716 Int_t termIdx = factorized.terms.IndexOf(term);
721 ostringstream str; termNSet.printValue(str);
722 if (!ratioTerms[str.str()].empty()) {
723 term->add(ratioTerms[str.str()]);
724 cache->_ownedList.addOwned(std::move(ratioTerms[str.str()]));
729 for (
auto const&
group : groupedList) {
730 if (1 ==
group.size()) {
733 Int_t termIdx = factorized.terms.IndexOf(term);
734 RooArgSet *norm = factorized.termNormDeps(termIdx);
735 RooArgSet *integ = factorized.termIntDeps(termIdx);
745 cache->_partList.add(*func.x0);
746 if (func.isOwned) cache->_ownedList.addOwned(std::unique_ptr<RooAbsArg>{func.x0});
748 cache->_normList.emplace_back(std::make_unique<RooArgSet>());
749 norm->snapshot(*cache->_normList.back(),
false);
751 cache->_numList.addOwned(std::move(func.x1));
752 cache->_denList.addOwned(std::move(func.x2));
759 for (
auto const &term :
group) {
760 Int_t termIdx = factorized.terms.IndexOf(term);
761 RooArgSet *norm = factorized.termNormDeps(termIdx);
762 RooArgSet *integ = factorized.termIntDeps(termIdx);
768 termISet.
remove(outerIntDeps,
true,
true);
770 auto func =
processProductTerm(nset, iset, isetRangeName, term, termNSet, termISet,
true);
772 compTermSet.add(*func.x0);
773 if (func.isOwned) cache->_ownedList.addOwned(std::unique_ptr<RooAbsArg>{func.x0});
774 compTermNorm.add(*norm,
false);
776 compTermNum.add(*func.x1.release());
777 compTermDen.add(*func.x2.release());
788 const std::string prodname =
makeRGPPName(
"SPECPROD", compTermSet, outerIntDeps,
RooArgSet(), isetRangeName);
789 auto prodtmp = std::make_unique<RooProduct>(prodname.c_str(), prodname.c_str(), compTermSet);
791 const std::string intname =
makeRGPPName(
"SPECINT", compTermSet, outerIntDeps,
RooArgSet(), isetRangeName);
792 auto inttmp = std::make_unique<RooRealIntegral>(intname.c_str(), intname.c_str(), *prodtmp, outerIntDeps,
nullptr,
nullptr, isetRangeName);
793 inttmp->setStringAttribute(
"PROD_TERM_TYPE",
"SPECINT");
795 cache->_partList.add(*inttmp);
799 auto prodtmp_num = std::make_unique<RooProduct>(prodname_num.c_str(), prodname_num.c_str(), compTermNum);
800 prodtmp_num->addOwnedComponents(compTermNum);
804 auto prodtmp_den = std::make_unique<RooProduct>(prodname_den.c_str(), prodname_den.c_str(), compTermDen);
805 prodtmp_den->addOwnedComponents(compTermDen);
808 std::string
name =
Form(
"SPEC_RATIO(%s,%s)", prodname_num.c_str(), prodname_den.c_str());
809 auto ndr = std::make_unique<RooFormulaVar>(
name.c_str(),
"@0/@1",
RooArgList(*prodtmp_num, *prodtmp_den));
812 std::unique_ptr<RooAbsReal> numtmp{ndr->createIntegral(outerIntDeps,isetRangeName)};
813 numtmp->addOwnedComponents(std::move(ndr));
815 cache->_ownedList.addOwned(std::move(prodtmp));
816 cache->_ownedList.addOwned(std::move(inttmp));
817 cache->_ownedList.addOwned(std::move(prodtmp_num));
818 cache->_ownedList.addOwned(std::move(prodtmp_den));
819 cache->_numList.addOwned(std::move(numtmp));
821 cache->_normList.emplace_back(std::make_unique<RooArgSet>());
822 compTermNorm.snapshot(*cache->_normList.back(),
false);
851 std::unique_ptr<RooAbsReal> ratio_num{pdf.
createIntegral(termNset,normRangeTmp)};
852 std::unique_ptr<RooAbsReal> ratio_den{pdf.
createIntegral(termNset,refRange)};
853 auto ratio = std::make_unique<RooFormulaVar>(
Form(
"ratio(%s,%s)",ratio_num->GetName(),ratio_den->GetName()),
"@0/@1",
856 ratio->addOwnedComponents(std::move(ratio_num));
857 ratio->addOwnedComponents(std::move(ratio_den));
858 ratio->setAttribute(
"RATIO_TERM") ;
873 std::map<std::string,RooArgSet> denListList ;
875 string specIntRange ;
888 if (
string(
"SPECINT")==part->getStringAttribute(
"PROD_TERM_TYPE")) {
891 auto specratio =
static_cast<RooFormulaVar const*
>(&orig->integrand()) ;
894 std::unique_ptr<RooArgSet> components{orig->
getComponents()};
896 if (carg->getAttribute(
"RATIO_TERM")) {
905 nomList.add(*cust.build()) ;
921 if (arg->getAttribute(
"RATIO_TERM")) {
924 origNumTerm.add(*arg) ;
930 nomList.add(origNumTerm) ;
937 for (
auto iter = rangeComps.begin() ; iter != rangeComps.end() ; ++iter) {
941 if (
string(
"SPECINT")==part->getStringAttribute(
"PROD_TERM_TYPE")) {
944 auto specRatio =
static_cast<RooFormulaVar const*
>(&orig->integrand()) ;
945 specIntDeps.add(orig->intVars()) ;
946 if (orig->intRange()) {
947 specIntRange = orig->intRange() ;
952 for (
auto* parg : static_range_cast<RooAbsReal*>(dentmp->components())) {
953 if (ratio && parg->dependsOn(*ratio)) {
965 RooCustomizer cust(*tmpadd->list1().first(), (
"blah_" + *iter).c_str());
966 cust.replaceArg(*ratio,*specializedRatio) ;
967 partCust = cust.build() ;
971 cust.replaceArg(*ratio, *specializedRatio);
972 partCust = cust.build();
980 string name =
Form(
"%s_divided_by_ratio",specializedPartCust->GetName()) ;
981 auto specIntFinal = std::make_unique<RooFormulaVar>(
name.c_str(),
"@0/@1",
RooArgList(*specializedPartCust,*specializedRatio)) ;
982 specIntFinal->addOwnedComponents(std::move(specializedPartCust));
983 specIntFinal->addOwnedComponents(std::move(specializedRatio));
985 denListList[*iter].addOwned(std::move(specIntFinal));
1001 tmp.add(*specRatio) ;
1003 auto specDenProd = std::make_unique<RooProduct>(pname.c_str(),pname.c_str(),tmp) ;
1004 std::unique_ptr<RooAbsReal> specInt;
1007 specInt = std::unique_ptr<RooAbsReal>{specDenProd->createIntegral((
static_cast<RooRealIntegral*
>(den))->intVars(),iter->c_str())};
1008 specInt->addOwnedComponents(std::move(specDenProd));
1012 specInt = std::unique_ptr<RooAbsReal>{specDenProd->
createIntegral(origInt->intVars(),iter->c_str())};
1013 specInt->addOwnedComponents(std::move(specDenProd));
1015 throw string(
"this should not happen") ;
1019 string name =
Form(
"%s_divided_by_ratio",specInt->GetName()) ;
1020 auto specIntFinal = std::make_unique<RooFormulaVar>(
name.c_str(),
"@0/@1",
RooArgList(*specInt,*specRatio)) ;
1021 specIntFinal->addOwnedComponents(std::move(specInt));
1022 specIntFinal->addOwnedComponents(std::move(specRatio));
1023 denListList[*iter].addOwned(std::move(specIntFinal));
1034 if (nomList.empty()) {
1038 string name = std::string{
GetName()} +
"_numerator";
1041 std::unique_ptr<RooAbsReal> numerator = std::make_unique<RooProduct>(
name.c_str(),
name.c_str(),nomList) ;
1044 for (map<string,RooArgSet>::iterator iter = denListList.begin() ; iter != denListList.end() ; ++iter) {
1048 prod_comp->addOwnedComponents(std::move(iter->second));
1049 products.add(*prod_comp) ;
1053 norm->addOwnedComponents(products) ;
1055 if (!specIntDeps.empty()) {
1058 string namesr =
Form(
"SPEC_RATIO(%s,%s)",numerator->GetName(),norm->GetName()) ;
1060 ndr->addOwnedComponents(std::move(numerator));
1063 numerator = std::unique_ptr<RooAbsReal>{ndr->createIntegral(specIntDeps,specIntRange.c_str())};
1087 std::unique_ptr<RooAbsReal> numint_spec{
specializeIntegral(*numint,targetRangeName)};
1089 std::unique_ptr<RooAbsReal> ret = std::make_unique<RooFormulaVar>(
Form(
"ratio(%s,%s)",numint_spec->GetName(),denint->GetName()),
"@0/@1",
RooArgList(*numint_spec,*denint)) ;
1090 ret->addOwnedComponents(std::move(numint_spec));
1115 std::stringstream errMsg;
1116 errMsg <<
"specializeIntegral: unknown input type " <<
input.ClassName() <<
"::" <<
input.GetName();
1117 throw std::runtime_error(errMsg.str());
1128 for(
auto * term : static_range_cast<RooArgSet*>(factorized.terms)) {
1129 groupedTerms.emplace_back();
1130 groupedTerms.back().emplace_back(term) ;
1135 for(
auto * impDeps : static_range_cast<RooArgSet*>(factorized.imps)) {
1136 allImpDeps.
add(*impDeps,
false) ;
1141 for(
auto * intDeps : static_range_cast<RooArgSet*>(factorized.ints)) {
1142 allIntDeps.
add(*intDeps,
false) ;
1145 outerIntDeps.removeAll() ;
1146 outerIntDeps.add(*std::unique_ptr<RooArgSet>{allIntDeps.selectCommon(allImpDeps)});
1149 for(
RooAbsArg * outerIntDep : outerIntDeps) {
1152 std::vector<RooArgSet*>* newGroup = nullptr ;
1155 bool needMerge = false ;
1156 auto group = groupedTerms.begin();
1157 auto nGroups = groupedTerms.size();
1158 for (
size_t iGroup = 0; iGroup < nGroups; ++iGroup) {
1161 for (
auto const& term2 : *
group) {
1163 Int_t termIdx = factorized.terms.IndexOf(term2) ;
1164 if (factorized.termNormDeps(termIdx)->contains(*outerIntDep) ||
1165 factorized.termIntDeps(termIdx)->contains(*outerIntDep) ||
1166 factorized.termImpDeps(termIdx)->contains(*outerIntDep)) {
1174 if (newGroup==
nullptr) {
1175 groupedTerms.emplace_back() ;
1176 newGroup = &groupedTerms.back() ;
1180 for (
auto& term2 : *
group) {
1181 newGroup->emplace_back(term2) ;
1202 bool forceWrap)
const
1209 if (!termNSet.empty() && termNSet.size()==termISet.size() && isetRangeName==
nullptr) {
1216 if (nset && termNSet.
empty()) {
1221 if (iset && !termISet.empty()) {
1222 if (term->size()==1) {
1229 ret.x0 = std::unique_ptr<RooAbsReal>{pdf->
createIntegral(termISet,termNSet,isetRangeName)}.release();
1231 ret.x0->setStringAttribute(
"PROD_TERM_TYPE",
"IIIa") ;
1236 ret.x1 = std::unique_ptr<RooAbsReal>{pdf->
createIntegral(termISet,isetRangeName)};
1247 const std::string
name =
makeRGPPName(
"GENPROJ_",*term,termISet,termNSet,isetRangeName) ;
1248 ret.x0 =
new RooGenProdProj(
name.c_str(),
name.c_str(),*term,termISet,termNSet,isetRangeName) ;
1249 ret.x0->setStringAttribute(
"PROD_TERM_TYPE",
"IIIb") ;
1259 ret.x1 = std::unique_ptr<RooAbsReal>{tmp_prod->createIntegral(termISet,isetRangeName)};
1260 ret.x2 = std::unique_ptr<RooAbsReal>{tmp_prod->createIntegral(termNSet,
normRange())};
1268 if (nset && !nset->
empty() && term->size()>1) {
1271 const std::string
name =
makeRGPPName(
"GENPROJ_",*term,termISet,termNSet,isetRangeName) ;
1272 ret.x0 =
new RooGenProdProj(
name.c_str(),
name.c_str(),*term,termISet,termNSet,isetRangeName,
normRange()) ;
1275 ret.x0->setStringAttribute(
"PROD_TERM_TYPE",
"IVa") ;
1285 ret.x1 = std::unique_ptr<RooAbsReal>{tmp_prod->createIntegral(termISet,isetRangeName)};
1286 ret.x2 = std::unique_ptr<RooAbsReal>{tmp_prod->createIntegral(termNSet,
normRange())};
1293 for (
auto* pdf : static_range_cast<RooAbsPdf*>(*term)) {
1295 ret.isOwned =
false;
1306 ret0->setStringAttribute(
"PROD_TERM_TYPE",
"IVb") ;
1308 ret.x1 = std::unique_ptr<RooAbsReal>{pdf->createIntegral(
RooArgSet())};
1309 ret.x2 = std::unique_ptr<RooAbsReal>{pdf->createIntegral(termNSet,
normRange())};
1313 coutE(Eval) <<
"RooProdPdf::processProductTerm(" <<
GetName() <<
") unidentified term!!!" << std::endl ;
1324 const RooArgSet& nset,
const char* isetRangeName)
const
1328 std::ostringstream os;
1334 for (
auto const* pdf : static_range_cast<RooAbsPdf*>(term)) {
1335 if (!first) os <<
"_X_";
1337 os << pdf->GetName();
1372 const RooArgSet* normSet,
const char* rangeName)
const
1377 analVars.add(allVars) ;
1405 if (cache==
nullptr) {
1442 coutF(Generation) <<
"Requesting expected number of events from a RooProdPdf that does not contain an extended p.d.f" << std::endl ;
1443 throw std::logic_error(std::string(
"RooProdPdf ") +
GetName() +
" could not be extended.");
1452 coutF(Generation) <<
"Requesting expected number of events from a RooProdPdf that does not contain an extended p.d.f" << std::endl ;
1453 throw std::logic_error(std::string(
"RooProdPdf ") +
GetName() +
" could not be extended.");
1464 const RooArgSet* auxProto,
bool verbose)
const
1482 for (
auto const* arg : directVars) {
1488 std::vector<Int_t> code;
1490 for (
auto const* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
1492 Int_t pdfCode = pdf->getGenerator(directSafe,pdfDirect,staticInitOK);
1493 code.push_back(pdfCode);
1495 generateVars.add(pdfDirect) ;
1500 if (!generateVars.empty()) {
1505 return std::distance(
_genCode.begin(), found) + 1;
1507 _genCode.emplace_back(std::move(code));
1523 const std::vector<int>& codeList =
_genCode[code-1];
1525 for (
auto* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
1526 if (codeList[i]!=0) {
1527 pdf->initGenerator(codeList[i]) ;
1544 const std::vector<Int_t>& codeList =
_genCode[code-1];
1546 for (
auto* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
1547 if (codeList[i]!=0) {
1548 pdf->generateEvent(codeList[i]) ;
1562 ret.
add(_partList) ;
1565 if (_rearrangedNum) ret.add(*_rearrangedNum) ;
1566 if (_rearrangedDen) ret.add(*_rearrangedDen) ;
1579 os <<
indent <<
"RooProdPdf begin partial integral cache" << std::endl ;
1582 auto indent2 = std::string(
indent) +
"[" + std::to_string(curElem) +
"]";
1583 for(
auto const& arg : _partList) {
1584 arg->printCompactTree(os,indent2.c_str()) ;
1587 if (curElem==maxElem) {
1588 os <<
indent <<
"RooProdPdf end partial integral cache" << std::endl ;
1605 for (
auto* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
1607 if (pdf->dependsOn(arg)) {
1611 if (thePdf)
return false ;
1617 return thePdf?(thePdf->isDirectGenSafe(arg)):false ;
1638 for(
auto arg : pdfs) {
1641 coutW(InputArguments) <<
"RooProdPdf::addPdfs(" <<
GetName() <<
") list arg "
1642 << arg->GetName() <<
" is not a PDF, ignored" << std::endl ;
1653 _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(
"nset"));
1657 if (numExtended>1) {
1658 coutW(InputArguments) <<
"RooProdPdf::addPdfs(" <<
GetName()
1659 <<
") WARNING: multiple components with extended terms detected,"
1660 <<
" product will not be extendable." << std::endl ;
1700 std::vector<TNamed const*> ptrs;
1701 ptrs.reserve(col.size());
1703 ptrs.push_back(arg->namePtr());
1705 std::sort(ptrs.begin(), ptrs.end());
1709bool sortedNamePtrsOverlap(std::vector<TNamed const*>
const& ptrsA, std::vector<TNamed const*>
const& ptrsB)
1711 auto pA = ptrsA.begin();
1712 auto pB = ptrsB.begin();
1713 while (pA != ptrsA.end() && pB != ptrsB.end()) {
1716 }
else if (*pB < *pA) {
1736std::unique_ptr<RooArgSet>
1739 auto constraints = std::make_unique<RooArgSet>(
"constraints");
1742 auto observablesNamePtrs = sortedNamePtrs(observables);
1743 auto constrainedParamsNamePtrs = sortedNamePtrs(constrainedParams);
1746 for (std::size_t iPdf = 0; iPdf <
_pdfList.
size(); ++iPdf) {
1750 pdf->getParameters(
nullptr, tmp);
1755 bool isConstraint =
false;
1758 auto tmpNamePtrs = sortedNamePtrs(tmp);
1770 isConstraint = !sortedNamePtrsOverlap(tmpNamePtrs, observablesNamePtrs) &&
1771 sortedNamePtrsOverlap(tmpNamePtrs, constrainedParamsNamePtrs);
1774 constraints->add(*pdf) ;
1781 tmp.remove(observables,
false,
true);
1782 pdfParams.add(tmp,
true) ;
1801 for (std::size_t iPdf = 0; iPdf <
_pdfList.
size(); ++iPdf) {
1806 if (
static_cast<int>(iPdf) ==
_extendedIndex || pdf->dependsOn(observables)) {
1808 pdf->getParameters(&observables, tmp);
1809 connectedPars->
add(tmp) ;
1812 return connectedPars ;
1845 for (
auto const* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
1846 if (std::list<double>* hint = pdf->plotSamplingHint(obs,xlo,xhi)) {
1861 for (
auto const* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
1862 if (pdf->dependsOn(obs) && !pdf->isBinnedDistribution(obs)) {
1880 for (
auto const* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
1881 if (std::list<double>* hint = pdf->binBoundaries(obs,xlo,xhi)) {
1898 if (i>0) os <<
" * " ;
1901 if (!ncset->empty()) {
1902 if (
string(
"nset")==ncset->GetName()) {
1907 for (
auto const* arg : *ncset) {
1913 os << arg->GetName() ;
1930 cxcoutD(LinkStateMgmt) <<
"RooProdPdf::redirectServersHook(" <<
GetName() <<
"): removing REMOVAL_DUMMY" << std::endl ;
1945 for(std::unique_ptr<RooArgSet>
const& normSet :
_pdfNSetList) {
1949 normSet->replace(arg, std::unique_ptr<RooAbsArg>{newArg->cloneTree()});
1959 os <<
"_partList\n";
1960 os << getColonSeparatedNameString(_partList) <<
"\n";
1962 os << getColonSeparatedNameString(_numList) <<
"\n";
1964 os << getColonSeparatedNameString(_denList) <<
"\n";
1965 os <<
"_ownedList\n";
1966 os << getColonSeparatedNameString(_ownedList) <<
"\n";
1967 os <<
"_normList\n";
1968 for(
auto const& set : _normList) {
1969 os << getColonSeparatedNameString(*set) <<
"\n";
1971 os <<
"_isRearranged" <<
"\n";
1972 os << _isRearranged <<
"\n";
1973 os <<
"_rearrangedNum" <<
"\n";
1974 if(_rearrangedNum) {
1975 os << getColonSeparatedNameString(*_rearrangedNum) <<
"\n";
1977 os <<
"nullptr" <<
"\n";
1979 os <<
"_rearrangedDen" <<
"\n";
1980 if(_rearrangedDen) {
1981 os << getColonSeparatedNameString(*_rearrangedDen) <<
"\n";
1983 os <<
"nullptr" <<
"\n";
1989 if (normSet.empty())
1992 if (pdfNset && !pdfNset->empty()) {
1993 std::unique_ptr<RooArgSet> out;
1994 if (0 == strcmp(
"cset", pdfNset->GetName())) {
1998 out = std::make_unique<RooArgSet>(normSet);
2000 out->selectCommon(*pdfNset, common);
2001 out->remove(common);
2003 out = std::make_unique<RooArgSet>(*pdfNset);
2008 if (!arg->getStringAttribute(
"__prefix__")) {
2009 arg->SetName((std::string(prefix) + arg->GetName()).c_str());
2010 arg->setStringAttribute(
"__prefix__", prefix);
2020std::unique_ptr<RooAbsArg>
2023 if (ctx.likelihoodMode()) {
2025 if (binnedInfo.binnedPdf && binnedInfo.binnedPdf !=
this) {
2026 return binnedInfo.binnedPdf->compileForNormSet(normSet, ctx);
2030 std::unique_ptr<RooProdPdf> prodPdfClone{
static_cast<RooProdPdf *
>(this->
Clone())};
2048 std::vector<std::pair<RooAbsPdf *, std::string>> restoreNormRanges;
2049 if (
const char *prodNormRange =
normRange()) {
2050 std::vector<std::string> rangeTokens =
ROOT::Split(prodNormRange,
",",
true);
2051 for (
auto *pdf : static_range_cast<RooAbsPdf *>(prodPdfClone->_pdfList)) {
2053 pdf->getObservables(&normSet, pdfObs);
2054 bool rangeDefined = !pdfObs.
empty();
2057 for (
auto const &token : rangeTokens) {
2058 if (!lval || !lval->hasRange(token.c_str())) {
2059 rangeDefined =
false;
2063 if (rangeDefined && std::string(pdf->normRange() ? pdf->normRange() :
"") != prodNormRange) {
2064 restoreNormRanges.emplace_back(pdf, pdf->normRange() ? pdf->normRange() :
"");
2065 pdf->setNormRange(prodNormRange);
2077 std::unordered_set<std::string> jointlyNormalized;
2078 if (!normSet.empty()) {
2080 prodPdfClone->factorizeProduct(normSet,
RooArgSet{}, factorized);
2081 for (
auto *term : static_range_cast<RooArgSet *>(factorized.terms)) {
2082 if (term->size() > 1) {
2084 jointlyNormalized.insert(pdf->GetName());
2090 for (
const auto server : prodPdfClone->servers()) {
2092 RooArgSet const &nset = nsetForServer ? *nsetForServer : normSet;
2095 server->getObservables(&nset, depList);
2097 ctx.compileServer(*server, *prodPdfClone, depList);
2100 for (
auto const &[pdf, oldRange] : restoreNormRanges) {
2101 pdf->setNormRange(oldRange.empty() ? nullptr : oldRange.c_str());
2108 std::unordered_map<RooAbsArg *, RooAbsArg *> unwrapped;
2109 for (
RooAbsArg *pdf : prodPdfClone->_pdfList) {
2111 if (normalized && jointlyNormalized.count(normalized->pdf().GetName())) {
2112 unwrapped[normalized] =
const_cast<RooAbsPdf *
>(&normalized->pdf());
2115 std::unique_ptr<RooProdPdf> cacheProdPdf;
2116 if (!unwrapped.empty()) {
2117 cacheProdPdf.reset(
static_cast<RooProdPdf *
>(prodPdfClone->Clone()));
2127 auto fixedProdPdf = std::make_unique<RooFit::Detail::RooFixedProdPdf>(
2128 std::move(prodPdfClone), ctx.mapToCompiled(normSet), cacheProdPdf.get());
2129 ctx.markAsCompiled(*fixedProdPdf);
2131 return fixedProdPdf;
2142RooFixedProdPdf::RooFixedProdPdf(std::unique_ptr<RooProdPdf> &&prodPdf,
RooArgSet const &normSet,
2144 :
RooAbsPdf(prodPdf->GetName(), prodPdf->GetTitle()),
2146 _servers(
"!servers",
"List of servers", this),
2147 _prodPdf{std::move(prodPdf)}
2149 auto cache = (cacheProdPdf ? cacheProdPdf :
_prodPdf.get())->createCacheElem(&
_normSet,
nullptr);
2154 cache->_ownedList.releaseOwnership();
2155 cache->_numList.releaseOwnership();
2156 cache->_denList.releaseOwnership();
2171 for (
RooAbsArg *arg : cache->_partList) {
2178 _normSet{other._normSet},
2179 _servers(
"!servers", this, other._servers),
2180 _prodPdf{static_cast<
RooProdPdf *>(other._prodPdf->Clone())},
2181 _isRearranged{other._isRearranged}
2196 std::vector<std::span<const double>> factors;
2198 if (ctx.outputsLogarithm(
this)) {
2201 if (ctx.outputsLogarithm(arg))
2202 factors.push_back(ctx.at(arg));
2204 std::array<double, 1> nLogFactors{
static_cast<double>(factors.size())};
2206 if (!ctx.outputsLogarithm(arg))
2207 factors.push_back(ctx.at(arg));
2213 auto span = ctx.at(arg);
2214 factors.push_back(span);
2216 std::array<double, 1> special{
static_cast<double>(factors.size())};
2227 for (
auto *arg : static_range_cast<RooAbsReal *>(*
partList())) {
2228 value *= arg->getVal();
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
static void indent(ostringstream &buf, int indent_level)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Common abstract base class for objects that represent a value and a "shape" in RooFit.
RooExpensiveObjectCache & expensiveObjectCache() const
void treeNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=nullptr, bool doBranch=true, bool doLeaf=true, bool valueOnly=false, bool recurseFundamental=false) const
Fill supplied list with nodes of the arg tree, following all server links, starting with ourself as t...
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...
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'.
bool redirectServers(const RooAbsCollection &newServerList, bool mustReplaceAll=false, bool nameChange=false, bool isRecursionStep=false)
Replace all direct servers of this object with the new servers in newServerList.
friend class RooRealIntegral
RooFit::OwningPtr< RooArgSet > getComponents() const
Create a RooArgSet with all components (branch nodes) of the expression tree headed by this object.
TObject * Clone(const char *newname=nullptr) const override
Make a clone of an object using the Streamer facility.
RooAbsArg * findNewServer(const RooAbsCollection &newSet, bool nameChange) const
Find the new server in the specified set that matches the old server.
OperMode operMode() const
Query the operation mode of this node.
Abstract container object that can hold multiple RooAbsArg objects.
bool contains(const char *name) const
Check if collection contains an argument with a specific name.
virtual bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Int_t index(const RooAbsArg *arg) const
Returns index of given arg, or -1 if arg is not in the collection.
bool overlaps(Iterator_t otherCollBegin, Iterator_t otherCollEnd) const
Storage_t::size_type size() const
const_iterator begin() const
RooAbsArg * find(const char *name) const
Find object with given name in list.
Abstract base class for generator contexts of RooAbsPdf objects.
Abstract interface for all probability density functions.
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...
RooArgSet const * _normSet
! Normalization set with for above integral
bool canBeExtended() const
If true, PDF can provide extended likelihood term.
const char * normRange() const
bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursiveStep) override
Hook function intercepting redirectServer calls.
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.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
Abstract base class for objects that represent a real value and implements functionality common to al...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
bool _forceNumInt
Force numerical integration if flag set.
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...
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 ...
Calculates the sum of a set of RooAbsReal terms, or when constructed with two sets,...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
RooArgSet * selectCommon(const RooAbsCollection &refColl) const
Use RooAbsCollection::selecCommon(), but return as RooArgSet.
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=nullptr)
Setter function without integration set.
RooArgSet selectFromSet1(RooArgSet const &argSet, int index) const
Create RooArgSet containing the objects that are both in the cached set 1 with a given index and an i...
T * getObjByIndex(Int_t index) const
Retrieve payload object by slot index.
RooArgSet selectFromSet2(RooArgSet const &argSet, int index) const
Create RooArgSet containing the objects that are both in the cached set 2 with a given index and an i...
void reset()
Clear the cache.
Int_t lastIndex() const
Return index of slot used in last get or set operation.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=nullptr, const TNamed *isetRangeName=nullptr)
Getter function without integration set.
Named container for two doubles, two integers two object points and three string pointers that can be...
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false) override
Remove object 'var' from set and deregister 'var' as server to owner.
TObject * clone(const char *newname=nullptr) const override
RooCustomizer is a factory class to produce clones of a prototype composite PDF object with the same ...
Container class to hold unbinned data.
void markAsCompiled(RooAbsArg &arg) const
A RooProdPdf with a fixed normalization set can be replaced by this class.
RooArgSet const * partList() const
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
void doEval(RooFit::EvalContext &ctx) const override
Evaluate product of PDFs in batch mode.
std::unique_ptr< RooProdPdf > _prodPdf
RooAbsReal const * rearrangedDen() const
RooFixedProdPdf(std::unique_ptr< RooProdPdf > &&prodPdf, RooArgSet const &normSet, RooProdPdf const *cacheProdPdf=nullptr)
RooAbsReal const * rearrangedNum() const
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,...
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
RooArgList containedArgs(Action) override
Return RooAbsArg components contained in the cache.
std::unique_ptr< RooAbsReal > _rearrangedNum
void printCompactTreeHook(std::ostream &, const char *, Int_t, Int_t) override
Hook function to print cache contents in tree printing of RooProdPdf.
std::vector< std::unique_ptr< RooArgSet > > _normList
std::unique_ptr< RooAbsReal > _rearrangedDen
void writeToStream(std::ostream &os) const
Efficient implementation of a product of PDFs of the form.
std::unique_ptr< RooArgSet > getConstraints(const RooArgSet &observables, RooArgSet const &constrainedParams, RooArgSet &pdfParams) const override
Return all parameter constraint p.d.f.s on parameters listed in constrainedParams.
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, bool staticInitOK=true) const override
Query internal generation capabilities of component p.d.f.s and aggregate capabilities into master co...
void rearrangeProduct(CacheElem &) const
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Return analytical integral defined by given scenario code.
~RooProdPdf() override
Destructor.
Int_t _extendedIndex
Index of extended PDF (if any)
std::unique_ptr< RooAbsReal > specializeRatio(RooFormulaVar &input, const char *targetRangeName) const
RooProdPdf()
Default constructor.
void removePdfs(RooAbsCollection const &pdfs)
Remove some PDFs from the factors of this RooProdPdf.
bool _useDefaultGen
Use default or distributed event generator.
std::vector< std::unique_ptr< RooArgSet > > _pdfNSetList
List of PDF component normalization sets.
std::unique_ptr< RooArgSet > fillNormSetForServer(RooArgSet const &normSet, RooAbsArg const &server) const
void factorizeProduct(const RooArgSet &normSet, const RooArgSet &intSet, Factorized &factorized) const
Factorize product in irreducible terms for given choice of integration/normalization.
bool forceAnalyticalInt(const RooAbsArg &dep) const override
Force RooRealIntegral to offer all observables for internal integration.
std::unique_ptr< RooAbsArg > compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext &ctx) const override
RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=nullptr, const RooArgSet *auxProto=nullptr, bool verbose=false) const override
Return generator context optimized for generating events from product p.d.f.s.
TNamed * _refRangeName
Reference range name for interpretation of conditional products.
void addPdfs(RooAbsCollection const &pdfs)
Add some full PDFs to the factors of this RooProdPdf.
RooListProxy _pdfList
List of PDF components.
Int_t getPartIntList(const RooArgSet *nset, const RooArgSet *iset, const char *isetRangeName=nullptr) const
Return list of (partial) integrals of product terms for integration of p.d.f over observables iset wh...
void printMetaArgs(std::ostream &os) const override
Customized printing of arguments of a RooProdPdf to more intuitively reflect the contents of the prod...
std::list< double > * binBoundaries(RooAbsRealLValue &, double, double) const override
Forward the plot sampling hint from the p.d.f. that defines the observable obs.
RooObjCacheManager _cacheMgr
! The cache manager
std::string makeRGPPName(const char *pfx, const RooArgSet &term, const RooArgSet &iset, const RooArgSet &nset, const char *isetRangeName) const
Make an appropriate automatic name for a RooGenProdProj object in getPartIntList()
bool isDirectGenSafe(const RooAbsArg &arg) const override
Forward determination of safety of internal generator code to component p.d.f that would generate the...
ProcessProductTermOutput processProductTerm(const RooArgSet *nset, const RooArgSet *iset, const char *isetRangeName, const RooArgSet *term, const RooArgSet &termNSet, const RooArgSet &termISet, bool forceWrap=false) const
Calculate integrals of factorized product terms over observables iset while normalized to observables...
RooArgSet * findPdfNSet(RooAbsPdf const &pdf) const
Look up user specified normalization set for given input PDF component.
ExtendMode extendMode() const override
If this product contains exactly one extendable p.d.f return the extension abilities of that p....
std::list< double > * plotSamplingHint(RooAbsRealLValue &obs, double xlo, double xhi) const override
Forward the plot sampling hint from the p.d.f. that defines the observable obs.
double expectedEvents(const RooArgSet *nset) const override
Return the expected number of events associated with the extendable input PDF in the product.
bool isBinnedDistribution(const RooArgSet &obs) const override
If all components that depend on obs are binned that so is the product.
friend class RooProdGenContext
RooArgSet * getConnectedParameters(const RooArgSet &observables) const
Return all parameter constraint p.d.f.s on parameters listed in constrainedParams.
double calculate(const RooProdPdf::CacheElem &cache, bool verbose=false) const
Calculate running product of pdfs terms, using the supplied normalization set in 'normSetList' for ea...
RooArgSet _defNormSet
Default normalization set.
std::unique_ptr< RooAbsReal > specializeIntegral(RooAbsReal &input, const char *targetRangeName) const
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Determine which part (if any) of given integral can be performed analytically.
std::unique_ptr< RooAbsReal > createExpectedEventsFunc(const RooArgSet *nset) const override
Returns an object that represents the expected number of events for a given normalization set,...
CacheElem * getCacheElem(RooArgSet const *nset) const
bool redirectServersHook(const RooAbsCollection &, bool, bool, bool) override
Implement support for node removal.
void groupProductTerms(std::list< std::vector< RooArgSet * > > &groupedTerms, RooArgSet &outerIntDeps, Factorized const &factorized) const
Group product into terms that can be calculated independently.
std::vector< std::vector< int > > _genCode
! Registry of composite direct generator codes
void initGenerator(Int_t code) override
Forward one-time initialization call to component generation initialization methods.
void generateEvent(Int_t code) override
Generate a single event with configuration specified by 'code' Defer internal generation to component...
void fixRefRange(const char *rangeName)
std::unique_ptr< CacheElem > createCacheElem(const RooArgSet *nset, const RooArgSet *iset, const char *isetRangeName=nullptr) const
double evaluate() const override
Calculate current value of object.
void initializeFromCmdArgList(const RooArgSet &fullPdfSet, const RooLinkedList &l)
Initialize RooProdPdf configuration from given list of RooCmdArg configuration arguments and set of '...
void selectNormalizationRange(const char *rangeName=nullptr, bool force=false) override
Interface function used by test statistics to freeze choice of range for interpretation of conditiona...
double _cutOff
Cutoff parameter for running product.
std::unique_ptr< RooAbsReal > makeCondPdfRatioCorr(RooAbsReal &pdf, const RooArgSet &termNset, const RooArgSet &termImpSet, const char *normRange, const char *refRange) const
For single normalization ranges.
Represents the product of a given set of RooAbsReal objects.
Performs hybrid numerical/analytical integrals of RooAbsReal objects.
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const RooArgSet *nset=nullptr, const RooNumIntConfig *cfg=nullptr, const char *rangeName=nullptr) const override
Create an object that represents the integral of the function over one or more observables listed in ...
const RooAbsReal & integrand() const
Variable that can be changed from the outside.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
RooConstVar & RooConst(double val)
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
void compute(Config cfg, Computer comp, std::span< double > output, VarSpan vars, ArgSpan extraArgs={})
BinnedLOutput getBinnedL(RooAbsPdf const &pdf)
std::string getColonSeparatedNameString(RooArgSet const &argSet, char delim=':')