80#define NoHistConst_Low "0"
81#define NoHistConst_High "2000"
98 fSystToFix( measurement.GetConstantParams() ),
99 fParamValues( measurement.GetParamValues() ),
100 fNomLumi( measurement.GetLumi() ),
101 fLumiError( measurement.GetLumi()*measurement.GetLumiRelErr() ),
102 fLowBin( measurement.GetBinLow() ),
103 fHighBin( measurement.GetBinHigh() ),
119 if( proto_config ==
nullptr ) {
120 std::cout <<
"Error: Did not find 'ModelConfig' object in file: " << ws_single->
GetName()
125 std::vector<std::string> poi_list = measurement.
GetPOIList();
126 if( poi_list.empty() ) {
127 cxcoutWHF <<
"No Parametetrs of interest are set" << std::endl;
131 std::stringstream sstream;
132 sstream <<
"Setting Parameter(s) of Interest as: ";
133 for(
unsigned int i = 0; i < poi_list.size(); ++i) {
134 sstream << poi_list.at(i) <<
" ";
139 for(
unsigned int i = 0; i < poi_list.size(); ++i ) {
140 std::string poi_name = poi_list.at(i);
146 std::cout <<
"WARNING: Can't find parameter of interest: " << poi_name
147 <<
" in Workspace. Not setting in ModelConfig." << std::endl;
154 std::string NewModelName =
"newSimPdf";
159 std::cout <<
"Error: Failed to find dataset: " << expData
160 <<
" in workspace" << std::endl;
163 if(poi_list.size()!=0){
175 if( !pdf ) pdf = ws_single->
pdf( ModelName );
176 const RooArgSet* observables = ws_single->
set(
"observables");
179 std::string SnapShotName =
"NominalParamValues";
186 std::string AsimovName = asimov.
GetName();
188 cxcoutPHF <<
"Generating additional Asimov Dataset: " << AsimovName << std::endl;
192 cxcoutPHF <<
"Importing Asimov dataset" << std::endl;
193 bool failure = ws_single->
import(*asimov_dataset,
Rename(AsimovName.c_str()));
195 std::cout <<
"Error: Failed to import Asimov dataset: " << AsimovName
223 string ch_name = channel.
GetName();
227 if( ws_single ==
nullptr ) {
228 cxcoutF(
HistFactory) <<
"Error: Failed to make Single-Channel workspace for channel: " << ch_name
229 <<
" and measurement: " << measurement.
GetName() << std::endl;
259 vector<std::unique_ptr<RooWorkspace>> channel_workspaces;
260 vector<string> channel_names;
262 for(
unsigned int chanItr = 0; chanItr < measurement.
GetChannels().
size(); ++chanItr ) {
268 <<
" has uninitialized histogram pointers" << std::endl;
272 string ch_name = channel.
GetName();
273 channel_names.push_back(ch_name);
278 channel_workspaces.emplace_back(ws_single);
300 for (
unsigned int idx=0; idx <
fObsNameVec.size(); ++idx) {
313 obs->setBinning(binning);
335 unsigned int histndim(1);
336 std::string classname = hist->
ClassName();
337 if (classname.find(
"TH1")==0) { histndim=1; }
338 else if (classname.find(
"TH2")==0) { histndim=2; }
339 else if (classname.find(
"TH3")==0) { histndim=3; }
342 prefix +=
"_Hist_alphanominal";
344 RooDataHist histDHist((prefix +
"DHist").c_str(),
"",observables,hist);
345 RooHistFunc histFunc(prefix.c_str(),
"",observables,histDHist,0);
356 std::vector<std::string> & constraintTermNames) {
357 std::string paramName = param.
GetName();
358 std::string constraintName = paramName +
"Constraint";
361 if(
proto.pdf(constraintName))
return;
365 const double gaussSigma = isUniform ? 100. : 1.0;
367 cxcoutIHF <<
"Added a uniform constraint for " << paramName <<
" as a Gaussian constraint with a very large sigma " << std::endl;
370 std::stringstream command;
371 command <<
"Gaussian::" << constraintName <<
"(" << paramName <<
",nom_" << paramName <<
"[0.,-10,10],"
372 << gaussSigma <<
")";
373 constraintTermNames.emplace_back(
proto.factory(command.str())->GetName());
374 auto * normParam =
proto.var(std::string(
"nom_") + paramName);
375 normParam->setConstant();
376 const_cast<RooArgSet*
>(
proto.set(
"globalObservables"))->add(*normParam);
386 for(
auto const& histoSys : histoSysList) {
387 const std::string histoSysName = histoSys.GetName();
403 const string& prefix,
408 vector<double> low, high;
411 for(
unsigned int j=0; j<histoSysList.size(); ++j){
412 std::stringstream str;
415 const HistoSys& histoSys = histoSysList.at(j);
416 RooDataHist* lowDHist =
new RooDataHist((prefix+str.str()+
"lowDHist").c_str(),
"",observables, histoSys.GetHistoLow());
417 RooDataHist* highDHist =
new RooDataHist((prefix+str.str()+
"highDHist").c_str(),
"",observables, histoSys.GetHistoHigh());
420 lowSet.
add(*lowFunc);
421 highSet.
add(*highFunc);
426 interp.setPositiveDefinite();
427 interp.setAllInterpCodes(4);
430 interp.setBinIntegrator(observableSet);
431 interp.forceNumInt();
435 auto interpInWS =
proto->arg(prefix.c_str());
446 std::vector<string> prodNames;
449 vector<string> normFactorNames, rangeNames;
452 string overallNorm_times_sigmaEpsilon = sample.
GetName() +
"_" + channel +
"_scaleFactors";
453 auto sigEps =
proto->arg(sigmaEpsilon.c_str());
455 auto normFactor = std::make_unique<RooProduct>(overallNorm_times_sigmaEpsilon.c_str(), overallNorm_times_sigmaEpsilon.c_str(),
RooArgList(*sigEps));
457 if(normList.size() > 0){
459 for(vector<NormFactor>::iterator itr = normList.begin(); itr != normList.end(); ++itr){
465 varname = norm.
GetName() +
"_" + channel;
474 std::stringstream range;
477 if(
proto->obj(varname) ==
nullptr) {
480 proto->factory(varname + range.str());
483 prodNames.push_back(varname);
484 rangeNames.push_back(range.str());
485 normFactorNames.push_back(varname);
489 for (
const auto&
name : prodNames) {
492 normFactor->addTerm(arg);
497 unsigned int rangeIndex=0;
498 for( vector<string>::iterator nit = normFactorNames.begin(); nit!=normFactorNames.end(); ++nit){
499 if( count (normFactorNames.begin(), normFactorNames.end(), *nit) > 1 ){
500 cxcoutI(
HistFactory) <<
"<NormFactor Name =\""<<*nit<<
"\"> is duplicated for <Sample Name=\""
501 << sample.
GetName() <<
"\">, but only one factor will be included. \n Instead, define something like"
502 <<
"\n\t<Function Name=\""<<*nit<<
"Squared\" Expression=\""<<*nit<<
"*"<<*nit<<
"\" Var=\""<<*nit<<rangeNames.at(rangeIndex)
503 <<
"\"> \nin your top-level XML's <Measurment> entry and use <NormFactor Name=\""<<*nit<<
"Squared\" in your channel XML file."<< endl;
513 std::vector<OverallSys>& systList,
514 vector<string>& constraintTermNames,
515 vector<string>& totSystTermNames) {
521 totSystTermNames.push_back(prefix);
524 vector<double> lowVec, highVec;
526 std::map<std::string, double>::iterator itconstr;
527 for(
unsigned int i = 0; i < systList.size(); ++i) {
530 std::string strname = sys.
GetName();
531 const char *
name = strname.c_str();
542 cxcoutI(
HistFactory) <<
"HistoToWorkspaceFast::AddConstraintTerm - zero uncertainty assigned - skip systematic " << sys.
GetName() << std::endl;
545 double tauVal = 1./(relerr*relerr);
546 double sqtau = 1./relerr;
560 alphaOfBeta->
Print(
"t");
563 constraintTermNames.push_back(
gamma->GetName());
567 const_cast<RooArgSet*
>(
proto->set(
"globalObservables"))->add(*yvar);
570 params.
add(*alphaOfBeta);
581 makeGaussianConstraint(*alpha, *
proto, isUniform, constraintTermNames);
592 double tauVal = 1./relerr;
593 std::string tauName =
"tau_" + sys.
GetName();
595 double kappaVal = 1. + relerr;
596 std::string kappaName =
"kappa_" + sys.
GetName();
598 const char * alphaName = alpha->
GetName();
600 std::string alphaOfBetaName =
"alphaOfBeta_" + sys.
GetName();
602 tauName.c_str(),kappaName.c_str(),alphaName,
603 tauName.c_str(),kappaName.c_str(),alphaName ) );
607 alphaOfBeta->
Print(
"t");
608 params.
add(*alphaOfBeta);
613 double low = sys.
GetLow();
615 lowVec.push_back(low);
616 highVec.push_back(high);
620 if(systList.size() > 0){
624 assert(!params.
empty());
625 assert(
int(lowVec.size()) == params.
getSize() );
627 FlexibleInterpVar interp( (interpName).c_str(),
"", params, 1., lowVec, highVec);
630 proto->import(interp);
635 proto->import(interp);
645 const vector<RooProduct*>& sampleScaleFactors, std::vector<vector<RooAbsArg*>>& sampleHistFuncs)
const {
646 assert(sampleScaleFactors.size() == sampleHistFuncs.size());
651 throw std::logic_error(
"HistFactory didn't process the observables correctly. Please file a bug report.");
653 auto firstHistFunc =
dynamic_cast<const RooHistFunc*
>(sampleHistFuncs.front().front());
654 if (!firstHistFunc) {
656 firstHistFunc =
dynamic_cast<const RooHistFunc*
>(piecewiseInt->nominalHist());
658 assert(firstHistFunc);
661 const std::string binWidthFunctionName = totName +
"_binWidth";
662 RooBinWidthFunction binWidth(binWidthFunctionName.c_str(),
"Divide by bin width to obtain probability density", *firstHistFunc,
true);
663 proto->import(binWidth);
664 auto binWidthWS =
proto->function(binWidthFunctionName.c_str());
670 for (
unsigned int i=0; i < sampleHistFuncs.size(); ++i) {
671 assert(!sampleHistFuncs[i].empty());
672 coefList.
add(*sampleScaleFactors[i]);
674 std::vector<RooAbsArg*>& thisSampleHistFuncs = sampleHistFuncs[i];
675 thisSampleHistFuncs.push_back(binWidthWS);
677 if (thisSampleHistFuncs.size() == 1) {
679 shapeList.
add(*thisSampleHistFuncs.front());
682 std::string
name = thisSampleHistFuncs.front()->GetName();
683 auto pos =
name.find(
"Hist_alpha");
684 if (pos != std::string::npos) {
685 name =
name.substr(0, pos) +
"shapes";
686 }
else if ( (pos =
name.find(
"nominal")) != std::string::npos) {
687 name =
name.substr(0, pos) +
"shapes";
690 RooProduct shapeProduct(
name.c_str(), thisSampleHistFuncs.front()->GetTitle(),
RooArgSet(thisSampleHistFuncs.begin(), thisSampleHistFuncs.end()));
697 RooRealSumPdf tot(totName.c_str(), totName.c_str(), shapeList, coefList,
true);
718 FILE* covFile = fopen ((
filename).c_str(),
"w");
719 fprintf(covFile,
" ") ;
720 for (
auto const *myargi : static_range_cast<RooRealVar *>(*params)) {
721 if(myargi->isConstant())
continue;
722 fprintf(covFile,
" & %s", myargi->GetName());
724 fprintf(covFile,
"\\\\ \\hline \n" );
725 for (
auto const *myargi : static_range_cast<RooRealVar *>(*params)) {
726 if(myargi->isConstant())
continue;
727 fprintf(covFile,
"%s", myargi->GetName());
728 for (
auto const *myargj : static_range_cast<RooRealVar *>(*params)) {
729 if(myargj->isConstant())
continue;
730 cout << myargi->GetName() <<
"," << myargj->GetName();
731 fprintf(covFile,
" & %.2f",
result->correlation(*myargi, *myargj));
734 fprintf(covFile,
" \\\\\n");
747 Error(
"MakeSingleChannelWorkspace",
748 "The input Channel does not contain any sample - return a nullptr");
752 const TH1* channel_hist_template = channel.
GetSamples().front().GetHisto();
753 if (channel_hist_template ==
nullptr) {
755 channel_hist_template = channel.
GetSamples().front().GetHisto();
757 if (channel_hist_template ==
nullptr) {
758 std::ostringstream stream;
759 stream <<
"The sample " << channel.
GetSamples().front().GetName()
760 <<
" in channel " << channel.
GetName() <<
" does not contain a histogram. This is the channel:\n";
761 channel.
Print(stream);
762 Error(
"MakeSingleChannelWorkspace",
"%s", stream.str().c_str());
767 std::cout <<
"MakeSingleChannelWorkspace: Channel: " << channel.
GetName()
768 <<
" has uninitialized histogram pointers" << std::endl;
782 string channel_name = channel.
GetName();
792 for (
unsigned int idx=0; idx<
fObsNameVec.size(); ++idx ) {
802 throw hf_exc(
"HistFactory is limited to 1- to 3-dimensional histograms.");
806 <<
"\tStarting to process '"
807 << channel_name <<
"' channel with " <<
fObsNameVec.size() <<
" observables"
808 <<
"\n-----------------------------------------\n" << endl;
814 auto proto_config = make_unique<ModelConfig>(
"ModelConfig",
proto);
815 proto_config->SetWorkspace(*
proto);
821 proto->factory(*funcIter);
825 RooArgSet likelihoodTerms(
"likelihoodTerms"), constraintTerms(
"constraintTerms");
826 vector<string> likelihoodTermNames, constraintTermNames, totSystTermNames;
828 std::vector<std::vector<RooAbsArg*>> allSampleHistFuncs;
829 std::vector<RooProduct*> sampleScaleFactors;
831 std::vector< pair<string,string> > statNamePairs;
832 std::vector< pair<const TH1*, std::unique_ptr<TH1>> > statHistPairs;
833 const std::string statFuncName =
"mc_stat_" + channel_name;
835 string prefix, range;
840 std::stringstream lumiStr;
843 proto->factory(lumiStr.str());
846 std::stringstream lumiErrorStr;
848 proto->factory(
"Gaussian::lumiConstraint(Lumi,"+lumiErrorStr.str()+
")");
849 proto->var(
"nominalLumi")->setConstant();
850 proto->defineSet(
"globalObservables",
"nominalLumi");
852 constraintTermNames.push_back(
"lumiConstraint");
861 string overallSystName = sample.GetName() +
"_" + channel_name +
"_epsilon";
863 string systSourcePrefix =
"alpha_";
868 sample.GetOverallSysList(), constraintTermNames , totSystTermNames);
870 allSampleHistFuncs.emplace_back();
871 std::vector<RooAbsArg*>& sampleHistFuncs = allSampleHistFuncs.back();
884 const TH1* nominal = sample.GetHisto();
896 string expPrefix = sample.
GetName() +
"_" + channel_name;
900 assert(nominalHistFunc);
902 if(sample.GetHistoSysList().empty()) {
904 cxcoutI(
HistFactory) << sample.GetName() +
"_" + channel_name +
" has no variation histograms " << endl;
906 sampleHistFuncs.push_back(nominalHistFunc);
910 string constraintPrefix = sample.GetName() +
"_" + channel_name +
"_Hist_alpha";
913 RooArgList interpParams = makeInterpolationParameters(sample.GetHistoSysList(), *
proto);
916 for(std::size_t i = 0; i < interpParams.
size(); ++i) {
917 bool isUniform = measurement.
GetUniformSyst().count(sample.GetHistoSysList()[i].GetName()) > 0;
918 makeGaussianConstraint(interpParams[i], *
proto, isUniform, constraintTermNames);
922 sampleHistFuncs.push_back( makeLinInterp(interpParams, nominalHistFunc,
proto,
923 sample.GetHistoSysList(), constraintPrefix, observables) );
926 sampleHistFuncs.front()->SetTitle( (nominal && strlen(nominal->
GetTitle())>0) ? nominal->
GetTitle() : sample.GetName().c_str() );
932 if( sample.GetStatError().GetActivate() ) {
935 cxcoutF(
HistFactory) <<
"Cannot include Stat Error for histograms of more than 3 dimensions."
944 cxcoutI(
HistFactory) <<
"Sample: " << sample.GetName() <<
" to be included in Stat Error "
945 <<
"for channel " << channel_name
948 string UncertName = sample.GetName() +
"_" + channel_name +
"_StatAbsolUncert";
949 std::unique_ptr<TH1> statErrorHist;
951 if( sample.GetStatError().GetErrorHist() ==
nullptr ) {
954 <<
" Channel: " << channel_name
955 <<
" Sample: " << sample.GetName()
962 statErrorHist.reset(
static_cast<TH1*
>(sample.GetStatError().GetErrorHist()->Clone()));
967 <<
"\tChannel: " << channel_name
968 <<
"\tSample: " << sample.GetName()
969 <<
"\tError Histogram: " << statErrorHist->GetName() << std::endl;
972 statErrorHist->Multiply( nominal );
973 statErrorHist->SetName( UncertName.c_str() );
978 statHistPairs.emplace_back(nominal, std::move(statErrorHist));
996 if( paramHist ==
nullptr ) {
1001 std::vector<std::string>::iterator itr =
fObsNameVec.begin();
1002 for (
int idx=0; itr!=
fObsNameVec.end(); ++itr, ++idx ) {
1003 theObservables.
add( *
proto->var(*itr) );
1008 std::string ParamSetPrefix =
"gamma_stat_" + channel_name;
1009 double gammaMin = 0.0;
1010 double gammaMax = 10.0;
1012 ParamSetPrefix.c_str(),
1014 gammaMin, gammaMax);
1016 ParamHistFunc statUncertFunc(statFuncName.c_str(), statFuncName.c_str(),
1017 theObservables, statFactorParams );
1025 sampleHistFuncs.push_back(paramHist);
1034 if( sample.GetShapeFactorList().size() > 0 ) {
1037 cxcoutF(
HistFactory) <<
"Cannot include Stat Error for histograms of more than 3 dimensions."
1042 cxcoutI(
HistFactory) <<
"Sample: " << sample.GetName() <<
" in channel: " << channel_name
1043 <<
" to be include a ShapeFactor."
1046 for(
unsigned int i=0; i < sample.GetShapeFactorList().
size(); ++i) {
1048 ShapeFactor& shapeFactor = sample.GetShapeFactorList().at(i);
1050 std::string funcName = channel_name +
"_" + shapeFactor.
GetName() +
"_shapeFactor";
1052 if( paramHist ==
nullptr ) {
1055 std::vector<std::string>::iterator itr =
fObsNameVec.begin();
1056 for (
int idx=0; itr!=
fObsNameVec.end(); ++itr, ++idx ) {
1057 theObservables.
add( *
proto->var(*itr) );
1061 std::string funcParams =
"gamma_" + shapeFactor.
GetName();
1067 theObservables, 0, 1000);
1070 ParamHistFunc shapeFactorFunc( funcName.c_str(), funcName.c_str(),
1071 theObservables, shapeFactorParams );
1077 <<
" to have initial shape from hist: "
1080 shapeFactorFunc.
setShape( initialShape );
1086 <<
" to be constant" << std::endl;
1095 sampleHistFuncs.push_back(paramHist);
1105 if( !sample.GetShapeSysList().empty() ) {
1108 cxcoutF(
HistFactory) <<
"Cannot include Stat Error for histograms of more than 3 dimensions."
1114 std::vector<string> ShapeSysNames;
1116 for(
unsigned int i = 0; i < sample.GetShapeSysList().
size(); ++i) {
1129 cxcoutI(
HistFactory) <<
"Sample: " << sample.GetName() <<
" in channel: " << channel_name
1130 <<
" to include a ShapeSys." << std::endl;
1132 std::string funcName = channel_name +
"_" + shapeSys.
GetName() +
"_ShapeSys";
1133 ShapeSysNames.push_back( funcName );
1135 if( paramHist ==
nullptr ) {
1141 std::vector<std::string>::iterator itr =
fObsNameVec.begin();
1143 theObservables.
add( *
proto->var(*itr) );
1147 std::string funcParams =
"gamma_" + shapeSys.
GetName();
1150 theObservables, 0, 10);
1153 ParamHistFunc shapeFactorFunc( funcName.c_str(), funcName.c_str(),
1154 theObservables, shapeFactorParams );
1177 double minShapeUncertainty = 0.0;
1179 *paramHist, shapeErrorHist,
1181 minShapeUncertainty);
1190 for(
unsigned int i = 0; i < ShapeSysNames.size(); ++i ) {
1191 auto func =
proto->function(ShapeSysNames.at(i).c_str());
1193 sampleHistFuncs.push_back(func);
1204 auto lumi =
proto->arg(
"Lumi");
1205 if( !sample.GetNormalizeByTheory() ) {
1208 lumiParamString += measurement.
GetLumi();
1210 lumi =
proto->factory((
"Lumi[" + lumiParamString +
"]").
Data());
1216 normFactors->addTerm(lumi);
1222 auto normFactorsInWS =
dynamic_cast<RooProduct*
>(
proto->arg(normFactors->GetName()));
1223 assert(normFactorsInWS);
1225 sampleScaleFactors.push_back(normFactorsInWS);
1230 if(!statHistPairs.empty()) {
1235 if( fracStatError ==
nullptr ) {
1237 << channel_name +
"_StatUncert" +
"_RelErr" << std::endl;
1245 << chanStatUncertFunc->
GetName()
1246 <<
" params: " << chanStatUncertFunc->
paramList()
1265 *chanStatUncertFunc, fracStatError.
get(),
1267 statRelErrorThreshold);
1275 sampleScaleFactors, allSampleHistFuncs);
1276 likelihoodTermNames.push_back(channel_name+
"_model");
1280 for(
unsigned int i=0; i<systToFix.size(); ++i){
1288 if(systToFix.at(i)==
"Lumi"){
1289 auxMeas =
proto->var(
"nominalLumi");
1291 auxMeas =
proto->var(std::string(
"nom_") + temp->
GetName());
1295 const_cast<RooArgSet*
>(
proto->set(
"globalObservables"))->remove(*auxMeas);
1302 <<
" could not set it to constant" << endl;
1308 for(
unsigned int i=0; i<constraintTermNames.size(); ++i){
1309 RooAbsArg* proto_arg = (
proto->arg(constraintTermNames[i].c_str()));
1310 if( proto_arg==
nullptr ) {
1312 <<
" in workspace: " <<
proto->GetName() << std::endl;
1315 constraintTerms.
add( *proto_arg );
1318 for(
unsigned int i=0; i<likelihoodTermNames.size(); ++i){
1319 RooAbsArg* proto_arg = (
proto->arg(likelihoodTermNames[i].c_str()));
1320 if( proto_arg==
nullptr ) {
1322 <<
" in workspace: " <<
proto->GetName() << std::endl;
1325 likelihoodTerms.add( *proto_arg );
1327 proto->defineSet(
"constraintTerms",constraintTerms);
1328 proto->defineSet(
"likelihoodTerms",likelihoodTerms);
1332 std::string observablesStr;
1334 std::vector<std::string>::iterator itr =
fObsNameVec.begin();
1336 observables.
add( *
proto->var(*itr) );
1337 if (!observablesStr.empty()) { observablesStr +=
","; }
1338 observablesStr += *itr;
1350 <<
"\timport model into workspace"
1351 <<
"\n-----------------------------------------\n" << endl;
1353 auto model = make_unique<RooProdPdf>(
1354 (
"model_"+channel_name).c_str(),
1355 "product of Poissons accross bins for a single channel",
1356 constraintTerms,
Conditional(likelihoodTerms,observables));
1363 proto_config->SetPdf(*model);
1364 proto_config->SetObservables(observables);
1365 proto_config->SetGlobalObservables(*
proto->set(
"globalObservables"));
1369 proto->import(*proto_config,proto_config->GetName());
1370 proto->importClassCode();
1377 int asymcalcPrintLevel = 0;
1390 proto->import(dataset);
1395 if(
data.GetName().empty()) {
1397 <<
" has no name! The name always needs to be set for additional datasets, "
1398 <<
"either via the \"Name\" tag in the XML or via RooStats::HistFactory::Data::SetName()." << std::endl;
1401 std::string
const& dataName =
data.GetName();
1402 TH1 const* mnominal =
data.GetHisto();
1405 <<
" with name: " << dataName <<
" is nullptr" << std::endl;
1412 proto->import(dataset);
1424 TH1 const& mnominal,
1426 std::vector<std::string>
const& obsNameVec) {
1432 if (obsNameVec.empty() ) {
1433 Error(
"ConfigureHistFactoryDataset",
"Invalid input - return");
1441 for (
int i=1; i<=ax->
GetNbins(); ++i) {
1444 proto.var( obsNameVec[0] )->setVal( xval );
1446 if(obsNameVec.size()==1) {
1448 obsDataUnbinned.
add( *
proto.set(
"observables"), fval );
1451 for(
int j=1; j<=ay->
GetNbins(); ++j) {
1453 proto.var( obsNameVec[1] )->setVal( yval );
1455 if(obsNameVec.size()==2) {
1457 obsDataUnbinned.
add( *
proto.set(
"observables"), fval );
1460 for(
int k=1; k<=az->
GetNbins(); ++k) {
1462 proto.var( obsNameVec[2] )->setVal( zval );
1464 obsDataUnbinned.
add( *
proto.set(
"observables"), fval );
1477 unsigned int histndim(1);
1478 std::string classname = hist->
ClassName();
1479 if (classname.find(
"TH1")==0) { histndim=1; }
1480 else if (classname.find(
"TH2")==0) { histndim=2; }
1481 else if (classname.find(
"TH3")==0) { histndim=3; }
1483 for (
unsigned int idx=0; idx<histndim; ++idx ) {
1496 if (ch_names.empty() || chs.empty() ) {
1497 Error(
"MakeCombinedModel",
"Input vectors are empty - return a nullptr");
1500 if (chs.size() < ch_names.size() ) {
1501 Error(
"MakeCombinedModel",
"Input vector of workspace has an invalid size - return a nullptr");
1509 map<string, RooAbsPdf*> pdfMap;
1510 vector<RooAbsPdf*> models;
1513 for(
unsigned int i = 0; i< ch_names.size(); ++i){
1520 stringstream channelString;
1521 channelString <<
"channelCat[";
1522 for(
unsigned int i = 0; i< ch_names.size(); ++i){
1523 string channel_name=ch_names[i];
1524 if (i == 0 && isdigit(channel_name[0])) {
1525 throw std::invalid_argument(
"The first channel name for HistFactory cannot start with a digit. Got " + channel_name);
1527 if (channel_name.find(
',') != std::string::npos) {
1528 throw std::invalid_argument(
"Channel names for HistFactory cannot contain ','. Got " + channel_name);
1531 if (i == 0) channelString << channel_name ;
1532 else channelString <<
',' << channel_name ;
1536 if(!model) cout <<
"failed to find model for channel"<<endl;
1538 models.push_back(model);
1539 globalObs.
add(*ch->
set(
"globalObservables"),
true);
1542 pdfMap[channel_name]=model;
1544 channelString <<
"]";
1547 <<
"\tEntering combination"
1548 <<
"\n-----------------------------------------\n" << endl;
1554 if (!channelCat)
throw std::runtime_error(
"Unable to construct a category from string " + channelString.str());
1556 auto simPdf= std::make_unique<RooSimultaneous>(
"simPdf",
"",pdfMap, *channelCat);
1557 auto combined_config = std::make_unique<ModelConfig>(
"ModelConfig", combined);
1558 combined_config->SetWorkspace(*combined);
1561 combined->
import(globalObs);
1562 combined->
defineSet(
"globalObservables",globalObs);
1563 combined_config->SetGlobalObservables(*combined->
set(
"globalObservables"));
1565 combined->
factory(
"weightVar[0,-1e10,1e10]");
1566 obsList.
add(*combined->
var(
"weightVar"));
1567 combined->
defineSet(
"observables",{obsList, *channelCat},
true);
1568 combined_config->SetObservables(*combined->
set(
"observables"));
1575 if(std::string(
"asimovData") !=
data->GetName()) {
1585 <<
"\tImporting combined model"
1586 <<
"\n-----------------------------------------\n" << endl;
1589 std::map< std::string, double>::iterator param_itr =
fParamValues.begin();
1592 std::string paramName = param_itr->first;
1593 double paramVal = param_itr->second;
1596 temp->
setVal( paramVal );
1597 cxcoutI(
HistFactory) <<
"setting " << paramName <<
" to the value: " << paramVal << endl;
1599 cxcoutE(
HistFactory) <<
"could not find variable " << paramName <<
" could not set its value" << endl;
1603 for(
unsigned int i=0; i<
fSystToFix.size(); ++i){
1617 combined_config->SetPdf(*simPdf);
1620 combined->
import(*combined_config,combined_config->GetName());
1628 <<
"\tcreate toy data for " << channelString.str()
1629 <<
"\n-----------------------------------------\n" << endl;
1637 *combined->
pdf(
"simPdf"),
1639 if( asimov_combined ) {
1640 combined->
import( *asimov_combined,
Rename(
"asimovData"));
1643 std::cout <<
"Error: Failed to create combined asimov dataset" << std::endl;
1652 std::vector<std::unique_ptr<RooWorkspace>>& wspace_vec,
1653 std::vector<std::string>
const& channel_names,
1654 std::string
const& dataSetName,
1659 std::unique_ptr<RooDataSet> simData;
1663 for(
unsigned int i = 0; i< channel_names.size(); ++i){
1666 cxcoutPHF <<
"Merging data for channel " << channel_names[i].c_str() << std::endl;
1668 if( !obsDataInChannel ) {
1669 std::cout <<
"Error: Can't find DataSet: " << dataSetName
1670 <<
" in channel: " << channel_names.at(i)
1676 auto tempData = std::make_unique<RooDataSet>(channel_names[i].c_str(),
"",
1677 obsList,
Index(*channelCat),
1679 Import(channel_names[i].c_str(),*obsDataInChannel));
1681 simData->append(*tempData);
1684 simData = std::move(tempData);
1691 combined->
import(*simData,
Rename(dataSetName.c_str()));
1695 std::cout <<
"Error: Unable to merge observable datasets" << std::endl;
1712 Int_t binNumber = 0;
1715 for(
Int_t i_bin = 0; i_bin < numBins; ++i_bin) {
1723 double histError = Nominal->
GetBinError( binNumber );
1726 if( histError != histError ) {
1727 std::cout <<
"Warning: In histogram " << Nominal->
GetName()
1728 <<
" bin error for bin " << i_bin
1729 <<
" is NAN. Not using Error!!!"
1737 if( histError < 0 ) {
1738 std::cout <<
"Warning: In histogram " << Nominal->
GetName()
1739 <<
" bin error for bin " << binNumber
1740 <<
" is < 0. Setting Error to 0"
1765 unsigned int numHists = HistVec.size();
1767 if( numHists == 0 ) {
1768 cxcoutE(
HistFactory) <<
"Warning: Empty Hist Vector, cannot create total uncertainty" << std::endl;
1772 const TH1* HistTemplate = HistVec.at(0).first;
1777 for(
unsigned int i = 0; i < HistVec.size(); ++i ) {
1779 const TH1* nominal = HistVec.at(i).first;
1780 const TH1* error = HistVec.at(i).second.get();
1792 std::vector<double> TotalBinContent( numBins, 0.0);
1793 std::vector<double> HistErrorsSqr( numBins, 0.0);
1795 Int_t binNumber = 0;
1798 for(
Int_t i_bins = 0; i_bins < numBins; ++i_bins) {
1805 for(
unsigned int i_hist = 0; i_hist < numHists; ++i_hist ) {
1807 const TH1* nominal = HistVec.at(i_hist).first;
1808 const TH1* error = HistVec.at(i_hist).second.get();
1823 if( histError != histError ) {
1825 <<
" bin error for bin " << binNumber
1826 <<
" is NAN. Not using error!!";
1830 TotalBinContent.at(i_bins) += histValue;
1831 HistErrorsSqr.at(i_bins) += histError*histError;
1843 for(
Int_t i = 0; i < numBins; ++i) {
1851 double ErrorsSqr = HistErrorsSqr.at(i);
1852 double TotalVal = TotalBinContent.at(i);
1854 if( TotalVal <= 0 ) {
1856 <<
" is <= 0. Setting error to 0"
1863 double RelativeError =
sqrt(ErrorsSqr) / TotalVal;
1867 if( RelativeError != RelativeError ) {
1869 <<
" HistErrorsSqr: " << ErrorsSqr
1870 <<
" TotalVal: " << TotalVal;
1884 <<
" Error = " <<
sqrt(ErrorsSqr)
1885 <<
" CentralVal = " << TotalVal
1886 <<
" RelativeError = " << RelativeError <<
"\n";
1890 return std::unique_ptr<TH1>(ErrorHist);
1926 if( numBins != numParams ) {
1927 std::cout <<
"Error: In createStatConstraintTerms, encountered bad number of bins" << std::endl;
1928 std::cout <<
"Given histogram with " << numBins <<
" bins,"
1929 <<
" but require exactly " << numParams << std::endl;
1933 Int_t TH1BinNumber = 0;
1945 <<
". Type of constraint: " <<
type << std::endl;
1949 const double sigmaRel = uncertHist->
GetBinContent(TH1BinNumber);
1953 if( sigmaRel <= 0 ){
1956 <<
" because sigma = " << sigmaRel
1958 <<
" (TH1 bin number = " << TH1BinNumber <<
")"
1960 gamma.setConstant(
true);
1965 gamma.setMax( 1 + 5*sigmaRel );
1969 std::string constrName = string(
gamma.GetName()) +
"_constraint";
1970 std::string nomName = string(
"nom_") +
gamma.GetName();
1971 std::string sigmaName = string(
gamma.GetName()) +
"_sigma";
1972 std::string poisMeanName = string(
gamma.GetName()) +
"_poisMean";
1980 RooConstVar constrSigma( sigmaName.c_str(), sigmaName.c_str(), sigmaRel );
1983 RooRealVar constrNom(nomName.c_str(), nomName.c_str(), 1.0,0,10);
1988 constrNom,
gamma, constrSigma );
1994 gamma.setError(sigmaRel);
1997 double tau = 1/sigmaRel/sigmaRel;
2000 RooRealVar constrNom(nomName.c_str(), nomName.c_str(), tau);
2005 std::string scalingName = string(
gamma.GetName()) +
"_tau";
2006 RooConstVar poissonScaling( scalingName.c_str(), scalingName.c_str(), tau);
2014 RooPoisson pois(constrName.c_str(), constrName.c_str(), constrNom, constrMean);
2018 if (std::string(
gamma.GetName()).find(
"gamma_stat") != std::string::npos) {
2021 gamma.setError(sigmaRel);
2026 std::cout <<
"Error: Did not recognize Stat Error constraint term type: "
2027 <<
type <<
" for : " << paramHist.
GetName() << std::endl;
2034 if( sigmaRel < minSigma ) {
2036 <<
" and is < " << minSigma
2037 <<
". Setting: " <<
gamma.GetName() <<
" to constant"
2039 gamma.setConstant(
true);
2042 constraintTermNames.push_back( constrName );
2043 ConstraintTerms.
add( *
proto->pdf(constrName) );
2050 if( ! globalSet->
contains(*nomVarInWorkspace) ) {
2051 globalSet->
add( *nomVarInWorkspace );
2056 return ConstraintTerms;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
A class which maps the current values of a RooRealVar (or a set of RooRealVars) to one of a number of...
const RooArgSet * get(Int_t masterIdx) const
void setConstant(bool constant)
const RooArgList & paramList() const
static RooArgList createParamSet(RooWorkspace &w, const std::string &, const RooArgList &Vars)
Create the list of RooRealVar parameters which represent the height of the histogram bins.
void setShape(TH1 *shape)
The PiecewiseInterpolation is a class that can morph distributions into each other,...
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
void Print(Option_t *options=nullptr) const override
Print the object to the defaultPrintStream().
void setAttribute(const Text_t *name, bool value=true)
Set (default) or clear a named boolean attribute of this object.
bool contains(const RooAbsArg &var) const
Check if collection contains an argument with the same name as var.
Int_t getSize() const
Return the number of elements in the collection.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Storage_t::size_type size() const
RooAbsData is the common abstract base class for binned and unbinned datasets.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
void setConstant(bool value=true)
RooNumIntConfig * specialIntegratorConfig() const
Returns the specialized integrator configuration for this RooAbsReal.
virtual void forceNumInt(bool flag=true)
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooBinWidthFunction is a class that returns the bin width (or volume) given a RooHistFunc.
Class RooBinning is an implements RooAbsBinning in terms of an array of boundary values,...
RooCategory is an object to represent discrete states.
bool setLabel(const char *label, bool printError=true) override
Set value by specifying the name of the desired state.
RooConstVar represent a constant real-valued object.
The RooDataHist is a container class to hold N-dimensional binned data.
RooDataSet is a container class to hold unbinned data.
void add(const RooArgSet &row, double weight, double weightError)
Add one ore more rows of data.
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Switches the message service to a different level while the instance is alive.
RooHistFunc implements a real-valued function sampled from a multidimensional histogram.
static RooMsgService & instance()
Return reference to singleton instance.
bool isActive(const RooAbsArg *self, RooFit::MsgTopic facility, RooFit::MsgLevel level)
Check if logging is active for given object/topic/RooFit::MsgLevel combination.
void setNoRounding(bool flag=true)
Switch off/on rounding of x to the nearest integer.
A RooProduct represents the product of a given set of RooAbsReal objects.
The class RooRealSumPdf implements a PDF constructed from a sum of functions:
RooRealVar represents a variable that can be changed from the outside.
void setVal(double value) override
Set value of variable to 'value'.
void setMin(const char *name, double value)
Set minimum of name range to given value.
static void SetPrintLevel(int level)
set print level (static function)
static RooAbsData * GenerateAsimovData(const RooAbsPdf &pdf, const RooArgSet &observables)
generate the asimov data for the observables (not the global ones) need to deal with the case of a si...
TODO Here, we are missing some documentation.
void ConfigureWorkspace(RooWorkspace *)
This class encapsulates all information for the statistical interpretation of one experiment.
std::vector< RooStats::HistFactory::Data > & GetAdditionalData()
retrieve vector of additional data objects
void Print(std::ostream &=std::cout)
HistFactory::StatErrorConfig & GetStatErrorConfig()
get information about threshold for statistical uncertainties and constraint term
RooStats::HistFactory::Data & GetData()
get data object
bool CheckHistograms() const
std::vector< RooStats::HistFactory::Sample > & GetSamples()
get vector of samples for this channel
std::string GetName() const
get name of channel
void setAllInterpCodes(int code)
This class provides helper functions for creating likelihood models from histograms.
std::unique_ptr< RooProduct > CreateNormFactor(RooWorkspace *proto, std::string &channel, std::string &sigmaEpsilon, Sample &sample, bool doRatio)
RooWorkspace * MakeSingleChannelModel(Measurement &measurement, Channel &channel)
RooWorkspace * MakeSingleChannelWorkspace(Measurement &measurement, Channel &channel)
void GuessObsNameVec(const TH1 *hist)
RooArgList createStatConstraintTerms(RooWorkspace *proto, std::vector< std::string > &constraintTerms, ParamHistFunc ¶mHist, const TH1 *uncertHist, Constraint::Type type, double minSigma)
std::unique_ptr< TH1 > MakeScaledUncertaintyHist(const std::string &Name, std::vector< std::pair< const TH1 *, std::unique_ptr< TH1 > > > const &HistVec) const
std::vector< std::string > fPreprocessFunctions
void SetFunctionsToPreprocess(std::vector< std::string > lines)
std::vector< std::string > fObsNameVec
RooHistFunc * MakeExpectedHistFunc(const TH1 *hist, RooWorkspace *proto, std::string prefix, const RooArgList &observables) const
Create the nominal hist function from hist, and register it in the workspace.
TH1 * MakeAbsolUncertaintyHist(const std::string &Name, const TH1 *Hist)
std::map< std::string, double > fParamValues
RooDataSet * MergeDataSets(RooWorkspace *combined, std::vector< std::unique_ptr< RooWorkspace > > &wspace_vec, std::vector< std::string > const &channel_names, std::string const &dataSetName, RooArgList const &obsList, RooCategory *channelCat)
static void ConfigureWorkspaceForMeasurement(const std::string &ModelName, RooWorkspace *ws_single, Measurement &measurement)
void MakeTotalExpected(RooWorkspace *proto, const std::string &totName, const std::vector< RooProduct * > &sampleScaleFactors, std::vector< std::vector< RooAbsArg * > > &sampleHistFuncs) const
void ConfigureHistFactoryDataset(RooDataSet &obsData, TH1 const &nominal, RooWorkspace &proto, std::vector< std::string > const &obsNameVec)
static void PrintCovarianceMatrix(RooFitResult *result, RooArgSet *params, std::string filename)
std::vector< std::string > fSystToFix
void AddConstraintTerms(RooWorkspace *proto, Measurement &measurement, std::string prefix, std::string interpName, std::vector< OverallSys > &systList, std::vector< std::string > &likelihoodTermNames, std::vector< std::string > &totSystTermNames)
RooArgList createObservables(const TH1 *hist, RooWorkspace *proto) const
Create observables of type RooRealVar. Creates 1 to 3 observables, depending on the type of the histo...
HistoToWorkspaceFactoryFast()
RooWorkspace * MakeCombinedModel(std::vector< std::string >, std::vector< std::unique_ptr< RooWorkspace > > &)
const std::string & GetName() const
The RooStats::HistFactory::Measurement class can be used to construct a model by combining multiple R...
std::map< std::string, double > & GetGammaSyst()
std::map< std::string, double > & GetLogNormSyst()
std::map< std::string, double > & GetNoSyst()
std::vector< std::string > & GetPOIList()
get vector of PoI names
std::map< std::string, double > & GetUniformSyst()
std::vector< std::string > & GetConstantParams()
get vector of all constant parameters
std::vector< RooStats::HistFactory::Channel > & GetChannels()
std::vector< RooStats::HistFactory::Asimov > & GetAsimovDatasets()
get vector of defined Asimov Datasets
std::vector< std::string > GetPreprocessFunctions() const
Returns a list of defined preprocess function expressions.
double GetLumi()
retrieve integrated luminosity
Configuration for an un- constrained overall systematic to scale sample normalisations.
std::string GetName() const
Configuration for a constrained overall systematic to scale sample normalisations.
const std::string & GetName() const
std::string GetName() const
get name of sample
std::vector< RooStats::HistFactory::NormFactor > & GetNormFactorList()
*Un*constrained bin-by-bin variation of affected histogram.
const TH1 * GetInitialShape() const
Constrained bin-by-bin variation of affected histogram.
Constraint::Type GetConstraintType() const
const TH1 * GetErrorHist() const
double GetRelErrorThreshold() const
Constraint::Type GetConstraintType() const
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
void GuessObsAndNuisance(const RooAbsData &data, bool printModelConfig=true)
Makes sensible guesses of observables, parameters of interest and nuisance parameters if one or multi...
virtual void SetParametersOfInterest(const RooArgSet &set)
Specify parameters of interest.
const RooArgSet * GetObservables() const
get RooArgSet for observables (return nullptr if not existing)
The RooWorkspace is a persistable container for RooFit projects.
TObject * obj(RooStringView name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name)
void Print(Option_t *opts=nullptr) const override
Print contents of the workspace.
RooAbsPdf * pdf(RooStringView name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
RooArgSet allVars() const
Return set with all variable objects.
bool import(const RooAbsArg &arg, 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())
Import a RooAbsArg object, e.g.
bool saveSnapshot(RooStringView, const char *paramNames)
Save snapshot of values and attributes (including "Constant") of given parameters.
bool importClassCode(const char *pat="*", bool doReplace=false)
Inport code of all classes in the workspace that have a class name that matches pattern 'pat' and whi...
RooFactoryWSTool & factory()
Return instance to factory tool.
RooRealVar * var(RooStringView name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found.
RooAbsData * data(RooStringView name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found.
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...
bool loadSnapshot(const char *name)
Load the values and attributes of the parameters in the snapshot saved with the given name.
bool defineSet(const char *name, const RooArgSet &aset, bool importMissing=false)
Define a named RooArgSet with given constituents.
const Double_t * GetArray() const
Class to manage histogram axis.
Bool_t IsVariableBinSize() const
const char * GetTitle() const override
Returns title of object.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
const TArrayD * GetXbins() const
TH1 is the base class of all histogram classes in ROOT.
virtual Int_t GetNbinsY() const
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
virtual Int_t GetNbinsZ() const
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual Int_t GetNbinsX() const
virtual void SetBinError(Int_t bin, Double_t error)
Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empt...
Bool_t IsBinUnderflow(Int_t bin, Int_t axis=0) const
Return true if the bin is underflow.
Bool_t IsBinOverflow(Int_t bin, Int_t axis=0) const
Return true if the bin is overflow.
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Mother of all ROOT objects.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
TString & ReplaceAll(const TString &s1, const TString &s2)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
RooCmdArg RecycleConflictNodes(bool flag=true)
RooCmdArg Rename(const char *suffix)
RooCmdArg Conditional(const RooArgSet &pdfSet, const RooArgSet &depSet, bool depsAreCond=false)
RooCmdArg Index(RooCategory &icat)
RooCmdArg WeightVar(const char *name="weight", bool reinterpretAsWeight=false)
RooCmdArg Import(const char *state, TH1 &histo)
double beta(double x, double y)
Calculates the beta function.
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Namespace for the RooStats classes.
static constexpr double gauss
bool binnedFitOptimization