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(
'=');
163 if (
_val.IsFloat()) {
165 }
else if (
_val.BeginsWith(
'[')) {
166 _idx =
_val.Index(
',');
185 throw std::runtime_error(
"Unknown parameter");
186 _par->setAttribute(
"axis");
188 if (low < _par->getMin()) {
189 Warning(
"AddPoints",
"low edge of hypoSpace %g below lower bound of parameter: %g. Changing to lower bound", low,
191 low = _par->getMin();
193 if (high > _par->getMax()) {
194 Warning(
"AddPoints",
"high edge of hypoSpace %g above upper bound of parameter: %g. Changing to upper bound",
195 high, _par->getMax());
196 high = _par->getMax();
200 _par->setVal((high + low) * 0.5);
205 double step = (high - low) / (nPoints - 1);
207 throw std::runtime_error(
"Invalid steps");
209 for (
size_t i = 0; i < nPoints; i++) {
210 _par->setVal((i == nPoints - 1) ? high : (low + step * i));
218 if (axes().empty()) {
221 throw std::runtime_error(
"No POI to scan");
223 poi().first()->setAttribute(
"axis");
229 poi().setAttribAll(
"poi",
false);
230 axes().setAttribAll(
"poi");
237 const std::vector<double> &nSigmas,
double relUncert)
245 throw std::runtime_error(
"scan type must be equal to one of: plr, cls, ts, pnull");
249 if (axes().empty()) {
252 throw std::runtime_error(
"No POI to scan");
254 poi().first()->setAttribute(
"axis");
259 poi().setAttribAll(
"poi",
false);
260 axes().setAttribAll(
"poi");
262 auto p =
dynamic_cast<RooRealVar *
>(axes().first());
264 throw std::runtime_error(
TString::Format(
"%s not scannable", axes().first()->GetName()));
268 if (empty() && relUncert == std::numeric_limits<double>::infinity()) {
270 ::Info(
"xRooHypoSpace::scan",
"Using default precision of 10%% for auto-scan");
273 for (
auto a : axes()) {
274 if (!
a->hasRange(
"physical")) {
275 ::Info(
"xRooHypoSpace::scan",
"No physical range set for %s, setting to [0,inf]",
p->
GetName());
276 dynamic_cast<RooRealVar *
>(
a)->setRange(
"physical", 0, std::numeric_limits<double>::infinity());
278 if (!
a->getStringAttribute(
"altVal") || !strlen(
p->getStringAttribute(
"altVal"))) {
279 ::Info(
"xRooHypoSpace::scan",
"No altVal set for %s, setting to 0",
a->GetName());
280 a->setStringAttribute(
"altVal",
"0");
283 double altVal =
TString(
a->getStringAttribute(
"altVal")).
Atof();
285 if (
v->getMin() >= altVal) {
286 ::Info(
"xRooHypoSpace::scan",
"range of POI does not straddle alt value, adjusting minimum to %g",
288 v->setMin(altVal - 1
e-5);
290 if (
v->getMax() <= altVal) {
291 ::Info(
"xRooHypoSpace::scan",
"range of POI does not straddle alt value, adjusting maximum to %g",
293 v->setMax(altVal + 1
e-5);
295 for (
auto &[
pdf, nll] : fNlls) {
296 if (
auto _v =
dynamic_cast<RooRealVar *
>(nll->pars()->find(*
a))) {
297 _v->setRange(
v->getMin(),
v->getMax());
307 if (high < low || (high == low && nPoints != 1)) {
309 low =
p->getMin(
"scan");
310 high =
p->getMax(
"scan");
312 if (!std::isnan(low) && !std::isnan(high) && !(std::isinf(low) && std::isinf(high))) {
313 p->setRange(
"scan", low, high);
315 if (
p->hasRange(
"scan")) {
316 ::Info(
"xRooHypoSpace::scan",
"Using %s scan range: %g - %g",
p->
GetName(),
p->getMin(
"scan"),
p->getMax(
"scan"));
320 for (
auto nSigma : nSigmas) {
321 if (std::isnan(nSigma)) {
330 relUncert = std::numeric_limits<double>::infinity();
339#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 26, 00)
359 for (
auto file : *
gROOT->GetListOfFiles()) {
360 if (
auto f =
dynamic_cast<TMemFile *
>(file)) {
366 new TMemFile(
"fitDatabase",
"RECREATE");
375 for (
double nSigma : nSigmas) {
377 if (std::isnan(nSigma)) {
385 if (std::isnan(res.first) || std::isnan(res.second)) {
387 }
else if (std::isinf(res.second)) {
392 throw std::runtime_error(
TString::Format(
"Automatic scanning not yet supported for %s",
type));
397 AddPoint(
TString::Format(
"%s=%g", poi().first()->GetName(), (high + low) / 2.));
400 double step = (high - low) / (nPoints - 1);
401 for (
size_t i = 0; i < nPoints; i++) {
402 AddPoint(
TString::Format(
"%s=%g", poi().first()->GetName(), low + step * i));
414std::map<std::string, xRooNLLVar::xValueWithError>
421 relUncert = std::numeric_limits<double>::infinity();
424 scan(opt, nSigmas, relUncert);
426 std::map<std::string, xRooNLLVar::xValueWithError> out;
427 for (
auto nSigma : nSigmas) {
428 auto lim = limit(opt, nSigma);
430 lim.second = -lim.second;
448 auto _idx = s.
Index(
'=');
453 auto _v =
dynamic_cast<RooRealVar *
>(fPars->find(_name));
457 if (
_val.IsFloat()) {
459 _v->setVal(
_val.Atof());
466 throw std::runtime_error(
"no model at coordinates");
473 if (fNlls.find(_pdf) == fNlls.end()) {
474 fNlls[_pdf] = std::make_shared<xRooNLLVar>(_pdf->nll(
"" , {}));
479 out.nllVar = fNlls[_pdf];
480 out.fData = fNlls[_pdf]->getData();
481 out.isExpected =
dynamic_cast<RooDataSet *
>(out.fData.first.get()) &&
482 dynamic_cast<RooDataSet *
>(out.fData.first.get())->weightVar()->getAttribute(
"expected");
485 out.coords.reset(fPars->snapshot());
487 out.poi().setAttribAll(
"Constant");
494 ->remove(*std::unique_ptr<RooAbsCollection>(out.coords->selectByAttrib(
"Constant",
false)),
true,
true);
496 double value = out.fNullVal();
497 double alt_value = out.fAltVal();
499 auto _type = fTestStatType;
502 if (std::isnan(alt_value)) {
504 }
else if (
value >= alt_value) {
511 out.fPllType = _type;
514 for (
auto &
p : *
this) {
515 if (
p.nllVar != out.nllVar)
517 if (
p.fData != out.fData)
519 if (!
p.alt_poi().equals(out.alt_poi()))
522 for (
auto c :
p.alt_poi()) {
524 v && std::abs(
v->getVal() - out.alt_poi().getRealValue(
v->GetName())) > 1
e-12) {
529 out.alt_poi().getCatIndex(cat->GetName(), std::numeric_limits<int>().max())) {
536 if (!
p.coords->equals(*out.coords))
538 for (
auto c : *
p.coords) {
539 if (
c->getAttribute(
"poi")) {
543 v && std::abs(
v->getVal() - out.coords->getRealValue(
v->GetName())) > 1
e-12) {
548 out.alt_poi().getCatIndex(cat->GetName(), std::numeric_limits<int>().max())) {
557 if (
auto cfit =
p.cfit_alt(
true)) {
558 out.fAlt_cfit = cfit;
560 if (
p.asimov(
true) &&
p.asimov(
true)->fData.first && (!out.asimov(
true) || !out.asimov(
true)->fData.first)) {
561 out.asimov()->fData =
p.asimov(
true)->fData;
563 if (!
p.poi().equals(out.poi()))
565 for (
auto c :
p.poi()) {
567 v && std::abs(
v->getVal() - out.poi().getRealValue(
v->GetName())) > 1
e-12) {
578 std::string coordString;
579 for (
auto a : axes()) {
580 coordString +=
TString::Format(
"%s=%g",
a->GetName(), out.coords->getRealValue(
a->GetName()));
583 coordString.erase(coordString.end() - 1);
585 ::Info(
"xRooHypoSpace::AddPoint",
"Added new point @ %s", coordString.c_str());
586 return emplace_back(out);
593 throw std::runtime_error(
"Not a pdf");
599 auto vpars = toArgs(validity);
601 vpars.remove(
pars,
true,
true);
604 if (
auto existing =
pdf(
pars)) {
605 throw std::runtime_error(std::string(
"Clashing model: ") + existing->GetName());
608 auto myPars = std::shared_ptr<RooArgList>(
dynamic_cast<RooArgList *
>(
pars.snapshot()));
611 pars.remove(*fPars,
true,
true);
613 fPars->addClone(
pars);
615 fPdfs.insert(std::make_pair(myPars, std::make_shared<xRooNode>(_pdf)));
626 out.add(*std::unique_ptr<RooAbsCollection>(
627 fPars->selectByAttrib(
"axis",
true)));
633 std::set<std::vector<double>> coords;
634 for (
auto &
p : *
this) {
635 std::vector<double> p_coords;
637 auto _v =
dynamic_cast<RooRealVar *
>(
p.coords->find(o->GetName()));
639 (_v && _v->isConstant())
641 : std::numeric_limits<double>::infinity());
644 if (coords.find(p_coords) != coords.end()) {
648 coords.insert(p_coords);
653 std::map<std::string, std::unordered_set<double>> values;
654 for (
auto &par : *
pars()) {
657 for (
auto p : *
this) {
658 auto _v =
dynamic_cast<RooRealVar *
>(
p.coords->find(par->GetName()));
659 values[par->GetName()].insert(
660 (_v && _v->isConstant())
662 : std::numeric_limits<double>::infinity());
671 for (
auto &[k,
v] : values) {
672 if (
v.size() > maxDiff || (
v.size() == maxDiff && !isPOI &&
pars()->find(k.c_str())->getAttribute(
"poi"))) {
674 isPOI =
pars()->find(k.c_str())->getAttribute(
"poi");
675 maxDiff = std::max(maxDiff,
v.size());
678 if (bestVar.empty()) {
682 out.add(*
pars()->find(bestVar.c_str()));
687 std::unique_ptr<RooAbsCollection> poi(out.selectByAttrib(
"poi",
true));
698 out.add(*std::unique_ptr<RooAbsCollection>(
pars()->selectByAttrib(
"poi",
true)));
722 Error(
"LoadFits",
"Path not found %s", apath);
732 std::map<std::set<std::tuple<std::string, double, std::string>>, std::set<std::set<std::string>>> cfits;
733 std::set<std::string> allpois;
738 std::cout <<
"Processing " << _dir->GetName() << std::endl;
739 if (
auto keys = _dir->GetListOfKeys(); keys) {
742 bool isNllDir =
false;
743 for (
auto &&k : *keys) {
744 TKey *key =
dynamic_cast<TKey *
>(k);
745 if (strcmp(key->
GetClassName(),
"RooLinkedList") == 0) {
751 for (
auto &&k : *keys) {
752 if (
auto subdir = _dir->GetDirectory(k->GetName()); subdir) {
754 LoadFits(subdir->GetPath());
761 if (cl->InheritsFrom(
"RooFitResult")) {
762 if (
auto cachedFit = _dir->Get<
RooFitResult>(k->GetName()); cachedFit) {
766 std::unique_ptr<RooAbsCollection> snap(cachedFit->floatParsFinal().snapshot());
767 snap->remove(*fPars,
true,
true);
768 fPars->addClone(*snap);
770 for (
auto &
p : cachedFit->constPars()) {
771 if (
p->getAttribute(
"global"))
777 if (!fPars->contains(*
v))
782 std::set<std::string> floatPars;
783 for (
auto &
p : cachedFit->floatParsFinal())
788 std::set<std::tuple<std::string, double, std::string>> constPars;
789 for (
auto &
p : cachedFit->constPars()) {
790 if (
p->getAttribute(
"global"))
797 std::make_tuple(
v->GetName(),
v->getVal(),
798 v->getStringAttribute(
"altVal") ?
v->getStringAttribute(
"altVal") :
""));
801 for (
auto &&[key,
value] : cfits) {
802 if (constPars == key)
804 if (std::includes(constPars.begin(), constPars.end(), key.begin(), key.end())) {
808 std::set<std::string> pois;
809 for (
auto &&par : constPars) {
810 if (key.find(par) == key.end()) {
811 pois.insert(std::get<0>(par));
812 allpois.insert(std::get<0>(par));
816 cfits[constPars].insert(pois);
851 ::Info(
"xRooHypoSpace::xRooHypoSpace",
"%s - Loaded %d fits", apath, nFits);
853 if (allpois.size() == 1) {
854 ::Info(
"xRooHypoSpace::xRooHypoSpace",
"Detected POI: %s", allpois.begin()->c_str());
856 auto nll = std::make_shared<xRooNLLVar>(
nullptr,
nullptr);
857 auto dummyNll = std::make_shared<RooRealVar>(apath,
"Dummy NLL", std::numeric_limits<double>::quiet_NaN());
858 nll->std::shared_ptr<
RooAbsReal>::operator=(dummyNll);
862 for (
auto &&
p : *fPars) {
867 for (
auto &
p : allpois) {
868 fPars->find(
p.c_str())->setAttribute(
"poi",
true);
873 for (
auto &&[key,
value] : cfits) {
876 auto _coords = std::make_shared<RooArgSet>();
877 for (
auto &k : key) {
878 auto v = _coords->addClone(
RooRealVar(std::get<0>(k).c_str(), std::get<0>(k).c_str(), std::get<1>(k)));
879 v->setAttribute(
"poi", allpois.find(std::get<0>(k)) != allpois.end());
880 if (!std::get<2>(k).empty()) {
881 v->setStringAttribute(
"altVal", std::get<2>(k).c_str());
896 if (std::isnan(hp.
fAltVal())) {
907 }
else if (nFits > 0) {
908 std::cout <<
"possible POI: ";
909 for (
auto p : allpois)
910 std::cout <<
p <<
",";
911 std::cout << std::endl;
922 for (
size_t i = 0; i <
size(); i++) {
923 std::cout << i <<
") ";
924 for (
auto a : _axes) {
925 if (
a != _axes.first())
927 std::cout <<
a->GetName() <<
"="
928 << at(i).coords->getRealValue(
a->GetName(), std::numeric_limits<double>::quiet_NaN());
930 std::cout <<
" status=[ufit:";
935 std::cout << ufit->
status();
938 std::cout <<
",cfit_null:";
939 auto cfit =
const_cast<xRooHypoPoint &
>(at(i)).cfit_null(
true);
943 std::cout << cfit->
status();
946 std::cout <<
",cfit_alt:";
947 auto afit =
const_cast<xRooHypoPoint &
>(at(i)).cfit_alt(
true);
951 std::cout << afit->
status();
954 if (
auto asiPoint =
const_cast<xRooHypoPoint &
>(at(i)).asimov(
true)) {
955 std::cout <<
",asimov.ufit:";
956 auto asi_ufit = asiPoint->ufit(
true);
960 std::cout << asi_ufit->status();
963 std::cout <<
",asimov.cfit_null:";
964 auto asi_cfit = asiPoint->cfit_null(
true);
968 std::cout << asi_cfit->status();
973 auto sigma_mu =
const_cast<xRooHypoPoint &
>(at(i)).sigma_mu(
true);
974 if (!std::isnan(sigma_mu.first)) {
975 std::cout <<
" sigma_mu=" << sigma_mu.first;
977 std::cout <<
" +/- " << sigma_mu.second;
979 std::cout << std::endl;
981 std::cout <<
"--------------------------" << std::endl;
982 std::cout <<
"Number of bad fits: " << badFits << std::endl;
986 const char *opt )
const
993 bool readOnly = sOpt.
Contains(
"readonly");
994 bool visualize = sOpt.
Contains(
"visualize") && !readOnly;
1001 : std::numeric_limits<double>::quiet_NaN();
1003 !std::isnan(nSigma) && nSigma && !(sOpt(sOpt.
Index(
"exp") + 3) ==
'+' || sOpt(sOpt.
Index(
"exp") + 3) ==
'-');
1005 auto _axes = axes();
1006 if (_axes.size() != 1)
1009 auto out = std::make_shared<TGraphErrors>();
1010 out->SetName(GetName());
1011 out->SetEditable(
false);
1012 const char *sCL = (doCLs) ?
"CLs" :
"null";
1016 (std::isnan(nSigma))
1018 : (!nSigma ?
"Expected"
1020 expBand || !nSigma ?
"" : ((nSigma < 0) ?
"-" :
"+"),
int(nSigma))
1022 _axes.at(0)->GetTitle(), sCL);
1024 if (std::isnan(nSigma)) {
1026 out->SetMarkerStyle(20);
1027 out->SetMarkerSize(0.5);
1029 out->SetNameTitle(
"obs_ts",
TString::Format(
"Observed;%s;%s", _axes.at(0)->GetTitle(),
1030 (empty() ?
"" : front().tsTitle(
true).Data())));
1033 out->SetNameTitle(
TString::Format(
"exp%d_p%s",
int(nSigma), sCL), title);
1034 out->SetMarkerStyle(0);
1035 out->SetMarkerSize(0);
1036 out->SetLineStyle(2 +
int(nSigma));
1037 if (expBand && nSigma) {
1040 out->SetLineStyle(0);
1041 out->SetLineWidth(0);
1042 auto x = out->Clone(
"up");
1046 out->GetListOfFunctions()->Add(
x,
"F");
1047 x = out->Clone(
"down");
1051 out->GetListOfFunctions()->Add(
x,
"F");
1055 TString::Format(
"Expected;%s;%s", _axes.at(0)->GetTitle(), front().tsTitle(
true).Data()));
1059 auto badPoints = [&]() {
1060 auto badPoints2 =
dynamic_cast<TGraph *
>(out->GetListOfFunctions()->FindObject(
"badPoints"));
1064 badPoints2->SetName(
"badPoints");
1065 badPoints2->SetMarkerStyle(5);
1066 badPoints2->SetMarkerColor(std::isnan(nSigma) ?
kRed :
kBlue);
1067 badPoints2->SetMarkerSize(1);
1068 out->GetListOfFunctions()->Add(badPoints2,
"P");
1072 int nPointsDown = 0;
1077 for (
auto &
p : *
this) {
1081 auto gra =
graph(sOpt +
" readOnly");
1082 if (gra && gra->GetN()) {
1084 gROOT->GetSelectedPad()->cd();
1087 gra->DrawClone(expBand ?
"AF" :
"ALP")->SetBit(
kCanDelete);
1088#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1089 if (
auto pad =
gROOT->GetSelectedPad()) {
1090 pad->GetCanvas()->ResetUpdated();
1096 ::Info(
"xRooHypoSpace::graph",
"Completed %d/%d points for %s",
int(nDone),
int(
size()), sOpt.
Data());
1102 double _x =
p.coords->getRealValue(_axes.at(0)->GetName(), std::numeric_limits<double>::quiet_NaN());
1104 auto idx = out->GetN() - nPointsDown;
1106 if (std::isnan(pval.first)) {
1107 if (
p.status() != 0) {
1108 badPoints()->SetPoint(badPoints()->GetN(), _x, 0);
1111 out->InsertPointBefore(idx, _x, pval.first);
1112 out->SetPointError(idx, 0, pval.second);
1115 if (expBand && nSigma) {
1119 if (std::isnan(pval.first)) {
1120 if (
p.status() != 0) {
1121 badPoints()->SetPoint(badPoints()->GetN(), _x, 0);
1124 out->InsertPointBefore(idx + 1, _x, pval.first);
1125 out->SetPointError(idx + 1, 0, pval.second);
1127 if (out->GetPointY(idx) < pval.first)
1134 if (out->GetN() == 0)
1139 if (out->GetListOfFunctions()->FindObject(
"badPoints")) {
1141 for (
int i = 0; i < badPoints()->GetN(); i++) {
1142 badPoints()->SetPointY(i, out->Eval(badPoints()->GetPointX(i)));
1147 out->Sort(&
TGraph::CompareX,
false, out->GetN() - nPointsDown, out->GetN() - 1);
1150 auto up =
dynamic_cast<TGraph *
>(out->GetListOfFunctions()->FindObject(
"up"));
1151 auto down =
dynamic_cast<TGraph *
>(out->GetListOfFunctions()->FindObject(
"down"));
1153 for (
int i = 0; i < out->GetN(); i++) {
1154 if (i < out->GetN() - nPointsDown) {
1155 up->
SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) + out->GetErrorY(i) * (above ? 1. : -1.));
1156 down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
1158 up->SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
1159 down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) + out->GetErrorY(i) * (above ? 1. : -1.));
1167 gROOT->GetSelectedPad()->cd();
1170 out->DrawClone(expBand ?
"AF" :
"ALP")->SetBit(
kCanDelete);
1171#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1172 if (
auto pad =
gROOT->GetSelectedPad()) {
1173 pad->GetCanvas()->ResetUpdated();
1186 std::shared_ptr<TMultiGraph> out;
1189 bool visualize = sOpt.
Contains(
"visualize");
1192 auto exp2 =
graph(sOpt +
" exp2");
1193 auto exp1 =
graph(sOpt +
" exp1");
1194 auto exp =
graph(sOpt +
" exp");
1197 auto obs = (doObs) ?
graph(sOpt) :
nullptr;
1199 out = std::make_shared<TMultiGraph>(GetName(), GetTitle());
1200 if (exp2 && exp2->GetN() > 1)
1201 out->Add(
static_cast<TGraph *
>(exp2->Clone()),
"FP");
1202 if (exp1 && exp1->GetN() > 1)
1203 out->Add(
static_cast<TGraph *
>(exp1->Clone()),
"FP");
1204 if (exp && exp->GetN() > 1)
1205 out->Add(
static_cast<TGraph *
>(exp->Clone()),
"LP");
1206 if (obs && obs->GetN() > 1)
1207 out->Add(
static_cast<TGraph *
>(obs->Clone()),
"LP");
1209 if (!out->GetListOfGraphs()) {
1213 TGraph *testedPoints =
nullptr;
1216 line->SetName(
"alpha");
1218 line->SetEditable(
false);
1219 line->SetPoint(
line->GetN(), out->GetHistogram()->GetXaxis()->GetXmin() - 10, 0.05);
1220 testedPoints =
new TGraph;
1221 testedPoints->
SetName(
"hypoPoints");
1226 for (
int i = 0; i < exp->GetN(); i++) {
1227 testedPoints->
SetPoint(testedPoints->
GetN(), exp->GetPointX(i), 0.05);
1230 line->SetPoint(
line->GetN(), out->GetHistogram()->GetXaxis()->GetXmax() + 10, 0.05);
1232 out->GetListOfFunctions()->Add(
line,
"L");
1235 out->GetHistogram()->GetXaxis()->SetTitle(exp->GetHistogram()->GetXaxis()->GetTitle());
1236 out->GetHistogram()->GetYaxis()->SetTitle(exp->GetHistogram()->GetYaxis()->GetTitle());
1240 leg->SetName(
"legend");
1243 out->GetListOfFunctions()->Add(
leg);
1246 for (
auto g : *out->GetListOfGraphs()) {
1248 leg->AddEntry(o,
"",
"F");
1250 leg->AddEntry(
g,
"",
"LPE");
1256 if (exp2 && exp2->GetN() > 1) {
1260 if (exp1 && exp1->GetN() > 1) {
1264 if (exp && exp->GetN() > 1) {
1268 if (exp1 && exp1->GetN() > 1) {
1272 if (exp2 && exp2->GetN() > 1) {
1276 if (obs && obs->GetN() > 1) {
1282 out->Add(testedPoints,
"P");
1286 gROOT->GetSelectedPad()->cd();
1289 auto gra2 =
static_cast<TMultiGraph *
>(out->DrawClone(
"A"));
1292 gra2->GetHistogram()->SetMinimum(1
e-6);
1296 gPad->GetCanvas()->Paint();
1297 gPad->GetCanvas()->Update();
1298#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1299 gPad->GetCanvas()->ResetUpdated();
1312 if (std::isnan(
target)) {
1316 auto gr = std::make_shared<TGraph>(pValues);
1319 std::set<double> existingX;
1320 while (i < gr->GetN()) {
1323 }
else if (existingX.find(
gr->
GetPointX(i)) != existingX.end()) {
1337 return std::pair<double, double>(std::numeric_limits<double>::quiet_NaN(), 0);
1340 double alpha = log(
target);
1343 for (
int ii = 1; ii <
gr->
GetN(); ii++) {
1354 return std::pair(lim, err);
1369 return std::pair(std::numeric_limits<double>::infinity(), std::numeric_limits<double>::infinity());
1370 return std::pair((alpha -
y1) /
m +
x1, std::numeric_limits<double>::infinity());
1377 return std::pair(-std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity());
1378 return std::pair((alpha -
y1) /
m +
x1, -std::numeric_limits<double>::infinity());
1385 if (std::isnan(nSigma)) {
1390 return GetLimit(*
graph(sOpt +
" readonly"));
1397 bool visualize = sOpt.
Contains(
"visualize");
1399 std::shared_ptr<TGraphErrors>
gr =
graph(sOpt +
" readonly");
1401 auto gra = graphs(sOpt.
Contains(
"toys") ?
"pcls readonly toys" :
"pcls readonly");
1408 gra->GetHistogram()->SetMinimum(1
e-9);
1409 gra->GetHistogram()->GetYaxis()->SetRangeUser(1
e-9, 1);
1411#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1412 gPad->GetCanvas()->ResetUpdated();
1419 for (
auto p : axes()) {
1420 for (
auto &[
pdf, nll] : fNlls) {
1421 if (
auto _v =
dynamic_cast<RooRealVar *
>(nll->pars()->find(*
p))) {
1422 dynamic_cast<RooRealVar *
>(
p)->setRange(_v->getMin(), _v->getMax());
1428 auto v = (axes().empty()) ?
nullptr :
dynamic_cast<RooRealVar *
>(*axes().rbegin());
1430 return std::pair(std::numeric_limits<double>::quiet_NaN(), 0.);
1431 double muMax = std::min(std::min(
v->getMax(
"physical"),
v->getMax()),
v->getMax(
"scan"));
1432 double muMin = std::max(std::max(
v->getMin(
"physical"),
v->getMin()),
v->getMin(
"scan"));
1434 if (maxTries == 0 || std::isnan(AddPoint(
TString::Format(
"%s=%g",
v->GetName(), muMin)).getVal(sOpt).first)) {
1436 Error(
"findlimit",
"Problem evaluating %s @ %s=%g", sOpt.
Data(),
v->GetName(), muMin);
1437 return std::pair(std::numeric_limits<double>::quiet_NaN(), 0.);
1440 return findlimit(opt, relUncert, maxTries - 1);
1447 double nextPoint = muMin + (muMax - muMin) / 50;
1453 auto expLim = findlimit(sOpt2, std::numeric_limits<double>::infinity(), 0);
1454 if (!std::isnan(expLim.first) && expLim.first < nextPoint)
1455 nextPoint = expLim.first;
1459 (sOpt.
Contains(
"exp")) ? back().asimov() : std::shared_ptr<xRooHypoPoint>(&back(), [](
xRooHypoPoint *) {});
1461 if (point && point->ufit()) {
1462 double rough_sigma_mu = point->mu_hat().getError();
1465 nextPoint = another_estimate;
1466 ::Info(
"xRooHypoSpace::findlimit",
"Guessing %g based on rough sigma_mu = %g", nextPoint, rough_sigma_mu);
1470 if (maxTries == 0 || std::isnan(AddPoint(
TString::Format(
"%s=%g",
v->GetName(), nextPoint)).getVal(sOpt).first)) {
1472 Error(
"findlimit",
"Problem evaluating %s @ %s=%g", sOpt.
Data(),
v->GetName(), nextPoint);
1473 return std::pair(std::numeric_limits<double>::quiet_NaN(), 0.);
1476 return findlimit(opt, relUncert, maxTries - 1);
1479 auto lim = GetLimit(*
gr);
1481 if (std::isnan(lim.first)) {
1485 auto v =
dynamic_cast<RooRealVar *
>(*axes().rbegin());
1486 double maxMu = std::min(std::min(
v->getMax(
"physical"),
v->getMax()),
v->getMax(
"scan"));
1487 double minMu = std::max(std::max(
v->getMin(
"physical"),
v->getMin()),
v->getMin(
"scan"));
1490 if (lim.first > -std::numeric_limits<double>::infinity() && lim.first < std::numeric_limits<double>::infinity() &&
1491 (std::abs(lim.second) <= relUncert * std::abs(lim.first) ))
1496 if (lim.second == std::numeric_limits<double>::infinity()) {
1498 nextPoint = lim.first;
1499 if (nextPoint == std::numeric_limits<double>::infinity() || nextPoint > maxMu) {
1506 (sOpt.
Contains(
"exp")) ? back().asimov() : std::shared_ptr<xRooHypoPoint>(&back(), [](
xRooHypoPoint *) {});
1508 if (point && point->ufit()) {
1509 double rough_sigma_mu = point->mu_hat().getError();
1512 nextPoint = std::max(nextPoint, another_estimate);
1513 ::Info(
"xRooHypoSpace::findlimit",
"Guessing %g based on rough sigma_mu = %g", nextPoint, rough_sigma_mu);
1516 nextPoint = std::min(nextPoint + nextPoint * relUncert * 0.99, maxMu);
1518 if (nextPoint > maxMu)
1520 }
else if (lim.second == -std::numeric_limits<double>::infinity()) {
1522 nextPoint = lim.first;
1523 if (nextPoint < minMu)
1524 nextPoint =
gr->
GetPointX(0) - (maxMu - minMu) / 50;
1525 if (nextPoint < minMu)
1528 nextPoint = lim.first + lim.second * relUncert * 0.99;
1534 ::Info(
"xRooHypoSpace::findlimit",
"%s -- Testing new point @ %s=%g (delta=%g)", sOpt.
Data(),
v->GetName(),
1535 nextPoint, lim.second);
1536 if (maxTries == 0 || std::isnan(AddPoint(
TString::Format(
"%s=%g",
v->GetName(), nextPoint)).getVal(sOpt).first)) {
1537 if (maxTries == 0) {
1538 Warning(
"findlimit",
"Reached max number of point evaluations");
1540 Error(
"findlimit",
"Problem evaluating %s @ %s=%g", sOpt.
Data(),
v->GetName(), nextPoint);
1545 return findlimit(opt, relUncert, maxTries - 1);
1554 if ((sOpt ==
"" || sOpt ==
"same") && !empty()) {
1557 for (
auto &hp : *
this) {
1558 if (!hp.nullToys.empty() || !hp.altToys.empty()) {
1569 auto _axes = axes();
1573 if (sOpt ==
"status") {
1575 if (_axes.size() <= 2) {
1578 out->SetName(
"points");
1579 out->SetMarkerSize(0.5);
1590 badPoints->
SetName(
"bad_ufit");
1596 badPoints2->
SetName(
"bad_cfit_null");
1602 out->SetTitle(
TString::Format(
"%s;%s;%s", GetTitle(), _axes.at(0)->GetTitle(),
1603 (_axes.size() == 1) ?
"" : _axes.at(1)->GetTitle()));
1604 for (
auto &
p : *
this) {
1605 bool _readOnly =
p.nllVar ?
p.nllVar->get()->getAttribute(
"readOnly") :
false;
1607 p.nllVar->get()->setAttribute(
"readOnly",
true);
1608 double x =
p.coords->getRealValue(_axes.at(0)->GetName());
1609 double y = _axes.size() == 1 ?
p.ts_asymp().first :
p.coords->getRealValue(_axes.at(1)->GetName());
1610 out->SetPoint(out->GetN(),
x,
y);
1611 if (!std::isnan(
p.ts_asymp().first)) {
1612 if (_axes.size() == 1)
1613 out->SetPointError(out->GetN() - 1, 0,
p.ts_asymp().second);
1615 }
else if (
p.fUfit && (std::isnan(
p.fUfit->minNll()) ||
1619 }
else if (
p.fNull_cfit && (std::isnan(
p.fNull_cfit->minNll()) ||
1624 if (!std::isnan(
p.ts_asymp(0).first)) {
1626 }
else if (
p.asimov() &&
p.asimov()->fUfit &&
1627 (std::isnan(
p.asimov()->fUfit->minNll()) ||
1631 }
else if (
p.asimov() &&
p.asimov()->fNull_cfit &&
1632 (std::isnan(
p.asimov()->fNull_cfit->minNll()) ||
1637 p.nllVar->get()->setAttribute(
"readOnly", _readOnly);
1640 if (_axes.size() == 1) {
1642 for (
int i = 0; i < out->GetN(); i++) {
1643 if (!std::isnan(out->GetPointY(i)))
1644 tmp.SetPoint(tmp.GetN(), out->GetPointX(i), out->GetPointY(i));
1646 auto fixPoints = [&](
TGraph *
g) {
1647 for (
int i = 0; i <
g->GetN(); i++) {
1648 if (std::isnan(
g->GetPointY(i)))
1649 g->SetPointY(i, std::isnan(tmp.Eval(
g->GetPointX(i))) ? 0. : tmp.Eval(
g->GetPointX(i)));
1654 fixPoints(expAvail);
1655 fixPoints(badPoints);
1656 fixPoints(badPoints2);
1659 out->SetMarkerStyle(4);
1661 auto leg =
new TLegend(1. -
gPad->GetRightMargin() - 0.3, 1. -
gPad->GetTopMargin() - 0.35,
1662 1. -
gPad->GetRightMargin() - 0.05, 1. -
gPad->GetTopMargin() - 0.05);
1663 leg->SetName(
"legend");
1664 leg->AddEntry(out,
"Uncomputed",
"P");
1666 if (tsAvail->
GetN()) {
1667 out->GetListOfFunctions()->Add(tsAvail,
"P");
1668 leg->AddEntry(tsAvail,
"Computed",
"P");
1672 if (expAvail->
GetN()) {
1673 out->GetListOfFunctions()->Add(expAvail,
"P");
1674 leg->AddEntry(expAvail,
"Expected computed",
"P");
1678 if (badPoints->
GetN()) {
1679 out->GetListOfFunctions()->Add(badPoints,
"P");
1680 leg->AddEntry(badPoints,
"Bad ufit",
"P");
1684 if (badPoints2->
GetN()) {
1685 out->GetListOfFunctions()->Add(badPoints2,
"P");
1686 leg->AddEntry(badPoints2,
"Bad null cfit",
"P");
1693 gPad->SetGrid(
true, _axes.size() > 1);
1694 if (_axes.size() == 1)
1695 gPad->SetLogy(
false);
1704 auto gra = graphs(sOpt +
" readonly");
1706 gROOT->GetSelectedPad()->cd();
1714 gra2->GetHistogram()->SetMinimum(1
e-6);
1718 gPad->GetCanvas()->Paint();
1719 gPad->GetCanvas()->Update();
1720#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1721 gPad->GetCanvas()->ResetUpdated();
1742 out->SetName(GetName());
1747 if (!empty() && axes().
size() == 1) {
1748 for (
auto &
p : *
this) {
1750 pllType =
p.fPllType;
1754 title += front().tsTitle(
true);
1757 out->SetTitle(title);
1758 *
dynamic_cast<TAttFill *
>(out) = *
this;
1759 *
dynamic_cast<TAttLine *
>(out) = *
this;
1769 bool doFits =
false;
1775 auto mainPad =
gPad;
1777 out->SetEditable(
false);
1782 gPad->SetBottomMargin(
gPad->GetBottomMargin() * 2.);
1786 mainPad = basePad->
GetPad(1);
1792 std::pair<double, double> minMax(std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity());
1793 for (
auto &
p : *
this) {
1794 if (
p.fPllType != pllType)
1796 auto val =
p.pll(
true).first;
1797 if (std::isnan(val))
1799 minMax.first = std::min(minMax.first, val);
1800 minMax.second = std::max(minMax.second, val);
1802 if (minMax.first < std::numeric_limits<double>::infinity())
1803 out->GetHistogram()->SetMinimum(minMax.first);
1804 if (minMax.second > -std::numeric_limits<double>::infinity())
1805 out->GetHistogram()->SetMaximum(minMax.second);
1807 TGraph *badPoints =
nullptr;
1811 std::shared_ptr<const RooFitResult> ufr;
1812 for (
auto &
p : *
this) {
1813 if (
p.fPllType != pllType)
1815 auto val =
p.pll().first;
1818 if (out->GetN() == 0 && ufr && ufr->status() == 0) {
1819 out->SetPoint(out->GetN(),
1820 ufr->floatParsFinal().getRealValue(axes().first()->GetName(),
1821 ufr->constPars().getRealValue(axes().first()->GetName())),
1823 out->SetPointError(out->GetN() - 1, 0, ufr->edm());
1825 if (
auto fr =
p.fNull_cfit;
1830 new TPad(fr->GetName(),
TString::Format(
"%s = %g", poi().first()->GetTitle(),
p.fNullVal()), 0, 0, 1., 1);
1831 pad->SetNumber(out->GetN() + 1);
1838 if (std::isnan(val) &&
p.status() != 0) {
1842 badPoints->
SetName(
"badPoints");
1846 out->GetListOfFunctions()->Add(badPoints,
"P");
1848 badPoints->
SetPoint(badPoints->
GetN(),
p.fNullVal(), out->Eval(
p.fNullVal()));
1849 mainPad->Modified();
1850 }
else if (!std::isnan(val)) {
1851 out->SetPoint(out->GetN(),
p.coords->getRealValue(axes().first()->GetName()),
p.pll().first);
1852 out->SetPointError(out->GetN() - 1, 0,
p.pll().second);
1857 for (
int i = 0; i < badPoints->
GetN(); i++)
1861 mainPad->Modified();
1874#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 30, 00)
1880 if (ufr && doFits) {
1882 auto pad =
new TPad(ufr->GetName(),
"unconditional fit", 0, 0, 1., 1.);
1890 pad =
new TPad(
"selected",
"selected", 0, 0, 1, 1);
1905 gPad->GetCanvas()->
Connect(
"Highlighted(TVirtualPad*,TObject*,Int_t,Int_t)",
"xRooNode::InteractiveObject",
1917 auto _axes = axes();
1922 out->SetTitle(GetTitle());
1924 for (
auto &
p : *
this) {
1925 double _x =
p.coords->getRealValue(_axes.at(0)->GetName(), std::numeric_limits<double>::quiet_NaN());
1926 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)
std::shared_ptr< const RooAbsCollection > coords
std::shared_ptr< xRooNLLVar > nllVar
xRooFit::Asymptotics::PLLType fPllType
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.
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...
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.
void setAttribute(const Text_t *name, bool value=true)
Set (default) or clear a named boolean attribute of this object.
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.
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.
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.
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
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 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.
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...
#define BEGIN_XROOFIT_NAMESPACE
#define END_XROOFIT_NAMESPACE