206 RooAbsReal(
name,title), _norm(0), _normSet(0), _normMgr(this,10), _selectComp(
kTRUE), _specGeneratorConfig(0)
219 RooAbsReal(
name,title,plotMin,plotMax), _norm(0), _normSet(0), _normMgr(this,10), _selectComp(
kTRUE), _specGeneratorConfig(0)
232 _normMgr(other._normMgr,this), _selectComp(other._selectComp), _normRange(other._normRange)
306 if (normVal < 0. || (normVal == 0. && rawVal != 0)) {
309 std::stringstream msg;
310 msg <<
"p.d.f normalization integral is zero or negative: " << normVal;
315 if (error || (rawVal == 0. && normVal == 0.)) {
318 _value = rawVal / normVal ;
338 cxcoutD(
Eval) <<
"RooAbsPdf::analyticalIntegralWN(" <<
GetName() <<
") code = " << code <<
" normset = " << (normSet?*normSet:
RooArgSet()) << endl ;
341 if (code==0)
return getVal(normSet) ;
361 logEvalError(
Form(
"p.d.f value is Not-a-Number (%f), forcing value to zero",value)) ;
365 logEvalError(
Form(
"p.d.f value is less than zero (%f), forcing value to zero",value)) ;
370 if(!error)
return error ;
393 if (!nset)
return 1 ;
401 coutW(
Eval) <<
"RooAbsPdf::getNorm(" <<
GetName() <<
":: WARNING normalization is zero, nset = " ; nset->
Print(
"1") ;
421 return cache->
_norm ;
467 if (nsetChanged && adjustProxies) {
477 ((
RooAbsPdf*)
this)->setProxyNormSet(nset) ;
485 <<
") recreating normalization integral " << endl ;
488 cxcoutD(
Tracing) << IsA()->GetName() <<
"::syncNormalization(" <<
GetName() <<
") selfNormalized, creating unit norm" << endl;
506 if (cacheParamsStr && strlen(cacheParamsStr)) {
514 if (cacheParams->
getSize()>0) {
516 <<
"-dim value cache for integral over " << *depList <<
" as a function of " << *cacheParams <<
" in range " << (nr?nr:
"<default>") << endl ;
525 normInt= cachedIntegral ;
625 if (
fabs(prob)>1e6) {
626 coutW(
Eval) <<
"RooAbsPdf::getLogVal(" <<
GetName() <<
") WARNING: large likelihood value: " << prob << endl ;
631 logEvalError(
"getLogVal() top-level p.d.f evaluates to a negative number") ;
637 logEvalError(
"getLogVal() top-level p.d.f evaluates to zero") ;
639 return log((
double)0);
643 logEvalError(
"getLogVal() top-level p.d.f evaluates to NaN") ;
645 return log((
double)0);
679 if (
fabs(expected)<1
e-10 &&
fabs(observed)<1
e-10) {
685 logEvalError(
"extendedTerm #expected events is <0 or NaN") ;
716 << observed <<
" events. extendedTerm = " << extra << endl;
806 pc.defineString(
"rangeName",
"RangeWithName",0,
"",
kTRUE) ;
807 pc.defineString(
"addCoefRange",
"SumCoefRange",0,
"") ;
808 pc.defineString(
"globstag",
"GlobalObservablesTag",0,
"") ;
809 pc.defineDouble(
"rangeLo",
"Range",0,-999.) ;
810 pc.defineDouble(
"rangeHi",
"Range",1,-999.) ;
811 pc.defineInt(
"splitRange",
"SplitRange",0,0) ;
812 pc.defineInt(
"ext",
"Extended",0,2) ;
813 pc.defineInt(
"numcpu",
"NumCPU",0,1) ;
814 pc.defineInt(
"interleave",
"NumCPU",1,0) ;
815 pc.defineInt(
"verbose",
"Verbose",0,0) ;
816 pc.defineInt(
"optConst",
"Optimize",0,0) ;
817 pc.defineInt(
"cloneData",
"CloneData",2,0) ;
818 pc.defineSet(
"projDepSet",
"ProjectedObservables",0,0) ;
819 pc.defineSet(
"cPars",
"Constrain",0,0) ;
820 pc.defineSet(
"glObs",
"GlobalObservables",0,0) ;
821 pc.defineInt(
"constrAll",
"Constrained",0,0) ;
822 pc.defineInt(
"doOffset",
"OffsetLikelihood",0,0) ;
823 pc.defineSet(
"extCons",
"ExternalConstraints",0,0) ;
824 pc.defineMutex(
"Range",
"RangeWithName") ;
825 pc.defineMutex(
"Constrain",
"Constrained") ;
826 pc.defineMutex(
"GlobalObservables",
"GlobalObservablesTag") ;
829 pc.process(cmdList) ;
835 const char* rangeName =
pc.getString(
"rangeName",0,
kTRUE) ;
836 const char* addCoefRangeName =
pc.getString(
"addCoefRange",0,
kTRUE) ;
837 const char* globsTag =
pc.getString(
"globstag",0,
kTRUE) ;
839 Int_t numcpu =
pc.getInt(
"numcpu") ;
842 Int_t splitr =
pc.getInt(
"splitRange") ;
844 Int_t optConst =
pc.getInt(
"optConst") ;
845 Int_t cloneData =
pc.getInt(
"cloneData") ;
846 Int_t doOffset =
pc.getInt(
"doOffset") ;
850 cloneData = optConst ;
856 if (
pc.hasProcessed(
"GlobalObservablesTag")) {
857 if (glObs)
delete glObs ;
860 coutI(
Minimization) <<
"User-defined specification of global observables definition with tag named '" << globsTag <<
"'" << endl ;
862 }
else if (!
pc.hasProcessed(
"GlobalObservables")) {
868 coutI(
Minimization) <<
"p.d.f. provides built-in specification of global observables definition with tag named '" << defGlobObsTag <<
"'" << endl ;
869 if (glObs)
delete glObs ;
883 doStripDisconnected=
kTRUE ;
891 coutI(
Minimization) <<
"p.d.f. provides expected number of events, including extended term in likelihood." << endl ;
895 if (
pc.hasProcessed(
"Range")) {
905 if (rrv) rrv->
setRange(
"fit",rangeLo,rangeHi) ;
921 if (!rangeName || strchr(rangeName,
',')==0) {
925 nll =
new RooNLLVar(baseName.c_str(),
"-log(likelihood)",*
this,data,projDeps,ext,rangeName,addCoefRangeName,numcpu,interl,
verbose,splitr,cloneData) ;
930 const size_t bufSize = strlen(rangeName)+1;
931 char* buf =
new char[bufSize] ;
932 strlcpy(buf,rangeName,bufSize) ;
933 char* token = strtok(buf,
",") ;
935 RooAbsReal* nllComp =
new RooNLLVar(
Form(
"%s_%s",baseName.c_str(),token),
"-log(likelihood)",*
this,data,projDeps,ext,token,addCoefRangeName,numcpu,interl,
verbose,splitr,cloneData) ;
936 nllList.
add(*nllComp) ;
937 token = strtok(0,
",") ;
953 <<
" entries" << endl;
954 allConstraints.
add(*constr);
958 if (cPars && cPars->
getSize() > 0) {
960 allConstraints.
add(*constraints);
964 allConstraints.
add(*extCons);
972 <<
" with " << allConstraints.
getSize() <<
" entries" << endl;
980 if (allConstraints.
getSize()>0 && cPars) {
982 coutI(
Minimization) <<
" Including the following contraint terms in minimization: " << allConstraints << endl ;
984 coutI(
Minimization) <<
"The following global observables have been defined: " << *glObs << endl ;
986 nllCons =
new RooConstraintSum(
Form(
"%s_constr",baseName.c_str()),
"nllCons",allConstraints,glObs ? *glObs : *cPars) ;
999 if (doStripDisconnected) {
1148 RooLinkedList nllCmdList =
pc.filterCmdList(fitCmdList,
"ProjectedObservables,Extended,Range,RangeWithName,SumCoefRange,NumCPU,SplitRange,Constrained,Constrain,ExternalConstraints,CloneData,GlobalObservables,GlobalObservablesTag,OffsetLikelihood") ;
1150 pc.defineString(
"fitOpt",
"FitOptions",0,
"") ;
1151 pc.defineInt(
"optConst",
"Optimize",0,2) ;
1152 pc.defineInt(
"verbose",
"Verbose",0,0) ;
1153 pc.defineInt(
"doSave",
"Save",0,0) ;
1154 pc.defineInt(
"doTimer",
"Timer",0,0) ;
1155 pc.defineInt(
"plevel",
"PrintLevel",0,1) ;
1156 pc.defineInt(
"strat",
"Strategy",0,1) ;
1157 pc.defineInt(
"initHesse",
"InitialHesse",0,0) ;
1158 pc.defineInt(
"hesse",
"Hesse",0,1) ;
1159 pc.defineInt(
"minos",
"Minos",0,0) ;
1160 pc.defineInt(
"ext",
"Extended",0,2) ;
1161 pc.defineInt(
"numcpu",
"NumCPU",0,1) ;
1162 pc.defineInt(
"numee",
"PrintEvalErrors",0,10) ;
1163 pc.defineInt(
"doEEWall",
"EvalErrorWall",0,1) ;
1164 pc.defineInt(
"doWarn",
"Warnings",0,1) ;
1165 pc.defineInt(
"doSumW2",
"SumW2Error",0,-1) ;
1166 pc.defineInt(
"doOffset",
"OffsetLikelihood",0,0) ;
1167 pc.defineString(
"mintype",
"Minimizer",0,
"Minuit") ;
1168 pc.defineString(
"minalg",
"Minimizer",1,
"minuit") ;
1169 pc.defineObject(
"minosSet",
"Minos",0,0) ;
1170 pc.defineSet(
"cPars",
"Constrain",0,0) ;
1171 pc.defineSet(
"extCons",
"ExternalConstraints",0,0) ;
1172 pc.defineMutex(
"FitOptions",
"Verbose") ;
1173 pc.defineMutex(
"FitOptions",
"Save") ;
1174 pc.defineMutex(
"FitOptions",
"Timer") ;
1175 pc.defineMutex(
"FitOptions",
"Strategy") ;
1176 pc.defineMutex(
"FitOptions",
"InitialHesse") ;
1177 pc.defineMutex(
"FitOptions",
"Hesse") ;
1178 pc.defineMutex(
"FitOptions",
"Minos") ;
1179 pc.defineMutex(
"Range",
"RangeWithName") ;
1180 pc.defineMutex(
"InitialHesse",
"Minimizer") ;
1183 pc.process(fitCmdList) ;
1189 const char* fitOpt =
pc.getString(
"fitOpt",0,
kTRUE) ;
1190 Int_t optConst =
pc.getInt(
"optConst") ;
1192 Int_t doSave =
pc.getInt(
"doSave") ;
1193 Int_t doTimer =
pc.getInt(
"doTimer") ;
1194 Int_t plevel =
pc.getInt(
"plevel") ;
1195 Int_t strat =
pc.getInt(
"strat") ;
1196 Int_t initHesse=
pc.getInt(
"initHesse") ;
1197 Int_t hesse =
pc.getInt(
"hesse") ;
1198 Int_t minos =
pc.getInt(
"minos") ;
1199 Int_t numee =
pc.getInt(
"numee") ;
1200 Int_t doEEWall =
pc.getInt(
"doEEWall") ;
1201 Int_t doWarn =
pc.getInt(
"doWarn") ;
1202 Int_t doSumW2 =
pc.getInt(
"doSumW2") ;
1204#ifdef __ROOFIT_NOROOMINIMIZER
1205 const char* minType =0 ;
1207 const char* minType =
pc.getString(
"mintype",
"Minuit") ;
1208 const char* minAlg =
pc.getString(
"minalg",
"minuit") ;
1215 if (weightedData && doSumW2==-1) {
1216 coutW(
InputArguments) <<
"RooAbsPdf::fitTo(" <<
GetName() <<
") WARNING: a likelihood fit is requested of what appears to be weighted data.\n"
1217 <<
" While the estimated values of the parameters will always be calculated taking the weights into account,\n"
1218 <<
" there are multiple ways to estimate the errors of the parameters. You are advised to make an'n"
1219 <<
" explicit choice for the error calculation:\n"
1220 <<
" - Either provide SumW2Error(true), to calculate a sum-of-weights-corrected HESSE error matrix\n"
1221 <<
" (error will be proportional to the number of events in MC).\n"
1222 <<
" - Or provide SumW2Error(false), to return errors from original HESSE error matrix\n"
1223 <<
" (which will be proportional to the sum of the weights, i.e., a dataset with <sum of weights> events).\n"
1224 <<
" If you want the errors to reflect the information contained in the provided simulation, choose true.\n"
1225 <<
" If you want the errors to reflect the precision you would be able to obtain with an unweighted dataset\n"
1226 <<
" with <sum of weights> events, choose false." << endl ;
1231 if (doSumW2==1 && minos) {
1232 coutW(
InputArguments) <<
"RooAbsPdf::fitTo(" <<
GetName() <<
") WARNING: sum-of-weights correction does not apply to MINOS errors" << endl ;
1240 if (
string(minType)!=
"OldMinuit") {
1242#ifndef __ROOFIT_NOROOMINIMIZER
1245 m.setMinimizerType(minType) ;
1247 m.setEvalErrorWall(doEEWall) ;
1252 m.setPrintEvalErrors(numee) ;
1254 m.setPrintLevel(plevel) ;
1259 m.optimizeConst(optConst) ;
1265 ret =
m.fit(fitOpt) ;
1280 m.setStrategy(strat) ;
1289 m.minimize(minType,minAlg) ;
1296 if (doSumW2==1 &&
m.getNPar()>0) {
1299 vector<RooNLLVar*> nllComponents;
1305 if (!nllComp)
continue;
1306 nllComponents.push_back(nllComp);
1313 for (vector<RooNLLVar*>::iterator it = nllComponents.begin(); nllComponents.end() != it; ++it) {
1314 (*it)->applyWeightSquared(
kTRUE);
1316 coutI(
Fitting) <<
"RooAbsPdf::fitTo(" <<
GetName() <<
") Calculating sum-of-weights-squared correction matrix for covariance matrix" << endl ;
1319 for (vector<RooNLLVar*>::iterator it = nllComponents.begin(); nllComponents.end() != it; ++it) {
1320 (*it)->applyWeightSquared(
kFALSE);
1327 CholeskyDecompGenDim<Double_t> decomp(matC.
GetNrows(), matC);
1330 <<
") ERROR: Cannot apply sum-of-weights correction to covariance matrix: correction matrix calculated with weight-squared is singular" <<endl ;
1333 decomp.Invert(matC);
1336 for (
int i = 0; i < matC.
GetNrows(); ++i)
1337 for (
int j = 0; j < i; ++j) matC(j, i) = matC(i, j);
1341 m.applyCovarianceMatrix(matC);
1351 m.minos(*minosSet) ;
1360 string title =
Form(
"Result of fit of p.d.f. %s to dataset %s",
GetName(),data.
GetName()) ;
1361 ret =
m.save(
name.c_str(),title.c_str()) ;
1366 m.optimizeConst(0) ;
1375 m.setEvalErrorWall(doEEWall) ;
1380 m.setPrintEvalErrors(numee) ;
1382 m.setPrintLevel(plevel) ;
1387 m.optimizeConst(optConst) ;
1393 ret =
m.fit(fitOpt) ;
1408 m.setStrategy(strat) ;
1424 if (doSumW2==1 &&
m.getNPar()>0) {
1427 list<RooNLLVar*> nllComponents ;
1434 nllComponents.push_back(nllComp) ;
1442 for (list<RooNLLVar*>::iterator iter1=nllComponents.begin() ; iter1!=nllComponents.end() ; ++iter1) {
1443 (*iter1)->applyWeightSquared(
kTRUE) ;
1445 coutI(
Fitting) <<
"RooAbsPdf::fitTo(" <<
GetName() <<
") Calculating sum-of-weights-squared correction matrix for covariance matrix" << endl ;
1448 for (list<RooNLLVar*>::iterator iter2=nllComponents.begin() ; iter2!=nllComponents.end() ; ++iter2) {
1449 (*iter2)->applyWeightSquared(
kFALSE) ;
1456 CholeskyDecompGenDim<Double_t> decomp(matC.
GetNrows(), matC);
1459 <<
") ERROR: Cannot apply sum-of-weights correction to covariance matrix: correction matrix calculated with weight-squared is singular" <<endl ;
1462 decomp.Invert(matC);
1465 for (
int i = 0; i < matC.
GetNrows(); ++i)
1466 for (
int j = 0; j < i; ++j) matC(j, i) = matC(i, j);
1470 m.applyCovarianceMatrix(matC);
1480 m.minos(*minosSet) ;
1489 string title =
Form(
"Result of fit of p.d.f. %s to dataset %s",
GetName(),data.
GetName()) ;
1490 ret =
m.save(
name.c_str(),title.c_str()) ;
1496 m.optimizeConst(0) ;
1520 RooLinkedList chi2CmdList =
pc.filterCmdList(fitCmdList,
"Range,RangeWithName,NumCPU,Optimize,ProjectedObservables,AddCoefRange,SplitRange,DataError,Extended") ;
1569 pc.defineString(
"rangeName",
"RangeWithName",0,
"",
kTRUE) ;
1571 pc.process(cmdList) ;
1575 const char* rangeName =
pc.getString(
"rangeName",0,
kTRUE) ;
1582 if (!rangeName || strchr(rangeName,
',')==0) {
1585 chi2 =
new RooChi2Var(baseName.c_str(),baseName.c_str(),*
this,data,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
1591 string rcmd =
"RangeWithName" ;
1592 if (arg1.
GetName()==rcmd) rarg = &arg1 ;
1593 if (arg2.
GetName()==rcmd) rarg = &arg2 ;
1594 if (arg3.
GetName()==rcmd) rarg = &arg3 ;
1595 if (arg4.
GetName()==rcmd) rarg = &arg4 ;
1596 if (arg5.
GetName()==rcmd) rarg = &arg5 ;
1597 if (arg6.
GetName()==rcmd) rarg = &arg6 ;
1598 if (arg7.
GetName()==rcmd) rarg = &arg7 ;
1599 if (arg8.
GetName()==rcmd) rarg = &arg8 ;
1603 const size_t bufSize = strlen(rangeName)+1;
1604 char* buf =
new char[bufSize] ;
1605 strlcpy(buf,rangeName,bufSize) ;
1606 char* token = strtok(buf,
",") ;
1611 &arg1==rarg?subRangeCmd:arg1,&arg2==rarg?subRangeCmd:arg2,
1612 &arg3==rarg?subRangeCmd:arg3,&arg4==rarg?subRangeCmd:arg4,
1613 &arg5==rarg?subRangeCmd:arg5,&arg6==rarg?subRangeCmd:arg6,
1614 &arg7==rarg?subRangeCmd:arg7,&arg8==rarg?subRangeCmd:arg8) ;
1615 chi2List.
add(*chi2Comp) ;
1616 token = strtok(0,
",") ;
1638 pc.defineInt(
"integrate",
"Integrate",0,0) ;
1639 pc.defineObject(
"yvar",
"YVar",0,0) ;
1642 pc.process(cmdList) ;
1648 Bool_t integrate =
pc.getInt(
"integrate") ;
1685 os <<
indent <<
"--- RooAbsPdf ---" << endl;
1688 os <<
indent <<
" Normalization integral: " << endl ;
1721 if (prototype || (auxProto && auxProto->
getSize()>0)) {
1787 pc.defineObject(
"proto",
"PrototypeData",0,0) ;
1788 pc.defineString(
"dsetName",
"Name",0,
"") ;
1789 pc.defineInt(
"randProto",
"PrototypeData",0,0) ;
1790 pc.defineInt(
"resampleProto",
"PrototypeData",1,0) ;
1791 pc.defineInt(
"verbose",
"Verbose",0,0) ;
1792 pc.defineInt(
"extended",
"Extended",0,0) ;
1793 pc.defineInt(
"nEvents",
"NumEvents",0,0) ;
1794 pc.defineInt(
"autoBinned",
"AutoBinned",0,1) ;
1795 pc.defineInt(
"expectedData",
"ExpectedData",0,0) ;
1796 pc.defineDouble(
"nEventsD",
"NumEventsD",0,-1.) ;
1797 pc.defineString(
"binnedTag",
"GenBinned",0,
"") ;
1798 pc.defineMutex(
"GenBinned",
"ProtoData") ;
1799 pc.defineMutex(
"Extended",
"NumEvents");
1802 pc.process(arg1,arg2,arg3,arg4,arg5,arg6) ;
1809 const char* dsetName =
pc.getString(
"dsetName") ;
1811 Bool_t randProto =
pc.getInt(
"randProto") ;
1812 Bool_t resampleProto =
pc.getInt(
"resampleProto") ;
1813 Bool_t extended =
pc.getInt(
"extended") ;
1814 Bool_t autoBinned =
pc.getInt(
"autoBinned") ;
1815 const char* binnedTag =
pc.getString(
"binnedTag") ;
1816 Int_t nEventsI =
pc.getInt(
"nEvents") ;
1819 Bool_t expectedData =
pc.getInt(
"expectedData") ;
1830 }
else if (nEvents==0) {
1831 cxcoutI(
Generation) <<
"No number of events specified , number of events generated is "
1835 if (extended && protoData && !randProto) {
1836 cxcoutI(
Generation) <<
"WARNING Using generator option Extended() (Poisson distribution of #events) together "
1837 <<
"with a prototype dataset implies incomplete sampling or oversampling of proto data. "
1838 <<
"Set randomize flag in ProtoData() option to randomize prototype dataset order and thus "
1839 <<
"to randomize the set of over/undersampled prototype events for each generation cycle." << endl ;
1848 data =
generate(whatVars,nEvents,
verbose,autoBinned,binnedTag,expectedData, extended) ;
1852 if (dsetName && strlen(dsetName)>0) {
1879 pc.defineObject(
"proto",
"PrototypeData",0,0) ;
1880 pc.defineString(
"dsetName",
"Name",0,
"") ;
1881 pc.defineInt(
"randProto",
"PrototypeData",0,0) ;
1882 pc.defineInt(
"resampleProto",
"PrototypeData",1,0) ;
1883 pc.defineInt(
"verbose",
"Verbose",0,0) ;
1884 pc.defineInt(
"extended",
"Extended",0,0) ;
1885 pc.defineInt(
"nEvents",
"NumEvents",0,0) ;
1886 pc.defineInt(
"autoBinned",
"AutoBinned",0,1) ;
1887 pc.defineString(
"binnedTag",
"GenBinned",0,
"") ;
1888 pc.defineMutex(
"GenBinned",
"ProtoData") ;
1892 pc.process(arg1,arg2,arg3,arg4,arg5,arg6) ;
1899 const char* dsetName =
pc.getString(
"dsetName") ;
1900 Int_t nEvents =
pc.getInt(
"nEvents") ;
1902 Bool_t randProto =
pc.getInt(
"randProto") ;
1903 Bool_t resampleProto =
pc.getInt(
"resampleProto") ;
1904 Bool_t extended =
pc.getInt(
"extended") ;
1905 Bool_t autoBinned =
pc.getInt(
"autoBinned") ;
1906 const char* binnedTag =
pc.getString(
"binnedTag") ;
1910 return new GenSpec(cx,whatVars,protoData,nEvents,extended,randProto,resampleProto,dsetName) ;
1960 return new RooDataSet(
"emptyData",
"emptyData",whatVars) ;
1970 if(0 != context && context->
isValid()) {
1976 if(0 != context)
delete context;
1990 if (nEvents==0 && (prototype==0 || prototype->
numEntries()==0)) {
1991 return new RooDataSet(
"emptyData",
"emptyData",whatVars) ;
1997 if (resampleProto) {
1998 randProtoOrder=
kTRUE ;
2001 if (randProtoOrder && prototype && prototype->
numEntries()!=nEvents) {
2002 coutI(
Generation) <<
"RooAbsPdf::generate (Re)randomizing event order in prototype dataset (Nevt=" << nEvents <<
")" << endl ;
2009 generated= context.
generate(nEvents,skipInit,extended);
2012 coutE(
Generation) <<
"RooAbsPdf::generate(" <<
GetName() <<
") do not have a valid generator context" << endl;
2051 coutE(
Generation) <<
"RooAbsPdf::generate(" <<
GetName() <<
") ERROR creating generator context" << endl ;
2068 for (i=0 ; i<nProto ; i++) {
2076 if (!resampleProto) {
2078 for (i=0 ; i<nProto ; i++) {
2087 for (i=0 ; i<nProto ; i++) {
2151 if(server == &arg)
continue;
2192 pc.defineString(
"dsetName",
"Name",0,
"") ;
2193 pc.defineInt(
"verbose",
"Verbose",0,0) ;
2194 pc.defineInt(
"extended",
"Extended",0,0) ;
2195 pc.defineInt(
"nEvents",
"NumEvents",0,0) ;
2196 pc.defineDouble(
"nEventsD",
"NumEventsD",0,-1.) ;
2197 pc.defineInt(
"expectedData",
"ExpectedData",0,0) ;
2200 pc.process(arg1,arg2,arg3,arg4,arg5,arg6) ;
2206 Double_t nEvents =
pc.getDouble(
"nEventsD") ;
2208 nEvents =
pc.getInt(
"nEvents") ;
2211 Bool_t extended =
pc.getInt(
"extended") ;
2212 Bool_t expectedData =
pc.getInt(
"expectedData") ;
2213 const char* dsetName =
pc.getString(
"dsetName") ;
2218 cxcoutI(
Generation) <<
" Extended mode active, number of events generated (" << nEvents <<
") is Poisson fluctuation on "
2219 <<
GetName() <<
"::expectedEvents() = " << nEvents << endl ;
2224 }
else if (nEvents==0) {
2225 cxcoutI(
Generation) <<
"No number of events specified , number of events generated is "
2233 if (dsetName && strlen(dsetName)>0) {
2264 coutE(
InputArguments) <<
"RooAbsPdf::generateBinned(" <<
GetName() <<
") ERROR: No event count provided and p.d.f does not provide expected number of events" << endl ;
2270 if (expectedData || extended) {
2283 Int_t histOutSum(0) ;
2292 }
else if (extended) {
2302 if (hist->
weight()>histMax) {
2303 histMax = hist->
weight() ;
2306 histOutSum += histOut[i] ;
2311 if (!expectedData && !extended) {
2316 Int_t nEvtExtra = abs(
Int_t(nEvents)-histOutSum) ;
2317 Int_t wgt = (histOutSum>nEvents) ? -1 : 1 ;
2320 while(nEvtExtra>0) {
2323 hist->
get(ibinRand) ;
2326 if (ranY<hist->weight()) {
2328 histOut[ibinRand]++ ;
2331 if (histOut[ibinRand]>0) {
2332 histOut[ibinRand]-- ;
2344 hist->
set(histOut[i],
sqrt(1.0*histOut[i])) ;
2347 }
else if (expectedData) {
2370 return generate(whatVars,nEvents) ;
2452 cmdList.
Add(plotRange) ;
2457 cmdList.
Add(normRange2) ;
2460 if (plotRange || normRange2) {
2461 coutI(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") p.d.f was fitted in range and no explicit "
2462 << (plotRange?
"plot":
"") << ((plotRange&&normRange2)?
",":
"")
2463 << (normRange2?
"norm":
"") <<
" range was specified, using fit range as default" << endl ;
2471 pc.defineDouble(
"scaleFactor",
"Normalization",0,1.0) ;
2472 pc.defineInt(
"scaleType",
"Normalization",0,
Relative) ;
2473 pc.defineObject(
"compSet",
"SelectCompSet",0) ;
2474 pc.defineString(
"compSpec",
"SelectCompSpec",0) ;
2475 pc.defineObject(
"asymCat",
"Asymmetry",0) ;
2476 pc.defineDouble(
"rangeLo",
"Range",0,-999.) ;
2477 pc.defineDouble(
"rangeHi",
"Range",1,-999.) ;
2478 pc.defineString(
"rangeName",
"RangeWithName",0,
"") ;
2479 pc.defineString(
"normRangeName",
"NormRange",0,
"") ;
2480 pc.defineInt(
"rangeAdjustNorm",
"Range",0,0) ;
2481 pc.defineInt(
"rangeWNAdjustNorm",
"RangeWithName",0,0) ;
2482 pc.defineMutex(
"SelectCompSet",
"SelectCompSpec") ;
2483 pc.defineMutex(
"Range",
"RangeWithName") ;
2484 pc.allowUndefined() ;
2487 pc.process(cmdList) ;
2494 Double_t scaleFactor =
pc.getDouble(
"scaleFactor") ;
2496 const char* compSpec =
pc.getString(
"compSpec") ;
2498 Bool_t haveCompSel = ( (compSpec && strlen(compSpec)>0) || compSet) ;
2502 if (compSpec && strlen(compSpec)>0) {
2503 nameSuffix.
Append(
"_Comp[") ;
2504 nameSuffix.
Append(compSpec) ;
2506 }
else if (compSet) {
2507 nameSuffix.
Append(
"_Comp[") ;
2513 pc.stripCmdList(cmdList,
"SelectCompSet,SelectCompSpec") ;
2517 RooCmdArg cnsuffix(
"CurveNameSuffix",0,0,0,0,nameSuffix.
Data(),0,0,0) ;
2518 cmdList.
Add(&cnsuffix);
2527 <<
"): ERROR the 'Expected' scale option can only be used on extendable PDFs" << endl ;
2539 list<pair<Double_t,Double_t> > rangeLim ;
2542 if (
pc.hasProcessed(
"Range")) {
2546 rangeLim.push_back(make_pair(rangeLo,rangeHi)) ;
2547 adjustNorm =
pc.getInt(
"rangeAdjustNorm") ;
2548 hasCustomRange =
kTRUE ;
2551 << rangeLo <<
"," << rangeHi <<
"]" ;
2552 if (!
pc.hasProcessed(
"NormRange")) {
2553 ccoutI(
Plotting) <<
", curve is normalized to data in " << (adjustNorm?
"given":
"full") <<
" given range" << endl ;
2558 nameSuffix.
Append(
Form(
"_Range[%f_%f]",rangeLo,rangeHi)) ;
2560 }
else if (
pc.hasProcessed(
"RangeWithName")) {
2563 strlcpy(tmp,
pc.getString(
"rangeName",0,
kTRUE),1024) ;
2564 char* rangeNameToken = strtok(tmp,
",") ;
2565 while(rangeNameToken) {
2568 rangeLim.push_back(make_pair(rangeLo,rangeHi)) ;
2569 rangeNameToken = strtok(0,
",") ;
2571 adjustNorm =
pc.getInt(
"rangeWNAdjustNorm") ;
2572 hasCustomRange =
kTRUE ;
2575 if (!
pc.hasProcessed(
"NormRange")) {
2576 ccoutI(
Plotting) <<
", curve is normalized to data in " << (adjustNorm?
"given":
"full") <<
" given range" << endl ;
2581 nameSuffix.
Append(
Form(
"_Range[%s]",
pc.getString(
"rangeName"))) ;
2584 if (
pc.hasProcessed(
"NormRange")) {
2586 strlcpy(tmp,
pc.getString(
"normRangeName",0,
kTRUE),1024) ;
2587 char* rangeNameToken = strtok(tmp,
",") ;
2589 while(rangeNameToken) {
2592 rangeLim.push_back(make_pair(rangeLo,rangeHi)) ;
2593 rangeNameToken = strtok(0,
",") ;
2595 adjustNorm =
kTRUE ;
2596 hasCustomRange =
kTRUE ;
2597 coutI(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") p.d.f. curve is normalized using explicit choice of ranges '" <<
pc.getString(
"normRangeName",0,
kTRUE) <<
"'" << endl ;
2599 nameSuffix.
Append(
Form(
"_NormRange[%s]",
pc.getString(
"rangeName"))) ;
2603 if (hasCustomRange && adjustNorm) {
2606 list<pair<Double_t,Double_t> >::iterator riter = rangeLim.begin() ;
2607 for (;riter!=rangeLim.end() ; ++riter) {
2611 scaleFactor *= rangeNevt/nExpected ;
2617 scaleFactor *= nExpected ;
2619 scaleFactor /= nExpected ;
2642 branchNodeSet.
remove(*arg) ;
2654 if (dirSelNodes->
getSize()>0) {
2655 coutI(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") directly selected PDF components: " << *dirSelNodes << endl ;
2661 coutE(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") ERROR: component selection set " << *compSet <<
" does not match any components of p.d.f." << endl ;
2663 coutE(
Plotting) <<
"RooAbsPdf::plotOn(" <<
GetName() <<
") ERROR: component selection expression '" << compSpec <<
"' does not select any components of p.d.f." << endl ;
2668 delete dirSelNodes ;
2672 RooCmdArg cnsuffix(
"CurveNameSuffix",0,0,0,0,nameSuffix.
Data(),0,0,0) ;
2673 cmdList.
Add(&cnsuffix);
2716 <<
"): ERROR the 'Expected' scale option can only be used on extendable PDFs" << endl ;
2782 pc.defineString(
"label",
"Label",0,
"") ;
2783 pc.defineDouble(
"xmin",
"Layout",0,0.50) ;
2784 pc.defineDouble(
"xmax",
"Layout",1,0.99) ;
2785 pc.defineInt(
"ymaxi",
"Layout",0,
Int_t(0.95*10000)) ;
2786 pc.defineInt(
"showc",
"ShowConstants",0,0) ;
2787 pc.defineObject(
"params",
"Parameters",0,0) ;
2788 pc.defineString(
"formatStr",
"Format",0,
"NELU") ;
2789 pc.defineInt(
"sigDigit",
"Format",0,2) ;
2790 pc.defineInt(
"dummy",
"FormatArgs",0,0) ;
2791 pc.defineMutex(
"Format",
"FormatArgs") ;
2794 pc.process(cmdList) ;
2799 const char* label =
pc.getString(
"label") ;
2803 Int_t showc =
pc.getInt(
"showc") ;
2806 const char* formatStr =
pc.getString(
"formatStr") ;
2807 Int_t sigDigit =
pc.getInt(
"sigDigit") ;
2813 if (
pc.hasProcessed(
"FormatArgs")) {
2823 if (
pc.hasProcessed(
"FormatArgs")) {
2871 Bool_t showLabel= (label != 0 && strlen(label) > 0);
2882 if(showLabel)
ymin-= dy;
2888 box->SetFillColor(0);
2889 box->SetBorderSize(1);
2890 box->SetTextAlign(12);
2891 box->SetTextSize(0.04F);
2892 box->SetFillStyle(1001);
2893 box->SetFillColor(0);
2897 if(var->
isConstant() && !showConstants)
continue;
2900 box->AddText(formatted->
Data());
2904 if(showLabel)
box->AddText(label);
2967 pdfOwner->
_norm = 0 ;
2983 name.Append(
"_Proj[") ;
3045 pc.defineObject(
"supNormSet",
"SupNormSet",0,0) ;
3046 pc.defineInt(
"numScanBins",
"ScanParameters",0,1000) ;
3047 pc.defineInt(
"intOrder",
"ScanParameters",1,2) ;
3048 pc.defineInt(
"doScanNum",
"ScanNumCdf",0,1) ;
3049 pc.defineInt(
"doScanAll",
"ScanAllCdf",0,0) ;
3050 pc.defineInt(
"doScanNon",
"ScanNoCdf",0,0) ;
3051 pc.defineMutex(
"ScanNumCdf",
"ScanAllCdf",
"ScanNoCdf") ;
3054 pc.process(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
3065 Int_t numScanBins =
pc.getInt(
"numScanBins") ;
3066 Int_t intOrder =
pc.getInt(
"intOrder") ;
3067 Int_t doScanNum =
pc.getInt(
"doScanNum") ;
3068 Int_t doScanAll =
pc.getInt(
"doScanAll") ;
3069 Int_t doScanNon =
pc.getInt(
"doScanNon") ;
3084 coutI(
NumIntegration) <<
"RooAbsPdf::createCdf(" <<
GetName() <<
") integration over observable(s) " << iset <<
" involves numeric integration," << endl
3085 <<
" constructing cdf though numeric integration of sampled pdf in " << numScanBins <<
" bins and applying order "
3086 << intOrder <<
" interpolation on integrated histogram." << endl
3087 <<
" To override this choice of technique use argument ScanNone(), to change scan parameters use ScanParameters(nbins,order) argument" << endl ;
3099 ivar->
setBins(numScanBins,
"numcdf") ;
3210 if (config)
return config ;
3248 delete _genContext ;
3256 _genContext(context), _whatVars(whatVars), _protoData(protoData), _nGen(nGen), _extended(extended),
3257 _randProto(randProto), _resampleProto(resampleProto), _dsetName(dsetName), _init(
init)
header file containing the templated implementation of matrix inversion routines for use with ROOT's ...
static void indent(ostringstream &buf, int indent_level)
char * Form(const char *fmt,...)
class to compute the Cholesky decomposition of a matrix
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Return the observables of this pdf given a set of observables.
void clearValueAndShapeDirty() const
RooWorkspace * _myws
Prevent 'AlwaysDirty' mode for this node.
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 TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
const Text_t * getStringAttribute(const Text_t *key) const
Get string attribute mapped under key 'key'.
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...
Bool_t isValueDirty() const
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
virtual void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTrackingOpt=kTRUE)
Interface function signaling a request to perform constant term optimization.
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
void setProxyNormSet(const RooArgSet *nset)
Forward a change in the cached normalization argset to all the registered proxies.
friend class RooProjectedPdf
RooArgSet * getComponents() const
Bool_t isConstant() 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.
TIterator * serverIterator() const R__SUGGEST_ALTERNATIVE("Use servers() and begin()
RooAbsArg * findServer(const char *name) const
OperMode operMode() const
void setInterpolationOrder(Int_t order)
Set interpolation order of RooHistFunct representing cache histogram.
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
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 add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooAbsArg * first() const
void reserve(Storage_t::size_type count)
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 ...
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
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...
std::string contentsString() const
Return comma separated list of contained object names as STL string.
TIterator * createIterator(Bool_t dir=kIterForward) const R__SUGGEST_ALTERNATIVE("begin()
TIterator-style iteration over contained elements.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual const RooArgSet * get() const
virtual Bool_t isNonPoissonWeighted() const
virtual Int_t numEntries() const
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
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...
virtual void setExpectedData(Bool_t)
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of prototype data to that in the lookup tables passed as argument.
Normalization set with for above integral.
virtual ~CacheElem()
Destructor of normalization cache element.
void operModeHook(RooAbsArg::OperMode)
Dummy implementation.
RooAbsGenContext * _genContext
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 identical spe...
RooObjCacheManager _normMgr
Double_t getNorm(const RooArgSet &nset) const
static Bool_t evalError()
Return the evaluation error flag.
virtual void generateEvent(Int_t code)
Interface for generation of an event using the algorithm corresponding to the specified code.
virtual ~RooAbsPdf()
Destructor.
void setGeneratorConfig()
Remove the specialized numeric MC generator configuration associated with this object.
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...
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 from a histogram and this function.
virtual RooFitResult * chi2FitTo(RooDataHist &data, const RooLinkedList &cmdList)
Calls RooAbsPdf::createChi2(RooDataSet& data, const RooLinkedList& cmdList) and returns fit result.
static int verboseEval()
Return global level of verbosity for p.d.f. evaluations.
Bool_t traceEvalPdf(Double_t value) const
Check that passed value is positive and not 'not-a-number'.
virtual RooAbsReal * createNLL(RooAbsData &data, const RooLinkedList &cmdList)
Construct representation of -log(L) of PDFwith given dataset.
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.
RooAbsReal * createScanCdf(const RooArgSet &iset, const RooArgSet &nset, Int_t numScanBins, Int_t intOrder)
TString _normRange
MC generator configuration specific for this object.
void setNormRange(const char *rangeName)
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...
RooNumGenConfig * specialGeneratorConfig() const
Returns the specialized integrator configuration for this RooAbsReal.
Bool_t canBeExtended() const
virtual Bool_t selfNormalized() const
virtual Bool_t traceEvalHook(Double_t value) const
WVE 08/21/01 Probably obsolete now.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print multi line detailed information of this RooAbsPdf.
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Analytical integral with normalization (see RooAbsReal::analyticalIntegralWN() for further informatio...
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())
See RooAbsPdf::generate(const RooArgSet&,const RooCmdArg&,const RooCmdArg&,const RooCmdArg&,...
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
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...
virtual void printValue(std::ostream &os) const
Print value of p.d.f, also print normalization integral that was last used, if any.
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....
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 void raiseEvalError()
Raise 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 Double_t getValV(const RooArgSet *set=0) const
Return current value, normalized by integrating over the observables in nset.
virtual RooArgSet * getConstraints(const RooArgSet &, RooArgSet &, Bool_t) 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())
As RooAbsPdf::generateBinned(const RooArgSet&, const RooCmdArg&,const RooCmdArg&, const RooCmdArg&,...
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.
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...
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.
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 ...
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...
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 expectedEvents(const RooArgSet *nset) const
Return expected number of events from this p.d.f for use in extended likelihood calculations.
void setNormRangeOverride(const char *rangeName)
virtual RooDataSet * generateSimGlobal(const RooArgSet &whatVars, Int_t nEvents)
Special generator interface for generation of 'global observables' – for RooStats tools.
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 void initGenerator(Int_t code)
Interface for one-time initialization to setup the generator for the specified code.
virtual ExtendMode extendMode() const
RooAbsPdf()
Default constructor.
virtual RooAbsGenContext * binnedGenContext(const RooArgSet &vars, Bool_t verbose=kFALSE) const
Return a binned generator context.
static RooNumGenConfig * defaultGeneratorConfig()
Returns the default numeric MC generator configuration for all RooAbsReals.
RooNumGenConfig * _specGeneratorConfig
RooArgSet * _normSet
Normalization integral (owned by _normMgr)
static TString _normRangeOverride
static Int_t _verboseEval
static void clearEvalError()
Clear the evaluation error flag.
virtual RooAbsPdf * createProjection(const RooArgSet &iset)
Return a p.d.f that represent a projection of this p.d.f integrated over given observables.
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
Helper calling plotOn(RooPlot*, RooLinkedList&) const.
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
void plotOnCompSelect(RooArgSet *selNodes) const
Helper function for plotting of composite p.d.fs.
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.
virtual Double_t evaluate() const =0
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
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...
RooAbsReal * createIntRI(const RooArgSet &iset, const RooArgSet &nset=RooArgSet())
Utility function for createRunningIntegral that construct an object implementing the standard (analyt...
RooFitResult * chi2FitDriver(RooAbsReal &fcn, RooLinkedList &cmdList)
Internal driver function for chi2 fits.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
virtual void enableOffsetting(Bool_t)
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 ...
Bool_t plotSanityChecks(RooPlot *frame) const
Utility function for plotOn(), perform general sanity check on frame to ensure safe plotting operatio...
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
const RooNumIntConfig * getIntegratorConfig() const
Return the numeric integration configuration used for this object.
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
void logEvalError(const char *message, const char *serverValueString=0) const
Log evaluation error message.
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.
RooAddition calculates the sum of a set of RooAbsReal terms, or when constructed with two sets,...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
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...
RooBinnedGenContext is an efficient implementation of the generator context specific for binned pdfs.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
RooCachedReal is an implementation of RooAbsCachedReal that can cache any external RooAbsReal input f...
void setCacheSource(Bool_t flag)
Class RooChi2Var implements a simple chi^2 calculation from a binned dataset and a PDF.
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
void setInt(Int_t idx, Int_t value)
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
RooConstraintSum calculates the sum of the -(log) likelihoods of a set of RooAbsPfs that represent co...
The RooDataHist is a container class to hold N-dimensional binned data.
virtual Double_t weight() const
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 Double_t sumEntries() const
virtual Int_t numEntries() const
Return the number of bins.
virtual const RooArgSet * get() const
void SetName(const char *name)
Change the name of the RooDataHist.
RooDataSet is a container class to hold unbinned data.
void SetName(const char *name)
Change the name of this dataset into the given name.
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
const TMatrixDSym & covarianceMatrix() const
Return covariance matrix.
Class RooGenContext implement a universal generator context for all RooAbsPdf classes that do not hav...
RooInt is a minimal implementation of a TObject holding a Int_t value.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
virtual void Add(TObject *arg)
RooMinimizer is a wrapper class around ROOT::Fit:Fitter that provides a seamless interface between th...
RooMinuit is a wrapper class around TFitter/TMinuit that provides a seamless interface between the MI...
Class RooNLLVar implements a a -log(likelihood) calculation from a dataset and a PDF.
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
RooNameSet is a utility class that stores the names the objects in a RooArget.
RooArgSet * select(const RooArgSet &list) const
Construct a RooArgSet of objects in input 'list' whose names match to those in the internal name list...
void setNameList(const char *givenList)
const char * content() const
Class RooNumCdf is an implementation of RooNumRunningInt specialized to calculate cumulative distribu...
RooNumGenConfig holds the configuration parameters of the various numeric integrators used by RooReal...
static RooNumGenConfig & defaultConfig()
Return reference to instance of default numeric integrator configuration object.
A RooPlot is a plot frame and a container for graphics objects within that frame.
void addObject(TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a generic object to this plot.
Double_t getFitRangeNEvt() const
Return the number of events in the fit range.
Double_t getFitRangeBinW() const
Return the bin width that is being used to normalise the PDF.
const RooArgSet * getNormVars() const
RooAbsRealLValue * getPlotVar() const
void updateNormVars(const RooArgSet &vars)
Install the given set of observables are reference normalization variables for this frame.
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,...
static UInt_t integer(UInt_t max, TRandom *generator=randomGenerator())
Return an integer uniformly distributed from [0,n-1].
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
RooRealIntegral performs hybrid numerical/analytical integrals of RooAbsReal objects.
const RooArgSet & numIntRealVars() const
RooRealVar represents a fundamental (non-derived) real valued object.
void setBins(Int_t nBins, const char *name=0)
void setRange(const char *name, Double_t min, Double_t max)
Set range named 'name to [min,max].
TString * format(const RooCmdArg &formatArg) const
Format contents of RooRealVar for pretty printing on RooPlot parameter boxes.
Bool_t defineSetInternal(const char *name, const RooArgSet &aset)
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...
Iterator abstract base class.
virtual TObject * Next()=0
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...
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
A Pave (see TPave) with text, lines or/and boxes inside.
virtual Int_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
void ToLower()
Change string to lower-case.
void Clear()
Clear string without changing its capacity.
const char * Data() const
TString & Append(const char *cs)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
RooCmdArg NormRange(const char *rangeNameList)
RooCmdArg SupNormSet(const RooArgSet &nset)
RooCmdArg Range(const char *rangeName, Bool_t adjustNorm=kTRUE)
RooCmdArg Normalization(Double_t scaleFactor)
static constexpr double pc