192 RooAbsReal(
name,title), _norm(0), _normSet(0), _normMgr(this,10), _selectComp(
kTRUE), _specGeneratorConfig(0)
205 RooAbsReal(
name,title,plotMin,plotMax), _norm(0), _normSet(0), _normMgr(this,10), _selectComp(
kTRUE), _specGeneratorConfig(0)
218 _normMgr(other._normMgr,this), _selectComp(other._selectComp), _normRange(other._normRange)
295 logEvalError(
"p.d.f normalization integral is zero or negative") ;
303 _value = rawVal / normVal ;
324 cxcoutD(
Eval) <<
"RooAbsPdf::analyticalIntegralWN(" <<
GetName() <<
") code = " << code <<
" normset = " << (normSet?*normSet:
RooArgSet()) << endl ;
327 if (code==0)
return getVal(normSet) ;
347 logEvalError(
Form(
"p.d.f value is Not-a-Number (%f), forcing value to zero",value)) ;
351 logEvalError(
Form(
"p.d.f value is less than zero (%f), forcing value to zero",value)) ;
356 if(!error)
return error ;
379 if (!nset)
return 1 ;
387 coutW(
Eval) <<
"RooAbsPdf::getNorm(" <<
GetName() <<
":: WARNING normalization is zero, nset = " ; nset->
Print(
"1") ;
407 return cache->
_norm ;
453 if (nsetChanged && adjustProxies) {
463 ((
RooAbsPdf*)
this)->setProxyNormSet(nset) ;
471 <<
") recreating normalization integral " << endl ;
474 cxcoutD(
Tracing) << IsA()->GetName() <<
"::syncNormalization(" <<
GetName() <<
") selfNormalized, creating unit norm" << endl;
480 TString ntitle(
GetTitle()) ; ntitle.Append(
" Unit Normalization") ;
481 TString nname(
GetName()) ; nname.Append(
"_UnitNorm") ;
492 if (cacheParamsStr && strlen(cacheParamsStr)) {
500 if (cacheParams->
getSize()>0) {
502 <<
"-dim value cache for integral over " << *depList <<
" as a function of " << *cacheParams <<
" in range " << (nr?nr:
"<default>") << endl ;
506 cachedIntegral->addOwnedComponents(*normInt) ;
507 cachedIntegral->setCacheSource(
kTRUE) ;
509 cachedIntegral->setOperMode(
ADirty) ;
511 normInt= cachedIntegral ;
611 if (
fabs(prob)>1e6) {
612 coutW(
Eval) <<
"RooAbsPdf::getLogVal(" <<
GetName() <<
") WARNING: large likelihood value: " << prob << endl ;
617 logEvalError(
"getLogVal() top-level p.d.f evaluates to a negative number") ;
623 logEvalError(
"getLogVal() top-level p.d.f evaluates to zero") ;
625 return log((
double)0);
629 logEvalError(
"getLogVal() top-level p.d.f evaluates to NaN") ;
631 return log((
double)0);
665 if (
fabs(expected)<1
e-10 &&
fabs(observed)<1
e-10) {
671 logEvalError(
"extendedTerm #expected events is <0 or NaN") ;
702 << observed <<
" events. extendedTerm = " << extra << endl;
784 pc.defineString(
"rangeName",
"RangeWithName",0,
"",
kTRUE) ;
785 pc.defineString(
"addCoefRange",
"SumCoefRange",0,
"") ;
786 pc.defineString(
"globstag",
"GlobalObservablesTag",0,
"") ;
787 pc.defineDouble(
"rangeLo",
"Range",0,-999.) ;
788 pc.defineDouble(
"rangeHi",
"Range",1,-999.) ;
789 pc.defineInt(
"splitRange",
"SplitRange",0,0) ;
790 pc.defineInt(
"ext",
"Extended",0,2) ;
791 pc.defineInt(
"numcpu",
"NumCPU",0,1) ;
792 pc.defineInt(
"interleave",
"NumCPU",1,0) ;
793 pc.defineInt(
"verbose",
"Verbose",0,0) ;
794 pc.defineInt(
"optConst",
"Optimize",0,0) ;
795 pc.defineInt(
"cloneData",
"CloneData",2,0) ;
796 pc.defineSet(
"projDepSet",
"ProjectedObservables",0,0) ;
797 pc.defineSet(
"cPars",
"Constrain",0,0) ;
798 pc.defineSet(
"glObs",
"GlobalObservables",0,0) ;
799 pc.defineInt(
"constrAll",
"Constrained",0,0) ;
800 pc.defineInt(
"doOffset",
"OffsetLikelihood",0,0) ;
801 pc.defineSet(
"extCons",
"ExternalConstraints",0,0) ;
802 pc.defineMutex(
"Range",
"RangeWithName") ;
803 pc.defineMutex(
"Constrain",
"Constrained") ;
804 pc.defineMutex(
"GlobalObservables",
"GlobalObservablesTag") ;
807 pc.process(cmdList) ;
813 const char* rangeName =
pc.getString(
"rangeName",0,
kTRUE) ;
814 const char* addCoefRangeName =
pc.getString(
"addCoefRange",0,
kTRUE) ;
815 const char* globsTag =
pc.getString(
"globstag",0,
kTRUE) ;
817 Int_t numcpu =
pc.getInt(
"numcpu") ;
820 Int_t splitr =
pc.getInt(
"splitRange") ;
821 Bool_t verbose =
pc.getInt(
"verbose") ;
822 Int_t optConst =
pc.getInt(
"optConst") ;
823 Int_t cloneData =
pc.getInt(
"cloneData") ;
824 Int_t doOffset =
pc.getInt(
"doOffset") ;
828 cloneData = optConst ;
834 if (
pc.hasProcessed(
"GlobalObservablesTag")) {
835 if (glObs)
delete glObs ;
838 coutI(
Minimization) <<
"User-defined specification of global observables definition with tag named '" << globsTag <<
"'" << endl ;
840 }
else if (!
pc.hasProcessed(
"GlobalObservables")) {
846 coutI(
Minimization) <<
"p.d.f. provides built-in specification of global observables definition with tag named '" << defGlobObsTag <<
"'" << endl ;
847 if (glObs)
delete glObs ;
861 doStripDisconnected=
kTRUE ;
869 coutI(
Minimization) <<
"p.d.f. provides expected number of events, including extended term in likelihood." << endl ;
873 if (
pc.hasProcessed(
"Range")) {
883 if (rrv) rrv->
setRange(
"fit",rangeLo,rangeHi) ;
899 if (!rangeName || strchr(rangeName,
',')==0) {
903 nll =
new RooNLLVar(baseName.c_str(),
"-log(likelihood)",*
this,
data,projDeps,ext,rangeName,addCoefRangeName,numcpu,interl,verbose,splitr,cloneData) ;
908 const size_t bufSize = strlen(rangeName)+1;
909 char* buf =
new char[bufSize] ;
910 strlcpy(buf,rangeName,bufSize) ;
911 char* token = strtok(buf,
",") ;
913 RooAbsReal* nllComp =
new RooNLLVar(
Form(
"%s_%s",baseName.c_str(),token),
"-log(likelihood)",*
this,
data,projDeps,ext,token,addCoefRangeName,numcpu,interl,verbose,splitr,cloneData) ;
914 nllList.
add(*nllComp) ;
915 token = strtok(0,
",") ;
931 <<
" entries" << endl;
932 allConstraints.
add(*constr);
936 if (cPars && cPars->
getSize() > 0) {
938 allConstraints.
add(*constraints);
942 allConstraints.
add(*extCons);
950 <<
" with " << allConstraints.
getSize() <<
" entries" << endl;
958 if (allConstraints.
getSize()>0 && cPars) {
960 coutI(
Minimization) <<
" Including the following contraint terms in minimization: " << allConstraints << endl ;
962 coutI(
Minimization) <<
"The following global observables have been defined: " << *glObs << endl ;
964 nllCons =
new RooConstraintSum(
Form(
"%s_constr",baseName.c_str()),
"nllCons",allConstraints,glObs ? *glObs : *cPars) ;
977 if (doStripDisconnected) {
1109 RooLinkedList nllCmdList =
pc.filterCmdList(fitCmdList,
"ProjectedObservables,Extended,Range,RangeWithName,SumCoefRange,NumCPU,SplitRange,Constrained,Constrain,ExternalConstraints,CloneData,GlobalObservables,GlobalObservablesTag,OffsetLikelihood") ;
1111 pc.defineString(
"fitOpt",
"FitOptions",0,
"") ;
1112 pc.defineInt(
"optConst",
"Optimize",0,2) ;
1113 pc.defineInt(
"verbose",
"Verbose",0,0) ;
1114 pc.defineInt(
"doSave",
"Save",0,0) ;
1115 pc.defineInt(
"doTimer",
"Timer",0,0) ;
1116 pc.defineInt(
"plevel",
"PrintLevel",0,1) ;
1117 pc.defineInt(
"strat",
"Strategy",0,1) ;
1118 pc.defineInt(
"initHesse",
"InitialHesse",0,0) ;
1119 pc.defineInt(
"hesse",
"Hesse",0,1) ;
1120 pc.defineInt(
"minos",
"Minos",0,0) ;
1121 pc.defineInt(
"ext",
"Extended",0,2) ;
1122 pc.defineInt(
"numcpu",
"NumCPU",0,1) ;
1123 pc.defineInt(
"numee",
"PrintEvalErrors",0,10) ;
1124 pc.defineInt(
"doEEWall",
"EvalErrorWall",0,1) ;
1125 pc.defineInt(
"doWarn",
"Warnings",0,1) ;
1126 pc.defineInt(
"doSumW2",
"SumW2Error",0,-1) ;
1127 pc.defineInt(
"doOffset",
"OffsetLikelihood",0,0) ;
1128 pc.defineString(
"mintype",
"Minimizer",0,
"Minuit") ;
1129 pc.defineString(
"minalg",
"Minimizer",1,
"minuit") ;
1130 pc.defineObject(
"minosSet",
"Minos",0,0) ;
1131 pc.defineSet(
"cPars",
"Constrain",0,0) ;
1132 pc.defineSet(
"extCons",
"ExternalConstraints",0,0) ;
1133 pc.defineMutex(
"FitOptions",
"Verbose") ;
1134 pc.defineMutex(
"FitOptions",
"Save") ;
1135 pc.defineMutex(
"FitOptions",
"Timer") ;
1136 pc.defineMutex(
"FitOptions",
"Strategy") ;
1137 pc.defineMutex(
"FitOptions",
"InitialHesse") ;
1138 pc.defineMutex(
"FitOptions",
"Hesse") ;
1139 pc.defineMutex(
"FitOptions",
"Minos") ;
1140 pc.defineMutex(
"Range",
"RangeWithName") ;
1141 pc.defineMutex(
"InitialHesse",
"Minimizer") ;
1144 pc.process(fitCmdList) ;
1150 const char* fitOpt =
pc.getString(
"fitOpt",0,
kTRUE) ;
1151 Int_t optConst =
pc.getInt(
"optConst") ;
1152 Int_t verbose =
pc.getInt(
"verbose") ;
1153 Int_t doSave =
pc.getInt(
"doSave") ;
1154 Int_t doTimer =
pc.getInt(
"doTimer") ;
1155 Int_t plevel =
pc.getInt(
"plevel") ;
1156 Int_t strat =
pc.getInt(
"strat") ;
1157 Int_t initHesse=
pc.getInt(
"initHesse") ;
1158 Int_t hesse =
pc.getInt(
"hesse") ;
1159 Int_t minos =
pc.getInt(
"minos") ;
1160 Int_t numee =
pc.getInt(
"numee") ;
1161 Int_t doEEWall =
pc.getInt(
"doEEWall") ;
1162 Int_t doWarn =
pc.getInt(
"doWarn") ;
1163 Int_t doSumW2 =
pc.getInt(
"doSumW2") ;
1165 #ifdef __ROOFIT_NOROOMINIMIZER 1166 const char* minType =0 ;
1168 const char* minType =
pc.getString(
"mintype",
"Minuit") ;
1169 const char* minAlg =
pc.getString(
"minalg",
"minuit") ;
1173 Bool_t weightedData =
data.isNonPoissonWeighted() ;
1176 if (weightedData && doSumW2==-1) {
1177 coutW(
InputArguments) <<
"RooAbsPdf::fitTo(" <<
GetName() <<
") WARNING: a likelihood fit is request of what appears to be weighted data. " << endl
1178 <<
" While the estimated values of the parameters will always be calculated taking the weights into account, " << endl
1179 <<
" there are multiple ways to estimate the errors on these parameter values. You are advised to make an " << endl
1180 <<
" explicit choice on the error calculation: " << endl
1181 <<
" - Either provide SumW2Error(kTRUE), to calculate a sum-of-weights corrected HESSE error matrix " << endl
1182 <<
" (error will be proportional to the number of events)" << endl
1183 <<
" - Or provide SumW2Error(kFALSE), to return errors from original HESSE error matrix" << endl
1184 <<
" (which will be proportional to the sum of the weights)" << endl
1185 <<
" If you want the errors to reflect the information contained in the provided dataset, choose kTRUE. " << endl
1186 <<
" If you want the errors to reflect the precision you would be able to obtain with an unweighted dataset " << endl
1187 <<
" with 'sum-of-weights' events, choose kFALSE." << endl ;
1192 if (doSumW2==1 && minos) {
1193 coutW(
InputArguments) <<
"RooAbsPdf::fitTo(" <<
GetName() <<
") WARNING: sum-of-weights correction does not apply to MINOS errors" << endl ;
1201 if (
string(minType)!=
"OldMinuit") {
1203 #ifndef __ROOFIT_NOROOMINIMIZER 1206 m.setMinimizerType(minType) ;
1208 m.setEvalErrorWall(doEEWall) ;
1213 m.setPrintEvalErrors(numee) ;
1215 m.setPrintLevel(plevel) ;
1220 m.optimizeConst(optConst) ;
1226 ret =
m.fit(fitOpt) ;
1241 m.setStrategy(strat) ;
1250 m.minimize(minType,minAlg) ;
1257 if (doSumW2==1 &&
m.getNPar()>0) {
1260 vector<RooNLLVar*> nllComponents;
1261 nllComponents.reserve(comps->
getSize());
1266 if (!nllComp)
continue;
1267 nllComponents.push_back(nllComp);
1274 for (vector<RooNLLVar*>::iterator it = nllComponents.begin(); nllComponents.end() != it; ++it) {
1275 (*it)->applyWeightSquared(
kTRUE);
1277 coutI(
Fitting) <<
"RooAbsPdf::fitTo(" <<
GetName() <<
") Calculating sum-of-weights-squared correction matrix for covariance matrix" << endl ;
1280 for (vector<RooNLLVar*>::iterator it = nllComponents.begin(); nllComponents.end() != it; ++it) {
1281 (*it)->applyWeightSquared(
kFALSE);
1288 CholeskyDecompGenDim<Double_t> decomp(matC.
GetNrows(), matC);
1291 <<
") ERROR: Cannot apply sum-of-weights correction to covariance matrix: correction matrix calculated with weight-squared is singular" <<endl ;
1294 decomp.Invert(matC);
1297 for (
int i = 0; i < matC.
GetNrows(); ++i)
1298 for (
int j = 0; j < i; ++j) matC(j, i) = matC(i, j);
1302 m.applyCovarianceMatrix(matC);
1312 m.minos(*minosSet) ;
1321 string title =
Form(
"Result of fit of p.d.f. %s to dataset %s",
GetName(),
data.GetName()) ;
1322 ret =
m.save(
name.c_str(),title.c_str()) ;
1327 m.optimizeConst(0) ;
1336 m.setEvalErrorWall(doEEWall) ;
1341 m.setPrintEvalErrors(numee) ;
1343 m.setPrintLevel(plevel) ;
1348 m.optimizeConst(optConst) ;
1354 ret =
m.fit(fitOpt) ;
1369 m.setStrategy(strat) ;
1385 if (doSumW2==1 &&
m.getNPar()>0) {
1388 list<RooNLLVar*> nllComponents ;
1395 nllComponents.push_back(nllComp) ;
1403 for (list<RooNLLVar*>::iterator iter1=nllComponents.begin() ; iter1!=nllComponents.end() ; iter1++) {
1404 (*iter1)->applyWeightSquared(
kTRUE) ;
1406 coutI(
Fitting) <<
"RooAbsPdf::fitTo(" <<
GetName() <<
") Calculating sum-of-weights-squared correction matrix for covariance matrix" << endl ;
1409 for (list<RooNLLVar*>::iterator iter2=nllComponents.begin() ; iter2!=nllComponents.end() ; iter2++) {
1410 (*iter2)->applyWeightSquared(
kFALSE) ;
1417 CholeskyDecompGenDim<Double_t> decomp(matC.
GetNrows(), matC);
1420 <<
") ERROR: Cannot apply sum-of-weights correction to covariance matrix: correction matrix calculated with weight-squared is singular" <<endl ;
1423 decomp.Invert(matC);
1426 for (
int i = 0; i < matC.
GetNrows(); ++i)
1427 for (
int j = 0; j < i; ++j) matC(j, i) = matC(i, j);
1431 m.applyCovarianceMatrix(matC);
1441 m.minos(*minosSet) ;
1450 string title =
Form(
"Result of fit of p.d.f. %s to dataset %s",
GetName(),
data.GetName()) ;
1451 ret =
m.save(
name.c_str(),title.c_str()) ;
1457 m.optimizeConst(0) ;
1481 RooLinkedList chi2CmdList =
pc.filterCmdList(fitCmdList,
"Range,RangeWithName,NumCPU,Optimize,ProjectedObservables,AddCoefRange,SplitRange,DataError,Extended") ;
1521 pc.defineString(
"rangeName",
"RangeWithName",0,
"",
kTRUE) ;
1523 pc.process(cmdList) ;
1527 const char* rangeName =
pc.getString(
"rangeName",0,
kTRUE) ;
1534 if (!rangeName || strchr(rangeName,
',')==0) {
1537 chi2 =
new RooChi2Var(baseName.c_str(),baseName.c_str(),*
this,
data,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
1543 string rcmd =
"RangeWithName" ;
1544 if (arg1.
GetName()==rcmd) rarg = &arg1 ;
1545 if (arg2.
GetName()==rcmd) rarg = &arg2 ;
1546 if (arg3.
GetName()==rcmd) rarg = &arg3 ;
1547 if (arg4.
GetName()==rcmd) rarg = &arg4 ;
1548 if (arg5.
GetName()==rcmd) rarg = &arg5 ;
1549 if (arg6.
GetName()==rcmd) rarg = &arg6 ;
1550 if (arg7.
GetName()==rcmd) rarg = &arg7 ;
1551 if (arg8.
GetName()==rcmd) rarg = &arg8 ;
1555 const size_t bufSize = strlen(rangeName)+1;
1556 char* buf =
new char[bufSize] ;
1557 strlcpy(buf,rangeName,bufSize) ;
1558 char* token = strtok(buf,
",") ;
1563 &arg1==rarg?subRangeCmd:arg1,&arg2==rarg?subRangeCmd:arg2,
1564 &arg3==rarg?subRangeCmd:arg3,&arg4==rarg?subRangeCmd:arg4,
1565 &arg5==rarg?subRangeCmd:arg5,&arg6==rarg?subRangeCmd:arg6,
1566 &arg7==rarg?subRangeCmd:arg7,&arg8==rarg?subRangeCmd:arg8) ;
1567 chi2List.
add(*chi2Comp) ;
1568 token = strtok(0,
",") ;
1590 pc.defineInt(
"integrate",
"Integrate",0,0) ;
1591 pc.defineObject(
"yvar",
"YVar",0,0) ;
1594 pc.process(cmdList) ;
1600 Bool_t integrate =
pc.getInt(
"integrate") ;
1637 os << indent <<
"--- RooAbsPdf ---" << endl;
1638 os << indent <<
"Cached value = " <<
_value << endl ;
1640 os << indent <<
" Normalization integral: " << endl ;
1641 TString moreIndent(indent) ; moreIndent.Append(
" ") ;
1664 return new RooGenContext(*
this,vars,prototype,auxProto,verbose) ;
1671 Bool_t verbose,
Bool_t autoBinned,
const char* binnedTag)
const 1673 if (prototype || (auxProto && auxProto->
getSize()>0)) {
1674 return genContext(vars,prototype,auxProto,verbose);
1781 pc.defineObject(
"proto",
"PrototypeData",0,0) ;
1782 pc.defineString(
"dsetName",
"Name",0,
"") ;
1783 pc.defineInt(
"randProto",
"PrototypeData",0,0) ;
1784 pc.defineInt(
"resampleProto",
"PrototypeData",1,0) ;
1785 pc.defineInt(
"verbose",
"Verbose",0,0) ;
1786 pc.defineInt(
"extended",
"Extended",0,0) ;
1787 pc.defineInt(
"nEvents",
"NumEvents",0,0) ;
1788 pc.defineInt(
"autoBinned",
"AutoBinned",0,1) ;
1789 pc.defineInt(
"expectedData",
"ExpectedData",0,0) ;
1790 pc.defineDouble(
"nEventsD",
"NumEventsD",0,-1.) ;
1791 pc.defineString(
"binnedTag",
"GenBinned",0,
"") ;
1792 pc.defineMutex(
"GenBinned",
"ProtoData") ;
1795 pc.process(arg1,arg2,arg3,arg4,arg5,arg6) ;
1802 const char* dsetName =
pc.getString(
"dsetName") ;
1803 Bool_t verbose =
pc.getInt(
"verbose") ;
1804 Bool_t randProto =
pc.getInt(
"randProto") ;
1805 Bool_t resampleProto =
pc.getInt(
"resampleProto") ;
1806 Bool_t extended =
pc.getInt(
"extended") ;
1807 Bool_t autoBinned =
pc.getInt(
"autoBinned") ;
1808 const char* binnedTag =
pc.getString(
"binnedTag") ;
1809 Int_t nEventsI =
pc.getInt(
"nEvents") ;
1812 Bool_t expectedData =
pc.getInt(
"expectedData") ;
1828 }
else if (nEvents==0) {
1829 cxcoutI(
Generation) <<
"No number of events specified , number of events generated is " 1833 if (extended && protoData && !randProto) {
1834 cxcoutI(
Generation) <<
"WARNING Using generator option Extended() (Poisson distribution of #events) together " 1835 <<
"with a prototype dataset implies incomplete sampling or oversampling of proto data. " 1836 <<
"Set randomize flag in ProtoData() option to randomize prototype dataset order and thus " 1837 <<
"to randomize the set of over/undersampled prototype events for each generation cycle." << endl ;
1844 data =
generate(whatVars,*protoData,
Int_t(nEvents),verbose,randProto,resampleProto) ;
1846 data =
generate(whatVars,nEvents,verbose,autoBinned,binnedTag,expectedData, extended) ;
1850 if (dsetName && strlen(dsetName)>0) {
1851 data->SetName(dsetName) ;
1913 pc.defineObject(
"proto",
"PrototypeData",0,0) ;
1914 pc.defineString(
"dsetName",
"Name",0,
"") ;
1915 pc.defineInt(
"randProto",
"PrototypeData",0,0) ;
1916 pc.defineInt(
"resampleProto",
"PrototypeData",1,0) ;
1917 pc.defineInt(
"verbose",
"Verbose",0,0) ;
1918 pc.defineInt(
"extended",
"Extended",0,0) ;
1919 pc.defineInt(
"nEvents",
"NumEvents",0,0) ;
1920 pc.defineInt(
"autoBinned",
"AutoBinned",0,1) ;
1921 pc.defineString(
"binnedTag",
"GenBinned",0,
"") ;
1922 pc.defineMutex(
"GenBinned",
"ProtoData") ;
1926 pc.process(arg1,arg2,arg3,arg4,arg5,arg6) ;
1933 const char* dsetName =
pc.getString(
"dsetName") ;
1934 Int_t nEvents =
pc.getInt(
"nEvents") ;
1935 Bool_t verbose =
pc.getInt(
"verbose") ;
1936 Bool_t randProto =
pc.getInt(
"randProto") ;
1937 Bool_t resampleProto =
pc.getInt(
"resampleProto") ;
1938 Bool_t extended =
pc.getInt(
"extended") ;
1939 Bool_t autoBinned =
pc.getInt(
"autoBinned") ;
1940 const char* binnedTag =
pc.getString(
"binnedTag") ;
1944 return new GenSpec(cx,whatVars,protoData,nEvents,extended,randProto,resampleProto,dsetName) ;
1985 return new RooDataSet(
"emptyData",
"emptyData",whatVars) ;
1995 if(0 != context && context->
isValid()) {
2001 if(0 != context)
delete context;
2015 if (nEvents==0 && (prototype==0 || prototype->
numEntries()==0)) {
2016 return new RooDataSet(
"emptyData",
"emptyData",whatVars) ;
2022 if (resampleProto) {
2023 randProtoOrder=
kTRUE ;
2026 if (randProtoOrder && prototype && prototype->
numEntries()!=nEvents) {
2027 coutI(
Generation) <<
"RooAbsPdf::generate (Re)randomizing event order in prototype dataset (Nevt=" << nEvents <<
")" << endl ;
2034 generated= context.
generate(nEvents,skipInit,extended);
2037 coutE(
Generation) <<
"RooAbsPdf::generate(" <<
GetName() <<
") do not have a valid generator context" << endl;
2068 coutE(
Generation) <<
"RooAbsPdf::generate(" <<
GetName() <<
") ERROR creating generator context" << endl ;
2085 for (i=0 ; i<nProto ; i++) {
2093 if (!resampleProto) {
2095 for (i=0 ; i<nProto ; i++) {
2104 for (i=0 ; i<nProto ; i++) {
2168 if(server == &arg)
continue;
2230 pc.defineString(
"dsetName",
"Name",0,
"") ;
2231 pc.defineInt(
"verbose",
"Verbose",0,0) ;
2232 pc.defineInt(
"extended",
"Extended",0,0) ;
2233 pc.defineInt(
"nEvents",
"NumEvents",0,0) ;
2234 pc.defineDouble(
"nEventsD",
"NumEventsD",0,-1.) ;
2235 pc.defineInt(
"expectedData",
"ExpectedData",0,0) ;
2238 pc.process(arg1,arg2,arg3,arg4,arg5,arg6) ;
2244 Double_t nEvents =
pc.getDouble(
"nEventsD") ;
2246 nEvents =
pc.getInt(
"nEvents") ;
2249 Bool_t extended =
pc.getInt(
"extended") ;
2250 Bool_t expectedData =
pc.getInt(
"expectedData") ;
2251 const char* dsetName =
pc.getString(
"dsetName") ;
2256 cxcoutI(
Generation) <<
" Extended mode active, number of events generated (" << nEvents <<
") is Poisson fluctuation on " 2257 <<
GetName() <<
"::expectedEvents() = " << nEvents << endl ;
2262 }
else if (nEvents==0) {
2263 cxcoutI(
Generation) <<
"No number of events specified , number of events generated is " 2271 if (dsetName && strlen(dsetName)>0) {
2272 data->SetName(dsetName) ;
2302 coutE(
InputArguments) <<
"RooAbsPdf::generateBinned(" <<
GetName() <<
") ERROR: No event count provided and p.d.f does not provide expected number of events" << endl ;
2308 if (expectedData || extended) {
2321 Int_t histOutSum(0) ;
2330 }
else if (extended) {
2340 if (hist->
weight()>histMax) {
2341 histMax = hist->
weight() ;
2344 histOutSum += histOut[i] ;
2349 if (!expectedData && !extended) {
2354 Int_t nEvtExtra = abs(
Int_t(nEvents)-histOutSum) ;
2355 Int_t wgt = (histOutSum>nEvents) ? -1 : 1 ;
2358 while(nEvtExtra>0) {
2361 hist->
get(ibinRand) ;
2364 if (ranY<hist->weight()) {
2366 histOut[ibinRand]++ ;
2369 if (histOut[ibinRand]>0) {
2370 histOut[ibinRand]-- ;
2382 hist->
set(histOut[i],
sqrt(1.0*histOut[i])) ;
2385 }
else if (expectedData) {
2408 return generate(whatVars,nEvents) ;
2485 cmdList.
Add(plotRange) ;
2490 cmdList.
Add(normRange2) ;
2493 if (plotRange || normRange2) {
2494 coutI(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") p.d.f was fitted in range and no explicit " 2495 << (plotRange?
"plot":
"") << ((plotRange&&normRange2)?
",":
"")
2496 << (normRange2?
"norm":
"") <<
" range was specified, using fit range as default" << endl ;
2504 pc.defineDouble(
"scaleFactor",
"Normalization",0,1.0) ;
2505 pc.defineInt(
"scaleType",
"Normalization",0,
Relative) ;
2506 pc.defineObject(
"compSet",
"SelectCompSet",0) ;
2507 pc.defineString(
"compSpec",
"SelectCompSpec",0) ;
2508 pc.defineObject(
"asymCat",
"Asymmetry",0) ;
2509 pc.defineDouble(
"rangeLo",
"Range",0,-999.) ;
2510 pc.defineDouble(
"rangeHi",
"Range",1,-999.) ;
2511 pc.defineString(
"rangeName",
"RangeWithName",0,
"") ;
2512 pc.defineString(
"normRangeName",
"NormRange",0,
"") ;
2513 pc.defineInt(
"rangeAdjustNorm",
"Range",0,0) ;
2514 pc.defineInt(
"rangeWNAdjustNorm",
"RangeWithName",0,0) ;
2515 pc.defineMutex(
"SelectCompSet",
"SelectCompSpec") ;
2516 pc.defineMutex(
"Range",
"RangeWithName") ;
2517 pc.allowUndefined() ;
2520 pc.process(cmdList) ;
2527 Double_t scaleFactor =
pc.getDouble(
"scaleFactor") ;
2529 const char* compSpec =
pc.getString(
"compSpec") ;
2531 Bool_t haveCompSel = ( (compSpec && strlen(compSpec)>0) || compSet) ;
2534 TString nameSuffix ;
2535 if (compSpec && strlen(compSpec)>0) {
2536 nameSuffix.Append(
"_Comp[") ;
2537 nameSuffix.Append(compSpec) ;
2538 nameSuffix.Append(
"]") ;
2539 }
else if (compSet) {
2540 nameSuffix.Append(
"_Comp[") ;
2542 nameSuffix.Append(
"]") ;
2546 pc.stripCmdList(cmdList,
"SelectCompSet,SelectCompSpec") ;
2550 RooCmdArg cnsuffix(
"CurveNameSuffix",0,0,0,0,nameSuffix.Data(),0,0,0) ;
2551 cmdList.
Add(&cnsuffix);
2560 <<
"): ERROR the 'Expected' scale option can only be used on extendable PDFs" << endl ;
2572 list<pair<Double_t,Double_t> > rangeLim ;
2575 if (
pc.hasProcessed(
"Range")) {
2579 rangeLim.push_back(make_pair(rangeLo,rangeHi)) ;
2580 adjustNorm =
pc.getInt(
"rangeAdjustNorm") ;
2581 hasCustomRange =
kTRUE ;
2584 << rangeLo <<
"," << rangeHi <<
"]" ;
2585 if (!
pc.hasProcessed(
"NormRange")) {
2586 ccoutI(
Plotting) <<
", curve is normalized to data in " << (adjustNorm?
"given":
"full") <<
" given range" << endl ;
2591 nameSuffix.Append(
Form(
"_Range[%f_%f]",rangeLo,rangeHi)) ;
2593 }
else if (
pc.hasProcessed(
"RangeWithName")) {
2596 strlcpy(tmp,
pc.getString(
"rangeName",0,
kTRUE),1024) ;
2597 char* rangeNameToken = strtok(tmp,
",") ;
2598 while(rangeNameToken) {
2601 rangeLim.push_back(make_pair(rangeLo,rangeHi)) ;
2602 rangeNameToken = strtok(0,
",") ;
2604 adjustNorm =
pc.getInt(
"rangeWNAdjustNorm") ;
2605 hasCustomRange =
kTRUE ;
2608 if (!
pc.hasProcessed(
"NormRange")) {
2609 ccoutI(
Plotting) <<
", curve is normalized to data in " << (adjustNorm?
"given":
"full") <<
" given range" << endl ;
2614 nameSuffix.Append(
Form(
"_Range[%s]",
pc.getString(
"rangeName"))) ;
2617 if (
pc.hasProcessed(
"NormRange")) {
2619 strlcpy(tmp,
pc.getString(
"normRangeName",0,
kTRUE),1024) ;
2620 char* rangeNameToken = strtok(tmp,
",") ;
2622 while(rangeNameToken) {
2625 rangeLim.push_back(make_pair(rangeLo,rangeHi)) ;
2626 rangeNameToken = strtok(0,
",") ;
2628 adjustNorm =
kTRUE ;
2629 hasCustomRange =
kTRUE ;
2630 coutI(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") p.d.f. curve is normalized using explicit choice of ranges '" <<
pc.getString(
"normRangeName",0,
kTRUE) <<
"'" << endl ;
2632 nameSuffix.Append(
Form(
"_NormRange[%s]",
pc.getString(
"rangeName"))) ;
2636 if (hasCustomRange && adjustNorm) {
2639 list<pair<Double_t,Double_t> >::iterator riter = rangeLim.begin() ;
2640 for (;riter!=rangeLim.end() ; ++riter) {
2644 scaleFactor *= rangeNevt/nExpected ;
2650 scaleFactor *= nExpected ;
2652 scaleFactor /= nExpected ;
2674 if (!dynamic_cast<RooAbsReal*>(arg)) {
2675 branchNodeSet.
remove(*arg) ;
2687 if (dirSelNodes->
getSize()>0) {
2688 coutI(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") directly selected PDF components: " << *dirSelNodes << endl ;
2694 coutE(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") ERROR: component selection set " << *compSet <<
" does not match any components of p.d.f." << endl ;
2696 coutE(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") ERROR: component selection expression '" << compSpec <<
"' does not select any components of p.d.f." << endl ;
2701 delete dirSelNodes ;
2705 RooCmdArg cnsuffix(
"CurveNameSuffix",0,0,0,0,nameSuffix.Data(),0,0,0) ;
2706 cmdList.
Add(&cnsuffix);
2749 <<
"): ERROR the 'Expected' scale option can only be used on extendable PDFs" << endl ;
2808 cmdList.
Add(const_cast<RooCmdArg*>(&arg1)) ; cmdList.
Add(const_cast<RooCmdArg*>(&arg2)) ;
2809 cmdList.
Add(const_cast<RooCmdArg*>(&arg3)) ; cmdList.
Add(const_cast<RooCmdArg*>(&arg4)) ;
2810 cmdList.
Add(const_cast<RooCmdArg*>(&arg5)) ; cmdList.
Add(const_cast<RooCmdArg*>(&arg6)) ;
2811 cmdList.
Add(const_cast<RooCmdArg*>(&arg7)) ; cmdList.
Add(const_cast<RooCmdArg*>(&arg8)) ;
2815 pc.defineString(
"label",
"Label",0,
"") ;
2816 pc.defineDouble(
"xmin",
"Layout",0,0.50) ;
2817 pc.defineDouble(
"xmax",
"Layout",1,0.99) ;
2818 pc.defineInt(
"ymaxi",
"Layout",0,
Int_t(0.95*10000)) ;
2819 pc.defineInt(
"showc",
"ShowConstants",0,0) ;
2820 pc.defineObject(
"params",
"Parameters",0,0) ;
2821 pc.defineString(
"formatStr",
"Format",0,
"NELU") ;
2822 pc.defineInt(
"sigDigit",
"Format",0,2) ;
2823 pc.defineInt(
"dummy",
"FormatArgs",0,0) ;
2824 pc.defineMutex(
"Format",
"FormatArgs") ;
2827 pc.process(cmdList) ;
2832 const char* label =
pc.getString(
"label") ;
2836 Int_t showc =
pc.getInt(
"showc") ;
2839 const char* formatStr =
pc.getString(
"formatStr") ;
2840 Int_t sigDigit =
pc.getInt(
"sigDigit") ;
2846 if (
pc.hasProcessed(
"FormatArgs")) {
2856 if (
pc.hasProcessed(
"FormatArgs")) {
2880 TString opts(options) ;
2902 TString opts = options;
2904 Bool_t showLabel= (label != 0 && strlen(label) > 0);
2915 if(showLabel)
ymin-= dy;
2921 box->SetFillColor(0);
2922 box->SetBorderSize(1);
2923 box->SetTextAlign(12);
2924 box->SetTextSize(0.04
F);
2925 box->SetFillStyle(1001);
2926 box->SetFillColor(0);
2930 if(var->
isConstant() && !showConstants)
continue;
2932 TString *formatted= options ? var->
format(sigDigits, options) : var->
format(*formatCmd) ;
2933 box->AddText(formatted->Data());
2937 if(showLabel)
box->AddText(label);
3000 pdfOwner->
_norm = 0 ;
3016 name.Append(
"_Proj[") ;
3079 pc.defineObject(
"supNormSet",
"SupNormSet",0,0) ;
3080 pc.defineInt(
"numScanBins",
"ScanParameters",0,1000) ;
3081 pc.defineInt(
"intOrder",
"ScanParameters",1,2) ;
3082 pc.defineInt(
"doScanNum",
"ScanNumCdf",0,1) ;
3083 pc.defineInt(
"doScanAll",
"ScanAllCdf",0,0) ;
3084 pc.defineInt(
"doScanNon",
"ScanNoCdf",0,0) ;
3085 pc.defineMutex(
"ScanNumCdf",
"ScanAllCdf",
"ScanNoCdf") ;
3088 pc.process(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
3099 Int_t numScanBins =
pc.getInt(
"numScanBins") ;
3100 Int_t intOrder =
pc.getInt(
"intOrder") ;
3101 Int_t doScanNum =
pc.getInt(
"doScanNum") ;
3102 Int_t doScanAll =
pc.getInt(
"doScanAll") ;
3103 Int_t doScanNon =
pc.getInt(
"doScanNon") ;
3118 coutI(
NumIntegration) <<
"RooAbsPdf::createCdf(" <<
GetName() <<
") integration over observable(s) " << iset <<
" involves numeric integration," << endl
3119 <<
" constructing cdf though numeric integration of sampled pdf in " << numScanBins <<
" bins and applying order " 3120 << intOrder <<
" interpolation on integrated histogram." << endl
3121 <<
" To override this choice of technique use argument ScanNone(), to change scan parameters use ScanParameters(nbins,order) argument" << endl ;
3133 ivar->
setBins(numScanBins,
"numcdf") ;
3244 if (config)
return config ;
3282 delete _genContext ;
3290 _genContext(context), _whatVars(whatVars), _protoData(protoData), _nGen(nGen), _extended(extended),
3291 _randProto(randProto), _resampleProto(resampleProto), _dsetName(dsetName), _init(
init)
virtual RooAbsReal * createNLL(RooAbsData &data, const RooLinkedList &cmdList)
Construct representation of -log(L) of PDFwith given dataset.
virtual Double_t getMin(const char *name=0) const
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
void operModeHook(RooAbsArg::OperMode)
Dummy implementation.
virtual const char * GetName() const
Returns name of object.
void setInterpolationOrder(Int_t order)
Set interpolation order of RooHistFunct representing cache histogram.
TIterator * createIterator(Bool_t dir=kIterForward) const
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.
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 RooFitResult * chi2FitTo(RooDataHist &data, const RooLinkedList &cmdList)
Internal back-end function to steer chi2 fits.
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
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.
void setTraceCounter(Int_t value, Bool_t allNodes=kFALSE)
Reset trace counter to given value, limiting the number of future trace messages for this pdf to 'val...
void plotOnCompSelect(RooArgSet *selNodes) const
Helper function for plotting of composite p.d.fs.
virtual RooAbsReal * createChi2(RooDataHist &data, 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())
Create a chi-2 from a histogram and this function.
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
virtual RooDataHist * generateBinned(const RooArgSet &whatVars, Double_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none())
Generate a new dataset containing the specified variables with events sampled from our distribution...
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...
void addObject(TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a generic object to this plot.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print multi line detailed information of this RooAbsPdf.
Class RooNumCdf is an implementation of RooNumRunningInt specialized to calculate cumulative distribu...
Double_t getVal(const RooArgSet *set=0) const
virtual ~RooAbsPdf()
Destructor.
virtual Bool_t selfNormalized() const
void setGeneratorConfig()
Remove the specialized numeric MC generator configuration associated with this object.
const TMatrixDSym & covarianceMatrix() const
Return covariance matrix.
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
TString _normRange
MC generator configuration specific for this object.
Normalization set with for above integral.
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...
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
void setNormRange(const char *rangeName)
void setNameList(const char *givenList)
RooCmdArg NumEvents(Int_t numEvents)
void updateNormVars(const RooArgSet &vars)
Install the given set of observables are reference normalization variables for this frame...
static UInt_t integer(UInt_t max, TRandom *generator=randomGenerator())
Return an integer uniformly distributed from [0,n-1].
Int_t * randomizeProtoOrder(Int_t nProto, Int_t nGen, Bool_t resample=kFALSE) const
Return lookup table with randomized access order for prototype events, given nProto prototype data ev...
virtual Double_t getLogVal(const RooArgSet *set=0) const
Return the log of the current value with given normalization An error message is printed if the argum...
RooInt is a minimal implementation of a TObject holding a Int_t value.
RooNumGenConfig * _specGeneratorConfig
friend class RooProjectedPdf
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
GenSpec * prepareMultiGen(const RooArgSet &whatVars, 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())
Prepare GenSpec configuration object for efficient generation of multiple datasets from idetical spec...
void setProxyNormSet(const RooArgSet *nset)
Forward a change in the cached normalization argset to all the registered proxies.
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
virtual RooPlot * plotOn(RooPlot *frame, 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 RooCmdArg &arg9=RooCmdArg::none(), const RooCmdArg &arg10=RooCmdArg::none()) const
Plot (project) PDF on specified frame.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
RooCmdArg SupNormSet(const RooArgSet &nset)
static TString _normRangeOverride
static int verboseEval()
Return global level of verbosity for p.d.f. evaluations.
Iterator abstract base class.
header file containing the templated implementation of matrix inversion routines for use with ROOT's ...
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Analytical integral with normalization (see RooAbsReal::analyticalIntegralWN() for further informatio...
Double_t getFitRangeBinW() const
RooAbsArg * findServer(const char *name) const
RooAbsGenContext * _genContext
RooAbsReal * createCdf(const RooArgSet &iset, const RooArgSet &nset=RooArgSet())
Create a cumulative distribution function of this p.d.f in terms of the observables listed in iset...
RooAbsReal * createScanCdf(const RooArgSet &iset, const RooArgSet &nset, Int_t numScanBins, Int_t intOrder)
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.
RooAbsReal * createIntRI(const RooArgSet &iset, const RooArgSet &nset=RooArgSet())
Utility function for createRunningIntegral that construct an object implementing the standard (analyt...
RooCmdArg Range(const char *rangeName, Bool_t adjustNorm=kTRUE)
Bool_t traceEvalPdf(Double_t value) const
Check that passed value is positive and not 'not-a-number'.
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
void clearValueAndShapeDirty() const
RooDataSet is a container class to hold N-dimensional binned data.
RooRealIntegral performs hybrid numerical/analytical integrals of RooAbsReal objects The class perfor...
RooAbsPdf()
Default constructor.
The TNamed class is the base class for all named ROOT classes.
RooNumGenConfig * specialGeneratorConfig() const
Returns the specialized integrator configuration for this RooAbsReal.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
RooConstraintSum calculates the sum of the -(log) likelihoods of a set of RooAbsPfs that represent co...
virtual RooArgSet * getConstraints(const RooArgSet &, RooArgSet &, Bool_t) const
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
virtual UInt_t Integer(UInt_t imax)
Returns a random integer on [ 0, imax-1 ].
RooAbsCollection * selectByAttrib(const char *name, Bool_t value) const
Create a subset of the current collection, consisting only of those elements with the specified attri...
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
virtual Double_t weight() const
const RooArgSet * getNormVars() const
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
void setBins(Int_t nBins, const char *name=0)
virtual RooAbsPdf * createProjection(const RooArgSet &iset)
Return a p.d.f that represent a projection of this p.d.f integrated over given observables.
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return expected number of events from this p.d.f for use in extended likelihood calculations.
virtual RooAbsGenContext * binnedGenContext(const RooArgSet &vars, Bool_t verbose=kFALSE) const
Return a binned generator context.
static void clearEvalError()
Clear the evaluation error flag.
virtual Bool_t syncNormalization(const RooArgSet *dset, Bool_t adjustProxies=kTRUE) const
Verify that the normalization integral cached with this PDF is valid for given set of normalization o...
virtual void enableOffsetting(Bool_t)
RooRealVar represents a fundamental (non-derived) real valued object.
const RooArgSet & numIntRealVars() const
virtual Double_t getValV(const RooArgSet *set=0) const
Return current value, normalizated by integrating over the observables in 'nset'. ...
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
virtual void Add(TObject *arg)
RooNameSet is a utility class that stores the names the objects in a RooArget.
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 listed in ...
Class RooNLLVar implements a a -log(likelihood) calculation from a dataset and a PDF.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
virtual void setExpectedData(Bool_t)
static RooNumGenConfig & defaultConfig()
Return reference to instance of default numeric integrator configuration object.
std::string contentsString() const
Return comma separated list of contained object names as STL string.
static Int_t _verboseEval
RooAbsArg * first() const
void logEvalError(const char *message, const char *serverValueString=0) const
Log evaluation error message.
void setNormRangeOverride(const char *rangeName)
virtual void generateEvent(Int_t code)
Interface for generation of anan event using the algorithm corresponding to the specified code...
RooObjCacheManager _normMgr
RooArgSet * getComponents() const
void branchNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=0, Bool_t recurseNonDerived=kFALSE) const
Fill supplied list with all branch nodes of the arg tree starting with ourself as top node...
static void raiseEvalError()
Raise the evaluation error flag.
RooWorkspace * _myws
Prevent 'AlwaysDirty' mode for this node.
const Text_t * getStringAttribute(const Text_t *key) const
Get string attribute mapped under key 'key'.
char * Form(const char *fmt,...)
RooCachedReal is an implementation of RooAbsCachedReal that can cache any external RooAbsReal input f...
Double_t getNorm(const RooArgSet &nset) const
TString * format(const RooCmdArg &formatArg) const
Format contents of RooRealVar for pretty printing on RooPlot parameter boxes.
OperMode operMode() const
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual void resetErrorCounters(Int_t resetValue=10)
Reset error counter to given value, limiting the number of future error messages for this pdf to 'res...
RooDataSet is a container class to hold unbinned data.
virtual RooAbsGenContext * autoGenContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE, Bool_t autoBinned=kTRUE, const char *binnedTag="") const
Bool_t canBeExtended() const
TIterator * serverIterator() const
class to compute the Cholesky decomposition of a matrix
Class RooGenContext implement a universal generator context for all RooAbsPdf classes that do not hav...
virtual const RooAbsReal * getNormObj(const RooArgSet *set, const RooArgSet *iset, const TNamed *rangeName=0) const
Return pointer to RooAbsReal object that implements calculation of integral over observables iset in ...
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
virtual Bool_t isDirectGenSafe(const RooAbsArg &arg) const
Check if given observable can be safely generated using the pdfs internal generator mechanism (if tha...
const RooNumGenConfig * getGeneratorConfig() const
Return the numeric MC generator configuration used for this object.
virtual ExtendMode extendMode() const
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
virtual Double_t sumEntries() const
void setInt(Int_t idx, Int_t value)
Bool_t defineSetInternal(const char *name, const RooArgSet &aset)
A Pave (see TPave) with text, lines or/and boxes inside.
TString integralNameSuffix(const RooArgSet &iset, const RooArgSet *nset=0, const char *rangeName=0, Bool_t omitEmpty=kFALSE) const
Construct string with unique suffix name to give to integral object that encodes integrated observabl...
RooAbsArg * find(const char *name) const
Find object with given name in list.
virtual Int_t numEntries() const
Return the number of bins.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const
Load generatedVars with the subset of directVars that we can generate events for, and return a code t...
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE) const
Interface function to create a generator context from a p.d.f.
static RooNumGenConfig * defaultGeneratorConfig()
Returns the default numeric MC generator configuration for all RooAbsReals.
virtual Bool_t traceEvalHook(Double_t value) const
WVE 08/21/01 Probably obsolete now.
RooCmdArg Normalization(Double_t scaleFactor)
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of prototype data to that in the lookup tables passed as argument.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
TMatrixTSym< Element > & Similarity(const TMatrixT< Element > &n)
Calculate B * (*this) * B^T , final matrix will be (nrowsb x nrowsb) This is a similarity transform w...
RooCmdArg NormRange(const char *rangeNameList)
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
RooArgSet * select(const RooArgSet &list) const
Construct a RooArgSet of objects in input 'list' whose names match to those in the internal name list...
virtual RooDataSet * generate(Double_t nEvents=0, Bool_t skipInit=kFALSE, Bool_t extendedMode=kFALSE)
Generate the specified number of events with nEvents>0 and and return a dataset containing the genera...
Bool_t isValueDirty() const
void setRange(const char *name, Double_t min, Double_t max)
Set range named 'name to [min,max].
Mother of all ROOT objects.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
virtual RooPlot * paramOn(RooPlot *frame, 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())
Add a box with parameter values (and errors) to the specified frame.
virtual void printValue(std::ostream &os) const
Print value of p.d.f, also print normalization integral that was last used, if any.
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral. ...
RooFitResult * chi2FitDriver(RooAbsReal &fcn, RooLinkedList &cmdList)
Internal driver function for chi2 fits.
RooAbsRealLValue * getPlotVar() const
const RooNumIntConfig * getIntegratorConfig() const
Return the numeric integration configuration used for this object.
RooMinimizer is a wrapper class around ROOT::Fit:Fitter that provides a seamless interface between th...
virtual void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTrackingOpt=kTRUE)
Interface function signaling a request to perform constant term optimization.
RooDataSet * generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none())
Generate a new dataset containing the specified variables with events sampled from our distribution...
static Bool_t evalError()
Return the evaluation error flag.
virtual void initGenerator(Int_t code)
Interface for one-time initialization to setup the generator for the specified code.
virtual TObject * Next()=0
virtual RooArgSet * getAllConstraints(const RooArgSet &observables, RooArgSet &constrainedParams, Bool_t stripDisconnected=kTRUE) const
This helper function finds and collects all constraints terms of all coponent p.d.f.s and returns a RooArgSet with all those terms.
const RooArgSet * set(const char *name)
Return pointer to previously defined named set with given nmame If no such set is found a null pointe...
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
Double_t getFitRangeNEvt() const
virtual RooFitResult * fitTo(RooAbsData &data, 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())
Fit PDF to given dataset.
static constexpr double pc
RooNumGenConfig holds the configuration parameters of the various numeric integrators used by RooReal...
RooAbsCollection * selectByName(const char *nameList, Bool_t verbose=kFALSE) const
Create a subset of the current collection, consisting only of those elements with names matching the ...
RooArgSet * _normSet
Normalization integral (owned by _normMgr)
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
RooAddition calculates the sum of a set of RooAbsReal terms, or when constructed with two sets...
virtual Int_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual const char * GetName() const
Returns name of object.
virtual ~CacheElem()
Destructor of normalization cache element.
virtual RooDataSet * generateSimGlobal(const RooArgSet &whatVars, Int_t nEvents)
Special generator interface for generation of 'global observables' – for RooStats tools...
Bool_t plotSanityChecks(RooPlot *frame) const
Utility function for plotOn(), perform general sanity check on frame to ensure safe plotting operatio...
virtual Double_t extendedTerm(Double_t observedEvents, const RooArgSet *nset=0) const
Returned the extended likelihood term (Nexpect - Nobserved*log(NExpected) of this PDF for the given n...
Bool_t isConstant() const
virtual Int_t numEntries() const
virtual const char * GetTitle() const
Returns title of object.
RooMinuit is a wrapper class around TFitter/TMinuit that provides a seamless interface between the MI...
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
RooBinnedGenContext is an efficient implementation of the generator context specific for binned pdfs...