Skip to content

Commit 36ad2c9

Browse files
will-cernguitargeek
authored andcommitted
[RF] Relocate the macro definition for XROOFIT_NAMESPACE_NAME
In Tests running in StatAnalysis we are seeing errors related to this macro definition. The changes in this PR are to try to consolidate the definition of XROOFIT_NAMESPACE_NAME in the `Config.h` file, which hopefully will resolve the ambiguities. The problems were observed after building xRooFit on top of ROOT and then on the root prompt doing: `#include "xRooFit/xRooFit.h"` I also ran a clang format, which is the source of the whitespace changes in this PR. (cherry picked from commit 33cc89c)
1 parent 3fee3b9 commit 36ad2c9

4 files changed

Lines changed: 13 additions & 21 deletions

File tree

roofit/xroofit/inc/RooFit/xRooFit/Config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
#ifdef XROOFIT_NAMESPACE
2424
#define BEGIN_XROOFIT_NAMESPACE namespace XROOFIT_NAMESPACE {
2525
#define END_XROOFIT_NAMESPACE } // namespace XROOFIT_NAMESPACE
26+
#define XROOFIT_NAMESPACE_NAME XROOFIT_NAMESPACE
2627
#else
2728
#define BEGIN_XROOFIT_NAMESPACE
2829
#define END_XROOFIT_NAMESPACE
30+
#define XROOFIT_NAMESPACE_NAME
2931
#endif
3032

3133
#endif

roofit/xroofit/inc/RooFit/xRooFit/xRooNLLVar.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -514,13 +514,7 @@ class xRooNLLVar : public std::shared_ptr<RooAbsReal> {
514514

515515
END_XROOFIT_NAMESPACE
516516

517-
#ifndef XROOFIT_NAMESPACE_NAME
518-
#ifdef XROOFIT_NAMESPACE
519-
#define XROOFIT_NAMESPACE_NAME XROOFIT_NAMESPACE
520-
#else
521-
#define XROOFIT_NAMESPACE_NAME
522-
#endif
523-
#endif
517+
524518
namespace cling {
525519
std::string printValue(const XROOFIT_NAMESPACE_NAME::xRooNLLVar::xValueWithError *val);
526520
std::string printValue(const std::map<std::string, XROOFIT_NAMESPACE_NAME::xRooNLLVar::xValueWithError> *m);

roofit/xroofit/inc/RooFit/xRooFit/xRooNode.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -559,13 +559,7 @@ class xRooNode : public TNamed, public std::vector<std::shared_ptr<xRooNode>> {
559559

560560
END_XROOFIT_NAMESPACE
561561

562-
#ifndef XROOFIT_NAMESPACE_NAME
563-
#ifdef XROOFIT_NAMESPACE
564-
#define XROOFIT_NAMESPACE_NAME XROOFIT_NAMESPACE
565-
#else
566-
#define XROOFIT_NAMESPACE_NAME
567-
#endif
568-
#endif
562+
569563
namespace cling {
570564
std::string printValue(const XROOFIT_NAMESPACE_NAME::xRooNode *val);
571565
}

roofit/xroofit/src/xRooHypoSpace.cxx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,8 @@ std::shared_ptr<TGraphErrors> xRooNLLVar::xRooHypoSpace::graph(
910910
out->GetListOfFunctions()->Add(x, "F");
911911
x = out->Clone("down");
912912
x->SetBit(kCanDelete);
913-
dynamic_cast<TAttFill*>(x)->SetFillColor(kBlack);
914-
dynamic_cast<TAttFill*>(x)->SetFillStyle(nSigma == 2 ? 3005 : 3004);
913+
dynamic_cast<TAttFill *>(x)->SetFillColor(kBlack);
914+
dynamic_cast<TAttFill *>(x)->SetFillStyle(nSigma == 2 ? 3005 : 3004);
915915
out->GetListOfFunctions()->Add(x, "F");
916916
}
917917
if (sOpt.Contains("ts")) {
@@ -1017,19 +1017,21 @@ std::shared_ptr<TGraphErrors> xRooNLLVar::xRooHypoSpace::graph(
10171017
for (int i = 0; i < out->GetN(); i++) {
10181018
if (i < out->GetN() - nPointsDown) {
10191019
up->SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) + out->GetErrorY(i) * (above ? 1. : -1.));
1020-
//down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
1020+
// down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. :
1021+
// -1.));
10211022
} else {
1022-
//up->SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
1023+
// up->SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
10231024
down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) + out->GetErrorY(i) * (above ? 1. : -1.));
10241025
}
10251026
}
10261027
// now go back round in reverse
1027-
for (int i = out->GetN()-1; i >= 0; i--) {
1028+
for (int i = out->GetN() - 1; i >= 0; i--) {
10281029
if (i < out->GetN() - nPointsDown) {
10291030
up->SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
1030-
//down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
1031+
// down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. :
1032+
// -1.));
10311033
} else {
1032-
//up->SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
1034+
// up->SetPoint(up->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
10331035
down->SetPoint(down->GetN(), out->GetPointX(i), out->GetPointY(i) - out->GetErrorY(i) * (above ? 1. : -1.));
10341036
}
10351037
}

0 commit comments

Comments
 (0)