35 #include <sys/types.h> 107 using namespace std ;
152 Double_t inMaxVal,
const char *unit) :
196 return (
getVal()==value) ;
216 if (!assumeSameType) {
232 if(appendUnit && 0 != strlen(
getUnit())) {
299 <<
"): validation failed: " << value << endl ;
319 const RooArgSet* ,
const char* rangeName)
const 350 if (code==0)
return getVal(normSet) ;
364 coutF(
Eval) <<
"RooAbsReal::analyticalIntegral(" <<
GetName() <<
") code " << code <<
" not implemented" << endl ;
425 os << indent <<
"--- RooAbsReal ---" << endl;
427 if(!unit.IsNull()) unit.Prepend(
' ');
429 os << endl << indent <<
" Plot label is \"" <<
getPlotLabel() <<
"\"" << endl;
514 pc.
process(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
545 if (!rangeName || strchr(rangeName,
',')==0) {
553 TObjArray* oa = TString(rangeName).Tokenize(
",");
559 components.
add(*compIntegral) ;
564 title.Prepend(
"Integral of ") ;
593 title.Prepend(
"Integral of ") ;
617 TString title(integrand->
GetTitle()) ;
618 title.Prepend(
"Integral of ") ;
627 if (integrand !=
this) {
635 if (integrand ==
this && iset.
getSize()>0) {
636 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 ;
640 integrand = integral ;
648 coutE(
Integration) <<
GetName() <<
" : ERROR while defining recursive integral over observables with parameterized integration ranges, please check that integration rangs specify uniquely defined integral " << endl;
657 if (cacheParamsStr && strlen(cacheParamsStr)) {
665 if (cacheParams->
getSize()>0) {
667 <<
"-dim value cache for integral over " << iset2 <<
" as a function of " << *cacheParams <<
" in range " << (rangeName?rangeName:
"<none>") << endl ;
671 cachedIntegral->addOwnedComponents(*integral) ;
672 cachedIntegral->setCacheSource(
kTRUE) ;
674 cachedIntegral->setOperMode(
ADirty) ;
677 integral = cachedIntegral ;
723 obsWithParamRange.
add(*aarg) ;
724 obsWithFixedRange.
remove(*aarg) ;
725 obsServingAsRangeParams.
add(*loBoundObs,
kFALSE) ;
726 obsServingAsRangeParams.
add(*hiBoundObs,
kFALSE) ;
736 RooArgSet obsWithFixedRangeNP(obsWithFixedRange) ;
737 obsWithFixedRangeNP.
remove(obsServingAsRangeParams) ;
740 RooArgSet obsWithParamRangeNP(obsWithParamRange) ;
741 obsWithParamRangeNP.
remove(obsServingAsRangeParams) ;
745 innerObs.
add(obsWithFixedRangeNP) ;
746 innerObs.
add(obsWithParamRangeNP) ;
763 name.Append(
"_Int[") ;
778 name.Append(rangeName) ;
781 }
else if (!omitEmpty) {
782 name.Append(
"_Int[]") ;
785 if (nset && nset->
getSize()>0 ) {
790 name.Append(
"_Norm[") ;
872 assert(0 != dependentIterator);
877 <<
"\" of wrong type: " << arg->
ClassName() << endl;
878 delete dependentIterator;
885 <<
"\" is not a dependent and will be ignored." << endl;
890 leafNodes.
replace(*found,*arg);
892 leafNodes.
add(*arg) ;
902 leafNodes.
add(*lvs) ;
911 if(0 != projectedVars && projectedVars->
find(arg->
GetName())) {
913 <<
"\" cannot be both a dependent and a projected variable." << endl;
914 delete dependentIterator;
920 if(0 != projectedVars) leafNodes.
remove(*projectedVars,
kTRUE);
925 coutE(
Plotting) <<
"RooAbsPdf::createPlotProjection(" <<
GetName() <<
") Couldn't deep-clone PDF, abort," << endl ;
938 delete plotLeafNodes ;
942 if(0 != projectedVars) normSet.
add(*projectedVars);
951 if(0 == projectedVars) projectedVars= ∅
957 title.Prepend(
"Projection of ");
962 if(0 == projected || !projected->
isValid()) {
966 if(0 != projected)
delete projected;
967 delete dependentIterator;
975 projected->
SetName(name.Data()) ;
982 delete dependentIterator;
1018 if(hdim != plotVars.
getSize()) {
1027 for(
Int_t index= 0; index < plotVars.
getSize(); index++) {
1032 <<
"\" of type " << var->
ClassName() << endl;
1037 <<
":fillHistogram: WARNING: variable is not an explicit dependent: " << realVar->
GetName() << endl;
1053 if (projectedVars) {
1054 allDeps.
add(*projectedVars) ;
1068 Int_t xbins(0),ybins(1),zbins(1);
1080 assert(0 != zvar && 0 != zaxis);
1081 if (scaleForDensity) {
1089 assert(0 != yvar && 0 != yaxis);
1090 if (scaleForDensity) {
1098 assert(0 != xvar && 0 != xaxis);
1099 if (scaleForDensity) {
1105 << hdim <<
" dimensions" << endl;
1112 Int_t xbin(0),ybin(0),zbin(0);
1113 Int_t bins= xbins*ybins*zbins;
1114 for(
Int_t bin= 0; bin < bins; bin++) {
1117 if(bin % (xbins*ybins) == 0) {
1123 if(bin % xbins == 0) {
1124 ybin= (ybin%ybins) + 1;
1129 xbin= (xbin%xbins) + 1;
1139 coutW(
Plotting) <<
"WARNING: Function evaluation error(s) at coordinates [x]=" << xvar->
getVal() ;
1212 if (showProgress && (i%onePct==0)) {
1216 Double_t binVal = theClone->
getVal(normSet?normSet:obs)*scaleFactor ;
1217 if (correctForBinSize) {
1244 strlcpy(buf,varNameList,1024) ;
1245 char* varName = strtok(buf,
",:") ;
1250 varName = strtok(0,
",") ;
1252 varName = strtok(0,
",") ;
1341 pc.
defineInt(
"intBinning",
"IntrinsicBinning",0,2) ;
1342 pc.
defineInt(
"extended",
"Extended",0,2) ;
1346 pc.
defineSet(
"projObs",
"ProjectedObservables",0,0) ;
1349 pc.
defineMutex(
"SelectCompSet",
"SelectCompSpec") ;
1351 pc.
defineMutex(
"IntrinsicBinning",
"BinningName") ;
1352 pc.
defineMutex(
"IntrinsicBinning",
"BinningSpec") ;
1380 if (!pdfSelf && doExtended>0) {
1381 coutW(
InputArguments) <<
"RooAbsReal::createHistogram(" <<
GetName() <<
") WARNING extended mode requested for a non-pdf object, ignored" << endl ;
1385 coutW(
InputArguments) <<
"RooAbsReal::createHistogram(" <<
GetName() <<
") WARNING extended mode requested for a non-extendable pdf, ignored" << endl ;
1388 if (pdfSelf && doExtended==2) {
1392 const char* compSpec = pc.
getString(
"compSpec") ;
1394 Bool_t haveCompSel = ( (compSpec && strlen(compSpec)>0) || compSet) ;
1397 if (doIntBinning>0) {
1402 if (doIntBinning==1) {
1404 <<
") WARNING, intrinsic model binning requested for histogram, but model does not define bin boundaries, reverting to default binning"<< endl ;
1407 if (doIntBinning==2) {
1409 <<
") INFO: Model has intrinsic binning definition, selecting that binning for the histogram"<< endl ;
1412 for (list<double>::iterator it=bl->begin() ; it!=bl->end() ; ++it) { ba[i++] = *it ; }
1413 intBinning =
new RooBinning(bl->size()-1,ba) ;
1419 pc.
stripCmdList(argListCreate,
"Scaling,ProjectedObservables,IntrinsicBinning,SelectCompSet,SelectCompSpec,Extended") ;
1424 argListCreate.
Add(&tmp) ;
1442 if (!dynamic_cast<RooAbsReal*>(arg)) {
1443 branchNodeSet.
remove(*arg) ;
1454 if (dirSelNodes->
getSize()>0) {
1455 coutI(
Plotting) <<
"RooAbsPdf::createHistogram(" <<
GetName() <<
") directly selected PDF components: " << *dirSelNodes << endl ;
1461 coutE(
Plotting) <<
"RooAbsPdf::createHistogram(" <<
GetName() <<
") ERROR: component selection set " << *compSet <<
" does not match any components of p.d.f." << endl ;
1463 coutE(
Plotting) <<
"RooAbsPdf::createHistogram(" <<
GetName() <<
") ERROR: component selection expression '" << compSpec <<
"' does not select any components of p.d.f." << endl ;
1467 delete dirSelNodes ;
1505 if (!dynamic_cast<RooAbsReal*>(arg)) {
1506 branchNodeSet.
remove(*arg) ;
1547 selNodes->
add(tmp) ;
1548 coutI(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") indirectly selected PDF components: " << tmp << endl ;
1707 if (rcmd && TString(rcmd->
getString(0)).Contains(
",")) {
1711 argList.
Add(&rnorm) ;
1713 list<string> rlist ;
1718 char* oneRange = strtok(buf,
",") ;
1720 rlist.push_back(oneRange) ;
1721 oneRange = strtok(0,
",") ;
1724 for (list<string>::iterator riter=rlist.begin() ; riter!=rlist.end() ; ++riter) {
1737 pc.
defineString(
"curveNameSuffix",
"CurveNameSuffix",0,
"") ;
1746 pc.
defineInt(
"doEvalError",
"EvalErrorValue",0,0) ;
1747 pc.
defineInt(
"shiftToZero",
"ShiftToZero",0,0) ;
1752 pc.
defineSet(
"errorPars",
"VisualizeError",0) ;
1753 pc.
defineInt(
"linearMethod",
"VisualizeError",0,0) ;
1754 pc.
defineInt(
"binProjData",
"ProjData",0,0) ;
1757 pc.
defineInt(
"numee",
"PrintEvalErrors",0,10) ;
1758 pc.
defineInt(
"rangeAdjustNorm",
"Range",0,0) ;
1759 pc.
defineInt(
"rangeWNAdjustNorm",
"RangeWithName",0,0) ;
1763 pc.
defineInt(
"lineColor",
"LineColor",0,-999) ;
1764 pc.
defineInt(
"lineStyle",
"LineStyle",0,-999) ;
1765 pc.
defineInt(
"lineWidth",
"LineWidth",0,-999) ;
1766 pc.
defineInt(
"fillColor",
"FillColor",0,-999) ;
1767 pc.
defineInt(
"fillStyle",
"FillStyle",0,-999) ;
1769 pc.
defineInt(
"curveInvisible",
"Invisible",0,0) ;
1770 pc.
defineInt(
"showProg",
"ShowProgress",0,0) ;
1772 pc.
defineInt(
"interleave",
"NumCPU",1,0) ;
1776 pc.
defineInt(
"moveToBack",
"MoveToBack",0,0) ;
1780 pc.
defineMutex(
"VisualizeError",
"VisualizeErrorData") ;
1818 const char* sliceCatState = pc.
getString(
"sliceCatState",0,
kTRUE) ;
1820 if (sliceCatState) {
1829 strlcpy(buf,sliceCatState,1024) ;
1830 const char* slabel = strtok(buf,
",") ;
1842 slabel = strtok(0,
",") ;
1854 if (vlines==2) vlines=0 ;
1860 if (vlines==2) vlines=0 ;
1886 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Preprocessing: have slice " << *sliceSet << endl ;
1893 while((sliceArg=(
RooAbsArg*)iter->Next())) {
1896 projectedVars.
remove(*arg) ;
1899 << sliceArg->
GetName() <<
" was not projected anyway" << endl ;
1903 }
else if (projSet) {
1904 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Preprocessing: have projSet " << *projSet << endl ;
1907 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Preprocessing: have neither sliceSet nor projSet " << endl ;
1912 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Preprocessing: projectedVars = " << projectedVars << endl ;
1978 projDataVars.
add(*tmp) ;
2001 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") frame->getNormVars() that are also observables = " << *sliceSetTmp << endl ;
2014 << frame->
getPlotVar()->
GetName() <<
" represents a slice in " << *sliceSetTmp << endl ;
2016 sliceSet.
add(*sliceSetTmp) ;
2017 delete sliceSetTmp ;
2023 cxcoutD(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") projectedVars = " << projectedVars <<
" sliceSet = " << sliceSet << endl ;
2036 if (!plotCloneSet) {
2037 coutE(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") Couldn't deep-clone self, abort," << endl ;
2043 if (projectedVars.
getSize()) {
2045 <<
" integrates over variables " << projectedVars
2048 if (projDataNeededVars && projDataNeededVars->
getSize()>0) {
2050 <<
" averages using data variables " << *projDataNeededVars << endl ;
2058 if (projDataNeededVars) {
2062 deps->
add(*plotVar) ;
2068 coutE(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") error in checkObservables, abort" << endl ;
2070 delete plotCloneSet ;
2071 if (projDataNeededVars)
delete projDataNeededVars ;
2086 fullNormSet.
add(projectedVars) ;
2087 if (projDataNeededVars && projDataNeededVars->
getSize()>0) {
2088 fullNormSet.
add(*projDataNeededVars) ;
2104 if (o.
projData && projDataNeededVars && projDataNeededVars->
getSize()>0) {
2114 if (sliceDataSet->
getSize()>0) {
2120 cutString.Append(
"&&") ;
2127 if ((real = dynamic_cast<RooAbsRealLValue*>(sliceVar))) {
2129 }
else if ((cat = dynamic_cast<RooAbsCategoryLValue*>(sliceVar))) {
2135 delete sliceDataSet ;
2137 if (!cutString.IsNull()) {
2139 coutI(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") reducing given projection dataset to entries with " << cutString << endl ;
2144 <<
") only the following components of the projection data will be used: " << *projDataNeededVars << endl ;
2148 if (!o.
binProjData && dynamic_cast<RooDataSet*>(projDataSel)!=0) {
2155 if (!dynamic_cast<RooCategory*>(arg2)) allCat =
kFALSE ;
2160 coutI(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") unbinned projection dataset consist only of discrete variables," 2161 <<
" performing projection with binned copy for optimization." << endl ;
2169 if (projDataSel!=o.
projData)
delete projDataSel ;
2176 projection->
getVal(projDataSel->
get()) ;
2196 TString curveName(projection->
GetName()) ;
2213 curve->
SetName(curveName.Data()) ;
2234 if (projDataSel!=o.
projData)
delete projDataSel ;
2274 TString curveName(projection->
GetName()) ;
2282 curve->
SetName(curveName.Data()) ;
2303 if (projDataNeededVars)
delete projDataNeededVars ;
2305 delete projectionCompList ;
2306 delete plotCloneSet ;
2325 while((sliceArg=(
RooAbsArg*)iter->Next())) {
2328 projectedVars.
remove(*arg) ;
2331 << sliceArg->
GetName() <<
" was not projected anyway" << endl ;
2374 projDataVars.
add(*tmp) ;
2384 <<
") function doesn't depend on asymmetry category " << asymCat.
GetName() << endl ;
2391 <<
") asymmetry category must have 2 or 3 states with index values -1,0,1" << endl ;
2415 << frame->
getPlotVar()->
GetName() <<
" represents a slice in " << *sliceSetTmp << endl ;
2417 sliceSet.
add(*sliceSetTmp) ;
2418 delete sliceSetTmp ;
2442 if (projectedVars.
getSize()) {
2444 <<
" projects variables " << projectedVars << endl ;
2446 if (projDataNeededVars && projDataNeededVars->getSize()>0) {
2448 <<
" averages using data variables "<< *projDataNeededVars << endl ;
2467 RooArgSet *posProjCompList, *negProjCompList ;
2473 depPos.
add(projDataVars) ;
2474 depNeg.
add(projDataVars) ;
2478 if (!posProj || !negProj) {
2479 coutE(
Plotting) <<
"RooAbsReal::plotAsymOn(" <<
GetName() <<
") Unable to create projections, abort" << endl ;
2485 asymName.Append(
"_Asym[") ;
2486 asymName.Append(asymCat.
GetName()) ;
2487 asymName.Append(
"]") ;
2488 TString asymTitle(asymCat.
GetName()) ;
2489 asymTitle.Append(
" Asymmetry of ") ;
2497 if (projDataNeededVars && projDataNeededVars->getSize()<o.
projData->
get()->
getSize()) {
2502 if (sliceDataSet->
getSize()>0) {
2508 cutString.Append(
"&&") ;
2515 if ((real = dynamic_cast<RooAbsRealLValue*>(sliceVar))) {
2517 }
else if ((cat = dynamic_cast<RooAbsCategoryLValue*>(sliceVar))) {
2523 delete sliceDataSet ;
2525 if (!cutString.IsNull()) {
2528 <<
") reducing given projection dataset to entries with " << cutString << endl ;
2533 <<
") only the following components of the projection data will be used: " << *projDataNeededVars << endl ;
2543 ((
RooAbsReal*)posProj)->attachDataSet(*projDataSel) ;
2544 ((
RooAbsReal*)negProj)->attachDataSet(*projDataSel) ;
2555 TString curveName(funcAsym->
GetName()) ;
2578 if (projDataSel!=o.
projData)
delete projDataSel ;
2597 TString curveName(funcAsym->
GetName()) ;
2605 curve->
SetName(curveName.Data()) ;
2617 delete posProjCompList ;
2618 delete negProjCompList ;
2649 fpf_stripped.
add(*frv);
2663 vector<int> fpf_idx;
2667 paramList.
add(*par);
2668 fpf_idx.push_back(i);
2672 vector<Double_t> plusVar, minusVar ;
2679 for (
Int_t ivar=0 ; ivar<paramList.
getSize() ; ivar++) {
2687 ((
RooRealVar*)paramList.
at(ivar))->setVal(cenVal+errVal) ;
2688 plusVar.push_back(cloneFunc->
getVal(nset)) ;
2691 ((
RooRealVar*)paramList.
at(ivar))->setVal(cenVal-errVal) ;
2692 minusVar.push_back(cloneFunc->
getVal(nset)) ;
2698 vector<double> errVec(paramList.
getSize()) ;
2699 for (
int i=0 ; i<paramList.
getSize() ; i++) {
2700 errVec[i] =
sqrt(V(i,i)) ;
2701 for (
int j=i ; j<paramList.
getSize() ; j++) {
2702 C(i,j) = V(i,j)/
sqrt(V(i,i)*V(j,j)) ;
2709 for (
unsigned int j=0 ; j<plusVar.size() ; j++) {
2710 F[j] = (plusVar[j]-minusVar[j])/2 ;
2717 delete errorParams ;
2759 pc.
stripCmdList(plotArgListTmp,
"VisualizeError,MoveToBack") ;
2766 if (std::string(
"Normalization")==cmd->
GetName()) {
2769 plotArgList.
Add(cmd) ;
2772 plotArgList.
Add(cmd) ;
2799 coutI(
Plotting) <<
"RooAbsReal::plotOn(" <<
GetName() <<
") INFO: visualizing " << Z <<
"-sigma uncertainties in parameters " 2800 << *errorParams <<
" from fit result " << fr.
GetName() <<
" using " << n <<
" samplings." << endl ;
2805 RooDataSet*
d = paramPdf->generate(*errorParams,n) ;
2806 vector<RooCurve*> cvec ;
2808 *cloneParams = (*d->
get(i)) ;
2810 cloneFunc->
plotOn(frame,tmp2) ;
2811 cvec.push_back(frame->
getCurve()) ;
2824 for (vector<RooCurve*>::iterator i=cvec.begin() ; i!=cvec.end() ; ++i) {
2846 fpf_stripped.
add(*frv);
2859 vector<int> fpf_idx ;
2863 paramList.add(*par) ;
2864 fpf_idx.push_back(i) ;
2868 vector<RooCurve*> plusVar, minusVar ;
2877 for (
Int_t ivar=0 ; ivar<paramList.getSize() ; ivar++) {
2885 ((
RooRealVar*)paramList.at(ivar))->setVal(cenVal+Z*errVal) ;
2889 cloneFunc->
plotOn(frame,tmp2) ;
2890 plusVar.push_back(frame->
getCurve()) ;
2895 ((
RooRealVar*)paramList.at(ivar))->setVal(cenVal-Z*errVal) ;
2897 cloneFunc->
plotOn(frame,tmp3) ;
2898 minusVar.push_back(frame->
getCurve()) ;
2901 ((
RooRealVar*)paramList.at(ivar))->setVal(cenVal) ;
2905 vector<double> errVec(paramList.getSize()) ;
2906 for (
int i=0 ; i<paramList.getSize() ; i++) {
2907 errVec[i] =
sqrt(V(i,i)) ;
2908 for (
int j=i ; j<paramList.getSize() ; j++) {
2909 C(i,j) = V(i,j)/
sqrt(V(i,i)*V(j,j)) ;
2919 for (vector<RooCurve*>::iterator i=plusVar.begin() ; i!=plusVar.end() ; ++i) {
2922 for (vector<RooCurve*>::iterator i=minusVar.begin() ; i!=minusVar.end() ; ++i) {
2929 if (!band)
return frame ;
2933 pc.
defineString(
"curveNameSuffix",
"CurveNameSuffix",0,
"") ;
2934 pc.
defineInt(
"lineColor",
"LineColor",0,-999) ;
2935 pc.
defineInt(
"lineStyle",
"LineStyle",0,-999) ;
2936 pc.
defineInt(
"lineWidth",
"LineWidth",0,-999) ;
2937 pc.
defineInt(
"fillColor",
"FillColor",0,-999) ;
2938 pc.
defineInt(
"fillStyle",
"FillStyle",0,-999) ;
2940 pc.
defineInt(
"curveInvisible",
"Invisible",0,0) ;
2941 pc.
defineInt(
"moveToBack",
"MoveToBack",0,0) ;
3002 <<
":plotOn: frame does not specify a plot variable" << endl;
3007 if(!dynamic_cast<RooAbsRealLValue*>(var)) {
3037 <<
" allVars = " << (allVars?(*allVars):
RooArgSet()) << endl ;
3040 if (!allVars) return ;
3043 projectedVars.
add(*allVars) ;
3048 projectedVars.
remove(*found);
3058 <<
" from projection set because it a server of " << plotVar->
GetName() << endl ;
3059 projectedVars.
remove(*tmp) ;
3063 delete plotServers ;
3067 <<
") WARNING: cannot project out frame variable (" 3068 << found->
GetName() <<
"), ignoring" << endl ;
3080 <<
") function doesn't depend on projection variable " 3081 << arg->
GetName() <<
", ignoring" << endl ;
3120 if(binding && !binding->
isValid()) {
3144 }
else if (source->
getAttribute(
"INTEGER_TREE_BRANCH")) {
3150 }
else if (source->
getAttribute(
"SIGNEDBYTE_TREE_BRANCH")) {
3152 }
else if (source->
getAttribute(
"UNSIGNED_INTEGER_TREE_BRANCH")) {
3190 TBranch* branch = t.GetBranch(cleanName) ;
3201 <<
" is an array and cannot be attached to a RooAbsReal" << endl ;
3207 if (!typeName.CompareTo(
"Float_t")) {
3209 <<
" will be converted to double precision" << endl ;
3213 }
else if (!typeName.CompareTo(
"Int_t")) {
3215 <<
" will be converted to double precision" << endl ;
3218 t.SetBranchAddress(cleanName,&
_intValue) ;
3219 }
else if (!typeName.CompareTo(
"UChar_t")) {
3221 <<
" will be converted to double precision" << endl ;
3225 }
else if (!typeName.CompareTo(
"Bool_t")) {
3227 <<
" will be converted to double precision" << endl ;
3231 }
else if (!typeName.CompareTo(
"Char_t")) {
3233 <<
" will be converted to double precision" << endl ;
3237 }
else if (!typeName.CompareTo(
"UInt_t")) {
3239 <<
" will be converted to double precision" << endl ;
3243 }
else if (!typeName.CompareTo(
"Double_t")) {
3244 t.SetBranchAddress(cleanName,&
_value) ;
3246 coutE(
InputArguments) <<
"RooAbsReal::attachToTree(" <<
GetName() <<
") data type " << typeName <<
" is not supported" << endl ;
3258 TString format(cleanName);
3259 format.Append(
"/D");
3260 branch = t.Branch(cleanName, &
_value, (
const Text_t*)format, bufSize);
3418 const TList &nameList)
const 3427 matched.
add(*found);
3441 if(isMatched) matchedArgs.
add(matched);
3490 if (config)
return config ;
3503 if (config)
return config ;
3615 if (inLogEvalError) {
3618 inLogEvalError =
kTRUE ;
3623 if (serverValueString) {
3628 oocoutE((
TObject*)0,
Eval) <<
"RooAbsReal::logEvalError(" <<
"<STATIC>" <<
") evaluation error, " << endl
3629 <<
" origin : " << origName << endl
3630 <<
" message : " << ee.
_msg << endl
3631 <<
" server values: " << ee.
_srvval << endl ;
3638 inLogEvalError =
kFALSE ;
3670 if (inLogEvalError) {
3673 inLogEvalError =
kTRUE ;
3678 if (serverValueString) {
3698 ostringstream oss2 ;
3702 coutE(
Eval) <<
"RooAbsReal::logEvalError(" <<
GetName() <<
") evaluation error, " << endl
3703 <<
" origin : " << oss2.str() << endl
3704 <<
" message : " << ee.
_msg << endl
3705 <<
" server values: " << ee.
_srvval << endl ;
3714 <<
") delayed evaluation error, " << endl
3715 <<
" origin : " << oss2.str() << endl
3716 <<
" message : " << oee.
_msg << endl
3717 <<
" server values: " << oee.
_srvval << endl ;
3724 inLogEvalError =
kFALSE ;
3760 if (maxPerNode<0) return ;
3762 map<const RooAbsArg*,pair<string,list<EvalError> > >::iterator iter =
_evalErrorList.begin() ;
3765 if (maxPerNode==0) {
3768 os << iter->second.first ;
3770 os <<
" has " << iter->second.second.size() <<
" errors" << endl ;
3775 os << iter->second.first << endl ;
3779 std::list<EvalError>::iterator iter2 = iter->second.second.begin() ;
3780 for(;iter2!=iter->second.second.end() ; ++iter2, i++) {
3781 os <<
" " << iter2->_msg <<
" @ " << iter2->_srvval << endl ;
3783 os <<
" ... (remaining " << iter->second.second.size() - maxPerNode <<
" messages suppressed)" << endl ;
3803 map<const RooAbsArg*,pair<string,list<EvalError> > >::iterator iter =
_evalErrorList.begin() ;
3805 ntot += iter->second.second.size() ;
3880 orderedObs.
add(obs) ;
3940 pc.
defineInt(
"numScanBins",
"ScanParameters",0,1000) ;
3941 pc.
defineInt(
"intOrder",
"ScanParameters",1,2) ;
3942 pc.
defineInt(
"doScanNum",
"ScanNum",0,1) ;
3943 pc.
defineInt(
"doScanAll",
"ScanAll",0,0) ;
3944 pc.
defineInt(
"doScanNon",
"ScanNone",0,0) ;
3948 pc.
process(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
3978 coutI(
NumIntegration) <<
"RooAbsPdf::createRunningIntegral(" <<
GetName() <<
") integration over observable(s) " << iset <<
" involves numeric integration," << endl
3979 <<
" constructing cdf though numeric integration of sampled pdf in " << numScanBins <<
" bins and applying order " 3980 << intOrder <<
" interpolation on integrated histogram." << endl
3981 <<
" To override this choice of technique use argument ScanNone(), to change scan parameters use ScanParameters(nbins,order) argument" << endl ;
3999 ivar->
setBins(numScanBins,
"numcdf") ;
4019 if (dynamic_cast<RooRealVar*>(arg)) {
4043 cloneList.
add(*cloneArg) ;
4049 loList.
add(*cloneLo) ;
4082 coutE(
InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified observables are not variables of this p.d.f" << endl ;
4088 coutE(
InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified parameters are not variables of this p.d.f" << endl ;
4109 coutE(
InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified observables are not variables of this p.d.f" << endl ;
4115 coutE(
InputArguments) <<
"RooAbsReal::functor(" <<
GetName() <<
") ERROR: one or more specified parameters are not variables of this p.d.f" << endl ;
4123 for (
int i=0 ; i<obs.
getSize() ; i++) {
4124 if (dynamic_cast<RooRealVar*>(obs.
at(i))==0) {
4129 for (
int i=0 ; i<pars.
getSize() ; i++) {
4130 if (dynamic_cast<RooRealVar*>(pars.
at(i))==0) {
4163 <<
" observables specified, but a ROOT TFx can only have 1,2 or 3 observables" << endl ;
4168 for (
int i=0 ; i<pars.
getSize() ; i++) {
4186 return new RooDerivative(name.c_str(),title.c_str(),*
this,obs,order,eps) ;
4198 return new RooDerivative(name.c_str(),title.c_str(),*
this,obs,normSet,order,eps) ;
4210 string title=
Form(
"%sMoment of order %d of %s w.r.t %s ",(central?
"Central ":
""),order,
GetName(),obs.
GetName()) ;
4211 if (order==1)
return new RooFirstMoment(name.c_str(),title.c_str(),*
this,obs) ;
4212 if (order==2)
return new RooSecondMoment(name.c_str(),title.c_str(),*
this,obs,central,takeRoot) ;
4213 return new RooMoment(name.c_str(),title.c_str(),*
this,obs,order,central,takeRoot) ;
4225 string title=
Form(
"%sMoment of order %d of %s w.r.t %s ",(central?
"Central ":
""),order,
GetName(),obs.
GetName()) ;
4227 if (order==1)
return new RooFirstMoment(name.c_str(),title.c_str(),*
this,obs,normObs,intNormObs) ;
4228 if (order==2)
return new RooSecondMoment(name.c_str(),title.c_str(),*
this,obs,normObs,central,takeRoot,intNormObs) ;
4229 return new RooMoment(name.c_str(),title.c_str(),*
this,obs,normObs,order,central,takeRoot,intNormObs) ;
4361 return new RooChi2Var(name.c_str(),name.c_str(),*
this,
data,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
4385 return createChi2(data,*cmds[0],*cmds[1],*cmds[2],*cmds[3],*cmds[4],*cmds[5],*cmds[6],*cmds[7]) ;
4504 pc.
defineInt(
"integrate",
"Integrate",0,0) ;
4520 return new RooXYChi2Var(name.c_str(),name.c_str(),*
this,
data,*yvar,integrate) ;
4541 pc.
defineInt(
"optConst",
"Optimize",0,1) ;
4545 pc.
defineInt(
"plevel",
"PrintLevel",0,1) ;
4547 pc.
defineInt(
"initHesse",
"InitialHesse",0,0) ;
4551 pc.
defineInt(
"numee",
"PrintEvalErrors",0,10) ;
4573 #ifdef __ROOFIT_NOROOMINIMIZER 4574 const char* minType =0 ;
4576 const char* minType = pc.
getString(
"mintype",
"Minuit") ;
4577 const char* minAlg = pc.
getString(
"minalg",
"minuit") ;
4594 #ifdef __ROOFIT_NOROOMINIMIZER 4597 if (
"OldMinuit" ==
string(minType)) {
4619 ret = m.
fit(fitOpt) ;
4653 m.
minos(*minosSet) ;
4662 string title =
Form(
"Result of fit of %s ",
GetName()) ;
4663 ret = m.
save(name.c_str(),title.c_str()) ;
4668 #ifndef __ROOFIT_NOROOMINIMIZER 4690 ret = m.
fit(fitOpt) ;
4724 m.
minos(*minosSet) ;
4733 string title =
Form(
"Result of fit of %s ",
GetName()) ;
4734 ret = m.
save(name.c_str(),title.c_str()) ;
4776 while((arg=iter.
next())) {
4779 <<
") function does not depend on listed parameter " << arg->
GetName() <<
", ignoring" << endl ;
4782 if (plist.size()>0) plist +=
":" ;
virtual Double_t getMin(const char *name=0) const
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
static RooNumIntConfig & defaultConfig()
Return reference to instance of default numeric integrator configuration object.
virtual const char * GetName() const
Returns name of object.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual RooAbsArg * cloneTree(const char *newname=0) const
Clone tree expression of objects.
void setInterpolationOrder(Int_t order)
Set interpolation order of RooHistFunct representing cache histogram.
TIterator * createIterator(Bool_t dir=kIterForward) const
Bool_t postRangeFracScale
const char * getString(Int_t idx) const
static long int sum(long int i)
static void globalSelectComp(Bool_t flag)
Global switch controlling the activation of the selectComp() functionality.
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer, which is interpreted as an OR of 'enum ContentsOptions' values and in the style given by 'enum StyleOption'.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
void treeNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=0, Bool_t doBranch=kTRUE, Bool_t doLeaf=kTRUE, Bool_t valueOnly=kFALSE, Bool_t recurseNonDerived=kFALSE) const
Fill supplied list with nodes of the arg tree, following all server links, starting with ourself as t...
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg(), const RooCmdArg &arg10=RooCmdArg()) const
Plot (project) PDF on specified frame.
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
void setServerValues(const char *tmp)
void setPrintEvalErrors(Int_t numEvalErrors)
A RooCurve is a one-dimensional graphical representation of a real-valued function.
static EvalErrorIter evalErrorIter()
Bool_t _boolValue
Transient cache for integer values from tree branches.
const RooArgList & floatParsFinal() const
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
virtual Double_t getMax(const char *name=0) const
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
virtual const RooArgSet * get() const
void setVerbose(Bool_t flag=kTRUE)
TMatrixDSym reducedCovarianceMatrix(const RooArgList ¶ms) const
Return a reduced covariance matrix (Note that Vred is a simple sub-matrix of V, row/columns are order...
void optimizeConst(Int_t flag)
If flag is true, perform constant term optimization on function being minimized.
virtual TObject * clone(const char *newname) const
const char * addToCurveName
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
virtual void SetParName(Int_t ipar, const char *name)
Set name of parameter number ipar.
void sort(Bool_t ascend=kTRUE)
const Text_t * getUnit() const
void plotOnCompSelect(RooArgSet *selNodes) const
Helper function for plotting of composite p.d.fs.
static RooNumIntConfig * defaultIntegratorConfig()
Returns the default numeric integration configuration for all RooAbsReals.
Class RooProfileLL implements the profile likelihood estimator for a given likelihood and set of para...
Bool_t defineDouble(const char *name, const char *argName, Int_t doubleNum, Double_t defValue=0.)
Define Double_t property name 'name' mapped to Double_t in slot 'doubleNum' in RooCmdArg with name ar...
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Collectable string class.
virtual const RooArgSet * get() const
void setPlotLabel(const char *label)
Set the label associated with this variable.
RooCmdArg ZVar(const RooAbsRealLValue &var, const RooCmdArg &arg=RooCmdArg::none())
Int_t GetCompressionLevel() const
void leafNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=0, Bool_t recurseNonDerived=kFALSE) const
Fill supplied list with all leaf nodes of the arg tree, starting with ourself as top node...
virtual Double_t evaluate() const =0
RooAbsCollection * selectCommon(const RooAbsCollection &refColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
virtual Bool_t isValidReal(Double_t value, Bool_t printError=kFALSE) const
Interface function to check if given value is a valid value for this object.
Bool_t matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
virtual TObject * Clone(const char *newName=0) const
Make a clone of an object using the Streamer facility.
Int_t hesse()
Execute HESSE.
const char * getString(const char *name, const char *defaultValue="", Bool_t convEmptyToNull=kFALSE)
Return string property registered with name 'name'.
virtual Bool_t isParameterized() const
virtual Bool_t replace(const RooAbsArg &var1, const RooAbsArg &var2)
Replace var1 with var2 and return kTRUE for success.
Double_t getVal(const RooArgSet *set=0) const
Bool_t matchArgsByName(const RooArgSet &allArgs, RooArgSet &matchedArgs, const TList &nameList) const
Check if allArgs contains matching elements for each name in nameList.
void setString(Int_t idx, const char *value)
const TMatrixDSym & covarianceMatrix() const
Return covariance matrix.
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported...
Lightweight interface adaptor that exports a RooAbsReal as a ROOT::Math::IMultiGenFunction.
RooFirstMoment represents the first, second, or third order derivative of any RooAbsReal as calculate...
virtual const char * GetTypeName() const
RooAbsMoment * moment(RooRealVar &obs, Int_t order, Bool_t central, Bool_t takeRoot)
Return function representing moment of function of given order.
virtual TLeaf * GetLeafCounter(Int_t &countval) const
Return a pointer to the counter of this leaf (if any) or store the number of elements that the leaf c...
Class RooNumRunningInt is an implementation of RooAbsCachedReal that represents a running integral t...
void setBuffer(RooAbsReal *real, Double_t *newBuf)
RooAbsArg * createFundamental(const char *newname=0) const
Create a RooRealVar fundamental object with our properties.
void set(Double_t weight, Double_t wgtErr=-1)
Increment the weight of the bin enclosing the coordinates given by 'row' by the specified amount...
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE)
Add the specified plotable object to our plot.
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Double_t traceEval(const RooArgSet *set) const
Calculate current value of object, with error tracing wrapper.
void SetCompressionLevel(Int_t level=1)
Set compression level.
static std::map< const RooAbsArg *, std::pair< std::string, std::list< EvalError > > > _evalErrorList
Int_t minos()
Execute MINOS.
virtual Int_t GetNbinsZ() const
Bool_t defineSet(const char *name, const char *argName, Int_t setNum, const RooArgSet *set=0)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
TString getTitle(Bool_t appendUnit=kFALSE) const
Return this variable's title string.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
friend class RooRealIntegral
static void clearEvalErrorLog()
Clear the stack of evaluation error messages.
virtual RooAbsReal * createChi2(RooDataHist &data, const RooLinkedList &cmdList)
Internal back-end function to create a chi2.
void setNameList(const char *givenList)
virtual void selectNormalization(const RooArgSet *depSet=0, Bool_t force=kFALSE)
Interface function to force use of a given set of observables to interpret function value...
static constexpr double ps
static Int_t numEvalErrorItems()
RooFIter fwdIterator() const
void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTrackingOpt=kTRUE)
Driver function to propagate constant term optimizations in test statistic.
RooAbsData * reduce(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg())
Create a reduced copy of this dataset.
TAttFill * getAttFill(const char *name=0) const
Return a pointer to the fill attributes of the named object in this plot, or zero if the named object...
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void fixAddCoefRange(const char *rangeName=0, Bool_t force=kTRUE)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
void allowUndefined(Bool_t flag=kTRUE)
RooAbsReal * createScanRI(const RooArgSet &iset, const RooArgSet &nset, Int_t numScanBins, Int_t intOrder)
Utility function for createRunningIntegral that construct an object implementing the numeric scanning...
virtual Int_t getIndex() const
Return index number of current state.
Bool_t isValueDirtyAndClear() const
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
Int_t migrad()
Execute MIGRAD.
void setStrategy(Int_t strat)
Change MINUIT strategy to istrat.
TObject * At(Int_t idx) const
RooAbsMoment represents the first, second, or third order derivative of any RooAbsReal as calculated ...
TObject * getObject(const char *name, TObject *obj=0)
Return TObject property registered with name 'name'.
RooCmdArg SupNormSet(const RooArgSet &nset)
static void setHideOffset(Bool_t flag)
void attachDataSet(const RooAbsData &set)
Replace server nodes with names matching the dataset variable names with those data set variables...
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)
Copy the cached value of another RooAbsArg to our cache.
virtual RooPlot * plotAsymOn(RooPlot *frame, const RooAbsCategoryLValue &asymCat, PlotOpt o) const
Iterator abstract base class.
virtual ~RooAbsReal()
Destructor.
void setMinimizerType(const char *type)
Choose the minimzer algorithm.
Double_t findRoot(RooRealVar &x, Double_t xmin, Double_t xmax, Double_t yval)
Return value of x (in range xmin,xmax) at which function equals yval.
RooAbsReal * createRunningIntegral(const RooArgSet &iset, const RooArgSet &nset=RooArgSet())
Create a running integral over this function, i.e.
void setStrategy(Int_t strat)
Change MINUIT strategy to istrat.
virtual Bool_t setLabel(const char *label, Bool_t printError=kTRUE)
Set value by specifying the name of the desired state If printError is set, a message will be printed...
virtual Bool_t isValid() const
Check if current value is valid.
const char * curveNameSuffix
void setValueDirty() const
RooDataHist * fillDataHist(RooDataHist *hist, const RooArgSet *nset, Double_t scaleFactor, Bool_t correctForBinVolume=kFALSE, Bool_t showProgress=kFALSE) const
Fill a RooDataHist with values sampled from this function at the bin centers.
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
static const RooCmdArg & none()
Return reference to null argument.
void setStringAttribute(const Text_t *key, const Text_t *value)
Associate string 'value' to this object under key 'key'.
RooAbsReal * createIntRI(const RooArgSet &iset, const RooArgSet &nset=RooArgSet())
Utility function for createRunningIntegral that construct an object implementing the standard (analyt...
const char * normRange() const
virtual Int_t GetDimension() const
friend class RooRealBinding
void setVerbose(Bool_t flag=kTRUE)
virtual void SetMinimum(Double_t minimum=-1111)
Set minimum value of Y axis.
void setBinning(const RooAbsBinning &binning, const char *name=0)
Add given binning under name 'name' with this variable.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
const char * normRangeName
RooDataSet is a container class to hold N-dimensional binned data.
RooRealIntegral performs hybrid numerical/analytical integrals of RooAbsReal objects The class perfor...
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from stream (dummy for now)
RooAbsPdf * createHessePdf(const RooArgSet ¶ms) const
Return a p.d.f that represents the fit result as a multi-variate probability densisty function on the...
void findInnerMostIntegration(const RooArgSet &allObs, RooArgSet &innerObs, const char *rangeName) const
Utility function for createIntObj() that aids in the construct of recursive integrals over functions ...
virtual Double_t getValV(const RooArgSet *set=0) const
Return value of object.
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
virtual void SetName(const char *name="")
Set graph name.
TH1 * createHistogram(const char *name, const RooCmdArg &arg1=RooCmdArg::none(), 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
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
Int_t _intValue
Transient cache for floating point values from tree branches.