From 84d04a15727c1a0cec6ba15bb85ba1e4dd9944a9 Mon Sep 17 00:00:00 2001
From: Charles Burton <burton@utexas.edu>
Date: Wed, 10 Jul 2019 18:33:33 +0000
Subject: [PATCH] Allow commas in titles, etc.

---
 .../AthenaMonitoring/python/ExampleMonitorAlgorithm.py   | 2 +-
 Control/AthenaMonitoring/src/HistogramDef.cxx            | 9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/Control/AthenaMonitoring/python/ExampleMonitorAlgorithm.py b/Control/AthenaMonitoring/python/ExampleMonitorAlgorithm.py
index aa1b7c1b1a3..21dc7d8c2d4 100644
--- a/Control/AthenaMonitoring/python/ExampleMonitorAlgorithm.py
+++ b/Control/AthenaMonitoring/python/ExampleMonitorAlgorithm.py
@@ -81,7 +81,7 @@ def ExampleMonitoringConfig(inputFlags):
 
     ### STEP 5 ###
     # Configure histograms
-    myGroup.defineHistogram('lumiPerBCID',title='Luminosity;L/BCID;Events',
+    myGroup.defineHistogram('lumiPerBCID',title='Luminosity","WithCommaInTitle;L/BCID;Events',
                             path='ToRuleThemAll',xbins=10,xmin=0.0,xmax=10.0)
     myGroup.defineHistogram('lb', title='Luminosity Block;lb;Events',
                             path='ToFindThem',xbins=1000,xmin=-0.5,xmax=999.5,weight='testweight')
diff --git a/Control/AthenaMonitoring/src/HistogramDef.cxx b/Control/AthenaMonitoring/src/HistogramDef.cxx
index 9d7c9234f53..5a52da40f72 100644
--- a/Control/AthenaMonitoring/src/HistogramDef.cxx
+++ b/Control/AthenaMonitoring/src/HistogramDef.cxx
@@ -9,7 +9,7 @@
 
 using namespace Monitored;
 
-typedef boost::tokenizer<boost::char_separator<char>> tokenizer_t;
+typedef boost::tokenizer<boost::escaped_list_separator<char>> tokenizer_t;
 
 const HistogramDef HistogramDef::parse(const std::string &histogramDefinition) {
   HistogramDef result;
@@ -61,12 +61,11 @@ const HistogramDef HistogramDef::parse(const std::string &histogramDefinition) {
 }
 
 std::vector<std::string> HistogramDef::splitWithSeparator(const std::string &input, const char *separator) {
-  boost::char_separator<char> sep(separator);
-  tokenizer_t tokens(input, sep);
+  boost::escaped_list_separator<char> sep('\\',*separator);
+  tokenizer_t tokens(input,sep);
   std::vector<std::string> result;
 
-  for (tokenizer_t::iterator itr = tokens.begin(); itr != tokens.end(); ++itr) {
-    std::string word = *itr;
+  for (auto word : tokens ) {
     boost::trim(word);
     result.push_back(word);
   }
-- 
GitLab