From 06d78fb1eb3c21062ea1067f3fa11a4c9185d62d Mon Sep 17 00:00:00 2001
From: smwang <song.ming.wang@cern.ch>
Date: Fri, 27 Sep 2019 14:57:40 +0200
Subject: [PATCH] Update packages:RecExOnline  from upstream/21.1 to
 upstream/master via pseudo-merge

---
 .../RecExample/RecExOnline/CMakeLists.txt     |   1 +
 .../python/OnlineISConfiguration.py           |  11 +
 .../RecExOnline/python/UnbinnedHist.py        |  47 ++
 .../RecExOnline/python/comparison_plot.py     | 228 ++++++
 .../RecExOnline/python/datatable.py           |  27 +
 .../RecExOnline/python/distributions.py       |  14 +
 .../RecExOnline/python/hash_tool.py           |  47 ++
 .../RecExOnline/python/power_of_test.py       | 155 +++++
 .../RecExample/RecExOnline/python/ros_farm.py |   2 +-
 .../RecExOnline/python/setupRTTAlg.py         |  45 ++
 .../RecExOnline/python/test_statistics.py     | 655 ++++++++++++++++++
 .../RecExample/RecExOnline/python/to_root.py  |  21 +
 .../RecExample/RecExOnline/python/utils.py    |  61 ++
 .../RecExOnline/share/GlobalMonitoring.py     | 238 ++++++-
 .../share/GlobalMonitoring_RunHIPP.py         | 317 +++++++++
 .../share/GlobalMonitoring_defaultHI.py       | 304 ++++++++
 .../share/GlobalMonitoring_defaultpp.py       | 282 ++++++++
 .../RecExOnline/share/RTTAlgmain.py           |  91 +++
 .../share/RecExOnline_Partition_Online.py     | 136 +++-
 .../share/RecExOnline_Partition_Online_ID.py  | 172 ++++-
 .../RecExOnline_Partition_Online_L1Calo.py    | 266 ++++++-
 ...xOnline_Partition_Online_L1Calo_Cosmics.py | 256 ++++++-
 ...nline_Partition_Online_L1Calo_Stability.py | 461 ++++++++++++
 .../share/RecExOnline_Test_Obj_His_RTT.C      |  40 ++
 .../share/RecExOnline_Test_Obj_His_RTT_CINT.C |  28 +
 .../share/RecExOnline_Test_Obj_His_RTT_Cpp.C  | 152 ++++
 .../RecExOnline_Test_Obj_His_RTT_Cpp_Online.C |  51 ++
 .../RecExOnline_Test_Obj_His_RTT_Cpp_rename.C | 147 ++++
 .../share/RecExOnline_User_Offline.py         | 142 +++-
 .../share/RecExOnline_User_Offline_HItest.py  | 235 +++++++
 .../share/RecExOnline_User_Offline_RunHI.py   | 230 ++++++
 .../RecExOnline_User_Offline_isOnlineTrue.py  | 153 +++-
 .../RecExOnline/share/RecExOnline_emonsvc.py  |   5 +-
 .../share/RecExOnline_globalconfig.py         | 146 ++--
 .../share/RecExOnline_jobOptions_HItest.py    |  45 ++
 .../share/RecExOnline_monitoring.py           |  35 +-
 .../share/RecExOnline_postconfig.py           |  66 +-
 .../share/RecExOnline_recoflags.py            |  20 +-
 .../share/RecExOnline_recoflags_HItest.py     |  84 +++
 .../share/RecExOnline_recoflags_RunHI.py      |  84 +++
 .../RecExOnline/share/RootHis_RTT.C           |  26 +
 .../RecExOnline/share/Rtt_histogram.py        |  79 +++
 .../share/SimpleJobOptions_ForRTT.py          |   1 +
 .../RecExample/RecExOnline/share/myAsetup     |  18 +
 .../test/RecExOnline_TestConfiguration.xml    | 386 +++++++++++
 .../test/test_recexonline_user_offline.sh     |  17 +
 ...t_recexonline_user_offline_isonlinetrue.sh |   8 +
 ...online_user_offline_isonlinetrue_cosmic.sh |   8 +
 ..._user_offline_isonlinetrue_noautoconfig.sh |   8 +
 49 files changed, 5837 insertions(+), 214 deletions(-)
 create mode 100644 Reconstruction/RecExample/RecExOnline/python/UnbinnedHist.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/python/comparison_plot.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/python/datatable.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/python/distributions.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/python/hash_tool.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/python/power_of_test.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/python/setupRTTAlg.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/python/test_statistics.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/python/to_root.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/python/utils.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_RunHIPP.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_defaultHI.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_defaultpp.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/RTTAlgmain.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo_Stability.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT.C
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_CINT.C
 create mode 100755 Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp.C
 create mode 100755 Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp_Online.C
 create mode 100755 Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp_rename.C
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_HItest.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_RunHI.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/RecExOnline_jobOptions_HItest.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags_HItest.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags_RunHI.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/RootHis_RTT.C
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/Rtt_histogram.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/SimpleJobOptions_ForRTT.py
 create mode 100644 Reconstruction/RecExample/RecExOnline/share/myAsetup
 create mode 100755 Reconstruction/RecExample/RecExOnline/test/RecExOnline_TestConfiguration.xml
 create mode 100755 Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline.sh
 create mode 100755 Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue.sh
 create mode 100755 Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue_cosmic.sh
 create mode 100755 Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue_noautoconfig.sh

diff --git a/Reconstruction/RecExample/RecExOnline/CMakeLists.txt b/Reconstruction/RecExample/RecExOnline/CMakeLists.txt
index 8b6ebbf3aac5..453eee1c0cd7 100644
--- a/Reconstruction/RecExample/RecExOnline/CMakeLists.txt
+++ b/Reconstruction/RecExample/RecExOnline/CMakeLists.txt
@@ -8,5 +8,6 @@ atlas_subdir( RecExOnline )
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py )
+atlas_install_runtime( test/RecExOnline_TestConfiguration.xml share/RootHis*.C share/RecExOnline_Test*.C )
 atlas_install_scripts( scripts/*.sh )
 
diff --git a/Reconstruction/RecExample/RecExOnline/python/OnlineISConfiguration.py b/Reconstruction/RecExample/RecExOnline/python/OnlineISConfiguration.py
index 30f63d1b9020..a59fa4a7e800 100644
--- a/Reconstruction/RecExample/RecExOnline/python/OnlineISConfiguration.py
+++ b/Reconstruction/RecExample/RecExOnline/python/OnlineISConfiguration.py
@@ -2,6 +2,17 @@
 
 import ispy
 
+
+def GetAtlasReady():
+   from ispy import ISObject, IPCPartition
+   try:
+      r4p = ISObject(IPCPartition("ATLAS"), 'RunParams.Ready4Physics', 'RunParams')
+      r4p.checkout()
+      return r4p.ready4physics
+   except:
+      print "#### Failed to determine if we are ready for physics"
+      raise
+
 def GetRunType():
   """Get the run type by reading the run-type setting in the partition from IS """
 
diff --git a/Reconstruction/RecExample/RecExOnline/python/UnbinnedHist.py b/Reconstruction/RecExample/RecExOnline/python/UnbinnedHist.py
new file mode 100644
index 000000000000..323301a3c38e
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/python/UnbinnedHist.py
@@ -0,0 +1,47 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+import rootpy.ROOT as ROOT
+import ROOT as R
+from rootpy.plotting import Hist
+import numpy as np
+class UnbinnedHist(ROOT.TH1F,R.TH1F):
+    def __new__(cls, tree, expression, selection='', options='', hist=None, create_hist=False, **kwargs):
+        obj = tree.Draw(expression, selection, options, hist, create_hist, **kwargs)
+        v1 = tree.get_v1()
+        v1.SetSize(obj.entries)
+        obj._raw_data = np.fromiter(v1, np.float)
+        return obj
+    def get_raw_data(self):
+        return self._raw_data
+    def __add__(self,y):
+        x = self.Clone("New")
+        x.fill_array(y.get_raw_data())
+        x._raw_data = np.append(self._raw_data, y._raw_data)
+        return x
+    def __radd__(self,y):
+        return y.__add__(self)
+    def refill(self, bins=100, range=None, inplace=False):
+        if np.iterable(bins):
+            self_ = Hist(bins)
+        else:
+            if not range:
+                range = (self.lowerbound(), self.upperbound())
+            self_ = Hist(bins, *range)
+        raw_data = self._raw_data
+        self_.fill_array(raw_data)
+        self_._raw_data = raw_data
+        self_.__class__ = UnbinnedHist
+        return self_
+def unbinned_hist(tree, expression, selection='', options='', hist=None, create_hist=False, **kwargs):
+    obj = UnbinnedHist(tree, expression, selection, options, hist, create_hist, **kwargs)
+    obj.__class__ = UnbinnedHist
+    return obj
+def group_eqbin(hist_list, bins=100, range=None, inplace=True):
+    if not range:
+        lowerbound = min(hist.lowerbound() for hist in hist_list)
+        upperbound = max(hist.upperbound() for hist in hist_list)
+        range = (lowerbound, upperbound)
+        hist_list = [hist.refill(bins, range, inplace) for hist in hist_list]
+    if not inplace:
+        return hist_list
+        
diff --git a/Reconstruction/RecExample/RecExOnline/python/comparison_plot.py b/Reconstruction/RecExample/RecExOnline/python/comparison_plot.py
new file mode 100644
index 000000000000..0f1e3463f3cd
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/python/comparison_plot.py
@@ -0,0 +1,228 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+"""
+Draw comparison plots and statistical tables for each 2 histograms inside 2 data sets.
+"""
+
+import rootpy.ROOT as ROOT
+from rootpy.plotting.hist import Hist
+from rootpy.plotting.style import get_style, set_style
+import rootpy.plotting.root2matplotlib as rplt
+import matplotlib
+import matplotlib.pyplot as plt
+import matplotlib.colors as colors
+import matplotlib.ticker
+import itertools
+import numpy as np
+import pandas as pd
+import re
+from collections import defaultdict
+import HistCompare.test_statistics as TS
+import copy
+from UnbinnedHist import UnbinnedHist
+from hash_tool import HashTool
+matplotlib.rcParams["text.usetex"]=True
+matplotlib.rcParams['text.latex.preamble']=['\usepackage{booktabs}']
+def tree(): return defaultdict(tree)
+#set_style('ATLAS',mpl=True)
+def set_yaxis(ax, tick=None):
+    if tick == "%":
+        def to_percent(y, position):
+            s = format(100*y, '.1f')
+            if matplotlib.rcParams['text.usetex'] is True:
+                return s + r'$\%$'
+            else:
+                return s + '%'
+        formatter = matplotlib.ticker.FuncFormatter(to_percent)
+        ax.yaxis.set_major_formatter(formatter)
+def identity(*x):
+    if len(x)==1:
+        return x[0]
+    return x
+def formatted_plt_dict(plt_kw, length, **kwarg):
+    for i in range(length):
+        yield dict((key, val[i]) if np.iterable(val) else (key, val) for key, val in plt_kw.iteritems())
+
+# keyword arguments for matplotlib.pyplot.text
+TEXT_KW = {
+    "x": 0.94,
+    "y": 0.25,
+    "ha": "right",
+    "va": "center",
+    'zorder': 2}
+
+# keyword arguments for auto_statistic_table
+STATISTIC_TABLE_KW = {
+    "iterfunc": itertools.combinations,
+    "iterkey": {"r": 2},
+    "row_title_func": identity,
+    "col_title_func": identity, 
+    "table_fformat": ".2e",
+    "text_kw": TEXT_KW}
+
+# keyword arguments for matplotlib.pyplot.setp
+AXES_KW = {
+    "ylim":(0,None)}
+
+# keyword arguments for matplotlib.pyplot.plot
+PLT_KW = {
+    "linewidth": 2,
+    "color": None,
+    'zorder': 1
+    }
+
+def statistic_table_kw_func(ax):
+    statistic_table_kw = copy.deepcopy(STATISTIC_TABLE_KW)
+    statistic_table_kw["text_kw"].update({"axes": ax, "transform": ax.transAxes})
+    return statistic_table_kw
+
+def auto_draw(hist_dict, cumulative = False, normalized = False, table = True, axes = None, frameon = True, cmap = plt.cm.brg, add_statistic_table_kw = {}, add_axes_kw = {}, add_plt_kw = {}):
+    """
+    Draw comparison plots and statistical tables for each 2 histograms inside 2 data sets.
+    
+    Parameters
+    ----------
+    hist_dict : pandas dataframe
+        Input data. *hist_dict* Should have 2 *rootpy.plotting.Hist*/*UnbinnedHist* instances
+        in each row.
+    cumulative : bool, optional
+        If True, then a histogram is computed where each bin gives the counts in that bin plus all bins for smaller
+        values. The last bin gives the total number of datapoints. If normed is also True then the histogram is
+        normalized such that the last bin equals 1. If cumulative evaluates to less than 0 (e.g., -1), the direction
+        of accumulation is reversed. In this case, if normed is also True, then the histogram is normalized such that
+        the first bin equals 1.
+    normalized : bool, optional
+        If False, the result will contain the number of samples in each bin. If True, the result is the value of the 
+        probability density function at the bin, normalized such that the integral over the range is 1.
+    table : bool, optional
+        If True, places a statistical table on each axes.
+    axes : list of matplotlib axis, optional, default : None
+        if provided, plot on these axes. Note *axes* should have the same number as *hist_dict*. i.e.::
+        >>> len(axes) = len(hist_dict)
+    frameon : bool, optional, default : True
+        If False, suppress drawing the figure frame
+    cmap : matplotlib.colors.Colormap instance or list of str, optional, default : plt.cm.brg
+        list of any matplotlib colors.
+    add_statistic_table_kw : dict, optional
+        Additional Keyword Arguments for ``statistic_table``
+    add_axes_kw : dict, optional
+        Additional Keyword Arguments for ``matplotlib.pyplot.setp``
+    add_plt_kw : dict, optional
+        dditional Keyword Arguments for ``matplotlib.pyplot.plot``
+    
+    Returns
+    -------
+    [ax1, ax2, ...] : list
+    list of matplotlib axes
+    """
+    if axes == None:
+        axes = [plt.axes() for _ in hist_dict if plt.figure(frameon=frameon)]
+    for ax, kind in zip(axes, hist_dict): 
+        statistic_table_kw = statistic_table_kw_func(ax)
+        statistic_table_kw.update(add_statistic_table_kw)
+        axes_kw = AXES_KW
+        axes_kw.update(add_axes_kw)
+        plt_kw = PLT_KW
+        plt_kw.update(add_plt_kw)
+        if cmap:
+            plt_kw["color"] = cmap(np.linspace(0, 1, len(hist_dict)))   
+        plt_dicts = formatted_plt_dict(plt_kw, len(hist_dict))
+
+        for (i, h), d in zip(hist_dict[kind].iteritems(), plt_dicts):
+            entries = h.entries
+            h_ = h.clone("New1")
+            if normalized:
+                h_.Scale(1./h_.Integral())      
+            if cumulative:
+                arr = np.cumsum([bin.value for bin in h_ ])
+                h_.set_content(arr)
+            for key, val in d.iteritems():
+                setattr(h_,key,val)
+            rplt.hist(h_, label = "%s (%i)" % (statistic_table_kw["col_title_func"](i),entries), axes = ax)
+
+        ########################################################################
+        if np.all([type(v)==UnbinnedHist for v in hist_dict[kind].values]) and cumulative:
+            data_all = np.concatenate(map(UnbinnedHist.get_raw_data, hist_dict[kind].values))
+            if normalized:
+                cdfs = [sorted(np.searchsorted(data.get_raw_data(), data_all, side='right')*1.0 / data.get_raw_data().shape[0]) for data in hist_dict[kind].values]
+            else:
+                cdfs = [sorted(np.searchsorted(data.get_raw_data(), data_all, side='right')) for data in hist_dict[kind].values]
+            for i, cdf, d in zip(hist_dict[kind].keys(), cdfs, plt_dicts):
+                plt.plot(sorted(data_all), cdf, label = "%s (%i)" % (statistic_table_kw["col_title_func"](i),entries), linestyle="--", axes = ax, **d)
+        ########################################################################
+
+        ax.legend()
+        if table:
+            df = auto_statistic_table(hist_dict[kind], ax=ax, ret_table=False, ret_text=False, **statistic_table_kw)
+            if HASH.objs:
+                textkw = statistic_table_kw["text_kw"].copy()
+                text = ax.text(textkw.pop("x"), textkw.pop("y"), df[0].to_latex(escape=False, sparsify=False, index_names=False).replace("\n",""), **textkw)
+        ax.set_xlabel(kind, fontsize=25)
+        
+        plt.setp(ax, **axes_kw) 
+        if normalized:
+            ax.set_ylim(0,1)
+            set_yaxis(ax,tick='%')
+        if not cumulative:
+            ax.set_ylabel("Events", fontsize=25)
+        else:
+            ax.set_ylabel("Cumulative Events", fontsize=25)
+    return axes
+
+HASH = HashTool('hist_dict', ret_table=True)
+@HASH
+def auto_statistic_table(hist_dict, ax=None, ret_table=True, ret_text=True, **statistic_table_kw):
+    """Compute statistic tables for the 2 histograms in each row of *hist_dict*.
+    
+    Parameters
+    ----------
+    hist_dict : pandas dataframe
+        Input data. *hist_dict* Should have 2 *rootpy.plotting.Hist*/*UnbinnedHist* instances
+        in each row.
+    ax : matplotlib axis, optional, default : None
+        if provided, plot on this axis
+    statistic_table_kw : dict, optional
+        Other keyword arguments
+    ret_table : bool, optional, default : True
+        If True, returns the formatted table in *list* form.
+    ret_text : bool, optional, default : True
+        If True, returns the formatted table in *latex* form.
+    
+    Returns
+    -------
+    [text[, table]] : list
+        depending on *ret_table* and *ret_text*, returns a list with required inside.
+    """
+    header = ["Type of Test", "Bin", "T","P","NDF","Description"]
+    df_ = pd.DataFrame()
+    textkw = statistic_table_kw["text_kw"].copy()
+    for (nA,A),(nB,B) in statistic_table_kw["iterfunc"](hist_dict.iteritems(), **statistic_table_kw["iterkey"]):
+        A_Arr_Binned = np.array([bin.value for bin in A.bins()])
+        B_Arr_Binned = np.array([bin.value for bin in B.bins()])
+        bin_str = A_Arr_Binned.shape[0]
+        Table=[#["$\chi^2$ Absolute Comparison", bin_str] + list(TS.chi2_2samp(A_Arr_Binned, B_Arr_Binned, normed=False, binned=True)) + ["Scipy + Modificatoin"],
+        ["$\chi^2$ Shape Comparison",bin_str] + list(TS.chi2_2samp(A_Arr_Binned, B_Arr_Binned, normed=True, binned=True)) + ["Scipy + Modificatoin"],
+        ["",bin_str, A.Chi2Test(B,"WW CHI2"), A.Chi2Test(B,"WW"),'',"ROOT"],
+        ["Likelihood Ratio Shape Comparison",bin_str]+list(TS.likelihoodratio_ksamp(A_Arr_Binned, B_Arr_Binned))+["Scipy + Modification"],
+        #["Likelihood Value Shape Comparison",bin_str]+list(TS.likelihoodvalue_ksamp(A_Arr_Binned, B_Arr_Binned))+["Scipy + Modification"],
+        #["BDM Shape Comparison",bin_str] + list(TS.BDM_2samp(A_Arr_Binned, B_Arr_Binned))+["Scipy + Modification"],
+        ["K-S Shape Comparison",bin_str] + list(TS.ks_2samp(A_Arr_Binned,B_Arr_Binned,binned=True))+ ["SciPy + Modification"],
+        ["",bin_str,A.KolmogorovTest(B,"M"), A.KolmogorovTest(B), '',"ROOT"],
+        ["A-D Shape Comparison",bin_str] + list(TS.anderson_ksamp(A_Arr_Binned, B_Arr_Binned, binned=True)) + ["Scipy + Modification"],  
+        ["CVM Shape Comparison",bin_str] + list(TS.CVM_2samp(A_Arr_Binned, B_Arr_Binned, binned=True)) + ["Matlab"]]
+
+        if type(A)==UnbinnedHist and type(B)==UnbinnedHist:
+            Table.insert(8,  ["","Unbinned"] + list(TS.ks_2samp(A.get_raw_data(), B.get_raw_data(), binned=False)) + ["SciPy + Modification"])
+            Table.insert(10, ["","Unbinned"] + list(TS.anderson_ksamp(A.get_raw_data(), B.get_raw_data(), binned=False)) + ["Scipy"])
+            Table.insert(12, ["","Unbinned"] + list(TS.CVM_2samp(A.get_raw_data(), B.get_raw_data(), binned=False)) + ["Matlab"])
+
+        df=pd.DataFrame(Table, columns=header)
+        df["T/P"] = map(lambda tp: "/".join(["%"+statistic_table_kw["table_fformat"]]*2)%(tp[0],tp[1]), zip(df["T"],df.P))
+        df_ = df[header]
+    text = ax.text(textkw.pop("x"), textkw.pop("y"), df_.to_latex(escape=False, sparsify=False, index_names=False).replace("\n",""), **textkw)
+    result = []
+    if ret_text:
+        result.append(text)
+    if ret_table:
+        result.append(df_)
+    return result
diff --git a/Reconstruction/RecExample/RecExOnline/python/datatable.py b/Reconstruction/RecExample/RecExOnline/python/datatable.py
new file mode 100644
index 000000000000..afbae7af0ef0
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/python/datatable.py
@@ -0,0 +1,27 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+cvm_ztable = [
+0.00000, 0.02480, 0.02878, 0.03177, 0.03430, 0.03656, 0.03865, 0.04061, 0.04247, 0.04427, 
+0.04601, 0.04772, 0.04939, 0.05103, 0.05265, 0.05426, 0.05586, 0.05746, 0.05904, 0.06063, 
+0.06222, 0.06381, 0.06541, 0.06702, 0.06863, 0.07025, 0.07189, 0.07354, 0.07521, 0.07690, 
+0.07860, 0.08032, 0.08206, 0.08383, 0.08562, 0.08744, 0.08928, 0.09115, 0.09306, 0.09499, 
+0.09696, 0.09896, 0.10100, 0.10308, 0.10520, 0.10736, 0.10956, 0.11182, 0.11412, 0.11647, 
+0.11888, 0.12134, 0.12387, 0.12646, 0.12911, 0.13183, 0.13463, 0.13751, 0.14046, 0.14350, 
+0.14663, 0.14986, 0.15319, 0.15663, 0.16018, 0.16385, 0.16765, 0.17159, 0.17568, 0.17992, 
+0.18433, 0.18892, 0.19371, 0.19870, 0.20392, 0.20939, 0.21512, 0.22114, 0.22748, 0.23417, 
+0.24124, 0.24874, 0.25670, 0.26520, 0.27429, 0.28406, 0.29460, 0.30603, 0.31849, 0.33217, 
+0.34730, 0.36421, 0.38331, 0.40520, 0.43077, 0.46136, 0.49929, 0.54885, 0.61981, 0.74346, 
+1.16786]
+
+cvm_ptable = [
+0.000, 0.010, 0.020, 0.030, 0.040, 0.050, 0.060, 0.070, 0.080, 0.090, 
+0.100, 0.110, 0.120, 0.130, 0.140, 0.150, 0.160, 0.170, 0.180, 0.190, 
+0.200, 0.210, 0.220, 0.230, 0.240, 0.250, 0.260, 0.270, 0.280, 0.290, 
+0.300, 0.310, 0.320, 0.330, 0.340, 0.350, 0.360, 0.370, 0.380, 0.390, 
+0.400, 0.410, 0.420, 0.430, 0.440, 0.450, 0.460, 0.470, 0.480, 0.490, 
+0.500, 0.510, 0.520, 0.530, 0.540, 0.550, 0.560, 0.570, 0.580, 0.590, 
+0.600, 0.610, 0.620, 0.630, 0.640, 0.650, 0.660, 0.670, 0.680, 0.690, 
+0.700, 0.710, 0.720, 0.730, 0.740, 0.750, 0.760, 0.770, 0.780, 0.790, 
+0.800, 0.810, 0.820, 0.830, 0.840, 0.850, 0.860, 0.870, 0.880, 0.890, 
+0.900, 0.910, 0.920, 0.930, 0.940, 0.950, 0.960, 0.970, 0.980, 0.990, 
+0.999]
\ No newline at end of file
diff --git a/Reconstruction/RecExample/RecExOnline/python/distributions.py b/Reconstruction/RecExample/RecExOnline/python/distributions.py
new file mode 100644
index 000000000000..74ff20e5eb74
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/python/distributions.py
@@ -0,0 +1,14 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+import datatable as dt
+import numpy as np
+def CVM(cvm, mean, var):
+	z = (cvm - mean) / (45. * var)**0.5 + 1./6
+	z_i = dt.cvm_ztable
+	p_i = dt.cvm_ptable
+	if z > z_i[-1]:
+		return 1.
+	elif z < z_i[0]:
+		return 0.
+	else:
+		return np.interp(z, z_i, p_i)
diff --git a/Reconstruction/RecExample/RecExOnline/python/hash_tool.py b/Reconstruction/RecExample/RecExOnline/python/hash_tool.py
new file mode 100644
index 000000000000..fc00b999ddcb
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/python/hash_tool.py
@@ -0,0 +1,47 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+import inspect
+import warnings
+import numpy as np
+import sys
+
+class HashTool:
+    def __init__(self, *args, **parse):
+        self.argvals = tuple()
+        self.objs = tuple()
+        self.signatures = args
+        self.parse = parse
+
+    def vars_wrapper(self,*args,**kwargs):
+        argspec = inspect.getargspec(self.func)
+        args_name,varargs_name = argspec[:-2]
+        argval = dict(zip(args_name, args[:len(args_name)]) + [(varargs_name, args[len(args_name):])] + kwargs.items())
+        signatures = self.signatures if self.signatures else argval.keys()
+        pattern = dict((s, argval[s]) for s in signatures)
+        try:
+            i = self.argvals.index(pattern)
+            warnings.warn("Hash index founded. Stored object is used instead of creating a new one.")
+            return self.objs[i]
+        except ValueError:
+            self.argvals += (pattern,)
+            try:
+                obj = self.func(*args,**dict(kwargs, **self.parse))
+            except TypeError:
+                obj = self.func(*args, **kwargs)
+            self.objs += (obj,)
+            return obj     
+    def __call__(self, func):
+        self.func = func
+        self.vars_wrapper.__func__.__doc__ = self.func.__doc__
+        return self.vars_wrapper
+
+class Do:
+    def __init__(self, do):
+        self.do = do
+    def vars_wrapper(self, *args, **kwargs):
+        ret = self.func(*args, **kwargs)
+        self.do(ret)
+        return ret
+    def __call__(self, func):
+        self.func = func
+        return self.vars_wrapper
diff --git a/Reconstruction/RecExample/RecExOnline/python/power_of_test.py b/Reconstruction/RecExample/RecExOnline/python/power_of_test.py
new file mode 100644
index 000000000000..d63c9bcb31d5
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/python/power_of_test.py
@@ -0,0 +1,155 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+from scipy.stats import rv_discrete
+import test_statistics as TS
+import numpy as np
+import warnings
+
+# If True, import IPyParallel package to do the parallel computation.
+# And if IPyParallel is not installed, automatically turns it False.
+PARALLEL = True
+if PARALLEL:
+    try:
+        from ipyparallel import Client
+    except ImportError:
+        PARALLEL = False
+# IPyParallel configurations.
+# For example, to activate SSH mode:
+# ipp_profile = {
+#     'sshserver':'<username>@<host>',
+#     'profile':'<IPyParallel profile directory>'
+#     }
+# Leave it empty if you don't want to make changes.
+ipp_profile = {'sshserver':'kingman@140.114.94.171',
+               'profile':'ssh@nthu'}
+
+def _hist_fill(data, bins, entries = 0, freeze = None):
+    if type(bins)==int:
+        if bins==0:
+            bins = np.arange(data.size + 1, dtype = float)
+        else:
+            bins = np.linspace(data.min(), data.max(), bins)
+    binc = (bins[1:] + bins[:-1]) / 2 
+    if freeze:
+        return lambda : data
+    else:
+        rv = rv_discrete(values = (binc, data/data.sum()))
+        return lambda : np.histogram(rv.rvs(size=data.sum() if entries==0 else entries), bins)[0].astype(float)
+
+def rvs_pairs(data1, data2, bins = 0, kind = 'binbybin', bin_mean = 1, size = 1, entries = 0, freeze = False):
+    """
+    Compute the histogram pairs from the random variates of the given 2 samples/frequencies for size_times. 
+    
+    Parameters
+    ----------
+    data1, data2 : sequence of 1-D ndarrays
+        Input data. Observed samples or frequencies.
+    bins : [scalar|1-D array], optional, default : 0
+        If bins is an int, it defines the number of equal-width bins in the given
+        range. If bins is zero, the given data will be assumed to be frequency data,
+        and it defines the bin index. If bins is an 1-D array, it defines the bin
+        edges, including the rightmost edge, allowing for non-uniform bin widths.
+    kind : [str|(str,str)], optional, default : "binbybin"
+        Bin-by-bin test
+    bin_mean : [scalar|(scalar,scalar)], optional, default : 1
+        The desired mean count in each bin of the output histograms. For example, 
+        if a histogram has 10000 entries and 100 bins, the bin_mean is 100. It is
+        ignored when entries is given.
+    size : int, optional, default : 1
+        The number of repetitions for computing the histograms.
+    entries : [scalar|(scalar,scalar)], optional, default : 0
+        The desired entries of the output histograms. If entries is 0, the entries
+        size of the input data will be used instead.
+    freeze : [bool,(bool,bool)], optional. default : False
+        if True, the output histogram will be the frozen distribution of the input
+        data
+    
+    Yields
+    ------
+    hist1, hist2 : (1-D array, 1-D array)
+        Histogram pairs
+    """ 
+    data1 = data1.astype(float)
+    data2 = data2.astype(float)
+    entries = np.resize(entries, 2)
+    freeze = np.resize(freeze, 2)
+    hist1 = _hist_fill(data1, bins, entries[0], freeze[0])
+    hist2 = _hist_fill(data2, bins, entries[1], freeze[1])
+    for _ in range(size):
+        yield hist1(), hist2()
+
+def power_of_test(data1, data2, rvs_func = 'rvs_pairs', tests = ['chi2_2samp'], rvs_key = {}, test_key = {}, parallel=None, sync=True):
+    """Compute the corresponding p-values for each histrogram pairs from the random variates of the given 2 samples/frequencies for size_times.
+    
+    Parameters
+    ----------
+    data1, data2 : sequence of 1-D ndarrays
+        Input data. Observed samples or frequencies.
+    rvs_func : [callable|str], optional, default : "rvs_pairs"
+        The random variates function. The rvs_func can be either a callable or one of the following strings::
+
+            String                     Description
+            "rvs_pairs"                Compute the histogram pairs from the random
+                                       variates of the given 2 samples/frequencies
+                                       for size_times. 
+
+    tests : ([callable|str],...), optional, default : ["chi2_2samp"]
+        A list of *test* statistical functions. The *test* can be either a callable or one of the following strings::
+
+            String                     Description
+            "chi2_2samp"               Read TS.chi2_2samp for further information.
+            "BDM_2samp"                Read TS.BDM_2samp for further information.
+            "likelihoodratio_ksamp"    Read TS.likelihoodratio_ksamp for further information.
+            "likelihoodvalue_ksamp"    Read TS.likelihoodvalue_ksamp for further information.
+            "ks_2samp"                 Read TS.ks_2samp for further information.
+            "anderson_ksamp"           Read TS.anderson_ksamp for further information.
+            "CVM_2samp"                Read TS.CVM_2samp for further information.
+
+    rvs_key : dict, optional, default : {}
+        Keyword arguments for the rvs function, rvs_func.
+    test_key : dict, optional
+        Keyword arguments for the test statistical function, test.
+    parallel : bool, optional, default : None
+        If True, import IPyParallel package to do the parallel computation. If parallel is None,
+        the global variable PARALLEL will be used instead.
+    sync : bool, optional, default : True
+        When sync is False, an IPyParallel AsyncResult Object will be returned instead. Onyl affect
+        when parallel is True.
+    
+    Returns
+    -------
+    [p1, p2, ...] : 1-D array
+        The corresponding p-values for each histogram pairs.
+    """
+    if parallel == None: parallel = PARALLEL
+    if parallel:
+        try:
+            global client
+            client=Client(**ipp_profile)
+            size = rvs_key['size']
+            N = len(client)
+            jobs = []
+            for i in range(N):
+                rvs_key['size'] = (size//N + 1) if (i < size % N) else size//N
+                jobs.append(client[client.ids[i]].apply_async(power_of_test, data1, data2, rvs_func, test, rvs_key, test_key, False))
+            ars = client._asyncresult_from_jobs(jobs)
+            if sync:
+                ars.wait_interactive()
+                ret = {}
+                for key, val in ars.get():
+                    ret.setdefault(key, []).extend(val)
+            else:
+                return ars
+        finally:
+            client.close()
+        return ret
+    if type(rvs_func) == str:
+        rvs_func = globals()[rvs_func]
+    if type(tests) not in (list, tuple):
+        tests = [tests]
+    tests = [(t, getattr(TS, t)) if type(t)==str else (str(t), t) for t in tests]
+    ret = {}
+    for rvs1, rvs2 in rvs_func(data1,data2,**rvs_key):
+        for tname, test in tests:
+            ret.setdefault(tname, []).append(test(rvs1, rvs2, binned=True, **test_key).pvalue)
+    return ret
diff --git a/Reconstruction/RecExample/RecExOnline/python/ros_farm.py b/Reconstruction/RecExample/RecExOnline/python/ros_farm.py
index 5f108ea361c8..7467e28b20c7 100644
--- a/Reconstruction/RecExample/RecExOnline/python/ros_farm.py
+++ b/Reconstruction/RecExample/RecExOnline/python/ros_farm.py
@@ -16,7 +16,7 @@ import pm.farm
 # to scan datafiles, or if you prefer, just import the output of
 # rosconf-from-data.py --py. We prefer that later because it is faster.
 from robhit import robhit
-ros_farm = pm.multinode.ros_farm_random(robhit,[pm.farm.local_computer()])
+ros_farm = pm.multinode.ros_farm_random(robhit,[pm.farm.local_computer(), pm.farm.local_computer()])
 
 # if you want to pretty print in the end and to verify this module is
 # actually loadable, uncomment the following line
diff --git a/Reconstruction/RecExample/RecExOnline/python/setupRTTAlg.py b/Reconstruction/RecExample/RecExOnline/python/setupRTTAlg.py
new file mode 100644
index 000000000000..22135f9bf5ce
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/python/setupRTTAlg.py
@@ -0,0 +1,45 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+output_directory = "./"
+#ref_filename = "/afs/cern.ch/user/y/yunju/working/yunju/public/GM_ref_plots/r0000284484_All_ATLAS_Global-MDA_Histogramming-Global.root"
+ref_filename = "/afs/cern.ch/user/y/yunju/working/yunju/public/GM_ref_plots/r0000302347_l0420_ATLAS_Global-MDA_Histogramming-Global.root"
+ref_treename = "Histogramming-Global-iss/GM-Gatherer-MIG_GlobalMonitoringSegment"
+rtt_filename = "/afs/cern.ch/atlas/project/RTT/prod/Results/rtt/chainstore/21.1/x86_64-slc6-gcc62-opt/AthenaP1/Reconstruction/RecExample/RecExOnline/OfflineChainJob/Monitor.root"
+#this file is only for debug
+#rtt_filename = "/afs/cern.ch/user/y/yunju/ATLAS_Ana/P1MON_20.11.0.19.2/Monitor.root"
+#rtt_treename = "run_284484"
+rtt_treename = "run_302347"
+histnames = [
+    'Jets/AntiKt4EMTopoJets/pt',
+    'Jets/AntiKt4EMTopoJets/eta',
+    'Jets/AntiKt4EMTopoJets/phi',
+    'Jets/AntiKt4EMTopoJets/M',
+    'Tau/tauEt',
+    'Tau/tauEta',
+    'Tau/tauPhi',
+    'Tau/tauCharge',
+    'IDAlignMon/ExtendedTracks_NoTriggerSelection/GenericTracks/ngtracks',
+    'IDAlignMon/ExtendedTracks_NoTriggerSelection/GenericTracks/Nhits_per_track',
+    'IDAlignMon/ExtendedTracks_NoTriggerSelection/GenericTracks/d0',
+    'IDAlignMon/ExtendedTracks_NoTriggerSelection/GenericTracks/P',
+    'IDPerfMon/Wenu/NoTriggerSelection/Wenu_transmass_sel',
+    'IDPerfMon/Zee/NoTriggerSelection/Zee_invmass',
+    'DiMuMon/Zmumu/NoTrig/Zmumu_invmass_All',
+    'DiMuMon/Jpsi/NoTrig/Jpsi_invmass_All',
+    'MuonPhysics/Muons/CBMuons/Muons_CBMuons_pt',
+    'MuonPhysics/Muons/CBMuons/Muons_CBMuons_eta',
+    'MuonPhysics/Muons/CBMuons/Muons_CBMuons_phi', 
+    'egamma/photons/photonEtCbLoose', 
+    'egamma/photons/photonEtaCbLoose',
+    'egamma/photons/photonPhiCbLoose',
+    'egamma/electrons/electronEtLhLoose',
+    'egamma/electrons/electronEtaLhLoose',
+    'egamma/electrons/electronPhiLhLoose'    
+    ]
+size = 1000
+tests = [
+    'anderson_ksamp',
+    'CVM_2samp',
+    'ks_2samp',
+    'likelihoodratio_ksamp',
+    'chi2_2samp']
diff --git a/Reconstruction/RecExample/RecExOnline/python/test_statistics.py b/Reconstruction/RecExample/RecExOnline/python/test_statistics.py
new file mode 100644
index 000000000000..3e956af00ed1
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/python/test_statistics.py
@@ -0,0 +1,655 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+"""
+Test statistic functions.
+"""
+from collections import namedtuple
+import numpy as np
+import scipy.stats
+import scipy.interpolate
+import scipy.special
+import warnings
+import distributions as distr
+from sympy import binomial, log
+
+#If True, estimate distributions of the test statistic for the current null hypothesis and dump it into statistic_seq
+DEBUG = False
+#The estimated distributions of the test statistic for the current null hypothesis.
+statistic_seq = []
+
+Ks_2sampResult = namedtuple('Ks_2sampResult', ('statistic', 'pvalue','ndf'))
+def ks_2samp(data1, data2, binned=False):
+    """
+    Computes the Kolmogorov-Smirnov statistic on 2 samples/frequencies.
+
+    This is a two-sided test for the null hypothesis that 2 independent samples
+    are drawn from the same continuous distribution.
+
+    Parameters
+    ----------
+    data1, data2 : sequence of 1-D ndarrays
+        Input data. Can be either observed frequencies in each category or array
+        of sample observations.
+    binned : bool, optional, default: False
+        If True/False, assume the type of input data is observed frequencies/samples.
+
+    Returns
+    -------
+    statistic : float
+        KS statistic
+    pvalue : float
+        two-tailed p-value
+    ndf : NaN
+        「Degrees of freedom」: the degrees of freedom for the p-value. Always NaN in this case.
+
+    Notes
+    -----
+    This code is modified from scipy.stats.ks_2samp and extended with supporting on
+    frequency data. See [1]_ for further information.
+
+    This tests whether 2 samples are drawn from the same distribution. Note
+    that, like in the case of the one-sample K-S test, the distribution is
+    assumed to be continuous.
+
+    This is the two-sided test, one-sided tests are not implemented.
+    The test uses the two-sided asymptotic Kolmogorov-Smirnov distribution.
+
+    If the K-S statistic is small or the p-value is high, then we cannot
+    reject the hypothesis that the distributions of the two samples
+    are the same.
+
+    References
+    ----------
+    .. [1] scipy.stats.mstats.ks_2samp — SciPy Reference Guide
+           http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mstats.ks_2samp.html
+    .. [2] Frank C. Porter. (2008). Testing Consistency of Two Histograms, arXiv:0804.0380 [physics.data-an].
+
+    Examples
+    --------
+    >>> from scipy import stats
+    >>> np.random.seed(12345678)  #fix random seed to get the same result
+    >>> n1 = 200  # size of first sample
+    >>> n2 = 300  # size of second sample
+
+    For a different distribution, we can reject the null hypothesis since the
+    pvalue is below 1%:
+
+    >>> rvs1 = stats.norm.rvs(size=n1, loc=0., scale=1)
+    >>> rvs2 = stats.norm.rvs(size=n2, loc=0.5, scale=1.5)
+    >>> stats.ks_2samp(rvs1, rvs2)
+    (0.20833333333333337, 4.6674975515806989e-005)
+
+    For a slightly different distribution, we cannot reject the null hypothesis
+    at a 10% or lower alpha since the p-value at 0.144 is higher than 10%
+
+    >>> rvs3 = stats.norm.rvs(size=n2, loc=0.01, scale=1.0)
+    >>> stats.ks_2samp(rvs1, rvs3)
+    (0.10333333333333333, 0.14498781825751686)
+
+    For an identical distribution, we cannot reject the null hypothesis since
+    the p-value is high, 41%:
+
+    >>> rvs4 = stats.norm.rvs(size=n2, loc=0.0, scale=1.0)
+    >>> stats.ks_2samp(rvs1, rvs4)
+    (0.07999999999999996, 0.41126949729859719)
+
+    """
+    if binned == True:
+        cdf1 = np.cumsum(data1)
+        cdf2 = np.cumsum(data2)
+        n1 = cdf1[-1]
+        n2 = cdf2[-1]
+        cdf1 /= n1
+        cdf2 /= n2
+        ndf = data1.shape[0]
+    else:
+        n1 = data1.shape[0]
+        n2 = data2.shape[0]
+        ndf = float("nan")
+        if binned == False:
+            data1 = np.sort(data1)
+            data2 = np.sort(data2)
+            data_all = np.concatenate([data1, data2])
+            cdf1 = np.searchsorted(data1, data_all, side='right') / (1.0*n1)
+            cdf2 = np.searchsorted(data2, data_all, side='right') / (1.0*n2)
+        if binned == 'kde':
+            data1_kde = sm.nonparametric.KDEUnivariate(data1)
+            data2_kde = sm.nonparametric.KDEUnivariate(data2)
+            data1_kde.fit()
+            data2_kde.fit()
+            i, min_sup = min(enumerate([data1_kde.support, data1_kde.support]), key = lambda data: data[1].shape[0])
+            if i == 0:
+                cdf1 = data1_kde.cdf
+                cdf2 = scipy.interpolate.interp1d(data2_kde.support, data2_kde.cdf)(min_sup)
+            else:
+                cdf1 = scipy.interpolate.interp1d(data1_kde.support, data1_kde.cdf)(min_sup)
+                cdf2 = data2_kde.cdf
+    d = np.max(np.absolute(cdf1 - cdf2))
+    # Note: d absolute not signed distance
+    en = np.sqrt(n1 * n2 / float(n1 + n2))
+    try:
+        prob = scipy.stats.distributions.kstwobign.sf((en + 0.12 + 0.11 / en) * d)
+    except:
+        prob = 1.0
+    if DEBUG:
+        global statistic_seq
+        statistic_seq = np.absolute(cdf1 - cdf2)
+    return Ks_2sampResult(d, prob, ndf)
+
+
+Chi2_2sampResult = namedtuple('Chi2_2sampResult', ('statistic', 'pvalue','ndf'))
+def chi2_2samp(data1, data2, normed=True, binned=True):
+    """
+    The chi square test tests the null hypothesis that 2 given frequencies are drawn
+    from the same distribution.
+    
+    Parameters
+    ----------
+    data1, data2 : sequence of 1-D ndarrays
+        Input data. Observed frequencies in each category.
+    normed : bool, optional, default: True
+        If True/False, shape/value comparison test.
+    binned : bool, optional, default: True
+        If True/False, assume the type of input data is observed frequencies/samples.
+    
+    Returns
+    -------
+    statistic : float
+        The chi-squared test statistic.
+    pvalue : float
+        Corresponding p-value.
+    ndf : int
+        「Degrees of freedom」: the degrees of freedom for the p-value. The p-value
+        is computed using a chi-squared distribution with k - 1 degrees of freedom,
+        where k is the number of observed frequencies without bins has zero counts 
+        in both histograms.
+
+    Note
+    ----
+    This code is modified from scipy.stats.chisquare and extended with supporting on
+    2 sample cases and shape comparison test. 
+    """
+    if binned == True:
+        filter = ~((data1 == 0.) & (data2 == 0.))
+        data1 = data1[filter] 
+        data2 = data2[filter] 
+        ndf = data1.shape[0]
+        if not normed:
+            chi2 = np.power(data1 - data2, 2).dot(np.power(data1 + data2, -1))
+        else:
+            ndf -= 1
+            N_data1 = data1.sum()
+            N_data2 = data2.sum()
+            data1 /= N_data1
+            data2 /= N_data2
+            chi2 = np.power(data1 - data2, 2).dot(np.power(data1/N_data1 + data2/N_data2, -1))
+    if DEBUG:
+        global statistic_seq
+        if not normed:
+            statistic_seq = np.power(data1 - data2, 2) * (np.power(data1 + data2, -1))
+        else:
+            statistic_seq = np.power(data1 - data2, 2) * np.power(data1/N_data1 + data2/N_data2, -1)
+    return Chi2_2sampResult(chi2, scipy.stats.chi2.sf(chi2, ndf), ndf)
+
+BDM_2sampResult = namedtuple('BDM_2sampResult', ('statistic', 'pvalue', 'ndf'))
+def BDM_2samp(data1, data2, normed=True, binned=True):
+    """
+    The Bhattacharyya test tests the null hypothesis that 2 given frequencies are drawn
+    from the same distribution.    
+
+    Parameters
+    ----------
+    data1, data2 : sequence of 1-D ndarrays
+        Input data. Observed frequencies in each category.
+    normed : bool, optional
+        If True/False, shape/value comparison test.
+    binned : bool, optional
+        If True/False, assume the type of input data is observed frequencies/samples.
+    
+    Returns
+    -------
+    statistic : float
+        The Bhattacharyya distance measure.
+    pvalue : float
+        Corresponding p-value.
+    ndf : int
+        「Degrees of freedom」: the degrees of freedom for the p-value. The p-value
+        is computed using a chi-squared distribution with k - 1 degrees of freedom,
+        where k is the number of observed frequencies without bins has zero counts 
+        in both histograms.
+    """
+    if binned:
+        filter = ~((data1 == 0.) & (data2 == 0.))
+        data1 = data1[filter] 
+        data2 = data2[filter] 
+        ndf = data1.shape[0]
+        N_data1 = data1.sum()
+        N_data2 = data2.sum()
+        bdm = np.sqrt(data1 * data2).sum()
+        approx_chi2 = 2*N_data1+2*N_data2 - 4*bdm
+        if normed:
+            ndf -= 1
+            bdm /= np.sqrt(N_data1 * N_data2)
+    if DEBUG:
+        global statistic_seq
+        statistic_seq = 2*data1+2*data2 - 4*np.sqrt(data1 * data2)
+    return BDM_2sampResult(bdm, scipy.stats.chi2.sf(approx_chi2, ndf), ndf)
+
+CVM_2sampResult = namedtuple('CVM_2sampResult', ('statistic', 'pvalue', 'ndf'))
+def CVM_2samp(data1, data2, normed=True, binned=False):
+    """
+    Computes the Cram ́er-von-Mises statistic on 2 samples/frequencies.
+
+    This is a two-sided test for the null hypothesis that 2 independent samples
+    are drawn from the same continuous distribution.
+
+    Parameters
+    ----------
+    data1 ,data2 : sequence of 1-D ndarrays
+        Input data. Can be either observed frequencies in each category or array
+        of sample observations.
+    binned : bool, optional, default: False
+        If True/False, assume the type of input data is observed frequencies/samples.
+    
+    Returns
+    -------
+    statistic : float
+        CVM statistic
+    pvalue : float
+        two-tailed p-value
+    ndf : NaN
+        「Degrees of freedom」: the degrees of freedom for the p-value. Always NaN in this case.
+    """
+    N1 = data1.shape[0]
+    N2 = data2.shape[0]
+    N = N1 + N2
+    if binned:
+        E1 = data1.sum()
+        E2 = data2.sum()
+        cdf1 = np.cumsum(data1) / E1
+        cdf2 = np.cumsum(data2) / E2
+        weights = data1 + data2
+    else:
+        E1 = N1
+        E2 = N2
+        data_all = np.concatenate([data1, data2])
+        cdf1 = np.searchsorted(data1, data_all, side='right') / (1.0*N1)
+        cdf2 = np.searchsorted(data2, data_all, side='right') / (1.0*N2)
+        weights = 1.
+    cvm = (weights * (cdf1 - cdf2)**2).sum() * E1 * E2 / (E1 + E2)**2
+    mean = 1./6 + 1./6/N
+    var = (N + 1.) * (4.*N1*N2*N - 3*(N1**2+N2**2) - 2*N1*N2) / (4 * N1 * N2) /N**2/45
+    if DEBUG:
+        global statistic_seq
+        statistic_seq = (weights * (cdf1 - cdf2)**2) * E1 * E2 / (E1 + E2)**2
+    return CVM_2sampResult(cvm, 1-distr.CVM(cvm, mean, var), float("nan"))
+
+def _anderson_ksamp_midrank_binned(data, Z, Zstar, k, n, N):
+    #########################################
+    if DEBUG:
+        global statistic_seq
+        statistic_seq = []
+    #########################################
+    A2akN = 0.
+    lj = Z
+    Bj = Z.cumsum() - lj/2
+    for i in np.arange(0, k):
+        d = data[i]
+        Mij = d.cumsum() - d/2
+        inner = lj / float(N) * (N*Mij - Bj*n[i])**2 / (Bj*(N - Bj) - N*lj/4.)
+        A2akN += np.nan_to_num(inner).sum() / n[i]
+        ########################################
+        if DEBUG:
+            statistic_seq.append(A2akN*(N-1.)/N)
+        ########################################
+    A2akN *= (N - 1.) / N
+    return A2akN
+
+def _anderson_ksamp_midrank(samples, Z, Zstar, k, n, N):
+    """
+    Compute A2akN equation 7 of Scholz and Stephens.
+
+    Parameters
+    ----------
+    samples : sequence of 1-D array_like
+        Array of sample arrays.
+    Z : array_like
+        Sorted array of all observations.
+    Zstar : array_like
+        Sorted array of unique observations.
+    k : int
+        Number of samples.
+    n : array_like
+        Number of observations in each sample.
+    N : int
+        Total number of observations.
+
+    Returns
+    -------
+    A2aKN : float
+        The A2aKN statistics of Scholz and Stephens 1987.
+    """
+    #########################################
+    if DEBUG:
+        global statistic_seq
+        statistic_seq = []
+    #########################################
+    A2akN = 0.
+    Z_ssorted_left = Z.searchsorted(Zstar, 'left')
+    if N == Zstar.size:
+        lj = 1.
+    else:
+        lj = Z.searchsorted(Zstar, 'right') - Z_ssorted_left
+    Bj = Z_ssorted_left + lj / 2.
+    for i in np.arange(0, k):
+        s = np.sort(samples[i])
+        s_ssorted_right = s.searchsorted(Zstar, side='right')
+        Mij = s_ssorted_right.astype(float)
+        fij = s_ssorted_right - s.searchsorted(Zstar, 'left')
+        Mij -= fij / 2.
+        inner = lj / float(N) * (N*Mij - Bj*n[i])**2 / (Bj*(N - Bj) - N*lj/4.)
+        A2akN += inner.sum() / n[i]
+        ########################################
+        if DEBUG:
+            statistic_seq.append(A2akN*(N-1.)/N)
+        ########################################
+    A2akN *= (N - 1.) / N
+    return A2akN
+
+
+def _anderson_ksamp_right(samples, Z, Zstar, k, n, N):
+    """
+    Compute A2akN equation 6 of Scholz & Stephens.
+
+    Parameters
+    ----------
+    samples : sequence of 1-D array_like
+        Array of sample arrays.
+    Z : array_like
+        Sorted array of all observations.
+    Zstar : array_like
+        Sorted array of unique observations.
+    k : int
+        Number of samples.
+    n : array_like
+        Number of observations in each sample.
+    N : int
+        Total number of observations.
+
+    Returns
+    -------
+    A2KN : float
+        The A2KN statistics of Scholz and Stephens 1987.
+    """
+
+    A2kN = 0.
+    lj = Z.searchsorted(Zstar[:-1], 'right') - Z.searchsorted(Zstar[:-1],  'left')
+    Bj = lj.cumsum()
+    for i in arange(0, k):
+        s = np.sort(samples[i])
+        Mij = s.searchsorted(Zstar[:-1], side='right')
+        inner = lj / float(N) * (N * Mij - Bj * n[i])**2 / (Bj * (N - Bj))
+        A2kN += inner.sum() / n[i]
+    return A2kN
+
+
+Anderson_ksampResult = namedtuple('Anderson_ksampResult', ('statistic', 'pvalue', 'ndf'))
+def anderson_ksamp(data1, data2, binned=False, midrank=True):
+    """The Anderson-Darling test for 2 samples.
+
+    It tests the null hypothesis
+    that the 2 samples are drawn from the same population without
+    having to specify the distribution function of that population.
+    The critical values depend on the number of samples.
+
+    Parameters
+    ----------
+    samples : sequence of 1-D array_like
+        Array of sample data in arrays.
+    
+    Returns
+    -------
+    statistic : float
+        AD statistic
+    pvalue : float
+        two-tailed p-value
+    ndf : NaN
+        「Degrees of freedom」: the degrees of freedom for the p-value.
+        Always NaN in this case.
+
+    Raises
+    ------
+    ValueError
+        If less than 2 samples are provided, a sample is empty, or no
+        distinct observations are in the samples.
+
+    See Also
+    --------
+    ks_2samp : 2 sample Kolmogorov-Smirnov test
+
+    Notes
+    -----
+    This code is modified from scipy.stats.anderson and extended with
+    supporting on frequency data. See [1]_ for further information.
+
+    [2]_ Defines three versions of the k-sample Anderson-Darling test:
+    one for continuous distributions and two for discrete
+    distributions, in which ties between samples may occur. The
+    default of this routine is to compute the version based on the
+    midrank empirical distribution function. This test is applicable
+    to continuous and discrete data. If midrank is set to False, the
+    right side empirical distribution is used for a test for discrete
+    data. According to [1]_, the two discrete test statistics differ
+    only slightly if a few collisions due to round-off errors occur in
+    the test not adjusted for ties between samples.
+
+    References
+    ----------
+    .. [1] scipy.stats.anderson — SciPy Reference Guide
+           http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.anderson.html
+    .. [2] Scholz, F. W and Stephens, M. A. (1987), K-Sample
+           Anderson-Darling Tests, Journal of the American Statistical
+           Association, Vol. 82, pp. 918-924.
+
+    Examples
+    --------
+    >>> from scipy import stats
+    >>> np.random.seed(314159)
+
+    The null hypothesis that the two random samples come from the same
+    distribution can be rejected at the 5% level because the returned
+    test value is greater than the critical value for 5% (1.961) but
+    not at the 2.5% level. The interpolation gives an approximate
+    significance level of 3.1%:
+
+    >>> stats.anderson_ksamp([np.random.normal(size=50),
+    ... np.random.normal(loc=0.5, size=30)])
+    (2.4615796189876105,
+      array([ 0.325,  1.226,  1.961,  2.718,  3.752]),
+      0.03134990135800783)
+
+
+    The null hypothesis cannot be rejected for three samples from an
+    identical distribution. The approximate p-value (87%) has to be
+    computed by extrapolation and may not be very accurate:
+
+    >>> stats.anderson_ksamp([np.random.normal(size=50),
+    ... np.random.normal(size=30), np.random.normal(size=20)])
+    (-0.73091722665244196,
+      array([ 0.44925884,  1.3052767 ,  1.9434184 ,  2.57696569,  3.41634856]),
+      0.8789283903979661)
+
+    """
+    samples = [data1, data2]
+    k = len(samples)
+    if (k < 2):
+        raise ValueError("anderson_ksamp needs at least two samples")
+
+    samples = list(map(np.asarray, samples))
+    if binned:
+        Z = Zstar = sum(samples)
+        n = np.array([sample.sum() for sample in samples])
+        N = n.sum()
+        A2kN = _anderson_ksamp_midrank_binned(samples, Z, Zstar, k, n, N)
+    else:
+        Z = np.sort(np.hstack(samples))
+        N = Z.size
+        Zstar = np.unique(Z)
+        if Zstar.size < 2:
+            raise ValueError("anderson_ksamp needs more than one distinct "
+                             "observation")
+
+        n = np.array([sample.size for sample in samples])
+        if any(n == 0):
+            raise ValueError("anderson_ksamp encountered sample without "
+                             "observations")
+
+        if midrank:
+            A2kN = _anderson_ksamp_midrank(samples, Z, Zstar, k, n, N)
+        else:
+            A2kN = _anderson_ksamp_right(samples, Z, Zstar, k, n, N)
+
+    H = (1. / n).sum()
+    hs_cs = (1. / np.arange(N - 1, 1, -1)).cumsum()
+    h = hs_cs[-1] + 1
+    g = (hs_cs / np.arange(2, N)).sum()
+
+    a = (4*g - 6) * (k - 1) + (10 - 6*g)*H
+    b = (2*g - 4)*k**2 + 8*h*k + (2*g - 14*h - 4)*H - 8*h + 4*g - 6
+    c = (6*h + 2*g - 2)*k**2 + (4*h - 4*g + 6)*k + (2*h - 6)*H + 4*h
+    d = (2*h + 6)*k**2 - 4*h*k
+    sigmasq = (a*N**3 + b*N**2 + c*N + d) / ((N - 1.) * (N - 2.) * (N - 3.))
+    m = k - 1
+    A2 = (A2kN - m) / np.sqrt(sigmasq)
+
+    # The b_i values are the interpolation coefficients from Table 2
+    # of Scholz and Stephens 1987
+    b0 = np.array([0.675, 1.281, 1.645, 1.96, 2.326])
+    b1 = np.array([-0.245, 0.25, 0.678, 1.149, 1.822])
+    b2 = np.array([-0.105, -0.305, -0.362, -0.391, -0.396])
+    critical = b0 + b1 / np.sqrt(m) + b2 / m
+    pf = np.polyfit(critical, np.log(np.array([0.25, 0.1, 0.05, 0.025, 0.01])), 2)
+    if A2 < critical.min() or A2 > critical.max():
+        warnings.warn("approximate p-value will be computed by extrapolation")
+
+    p = np.exp(np.polyval(pf, A2))
+    return Anderson_ksampResult(A2, p, float('nan'))
+
+def _log_fac(m,n):
+    return np.log(np.arange(m,n+1)).sum()
+@np.vectorize
+def _log_binomial(n,k): 
+    if k > (n-k):
+        return (_log_fac(n-k+1,n)-_log_fac(2,k))
+    else:
+        return (_log_fac(k+1,n)-_log_fac(2,n-k))
+
+def _loglikelihood(data1, data2, N_data1, N_data2, ratio, H = "H0"):
+    t = data1 + data2
+    logC = 0.
+    if not ratio:
+        logC = float(sum(log(binomial(t[i], data2[i])) for i in range(t.shape[0])))
+    if H=="H1":
+        a = data2/data1
+    if H=="H0":
+        a = N_data2 / N_data1
+    ###################################################################
+    if DEBUG:
+        global statistic_seq
+        statistic_seq = -2 * (logC - scipy.special.xlogy(t, 1+a) + scipy.special.xlogy(data2, a))
+    ###################################################################
+    return -2 * (logC - scipy.special.xlogy(t, 1+a).sum() + scipy.special.xlogy(data2, a).sum())
+
+def _zloglikelihood(data1, data2, N_data1, N_data2, H = "H0"):
+    z_not_in_both = (data1 == 0) ^ (data2 == 0)
+    data1 = data1[z_not_in_both]
+    data2 = data2[z_not_in_both]
+    t = data1 + data2
+    if H == "H0":
+        p = N_data1 / (N_data1 + N_data2)
+        #################################################################
+        if DEBUG:
+            global statistic_seq
+            statistic_seq = np.concatenate([statistic_seq, -2 * scipy.special.xlogy(t[data2==0], p), scipy.special.xlogy(t[data1 == 0], 1-p)])
+        #################################################################
+        return -2 * (scipy.special.xlogy(t[data2==0], p).sum() + scipy.special.xlogy(t[data1 == 0], 1-p).sum())
+    if H == "H1":
+        return 0.
+
+LikelihoodRatio_ksampResult = namedtuple('LikelihoodRatio_ksampResult', ('statistic', 'pvalue', 'ndf'))
+def likelihoodratio_ksamp(data1, data2, normed=True, binned=True):
+    """
+    The likelihood-ratio test tests the null hypothesis that 2 given frequencies are
+    drawn from the same distribution.
+    
+    Parameters
+    ----------
+    data1, data2 : sequence of 1-D ndarrays
+        Input data. Observed frequencies in each category.
+    normed : bool, optional, default: True
+        If True/False, shape/value comparison test.
+    binned : bool, optional, default: True
+        If True/False, assume the type of input data is observed frequencies/samples.
+    
+    Returns
+    -------
+    statistic : float
+        The llike-ratio test statistic.
+    pvalue : float
+        Corresponding p-value.
+    ndf : int
+        「Degrees of freedom」: the degrees of freedom for the p-value. The p-value
+        is computed using a chi-squared distribution with k - 1 degrees of freedom,
+        where k is the number of observed frequencies without bins has zero counts 
+        in both histograms.
+    """
+    not_all_zeros = (data1 != 0) & (data2 != 0)
+    ndf = sum((data1 != 0) | (data2 != 0))
+    N_data1 = data1.sum()
+    N_data2 = data2.sum()
+    if normed:
+        ndf -= 1
+    llike_H0 = _loglikelihood(data1[not_all_zeros], data2[not_all_zeros], N_data1, N_data2, ratio=True, H="H0") + _zloglikelihood(data1[~not_all_zeros], data2[~not_all_zeros], N_data1, N_data2, H="H0")
+    if DEBUG:
+        global statistic_seq
+        STATISTIC_SEQ = statistic_seq
+    llike_H1 = _loglikelihood(data1[not_all_zeros], data2[not_all_zeros], N_data1, N_data2, ratio=True, H="H1")
+    if DEBUG:
+        STATISTIC_SEQ[:statistic_seq.shape[0]] -= statistic_seq
+        statistic_seq = STATISTIC_SEQ
+    llike_ratio = llike_H0 - llike_H1
+    return LikelihoodRatio_ksampResult(llike_ratio, scipy.stats.chi2.sf(llike_ratio, ndf), ndf)
+
+LikelihoodValue_ksampResult = namedtuple('LikelihoodValue_ksampResult', ('statistic', 'pvalue', 'ndf'))
+def likelihoodvalue_ksamp(data1, data2, normed=True, binned=True):
+    """
+    The likelihood-value test tests the null hypothesis that 2 given frequencies are
+    drawn from the same distribution.
+    
+    Parameters
+    ----------
+    data1, data2 : sequence of 1-D ndarrays
+        Input data. Observed frequencies in each category.
+    normed : bool, optional, default: True
+        If True/False, shape/value comparison test.
+    binned : bool, optional, default: True
+        If True/False, assume the type of input data is observed frequencies/samples.
+    
+    Returns
+    -------
+    statistic : float
+        The llike-value test statistic.
+    pvalue : float
+        Corresponding p-value.
+    ndf : int
+        「Degrees of freedom」: the degrees of freedom for the p-value. The p-value
+        is computed using a chi-squared distribution with k - 1 degrees of freedom,
+        where k is the number of observed frequencies without bins has zero counts 
+        in both histograms.
+    """
+    no_zeros = (data1 != 0) | (data2 != 0)
+    ndf = no_zeros.sum()
+    if normed:
+        ndf -= 1
+    llike = _loglikelihood(data1[no_zeros], data2[no_zeros], data1.sum(), data2.sum(), ratio=False, H="H0") 
+    return LikelihoodValue_ksampResult(llike, scipy.stats.chi2.sf(llike, ndf), ndf)
diff --git a/Reconstruction/RecExample/RecExOnline/python/to_root.py b/Reconstruction/RecExample/RecExOnline/python/to_root.py
new file mode 100644
index 000000000000..c355b1cf8d3b
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/python/to_root.py
@@ -0,0 +1,21 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+import ROOT
+import numpy as np
+import warnings
+def fill_branch_by_arr(filename ,treename, list_of_branchname, list_of_entrylist):
+    of = ROOT.TFile(filename, 'update')
+    if of.GetListOfKeys().Contains(treename):
+        t = of.Get(treename)
+        warnings.warn('%r exsists.' % t, Warning)
+    else:
+        t = ROOT.TTree(treename, treename)
+    for branchname, entrylist in zip(list_of_branchname, list_of_entrylist):
+	    t.SetEntries(entrylist.size)
+	    address = np.zeros(1, 'float32')
+	    br = t.Branch(branchname, address, branchname+'/F')
+	    for en in entrylist:
+	        address[0] = en
+	        br.Fill()
+    of.Write("", 2)
+    of.Close()
\ No newline at end of file
diff --git a/Reconstruction/RecExample/RecExOnline/python/utils.py b/Reconstruction/RecExample/RecExOnline/python/utils.py
new file mode 100644
index 000000000000..205690c7d8d2
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/python/utils.py
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+from collections import defaultdict
+import numpy as np
+def tree(key_wrapper = None):
+    return lambda : TreeDict({}, key_wrapper)
+def directory_like(*key):
+    if len(key) == 1:
+        return key[0].split('/',1)
+    else:
+        return key
+
+def get_array(hist):
+    arr = hist.GetArray()
+    arr.SetSize(hist.GetNbinsX() + 2)
+    return np.fromiter(arr, np.float)
+
+TAIL   = lambda s: u' └── {} '.format(s)
+BRANCH = lambda s: u' ├── {} '.format(s)
+LINE   = lambda s: u' │   {} '.format(s)
+SPACE  = lambda s: u'     {} '.format(s)
+class TreeDict(defaultdict):
+    def __init__(self, dic = {}, key_wrapper=None):
+        super(defaultdict,self).__init__(dic)
+        self.default_factory = tree(key_wrapper)
+        self.key_wrapper = key_wrapper
+    def __missing__(self, key, wrap=True):
+        if self.default_factory is None: raise KeyError((key,))
+        if wrap and self.key_wrapper:
+            key = self.key_wrapper(key)
+            if len(key) == 1:
+                return self.__missing__(key[0], wrap=False)
+            else:
+                return self[key[0]][key[1]]
+        self[key] = value = self.default_factory()
+        return value
+    def __setitem__(self, key, value, wrap=True):
+        if wrap and self.key_wrapper:
+            key = self.key_wrapper(key)
+            if len(key) == 1:
+                self.__setitem__(key[0], value, wrap=False)
+            else:
+                self[key[0]][key[1]] = value
+        else:
+            super(defaultdict, self).__setitem__(key, value)
+    def to_dict(self):
+        return dict((key, val.to_dict()) if isinstance(val, TreeDict) else (key, val) for key, val in self.items())
+    def __repr__(self, level=0):
+        ret = u''
+        items = list(self.items())
+        len_key = 0
+        for i, (key, val) in enumerate(items):
+            LS = BRANCH if i < len(items)-1 else TAIL
+            ret += SPACE(' '*len_key)*level + LS(key.ljust(len_key)) + '\n'
+            if isinstance(val, TreeDict):
+                ret += val.__repr__(level+1)
+            else:
+                ret += SPACE(' '*len_key)*(level+1) + LS(str(val).ljust(len_key)) + '\n' 
+        return ret
+    def _repr_pretty_(self, p, cycle):
+        return p.text(repr(self))
diff --git a/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring.py b/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring.py
index 2c507be990e8..cf1be02b84d6 100644
--- a/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring.py
+++ b/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring.py
@@ -1,25 +1,30 @@
 ## -- Overview of all default local settings that one can change 
 ## -- The default values are also shown.
 
+isHI_2016 = False
+
 ## ------------------------------------------- flags set in: RecExOnline_jobOptions.py  
+
 isOnline          = True
 isOnlineStateless = True
 
+# for testing on lxplus
+isOfflineTest     = False
+
 #for the time being, running over file is not possible ONLINE (please see RecExOnline_File_Offline.py) 
 useEmon           = True
 ## KeyCount value in the EMON service defined as 1-byte, i.e. the maximum allowed value is 255. 
-keycount          = 250
+keycount          = 150
 buffersize        = 10
 updateperiod      = 200
 # timeout is in ms
 timeout           = 600000
+
 #keyname           = 'efd'   #AK: 21-05-2014
 keyname           = 'dcm'
 
 import os
 
-#streamName        = os.environ.get("GLOBAL_STREAM_NAME")  #AK: 21-05-2014
-#streamLogic       = os.environ.get("GLOBAL_STREAM_LOGIC")  #AK: 21-05-2014
 partitionName     = os.environ.get("TDAQ_PARTITION", "ATLAS")
 publishNumber     = os.environ.get("GLOBAL_JOB_NUMBER", "1")
 publishName       = os.environ.get("TDAQ_APPLICATION_NAME", "GlobalMonitoring")
@@ -27,6 +32,62 @@ publishName       = os.environ.get("TDAQ_APPLICATION_NAME", "GlobalMonitoring")
 print publishName
 isserverName = 'Histogramming-Global-iss'  # Ak: 26-05-2014 - needed to write out the gathere hsitograms to the correct server
 
+#streamName       = 'MinBias'
+streamName        = 'express'
+streamLogic       = 'Or'
+
+# When using ATLAS partition
+# Use different streams for "atlas standby" and "atlas ready"
+#
+if (partitionName == 'ATLAS' or partitionName == 'ATLAS_MP1'):
+    streamLogic       = 'Or'
+    
+    import RecExOnline.OnlineISConfiguration
+    import ispy
+    from ispy import *
+    from ipc import IPCPartition
+    from ispy import ISObject
+
+    obj = ispy.ISObject(ispy.IPCPartition(partitionName), 'RunParams.RunParams', 'RunParams')
+    obj.checkout()
+    ### if ( obj.T0_project_tag == 'data15_comm' or obj.T0_project_tag == 'data15_13TeV'):
+    if ( obj.T0_project_tag == 'data17_comm' or obj.T0_project_tag == 'data17_13TeV' or obj.T0_project_tag == 'data17_1beam' or obj.T0_project_tag == 'data16_comm' or obj.T0_project_tag == 'data16_13TeV' or obj.T0_project_tag == 'data16_5TeV' or obj.T0_project_tag == 'data16_1beam' or obj.T0_project_tag == 'data16_hip' or obj.T0_project_tag == 'data16_hip5TeV' or obj.T0_project_tag == 'data16_hip8TeV'):
+        #streamName        = 'MinBias'
+        #streamName        = 'Main' # Switching due to missingg Minbias stream -= 13/06/2015 AK
+        try:
+            if RecExOnline.OnlineISConfiguration.GetAtlasReady():
+                print "ATLAS READY, reading express stream"
+                streamName = 'express'
+            else:
+                print "ATLAS NOT READY, reading standby stream"
+                ### streamName = 'standby'
+                ### streamName = 'physics_Standby'
+                streamName = 'Standby'
+        except:
+            streamName = 'express'
+    else:
+        streamName        = 'express:IDCosmic:HLT_IDCosmic:CosmicMuons:MinBias'
+else:
+    streamLogic       = 'Ignore'
+    
+
+
+
+#
+# When NOT using ATLAS partition
+#
+if (partitionName != 'ATLAS' and partitionName != 'ATLAS_MP1'):
+    if isHI_2016:
+       publishName     = 'GMTest_hiconf'
+    else:
+       publishName     = 'GMTest_ppconf'
+    isserverName    = 'Histogramming'
+
+
+print "GlobalMonitoring : streamName streamLogic= ",streamName,streamLogic
+print "publishName      : ",publishName
+
+
 #import time
 #myfloat = float(publishNumber)
 #tosleep = myfloat*5
@@ -52,7 +113,17 @@ for pid in pids:
 
 
 useAtlantisEmon   = False
-evtMax            = -1
+
+### evtMax            = -1
+### evtMax            = 50
+
+if (partitionName == 'ATLAS' or partitionName == 'ATLAS_MP1'):
+    evtMax            = -1
+
+if (partitionName != 'ATLAS' and partitionName != 'ATLAS_MP1'):
+    # evtMax            = 200
+    evtMax            = -1 # lshi: for Gatherer test
+
 
 ## ------------------------------------------- flags set in: RecExOnline_emonsvc.py (from RecExOnline_jobOptions.py)                    
 
@@ -66,12 +137,30 @@ pickleconfigfile  = './ami_recotrf.pickle'
 DataSource        = 'data'
 InputFormat       = 'bytestream'
 fileName          = './0.data'
-beamType          = 'cosmics'  #AK: 21-05-2014
-#beamType          = 'collisions'  #AK: 21-05-2014
+#beamType          = 'cosmics'  
+beamType          = 'collisions'  #AK: 21-05-2014
 
 #COND tag and GEO are needed for running over a test partition online
-ConditionsTag     = 'COMCOND-HLTP-004-03' #AK was -01
-DetDescrVersion   = 'ATLAS-GEO-20-00-01'
+#ConditionsTag     = 'CONDBR2-HLTP-2015-08' # 20160317
+ConditionsTag     = 'CONDBR2-HLTP-2016-01'
+DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'  ### new for offline (19.3.0.1)
+### test run1
+if isHI_2016:
+   ConditionsTag     = 'CONDBR2-HLTP-2016-01'
+   DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'
+
+### ConditionsTag     = 'CONDBR2-HLTP-2016-01' # 2016-02-05 Based on CONDBR2-HLTP-2015-08, for M11.
+### ConditionsTag     = 'CONDBR2-HLTP-2015-08' # 20160317
+### ConditionsTag     = 'CONDBR2-HLTP-2015-07'   # created 2015-08-10
+### ConditionsTag     = 'CONDBR2-HLTP-2015-05'
+### ConditionsTag     = 'CONDBR2-HLTP-2015-04'
+### ConditionsTag     = 'CONDBR2-HLTP-2015-01'
+### ConditionsTag     = 'CONDBR2-ES1PA-2014-01'  ### new for offline (19.3.0.1)
+
+### DetDescrVersion   = 'ATLAS-R2-2015-01-01-00'
+### DetDescrVersion   = 'ATLAS-R2-2015-02-00-00'  ### new for offline (19.3.0.1)
+### DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'  ### new for offline (19.3.0.1)
+
 
 doESD             = True
 writeESD          = False
@@ -83,46 +172,147 @@ abortonuncheckedstatuscode = False
 
 ## ------------------------------------------ flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
 doAllReco   = True
+
 doInDet     = doAllReco
+### doInDet     = False
+
 doMuon      = doAllReco
+###doMuon      = False
+
 doLArg      = doAllReco
 doTile      = doAllReco
-doTrigger   = False
+
+doTrigger   = doAllReco
+
+   
 doHist      = doAllReco
 doJiveXML   = False
+
 doEgammaTau = doAllReco
+### doEgammaTau = False
+
+doHIPRec     = False
+
+doHIRec     = False
 
 #set to True in the JO
 #doCommissioning = False
 
 ## ------------------------------------------ flags set in : RecExOnline_monitoring.py (from from RecExOnline_jobOptions.py)
 doAllMon  = True
+
 doCaloMon = doAllMon
-doTileMon = doAllMon
-doPhysMon = False #doAllMon
-doTrigMon = False
+
+doTileMon = doAllMon #AK: new since 09 july 2014 (M4)
+# doTileMon = False
+
+doPhysMon = doAllMon
+
+doTrigMon = doAllMon
+
 doIDMon   = doAllMon
+###doIDMon   = False
+
 doTRTMon  = doAllMon
-doMuonMon = False #doAllMon #AK: 10-07-2014 RpcClusterization errors
+###doTRTMon  = False
+
+doMuonMon = doAllMon
+### doMuonMon = False
+
 doCTPMon  = False #doAllMon #AK: 25-01-2014
+doHIMon   = False # doAllMon
+
+if isHI_2016:
+   #doTrigger   = False
+   doHIPRec    = doAllReco
+   doZdc       = doAllReco
+   #doTrigMon = False
+   doHIMon   = doAllMon
+### doHIMon   = False # doAllMon
 
 ## ------------------------------------------ flags set in : RecExOnline_postconfig.py    (called from RecExOnline_jobOptions.py)
 
+from AthenaCommon.GlobalFlags import globalflags
+globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+
+from AthenaCommon.BFieldFlags import jobproperties
+jobproperties.BField.barrelToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.endcapToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.solenoidOn.set_Value_and_Lock(True)
+###jobproperties.BField.solenoidOn.set_Value_and_Lock(False)
+
+
+from CaloRec.CaloCellFlags import jobproperties
+jobproperties.CaloCellFlags.doLArHVCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)  ####? for trigger, added 11th March, 2015, by CY
+
+
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True)
+InDetFlags.useBroadClusterErrors.set_Value_and_Lock(False)
 
-#### CHANGES TO GET 19.1.0.1 RECO WORKING
 from AthenaMonitoring.DQMonFlags import DQMonFlags
-DQMonFlags.doMuonCombinedMon.set_Value_and_Lock(False)
-DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(False)
-DQMonFlags.doJetTagMon.set_Value_and_Lock(False)
-#DQMonFlags.doCaloMon.set_Value_and_Lock(False)
-#DQMonFlags.doPixelMon.set_Value_and_Lock(False)
+DQMonFlags.doStreamAwareMon.set_Value_and_Lock(False)
+DQMonFlags.enableLumiAccess.set_Value_and_Lock(False)
+DQMonFlags.doCTPMon.set_Value_and_Lock(False)         
+DQMonFlags.doLVL1CaloMon.set_Value_and_Lock(False)    
+### DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(False) #xx
+DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(True) #xx
+### DQMonFlags.doJetTagMon.set_Value_and_Lock(False)
+#print "#### yunju Here is DQMonFlags.monManEnvironment:"+DQMonFlags.monManEnvironment
+## for egmma monitoring in lxplus
+#if isHI_2016:
+#   DQMonFlags.monManEnvironment.set_Value_and_Lock('tier0')
 
 from RecExConfig.RecFlags import rec
-rec.doJetMissingETTag.set_Value_and_Lock(False) 
-#from AthenaCommon.AthenaCommonFlags import jobproperties,athenaCommonFlags
-#jobproperties.JetRecFlags.Enabled.set_Value(False)
-from tauRec.tauRecFlags import jobproperties
-jobproperties.tauRecFlags.doTauRec = False 
+rec.doBTagging.set_Value_and_Lock(True)
+
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useBTagging.set_Value_and_Lock(True)
+
+### from JetRec.JetRecFlags import jetFlags
+### jetFlags.useTracks.set_Value_and_Lock(False)
+
+from MuonDQAMonFlags.MuonDQAProperFlags import MuonDQADetFlags
+### MuonDQADetFlags.doMDTTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCMon.set_Value_and_Lock(True)
+
+
+##---------------------------------------ID suggestion from Alex 18.Feb.2015  --------
+jobproperties.InDetJobProperties.doTrackSegmentsSCT.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsPixel.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsTRT.set_Value_and_Lock(False)
+
+
+##---------------------------------------Bunch Spacing 25ns  --------
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.InDet25nsec.set_Value_and_Lock(True)
+
+jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25)
+
+# --------------------------------------------- Monitoring
+### replaced by MuonTrackMonitoring (SMW Jan 23 2016)
+### from AthenaMonitoring.DQMonFlags import DQMonFlags
+### DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(True)
+
+
+### ------------------- inherited from 20.1.0.2 -----------
+#from RecExConfig.RecFlags import rec
+#rec.doJetMissingETTag.set_Value_and_Lock(False)
+
+
+#from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags
+#HLTMonFlags.doBphys=False
+
+
+#jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)
+
+#from LArConditionsCommon.LArCondFlags import larCondFlags
+#larCondFlags.OFCShapeFolder.set_Value_and_Lock("")
 
 ## main online reco scripts
 include ("RecExOnline/RecExOnline_jobOptions.py")
+if isHI_2016:
+   include ("HIRecExample/hip_outputPostExec.py")
diff --git a/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_RunHIPP.py b/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_RunHIPP.py
new file mode 100644
index 000000000000..a6ec3ba479c8
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_RunHIPP.py
@@ -0,0 +1,317 @@
+## -- Overview of all default local settings that one can change 
+## -- The default values are also shown.
+
+isHI_2016 = False
+
+## ------------------------------------------- flags set in: RecExOnline_jobOptions.py  
+
+isOnline          = True
+isOnlineStateless = True
+
+# for testing on lxplus
+isOfflineTest     = False
+
+#for the time being, running over file is not possible ONLINE (please see RecExOnline_File_Offline.py) 
+useEmon           = True
+## KeyCount value in the EMON service defined as 1-byte, i.e. the maximum allowed value is 255. 
+keycount          = 150
+buffersize        = 10
+updateperiod      = 200
+# timeout is in ms
+timeout           = 600000
+
+#keyname           = 'efd'   #AK: 21-05-2014
+keyname           = 'dcm'
+
+import os
+
+partitionName     = os.environ.get("TDAQ_PARTITION", "ATLAS")
+publishNumber     = os.environ.get("GLOBAL_JOB_NUMBER", "1")
+publishName       = os.environ.get("TDAQ_APPLICATION_NAME", "GlobalMonitoring")
+
+print publishName
+isserverName = 'Histogramming-Global-iss'  # Ak: 26-05-2014 - needed to write out the gathere hsitograms to the correct server
+
+#streamName       = 'MinBias'
+streamName        = 'express'
+streamLogic       = 'Or'
+
+# When using ATLAS partition
+# Use different streams for "atlas standby" and "atlas ready"
+#
+if (partitionName == 'ATLAS'):
+    streamLogic       = 'Or'
+    
+    import RecExOnline.OnlineISConfiguration
+    import ispy
+    from ispy import *
+    from ipc import IPCPartition
+    from ispy import ISObject
+
+    obj = ispy.ISObject(ispy.IPCPartition(partitionName), 'RunParams.RunParams', 'RunParams')
+    obj.checkout()
+    ### if ( obj.T0_project_tag == 'data15_comm' or obj.T0_project_tag == 'data15_13TeV'):
+    if ( obj.T0_project_tag == 'data15_comm' or obj.T0_project_tag == 'data15_13TeV' or obj.T0_project_tag == 'data15_5TeV' or obj.T0_project_tag == 'data16_comm' or obj.T0_project_tag == 'data16_13TeV' or obj.T0_project_tag == 'data16_5TeV' or obj.T0_project_tag == 'data16_1beam' or obj.T0_project_tag == 'data16_hip' or obj.T0_project_tag == 'data16_hip5TeV' or obj.T0_project_tag == 'data16_hip8TeV'):
+        #streamName        = 'MinBias'
+        #streamName        = 'Main' # Switching due to missingg Minbias stream -= 13/06/2015 AK
+        try:
+            if RecExOnline.OnlineISConfiguration.GetAtlasReady():
+                print "ATLAS READY, reading express stream"
+                streamName = 'express'
+            else:
+                print "ATLAS NOT READY, reading standby stream"
+                ### streamName = 'standby'
+                ### streamName = 'physics_Standby'
+                streamName = 'Standby'
+        except:
+            streamName = 'express'
+    else:
+        streamName        = 'express:IDCosmic:HLT_IDCosmic:CosmicMuons:MinBias'
+else:
+    streamLogic       = 'Ignore'
+    
+
+
+
+#
+# When NOT using ATLAS partition
+#
+if (partitionName != 'ATLAS'):
+    if isHI_2016:
+       publishName     = 'lshi_hiconf_pp_20_11_2_2_1'
+    else:
+       publishName     = 'lshi_ppconf_pp_20_11_2_2_1'
+    isserverName    = 'Histogramming'
+
+
+print "GlobalMonitoring : streamName streamLogic= ",streamName,streamLogic
+print "publishName      : ",publishName
+
+
+#import time
+#myfloat = float(publishNumber)
+#tosleep = myfloat*5
+#time.sleep(tosleep)
+
+import commands
+pids=commands.getoutput("/sbin/pidof -o %u python" % os.getpid()).split(" ")
+print "pids",pids
+
+for pid in pids:
+  print "pid",pid
+  #if (False):
+  #if (1):
+  if (0):
+    print "pid = ",pid
+    #thisnumber=commands.getoutput("grep GLOBAL_JOB_NUMBER /proc/%u/fd/1 -m 1 | cut -f2 -d'='" % int(pid))
+    thisname=commands.getoutput("grep TDAQ_APPLICATION_NAME /proc/%u/fd/1 -m 1 | cut -f2 -d'='" % int(pid))
+    print "thisname = ",thisname
+    print "publishName = ",publishName
+    if (thisname == publishName):
+      print "found a match! Will Kill pid = ",pid
+      killreturn = commands.getoutput("kill %u" % int(pid))
+
+
+useAtlantisEmon   = False
+
+### evtMax            = -1
+### evtMax            = 50
+
+if (partitionName == 'ATLAS'):
+    evtMax            = -1
+
+if (partitionName != 'ATLAS'):
+    # evtMax            = 200
+    evtMax            = -1 # lshi: for Gatherer test
+
+
+## ------------------------------------------- flags set in: RecExOnline_emonsvc.py (from RecExOnline_jobOptions.py)                    
+
+isGlobalMonitoring = True
+
+## ------------------------------------------- flags set in: RecExOnline_globalconfig.py  (from RecExOnline_jobOptions.py)
+#read the pickle file if you want to use the AMI tag info
+#stored in ami_recotrf.pickle (produced by 'tct_getAmiTag.py f140 ami_recotrf.cmdargs ami_recotrf.pickle') 
+usePickleConfig   = False
+pickleconfigfile  = './ami_recotrf.pickle'
+DataSource        = 'data'
+InputFormat       = 'bytestream'
+fileName          = './0.data'
+#beamType          = 'cosmics'  
+beamType          = 'collisions'  #AK: 21-05-2014
+
+#COND tag and GEO are needed for running over a test partition online
+#ConditionsTag     = 'CONDBR2-HLTP-2015-08' # 20160317
+ConditionsTag     = 'CONDBR2-HLTP-2016-01'
+DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'  ### new for offline (19.3.0.1)
+### test run1
+if isHI_2016:
+   ConditionsTag     = 'CONDBR2-HLTP-2016-01'
+   DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'
+
+### ConditionsTag     = 'CONDBR2-HLTP-2016-01' # 2016-02-05 Based on CONDBR2-HLTP-2015-08, for M11.
+### ConditionsTag     = 'CONDBR2-HLTP-2015-08' # 20160317
+### ConditionsTag     = 'CONDBR2-HLTP-2015-07'   # created 2015-08-10
+### ConditionsTag     = 'CONDBR2-HLTP-2015-05'
+### ConditionsTag     = 'CONDBR2-HLTP-2015-04'
+### ConditionsTag     = 'CONDBR2-HLTP-2015-01'
+### ConditionsTag     = 'CONDBR2-ES1PA-2014-01'  ### new for offline (19.3.0.1)
+
+### DetDescrVersion   = 'ATLAS-R2-2015-01-01-00'
+### DetDescrVersion   = 'ATLAS-R2-2015-02-00-00'  ### new for offline (19.3.0.1)
+### DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'  ### new for offline (19.3.0.1)
+
+
+doESD             = True
+writeESD          = False
+doAOD             = False
+writeAOD          = False
+IOVDbSvcMessage   = False
+
+abortonuncheckedstatuscode = False
+
+## ------------------------------------------ flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
+doAllReco   = True
+
+doInDet     = doAllReco
+### doInDet     = False
+
+doMuon      = doAllReco
+###doMuon      = False
+
+doLArg      = doAllReco
+doTile      = doAllReco
+
+doTrigger   = doAllReco
+
+   
+doHist      = doAllReco
+doJiveXML   = False
+
+doEgammaTau = doAllReco
+### doEgammaTau = False
+
+doHIRec     = False
+
+#set to True in the JO
+#doCommissioning = False
+
+## ------------------------------------------ flags set in : RecExOnline_monitoring.py (from from RecExOnline_jobOptions.py)
+doAllMon  = True
+
+doCaloMon = doAllMon
+
+doTileMon = doAllMon #AK: new since 09 july 2014 (M4)
+# doTileMon = False
+
+doPhysMon = doAllMon
+
+doTrigMon = doAllMon
+
+doIDMon   = doAllMon
+###doIDMon   = False
+
+doTRTMon  = doAllMon
+###doTRTMon  = False
+
+doMuonMon = doAllMon
+### doMuonMon = False
+
+doCTPMon  = False #doAllMon #AK: 25-01-2014
+doHIMon   = False # doAllMon
+
+if isHI_2016:
+   #doTrigger   = False
+   doHIRec     = doAllReco
+   #doTrigMon = False
+   doHIMon   = doAllMon
+### doHIMon   = False # doAllMon
+
+## ------------------------------------------ flags set in : RecExOnline_postconfig.py    (called from RecExOnline_jobOptions.py)
+
+from AthenaCommon.GlobalFlags import globalflags
+globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+
+from AthenaCommon.BFieldFlags import jobproperties
+jobproperties.BField.barrelToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.endcapToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.solenoidOn.set_Value_and_Lock(True)
+###jobproperties.BField.solenoidOn.set_Value_and_Lock(False)
+
+
+from CaloRec.CaloCellFlags import jobproperties
+jobproperties.CaloCellFlags.doLArHVCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)  ####? for trigger, added 11th March, 2015, by CY
+
+
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True)
+InDetFlags.useBroadClusterErrors.set_Value_and_Lock(False)
+
+from AthenaMonitoring.DQMonFlags import DQMonFlags
+DQMonFlags.doStreamAwareMon.set_Value_and_Lock(False)
+DQMonFlags.enableLumiAccess.set_Value_and_Lock(False)
+DQMonFlags.doCTPMon.set_Value_and_Lock(False)         
+DQMonFlags.doLVL1CaloMon.set_Value_and_Lock(False)    
+### DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(False) #xx
+DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(True) #xx
+### DQMonFlags.doJetTagMon.set_Value_and_Lock(False)
+#print "#### yunju Here is DQMonFlags.monManEnvironment:"+DQMonFlags.monManEnvironment
+## for egmma monitoring in lxplus
+#if isHI_2016:
+#   DQMonFlags.monManEnvironment.set_Value_and_Lock('tier0')
+
+from RecExConfig.RecFlags import rec
+rec.doBTagging.set_Value_and_Lock(True)
+if isHI_2016:
+   rec.doHIP.set_Value_and_Lock(True)
+
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useBTagging.set_Value_and_Lock(True)
+
+### from JetRec.JetRecFlags import jetFlags
+### jetFlags.useTracks.set_Value_and_Lock(False)
+
+from MuonDQAMonFlags.MuonDQAProperFlags import MuonDQADetFlags
+### MuonDQADetFlags.doMDTTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCMon.set_Value_and_Lock(True)
+
+
+##---------------------------------------ID suggestion from Alex 18.Feb.2015  --------
+jobproperties.InDetJobProperties.doTrackSegmentsSCT.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsPixel.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsTRT.set_Value_and_Lock(False)
+
+
+##---------------------------------------Bunch Spacing 25ns  --------
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.InDet25nsec.set_Value_and_Lock(True)
+
+jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25)
+
+# --------------------------------------------- Monitoring
+### replaced by MuonTrackMonitoring (SMW Jan 23 2016)
+### from AthenaMonitoring.DQMonFlags import DQMonFlags
+### DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(True)
+
+
+### ------------------- inherited from 20.1.0.2 -----------
+#from RecExConfig.RecFlags import rec
+#rec.doJetMissingETTag.set_Value_and_Lock(False)
+
+
+#from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags
+#HLTMonFlags.doBphys=False
+
+
+#jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)
+
+#from LArConditionsCommon.LArCondFlags import larCondFlags
+#larCondFlags.OFCShapeFolder.set_Value_and_Lock("")
+
+## main online reco scripts
+include ("RecExOnline/RecExOnline_jobOptions.py")
+if isHI_2016:
+   include ("HIRecExample/hip_outputPostExec.py")
diff --git a/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_defaultHI.py b/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_defaultHI.py
new file mode 100644
index 000000000000..d098d87e1c3e
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_defaultHI.py
@@ -0,0 +1,304 @@
+## -- Overview of all default local settings that one can change 
+## -- The default values are also shown.
+
+## ------------------------------------------- flags set in: RecExOnline_jobOptions.py  
+isOnline          = True
+isOnlineStateless = True
+
+# for testing on lxplus
+isOfflineTest     = False
+
+#for the time being, running over file is not possible ONLINE (please see RecExOnline_File_Offline.py) 
+useEmon           = True
+## KeyCount value in the EMON service defined as 1-byte, i.e. the maximum allowed value is 255. 
+keycount          = 150
+buffersize        = 10
+updateperiod      = 200
+# timeout is in ms
+timeout           = 600000
+
+#keyname           = 'efd'   #AK: 21-05-2014
+keyname           = 'dcm'
+
+import os
+
+partitionName     = os.environ.get("TDAQ_PARTITION", "ATLAS")
+publishNumber     = os.environ.get("GLOBAL_JOB_NUMBER", "1")
+publishName       = os.environ.get("TDAQ_APPLICATION_NAME", "GlobalMonitoring")
+
+print publishName
+isserverName = 'Histogramming-Global-iss'  # Ak: 26-05-2014 - needed to write out the gathere hsitograms to the correct server
+
+#streamName       = 'MinBias'
+streamName        = 'express'
+streamLogic       = 'Or'
+
+# When using ATLAS partition
+# Use different streams for "atlas standby" and "atlas ready"
+#
+if (partitionName == 'ATLAS'):
+    streamLogic       = 'Or'
+    
+    import RecExOnline.OnlineISConfiguration
+    import ispy
+    from ispy import *
+    from ipc import IPCPartition
+    from ispy import ISObject
+
+    obj = ispy.ISObject(ispy.IPCPartition(partitionName), 'RunParams.RunParams', 'RunParams')
+    obj.checkout()
+    ### if ( obj.T0_project_tag == 'data15_comm' or obj.T0_project_tag == 'data15_13TeV'):
+    if ( obj.T0_project_tag == 'data15_comm' or obj.T0_project_tag == 'data15_13TeV' or obj.T0_project_tag == 'data15_5TeV' or obj.T0_project_tag == 'data16_comm' or obj.T0_project_tag == 'data16_13TeV' or obj.T0_project_tag == 'data16_5TeV' or obj.T0_project_tag == 'data16_1beam' or obj.T0_project_tag == 'data16_hip'):
+        #streamName        = 'MinBias'
+        #streamName        = 'Main' # Switching due to missingg Minbias stream -= 13/06/2015 AK
+        try:
+            if RecExOnline.OnlineISConfiguration.GetAtlasReady():
+                print "ATLAS READY, reading express stream"
+                streamName = 'express'
+            else:
+                print "ATLAS NOT READY, reading standby stream"
+                ### streamName = 'standby'
+                ### streamName = 'physics_Standby'
+                streamName = 'Standby'
+        except:
+            streamName = 'express'
+    else:
+        streamName        = 'express:IDCosmic:HLT_IDCosmic:CosmicMuons:MinBias'
+else:
+    streamLogic       = 'Ignore'
+    #projectName       = 'data13_hip'
+
+
+is_T0_project_tag = 'data13_hip'
+
+#
+# When NOT using ATLAS partition
+#
+if (partitionName != 'ATLAS'):
+    publishName     = 'YJ_GM_data13_hip_HI_tri_noprtag_HIMON'
+    isserverName    = 'Histogramming'
+
+
+print "GlobalMonitoring : streamName streamLogic= ",streamName,streamLogic
+print "publishName      : ",publishName
+
+
+#import time
+#myfloat = float(publishNumber)
+#tosleep = myfloat*5
+#time.sleep(tosleep)
+
+import commands
+pids=commands.getoutput("/sbin/pidof -o %u python" % os.getpid()).split(" ")
+print "pids",pids
+
+for pid in pids:
+  print "pid",pid
+  #if (False):
+  #if (1):
+  if (0):
+    print "pid = ",pid
+    #thisnumber=commands.getoutput("grep GLOBAL_JOB_NUMBER /proc/%u/fd/1 -m 1 | cut -f2 -d'='" % int(pid))
+    thisname=commands.getoutput("grep TDAQ_APPLICATION_NAME /proc/%u/fd/1 -m 1 | cut -f2 -d'='" % int(pid))
+    print "thisname = ",thisname
+    print "publishName = ",publishName
+    if (thisname == publishName):
+      print "found a match! Will Kill pid = ",pid
+      killreturn = commands.getoutput("kill %u" % int(pid))
+
+
+useAtlantisEmon   = False
+
+### evtMax            = -1
+### evtMax            = 50
+
+if (partitionName == 'ATLAS'):
+    evtMax            = -1
+
+if (partitionName != 'ATLAS'):
+    # evtMax            = 200
+    evtMax            = 30
+
+
+## ------------------------------------------- flags set in: RecExOnline_emonsvc.py (from RecExOnline_jobOptions.py)                    
+
+isGlobalMonitoring = True
+
+## ------------------------------------------- flags set in: RecExOnline_globalconfig.py  (from RecExOnline_jobOptions.py)
+#read the pickle file if you want to use the AMI tag info
+#stored in ami_recotrf.pickle (produced by 'tct_getAmiTag.py f140 ami_recotrf.cmdargs ami_recotrf.pickle') 
+usePickleConfig   = False
+pickleconfigfile  = './ami_recotrf.pickle'
+DataSource        = 'data'
+InputFormat       = 'bytestream'
+fileName          = './0.data'
+#beamType          = 'cosmics'  
+beamType          = 'collisions'  #AK: 21-05-2014
+
+#COND tag and GEO are needed for running over a test partition online
+### test run1
+#ConditionsTag     = 'COMCOND-HLTP-004-03'
+#DetDescrVersion   = 'ATLAS-GEO-20-00-01'
+
+ConditionsTag     = 'CONDBR2-HLTP-2016-01' # 2016-02-05 Based on CONDBR2-HLTP-2015-08, for M11.
+###ConditionsTag     = 'CONDBR2-HLTP-2015-08' # 20160317
+### ConditionsTag     = 'CONDBR2-HLTP-2015-07'   # created 2015-08-10
+### ConditionsTag     = 'CONDBR2-HLTP-2015-05'
+### ConditionsTag     = 'CONDBR2-HLTP-2015-04'
+### ConditionsTag     = 'CONDBR2-HLTP-2015-01'
+### ConditionsTag     = 'CONDBR2-ES1PA-2014-01'  ### new for offline (19.3.0.1)
+
+### DetDescrVersion   = 'ATLAS-R2-2015-01-01-00'
+### DetDescrVersion   = 'ATLAS-R2-2015-02-00-00'  ### new for offline (19.3.0.1)
+DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'  ### new for offline (19.3.0.1)
+
+
+doESD             = True
+writeESD          = False
+doAOD             = False
+writeAOD          = False
+IOVDbSvcMessage   = False
+
+abortonuncheckedstatuscode = False
+
+## ------------------------------------------ flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
+doAllReco   = True
+
+doInDet     = doAllReco
+### doInDet     = False
+
+doMuon      = doAllReco
+###doMuon      = False
+
+doLArg      = doAllReco
+doTile      = doAllReco
+
+doTrigger   = doAllReco
+#doTrigger   = False
+
+doHist      = doAllReco
+doJiveXML   = False
+
+doEgammaTau = doAllReco
+### doEgammaTau = False
+
+doHIRec     = doAllReco
+### doHIRec     = False
+
+#set to True in the JO
+#doCommissioning = False
+
+## ------------------------------------------ flags set in : RecExOnline_monitoring.py (from from RecExOnline_jobOptions.py)
+doAllMon  = True
+
+doCaloMon = doAllMon
+
+doTileMon = doAllMon #AK: new since 09 july 2014 (M4)
+# doTileMon = False
+
+doPhysMon = doAllMon
+
+doTrigMon = doAllMon
+#doTrigMon = False
+
+doIDMon   = doAllMon
+###doIDMon   = False
+
+doTRTMon  = doAllMon
+###doTRTMon  = False
+
+doMuonMon = doAllMon
+### doMuonMon = False
+
+doCTPMon  = False #doAllMon #AK: 25-01-2014
+
+doHIMon   = doAllMon
+### doHIMon   = False # doAllMon
+
+## ------------------------------------------ flags set in : RecExOnline_postconfig.py    (called from RecExOnline_jobOptions.py)
+
+from AthenaCommon.GlobalFlags import globalflags
+globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+#globalflags.DatabaseInstance.set_Value_and_Lock("COMP200")
+
+from AthenaCommon.BFieldFlags import jobproperties
+jobproperties.BField.barrelToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.endcapToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.solenoidOn.set_Value_and_Lock(True)
+###jobproperties.BField.solenoidOn.set_Value_and_Lock(False)
+
+
+from CaloRec.CaloCellFlags import jobproperties
+jobproperties.CaloCellFlags.doLArHVCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)  ####? for trigger, added 11th March, 2015, by CY
+
+
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True)
+InDetFlags.useBroadClusterErrors.set_Value_and_Lock(False)
+
+from AthenaMonitoring.DQMonFlags import DQMonFlags
+DQMonFlags.doStreamAwareMon.set_Value_and_Lock(False)
+DQMonFlags.enableLumiAccess.set_Value_and_Lock(False)
+DQMonFlags.doCTPMon.set_Value_and_Lock(False)         
+DQMonFlags.doLVL1CaloMon.set_Value_and_Lock(False)    
+### DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(False) #xx
+DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(True) #xx
+### DQMonFlags.doJetTagMon.set_Value_and_Lock(False)
+#print "#### yunju Here is DQMonFlags.monManEnvironment:"+DQMonFlags.monManEnvironment
+## for egmma monitoring in lxplus
+#DQMonFlags.monManEnvironment.set_Value_and_Lock('tier0')
+
+from RecExConfig.RecFlags import rec
+rec.doBTagging.set_Value_and_Lock(True)
+rec.doHIP.set_Value_and_Lock(True)
+
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useBTagging.set_Value_and_Lock(True)
+
+### from JetRec.JetRecFlags import jetFlags
+### jetFlags.useTracks.set_Value_and_Lock(False)
+
+from MuonDQAMonFlags.MuonDQAProperFlags import MuonDQADetFlags
+### MuonDQADetFlags.doMDTTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCMon.set_Value_and_Lock(True)
+
+
+##---------------------------------------ID suggestion from Alex 18.Feb.2015  --------
+jobproperties.InDetJobProperties.doTrackSegmentsSCT.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsPixel.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsTRT.set_Value_and_Lock(False)
+
+
+##---------------------------------------Bunch Spacing 25ns  --------
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.InDet25nsec.set_Value_and_Lock(True)
+
+jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25)
+
+# --------------------------------------------- Monitoring
+### replaced by MuonTrackMonitoring (SMW Jan 23 2016)
+### from AthenaMonitoring.DQMonFlags import DQMonFlags
+### DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(True)
+
+
+### ------------------- inherited from 20.1.0.2 -----------
+#from RecExConfig.RecFlags import rec
+#rec.doJetMissingETTag.set_Value_and_Lock(False)
+
+
+#from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags
+#HLTMonFlags.doBphys=False
+
+
+#jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)
+
+#from LArConditionsCommon.LArCondFlags import larCondFlags
+#larCondFlags.OFCShapeFolder.set_Value_and_Lock("")
+
+## main online reco scripts
+include ("RecExOnline/RecExOnline_jobOptions.py")
+
+include ("HIRecExample/hip_outputPostExec.py")
diff --git a/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_defaultpp.py b/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_defaultpp.py
new file mode 100644
index 000000000000..76f668d5cdc9
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/GlobalMonitoring_defaultpp.py
@@ -0,0 +1,282 @@
+## -- Overview of all default local settings that one can change 
+## -- The default values are also shown.
+
+## ------------------------------------------- flags set in: RecExOnline_jobOptions.py  
+isOnline          = True
+isOnlineStateless = True
+
+# for testing on lxplus
+isOfflineTest     = False
+
+#for the time being, running over file is not possible ONLINE (please see RecExOnline_File_Offline.py) 
+useEmon           = True
+## KeyCount value in the EMON service defined as 1-byte, i.e. the maximum allowed value is 255. 
+keycount          = 150
+buffersize        = 10
+updateperiod      = 200
+# timeout is in ms
+timeout           = 600000
+#keyname           = 'efd'   #AK: 21-05-2014
+keyname           = 'dcm'
+
+import os
+
+partitionName     = os.environ.get("TDAQ_PARTITION", "ATLAS")
+publishNumber     = os.environ.get("GLOBAL_JOB_NUMBER", "1")
+publishName       = os.environ.get("TDAQ_APPLICATION_NAME", "GlobalMonitoring")
+
+print publishName
+isserverName = 'Histogramming-Global-iss'  # Ak: 26-05-2014 - needed to write out the gathere hsitograms to the correct server
+
+#streamName       = 'MinBias'
+streamName        = 'express'
+streamLogic       = 'Or'
+
+# When using ATLAS partition
+# Use different streams for "atlas standby" and "atlas ready"
+#
+if (partitionName == 'ATLAS'):
+    streamLogic       = 'Or'
+    
+    import RecExOnline.OnlineISConfiguration
+    import ispy
+    from ispy import *
+    from ipc import IPCPartition
+    from ispy import ISObject
+
+    obj = ispy.ISObject(ispy.IPCPartition(partitionName), 'RunParams.RunParams', 'RunParams')
+    obj.checkout()
+    ### if ( obj.T0_project_tag == 'data15_comm' or obj.T0_project_tag == 'data15_13TeV'):
+    if ( obj.T0_project_tag == 'data15_comm' or obj.T0_project_tag == 'data15_13TeV' or obj.T0_project_tag == 'data15_5TeV' or obj.T0_project_tag == 'data16_comm' or obj.T0_project_tag == 'data16_13TeV' or obj.T0_project_tag == 'data16_5TeV' or obj.T0_project_tag == 'data16_1beam'):
+        #streamName        = 'MinBias'
+        #streamName        = 'Main' # Switching due to missingg Minbias stream -= 13/06/2015 AK
+        try:
+            if RecExOnline.OnlineISConfiguration.GetAtlasReady():
+                print "ATLAS READY, reading express stream"
+                streamName = 'express'
+            else:
+                print "ATLAS NOT READY, reading standby stream"
+                ### streamName = 'standby'
+                ### streamName = 'physics_Standby'
+                streamName = 'Standby'
+        except:
+            streamName = 'express'
+    else:
+        streamName        = 'express:IDCosmic:HLT_IDCosmic:CosmicMuons:MinBias'
+else:
+    streamLogic       = 'Ignore'
+
+#
+# When NOT using ATLAS partition
+#
+if (partitionName != 'ATLAS'):
+    publishName     = 'YJ_test'
+    isserverName    = 'Histogramming'
+
+
+print "GlobalMonitoring : streamName streamLogic= ",streamName,streamLogic
+print "publishName      : ",publishName
+
+
+#import time
+#myfloat = float(publishNumber)
+#tosleep = myfloat*5
+#time.sleep(tosleep)
+
+import commands
+pids=commands.getoutput("/sbin/pidof -o %u python" % os.getpid()).split(" ")
+print "pids",pids
+
+for pid in pids:
+  print "pid",pid
+  #if (False):
+  #if (1):
+  if (0):
+    print "pid = ",pid
+    #thisnumber=commands.getoutput("grep GLOBAL_JOB_NUMBER /proc/%u/fd/1 -m 1 | cut -f2 -d'='" % int(pid))
+    thisname=commands.getoutput("grep TDAQ_APPLICATION_NAME /proc/%u/fd/1 -m 1 | cut -f2 -d'='" % int(pid))
+    print "thisname = ",thisname
+    print "publishName = ",publishName
+    if (thisname == publishName):
+      print "found a match! Will Kill pid = ",pid
+      killreturn = commands.getoutput("kill %u" % int(pid))
+
+
+useAtlantisEmon   = False
+
+### evtMax            = -1
+### evtMax            = 50
+
+if (partitionName == 'ATLAS'):
+    evtMax            = -1
+
+if (partitionName != 'ATLAS'):
+    evtMax            = 40
+
+
+## ------------------------------------------- flags set in: RecExOnline_emonsvc.py (from RecExOnline_jobOptions.py)                    
+
+isGlobalMonitoring = True
+
+## ------------------------------------------- flags set in: RecExOnline_globalconfig.py  (from RecExOnline_jobOptions.py)
+#read the pickle file if you want to use the AMI tag info
+#stored in ami_recotrf.pickle (produced by 'tct_getAmiTag.py f140 ami_recotrf.cmdargs ami_recotrf.pickle') 
+usePickleConfig   = False
+pickleconfigfile  = './ami_recotrf.pickle'
+DataSource        = 'data'
+InputFormat       = 'bytestream'
+fileName          = './0.data'
+#beamType          = 'cosmics'  
+beamType          = 'collisions'  #AK: 21-05-2014
+
+#COND tag and GEO are needed for running over a test partition online
+ConditionsTag     = 'CONDBR2-HLTP-2015-08' # 20160317
+### ConditionsTag     = 'CONDBR2-HLTP-2015-07'   # created 2015-08-10
+### ConditionsTag     = 'CONDBR2-HLTP-2015-05'
+### ConditionsTag     = 'CONDBR2-HLTP-2015-04'
+### ConditionsTag     = 'CONDBR2-HLTP-2015-01'
+### ConditionsTag     = 'CONDBR2-ES1PA-2014-01'  ### new for offline (19.3.0.1)
+
+### DetDescrVersion   = 'ATLAS-R2-2015-01-01-00'
+### DetDescrVersion   = 'ATLAS-R2-2015-02-00-00'  ### new for offline (19.3.0.1)
+DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'  ### new for offline (19.3.0.1)
+
+
+doESD             = True
+writeESD          = False
+doAOD             = False
+writeAOD          = False
+IOVDbSvcMessage   = False
+
+abortonuncheckedstatuscode = False
+
+## ------------------------------------------ flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
+doAllReco   = True
+
+doInDet     = doAllReco
+### doInDet     = False
+
+doMuon      = doAllReco
+###doMuon      = False
+
+doLArg      = doAllReco
+doTile      = doAllReco
+
+doTrigger   = doAllReco
+### doTrigger   = False
+
+doHist      = doAllReco
+doJiveXML   = False
+
+doEgammaTau = doAllReco
+### doEgammaTau = False
+
+#set to True in the JO
+#doCommissioning = False
+
+## ------------------------------------------ flags set in : RecExOnline_monitoring.py (from from RecExOnline_jobOptions.py)
+doAllMon  = True
+
+doCaloMon = doAllMon
+
+doTileMon = doAllMon #AK: new since 09 july 2014 (M4)
+# doTileMon = False
+
+doPhysMon = doAllMon
+
+doTrigMon = doAllMon
+### doTrigMon = False
+
+doIDMon   = doAllMon
+###doIDMon   = False
+
+doTRTMon  = doAllMon
+###doTRTMon  = False
+
+doMuonMon = doAllMon
+### doMuonMon = False
+
+doCTPMon  = False #doAllMon #AK: 25-01-2014
+
+doHIMon   = False # doAllMon
+
+## ------------------------------------------ flags set in : RecExOnline_postconfig.py    (called from RecExOnline_jobOptions.py)
+
+from AthenaCommon.GlobalFlags import globalflags
+globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+
+from AthenaCommon.BFieldFlags import jobproperties
+jobproperties.BField.barrelToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.endcapToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.solenoidOn.set_Value_and_Lock(True)
+###jobproperties.BField.solenoidOn.set_Value_and_Lock(False)
+
+
+from CaloRec.CaloCellFlags import jobproperties
+jobproperties.CaloCellFlags.doLArHVCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)  ####? for trigger, added 11th March, 2015, by CY
+
+
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True)
+InDetFlags.useBroadClusterErrors.set_Value_and_Lock(False)
+
+from AthenaMonitoring.DQMonFlags import DQMonFlags
+DQMonFlags.doStreamAwareMon.set_Value_and_Lock(False)
+DQMonFlags.enableLumiAccess.set_Value_and_Lock(False)
+DQMonFlags.doCTPMon.set_Value_and_Lock(False)         
+DQMonFlags.doLVL1CaloMon.set_Value_and_Lock(False)    
+### DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(False) #xx
+DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(True) #xx
+### DQMonFlags.doJetTagMon.set_Value_and_Lock(False)
+
+from RecExConfig.RecFlags import rec
+rec.doBTagging.set_Value_and_Lock(True)
+
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useBTagging.set_Value_and_Lock(True)
+
+### from JetRec.JetRecFlags import jetFlags
+### jetFlags.useTracks.set_Value_and_Lock(False)
+
+from MuonDQAMonFlags.MuonDQAProperFlags import MuonDQADetFlags
+### MuonDQADetFlags.doMDTTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCMon.set_Value_and_Lock(True)
+
+
+##---------------------------------------ID suggestion from Alex 18.Feb.2015  --------
+jobproperties.InDetJobProperties.doTrackSegmentsSCT.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsPixel.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsTRT.set_Value_and_Lock(False)
+
+
+##---------------------------------------Bunch Spacing 25ns  --------
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.InDet25nsec.set_Value_and_Lock(True)
+
+jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25)
+
+# --------------------------------------------- Monitoring
+### replaced by MuonTrackMonitoring (SMW Jan 23 2016)
+### from AthenaMonitoring.DQMonFlags import DQMonFlags
+### DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(True)
+
+
+### ------------------- inherited from 20.1.0.2 -----------
+#from RecExConfig.RecFlags import rec
+#rec.doJetMissingETTag.set_Value_and_Lock(False)
+
+
+#from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags
+#HLTMonFlags.doBphys=False
+
+
+#jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)
+
+#from LArConditionsCommon.LArCondFlags import larCondFlags
+#larCondFlags.OFCShapeFolder.set_Value_and_Lock("")
+
+## main online reco scripts
+include ("RecExOnline/RecExOnline_jobOptions.py")
diff --git a/Reconstruction/RecExample/RecExOnline/share/RTTAlgmain.py b/Reconstruction/RecExample/RecExOnline/share/RTTAlgmain.py
new file mode 100644
index 000000000000..280bb3cfd9d3
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RTTAlgmain.py
@@ -0,0 +1,91 @@
+import os, sys
+import numpy as np
+import ROOT
+
+sys.path.append(os.path.join(os.path.dirname(__file__),'HistCompare'))
+print(sys.path)
+from RecExOnline.power_of_test import power_of_test
+from RecExOnline.utils import get_array
+import warnings
+warnings.filterwarnings("ignore")
+
+from RecExOnline.setupRTTAlg import *
+#YJ add for athena
+theApp.EvtMax = 1
+#YJ add for html generator (5test & 1 plot)* total his 
+w = 6*len(histnames) 
+h =  7 
+h_th =0
+Matrix = [0 for x in range(w)]  
+from collections import Counter, defaultdict
+#YJ for check time for rel
+
+import datetime
+currenttime=datetime.datetime.now() 
+rel=currenttime.isoweekday()
+print "Time for RTT Alg : %d" %currenttime.hour
+if currenttime.hour>15:
+   rel=rel+1
+if rel==7:
+   rel=0
+print "rel for RTT Alg : %d" %rel
+
+#output format
+header = dict([("Object", max(len(h) for h in histnames)),("Test",max(len(t.split("_")[0]) for t in tests)),("p-value",21)])
+std_line = ["Object","Test","p-value"]
+#check system
+if not os.path.isdir(output_directory):
+    os.makedirs(output_directory)
+files = ROOT.TFile(ref_filename), ROOT.TFile(rtt_filename)
+trees = [file.Get(treename) for treename, file in zip([ref_treename, rtt_treename], files)]
+hist_pairs = [(histname, tuple(tree.Get(histname) for tree in trees)) for histname in histnames]
+
+output_file = ROOT.TFile(os.path.join(output_directory, "power_of_test.root"), "RECREATE")
+output_tree = ROOT.TTree("Tree", "Tree")
+output_tree.SetEntries(size)
+
+#main program
+print std_line[0].ljust(header["Object"]), std_line[1].ljust(header["Test"]), std_line[2].center(header["p-value"])
+print "="*header["Object"], "="*header["Test"], "="*header["p-value"]
+for histname, hist_pair in hist_pairs:
+    output_tree.Branch("/"+histname.replace("/","."))
+    bins = np.intersect1d(*map(lambda hist: [hist.GetBinLowEdge(i) for i in range(1, hist.GetNbinsX()+2)], hist_pair))
+    for hist in hist_pair: hist.SetBins(bins.size-1, bins)
+    data1, data2 = map(get_array, hist_pair)
+    address = np.zeros(1, 'float32')
+    htmalhisname="tot_"+rtt_treename+"_"+histname.replace("/", "_")+".png"
+    Matrix[h_th]=("<img src=\"https://atlas-rtt.cern.ch/prod/rtt/rel_%d/20.11.X.Y.Z-VAL/build/x86_64-slc6-gcc49-opt/AtlasP1MON/RecExOnline/RecExOnline_User_Offline_test_v1/" +htmalhisname+"\" alt=\""+htmalhisname+"\" height=\"250\">") %rel
+    h_th+=1
+    for test, p_arr in power_of_test(data1+data2, data2, tests = tests, rvs_key = {'size' : size, 'freeze' : (False, True), 'entries' : data2.sum()}.copy(), parallel = False).items():
+        branchname = '.'.join([histname.replace('/','.'), test.split('_')[0]])
+        branch = output_tree.Branch(branchname, address, "F")
+        p_arr = np.array(p_arr).round(5)
+        if test == "anderson_ksamp":
+           p_arr[p_arr >= 1.2] = 0.
+        print (histname if std_line[0]!=histname else "").ljust(header["Object"]), (test.split("_")[0] if std_line[1]!=test else "").ljust(header["Test"]), "{:>8} +/- {:<8} (%)".format(round(p_arr.mean()*100,1),round(p_arr.std()*100,2))
+        Testresult= "%s %s:%s +- %s" % (histname,test ,p_arr.mean(),p_arr.std())
+        if test =="ks_2samp" and (p_arr.mean()+p_arr.std()<0.05):
+           Testresult= "<font color=\"red\">%s %s:%s +- %s </font>" % (histname,test ,p_arr.mean(),p_arr.std())
+        Matrix[h_th]= Testresult
+        h_th+=1
+        print "matrix index check : %d "%(h_th)
+        sys.stdout.flush()
+        std_line[:2] = histname, test
+        for p in p_arr:
+            address[0] = p
+            branch.Fill()
+output_file.Write("", 2)
+for f in files: f.Close()
+output_file.Close()
+print(Matrix)
+
+
+
+
+f_html = open('RTTAlg.html', 'w')
+f_html.write("<table> \n")
+for nprint in range(w):
+    f_html.write("<tr> \n")
+    f_html.write("<td>" + Matrix[nprint] + "</td> \n")
+    f_html.write("</tr> \n")
+f_html.write("</table> \n")
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online.py
index fd09cf62e0bf..b39f7ac1383c 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online.py
@@ -5,6 +5,12 @@
 isOnline          = True
 isOnlineStateless = True
 
+## this is used for testing in lxplus
+## isOfflineTest = True  (lxplus)
+## isOfflineTest = False  (P1)
+##
+isOfflineTest     = False
+
 #for the time being, running over file is not possible ONLINE (please see RecExOnline_File_Offline.py) 
 
 useEmon           = True
@@ -19,14 +25,14 @@ keyname           = 'dcm'
 streamName        ='express_express'
 
 useAtlantisEmon   = False
-evtMax            = 500
+evtMax            = 100
 
-## ------------------------------------------- flags set in: RecExOnline_emonsvc.py (from RecExOnline_jobOptions.py)                    
+## ------------------------------------------- flags set in: RecExOnline_emonsvc.py (from RecExOnline_jobOptions.py)
 import os
 partitionName   = os.environ.get("TDAQ_PARTITION", "TestDataProvider_TCT")
 #"TestPartitionGlobalMonitoring" 
 
-publishName     = 'GM_test_19.1.0.1'
+publishName     = 'SMW_GMtestM7_20_2_0_2_1_29may15'
 isserverName    = 'Histogramming'
 
 ## ------------------------------------------- flags set in: RecExOnline_globalconfig.py  (from RecExOnline_jobOptions.py)
@@ -39,9 +45,17 @@ InputFormat       = 'bytestream'
 fileName          = './0.data'
 
 #COND tag and GEO are needed for running over a test partition or against ATLAS cosmics, calib
-ConditionsTag     = 'COMCOND-HLTP-004-03'
-DetDescrVersion   = 'ATLAS-GEO-20-00-01'
-beamType = 'collisions'
+ConditionsTag     = 'CONDBR2-HLTP-2015-08'  ### tag created : 2015-11-04
+### ConditionsTag     = 'CONDBR2-HLTP-2014-00'
+###
+### ConditionsTag     = 'CONDBR2-BLKPA-2014-03'
+### ConditionsTag     = 'CONDBR2-ES1PA-2014-01'  ### new for offline (19.3.0.1)
+
+### DetDescrVersion   = 'ATLAS-R2-2015-01-01-00'
+### DetDescrVersion   = 'ATLAS-R2-2015-02-00-00'
+DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'
+
+beamType = 'cosmics'
 
 doESD             = True
 writeESD          = False
@@ -54,38 +68,128 @@ abortonuncheckedstatuscode = False
 
 ## ------------------------------------------ flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
 doAllReco   = True
+
 doInDet     = doAllReco
-doMuon      = doAllReco #False
+### doInDet     = False
+
+doMuon      = doAllReco
+### doMuon      = False
+
 doLArg      = doAllReco
 doTile      = doAllReco
-doTrigger   = False
+
+doTrigger   = doAllReco
+### doTrigger   = False
+
 doHist      = doAllReco
 doJiveXML   = False
+
 doEgammaTau = doAllReco
+### doEgammaTau = False
 
 #set to True in the JO
 #doCommissioning = False
 
 ## ------------------------------------------ flags set in : RecExOnline_monitoring.py (from from RecExOnline_jobOptions.py)
 doAllMon  = True
+
 doCaloMon = doAllMon
+
 doTileMon = doAllMon #AK: new since 09 july 2014 (M4)
+#doTileMon = False
+
 doPhysMon = doAllMon
-doTrigMon = False
+
+doTrigMon = doAllMon
+### doTrigMon = False
+
 doIDMon   = doAllMon
+###doIDMon   = False
+
 doTRTMon  = doAllMon
-doMuonMon = False #doAllMon
+###doTRTMon  = False
+
+doMuonMon = doAllMon
+###doMuonMon = False
+
+doCTPMon  = False #doAllMon #AK: 25-01-2014
 
 ## ------------------------------------------ flags set in : RecExOnline_postconfig.py    (called from RecExOnline_jobOptions.py)
 
-#### CHANGES TO GET 19.1.0.1 RECO WORKING (M4)
+from AthenaCommon.GlobalFlags import globalflags
+globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+
+from AthenaCommon.BFieldFlags import jobproperties
+jobproperties.BField.barrelToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.endcapToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.solenoidOn.set_Value_and_Lock(True)
+###jobproperties.BField.solenoidOn.set_Value_and_Lock(False)
+
+
+from CaloRec.CaloCellFlags import jobproperties
+jobproperties.CaloCellFlags.doLArHVCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)  ####? for trigger, added 11th March, 2015, by CY
+
+
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True)
+InDetFlags.useBroadClusterErrors.set_Value_and_Lock(False)
+
 from AthenaMonitoring.DQMonFlags import DQMonFlags
-DQMonFlags.doMuonCombinedMon.set_Value_and_Lock(False)
-DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(False)
-#DQMonFlags.doJetTagMon.set_Value_and_Lock(False)
-#DQMonFlags.doCaloMon.set_Value_and_Lock(False)
-#DQMonFlags.doPixelMon.set_Value_and_Lock(False)
+DQMonFlags.doStreamAwareMon.set_Value_and_Lock(False)
+DQMonFlags.enableLumiAccess.set_Value_and_Lock(False)
+DQMonFlags.doCTPMon.set_Value_and_Lock(False)         
+DQMonFlags.doLVL1CaloMon.set_Value_and_Lock(False)
+### DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(False) #xx
+DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(True) #xx
+### DQMonFlags.doJetTagMon.set_Value_and_Lock(False)
+
+from RecExConfig.RecFlags import rec
+rec.doBTagging.set_Value_and_Lock(True)
+
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useBTagging.set_Value_and_Lock(True)
+
+### from JetRec.JetRecFlags import jetFlags
+### jetFlags.useTracks.set_Value_and_Lock(False)
+
+from MuonDQAMonFlags.MuonDQAProperFlags import MuonDQADetFlags
+### MuonDQADetFlags.doMDTTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCMon.set_Value_and_Lock(True)
+
+
+##---------------------------------------ID suggestion from Alex 18.Feb.2015  --------
+jobproperties.InDetJobProperties.doTrackSegmentsSCT.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsPixel.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsTRT.set_Value_and_Lock(False)
+
+##---------------------------------------Bunch Spacing 25ns  --------
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.InDet25nsec.set_Value_and_Lock(True)
+
+jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25)
+
+# --------------------------------------------- Monitoring
+### replaced by MuonTrackMonitoring (SMW Jan 23 2016)
+### from AthenaMonitoring.DQMonFlags import DQMonFlags
+### DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(True)
+
+
+### ------------------- inherited from 20.1.0.2 -----------
+#from RecExConfig.RecFlags import rec
+#rec.doJetMissingETTag.set_Value_and_Lock(False)
+
+
+#from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags
+#HLTMonFlags.doBphys=False
+
+
+#jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)
 
+#from LArConditionsCommon.LArCondFlags import larCondFlags
+#larCondFlags.OFCShapeFolder.set_Value_and_Lock("")
 
 ## main online reco scripts
 include ("RecExOnline/RecExOnline_jobOptions.py")
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_ID.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_ID.py
index 11d82944101c..104b2f97d042 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_ID.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_ID.py
@@ -4,26 +4,140 @@
 ## ------------------------------------------- flags set in: RecExOnline_jobOptions.py  
 isOnline          = True
 isOnlineStateless = True
+isOfflineTest     =False
 
 #for the time being, running over file is not possible ONLINE (please see RecExOnline_File_Offline.py)
 useEmon           = True
-keycount          = 10
+keycount          = 90
 buffersize        = 10
-updateperiod      = 200
+updateperiod      = 100
 timeout           = 240000
 keyname           = 'dcm'
-streamName        = 'L1Calo'
-streamLogic       = 'Ignore'
-
 useAtlantisEmon   = False
 evtMax            = -1
 
+streamName        = 'IDCosmic'
+streamName        = 'MinBias'   # first collisions (05/05/2015 - cgrefe)
+streamType	  = 'physics'
+streamLogic       = 'Or'
+
 ## ------------------------------------------- flags set in: RecExOnline_emonsvc.py (from RecExOnline_jobOptions.py)                    
 import os
 partitionName = os.environ.get("TDAQ_PARTITION", "TestPartitionGlobalMonitoring")
+publishName   = os.environ.get("TDAQ_APPLICATION_NAME", "ID-Test-Application")
+isserverName  = 'Histogramming-CombinedInDet-1-iss'
+
+if(partitionName == "ATLAS"):
+    streamLogic       = 'Or'
+    
+    import RecExOnline.OnlineISConfiguration
+    import ispy
+    from ispy import *
+    from ipc import IPCPartition
+    from ispy import ISObject
+    
+    obj = ispy.ISObject(ispy.IPCPartition(partitionName), 'RunParams.RunParams', 'RunParams')
+    obj.checkout()
+
+    if ( obj.T0_project_tag == 'data16_comm' or obj.T0_project_tag == 'data16_13TeV' or obj.T0_project_tag == 'data16_5TeV' or obj.T0_project_tag == 'data16_hi'):
+        try:
+            if obj.T0_project_tag == 'data15_hi':
+                 from InDetRecExample.InDetJobProperties import InDetFlags
+                 InDetFlags.doHeavyIon.set_Value_and_Lock(True)
+                 InDetFlags.cutLevel = 2
+            if RecExOnline.OnlineISConfiguration.GetAtlasReady():
+                print "ATLAS READY, reading express stream"
+                streamName = 'express:IDMonDummyStream'
+                streamType = 'express'
+                if obj.T0_project_tag == 'data15_hi':
+                    streamName = 'MinBias:IDMonDummyStream'  # intermediate change for HI running
+                    streamType = 'physics'
+                #streamName = 'IDTrack:IDMonDummyStream'
+                #streamType = 'calib'
+            else:
+                print "ATLAS NOT READY, reading standby stream"
+                streamName = 'Standby:IDMonDummyStream'
+        except:
+            print "EXCEPTION"
+            streamName = 'express:IDMonDummyStream'
+    elif obj.T0_project_tag == 'data16_1beam':
+        streamName = 'express'
+    else:
+        streamName        = 'express:IDCosmic:HLT_IDCosmic:MinBias:IDMonDummyStream'
+
+else:
+    streamLogic       = 'Ignore'
+
+if ( publishName == "ID-AthenaMon-Noise" ):
+    publishName       = "ID_PT_Noise"
+    streamType        = 'monitoring'
+    streamName        = 'IDMonitoring'
+    streamLogic       = 'Or'# This should be taken out when we have a proper IDMonitoring stream
+    dispersion        = False
+    lvl1Logic         = 'Or' if partitionName == "ATLAS" else 'Ignore' # cgrefe 08.09.15: see if the Or works in beam 
+    lvl1Name          = 'L1_RD0_EMPTY'
+    doIdGlobalErrorMon = True
+elif ( publishName == "ID-AthenaMon-PixelDetails" ):
+    doPixelOnlyMon    = True
+    publishName       = 'CombinedInDet_PixelDetails'
+    from InDetRecExample.InDetJobProperties import InDetFlags
+    InDetFlags.doTRTStandalone.set_Value_and_Lock(False)
+    InDetFlags.doTrackSegmentsSCT.set_Value_and_Lock(False)
+    InDetFlags.doTrackSegmentsTRT.set_Value_and_Lock(False)
+    InDetFlags.doBackTracking.set_Value_and_Lock(False)
+elif ( publishName == "ID-AthenaMon-PixelDetails-Test" ):
+    doPixelOnlyMon    = True
+    publishName       = 'CombinedInDet_PixelDetails'
+    from InDetRecExample.InDetJobProperties import InDetFlags
+    InDetFlags.doTRTStandalone.set_Value_and_Lock(False)
+    InDetFlags.doTrackSegmentsSCT.set_Value_and_Lock(False)
+    InDetFlags.doTrackSegmentsTRT.set_Value_and_Lock(False)
+    InDetFlags.doBackTracking.set_Value_and_Lock(False)
+    streamLogic       = 'Ignore'
+elif ( publishName == "ID-AthenaMon-NCB" ):
+    #Ensure we reconstruct only 01X hits in the SCT!
+    from InDetRecExample.InDetJobProperties import InDetFlags
+    InDetFlags.InDet25nsec.set_Value_and_Lock(True)
+    keyname           = 'dcm'
+    keycount          = 255      # increasing dcm to increase statistics
+    streamLogic       = 'Or'
+    streamType        = 'physics'
+    streamName        = 'Background'
+    lvl1Logic         = 'Or'
+    lvl1Name          = 'L1_BCM_AC_UNPAIRED_ISO:L1_BCM_AC_UNPAIRED_NONISO:L1_BCM_CA_UNPAIRED_ISO:L1_BCM_CA_UNPAIRED_NONISO:L1_J12_UNPAIRED_ISO:L1_J12_UNPAIRED_NONISO'
+    doIdNCBMon        = True
+elif ( publishName == "ID-Test-Application" ):
+    ##keyname='CompleteEvent'
+    #streamLogic       = 'Or'
+    isserverName  = 'Histogramming'
+    streamType = 'express'
+    streamName = 'express'
+
+# --- Trigger selection for TRT beam monitoring
+elif ( publishName == 'ID-AthenaMon-TRTBeam' ):
+    keyname      = 'dcm'
+    keycount     = 255           # there are only around 100 SFIs - connect to all of them
+    dispersion   = False         # process the same events as other monitoring jobs with the same event selection
+    streamType   = 'monitoring'
+    streamLogic  = 'Or'
+    streamName   = 'IDMonitoring'# avoid PixelNoise and SCTNoise, because those streams contain mostly partial events without TRT data
+    lvl1Logic    = 'Or'
+    lvl1Name     = 'L1_RD0_FILLED'
+    doTRTBeamMon = True          # use the special monitoring tool InDetMonitoringTRT_Beam.py in InDetMonitoring.py
+    doESD        = False         # switch off any reconstruction to gain some speed, we only need raw data here
+
+elif ( publishName == 'ID-AthenaMon-TRTBeam-Test' ):
+    keyname      = 'dcm'
+    keycount     = 255           # there are only around 100 SFIs - connect to all of them
+    dispersion   = False         # process the same events as other monitoring jobs with the same event selection
+    streamType   = 'monitoring'
+    streamLogic  = 'Or'
+    streamName   = 'IDMonitoring'# avoid PixelNoise and SCTNoise, because those streams contain mostly partial events without TRT data
+    lvl1Logic    = 'Or'
+    lvl1Name     = 'L1_RD0_FILLED'
+    doTRTBeamMon = True          # use the special monitoring tool InDetMonitoringTRT_Beam.py in InDetMonitoring.py
+    doESD        = False         # switch off any reconstruction to gain some speed, we only need raw data here
 
-publishName     = 'CombinedInDet_rel19'
-isserverName    = 'Histogramming-CombinedInDet-1-iss'
 
 ## ------------------------------------------- flags set in: RecExOnline_globalconfig.py  (from RecExOnline_jobOptions.py)
 #read the pickle file if you want to use the AMI tag info
@@ -32,12 +146,11 @@ usePickleConfig   = False
 pickleconfigfile  = './ami_recotrf.pickle'
 DataSource        = 'data'
 InputFormat       = 'bytestream'
-#fileName         = './0.data'
 
 #COND tag and GEO are needed for running over a test partition or against ATLAS cosmics, calib
-ConditionsTag     = 'COMCOND-HLTP-004-03'
-DetDescrVersion   = 'ATLAS-GEO-20-00-01'
-beamType = 'collisions'
+#ConditionsTag     = 'CONDBR2-HLTP-2015-08'
+#DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'  ### new for offline (19.3.0.1)
+#beamType          = 'cosmics'
 
 doESD             = True
 writeESD          = False
@@ -50,9 +163,9 @@ abortonuncheckedstatuscode = False
 ## ------------------------------------------ flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
 doAllReco   = False
 doInDet     = True
-doMuon      = doAllReco
-doLArg      = doAllReco
-doTile      = doAllReco
+doMuon      = False
+doLArg      = False
+doTile      = False
 doTrigger   = False
 doHist      = doAllReco
 doJiveXML   = False
@@ -66,16 +179,41 @@ doAllMon  = False
 doCaloMon = doAllMon
 doPhysMon = doAllMon
 doTrigMon = False
-doIDMon   = True
+doIDMon   = True   # cgrefe: disabled for now until pixel monitoing is fixed (19.08.2015)
+doSCTMon  = True
 doTRTMon  = True
 doMuonMon = doAllMon
 
+# TRT beam monitoring uses no event reconstruction - switch of all other ID monitoring
+if ('doTRTBeamMon' in dir() and doTRTBeamMon):
+    doIDMon   = False
+    doSCTMon  = False
+    doTRTMon  = True  # this needs to be true in order to initialize the ID monitoring config. Will not run the TRT_Monitoring tool
+
 ## ------------------------------------------ flags set in : RecExOnline_postconfig.py    (called from RecExOnline_jobOptions.py)
+from AthenaCommon.GlobalFlags import globalflags
+globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
 
-# Print out InDet
 from InDetRecExample.InDetJobProperties import InDetFlags
+#InDetFlags.doIBL.set_Value_and_Lock(True)
+InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True)
 InDetFlags.doPrintConfigurables.set_Value_and_Lock(True)
-InDetFlags.doTrackSegmentsPixel.set_Value_and_Lock(True)
+
+if ( publishName != "ID-AthenaMon-PixelDetails" ):
+    InDetFlags.doTrackSegmentsPixel.set_Value_and_Lock(False)
+    InDetFlags.doTrackSegmentsSCT.set_Value_and_Lock(False)
+    InDetFlags.doTrackSegmentsTRT.set_Value_and_Lock(False)
+
+from JetRec.JetRecFlags import jetFlags
+jetFlags.Enabled = False
+
+from InDetRecExample.InDetJobProperties import InDetFlags                                                                               
+InDetFlags.InDet25nsec.set_Value_and_Lock(True)                                                                                         
+
+#jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25)                                                                                  
+
+from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
+TrkDetFlags.TRT_BuildStrawLayers.set_Value(True) # needed for proper efficiency determination during online monitoring
 
 ## main online reco scripts
 include ("RecExOnline/RecExOnline_jobOptions.py")
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo.py
index 0a476f65f858..1b7c7517bee1 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo.py
@@ -23,7 +23,7 @@ import os
 partitionName = os.getenv("TDAQ_PARTITION","ATLAS")
 
 # set name of this publisher as it will appear in IS
-publishName       = "l1calo-athenaPT"
+publishName       = "l1calo-athenaHLT"
 
 # name of the stream type (physics,express, etc.)
 streamType = os.getenv("L1CALO_PTIO_STREAM_TYPE","physics")
@@ -31,8 +31,8 @@ streamType = os.getenv("L1CALO_PTIO_STREAM_TYPE","physics")
 # name of the stream (Egamma,JetTauEtmiss,MinBias,Standby, etc.)
 # this can be a colon(:) separated list of streams that use
 # the 'streamLogic' to combine
-# stream for 2011 HI run: HardProbes
-streamName = os.getenv("L1CALO_PTIO_STREAM_NAME","Egamma:JetTauEtmiss:MinBias:Muons:HardProbes")
+# stream for 2016 HI run
+streamName = os.getenv("L1CALO_PTIO_STREAM_NAME","L1Calo:Main:MinBias:MinBiasOverlay:UPC:EnhancedBias:ZeroBias:HardProbes:Standby:ALFACalib")
 
 # logic used to combine multiple streams
 # can be set to 'Ignore' which means the stream selection isn't used
@@ -53,7 +53,7 @@ if ( not os.environ.get("L1CALO_PTIO_KEY") ):
   if( partitionName == "L1CaloStandalone" ):
     keyname = 'REB'
   else:
-    keyname = 'SFI'
+    keyname = 'dcm' #'SFI'
 else:
   keyname = os.environ.get("L1CALO_PTIO_KEY")
 
@@ -76,7 +76,9 @@ isserverName    = 'Histogramming'
 isGlobalMonitoring = False
 
 
-
+#from IOVDbSvc.CondDB import conddb
+#conddb.setGlobalTag("CONDBR2-HLTP-2014-00")
+#conddb.setGlobalTag("CONDBR2-ES1PA-2014-00") #crash
 
 
 ############
@@ -94,13 +96,28 @@ isGlobalMonitoring = False
 #doAOD             = False
 #writeAOD          = False
 isOnlineStateless = True
-beamType = 'collisions' # default: 'cosmics'
+#beamType = 'collisions' #'collisions' # default: 'cosmics'
 #is_T0_project_tag = 'cos010'
+#is_T0_project_tag = "data_test"
+#is_T0_project_tag = "data14_cos"
+#is_T0_project_tag = "data15_13TeV"
 
 #COND tag and GEO are needed for running over a test partition or against ATLAS cosmics, calib
 #ConditionsTag     = 'COMCOND-HLTP-004-01'
 #DetDescrVersion   = 'ATLAS-GEO-20-00-01'
 
+from AthenaCommon.GlobalFlags import globalflags
+#globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-ES1PA-2014-00")
+#globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-HLTP-2015-05")
+#--->>>######globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-HLTP-2015-08")
+#globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-HLTP-2016-01")
+#globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+##ConditionsTag = 'CONDBR2-ES1PA-2014-00'
+##DetDescrVersion = 'ATLAS-R2-2015-01-01-00' 
+#DetDescrVersion = 'ATLAS-R2-2015-03-01-00' 
+#--->>>######DetDescrVersion = 'ATLAS-R2-2015-03-01-00'
+#DetDescrVersion = 'ATLAS-R2-2016-00-01-00'
+
 #doPixelOnlyMon   = False
 
 # unlimit max number of events
@@ -119,14 +136,36 @@ doAllReco   = False
 #doJiveXML   = False
 #doEgammaTau = doAllReco
 
+###########
+## -- flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
+#doAllReco   = True
+# following set to default values from JOs
+#doInDet     = False
+#doMuon      = True
+#doLArg      = doAllReco
+#doTile      = doAllReco
+#doLucid     = False
+#doHist      = False
+#doJiveXML   = False
+#doEgammaTau = False
+#doLArg      = False
+#doTile      = False
+
+
 #doCommissioning = False
 #abortonuncheckedstatuscode = False
 
 # Found that this must be true for REB runs but not for SFI
 if (partitionName == "L1CaloStandalone"):
-   doTrigger = True #Default: False
+   doTrigger = False #True #Default: False
 else:
    doTrigger = False
+   #doTrigger = True
+   #doTriggerConfigOnly=True
+   #TriggerModernConfig=True
+   #from TriggerJobOpts.TriggerFlags import TriggerFlags
+   #TriggerFlags.doTriggerConfigOnly=True
+   
 
 
 ################
@@ -139,23 +178,31 @@ doAllMon  = False
 #doIDMon   = doAllMon
 #doPixelOnlyMon = False
 #doSCTMon  = doAllMon
-#doMuonMon = doAllMon
+#doMuonMon = True
 #doTRTMon  = doAllMon
 #doTrigMon = doAllMon
 doLVL1CaloMon = True
 #doHLTMon  = doTrigMon
-#doCTPMon  = doTrigMon
+#doCTPMon  = doAllMon
+#doCTPMon = True
 #doLucidMon= doAllMon
 isOnline  = True
 
+rec.doInDet.set_Value_and_Lock(False)
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useTracks.set_Value_and_Lock(False)
+jetFlags.usePFlow.set_Value_and_Lock(False)
+jetFlags.useMuonSegments.set_Value_and_Lock(False)
 
 
+#rec.doMuon.set_Value_and_Lock(False)
 
 
 ## main online reco scripts
 include ("RecExOnline/RecExOnline_jobOptions.py")
 
 
+
 print ' '
 print '-------------------------------------------------------------'
 print '|     RecExOnline_globalconfig settings'
@@ -221,24 +268,191 @@ print '| isserverName       = ',isserverName
 print '| isGlobalMonitoring = ',isGlobalMonitoring
 print '--------------------------------------------------------------'
 
-
-
+#from AthenaCommon.AppMgr import ServiceMgr
+#from TrigT1CaloCondSvc.TrigT1CaloCondSvcConf import L1CaloCondSvc
+#ServiceMgr += L1CaloCondSvc()
+#from IOVDbSvc.CondDB import conddb
+#L1CaloFolderList = []
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Calibration/PprChanCalib"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Conditions/DisabledTowers"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults"]
+#for l1calofolder in L1CaloFolderList:
+#  conddb.addFolderWithTag("TRIGGER", l1calofolder, "HEAD")
+
+#L1CaloDb=""
+#if not 'L1CaloDbConnection' in dir():
+#    if 'L1CaloSqliteDB' in dir():
+#        L1CaloDbConnection="<dbConnection>sqlite://;schema=" + L1CaloSqliteDB + ";dbname=L1CALO</dbConnection>"
+#    else:
+#        L1CaloDb="TRIGGER"
+#        L1CaloDbConnection=""
+
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+##conddb.blockFolder("/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+#conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Conditions/DisabledTowers")
+
+
+
+#L1CaloDbTag = "<tag>HEAD</tag>"
+#
+#L1CaloFolderList = []
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Conditions/DisabledTowers"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults"]
+
+#for l1calofolder in L1CaloFolderList:
+#    if not conddb.folderRequested(l1calofolder):
+#        conddb.addFolder(L1CaloDb, L1CaloDbConnection + l1calofolder + L1CaloDbTag)
+
+
+#from IOVDbSvc.CondDB import conddb
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+##conddb.blockFolder("/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+##conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults")
+##conddb.blockFolder("/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Conditions/DisabledTowers")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels<tag>HEAD</tag>")
+##conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/Receivers/Factors/CalibGains<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Conditions/DisabledTowers<tag>HEAD</tag>")
+#
+#from IOVDbSvc.CondDB import conddb
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+#conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Conditions/DisabledTowers")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/Receivers/Factors/CalibGains<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Conditions/DisabledTowers<tag>HEAD</tag>")
+#
+#conddb.addOverride('/GLOBAL/TrackingGeo/LayerMaterialV2','AtlasLayerMat_v19s0_ATLAS-R2-2015-02')
+
+#--->>>######conddb.addOverride('/GLOBAL/TrackingGeo/LayerMaterialV2','AtlasLayerMat_v19s0_ATLAS-R2-2015-03')
+
+#from IOVDbSvc.CondDB import conddb
+#conddb.addFolder("TRIGGER","/TRIGGER/HLT/Menu <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/HLT/HltConfigKeys <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Lvl1ConfigKey <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Menu <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Prescales <tag>HEAD</tag>")
+
+
+
+#theApp.CreateSvc  += ["StoreGateSvc/StoreGateSvc" ]
+#ByteStreamAddressProviderSvc = Service( "ByteStreamAddressProviderSvc" )
+#ByteStreamAddressProviderSvc.TypeNames += ["/Run/L1TopoToCTPLocation"]
+#ProxyProviderSvc = Service( "ProxyProviderSvc" )
+#ProxyProviderSvc.ProviderNames += [ "ByteStreamAddressProviderSvc" ]
+#svcMgr.ProxyProviderSvc.ProviderNames += [ "/Run/L1TopoToCTPLocation" ]
 
 
 # added for testing purposes
 # need to for the run number in the test data partitions
-if (partitionName.find("L1CaloStandalone") >= 0) or (partitionName.find("Test_dataProvider") >= 0) :
-   print "L1Calo Monitoring is overriding the run number and lumiblock number."
-   svcMgr.IOVDbSvc.forceRunNumber=182519
-   svcMgr.IOVDbSvc.forceLumiblockNumber=1
-   print "L1Calo Monitoring set run to ",svcMgr.IOVDbSvc.forceRunNumber,"and lumi block to",svcMgr.IOVDbSvc.forceLumiblockNumber
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
-tf.configForStartup = "HLTonline"
-from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
-cfg = TriggerConfigGetter()
-if rec.doLArg and rec.doTile:
-  from AthenaCommon.AlgSequence import AlgSequence
-  TTjob = AlgSequence()
-  TTjob.TriggerTowerMaker.LVL1ConfigSvc = "Trig::TrigConfigSvc/TrigConfigSvc"
-   
+# fix for missing folder /TRIGGER/LUMI/LBLESTONL
+#if (partitionName.find("L1CaloStandalone") >= 0) or (partitionName.find("Test_dataProvider") >= 0) :
+
+if (partitionName.find("L1CaloStandalone") >= 0) or (partitionName.find("ATLAS") >= 0) :
+#if (partitionName.find("L1CaloStandalone") >= 0) :
+  print "L1Calo Monitoring is overriding the run number and lumiblock number."
+  import ispy   ## this should retrieve the run number automatically as done in RecExOnline_globalconfig.py
+  from ispy import *
+  from ipc import IPCPartition
+  from ispy import ISObject
+  p2  = ispy.IPCPartition(partitionName)
+  obj = ispy.ISObject(p2, 'RunParams.RunParams', 'RunParams')
+  obj.checkout()
+  is_run_number = obj.run_number
+  svcMgr.IOVDbSvc.forceRunNumber = is_run_number
+  #svcMgr.IOVDbSvc.forceRunNumber=313285 #313063 #312649(HI) #312424(HI) #309640 #271733 #182519 #238735
+  svcMgr.IOVDbSvc.forceLumiblockNumber=1
+  print "L1Calo Monitoring set run to ",svcMgr.IOVDbSvc.forceRunNumber,"and lumi block to",svcMgr.IOVDbSvc.forceLumiblockNumber
+
+  #from IOVDbSvc.CondDB import conddb
+  #conddb.addFolder("TRIGGER","/TRIGGER/HLT/Menu <tag>HEAD</tag>") 
+  #conddb.addFolder("TRIGGER","/TRIGGER/HLT/HltConfigKeys <tag>HEAD</tag>")
+  #conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Lvl1ConfigKey <tag>HEAD</tag>")
+  #conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Menu <tag>HEAD</tag>")
+  #conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Prescales <tag>HEAD</tag>")
+
+
+  from IOVDbSvc.CondDB import conddb
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/HLT/Menu<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/HLT/HltConfigKeys<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/HLT/Prescales<tag>HEAD</tag>")
+
+  conddb.addFolder("", "<db>oracle://ATONR_COOL;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2</dbConnection>/TRIGGER/HLT/PrescaleKey<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>oracle://ATONR_COOL;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2</dbConnection>/TRIGGER/HLT/Groups<tag>HEAD</tag>")
+
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Lvl1ConfigKey<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Menu<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/ItemDef<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/BunchGroupKey<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/BunchGroupDescription<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/BunchGroupContent<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Prescales<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Thresholds<tag>HEAD</tag>")
+
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/CTPCoreInputMapping<tag>HEAD</tag>")
+
+
+
+  # only offline
+  from RecExConfig.InputFilePeeker import inputFileSummary
+  print "inputFileSummary =",inputFileSummary
+  if inputFileSummary.__contains__('bs_metadata'):
+    # get the run number and lumi_block for the input
+    run_number = inputFileSummary['bs_metadata']['run_number']
+
+    pointintime = (int(run_number)<<32) + int(lumi_block) # start from lumiblock 0 (or 1?)
+
+    DBInstance = svcMgr.IOVDbSvc.properties()['DBInstance']
+    print "L1Calo Monitoring check DBInstance ",DBInstance
+    connstring = "COOLONL_TRIGGER/"+str(DBInstance) 
+    from CoolConvUtilities.AtlCoolLib import indirectOpen
+    coolDB=indirectOpen(connstring,oracle='True')
+    SMKfolder=coolDB.getFolder('/TRIGGER/HLT/HltConfigKeys')
+
+    retrieved_obj=SMKfolder.findObject(pointintime,0)
+    retrieved_payload=retrieved_obj.payload()
+    retrieved_format=retrieved_payload['MasterConfigurationKey']
+    SuperMasterKey=int(999)
+    print "SMK SuperMasterKey default =",SuperMasterKey
+    SuperMasterKey = int(retrieved_format)                                 
+    print "SMK SuperMasterKey from Cool =",SuperMasterKey
+    coolDB.closeDatabase()
+
+   #from IOVDbSvc.CondDB import conddb
+   #conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+   #conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+   #conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+   #conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib<tag>HEAD</tag>")
+   #conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels<tag>HEAD</tag>")
+   #conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/Receivers/Factors/CalibGains<tag>HEAD</tag>")
+
+
+#from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
+#tf.configForStartup = "HLTonline"
+#from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
+#cfg = TriggerConfigGetter()
+#if rec.doLArg and rec.doTile:
+#  from AthenaCommon.AlgSequence import AlgSequence
+#  TTjob = AlgSequence()
+#  TTjob.TriggerTowerMaker.LVL1ConfigSvc = "Trig::TrigConfigSvc/TrigConfigSvc"
+ 
+#M6
+#rec.doTau=False;
+#rec.doEgamma=False;
+#rec.doJetMissingETTag=False;
+#from CaloRec.CaloCellFlags import jobproperties
+#jobproperties.CaloCellFlags.doLArHVCorr=False
+#jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False);  
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo_Cosmics.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo_Cosmics.py
index 2625393dcb22..0abbb60111a2 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo_Cosmics.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo_Cosmics.py
@@ -23,7 +23,7 @@ import os
 partitionName = os.getenv("TDAQ_PARTITION","ATLAS")
 
 # set name of this publisher as it will appear in IS
-publishName       = "l1calo-athenaPT-cosmics"
+publishName       = "l1calo-athenaHLT-cosmics"
 
 # name of the stream type (physics,express, etc.)
 streamType = os.getenv("L1CALO_PTIO_STREAM_TYPE","physics")
@@ -31,7 +31,7 @@ streamType = os.getenv("L1CALO_PTIO_STREAM_TYPE","physics")
 # name of the stream (Egamma,JetTauEtmiss,MinBias,Standby, etc.)
 # this can be a colon(:) separated list of streams that use
 # the 'streamLogic' to combine
-streamName = os.getenv("L1CALO_PTIO_STREAM_NAME","CosmicCalo")
+streamName = os.getenv("L1CALO_PTIO_STREAM_NAME","CosmicCalo:Standby")
 
 # logic used to combine multiple streams
 # can be set to 'Ignore' which means the stream selection isn't used
@@ -52,11 +52,11 @@ if ( not os.environ.get("L1CALO_PTIO_KEY") ):
   if( partitionName == "L1CaloStandalone" ):
     keyname = 'REB'
   else:
-    keyname = 'SFI'
+    keyname = 'dcm' #'SFI'
 else:
   keyname = os.environ.get("L1CALO_PTIO_KEY")
 
-# set the Sampler count (default is 25)
+# set the Sampler count (default is 15)
 keycount = int(os.environ.get("L1CALO_PTIO_KEY_COUNT","25"))
 
 # event buffer size for each sampler
@@ -75,7 +75,9 @@ isserverName    = 'Histogramming'
 isGlobalMonitoring = False
 
 
-
+#from IOVDbSvc.CondDB import conddb
+#conddb.setGlobalTag("CONDBR2-HLTP-2014-00")
+#conddb.setGlobalTag("CONDBR2-ES1PA-2014-00") #crash
 
 
 ############
@@ -93,13 +95,28 @@ isGlobalMonitoring = False
 #doAOD             = False
 #writeAOD          = False
 isOnlineStateless = True
-beamType = 'collisions' # default: 'cosmics'
+#beamType = 'collisions' #'collisions' # default: 'cosmics'
 #is_T0_project_tag = 'cos010'
+#is_T0_project_tag = "data_test"
+#is_T0_project_tag = "data14_cos"
+#is_T0_project_tag = "data15_13TeV"
 
 #COND tag and GEO are needed for running over a test partition or against ATLAS cosmics, calib
 #ConditionsTag     = 'COMCOND-HLTP-004-01'
 #DetDescrVersion   = 'ATLAS-GEO-20-00-01'
 
+from AthenaCommon.GlobalFlags import globalflags
+#globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-ES1PA-2014-00")
+#globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-HLTP-2015-05")
+#--->>>######globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-HLTP-2015-08")
+#globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-HLTP-2016-01")
+#globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+##ConditionsTag = 'CONDBR2-ES1PA-2014-00'
+##DetDescrVersion = 'ATLAS-R2-2015-01-01-00' 
+#DetDescrVersion = 'ATLAS-R2-2015-03-01-00' 
+#--->>>######DetDescrVersion = 'ATLAS-R2-2015-03-01-00'
+#DetDescrVersion = 'ATLAS-R2-2016-00-01-00'
+
 #doPixelOnlyMon   = False
 
 # unlimit max number of events
@@ -118,14 +135,36 @@ doAllReco   = False
 #doJiveXML   = False
 #doEgammaTau = doAllReco
 
+###########
+## -- flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
+#doAllReco   = True
+# following set to default values from JOs
+#doInDet     = False
+#doMuon      = True
+#doLArg      = doAllReco
+#doTile      = doAllReco
+#doLucid     = False
+#doHist      = False
+#doJiveXML   = False
+#doEgammaTau = False
+#doLArg      = False
+#doTile      = False
+
+
 #doCommissioning = False
 #abortonuncheckedstatuscode = False
 
 # Found that this must be true for REB runs but not for SFI
 if (partitionName == "L1CaloStandalone"):
-   doTrigger = True #Default: False
+   doTrigger = False #True #Default: False
 else:
    doTrigger = False
+   #doTrigger = True
+   #doTriggerConfigOnly=True
+   #TriggerModernConfig=True
+   #from TriggerJobOpts.TriggerFlags import TriggerFlags
+   #TriggerFlags.doTriggerConfigOnly=True
+   
 
 
 ################
@@ -138,23 +177,31 @@ doAllMon  = False
 #doIDMon   = doAllMon
 #doPixelOnlyMon = False
 #doSCTMon  = doAllMon
-#doMuonMon = doAllMon
+#doMuonMon = True
 #doTRTMon  = doAllMon
 #doTrigMon = doAllMon
 doLVL1CaloMon = True
 #doHLTMon  = doTrigMon
-#doCTPMon  = doTrigMon
+#doCTPMon  = doAllMon
+#doCTPMon = True
 #doLucidMon= doAllMon
 isOnline  = True
 
+rec.doInDet.set_Value_and_Lock(False)
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useTracks.set_Value_and_Lock(False)
+jetFlags.usePFlow.set_Value_and_Lock(False)
+jetFlags.useMuonSegments.set_Value_and_Lock(False)
 
 
+#rec.doMuon.set_Value_and_Lock(False)
 
 
 ## main online reco scripts
 include ("RecExOnline/RecExOnline_jobOptions.py")
 
 
+
 print ' '
 print '-------------------------------------------------------------'
 print '|     RecExOnline_globalconfig settings'
@@ -220,25 +267,182 @@ print '| isserverName       = ',isserverName
 print '| isGlobalMonitoring = ',isGlobalMonitoring
 print '--------------------------------------------------------------'
 
-
-
+#from AthenaCommon.AppMgr import ServiceMgr
+#from TrigT1CaloCondSvc.TrigT1CaloCondSvcConf import L1CaloCondSvc
+#ServiceMgr += L1CaloCondSvc()
+#from IOVDbSvc.CondDB import conddb
+#L1CaloFolderList = []
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Calibration/PprChanCalib"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Conditions/DisabledTowers"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults"]
+#for l1calofolder in L1CaloFolderList:
+#  conddb.addFolderWithTag("TRIGGER", l1calofolder, "HEAD")
+
+#L1CaloDb=""
+#if not 'L1CaloDbConnection' in dir():
+#    if 'L1CaloSqliteDB' in dir():
+#        L1CaloDbConnection="<dbConnection>sqlite://;schema=" + L1CaloSqliteDB + ";dbname=L1CALO</dbConnection>"
+#    else:
+#        L1CaloDb="TRIGGER"
+#        L1CaloDbConnection=""
+
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+##conddb.blockFolder("/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+#conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Conditions/DisabledTowers")
+
+
+
+#L1CaloDbTag = "<tag>HEAD</tag>"
+#
+#L1CaloFolderList = []
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Conditions/DisabledTowers"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults"]
+
+#for l1calofolder in L1CaloFolderList:
+#    if not conddb.folderRequested(l1calofolder):
+#        conddb.addFolder(L1CaloDb, L1CaloDbConnection + l1calofolder + L1CaloDbTag)
+
+
+#from IOVDbSvc.CondDB import conddb
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+##conddb.blockFolder("/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+##conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults")
+##conddb.blockFolder("/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Conditions/DisabledTowers")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels<tag>HEAD</tag>")
+##conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/Receivers/Factors/CalibGains<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Conditions/DisabledTowers<tag>HEAD</tag>")
+#
+#from IOVDbSvc.CondDB import conddb
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+#conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Conditions/DisabledTowers")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/Receivers/Factors/CalibGains<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Conditions/DisabledTowers<tag>HEAD</tag>")
+#
+#conddb.addOverride('/GLOBAL/TrackingGeo/LayerMaterialV2','AtlasLayerMat_v19s0_ATLAS-R2-2015-02')
+
+#--->>>######conddb.addOverride('/GLOBAL/TrackingGeo/LayerMaterialV2','AtlasLayerMat_v19s0_ATLAS-R2-2015-03')
+
+#from IOVDbSvc.CondDB import conddb
+#conddb.addFolder("TRIGGER","/TRIGGER/HLT/Menu <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/HLT/HltConfigKeys <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Lvl1ConfigKey <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Menu <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Prescales <tag>HEAD</tag>")
+
+
+
+#theApp.CreateSvc  += ["StoreGateSvc/StoreGateSvc" ]
+#ByteStreamAddressProviderSvc = Service( "ByteStreamAddressProviderSvc" )
+#ByteStreamAddressProviderSvc.TypeNames += ["/Run/L1TopoToCTPLocation"]
+#ProxyProviderSvc = Service( "ProxyProviderSvc" )
+#ProxyProviderSvc.ProviderNames += [ "ByteStreamAddressProviderSvc" ]
+#svcMgr.ProxyProviderSvc.ProviderNames += [ "/Run/L1TopoToCTPLocation" ]
 
 
 # added for testing purposes
 # need to for the run number in the test data partitions
+# fix for missing folder /TRIGGER/LUMI/LBLESTONL
 #if (partitionName.find("L1CaloStandalone") >= 0) or (partitionName.find("Test_dataProvider") >= 0) :
-#   print "L1Calo Monitoring is overriding the run number and lumiblock number."
-#   svcMgr.IOVDbSvc.forceRunNumber=182519
-#   svcMgr.IOVDbSvc.forceLumiblockNumber=1
-#   print "L1Calo Monitoring set run to ",svcMgr.IOVDbSvc.forceRunNumber,"and lumi block to",svcMgr.IOVDbSvc.forceLumiblockNumber
-
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
-tf.configForStartup = "HLTonline"
-from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
-cfg = TriggerConfigGetter()
-if rec.doLArg and rec.doTile:
-  from AthenaCommon.AlgSequence import AlgSequence
-  TTjob = AlgSequence()
-  TTjob.TriggerTowerMaker.LVL1ConfigSvc = "Trig::TrigConfigSvc/TrigConfigSvc"
-   
+
+if (partitionName.find("L1CaloStandalone") >= 0) or (partitionName.find("ATLAS") >= 0) :
+#if (partitionName.find("L1CaloStandalone") >= 0) :
+  print "L1Calo Monitoring is overriding the run number and lumiblock number."
+  svcMgr.IOVDbSvc.forceRunNumber=313285 #312649 #312424(HI) #309640 #271733 #182519 #238735
+  svcMgr.IOVDbSvc.forceLumiblockNumber=1
+  print "L1Calo Monitoring set run to ",svcMgr.IOVDbSvc.forceRunNumber,"and lumi block to",svcMgr.IOVDbSvc.forceLumiblockNumber
+
+  #from IOVDbSvc.CondDB import conddb
+  #conddb.addFolder("TRIGGER","/TRIGGER/HLT/Menu <tag>HEAD</tag>") 
+  #conddb.addFolder("TRIGGER","/TRIGGER/HLT/HltConfigKeys <tag>HEAD</tag>")
+  #conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Lvl1ConfigKey <tag>HEAD</tag>")
+  #conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Menu <tag>HEAD</tag>")
+  #conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Prescales <tag>HEAD</tag>")
+
+
+  from IOVDbSvc.CondDB import conddb
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/HLT/Menu<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/HLT/HltConfigKeys<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/HLT/Prescales<tag>HEAD</tag>")
+
+  conddb.addFolder("", "<db>oracle://ATONR_COOL;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2</dbConnection>/TRIGGER/HLT/PrescaleKey<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>oracle://ATONR_COOL;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2</dbConnection>/TRIGGER/HLT/Groups<tag>HEAD</tag>")
+
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Lvl1ConfigKey<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Menu<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/ItemDef<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/BunchGroupKey<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/BunchGroupDescription<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/BunchGroupContent<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Prescales<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Thresholds<tag>HEAD</tag>")
+
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/CTPCoreInputMapping<tag>HEAD</tag>")
+
+
+
+  # only offline
+  from RecExConfig.InputFilePeeker import inputFileSummary
+  print "inputFileSummary =",inputFileSummary
+  if inputFileSummary.__contains__('bs_metadata'):
+    # get the run number and lumi_block for the input
+    run_number = inputFileSummary['bs_metadata']['run_number']
+
+    pointintime = (int(run_number)<<32) + int(lumi_block) # start from lumiblock 0 (or 1?)
+
+    DBInstance = svcMgr.IOVDbSvc.properties()['DBInstance']
+    print "L1Calo Monitoring check DBInstance ",DBInstance
+    connstring = "COOLONL_TRIGGER/"+str(DBInstance) 
+    from CoolConvUtilities.AtlCoolLib import indirectOpen
+    coolDB=indirectOpen(connstring,oracle='True')
+    SMKfolder=coolDB.getFolder('/TRIGGER/HLT/HltConfigKeys')
+
+    retrieved_obj=SMKfolder.findObject(pointintime,0)
+    retrieved_payload=retrieved_obj.payload()
+    retrieved_format=retrieved_payload['MasterConfigurationKey']
+    SuperMasterKey=int(999)
+    print "SMK SuperMasterKey default =",SuperMasterKey
+    SuperMasterKey = int(retrieved_format)                                 
+    print "SMK SuperMasterKey from Cool =",SuperMasterKey
+    coolDB.closeDatabase()
+
+   #from IOVDbSvc.CondDB import conddb
+   #conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+   #conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+   #conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+   #conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib<tag>HEAD</tag>")
+   #conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels<tag>HEAD</tag>")
+   #conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/Receivers/Factors/CalibGains<tag>HEAD</tag>")
+
+
+#from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
+#tf.configForStartup = "HLTonline"
+#from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
+#cfg = TriggerConfigGetter()
+#if rec.doLArg and rec.doTile:
+#  from AthenaCommon.AlgSequence import AlgSequence
+#  TTjob = AlgSequence()
+#  TTjob.TriggerTowerMaker.LVL1ConfigSvc = "Trig::TrigConfigSvc/TrigConfigSvc"
+ 
+#M6
+#rec.doTau=False;
+#rec.doEgamma=False;
+#rec.doJetMissingETTag=False;
+#from CaloRec.CaloCellFlags import jobproperties
+#jobproperties.CaloCellFlags.doLArHVCorr=False
+#jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False);  
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo_Stability.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo_Stability.py
new file mode 100644
index 000000000000..fbca813110b2
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo_Stability.py
@@ -0,0 +1,461 @@
+## Job options for Running the L1Calo Athena Online Monitoring
+## A few notes:
+## At the moment one needs to edit the RecExOnline_monitoring.py 
+##    and define the doLVL1CaloMon variable and replace doTrigMon
+##    in the statement:
+##       DQMonFlags.useTrigger(doTrigMon)
+##       DQMonFlags.doLVL1CaloMon(doTrigMon)
+##    with doLVL1CaloMon. Then add doLVL1CaloMon to
+##    the 'orMon' list.
+## I think that is all you need. Cheers, Taylor
+
+
+# used by RecExOnline to setup Emon Service
+useEmon           = True
+
+
+##################
+## -- flags set in: RecExOnline_emonsvc.py (from RecExOnline_jobOptions.py)
+
+import os
+
+# set partition name (default is ATLAS)
+partitionName = os.getenv("TDAQ_PARTITION","ATLAS")
+
+# set name of this publisher as it will appear in IS
+publishName       = "l1calo-athenaHLT-stability"
+
+# name of the stream type (physics,express, etc.)
+streamType = os.getenv("L1CALO_PTIO_STREAM_TYPE","physics")
+
+# name of the stream (Egamma,JetTauEtmiss,MinBias,Standby, etc.)
+# this can be a colon(:) separated list of streams that use
+# the 'streamLogic' to combine
+# stream for 2011 HI run: HardProbes
+#streamName = os.getenv("L1CALO_PTIO_STREAM_NAME","CosmicCalo:Egamma:JetTauEtmiss:MinBias:Muons:HardProbes")
+#streamName = os.getenv("L1CALO_PTIO_STREAM_NAME","CosmicCalo:CosmicMuons:Egamma:HLTPassthrough:HLT_IDCosmic:IDCosmic:L1Muon:L1Calo:MinBias:Jet:MinBias")
+#streamName = os.getenv("L1CALO_PTIO_STREAM_NAME","CosmicCalo:L1Calo:Main:MinBias")
+streamName = os.getenv("L1CALO_PTIO_STREAM_NAME","CosmicCalo:L1Calo:Main:MinBias:EnhancedBias:ZeroBias:HardProbes:Standby:ALFACalib")
+
+# logic used to combine multiple streams
+# can be set to 'Ignore' which means the stream selection isn't used
+streamLogic = os.getenv("L1CALO_PTIO_STREAM_LOGIC","Or")
+if(partitionName == "L1CaloStandalone"):
+   streamLogic = "Ignore"
+
+# name of L1 items to select
+# can be colon(:) separated list of L1 items
+lvl1Name          = ''
+
+# logic used to combined multiple L1 items
+# can be set to 'Ignore' which means the L1 selection isn't used
+lvl1Logic         = 'Ignore'
+
+# set the Sampler Key Type name (default is SFI)
+if ( not os.environ.get("L1CALO_PTIO_KEY") ):
+  if( partitionName == "L1CaloStandalone" ):
+    keyname = 'REB'
+  else:
+    keyname = 'dcm' #'SFI'
+else:
+  keyname = os.environ.get("L1CALO_PTIO_KEY")
+
+# set the Sampler count (default is 15)
+keycount = int(os.environ.get("L1CALO_PTIO_KEY_COUNT","25"))
+
+# event buffer size for each sampler
+buffersize        = 10
+
+# time in seconds between updating plots
+updateperiod      = 30
+
+# timeout (not sure what this does)
+timeout           = 240000
+
+# IS server onwhich to create this provider
+isserverName    = 'Histogramming'
+
+# this is not the global monitoring
+isGlobalMonitoring = False
+
+
+#from IOVDbSvc.CondDB import conddb
+#conddb.setGlobalTag("CONDBR2-HLTP-2014-00")
+#conddb.setGlobalTag("CONDBR2-ES1PA-2014-00") #crash
+
+
+############
+## -- flags set in: RecExOnline_globalconfig.py  (from RecExOnline_jobOptions.py)
+
+#read the pickle file if you want to use the AMI tag info
+#stored in ami_recotrf.pickle (produced by 'tct_getAmiTag.py f140 ami_recotrf.cmdargs ami_recotrf.pickle') 
+#usePickleConfig   = False
+#pickleconfigfile  = './ami_recotrf.pickle'
+#DataSource        = 'data'
+#InputFormat       = 'bytestream'
+#fileName         = './0.data'
+#doESD             = True
+#writeESD          = False
+#doAOD             = False
+#writeAOD          = False
+isOnlineStateless = True
+#beamType = 'collisions' #'collisions' # default: 'cosmics'
+#is_T0_project_tag = 'cos010'
+#is_T0_project_tag = "data_test"
+#is_T0_project_tag = "data14_cos"
+#is_T0_project_tag = "data15_13TeV"
+
+#COND tag and GEO are needed for running over a test partition or against ATLAS cosmics, calib
+#ConditionsTag     = 'COMCOND-HLTP-004-01'
+#DetDescrVersion   = 'ATLAS-GEO-20-00-01'
+
+from AthenaCommon.GlobalFlags import globalflags
+#globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-ES1PA-2014-00")
+#globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-HLTP-2015-05")
+#--->>>######globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-HLTP-2015-08")
+#globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-HLTP-2016-01")
+#globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+##ConditionsTag = 'CONDBR2-ES1PA-2014-00'
+##DetDescrVersion = 'ATLAS-R2-2015-01-01-00' 
+#DetDescrVersion = 'ATLAS-R2-2015-03-01-00' 
+#--->>>######DetDescrVersion = 'ATLAS-R2-2015-03-01-00'
+#DetDescrVersion = 'ATLAS-R2-2016-00-01-00'
+
+#doPixelOnlyMon   = False
+
+# unlimit max number of events
+evtMax            = -1
+
+###########
+## -- flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
+doAllReco   = False
+# following set to default values from JOs
+#doInDet     = doAllReco
+#doMuon      = doAllReco
+#doLArg      = doAllReco
+#doTile      = doAllReco
+#doLucid     = False
+#doHist      = True
+#doJiveXML   = False
+#doEgammaTau = doAllReco
+
+###########
+## -- flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
+#doAllReco   = True
+# following set to default values from JOs
+#doInDet     = False
+#doMuon      = True
+#doLArg      = doAllReco
+#doTile      = doAllReco
+#doLucid     = False
+#doHist      = False
+#doJiveXML   = False
+#doEgammaTau = False
+#doLArg      = False
+#doTile      = False
+
+
+#doCommissioning = False
+#abortonuncheckedstatuscode = False
+
+# Found that this must be true for REB runs but not for SFI
+if (partitionName == "L1CaloStandalone"):
+   doTrigger = False #True #Default: False
+else:
+   doTrigger = False
+   #doTrigger = True
+   #doTriggerConfigOnly=True
+   #TriggerModernConfig=True
+   #from TriggerJobOpts.TriggerFlags import TriggerFlags
+   #TriggerFlags.doTriggerConfigOnly=True
+   
+
+
+################
+## -- flags set in: RecExOnline_monitoring.py (from RecExOnline_jobOptions.py)
+
+# don't need all the monitoring enabled just for L1Calo
+doAllMon  = False
+#doCaloMon = doAllMon
+#doPhysMon = doAllMon
+#doIDMon   = doAllMon
+#doPixelOnlyMon = False
+#doSCTMon  = doAllMon
+#doMuonMon = True
+#doTRTMon  = doAllMon
+#doTrigMon = doAllMon
+doLVL1CaloMon = True
+#doHLTMon  = doTrigMon
+#doCTPMon  = doAllMon
+#doCTPMon = True
+#doLucidMon= doAllMon
+isOnline  = True
+
+
+from TrigT1CaloMonitoringTools.LVL1CaloMonFlags import LVL1CaloMonFlags
+LVL1CaloMonFlags.doPPrStabilityMon = True #False #True
+LVL1CaloMonFlags.doFineTimeMonitoring = False
+LVL1CaloMonFlags.doPedestalMonitoring = True
+LVL1CaloMonFlags.doPedestalCorrectionMonitoring = True
+LVL1CaloMonFlags.doEtCorrelationMonitoring = False
+
+
+rec.doInDet.set_Value_and_Lock(False)
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useTracks.set_Value_and_Lock(False)
+jetFlags.usePFlow.set_Value_and_Lock(False)
+jetFlags.useMuonSegments.set_Value_and_Lock(False)
+
+
+#rec.doMuon.set_Value_and_Lock(False)
+
+
+## main online reco scripts
+include ("RecExOnline/RecExOnline_jobOptions.py")
+
+
+
+print ' '
+print '-------------------------------------------------------------'
+print '|     RecExOnline_globalconfig settings'
+print '| usePickleConfig    = ',usePickleConfig
+print '| DataSource         = ',DataSource
+print '| InputFormat        = ',InputFormat
+print '| fileName           = ',fileName
+#print '| doESD              = ',doESD
+print '| writeESD           = ',writeESD
+#print '| doAOD              = ',doAOD
+print '| writeAOD           = ',writeAOD
+print '| isOnlineStateless  = ',isOnlineStateless
+print '| beamType           = ',beamType
+print '| is_T0_project_tag  = ',is_T0_project_tag
+print '| ConditionsTag      = ',ConditionsTag
+#print '| DetDescrVersion    = ',DetDescrVersion
+print '| doPixelOnlyMon     = ',doPixelOnlyMon
+print '| evtMax             = ',evtMax
+print '-------------------------------------------------------------'
+print '|     RecExOnline_recoflags settings'
+print '| doAllReco          = ',doAllReco
+print '| doInDet            = ',doInDet
+print '| doMuon             = ',doMuon
+print '| doLArg             = ',doLArg
+print '| doTile             = ',doTile
+print '| doLucid            = ',doLucid
+#print '| doTrigger          = ',doTrigger
+#print '| doHist             = ',doHist
+#print '| doJiveXML          = ',doJiveXML
+print '| doEgammaTau        = ',doEgammaTau
+print '| doCommissioning    = ',doCommissioning
+print '| abortonuncheckedstatuscode = ',abortonuncheckedstatuscode
+print '-------------------------------------------------------------'
+print '|     RecExOnline_monitoring settings'
+print '| doAllMon           = ',doAllMon
+print '| doCaloMon          = ',doCaloMon
+print '| doPhysMon          = ',doPhysMon
+print '| doHLTMon           = ',doHLTMon
+print '| doLVL1CaloMon      = ',doLVL1CaloMon
+print '| doCTPMon           = ',doCTPMon
+print '| doIDMon            = ',doIDMon
+print '| doPixelOnlyMon     = ',doPixelOnlyMon
+print '| doSCTMon           = ',doSCTMon
+print '| doMuonMon          = ',doMuonMon
+print '| doTRTMon           = ',doTRTMon
+print '| doLucidMon         = ',doLucidMon
+print '| isOnline           = ',isOnline
+print '-------------------------------------------------------------'
+print '|     RecExOnline: emonsvc settings'
+print '| partitionName      = ',partitionName
+print '| publishName        = ',publishName
+print '| streamNames        = ',streamName
+print '| streamType         = ',streamType
+print '| streamLogic        = ',streamLogic
+print '| lvl1Name           = ',lvl1Name
+print '| lvl1Logic          = ',lvl1Logic
+print '| keyname            = ',keyname
+print '| keycount           = ',keycount
+print '| buffersize         = ',buffersize
+print '| updateperiod       = ',updateperiod
+print '| timeout            = ',timeout
+print '| isserverName       = ',isserverName
+print '| isGlobalMonitoring = ',isGlobalMonitoring
+print '--------------------------------------------------------------'
+
+#from AthenaCommon.AppMgr import ServiceMgr
+#from TrigT1CaloCondSvc.TrigT1CaloCondSvcConf import L1CaloCondSvc
+#ServiceMgr += L1CaloCondSvc()
+#from IOVDbSvc.CondDB import conddb
+#L1CaloFolderList = []
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Calibration/PprChanCalib"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Conditions/DisabledTowers"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults"]
+#for l1calofolder in L1CaloFolderList:
+#  conddb.addFolderWithTag("TRIGGER", l1calofolder, "HEAD")
+
+#L1CaloDb=""
+#if not 'L1CaloDbConnection' in dir():
+#    if 'L1CaloSqliteDB' in dir():
+#        L1CaloDbConnection="<dbConnection>sqlite://;schema=" + L1CaloSqliteDB + ";dbname=L1CALO</dbConnection>"
+#    else:
+#        L1CaloDb="TRIGGER"
+#        L1CaloDbConnection=""
+
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+##conddb.blockFolder("/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+#conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Conditions/DisabledTowers")
+
+
+
+#L1CaloDbTag = "<tag>HEAD</tag>"
+#
+#L1CaloFolderList = []
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Conditions/DisabledTowers"]
+#L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults"]
+
+#for l1calofolder in L1CaloFolderList:
+#    if not conddb.folderRequested(l1calofolder):
+#        conddb.addFolder(L1CaloDb, L1CaloDbConnection + l1calofolder + L1CaloDbTag)
+
+
+#from IOVDbSvc.CondDB import conddb
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+##conddb.blockFolder("/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+##conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults")
+##conddb.blockFolder("/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults")
+##conddb.blockFolder("/TRIGGER/L1Calo/V1/Conditions/DisabledTowers")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels<tag>HEAD</tag>")
+##conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/Receivers/Factors/CalibGains<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Conditions/DisabledTowers<tag>HEAD</tag>")
+#
+#from IOVDbSvc.CondDB import conddb
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+#conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults")
+#conddb.blockFolder("/TRIGGER/L1Calo/V1/Conditions/DisabledTowers")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/Receivers/Factors/CalibGains<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults<tag>HEAD</tag>")
+#conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Conditions/DisabledTowers<tag>HEAD</tag>")
+#
+#conddb.addOverride('/GLOBAL/TrackingGeo/LayerMaterialV2','AtlasLayerMat_v19s0_ATLAS-R2-2015-02')
+
+#--->>>######conddb.addOverride('/GLOBAL/TrackingGeo/LayerMaterialV2','AtlasLayerMat_v19s0_ATLAS-R2-2015-03')
+
+#from IOVDbSvc.CondDB import conddb
+#conddb.addFolder("TRIGGER","/TRIGGER/HLT/Menu <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/HLT/HltConfigKeys <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Lvl1ConfigKey <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Menu <tag>HEAD</tag>")
+#conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Prescales <tag>HEAD</tag>")
+
+
+
+#theApp.CreateSvc  += ["StoreGateSvc/StoreGateSvc" ]
+#ByteStreamAddressProviderSvc = Service( "ByteStreamAddressProviderSvc" )
+#ByteStreamAddressProviderSvc.TypeNames += ["/Run/L1TopoToCTPLocation"]
+#ProxyProviderSvc = Service( "ProxyProviderSvc" )
+#ProxyProviderSvc.ProviderNames += [ "ByteStreamAddressProviderSvc" ]
+#svcMgr.ProxyProviderSvc.ProviderNames += [ "/Run/L1TopoToCTPLocation" ]
+
+
+# added for testing purposes
+# need to for the run number in the test data partitions
+# fix for missing folder /TRIGGER/LUMI/LBLESTONL
+#if (partitionName.find("L1CaloStandalone") >= 0) or (partitionName.find("Test_dataProvider") >= 0) :
+
+if (partitionName.find("L1CaloStandalone") >= 0) or (partitionName.find("ATLAS") >= 0) :
+#if (partitionName.find("L1CaloStandalone") >= 0) :
+  print "L1Calo Monitoring is overriding the run number and lumiblock number."
+  svcMgr.IOVDbSvc.forceRunNumber=313285 #312424 #309640 #271733 #182519 #238735
+  svcMgr.IOVDbSvc.forceLumiblockNumber=1
+  print "L1Calo Monitoring set run to ",svcMgr.IOVDbSvc.forceRunNumber,"and lumi block to",svcMgr.IOVDbSvc.forceLumiblockNumber
+
+  #from IOVDbSvc.CondDB import conddb
+  #conddb.addFolder("TRIGGER","/TRIGGER/HLT/Menu <tag>HEAD</tag>") 
+  #conddb.addFolder("TRIGGER","/TRIGGER/HLT/HltConfigKeys <tag>HEAD</tag>")
+  #conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Lvl1ConfigKey <tag>HEAD</tag>")
+  #conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Menu <tag>HEAD</tag>")
+  #conddb.addFolder("TRIGGER","/TRIGGER/LVL1/Prescales <tag>HEAD</tag>")
+
+
+  from IOVDbSvc.CondDB import conddb
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/HLT/Menu<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/HLT/HltConfigKeys<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/HLT/Prescales<tag>HEAD</tag>")
+
+  conddb.addFolder("", "<db>oracle://ATONR_COOL;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2</dbConnection>/TRIGGER/HLT/PrescaleKey<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>oracle://ATONR_COOL;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2</dbConnection>/TRIGGER/HLT/Groups<tag>HEAD</tag>")
+
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Lvl1ConfigKey<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Menu<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/ItemDef<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/BunchGroupKey<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/BunchGroupDescription<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/BunchGroupContent<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Prescales<tag>HEAD</tag>")
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/Thresholds<tag>HEAD</tag>")
+
+  conddb.addFolder("", "<db>COOLONL_TRIGGER/CONDBR2</db>/TRIGGER/LVL1/CTPCoreInputMapping<tag>HEAD</tag>")
+
+
+
+  # only offline
+  from RecExConfig.InputFilePeeker import inputFileSummary
+  print "inputFileSummary =",inputFileSummary
+  if inputFileSummary.__contains__('bs_metadata'):
+    # get the run number and lumi_block for the input
+    run_number = inputFileSummary['bs_metadata']['run_number']
+
+    pointintime = (int(run_number)<<32) + int(lumi_block) # start from lumiblock 0 (or 1?)
+
+    DBInstance = svcMgr.IOVDbSvc.properties()['DBInstance']
+    print "L1Calo Monitoring check DBInstance ",DBInstance
+    connstring = "COOLONL_TRIGGER/"+str(DBInstance) 
+    from CoolConvUtilities.AtlCoolLib import indirectOpen
+    coolDB=indirectOpen(connstring,oracle='True')
+    SMKfolder=coolDB.getFolder('/TRIGGER/HLT/HltConfigKeys')
+
+    retrieved_obj=SMKfolder.findObject(pointintime,0)
+    retrieved_payload=retrieved_obj.payload()
+    retrieved_format=retrieved_payload['MasterConfigurationKey']
+    SuperMasterKey=int(999)
+    print "SMK SuperMasterKey default =",SuperMasterKey
+    SuperMasterKey = int(retrieved_format)                                 
+    print "SMK SuperMasterKey from Cool =",SuperMasterKey
+    coolDB.closeDatabase()
+
+   #from IOVDbSvc.CondDB import conddb
+   #conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib")
+   #conddb.blockFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels")
+   #conddb.blockFolder("/TRIGGER/Receivers/Factors/CalibGains")
+   #conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib<tag>HEAD</tag>")
+   #conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels<tag>HEAD</tag>")
+   #conddb.addFolder("", "<dbConnection>sqlite://;schema=/det/l1calo/calib/tdaq-05/calib.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/Receivers/Factors/CalibGains<tag>HEAD</tag>")
+
+
+#from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
+#tf.configForStartup = "HLTonline"
+#from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
+#cfg = TriggerConfigGetter()
+#if rec.doLArg and rec.doTile:
+#  from AthenaCommon.AlgSequence import AlgSequence
+#  TTjob = AlgSequence()
+#  TTjob.TriggerTowerMaker.LVL1ConfigSvc = "Trig::TrigConfigSvc/TrigConfigSvc"
+ 
+#M6
+#rec.doTau=False;
+#rec.doEgamma=False;
+#rec.doJetMissingETTag=False;
+#from CaloRec.CaloCellFlags import jobproperties
+#jobproperties.CaloCellFlags.doLArHVCorr=False
+#jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False);  
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT.C b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT.C
new file mode 100644
index 000000000000..79fd45b50aef
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT.C
@@ -0,0 +1,40 @@
+#include <iostream>
+#include <string>
+#include <fstream>
+
+#include "TROOT.h"
+#include "TH1F.h"
+#include "TFile.h"
+#include "TCanvas.h"
+#include "TSystem.h"
+#include "TKey.h"
+#include "TFolder.h"
+#include "TDirectory.h"
+void RecExOnline_Test_Obj_His_RTT() 
+{
+   
+   TFile *file = new TFile("Monitor.root");
+
+//    TH1F *h1_AK4LCTTopoJetsPt= (TH1F*)gDirectory->FindObjectAny("Jets/AntiKt4LCTTopoJets/pt");
+      //  TH1F *h1_AK4LCTTopoJetsPt= (TH1F*)gDirectory->FindObjectAny("run_284484/Jets/AntiKt4EMTopoJets/pt");
+     
+      TDirectory* fjet =(TDirectory*)file->FindObjectAny("AntiKt4EMTopoJets"); 
+      TH1F *h1_JetsPt= (TH1F*)fjet->FindObjectAny("pt");
+      
+      TDirectory* ftau =(TDirectory*)file->FindObjectAny("Tau"); 
+      TH1F *h2_TauPt= (TH1F*)ftau->FindObjectAny("tauEt");
+         
+
+    TCanvas *c1 = new TCanvas("c1", " Canvas", 400, 300);
+ 
+    h1_JetsPt->Draw("HistE");
+    c1->Print("AntiKt4EMTopoPt.png");
+       
+    TCanvas *c2 = new TCanvas("c21", "Canvas 2", 400, 300);
+ 
+    h2_TauPt->Draw("HistE");
+    c2->Print("TauPt.png");
+
+
+}
+
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_CINT.C b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_CINT.C
new file mode 100644
index 000000000000..114098f87032
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_CINT.C
@@ -0,0 +1,28 @@
+void RecExOnline_Test_Obj_His_RTT_CINT() 
+{
+   
+   TFile *file = new TFile("Monitor.root");
+
+//    TH1F *h1_AK4LCTTopoJetsPt= (TH1F*)gDirectory->FindObjectAny("Jets/AntiKt4LCTTopoJets/pt");
+      //  TH1F *h1_AK4LCTTopoJetsPt= (TH1F*)gDirectory->FindObjectAny("run_284484/Jets/AntiKt4EMTopoJets/pt");
+     
+      TDirectory* fjet =(TDirectory*)file->FindObjectAny("AntiKt4EMTopoJets"); 
+      TH1F *h1_JetsPt= (TH1F*)fjet->FindObjectAny("pt");
+      
+      TDirectory* ftau =(TDirectory*)file->FindObjectAny("Tau"); 
+      TH1F *h2_TauPt= (TH1F*)ftau->FindObjectAny("tauEt");
+         
+
+    TCanvas *c1 = new TCanvas("c1", " Canvas", 400, 300);
+ 
+    h1_JetsPt->Draw("HistE");
+    c1->Print("AntiKt4EMTopoPt.png");
+       
+    TCanvas *c2 = new TCanvas("c21", "Canvas 2", 400, 300);
+ 
+    h2_TauPt->Draw("HistE");
+    c2->Print("TauPt.png");
+
+
+}
+
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp.C b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp.C
new file mode 100755
index 000000000000..549be45b1418
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp.C
@@ -0,0 +1,152 @@
+#include <cstdlib>
+#include <iostream>
+#include <string>
+#include <fstream>
+      
+#include "TROOT.h"
+#include "TH1F.h"
+#include "TFile.h"
+#include "TCanvas.h"
+#include "TSystem.h"
+#include "TKey.h"
+#include "TFolder.h"
+#include "TDirectory.h"
+
+
+#define nJetVar 4
+#define nTauVar 4
+#define nTrackVar 5
+void RecExOnline_Test_Obj_His_RTT_Cpp() 
+{
+   
+   TFile *file = new TFile("Monitor.root");
+
+      //  For Jet variables  
+      
+      vector<string> JetVarstring;
+      
+      JetVarstring.push_back("pt");  
+      JetVarstring.push_back("eta");  
+      JetVarstring.push_back("phi");  
+      JetVarstring.push_back("M");  
+
+
+      TH1F *h_Jet[nJetVar];
+      TCanvas *cjet[nJetVar];  
+      
+              
+      string JetType;
+      JetType="AntiKt4EMTopoJets";
+      TDirectory* fjet =(TDirectory*)file->FindObjectAny(JetType.data()); 
+    
+      for(int n=0;n<nJetVar;n++)
+      {
+        h_Jet[n]=(TH1F*)fjet->FindObjectAny(JetVarstring[n].data());
+        cjet[n]=new TCanvas(Form("cjet_%d",n),Form("JetCanvas_%d",n), 400, 300);
+        cjet[n]->cd();
+        h_Jet[n]->Draw("HistE");
+        string savehis;
+        savehis=Form("Jet_%s_%s.png",JetType.data(),JetVarstring[n].data()); 
+        cjet[n]->Print(savehis.data());
+        cout<<"<td><img src=\""<<savehis<<"\" alt=\""<<savehis<<"\" height=\"250\"></td>"<<endl;
+      }
+      
+      //  For Tau variables  
+      
+      vector<string> TauVarstring;
+      
+      TauVarstring.push_back("tauEt");  
+      TauVarstring.push_back("tauEta");  
+      TauVarstring.push_back("tauPhi");  
+      TauVarstring.push_back("tauCharge");  
+
+
+      TH1F *h_Tau[nTauVar];
+      TCanvas *cTau[nTauVar];  
+      
+              
+      string TauType;
+      TauType="Tau";
+      TDirectory* fTau =(TDirectory*)file->FindObjectAny(TauType.data()); 
+    
+      for(int n=0;n<nTauVar;n++)
+      {
+        h_Tau[n]=(TH1F*)fTau->FindObjectAny(TauVarstring[n].data());
+        cTau[n]=new TCanvas(Form("cTau_%d",n),Form("TauCanvas_%d",n), 400, 300);
+        cTau[n]->cd();
+        h_Tau[n]->Draw("HistE");
+        string savehis;
+        savehis=Form("Tau_%s_%s.png",TauType.data(),TauVarstring[n].data());
+        cTau[n]->Print(savehis.data());
+        cout<<"<td><img src=\""<<savehis<<"\" alt=\""<<savehis<<"\" height=\"250\"></td>"<<endl;
+      }
+      
+      vector<string> TrackVarstring;
+      
+      TrackVarstring.push_back("ngtracks");  
+      TrackVarstring.push_back("Nhits_per_track");  
+      TrackVarstring.push_back("d0");  
+      TrackVarstring.push_back("z0");  
+      TrackVarstring.push_back("P");
+
+      TH1F *h_Track[nTrackVar];
+      TCanvas *cTrack[nTrackVar];  
+      
+              
+      string TrackType;
+      TrackType="run_284484/IDAlignMon/ExtendedTracks_NoTriggerSelection/GenericTracks";
+      TDirectory* fTrack =(TDirectory*)file->Get(TrackType.data()); 
+
+      string FindTrackDir=fTrack->GetName();
+      cout<<"### Sucessfully finding Dir : "<<FindTrackDir<<endl;   
+      //fTrack->Paint();  
+      fTrack->Print();
+      fTrack->ls();
+
+      
+      for(int n=0;n<nTrackVar;n++)
+      {
+        cout<<" Found "<<TrackVarstring[n].data()<<" : "<<fTrack->GetListOfKeys()->Contains(TrackVarstring[n].data())<<endl;
+        cTrack[n]=new TCanvas(Form("cTrack_%d",n),Form("TrackCanvas_%d",n), 400, 300);      
+        cTrack[n]->cd();
+        
+        if(fTrack->GetListOfKeys()->Contains(TrackVarstring[n].data()))
+        {
+          h_Track[n]=(TH1F*)fTrack->Get(TrackVarstring[n].data());
+          h_Track[n]->Draw("HistE");
+        }
+        string savehis;
+        savehis=Form("Track_%s_%s.png","TrackTemp",TrackVarstring[n].data());
+        cTrack[n]->Print(savehis.data());
+        cout<<"<td><img src=\""<<savehis<<"\" alt=\""<<savehis<<"\" height=\"250\"></td>"<<endl;
+      }
+ 
+      //  For resonance variables  
+      
+
+      TH1F *h_Res[4];
+      TCanvas *cRes[4];  
+      
+      h_Res[0]=(TH1F*)file->Get("run_284484/IDPerfMon/Wenu/NoTriggerSelection/Wenu_transmass_sel");     
+      cRes[0]=new TCanvas("wenu","wenu", 400, 300);    
+      h_Res[0]->Draw("HistE");            
+      cRes[0]->Print("wenu_mt.png");
+ 
+      h_Res[1]=(TH1F*)file->Get("run_284484/IDPerfMon/Zee/NoTriggerSelection/Zee_invmass");     
+      cRes[1]=new TCanvas("zee","zee", 400, 300);    
+      h_Res[1]->Draw("HistE");            
+      cRes[1]->Print("zee_m.png");
+
+      h_Res[2]=(TH1F*)file->Get("run_284484/DiMuMon/Zmumu/NoTrig/Zmumu_invmass_All");     
+      cRes[2]=new TCanvas("zmumu","zmumu", 400, 300);    
+      h_Res[2]->Draw("HistE");            
+      cRes[2]->Print("zmumu_m.png");
+
+      h_Res[3]=(TH1F*)file->Get("run_284484/DiMuMon/Jpsi/NoTrig/Jpsi_invmass_All");     
+      cRes[3]=new TCanvas("jpsi","jpsi", 400, 300);    
+      h_Res[3]->Draw("HistE");            
+      cRes[3]->Print("jpsi_m.png");
+
+
+}
+
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp_Online.C b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp_Online.C
new file mode 100755
index 000000000000..cb8273d67d70
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp_Online.C
@@ -0,0 +1,51 @@
+#include <cstdlib>
+#include <iostream>
+#include <string>
+#include <fstream>
+      
+#include "TROOT.h"
+#include "TH1F.h"
+#include "TFile.h"
+#include "TCanvas.h"
+#include "TSystem.h"
+#include "TKey.h"
+#include "TFolder.h"
+#include "TDirectory.h"
+
+
+#define nDQBKG 1
+#define nTauVar 4
+void RecExOnline_Test_Obj_His_RTT_Cpp_Online() 
+{
+   
+   TFile *file = new TFile("monitoring.root");
+
+      //  For Jet variables  
+      
+      vector<string> DQBKGstring;
+      
+      DQBKGstring.push_back("m_NumVertex");  
+
+      TH1F *h_DQBKG[nDQBKG];
+      TCanvas *cjet[nDQBKG];  
+      
+              
+      string DQBKGType;
+      DQBKGType="BackgroundMon";
+      TDirectory* fDQBKG =(TDirectory*)file->FindObjectAny(DQBKGType.data()); 
+    
+      for(int n=0;n<nDQBKG;n++)
+      {
+        h_DQBKG[n]=(TH1F*)fDQBKG->FindObjectAny(DQBKGstring[n].data());
+        cjet[n]=new TCanvas(Form("cjet_%d",n),Form("Canvas_%d",n), 400, 300);
+        cjet[n]->cd();
+        h_DQBKG[n]->Draw("HistE");
+        string savehis;
+        savehis=Form("DQBKG_%s_%s.png",DQBKGType.data(),DQBKGstring[n].data()); 
+        cjet[n]->Print(savehis.data());
+        cout<<"<td><img src=\""<<savehis<<"\" alt=\""<<savehis<<"\" height=\"250\"></td>"<<endl;
+      }
+      
+
+}
+
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp_rename.C b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp_rename.C
new file mode 100755
index 000000000000..bb9513ee925e
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Test_Obj_His_RTT_Cpp_rename.C
@@ -0,0 +1,147 @@
+#include <cstdlib>
+#include <iostream>
+#include <string>
+#include <fstream>
+      
+#include "TROOT.h"
+#include "TH1F.h"
+#include "TFile.h"
+#include "TCanvas.h"
+#include "TSystem.h"
+#include "TKey.h"
+#include "TFolder.h"
+#include "TDirectory.h"
+#include "TLegend.h"
+
+#define nHisVar 25
+#define nJetVar 4
+#define nTauVar 4
+#define nTrackVar 5
+void RecExOnline_Test_Obj_His_RTT_Cpp_rename() 
+{
+   string P1MONversion="/20.11.X.Y.Z-VAL/build/x86_64-slc6-gcc49-opt/AtlasP1MON/RecExOnline/RecExOnline_User_Offline_test_v1/";  
+   string PreURL="https://atlas-rtt.cern.ch/prod/rtt/rel_";
+   ofstream myfile;
+   myfile.open ("P1MON_RTT_result_template_v1.html");
+   myfile<<"<table border=\"2\" style=\"width:100%\"> \n";
+ 
+   TFile *file = new TFile("Monitor.root");
+  
+//   TFile *file_ref = new TFile("/afs/cern.ch/user/y/yunju/working/yunju/public/GM_ref_plots/r0000284484_All_ATLAS_Global-MDA_Histogramming-Global.root");
+TFile *file_ref = new TFile("/afs/cern.ch/user/y/yunju/working/yunju/public/GM_ref_plots/r0000302347_l0420_ATLAS_Global-MDA_Histogramming-Global.root");  
+   string foldername_ref;
+   foldername_ref= "Histogramming-Global-iss/GM-Gatherer-MIG_GlobalMonitoringSegment";   
+      
+   string foldername;
+  //   foldername="run_284484";
+  foldername="run_302347";
+
+   vector<string> HisVarstring;      
+   HisVarstring.push_back("Jets/AntiKt4EMTopoJets/pt");  
+   HisVarstring.push_back("Jets/AntiKt4EMTopoJets/eta");  
+   HisVarstring.push_back("Jets/AntiKt4EMTopoJets/phi");  
+   HisVarstring.push_back("Jets/AntiKt4EMTopoJets/M");  
+   HisVarstring.push_back("Tau/tauEt");  
+   HisVarstring.push_back("Tau/tauEta");  
+   HisVarstring.push_back("Tau/tauPhi");  
+   HisVarstring.push_back("Tau/tauCharge");  
+   HisVarstring.push_back("IDAlignMon/ExtendedTracks_NoTriggerSelection/GenericTracks/ngtracks");  
+   HisVarstring.push_back("IDAlignMon/ExtendedTracks_NoTriggerSelection/GenericTracks/Nhits_per_track");  
+   HisVarstring.push_back("IDAlignMon/ExtendedTracks_NoTriggerSelection/GenericTracks/d0");  
+   HisVarstring.push_back("IDAlignMon/ExtendedTracks_NoTriggerSelection/GenericTracks/P");  
+   HisVarstring.push_back("IDPerfMon/Wenu/NoTriggerSelection/Wenu_transmass_sel");  
+   HisVarstring.push_back("IDPerfMon/Zee/NoTriggerSelection/Zee_invmass");  
+   HisVarstring.push_back("DiMuMon/Zmumu/NoTrig/Zmumu_invmass_All");  
+   HisVarstring.push_back("DiMuMon/Jpsi/NoTrig/Jpsi_invmass_All"); 
+   HisVarstring.push_back("MuonPhysics/Muons/CBMuons/Muons_CBMuons_pt");  
+   HisVarstring.push_back("MuonPhysics/Muons/CBMuons/Muons_CBMuons_eta");
+   HisVarstring.push_back("MuonPhysics/Muons/CBMuons/Muons_CBMuons_phi");
+   HisVarstring.push_back("egamma/photons/photonEtCbLoose");
+   HisVarstring.push_back("egamma/photons/photonEtaCbLoose");
+   HisVarstring.push_back("egamma/photons/photonPhiCbLoose");
+   HisVarstring.push_back("egamma/electrons/electronEtLhLoose");
+   HisVarstring.push_back("egamma/electrons/electronEtaLhLoose");
+   HisVarstring.push_back("egamma/electrons/electronPhiLhLoose");
+   
+
+
+      TH1F *h_tot[nHisVar];
+      TH1F *h_tot_ref[nHisVar]; 
+
+      TCanvas *ctot[nHisVar];  
+
+      TLegend *leg3 = new TLegend(0.22, 0.8, 0.3, 0.88);
+      leg3->SetBorderSize(0);
+      leg3->SetFillColor(0);
+      leg3->SetTextSize(0.03);
+      //leg3->SetHeader("p + p , #sqrt{s} = 8 TeV");     
+
+      
+              
+    
+      for(int n=0;n<nHisVar;n++)
+      {
+       
+
+        //cout<<"Looking for hist: "<<Form("%s/%s",foldername.data(),HisVarstring[n].data())<<endl; 
+         
+        h_tot[n]=(TH1F*)file->Get(Form("%s/%s",foldername.data(),HisVarstring[n].data()));
+        h_tot_ref[n]=(TH1F*)file_ref->Get(Form("%s/%s",foldername_ref.data(),HisVarstring[n].data()));
+       
+        ctot[n]=new TCanvas(Form("ctot_%d",n),Form("totCanvas_%d",n), 600, 400);
+        ctot[n]->cd();
+        h_tot[n]->Sumw2();
+        h_tot_ref[n]->Sumw2();      
+ 
+        h_tot[n]->Scale(1/h_tot[n]->Integral());
+        h_tot_ref[n]->Scale(1/h_tot_ref[n]->Integral());       
+        h_tot_ref[n]->SetLineColor(8);
+        h_tot_ref[n]->SetFillColor(8);
+        h_tot_ref[n]->SetFillStyle(3313);
+        float ymax=h_tot_ref[n]->GetMaximum();
+        h_tot_ref[n]->SetMaximum(ymax*1.5); 
+        h_tot_ref[n]->Draw("HistE");
+        
+        h_tot[n]->SetLineColor(1);        
+        h_tot[n]->Draw("HistEsame");
+        string HisVarstring_new;
+        HisVarstring_new=HisVarstring[n].data();
+     
+        if(n==0)
+        {  
+          leg3->AddEntry(h_tot[n],"P1 MON RTT","f");
+          leg3->AddEntry(h_tot_ref[n],"Ref from MDA","f");
+        }
+
+        leg3->Draw("same");
+                
+        int f=-10; 
+        do
+        {
+          //cout<<"start:"<<endl; 
+          //cout<<"f1:"<<f<<endl;
+          f = HisVarstring_new.find("/");       
+          //cout<<"f2:"<<f<<endl;
+          if(f!=string::npos) HisVarstring_new.replace(f, std::string("/").length(), "_");
+          //cin.get();
+        }while (f!=-1);        
+
+        
+        string savehis;
+        savehis=Form("tot_%s_%s.png",foldername.data(),HisVarstring_new.data()); 
+        ctot[n]->Print(savehis.data());
+        myfile<<"<tr> \n";
+        for(int rel=0;rel<7;rel++)
+        {
+           string PreURLRel=Form("%s%d%s%s",PreURL.data(),rel,P1MONversion.data(),savehis.data());
+           string histlocation;
+           //histlocation= "<td><img src=\""+PreURL<<savehis<<"\" alt=\""<<savehis<<"\" height=\"250\"></td>" 
+           myfile<<"<td><img src=\""<<PreURLRel.data()<<"\" alt=\""<<savehis<<"\" height=\"250\"></td> \n";
+        
+        }
+        myfile<<"</tr> \n";
+      }
+      myfile<<"</table> \n";    
+myfile.close();
+}
+
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline.py
index c3fad496666c..e1adbfbe3ca1 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline.py
@@ -1,18 +1,28 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
 
 ## -- Overview of all default local settings that one can change 
 ## -- The default values are also shown.
 
+
+
 ## ------------------------------------------- flags set in: RecExOnline_jobOptions.py  
 isOnline          = False
 isOnlineStateless = False
 
+# for testing on lxplus
+isOfflineTest     = True
+
 ## ------------------------------------------- flags set in: RecExOnline_monitoring.py  
 isGlobalMonitoring = False
 
 #eMon can only be used ONLINE (please see RecExOnline_Partition_Online.py)
 useEmon           = False
 useAtlantisEmon   = False
-evtMax            = 10 #100
+
+###evtMax            = 200
+evtMax            = vars().get('inpuevtMax', 200)
+###evtMax            = -1
 
 ## ------------------------------------------- flags set in: RecExOnline_globalconfig.py  (from RecExOnline_jobOptions.py)
 #read the pickle file if you want to use the AMI tag info
@@ -21,8 +31,55 @@ usePickleConfig   = False
 pickleconfigfile  = './ami_recotrf.pickle'
 DataSource        = 'data'
 InputFormat       = 'bytestream'
+
+## cosmic
+## fileName          = '/afs/cern.ch/work/c/cylin/public/data15_cos.00258389.express_express.merge.RAW._lb0894._SFO-ALL._0001.1'
+
+## collision
+### fileName          = '/afs/cern.ch/work/c/cylin/public/data15_comm.00264034.express_express.merge.RAW._lb0784._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/c/cylin/public/data/data15_13TeV.00270953.express_express.merge.RAW._lb0265._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/s/smwang/public/DQM/data/data15_13TeV.00284154.express_express.merge.RAW._lb0218._SFO-ALL._0001.1'
+#fileName          = '/afs/cern.ch/work/s/smwang/public/DQM/data/data15_13TeV.00284484.express_express.merge.RAW._lb0098._SFO-ALL._0001.1'
+fileName          = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExOnline/data16_13TeV.00302347.express_express.merge.RAW._lb0432._SFO-ALL._0001.1'
+###
+### fileName          = 'root://eosatlas.cern.ch//eos/atlas/atlastier0/rucio/data15_13TeV/express_express/00284484/data15_13TeV.00284484.express_express.merge.RAW/data15_13TeV.00284484.express_express.merge.RAW._lb0487._SFO-ALL._0001.1'
+
+##
 #fileName          = '/afs/cern.ch/user/k/koutsman/OnlineNightly/data/data12_8TeV.00208931.express_express.daq.RAW._lb0123._SFO-9._0001.data'
-fileName          = 'root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/tct/rec_input/00204416/express_express/data12_8TeV.00204416.express_express.merge.RAW._lb0015._SFO-ALL._0001.1'
+#fileName          = 'root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/tct/rec_input/00204416/express_express/data12_8TeV.00204416.express_express.merge.RAW._lb0015._SFO-ALL._0001.1'
+
+
+#beamType          = 'cosmics'
+#projectName       = 'data15_cos'
+beamType          = 'collisions'  #AK: 21-05-2014
+### projectName       = 'data15_comm'
+###projectName       = 'data15_13TeV'
+projectName       = 'data16_13TeV'
+
+
+### Online
+### ConditionsTag     = 'CONDBR2-HLTP-2015-03'
+###
+### Offline
+### ConditionsTag     = 'CONDBR2-ES1PA-2015-03'
+### ConditionsTag     = 'CONDBR2-ES1PA-2015-04'
+### ConditionsTag     = 'CONDBR2-ES1PA-2015-07'  ### 2015-06-17
+###
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-03'
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-04'
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-09'  ### 2015-06-25
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-11'  ### 2015-07-30
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-14'  ### 2015-08-31
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-15'  ### 2015-09-06
+ConditionsTag     = 'CONDBR2-BLKPA-2016-06'  ### 2016-02-26
+#ConditionsTag = 'CONDBR2-BLKPA-2017-07' ### 2017-11-04
+
+### DetDescrVersion   = 'ATLAS-R2-2015-02-00-00'
+#DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'
+
+DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'
+#DetDescrVersion   = 'ATLAS-R2-2016-01-00-01'
+
 
 doESD             = True
 writeESD          = False
@@ -36,7 +93,7 @@ doInDet     = doAllReco
 doMuon      = doAllReco
 doLArg      = doAllReco
 doTile      = doAllReco
-doTrigger   = False
+doTrigger   = doAllReco
 doHist      = doAllReco
 doJiveXML   = False
 doEgammaTau = doAllReco
@@ -47,22 +104,91 @@ doEgammaTau = doAllReco
 ## ------------------------------------------ flags set in : RecExOnline_monitoring.py (from from RecExOnline_jobOptions.py)
 doAllMon  = True
 doCaloMon = doAllMon
+doTileMon = doAllMon
 doPhysMon = doAllMon
-doTrigMon = False
+doTrigMon = doAllMon
 doIDMon   = doAllMon
 doTRTMon  = doAllMon
 doMuonMon = doAllMon
+doCTPMon  = False
+doHIMon   = False # doAllMon
+
+#  if DQMonFlags.doPixelMon() or DQMonFlags.doSCTMon() or DQMonFlags.doTRTMon() or \
+#               DQMonFlags.doInDetGlobalMon() or DQMonFlags.doInDetAlignMon():
 
 ## ------------------------------------------ flags set in : RecExOnline_postconfig.py    (called from RecExOnline_jobOptions.py)
 
 #### CHANGES TO GET 19.1.0.1 RECO WORKING (M4)
+from AthenaCommon.BeamFlags import jobproperties
+jobproperties.Beam.beamType.set_Value_and_Lock(beamType)
+
+from AthenaCommon.GlobalFlags import globalflags
+globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+globalflags.ConditionsTag.set_Value_and_Lock(ConditionsTag)
+globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion)
+
+
+from AthenaCommon.BFieldFlags import jobproperties
+jobproperties.BField.barrelToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.endcapToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.solenoidOn.set_Value_and_Lock(True)
+###jobproperties.BField.solenoidOn.set_Value_and_Lock(False)
+
+
+from CaloRec.CaloCellFlags import jobproperties
+jobproperties.CaloCellFlags.doLArHVCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)  ####? for trigger, added 11th March, 2015, by CY
+
+
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True)
+InDetFlags.useBroadClusterErrors.set_Value_and_Lock(False)
+
+
 from AthenaMonitoring.DQMonFlags import DQMonFlags
-DQMonFlags.doMuonCombinedMon.set_Value_and_Lock(False)
-DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(False)
+DQMonFlags.doStreamAwareMon.set_Value_and_Lock(False)
+DQMonFlags.enableLumiAccess.set_Value_and_Lock(False)
+DQMonFlags.doCTPMon.set_Value_and_Lock(False)
+DQMonFlags.doLVL1CaloMon.set_Value_and_Lock(False)
+### DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(False) #xx
+DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(True) #xx
+### DQMonFlags.doJetTagMon.set_Value_and_Lock(False)
+#print "#### yunju Here is DQMonFlags.monManEnvironment:"+DQMonFlags.monManEnvironment
+## for egmma monitoring in lxplus
+DQMonFlags.monManEnvironment.set_Value_and_Lock('tier0')
+
+from RecExConfig.RecFlags import rec
+rec.doBTagging.set_Value_and_Lock(True)
 
-# Doesn't work with run 1 data (conditions issue).
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useBTagging.set_Value_and_Lock(True)
+
+### from JetRec.JetRecFlags import jetFlags
+### jetFlags.useTracks.set_Value_and_Lock(False)
+
+
+from MuonDQAMonFlags.MuonDQAProperFlags import MuonDQADetFlags
+### MuonDQADetFlags.doMDTTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCMon.set_Value_and_Lock(True)
+
+##---------------------------------------ID suggestion from Alex 18.Feb.2015  --------
+jobproperties.InDetJobProperties.doTrackSegmentsSCT.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsPixel.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsTRT.set_Value_and_Lock(False)
+
+##---------------------------------------Bunch Spacing 25ns  --------
 from InDetRecExample.InDetJobProperties import InDetFlags
-InDetFlags.doTIDE_Ambi.set_Value_and_Lock(False)
+InDetFlags.InDet25nsec.set_Value_and_Lock(True)
+
+jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25)
+
+# --------------------------------------------- Monitoring
+### replaced by MuonTrackMonitoring (SMW Jan 23 2016)
+### from AthenaMonitoring.DQMonFlags import DQMonFlags
+### DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(True)
+
 
 ## main online reco scripts
 include ("RecExOnline/RecExOnline_jobOptions.py")
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_HItest.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_HItest.py
new file mode 100644
index 000000000000..8013375f7fd8
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_HItest.py
@@ -0,0 +1,235 @@
+
+
+## -- Overview of all default local settings that one can change 
+## -- The default values are also shown.
+
+
+
+## ------------------------------------------- flags set in: RecExOnline_jobOptions.py  
+isOnline          = False
+isOnlineStateless = False
+
+# for testing on lxplus
+isOfflineTest     = True
+
+## ------------------------------------------- flags set in: RecExOnline_monitoring.py  
+isGlobalMonitoring = False
+
+#eMon can only be used ONLINE (please see RecExOnline_Partition_Online.py)
+useEmon           = False
+useAtlantisEmon   = False
+
+evtMax            = 100
+###evtMax            = vars().get('inpuevtMax', 200)
+###evtMax            = -1
+
+## ------------------------------------------- flags set in: RecExOnline_globalconfig.py  (from RecExOnline_jobOptions.py)
+#read the pickle file if you want to use the AMI tag info
+#stored in ami_recotrf.pickle (produced by 'tct_getAmiTag.py f140 ami_recotrf.cmdargs ami_recotrf.pickle') 
+usePickleConfig   = False
+pickleconfigfile  = './ami_recotrf.pickle'
+DataSource        = 'data'
+InputFormat       = 'bytestream'
+
+## cosmic
+## fileName          = '/afs/cern.ch/work/c/cylin/public/data15_cos.00258389.express_express.merge.RAW._lb0894._SFO-ALL._0001.1'
+
+## collision
+### fileName          = '/afs/cern.ch/work/c/cylin/public/data15_comm.00264034.express_express.merge.RAW._lb0784._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/c/cylin/public/data/data15_13TeV.00270953.express_express.merge.RAW._lb0265._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/s/smwang/public/DQM/data/data15_13TeV.00284154.express_express.merge.RAW._lb0218._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/s/smwang/public/DQM/data/data15_13TeV.00284484.express_express.merge.RAW._lb0098._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/y/yunju/public/GM_raw2016/data16_13TeV.00302347.express_express.merge.RAW._lb0432._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/d/derendar/public/data16_13TeV.00305359.physics_MinBias.daq.RAW._lb0516._SFO-1._0001.data'
+fileName          = '/afs/cern.ch/work/s/smwang/public/DQM/data/data15_hi.00287259.express_express.merge.RAW._lb0596._SFO-ALL._0001.1'
+###fileName          = '/afs/cern.ch/work/w/wlampl/public/HIPTests/data13_hip.00218048.physics_HardProbes.merge.RAW._lb0845._SFO-7._0001.1'
+
+###
+### fileName          = 'root://eosatlas.cern.ch//eos/atlas/atlastier0/rucio/data15_13TeV/express_express/00284484/data15_13TeV.00284484.express_express.merge.RAW/data15_13TeV.00284484.express_express.merge.RAW._lb0487._SFO-ALL._0001.1'
+
+##
+#fileName          = '/afs/cern.ch/user/k/koutsman/OnlineNightly/data/data12_8TeV.00208931.express_express.daq.RAW._lb0123._SFO-9._0001.data'
+#fileName          = 'root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/tct/rec_input/00204416/express_express/data12_8TeV.00204416.express_express.merge.RAW._lb0015._SFO-ALL._0001.1'
+
+
+#beamType          = 'cosmics'
+#projectName       = 'data15_cos'
+beamType          = 'collisions'  #AK: 21-05-2014
+### projectName       = 'data15_comm'
+###projectName       = 'data15_13TeV'
+projectName       = 'data15_hi'
+###projectName       = 'data16_13TeV'
+###projectName       = 'data13_hip'
+
+
+### Online
+### ConditionsTag     = 'CONDBR2-HLTP-2015-03'
+###
+### Offline
+### ConditionsTag     = 'CONDBR2-ES1PA-2015-03'
+### ConditionsTag     = 'CONDBR2-ES1PA-2015-04'
+### ConditionsTag     = 'CONDBR2-ES1PA-2015-07'  ### 2015-06-17
+###
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-03'
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-04'
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-09'  ### 2015-06-25
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-11'  ### 2015-07-30
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-14'  ### 2015-08-31
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-15'  ### 2015-09-06
+### ConditionsTag     = 'CONDBR2-BLKPA-2016-06'  ### 2016-02-26
+ConditionsTag     = 'CONDBR2-BLKPA-2016-18'  ### 2016-09-15
+#
+### ConditionsTag = 'COMCOND-BLKPA-RUN1-09'
+
+### DetDescrVersion   = 'ATLAS-R2-2015-02-00-00'
+DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'
+### DetDescrVersion = 'ATLAS-GEO-18-01-01'
+### DetDescrVersion = 'ATLAS-R1-2012-02-00-00' 
+
+
+
+doESD             = True
+writeESD          = False
+doAOD             = False
+writeAOD          = False
+IOVDbSvcMessage   = False
+
+## ------------------------------------------ flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
+doAllReco   = True
+
+doInDet     = doAllReco
+doMuon      = doAllReco
+doLArg      = doAllReco
+doTile      = doAllReco
+doHist      = doAllReco
+doEgammaTau = doAllReco
+
+#doInDet     = False
+#doMuon      = False
+#doLArg      = False
+#doTile      = False
+#doHist      = False
+#doEgammaTau = False
+
+doTrigger   = doAllReco
+### doTrigger   = False
+
+doJiveXML   = False
+
+doHIRec     = doAllReco
+### doHIRec     = False
+
+#set to True in the JO
+#doCommissionig = False
+
+## ------------------------------------------ flags set in : RecExOnline_monitoring.py (from from RecExOnline_jobOptions.py)
+doAllMon  = True
+
+doCaloMon = doAllMon
+doTileMon = doAllMon
+doPhysMon = doAllMon
+doIDMon   = doAllMon
+doTRTMon  = doAllMon
+doMuonMon = doAllMon
+
+#doCaloMon = False
+#doTileMon = False
+#doPhysMon = False
+#doIDMon   = False
+#doTRTMon  = False
+#doMuonMon = False
+
+
+doTrigMon = doAllMon
+### doTrigMon = False
+
+doCTPMon  = False
+
+doHIMon   = doAllMon
+### doHIMon   = False # doAllMon
+
+#  if DQMonFlags.doPixelMon() or DQMonFlags.doSCTMon() or DQMonFlags.doTRTMon() or \
+#               DQMonFlags.doInDetGlobalMon() or DQMonFlags.doInDetAlignMon():
+
+## ------------------------------------------ flags set in : RecExOnline_postconfig.py    (called from RecExOnline_jobOptions.py)
+
+#### CHANGES TO GET 19.1.0.1 RECO WORKING (M4)
+from AthenaCommon.BeamFlags import jobproperties
+jobproperties.Beam.beamType.set_Value_and_Lock(beamType)
+
+from AthenaCommon.GlobalFlags import globalflags
+globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+globalflags.ConditionsTag.set_Value_and_Lock(ConditionsTag)
+globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion)
+
+
+from AthenaCommon.BFieldFlags import jobproperties
+jobproperties.BField.barrelToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.endcapToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.solenoidOn.set_Value_and_Lock(True)
+###jobproperties.BField.solenoidOn.set_Value_and_Lock(False)
+
+
+from CaloRec.CaloCellFlags import jobproperties
+jobproperties.CaloCellFlags.doLArHVCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)  ####? for trigger, added 11th March, 2015, by CY
+jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False)  ### for Heavy Ion
+
+
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True)
+InDetFlags.useBroadClusterErrors.set_Value_and_Lock(False)
+
+
+from AthenaMonitoring.DQMonFlags import DQMonFlags
+DQMonFlags.doStreamAwareMon.set_Value_and_Lock(False)
+DQMonFlags.enableLumiAccess.set_Value_and_Lock(False)
+DQMonFlags.doCTPMon.set_Value_and_Lock(False)
+DQMonFlags.doLVL1CaloMon.set_Value_and_Lock(False)
+### DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(False) #xx
+DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(True) #xx
+### DQMonFlags.doJetTagMon.set_Value_and_Lock(False)
+#print "#### yunju Here is DQMonFlags.monManEnvironment:"+DQMonFlags.monManEnvironment
+## for egmma monitoring in lxplus
+DQMonFlags.monManEnvironment.set_Value_and_Lock('tier0')
+
+
+from RecExConfig.RecFlags import rec
+rec.doBTagging.set_Value_and_Lock(True)
+rec.doHIP.set_Value_and_Lock(True)
+
+
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useBTagging.set_Value_and_Lock(True)
+
+### from JetRec.JetRecFlags import jetFlags
+### jetFlags.useTracks.set_Value_and_Lock(False)
+
+
+from MuonDQAMonFlags.MuonDQAProperFlags import MuonDQADetFlags
+### MuonDQADetFlags.doMDTTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCMon.set_Value_and_Lock(True)
+
+##---------------------------------------ID suggestion from Alex 18.Feb.2015  --------
+jobproperties.InDetJobProperties.doTrackSegmentsSCT.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsPixel.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsTRT.set_Value_and_Lock(False)
+
+##---------------------------------------Bunch Spacing 25ns  --------
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.InDet25nsec.set_Value_and_Lock(True)
+
+jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25)
+
+# --------------------------------------------- Monitoring
+### replaced by MuonTrackMonitoring (SMW Jan 23 2016)
+### from AthenaMonitoring.DQMonFlags import DQMonFlags
+### DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(True)
+
+
+## main online reco scripts
+include ("RecExOnline/RecExOnline_jobOptions_HItest.py")
+
+include ("HIRecExample/hip_outputPostExec.py")
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_RunHI.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_RunHI.py
new file mode 100644
index 000000000000..753c8a1abee4
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_RunHI.py
@@ -0,0 +1,230 @@
+
+
+## -- Overview of all default local settings that one can change 
+## -- The default values are also shown.
+
+## --setting for HI
+isHI_2016 =True
+
+## ------------------------------------------- flags set in: RecExOnline_jobOptions.py  
+isOnline          = False
+isOnlineStateless = False
+
+# for testing on lxplus
+isOfflineTest     = True
+
+## ------------------------------------------- flags set in: RecExOnline_monitoring.py  
+isGlobalMonitoring = False
+
+#eMon can only be used ONLINE (please see RecExOnline_Partition_Online.py)
+useEmon           = False
+useAtlantisEmon   = False
+
+#evtMax            = 100
+evtMax            = vars().get('inpuevtMax', 200)
+###evtMax            = -1
+
+## ------------------------------------------- flags set in: RecExOnline_globalconfig.py  (from RecExOnline_jobOptions.py)
+#read the pickle file if you want to use the AMI tag info
+#stored in ami_recotrf.pickle (produced by 'tct_getAmiTag.py f140 ami_recotrf.cmdargs ami_recotrf.pickle') 
+usePickleConfig   = False
+pickleconfigfile  = './ami_recotrf.pickle'
+DataSource        = 'data'
+InputFormat       = 'bytestream'
+
+## cosmic
+## fileName          = '/afs/cern.ch/work/c/cylin/public/data15_cos.00258389.express_express.merge.RAW._lb0894._SFO-ALL._0001.1'
+
+## collision
+### fileName          = '/afs/cern.ch/work/c/cylin/public/data15_comm.00264034.express_express.merge.RAW._lb0784._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/c/cylin/public/data/data15_13TeV.00270953.express_express.merge.RAW._lb0265._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/s/smwang/public/DQM/data/data15_13TeV.00284154.express_express.merge.RAW._lb0218._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/s/smwang/public/DQM/data/data15_13TeV.00284484.express_express.merge.RAW._lb0098._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/y/yunju/public/GM_raw2016/data16_13TeV.00302347.express_express.merge.RAW._lb0432._SFO-ALL._0001.1'
+### fileName          = '/afs/cern.ch/work/d/derendar/public/data16_13TeV.00305359.physics_MinBias.daq.RAW._lb0516._SFO-1._0001.data'
+fileName          = '/afs/cern.ch/work/s/smwang/public/DQM/data/data15_hi.00287259.express_express.merge.RAW._lb0596._SFO-ALL._0001.1'
+###fileName          = '/afs/cern.ch/work/w/wlampl/public/HIPTests/data13_hip.00218048.physics_HardProbes.merge.RAW._lb0845._SFO-7._0001.1'
+
+###
+### fileName          = 'root://eosatlas.cern.ch//eos/atlas/atlastier0/rucio/data15_13TeV/express_express/00284484/data15_13TeV.00284484.express_express.merge.RAW/data15_13TeV.00284484.express_express.merge.RAW._lb0487._SFO-ALL._0001.1'
+
+##
+#fileName          = '/afs/cern.ch/user/k/koutsman/OnlineNightly/data/data12_8TeV.00208931.express_express.daq.RAW._lb0123._SFO-9._0001.data'
+#fileName          = 'root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/tct/rec_input/00204416/express_express/data12_8TeV.00204416.express_express.merge.RAW._lb0015._SFO-ALL._0001.1'
+
+
+#beamType          = 'cosmics'
+#projectName       = 'data15_cos'
+beamType          = 'collisions'  #AK: 21-05-2014
+### projectName       = 'data15_comm'
+###projectName       = 'data15_13TeV'
+projectName       = 'data16_13TeV'
+
+if isHI_2016 :
+   projectName       = 'data15_hi'
+###projectName       = 'data16_13TeV'
+###projectName       = 'data13_hip'
+
+
+### Online
+### ConditionsTag     = 'CONDBR2-HLTP-2015-03'
+###
+### Offline
+### ConditionsTag     = 'CONDBR2-ES1PA-2015-03'
+### ConditionsTag     = 'CONDBR2-ES1PA-2015-04'
+### ConditionsTag     = 'CONDBR2-ES1PA-2015-07'  ### 2015-06-17
+###
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-03'
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-04'
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-09'  ### 2015-06-25
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-11'  ### 2015-07-30
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-14'  ### 2015-08-31
+### ConditionsTag     = 'CONDBR2-BLKPA-2015-15'  ### 2015-09-06
+### ConditionsTag     = 'CONDBR2-BLKPA-2016-06'  ### 2016-02-26
+ConditionsTag     = 'CONDBR2-BLKPA-2016-06'  ### 2016-02-26
+if isHI_2016:
+   ConditionsTag     = 'CONDBR2-BLKPA-2016-18'  ### 2016-09-15
+#
+### ConditionsTag = 'COMCOND-BLKPA-RUN1-09'
+
+### DetDescrVersion   = 'ATLAS-R2-2015-02-00-00'
+DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'
+### DetDescrVersion = 'ATLAS-GEO-18-01-01'
+### DetDescrVersion = 'ATLAS-R1-2012-02-00-00' 
+
+
+
+doESD             = True
+writeESD          = False
+doAOD             = False
+writeAOD          = False
+IOVDbSvcMessage   = False
+
+## ------------------------------------------ flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py)
+doAllReco   = True
+doInDet     = doAllReco
+doMuon      = doAllReco
+doLArg      = doAllReco
+doTile      = doAllReco
+doTrigger   = doAllReco
+doHist      = doAllReco
+doJiveXML   = False
+doEgammaTau = doAllReco
+
+#doInDet     = False
+#doMuon      = False
+#doLArg      = False
+#doTile      = False
+#doHist      = False
+#doEgammaTau = False
+
+### doTrigger   = False
+
+if isHI_2016:
+   doHIRec     = doAllReco
+### doHIRec     = False
+
+#set to True in the JO
+#doCommissionig = False
+
+## ------------------------------------------ flags set in : RecExOnline_monitoring.py (from from RecExOnline_jobOptions.py)
+doAllMon  = True
+doCaloMon = doAllMon
+doTileMon = doAllMon
+doPhysMon = doAllMon
+doTrigMon = doAllMon
+doIDMon   = doAllMon
+doTRTMon  = doAllMon
+doMuonMon = doAllMon
+doCTPMon  = False
+if isHI_2016:
+  doHIMon   = doAllMon
+### doHIMon   = False # doAllMon
+
+#  if DQMonFlags.doPixelMon() or DQMonFlags.doSCTMon() or DQMonFlags.doTRTMon() or \
+#               DQMonFlags.doInDetGlobalMon() or DQMonFlags.doInDetAlignMon():
+
+## ------------------------------------------ flags set in : RecExOnline_postconfig.py    (called from RecExOnline_jobOptions.py)
+
+#### CHANGES TO GET 19.1.0.1 RECO WORKING (M4)
+from AthenaCommon.BeamFlags import jobproperties
+jobproperties.Beam.beamType.set_Value_and_Lock(beamType)
+
+from AthenaCommon.GlobalFlags import globalflags
+globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+globalflags.ConditionsTag.set_Value_and_Lock(ConditionsTag)
+globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion)
+
+
+from AthenaCommon.BFieldFlags import jobproperties
+jobproperties.BField.barrelToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.endcapToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.solenoidOn.set_Value_and_Lock(True)
+###jobproperties.BField.solenoidOn.set_Value_and_Lock(False)
+
+
+from CaloRec.CaloCellFlags import jobproperties
+jobproperties.CaloCellFlags.doLArHVCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)  ####? for trigger, added 11th March, 2015, by CY
+if isHI_2016:
+   jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False)  ### for Heavy Ion
+
+
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True)
+InDetFlags.useBroadClusterErrors.set_Value_and_Lock(False)
+
+
+from AthenaMonitoring.DQMonFlags import DQMonFlags
+DQMonFlags.doStreamAwareMon.set_Value_and_Lock(False)
+DQMonFlags.enableLumiAccess.set_Value_and_Lock(False)
+DQMonFlags.doCTPMon.set_Value_and_Lock(False)
+DQMonFlags.doLVL1CaloMon.set_Value_and_Lock(False)
+### DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(False) #xx
+DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(True) #xx
+### DQMonFlags.doJetTagMon.set_Value_and_Lock(False)
+#print "#### yunju Here is DQMonFlags.monManEnvironment:"+DQMonFlags.monManEnvironment
+## for egmma monitoring in lxplus
+DQMonFlags.monManEnvironment.set_Value_and_Lock('tier0')
+
+
+from RecExConfig.RecFlags import rec
+rec.doBTagging.set_Value_and_Lock(True)
+if isHI_2016:
+   rec.doHIP.set_Value_and_Lock(True)
+
+
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useBTagging.set_Value_and_Lock(True)
+
+### from JetRec.JetRecFlags import jetFlags
+### jetFlags.useTracks.set_Value_and_Lock(False)
+
+
+from MuonDQAMonFlags.MuonDQAProperFlags import MuonDQADetFlags
+### MuonDQADetFlags.doMDTTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCMon.set_Value_and_Lock(True)
+
+##---------------------------------------ID suggestion from Alex 18.Feb.2015  --------
+jobproperties.InDetJobProperties.doTrackSegmentsSCT.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsPixel.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsTRT.set_Value_and_Lock(False)
+
+##---------------------------------------Bunch Spacing 25ns  --------
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.InDet25nsec.set_Value_and_Lock(True)
+
+jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25)
+
+# --------------------------------------------- Monitoring
+### replaced by MuonTrackMonitoring (SMW Jan 23 2016)
+### from AthenaMonitoring.DQMonFlags import DQMonFlags
+### DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(True)
+
+
+## main online reco scripts
+include ("RecExOnline/RecExOnline_jobOptions.py")
+if isHI_2016:
+   include ("HIRecExample/hip_outputPostExec.py")
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_isOnlineTrue.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_isOnlineTrue.py
index bb38f16a5eb1..77b5a3a3dc77 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_isOnlineTrue.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_isOnlineTrue.py
@@ -4,7 +4,12 @@
 
 ## ------------------------------------------- flags set in: RecExOnline_jobOptions.py  
 isOnline          = True
-isOnlineStateless = False
+
+### isOnlineStateless = False
+isOnlineStateless = True
+
+# for testing on lxplus
+isOfflineTest     = True
 
 ## ------------------------------------------- flags set in: RecExOnline_monitoring.py  
 isGlobalMonitoring = False
@@ -12,7 +17,7 @@ isGlobalMonitoring = False
 #eMon can only be used ONLINE (please see RecExOnline_Partition_Online.py)
 useEmon           = False
 useAtlantisEmon   = False
-evtMax            = 10 #100
+evtMax            = 100
 
 keycount          = 250
 buffersize        = 10
@@ -24,8 +29,27 @@ streamName        ='express_express'
 
 
 #COND tag and GEO are needed for running over a test partition or against ATLAS cosmics, calib
-ConditionsTag     = 'COMCOND-HLTP-004-03'  # was -01
-DetDescrVersion   = 'ATLAS-R1-2012-03-01-00'
+#ConditionsTag     = 'CONDBR2-ES1PA-2015-03'
+#ConditionsTag     = 'CONDBR2-HLTP-2015-03'    # online database
+#ConditionsTag     = 'CONDBR2-HLTP-2015-07'   # created 2015-08-10
+ConditionsTag     = 'CONDBR2-HLTP-2015-08'   # created 2015-11-04, used in M10
+#ConditionsTag     = 'CONDBR2-HLTP-2016-01'   # 2016-02-05 Based on CONDBR2-HLTP-2015-08, for M11. 
+#ConditionsTag     = 'CONDBR2-BLKPA-2016-06'
+
+#DetDescrVersion   = 'ATLAS-R2-2015-02-00-00'
+DetDescrVersion   = 'ATLAS-R2-2015-03-01-00'
+
+##
+## Beam Type and Project Name
+##
+#beamType          = 'cosmics'
+#projectName       = 'data15_cos'
+##
+beamType          = 'collisions'
+projectName       = 'data15_comm'
+
+
+
 if (not 'beamType' in dir()):
     beamType = 'collisions'
 
@@ -37,16 +61,33 @@ pickleconfigfile  = './ami_recotrf.pickle'
 DataSource        = 'data'
 InputFormat       = 'bytestream'
 #fileName          = '/afs/cern.ch/user/k/koutsman/OnlineNightly/data/data12_8TeV.00208931.express_express.daq.RAW._lb0123._SFO-9._0001.data'
-fileName          = 'root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/tct/rec_input/00204416/express_express/data12_8TeV.00204416.express_express.merge.RAW._lb0015._SFO-ALL._0001.1'
-from RecExConfig.RecFlags import rec
-rec.RunNumber.set_Value (204416)
+#fileName          = 'root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/tct/rec_input/00204416/express_express/data12_8TeV.00204416.express_express.merge.RAW._lb0015._SFO-ALL._0001.1'
+
+## cosmic
+## fileName          = '/afs/cern.ch/work/c/cylin/public/data15_cos.00258389.express_express.merge.RAW._lb0894._SFO-ALL._0001.1'
+###
+## collision
+### fileName          = '/afs/cern.ch/work/c/cylin/public/data15_comm.00264034.express_express.merge.RAW._lb0784._SFO-ALL._0001.1'
+#fileName          = '/afs/cern.ch/work/s/smwang/public/DQM/data/data15_13TeV.00284484.express_express.merge.RAW._lb0098._SFO-ALL._0001.1'
+### fileName          = 'root://eosatlas.cern.ch//eos/atlas/atlastier0/rucio/data15_13TeV/express_express/00284484/data15_13TeV.00284484.express_express.merge.RAW/data15_13TeV.00284484.express_express.merge.RAW._lb0487._SFO-ALL._0001.1'
+### projectName       = 'data15_comm'
+#projectName       = 'data15_13TeV'
+
+fileName          = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExOnline/data16_13TeV.00302347.express_express.merge.RAW._lb0432._SFO-ALL._0001.1'
+projectName       = 'data16_13TeV'
+
 
 # update for comsics
 if beamType == 'cosmics':
-    fileName          = '/afs/cern.ch/atlas/offline/test/data11_cos.00182609.physics_CosmicCalo.merge.RAW._lb0100._SFO-ALL._0001.1.SFO-ALL._0001.1.10evts.data'
-    streamName        ='CosmicCalo_physics'
-    rec.RunNumber.set_Value (182609)
+    ### fileName          = '/afs/cern.ch/atlas/offline/test/data11_cos.00182609.physics_CosmicCalo.merge.RAW._lb0100._SFO-ALL._0001.1.SFO-ALL._0001.1.10evts.data '
+    ### fileName          = '/afs/cern.ch/work/c/cylin/public/data15_cos.00258389.express_express.merge.RAW._lb0894._SFO-ALL._0001.1'
+    fileName          = '/afs/cern.ch/work/s/smwang/public/DQM/data/data15_cos.00287824.express_express.merge.RAW._lb0015._SFO-ALL._0001.1'
+    ### fileName          = 'root://eosatlas.cern.ch//eos/atlas/atlastier0/rucio/data15_cos/express_express/00287824/data15_cos.00287824.express_express.merge.RAW/data15_cos.00287824.express_express.merge.RAW._lb0015._SFO-ALL._0001.1'
+    ### streamName        ='CosmicCalo_physics'
+    streamName        ='express_express'
+    projectName       = 'data15_cos'
     
+
 doESD             = True
 writeESD          = False
 doAOD             = False
@@ -59,7 +100,7 @@ doInDet     = doAllReco
 doMuon      = doAllReco
 doLArg      = doAllReco
 doTile      = doAllReco
-doTrigger   = False
+doTrigger   = doAllReco
 doHist      = doAllReco
 doJiveXML   = False
 doEgammaTau = doAllReco
@@ -71,7 +112,7 @@ doEgammaTau = doAllReco
 doAllMon  = True
 doCaloMon = doAllMon
 doPhysMon = doAllMon
-doTrigMon = False
+doTrigMon = doAllMon
 doIDMon   = doAllMon
 doTRTMon  = doAllMon
 doMuonMon = doAllMon
@@ -79,29 +120,85 @@ doMuonMon = doAllMon
 
 ## ------------------------------------------ flags set in : RecExOnline_postconfig.py    (called from RecExOnline_jobOptions.py)
 
-
 #### CHANGES TO GET 19.1.0.1 RECO WORKING (M4)
+from AthenaCommon.BeamFlags import jobproperties
+jobproperties.Beam.beamType.set_Value_and_Lock(beamType)
+
+#from AthenaCommon.GlobalFlags import globalflags
+#globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+#globalflags.ConditionsTag.set_Value_and_Lock(ConditionsTag)
+#globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion)
+
+
+from AthenaCommon.BFieldFlags import jobproperties
+jobproperties.BField.barrelToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.endcapToroidOn.set_Value_and_Lock(True)
+jobproperties.BField.solenoidOn.set_Value_and_Lock(True)
+###jobproperties.BField.solenoidOn.set_Value_and_Lock(False)
+
+
+from CaloRec.CaloCellFlags import jobproperties
+jobproperties.CaloCellFlags.doLArHVCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False)
+jobproperties.CaloCellFlags.doLArDeadOTXCorr.set_Value_and_Lock(False)  ####? for trigger, added 11th March, 2015, by CY
+
+
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True)
+InDetFlags.useBroadClusterErrors.set_Value_and_Lock(False)
+
+
 from AthenaMonitoring.DQMonFlags import DQMonFlags
-DQMonFlags.doMuonCombinedMon.set_Value_and_Lock(False)
-DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(False)
+DQMonFlags.doStreamAwareMon.set_Value_and_Lock(False)
+DQMonFlags.enableLumiAccess.set_Value_and_Lock(False)
+DQMonFlags.doCTPMon.set_Value_and_Lock(False)
+DQMonFlags.doLVL1CaloMon.set_Value_and_Lock(False)
+### DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(False) #xx
+DQMonFlags.doMuonTrkPhysMon.set_Value_and_Lock(True) #xx
+### DQMonFlags.doJetTagMon.set_Value_and_Lock(False)
+
+
+from RecExConfig.RecFlags import rec
+rec.doBTagging.set_Value_and_Lock(True)
+
+from JetRec.JetRecFlags import jetFlags
+jetFlags.useBTagging.set_Value_and_Lock(True)
+
 
-# Doesn't work with run 1 data (conditions issue).
+###from JetRec.JetRecFlags import jetFlags
+###jetFlags.useTracks.set_Value_and_Lock(False)
+
+
+from MuonDQAMonFlags.MuonDQAProperFlags import MuonDQADetFlags
+### MuonDQADetFlags.doMDTTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCL1Mon.set_Value_and_Lock(True)
+MuonDQADetFlags.doTGCMon.set_Value_and_Lock(True)
+
+
+### from AthenaMonitoring.DQMonFlags import DQMonFlags
+### DQMonFlags.doMuonCombinedMon.set_Value_and_Lock(False)
+### DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(False)
+### #DQMonFlags.doIDMon.set_Value_and_Lock(False)
+
+##---------------------------------------ID suggestion from Alex 18.Feb.2015  --------
+jobproperties.InDetJobProperties.doTrackSegmentsSCT.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsPixel.set_Value_and_Lock(False)
+jobproperties.InDetJobProperties.doTrackSegmentsTRT.set_Value_and_Lock(False)
+
+
+##---------------------------------------Bunch Spacing 25ns  --------
 from InDetRecExample.InDetJobProperties import InDetFlags
-InDetFlags.doTIDE_Ambi.set_Value_and_Lock(False)
+InDetFlags.InDet25nsec.set_Value_and_Lock(True)
+
+jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25)
+
+# --------------------------------------------- Monitoring
+### replaced by MuonTrackMonitoring (SMW Jan 23 2016)
+### from AthenaMonitoring.DQMonFlags import DQMonFlags
+### DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(True)
 
-from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
-preExec = ['cfg =  TriggerConfigGetter(); cfg.setupxAODWriting()']
 
 ## main online reco scripts
 include ("RecExOnline/RecExOnline_jobOptions.py")
 
-from TrigConfxAOD.TrigConfxAODConf import TrigConf__xAODMenuWriter
-w=TrigConf__xAODMenuWriter()
-w.MetaDataStore='InputMetaDataStore'
-topSequence.remove(w)
-from AthenaCommon import AlgSequence
-athBeginSeq = AlgSequence.AthSequencer('AthBeginSeq')
-athBeginSeq += w
 
-ToolSvc.GSFBuildPixelToTPIDTool.ReadFromCOOL=False
-ToolSvc.CombinedMuonPixelToTPID.ReadFromCOOL=False
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_emonsvc.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_emonsvc.py
index 654e655c4e4f..3a25d3e1c211 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_emonsvc.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_emonsvc.py
@@ -177,7 +177,10 @@ else:
 # ############################################
 # A list of stream tag names
 # ############################################
-ByteStreamEmonInputSvc.StreamNames = streamName.split(':')
+if (streamName == ""):
+    ByteStreamEmonInputSvc.StreamNames = list()
+else:
+    ByteStreamEmonInputSvc.StreamNames = streamName.split(':')
 
 # #################################################
 # Shall athena exit if the partition is shutdown ?
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig.py
index 089ee0005306..5a6186194e51 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig.py
@@ -31,14 +31,18 @@ if (not 'isOnlineStateless' in dir()):
 if (not 'beamType' in dir()):
     beamType = 'collisions'
 
+#if (not 'is_T0_project_tag' in dir()):
+#    is_T0_project_tag = 'data12_8TeV'
+
 if (not 'is_T0_project_tag' in dir()):
-    is_T0_project_tag = 'data12_8TeV'
+    is_T0_project_tag = 'data15_cos'
 
+### tag created 2015-11-04 : Based on CONDBR2-HLTP-2015-07, TRT folders for rel. 20.7 were added and updated.
 if (not 'ConditionsTag' in dir()):
-    ConditionsTag = 'COMCOND-HLTP-004-01'
+    ConditionsTag = 'CONDBR2-HLTP-2015-08'
 
 if (not 'DetDescrVersion' in dir()):
-    DetDescrVersion = 'ATLAS-GEO-20-00-01'
+    DetDescrVersion = 'ATLAS-R2-2015-03-01-00'
 
 if (not 'doPixelOnlyMon' in dir()):
     doPixelOnlyMon = False
@@ -46,6 +50,10 @@ if (not 'doPixelOnlyMon' in dir()):
 if (not 'REO_doAutoConfiguration' in dir()):
     REO_doAutoConfiguration = False
 
+### harmonize conditions tag and geometry for all monitoring jobs; 26 May 2017
+DetDescrVersion = 'ATLAS-R2-2016-01-00-01' # for new ID alignment 26 May 2017
+if isOnline:
+    ConditionsTag = 'CONDBR2-HLTP-2017-03' # for new ID alignment 26 May 2017
 
 ## -------------------------------------------------------------------
 ## configuration from pickle file
@@ -98,7 +106,6 @@ try:
     sys.setdlopenflags(newflags)
 except:
     logRecExOnline_globalconfig.info("sys.setdlopenflags(newflags) failed with newflags=%s" % newflags )
-
 #import dl
 #sys.setdlopenflags(dl.RTLD_GLOBAL | dl.RTLD_NOW)
 
@@ -109,8 +116,13 @@ from AthenaCommon.BFieldFlags import jobproperties
 FirstSample = 3
 NSamples = 5
 
-#if (useEmon and (partitionName == 'ATLAS' or partitionName == 'TDAQ')):
-if (useEmon and (partitionName == 'ATLAS')):
+### initialize flags before SetupField to choose correct condition tag database. 5 May 2017
+from AthenaCommon.GlobalFlags import globalflags
+from AthenaCommon.AthenaCommonFlags import jobproperties,athenaCommonFlags
+globalflags.DataSource.set_Value_and_Lock(DataSource)
+athenaCommonFlags.isOnline = isOnline
+
+if (useEmon and (partitionName == 'ATLAS' or partitionName == 'ATLAS_MP1')):
     import ispy
     from ispy import *
     from ipc import IPCPartition
@@ -125,9 +137,6 @@ if (useEmon and (partitionName == 'ATLAS')):
     logRecExOnline_globalconfig.info("is_run_number = %s" % is_run_number)
     logRecExOnline_globalconfig.info("is_beam_type = %s" % is_beam_type)
     logRecExOnline_globalconfig.info("is_T0_project_tag = %s" % is_T0_project_tag)
-##     print 'is_run_number', is_run_number
-##     print 'is_beam_type', is_beam_type
-##     print 'is_T0_project_tag', is_T0_project_tag
 
     part_name = 'initial'
     p = IPCPartition(part_name)
@@ -137,51 +146,54 @@ if (useEmon and (partitionName == 'ATLAS')):
     solenoidInvalid = 1
 
     # AL playing around: start
-    toroidCurrent   = ispy.ISInfoDynAny(p2, 'DdcFloatInfo')
-    solenoidCurrent = ispy.ISInfoDynAny(p2, 'DdcFloatInfo')
-    toroidInvalid   = ispy.ISInfoDynAny(p2, 'DdcIntInfo')
-    solenoidInvalid = ispy.ISInfoDynAny(p2, 'DdcIntInfo')
-    
-    toroidInvalid.value=1
-    solenoidInvalid.value=1
+    #toroidCurrent   = ispy.ISInfoDynAny(p2, 'DdcFloatInfo')
+    #solenoidCurrent = ispy.ISInfoDynAny(p2, 'DdcFloatInfo')
+    #toroidInvalid   = ispy.ISInfoDynAny(p2, 'DdcIntInfo')
+    #solenoidInvalid = ispy.ISInfoDynAny(p2, 'DdcIntInfo')
+    solenoidCurrent = ISObject(p,'DCS_GENERAL.MagnetSolenoidCurrent.value','DdcFloatInfo')
+    solenoidCurrent.checkout()
+    toroidCurrent = ISObject(p,'DCS_GENERAL.MagnetToroidsCurrent.value','DdcFloatInfo')
+    toroidCurrent.checkout()
+    solenoidInvalid = ISObject(p,'DCS_GENERAL.MagnetSolenoidCurrent.invalid','DdcIntInfo')
+    solenoidInvalid.checkout()
+    toroidInvalid = ISObject(p,'DCS_GENERAL.MagnetToroidsCurrent.invalid','DdcIntInfo')
+    toroidInvalid.checkout()
+
+    #toroidInvalid.value=1
+    #solenoidInvalid.value=1
     # AL playing around: end
-    
+
 
     logRecExOnline_globalconfig.info("toroidCurrent = %f", toroidCurrent.value)
     logRecExOnline_globalconfig.info("toroidInvalid = %f", toroidInvalid.value)
     logRecExOnline_globalconfig.info("solenoidCurrent = %f", solenoidCurrent.value)
     logRecExOnline_globalconfig.info("solenoidInvalid = %f", solenoidInvalid.value)
-    
-    from BFieldAth.BFieldAthConf import MagFieldAthenaSvc
-    svcMgr += MagFieldAthenaSvc(SetupCOOL=True, NameOfTheSource='COOL_HLT', onlineSolCur=solenoidCurrent.value, onlineTorCur=toroidCurrent.value)
-
-## # ---> AK
-## # LArMon stuff
-## # CaloMon problems of setting up FirstSample
-##     import ispy
-##     from ispy import *
-##     from ipc import IPCPartition
-##     from ispy import ISObject
+
+    #from BFieldAth.BFieldAthConf import MagFieldAthenaSvc
+    #svcMgr += MagFieldAthenaSvc(SetupCOOL=True, NameOfTheSource='COOL_HLT', onlineSolCur=solenoidCurrent.value, onlineTorCur=toroidCurrent.value)
+    import MagFieldServices.SetupField # New magnetic field service. 5 May 2017
 
     try:
-        p3 = IPCPartition("ATLAS")
-        x = ISObject(p3, 'LargParams.LArg.RunLogger.GlobalParams', 'GlobalParamsInfo')
+        p3 = IPCPartition(partitionName)
+        x = ISObject(p3, 'LArParams.LAr.RunLogger.GlobalParams', 'GlobalParamsInfo')
         x.checkout()
         FirstSample = x.firstSample
         NSamples = x.nbOfSamples
+        Format = x.format
     except:
-        logRecExOnline_globalconfig.info("Could not find IS Parameters for LargParams.LArg.RunLogger.GlobalParams - Set default flags (FirstSample=3, NSamples=5")
- 
-# ---> AK
-          
+        logRecExOnline_globalconfig.info("Could not find IS Parameters for LArParams.LAr.RunLogger.GlobalParams - Set default flags (FirstSample=3, NSamples=5")
+
+    # for beam splash when LAr in "transparent" ROD mode  (5 May 2017)
+    if 'Format' in dir() and Format == 0:
+        from LArROD.LArRODFlags import larRODFlags
+        larRODFlags.keepDSPRaw.set_Value_and_Lock(False)
+
+
+
 
 # ----------------------------------------------- Set Run configuration
 
 ## Second, fall back to manual configuration or default values
-from AthenaCommon.GlobalFlags import globalflags
-from AthenaCommon.AthenaCommonFlags import jobproperties,athenaCommonFlags
-
-globalflags.DataSource.set_Value_and_Lock(DataSource)
 globalflags.InputFormat.set_Value_and_Lock(InputFormat)
 
 if not useEmon:
@@ -197,12 +209,13 @@ THistSvc.OutputLevel = ERROR
 from InDetRecExample.InDetJobProperties import InDetFlags
 InDetFlags.doPixelClusterSplitting.set_Value(False) # does not work online
 
-# ----------------------------------------------- Online flag
+## new ID alignment 26 May 2017
+from AtlasGeoModel.InDetGMJobProperties import GeometryFlags
+GeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)
 
-athenaCommonFlags.isOnline = isOnline
+# ----------------------------------------------- Online flag
 athenaCommonFlags.EvtMax.set_Value_and_Lock(evtMax)
 athenaCommonFlags.isOnlineStateless = isOnlineStateless
-
 # ----------------------------------------------- Remove DCS problems
 from InDetRecExample.InDetJobProperties import InDetFlags
 InDetFlags.useBeamConstraint.set_Value_and_Lock(False)
@@ -213,7 +226,7 @@ if athenaCommonFlags.isOnline:
     InDetFlags.useDCS.set_Value_and_Lock(False)                               # fails when true: pixel accessing Temperature info (getting fixed)
 
 # ----------------------------------------------- Special settings for pixel monitoring
-logRecExOnline_globalconfig.info("RecExOnline: flag doPixelOnlyMon = %s" %doPixelOnlyMon) 
+logRecExOnline_globalconfig.info("RecExOnline: flag doPixelOnlyMon = %s" %doPixelOnlyMon)
 if doPixelOnlyMon:
     ## force pixel on, turn off the rest of the ID:
     InDetFlags.doTrackSegmentsPixel.set_Value_and_Lock(True)
@@ -232,28 +245,48 @@ if doPixelOnlyMon:
 # ----------------------------------------------- Output flags
 from RecExConfig.RecFlags import rec
 
-if (isOnline and useEmon and (partitionName == 'ATLAS' or partitionName == 'TDAQ')):
+if (isOnline and useEmon and (partitionName == 'ATLAS' or partitionName == 'ATLAS_MP1' or partitionName == 'TDAQ')):
     rec.projectName.set_Value_and_Lock(is_T0_project_tag)
-    #rec.AutoConfiguration = ['FieldAndGeo', 'ConditionsTag', 'BeamType']
+    from AthenaCommon.BeamFlags import jobproperties
+    jobproperties.Beam.beamType.set_Value_and_Lock(beamType)
+    globalflags.ConditionsTag.set_Value_and_Lock(ConditionsTag)
+    globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion)
     rec.AutoConfiguration = ['FieldAndGeo', 'ConditionsTag', 'BeamType', 'BeamEnergy', 'LumiFlags']
 
-if (isOnline and useEmon and (partitionName != 'ATLAS' and partitionName != 'TDAQ')):
-    from AthenaCommon.BFieldFlags import jobproperties
-    jobproperties.BField.barrelToroidOn.set_Value_and_Lock(True)
-    jobproperties.BField.endcapToroidOn.set_Value_and_Lock(True)
-    jobproperties.BField.solenoidOn.set_Value_and_Lock(True)
+# ------------------------------------------------ Ensure the current in tororid and solenoid
+    from AthenaCommon.AthenaCommonFlags import jobproperties,athenaCommonFlags
+    jobproperties.BField.solenoidOn.set_Value_and_Lock( solenoidCurrent.value > 70 )
+    jobproperties.BField.barrelToroidOn.set_Value_and_Lock( toroidCurrent.value > 70 )
+    jobproperties.BField.endcapToroidOn.set_Value_and_Lock( toroidCurrent.value > 70 )
+
+    #rec.AutoConfiguration = ['FieldAndGeo', 'ConditionsTag', 'BeamType', 'BeamEnergy', 'LumiFlags']
+    #rec.AutoConfiguration = ['ConditionsTag', 'BeamType', 'BeamEnergy', 'LumiFlags']
+    logRecExOnline_globalconfig.info("RecExOnline: running with autoconfiguration ['FieldAndGeo', 'ConditionsTag', 'BeamType', 'BeamEnergy', 'LumiFlags']")
+    #logRecExOnline_globalconfig.info("RecExOnline: FieldAndGeo = %s" %FieldAndGeo)
+    #logRecExOnline_globalconfig.info("RecExOnline: ConditionsTag = %s" %ConditionsTag)
+    #logRecExOnline_globalconfig.info("RecExOnline: BeamType = %s" %BeamType)
+    #logRecExOnline_globalconfig.info("RecExOnline: BeamEnergy = %s" %BeamEnergy)
+    #logRecExOnline_globalconfig.info("RecExOnline: LumiFlags = %s" %LumiFlags)
+
+if (isOnline and useEmon and (partitionName != 'ATLAS' and partitionName != 'ATLAS_MP1' and partitionName != 'TDAQ')):
     from AthenaCommon.BeamFlags import jobproperties
     jobproperties.Beam.beamType.set_Value_and_Lock(beamType)
     globalflags.ConditionsTag.set_Value_and_Lock(ConditionsTag)
     globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion)
     rec.AutoConfiguration = ['FieldAndGeo', 'ConditionsTag', 'BeamType']
-
+#    rec.AutoConfiguration = ['ConditionsTag', 'BeamType']
+    #logRecExOnline_globalconfig.info("RecExOnline: running with autoconfiguration ['FieldAndGeo', 'ConditionsTag', 'BeamType']")
+    #logRecExOnline_globalconfig.info("RecExOnline: FieldAndGeo = %s" %FieldAndGeo)
+    #logRecExOnline_globalconfig.info("RecExOnline: ConditionsTag = %s" %ConditionsTag)
+    #logRecExOnline_globalconfig.info("RecExOnline: BeamType = %s" %BeamType)
 if (not isOnline and not useEmon) or (isOnline and REO_doAutoConfiguration):
+    logRecExOnline_globalconfig.info("RecExOnline: (not isOnline and not useEmon) or (isOnline and REO_doAutoConfiguration)")
     rec.AutoConfiguration = ['everything']
-    logRecExOnline_globalconfig.info("RecExOnline: running with autoconfiguration = everything") 
+    logRecExOnline_globalconfig.info("RecExOnline: running with autoconfiguration = everything")
 
 
 if (isOnline and not useEmon):
+    logRecExOnline_globalconfig.info("RecExOnline: isOnline and not useEmon")
     from AthenaCommon.BFieldFlags import jobproperties
     jobproperties.BField.barrelToroidOn.set_Value_and_Lock(True)
     jobproperties.BField.endcapToroidOn.set_Value_and_Lock(True)
@@ -262,15 +295,21 @@ if (isOnline and not useEmon):
     jobproperties.Beam.beamType.set_Value_and_Lock(beamType)
     globalflags.ConditionsTag.set_Value_and_Lock(ConditionsTag)
     globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion)
+    ### rec.AutoConfiguration = ['FieldAndGeo', 'ConditionsTag', 'BeamType', 'BeamEnergy', 'LumiFlags']
     rec.AutoConfiguration = ['FieldAndGeo', 'ConditionsTag', 'BeamType']
-    logRecExOnline_globalconfig.info(" Running with isOnline=True with autoconfiguration = FieldAndGeo, ConditionsTag, BeamType (taken from P1 job)")
+    #    rec.AutoConfiguration = ['ConditionsTag', 'BeamType']
+    logRecExOnline_globalconfig.info("RecExOnline: running with autoconfiguration ['FieldAndGeo', 'ConditionsTag', 'BeamType']")
+    # logRecExOnline_globalconfig.info("RecExOnline: FieldAndGeo = %s" %FieldAndGeo)
+    # logRecExOnline_globalconfig.info("RecExOnline: ConditionsTag = %s" %ConditionsTag)
+    # logRecExOnline_globalconfig.info("RecExOnline: BeamType = %s" %BeamType)
 
 
 
 #### CHANGES TO GET 19.1.0.1 RECO WORKING (M4)
 # Default to COMP200 rather than CONDBR2
 from AthenaCommon.GlobalFlags import globalflags
-globalflags.DatabaseInstance = "COMP200"
+#globalflags.DatabaseInstance = "CONDBR2"
+globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
 
 ## Another Problem with LAR offline databases
 from LArConditionsCommon.LArCondFlags import larCondFlags
@@ -307,3 +346,4 @@ if not 'IOVDbSvcMessage' in dir():
     from AthenaCommon.AppMgr import ServiceMgr as svcMgr
     import IOVDbSvc.IOVDb
     svcMgr.IOVDbSvc.OutputLevel = 2
+
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_jobOptions_HItest.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_jobOptions_HItest.py
new file mode 100644
index 000000000000..3c68371c002b
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_jobOptions_HItest.py
@@ -0,0 +1,45 @@
+## -------------------------------------------------------------------
+## File: RecExOnline_jobOptions.py
+##
+## Authors: Anadi Canepa, Max Baak
+## Date: 04 April 2009
+##
+## This JO is intended for online reconstruction.
+## It can be run over a BSRDO via EMON service
+## See instructions line by line
+##
+## -------------------------------------------------------------------
+
+## General run configuration (bs emon, filename, datatype, magnetic field, etc.)
+## Reconstruction flags for online running
+## Monitoring flags for online running
+if useEmon:
+  include ("RecExOnline/RecExOnline_emonsvc.py")
+include ("RecExOnline/RecExOnline_globalconfig.py")
+include ("RecExOnline/RecExOnline_recoflags_HItest.py")
+include ("RecExOnline/RecExOnline_monitoring.py")
+
+## Pre-exec && preinclude, taken from ami tag
+if (not 'preExec' in dir()):
+  preExec = []
+for cmd in preExec:
+  exec(cmd)
+
+## Usual main reco top options
+include ("RecExCommon/RecExCommon_topOptions.py")
+
+## New protections against crashes
+from AthenaServices.AthenaServicesConf import AthenaEventLoopMgr
+AthenaEventLoopMgr.FailureMode=2
+
+## Post configuration, taken from ami tag
+if (not 'postInclude' in dir()):
+  postInclude = [] 
+for fragment in postInclude: include(fragment)
+
+## debug outputlevel, etc
+include ( "RecExOnline/RecExOnline_postconfig.py" )
+
+## -------------------------------------------------------------------
+## End of RecExOnline_jobOptions.py
+
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_monitoring.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_monitoring.py
index 4dacea2d64d7..63014f649527 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_monitoring.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_monitoring.py
@@ -18,11 +18,11 @@ if (not 'doLVL1CaloMon' in dir()):
   doLVL1CaloMon = doTrigMon
 
 if (not 'doHLTMon' in dir()):
-  doHLTMon = doTrigMon
-
+  #doHLTMon = doTrigMon
+  doHLTMon = False 
 if (not 'doCTPMon' in dir()):
-  doCTPMon = doTrigMon
-
+  #doCTPMon = doTrigMon
+  doCTPMon = False
 if (not 'doIDMon' in dir()):
   doIDMon = doAllMon
 
@@ -47,6 +47,12 @@ if (not 'isOnline' in dir()):
 if (not 'doTileMon' in dir()):
   doTileMon = False #doAllMon
 
+if (not 'doHIMon' in dir()):
+  doHIMon = False
+
+if (not 'isOfflineTest' in dir()):
+  isOfflineTest   = False
+
 ## if ('isGlobalMonitoring' not in dir()):
 ##     isGlobalMonitoring = False
 
@@ -59,10 +65,10 @@ if isOnline and useEmon:
   DQMonFlags.monManFileKey = 'ourGLOBAL'                                   # must use a different stream w.r.t what sets in DQ steering JO
   DQMonFlags.monManEnvironment.set_Value_and_Lock('online')
 
-#DQMonFlags.monManDataType.set_Value_and_Lock('data')
-DQMonFlags.monManDataType.set_Value_and_Lock('cosmics')
+DQMonFlags.monManDataType.set_Value_and_Lock('data')
+#DQMonFlags.monManDataType.set_Value_and_Lock('cosmics')
 
-orMon = doAllMon or doCaloMon or doPhysMon or doIDMon or doMuonMon or doTRTMon or doCTPMon or doLucidMon or doSCTMon or doPixelOnlyMon or doLVL1CaloMon or doHLTMon
+orMon = doAllMon or doCaloMon or doPhysMon or doIDMon or doMuonMon or doTRTMon or doCTPMon or doLucidMon or doSCTMon or doPixelOnlyMon or doLVL1CaloMon or doHLTMon or doHIMon
 DQMonFlags.doMonitoring.set_Value_and_Lock(orMon)
 
 from RecExConfig.RecFlags import rec
@@ -79,7 +85,7 @@ DQMonFlags.doJetMon.set_Value_and_Lock(doPhysMon)
 DQMonFlags.doJetTagMon.set_Value_and_Lock(doPhysMon)
 DQMonFlags.doTauMon.set_Value_and_Lock(doPhysMon)
 DQMonFlags.doCaloMon.set_Value_and_Lock(doCaloMon)
-DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(doPhysMon)
+### DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(doPhysMon) ### replaced by MuonTrackMonitoring (SMW Jan 23 2016)
 DQMonFlags.doGlobalMon.set_Value_and_Lock(doPhysMon)
 
 # ******************* Trigger monitorings
@@ -103,17 +109,22 @@ from MuonDQAMonFlags.MuonDQAProperFlags import MuonDQADetFlags
 DQMonFlags.doMuonAlignMon.set_Value_and_Lock(False)                      #### set False by default
 DQMonFlags.doMuonCombinedMon.set_Value_and_Lock(doMuonMon)
 
-MuonDQADetFlags.doTGCMon.set_Value_and_Lock(False)
-MuonDQADetFlags.doTGCL1Mon.set_Value_and_Lock(False)
-MuonDQADetFlags.doMDTTGCL1Mon.set_Value_and_Lock(False)
+#MuonDQADetFlags.doTGCMon.set_Value_and_Lock(False)
+#MuonDQADetFlags.doTGCL1Mon.set_Value_and_Lock(False)
+#MuonDQADetFlags.doMDTTGCL1Mon.set_Value_and_Lock(False)
 
-DQMonFlags.doMuonRawMon.set_Value_and_Lock(False) #AK - 04/07/2014 doMuonMon)
+### DQMonFlags.doMuonRawMon.set_Value_and_Lock(False) #AK - 04/07/2014 doMuonMon)
+DQMonFlags.doMuonRawMon.set_Value_and_Lock(doMuonMon)
 DQMonFlags.doMuonSegmentMon.set_Value_and_Lock(doMuonMon)
 DQMonFlags.doMuonTrackMon.set_Value_and_Lock(doMuonMon)
 
 # ******************* Additional monitorings
 DQMonFlags.doLucidMon.set_Value_and_Lock(doLucidMon)
 
+# ******************* Heavy Ion monitorings
+DQMonFlags.doHIMon.set_Value_and_Lock(doHIMon)
+
+
 #toRun='GM-Application:GlobalMonitoringSegment:pc-tdq-gmon-02:1'
 #if (toRun==publishName):
 #if (isGlobalMonitoring):     #AK: 21-05-2014
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_postconfig.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_postconfig.py
index bb6f360da49e..cced7939c29b 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_postconfig.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_postconfig.py
@@ -13,10 +13,74 @@ if isOnline and useEmon:
 #AthenaPoolConverter                                 ERROR poolToObject: caught error: FID "22CA8C5E-C583-DD11-A2EC-000423D94D30" is not existing in the catalog ( POOL : "PersistencySvc::UserDatabase::connectForRead" from "PersistencySvc" )
 #AthenaPoolConverter                                 ERROR createObj PoolToDataObject() failed, Token = [DB=22CA8C5E-C583-DD11-A2EC-000423D94D30][CNT=CollectionTree(CaloRec::ToolConstants/H1WeightsCone4Topo)][CLID=5A73ABF8-5095-405B-A296-3435BB52A5FD][TECH=00000202][OID=0000000000000003-0000000000000000]
 #DataProxy                                         WARNING accessData: conversion failed for data object 250904980//CALO/H1Weights/H1WeightsCone4Topo
-  PoolSvc.ReadCatalog += ["xmlcatalog_file:/det/dqm/GlobalMonitoring/AtlasProduction-19.1.0.1/PoolFileCatalog.xml"]
+###  PoolSvc.ReadCatalog += ["xmlcatalog_file:/det/dqm/GlobalMonitoring/AtlasProduction-19.1.0.1/PoolFileCatalog.xml"]
+
+# SMW: 19-11-2014: fixing this error
+# PoolCollectionConverter                           WARNING Unable to create Collection: FID:BC292F26-AE73-9041-BF5C-BCE6C5C651EC
+# PoolCollectionConverter                           WARNING FID "BC292F26-AE73-9041-BF5C-BCE6C5C651EC" is not existing in the catalog ( POOL : "PersistencySvc::UserDatabase::connectForRead" from "PersistencySvc" )
+# CondProxyProvider                                   ERROR Unable to open: FID:BC292F26-AE73-9041-BF5C-BCE6C5C651EC
+
+### PoolSvc.ReadCatalog += ["xmlcatalog_file:/det/dqm/GlobalMonitoring/SMW_test/AtlasProduction-19.3.0.1_19nov14/PoolFileCatalog.xml"]
+  PoolSvc.ReadCatalog += ["xmlcatalog_file:/det/dqm/GlobalMonitoring/PoolFileCatalog_M7/PoolFileCatalog.xml"]
 
 #ToolSvc.InDetCosmicsEventPhaseTool.GlobalOffset = 0
 
+
+###
+### Fix problem in PixelConditionsTools
+### From Fares Djama
+### " the RUN2 pixel tags have been copied from RUN1,
+###   while we have a new detector, the IBL.
+###   We need to add a new IOV to our tags in the online.
+###   I guess that's the same for all other condb folders"
+###
+
+
+#
+# This part is only for online (SMWANG : Nov 17th 2015)
+#
+
+#from IOVDbSvc.CondDB import conddb
+#
+#if not conddb.folderRequested("PIXEL/PixReco"):
+#        conddb.addFolder('PIXEL','/PIXEL/PixReco')
+#if not conddb.folderRequested("PIXEL/PixCalib"):
+#        conddb.addFolder('PIXEL','/PIXEL/PixCalib')
+#conddb.blockFolder("/PIXEL/PixCalib")
+#conddb.blockFolder("/PIXEL/PixReco")
+#
+#conddb.addFolderWithTag("/det/indet/M8/AtlasProduction-20.1.0.1/NewHLT.db;dbname=CONDBR2","/PIXEL/PixReco","PixReco-HLT-RUN12-000-01",force=True) 
+#conddb.addFolderWithTag("/det/indet/M8/AtlasProduction-20.1.0.1/NewHLT.db;dbname=CONDBR2","/PIXEL/PixCalib","PixReco-HLT-RUN12-000-01",force=True) 
+
+
+#
+# Need to get this part to work online and offline !!! (SMWANG : Nov 17th 2015)
+#
+
+if (isOnline and not isOfflineTest):
+  from IOVDbSvc.CondDB import conddb
+  if not conddb.folderRequested("PIXEL/PixReco"):
+    conddb.addFolder('PIXEL','/PIXEL/PixReco')
+  if not conddb.folderRequested("PIXEL/PixCalib"):
+    conddb.addFolder('PIXEL','/PIXEL/PixCalib')
+  conddb.blockFolder("/PIXEL/PixCalib")
+  conddb.blockFolder("/PIXEL/PixReco")
+  conddb.addFolderWithTag("/det/indet/M8/AtlasProduction-20.1.0.1/NewHLT.db;dbname=CONDBR2","/PIXEL/PixReco","PixReco-HLT-RUN12-000-01",force=True) 
+  conddb.addFolderWithTag("/det/indet/M8/AtlasProduction-20.1.0.1/NewHLT.db;dbname=CONDBR2","/PIXEL/PixCalib","PixReco-HLT-RUN12-000-01",force=True) 
+
+
+if (isOnline and isOfflineTest):
+  from IOVDbSvc.CondDB import conddb
+  if not conddb.folderRequested("PIXEL/PixReco"):
+    conddb.addFolder('PIXEL','/PIXEL/PixReco')
+  if not conddb.folderRequested("PIXEL/PixCalib"):
+    conddb.addFolder('PIXEL','/PIXEL/PixCalib')
+  conddb.blockFolder("/PIXEL/PixCalib")
+  conddb.blockFolder("/PIXEL/PixReco")
+  conddb.addFolderWithTag("/afs/cern.ch/work/s/smwang/public/DQM/InDet_online_db/NewHLT.db;dbname=CONDBR2","/PIXEL/PixReco","PixReco-HLT-RUN12-000-01",force=True) 
+  conddb.addFolderWithTag("/afs/cern.ch/work/s/smwang/public/DQM/InDet_online_db/NewHLT.db;dbname=CONDBR2","/PIXEL/PixCalib","PixReco-HLT-RUN12-000-01",force=True) 
+
+
 # ----------------------------- Printout
 print "CHECK POINT PRINTING"
 globalflags.print_JobProperties()
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags.py
index 9fb8a0dc58e2..7d837a0de0c0 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags.py
@@ -43,6 +43,12 @@ if (not 'doCommissioning' in dir()):
 if ( not 'abortonuncheckedstatuscode' in dir()):
   abortonuncheckedstatuscode = False
 
+if (not 'doHIRec' in dir()):
+  doHIRec = False
+
+if (not 'doHIPRec' in dir()):
+  doHIPRec = False
+
 ## ------------------------------------------------------------------- Reco flags
 
 rec.doInDet.set_Value_and_Lock(doInDet)
@@ -56,7 +62,19 @@ rec.doForwardDet.set_Value_and_Lock(doLucid or doZdc or doAlfa)
 rec.doTrigger.set_Value_and_Lock(doTrigger)
 
 from RecExConfig.RecAlgsFlags import recAlgs
-recAlgs.doTrigger.set_Value_and_Lock(doTrigger)                                
+#recAlgs.doTrigger.set_Value_and_Lock(doTrigger)                                
+
+rec.doHeavyIon.set_Value_and_Lock(doHIRec)
+rec.doHIP.set_Value_and_Lock(doHIPRec)
+
+## --------------------- Added by S. Sun to disable Muon Girl algorithm -----------------------------##
+
+recAlgs.doMuGirl.set_Value_and_Lock(False)
+
+from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags
+muonCombinedRecFlags.doMuGirl.set_Value_and_Lock(False)
+
+## --------------------------------------------------------------------------------------------------##
 
 rec.doHist.set_Value_and_Lock(doHist)
 rec.doJiveXML.set_Value_and_Lock(doJiveXML)                               
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags_HItest.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags_HItest.py
new file mode 100644
index 000000000000..cb8f5d2f2b2d
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags_HItest.py
@@ -0,0 +1,84 @@
+## -------------------------------------------------------------------
+
+## default settings
+if (not 'doAllReco' in dir()):
+  doAllReco = True
+
+if (not 'doInDet' in dir()):
+  doInDet = doAllReco
+
+if (not 'doMuon' in dir()):
+  doMuon = doAllReco
+
+if (not 'doLArg' in dir()):
+  doLArg = doAllReco
+
+if (not 'doTile' in dir()):
+  doTile = doAllReco
+
+if (not 'doLucid' in dir()):
+  doLucid = False
+
+if (not 'doZdc' in dir()):
+  doZdc = False
+
+if (not 'doAlfa' in dir()):
+  doAlfa = False
+
+if (not 'doTrigger' in dir()):
+  doTrigger = False
+
+if (not 'doHist' in dir()):
+  doHist = True
+
+if (not 'doJiveXML' in dir()):
+  doJiveXML = False
+
+if (not 'doEgammaTau' in dir()):
+  doEgammaTau = doAllReco
+
+if (not 'doCommissioning' in dir()):
+  doCommissioning = False
+
+if ( not 'abortonuncheckedstatuscode' in dir()):
+  abortonuncheckedstatuscode = False
+
+if (not 'doHIRec' in dir()):
+  doHIRec = False
+
+## ------------------------------------------------------------------- Reco flags
+
+rec.doInDet.set_Value_and_Lock(doInDet)
+rec.doMuon.set_Value_and_Lock(doMuon)                                      
+rec.doLArg.set_Value_and_Lock(doLArg)                                      
+rec.doTile.set_Value_and_Lock(doTile)                                      
+rec.doLucid.set_Value_and_Lock(doLucid)
+rec.doZdc.set_Value_and_Lock(doZdc)
+rec.doAlfa.set_Value_and_Lock(doAlfa)
+rec.doForwardDet.set_Value_and_Lock(doLucid or doZdc or doAlfa)
+rec.doTrigger.set_Value_and_Lock(doTrigger)
+
+from RecExConfig.RecAlgsFlags import recAlgs
+#recAlgs.doTrigger.set_Value_and_Lock(doTrigger)                                
+
+rec.doHeavyIon.set_Value_and_Lock(doHIRec)
+
+rec.doHIP.set_Value_and_Lock(True)
+
+## --------------------- Added by S. Sun to disable Muon Girl algorithm -----------------------------##
+
+recAlgs.doMuGirl.set_Value_and_Lock(False)
+
+from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags
+muonCombinedRecFlags.doMuGirl.set_Value_and_Lock(False)
+
+## --------------------------------------------------------------------------------------------------##
+
+rec.doHist.set_Value_and_Lock(doHist)
+rec.doJiveXML.set_Value_and_Lock(doJiveXML)                               
+rec.doEgamma.set_Value_and_Lock(doEgammaTau)
+rec.doTau.set_Value_and_Lock(doEgammaTau)
+
+rec.Commissioning.set_Value_and_Lock(True) # set to True by default
+
+rec.abortOnUncheckedStatusCode.set_Value_and_Lock(abortonuncheckedstatuscode)
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags_RunHI.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags_RunHI.py
new file mode 100644
index 000000000000..b03ae0e9f15f
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_recoflags_RunHI.py
@@ -0,0 +1,84 @@
+## -------------------------------------------------------------------
+
+## default settings
+if (not 'doAllReco' in dir()):
+  doAllReco = True
+
+if (not 'doInDet' in dir()):
+  doInDet = doAllReco
+
+if (not 'doMuon' in dir()):
+  doMuon = doAllReco
+
+if (not 'doLArg' in dir()):
+  doLArg = doAllReco
+
+if (not 'doTile' in dir()):
+  doTile = doAllReco
+
+if (not 'doLucid' in dir()):
+  doLucid = False
+
+if (not 'doZdc' in dir()):
+  doZdc = False
+
+if (not 'doAlfa' in dir()):
+  doAlfa = False
+
+if (not 'doTrigger' in dir()):
+  doTrigger = False
+
+if (not 'doHist' in dir()):
+  doHist = True
+
+if (not 'doJiveXML' in dir()):
+  doJiveXML = False
+
+if (not 'doEgammaTau' in dir()):
+  doEgammaTau = doAllReco
+
+if (not 'doCommissioning' in dir()):
+  doCommissioning = False
+
+if ( not 'abortonuncheckedstatuscode' in dir()):
+  abortonuncheckedstatuscode = False
+
+if (not 'doHIRec' in dir()):
+  doHIRec = False
+
+## ------------------------------------------------------------------- Reco flags
+
+rec.doInDet.set_Value_and_Lock(doInDet)
+rec.doMuon.set_Value_and_Lock(doMuon)                                      
+rec.doLArg.set_Value_and_Lock(doLArg)                                      
+rec.doTile.set_Value_and_Lock(doTile)                                      
+rec.doLucid.set_Value_and_Lock(doLucid)
+rec.doZdc.set_Value_and_Lock(doZdc)
+rec.doAlfa.set_Value_and_Lock(doAlfa)
+rec.doForwardDet.set_Value_and_Lock(doLucid or doZdc or doAlfa)
+rec.doTrigger.set_Value_and_Lock(doTrigger)
+
+from RecExConfig.RecAlgsFlags import recAlgs
+#recAlgs.doTrigger.set_Value_and_Lock(doTrigger)                                
+
+rec.doHeavyIon.set_Value_and_Lock(doHIRec)
+
+#rec.doHIP.set_Value_and_Lock(True)
+
+## --------------------- Added by S. Sun to disable Muon Girl algorithm -----------------------------##
+
+recAlgs.doMuGirl.set_Value_and_Lock(False)
+
+from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags
+muonCombinedRecFlags.doMuGirl.set_Value_and_Lock(False)
+
+## --------------------------------------------------------------------------------------------------##
+
+rec.doHist.set_Value_and_Lock(doHist)
+rec.doJiveXML.set_Value_and_Lock(doJiveXML)                               
+rec.doEgamma.set_Value_and_Lock(doEgammaTau)
+rec.doTau.set_Value_and_Lock(doEgammaTau)
+
+rec.Commissioning.set_Value_and_Lock(True) # set to True by default
+
+rec.abortOnUncheckedStatusCode.set_Value_and_Lock(abortonuncheckedstatuscode)
diff --git a/Reconstruction/RecExample/RecExOnline/share/RootHis_RTT.C b/Reconstruction/RecExample/RecExOnline/share/RootHis_RTT.C
new file mode 100644
index 000000000000..cd21069e99e5
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/RootHis_RTT.C
@@ -0,0 +1,26 @@
+#include <iostream>
+#include <string>
+#include <fstream>
+
+#include "TH1F.h"
+#include "TFile.h"
+#include "TCanvas.h"
+#include "TSystem.h"
+#include "TKey.h"
+
+void RootHis_RTT() 
+{
+   
+   TFile *file = new TFile("Monitor.root");
+
+//    TH1F *h1_AK4LCTTopoJetsPt= (TH1F*)gDirectory->FindObjectAny("Jets/AntiKt4LCTTopoJets/pt");
+        TH1F *h1_AK4LCTTopoJetsPt= (TH1F*)gDirectory->FindObjectAny("pt");
+
+    TCanvas *c1 = new TCanvas("c1", "GIF Canvas", 400, 300);
+    h1_AK4LCTTopoJetsPt->Draw("HistE");
+    c1->Print("AK4LCTTopoJetsPt.png");
+       
+
+
+}
+
diff --git a/Reconstruction/RecExample/RecExOnline/share/Rtt_histogram.py b/Reconstruction/RecExample/RecExOnline/share/Rtt_histogram.py
new file mode 100644
index 000000000000..6239b69b4bcf
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/Rtt_histogram.py
@@ -0,0 +1,79 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+import xml.etree.ElementTree as ET
+import sys
+import string
+import ROOT
+
+theApp.EvtMax = 0
+print (sys.version)
+#tree = ET.parse("tesr.xml")
+listhis = [] #list for combine perf his 
+listhisIndetG = [] #list for indet global his 
+print "############# reading combine performance "
+tree = ET.parse("/afs/cern.ch/user/y/yunju/working/yunju/public/Rtt_ohpxml/CombPerf.xml")
+#tree = ET.parse("ohp.xml")
+root = tree.getroot()
+for neighbor in root.getiterator('histos'):
+    #print neighbor.attrib
+    #print neighbor.text
+    listpaths=neighbor.text
+    print "info: %s %s" % (neighbor,listpaths)
+    n1 = neighbor.text.split(',')
+    print "list:%s" %n1
+    for stringth in n1:
+        print stringth.find("Global_ISSERVER")
+        if stringth.find("Global_ISSERVER")!=-1:
+            finalpath=string.replace(stringth,"${Global_ISSERVER}/${Global_PROVIDER}","run_302347")
+            print stringth.find("MET")
+            if stringth.find("MET")!=-1:
+                finalpath=string.replace(finalpath,"run_302347","run_302347/lb_432")
+            finalpath2=string.replace(finalpath," ", "")
+            finalpath2=string.replace(finalpath2,"\t","")#remove tab 
+            finalpath3=string.replace(finalpath2,"\n","")
+            listhis.append(finalpath3)        
+print listhis 
+print "############# reading indetglobal "
+treeindetglobal = ET.parse("/afs/cern.ch/user/y/yunju/working/yunju/public/Rtt_ohpxml/globaldq-indet_20_11_0_25_1.xml")
+#treeindetglobal = ET.parse("ohp.xml")
+rootindetglobal = treeindetglobal.getroot()
+for neighbor in rootindetglobal.getiterator('histos'):
+    #print neighbor.attrib
+    #print neighbor.text
+    listpaths=neighbor.text
+    print "info: %s %s" % (neighbor,listpaths)
+    n1 = neighbor.text.split(',')
+    print "list:%s" %n1
+    for stringth in n1:
+        print stringth.find("Global_ISSERVER")
+        if stringth.find("Histogramming-Global-iss/GM-Gatherer-MIG:GlobalMonitoringSegment")!=-1:
+            finalpath=string.replace(stringth,"Histogramming-Global-iss/GM-Gatherer-MIG:GlobalMonitoringSegment","run_302347")
+            print stringth.find("${ID_AL_BASE_PATH}")
+            if stringth.find("${ID_AL_BASE_PATH}")!=-1:
+                finalpath=string.replace(finalpath,"${ID_AL_BASE_PATH}","ExtendedTracks_NoTriggerSelection") #defined in idgl-options.xml
+            print "info with empty: %s" % ([finalpath])
+            finalpath2=string.replace(finalpath,"\t","")#remove tab
+            finalpath2=string.replace(finalpath2," ","")#remove space
+            print "info with out empty: %s" % (finalpath2)
+            finalpath3=string.replace(finalpath2,"\n","")
+            listhisIndetG.append(finalpath3)        
+print listhisIndetG 
+f = ROOT.TFile("Monitor.root")
+print "############# checking combine perf "
+for ith in listhis:
+    print "get his %s" %ith
+    histCount = f.Get(ith)
+    if  histCount :
+        histCount.Draw()
+    else: 
+        print "missing combined perf %s " %ith 
+
+
+print "############# checking indetglobal "
+for ith in listhisIndetG:
+    print "get his %s" %ith
+    histCount = f.Get(ith)
+    if  histCount :
+        histCount.Draw()
+    else: 
+        print "missing indet global %s " %ith 
+
diff --git a/Reconstruction/RecExample/RecExOnline/share/SimpleJobOptions_ForRTT.py b/Reconstruction/RecExample/RecExOnline/share/SimpleJobOptions_ForRTT.py
new file mode 100644
index 000000000000..b9728ff2d1e9
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/SimpleJobOptions_ForRTT.py
@@ -0,0 +1 @@
+theApp.EvtMax = 5
diff --git a/Reconstruction/RecExample/RecExOnline/share/myAsetup b/Reconstruction/RecExample/RecExOnline/share/myAsetup
new file mode 100644
index 000000000000..db799b147f7e
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/share/myAsetup
@@ -0,0 +1,18 @@
+[defaults]
+tags			= AtlasProduction,AtlasHLT
+release			= 19.3.0.1
+runtime			= True
+32bit			= False
+os			= slc6
+compiler		= gcc47
+optimised		= True
+testarea		= /det/dqm/GlobalMonitoring/SMW_test/AtlasProduction-19.3.0.1_21nov14/
+
+[environment]
+CORAL_DBLOOKUP_PATH=/sw/DbSuppForMx/lookup4oracle
+CORAL_AUTH_PATH=/sw/DbSuppForMx/lookup4oracle
+
+[epilog.sh]
+export CORAL_DBLOOKUP_PATH=/sw/DbSuppForMx/lookup4oracle
+export CORAL_AUTH_PATH=/sw/DbSuppForMx/lookup4oracle
+export CALIBPATH=/sw/extras/sw_tmp/current/hlt/CalibArea12112014:$CALIBPATH
diff --git a/Reconstruction/RecExample/RecExOnline/test/RecExOnline_TestConfiguration.xml b/Reconstruction/RecExample/RecExOnline/test/RecExOnline_TestConfiguration.xml
new file mode 100755
index 000000000000..da82fc248d93
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/test/RecExOnline_TestConfiguration.xml
@@ -0,0 +1,386 @@
+<?xml version="1.0"?>
+<!-- MB: Search for RUNNUMBER to replace the run input collections and setting -->
+<!-- MB: xml file validation: http://www.hep.ucl.ac.uk/atlas/AtlasTesting/DTD/onlineValidation/validator.html -->
+<!-- <!DOCTYPE unifiedTestConfiguration SYSTEM "https://test-rtt.web.cern.ch/test-rtt/brinick/Results/unifiedTestConfiguration.dtd"> --> <!-- xmltest -->
+<!DOCTYPE unifiedTestConfiguration SYSTEM "http://www.hep.ucl.ac.uk/atlas/AtlasTesting/DTD/unifiedTestConfiguration.dtd"> <!-- official -->
+<!-- A test version -->
+
+<unifiedTestConfiguration>
+    
+    <atn/>
+    <kv/>
+    <rtt xmlns="http://www.hep.ucl.ac.uk/atlas/AtlasTesting/rtt">
+        <rttContactPerson>Yun-Ju Lu</rttContactPerson>
+        <mailto>yunju@cern.ch</mailto>
+        <refRelease>20.1.X.Y</refRelease>
+        <jobList>
+        
+        <chain>
+        <chainName>OfflineChainJob</chainName>  
+         <sequential>
+          <chainElement>              
+           <jobTransform userJobId="RecExOnline_User_Offline_test_v1">
+             <doc>Recexonline test</doc>
+             <jobTransformJobName>First_RecexOnline_test</jobTransformJobName>
+             <jobTransformCmd>
+             athena.py -c "inpuevtMax=850" RecExOnline/RecExOnline_User_Offline.py 
+             </jobTransformCmd>
+             <group>RecExOnline_Test</group>
+             <queue>medium</queue>
+
+
+<!--
+
+             <test>
+               <modulename>RttLibraryTools</modulename>
+               <testname>FileGrepper</testname>
+          
+   
+               <arg>
+                 <fileGrepperArgs>
+                   <fileGrepperInputFile>*v1_log</fileGrepperInputFile>
+                  
+                   <fileGrepperSearchPattern>
+                     <fileGrepperPattern>Number of events processed</fileGrepperPattern>   
+                   </fileGrepperSearchPattern>   
+                 </fileGrepperArgs>
+               </arg>
+             </test>              
+            
+             <test>
+               <modulename>RttLibraryTools</modulename>
+               <testname>ROOTMacroRunner</testname>    
+                 <arg>
+                   <argname>macro</argname>
+                   <argvalue>RootHis_RTT.C</argvalue>
+                 </arg>
+             </test>
+             
+             <test>
+               <modulename>RttLibraryTools</modulename>
+               <testname>ROOTMacroRunner</testname>    
+                 <arg>
+                   <argname>macro</argname>
+                   <argvalue>RecExOnline_Test_Obj_His_RTT.C</argvalue>
+                 </arg>
+             </test>
+-->
+             <test position="1">
+              <modulename>RttLibraryTools</modulename>
+               <testname>ROOTMacroRunner</testname>    
+                <arg>
+                <argname>macro</argname>
+                <argvalue>RecExOnline_Test_Obj_His_RTT_Cpp_rename.C</argvalue>
+                </arg>
+             </test>
+            
+             <alwaysRunPostProc />
+           </jobTransform>
+          <chainfileout>Monitor.root</chainfileout>
+         </chainElement>
+         
+         <chainElement>   
+          <jobTransform userJobId="RTTAlgs">
+             <doc>RTTAlgs</doc>
+             <jobTransformJobName>RTTAlgs</jobTransformJobName>
+             <jobTransformCmd>
+             athena.py RecExOnline/RTTAlgmain.py 
+             </jobTransformCmd>
+             <group>RecExOnline_Test</group>
+           
+             <chaindataset_info>
+             <jobTransformData />    
+             <chaindatasetName>Monitor.root</chaindatasetName>
+             <!-- If the file on the previous line is not in the chain store, then use the following fallback file. -->
+             <dataset_info>
+                 <jobTransformData />
+                 <datasetName>/afs/cern.ch/user/y/yunju/working/yunju/public/GM_ref_plots/Monitor.root</datasetName>
+             </dataset_info>
+        </chaindataset_info> 
+             <testToRemove>
+              <jobGroupName>AthenaRecExOnline_Test</jobGroupName>
+              <testidentifier>FileGrepperprocessed</testidentifier>
+             </testToRemove>
+          
+              <alwaysRunPostProc /> 
+            </jobTransform>     
+           </chainElement>
+
+             <chainElement>   
+          <jobTransform userJobId="ohp_hispathcheck">
+             <doc>ohp_hispathcheck</doc>
+             <jobTransformJobName>ohp_hispathcheck</jobTransformJobName>
+             <jobTransformCmd>
+             athena.py RecExOnline/Rtt_histogram.py 
+             </jobTransformCmd>
+             <group>RecExOnline_Test</group>
+           
+             <testToRemove>
+              <jobGroupName>AthenaRecExOnline_Test</jobGroupName>
+              <testidentifier>FileGrepperprocessed</testidentifier>
+             </testToRemove>
+          
+              <alwaysRunPostProc /> 
+            </jobTransform>     
+           </chainElement>
+
+          </sequential>
+         </chain>
+
+
+            <jobTransform userJobId="Online_reconstruction_autoconfiguration_test_v1">
+             <doc>Recexonline test Online_reconstruction_autoconfiguration</doc>
+             <jobTransformJobName>Online_reconstruction_autoconfiguration_test_v1</jobTransformJobName>
+             <jobTransformCmd>
+             athena.py -c "REO_doAutoConfiguration=True" RecExOnline/RecExOnline_User_Offline_isOnlineTrue.py 
+             </jobTransformCmd>
+             <group>RecExOnline_Test</group>
+             <queue>medium</queue> 
+            <test position="1">
+              <modulename>RttLibraryTools</modulename>
+               <testname>ROOTMacroRunner</testname>    
+               <arg>
+              <argname>macro</argname>
+              <argvalue>RecExOnline_Test_Obj_His_RTT_Cpp_Online.C</argvalue>
+              </arg>
+           </test>
+
+
+
+
+             <alwaysRunPostProc />
+            </jobTransform>
+            
+            <jobTransform userJobId="Online_reconstruction_autoconfiguration_False_test_v1">
+             <doc>Recexonline test Online_reconstruction_autoconfiguration_False</doc>
+             <jobTransformJobName>Online_reconstruction_autoconfiguration_False_test_v1</jobTransformJobName>
+             <jobTransformCmd>
+             athena.py -c "REO_doAutoConfiguration=False" RecExOnline/RecExOnline_User_Offline_isOnlineTrue.py 
+             </jobTransformCmd>
+             <group>RecExOnline_Test</group>
+             <queue>medium</queue>
+           <test position="1">
+             <modulename>RttLibraryTools</modulename>
+              <testname>ROOTMacroRunner</testname>    
+               <arg>
+               <argname>macro</argname>
+               <argvalue>RecExOnline_Test_Obj_His_RTT_Cpp_Online.C</argvalue>
+               </arg>
+            </test>
+
+
+
+
+
+
+             <alwaysRunPostProc />
+            </jobTransform>
+            
+            <jobTransform userJobId="Online_reconstruction_autoconfiguration_False_cosmics_test_v1">
+             <doc>Recexonline test Online_reconstruction_autoconfiguration_False_cosmics</doc>
+             <jobTransformJobName>Online_reconstruction_autoconfiguration_False_cosmics_test_v1</jobTransformJobName>
+             <jobTransformCmd>
+             athena.py -c "REO_doAutoConfiguration=False; beamType='cosmics'" RecExOnline/RecExOnline_User_Offline_isOnlineTrue.py 
+             </jobTransformCmd>
+             <group>RecExOnline_Test</group>
+             <queue>medium</queue> 
+             <test position="1">
+              <modulename>RttLibraryTools</modulename>
+               <testname>ROOTMacroRunner</testname>    
+                <arg>
+                <argname>macro</argname>
+                <argvalue>RecExOnline_Test_Obj_His_RTT_Cpp_Online.C</argvalue>
+                </arg>
+             </test>
+             
+              <alwaysRunPostProc />
+            </jobTransform>
+          
+            <jobTransform userJobId="RTTTool_test_v1">
+             <doc>RTTTool_test_v1</doc>
+             <jobTransformJobName>RTTTool_test_v1</jobTransformJobName>
+             <jobTransformCmd>
+             athena.py RecExOnline/SimpleJobOptions_ForRTT.py 
+             </jobTransformCmd>
+             <group>RecExOnline_Test</group>
+ 
+             <testToRemove>
+              <jobGroupName>AthenaRecExOnline_Test</jobGroupName>
+              <testidentifier>FileGrepperprocessed</testidentifier>
+             </testToRemove>
+          
+              <alwaysRunPostProc /> 
+            </jobTransform>     
+          
+        
+
+
+    </jobList>
+ <jobGroups>
+     <jobGroup name="AthenaRecExOnline_Test" parent="Athena">
+       <keepFilePattern>*.root</keepFilePattern>   
+       <keepFilePattern>*.png</keepFilePattern>    
+       <keepFilePattern>testlog*.log</keepFilePattern>      
+       <keepFilePattern>RTTAlg.html</keepFilePattern>      
+       <keepFilePattern>P1MON_RTT_result_template_v1.html</keepFilePattern>
+       <auxFilePattern>RootHis*.C</auxFilePattern>
+       <auxFilePattern>RecExOnline_Test*.C</auxFilePattern>
+       <auxFilePattern>RecExOnline_Test_Obj_His_RTT.C</auxFilePattern>
+       <auxFilePattern>RecExOnline_Test_Obj_His_RTT_CINT.C</auxFilePattern>
+
+<!--
+       <action>   
+               <modulename>RttLibraryTools</modulename>
+               <testname>ROOTMacroRunner</testname>    
+                 <arg>
+                   <argname>macro</argname>
+                   <argvalue>RecExOnline_Test_Obj_His_RTT.C</argvalue>
+                 </arg>
+       </action>
+       <action>    
+               <modulename>RttLibraryTools</modulename>
+               <testname>ROOTMacroRunner</testname>    
+                 <arg>
+                   <argname>macro</argname>
+                   <argvalue>RecExOnline_Test_Obj_His_RTT_CINT.C</argvalue>
+                 </arg>
+       </action>
+       <action>    
+               <modulename>RttLibraryTools</modulename>
+               <testname>ROOTMacroRunner</testname>    
+                 <arg>
+                   <argname>macro</argname>
+                   <argvalue>RecExOnline_Test_Obj_His_RTT_CINT.C</argvalue>
+                 </arg>
+       </action>
+-->
+
+
+             <test position="2">
+
+                    <modulename>RttLibraryTools</modulename>
+                    <testname>FileGrepper</testname>
+                    <testidentifier>FileGrepperprocessed</testidentifier>
+             
+                    <arg>
+                        <argname>inputFile</argname>
+                        <argvalue>*v1_log</argvalue> <!-- put this one if you use job log -->
+                    </arg>
+                    <arg>
+                        <argname>outputFile</argname>
+                        <argvalue>testlogprocessed.log</argvalue>
+                    </arg>
+                    <arg>
+                        <argname>searchList</argname>
+                        <argvalue>Number of events processed</argvalue> <!-- put here the string you should find to mean all ok -->
+                    </arg>
+             </test>
+             
+             <test position="3">
+
+                    <modulename>RttLibraryTools</modulename>
+                    <testname>FileGrepper</testname>
+                    <testnegate />
+                    <testidentifier>FileGrepperERROR3</testidentifier>                     
+                    <arg>
+                        <argname>inputFile</argname>
+                        <argvalue>*v1_log</argvalue> <!-- put this one if you use job log -->
+                    </arg>
+                    <arg>
+                        <argname>outputFile</argname>
+                        <argvalue>testlogError.log</argvalue>
+                    </arg>
+                    <arg>
+                        <argname>searchList</argname>
+                        <argvalue>ERROR</argvalue> <!-- put here the string you should find to mean all ok -->
+ 
+                    </arg>
+                    <noalarm /> 
+             </test>
+             <test position="4">
+
+                    <modulename>RttLibraryTools</modulename>
+                    <testname>FileGrepper</testname>
+                    <testidentifier>FileGrepperERROR4</testidentifier>
+                    
+                    <arg>
+                        <argname>inputFile</argname>
+                        <argvalue>*v1_log</argvalue> <!-- put this one if you use job log -->
+                    </arg>
+                    <arg>
+                        <argname>outputFile</argname>
+                        <argvalue>testlogError2.log</argvalue>
+                    </arg>
+                    <arg>
+                        <argname>searchList</argname>
+                        <argvalue>ERROR</argvalue> <!-- put here the string you should find to mean all ok -->
+ 
+                    </arg>
+                    <noalarm /> 
+             </test>
+             
+
+             <test position="5">
+
+                    <modulename>RttLibraryTools</modulename>
+                    <testname>FileGrepper</testname>
+                    <testnegate />
+                    
+                    <testidentifier>FileGrepperFATAL</testidentifier>
+                    
+                    <arg>
+                        <argname>inputFile</argname>
+                        <argvalue>*v1_log</argvalue> <!-- put this one if you use job log -->
+                    </arg>
+                    <arg>
+                        <argname>outputFile</argname>
+                        <argvalue>testlogFATAL.log</argvalue>
+                    </arg>
+                    <arg>
+                        <argname>searchList</argname>
+                        <argvalue>FATAL</argvalue> <!-- put here the string you should find to mean all ok -->
+                         
+                    </arg>
+                    
+             </test>
+             
+             <test position="6">
+
+                    <modulename>RttLibraryTools</modulename>
+                    <testname>FileGrepper</testname>
+                    <testnegate />
+                    <testidentifier>FileGrepperTraceback</testidentifier>
+                    
+                    <arg>
+                        <argname>inputFile</argname>
+                        <argvalue>*v1_log</argvalue> <!-- put this one if you use job log -->
+                    </arg>
+                    <arg>
+                        <argname>outputFile</argname>
+                        <argvalue>testlogTraceback.log</argvalue>
+                    </arg>
+                    <arg>
+                        <argname>searchList</argname>
+                        <argvalue>Traceback</argvalue> <!-- put here the string you should find to mean all ok -->       
+                    </arg>
+                    <noalarm />
+             </test>
+             
+           <testToRemove>
+              <jobGroupName>RTT:Top</jobGroupName>
+              <testidentifier>CheckFileRunner0</testidentifier>
+           </testToRemove>
+           <testToRemove>
+              <jobGroupName>RTT:Athena</jobGroupName>
+              <testidentifier>Athena_FileGrepper</testidentifier>
+           </testToRemove>
+     
+     </jobGroup>
+ </jobGroups>
+       
+
+
+ 
+        
+    </rtt>
+</unifiedTestConfiguration>
diff --git a/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline.sh b/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline.sh
new file mode 100755
index 000000000000..5acdf5ee22e7
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# art-description: DAOD building TOPQ5 mc16
+# art-type: build
+
+pwd
+athena.py -c "inpuevtMax=500" RecExOnline/RecExOnline_User_Offline.py >& log_RecExOnline_User_Offline_py.log
+grep "successful run" log_RecExOnline_User_Offline_py.log
+grep "FATAL" log_RecExOnline_User_Offline_py.log
+grep "Traceback" log_RecExOnline_User_Offline_py.log
+grep "ERROR" log_RecExOnline_User_Offline_py.log
+root -b -q /afs/cern.ch/user/y/yunju/public/ARTRootMacro/RecExOnline_Test_Obj_His_RTT_Cpp_rename.C+ >& log_RecExOnline_Test_Obj_His_RTT_Cpp_rename_C.log
+day=$(date +"%u")
+prefix="/eos/user/y/yunju/ARTjobs/Rel_"
+wbmserver=$prefix$day
+rm -rf $wbmserver/*
+cp *.png $wbmserver
diff --git a/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue.sh b/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue.sh
new file mode 100755
index 000000000000..bd8d223dfa01
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# art-description: DAOD building TOPQ5 mc16
+# art-type: build
+
+pwd
+athena.py -c "REO_doAutoConfiguration=True" RecExOnline/RecExOnline_User_Offline_isOnlineTrue.py >& log_RecExOnline_User_Offline_isOnlineTrue_py.log
+grep "successful run" log_RecExOnline_User_Offline_isOnlineTrue_py.log
diff --git a/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue_cosmic.sh b/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue_cosmic.sh
new file mode 100755
index 000000000000..e2a7f0948e39
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue_cosmic.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# art-description: DAOD building TOPQ5 mc16
+# art-type: build
+
+pwd
+athena.py -c "REO_doAutoConfiguration=False; beamType='cosmics'" RecExOnline/RecExOnline_User_Offline_isOnlineTrue.py >& log_RecExOnline_User_Offline_isOnlineTrue_py_cosmic.log
+grep "successful run" log_RecExOnline_User_Offline_isOnlineTrue_py_cosmic.log
diff --git a/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue_noautoconfig.sh b/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue_noautoconfig.sh
new file mode 100755
index 000000000000..ec19bc0c232a
--- /dev/null
+++ b/Reconstruction/RecExample/RecExOnline/test/test_recexonline_user_offline_isonlinetrue_noautoconfig.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# art-description: DAOD building TOPQ5 mc16
+# art-type: build
+
+pwd
+athena.py -c "REO_doAutoConfiguration=False" RecExOnline/RecExOnline_User_Offline_isOnlineTrue.py >& log_RecExOnline_User_Offline_isOnlineTrue_py_noautoconfig.log
+grep "successful run" log_RecExOnline_User_Offline_isOnlineTrue_py_noautoconfig.log
-- 
GitLab