diff --git a/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py b/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py
index 25982834248be21804790ba5281ec2b3f55d9df2..020c5bc6c32fbb072d2474dda063f28cbab5abe7 100755
--- a/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py
+++ b/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py
@@ -77,9 +77,6 @@ def update_pcommands(args, cdict):
 
    cdict['trigger']['precommand'].append('_run_number=%d' % args.run_number)
 
-   if not args.oh_monitoring:
-       cdict['trigger']['precommand'].append("include('TrigServices/OfflineTHistSvc.py')")
-
    if args.perfmon:
       cdict['trigger']['precommand'].insert(0, "include('TrigCommon/PerfMon.py')")
 
@@ -340,6 +337,9 @@ def main():
    if not args.concurrent_events:
       args.concurrent_events = args.threads
 
+   if args.nprocs > 1 and not args.oh_monitoring:
+      parser.error('You have to run with -M/--oh-monitoring in case of multiple child processes')
+
    # Update args and set athena flags
    update_run_params(args)
    set_athena_flags(args)
@@ -357,6 +357,10 @@ def main():
    import TrigPSC.PscConfig
    TrigPSC.PscConfig.interactive = args.interactive
 
+   # Select the correct THistSvc
+   from TrigServices.TriggerUnixStandardSetup import _Conf
+   _Conf.useOnlineTHistSvc = args.oh_monitoring
+
    # Run HLTMPPU
    from HLTMPPy.runner import runHLTMPPy
    runHLTMPPy(cdict)
diff --git a/HLT/Trigger/TrigControl/TrigPSC/share/TrigPSCPythonSetup.py b/HLT/Trigger/TrigControl/TrigPSC/share/TrigPSCPythonSetup.py
index a74a7961141b4f7295215a9eddb9b6e6bf6a362c..3e2c42d7f616abe134cbe93d8b2fae8618719681 100755
--- a/HLT/Trigger/TrigControl/TrigPSC/share/TrigPSCPythonSetup.py
+++ b/HLT/Trigger/TrigControl/TrigPSC/share/TrigPSCPythonSetup.py
@@ -15,11 +15,6 @@ if joPath[-4:] == '.pkl':
 
 else:
 
-   ### basic setup files and definitions ----------------------------------------
-   pscBootstrapFile     = "TrigServices/TrigServicesBootstrap.py"   # PSC bootstrap
-   pscServiceSetupBegin = "TrigServices/TrigServicesCommonBegin.py" # Service definitions
-   pscServiceSetupEnd   = "TrigServices/TrigServicesCommonEnd.py"   # Service definitions
-
    import sys
    import os
    import string
@@ -56,9 +51,10 @@ else:
 
    ## These properties have alread been set on the C++ ApplicationMgr in the Psc
    ## but the configurable needs to have them set as well
+   theApp.EventLoop         = "HltEventLoopMgr"
    theApp.MessageSvcType    = PscConfig.optmap["MESSAGESVCTYPE"]
    theApp.JobOptionsSvcType = PscConfig.optmap["JOBOPTIONSSVCTYPE"]
-            
+
    ## add the MessageSvc and the JobOptionsSvc to the ServiceMgr
    from AthenaCommon.ConfigurableDb import getConfigurable
    ServiceMgr += getConfigurable(theApp.JobOptionsSvcType)("JobOptionsSvc")
@@ -79,16 +75,6 @@ else:
    ## file inclusion and tracing
    from AthenaCommon.Include import Include, IncludeError, include
 
-   ## set the default values
-   try:
-      include( pscBootstrapFile )
-   except Exception, e:
-      if isinstance( e, IncludeError ):
-         print sys.exc_type, e
-         theApp._exitstate = ExitCodes.INCLUDE_ERROR
-         sys.exit( ExitCodes.INCLUDE_ERROR )
-      raise
-
    ## properties of the application manager
    theApp.StatusCodeCheck = False     # enabled via TriggerFlags.Online.doValidation (see below)
 
@@ -134,15 +120,8 @@ else:
       print "\n"
 
    ### basic job configuration before user configuration ------------------------
-   try:
-      include( pscServiceSetupBegin )
-      include.block( pscServiceSetupBegin )
-   except Exception, e:
-      print sys.exc_type, e
-      if isinstance( e, IncludeError ):
-         theApp._exitstate = ExitCodes.INCLUDE_ERROR
-         sys.exit( theApp._exitstate )      
-      raise
+   from TrigServices.TriggerUnixStandardSetup import setupCommonServices
+   setupCommonServices()
 
    ### run user jobOptions file -------------------------------------------------
    try:
@@ -179,17 +158,10 @@ else:
       raise
 
    ### basic job configuration after user configuration -------------------------
-   try:
-      include( pscServiceSetupEnd )
-      include.block( pscServiceSetupEnd )
-   except Exception, e:
-      if isinstance( e, IncludeError ):
-         print sys.exc_type, e
-         theApp._exitstate = ExitCodes.INCLUDE_ERROR
-         sys.exit( ExitCodes.INCLUDE_ERROR )
-      raise
+   from TrigServices.TriggerUnixStandardSetup import setupCommonServicesEnd
+   setupCommonServicesEnd()
 
-   ### run optional command after user job options script -----------------------   
+   ### run optional command after user job options script -----------------------
    if PscConfig.optmap['POSTCOMMAND']:
       print "\n"
       print " +------------------------------------------------+ "
diff --git a/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt b/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt
index ddcaddd525d3f7452901616e663bb83fecf737c5..00bf3e641e139d4d1da159d2c11637ae2669607c 100644
--- a/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt
+++ b/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt
@@ -52,4 +52,3 @@ atlas_add_component( TrigServices
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
-atlas_install_joboptions( share/*.py )
diff --git a/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py b/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
index 0e3b4824c04b1e655ed428619ef83ecb5d12ad24..d98544402fd95d76306e1b95f5449e80ec0b0b6e 100644
--- a/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
+++ b/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
 
 # @file: TrigServicesConfig.py
 # @purpose: customized configurables
@@ -25,3 +25,47 @@ class TrigCOOLUpdateHelper(_TrigCOOLUpdateHelper):
       else:
          conddb.addFolderWithTag('TRIGGER',self.coolFolder,tag)
       
+
+def setupMessageSvc():
+   from AthenaCommon.AppMgr import theApp
+   from AthenaCommon.AppMgr import ServiceMgr as svcMgr
+   from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, WARNING
+
+   svcMgr.MessageSvc = theApp.service( "MessageSvc" )     # already instantiated
+   MessageSvc = svcMgr.MessageSvc
+   MessageSvc.OutputLevel = theApp.OutputLevel
+
+   MessageSvc.Format       = "%t  % F%35W%S%7W%R%T %0W%M"
+
+   # Message suppression
+   MessageSvc.enableSuppression    = False
+   MessageSvc.suppressRunningOnly  = True
+   MessageSvc.resetStatsAtBeginRun = True
+
+   # 0 = no suppression, negative = log-suppression, positive = normal suppression
+   # Do not rely on the defaultLimit property, always set each limit separately
+   MessageSvc.defaultLimit = -100
+   MessageSvc.verboseLimit = MessageSvc.defaultLimit
+   MessageSvc.debugLimit   = MessageSvc.defaultLimit
+   MessageSvc.infoLimit    = MessageSvc.defaultLimit
+   MessageSvc.warningLimit = MessageSvc.defaultLimit
+   MessageSvc.errorLimit   = 0
+   MessageSvc.fatalLimit   = 0
+
+   # set message limit to unlimited when general DEBUG is requested
+   if MessageSvc.OutputLevel<=DEBUG :
+      MessageSvc.defaultLimit = 0
+      MessageSvc.enableSuppression = False
+
+   # publish message counts during RUNNING in histogram
+   MessageSvc.publishStats = True
+   MessageSvc.publishLevel = INFO
+
+   # show summary statistics of messages in finalize
+   MessageSvc.showStats = True
+   MessageSvc.statLevel = WARNING
+   MessageSvc.statLevelRun = VERBOSE
+
+   # publish message counts during RUNNING in histogram
+   MessageSvc.publishStats = True
+   MessageSvc.publishLevel = INFO
diff --git a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
index b491fd18f40a7b2f47d4dec74333e72971c5ba83..b5a2bcd77b744533b9e3b36fc24865bc7a27dbf3 100644
--- a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
+++ b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
@@ -7,42 +7,60 @@
 
 class _Conf:
     """Some configuration flags for this module with defaults"""
-    useOnlineTHistSvc = True    # set via TrigServices/OfflineTHistSvc.py
-    athenaXT = False            # set below in _setupCommonServices
+    useOnlineTHistSvc = True    # set in athenaHLT.py
 
-def _eventLoopMgr(svcMgr):
-    if hasattr(svcMgr, 'HltEventLoopMgr'): return svcMgr.HltEventLoopMgr
-    return None
-    
-def _setupCommonServices():
-    from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, ERROR
-    
-    # Add timestamp to python logger
+def setupCommonServices():
+    from AthenaCommon import CfgMgr
+    from AthenaCommon.Logging import logging
+    from AthenaCommon.Constants import INFO
+    from AthenaCommon.AppMgr import ServiceMgr as svcMgr, theApp
+    from AthenaCommon.ConcurrencyFlags import jobproperties as jps
+
+    # Setup messaging for Python and C++
     from AthenaCommon.Logging import log
     log.setFormat("%(asctime)s  Py:%(name)-31s %(levelname)7s %(message)s")
 
-    from AthenaCommon.Logging import logging
+    # Create our own logger
     log = logging.getLogger( 'TriggerUnixStandardSetup::setupCommonServices:' )
+
+    from TrigServices.TrigServicesConfig import setupMessageSvc
+    setupMessageSvc()
      
     # Do the default Atlas job configuration first
-    import AthenaCommon.AtlasUnixStandardJob
+    import AthenaCommon.AtlasUnixStandardJob   # noqa: F401
+
+    # Now do HLT/thread specific configuration (see e.g. AtlasThreadedJob.py)
+    from StoreGate.StoreGateConf import SG__HiveMgrSvc
+    svcMgr += SG__HiveMgrSvc("EventDataSvc",
+                             NSlots = jps.ConcurrencyFlags.NumConcurrentEvents())
+
+    import StoreGate.StoreGateConf as StoreGateConf
+    svcMgr += StoreGateConf.StoreGateSvc("ConditionStore")
+
+    # ThreadPoolService thread local initialization
+    from GaudiHive.GaudiHiveConf import ThreadPoolSvc
+    svcMgr += ThreadPoolSvc("ThreadPoolSvc")
+    svcMgr.ThreadPoolSvc.ThreadInitTools = ["ThreadInitTool"]
+
+    from GaudiHive.GaudiHiveConf import AlgResourcePool
+    svcMgr += AlgResourcePool( OutputLevel = INFO,
+                               TopAlg=["AthMasterSeq"])       # this should enable control flow
+
+    from AthenaCommon.AlgSequence import AlgSequence
+    from SGComps.SGCompsConf import SGInputLoader
+    topSequence = AlgSequence()
+    topSequence += SGInputLoader(FailIfNoProxy = False)  # change to True eventually
+
+    from AthenaCommon.AlgScheduler import AlgScheduler
+    AlgScheduler.ShowDataDependencies(False)
+    AlgScheduler.ShowControlFlow(False)
+    AlgScheduler.setDataLoaderAlg ('SGInputLoader' )
+
+    # Setup SGCommitAuditor to sweep new DataObjects at end of Alg execute
+    theApp.AuditAlgorithms = True
+    from SGComps.SGCompsConf import SGCommitAuditor
+    svcMgr.AuditorSvc += SGCommitAuditor()
 
-    # Now do HLT specific configuration
-    from AthenaCommon import CfgMgr
-    from AthenaCommon.AppMgr import theApp
-    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-    from AthenaCommon.AppMgr import ToolSvc
-
-    # Check whether we are running in athenaXT
-    # Only a minimal set of properties should depend on this
-    import sys
-    if sys.modules.has_key('HLTTestApps'):
-        _Conf.athenaXT = True
-        log.debug("Configuration for athenaXT running")
-    else:
-        _Conf.athenaXT = False
-        log.debug("Configuration for online running")
-        
     # setup ROOT6
     from PyUtils.Helpers import ROOT6Setup
     ROOT6Setup()
@@ -61,27 +79,40 @@ def _setupCommonServices():
     # Initialization of DetDescrCnvSvc
     svcMgr += CfgMgr.DetDescrCnvSvc(
         # specify primary Identifier dictionary to be used
-        IdDictName = "IdDictParser/ATLAS_IDS.xml"
-        )
+        IdDictName = "IdDictParser/ATLAS_IDS.xml")
+
     theApp.CreateSvc += [ svcMgr.DetDescrCnvSvc.getFullName() ]
     svcMgr.EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ]
 
-    # --- ByteStreamCnvSvc configuration
-    svcMgr += CfgMgr.ByteStreamCnvSvc("ByteStreamCnvSvc")
+    # ByteStreamCnvSvc configuration
+    from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamCnvSvc
+    svcMgr += ByteStreamCnvSvc("ByteStreamCnvSvc")
     svcMgr.EventPersistencySvc.CnvServices += [ "ByteStreamCnvSvc" ]
-    
-    # Disable history
-    svcMgr += CfgMgr.HistorySvc()
-    svcMgr.HistorySvc.Activate = False
+
+    from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamInputSvc
+    svcMgr += TrigByteStreamInputSvc("ByteStreamInputSvc")
+
+    from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigEventSelectorByteStream
+    svcMgr += TrigEventSelectorByteStream("EventSelector",
+                                          ByteStreamInputSvc = svcMgr.ByteStreamInputSvc)
+    theApp.EvtSel = "EventSelector"
+
+    from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamCnvSvc
+    svcMgr += TrigByteStreamCnvSvc("TrigByteStreamCnvSvc")
+
+    # make the HltEventLoopMgr service available
+    svcMgr.HltEventLoopMgr = theApp.service( "HltEventLoopMgr" )     # already instantiated
+    svcMgr.HltEventLoopMgr.WhiteboardSvc = "EventDataSvc"
+    svcMgr.HltEventLoopMgr.SchedulerSvc = AlgScheduler.getScheduler().getName()
+    svcMgr.HltEventLoopMgr.EvtSel = svcMgr.EventSelector
+    svcMgr.HltEventLoopMgr.OutputCnvSvc = svcMgr.TrigByteStreamCnvSvc
+
+    from TrigOutputHandling.TrigOutputHandlingConfig import HLTResultMTMakerCfg
+    svcMgr.HltEventLoopMgr.ResultMaker = HLTResultMTMakerCfg()
 
     # Configuration of Interval of Validity Service
     svcMgr += CfgMgr.IOVSvc()
     
-    # Configure CoreDumpSvc
-    if not hasattr(svcMgr,"CoreDumpSvc"):
-        from AthenaServices.Configurables import CoreDumpSvc
-        svcMgr += CoreDumpSvc()
-        
     # Configure COOL update helper tool
     # from TrigServices.TrigServicesConfig import TrigCOOLUpdateHelper
     # _eventLoopMgr(svcMgr).CoolUpdateTool = TrigCOOLUpdateHelper()
@@ -109,17 +140,16 @@ def _setupCommonServices():
     return
 
 
-def _setupCommonServicesEnd():
-    from AthenaCommon.AppMgr import theApp
+def setupCommonServicesEnd():
     from AthenaCommon.AppMgr import ServiceMgr as svcMgr    
     from AthenaCommon.Logging import logging
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-    
+
     log = logging.getLogger( 'TriggerUnixStandardSetup::setupCommonServicesEnd:' )
     
     # --- create the ByteStreamCnvSvc after the Detector Description otherwise
     # --- the initialization of converters fails
-    theApp.CreateSvc += [ svcMgr.ByteStreamCnvSvc.getFullName() ]    
+    #from AthenaCommon.AppMgr import theApp
+    #theApp.CreateSvc += [ svcMgr.ByteStreamCnvSvc.getFullName() ]
 
     # Make sure no THistSvc output/input stream is defined for online running
     if _Conf.useOnlineTHistSvc:
@@ -154,70 +184,5 @@ def _setupCommonServicesEnd():
         svcMgr.IOVDbSvc.CacheAlign = 0  # VERY IMPORTANT to get unique queries for folder udpates (see Savannah #81092)
         svcMgr.IOVDbSvc.CacheRun = 0
         svcMgr.IOVDbSvc.CacheTime = 0
-        
-    # Flag to extract trigger configuration
-    if TriggerFlags.Online.doDBConfig():
-        from TrigConfigSvc import DoDBConfig
-        
-    # --- print out configuration details
-    _printConfiguration(log.name)
-    
-    return 
-    
-def _printConfiguration(loggerName):
-    from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, ERROR
-
-    from AthenaCommon.Logging import logging
-    if loggerName == '':
-        loggerName = 'TriggerUnixStandardSetup::_printConfiguration'
-        
-    log = logging.getLogger( loggerName )
-    
-    # --- print out configuration details
-    # ---
-    from AthenaCommon.AppMgr import theApp
-    log.debug("---> Application Manager")
-    log.debug(theApp)
-    
-    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-    log.debug("---> Service Manager")
-    log.debug(svcMgr)
-
-    from AthenaCommon.AlgSequence import AlgSequence
-    topSequence = AlgSequence()
-    log.debug("---> Algorithm Sequence")
-    log.debug(topSequence)
-    
-    return
-
-def setupHLTServicesBegin():
-    from AthenaCommon import CfgMgr
-    from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, ERROR
-    from AthenaCommon.AppMgr import theApp
-    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-    from AthenaCommon.Logging import logging
-    log = logging.getLogger( 'TriggerUnixStandardSetup::setupHLTServicesBegin:' )
-    log.debug( "---> Start" )
-
-    # --- setup the standard services
-    _setupCommonServices()   
-
-    # --- Hlt ROBDataProvider configuration
-    svcMgr += CfgMgr.HltROBDataProviderSvc("ROBDataProviderSvc")
-    theApp.CreateSvc += [ svcMgr.ROBDataProviderSvc.getFullName() ]
-
-    log.debug( "---> End" )
-    return
-
-def setupHLTServicesEnd():
-    from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, ERROR
-
-    from AthenaCommon.Logging import logging
-    log = logging.getLogger( 'TriggerUnixStandardSetup::setupHLTServicesEnd:' )
-    log.debug( "---> Start" )
-
-    # --- final modifications to standard services
-    _setupCommonServicesEnd()      
 
-    log.debug( "---> End" )
     return
diff --git a/HLT/Trigger/TrigControl/TrigServices/share/MessageSvc.py b/HLT/Trigger/TrigControl/TrigServices/share/MessageSvc.py
deleted file mode 100644
index dd17ca5e0bbf8c2b36af7b6a0b5b4c81ee86f8e7..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigControl/TrigServices/share/MessageSvc.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#**************************************************************
-#
-#  MessageSvc configuration file
-#
-#==============================================================
-from AthenaCommon.AppMgr import theApp
-from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-from AthenaCommon.Constants import *
-
-# make the message service available
-svcMgr.MessageSvc = theApp.service( "MessageSvc" )     # already instantiated
-MessageSvc = svcMgr.MessageSvc
-MessageSvc.OutputLevel = theApp.OutputLevel
-
-# Use color for different message levels
-# --------------------------------------
-MessageSvc.useColors    = False
-
-# Format string for all messages
-# ------------------------------
-MessageSvc.Format       = "%t  % F%35W%S%7W%R%T %0W%M"
-
-# Message suppression
-# -------------------
-MessageSvc.enableSuppression    = False
-MessageSvc.suppressRunningOnly  = True
-MessageSvc.resetStatsAtBeginRun = True
-
-# 0 = no suppression, negative = log-suppression, positive = normal suppression
-# Do not rely on the defaultLimit property, always set each limit separately
-MessageSvc.defaultLimit = -100
-MessageSvc.verboseLimit = MessageSvc.defaultLimit
-MessageSvc.debugLimit   = MessageSvc.defaultLimit
-MessageSvc.infoLimit    = MessageSvc.defaultLimit
-MessageSvc.warningLimit = MessageSvc.defaultLimit
-MessageSvc.errorLimit   = 0
-MessageSvc.fatalLimit   = 0
-
-# set message limit to unlimited when general DEBUG is requested
-if MessageSvc.OutputLevel<=DEBUG :
-    MessageSvc.defaultLimit = 0
-    MessageSvc.enableSuppression = False
-
-# show summary statistics of messages in finalize
-# -----------------------------------------------
-MessageSvc.showStats = True
-MessageSvc.statLevel = WARNING
-MessageSvc.statLevelRun = VERBOSE
-
-# publish message counts during RUNNING in histogram
-# --------------------------------------------------
-MessageSvc.publishStats = True
-MessageSvc.publishLevel = INFO
-
-
-# report messages via ERS
-# -----------------------
-# report given message severities via ERS
-# MessageSvc.useErsVerbose = ['*']
-# MessageSvc.useErsDebug = ['*']
-# MessageSvc.useErsInfo = ['*']
-# MessageSvc.useErsWarning = ['*']
-# MessageSvc.useErsError = ['*']
-# MessageSvc.useErsFatal = ['*']
-
-# Set to True, if ERS messages should be duplicated to the MsgStream
-# MessageSvc.alwaysUseMsgStream = True
-# Only forward message during RUNNING
-# MessageSvc.useErsRunningOnly = True
-
-#==============================================================
-#
-# End of MessageSvc configuration file
-#
-#**************************************************************
diff --git a/HLT/Trigger/TrigControl/TrigServices/share/OfflineTHistSvc.py b/HLT/Trigger/TrigControl/TrigServices/share/OfflineTHistSvc.py
deleted file mode 100644
index 021de3330cddf8faf781ccaea1fe04fc9d3b61a9..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigControl/TrigServices/share/OfflineTHistSvc.py
+++ /dev/null
@@ -1,13 +0,0 @@
-## @file   OfflineTHistSvc.py
-## @brief  Configure the offline THistSvc
-## @author Frank Winklmeier <fwinkl@cern.ch>
-##
-## This fragment will be included by athenaHLT if we are
-## running withtout the OH monitoring. Otherwise, the default
-## is to use the online histogramming service (TrigMonTHistSvc)
-###################################################################
-
-from TrigServices.TriggerUnixStandardSetup import _Conf
-_Conf.useOnlineTHistSvc = False
-del _Conf
-
diff --git a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesBootstrap.py b/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesBootstrap.py
deleted file mode 100644
index 3bf4063c5b73dcca5f58dfd5674becd2fc7efe63..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesBootstrap.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#**************************************************************
-#
-# HLT bootstrap options file
-#
-#==============================================================
-
-#--------------------------------------------------------------
-# HLT specific event loop and output stream
-#--------------------------------------------------------------
-theApp.EventLoop         = "HltEventLoopMgr"
-#theApp.OutStreamType     = "AthenaOutputStream"
-
-#--------------------------------------------------------------
-# in Hlt the EventLoop is controlled by the HLT Processing Unit
-# so the default is no Event Selector
-#--------------------------------------------------------------
-theApp.EvtSel            = "NONE"
-
-#--------------------------------------------------------------
-# take care of job options legacy
-#--------------------------------------------------------------
-theApp.JobOptionsPath    = ""
-theApp.JobOptionsType    = "NONE"
-
-#==============================================================
-#
-# End of HLT bootstrap options file
-#
-#**************************************************************
diff --git a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesCommonBegin.py b/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesCommonBegin.py
deleted file mode 100644
index bddc77849fa2ad16e95f5e50c9fd4cea76687b9c..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesCommonBegin.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#**************************************************************
-#
-# HLT common configuration file: TrigServicesCommonBegin.py
-#
-#==============================================================
-
-include( "TrigServices/MessageSvc.py" )
-include( "TrigServices/TrigServicesEventLoopMgr.py" )
-
-## HLT standard service configuration
-# from TrigServices.TriggerUnixStandardSetup import setupHLTServicesBegin
-# setupHLTServicesBegin()
-## clean-up: avoid running multiple times this method
-# del setupHLTServicesBegin
-
-#==============================================================
-#
-# End of HLT common configuration file: TrigServicesCommonBegin.py
-#
-#**************************************************************
diff --git a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesCommonEnd.py b/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesCommonEnd.py
deleted file mode 100644
index 2cd3fa3055226dad589ffef020f348b06a80402a..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesCommonEnd.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#**************************************************************
-#
-# HLT common configuration file: TrigServicesCommonEnd.py
-#
-#==============================================================
-
-## get a handle on the ServiceMgr
-# from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-
-## HLT standard service configuration 
-# from TrigServices.TriggerUnixStandardSetup import setupHLTServicesEnd
-# setupHLTServicesEnd()
-## clean-up: avoid running multiple times this method
-# del setupHLTServicesEnd
-#==============================================================
-#
-# End of HLT common configuration file: TrigServicesCommonEnd.py
-#
-#**************************************************************
diff --git a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesEventLoopMgr.py b/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesEventLoopMgr.py
deleted file mode 100644
index c4f65529f9e6e763118c7273ee04e1fe7dc9c6bb..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesEventLoopMgr.py
+++ /dev/null
@@ -1,243 +0,0 @@
-#**************************************************************
-#
-# TrigServicesEventLoopMgr configuration file
-#
-#==============================================================
-from AthenaCommon import CfgMgr
-from AthenaCommon.AppMgr import theApp
-from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-from AthenaCommon.AppMgr import ToolSvc
-
-# from AthenaCommon.Constants import *
-
-# ==============================================================================
-# Set up from StoreGateHiveExample.py and AthExHiveOpts.py and AtlasThreadedJob.py
-# ==============================================================================
-#nThreads = 1
-#numStores = 1
-#numAlgsInFlight = nThreads
-
-#from AthenaCommon.ConcurrencyFlags import jobproperties as jps
-#jps.ConcurrencyFlags.NumThreads = nThreads
-#jps.ConcurrencyFlags.NumConcurrentEvents = numStores
-
-# from GaudiCommonSvc.GaudiCommonSvcConf import AlgContextSvc
-# svcMgr += AlgContextSvc("AlgContextSvc")
-# svcMgr.AlgContextSvc.Check = True
-
-from StoreGate.StoreGateConf import SG__HiveMgrSvc
-svcMgr += SG__HiveMgrSvc("EventDataSvc")
-#svcMgr.EventDataSvc.NSlots = numStores
-#svcMgr.EventDataSvc.OutputLevel = VERBOSE
-
-from GaudiHive.GaudiHiveConf import AlgResourcePool
-arp=AlgResourcePool()
-arp.TopAlg=["AthMasterSeq"] #this should enable control flow
-svcMgr += arp
-
-from AthenaCommon.AlgScheduler import AlgScheduler
-#AlgScheduler.setThreadPoolSize(nThreads)
-AlgScheduler.ShowDataDependencies(True)
-AlgScheduler.ShowControlFlow(True)
-
-from StoreGate.StoreGateConf import StoreGateSvc
-svcMgr += StoreGateSvc()
-
-from StoreGate.StoreGateConf import SGImplSvc
-svcMgr += SGImplSvc("SGImplSvc")
-
-# ThreadPoolService thread local initialization
-from GaudiHive.GaudiHiveConf import ThreadPoolSvc
-svcMgr += ThreadPoolSvc("ThreadPoolSvc")
-svcMgr.ThreadPoolSvc.ThreadInitTools = ["ThreadInitTool"]
-
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-#algCardinality = nThreads
-
-# if (algCardinality != 1):
-#     for alg in topSequence:
-#        name = alg.name()
-#        alg.Cardinality = algCardinality
-
-from SGComps.SGCompsConf import SGInputLoader
-topSequence += SGInputLoader( FailIfNoProxy=False )
-
-theAuditorSvc = svcMgr.AuditorSvc
-theApp.AuditAlgorithms=True
-from SGComps.SGCompsConf import SGCommitAuditor
-theAuditorSvc += SGCommitAuditor()
-
-# ==============================================================================
-# Event selector and input service
-# ==============================================================================
-from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamInputSvc
-inputSvc = TrigByteStreamInputSvc("ByteStreamInputSvc")
-svcMgr += inputSvc
-
-from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigEventSelectorByteStream
-evtSel = TrigEventSelectorByteStream("EventSelector")
-evtSel.ByteStreamInputSvc = inputSvc
-svcMgr += evtSel
-theApp.EvtSel = "EventSelector"
-
-# ==============================================================================
-# Output conversion service
-# ==============================================================================
-from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamCnvSvc
-outputCnvSvc = TrigByteStreamCnvSvc("TrigByteStreamCnvSvc")
-svcMgr += outputCnvSvc
-
-# ==============================================================================
-# Some extra services
-# ==============================================================================
-## basic Gaudi services from AtlasUnixStandardJob.py
-import GaudiSvc.GaudiSvcConf as GaudiSvcConf
-svcMgr += GaudiSvcConf.IncidentSvc()
-svcMgr += GaudiSvcConf.EvtPersistencySvc( "EventPersistencySvc" )
-svcMgr += GaudiSvcConf.HistogramSvc( "HistogramDataSvc" )
-svcMgr += GaudiSvcConf.NTupleSvc()
-svcMgr += GaudiSvcConf.ToolSvc()
-svcMgr += GaudiSvcConf.RndmGenSvc()
-svcMgr += GaudiSvcConf.ChronoStatSvc()
-
-#####
-
-from StoreGate.StoreGateConf import StoreGateSvc
-svcMgr += StoreGateSvc("DetectorStore")
-
-# ProxyProviderSvc services configuration
-svcMgr += CfgMgr.ProxyProviderSvc()
-
-# --- ByteStreamAddressProviderSvc configuration
-svcMgr += CfgMgr.ByteStreamAddressProviderSvc()
-svcMgr.ProxyProviderSvc.ProviderNames += [ "ByteStreamAddressProviderSvc" ]
-#theApp.CreateSvc += [ svcMgr.ByteStreamAddressProviderSvc.getFullName() ]
-
-# Initialization of DetDescrCnvSvc
-svcMgr += CfgMgr.DetDescrCnvSvc(
-    # specify primary Identifier dictionary to be used
-    IdDictName = "IdDictParser/ATLAS_IDS.xml"
-    )
-theApp.CreateSvc += [ svcMgr.DetDescrCnvSvc.getFullName() ]
-svcMgr.EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ]
-
-# --- ByteStreamCnvSvc configuration
-svcMgr += CfgMgr.ByteStreamCnvSvc("ByteStreamCnvSvc")
-svcMgr.EventPersistencySvc.CnvServices += [ "ByteStreamCnvSvc" ]
-
-# dictionary services from AtlasUnixStandardJob.py
-# the dict loader
-import AthenaServices.AthenaServicesConf as AthenaServicesConf
-if not hasattr(svcMgr, 'AthDictLoaderSvc'):
-    svcMgr += AthenaServicesConf.AthDictLoaderSvc()
-theApp.CreateSvc += [svcMgr.AthDictLoaderSvc.getFullJobOptName()]
-
-# the dict checker
-if not hasattr(svcMgr, 'AthenaSealSvc'):
-    svcMgr += AthenaServicesConf.AthenaSealSvc()
-theApp.CreateSvc += [svcMgr.AthenaSealSvc.getFullJobOptName()]
-
-# ==============================================================================
-#  HLT result monitoring
-# ==============================================================================
-from TrigOutputHandling.TrigOutputHandlingConf import HLTResultMTMaker
-hltResultMaker =  HLTResultMTMaker()
-
-from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
-hltResultMaker.MonTool = GenericMonitoringTool("MonOfHLTResultMTtest")
-hltResultMaker.MonTool.HistPath = "OutputMonitoring"
-hltResultMaker.MonTool.Histograms = [ defineHistogram( 'TIME_build', path='EXPERT', type='TH1F', title='Time of result construction in;[micro seccond]',
-                                                       xbins=100, xmin=0, xmax=1000 ),
-                                      defineHistogram( 'nstreams', path='EXPERT', type='TH1F', title='number of streams',
-                                                       xbins=60, xmin=0, xmax=60 ),
-                                      defineHistogram( 'nfrags', path='EXPERT', type='TH1F', title='number of HLT results',
-                                                       xbins=10, xmin=0, xmax=10 ),
-                                      defineHistogram( 'sizeMain', path='EXPERT', type='TH1F', title='Main (physics) HLT Result size;4B words',
-                                                       xbins=100, xmin=-1, xmax=999 ) ] # 1000 k span
-
-
-# ==============================================================================
-#  Message format
-# ==============================================================================
-msgFmt = "% F%40W%S %4W%e%s %7W%R %T %0W%M"
-svcMgr.MessageSvc.Format = msgFmt
-
-# ==============================================================================
-# General setup
-# ==============================================================================
-
-# make the HltEventLoopMgr service available
-svcMgr.HltEventLoopMgr = theApp.service( "HltEventLoopMgr" )     # already instantiated
-HltEventLoopMgr = svcMgr.HltEventLoopMgr
-HltEventLoopMgr.WhiteboardSvc = "EventDataSvc"
-HltEventLoopMgr.SchedulerSvc = AlgScheduler.getScheduler().getName()
-HltEventLoopMgr.EvtSel = evtSel
-HltEventLoopMgr.OutputCnvSvc = outputCnvSvc
-HltEventLoopMgr.ResultMaker = hltResultMaker
-
-
-# configure here Level-1 CTP ROB identifier which is used in HLT
-# HltEventLoopMgr.Lvl1CTPROBid = 0x770001
-
-# request that events with invalid or missing CTP ROBs are skipped by the HltEventLoopMgr
-# (default: don't skip these events)
-# HltEventLoopMgr.Lvl1CTPROBcheck = TRUE
-
-#
-# name of the HLT Result object in StoreGate
-#
-# HltEventLoopMgr.HltResultName = "HLTResult_HLT"
-
-#
-# handling of truncated HLT Results
-#
-# switch on saving of events with truncated HLT results to DEBUG stream (default FALSE)
-#HltEventLoopMgr.WriteTruncatedHLTtoDebug = FALSE 
-# name of DEBUG Stream (default "TruncatedHLTResult")
-#HltEventLoopMgr.HltTruncationDebugStreamName = "TruncatedHLTResult"
-
-# list of stream names which should not be send to the truncation DEBUG stream (default ["CostMonitoring"]) 
-# HltEventLoopMgr.ExcludeFromHltTruncationDebugStream = ["CostMonitoring"]
-
-#
-# properties for the HLT result size histograms
-# --> set upper edge of histogram to maximum allowed number of words in HLT
-#
-# HltEventLoopMgr.histHltResultSize=("HltResultSize",0,125000,100)
-
-#
-# Configuration of EDM size monitoring plots
-#
-# try:
-    # from TrigEDMConfig.TriggerEDM import EDMDetails,getTypeAndKey,keyToLabel
-    # from TrigEDMConfig.TriggerEDM import TriggerHLTList
-    # 
-    # # TODO update to use import TriggerHLTList directly
-    # #from TrigEDMConfig.TriggerEDM import TriggerL2List,TriggerEFList
-    # #TriggerHLTList = list(set(TriggerL2List).union(TriggerEFList))
-    # 
-    # l = []
-    # for item in TriggerHLTList:
-        # if ('BS' in item[1].split()) or ('DS' in item[1].split()):
-            # t,k = getTypeAndKey(item[0])
-            # ctype = t
-            # if EDMDetails[t].has_key('collection'):
-                # ctype = EDMDetails[t]['collection']
-            # l += [ctype+'__'+keyToLabel(k)]
-    # # add a bin for not accounted collections
-    # l += ['not__configured']
-# 
-    # HltEventLoopMgr.HltEDMCollectionNames = l
-    # number_of_collections=len( HltEventLoopMgr.HltEDMCollectionNames )
-    # HltEventLoopMgr.histHltEdmSizes=("HltEDMSizes",0., 15000., number_of_collections)
-# except ImportError,e:
-    # print " +----------------------------------------------------------------------+ "
-    # print " | No initial configuration for EDM monitoring plots will be available! | "
-    # print " +----------------------------------------------------------------------+ "
-    # print e
-#==============================================================
-#
-# End of TrigServicesEventLoopMgr configuration file
-#
-#**************************************************************
diff --git a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesTHistSvc.py b/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesTHistSvc.py
deleted file mode 100644
index 5cb0622e166a5e67c9365db5814313b808c0db4d..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesTHistSvc.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#**************************************************************
-#
-# TrigServicesTHistSvc configuration file
-#
-#==============================================================
-
-# loading of this library (not a problem if done twice)
-theApp.Dlls += [ "TrigServices" ]
-
-# service creation
-theApp.ExtSvc += [ "HltTHistSvc/THistSvc" ]
-theApp.MultiThreadExtSvc += [ "HltTHistSvc/THistSvc" ]
-
-
-# just a helper function
-def defineTHistSvcOutputFile(dir, name, opt='NEW', service='THistSvc'):
-    if numberOfThreads.value() == 0:
-        THistSvc = Service(service)
-        THistSvc.Output += [dir+" DATAFILE=\'"+name+"' OPT=\'"+opt+"\'" ]
-        return
-    for n in range(0,numberOfThreads.value()):
-        threadID = '__%(#)d' % { '#': n}
-        THistSvc = Service ( service+threadID )
-        THistSvc.Output += [dir+" DATAFILE=\'"+name+threadID+"' OPT=\'"+opt+"\'" ]
-
-# default settings 
-defineTHistSvcOutputFile("SHIFT", "monitoring-shift.root")
-defineTHistSvcOutputFile("EXPERT", "monitoring-expert.root")
-defineTHistSvcOutputFile("DEBUG", "monitoring-debug.root") 
-defineTHistSvcOutputFile("RUNSTAT", "monitoring-runstat.root") 
-
-
-
-# user can also specify REGEX used to check Histograms Naming Convention
-# THistSvc = Service("THistSvc")
-#
-# all sort of regex can be given
-# THistSvc.ExcludeName = ".+LAr.+" # no LAr histograms any more
-# THistSvc.IncludeName = "/SHIFT/.+"   # only monitoring allowed 
-#
-# the default is (implementation of the naming convention):
-# see: https://edms.cern.ch/document/710911/1
-# see: https://twiki.cern.ch/twiki/bin/view/Atlas/AthenaMTHistogramming
-#
-# THistSvc.ExcludeName = ".*\..*"
-# THistSvc.IncludeName = "^/((SHIFT)|(EXPERT)|(DEBUG)|(RUNSTAT))/.+/.+"
-# 
-# Similar can be specified for histogram types (name of the ROOT class)
-# example below can be used to exclude 2dim histograms from being registered
-# THistSvc.ExcludeType = ".+2.+" 
-# example below accepts only 1 dimensional integer histogram
-# THistSvc.ExcludeType = ".+"
-# THistSvc.IncludeType = "TH1I"
-
-#==============================================================
-#
-# End of TrigServicesTHistSvc configuration file
-#
-#**************************************************************
diff --git a/HLT/Trigger/TrigControl/TrigServices/share/hadd.C b/HLT/Trigger/TrigControl/TrigServices/share/hadd.C
deleted file mode 100644
index f566a4f55c1f3977bdf581ae31435c5c02b3dcf3..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigControl/TrigServices/share/hadd.C
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
-
-  NOTE: This macro is kept for back compatibility only.
-  Use instead the executable $ROOTSYS/bin/hadd
-  
-  This macro will add histograms from a list of root files and write them
-  to a target root file. The target file is newly created and must not be
-  identical to one of the source files.
-
-  Author: Sven A. Schmidt, sven.schmidt@cern.ch
-  Date:   13.2.2001
-
-  This code is based on the hadd.C example by Rene Brun and Dirk Geppert,
-  which had a problem with directories more than one level deep.
-  (see macro hadd_old.C for this previous implementation).
-  
-  The macro from Sven has been enhanced by 
-     Anne-Sylvie Nicollerat <Anne-Sylvie.Nicollerat@cern.ch>
-   to automatically add Trees (via a chain of trees).
-  
-  To use this macro, modify the file names in function hadd.
-  
-  NB: This macro is provided as a tutorial.
-      Use $ROOTSYS/bin/hadd to merge many histogram files
-
-  ATLAS HLT COMMENT by T. Bold:
-  This is modified macro used to deal with the sort of strange
-  ROOT files generated while athenaMT is run. There possibly
-  number of the output files. With this one can work whit standard hadd.
-  But in fact there is number of the TTrees in the file 
-  having the same name, just subsequent sequence(version) number. 
-  This can only be handled by this script. 
- */
-
-
-#include <string.h>
-#include "TChain.h"
-#include "TFile.h"
-#include "TH1.h"
-#include "TTree.h"
-#include "TKey.h"
-#include "Riostream.h"
-
-TList *FileList;
-TFile *Target;
-
-void MergeRootfile( TDirectory *target, TList *sourcelist );
-
-
-void hadd() {
-   // in an interactive ROOT session, edit the file names
-   // Target and FileList, then
-   // root > .L hadd.C
-   // root > hadd()
-   
-  Target = TFile::Open( "result.root", "RECREATE" );
-  
-  FileList = new TList();
-  FileList->Add( TFile::Open("hsimple1.root") );
-  FileList->Add( TFile::Open("hsimple2.root") );
-  
-  MergeRootfile( Target, FileList );
-
-}   
-
-TTree * mergeCircularTrees(const char* treename, TDirectory *dir, TTree *nTree = 0) {
-    
-    TString basename(treename);
-    TIter nextIter(gDirectory->GetListOfKeys()); 
-    gDirectory->GetListOfKeys()->Print();                          
-    TKey *obj;
-    TTree *tptr;
-    TList myTreesList;
-
-    while ( (obj = (TKey *)nextIter()) != 0 ) {                                
-
-	if ( TString(obj->GetClassName()) == TString("TTree") ) {
-	    // it is the tree let's read it in
-	    tptr = (TTree *)obj->ReadObj();
-	    if ( TString(tptr->GetName()) == basename  ) { 
-		if ( nTree == 0 ) {
-		    nTree = (TTree*)tptr->Clone();
-		    nTree->SetCircular(kMaxLong64); // maximum circularity
-		}
-		else
-		    myTreesList.AddLast(tptr);
-	    }    
-	}
-    }
-
-    dir->cd();
-    nTree->SetDirectory(dir);
-    nTree->Merge(&myTreesList);
-    return nTree;
-}
-
-void MergeRootfile( TDirectory *target, TList *sourcelist ) {
-
-  //  cout << "Target path: " << target->GetPath() << endl;
-  TString path( (char*)strstr( target->GetPath(), ":" ) );
-  path.Remove( 0, 2 );
-
-  TFile *first_source = (TFile*)sourcelist->First();
-  first_source->cd( path );
-  TDirectory *current_sourcedir = gDirectory;
-  //gain time, do not add the objects in the list in memory
-  Bool_t status = TH1::AddDirectoryStatus();
-  TH1::AddDirectory(kFALSE);
-
-  // loop over all keys in this directory
-  TTree *nTree = 0;
-  TIter nextkey( current_sourcedir->GetListOfKeys() );
-  TKey *key, *oldkey=0;
-  while ( (key = (TKey*)nextkey())) {
-      //      cout << "found key " << key->GetName() << endl;
-      //keep only the highest cycle number for each key
-      if (oldkey)
-	  if ( strcmp(oldkey->GetName(),key->GetName()) == 0 ) {
-	      //      cout << "skipping key " << key->GetName() << endl;
-	      continue;
-	  }
-      // always set oldkey ptr
-      oldkey = key;
-    
-    // read object from first source file
-    first_source->cd( path );
-    TObject *obj = key->ReadObj();
-
-    if ( obj->IsA()->InheritsFrom( "TH1" ) ) {
-      // descendant of TH1 -> merge it
-
-      //      cout << "Merging histogram " << obj->GetName() << endl;
-      TH1 *h1 = (TH1*)obj;
-
-      // loop over all source files and add the content of the
-      // correspondant histogram to the one pointed to by "h1"
-      TFile *nextsource = (TFile*)sourcelist->After( first_source );
-      while ( nextsource ) {
-        
-        // make sure we are at the correct directory level by cd'ing to path
-        nextsource->cd( path );
-        TKey *key2 = (TKey*)gDirectory->GetListOfKeys()->FindObject(h1->GetName());
-        if (key2) {
-           TH1 *h2 = (TH1*)key2->ReadObj();
-           h1->Add( h2 );
-           delete h2;
-        }
-
-        nextsource = (TFile*)sourcelist->After( nextsource );
-      }
-    }
-    else if ( obj->IsA()->InheritsFrom( "TTree" ) ) {
-      
-      // loop over all source files create a chain of Trees "globChain"
-      const char* obj_name= obj->GetName();
-      cout << "merging all trees in first file" << endl;
-      nTree = mergeCircularTrees(obj_name, target);
-      cout << "merged trees in first file" << endl;
-
-      TFile *nextsource = (TFile*)sourcelist->After( first_source );
-
-     while ( nextsource ) {
-	 nextsource->cd( path );
-	 cout << "merging all trees in file "<< nextsource->GetName() << endl;
-	 mergeCircularTrees(obj_name, target, nTree);
-	 cout << "merged all trees "<< nextsource->GetName() << endl;
-	 nextsource = (TFile*)sourcelist->After( nextsource );
-     }
-
-    } else if ( obj->IsA()->InheritsFrom( "TDirectory" ) ) {
-      // it's a subdirectory
-
-      cout << "Found subdirectory " << obj->GetName() << endl;
-
-      // create a new subdir of same name and title in the target file
-      target->cd();
-      TDirectory *newdir = target->mkdir( obj->GetName(), obj->GetTitle() );
-
-      // newdir is now the starting point of another round of merging
-      // newdir still knows its depth within the target file via
-      // GetPath(), so we can still figure out where we are in the recursion
-      MergeRootfile( newdir, sourcelist );
-
-    } else {
-
-      // object is of no type that we know or can handle
-      cout << "Unknown object type, name: " 
-           << obj->GetName() << " title: " << obj->GetTitle() << endl;
-    }
-
-    // now write the merged histogram (which is "in" obj) to the target file
-    // note that this will just store obj in the current directory level,
-    // which is not persistent until the complete directory itself is stored
-    // by "target->Write()" below
-    if ( obj ) {
-      target->cd();
-
-      //!!if the object is a tree, it is stored in globChain...
-      if(obj->IsA()->InheritsFrom( "TTree" )) {
-	  nTree->Write();
-	  nTree->Print();
-      }
-      else
-	obj->Write( key->GetName() );
-    }
-
-  } // while ( ( TKey *key = (TKey*)nextkey() ) )
-
-  // save modifications to target file
-  target->SaveSelf(kTRUE);
-  TH1::AddDirectory(status);
-}
diff --git a/HLT/Trigger/TrigControl/TrigServices/share/hadd.sh b/HLT/Trigger/TrigControl/TrigServices/share/hadd.sh
deleted file mode 100755
index f68f3bd59d3ff9296ea3ec97f77303d46ce697dc..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigControl/TrigServices/share/hadd.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-# generate the script for ROOT hadd.C
-
-#script which will be generated in order to do the merging job
-sums=thishadd.C
-
-# find out where hadd.C is located
-haddmacro=$( dirname $(which hadd.sh))"/hadd.C"
-#echo $haddmacro
-
-if [ ! -f $haddmacro ]
-    then
-    echo "$haddmacro macro could not be found"
-    echo "It is expected to be in the same directory as hadd.sh"
-    echo "Check your installation!"
-    exit 0
-fi
-
-
-# make local copy of the macro
-cp $haddmacro .
-
-
-if [ $# -lt 2 ]
-    then
-    echo "Usage: hadd.sh destination source1|source2|..."
-    exit 127
-fi
-
-output=$1
-shift 1
-
-#build the actual script 
-echo "{
-gROOT->LoadMacro(\"hadd.C+\");
-TFile *foutput = TFile::Open(\"$output\",\"NEW\");
-if ( foutput == 0 ) {
-    cout << \"output file already exist, exitting ...\" << endl;
-    gROOT->ProcessLine(\".q\");
-}
-TList *inputs = new TList();
-
-" > $sums
-
-
-
-echo "INPUT FILES: " `ls $@` 
-echo "OUTPUT FILE: "  $output
-
-# trick to expand wildcards
-for f in `ls $@`
-do
-  echo "inputs->AddLast( TFile::Open (\"$f\") );" >> $sums
-done
-
-echo "
-MergeRootfile(foutput , inputs);
-foutput->Close();
-gROOT->ProcessLine(\".q\");
-}
-" >> $sums
-echo "EXECUTING ROOT to merge files: "
-root -l -b $sums
-# do cleanup
-rm -f $sums hadd.C
-echo "done"
\ No newline at end of file
diff --git a/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt b/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt
index 890570e4e28162540dccaf83131139395ab0d5d9..221a6ba96a9c0773ead30ca9f2b7aa96287e4211 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt
+++ b/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt
@@ -9,41 +9,45 @@ atlas_subdir( TrigOutputHandling )
 atlas_depends_on_subdirs( PUBLIC
                           GaudiKernel
                           PRIVATE
-			  Control/AthContainers
-			  Control/AthLinks 
+                          Control/AthContainers
+                          Control/AthLinks
                           Control/AthenaBaseComps
                           Control/AthViews
-			  Trigger/TrigEvent/TrigSteeringEvent
-			  Event/xAOD/xAODTrigCalo
-			  Event/xAOD/xAODTrigEgamma
-			  Event/xAOD/xAODTrigger
-			  Event/xAOD/xAODTracking
-			  Trigger/TrigDataAccess/TrigSerializeResult
-			  Event/xAOD/xAODTrigMuon
-			  Event/xAOD/xAODMuon
-			  Trigger/TrigSteer/DecisionHandling
-			  Control/AthenaMonitoring
-			  )
+                          Trigger/TrigEvent/TrigSteeringEvent
+                          Event/xAOD/xAODTrigCalo
+                          Event/xAOD/xAODTrigEgamma
+                          Event/xAOD/xAODTrigger
+                          Event/xAOD/xAODTracking
+                          Trigger/TrigDataAccess/TrigSerializeResult
+                          Event/xAOD/xAODTrigMuon
+                          Event/xAOD/xAODMuon
+                          Trigger/TrigSteer/DecisionHandling
+                          Control/AthenaMonitoring
+                          )
 find_package( tdaq-common )
 
 # Component(s) in the package:
 atlas_add_library( TrigOutputHandlingLib
                    src/*.cxx
                    PUBLIC_HEADERS TrigOutputHandling
-		   INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
+                   INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
                    LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES}  GaudiKernel AthViews AthenaBaseComps TrigSteeringEvent TrigSerializeResultLib
-                   xAODTrigCalo xAODTrigEgamma xAODTrigger xAODTracking xAODTrigMuon xAODMuon DecisionHandlingLib AthenaMonitoringLib )                 
+                   xAODTrigCalo xAODTrigEgamma xAODTrigger xAODTracking xAODTrigMuon xAODMuon DecisionHandlingLib AthenaMonitoringLib )
 
 atlas_add_component( TrigOutputHandling
-                     src/components/*.cxx                      
+                     src/components/*.cxx
                      LINK_LIBRARIES TrigOutputHandlingLib )
 
+# Install files from the package:
+atlas_install_python_modules( python/*.py )
+
+# Tests:
 atlas_add_test( void_record_test
       SOURCES test/void_record_test.cxx
       INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
       LINK_LIBRARIES ${Boost_LIBRARIES} xAODTrigger
-      AthLinks AthenaKernel StoreGateLib GaudiKernel TestTools xAODCore 
+      AthLinks AthenaKernel StoreGateLib GaudiKernel TestTools xAODCore
       ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share"
-      POST_EXEC_SCRIPT nopost.sh     
+      POST_EXEC_SCRIPT nopost.sh
       PROPERTIES TIMEOUT 300
-       )
+      )
diff --git a/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py
new file mode 100644
index 0000000000000000000000000000000000000000..adf8a8854cabc4c241e383ef8ac587a09332c420
--- /dev/null
+++ b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py
@@ -0,0 +1,17 @@
+# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+
+def HLTResultMTMakerCfg():
+   from TrigOutputHandlingConf import HLTResultMTMaker
+   from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
+
+   m = HLTResultMTMaker()
+   m.MonTool = GenericMonitoringTool('MonTool', HistPath='HLTResultMTMaker')
+   m.MonTool.Histograms = [ defineHistogram( 'TIME_build', path='EXPERT', type='TH1F', title='Time of result construction in;[micro seccond]',
+                                             xbins=100, xmin=0, xmax=1000 ),
+                            defineHistogram( 'nstreams', path='EXPERT', type='TH1F', title='number of streams',
+                                             xbins=60, xmin=0, xmax=60 ),
+                            defineHistogram( 'nfrags', path='EXPERT', type='TH1F', title='number of HLT results',
+                                             xbins=10, xmin=0, xmax=10 ),
+                            defineHistogram( 'sizeMain', path='EXPERT', type='TH1F', title='Main (physics) HLT Result size;4B words',
+                                             xbins=100, xmin=-1, xmax=999 ) ] # 1000 k span
+   return m