113  _pdfList(
"!pdfs",
"List of PDFs",this)
 
  116  _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(
"nset")) ;
 
  122  _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(
"nset")) ;
 
  127      coutW(InputArguments) << 
"RooProdPdf::RooProdPdf(" << 
GetName()
 
  128             << 
") multiple components with extended terms detected," 
  129             << 
" product will not be extendible." << endl ;
 
  161  _pdfList(
"!pdfs",
"List of PDFs",this)
 
  209  _pdfList(
"!pdfs",
"List of PDFs",this)
 
  233  _pdfList(
"!pdfList",
"List of PDFs",this)
 
  253  _pdfList(
"!pdfs",
"List of PDFs",this)
 
  266  _cacheMgr(other._cacheMgr,this),
 
  267  _genCode(other._genCode),
 
  268  _cutOff(other._cutOff),
 
  269  _pdfList(
"!pdfs",this,other._pdfList),
 
  270  _extendedIndex(other._extendedIndex),
 
  271  _useDefaultGen(other._useDefaultGen),
 
  272  _refRangeName(other._refRangeName),
 
  273  _selfNorm(other._selfNorm),
 
  274  _defNormSet(other._defNormSet)
 
  278    _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(nset->GetName()));
 
  292  Int_t numExtended(0) ;
 
  295  for(
auto const* pdf : static_range_cast<RooAbsPdf*>(fullPdfSet)) {
 
  297    _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(
"nset")) ;
 
  299    if (pdf->canBeExtended()) {
 
  307  for(
auto * carg : static_range_cast<RooCmdArg*>(
l)) {
 
  309    if (0 == strcmp(carg->GetName(), 
"Conditional")) {
 
  311      Int_t argType = carg->getInt(0) ;
 
  312      auto pdfSet = 
static_cast<RooArgSet const*
>(carg->getSet(0));
 
  313      auto normSet = 
static_cast<RooArgSet const*
>(carg->getSet(1));
 
  315      for(
auto * thePdf : static_range_cast<RooAbsPdf*>(*pdfSet)) {
 
  318        _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(0 == argType ? 
"nset" : 
"cset"));
 
  321        if (thePdf->canBeExtended()) {
 
  328    } 
else if (0 != strlen(carg->GetName())) {
 
  329      coutW(InputArguments) << 
"Unknown arg: " << carg->GetName() << endl ;
 
  335    coutW(InputArguments) << 
"RooProdPdf::RooProdPdf(" << 
GetName()
 
  336           << 
") WARNING: multiple components with extended terms detected," 
  337           << 
" product will not be extendible." << endl ;
 
  386      cxcoutD(Eval) << 
"RooProdPdf::calculate(" << 
GetName() << 
") rearranged product calculation" 
  400      const auto normSet = cache.
_normList[i].get();
 
  402      const double piVal = partInt.getVal(normSet->getSize() > 0 ? normSet : 
nullptr);
 
  425       auto span = dataMap.
at(i);
 
  426       factors.push_back(span);
 
  436void eraseNullptrs(std::vector<T*>& 
v) {
 
  437  v.erase(std::remove_if(
v.begin(), 
v.end(), [](T* 
x){ return x == nullptr; } ), 
v.end());
 
  440void removeCommon(std::vector<RooAbsArg*> &
v, std::span<RooAbsArg * const> other) {
 
  442  for (
auto const& arg : other) {
 
  443    auto namePtrMatch = [&arg](
const RooAbsArg* elm) {
 
  444      return elm != 
nullptr && elm->namePtr() == arg->namePtr();
 
  447    auto found = std::find_if(
v.begin(), 
v.end(), namePtrMatch);
 
  448    if(found != 
v.end()) {
 
  455void addCommon(std::vector<RooAbsArg*> &
v, std::vector<RooAbsArg*> 
const& o1, std::vector<RooAbsArg*> 
const& o2) {
 
  457  for (
auto const& arg : o1) {
 
  458    auto namePtrMatch = [&arg](
const RooAbsArg* elm) {
 
  459      return elm->namePtr() == arg->namePtr();
 
  462    if(std::find_if(o2.begin(), o2.end(), namePtrMatch) != o2.end()) {
 
  480  std::vector<RooArgSet> depAllList;
 
  481  std::vector<RooArgSet> depIntNoNormList;
 
  489  std::vector<RooAbsArg*> pdfIntNoNormDeps;
 
  490  std::vector<RooAbsArg*> pdfIntSet;
 
  491  std::vector<RooAbsArg*> pdfNSet;
 
  492  std::vector<RooAbsArg*> pdfCSet;
 
  493  std::vector<RooAbsArg*> pdfNormDeps; 
 
  494  std::vector<RooAbsArg*> pdfAllDeps; 
 
  497  for(std::size_t iPdf = 0; iPdf < 
_pdfList.
size(); ++iPdf) {
 
  508    RooArgSet pdfLeafList(
"leafNodeServerList") ;
 
  510    auto getObservablesOfCurrentPdf = [&pdfLeafList](
 
  511            std::vector<RooAbsArg*> & out,
 
  513      for (
const auto arg : pdfLeafList) {
 
  514        if (arg->dependsOnValue(dataList) && arg->isLValue()) {
 
  521    if (0 == strcmp(
"cset", pdfNSetOrig.
GetName())) {
 
  522      getObservablesOfCurrentPdf(pdfNSet, normSet);
 
  523      removeCommon(pdfNSet, pdfNSetOrig.
get());
 
  524      pdfCSet = pdfNSetOrig.
get();
 
  527      getObservablesOfCurrentPdf(pdfNSet, pdfNSetOrig);
 
  535    getObservablesOfCurrentPdf(pdfAllDeps, normSet);
 
  541    if (!pdfNSet.empty()) {
 
  543      addCommon(pdfNormDeps, pdfAllDeps, pdfNSet);
 
  546      pdfNormDeps = pdfAllDeps;
 
  552    getObservablesOfCurrentPdf(pdfIntSet, intSet) ;
 
  555    if (pdfNormDeps.empty() && !pdfCSet.empty()) {
 
  556      removeCommon(pdfIntSet, pdfCSet);
 
  560    pdfIntNoNormDeps.clear();
 
  561    pdfIntNoNormDeps = pdfIntSet;
 
  562    removeCommon(pdfIntNoNormDeps, pdfNormDeps);
 
  569    auto lIter = termList.
begin();
 
  570    auto ldIter = normList.
begin();
 
  571    for(;lIter != termList.
end(); (++lIter, ++ldIter, ++j)) {
 
  572      termNormDeps = 
static_cast<RooArgSet*
>(*ldIter);
 
  580      bool normOverlap = termNormDeps->
overlaps(pdfNormDeps.begin(), pdfNormDeps.end());
 
  587   termNormDeps->
add(pdfNormDeps.begin(), pdfNormDeps.end(), 
false);
 
  588   depAllList[j].add(pdfAllDeps.begin(), pdfAllDeps.end(), 
false);
 
  590     termIntDeps->
add(pdfIntSet.begin(), pdfIntSet.end(), 
false);
 
  592   if (termIntNoNormDeps) {
 
  593     termIntNoNormDeps->
add(pdfIntNoNormDeps.begin(), pdfIntNoNormDeps.end(), 
false);
 
  595   termIntNoNormDeps->
add(pdfIntNoNormDeps.begin(), pdfIntNoNormDeps.end(), 
false);
 
  602      if (!(pdfNormDeps.empty() && pdfAllDeps.empty() &&
 
  603       pdfIntSet.empty()) || normSet.
empty()) {
 
  605   termNormDeps = 
new RooArgSet(
"termNormDeps");
 
  606   depAllList.emplace_back(pdfAllDeps.begin(), pdfAllDeps.end(), 
"termAllDeps");
 
  607   termIntDeps = 
new RooArgSet(pdfIntSet.begin(), pdfIntSet.end(), 
"termIntDeps");
 
  608   depIntNoNormList.emplace_back(pdfIntNoNormDeps.begin(), pdfIntNoNormDeps.end(), 
"termIntNoNormDeps");
 
  609   termIntNoNormDeps = &depIntNoNormList.back();
 
  612   termNormDeps->
add(pdfNormDeps.begin(), pdfNormDeps.end(), 
false);
 
  615   normList.
Add(termNormDeps);
 
  616   intList.
Add(termIntDeps);
 
  625  auto lIter = termList.
begin();
 
  626  auto ldIter = normList.
begin();
 
  627  for(;lIter != termList.
end(); (++lIter, ++ldIter, ++i)) {
 
  628    normDeps = 
static_cast<RooArgSet*
>(*ldIter);
 
  632    impDeps.
remove(*normDeps, 
true, 
true);
 
  638    auto crossDeps = std::unique_ptr<RooAbsCollection>{depIntNoNormList[i].selectCommon(*normDeps)};
 
  639    crossDepList.
Add(crossDeps->snapshot());
 
  658  Int_t sterileIdx(-1);
 
  664  std::unique_ptr<CacheElem> cache = 
createCacheElem(nset, iset, isetRangeName);
 
  674                                                       const char* isetRangeName)
 const 
  682  auto cache = std::make_unique<CacheElem>();
 
  698  std::list<std::vector<RooArgSet*>> groupedList;
 
  706  std::map<std::string, RooArgSet> ratioTerms;
 
  707  for (
auto const& 
group : groupedList) {
 
  708    if (1 == 
group.size()) {
 
  716      RooArgSet termNSet(*norm), termImpSet(*imps);
 
  726   bool rangeIdentical(
true);
 
  728   for (
auto const* normObs : static_range_cast<RooRealVar*>(termNSet)) {
 
  742   if (!rangeIdentical ) {
 
  745     std::ostringstream str; termImpSet.
printValue(str);
 
  747     ratioTerms[str.str()].addOwned(std::move(ratio));
 
  754      for (
auto const& term : 
group) {
 
  759   RooArgSet termNSet(*norm), termImpSet(*imps);
 
  764     bool rangeIdentical(
true);
 
  767       for (
auto const* normObs : static_range_cast<RooRealVar*>(termNSet)) {
 
  772       for (
auto const* normObs : static_range_cast<RooRealVar*>(termNSet)) {
 
  778     if (!rangeIdentical ) {
 
  781       std::ostringstream str; termImpSet.
printValue(str);
 
  782       ratioTerms[str.str()].addOwned(std::move(ratio));
 
  792  for (
auto const& 
group : groupedList) {
 
  793      for (
auto const& term : 
group) {
 
  797   RooArgSet termNSet(*norm), termImpSet(*imps);
 
  800   ostringstream str; termNSet.printValue(str);
 
  801   if (!ratioTerms[str.str()].empty()) {
 
  803     term->add(ratioTerms[str.str()]);
 
  804     cache->_ownedList.addOwned(std::move(ratioTerms[str.str()]));
 
  809  for (
auto const& 
group : groupedList) {
 
  813    if (1 == 
group.size()) {
 
  823        RooArgSet termNSet, termISet, termXSet, termImpSet;
 
  826        termISet.
add(*integ);
 
  830        termXSet.
add(*xdeps);
 
  831        termImpSet.
add(*imps);
 
  835        vector<RooAbsReal*> func = 
processProductTerm(nset, iset, isetRangeName, term, termNSet, termISet, isOwned);
 
  837          cache->_partList.add(*func[0]);
 
  838          if (isOwned) cache->_ownedList.addOwned(std::unique_ptr<RooAbsArg>{func[0]});
 
  840          cache->_normList.emplace_back(norm->snapshot(
false));
 
  842          cache->_numList.addOwned(std::unique_ptr<RooAbsArg>{func[1]});
 
  843          cache->_denList.addOwned(std::unique_ptr<RooAbsArg>{func[2]});
 
  847      RooArgSet compTermSet, compTermNorm, compTermNum, compTermDen;
 
  848      for (
auto const& term : 
group) {
 
  856   RooArgSet termNSet, termISet, termXSet, termImpSet;
 
  857   termISet.
add(*integ);
 
  859   termXSet.
add(*xdeps);
 
  860   termImpSet.
add(*imps);
 
  863   termISet.
remove(outerIntDeps, 
true, 
true);
 
  865   bool isOwned = 
false;
 
  866   vector<RooAbsReal*> func = 
processProductTerm(nset, iset, isetRangeName, term, termNSet, termISet, isOwned, 
true);
 
  869     compTermSet.
add(*func[0]);
 
  870     if (isOwned) cache->_ownedList.addOwned(std::unique_ptr<RooAbsArg>{func[0]});
 
  871     compTermNorm.
add(*norm, 
false);
 
  873     compTermNum.
add(*func[1]);
 
  874     compTermDen.
add(*func[2]);
 
  890      const std::string prodname = 
makeRGPPName(
"SPECPROD", compTermSet, outerIntDeps, 
RooArgSet(), isetRangeName);
 
  891      auto prodtmp = std::make_unique<RooProduct>(prodname.c_str(), prodname.c_str(), compTermSet);
 
  893      const std::string intname = 
makeRGPPName(
"SPECINT", compTermSet, outerIntDeps, 
RooArgSet(), isetRangeName);
 
  894      auto inttmp = std::make_unique<RooRealIntegral>(intname.c_str(), intname.c_str(), *prodtmp, outerIntDeps, 
nullptr, 
nullptr, isetRangeName);
 
  895      inttmp->setStringAttribute(
"PROD_TERM_TYPE", 
"SPECINT");
 
  897      cache->_partList.add(*inttmp);
 
  901      auto prodtmp_num = std::make_unique<RooProduct>(prodname_num.c_str(), prodname_num.c_str(), compTermNum);
 
  902      prodtmp_num->addOwnedComponents(compTermNum);
 
  906      auto prodtmp_den = std::make_unique<RooProduct>(prodname_den.c_str(), prodname_den.c_str(), compTermDen);
 
  907      prodtmp_den->addOwnedComponents(compTermDen);
 
  910      std::string 
name = 
Form(
"SPEC_RATIO(%s,%s)", prodname_num.c_str(), prodname_den.c_str());
 
  911      auto ndr = std::make_unique<RooFormulaVar>(
name.c_str(), 
"@0/@1", 
RooArgList(*prodtmp_num, *prodtmp_den));
 
  914      std::unique_ptr<RooAbsReal> numtmp{ndr->createIntegral(outerIntDeps,isetRangeName)};
 
  915      numtmp->addOwnedComponents(std::move(ndr));
 
  917      cache->_ownedList.addOwned(std::move(prodtmp));
 
  918      cache->_ownedList.addOwned(std::move(inttmp));
 
  919      cache->_ownedList.addOwned(std::move(prodtmp_num));
 
  920      cache->_ownedList.addOwned(std::move(prodtmp_den));
 
  921      cache->_numList.addOwned(std::move(numtmp));
 
  923      cache->_normList.emplace_back(std::make_unique<RooArgSet>());
 
  924      compTermNorm.
snapshot(*cache->_normList.back(), 
false);
 
  950  std::unique_ptr<RooAbsReal> ratio_num{pdf.
createIntegral(termNset,normRangeTmp)};
 
  951  std::unique_ptr<RooAbsReal> ratio_den{pdf.
createIntegral(termNset,refRange)};
 
  952  auto ratio = std::make_unique<RooFormulaVar>(
Form(
"ratio(%s,%s)",ratio_num->GetName(),ratio_den->GetName()),
"@0/@1",
 
  955  ratio->addOwnedComponents(std::move(ratio_num));
 
  956  ratio->addOwnedComponents(std::move(ratio_den));
 
  957  ratio->setAttribute(
"RATIO_TERM") ;
 
  971  list<string> rangeComps ;
 
  976    char* token = R__STRTOK_R(buf.data(),
",",&
save) ;
 
  978      rangeComps.push_back(token) ;
 
  979      token = R__STRTOK_R(0,
",",&
save) ;
 
  984  std::map<std::string,RooArgSet> denListList ;
 
  986  string specIntRange ;
 
 1011   std::unique_ptr<RooArgSet> components{orig->
getComponents()};
 
 1013     if (carg->getAttribute(
"RATIO_TERM")) {
 
 1025     nomList.
add(*funcCust) ;
 
 1027     nomList.
add(*func) ;
 
 1042     if (arg->getAttribute(
"RATIO_TERM")) {
 
 1045       origNumTerm.
add(*arg) ;
 
 1053   nomList.
add(origNumTerm) ;
 
 1060    for (list<string>::iterator iter = rangeComps.begin() ; iter != rangeComps.end() ; ++iter) {
 
 1081   for (
auto* parg : static_range_cast<RooAbsReal*>(dentmp->
components())) {
 
 1103         partCust = cust.
build() ;
 
 1108         partCust = cust.
build() ;
 
 1118       string name = 
Form(
"%s_divided_by_ratio",specializedPartCust->GetName()) ;
 
 1119       auto specIntFinal = std::make_unique<RooFormulaVar>(
name.c_str(),
"@0/@1",
RooArgList(*specializedPartCust,*specializedRatio)) ;
 
 1120       specIntFinal->addOwnedComponents(std::move(specializedPartCust));
 
 1121       specIntFinal->addOwnedComponents(std::move(specializedRatio));
 
 1123       denListList[*iter].addOwned(std::move(specIntFinal));
 
 1144     tmp.
add(*specRatio) ;
 
 1146     auto specDenProd = std::make_unique<RooProduct>(pname.c_str(),pname.c_str(),tmp) ;
 
 1147     std::unique_ptr<RooAbsReal> specInt;
 
 1150       specInt = std::unique_ptr<RooAbsReal>{specDenProd->createIntegral(((
RooRealIntegral*)den)->intVars(),iter->c_str())};
 
 1151       specInt->addOwnedComponents(std::move(specDenProd));
 
 1155       specInt = std::unique_ptr<RooAbsReal>{specDenProd->createIntegral(origInt->
intVars(),iter->c_str())};
 
 1158       throw string(
"this should not happen") ;
 
 1162     string name = 
Form(
"%s_divided_by_ratio",specInt->GetName()) ;
 
 1163     auto specIntFinal = std::make_unique<RooFormulaVar>(
name.c_str(),
"@0/@1",
RooArgList(*specInt,*specRatio)) ;
 
 1164     specIntFinal->addOwnedComponents(std::move(specInt));
 
 1165     specIntFinal->addOwnedComponents(std::move(specRatio));
 
 1166     denListList[*iter].addOwned(std::move(specIntFinal));
 
 1177  if (nomList.
empty()) {
 
 1184  std::unique_ptr<RooAbsReal> numerator = std::make_unique<RooProduct>(
name.c_str(),
name.c_str(),nomList) ;
 
 1188  for (map<string,RooArgSet>::iterator iter = denListList.begin() ; iter != denListList.end() ; ++iter) {
 
 1194    products.
add(*prod_comp) ;
 
 1200  if (!specIntDeps.
empty()) {
 
 1203    string namesr = 
Form(
"SPEC_RATIO(%s,%s)",numerator->GetName(),norm->
GetName()) ;
 
 1208    numerator = std::unique_ptr<RooAbsReal>{ndr->
createIntegral(specIntDeps,specIntRange.c_str())};
 
 1237  std::unique_ptr<RooAbsReal> numint_spec{
specializeIntegral(*numint,targetRangeName)};
 
 1239  std::unique_ptr<RooAbsReal> ret = std::make_unique<RooFormulaVar>(
Form(
"ratio(%s,%s)",numint_spec->GetName(),denint->
GetName()),
"@0/@1",
RooArgList(*numint_spec,*denint)) ;
 
 1240  ret->addOwnedComponents(std::move(numint_spec));
 
 1267  std::stringstream errMsg;
 
 1268  errMsg << 
"specializeIntegral: unknown input type " << 
input.ClassName() << 
"::" << 
input.GetName();
 
 1269  throw std::runtime_error(errMsg.str());
 
 1281  for(
auto * term : static_range_cast<RooArgSet*>(terms)) {
 
 1282    groupedTerms.emplace_back();
 
 1283    groupedTerms.back().emplace_back(term) ;
 
 1288  for(
auto * impDeps : static_range_cast<RooArgSet*>(imps)) {
 
 1289    allImpDeps.
add(*impDeps,
false) ;
 
 1294  for(
auto * intDeps : static_range_cast<RooArgSet*>(ints)) {
 
 1295    allIntDeps.
add(*intDeps,
false) ;
 
 1302  for(
RooAbsArg * outerIntDep : outerIntDeps) {
 
 1305    std::vector<RooArgSet*>* newGroup = nullptr ;
 
 1308    bool needMerge = false ;
 
 1309    auto group = groupedTerms.begin();
 
 1310    auto nGroups = groupedTerms.size();
 
 1311    for (
size_t iGroup = 0; iGroup < nGroups; ++iGroup) {
 
 1314      for (
auto const& term2 : *
group) {
 
 1321   if (termNormDeps->
contains(*outerIntDep) ||
 
 1322       termIntDeps->
contains(*outerIntDep) ||
 
 1323       termImpDeps->
contains(*outerIntDep)) {
 
 1331   if (newGroup==
nullptr) {
 
 1332     groupedTerms.emplace_back() ;
 
 1333     newGroup = &groupedTerms.back() ;
 
 1337   for (
auto& term2 : *
group) {
 
 1338     newGroup->emplace_back(term2) ;
 
 1359                     bool& isOwned, 
bool forceWrap)
 const 
 1361  vector<RooAbsReal*> ret(3) ; ret[0] = 0 ; ret[1] = 0 ; ret[2] = 0 ;
 
 1377  if (nset && termNSet.
empty()) {
 
 1385  if (iset && termISet.
getSize()>0) {
 
 1404      ret[1] = std::unique_ptr<RooAbsReal>{pdf->
createIntegral(termISet,isetRangeName)}.release();
 
 1416      const std::string 
name = 
makeRGPPName(
"GENPROJ_",*term,termISet,termNSet,isetRangeName) ;
 
 1431      ret[1] = std::unique_ptr<RooAbsReal>{tmp_prod->
createIntegral(termISet,isetRangeName)}.release();
 
 1443    const std::string 
name = 
makeRGPPName(
"GENPROJ_",*term,termISet,termNSet,isetRangeName) ;
 
 1460    ret[1] = std::unique_ptr<RooAbsReal>{tmp_prod->
createIntegral(termISet,isetRangeName)}.release();
 
 1468  for (
auto* pdf : static_range_cast<RooAbsPdf*>(*term)) {
 
 1474      name.Append(
"_NORM[") ;
 
 1476      for (
auto const* arg : termNSet) {
 
 1482   name.Append(arg->GetName()) ;
 
 1499      ret[2] = std::unique_ptr<RooAbsReal>{pdf->createIntegral(termNSet,
normRange())}.release();
 
 1510      pdf->setStringAttribute(
"PROD_TERM_TYPE",
"IVb") ;
 
 1513      ret[1] = std::unique_ptr<RooAbsReal>{pdf->createIntegral(
RooArgSet())}.release();
 
 1514      ret[2] = !termNSet.
empty() ? std::unique_ptr<RooAbsReal>{pdf->createIntegral(termNSet,
normRange())}.release()
 
 1520  coutE(Eval) << 
"RooProdPdf::processProductTerm(" << 
GetName() << 
") unidentified term!!!" << endl ;
 
 1531                 const RooArgSet& nset, 
const char* isetRangeName)
 const 
 1535  std::ostringstream os(pfx);
 
 1540  for (
auto const* pdf : static_range_cast<RooAbsPdf*>(term)) {
 
 1541    if (!
first) os << 
"_X_";
 
 1543    os << pdf->GetName();
 
 1578                 const RooArgSet* normSet, 
const char* rangeName)
 const 
 1583  analVars.
add(allVars) ;
 
 1649    coutF(Generation) << 
"Requesting expected number of events from a RooProdPdf that does not contain an extended p.d.f" << endl ;
 
 1650    throw std::logic_error(std::string(
"RooProdPdf ") + 
GetName() + 
" could not be extended.");
 
 1659    coutF(Generation) << 
"Requesting expected number of events from a RooProdPdf that does not contain an extended p.d.f" << endl ;
 
 1660    throw std::logic_error(std::string(
"RooProdPdf ") + 
GetName() + 
" could not be extended.");
 
 1671                const RooArgSet* auxProto, 
bool verbose)
 const 
 1689  for (
auto const* arg : directVars) {
 
 1695  std::vector<Int_t> code;
 
 1697  for (
auto const* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
 
 1699    Int_t pdfCode = pdf->getGenerator(directSafe,pdfDirect,staticInitOK);
 
 1700    code.push_back(pdfCode);
 
 1702      generateVars.
add(pdfDirect) ;
 
 1707  if (generateVars.
getSize()>0) {
 
 1709    return masterCode+1 ;
 
 1727  for (
auto* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
 
 1728    if (codeList[i]!=0) {
 
 1729      pdf->initGenerator(codeList[i]) ;
 
 1748  for (
auto* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
 
 1749    if (codeList[i]!=0) {
 
 1750      pdf->generateEvent(codeList[i]) ;
 
 1781     os << 
indent << 
"RooProdPdf begin partial integral cache" << endl ;
 
 1784   auto indent2 = std::string(
indent) +  
"[" + std::to_string(curElem) + 
"]";
 
 1785   for(
auto const& arg : _partList) {
 
 1786     arg->printCompactTree(os,indent2.c_str()) ;
 
 1789   if (curElem==maxElem) {
 
 1790     os << 
indent << 
"RooProdPdf end partial integral cache" << endl ;
 
 1807  for (
auto* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
 
 1809    if (pdf->dependsOn(arg)) {
 
 1813      if (thePdf) 
return false ;
 
 1830  if (idx<0) 
return nullptr;
 
 1841   for(
auto arg : pdfs) {
 
 1844         coutW(InputArguments) << 
"RooProdPdf::addPdfs(" << 
GetName() << 
") list arg " 
 1845                               << arg->
GetName() << 
" is not a PDF, ignored" << endl ;
 
 1856      _pdfNSetList.emplace_back(std::make_unique<RooArgSet>(
"nset"));
 
 1860   if (numExtended>1) {
 
 1861      coutW(InputArguments) << 
"RooProdPdf::addPdfs(" << 
GetName()
 
 1862                            << 
") WARNING: multiple components with extended terms detected," 
 1863                            << 
" product will not be extendible." << endl ;
 
 1903   std::vector<TNamed const*> ptrs;
 
 1904   ptrs.reserve(col.
size());
 
 1906     ptrs.push_back(arg->namePtr());
 
 1908   std::sort(ptrs.begin(), ptrs.end());
 
 1912bool sortedNamePtrsOverlap(std::vector<TNamed const*> 
const& ptrsA, std::vector<TNamed const*> 
const& ptrsB)
 
 1914   auto pA = ptrsA.begin();
 
 1915   auto pB = ptrsB.begin();
 
 1916   while (pA != ptrsA.end() && pB != ptrsB.end()) {
 
 1919      } 
else if (*pB < *pA) {
 
 1938                                      bool stripDisconnected, 
bool removeConstraintsFromPdf)
 const 
 1944  auto observablesNamePtrs = sortedNamePtrs(observables);
 
 1945  auto constrainedParamsNamePtrs = sortedNamePtrs(constrainedParams);
 
 1948  for (std::size_t iPdf = 0; iPdf < 
_pdfList.
size(); ++iPdf) {
 
 1952    pdf->getParameters(
nullptr, tmp);
 
 1957    bool isConstraint = 
false;
 
 1960      auto tmpNamePtrs = sortedNamePtrs(tmp);
 
 1972      isConstraint = !sortedNamePtrsOverlap(tmpNamePtrs, observablesNamePtrs) &&
 
 1973                     sortedNamePtrsOverlap(tmpNamePtrs, constrainedParamsNamePtrs);
 
 1976      constraints.
add(*pdf) ;
 
 1977      conParams.
add(tmp,
true) ;
 
 1984      tmp.
remove(observables, 
false, 
true);
 
 1985      pdfParams.
add(tmp,
true) ;
 
 1990  if(removeConstraintsFromPdf) {
 
 1996  for(
auto * pdf : static_range_cast<RooAbsPdf*>(constraints)) {
 
 1997    if (pdf->dependsOnValue(pdfParams) || !stripDisconnected) {
 
 1998      finalConstraints->
add(*pdf) ;
 
 2000      coutI(Minimization) << 
"RooProdPdf::getConstraints(" << 
GetName() << 
") omitting term " << pdf->GetName()
 
 2001           << 
" as constraint term as it does not share any parameters with the other pdfs in product. " 
 2002           << 
"To force inclusion in likelihood, add an explicit Constrain() argument for the target parameter" << endl ;
 
 2010  cexl.
remove(pdfParams,
true,
true) ;
 
 2011  constrainedParams.
remove(cexl,
true,
true) ;
 
 2013  return finalConstraints ;
 
 2028  for (std::size_t iPdf = 0; iPdf < 
_pdfList.
size(); ++iPdf) {
 
 2033    if (
static_cast<int>(iPdf) == 
_extendedIndex || pdf->dependsOn(observables)) {
 
 2035      pdf->getParameters(&observables, tmp);
 
 2036      connectedPars->
add(tmp) ;
 
 2039  return connectedPars ;
 
 2049  if (!stripDisconnected) return ;
 
 2050  if (!nset || nset->
empty()) return ;
 
 2058  for (
auto param : *params) {
 
 2059    bool anyDep(
false) ;
 
 2060    for (
auto term : plist) {
 
 2061      if (term->dependsOnValue(*param)) {
 
 2066      tostrip.
add(*param) ;
 
 2070  if (!tostrip.
empty()) {
 
 2071    params->
remove(tostrip,
true,
true);
 
 2108  for (
auto const* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
 
 2109    if (std::list<double>* hint = pdf->plotSamplingHint(obs,xlo,xhi)) {
 
 2124  for (
auto const* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
 
 2125    if (pdf->dependsOn(obs) && !pdf->isBinnedDistribution(obs)) {
 
 2143  for (
auto const* pdf : static_range_cast<RooAbsPdf*>(
_pdfList)) {
 
 2144    if (std::list<double>* hint = pdf->binBoundaries(obs,xlo,xhi)) {
 
 2162    if (parg->canNodeBeCached()==
Always) {
 
 2163      trackNodes.
add(*parg) ;
 
 2170        if (
string(
"nset")==pdf_nset->GetName() && !pdf_nset->empty()) {
 
 2171          parg->setStringAttribute(
"CATNormSet",getColonSeparatedNameString(*pdf_nset).c_str()) ;
 
 2173        if (
string(
"cset")==pdf_nset->GetName()) {
 
 2174          parg->setStringAttribute(
"CATCondSet",getColonSeparatedNameString(*pdf_nset).c_str()) ;
 
 2177        coutW(Optimization) << 
"RooProdPdf::setCacheAndTrackHints(" << 
GetName() << 
") WARNING product pdf does not specify a normalization set for component " << parg->GetName() << endl ;
 
 2192    if (i>0) os << 
" * " ;
 
 2196      if (
string(
"nset")==ncset->
GetName()) {
 
 2201   for (
auto const* arg : *ncset) {
 
 2207     os << arg->GetName() ;
 
 2224    cxcoutD(LinkStateMgmt) << 
"RooProdPdf::redirectServersHook(" << 
GetName() << 
"): removing REMOVAL_DUMMY" << endl ;
 
 2239  for(std::unique_ptr<RooArgSet> 
const& normSet : 
_pdfNSetList) {
 
 2244        normSet->releaseOwnership();
 
 2245        normSet->replace(*std::unique_ptr<RooAbsArg>{arg}, *newArg->cloneTree());
 
 2246        normSet->takeOwnership();
 
 2256  os << 
"_partList\n";
 
 2257  os << getColonSeparatedNameString(_partList) << 
"\n";
 
 2259  os << getColonSeparatedNameString(_numList) << 
"\n";
 
 2261  os << getColonSeparatedNameString(_denList) << 
"\n";
 
 2262  os << 
"_ownedList\n";
 
 2263  os << getColonSeparatedNameString(_ownedList) << 
"\n";
 
 2264  os << 
"_normList\n";
 
 2265  for(
auto const& set : _normList) {
 
 2266    os << getColonSeparatedNameString(*set) << 
"\n";
 
 2268  os << 
"_isRearranged" << 
"\n";
 
 2269  os << _isRearranged << 
"\n";
 
 2270  os << 
"_rearrangedNum" << 
"\n";
 
 2271  if(_rearrangedNum) {
 
 2272    os << getColonSeparatedNameString(*_rearrangedNum) << 
"\n";
 
 2274    os << 
"nullptr" << 
"\n";
 
 2276  os << 
"_rearrangedDen" << 
"\n";
 
 2277  if(_rearrangedDen) {
 
 2278    os << getColonSeparatedNameString(*_rearrangedDen) << 
"\n";
 
 2280    os << 
"nullptr" << 
"\n";
 
 2286   if (normSet.
empty())
 
 2289   if (pdfNset && !pdfNset->empty()) {
 
 2290      std::unique_ptr<RooArgSet> out;
 
 2291      if (0 == strcmp(
"cset", pdfNset->GetName())) {
 
 2295         out = std::make_unique<RooArgSet>(normSet);
 
 2298         out->remove(common);
 
 2300         out = std::make_unique<RooArgSet>(*pdfNset);
 
 2305            if (!arg->getStringAttribute(
"__prefix__")) {
 
 2306               arg->SetName((std::string(prefix) + arg->GetName()).c_str());
 
 2307               arg->setStringAttribute(
"__prefix__", prefix);
 
 2325        _servers(
"!servers", 
"List of servers", this), _prodPdf{std::move(prodPdf)}
 
 2331        _servers(
"!servers", 
"List of servers", this), _prodPdf{static_cast<
RooProdPdf *>(other._prodPdf->
Clone())}
 
 2344      _prodPdf->calculateBatch(*_cache, stream, 
output, nEvents, dataMap);
 
 2351      return _prodPdf->createExpectedEventsFunc(&
_normSet);
 
 2357                                 const char *rangeName = 
nullptr)
 const override 
 2359      return _prodPdf->getAnalyticalIntegralWN(allVars, analVars, normSet, rangeName);
 
 2363      return _prodPdf->getAnalyticalIntegral(allVars, numVars, rangeName);
 
 2367      return _prodPdf->analyticalIntegralWN(code, normSet, rangeName);
 
 2371      return _prodPdf->analyticalIntegral(code, rangeName);
 
 2377      _cache = _prodPdf->createCacheElem(&
_normSet, 
nullptr);
 
 2378      auto &cache = *_cache;
 
 2383      if (cache._isRearranged) {
 
 2384         _servers.add(*cache._rearrangedNum);
 
 2385         _servers.add(*cache._rearrangedDen);
 
 2387         for (std::size_t i = 0; i < cache._partList.size(); ++i) {
 
 2388            _servers.add(cache._partList[i]);
 
 2393   double evaluate()
 const override { 
return _prodPdf->calculate(*_cache); }
 
 2396   std::unique_ptr<RooProdPdf::CacheElem> 
_cache;
 
 2401std::unique_ptr<RooAbsArg>
 
 2406      if (binnedInfo.binnedPdf && binnedInfo.binnedPdf != 
this) {
 
 2407         return binnedInfo.binnedPdf->compileForNormSet(normSet, ctx);
 
 2411   std::unique_ptr<RooProdPdf> prodPdfClone{
static_cast<RooProdPdf *
>(this->
Clone())};
 
 2414   for (
const auto server : prodPdfClone->servers()) {
 
 2416      RooArgSet const &nset = nsetForServer ? *nsetForServer : normSet;
 
 2419      server->getObservables(&nset, depList);
 
 2424   auto fixedProdPdf = std::make_unique<RooFixedProdPdf>(std::move(prodPdfClone), normSet);
 
 2427   return fixedProdPdf;
 
RooFitResult * save(const char *name=nullptr, const char *title=nullptr)
 
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.
 
const std::vector< Int_t > & retrieve(Int_t masterCode) const
Retrieve the array of integer codes associated with the given master code.
 
Int_t store(const std::vector< Int_t > &codeList, RooArgSet *set1=nullptr, RooArgSet *set2=nullptr, RooArgSet *set3=nullptr, RooArgSet *set4=nullptr)
Store given arrays of integer codes, and up to four RooArgSets in the registry (each setX pointer may...
 
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
 
RooExpensiveObjectCache & expensiveObjectCache() const
 
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.
 
void setOperMode(OperMode mode, bool recurseADirty=true)
Set the operation mode of this node.
 
void setStringAttribute(const Text_t *key, const Text_t *value)
Associate string 'value' to this object under key 'key'.
 
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...
 
virtual void setExpensiveObjectCache(RooExpensiveObjectCache &cache)
 
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'.
 
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.
 
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...
 
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.
 
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
 
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
 
virtual bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
 
Storage_t const & get() const
Const access to the underlying stl container.
 
bool contains(const RooAbsArg &var) const
Check if collection contains an argument with the same name as var.
 
void printValue(std::ostream &os) const override
Print value of collection, i.e.
 
Int_t getSize() const
Return the number of elements in the collection.
 
const char * GetName() const override
Returns name of object.
 
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
 
RooAbsArg * first() const
 
void clear()
Clear contents. If the collection is owning, it will also delete the contents.
 
bool selectCommon(const RooAbsCollection &refColl, RooAbsCollection &outColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
 
RooAbsArg * find(const char *name) const
Find object with given name in list.
 
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
 
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 integral (owned by _normMgr)
 
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
The cache manager.
 
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.
 
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
 
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
 
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
 
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create an object that represents the integral of the function over one or more observables std::liste...
 
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 std::string with unique suffix name to give to integral object that encodes integrated obse...
 
RooAddition calculates the sum of a set of RooAbsReal terms, or when constructed with two sets,...
 
const RooArgList & list1() const
 
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.
 
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 contatining the objects that are both in the cached set 1.
 
T * getObjByIndex(Int_t index) const
Retrieve payload object by slot index.
 
RooArgSet selectFromSet2(RooArgSet const &argSet, int index) const
Create RooArgSet contatining the objects that are both in the cached set 2.
 
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.
 
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
 
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) const override
 
RooCustomizer is a factory class to produce clones of a prototype composite PDF object with the same ...
 
void replaceArg(const RooAbsArg &orig, const RooAbsArg &subst)
Replace any occurence of arg 'orig' with arg 'subst'.
 
RooAbsArg * build(const char *masterCatState, bool verbose=false)
Build a clone of the prototype executing all registered 'replace' rules and 'split' rules for the mas...
 
RooDataSet is a container class to hold unbinned data.
 
void markAsCompiled(RooAbsArg &arg) const
 
bool likelihoodMode() const
 
void compileServer(RooAbsArg &server, RooAbsArg &arg, RooArgSet const &normSet)
 
RooSpan< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
 
A RooProdPdf with a fixed normalization set can be replaced by this class.
 
std::unique_ptr< RooProdPdf::CacheElem > _cache
 
void computeBatch(cudaStream_t *stream, double *output, size_t nEvents, RooFit::Detail::DataMap const &dataMap) const override
Base function for computing multiple values of a RooAbsReal.
 
RooFixedProdPdf(const RooFixedProdPdf &other, const char *name=nullptr)
 
RooFixedProdPdf(std::unique_ptr< RooProdPdf > &&prodPdf, RooArgSet const &normSet)
 
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
 
bool selfNormalized() const override
Shows if a PDF is self-normalized, which means that no attempt is made to add a normalization term.
 
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &numVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
 
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
 
std::unique_ptr< RooAbsReal > createExpectedEventsFunc(const RooArgSet *) const override
Returns an object that represents the expected number of events for a given normalization set,...
 
TObject * clone(const char *newname) const override
 
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
 
std::unique_ptr< RooProdPdf > _prodPdf
 
double expectedEvents(const RooArgSet *) const override
Return expected number of events to be used in calculation of extended likelihood.
 
bool canComputeBatchWithCuda() const override
 
bool forceAnalyticalInt(const RooAbsArg &dep) const override
 
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName) const override
Analytical integral with normalization (see RooAbsReal::analyticalIntegralWN() for further informatio...
 
ExtendMode extendMode() const override
Returns ability of PDF to provide extended likelihood terms.
 
RooGenProdProj is an auxiliary class for RooProdPdf that calculates a general normalised projection o...
 
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
 
TObject * At(int index) const
Return object stored in sequential position given by index.
 
RooLinkedListIterImpl end() const
 
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)
 
RooLinkedListIterImpl begin() const
 
Int_t IndexOf(const char *name) const
Return position of given object in list.
 
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
 
RooProdPdf is an efficient implementation of a product of PDFs of the form.
 
void setCacheAndTrackHints(RooArgSet &) override
Label OK'ed components of a RooProdPdf with cache-and-track, and label all RooProdPdf descendants wit...
 
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
 
void factorizeProduct(const RooArgSet &normSet, const RooArgSet &intSet, RooLinkedList &termList, RooLinkedList &normList, RooLinkedList &impDepList, RooLinkedList &crossDepList, RooLinkedList &intList) const
Factorize product in irreducible terms for given choice of integration/normalization.
 
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Return analytical integral defined by given scenario code.
 
RooArgSet * getConstraints(const RooArgSet &observables, RooArgSet &constrainedParams, bool stripDisconnected, bool removeConstraintsFromPdf=false) const override
Return all parameter constraint p.d.f.s on parameters listed in constrainedParams.
 
~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
 
std::unique_ptr< RooAbsReal > specializeIntegral(RooAbsReal &orig, const char *targetRangeName) const
 
bool forceAnalyticalInt(const RooAbsArg &dep) const override
Force RooRealIntegral to offer all observables for internal integration.
 
void calculateBatch(const RooProdPdf::CacheElem &cache, cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &) const
Evaluate product of PDFs in batch mode.
 
std::unique_ptr< RooAbsArg > compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext &ctx) const override
 
void getParametersHook(const RooArgSet *, RooArgSet *, bool stripDisconnected) 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.
 
RooAICRegistry _genCode
! Registry of composite direct generator codes
 
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
 
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...
 
std::unique_ptr< RooAbsReal > makeCondPdfRatioCorr(RooAbsReal &term, const RooArgSet &termNset, const RooArgSet &termImpSet, const char *normRange, const char *refRange) const
For single normalization ranges.
 
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.
 
std::vector< RooAbsReal * > processProductTerm(const RooArgSet *nset, const RooArgSet *iset, const char *isetRangeName, const RooArgSet *term, const RooArgSet &termNSet, const RooArgSet &termISet, bool &isOwned, bool forceWrap=false) const
Calculate integrals of factorized product terms over observables iset while normalized to observables...
 
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Determine which part (if any) of given integral can be performed analytically.
 
friend class RooFixedProdPdf
 
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 > 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
The cache manager.
 
bool redirectServersHook(const RooAbsCollection &, bool, bool, bool) override
Implement support for node removal.
 
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 groupProductTerms(std::list< std::vector< RooArgSet * > > &groupedTerms, RooArgSet &outerIntDeps, const RooLinkedList &terms, const RooLinkedList &norms, const RooLinkedList &imps, const RooLinkedList &ints, const RooLinkedList &cross) const
Group product into terms that can be calculated independently.
 
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.
 
A RooProduct represents the product of a given set of RooAbsReal objects.
 
RooRealIntegral performs hybrid numerical/analytical integrals of RooAbsReal objects.
 
RooArgSet intVars() const
 
const RooAbsReal & integrand() const
 
const char * intRange() const
 
The TNamed class is the base class for all named ROOT classes.
 
const char * GetName() const override
Returns name of object.
 
const char * GetTitle() const override
Returns title 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< RooSpan< const double > > VarVector
 
R__EXTERN RooBatchComputeInterface * dispatchCUDA
 
R__EXTERN RooBatchComputeInterface * dispatchCPU
This dispatch pointer points to an implementation of the compute library, provided one has been loade...
 
std::vector< double > ArgVector
 
BinnedLOutput getBinnedL(RooAbsPdf const &pdf)
 
std::string getColonSeparatedNameString(RooArgSet const &argSet)
Create a string with all sorted names of RooArgSet elements separated by colons.