Skip to content

Commit 0f34653

Browse files
authored
[RF][HS3] Minor Bugfixes, added Streamers and name sanitizing scheme
- Added Streamers: - RooDecay - RooDerivative - RooAddModel - RooGaussModel - RooTruthModel - New name sanitizing Tool - Minor Bugfixes
1 parent 3de0869 commit 0f34653

14 files changed

+819
-90
lines changed

roofit/hs3/inc/RooFitHS3/RooJSONFactoryWSTool.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class RooJSONFactoryWSTool {
3939
public:
4040
static constexpr bool useListsInsteadOfDicts = true;
4141
static bool allowExportInvalidNames;
42+
static bool allowSanitizeNames;
43+
static RooWorkspace sanitizeWS(const RooWorkspace &ws);
44+
static RooWorkspace cleanWS(const RooWorkspace &ws, bool onlyModelConfig = false);
4245

4346
struct CombinedData {
4447
std::string name;
@@ -52,11 +55,14 @@ class RooJSONFactoryWSTool {
5255
static std::string name(const RooFit::Detail::JSONNode &n);
5356
static bool isValidName(const std::string &str);
5457
static bool testValidName(const std::string &str, bool forcError);
58+
static std::string sanitizeName(const std::string str);
59+
static void rebuildModelConfigInWorkspace(RooStats::ModelConfig *mc, RooWorkspace &ws);
5560

5661
static RooFit::Detail::JSONNode &appendNamedChild(RooFit::Detail::JSONNode &node, std::string const &name);
5762
static RooFit::Detail::JSONNode const *findNamedChild(RooFit::Detail::JSONNode const &node, std::string const &name);
5863

5964
static void fillSeq(RooFit::Detail::JSONNode &node, RooAbsCollection const &coll, size_t nMax = -1);
65+
static void fillSeqSanitizedName(RooFit::Detail::JSONNode &node, RooAbsCollection const &coll, size_t nMax = -1);
6066

6167
template <class T>
6268
T *request(const std::string &objname, const std::string &requestAuthor)
@@ -199,7 +205,6 @@ class RooJSONFactoryWSTool {
199205
private:
200206
template <class T>
201207
T *requestImpl(const std::string &objname);
202-
203208
void exportObject(RooAbsArg const &func, std::set<std::string> &exportedObjectNames);
204209

205210
// To export multiple objects sorted alphabetically
@@ -230,7 +235,8 @@ class RooJSONFactoryWSTool {
230235
void exportAllObjects(RooFit::Detail::JSONNode &n);
231236

232237
void exportModelConfig(RooFit::Detail::JSONNode &rootnode, RooStats::ModelConfig const &mc,
233-
const std::vector<RooJSONFactoryWSTool::CombinedData> &d);
238+
const std::vector<RooJSONFactoryWSTool::CombinedData> &combined,
239+
const std::vector<RooAbsData *> &single);
234240

235241
void exportSingleModelConfig(RooFit::Detail::JSONNode &rootnode, RooStats::ModelConfig const &mc,
236242
std::string const &analysisName,

roofit/hs3/src/JSONFactories_HistFactory.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ getOrCreateConstraint(RooJSONFactoryWSTool &tool, const JSONNode &mod, RooRealVa
263263
}
264264
return *constraint;
265265
} else {
266-
std::cout << "creating new constraint for " << param << std::endl;
267266
std::string constraint_type = "Gauss";
268267
if (auto constrType = mod.find("constraint_type")) {
269268
constraint_type = constrType->val();

0 commit comments

Comments
 (0)