139 RooAbsArg(
name,title), _plotMin(0), _plotMax(0), _plotBins(100),
140 _value(0), _unit(unit), _forceNumInt(
kFALSE), _specIntegratorConfig(0), _treeVar(
kFALSE), _selectComp(
kTRUE), _lastNSet(0)
153 Double_t inMaxVal,
const char *unit) :
154 RooAbsArg(
name,title), _plotMin(inMinVal), _plotMax(inMaxVal), _plotBins(100),
155 _value(0), _unit(unit), _forceNumInt(
kFALSE), _specIntegratorConfig(0), _treeVar(
kFALSE), _selectComp(
kTRUE), _lastNSet(0)
167 RooAbsArg(other,
name), _plotMin(other._plotMin), _plotMax(other._plotMax),
168 _plotBins(other._plotBins), _value(other._value), _unit(other._unit), _label(other._label),
169 _forceNumInt(other._forceNumInt), _treeVar(other._treeVar), _selectComp(other._selectComp), _lastNSet(0)
221 return (
getVal()==value) ;
241 if (!assumeSameType) {
257 if(appendUnit && 0 != strlen(
getUnit())) {
314 maxSize = ret.size();
354 <<
"): validation failed: " << value << endl ;
374 const RooArgSet* ,
const char* rangeName)
const
405 if (code==0)
return getVal(normSet) ;
419 coutF(
Eval) <<
"RooAbsReal::analyticalIntegral(" <<
GetName() <<
") code " << code <<
" not implemented" << endl ;
480 os <<
indent <<
"--- RooAbsReal ---" << endl;
570 pc.defineString(
"rangeName",
"RangeWithName",0,
"",
kTRUE) ;
571 pc.defineObject(
"normSet",
"NormSet",0,0) ;
572 pc.defineObject(
"numIntConfig",
"NumIntConfig",0,0) ;
575 pc.process(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
581 const char* rangeName =
pc.getString(
"rangeName",0,
kTRUE) ;
606 if (!rangeName || strchr(rangeName,
',')==0) {
616 for (
const std::string& token : tokens) {
618 components.
add(*compIntegral);
622 title.
Prepend(
"Integral of ") ;
650 title.
Prepend(
"Integral of ") ;
675 title.
Prepend(
"Integral of ") ;
684 if (integrand !=
this) {
692 if (integrand ==
this && iset.
getSize()>0) {
693 coutI(
Integration) <<
GetName() <<
" : multidimensional integration over observables with parameterized ranges in terms of other integrated observables detected, using recursive integration strategy to construct final integral" << endl ;
697 integrand = integral ;
705 coutE(
Integration) <<
GetName() <<
" : ERROR while defining recursive integral over observables with parameterized integration ranges, please check that integration rangs specify uniquely defined integral " << endl;
714 if (cacheParamsStr && strlen(cacheParamsStr)) {
722 if (cacheParams->
getSize()>0) {
724 <<
"-dim value cache for integral over " << iset2 <<
" as a function of " << *cacheParams <<
" in range " << (rangeName?rangeName:
"<none>") << endl ;
734 integral = cachedIntegral ;
765 for (
const auto aarg : allObs) {
778 obsWithParamRange.
add(*aarg) ;
779 obsWithFixedRange.
remove(*aarg) ;
780 obsServingAsRangeParams.
add(*loBoundObs,
kFALSE) ;
781 obsServingAsRangeParams.
add(*hiBoundObs,
kFALSE) ;
790 RooArgSet obsWithFixedRangeNP(obsWithFixedRange) ;
791 obsWithFixedRangeNP.
remove(obsServingAsRangeParams) ;
794 RooArgSet obsWithParamRangeNP(obsWithParamRange) ;
795 obsWithParamRangeNP.
remove(obsServingAsRangeParams) ;
799 innerObs.
add(obsWithFixedRangeNP) ;
800 innerObs.
add(obsWithParamRangeNP) ;
817 name.Append(
"_Int[") ;
832 name.Append(rangeName) ;
835 }
else if (!omitEmpty) {
836 name.Append(
"_Int[]") ;
839 if (nset && nset->
getSize()>0 ) {
844 name.Append(
"_Norm[") ;
931 for (
const auto arg : dependentVars) {
932 if(!arg->isFundamental() && !
dynamic_cast<const RooAbsLValue*
>(arg)) {
934 <<
"\" of wrong type: " << arg->ClassName() << endl;
941 <<
"\" is not a dependent and will be ignored." << endl;
946 leafNodes.
replace(*found,*arg);
948 leafNodes.
add(*arg) ;
951 RooArgSet* lvDep = arg->getObservables(&leafNodes) ;
952 for (
const auto lvs : *lvDep) {
956 leafNodes.
add(*lvs) ;
963 if(0 != projectedVars && projectedVars->
find(arg->GetName())) {
965 <<
"\" cannot be both a dependent and a projected variable." << endl;
971 if(0 != projectedVars) leafNodes.
remove(*projectedVars,
kTRUE);
976 coutE(
Plotting) <<
"RooAbsPdf::createPlotProjection(" <<
GetName() <<
") Couldn't deep-clone PDF, abort," << endl ;
989 delete plotLeafNodes ;
993 if(0 != projectedVars) normSet.
add(*projectedVars);
1002 if(0 == projectedVars) projectedVars= ∅
1008 title.
Prepend(
"Projection of ");
1013 if(0 == projected || !projected->
isValid()) {
1017 if(0 != projected)
delete projected;
1022 static_cast<RooRealIntegral*
>(projected)->setAllowComponentSelection(
true);
1065 if(hdim != plotVars.
getSize()) {
1074 for(
Int_t index= 0; index < plotVars.
getSize(); index++) {
1079 <<
"\" of type " << var->
ClassName() << endl;
1084 <<
":fillHistogram: WARNING: variable is not an explicit dependent: " << realVar->
GetName() << endl;
1100 if (projectedVars) {
1101 allDeps.
add(*projectedVars) ;
1115 Int_t xbins(0),ybins(1),zbins(1);
1127 assert(0 != zvar && 0 != zaxis);
1128 if (scaleForDensity) {
1136 assert(0 != yvar && 0 != yaxis);
1137 if (scaleForDensity) {
1145 assert(0 != xvar && 0 != xaxis);
1146 if (scaleForDensity) {
1152 << hdim <<
" dimensions" << endl;
1159 Int_t xbin(0),ybin(0),zbin(0);
1160 Int_t bins= xbins*ybins*zbins;
1161 for(
Int_t bin= 0; bin < bins; bin++) {
1164 if(bin % (xbins*ybins) == 0) {
1170 if(bin % xbins == 0) {
1171 ybin= (ybin%ybins) + 1;
1176 xbin= (xbin%xbins) + 1;
1186 coutW(
Plotting) <<
"WARNING: Function evaluation error(s) at coordinates [x]=" << xvar->
getVal() ;
1259 if (showProgress && (i%onePct==0)) {
1263 Double_t binVal = theClone->
getVal(normSet?normSet:obs)*scaleFactor ;
1264 if (correctForBinSize) {
1296 strlcpy(buf,varNameList,1024) ;
1297 char* varName = strtok(buf,
",:") ;
1302 varName = strtok(0,
",") ;
1304 varName = strtok(0,
",") ;
1396 pc.defineInt(
"scaling",
"Scaling",0,1) ;
1397 pc.defineInt(
"intBinning",
"IntrinsicBinning",0,2) ;
1398 pc.defineInt(
"extended",
"Extended",0,2) ;
1400 pc.defineObject(
"compSet",
"SelectCompSet",0) ;
1401 pc.defineString(
"compSpec",
"SelectCompSpec",0) ;
1402 pc.defineSet(
"projObs",
"ProjectedObservables",0,0) ;
1403 pc.defineObject(
"yvar",
"YVar",0,0) ;
1404 pc.defineObject(
"zvar",
"ZVar",0,0) ;
1405 pc.defineMutex(
"SelectCompSet",
"SelectCompSpec") ;
1406 pc.defineMutex(
"IntrinsicBinning",
"Binning") ;
1407 pc.defineMutex(
"IntrinsicBinning",
"BinningName") ;
1408 pc.defineMutex(
"IntrinsicBinning",
"BinningSpec") ;
1409 pc.allowUndefined() ;
1412 pc.process(argList) ;
1430 Bool_t doScaling =
pc.getInt(
"scaling") ;
1431 Int_t doIntBinning =
pc.getInt(
"intBinning") ;
1432 Int_t doExtended =
pc.getInt(
"extended") ;
1436 if (!pdfSelf && doExtended>0) {
1437 coutW(
InputArguments) <<
"RooAbsReal::createHistogram(" <<
GetName() <<
") WARNING extended mode requested for a non-pdf object, ignored" << endl ;
1441 coutW(
InputArguments) <<
"RooAbsReal::createHistogram(" <<
GetName() <<
") WARNING extended mode requested for a non-extendable pdf, ignored" << endl ;
1444 if (pdfSelf && doExtended==2) {
1448 const char* compSpec =
pc.getString(
"compSpec") ;
1450 Bool_t haveCompSel = ( (compSpec && strlen(compSpec)>0) || compSet) ;
1453 if (doIntBinning>0) {
1458 if (doIntBinning==1) {
1460 <<
") WARNING, intrinsic model binning requested for histogram, but model does not define bin boundaries, reverting to default binning"<< endl ;
1463 if (doIntBinning==2) {
1465 <<
") INFO: Model has intrinsic binning definition, selecting that binning for the histogram"<< endl ;
1468 for (list<double>::iterator it=bl->begin() ; it!=bl->end() ; ++it) { ba[i++] = *it ; }
1469 intBinning =
new RooBinning(bl->size()-1,ba) ;
1475 pc.stripCmdList(argListCreate,
"Scaling,ProjectedObservables,IntrinsicBinning,SelectCompSet,SelectCompSpec,Extended") ;
1480 argListCreate.
Add(&tmp) ;
1499 branchNodeSet.
remove(*arg) ;
1510 if (dirSelNodes->
getSize()>0) {
1511 coutI(
Plotting) <<
"RooAbsPdf::createHistogram(" <<
GetName() <<
") directly selected PDF components: " << *dirSelNodes << endl ;
1517 coutE(
Plotting) <<
"RooAbsPdf::createHistogram(" <<
GetName() <<
") ERROR: component selection set " << *compSet <<
" does not match any components of p.d.f." << endl ;
1519 coutE(
Plotting) <<
"RooAbsPdf::createHistogram(" <<
GetName() <<
") ERROR: component selection expression '" << compSpec <<
"' does not select any components of p.d.f." << endl ;
1523 delete dirSelNodes ;
1559 for (
unsigned int i = 0; i < branchNodeSet.
size(); ++i) {
1560 const auto arg = branchNodeSet[i];
1562 branchNodeSet.
remove(*arg) ;
1569 for (
const auto arg : branchNodeSet) {
1578 for (
const auto arg : branchNodeSet) {
1579 for (
const auto selNode : *selNodes) {
1580 if (selNode->dependsOn(*arg)) {
1587 for (
const auto arg : branchNodeSet) {
1588 if (arg->dependsOn(*selNodes)) {
1593 tmp.
remove(*selNodes,
true);
1596 coutI(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") indirectly selected PDF components: " << tmp << endl ;
1599 for (
const auto arg : branchNodeSet) {
1600 Bool_t select = selNodes->
find(arg->GetName()) !=
nullptr;
1745 argList.
Add(&rnorm) ;
1747 std::vector<string> rlist;
1751 rlist.emplace_back(rangeNameToken);
1754 for (
const auto& rangeString : rlist) {
1756 rcmd->
setString(0, rangeString.c_str());
1765 pc.defineString(
"drawOption",
"DrawOption",0,
"L") ;
1766 pc.defineString(
"projectionRangeName",
"ProjectionRange",0,
"",
kTRUE) ;
1767 pc.defineString(
"curveNameSuffix",
"CurveNameSuffix",0,
"") ;
1768 pc.defineString(
"sliceCatState",
"SliceCat",0,
"",
kTRUE) ;
1769 pc.defineDouble(
"scaleFactor",
"Normalization",0,1.0) ;
1770 pc.defineInt(
"scaleType",
"Normalization",0,
Relative) ;
1771 pc.defineObject(
"sliceSet",
"SliceVars",0) ;
1772 pc.defineObject(
"sliceCatList",
"SliceCat",0,0,
kTRUE) ;
1773 pc.defineObject(
"projSet",
"Project",0) ;
1774 pc.defineObject(
"asymCat",
"Asymmetry",0) ;
1775 pc.defineDouble(
"precision",
"Precision",0,1
e-3) ;
1776 pc.defineDouble(
"evalErrorVal",
"EvalErrorValue",0,0) ;
1777 pc.defineInt(
"doEvalError",
"EvalErrorValue",0,0) ;
1778 pc.defineInt(
"shiftToZero",
"ShiftToZero",0,0) ;
1779 pc.defineObject(
"projDataSet",
"ProjData",0) ;
1780 pc.defineObject(
"projData",
"ProjData",1) ;
1781 pc.defineObject(
"errorFR",
"VisualizeError",0) ;
1782 pc.defineDouble(
"errorZ",
"VisualizeError",0,1.) ;
1783 pc.defineSet(
"errorPars",
"VisualizeError",0) ;
1784 pc.defineInt(
"linearMethod",
"VisualizeError",0,0) ;
1785 pc.defineInt(
"binProjData",
"ProjData",0,0) ;
1786 pc.defineDouble(
"rangeLo",
"Range",0,-999.) ;
1787 pc.defineDouble(
"rangeHi",
"Range",1,-999.) ;
1788 pc.defineInt(
"numee",
"PrintEvalErrors",0,10) ;
1789 pc.defineInt(
"rangeAdjustNorm",
"Range",0,0) ;
1790 pc.defineInt(
"rangeWNAdjustNorm",
"RangeWithName",0,0) ;
1791 pc.defineInt(
"VLines",
"VLines",0,2) ;
1792 pc.defineString(
"rangeName",
"RangeWithName",0,
"") ;
1793 pc.defineString(
"normRangeName",
"NormRange",0,
"") ;
1794 pc.defineInt(
"markerColor",
"MarkerColor",0,-999) ;
1795 pc.defineInt(
"markerStyle",
"MarkerStyle",0,-999) ;
1796 pc.defineDouble(
"markerSize",
"MarkerSize",0,-999) ;
1797 pc.defineInt(
"lineColor",
"LineColor",0,-999) ;
1798 pc.defineInt(
"lineStyle",
"LineStyle",0,-999) ;
1799 pc.defineInt(
"lineWidth",
"LineWidth",0,-999) ;
1800 pc.defineInt(
"fillColor",
"FillColor",0,-999) ;
1801 pc.defineInt(
"fillStyle",
"FillStyle",0,-999) ;
1802 pc.defineString(
"curveName",
"Name",0,
"") ;
1803 pc.defineInt(
"curveInvisible",
"Invisible",0,0) ;
1804 pc.defineInt(
"showProg",
"ShowProgress",0,0) ;
1805 pc.defineInt(
"numCPU",
"NumCPU",0,1) ;
1806 pc.defineInt(
"interleave",
"NumCPU",1,0) ;
1807 pc.defineString(
"addToCurveName",
"AddTo",0,
"") ;
1808 pc.defineDouble(
"addToWgtSelf",
"AddTo",0,1.) ;
1809 pc.defineDouble(
"addToWgtOther",
"AddTo",1,1.) ;
1810 pc.defineInt(
"moveToBack",
"MoveToBack",0,0) ;
1811 pc.defineMutex(
"SliceVars",
"Project") ;
1812 pc.defineMutex(
"AddTo",
"Asymmetry") ;
1813 pc.defineMutex(
"Range",
"RangeWithName") ;
1814 pc.defineMutex(
"VisualizeError",
"VisualizeErrorData") ;
1817 pc.process(argList) ;
1823 TString drawOpt(
pc.getString(
"drawOption"));
1828 Bool_t linMethod =
pc.getInt(
"linearMethod") ;
1829 if (!drawOpt.
Contains(
"P") && errFR) {
1836 o.
numee =
pc.getInt(
"numee") ;
1846 o.
eeval =
pc.getDouble(
"evalErrorVal") ;
1856 const char* sliceCatState =
pc.getString(
"sliceCatState",0,
kTRUE) ;
1857 const RooLinkedList& sliceCatList =
pc.getObjectList(
"sliceCatList") ;
1858 if (sliceCatState) {
1867 strlcpy(buf,sliceCatState,1024) ;
1868 const char* slabel = strtok(buf,
",") ;
1880 slabel = strtok(0,
",") ;
1887 Int_t vlines =
pc.getInt(
"VLines");
1888 if (
pc.hasProcessed(
"Range")) {
1892 if (vlines==2) vlines=0 ;
1893 }
else if (
pc.hasProcessed(
"RangeWithName")) {
1898 if (vlines==2) vlines=0 ;
1903 if (
pc.hasProcessed(
"NormRange")) {
1924 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Preprocessing: have slice " << *sliceSet << endl ;
1934 projectedVars.
remove(*arg) ;
1937 << sliceArg->
GetName() <<
" was not projected anyway" << endl ;
1941 }
else if (projSet) {
1942 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Preprocessing: have projSet " << *projSet << endl ;
1945 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Preprocessing: have neither sliceSet nor projSet " << endl ;
1950 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Preprocessing: projectedVars = " << projectedVars << endl ;
1965 Int_t lineColor =
pc.getInt(
"lineColor") ;
1966 Int_t lineStyle =
pc.getInt(
"lineStyle") ;
1967 Int_t lineWidth =
pc.getInt(
"lineWidth") ;
1968 Int_t markerColor =
pc.getInt(
"markerColor") ;
1969 Int_t markerStyle =
pc.getInt(
"markerStyle") ;
1970 Size_t markerSize =
pc.getDouble(
"markerSize") ;
1971 Int_t fillColor =
pc.getInt(
"fillColor") ;
1972 Int_t fillStyle =
pc.getInt(
"fillStyle") ;
1983 if (
pc.getInt(
"moveToBack") && frame->
numItems()>1) {
2022 projDataVars.
add(*tmp) ;
2045 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") frame->getNormVars() that are also observables = " << *sliceSetTmp << endl ;
2058 << frame->
getPlotVar()->
GetName() <<
" represents a slice in " << *sliceSetTmp << endl ;
2060 sliceSet.
add(*sliceSetTmp) ;
2061 delete sliceSetTmp ;
2067 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") projectedVars = " << projectedVars <<
" sliceSet = " << sliceSet << endl ;
2080 if (!plotCloneSet) {
2081 coutE(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Couldn't deep-clone self, abort," << endl ;
2087 if (projectedVars.
getSize()) {
2089 <<
" integrates over variables " << projectedVars
2092 if (projDataNeededVars && projDataNeededVars->
getSize()>0) {
2094 <<
" averages using data variables " << *projDataNeededVars << endl ;
2102 if (projDataNeededVars) {
2106 deps->
add(*plotVar) ;
2112 coutE(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") error in checkObservables, abort" << endl ;
2114 delete plotCloneSet ;
2115 if (projDataNeededVars)
delete projDataNeededVars ;
2130 fullNormSet.
add(projectedVars) ;
2131 if (projDataNeededVars && projDataNeededVars->
getSize()>0) {
2132 fullNormSet.
add(*projDataNeededVars) ;
2148 if (o.
projData && projDataNeededVars && projDataNeededVars->
getSize()>0) {
2158 if (sliceDataSet->
getSize()>0) {
2179 delete sliceDataSet ;
2181 if (!cutString.
IsNull()) {
2183 coutI(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") reducing given projection dataset to entries with " << cutString << endl ;
2188 <<
") only the following components of the projection data will be used: " << *projDataNeededVars << endl ;
2204 coutI(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") unbinned projection dataset consist only of discrete variables,"
2205 <<
" performing projection with binned copy for optimization." << endl ;
2213 if (projDataSel!=o.
projData)
delete projDataSel ;
2220 projection->
getVal(projDataSel->
get()) ;
2278 if (projDataSel!=o.
projData)
delete projDataSel ;
2361 if (projDataNeededVars)
delete projDataNeededVars ;
2363 delete projectionCompList ;
2364 delete plotCloneSet ;
2386 projectedVars.
remove(*arg) ;
2389 << sliceArg->
GetName() <<
" was not projected anyway" << endl ;
2432 projDataVars.
add(*tmp) ;
2442 <<
") function doesn't depend on asymmetry category " << asymCat.
GetName() << endl ;
2449 <<
") asymmetry category must have 2 or 3 states with index values -1,0,1" << endl ;
2473 << frame->
getPlotVar()->
GetName() <<
" represents a slice in " << *sliceSetTmp << endl ;
2475 sliceSet.
add(*sliceSetTmp) ;
2476 delete sliceSetTmp ;
2500 if (projectedVars.
getSize()) {
2502 <<
" projects variables " << projectedVars << endl ;
2504 if (projDataNeededVars && projDataNeededVars->
getSize()>0) {
2506 <<
" averages using data variables "<< *projDataNeededVars << endl ;
2525 RooArgSet *posProjCompList, *negProjCompList ;
2531 depPos.
add(projDataVars) ;
2532 depNeg.
add(projDataVars) ;
2536 if (!posProj || !negProj) {
2537 coutE(
Plotting) <<
"RooAbsReal::plotAsymOn(" <<
GetName() <<
") Unable to create projections, abort" << endl ;
2543 asymName.
Append(
"_Asym[") ;
2547 asymTitle.
Append(
" Asymmetry of ") ;
2560 if (sliceDataSet->
getSize()>0) {
2581 delete sliceDataSet ;
2583 if (!cutString.
IsNull()) {
2586 <<
") reducing given projection dataset to entries with " << cutString << endl ;
2591 <<
") only the following components of the projection data will be used: " << *projDataNeededVars << endl ;
2601 ((
RooAbsReal*)posProj)->attachDataSet(*projDataSel) ;
2602 ((
RooAbsReal*)negProj)->attachDataSet(*projDataSel) ;
2636 if (projDataSel!=o.
projData)
delete projDataSel ;
2675 delete posProjCompList ;
2676 delete negProjCompList ;
2708 fpf_stripped.
add(*frv);
2722 vector<int> fpf_idx;
2726 paramList.
add(*par);
2727 fpf_idx.push_back(i);
2731 vector<Double_t> plusVar, minusVar ;
2738 for (
Int_t ivar=0 ; ivar<paramList.
getSize() ; ivar++) {
2746 ((
RooRealVar*)paramList.
at(ivar))->setVal(cenVal+errVal) ;
2747 plusVar.push_back(cloneFunc->
getVal(nset)) ;
2750 ((
RooRealVar*)paramList.
at(ivar))->setVal(cenVal-errVal) ;
2751 minusVar.push_back(cloneFunc->
getVal(nset)) ;
2757 vector<double> errVec(paramList.
getSize()) ;
2758 for (
int i=0 ; i<paramList.
getSize() ; i++) {
2759 errVec[i] =
sqrt(V(i,i)) ;
2760 for (
int j=i ; j<paramList.
getSize() ; j++) {
2761 C(i,j) = V(i,j)/
sqrt(V(i,i)*V(j,j)) ;
2768 for (
unsigned int j=0 ; j<plusVar.size() ; j++) {
2769 F[j] = (plusVar[j]-minusVar[j])/2 ;
2776 delete errorParams ;
2828 pc.stripCmdList(plotArgListTmp,
"VisualizeError,MoveToBack") ;
2835 if (std::string(
"Normalization")==cmd->
GetName()) {
2838 plotArgList.
Add(cmd) ;
2841 plotArgList.
Add(cmd) ;
2872 coutI(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") INFO: visualizing " << Z <<
"-sigma uncertainties in parameters "
2873 << *errorParams <<
" from fit result " << fr.
GetName() <<
" using " <<
n <<
" samplings." << endl ;
2879 vector<RooCurve*> cvec ;
2880 for (
int i=0 ; i<
d->numEntries() ; i++) {
2881 *cloneParams = (*
d->get(i)) ;
2883 cloneFunc->
plotOn(frame,tmp2) ;
2884 cvec.push_back(frame->
getCurve()) ;
2897 for (vector<RooCurve*>::iterator i=cvec.begin() ; i!=cvec.end() ; ++i) {
2919 fpf_stripped.
add(*frv);
2932 vector<int> fpf_idx ;
2936 paramList.add(*par) ;
2937 fpf_idx.push_back(i) ;
2941 vector<RooCurve*> plusVar, minusVar ;
2950 for (
Int_t ivar=0 ; ivar<paramList.getSize() ; ivar++) {
2958 ((
RooRealVar*)paramList.at(ivar))->setVal(cenVal+Z*errVal) ;
2962 cloneFunc->
plotOn(frame,tmp2) ;
2963 plusVar.push_back(frame->
getCurve()) ;
2968 ((
RooRealVar*)paramList.at(ivar))->setVal(cenVal-Z*errVal) ;
2970 cloneFunc->
plotOn(frame,tmp3) ;
2971 minusVar.push_back(frame->
getCurve()) ;
2974 ((
RooRealVar*)paramList.at(ivar))->setVal(cenVal) ;
2978 vector<double> errVec(paramList.getSize()) ;
2979 for (
int i=0 ; i<paramList.getSize() ; i++) {
2980 errVec[i] =
sqrt(V(i,i)) ;
2981 for (
int j=i ; j<paramList.getSize() ; j++) {
2982 C(i,j) = V(i,j)/
sqrt(V(i,i)*V(j,j)) ;
2992 for (vector<RooCurve*>::iterator i=plusVar.begin() ; i!=plusVar.end() ; ++i) {
2995 for (vector<RooCurve*>::iterator i=minusVar.begin() ; i!=minusVar.end() ; ++i) {
3002 if (!band)
return frame ;
3005 pc.defineString(
"drawOption",
"DrawOption",0,
"F") ;
3006 pc.defineString(
"curveNameSuffix",
"CurveNameSuffix",0,
"") ;
3007 pc.defineInt(
"lineColor",
"LineColor",0,-999) ;
3008 pc.defineInt(
"lineStyle",
"LineStyle",0,-999) ;
3009 pc.defineInt(
"lineWidth",
"LineWidth",0,-999) ;
3010 pc.defineInt(
"markerColor",
"MarkerColor",0,-999) ;
3011 pc.defineInt(
"markerStyle",
"MarkerStyle",0,-999) ;
3012 pc.defineDouble(
"markerSize",
"MarkerSize",0,-999) ;
3013 pc.defineInt(
"fillColor",
"FillColor",0,-999) ;
3014 pc.defineInt(
"fillStyle",
"FillStyle",0,-999) ;
3015 pc.defineString(
"curveName",
"Name",0,
"") ;
3016 pc.defineInt(
"curveInvisible",
"Invisible",0,0) ;
3017 pc.defineInt(
"moveToBack",
"MoveToBack",0,0) ;
3018 pc.allowUndefined() ;
3021 pc.process(argList) ;
3027 frame->
addPlotable(band,
pc.getString(
"drawOption"),
pc.getInt(
"curveInvisible")) ;
3030 Int_t lineColor =
pc.getInt(
"lineColor") ;
3031 Int_t lineStyle =
pc.getInt(
"lineStyle") ;
3032 Int_t lineWidth =
pc.getInt(
"lineWidth") ;
3033 Int_t markerColor =
pc.getInt(
"markerColor") ;
3034 Int_t markerStyle =
pc.getInt(
"markerStyle") ;
3035 Size_t markerSize =
pc.getDouble(
"markerSize") ;
3036 Int_t fillColor =
pc.getInt(
"fillColor") ;
3037 Int_t fillStyle =
pc.getInt(
"fillStyle") ;
3048 if (
pc.getString(
"curveName",0,
kTRUE)) {
3050 }
else if (
pc.getString(
"curveNameSuffix",0,
kTRUE)) {
3052 name.Append(
pc.getString(
"curveNameSuffix",0,
kTRUE)) ;
3057 if (
pc.getInt(
"moveToBack") && frame->
numItems()>1) {
3083 <<
":plotOn: frame does not specify a plot variable" << endl;
3118 <<
" allVars = " << (allVars?(*allVars):
RooArgSet()) << endl ;
3121 if (!allVars) return ;
3124 projectedVars.
add(*allVars) ;
3129 projectedVars.
remove(*found);
3139 <<
" from projection set because it a server of " << plotVar->
GetName() << endl ;
3140 projectedVars.
remove(*tmp) ;
3144 delete plotServers ;
3148 <<
") WARNING: cannot project out frame variable ("
3149 << found->
GetName() <<
"), ignoring" << endl ;
3161 <<
") function doesn't depend on projection variable "
3162 << arg->
GetName() <<
", ignoring" << endl ;
3201 if(binding && !binding->
isValid()) {
3218 auto other =
static_cast<const RooAbsReal*
>(source);
3219 assert(
dynamic_cast<const RooAbsReal*
>(source));
3221 if (!other->_treeVar) {
3225 _value = other->_floatValue ;
3226 }
else if (source->
getAttribute(
"INTEGER_TREE_BRANCH")) {
3227 _value = other->_intValue ;
3229 _value = other->_byteValue ;
3231 _value = other->_boolValue ;
3232 }
else if (source->
getAttribute(
"SIGNEDBYTE_TREE_BRANCH")) {
3233 _value = other->_sbyteValue ;
3234 }
else if (source->
getAttribute(
"UNSIGNED_INTEGER_TREE_BRANCH")) {
3235 _value = other->_uintValue ;
3285 <<
" is an array and cannot be attached to a RooAbsReal" << endl ;
3293 <<
" will be converted to double precision" << endl ;
3297 }
else if (!typeName.
CompareTo(
"Int_t")) {
3299 <<
" will be converted to double precision" << endl ;
3303 }
else if (!typeName.
CompareTo(
"UChar_t")) {
3305 <<
" will be converted to double precision" << endl ;
3309 }
else if (!typeName.
CompareTo(
"Bool_t")) {
3311 <<
" will be converted to double precision" << endl ;
3315 }
else if (!typeName.
CompareTo(
"Char_t")) {
3317 <<
" will be converted to double precision" << endl ;
3321 }
else if (!typeName.
CompareTo(
"UInt_t")) {
3323 <<
" will be converted to double precision" << endl ;
3327 }
else if (!typeName.
CompareTo(
"Double_t")) {
3330 coutE(
InputArguments) <<
"RooAbsReal::attachToTree(" <<
GetName() <<
") data type " << typeName <<
" is not supported" << endl ;
3496 const TList &nameList)
const
3505 matched.
add(*found);
3519 if(isMatched) matchedArgs.
add(matched);
3568 if (config)
return config ;
3581 if (config)
return config ;
3683 if (inLogEvalError) {
3686 inLogEvalError =
kTRUE ;
3691 if (serverValueString) {
3696 oocoutE((
TObject*)0,
Eval) <<
"RooAbsReal::logEvalError(" <<
"<STATIC>" <<
") evaluation error, " << endl
3697 <<
" origin : " << origName << endl
3698 <<
" message : " << ee.
_msg << endl
3699 <<
" server values: " << ee.
_srvval << endl ;
3706 inLogEvalError =
kFALSE ;
3738 if (inLogEvalError) {
3741 inLogEvalError =
kTRUE ;
3746 if (serverValueString) {
3766 ostringstream oss2 ;
3770 coutE(
Eval) <<
"RooAbsReal::logEvalError(" <<
GetName() <<
") evaluation error, " << endl
3771 <<
" origin : " << oss2.str() << endl
3772 <<
" message : " << ee.
_msg << endl
3773 <<
" server values: " << ee.
_srvval << endl ;
3782 <<
") delayed evaluation error, " << endl
3783 <<
" origin : " << oss2.str() << endl
3784 <<
" message : " << oee.
_msg << endl
3785 <<
" server values: " << oee.
_srvval << endl ;
3792 inLogEvalError =
kFALSE ;
3828 if (maxPerNode<0) return ;
3830 map<const RooAbsArg*,pair<string,list<EvalError> > >::iterator iter =
_evalErrorList.begin() ;
3833 if (maxPerNode==0) {
3836 os << iter->second.first ;
3838 os <<
" has " << iter->second.second.size() <<
" errors" << endl ;
3843 os << iter->second.first << endl ;
3847 std::list<EvalError>::iterator iter2 = iter->second.second.begin() ;
3848 for(;iter2!=iter->second.second.end() ; ++iter2, i++) {
3849 os <<
" " << iter2->_msg <<
" @ " << iter2->_srvval << endl ;
3851 os <<
" ... (remaining " << iter->second.second.size() - maxPerNode <<
" messages suppressed)" << endl ;
3871 map<const RooAbsArg*,pair<string,list<EvalError> > >::iterator iter =
_evalErrorList.begin() ;
3873 ntot += iter->second.second.size() ;
3948 orderedObs.
add(obs) ;
4006 pc.defineObject(
"supNormSet",
"SupNormSet",0,0) ;
4007 pc.defineInt(
"numScanBins",
"ScanParameters",0,1000) ;
4008 pc.defineInt(
"intOrder",
"ScanParameters",1,2) ;
4009 pc.defineInt(
"doScanNum",
"ScanNum",0,1) ;
4010 pc.defineInt(
"doScanAll",
"ScanAll",0,0) ;
4011 pc.defineInt(
"doScanNon",
"ScanNone",0,0) ;
4012 pc.defineMutex(
"ScanNum",
"ScanAll",
"ScanNone") ;
4015 pc.process(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
4026 Int_t numScanBins =
pc.getInt(
"numScanBins") ;
4027 Int_t intOrder =
pc.getInt(
"intOrder") ;
4028 Int_t doScanNum =
pc.getInt(
"doScanNum") ;
4029 Int_t doScanAll =
pc.getInt(
"doScanAll") ;
4030 Int_t doScanNon =
pc.getInt(
"doScanNon") ;
4045 coutI(
NumIntegration) <<
"RooAbsPdf::createRunningIntegral(" <<
GetName() <<
") integration over observable(s) " << iset <<
" involves numeric integration," << endl
4046 <<
" constructing cdf though numeric integration of sampled pdf in " << numScanBins <<
" bins and applying order "
4047 << intOrder <<
" interpolation on integrated histogram." << endl
4048 <<
" To override this choice of technique use argument ScanNone(), to change scan parameters use ScanParameters(nbins,order) argument" << endl ;
4066 ivar->
setBins(numScanBins,
"numcdf") ;
4110 cloneList.
add(*cloneArg) ;
4116 loList.
add(*cloneLo) ;
4149 coutE(
InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified observables are not variables of this p.d.f" << endl ;
4155 coutE(
InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified parameters are not variables of this p.d.f" << endl ;
4176 coutE(
InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified observables are not variables of this p.d.f" << endl ;
4182 coutE(
InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified parameters are not variables of this p.d.f" << endl ;
4190 for (
int i=0 ; i<obs.
getSize() ; i++) {
4196 for (
int i=0 ; i<pars.
getSize() ; i++) {
4230 <<
" observables specified, but a ROOT TFx can only have 1,2 or 3 observables" << endl ;
4235 for (
int i=0 ; i<pars.
getSize() ; i++) {
4265 return new RooDerivative(
name.c_str(),title.c_str(),*
this,obs,normSet,order,eps) ;
4280 string title=
Form(
"%sMoment of order %d of %s w.r.t %s ",(central?
"Central ":
""),order,
GetName(),obs.
GetName()) ;
4282 if (order==2)
return new RooSecondMoment(
name.c_str(),title.c_str(),*
this,obs,central,takeRoot) ;
4283 return new RooMoment(
name.c_str(),title.c_str(),*
this,obs,order,central,takeRoot) ;
4299 string title=
Form(
"%sMoment of order %d of %s w.r.t %s ",(central?
"Central ":
""),order,
GetName(),obs.
GetName()) ;
4301 if (order==1)
return new RooFirstMoment(
name.c_str(),title.c_str(),*
this,obs,normObs,intNormObs) ;
4302 if (order==2)
return new RooSecondMoment(
name.c_str(),title.c_str(),*
this,obs,normObs,central,takeRoot,intNormObs) ;
4303 return new RooMoment(
name.c_str(),title.c_str(),*
this,obs,normObs,order,central,takeRoot,intNormObs) ;
4403 RooLinkedList chi2CmdList =
pc.filterCmdList(fitCmdList,
"Range,RangeWithName,NumCPU,Optimize") ;
4436 return new RooChi2Var(
name.c_str(),
name.c_str(),*
this,data,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
4461 return createChi2(data,*cmds[0],*cmds[1],*cmds[2],*cmds[3],*cmds[4],*cmds[5],*cmds[6],*cmds[7]) ;
4527 RooLinkedList chi2CmdList =
pc.filterCmdList(fitCmdList,
"YVar,Integrate") ;
4576 pc.defineInt(
"integrate",
"Integrate",0,0) ;
4577 pc.defineObject(
"yvar",
"YVar",0,0) ;
4580 pc.process(cmdList) ;
4586 Bool_t integrate =
pc.getInt(
"integrate") ;
4611 pc.defineString(
"fitOpt",
"FitOptions",0,
"") ;
4613 pc.defineInt(
"optConst",
"Optimize",0,1) ;
4614 pc.defineInt(
"verbose",
"Verbose",0,0) ;
4615 pc.defineInt(
"doSave",
"Save",0,0) ;
4616 pc.defineInt(
"doTimer",
"Timer",0,0) ;
4617 pc.defineInt(
"plevel",
"PrintLevel",0,1) ;
4618 pc.defineInt(
"strat",
"Strategy",0,1) ;
4619 pc.defineInt(
"initHesse",
"InitialHesse",0,0) ;
4620 pc.defineInt(
"hesse",
"Hesse",0,1) ;
4621 pc.defineInt(
"minos",
"Minos",0,0) ;
4622 pc.defineInt(
"ext",
"Extended",0,2) ;
4623 pc.defineInt(
"numee",
"PrintEvalErrors",0,10) ;
4624 pc.defineInt(
"doWarn",
"Warnings",0,1) ;
4625 pc.defineString(
"mintype",
"Minimizer",0,
"Minuit") ;
4626 pc.defineString(
"minalg",
"Minimizer",1,
"minuit") ;
4627 pc.defineObject(
"minosSet",
"Minos",0,0) ;
4629 pc.defineMutex(
"FitOptions",
"Verbose") ;
4630 pc.defineMutex(
"FitOptions",
"Save") ;
4631 pc.defineMutex(
"FitOptions",
"Timer") ;
4632 pc.defineMutex(
"FitOptions",
"Strategy") ;
4633 pc.defineMutex(
"FitOptions",
"InitialHesse") ;
4634 pc.defineMutex(
"FitOptions",
"Hesse") ;
4635 pc.defineMutex(
"FitOptions",
"Minos") ;
4638 pc.process(cmdList) ;
4644 const char* fitOpt =
pc.getString(
"fitOpt",0,
kTRUE) ;
4645#ifdef __ROOFIT_NOROOMINIMIZER
4646 const char* minType =0 ;
4648 const char* minType =
pc.getString(
"mintype",
"Minuit") ;
4649 const char* minAlg =
pc.getString(
"minalg",
"minuit") ;
4651 Int_t optConst =
pc.getInt(
"optConst") ;
4653 Int_t doSave =
pc.getInt(
"doSave") ;
4654 Int_t doTimer =
pc.getInt(
"doTimer") ;
4655 Int_t plevel =
pc.getInt(
"plevel") ;
4656 Int_t strat =
pc.getInt(
"strat") ;
4657 Int_t initHesse=
pc.getInt(
"initHesse") ;
4658 Int_t hesse =
pc.getInt(
"hesse") ;
4659 Int_t minos =
pc.getInt(
"minos") ;
4660 Int_t numee =
pc.getInt(
"numee") ;
4661 Int_t doWarn =
pc.getInt(
"doWarn") ;
4666#ifdef __ROOFIT_NOROOMINIMIZER
4669 if (
"OldMinuit" ==
string(minType)) {
4678 m.setPrintEvalErrors(numee) ;
4680 m.setPrintLevel(plevel) ;
4685 m.optimizeConst(optConst);