42xRooNLLVar::xRooHypoSpace::xRooHypoSpace(
const char *
name,
const char *title)
45 if (
name ==
nullptr || strlen(
name) == 0) {
64 spaceSize *= (
v->getMax() -
v->getMin());
69 double ssize = spaceSize;
74 ssize /= (
v->getMax() -
v->getMin());
75 double remain = std::fmod(xVal, ssize);
76 v->setVal((xVal - remain) / ssize);
82 for (
auto &
p : *
this) {
83 for (
auto a : *
p.coords) {
84 if (!
fPars->find(
a->GetName()))
92 return pdf(toArgs(parValues));
101 std::shared_ptr<xRooNode> out =
nullptr;
103 for (
auto &[_range, _pdf] : fPdfs) {
106 bool collision =
true;
107 for (
auto &_lhs : *_range) {
108 auto _rhs = rhs.
find(*_lhs);
113 if (!(
v->getMin() <=
v2->getMax() &&
v2->getMin() <=
v->getMax())) {
118 if (!(
v->getMin() <=
c2->getVal() &&
c2->getVal() <=
v->getMax())) {
125 if (!(
c->getVal() <=
v2->getMax() &&
v2->getMin() <=
c->getVal())) {
130 if (!(
c->getVal() ==
c2->getVal())) {
139 throw std::runtime_error(
"Multiple pdf possibilities");
157 auto _idx = s.
Index(
'=');
166 _idx = _val.
Index(
',');
185 throw std::runtime_error(
"Unknown parameter");
186 _par->setAttribute(
"axis");
189 _par->setVal((high + low) * 0.5);
194 double step = (high - low) / (nPoints - 1);
196 throw std::runtime_error(
"Invalid steps");
198 for (
size_t i = 0; i < nPoints; i++) {
199 _par->setVal((i == nPoints - 1) ? high : (low + step * i));
207 if (axes().empty()) {
210 throw std::runtime_error(
"No POI to scan");
212 poi().first()->setAttribute(
"axis");
218 poi().setAttribAll(
"poi",
false);
219 axes().setAttribAll(
"poi");
226 const std::vector<double> &nSigmas,
double relUncert)
234 throw std::runtime_error(
"scan type must be equal to one of: plr, cls, ts, pnull");
238 if (axes().empty()) {
241 throw std::runtime_error(
"No POI to scan");
243 poi().first()->setAttribute(
"axis");
248 poi().setAttribAll(
"poi",
false);
249 axes().setAttribAll(
"poi");
251 auto p =
dynamic_cast<RooRealVar *
>(axes().first());
257 if (empty() && relUncert == std::numeric_limits<double>::infinity()) {
259 ::Info(
"xRooHypoSpace::scan",
"Using default precision of 10%% for auto-scan");
262 for (
auto a : axes()) {
263 if (!
a->hasRange(
"physical")) {
264 ::Info(
"xRooHypoSpace::scan",
"No physical range set for %s, setting to [0,inf]",
p->
GetName());
265 dynamic_cast<RooRealVar *
>(
a)->setRange(
"physical", 0, std::numeric_limits<double>::infinity());
267 if (!
a->getStringAttribute(
"altVal") || !strlen(
p->getStringAttribute(
"altVal"))) {
268 ::Info(
"xRooHypoSpace::scan",
"No altVal set for %s, setting to 0",
a->GetName());
269 a->setStringAttribute(
"altVal",
"0");
272 double altVal =
TString(
a->getStringAttribute(
"altVal")).
Atof();
274 if (
v->getMin() >= altVal) {
275 ::Info(
"xRooHypoSpace::scan",
"range of POI does not straddle alt value, adjusting minimum to %g",
277 v->setMin(altVal - 1
e-5);
279 if (
v->getMax() <= altVal) {
280 ::Info(
"xRooHypoSpace::scan",
"range of POI does not straddle alt value, adjusting maximum to %g",
282 v->setMax(altVal + 1
e-5);
284 for (
auto &[
pdf, nll] : fNlls) {
285 if (
auto _v =
dynamic_cast<RooRealVar *
>(nll->pars()->find(*
a))) {
286 _v->setRange(
v->getMin(),
v->getMax());
296 if (
p && high <= low) {
298 low =
p->getMin(
"scan");
299 high =
p->getMax(
"scan");
300 ::Info(
"xRooHypoSpace::scan",
"Using %s range: %g - %g",
p->
GetName(), low, high);
302 if (!std::isnan(low) && !std::isnan(high) && !(std::isinf(low) && std::isinf(high))) {
303 p->setRange(
"scan", low, high);
307 for (
auto nSigma : nSigmas) {
308 if (std::isnan(nSigma)) {
317 relUncert = std::numeric_limits<double>::infinity();
326#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 26, 00)
346 for (
auto file : *
gROOT->GetListOfFiles()) {
353 new TMemFile(
"fitDatabase",
"RECREATE");
362 for (
double nSigma : nSigmas) {
364 if (std::isnan(nSigma)) {
372 if (std::isnan(res.first) || std::isnan(res.second))
374 else if (std::isinf(res.second))
378 throw std::runtime_error(
TString::Format(
"Automatic scanning not yet supported for %s",
type));
386 double step = (high - low) / (nPoints - 1);
387 for (
size_t i = 0; i < nPoints; i++) {
400std::map<std::string, std::pair<double, double>>
407 relUncert = std::numeric_limits<double>::infinity();
410 scan(opt, nSigmas, relUncert);
412 std::map<std::string, std::pair<double, double>> out;
413 for (
auto nSigma : nSigmas) {
414 auto lim = limit(opt, nSigma);
416 lim.second = -lim.second;
434 auto _idx = s.
Index(
'=');
439 auto _v =
dynamic_cast<RooRealVar *
>(fPars->find(_name));
445 _v->setVal(_val.
Atof());
452 throw std::runtime_error(
"no model at coordinates");
459 if (fNlls.find(_pdf) == fNlls.end()) {
460 fNlls[_pdf] = std::make_shared<xRooNLLVar>(_pdf->nll(
"" , {}));
465 out.nllVar = fNlls[_pdf];
466 out.fData = fNlls[_pdf]->getData();
467 out.isExpected =
dynamic_cast<RooDataSet *
>(out.fData.first.get()) &&
468 dynamic_cast<RooDataSet *
>(out.fData.first.get())->weightVar()->getAttribute(
"expected");
471 out.coords.reset(fPars->snapshot());
473 out.poi().setAttribAll(
"Constant");
480 ->remove(*std::unique_ptr<RooAbsCollection>(out.coords->selectByAttrib(
"Constant",
false)),
true,
true);
482 double value = out.fNullVal();
483 double alt_value = out.fAltVal();
485 auto _type = fTestStatType;
488 if (std::isnan(alt_value))
490 else if (
value >= alt_value)
496 out.fPllType = _type;
499 for (
auto &
p : *
this) {
500 if (
p.nllVar != out.nllVar)
502 if (
p.fData != out.fData)
504 if (!
p.alt_poi().equals(out.alt_poi()))
507 for (
auto c :
p.alt_poi()) {
509 v && std::abs(
v->getVal() - out.alt_poi().getRealValue(
v->GetName())) > 1
e-12) {
516 if (!
p.coords->equals(*out.coords))
518 for (
auto c : *
p.coords) {
519 if (
c->getAttribute(
"poi")) {
523 v && std::abs(
v->getVal() - out.coords->getRealValue(
v->GetName())) > 1
e-12) {
532 if (
auto cfit =
p.cfit_alt(
true)) {
533 out.fAlt_cfit = cfit;
535 if (
p.asimov(
true) &&
p.asimov(
true)->fData.first && (!out.asimov(
true) || !out.asimov(
true)->fData.first)) {
536 out.asimov()->fData =
p.asimov(
true)->fData;
538 if (!
p.poi().equals(out.poi()))
540 for (
auto c :
p.poi()) {
542 v && std::abs(
v->getVal() - out.poi().getRealValue(
v->GetName())) > 1
e-12) {
553 std::string coordString;
554 for (
auto a : axes()) {
555 coordString +=
TString::Format(
"%s=%g",
a->GetName(), out.coords->getRealValue(
a->GetName()));
558 coordString.erase(coordString.end() - 1);
560 ::Info(
"xRooHypoSpace::AddPoint",
"Added new point @ %s", coordString.c_str());
561 return emplace_back(out);
568 throw std::runtime_error(
"Not a pdf");
574 auto vpars = toArgs(validity);
576 vpars.remove(
pars,
true,
true);
579 if (
auto existing =
pdf(
pars)) {
580 throw std::runtime_error(std::string(
"Clashing model: ") + existing->GetName());
583 auto myPars = std::shared_ptr<RooArgList>(
dynamic_cast<RooArgList *
>(
pars.snapshot()));
586 pars.remove(*fPars,
true,
true);
588 fPars->addClone(
pars);
590 fPdfs.insert(std::make_pair(myPars, std::make_shared<xRooNode>(_pdf)));
601 out.add(*std::unique_ptr<RooAbsCollection>(
602 fPars->selectByAttrib(
"axis",
true)));
608 std::set<std::vector<double>> coords;
609 for (
auto &
p : *
this) {
610 std::vector<double> p_coords;
612 auto _v =
dynamic_cast<RooRealVar *
>(
p.coords->find(o->GetName()));
614 (_v && _v->isConstant())
616 : std::numeric_limits<double>::infinity());
619 if (coords.find(p_coords) != coords.end()) {
623 coords.insert(p_coords);
628 std::map<std::string, std::unordered_set<double>> values;
629 for (
auto &par : *
pars()) {
632 for (
auto p : *
this) {
633 auto _v =
dynamic_cast<RooRealVar *
>(
p.coords->find(par->GetName()));
634 values[par->GetName()].insert(
635 (_v && _v->isConstant())
637 : std::numeric_limits<double>::infinity());
646 for (
auto &[k,
v] : values) {
647 if (
v.size() > maxDiff || (
v.size() == maxDiff && !isPOI &&
pars()->find(k.c_str())->getAttribute(
"poi"))) {
649 isPOI =
pars()->find(k.c_str())->getAttribute(
"poi");
650 maxDiff = std::max(maxDiff,
v.size());
653 if (bestVar.empty()) {
657 out.add(*
pars()->find(bestVar.c_str()));
662 std::unique_ptr<RooAbsCollection> poi(out.selectByAttrib(
"poi",
true));
673 out.add(*std::unique_ptr<RooAbsCollection>(
pars()->selectByAttrib(
"poi",
true)));
697 Error(
"LoadFits",
"Path not found %s", apath);
707 std::map<std::set<std::tuple<std::string, double, std::string>>, std::set<std::set<std::string>>> cfits;
708 std::set<std::string> allpois;
713 std::cout <<
"Processing " << _dir->GetName() << std::endl;
714 if (
auto keys = _dir->GetListOfKeys(); keys) {
717 bool isNllDir =
false;
718 for (
auto &&k : *keys) {
719 TKey *key =
dynamic_cast<TKey *
>(k);
720 if (strcmp(key->
GetClassName(),
"RooLinkedList") == 0) {
726 for (
auto &&k : *keys) {
727 if (
auto subdir = _dir->GetDirectory(k->GetName()); subdir) {
729 LoadFits(subdir->GetPath());
736 if (cl->InheritsFrom(
"RooFitResult")) {
741 std::unique_ptr<RooAbsCollection> snap(cachedFit->floatParsFinal().snapshot());
742 snap->remove(*fPars,
true,
true);
743 fPars->addClone(*snap);
745 for (
auto &
p : cachedFit->constPars()) {
746 if (
p->getAttribute(
"global"))
752 if (!fPars->contains(*
v))
757 std::set<std::string> floatPars;
758 for (
auto &
p : cachedFit->floatParsFinal())
763 std::set<std::tuple<std::string, double, std::string>> constPars;
764 for (
auto &
p : cachedFit->constPars()) {
765 if (
p->getAttribute(
"global"))
772 std::make_tuple(
v->GetName(),
v->getVal(),
773 v->getStringAttribute(
"altVal") ?
v->getStringAttribute(
"altVal") :
""));
776 for (
auto &&[key,
value] : cfits) {
777 if (constPars == key)
779 if (std::includes(constPars.begin(), constPars.end(), key.begin(), key.end())) {
783 std::set<std::string> pois;
784 for (
auto &&par : constPars) {
785 if (key.find(par) == key.end()) {
786 pois.insert(std::get<0>(par));
787 allpois.insert(std::get<0>(par));
791 cfits[constPars].insert(pois);
826 ::Info(
"xRooHypoSpace::xRooHypoSpace",
"%s - Loaded %d fits", apath, nFits);
828 if (allpois.size() == 1) {
829 ::Info(
"xRooHypoSpace::xRooHypoSpace",
"Detected POI: %s", allpois.begin()->c_str());
831 auto nll = std::make_shared<xRooNLLVar>(
nullptr,
nullptr);
832 auto dummyNll = std::make_shared<RooRealVar>(apath,
"Dummy NLL", std::numeric_limits<double>::quiet_NaN());
833 nll->std::shared_ptr<
RooAbsReal>::operator=(dummyNll);
837 for (
auto &&
p : *fPars) {
842 for (
auto &
p : allpois) {
843 fPars->find(
p.c_str())->setAttribute(
"poi",
true);
848 for (
auto &&[key,
value] : cfits) {
851 auto _coords = std::make_shared<RooArgSet>();
852 for (
auto &k : key) {
853 auto v = _coords->addClone(
RooRealVar(std::get<0>(k).c_str(), std::get<0>(k).c_str(), std::get<1>(k)));
854 v->setAttribute(
"poi", allpois.find(std::get<0>(k)) != allpois.end());
855 if (!std::get<2>(k).empty()) {
856 v->setStringAttribute(
"altVal", std::get<2>(k).c_str());
881 }
else if (nFits > 0) {
882 std::cout <<
"possible POI: ";
883 for (
auto p : allpois)
884 std::cout <<
p <<
",";
885 std::cout << std::endl;
896 for (
size_t i = 0; i <
size(); i++) {
897 std::cout << i <<
") ";
898 for (
auto a : _axes) {
899 if (
a != _axes.first())
901 std::cout <<
a->GetName() <<
"="
902 << at(i).coords->getRealValue(
a->GetName(), std::numeric_limits<double>::quiet_NaN());
904 std::cout <<
" status=[ufit:";
909 std::cout << ufit->
status();
912 std::cout <<
",cfit_null:";
913 auto cfit =
const_cast<xRooHypoPoint &
>(at(i)).cfit_null(
true);
917 std::cout << cfit->
status();
920 std::cout <<
",cfit_alt:";
921 auto afit =
const_cast<xRooHypoPoint &
>(at(i)).cfit_alt(
true);
925 std::cout << afit->
status();
928 if (
auto asiPoint =
const_cast<xRooHypoPoint &
>(at(i)).asimov(
true)) {
929 std::cout <<
",asimov.ufit:";
930 auto asi_ufit = asiPoint->ufit(
true);
934 std::cout << asi_ufit->status();
937 std::cout <<
",asimov.cfit_null:";
938 auto asi_cfit = asiPoint->cfit_null(
true);
942 std::cout << asi_cfit->status();
947 auto sigma_mu =
const_cast<xRooHypoPoint &
>(at(i)).sigma_mu(
true);
948 if (!std::isnan(sigma_mu.first)) {
949 std::cout <<
" sigma_mu=" << sigma_mu.first;
951 std::cout <<
" +/- " << sigma_mu.second;
953 std::cout << std::endl;
955 std::cout <<
"--------------------------" << std::endl;
956 std::cout <<
"Number of bad fits: " << badFits << std::endl;
960 const char *opt )
const
967 bool readOnly = sOpt.
Contains(
"readonly");
968 bool visualize = sOpt.
Contains(
"visualize") && !readOnly;
975 : std::numeric_limits<double>::quiet_NaN();
977 !std::isnan(nSigma) && nSigma && !(sOpt(sOpt.
Index(
"exp") + 3) ==
'+' || sOpt(sOpt.
Index(
"exp") + 3) ==
'-');
980 if (_axes.size() != 1)
983 auto out = std::make_shared<TGraphErrors>();
984 out->SetName(GetName());
985 out->SetEditable(
false);
986 const char *sCL = (doCLs) ?
"CLs" :
"null";
992 : (!nSigma ?
"Expected"
994 expBand || !nSigma ?
"" : ((nSigma < 0) ?
"-" :
"+"),
int(nSigma))
996 _axes.at(0)->GetTitle(), sCL);
998 if (std::isnan(nSigma)) {
1000 out->SetMarkerStyle(20);
1001 out->SetMarkerSize(0.5);
1003 out->SetNameTitle(
"obs_ts",
TString::Format(
"Observed;%s;%s", _axes.at(0)->GetTitle(),
1004 (empty() ?
"" : front().tsTitle(
true).Data())));
1006 out->SetNameTitle(
TString::Format(
"exp%d_p%s",
int(nSigma), sCL), title);
1007 out->SetMarkerStyle(0);
1008 out->SetMarkerSize(0);
1009 out->SetLineStyle(2 +
int(nSigma));
1010 if (expBand && nSigma) {
1013 out->SetLineStyle(0);
1014 out->SetLineWidth(0);
1015 auto x = out->Clone(
"up");
1019 out->GetListOfFunctions()->Add(
x,
"F");
1020 x = out->Clone(
"down");
1024 out->GetListOfFunctions()->Add(
x,
"F");
1028 TString::Format(
"Expected;%s;%s", _axes.at(0)->GetTitle(), front().tsTitle(
true).Data()));
1031 auto badPoints = [&]() {
1032 auto badPoints2 =
dynamic_cast<TGraph *
>(out->GetListOfFunctions()->FindObject(
"badPoints"));
1036 badPoints2->SetName(
"badPoints");
1037 badPoints2->SetMarkerStyle(5);
1038 badPoints2->SetMarkerColor(std::isnan(nSigma) ?
kRed :
kBlue);
1039 badPoints2->SetMarkerSize(1);
1040 out->GetListOfFunctions()->Add(badPoints2,
"P");
1044 int nPointsDown = 0;
1049 for (
auto &
p : *
this) {
1053 auto gra =
graph(sOpt +
" readOnly");
1054 if (gra && gra->GetN()) {
1056 gROOT->GetSelectedPad()->cd();
1059 gra->DrawClone(expBand ?
"AF" :
"ALP")->SetBit(
kCanDelete);
1060#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1061 if (
auto pad =
gROOT->GetSelectedPad()) {
1062 pad->GetCanvas()->ResetUpdated();
1068 ::Info(
"xRooHypoSpace::graph",
"Completed %d/%d points for %s",
int(nDone),
int(
size()), sOpt.
Data());
1074 double _x =
p.coords->getRealValue(_axes.at(0)->GetName(), std::numeric_limits<double>::quiet_NaN());
1076 auto idx = out->GetN() - nPointsDown;
1078 if (std::isnan(pval.first)) {
1079 if (
p.status() != 0) {
1080 badPoints()->SetPoint(badPoints()->GetN(), _x, 0);
1083 out->InsertPointBefore(idx, _x, pval.first);
1084 out->SetPointError(idx, 0, pval.second);
1087 if (expBand && nSigma) {
1091 if (std::isnan(pval.first)) {
1092 if (
p.status() != 0) {
1093 badPoints()->SetPoint(badPoints()->GetN(), _x, 0);
1096 out->InsertPointBefore(idx + 1, _x, pval.first);
1097 out->SetPointError(idx + 1, 0, pval.second);
1099 if (out->GetPointY(idx) < pval.first)
1106 if (out->GetN() == 0)
1111 if (out->GetListOfFunctions()->FindObject(
"badPoints")) {
1113 for (
int i = 0; i < badPoints()->GetN(); i++) {
1114 badPoints()->SetPointY(i, out->Eval(badPoints()->GetPointX(i)));
1119 out->Sort(&
TGraph::CompareX,
false, out->GetN() - nPointsDown, out->GetN() - 1);
1122 auto up =
dynamic_cast<TGraph *
>(out->GetListOfFunctions()->FindObject(
"up"));
1123 auto down =
dynamic_cast<TGraph *
>(out->GetListOfFunctions()->FindObject(
"down"));
1125 for (
int i = 0; i < out->GetN(); i++) {
1126 if (i < out->GetN() - nPointsDown) {
1127 up->
SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) + out->GetErrorY(i) * (above ? 1. : -1.));
1128 down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
1130 up->SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
1131 down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) + out->GetErrorY(i) * (above ? 1. : -1.));
1139 gROOT->GetSelectedPad()->cd();
1142 out->DrawClone(expBand ?
"AF" :
"ALP")->SetBit(
kCanDelete);
1143#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1144 if (
auto pad =
gROOT->GetSelectedPad()) {
1145 pad->GetCanvas()->ResetUpdated();
1158 std::shared_ptr<TMultiGraph> out;
1161 bool visualize = sOpt.
Contains(
"visualize");
1164 auto exp2 =
graph(sOpt +
" exp2");
1165 auto exp1 =
graph(sOpt +
" exp1");
1166 auto exp =
graph(sOpt +
" exp");
1169 auto obs = (doObs) ?
graph(sOpt) :
nullptr;
1171 out = std::make_shared<TMultiGraph>(GetName(), GetTitle());
1172 if (exp2 && exp2->GetN() > 1)
1173 out->Add(
static_cast<TGraph *
>(exp2->Clone()),
"FP");
1174 if (exp1 && exp1->GetN() > 1)
1175 out->Add(
static_cast<TGraph *
>(exp1->Clone()),
"FP");
1176 if (exp && exp->GetN() > 1)
1177 out->Add(
static_cast<TGraph *
>(exp->Clone()),
"LP");
1178 if (obs && obs->GetN() > 1)
1179 out->Add(
static_cast<TGraph *
>(obs->Clone()),
"LP");
1181 if (!out->GetListOfGraphs()) {
1185 TGraph *testedPoints =
nullptr;
1188 line->SetName(
"alpha");
1190 line->SetEditable(
false);
1191 line->SetPoint(
line->GetN(), out->GetHistogram()->GetXaxis()->GetXmin() - 10, 0.05);
1192 testedPoints =
new TGraph;
1193 testedPoints->
SetName(
"hypoPoints");
1198 for (
int i = 0; i < exp->GetN(); i++) {
1199 testedPoints->
SetPoint(testedPoints->
GetN(), exp->GetPointX(i), 0.05);
1202 line->SetPoint(
line->GetN(), out->GetHistogram()->GetXaxis()->GetXmax() + 10, 0.05);
1204 out->GetListOfFunctions()->Add(
line,
"L");
1207 out->GetHistogram()->GetXaxis()->SetTitle(exp->GetHistogram()->GetXaxis()->GetTitle());
1208 out->GetHistogram()->GetYaxis()->SetTitle(exp->GetHistogram()->GetYaxis()->GetTitle());
1212 leg->SetName(
"legend");
1215 out->GetListOfFunctions()->Add(
leg);
1218 for (
auto g : *out->GetListOfGraphs()) {
1220 leg->AddEntry(o,
"",
"F");
1222 leg->AddEntry(
g,
"",
"LPE");
1228 if (exp2 && exp2->GetN() > 1) {
1232 if (exp1 && exp1->GetN() > 1) {
1236 if (exp && exp->GetN() > 1) {
1240 if (exp1 && exp1->GetN() > 1) {
1244 if (exp2 && exp2->GetN() > 1) {
1248 if (obs && obs->GetN() > 1) {
1254 out->Add(testedPoints,
"P");
1258 gROOT->GetSelectedPad()->cd();
1261 auto gra2 =
static_cast<TMultiGraph *
>(out->DrawClone(
"A"));
1264 gra2->GetHistogram()->SetMinimum(1
e-6);
1268 gPad->GetCanvas()->Paint();
1269 gPad->GetCanvas()->Update();
1270#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1271 gPad->GetCanvas()->ResetUpdated();
1284 if (std::isnan(
target)) {
1288 auto gr = std::make_shared<TGraph>(pValues);
1291 std::set<double> existingX;
1292 while (i < gr->GetN()) {
1295 else if (existingX.find(
gr->
GetPointX(i)) != existingX.end()) {
1309 return std::pair(std::numeric_limits<double>::quiet_NaN(), 0);
1312 double alpha = log(
target);
1315 for (
int ii = 1; ii <
gr->
GetN(); ii++) {
1326 return std::pair(lim, err);
1341 return std::pair(std::numeric_limits<double>::infinity(), std::numeric_limits<double>::infinity());
1342 return std::pair((alpha -
y1) /
m +
x1, std::numeric_limits<double>::infinity());
1349 return std::pair(-std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity());
1350 return std::pair((alpha -
y1) /
m +
x1, -std::numeric_limits<double>::infinity());
1357 if (std::isnan(nSigma)) {
1362 return GetLimit(*
graph(sOpt +
" readonly"));
1369 bool visualize = sOpt.
Contains(
"visualize");
1371 std::shared_ptr<TGraphErrors>
gr =
graph(sOpt +
" readonly");
1373 auto gra = graphs(sOpt.
Contains(
"toys") ?
"pcls readonly toys" :
"pcls readonly");
1380 gra->GetHistogram()->SetMinimum(1
e-9);
1381 gra->GetHistogram()->GetYaxis()->SetRangeUser(1
e-9, 1);
1383#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1384 gPad->GetCanvas()->ResetUpdated();
1391 for (
auto p : axes()) {
1392 for (
auto &[
pdf, nll] : fNlls) {
1393 if (
auto _v =
dynamic_cast<RooRealVar *
>(nll->pars()->find(*
p))) {
1394 dynamic_cast<RooRealVar *
>(
p)->setRange(_v->getMin(), _v->getMax());
1400 auto v = (axes().empty()) ?
nullptr :
dynamic_cast<RooRealVar *
>(*axes().rbegin());
1402 return std::pair(std::numeric_limits<double>::quiet_NaN(), 0.);
1403 double muMax = std::min(std::min(
v->getMax(
"physical"),
v->getMax()),
v->getMax(
"scan"));
1404 double muMin = std::max(std::max(
v->getMin(
"physical"),
v->getMin()),
v->getMin(
"scan"));
1406 if (maxTries == 0 || std::isnan(AddPoint(
TString::Format(
"%s=%g",
v->GetName(), muMin)).getVal(sOpt).first)) {
1408 Error(
"findlimit",
"Problem evaluating %s @ %s=%g", sOpt.
Data(),
v->GetName(), muMin);
1409 return std::pair(std::numeric_limits<double>::quiet_NaN(), 0.);
1412 return findlimit(opt, relUncert, maxTries - 1);
1419 double nextPoint = muMin + (muMax - muMin) / 50;
1425 auto expLim = findlimit(sOpt2, std::numeric_limits<double>::infinity(), 0);
1426 if (!std::isnan(expLim.first) && expLim.first < nextPoint)
1427 nextPoint = expLim.first;
1431 (sOpt.
Contains(
"exp")) ? back().asimov() : std::shared_ptr<xRooHypoPoint>(&back(), [](
xRooHypoPoint *) {});
1433 if (point && point->ufit()) {
1434 double rough_sigma_mu = point->mu_hat().getError();
1437 nextPoint = another_estimate;
1438 ::Info(
"xRooHypoSpace::findlimit",
"Guessing %g based on rough sigma_mu = %g", nextPoint, rough_sigma_mu);
1442 if (maxTries == 0 || std::isnan(AddPoint(
TString::Format(
"%s=%g",
v->GetName(), nextPoint)).getVal(sOpt).first)) {
1444 Error(
"findlimit",
"Problem evaluating %s @ %s=%g", sOpt.
Data(),
v->GetName(), nextPoint);
1445 return std::pair(std::numeric_limits<double>::quiet_NaN(), 0.);
1448 return findlimit(opt, relUncert, maxTries - 1);
1451 auto lim = GetLimit(*
gr);
1453 if (std::isnan(lim.first)) {
1457 auto v =
dynamic_cast<RooRealVar *
>(*axes().rbegin());
1458 double maxMu = std::min(std::min(
v->getMax(
"physical"),
v->getMax()),
v->getMax(
"scan"));
1459 double minMu = std::max(std::max(
v->getMin(
"physical"),
v->getMin()),
v->getMin(
"scan"));
1462 if (lim.first > -std::numeric_limits<double>::infinity() && lim.first < std::numeric_limits<double>::infinity() &&
1463 (std::abs(lim.second) <= relUncert * std::abs(lim.first) ))
1468 if (lim.second == std::numeric_limits<double>::infinity()) {
1470 nextPoint = lim.first;
1471 if (nextPoint == std::numeric_limits<double>::infinity() || nextPoint > maxMu) {
1478 (sOpt.
Contains(
"exp")) ? back().asimov() : std::shared_ptr<xRooHypoPoint>(&back(), [](
xRooHypoPoint *) {});
1480 if (point && point->ufit()) {
1481 double rough_sigma_mu = point->mu_hat().getError();
1484 nextPoint = std::max(nextPoint, another_estimate);
1485 ::Info(
"xRooHypoSpace::findlimit",
"Guessing %g based on rough sigma_mu = %g", nextPoint, rough_sigma_mu);
1488 nextPoint = std::min(nextPoint + nextPoint * relUncert * 0.99, maxMu);
1490 if (nextPoint > maxMu)
1492 }
else if (lim.second == -std::numeric_limits<double>::infinity()) {
1494 nextPoint = lim.first;
1495 if (nextPoint < minMu)
1496 nextPoint =
gr->
GetPointX(0) - (maxMu - minMu) / 50;
1497 if (nextPoint < minMu)
1500 nextPoint = lim.first + lim.second * relUncert * 0.99;
1506 ::Info(
"xRooHypoSpace::findlimit",
"%s -- Testing new point @ %s=%g (delta=%g)", sOpt.
Data(),
v->GetName(),
1507 nextPoint, lim.second);
1508 if (maxTries == 0 || std::isnan(AddPoint(
TString::Format(
"%s=%g",
v->GetName(), nextPoint)).getVal(sOpt).first)) {
1509 if (maxTries == 0) {
1510 Warning(
"findlimit",
"Reached max number of point evaluations");
1512 Error(
"findlimit",
"Problem evaluating %s @ %s=%g", sOpt.
Data(),
v->GetName(), nextPoint);
1517 return findlimit(opt, relUncert, maxTries - 1);
1526 if ((sOpt ==
"" || sOpt ==
"same") && !empty()) {
1529 for (
auto &hp : *
this) {
1530 if (hp.nullToys.size() || hp.altToys.size()) {
1541 auto _axes = axes();
1545 if (sOpt ==
"status") {
1547 if (_axes.size() <= 2) {
1550 out->SetName(
"points");
1551 out->SetMarkerSize(0.5);
1562 badPoints->
SetName(
"bad_ufit");
1568 badPoints2->
SetName(
"bad_cfit_null");
1574 out->SetTitle(
TString::Format(
"%s;%s;%s", GetTitle(), _axes.at(0)->GetTitle(),
1575 (_axes.size() == 1) ?
"" : _axes.at(1)->GetTitle()));
1576 for (
auto &
p : *
this) {
1577 bool _readOnly =
p.nllVar ?
p.nllVar->get()->getAttribute(
"readOnly") :
false;
1579 p.nllVar->get()->setAttribute(
"readOnly",
true);
1580 double x =
p.coords->getRealValue(_axes.at(0)->GetName());
1581 double y = _axes.size() == 1 ?
p.ts_asymp().first :
p.coords->getRealValue(_axes.at(1)->GetName());
1582 out->SetPoint(out->GetN(),
x,
y);
1583 if (!std::isnan(
p.ts_asymp().first)) {
1584 if (_axes.size() == 1)
1585 out->SetPointError(out->GetN() - 1, 0,
p.ts_asymp().second);
1587 }
else if (
p.fUfit && (std::isnan(
p.fUfit->minNll()) ||
1591 }
else if (
p.fNull_cfit && (std::isnan(
p.fNull_cfit->minNll()) ||
1596 if (!std::isnan(
p.ts_asymp(0).first)) {
1598 }
else if (
p.asimov() &&
p.asimov()->fUfit &&
1599 (std::isnan(
p.asimov()->fUfit->minNll()) ||
1603 }
else if (
p.asimov() &&
p.asimov()->fNull_cfit &&
1604 (std::isnan(
p.asimov()->fNull_cfit->minNll()) ||
1609 p.nllVar->get()->setAttribute(
"readOnly", _readOnly);
1612 if (_axes.size() == 1) {
1614 for (
int i = 0; i < out->GetN(); i++) {
1615 if (!std::isnan(out->GetPointY(i)))
1616 tmp.
SetPoint(tmp.
GetN(), out->GetPointX(i), out->GetPointY(i));
1618 auto fixPoints = [&](
TGraph *
g) {
1619 for (
int i = 0; i <
g->GetN(); i++) {
1620 if (std::isnan(
g->GetPointY(i)))
1621 g->SetPointY(i, std::isnan(tmp.
Eval(
g->GetPointX(i))) ? 0. : tmp.
Eval(
g->GetPointX(i)));
1626 fixPoints(expAvail);
1627 fixPoints(badPoints);
1628 fixPoints(badPoints2);
1631 out->SetMarkerStyle(4);
1633 auto leg =
new TLegend(1. -
gPad->GetRightMargin() - 0.3, 1. -
gPad->GetTopMargin() - 0.35,
1634 1. -
gPad->GetRightMargin() - 0.05, 1. -
gPad->GetTopMargin() - 0.05);
1635 leg->SetName(
"legend");
1636 leg->AddEntry(out,
"Uncomputed",
"P");
1638 if (tsAvail->
GetN()) {
1639 out->GetListOfFunctions()->Add(tsAvail,
"P");
1640 leg->AddEntry(tsAvail,
"Computed",
"P");
1644 if (expAvail->
GetN()) {
1645 out->GetListOfFunctions()->Add(expAvail,
"P");
1646 leg->AddEntry(expAvail,
"Expected computed",
"P");
1650 if (badPoints->
GetN()) {
1651 out->GetListOfFunctions()->Add(badPoints,
"P");
1652 leg->AddEntry(badPoints,
"Bad ufit",
"P");
1656 if (badPoints2->
GetN()) {
1657 out->GetListOfFunctions()->Add(badPoints2,
"P");
1658 leg->AddEntry(badPoints2,
"Bad null cfit",
"P");
1665 gPad->SetGrid(
true, _axes.size() > 1);
1666 if (_axes.size() == 1)
1667 gPad->SetLogy(
false);
1676 auto gra = graphs(sOpt +
" readonly");
1678 gROOT->GetSelectedPad()->cd();
1686 gra2->GetHistogram()->SetMinimum(1
e-6);
1690 gPad->GetCanvas()->Paint();
1691 gPad->GetCanvas()->Update();
1692#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1693 gPad->GetCanvas()->ResetUpdated();
1714 out->SetName(GetName());
1719 if (!empty() && axes().
size() == 1) {
1720 for (
auto &
p : *
this) {
1722 pllType =
p.fPllType;
1726 title += front().tsTitle(
true);
1729 out->SetTitle(title);
1730 *
dynamic_cast<TAttFill *
>(out) = *
this;
1731 *
dynamic_cast<TAttLine *
>(out) = *
this;
1741 bool doFits =
false;
1747 auto mainPad =
gPad;
1749 out->SetEditable(
false);
1754 gPad->SetBottomMargin(
gPad->GetBottomMargin() * 2.);
1758 mainPad = basePad->
GetPad(1);
1764 std::pair<double, double> minMax(std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity());
1765 for (
auto &
p : *
this) {
1766 if (
p.fPllType != pllType)
1768 auto val =
p.pll(
true).first;
1769 if (std::isnan(val))
1771 minMax.first = std::min(minMax.first, val);
1772 minMax.second = std::max(minMax.second, val);
1774 if (minMax.first < std::numeric_limits<double>::infinity())
1775 out->GetHistogram()->SetMinimum(minMax.first);
1776 if (minMax.second > -std::numeric_limits<double>::infinity())
1777 out->GetHistogram()->SetMaximum(minMax.second);
1779 TGraph *badPoints =
nullptr;
1783 std::shared_ptr<const RooFitResult> ufr;
1784 for (
auto &
p : *
this) {
1785 if (
p.fPllType != pllType)
1787 auto val =
p.pll().first;
1790 if (out->GetN() == 0 && ufr && ufr->status() == 0) {
1791 out->SetPoint(out->GetN(),
1792 ufr->floatParsFinal().getRealValue(axes().
first()->GetName(),
1793 ufr->constPars().getRealValue(axes().
first()->GetName())),
1795 out->SetPointError(out->GetN() - 1, 0, ufr->edm());
1797 if (
auto fr =
p.fNull_cfit;
1803 pad->SetNumber(out->GetN() + 1);
1810 if (std::isnan(val) &&
p.status() != 0) {
1814 badPoints->
SetName(
"badPoints");
1818 out->GetListOfFunctions()->Add(badPoints,
"P");
1820 badPoints->
SetPoint(badPoints->
GetN(),
p.fNullVal(), out->Eval(
p.fNullVal()));
1821 mainPad->Modified();
1822 }
else if (!std::isnan(val)) {
1823 out->SetPoint(out->GetN(),
p.coords->getRealValue(axes().
first()->GetName()),
p.pll().first);
1824 out->SetPointError(out->GetN() - 1, 0,
p.pll().second);
1829 for (
int i = 0; i < badPoints->
GetN(); i++)
1833 mainPad->Modified();
1846#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1852 if (ufr && doFits) {
1854 auto pad =
new TPad(ufr->GetName(),
"unconditional fit", 0, 0, 1., 1.);
1862 pad =
new TPad(
"selected",
"selected", 0, 0, 1, 1);
1877 gPad->GetCanvas()->
Connect(
"Highlighted(TVirtualPad*,TObject*,Int_t,Int_t)",
"xRooNode::InteractiveObject",
1889 auto _axes = axes();
1894 out->SetTitle(GetTitle());
1896 for (
auto &
p : *
this) {
1897 double _x =
p.coords->getRealValue(_axes.at(0)->GetName(), std::numeric_limits<double>::quiet_NaN());
1898 out->Add(_x,
p.result());
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t SetFillStyle
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 offset
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 target
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 value
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t SetFillColor
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
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TStyle * gStyle
R__EXTERN TSystem * gSystem
static std::pair< double, double > matchPrecision(const std::pair< double, double > &in)
static std::set< int > allowedStatusCodes
std::shared_ptr< const RooAbsCollection > coords
std::shared_ptr< xRooNLLVar > nllVar
xRooFit::Asymptotics::PLLType fPllType
xValueWithError limit(const char *type="cls", double nSigma=std::numeric_limits< double >::quiet_NaN()) const
xRooHypoPoint & point(size_t i)
RooStats::HypoTestInverterResult * result()
bool AddModel(const xRooNode &pdf, const char *validity="")
std::shared_ptr< TMultiGraph > graphs(const char *opt)
static RooArgList toArgs(const char *str)
xValueWithError findlimit(const char *opt, double relUncert=std::numeric_limits< double >::infinity(), unsigned int maxTries=20)
int AddPoints(const char *parName, size_t nPoints, double low, double high)
static std::pair< double, double > GetLimit(const TGraph &pValues, double target=std::numeric_limits< double >::quiet_NaN())
std::shared_ptr< TGraphErrors > graph(const char *opt) const
std::shared_ptr< RooArgSet > fPars
void Print(Option_t *opt="") const override
Print TNamed name and title.
xRooHypoPoint & AddPoint(double value)
xRooHypoSpace(const char *name="", const char *title="")
int scan(const char *type, size_t nPoints, double low=std::numeric_limits< double >::quiet_NaN(), double high=std::numeric_limits< double >::quiet_NaN(), const std::vector< double > &nSigmas={0, 1, 2, -1, -2, std::numeric_limits< double >::quiet_NaN()}, double relUncert=0.1)
std::shared_ptr< xRooNode > pdf(const RooAbsCollection &parValues) const
void Draw(Option_t *opt="") override
Default Draw method for all objects.
std::map< std::string, std::pair< double, double > > limits(const char *opt="cls", const std::vector< double > &nSigmas={0, 1, 2, -1, -2, std::numeric_limits< double >::quiet_NaN()}, double relUncert=std::numeric_limits< double >::infinity())
void LoadFits(const char *apath)
std::shared_ptr< RooAbsPdf > pdf() const
std::shared_ptr< RooArgSet > pars(bool stripGlobalObs=true) const
The xRooNode class is designed to wrap over a TObject and provide functionality to aid with interacti...
static InteractiveObject * gIntObj
void Draw(Option_t *opt="") override
Default Draw method for all objects.
RooArgList argList() const
xRooNode pars() const
List of parameters (non-observables) of this node.
void setAttribute(const Text_t *name, bool value=true)
Set (default) or clear a named boolean attribute of this object.
Abstract container object that can hold multiple RooAbsArg objects.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
void sort(bool reverse=false)
Sort collection using std::sort and name comparison.
RooAbsArg * find(const char *name) const
Find object with given name in list.
Abstract interface for all probability density functions.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
void setConstant(bool value=true)
Abstract base class for objects that represent a real value and implements functionality common to al...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooConstVar represent a constant real-valued object.
RooDataSet is a container class to hold unbinned data.
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
RooRealVar represents a variable that can be changed from the outside.
HypoTestInverterResult class holds the array of hypothesis test results and compute a confidence inte...
HypoTestResult * GetResult(int index) const
return a pointer to the i^th result object
int ArraySize() const
number of entries in the results array
double GetXValue(int index) const
function to return the value of the parameter of interest for the i^th entry in the results
RooArgSet * GetParameters() const override
return a cloned list with the parameter of interest
Fill Area Attributes class.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
static TCanvas * MakeDefCanvas()
Static function to build a default canvas.
void Paint(Option_t *option="") override
Paint canvas.
void Update() override
Update canvas pad buffers.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Describe directory structure in memory.
virtual Bool_t cd()
Change current directory to "this" directory.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
A TGraphErrors is a TGraph with error bars.
A TGraph is an object made of two arrays X and Y with npoints each.
virtual Double_t GetPointX(Int_t i) const
Get x value for point i.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
static Bool_t CompareX(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if fX[left] > fX[right]. Can be used by Sort.
virtual void Sort(Bool_t(*greater)(const TGraph *, Int_t, Int_t)=&TGraph::CompareX, Bool_t ascending=kTRUE, Int_t low=0, Int_t high=-1111)
Sorts the points of this TGraph using in-place quicksort (see e.g.
TList * GetListOfFunctions() const
virtual Double_t Eval(Double_t x, TSpline *spline=nullptr, Option_t *option="") const
Interpolate points in this graph at x using a TSpline.
virtual Int_t RemovePoint()
Delete point close to the mouse position Returns index of removed point (or -1 if nothing was changed...
void SetName(const char *name="") override
Set graph name.
virtual Double_t GetPointY(Int_t i) const
Get y value for point i.
virtual void SetPointY(Int_t i, Double_t y)
Set y value for point i.
virtual void SetEditable(Bool_t editable=kTRUE)
if editable=kFALSE, the graph cannot be modified with the mouse by default a TGraph is editable
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual const char * GetClassName() const
This class displays a legend box (TPaveText) containing several legend entries.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
A TMemFile is like a normal TFile except that it reads and writes only from memory.
A TMultiGraph is a collection of TGraph (or derived) objects.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
The most important graphics class in the ROOT system.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void Continue()
Resume a stopped stopwatch.
Provides iteration through tokens of a given string.
Bool_t NextToken()
Get the next token, it is stored in this TString.
void ToLower()
Change string to lower-case.
Double_t Atof() const
Return floating-point value contained in string.
Bool_t IsFloat() const
Returns kTRUE if string contains a floating point or integer number.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Float_t GetPadRightMargin() const
Float_t GetPadTopMargin() const
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)=0
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
virtual TVirtualPad * GetPad(Int_t subpadnumber) const =0
virtual TCanvas * GetCanvas() const =0
void Clear(Option_t *option="") override=0
double gaussian_quantile(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the lower tail of the normal (Gaussian) distri...
#define END_XROOFIT_NAMESPACE