44xRooNLLVar::xRooHypoSpace::xRooHypoSpace(
const char *
name,
const char *title)
47 if (
name ==
nullptr || strlen(
name) == 0) {
66 spaceSize *= (
v->getMax() -
v->getMin());
71 double ssize = spaceSize;
76 ssize /= (
v->getMax() -
v->getMin());
77 double remain = std::fmod(xVal, ssize);
78 v->setVal((xVal - remain) / ssize);
84 for (
auto &
p : *
this) {
85 for (
auto a : *
p.coords) {
86 if (!
fPars->find(
a->GetName()))
94 return pdf(toArgs(parValues));
103 std::shared_ptr<xRooNode> out =
nullptr;
105 for (
auto &[_range, _pdf] : fPdfs) {
108 bool collision =
true;
109 for (
auto &_lhs : *_range) {
110 auto _rhs = rhs.
find(*_lhs);
115 if (!(
v->getMin() <=
v2->getMax() &&
v2->getMin() <=
v->getMax())) {
120 if (!(
v->getMin() <=
c2->getVal() &&
c2->getVal() <=
v->getMax())) {
127 if (!(
c->getVal() <=
v2->getMax() &&
v2->getMin() <=
c->getVal())) {
132 if (!(
c->getVal() ==
c2->getVal())) {
141 throw std::runtime_error(
"Multiple pdf possibilities");
159 auto _idx = s.
Index(
'=');
165 if (
_val.IsFloat()) {
167 }
else if (
_val.BeginsWith(
'[')) {
168 _idx =
_val.Index(
',');
187 throw std::runtime_error(
"Unknown parameter");
188 _par->setAttribute(
"axis");
190 if (low < _par->getMin()) {
191 Warning(
"AddPoints",
"low edge of hypoSpace %g below lower bound of parameter: %g. Changing to lower bound", low,
193 low = _par->getMin();
195 if (high > _par->getMax()) {
196 Warning(
"AddPoints",
"high edge of hypoSpace %g above upper bound of parameter: %g. Changing to upper bound",
197 high, _par->getMax());
198 high = _par->getMax();
202 _par->setVal((high + low) * 0.5);
207 double step = (high - low) / (nPoints - 1);
209 throw std::runtime_error(
"Invalid steps");
211 for (
size_t i = 0; i < nPoints; i++) {
212 _par->setVal((i == nPoints - 1) ? high : (low + step * i));
220 if (axes().empty()) {
223 throw std::runtime_error(
"No POI to scan");
225 poi().first()->setAttribute(
"axis");
231 poi().setAttribAll(
"poi",
false);
232 axes().setAttribAll(
"poi");
239 const std::vector<double> &nSigmas,
double relUncert)
247 throw std::runtime_error(
"scan type must be equal to one of: plr, cls, ts, pnull");
251 if (axes().empty()) {
254 throw std::runtime_error(
"No POI to scan");
256 poi().first()->setAttribute(
"axis");
261 poi().setAttribAll(
"poi",
false);
262 axes().setAttribAll(
"poi");
264 auto p =
dynamic_cast<RooRealVar *
>(axes().first());
266 throw std::runtime_error(
TString::Format(
"%s not scannable", axes().first()->GetName()));
270 if (empty() && relUncert == std::numeric_limits<double>::infinity()) {
272 ::Info(
"xRooHypoSpace::scan",
"Using default precision of 10%% for auto-scan");
275 for (
auto a : axes()) {
276 if (!
a->hasRange(
"physical")) {
277 ::Info(
"xRooHypoSpace::scan",
"No physical range set for %s, setting to [0,inf]",
p->
GetName());
278 dynamic_cast<RooRealVar *
>(
a)->setRange(
"physical", 0, std::numeric_limits<double>::infinity());
280 if (!
a->getStringAttribute(
"altVal") || !strlen(
p->getStringAttribute(
"altVal"))) {
281 ::Info(
"xRooHypoSpace::scan",
"No altVal set for %s, setting to 0",
a->GetName());
282 a->setStringAttribute(
"altVal",
"0");
285 double altVal =
TString(
a->getStringAttribute(
"altVal")).
Atof();
287 if (
v->getMin() >= altVal) {
288 ::Info(
"xRooHypoSpace::scan",
"range of POI does not straddle alt value, adjusting minimum to %g",
290 v->setMin(altVal - 1
e-5);
292 if (
v->getMax() <= altVal) {
293 ::Info(
"xRooHypoSpace::scan",
"range of POI does not straddle alt value, adjusting maximum to %g",
295 v->setMax(altVal + 1
e-5);
297 for (
auto &[
pdf, nll] : fNlls) {
298 if (
auto _v =
dynamic_cast<RooRealVar *
>(nll->pars()->find(*
a))) {
299 _v->setRange(
v->getMin(),
v->getMax());
312 for (
auto a : axes()) {
313 if (!
a->getStringAttribute(
"altVal") || !strlen(
p->getStringAttribute(
"altVal"))) {
314 ::Info(
"xRooHypoSpace::scan",
"No altVal set for %s, setting to 1",
a->GetName());
315 a->setStringAttribute(
"altVal",
"1");
320 if ( (high == low && nPoints != 1)) {
323 low =
p->getMin(
"scan");
324 high =
p->getMax(
"scan");
326 if (!std::isnan(low) && !std::isnan(high) && !(std::isinf(low) && std::isinf(high))) {
327 p->setRange(
"scan", std::min(low, high), std::max(low, high));
331 for (
auto nSigma : nSigmas) {
332 if (std::isnan(nSigma)) {
341 relUncert = std::numeric_limits<double>::infinity();
350#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 26, 00)
370 if (
auto myDb =
dynamic_cast<TMemFile *
>(fFitDb.get())) {
372 myDb->SetWritable(
true);
388 fFitDb = std::shared_ptr<TDirectory>(
401 sType +=
" visualize";
406 if (
p->hasRange(
"scan")) {
407 ::Info(
"xRooHypoSpace::scan",
"Using %s scan range: %g - %g",
p->
GetName(),
p->getMin(
"scan"),
410 for (
double nSigma : nSigmas) {
412 if (std::isnan(nSigma)) {
420 if (std::isnan(res.first) || std::isnan(res.second)) {
422 }
else if (std::isinf(res.second)) {
430 AddPoint(
TString::Format(
"%s=%g", poi().first()->GetName(), poi().getRealValue(poi().first()->GetName())));
433 if (back().status() != 0) {
437 low = std::max(std::isnan(low) ?
p->getMin() : low, back().mu_hat().getVal() - back().mu_hat().getError() * 3);
438 high = std::min(std::isnan(high) ?
p->getMax() : high, back().mu_hat().getVal() + back().mu_hat().getError() * 3);
440 double step = (high - low) / (nPoints - 1);
441 for (
size_t i = 0; i < nPoints; i++) {
442 AddPoint(
TString::Format(
"%s=%g", poi().first()->GetName(), low + step * i));
444 if (back().status() != 0)
449 throw std::runtime_error(
TString::Format(
"Automatic scanning not yet supported for %s",
type));
454 AddPoint(
TString::Format(
"%s=%g", poi().first()->GetName(), (high + low) / 2.));
456 if (back().status() != 0)
459 double step = (high - low) / (nPoints - 1);
460 for (
size_t i = 0; i < nPoints; i++) {
461 AddPoint(
TString::Format(
"%s=%g", poi().first()->GetName(), low + step * i));
463 if (back().status() != 0)
472 if (
auto myDb =
dynamic_cast<TMemFile *
>(fFitDb.get())) {
474 myDb->SetWritable(
false);
479std::map<std::string, xRooNLLVar::xValueWithError>
486 relUncert = std::numeric_limits<double>::infinity();
489 scan(opt, nSigmas, relUncert);
491 std::map<std::string, xRooNLLVar::xValueWithError> out;
492 for (
auto nSigma : nSigmas) {
493 auto lim = limit(opt, nSigma);
495 lim.second = -lim.second;
513 auto _idx = s.
Index(
'=');
518 auto _v =
dynamic_cast<RooRealVar *
>(fPars->find(_name));
522 if (
_val.IsFloat()) {
524 _v->setVal(
_val.Atof());
531 throw std::runtime_error(
"no model at coordinates");
538 if (fNlls.find(_pdf) == fNlls.end()) {
539 fNlls[_pdf] = std::make_shared<xRooNLLVar>(_pdf->nll(
"" , {}));
545 out.
fData = fNlls[_pdf]->getData();
547 dynamic_cast<RooDataSet *
>(out.
fData.first.get())->weightVar()->getAttribute(
"expected");
550 out.
coords.reset(fPars->snapshot());
559 ->remove(*std::unique_ptr<RooAbsCollection>(out.
coords->selectByAttrib(
"Constant",
false)),
true,
true);
562 double alt_value = out.
fAltVal();
564 auto _type = fTestStatType;
567 if (std::isnan(alt_value)) {
569 }
else if (
value >= alt_value) {
579 for (
auto &
p : *
this) {
584 if (!
p.alt_poi().equals(out.
alt_poi()))
587 for (
auto c :
p.alt_poi()) {
601 if (!
p.coords->equals(*out.
coords))
603 for (
auto c : *
p.coords) {
604 if (
c->getAttribute(
"poi")) {
608 v && std::abs(
v->getVal() - out.
coords->getRealValue(
v->GetName())) > 1
e-12) {
622 if (
auto cfit =
p.cfit_alt(
true)) {
625 if (
p.asimov(
true) &&
p.asimov(
true)->fData.first && (!out.
asimov(
true) || !out.
asimov(
true)->fData.first)) {
626 out.
asimov()->fData =
p.asimov(
true)->fData;
628 if (!
p.poi().equals(out.
poi()))
630 for (
auto c :
p.poi()) {
643 std::string coordString;
644 for (
auto a : axes()) {
648 coordString.erase(coordString.end() - 1);
651 auto s =
TString::Format(
"Info in <xRooHypoSpace::AddPoint>: Added new point @ %s", coordString.c_str());
657 ::Info(
"xRooHypoSpace::AddPoint",
"Added new point @ %s", coordString.c_str());
659 return emplace_back(out);
666 throw std::runtime_error(
"Not a pdf");
672 auto vpars = toArgs(validity);
674 vpars.remove(
pars,
true,
true);
677 if (
auto existing =
pdf(
pars)) {
678 throw std::runtime_error(std::string(
"Clashing model: ") + existing->GetName());
681 auto myPars = std::shared_ptr<RooArgList>(
dynamic_cast<RooArgList *
>(
pars.snapshot()));
684 pars.remove(*fPars,
true,
true);
686 fPars->addClone(
pars);
688 fPdfs.insert(std::make_pair(myPars, std::make_shared<xRooNode>(_pdf)));
699 out.
add(*std::unique_ptr<RooAbsCollection>(
700 fPars->selectByAttrib(
"axis",
true)));
706 std::set<std::vector<double>> coords;
707 for (
auto &
p : *
this) {
708 std::vector<double> p_coords;
710 auto _v =
dynamic_cast<RooRealVar *
>(
p.coords->find(o->GetName()));
712 (_v && _v->isConstant())
714 : std::numeric_limits<double>::infinity());
717 if (coords.find(p_coords) != coords.end()) {
721 coords.insert(p_coords);
726 std::map<std::string, std::unordered_set<double>> values;
727 for (
auto &par : *
pars()) {
730 for (
auto p : *
this) {
731 auto _v =
dynamic_cast<RooRealVar *
>(
p.coords->find(par->GetName()));
732 values[par->GetName()].insert(
733 (_v && _v->isConstant())
735 : std::numeric_limits<double>::infinity());
744 for (
auto &[k,
v] : values) {
745 if (
v.size() > maxDiff || (
v.size() == maxDiff && !isPOI &&
pars()->find(k.c_str())->getAttribute(
"poi"))) {
747 isPOI =
pars()->find(k.c_str())->getAttribute(
"poi");
748 maxDiff = std::max(maxDiff,
v.size());
751 if (bestVar.empty()) {
755 out.
add(*
pars()->find(bestVar.c_str()));
760 std::unique_ptr<RooAbsCollection> poi(out.
selectByAttrib(
"poi",
true));
771 out.
add(*std::unique_ptr<RooAbsCollection>(
pars()->selectByAttrib(
"poi",
true)));
782 for (
size_t i = 0; i <
size(); i++) {
783 std::cout << i <<
") ";
784 for (
auto a : _axes) {
785 if (
a != _axes.first())
787 std::cout <<
a->GetName() <<
"="
788 << at(i).coords->getRealValue(
a->GetName(), std::numeric_limits<double>::quiet_NaN());
790 std::cout <<
" status=[ufit:";
795 std::cout << ufit->
status();
798 std::cout <<
",cfit_null:";
799 auto cfit =
const_cast<xRooHypoPoint &
>(at(i)).cfit_null(
true);
803 std::cout << cfit->
status();
806 std::cout <<
",cfit_alt:";
807 auto afit =
const_cast<xRooHypoPoint &
>(at(i)).cfit_alt(
true);
811 std::cout << afit->
status();
814 if (
auto asiPoint =
const_cast<xRooHypoPoint &
>(at(i)).asimov(
true)) {
815 std::cout <<
",asimov.ufit:";
816 auto asi_ufit = asiPoint->ufit(
true);
820 std::cout << asi_ufit->status();
823 std::cout <<
",asimov.cfit_null:";
824 auto asi_cfit = asiPoint->cfit_null(
true);
828 std::cout << asi_cfit->status();
831 auto cfit_lbound =
const_cast<xRooHypoPoint &
>(at(i)).cfit_lbound(
true);
834 std::cout <<
",cfit_lbound:" << cfit_lbound->
status();
839 auto sigma_mu =
const_cast<xRooHypoPoint &
>(at(i)).sigma_mu(
true);
840 if (!std::isnan(sigma_mu.first)) {
841 std::cout <<
" sigma_mu=" << sigma_mu.first;
843 std::cout <<
" +/- " << sigma_mu.second;
845 std::cout << std::endl;
847 std::cout <<
"--------------------------" << std::endl;
848 std::cout <<
"Number of bad fits: " << badFits << std::endl;
852 const char *opt )
const
859 bool readOnly = sOpt.
Contains(
"readonly");
860 bool visualize = sOpt.
Contains(
"visualize") && !readOnly;
867 : std::numeric_limits<double>::quiet_NaN();
869 !std::isnan(nSigma) && nSigma && !(sOpt(sOpt.
Index(
"exp") + 3) ==
'+' || sOpt(sOpt.
Index(
"exp") + 3) ==
'-');
872 if (_axes.size() != 1)
875 auto out = std::make_shared<TGraphErrors>();
876 out->SetName(GetName());
877 out->SetEditable(
false);
878 const char *sCL = (doCLs) ?
"CLs" :
"null";
884 : (!nSigma ?
"Expected"
886 expBand || !nSigma ?
"" : ((nSigma < 0) ?
"-" :
"+"),
int(nSigma))
888 _axes.at(0)->GetTitle(), sCL);
890 if (std::isnan(nSigma)) {
892 out->SetMarkerStyle(20);
893 out->SetMarkerSize(0.5);
895 out->SetNameTitle(
"obs_ts",
TString::Format(
"Observed;%s;%s", _axes.at(0)->GetTitle(),
896 (empty() ?
"" : front().tsTitle(
true).Data())));
899 out->SetNameTitle(
TString::Format(
"exp%d_p%s",
int(nSigma), sCL), title);
900 out->SetMarkerStyle(0);
901 out->SetMarkerSize(0);
902 out->SetLineStyle(2 +
int(nSigma));
903 if (expBand && nSigma) {
906 out->SetLineStyle(0);
907 out->SetLineWidth(0);
908 auto x = out->Clone(
"up");
912 out->GetListOfFunctions()->Add(
x,
"F");
913 x = out->Clone(
"down");
917 out->GetListOfFunctions()->Add(
x,
"F");
921 TString::Format(
"Expected;%s;%s", _axes.at(0)->GetTitle(), front().tsTitle(
true).Data()));
925 auto badPoints = [&]() {
926 auto badPoints2 =
dynamic_cast<TGraph *
>(out->GetListOfFunctions()->FindObject(
"badPoints"));
930 badPoints2->SetName(
"badPoints");
931 badPoints2->SetMarkerStyle(5);
932 badPoints2->SetMarkerColor(std::isnan(nSigma) ?
kRed :
kBlue);
933 badPoints2->SetMarkerSize(1);
934 out->GetListOfFunctions()->Add(badPoints2,
"P");
952 nToys = toyNum.
Atoi();
953 nToysAlt = (toyNum.
Atof() - nToys) * nToys;
964 for (
auto &
p : *
this) {
968 auto gra = graph(sOpt +
" readOnly");
969 if (gra && gra->GetN()) {
971 gROOT->GetSelectedPad()->cd();
974 gra->DrawClone(expBand ?
"AF" :
"ALP")->SetBit(
kCanDelete);
975#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
976 if (
auto pad =
gROOT->GetSelectedPad()) {
977 pad->GetCanvas()->ResetUpdated();
983 ::Info(
"xRooHypoSpace::graph",
"Completed %d/%d points for %s",
int(nDone),
int(
size()), sOpt.
Data());
989 double _x =
p.coords->getRealValue(_axes.at(0)->GetName(), std::numeric_limits<double>::quiet_NaN());
991 auto idx = out->GetN() - nPointsDown;
993 double target=0.05;
double relErrThreshold = 2;
994 double diff = (
target < 0) ? pval.first : std::abs(pval.first -
target);
997 if (std::isnan(pval.first) || (pval.second != 0 && (
p.nullToys.size() < nToys ||
p.altToys.size() < nToysAlt) && (sOpt.
Contains(
"toys=") || (sOpt.
Contains(
"toys") && !sOpt.
Contains(
"toys=") && doCLs && pval.second > 1
e-4 && diff <= relErrThreshold * pval.second))) ) {
998 if (
p.status() != 0) {
999 badPoints()->SetPoint(badPoints()->GetN(), _x, 0);
1002 out->InsertPointBefore(idx, _x, pval.first);
1003 out->SetPointError(idx, 0, pval.second);
1006 if (expBand && nSigma) {
1010 diff = (
target < 0) ? pval.first : std::abs(pval.first -
target);
1011 if (std::isnan(pval.first) || (pval.second != 0 && (
p.nullToys.size() < nToys ||
p.altToys.size() < nToysAlt) && (sOpt.
Contains(
"toys=") || (sOpt.
Contains(
"toys") && !sOpt.
Contains(
"toys=") && doCLs && pval.second > 1
e-4 && diff <= relErrThreshold * pval.second))) ) {
1012 if (
p.status() != 0) {
1013 badPoints()->SetPoint(badPoints()->GetN(), _x, 0);
1016 out->InsertPointBefore(idx + 1, _x, pval.first);
1017 out->SetPointError(idx + 1, 0, pval.second);
1019 if (out->GetPointY(idx) < pval.first)
1026 if (out->GetN() == 0)
1031 if (out->GetListOfFunctions()->FindObject(
"badPoints")) {
1033 for (
int i = 0; i < badPoints()->GetN(); i++) {
1034 badPoints()->SetPointY(i, out->Eval(badPoints()->GetPointX(i)));
1039 out->Sort(&
TGraph::CompareX,
false, out->GetN() - nPointsDown, out->GetN() - 1);
1042 auto up =
dynamic_cast<TGraph *
>(out->GetListOfFunctions()->FindObject(
"up"));
1043 auto down =
dynamic_cast<TGraph *
>(out->GetListOfFunctions()->FindObject(
"down"));
1045 for (
int i = 0; i < out->GetN(); i++) {
1046 if (i < out->GetN() - nPointsDown) {
1047 up->
SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) + out->GetErrorY(i) * (above ? 1. : -1.));
1052 down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) + out->GetErrorY(i) * (above ? 1. : -1.));
1056 for (
int i = out->GetN() - 1; i >= 0; i--) {
1057 if (i < out->GetN() - nPointsDown) {
1058 up->SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
1063 down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
1071 gROOT->GetSelectedPad()->cd();
1074 out->DrawClone(expBand ?
"AF" :
"ALP")->SetBit(
kCanDelete);
1075#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1076 if (
auto pad =
gROOT->GetSelectedPad()) {
1077 pad->GetCanvas()->ResetUpdated();
1090 std::shared_ptr<TMultiGraph> out;
1093 bool visualize = sOpt.
Contains(
"visualize");
1096 auto exp2 = graph(sOpt +
" exp2");
1097 auto exp1 = graph(sOpt +
" exp1");
1098 auto exp = graph(sOpt +
" exp");
1101 auto obs = (doObs) ? graph(sOpt) :
nullptr;
1103 out = std::make_shared<TMultiGraph>(GetName(), GetTitle());
1104 if (exp2 && exp2->GetN() > 1)
1105 out->Add(
static_cast<TGraph *
>(exp2->Clone()),
"FP");
1106 if (exp1 && exp1->GetN() > 1)
1107 out->Add(
static_cast<TGraph *
>(exp1->Clone()),
"FP");
1108 if (exp && exp->GetN() > 1)
1109 out->Add(
static_cast<TGraph *
>(exp->Clone()),
"LP");
1110 if (obs && obs->GetN() > 1)
1111 out->Add(
static_cast<TGraph *
>(obs->Clone()),
"LP");
1113 if (!out->GetListOfGraphs()) {
1117 TGraph *testedPoints =
nullptr;
1120 line->SetName(
"alpha");
1122 line->SetEditable(
false);
1123 line->SetPoint(
line->GetN(), out->GetHistogram()->GetXaxis()->GetXmin() - 10, 0.05);
1124 testedPoints =
new TGraph;
1125 testedPoints->
SetName(
"hypoPoints");
1130 for (
int i = 0; i < exp->GetN(); i++) {
1131 testedPoints->
SetPoint(testedPoints->
GetN(), exp->GetPointX(i), 0.05);
1134 line->SetPoint(
line->GetN(), out->GetHistogram()->GetXaxis()->GetXmax() + 10, 0.05);
1136 out->GetListOfFunctions()->Add(
line,
"L");
1139 out->GetHistogram()->GetXaxis()->SetTitle(exp->GetHistogram()->GetXaxis()->GetTitle());
1140 out->GetHistogram()->GetYaxis()->SetTitle(exp->GetHistogram()->GetYaxis()->GetTitle());
1143 if (out->GetListOfGraphs()->GetEntries() > 1) {
1146 leg->SetName(
"legend");
1149 out->GetListOfFunctions()->Add(
leg);
1152 for (
auto g : *out->GetListOfGraphs()) {
1154 leg->AddEntry(
g,
"",
"F");
1156 leg->AddEntry(
g,
"",
"LPE");
1161 auto addToLegend = [](
TLegend *
l,
const char *label,
const std::pair<double, double> val) {
1164 TString::Format(
"%s%s: %g #pm %g%s", std::isfinite(val.second) ?
"" :
"#color[2]{", label,
1165 val.first, val.second, std::isfinite(val.second) ?
"" :
"}"),
1172 if (exp2 && exp2->GetN() > 1) {
1174 addToLegend(
leg,
"-2#sigma",
l);
1176 if (exp1 && exp1->GetN() > 1) {
1178 addToLegend(
leg,
"-1#sigma",
l);
1180 if (exp && exp->GetN() > 1) {
1182 addToLegend(
leg,
"0#sigma",
l);
1184 if (exp1 && exp1->GetN() > 1) {
1186 addToLegend(
leg,
"+1#sigma",
l);
1188 if (exp2 && exp2->GetN() > 1) {
1190 addToLegend(
leg,
"+2#sigma",
l);
1192 if (obs && obs->GetN() > 1) {
1194 addToLegend(
leg,
"Observed",
l);
1198 out->Add(testedPoints,
"P");
1202 gROOT->GetSelectedPad()->cd();
1205 auto gra2 =
static_cast<TMultiGraph *
>(out->DrawClone(
"A"));
1208 gra2->SetMinimum(1
e-6);
1209 gra2->SetMaximum(1);
1213 gPad->GetCanvas()->Paint();
1214 gPad->GetCanvas()->Update();
1215#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1216 gPad->GetCanvas()->ResetUpdated();
1229 if (std::isnan(
target)) {
1233 auto gr = std::make_shared<TGraph>(pValues);
1236 std::set<double> existingX;
1237 while (i < gr->GetN()) {
1240 }
else if (existingX.find(
gr->
GetPointX(i)) != existingX.end()) {
1254 return std::pair<double, double>(std::numeric_limits<double>::quiet_NaN(), 0);
1257 double alpha = log(
target);
1260 for (
int ii = 1; ii <
gr->
GetN(); ii++) {
1271 return std::pair(lim, err);
1287 }
while(offset < gr->GetN() && (
y1==0 ||
m<=0) );
1289 return std::pair(std::numeric_limits<double>::infinity(), std::numeric_limits<double>::infinity());
1290 return std::pair((alpha -
y1) /
m +
x1, std::numeric_limits<double>::infinity());
1297 return std::pair(-std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity());
1298 return std::pair((alpha -
y1) /
m +
x1, -std::numeric_limits<double>::infinity());
1305 if (std::isnan(nSigma)) {
1310 return GetLimit(*graph(sOpt +
" readonly"));
1317 bool visualize = sOpt.
Contains(
"visualize");
1319 std::shared_ptr<TGraphErrors>
gr = graph(sOpt +
" readonly");
1322 auto gra = graphs(
TString(
"pcls readonly") + toyConf);
1327 auto gra2 =
static_cast<TMultiGraph *
>(gra->DrawClone(
"A"));
1329 gra2->SetMinimum(1
e-9);
1330 gra2->SetMaximum(1);
1332 gPad->GetCanvas()->Paint();
1333 gPad->GetCanvas()->Update();
1334#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1335 gPad->GetCanvas()->ResetUpdated();
1342 for (
auto p : axes()) {
1343 for (
auto &[
pdf, nll] : fNlls) {
1344 if (
auto _v =
dynamic_cast<RooRealVar *
>(nll->pars()->find(*
p))) {
1345 dynamic_cast<RooRealVar *
>(
p)->setRange(_v->getMin(), _v->getMax());
1351 auto v = (axes().empty()) ?
nullptr :
dynamic_cast<RooRealVar *
>(*axes().rbegin());
1353 return std::pair(std::numeric_limits<double>::quiet_NaN(), 0.);
1354 double muMax = std::min(std::min(
v->getMax(
"physical"),
v->getMax()),
v->getMax(
"scan"));
1355 double muMin = std::max(std::max(
v->getMin(
"physical"),
v->getMin()),
v->getMin(
"scan"));
1357 if (maxTries == 0 || std::isnan(AddPoint(
TString::Format(
"%s=%g",
v->GetName(), muMin)).getVal(sOpt).first)) {
1359 ::Error(
"findlimit",
"Problem evaluating First Point %s @ %s=%g (maxTries=%d)", sOpt.
Data(),
v->GetName(), muMin,maxTries);
1360 return std::pair(std::numeric_limits<double>::quiet_NaN(), 0.);
1363 return findlimit(opt, relUncert, maxTries - 1);
1370 double nextPoint = muMin + (muMax - muMin) / 50;
1376 auto expLim = findlimit(sOpt2, std::numeric_limits<double>::infinity(), 0);
1377 if (!std::isnan(expLim.first) && expLim.first < nextPoint)
1378 nextPoint = expLim.first;
1382 (sOpt.
Contains(
"exp")) ? back().asimov() : std::shared_ptr<xRooHypoPoint>(&back(), [](
xRooHypoPoint *) {});
1384 if (point && point->ufit()) {
1385 double rough_sigma_mu = point->mu_hat().getError();
1388 nextPoint = another_estimate;
1389 ::Info(
"xRooHypoSpace::findlimit",
"Guessing %g based on rough sigma_mu = %g", nextPoint, rough_sigma_mu);
1393 if (maxTries == 0 || std::isnan(AddPoint(
TString::Format(
"%s=%g",
v->GetName(), nextPoint)).getVal(sOpt).first)) {
1395 ::Error(
"xRooHypoSpace::findlimit",
"Problem evaluating Second Point %s @ %s=%g", sOpt.
Data(),
v->GetName(),
1397 return std::pair(std::numeric_limits<double>::quiet_NaN(), 0.);
1400 return findlimit(opt, relUncert, maxTries - 1);
1403 auto lim = GetLimit(*
gr);
1405 if (std::isnan(lim.first)) {
1409 auto v =
dynamic_cast<RooRealVar *
>(*axes().rbegin());
1410 double maxMu = std::min(std::min(
v->getMax(
"physical"),
v->getMax()),
v->getMax(
"scan"));
1411 double minMu = std::max(std::max(
v->getMin(
"physical"),
v->getMin()),
v->getMin(
"scan"));
1414 if (lim.first > -std::numeric_limits<double>::infinity() && lim.first < std::numeric_limits<double>::infinity() &&
1415 (std::abs(lim.second) <= relUncert * std::abs(lim.first) ))
1420 if (lim.second == std::numeric_limits<double>::infinity()) {
1422 nextPoint = lim.first;
1423 if (nextPoint == std::numeric_limits<double>::infinity() || nextPoint > maxMu) {
1430 (sOpt.
Contains(
"exp")) ? back().asimov() : std::shared_ptr<xRooHypoPoint>(&back(), [](
xRooHypoPoint *) {});
1432 if (point && point->ufit()) {
1433 double rough_sigma_mu = point->mu_hat().getError();
1436 nextPoint = std::max(nextPoint, another_estimate);
1437 ::Info(
"xRooHypoSpace::findlimit",
"Guessing %g based on rough sigma_mu = %g", nextPoint, rough_sigma_mu);
1440 nextPoint = std::min(nextPoint + nextPoint * relUncert * 0.99, maxMu);
1442 if (nextPoint > maxMu)
1444 }
else if (lim.second == -std::numeric_limits<double>::infinity()) {
1446 nextPoint = lim.first;
1447 if (nextPoint < minMu)
1448 nextPoint =
gr->
GetPointX(0) - (maxMu - minMu) / 50;
1449 if (nextPoint < minMu)
1452 nextPoint = lim.first + lim.second * relUncert * 0.99;
1458 if (maxTries == 0) {
1459 ::Warning(
"xRooHypoSpace::findlimit",
"Reached max number of point evaluations");
1463 ::Info(
"xRooHypoSpace::findlimit",
"%s -- Testing new point @ %s=%g (delta=%g)", sOpt.
Data(),
v->GetName(),
1464 nextPoint, lim.second);
1465 if (std::isnan(AddPoint(
TString::Format(
"%s=%g",
v->GetName(), nextPoint)).getVal(sOpt).first)) {
1466 ::Error(
"xRooHypoSpace::findlimit",
"Problem evaluating %s @ %s=%g", sOpt.
Data(),
v->GetName(), nextPoint);
1470 return findlimit(opt, relUncert, maxTries - 1);
1479 if ((sOpt ==
"" || sOpt ==
"same") && !empty()) {
1482 for (
auto &hp : *
this) {
1483 if (!hp.nullToys.empty() || !hp.altToys.empty()) {
1494 auto _axes = axes();
1498 if (sOpt ==
"status") {
1500 if (_axes.size() <= 2) {
1515 badPoints->
SetName(
"bad_ufit");
1521 badPoints2->
SetName(
"bad_cfit_null");
1528 (_axes.size() == 1) ?
"" : _axes.at(1)->GetTitle()));
1529 for (
auto &
p : *
this) {
1530 bool _readOnly =
p.nllVar ?
p.nllVar->get()->getAttribute(
"readOnly") :
false;
1532 p.nllVar->get()->setAttribute(
"readOnly",
true);
1533 double x =
p.coords->getRealValue(_axes.at(0)->GetName());
1534 double y = _axes.size() == 1 ?
p.ts_asymp().first :
p.coords->getRealValue(_axes.at(1)->GetName());
1536 if (!std::isnan(
p.ts_asymp().first)) {
1537 if (_axes.size() == 1)
1540 }
else if (
p.fUfit && (std::isnan(
p.fUfit->minNll()) ||
1544 }
else if (
p.fNull_cfit && (std::isnan(
p.fNull_cfit->minNll()) ||
1549 if (!std::isnan(
p.ts_asymp(0).first)) {
1551 }
else if (
p.asimov() &&
p.asimov()->fUfit &&
1552 (std::isnan(
p.asimov()->fUfit->minNll()) ||
1556 }
else if (
p.asimov() &&
p.asimov()->fNull_cfit &&
1557 (std::isnan(
p.asimov()->fNull_cfit->minNll()) ||
1562 p.nllVar->get()->setAttribute(
"readOnly", _readOnly);
1565 if (_axes.size() == 1) {
1567 for (
int i = 0; i < out->
GetN(); i++) {
1571 auto fixPoints = [&](
TGraph *
g) {
1572 for (
int i = 0; i <
g->GetN(); i++) {
1573 if (std::isnan(
g->GetPointY(i)))
1574 g->SetPointY(i, std::isnan(tmp.
Eval(
g->GetPointX(i))) ? 0. : tmp.
Eval(
g->GetPointX(i)));
1579 fixPoints(expAvail);
1580 fixPoints(badPoints);
1581 fixPoints(badPoints2);
1586 auto leg =
new TLegend(1. -
gPad->GetRightMargin() - 0.3, 1. -
gPad->GetTopMargin() - 0.35,
1587 1. -
gPad->GetRightMargin() - 0.05, 1. -
gPad->GetTopMargin() - 0.05);
1588 leg->SetName(
"legend");
1589 leg->AddEntry(out,
"Uncomputed",
"P");
1591 if (tsAvail->
GetN()) {
1593 leg->AddEntry(tsAvail,
"Computed",
"P");
1597 if (expAvail->
GetN()) {
1599 leg->AddEntry(expAvail,
"Expected computed",
"P");
1603 if (badPoints->
GetN()) {
1605 leg->AddEntry(badPoints,
"Bad ufit",
"P");
1609 if (badPoints2->
GetN()) {
1611 leg->AddEntry(badPoints2,
"Bad null cfit",
"P");
1618 gPad->SetGrid(
true, _axes.size() > 1);
1619 if (_axes.size() == 1)
1620 gPad->SetLogy(
false);
1629 auto gra = graphs(sOpt +
" readonly");
1631 gROOT->GetSelectedPad()->cd();
1641 gra2->SetMinimum(1
e-6);
1642 gra2->SetMaximum(1);
1646 gPad->GetCanvas()->Paint();
1647 gPad->GetCanvas()->Update();
1648#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1649 gPad->GetCanvas()->ResetUpdated();
1675 if (!empty() && axes().
size() == 1) {
1676 for (
auto &
p : *
this) {
1678 pllType =
p.fPllType;
1682 title += front().tsTitle(
true);
1686 *
dynamic_cast<TAttFill *
>(out) = *
this;
1687 *
dynamic_cast<TAttLine *
>(out) = *
this;
1697 bool doFits =
false;
1703 auto mainPad =
gPad;
1710 gPad->SetBottomMargin(
gPad->GetBottomMargin() * 2.);
1714 mainPad = basePad->
GetPad(1);
1720 std::pair<double, double> minMax(std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity());
1721 for (
auto &
p : *
this) {
1722 if (
p.fPllType != pllType)
1724 auto val =
p.pll(
true).first;
1725 if (std::isnan(val))
1727 minMax.first = std::min(minMax.first, val);
1728 minMax.second = std::max(minMax.second, val);
1730 if (minMax.first < std::numeric_limits<double>::infinity())
1732 if (minMax.second > -std::numeric_limits<double>::infinity())
1735 TGraph *badPoints =
nullptr;
1739 std::shared_ptr<const RooFitResult> ufr;
1740 for (
auto &
p : *
this) {
1741 if (
p.fPllType != pllType)
1743 auto val =
p.pll().first;
1746 if (out->
GetN() == 0 && ufr && ufr->status() == 0) {
1748 ufr->floatParsFinal().getRealValue(axes().first()->GetName(),
1749 ufr->constPars().getRealValue(axes().first()->GetName())),
1753 if (
auto fr =
p.fNull_cfit;
1758 new TPad(fr->GetName(),
TString::Format(
"%s = %g", poi().first()->GetTitle(),
p.fNullVal()), 0, 0, 1., 1);
1759 pad->SetNumber(out->
GetN() + 1);
1766 if (std::isnan(val) &&
p.status() != 0) {
1770 badPoints->
SetName(
"badPoints");
1777 mainPad->Modified();
1778 }
else if (!std::isnan(val)) {
1779 out->
SetPoint(out->
GetN(),
p.coords->getRealValue(axes().first()->GetName()),
p.pll().first);
1785 for (
int i = 0; i < badPoints->
GetN(); i++)
1789 mainPad->Modified();
1802#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1808 if (ufr && doFits) {
1810 auto pad =
new TPad(ufr->GetName(),
"unconditional fit", 0, 0, 1., 1.);
1818 pad =
new TPad(
"selected",
"selected", 0, 0, 1, 1);
1833 gPad->GetCanvas()->
Connect(
"Highlighted(TVirtualPad*,TObject*,Int_t,Int_t)",
"xRooNode::InteractiveObject",
1845 auto _axes = axes();
1852 for (
auto &
p : *
this) {
1853 double _x =
p.coords->getRealValue(_axes.at(0)->GetName(), std::numeric_limits<double>::quiet_NaN());
1854 out->
Add(_x,
p.result());
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
const char Option_t
Option string (const char)
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)
std::pair< std::shared_ptr< RooAbsData >, std::shared_ptr< const RooAbsCollection > > fData
std::shared_ptr< const RooAbsCollection > coords
std::shared_ptr< xRooNLLVar > nllVar
xRooFit::Asymptotics::PLLType fPllType
std::shared_ptr< xRooHypoPoint > asimov(bool readOnly=false)
RooArgList alt_poi() const
std::shared_ptr< const RooFitResult > fAlt_cfit
static std::set< int > allowedStatusCodes
xValueWithError limit(const char *type="cls", double nSigma=std::numeric_limits< double >::quiet_NaN()) const
xRooHypoPoint & point(size_t i)
RooStats::HypoTestInverterResult * result()
static xValueWithError GetLimit(const TGraph &pValues, double target=std::numeric_limits< double >::quiet_NaN())
std::map< std::string, xValueWithError > 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())
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)
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.
xRooHypoSpace(const char *name="", const char *title="")
xRooHypoPoint & AddPoint(double value)
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::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...
void Draw(Option_t *opt="") override
Default Draw method for all objects.
RooArgList argList() const
static InteractiveObject * gIntObj
xRooNode pars() const
List of parameters (non-observables) of this node.
A space to attach TBranches.
virtual value_type getCurrentIndex() const
Return index number of current state.
Abstract container object that can hold multiple RooAbsArg objects.
RooAbsCollection * selectByAttrib(const char *name, bool value) const
Create a subset of the current collection, consisting only of those elements with the specified attri...
double getRealValue(const char *name, double defVal=0.0, bool verbose=false) const
Get value of a RooAbsReal stored in set with given name.
Int_t getCatIndex(const char *name, Int_t defVal=0, bool verbose=false) const
Get index value of a RooAbsCategory stored in set with given name.
virtual bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
void setAttribAll(const Text_t *name, bool value=true)
Set given attribute in each element of the collection by calling each elements setAttribute() functio...
virtual RooAbsArg * addClone(const RooAbsArg &var, bool silent=false)
Add a clone of the specified argument to list.
void sort(bool reverse=false)
Sort collection using std::sort and name comparison.
void setName(const char *name)
RooAbsArg * find(const char *name) const
Find object with given name in list.
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
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.
Represents a constant real-valued object.
Container class to hold unbinned data.
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
bool Add(const HypoTestInverterResult &otherResult)
merge with the content of another HypoTestInverterResult object
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 Size_t GetMarkerSize() const
Return the marker size.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
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.
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.
A TGraphErrors is a TGraph with error bars.
virtual void SetPointError(Double_t ex, Double_t ey)
Set ex and ey values for point pointed by the mouse.
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.
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum of the graph.
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.
void Draw(Option_t *chopt="") override
Draw this graph with its current attributes.
virtual Double_t GetPointY(Int_t i) const
Get y value for point i.
void SetTitle(const char *title="") override
Change (i.e.
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
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum of the graph.
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.
void Add(TObject *obj) override
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.
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.
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.
Int_t Atoi() const
Return integer value of string.
Double_t Atof() const
Return floating-point value contained in string.
const char * Data() const
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.
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...
void writeStdoutLine(const char *msg)
bool isPythonInitialized()
#define BEGIN_XROOFIT_NAMESPACE
#define END_XROOFIT_NAMESPACE