From 4502b7b449ee93697738731b0efea16486b33c01 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Thu, 5 Dec 2019 21:37:14 +0100
Subject: [PATCH 001/422] First template for AFP Run3 Monitoring

---
 .../AFP/Run3AFPMonitoring/CMakeLists.txt      |  86 +++++++++
 .../AFPHitsMonitorAlgorithm.h                 |  26 +++
 .../python/PoolFileCatalog.xml                |  12 ++
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 165 ++++++++++++++++++
 .../python/eventLoopHeartBeat.txt             |   1 +
 .../src/AFPHitsMonitorAlgorithm.cxx           |  96 ++++++++++
 .../components/Run3AFPMonitoring_entries.cxx  |   7 +
 7 files changed, 393 insertions(+)
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPHitsMonitorAlgorithm.cxx
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
new file mode 100644
index 000000000000..4ed7b4100b5d
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -0,0 +1,86 @@
+################################################################################
+# Package: Run3AFPMonitoring
+################################################################################
+
+# Declare the package name:
+atlas_subdir( Run3AFPMonitoring )
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs(
+    PUBLIC
+        Control/AthenaBaseComps
+        Control/AthenaMonitoringKernel
+        GaudiKernel
+        LumiBlock/LumiBlockComps
+        LumiBlock/LumiBlockData
+        Trigger/TrigEvent/TrigDecisionInterface
+    PRIVATE
+        Control/AthenaMonitoring
+        AtlasTest/TestTools
+        Control/AthenaKernel
+        Control/CxxUtils
+        Control/SGMon/SGAudCore
+        Database/AthenaPOOL/AthenaPoolUtilities
+        Event/xAOD/xAODEventInfo
+        Event/EventInfo
+        Tools/LWHists
+        Trigger/TrigAnalysis/TrigDecisionTool
+        Trigger/TrigAnalysis/TrigAnalysisInterfaces
+        MuonSpectrometer/MuonAlignment/MuonAlignmentData
+)
+
+# External dependencies:
+find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
+find_package( Boost )
+find_package( ROOT COMPONENTS Core )
+
+# Component(s) in the package:
+atlas_add_library(
+    Run3AFPMonitoringLib
+    src/*.cxx
+    PUBLIC_HEADERS
+        Run3AFPMonitoring
+    INCLUDE_DIRS
+        ${ROOT_INCLUDE_DIRS}
+    PRIVATE_INCLUDE_DIRS
+        ${Boost_INCLUDE_DIRS}
+        ${CORAL_INCLUDE_DIRS}
+    LINK_LIBRARIES
+        ${Boost_LIBRARIES}
+        ${ROOT_LIBRARIES}
+        AthenaBaseComps
+        AthenaMonitoringLib
+        AthenaMonitoringKernelLib
+        GaudiKernel
+        LumiBlockCompsLib
+        LumiBlockData
+        TrigDecisionToolLib
+    PRIVATE_LINK_LIBRARIES
+        ${CORAL_LIBRARIES}
+        AthenaKernel
+        SGAudCore
+        AthenaPoolUtilities
+        EventInfo
+        LWHists
+)
+
+atlas_add_component(
+    Run3AFPMonitoring
+    src/components/*.cxx
+    INCLUDE_DIRS
+        ${CORAL_INCLUDE_DIRS}
+    LINK_LIBRARIES
+        Run3AFPMonitoringLib
+        AthenaMonitoringLib
+        AthenaMonitoringKernelLib
+        LumiBlockData
+        LWHists
+        SGAudCore
+        TrigDecisionToolLib
+)
+
+# Install files from the package:
+#atlas_install_python_modules( python/*.py 
+#                              POST_BUILD_CMD ${ATLAS_FLAKE8} )
+atlas_install_joboptions( share/*.py )
+#atlas_install_scripts( share/Run3DQTestingDriver.py share/hist_file_dump.py share/hist_diff.sh )
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h
new file mode 100644
index 000000000000..3ea7e50f3364
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h
@@ -0,0 +1,26 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef AFPHITSMONITORALGORITHM_H
+#define AFPHITSMONITORALGORITHM_H
+
+#include "AthenaMonitoring/AthMonitorAlgorithm.h"
+#include "AthenaMonitoringKernel/Monitored.h"
+
+#include "TRandom3.h"
+
+class AFPHitsMonitorAlgorithm : public AthMonitorAlgorithm {
+public:
+    AFPHitsMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
+    virtual ~AFPHitsMonitorAlgorithm();
+    virtual StatusCode initialize() override;
+    virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+private:
+    Gaudi::Property<bool> m_doRandom {this,"RandomHist",false};
+    std::vector<int> m_abGroups1;
+    std::vector<std::vector<int>> m_abGroups2;
+    std::map<std::string,int> m_cGroups1;
+    std::map<std::string,std::map<std::string,int>> m_cGroups2;
+};
+#endif
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml b/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
new file mode 100644
index 000000000000..5f18c9c49da1
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<!-- Edited By POOL -->
+<!DOCTYPE POOLFILECATALOG SYSTEM "InMemory">
+<POOLFILECATALOG>
+  <File ID="23288CC6-5921-944B-BF66-F99ACC97ABBB">
+    <physical>
+      <pfn filetype="ROOT_All" name="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1"/>
+    </physical>
+    <logical/>
+  </File>
+
+</POOLFILECATALOG>
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
new file mode 100644
index 000000000000..2fc18abd1e0f
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -0,0 +1,165 @@
+#
+#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#
+
+'''@file ExampleMonitorAlgorithm.py kristin
+@author C. D. Burton
+@author P. Onyisi
+@date 2018-01-11
+@brief Example python configuration for the Run III AthenaMonitoring package
+'''
+
+def Run3AFPExampleMonitoringConfig(inputFlags):
+    '''Function to configures some algorithms in the monitoring system.'''
+
+    ### STEP 1 ###
+    # If you need to set up special tools, etc., you will need your own ComponentAccumulator;
+    # uncomment the following 2 lines and use the last three lines of this function instead of the ones
+    # just before
+    # from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    # result = ComponentAccumulator()
+
+    # The following class will make a sequence, configure algorithms, and link
+    # them to GenericMonitoringTools
+    from AthenaMonitoring import AthMonitorCfgHelper
+    helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
+
+
+    ### STEP 2 ###
+    # Adding an algorithm to the helper. Here, we will use the example 
+    # algorithm in the AthenaMonitoring package. Just pass the type to the 
+    # helper. Then, the helper will instantiate an instance and set up the 
+    # base class configuration following the inputFlags. The returned object 
+    # is the algorithm.
+    from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPHitsMonitorAlgorithm
+    exampleMonAlg = helper.addAlgorithm(AFPHitsMonitorAlgorithm,'exampleMonAlg')
+
+    # You can actually make multiple instances of the same algorithm and give 
+    # them different configurations
+    anotherExampleMonAlg = helper.addAlgorithm(AFPHitsMonitorAlgorithm,'AnotherExampleMonAlg')
+
+    # # If for some really obscure reason you need to instantiate an algorithm
+    # # yourself, the AddAlgorithm method will still configure the base 
+    # # properties and add the algorithm to the monitoring sequence.
+    # helper.AddAlgorithm(myExistingAlg)
+
+
+    ### STEP 3 ###
+    # Edit properties of a algorithm
+    # some generic property
+    #exampleMonAlg.RandomHist = True
+    # to enable a trigger filter, for example:
+    #exampleMonAlg.TriggerChain = 'HLT_mu26_ivarmedium'
+
+    ### STEP 4 ###
+    # Add some tools. N.B. Do not use your own trigger decion tool. Use the
+    # standard one that is included with AthMonitorAlgorithm.
+
+    # # Then, add a tool that doesn't have its own configuration function. In
+    # # this example, no accumulator is returned, so no merge is necessary.
+    # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
+    # exampleMonAlg.MyDomainTool = MyDomainTool()
+
+    # Add a generic monitoring tool (a "group" in old language). The returned 
+    # object here is the standard GenericMonitoringTool.
+    myGroup = helper.addGroup(
+        exampleMonAlg,
+        'ExampleMonitor',
+        'OneRing/'
+    )
+
+    # Add a GMT for the other example monitor algorithm
+    anotherGroup = helper.addGroup(anotherExampleMonAlg,'ExampleMonitor')
+
+
+    ### STEP 5 ###
+    # Configure histograms
+    myGroup.defineHistogram('lumiPerBCID',title='Luminosity,WithCommaInTitle;L/BCID;Events',
+                            path='ToRuleThemAll',xbins=40,xmin=0.0,xmax=80.0)
+    myGroup.defineHistogram('lb', title='Luminosity Block;lb;Events',
+                            path='ToFindThem',xbins=1000,xmin=-0.5,xmax=999.5,weight='testweight')
+    myGroup.defineHistogram('random', title='LB;x;Events',
+                            path='ToBringThemAll',xbins=30,xmin=0,xmax=1,opt='kLBNHistoryDepth=10')
+    myGroup.defineHistogram('random', title='title;x;y',path='ToBringThemAll',
+                            xbins=[0,.1,.2,.4,.8,1.6])
+    myGroup.defineHistogram('random,pT', type='TH2F', title='title;x;y',path='ToBringThemAll',
+                            xbins=[0,.1,.2,.4,.8,1.6],ybins=[0,10,30,40,60,70,90])
+    # myGroup.defineHistogram('pT_passed,pT',type='TEfficiency',title='Test TEfficiency;x;Eff',
+    #                         path='AndInTheDarkness',xbins=100,xmin=0.0,xmax=50.0)
+
+    anotherGroup.defineHistogram('lbWithFilter',title='Lumi;lb;Events',
+                                 path='top',xbins=1000,xmin=-0.5,xmax=999.5)
+    anotherGroup.defineHistogram('run',title='Run Number;run;Events',
+                                 path='top',xbins=1000000,xmin=-0.5,xmax=999999.5)
+
+    # Example defining an array of histograms. This is useful if one seeks to create a
+    # number of histograms in an organized manner. (For instance, one plot for each ASIC
+    # in the subdetector, and these components are mapped in eta, phi, and layer.) Thus,
+    # one might have an array of TH1's such as quantity[etaIndex][phiIndex][layerIndex].
+    for alg in [exampleMonAlg,anotherExampleMonAlg]:
+        # Using an array of groups
+        array = helper.addArray([2],alg,'ExampleMonitor')
+        array.defineHistogram('a,b',title='AB',type='TH2F',path='Eta',
+                              xbins=10,xmin=0.0,xmax=10.0,
+                              ybins=10,ymin=0.0,ymax=10.0)
+        array.defineHistogram('c',title='C',path='Eta',
+                              xbins=10,xmin=0.0,xmax=10.0)
+        array = helper.addArray([4,2],alg,'ExampleMonitor')
+        array.defineHistogram('a',title='A',path='EtaPhi',
+                              xbins=10,xmin=0.0,xmax=10.0)
+        # Using a map of groups
+        layerList = ['layer1','layer2']
+        clusterList = ['clusterX','clusterB']
+        array = helper.addArray([layerList],alg,'ExampleMonitor')
+        array.defineHistogram('c',title='C',path='Layer',
+                              xbins=10,xmin=0,xmax=10.0)
+        array = helper.addArray([layerList,clusterList],alg,'ExampleMonitor')
+        array.defineHistogram('c',title='C',path='LayerCluster',
+                              xbins=10,xmin=0,xmax=10.0)
+
+    ### STEP 6 ###
+    # Finalize. The return value should be a tuple of the ComponentAccumulator
+    # and the sequence containing the created algorithms. If we haven't called
+    # any configuration other than the AthMonitorCfgHelper here, then we can 
+    # just return directly (and not create "result" above)
+    return helper.result()
+    
+    # # Otherwise, merge with result object and return
+    # acc = helper.result()
+    # result.merge(acc)
+    # return result
+
+if __name__=='__main__':
+    # Setup the Run III behavior
+    from AthenaCommon.Configurable import Configurable
+    Configurable.configurableRun3Behavior = 1
+
+    # Setup logs
+    from AthenaCommon.Logging import log
+    from AthenaCommon.Constants import INFO
+    log.setLevel(INFO)
+
+    # Set the Athena configuration flags
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
+    file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
+    ConfigFlags.Input.Files = [nightly+file]
+    ConfigFlags.Input.isMC = False
+    ConfigFlags.Output.HISTFileName = 'ExampleMonitorOutput.root'
+    
+    ConfigFlags.lock()
+
+    # Initialize configuration object, add accumulator, merge, and run.
+    from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg 
+    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+    cfg = MainServicesSerialCfg()
+    cfg.merge(PoolReadCfg(ConfigFlags))
+
+    exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
+    cfg.merge(exampleMonitorAcc)
+
+    # If you want to turn on more detailed messages ...
+    # exampleMonitorAcc.getEventAlgo('ExampleMonAlg').OutputLevel = 2 # DEBUG
+    cfg.printConfig(withDetails=False) # set True for exhaustive info
+
+    cfg.run(10) #use cfg.run(20) to only run on first 20 events
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt
new file mode 100644
index 000000000000..0cd8dced0633
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt
@@ -0,0 +1 @@
+  done processing event #779703711, run #311321 10 events read so far  <<<===
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPHitsMonitorAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPHitsMonitorAlgorithm.cxx
new file mode 100644
index 000000000000..4c38efd5127c
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPHitsMonitorAlgorithm.cxx
@@ -0,0 +1,96 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h"
+
+AFPHitsMonitorAlgorithm::AFPHitsMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
+:AthMonitorAlgorithm(name,pSvcLocator)
+,m_doRandom(true)
+{}
+
+
+AFPHitsMonitorAlgorithm::~AFPHitsMonitorAlgorithm() {}
+
+
+StatusCode AFPHitsMonitorAlgorithm::initialize() {
+    using namespace Monitored;
+    m_abGroups1 = buildToolMap<int>(m_tools,"ExampleMonitor",2);
+    m_abGroups2 = buildToolMap<std::vector<int>>(m_tools,"ExampleMonitor",4,2);
+
+    std::vector<std::string> layers = {"layer1","layer2"};
+    std::vector<std::string> clusters = {"clusterX","clusterB"};
+    m_cGroups1 = buildToolMap<int>(m_tools,"ExampleMonitor",layers);
+    m_cGroups2 = buildToolMap<std::map<std::string,int>>(m_tools,"ExampleMonitor",layers,clusters);
+    return AthMonitorAlgorithm::initialize();
+}
+
+
+StatusCode AFPHitsMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const {
+    using namespace Monitored;
+
+    // Declare the quantities which should be monitored
+    auto lumiPerBCID = Monitored::Scalar<float>("lumiPerBCID",0.0);
+    auto lb = Monitored::Scalar<int>("lb",0);
+    auto run = Monitored::Scalar<int>("run",0);
+    auto random = Monitored::Scalar<float>("random",0.0);
+    auto testweight = Monitored::Scalar<float>("testweight",1.0);
+
+    // Two variables (value and passed) needed for TEfficiency
+    auto pT = Monitored::Scalar<float>("pT",0.0);
+    auto pT_passed = Monitored::Scalar<bool>("pT_passed",false);
+
+    // Set the values of the monitored variables for the event
+    lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
+    lb = GetEventInfo(ctx)->lumiBlock();
+    run = GetEventInfo(ctx)->runNumber();
+    testweight = 2.0;
+    
+    TRandom3 r(ctx.eventID().event_number());
+    // Example of using flags
+    if (m_doRandom) {
+        random = r.Rndm();
+    }
+
+    // Fake efficiency calculator
+    pT = r.Landau(15);
+    pT_passed = pT>r.Poisson(15);
+
+    // Fill. First argument is the tool name, all others are the variables to be saved.
+    fill("ExampleMonitor",lumiPerBCID,lb,random,pT,pT_passed,testweight);
+
+    // Alternative fill method. Get the group yourself, and pass it to the fill function.
+    auto tool = getGroup("ExampleMonitor");
+    fill(tool,run);
+
+    // Fill with a vector; useful in some circumstances.
+    std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> varVec = {lumiPerBCID,pT};
+    fill("ExampleMonitor",varVec);
+    fill(tool,varVec);
+
+    // Filling using a pre-defined array of groups.
+    auto a = Scalar<float>("a",0.0);
+    auto b = Scalar<float>("b",1.0);
+    auto c = Scalar<float>("c",2.0);
+    for ( auto iEta : {0,1} ) {
+        // 1) Valid but inefficient fill
+        fill("ExampleMonitor_"+std::to_string(iEta),a,b,c);
+        // 2) Faster way to fill a vector of histograms
+        fill(m_tools[m_abGroups1[iEta]],a,b,c);
+        for ( auto iPhi : {0,1} ) {
+            // Same efficient method for 2D array
+            fill(m_tools[m_abGroups2[iEta][iPhi]],a,b);
+        }
+    }
+
+    // Filling using a pre-defined map of groups.
+    for ( auto& layer : std::vector<std::string>({"layer1","layer2"}) ) {
+        fill(m_tools[m_cGroups1.at(layer)],c);
+        for ( auto& cluster : std::vector<std::string>({"clusterX","clusterB"}) ) {
+            // Same efficient method for 2D map
+            fill(m_tools[m_cGroups2.at(layer).at(cluster)],c);
+        }
+    }
+
+    return StatusCode::SUCCESS;
+}
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx
new file mode 100644
index 000000000000..9d55fb58b6d0
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx
@@ -0,0 +1,7 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h"
+
+DECLARE_COMPONENT( AFPHitsMonitorAlgorithm )
-- 
GitLab


From 8b72f99cce4f7dd2fbfcb9864f31a52af39a81d2 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Tue, 10 Dec 2019 09:26:49 +0100
Subject: [PATCH 002/422] removed files for clean package

---
 .../AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml | 12 ------------
 .../Run3AFPMonitoring/python/eventLoopHeartBeat.txt  |  1 -
 2 files changed, 13 deletions(-)
 delete mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
 delete mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml b/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
deleted file mode 100644
index 5f18c9c49da1..000000000000
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
-<!-- Edited By POOL -->
-<!DOCTYPE POOLFILECATALOG SYSTEM "InMemory">
-<POOLFILECATALOG>
-  <File ID="23288CC6-5921-944B-BF66-F99ACC97ABBB">
-    <physical>
-      <pfn filetype="ROOT_All" name="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1"/>
-    </physical>
-    <logical/>
-  </File>
-
-</POOLFILECATALOG>
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt
deleted file mode 100644
index 0cd8dced0633..000000000000
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt
+++ /dev/null
@@ -1 +0,0 @@
-  done processing event #779703711, run #311321 10 events read so far  <<<===
-- 
GitLab


From c68d77df27931b1b5909da92be3662aefe83ce8f Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Fri, 17 Jan 2020 13:00:18 +0100
Subject: [PATCH 003/422] This is a test for adding files to the branch. This
 file should be deleted after test.

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
new file mode 100644
index 000000000000..0922b96f830b
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -0,0 +1,2 @@
+this is a test
+nikola
\ No newline at end of file
-- 
GitLab


From 095466b4c53723604f4cf089142cb935e325fd74 Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Fri, 17 Jan 2020 19:43:29 +0100
Subject: [PATCH 004/422] Commit 2

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index 0922b96f830b..eb697fac88b8 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -1,2 +1,3 @@
 this is a test
-nikola
\ No newline at end of file
+nikola
+nikola 1
-- 
GitLab


From ec01dc2595a96e7df22a5692d9af101ed25e85dc Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Fri, 17 Jan 2020 23:23:40 +0100
Subject: [PATCH 005/422] Nikola2 change. Remove it after.

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index eb697fac88b8..c171bf82f8dd 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -1,3 +1,4 @@
 this is a test
 nikola
 nikola 1
+nikola 2
-- 
GitLab


From 5969904be273d2b16c45592562b1cf8e8528acec Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Sat, 18 Jan 2020 00:16:43 +0100
Subject: [PATCH 006/422] Some message

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index c171bf82f8dd..05cff0ad8374 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -1,4 +1,4 @@
 this is a test
 nikola
-nikola 1
-nikola 2
+
+nikola 123
\ No newline at end of file
-- 
GitLab


From 304f04beb8f2edc95ffda71ffbfcd2040dc62f68 Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Sat, 18 Jan 2020 01:37:52 +0100
Subject: [PATCH 007/422] Change n

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index 05cff0ad8374..3b1d044007a9 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -1,4 +1,5 @@
 this is a test
 nikola
 
-nikola 123
\ No newline at end of file
+nikola 123
+nikola 4
\ No newline at end of file
-- 
GitLab


From 31aa1ea5b1375fea54a8169cf7aea79938b84809 Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Sat, 18 Jan 2020 13:51:15 +0100
Subject: [PATCH 008/422] added line "nikola 5"

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index 3b1d044007a9..e888ef4c150a 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -2,4 +2,5 @@ this is a test
 nikola
 
 nikola 123
-nikola 4
\ No newline at end of file
+nikola 4
+nikola 5
\ No newline at end of file
-- 
GitLab


From d2f314bb0f465ead8c3bdcef26fe5a3a999341e4 Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Sat, 18 Jan 2020 14:00:28 +0100
Subject: [PATCH 009/422] added line "nikola 6"

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index e888ef4c150a..c5fcf52adfa0 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -3,4 +3,5 @@ nikola
 
 nikola 123
 nikola 4
-nikola 5
\ No newline at end of file
+nikola 5
+nikola 6
\ No newline at end of file
-- 
GitLab


From 8ee5f2de26c27551cd5dc939c6f5cfa100d172eb Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Sat, 18 Jan 2020 14:30:39 +0100
Subject: [PATCH 010/422] Setting up new environment

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  26 ++++
 .../python/PoolFileCatalog.xml                |  12 ++
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  51 ++++----
 .../python/eventLoopHeartBeat.txt             |   1 +
 .../src/AFPSiLayerAlgorithm.cxx               | 113 ++++++++++++++++++
 .../components/Run3AFPMonitoring_entries.cxx  |   4 +-
 6 files changed, 182 insertions(+), 25 deletions(-)
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
new file mode 100644
index 000000000000..9e6f97ff56fd
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -0,0 +1,26 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef AFPSILAYERALGORITHM_H
+#define AFPSILAYERALGORITHM_H
+
+#include "AthenaMonitoring/AthMonitorAlgorithm.h"
+#include "AthenaMonitoringKernel/Monitored.h"
+
+#include "TRandom3.h"
+
+class AFPSiLayerAlgorithm : public AthMonitorAlgorithm {
+public:
+    AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
+    virtual ~AFPSiLayerAlgorithm();
+    virtual StatusCode initialize() override;
+    virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+private:
+    Gaudi::Property<bool> m_doRandom {this,"RandomHist",false};
+    std::vector<int> m_abGroups1;
+    std::vector<std::vector<int>> m_abGroups2;
+    std::map<std::string,int> m_cGroups1;
+    std::map<std::string,std::map<std::string,int>> m_cGroups2;
+};
+#endif
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml b/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
new file mode 100644
index 000000000000..5f18c9c49da1
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<!-- Edited By POOL -->
+<!DOCTYPE POOLFILECATALOG SYSTEM "InMemory">
+<POOLFILECATALOG>
+  <File ID="23288CC6-5921-944B-BF66-F99ACC97ABBB">
+    <physical>
+      <pfn filetype="ROOT_All" name="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1"/>
+    </physical>
+    <logical/>
+  </File>
+
+</POOLFILECATALOG>
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 2fc18abd1e0f..b5c8b2349ce6 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -2,7 +2,7 @@
 #  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 #
 
-'''@file ExampleMonitorAlgorithm.py kristin
+'''@file Run3AFPExampleMonitorAlgorithm.py
 @author C. D. Burton
 @author P. Onyisi
 @date 2018-01-11
@@ -31,12 +31,12 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     # helper. Then, the helper will instantiate an instance and set up the 
     # base class configuration following the inputFlags. The returned object 
     # is the algorithm.
-    from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPHitsMonitorAlgorithm
-    exampleMonAlg = helper.addAlgorithm(AFPHitsMonitorAlgorithm,'exampleMonAlg')
+    from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
+    afpSiLayerAlgorithm = helper.addAlgorithm(AFPSiLayerAlgorithm,'AFPSiLayer')
 
     # You can actually make multiple instances of the same algorithm and give 
-    # them different configurations
-    anotherExampleMonAlg = helper.addAlgorithm(AFPHitsMonitorAlgorithm,'AnotherExampleMonAlg')
+    # them different configuration
+    anotherExampleMonAlg = helper.addAlgorithm(AFPSiLayerAlgorithm,'AnotherExampleMonAlg')
 
     # # If for some really obscure reason you need to instantiate an algorithm
     # # yourself, the AddAlgorithm method will still configure the base 
@@ -62,27 +62,32 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     # Add a generic monitoring tool (a "group" in old language). The returned 
     # object here is the standard GenericMonitoringTool.
-    myGroup = helper.addGroup(
-        exampleMonAlg,
-        'ExampleMonitor',
-        'OneRing/'
-    )
+    station0_1 = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayer','Station0/')
 
     # Add a GMT for the other example monitor algorithm
-    anotherGroup = helper.addGroup(anotherExampleMonAlg,'ExampleMonitor')
+    anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer')
 
 
     ### STEP 5 ###
-    # Configure histograms
-    myGroup.defineHistogram('lumiPerBCID',title='Luminosity,WithCommaInTitle;L/BCID;Events',
+    # Configure histogramsIf you want to create histograms with variable bin widths, ROOT provides another constructor suited for this purpose. Instead of passing the data interval and the number of bins, you have to pass an array (single or double precision) of bin edges. When the histogram has n bins, then there are n+1 distinct edges, so the array you pass must be of size n+1.
+
+
+    
+    # My histograms
+    station0_1.defineHistogram('h_hitMultiplicity', title='Number of hits per event', path='AFPSiLayerPath',xbins=40, xmin=-0.5, xmax=39.5)
+    station0_1.defineHistogram('h_timeOverThreshold', title='Time over threshold', path='AFPSiLayerPath', xbins=16, xmin=-0.5, xmax=15.5)
+    # nRows = 80, nColumns = 336.
+   # station0_1.defineHistogram('h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80+0.5, ybins=336,ymin=0.5,ymax=336+0.5)
+    # end My histograms
+    station0_1.defineHistogram('lumiPerBCID',title='Luminosity,WithCommaInTitle;L/BCID;Events',
                             path='ToRuleThemAll',xbins=40,xmin=0.0,xmax=80.0)
-    myGroup.defineHistogram('lb', title='Luminosity Block;lb;Events',
+    station0_1.defineHistogram('lb', title='Luminosity Block;lb;Events',
                             path='ToFindThem',xbins=1000,xmin=-0.5,xmax=999.5,weight='testweight')
-    myGroup.defineHistogram('random', title='LB;x;Events',
+    station0_1.defineHistogram('random', title='LB;x;Events',
                             path='ToBringThemAll',xbins=30,xmin=0,xmax=1,opt='kLBNHistoryDepth=10')
-    myGroup.defineHistogram('random', title='title;x;y',path='ToBringThemAll',
+    station0_1.defineHistogram('random', title='title;x;y',path='ToBringThemAll',
                             xbins=[0,.1,.2,.4,.8,1.6])
-    myGroup.defineHistogram('random,pT', type='TH2F', title='title;x;y',path='ToBringThemAll',
+    station0_1.defineHistogram('random,pT', type='TH2F', title='title;x;y',path='ToBringThemAll',
                             xbins=[0,.1,.2,.4,.8,1.6],ybins=[0,10,30,40,60,70,90])
     # myGroup.defineHistogram('pT_passed,pT',type='TEfficiency',title='Test TEfficiency;x;Eff',
     #                         path='AndInTheDarkness',xbins=100,xmin=0.0,xmax=50.0)
@@ -96,24 +101,24 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     # number of histograms in an organized manner. (For instance, one plot for each ASIC
     # in the subdetector, and these components are mapped in eta, phi, and layer.) Thus,
     # one might have an array of TH1's such as quantity[etaIndex][phiIndex][layerIndex].
-    for alg in [exampleMonAlg,anotherExampleMonAlg]:
+    for alg in [afpSiLayerAlgorithm,anotherExampleMonAlg]:
         # Using an array of groups
-        array = helper.addArray([2],alg,'ExampleMonitor')
+        array = helper.addArray([2],alg,'AFPSiLayer')
         array.defineHistogram('a,b',title='AB',type='TH2F',path='Eta',
                               xbins=10,xmin=0.0,xmax=10.0,
                               ybins=10,ymin=0.0,ymax=10.0)
         array.defineHistogram('c',title='C',path='Eta',
                               xbins=10,xmin=0.0,xmax=10.0)
-        array = helper.addArray([4,2],alg,'ExampleMonitor')
+        array = helper.addArray([4,2],alg,'AFPSiLayer')
         array.defineHistogram('a',title='A',path='EtaPhi',
                               xbins=10,xmin=0.0,xmax=10.0)
         # Using a map of groups
         layerList = ['layer1','layer2']
         clusterList = ['clusterX','clusterB']
-        array = helper.addArray([layerList],alg,'ExampleMonitor')
+        array = helper.addArray([layerList],alg,'AFPSiLayer')
         array.defineHistogram('c',title='C',path='Layer',
                               xbins=10,xmin=0,xmax=10.0)
-        array = helper.addArray([layerList,clusterList],alg,'ExampleMonitor')
+        array = helper.addArray([layerList,clusterList],alg,'AFPSiLayer')
         array.defineHistogram('c',title='C',path='LayerCluster',
                               xbins=10,xmin=0,xmax=10.0)
 
@@ -145,7 +150,7 @@ if __name__=='__main__':
     file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
     ConfigFlags.Input.Files = [nightly+file]
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'ExampleMonitorOutput.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput.root'
     
     ConfigFlags.lock()
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt
new file mode 100644
index 000000000000..0cd8dced0633
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt
@@ -0,0 +1 @@
+  done processing event #779703711, run #311321 10 events read so far  <<<===
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
new file mode 100644
index 000000000000..736e21bd8b69
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -0,0 +1,113 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "Run3AFPMonitoring/AFPSiLayerAlgorithm.h"
+
+/* Old constructor:
+AFPHitsMonitorAlgorithm::AFPHitsMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
+:AthMonitorAlgorithm(name,pSvcLocator)
+,m_doRandom(true)
+{}
+*/
+
+AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
+:AthMonitorAlgorithm(name,pSvcLocator)
+,m_doRandom(true)
+{}
+
+
+AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
+
+
+StatusCode AFPSiLayerAlgorithm::initialize() {
+    using namespace Monitored;
+    m_abGroups1 = buildToolMap<int>(m_tools,"AFPSiLayer",2);
+    m_abGroups2 = buildToolMap<std::vector<int>>(m_tools,"AFPSiLayer",4,2);
+
+    std::vector<std::string> layers = {"layer1","layer2"};
+    std::vector<std::string> clusters = {"clusterX","clusterB"};
+    m_cGroups1 = buildToolMap<int>(m_tools,"AFPSiLayer",layers);
+    m_cGroups2 = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayer",layers,clusters);
+    return AthMonitorAlgorithm::initialize();
+}
+
+
+StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
+    using namespace Monitored;
+
+    // Declare the quantities which should be monitored
+    // My histograms:
+    auto h_hitMultiplicity = Monitored::Scalar<int>("h_hitMultiplicity", 0);
+    auto h_timeOverThreshold = Monitored::Scalar<int>("h_timeOverThreshold", 0);
+    //auto h_hitMap = Monitored::Scalar<int>("h_hitMap", 0);
+    // End
+
+    auto lumiPerBCID = Monitored::Scalar<float>("lumiPerBCID",0.0);
+    auto lb = Monitored::Scalar<int>("lb",0);
+    auto run = Monitored::Scalar<int>("run",0);
+    auto random = Monitored::Scalar<float>("random",0.0);
+    auto testweight = Monitored::Scalar<float>("testweight",1.0);
+
+    // Two variables (value and passed) needed for TEfficiency
+    auto pT = Monitored::Scalar<float>("pT",0.0);
+    auto pT_passed = Monitored::Scalar<bool>("pT_passed",false);
+
+    // Set the values of the monitored variables for the event
+    h_timeOverThreshold = lbAverageInteractionsPerCrossing(ctx);
+    h_hitMultiplicity = lbAverageInteractionsPerCrossing(ctx);
+    //    h_hitMap = lbAverageInteractionsPerCrossing(ctx);
+    lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
+    lb = GetEventInfo(ctx)->lumiBlock();
+    run = GetEventInfo(ctx)->runNumber();
+    testweight = 2.0;
+    
+    TRandom3 r(ctx.eventID().event_number());
+    // Example of using flags
+    if (m_doRandom) {
+        random = r.Rndm();
+    }
+
+    // Fake efficiency calculator
+    pT = r.Landau(15);
+    pT_passed = pT>r.Poisson(15);
+
+    // Fill. First argument is the tool name, all others are the variables to be saved.
+    fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity,lumiPerBCID,lb,random,pT,pT_passed,testweight);
+    //fill("AFPSiLayerAlgorithm",h_hitMultiplicity,lb,random,pT,pT_passed,testweight);
+
+    // Alternative fill method. Get the group yourself, and pass it to the fill function.
+    auto tool = getGroup("AFPSiLayer");
+    fill(tool,run);
+
+    // Fill with a vector; useful in some circumstances.
+    std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> varVec = {lumiPerBCID,pT};
+    fill("AFPSiLayer",varVec);
+    fill(tool,varVec);
+
+    // Filling using a pre-defined array of groups.
+    auto a = Scalar<float>("a",0.0);
+    auto b = Scalar<float>("b",1.0);
+    auto c = Scalar<float>("c",2.0);
+    for ( auto iEta : {0,1} ) {
+        // 1) Valid but inefficient fill
+        fill("AFPSiLayer_"+std::to_string(iEta),a,b,c);
+        // 2) Faster way to fill a vector of histograms
+        fill(m_tools[m_abGroups1[iEta]],a,b,c);
+        for ( auto iPhi : {0,1} ) {
+            // Same efficient method for 2D array
+            fill(m_tools[m_abGroups2[iEta][iPhi]],a,b);
+        }
+    }
+
+    // Filling using a pre-defined map of groups.
+    for ( auto& layer : std::vector<std::string>({"layer1","layer2"}) ) {
+        fill(m_tools[m_cGroups1.at(layer)],c);
+        for ( auto& cluster : std::vector<std::string>({"clusterX","clusterB"}) ) {
+            // Same efficient method for 2D map
+            fill(m_tools[m_cGroups2.at(layer).at(cluster)],c);
+        }
+    }
+
+    return StatusCode::SUCCESS;
+}
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx
index 9d55fb58b6d0..3fb7d47dc5a6 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx
@@ -2,6 +2,6 @@
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h"
+#include "Run3AFPMonitoring/AFPSiLayerAlgorithm.h"
 
-DECLARE_COMPONENT( AFPHitsMonitorAlgorithm )
+DECLARE_COMPONENT( AFPSiLayerAlgorithm )
-- 
GitLab


From dd72baae18d1bc1e61500e8d12e5d7e407d00324 Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Sat, 18 Jan 2020 15:25:19 +0100
Subject: [PATCH 011/422] Modifying 1

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index c5fcf52adfa0..8d043e3b8049 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -1,5 +1,5 @@
 this is a test
-nikola
+nikola abc
 
 nikola 123
 nikola 4
-- 
GitLab


From ea6caf96ccc240623d71c84592e5d04808a796a1 Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Sun, 19 Jan 2020 23:48:56 +0100
Subject: [PATCH 012/422] added test file

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index 8d043e3b8049..de52083f2eec 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -4,4 +4,5 @@ nikola abc
 nikola 123
 nikola 4
 nikola 5
-nikola 6
\ No newline at end of file
+nikola 6
+nikola 7
\ No newline at end of file
-- 
GitLab


From 7d882e25391c3114c15e8e8e2a5f7f71f14148c4 Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Mon, 20 Jan 2020 00:30:13 +0100
Subject: [PATCH 013/422] Sample txt file

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index de52083f2eec..aeb971ecc027 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -1,5 +1,5 @@
 this is a test
-nikola abc
+nikola a
 
 nikola 123
 nikola 4
-- 
GitLab


From 4b966800c33799ea90c25f71be955adbc334f43d Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Mon, 20 Jan 2020 01:38:19 +0100
Subject: [PATCH 014/422] Adding sample .txt file for testing purposes

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index aeb971ecc027..55fae3e3782e 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -5,4 +5,6 @@ nikola 123
 nikola 4
 nikola 5
 nikola 6
-nikola 7
\ No newline at end of file
+nikola 7
+
+If you can read this, then it works! 
\ No newline at end of file
-- 
GitLab


From 1a7ce2bbf7890105c2ec94815c608437bb25509d Mon Sep 17 00:00:00 2001
From: ndikic <nikola.dikic@cern.ch>
Date: Mon, 20 Jan 2020 01:56:33 +0100
Subject: [PATCH 015/422] Sample .txt for testing

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index 55fae3e3782e..5947374564ea 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -7,4 +7,4 @@ nikola 5
 nikola 6
 nikola 7
 
-If you can read this, then it works! 
\ No newline at end of file
+If you can read this, then it works! :)
\ No newline at end of file
-- 
GitLab


From 525911e7b725e247490971498711116967071a42 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 20 Jan 2020 02:02:46 +0100
Subject: [PATCH 016/422] Sample .txt file for testing

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index 5947374564ea..c92ff0e26568 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -7,4 +7,4 @@ nikola 5
 nikola 6
 nikola 7
 
-If you can read this, then it works! :)
\ No newline at end of file
+If you can read this, then it works! :) :)
\ No newline at end of file
-- 
GitLab


From df648e1bb6c467e0e2efcd26ce71c787254a9ef5 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 20 Jan 2020 02:44:43 +0100
Subject: [PATCH 017/422] Sample .txt file for testing2

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
index c92ff0e26568..d1768d22658e 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
@@ -7,4 +7,4 @@ nikola 5
 nikola 6
 nikola 7
 
-If you can read this, then it works! :) :)
\ No newline at end of file
+If you can read this, then it works! :) :) :) :)
\ No newline at end of file
-- 
GitLab


From a257ac4fc2a9721a581328e61e5e33e65bc0b1c4 Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Mon, 24 Feb 2020 15:37:25 +0100
Subject: [PATCH 018/422] deleting run files

---
 .../AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml | 12 ------------
 .../Run3AFPMonitoring/python/eventLoopHeartBeat.txt  |  1 -
 2 files changed, 13 deletions(-)
 delete mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
 delete mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml b/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
deleted file mode 100644
index 5f18c9c49da1..000000000000
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/PoolFileCatalog.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
-<!-- Edited By POOL -->
-<!DOCTYPE POOLFILECATALOG SYSTEM "InMemory">
-<POOLFILECATALOG>
-  <File ID="23288CC6-5921-944B-BF66-F99ACC97ABBB">
-    <physical>
-      <pfn filetype="ROOT_All" name="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1"/>
-    </physical>
-    <logical/>
-  </File>
-
-</POOLFILECATALOG>
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt
deleted file mode 100644
index 0cd8dced0633..000000000000
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/eventLoopHeartBeat.txt
+++ /dev/null
@@ -1 +0,0 @@
-  done processing event #779703711, run #311321 10 events read so far  <<<===
-- 
GitLab


From 2ee0eb22a18d716604be337ea854826f719324a1 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 24 Feb 2020 16:21:43 +0100
Subject: [PATCH 019/422] deleted testfle

---
 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt | 10 ----------
 1 file changed, 10 deletions(-)
 delete mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
deleted file mode 100644
index d1768d22658e..000000000000
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/niktest.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-this is a test
-nikola a
-
-nikola 123
-nikola 4
-nikola 5
-nikola 6
-nikola 7
-
-If you can read this, then it works! :) :) :) :)
\ No newline at end of file
-- 
GitLab


From e720768855750558d781b7530c54273f274ab56a Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 24 Feb 2020 18:29:56 +0100
Subject: [PATCH 020/422] Adding access to the data

---
 ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt      | 7 +++++++
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h                | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index 4ed7b4100b5d..305c54a39ac7 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -5,12 +5,17 @@
 # Declare the package name:
 atlas_subdir( Run3AFPMonitoring )
 
+# Set the minimum required CMake version:
+cmake_minimum_required( VERSION 3.6 FATAL_ERROR )
+project(../athena/ForwardDetectors/AFP/Run3AFPMonitoring/)
+
 # Declare the package's dependencies:
 atlas_depends_on_subdirs(
     PUBLIC
         Control/AthenaBaseComps
         Control/AthenaMonitoringKernel
         GaudiKernel
+	Event/xAOD/xAODForward
         LumiBlock/LumiBlockComps
         LumiBlock/LumiBlockData
         Trigger/TrigEvent/TrigDecisionInterface
@@ -75,6 +80,7 @@ atlas_add_component(
         AthenaMonitoringKernelLib
         LumiBlockData
         LWHists
+	xAODForward
         SGAudCore
         TrigDecisionToolLib
 )
@@ -84,3 +90,4 @@ atlas_add_component(
 #                              POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
 #atlas_install_scripts( share/Run3DQTestingDriver.py share/hist_file_dump.py share/hist_diff.sh )
+
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 9e6f97ff56fd..92b98fc49f6e 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -22,5 +22,12 @@ private:
     std::vector<std::vector<int>> m_abGroups2;
     std::map<std::string,int> m_cGroups1;
     std::map<std::string,std::map<std::string,int>> m_cGroups2;
+
+protected:
+  static const int s_cNearStationIndex;
+  static const int s_cFarStationIndex;
+  const std::string m_histsDirectoryName;
+
 };
 #endif
+
-- 
GitLab


From f893caa975ee71e7348b60043414d74f1741f066 Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Mon, 24 Feb 2020 19:11:59 +0100
Subject: [PATCH 021/422] added also cxx code accessing data

---
 .../src/AFPSiLayerAlgorithm.cxx               | 80 ++++++++++++++++---
 1 file changed, 68 insertions(+), 12 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 736e21bd8b69..91a2125a1def 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -1,8 +1,12 @@
+
 /*
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "Run3AFPMonitoring/AFPSiLayerAlgorithm.h"
+#include <xAODForward/AFPSiHit.h>
+#include <xAODForward/AFPSiHitContainer.h>
+#include "StoreGate/ReadHandleKey.h"
 
 /* Old constructor:
 AFPHitsMonitorAlgorithm::AFPHitsMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
@@ -11,10 +15,19 @@ AFPHitsMonitorAlgorithm::AFPHitsMonitorAlgorithm( const std::string& name, ISvcL
 {}
 */
 
+const int s_cNearStationIndex = 2;
+const int s_cFarStationIndex = 3;
+
+
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
-,m_doRandom(true)
-{}
+//, m_histsDirectoryName ("AFP/")
+//, m_cNearStation (s_cNearStationIndex)
+//, m_cFarStation (s_cFarStationIndex)
+
+{
+    //declareProperty( "AFPSiHits", afpHitContainerKey );
+}
 
 
 AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
@@ -22,14 +35,22 @@ AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
 
 StatusCode AFPSiLayerAlgorithm::initialize() {
     using namespace Monitored;
-    m_abGroups1 = buildToolMap<int>(m_tools,"AFPSiLayer",2);
+    
+m_abGroups1 = buildToolMap<int>(m_tools,"AFPSiLayer",2);
     m_abGroups2 = buildToolMap<std::vector<int>>(m_tools,"AFPSiLayer",4,2);
-
+    /*
     std::vector<std::string> layers = {"layer1","layer2"};
     std::vector<std::string> clusters = {"clusterX","clusterB"};
     m_cGroups1 = buildToolMap<int>(m_tools,"AFPSiLayer",layers);
     m_cGroups2 = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayer",layers,clusters);
     return AthMonitorAlgorithm::initialize();
+    */
+    // We must declare to the framework in initialize what SG objects we are going to use
+    SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey;
+
+    ATH_CHECK(afpHitContainerKey.initialize());
+    // ...
+    return AthMonitorAlgorithm::initialize();
 }
 
 
@@ -42,21 +63,23 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     auto h_timeOverThreshold = Monitored::Scalar<int>("h_timeOverThreshold", 0);
     //auto h_hitMap = Monitored::Scalar<int>("h_hitMap", 0);
     // End
-
+/*	
     auto lumiPerBCID = Monitored::Scalar<float>("lumiPerBCID",0.0);
     auto lb = Monitored::Scalar<int>("lb",0);
     auto run = Monitored::Scalar<int>("run",0);
     auto random = Monitored::Scalar<float>("random",0.0);
     auto testweight = Monitored::Scalar<float>("testweight",1.0);
+*/
 
-    // Two variables (value and passed) needed for TEfficiency
+/*    // Two variables (value and passed) needed for TEfficiency
     auto pT = Monitored::Scalar<float>("pT",0.0);
     auto pT_passed = Monitored::Scalar<bool>("pT_passed",false);
-
+*/
     // Set the values of the monitored variables for the event
     h_timeOverThreshold = lbAverageInteractionsPerCrossing(ctx);
     h_hitMultiplicity = lbAverageInteractionsPerCrossing(ctx);
     //    h_hitMap = lbAverageInteractionsPerCrossing(ctx);
+/*
     lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
     lb = GetEventInfo(ctx)->lumiBlock();
     run = GetEventInfo(ctx)->runNumber();
@@ -71,20 +94,23 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     // Fake efficiency calculator
     pT = r.Landau(15);
     pT_passed = pT>r.Poisson(15);
-
+*/
     // Fill. First argument is the tool name, all others are the variables to be saved.
-    fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity,lumiPerBCID,lb,random,pT,pT_passed,testweight);
+    //fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity,lumiPerBCID,lb,random,pT,pT_passed,testweight);
     //fill("AFPSiLayerAlgorithm",h_hitMultiplicity,lb,random,pT,pT_passed,testweight);
+    fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity);
 
     // Alternative fill method. Get the group yourself, and pass it to the fill function.
-    auto tool = getGroup("AFPSiLayer");
-    fill(tool,run);
+    //auto tool = getGroup("AFPSiLayer");
+    //fill(tool,run);
 
     // Fill with a vector; useful in some circumstances.
+/*
     std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> varVec = {lumiPerBCID,pT};
     fill("AFPSiLayer",varVec);
     fill(tool,varVec);
-
+*/
+/*
     // Filling using a pre-defined array of groups.
     auto a = Scalar<float>("a",0.0);
     auto b = Scalar<float>("b",1.0);
@@ -108,6 +134,36 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
             fill(m_tools[m_cGroups2.at(layer).at(cluster)],c);
         }
     }
+*/    
+    SG::ReadHandle<xAOD::AFPSiHitContainer>* afpHitContainer;
+    if(! afpHitContainer->isValid())
+    {
+	ATH_MSG_ERROR("evtStore() does not contain hits collection with name afpHitContainerKey ");
+	return StatusCode::FAILURE;
+    }
+/*
+    CHECK( evtStore()->retrieve( afpHitContainer, "AFPSiHitContainer" ) );
+
+    for(const auto* hitsItr: *afpHitContainer)
+    {
+
+	switch(hitsItr->stationID())
+	{
+	    case s_cNearStationIndex:
+	        m_cNearStation.fillHistograms(*hitsItr);
+		break;
+	    case s_cFarStationIndex:
+		m_cFarStation.fillHistograms(*hitsItr);
+		break;
+	    default:
+		ATH_MSG_WARNING("UNrecognised station index: " << hitsItr->stationID());
+	}
 
+    }
+
+	m_cNearStation.eventEnd();
+	m_cFarStation.eventEnd();
+*/
     return StatusCode::SUCCESS;
 }
+
-- 
GitLab


From fa6700f04072affaf242f9d32d39d8654dc5c5e7 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Tue, 25 Feb 2020 12:42:23 +0100
Subject: [PATCH 022/422] Access to hits

---
 .../src/AFPSiLayerAlgorithm.cxx                | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 91a2125a1def..9f3c27689d2f 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -141,7 +141,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	ATH_MSG_ERROR("evtStore() does not contain hits collection with name afpHitContainerKey ");
 	return StatusCode::FAILURE;
     }
-/*
+
     CHECK( evtStore()->retrieve( afpHitContainer, "AFPSiHitContainer" ) );
 
     for(const auto* hitsItr: *afpHitContainer)
@@ -150,20 +150,20 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	switch(hitsItr->stationID())
 	{
 	    case s_cNearStationIndex:
-	        m_cNearStation.fillHistograms(*hitsItr);
-		break;
-	    case s_cFarStationIndex:
-		m_cFarStation.fillHistograms(*hitsItr);
+	        std::cout << hit.pixelColIDChip() << std::endl;
 		break;
+	    //case s_cFarStationIndex:
+		//m_cFarStation.fillHistograms(*hitsItr);
+		//break;
 	    default:
-		ATH_MSG_WARNING("UNrecognised station index: " << hitsItr->stationID());
+		ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
 	}
 
     }
 
-	m_cNearStation.eventEnd();
-	m_cFarStation.eventEnd();
-*/
+	//m_cNearStation.eventEnd();
+	//m_cFarStation.eventEnd();
+
     return StatusCode::SUCCESS;
 }
 
-- 
GitLab


From 441a60369ce4f3e230ba2bfc3da50b16b3586d2e Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Tue, 25 Feb 2020 15:03:16 +0100
Subject: [PATCH 023/422] Accessing data

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  3 +++
 .../src/AFPSiLayerAlgorithm.cxx               | 23 ++++++++++---------
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 92b98fc49f6e..a6f1a47bf763 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -7,6 +7,8 @@
 
 #include "AthenaMonitoring/AthMonitorAlgorithm.h"
 #include "AthenaMonitoringKernel/Monitored.h"
+#include "StoreGate/ReadHandleKey.h"
+#include <xAODForward/AFPSiHitContainer.h>
 
 #include "TRandom3.h"
 
@@ -22,6 +24,7 @@ private:
     std::vector<std::vector<int>> m_abGroups2;
     std::map<std::string,int> m_cGroups1;
     std::map<std::string,std::map<std::string,int>> m_cGroups2;
+    SG::ReadHandleKey<xAOD::MuonContainer> m_afpHitContainerKey;
 
 protected:
   static const int s_cNearStationIndex;
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 9f3c27689d2f..d18f4990864a 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -24,9 +24,10 @@ AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator*
 //, m_histsDirectoryName ("AFP/")
 //, m_cNearStation (s_cNearStationIndex)
 //, m_cFarStation (s_cFarStationIndex)
+, m_afpHitContainerKey("AFPSiHits")
 
 {
-    //declareProperty( "AFPSiHits", afpHitContainerKey );
+    declareProperty( "AFPSiHits", m_afpHitContainerKey );
 }
 
 
@@ -46,9 +47,9 @@ m_abGroups1 = buildToolMap<int>(m_tools,"AFPSiLayer",2);
     return AthMonitorAlgorithm::initialize();
     */
     // We must declare to the framework in initialize what SG objects we are going to use
-    SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey;
+    //SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
 
-    ATH_CHECK(afpHitContainerKey.initialize());
+    ATH_CHECK(m_afpHitContainerKey.initialize());
     // ...
     return AthMonitorAlgorithm::initialize();
 }
@@ -98,7 +99,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     // Fill. First argument is the tool name, all others are the variables to be saved.
     //fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity,lumiPerBCID,lb,random,pT,pT_passed,testweight);
     //fill("AFPSiLayerAlgorithm",h_hitMultiplicity,lb,random,pT,pT_passed,testweight);
-    fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity);
+    //////////fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity);
 
     // Alternative fill method. Get the group yourself, and pass it to the fill function.
     //auto tool = getGroup("AFPSiLayer");
@@ -135,22 +136,22 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
         }
     }
 */    
-    SG::ReadHandle<xAOD::AFPSiHitContainer>* afpHitContainer;
-    if(! afpHitContainer->isValid())
+    SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
+    if(! afpHitContainer.isValid())
     {
-	ATH_MSG_ERROR("evtStore() does not contain hits collection with name afpHitContainerKey ");
+	ATH_MSG_ERROR("evtStore() does not contain hits collection with name m_afpHitContainerKey ");
 	return StatusCode::FAILURE;
     }
 
-    CHECK( evtStore()->retrieve( afpHitContainer, "AFPSiHitContainer" ) );
+    //ATH_CHECK( afpHitContainerKey.initialize() );
 
-    for(const auto* hitsItr: *afpHitContainer)
+    for(const auto& hitsItr: *afpHitContainer)
     {
 
 	switch(hitsItr->stationID())
 	{
-	    case s_cNearStationIndex:
-	        std::cout << hit.pixelColIDChip() << std::endl;
+	    case 2:
+	        std::cout << hitsItr->pixelColIDChip() << std::endl;
 		break;
 	    //case s_cFarStationIndex:
 		//m_cFarStation.fillHistograms(*hitsItr);
-- 
GitLab


From c8689e3ee58948d6d0ccb2127c143258ff52a0fb Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Tue, 25 Feb 2020 15:13:36 +0100
Subject: [PATCH 024/422] fixed container initialisation

---
 .../Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index a6f1a47bf763..a500b56c5b77 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -24,7 +24,7 @@ private:
     std::vector<std::vector<int>> m_abGroups2;
     std::map<std::string,int> m_cGroups1;
     std::map<std::string,std::map<std::string,int>> m_cGroups2;
-    SG::ReadHandleKey<xAOD::MuonContainer> m_afpHitContainerKey;
+    SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
 
 protected:
   static const int s_cNearStationIndex;
-- 
GitLab


From 4668f1ce7872d756e2fba375ed33193587837184 Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Tue, 25 Feb 2020 15:36:58 +0100
Subject: [PATCH 025/422] test on afp si hits

---
 .../Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h | 1 +
 .../AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index a500b56c5b77..0f971d0a9850 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -9,6 +9,7 @@
 #include "AthenaMonitoringKernel/Monitored.h"
 #include "StoreGate/ReadHandleKey.h"
 #include <xAODForward/AFPSiHitContainer.h>
+//##include <xAODForward/AFPSiHit.h>
 
 #include "TRandom3.h"
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index d18f4990864a..73c63b3f0644 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -4,8 +4,8 @@
 */
 
 #include "Run3AFPMonitoring/AFPSiLayerAlgorithm.h"
-#include <xAODForward/AFPSiHit.h>
-#include <xAODForward/AFPSiHitContainer.h>
+//#include <xAODForward/AFPSiHit.h>
+//#include <xAODForward/AFPSiHitContainer.h>
 #include "StoreGate/ReadHandleKey.h"
 
 /* Old constructor:
-- 
GitLab


From bde1d6911dccdca49f25643ffd3292551cbc8d8e Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Tue, 25 Feb 2020 17:27:12 +0100
Subject: [PATCH 026/422] latest changes

---
 ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt        | 5 ++++-
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h                  | 4 ++--
 .../AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx        | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index 305c54a39ac7..ef8a35d49268 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -16,6 +16,7 @@ atlas_depends_on_subdirs(
         Control/AthenaMonitoringKernel
         GaudiKernel
 	Event/xAOD/xAODForward
+	xAODForward/AFPSiHit
         LumiBlock/LumiBlockComps
         LumiBlock/LumiBlockData
         Trigger/TrigEvent/TrigDecisionInterface
@@ -80,7 +81,8 @@ atlas_add_component(
         AthenaMonitoringKernelLib
         LumiBlockData
         LWHists
-	xAODForward
+	AFPSiHit
+        xAODForward
         SGAudCore
         TrigDecisionToolLib
 )
@@ -89,5 +91,6 @@ atlas_add_component(
 #atlas_install_python_modules( python/*.py 
 #                              POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
+atlas_install_python_modules( python/*.py )
 #atlas_install_scripts( share/Run3DQTestingDriver.py share/hist_file_dump.py share/hist_diff.sh )
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 0f971d0a9850..c345cbcce3e5 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -8,8 +8,8 @@
 #include "AthenaMonitoring/AthMonitorAlgorithm.h"
 #include "AthenaMonitoringKernel/Monitored.h"
 #include "StoreGate/ReadHandleKey.h"
-#include <xAODForward/AFPSiHitContainer.h>
-//##include <xAODForward/AFPSiHit.h>
+#include "xAODForward/AFPSiHitContainer.h"
+#include "xAODForward/AFPSiHit.h"
 
 #include "TRandom3.h"
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 73c63b3f0644..4cb400022e11 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -145,7 +145,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
     //ATH_CHECK( afpHitContainerKey.initialize() );
 
-    for(const auto& hitsItr: *afpHitContainer)
+    for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
     {
 
 	switch(hitsItr->stationID())
-- 
GitLab


From c166e7ad8e3a08d02235fb8f564df35a81bb113b Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Tue, 25 Feb 2020 18:00:18 +0100
Subject: [PATCH 027/422] Deleting files

---
 .../AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx            | 1 -
 1 file changed, 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 73c63b3f0644..9f6f8d1eae9b 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -1,4 +1,3 @@
-
 /*
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-- 
GitLab


From 25ec760a8f69a882caabccbe78cf29f88dd88e39 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Tue, 25 Feb 2020 18:02:24 +0100
Subject: [PATCH 028/422] Deleting files

---
 .../AFPHitsMonitorAlgorithm.h                 | 26 -----
 .../src/AFPHitsMonitorAlgorithm.cxx           | 96 -------------------
 2 files changed, 122 deletions(-)
 delete mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h
 delete mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPHitsMonitorAlgorithm.cxx

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h
deleted file mode 100644
index 3ea7e50f3364..000000000000
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef AFPHITSMONITORALGORITHM_H
-#define AFPHITSMONITORALGORITHM_H
-
-#include "AthenaMonitoring/AthMonitorAlgorithm.h"
-#include "AthenaMonitoringKernel/Monitored.h"
-
-#include "TRandom3.h"
-
-class AFPHitsMonitorAlgorithm : public AthMonitorAlgorithm {
-public:
-    AFPHitsMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
-    virtual ~AFPHitsMonitorAlgorithm();
-    virtual StatusCode initialize() override;
-    virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
-private:
-    Gaudi::Property<bool> m_doRandom {this,"RandomHist",false};
-    std::vector<int> m_abGroups1;
-    std::vector<std::vector<int>> m_abGroups2;
-    std::map<std::string,int> m_cGroups1;
-    std::map<std::string,std::map<std::string,int>> m_cGroups2;
-};
-#endif
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPHitsMonitorAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPHitsMonitorAlgorithm.cxx
deleted file mode 100644
index 4c38efd5127c..000000000000
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPHitsMonitorAlgorithm.cxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "Run3AFPMonitoring/AFPHitsMonitorAlgorithm.h"
-
-AFPHitsMonitorAlgorithm::AFPHitsMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
-:AthMonitorAlgorithm(name,pSvcLocator)
-,m_doRandom(true)
-{}
-
-
-AFPHitsMonitorAlgorithm::~AFPHitsMonitorAlgorithm() {}
-
-
-StatusCode AFPHitsMonitorAlgorithm::initialize() {
-    using namespace Monitored;
-    m_abGroups1 = buildToolMap<int>(m_tools,"ExampleMonitor",2);
-    m_abGroups2 = buildToolMap<std::vector<int>>(m_tools,"ExampleMonitor",4,2);
-
-    std::vector<std::string> layers = {"layer1","layer2"};
-    std::vector<std::string> clusters = {"clusterX","clusterB"};
-    m_cGroups1 = buildToolMap<int>(m_tools,"ExampleMonitor",layers);
-    m_cGroups2 = buildToolMap<std::map<std::string,int>>(m_tools,"ExampleMonitor",layers,clusters);
-    return AthMonitorAlgorithm::initialize();
-}
-
-
-StatusCode AFPHitsMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const {
-    using namespace Monitored;
-
-    // Declare the quantities which should be monitored
-    auto lumiPerBCID = Monitored::Scalar<float>("lumiPerBCID",0.0);
-    auto lb = Monitored::Scalar<int>("lb",0);
-    auto run = Monitored::Scalar<int>("run",0);
-    auto random = Monitored::Scalar<float>("random",0.0);
-    auto testweight = Monitored::Scalar<float>("testweight",1.0);
-
-    // Two variables (value and passed) needed for TEfficiency
-    auto pT = Monitored::Scalar<float>("pT",0.0);
-    auto pT_passed = Monitored::Scalar<bool>("pT_passed",false);
-
-    // Set the values of the monitored variables for the event
-    lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
-    lb = GetEventInfo(ctx)->lumiBlock();
-    run = GetEventInfo(ctx)->runNumber();
-    testweight = 2.0;
-    
-    TRandom3 r(ctx.eventID().event_number());
-    // Example of using flags
-    if (m_doRandom) {
-        random = r.Rndm();
-    }
-
-    // Fake efficiency calculator
-    pT = r.Landau(15);
-    pT_passed = pT>r.Poisson(15);
-
-    // Fill. First argument is the tool name, all others are the variables to be saved.
-    fill("ExampleMonitor",lumiPerBCID,lb,random,pT,pT_passed,testweight);
-
-    // Alternative fill method. Get the group yourself, and pass it to the fill function.
-    auto tool = getGroup("ExampleMonitor");
-    fill(tool,run);
-
-    // Fill with a vector; useful in some circumstances.
-    std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> varVec = {lumiPerBCID,pT};
-    fill("ExampleMonitor",varVec);
-    fill(tool,varVec);
-
-    // Filling using a pre-defined array of groups.
-    auto a = Scalar<float>("a",0.0);
-    auto b = Scalar<float>("b",1.0);
-    auto c = Scalar<float>("c",2.0);
-    for ( auto iEta : {0,1} ) {
-        // 1) Valid but inefficient fill
-        fill("ExampleMonitor_"+std::to_string(iEta),a,b,c);
-        // 2) Faster way to fill a vector of histograms
-        fill(m_tools[m_abGroups1[iEta]],a,b,c);
-        for ( auto iPhi : {0,1} ) {
-            // Same efficient method for 2D array
-            fill(m_tools[m_abGroups2[iEta][iPhi]],a,b);
-        }
-    }
-
-    // Filling using a pre-defined map of groups.
-    for ( auto& layer : std::vector<std::string>({"layer1","layer2"}) ) {
-        fill(m_tools[m_cGroups1.at(layer)],c);
-        for ( auto& cluster : std::vector<std::string>({"clusterX","clusterB"}) ) {
-            // Same efficient method for 2D map
-            fill(m_tools[m_cGroups2.at(layer).at(cluster)],c);
-        }
-    }
-
-    return StatusCode::SUCCESS;
-}
-- 
GitLab


From 9f8db352e36a95d162b615e51c311a25995eb318 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Tue, 25 Feb 2020 17:20:44 +0000
Subject: [PATCH 029/422] clean up CMakeLists, I assume this is a component
 only library, i.e the main usage is to run the alg from Athena

---
 .../AFP/Run3AFPMonitoring/CMakeLists.txt      | 41 ++-----------------
 1 file changed, 3 insertions(+), 38 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index ef8a35d49268..8c93802de04f 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -5,9 +5,6 @@
 # Declare the package name:
 atlas_subdir( Run3AFPMonitoring )
 
-# Set the minimum required CMake version:
-cmake_minimum_required( VERSION 3.6 FATAL_ERROR )
-project(../athena/ForwardDetectors/AFP/Run3AFPMonitoring/)
 
 # Declare the package's dependencies:
 atlas_depends_on_subdirs(
@@ -36,23 +33,14 @@ atlas_depends_on_subdirs(
 )
 
 # External dependencies:
-find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
-find_package( Boost )
 find_package( ROOT COMPONENTS Core )
 
 # Component(s) in the package:
-atlas_add_library(
-    Run3AFPMonitoringLib
-    src/*.cxx
-    PUBLIC_HEADERS
-        Run3AFPMonitoring
+atlas_add_component( Run3AFPMonitoring
+    Run3AFPMonitoring/*.h src/*.cxx src/components/*.cxx
     INCLUDE_DIRS
         ${ROOT_INCLUDE_DIRS}
-    PRIVATE_INCLUDE_DIRS
-        ${Boost_INCLUDE_DIRS}
-        ${CORAL_INCLUDE_DIRS}
     LINK_LIBRARIES
-        ${Boost_LIBRARIES}
         ${ROOT_LIBRARIES}
         AthenaBaseComps
         AthenaMonitoringLib
@@ -61,8 +49,7 @@ atlas_add_library(
         LumiBlockCompsLib
         LumiBlockData
         TrigDecisionToolLib
-    PRIVATE_LINK_LIBRARIES
-        ${CORAL_LIBRARIES}
+        xAODForward
         AthenaKernel
         SGAudCore
         AthenaPoolUtilities
@@ -70,27 +57,5 @@ atlas_add_library(
         LWHists
 )
 
-atlas_add_component(
-    Run3AFPMonitoring
-    src/components/*.cxx
-    INCLUDE_DIRS
-        ${CORAL_INCLUDE_DIRS}
-    LINK_LIBRARIES
-        Run3AFPMonitoringLib
-        AthenaMonitoringLib
-        AthenaMonitoringKernelLib
-        LumiBlockData
-        LWHists
-	AFPSiHit
-        xAODForward
-        SGAudCore
-        TrigDecisionToolLib
-)
-
-# Install files from the package:
-#atlas_install_python_modules( python/*.py 
-#                              POST_BUILD_CMD ${ATLAS_FLAKE8} )
-atlas_install_joboptions( share/*.py )
 atlas_install_python_modules( python/*.py )
-#atlas_install_scripts( share/Run3DQTestingDriver.py share/hist_file_dump.py share/hist_diff.sh )
 
-- 
GitLab


From 1ba343b3e230a264312e75af48c64657ddb51090 Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Wed, 26 Feb 2020 17:57:51 +0100
Subject: [PATCH 030/422] changed container name and printout now prints out
 actually used name

---
 .../AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index c3e069288229..7301d788d968 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -23,10 +23,10 @@ AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator*
 //, m_histsDirectoryName ("AFP/")
 //, m_cNearStation (s_cNearStationIndex)
 //, m_cFarStation (s_cFarStationIndex)
-, m_afpHitContainerKey("AFPSiHits")
+, m_afpHitContainerKey("AFPSiHitContainer")
 
 {
-    declareProperty( "AFPSiHits", m_afpHitContainerKey );
+    declareProperty( "AFPSiHitContainer", m_afpHitContainerKey );
 }
 
 
@@ -138,14 +138,16 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
     if(! afpHitContainer.isValid())
     {
-	ATH_MSG_ERROR("evtStore() does not contain hits collection with name m_afpHitContainerKey ");
+	ATH_MSG_ERROR("evtStore() does not contain hits collection with name " << m_afpHitContainerKey);
 	return StatusCode::FAILURE;
     }
 
-    //ATH_CHECK( afpHitContainerKey.initialize() );
 
+    //ATH_CHECK( afpHitContainerKey.initialize() );
+ //for (const auto& muonItr : *muons) {
     for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
     {
+       std::cout << hitsItr->stationID() << std::endl;
 
 	switch(hitsItr->stationID())
 	{
-- 
GitLab


From be802017e8ba2aaa878902f35d5c687da400069c Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Wed, 4 Mar 2020 16:18:50 +0100
Subject: [PATCH 031/422] added 3d monitoring group for the hits

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  4 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 81 +++++++------------
 .../src/AFPSiLayerAlgorithm.cxx               | 35 ++++----
 3 files changed, 47 insertions(+), 73 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index c345cbcce3e5..9e07ad9c6a66 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -24,9 +24,9 @@ private:
     std::vector<int> m_abGroups1;
     std::vector<std::vector<int>> m_abGroups2;
     std::map<std::string,int> m_cGroups1;
-    std::map<std::string,std::map<std::string,int>> m_cGroups2;
+    std::map<std::string,std::map<std::string,std::map<std::string,int>>> m_HitmapGroups;
     SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
-
+//      m_HitmapGroups = buildToolMap<std::string,std::map<std::string,int>>
 protected:
   static const int s_cNearStationIndex;
   static const int s_cFarStationIndex;
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index b5c8b2349ce6..45c962625256 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -32,11 +32,11 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     # base class configuration following the inputFlags. The returned object 
     # is the algorithm.
     from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
-    afpSiLayerAlgorithm = helper.addAlgorithm(AFPSiLayerAlgorithm,'AFPSiLayer')
+    afpSiLayerAlgorithm = helper.addAlgorithm(AFPSiLayerAlgorithm,'AFPSiLayerAlg')
 
     # You can actually make multiple instances of the same algorithm and give 
     # them different configuration
-    anotherExampleMonAlg = helper.addAlgorithm(AFPSiLayerAlgorithm,'AnotherExampleMonAlg')
+    #anotherExampleMonAlg = helper.addAlgorithm(AFPSiLayerAlgorithm,'AnotherExampleMonAlg')
 
     # # If for some really obscure reason you need to instantiate an algorithm
     # # yourself, the AddAlgorithm method will still configure the base 
@@ -62,65 +62,33 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     # Add a generic monitoring tool (a "group" in old language). The returned 
     # object here is the standard GenericMonitoringTool.
-    station0_1 = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayer','Station0/')
+    AFPGroup = helper.addGroup( afpSiLayerAlgorithm,         'AFPSiLayerTool',         'AFP/'     ) 
+
+#    station0_1 = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayer','Station0/')
 
     # Add a GMT for the other example monitor algorithm
-    anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer')
+#    anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer')
 
 
     ### STEP 5 ###
     # Configure histogramsIf you want to create histograms with variable bin widths, ROOT provides another constructor suited for this purpose. Instead of passing the data interval and the number of bins, you have to pass an array (single or double precision) of bin edges. When the histogram has n bins, then there are n+1 distinct edges, so the array you pass must be of size n+1.
 
 
-    
-    # My histograms
-    station0_1.defineHistogram('h_hitMultiplicity', title='Number of hits per event', path='AFPSiLayerPath',xbins=40, xmin=-0.5, xmax=39.5)
-    station0_1.defineHistogram('h_timeOverThreshold', title='Time over threshold', path='AFPSiLayerPath', xbins=16, xmin=-0.5, xmax=15.5)
-    # nRows = 80, nColumns = 336.
-   # station0_1.defineHistogram('h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80+0.5, ybins=336,ymin=0.5,ymax=336+0.5)
-    # end My histograms
-    station0_1.defineHistogram('lumiPerBCID',title='Luminosity,WithCommaInTitle;L/BCID;Events',
-                            path='ToRuleThemAll',xbins=40,xmin=0.0,xmax=80.0)
-    station0_1.defineHistogram('lb', title='Luminosity Block;lb;Events',
-                            path='ToFindThem',xbins=1000,xmin=-0.5,xmax=999.5,weight='testweight')
-    station0_1.defineHistogram('random', title='LB;x;Events',
-                            path='ToBringThemAll',xbins=30,xmin=0,xmax=1,opt='kLBNHistoryDepth=10')
-    station0_1.defineHistogram('random', title='title;x;y',path='ToBringThemAll',
-                            xbins=[0,.1,.2,.4,.8,1.6])
-    station0_1.defineHistogram('random,pT', type='TH2F', title='title;x;y',path='ToBringThemAll',
-                            xbins=[0,.1,.2,.4,.8,1.6],ybins=[0,10,30,40,60,70,90])
-    # myGroup.defineHistogram('pT_passed,pT',type='TEfficiency',title='Test TEfficiency;x;Eff',
-    #                         path='AndInTheDarkness',xbins=100,xmin=0.0,xmax=50.0)
-
-    anotherGroup.defineHistogram('lbWithFilter',title='Lumi;lb;Events',
-                                 path='top',xbins=1000,xmin=-0.5,xmax=999.5)
-    anotherGroup.defineHistogram('run',title='Run Number;run;Events',
-                                 path='top',xbins=1000000,xmin=-0.5,xmax=999999.5)
-
     # Example defining an array of histograms. This is useful if one seeks to create a
     # number of histograms in an organized manner. (For instance, one plot for each ASIC
     # in the subdetector, and these components are mapped in eta, phi, and layer.) Thus,
     # one might have an array of TH1's such as quantity[etaIndex][phiIndex][layerIndex].
-    for alg in [afpSiLayerAlgorithm,anotherExampleMonAlg]:
-        # Using an array of groups
-        array = helper.addArray([2],alg,'AFPSiLayer')
-        array.defineHistogram('a,b',title='AB',type='TH2F',path='Eta',
-                              xbins=10,xmin=0.0,xmax=10.0,
-                              ybins=10,ymin=0.0,ymax=10.0)
-        array.defineHistogram('c',title='C',path='Eta',
-                              xbins=10,xmin=0.0,xmax=10.0)
-        array = helper.addArray([4,2],alg,'AFPSiLayer')
-        array.defineHistogram('a',title='A',path='EtaPhi',
-                              xbins=10,xmin=0.0,xmax=10.0)
-        # Using a map of groups
-        layerList = ['layer1','layer2']
-        clusterList = ['clusterX','clusterB']
-        array = helper.addArray([layerList],alg,'AFPSiLayer')
-        array.defineHistogram('c',title='C',path='Layer',
-                              xbins=10,xmin=0,xmax=10.0)
-        array = helper.addArray([layerList,clusterList],alg,'AFPSiLayer')
-        array.defineHistogram('c',title='C',path='LayerCluster',
-                              xbins=10,xmin=0,xmax=10.0)
+    for alg in [afpSiLayerAlgorithm]:
+
+    # Using a map of groups
+        layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
+        stationList = ['FarStation','NearStation'] # TODO XXX
+        sideList = ['Aside' , 'Cside' ]
+        array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayer')
+        array.defineHistogram(  'h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', 
+				xbins=80,xmin=0.5,xmax=80.5, 
+				ybins=336,ymin=0.5,ymax=336.5)
+
 
     ### STEP 6 ###
     # Finalize. The return value should be a tuple of the ComponentAccumulator
@@ -146,8 +114,17 @@ if __name__=='__main__':
 
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
-    file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
+    nightly = ''#/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00348618/data18_13TeV.00348618.physics_Main.recon.AOD.v220/'
+    #file = 'data18_13TeV.00348618.physics_Main.recon.AOD.v220._lb0295._0009.1'
+    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1'
+#/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.deriv.DAOD_STDM7.r10258_p3399_p4030/DAOD_STDM7.20036794._000007.pool.root.1'
+#/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.recon.AOD.r10258_p3412_r11501/AOD.18508508._000007.pool.root.1'
+#/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
+   # nightly = '/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00357750/data18_13TeV.00357750.physics_Main.recon.AOD.f1041/'
+   # file = 'data18_13TeV.00357750.physics_Main.recon.AOD.f1041._lb0105._SFO-7._0103.1'
+
+    #nightly = '/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/'
+    #file = 'data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1'
     ConfigFlags.Input.Files = [nightly+file]
     ConfigFlags.Input.isMC = False
     ConfigFlags.Output.HISTFileName = 'AFPOutput.root'
@@ -167,4 +144,4 @@ if __name__=='__main__':
     # exampleMonitorAcc.getEventAlgo('ExampleMonAlg').OutputLevel = 2 # DEBUG
     cfg.printConfig(withDetails=False) # set True for exhaustive info
 
-    cfg.run(10) #use cfg.run(20) to only run on first 20 events
+    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 7301d788d968..d33b6042176a 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -35,20 +35,17 @@ AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
 
 StatusCode AFPSiLayerAlgorithm::initialize() {
     using namespace Monitored;
-    
-m_abGroups1 = buildToolMap<int>(m_tools,"AFPSiLayer",2);
-    m_abGroups2 = buildToolMap<std::vector<int>>(m_tools,"AFPSiLayer",4,2);
-    /*
-    std::vector<std::string> layers = {"layer1","layer2"};
-    std::vector<std::string> clusters = {"clusterX","clusterB"};
-    m_cGroups1 = buildToolMap<int>(m_tools,"AFPSiLayer",layers);
-    m_cGroups2 = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayer",layers,clusters);
-    return AthMonitorAlgorithm::initialize();
-    */
-    // We must declare to the framework in initialize what SG objects we are going to use
-    //SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
+ 
+    std::vector<std::string> layers = { "P0","P1", "P2", "P3"};
+    std::vector<std::string> stations = { "FarStation","NearStation"};
+    std::vector<std::string> sides = { "Aside","Cside"};
+
+    m_HitmapGroups = buildToolMap<std::map<std::string,std::map<std::string,int>>>(m_tools,"AFPSiLayerTool",sides,stations,layers);
 
-    ATH_CHECK(m_afpHitContainerKey.initialize());
+//  std::map<std::string,std::map<std::string,int>> <std::map<std::string,int>> 
+     // We must declare to the framework in initialize what SG objects we are going to use
+    //SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
+    //    ATH_CHECK(m_afpHitContainerKey.initialize());
     // ...
     return AthMonitorAlgorithm::initialize();
 }
@@ -59,8 +56,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
     // Declare the quantities which should be monitored
     // My histograms:
-    auto h_hitMultiplicity = Monitored::Scalar<int>("h_hitMultiplicity", 0);
-    auto h_timeOverThreshold = Monitored::Scalar<int>("h_timeOverThreshold", 0);
+ //   auto h_hitMultiplicity = Monitored::Scalar<int>("h_hitMultiplicity", 0);
+ //   auto h_timeOverThreshold = Monitored::Scalar<int>("h_timeOverThreshold", 0);
     //auto h_hitMap = Monitored::Scalar<int>("h_hitMap", 0);
     // End
 /*	
@@ -76,8 +73,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     auto pT_passed = Monitored::Scalar<bool>("pT_passed",false);
 */
     // Set the values of the monitored variables for the event
-    h_timeOverThreshold = lbAverageInteractionsPerCrossing(ctx);
-    h_hitMultiplicity = lbAverageInteractionsPerCrossing(ctx);
+  //  h_timeOverThreshold = lbAverageInteractionsPerCrossing(ctx);
+  //  h_hitMultiplicity = lbAverageInteractionsPerCrossing(ctx);
     //    h_hitMap = lbAverageInteractionsPerCrossing(ctx);
 /*
     lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
@@ -145,7 +142,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
     //ATH_CHECK( afpHitContainerKey.initialize() );
  //for (const auto& muonItr : *muons) {
-    for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
+  /*  for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
     {
        std::cout << hitsItr->stationID() << std::endl;
 
@@ -162,7 +159,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	}
 
     }
-
+*/
 	//m_cNearStation.eventEnd();
 	//m_cFarStation.eventEnd();
 
-- 
GitLab


From 6d2604d6d3f9b177c7a3259cc1cf58c730106ef2 Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Wed, 4 Mar 2020 21:51:03 +0100
Subject: [PATCH 032/422] added half working thing

---
 .../python/Run3AFPExampleMonitorAlgorithm.py     | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 45c962625256..163745845b59 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -64,11 +64,11 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     # object here is the standard GenericMonitoringTool.
     AFPGroup = helper.addGroup( afpSiLayerAlgorithm,         'AFPSiLayerTool',         'AFP/'     ) 
 
-#    station0_1 = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayer','Station0/')
+    #    station0_1 = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayer','Station0/')
 
     # Add a GMT for the other example monitor algorithm
-#    anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer')
-
+    #    anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer')
+#    AFPGroup.defineHistogram('totHits', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits') 
 
     ### STEP 5 ###
     # Configure histogramsIf you want to create histograms with variable bin widths, ROOT provides another constructor suited for this purpose. Instead of passing the data interval and the number of bins, you have to pass an array (single or double precision) of bin edges. When the histogram has n bins, then there are n+1 distinct edges, so the array you pass must be of size n+1.
@@ -84,11 +84,9 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
         layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
         stationList = ['FarStation','NearStation'] # TODO XXX
         sideList = ['Aside' , 'Cside' ]
-        array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayer')
-        array.defineHistogram(  'h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', 
-				xbins=80,xmin=0.5,xmax=80.5, 
-				ybins=336,ymin=0.5,ymax=336.5)
-
+        array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayerTool')
+        array.defineHistogram(  'h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80.5, ybins=336,ymin=0.5,ymax=336.5)
+        array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {3}', path='Keys/{0}', xmax=3. )
 
     ### STEP 6 ###
     # Finalize. The return value should be a tuple of the ComponentAccumulator
@@ -144,4 +142,4 @@ if __name__=='__main__':
     # exampleMonitorAcc.getEventAlgo('ExampleMonAlg').OutputLevel = 2 # DEBUG
     cfg.printConfig(withDetails=False) # set True for exhaustive info
 
-    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
+    cfg.run(100) #use cfg.run(20) to only run on first 20 events
-- 
GitLab


From c6281a005a849c58478e2060e4079d174f1f37f8 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Thu, 5 Mar 2020 14:22:58 +0100
Subject: [PATCH 033/422] Containers access - works

---
 .../python/Run3AFPExampleMonitorAlgorithm.py       |  4 ++--
 .../Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx  | 14 +++++++++-----
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 163745845b59..591748f53976 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -68,7 +68,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     # Add a GMT for the other example monitor algorithm
     #    anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer')
-#    AFPGroup.defineHistogram('totHits', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits') 
+    AFPGroup.defineHistogram('totHits', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits') 
 
     ### STEP 5 ###
     # Configure histogramsIf you want to create histograms with variable bin widths, ROOT provides another constructor suited for this purpose. Instead of passing the data interval and the number of bins, you have to pass an array (single or double precision) of bin edges. When the histogram has n bins, then there are n+1 distinct edges, so the array you pass must be of size n+1.
@@ -86,7 +86,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
         sideList = ['Aside' , 'Cside' ]
         array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayerTool')
         array.defineHistogram(  'h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80.5, ybins=336,ymin=0.5,ymax=336.5)
-        array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {3}', path='Keys/{0}', xmax=3. )
+        array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {2}', path='Keys/{0}', xmax=3. )
 
     ### STEP 6 ###
     # Finalize. The return value should be a tuple of the ComponentAccumulator
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index d33b6042176a..17c9c3ed0717 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -40,12 +40,13 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
     std::vector<std::string> stations = { "FarStation","NearStation"};
     std::vector<std::string> sides = { "Aside","Cside"};
 
+
     m_HitmapGroups = buildToolMap<std::map<std::string,std::map<std::string,int>>>(m_tools,"AFPSiLayerTool",sides,stations,layers);
 
 //  std::map<std::string,std::map<std::string,int>> <std::map<std::string,int>> 
      // We must declare to the framework in initialize what SG objects we are going to use
-    //SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
-    //    ATH_CHECK(m_afpHitContainerKey.initialize());
+    SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
+        ATH_CHECK(m_afpHitContainerKey.initialize());
     // ...
     return AthMonitorAlgorithm::initialize();
 }
@@ -67,6 +68,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     auto random = Monitored::Scalar<float>("random",0.0);
     auto testweight = Monitored::Scalar<float>("testweight",1.0);
 */
+    auto totHits = Monitored::Scalar<int>("totHits", 0); // Nikola
 
 /*    // Two variables (value and passed) needed for TEfficiency
     auto pT = Monitored::Scalar<float>("pT",0.0);
@@ -76,6 +78,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
   //  h_timeOverThreshold = lbAverageInteractionsPerCrossing(ctx);
   //  h_hitMultiplicity = lbAverageInteractionsPerCrossing(ctx);
     //    h_hitMap = lbAverageInteractionsPerCrossing(ctx);
+    totHits = GetEventInfo(ctx)->lumiBlock();	// Nikola
 /*
     lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
     lb = GetEventInfo(ctx)->lumiBlock();
@@ -96,6 +99,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     //fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity,lumiPerBCID,lb,random,pT,pT_passed,testweight);
     //fill("AFPSiLayerAlgorithm",h_hitMultiplicity,lb,random,pT,pT_passed,testweight);
     //////////fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity);
+    //fill("AFPSiLayerTool", totHits);
 
     // Alternative fill method. Get the group yourself, and pass it to the fill function.
     //auto tool = getGroup("AFPSiLayer");
@@ -140,9 +144,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     }
 
 
-    //ATH_CHECK( afpHitContainerKey.initialize() );
+    ATH_CHECK( afpHitContainer.initialize() );
  //for (const auto& muonItr : *muons) {
-  /*  for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
+    for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
     {
        std::cout << hitsItr->stationID() << std::endl;
 
@@ -159,7 +163,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	}
 
     }
-*/
+
 	//m_cNearStation.eventEnd();
 	//m_cFarStation.eventEnd();
 
-- 
GitLab


From 227e86508e7e45e802afee5a3f36355cb358aa2d Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Thu, 5 Mar 2020 18:13:23 +0100
Subject: [PATCH 034/422] Added first histogram - Luminosity block

---
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  4 ++--
 .../src/AFPSiLayerAlgorithm.cxx               | 21 +++++++++++++------
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 591748f53976..27d8407ae2f7 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -68,7 +68,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     # Add a GMT for the other example monitor algorithm
     #    anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer')
-    AFPGroup.defineHistogram('totHits', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits') 
+    AFPGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits') 
 
     ### STEP 5 ###
     # Configure histogramsIf you want to create histograms with variable bin widths, ROOT provides another constructor suited for this purpose. Instead of passing the data interval and the number of bins, you have to pass an array (single or double precision) of bin edges. When the histogram has n bins, then there are n+1 distinct edges, so the array you pass must be of size n+1.
@@ -142,4 +142,4 @@ if __name__=='__main__':
     # exampleMonitorAcc.getEventAlgo('ExampleMonAlg').OutputLevel = 2 # DEBUG
     cfg.printConfig(withDetails=False) # set True for exhaustive info
 
-    cfg.run(100) #use cfg.run(20) to only run on first 20 events
+    cfg.run(1000) #use cfg.run(20) to only run on first 20 events
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 17c9c3ed0717..02fd4178e1d1 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -68,7 +68,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     auto random = Monitored::Scalar<float>("random",0.0);
     auto testweight = Monitored::Scalar<float>("testweight",1.0);
 */
-    auto totHits = Monitored::Scalar<int>("totHits", 0); // Nikola
+    auto lb = Monitored::Scalar<int>("lb", 0); // Nikola
+    auto nhits = Monitored::Scalar<float>("nhits", 1.0);
+    
 
 /*    // Two variables (value and passed) needed for TEfficiency
     auto pT = Monitored::Scalar<float>("pT",0.0);
@@ -78,13 +80,15 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
   //  h_timeOverThreshold = lbAverageInteractionsPerCrossing(ctx);
   //  h_hitMultiplicity = lbAverageInteractionsPerCrossing(ctx);
     //    h_hitMap = lbAverageInteractionsPerCrossing(ctx);
-    totHits = GetEventInfo(ctx)->lumiBlock();	// Nikola
+    lb = GetEventInfo(ctx)->lumiBlock();	// Nikola
+    nhits = 1.0;		// This should be changed to: nhits = afpHitContainer.size() ; !!!!!!!!!
 /*
     lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
     lb = GetEventInfo(ctx)->lumiBlock();
     run = GetEventInfo(ctx)->runNumber();
     testweight = 2.0;
-    
+        
+
     TRandom3 r(ctx.eventID().event_number());
     // Example of using flags
     if (m_doRandom) {
@@ -99,7 +103,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     //fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity,lumiPerBCID,lb,random,pT,pT_passed,testweight);
     //fill("AFPSiLayerAlgorithm",h_hitMultiplicity,lb,random,pT,pT_passed,testweight);
     //////////fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity);
-    //fill("AFPSiLayerTool", totHits);
+   //fill("AFPSiLayerTool", lb);
 
     // Alternative fill method. Get the group yourself, and pass it to the fill function.
     //auto tool = getGroup("AFPSiLayer");
@@ -146,6 +150,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
     ATH_CHECK( afpHitContainer.initialize() );
  //for (const auto& muonItr : *muons) {
+    //nhits = afpHitContainer.size();
     for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
     {
        std::cout << hitsItr->stationID() << std::endl;
@@ -154,10 +159,14 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	{
 	    case 2:
 	        std::cout << hitsItr->pixelColIDChip() << std::endl;
+		std::cout << "Case 2; Test" << std::endl;
+		//fill(*hitsItr);
+		fill("AFPSiLayerTool", lb, nhits);
 		break;
-	    //case s_cFarStationIndex:
+	    case 3:
+		std::cout << "Case 3; Test" << std::endl;		
 		//m_cFarStation.fillHistograms(*hitsItr);
-		//break;
+		break;
 	    default:
 		ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
 	}
-- 
GitLab


From ed9664639a18f61c127cb03673b894a951d3de9e Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Thu, 5 Mar 2020 20:48:28 +0100
Subject: [PATCH 035/422] fixed container size access

---
 .../AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx         | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 02fd4178e1d1..bf9908be5108 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -81,7 +81,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
   //  h_hitMultiplicity = lbAverageInteractionsPerCrossing(ctx);
     //    h_hitMap = lbAverageInteractionsPerCrossing(ctx);
     lb = GetEventInfo(ctx)->lumiBlock();	// Nikola
-    nhits = 1.0;		// This should be changed to: nhits = afpHitContainer.size() ; !!!!!!!!!
+
 /*
     lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
     lb = GetEventInfo(ctx)->lumiBlock();
@@ -150,7 +150,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
     ATH_CHECK( afpHitContainer.initialize() );
  //for (const auto& muonItr : *muons) {
-    //nhits = afpHitContainer.size();
+    nhits = afpHitContainer->size();
     for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
     {
        std::cout << hitsItr->stationID() << std::endl;
-- 
GitLab


From d1b193a740f15b967a6e4c92653ce10ba80adeeb Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 9 Mar 2020 10:15:29 +0100
Subject: [PATCH 036/422] Hitmaps - version 0

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  3 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 11 ++--
 .../src/AFPSiLayerAlgorithm.cxx               | 55 +++++++++++++++----
 3 files changed, 53 insertions(+), 16 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 9e07ad9c6a66..a880b0a101e7 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -24,7 +24,8 @@ private:
     std::vector<int> m_abGroups1;
     std::vector<std::vector<int>> m_abGroups2;
     std::map<std::string,int> m_cGroups1;
-    std::map<std::string,std::map<std::string,std::map<std::string,int>>> m_HitmapGroups;
+    //std::map<std::string,std::map<std::string,std::map<std::string,int>>> m_HitmapGroups;
+    std::map<std::string,<std::map<std::string,int>> m_HitmapGroups;
     SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
 //      m_HitmapGroups = buildToolMap<std::string,std::map<std::string,int>>
 protected:
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 27d8407ae2f7..c22c115fb6c3 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -82,11 +82,14 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     # Using a map of groups
         layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
-        stationList = ['FarStation','NearStation'] # TODO XXX
-        sideList = ['Aside' , 'Cside' ]
-        array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayerTool')
+        #stationList = ['FarStation','NearStation'] # TODO XXX
+        #sideList = ['Aside' , 'Cside' ]
+	combinedList = [ 0, 1, 2, 3 ]
+        #array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayerTool')
+        array = helper.addArray([combinedList,layerList],alg,'AFPSiLayerTool')
         array.defineHistogram(  'h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80.5, ybins=336,ymin=0.5,ymax=336.5)
-        array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {2}', path='Keys/{0}', xmax=3. )
+        #array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {2}', path='Keys/{0}', xmax=3. )
+         array.defineHistogram('h_hitMap', title='hitmap for {0} Layer {1}', path='Keys/{0}', xmax=3. )
 
     ### STEP 6 ###
     # Finalize. The return value should be a tuple of the ComponentAccumulator
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index bf9908be5108..79fc33eeb389 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -36,12 +36,14 @@ AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
 StatusCode AFPSiLayerAlgorithm::initialize() {
     using namespace Monitored;
  
-    std::vector<std::string> layers = { "P0","P1", "P2", "P3"};
-    std::vector<std::string> stations = { "FarStation","NearStation"};
-    std::vector<std::string> sides = { "Aside","Cside"};
+    std::vector<std::string> layers = { "P0", "P1", "P2", "P3"};
+    std::vector<int> combined = { 0, 1, 2, 3};
+    //std::vector<std::string> stations = { "FarStation" , "NearStation" };
+    //std::vector<std::string> sides = { "Aside" , "Cside" };
 
 
-    m_HitmapGroups = buildToolMap<std::map<std::string,std::map<std::string,int>>>(m_tools,"AFPSiLayerTool",sides,stations,layers);
+    //m_HitmapGroups = buildToolMap<std::map<std::string,std::map<std::string,int>>>(m_tools,"AFPSiLayerTool",sides,stations,layers);
+      m_HitmapGroups = buildToolMap<std::map<int,int>>(m_tools,"AFPSiLayerTool",combined,layers);
 
 //  std::map<std::string,std::map<std::string,int>> <std::map<std::string,int>> 
      // We must declare to the framework in initialize what SG objects we are going to use
@@ -147,31 +149,62 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	return StatusCode::FAILURE;
     }
 
+    /**
+     *
+     *	const int xAOD::AFPStationID::farA = 0;
+     *	const int xAOD::AFPStationID::nearA = 1;
+     *	const int xAOD::AFPStationID::nearC = 2;
+     *	const int xAOD::AFPStationID::farC = 3;
+     *
+     */
 
     ATH_CHECK( afpHitContainer.initialize() );
- //for (const auto& muonItr : *muons) {
+
     nhits = afpHitContainer->size();
+    fill("AFPSiLayerTool", lb, nhits);
+
     for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
     {
-       std::cout << hitsItr->stationID() << std::endl;
+       //std::cout << hitsItr->stationID() << std::endl;
 
+	for ( auto& layer : std::vector<std::string>({"P0","P1", "P2", "P3"}) ) 
+	{
 	switch(hitsItr->stationID())
 	{
+	    case 0:
+		std::cout << "Case 0; Test" << std::endl;
+		fill(m_tools[m_HitmapGroups.at(layer).at(hitsItr)]);
+		break;
+	    case 1:
+		std::cout << "Case 1; Test" << std::endl;
+		fill(m_tools[m_HitmapGroups.at(layer).at(hitsItr)]);
+		break;
 	    case 2:
-	        std::cout << hitsItr->pixelColIDChip() << std::endl;
 		std::cout << "Case 2; Test" << std::endl;
-		//fill(*hitsItr);
-		fill("AFPSiLayerTool", lb, nhits);
+		fill(m_tools[m_HitmapGroups.at(layer).at(hitsItr)]);
 		break;
 	    case 3:
-		std::cout << "Case 3; Test" << std::endl;		
+		std::cout << "Case 3; Test" << std::endl;
+		fill(m_tools[m_HitmapGroups.at(layer).at(hitsItr)]);		
 		//m_cFarStation.fillHistograms(*hitsItr);
 		break;
 	    default:
 		ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
 	}
-
+	}
     }
+/*
+    // Filling using a pre-defined map of groups.
+    for ( auto& layer : std::vector<std::string>({"layer1","layer2"}) ) {
+        fill(m_tools[m_cGroups1.at(layer)],c);
+        for ( auto& cluster : std::vector<std::string>({"clusterX","clusterB"}) ) {
+            // Same efficient method for 2D map
+            fill(m_tools[m_cGroups2.at(layer).at(cluster)],c);
+        }
+    }
+
+
+*/
 
 	//m_cNearStation.eventEnd();
 	//m_cFarStation.eventEnd();
-- 
GitLab


From c2024d88a5fdd23eb6d75b4d8a51d66ffc829554 Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Mon, 9 Mar 2020 11:19:52 +0100
Subject: [PATCH 037/422] added loop over layers and statiosn

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  8 ++-
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 25 ++++----
 .../src/AFPSiLayerAlgorithm.cxx               | 61 ++++++-------------
 3 files changed, 37 insertions(+), 57 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index a880b0a101e7..b245a2f57dd3 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -25,10 +25,16 @@ private:
     std::vector<std::vector<int>> m_abGroups2;
     std::map<std::string,int> m_cGroups1;
     //std::map<std::string,std::map<std::string,std::map<std::string,int>>> m_HitmapGroups;
-    std::map<std::string,<std::map<std::string,int>> m_HitmapGroups;
+    std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
     SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
+    
 //      m_HitmapGroups = buildToolMap<std::string,std::map<std::string,int>>
 protected:
+   std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
+   std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
+
+
+
   static const int s_cNearStationIndex;
   static const int s_cFarStationIndex;
   const std::string m_histsDirectoryName;
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index c22c115fb6c3..50218c937f04 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -80,16 +80,17 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     # one might have an array of TH1's such as quantity[etaIndex][phiIndex][layerIndex].
     for alg in [afpSiLayerAlgorithm]:
 
-    # Using a map of groups
-        layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
-        #stationList = ['FarStation','NearStation'] # TODO XXX
-        #sideList = ['Aside' , 'Cside' ]
-	combinedList = [ 0, 1, 2, 3 ]
-        #array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayerTool')
-        array = helper.addArray([combinedList,layerList],alg,'AFPSiLayerTool')
-        array.defineHistogram(  'h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80.5, ybins=336,ymin=0.5,ymax=336.5)
-        #array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {2}', path='Keys/{0}', xmax=3. )
-         array.defineHistogram('h_hitMap', title='hitmap for {0} Layer {1}', path='Keys/{0}', xmax=3. )
+       # Using a map of groups
+       layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
+       #stationList = ['FarStation','NearStation'] # TODO XXX
+       #sideList = ['Aside' , 'Cside' ]        
+       combinedList = [ "farAside", "nearAside" , "nearCside" , "farCside" ]
+
+       #array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayerTool')
+       array = helper.addArray([combinedList,layerList],alg,'AFPSiLayerTool')
+       array.defineHistogram(  'h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80.5, ybins=336,ymin=0.5,ymax=336.5)
+       #array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {2}', path='Keys/{0}', xmax=3. )
+       array.defineHistogram('h_hitMap', title='hitmap for {0} Layer {1}', path='Keys/{0}', xmax=3. )
 
     ### STEP 6 ###
     # Finalize. The return value should be a tuple of the ComponentAccumulator
@@ -143,6 +144,6 @@ if __name__=='__main__':
 
     # If you want to turn on more detailed messages ...
     # exampleMonitorAcc.getEventAlgo('ExampleMonAlg').OutputLevel = 2 # DEBUG
-    cfg.printConfig(withDetails=False) # set True for exhaustive info
+ #   cfg.printConfig(withDetails=False) # set True for exhaustive info
 
-    cfg.run(1000) #use cfg.run(20) to only run on first 20 events
+    cfg.run(10) #use cfg.run(20) to only run on first 20 events
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 79fc33eeb389..c68ae9dc1aab 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -6,16 +6,7 @@
 //#include <xAODForward/AFPSiHit.h>
 //#include <xAODForward/AFPSiHitContainer.h>
 #include "StoreGate/ReadHandleKey.h"
-
-/* Old constructor:
-AFPHitsMonitorAlgorithm::AFPHitsMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
-:AthMonitorAlgorithm(name,pSvcLocator)
-,m_doRandom(true)
-{}
-*/
-
-const int s_cNearStationIndex = 2;
-const int s_cFarStationIndex = 3;
+#include "xAODForward/AFPStationID.h"
 
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
@@ -36,14 +27,7 @@ AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
 StatusCode AFPSiLayerAlgorithm::initialize() {
     using namespace Monitored;
  
-    std::vector<std::string> layers = { "P0", "P1", "P2", "P3"};
-    std::vector<int> combined = { 0, 1, 2, 3};
-    //std::vector<std::string> stations = { "FarStation" , "NearStation" };
-    //std::vector<std::string> sides = { "Aside" , "Cside" };
-
-
-    //m_HitmapGroups = buildToolMap<std::map<std::string,std::map<std::string,int>>>(m_tools,"AFPSiLayerTool",sides,stations,layers);
-      m_HitmapGroups = buildToolMap<std::map<int,int>>(m_tools,"AFPSiLayerTool",combined,layers);
+    m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool",m_stationnames,m_pixlayers);
 
 //  std::map<std::string,std::map<std::string,int>> <std::map<std::string,int>> 
      // We must declare to the framework in initialize what SG objects we are going to use
@@ -163,36 +147,25 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     nhits = afpHitContainer->size();
     fill("AFPSiLayerTool", lb, nhits);
 
+    auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); // Nikola
+    auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); // Nikola
+
     for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
     {
-       //std::cout << hitsItr->stationID() << std::endl;
-
-	for ( auto& layer : std::vector<std::string>({"P0","P1", "P2", "P3"}) ) 
-	{
-	switch(hitsItr->stationID())
-	{
-	    case 0:
-		std::cout << "Case 0; Test" << std::endl;
-		fill(m_tools[m_HitmapGroups.at(layer).at(hitsItr)]);
-		break;
-	    case 1:
-		std::cout << "Case 1; Test" << std::endl;
-		fill(m_tools[m_HitmapGroups.at(layer).at(hitsItr)]);
-		break;
-	    case 2:
-		std::cout << "Case 2; Test" << std::endl;
-		fill(m_tools[m_HitmapGroups.at(layer).at(hitsItr)]);
-		break;
-	    case 3:
-		std::cout << "Case 3; Test" << std::endl;
-		fill(m_tools[m_HitmapGroups.at(layer).at(hitsItr)]);		
-		//m_cFarStation.fillHistograms(*hitsItr);
-		break;
-	    default:
-		ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
+      pixelRowIDChip=hitsItr->pixelRowIDChip();
+      pixelColIDChip = hitsItr->pixelColIDChip();
+      std::cout << hitsItr->stationID() << std::endl;
+      std::cout << hitsItr->pixelLayerID() << std::endl;
+	
+      if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 
+	&& hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
+      {
+         fill(m_tools[m_HitmapGroups.at( m_stationnames.at(hitsItr->stationID())).at( m_pixlayers.at(hitsItr->pixelLayerID()))] , pixelRowIDChip , pixelColIDChip);
 	}
+else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
+
 	}
-    }
+    
 /*
     // Filling using a pre-defined map of groups.
     for ( auto& layer : std::vector<std::string>({"layer1","layer2"}) ) {
-- 
GitLab


From 93ec232289751b97955c88ff5a767c58cb70ed21 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 9 Mar 2020 14:28:13 +0100
Subject: [PATCH 038/422] Added a lot of histograms with Hits

---
 .../python/Run3AFPExampleMonitorAlgorithm.py         | 11 ++++++-----
 .../Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx    | 12 +++++++-----
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 50218c937f04..8001dc4cd022 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -84,13 +84,13 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
        layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
        #stationList = ['FarStation','NearStation'] # TODO XXX
        #sideList = ['Aside' , 'Cside' ]        
-       combinedList = [ "farAside", "nearAside" , "nearCside" , "farCside" ]
+       combinedList = [ 'farAside', 'nearAside' , 'nearCside' , 'farCside' ]
 
        #array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayerTool')
-       array = helper.addArray([combinedList,layerList],alg,'AFPSiLayerTool')
-       array.defineHistogram(  'h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80.5, ybins=336,ymin=0.5,ymax=336.5)
+       array2D = helper.addArray([combinedList,layerList],alg,'AFPSiLayerTool', topPath = 'Hits')
+       array2D.defineHistogram(  'h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80.5, ybins=336,ymin=0.5,ymax=336.5)
        #array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {2}', path='Keys/{0}', xmax=3. )
-       array.defineHistogram('h_hitMap', title='hitmap for {0} Layer {1}', path='Keys/{0}', xmax=3. )
+       array2D.defineHistogram('h_hitMap', title='hitmap for {0} Layer {1}', path='Keys/{0}', xmax=3. )
 
     ### STEP 6 ###
     # Finalize. The return value should be a tuple of the ComponentAccumulator
@@ -146,4 +146,5 @@ if __name__=='__main__':
     # exampleMonitorAcc.getEventAlgo('ExampleMonAlg').OutputLevel = 2 # DEBUG
  #   cfg.printConfig(withDetails=False) # set True for exhaustive info
 
-    cfg.run(10) #use cfg.run(20) to only run on first 20 events
+    cfg.run(100) #use cfg.run(20) to only run on first 20 events
+
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index c68ae9dc1aab..43f94e726a9c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -55,7 +55,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     auto testweight = Monitored::Scalar<float>("testweight",1.0);
 */
     auto lb = Monitored::Scalar<int>("lb", 0); // Nikola
-    auto nhits = Monitored::Scalar<float>("nhits", 1.0);
+    auto nhits = Monitored::Scalar<int>("nhits", 1);
     
 
 /*    // Two variables (value and passed) needed for TEfficiency
@@ -149,18 +149,20 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
     auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); // Nikola
     auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); // Nikola
-
+    auto h_hitMap = Monitored::Scalar<int>("h_hitMap", 0); // Nikola
     for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
     {
       pixelRowIDChip=hitsItr->pixelRowIDChip();
       pixelColIDChip = hitsItr->pixelColIDChip();
-      std::cout << hitsItr->stationID() << std::endl;
-      std::cout << hitsItr->pixelLayerID() << std::endl;
+      std::cout << "Hits iteration -> stationID = " << hitsItr->stationID() << std::endl;
+      std::cout << "Hits iteration -> pixelLayerID = " << hitsItr->pixelLayerID() << std::endl;
 	
       if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 
 	&& hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
       {
-         fill(m_tools[m_HitmapGroups.at( m_stationnames.at(hitsItr->stationID())).at( m_pixlayers.at(hitsItr->pixelLayerID()))] , pixelRowIDChip , pixelColIDChip);
+	std::cout << "I AM RIGHT BEFORE FILL METHOD\n" << std::endl;
+        //fill(m_tools[m_HitmapGroups.at( m_stationnames.at(hitsItr->stationID())).at( m_pixlayers.at(hitsItr->pixelLayerID()))] , pixelRowIDChip , pixelColIDChip);
+        fill(m_tools[m_HitmapGroups.at( m_stationnames.at(hitsItr->stationID())).at( m_pixlayers.at(hitsItr->pixelLayerID()))] , h_hitMap);
 	}
 else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
 
-- 
GitLab


From e8cee7b46f4cdb235c3948a20e191849b29aaff0 Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Mon, 9 Mar 2020 14:57:34 +0100
Subject: [PATCH 039/422] add updates

---
 .../python/Run3AFPExampleMonitorAlgorithm.py                 | 5 +++--
 .../AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx        | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 8001dc4cd022..24bb8430d81c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -88,9 +88,10 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
        #array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayerTool')
        array2D = helper.addArray([combinedList,layerList],alg,'AFPSiLayerTool', topPath = 'Hits')
-       array2D.defineHistogram(  'h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80.5, ybins=336,ymin=0.5,ymax=336.5)
+       array2D.defineHistogram(  'pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80.5, ybins=336,ymin=0.5,ymax=336.5)
        #array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {2}', path='Keys/{0}', xmax=3. )
-       array2D.defineHistogram('h_hitMap', title='hitmap for {0} Layer {1}', path='Keys/{0}', xmax=3. )
+
+      #array2D.defineHistogram('h_hitMap', title='hitmap for {0} Layer {1}', path='Keys/{0}', xmax=3. )
 
     ### STEP 6 ###
     # Finalize. The return value should be a tuple of the ComponentAccumulator
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 43f94e726a9c..65c99d2cc0bd 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -162,7 +162,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
       {
 	std::cout << "I AM RIGHT BEFORE FILL METHOD\n" << std::endl;
         //fill(m_tools[m_HitmapGroups.at( m_stationnames.at(hitsItr->stationID())).at( m_pixlayers.at(hitsItr->pixelLayerID()))] , pixelRowIDChip , pixelColIDChip);
-        fill(m_tools[m_HitmapGroups.at( m_stationnames.at(hitsItr->stationID())).at( m_pixlayers.at(hitsItr->pixelLayerID()))] , h_hitMap);
+        fill(m_tools[m_HitmapGroups.at( m_stationnames.at(hitsItr->stationID())).at( m_pixlayers.at(hitsItr->pixelLayerID()))] , pixelRowIDChip, pixelColIDChip);
 	}
 else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
 
-- 
GitLab


From 8c5a4fca6eaa3339ac2ec968f1f3c40001c21076 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Tue, 10 Mar 2020 15:39:04 +0100
Subject: [PATCH 040/422] Started ToF

---
 .../Run3AFPMonitoring/AFPToFAlgorithm.h       |  45 ++++++++
 .../python/Run3AFPExampleMonitorAlgorithm.py  |   4 +
 .../src/AFPSiLayerAlgorithm.cxx               |   5 +
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx | 105 ++++++++++++++++++
 .../components/Run3AFPMonitoring_entries.cxx  |   2 +
 5 files changed, 161 insertions(+)
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
new file mode 100644
index 000000000000..450e360763f3
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -0,0 +1,45 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef AFPTOFALGORITHM_H
+#define AFPTOFALGORITHM_H
+
+#include "AthenaMonitoring/AthMonitorAlgorithm.h"
+#include "AthenaMonitoringKernel/Monitored.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "xAODForward/AFPToFHitContainer.h"
+#include "xAODForward/AFPToFHit.h"
+
+
+#include "TRandom3.h"
+
+class AFPToFAlgorithm : public AthMonitorAlgorithm {
+public:
+    AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
+    virtual ~AFPToFAlgorithm();
+    virtual StatusCode initialize() override;
+    virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+private:
+    Gaudi::Property<bool> m_doRandom {this,"RandomHist",false};
+    std::vector<int> m_abGroups1;
+    std::vector<std::vector<int>> m_abGroups2;
+    std::map<std::string,int> m_cGroups1;
+    //std::map<std::string,std::map<std::string,std::map<std::string,int>>> m_HitmapGroups;
+    std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
+    SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
+    
+//      m_HitmapGroups = buildToolMap<std::string,std::map<std::string,int>>
+protected:
+   std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
+   std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
+
+
+
+  static const int s_cNearStationIndex;
+  static const int s_cFarStationIndex;
+  const std::string m_histsDirectoryName;
+
+};
+#endif
+
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 24bb8430d81c..39a984de7a4c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -34,6 +34,9 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
     afpSiLayerAlgorithm = helper.addAlgorithm(AFPSiLayerAlgorithm,'AFPSiLayerAlg')
 
+    from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPToFAlgorithm
+    afpToFAlgorithm = helper.addAlgorithm(AFPToFAlgorithm,'AFPToFAlg')
+
     # You can actually make multiple instances of the same algorithm and give 
     # them different configuration
     #anotherExampleMonAlg = helper.addAlgorithm(AFPSiLayerAlgorithm,'AnotherExampleMonAlg')
@@ -63,6 +66,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     # Add a generic monitoring tool (a "group" in old language). The returned 
     # object here is the standard GenericMonitoringTool.
     AFPGroup = helper.addGroup( afpSiLayerAlgorithm,         'AFPSiLayerTool',         'AFP/'     ) 
+    AFPToFGroup = helper.addGroup( afpToFAlgorithm,         'AFPToFTool',         'AFP/'     )
 
     #    station0_1 = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayer','Station0/')
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 65c99d2cc0bd..26f0e22fc6f3 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -1,5 +1,10 @@
 /*
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*
+*
+*	AFPSiLayerAlgorithm
+*
+*
 */
 
 #include "Run3AFPMonitoring/AFPSiLayerAlgorithm.h"
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
new file mode 100644
index 000000000000..bfb57360d3b7
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -0,0 +1,105 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*
+*
+*	AFPToFAlgorithm
+*
+*
+*/
+
+#include "Run3AFPMonitoring/AFPToFAlgorithm.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "xAODForward/AFPStationID.h"
+
+
+AFPToFAlgorithm::AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
+:AthMonitorAlgorithm(name,pSvcLocator)
+//, m_histsDirectoryName ("AFP/")
+//, m_cNearStation (s_cNearStationIndex)
+//, m_cFarStation (s_cFarStationIndex)
+, m_afpToFContainerKey("AFPToFContainer")
+
+{
+    declareProperty( "AFPToFContainer", m_afpToFContainerKey );
+}
+
+
+AFPToFAlgorithm::~AFPToFAlgorithm() {}
+
+
+StatusCode AFPToFAlgorithm::initialize() {
+    using namespace Monitored;
+ 
+    m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPToFTool",m_stationnames,m_pixlayers);
+
+    // std::map<std::string,std::map<std::string,int>> <std::map<std::string,int>> 
+    // We must declare to the framework in initialize what SG objects we are going to use
+    SG::ReadHandleKey<xAOD::AFPToFContainer> afpToFContainerKey("AFPToFHits");
+        ATH_CHECK(m_afpToFContainerKey.initialize());
+    // ...
+    return AthMonitorAlgorithm::initialize();
+}
+
+
+StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
+    using namespace Monitored;
+
+    // Declare the quantities which should be monitored
+    // My histograms:
+    // auto h_hitMultiplicity = Monitored::Scalar<int>("h_hitMultiplicity", 0);
+    // auto h_timeOverThreshold = Monitored::Scalar<int>("h_timeOverThreshold", 0);
+    // auto h_hitMap = Monitored::Scalar<int>("h_hitMap", 0);
+    // End
+
+    auto lb = Monitored::Scalar<int>("lb", 0); // Nikola
+    auto nhits = Monitored::Scalar<int>("nhits", 1);
+    
+    lb = GetEventInfo(ctx)->lumiBlock();	// Nikola
+
+ 
+    SG::ReadHandle<xAOD::AFPToFContainer> afpToFContainer(m_afpToFContainerKey, ctx);
+    if(! afpToFContainer.isValid())
+    {
+	ATH_MSG_ERROR("evtStore() does not contain hits collection with name " << m_afpToFContainerKey);
+	return StatusCode::FAILURE;
+    }
+
+    /******************************************
+     *
+     *	const int xAOD::AFPStationID::farA = 0;
+     *	const int xAOD::AFPStationID::nearA = 1;
+     *	const int xAOD::AFPStationID::nearC = 2;
+     *	const int xAOD::AFPStationID::farC = 3;
+     *
+     ******************************************/
+
+    ATH_CHECK( afpToFContainer.initialize() );
+
+    nhits = afpToFContainer->size();
+    fill("AFPSiLayerTool", lb, nhits);
+
+    auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); // Nikola
+    auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); // Nikola
+    auto h_hitMap = Monitored::Scalar<int>("h_hitMap", 0); // Nikola
+
+    for(const xAOD::AFPSiHit *hitsItr: *afpToFContainer)
+    {
+       pixelRowIDChip=hitsItr->pixelRowIDChip();
+       pixelColIDChip = hitsItr->pixelColIDChip();
+       std::cout << "Hits iteration -> stationID = " << hitsItr->stationID() << std::endl;
+       std::cout << "Hits iteration -> pixelLayerID = " << hitsItr->pixelLayerID() << std::endl;
+	
+       if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
+       {
+          std::cout << "I AM RIGHT BEFORE FILL METHOD\n" << std::endl;
+          fill(m_tools[m_HitmapGroups.at( m_stationnames.at(hitsItr->stationID())).at( m_pixlayers.at(hitsItr->pixelLayerID()))] , pixelRowIDChip, pixelColIDChip);
+       }
+       else 
+	ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
+
+     }
+
+
+    return StatusCode::SUCCESS;
+}
+
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx
index 3fb7d47dc5a6..ddca4d2e27ab 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx
@@ -3,5 +3,7 @@
 */
 
 #include "Run3AFPMonitoring/AFPSiLayerAlgorithm.h"
+#include "Run3AFPMonitoring/AFPToFAlgorithm.h"
 
 DECLARE_COMPONENT( AFPSiLayerAlgorithm )
+//DECLARE_COMPONENT( AFPToFAlgorithm )
-- 
GitLab


From 0b41eb1ee3624817dbf5cc18fc16236ae2c28a19 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 11 Mar 2020 13:03:44 +0100
Subject: [PATCH 041/422] ToF histograms obtaining - version 0.9

---
 .../AFP/Run3AFPMonitoring/CMakeLists.txt      |  1 +
 .../Run3AFPMonitoring/AFPToFAlgorithm.h       | 12 ++++-----
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  1 +
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx | 27 +++++++++----------
 .../components/Run3AFPMonitoring_entries.cxx  |  2 +-
 5 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index 8c93802de04f..893eb37d8671 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -14,6 +14,7 @@ atlas_depends_on_subdirs(
         GaudiKernel
 	Event/xAOD/xAODForward
 	xAODForward/AFPSiHit
+	xAODForward/AFPToFHit	#Nikola
         LumiBlock/LumiBlockComps
         LumiBlock/LumiBlockData
         Trigger/TrigEvent/TrigDecisionInterface
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
index 450e360763f3..d5258e227c1d 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -21,13 +21,13 @@ public:
     virtual StatusCode initialize() override;
     virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 private:
-    Gaudi::Property<bool> m_doRandom {this,"RandomHist",false};
-    std::vector<int> m_abGroups1;
-    std::vector<std::vector<int>> m_abGroups2;
-    std::map<std::string,int> m_cGroups1;
+    //Gaudi::Property<bool> m_doRandom {this,"RandomHist",false};
+    //std::vector<int> m_abGroups1;
+    //std::vector<std::vector<int>> m_abGroups2;
+    //std::map<std::string,int> m_cGroups1;
     //std::map<std::string,std::map<std::string,std::map<std::string,int>>> m_HitmapGroups;
-    std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
-    SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
+    //std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
+    SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
     
 //      m_HitmapGroups = buildToolMap<std::string,std::map<std::string,int>>
 protected:
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 39a984de7a4c..5ffb476a9537 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -73,6 +73,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     # Add a GMT for the other example monitor algorithm
     #    anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer')
     AFPGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits') 
+    AFPToFGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits') 
 
     ### STEP 5 ###
     # Configure histogramsIf you want to create histograms with variable bin widths, ROOT provides another constructor suited for this purpose. Instead of passing the data interval and the number of bins, you have to pass an array (single or double precision) of bin edges. When the histogram has n bins, then there are n+1 distinct edges, so the array you pass must be of size n+1.
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index bfb57360d3b7..1ae1419f0721 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -14,13 +14,10 @@
 
 AFPToFAlgorithm::AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
-//, m_histsDirectoryName ("AFP/")
-//, m_cNearStation (s_cNearStationIndex)
-//, m_cFarStation (s_cFarStationIndex)
-, m_afpToFContainerKey("AFPToFContainer")
+, m_afpToFHitContainerKey("AFPToFHitContainer")
 
 {
-    declareProperty( "AFPToFContainer", m_afpToFContainerKey );
+    declareProperty( "AFPToFHitContainer", m_afpToFHitContainerKey );
 }
 
 
@@ -30,12 +27,12 @@ AFPToFAlgorithm::~AFPToFAlgorithm() {}
 StatusCode AFPToFAlgorithm::initialize() {
     using namespace Monitored;
  
-    m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPToFTool",m_stationnames,m_pixlayers);
+    //m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPToFTool",m_stationnames,m_pixlayers);
 
     // std::map<std::string,std::map<std::string,int>> <std::map<std::string,int>> 
     // We must declare to the framework in initialize what SG objects we are going to use
-    SG::ReadHandleKey<xAOD::AFPToFContainer> afpToFContainerKey("AFPToFHits");
-        ATH_CHECK(m_afpToFContainerKey.initialize());
+    SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
+        ATH_CHECK(m_afpToFHitContainerKey.initialize());
     // ...
     return AthMonitorAlgorithm::initialize();
 }
@@ -57,10 +54,10 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     lb = GetEventInfo(ctx)->lumiBlock();	// Nikola
 
  
-    SG::ReadHandle<xAOD::AFPToFContainer> afpToFContainer(m_afpToFContainerKey, ctx);
-    if(! afpToFContainer.isValid())
+    SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
+    if(! afpToFHitContainer.isValid())
     {
-	ATH_MSG_ERROR("evtStore() does not contain hits collection with name " << m_afpToFContainerKey);
+	ATH_MSG_ERROR("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
 	return StatusCode::FAILURE;
     }
 
@@ -73,11 +70,11 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
      *
      ******************************************/
 
-    ATH_CHECK( afpToFContainer.initialize() );
+    ATH_CHECK( afpToFHitContainer.initialize() );
 
-    nhits = afpToFContainer->size();
+    nhits = afpToFHitContainer->size();
     fill("AFPSiLayerTool", lb, nhits);
-
+/*
     auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); // Nikola
     auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); // Nikola
     auto h_hitMap = Monitored::Scalar<int>("h_hitMap", 0); // Nikola
@@ -98,7 +95,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
 
      }
-
+*/
 
     return StatusCode::SUCCESS;
 }
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx
index ddca4d2e27ab..87d934362be0 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/components/Run3AFPMonitoring_entries.cxx
@@ -6,4 +6,4 @@
 #include "Run3AFPMonitoring/AFPToFAlgorithm.h"
 
 DECLARE_COMPONENT( AFPSiLayerAlgorithm )
-//DECLARE_COMPONENT( AFPToFAlgorithm )
+DECLARE_COMPONENT( AFPToFAlgorithm )
-- 
GitLab


From e1bf4c79e10028adfe514a52f97364854f33e5e0 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 11 Mar 2020 14:01:40 +0100
Subject: [PATCH 042/422] Small correction to AFPToFAlgorithm.cxx (AFPToFTool)

---
 .../Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h   | 6 +++---
 .../AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx           | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
index d5258e227c1d..b975fb7c7972 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -36,9 +36,9 @@ protected:
 
 
 
-  static const int s_cNearStationIndex;
-  static const int s_cFarStationIndex;
-  const std::string m_histsDirectoryName;
+  //static const int s_cNearStationIndex;
+  //static const int s_cFarStationIndex;
+  //const std::string m_histsDirectoryName;
 
 };
 #endif
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index 1ae1419f0721..64c10506fc34 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -73,7 +73,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     ATH_CHECK( afpToFHitContainer.initialize() );
 
     nhits = afpToFHitContainer->size();
-    fill("AFPSiLayerTool", lb, nhits);
+    fill("AFPToFTool", lb, nhits);
 /*
     auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); // Nikola
     auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); // Nikola
-- 
GitLab


From 0fefcf29243a87bee76bc6bfd730a97cc5519d49 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 11 Mar 2020 15:54:04 +0100
Subject: [PATCH 043/422] First ToF histogram

---
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 10 ++++++---
 .../src/AFPSiLayerAlgorithm.cxx               |  6 ++---
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx | 22 ++++++++++++++++---
 3 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 5ffb476a9537..a61a73ed56bf 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -72,8 +72,11 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     # Add a GMT for the other example monitor algorithm
     #    anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer')
-    AFPGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits') 
-    AFPToFGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits') 
+    AFPGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nsihits') 
+    AFPToFGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='ToF',xbins=1000,xmin=-0.5,xmax=999.5,weight='ntofhits') 
+
+    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits',  path='ToF',xbins=3,xmin=-0.5,xmax=2.5)
+    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits',  path='ToF',xbins=3,xmin=-0.5,xmax=2.5)
 
     ### STEP 5 ###
     # Configure histogramsIf you want to create histograms with variable bin widths, ROOT provides another constructor suited for this purpose. Instead of passing the data interval and the number of bins, you have to pass an array (single or double precision) of bin edges. When the histogram has n bins, then there are n+1 distinct edges, so the array you pass must be of size n+1.
@@ -124,7 +127,8 @@ if __name__=='__main__':
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     nightly = ''#/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00348618/data18_13TeV.00348618.physics_Main.recon.AOD.v220/'
     #file = 'data18_13TeV.00348618.physics_Main.recon.AOD.v220._lb0295._0009.1'
-    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1'
+    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' #ToF
+    #file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1' #SiT
 #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.deriv.DAOD_STDM7.r10258_p3399_p4030/DAOD_STDM7.20036794._000007.pool.root.1'
 #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.recon.AOD.r10258_p3412_r11501/AOD.18508508._000007.pool.root.1'
 #/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 26f0e22fc6f3..6fe12d88fefb 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -60,7 +60,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     auto testweight = Monitored::Scalar<float>("testweight",1.0);
 */
     auto lb = Monitored::Scalar<int>("lb", 0); // Nikola
-    auto nhits = Monitored::Scalar<int>("nhits", 1);
+    auto nsihits = Monitored::Scalar<int>("nsihits", 1);
     
 
 /*    // Two variables (value and passed) needed for TEfficiency
@@ -149,8 +149,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
     ATH_CHECK( afpHitContainer.initialize() );
 
-    nhits = afpHitContainer->size();
-    fill("AFPSiLayerTool", lb, nhits);
+    nsihits = afpHitContainer->size();
+    fill("AFPSiLayerTool", lb, nsihits);
 
     auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); // Nikola
     auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); // Nikola
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index 64c10506fc34..dd3fffa51d83 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -49,7 +49,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     // End
 
     auto lb = Monitored::Scalar<int>("lb", 0); // Nikola
-    auto nhits = Monitored::Scalar<int>("nhits", 1);
+    auto ntofhits = Monitored::Scalar<int>("ntofhits", 1);
     
     lb = GetEventInfo(ctx)->lumiBlock();	// Nikola
 
@@ -72,8 +72,24 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 
     ATH_CHECK( afpToFHitContainer.initialize() );
 
-    nhits = afpToFHitContainer->size();
-    fill("AFPToFTool", lb, nhits);
+    ntofhits = afpToFHitContainer->size();
+    fill("AFPToFTool", lb, ntofhits);
+/*									TO BE researched: difference between trainID and barInTrainID
+    auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
+    auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0); 
+
+    for(const xAOD::AFPTofHit *hitsIts: *afpToFHitContainer)
+    {
+	if(hitsIts->isSideA())
+	{
+	    fill("AFPToFTool", numberOfHit_S0);
+	}
+	else if(hitsIts->isSideC())
+	{
+	    fill("AFPToFTool", numberOfHit_S3);
+	}
+    }
+*/
 /*
     auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); // Nikola
     auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); // Nikola
-- 
GitLab


From 06d50825a446ae217bd6679ed0c48849f42ad196 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 30 Mar 2020 13:47:17 +0200
Subject: [PATCH 044/422] Cleaning the code

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  19 +--
 .../Run3AFPMonitoring/AFPToFAlgorithm.h       |  19 +--
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 101 ++----------
 .../src/AFPSiLayerAlgorithm.cxx               | 150 +++---------------
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx |  47 ++----
 5 files changed, 52 insertions(+), 284 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index b245a2f57dd3..09ee501e0d40 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -19,25 +19,14 @@ public:
     virtual ~AFPSiLayerAlgorithm();
     virtual StatusCode initialize() override;
     virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+
 private:
-    Gaudi::Property<bool> m_doRandom {this,"RandomHist",false};
-    std::vector<int> m_abGroups1;
-    std::vector<std::vector<int>> m_abGroups2;
-    std::map<std::string,int> m_cGroups1;
-    //std::map<std::string,std::map<std::string,std::map<std::string,int>>> m_HitmapGroups;
     std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
     SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
-    
-//      m_HitmapGroups = buildToolMap<std::string,std::map<std::string,int>>
-protected:
-   std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
-   std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
-
 
-
-  static const int s_cNearStationIndex;
-  static const int s_cFarStationIndex;
-  const std::string m_histsDirectoryName;
+protected:
+    std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
+    std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
 
 };
 #endif
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
index b975fb7c7972..a9400de43779 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -11,7 +11,6 @@
 #include "xAODForward/AFPToFHitContainer.h"
 #include "xAODForward/AFPToFHit.h"
 
-
 #include "TRandom3.h"
 
 class AFPToFAlgorithm : public AthMonitorAlgorithm {
@@ -20,26 +19,14 @@ public:
     virtual ~AFPToFAlgorithm();
     virtual StatusCode initialize() override;
     virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+
 private:
-    //Gaudi::Property<bool> m_doRandom {this,"RandomHist",false};
-    //std::vector<int> m_abGroups1;
-    //std::vector<std::vector<int>> m_abGroups2;
-    //std::map<std::string,int> m_cGroups1;
-    //std::map<std::string,std::map<std::string,std::map<std::string,int>>> m_HitmapGroups;
-    //std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
-    SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
-    
-//      m_HitmapGroups = buildToolMap<std::string,std::map<std::string,int>>
+   SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
+
 protected:
    std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
    std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
 
-
-
-  //static const int s_cNearStationIndex;
-  //static const int s_cFarStationIndex;
-  //const std::string m_histsDirectoryName;
-
 };
 #endif
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index a61a73ed56bf..d4f06c74d647 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -12,106 +12,39 @@
 def Run3AFPExampleMonitoringConfig(inputFlags):
     '''Function to configures some algorithms in the monitoring system.'''
 
-    ### STEP 1 ###
-    # If you need to set up special tools, etc., you will need your own ComponentAccumulator;
-    # uncomment the following 2 lines and use the last three lines of this function instead of the ones
-    # just before
-    # from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
-    # result = ComponentAccumulator()
-
-    # The following class will make a sequence, configure algorithms, and link
-    # them to GenericMonitoringTools
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
 
-
-    ### STEP 2 ###
-    # Adding an algorithm to the helper. Here, we will use the example 
-    # algorithm in the AthenaMonitoring package. Just pass the type to the 
-    # helper. Then, the helper will instantiate an instance and set up the 
-    # base class configuration following the inputFlags. The returned object 
-    # is the algorithm.
     from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
     afpSiLayerAlgorithm = helper.addAlgorithm(AFPSiLayerAlgorithm,'AFPSiLayerAlg')
 
     from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPToFAlgorithm
     afpToFAlgorithm = helper.addAlgorithm(AFPToFAlgorithm,'AFPToFAlg')
 
-    # You can actually make multiple instances of the same algorithm and give 
-    # them different configuration
-    #anotherExampleMonAlg = helper.addAlgorithm(AFPSiLayerAlgorithm,'AnotherExampleMonAlg')
-
-    # # If for some really obscure reason you need to instantiate an algorithm
-    # # yourself, the AddAlgorithm method will still configure the base 
-    # # properties and add the algorithm to the monitoring sequence.
-    # helper.AddAlgorithm(myExistingAlg)
-
-
-    ### STEP 3 ###
-    # Edit properties of a algorithm
-    # some generic property
-    #exampleMonAlg.RandomHist = True
-    # to enable a trigger filter, for example:
-    #exampleMonAlg.TriggerChain = 'HLT_mu26_ivarmedium'
-
-    ### STEP 4 ###
-    # Add some tools. N.B. Do not use your own trigger decion tool. Use the
-    # standard one that is included with AthMonitorAlgorithm.
-
-    # # Then, add a tool that doesn't have its own configuration function. In
-    # # this example, no accumulator is returned, so no merge is necessary.
-    # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
-    # exampleMonAlg.MyDomainTool = MyDomainTool()
-
     # Add a generic monitoring tool (a "group" in old language). The returned 
     # object here is the standard GenericMonitoringTool.
-    AFPGroup = helper.addGroup( afpSiLayerAlgorithm,         'AFPSiLayerTool',         'AFP/'     ) 
-    AFPToFGroup = helper.addGroup( afpToFAlgorithm,         'AFPToFTool',         'AFP/'     )
+    AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
+    AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
-    #    station0_1 = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayer','Station0/')
-
-    # Add a GMT for the other example monitor algorithm
-    #    anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer')
-    AFPGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nsihits') 
+    AFPSiGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nsihits') 
+    
     AFPToFGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='ToF',xbins=1000,xmin=-0.5,xmax=999.5,weight='ntofhits') 
-
     AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits',  path='ToF',xbins=3,xmin=-0.5,xmax=2.5)
     AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits',  path='ToF',xbins=3,xmin=-0.5,xmax=2.5)
 
-    ### STEP 5 ###
-    # Configure histogramsIf you want to create histograms with variable bin widths, ROOT provides another constructor suited for this purpose. Instead of passing the data interval and the number of bins, you have to pass an array (single or double precision) of bin edges. When the histogram has n bins, then there are n+1 distinct edges, so the array you pass must be of size n+1.
-
-
-    # Example defining an array of histograms. This is useful if one seeks to create a
-    # number of histograms in an organized manner. (For instance, one plot for each ASIC
-    # in the subdetector, and these components are mapped in eta, phi, and layer.) Thus,
-    # one might have an array of TH1's such as quantity[etaIndex][phiIndex][layerIndex].
-    for alg in [afpSiLayerAlgorithm]:
+    
+for alg in [afpSiLayerAlgorithm]:
 
        # Using a map of groups
        layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
-       #stationList = ['FarStation','NearStation'] # TODO XXX
-       #sideList = ['Aside' , 'Cside' ]        
-       combinedList = [ 'farAside', 'nearAside' , 'nearCside' , 'farCside' ]
+       combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside' 
 
-       #array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayerTool')
-       array2D = helper.addArray([combinedList,layerList],alg,'AFPSiLayerTool', topPath = 'Hits')
-       array2D.defineHistogram(  'pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80.5, ybins=336,ymin=0.5,ymax=336.5)
-       #array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {2}', path='Keys/{0}', xmax=3. )
+       array2D = helper.addArray([combinedList,layerList], alg, 'AFPSiLayerTool', topPath = 'Hits')
+       array2D.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='AFPSiLayer', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
 
-      #array2D.defineHistogram('h_hitMap', title='hitmap for {0} Layer {1}', path='Keys/{0}', xmax=3. )
-
-    ### STEP 6 ###
     # Finalize. The return value should be a tuple of the ComponentAccumulator
-    # and the sequence containing the created algorithms. If we haven't called
-    # any configuration other than the AthMonitorCfgHelper here, then we can 
-    # just return directly (and not create "result" above)
     return helper.result()
     
-    # # Otherwise, merge with result object and return
-    # acc = helper.result()
-    # result.merge(acc)
-    # return result
 
 if __name__=='__main__':
     # Setup the Run III behavior
@@ -129,14 +62,14 @@ if __name__=='__main__':
     #file = 'data18_13TeV.00348618.physics_Main.recon.AOD.v220._lb0295._0009.1'
     file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' #ToF
     #file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1' #SiT
-#/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.deriv.DAOD_STDM7.r10258_p3399_p4030/DAOD_STDM7.20036794._000007.pool.root.1'
-#/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.recon.AOD.r10258_p3412_r11501/AOD.18508508._000007.pool.root.1'
-#/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
-   # nightly = '/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00357750/data18_13TeV.00357750.physics_Main.recon.AOD.f1041/'
-   # file = 'data18_13TeV.00357750.physics_Main.recon.AOD.f1041._lb0105._SFO-7._0103.1'
-
+    #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.deriv.DAOD_STDM7.r10258_p3399_p4030/DAOD_STDM7.20036794._000007.pool.root.1'
+    #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.recon.AOD.r10258_p3412_r11501/AOD.18508508._000007.pool.root.1'
+    #/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
+    #nightly = '/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00357750/data18_13TeV.00357750.physics_Main.recon.AOD.f1041/'
+    #file = 'data18_13TeV.00357750.physics_Main.recon.AOD.f1041._lb0105._SFO-7._0103.1'
     #nightly = '/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/'
     #file = 'data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1'
+    
     ConfigFlags.Input.Files = [nightly+file]
     ConfigFlags.Input.isMC = False
     ConfigFlags.Output.HISTFileName = 'AFPOutput.root'
@@ -152,9 +85,5 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    # If you want to turn on more detailed messages ...
-    # exampleMonitorAcc.getEventAlgo('ExampleMonAlg').OutputLevel = 2 # DEBUG
- #   cfg.printConfig(withDetails=False) # set True for exhaustive info
-
     cfg.run(100) #use cfg.run(20) to only run on first 20 events
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 6fe12d88fefb..8481a663e59d 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -8,17 +8,12 @@
 */
 
 #include "Run3AFPMonitoring/AFPSiLayerAlgorithm.h"
-//#include <xAODForward/AFPSiHit.h>
-//#include <xAODForward/AFPSiHitContainer.h>
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPStationID.h"
 
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
-//, m_histsDirectoryName ("AFP/")
-//, m_cNearStation (s_cNearStationIndex)
-//, m_cFarStation (s_cFarStationIndex)
 , m_afpHitContainerKey("AFPSiHitContainer")
 
 {
@@ -32,13 +27,12 @@ AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
 StatusCode AFPSiLayerAlgorithm::initialize() {
     using namespace Monitored;
  
-    m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool",m_stationnames,m_pixlayers);
+    m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
 
-//  std::map<std::string,std::map<std::string,int>> <std::map<std::string,int>> 
-     // We must declare to the framework in initialize what SG objects we are going to use
+    // We must declare to the framework in initialize what SG objects we are going to use:
     SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
-        ATH_CHECK(m_afpHitContainerKey.initialize());
-    // ...
+    ATH_CHECK(m_afpHitContainerKey.initialize());
+
     return AthMonitorAlgorithm::initialize();
 }
 
@@ -46,91 +40,14 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
     using namespace Monitored;
 
-    // Declare the quantities which should be monitored
-    // My histograms:
- //   auto h_hitMultiplicity = Monitored::Scalar<int>("h_hitMultiplicity", 0);
- //   auto h_timeOverThreshold = Monitored::Scalar<int>("h_timeOverThreshold", 0);
-    //auto h_hitMap = Monitored::Scalar<int>("h_hitMap", 0);
-    // End
-/*	
-    auto lumiPerBCID = Monitored::Scalar<float>("lumiPerBCID",0.0);
-    auto lb = Monitored::Scalar<int>("lb",0);
-    auto run = Monitored::Scalar<int>("run",0);
-    auto random = Monitored::Scalar<float>("random",0.0);
-    auto testweight = Monitored::Scalar<float>("testweight",1.0);
-*/
-    auto lb = Monitored::Scalar<int>("lb", 0); // Nikola
-    auto nsihits = Monitored::Scalar<int>("nsihits", 1);
+    // Declare the quantities which should be monitored:
+    auto lb = Monitored::Scalar<int>("lb", 0); 
+    auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
+    auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
+    auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
     
-
-/*    // Two variables (value and passed) needed for TEfficiency
-    auto pT = Monitored::Scalar<float>("pT",0.0);
-    auto pT_passed = Monitored::Scalar<bool>("pT_passed",false);
-*/
-    // Set the values of the monitored variables for the event
-  //  h_timeOverThreshold = lbAverageInteractionsPerCrossing(ctx);
-  //  h_hitMultiplicity = lbAverageInteractionsPerCrossing(ctx);
-    //    h_hitMap = lbAverageInteractionsPerCrossing(ctx);
-    lb = GetEventInfo(ctx)->lumiBlock();	// Nikola
-
-/*
-    lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
     lb = GetEventInfo(ctx)->lumiBlock();
-    run = GetEventInfo(ctx)->runNumber();
-    testweight = 2.0;
-        
-
-    TRandom3 r(ctx.eventID().event_number());
-    // Example of using flags
-    if (m_doRandom) {
-        random = r.Rndm();
-    }
-
-    // Fake efficiency calculator
-    pT = r.Landau(15);
-    pT_passed = pT>r.Poisson(15);
-*/
-    // Fill. First argument is the tool name, all others are the variables to be saved.
-    //fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity,lumiPerBCID,lb,random,pT,pT_passed,testweight);
-    //fill("AFPSiLayerAlgorithm",h_hitMultiplicity,lb,random,pT,pT_passed,testweight);
-    //////////fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity);
-   //fill("AFPSiLayerTool", lb);
-
-    // Alternative fill method. Get the group yourself, and pass it to the fill function.
-    //auto tool = getGroup("AFPSiLayer");
-    //fill(tool,run);
-
-    // Fill with a vector; useful in some circumstances.
-/*
-    std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> varVec = {lumiPerBCID,pT};
-    fill("AFPSiLayer",varVec);
-    fill(tool,varVec);
-*/
-/*
-    // Filling using a pre-defined array of groups.
-    auto a = Scalar<float>("a",0.0);
-    auto b = Scalar<float>("b",1.0);
-    auto c = Scalar<float>("c",2.0);
-    for ( auto iEta : {0,1} ) {
-        // 1) Valid but inefficient fill
-        fill("AFPSiLayer_"+std::to_string(iEta),a,b,c);
-        // 2) Faster way to fill a vector of histograms
-        fill(m_tools[m_abGroups1[iEta]],a,b,c);
-        for ( auto iPhi : {0,1} ) {
-            // Same efficient method for 2D array
-            fill(m_tools[m_abGroups2[iEta][iPhi]],a,b);
-        }
-    }
-
-    // Filling using a pre-defined map of groups.
-    for ( auto& layer : std::vector<std::string>({"layer1","layer2"}) ) {
-        fill(m_tools[m_cGroups1.at(layer)],c);
-        for ( auto& cluster : std::vector<std::string>({"clusterX","clusterB"}) ) {
-            // Same efficient method for 2D map
-            fill(m_tools[m_cGroups2.at(layer).at(cluster)],c);
-        }
-    }
-*/    
+ 
     SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
     if(! afpHitContainer.isValid())
     {
@@ -140,55 +57,30 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
     /**
      *
-     *	const int xAOD::AFPStationID::farA = 0;
+     *	const int xAOD::AFPStationID::farA  = 0;
      *	const int xAOD::AFPStationID::nearA = 1;
      *	const int xAOD::AFPStationID::nearC = 2;
-     *	const int xAOD::AFPStationID::farC = 3;
+     *	const int xAOD::AFPStationID::farC  = 3;
      *
      */
 
     ATH_CHECK( afpHitContainer.initialize() );
 
-    nsihits = afpHitContainer->size();
-    fill("AFPSiLayerTool", lb, nsihits);
+    nSiHits = afpHitContainer->size();
+    fill("AFPSiLayerTool", lb, nSiHits);    
 
-    auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); // Nikola
-    auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); // Nikola
-    auto h_hitMap = Monitored::Scalar<int>("h_hitMap", 0); // Nikola
     for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
     {
-      pixelRowIDChip=hitsItr->pixelRowIDChip();
+      pixelRowIDChip = hitsItr->pixelRowIDChip();
       pixelColIDChip = hitsItr->pixelColIDChip();
-      std::cout << "Hits iteration -> stationID = " << hitsItr->stationID() << std::endl;
-      std::cout << "Hits iteration -> pixelLayerID = " << hitsItr->pixelLayerID() << std::endl;
 	
-      if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 
-	&& hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
+      if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
       {
-	std::cout << "I AM RIGHT BEFORE FILL METHOD\n" << std::endl;
-        //fill(m_tools[m_HitmapGroups.at( m_stationnames.at(hitsItr->stationID())).at( m_pixlayers.at(hitsItr->pixelLayerID()))] , pixelRowIDChip , pixelColIDChip);
-        fill(m_tools[m_HitmapGroups.at( m_stationnames.at(hitsItr->stationID())).at( m_pixlayers.at(hitsItr->pixelLayerID()))] , pixelRowIDChip, pixelColIDChip);
-	}
-else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
-
-	}
-    
-/*
-    // Filling using a pre-defined map of groups.
-    for ( auto& layer : std::vector<std::string>({"layer1","layer2"}) ) {
-        fill(m_tools[m_cGroups1.at(layer)],c);
-        for ( auto& cluster : std::vector<std::string>({"clusterX","clusterB"}) ) {
-            // Same efficient method for 2D map
-            fill(m_tools[m_cGroups2.at(layer).at(cluster)],c);
-        }
-    }
-
-
-*/
-
-	//m_cNearStation.eventEnd();
-	//m_cFarStation.eventEnd();
-
+        fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
+      }
+	else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
+      }
+ 
     return StatusCode::SUCCESS;
 }
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index dd3fffa51d83..d77a6a65a582 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -27,13 +27,10 @@ AFPToFAlgorithm::~AFPToFAlgorithm() {}
 StatusCode AFPToFAlgorithm::initialize() {
     using namespace Monitored;
  
-    //m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPToFTool",m_stationnames,m_pixlayers);
-
-    // std::map<std::string,std::map<std::string,int>> <std::map<std::string,int>> 
     // We must declare to the framework in initialize what SG objects we are going to use
     SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
-        ATH_CHECK(m_afpToFHitContainerKey.initialize());
-    // ...
+    ATH_CHECK(m_afpToFHitContainerKey.initialize());
+    
     return AthMonitorAlgorithm::initialize();
 }
 
@@ -42,16 +39,10 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     using namespace Monitored;
 
     // Declare the quantities which should be monitored
-    // My histograms:
-    // auto h_hitMultiplicity = Monitored::Scalar<int>("h_hitMultiplicity", 0);
-    // auto h_timeOverThreshold = Monitored::Scalar<int>("h_timeOverThreshold", 0);
-    // auto h_hitMap = Monitored::Scalar<int>("h_hitMap", 0);
-    // End
-
-    auto lb = Monitored::Scalar<int>("lb", 0); // Nikola
-    auto ntofhits = Monitored::Scalar<int>("ntofhits", 1);
+    auto lb = Monitored::Scalar<int>("lb", 0);
+    auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
     
-    lb = GetEventInfo(ctx)->lumiBlock();	// Nikola
+    lb = GetEventInfo(ctx)->lumiBlock()
 
  
     SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
@@ -72,9 +63,10 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 
     ATH_CHECK( afpToFHitContainer.initialize() );
 
-    ntofhits = afpToFHitContainer->size();
-    fill("AFPToFTool", lb, ntofhits);
-/*									TO BE researched: difference between trainID and barInTrainID
+    nTofHits = afpToFHitContainer->size();
+    fill("AFPToFTool", lb, nTofHits);
+
+/*	TO BE researched: difference between trainID and barInTrainID
     auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
     auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0); 
 
@@ -90,28 +82,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	}
     }
 */
-/*
-    auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); // Nikola
-    auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); // Nikola
-    auto h_hitMap = Monitored::Scalar<int>("h_hitMap", 0); // Nikola
 
-    for(const xAOD::AFPSiHit *hitsItr: *afpToFContainer)
-    {
-       pixelRowIDChip=hitsItr->pixelRowIDChip();
-       pixelColIDChip = hitsItr->pixelColIDChip();
-       std::cout << "Hits iteration -> stationID = " << hitsItr->stationID() << std::endl;
-       std::cout << "Hits iteration -> pixelLayerID = " << hitsItr->pixelLayerID() << std::endl;
-	
-       if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
-       {
-          std::cout << "I AM RIGHT BEFORE FILL METHOD\n" << std::endl;
-          fill(m_tools[m_HitmapGroups.at( m_stationnames.at(hitsItr->stationID())).at( m_pixlayers.at(hitsItr->pixelLayerID()))] , pixelRowIDChip, pixelColIDChip);
-       }
-       else 
-	ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
-
-     }
-*/
 
     return StatusCode::SUCCESS;
 }
-- 
GitLab


From fd0cee4184484b5bc4edbc9fae7cba98c00458c7 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 1 Apr 2020 00:26:00 +0200
Subject: [PATCH 045/422] Fixing syntax errors

---
 ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt         | 2 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py                  | 4 ++--
 .../AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx             | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index 893eb37d8671..1d99ae5b68e4 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -14,7 +14,7 @@ atlas_depends_on_subdirs(
         GaudiKernel
 	Event/xAOD/xAODForward
 	xAODForward/AFPSiHit
-	xAODForward/AFPToFHit	#Nikola
+	xAODForward/AFPToFHit	
         LumiBlock/LumiBlockComps
         LumiBlock/LumiBlockData
         Trigger/TrigEvent/TrigDecisionInterface
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index d4f06c74d647..aba52dc2e7cd 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -33,11 +33,11 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits',  path='ToF',xbins=3,xmin=-0.5,xmax=2.5)
 
     
-for alg in [afpSiLayerAlgorithm]:
+    for alg in [afpSiLayerAlgorithm]:
 
        # Using a map of groups
        layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
-       combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside' 
+       combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
 
        array2D = helper.addArray([combinedList,layerList], alg, 'AFPSiLayerTool', topPath = 'Hits')
        array2D.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='AFPSiLayer', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index d77a6a65a582..ffe4accdd777 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -42,7 +42,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     auto lb = Monitored::Scalar<int>("lb", 0);
     auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
     
-    lb = GetEventInfo(ctx)->lumiBlock()
+    lb = GetEventInfo(ctx)->lumiBlock();
 
  
     SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
-- 
GitLab


From 01f50b036856e3376eaa233041f5375b31a440c8 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 1 Apr 2020 23:50:42 +0200
Subject: [PATCH 046/422] Corecting wrong variable name

---
 .../python/Run3AFPExampleMonitorAlgorithm.py              | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index aba52dc2e7cd..245468c6f994 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -26,9 +26,9 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
     AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
-    AFPSiGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nsihits') 
+    AFPSiGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nSiHits') 
     
-    AFPToFGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='ToF',xbins=1000,xmin=-0.5,xmax=999.5,weight='ntofhits') 
+    AFPToFGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='ToF',xbins=1000,xmin=-0.5,xmax=999.5,weight='nTofHits') 
     AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits',  path='ToF',xbins=3,xmin=-0.5,xmax=2.5)
     AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits',  path='ToF',xbins=3,xmin=-0.5,xmax=2.5)
 
@@ -60,8 +60,8 @@ if __name__=='__main__':
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     nightly = ''#/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00348618/data18_13TeV.00348618.physics_Main.recon.AOD.v220/'
     #file = 'data18_13TeV.00348618.physics_Main.recon.AOD.v220._lb0295._0009.1'
-    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' #ToF
-    #file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1' #SiT
+    #file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' #ToF
+    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1' #SiT
     #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.deriv.DAOD_STDM7.r10258_p3399_p4030/DAOD_STDM7.20036794._000007.pool.root.1'
     #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.recon.AOD.r10258_p3412_r11501/AOD.18508508._000007.pool.root.1'
     #/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
-- 
GitLab


From 34938b54b312ab79a4ff33e42a500b3be6146020 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Thu, 2 Apr 2020 15:20:49 +0200
Subject: [PATCH 047/422] Adding class for cluster and track reconstruction

---
 .../Run3AFPMonitoring/AfpFastReco.h           | 131 ++++++++++++++++++
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  19 +--
 .../src/AFPSiLayerAlgorithm.cxx               |  13 ++
 .../AFP/Run3AFPMonitoring/src/AfpFastReco.cxx | 125 +++++++++++++++++
 4 files changed, 280 insertions(+), 8 deletions(-)
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AfpFastReco.h
 create mode 100644 ForwardDetectors/AFP/Run3AFPMonitoring/src/AfpFastReco.cxx

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AfpFastReco.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AfpFastReco.h
new file mode 100644
index 000000000000..9d37c2c77b69
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AfpFastReco.h
@@ -0,0 +1,131 @@
+#ifndef AFP_MONITORING_AFPFASTRECO_H
+#define AFP_MONITORING_AFPFASTRECO_H
+
+#include <array>
+#include <list>
+#include <utility>
+#include <vector>
+
+#include "xAODForward/AFPSiHit.h"
+#include "xAODForward/AFPSiHitContainer.h"
+
+namespace AfpMon {
+
+  struct AfpCluster {
+    AfpCluster(float x_, float y_, float z_, int s, int l)
+        : x {x_}, y {y_}, z {z_}, station {s}, layer {l} {}
+
+    float x;
+    float y;
+    float z;
+    int station;
+    int layer;
+  };
+
+  inline bool operator==(const AfpCluster& lhs, const AfpCluster& rhs) {
+    if (lhs.x != rhs.x) return false;
+    if (lhs.y != rhs.y) return false;
+    if (lhs.z != rhs.z) return false;
+    if (lhs.station != rhs.station) return false;
+    if (lhs.layer != rhs.layer) return false;
+
+    return true;
+  }
+
+  struct AfpTrack {
+    AfpTrack(float x_, float y_, int s, std::array<int, 4> a)
+        : x {x_}, y {y_}, station {s}, layerClusters {std::move(a)} {}
+
+    float x;
+    float y;
+    int station;
+    std::array<int, 4> layerClusters;
+  };
+
+  class AfpFastReco {
+  public:
+    /// Constructor. Sets input hit container
+    AfpFastReco(const xAOD::AFPSiHitContainer* hits) : m_hitContainer {hits} {}
+
+    /// Performs fast reconstruction of clusters and tracks
+    void reco();
+
+    /// Returns vector of clusters
+    std::vector<AfpCluster> clusters() const { return m_clusters; }
+
+    /// Returns vector of tracks
+    std::vector<AfpTrack> tracks() const { return m_tracks; }
+
+  private:
+    /// Performs fast cluster reconstruction
+    void recoClusters();
+
+    /// Performs fast track reconstruction
+    void recoTracks();
+
+    /// Returns parameters of fitted line
+    std::pair<double, double> linReg(std::vector<std::pair<double, double>> YX) const;
+
+    /// Finds hits/clusters around given init element
+    template <class T>
+    std::vector<T> findAround(T init, std::list<T>& toJoin) const;
+
+    /// Checks if given hits are neighbours
+    bool areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const;
+
+    /// Checks if given clusters are neighbours
+    bool areNeighbours(const AfpCluster& lhs, const AfpCluster& rhs) const;
+
+    /// Pointer to hit container
+    const xAOD::AFPSiHitContainer* m_hitContainer;
+
+    /// Vector of clusters
+    std::vector<AfpCluster> m_clusters;
+
+    /// Vector of tracks
+    std::vector<AfpTrack> m_tracks;
+
+    /// Number of Afp stations
+    static constexpr int s_afpStations = 4;
+
+    /// Number of layers in each station
+    static constexpr int s_afpLayers = 4;
+
+    /// Minimum number of clusters in track
+    static constexpr int s_trackSize = 3;
+
+    /// Maximum distance between cluster
+    static constexpr float s_clusterDistance = 0.4;
+  };
+
+  template <class T>
+  std::vector<T> AfpFastReco::findAround(T init, std::list<T>& toJoin) const {
+    std::vector<T> element;
+    element.push_back(init);
+
+    std::vector<T> newNeighbours;
+    do {
+      newNeighbours.clear();
+      for (auto& b : toJoin) {
+        bool isNew = false;
+        for (auto& a : element)
+          if (areNeighbours(a, b)) isNew = true;
+
+        if (isNew) {
+          newNeighbours.push_back(b);
+          element.push_back(b);
+        }
+      }
+
+      for (auto& t : newNeighbours)
+        toJoin.remove(t);
+
+    } while (newNeighbours.size() > 0);
+
+    return element;
+  }
+
+}  // namespace AfpMon
+
+#endif /* AFP_MONITORING_AFPFASTRECO_H */
+
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 245468c6f994..9f946f9c325a 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -35,12 +35,12 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     
     for alg in [afpSiLayerAlgorithm]:
 
-       # Using a map of groups
-       layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
-       combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
+        # Using a map of groups
+        layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
+        combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
 
-       array2D = helper.addArray([combinedList,layerList], alg, 'AFPSiLayerTool', topPath = 'Hits')
-       array2D.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='AFPSiLayer', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+        array2D = helper.addArray([combinedList,layerList], alg, 'AFPSiLayerTool', topPath = 'Hits')
+        array2D.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='AFPSiLayer', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
 
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
@@ -60,8 +60,8 @@ if __name__=='__main__':
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     nightly = ''#/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00348618/data18_13TeV.00348618.physics_Main.recon.AOD.v220/'
     #file = 'data18_13TeV.00348618.physics_Main.recon.AOD.v220._lb0295._0009.1'
-    #file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' #ToF
-    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1' #SiT
+    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' #ToF
+    #file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1' #SiT
     #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.deriv.DAOD_STDM7.r10258_p3399_p4030/DAOD_STDM7.20036794._000007.pool.root.1'
     #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.recon.AOD.r10258_p3412_r11501/AOD.18508508._000007.pool.root.1'
     #/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
@@ -69,6 +69,8 @@ if __name__=='__main__':
     #file = 'data18_13TeV.00357750.physics_Main.recon.AOD.f1041._lb0105._SFO-7._0103.1'
     #nightly = '/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/'
     #file = 'data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1'
+
+    #file = '/eos/user/k/kciesla/data17_336505/RAW/data17_13TeV.00336505.physics_MinBias.merge.AOD.f935_m1992._lb0433._0004.1'
     
     ConfigFlags.Input.Files = [nightly+file]
     ConfigFlags.Input.isMC = False
@@ -85,5 +87,6 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    cfg.run(100) #use cfg.run(20) to only run on first 20 events
+    cfg.run(1000) #use cfg.run(20) to only run on first 20 events
+
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 8481a663e59d..12edfcdcb2ff 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -11,6 +11,8 @@
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPStationID.h"
 
+#include <Run3AFPMonitoring/AfpFastReco.h>
+
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
@@ -81,6 +83,17 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
       }
  
+    AfpMon::AfpFastReco fast(afpHitContainer.get());
+    fast.reco();
+
+    for (const auto& cluster : fast.clusters()) {
+      ATH_MSG_INFO("c: " << cluster.x << " " << cluster.y);
+    }
+
+    for (const auto& track : fast.tracks()) {
+      ATH_MSG_INFO("t: " << track.x << " " << track.y);
+    }
+
     return StatusCode::SUCCESS;
 }
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AfpFastReco.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AfpFastReco.cxx
new file mode 100644
index 000000000000..41d2dc26c946
--- /dev/null
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AfpFastReco.cxx
@@ -0,0 +1,125 @@
+#include <Run3AFPMonitoring/AfpFastReco.h>
+
+namespace AfpMon {
+
+  void AfpFastReco::reco() {
+    recoClusters();
+    recoTracks();
+  }
+
+  void AfpFastReco::recoClusters() {
+    constexpr float dx   = 0.25;  // [mm]
+    constexpr float dy   = 0.05;  // [mm]
+    constexpr float dz   = 9.00;  // [mm]
+    constexpr float tilt = 14. / 180. * 3.14159;
+
+    std::list toCluster(m_hitContainer->begin(), m_hitContainer->end());
+
+    while (toCluster.size() > 0) {
+      auto init = *(toCluster.begin());
+      toCluster.pop_front();
+      auto clusteredHits = findAround(init, toCluster);
+
+      float sumX      = 0;
+      float sumY      = 0;
+      float sumCharge = 0;
+      for (const xAOD::AFPSiHit* h : clusteredHits) {
+        const float charge = h->depositedCharge();
+        const float pixX   = dx * h->pixelColIDChip();
+        const float pixY   = dy * h->pixelRowIDChip();
+        sumX += charge * pixX;
+        sumY += charge * pixY;
+        sumCharge += charge;
+      }
+
+      const float xPlane = sumX / sumCharge;
+      const float yPlane = sumY / sumCharge;
+
+      const int stationID = init->stationID();
+      const int layerID   = init->pixelLayerID();
+
+      const float x = xPlane;
+      const float y = yPlane * cos(tilt);
+      const float z = yPlane * sin(tilt) * dz * layerID;
+
+      m_clusters.emplace_back(x, y, z, stationID, layerID);
+    }
+  }
+
+  void AfpFastReco::recoTracks() {
+    std::list toTrack(m_clusters.begin(), m_clusters.end());
+
+    while (toTrack.size() > 0) {
+      auto init = *(toTrack.begin());
+      toTrack.pop_front();
+      auto trackCandidate = findAround(init, toTrack);
+
+      if (trackCandidate.size() < s_trackSize) continue;
+
+      std::array<int, 4> clusters {};
+
+      std::vector<std::pair<double, double>> XZ;
+      std::vector<std::pair<double, double>> YZ;
+
+      for (const auto& cluster : trackCandidate) {
+        clusters[cluster.layer]++;
+
+        XZ.emplace_back(cluster.x, cluster.z);
+        YZ.emplace_back(cluster.y, cluster.z);
+      }
+
+      const auto [x, xSlope] = linReg(XZ);
+      const auto [y, ySlope] = linReg(YZ);
+      const int station      = trackCandidate[0].station;
+
+      m_tracks.emplace_back(x, y, station, clusters);
+    }
+  }
+
+  std::pair<double, double> AfpFastReco::linReg(std::vector<std::pair<double, double>> YX) const {
+    double meanx = 0;
+    double meany = 0;
+    for (const auto& yx : YX) {
+      meany += yx.first;
+      meanx += yx.second;
+    }
+
+    meanx /= YX.size();
+    meany /= YX.size();
+
+    double numerator   = 0;
+    double denumerator = 0;
+    for (const auto& yx : YX) {
+      const double dy = yx.first - meany;
+      const double dx = yx.second - meanx;
+      numerator += dx * dy;
+      denumerator += dx * dx;
+    }
+
+    const double slope    = numerator / denumerator;
+    const double position = meany - slope * meanx;
+
+    return {position, slope};
+  }
+
+  bool AfpFastReco::areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const {
+    if (lhs->stationID() != rhs->stationID()) return false;
+    if (lhs->pixelLayerID() != rhs->pixelLayerID()) return false;
+    if (lhs->pixelColIDChip() != rhs->pixelColIDChip()) return false;
+    if (abs(lhs->pixelRowIDChip() - rhs->pixelRowIDChip()) != 1) return false;
+
+    return true;
+  }
+
+  bool AfpFastReco::areNeighbours(const AfpCluster& lhs, const AfpCluster& rhs) const {
+    if (lhs.station != rhs.station) return false;
+
+    const float dx = lhs.x - rhs.x;
+    const float dy = lhs.y - rhs.y;
+    if (dx * dx + dy * dy > s_clusterDistance) return false;
+
+    return true;
+  }
+
+}  // namespace AfpMon
+
-- 
GitLab


From 47cc879fb6f0dbb1675aeddde395276304cc0754 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Thu, 2 Apr 2020 20:24:19 +0200
Subject: [PATCH 048/422] 1D histograms, correction

---
 .../python/Run3AFPExampleMonitorAlgorithm.py   | 18 ++++++++++++------
 .../src/AFPSiLayerAlgorithm.cxx                |  7 ++++++-
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 9f946f9c325a..a40d2680cce2 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -1,4 +1,4 @@
-#
+# 
 #  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 #
 
@@ -26,7 +26,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
     AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
-    AFPSiGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nSiHits') 
+    AFPSiGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='SiT',xbins=1000,xmin=-0.5,xmax=999.5,weight='nSiHits') 
     
     AFPToFGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='ToF',xbins=1000,xmin=-0.5,xmax=999.5,weight='nTofHits') 
     AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits',  path='ToF',xbins=3,xmin=-0.5,xmax=2.5)
@@ -38,9 +38,15 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
         # Using a map of groups
         layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
         combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
+	
+	#array1D = helper.addArray([combinedList,layerList], alg, 'AFPSiLayerTool', topPath = '1D Hits')
+	#array1D.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1}', path='pixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
+	#array1D.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='pixelRowIDChip', xbins=80, xmin=0.5, xmax=80.5)	
 
-        array2D = helper.addArray([combinedList,layerList], alg, 'AFPSiLayerTool', topPath = 'Hits')
-        array2D.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='AFPSiLayer', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+        array = helper.addArray([combinedList,layerList], alg, 'AFPSiLayerTool', topPath = 'Hits')
+	array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1}', path='pixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
+	array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='pixelRowIDChip', xbins=80, xmin=0.5, xmax=80.5)
+        array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='AFPSiLayer', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
 
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
@@ -60,8 +66,8 @@ if __name__=='__main__':
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     nightly = ''#/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00348618/data18_13TeV.00348618.physics_Main.recon.AOD.v220/'
     #file = 'data18_13TeV.00348618.physics_Main.recon.AOD.v220._lb0295._0009.1'
-    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' #ToF
-    #file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1' #SiT
+    #file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' #ToF
+    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1' #SiT
     #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.deriv.DAOD_STDM7.r10258_p3399_p4030/DAOD_STDM7.20036794._000007.pool.root.1'
     #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.recon.AOD.r10258_p3412_r11501/AOD.18508508._000007.pool.root.1'
     #/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 12edfcdcb2ff..258592813070 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -1,4 +1,4 @@
-/*
+/* 
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 *
 *
@@ -79,6 +79,10 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
       if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
       {
         fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
+
+	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
+
+	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
       }
 	else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
       }
@@ -97,3 +101,4 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     return StatusCode::SUCCESS;
 }
 
+
-- 
GitLab


From 15e149f6ad6bb7141db2a67fe9ea64ed837636b5 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 3 Apr 2020 23:19:25 +0200
Subject: [PATCH 049/422] Added timeOverThreshold 1D histograms

---
 .../python/Run3AFPExampleMonitorAlgorithm.py                | 5 +++--
 .../AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx       | 6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index a40d2680cce2..3454c4b25520 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -44,9 +44,10 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 	#array1D.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='pixelRowIDChip', xbins=80, xmin=0.5, xmax=80.5)	
 
         array = helper.addArray([combinedList,layerList], alg, 'AFPSiLayerTool', topPath = 'Hits')
-	array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1}', path='pixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-	array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='pixelRowIDChip', xbins=80, xmin=0.5, xmax=80.5)
+	array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1}', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
+	array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='PixelRowIDChip', xbins=80, xmin=0.5, xmax=80.5)
         array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='AFPSiLayer', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+	array.defineHistogram('timeOverThreshold', title='1D Time over threshold for {0} Layer {1}', path='TimeOverThreshold', xbins=16, xmin=-0.5, xmax=15.5)
 
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 258592813070..884bf30e01c9 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -47,6 +47,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
     auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
     auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
+    auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold", 0.0);
     
     lb = GetEventInfo(ctx)->lumiBlock();
  
@@ -75,14 +76,15 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     {
       pixelRowIDChip = hitsItr->pixelRowIDChip();
       pixelColIDChip = hitsItr->pixelColIDChip();
+      timeOverThreshold = hitsItr->timeOverThreshold();
 	
       if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
       {
         fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
-
 	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
-
 	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
+	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
+	
       }
 	else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
       }
-- 
GitLab


From 667f55a7163612fa2040dc92d547661a9dcd02f2 Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Sun, 5 Apr 2020 21:17:16 +0200
Subject: [PATCH 050/422] fixed folders and change lb histos into TProfiles

---
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 36 ++++++++-----------
 1 file changed, 15 insertions(+), 21 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 3454c4b25520..6c0954433975 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -26,28 +26,22 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
     AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
-    AFPSiGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='SiT',xbins=1000,xmin=-0.5,xmax=999.5,weight='nSiHits') 
-    
-    AFPToFGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits',  path='ToF',xbins=1000,xmin=-0.5,xmax=999.5,weight='nTofHits') 
-    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits',  path='ToF',xbins=3,xmin=-0.5,xmax=2.5)
-    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits',  path='ToF',xbins=3,xmin=-0.5,xmax=2.5)
+    AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/',xbins=1000,xmin=-0.5,xmax=999.5 ) 
+    AFPToFGroup.defineHistogram('lb,nTofHits', title='Luminosity Block;lb;total number of Hits', type='TProfile',  path='ToF/',xbins=1000,xmin=-0.5,xmax=999.5) 
 
-    
-    for alg in [afpSiLayerAlgorithm]:
-
-        # Using a map of groups
-        layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
-        combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
-	
-	#array1D = helper.addArray([combinedList,layerList], alg, 'AFPSiLayerTool', topPath = '1D Hits')
-	#array1D.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1}', path='pixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-	#array1D.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='pixelRowIDChip', xbins=80, xmin=0.5, xmax=80.5)	
-
-        array = helper.addArray([combinedList,layerList], alg, 'AFPSiLayerTool', topPath = 'Hits')
-	array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1}', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-	array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='PixelRowIDChip', xbins=80, xmin=0.5, xmax=80.5)
-        array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='AFPSiLayer', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-	array.defineHistogram('timeOverThreshold', title='1D Time over threshold for {0} Layer {1}', path='TimeOverThreshold', xbins=16, xmin=-0.5, xmax=15.5)
+    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits',  path='ToF/',xbins=3,xmin=-0.5,xmax=2.5)
+    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits',  path='ToF/',xbins=3,xmin=-0.5,xmax=2.5)
+
+
+    # Using a map of groups
+    layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
+    combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
+
+    array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
+    array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1}', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
+    array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='PixelRowIDChip', xbins=80, xmin=0.5, xmax=80.5)
+    array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    array.defineHistogram('timeOverThreshold', title='1D Time over threshold for {0} Layer {1}', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
 
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
-- 
GitLab


From 990d581febcbba45b23e7c01f2ec73095153b4ec Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Sun, 5 Apr 2020 21:59:14 +0200
Subject: [PATCH 051/422] adapted naming and changed/added copyright

---
 .../{AfpFastReco.h => AFPFastReco.h}          | 32 +++++++++----------
 .../src/{AfpFastReco.cxx => AFPFastReco.cxx}  | 27 ++++++++++------
 .../src/AFPSiLayerAlgorithm.cxx               |  6 ++--
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx |  2 +-
 4 files changed, 38 insertions(+), 29 deletions(-)
 rename ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/{AfpFastReco.h => AFPFastReco.h} (78%)
 rename ForwardDetectors/AFP/Run3AFPMonitoring/src/{AfpFastReco.cxx => AFPFastReco.cxx} (85%)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AfpFastReco.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
similarity index 78%
rename from ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AfpFastReco.h
rename to ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
index 9d37c2c77b69..38080060f69b 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AfpFastReco.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
@@ -9,10 +9,10 @@
 #include "xAODForward/AFPSiHit.h"
 #include "xAODForward/AFPSiHitContainer.h"
 
-namespace AfpMon {
+namespace AFPMon {
 
-  struct AfpCluster {
-    AfpCluster(float x_, float y_, float z_, int s, int l)
+  struct AFPCluster {
+    AFPCluster(float x_, float y_, float z_, int s, int l)
         : x {x_}, y {y_}, z {z_}, station {s}, layer {l} {}
 
     float x;
@@ -22,7 +22,7 @@ namespace AfpMon {
     int layer;
   };
 
-  inline bool operator==(const AfpCluster& lhs, const AfpCluster& rhs) {
+  inline bool operator==(const AFPCluster& lhs, const AFPCluster& rhs) {
     if (lhs.x != rhs.x) return false;
     if (lhs.y != rhs.y) return false;
     if (lhs.z != rhs.z) return false;
@@ -32,8 +32,8 @@ namespace AfpMon {
     return true;
   }
 
-  struct AfpTrack {
-    AfpTrack(float x_, float y_, int s, std::array<int, 4> a)
+  struct AFPTrack {
+    AFPTrack(float x_, float y_, int s, std::array<int, 4> a)
         : x {x_}, y {y_}, station {s}, layerClusters {std::move(a)} {}
 
     float x;
@@ -42,19 +42,19 @@ namespace AfpMon {
     std::array<int, 4> layerClusters;
   };
 
-  class AfpFastReco {
+  class AFPFastReco {
   public:
     /// Constructor. Sets input hit container
-    AfpFastReco(const xAOD::AFPSiHitContainer* hits) : m_hitContainer {hits} {}
+    AFPFastReco(const xAOD::AFPSiHitContainer* hits) : m_hitContainer {hits} {}
 
     /// Performs fast reconstruction of clusters and tracks
     void reco();
 
     /// Returns vector of clusters
-    std::vector<AfpCluster> clusters() const { return m_clusters; }
+    std::vector<AFPCluster> clusters() const { return m_clusters; }
 
     /// Returns vector of tracks
-    std::vector<AfpTrack> tracks() const { return m_tracks; }
+    std::vector<AFPTrack> tracks() const { return m_tracks; }
 
   private:
     /// Performs fast cluster reconstruction
@@ -74,18 +74,18 @@ namespace AfpMon {
     bool areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const;
 
     /// Checks if given clusters are neighbours
-    bool areNeighbours(const AfpCluster& lhs, const AfpCluster& rhs) const;
+    bool areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const;
 
     /// Pointer to hit container
     const xAOD::AFPSiHitContainer* m_hitContainer;
 
     /// Vector of clusters
-    std::vector<AfpCluster> m_clusters;
+    std::vector<AFPCluster> m_clusters;
 
     /// Vector of tracks
-    std::vector<AfpTrack> m_tracks;
+    std::vector<AFPTrack> m_tracks;
 
-    /// Number of Afp stations
+    /// Number of AFP stations
     static constexpr int s_afpStations = 4;
 
     /// Number of layers in each station
@@ -99,7 +99,7 @@ namespace AfpMon {
   };
 
   template <class T>
-  std::vector<T> AfpFastReco::findAround(T init, std::list<T>& toJoin) const {
+  std::vector<T> AFPFastReco::findAround(T init, std::list<T>& toJoin) const {
     std::vector<T> element;
     element.push_back(init);
 
@@ -125,7 +125,7 @@ namespace AfpMon {
     return element;
   }
 
-}  // namespace AfpMon
+}  // namespace AFPMon
 
 #endif /* AFP_MONITORING_AFPFASTRECO_H */
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AfpFastReco.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
similarity index 85%
rename from ForwardDetectors/AFP/Run3AFPMonitoring/src/AfpFastReco.cxx
rename to ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
index 41d2dc26c946..83ba56c43358 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AfpFastReco.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
@@ -1,13 +1,22 @@
-#include <Run3AFPMonitoring/AfpFastReco.h>
+/*
+ *   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+ *   *
+ *   *
+ *   *       AFPFastReco.cxx
+ *   *
+ *   *
+ *   */
 
-namespace AfpMon {
+#include <Run3AFPMonitoring/AFPFastReco.h>
 
-  void AfpFastReco::reco() {
+namespace AFPMon {
+
+  void AFPFastReco::reco() {
     recoClusters();
     recoTracks();
   }
 
-  void AfpFastReco::recoClusters() {
+  void AFPFastReco::recoClusters() {
     constexpr float dx   = 0.25;  // [mm]
     constexpr float dy   = 0.05;  // [mm]
     constexpr float dz   = 9.00;  // [mm]
@@ -46,7 +55,7 @@ namespace AfpMon {
     }
   }
 
-  void AfpFastReco::recoTracks() {
+  void AFPFastReco::recoTracks() {
     std::list toTrack(m_clusters.begin(), m_clusters.end());
 
     while (toTrack.size() > 0) {
@@ -76,7 +85,7 @@ namespace AfpMon {
     }
   }
 
-  std::pair<double, double> AfpFastReco::linReg(std::vector<std::pair<double, double>> YX) const {
+  std::pair<double, double> AFPFastReco::linReg(std::vector<std::pair<double, double>> YX) const {
     double meanx = 0;
     double meany = 0;
     for (const auto& yx : YX) {
@@ -102,7 +111,7 @@ namespace AfpMon {
     return {position, slope};
   }
 
-  bool AfpFastReco::areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const {
+  bool AFPFastReco::areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const {
     if (lhs->stationID() != rhs->stationID()) return false;
     if (lhs->pixelLayerID() != rhs->pixelLayerID()) return false;
     if (lhs->pixelColIDChip() != rhs->pixelColIDChip()) return false;
@@ -111,7 +120,7 @@ namespace AfpMon {
     return true;
   }
 
-  bool AfpFastReco::areNeighbours(const AfpCluster& lhs, const AfpCluster& rhs) const {
+  bool AFPFastReco::areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const {
     if (lhs.station != rhs.station) return false;
 
     const float dx = lhs.x - rhs.x;
@@ -121,5 +130,5 @@ namespace AfpMon {
     return true;
   }
 
-}  // namespace AfpMon
+}  // namespace AFPMon
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 884bf30e01c9..eb48b4bd5403 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -1,5 +1,5 @@
 /* 
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 *
 *
 *	AFPSiLayerAlgorithm
@@ -11,7 +11,7 @@
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPStationID.h"
 
-#include <Run3AFPMonitoring/AfpFastReco.h>
+#include <Run3AFPMonitoring/AFPFastReco.h>
 
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
@@ -89,7 +89,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
       }
  
-    AfpMon::AfpFastReco fast(afpHitContainer.get());
+    AFPMon::AFPFastReco fast(afpHitContainer.get());
     fast.reco();
 
     for (const auto& cluster : fast.clusters()) {
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index ffe4accdd777..5d912b00bad9 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 *
 *
 *	AFPToFAlgorithm
-- 
GitLab


From 0d677af00f3d3bf235330faf98c8b269e64ba140 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 8 Apr 2020 12:10:32 +0200
Subject: [PATCH 052/422] Removing comments

---
 .../python/Run3AFPExampleMonitorAlgorithm.py    | 17 +++--------------
 .../src/AFPSiLayerAlgorithm.cxx                 |  9 ---------
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx   |  9 ---------
 3 files changed, 3 insertions(+), 32 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 6c0954433975..700a7575f04a 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -39,7 +39,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
     array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1}', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-    array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='PixelRowIDChip', xbins=80, xmin=0.5, xmax=80.5)
+    array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
     array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
     array.defineHistogram('timeOverThreshold', title='1D Time over threshold for {0} Layer {1}', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
 
@@ -59,19 +59,8 @@ if __name__=='__main__':
 
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    nightly = ''#/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00348618/data18_13TeV.00348618.physics_Main.recon.AOD.v220/'
-    #file = 'data18_13TeV.00348618.physics_Main.recon.AOD.v220._lb0295._0009.1'
-    #file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' #ToF
-    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1' #SiT
-    #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.deriv.DAOD_STDM7.r10258_p3399_p4030/DAOD_STDM7.20036794._000007.pool.root.1'
-    #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.recon.AOD.r10258_p3412_r11501/AOD.18508508._000007.pool.root.1'
-    #/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
-    #nightly = '/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00357750/data18_13TeV.00357750.physics_Main.recon.AOD.f1041/'
-    #file = 'data18_13TeV.00357750.physics_Main.recon.AOD.f1041._lb0105._SFO-7._0103.1'
-    #nightly = '/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/'
-    #file = 'data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1'
-
-    #file = '/eos/user/k/kciesla/data17_336505/RAW/data17_13TeV.00336505.physics_MinBias.merge.AOD.f935_m1992._lb0433._0004.1'
+    nightly = ''
+    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1'
     
     ConfigFlags.Input.Files = [nightly+file]
     ConfigFlags.Input.isMC = False
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index eb48b4bd5403..9f116b2eae45 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -58,15 +58,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	return StatusCode::FAILURE;
     }
 
-    /**
-     *
-     *	const int xAOD::AFPStationID::farA  = 0;
-     *	const int xAOD::AFPStationID::nearA = 1;
-     *	const int xAOD::AFPStationID::nearC = 2;
-     *	const int xAOD::AFPStationID::farC  = 3;
-     *
-     */
-
     ATH_CHECK( afpHitContainer.initialize() );
 
     nSiHits = afpHitContainer->size();
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index 5d912b00bad9..d156db4b300c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -52,15 +52,6 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	return StatusCode::FAILURE;
     }
 
-    /******************************************
-     *
-     *	const int xAOD::AFPStationID::farA = 0;
-     *	const int xAOD::AFPStationID::nearA = 1;
-     *	const int xAOD::AFPStationID::nearC = 2;
-     *	const int xAOD::AFPStationID::farC = 3;
-     *
-     ******************************************/
-
     ATH_CHECK( afpToFHitContainer.initialize() );
 
     nTofHits = afpToFHitContainer->size();
-- 
GitLab


From 236cd0a78d948085921db65aadd830569d67d1b0 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 15 Apr 2020 00:17:18 +0200
Subject: [PATCH 053/422] Git test after branch

---
 .../Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 09ee501e0d40..0ba01b4a325b 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -31,3 +31,4 @@ protected:
 };
 #endif
 
+// test
-- 
GitLab


From 11164e45d2940098bbae5755286ab6c33c9176ce Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Tue, 21 Apr 2020 11:56:45 +0200
Subject: [PATCH 054/422] Adding ToF histograms

---
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  3 +++
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx | 26 ++++++++++++-------
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 700a7575f04a..b47f95bab260 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -43,6 +43,9 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
     array.defineHistogram('timeOverThreshold', title='1D Time over threshold for {0} Layer {1}', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
 
+    #array.defineHistogram('pixelColIDChip,pixelColIDChip', title='Correlation Row {0} Row {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    #array.defineHistogram('pixelRowIDChip,pixelRowIDChip', title='Correlation Col {0} Col {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
     
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index d156db4b300c..b6f3a0c09e28 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -57,24 +57,30 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     nTofHits = afpToFHitContainer->size();
     fill("AFPToFTool", lb, nTofHits);
 
-/*	TO BE researched: difference between trainID and barInTrainID
+//	TO BE researched: difference between trainID and barInTrainID
     auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
-    auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0); 
+    auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
+    auto trainID = Monitored::Scalar<int>("trainID", 0); 
+    auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
 
-    for(const xAOD::AFPTofHit *hitsIts: *afpToFHitContainer)
+    for(const xAOD::AFPTofHit *hitsItr: *afpToFHitContainer)
     {
-	if(hitsIts->isSideA())
+	trainID = hitsItr->trainID();
+        barInTrainID = hitsItr->barInTrainID();
+
+	if(hitsItr->isSideA())
 	{
-	    fill("AFPToFTool", numberOfHit_S0);
+	    numberOfHit_S0 = hitsItr->trainID();
+            fill("AFPToFTool", numberOfHit_S0);
+	    fill("AFPToFTool", trainID, barInTrainID);
 	}
-	else if(hitsIts->isSideC())
+	else if(hitsItr->isSideC())
 	{
-	    fill("AFPToFTool", numberOfHit_S3);
+	    numberOfHit_S3 = hitsItr->trainID();
+            fill("AFPToFTool", numberOfHit_S3);	
+            fill("AFPToFTool", trainID, barInTrainID);    
 	}
     }
-*/
-
-
     return StatusCode::SUCCESS;
 }
 
-- 
GitLab


From 71ab87e2d4755e00c2ba2157a34f595a3ebfd55e Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Tue, 21 Apr 2020 20:53:17 +0200
Subject: [PATCH 055/422] Fix syntax error

---
 .../Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py  | 2 +-
 ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index b47f95bab260..70160b5fe618 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -63,7 +63,7 @@ if __name__=='__main__':
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     nightly = ''
-    file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1'
+    file = '/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
     
     ConfigFlags.Input.Files = [nightly+file]
     ConfigFlags.Input.isMC = False
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index b6f3a0c09e28..1986768926bc 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -63,7 +63,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     auto trainID = Monitored::Scalar<int>("trainID", 0); 
     auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
 
-    for(const xAOD::AFPTofHit *hitsItr: *afpToFHitContainer)
+    for(const xAOD::AFPToFHit *hitsItr: *afpToFHitContainer)
     {
 	trainID = hitsItr->trainID();
         barInTrainID = hitsItr->barInTrainID();
-- 
GitLab


From ce1f6d99a7d984a22599d36a7ba94d9f78d442e7 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Tue, 21 Apr 2020 21:18:17 +0200
Subject: [PATCH 056/422] Correction: Error->Warning, Failure->Success

---
 .../python/Run3AFPExampleMonitorAlgorithm.py               | 7 ++++---
 .../AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx      | 4 ++--
 .../AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx          | 6 ++++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 70160b5fe618..f707cb8d6ed1 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -29,8 +29,8 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/',xbins=1000,xmin=-0.5,xmax=999.5 ) 
     AFPToFGroup.defineHistogram('lb,nTofHits', title='Luminosity Block;lb;total number of Hits', type='TProfile',  path='ToF/',xbins=1000,xmin=-0.5,xmax=999.5) 
 
-    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits',  path='ToF/',xbins=3,xmin=-0.5,xmax=2.5)
-    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits',  path='ToF/',xbins=3,xmin=-0.5,xmax=2.5)
+    #AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits',  path='ToF/',xbins=3,xmin=-0.5,xmax=2.5)
+    #AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits',  path='ToF/',xbins=3,xmin=-0.5,xmax=2.5)
 
 
     # Using a map of groups
@@ -63,7 +63,8 @@ if __name__=='__main__':
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     nightly = ''
-    file = '/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
+    #file = '/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
+    file = '/afs/cern.ch/user/p/ponyisi/atlas/afp/myESD.pool.root'
     
     ConfigFlags.Input.Files = [nightly+file]
     ConfigFlags.Input.isMC = False
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 9f116b2eae45..2b6004679b3e 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -54,8 +54,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
     if(! afpHitContainer.isValid())
     {
-	ATH_MSG_ERROR("evtStore() does not contain hits collection with name " << m_afpHitContainerKey);
-	return StatusCode::FAILURE;
+	ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpHitContainerKey);
+	return StatusCode::SUCCESS;
     }
 
     ATH_CHECK( afpHitContainer.initialize() );
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index 1986768926bc..170bbe9dab9d 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -48,8 +48,8 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
     if(! afpToFHitContainer.isValid())
     {
-	ATH_MSG_ERROR("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
-	return StatusCode::FAILURE;
+	ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
+	return StatusCode::SUCCESS;
     }
 
     ATH_CHECK( afpToFHitContainer.initialize() );
@@ -58,6 +58,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     fill("AFPToFTool", lb, nTofHits);
 
 //	TO BE researched: difference between trainID and barInTrainID
+/*
     auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
     auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
     auto trainID = Monitored::Scalar<int>("trainID", 0); 
@@ -81,6 +82,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
             fill("AFPToFTool", trainID, barInTrainID);    
 	}
     }
+*/
     return StatusCode::SUCCESS;
 }
 
-- 
GitLab


From 0ab06bc6d8f310e9c1f4fe8f63e541f2df591de3 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 22 Apr 2020 16:21:06 +0200
Subject: [PATCH 057/422] Commit before MR

---
 .../python/Run3AFPExampleMonitorAlgorithm.py              | 8 ++++----
 .../AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx         | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index f707cb8d6ed1..fcd80a58fbc3 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -29,8 +29,8 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/',xbins=1000,xmin=-0.5,xmax=999.5 ) 
     AFPToFGroup.defineHistogram('lb,nTofHits', title='Luminosity Block;lb;total number of Hits', type='TProfile',  path='ToF/',xbins=1000,xmin=-0.5,xmax=999.5) 
 
-    #AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits',  path='ToF/',xbins=3,xmin=-0.5,xmax=2.5)
-    #AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits',  path='ToF/',xbins=3,xmin=-0.5,xmax=2.5)
+    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
+    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
 
 
     # Using a map of groups
@@ -64,7 +64,7 @@ if __name__=='__main__':
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     nightly = ''
     #file = '/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
-    file = '/afs/cern.ch/user/p/ponyisi/atlas/afp/myESD.pool.root'
+    file ='/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' 
     
     ConfigFlags.Input.Files = [nightly+file]
     ConfigFlags.Input.isMC = False
@@ -81,6 +81,6 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    cfg.run(1000) #use cfg.run(20) to only run on first 20 events
+    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index 170bbe9dab9d..54a652ab9d51 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -58,7 +58,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     fill("AFPToFTool", lb, nTofHits);
 
 //	TO BE researched: difference between trainID and barInTrainID
-/*
+
     auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
     auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
     auto trainID = Monitored::Scalar<int>("trainID", 0); 
@@ -82,7 +82,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
             fill("AFPToFTool", trainID, barInTrainID);    
 	}
     }
-*/
+
     return StatusCode::SUCCESS;
 }
 
-- 
GitLab


From 7def25a6e590168a22e128d8a120c4ed073d098d Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 22 Apr 2020 16:24:27 +0200
Subject: [PATCH 058/422] Removing comments and unnecessary prinouts

---
 .../AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx  | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 2b6004679b3e..2b7da5f496b0 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -80,16 +80,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
       }
  
-    AFPMon::AFPFastReco fast(afpHitContainer.get());
-    fast.reco();
-
-    for (const auto& cluster : fast.clusters()) {
-      ATH_MSG_INFO("c: " << cluster.x << " " << cluster.y);
-    }
-
-    for (const auto& track : fast.tracks()) {
-      ATH_MSG_INFO("t: " << track.x << " " << track.y);
-    }
 
     return StatusCode::SUCCESS;
 }
-- 
GitLab


From 8c2b7011f05fbfbfa134f95ac67657800ebce571 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Thu, 23 Apr 2020 02:44:44 +0200
Subject: [PATCH 059/422] Added ToF histograms - HitBarVsTrain

---
 .../Run3AFPMonitoring/AFPToFAlgorithm.h       | 10 ++++---
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  9 +++++--
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx | 26 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
index a9400de43779..81014def2219 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -21,12 +21,16 @@ public:
     virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 
 private:
+   //std::map<std::string,std::map<std::string,int>> m_HitmapGroupsToF;
+   //std::map<std::string, int> m_HitmapGroupsToF;
+   //std::vector<std::string> m_HitmapGroupsToF;
+   std::map<std::string,int> m_HitmapGroupsToF;
    SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
 
 protected:
-   std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
-   std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
-
+   // Only 0 and 3 are ToF stations (farAside and farCside)
+   std::vector<std::string> m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" };
+   
 };
 #endif
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index fcd80a58fbc3..0c61a5fd36bf 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -31,6 +31,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
     AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
+    #AFPToFGroup.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train side A;trainID;barInTrainID', type='TH2F', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
 
 
     # Using a map of groups
@@ -43,7 +44,11 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
     array.defineHistogram('timeOverThreshold', title='1D Time over threshold for {0} Layer {1}', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
 
-    #array.defineHistogram('pixelColIDChip,pixelColIDChip', title='Correlation Row {0} Row {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    #tofStations = [ 'Aside', 'Cside' ]
+    arrayToF = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
+    arrayToF.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
+
+    #array.defineHistogram('pixelColIDChip,pixelColIDChip', title='Correlation Row {0} Row {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=80, ymin=0.5, ymax=80.5)
     #array.defineHistogram('pixelRowIDChip,pixelRowIDChip', title='Correlation Col {0} Col {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
 
     # Finalize. The return value should be a tuple of the ComponentAccumulator
@@ -81,6 +86,6 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
+    cfg.run(1000) #use cfg.run(20) to only run on first 20 events
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index 54a652ab9d51..a9010103ace3 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -26,7 +26,11 @@ AFPToFAlgorithm::~AFPToFAlgorithm() {}
 
 StatusCode AFPToFAlgorithm::initialize() {
     using namespace Monitored;
- 
+
+    //m_HitmapGroupsToF = buildToolMap<std::map<std::string,int>>(m_tools,"AFPToFAlgorithm", m_stationNamesToF);
+    //m_HitmapGroupsToF = buildToolMap<std::map<std::string,int>>(m_tools,"AFPToFAlgorithm", m_stationNamesToF);
+    //m_HitmapGroupsToF = buildToolMap<std::vector<int>>(m_tools,"AFPToFTool", m_stationNamesToF);
+    m_HitmapGroupsToF = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
     // We must declare to the framework in initialize what SG objects we are going to use
     SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
     ATH_CHECK(m_afpToFHitContainerKey.initialize());
@@ -43,7 +47,6 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
     
     lb = GetEventInfo(ctx)->lumiBlock();
-
  
     SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
     if(! afpToFHitContainer.isValid())
@@ -73,14 +76,27 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	{
 	    numberOfHit_S0 = hitsItr->trainID();
             fill("AFPToFTool", numberOfHit_S0);
-	    fill("AFPToFTool", trainID, barInTrainID);
+	    //std::cout << "\n\t" << hitsItr->stationID() << "\n";
+            
+            //fill(m_tools[m_HitmapGroupsToF.at("Aside")], trainID, barInTrainID);
+            //fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(0))], trainID, barInTrainID);
+            //fill(m_tools[m_HitmapGroupsToF[0]], trainID, barInTrainID);
+	    //fill("AFPToFTool", trainID, barInTrainID);
 	}
 	else if(hitsItr->isSideC())
 	{
 	    numberOfHit_S3 = hitsItr->trainID();
-            fill("AFPToFTool", numberOfHit_S3);	
-            fill("AFPToFTool", trainID, barInTrainID);    
+            fill("AFPToFTool", numberOfHit_S3);
+            //std::cout << "\n\t" << hitsItr->stationID() << "\n";
+	    //fill(m_tools[m_HitmapGroupsToF.at(m_stationnames.at(hitsItr->stationID()))], trainID, barInTrainID);
+            //fill(m_tools[m_HitmapGroupsToF.at("Cside")], trainID, barInTrainID);
+	    //fill(m_tools[m_HitmapGroupsToF[1]], trainID, barInTrainID);	
+            //fill("AFPToFTool", trainID, barInTrainID);    
 	}
+
+	if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
+	    fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], trainID, barInTrainID);
+	
     }
 
     return StatusCode::SUCCESS;
-- 
GitLab


From f6a331859ad1d002641ec3199e53ecd000d3997c Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Thu, 23 Apr 2020 03:19:33 +0200
Subject: [PATCH 060/422] Added SiT histograms: Cluster positions in each layer
 (16 histograms)

---
 .../python/Run3AFPExampleMonitorAlgorithm.py    |  1 +
 .../src/AFPSiLayerAlgorithm.cxx                 | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 0c61a5fd36bf..393eaaf95b4d 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -43,6 +43,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
     array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
     array.defineHistogram('timeOverThreshold', title='1D Time over threshold for {0} Layer {1}', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
+    array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1}', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
 
     #tofStations = [ 'Aside', 'Cside' ]
     arrayToF = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 2b7da5f496b0..5cf0a6f3a9b5 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -48,6 +48,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
     auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
     auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold", 0.0);
+    auto clusterX = Monitored::Scalar<float>("clusterX", 0.0);
+    auto clusterY = Monitored::Scalar<float>("clusterY", 0.0);
     
     lb = GetEventInfo(ctx)->lumiBlock();
  
@@ -79,6 +81,21 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
       }
 	else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
       }
+
+    AFPMon::AFPFastReco fast(afpHitContainer.get());
+    fast.reco();
+
+    for (const auto& cluster : fast.clusters()) {
+      //ATH_MSG_INFO("c: " << cluster.x << " " << cluster.y);
+      clusterX = cluster.x;
+      clusterY = cluster.y;
+      fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterX, clusterY);
+    }
+
+    for (const auto& track : fast.tracks()) {
+      //ATH_MSG_INFO("t: " << track.x << " " << track.y);
+      
+    }
  
 
     return StatusCode::SUCCESS;
-- 
GitLab


From a6154f83c99126b4d7b0bb667d4054627353de4b Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Mon, 27 Apr 2020 17:06:28 +0100
Subject: [PATCH 061/422] Ordered services creation

---
 .../python/ComponentAccumulator.py            | 27 ++++++++++++++-----
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py
index 6ff7f98c86e4..6d6222d94e11 100644
--- a/Control/AthenaConfiguration/python/ComponentAccumulator.py
+++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py
@@ -23,8 +23,10 @@ from AthenaConfiguration.UnifyProperties import unifySet
 
 class ConfigurationError(RuntimeError):
     pass
+_basicServicesToCreate=('MessageSvc','JobOptionsSvc','GeoModelSvc','DetDescrCnvSvc','CoreDumpSvc')
+_basicServicesToCreateOrder=_basicServicesToCreate+('VTuneProfilerService','EvtIdModifierSvc') # this is just an example, I doubt they need to be in certain order
+
 
-_basicServicesToCreate=frozenset(('GeoModelSvc','TileInfoLoader','DetDescrCnvSvc','CoreDumpSvc','VTuneProfilerService','EvtIdModifierSvc'))
 
 def printProperties(msg, c, nestLevel = 0):
     # Iterate in sorted order.
@@ -75,7 +77,7 @@ class ComponentAccumulator(object):
         self._algorithms = {}            #Flat algorithms list, useful for merging
         self._conditionsAlgs=[]          #Unordered list of conditions algorithms + their private tools
         self._services=[]                #List of service, not yet sure if the order matters here in the MT age
-        self._servicesToCreate=set(_basicServicesToCreate)
+        self._servicesToCreate=list(_basicServicesToCreate)
         self._privateTools=None          #A placeholder to carry a private tool(s) not yet attached to its parent
         self._primaryComp=None           #A placeholder to designate the primary service 
 
@@ -387,7 +389,18 @@ class ComponentAccumulator(object):
             #keep a ref of the de-duplicated public tool as primary component
             self._primaryComp=self.__getOne( self._services, newSvc.name, "Services") 
         self._lastAddedComponent=newSvc.name
-        if create: self._servicesToCreate.add(newSvc.name)
+        if create:
+            if newSvc.getName in self._servicesToCreate: # done already
+                return
+            if newSvc.getName not in _basicServicesToCreateOrder:
+                self._servicesToCreate.append( newSvc.name )
+            else:
+                for basicSvc in reversed(_basicServicesToCreateOrder[:_basicServicesToCreateOrder.index(newSvc.name)]):
+                    if basicSvc in self._servicesToCreate:
+                        self._basicServicesToCreate.insert(self._basicServicesToCreate.index(basicSvc)+1, newSvc.name)
+                        break
+                else:
+                    self._servicesToCreate.insert( 0, newSvc.name )
         return 
 
 
@@ -562,9 +575,7 @@ class ComponentAccumulator(object):
             self.addCondAlgo(condAlg) #Profit from deduplicaton here
 
         for svc in other._services:
-            self.addService(svc) #Profit from deduplicaton here
-
-        self._servicesToCreate.update(other._servicesToCreate)
+            self.addService(svc, create = svc.name in self._servicesToCreate) #Profit from deduplicaton here
 
         for pt in other._publicTools:
             self.addPublicTool(pt) #Profit from deduplicaton here
@@ -954,12 +965,14 @@ def appendCAtoAthena(ca, destinationSeq=athAlgSeq ):
     _log = logging.getLogger( "conf2toConfigurable".ljust(32) )
     _log.info( "Merging of CA to global ..." )
 
-    from AthenaCommon.AppMgr import ServiceMgr,ToolSvc,athAlgSeq,athCondSeq
+    from AthenaCommon.AppMgr import ServiceMgr,ToolSvc,athAlgSeq,athCondSeq,theApp
     if len(ca.getServices()) != 0:
         _log.info( "Merging services" )
         for comp in ca.getServices():
             instance = conf2toConfigurable( comp, indent="  " )
             ServiceMgr += instance
+        for svcName in ca._servicesToCreate:
+            theApp.CreateSvc += [svcName]
 
     if  len(ca._conditionsAlgs) != 0:
         _log.info( "Merging condition algorithms" )
-- 
GitLab


From 38871d9bc76a44bd562647d54ba1fbbf5daa5f8d Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 1 May 2020 14:35:54 +0200
Subject: [PATCH 062/422] Fixing a wrong formula in AFPFastReco

---
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 26 +++++++++++--------
 .../AFP/Run3AFPMonitoring/src/AFPFastReco.cxx |  2 +-
 .../src/AFPSiLayerAlgorithm.cxx               |  9 +++++--
 3 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 393eaaf95b4d..268db3b67334 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -14,11 +14,15 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
+    
+    from AthenaConfiguration.ComponentFactory import CompFactory
 
-    from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
+    #from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
+    afpSiLayerAlgorithm = CompFactory.AFPSiLayerAlgorithm
     afpSiLayerAlgorithm = helper.addAlgorithm(AFPSiLayerAlgorithm,'AFPSiLayerAlg')
 
-    from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPToFAlgorithm
+    #from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPToFAlgorithm
+    afpToFAlgorithm = CompFactory.AFPToFAlgorithm
     afpToFAlgorithm = helper.addAlgorithm(AFPToFAlgorithm,'AFPToFAlg')
 
     # Add a generic monitoring tool (a "group" in old language). The returned 
@@ -39,15 +43,15 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
 
     array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
-    array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1}', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-    array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1}', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
-    array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1}', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-    array.defineHistogram('timeOverThreshold', title='1D Time over threshold for {0} Layer {1}', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
-    array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1}', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-
-    #tofStations = [ 'Aside', 'Cside' ]
-    arrayToF = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
-    arrayToF.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
+    array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
+    array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
+    array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1};pixelColIDChip;pixelRowIDChip', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    array.defineHistogram('timeOverThreshold', type='TH1F', title='1D Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
+    array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+
+    arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
+    arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
+    array.defineHistogram('trackX,trackY', title='Track posistion position in station {0}trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)   
 
     #array.defineHistogram('pixelColIDChip,pixelColIDChip', title='Correlation Row {0} Row {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=80, ymin=0.5, ymax=80.5)
     #array.defineHistogram('pixelRowIDChip,pixelRowIDChip', title='Correlation Col {0} Col {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
index 83ba56c43358..217c1dc607fb 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
@@ -49,7 +49,7 @@ namespace AFPMon {
 
       const float x = xPlane;
       const float y = yPlane * cos(tilt);
-      const float z = yPlane * sin(tilt) * dz * layerID;
+      const float z = yPlane * sin(tilt) + dz * layerID;
 
       m_clusters.emplace_back(x, y, z, stationID, layerID);
     }
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 5cf0a6f3a9b5..80d88e8b8cfd 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -49,7 +49,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
     auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold", 0.0);
     auto clusterX = Monitored::Scalar<float>("clusterX", 0.0);
-    auto clusterY = Monitored::Scalar<float>("clusterY", 0.0);
+    auto clusterY = Monitored::Scalar<float>("clusterY", 0.0); 
+    auto trackX = Monitored::Scalar<float>("trackX", 0.0);
+    auto trackY = Monitored::Scalar<float>("trackY", 0.0);
     
     lb = GetEventInfo(ctx)->lumiBlock();
  
@@ -70,6 +72,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
       pixelRowIDChip = hitsItr->pixelRowIDChip();
       pixelColIDChip = hitsItr->pixelColIDChip();
       timeOverThreshold = hitsItr->timeOverThreshold();
+      std::cout << "\tTime Over Threshold: " << timeOverThreshold << "\n";
 	
       if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
       {
@@ -94,7 +97,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
     for (const auto& track : fast.tracks()) {
       //ATH_MSG_INFO("t: " << track.x << " " << track.y);
-      
+      trackX = track.x;
+      trackY = track.y;
+      //fill(m_tools[m_HitmapGroups.at(m_stationnames.at(track.station))], trackX, trackY);
     }
  
 
-- 
GitLab


From d5101d2db29f33afc3af377b88972d82fc64e352 Mon Sep 17 00:00:00 2001
From: kristin <kristin.lohwasser@cern.ch>
Date: Fri, 1 May 2020 19:35:47 +0200
Subject: [PATCH 063/422] added bu fix

---
 .../python/Run3AFPExampleMonitorAlgorithm.py              | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 268db3b67334..a1297739f269 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -18,12 +18,12 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     from AthenaConfiguration.ComponentFactory import CompFactory
 
     #from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
-    afpSiLayerAlgorithm = CompFactory.AFPSiLayerAlgorithm
-    afpSiLayerAlgorithm = helper.addAlgorithm(AFPSiLayerAlgorithm,'AFPSiLayerAlg')
+    afpSiLayerAlgorithmFac = CompFactory.AFPSiLayerAlgorithm
+    afpSiLayerAlgorithm = helper.addAlgorithm(afpSiLayerAlgorithmFac,'AFPSiLayerAlg')
 
     #from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPToFAlgorithm
-    afpToFAlgorithm = CompFactory.AFPToFAlgorithm
-    afpToFAlgorithm = helper.addAlgorithm(AFPToFAlgorithm,'AFPToFAlg')
+    afpToFAlgorithmFac = CompFactory.AFPToFAlgorithm
+    afpToFAlgorithm = helper.addAlgorithm(afpToFAlgorithmFac,'AFPToFAlg')
 
     # Add a generic monitoring tool (a "group" in old language). The returned 
     # object here is the standard GenericMonitoringTool.
-- 
GitLab


From 974f2e2bf3162d855e0ee3fd261d32f40dfd2836 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 1 May 2020 23:16:43 +0200
Subject: [PATCH 064/422] Cleaning up the code

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  1 +
 .../Run3AFPMonitoring/AFPToFAlgorithm.h       |  4 +--
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 15 ++++++-----
 .../src/AFPSiLayerAlgorithm.cxx               |  7 ++----
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx | 25 ++++---------------
 5 files changed, 16 insertions(+), 36 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 0ba01b4a325b..c6c98e953d16 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -22,6 +22,7 @@ public:
 
 private:
     std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
+    std::map<std::string,int> m_TrackGroup; 
     SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
 
 protected:
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
index 81014def2219..fea6a733f502 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -21,10 +21,8 @@ public:
     virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 
 private:
-   //std::map<std::string,std::map<std::string,int>> m_HitmapGroupsToF;
-   //std::map<std::string, int> m_HitmapGroupsToF;
-   //std::vector<std::string> m_HitmapGroupsToF;
    std::map<std::string,int> m_HitmapGroupsToF;
+   
    SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
 
 protected:
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 268db3b67334..135ceab6cd29 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -18,12 +18,12 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     from AthenaConfiguration.ComponentFactory import CompFactory
 
     #from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
-    afpSiLayerAlgorithm = CompFactory.AFPSiLayerAlgorithm
-    afpSiLayerAlgorithm = helper.addAlgorithm(AFPSiLayerAlgorithm,'AFPSiLayerAlg')
+    afpSiLayerAlgorithmFac = CompFactory.AFPSiLayerAlgorithm
+    afpSiLayerAlgorithm = helper.addAlgorithm(afpSiLayerAlgorithmFac,'AFPSiLayerAlg')
 
     #from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPToFAlgorithm
-    afpToFAlgorithm = CompFactory.AFPToFAlgorithm
-    afpToFAlgorithm = helper.addAlgorithm(AFPToFAlgorithm,'AFPToFAlg')
+    afpToFAlgorithmFac = CompFactory.AFPToFAlgorithm
+    afpToFAlgorithm = helper.addAlgorithm(afpToFAlgorithmFac,'AFPToFAlg')
 
     # Add a generic monitoring tool (a "group" in old language). The returned 
     # object here is the standard GenericMonitoringTool.
@@ -35,7 +35,6 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
     AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
-    #AFPToFGroup.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train side A;trainID;barInTrainID', type='TH2F', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
 
 
     # Using a map of groups
@@ -51,7 +50,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
     arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
-    array.defineHistogram('trackX,trackY', title='Track posistion position in station {0}trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)   
+    arrayOneList.defineHistogram('trackX,trackY', title='Track posistion position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)   
 
     #array.defineHistogram('pixelColIDChip,pixelColIDChip', title='Correlation Row {0} Row {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=80, ymin=0.5, ymax=80.5)
     #array.defineHistogram('pixelRowIDChip,pixelRowIDChip', title='Correlation Col {0} Col {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
@@ -73,8 +72,8 @@ if __name__=='__main__':
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     nightly = ''
-    #file = '/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
     file ='/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' 
+
     
     ConfigFlags.Input.Files = [nightly+file]
     ConfigFlags.Input.isMC = False
@@ -91,6 +90,6 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    cfg.run(1000) #use cfg.run(20) to only run on first 20 events
+    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 80d88e8b8cfd..280dd3b541b1 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -30,7 +30,7 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
     using namespace Monitored;
  
     m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
-
+    m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
     // We must declare to the framework in initialize what SG objects we are going to use:
     SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
     ATH_CHECK(m_afpHitContainerKey.initialize());
@@ -72,7 +72,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
       pixelRowIDChip = hitsItr->pixelRowIDChip();
       pixelColIDChip = hitsItr->pixelColIDChip();
       timeOverThreshold = hitsItr->timeOverThreshold();
-      std::cout << "\tTime Over Threshold: " << timeOverThreshold << "\n";
 	
       if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
       {
@@ -89,17 +88,15 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
     fast.reco();
 
     for (const auto& cluster : fast.clusters()) {
-      //ATH_MSG_INFO("c: " << cluster.x << " " << cluster.y);
       clusterX = cluster.x;
       clusterY = cluster.y;
       fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterX, clusterY);
     }
 
     for (const auto& track : fast.tracks()) {
-      //ATH_MSG_INFO("t: " << track.x << " " << track.y);
       trackX = track.x;
       trackY = track.y;
-      //fill(m_tools[m_HitmapGroups.at(m_stationnames.at(track.station))], trackX, trackY);
+      fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackX, trackY);
     }
  
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index a9010103ace3..9d8fb4668222 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -27,10 +27,8 @@ AFPToFAlgorithm::~AFPToFAlgorithm() {}
 StatusCode AFPToFAlgorithm::initialize() {
     using namespace Monitored;
 
-    //m_HitmapGroupsToF = buildToolMap<std::map<std::string,int>>(m_tools,"AFPToFAlgorithm", m_stationNamesToF);
-    //m_HitmapGroupsToF = buildToolMap<std::map<std::string,int>>(m_tools,"AFPToFAlgorithm", m_stationNamesToF);
-    //m_HitmapGroupsToF = buildToolMap<std::vector<int>>(m_tools,"AFPToFTool", m_stationNamesToF);
     m_HitmapGroupsToF = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
+
     // We must declare to the framework in initialize what SG objects we are going to use
     SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
     ATH_CHECK(m_afpToFHitContainerKey.initialize());
@@ -45,6 +43,10 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     // Declare the quantities which should be monitored
     auto lb = Monitored::Scalar<int>("lb", 0);
     auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
+    auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
+    auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
+    auto trainID = Monitored::Scalar<int>("trainID", 0); 
+    auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
     
     lb = GetEventInfo(ctx)->lumiBlock();
  
@@ -60,12 +62,6 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
     nTofHits = afpToFHitContainer->size();
     fill("AFPToFTool", lb, nTofHits);
 
-//	TO BE researched: difference between trainID and barInTrainID
-
-    auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
-    auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
-    auto trainID = Monitored::Scalar<int>("trainID", 0); 
-    auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
 
     for(const xAOD::AFPToFHit *hitsItr: *afpToFHitContainer)
     {
@@ -76,22 +72,11 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	{
 	    numberOfHit_S0 = hitsItr->trainID();
             fill("AFPToFTool", numberOfHit_S0);
-	    //std::cout << "\n\t" << hitsItr->stationID() << "\n";
-            
-            //fill(m_tools[m_HitmapGroupsToF.at("Aside")], trainID, barInTrainID);
-            //fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(0))], trainID, barInTrainID);
-            //fill(m_tools[m_HitmapGroupsToF[0]], trainID, barInTrainID);
-	    //fill("AFPToFTool", trainID, barInTrainID);
 	}
 	else if(hitsItr->isSideC())
 	{
 	    numberOfHit_S3 = hitsItr->trainID();
             fill("AFPToFTool", numberOfHit_S3);
-            //std::cout << "\n\t" << hitsItr->stationID() << "\n";
-	    //fill(m_tools[m_HitmapGroupsToF.at(m_stationnames.at(hitsItr->stationID()))], trainID, barInTrainID);
-            //fill(m_tools[m_HitmapGroupsToF.at("Cside")], trainID, barInTrainID);
-	    //fill(m_tools[m_HitmapGroupsToF[1]], trainID, barInTrainID);	
-            //fill("AFPToFTool", trainID, barInTrainID);    
 	}
 
 	if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
-- 
GitLab


From f44f8cfb74ff4268f9ddd4422eebc1c7a3ef2cbc Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 1 May 2020 23:34:06 +0200
Subject: [PATCH 065/422] Cleaning up the environment

---
 .../Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 135ceab6cd29..639fda34aebf 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -52,9 +52,6 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
     arrayOneList.defineHistogram('trackX,trackY', title='Track posistion position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)   
 
-    #array.defineHistogram('pixelColIDChip,pixelColIDChip', title='Correlation Row {0} Row {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=80, ymin=0.5, ymax=80.5)
-    #array.defineHistogram('pixelRowIDChip,pixelRowIDChip', title='Correlation Col {0} Col {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
     
-- 
GitLab


From 3f477bb624dd682d9163429411ac4bb1d73fdb55 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Sat, 9 May 2020 20:19:16 +0200
Subject: [PATCH 066/422] Changing spaces to tabs, to be consistent.

---
 .../Run3AFPMonitoring/AFPFastReco.h           | 177 ++++++++--------
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  18 +-
 .../Run3AFPMonitoring/AFPToFAlgorithm.h       |  16 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 120 ++++++-----
 .../AFP/Run3AFPMonitoring/src/AFPFastReco.cxx | 196 ++++++++++--------
 .../src/AFPSiLayerAlgorithm.cxx               | 120 +++++------
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx |  86 ++++----
 7 files changed, 374 insertions(+), 359 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
index 38080060f69b..a77f8e348477 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
@@ -11,118 +11,125 @@
 
 namespace AFPMon {
 
-  struct AFPCluster {
-    AFPCluster(float x_, float y_, float z_, int s, int l)
+struct AFPCluster 
+{
+	AFPCluster(float x_, float y_, float z_, int s, int l)
         : x {x_}, y {y_}, z {z_}, station {s}, layer {l} {}
 
-    float x;
-    float y;
-    float z;
-    int station;
-    int layer;
-  };
-
-  inline bool operator==(const AFPCluster& lhs, const AFPCluster& rhs) {
-    if (lhs.x != rhs.x) return false;
-    if (lhs.y != rhs.y) return false;
-    if (lhs.z != rhs.z) return false;
-    if (lhs.station != rhs.station) return false;
-    if (lhs.layer != rhs.layer) return false;
-
-    return true;
-  }
-
-  struct AFPTrack {
-    AFPTrack(float x_, float y_, int s, std::array<int, 4> a)
+	float x;
+	float y;
+	float z;
+	int station;
+	int layer;
+ };
+
+inline bool operator==(const AFPCluster& lhs, const AFPCluster& rhs) 
+{
+	if (lhs.x != rhs.x) return false;
+	if (lhs.y != rhs.y) return false;
+	if (lhs.z != rhs.z) return false;
+	if (lhs.station != rhs.station) return false;
+	if (lhs.layer != rhs.layer) return false;
+
+	return true;
+}
+
+struct AFPTrack 
+{
+	AFPTrack(float x_, float y_, int s, std::array<int, 4> a)
         : x {x_}, y {y_}, station {s}, layerClusters {std::move(a)} {}
 
-    float x;
-    float y;
-    int station;
-    std::array<int, 4> layerClusters;
-  };
+	float x;
+	float y;
+	int station;
+	std::array<int, 4> layerClusters;
+};
 
-  class AFPFastReco {
-  public:
-    /// Constructor. Sets input hit container
-    AFPFastReco(const xAOD::AFPSiHitContainer* hits) : m_hitContainer {hits} {}
+class AFPFastReco 
+{
+	public:
+	/// Constructor. Sets input hit container
+	AFPFastReco(const xAOD::AFPSiHitContainer* hits) : m_hitContainer {hits} {}
 
-    /// Performs fast reconstruction of clusters and tracks
-    void reco();
+	/// Performs fast reconstruction of clusters and tracks
+	void reco();
 
-    /// Returns vector of clusters
-    std::vector<AFPCluster> clusters() const { return m_clusters; }
+	/// Returns vector of clusters
+	std::vector<AFPCluster> clusters() const { return m_clusters; }
 
-    /// Returns vector of tracks
-    std::vector<AFPTrack> tracks() const { return m_tracks; }
+	/// Returns vector of tracks
+	std::vector<AFPTrack> tracks() const { return m_tracks; }
 
-  private:
-    /// Performs fast cluster reconstruction
-    void recoClusters();
+  	private:
+	/// Performs fast cluster reconstruction
+	void recoClusters();
 
-    /// Performs fast track reconstruction
-    void recoTracks();
+	/// Performs fast track reconstruction
+	void recoTracks();
 
-    /// Returns parameters of fitted line
-    std::pair<double, double> linReg(std::vector<std::pair<double, double>> YX) const;
+	/// Returns parameters of fitted line
+	std::pair<double, double> linReg(std::vector<std::pair<double, double>> YX) const;
 
-    /// Finds hits/clusters around given init element
-    template <class T>
-    std::vector<T> findAround(T init, std::list<T>& toJoin) const;
+	/// Finds hits/clusters around given init element
+	template <class T>
+	std::vector<T> findAround(T init, std::list<T>& toJoin) const;
 
-    /// Checks if given hits are neighbours
-    bool areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const;
+	/// Checks if given hits are neighbours
+	bool areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const;
 
-    /// Checks if given clusters are neighbours
-    bool areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const;
+	/// Checks if given clusters are neighbours
+	bool areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const;
 
-    /// Pointer to hit container
-    const xAOD::AFPSiHitContainer* m_hitContainer;
+	/// Pointer to hit container
+	const xAOD::AFPSiHitContainer* m_hitContainer;
 
-    /// Vector of clusters
-    std::vector<AFPCluster> m_clusters;
+	/// Vector of clusters
+	std::vector<AFPCluster> m_clusters;
 
-    /// Vector of tracks
-    std::vector<AFPTrack> m_tracks;
+	/// Vector of tracks
+	std::vector<AFPTrack> m_tracks;
 
-    /// Number of AFP stations
-    static constexpr int s_afpStations = 4;
+	/// Number of AFP stations
+	static constexpr int s_afpStations = 4;
 
-    /// Number of layers in each station
-    static constexpr int s_afpLayers = 4;
+	/// Number of layers in each station
+	static constexpr int s_afpLayers = 4;
 
-    /// Minimum number of clusters in track
-    static constexpr int s_trackSize = 3;
+	/// Minimum number of clusters in track
+	static constexpr int s_trackSize = 3;
 
-    /// Maximum distance between cluster
-    static constexpr float s_clusterDistance = 0.4;
-  };
+	/// Maximum distance between cluster
+	static constexpr float s_clusterDistance = 0.4;
+ };
 
-  template <class T>
-  std::vector<T> AFPFastReco::findAround(T init, std::list<T>& toJoin) const {
-    std::vector<T> element;
-    element.push_back(init);
+template <class T> std::vector<T> AFPFastReco::findAround(T init, std::list<T>& toJoin) const 
+{
+	std::vector<T> element;
+	element.push_back(init);
 
-    std::vector<T> newNeighbours;
-    do {
-      newNeighbours.clear();
-      for (auto& b : toJoin) {
-        bool isNew = false;
-        for (auto& a : element)
-          if (areNeighbours(a, b)) isNew = true;
+	std::vector<T> newNeighbours;
+	do 
+	{
+		newNeighbours.clear();
+		for (auto& b : toJoin) 
+		{
+			bool isNew = false;
+        	for (auto& a : element)
+          		if (areNeighbours(a, b)) isNew = true;
 
-        if (isNew) {
-          newNeighbours.push_back(b);
-          element.push_back(b);
-        }
-      }
+        	if (isNew) 
+			{
+				newNeighbours.push_back(b);
+				element.push_back(b);
+        	}
+		}
 
-      for (auto& t : newNeighbours)
-        toJoin.remove(t);
+		for (auto& t : newNeighbours)
+			toJoin.remove(t);
 
-    } while (newNeighbours.size() > 0);
+	} while (newNeighbours.size() > 0);
 
-    return element;
+	return element;
   }
 
 }  // namespace AFPMon
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index c6c98e953d16..958c1cdf189c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -15,19 +15,19 @@
 
 class AFPSiLayerAlgorithm : public AthMonitorAlgorithm {
 public:
-    AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
-    virtual ~AFPSiLayerAlgorithm();
-    virtual StatusCode initialize() override;
-    virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+	AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
+	virtual ~AFPSiLayerAlgorithm();
+	virtual StatusCode initialize() override;
+	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 
 private:
-    std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
-    std::map<std::string,int> m_TrackGroup; 
-    SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
+	std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
+	std::map<std::string,int> m_TrackGroup; 
+	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
 
 protected:
-    std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
-    std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
+	std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
+	std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
 
 };
 #endif
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
index fea6a733f502..63f34211b5c9 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -15,19 +15,19 @@
 
 class AFPToFAlgorithm : public AthMonitorAlgorithm {
 public:
-    AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
-    virtual ~AFPToFAlgorithm();
-    virtual StatusCode initialize() override;
-    virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+	AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
+	virtual ~AFPToFAlgorithm();
+	virtual StatusCode initialize() override;
+	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 
 private:
-   std::map<std::string,int> m_HitmapGroupsToF;
+	std::map<std::string,int> m_HitmapGroupsToF;
    
-   SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
+	SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
 
 protected:
-   // Only 0 and 3 are ToF stations (farAside and farCside)
-   std::vector<std::string> m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" };
+	// Only 0 and 3 are ToF stations (farAside and farCside)
+	std::vector<std::string> m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" };
    
 };
 #endif
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 639fda34aebf..77909efd27d1 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -10,83 +10,79 @@
 '''
 
 def Run3AFPExampleMonitoringConfig(inputFlags):
-    '''Function to configures some algorithms in the monitoring system.'''
+	'''Function to configures some algorithms in the monitoring system.'''
 
-    from AthenaMonitoring import AthMonitorCfgHelper
-    helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
+	from AthenaMonitoring import AthMonitorCfgHelper
+	helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
     
-    from AthenaConfiguration.ComponentFactory import CompFactory
+	from AthenaConfiguration.ComponentFactory import CompFactory
 
-    #from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
-    afpSiLayerAlgorithmFac = CompFactory.AFPSiLayerAlgorithm
-    afpSiLayerAlgorithm = helper.addAlgorithm(afpSiLayerAlgorithmFac,'AFPSiLayerAlg')
+	#from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
+	afpSiLayerAlgorithmFac = CompFactory.AFPSiLayerAlgorithm
+	afpSiLayerAlgorithm = helper.addAlgorithm(afpSiLayerAlgorithmFac,'AFPSiLayerAlg')
 
-    #from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPToFAlgorithm
-    afpToFAlgorithmFac = CompFactory.AFPToFAlgorithm
-    afpToFAlgorithm = helper.addAlgorithm(afpToFAlgorithmFac,'AFPToFAlg')
+	#from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPToFAlgorithm
+	afpToFAlgorithmFac = CompFactory.AFPToFAlgorithm
+	afpToFAlgorithm = helper.addAlgorithm(afpToFAlgorithmFac,'AFPToFAlg')
 
-    # Add a generic monitoring tool (a "group" in old language). The returned 
-    # object here is the standard GenericMonitoringTool.
-    AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
-    AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
+	# Add a generic monitoring tool (a "group" in old language). The returned 
+	# object here is the standard GenericMonitoringTool.
+	AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
+	AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
-    AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/',xbins=1000,xmin=-0.5,xmax=999.5 ) 
-    AFPToFGroup.defineHistogram('lb,nTofHits', title='Luminosity Block;lb;total number of Hits', type='TProfile',  path='ToF/',xbins=1000,xmin=-0.5,xmax=999.5) 
+	AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/',xbins=1000,xmin=-0.5,xmax=999.5 ) 
+	AFPToFGroup.defineHistogram('lb,nTofHits', title='Luminosity Block;lb;total number of Hits', type='TProfile',  path='ToF/',xbins=1000,xmin=-0.5,xmax=999.5) 
 
-    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
-    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
+	AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
+	AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
 
+	# Using a map of groups
+	layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
+	combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
 
-    # Using a map of groups
-    layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
-    combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
+	array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
+	array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
+	array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
+	array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1};pixelColIDChip;pixelRowIDChip', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+	array.defineHistogram('timeOverThreshold', type='TH1F', title='1D Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
+	array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
 
-    array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
-    array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-    array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
-    array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1};pixelColIDChip;pixelRowIDChip', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-    array.defineHistogram('timeOverThreshold', type='TH1F', title='1D Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
-    array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+	arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
+	arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
+	arrayOneList.defineHistogram('trackX,trackY', title='Track posistion position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)   
 
-    arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
-    arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
-    arrayOneList.defineHistogram('trackX,trackY', title='Track posistion position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)   
-
-    # Finalize. The return value should be a tuple of the ComponentAccumulator
-    return helper.result()
+	# Finalize. The return value should be a tuple of the ComponentAccumulator
+	return helper.result()
     
 
 if __name__=='__main__':
-    # Setup the Run III behavior
-    from AthenaCommon.Configurable import Configurable
-    Configurable.configurableRun3Behavior = 1
-
-    # Setup logs
-    from AthenaCommon.Logging import log
-    from AthenaCommon.Constants import INFO
-    log.setLevel(INFO)
-
-    # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    nightly = ''
-    file ='/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' 
-
+	# Setup the Run III behavior
+	from AthenaCommon.Configurable import Configurable
+	Configurable.configurableRun3Behavior = 1
+
+	# Setup logs
+	from AthenaCommon.Logging import log
+	from AthenaCommon.Constants import INFO
+	log.setLevel(INFO)
+
+	# Set the Athena configuration flags
+	from AthenaConfiguration.AllConfigFlags import ConfigFlags
+	nightly = ''
+	file = '/afs/cern.ch/user/l/ladamczy/public/data18_13TeV.00354309.physics_Main.ESD._lb0130._SFO-1._0001.data.r21'
+
+	ConfigFlags.Input.Files = [nightly+file]
+	ConfigFlags.Input.isMC = False
+	ConfigFlags.Output.HISTFileName = 'AFPOutput.root'
     
-    ConfigFlags.Input.Files = [nightly+file]
-    ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput.root'
-    
-    ConfigFlags.lock()
-
-    # Initialize configuration object, add accumulator, merge, and run.
-    from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg 
-    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesSerialCfg()
-    cfg.merge(PoolReadCfg(ConfigFlags))
-
-    exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
-    cfg.merge(exampleMonitorAcc)
+	ConfigFlags.lock()
 
-    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
+	# Initialize configuration object, add accumulator, merge, and run.
+	from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg 
+	from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+	cfg = MainServicesSerialCfg()
+	cfg.merge(PoolReadCfg(ConfigFlags))
 
+	exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
+	cfg.merge(exampleMonitorAcc)
 
+	cfg.run(10000) #use cfg.run(20) to only run on first 20 events
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
index 217c1dc607fb..9234e1c3a024 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
@@ -11,124 +11,136 @@
 
 namespace AFPMon {
 
-  void AFPFastReco::reco() {
-    recoClusters();
-    recoTracks();
-  }
-
-  void AFPFastReco::recoClusters() {
-    constexpr float dx   = 0.25;  // [mm]
+void AFPFastReco::reco() 
+{
+	recoClusters();
+	recoTracks();
+}
+
+void AFPFastReco::recoClusters() 
+{
+	constexpr float dx   = 0.25;  // [mm]
     constexpr float dy   = 0.05;  // [mm]
     constexpr float dz   = 9.00;  // [mm]
     constexpr float tilt = 14. / 180. * 3.14159;
 
     std::list toCluster(m_hitContainer->begin(), m_hitContainer->end());
 
-    while (toCluster.size() > 0) {
-      auto init = *(toCluster.begin());
-      toCluster.pop_front();
-      auto clusteredHits = findAround(init, toCluster);
-
-      float sumX      = 0;
-      float sumY      = 0;
-      float sumCharge = 0;
-      for (const xAOD::AFPSiHit* h : clusteredHits) {
-        const float charge = h->depositedCharge();
-        const float pixX   = dx * h->pixelColIDChip();
-        const float pixY   = dy * h->pixelRowIDChip();
-        sumX += charge * pixX;
-        sumY += charge * pixY;
-        sumCharge += charge;
-      }
-
-      const float xPlane = sumX / sumCharge;
-      const float yPlane = sumY / sumCharge;
-
-      const int stationID = init->stationID();
-      const int layerID   = init->pixelLayerID();
-
-      const float x = xPlane;
-      const float y = yPlane * cos(tilt);
-      const float z = yPlane * sin(tilt) + dz * layerID;
-
-      m_clusters.emplace_back(x, y, z, stationID, layerID);
+    while (toCluster.size() > 0) 
+	{
+		auto init = *(toCluster.begin());
+		toCluster.pop_front();
+		auto clusteredHits = findAround(init, toCluster);
+
+		float sumX      = 0;
+		float sumY      = 0;
+		float sumCharge = 0;
+		for (const xAOD::AFPSiHit* h : clusteredHits) 
+		{
+        	const float charge = h->depositedCharge();
+			const float pixX   = dx * h->pixelColIDChip();
+			const float pixY   = dy * h->pixelRowIDChip();
+			sumX += charge * pixX;
+			sumY += charge * pixY;
+			sumCharge += charge;
+		}
+
+		const float xPlane = sumX / sumCharge;
+		const float yPlane = sumY / sumCharge;
+
+		const int stationID = init->stationID();
+		const int layerID   = init->pixelLayerID();
+
+		const float x = xPlane;
+		const float y = yPlane * cos(tilt);
+		const float z = yPlane * sin(tilt) + dz * layerID;
+
+		m_clusters.emplace_back(x, y, z, stationID, layerID);
     }
-  }
+}
 
-  void AFPFastReco::recoTracks() {
-    std::list toTrack(m_clusters.begin(), m_clusters.end());
+void AFPFastReco::recoTracks() 
+{
+	std::list toTrack(m_clusters.begin(), m_clusters.end());
 
-    while (toTrack.size() > 0) {
-      auto init = *(toTrack.begin());
-      toTrack.pop_front();
-      auto trackCandidate = findAround(init, toTrack);
+	while (toTrack.size() > 0) 
+	{
+		auto init = *(toTrack.begin());
+		toTrack.pop_front();
+		auto trackCandidate = findAround(init, toTrack);
 
-      if (trackCandidate.size() < s_trackSize) continue;
+		if (trackCandidate.size() < s_trackSize) continue;
 
-      std::array<int, 4> clusters {};
+		std::array<int, 4> clusters {};
 
-      std::vector<std::pair<double, double>> XZ;
-      std::vector<std::pair<double, double>> YZ;
+		std::vector<std::pair<double, double>> XZ;
+		std::vector<std::pair<double, double>> YZ;
 
-      for (const auto& cluster : trackCandidate) {
-        clusters[cluster.layer]++;
+		for (const auto& cluster : trackCandidate) 
+		{
+			clusters[cluster.layer]++;
 
-        XZ.emplace_back(cluster.x, cluster.z);
-        YZ.emplace_back(cluster.y, cluster.z);
-      }
+			XZ.emplace_back(cluster.x, cluster.z);
+			YZ.emplace_back(cluster.y, cluster.z);
+		}
 
-      const auto [x, xSlope] = linReg(XZ);
-      const auto [y, ySlope] = linReg(YZ);
-      const int station      = trackCandidate[0].station;
+		const auto [x, xSlope] = linReg(XZ);
+		const auto [y, ySlope] = linReg(YZ);
+		const int station      = trackCandidate[0].station;
 
-      m_tracks.emplace_back(x, y, station, clusters);
+		m_tracks.emplace_back(x, y, station, clusters);
     }
-  }
+}
 
-  std::pair<double, double> AFPFastReco::linReg(std::vector<std::pair<double, double>> YX) const {
+std::pair<double, double> AFPFastReco::linReg(std::vector<std::pair<double, double>> YX) const 
+{
     double meanx = 0;
     double meany = 0;
-    for (const auto& yx : YX) {
-      meany += yx.first;
-      meanx += yx.second;
+    for (const auto& yx : YX) 
+	{
+		meany += yx.first;
+		meanx += yx.second;
     }
 
-    meanx /= YX.size();
+	meanx /= YX.size();
     meany /= YX.size();
 
     double numerator   = 0;
     double denumerator = 0;
-    for (const auto& yx : YX) {
-      const double dy = yx.first - meany;
-      const double dx = yx.second - meanx;
-      numerator += dx * dy;
-      denumerator += dx * dx;
-    }
-
-    const double slope    = numerator / denumerator;
-    const double position = meany - slope * meanx;
-
-    return {position, slope};
-  }
-
-  bool AFPFastReco::areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const {
-    if (lhs->stationID() != rhs->stationID()) return false;
-    if (lhs->pixelLayerID() != rhs->pixelLayerID()) return false;
-    if (lhs->pixelColIDChip() != rhs->pixelColIDChip()) return false;
-    if (abs(lhs->pixelRowIDChip() - rhs->pixelRowIDChip()) != 1) return false;
-
-    return true;
-  }
-
-  bool AFPFastReco::areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const {
-    if (lhs.station != rhs.station) return false;
-
-    const float dx = lhs.x - rhs.x;
-    const float dy = lhs.y - rhs.y;
-    if (dx * dx + dy * dy > s_clusterDistance) return false;
-
-    return true;
-  }
+    for (const auto& yx : YX) 
+	{
+		const double dy = yx.first - meany;
+		const double dx = yx.second - meanx;
+		numerator += dx * dy;
+		denumerator += dx * dx;
+	}
+
+	const double slope    = numerator / denumerator;
+	const double position = meany - slope * meanx;
+
+	return {position, slope};
+}
+
+bool AFPFastReco::areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const 
+{
+	if (lhs->stationID() != rhs->stationID()) return false;
+	if (lhs->pixelLayerID() != rhs->pixelLayerID()) return false;
+	if (lhs->pixelColIDChip() != rhs->pixelColIDChip()) return false;
+	if (abs(lhs->pixelRowIDChip() - rhs->pixelRowIDChip()) != 1) return false;
+
+	return true;
+}
+
+bool AFPFastReco::areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const 
+{
+	if (lhs.station != rhs.station) return false;
+
+	const float dx = lhs.x - rhs.x;
+	const float dy = lhs.y - rhs.y;
+	if (dx * dx + dy * dy > s_clusterDistance) return false;
+
+	return true;
+}
 
 }  // namespace AFPMon
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 280dd3b541b1..aa126b716ee4 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -19,7 +19,7 @@ AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator*
 , m_afpHitContainerKey("AFPSiHitContainer")
 
 {
-    declareProperty( "AFPSiHitContainer", m_afpHitContainerKey );
+	declareProperty( "AFPSiHitContainer", m_afpHitContainerKey );
 }
 
 
@@ -27,80 +27,80 @@ AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
 
 
 StatusCode AFPSiLayerAlgorithm::initialize() {
-    using namespace Monitored;
+	using namespace Monitored;
  
-    m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
-    m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
-    // We must declare to the framework in initialize what SG objects we are going to use:
-    SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
-    ATH_CHECK(m_afpHitContainerKey.initialize());
+	m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
+	m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
+	// We must declare to the framework in initialize what SG objects we are going to use:
+	SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
+	ATH_CHECK(m_afpHitContainerKey.initialize());
 
-    return AthMonitorAlgorithm::initialize();
+	return AthMonitorAlgorithm::initialize();
 }
 
 
 StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
-    using namespace Monitored;
-
-    // Declare the quantities which should be monitored:
-    auto lb = Monitored::Scalar<int>("lb", 0); 
-    auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
-    auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
-    auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
-    auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold", 0.0);
-    auto clusterX = Monitored::Scalar<float>("clusterX", 0.0);
-    auto clusterY = Monitored::Scalar<float>("clusterY", 0.0); 
-    auto trackX = Monitored::Scalar<float>("trackX", 0.0);
-    auto trackY = Monitored::Scalar<float>("trackY", 0.0);
+	using namespace Monitored;
+
+	// Declare the quantities which should be monitored:
+	auto lb = Monitored::Scalar<int>("lb", 0); 
+	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
+	auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
+	auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
+	auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold", 0.0);
+	auto clusterX = Monitored::Scalar<float>("clusterX", 0.0);
+	auto clusterY = Monitored::Scalar<float>("clusterY", 0.0); 
+	auto trackX = Monitored::Scalar<float>("trackX", 0.0);
+	auto trackY = Monitored::Scalar<float>("trackY", 0.0);
     
-    lb = GetEventInfo(ctx)->lumiBlock();
+	lb = GetEventInfo(ctx)->lumiBlock();
  
-    SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
-    if(! afpHitContainer.isValid())
-    {
-	ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpHitContainerKey);
-	return StatusCode::SUCCESS;
-    }
+	SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
+	if(! afpHitContainer.isValid())
+	{
+		ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpHitContainerKey);
+		return StatusCode::SUCCESS;
+	}
 
-    ATH_CHECK( afpHitContainer.initialize() );
+	ATH_CHECK( afpHitContainer.initialize() );
 
-    nSiHits = afpHitContainer->size();
-    fill("AFPSiLayerTool", lb, nSiHits);    
+	nSiHits = afpHitContainer->size();
+	fill("AFPSiLayerTool", lb, nSiHits);    
 
     for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
     {
-      pixelRowIDChip = hitsItr->pixelRowIDChip();
-      pixelColIDChip = hitsItr->pixelColIDChip();
-      timeOverThreshold = hitsItr->timeOverThreshold();
-	
-      if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
-      {
-        fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
+		pixelRowIDChip = hitsItr->pixelRowIDChip();
+		pixelColIDChip = hitsItr->pixelColIDChip();
+		timeOverThreshold = hitsItr->timeOverThreshold();
 	
-      }
-	else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
-      }
-
-    AFPMon::AFPFastReco fast(afpHitContainer.get());
-    fast.reco();
-
-    for (const auto& cluster : fast.clusters()) {
-      clusterX = cluster.x;
-      clusterY = cluster.y;
-      fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterX, clusterY);
-    }
-
-    for (const auto& track : fast.tracks()) {
-      trackX = track.x;
-      trackY = track.y;
-      fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackX, trackY);
-    }
+		if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
+		{
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);	
+		}
+			else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
+		}
+
+	AFPMon::AFPFastReco fast(afpHitContainer.get());
+	fast.reco();
+
+	for (const auto& cluster : fast.clusters()) 
+	{
+		clusterX = cluster.x;
+		clusterY = cluster.y;
+		fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterX, clusterY);
+	}
+
+	for (const auto& track : fast.tracks()) 
+	{
+		trackX = track.x;
+		trackY = track.y;
+		fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackX, trackY);
+	}
  
-
-    return StatusCode::SUCCESS;
+	return StatusCode::SUCCESS;
 }
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index 9d8fb4668222..a0f529b30606 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -17,7 +17,7 @@ AFPToFAlgorithm::AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLoca
 , m_afpToFHitContainerKey("AFPToFHitContainer")
 
 {
-    declareProperty( "AFPToFHitContainer", m_afpToFHitContainerKey );
+	declareProperty( "AFPToFHitContainer", m_afpToFHitContainerKey );
 }
 
 
@@ -25,64 +25,64 @@ AFPToFAlgorithm::~AFPToFAlgorithm() {}
 
 
 StatusCode AFPToFAlgorithm::initialize() {
-    using namespace Monitored;
+	using namespace Monitored;
 
-    m_HitmapGroupsToF = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
+	m_HitmapGroupsToF = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
 
-    // We must declare to the framework in initialize what SG objects we are going to use
-    SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
-    ATH_CHECK(m_afpToFHitContainerKey.initialize());
+	// We must declare to the framework in initialize what SG objects we are going to use
+	SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
+	ATH_CHECK(m_afpToFHitContainerKey.initialize());
     
-    return AthMonitorAlgorithm::initialize();
+	return AthMonitorAlgorithm::initialize();
 }
 
 
 StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
-    using namespace Monitored;
-
-    // Declare the quantities which should be monitored
-    auto lb = Monitored::Scalar<int>("lb", 0);
-    auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
-    auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
-    auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
-    auto trainID = Monitored::Scalar<int>("trainID", 0); 
-    auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
+	using namespace Monitored;
+
+	// Declare the quantities which should be monitored
+	auto lb = Monitored::Scalar<int>("lb", 0);
+	auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
+	auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
+	auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
+	auto trainID = Monitored::Scalar<int>("trainID", 0); 
+	auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
     
-    lb = GetEventInfo(ctx)->lumiBlock();
+	lb = GetEventInfo(ctx)->lumiBlock();
  
-    SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
-    if(! afpToFHitContainer.isValid())
-    {
-	ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
-	return StatusCode::SUCCESS;
+	SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
+	if(! afpToFHitContainer.isValid())
+	{
+		ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
+		return StatusCode::SUCCESS;
     }
 
-    ATH_CHECK( afpToFHitContainer.initialize() );
-
-    nTofHits = afpToFHitContainer->size();
-    fill("AFPToFTool", lb, nTofHits);
+	ATH_CHECK( afpToFHitContainer.initialize() );
 
+	nTofHits = afpToFHitContainer->size();
+	fill("AFPToFTool", lb, nTofHits);
 
-    for(const xAOD::AFPToFHit *hitsItr: *afpToFHitContainer)
-    {
-	trainID = hitsItr->trainID();
-        barInTrainID = hitsItr->barInTrainID();
-
-	if(hitsItr->isSideA())
+	for(const xAOD::AFPToFHit *hitsItr: *afpToFHitContainer)
 	{
-	    numberOfHit_S0 = hitsItr->trainID();
+		trainID = hitsItr->trainID();
+		barInTrainID = hitsItr->barInTrainID();
+
+		if(hitsItr->isSideA())
+		{
+	    	numberOfHit_S0 = hitsItr->trainID();
             fill("AFPToFTool", numberOfHit_S0);
+		}
+		else if(hitsItr->isSideC())
+		{
+			numberOfHit_S3 = hitsItr->trainID();
+			fill("AFPToFTool", numberOfHit_S3);
+		}
+
+		if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
+		{
+	    	fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], trainID, barInTrainID);
+		}	
 	}
-	else if(hitsItr->isSideC())
-	{
-	    numberOfHit_S3 = hitsItr->trainID();
-            fill("AFPToFTool", numberOfHit_S3);
-	}
-
-	if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
-	    fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], trainID, barInTrainID);
-	
-    }
 
     return StatusCode::SUCCESS;
 }
-- 
GitLab


From ea033e892978a98211d0da904d2006b183c8dc0a Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 10 Jun 2020 18:46:31 +0200
Subject: [PATCH 067/422] Commit for test

---
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 129 ++++++++++--------
 .../src/AFPSiLayerAlgorithm.cxx               |  74 ++++++++++
 2 files changed, 145 insertions(+), 58 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 77909efd27d1..3d12fa474b4c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -10,79 +10,92 @@
 '''
 
 def Run3AFPExampleMonitoringConfig(inputFlags):
-	'''Function to configures some algorithms in the monitoring system.'''
+    '''Function to configures some algorithms in the monitoring system.'''
 
-	from AthenaMonitoring import AthMonitorCfgHelper
-	helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
+    from AthenaMonitoring import AthMonitorCfgHelper
+    helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
     
-	from AthenaConfiguration.ComponentFactory import CompFactory
+    from AthenaConfiguration.ComponentFactory import CompFactory
 
-	#from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
-	afpSiLayerAlgorithmFac = CompFactory.AFPSiLayerAlgorithm
-	afpSiLayerAlgorithm = helper.addAlgorithm(afpSiLayerAlgorithmFac,'AFPSiLayerAlg')
+    #from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
+    afpSiLayerAlgorithmFac = CompFactory.AFPSiLayerAlgorithm
+    afpSiLayerAlgorithm = helper.addAlgorithm(afpSiLayerAlgorithmFac,'AFPSiLayerAlg')
 
-	#from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPToFAlgorithm
-	afpToFAlgorithmFac = CompFactory.AFPToFAlgorithm
-	afpToFAlgorithm = helper.addAlgorithm(afpToFAlgorithmFac,'AFPToFAlg')
+    #from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPToFAlgorithm
+    afpToFAlgorithmFac = CompFactory.AFPToFAlgorithm
+    afpToFAlgorithm = helper.addAlgorithm(afpToFAlgorithmFac,'AFPToFAlg')
 
-	# Add a generic monitoring tool (a "group" in old language). The returned 
-	# object here is the standard GenericMonitoringTool.
-	AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
-	AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
+    # Add a generic monitoring tool (a "group" in old language). The returned 
+    # object here is the standard GenericMonitoringTool.
+    AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
+    AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
-	AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/',xbins=1000,xmin=-0.5,xmax=999.5 ) 
-	AFPToFGroup.defineHistogram('lb,nTofHits', title='Luminosity Block;lb;total number of Hits', type='TProfile',  path='ToF/',xbins=1000,xmin=-0.5,xmax=999.5) 
+    AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/',xbins=1000,xmin=-0.5,xmax=999.5) 
+	AFPSiGroup.defineHistogram('layerNumber,layerEfficiency', title='LayerEfficiency as a function of a lumiblock;layerNumber;layerEfficiency',type='TH2F',path='SiT/',xbins = 17,xmin=-0.5,xmax=16.5,ybins=100,ymin=0,ymax=100)
 
-	AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
-	AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
+    AFPToFGroup.defineHistogram('lb,nTofHits', title='Luminosity Block;lb;total number of Hits', type='TProfile',  path='ToF/',xbins=1000,xmin=-0.5,xmax=999.5) 
+    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
+    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
 
-	# Using a map of groups
-	layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
-	combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
 
-	array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
-	array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-	array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
-	array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1};pixelColIDChip;pixelRowIDChip', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-	array.defineHistogram('timeOverThreshold', type='TH1F', title='1D Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
-	array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    # Using a map of groups
+    layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
+    combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
 
-	arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
-	arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
-	arrayOneList.defineHistogram('trackX,trackY', title='Track posistion position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)   
+    array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
+    array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
+    array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
+    array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1};pixelColIDChip;pixelRowIDChip', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    array.defineHistogram('timeOverThreshold', type='TH1F', title='1D Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
+    array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
 
-	# Finalize. The return value should be a tuple of the ComponentAccumulator
-	return helper.result()
+
+    array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/Track/')
+    array.defineHistogram('trackX,trackY', title='Track posistion position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+
+
+
+    arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
+    arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
+
+    # Finalize. The return value should be a tuple of the ComponentAccumulator
+    return helper.result()
     
 
 if __name__=='__main__':
-	# Setup the Run III behavior
-	from AthenaCommon.Configurable import Configurable
-	Configurable.configurableRun3Behavior = 1
-
-	# Setup logs
-	from AthenaCommon.Logging import log
-	from AthenaCommon.Constants import INFO
-	log.setLevel(INFO)
-
-	# Set the Athena configuration flags
-	from AthenaConfiguration.AllConfigFlags import ConfigFlags
-	nightly = ''
-	file = '/afs/cern.ch/user/l/ladamczy/public/data18_13TeV.00354309.physics_Main.ESD._lb0130._SFO-1._0001.data.r21'
-
-	ConfigFlags.Input.Files = [nightly+file]
-	ConfigFlags.Input.isMC = False
-	ConfigFlags.Output.HISTFileName = 'AFPOutput.root'
+    # Setup the Run III behavior
+    from AthenaCommon.Configurable import Configurable
+    Configurable.configurableRun3Behavior = 1
+
+    # Setup logs
+    from AthenaCommon.Logging import log
+    from AthenaCommon.Constants import INFO
+    log.setLevel(INFO)
+
+    # Set the Athena configuration flags
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    nightly = ''
+    #file ='/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' 
+    #file = '/afs/cern.ch/user/l/ladamczy/public/data17_13TeV.00337176.calibration_AFP.AOD.pool.root'
+    file='/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00361795.calibration_AFP.AODV1_EXT0'
+
+    
+    ConfigFlags.Input.Files = [nightly+file]
+    ConfigFlags.Input.isMC = False
+    ConfigFlags.Output.HISTFileName = 'AFPOutput.root'
     
-	ConfigFlags.lock()
+    ConfigFlags.lock()
+
+    # Initialize configuration object, add accumulator, merge, and run.
+    from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
+    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+    cfg = MainServicesCfg(ConfigFlags)
+    cfg.merge(PoolReadCfg(ConfigFlags))
+
+    exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
+    cfg.merge(exampleMonitorAcc)
+
+    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
 
-	# Initialize configuration object, add accumulator, merge, and run.
-	from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg 
-	from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-	cfg = MainServicesSerialCfg()
-	cfg.merge(PoolReadCfg(ConfigFlags))
 
-	exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
-	cfg.merge(exampleMonitorAcc)
 
-	cfg.run(10000) #use cfg.run(20) to only run on first 20 events
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index aa126b716ee4..e55423ccc41e 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -31,6 +31,7 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
  
 	m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
 	m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
+
 	// We must declare to the framework in initialize what SG objects we are going to use:
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
 	ATH_CHECK(m_afpHitContainerKey.initialize());
@@ -42,6 +43,10 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	using namespace Monitored;
 
+	// Local variables:
+	unsigned int numberOfHits[16];
+	float eff;
+
 	// Declare the quantities which should be monitored:
 	auto lb = Monitored::Scalar<int>("lb", 0); 
 	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
@@ -52,6 +57,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	auto clusterY = Monitored::Scalar<float>("clusterY", 0.0); 
 	auto trackX = Monitored::Scalar<float>("trackX", 0.0);
 	auto trackY = Monitored::Scalar<float>("trackY", 0.0);
+	auto layerEfficiency = Monitored::Scalar<float>("layerEfficiency", 0.0);
+	auto layerNumber = Monitored::Scalar<int>("layerNumber", 0);
     
 	lb = GetEventInfo(ctx)->lumiBlock();
  
@@ -81,8 +88,75 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);	
 		}
 			else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
+
+		if(hitsItr->stationID == 0)
+		{
+			if(hitsItr->pixelLayerID == 0)
+			{
+			}
+			if(hitsItr->pixelLayerID == 1)
+			{
+			}
+			if(hitsItr->pixelLayerID == 2)
+			{
+			}
+			if(hitsItr->pixelLayerID == 3)
+			{
+			}
 		}
 
+		if(hitsItr->stationID == 1)
+		{
+			if(hitsItr->pixelLayerID == 0)
+			{
+			}
+			if(hitsItr->pixelLayerID == 1)
+			{
+			}
+			if(hitsItr->pixelLayerID == 2)
+			{
+			}
+			if(hitsItr->pixelLayerID == 3)
+			{
+			}
+		}
+
+		if(hitsItr->stationID == 2)
+		{
+			if(hitsItr->pixelLayerID == 0)
+			{
+			}
+			if(hitsItr->pixelLayerID == 1)
+			{
+			}
+			if(hitsItr->pixelLayerID == 2)
+			{
+			}
+			if(hitsItr->pixelLayerID == 3)
+			{
+			}
+		}
+
+		if(hitsItr->stationID == 3)
+		{
+			if(hitsItr->pixelLayerID == 0)
+			{
+			}
+			if(hitsItr->pixelLayerID == 1)
+			{
+			}
+			if(hitsItr->pixelLayerID == 2)
+			{
+			}
+			if(hitsItr->pixelLayerID == 3)
+			{
+			}
+		}
+
+		
+	}
+	// Filling of layerEff 2D histogram
+
 	AFPMon::AFPFastReco fast(afpHitContainer.get());
 	fast.reco();
 
-- 
GitLab


From e783eeda1722139e93e593904de6e57586c6df40 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Tue, 23 Jun 2020 15:55:31 +0100
Subject: [PATCH 068/422] Include FTF in newJO

---
 .../TrigInDetConfig/python/TrigInDetConfig.py    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
index a5fceef39452..a99acc9d131a 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
@@ -360,6 +360,22 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
 
   acc.addEventAlgo(InDetSiTrackerSpacePointFinder)
 
+  acc.addPublicTool( CompFactory.TrigL2LayerNumberTool( "TrigL2LayerNumberTool_FTF" ) )
+  acc.addPublicTool( CompFactory.Trk.TrackSummaryTool( "InDetTrigFastTrackSummaryTool" ) )
+  acc.addPublicTool( CompFactory.TrigL2ResidualCalculator( "TrigL2ResidualCalculator" ) )
+  acc.addPublicTool( CompFactory.InDet.SiTrackMaker_xk( "InDetTrigSiTrackMaker_FTF" + signature ) )
+  acc.addPublicTool( CompFactory.TrigInDetTrackFitter( "TrigInDetTrackFitter" ) )
+  acc.addPublicTool( CompFactory.TrigSpacePointConversionTool( "TrigSpacePointConversionTool" + signature ) )
+
+  ftf = CompFactory.TrigFastTrackFinder( name = "TrigFastTrackFinder" + signature,
+                                         LayerNumberTool          = acc.getPublicTool( "TrigL2LayerNumberTool_FTF" ),
+                                         SpacePointProviderTool   = acc.getPublicTool( "TrigSpacePointConversionTool" + signature ),
+                                         TrackSummaryTool         = acc.getPublicTool( "InDetTrigFastTrackSummaryTool" ),
+                                         TrigL2ResidualCalculator = acc.getPublicTool( "TrigL2ResidualCalculator" ),
+                                         initialTrackMaker        = acc.getPublicTool( "InDetTrigSiTrackMaker_FTF" + signature ),
+                                         trigInDetTrackFitter     = acc.getPublicTool( "TrigInDetTrackFitter" ),
+                                         trigZFinder = CompFactory.TrigZFinder(), )
+  acc.addEventAlgo( ftf )
 
   #CondSvc=CompFactory.CondSvc
   #acc.addService(CondSvc())
-- 
GitLab


From 4661993185dd9c4f73abad362872e0602964db2b Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Thu, 25 Jun 2020 14:48:29 +0100
Subject: [PATCH 069/422] Configured  SiTrackMaker_xk

---
 .../TrigInDetConfig/python/TrigInDetConfig.py | 141 +++++++++++++++++-
 1 file changed, 138 insertions(+), 3 deletions(-)

diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
index a99acc9d131a..7286f9b6acd8 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
@@ -5,6 +5,137 @@
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 
+def RungeKuttaPropagatorCfg(flags, **kwargs):
+  acc = ComponentAccumulator()
+  name = kwargs.pop("propagatorName", "InDetTrigPatternPropagator")
+  acc.addPublicTool( CompFactory.Trk.RungeKuttaPropagator( name ) )
+  return acc
+
+def SiDetElementsRoadMaker_xkCfg( flags, **kwargs ):
+  """
+  based  on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py, should be moved elsewhere
+  """
+  acc = ComponentAccumulator()
+  name = kwargs.pop( "rodMakerName", "InDetTrigSiDetElementsRoadMaker" )
+  acc.merge( RungeKuttaPropagatorCfg( flags, **kwargs ) )
+  tool = CompFactory.InDet.SiDetElementsRoadMaker_xk( name,
+                                                      PropagatorTool = acc.getPublicTool( "InDetTrigPatternPropagator" ),
+                                                      usePixel     = flags.Detector.PixelOn, # DetFlags.haveRIO.pixel_on(),
+                                                      useSCT       = flags.Detector.SCTOn, #DetFlags.haveRIO.SCT_on(),
+                                                      RoadWidth    = 10, #InDetTrigCutValues.RoadWidth()
+                                                        )
+  acc.addPublicTool( tool )
+  return acc
+
+def PixelClusterOnTrackCfg( flags, **kwargs ):
+  """
+  based on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
+  """
+  acc = ComponentAccumulator()
+  name =  kwargs.pop("pixelOnTrackName", "InDetTrigPixelClusterOnTrackTool")
+  from SiLorentzAngleTool.PixelLorentzAngleConfig import PixelLorentzAngleCfg
+
+  pixelLATool = acc.popToolsAndMerge( PixelLorentzAngleCfg( flags) )
+  acc.addPublicTool( pixelLATool )
+
+  nnTool = CompFactory.InDet.NnClusterizationFactory( name                         = "TrigNnClusterizationFactory",
+                                                      PixelLorentzAngleTool        = pixelLATool,
+                                                      useToT                       = flags.InDet.doNNToTCalibration,
+                                                      NnCollectionReadKey          = 'PixelClusterNN',
+                                                      NnCollectionWithTrackReadKey = 'PixelClusterNNWithTrack')
+
+  tool = CompFactory.InDet.PixelClusterOnTrackTool( name,
+                                                    ErrorStrategy = 2,
+                                                    LorentzAngleTool = acc.getPublicTool( "PixelLorentzAngleTool" ),
+                                                    NnClusterizationFactory = nnTool )
+  acc.addPublicTool( tool )
+  return acc
+
+
+def SCT_ClusterOnTrackToolCfg( flags, **kwargs ):
+  acc = ComponentAccumulator()
+  from SiLorentzAngleTool.SCT_LorentzAngleConfig import SCT_LorentzAngleCfg
+  sctLATool =  acc.popToolsAndMerge( SCT_LorentzAngleCfg( flags ) )
+  acc.addPublicTool( sctLATool )
+  tool = CompFactory.InDet.SCT_ClusterOnTrackTool("SCT_ClusterOnTrackTool",
+                                                    CorrectionStrategy = 0,  # do correct position bias
+                                                    ErrorStrategy      = 2,  # do use phi dependent errors
+                                                    LorentzAngleTool   = acc.getPublicTool( "SCT_LorentzAngleTool" ) # default name
+                                                    )
+  acc.addPublicTool ( tool )
+  return acc
+
+def RIO_OnTrackCreatorCfg( flags, **kwargs ):
+  acc = ComponentAccumulator()
+  name =  kwargs.pop("rioOnTrackCreatorName", "InDetTrigRotCreator")
+  acc.merge( PixelClusterOnTrackCfg( flags, **kwargs ) )
+  acc.merge( SCT_ClusterOnTrackToolCfg( flags, **kwargs ) )
+  tool = CompFactory.Trk.RIO_OnTrackCreator(name,
+                                              ToolPixelCluster= acc.getPublicTool( "InDetTrigPixelClusterOnTrackTool" ), #InDetTrigPixelClusterOnTrackTool,
+                                              ToolSCT_Cluster = acc.getPublicTool( "SCT_ClusterOnTrackTool" ),
+                                              Mode = 'indet')
+  acc.addPublicTool( tool )
+  return acc
+
+def SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ):
+  """
+  based  on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py, should be moved elsewhere
+  """
+  acc = ComponentAccumulator()
+  name = kwargs.pop( "combinatorialTrackFinderName", "InDetTrigSiComTrackFinder" )
+  acc.merge( RungeKuttaPropagatorCfg( flags, **kwargs ) )
+  acc.addPublicTool( CompFactory.Trk.KalmanUpdator_xk( "InDetTrigPatternUpdator" ) )
+  acc.merge( RIO_OnTrackCreatorCfg( flags, **kwargs ) )
+
+  from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg
+  pixelCondSummaryTool = acc.popToolsAndMerge( PixelConditionsSummaryCfg(flags) )
+
+  from InDetConfig.InDetRecToolConfig import InDetSCT_ConditionsSummaryToolCfg
+  sctCondSummaryTool = acc.popToolsAndMerge( InDetSCT_ConditionsSummaryToolCfg( flags,withFlaggedCondTool=False, withTdaqTool=False ) )
+
+
+  tool = CompFactory.InDet.SiCombinatorialTrackFinder_xk(name,
+                                                         PropagatorTool = acc.getPublicTool( "InDetTrigPatternPropagator" ),
+                                                         UpdatorTool    = acc.getPublicTool( "InDetTrigPatternUpdator" ),
+                                                         RIOonTrackTool   = acc.getPublicTool( "InDetTrigRotCreator" ),
+                                                         usePixel         = flags.Detector.PixelOn, #DetFlags.haveRIO.pixel_on(),
+                                                         useSCT           =  flags.Detector.SCTOn, #DetFlags.haveRIO.SCT_on(),
+                                                         PixelClusterContainer = 'PixelTrigClusters',
+                                                         SCT_ClusterContainer = 'SCT_TrigClusters',
+                                                         PixelSummaryTool = pixelCondSummaryTool,
+                                                         SctSummaryTool = sctCondSummaryTool
+                                                        )
+  acc.addPublicTool( tool )
+  return acc
+
+def SiTrackMaker_xkCfg(flags, **kwargs):
+  """
+  based on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecNewTracking.py , should be moved elsewhere
+  """
+  import AthenaCommon.SystemOfUnits as Unit
+  name = kwargs.pop("name", "SiTrackMaker_xk")
+  acc = ComponentAccumulator()
+  acc.merge( SiDetElementsRoadMaker_xkCfg( flags, **kwargs ) )
+  acc.merge( SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ) )
+  tool = CompFactory.InDet.SiTrackMaker_xk( name,
+                                            RoadTool = acc.getPublicTool( "InDetTrigSiDetElementsRoadMaker" ),
+                                            CombinatorialTrackFinder =acc.getPublicTool( "InDetTrigSiComTrackFinder" ),
+                                            pTmin = 100*Unit.MeV, # TODO use flag for these props
+                                            nClustersMin   = 1,
+                                            nHolesMax      = 10,
+                                            nHolesGapMax   = 1,
+                                            SeedsFilterLevel = 1,
+                                            Xi2max         = 15,
+                                            Xi2maxNoAdd    = 35,
+                                            nWeightedClustersMin= 6,
+                                            #CosmicTrack              = InDetFlags.doCosmics(),
+                                            Xi2maxMultiTracks         = 15,
+                                            UseAssociationTool       = False )
+  acc.addPublicTool( tool )
+  return acc
+
+
+
 class InDetCacheNames(object):
   Pixel_ClusterKey   = "PixelTrigClustersCache"
   SCT_ClusterKey     = "SCT_ClustersCache"
@@ -32,6 +163,7 @@ def InDetIDCCacheCreatorCfg():
   acc.addEventAlgo( InDetCacheCreatorTrig )
   return acc
 
+
 #Set up conditions algorithms
 def TrigInDetCondConfig( flags ):
 
@@ -47,8 +179,10 @@ def TrigInDetCondConfig( flags ):
   acc.merge(addFoldersSplitOnline(flags, "INDET","/Indet/Onl/AlignL3","/Indet/AlignL3",className="AlignableTransformContainer"))
   acc.merge(addFoldersSplitOnline(flags, "INDET","/Indet/Onl/IBLDist","/Indet/IBLDist",className="CondAttrListCollection"))
 
-  SCT_DCSConditionsTool=CompFactory.SCT_DCSConditionsTool
-  dcsTool = SCT_DCSConditionsTool(ReadAllDBFolders = True, ReturnHVTemp = True)
+  from SCT_ConditionsTools.SCT_DCSConditionsConfig import SCT_DCSConditionsCfg, SCT_DCSConditionsToolCfg
+  dcsTool =  acc.popToolsAndMerge( SCT_DCSConditionsCfg( flags, DCSConditionsTool = SCT_DCSConditionsToolCfg( flags, ReadAllDBFolders = True, ReturnHVTemp = True)) )
+#  SCT_DCSConditionsTool=CompFactory.SCT_DCSConditionsTool
+#  dcsTool = SCT_DCSConditionsTool(ReadAllDBFolders = True, ReturnHVTemp = True)
 
   from SCT_ConditionsTools.SCT_SiliconConditionsConfig import SCT_SiliconConditionsToolCfg, SCT_SiliconConditionsCfg
   #sctSiliconConditionsTool= SCT_SiliconConditionsCfg(flags, toolName="InDetSCT_SiliconConditionsTool", dcsTool=dcsTool )
@@ -363,7 +497,8 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   acc.addPublicTool( CompFactory.TrigL2LayerNumberTool( "TrigL2LayerNumberTool_FTF" ) )
   acc.addPublicTool( CompFactory.Trk.TrackSummaryTool( "InDetTrigFastTrackSummaryTool" ) )
   acc.addPublicTool( CompFactory.TrigL2ResidualCalculator( "TrigL2ResidualCalculator" ) )
-  acc.addPublicTool( CompFactory.InDet.SiTrackMaker_xk( "InDetTrigSiTrackMaker_FTF" + signature ) )
+  acc.merge( SiTrackMaker_xkCfg( flags, name = "InDetTrigSiTrackMaker_FTF"+signature ) )
+
   acc.addPublicTool( CompFactory.TrigInDetTrackFitter( "TrigInDetTrackFitter" ) )
   acc.addPublicTool( CompFactory.TrigSpacePointConversionTool( "TrigSpacePointConversionTool" + signature ) )
 
-- 
GitLab


From 4e3f6d699e1758ec25cb85d3b3dd9542a364e8c8 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 26 Jun 2020 09:44:23 +0100
Subject: [PATCH 070/422] Next step, summary tool configured

---
 .../TrigInDetConfig/python/TrigInDetConfig.py | 159 +++++++++++++++---
 1 file changed, 134 insertions(+), 25 deletions(-)

diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
index 7286f9b6acd8..0ae34807ea1e 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
@@ -71,9 +71,9 @@ def RIO_OnTrackCreatorCfg( flags, **kwargs ):
   acc.merge( PixelClusterOnTrackCfg( flags, **kwargs ) )
   acc.merge( SCT_ClusterOnTrackToolCfg( flags, **kwargs ) )
   tool = CompFactory.Trk.RIO_OnTrackCreator(name,
-                                              ToolPixelCluster= acc.getPublicTool( "InDetTrigPixelClusterOnTrackTool" ), #InDetTrigPixelClusterOnTrackTool,
-                                              ToolSCT_Cluster = acc.getPublicTool( "SCT_ClusterOnTrackTool" ),
-                                              Mode = 'indet')
+                                            ToolPixelCluster = acc.getPublicTool( "InDetTrigPixelClusterOnTrackTool" ), #InDetTrigPixelClusterOnTrackTool,
+                                            ToolSCT_Cluster  = acc.getPublicTool( "SCT_ClusterOnTrackTool" ),
+                                            Mode             = 'indet')
   acc.addPublicTool( tool )
   return acc
 
@@ -95,15 +95,15 @@ def SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ):
 
 
   tool = CompFactory.InDet.SiCombinatorialTrackFinder_xk(name,
-                                                         PropagatorTool = acc.getPublicTool( "InDetTrigPatternPropagator" ),
-                                                         UpdatorTool    = acc.getPublicTool( "InDetTrigPatternUpdator" ),
-                                                         RIOonTrackTool   = acc.getPublicTool( "InDetTrigRotCreator" ),
-                                                         usePixel         = flags.Detector.PixelOn, #DetFlags.haveRIO.pixel_on(),
-                                                         useSCT           =  flags.Detector.SCTOn, #DetFlags.haveRIO.SCT_on(),
+                                                         PropagatorTool        = acc.getPublicTool( "InDetTrigPatternPropagator" ),
+                                                         UpdatorTool           = acc.getPublicTool( "InDetTrigPatternUpdator" ),
+                                                         RIOonTrackTool        = acc.getPublicTool( "InDetTrigRotCreator" ),
+                                                         usePixel              = flags.Detector.PixelOn, #DetFlags.haveRIO.pixel_on(),
+                                                         useSCT                = flags.Detector.SCTOn, #DetFlags.haveRIO.SCT_on(),
                                                          PixelClusterContainer = 'PixelTrigClusters',
-                                                         SCT_ClusterContainer = 'SCT_TrigClusters',
-                                                         PixelSummaryTool = pixelCondSummaryTool,
-                                                         SctSummaryTool = sctCondSummaryTool
+                                                         SCT_ClusterContainer  = 'SCT_TrigClusters',
+                                                         PixelSummaryTool      = pixelCondSummaryTool,
+                                                         SctSummaryTool        = sctCondSummaryTool
                                                         )
   acc.addPublicTool( tool )
   return acc
@@ -117,24 +117,132 @@ def SiTrackMaker_xkCfg(flags, **kwargs):
   acc = ComponentAccumulator()
   acc.merge( SiDetElementsRoadMaker_xkCfg( flags, **kwargs ) )
   acc.merge( SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ) )
+
   tool = CompFactory.InDet.SiTrackMaker_xk( name,
-                                            RoadTool = acc.getPublicTool( "InDetTrigSiDetElementsRoadMaker" ),
-                                            CombinatorialTrackFinder =acc.getPublicTool( "InDetTrigSiComTrackFinder" ),
-                                            pTmin = 100*Unit.MeV, # TODO use flag for these props
-                                            nClustersMin   = 1,
-                                            nHolesMax      = 10,
-                                            nHolesGapMax   = 1,
-                                            SeedsFilterLevel = 1,
-                                            Xi2max         = 15,
-                                            Xi2maxNoAdd    = 35,
-                                            nWeightedClustersMin= 6,
-                                            #CosmicTrack              = InDetFlags.doCosmics(),
-                                            Xi2maxMultiTracks         = 15,
+                                            RoadTool                 = acc.getPublicTool( "InDetTrigSiDetElementsRoadMaker" ),
+                                            CombinatorialTrackFinder = acc.getPublicTool( "InDetTrigSiComTrackFinder" ),
+                                            pTmin                    = 100*Unit.MeV, # TODO use flag for these props
+                                            nClustersMin             = 7,
+                                            nHolesMax                = 3,
+                                            nHolesGapMax             = 3,
+                                            SeedsFilterLevel         = 0,
+                                            Xi2max                   = 15,
+                                            Xi2maxNoAdd              = 35,
+                                            nWeightedClustersMin     = 6,
+                                            #CosmicTrack             = InDetFlags.doCosmics(),
+                                            Xi2maxMultiTracks        = 15,
                                             UseAssociationTool       = False )
   acc.addPublicTool( tool )
   return acc
 
 
+# def (flags, **kwargs):
+#   acc = ComponentAccumulator()
+
+#   tool = CompFactory.
+#   acc.addPublicTool( tool )
+#   return acc
+
+
+# def (flags, **kwargs):
+#   acc = ComponentAccumulator()
+
+#   tool = CompFactory.
+#   acc.addPublicTool( tool )
+#   return acc
+
+
+def InDetTestPixelLayerToolCfg(flags, **kwargs):
+  acc = ComponentAccumulator()
+  from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg
+  pixelCondSummaryTool = acc.popToolsAndMerge( PixelConditionsSummaryCfg(flags) )
+  from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg
+  extrapolator = acc.popToolsAndMerge( InDetExtrapolatorCfg( flags, name = "TrigInDetExtrapolator" ) )
+
+  tool = CompFactory.InDet.InDetTestPixelLayerTool("InDetTrigTestPixelLayerTool",
+                                                               PixelSummaryTool = pixelCondSummaryTool,
+                                                               Extrapolator     = extrapolator,
+                                                               CheckActiveAreas = True,
+                                                               CheckDeadRegions = True)
+  acc.addPublicTool( tool )
+  return acc
+
+
+def InDetHoleSearchToolCfg(flags, **kwargs):
+  acc = ComponentAccumulator()
+
+  from InDetConfig.InDetRecToolConfig import InDetSCT_ConditionsSummaryToolCfg
+  sctCondSummaryTool = acc.popToolsAndMerge( InDetSCT_ConditionsSummaryToolCfg( flags,withFlaggedCondTool=False, withTdaqTool=False ) )
+
+  acc.merge( InDetTestPixelLayerToolCfg( flags, **kwargs ) )
+
+  from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg
+  acc.merge( InDetExtrapolatorCfg( flags, name = "TrigInDetExtrapolator" ) )
+  #acc.addPublicTool(extrapolator)
+
+  name = kwargs.pop("name", "InDetTrigHoleSearchTool")
+  tool = CompFactory.InDet.InDetTrackHoleSearchTool(name,
+                                                    Extrapolator =  acc.getPublicTool( "TrigInDetExtrapolator" ),
+                                                    usePixel      = flags.Detector.PixelOn, #DetFlags.haveRIO.pixel_on(),
+                                                    useSCT        = flags.Detector.SCTOn, #DetFlags.haveRIO.SCT_on(),
+                                                    SctSummaryTool = sctCondSummaryTool,
+                                                    PixelLayerTool = acc.getPublicTool( "InDetTrigTestPixelLayerTool" ),
+                                                    )
+  acc.addPublicTool( tool )
+  return acc
+
+def InDetTrackSummaryHelperToolCfg(flags, **kwargs):
+  """
+  based on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
+  """
+  acc = ComponentAccumulator()
+  name = kwargs.pop("name", "InDetSummaryHelperTool")
+  acc.merge( InDetHoleSearchToolCfg(flags, name = "InDetTrigHoleSearchTool" ) )
+
+  acc.addPublicTool( CompFactory.InDet.InDetPRD_AssociationToolGangedPixels(name = "InDetTrigPrdAssociationTool",
+                                                              PixelClusterAmbiguitiesMapName = "TrigPixelClusterAmbiguitiesMap") )
+
+  from InDetOverlay.TRT_ConditionsConfig import TRTStrawCondAlgCfg,TRT_StrawStatusSummaryToolCfg # this will be moved somewhere else so this import will need adjustment
+  acc.merge( TRTStrawCondAlgCfg(flags) )
+  trtStrawSummaryTool = acc.popToolsAndMerge( TRT_StrawStatusSummaryToolCfg(flags) )
+
+  tool = CompFactory.InDet.InDetTrackSummaryHelperTool(name,
+                                                       HoleSearch    = acc.getPublicTool( "InDetTrigHoleSearchTool" ),
+                                                       AssoTool      = acc.getPublicTool( "InDetTrigPrdAssociationTool" ),
+                                                       TestBLayerTool = None,
+                                                       PixelToTPIDTool= None, #InDetTrigPixelToTPIDTool,
+                                                       DoSharedHits  = False,
+                                                       TRTStrawSummarySvc = trtStrawSummaryTool,
+                                                       usePixel      = flags.Detector.PixelOn,  #DetFlags.haveRIO.pixel_on(),
+                                                       useSCT        = flags.Detector.SCTOn,  #DetFlags.haveRIO.SCT_on(),
+                                                       useTRT        = True, # flags.Detector.TRTOn,  #DetFlags.haveRIO.TRT_on()
+                                                         )
+
+  acc.addPublicTool( tool )
+  return acc
+
+def TrackSummaryToolCfg(flags, **kwargs):
+  acc = ComponentAccumulator()
+  name = kwargs.pop("name", "InDetTrackSummaryTool")
+  summaryHelperTool = kwargs.pop( "summaryHelperTool", None )
+  if not summaryHelperTool:
+    acc.merge( InDetTrackSummaryHelperToolCfg( flags ) )
+    summaryHelperTool = acc.getPublicTool( "InDetSummaryHelperTool" )
+
+
+  tool = CompFactory.Trk.TrackSummaryTool(name = name,
+                                          InDetSummaryHelperTool = summaryHelperTool,
+                                          doSharedHits           = False,
+                                          doHolesInDet           = True,
+                                          #this may be temporary #61512 (and used within egamma later)
+                                          #TRT_ElectronPidTool    = InDetTrigTRT_ElectronPidTool,
+                                          TRT_ElectronPidTool    = None,
+                                          )
+
+  acc.addPublicTool( tool )
+  return acc
+
+
 
 class InDetCacheNames(object):
   Pixel_ClusterKey   = "PixelTrigClustersCache"
@@ -495,7 +603,9 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   acc.addEventAlgo(InDetSiTrackerSpacePointFinder)
 
   acc.addPublicTool( CompFactory.TrigL2LayerNumberTool( "TrigL2LayerNumberTool_FTF" ) )
-  acc.addPublicTool( CompFactory.Trk.TrackSummaryTool( "InDetTrigFastTrackSummaryTool" ) )
+
+  acc.merge( TrackSummaryToolCfg(flags, name="InDetTrigFastTrackSummaryTool") )
+
   acc.addPublicTool( CompFactory.TrigL2ResidualCalculator( "TrigL2ResidualCalculator" ) )
   acc.merge( SiTrackMaker_xkCfg( flags, name = "InDetTrigSiTrackMaker_FTF"+signature ) )
 
@@ -579,4 +689,3 @@ if __name__ == "__main__":
     acc.printConfig()
     acc.store( open("test.pkl", "wb") )
     print('All ok')
-
-- 
GitLab


From 61115747de2c6defc0634c416dbcb7e92719f543 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Thu, 2 Jul 2020 15:00:57 +0200
Subject: [PATCH 071/422] Efficiency plots and <mu>

---
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  30 ++--
 .../src/AFPSiLayerAlgorithm.cxx               | 148 ++++++++----------
 2 files changed, 77 insertions(+), 101 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 3d12fa474b4c..971381b48c78 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -30,12 +30,14 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
     AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
-    AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/',xbins=1000,xmin=-0.5,xmax=999.5) 
-	AFPSiGroup.defineHistogram('layerNumber,layerEfficiency', title='LayerEfficiency as a function of a lumiblock;layerNumber;layerEfficiency',type='TH2F',path='SiT/',xbins = 17,xmin=-0.5,xmax=16.5,ybins=100,ymin=0,ymax=100)
+    AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
+    AFPSiGroup.defineHistogram('lb,lumiPerBCID', title='Mu;lumiBlock;<mu>', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
+    #AFPSiGroup.defineHistogram('layerNumber,layerEfficiency', title='LayerEfficiency as a function of a lumiblock;layerNumber;layerEfficiency', type='TH2F', path='SiT/', xbins = 16, xmin=0.5, xmax=16.5, ybins=100, ymin=0, ymax=1)
+    AFPSiGroup.defineHistogram('layerEfficiency', type='TH1F', title='1D layer efficiency;layerEfficiency', path='SiT/', xbins=16, xmin=0.5, xmax=16.5)
 
-    AFPToFGroup.defineHistogram('lb,nTofHits', title='Luminosity Block;lb;total number of Hits', type='TProfile',  path='ToF/',xbins=1000,xmin=-0.5,xmax=999.5) 
-    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
-    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
+    AFPToFGroup.defineHistogram('lb,nTofHits', title='Multiplicity;lb;total number of Hits', type='TProfile', path='ToF/', xbins=1000, xmin=-0.5, xmax=999.5) 
+    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
+    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
 
 
     # Using a map of groups
@@ -51,9 +53,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
 
     array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/Track/')
-    array.defineHistogram('trackX,trackY', title='Track posistion position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-
-
+    array.defineHistogram('trackX,trackY', title='Track position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
 
     arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
     arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
@@ -74,15 +74,17 @@ if __name__=='__main__':
 
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    nightly = ''
+    #nightly = '/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00361795.calibration_AFP.AODV1_EXT0'
+    #file=''
+    #file = '/afs/cern.ch/user/l/ladamczy/public/data18_13TeV.00354309.physics_Main.ESD._lb0130._SFO-1._0001.data.r22'
     #file ='/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' 
     #file = '/afs/cern.ch/user/l/ladamczy/public/data17_13TeV.00337176.calibration_AFP.AOD.pool.root'
-    file='/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00361795.calibration_AFP.AODV1_EXT0'
+    #file = '/afs/cern.ch/user/l/ladamczy/public/data18_13TeV.00354309.physics_Main.ESD._lb0130._SFO-1._0001.data.r22'
 
-    
-    ConfigFlags.Input.Files = [nightly+file]
+    #ConfigFlags.Input.Files = [nightly+file]
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput4.root'
     
     ConfigFlags.lock()
 
@@ -95,7 +97,7 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
+    cfg.run(2000) #use cfg.run(20) to only run on first 20 events
 
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index e55423ccc41e..ac3d41201064 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -8,12 +8,10 @@
 */
 
 #include "Run3AFPMonitoring/AFPSiLayerAlgorithm.h"
+#include <Run3AFPMonitoring/AFPFastReco.h>
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPStationID.h"
 
-#include <Run3AFPMonitoring/AFPFastReco.h>
-
-
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
 , m_afpHitContainerKey("AFPSiHitContainer")
@@ -28,7 +26,7 @@ AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
 
 StatusCode AFPSiLayerAlgorithm::initialize() {
 	using namespace Monitored;
- 
+
 	m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
 	m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
 
@@ -43,25 +41,46 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	using namespace Monitored;
 
-	// Local variables:
-	unsigned int numberOfHits[16];
-	float eff;
+	// Temporary variables:
+	//unsigned int numberOfHitsPerPlane[16]		=	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+	//unsigned int numberOfHitsPerStation[4]	=	{0, 0, 0, 0};
+	
+	static unsigned int numberOfHitsStationPlane[4][4] =	{	{0, 0, 0, 0},
+																													{0, 0, 0, 0},
+																													{0, 0, 0, 0},
+																													{0, 0, 0, 0} };
+	
+	//int i = 0;
+	//float eff = 0.0;
 
 	// Declare the quantities which should be monitored:
-	auto lb = Monitored::Scalar<int>("lb", 0); 
+	auto lb = Monitored::Scalar<int>("lb", 0);
+	auto lumiPerBCID = Monitored::Scalar<float>("lumiPerBCID", 0.0);
+	auto run = Monitored::Scalar<int>("run",0);
+	auto weight = Monitored::Scalar<float>("weight", 1.0);
+
 	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
+
 	auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
 	auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
+
 	auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold", 0.0);
+
 	auto clusterX = Monitored::Scalar<float>("clusterX", 0.0);
 	auto clusterY = Monitored::Scalar<float>("clusterY", 0.0); 
+
 	auto trackX = Monitored::Scalar<float>("trackX", 0.0);
 	auto trackY = Monitored::Scalar<float>("trackY", 0.0);
+
 	auto layerEfficiency = Monitored::Scalar<float>("layerEfficiency", 0.0);
 	auto layerNumber = Monitored::Scalar<int>("layerNumber", 0);
-    
+
 	lb = GetEventInfo(ctx)->lumiBlock();
- 
+	lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
+	//run = GetEventInfo(ctx)->runNumber();
+
+	fill("AFPSiLayerTool", lb, lumiPerBCID);
+
 	SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
 	if(! afpHitContainer.isValid())
 	{
@@ -72,108 +91,63 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	ATH_CHECK( afpHitContainer.initialize() );
 
 	nSiHits = afpHitContainer->size();
-	fill("AFPSiLayerTool", lb, nSiHits);    
+	fill("AFPSiLayerTool", lb, nSiHits);
 
-    for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
-    {
+	for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
+	{
 		pixelRowIDChip = hitsItr->pixelRowIDChip();
 		pixelColIDChip = hitsItr->pixelColIDChip();
 		timeOverThreshold = hitsItr->timeOverThreshold();
+		++numberOfHitsStationPlane[hitsItr->stationID()][hitsItr->pixelLayerID()];
 	
 		if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
 		{
 			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
 			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
 			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
-			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);	
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
 		}
-			else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
+		else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
 
-		if(hitsItr->stationID == 0)
-		{
-			if(hitsItr->pixelLayerID == 0)
-			{
-			}
-			if(hitsItr->pixelLayerID == 1)
-			{
-			}
-			if(hitsItr->pixelLayerID == 2)
-			{
-			}
-			if(hitsItr->pixelLayerID == 3)
-			{
-			}
-		}
+		
+		
+				// Filling of cluster and track 2D histograms
+		AFPMon::AFPFastReco fast(afpHitContainer.get());
+		fast.reco();
 
-		if(hitsItr->stationID == 1)
+		for (const auto& cluster : fast.clusters()) 
 		{
-			if(hitsItr->pixelLayerID == 0)
-			{
-			}
-			if(hitsItr->pixelLayerID == 1)
-			{
-			}
-			if(hitsItr->pixelLayerID == 2)
-			{
-			}
-			if(hitsItr->pixelLayerID == 3)
-			{
-			}
+			clusterX = cluster.x;
+			clusterY = cluster.y;
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterX, clusterY);
 		}
 
-		if(hitsItr->stationID == 2)
+		for (const auto& track : fast.tracks()) 
 		{
-			if(hitsItr->pixelLayerID == 0)
-			{
-			}
-			if(hitsItr->pixelLayerID == 1)
-			{
-			}
-			if(hitsItr->pixelLayerID == 2)
-			{
-			}
-			if(hitsItr->pixelLayerID == 3)
-			{
-			}
+			trackX = track.x;
+			trackY = track.y;
+			fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackX, trackY);
 		}
+	}
 
-		if(hitsItr->stationID == 3)
+	// Filling of layerEff 2D histogram
+	
+	for(int i = 0; i < 4; i++)
+	{
+		unsigned long tempSum = numberOfHitsStationPlane[i][0] + numberOfHitsStationPlane[i][1] + numberOfHitsStationPlane[i][2] + numberOfHitsStationPlane[i][3];
+		if(tempSum>0)
 		{
-			if(hitsItr->pixelLayerID == 0)
-			{
-			}
-			if(hitsItr->pixelLayerID == 1)
-			{
-			}
-			if(hitsItr->pixelLayerID == 2)
-			{
-			}
-			if(hitsItr->pixelLayerID == 3)
+			for(int j = 0; j < 4; j++)
 			{
+				layerNumber = i*4 + j;
+				layerEfficiency = numberOfHitsStationPlane[i][j] / tempSum ;
+				fill("AFPSiLayerTool", layerNumber, layerEfficiency);
+				fill("AFPSiLayerTool", layerEfficiency);
 			}
 		}
-
-		
-	}
-	// Filling of layerEff 2D histogram
-
-	AFPMon::AFPFastReco fast(afpHitContainer.get());
-	fast.reco();
-
-	for (const auto& cluster : fast.clusters()) 
-	{
-		clusterX = cluster.x;
-		clusterY = cluster.y;
-		fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterX, clusterY);
 	}
+	
 
-	for (const auto& track : fast.tracks()) 
-	{
-		trackX = track.x;
-		trackY = track.y;
-		fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackX, trackY);
-	}
- 
 	return StatusCode::SUCCESS;
 }
 
-- 
GitLab


From a8865802caed43443ecfec3ab35262a56a89b191 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Thu, 2 Jul 2020 15:17:59 +0200
Subject: [PATCH 072/422] Fixing titles of histograms

---
 .../python/Run3AFPExampleMonitorAlgorithm.py              | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 971381b48c78..78513797a50d 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -30,7 +30,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
     AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
-    AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
+    AFPSiGroup.defineHistogram('lb,nSiHits', title='Total number of hits;lb;total number of Hits', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
     AFPSiGroup.defineHistogram('lb,lumiPerBCID', title='Mu;lumiBlock;<mu>', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
     #AFPSiGroup.defineHistogram('layerNumber,layerEfficiency', title='LayerEfficiency as a function of a lumiblock;layerNumber;layerEfficiency', type='TH2F', path='SiT/', xbins = 16, xmin=0.5, xmax=16.5, ybins=100, ymin=0, ymax=1)
     AFPSiGroup.defineHistogram('layerEfficiency', type='TH1F', title='1D layer efficiency;layerEfficiency', path='SiT/', xbins=16, xmin=0.5, xmax=16.5)
@@ -45,15 +45,15 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
 
     array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
-    array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-    array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
+    array.defineHistogram('pixelColIDChip', title='Hits per column for {0} layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
+    array.defineHistogram('pixelRowIDChip', title='Hits per row for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
     array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1};pixelColIDChip;pixelRowIDChip', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
     array.defineHistogram('timeOverThreshold', type='TH1F', title='1D Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
     array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
 
 
     array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/Track/')
-    array.defineHistogram('trackX,trackY', title='Track position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    array.defineHistogram('trackX,trackY', title='Track in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
 
     arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
     arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
-- 
GitLab


From a9adfb1a520a97db18bfcdce9a2d4a6cf5fe5d93 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Sat, 4 Jul 2020 14:24:44 +0100
Subject: [PATCH 073/422] Made the FTF to run

---
 .../src/TrigL2CaloHypoAlgMT.cxx               | 31 ++++---
 .../TrigInDetConfig/python/TrigInDetConfig.py | 89 +++++++++++--------
 .../TrigUpgradeTest/share/newJOtest.py        | 13 +--
 .../Electron/generateElectron.py              |  4 +-
 .../HLTMenuConfig/Photon/generatePhoton.py    |  2 +-
 5 files changed, 84 insertions(+), 55 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlgMT.cxx
index 64f2f2487531..abd0b4a78e83 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlgMT.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlgMT.cxx
@@ -20,7 +20,7 @@ StatusCode TrigL2CaloHypoAlgMT::initialize() {
   ATH_CHECK( m_hypoTools.retrieve() );
   
   ATH_CHECK( m_clustersKey.initialize() );
-  ATH_CHECK( m_ringsKey.initialize());
+  ATH_CHECK( m_ringsKey.initialize(SG::AllowEmpty));
 
   renounce( m_clustersKey );// clusters are made in views, so they are not in the EvtStore: hide them
   renounce( m_ringsKey );
@@ -63,25 +63,30 @@ StatusCode TrigL2CaloHypoAlgMT::execute( const EventContext& context ) const {
     ATH_CHECK( clusterHandle.isValid() );
     ATH_MSG_DEBUG ( "Cluster handle size: " << clusterHandle->size() << "..." );
 
+    auto d = newDecisionIn( decisions, name() );
+    
     // get Rings
-    auto ringerShapeHandle = ViewHelper::makeHandle( *viewEL, m_ringsKey, context);
-    ATH_CHECK( ringerShapeHandle.isValid() );
+    const xAOD::TrigRingerRingsContainer* rings = nullptr;    
+    if ( not m_ringsKey.empty() ) {      
+      auto ringerShapeHandle = ViewHelper::makeHandle( *viewEL, m_ringsKey, context);
+      ATH_CHECK( ringerShapeHandle.isValid() );
+      rings = ringerShapeHandle.cptr();	
+      ATH_MSG_DEBUG ( "Ringer handle size: " << ringerShapeHandle->size() << "..." );
+
+      // link the rings      
+      auto el = ViewHelper::makeLink( *viewEL, ringerShapeHandle, 0 );
+      ATH_CHECK( el.isValid() );
+      d->setObjectLink( "ringer",  el );
+      
+    }
 
-    ATH_MSG_DEBUG ( "Ringer handle size: " << ringerShapeHandle->size() << "..." );
 
 
 
     // create new decision
-    auto d = newDecisionIn( decisions, name() );
-
-    toolInput.emplace_back( d, roi, clusterHandle.cptr()->at(0), ringerShapeHandle.cptr()->at(0), previousDecision );
+    toolInput.emplace_back( d, roi, clusterHandle.cptr()->at(0), (rings ? rings->at(0) : nullptr) , previousDecision );
     
-    // link the rings
-    {
-      auto el = ViewHelper::makeLink( *viewEL, ringerShapeHandle, 0 );
-      ATH_CHECK( el.isValid() );
-      d->setObjectLink( "ringer",  el );
-    }
+
     // link the cluster
     { 
       auto clus = ViewHelper::makeLink( *viewEL, clusterHandle, 0 );
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
index c4101a07f0eb..a913420a9fa6 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
@@ -91,7 +91,7 @@ def SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ):
   pixelCondSummaryTool = acc.popToolsAndMerge( PixelConditionsSummaryCfg(flags) )
 
   from InDetConfig.InDetRecToolConfig import InDetSCT_ConditionsSummaryToolCfg
-  sctCondSummaryTool = acc.popToolsAndMerge( InDetSCT_ConditionsSummaryToolCfg( flags,withFlaggedCondTool=False, withTdaqTool=False ) )
+  sctCondSummaryTool = acc.popToolsAndMerge( InDetSCT_ConditionsSummaryToolCfg( flags, withFlaggedCondTool=False, withTdaqTool=False ) )
 
 
   tool = CompFactory.InDet.SiCombinatorialTrackFinder_xk(name,
@@ -272,14 +272,18 @@ def InDetIDCCacheCreatorCfg():
   return acc
 
 
+
+
 #Set up conditions algorithms
-def TrigInDetCondConfig( flags ):
+def TrigInDetCondCfg( flags ):
 
   acc = ComponentAccumulator()
   from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg
   acc.merge(InDetGeometryCfg(flags))
   #acc.merge(InDetGMConfig(flags))
 
+  
+  
   from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline, addFolders
   acc.merge(addFoldersSplitOnline(flags, "INDET","/Indet/Onl/AlignL1/ID","/Indet/AlignL1/ID",className="CondAttrListCollection"))
   acc.merge(addFoldersSplitOnline(flags, "INDET","/Indet/Onl/AlignL2/PIX","/Indet/AlignL2/PIX",className="CondAttrListCollection"))
@@ -323,33 +327,44 @@ def TrigInDetCondConfig( flags ):
   dbInstance = "DCS_OFL"
   acc.merge(addFolders(flags, [stateFolder, hvFolder, tempFolder], dbInstance, className="CondAttrListCollection"))
 
-  SCT_DCSConditionsTempCondAlg=CompFactory.SCT_DCSConditionsTempCondAlg
-  acc.addCondAlgo(SCT_DCSConditionsTempCondAlg( ReadKey = tempFolder ))
-  SCT_DCSConditionsStatCondAlg=CompFactory.SCT_DCSConditionsStatCondAlg
-  acc.addCondAlgo(SCT_DCSConditionsStatCondAlg(ReturnHVTemp = True,
-                                               ReadKeyHV = hvFolder,
-                                               ReadKeyState = stateFolder))
-  SCT_DCSConditionsHVCondAlg=CompFactory.SCT_DCSConditionsHVCondAlg
-  acc.addCondAlgo(SCT_DCSConditionsHVCondAlg(ReadKey = hvFolder))
-
-  SCT_SiliconHVCondAlg=CompFactory.SCT_SiliconHVCondAlg
-  acc.addCondAlgo(SCT_SiliconHVCondAlg(UseState = dcsTool.ReadAllDBFolders,
-                                       DCSConditionsTool = dcsTool))
-  SCT_SiliconTempCondAlg=CompFactory.SCT_SiliconTempCondAlg
-  acc.addCondAlgo(SCT_SiliconTempCondAlg(UseState = dcsTool.ReadAllDBFolders, DCSConditionsTool = dcsTool))
-
-
-  SCTSiLorentzAngleCondAlg=CompFactory.SCTSiLorentzAngleCondAlg
-  acc.addCondAlgo(SCTSiLorentzAngleCondAlg(name = "SCTSiLorentzAngleCondAlg",
-                                           SiConditionsTool = sctSiliconConditionsTool,
-                                           UseMagFieldCache = True,
-                                           UseMagFieldDcs = False))
-  SiLorentzAngleTool=CompFactory.SiLorentzAngleTool
-  SCTLorentzAngleTool = SiLorentzAngleTool(name = "SCTLorentzAngleTool", DetectorName="SCT", SiLorentzAngleCondData="SCTSiLorentzAngleCondData")
-  SCTLorentzAngleTool.UseMagFieldCache = True
-  acc.addPublicTool(SCTLorentzAngleTool)
+
+  # from InDetConfig.InDetRecToolConfig import InDetSCT_ConditionsSummaryToolCfg
+  # sctCondSummaryTool = acc.popToolsAndMerge( InDetSCT_ConditionsSummaryToolCfg( flags, withFlaggedCondTool=False, withTdaqTool=False ) )
+  
+  # SCT_DCSConditionsTempCondAlg=CompFactory.SCT_DCSConditionsTempCondAlg
+  # acc.addCondAlgo(SCT_DCSConditionsTempCondAlg( ReadKey = tempFolder ))
+
+  # SCT_DCSConditionsStatCondAlg=CompFactory.SCT_DCSConditionsStatCondAlg
+  # acc.addCondAlgo(SCT_DCSConditionsStatCondAlg(ReturnHVTemp = True,
+  #                                             ReadKeyHV = hvFolder,
+  #                                             ReadKeyState = stateFolder))
+  # SCT_DCSConditionsHVCondAlg=CompFactory.SCT_DCSConditionsHVCondAlg
+  # acc.addCondAlgo(SCT_DCSConditionsHVCondAlg(ReadKey = hvFolder))
+
+  # SCT_SiliconHVCondAlg=CompFactory.SCT_SiliconHVCondAlg
+  # acc.addCondAlgo(SCT_SiliconHVCondAlg(UseState = dcsTool.ReadAllDBFolders,
+  #                                     DCSConditionsTool = dcsTool))
+  # SCT_SiliconTempCondAlg=CompFactory.SCT_SiliconTempCondAlg
+  # acc.addCondAlgo(SCT_SiliconTempCondAlg(UseState = dcsTool.ReadAllDBFolders, DCSConditionsTool = dcsTool))
 
 
+
+  
+  # SCTSiLorentzAngleCondAlg=CompFactory.SCTSiLorentzAngleCondAlg
+  # acc.addCondAlgo(SCTSiLorentzAngleCondAlg(name = "SCTSiLorentzAngleCondAlg",
+  #                                          SiConditionsTool = sctSiliconConditionsTool,
+  #                                          UseMagFieldCache = True,
+  #                                          UseMagFieldDcs = False))
+  # SiLorentzAngleTool=CompFactory.SiLorentzAngleTool
+  # SCTLorentzAngleTool = SiLorentzAngleTool(name = "SCTLorentzAngleTool", DetectorName="SCT", SiLorentzAngleCondData="SCTSiLorentzAngleCondData")
+  # SCTLorentzAngleTool.UseMagFieldCache = True
+  # acc.addPublicTool(SCTLorentzAngleTool)
+
+
+  from SiLorentzAngleTool.SCT_LorentzAngleConfig import SCT_LorentzAngleCfg
+  SCTLorentzAngleTool =  acc.popToolsAndMerge( SCT_LorentzAngleCfg( flags ) )
+  acc.addPublicTool(SCTLorentzAngleTool)
+  
   acc.merge(addFoldersSplitOnline(flags, "INDET", "/Indet/Onl/Beampos", "/Indet/Beampos", className="AthenaAttributeList"))
   acc.merge(addFolders(flags, "/TRT/Onl/ROD/Compress","TRT_ONL", className='CondAttrListCollection'))
   acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Calib/RT","/TRT/Calib/RT",className="TRTCond::RtRelationMultChanContainer"))
@@ -366,7 +381,7 @@ def TrigInDetCondConfig( flags ):
       PixelHitDiscCnfgAlgCfg, PixelReadoutSpeedAlgCfg, PixelCablingCondAlgCfg,
       PixelDCSCondStateAlgCfg, PixelDCSCondStatusAlgCfg, PixelTDAQCondAlgCfg,
       PixelDistortionAlgCfg, PixelOfflineCalibCondAlgCfg
-# NEW FOR RUN3    PixelDeadMapCondAlgCfg, PixelChargeLUTCalibCondAlgCfg
+# NEW FOR RUN3    PixelDeadMapCondAlgCfg, PixelChargeLUTCalibCondAlgCfg/
   )
 
   from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg
@@ -425,7 +440,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   signature =  "_" + signatureName if signatureName else ''
 
   acc = ComponentAccumulator()
-  acc.merge(TrigInDetCondConfig(flags))
+  acc.merge(TrigInDetCondCfg(flags))
 
   from InDetRecExample.InDetKeys import InDetKeys
 
@@ -594,7 +609,8 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   InDetSiSpacePointMakerTool = InDet__SiSpacePointMakerTool(name = "InDetSiSpacePointMakerTool"+ signature)
   acc.addPublicTool(InDetSiSpacePointMakerTool)
 
-  from AthenaCommon.DetFlags import DetFlags
+  acc.addCondAlgo( CompFactory.InDet.SiElementPropertiesTableCondAlg(name = "InDetSiElementPropertiesTableCondAlg") ) 
+  
   InDet__SiTrackerSpacePointFinder=CompFactory.InDet.SiTrackerSpacePointFinder
   InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(name                   = "InDetSiTrackerSpacePointFinder"+ signature,
                                                                     SiSpacePointMakerTool  = InDetSiSpacePointMakerTool,
@@ -603,12 +619,13 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
                                                                     SpacePointsPixelName   = "PixelTrigSpacePoints",
                                                                     SpacePointsSCTName     = "SCT_TrigSpacePoints",
                                                                     SpacePointsOverlapName = InDetKeys.OverlapSpacePoints(),
-                                                                    ProcessPixels          = DetFlags.haveRIO.pixel_on(),
-                                                                    ProcessSCTs            = DetFlags.haveRIO.SCT_on(),
-                                                                    ProcessOverlaps        = DetFlags.haveRIO.SCT_on(),
+                                                                    ProcessPixels          = flags.Detector.PixelOn, #DetFlags.haveRIO.pixel_on(), # TODO ask Jiri about thes flags again
+                                                                    ProcessSCTs            = flags.Detector.SCTOn, #DetFlags.haveRIO.SCT_on(),
+                                                                    ProcessOverlaps        = flags.Detector.SCTOn, #DetFlags.haveRIO.SCT_on(),
                                                                     SpacePointCacheSCT = InDetCacheNames.SpacePointCacheSCT,
                                                                     SpacePointCachePix = InDetCacheNames.SpacePointCachePix,)
-
+  from AthenaCommon.Constants import DEBUG
+  InDetSiTrackerSpacePointFinder.OutputLevel=DEBUG
   acc.addEventAlgo(InDetSiTrackerSpacePointFinder)
 
   acc.addPublicTool( CompFactory.TrigL2LayerNumberTool( "TrigL2LayerNumberTool_FTF" ) )
@@ -628,7 +645,9 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
                                          TrigL2ResidualCalculator = acc.getPublicTool( "TrigL2ResidualCalculator" ),
                                          initialTrackMaker        = acc.getPublicTool( "InDetTrigSiTrackMaker_FTF" + signature ),
                                          trigInDetTrackFitter     = acc.getPublicTool( "TrigInDetTrackFitter" ),
-                                         trigZFinder = CompFactory.TrigZFinder(), )
+                                         trigZFinder = CompFactory.TrigZFinder()) 
+  ftf.RoIs = roisKey
+  ftf.OutputLevel=DEBUG
   acc.addEventAlgo( ftf )
 
   #CondSvc=CompFactory.CondSvc
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
index 8461b5949533..6668963dc57a 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
@@ -29,7 +29,10 @@ flags.Output.doWriteRDO = True
 flags.Output.RDOFileName = 'RDO_TRIG.pool.root'
 
 flags.Trigger.CostMonitoring.doCostMonitoring = True
-
+flags.Scheduler.CheckDependencies = True
+flags.Scheduler.ShowDataDeps = True
+flags.Scheduler.ShowDataFlow = True
+flags.Scheduler.ShowControlFlow = True
 
 import importlib
 setupMenuPath = "TriggerMenuMT.HLTMenuConfig.Menu."+flags.Trigger.triggerMenuSetup+"_newJO"
@@ -69,9 +72,6 @@ from RegionSelector.RegSelConfig import regSelCfg
 acc.merge( regSelCfg( flags ) )
 
 
-from TrigInDetConfig.TrigInDetConfig import TrigInDetCondConfig
-acc.merge( TrigInDetCondConfig( flags ) )
-
 acc.getEventAlgo( "TrigSignatureMoniMT" ).OutputLevel=DEBUG
 
 
@@ -87,7 +87,10 @@ acc.foreach_component("*HLTTop/*Input*").OutputLevel = DEBUG # input makers
 acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = DEBUG # messaging from the EDM creators
 acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING # silcence mon tools (addressing by type)
 
-acc.printConfig()
+
+
+acc.printConfig(withDetails=False, summariseProps=False)
+
 
 fname = "newJOtest.pkl"
 print( "Storing config in the file {}".format( fname ) )
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
index 2ef3bef81099..660199b4df70 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
@@ -28,7 +28,9 @@ def generateChains( flags,  chainDict ):
     accCalo.merge(l2CaloReco, sequenceName=stepReco.getName())
 
     l2CaloHypo =  l2CaloHypoCfg( flags, name = 'L2ElectronCaloHypo',
-                                 CaloClusters = recordable('HLT_L2CaloEMClusters'))
+                                 CaloClusters = recordable('HLT_L2CaloEMClusters'),
+                               )
+    l2CaloHypo.RingerKey = '' # TODO restore to default or EDM setting once Ringer New JO config is available
 
     accCalo.addEventAlgo(l2CaloHypo, sequenceName=stepView.getName())
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
index c75dc472186d..d777557d1a5a 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
@@ -28,7 +28,7 @@ def generateChains(flags, chainDict):
     l2CaloHypo = l2CaloHypoCfg( flags,
                                 name = 'L2PhotonCaloHypo',
                                 CaloClusters = recordable('HLT_L2CaloEMClusters') )
-
+    l2CaloHypo.RingerKey = '' # TODO restore to default (or setup properly) once New JO Ringer config is available
     accCalo.addEventAlgo(l2CaloHypo, sequenceName=stepView.getName())
 
     fastCaloSequence = CAMenuSequence( Sequence = l2CaloReco.sequence(),
-- 
GitLab


From 705a3a210fae5ed7d859a3139d61a282117c706a Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 10 Jul 2020 08:38:34 +0200
Subject: [PATCH 074/422] Added both approaches for clusters per plane per
 evennt divided by <mu>

---
 .../AFP/Run3AFPMonitoring/CMakeLists.txt      |   6 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  22 +--
 .../src/AFPSiLayerAlgorithm.cxx               | 169 ++++++++++++++----
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx |  12 +-
 4 files changed, 154 insertions(+), 55 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index 1d99ae5b68e4..74c169a2095c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -12,9 +12,9 @@ atlas_depends_on_subdirs(
         Control/AthenaBaseComps
         Control/AthenaMonitoringKernel
         GaudiKernel
-	Event/xAOD/xAODForward
-	xAODForward/AFPSiHit
-	xAODForward/AFPToFHit	
+        Event/xAOD/xAODForward
+        xAODForward/AFPSiHit
+        xAODForward/AFPToFHit	
         LumiBlock/LumiBlockComps
         LumiBlock/LumiBlockData
         Trigger/TrigEvent/TrigDecisionInterface
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 78513797a50d..fb6831758f0c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -31,9 +31,9 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
     AFPSiGroup.defineHistogram('lb,nSiHits', title='Total number of hits;lb;total number of Hits', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
-    AFPSiGroup.defineHistogram('lb,lumiPerBCID', title='Mu;lumiBlock;<mu>', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
-    #AFPSiGroup.defineHistogram('layerNumber,layerEfficiency', title='LayerEfficiency as a function of a lumiblock;layerNumber;layerEfficiency', type='TH2F', path='SiT/', xbins = 16, xmin=0.5, xmax=16.5, ybins=100, ymin=0, ymax=1)
-    AFPSiGroup.defineHistogram('layerEfficiency', type='TH1F', title='1D layer efficiency;layerEfficiency', path='SiT/', xbins=16, xmin=0.5, xmax=16.5)
+    AFPSiGroup.defineHistogram('lb,muPerBCID', title='<mu>;lumiBlock;<mu>', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
+    #AFPSiGroup.defineHistogram('layerNumber,layerEfficiency', title='LayerEfficiency;layerNumber', path='SiT/', xbins = 16, xmin=0.5, xmax=16.5, ybins=100, ymin=0, ymax=1)
+    #AFPSiGroup.defineHistogram('layerEfficiency', type='TH1F', title='1D layer efficiency;layerEfficiency', path='SiT/', xbins=16, xmin=0.5, xmax=16.5)
 
     AFPToFGroup.defineHistogram('lb,nTofHits', title='Multiplicity;lb;total number of Hits', type='TProfile', path='ToF/', xbins=1000, xmin=-0.5, xmax=999.5) 
     AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
@@ -47,13 +47,15 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
     array.defineHistogram('pixelColIDChip', title='Hits per column for {0} layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
     array.defineHistogram('pixelRowIDChip', title='Hits per row for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
-    array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1};pixelColIDChip;pixelRowIDChip', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-    array.defineHistogram('timeOverThreshold', type='TH1F', title='1D Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
-    array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for {0} Layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
+    array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
+    array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
+    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=0.2)
+    array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters in station {0}, layer {1};lb; clustersPerEvent / <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
 
 
     array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/Track/')
-    array.defineHistogram('trackX,trackY', title='Track in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    array.defineHistogram('trackY,trackX', title='Track in station {0};trackX;trackY', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
 
     arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
     arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
@@ -82,9 +84,9 @@ if __name__=='__main__':
     #file = '/afs/cern.ch/user/l/ladamczy/public/data18_13TeV.00354309.physics_Main.ESD._lb0130._SFO-1._0001.data.r22'
 
     #ConfigFlags.Input.Files = [nightly+file]
-    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/00361795/data18_13TeV.00361795.calibration_AFP.daq.AOD._lb0000._SFO-8._0004.pool.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput4.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput20.root'
     
     ConfigFlags.lock()
 
@@ -97,7 +99,7 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    cfg.run(2000) #use cfg.run(20) to only run on first 20 events
+    cfg.run(300000) #use cfg.run(20) to only run on first 20 events
 
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index ac3d41201064..1e038a84596b 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -12,6 +12,13 @@
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPStationID.h"
 
+	unsigned int clusterCounter[1000][4][4];
+	int previouslb = -1;
+	unsigned int counterForEvents = 0;
+	unsigned int counterForEventsFront = 0;
+	unsigned int counterForEventsEnd = 0;
+	unsigned int counterForEventsMiddle = 0;
+
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
 , m_afpHitContainerKey("AFPSiHitContainer")
@@ -34,6 +41,17 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
 	ATH_CHECK(m_afpHitContainerKey.initialize());
 
+	for(int a=0; a<1000; a++)
+	{
+		for(int b=0;b<4;b++)
+		{
+			for(int c=0; c<4; c++)
+			{
+				clusterCounter[a][b][c] = 0;
+			}
+		}
+	}
+
 	return AthMonitorAlgorithm::initialize();
 }
 
@@ -41,25 +59,18 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	using namespace Monitored;
 
-	// Temporary variables:
-	//unsigned int numberOfHitsPerPlane[16]		=	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-	//unsigned int numberOfHitsPerStation[4]	=	{0, 0, 0, 0};
-	
-	static unsigned int numberOfHitsStationPlane[4][4] =	{	{0, 0, 0, 0},
-																													{0, 0, 0, 0},
-																													{0, 0, 0, 0},
-																													{0, 0, 0, 0} };
-	
-	//int i = 0;
-	//float eff = 0.0;
+	static unsigned int numberOfClusterStationPlane[4][4] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} };
+	//static unsigned int lumiBlocks[100];
 
 	// Declare the quantities which should be monitored:
 	auto lb = Monitored::Scalar<int>("lb", 0);
-	auto lumiPerBCID = Monitored::Scalar<float>("lumiPerBCID", 0.0);
+	auto muPerBCID = Monitored::Scalar<float>("muPerBCID", 0.0);
 	auto run = Monitored::Scalar<int>("run",0);
 	auto weight = Monitored::Scalar<float>("weight", 1.0);
 
 	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
+	auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 1.0);
+	auto clustersPerPlane2 = Monitored::Scalar<float>("clustersPerPlane2", 0.0);
 
 	auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
 	auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
@@ -74,12 +85,18 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
 	auto layerEfficiency = Monitored::Scalar<float>("layerEfficiency", 0.0);
 	auto layerNumber = Monitored::Scalar<int>("layerNumber", 0);
-
+	
 	lb = GetEventInfo(ctx)->lumiBlock();
-	lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
+	muPerBCID = lbAverageInteractionsPerCrossing(ctx);
 	//run = GetEventInfo(ctx)->runNumber();
-
-	fill("AFPSiLayerTool", lb, lumiPerBCID);
+	++counterForEvents;
+	//std::cout << "\tBCID: " << GetEventInfo(ctx)->bcid() << std::endl;
+	//if(GetEventInfo(ctx)->bcid() == 63)
+	//{
+	//	++counterForEventsFront;
+	//}
+	//std::cout << "\t\t" << counterForEvents << " lb:" << lb << std::endl;
+	fill("AFPSiLayerTool", lb, muPerBCID);
 
 	SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
 	if(! afpHitContainer.isValid())
@@ -91,14 +108,16 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	ATH_CHECK( afpHitContainer.initialize() );
 
 	nSiHits = afpHitContainer->size();
+	//hitsPerPlane = afpHitContainer->size();
 	fill("AFPSiLayerTool", lb, nSiHits);
-
+	
 	for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
 	{
+		lb = GetEventInfo(ctx)->lumiBlock();
 		pixelRowIDChip = hitsItr->pixelRowIDChip();
 		pixelColIDChip = hitsItr->pixelColIDChip();
 		timeOverThreshold = hitsItr->timeOverThreshold();
-		++numberOfHitsStationPlane[hitsItr->stationID()][hitsItr->pixelLayerID()];
+		
 	
 		if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
 		{
@@ -106,32 +125,108 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
 			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
 			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
+			
 		}
 		else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
+	}
+	
+	// Filling of cluster and track 2D histograms
+	AFPMon::AFPFastReco fast(afpHitContainer.get());
+	fast.reco();
 
-		
-		
-				// Filling of cluster and track 2D histograms
-		AFPMon::AFPFastReco fast(afpHitContainer.get());
-		fast.reco();
+	for (const auto& track : fast.tracks()) 
+	{
+		trackX = track.x;
+		trackY = track.y;
+		fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackY, trackX);
+	}
 
-		for (const auto& cluster : fast.clusters()) 
+// Clusters:
+// Davide's approach
+	for(int i = 0; i < 4; i++)
+	{
+		for(int j = 0; j < 4; j++)
 		{
-			clusterX = cluster.x;
-			clusterY = cluster.y;
-			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterX, clusterY);
+			clustersPerPlane2 = numberOfClusterStationPlane[i][j]*1.0;
+			if(muPerBCID != 0)
+			{
+				clustersPerPlane2 /= (muPerBCID*counterForEvents);
+			}
+			else
+			{
+				clustersPerPlane2 = -99;
+			}
+			//std::cout <<"\t"<< clustersPerPlane2 << std::endl;
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane2);
 		}
+	}
 
-		for (const auto& track : fast.tracks()) 
+// Kris's approach:
+		for(const auto& cluster : fast.clusters()) 
 		{
-			trackX = track.x;
-			trackY = track.y;
-			fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackX, trackY);
+			clusterX = cluster.x;
+			clusterY = cluster.y;
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX); // Swap after suggestion
+			
+			lb = GetEventInfo(ctx)->lumiBlock();
+			++numberOfClusterStationPlane[cluster.station][cluster.layer];
+			
+			// Time for fill - current and previous lb are different, and the previouslb is not -1 (it means - this is not the first lb)
+			if(lb != previouslb && previouslb != -1)
+			{
+				std::cout << "\tlb!=previouslb" << std::endl;
+				for(int i=0; i<4; i++)
+				{
+					for(int j=0; j<4; j++)
+					{
+						clustersPerPlane = clusterCounter[previouslb][i][j]*1.0;
+						if(muPerBCID != 0)
+						{
+							clustersPerPlane = clustersPerPlane/(muPerBCID*counterForEvents);
+						}
+						else
+							{
+								clustersPerPlane = -99;
+							}
+						std::cout << "\tFILL" << std::endl;
+						std::cout << "ClustersPerPlane (it was zero on cernbox): " << clustersPerPlane << std::endl;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
+					}
+				}
+				previouslb = lb;
+				++clusterCounter[lb][cluster.station][cluster.layer];
+				counterForEvents=1;
+				
+				for(int i=0; i<4; i++)
+				{
+					for(int j=0; j<4; j++)
+					{
+						numberOfClusterStationPlane[i][j] = 0;
+					}
+				}
+			}
+			
+			// First time in lumiblock (in plane)
+			else if(clusterCounter[lb][cluster.station][cluster.layer] == 0) 
+			{
+				++clusterCounter[lb][cluster.station][cluster.layer];
+				
+				previouslb = lb;
+				//std::cout << "\tFirst time" << std::endl;
+				//std::cout << "\tLuminosity block: " << lb << std::endl;
+			}
+			
+			// Lumiblock is same, so proceed
+			else if(lb==previouslb)	// Same lumiblock
+			{
+				++clusterCounter[lb][cluster.station][cluster.layer];
+			}
 		}
-	}
+	
+
 
 	// Filling of layerEff 2D histogram
-	
+/*	
 	for(int i = 0; i < 4; i++)
 	{
 		unsigned long tempSum = numberOfHitsStationPlane[i][0] + numberOfHitsStationPlane[i][1] + numberOfHitsStationPlane[i][2] + numberOfHitsStationPlane[i][3];
@@ -140,15 +235,17 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			for(int j = 0; j < 4; j++)
 			{
 				layerNumber = i*4 + j;
-				layerEfficiency = numberOfHitsStationPlane[i][j] / tempSum ;
-				fill("AFPSiLayerTool", layerNumber, layerEfficiency);
+				layerEfficiency = numberOfHitsStationPlane[i][j] / tempSum;
+				layerEfficiency += i*4+j;
+				//fill("AFPSiLayerTool", layerNumber, layerEfficiency);
 				fill("AFPSiLayerTool", layerEfficiency);
 			}
 		}
 	}
-	
+*/	
 
 	return StatusCode::SUCCESS;
 }
 
 
+
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index a0f529b30606..45ff567d373b 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -55,7 +55,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	{
 		ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
 		return StatusCode::SUCCESS;
-    }
+	}
 
 	ATH_CHECK( afpToFHitContainer.initialize() );
 
@@ -69,8 +69,8 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 
 		if(hitsItr->isSideA())
 		{
-	    	numberOfHit_S0 = hitsItr->trainID();
-            fill("AFPToFTool", numberOfHit_S0);
+			numberOfHit_S0 = hitsItr->trainID();
+			fill("AFPToFTool", numberOfHit_S0);
 		}
 		else if(hitsItr->isSideC())
 		{
@@ -80,10 +80,10 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 
 		if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
 		{
-	    	fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], trainID, barInTrainID);
-		}	
+			fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], trainID, barInTrainID);
+		}
 	}
 
-    return StatusCode::SUCCESS;
+	return StatusCode::SUCCESS;
 }
 
-- 
GitLab


From 6ad7c775c7f182918d55221b782fa15345ab146a Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 10 Jul 2020 13:03:05 +0200
Subject: [PATCH 075/422] Front BCID histograms added

---
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 11 +--
 .../src/AFPSiLayerAlgorithm.cxx               | 70 +++++++++++++++++--
 2 files changed, 72 insertions(+), 9 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index fb6831758f0c..b261c7209615 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -49,13 +49,14 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array.defineHistogram('pixelRowIDChip', title='Hits per row for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
     array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for {0} Layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
     array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
-    array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
+    array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};x (mm];y (mm]', type='TH2F', path='Cluster', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
     array.defineHistogram('lb,clustersPerPlane', title='Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=0.2)
+    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=0.2)
     array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters in station {0}, layer {1};lb; clustersPerEvent / <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
 
 
     array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/Track/')
-    array.defineHistogram('trackY,trackX', title='Track in station {0};trackX;trackY', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
+    array.defineHistogram('trackY,trackX', title='Track in station {0};x (mm];y (mm]', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
 
     arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
     arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
@@ -84,9 +85,9 @@ if __name__=='__main__':
     #file = '/afs/cern.ch/user/l/ladamczy/public/data18_13TeV.00354309.physics_Main.ESD._lb0130._SFO-1._0001.data.r22'
 
     #ConfigFlags.Input.Files = [nightly+file]
-    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/00361795/data18_13TeV.00361795.calibration_AFP.daq.AOD._lb0000._SFO-8._0004.pool.root']
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput20.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput21.root'
     
     ConfigFlags.lock()
 
@@ -99,7 +100,7 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    cfg.run(300000) #use cfg.run(20) to only run on first 20 events
+    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
 
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 1e038a84596b..17f69d00fdbb 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -13,7 +13,9 @@
 #include "xAODForward/AFPStationID.h"
 
 	unsigned int clusterCounter[1000][4][4];
+	unsigned int clusterCounterFront[1000][4][4];
 	int previouslb = -1;
+	int previouslbFront = -1;
 	unsigned int counterForEvents = 0;
 	unsigned int counterForEventsFront = 0;
 	unsigned int counterForEventsEnd = 0;
@@ -71,6 +73,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
 	auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 1.0);
 	auto clustersPerPlane2 = Monitored::Scalar<float>("clustersPerPlane2", 0.0);
+	auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
 
 	auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
 	auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
@@ -91,10 +94,10 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	//run = GetEventInfo(ctx)->runNumber();
 	++counterForEvents;
 	//std::cout << "\tBCID: " << GetEventInfo(ctx)->bcid() << std::endl;
-	//if(GetEventInfo(ctx)->bcid() == 63)
-	//{
-	//	++counterForEventsFront;
-	//}
+	if(GetEventInfo(ctx)->bcid() == 63)
+	{
+		++counterForEventsFront;
+	}
 	//std::cout << "\t\t" << counterForEvents << " lb:" << lb << std::endl;
 	fill("AFPSiLayerTool", lb, muPerBCID);
 
@@ -222,6 +225,65 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 				++clusterCounter[lb][cluster.station][cluster.layer];
 			}
 		}
+		
+		// ========== Front BCID ==========
+		if(GetEventInfo(ctx)->bcid() == 63)
+		{
+		for(const auto& cluster : fast.clusters()) 
+		{
+			lb = GetEventInfo(ctx)->lumiBlock();
+			// Time for fill - current and previous lb are different, and the previouslbFront is not -1 (it means - this is not the first lb)
+			if(lb != previouslbFront && previouslbFront != -1)
+			{
+				//std::cout << "\tlb!=previouslbFront" << std::endl;
+				for(int i=0; i<4; i++)
+				{
+					for(int j=0; j<4; j++)
+					{
+						clustersPerPlaneFront = clusterCounterFront[previouslbFront][i][j]*1.0;
+						if(muPerBCID != 0)
+						{
+							clustersPerPlaneFront = clustersPerPlaneFront/(muPerBCID*counterForEventsFront);
+						}
+						else
+							{
+								clustersPerPlaneFront = -99;
+							}
+						std::cout << "\tFILL FRONT" << std::endl;
+						std::cout << "clustersPerPlaneFront (it was zero on cernbox): " << clustersPerPlaneFront << std::endl;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
+					}
+				}
+				previouslbFront = lb;
+				++clusterCounterFront[lb][cluster.station][cluster.layer];
+				counterForEventsFront=1;
+				
+				//(int i=0; i<4; i++)
+				//{
+					//for(int j=0; j<4; j++)
+					//{
+					//	numberOfClusterStationPlane[i][j] = 0;
+					//}
+				//}
+			}
+			
+			// First time in lumiblock (in plane)
+			else if(clusterCounterFront[lb][cluster.station][cluster.layer] == 0) 
+			{
+				++clusterCounterFront[lb][cluster.station][cluster.layer];
+				
+				previouslbFront = lb;
+				//std::cout << "\tFirst time" << std::endl;
+				//std::cout << "\tLuminosity block: " << lb << std::endl;
+			}
+			
+			// Lumiblock is same, so proceed
+			else if(lb==previouslbFront)	// Same lumiblock
+			{
+				++clusterCounterFront[lb][cluster.station][cluster.layer];
+			}
+		}
+		}
 	
 
 
-- 
GitLab


From 4388eae0991a096d626816ce5a64fd9abe089298 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 13 Jul 2020 20:30:58 +0200
Subject: [PATCH 076/422] Synchronization histograms

---
 .../AFP/Run3AFPMonitoring/CMakeLists.txt      |   4 +-
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |   2 +
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  24 +-
 .../src/AFPSiLayerAlgorithm.cxx               | 379 +++++++++++++++---
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx |   2 +-
 5 files changed, 349 insertions(+), 62 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index 74c169a2095c..0130dc3dcc86 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -14,7 +14,7 @@ atlas_depends_on_subdirs(
         GaudiKernel
         Event/xAOD/xAODForward
         xAODForward/AFPSiHit
-        xAODForward/AFPToFHit	
+        xAODForward/AFPToFHit
         LumiBlock/LumiBlockComps
         LumiBlock/LumiBlockData
         Trigger/TrigEvent/TrigDecisionInterface
@@ -51,6 +51,8 @@ atlas_add_component( Run3AFPMonitoring
         LumiBlockData
         TrigDecisionToolLib
         xAODForward
+        #xAODTrigger
+        #Trigger
         AthenaKernel
         SGAudCore
         AthenaPoolUtilities
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 29843fa91569..f1adeaa11119 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -11,6 +11,7 @@
 #include "xAODForward/AFPSiHitContainer.h"
 #include "xAODForward/AFPSiHit.h"
 
+
 #include "TRandom3.h"
 
 class AFPSiLayerAlgorithm : public AthMonitorAlgorithm {
@@ -24,6 +25,7 @@ private:
 	std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
 	std::map<std::string,int> m_TrackGroup; 
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
+	
 
 protected:
 	std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index b261c7209615..b7d074761c06 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -49,17 +49,23 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array.defineHistogram('pixelRowIDChip', title='Hits per row for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
     array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for {0} Layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
     array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
-    array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};x (mm];y (mm]', type='TH2F', path='Cluster', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
-    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=0.2)
-    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=0.2)
+    array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};x [mm];y [mm]', type='TH2F', path='Cluster', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
+    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters in station {0}, layer {1};lb; clustersPerEvent / <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
 
 
-    array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/Track/')
-    array.defineHistogram('trackY,trackX', title='Track in station {0};x (mm];y (mm]', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
+    array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
+    array.defineHistogram('trackY,trackX', title='Track in AFP station {0};x [mm];y [mm]', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
+    array.defineHistogram('lb,clustersPerStation', title ='Number of clusters in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationFront', title ='(Front) Number of clusters in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationEnd', title ='(End) Number of clusters in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationMiddle', title ='(Middle) Number of clusters in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
 
     arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
-    arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
+    arrayOneList.defineHistogram('barInTrainID,trainID', title='ToF hit bar vs train {0};barInTrainID;trainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
 
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
@@ -85,9 +91,9 @@ if __name__=='__main__':
     #file = '/afs/cern.ch/user/l/ladamczy/public/data18_13TeV.00354309.physics_Main.ESD._lb0130._SFO-1._0001.data.r22'
 
     #ConfigFlags.Input.Files = [nightly+file]
-    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod4.pool.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput21.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput32.root'
     
     ConfigFlags.lock()
 
@@ -100,7 +106,7 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
+    cfg.run()
 
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 17f69d00fdbb..456c37dadf77 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -12,14 +12,62 @@
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPStationID.h"
 
+
 	unsigned int clusterCounter[1000][4][4];
 	unsigned int clusterCounterFront[1000][4][4];
+	unsigned int clusterCounterEnd[1000][4][4];
+	unsigned int clusterCounterMiddle[1000][4][4];
+	
+	unsigned int clusterCounterStation[1000][4];
+	unsigned int clusterCounterStationFront[1000][4];
+	unsigned int clusterCounterStationEnd[1000][4];
+	unsigned int clusterCounterStationMiddle[1000][4];
+
 	int previouslb = -1;
 	int previouslbFront = -1;
+	int previouslbEnd = -1;
+	int previouslbMiddle = -1;
+	
+	int previouslbStation = -1;
+	int previouslbStationFront = -1;
+	int previouslbStationEnd = -1;
+	int previouslbStationMiddle = -1;
+
 	unsigned int counterForEvents = 0;
 	unsigned int counterForEventsFront = 0;
 	unsigned int counterForEventsEnd = 0;
 	unsigned int counterForEventsMiddle = 0;
+	
+	unsigned int counterForEventsStation = 0;
+	unsigned int counterForEventsStationFront = 0;
+	unsigned int counterForEventsStationEnd = 0;
+	unsigned int counterForEventsStationMiddle = 0;
+	
+	int frontBCIDs[] = {63,75,87,99,114,126,138,150,165,177,189,201,240,252,264,276,291,303,315,327,342,354,366,378,-1};
+	
+	int middleBCIDs[] = {64,65,66,67,68,69,76,77,78,79,80,81,88,89,90,91,92,93,100,101,102,103,104,105,115,
+	116,117,118,119,120,127,128,129,130,131,132,139,140,141,142,143,144,151,152,153,154,155,156,166,167,168,169,170,171,
+	178,179,180,181,182,183,190,191,192,193,194,195,202,203,204,205,206,207,241,242,243,244,245,246,253,254,255,256,257,
+	258,265,266,267,268,269,270,277,278,279,280,281,282,292,293,294,295,296,297,304,305,306,307,308,309,316,317,318,319,
+	320,321,328,329,330,331,332,333,343,344,345,346,347,348,355,356,357,358,359,360,367,368,369,370,371,372,379,380,381,
+	382,383,384,-1};
+	
+	int endBCIDs[] = {70,82,94,106,121,133,145,157,172,184,196,208,247,259,271,283,298,310,322,334,349,361,373,385,-1};
+	
+	bool isInList(int bcid, int* arr)
+	{
+		int i=0;
+		while(arr[i] != -1)
+		{
+			if(bcid == arr[i])
+			{
+				return true;
+			}
+			i++;
+		}
+		return false;
+	}
+
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
@@ -42,7 +90,7 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 	// We must declare to the framework in initialize what SG objects we are going to use:
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
 	ATH_CHECK(m_afpHitContainerKey.initialize());
-
+	
 	for(int a=0; a<1000; a++)
 	{
 		for(int b=0;b<4;b++)
@@ -63,7 +111,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
 	static unsigned int numberOfClusterStationPlane[4][4] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} };
 	//static unsigned int lumiBlocks[100];
-
+	
 	// Declare the quantities which should be monitored:
 	auto lb = Monitored::Scalar<int>("lb", 0);
 	auto muPerBCID = Monitored::Scalar<float>("muPerBCID", 0.0);
@@ -74,6 +122,13 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 1.0);
 	auto clustersPerPlane2 = Monitored::Scalar<float>("clustersPerPlane2", 0.0);
 	auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
+	auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
+	auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
+	
+	auto clustersPerStation = Monitored::Scalar<float>("clustersPerStation", 0.0);
+	auto clustersPerStationFront = Monitored::Scalar<float>("clustersPerStationFront", 0.0);
+	auto clustersPerStationEnd = Monitored::Scalar<float>("clustersPerStationEnd", 0.0);
+	auto clustersPerStationMiddle = Monitored::Scalar<float>("clustersPerStationMiddle", 0.0);
 
 	auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
 	auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
@@ -89,17 +144,34 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	auto layerEfficiency = Monitored::Scalar<float>("layerEfficiency", 0.0);
 	auto layerNumber = Monitored::Scalar<int>("layerNumber", 0);
 	
+	
 	lb = GetEventInfo(ctx)->lumiBlock();
 	muPerBCID = lbAverageInteractionsPerCrossing(ctx);
 	//run = GetEventInfo(ctx)->runNumber();
-	++counterForEvents;
-	//std::cout << "\tBCID: " << GetEventInfo(ctx)->bcid() << std::endl;
-	if(GetEventInfo(ctx)->bcid() == 63)
+	fill("AFPSiLayerTool", lb, muPerBCID);
+
+	++counterForEvents;		// Counter for the all BCIDs
+	++counterForEventsStation;
+
+	int tempbcid = GetEventInfo(ctx)->bcid();
+	if(isInList(tempbcid, frontBCIDs) == true)
 	{
 		++counterForEventsFront;
+		++counterForEventsStationFront;
+	} 
+	else if (isInList(tempbcid, endBCIDs) == true)
+	{
+		++counterForEventsEnd;
+		++counterForEventsStationEnd;
+	}
+	
+	if(isInList(tempbcid, middleBCIDs) == true)
+	{
+		++counterForEventsMiddle;
+		++counterForEventsStationMiddle;
 	}
 	//std::cout << "\t\t" << counterForEvents << " lb:" << lb << std::endl;
-	fill("AFPSiLayerTool", lb, muPerBCID);
+	
 
 	SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
 	if(! afpHitContainer.isValid())
@@ -114,6 +186,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	//hitsPerPlane = afpHitContainer->size();
 	fill("AFPSiLayerTool", lb, nSiHits);
 	
+
+	
 	for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
 	{
 		lb = GetEventInfo(ctx)->lumiBlock();
@@ -121,7 +195,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		pixelColIDChip = hitsItr->pixelColIDChip();
 		timeOverThreshold = hitsItr->timeOverThreshold();
 		
-	
 		if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
 		{
 			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
@@ -163,6 +236,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane2);
 		}
 	}
+// Davide's approach - End
 
 // Kris's approach:
 		for(const auto& cluster : fast.clusters()) 
@@ -177,7 +251,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			// Time for fill - current and previous lb are different, and the previouslb is not -1 (it means - this is not the first lb)
 			if(lb != previouslb && previouslb != -1)
 			{
-				std::cout << "\tlb!=previouslb" << std::endl;
 				for(int i=0; i<4; i++)
 				{
 					for(int j=0; j<4; j++)
@@ -188,14 +261,13 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 							clustersPerPlane = clustersPerPlane/(muPerBCID*counterForEvents);
 						}
 						else
-							{
-								clustersPerPlane = -99;
-							}
-						std::cout << "\tFILL" << std::endl;
-						std::cout << "ClustersPerPlane (it was zero on cernbox): " << clustersPerPlane << std::endl;
+						{
+							clustersPerPlane = -99;
+						}
 						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
 					}
 				}
+				
 				previouslb = lb;
 				++clusterCounter[lb][cluster.station][cluster.layer];
 				counterForEvents=1;
@@ -213,50 +285,256 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			else if(clusterCounter[lb][cluster.station][cluster.layer] == 0) 
 			{
 				++clusterCounter[lb][cluster.station][cluster.layer];
-				
 				previouslb = lb;
-				//std::cout << "\tFirst time" << std::endl;
-				//std::cout << "\tLuminosity block: " << lb << std::endl;
 			}
 			
 			// Lumiblock is same, so proceed
 			else if(lb==previouslb)	// Same lumiblock
+			{++clusterCounter[lb][cluster.station][cluster.layer];}
+			
+			// =============== Stations ===============
+			
+			if(lb != previouslbStation && previouslbStation != -1)
 			{
-				++clusterCounter[lb][cluster.station][cluster.layer];
+				for(int i=0; i<4; i++)
+				{
+					clustersPerStation = clusterCounterStation[previouslbStation][i]*1.0;
+					
+					if(muPerBCID != 0)
+					{clustersPerStation = clustersPerStation/(muPerBCID*counterForEventsStation*4);}
+					else{clustersPerStation = -99;}
+
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
+				}
+				previouslbStation=lb;
+				++clusterCounterStation[lb][cluster.station];
+				counterForEventsStation=1;
 			}
-		}
+			else if (clusterCounterStation[lb][cluster.station] == 0)
+			{
+				++clusterCounterStation[lb][cluster.station];
+				previouslbStation = lb;
+			}
+			else if (lb==previouslbStation)
+			{++clusterCounterStation[lb][cluster.station];}
+			
+			// ========== Front Station ==========
+			if(lb != previouslbStationFront && previouslbStationFront != -1)
+			{
+				for(int i=0; i<4; i++)
+				{
+					clustersPerStationFront = clusterCounterStationFront[previouslbStationFront][i]*1.0;
+					if(muPerBCID != 0)
+					{
+						clustersPerStationFront = clustersPerStationFront/(muPerBCID*counterForEventsStationFront*4);
+					}
+					else{clustersPerStationFront = -99;}
+					
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationFront);
+				}
+				previouslbStationFront=lb;
+				++clusterCounterStationFront[lb][cluster.station];
+				counterForEventsStationFront=1;
+			}
+			else if (clusterCounterStationFront[lb][cluster.station] == 0)
+			{
+				++clusterCounterStationFront[lb][cluster.station];
+				previouslbStationFront = lb;
+			}
+			else if (lb == previouslbStationFront)
+			{++clusterCounterStationFront[lb][cluster.station];}
+			// end front station
+			
+			// ========== End Station ==========
+			if(lb != previouslbStationEnd && previouslbStationEnd != -1)
+			{
+				for(int i=0; i<4; i++)
+				{
+					clustersPerStationEnd = clusterCounterStationEnd[previouslbStationEnd][i]*1.0;
+					if(muPerBCID != 0)
+					{
+						clustersPerStationEnd = clustersPerStationEnd/(muPerBCID*counterForEventsStationEnd*4);
+					}
+					else{clustersPerStationEnd = -99;}
+					
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationEnd);
+				}
+				previouslbStationEnd=lb;
+				++clusterCounterStationEnd[lb][cluster.station];
+				counterForEventsStationEnd=1;
+			}
+			else if (clusterCounterStationEnd[lb][cluster.station] == 0)
+			{
+				++clusterCounterStationEnd[lb][cluster.station];
+				previouslbStationEnd = lb;
+			}
+			else if (lb == previouslbStationEnd)
+			{++clusterCounterStationEnd[lb][cluster.station];}
+			// end end station
+			
+			// ========== Middle Station ==========
+			if(lb != previouslbStationMiddle && previouslbStationMiddle != -1)
+			{
+				for(int i=0; i<4; i++)
+				{
+					clustersPerStationMiddle = clusterCounterStationMiddle[previouslbStationMiddle][i]*1.0;
+					if(muPerBCID != 0)
+					{
+						clustersPerStationMiddle = clustersPerStationMiddle/(muPerBCID*counterForEventsStationMiddle*4);
+					}
+					else{clustersPerStationMiddle = -99;}
+					
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationMiddle);
+				}
+				previouslbStationMiddle=lb;
+				++clusterCounterStationMiddle[lb][cluster.station];
+				counterForEventsStationMiddle=1;
+			}
+			else if (clusterCounterStationMiddle[lb][cluster.station] == 0)
+			{
+				++clusterCounterStationMiddle[lb][cluster.station];
+				previouslbStationMiddle = lb;
+			}
+			else if (lb == previouslbStationMiddle)
+			{++clusterCounterStationMiddle[lb][cluster.station];}
+			// end middle station
+			
+			// end stations
+			
+		}	// end cluster loop
 		
 		// ========== Front BCID ==========
-		if(GetEventInfo(ctx)->bcid() == 63)
-		{
-		for(const auto& cluster : fast.clusters()) 
+		if(isInList(GetEventInfo(ctx)->bcid(), frontBCIDs))
 		{
-			lb = GetEventInfo(ctx)->lumiBlock();
-			// Time for fill - current and previous lb are different, and the previouslbFront is not -1 (it means - this is not the first lb)
-			if(lb != previouslbFront && previouslbFront != -1)
+			for(const auto& cluster : fast.clusters()) 
 			{
-				//std::cout << "\tlb!=previouslbFront" << std::endl;
-				for(int i=0; i<4; i++)
+				lb = GetEventInfo(ctx)->lumiBlock();
+				// Time for fill - current and previous lb are different, and the previouslbFront is not -1 (it means - this is not the first lb)
+				if(lb != previouslbFront && previouslbFront != -1)
 				{
-					for(int j=0; j<4; j++)
+					//std::cout << "\tlb!=previouslbFront" << std::endl;
+					for(int i=0; i<4; i++)
 					{
-						clustersPerPlaneFront = clusterCounterFront[previouslbFront][i][j]*1.0;
-						if(muPerBCID != 0)
+						for(int j=0; j<4; j++)
 						{
-							clustersPerPlaneFront = clustersPerPlaneFront/(muPerBCID*counterForEventsFront);
-						}
-						else
+							clustersPerPlaneFront = clusterCounterFront[previouslbFront][i][j]*1.0;
+							if(muPerBCID != 0)
+							{
+								clustersPerPlaneFront = clustersPerPlaneFront/(muPerBCID*counterForEventsFront);
+							}
+							else
 							{
 								clustersPerPlaneFront = -99;
 							}
-						std::cout << "\tFILL FRONT" << std::endl;
-						std::cout << "clustersPerPlaneFront (it was zero on cernbox): " << clustersPerPlaneFront << std::endl;
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
+							//std::cout << "\tFILL FRONT" << std::endl;
+							//std::cout << "clustersPerPlaneFront (it was zero on cernbox): " << clustersPerPlaneFront << std::endl;
+							fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
+						}
+					}
+					previouslbFront = lb;
+					++clusterCounterFront[lb][cluster.station][cluster.layer];
+					counterForEventsFront=1;
+
+				}
+			
+			// First time in lumiblock (in plane)
+				else if(clusterCounterFront[lb][cluster.station][cluster.layer] == 0) 
+				{
+					++clusterCounterFront[lb][cluster.station][cluster.layer];
+					previouslbFront = lb;
+				//std::cout << "\tFirst time" << std::endl;
+				//std::cout << "\tLuminosity block: " << lb << std::endl;
+				}
+			
+				// Lumiblock is same, so proceed
+				else if(lb==previouslbFront)	// Same lumiblock
+				{
+					++clusterCounterFront[lb][cluster.station][cluster.layer];
+				}
+			}
+		}
+		
+		// ========== End BCID ==========
+		if(isInList(GetEventInfo(ctx)->bcid(), endBCIDs))
+		{
+			for(const auto& cluster : fast.clusters()) 
+			{
+				lb = GetEventInfo(ctx)->lumiBlock();
+				// Time for fill - current and previous lb are different, and the previouslbEnd is not -1 (it means - this is not the first lb)
+				if(lb != previouslbEnd && previouslbEnd != -1)
+				{
+					//std::cout << "\tlb!=previouslbEnd" << std::endl;
+					for(int i=0; i<4; i++)
+					{
+						for(int j=0; j<4; j++)
+						{
+							clustersPerPlaneEnd = clusterCounterEnd[previouslbEnd][i][j]*1.0;
+							if(muPerBCID != 0)
+							{
+								clustersPerPlaneEnd = clustersPerPlaneEnd/(muPerBCID*counterForEventsEnd);
+							}
+							else
+							{
+								clustersPerPlaneEnd = -99;
+							}
+							//std::cout << "\tFILL END" << std::endl;
+							//std::cout << "clustersPerPlaneEnd (it was zero on cernbox): " << clustersPerPlaneEnd << std::endl;
+							fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
+						}
 					}
+					previouslbEnd = lb;
+					++clusterCounterEnd[lb][cluster.station][cluster.layer];
+					counterForEventsEnd=1;
+				}
+			
+			// First time in lumiblock (in plane)
+				else if(clusterCounterEnd[lb][cluster.station][cluster.layer] == 0) 
+				{
+					++clusterCounterEnd[lb][cluster.station][cluster.layer];				
+					previouslbEnd = lb;
+				//std::cout << "\tFirst time" << std::endl;
+				//std::cout << "\tLuminosity block: " << lb << std::endl;
+				}
+			
+				// Lumiblock is same, so proceed
+				else if(lb==previouslbEnd)	// Same lumiblock
+				{
+					++clusterCounterEnd[lb][cluster.station][cluster.layer];
 				}
-				previouslbFront = lb;
-				++clusterCounterFront[lb][cluster.station][cluster.layer];
-				counterForEventsFront=1;
+			}
+		}
+		
+		// ========== Middle BCID ==========
+		if(isInList(GetEventInfo(ctx)->bcid(), middleBCIDs))
+		{
+			for(const auto& cluster : fast.clusters()) 
+			{
+				lb = GetEventInfo(ctx)->lumiBlock();
+				// Time for fill - current and previous lb are different, and the previouslbMiddle is not -1 (it means - this is not the first lb)
+				if(lb != previouslbMiddle && previouslbMiddle != -1)
+				{
+					//std::cout << "\tlb!=previouslbMiddle" << std::endl;
+					for(int i=0; i<4; i++)
+					{
+						for(int j=0; j<4; j++)
+						{
+							clustersPerPlaneMiddle = clusterCounterMiddle[previouslbMiddle][i][j]*1.0;
+							if(muPerBCID != 0)
+							{
+								clustersPerPlaneMiddle = clustersPerPlaneMiddle/(muPerBCID*counterForEventsMiddle);
+							}
+							else
+							{
+								clustersPerPlaneMiddle = -99;
+							}
+							//std::cout << "\tFILL Middle" << std::endl;
+							//std::cout << "clustersPerPlaneMiddle (it was zero on cernbox): " << clustersPerPlaneMiddle << std::endl;
+							fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
+						}
+					}
+					previouslbMiddle = lb;
+					++clusterCounterMiddle[lb][cluster.station][cluster.layer];
+					counterForEventsMiddle=1;
 				
 				//(int i=0; i<4; i++)
 				//{
@@ -265,25 +543,24 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 					//	numberOfClusterStationPlane[i][j] = 0;
 					//}
 				//}
-			}
+				}
 			
 			// First time in lumiblock (in plane)
-			else if(clusterCounterFront[lb][cluster.station][cluster.layer] == 0) 
-			{
-				++clusterCounterFront[lb][cluster.station][cluster.layer];
-				
-				previouslbFront = lb;
+				else if(clusterCounterMiddle[lb][cluster.station][cluster.layer] == 0) 
+				{
+					++clusterCounterMiddle[lb][cluster.station][cluster.layer];				
+					previouslbMiddle = lb;
 				//std::cout << "\tFirst time" << std::endl;
 				//std::cout << "\tLuminosity block: " << lb << std::endl;
-			}
+				}
 			
-			// Lumiblock is same, so proceed
-			else if(lb==previouslbFront)	// Same lumiblock
-			{
-				++clusterCounterFront[lb][cluster.station][cluster.layer];
+				// Lumiblock is same, so proceed
+				else if(lb==previouslbMiddle)	// Same lumiblock
+				{
+					++clusterCounterMiddle[lb][cluster.station][cluster.layer];
+				}
 			}
 		}
-		}
 	
 
 
@@ -307,7 +584,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 */	
 
 	return StatusCode::SUCCESS;
-}
+} // end of fillHistograms
 
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index 45ff567d373b..51490af1e6a9 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -80,7 +80,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 
 		if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
 		{
-			fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], trainID, barInTrainID);
+			fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], barInTrainID, trainID);
 		}
 	}
 
-- 
GitLab


From c6dca803792639e54e2a3da9a025feb9e2406351 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@mpp.mpg.de>
Date: Tue, 14 Jul 2020 16:47:49 +0200
Subject: [PATCH 077/422] Remove non-ascii characters from codes. Mostly
 comments are affected.

---
 .../src/MonitoringFile_MergeAlgs.cxx          |  4 +--
 .../AthenaPoolUtilities/doc/packagedoc.h      |  2 +-
 Database/CrestApi/CrestApi/CrestApi.h         |  4 +--
 .../EventContainers/I_InternalIDC.h           |  2 +-
 .../xAODCaloRings/versions/CaloRings_v1.h     |  2 +-
 .../xAODCaloRings/versions/RingSetConf_v1.h   |  2 +-
 .../xAODCaloRings/versions/RingSet_v1.h       |  2 +-
 .../xAOD/xAODEgamma/xAODEgamma/EgammaEnums.h  |  4 +--
 .../versions/EgammaAuxContainer_v1.h          |  4 +--
 Generators/CosmicGenerator/src/cosmic2.f      |  2 +-
 .../src/TRTFastDigitizationTool.cxx           |  2 +-
 .../PixelDigitization/src/SensorSim3DTool.cxx |  2 +-
 .../SiSpacePointsSeedMakerEventData.h         |  6 ++--
 .../src/SiSpacePointsSeedMaker_ATLxk.cxx      | 34 +++++++++----------
 .../Root/BaseTrackVertexAssociationTool.cxx   |  4 +--
 .../Root/TrackVertexAssociationTool.cxx       |  4 +--
 .../BaseTrackVertexAssociationTool.h          |  4 +--
 .../TrackVertexAssociationTool.h              |  2 +-
 .../src/InDetPhysHitDecoratorAlg.cxx          |  2 +-
 .../src/InDetPhysValTruthDecoratorAlg.cxx     |  2 +-
 .../NtupleCalibADCTool.h                      |  2 +-
 .../MuonReadoutGeometry/src/MuonStation.cxx   |  2 +-
 .../MM_StripsResponseSimulation.h             |  2 +-
 .../src/TgcRawDataValAlg_Efficiency.cxx       |  2 +-
 .../MuonPRDTest/src/sTGCDigitVariables.cxx    |  2 +-
 .../Root/MuonResonancePlots.cxx               |  2 +-
 .../Root/MissingMassCalculator.cxx            |  4 +--
 .../xAOD/TopFakes/Root/FakesWeights.cxx       | 12 +++----
 .../Root/MissingETPerformanceFunctions.cxx    |  2 +-
 .../Root/HIJetConstituentModifierTool.cxx     |  2 +-
 .../JetRecCalo/src/MissingCellListTool.cxx    |  2 +-
 .../eflowRec/eflowRec/eflowCellIntegrator.h   |  4 +--
 .../eflowRec/eflowRec/eflowCellPosition.h     |  2 +-
 .../egamma/egammaEvent/egammaEvent/EMShower.h |  4 +--
 .../egammaEvent/egammaEvent/egammaParamDefs.h |  4 +--
 .../src/TFCSEnergyAndHitGAN.cxx               |  2 +-
 .../src/EnergyLossSamplerBetheHeitler.cxx     |  4 +--
 ...ultipleScatteringSamplerGeneralMixture.cxx |  4 +--
 .../MultipleScatteringSamplerGeneralMixture.h |  2 +-
 .../TrkAlignGenTools/src/MatrixTool.cxx       |  2 +-
 .../src/GeoShapeConverter.cxx                 |  2 +-
 .../src/MaterialMapper.cxx                    |  4 +--
 .../VxMultiVertex/MVFVxContainer.h            |  2 +-
 .../TrkGaussianSumFilter/src/GsfSmoother.cxx  |  2 +-
 .../src/TrkMaterialProviderTool.cxx           |  2 +-
 .../TrigT2CaloCommon/src/TrigDataAccess.h     |  2 +-
 .../src/TrigT1CaloTauFex.cxx                  |  2 +-
 .../components/TrigBjetMonitoring_entries.cxx |  2 +-
 .../src/xaod/CmxRoIByteStreamAuxCnv.cxx       |  4 +--
 .../src/TrigTrackSeedGenerator.cxx            |  2 +-
 .../TrigVKalFitter/src/CvtTrigTrack.cxx       |  2 +-
 51 files changed, 89 insertions(+), 89 deletions(-)

diff --git a/DataQuality/DataQualityUtils/src/MonitoringFile_MergeAlgs.cxx b/DataQuality/DataQualityUtils/src/MonitoringFile_MergeAlgs.cxx
index 21947a1f8bd6..13b37256212b 100644
--- a/DataQuality/DataQualityUtils/src/MonitoringFile_MergeAlgs.cxx
+++ b/DataQuality/DataQualityUtils/src/MonitoringFile_MergeAlgs.cxx
@@ -80,7 +80,7 @@ void MonitoringFile::merge_effAsPerCent( TH2& a, const TH2& b )
   // a and b are efficiency histogramming with percentage stored
   // den/num are a number of events
   // BinContent = n/d*100 
-  // BinError   = (1/d2) * sqrt( d*n*(d-n) )
+  // BinError  =  (1/d2) * sqrt( d*n*(d-n) )
 
   // First extract the denominator
   // It is supposed to be the same for all bins
@@ -232,7 +232,7 @@ void MonitoringFile::merge_effAsPerCentAlt( TH1& a, const TH1& b )
   // a and b are efficiency histogramming with percentage stored
   // den/num are a number of events
   // BinContent = n/d*100
-  // BinError   = (1/d2) * sqrt( d*n*(d-n) )
+  // BinError  = (1/d2) * sqrt( d*n*(d-n) )
 
   // Verify histogram compatibility
   if (a.GetDimension() != b.GetDimension()) {
diff --git a/Database/AthenaPOOL/AthenaPoolUtilities/doc/packagedoc.h b/Database/AthenaPOOL/AthenaPoolUtilities/doc/packagedoc.h
index e0d322ba27f2..00b8bfe47e02 100644
--- a/Database/AthenaPOOL/AthenaPoolUtilities/doc/packagedoc.h
+++ b/Database/AthenaPOOL/AthenaPoolUtilities/doc/packagedoc.h
@@ -39,7 +39,7 @@ package as an example.
 @verbatim
    package InDetEventAthenaPool
 
-   author  Davide Costanzo <Davide.Costanzo@cern.ch>
+   author  Davide Costanzo <Davide.Costanzo@cern.ch>
 
    use AtlasPolicy          AtlasPolicy-* 
    use AthenaPoolUtilities  AthenaPoolUtilities-00-*   Database/AthenaPOOL
diff --git a/Database/CrestApi/CrestApi/CrestApi.h b/Database/CrestApi/CrestApi/CrestApi.h
index 3d13f968bc85..51bf45014d90 100644
--- a/Database/CrestApi/CrestApi/CrestApi.h
+++ b/Database/CrestApi/CrestApi/CrestApi.h
@@ -127,7 +127,7 @@ namespace Crest {
 
 /**
  * General auxiliary method to make request to the CREST Server. This method is used by other methods realizing the
- * requests with the concrete kinds of data (iovs|payloads|tags…).
+ * requests with the concrete kinds of data (iovs|payloads|tags...).
  *
  * @param current_path - URL request path
  * @param action - Action (GET|POST|DELETE)
@@ -153,7 +153,7 @@ namespace Crest {
 
 /**
  * General auxillary method to make request to the CREST Server. This method is used by other methods realizing the
- * requests with the concrete kinds of data (iovs|payloads|tags…).
+ * requests with the concrete kinds of data (iovs|payloads|tags...).
  *
  * @param current_path - URL request path
  * @param action - Action (GET|POST|DELETE)
diff --git a/Event/EventContainers/EventContainers/I_InternalIDC.h b/Event/EventContainers/EventContainers/I_InternalIDC.h
index c336d4b964b0..ccb47b2281a0 100644
--- a/Event/EventContainers/EventContainers/I_InternalIDC.h
+++ b/Event/EventContainers/EventContainers/I_InternalIDC.h
@@ -15,7 +15,7 @@ class IDC_WriteHandleBase;
 /*
 The intention of the IdentifiableContainer is to provide a key-value map
 for collection pointers. To increase memory and cpu efficiency the online trigger 
-system different “views” can share collection that are created concurrently.
+system different ''views'' can share collection that are created concurrently.
 To efficiently support these different uses while not imposing overhead on the
 offline case and to maintain a consistent interface the internals of the class are
 virtualised.
diff --git a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/CaloRings_v1.h b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/CaloRings_v1.h
index d3083b8cf589..7bcde6feec50 100644
--- a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/CaloRings_v1.h
+++ b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/CaloRings_v1.h
@@ -193,7 +193,7 @@ class CaloRings_v1 : public SG::AuxElement {
 
     
     /// Print @name CaloRings_v1 methods:
-    /// @{
+    /// @{
     /**
      * @brief Print @name CaloRings_v1 using ostream:
      **/
diff --git a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSetConf_v1.h b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSetConf_v1.h
index 945e16e963c2..a51ed8df0123 100644
--- a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSetConf_v1.h
+++ b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSetConf_v1.h
@@ -434,7 +434,7 @@ class RingSetConf_v1 : public SG::AuxElement {
     void setSectionEndIdx(unsigned sectionEndIdx);
     /// @}
  
-    /// @{ Print @name RingSetConf_v1 methods:
+    /// @{ Print @name RingSetConf_v1 methods:
     /**
      * @brief Print @name RingSetConf_v1 using ostream:
      **/
diff --git a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSet_v1.h b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSet_v1.h
index 0587e51e1405..e3102c367567 100644
--- a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSet_v1.h
+++ b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSet_v1.h
@@ -132,7 +132,7 @@ class RingSet_v1 : public SG::AuxElement {
     RingSet_v1& operator=(const RingSet_v1& clrings);
     /// @}
 
-    /// @{ Print @name RingSet_v1 methods:
+    /// @{ Print @name RingSet_v1 methods:
     /**
      * @brief Print @name RingSet_v1 using ostream:
      **/
diff --git a/Event/xAOD/xAODEgamma/xAODEgamma/EgammaEnums.h b/Event/xAOD/xAODEgamma/xAODEgamma/EgammaEnums.h
index 733fc80244ee..b3fc409efba7 100644
--- a/Event/xAOD/xAODEgamma/xAODEgamma/EgammaEnums.h
+++ b/Event/xAOD/xAODEgamma/xAODEgamma/EgammaEnums.h
@@ -75,7 +75,7 @@ namespace xAOD {
       e2ts1 = 22,   
       /// @brief energy of the cell corresponding to second energy maximum in the first sampling
       e2tsts1 = 23,  
-      /// @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strips around the strip with highest energy
+      /// @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in +- n strips around the strip with highest energy
       fracs1 = 24,   
       /// @brief same as egammaParameters::weta1 but without corrections  on particle impact point inside the cell
       widths1 = 25,  
@@ -98,7 +98,7 @@ namespace xAOD {
       pos7 = 31, 
       /// @brief  barycentre in sampling 1 calculated in 3 strips
       barys1 =32,   
-      /// @brief shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips in 
+      /// @brief shower width is determined in a window detaxdphi = 0,0625 x~0,2, corresponding typically to 20 strips in 
       ///eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum
       wtots1 = 33,   
       /// @brief energy reconstructed in the strip with the minimal value between the first and second maximum
diff --git a/Event/xAOD/xAODEgamma/xAODEgamma/versions/EgammaAuxContainer_v1.h b/Event/xAOD/xAODEgamma/xAODEgamma/versions/EgammaAuxContainer_v1.h
index 7e42e218572a..f11be1325b7d 100644
--- a/Event/xAOD/xAODEgamma/xAODEgamma/versions/EgammaAuxContainer_v1.h
+++ b/Event/xAOD/xAODEgamma/xAODEgamma/versions/EgammaAuxContainer_v1.h
@@ -132,7 +132,7 @@ namespace xAOD {
     std::vector< float >  e2ts1;    
     /// @brief energy of the cell corresponding to second energy maximum in the first sampling
     std::vector< float >  e2tsts1;  
-    /// @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strips around the strip with highest energy
+    /// @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in +- n strips around the strip with highest energy
     std::vector< float >  fracs1;   
     /// @brief same as egammaParameters::weta1 but without corrections  on particle impact point inside the cell
     std::vector< float >  widths1;  
@@ -155,7 +155,7 @@ namespace xAOD {
     std::vector< float >  pos7; 
     /// @brief  barycentre in sampling 1 calculated in 3 strips
     std::vector< float >  barys1;   
-    /// @brief shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum
+    /// @brief shower width is determined in a window detaxdphi = 0,0625 x~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum
     std::vector< float >  wtots1;   
     /// @brief energy reconstructed in the strip with the minimal value between the first and second maximum
     std::vector< float >  emins1;   
diff --git a/Generators/CosmicGenerator/src/cosmic2.f b/Generators/CosmicGenerator/src/cosmic2.f
index 0b07e1b353f9..0c46f1667406 100644
--- a/Generators/CosmicGenerator/src/cosmic2.f
+++ b/Generators/CosmicGenerator/src/cosmic2.f
@@ -499,7 +499,7 @@ C
       WRITE(IOU,6102)
 6102  FORMAT(/,2X,'FOR COMPARISON : MEASURED TOTAL FLUX ABOVE 0.35 GEV',
      F/19X,'BY ALLKOFER ET AL. COSMIC RAYS ON EARTH,ISSN 0344-8401'/19X
-     F      ,'J2 = (1.90 ± 0.12).E-2'//)
+     F      ,'J2 = (1.90 +- 0.12).E-2'//)
       END
 *
       SUBROUTINE CDARFX(EMU,THEMU,WQPOS,WQNEG)
diff --git a/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx b/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx
index 181fdab20d6d..38913f15bc9c 100644
--- a/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx
+++ b/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx
@@ -760,7 +760,7 @@ bool TRTFastDigitizationTool::isArgonStraw( const Identifier &straw_id ) const
 int TRTFastDigitizationTool::gasType( const Identifier &straw_id ) const
 {
   // getStatusHT returns enum EStatus { Undefined, Dead, Good, Xenon, Argon, Krypton } // from 20.7.1
-  // ​see InnerDetector/​InDetConditions/​TRT_ConditionsData/​TRT_ConditionsData/​StrawStatus.h
+  // see InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/StrawStatus.h
   // TRT representation of gasType = Xenon: 0, Argon: 1, Krypton: 2
 
   int status = m_trtStrawStatusSummaryTool->getStatusHT( straw_id );
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
index 2f3474393ed4..aa8006f43cc4 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
@@ -598,7 +598,7 @@ double SensorSim3DTool::getMobility(double electricField, bool isHoleBit) {
   double ecrit = 0;
   double beta = 0;
 
-  //These parameterizations come from C. Jacoboni et al., Solid‐State Electronics 20 (1977) 77‐89. (see also https://cds.cern.ch/record/684187/files/indet-2001-004.pdf).
+  //These parameterizations come from C. Jacoboni et al., Solidid State Electronics 20 (1977) 77 89. (see also https://cds.cern.ch/record/684187/files/indet-2001-004.pdf).
 
   if (!isHoleBit) {
     vsat = 15.3 * pow(m_temperature, -0.87); // mm/ns
diff --git a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointsSeedMakerEventData.h b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointsSeedMakerEventData.h
index 0d2eff9a4e2e..78a941003f1e 100644
--- a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointsSeedMakerEventData.h
+++ b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointsSeedMakerEventData.h
@@ -85,7 +85,7 @@ namespace InDet {
     float dzdrmin{0.};    //<! store eta cuts interpreted as dz/dr 
     float dzdrmax{0.};    //<! store eta cuts interpreted as dz/dr 
     float ipt2C{0.};  ///< inverse of 90% of the pt cut, squared, multiplied by a magic conversion factor 
-    float ipt2K{0.};  ///< 1 / (K * 0.9 * pt cut)², allows us to directly apply our pt cut on the (2R)² estimate we obtain from the seed
+    float ipt2K{0.};  ///< 1 / (K * 0.9 * pt cut)^2, allows us to directly apply our pt cut on the (2R)^2 estimate we obtain from the seed
     float COFK{0.};   ///< a magic number 
     float zminU{0.};
     float zmaxU{0.};
@@ -129,8 +129,8 @@ namespace InDet {
     std::vector<float> Zo;    ///< z0 estimate from 2 points
     std::vector<float> Tz;    ///< 1/sintheta estimate from 2 points
     std::vector<float> R;     ///< inverse distance to the central space point 
-    std::vector<float> U;     ///< transformed U coordinate (x/(x²+y²)) in frame around central SP 
-    std::vector<float> V;     ///< transformed V coordinate (y/(x²+y²)) in frame around central SP 
+    std::vector<float> U;     ///< transformed U coordinate (x/(x^2+y^2)) in frame around central SP 
+    std::vector<float> V;     ///< transformed V coordinate (y/(x^2+y^2)) in frame around central SP 
     std::vector<float> X;
     std::vector<float> Y;
     std::vector<float> Er;
diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
index b0dd7293bab0..b467120fb493 100644
--- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
+++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
@@ -123,7 +123,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newEvent(const EventContext& ctx, Even
       * allows to set the circle-radius to pT conversion factor.
       * 
       * See for example ATLAS-CONF-2010-072 
-      * R[mm] =pT[GeV] / (3·10−4×B[T]) =  pT[MeV] / (300 *Bz[kT])
+      * R[mm] =pT[GeV] / (3*10^-4*B[T]) =  pT[MeV] / (300 *Bz[kT])
       * 
       * We actually estimate the circle diameter, 2R, in the seeding. 
       * So what we want is: 2R = pT[MeV] x 2  / (300 x Bz) = K x pT[MeV]. 
@@ -134,7 +134,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newEvent(const EventContext& ctx, Even
     }
     /** helper variables allowing us to directly apply our pt cut on the variables
     * available at seed level. 
-    * ipt2K is 1 / (K * 0.9 * pt cut)² 
+    * ipt2K is 1 / (K * 0.9 * pt cut)^2 
     **/ 
     data.ipt2K = m_ipt2/(data.K*data.K);
     /// related to the mysterious magic number, m_COF{134*.05*9}
@@ -1761,7 +1761,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
       data.R [i]   = dr;      ///< inverse distance to central SP
       data.U [i]   = x*r2;    ///< transformed U coordinate  
       data.V [i]   = y*r2;    ///< transformed V coordinate 
-      data.Er[i]   = ((covz0+sp->covz())+(tz*tz)*(covr0+sp->covr()))*r2;    ///< 1/r² (cov(z)) + 1/r²sin²theta cov(r)
+      data.Er[i]   = ((covz0+sp->covz())+(tz*tz)*(covr0+sp->covr()))*r2;    ///< 1/r^2 (cov(z)) + 1/r^2sin^2theta cov(r)
     }
 
     /// tweak covariance matrix elements
@@ -1780,13 +1780,13 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
       float  Tzb  = data.Tz[b];       ///< 1/sintheta estimate from central+bottom SP
       float  Rb2r = data.R [b]*covr0; ///< inverse distance times covariance on r coordinate
       float  Rb2z = data.R [b]*covz0; ///< inverse distance times covariance on z coordinate
-      float  Erb  = data.Er[b];       ///< 1/r² (cov(z)) + 1/r²sin²theta cov(r)
+      float  Erb  = data.Er[b];       ///< 1/r^2 (cov(z)) + 1/r^2 sin^theta cov(r)
       float  Vb   = data.V [b];       ///< v-coordinate of bottom SP  
       float  Ub   = data.U [b];       ///< u-coordinate of bottom SP
-      float  Tzb2 = (1.+Tzb*Tzb);     ///< 1+1/sin²theta 
-      float sTzb2 = sqrt(Tzb2);       ///< sqrt (1+1/sin²theta)
-      float  CSA  = Tzb2*COFK;        ///< magic number x (1+1+sin²theta) 
-      float ICSA  = Tzb2*ipt2C;       ///< magic number x inverse of 90% of the pt cut, squared x (1+1+sin²theta) 
+      float  Tzb2 = (1.+Tzb*Tzb);     ///< 1+1/sin^2theta 
+      float sTzb2 = sqrt(Tzb2);       ///< sqrt (1+1/sin^2theta)
+      float  CSA  = Tzb2*COFK;        ///< magic number x (1+1+sin^2theta) 
+      float ICSA  = Tzb2*ipt2C;       ///< magic number x inverse of 90% of the pt cut, squared x (1+1+sin^2theta) 
       /// max IP
       float d0max  = maxd0cut;
       /// for strips, apply the strip version of the IP cut 
@@ -1801,7 +1801,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
         if (dT > ICSA) continue;    
 
         /** 
-        * The following exploits the transformation u:=x/(x²+y²); v:=y/(x²+y²); 
+        * The following exploits the transformation u:=x/(x^2+y^2); v:=y/(x^2+y^2); 
         * This is applied on the x,y coordinates in the frame described above, where the 
         * origin is put in the central SP and the x axis defined to point directly away from the IP.
         * 
@@ -1809,7 +1809,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
         * a linear function V = (-x0/y0) x U + 1/(2y0) =: A x U + B.
         * Here, x0 and y0 describe the center point of the circle in the x-y frame. 
         * As the origin of the x-y frame (the middle space point of our seed) is on the circle, 
-        * we have x0²+y0²=R² with circle radius R. 
+        * we have x0^2+y0^2=R^2 with circle radius R. 
         * 
         * For our seed, we can experimentally obtain A as the slope of the linear function, 
         * delta V / delta U, 
@@ -1818,8 +1818,8 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
         * B is then obtained by inserting the obtained A into the 
         * linear equation for the bottom SP, A x U + B = V --> B = V - A x U 
         * 
-        * With x0²+y0²=R², and x0=-A/2B and y0=1/2B, the radius of the circle is 
-        * then obtained as (2R)²=(1+A²)/B². 
+        * With x0^2+y0^2=R^2, and x0=-A/2B and y0=1/2B, the radius of the circle is 
+        * then obtained as (2R)^2=(1+A^2)/B^2. 
         **/ 
         float deltaU  = data.U[t]-Ub;
         if (deltaU == 0.) continue;       ///< delta U = 0 blocks the evaluation of A. 
@@ -1828,8 +1828,8 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
         float onePlusAsquare  = 1.+A*A;
         float BSquare  = B*B;
         /** With this radius (and pT) estimate, we can apply our pt cut. 
-         * Reminder, ipt2K is 1 / (K x 0.9 x pt-cut)², where K translates pt into 2R. 
-         * So here we can apply the pt cut directly on the (2R)² estimate without
+         * Reminder, ipt2K is 1 / (K x 0.9 x pt-cut)^2, where K translates pt into 2R. 
+         * So here we can apply the pt cut directly on the (2R)^2 estimate without
          * the extra overhead of conversion / division
          **/ 
         if (BSquare  > ipt2K*onePlusAsquare || dT*onePlusAsquare > BSquare*CSA) continue;
@@ -1838,14 +1838,14 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
         * The reasoning is that, in the x-y frame with the central SP as origin and 
         * the x axis pointing away from the IP, we have for the distance between
         * the IP and the middle of the circle: 
-        * (x0 - r_central)²+y0² = (R + d0)², 
+        * (x0 - r_central)^2+y0^2 = (R + d0)^2, 
         * with R being the circle radius and r_central 
         * the radial location of the central SP, placing the IP at IP at (-r_central, 0). 
         * 
-        * First simplify using R² =x0²+y0², then apply the approximation d0²/R² ~ 0. 
+        * First simplify using R^2 =x0^2+y0^2, then apply the approximation d0^2/R^2 ~ 0. 
         * 
         * Finally, consider that locally close to the central SP, the circle is parallel to the x axis, 
-        * so A = 0 --> expand (2R)²=(1+A²)/B² around this point to obtain 
+        * so A = 0 --> expand (2R)^2=(1+A^2)/B^2 around this point to obtain 
         * d0 = r_central x (r_central x B - A). 
         * Note that below, the variable R is the radial coordinate fo the central SP, 
         * corresponding to r_central in the notation above. 
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/BaseTrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/BaseTrackVertexAssociationTool.cxx
index 8e02937f3622..515f7547b0fa 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/BaseTrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/BaseTrackVertexAssociationTool.cxx
@@ -29,7 +29,7 @@ StatusCode BaseTrackVertexAssociationTool::initialize()
   ATH_CHECK( m_eventInfo.initialize() );
 
   ATH_MSG_INFO("Cut on d0 significance: " << m_d0sig_cut << "\t(d0sig_cut)");
-  ATH_MSG_INFO("Cut on Δz * sin θ: " << m_dzSinTheta_cut << "\t(dzSinTheta_cut)");
+  ATH_MSG_INFO("Cut on deltaz * sin theta: " << m_dzSinTheta_cut << "\t(dzSinTheta_cut)");
 
   ATH_MSG_WARNING("BaseTrackVertexAssociationTool is being depricated. Please use the new TrackVertexAssociationTool instead.");
 
@@ -129,7 +129,7 @@ bool BaseTrackVertexAssociationTool::isMatch(const xAOD::TrackParticle &trk,
   if (m_d0sig_cut >= 0 && fabs(d0sig) > m_d0sig_cut)
     return false;
 
-  // calculate Δz * sin θ
+  // calculate deltaz * sin theta
   dzSinTheta = fabs((trk_z0 - vx_z0 + beamspot_z0) * sin(theta));
   if (m_dzSinTheta_cut >= 0 && dzSinTheta > m_dzSinTheta_cut)
     return false;
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx
index 3af91028a5cc..64d8ea6ac55d 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx
@@ -141,7 +141,7 @@ StatusCode TrackVertexAssociationTool::initialize()
   } else {
     ATH_MSG_INFO("Cut on d0: " << m_d0_cut << "\t(d0_cut)");
   }
-  ATH_MSG_INFO("Cut on Δz * sin θ: " << m_dzSinTheta_cut << "\t(dzSinTheta_cut)");
+  ATH_MSG_INFO("Cut on deltaz * sin theta: " << m_dzSinTheta_cut << "\t(dzSinTheta_cut)");
 
   ATH_MSG_INFO("Allow UsedInFit MatchStatus: " << m_doUsedInFit << "\t(doUsedInFit)");
   ATH_MSG_INFO("Require VxType::PriVtx for unique match: " << m_requirePriVtx << "\t(requirePriVtx)");
@@ -236,7 +236,7 @@ TrackVertexAssociationTool::MatchStatus TrackVertexAssociationTool::isMatch(cons
   float trk_z0 = trk.z0();
   float beamspot_z0 = trk.vz();
   float theta = trk.theta();
-  // calculate Δz * sin θ
+  // calculate deltaz * sin theta
   dzSinTheta = fabs((trk_z0 - vx_z0 + beamspot_z0) * sin(theta));
 
   // If vertex fit information is flagged to be used,
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h
index 21035bd9f9c3..4f32a26b2e05 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h
@@ -60,7 +60,7 @@ public:
               const xAOD::VertexContainer &vxCont) const;
 
   /// Compares the track trk with each track in vx_list using isCompatible,
-  /// and returns the compatible track with the smallest Δz * sin θ.
+  /// and returns the compatible track with the smallest delta z * sin theta.
   const xAOD::Vertex *
   getUniqueMatchVertex(const xAOD::TrackParticle &trk,
                        std::vector<const xAOD::Vertex *> &vx_list) const;
@@ -87,7 +87,7 @@ private:
   SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo { this, "EventInfo", "EventInfo", "EventInfo key" };
 
   /// Checks if a track-vertex pair passes the cuts.  Returns
-  /// Δz * sin θ of the pair in `dzSinTheta` if successful.
+  /// deltaz * sin theta of the pair in `dzSinTheta` if successful.
   bool isMatch(const xAOD::TrackParticle &trk, const xAOD::Vertex &vx,
                float &dzSinTheta) const;
 
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationTool.h
index 26f7e90c49c4..e833460dbd25 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationTool.h
@@ -64,7 +64,7 @@ namespace CP {
       SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo { this, "EventInfo", "EventInfo", "EventInfo key" };
 
       /// Checks if a track-vertex pair passes the cuts.  Returns
-      /// Δz * sin θ of the pair in `dzSinTheta` if successful.
+      /// deltaz * sin theta of the pair in `dzSinTheta` if successful.
       MatchStatus isMatch(const xAOD::TrackParticle &trk, const xAOD::Vertex &vx,
                    float &dzSinTheta) const;
 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorAlg.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorAlg.cxx
index e95505f585b0..3b323979a4ac 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorAlg.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorAlg.cxx
@@ -28,7 +28,7 @@
 #include <limits>
 
 // ref:
-// ​https://svnweb.cern.ch/trac/atlasoff/browser/Tracking/TrkEvent/TrkParametersBase/trunk/TrkParametersBase/CurvilinearParametersT.h
+// https://svnweb.cern.ch/trac/atlasoff/browser/Tracking/TrkEvent/TrkParametersBase/trunk/TrkParametersBase/CurvilinearParametersT.h
 
 
 InDetPhysHitDecoratorAlg::InDetPhysHitDecoratorAlg(const std::string& name, ISvcLocator* pSvcLocator) :
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx
index 678bcdf689db..e6c6f8b5facf 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx
@@ -207,7 +207,7 @@ InDetPhysValTruthDecoratorAlg::decorateTruth(const xAOD::TruthParticle& particle
 /** Email from Andi Salzburger to Shaun Roe **
 
    the correct way is actually to extrapolate it.
-   So you’d need to retrieve the extrapolator:
+   So you would need to retrieve the extrapolator:
     TooHandle<IExtrapolator> m_extrapolator;
 
    -> retrieve it in your code and use the AtlasExtrapolator (which is fully configured, and can be imported in python
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/MuonCalibStandAloneTools/NtupleCalibADCTool.h b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/MuonCalibStandAloneTools/NtupleCalibADCTool.h
index a3807fbb385e..47289e8d5051 100644
--- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/MuonCalibStandAloneTools/NtupleCalibADCTool.h
+++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/MuonCalibStandAloneTools/NtupleCalibADCTool.h
@@ -12,7 +12,7 @@
 //   2009.03.06   Add new array histogram for studing the ADC varation with differnet segment AngleXZ
 //   2009.06.22   Test the current version in new package, working on the producting of timeslewing coefficient
 //   2009.07.02   v320 input_svc ->T0 and RT , slewing factor from r_MDT_residual_vs_ADC[15]
-//   2009.07.15   v330 TS_factor[15] change range.  Range 0 to 0.5, 0.5~1.5£¬13.5~15
+//   2009.07.15   v330 TS_factor[15] change range.  Range 0 to 0.5, 0.5~1.5 13.5~15
 //   2009.07.23   v400 introduce the TS_cor and reset the driftRadius before the refit. new plot Residual_vs_Radius[3]
 //   2009.08.27   v440 new plot  radius_vs_distanceTowire  ->> check the bugs on the NTUP filling
 //   2009.08.31   v500 running version except r_MDT_residual_vs_ADC[15]
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx
index 58d1431c8e00..59265c713438 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx
@@ -125,7 +125,7 @@ void  MuonStation::updateBlineFixedPointInAmdbLRS()
 	  // Correct for tube staggering on barrel side C
 	  double shiftInZ = -0.5 * mdtRE->tubePitch();
 
-	  // in addition, correct for 35µm glue width incorrectly applied
+	  // in addition, correct for 35mum glue width incorrectly applied
 	  double multilayerRealSize = 0;
 	  for (int ilayer=1; ilayer<=2; ++ilayer) {
 	    double val;
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_StripsResponseSimulation.h b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_StripsResponseSimulation.h
index 2163d38de5da..4443f704bb14 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_StripsResponseSimulation.h
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_StripsResponseSimulation.h
@@ -112,7 +112,7 @@ private:
   float m_qThreshold;
 
 
-  /** // 0.350/10 diffusSigma=transverse diffusion (350 μm per 1cm ) for 93:7 @ 600 V/cm, according to garfield  */
+  /** // 0.350/10 diffusSigma=transverse diffusion (350 mum per 1cm ) for 93:7 @ 600 V/cm, according to garfield  */
   float m_transverseDiffusionSigma;
   float m_longitudinalDiffusionSigma;
   float m_pitch;
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx
index 13fe8a63402a..1b75ab839567 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx
@@ -444,7 +444,7 @@ TgcRawDataValAlg::fillEfficiency(){
         // channel number +offset for wires and strips in each layer
         int chIds[2][9] = {{-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,},
                            {-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,}};//[ws][layer]
-        // Eta and Phi positions of channels (layer2 has no strips)
+        // Eta and Phi positions of channels (layer2 has no strips)
         double chEtas[2][9] = {{-99,-99,-99,-99,-99,-99,-99,-99,-99,},
                                {-99, -1,-99,-99,-99,-99,-99,-99,-99,}};//[ws][layer]
         double chPhis[2][9] = {{-99,-99,-99,-99,-99,-99,-99,-99,-99,},
diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx
index 41dd7c70d35b..653a267de57e 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx
@@ -1,4 +1,4 @@
-/*
+/*
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
diff --git a/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonancePlots.cxx b/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonancePlots.cxx
index 1162e63ec1c1..7b2c6d3f3578 100644
--- a/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonancePlots.cxx
+++ b/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonancePlots.cxx
@@ -344,7 +344,7 @@ float MuonResonancePlots::deltaPt(TLorentzVector v1, TLorentzVector v2){
 }
 
 
-// function to return Chi² / DoF
+// function to return Chi2 / DoF
 float MuonResonancePlots::getChiSquared(const xAOD::Muon& mu, int type){
 
   const xAOD::TrackParticle *cb_ = mu.trackParticle(xAOD::Muon::CombinedTrackParticle);
diff --git a/PhysicsAnalysis/TauID/DiTauMassTools/Root/MissingMassCalculator.cxx b/PhysicsAnalysis/TauID/DiTauMassTools/Root/MissingMassCalculator.cxx
index 89bf606b334e..a97249f2a12a 100644
--- a/PhysicsAnalysis/TauID/DiTauMassTools/Root/MissingMassCalculator.cxx
+++ b/PhysicsAnalysis/TauID/DiTauMassTools/Root/MissingMassCalculator.cxx
@@ -6851,7 +6851,7 @@ inline double  MissingMassCalculator::fixPhiRange  (const double & phi)
 
 
 // fast approximate calculation of sin and cos
-// approximation good to 1 per mill. s²+c²=1 strictly exact though
+// approximation good to 1 per mill. s^2+c^2=1 strictly exact though
 // it is like using slightly different values of phi1 and phi2
 
 
@@ -6884,7 +6884,7 @@ inline void MissingMassCalculator::fastSinCos (const double & phiInput, double &
   sinPhi=y*(fastP*std::abs(y)+fastQ);
 
 
-  //note that one could use cos(phi)=sin(phi+pi/2), however then one would not have c²+s²=1 (would get it only within 1 per mille)
+  //note that one could use cos(phi)=sin(phi+pi/2), however then one would not have c^2+s^2=1 (would get it only within 1 per mille)
   // the choice here is to keep c^2+s^2=1 so everything is as one would compute c and s from a slightly (1 per mille) different angle
   cosPhi=sqrt(1-std::pow(sinPhi,2));
   if (std::abs(phi)>piOverTwo) cosPhi=-cosPhi;
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopFakes/Root/FakesWeights.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopFakes/Root/FakesWeights.cxx
index 5d5a3222c876..8b2d3b113f0a 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopFakes/Root/FakesWeights.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopFakes/Root/FakesWeights.cxx
@@ -134,15 +134,15 @@ void FakesWeights::SetupWeighter(int channel, std::string aReal, std::string aFa
   std::cout << "--------------------------------------------------------" << std::endl;
   std::cout << "  FakesWeights::INFO: Setting-up Matrix Method Weighter." << std::endl;
   if(channel==EJETS)  std::cout << "    channel:  e+jets" << std::endl;
-  if(channel==MUJETS) std::cout << "    channel:  µ+jets" << std::endl;
+  if(channel==MUJETS) std::cout << "    channel:  mu+jets" << std::endl;
   if(channel==EE)     std::cout << "    channel:  ee" << std::endl;
-  if(channel==MUMU)   std::cout << "    channel:  µµ" << std::endl;
-  if(channel==EMU)    std::cout << "    channel:  eµ" << std::endl;
+  if(channel==MUMU)   std::cout << "    channel:  mumu" << std::endl;
+  if(channel==EMU)    std::cout << "    channel:  emu" << std::endl;
   if(channel==EMU){
     std::cout << "    real eff(e): " << aReal << std::endl;
     std::cout << "    fake eff(e): " << aFake << std::endl;    
-    std::cout << "    real eff(µ): " << aReal2 << std::endl;
-    std::cout << "    fake eff(µ): " << aFake2 << std::endl;    
+    std::cout << "    real eff(mu): " << aReal2 << std::endl;
+    std::cout << "    fake eff(mu): " << aFake2 << std::endl;    
   }
   else{
     std::cout << "    real eff: " << aReal << std::endl;
@@ -201,7 +201,7 @@ void FakesWeights::SetupWeighter(int channel, std::string aReal, std::string aFa
   // setup firt lepton, for all the channels
   _EffSet[0]->SetupEff(aReal);
   _EffSet[1]->SetupEff(aFake);
-  // setup the second lepton in the same way as the first one for ee and µµ, but following aReal2/aFake2 for eµ
+  // setup the second lepton in the same way as the first one for ee and mumu, but following aReal2/aFake2 for emu
   if(channel==EE || channel==EMU || channel==MUMU){
     if(aReal2!="") _EffSet[2]->SetupEff(aReal2);
     else _EffSet[2]->SetupEff(aReal);
diff --git a/PhysicsAnalysis/UpgradePhys/SmearingFunctions/UpgradePerformanceFunctions/Root/MissingETPerformanceFunctions.cxx b/PhysicsAnalysis/UpgradePhys/SmearingFunctions/UpgradePerformanceFunctions/Root/MissingETPerformanceFunctions.cxx
index 37946741c888..33f7074ba6f0 100644
--- a/PhysicsAnalysis/UpgradePhys/SmearingFunctions/UpgradePerformanceFunctions/Root/MissingETPerformanceFunctions.cxx
+++ b/PhysicsAnalysis/UpgradePhys/SmearingFunctions/UpgradePerformanceFunctions/Root/MissingETPerformanceFunctions.cxx
@@ -135,7 +135,7 @@ float UpgradePerformanceFunctions::getMETResolution(float sumEtMeV, METSyst syst
 //  /*Transition*/
 //  else if (sumEtGeV<m_highsumet[PUcondition]) 
 //    METPUresoNom=m_Ress[PUcondition]->Eval(m_lowsumet[PUcondition])+((sumEtGeV-m_lowsumet[PUcondition])*(m_par1[PUcondition]+m_par2[PUcondition]*sqrt(m_highsumet[PUcondition])-m_Ress[PUcondition]->Eval(m_lowsumet[PUcondition]))/(m_highsumet[PUcondition]-m_lowsumet[PUcondition]));
-//  /*Z´ fit*/   
+//  /*Z' fit*/   
 //  else METPUresoNom=m_par1[PUcondition]+m_par2[PUcondition]*sqrt(sumEtGeV);
 //  
 //  //5% systematics sample dependence, and extrapolation at low sumET wiht the fit
diff --git a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentModifierTool.cxx b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentModifierTool.cxx
index 7230177af05a..ee06318bdd95 100644
--- a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentModifierTool.cxx
+++ b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentModifierTool.cxx
@@ -45,7 +45,7 @@ int HIJetConstituentModifierTool::modifyJet(xAOD::Jet& jet) const {
    if( constituentAcc.isAvailable(jet) ) constituentAcc( jet ).resize(0);
    if( constituentWeightAcc.isAvailable(jet) ) constituentWeightAcc( jet ).resize(0);
 
-   //save unsubtracted kinematics as moment if they don’t exist already...
+   //save unsubtracted kinematics as moment if they don't exist already...
    xAOD::IParticle::FourMom_t unsubtractedP4;
    unsubtractedP4 = jet.p4();
    jet.setJetP4(HIJetRec::unsubtractedJetState(),jet.jetP4());
diff --git a/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx b/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx
index dc24774d67ec..b24ff83d2ff2 100644
--- a/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx
+++ b/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx
@@ -226,7 +226,7 @@ int MissingCellListTool::execute() const {
 //    if (inc.type()=="BeginEvent") {
 //      ATH_MSG(DEBUG) << " got begining event" << endmsg;
 //      m_needSetup = true;
-//      //if(prepareCellList().isFailure()) ATH_MSG(ERROR)<< " Couldń t build missing cell list !!"<<endmsg;
+//      //if(prepareCellList().isFailure()) ATH_MSG(ERROR)<< " Could not build missing cell list !!"<<endmsg;
 //    }
    
 //  }
diff --git a/Reconstruction/eflowRec/eflowRec/eflowCellIntegrator.h b/Reconstruction/eflowRec/eflowRec/eflowCellIntegrator.h
index e302e6c8bdef..9552c649688c 100644
--- a/Reconstruction/eflowRec/eflowRec/eflowCellIntegrator.h
+++ b/Reconstruction/eflowRec/eflowRec/eflowCellIntegrator.h
@@ -40,7 +40,7 @@ public:
   virtual ~eflowRecursiveGaussLegendreIntegrator() { }
 
   virtual double integrate(const eflowRange& range) {
-    /* Try a 5th and 6th order Gauss–Legendre quadrature */
+    /* Try a 5th and 6th order Gauss-Legendre quadrature */
     double I5 = DoGaussLegendreIntegration(range, 5);
     double I6 = DoGaussLegendreIntegration(range, 6);
 
@@ -59,7 +59,7 @@ public:
 private:
 
   double DoGaussLegendreIntegration(const eflowRange& range, int nOrder){
-    /* Perform nth order Gauss–Legendre quadrature, see
+    /* Perform nth order Gauss-Legendre quadrature, see
      * http://en.wikipedia.org/wiki/Gaussian_quadrature#Gauss.E2.80.93Legendre_quadrature */
 
     /* Array offset for legendre weights/roots */
diff --git a/Reconstruction/eflowRec/eflowRec/eflowCellPosition.h b/Reconstruction/eflowRec/eflowRec/eflowCellPosition.h
index 3fc879d6c272..7a3d7cb2c8f2 100644
--- a/Reconstruction/eflowRec/eflowRec/eflowCellPosition.h
+++ b/Reconstruction/eflowRec/eflowRec/eflowCellPosition.h
@@ -21,7 +21,7 @@ class CaloCell;
 class eflowAbstractCellList;
 
 /**
-This class stores the eta,phi and layer of the calorimeter cell and defines a “<” operator which can be used to order the eflowCellPosition based on eta,phi and layer. The < operator makes use of a stored pointer to the eflowAbstractCellList that the eflowCellPosition is in, in order to use eflowCellList::DR2 inside the < operator.
+This class stores the eta,phi and layer of the calorimeter cell and defines a "<" operator which can be used to order the eflowCellPosition based on eta,phi and layer. The < operator makes use of a stored pointer to the eflowAbstractCellList that the eflowCellPosition is in, in order to use eflowCellList::DR2 inside the < operator.
 
 So conceptually we can consider that a track has some list of associated calorimeter cells in the eflowCellList, where the information that we need for each cell is stored in the eflowCellPosition. A map is kept to link the eflowCellPosition back to the actual CaloCell.
 */
diff --git a/Reconstruction/egamma/egammaEvent/egammaEvent/EMShower.h b/Reconstruction/egamma/egammaEvent/egammaEvent/EMShower.h
index 43633463ab33..aa1e885f7fba 100755
--- a/Reconstruction/egamma/egammaEvent/egammaEvent/EMShower.h
+++ b/Reconstruction/egamma/egammaEvent/egammaEvent/EMShower.h
@@ -91,7 +91,7 @@ class EMShower : public egDetail
   double  e2ts1() const;    
   /** @brief energy of the cell corresponding to second energy maximum in the first sampling*/
   double  e2tsts1() const;  
-  /** @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strips around the strip with highest energy*/
+  /** @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in +- n strips around the strip with highest energy*/
   double  fracs1() const;   
   /** @brief same as egammaParameters::weta1 but without corrections 
   on particle impact point inside the cell*/
@@ -116,7 +116,7 @@ class EMShower : public egDetail
   double  pos7() const; 
   /** @brief  barycentre in sampling 1 calculated in 3 strips*/
   double  barys1() const;   
-  /** @brief shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum*/
+  /** @brief shower width is determined in a window detaxdphi = 0,0625 x~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum*/
   double  wtots1() const;   
   /** @brief energy reconstructed in the strip with the minimal value between the first and second maximum*/
   double  emins1() const;   
diff --git a/Reconstruction/egamma/egammaEvent/egammaEvent/egammaParamDefs.h b/Reconstruction/egamma/egammaEvent/egammaEvent/egammaParamDefs.h
index bd50254c5cc9..67411aabec6d 100755
--- a/Reconstruction/egamma/egammaEvent/egammaEvent/egammaParamDefs.h
+++ b/Reconstruction/egamma/egammaEvent/egammaEvent/egammaParamDefs.h
@@ -137,7 +137,7 @@ namespace egammaParameters {
     e2ts1 = 26,
     /** @brief energy of the cell corresponding to second energy maximum in the first sampling */
     e2tsts1 = 27,
-    /** @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strips around the strip with highest energy */
+    /** @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in +- n strips around the strip with highest energy */
     fracs1 = 28,
     /** @brief same as egammaParameters::weta1 but without corrections 
   on particle impact point inside the cell */
@@ -161,7 +161,7 @@ namespace egammaParameters {
     pos7 = 35,
     /** @brief  barycentre in sampling 1 calculated in 3 strips*/
     barys1 = 36,
-    /** @brief shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum */
+    /** @brief shower width is determined in a window detaxdphi = 0,0625 ~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum */
     wtots1 = 37,
     /** @brief energy reconstructed in the strip with the minimal value between the first and second maximum */
     emins1 = 38,
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyAndHitGAN.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyAndHitGAN.cxx
index d73451fc8184..ade74e9bfa4c 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyAndHitGAN.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyAndHitGAN.cxx
@@ -319,7 +319,7 @@ bool TFCSEnergyAndHitGAN::fillEnergy(TFCSSimulationState& simulstate, const TFCS
           nHitsAlpha = ceil(2 * TMath::Pi() * r / binResolution);
         }
         else{
-          //d = 2•r•sin (a/2r) this distance at the upper r must be 1mm for layer 1 or 5, 5mm otherwise. 
+          //d = 2*r*sin (a/2r) this distance at the upper r must be 1mm for layer 1 or 5, 5mm otherwise. 
           TAxis* y = (TAxis*)h->GetYaxis();
           double angle = y->GetBinUpEdge(iy) - y->GetBinLowEdge(iy);
           double r = x->GetBinUpEdge(ix);
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/EnergyLossSamplerBetheHeitler.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/EnergyLossSamplerBetheHeitler.cxx
index 95393d247010..b991cab5be8b 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/EnergyLossSamplerBetheHeitler.cxx
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/EnergyLossSamplerBetheHeitler.cxx
@@ -111,8 +111,8 @@ Trk::EnergyLoss* iFatras::EnergyLossSamplerBetheHeitler::energyLoss( const Trk::
 
 
   //Bethe-Heitler for electron brem description as described here:
-  // "A Gaussian-mixture approximation of the Bethe–Heitler model of electron energy loss by bremsstrahlung"
-  // R. Frühwirth
+  // "A Gaussian-mixture approximation of the Bethe-Heitler model of electron energy loss by bremsstrahlung"
+  // R. Fruehwirth
   
   double u = CLHEP::RandGamma::shoot(m_randomEngine, pathLength / log(2.), 1.);
   double z = exp( -1. * u );
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.cxx
index e0370add52c0..a3fe3be47e9e 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.cxx
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.cxx
@@ -103,8 +103,8 @@ double iFatras::MultipleScatteringSamplerGeneralMixture::simTheta(const Trk::Mat
   
   if (particle != Trk::electron) {
     //----------------------------------------------------------------------------------------------//
-    //see Mixture models of multiple scattering: computation and simulation. - R.Frühwirth, M. Liendl. -
-    //Computer Physics Communications 141 (2001) 230–246
+    //see Mixture models of multiple scattering: computation and simulation. - R.Fruehwirth, M. Liendl. -
+    //Computer Physics Communications 141 (2001) 230 246
     //----------------------------------------------------------------------------------------------//
     std::vector<double> scattering_params;
     // Decide which mixture is best
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.h b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.h
index 191fcf2a6349..11e32b5b00b7 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.h
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.h
@@ -76,7 +76,7 @@ namespace iFatras {
       static double         s_log_RossiGreisen;      //!< main factor for Rossi-Greisen formula
       
       
-      // ========= General mixture model R.Frühwirth, M. Liendl. Comp. Phys. Comm. 141 (2001) 230–246 =========
+      // ========= General mixture model R.Fruehwirth, M. Liendl. Comp. Phys. Comm. 141 (2001) 230-246 =========
       static double	    s_genMixScale;	    //!< General mixture model: Scaling factor
       
       //!< General mixture model: get parameters for single gaussian simulation
diff --git a/Tracking/TrkAlignment/TrkAlignGenTools/src/MatrixTool.cxx b/Tracking/TrkAlignment/TrkAlignGenTools/src/MatrixTool.cxx
index 7ebc45249224..14484dd0c273 100644
--- a/Tracking/TrkAlignment/TrkAlignGenTools/src/MatrixTool.cxx
+++ b/Tracking/TrkAlignment/TrkAlignGenTools/src/MatrixTool.cxx
@@ -860,7 +860,7 @@ namespace Trk {
   void MatrixTool::storeInTFile(TString filename)
   {
     //Store reults in a single TFile....
-    //Including Matrix Vector Hitmap.. Soluton EV’s etc.
+    //Including Matrix Vector Hitmap.. Soluton EVs etc.
     
     ATH_MSG_INFO("Writing Results to a TFile");
     
diff --git a/Tracking/TrkDetDescr/TrkDetDescrGeoModelCnv/src/GeoShapeConverter.cxx b/Tracking/TrkDetDescr/TrkDetDescrGeoModelCnv/src/GeoShapeConverter.cxx
index e62ddccfe22e..16a6b384416b 100755
--- a/Tracking/TrkDetDescr/TrkDetDescrGeoModelCnv/src/GeoShapeConverter.cxx
+++ b/Tracking/TrkDetDescr/TrkDetDescrGeoModelCnv/src/GeoShapeConverter.cxx
@@ -49,7 +49,7 @@
 namespace {
 	//commonly used axes
 	const Amg::Vector3D gXAxis(1.0, 0.0, 0.0), gYAxis(0.0, 1.0, 0.0), gZAxis(0.0, 0.0, 1.0);
-	//commonly used angles, ±90°, 180°
+	//commonly used angles, +-90 degree, 180 degree
 	const double p90deg(90.0 * Gaudi::Units::deg), m90deg(-90.0 * Gaudi::Units::deg), p180deg(180.0 * Gaudi::Units::deg);
 }
 
diff --git a/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/MaterialMapper.cxx b/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/MaterialMapper.cxx
index 62f34f118ebd..09bf5c434a27 100755
--- a/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/MaterialMapper.cxx
+++ b/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/MaterialMapper.cxx
@@ -636,8 +636,8 @@ void Trk::MaterialMapper::bookValidationTree()
     m_validationTree->Branch("Path",                   &m_mappedPath,            "path/F");
     m_validationTree->Branch("PathInX0",               &m_mappedPathInX0,        "pathInX0/F");
     m_validationTree->Branch("PathInL0",               &m_mappedPathInL0,        "pathInL0/F");
-    m_validationTree->Branch("PathRho",                &m_mappedPathRho,         "pathRho/F¯");
-    m_validationTree->Branch("PathZARho",              &m_mappedPathZARho,       "pathZARho/F¯");
+    m_validationTree->Branch("PathRho",                &m_mappedPathRho,         "pathRho/F");
+    m_validationTree->Branch("PathZARho",              &m_mappedPathZARho,       "pathZARho/F");
     m_validationTree->Branch("UnmappedPathInX0",       &m_unmappedPathInX0,      "unmappedPathInX0/F");
     m_validationTree->Branch("MaterialSteps",          &m_materialSteps,         "steps/I");
     m_validationTree->Branch("Mapped",                 m_mapped,                 "mapped[steps]/I");
diff --git a/Tracking/TrkEvent/VxMultiVertex/VxMultiVertex/MVFVxContainer.h b/Tracking/TrkEvent/VxMultiVertex/VxMultiVertex/MVFVxContainer.h
index eacf58c8f3bd..6f25ad8e721c 100755
--- a/Tracking/TrkEvent/VxMultiVertex/VxMultiVertex/MVFVxContainer.h
+++ b/Tracking/TrkEvent/VxMultiVertex/VxMultiVertex/MVFVxContainer.h
@@ -18,7 +18,7 @@
  *  MVFVxCandidate objects alone would beed to be 
  *  stored. In the resent reconstruction, the 
  *  VxContainer is used to store any kind of
- *  Trk::VxCandidate´s.
+ *  Trk::VxCandidate.
  *
  *  begin   : 18-08-2006
  *  authors  Giacinto Piacquadio (Freiburg University)
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfSmoother.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfSmoother.cxx
index 4dba395e6017..b1c17980a2cc 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfSmoother.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfSmoother.cxx
@@ -226,7 +226,7 @@ Trk::GsfSmoother::fit(const EventContext& ctx,
     forwardTrajectory.rbegin() + 1;
   Trk::ForwardTrajectory::const_reverse_iterator lasttrackStateOnSurface =
     forwardTrajectory.rend() - 1;
-  // TSOS that the cluster measuremenet will added on after .. can’t be teh last
+  // TSOS that the cluster measuremenet will added on after .. cannot be teh last
   // as the impact parameters will be compromised
   Trk::ForwardTrajectory::const_reverse_iterator secondLastTrackStateOnSurface =
     forwardTrajectory.rend() - 2;
diff --git a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
index 104596fc7ba2..c6632eebbbc6 100644
--- a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
+++ b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
@@ -1002,7 +1002,7 @@ CaloEnergy* Trk::TrkMaterialProviderTool::getParamCaloELoss(Trk::Track* track) c
 }
 
 
-//////////////////////////////////////////////// Privé //////////////////////////////////////////////////////
+//////////////////////////////////////////////// Privat //////////////////////////////////////////////////////
  
 /**Helper to get last calo TSOS with TP*/
 const Trk::TrackStateOnSurface* Trk::TrkMaterialProviderTool::getCaloExitTSOS(const std::vector<const Trk::TrackStateOnSurface*>* caloTSOS, Trk::PropDirection dir) const
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h
index 977044386c91..350f5fa30e27 100755
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h
@@ -297,7 +297,7 @@ protected:
     ServiceHandle<IROBDataProviderSvc>         m_robDataProvider;
 
   /** iterators to LArCells type depending on
-      access wa§y (IDC or Cont) */
+      access way (IDC or Cont) */
   LArTT_Selector<LArCellCont>* m_sel;
   LArTT_Selector<LArCellCont>* m_sellarfull;
   LArTT_Selector<LArCellCont>* m_selem;
diff --git a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
index d1d3bfca4e4e..fb70f760080b 100644
--- a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
+++ b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
@@ -326,7 +326,7 @@ void TrigT1CaloTauFex::IsolationCorett(const std::vector<const CaloCell*>& scell
         float deltaphiInner = 0.05;
         for(auto scell : scells) {
                 if ( std::abs( scell->eta() - etacell) > deltaetaOuter2 ) continue;
-                if (scell->caloDDE()->getSampling()!=1 && scell->caloDDE()->getSampling()!=5 && cell->caloDDE()->getSampling()!=4 && cell->caloDDE()->getSampling()!=8) deltaetaOuter1 = 1.0; // tighter isolation in 1° and 2° layers
+                if (scell->caloDDE()->getSampling()!=1 && scell->caloDDE()->getSampling()!=5 && cell->caloDDE()->getSampling()!=4 && cell->caloDDE()->getSampling()!=8) deltaetaOuter1 = 1.0; // tighter isolation in 1 grad  and 2 grad layers
                 float dphi = std::abs( scell->phi() - phicell);
                 dphi = std::abs( M_PI - dphi );
                 dphi = std::abs( M_PI - dphi );
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx
index eacb278d2c7b..b1e0e9968a14 100644
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx
@@ -1,5 +1,5 @@
 /* 
-Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration

+Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 #include "../HLTBjetMonTool.h"
 #include "../TrigBjetMonitorAlgorithm.h"
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/xaod/CmxRoIByteStreamAuxCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/xaod/CmxRoIByteStreamAuxCnv.cxx
index 15cc5487a9fa..fe8f2e9d65fe 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/xaod/CmxRoIByteStreamAuxCnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/xaod/CmxRoIByteStreamAuxCnv.cxx
@@ -109,7 +109,7 @@ StatusCode CmxRoIByteStreamAuxCnv::createObj(IOpaqueAddress* pAddr,
   item->initialize(source.ex(), source.ey(), source.et(),
     source.exError(), source.eyError(), source.etError(),
     //source.sumEtHits(), source.missingEtHits(),
-    // amazurov: values for EtHits and missingEtHits are swaзув in source 
+    // amazurov: values for EtHits and missingEtHits are swaped in source 
     source.missingEtHits(), source.sumEtHits(),
     source.missingEtSigHits(),
     source.ex(LVL1::CMXRoI::SumType::MASKED),
@@ -119,7 +119,7 @@ StatusCode CmxRoIByteStreamAuxCnv::createObj(IOpaqueAddress* pAddr,
     source.eyError(LVL1::CMXRoI::SumType::MASKED),
     source.etError(LVL1::CMXRoI::SumType::MASKED),
     // source.sumEtHits(LVL1::CMXRoI::SumType::MASKED), source.missingEtHits(LVL1::CMXRoI::SumType::MASKED)
-    // amazurov: values for EtHits and missingEtHits are swaзув in source  
+    // amazurov: values for EtHits and missingEtHits are swaped in source  
     source.missingEtHits(LVL1::CMXRoI::SumType::MASKED), source.sumEtHits(LVL1::CMXRoI::SumType::MASKED)
   );
 
diff --git a/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx b/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx
index e85f1ce9c111..ffb0ddb3e441 100644
--- a/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx
+++ b/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx
@@ -469,7 +469,7 @@ bool TrigTrackSeedGenerator::validateLayerPairNew(int layerI, int layerJ, float
     }
   }
   //if(m_minCoord>m_maxCoord) {
-  // std::cout<<"WRONG ORDER: m_minCoord="<<m_minCoord<<" m_maxCoord="<<m_maxCoord<<std::endl;
+  //std::cout<<"WRONG ORDER: m_minCoord="<<m_minCoord<<" m_maxCoord="<<m_maxCoord<<std::endl;
   // }
   //float tmp = m_maxCoord;m_maxCoord = m_minCoord;m_minCoord = tmp;
   //}
diff --git a/Trigger/TrigTools/TrigVKalFitter/src/CvtTrigTrack.cxx b/Trigger/TrigTools/TrigVKalFitter/src/CvtTrigTrack.cxx
index 87c1f90240c0..c503f3402ae9 100755
--- a/Trigger/TrigTools/TrigVKalFitter/src/CvtTrigTrack.cxx
+++ b/Trigger/TrigTools/TrigVKalFitter/src/CvtTrigTrack.cxx
@@ -112,7 +112,7 @@
        if(CovI[1][1] < 1.e-30) CovI[2][2] = 3.0e-4;                 // 1deg   phi
        if(CovI[2][2] < 1.e-30) CovI[1][1] = 4.0e-4;                 // 200mkm   Z
        if(CovI[3][3] < 1.e-30) CovI[3][3] = 1.0e-4;                 // 0.01   eta
-       if(CovI[4][4] < 1.e-30) CovI[4][4] = 1.0e-4*std::pow(PtVert,4);   // 0.01*Pt²  Pt error
+       if(CovI[4][4] < 1.e-30) CovI[4][4] = 1.0e-4*std::pow(PtVert,4);   // 0.01*Pt  Pt error
 
            /* D(new)/D(old) */
 
-- 
GitLab


From 9c0f33f07fc306c8987bbf6c366031200d456dca Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 15 Jul 2020 11:19:36 +0200
Subject: [PATCH 078/422] Fixed clusters per plane

---
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  23 +-
 .../src/AFPSiLayerAlgorithm.cxx               | 474 ++++++++++--------
 2 files changed, 280 insertions(+), 217 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index b7d074761c06..6b638e06682d 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -50,19 +50,19 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for {0} Layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
     array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
     array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};x [mm];y [mm]', type='TH2F', path='Cluster', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
-    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters in station {0}, layer {1};lb; clustersPerEvent / <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
+    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerEvent / <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
 
 
     array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
     array.defineHistogram('trackY,trackX', title='Track in AFP station {0};x [mm];y [mm]', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
-    array.defineHistogram('lb,clustersPerStation', title ='Number of clusters in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerStationFront', title ='(Front) Number of clusters in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerStationEnd', title ='(End) Number of clusters in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerStationMiddle', title ='(Middle) Number of clusters in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStation', title ='Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationFront', title ='(Front) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationEnd', title ='(End) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationMiddle', title ='(Middle) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
 
     arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
     arrayOneList.defineHistogram('barInTrainID,trainID', title='ToF hit bar vs train {0};barInTrainID;trainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
@@ -91,9 +91,10 @@ if __name__=='__main__':
     #file = '/afs/cern.ch/user/l/ladamczy/public/data18_13TeV.00354309.physics_Main.ESD._lb0130._SFO-1._0001.data.r22'
 
     #ConfigFlags.Input.Files = [nightly+file]
-    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod4.pool.root']
+    #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_6/aod0.pool.root']
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput32.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput45-337176-CorrectMask.root'
     
     ConfigFlags.lock()
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 456c37dadf77..17facee52447 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -23,15 +23,15 @@
 	unsigned int clusterCounterStationEnd[1000][4];
 	unsigned int clusterCounterStationMiddle[1000][4];
 
-	int previouslb = -1;
-	int previouslbFront = -1;
-	int previouslbEnd = -1;
-	int previouslbMiddle = -1;
+	int previouslb = 0;
+	int previouslbFront = 0;
+	int previouslbEnd = 0;
+	int previouslbMiddle = 0;
 	
-	int previouslbStation = -1;
-	int previouslbStationFront = -1;
-	int previouslbStationEnd = -1;
-	int previouslbStationMiddle = -1;
+	int previouslbStation = 0;
+	int previouslbStationFront = 0;
+	int previouslbStationEnd = 0;
+	int previouslbStationMiddle = 0;
 
 	unsigned int counterForEvents = 0;
 	unsigned int counterForEventsFront = 0;
@@ -43,16 +43,64 @@
 	unsigned int counterForEventsStationEnd = 0;
 	unsigned int counterForEventsStationMiddle = 0;
 	
-	int frontBCIDs[] = {63,75,87,99,114,126,138,150,165,177,189,201,240,252,264,276,291,303,315,327,342,354,366,378,-1};
 	
-	int middleBCIDs[] = {64,65,66,67,68,69,76,77,78,79,80,81,88,89,90,91,92,93,100,101,102,103,104,105,115,
-	116,117,118,119,120,127,128,129,130,131,132,139,140,141,142,143,144,151,152,153,154,155,156,166,167,168,169,170,171,
-	178,179,180,181,182,183,190,191,192,193,194,195,202,203,204,205,206,207,241,242,243,244,245,246,253,254,255,256,257,
-	258,265,266,267,268,269,270,277,278,279,280,281,282,292,293,294,295,296,297,304,305,306,307,308,309,316,317,318,319,
-	320,321,328,329,330,331,332,333,343,344,345,346,347,348,355,356,357,358,359,360,367,368,369,370,371,372,379,380,381,
-	382,383,384,-1};
+	int frontBCIDs[] = {63,75,87,99,114,126,138,150,165,177,189,201,240,252,264,276,291,303,315,327,342,354,366,378,417,429,441,453,468,480,492,
+504,519,531,543,555,594,606,618,630,645,657,669,681,696,708,720,732,780,792,804,816,831,843,855,867,882,894,906,918,957,969,981,993,1008,1020,
+1032,1044,1059,1071,1083,1095,1134,1146,1158,1170,1185,1197,1209,1221,1236,1248,1260,1272,1311,1323,1335,1347,1362,1374,1386,1398,1413,1425,1437,
+1449,1488,1500,1512,1524,1539,1551,1563,1575,1590,1602,1614,1626,1674,1686,1698,1710,1725,1737,1749,1761,1776,1788,1800,1812,1851,1863,1875,1887,
+1902,1914,1926,1938,1953,1965,1977,1989,2028,2040,2052,2064,2079,2091,2103,2115,2130,2142,2154,2166,2205,2217,2229,2241,2256,2268,2280,2292,2307,
+2319,2331,2343,2382,2394,2406,2418,2433,2445,2457,2469,2484,2496,2508,2520,2568,2580,2592,2604,2619,2631,2643,2655,2670,2682,2694,2706,2745,2757,
+2769,2781,2796,2808,2820,2832,2847,2859,2871,2883,2922,2934,2946,2958,2973,2985,2997,3009,3024,3036,3048,3060,3099,3111,3123,3135,3150,3162,3174,
+3186,3201,3213,3225,3237,3276,3288,3300,3312,3327,3339,3351,3363,3378,3390,3402,3414,-1};
 	
-	int endBCIDs[] = {70,82,94,106,121,133,145,157,172,184,196,208,247,259,271,283,298,310,322,334,349,361,373,385,-1};
+	int middleBCIDs[] = {64,65,66,67,68,69,76,77,78,79,80,81,88,89,90,91,92,93,100,101,102,103,104,105,115,116,117,118,119,120,127,128,129,130,131,132,139,140,141,142,143,144,151,
+152,153,154,155,156,166,167,168,169,170,171,178,179,180,181,182,183,190,191,192,193,194,195,202,203,204,205,206,207,241,242,243,244,245,246,253,254,255,256,257,258,
+265,266,267,268,269,270,277,278,279,280,281,282,292,293,294,295,296,297,304,305,306,307,308,309,316,317,318,319,320,321,328,329,330,331,332,333,343,344,345,346,347,
+348,355,356,357,358,359,360,367,368,369,370,371,372,379,380,381,382,383,384,418,419,420,421,422,423,430,431,432,433,434,435,442,443,444,445,446,447,454,455,456,457,
+458,459,469,470,471,472,473,474,481,482,483,484,485,486,493,494,495,496,497,498,505,506,507,508,509,510,520,521,522,523,524,525,532,533,534,535,536,537,544,545,546,
+547,548,549,556,557,558,559,560,561,595,596,597,598,599,600,607,608,609,610,611,612,619,620,621,622,623,624,631,632,633,634,635,636,646,647,648,649,650,651,658,659,
+660,661,662,663,670,671,672,673,674,675,682,683,684,685,686,687,697,698,699,700,701,702,709,710,711,712,713,714,721,722,723,724,725,726,733,734,735,736,737,738,781,
+782,783,784,785,786,793,794,795,796,797,798,805,806,807,808,809,810,817,818,819,820,821,822,832,833,834,835,836,837,844,845,846,847,848,849,856,857,858,859,860,861,
+868,869,870,871,872,873,883,884,885,886,887,888,895,896,897,898,899,900,907,908,909,910,911,912,919,920,921,922,923,924,958,959,960,961,962,963,970,971,972,973,974,
+975,982,983,984,985,986,987,994,995,996,997,998,999,1009,1010,1011,1012,1013,1014,1021,1022,1023,1024,1025,1026,1033,1034,1035,1036,1037,1038,1045,1046,1047,1048,
+1049,1050,1060,1061,1062,1063,1064,1065,1072,1073,1074,1075,1076,1077,1084,1085,1086,1087,1088,1089,1096,1097,1098,1099,1100,1101,1135,1136,1137,1138,1139,1140,1147,
+1148,1149,1150,1151,1152,1159,1160,1161,1162,1163,1164,1171,1172,1173,1174,1175,1176,1186,1187,1188,1189,1190,1191,1198,1199,1200,1201,1202,1203,1210,1211,1212,1213,
+1214,1215,1222,1223,1224,1225,1226,1227,1237,1238,1239,1240,1241,1242,1249,1250,1251,1252,1253,1254,1261,1262,1263,1264,1265,1266,1273,1274,1275,1276,1277,1278,1312,
+1313,1314,1315,1316,1317,1324,1325,1326,1327,1328,1329,1336,1337,1338,1339,1340,1341,1348,1349,1350,1351,1352,1353,1363,1364,1365,1366,1367,1368,1375,1376,1377,1378,
+1379,1380,1387,1388,1389,1390,1391,1392,1399,1400,1401,1402,1403,1404,1414,1415,1416,1417,1418,1419,1426,1427,1428,1429,1430,1431,1438,1439,1440,1441,1442,1443,1450,
+1451,1452,1453,1454,1455,1489,1490,1491,1492,1493,1494,1501,1502,1503,1504,1505,1506,1513,1514,1515,1516,1517,1518,1525,1526,1527,1528,1529,1530,1540,1541,1542,1543,
+1544,1545,1552,1553,1554,1555,1556,1557,1564,1565,1566,1567,1568,1569,1576,1577,1578,1579,1580,1581,1591,1592,1593,1594,1595,1596,1603,1604,1605,1606,1607,1608,1615,
+1616,1617,1618,1619,1620,1627,1628,1629,1630,1631,1632,1675,1676,1677,1678,1679,1680,1687,1688,1689,1690,1691,1692,1699,1700,1701,1702,1703,1704,1711,1712,1713,1714,
+1715,1716,1726,1727,1728,1729,1730,1731,1738,1739,1740,1741,1742,1743,1750,1751,1752,1753,1754,1755,1762,1763,1764,1765,1766,1767,1777,1778,1779,1780,1781,1782,1789,
+1790,1791,1792,1793,1794,1801,1802,1803,1804,1805,1806,1813,1814,1815,1816,1817,1818,1852,1853,1854,1855,1856,1857,1864,1865,1866,1867,1868,1869,1876,1877,1878,1879,
+1880,1881,1888,1889,1890,1891,1892,1893,1903,1904,1905,1906,1907,1908,1915,1916,1917,1918,1919,1920,1927,1928,1929,1930,1931,1932,1939,1940,1941,1942,1943,1944,1954,
+1955,1956,1957,1958,1959,1966,1967,1968,1969,1970,1971,1978,1979,1980,1981,1982,1983,1990,1991,1992,1993,1994,1995,2029,2030,2031,2032,2033,2034,2041,2042,2043,2044,
+2045,2046,2053,2054,2055,2056,2057,2058,2065,2066,2067,2068,2069,2070,2080,2081,2082,2083,2084,2085,2092,2093,2094,2095,2096,2097,2104,2105,2106,2107,2108,2109,2116,
+2117,2118,2119,2120,2121,2131,2132,2133,2134,2135,2136,2143,2144,2145,2146,2147,2148,2155,2156,2157,2158,2159,2160,2167,2168,2169,2170,2171,2172,2206,2207,2208,2209,
+2210,2211,2218,2219,2220,2221,2222,2223,2230,2231,2232,2233,2234,2235,2242,2243,2244,2245,2246,2247,2257,2258,2259,2260,2261,2262,2269,2270,2271,2272,2273,2274,2281,
+2282,2283,2284,2285,2286,2293,2294,2295,2296,2297,2298,2308,2309,2310,2311,2312,2313,2320,2321,2322,2323,2324,2325,2332,2333,2334,2335,2336,2337,2344,2345,2346,2347,
+2348,2349,2383,2384,2385,2386,2387,2388,2395,2396,2397,2398,2399,2400,2407,2408,2409,2410,2411,2412,2419,2420,2421,2422,2423,2424,2434,2435,2436,2437,2438,2439,2446,
+2447,2448,2449,2450,2451,2458,2459,2460,2461,2462,2463,2470,2471,2472,2473,2474,2475,2485,2486,2487,2488,2489,2490,2497,2498,2499,2500,2501,2502,2509,2510,2511,2512,
+2513,2514,2521,2522,2523,2524,2525,2526,2569,2570,2571,2572,2573,2574,2581,2582,2583,2584,2585,2586,2593,2594,2595,2596,2597,2598,2605,2606,2607,2608,2609,2610,2620,
+2621,2622,2623,2624,2625,2632,2633,2634,2635,2636,2637,2644,2645,2646,2647,2648,2649,2656,2657,2658,2659,2660,2661,2671,2672,2673,2674,2675,2676,2683,2684,2685,2686,
+2687,2688,2695,2696,2697,2698,2699,2700,2707,2708,2709,2710,2711,2712,2746,2747,2748,2749,2750,2751,2758,2759,2760,2761,2762,2763,2770,2771,2772,2773,2774,2775,2782,
+2783,2784,2785,2786,2787,2797,2798,2799,2800,2801,2802,2809,2810,2811,2812,2813,2814,2821,2822,2823,2824,2825,2826,2833,2834,2835,2836,2837,2838,2848,2849,2850,2851,
+2852,2853,2860,2861,2862,2863,2864,2865,2872,2873,2874,2875,2876,2877,2884,2885,2886,2887,2888,2889,2923,2924,2925,2926,2927,2928,2935,2936,2937,2938,2939,2940,2947,
+2948,2949,2950,2951,2952,2959,2960,2961,2962,2963,2964,2974,2975,2976,2977,2978,2979,2986,2987,2988,2989,2990,2991,2998,2999,3000,3001,3002,3003,3010,3011,3012,3013,
+3014,3015,3025,3026,3027,3028,3029,3030,3037,3038,3039,3040,3041,3042,3049,3050,3051,3052,3053,3054,3061,3062,3063,3064,3065,3066,3100,3101,3102,3103,3104,3105,3112,
+3113,3114,3115,3116,3117,3124,3125,3126,3127,3128,3129,3136,3137,3138,3139,3140,3141,3151,3152,3153,3154,3155,3156,3163,3164,3165,3166,3167,3168,3175,3176,3177,3178,
+3179,3180,3187,3188,3189,3190,3191,3192,3202,3203,3204,3205,3206,3207,3214,3215,3216,3217,3218,3219,3226,3227,3228,3229,3230,3231,3238,3239,3240,3241,3242,3243,3277,
+3278,3279,3280,3281,3282,3289,3290,3291,3292,3293,3294,3301,3302,3303,3304,3305,3306,3313,3314,3315,3316,3317,3318,3328,3329,3330,3331,3332,3333,3340,3341,3342,3343,
+3344,3345,3352,3353,3354,3355,3356,3357,3364,3365,3366,3367,3368,3369,3379,3380,3381,3382,3383,3384,3391,3392,3393,3394,3395,3396,3403,3404,3405,3406,3407,3408,3415,
+3416,3417,3418,3419,3420,-1};
+	
+	int endBCIDs[] = {70,82,94,106,121,133,145,157,172,184,196,208,247,259,271,283,298,310,322,334,349,361,373,385,424,436,448,460,475,487,499,511,526,538,550,562,
+601,613,625,637,652,664,676,688,703,715,727,739,787,799,811,823,838,850,862,874,889,901,913,925,964,976,988,1000,1015,1027,1039,1051,1066,1078,1090,1102,1141,1153,
+1165,1177,1192,1204,1216,1228,1243,1255,1267,1279,1318,1330,1342,1354,1369,1381,1393,1405,1420,1432,1444,1456,1495,1507,1519,1531,1546,1558,1570,1582,1597,1609,1621,
+1633,1681,1693,1705,1717,1732,1744,1756,1768,1783,1795,1807,1819,1858,1870,1882,1894,1909,1921,1933,1945,1960,1972,1984,1996,2035,2047,2059,2071,2086,2098,2110,2122,
+2137,2149,2161,2173,2212,2224,2236,2248,2263,2275,2287,2299,2314,2326,2338,2350,2389,2401,2413,2425,2440,2452,2464,2476,2491,2503,2515,2527,2575,2587,2599,2611,2626,
+2638,2650,2662,2677,2689,2701,2713,2752,2764,2776,2788,2803,2815,2827,2839,2854,2866,2878,2890,2929,2941,2953,2965,2980,2992,3004,3016,3031,3043,3055,3067,3106,3118,
+3130,3142,3157,3169,3181,3193,3208,3220,3232,3244,3283,3295,3307,3319,3334,3346,3358,3370,3385,3397,3409,3421,-1};
 	
 	bool isInList(int bcid, int* arr)
 	{
@@ -67,6 +115,7 @@
 		}
 		return false;
 	}
+	
 
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
@@ -117,6 +166,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	auto muPerBCID = Monitored::Scalar<float>("muPerBCID", 0.0);
 	auto run = Monitored::Scalar<int>("run",0);
 	auto weight = Monitored::Scalar<float>("weight", 1.0);
+	//auto previouslb = Monitored::Scalar<int>("previouslb", 0);
 
 	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
 	auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 1.0);
@@ -239,87 +289,97 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 // Davide's approach - End
 
 // Kris's approach:
-		for(const auto& cluster : fast.clusters()) 
+	for(const auto& cluster : fast.clusters()) 
+	{
+		clusterX = cluster.x;
+		clusterY = cluster.y;
+		fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX); // Swap after suggestion
+		
+		lb = GetEventInfo(ctx)->lumiBlock();
+		++numberOfClusterStationPlane[cluster.station][cluster.layer];
+		
+		// Time for fill - current and previous lb are different, and the previouslb is not -1 (it means - this is not the first lb)
+		if(lb > previouslb && previouslb != 0)
 		{
-			clusterX = cluster.x;
-			clusterY = cluster.y;
-			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX); // Swap after suggestion
-			
-			lb = GetEventInfo(ctx)->lumiBlock();
-			++numberOfClusterStationPlane[cluster.station][cluster.layer];
-			
-			// Time for fill - current and previous lb are different, and the previouslb is not -1 (it means - this is not the first lb)
-			if(lb != previouslb && previouslb != -1)
+			for(int i=0; i<4; i++)
 			{
-				for(int i=0; i<4; i++)
+				for(int j=0; j<4; j++)
 				{
-					for(int j=0; j<4; j++)
+					clustersPerPlane = clusterCounter[previouslb][i][j]*1.0;
+					if(muPerBCID != 0)
 					{
-						clustersPerPlane = clusterCounter[previouslb][i][j]*1.0;
-						if(muPerBCID != 0)
-						{
-							clustersPerPlane = clustersPerPlane/(muPerBCID*counterForEvents);
-						}
-						else
-						{
-							clustersPerPlane = -99;
-						}
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
+						clustersPerPlane = clustersPerPlane/(muPerBCID*counterForEvents);
 					}
-				}
-				
-				previouslb = lb;
-				++clusterCounter[lb][cluster.station][cluster.layer];
-				counterForEvents=1;
-				
-				for(int i=0; i<4; i++)
-				{
-					for(int j=0; j<4; j++)
+					else
 					{
-						numberOfClusterStationPlane[i][j] = 0;
+						clustersPerPlane = -99;
 					}
+					fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
 				}
 			}
+				
+			previouslb = lb;
+			++clusterCounter[lb][cluster.station][cluster.layer];
+			counterForEvents=1;
 			
-			// First time in lumiblock (in plane)
-			else if(clusterCounter[lb][cluster.station][cluster.layer] == 0) 
+			for(int i=0; i<4; i++)
 			{
-				++clusterCounter[lb][cluster.station][cluster.layer];
-				previouslb = lb;
+				for(int j=0; j<4; j++)
+				{
+					numberOfClusterStationPlane[i][j] = 0;
+				}
 			}
+		}
 			
-			// Lumiblock is same, so proceed
-			else if(lb==previouslb)	// Same lumiblock
-			{++clusterCounter[lb][cluster.station][cluster.layer];}
+			// First time in lumiblock (in plane)
+		else if(clusterCounter[lb][cluster.station][cluster.layer] == 0) 
+		{
+			++clusterCounter[lb][cluster.station][cluster.layer];
+			previouslb = lb;
+		}
 			
-			// =============== Stations ===============
+		// Lumiblock is same, so proceed
+		else if(lb==previouslb)	// Same lumiblock
+		{++clusterCounter[lb][cluster.station][cluster.layer];}
 			
-			if(lb != previouslbStation && previouslbStation != -1)
+	}	// ..... end cluster loop .....
+		
+		
+		
+	// =============== Stations all BCIDs ===============
+	for(const auto& cluster : fast.clusters()) 
+	{
+		lb = GetEventInfo(ctx)->lumiBlock();
+		if(lb > previouslbStation && previouslbStation != 0)
+		{
+			for(int i=0; i<4; i++)
 			{
-				for(int i=0; i<4; i++)
-				{
-					clustersPerStation = clusterCounterStation[previouslbStation][i]*1.0;
-					
-					if(muPerBCID != 0)
-					{clustersPerStation = clustersPerStation/(muPerBCID*counterForEventsStation*4);}
-					else{clustersPerStation = -99;}
+				clustersPerStation = clusterCounterStation[previouslbStation][i]*1.0;
+				if(muPerBCID != 0)
+				{clustersPerStation = clustersPerStation/(muPerBCID*counterForEventsStation*4);}
+				else{clustersPerStation = -99;}
 
-					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
-				}
-				previouslbStation=lb;
-				++clusterCounterStation[lb][cluster.station];
-				counterForEventsStation=1;
-			}
-			else if (clusterCounterStation[lb][cluster.station] == 0)
-			{
-				++clusterCounterStation[lb][cluster.station];
-				previouslbStation = lb;
+				fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
 			}
-			else if (lb==previouslbStation)
-			{++clusterCounterStation[lb][cluster.station];}
-			
-			// ========== Front Station ==========
-			if(lb != previouslbStationFront && previouslbStationFront != -1)
+			previouslbStation=lb;
+			++clusterCounterStation[lb][cluster.station];
+			counterForEventsStation=1;
+		}
+		else if (clusterCounterStation[lb][cluster.station] == 0)
+		{
+			++clusterCounterStation[lb][cluster.station];
+			previouslbStation = lb;
+		}
+		else if (lb==previouslbStation)
+		{++clusterCounterStation[lb][cluster.station];}
+	}
+	// ========== Front Station ==========
+	if(isInList(GetEventInfo(ctx)->bcid(), frontBCIDs))
+	{
+		for(const auto& cluster : fast.clusters()) 
+		{
+			lb = GetEventInfo(ctx)->lumiBlock();
+			if(lb > previouslbStationFront && previouslbStationFront != 0)
 			{
 				for(int i=0; i<4; i++)
 				{
@@ -343,10 +403,17 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			}
 			else if (lb == previouslbStationFront)
 			{++clusterCounterStationFront[lb][cluster.station];}
-			// end front station
+		}
+	}
+	// ..... end front station .....
 			
-			// ========== End Station ==========
-			if(lb != previouslbStationEnd && previouslbStationEnd != -1)
+	// ========== End Station ==========
+	if(isInList(GetEventInfo(ctx)->bcid(), endBCIDs))
+	{	
+		for(const auto& cluster : fast.clusters())
+		{
+			lb = GetEventInfo(ctx)->lumiBlock();
+			if(lb > previouslbStationEnd && previouslbStationEnd != 0)
 			{
 				for(int i=0; i<4; i++)
 				{
@@ -356,7 +423,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 						clustersPerStationEnd = clustersPerStationEnd/(muPerBCID*counterForEventsStationEnd*4);
 					}
 					else{clustersPerStationEnd = -99;}
-					
+				
 					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationEnd);
 				}
 				previouslbStationEnd=lb;
@@ -370,10 +437,16 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			}
 			else if (lb == previouslbStationEnd)
 			{++clusterCounterStationEnd[lb][cluster.station];}
-			// end end station
-			
-			// ========== Middle Station ==========
-			if(lb != previouslbStationMiddle && previouslbStationMiddle != -1)
+		}
+	}
+	// ..... end end station .....
+	
+	// ========== Middle Station ==========
+	if(isInList(GetEventInfo(ctx)->bcid(), middleBCIDs))
+	{
+		for(const auto& cluster : fast.clusters())
+		{
+			if(lb > previouslbStationMiddle && previouslbStationMiddle != 0)
 			{
 				for(int i=0; i<4; i++)
 				{
@@ -383,7 +456,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 						clustersPerStationMiddle = clustersPerStationMiddle/(muPerBCID*counterForEventsStationMiddle*4);
 					}
 					else{clustersPerStationMiddle = -99;}
-					
 					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationMiddle);
 				}
 				previouslbStationMiddle=lb;
@@ -398,169 +470,159 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			else if (lb == previouslbStationMiddle)
 			{++clusterCounterStationMiddle[lb][cluster.station];}
 			// end middle station
-			
+		}
+	}
 			// end stations
-			
-		}	// end cluster loop
 		
-		// ========== Front BCID ==========
-		if(isInList(GetEventInfo(ctx)->bcid(), frontBCIDs))
-		{
-			for(const auto& cluster : fast.clusters()) 
+		// ========== Front BCID ========== (planes)
+	if(isInList(GetEventInfo(ctx)->bcid(), frontBCIDs))
+	{
+		for(const auto& cluster : fast.clusters()) 
+			{
+			lb = GetEventInfo(ctx)->lumiBlock();
+			// Time for fill - current and previous lb are different, and the previouslbFront is not -1 (it means - this is not the first lb)
+			if(lb > previouslbFront && previouslbFront != 0)
 			{
-				lb = GetEventInfo(ctx)->lumiBlock();
-				// Time for fill - current and previous lb are different, and the previouslbFront is not -1 (it means - this is not the first lb)
-				if(lb != previouslbFront && previouslbFront != -1)
+				//std::cout << "\tlb!=previouslbFront" << std::endl;
+				for(int i=0; i<4; i++)
 				{
-					//std::cout << "\tlb!=previouslbFront" << std::endl;
-					for(int i=0; i<4; i++)
+					for(int j=0; j<4; j++)
 					{
-						for(int j=0; j<4; j++)
+						clustersPerPlaneFront = clusterCounterFront[previouslbFront][i][j]*1.0;
+						if(muPerBCID != 0)
+						{
+							clustersPerPlaneFront = clustersPerPlaneFront/(muPerBCID*counterForEventsFront);
+						}
+						else
 						{
-							clustersPerPlaneFront = clusterCounterFront[previouslbFront][i][j]*1.0;
-							if(muPerBCID != 0)
-							{
-								clustersPerPlaneFront = clustersPerPlaneFront/(muPerBCID*counterForEventsFront);
-							}
-							else
-							{
-								clustersPerPlaneFront = -99;
-							}
-							//std::cout << "\tFILL FRONT" << std::endl;
-							//std::cout << "clustersPerPlaneFront (it was zero on cernbox): " << clustersPerPlaneFront << std::endl;
-							fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
+							clustersPerPlaneFront = -99;
 						}
+						//std::cout << "\tFILL FRONT" << std::endl;
+						//std::cout << "clustersPerPlaneFront (it was zero on cernbox): " << clustersPerPlaneFront << std::endl;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
 					}
-					previouslbFront = lb;
-					++clusterCounterFront[lb][cluster.station][cluster.layer];
-					counterForEventsFront=1;
-
-				}
-			
-			// First time in lumiblock (in plane)
-				else if(clusterCounterFront[lb][cluster.station][cluster.layer] == 0) 
-				{
-					++clusterCounterFront[lb][cluster.station][cluster.layer];
-					previouslbFront = lb;
-				//std::cout << "\tFirst time" << std::endl;
-				//std::cout << "\tLuminosity block: " << lb << std::endl;
-				}
-			
-				// Lumiblock is same, so proceed
-				else if(lb==previouslbFront)	// Same lumiblock
-				{
-					++clusterCounterFront[lb][cluster.station][cluster.layer];
 				}
+				previouslbFront = lb;
+				++clusterCounterFront[lb][cluster.station][cluster.layer];
+				counterForEventsFront=1;
+			}
+		
+		// First time in lumiblock (in plane)
+			else if(clusterCounterFront[lb][cluster.station][cluster.layer] == 0) 
+			{
+				++clusterCounterFront[lb][cluster.station][cluster.layer];
+				previouslbFront = lb;
+			//std::cout << "\tFirst time" << std::endl;
+			//std::cout << "\tLuminosity block: " << lb << std::endl;
+			}
+		
+			// Lumiblock is same, so proceed
+			else if(lb==previouslbFront)	// Same lumiblock
+			{
+				++clusterCounterFront[lb][cluster.station][cluster.layer];
 			}
 		}
+	}
 		
-		// ========== End BCID ==========
-		if(isInList(GetEventInfo(ctx)->bcid(), endBCIDs))
+	// ========== End BCID ==========
+	if(isInList(GetEventInfo(ctx)->bcid(), endBCIDs))
+	{
+		for(const auto& cluster : fast.clusters()) 
 		{
-			for(const auto& cluster : fast.clusters()) 
+			lb = GetEventInfo(ctx)->lumiBlock();
+			// Time for fill - current and previous lb are different, and the previouslbEnd is not -1 (it means - this is not the first lb)
+			if(lb > previouslbEnd && previouslbEnd != 0)
 			{
-				lb = GetEventInfo(ctx)->lumiBlock();
-				// Time for fill - current and previous lb are different, and the previouslbEnd is not -1 (it means - this is not the first lb)
-				if(lb != previouslbEnd && previouslbEnd != -1)
+				//std::cout << "\tlb!=previouslbEnd" << std::endl;
+				for(int i=0; i<4; i++)
 				{
-					//std::cout << "\tlb!=previouslbEnd" << std::endl;
-					for(int i=0; i<4; i++)
+					for(int j=0; j<4; j++)
 					{
-						for(int j=0; j<4; j++)
+						clustersPerPlaneEnd = clusterCounterEnd[previouslbEnd][i][j]*1.0;
+						if(muPerBCID != 0)
+						{
+							clustersPerPlaneEnd = clustersPerPlaneEnd/(muPerBCID*counterForEventsEnd);
+						}
+						else
 						{
-							clustersPerPlaneEnd = clusterCounterEnd[previouslbEnd][i][j]*1.0;
-							if(muPerBCID != 0)
-							{
-								clustersPerPlaneEnd = clustersPerPlaneEnd/(muPerBCID*counterForEventsEnd);
-							}
-							else
-							{
-								clustersPerPlaneEnd = -99;
-							}
-							//std::cout << "\tFILL END" << std::endl;
-							//std::cout << "clustersPerPlaneEnd (it was zero on cernbox): " << clustersPerPlaneEnd << std::endl;
-							fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
+							clustersPerPlaneEnd = -99;
 						}
+						//std::cout << "\tFILL END" << std::endl;
+						//std::cout << "clustersPerPlaneEnd (it was zero on cernbox): " << clustersPerPlaneEnd << std::endl;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
 					}
+				}
 					previouslbEnd = lb;
 					++clusterCounterEnd[lb][cluster.station][cluster.layer];
 					counterForEventsEnd=1;
-				}
+			}
 			
 			// First time in lumiblock (in plane)
-				else if(clusterCounterEnd[lb][cluster.station][cluster.layer] == 0) 
-				{
-					++clusterCounterEnd[lb][cluster.station][cluster.layer];				
-					previouslbEnd = lb;
+			else if(clusterCounterEnd[lb][cluster.station][cluster.layer] == 0) 
+			{
+				++clusterCounterEnd[lb][cluster.station][cluster.layer];				
+				previouslbEnd = lb;
 				//std::cout << "\tFirst time" << std::endl;
 				//std::cout << "\tLuminosity block: " << lb << std::endl;
-				}
+			}
 			
-				// Lumiblock is same, so proceed
-				else if(lb==previouslbEnd)	// Same lumiblock
-				{
-					++clusterCounterEnd[lb][cluster.station][cluster.layer];
-				}
+			// Lumiblock is same, so proceed
+			else if(lb==previouslbEnd)	// Same lumiblock
+			{
+				++clusterCounterEnd[lb][cluster.station][cluster.layer];
 			}
 		}
+	}
 		
-		// ========== Middle BCID ==========
-		if(isInList(GetEventInfo(ctx)->bcid(), middleBCIDs))
+	// ========== Middle BCID ==========
+	if(isInList(GetEventInfo(ctx)->bcid(), middleBCIDs))
+	{
+		for(const auto& cluster : fast.clusters()) 
 		{
-			for(const auto& cluster : fast.clusters()) 
+			lb = GetEventInfo(ctx)->lumiBlock();
+			// Time for fill - current and previous lb are different, and the previouslbMiddle is not -1 (it means - this is not the first lb)
+			if(lb > previouslbMiddle && previouslbMiddle != 0)
 			{
-				lb = GetEventInfo(ctx)->lumiBlock();
-				// Time for fill - current and previous lb are different, and the previouslbMiddle is not -1 (it means - this is not the first lb)
-				if(lb != previouslbMiddle && previouslbMiddle != -1)
+				//std::cout << "\tlb!=previouslbMiddle" << std::endl;
+				for(int i=0; i<4; i++)
 				{
-					//std::cout << "\tlb!=previouslbMiddle" << std::endl;
-					for(int i=0; i<4; i++)
+					for(int j=0; j<4; j++)
 					{
-						for(int j=0; j<4; j++)
+						clustersPerPlaneMiddle = clusterCounterMiddle[previouslbMiddle][i][j]*1.0;
+						if(muPerBCID != 0)
 						{
-							clustersPerPlaneMiddle = clusterCounterMiddle[previouslbMiddle][i][j]*1.0;
-							if(muPerBCID != 0)
-							{
-								clustersPerPlaneMiddle = clustersPerPlaneMiddle/(muPerBCID*counterForEventsMiddle);
-							}
-							else
-							{
-								clustersPerPlaneMiddle = -99;
-							}
-							//std::cout << "\tFILL Middle" << std::endl;
-							//std::cout << "clustersPerPlaneMiddle (it was zero on cernbox): " << clustersPerPlaneMiddle << std::endl;
-							fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
+							clustersPerPlaneMiddle = clustersPerPlaneMiddle/(muPerBCID*counterForEventsMiddle);
 						}
+						else
+						{
+							clustersPerPlaneMiddle = -99;
+						}
+						//std::cout << "\tFILL Middle" << std::endl;
+						//std::cout << "clustersPerPlaneMiddle (it was zero on cernbox): " << clustersPerPlaneMiddle << std::endl;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
 					}
-					previouslbMiddle = lb;
-					++clusterCounterMiddle[lb][cluster.station][cluster.layer];
-					counterForEventsMiddle=1;
-				
-				//(int i=0; i<4; i++)
-				//{
-					//for(int j=0; j<4; j++)
-					//{
-					//	numberOfClusterStationPlane[i][j] = 0;
-					//}
-				//}
 				}
+				previouslbMiddle = lb;
+				++clusterCounterMiddle[lb][cluster.station][cluster.layer];
+				counterForEventsMiddle=1;
+			}
 			
 			// First time in lumiblock (in plane)
-				else if(clusterCounterMiddle[lb][cluster.station][cluster.layer] == 0) 
-				{
-					++clusterCounterMiddle[lb][cluster.station][cluster.layer];				
-					previouslbMiddle = lb;
+			else if(clusterCounterMiddle[lb][cluster.station][cluster.layer] == 0) 
+			{
+				++clusterCounterMiddle[lb][cluster.station][cluster.layer];				
+				previouslbMiddle = lb;
 				//std::cout << "\tFirst time" << std::endl;
 				//std::cout << "\tLuminosity block: " << lb << std::endl;
-				}
+			}
 			
-				// Lumiblock is same, so proceed
-				else if(lb==previouslbMiddle)	// Same lumiblock
-				{
-					++clusterCounterMiddle[lb][cluster.station][cluster.layer];
-				}
+			// Lumiblock is same, so proceed
+			else if(lb==previouslbMiddle)	// Same lumiblock
+			{
+				++clusterCounterMiddle[lb][cluster.station][cluster.layer];
 			}
 		}
+	}
 	
 
 
-- 
GitLab


From a9667b9634c209280ad58f4048e24bd3c26b7e81 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@mpp.mpg.de>
Date: Wed, 15 Jul 2020 11:30:02 +0200
Subject: [PATCH 079/422] Implement comments from Walter

---
 .../PixelDigitization/src/SensorSim3DTool.cxx                 | 2 +-
 .../Root/BaseTrackVertexAssociationTool.cxx                   | 4 ++--
 .../Root/TrackVertexAssociationTool.cxx                       | 2 +-
 .../InDetPhysValMonitoring/src/InDetPhysHitDecoratorAlg.cxx   | 3 ---
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
index aa8006f43cc4..7d783d4d5054 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
@@ -598,7 +598,7 @@ double SensorSim3DTool::getMobility(double electricField, bool isHoleBit) {
   double ecrit = 0;
   double beta = 0;
 
-  //These parameterizations come from C. Jacoboni et al., Solidid State Electronics 20 (1977) 77 89. (see also https://cds.cern.ch/record/684187/files/indet-2001-004.pdf).
+  //These parameterizations come from C. Jacoboni et al., Solid-State Electronics 20 (1977) 77-89. (see also https://cds.cern.ch/record/684187/files/indet-2001-004.pdf).
 
   if (!isHoleBit) {
     vsat = 15.3 * pow(m_temperature, -0.87); // mm/ns
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/BaseTrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/BaseTrackVertexAssociationTool.cxx
index 515f7547b0fa..8e02937f3622 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/BaseTrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/BaseTrackVertexAssociationTool.cxx
@@ -29,7 +29,7 @@ StatusCode BaseTrackVertexAssociationTool::initialize()
   ATH_CHECK( m_eventInfo.initialize() );
 
   ATH_MSG_INFO("Cut on d0 significance: " << m_d0sig_cut << "\t(d0sig_cut)");
-  ATH_MSG_INFO("Cut on deltaz * sin theta: " << m_dzSinTheta_cut << "\t(dzSinTheta_cut)");
+  ATH_MSG_INFO("Cut on Δz * sin θ: " << m_dzSinTheta_cut << "\t(dzSinTheta_cut)");
 
   ATH_MSG_WARNING("BaseTrackVertexAssociationTool is being depricated. Please use the new TrackVertexAssociationTool instead.");
 
@@ -129,7 +129,7 @@ bool BaseTrackVertexAssociationTool::isMatch(const xAOD::TrackParticle &trk,
   if (m_d0sig_cut >= 0 && fabs(d0sig) > m_d0sig_cut)
     return false;
 
-  // calculate deltaz * sin theta
+  // calculate Δz * sin θ
   dzSinTheta = fabs((trk_z0 - vx_z0 + beamspot_z0) * sin(theta));
   if (m_dzSinTheta_cut >= 0 && dzSinTheta > m_dzSinTheta_cut)
     return false;
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx
index 64d8ea6ac55d..c9fa0f74cd81 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx
@@ -141,7 +141,7 @@ StatusCode TrackVertexAssociationTool::initialize()
   } else {
     ATH_MSG_INFO("Cut on d0: " << m_d0_cut << "\t(d0_cut)");
   }
-  ATH_MSG_INFO("Cut on deltaz * sin theta: " << m_dzSinTheta_cut << "\t(dzSinTheta_cut)");
+  ATH_MSG_INFO("Cut on Δz * sin θ: " << m_dzSinTheta_cut << "\t(dzSinTheta_cut)");
 
   ATH_MSG_INFO("Allow UsedInFit MatchStatus: " << m_doUsedInFit << "\t(doUsedInFit)");
   ATH_MSG_INFO("Require VxType::PriVtx for unique match: " << m_requirePriVtx << "\t(requirePriVtx)");
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorAlg.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorAlg.cxx
index 3b323979a4ac..b32e7a858e3a 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorAlg.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorAlg.cxx
@@ -27,9 +27,6 @@
 #include <tuple>
 #include <limits>
 
-// ref:
-// https://svnweb.cern.ch/trac/atlasoff/browser/Tracking/TrkEvent/TrkParametersBase/trunk/TrkParametersBase/CurvilinearParametersT.h
-
 
 InDetPhysHitDecoratorAlg::InDetPhysHitDecoratorAlg(const std::string& name, ISvcLocator* pSvcLocator) :
   AthReentrantAlgorithm(name,pSvcLocator),
-- 
GitLab


From 9c7c9409d8059b995e1e73d0f1f8679ebcdd286e Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <averbyts@cern.ch>
Date: Fri, 17 Jul 2020 11:20:24 +0200
Subject: [PATCH 080/422] Make a copy of MR34724  but w/o changes to TauID 
 package

---
 .../TauID/DiTauMassTools/Root/MissingMassCalculator.cxx       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PhysicsAnalysis/TauID/DiTauMassTools/Root/MissingMassCalculator.cxx b/PhysicsAnalysis/TauID/DiTauMassTools/Root/MissingMassCalculator.cxx
index a97249f2a12a..89bf606b334e 100644
--- a/PhysicsAnalysis/TauID/DiTauMassTools/Root/MissingMassCalculator.cxx
+++ b/PhysicsAnalysis/TauID/DiTauMassTools/Root/MissingMassCalculator.cxx
@@ -6851,7 +6851,7 @@ inline double  MissingMassCalculator::fixPhiRange  (const double & phi)
 
 
 // fast approximate calculation of sin and cos
-// approximation good to 1 per mill. s^2+c^2=1 strictly exact though
+// approximation good to 1 per mill. s²+c²=1 strictly exact though
 // it is like using slightly different values of phi1 and phi2
 
 
@@ -6884,7 +6884,7 @@ inline void MissingMassCalculator::fastSinCos (const double & phiInput, double &
   sinPhi=y*(fastP*std::abs(y)+fastQ);
 
 
-  //note that one could use cos(phi)=sin(phi+pi/2), however then one would not have c^2+s^2=1 (would get it only within 1 per mille)
+  //note that one could use cos(phi)=sin(phi+pi/2), however then one would not have c²+s²=1 (would get it only within 1 per mille)
   // the choice here is to keep c^2+s^2=1 so everything is as one would compute c and s from a slightly (1 per mille) different angle
   cosPhi=sqrt(1-std::pow(sinPhi,2));
   if (std::abs(phi)>piOverTwo) cosPhi=-cosPhi;
-- 
GitLab


From f97d617df4b78acd12a86090fecaa9ea29b1e239 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 17 Jul 2020 16:16:54 +0100
Subject: [PATCH 081/422] Got tracking configured

---
 .../python/ComponentAccumulator.py            | 24 +++--
 .../RegionSelector/python/RegSelToolConfig.py |  3 +
 .../TrigInDetConfig/python/TrigInDetConfig.py | 96 +++++++++++++++----
 .../TrigUpgradeTest/share/newJOtest.py        | 17 +++-
 .../python/HLTMenuConfig/Menu/LS2_v1_newJO.py |  4 +-
 5 files changed, 110 insertions(+), 34 deletions(-)

diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py
index d3a43f99da0f..eb369a651493 100644
--- a/Control/AthenaConfiguration/python/ComponentAccumulator.py
+++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py
@@ -26,11 +26,12 @@ class ConfigurationError(RuntimeError):
 
 _basicServicesToCreate=frozenset(('GeoModelSvc','TileInfoLoader','DetDescrCnvSvc','CoreDumpSvc','VTuneProfilerService','EvtIdModifierSvc'))
 
-def printProperties(msg, c, nestLevel = 0):
+def printProperties(msg, c, nestLevel = 0, printDefaults=False):
     # Iterate in sorted order.
     propnames= sorted(c._descriptors.keys())
     for propname in propnames:
-        if not c.is_property_set(propname): 
+        
+        if not printDefaults and not c.is_property_set(propname):
             continue
         propval=getattr(c,propname)
         # Ignore empty lists
@@ -41,7 +42,10 @@ def printProperties(msg, c, nestLevel = 0):
         if propname in ["DetStore","EvtStore"]:
             continue
 
-
+        if isinstance( propval, GaudiConfig2.Configurable ):
+            msg.info( " "*nestLevel +"    * {0}: {1}/{2}".format(propname, propval.__cpp_type__, propval.getName()))
+            printProperties(msg, propval, nestLevel+3)
+            continue
         if isinstance(propval,GaudiHandles.PublicToolHandleArray):
             ths = [th.getName() for th in propval]
             propstr = "PublicToolHandleArray([ {0} ])".format(', '.join(ths))
@@ -138,12 +142,12 @@ class ComponentAccumulator(object):
         self._msg=logging.getLogger('ComponentAccumulator')
 
 
-    def printCondAlgs(self, summariseProps=False, onlyComponents=[]):
+    def printCondAlgs(self, summariseProps=False, onlyComponents=[], printDefaults=False):
         self._msg.info( "Condition Algorithms" )
         for (c, flag) in filterComponents (self._conditionsAlgs, onlyComponents):
             self._msg.info( " " +"\\__ "+ c.name +" (cond alg)" )
             if summariseProps and flag:
-                printProperties(self._msg, c, 1)
+                printProperties(self._msg, c, 1, printDefaults)
         return
         
 
@@ -152,7 +156,7 @@ class ComponentAccumulator(object):
     # in the list with a trailing `-', then only the name of the component
     # will be printed, not its properties.
     def printConfig(self, withDetails=False, summariseProps=False,
-                    onlyComponents = []):
+                    onlyComponents = [], printDefaults=False):
         self._msg.info( "Event Inputs" )
         self._msg.info( "Event Algorithm Sequences" )
 
@@ -176,7 +180,7 @@ class ComponentAccumulator(object):
                     else:
                         self._msg.info( " "*nestLevel +"\\__ "+ c.name +" (alg)" )
                         if summariseProps and flag:
-                            printProperties(self._msg, c, nestLevel)
+                            printProperties(self._msg, c, nestLevel, printDefaults)
 
             for n,s in enumerate(self._allSequences):
                 self._msg.info( "Top sequence {}".format(n) )
@@ -192,7 +196,7 @@ class ComponentAccumulator(object):
             self._msg.info( "  {0},".format(t.getFullJobOptName()) )
             # Not nested, for now
             if summariseProps and flag:
-                printProperties(self._msg, t)
+                printProperties(self._msg, t, printDefaults)
         self._msg.info( "]" )
         self._msg.info( "Private Tools")
         self._msg.info( "[" )
@@ -201,12 +205,12 @@ class ComponentAccumulator(object):
                 self._msg.info( "  {0},".format(t.getFullJobOptsName()) )
                 # Not nested, for now
                 if summariseProps and flag:
-                    printProperties(self._msg, t)
+                    printProperties(self._msg, t, printDefaults)
         else:
             if self._privateTools is not None:
                 self._msg.info( "  {0},".format(self._privateTools.getFullJobOptName()) )
                 if summariseProps:
-                    printProperties(self._msg, self._privateTools)
+                    printProperties(self._msg, self._privateTools, printDefaults)
         self._msg.info( "]" )
         self._msg.info( "TheApp properties" )
         for k,v in six.iteritems(self._theAppProps):
diff --git a/DetectorDescription/RegionSelector/python/RegSelToolConfig.py b/DetectorDescription/RegionSelector/python/RegSelToolConfig.py
index a55964df9e6a..aee84b9695e5 100644
--- a/DetectorDescription/RegionSelector/python/RegSelToolConfig.py
+++ b/DetectorDescription/RegionSelector/python/RegSelToolConfig.py
@@ -190,6 +190,9 @@ def regSelToolCfg(flags, detector, CondAlg, CablingConfigCfg=0):
 def regSelTool_SCT_Cfg(flags):
     return regSelToolCfg(flags, "SCT", CompFactory.SiRegSelCondAlg)
 
+def regSelTool_Pixel_Cfg(flags):
+    return regSelToolCfg(flags, "Pixel", CompFactory.SiRegSelCondAlg)
+
 # muon spectrometer
 
 def regSelTool_MDT_Cfg(flags):
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
index 2dccbbdb48db..1b1b45610fd4 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
@@ -4,6 +4,7 @@
 
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaCommon.Constants import DEBUG
 
 def RungeKuttaPropagatorCfg(flags, **kwargs):
   acc = ComponentAccumulator()
@@ -18,6 +19,7 @@ def SiDetElementsRoadMaker_xkCfg( flags, **kwargs ):
   acc = ComponentAccumulator()
   name = kwargs.pop( "rodMakerName", "InDetTrigSiDetElementsRoadMaker" )
   acc.merge( RungeKuttaPropagatorCfg( flags, **kwargs ) )
+  acc.addCondAlgo( CompFactory.InDet.SiDetElementsRoadCondAlg_xk() )
   tool = CompFactory.InDet.SiDetElementsRoadMaker_xk( name,
                                                       PropagatorTool = acc.getPublicTool( "InDetTrigPatternPropagator" ),
                                                       usePixel     = flags.Detector.PixelOn, # DetFlags.haveRIO.pixel_on(),
@@ -105,7 +107,7 @@ def SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ):
                                                          PixelSummaryTool      = pixelCondSummaryTool,
                                                          SctSummaryTool        = sctCondSummaryTool
                                                         )
-  acc.addPublicTool( tool )
+  acc.setPrivateTools( tool )
   return acc
 
 def SiTrackMaker_xkCfg(flags, **kwargs):
@@ -116,12 +118,12 @@ def SiTrackMaker_xkCfg(flags, **kwargs):
   name = kwargs.pop("name", "SiTrackMaker_xk")
   acc = ComponentAccumulator()
   acc.merge( SiDetElementsRoadMaker_xkCfg( flags, **kwargs ) )
-  acc.merge( SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ) )
+  combTrackFinderTool = acc.popToolsAndMerge( SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ) )
 
   tool = CompFactory.InDet.SiTrackMaker_xk( name,
                                             RoadTool                 = acc.getPublicTool( "InDetTrigSiDetElementsRoadMaker" ),
-                                            CombinatorialTrackFinder = acc.getPublicTool( "InDetTrigSiComTrackFinder" ),
-                                            pTmin                    = 100*Unit.MeV, # TODO use flag for these props
+                                            CombinatorialTrackFinder = combTrackFinderTool,
+                                            pTmin                    = 1000*Unit.MeV, # TODO use flag for these props
                                             nClustersMin             = 7,
                                             nHolesMax                = 3,
                                             nHolesGapMax             = 3,
@@ -278,8 +280,10 @@ def InDetIDCCacheCreatorCfg():
 def TrigInDetCondCfg( flags ):
 
   acc = ComponentAccumulator()
+  from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
+  acc.merge( BeamPipeGeometryCfg( flags ) )
   from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg
-  acc.merge(InDetGeometryCfg(flags))
+  acc.merge( InDetGeometryCfg( flags ) )
   #acc.merge(InDetGMConfig(flags))
 
   
@@ -296,9 +300,9 @@ def TrigInDetCondCfg( flags ):
 #  SCT_DCSConditionsTool=CompFactory.SCT_DCSConditionsTool
 #  dcsTool = SCT_DCSConditionsTool(ReadAllDBFolders = True, ReturnHVTemp = True)
 
-  from SCT_ConditionsTools.SCT_SiliconConditionsConfig import SCT_SiliconConditionsToolCfg, SCT_SiliconConditionsCfg
+  from SCT_ConditionsTools.SCT_SiliconConditionsConfig import SCT_SiliconConditionsCfg #, SCT_SiliconConditionsToolCfg
   #sctSiliconConditionsTool= SCT_SiliconConditionsCfg(flags, toolName="InDetSCT_SiliconConditionsTool", dcsTool=dcsTool )
-  sctSiliconConditionsTool = SCT_SiliconConditionsToolCfg(flags)
+  #sctSiliconConditionsTool = SCT_SiliconConditionsToolCfg(flags)
   acc.merge(SCT_SiliconConditionsCfg(flags, DCSConditionsTool=dcsTool))
 
   SCT_AlignCondAlg=CompFactory.SCT_AlignCondAlg
@@ -398,6 +402,7 @@ def TrigInDetCondCfg( flags ):
                                   UseDCSHVConditions=True,
                                   UseDCSTemperatureConditions=True,
                                   UseTDAQConditions=False))
+  
   # charge calibration
   acc.merge(PixelChargeCalibCondAlgCfg(flags))
 # NEW FOR RUN3  acc.merge(PixelChargeLUTCalibCondAlgCfg(flags))
@@ -447,6 +452,19 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   from RegionSelector.RegSelToolConfig import regSelTool_SCT_Cfg
   RegSelTool_SCT = acc.popToolsAndMerge(regSelTool_SCT_Cfg(flags))
 
+  verifier = CompFactory.AthViews.ViewDataVerifier('IDViewDataVerifier'+signature,
+                                                    DataObjects= [('InDet::PixelClusterContainerCache', 'PixelTrigClustersCache'),
+                                                                  ('PixelRDO_Cache', 'PixRDOCache'),
+                                                                  ('InDet::SCT_ClusterContainerCache', 'SCT_ClustersCache'),
+                                                                  ('SCT_RDO_Cache', 'SctRDOCache'),
+                                                                  ('SpacePointCache', 'PixelSpacePointCache'),
+                                                                  ('SpacePointCache', 'SctSpacePointCache'),
+                                                                  ('IDCInDetBSErrContainer_Cache', 'SctBSErrCache'),
+                                                                  ('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
+                                                                      # ('xAOD::TrigEMClusterContainer', 'StoreGateSvc+HLT_L2CaloEMClusters'),
+                                                                  ('TrigRoiDescriptorCollection', 'StoreGateSvc+'+roisKey)])
+
+  
   #Only add raw data decoders if we're running over raw data
   isMC = flags.Input.isMC
   if not isMC:
@@ -499,8 +517,8 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
     InDetSCTRawDataProvider.RoIs = roisKey
     InDetSCTRawDataProvider.RDOCacheKey = InDetCacheNames.SCTRDOCacheKey
 
-    InDetSCTRawDataProvider.RegSelTool = RegSelTool_SCT
-
+    InDetSCTRawDataProvider.RegSelTool = RegSelTool_SCT    
+    InDetSCTRawDataProvider.OutputLevel=DEBUG
     acc.addEventAlgo(InDetSCTRawDataProvider)
 
     # load the SCTEventFlagWriter
@@ -550,7 +568,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
                                                   MinimalSplitProbability = 0,
                                                   DoIBLSplitting = True,
                                                   )
-  # Enable duplcated RDO check for data15 because duplication mechanism was used.
+  # Enable duplicated RDO check for data15 because duplication mechanism was used.
   if len(flags.Input.ProjectName)>=6 and flags.Input.ProjectName[:6]=="data15":
     InDetMergedPixelsTool.CheckDuplicatedRDO = True
   acc.addPublicTool(InDetMergedPixelsTool)
@@ -566,6 +584,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
                                                         DataObjectName          = InDetKeys.PixelRDOs(),
                                                         AmbiguitiesMap          = 'TrigPixelClusterAmbiguitiesMap',
                                                         ClustersName            = "PixelTrigClusters",)
+  InDetPixelClusterization
   InDetPixelClusterization.isRoI_Seeded = True
   InDetPixelClusterization.RoIs = roisKey
   InDetPixelClusterization.ClusterContainerCacheKey = InDetCacheNames.Pixel_ClusterKey
@@ -598,7 +617,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   InDetSCT_Clusterization.ClusterContainerCacheKey = InDetCacheNames.SCT_ClusterKey
 
   InDetSCT_Clusterization.RegSelTool = RegSelTool_SCT
-
+  InDetSCT_Clusterization.OutputLevel = DEBUG
   acc.addEventAlgo(InDetSCT_Clusterization)
 
 
@@ -623,7 +642,6 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
                                                                     ProcessOverlaps        = flags.Detector.SCTOn, #DetFlags.haveRIO.SCT_on(),
                                                                     SpacePointCacheSCT = InDetCacheNames.SpacePointCacheSCT,
                                                                     SpacePointCachePix = InDetCacheNames.SpacePointCachePix,)
-  from AthenaCommon.Constants import DEBUG
   InDetSiTrackerSpacePointFinder.OutputLevel=DEBUG
   acc.addEventAlgo(InDetSiTrackerSpacePointFinder)
 
@@ -635,20 +653,64 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   acc.merge( SiTrackMaker_xkCfg( flags, name = "InDetTrigSiTrackMaker_FTF"+signature ) )
 
   acc.addPublicTool( CompFactory.TrigInDetTrackFitter( "TrigInDetTrackFitter" ) )
-  acc.addPublicTool( CompFactory.TrigSpacePointConversionTool( "TrigSpacePointConversionTool" + signature ) )
+  from RegionSelector.RegSelToolConfig import (regSelTool_SCT_Cfg, regSelTool_Pixel_Cfg)
 
+  pixRegSelTool = acc.popToolsAndMerge( regSelTool_Pixel_Cfg( flags) )
+  sctRegSelTool = acc.popToolsAndMerge( regSelTool_SCT_Cfg( flags) )
+
+  from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
+  acc.merge( TrackingGeometrySvcCfg( flags ) )
+  acc.addPublicTool( CompFactory.TrigL2LayerNumberTool( name = "TrigL2LayerNumberTool_FTF",
+                                                        UseNewLayerScheme = True) )
+  
+  acc.addPublicTool( CompFactory.TrigSpacePointConversionTool( "TrigSpacePointConversionTool" + signature.lower(), # lowercased to ease comparison to old style conf. TODO, remove
+                                                                 DoPhiFiltering = True,
+                                                                 UseBeamTilt = False,
+                                                                 UseNewLayerScheme = True,
+                                                                 RegSel_Pixel = pixRegSelTool,
+                                                                 RegSel_SCT = sctRegSelTool,
+                                                                 layerNumberTool = acc.getPublicTool("TrigL2LayerNumberTool_FTF") ) )
+
+
+  # TODO remove once offline configured counterparts are available?
+  acc.addCondAlgo( CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name= "InDetSiDetElementBoundaryLinksSCTCondAlg",
+                                                                         WriteKey = "SCT_DetElementBoundaryLinks_xk") )
+  
+  acc.addCondAlgo( CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name = "InDetSiDetElementBoundaryLinksPixelCondAlg",
+                                                                         ReadKey  = "PixelDetectorElementCollection",
+                                                                         WriteKey = "PixelDetElementBoundaryLinks_xk") )
+  
   ftf = CompFactory.TrigFastTrackFinder( name = "TrigFastTrackFinder" + signature,
                                          LayerNumberTool          = acc.getPublicTool( "TrigL2LayerNumberTool_FTF" ),
-                                         SpacePointProviderTool   = acc.getPublicTool( "TrigSpacePointConversionTool" + signature ),
+                                         SpacePointProviderTool   = acc.getPublicTool( "TrigSpacePointConversionTool" + signature.lower() ),
                                          TrackSummaryTool         = acc.getPublicTool( "InDetTrigFastTrackSummaryTool" ),
                                          TrigL2ResidualCalculator = acc.getPublicTool( "TrigL2ResidualCalculator" ),
                                          initialTrackMaker        = acc.getPublicTool( "InDetTrigSiTrackMaker_FTF" + signature ),
                                          trigInDetTrackFitter     = acc.getPublicTool( "TrigInDetTrackFitter" ),
-                                         trigZFinder = CompFactory.TrigZFinder()) 
-  ftf.RoIs = roisKey
+                                         RoIs = roisKey,
+                                         trigZFinder = CompFactory.TrigZFinder(),
+                                         doZFinder = False, # this and all below, copied over from comparison with running JOs, TODO find a proper surce of this settings
+                                         SeedRadBinWidth =  2,
+                                         TrackInitialD0Max = 20.0,
+                                         TracksName = "TrigFastTrackFinder_Tracks"+signature,
+                                         OutputCollectionSuffix = signature,
+                                         TripletDoPSS = False,
+                                         Triplet_D0Max = 4.0,
+                                         Triplet_D0_PPS_Max = 1.7,
+                                         Triplet_MaxBufferLength = 3,
+                                         Triplet_MinPtFrac = 1,
+                                         Triplet_nMaxPhiSlice = 53,
+                                         doCloneRemoval = True,
+                                         doResMon = False,
+                                         doSeedRedundancyCheck = True,
+                                         pTmin = 1000.0,
+                                         useNewLayerNumberScheme = True,
+                                         MinHits = 5
+                                           ) 
+  #ftf.RoIs = roisKey
   ftf.OutputLevel=DEBUG
   acc.addEventAlgo( ftf )
-
+  
   #CondSvc=CompFactory.CondSvc
   #acc.addService(CondSvc())
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
index 6668963dc57a..8fab4da49b98 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
@@ -13,9 +13,12 @@ from AthenaCommon.Configurable import Configurable
 Configurable.configurableRun3Behavior=1
 
 #Temporarily turning off ID geometery until the configuration is fully migrated
-flags.Detector.GeometryPixel = False
-flags.Detector.GeometrySCT   = False
-flags.Detector.GeometryTRT   = False
+flags.Detector.GeometryPixel = True
+flags.Detector.GeometrySCT   = True
+flags.Detector.GeometryTRT   = True
+flags.Detector.GeometryID    = True
+flags.Detector.GeometryBpipe = True
+flags.Detector.GeometryCavern = False
 flags.Detector.GeometryLAr   = True
 flags.Detector.GeometryTile  = True
 flags.Detector.GeometryMDT   = True
@@ -89,7 +92,7 @@ acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING #
 
 
 
-acc.printConfig(withDetails=False, summariseProps=False)
+acc.printConfig(withDetails=False, summariseProps=True, printDefaults=True)
 
 
 fname = "newJOtest.pkl"
@@ -97,4 +100,8 @@ print( "Storing config in the file {}".format( fname ) )
 with open(fname, "wb") as p:
     acc.store( p )
     p.close()
-acc.run()
+status = acc.run()
+if status.isFailure():
+    import sys
+    sys.exit(-1)
+
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
index 27d0fdda4fbc..a729b66262cf 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
@@ -61,8 +61,8 @@ def setupMenu(flags):
     ]
 
     flags.Trigger.menu.combined = [
-        ChainProp(name='HLT_e7_mu10_L1EM7_MU10', groups=SingleElectronGroup),
-        ChainProp(name='HLT_e5_mu5_L1EM7_MU10', groups=SingleElectronGroup),
+#        ChainProp(name='HLT_e7_mu10_L1EM7_MU10', groups=SingleElectronGroup),
+#        ChainProp(name='HLT_e5_mu5_L1EM7_MU10', groups=SingleElectronGroup),
     ]
 
 if __name__ == "__main__":
-- 
GitLab


From 0c94f5b0bbffed14f11cad392a4d928acaa9ffc5 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Tue, 28 Jul 2020 14:43:06 +0100
Subject: [PATCH 082/422] Attempted to fix missing conditions

---
 .../TrigInDetConfig/python/TrigInDetConfig.py | 21 +++++++++++--------
 .../TrigUpgradeTest/share/newJOtest.py        | 14 ++-----------
 2 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
index c4df232b9b06..6e0ad12fcf13 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
@@ -116,10 +116,15 @@ def SiTrackMaker_xkCfg(flags, **kwargs):
   """
   import AthenaCommon.SystemOfUnits as Unit
   name = kwargs.pop("name", "SiTrackMaker_xk")
-  acc = ComponentAccumulator()
+  acc = ComponentAccumulator()  
   acc.merge( SiDetElementsRoadMaker_xkCfg( flags, **kwargs ) )
   combTrackFinderTool = acc.popToolsAndMerge( SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ) )
 
+  acc.addCondAlgo( CompFactory.RIO_OnTrackErrorScalingCondAlg(ErrorScalingType = ["PixelRIO_OnTrackErrorScaling", "SCTRIO_OnTrackErrorScaling", "TRTRIO_OnTrackErrorScaling"],
+                                                              OutKeys        = ["ConditionStore+/Indet/TrkErrorScalingPixel", "ConditionStore+/Indet/TrkErrorScalingSCT", "ConditionStore+/Indet/TrkErrorScalingTRT"],
+                                                              ReadKey        = "ConditionStore+/Indet/TrkErrorScaling") )
+  
+  
   tool = CompFactory.InDet.SiTrackMaker_xk( name,
                                             RoadTool                 = acc.getPublicTool( "InDetTrigSiDetElementsRoadMaker" ),
                                             CombinatorialTrackFinder = combTrackFinderTool,
@@ -453,17 +458,15 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   RegSelTool_SCT = acc.popToolsAndMerge(regSelTool_SCT_Cfg(flags))
 
   verifier = CompFactory.AthViews.ViewDataVerifier( name = 'VDVInDet'+signature,
-
-                                                    DataObjects= [('InDet::PixelClusterContainerCache', 'PixelTrigClustersCache'),
+                                                    DataObjects= [('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
+                                                                  ('InDet::PixelClusterContainerCache', 'PixelTrigClustersCache'),
                                                                   ('PixelRDO_Cache', 'PixRDOCache'),
                                                                   ('InDet::SCT_ClusterContainerCache', 'SCT_ClustersCache'),
                                                                   ('SCT_RDO_Cache', 'SctRDOCache'),
                                                                   ('SpacePointCache', 'PixelSpacePointCache'),
                                                                   ('SpacePointCache', 'SctSpacePointCache'),
-                                                                  ('IDCInDetBSErrContainer_Cache', 'SctBSErrCache'),
-                                                                  ('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
-                                                                      # ('xAOD::TrigEMClusterContainer', 'StoreGateSvc+HLT_L2CaloEMClusters'),
-                                                                  ('TrigRoiDescriptorCollection', 'StoreGateSvc+'+roisKey)])
+                                                                  ('IDCInDetBSErrContainer_Cache', 'SctBSErrCache'),                                                                  
+                                                                  ('TrigRoiDescriptorCollection', 'StoreGateSvc+'+roisKey),
                                                                   ( 'TagInfo' , 'DetectorStore+ProcessingTags' )] )
 
   acc.addEventAlgo(verifier)
@@ -652,7 +655,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
 
   acc.merge( TrackSummaryToolCfg(flags, name="InDetTrigFastTrackSummaryTool") )
 
-  acc.addPublicTool( CompFactory.TrigL2ResidualCalculator( "TrigL2ResidualCalculator" ) )
+#  acc.addPublicTool( CompFactory.TrigL2ResidualCalculator( "TrigL2ResidualCalculator" ) )
   acc.merge( SiTrackMaker_xkCfg( flags, name = "InDetTrigSiTrackMaker_FTF"+signature ) )
 
   acc.addPublicTool( CompFactory.TrigInDetTrackFitter( "TrigInDetTrackFitter" ) )
@@ -687,7 +690,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
                                          LayerNumberTool          = acc.getPublicTool( "TrigL2LayerNumberTool_FTF" ),
                                          SpacePointProviderTool   = acc.getPublicTool( "TrigSpacePointConversionTool" + signature.lower() ),
                                          TrackSummaryTool         = acc.getPublicTool( "InDetTrigFastTrackSummaryTool" ),
-                                         TrigL2ResidualCalculator = acc.getPublicTool( "TrigL2ResidualCalculator" ),
+#                                         TrigL2ResidualCalculator = acc.getPublicTool( "TrigL2ResidualCalculator" ),
                                          initialTrackMaker        = acc.getPublicTool( "InDetTrigSiTrackMaker_FTF" + signature ),
                                          trigInDetTrackFitter     = acc.getPublicTool( "TrigInDetTrackFitter" ),
                                          RoIs = roisKey,
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
index cdc50ec6807d..2fc096aa8aa0 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
@@ -58,7 +58,7 @@ flags.InDet.usePixelDCS=False
 
 flags.lock()
 
-from AthenaCommon.Constants import INFO,DEBUG,WARNING
+from AthenaCommon.Constants import INFO,DEBUG,WARNING,VERBOSE
 acc = MainServicesCfg( flags )
 acc.getService('AvalancheSchedulerSvc').VerboseSubSlots = True
 
@@ -96,17 +96,12 @@ acc.foreach_component("*HLTTop/RoRSeqFilter/*").OutputLevel = DEBUG # filters
 acc.foreach_component("*HLTTop/*Input*").OutputLevel = DEBUG # input makers
 acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = DEBUG # messaging from the EDM creators
 acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING # silcence mon tools (addressing by type)
-<<<<<<< HEAD
 
+acc.foreach_component("*HLTTop/*/Menu1Electron_step1/*").OutputLevel = VERBOSE 
 
 
 acc.printConfig(withDetails=False, summariseProps=True, printDefaults=True)
 
-=======
-acc.foreach_component("*/L1Decoder").OutputLevel = DEBUG
-acc.foreach_component("*FastEMCaloAlgo*").OutputLevel = DEBUG
-acc.foreach_component("VDVFastEgammaCalo").OutputLevel =DEBUG
->>>>>>> upstream/master
 
 fname = "newJOtest.pkl"
 print( "Storing config in the file {}".format( fname ) )
@@ -116,9 +111,4 @@ with open(fname, "wb") as p:
 status = acc.run()
 if status.isFailure():
     import sys
-<<<<<<< HEAD
-    sys.exit(-1)
-
-=======
     sys.exit(1)
->>>>>>> upstream/master
-- 
GitLab


From 99ff961e61217fe46b5e7d425c56a1bf31005423 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch>
Date: Thu, 30 Jul 2020 10:13:51 +0000
Subject: [PATCH 083/422] Update TrigT1CaloTauFex.cxx

---
 .../TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
index fb70f760080b..050344c8be66 100644
--- a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
+++ b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
@@ -326,7 +326,7 @@ void TrigT1CaloTauFex::IsolationCorett(const std::vector<const CaloCell*>& scell
         float deltaphiInner = 0.05;
         for(auto scell : scells) {
                 if ( std::abs( scell->eta() - etacell) > deltaetaOuter2 ) continue;
-                if (scell->caloDDE()->getSampling()!=1 && scell->caloDDE()->getSampling()!=5 && cell->caloDDE()->getSampling()!=4 && cell->caloDDE()->getSampling()!=8) deltaetaOuter1 = 1.0; // tighter isolation in 1 grad  and 2 grad layers
+                if (scell->caloDDE()->getSampling()!=1 && scell->caloDDE()->getSampling()!=5 && cell->caloDDE()->getSampling()!=4 && cell->caloDDE()->getSampling()!=8) deltaetaOuter1 = 1.0; // tighter isolation in 1 deg  and 2 deg layers
                 float dphi = std::abs( scell->phi() - phicell);
                 dphi = std::abs( M_PI - dphi );
                 dphi = std::abs( M_PI - dphi );
-- 
GitLab


From 0fb90f209196b70952d0123660b1342b31fc5b92 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 3 Aug 2020 13:11:51 +0200
Subject: [PATCH 084/422] Non-working isFilled(bcid) method

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  3 ++
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 18 +++++------
 .../src/AFPSiLayerAlgorithm.cxx               | 31 ++++++++++++++++---
 3 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index f1adeaa11119..80629b012e0d 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -8,6 +8,7 @@
 #include "AthenaMonitoring/AthMonitorAlgorithm.h"
 #include "AthenaMonitoringKernel/Monitored.h"
 #include "StoreGate/ReadHandleKey.h"
+#include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
 #include "xAODForward/AFPSiHitContainer.h"
 #include "xAODForward/AFPSiHit.h"
 
@@ -25,6 +26,8 @@ private:
 	std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
 	std::map<std::string,int> m_TrackGroup; 
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
+	ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool;
+	//ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool{this, "BunchCrossingTool",""};
 	
 
 protected:
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 6b638e06682d..53518f422526 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -45,15 +45,15 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
 
     array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
-    array.defineHistogram('pixelColIDChip', title='Hits per column for {0} layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-    array.defineHistogram('pixelRowIDChip', title='Hits per row for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
+    array.defineHistogram('pixelColIDChip', title='Hits per column for {0} layer {1};pixelColIDChip; entries', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
+    array.defineHistogram('pixelRowIDChip', title='Hits per row for {0} Layer {1};pixelRowIDChip; entries', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
     array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for {0} Layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
-    array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
+    array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for {0} Layer {1};timeOverThreshold; entries', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
     array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};x [mm];y [mm]', type='TH2F', path='Cluster', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
-    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerPlane', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerEvent / <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
 
 
@@ -94,7 +94,7 @@ if __name__=='__main__':
     #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_6/aod0.pool.root']
     ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput45-337176-CorrectMask.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput46.root'
     
     ConfigFlags.lock()
 
@@ -107,7 +107,7 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    cfg.run()
+    cfg.run(5000)
 
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 17facee52447..abc7919c5c3c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -11,6 +11,7 @@
 #include <Run3AFPMonitoring/AFPFastReco.h>
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPStationID.h"
+#include "EventInfo/EventID.h"
 
 
 	unsigned int clusterCounter[1000][4][4];
@@ -115,15 +116,15 @@
 		}
 		return false;
 	}
-	
-
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
 , m_afpHitContainerKey("AFPSiHitContainer")
+, m_bunchCrossingTool("Trig::TrigConfBunchCrossingTool/BunchCrossingTool")
 
 {
 	declareProperty( "AFPSiHitContainer", m_afpHitContainerKey );
+	declareProperty("BunchCrossingTool", m_bunchCrossingTool);
 }
 
 
@@ -150,6 +151,16 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 			}
 		}
 	}
+	
+	StatusCode sc = m_bunchCrossingTool.retrieve();
+	if(sc.isFailure())
+	{
+		ATH_MSG_WARNING("\n\n\t\tUnable to retrieve bunchCrossingTool.\n\n");
+	}
+	else
+	{
+		ATH_MSG_WARNING("\n\n\t\tRetrieve works!!!.\n\n");
+	}
 
 	return AthMonitorAlgorithm::initialize();
 }
@@ -204,6 +215,19 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	++counterForEventsStation;
 
 	int tempbcid = GetEventInfo(ctx)->bcid();
+
+	// IMPORTANT PART
+	EventID::number_type specialBCID = GetEventInfo(ctx)->bcid();
+	(m_bunchCrossingTool->isFilled(specialBCID))
+	{
+		std::cout << "\tFilled: " << specialBCID << std::endl;
+	}
+	else
+	{
+		std::cout << "\tNOT filled: " << specialBCID << std::endl;
+	}
+	// END OF IMPORTANT PART
+	
 	if(isInList(tempbcid, frontBCIDs) == true)
 	{
 		++counterForEventsFront;
@@ -214,8 +238,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		++counterForEventsEnd;
 		++counterForEventsStationEnd;
 	}
-	
-	if(isInList(tempbcid, middleBCIDs) == true)
+	else if(isInList(tempbcid, middleBCIDs) == true)
 	{
 		++counterForEventsMiddle;
 		++counterForEventsStationMiddle;
-- 
GitLab


From f9b4e15630d0b6d03ec92d9f53e4e560aada2033 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Tue, 4 Aug 2020 00:22:01 +0200
Subject: [PATCH 085/422] Update

---
 .../Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx  | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index abc7919c5c3c..73db09a8f463 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -160,6 +160,18 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 	else
 	{
 		ATH_MSG_WARNING("\n\n\t\tRetrieve works!!!.\n\n");
+		
+	for(int i=1; i<=3654; i++)
+	{
+		if (m_bunchCrossingTool->isFilled(i))
+		{
+			std::cout << "\tFilled: " << i << std::endl;
+		}
+		else
+		{
+			std::cout << "\tNOT filled: " << i << std::endl;
+		}
+	}
 	}
 
 	return AthMonitorAlgorithm::initialize();
@@ -218,7 +230,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
 	// IMPORTANT PART
 	EventID::number_type specialBCID = GetEventInfo(ctx)->bcid();
-	(m_bunchCrossingTool->isFilled(specialBCID))
+	if (m_bunchCrossingTool->isFilled(specialBCID))
 	{
 		std::cout << "\tFilled: " << specialBCID << std::endl;
 	}
-- 
GitLab


From 68a5f91238aaafd5544667fec899e6c9ad5f065c Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 7 Aug 2020 16:45:10 +0200
Subject: [PATCH 086/422] Update 07/08/2020

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h        | 14 +++++++++++---
 .../python/Run3AFPExampleMonitorAlgorithm.py       |  5 +++--
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 80629b012e0d..26367ff1c0d8 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -11,22 +11,30 @@
 #include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
 #include "xAODForward/AFPSiHitContainer.h"
 #include "xAODForward/AFPSiHit.h"
-
+#include "LumiBlockData/BunchCrossingCondData.h"
 
 #include "TRandom3.h"
 
+class BunchCrossingCondData;
+
 class AFPSiLayerAlgorithm : public AthMonitorAlgorithm {
 public:
 	AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
 	virtual ~AFPSiLayerAlgorithm();
 	virtual StatusCode initialize() override;
 	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
-
+	virtual StatusCode execute(const EventContext& ctx) const override;
+	
 private:
 	std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
 	std::map<std::string,int> m_TrackGroup; 
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
-	ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool;
+	SG::ReadCondHandleKey<BunchCrossingCondData>  m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
+	//BunchCrossingCondData m_bunchCrossingCondTool;
+	
+	//SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingCondTool {this, "BunchCrossingCondDataKey", "BunchCrossingData" ,"SG Key of BunchCrossing CDO"};
+	//SG::ReadHandleKey<BunchCrossingCondData> m_bunchCrossingCondTool;
+	//ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool;
 	//ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool{this, "BunchCrossingTool",""};
 	
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 53518f422526..fa81944d3d03 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -92,7 +92,8 @@ if __name__=='__main__':
 
     #ConfigFlags.Input.Files = [nightly+file]
     #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_6/aod0.pool.root']
-    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
+    #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
+    ConfigFlags.Input.Files = ['/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1']
     ConfigFlags.Input.isMC = False
     ConfigFlags.Output.HISTFileName = 'AFPOutput46.root'
     
@@ -107,7 +108,7 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    cfg.run(5000)
+    cfg.run(100)
 
 
 
-- 
GitLab


From 5a52919ba918fff7f8dd5518c9441bbd7a698e11 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 12 Aug 2020 16:17:48 +0200
Subject: [PATCH 087/422] Non-working version, even without BCID

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |   3 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  12 +-
 .../src/AFPSiLayerAlgorithm.cxx               | 108 +++++++++++++-----
 3 files changed, 88 insertions(+), 35 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 26367ff1c0d8..34f7ebd0a4bd 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -29,7 +29,8 @@ private:
 	std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
 	std::map<std::string,int> m_TrackGroup; 
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
-	SG::ReadCondHandleKey<BunchCrossingCondData>  m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
+	ToolHandle<Trig::IBunchCrossingTool> m_bcTool;
+	//SG::ReadCondHandleKey<BunchCrossingCondData>  m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
 	//BunchCrossingCondData m_bunchCrossingCondTool;
 	
 	//SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingCondTool {this, "BunchCrossingCondDataKey", "BunchCrossingData" ,"SG Key of BunchCrossing CDO"};
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index fa81944d3d03..d999f52dadb1 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -3,10 +3,8 @@
 #
 
 '''@file Run3AFPExampleMonitorAlgorithm.py
-@author C. D. Burton
-@author P. Onyisi
-@date 2018-01-11
-@brief Example python configuration for the Run III AthenaMonitoring package
+@author N. Dikic
+@date 2020-08-12
 '''
 
 def Run3AFPExampleMonitoringConfig(inputFlags):
@@ -92,8 +90,8 @@ if __name__=='__main__':
 
     #ConfigFlags.Input.Files = [nightly+file]
     #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_6/aod0.pool.root']
-    #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
-    ConfigFlags.Input.Files = ['/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1']
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
+    #ConfigFlags.Input.Files = ['/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1']
     ConfigFlags.Input.isMC = False
     ConfigFlags.Output.HISTFileName = 'AFPOutput46.root'
     
@@ -104,7 +102,7 @@ if __name__=='__main__':
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
     cfg = MainServicesCfg(ConfigFlags)
     cfg.merge(PoolReadCfg(ConfigFlags))
-
+    
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 73db09a8f463..a77a2e318ddc 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -120,11 +120,12 @@
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
 , m_afpHitContainerKey("AFPSiHitContainer")
-, m_bunchCrossingTool("Trig::TrigConfBunchCrossingTool/BunchCrossingTool")
-
+//, m_bunchCrossingCondTool("BunchCrossingCondData")
+, m_bcTool("Trig::TrigConfBunchCrossingTool/BunchCrossingTool")
 {
 	declareProperty( "AFPSiHitContainer", m_afpHitContainerKey );
-	declareProperty("BunchCrossingTool", m_bunchCrossingTool);
+	declareProperty("BCTool", m_bcTool);
+	//declareProperty("BunchCrossingCondData", m_bunchCrossingCondTool);
 }
 
 
@@ -141,6 +142,9 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
 	ATH_CHECK(m_afpHitContainerKey.initialize());
 	
+	//SG::ReadHandleKey<BunchCrossingCondData> bunchCrossingCondTool("bcidCondTool");
+	//ATH_CHECK(m_bunchCrossingCondTool.initialize());
+	
 	for(int a=0; a<1000; a++)
 	{
 		for(int b=0;b<4;b++)
@@ -151,30 +155,41 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 			}
 		}
 	}
-	
-	StatusCode sc = m_bunchCrossingTool.retrieve();
+	/*
+	StatusCode sc = m_bunchCrossingCondTool.retrieve();
 	if(sc.isFailure())
 	{
-		ATH_MSG_WARNING("\n\n\t\tUnable to retrieve bunchCrossingTool.\n\n");
+		ATH_MSG_WARNING("\n\n\t\tUnable to retrieve m_bunchCrossingCondTool.\n\n");
 	}
 	else
 	{
 		ATH_MSG_WARNING("\n\n\t\tRetrieve works!!!.\n\n");
+	}
+	*/
+	//ATH_CHECK(m_bunchCrossingKey.initialize());
+	ATH_MSG_INFO("Initializing...");
+	CHECK(m_bcTool.retrieve());
+	ATH_MSG_INFO("Retrieved the bunch crossing tool.");
+	return AthMonitorAlgorithm::initialize();
+}
+
+StatusCode AFPSiLayerAlgorithm::execute(const EventContext& ctx) const {
+	using namespace Monitored;
+	
+
+	
+	
+	//std::cout << "\n\t\t MAX_BCID: " << m_bunchCrossingCondTool.m_MAX_BCID;
 		
-	for(int i=1; i<=3654; i++)
+	//std::cout << "\n\tNumber of filled bunches: " << m_bunchCrossingCondTool.numberOfFilledBunches() << "\n";	
+	//std::cout << "\tNumber of bunch trains: " << m_bunchCrossingCondTool.numberOfBunchTrains() << "\n";
+	unsigned int bcid_type = GetEventInfo(ctx)->bcid();
+	if(m_bcTool->isFilled(bcid_type))
 	{
-		if (m_bunchCrossingTool->isFilled(i))
-		{
-			std::cout << "\tFilled: " << i << std::endl;
-		}
-		else
-		{
-			std::cout << "\tNOT filled: " << i << std::endl;
-		}
-	}
+		std::cout << "Bunch is filled: " << bcid_type << " \n";
 	}
 
-	return AthMonitorAlgorithm::initialize();
+	return StatusCode::SUCCESS;
 }
 
 
@@ -222,6 +237,42 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	muPerBCID = lbAverageInteractionsPerCrossing(ctx);
 	//run = GetEventInfo(ctx)->runNumber();
 	fill("AFPSiLayerTool", lb, muPerBCID);
+	
+	//////////////
+	/*
+	unsigned int bcid_type = GetEventInfo(ctx)->bcid();
+	
+	SG::ReadCondHandle<BunchCrossingCondData> bcidHdl(m_bunchCrossingKey,ctx);
+	if (!bcidHdl.isValid()) 
+	{
+		ATH_MSG_ERROR( "Unable to retrieve BunchCrossing conditions object" );
+		return StatusCode::FAILURE;
+	}
+	else
+	{
+		ATH_MSG_WARNING("\n\n\t\tRetrieve works!!!.\n\n");
+	}
+	
+	const BunchCrossingCondData* bcData{*bcidHdl};
+	//bcData->isFilled(bcid_type)
+	int maxbcid = {bcData->m_MAX_BCID};
+	
+	std::cout << "\n\n\tMAX_BCID: " << maxbcid << std::endl;
+	std::cout << "\nThis is for the testing purposes.";
+	std::cout << "\n\n\tNumber of bunch trains: " << bcData->numberOfBunchTrains() << std::endl;
+	std::cout << "\n\n\tNumber of filled bunches: " << bcData->numberOfFilledBunches() << std::endl;
+	
+	if (bcData->isFilled(bcid_type))
+	{
+		std::cout << "\tFilled: " << bcid_type << std::endl;
+	}
+	else
+	{
+		std::cout << "\tNOT filled: " << bcid_type << std::endl;
+	}
+	*/
+	//////////////////
+
 
 	++counterForEvents;		// Counter for the all BCIDs
 	++counterForEventsStation;
@@ -229,8 +280,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	int tempbcid = GetEventInfo(ctx)->bcid();
 
 	// IMPORTANT PART
+	/*
 	EventID::number_type specialBCID = GetEventInfo(ctx)->bcid();
-	if (m_bunchCrossingTool->isFilled(specialBCID))
+	if (m_bunchCrossingCondTool->isFilled(specialBCID))
 	{
 		std::cout << "\tFilled: " << specialBCID << std::endl;
 	}
@@ -238,6 +290,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	{
 		std::cout << "\tNOT filled: " << specialBCID << std::endl;
 	}
+	*/
 	// END OF IMPORTANT PART
 	
 	if(isInList(tempbcid, frontBCIDs) == true)
@@ -275,6 +328,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	
 	for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
 	{
+				
 		lb = GetEventInfo(ctx)->lumiBlock();
 		pixelRowIDChip = hitsItr->pixelRowIDChip();
 		pixelColIDChip = hitsItr->pixelColIDChip();
@@ -315,7 +369,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			}
 			else
 			{
-				clustersPerPlane2 = -99;
+				clustersPerPlane2 = -0.1;
 			}
 			//std::cout <<"\t"<< clustersPerPlane2 << std::endl;
 			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane2);
@@ -347,7 +401,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 					}
 					else
 					{
-						clustersPerPlane = -99;
+						clustersPerPlane = -0.1;
 					}
 					fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
 				}
@@ -392,7 +446,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 				clustersPerStation = clusterCounterStation[previouslbStation][i]*1.0;
 				if(muPerBCID != 0)
 				{clustersPerStation = clustersPerStation/(muPerBCID*counterForEventsStation*4);}
-				else{clustersPerStation = -99;}
+				else{clustersPerStation = -0.1;}
 
 				fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
 			}
@@ -423,7 +477,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 					{
 						clustersPerStationFront = clustersPerStationFront/(muPerBCID*counterForEventsStationFront*4);
 					}
-					else{clustersPerStationFront = -99;}
+					else{clustersPerStationFront = -0.1;}
 					
 					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationFront);
 				}
@@ -457,7 +511,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 					{
 						clustersPerStationEnd = clustersPerStationEnd/(muPerBCID*counterForEventsStationEnd*4);
 					}
-					else{clustersPerStationEnd = -99;}
+					else{clustersPerStationEnd = -0.1;}
 				
 					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationEnd);
 				}
@@ -490,7 +544,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 					{
 						clustersPerStationMiddle = clustersPerStationMiddle/(muPerBCID*counterForEventsStationMiddle*4);
 					}
-					else{clustersPerStationMiddle = -99;}
+					else{clustersPerStationMiddle = -0.1;}
 					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationMiddle);
 				}
 				previouslbStationMiddle=lb;
@@ -530,7 +584,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 						}
 						else
 						{
-							clustersPerPlaneFront = -99;
+							clustersPerPlaneFront = -0.1;
 						}
 						//std::cout << "\tFILL FRONT" << std::endl;
 						//std::cout << "clustersPerPlaneFront (it was zero on cernbox): " << clustersPerPlaneFront << std::endl;
@@ -580,7 +634,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 						}
 						else
 						{
-							clustersPerPlaneEnd = -99;
+							clustersPerPlaneEnd = -0.1;
 						}
 						//std::cout << "\tFILL END" << std::endl;
 						//std::cout << "clustersPerPlaneEnd (it was zero on cernbox): " << clustersPerPlaneEnd << std::endl;
@@ -630,7 +684,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 						}
 						else
 						{
-							clustersPerPlaneMiddle = -99;
+							clustersPerPlaneMiddle = -0.1;
 						}
 						//std::cout << "\tFILL Middle" << std::endl;
 						//std::cout << "clustersPerPlaneMiddle (it was zero on cernbox): " << clustersPerPlaneMiddle << std::endl;
-- 
GitLab


From e34ccb0108df7df331c7f061ee0afe0e65457ff8 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Fri, 14 Aug 2020 06:37:51 +0200
Subject: [PATCH 088/422] doTestSlice, doHEavyIonSlice and doEnahncedBiasSlice

---
 .../TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 3ed34972062c..771db0c56875 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -44,6 +44,9 @@ class opt:
     enableL1Phase1   = False          # Enable Run-3 LVL1 simulation and/or decoding
     enableL1CaloLegacy = True         # Enable Run-2 L1Calo simulation and/or decoding (possible even if enablePhase1 is True)
 #Individual slice flags
+    doTestSlice         = True
+    doHeavyIonSlice     = True
+    doEnhancedBiasSlice = True
     doEgammaSlice     = True
     doMuonSlice       = True
     doMinBiasSlice    = True
-- 
GitLab


From 1608c4c340e5fc86aab915dbf4e92fb790bf5341 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Tue, 18 Aug 2020 00:03:36 +0200
Subject: [PATCH 089/422] added config file for the calibSlice

---
 .../TriggerJobOpts/share/runHLT_standalone.py |  1 +
 .../CalibCosmicMon/CalibChainConfiguration.py | 38 +++++++++++++++++++
 .../CalibCosmicMon/GenerateCalibChainDefs.py  | 38 +++++++++++++++++++
 .../HLTMenuConfig/Menu/GenerateMenuMT.py      |  2 +-
 4 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
 create mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 771db0c56875..d3785428bea8 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -44,6 +44,7 @@ class opt:
     enableL1Phase1   = False          # Enable Run-3 LVL1 simulation and/or decoding
     enableL1CaloLegacy = True         # Enable Run-2 L1Calo simulation and/or decoding (possible even if enablePhase1 is True)
 #Individual slice flags
+    doCalibSlice        = True
     doTestSlice         = True
     doHeavyIonSlice     = True
     doEnhancedBiasSlice = True
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
new file mode 100644
index 000000000000..8b96e9c6fd6e
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
+from AthenaCommon.Logging import logging
+logging.getLogger().info("Importing %s",__name__)
+log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibChainConfiguration")
+
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
+
+#----------------------------------------------------------------
+class CalibChainConfiguration(ChainConfigurationBase):
+
+    def __init__(self, chainDict):
+        ChainConfigurationBase.__init__(self,chainDict)
+        
+    # ----------------------
+    # Assemble the chain depending on information from chainName
+    # ----------------------
+    def assembleChain(self):       
+                         
+        chainSteps = []
+        log.debug("Assembling chain for " + self.chainName)
+        # --------------------
+        # define here the names of the steps and obtain the chainStep configuration 
+        # --------------------
+        stepDictionary = {
+            "sct_noise":[],
+            "tilecalib_laser" : []
+        }
+
+        key = self.chainPart['chainPartName']
+        steps=stepDictionary[key]
+        for step in steps:
+            chainSteps+=[step]
+            
+        myChain = self.buildChain(chainSteps)
+        return myChain
+
+
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py
new file mode 100644
index 000000000000..7db53d3b1c51
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDict
+from TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibChainConfiguration import CalibChainConfiguration as CalibChainConfiguration
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainMerging import mergeChainDefs
+
+
+from AthenaCommon.Logging import logging
+log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.generateChainConfigs' )
+log.info("Importing %s",__name__)
+
+
+
+def generateChainConfigs( chainDict ):
+
+    listOfChainDicts = splitChainDict(chainDict)
+    log.debug("Will generate Config for streamer: %s", chainDict['chainName'])
+
+    listOfChainDefs = []
+        
+    #streamers will never have more than one chainPart but this is still
+    #needed to move to the correct format [{}]->{}
+    for subChainDict in listOfChainDicts:
+        
+        Calib = CalibChainConfiguration(subChainDict).assembleChain() 
+
+        listOfChainDefs += [Calib]
+        log.debug('length of chaindefs %s', len(listOfChainDefs) )
+
+    if len(listOfChainDefs)>1:
+        log.warning("This is a streamer with more than one chainPart, is this really intended?")
+        theChainDef = mergeChainDefs(listOfChainDefs, chainDict)
+    else:
+        theChainDef = listOfChainDefs[0]
+
+    log.debug("theChainDef %s" , theChainDef)
+
+    return theChainDef
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index 3ad2a6e75e00..41955f4adc08 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -65,7 +65,7 @@ class GenerateMenuMT(object):
         self.allSignatures = ['Egamma', 'Muon', 'Jet', 'Bjet', 'Bphysics', 'MET', 'Tau',
                               'HeavyIon', 'Beamspot', 'Cosmic', 'EnhancedBias',
                               'Monitor', 'Calib', 'Streaming', 'Combined', 'MinBias', 'Test'] #, AFP
-        self.calibCosmicMonSigs = ['Streaming','Monitor','Beamspot','Cosmic'] #others not implemented yet ['Beamspot', 'Cosmic', 'EnhancedBias', 'Monitor', 'Calib', 'Streaming']
+        self.calibCosmicMonSigs = ['Streaming','Monitor','Beamspot','Cosmic', 'Calib'] #others not implemented yet ['Beamspot', 'Cosmic', 'EnhancedBias', 'Monitor', 'Calib', 'Streaming']
 
         # flags
         self.doEgammaChains         = True
-- 
GitLab


From 7c6d7bed9c7a1499a1bc32b85538e130ab428b20 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Tue, 18 Aug 2020 16:36:45 +0200
Subject: [PATCH 090/422] fixed a typo

---
 .../TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index 41955f4adc08..131bf02315a6 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -79,7 +79,7 @@ class GenerateMenuMT(object):
         self.doMinBiasChains        = True
         self.doHeavyIonChains       = True
         self.doCosmicChains         = True
-        self.doCalibrationChains    = True
+        self.doCalibChains          = True
         self.doStreamingChains      = True
         self.doMonitorChains        = True
         self.doBeamspotChains       = True
-- 
GitLab


From 4296021c85f8994de654f0039a2ec50e27a87a64 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Wed, 19 Aug 2020 00:14:58 +0200
Subject: [PATCH 091/422] test debug

---
 .../TriggerJobOpts/share/runHLT_standalone.py          |  3 ++-
 .../python/HLTMenuConfig/Menu/GenerateMenuMT.py        |  1 +
 .../python/HLTMenuConfig/Menu/SignatureDicts.py        | 10 +++++++---
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index d3785428bea8..aabbce8457ff 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -44,7 +44,7 @@ class opt:
     enableL1Phase1   = False          # Enable Run-3 LVL1 simulation and/or decoding
     enableL1CaloLegacy = True         # Enable Run-2 L1Calo simulation and/or decoding (possible even if enablePhase1 is True)
 #Individual slice flags
-    doCalibSlice        = True
+    doCalibSlice  = True
     doTestSlice         = True
     doHeavyIonSlice     = True
     doEnhancedBiasSlice = True
@@ -96,6 +96,7 @@ import re
 
 sliceRe = re.compile("^do.*Slice")
 slices = [a for a in dir(opt) if sliceRe.match(a)]
+print('[runHLT_standalone] slices = {}'.format(slices))
 if opt.doEmptyMenu is True:
     log.info("Disabling all slices")
     for s in slices:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index 131bf02315a6..bfd2e0446762 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -79,6 +79,7 @@ class GenerateMenuMT(object):
         self.doMinBiasChains        = True
         self.doHeavyIonChains       = True
         self.doCosmicChains         = True
+        # self.doCalibrationChains    = True
         self.doCalibChains          = True
         self.doStreamingChains      = True
         self.doMonitorChains        = True
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 1018c922d09b..8acf40a35ef1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -22,7 +22,8 @@ SliceIDDict = {
     'MinBias' : 'mb',
     'HeavyIon' : 'hi',
     'Cosmic'  : 'cosmic',
-    'Calibration'   : 'calib',
+    # 'Calibration'   : 'calib',
+    'Calib'   : 'calib',
     'Streaming'     : 'streamer',
     'Monitor'    : 'mon',
     'Beamspot'      : 'beamspot',
@@ -38,7 +39,8 @@ AllowedSignatures = ["jet", "bjet", "ht",
                      "minbias", 
                      "heavyion", 
                      "cosmic", 
-                     "calibration", "streaming", "monitoring", 'eb']        
+                     # "calibration",
+                     "calib", "streaming", "monitoring", 'eb']        
 
 #==========================================================
 # ---- Generic Template for all chains          ----
@@ -813,7 +815,9 @@ def getSignatureInformation(signature):
         return [HeavyIonChainParts_Default, HeavyIonChainParts]
     if signature == "Cosmic":
         return [CosmicChainParts_Default, CosmicChainParts]
-    if signature == "Calibration":
+    # if signature == "Calibration":
+    #     return [CalibChainParts_Default, CalibChainParts]
+    if signature == "Calib":
         return [CalibChainParts_Default, CalibChainParts]
     if signature == "Streaming":
         return [StreamingChainParts_Default, StreamingChainParts]
-- 
GitLab


From 0f1e721f47fde9e42bcfcad92c8c3fa141384224 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Wed, 19 Aug 2020 06:25:50 +0200
Subject: [PATCH 092/422] updates

---
 .../TriggerJobOpts/share/runHLT_standalone.py          |  2 +-
 .../python/HLTMenuConfig/Menu/GenerateMenuMT.py        |  4 ++--
 .../python/HLTMenuConfig/Menu/SignatureDicts.py        | 10 +++-------
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index aabbce8457ff..21ca9bebc8dc 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -44,7 +44,7 @@ class opt:
     enableL1Phase1   = False          # Enable Run-3 LVL1 simulation and/or decoding
     enableL1CaloLegacy = True         # Enable Run-2 L1Calo simulation and/or decoding (possible even if enablePhase1 is True)
 #Individual slice flags
-    doCalibSlice  = True
+    doCalibSlice        = True
     doTestSlice         = True
     doHeavyIonSlice     = True
     doEnhancedBiasSlice = True
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index bfd2e0446762..bd24891ca793 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -79,8 +79,8 @@ class GenerateMenuMT(object):
         self.doMinBiasChains        = True
         self.doHeavyIonChains       = True
         self.doCosmicChains         = True
-        # self.doCalibrationChains    = True
-        self.doCalibChains          = True
+        self.doCalibrationChains    = True
+        self.doCalibChains    = True
         self.doStreamingChains      = True
         self.doMonitorChains        = True
         self.doBeamspotChains       = True
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 8acf40a35ef1..1018c922d09b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -22,8 +22,7 @@ SliceIDDict = {
     'MinBias' : 'mb',
     'HeavyIon' : 'hi',
     'Cosmic'  : 'cosmic',
-    # 'Calibration'   : 'calib',
-    'Calib'   : 'calib',
+    'Calibration'   : 'calib',
     'Streaming'     : 'streamer',
     'Monitor'    : 'mon',
     'Beamspot'      : 'beamspot',
@@ -39,8 +38,7 @@ AllowedSignatures = ["jet", "bjet", "ht",
                      "minbias", 
                      "heavyion", 
                      "cosmic", 
-                     # "calibration",
-                     "calib", "streaming", "monitoring", 'eb']        
+                     "calibration", "streaming", "monitoring", 'eb']        
 
 #==========================================================
 # ---- Generic Template for all chains          ----
@@ -815,9 +813,7 @@ def getSignatureInformation(signature):
         return [HeavyIonChainParts_Default, HeavyIonChainParts]
     if signature == "Cosmic":
         return [CosmicChainParts_Default, CosmicChainParts]
-    # if signature == "Calibration":
-    #     return [CalibChainParts_Default, CalibChainParts]
-    if signature == "Calib":
+    if signature == "Calibration":
         return [CalibChainParts_Default, CalibChainParts]
     if signature == "Streaming":
         return [StreamingChainParts_Default, StreamingChainParts]
-- 
GitLab


From 512cc7e722f7dabdeb868322767286e17f8ba1f1 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Wed, 19 Aug 2020 17:18:57 +0200
Subject: [PATCH 093/422] removed useless lines

---
 .../CalibCosmicMon/CalibChainConfiguration.py       | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
index 8b96e9c6fd6e..3a9ea2d4fb54 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
@@ -19,19 +19,6 @@ class CalibChainConfiguration(ChainConfigurationBase):
                          
         chainSteps = []
         log.debug("Assembling chain for " + self.chainName)
-        # --------------------
-        # define here the names of the steps and obtain the chainStep configuration 
-        # --------------------
-        stepDictionary = {
-            "sct_noise":[],
-            "tilecalib_laser" : []
-        }
-
-        key = self.chainPart['chainPartName']
-        steps=stepDictionary[key]
-        for step in steps:
-            chainSteps+=[step]
-            
         myChain = self.buildChain(chainSteps)
         return myChain
 
-- 
GitLab


From f55584d57e509a8156c44187e4bdb0a02fd33d0b Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Thu, 20 Aug 2020 07:01:36 +0200
Subject: [PATCH 094/422] removed hits in the CalibChainParts_default + cleanup

---
 Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py | 1 -
 .../TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py   | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 21ca9bebc8dc..d3785428bea8 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -96,7 +96,6 @@ import re
 
 sliceRe = re.compile("^do.*Slice")
 slices = [a for a in dir(opt) if sliceRe.match(a)]
-print('[runHLT_standalone] slices = {}'.format(slices))
 if opt.doEmptyMenu is True:
     log.info("Disabling all slices")
     for s in slices:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 1018c922d09b..b762a4c86a8f 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -626,7 +626,7 @@ CalibChainParts_Default = {
     'purpose'        : [],
     'addInfo'        : [],
     'hypo'           : '',
-    'hits'           : [],
+    # 'hits'           : [],
     'streamingInfo'  : [],
     'threshold'      : '',
     'multiplicity'   : '',
-- 
GitLab


From f8fd10f4ee9627de4d7630c09a605e320116828b Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Thu, 20 Aug 2020 15:55:51 +0200
Subject: [PATCH 095/422] commit dummy eflowRec algorithm - will add relevant
 flags later

---
 .../eflowRec/NewEDM_PFEGamRecoAssoc.h         | 66 ++++++++++++++++++
 .../eflowRec/share/PFlowMTConfig.py           |  9 ++-
 .../eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx   | 68 +++++++++++++++++++
 .../src/components/eflowRec_entries.cxx       |  2 +
 4 files changed, 144 insertions(+), 1 deletion(-)
 create mode 100644 Reconstruction/eflowRec/eflowRec/NewEDM_PFEGamRecoAssoc.h
 create mode 100644 Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx

diff --git a/Reconstruction/eflowRec/eflowRec/NewEDM_PFEGamRecoAssoc.h b/Reconstruction/eflowRec/eflowRec/NewEDM_PFEGamRecoAssoc.h
new file mode 100644
index 000000000000..936fd8eca936
--- /dev/null
+++ b/Reconstruction/eflowRec/eflowRec/NewEDM_PFEGamRecoAssoc.h
@@ -0,0 +1,66 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/*
+ * PFEgammaPFOAssoc.h
+ * Header file for class PFEGammaPFOAssoc
+ *                                                                                                                                                                                     
+ *  Created on: 13.03.19                                                                                                                                                            
+ *      Author: J. C. MacDonald                                                                                                                                                      
+ */
+
+#ifndef NEWEDM_PFEGAMRECOASSOC_H
+#define NEWEDM_PFEGAMRECOASSOC_H
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "xAODEgamma/ElectronContainer.h"
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODPFlow/PFOContainer.h"
+#include "StoreGate/WriteDecorHandle.h"
+
+/**                                                                                                                                                                                     
+This is the algorithm, which inherits from AthAlgorithm, that adds element links 
+between particle flow objects (PFOs) and Egamma objects. The algorithm associates charged (c) PFOs 
+to all electron and converted photon tracks, and neutral (n) PFOs to all electron and photon clusters. 
+This is done by adding decorations to the "Electron" and "Photon" container, for charged cPFOs and nPFOs separately, 
+in the form of vectors of element links to the associated PFOs. 
+The algorithm also adds decorations to the "JetETMissNeutralParticleFlowObjects" and 
+"JetETMissChargedParticleFlowObjects" containers, 
+in the form of vectors of element links to the associated electrons and photons.
+*/
+class NewEDM_PFEGamRecoAssoc : public AthAlgorithm {
+
+public:
+
+  NewEDM_PFEGamRecoAssoc(const std::string& name, ISvcLocator* pSvcLocator);
+  
+  virtual ~NewEDM_PFEGamRecoAssoc();
+
+  virtual StatusCode initialize() override final;
+  virtual StatusCode execute() override final;
+  virtual StatusCode finalize() override final;
+  
+private:
+
+  /** The write key for adding nPFO element link decorations to electrons */ 
+  SG::WriteDecorHandleKey<xAOD::ElectronContainer> m_electronNeutralPFOWriteDecorKey;
+  /** The write key for adding cPFO element link decorations to electrons */
+  SG::WriteDecorHandleKey<xAOD::ElectronContainer> m_electronChargedPFOWriteDecorKey;
+  /** The write key for adding electron element link decorations to nPFOs */
+  SG::WriteDecorHandleKey<xAOD::PFOContainer> m_neutralpfoElectronWriteDecorKey;
+  /** The write key for adding electron element link decorations to cPFOs */
+  SG::WriteDecorHandleKey<xAOD::PFOContainer> m_chargedpfoElectronWriteDecorKey;
+
+  /** The write key for adding nPFO element link decorations to photons */
+  SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonNeutralPFOWriteDecorKey;
+  /** The write key for adding cPFO element link decorations to photons */
+  SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonChargedPFOWriteDecorKey;
+  /** The write key for adding photon element link decorations to nPFOs */
+  SG::WriteDecorHandleKey<xAOD::PFOContainer> m_neutralpfoPhotonWriteDecorKey;
+  /** The write key for adding photon element link decorations to cPFOs */
+  SG::WriteDecorHandleKey<xAOD::PFOContainer> m_chargedpfoPhotonWriteDecorKey;
+ 
+};
+
+#endif // NEWEDM_PFEGAMRECOASSOC
diff --git a/Reconstruction/eflowRec/share/PFlowMTConfig.py b/Reconstruction/eflowRec/share/PFlowMTConfig.py
index bf6780e54b77..ce49dcb4b876 100644
--- a/Reconstruction/eflowRec/share/PFlowMTConfig.py
+++ b/Reconstruction/eflowRec/share/PFlowMTConfig.py
@@ -243,13 +243,20 @@ if True == jobproperties.eflowRecFlags.provideShowerSubtractedClusters:
     PFONeutralCreatorAlgorithm.AddShowerSubtractedClusters = True
 
 topSequence += PFONeutralCreatorAlgorithm
+from eflowRec.eflowRecFlags import jobproperties
+jobproperties.eflowRecFlags.usePFEGammaPFOAssoc.set_Value_and_Lock(True)
 
 if jobproperties.eflowRecFlags.usePFEGammaPFOAssoc:
-
+   
    from eflowRec.eflowRecConf import PFEGammaPFOAssoc
    PFEGammaPFOAssoc=PFEGammaPFOAssoc("PFEGammaPFOAssoc")
    topSequence += PFEGammaPFOAssoc
 
+   from eflowRec.eflowRecConf import NewEDM_PFEGamRecoAssoc
+   NewEDM_PFEGamRecoAssoc=NewEDM_PFEGamRecoAssoc("NewEDM_PFEGamRecoAssoc")
+   topSequence +=NewEDM_PFEGamRecoAssoc
+   
+
 #Add new FlowElement creators
 if jobproperties.eflowRecFlags.useFlowElements:
   from eflowRec.eflowRecConf import PFChargedFlowElementCreatorAlgorithm
diff --git a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
new file mode 100644
index 000000000000..9e3feb477e2c
--- /dev/null
+++ b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
@@ -0,0 +1,68 @@
+/*  
+ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "eflowRec/NewEDM_PFEGamRecoAssoc.h" 
+#include "StoreGate/WriteDecorHandle.h" 
+#include "xAODEgamma/ElectronContainer.h" 
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/Electron.h" 
+#include "xAODEgamma/Photon.h"
+#include "xAODEgamma/ElectronxAODHelpers.h"
+#include "xAODEgamma/EgammaxAODHelpers.h" 
+#include "xAODPFlow/PFOContainer.h" 
+#include "xAODPFlow/PFO.h" 
+
+typedef ElementLink<xAOD::ElectronContainer> ElectronLink_t; 
+typedef ElementLink<xAOD::PhotonContainer> PhotonLink_t;
+typedef ElementLink<xAOD::PFOContainer> PFOLink_t; 
+
+
+NewEDM_PFEGamRecoAssoc::NewEDM_PFEGamRecoAssoc(
+const std::string& name,
+  ISvcLocator* pSvcLocator
+  ):
+  AthAlgorithm(name,pSvcLocator)
+{
+// Class initializer 
+declareProperty ("ElectronNeutralPFODecorKey", m_electronNeutralPFOWriteDecorKey = "Electrons.neutralpfoLinks");   
+declareProperty ("ElectronChargedPFODecorKey", m_electronChargedPFOWriteDecorKey = "Electrons.chargedpfoLinks");   
+declareProperty ("NeutralPFOElectronDecorKey", m_neutralpfoElectronWriteDecorKey = "JetETMissNeutralParticleFlowObjects.pfo_ElectronLinks");   
+declareProperty ("ChargedPFOElectronDecorKey", m_chargedpfoElectronWriteDecorKey = "JetETMissChargedParticleFlowObjects.pfo_ElectronLinks"); 
+
+declareProperty ("PhotonNeutralPFODecorKey", m_photonNeutralPFOWriteDecorKey = "Photons.neutralpfoLinks");
+declareProperty ("PhotonChargedPFODecorKey", m_photonChargedPFOWriteDecorKey = "Photons.chargedpfoLinks");
+declareProperty ("NeutralPFOPhotonDecorKey", m_neutralpfoPhotonWriteDecorKey = "JetETMissNeutralParticleFlowObjects.pfo_PhotonLinks");
+declareProperty ("ChargedPFOPhotonDecorKey", m_chargedpfoPhotonWriteDecorKey = "JetETMissChargedParticleFlowObjects.pfo_PhotonLinks");
+} 
+
+// Class destructor 
+NewEDM_PFEGamRecoAssoc::~NewEDM_PFEGamRecoAssoc(){}
+
+StatusCode NewEDM_PFEGamRecoAssoc::initialize()
+{
+
+ATH_MSG_DEBUG("Initializing "<<name() << "...");
+ATH_CHECK(m_electronNeutralPFOWriteDecorKey.initialize());   
+ATH_CHECK(m_electronChargedPFOWriteDecorKey.initialize());   
+ATH_CHECK(m_neutralpfoElectronWriteDecorKey.initialize());   
+ATH_CHECK(m_chargedpfoElectronWriteDecorKey.initialize());  
+
+ATH_CHECK(m_photonNeutralPFOWriteDecorKey.initialize());
+ATH_CHECK(m_photonChargedPFOWriteDecorKey.initialize());
+ATH_CHECK(m_neutralpfoPhotonWriteDecorKey.initialize());
+ATH_CHECK(m_chargedpfoPhotonWriteDecorKey.initialize()); 
+
+ ATH_MSG_DEBUG("Initialization completed successfully");   
+
+return StatusCode::SUCCESS;
+}
+
+StatusCode NewEDM_PFEGamRecoAssoc::finalize(){
+return StatusCode::SUCCESS;
+}
+StatusCode NewEDM_PFEGamRecoAssoc::execute(){
+
+
+return StatusCode::SUCCESS;
+}
diff --git a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
index 3667e06ebd95..54c6362a87f5 100644
--- a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
+++ b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
@@ -20,10 +20,12 @@
 #include "eflowRec/PFOChargedCreatorAlgorithm.h"
 #include "eflowRec/PFONeutralCreatorAlgorithm.h"
 #include "eflowRec/PFEGammaPFOAssoc.h"
+#include "eflowRec/NewEDM_PFEGamRecoAssoc.h"
 
 DECLARE_COMPONENT( eflowOverlapRemoval )
 DECLARE_COMPONENT( PFLeptonSelector )
 DECLARE_COMPONENT( PFEGammaPFOAssoc )
+DECLARE_COMPONENT( NewEDM_PFEGamRecoAssoc )
 DECLARE_COMPONENT( PFClusterSelectorTool )
 DECLARE_COMPONENT( PFTrackSelector )
 DECLARE_COMPONENT( PFAlgorithm )
-- 
GitLab


From 795586c0117782b0432880c404ed9b31398de2c5 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Thu, 20 Aug 2020 17:33:26 +0200
Subject: [PATCH 096/422] configuring the read handles

---
 .../eflowRec/NewEDM_PFEGamRecoAssoc.h         | 38 +++++----
 .../eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx   | 84 ++++++++++++++++---
 2 files changed, 91 insertions(+), 31 deletions(-)

diff --git a/Reconstruction/eflowRec/eflowRec/NewEDM_PFEGamRecoAssoc.h b/Reconstruction/eflowRec/eflowRec/NewEDM_PFEGamRecoAssoc.h
index 936fd8eca936..1190d563fb12 100644
--- a/Reconstruction/eflowRec/eflowRec/NewEDM_PFEGamRecoAssoc.h
+++ b/Reconstruction/eflowRec/eflowRec/NewEDM_PFEGamRecoAssoc.h
@@ -16,15 +16,17 @@
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "xAODEgamma/ElectronContainer.h"
 #include "xAODEgamma/PhotonContainer.h"
-#include "xAODPFlow/PFOContainer.h"
-#include "StoreGate/WriteDecorHandle.h"
 
+#include "StoreGate/WriteDecorHandle.h"
+// this should be obsolete, but keeping atm to avoid crashes
+#include "xAODPFlow/PFOContainer.h" // old EDM
+#include "xAODPFlow/FlowElementContainer.h" // Container to replace it
 /**                                                                                                                                                                                     
 This is the algorithm, which inherits from AthAlgorithm, that adds element links 
-between particle flow objects (PFOs) and Egamma objects. The algorithm associates charged (c) PFOs 
-to all electron and converted photon tracks, and neutral (n) PFOs to all electron and photon clusters. 
-This is done by adding decorations to the "Electron" and "Photon" container, for charged cPFOs and nPFOs separately, 
-in the form of vectors of element links to the associated PFOs. 
+between particle flow objects (Flow Elements) and Egamma objects. The algorithm associates charged (c) Flow Elements 
+to all electron and converted photon tracks, and neutral (n) Flow Elements to all electron and photon clusters. 
+This is done by adding decorations to the "Electron" and "Photon" container, for charged Charged Flow Elements and Neutral Flow Elements separately, 
+in the form of vectors of element links to the associated Flow Elements. 
 The algorithm also adds decorations to the "JetETMissNeutralParticleFlowObjects" and 
 "JetETMissChargedParticleFlowObjects" containers, 
 in the form of vectors of element links to the associated electrons and photons.
@@ -43,23 +45,23 @@ public:
   
 private:
 
-  /** The write key for adding nPFO element link decorations to electrons */ 
+  /** The write key for adding Neutral Flow Element element link decorations to electrons */ 
   SG::WriteDecorHandleKey<xAOD::ElectronContainer> m_electronNeutralPFOWriteDecorKey;
-  /** The write key for adding cPFO element link decorations to electrons */
+  /** The write key for adding Charged Flow Element element link decorations to electrons */
   SG::WriteDecorHandleKey<xAOD::ElectronContainer> m_electronChargedPFOWriteDecorKey;
-  /** The write key for adding electron element link decorations to nPFOs */
-  SG::WriteDecorHandleKey<xAOD::PFOContainer> m_neutralpfoElectronWriteDecorKey;
-  /** The write key for adding electron element link decorations to cPFOs */
-  SG::WriteDecorHandleKey<xAOD::PFOContainer> m_chargedpfoElectronWriteDecorKey;
+  /** The write key for adding electron element link decorations to Neutral Flow Elements */
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralpfoElectronWriteDecorKey;
+  /** The write key for adding electron element link decorations to Charged Flow Elements */
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedpfoElectronWriteDecorKey;
 
-  /** The write key for adding nPFO element link decorations to photons */
+  /** The write key for adding Neutral Flow Element element link decorations to photons */
   SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonNeutralPFOWriteDecorKey;
-  /** The write key for adding cPFO element link decorations to photons */
+  /** The write key for adding Charged Flow Element element link decorations to photons */
   SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonChargedPFOWriteDecorKey;
-  /** The write key for adding photon element link decorations to nPFOs */
-  SG::WriteDecorHandleKey<xAOD::PFOContainer> m_neutralpfoPhotonWriteDecorKey;
-  /** The write key for adding photon element link decorations to cPFOs */
-  SG::WriteDecorHandleKey<xAOD::PFOContainer> m_chargedpfoPhotonWriteDecorKey;
+  /** The write key for adding photon element link decorations to Neutral Flow Elements */
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralpfoPhotonWriteDecorKey;
+  /** The write key for adding photon element link decorations to Charged Flow Elements */
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedpfoPhotonWriteDecorKey;
  
 };
 
diff --git a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
index 9e3feb477e2c..f9d08fab9c19 100644
--- a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
+++ b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
@@ -1,7 +1,6 @@
 /*  
  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-
 #include "eflowRec/NewEDM_PFEGamRecoAssoc.h" 
 #include "StoreGate/WriteDecorHandle.h" 
 #include "xAODEgamma/ElectronContainer.h" 
@@ -10,13 +9,18 @@
 #include "xAODEgamma/Photon.h"
 #include "xAODEgamma/ElectronxAODHelpers.h"
 #include "xAODEgamma/EgammaxAODHelpers.h" 
+// keep these for the moment, although we expect to NOT need them
 #include "xAODPFlow/PFOContainer.h" 
 #include "xAODPFlow/PFO.h" 
+// this is the new EDM to replace the above
+#include "xAODPFlow/FlowElementContainer.h"
+#include "xAODPFlow/FlowElement.h"
+
+#include <typeinfo> // temp debug for type checks on objects
 
 typedef ElementLink<xAOD::ElectronContainer> ElectronLink_t; 
 typedef ElementLink<xAOD::PhotonContainer> PhotonLink_t;
-typedef ElementLink<xAOD::PFOContainer> PFOLink_t; 
-
+typedef ElementLink<xAOD::FlowElementContainer> FlowElementLink_t; 
 
 NewEDM_PFEGamRecoAssoc::NewEDM_PFEGamRecoAssoc(
 const std::string& name,
@@ -25,16 +29,16 @@ const std::string& name,
   AthAlgorithm(name,pSvcLocator)
 {
 // Class initializer 
-declareProperty ("ElectronNeutralPFODecorKey", m_electronNeutralPFOWriteDecorKey = "Electrons.neutralpfoLinks");   
-declareProperty ("ElectronChargedPFODecorKey", m_electronChargedPFOWriteDecorKey = "Electrons.chargedpfoLinks");   
-declareProperty ("NeutralPFOElectronDecorKey", m_neutralpfoElectronWriteDecorKey = "JetETMissNeutralParticleFlowObjects.pfo_ElectronLinks");   
-declareProperty ("ChargedPFOElectronDecorKey", m_chargedpfoElectronWriteDecorKey = "JetETMissChargedParticleFlowObjects.pfo_ElectronLinks"); 
+declareProperty ("ElectronNeutralPFODecorKey", m_electronNeutralPFOWriteDecorKey = "Electrons.neutralfeLinks");   
+declareProperty ("ElectronChargedPFODecorKey", m_electronChargedPFOWriteDecorKey = "Electrons.chargedfeLinks");   
+declareProperty ("NeutralPFOElectronDecorKey", m_neutralpfoElectronWriteDecorKey = "JetETMissNeutralFlowElements.fe_ElectronLinks");   
+declareProperty ("ChargedPFOElectronDecorKey", m_chargedpfoElectronWriteDecorKey = "JetETMissChargedFlowElements.fe_ElectronLinks"); 
 
-declareProperty ("PhotonNeutralPFODecorKey", m_photonNeutralPFOWriteDecorKey = "Photons.neutralpfoLinks");
-declareProperty ("PhotonChargedPFODecorKey", m_photonChargedPFOWriteDecorKey = "Photons.chargedpfoLinks");
-declareProperty ("NeutralPFOPhotonDecorKey", m_neutralpfoPhotonWriteDecorKey = "JetETMissNeutralParticleFlowObjects.pfo_PhotonLinks");
-declareProperty ("ChargedPFOPhotonDecorKey", m_chargedpfoPhotonWriteDecorKey = "JetETMissChargedParticleFlowObjects.pfo_PhotonLinks");
-} 
+declareProperty ("PhotonNeutralPFODecorKey", m_photonNeutralPFOWriteDecorKey = "Photons.neutralfeLinks");
+declareProperty ("PhotonChargedPFODecorKey", m_photonChargedPFOWriteDecorKey = "Photons.chargedfeLinks");
+declareProperty ("NeutralPFOPhotonDecorKey", m_neutralpfoPhotonWriteDecorKey = "JetETMissNeutralFlowElements.fe_PhotonLinks");
+declareProperty ("ChargedPFOPhotonDecorKey", m_chargedpfoPhotonWriteDecorKey = "JetETMissChargedParticleFlowObjects.fe_PhotonLinks");
+}
 
 // Class destructor 
 NewEDM_PFEGamRecoAssoc::~NewEDM_PFEGamRecoAssoc(){}
@@ -61,7 +65,61 @@ return StatusCode::SUCCESS;
 StatusCode NewEDM_PFEGamRecoAssoc::finalize(){
 return StatusCode::SUCCESS;
 }
-StatusCode NewEDM_PFEGamRecoAssoc::execute(){
+StatusCode NewEDM_PFEGamRecoAssoc::execute()
+{
+// write decoration handles for the electron, photon and PFO containers -- these are the OUTPUT handles
+//Electron Write Handle
+SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronNeutralPFOWriteDecorHandle (m_electronNeutralPFOWriteDecorKey);   
+SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronChargedPFOWriteDecorHandle (m_electronChargedPFOWriteDecorKey);   
+SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > neutralpfoElectronWriteDecorHandle (m_neutralpfoElectronWriteDecorKey);   
+SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > chargedpfoElectronWriteDecorHandle (m_chargedpfoElectronWriteDecorKey); 
+
+//Photon Write Handle
+SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonNeutralPFOWriteDecorHandle (m_photonNeutralPFOWriteDecorKey);
+SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonChargedPFOWriteDecorHandle (m_photonChargedPFOWriteDecorKey);
+SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > neutralpfoPhotonWriteDecorHandle (m_neutralpfoPhotonWriteDecorKey);
+SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > chargedpfoPhotonWriteDecorHandle (m_chargedpfoPhotonWriteDecorKey);  
+
+
+// This is the READ handles (so the input containers for electron, photon, PFO)
+
+SG::ReadHandle<xAOD::ElectronContainer>electronReadHandle (m_electronNeutralPFOWriteDecorKey.contHandleKey());
+SG::ReadHandle<xAOD::PhotonContainer> photonReadHandle (m_photonNeutralPFOWriteDecorKey.contHandleKey());
+
+// Charged and Neutral PFlow "Flow elements"
+SG::ReadHandle<xAOD::FlowElementContainer> neutralpfoReadHandle (m_neutralpfoElectronWriteDecorKey.contHandleKey());   
+SG::ReadHandle<xAOD::FlowElementContainer> chargedpfoReadHandle (m_chargedpfoElectronWriteDecorKey.contHandleKey());   
+  
+// now initialise some Flow element link containers
+std::vector<std::vector<FlowElementLink_t>> electronNeutralPFOVec(electronReadHandle->size());
+std::vector<std::vector<FlowElementLink_t>> electronChargedPFOVec(electronReadHandle->size());
+
+std::vector<std::vector<FlowElementLink_t>> photonNeutralPFOVec(photonReadHandle->size());
+std::vector<std::vector<FlowElementLink_t>> photonChargedPFOVec(photonReadHandle->size());
+
+///////////////////////////
+// Loop over neutral flow elements (PFOs)
+///////////////////////////
+
+ for (const xAOD::FlowElement* pfo: *neutralpfoElectronWriteDecorHandle){
+   //Obtain the index of the PFO topo-cluster
+   auto pfoClusterIndex = pfo->CaloCluster;
+   std::string mytype=typeid(pfoClusterIndex).name();
+   std::cout<<"Flow Element CaloCluster type: "<<mytype<<std::endl;
+   
+ }
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 return StatusCode::SUCCESS;
-- 
GitLab


From 8a7ca1a63f7b36b082c745ec7eb4ef105c6c2e99 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Thu, 20 Aug 2020 17:57:08 +0200
Subject: [PATCH 097/422] more tinkering with read handles

---
 Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
index f9d08fab9c19..0dcb6965aa2a 100644
--- a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
+++ b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
@@ -37,7 +37,7 @@ declareProperty ("ChargedPFOElectronDecorKey", m_chargedpfoElectronWriteDecorKey
 declareProperty ("PhotonNeutralPFODecorKey", m_photonNeutralPFOWriteDecorKey = "Photons.neutralfeLinks");
 declareProperty ("PhotonChargedPFODecorKey", m_photonChargedPFOWriteDecorKey = "Photons.chargedfeLinks");
 declareProperty ("NeutralPFOPhotonDecorKey", m_neutralpfoPhotonWriteDecorKey = "JetETMissNeutralFlowElements.fe_PhotonLinks");
-declareProperty ("ChargedPFOPhotonDecorKey", m_chargedpfoPhotonWriteDecorKey = "JetETMissChargedParticleFlowObjects.fe_PhotonLinks");
+declareProperty ("ChargedPFOPhotonDecorKey", m_chargedpfoPhotonWriteDecorKey = "JetETMissChargedFlowElements.fe_PhotonLinks");
 }
 
 // Class destructor 
@@ -100,7 +100,7 @@ std::vector<std::vector<FlowElementLink_t>> photonChargedPFOVec(photonReadHandle
 ///////////////////////////
 // Loop over neutral flow elements (PFOs)
 ///////////////////////////
-
+ std::cout<<"MATT'S DEBUG: PFO elements size "<<neutralpfoElectronWriteDecorHandle->size()<<std::endl;
  for (const xAOD::FlowElement* pfo: *neutralpfoElectronWriteDecorHandle){
    //Obtain the index of the PFO topo-cluster
    auto pfoClusterIndex = pfo->CaloCluster;
-- 
GitLab


From a6d019bf82c92e2c1058dbbb2d9508874e2ab111 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Fri, 21 Aug 2020 07:37:34 +0200
Subject: [PATCH 098/422] ALFA Calib runs

---
 .../TriggerJobOpts/share/runHLT_standalone.py |  1 +
 .../CalibCosmicMon/CalibChainConfiguration.py | 25 ------------
 .../CalibCosmicMon/GenerateCalibChainDefs.py  | 38 -------------------
 .../HLTMenuConfig/Menu/GenerateMenuMT.py      | 25 +++++++-----
 .../HLTMenuConfig/Menu/SignatureDicts.py      |  7 +++-
 5 files changed, 22 insertions(+), 74 deletions(-)
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index d3785428bea8..ab646802da8f 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -45,6 +45,7 @@ class opt:
     enableL1CaloLegacy = True         # Enable Run-2 L1Calo simulation and/or decoding (possible even if enablePhase1 is True)
 #Individual slice flags
     doCalibSlice        = True
+    # doCalibrationSlice  = True
     doTestSlice         = True
     doHeavyIonSlice     = True
     doEnhancedBiasSlice = True
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
deleted file mode 100644
index 3a9ea2d4fb54..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-from AthenaCommon.Logging import logging
-logging.getLogger().info("Importing %s",__name__)
-log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibChainConfiguration")
-
-from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
-
-#----------------------------------------------------------------
-class CalibChainConfiguration(ChainConfigurationBase):
-
-    def __init__(self, chainDict):
-        ChainConfigurationBase.__init__(self,chainDict)
-        
-    # ----------------------
-    # Assemble the chain depending on information from chainName
-    # ----------------------
-    def assembleChain(self):       
-                         
-        chainSteps = []
-        log.debug("Assembling chain for " + self.chainName)
-        myChain = self.buildChain(chainSteps)
-        return myChain
-
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py
deleted file mode 100644
index 7db53d3b1c51..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDict
-from TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibChainConfiguration import CalibChainConfiguration as CalibChainConfiguration
-from TriggerMenuMT.HLTMenuConfig.Menu.ChainMerging import mergeChainDefs
-
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.generateChainConfigs' )
-log.info("Importing %s",__name__)
-
-
-
-def generateChainConfigs( chainDict ):
-
-    listOfChainDicts = splitChainDict(chainDict)
-    log.debug("Will generate Config for streamer: %s", chainDict['chainName'])
-
-    listOfChainDefs = []
-        
-    #streamers will never have more than one chainPart but this is still
-    #needed to move to the correct format [{}]->{}
-    for subChainDict in listOfChainDicts:
-        
-        Calib = CalibChainConfiguration(subChainDict).assembleChain() 
-
-        listOfChainDefs += [Calib]
-        log.debug('length of chaindefs %s', len(listOfChainDefs) )
-
-    if len(listOfChainDefs)>1:
-        log.warning("This is a streamer with more than one chainPart, is this really intended?")
-        theChainDef = mergeChainDefs(listOfChainDefs, chainDict)
-    else:
-        theChainDef = listOfChainDefs[0]
-
-    log.debug("theChainDef %s" , theChainDef)
-
-    return theChainDef
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index bd24891ca793..12ffcb462cb9 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -64,8 +64,8 @@ class GenerateMenuMT(object):
         self.signaturesToGenerate = []
         self.allSignatures = ['Egamma', 'Muon', 'Jet', 'Bjet', 'Bphysics', 'MET', 'Tau',
                               'HeavyIon', 'Beamspot', 'Cosmic', 'EnhancedBias',
-                              'Monitor', 'Calib', 'Streaming', 'Combined', 'MinBias', 'Test'] #, AFP
-        self.calibCosmicMonSigs = ['Streaming','Monitor','Beamspot','Cosmic', 'Calib'] #others not implemented yet ['Beamspot', 'Cosmic', 'EnhancedBias', 'Monitor', 'Calib', 'Streaming']
+                              'Monitor', 'Calibration', 'Streaming', 'Combined', 'MinBias', 'Test'] #, AFP
+        self.calibCosmicMonSigs = ['Streaming','Monitor','Beamspot','Cosmic', 'Calibration'] #others not implemented yet ['Beamspot', 'Cosmic', 'EnhancedBias', 'Monitor', 'Calib', 'Streaming']
 
         # flags
         self.doEgammaChains         = True
@@ -80,7 +80,7 @@ class GenerateMenuMT(object):
         self.doHeavyIonChains       = True
         self.doCosmicChains         = True
         self.doCalibrationChains    = True
-        self.doCalibChains    = True
+        # self.doCalibChains    = True
         self.doStreamingChains      = True
         self.doMonitorChains        = True
         self.doBeamspotChains       = True
@@ -365,14 +365,17 @@ class GenerateMenuMT(object):
         #ConfigFlags.lock()
 
         for sig in self.allSignatures:
-            if eval('TriggerFlags.' + sig + 'Slice.signatures()') and eval('self.do' + sig + 'Chains'):
-                log.debug("Adding %s chains to the list of chains to be configured", sig)
-                chains+= eval('TriggerFlags.' + sig + 'Slice.signatures()')
+            sig2 = sig
+            if sig2 == 'Calibration': 
+                sig2 = 'Calib'
+            if eval('TriggerFlags.' + sig2 + 'Slice.signatures()') and eval('self.do' + sig + 'Chains'):
+                log.debug("Adding %s chains to the list of chains to be configured", sig2)
+                chains+= eval('TriggerFlags.' + sig2 + 'Slice.signatures()')
                 self.signaturesToGenerate.append(sig)
-            elif not eval('TriggerFlags.' + sig + 'Slice.signatures()'):
-                log.debug('Signature %s is not switched on (no chains in menu)', sig)
+            elif not eval('TriggerFlags.' + sig2 + 'Slice.signatures()'):
+                log.debug('Signature %s is not switched on (no chains in menu)', sig2)
             elif not eval('self.do' + sig + 'Chains'):
-                log.debug('Signature %s is not switched on (disabled by flag)', sig)
+                log.debug('Signature %s is not switched on (disabled by flag)', sig2)
 
         log.info("The following signature(s) is (are) enabled: %s", self.signaturesToGenerate)
 
@@ -398,7 +401,11 @@ class GenerateMenuMT(object):
         # Assembles the chain configuration and returns a chain object with (name, L1see and list of ChainSteps)
         """
         # check if all the signature files can be imported files can be imported
+        log.debug("[__generateChainConfig] signaturesToGenerate: %s",  self.signaturesToGenerate)
+
         for sig in self.signaturesToGenerate:
+            log.debug("[__generateChainConfig] sig: %s", sig)
+            
             try:
                 if eval('self.do' + sig + 'Chains'):
                     if sig == 'Egamma':
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index b762a4c86a8f..3ff58f0152ba 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -23,6 +23,7 @@ SliceIDDict = {
     'HeavyIon' : 'hi',
     'Cosmic'  : 'cosmic',
     'Calibration'   : 'calib',
+    #'Calib'   : 'calib',
     'Streaming'     : 'streamer',
     'Monitor'    : 'mon',
     'Beamspot'      : 'beamspot',
@@ -38,7 +39,9 @@ AllowedSignatures = ["jet", "bjet", "ht",
                      "minbias", 
                      "heavyion", 
                      "cosmic", 
-                     "calibration", "streaming", "monitoring", 'eb']        
+                     "calibration",
+                     #"calib", 
+                     "streaming", "monitoring", 'eb']        
 
 #==========================================================
 # ---- Generic Template for all chains          ----
@@ -826,7 +829,7 @@ def getSignatureInformation(signature):
     if signature == "Test":
         return [TestChainParts_Default, TestChainParts]
     else:
-        raise RuntimeError("ERROR Cannot find corresponding dictionary")
+        raise RuntimeError("ERROR Cannot find corresponding dictionary for signature", signature)
 
 #==========================================================
 # Analysis the base pattern: <mult><signatureType><threshold><extraInfo>
-- 
GitLab


From 30324ec54d063dbec642b35dd69919e4b6bc05a4 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 21 Aug 2020 17:40:11 +0200
Subject: [PATCH 099/422] Try for Kristin

---
 .../AFP/Run3AFPMonitoring/CMakeLists.txt           |  1 +
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h        |  6 +++---
 .../python/Run3AFPExampleMonitorAlgorithm.py       |  2 --
 .../Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx  | 14 +++++++-------
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index 0130dc3dcc86..4f1c65d2739a 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -50,6 +50,7 @@ atlas_add_component( Run3AFPMonitoring
         LumiBlockCompsLib
         LumiBlockData
         TrigDecisionToolLib
+#        TrigAnalysisInterfaces
         xAODForward
         #xAODTrigger
         #Trigger
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 34f7ebd0a4bd..e0177d5f9cff 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -8,10 +8,10 @@
 #include "AthenaMonitoring/AthMonitorAlgorithm.h"
 #include "AthenaMonitoringKernel/Monitored.h"
 #include "StoreGate/ReadHandleKey.h"
-#include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
+//#include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
 #include "xAODForward/AFPSiHitContainer.h"
 #include "xAODForward/AFPSiHit.h"
-#include "LumiBlockData/BunchCrossingCondData.h"
+//#include "LumiBlockData/BunchCrossingCondData.h"
 
 #include "TRandom3.h"
 
@@ -29,7 +29,7 @@ private:
 	std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
 	std::map<std::string,int> m_TrackGroup; 
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
-	ToolHandle<Trig::IBunchCrossingTool> m_bcTool;
+//	ToolHandle<Trig::IBunchCrossingTool> m_bcTool;
 	//SG::ReadCondHandleKey<BunchCrossingCondData>  m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
 	//BunchCrossingCondData m_bunchCrossingCondTool;
 	
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index d999f52dadb1..fef852cd1aa4 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -108,5 +108,3 @@ if __name__=='__main__':
 
     cfg.run(100)
 
-
-
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index a77a2e318ddc..63d1c4a0d56c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -121,10 +121,10 @@ AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator*
 :AthMonitorAlgorithm(name,pSvcLocator)
 , m_afpHitContainerKey("AFPSiHitContainer")
 //, m_bunchCrossingCondTool("BunchCrossingCondData")
-, m_bcTool("Trig::TrigConfBunchCrossingTool/BunchCrossingTool")
+//, m_bcTool("Trig::TrigConfBunchCrossingTool/BunchCrossingTool")
 {
 	declareProperty( "AFPSiHitContainer", m_afpHitContainerKey );
-	declareProperty("BCTool", m_bcTool);
+//	declareProperty("BCTool", m_bcTool);
 	//declareProperty("BunchCrossingCondData", m_bunchCrossingCondTool);
 }
 
@@ -168,7 +168,7 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 	*/
 	//ATH_CHECK(m_bunchCrossingKey.initialize());
 	ATH_MSG_INFO("Initializing...");
-	CHECK(m_bcTool.retrieve());
+//	CHECK(m_bcTool.retrieve());
 	ATH_MSG_INFO("Retrieved the bunch crossing tool.");
 	return AthMonitorAlgorithm::initialize();
 }
@@ -184,11 +184,11 @@ StatusCode AFPSiLayerAlgorithm::execute(const EventContext& ctx) const {
 	//std::cout << "\n\tNumber of filled bunches: " << m_bunchCrossingCondTool.numberOfFilledBunches() << "\n";	
 	//std::cout << "\tNumber of bunch trains: " << m_bunchCrossingCondTool.numberOfBunchTrains() << "\n";
 	unsigned int bcid_type = GetEventInfo(ctx)->bcid();
-	if(m_bcTool->isFilled(bcid_type))
+/*	if(m_bcTool->isFilled(bcid_type))
 	{
 		std::cout << "Bunch is filled: " << bcid_type << " \n";
 	}
-
+*/
 	return StatusCode::SUCCESS;
 }
 
@@ -234,7 +234,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	
 	
 	lb = GetEventInfo(ctx)->lumiBlock();
-	muPerBCID = lbAverageInteractionsPerCrossing(ctx);
+	muPerBCID = 1;//lbAverageInteractionsPerCrossing(ctx);
 	//run = GetEventInfo(ctx)->runNumber();
 	fill("AFPSiLayerTool", lb, muPerBCID);
 	
@@ -326,6 +326,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	
 
 	
+
 	for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
 	{
 				
@@ -738,4 +739,3 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 } // end of fillHistograms
 
 
-
-- 
GitLab


From 63ab0a57b26f19120ea8a381c98f3b1d8a8eba8a Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Fri, 21 Aug 2020 18:00:26 +0200
Subject: [PATCH 100/422] starting the migration

---
 .../eflowRec/share/PFlowMTConfig.py           |  14 +--
 .../eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx   | 111 +++++++++++-------
 2 files changed, 73 insertions(+), 52 deletions(-)

diff --git a/Reconstruction/eflowRec/share/PFlowMTConfig.py b/Reconstruction/eflowRec/share/PFlowMTConfig.py
index ce49dcb4b876..1876eecfa214 100644
--- a/Reconstruction/eflowRec/share/PFlowMTConfig.py
+++ b/Reconstruction/eflowRec/share/PFlowMTConfig.py
@@ -243,8 +243,9 @@ if True == jobproperties.eflowRecFlags.provideShowerSubtractedClusters:
     PFONeutralCreatorAlgorithm.AddShowerSubtractedClusters = True
 
 topSequence += PFONeutralCreatorAlgorithm
-from eflowRec.eflowRecFlags import jobproperties
+from eflowRec.eflowRecFlags import jobproperties # set reco flags for eFlowRec algorithms
 jobproperties.eflowRecFlags.usePFEGammaPFOAssoc.set_Value_and_Lock(True)
+jobproperties.eflowRecFlags.useFlowElements.set_Value_and_Lock(True)
 
 if jobproperties.eflowRecFlags.usePFEGammaPFOAssoc:
    
@@ -252,13 +253,8 @@ if jobproperties.eflowRecFlags.usePFEGammaPFOAssoc:
    PFEGammaPFOAssoc=PFEGammaPFOAssoc("PFEGammaPFOAssoc")
    topSequence += PFEGammaPFOAssoc
 
-   from eflowRec.eflowRecConf import NewEDM_PFEGamRecoAssoc
-   NewEDM_PFEGamRecoAssoc=NewEDM_PFEGamRecoAssoc("NewEDM_PFEGamRecoAssoc")
-   topSequence +=NewEDM_PFEGamRecoAssoc
-   
-
 #Add new FlowElement creators
-if jobproperties.eflowRecFlags.useFlowElements:
+if jobproperties.eflowRecFlags.useFlowElements: 
   from eflowRec.eflowRecConf import PFChargedFlowElementCreatorAlgorithm
   PFChargedFlowElementCreatorAlgorithm = PFChargedFlowElementCreatorAlgorithm("PFChargedFlowElementCreatorAlgorithm")
   topSequence += PFChargedFlowElementCreatorAlgorithm 
@@ -270,3 +266,7 @@ if jobproperties.eflowRecFlags.useFlowElements:
   from eflowRec.eflowRecConf import PFLCNeutralFlowElementCreatorAlgorithm
   PFLCNeutralFlowElementCreatorAlgorithm = PFLCNeutralFlowElementCreatorAlgorithm("PFLCNeutralFlowElementCreatorAlgorithm")
   topSequence += PFLCNeutralFlowElementCreatorAlgorithm 
+
+  from eflowRec.eflowRecConf import NewEDM_PFEGamRecoAssoc
+  NewEDM_PFEGamRecoAssoc=NewEDM_PFEGamRecoAssoc("NewEDM_PFEGamRecoAssoc")
+  topSequence +=NewEDM_PFEGamRecoAssoc
diff --git a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
index 0dcb6965aa2a..458fac110b2a 100644
--- a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
+++ b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
@@ -67,60 +67,81 @@ return StatusCode::SUCCESS;
 }
 StatusCode NewEDM_PFEGamRecoAssoc::execute()
 {
-// write decoration handles for the electron, photon and PFO containers -- these are the OUTPUT handles
-//Electron Write Handle
-SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronNeutralPFOWriteDecorHandle (m_electronNeutralPFOWriteDecorKey);   
-SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronChargedPFOWriteDecorHandle (m_electronChargedPFOWriteDecorKey);   
-SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > neutralpfoElectronWriteDecorHandle (m_neutralpfoElectronWriteDecorKey);   
-SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > chargedpfoElectronWriteDecorHandle (m_chargedpfoElectronWriteDecorKey); 
-
-//Photon Write Handle
-SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonNeutralPFOWriteDecorHandle (m_photonNeutralPFOWriteDecorKey);
-SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonChargedPFOWriteDecorHandle (m_photonChargedPFOWriteDecorKey);
-SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > neutralpfoPhotonWriteDecorHandle (m_neutralpfoPhotonWriteDecorKey);
-SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > chargedpfoPhotonWriteDecorHandle (m_chargedpfoPhotonWriteDecorKey);  
-
-
-// This is the READ handles (so the input containers for electron, photon, PFO)
-
-SG::ReadHandle<xAOD::ElectronContainer>electronReadHandle (m_electronNeutralPFOWriteDecorKey.contHandleKey());
-SG::ReadHandle<xAOD::PhotonContainer> photonReadHandle (m_photonNeutralPFOWriteDecorKey.contHandleKey());
-
-// Charged and Neutral PFlow "Flow elements"
-SG::ReadHandle<xAOD::FlowElementContainer> neutralpfoReadHandle (m_neutralpfoElectronWriteDecorKey.contHandleKey());   
-SG::ReadHandle<xAOD::FlowElementContainer> chargedpfoReadHandle (m_chargedpfoElectronWriteDecorKey.contHandleKey());   
+  // This algorithm does the following:
+  // 1) Read the Input containers for Flow Elements, Electrons and Photons
+  // 2) Match the Clusters in the flow elements to the relevant E/Photon clusters
+  // 3) Link them
+  // 4) output the Electron/Photon containers with the linkers to the Flow element containers
+
+  // write decoration handles for the electron, photon and PFO containers -- these are the OUTPUT handles
+  //Electron Write Handle
+  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronNeutralPFOWriteDecorHandle (m_electronNeutralPFOWriteDecorKey);   
+  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronChargedPFOWriteDecorHandle (m_electronChargedPFOWriteDecorKey);   
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > neutralpfoElectronWriteDecorHandle (m_neutralpfoElectronWriteDecorKey);   
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > chargedpfoElectronWriteDecorHandle (m_chargedpfoElectronWriteDecorKey); 
+
+  //Photon Write Handle
+  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonNeutralPFOWriteDecorHandle (m_photonNeutralPFOWriteDecorKey);
+  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonChargedPFOWriteDecorHandle (m_photonChargedPFOWriteDecorKey);
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > neutralpfoPhotonWriteDecorHandle (m_neutralpfoPhotonWriteDecorKey);
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > chargedpfoPhotonWriteDecorHandle (m_chargedpfoPhotonWriteDecorKey);  
+  
+  
+  // This is the READ handles (so the input containers for electron, photon, PFO)
+  
+  SG::ReadHandle<xAOD::ElectronContainer>electronReadHandle (m_electronNeutralPFOWriteDecorKey.contHandleKey());
+  SG::ReadHandle<xAOD::PhotonContainer> photonReadHandle (m_photonNeutralPFOWriteDecorKey.contHandleKey());
+  
+  // Charged and Neutral PFlow "Flow elements"
+  SG::ReadHandle<xAOD::FlowElementContainer> neutralpfoReadHandle (m_neutralpfoElectronWriteDecorKey.contHandleKey());   
+  SG::ReadHandle<xAOD::FlowElementContainer> chargedpfoReadHandle (m_chargedpfoElectronWriteDecorKey.contHandleKey());   
+  
+  // now initialise some Flow element link containers
+  std::vector<std::vector<FlowElementLink_t>> electronNeutralPFOVec(electronReadHandle->size());
+  std::vector<std::vector<FlowElementLink_t>> electronChargedPFOVec(electronReadHandle->size());
+  
+  std::vector<std::vector<FlowElementLink_t>> photonNeutralPFOVec(photonReadHandle->size());
+  std::vector<std::vector<FlowElementLink_t>> photonChargedPFOVec(photonReadHandle->size());
+  //////////////////////////////////////////////////////////////////////////
+  ////                      DO MATCHING/LINKING
+  //////////////////////////////////////////////////////////////////////////
   
-// now initialise some Flow element link containers
-std::vector<std::vector<FlowElementLink_t>> electronNeutralPFOVec(electronReadHandle->size());
-std::vector<std::vector<FlowElementLink_t>> electronChargedPFOVec(electronReadHandle->size());
-
-std::vector<std::vector<FlowElementLink_t>> photonNeutralPFOVec(photonReadHandle->size());
-std::vector<std::vector<FlowElementLink_t>> photonChargedPFOVec(photonReadHandle->size());
-
-///////////////////////////
-// Loop over neutral flow elements (PFOs)
-///////////////////////////
- std::cout<<"MATT'S DEBUG: PFO elements size "<<neutralpfoElectronWriteDecorHandle->size()<<std::endl;
- for (const xAOD::FlowElement* pfo: *neutralpfoElectronWriteDecorHandle){
-   //Obtain the index of the PFO topo-cluster
-   auto pfoClusterIndex = pfo->CaloCluster;
-   std::string mytype=typeid(pfoClusterIndex).name();
-   std::cout<<"Flow Element CaloCluster type: "<<mytype<<std::endl;
-   
- }
-
-
-
-
 
+  ///////////////////////////
+  // Loop over neutral flow elements (PFOs)
+  ///////////////////////////
+  std::cout<<"MATT'S DEBUG: PFO elements size "<<neutralpfoElectronWriteDecorHandle->size()<<std::endl;
+  for (const xAOD::FlowElement* pfo: *neutralpfoElectronWriteDecorHandle){
+    //Obtain the index of the PFO calo-cluster
+    size_t pfoClusterIndex=pfo->otherObjects().at(0)->index();
 
+    // init the linkers
+    std::vector<ElectronLink_t> pfoElectronLinks;
+    std::vector<PhotonLink_t> pfoPhotonLinks;
+    
+    std::cout<<"DEBUG 1:  pfoclusterindex: "<<pfoClusterIndex<<std::endl; 
+    //Loop over electrons:
+    for (const xAOD::Electron* electron: *electronNeutralPFOWriteDecorHandle){
+      // get the calo clusters from the electron
+      std::cout<<"DEBUG 2: Electron pt : "<<electron->pt()<<std::endl;
+      const std::vector<const xAOD::CaloCluster*> electronTopoClusters = xAOD::EgammaHelpers::getAssociatedTopoClusters(electron->caloCluster());
+	
+      for(const xAOD::CaloCluster* cluster : electronTopoClusters){
 
+	size_t electronClusterIndex=cluster->index();	
+	std::cout<<"DEBUG 3: Cluster index : "<<electronClusterIndex<<std::endl;
 
+      } // end loop over cluster
+      
+    } // end Electron loop
 
+    //Add vector of electron element links as decoration to FlowElement container
+    //    neutralpfoElectronWriteDecorHandle (*pfo)=pfoElectronLinks;
 
 
 
+  } // end neutral PFO loop
 
 
-return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 }
-- 
GitLab


From fabf068dec8bbdcde425360b4177a50e6c978620 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Fri, 21 Aug 2020 18:16:28 +0200
Subject: [PATCH 101/422] added new files for running the calibration chain

---
 .../CalibrationChainConfiguration.py          | 25 ++++++++++++
 .../GenerateCalibrationChainDefs.py           | 38 +++++++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibrationChainConfiguration.py
 create mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibrationChainDefs.py

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibrationChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibrationChainConfiguration.py
new file mode 100644
index 000000000000..5cc0d787e9fa
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibrationChainConfiguration.py
@@ -0,0 +1,25 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
+from AthenaCommon.Logging import logging
+logging.getLogger().info("Importing %s",__name__)
+log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibrationChainConfiguration")
+
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
+
+#----------------------------------------------------------------
+class CalibrationChainConfiguration(ChainConfigurationBase):
+
+    def __init__(self, chainDict):
+        ChainConfigurationBase.__init__(self,chainDict)
+        
+    # ----------------------
+    # Assemble the chain depending on information from chainName
+    # ----------------------
+    def assembleChain(self):       
+                         
+        chainSteps = []
+        log.debug("Assembling chain for " + self.chainName)
+        myChain = self.buildChain(chainSteps)
+        return myChain
+
+
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibrationChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibrationChainDefs.py
new file mode 100644
index 000000000000..3a1d29498c3a
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibrationChainDefs.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDict
+from TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibrationChainConfiguration import CalibrationChainConfiguration as CalibrationChainConfiguration
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainMerging import mergeChainDefs
+
+
+from AthenaCommon.Logging import logging
+log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.generateChainConfigs' )
+log.info("Importing %s",__name__)
+
+
+
+def generateChainConfigs( chainDict ):
+
+    listOfChainDicts = splitChainDict(chainDict)
+    log.debug("Will generate Config for streamer: %s", chainDict['chainName'])
+
+    listOfChainDefs = []
+        
+    #streamers will never have more than one chainPart but this is still
+    #needed to move to the correct format [{}]->{}
+    for subChainDict in listOfChainDicts:
+        
+        Calib = CalibrationChainConfiguration(subChainDict).assembleChain() 
+
+        listOfChainDefs += [Calib]
+        log.debug('length of chaindefs %s', len(listOfChainDefs) )
+
+    if len(listOfChainDefs)>1:
+        log.warning("This is a streamer with more than one chainPart, is this really intended?")
+        theChainDef = mergeChainDefs(listOfChainDefs, chainDict)
+    else:
+        theChainDef = listOfChainDefs[0]
+
+    log.debug("theChainDef %s" , theChainDef)
+
+    return theChainDef
-- 
GitLab


From dac8927612dfad428ee7942b9f993f602687f978 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Mon, 24 Aug 2020 12:29:22 +0200
Subject: [PATCH 102/422] Added something to PFlowDict to make FE code work

---
 Event/xAOD/xAODPFlow/xAODPFlow/selection.xml         |  2 ++
 Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h       | 12 +++++++-----
 .../eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx          |  2 ++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
index 2c6e4664db7c..2a1baeb97edb 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
@@ -48,5 +48,7 @@
    <class name="std::vector<std::pair<ElementLink<xAOD::CaloClusterContainer_v1>,double> >" />
    <class name="std::vector<std::vector<std::pair<ElementLink<xAOD::CaloClusterContainer_v1>,double> > >" />
    <class name="std::vector<xAOD::PFODetails::PFOLeptonType>" />
+   <class name="std::vector<std::vector<std::pair<ElementLink<xAOD::FlowElementContainer_v1>, double> > >" /> 
+   <class name="std::vector<std::vector<ElementLink<DataVector<xAOD::FlowElement_v1> > > >  "/>
 
 </lcgdict>
diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h b/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
index 11b944665f6a..bd5b4a687bc1 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
@@ -44,11 +44,13 @@ namespace {
      // Weird/bad types used by the PFO reconstruction as attributes on
      // xAOD::PFO objects. :-(
      std::pair< ElementLink< xAOD::CaloClusterContainer >, double > dummy1;
-     std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > >
-     dummy2;
-     std::vector< std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > > >
-     dummy3;
-     std::vector< xAOD::PFODetails::PFOLeptonType > dummy4;
+     std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > > dummy2;
+     std::vector< std::vector<ElementLink<xAOD::FlowElementContainer_v1>, double >> dummy3;
+     std::vector< std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > >  > dummy4;
+     std::vector< xAOD::PFODetails::PFOLeptonType > dummy5;
+
+     // fixes some issues in eflowRec
+     std::vector<std::vector<ElementLink<DataVector<xAOD::FlowElement_v1> > > > dummy6;
 
    };
 }
diff --git a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
index 458fac110b2a..9a144508a331 100644
--- a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
+++ b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
@@ -31,7 +31,9 @@ const std::string& name,
 // Class initializer 
 declareProperty ("ElectronNeutralPFODecorKey", m_electronNeutralPFOWriteDecorKey = "Electrons.neutralfeLinks");   
 declareProperty ("ElectronChargedPFODecorKey", m_electronChargedPFOWriteDecorKey = "Electrons.chargedfeLinks");   
+
 declareProperty ("NeutralPFOElectronDecorKey", m_neutralpfoElectronWriteDecorKey = "JetETMissNeutralFlowElements.fe_ElectronLinks");   
+
 declareProperty ("ChargedPFOElectronDecorKey", m_chargedpfoElectronWriteDecorKey = "JetETMissChargedFlowElements.fe_ElectronLinks"); 
 
 declareProperty ("PhotonNeutralPFODecorKey", m_photonNeutralPFOWriteDecorKey = "Photons.neutralfeLinks");
-- 
GitLab


From 3907fe51afe2eb192aef80e315184bb1ae027e28 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Mon, 24 Aug 2020 13:44:48 +0200
Subject: [PATCH 103/422] Update EGamma Association links to PFOs to use new
 EDM (FlowElements). Current naming convention though uses "Dummy"
 nomenclature. ToFix

---
 .../eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx   | 119 ++++++++++++++++--
 1 file changed, 111 insertions(+), 8 deletions(-)

diff --git a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
index 9a144508a331..916307319116 100644
--- a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
+++ b/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
@@ -71,7 +71,7 @@ StatusCode NewEDM_PFEGamRecoAssoc::execute()
 {
   // This algorithm does the following:
   // 1) Read the Input containers for Flow Elements, Electrons and Photons
-  // 2) Match the Clusters in the flow elements to the relevant E/Photon clusters
+  // 2) Match the Clusters in the flow elements to the relevant E/Photon clusters (Neutral) or match tracks to relevant Electron/Photon tracks (Charged)
   // 3) Link them
   // 4) output the Electron/Photon containers with the linkers to the Flow element containers
 
@@ -112,7 +112,6 @@ StatusCode NewEDM_PFEGamRecoAssoc::execute()
   ///////////////////////////
   // Loop over neutral flow elements (PFOs)
   ///////////////////////////
-  std::cout<<"MATT'S DEBUG: PFO elements size "<<neutralpfoElectronWriteDecorHandle->size()<<std::endl;
   for (const xAOD::FlowElement* pfo: *neutralpfoElectronWriteDecorHandle){
     //Obtain the index of the PFO calo-cluster
     size_t pfoClusterIndex=pfo->otherObjects().at(0)->index();
@@ -121,29 +120,133 @@ StatusCode NewEDM_PFEGamRecoAssoc::execute()
     std::vector<ElectronLink_t> pfoElectronLinks;
     std::vector<PhotonLink_t> pfoPhotonLinks;
     
-    std::cout<<"DEBUG 1:  pfoclusterindex: "<<pfoClusterIndex<<std::endl; 
     //Loop over electrons:
     for (const xAOD::Electron* electron: *electronNeutralPFOWriteDecorHandle){
       // get the calo clusters from the electron
-      std::cout<<"DEBUG 2: Electron pt : "<<electron->pt()<<std::endl;
+
       const std::vector<const xAOD::CaloCluster*> electronTopoClusters = xAOD::EgammaHelpers::getAssociatedTopoClusters(electron->caloCluster());
 	
+      
       for(const xAOD::CaloCluster* cluster : electronTopoClusters){
-
+	// obtain the index of the electron seed topocluster
 	size_t electronClusterIndex=cluster->index();	
-	std::cout<<"DEBUG 3: Cluster index : "<<electronClusterIndex<<std::endl;
+	//match the indices: Cluster match between Flow Element (PFO) and electron
+	if(electronClusterIndex==pfoClusterIndex){
+	  pfoElectronLinks.push_back( ElectronLink_t(*electronReadHandle,electron->index()) );
+	  //Add Flow Element (PFO) link to a vector
+	  //index() is the unique index of the Flow Element in the container
+	  electronNeutralPFOVec.at(electron->index()).push_back(FlowElementLink_t(*neutralpfoReadHandle, pfo->index()) );
+	}// end of matching block
 
       } // end loop over cluster
       
     } // end Electron loop
 
+    // now loop over photons
+    for (const xAOD::Photon* photon: *photonNeutralPFOWriteDecorHandle){
+      // retrieve clusters from the photon container
+      const std::vector<const xAOD::CaloCluster*> photonTopoClusters = xAOD::EgammaHelpers::getAssociatedTopoClusters(photon->caloCluster());
+      //loop over clusters, and do the matching
+      for (const xAOD::CaloCluster* cluster: photonTopoClusters){
+	//retrieve index of the cluster
+	size_t photonClusterIndex=cluster->index();
+	//do the matching
+	if(photonClusterIndex==pfoClusterIndex){
+	  // Add flow element (PFO) links to photon
+	  pfoPhotonLinks.push_back( PhotonLink_t(*photonReadHandle,photon->index()) );
+	  //Add Flow Element (PFO) link to a vector
+	  //index() is the unique index of the Flow Element in the container
+	  photonNeutralPFOVec.at(photon->index()).push_back(FlowElementLink_t(*neutralpfoReadHandle, pfo->index()) );	  
+	}// end of matching block
+      } // end of neutral loop
+      
+
+    }// end of photon loop
+    
     //Add vector of electron element links as decoration to FlowElement container
-    //    neutralpfoElectronWriteDecorHandle (*pfo)=pfoElectronLinks;
+    neutralpfoElectronWriteDecorHandle (*pfo)=pfoElectronLinks;
+    neutralpfoPhotonWriteDecorHandle (*pfo)=pfoPhotonLinks;
+
+  } // end neutral PFO loop
+
+  ////////////////////////////////////////////////////////
+  //             Loop over charged Flow Elements (PFOs)
+  ////////////////////////////////////////////////////////
+  for (const xAOD::FlowElement* pfo: *chargedpfoElectronWriteDecorHandle){
+    // retrieve the track from the Flow element
+    size_t pfoTrackIndex=pfo->chargedObjects().at(0)->index();
+    // Initialise a vector of element links to electrons/Photons
+    std::vector<ElectronLink_t> pfoElectronLinks;
+    std::vector<PhotonLink_t> pfoPhotonLinks;
 
+    //loop over electrons
+    for (const xAOD::Electron* electron: *electronChargedPFOWriteDecorHandle){
+      //obtain the clusters
+       const std::vector<const xAOD::TrackParticle*> electronTrackParticles = xAOD::EgammaHelpers::getTrackParticlesVec(electron, true, true); // useBremAssoc = true (get original non-GSF track), allParticles = true (include all track particles)
+       // loop over tracks
+       for (const xAOD::TrackParticle* electronTrack: electronTrackParticles){
+	 size_t electronTrackIndex = electronTrack->index();
+
+	 //link to PFO if track indices match
+	 if(electronTrackIndex==pfoTrackIndex){
+	   // Add electron element link to a vector 
+	   // index() is the unique index of the electron in the electron container 
+	   pfoElectronLinks.push_back( ElectronLink_t(*electronReadHandle, electron->index()) );
+	   // Add pfo element link to a vector 
+	   // index() is the unique index of the cPFO in the cPFO container 
+	   electronChargedPFOVec.at(electron->index()).push_back( FlowElementLink_t(*chargedpfoReadHandle, pfo->index()) );  
+
+	 }//end of matching block
+	 
+       }//end of loop on clusters
+    } // end of loop on electrons
+    
+    for(const xAOD::Photon* photon: *photonChargedPFOWriteDecorHandle){
+      //obtain indices of the converted photon's original tracks
+      const std::set<const xAOD::TrackParticle*> photonTrackParticles = xAOD::EgammaHelpers::getTrackParticles(photon, true);
+      // loop over the tracks
+      for (const xAOD::TrackParticle* photonTrack: photonTrackParticles){
+	size_t photonTrackIndex=photonTrack->index();
+	
+	// Link the photon to the Flow Element (PFO) if the track indices match
+	if (photonTrackIndex==pfoTrackIndex){
+	            // Add photon element link to a vector
+          // index() is the unique index of the photon in the photon container
+          pfoPhotonLinks.push_back( PhotonLink_t(*photonReadHandle, photon->index()) );
+          // Add pfo element link to a vector
+          // index() is the unique index of the cPFO in the cPFO container
+          photonChargedPFOVec.at(photon->index()).push_back( FlowElementLink_t(*chargedpfoReadHandle, pfo->index()) );
+	}// end of matching block
+
+      }// end of loop on tracks
+      
+    }//end of loop on photons
 
 
-  } // end neutral PFO loop
+    // Add vector of electron element links as decoration to PFO container     
+    chargedpfoElectronWriteDecorHandle (*pfo) = pfoElectronLinks;  
+    // Add vector of photon element links as decoration to PFO container
+    chargedpfoPhotonWriteDecorHandle (*pfo) = pfoPhotonLinks;
+
+  } // end of charged PFO loop
+  
+
 
+  ////////////////////////////////////////////////////
+  //   WRITE OUTPUT: ADD HANDLES TO EL/PHOT CONTAINERS
+  ////////////////////////////////////////////////////
+  // Add the vectors of the Flow Element (PFO) Links as decorations to the electron container
+  for (const xAOD::Electron* electron : *electronNeutralPFOWriteDecorHandle){
+    electronNeutralPFOWriteDecorHandle (*electron) = electronNeutralPFOVec.at(electron->index());
+    electronChargedPFOWriteDecorHandle (*electron) = electronChargedPFOVec.at(electron->index());
+  } //end of photon loop
+  // Add the vectors of the Flow Element (PFO) Links as decorations to the photon container
+  for (const xAOD::Photon* photon: *photonNeutralPFOWriteDecorHandle){
+    photonNeutralPFOWriteDecorHandle (*photon) = photonNeutralPFOVec.at(photon->index());
+    photonChargedPFOWriteDecorHandle (*photon) = photonChargedPFOVec.at(photon->index());
+  } // end of loop on photons
+
+  ATH_MSG_DEBUG("Execute completed successfully");
 
   return StatusCode::SUCCESS;
 }
-- 
GitLab


From ba839b8eda3aeafaed8ecc5cda7c5a7314cd00f2 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 24 Aug 2020 14:50:09 +0200
Subject: [PATCH 104/422] Fixing conflicts

---
 .../python/Run3AFPExampleMonitorAlgorithm.py         | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index d999f52dadb1..c27ca4a905c1 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -48,11 +48,11 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for {0} Layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
     array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for {0} Layer {1};timeOverThreshold; entries', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
     array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};x [mm];y [mm]', type='TH2F', path='Cluster', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
-    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerEvent / <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
+    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event by <mu>', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event by <mu>', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event by <mu>', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event by<mu>', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerEvent by <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
 
 
     array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
@@ -90,8 +90,8 @@ if __name__=='__main__':
 
     #ConfigFlags.Input.Files = [nightly+file]
     #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_6/aod0.pool.root']
-    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
     #ConfigFlags.Input.Files = ['/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1']
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
     ConfigFlags.Input.isMC = False
     ConfigFlags.Output.HISTFileName = 'AFPOutput46.root'
     
-- 
GitLab


From 64abf2b940eb8c1f824a456258de5923aecae429 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Mon, 24 Aug 2020 15:35:17 +0200
Subject: [PATCH 105/422] add renamed algo instead of the dummy name

---
 Reconstruction/eflowRec/share/PFlowMTConfig.py              | 6 +++---
 Reconstruction/eflowRec/src/components/eflowRec_entries.cxx | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Reconstruction/eflowRec/share/PFlowMTConfig.py b/Reconstruction/eflowRec/share/PFlowMTConfig.py
index 1876eecfa214..8fc0211ac214 100644
--- a/Reconstruction/eflowRec/share/PFlowMTConfig.py
+++ b/Reconstruction/eflowRec/share/PFlowMTConfig.py
@@ -267,6 +267,6 @@ if jobproperties.eflowRecFlags.useFlowElements:
   PFLCNeutralFlowElementCreatorAlgorithm = PFLCNeutralFlowElementCreatorAlgorithm("PFLCNeutralFlowElementCreatorAlgorithm")
   topSequence += PFLCNeutralFlowElementCreatorAlgorithm 
 
-  from eflowRec.eflowRecConf import NewEDM_PFEGamRecoAssoc
-  NewEDM_PFEGamRecoAssoc=NewEDM_PFEGamRecoAssoc("NewEDM_PFEGamRecoAssoc")
-  topSequence +=NewEDM_PFEGamRecoAssoc
+  from eflowRec.eflowRecConf import PFEGamFlowElementAssoc
+  PFEGamFlowElementAssoc=PFEGamFlowElementAssoc("PFEGamFlowElementAssoc")
+  topSequence +=PFEGamFlowElementAssoc
diff --git a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
index 54c6362a87f5..d3d4bab1785d 100644
--- a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
+++ b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
@@ -21,11 +21,13 @@
 #include "eflowRec/PFONeutralCreatorAlgorithm.h"
 #include "eflowRec/PFEGammaPFOAssoc.h"
 #include "eflowRec/NewEDM_PFEGamRecoAssoc.h"
+#include "eflowRec/PFEGamFlowElementAssoc.h"
 
 DECLARE_COMPONENT( eflowOverlapRemoval )
 DECLARE_COMPONENT( PFLeptonSelector )
 DECLARE_COMPONENT( PFEGammaPFOAssoc )
 DECLARE_COMPONENT( NewEDM_PFEGamRecoAssoc )
+DECLARE_COMPONENT( PFEGamFlowElementAssoc )
 DECLARE_COMPONENT( PFClusterSelectorTool )
 DECLARE_COMPONENT( PFTrackSelector )
 DECLARE_COMPONENT( PFAlgorithm )
-- 
GitLab


From 1fa677cfcaa797c59d153feaa01d01f21893bd07 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Mon, 24 Aug 2020 15:42:50 +0200
Subject: [PATCH 106/422] PFEGamFlowElementAssoc: rename the Association alg to
 something more sensible

---
 ...FEGamRecoAssoc.h => PFEGamFlowElementAssoc.h} | 16 ++++++++--------
 ...mRecoAssoc.cxx => PFEGamFlowElementAssoc.cxx} | 13 +++++++------
 .../eflowRec/src/components/eflowRec_entries.cxx |  2 --
 3 files changed, 15 insertions(+), 16 deletions(-)
 rename Reconstruction/eflowRec/eflowRec/{NewEDM_PFEGamRecoAssoc.h => PFEGamFlowElementAssoc.h} (91%)
 rename Reconstruction/eflowRec/src/{NewEDM_PFEGamRecoAssoc.cxx => PFEGamFlowElementAssoc.cxx} (97%)

diff --git a/Reconstruction/eflowRec/eflowRec/NewEDM_PFEGamRecoAssoc.h b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
similarity index 91%
rename from Reconstruction/eflowRec/eflowRec/NewEDM_PFEGamRecoAssoc.h
rename to Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
index 1190d563fb12..4845a217febd 100644
--- a/Reconstruction/eflowRec/eflowRec/NewEDM_PFEGamRecoAssoc.h
+++ b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
@@ -3,15 +3,15 @@
 */
 
 /*
- * PFEgammaPFOAssoc.h
- * Header file for class PFEGammaPFOAssoc
+ * PFEGamFlowElementAssoc.h
+ * Header file for class PFEGamFlowElementAssoc
  *                                                                                                                                                                                     
  *  Created on: 13.03.19                                                                                                                                                            
  *      Author: J. C. MacDonald                                                                                                                                                      
  */
 
-#ifndef NEWEDM_PFEGAMRECOASSOC_H
-#define NEWEDM_PFEGAMRECOASSOC_H
+#ifndef PFEGAMFLOWELEMENTASSOC_H
+#define PFEGAMFLOWELEMENTASSOC_H
 
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "xAODEgamma/ElectronContainer.h"
@@ -31,13 +31,13 @@ The algorithm also adds decorations to the "JetETMissNeutralParticleFlowObjects"
 "JetETMissChargedParticleFlowObjects" containers, 
 in the form of vectors of element links to the associated electrons and photons.
 */
-class NewEDM_PFEGamRecoAssoc : public AthAlgorithm {
+class PFEGamFlowElementAssoc : public AthAlgorithm {
 
 public:
 
-  NewEDM_PFEGamRecoAssoc(const std::string& name, ISvcLocator* pSvcLocator);
+  PFEGamFlowElementAssoc(const std::string& name, ISvcLocator* pSvcLocator);
   
-  virtual ~NewEDM_PFEGamRecoAssoc();
+  virtual ~PFEGamFlowElementAssoc();
 
   virtual StatusCode initialize() override final;
   virtual StatusCode execute() override final;
@@ -65,4 +65,4 @@ private:
  
 };
 
-#endif // NEWEDM_PFEGAMRECOASSOC
+#endif // PFEGamFlowElementAssoc
diff --git a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
similarity index 97%
rename from Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
rename to Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
index 916307319116..3baf5c053301 100644
--- a/Reconstruction/eflowRec/src/NewEDM_PFEGamRecoAssoc.cxx
+++ b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
@@ -1,7 +1,7 @@
 /*  
  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-#include "eflowRec/NewEDM_PFEGamRecoAssoc.h" 
+
 #include "StoreGate/WriteDecorHandle.h" 
 #include "xAODEgamma/ElectronContainer.h" 
 #include "xAODEgamma/PhotonContainer.h"
@@ -16,13 +16,14 @@
 #include "xAODPFlow/FlowElementContainer.h"
 #include "xAODPFlow/FlowElement.h"
 
+#include "eflowRec/PFEGamFlowElementAssoc.h" 
 #include <typeinfo> // temp debug for type checks on objects
 
 typedef ElementLink<xAOD::ElectronContainer> ElectronLink_t; 
 typedef ElementLink<xAOD::PhotonContainer> PhotonLink_t;
 typedef ElementLink<xAOD::FlowElementContainer> FlowElementLink_t; 
 
-NewEDM_PFEGamRecoAssoc::NewEDM_PFEGamRecoAssoc(
+PFEGamFlowElementAssoc::PFEGamFlowElementAssoc(
 const std::string& name,
   ISvcLocator* pSvcLocator
   ):
@@ -43,9 +44,9 @@ declareProperty ("ChargedPFOPhotonDecorKey", m_chargedpfoPhotonWriteDecorKey = "
 }
 
 // Class destructor 
-NewEDM_PFEGamRecoAssoc::~NewEDM_PFEGamRecoAssoc(){}
+PFEGamFlowElementAssoc::~PFEGamFlowElementAssoc(){}
 
-StatusCode NewEDM_PFEGamRecoAssoc::initialize()
+StatusCode PFEGamFlowElementAssoc::initialize()
 {
 
 ATH_MSG_DEBUG("Initializing "<<name() << "...");
@@ -64,10 +65,10 @@ ATH_CHECK(m_chargedpfoPhotonWriteDecorKey.initialize());
 return StatusCode::SUCCESS;
 }
 
-StatusCode NewEDM_PFEGamRecoAssoc::finalize(){
+StatusCode PFEGamFlowElementAssoc::finalize(){
 return StatusCode::SUCCESS;
 }
-StatusCode NewEDM_PFEGamRecoAssoc::execute()
+StatusCode PFEGamFlowElementAssoc::execute()
 {
   // This algorithm does the following:
   // 1) Read the Input containers for Flow Elements, Electrons and Photons
diff --git a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
index d3d4bab1785d..0f8d8a1b5381 100644
--- a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
+++ b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
@@ -20,13 +20,11 @@
 #include "eflowRec/PFOChargedCreatorAlgorithm.h"
 #include "eflowRec/PFONeutralCreatorAlgorithm.h"
 #include "eflowRec/PFEGammaPFOAssoc.h"
-#include "eflowRec/NewEDM_PFEGamRecoAssoc.h"
 #include "eflowRec/PFEGamFlowElementAssoc.h"
 
 DECLARE_COMPONENT( eflowOverlapRemoval )
 DECLARE_COMPONENT( PFLeptonSelector )
 DECLARE_COMPONENT( PFEGammaPFOAssoc )
-DECLARE_COMPONENT( NewEDM_PFEGamRecoAssoc )
 DECLARE_COMPONENT( PFEGamFlowElementAssoc )
 DECLARE_COMPONENT( PFClusterSelectorTool )
 DECLARE_COMPONENT( PFTrackSelector )
-- 
GitLab


From a0ee3b1f396dc34c9caea55278ab72e958d3ce54 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Mon, 24 Aug 2020 18:51:01 +0200
Subject: [PATCH 107/422] modified CTP ID 490 (set to L1_ALFA_ANY

---
 .../TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py              | 3 ++-
 .../python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py              | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
index 3989732ab3bd..e6487b49c2d5 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
@@ -803,7 +803,8 @@ def defineMenu():
         'L1_eEM15VHI_2eTAU12IM_gXERHO35' : 477,
         'L1_eEM15VH_MU10' : 478,
         'L1_eEM18VHI_3jJ20' : 489,
-        'L1_eEM20VHI_eTAU20IM_2eTAU20_jJ25_3jJ20' :  490,
+        # 'L1_eEM20VHI_eTAU20IM_2eTAU20_jJ25_3jJ20' :  490,
+        'L1_ALFA_ANY' : 490,
         'L1_eEM20VH_3eEM10VH' : 491,
         'L1_eEM22VHI' : 492,
         'L1_eEM20VHI' : 493, 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
index 3ccc35a1ff29..a264780c6635 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
@@ -1492,7 +1492,8 @@ def defineMenu():
 #        'L1_ALFA_ANY_ABORTGAPNOTCALIB' : 487,
 #        'L1_ALFA_ANY_CALIB' : 488,
          'L1_ALFA_B7L1U' : 489,
-         'L1_ALFA_B7L1L' : 490,
+         # 'L1_ALFA_B7L1L' : 490,
+         'L1_ALFA_ANY'   : 490,
          'L1_ALFA_A7L1U' : 491,
          'L1_ALFA_A7L1L' : 492,
          'L1_ALFA_A7R1U' : 493,
-- 
GitLab


From a7184ab7282b1280b4e3d07bb6e203a85553029c Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Mon, 24 Aug 2020 21:36:49 +0200
Subject: [PATCH 108/422] added L1_ALFA_ANY item

---
 .../TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py            | 5 ++++-
 .../python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py            | 1 -
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
index e6487b49c2d5..e9334fb8d945 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
@@ -1,3 +1,4 @@
+
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 #
 # Run this file in order to print out the empty slots
@@ -383,7 +384,9 @@ def defineMenu():
         #ATR-17320
         'L1_CEP-CJ60',
         'L1_CEP-CJ50' ,
-        'L1_CEP-CJ50.ETA21'
+        'L1_CEP-CJ50.ETA21',
+        
+        'L1_ALFA_ANY'
 
         ]
     
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
index a264780c6635..f32fe825deb0 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
@@ -1483,7 +1483,6 @@ def defineMenu():
 #        'L1_ALFA_SYST12' : 478,
 #        'L1_ALFA_SYST17' : 479,
 #        'L1_ALFA_SYST18' : 480,
-         'L1_ALFA_ANY' : 481,
 #        'L1_ALFA_ANY_EMPTY' : 482,
 #        'L1_ALFA_ANY_FIRSTEMPTY' : 483,
 #        'L1_ALFA_ANY_UNPAIRED_ISO' : 484,
-- 
GitLab


From 099d2b35210b02dec8933e38b2daa9eafad32f53 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Tue, 25 Aug 2020 04:11:56 +0200
Subject: [PATCH 109/422] update

---
 .../python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py             | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
index f32fe825deb0..57e3f08a43b3 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
@@ -1483,6 +1483,7 @@ def defineMenu():
 #        'L1_ALFA_SYST12' : 478,
 #        'L1_ALFA_SYST17' : 479,
 #        'L1_ALFA_SYST18' : 480,
+#        'L1_ALFA_ANY' : 481,
 #        'L1_ALFA_ANY_EMPTY' : 482,
 #        'L1_ALFA_ANY_FIRSTEMPTY' : 483,
 #        'L1_ALFA_ANY_UNPAIRED_ISO' : 484,
@@ -1491,8 +1492,7 @@ def defineMenu():
 #        'L1_ALFA_ANY_ABORTGAPNOTCALIB' : 487,
 #        'L1_ALFA_ANY_CALIB' : 488,
          'L1_ALFA_B7L1U' : 489,
-         # 'L1_ALFA_B7L1L' : 490,
-         'L1_ALFA_ANY'   : 490,
+         'L1_ALFA_ANY' : 490,
          'L1_ALFA_A7L1U' : 491,
          'L1_ALFA_A7L1L' : 492,
          'L1_ALFA_A7R1U' : 493,
-- 
GitLab


From deb7c2e6508421aa15c657e672a93fac47f48ef6 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Tue, 25 Aug 2020 04:18:59 +0200
Subject: [PATCH 110/422] fixed merge

---
 .../LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py    | 1459 ++++++-----------
 1 file changed, 470 insertions(+), 989 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
index 57e3f08a43b3..b7241c319298 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 def defineMenu():
     """
@@ -38,14 +38,13 @@ def defineMenu():
         # SLOT 7 / CON 0,1 (EM1,2)
         #-------------------------
         
+ 
         # 16 x EM
         'EM3', 'EM7', 'EM8VH',
-        'EM8I',
-        'EM10VH', 'EM12', 'EM13VH', 'EM15', 'EM15VH',
-        'EM15HI',
-        'EM18VH', 'EM20VH', 'EM20VHI', 'EM22VHI', 'EM24VHI', 'EM26VHI', 
-
-        # 1 x ZB
+        'EM10VH', 'EM12', 'EM15', 'EM15VH',
+        'EM15VHI',
+        'EM18VHI', 'EM20VH', 'EM20VHI', 'EM22VH', 'EM22VHI', 'EM24VHI', 'EM24VHIM', 'EM30VHI', 
+        # 1 x ZB/
         'ZB_EM15',
 
         #--------------------------
@@ -53,7 +52,8 @@ def defineMenu():
         #--------------------------
 
         # 16 x TAU
-        'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA12IT', 'HA15', 'HA20', 'HA20IL',  'HA20IM', 'HA20IT', 'HA25', 'HA25IT', 'HA30', 'HA40', 'HA60', 'HA100', 
+        'HA5', 'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA15', 'HA20', 'HA20IL', 'HA20IM', 'HA25', 'HA25IM', 'HA30', 'HA40', 'HA60', 'HA90', 'HA100',
+ 
 
         #----------------------
         # SLOT 8 / CON 0 (JET1)
@@ -61,9 +61,11 @@ def defineMenu():
         # 10 x 3-bit JET (can have multiplicity 4 or more)
 
         # 8 x JETs and central jets
-        'J12', 'J15', 'J15.0ETA25','J20', 'J25','J25.0ETA23','J30', 'J40',
-        
-        # 2 x VBF
+        'J12', 'J12.0ETA23', 'J15', 'J15.0ETA25','J20', 'J25','J25.0ETA23','J30',
+        # 2 x Central Jets
+         'J12.0ETA28', #'J12.0ETA25',
+
+        # VBF Jets
         'J20.0ETA49', 'J30.0ETA49',
 
 
@@ -73,37 +75,33 @@ def defineMenu():
         # 15 x 2-bit JET (can have maximum multiplicity of 3) (SLOT 8, CON 1)
 
         # 3 x Central Jet
-        'J35.0ETA23','J40.0ETA25', 'J20.28ETA31',
+        'J35.0ETA23','J40.0ETA25', #'J20.28ETA31',
+
+        # 6 Jets # replace J400 with J45.0ETA20 - ATR-19309
+        'J40', 'J50', 'J75', 'J85', 'J100', 'J45.0ETA20',  'J400', #'J120',
 
-        # 6 Jets
-        'J50', 'J75', 'J85', 'J100', 'J120', 'J400',
 
         # 6 x FJ              
-        'J15.31ETA49', 'J20.31ETA49', 'J30.31ETA49', 'J50.31ETA49', 'J75.31ETA49', 'J100.31ETA49', 
+        'J15.31ETA49', 'J20.31ETA49', 'J30.31ETA49', 'J50.31ETA49', 'J75.31ETA49', 
+ 
 
 
         #---------------------
-        # SLOT 8 / CON 2 (EN1)
+        # SLOT 8 / CON 2 (EN1) 
         #---------------------
         # 24 x 1-bit thresholds
-        
-        # 8 x TE
-        #'TE3', 'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40',
-        #'TE5', 'TE30', 'TE40', 'TE45', 'TE50', 'TE55', 'TE60', 'TE65',
-        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE70',
 
+        # 8 x TE
+        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE50',
+    
         # 8 x XE (for standard XE)
-        #'XE35', 'XE40', 'XE45', 'XE50', 'XE55', 'XE60', 'XE70', 'XE80',
-        # 8 x XE (for restricted ETA XE: check ATR-13234 for any further change)
-        #'XE10', 'XE20', 'XE25', 'XE30', 'XE65', 'XE75', 'XE150', 'XE300',
-
         'XE10', 'XE20', 'XE25', 'XE30', 'XE35', 'XE40', 'XE45', 'XE50',
         'XE55', 'XE60', 'XE65', 'XE70', 'XE75', 'XE80', 'XE150', 'XE300',
         
         # 8 x XS
         'XS20', 'XS30', 'XS40', 'XS45', 'XS50', 'XS55', 'XS60', 'XS65', 
 
-
+ 
         #---------------------
         # SLOT 8 / CON 3 (EN2)
         #---------------------
@@ -113,18 +111,18 @@ def defineMenu():
         #'RXE35', 'RXE40', 'RXE45', 'RXE50', 'RXE55', 'RXE60', 'RXE70', 'RXE80', # FTHR
 
         # 8 x restricted eta range
-        #'TE3.0ETA24', 'TE5.0ETA24','TE10.0ETA24', 'TE15.0ETA24', 'TE20.0ETA24', 'TE25.0ETA24', 'TE30.0ETA24', 'TE40.0ETA24',
-        #'TE5.0ETA24', 'TE30.0ETA24','TE40.0ETA24', 'TE45.0ETA24', 'TE50.0ETA24', 'TE55.0ETA24', 'TE60.0ETA24', 'TE65.0ETA24',
-        'TE5.0ETA24', 'TE10.0ETA24', 'TE15.0ETA24', 'TE20.0ETA24', 'TE25.0ETA24', 'TE30.0ETA24', 'TE40.0ETA24', 'TE70.0ETA24',
+        #'TE5.24ETA49', 'TE10.24ETA49', 'TE15.24ETA49', 'TE20.24ETA49', 'TE25.24ETA49', 'TE30.24ETA49', 'TE40.24ETA49', 'TE70.24ETA49',
+
+
 
         #------------------------
-        # SLOT 9 / CON 0 (MUCTPi)
+        # SLOT 9 / CON 0 (MUCTPi) 
         #------------------------
         
         # 6 x MU
-        'MU4', 'MU6', 'MU10', 'MU11', 'MU15', 'MU20',
-
+        'MU4', 'MU6', 'MU10', 'MU11', 'MU20', 'MU21',
 
+        
         #------------------------
         # SLOT 9 / CON 1 (CTPCal)
         #------------------------
@@ -153,6 +151,8 @@ def defineMenu():
         # 3 x CALREQ
         'CAL0','CAL1','CAL2',
 
+ 
+
         #-----------------------------
         # SLOT 9 / CON 2,3 (NIM1,NIM2)
         #-----------------------------
@@ -160,11 +160,13 @@ def defineMenu():
         # 2 x MBTS
         'MBTS_A', 'MBTS_C',
 
-        # 24 x MBTSSI (all FTHR)
-        'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4'  , 'MBTS_A5', 'MBTS_A6', 'MBTS_A7', 
-        'MBTS_A8', 'MBTS_A10', 'MBTS_A12' , 'MBTS_A14',
-        'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4'  , 'MBTS_C5', 'MBTS_C6', 'MBTS_C7', 
-        'MBTS_C8', 'MBTS_C10', 'MBTS_C12' , 'MBTS_C14',
+        # 32 x MBTSSI (all FTHR)
+        # NOTE: THESE ARE OUT OF ORDER FOR A REASON! Do not change!
+        # The order defines the mapping - see ATR-17870.
+        'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4', 'MBTS_A5', 'MBTS_A6', 'MBTS_A7',
+        'MBTS_A8', 'MBTS_A10', 'MBTS_A12', 'MBTS_A14', 'MBTS_A9', 'MBTS_A11','MBTS_A13', 'MBTS_A15',
+        'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4', 'MBTS_C5', 'MBTS_C6', 'MBTS_C7',
+        'MBTS_C8', 'MBTS_C10', 'MBTS_C12', 'MBTS_C14', 'MBTS_C11', 'MBTS_C13','MBTS_C9','MBTS_C15',
 
         # L1A for CTP monitoring itself
         'NIML1A',
@@ -182,394 +184,317 @@ def defineMenu():
         'NIMTRT',
 
         # AFP
-        'AFP_NSC', 'AFP_FSC',
+        'AFP_NSC', 'AFP_NSA',
+        #'AFP_FSA_SIT', 'AFP_FSA_TOF', 'AFP_FSA_LOG',
+        #'AFP_FSC_SIT', 'AFP_FSC_LOG', 'AFP_FSC_TOF',
 
+        
         #-------------------------------------------------------------------
         #L1 TOPO inputs 
         #-------------------------------------------------------------------
-        
+
+        #B-jets
+        #'BTAG-MU4J15',
+        #'BTAG-MU6J20',
+
         #HT
-        'HT190-AJ15all.ETA21',
         'HT190-J15s5.ETA21',
-        'HT150-AJ20all.ETA31',
         'HT150-J20s5.ETA31',
 
         
 
         #ZH 
-        '10MINDPHI-AJ20s2-XE50', '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', '10MINDPHI-J20ab-XE50', '10MINDPHI-CJ20ab-XE50', 
+        '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', 
+
         #Jpsi T&P
-        '1INVM5-EMs1-EMs6', '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',        
-
-        #W T&P
-        '05MINDPHI-AJj10s6-XE0',
-        '10MINDPHI-AJj10s6-XE0',
-        '15MINDPHI-AJj10s6-XE0',
-        '05MINDPHI-EM12s6-XE0',
-        '15MINDPHI-EM12s6-XE0',
-        '05MINDPHI-EM15s6-XE0',
-        '15MINDPHI-EM15s6-XE0',
-        '05RATIO-XE0-HT0-AJj15all.ETA49',
-        '90RATIO2-XE0-HT0-AJj15all.ETA49',
-        '250RATIO2-XE0-HT0-AJj15all.ETA49',
-        'HT20-AJj15all.ETA49',
-        'NOT-02MATCH-EM10s1-AJj15all.ETA49',
-        '25MT-EM12s6-XE0',
-        '35MT-EM12s6-XE0',
-        '35MT-EM15s6-XE0',
-        #'10MINDPHI-AJj15s2-XE0',
-        #'20MINDPHI-AJjs6-XE0',
-        #'20MINDPHI-AJj15s2-XE0',
-        #'10MINDPHI-EM6s1-XE0',
-        #'20MINDPHI-EM9s6-XE0',
-        #'20MINDPHI-EM6s1-XE0',
-        #'05RATIO-XE0-HT0-AJj15all.ETA49',
-        #'08RATIO-XE0-HT0-AJj0all.ETA49',
-        #'40RATIO2-XE0-HT0-AJj15all.ETA49',
-        #'90RATIO2-XE0-HT0-AJj0all.ETA49',
-        #'HT20-AJj0all.ETA49',
-        #'NOT-02MATCH-EM9s1-AJj15all.ETA49',
-        #'05RATIO-XE0-SUM0-EM9s1-HT0-AJj15all.ETA49',
-        #'20MT-EM6s6-XE0',
-        #'30MT-EM6s6-XE0',
-        #'40MT-EM6s6-XE0',
+         '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',        
+
+        #W T&P - all were commented out
+ 
         
         # central muon
         'MULT-CMU4ab',
         'MULT-CMU6ab',
         
-        #B-jet
-        '0DR04-MU4ab-CJ15ab', '0DR04-MU4ab-CJ20ab', '0DR04-MU4ab-CJ30ab', '0DR04-MU6ab-CJ20ab', '0DR04-MU6ab-CJ25ab',
+
         #B-physics
-#SX        '2DR15-2MU4ab', 
-#SX        '2INVM999-2MU4ab', 
-#SX        '4INVM8-2MU4ab',
-        '2DR15-2MU6ab', 
-#SX        '2INVM999-2MU6ab', 
-#SX        '4INVM8-2MU6ab',
+        '0DR03-EM7ab-CJ15ab',
+ 
 
         # L1 thresholds for L1Topo streamers
-#SX        '2INVM999-CMU4ab-MU4ab',
-#SX        '2INVM999-2CMU4ab',
-#SX        '2INVM999-MU6ab-MU4ab',
-#SX        '2INVM999-ONEBARREL-MU6ab-MU4ab',
-#SX        '2INVM999-CMU6ab-CMU4ab',
-#SX        '4INVM8-CMU4ab-MU4ab',
-#SX        '4INVM8-2CMU4ab',
-#SX        '4INVM8-MU6ab-MU4ab',
-#SX        '4INVM8-ONEBARREL-MU6ab-MU4ab',
-#SX        '4INVM8-CMU6ab-CMU4ab',        
-        '2DR99-2MU4ab',
+        #'2DR99_2MU4ab',
         '5DETA99-5DPHI99-MU6ab-MU4ab',
         '5DETA99-5DPHI99-2MU6ab',
-        '0DR10-MU10ab-MU6ab',
         '0DR15-2MU6ab',
-#        '0DETA04-0DPHI03-EM8abi-MU10ab',
         '0DETA04-EM8abi-MU10ab',
         '0DPHI03-EM8abi-MU10ab',
-#        '0DETA04-0DPHI03-EM15abi-MUab',
         '0DETA04-EM15abi-MUab',
         '0DPHI03-EM15abi-MUab',
-        '10MINDPHI-AJ20s2-XE50',
-        '10MINDPHI-J20s2-XE50',
-        '10MINDPHI-J20ab-XE50',
-        '10MINDPHI-CJ20ab-XE50',
-        '900INVM9999-AJ30s6-AJ20s6',
-        '800INVM9999-AJ30s6-AJ20s6',
+        #'800INVM9999-AJ30s6-AJ20s6',
         '700INVM9999-AJ30s6-AJ20s6',
-        '500INVM9999-AJ30s6-AJ20s6',
-        '400INVM9999-AJ30s6-AJ20s6',
-        #'350INVM9999-AJ30s6-AJ20s6',
         '300INVM9999-AJ30s6-AJ20s6',
-        '200INVM9999-AJ30s6-AJ20s6',
-        '100INVM9999-AJ30s6-AJ20s6',
-        #'350INVM9999-J30s6-J20s6',
-        #'300INVM9999-J30s6-J20s6',
-        #'250INVM9999-J30s6-J20s6',
-        #'200INVM9999-J30s6-J20s6',
-        'HT150-AJj15all.ETA49',
-        '0MATCH-4AJ20.ETA31-4AJj15.ETA31',
+        #'400INVM9999-AJ30s6-AJ20s6',
+        '500INVM9999-J30s6-AJ20s6',
+        #'100INVM9999-AJ30s6-AJ20s6',
+        '0DETA20-J50s1-Js2',
+        '27DPHI32-EMs1-EMs6',
+        #'HT150-AJj15all.ETA49',
+        #'0MATCH-4AJ20.ETA31-4AJj15.ETA31',
         '100RATIO-0MATCH-TAU30si2-EMall',
-        'NOT-0MATCH-TAU30si2-EMall',
-        '0DR28-MU10ab-TAU12abi',
-        '1DISAMB-TAU12abi-J25ab',
-        '1DISAMB-EM15his2-TAU12abi-J25ab',
-        'DISAMB-0DR28-EM15his2-TAU12abi',
-        '1DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
-        '1DISAMB-TAU20abi-TAU12abi-J25ab',
+        'NOT-0MATCH-TAU30si1-EMall',
+        #'1DISAMB-TAU12abi-J25ab',
+        #'1DISAMB-EM15his2-TAU12abi-J25ab',
+        '2DISAMB-TAU12abi-J25ab',
+        '2DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
+        #'0DR28-MU10ab-TAU12abi',  # add back if needed
+        #'1DISAMB-TAU20abi-TAU12abi-J25ab',
         '0DR25-TAU20abi-TAU12abi',
         '0DR28-TAU20abi-TAU12abi',
-        '0DETA20-0DPHI20-TAU20abi-TAU12abi',
-        '1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
-        '1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
+        '2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
+        '2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
         'DISAMB-30INVM-EM20his2-TAU12ab',
         '400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49',
-        'LAR-EM50s1',
-        'LAR-J100s1',
-#SX        '2DR15-CMU4ab-MU4ab',
-#SX        '2DR15-2CMU4ab',
-#SX        '2DR15-MU6ab-MU4ab',
-#SX        '2DR15-ONEBARREL-MU6ab-MU4ab',
-#SX        '2DR15-CMU6ab-CMU4ab',
-
-        '2INVM9-2MU6ab',
-        '7INVM15-2MU4ab', 
-        '2INVM8-ONEBARREL-MU6ab-MU4ab', 
-        '0DR24-2CMU4ab', 
-        '0DR22-2MU6ab',
-        '0DR34-2MU4ab', 
-        '0DR24-2MU4ab', 
-        '0DR24-CMU4ab-MU4ab',  
-        '2INVM8-CMU4ab-MU4ab',
-        '0DR15-2MU4ab',  
-        '0DR15-MU6ab-MU4ab',  
-        '0DR22-MU6ab-MU4ab', 
-        '8INVM15-MU6ab-MU4ab',  
-        '8INVM15-2MU6ab', 
-        '2INVM8-2MU4ab',  # ATR-15197 '2INVM9-2MU4ab',
-        '2INVM8-MU6ab-MU4ab', # ATR-15197 '2INVM9-MU6ab-MU4ab',
-        '2INVM9-2MU4ab',
-        '2INVM9-MU6ab-MU4ab',
-        'KF-XE40-AJall',
-        'KF-XE50-AJall',
-        'KF-XE55-AJall',
-        'KF-XE60-AJall',
-        'KF-XE65-AJall',
-        'KF-XE75-AJall',
+
+        '0INVM9-EM7ab-EMab',
+        '400INVM9999-0DPHI20-J30s6-AJ20s6',
+        '400INVM9999-0DPHI22-J30s6-AJ20s6',
+        '400INVM9999-0DPHI24-J30s6-AJ20s6',
+        '400INVM9999-0DPHI26-J30s6-AJ20s6',
 
         'LATE-MU10s1',
         'SC111-CJ15ab.ETA26',
-        'SC85-CJ15ab.ETA26',
+        
         
         # ALFA (the replication is needed to build all the combinations in the CTPCore)
         'ALFA_B7R1L', 'ALFA_B7R1U', 'ALFA_A7R1L', 'ALFA_A7R1U', 'ALFA_A7L1L', 'ALFA_A7L1U', 'ALFA_B7L1L', 'ALFA_B7L1U',
         'ALFA2_B7R1L', 'ALFA2_B7R1U', 'ALFA2_A7R1L', 'ALFA2_A7R1U', 'ALFA2_A7L1L', 'ALFA2_A7L1U', 'ALFA2_B7L1L', 'ALFA2_B7L1U',
         'ALFA3_B7R1L', 'ALFA3_B7R1U', 'ALFA3_A7R1L', 'ALFA3_A7R1U', 'ALFA3_A7L1L', 'ALFA3_A7L1U', 'ALFA3_B7L1L', 'ALFA3_B7L1U',
         'ALFA4_B7R1L', 'ALFA4_B7R1U', 'ALFA4_A7R1L', 'ALFA4_A7R1U', 'ALFA4_A7L1L', 'ALFA4_A7L1U', 'ALFA4_B7L1L', 'ALFA4_B7L1U',
-#ATR-13743        'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
-
+#ATR-13743      
+        'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
+
+        #ATR-19355
+        '0INVM10-3MU4ab',
+
+        #ATR-18815 - Algorithm needs to be moved to master
+#        '0INVM10-0DR15-EM8abi-MU10ab',
+#        '0INVM10-0DR15-EM12abi-MU6ab',
+
+        #ATR-18824
+        '60INVM9999-25DPHI32-EM15abhi-FJj15s623ETA49',
+        '60INVM9999-04DPHI32-EM15abhi-FJj15s623ETA49',
+        #ATR-19302
+        '0INVM70-27DPHI32-EM12his1-EM12his6',
+
+        #ATR-19720
+        #'8INVM15-0DR22-2MU6ab',
+        #'2INVM9-2DR15-2MU6ab',
+        #'2INVM9-0DR15-MU6ab-MU4ab',
+        #'8INVM15-0DR22-MU6ab-MU4ab',
+        #'2INVM9-0DR15-2MU4ab',
+
+        #ATR-19510
+        '5DETA99-5DPHI99-2MU4ab',
+            
+        #ATR-17320
+        'CEP-CJ60s6',
+        'CEP-CJ50s6',
+       
+        #ATR-20174
+        '8INVM15-2CMU4ab'
 
-        ]
+        
+    ]
 
     
     Lvl1Flags.items = [
 
-        
         # single EM
 
         'L1_EM3','L1_EM7','L1_EM12', 'L1_EM8VH',
-#        'L1_EM8I',
-        'L1_EM10VH', 'L1_EM13VH', 'L1_EM15',
-        'L1_EM15I','L1_EM15HI',
-        'L1_EM26VHI','L1_EM15VH', 'L1_EM18VH', 'L1_EM20VH', 'L1_EM20VHI', 'L1_EM22VHI', 'L1_EM24VHI', # see Jira ATR-10334'L1_EM22VHLIL', #'L1_EM50V',
-        'L1_EM3_EMPTY', 'L1_EM7_EMPTY', 'L1_EM7_UNPAIRED_ISO', 'L1_EM7_FIRSTEMPTY','L1_EM7_UNPAIRED_NONISO',
+        'L1_EM10VH', 'L1_EM15',
+        'L1_EM30VHI',
+        'L1_EM15VHI',
+        'L1_EM24VHIM','L1_EM15VH', 'L1_EM18VHI', 'L1_EM20VH', 'L1_EM20VHI', 'L1_EM22VHI', 'L1_EM22VH','L1_EM24VHI', 
+        'L1_EM3_EMPTY', 'L1_EM7_EMPTY', 'L1_EM7_UNPAIRED_ISO', 'L1_EM7_FIRSTEMPTY',
         'L1_EM20VH_FIRSTEMPTY',
-        'L1_EM22VHI_FIRSTEMPTY',
-        #'L1_EM15_BGRP7',
 
-        # see savannah https://savannah.cern.ch/bugs/?103935
 
-        # combined EM -jet
-        #'L1_JJ15.23ETA49', # 4x4 window
+        # combined EM -jet - all commented
 
         # single MU
-        "L1_MU4", "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU15", "L1_MU20",
-
+        "L1_MU4", "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU20", "L1_MU21",
+        
         "L1_MU4_EMPTY", "L1_MU6_EMPTY", "L1_MU4_FIRSTEMPTY", "L1_MU11_EMPTY",
-        'L1_MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_NONISO',
-         'L1_MU20_FIRSTEMPTY',
+        'L1_MU4_UNPAIRED_ISO',
+
 
-        
         
         # multi lepton
-        "L1_2EM3", "L1_2EM7", "L1_2EM10VH", "L1_2EM13VH", "L1_2EM15", "L1_2EM15VH", "L1_EM7_2EM3", "L1_EM12_2EM3", "L1_EM15VH_3EM7", "L1_EM15VH_3EM8VH", "L1_EM15VH_2EM10VH_3EM7",
-        "L1_2EM18VH", "L1_2EM20VH", "L1_EM15VH_3EM10VH", "L1_EM18VH_3EM8VH", "L1_EM18VH_2EM10VH_3EM7", "L1_EM20VH_3EM10VH", "L1_EM20VH_2EM10VH_3EM8VH",
+        "L1_2EM3", "L1_2EM7",
+        "L1_2EM15", "L1_2EM15VH", "L1_2EM15VHI",
+        "L1_2EM20VH",
+        "L1_EM20VH_3EM10VH", 
         "L1_EM7_MU10",
-        "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY", "L1_MU10_2MU6", "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4",
-
-        "L1_EM8I_MU10", "L1_EM15I_MU4", "L1_2EM8VH_MU10", "L1_EM15VH_MU10", 
-
+        "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY",  "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4", "L1_2MU11", "L1_MU11_2MU10",
+        "L1_2EM8VH_MU10", "L1_EM15VH_MU10",  "L1_EM7_MU20", "L1_EM8VH_MU20",
 
         # single tau
-        "L1_TAU12", "L1_TAU12IM",  "L1_TAU20", "L1_TAU20IM",
-        "L1_TAU30","L1_TAU30_EMPTY","L1_TAU30_UNPAIRED_ISO", "L1_TAU40", "L1_TAU60", "L1_TAU100", "L1_TAU8", "L1_TAU8_EMPTY", 
-        "L1_TAU8_UNPAIRED_ISO","L1_TAU8_FIRSTEMPTY","L1_TAU8_UNPAIRED_NONISO",
+        "L1_TAU5", "L1_TAU12", "L1_TAU12IM",   "L1_TAU20IM",
+        "L1_TAU30","L1_TAU30_EMPTY","L1_TAU30_UNPAIRED_ISO", "L1_TAU40", "L1_TAU60", "L1_TAU90", "L1_TAU100", "L1_TAU8_EMPTY", 
+        "L1_TAU8_UNPAIRED_ISO","L1_TAU8_FIRSTEMPTY",
 
         # multi tau
-        "L1_TAU20IM_2TAU12IM", "L1_TAU20_2TAU12", "L1_TAU40_2TAU20IM",
+        "L1_TAU20IM_2TAU12IM",   "L1_TAU60_2TAU40", "L1_2TAU5", "L1_2TAU8",
 
         # combined tau - lepton
-        "L1_EM15HI_2TAU12IM",          
-        "L1_EM15HI_2TAU12IM_J25_3J12",   
-        "L1_EM15HI_TAU40_2TAU15",
+        "L1_EM15VHI_2TAU12IM",          
+        "L1_EM15VHI_2TAU12IM_J25_3J12",   
+        "L1_EM15VHI_2TAU12IM_4J12",
+        "L1_EM15VHI_TAU40_2TAU15",
         "L1_MU10_TAU12IM",  
-        "L1_MU10_TAU12IM_J25_2J12", 
-#        "L1_MU10_TAU12_J25_2J12", 
-#        "L1_MU10_TAU20",
+        "L1_MU10_TAU12IM_J25_2J12",
+        "L1_MU10_TAU12IM_3J12",
+        #'L1_DR-MU10TAU12I_TAU12I-J25',
         "L1_MU10_TAU20IM",
         "L1_MU11_TAU20IM",
         "L1_MU10_TAU20IM_J25_2J20",
 
         # combined tau - jet
-#        "L1_TAU25IT_2TAU12IT_2J25_3J12", 
 
-        "L1_TAU20IM_2TAU12IM_J25_2J20_3J12", 
-        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I',  
-        'L1_DR-MU10TAU12I_TAU12I-J25', 
-        "L1_MU10_TAU12I-J25",
+        "L1_TAU20IM_2TAU12IM_J25_2J20_3J12",
+        "L1_TAU20IM_2TAU12IM_4J12.0ETA23",
+        #"L1_TAU20IM_2TAU12IM_4J12.0ETA25",
+        "L1_TAU20IM_2TAU12IM_4J12.0ETA28",
+        "L1_TAU25IM_2TAU20IM_2J25_3J20", 
+
 
 
         # combined tau - xe
         "L1_TAU20IM_2J20_XE45", 
-#        "L1_TAU20_2J20_XE45", 
-#        "L1_TAU20IM_2J20_XE50",   
+        "L1_TAU20IM_2J20_XE50", 
+
 
         #"L1_EM15HI_2TAU12I_XE35", 
-        "L1_EM15HI_2TAU12IM_XE35", 
-        "L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15",
+        "L1_EM15VHI_2TAU12IM_XE35", 
         'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20',
 
 
         "L1_MU10_TAU12IM_XE35",  
-#        "L1_MU10_TAU12IM_XE40",  
 
         "L1_TAU20IM_2TAU12IM_XE35", 
-        "L1_TAU20_2TAU12_XE35",
         "L1_TAU40_2TAU12IM_XE40",  
 
 
 
         # combined em - jet
-        #'L1_EM15VH_J15.23ETA49',
-#        'L1_EM15VH_JJ15.23ETA49',
-        'L1_EM13VH_3J20',
-        'L1_EM18VH_3J20',
+        'L1_EM18VHI_3J20',
+        'L1_EM20VH_3J20',
+
+        
 
         # combined mu - jet
-        'L1_MU4_J12',  'L1_MU4_J50_XE40', 'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
-#ATR-13743        'L1_MU4_J30',
-        #'L1_MU4_J50',
+        'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
         'L1_MU10_2J20','L1_MU10_3J20', 'L1_MU10_2J15_J20',
-        'L1_2MU4_J40_XE20',
         'L1_MU20_J40',
         'L1_MU20_XE30',
+        'L1_MU20_J50',
 
         # single jet
-        "L1_J12","L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100", "L1_J120", "L1_J400",
-        "L1_J20.31ETA49", "L1_J30.31ETA49", "L1_J50.31ETA49", "L1_J75.31ETA49", "L1_J100.31ETA49",
-        #'L1_J15.23ETA49',
-         'L1_J15.31ETA49',
-        "L1_J20.28ETA31",
-        #'L1_J40.0ETA25', 
+        "L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100",  "L1_J400", #"L1_J120",
+        "L1_J20.31ETA49", "L1_J30.31ETA49", "L1_J50.31ETA49", "L1_J75.31ETA49", 
+        'L1_J15.31ETA49',
         "L1_J12_EMPTY","L1_J12_FIRSTEMPTY", "L1_J12_UNPAIRED_ISO", "L1_J12_UNPAIRED_NONISO", "L1_J12_ABORTGAPNOTCALIB", 
         "L1_J15.31ETA49_UNPAIRED_ISO",
         "L1_J30_EMPTY", "L1_J30_FIRSTEMPTY", "L1_J30.31ETA49_EMPTY", "L1_J30.31ETA49_UNPAIRED_ISO",
         "L1_J30.31ETA49_UNPAIRED_NONISO",
         "L1_J50_UNPAIRED_ISO", "L1_J50_UNPAIRED_NONISO", "L1_J50_ABORTGAPNOTCALIB",         
-        "L1_J12_BGRP12", "L1_J30.31ETA49_BGRP12",
         'L1_J100_FIRSTEMPTY',
-        'L1_J100.31ETA49_FIRSTEMPTY',
+ 
         
         # multi jet
-
-        "L1_J20_J20.31ETA49",
-        "L1_3J15", "L1_3J20","L1_3J40", 'L1_3J15.0ETA25', "L1_3J50", "L1_4J15", "L1_4J20",
-        "L1_4J20.0ETA49",
+        "L1_J45.0ETA20_3J15.0ETA25",
+        "L1_J50_2J40.0ETA25_3J15.0ETA25",
+        "L1_3J50", "L1_4J15", "L1_4J20", #"L1_4J20.0ETA49",
         "L1_3J15.0ETA25_XE40",
         
-        #"L1_3J75",
-        #"L1_4J30",
         "L1_6J15",
-        "L1_J75_3J20",
         "L1_J85_3J30",
-        "L1_J30.0ETA49_2J20.0ETA49",
-
-        "L1_J15.0ETA25_2J15.31ETA49",
+       # multi jet forward
+        "L1_J25.0ETA23_2J15.31ETA49",
         "L1_J40.0ETA25_2J15.31ETA49",
         "L1_J40.0ETA25_2J25_J20.31ETA49",
-        "L1_J40.0ETA25_2J30_J20.31ETA49",
+        "L1_J30.0ETA49_2J20.0ETA49",
         
         # multi jet central
         "L1_3J25.0ETA23",
         "L1_3J35.0ETA23",
         "L1_4J15.0ETA25",
         "L1_5J15.0ETA25", 
-        
         # combined jet
-        "L1_2J15_XE55", "L1_J40_XE50", "L1_J75_XE50",
+        "L1_2J15_XE55", "L1_J40_XE50",
 
         #'L1_2J40_XE45',
-        "L1_2J50_XE40", "L1_J40_XE60","L1_J40.0ETA25_XE50",
+        "L1_2J50_XE40", "L1_J40_XE60",
+        
 
         # XE
         "L1_XE35", "L1_XE40", "L1_XE45", "L1_XE50", 
         "L1_XE55", "L1_XE60", "L1_XE70", "L1_XE80",
-        'L1_XE10', 'L1_XE30', 'L1_XE65', 'L1_XE75', 'L1_XE150', 'L1_XE300',
+        'L1_XE30', 'L1_XE300',
+        "L1_XE10",
         
         #XS
-        'L1_XS20', 'L1_XS30',
         'L1_EM12_XS20', 'L1_EM15_XS30',
         
         # TE
-        #"L1_TE3",        "L1_TE5",        "L1_TE10",        "L1_TE15",        "L1_TE20",        "L1_TE25",        "L1_TE30",        "L1_TE40",
-        #"L1_TE5",        "L1_TE30",        "L1_TE40",        "L1_TE45",        "L1_TE50",        "L1_TE55",        "L1_TE60",        "L1_TE65",
-        "L1_TE5",        "L1_TE10",        "L1_TE15",   "L1_TE20",  "L1_TE25",  "L1_TE30",        "L1_TE40",      "L1_TE70",      
+#        'L1_TE5', ## disabled?
 
-        #"L1_TE3.0ETA24", "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", 
-        #"L1_TE5.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", "L1_TE45.0ETA24", "L1_TE50.0ETA24", "L1_TE55.0ETA24", "L1_TE60.0ETA24", "L1_TE65.0ETA24", 
-        "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24","L1_TE70.0ETA24",
+        #VTE + MBTS
+        #"L1_MBTS_1_VTE2", "L1_MBTS_1_VTE3", "L1_MBTS_1_VTE4", "L1_MBTS_1_VTE5", "L1_MBTS_1_VTE10", "L1_MBTS_2_VTE2", "L1_MBTS_2_VTE3", "L1_MBTS_2_VTE4", "L1_MBTS_2_VTE5", "L1_MBTS_2_VTE10", 
+        
+        #TE + MU
 
         # MBTS
-        "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
-        "L1_MBTS_1_EMPTY", "L1_MBTS_1_UNPAIRED_ISO", 
-        "L1_MBTS_2_EMPTY", "L1_MBTS_2_UNPAIRED_ISO",
-        "L1_MBTS_1_1_EMPTY", "L1_MBTS_1_1_UNPAIRED_ISO","L1_MBTS_4_A_UNPAIRED_ISO","L1_MBTS_4_C_UNPAIRED_ISO",
-#        'L1_MBTSA0' ,'L1_MBTSA1' ,'L1_MBTSA2' ,'L1_MBTSA3' ,'L1_MBTSA4' ,
-#        'L1_MBTSA5' ,'L1_MBTSA6' ,'L1_MBTSA7' ,'L1_MBTSA8' ,
-#        'L1_MBTSA10','L1_MBTSA12','L1_MBTSA14',
-#        'L1_MBTSC0' ,'L1_MBTSC1' ,'L1_MBTSC2' ,'L1_MBTSC3' ,'L1_MBTSC4' ,
-#        'L1_MBTSC5' ,'L1_MBTSC6' ,'L1_MBTSC7' ,'L1_MBTSC8' ,
-#        'L1_MBTSC10','L1_MBTSC12','L1_MBTSC14',
         # beam splashes
-        "L1_MBTS_4_A", "L1_MBTS_4_C",
+        
+        #Overlay
+#        "L1_MBTS_1_OVERLAY","L1_TE20_OVERLAY",
+        
+        #BeamSpot
+#        "L1_MBTS_1_VTE70",
 
         #BGRP9
-        'L1_MBTS_1_BGRP9','L1_MBTS_2_BGRP9',
 
         #BGRP11
-        'L1_MBTS_1_BGRP11','L1_MBTS_2_BGRP11',
 
         # RNDM
-        'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO','L1_RD0_EMPTY',
-        "L1_RD1_FILLED","L1_RD1_EMPTY","L1_RD1_BGRP10",
-        "L1_RD2_FILLED","L1_RD2_EMPTY","L1_RD2_BGRP12",
-        "L1_RD3_FILLED","L1_RD3_EMPTY",
-        'L1_RD0_FIRSTEMPTY', 
-        'L1_RD0_BGRP9', 'L1_RD0_BGRP11', 'L1_RD0_ABORTGAPNOTCALIB',
+        'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO',  'L1_RD0_EMPTY',
+        "L1_RD1_EMPTY","L1_RD2_EMPTY",
+#        'L1_RD0_FIRSTEMPTY', 
+        'L1_RD0_ABORTGAPNOTCALIB',
+#        'L1_RD2_FILLED', # This is not needed?
 
         #LUCID
-        'L1_LUCID', 'L1_LUCID_EMPTY', 'L1_LUCID_UNPAIRED_ISO', 
-        'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
+#        'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
         #'L1_LUCID_COMM_EMPTY', 'L1_LUCID_COMM_UNPAIRED_ISO', 
 
+        
+
         # ZDC
-        'L1_ZDC_A', 'L1_ZDC_C', 'L1_ZDC_A_C',
-        'L1_ZDC_AND', # FTHR
+         # FTHR
 
         # VDM
-        'L1_BGRP9', #"L1_BGRP7",
+         #"L1_BGRP7",
 
         # TRT
         # "L1_TRT",
-        "L1_TRT_FILLED",
-        "L1_TRT_EMPTY",
 
         # TGC
         "L1_TGC_BURST",
 #        "L1_TGC_BURST_EMPTY",
 
         # LHCF
-        "L1_LHCF", "L1_LHCF_UNPAIRED_ISO", "L1_LHCF_EMPTY",
     
         #CALREQ
         "L1_CALREQ2",
@@ -578,244 +503,124 @@ def defineMenu():
         "L1_ZB",
 
         # BPTX
-        "L1_BPTX0_BGRP0", "L1_BPTX1_BGRP0",
         
         # BCM
-        'L1_BCM_Wide_BGRP0','L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO', 'L1_BCM_AC_CA_UNPAIRED_ISO',
+         #'L1_BCM_AC_CA_UNPAIRED_ISO',
+        'L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO',
         'L1_BCM_AC_UNPAIRED_ISO','L1_BCM_CA_UNPAIRED_ISO',
         'L1_BCM_AC_UNPAIRED_NONISO','L1_BCM_CA_UNPAIRED_NONISO',
         'L1_BCM_AC_ABORTGAPNOTCALIB', 'L1_BCM_CA_ABORTGAPNOTCALIB','L1_BCM_Wide_ABORTGAPNOTCALIB',
         'L1_BCM_AC_CALIB', 'L1_BCM_CA_CALIB','L1_BCM_Wide_CALIB',
 
         #AFP
-        'L1_AFP_NSC', 'L1_AFP_FSC', 
-        'L1_AFP_C_ANY', 'L1_AFP_C_ANY_UNPAIRED_ISO', 'L1_AFP_C_ANY_UNPAIRED_NONISO', 'L1_AFP_C_ANY_EMPTY', 'L1_AFP_C_ANY_FIRSTEMPTY', 'L1_AFP_C_AND',
+#         'L1_AFP_FSC', 
+#        'L1_AFP_C_ANY', 'L1_AFP_C_ANY_UNPAIRED_ISO', 'L1_AFP_C_ANY_UNPAIRED_NONISO', 'L1_AFP_C_ANY_EMPTY', 'L1_AFP_C_ANY_FIRSTEMPTY', 'L1_AFP_C_AND',
 
-        #--------------------------------
+#	'L1_EM7_AFP_A_AND_C','L1_EM12_AFP_A_AND_C',
+
+
+          #--------------------------------
         # TOPO items
         #--------------------------------
 
         # B-jet
-        'L1_BTAG-MU4J15', 'L1_BTAG-MU4J30', 'L1_BTAG-MU6J20', 'L1_BTAG-MU6J25',
-        #'L1_BTAG-MU4J20',
-        'L1_3J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J30', 'L1_3J15_BTAG-MU6J25', 'L1_3J20_BTAG-MU4J20',
-        #'L1_3J20_BTAG-MU4J30', 'L1_3J20_BTAG-MU6J25',
-
-        # ZH
-        'L1_DPHI-AJ20s2XE50', 'L1_J40_DPHI-J20s2XE50', 'L1_J40_DPHI-J20XE50', 'L1_J40_DPHI-CJ20XE50', #'L1_J40_DPHI-J20s2XE30',
-#SX        'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B',
-#SX        'L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B',
-#SX        'L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO',
-#SX        'L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO',
+        #'L1_BTAG-MU4J15',
+        #'L1_BTAG-MU6J20',
+
+        # ZH - all removed
+   
+
+        #Higgsino
+        'L1_2MU4_J40_XE50',
+        'L1_MU4_J30_XE40_DPHI-J20s2XE30','L1_MU4_J50_XE50_DPHI-J20s2XE30',
+        'L1_MU4_XE60',
 
         # HT
-        'L1_HT190-J15.ETA21',
         'L1_HT190-J15s5.ETA21',
-        'L1_HT150-J20.ETA31',
-        'L1_HT150-J20s5.ETA31',   
 
-        "L1_HT150-J20s5.ETA31_MJJ-400",
         "L1_HT150-J20s5.ETA31_MJJ-400-CF",
         
         # Jpsi T&P
-        'L1_JPSI-1M5', 'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
-        'L1_KF-XE40', 'L1_KF-XE50', 'L1_KF-XE55', 'L1_KF-XE60', 'L1_KF-XE65', 'L1_KF-XE75',
+        'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
+#            
         
-        # W T&P
-#        'L1_W-05DPHI-JXE-0',
-#        'L1_W-10DPHI-JXE-0',
-#        'L1_W-15DPHI-JXE-0',
-#        'L1_W-05DPHI-EMXE-1',
-        #'L1_W-15DPHI-EMXE-1',
-#        'L1_W-05DPHI-EM15XE-1',
-        #'L1_W-15DPHI-EM15XE-1',
-        'L1_W-05RO-XEHT-0',
-        'L1_W-90RO2-XEHT-0',
-        'L1_W-250RO2-XEHT-0',
-        'L1_W-HT20-JJ15.ETA49',
-        'L1_W-NOMATCH',
-        #'L1_W-NOMATCH_W-05RO-XEEMHT',
-        'L1_EM12_W-MT25',
-#        'L1_EM12_W-MT35',
-        'L1_EM15_W-MT35',
-        'L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE',
-        'L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE',
-        'L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE',
-        'L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE',
-        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
-        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM12_W-MT35_XS50',
-        'L1_EM15_W-MT35_XS60',
-        'L1_EM10VH_W-MT35_XS50',
-        'L1_EM15VH_W-MT35_XS60',
-        'L1_EM20VH_W-MT35_XS60',
-        'L1_EM22VHI_W-MT35_XS40',
-        # Old
-        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0',
-        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
-        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE',
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        #'L1_W-10DPHI-JXE-0',
-        #'L1_W-20DPHI-JXE-1',
-        #'L1_W-20DPHI-JXE-0',
-        #'L1_W-20DPHI-EMXE-1',
-        #'L1_W-20DPHI-EMXE-0',
-        #'L1_W-05RO-XEHT-0',
-        #'L1_W-08RO-XEHT-1',
-        #'L1_W-40RO2-XEHT-0',
-        #'L1_W-90RO2-XEHT-1',
-        #'L1_W-HT20-JJ0.ETA49',
-        #'L1_W-NOMATCH',
-        #'L1_W-NOMATCH_W-05RO-XEEMHT',
-        #'L1_EM3_W-MT20',
-        #'L1_EM3_W-MT40',
-
-        #Bphysics items
-#SX        'L1_BPH-DR-2MU4', 
-#SX        'L1_BPH-2M-2MU4', 
-#SX        'L1_BPH-4M8-2MU4',
-#SX        'L1_BPH-DR-2MU4_BPH-2M-2MU4', 'L1_BPH-DR-2MU4_BPH-4M8-2MU4',
-
-#SX        'L1_BPH-DR-2MU6', 
-#SX        'L1_BPH-2M-2MU6', 'L1_BPH-4M8-2MU6',
-#SX        'L1_BPH-DR-2MU6_BPH-2M-2MU6', 'L1_BPH-DR-2MU6_BPH-4M8-2MU6',
-
-        # temporarily commented out until CTP Simulation is fixed (menu generation and TMC understand multiplicity topo)
-#SX uncommenting
-        'L1_2MU4-BO',
-        'L1_2MU6-BO',
-        'L1_MU6MU4-BO', 
-
-        # L1 items for L1Topo streamers
-#SX        'L1_BPH-2M-2MU4-B',
-#SX        'L1_BPH-2M-2MU4-BO',
-#SX        'L1_BPH-2M-MU6MU4',
-#SX        'L1_BPH-2M-MU6MU4-B',
-#SX        'L1_BPH-2M-MU6MU4-BO',    
-#SX        'L1_BPH-4M8-2MU4-B',
-#SX        'L1_BPH-4M8-2MU4-BO',
-#SX        'L1_BPH-4M8-MU6MU4',
-#SX        'L1_BPH-4M8-MU6MU4-B',        
-#SX        'L1_BPH-4M8-MU6MU4-BO',
-        'L1_DY-DR-2MU4',
-        'L1_EM15VH_2EM8VH_MU6',
-        #'L1_DY-BOX-MU6MU4',
-        'L1_DY-BOX-2MU6',
-        'L1_LFV-MU',
+        # W T&P - all removed
+
         'L1_LFV-MU6',
+        'L1_LFV-MU11',
         'L1_LFV-EM8I',
         'L1_LFV-EM15I',
-        'L1_EM7_MU15',
-        'L1_EM8VH_MU15',
         'L1_DPHI-J20s2XE50',
         'L1_J40_XE50_DPHI-J20s2XE50',
-        'L1_DPHI-J20XE50',
-        'L1_DPHI-CJ20XE50',
-        'L1_MU4_J20_XE30_DPHI-J20s2XE30',
         'L1_2MU4_J20_XE30_DPHI-J20s2XE30',
-        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30',
-        'L1_3EM3_J40_XE50_DPHI-J20s2XE50',
-        'L1_MJJ-900',
-        'L1_MJJ-800',
         'L1_MJJ-700',
-        'L1_MJJ-400',
-        #'L1_MJJ-350',
-#        'L1_MJJ-300',
-#        'L1_MJJ-200',
-        'L1_MJJ-100',
-        'L1_HT150-JJ15.ETA49',
-        'L1_HT150-JJ15.ETA49_MJJ-400',
-        'L1_J4-MATCH',
+        'L1_MJJ-300',
+        #'L1_MJJ-100',
+        #'L1_MJJ-400',
+        #'L1_MJJ-800',
+        'L1_MJJ-500-NFF',
+        'L1_J50_DETA20-J50J',
+        'L1_DPHI-2EM3',
+        #'L1_HT150-JJ15.ETA49',
+        #'L1_HT150-JJ15.ETA49_MJJ-400',
+        #'L1_J4-MATCH',
         'L1_LLP-RO',
-        'L1_LLP-NOMATCH',
-        'L1_DR-MU10TAU12I',    
-#        'L1_TAU12I-J25',    
-        'L1_EM15TAU12I-J25',
-        'L1_DR-EM15TAU12I',    
-        'L1_DR-EM15TAU12I-J25',    
-        'L1_TAU20ITAU12I-J25',
+        #'L1_LLP-NOMATCH',
+        #'L1_EM15TAU12I-J25',
+        'L1_DR-EM15TAU12I-J25',
+        #'L1_TAU20ITAU12I-J25',
         'L1_DR-TAU20ITAU12I',    
-        'L1_BOX-TAU20ITAU12I',
         'L1_DR-TAU20ITAU12I-J25',
+        #'L1_DR-MU10TAU12I',
 
-        'L1_DR25-TAU20ITAU12I',
-        'L1_DR25-TAU20ITAU12I-J25',
         'L1_30M-EM20ITAU12',
         'L1_MJJ-400-CF',
     
-        'L1_LAR-EM',
-        'L1_LAR-J',
-#SX        'L1_BPH-DR-2MU4-B',
-#SX        'L1_BPH-DR-2MU4-BO',
-#SX        'L1_BPH-DR-MU6MU4',
-#SX        'L1_BPH-DR-MU6MU4-B',
-#SX        'L1_BPH-DR-MU6MU4-BO',
-
-#new bhysics
-        #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4',
-        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
-        'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4',
-        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4', # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
-        'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
-        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',
-        'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',
-        'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',
-        'L1_2MU4-B',
-        'L1_2MU6-B' ,
-        #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4',
-        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4' ,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B' ,
-        #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4' ,
-        #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4' ,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO' ,
-        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
-        'L1_MU6_2MU4-B',
-
-        'L1_BPH-2M8-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4',
-        'L1_BPH-8M15-MU6MU4',
-        'L1_BPH-8M15-2MU6',
-        
+        #'L1_LAR-EM',
+        #'L1_LAR-J',
+        #'L1_LAR-ZEE',
+        #'L1_LAR-ZEE_LAR-EM',
+        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
+        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
+        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',
+        #'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO',
+
+        #ATR-19720 - no algorithm in master
+#        'L1_BPH-8M15-0DR22-2MU6',
+#        'L1_BPH-2M9-2DR15-2MU6',
+#        'L1_BPH-2M9-0DR15-MU6MU4',
+#        'L1_BPH-8M15-0DR22-MU6MU4-BO',
+#        'L1_BPH-2M9-0DR15-2MU4',
+#
+#        'L1_BPH-0M9-EM7-EM5',        
+#        'L1_BPH-0DR3-EM7J15',
+#        'L1_BPH-0M9-EM7-EM5_MU6',
+#        'L1_BPH-0DR3-EM7J15_MU6',
+#        'L1_BPH-0M9-EM7-EM5_2MU4',
+#        'L1_BPH-0DR3-EM7J15_2MU4',
+#
         # combined L1Topo for VBF
-        'L1_MU6_MJJ-200',
-        'L1_MU6_MJJ-300',
-        'L1_MU6_MJJ-400',
-        'L1_MU6_MJJ-500',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-400',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-700',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-800',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-900',
-        'L1_3J20_4J20.0ETA49_MJJ-400',
-        'L1_3J20_4J20.0ETA49_MJJ-700',
-        'L1_3J20_4J20.0ETA49_MJJ-800',
-        'L1_3J20_4J20.0ETA49_MJJ-900',
         
-        'L1_XE35_MJJ-200',
+        # INVM + DPHI 
+        #'L1_MJJ-400-NFF-0DPHI20',
+        'L1_MJJ-400-NFF-0DPHI22',
+        'L1_MJJ-400-NFF-0DPHI24',
+        'L1_MJJ-400-NFF-0DPHI26',
    
         ### ATR-15062
-        'L1_EM18VH_MJJ-300',
+        'L1_EM18VHI_MJJ-300',
 
-        'L1_LATE-MU10_XE50', 'L1_LATE-MU10_J50',
+        'L1_LATE-MU10_XE50','L1_LATE-MU10_XE40', 'L1_LATE-MU10_J50',
 
         'L1_TAU60_DR-TAU20ITAU12I',
 
-        'L1_SC111',
-        'L1_SC85',
+        'L1_SC111-CJ15',
+#        'L1_SC85-CJ15',
         
         ##     # Partition 1
         ##     'L1_CALREQ0_P1', 'L1_CALREQ1_P1', 'L1_CALREQ2_P1',
 
         #ALFA
-#ALFA_B7R1L_OD        'L1_ALFA_ELAST1',
-#        'L1_ALFA_ELAST2',
-#        'L1_ALFA_ELAST11','L1_ALFA_ELAST12',
-#        'L1_ALFA_ELAST13','L1_ALFA_ELAST14','L1_ALFA_ELAST15','L1_ALFA_ELAST15_Calib',
-#        'L1_ALFA_ELAST16','L1_ALFA_ELAST17','L1_ALFA_ELAST18','L1_ALFA_ELAST18_Calib',
 #        'L1_ALFA_SDIFF5','L1_ALFA_SDIFF6','L1_ALFA_SDIFF7','L1_ALFA_SDIFF8',
 #        'L1_MBTS_1_A_ALFA_C','L1_MBTS_1_C_ALFA_A','L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO',
 #        'L1_MBTS_2_A_ALFA_C','L1_MBTS_2_C_ALFA_A','L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO',
@@ -829,64 +634,106 @@ def defineMenu():
 #
 #        'L1_EM3_ALFA_EINE',
 #        'L1_J12_ALFA_ANY','L1_J12_ALFA_ANY_UNPAIRED_ISO',
-#        'L1_TE5_ALFA_ANY','L1_TE5_ALFA_ANY_UNPAIRED_ISO','L1_TE5_ALFA_EINE',
+#        'L1_TE5_ALFA_ANY','L1_TE5_ALFA_ANY_UNPAIRED_ISO',
+#         'L1_TE5_ALFA_EINE',
 #        'L1_TRT_ALFA_ANY','L1_TRT_ALFA_ANY_UNPAIRED_ISO',
 #        'L1_TRT_ALFA_EINE',
 #        #'L1_LHCF_ALFA_ANY_A',
 #        #'L1_LHCF_ALFA_ANY_C',
 ##        'L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO','L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO',
-#        'L1_ALFA_BGT','L1_ALFA_BGT_UNPAIRED_ISO','L1_ALFA_BGT_BGRP10',
-#        'L1_ALFA_SHOWSYST5',
-#        'L1_ALFA_SYST9' ,'L1_ALFA_SYST10','L1_ALFA_SYST11','L1_ALFA_SYST12',
-#        'L1_ALFA_SYST17','L1_ALFA_SYST18',
-         'L1_ALFA_ANY',
-#        'L1_ALFA_ANY_EMPTY','L1_ALFA_ANY_FIRSTEMPTY','L1_ALFA_ANY_UNPAIRED_ISO','L1_ALFA_ANY_UNPAIRED_NONISO',
-#        'L1_ALFA_ANY_BGRP10','L1_ALFA_ANY_ABORTGAPNOTCALIB','L1_ALFA_ANY_CALIB',
-        'L1_ALFA_B7L1U','L1_ALFA_B7L1L','L1_ALFA_A7L1U','L1_ALFA_A7L1L','L1_ALFA_A7R1U','L1_ALFA_A7R1L','L1_ALFA_B7R1U','L1_ALFA_B7R1L',
+#        'L1_ALFA_BGT','L1_ALFA_BGT_UNPAIRED_ISO',
 #        'L1_ALFA_ANY_A_EMPTY','L1_ALFA_ANY_C_EMPTY',
-#        'L1_ALFA_B7L1U_OD','L1_ALFA_B7L1L_OD','L1_ALFA_A7L1U_OD','L1_ALFA_A7L1L_OD','L1_ALFA_A7R1U_OD','L1_ALFA_A7R1L_OD','L1_ALFA_B7R1U_OD','L1_ALFA_B7R1L_OD',
-#        'L1_ALFA_B7L1_OD','L1_ALFA_A7L1_OD','L1_ALFA_B7R1_OD','L1_ALFA_A7R1_OD',
+         'L1_ALFA_ANY',
 #
-         'L1_AFP_C_MBTS_A',
-         'L1_AFP_C_ZDC_C',
-         'L1_AFP_C_J12',
-         'L1_AFP_C_EM3',
-         'L1_AFP_C_TE5',
-         'L1_AFP_C_ALFA_C',
-         'L1_AFP_C_ALFA_A',
-         'L1_AFP_C_ANY_MBTS_A',
-         'L1_AFP_C_MU4',
+#         'L1_AFP_C_MBTS_A',
+#         'L1_AFP_C_ZDC_C',
+#         'L1_AFP_C_J12',
+#         'L1_AFP_C_EM3',
+#         'L1_AFP_C_TE5',
+#         'L1_AFP_C_ALFA_C',
+#         'L1_AFP_C_ALFA_A',
+#         'L1_AFP_C_ANY_MBTS_A',
+#         'L1_AFP_C_MU4',
+
+        # Items for beta*=90m run
+#        'L1_J12_ALFA_EINE',
+#        'L1_2EM3_ALFA_EINE',
+#        'L1_MU4_ALFA_ANY',
+#        'L1_MU4_ALFA_ANY_UNPAIRED_ISO',
+#        'L1_MU4_ALFA_ANY_PAIRED_UNPAIRED_ISO',
+#        'L1_MU4_ALFA_EINE',
+
+
+        #ATR-18815
+        #'L1_LFV-EM8I-MU11',
+        #'L1_LFV-EM12I-MU6',
+
+        #ATR-19355
+        'L1_BPH-0M10-3MU4',
+
+        #ATR-18824
+        'L1_ZAFB-04DPHI-EM15I',
+        'L1_ZAFB-25DPHI-EM15I',
+        #'L1_ZAFB-25DPHI-EM18I',
+
+        #ATR-19302: 
+#        'L1_DPHI-M70-2EM10I',
+        'L1_DPHI-M70-2EM12I',
+
+        #ATR-19510
+        'L1_DY-BOX-2MU4',
+        #'L1_DY-DR-2MU4',
+        'L1_DY-BOX-2MU6',
+
+                
+        #ATR-17320
+        'L1_CEP-CJ60',
+        'L1_CEP-CJ50' ,
+
+        #ATR-20174
+        'L1_BPH-8M15-2MU4-BO'
+
+
 
         ]
     
 
-    # the CTP ID mapping still has to be defined, currently it is taken from the order of the items
-    #Free slot [ATR-14858], 16-08-16
-    #[82,143,377,378,379,406,409,416,480]
+    #CTP IDs are taken from this mapping. Every L1 item needs a unique ctpid.
+    # Run this file as python <this file> to print out available IDs
+    # 463-464 are reserved for L1_RD2_BGRP14 and L1_RD3_BGRP15 (from run 2)
+    # 509-511 are reserved for CALREQ
 
     
 
     Lvl1Flags.CtpIdMap = {
+
         'L1_EM3' : 0,
         'L1_EM7' : 1,
         'L1_EM12' : 2,
         'L1_EM8VH' : 3,
         'L1_EM10VH' : 4,
-        'L1_EM13VH' : 5,
         'L1_EM15' : 6,
+        'L1_EM30VHI' : 25,
+        'L1_EM15VHI' : 29,
+        'L1_EM24VHIM' : 30,
         'L1_EM15VH' : 7,
-        'L1_EM18VH' : 8,
+        'L1_EM18VHI' : 8,
         'L1_EM20VH' : 9,
         'L1_EM20VHI' : 10,
         'L1_EM22VHI' : 11,
+        'L1_EM22VH' : 295,
+        'L1_EM24VHI' : 392,
         'L1_EM3_EMPTY' : 12,
         'L1_EM7_EMPTY' : 13,
+        'L1_EM7_UNPAIRED_ISO' : 389,
+        'L1_EM7_FIRSTEMPTY' : 371,
+        'L1_EM20VH_FIRSTEMPTY' : 411,
         'L1_MU4' : 14,
         'L1_MU6' : 15,
         'L1_MU10' : 16,
         'L1_MU11' : 256,
-        'L1_MU15' : 17,
         'L1_MU20' : 18,
+        'L1_MU21' : 17,
         'L1_MU4_EMPTY' : 19,
         'L1_MU6_EMPTY' : 66,
         'L1_MU4_FIRSTEMPTY' : 20,
@@ -894,103 +741,99 @@ def defineMenu():
         'L1_MU4_UNPAIRED_ISO' : 22,
         'L1_2EM3' : 23,
         'L1_2EM7' : 24,
-        'L1_2EM10VH' : 25,
-        'L1_2EM13VH' : 26,
         'L1_2EM15' : 27,
         'L1_2EM15VH' : 28,
-        'L1_EM7_2EM3' : 29,
-        'L1_EM12_2EM3' : 30,
-        'L1_EM15VH_3EM7' : 31,
-        'L1_2EM18VH':398,
-        'L1_2EM20VH':400,
-        'L1_EM15VH_3EM10VH':401,
-        'L1_EM18VH_3EM8VH':406,
-        'L1_EM18VH_2EM10VH_3EM7':408,
-        'L1_EM20VH_3EM10VH':431, 
-        'L1_EM20VH_2EM10VH_3EM8VH':432,
+        'L1_2EM15VHI' : 31,
+        'L1_2EM20VH' : 400,
+        'L1_EM20VH_3EM10VH' : 431,
+        'L1_EM7_MU10' : 65,
         'L1_2MU4' : 32,
         'L1_2MU6' : 33,
         'L1_2MU10' : 34,
         'L1_2MU20_OVERLAY' : 35,
-        'L1_MU10_2MU6' : 36,
         'L1_MU11_2MU6' : 37,
         'L1_3MU4' : 38,
         'L1_MU6_2MU4' : 39,
         'L1_3MU6' : 40,
         'L1_4MU4' : 46,
-        'L1_4J15.0ETA25' : 41,
-        'L1_EM15I_MU4' : 42,
+        'L1_MU6_3MU4' : 36,
+        'L1_2MU6_3MU4' : 42,
+        'L1_2MU11' : 48,
+        'L1_MU11_2MU10' : 49,
         'L1_2EM8VH_MU10' : 43,
         'L1_EM15VH_MU10' : 44,
+        'L1_EM7_MU20' : 483,
+        'L1_EM8VH_MU20' : 484,
+        'L1_TAU5' : 50,
         'L1_TAU12' : 45,
         'L1_TAU12IM' : 47,
-        'L1_TAU20' : 49,
         'L1_TAU20IM' : 51,
         'L1_TAU30' : 53,
+        'L1_TAU30_EMPTY' : 341,
+        'L1_TAU30_UNPAIRED_ISO' : 343,
         'L1_TAU40' : 54,
         'L1_TAU60' : 55,
+        'L1_TAU90' : 56,
         'L1_TAU100' : 52,
-        'L1_TAU8' : 56,
         'L1_TAU8_EMPTY' : 57,
+        'L1_TAU8_UNPAIRED_ISO' : 388,
+        'L1_TAU8_FIRSTEMPTY' : 391,
         'L1_TAU20IM_2TAU12IM' : 58,
-        'L1_TAU20_2TAU12' : 59,
-        'L1_EM15HI_2TAU12IM' : 60,
-        'L1_EM15HI_2TAU12IM_J25_3J12' : 61,
-        'L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15' : 378,
-        'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
-        'L1_EM15HI_TAU40_2TAU15' : 62,
+        'L1_TAU60_2TAU40' : 458,
+        'L1_2TAU5' : 59,
+        'L1_2TAU8' : 166,
+        'L1_EM15VHI_2TAU12IM' : 60,
+        'L1_EM15VHI_2TAU12IM_J25_3J12' : 61,
+        'L1_EM15VHI_2TAU12IM_4J12' : 5,
+        'L1_EM15VHI_TAU40_2TAU15' : 62,
         'L1_MU10_TAU12IM' : 63,
         'L1_MU10_TAU12IM_J25_2J12' : 64,
-        'L1_EM7_MU10':65,
-        'L1_TAU30_EMPTY':341,
+        'L1_MU10_TAU12IM_3J12' : 482,
         'L1_MU10_TAU20IM' : 67,
         'L1_MU11_TAU20IM' : 430,
         'L1_MU10_TAU20IM_J25_2J20' : 377,
-
         'L1_TAU20IM_2TAU12IM_J25_2J20_3J12' : 70,
-        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I' : 71,
-        'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
-        'L1_MU10_TAU12I-J25' : 73,
+        'L1_TAU20IM_2TAU12IM_4J12.0ETA23' : 316,
+        #'L1_TAU20IM_2TAU12IM_4J12.0ETA25' : 73,
+        'L1_TAU20IM_2TAU12IM_4J12.0ETA28' : 77,
+        'L1_TAU25IM_2TAU20IM_2J25_3J20' : 398,
         'L1_TAU20IM_2J20_XE45' : 74,
-        'L1_TAU30_UNPAIRED_ISO' :343,
-        'L1_TAU60_DR-TAU20ITAU12I' : 76,
-        'L1_EM15HI_2TAU12IM_XE35' : 78,
+        'L1_TAU20IM_2J20_XE50' : 79,
+        'L1_EM15VHI_2TAU12IM_XE35' : 78,
+        'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
         'L1_MU10_TAU12IM_XE35' : 81,
-#        'L1_MU10_TAU12IM_XE40' : 82,
         'L1_TAU20IM_2TAU12IM_XE35' : 83,
-        'L1_TAU20_2TAU12_XE35' : 84,
         'L1_TAU40_2TAU12IM_XE40' : 429,
-#        'L1_EM15VH_JJ15.23ETA49' : 86,
-        'L1_MU4_J12' : 87,
-        'L1_MU4_J50_XE40' : 330,
+        'L1_EM18VHI_3J20' : 172,
+        'L1_EM20VH_3J20' : 26,
         'L1_MU6_J20' : 88,
+        'L1_MU6_J30.0ETA49_2J20.0ETA49' : 382,
         'L1_MU6_J40' : 89,
         'L1_MU6_J75' : 90,
-        'L1_2MU4_J40_XE20' : 331,
-        'L1_MU20_J40'  : 428,
+        'L1_MU10_2J20' : 278,
+        'L1_MU10_3J20' : 173,
+        'L1_MU10_2J15_J20' : 255,
+        'L1_MU20_J40' : 428,
         'L1_MU20_XE30' : 433,
-        'L1_J12' : 91,
+        'L1_MU20_J50' : 82,
         'L1_J15' : 92,
         'L1_J20' : 93,
         'L1_J25' : 94,
         'L1_J30' : 95,
-        
         'L1_J40' : 96,
         'L1_J50' : 97,
         'L1_J75' : 98,
         'L1_J85' : 99,
         'L1_J100' : 100,
-        'L1_J120' : 101,
+        #'L1_J120' : 101,
         'L1_J400' : 102,
+        #'L1_4J20.0ETA49' : 383,
         'L1_J20.31ETA49' : 103,
         'L1_J30.31ETA49' : 104,
         'L1_J50.31ETA49' : 105,
         'L1_J75.31ETA49' : 106,
-        'L1_J100.31ETA49' : 107,
-#        'L1_J40.0ETA25' : 108,
-        
         'L1_J15.31ETA49' : 109,
-        'L1_J20.28ETA31' : 110,
+        'L1_J30.0ETA49_2J20.0ETA49' : 137,
         'L1_J12_EMPTY' : 111,
         'L1_J12_FIRSTEMPTY' : 112,
         'L1_J12_UNPAIRED_ISO' : 113,
@@ -1005,43 +848,27 @@ def defineMenu():
         'L1_J50_UNPAIRED_ISO' : 121,
         'L1_J50_UNPAIRED_NONISO' : 122,
         'L1_J50_ABORTGAPNOTCALIB' : 123,
-
-        'L1_J20_J20.31ETA49' : 125,
-        'L1_3J15' : 126,
-        'L1_3J20' : 127,
-        'L1_3J40' : 128,
-        'L1_3J15.0ETA25' : 129,
+        'L1_J100_FIRSTEMPTY' : 414,
+        'L1_J45.0ETA20_3J15.0ETA25' : 86,
+        'L1_J50_2J40.0ETA25_3J15.0ETA25' : 87,
         'L1_3J50' : 130,
         'L1_4J15' : 131,
         'L1_4J20' : 132,
         'L1_3J15.0ETA25_XE40' : 184,
-        
-#        'L1_3J75' : 133,
-#        'L1_4J30' : 134,
         'L1_6J15' : 135,
-        'L1_J75_3J20' : 136,
         'L1_J85_3J30' : 480,
-        'L1_J30.0ETA49_2J20.0ETA49' : 137,
-
-       
-        'L1_TE10' : 138,
-        'L1_TE15' : 82,
-        'L1_TE25' : 143,
-
+        'L1_J25.0ETA23_2J15.31ETA49' : 335,
+        'L1_J40.0ETA25_2J15.31ETA49' : 181,
+        'L1_J40.0ETA25_2J25_J20.31ETA49' : 182,
+        'L1_3J25.0ETA23' : 373,
+        'L1_3J35.0ETA23' : 425,
+        'L1_4J15.0ETA25' : 41,
         'L1_5J15.0ETA25' : 140,
         'L1_2J15_XE55' : 141,
         'L1_J40_XE50' : 142,
-        #'L1_J75_XE40' : 143,
-        'L1_J75_XE50' : 133,
-
+        'L1_2J50_XE40' : 175,
+        'L1_J40_XE60' : 176,
         'L1_XE10': 68,
-        #'L1_XE25': 82,
-        'L1_XE30': 85,
-        'L1_XE65': 108,
-        'L1_XE75': 134,
-        'L1_XE150': 156,
-        'L1_XE300': 187,
-        
         'L1_XE35' : 144,
         'L1_XE40' : 145,
         'L1_XE45' : 146,
@@ -1050,129 +877,23 @@ def defineMenu():
         'L1_XE60' : 149,
         'L1_XE70' : 150,
         'L1_XE80' : 151,
-        'L1_XS20' : 152,
-        'L1_XS30' : 153,
+        'L1_XE30' : 85,
+        'L1_XE300' : 187,
         'L1_EM12_XS20' : 154,
         'L1_EM15_XS30' : 155,
-
-        'L1_TE30' : 157,
-        'L1_TE40' : 158,
-        'L1_TE70' : 159,
-        'L1_TE30.0ETA24' : 160,
-        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
-        'L1_BCM_AC_CA_UNPAIRED_ISO' : 162,
-        'L1_BCM_AC_UNPAIRED_ISO' : 163,
-        'L1_MBTS_1_EMPTY' : 164,
-        'L1_MBTS_1_UNPAIRED_ISO' : 165,
-        'L1_MBTS_2_EMPTY' : 166,
-        'L1_MBTS_2_UNPAIRED_ISO' : 167,
-        'L1_MBTS_1_1_EMPTY' : 168,
-        'L1_MBTS_1_1_UNPAIRED_ISO' : 169,
-
-        'L1_DPHI-AJ20s2XE50' : 171,
-        'L1_EM13VH_3J20' : 172,
-        'L1_EM18VH_3J20' : 295,
-        'L1_MU10_3J20' : 173,
-
-        'L1_2J50_XE40' : 175,
-        'L1_J40_XE60' : 176,
-        'L1_J40.0ETA25_XE50' : 177,
-        'L1_MU10_2J20' : 278,
-        'L1_TAU40_2TAU20IM' : 254,
-        'L1_MU10_2J15_J20' : 255,
-# freeing some CTPIDs  
-#        'L1_MBTSA0' : 170,
-#        'L1_MBTSA1' : 171,
-#        'L1_MBTSA2' : 172,
-#        'L1_MBTSA3' : 173,
-#        'L1_MBTSA4' : 174,
-#        'L1_MBTSA5' : 175,
-#        'L1_MBTSA6' : 176,
-#        'L1_MBTSA7' : 177,
-#        'L1_MBTSA8' : 178,
-#        'L1_MBTSA10' : 179,
-#        'L1_MBTSA12' : 180,
-#        'L1_MBTSA14' : 181,
-#        'L1_MBTSC0' : 182,
-#        'L1_MBTSC1' : 183,
-#        'L1_MBTSC2' : 184,
-#        'L1_MBTSC3' : 185,
-#        'L1_MBTSC4' : 186,
-#        'L1_MBTSC5' : 187,
-#        'L1_MBTSC6' : 188,
-#        'L1_MBTSC7' : 189,
-#        'L1_MBTSC8' : 190,
-#        'L1_MBTSC10' : 191,
-#        'L1_MBTSC12' : 192,
-#        'L1_MBTSC14' : 193,
-
-        
-        'L1_BPH-2M8-2MU4' : 178, # ATR-15197 'L1_BPH-2M9-2MU4' : 178,
-        'L1_BPH-8M15-MU6MU4' : 179,
-        'L1_BPH-8M15-2MU6' : 180,
-        'L1_J15.0ETA25_2J15.31ETA49': 305 , 
-        'L1_J40.0ETA25_2J15.31ETA49' : 181,
-        'L1_J40.0ETA25_2J25_J20.31ETA49' : 182,
-
-        "L1_J40.0ETA25_2J30_J20.31ETA49":250 , 
-
-        "L1_HT150-J20s5.ETA31_MJJ-400": 272 , ## noid(ea)
-        "L1_HT150-J20s5.ETA31_MJJ-400-CF": 273,
-        
-        ## the ctp ids are a mess.. no 7 consequetive ids are free.. but these here are:
-        'L1_AFP_C_MBTS_A':183,
-        'L1_AFP_C_ZDC_C':189,
-        'L1_AFP_C_J12':190,
-        'L1_AFP_C_EM3':191,
-        'L1_AFP_C_TE5':192,
-        'L1_AFP_C_ALFA_C':193,
-        'L1_AFP_C_ALFA_A':170,
-        'L1_AFP_C_ANY_MBTS_A':174,
-        'L1_AFP_C_MU4':379,   
-        
-#        'L1_EM8I' : 183,
-#        'L1_EM15I': 184,
-        'L1_MBTS_4_A_UNPAIRED_ISO' : 185,
-        'L1_MBTS_4_C_UNPAIRED_ISO' : 186,        
-        'L1_MBTS_4_A' : 194,
-        'L1_MBTS_4_C' : 195,
-        'L1_MBTS_1_BGRP9' : 196,
-        'L1_MBTS_2_BGRP9' : 197,
-        'L1_MBTS_1_BGRP11' : 198,
-        'L1_MBTS_2_BGRP11' : 199,
         'L1_RD0_FILLED' : 200,
         'L1_RD0_UNPAIRED_ISO' : 201,
         'L1_RD0_EMPTY' : 202,
-        'L1_RD1_FILLED' : 203,
         'L1_RD1_EMPTY' : 204,
-        'L1_RD1_BGRP10' : 188,
-        'L1_RD2_FILLED' : 205,
         'L1_RD2_EMPTY' : 206,
-        'L1_RD3_FILLED' : 207,
-        'L1_RD3_EMPTY' : 208,
-        'L1_RD0_FIRSTEMPTY' : 209,
-        'L1_RD0_BGRP9' : 210,
-        'L1_RD0_BGRP11' : 211,
-        'L1_LUCID' : 212,
-        'L1_LUCID_EMPTY' : 213,
-        'L1_LUCID_UNPAIRED_ISO' : 214,
-        'L1_LUCID_A_C_EMPTY' : 215,
-        'L1_LUCID_A_C_UNPAIRED_ISO' : 216,
-        'L1_LUCID_A_C_UNPAIRED_NONISO' : 217,
-        'L1_TRT_FILLED' : 218,
-        'L1_TRT_EMPTY' : 219,
+        'L1_RD0_ABORTGAPNOTCALIB' : 372,
         'L1_TGC_BURST' : 220,
-#        'L1_TGC_BURST_EMPTY' : 184,
-        'L1_LHCF' : 221,
-        'L1_BCM_Wide_BGRP0' : 222,
+        'L1_ZB' : 240,
         'L1_BCM_AC_CA_BGRP0' : 223,
         'L1_BCM_Wide_EMPTY' : 224,
         'L1_BCM_Wide_UNPAIRED_ISO' : 225,
-        'L1_MBTS_1' : 226,
-        'L1_MBTS_2' : 227,
-        'L1_MBTS_1_1' : 228,
-        
-      
+        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
+        'L1_BCM_AC_UNPAIRED_ISO' : 163,
         'L1_BCM_CA_UNPAIRED_ISO' : 229,
         'L1_BCM_AC_UNPAIRED_NONISO' : 230,
         'L1_BCM_CA_UNPAIRED_NONISO' : 231,
@@ -1182,338 +903,98 @@ def defineMenu():
         'L1_BCM_AC_CALIB' : 235,
         'L1_BCM_CA_CALIB' : 236,
         'L1_BCM_Wide_CALIB' : 237,
-        'L1_BTAG-MU4J15' : 238,
-        'L1_BTAG-MU4J30' : 239,
-        'L1_ZB' : 240,
-        'L1_BPTX0_BGRP0' : 241,
-        'L1_BPTX1_BGRP0' : 242,
-        'L1_BTAG-MU6J20' : 243,
-        'L1_BTAG-MU6J25' : 244,
-#        'L1_BTAG-MU4J20' : 245,
-        'L1_3J15_BTAG-MU4J15' : 246,
-        'L1_3J15_BTAG-MU4J30' : 247,
-        'L1_3J15_BTAG-MU6J25' : 248,
-        'L1_3J20_BTAG-MU4J20' : 249,
-#        'L1_J40_DPHI-Js2XE50' : 250,
-        'L1_J40_DPHI-J20s2XE50' : 251,
-        #'L1_J40_DPHI-J20s2XE30' : 257,
-        'L1_J40_XE50_DPHI-J20s2XE50': 245,
-        'L1_J40_DPHI-J20XE50' : 252,
-        'L1_J40_DPHI-CJ20XE50' : 253,
-        'L1_MU4_J20_XE30_DPHI-J20s2XE30' : 257,
-        'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
-        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30' : 434,
-        'L1_3EM3_J40_XE50_DPHI-J20s2XE50' : 435,
-#SX
-#        'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B' : 254,
-#        'L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B' : 255,
-#        'L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO' : 256,
-#        'L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO' : 257,
-
-        
-        'L1_HT190-J15.ETA21' : 258,
+        #'L1_BTAG-MU4J15' : 238,
+        #'L1_BTAG-MU6J20' : 243,
+        'L1_2MU4_J40_XE50' : 449,
+        'L1_MU4_J30_XE40_DPHI-J20s2XE30' : 452,
+        'L1_MU4_J50_XE50_DPHI-J20s2XE30' : 453,
+        'L1_MU4_XE60' : 454,
         'L1_HT190-J15s5.ETA21' : 259,
-        'L1_HT150-J20.ETA31' : 260,
-        'L1_HT150-J20s5.ETA31' : 261,
-        'L1_JPSI-1M5' : 262,
+        'L1_HT150-J20s5.ETA31_MJJ-400-CF' : 91,
         'L1_JPSI-1M5-EM7' : 263,
         'L1_JPSI-1M5-EM12' : 264,
-        'L1_KF-XE40' : 265,
-        'L1_KF-XE50' : 266,
-        'L1_KF-XE55' : 267,
-        'L1_KF-XE60' : 268,
-        'L1_KF-XE65' : 269,
-        'L1_KF-XE75' : 270,
-#        'L1_W-05DPHI-JXE-0' : 271,
-#        'L1_W-10DPHI-JXE-0' : 272,
-#        'L1_W-15DPHI-JXE-0' : 273,
-        #'L1_W-15DPHI-EMXE-1' : 271,
-        #'L1_W-15DPHI-EM15XE-1' : 272,
-#        'L1_W-05DPHI-EMXE-1' : 276,
-        'L1_W-05RO-XEHT-0' : 277,
-        'L1_W-90RO2-XEHT-0' : 279,
-        'L1_W-250RO2-XEHT-0' : 280,
-        'L1_W-HT20-JJ15.ETA49' : 281,
-        'L1_W-NOMATCH' : 282,
-        #'L1_W-NOMATCH_W-05RO-XEEMHT' : 283,
-        'L1_EM10_W-MT25' : 284,
-        'L1_EM15_W-MT35' : 286,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0' : 287,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30' : 288,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20' : 289,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE' : 290,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_W-250RO2-XEHT-0' : 291,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS60' : 292,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS30' : 293,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE' : 294,
-#SX
-#        'L1_BPH-DR-2MU4' : 295,
-#        'L1_BPH-2M-2MU4' : 296,
-#        'L1_BPH-4M8-2MU4' : 297,
-#        'L1_BPH-DR-2MU4_BPH-2M-2MU4' : 298,
-#        'L1_BPH-DR-2MU4_BPH-4M8-2MU4' : 299,
-#        'L1_BPH-DR-2MU6' : 300,
-#        'L1_BPH-2M-2MU6' : 301,
-#        'L1_BPH-4M8-2MU6' : 302,
-#        'L1_BPH-DR-2MU6_BPH-2M-2MU6' : 303,
-#        'L1_BPH-DR-2MU6_BPH-4M8-2MU6' : 304,
-#        'L1_BPH-2M-2MU4-B' : 305,
-#        'L1_BPH-2M-2MU4-BO' : 306,
-#        'L1_BPH-2M-MU6MU4' : 307,
-#        'L1_BPH-2M-MU6MU4-B' : 308,
-#        'L1_BPH-2M-MU6MU4-BO' : 309,
-#        'L1_BPH-4M8-2MU4-B' : 310,
-#        'L1_BPH-4M8-2MU4-BO' : 311,
-#        'L1_BPH-4M8-MU6MU4' : 312,
-#        'L1_BPH-4M8-MU6MU4-B' : 313,
-#        'L1_BPH-4M8-MU6MU4-BO' : 314,
-
-#SX adding
-        #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4' : 295,
-        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4'  : 296, #  ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4'  : 296,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4'  : 297,
-        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4'  : 298, # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4'  : 298,
-        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4'  : 299,
-        'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6' : 300,
-        'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6'  : 301,
-        'L1_MU6MU4-BO' : 302,
-        'L1_2MU4-B' : 303,
-        'L1_2MU6-B'  : 304,
-        #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4'  : 305,
-        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4'  : 306,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'  :  307,
-        #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4'   : 308,
-        #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4'  : 309,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO'  : 310,
-        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4' : 311,
-        'L1_2MU4-BO' : 312,
-        'L1_2MU6-BO' : 313,
-        'L1_MU6_2MU4-B'  : 314,
-
-        ### ATR-14350 - these should be replaced in 2017 with items 296 and 298
-        'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4' : 426,
-        'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' : 427,
-
-
-        'L1_DY-DR-2MU4' : 315,
-        'L1_EM15VH_2EM8VH_MU6' : 316,
-        #'L1_DY-BOX-MU6MU4' : 317,
-        'L1_DY-BOX-2MU6' : 318,
-        'L1_LFV-MU' : 319,
         'L1_LFV-MU6' : 332,
+        'L1_LFV-MU11' : 364,
         'L1_LFV-EM8I' : 320,
         'L1_LFV-EM15I' : 321,
-        'L1_EM7_MU15' : 322,
-        'L1_EM8VH_MU15' : 48,
         'L1_DPHI-J20s2XE50' : 323,
-        'L1_DPHI-J20XE50' : 324,
-        'L1_DPHI-CJ20XE50' : 325,
-        'L1_MJJ-900' : 326,
-        'L1_MJJ-800' : 327,
-        'L1_MJJ-700' : 328,
-        'L1_MJJ-400' : 329,
-        #'L1_MJJ-350' : 330,
-#        'L1_MJJ-300' : 331,
-#        'L1_MJJ-200' : 332,
-        'L1_MJJ-100' : 333,
-        'L1_HT150-JJ15.ETA49' : 334,
-        'L1_J4-MATCH' : 336,
+        'L1_J40_XE50_DPHI-J20s2XE50' : 245,
+        'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
+        'L1_MJJ-700' : 216,
+        'L1_MJJ-300' : 331,
+        #'L1_MJJ-100' : 333,
+        #'L1_MJJ-400' : 329,
+        #'L1_MJJ-800' : 327,
+        'L1_MJJ-500-NFF' : 108,
+        'L1_J50_DETA20-J50J' : 275,
+        'L1_DPHI-2EM3' : 288,
+        #'L1_HT150-JJ15.ETA49' : 334,
+        #'L1_HT150-JJ15.ETA49_MJJ-400' : 416,
+        #'L1_J4-MATCH' : 336,
         'L1_LLP-RO' : 338,
-        'L1_LLP-NOMATCH' : 339,
-        'L1_DR-MU10TAU12I' : 340,
-#        'L1_TAU12I-J25' : 341,
-        'L1_EM15TAU12I-J25' : 345,
+        #'L1_LLP-NOMATCH' : 339,
+        #'L1_EM15TAU12I-J25' : 345,
+        #'L1_DR-MU10TAU12I' : 340,
+        #'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
         'L1_DR-EM15TAU12I-J25' : 346,
-        'L1_TAU20ITAU12I-J25' : 347,
+        #'L1_TAU20ITAU12I-J25' : 347,
         'L1_DR-TAU20ITAU12I' : 348,
-        'L1_BOX-TAU20ITAU12I' : 349,
         'L1_DR-TAU20ITAU12I-J25' : 350,
-
-        'L1_DR25-TAU20ITAU12I' : 337,
-
-        'L1_DR25-TAU20ITAU12I-J25' : 386,
         'L1_30M-EM20ITAU12' : 387,
-        'L1_MJJ-400-CF': 397,
-
-        'L1_LAR-EM' : 351,
-        'L1_LAR-J' : 352,
-        'L1_DR-EM15TAU12I' : 353,        
-        'L1_LATE-MU10_XE50': 354,
+        'L1_MJJ-400-CF' : 397,
+        #'L1_LAR-EM' : 351,
+        #'L1_LAR-J' : 352,
+        #'L1_LAR-ZEE' : 71,
+        #'L1_LAR-ZEE_LAR-EM' : 285,
+        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4' : 426,
+        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' : 427,
+        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO' : 488,
+        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6' : 301,
+        'L1_BPH-8M15-0DR22-2MU6' : 107,
+        'L1_BPH-2M9-2DR15-2MU6' : 110,
+        'L1_BPH-2M9-0DR15-MU6MU4' : 125,
+        'L1_BPH-8M15-0DR22-MU6MU4-BO' : 126,
+        'L1_BPH-2M9-0DR15-2MU4' : 127,
+        'L1_BPH-0M9-EM7-EM5' : 80,
+        'L1_BPH-0DR3-EM7J15' : 84,
+        'L1_BPH-0M9-EM7-EM5_MU6' : 124,
+        'L1_BPH-0DR3-EM7J15_MU6' : 134,
+        'L1_BPH-0M9-EM7-EM5_2MU4' : 153,
+        'L1_BPH-0DR3-EM7J15_2MU4' : 156,
+        #'L1_MJJ-400-NFF-0DPHI20' : 128,
+        'L1_MJJ-400-NFF-0DPHI22' : 129,
+        'L1_MJJ-400-NFF-0DPHI24' : 133,
+        'L1_MJJ-400-NFF-0DPHI26' : 136,
+        'L1_EM18VHI_MJJ-300' : 385,
+        'L1_LATE-MU10_XE50' : 354,
+        'L1_LATE-MU10_XE40' : 466,
         'L1_LATE-MU10_J50' : 355,
-        'L1_SC111' : 356,
-        'L1_SC85' : 357,
-#SX
-#        'L1_BPH-DR-2MU4-B' : 353,
-#        'L1_BPH-DR-2MU4-BO' : 354,
-#        'L1_BPH-DR-MU6MU4' : 355,
-#        'L1_BPH-DR-MU6MU4-B' : 356,
-#        'L1_BPH-DR-MU6MU4-BO' : 357,
-        'L1_MU6_MJJ-200' : 358,
-        'L1_MU6_MJJ-300' : 359,
-        'L1_MU6_MJJ-400' : 360,
-        'L1_MU6_MJJ-500' : 361,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-400' : 362,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-700' : 363,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-800' : 364,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-900' : 365,
-        'L1_3J20_4J20.0ETA49_MJJ-400' : 366,
-        'L1_3J20_4J20.0ETA49_MJJ-700' : 367,
-        'L1_3J20_4J20.0ETA49_MJJ-800' : 368,
-        'L1_3J20_4J20.0ETA49_MJJ-900' : 369,
-        'L1_XE35_MJJ-200' : 370,
-        'L1_EM7_FIRSTEMPTY': 371, 
-        'L1_RD0_ABORTGAPNOTCALIB':372,
-        'L1_3J25.0ETA23' : 373,
-        'L1_3J35.0ETA23' : 425,
-        'L1_TE20' : 374,
-        'L1_TE10.0ETA24' : 375,
-        'L1_TE15.ETA24' : 416,
-        'L1_TE20.0ETA24' : 376,
-        'L1_TE25.0ETA24' : 409,
-        #'L1_XS40' : 377,
-        #'L1_XS50' : 378,
-        #'L1_XS60' : 379,
-        'L1_J12_BGRP12' : 380,
-        'L1_J30.31ETA49_BGRP12' : 381,
-        'L1_MU6_J30.0ETA49_2J20.0ETA49' : 382,
-        'L1_4J20.0ETA49' : 383,
-        'L1_HT150-JJ15.ETA49_MJJ400' : 384,
-
-        ### ATR-15062
-        'L1_EM18VH_MJJ-300' : 385,
-        
-#ATR-13743        'L1_MU4_J30' : 386,
-#        'L1_MU4_J50' : 387,
-
-        
-        'L1_TAU8_UNPAIRED_ISO': 388,
-        'L1_EM7_UNPAIRED_ISO': 389,
-        'L1_TAU8_UNPAIRED_NONISO': 467,
-        'L1_EM7_UNPAIRED_NONISO': 468,
-        'L1_MU4_UNPAIRED_NONISO' : 469,
-        'L1_RD2_BGRP12'   : 390,
-        'L1_TAU8_FIRSTEMPTY': 391,
-        'L1_EM24VHI'           : 392,
-        'L1_LHCF_UNPAIRED_ISO' : 393,
-        'L1_LHCF_EMPTY' : 394,
-        'L1_EM15VH_2EM10VH_3EM7': 395,
-        'L1_EM15VH_3EM8VH': 396, 
-        'L1_EM8I_MU10'  : 399,
-        "L1_EM26VHI"    :402,
-        "L1_EM15HI"    :423,
-        "L1_EM15I"    :424,
-        "L1_MU6_3MU4"  :403,
-        "L1_2MU6_3MU4" :404,
-        "L1_BGRP9"     :405,
-        #'L1_TE50'       :406,
-        'L1_TE5'       :407,
-        #'L1_TE60'      :408,
-        #'L1_TE50.0ETA24':409,
-        'L1_TE5.0ETA24':410, 
-        'L1_EM20VH_FIRSTEMPTY':411, 
-        'L1_EM22VHI_FIRSTEMPTY':412, 
-        'L1_MU20_FIRSTEMPTY':413, 
-        'L1_J100_FIRSTEMPTY':414, 
-        'L1_J100.31ETA49_FIRSTEMPTY':415, 
-        #'L1_TE60.0ETA24':416, 
-        'L1_TE70.0ETA24':417, 
-        'L1_TE40.0ETA24':418, 
-
-        # 3 x ZDC
-        'L1_ZDC_A':419,
-        'L1_ZDC_C':420,
-        'L1_ZDC_AND':421, 
-        'L1_ZDC_A_C':422, 
-        
-#ATR-13743        'L1_ALFA_ELAST1'  : 424,
-#        'L1_ALFA_ELAST2'  : 425,
-#        'L1_ALFA_ELAST11' : 426,
-#        'L1_ALFA_ELAST12' : 427,
-#        'L1_ALFA_ELAST13' : 428,
-#        'L1_ALFA_ELAST14' : 429,
-#        'L1_ALFA_ELAST15' : 430,
-#        'L1_ALFA_ELAST15_Calib' : 431,
-#        'L1_ALFA_ELAST16' : 432,
-#        'L1_ALFA_ELAST17' : 433,
-#        'L1_ALFA_ELAST18' : 434,
-#        'L1_ALFA_ELAST18_Calib' : 435,
-#        'L1_ALFA_SDIFF5' : 436,
-#        'L1_ALFA_SDIFF6' : 437,
-#        'L1_ALFA_SDIFF7' : 438,
-#        'L1_ALFA_SDIFF8' : 439,
-#        'L1_MBTS_1_A_ALFA_C' : 440,
-#        'L1_MBTS_1_C_ALFA_A' : 441,
-#        'L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO' : 442,
-#        'L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO' : 443,
-#        'L1_MBTS_2_A_ALFA_C' : 444,
-#        'L1_MBTS_2_C_ALFA_A' : 445,
-#        'L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO' : 446,
-#        'L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO' : 447,
-#        'L1_LUCID_A_ALFA_C' : 448,
-#        'L1_LUCID_C_ALFA_A' : 449,
-#        'L1_LUCID_A_ALFA_C_UNPAIRED_ISO' : 450,
-#        'L1_LUCID_C_ALFA_A_UNPAIRED_ISO' : 451,
-#        'L1_EM3_ALFA_ANY' : 452,
-#        'L1_EM3_ALFA_ANY_UNPAIRED_ISO' : 453,
-#        'L1_EM3_ALFA_EINE' :   454,
-#        'L1_ALFA_ELASTIC_UNPAIRED_ISO' : 455,
-#        'L1_ALFA_ANTI_ELASTIC_UNPAIRED_ISO' : 456,
-#        'L1_ALFA_ANY_A_EMPTY' : 457,
-#        'L1_ALFA_ANY_C_EMPTY' : 458,
-#        'L1_J12_ALFA_ANY' : 459,
-#        'L1_J12_ALFA_ANY_UNPAIRED_ISO' : 460,
-#        'L1_TE5_ALFA_ANY' : 461,
-#        'L1_TE5_ALFA_ANY_UNPAIRED_ISO' : 462,
-#        'L1_TE5_ALFA_EINE' : 463,
-#        'L1_TRT_ALFA_ANY' : 464,
-#        'L1_TRT_ALFA_ANY_UNPAIRED_ISO' : 465,
-#        'L1_TRT_ALFA_EINE' :   466,
-##        'L1_LHCF_ALFA_ANY_A' : 467,
-##        'L1_LHCF_ALFA_ANY_C' : 468,
-##        'L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO' : 469,
-##        'L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO' : 470,
-#        
-#        'L1_ALFA_BGT' : 471,
-#        'L1_ALFA_BGT_UNPAIRED_ISO' : 472,
-#        'L1_ALFA_BGT_BGRP10' : 473,
-#        'L1_ALFA_SHOWSYST5' : 474,
-#        'L1_ALFA_SYST9'  : 475,
-#        'L1_ALFA_SYST10' : 476,
-#        'L1_ALFA_SYST11' : 477,
-#        'L1_ALFA_SYST12' : 478,
-#        'L1_ALFA_SYST17' : 479,
-#        'L1_ALFA_SYST18' : 480,
-#        'L1_ALFA_ANY' : 481,
-#        'L1_ALFA_ANY_EMPTY' : 482,
-#        'L1_ALFA_ANY_FIRSTEMPTY' : 483,
-#        'L1_ALFA_ANY_UNPAIRED_ISO' : 484,
-#        'L1_ALFA_ANY_UNPAIRED_NONISO' : 485,
-#        'L1_ALFA_ANY_BGRP10' : 486,
-#        'L1_ALFA_ANY_ABORTGAPNOTCALIB' : 487,
-#        'L1_ALFA_ANY_CALIB' : 488,
-         'L1_ALFA_B7L1U' : 489,
-         'L1_ALFA_ANY' : 490,
-         'L1_ALFA_A7L1U' : 491,
-         'L1_ALFA_A7L1L' : 492,
-         'L1_ALFA_A7R1U' : 493,
-         'L1_ALFA_A7R1L' : 494,
-         'L1_ALFA_B7R1U' : 495,
-         'L1_ALFA_B7R1L' : 496,
-
-        
-#        'L1_ALFA_B7L1U_OD' : 497,
-#        'L1_ALFA_B7L1L_OD' : 498,
-#        'L1_ALFA_A7L1U_OD' : 499,
-#        'L1_ALFA_A7L1L_OD' : 500,
-#        'L1_ALFA_A7R1U_OD' : 501,
-#        'L1_ALFA_A7R1L_OD' : 502,
-#        'L1_ALFA_B7R1U_OD' : 503,
-#        'L1_ALFA_B7R1L_OD' : 504,
-#        'L1_ALFA_B7L1_OD'  : 505,
-#        'L1_ALFA_A7L1_OD'  : 506,
-#        'L1_ALFA_B7R1_OD'  : 507,
-#        'L1_ALFA_A7R1_OD'  : 508,
-        'L1_CALREQ2' : 511,  # never use 509-511 for anything else than CALREQ triggers
+        'L1_TAU60_DR-TAU20ITAU12I' : 76,
+        'L1_SC111-CJ15' : 356,
+        #'L1_LFV-EM8I-MU11' : 138,
+        #'L1_LFV-EM12I-MU6' : 139,
+        'L1_BPH-0M10-3MU4' : 143,
+        'L1_ZAFB-04DPHI-EM15I' : 152,
+        'L1_ZAFB-25DPHI-EM15I' : 157,
+        #'L1_ZAFB-25DPHI-EM18I' : 158,
+        'L1_DPHI-M70-2EM12I' : 159,
+        #'L1_DY-DR-2MU4' : 315,
+        'L1_DY-BOX-2MU6' : 318,
+        'L1_DY-BOX-2MU4' : 160,
+        'L1_CEP-CJ60' : 162,
+        'L1_CEP-CJ50' : 164,
+        'L1_BPH-8M15-2MU4-BO' : 165,
+        'L1_CALREQ2' : 511,
+
+        #ATR-21371
+        'L1_ALFA_B7L1U' : 489,
+        'L1_ALFA_ANY'   : 490,
+        'L1_ALFA_A7L1U' : 491,
+        'L1_ALFA_A7L1L' : 492,
+        'L1_ALFA_A7R1U' : 493,
+        'L1_ALFA_A7R1L' : 494,
+        'L1_ALFA_B7R1U' : 495,
+        'L1_ALFA_B7R1L' : 496,
 }
 
 
-- 
GitLab


From 33ea0cfeaf2e7c25c1171005e90c26c12e71a133 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Tue, 25 Aug 2020 04:26:57 +0200
Subject: [PATCH 111/422] update

---
 .../LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py    | 1459 +++++++++++------
 1 file changed, 989 insertions(+), 470 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
index b7241c319298..f32fe825deb0 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 def defineMenu():
     """
@@ -38,13 +38,14 @@ def defineMenu():
         # SLOT 7 / CON 0,1 (EM1,2)
         #-------------------------
         
- 
         # 16 x EM
         'EM3', 'EM7', 'EM8VH',
-        'EM10VH', 'EM12', 'EM15', 'EM15VH',
-        'EM15VHI',
-        'EM18VHI', 'EM20VH', 'EM20VHI', 'EM22VH', 'EM22VHI', 'EM24VHI', 'EM24VHIM', 'EM30VHI', 
-        # 1 x ZB/
+        'EM8I',
+        'EM10VH', 'EM12', 'EM13VH', 'EM15', 'EM15VH',
+        'EM15HI',
+        'EM18VH', 'EM20VH', 'EM20VHI', 'EM22VHI', 'EM24VHI', 'EM26VHI', 
+
+        # 1 x ZB
         'ZB_EM15',
 
         #--------------------------
@@ -52,8 +53,7 @@ def defineMenu():
         #--------------------------
 
         # 16 x TAU
-        'HA5', 'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA15', 'HA20', 'HA20IL', 'HA20IM', 'HA25', 'HA25IM', 'HA30', 'HA40', 'HA60', 'HA90', 'HA100',
- 
+        'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA12IT', 'HA15', 'HA20', 'HA20IL',  'HA20IM', 'HA20IT', 'HA25', 'HA25IT', 'HA30', 'HA40', 'HA60', 'HA100', 
 
         #----------------------
         # SLOT 8 / CON 0 (JET1)
@@ -61,11 +61,9 @@ def defineMenu():
         # 10 x 3-bit JET (can have multiplicity 4 or more)
 
         # 8 x JETs and central jets
-        'J12', 'J12.0ETA23', 'J15', 'J15.0ETA25','J20', 'J25','J25.0ETA23','J30',
-        # 2 x Central Jets
-         'J12.0ETA28', #'J12.0ETA25',
-
-        # VBF Jets
+        'J12', 'J15', 'J15.0ETA25','J20', 'J25','J25.0ETA23','J30', 'J40',
+        
+        # 2 x VBF
         'J20.0ETA49', 'J30.0ETA49',
 
 
@@ -75,33 +73,37 @@ def defineMenu():
         # 15 x 2-bit JET (can have maximum multiplicity of 3) (SLOT 8, CON 1)
 
         # 3 x Central Jet
-        'J35.0ETA23','J40.0ETA25', #'J20.28ETA31',
-
-        # 6 Jets # replace J400 with J45.0ETA20 - ATR-19309
-        'J40', 'J50', 'J75', 'J85', 'J100', 'J45.0ETA20',  'J400', #'J120',
+        'J35.0ETA23','J40.0ETA25', 'J20.28ETA31',
 
+        # 6 Jets
+        'J50', 'J75', 'J85', 'J100', 'J120', 'J400',
 
         # 6 x FJ              
-        'J15.31ETA49', 'J20.31ETA49', 'J30.31ETA49', 'J50.31ETA49', 'J75.31ETA49', 
- 
+        'J15.31ETA49', 'J20.31ETA49', 'J30.31ETA49', 'J50.31ETA49', 'J75.31ETA49', 'J100.31ETA49', 
 
 
         #---------------------
-        # SLOT 8 / CON 2 (EN1) 
+        # SLOT 8 / CON 2 (EN1)
         #---------------------
         # 24 x 1-bit thresholds
-
+        
         # 8 x TE
-        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE50',
-    
+        #'TE3', 'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40',
+        #'TE5', 'TE30', 'TE40', 'TE45', 'TE50', 'TE55', 'TE60', 'TE65',
+        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE70',
+
         # 8 x XE (for standard XE)
+        #'XE35', 'XE40', 'XE45', 'XE50', 'XE55', 'XE60', 'XE70', 'XE80',
+        # 8 x XE (for restricted ETA XE: check ATR-13234 for any further change)
+        #'XE10', 'XE20', 'XE25', 'XE30', 'XE65', 'XE75', 'XE150', 'XE300',
+
         'XE10', 'XE20', 'XE25', 'XE30', 'XE35', 'XE40', 'XE45', 'XE50',
         'XE55', 'XE60', 'XE65', 'XE70', 'XE75', 'XE80', 'XE150', 'XE300',
         
         # 8 x XS
         'XS20', 'XS30', 'XS40', 'XS45', 'XS50', 'XS55', 'XS60', 'XS65', 
 
- 
+
         #---------------------
         # SLOT 8 / CON 3 (EN2)
         #---------------------
@@ -111,18 +113,18 @@ def defineMenu():
         #'RXE35', 'RXE40', 'RXE45', 'RXE50', 'RXE55', 'RXE60', 'RXE70', 'RXE80', # FTHR
 
         # 8 x restricted eta range
-        #'TE5.24ETA49', 'TE10.24ETA49', 'TE15.24ETA49', 'TE20.24ETA49', 'TE25.24ETA49', 'TE30.24ETA49', 'TE40.24ETA49', 'TE70.24ETA49',
-
-
+        #'TE3.0ETA24', 'TE5.0ETA24','TE10.0ETA24', 'TE15.0ETA24', 'TE20.0ETA24', 'TE25.0ETA24', 'TE30.0ETA24', 'TE40.0ETA24',
+        #'TE5.0ETA24', 'TE30.0ETA24','TE40.0ETA24', 'TE45.0ETA24', 'TE50.0ETA24', 'TE55.0ETA24', 'TE60.0ETA24', 'TE65.0ETA24',
+        'TE5.0ETA24', 'TE10.0ETA24', 'TE15.0ETA24', 'TE20.0ETA24', 'TE25.0ETA24', 'TE30.0ETA24', 'TE40.0ETA24', 'TE70.0ETA24',
 
         #------------------------
-        # SLOT 9 / CON 0 (MUCTPi) 
+        # SLOT 9 / CON 0 (MUCTPi)
         #------------------------
         
         # 6 x MU
-        'MU4', 'MU6', 'MU10', 'MU11', 'MU20', 'MU21',
+        'MU4', 'MU6', 'MU10', 'MU11', 'MU15', 'MU20',
+
 
-        
         #------------------------
         # SLOT 9 / CON 1 (CTPCal)
         #------------------------
@@ -151,8 +153,6 @@ def defineMenu():
         # 3 x CALREQ
         'CAL0','CAL1','CAL2',
 
- 
-
         #-----------------------------
         # SLOT 9 / CON 2,3 (NIM1,NIM2)
         #-----------------------------
@@ -160,13 +160,11 @@ def defineMenu():
         # 2 x MBTS
         'MBTS_A', 'MBTS_C',
 
-        # 32 x MBTSSI (all FTHR)
-        # NOTE: THESE ARE OUT OF ORDER FOR A REASON! Do not change!
-        # The order defines the mapping - see ATR-17870.
-        'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4', 'MBTS_A5', 'MBTS_A6', 'MBTS_A7',
-        'MBTS_A8', 'MBTS_A10', 'MBTS_A12', 'MBTS_A14', 'MBTS_A9', 'MBTS_A11','MBTS_A13', 'MBTS_A15',
-        'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4', 'MBTS_C5', 'MBTS_C6', 'MBTS_C7',
-        'MBTS_C8', 'MBTS_C10', 'MBTS_C12', 'MBTS_C14', 'MBTS_C11', 'MBTS_C13','MBTS_C9','MBTS_C15',
+        # 24 x MBTSSI (all FTHR)
+        'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4'  , 'MBTS_A5', 'MBTS_A6', 'MBTS_A7', 
+        'MBTS_A8', 'MBTS_A10', 'MBTS_A12' , 'MBTS_A14',
+        'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4'  , 'MBTS_C5', 'MBTS_C6', 'MBTS_C7', 
+        'MBTS_C8', 'MBTS_C10', 'MBTS_C12' , 'MBTS_C14',
 
         # L1A for CTP monitoring itself
         'NIML1A',
@@ -184,317 +182,394 @@ def defineMenu():
         'NIMTRT',
 
         # AFP
-        'AFP_NSC', 'AFP_NSA',
-        #'AFP_FSA_SIT', 'AFP_FSA_TOF', 'AFP_FSA_LOG',
-        #'AFP_FSC_SIT', 'AFP_FSC_LOG', 'AFP_FSC_TOF',
+        'AFP_NSC', 'AFP_FSC',
 
-        
         #-------------------------------------------------------------------
         #L1 TOPO inputs 
         #-------------------------------------------------------------------
-
-        #B-jets
-        #'BTAG-MU4J15',
-        #'BTAG-MU6J20',
-
+        
         #HT
+        'HT190-AJ15all.ETA21',
         'HT190-J15s5.ETA21',
+        'HT150-AJ20all.ETA31',
         'HT150-J20s5.ETA31',
 
         
 
         #ZH 
-        '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', 
-
+        '10MINDPHI-AJ20s2-XE50', '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', '10MINDPHI-J20ab-XE50', '10MINDPHI-CJ20ab-XE50', 
         #Jpsi T&P
-         '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',        
-
-        #W T&P - all were commented out
- 
+        '1INVM5-EMs1-EMs6', '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',        
+
+        #W T&P
+        '05MINDPHI-AJj10s6-XE0',
+        '10MINDPHI-AJj10s6-XE0',
+        '15MINDPHI-AJj10s6-XE0',
+        '05MINDPHI-EM12s6-XE0',
+        '15MINDPHI-EM12s6-XE0',
+        '05MINDPHI-EM15s6-XE0',
+        '15MINDPHI-EM15s6-XE0',
+        '05RATIO-XE0-HT0-AJj15all.ETA49',
+        '90RATIO2-XE0-HT0-AJj15all.ETA49',
+        '250RATIO2-XE0-HT0-AJj15all.ETA49',
+        'HT20-AJj15all.ETA49',
+        'NOT-02MATCH-EM10s1-AJj15all.ETA49',
+        '25MT-EM12s6-XE0',
+        '35MT-EM12s6-XE0',
+        '35MT-EM15s6-XE0',
+        #'10MINDPHI-AJj15s2-XE0',
+        #'20MINDPHI-AJjs6-XE0',
+        #'20MINDPHI-AJj15s2-XE0',
+        #'10MINDPHI-EM6s1-XE0',
+        #'20MINDPHI-EM9s6-XE0',
+        #'20MINDPHI-EM6s1-XE0',
+        #'05RATIO-XE0-HT0-AJj15all.ETA49',
+        #'08RATIO-XE0-HT0-AJj0all.ETA49',
+        #'40RATIO2-XE0-HT0-AJj15all.ETA49',
+        #'90RATIO2-XE0-HT0-AJj0all.ETA49',
+        #'HT20-AJj0all.ETA49',
+        #'NOT-02MATCH-EM9s1-AJj15all.ETA49',
+        #'05RATIO-XE0-SUM0-EM9s1-HT0-AJj15all.ETA49',
+        #'20MT-EM6s6-XE0',
+        #'30MT-EM6s6-XE0',
+        #'40MT-EM6s6-XE0',
         
         # central muon
         'MULT-CMU4ab',
         'MULT-CMU6ab',
         
-
+        #B-jet
+        '0DR04-MU4ab-CJ15ab', '0DR04-MU4ab-CJ20ab', '0DR04-MU4ab-CJ30ab', '0DR04-MU6ab-CJ20ab', '0DR04-MU6ab-CJ25ab',
         #B-physics
-        '0DR03-EM7ab-CJ15ab',
- 
+#SX        '2DR15-2MU4ab', 
+#SX        '2INVM999-2MU4ab', 
+#SX        '4INVM8-2MU4ab',
+        '2DR15-2MU6ab', 
+#SX        '2INVM999-2MU6ab', 
+#SX        '4INVM8-2MU6ab',
 
         # L1 thresholds for L1Topo streamers
-        #'2DR99_2MU4ab',
+#SX        '2INVM999-CMU4ab-MU4ab',
+#SX        '2INVM999-2CMU4ab',
+#SX        '2INVM999-MU6ab-MU4ab',
+#SX        '2INVM999-ONEBARREL-MU6ab-MU4ab',
+#SX        '2INVM999-CMU6ab-CMU4ab',
+#SX        '4INVM8-CMU4ab-MU4ab',
+#SX        '4INVM8-2CMU4ab',
+#SX        '4INVM8-MU6ab-MU4ab',
+#SX        '4INVM8-ONEBARREL-MU6ab-MU4ab',
+#SX        '4INVM8-CMU6ab-CMU4ab',        
+        '2DR99-2MU4ab',
         '5DETA99-5DPHI99-MU6ab-MU4ab',
         '5DETA99-5DPHI99-2MU6ab',
+        '0DR10-MU10ab-MU6ab',
         '0DR15-2MU6ab',
+#        '0DETA04-0DPHI03-EM8abi-MU10ab',
         '0DETA04-EM8abi-MU10ab',
         '0DPHI03-EM8abi-MU10ab',
+#        '0DETA04-0DPHI03-EM15abi-MUab',
         '0DETA04-EM15abi-MUab',
         '0DPHI03-EM15abi-MUab',
-        #'800INVM9999-AJ30s6-AJ20s6',
+        '10MINDPHI-AJ20s2-XE50',
+        '10MINDPHI-J20s2-XE50',
+        '10MINDPHI-J20ab-XE50',
+        '10MINDPHI-CJ20ab-XE50',
+        '900INVM9999-AJ30s6-AJ20s6',
+        '800INVM9999-AJ30s6-AJ20s6',
         '700INVM9999-AJ30s6-AJ20s6',
+        '500INVM9999-AJ30s6-AJ20s6',
+        '400INVM9999-AJ30s6-AJ20s6',
+        #'350INVM9999-AJ30s6-AJ20s6',
         '300INVM9999-AJ30s6-AJ20s6',
-        #'400INVM9999-AJ30s6-AJ20s6',
-        '500INVM9999-J30s6-AJ20s6',
-        #'100INVM9999-AJ30s6-AJ20s6',
-        '0DETA20-J50s1-Js2',
-        '27DPHI32-EMs1-EMs6',
-        #'HT150-AJj15all.ETA49',
-        #'0MATCH-4AJ20.ETA31-4AJj15.ETA31',
+        '200INVM9999-AJ30s6-AJ20s6',
+        '100INVM9999-AJ30s6-AJ20s6',
+        #'350INVM9999-J30s6-J20s6',
+        #'300INVM9999-J30s6-J20s6',
+        #'250INVM9999-J30s6-J20s6',
+        #'200INVM9999-J30s6-J20s6',
+        'HT150-AJj15all.ETA49',
+        '0MATCH-4AJ20.ETA31-4AJj15.ETA31',
         '100RATIO-0MATCH-TAU30si2-EMall',
-        'NOT-0MATCH-TAU30si1-EMall',
-        #'1DISAMB-TAU12abi-J25ab',
-        #'1DISAMB-EM15his2-TAU12abi-J25ab',
-        '2DISAMB-TAU12abi-J25ab',
-        '2DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
-        #'0DR28-MU10ab-TAU12abi',  # add back if needed
-        #'1DISAMB-TAU20abi-TAU12abi-J25ab',
+        'NOT-0MATCH-TAU30si2-EMall',
+        '0DR28-MU10ab-TAU12abi',
+        '1DISAMB-TAU12abi-J25ab',
+        '1DISAMB-EM15his2-TAU12abi-J25ab',
+        'DISAMB-0DR28-EM15his2-TAU12abi',
+        '1DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
+        '1DISAMB-TAU20abi-TAU12abi-J25ab',
         '0DR25-TAU20abi-TAU12abi',
         '0DR28-TAU20abi-TAU12abi',
-        '2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
-        '2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
+        '0DETA20-0DPHI20-TAU20abi-TAU12abi',
+        '1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
+        '1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
         'DISAMB-30INVM-EM20his2-TAU12ab',
         '400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49',
-
-        '0INVM9-EM7ab-EMab',
-        '400INVM9999-0DPHI20-J30s6-AJ20s6',
-        '400INVM9999-0DPHI22-J30s6-AJ20s6',
-        '400INVM9999-0DPHI24-J30s6-AJ20s6',
-        '400INVM9999-0DPHI26-J30s6-AJ20s6',
+        'LAR-EM50s1',
+        'LAR-J100s1',
+#SX        '2DR15-CMU4ab-MU4ab',
+#SX        '2DR15-2CMU4ab',
+#SX        '2DR15-MU6ab-MU4ab',
+#SX        '2DR15-ONEBARREL-MU6ab-MU4ab',
+#SX        '2DR15-CMU6ab-CMU4ab',
+
+        '2INVM9-2MU6ab',
+        '7INVM15-2MU4ab', 
+        '2INVM8-ONEBARREL-MU6ab-MU4ab', 
+        '0DR24-2CMU4ab', 
+        '0DR22-2MU6ab',
+        '0DR34-2MU4ab', 
+        '0DR24-2MU4ab', 
+        '0DR24-CMU4ab-MU4ab',  
+        '2INVM8-CMU4ab-MU4ab',
+        '0DR15-2MU4ab',  
+        '0DR15-MU6ab-MU4ab',  
+        '0DR22-MU6ab-MU4ab', 
+        '8INVM15-MU6ab-MU4ab',  
+        '8INVM15-2MU6ab', 
+        '2INVM8-2MU4ab',  # ATR-15197 '2INVM9-2MU4ab',
+        '2INVM8-MU6ab-MU4ab', # ATR-15197 '2INVM9-MU6ab-MU4ab',
+        '2INVM9-2MU4ab',
+        '2INVM9-MU6ab-MU4ab',
+        'KF-XE40-AJall',
+        'KF-XE50-AJall',
+        'KF-XE55-AJall',
+        'KF-XE60-AJall',
+        'KF-XE65-AJall',
+        'KF-XE75-AJall',
 
         'LATE-MU10s1',
         'SC111-CJ15ab.ETA26',
-        
+        'SC85-CJ15ab.ETA26',
         
         # ALFA (the replication is needed to build all the combinations in the CTPCore)
         'ALFA_B7R1L', 'ALFA_B7R1U', 'ALFA_A7R1L', 'ALFA_A7R1U', 'ALFA_A7L1L', 'ALFA_A7L1U', 'ALFA_B7L1L', 'ALFA_B7L1U',
         'ALFA2_B7R1L', 'ALFA2_B7R1U', 'ALFA2_A7R1L', 'ALFA2_A7R1U', 'ALFA2_A7L1L', 'ALFA2_A7L1U', 'ALFA2_B7L1L', 'ALFA2_B7L1U',
         'ALFA3_B7R1L', 'ALFA3_B7R1U', 'ALFA3_A7R1L', 'ALFA3_A7R1U', 'ALFA3_A7L1L', 'ALFA3_A7L1U', 'ALFA3_B7L1L', 'ALFA3_B7L1U',
         'ALFA4_B7R1L', 'ALFA4_B7R1U', 'ALFA4_A7R1L', 'ALFA4_A7R1U', 'ALFA4_A7L1L', 'ALFA4_A7L1U', 'ALFA4_B7L1L', 'ALFA4_B7L1U',
-#ATR-13743      
-        'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
-
-        #ATR-19355
-        '0INVM10-3MU4ab',
-
-        #ATR-18815 - Algorithm needs to be moved to master
-#        '0INVM10-0DR15-EM8abi-MU10ab',
-#        '0INVM10-0DR15-EM12abi-MU6ab',
-
-        #ATR-18824
-        '60INVM9999-25DPHI32-EM15abhi-FJj15s623ETA49',
-        '60INVM9999-04DPHI32-EM15abhi-FJj15s623ETA49',
-        #ATR-19302
-        '0INVM70-27DPHI32-EM12his1-EM12his6',
-
-        #ATR-19720
-        #'8INVM15-0DR22-2MU6ab',
-        #'2INVM9-2DR15-2MU6ab',
-        #'2INVM9-0DR15-MU6ab-MU4ab',
-        #'8INVM15-0DR22-MU6ab-MU4ab',
-        #'2INVM9-0DR15-2MU4ab',
-
-        #ATR-19510
-        '5DETA99-5DPHI99-2MU4ab',
-            
-        #ATR-17320
-        'CEP-CJ60s6',
-        'CEP-CJ50s6',
-       
-        #ATR-20174
-        '8INVM15-2CMU4ab'
+#ATR-13743        'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
 
-        
-    ]
+
+        ]
 
     
     Lvl1Flags.items = [
 
+        
         # single EM
 
         'L1_EM3','L1_EM7','L1_EM12', 'L1_EM8VH',
-        'L1_EM10VH', 'L1_EM15',
-        'L1_EM30VHI',
-        'L1_EM15VHI',
-        'L1_EM24VHIM','L1_EM15VH', 'L1_EM18VHI', 'L1_EM20VH', 'L1_EM20VHI', 'L1_EM22VHI', 'L1_EM22VH','L1_EM24VHI', 
-        'L1_EM3_EMPTY', 'L1_EM7_EMPTY', 'L1_EM7_UNPAIRED_ISO', 'L1_EM7_FIRSTEMPTY',
+#        'L1_EM8I',
+        'L1_EM10VH', 'L1_EM13VH', 'L1_EM15',
+        'L1_EM15I','L1_EM15HI',
+        'L1_EM26VHI','L1_EM15VH', 'L1_EM18VH', 'L1_EM20VH', 'L1_EM20VHI', 'L1_EM22VHI', 'L1_EM24VHI', # see Jira ATR-10334'L1_EM22VHLIL', #'L1_EM50V',
+        'L1_EM3_EMPTY', 'L1_EM7_EMPTY', 'L1_EM7_UNPAIRED_ISO', 'L1_EM7_FIRSTEMPTY','L1_EM7_UNPAIRED_NONISO',
         'L1_EM20VH_FIRSTEMPTY',
+        'L1_EM22VHI_FIRSTEMPTY',
+        #'L1_EM15_BGRP7',
 
+        # see savannah https://savannah.cern.ch/bugs/?103935
 
-        # combined EM -jet - all commented
+        # combined EM -jet
+        #'L1_JJ15.23ETA49', # 4x4 window
 
         # single MU
-        "L1_MU4", "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU20", "L1_MU21",
-        
-        "L1_MU4_EMPTY", "L1_MU6_EMPTY", "L1_MU4_FIRSTEMPTY", "L1_MU11_EMPTY",
-        'L1_MU4_UNPAIRED_ISO',
+        "L1_MU4", "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU15", "L1_MU20",
 
+        "L1_MU4_EMPTY", "L1_MU6_EMPTY", "L1_MU4_FIRSTEMPTY", "L1_MU11_EMPTY",
+        'L1_MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_NONISO',
+         'L1_MU20_FIRSTEMPTY',
 
         
+        
         # multi lepton
-        "L1_2EM3", "L1_2EM7",
-        "L1_2EM15", "L1_2EM15VH", "L1_2EM15VHI",
-        "L1_2EM20VH",
-        "L1_EM20VH_3EM10VH", 
+        "L1_2EM3", "L1_2EM7", "L1_2EM10VH", "L1_2EM13VH", "L1_2EM15", "L1_2EM15VH", "L1_EM7_2EM3", "L1_EM12_2EM3", "L1_EM15VH_3EM7", "L1_EM15VH_3EM8VH", "L1_EM15VH_2EM10VH_3EM7",
+        "L1_2EM18VH", "L1_2EM20VH", "L1_EM15VH_3EM10VH", "L1_EM18VH_3EM8VH", "L1_EM18VH_2EM10VH_3EM7", "L1_EM20VH_3EM10VH", "L1_EM20VH_2EM10VH_3EM8VH",
         "L1_EM7_MU10",
-        "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY",  "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4", "L1_2MU11", "L1_MU11_2MU10",
-        "L1_2EM8VH_MU10", "L1_EM15VH_MU10",  "L1_EM7_MU20", "L1_EM8VH_MU20",
+        "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY", "L1_MU10_2MU6", "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4",
+
+        "L1_EM8I_MU10", "L1_EM15I_MU4", "L1_2EM8VH_MU10", "L1_EM15VH_MU10", 
+
 
         # single tau
-        "L1_TAU5", "L1_TAU12", "L1_TAU12IM",   "L1_TAU20IM",
-        "L1_TAU30","L1_TAU30_EMPTY","L1_TAU30_UNPAIRED_ISO", "L1_TAU40", "L1_TAU60", "L1_TAU90", "L1_TAU100", "L1_TAU8_EMPTY", 
-        "L1_TAU8_UNPAIRED_ISO","L1_TAU8_FIRSTEMPTY",
+        "L1_TAU12", "L1_TAU12IM",  "L1_TAU20", "L1_TAU20IM",
+        "L1_TAU30","L1_TAU30_EMPTY","L1_TAU30_UNPAIRED_ISO", "L1_TAU40", "L1_TAU60", "L1_TAU100", "L1_TAU8", "L1_TAU8_EMPTY", 
+        "L1_TAU8_UNPAIRED_ISO","L1_TAU8_FIRSTEMPTY","L1_TAU8_UNPAIRED_NONISO",
 
         # multi tau
-        "L1_TAU20IM_2TAU12IM",   "L1_TAU60_2TAU40", "L1_2TAU5", "L1_2TAU8",
+        "L1_TAU20IM_2TAU12IM", "L1_TAU20_2TAU12", "L1_TAU40_2TAU20IM",
 
         # combined tau - lepton
-        "L1_EM15VHI_2TAU12IM",          
-        "L1_EM15VHI_2TAU12IM_J25_3J12",   
-        "L1_EM15VHI_2TAU12IM_4J12",
-        "L1_EM15VHI_TAU40_2TAU15",
+        "L1_EM15HI_2TAU12IM",          
+        "L1_EM15HI_2TAU12IM_J25_3J12",   
+        "L1_EM15HI_TAU40_2TAU15",
         "L1_MU10_TAU12IM",  
-        "L1_MU10_TAU12IM_J25_2J12",
-        "L1_MU10_TAU12IM_3J12",
-        #'L1_DR-MU10TAU12I_TAU12I-J25',
+        "L1_MU10_TAU12IM_J25_2J12", 
+#        "L1_MU10_TAU12_J25_2J12", 
+#        "L1_MU10_TAU20",
         "L1_MU10_TAU20IM",
         "L1_MU11_TAU20IM",
         "L1_MU10_TAU20IM_J25_2J20",
 
         # combined tau - jet
+#        "L1_TAU25IT_2TAU12IT_2J25_3J12", 
 
-        "L1_TAU20IM_2TAU12IM_J25_2J20_3J12",
-        "L1_TAU20IM_2TAU12IM_4J12.0ETA23",
-        #"L1_TAU20IM_2TAU12IM_4J12.0ETA25",
-        "L1_TAU20IM_2TAU12IM_4J12.0ETA28",
-        "L1_TAU25IM_2TAU20IM_2J25_3J20", 
-
+        "L1_TAU20IM_2TAU12IM_J25_2J20_3J12", 
+        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I',  
+        'L1_DR-MU10TAU12I_TAU12I-J25', 
+        "L1_MU10_TAU12I-J25",
 
 
         # combined tau - xe
         "L1_TAU20IM_2J20_XE45", 
-        "L1_TAU20IM_2J20_XE50", 
-
+#        "L1_TAU20_2J20_XE45", 
+#        "L1_TAU20IM_2J20_XE50",   
 
         #"L1_EM15HI_2TAU12I_XE35", 
-        "L1_EM15VHI_2TAU12IM_XE35", 
+        "L1_EM15HI_2TAU12IM_XE35", 
+        "L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15",
         'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20',
 
 
         "L1_MU10_TAU12IM_XE35",  
+#        "L1_MU10_TAU12IM_XE40",  
 
         "L1_TAU20IM_2TAU12IM_XE35", 
+        "L1_TAU20_2TAU12_XE35",
         "L1_TAU40_2TAU12IM_XE40",  
 
 
 
         # combined em - jet
-        'L1_EM18VHI_3J20',
-        'L1_EM20VH_3J20',
-
-        
+        #'L1_EM15VH_J15.23ETA49',
+#        'L1_EM15VH_JJ15.23ETA49',
+        'L1_EM13VH_3J20',
+        'L1_EM18VH_3J20',
 
         # combined mu - jet
-        'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
+        'L1_MU4_J12',  'L1_MU4_J50_XE40', 'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
+#ATR-13743        'L1_MU4_J30',
+        #'L1_MU4_J50',
         'L1_MU10_2J20','L1_MU10_3J20', 'L1_MU10_2J15_J20',
+        'L1_2MU4_J40_XE20',
         'L1_MU20_J40',
         'L1_MU20_XE30',
-        'L1_MU20_J50',
 
         # single jet
-        "L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100",  "L1_J400", #"L1_J120",
-        "L1_J20.31ETA49", "L1_J30.31ETA49", "L1_J50.31ETA49", "L1_J75.31ETA49", 
-        'L1_J15.31ETA49',
+        "L1_J12","L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100", "L1_J120", "L1_J400",
+        "L1_J20.31ETA49", "L1_J30.31ETA49", "L1_J50.31ETA49", "L1_J75.31ETA49", "L1_J100.31ETA49",
+        #'L1_J15.23ETA49',
+         'L1_J15.31ETA49',
+        "L1_J20.28ETA31",
+        #'L1_J40.0ETA25', 
         "L1_J12_EMPTY","L1_J12_FIRSTEMPTY", "L1_J12_UNPAIRED_ISO", "L1_J12_UNPAIRED_NONISO", "L1_J12_ABORTGAPNOTCALIB", 
         "L1_J15.31ETA49_UNPAIRED_ISO",
         "L1_J30_EMPTY", "L1_J30_FIRSTEMPTY", "L1_J30.31ETA49_EMPTY", "L1_J30.31ETA49_UNPAIRED_ISO",
         "L1_J30.31ETA49_UNPAIRED_NONISO",
         "L1_J50_UNPAIRED_ISO", "L1_J50_UNPAIRED_NONISO", "L1_J50_ABORTGAPNOTCALIB",         
+        "L1_J12_BGRP12", "L1_J30.31ETA49_BGRP12",
         'L1_J100_FIRSTEMPTY',
- 
+        'L1_J100.31ETA49_FIRSTEMPTY',
         
         # multi jet
-        "L1_J45.0ETA20_3J15.0ETA25",
-        "L1_J50_2J40.0ETA25_3J15.0ETA25",
-        "L1_3J50", "L1_4J15", "L1_4J20", #"L1_4J20.0ETA49",
+
+        "L1_J20_J20.31ETA49",
+        "L1_3J15", "L1_3J20","L1_3J40", 'L1_3J15.0ETA25', "L1_3J50", "L1_4J15", "L1_4J20",
+        "L1_4J20.0ETA49",
         "L1_3J15.0ETA25_XE40",
         
+        #"L1_3J75",
+        #"L1_4J30",
         "L1_6J15",
+        "L1_J75_3J20",
         "L1_J85_3J30",
-       # multi jet forward
-        "L1_J25.0ETA23_2J15.31ETA49",
+        "L1_J30.0ETA49_2J20.0ETA49",
+
+        "L1_J15.0ETA25_2J15.31ETA49",
         "L1_J40.0ETA25_2J15.31ETA49",
         "L1_J40.0ETA25_2J25_J20.31ETA49",
-        "L1_J30.0ETA49_2J20.0ETA49",
+        "L1_J40.0ETA25_2J30_J20.31ETA49",
         
         # multi jet central
         "L1_3J25.0ETA23",
         "L1_3J35.0ETA23",
         "L1_4J15.0ETA25",
         "L1_5J15.0ETA25", 
+        
         # combined jet
-        "L1_2J15_XE55", "L1_J40_XE50",
+        "L1_2J15_XE55", "L1_J40_XE50", "L1_J75_XE50",
 
         #'L1_2J40_XE45',
-        "L1_2J50_XE40", "L1_J40_XE60",
-        
+        "L1_2J50_XE40", "L1_J40_XE60","L1_J40.0ETA25_XE50",
 
         # XE
         "L1_XE35", "L1_XE40", "L1_XE45", "L1_XE50", 
         "L1_XE55", "L1_XE60", "L1_XE70", "L1_XE80",
-        'L1_XE30', 'L1_XE300',
-        "L1_XE10",
+        'L1_XE10', 'L1_XE30', 'L1_XE65', 'L1_XE75', 'L1_XE150', 'L1_XE300',
         
         #XS
+        'L1_XS20', 'L1_XS30',
         'L1_EM12_XS20', 'L1_EM15_XS30',
         
         # TE
-#        'L1_TE5', ## disabled?
+        #"L1_TE3",        "L1_TE5",        "L1_TE10",        "L1_TE15",        "L1_TE20",        "L1_TE25",        "L1_TE30",        "L1_TE40",
+        #"L1_TE5",        "L1_TE30",        "L1_TE40",        "L1_TE45",        "L1_TE50",        "L1_TE55",        "L1_TE60",        "L1_TE65",
+        "L1_TE5",        "L1_TE10",        "L1_TE15",   "L1_TE20",  "L1_TE25",  "L1_TE30",        "L1_TE40",      "L1_TE70",      
 
-        #VTE + MBTS
-        #"L1_MBTS_1_VTE2", "L1_MBTS_1_VTE3", "L1_MBTS_1_VTE4", "L1_MBTS_1_VTE5", "L1_MBTS_1_VTE10", "L1_MBTS_2_VTE2", "L1_MBTS_2_VTE3", "L1_MBTS_2_VTE4", "L1_MBTS_2_VTE5", "L1_MBTS_2_VTE10", 
-        
-        #TE + MU
+        #"L1_TE3.0ETA24", "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", 
+        #"L1_TE5.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", "L1_TE45.0ETA24", "L1_TE50.0ETA24", "L1_TE55.0ETA24", "L1_TE60.0ETA24", "L1_TE65.0ETA24", 
+        "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24","L1_TE70.0ETA24",
 
         # MBTS
+        "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
+        "L1_MBTS_1_EMPTY", "L1_MBTS_1_UNPAIRED_ISO", 
+        "L1_MBTS_2_EMPTY", "L1_MBTS_2_UNPAIRED_ISO",
+        "L1_MBTS_1_1_EMPTY", "L1_MBTS_1_1_UNPAIRED_ISO","L1_MBTS_4_A_UNPAIRED_ISO","L1_MBTS_4_C_UNPAIRED_ISO",
+#        'L1_MBTSA0' ,'L1_MBTSA1' ,'L1_MBTSA2' ,'L1_MBTSA3' ,'L1_MBTSA4' ,
+#        'L1_MBTSA5' ,'L1_MBTSA6' ,'L1_MBTSA7' ,'L1_MBTSA8' ,
+#        'L1_MBTSA10','L1_MBTSA12','L1_MBTSA14',
+#        'L1_MBTSC0' ,'L1_MBTSC1' ,'L1_MBTSC2' ,'L1_MBTSC3' ,'L1_MBTSC4' ,
+#        'L1_MBTSC5' ,'L1_MBTSC6' ,'L1_MBTSC7' ,'L1_MBTSC8' ,
+#        'L1_MBTSC10','L1_MBTSC12','L1_MBTSC14',
         # beam splashes
-        
-        #Overlay
-#        "L1_MBTS_1_OVERLAY","L1_TE20_OVERLAY",
-        
-        #BeamSpot
-#        "L1_MBTS_1_VTE70",
+        "L1_MBTS_4_A", "L1_MBTS_4_C",
 
         #BGRP9
+        'L1_MBTS_1_BGRP9','L1_MBTS_2_BGRP9',
 
         #BGRP11
+        'L1_MBTS_1_BGRP11','L1_MBTS_2_BGRP11',
 
         # RNDM
-        'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO',  'L1_RD0_EMPTY',
-        "L1_RD1_EMPTY","L1_RD2_EMPTY",
-#        'L1_RD0_FIRSTEMPTY', 
-        'L1_RD0_ABORTGAPNOTCALIB',
-#        'L1_RD2_FILLED', # This is not needed?
+        'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO','L1_RD0_EMPTY',
+        "L1_RD1_FILLED","L1_RD1_EMPTY","L1_RD1_BGRP10",
+        "L1_RD2_FILLED","L1_RD2_EMPTY","L1_RD2_BGRP12",
+        "L1_RD3_FILLED","L1_RD3_EMPTY",
+        'L1_RD0_FIRSTEMPTY', 
+        'L1_RD0_BGRP9', 'L1_RD0_BGRP11', 'L1_RD0_ABORTGAPNOTCALIB',
 
         #LUCID
-#        'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
+        'L1_LUCID', 'L1_LUCID_EMPTY', 'L1_LUCID_UNPAIRED_ISO', 
+        'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
         #'L1_LUCID_COMM_EMPTY', 'L1_LUCID_COMM_UNPAIRED_ISO', 
 
-        
-
         # ZDC
-         # FTHR
+        'L1_ZDC_A', 'L1_ZDC_C', 'L1_ZDC_A_C',
+        'L1_ZDC_AND', # FTHR
 
         # VDM
-         #"L1_BGRP7",
+        'L1_BGRP9', #"L1_BGRP7",
 
         # TRT
         # "L1_TRT",
+        "L1_TRT_FILLED",
+        "L1_TRT_EMPTY",
 
         # TGC
         "L1_TGC_BURST",
 #        "L1_TGC_BURST_EMPTY",
 
         # LHCF
+        "L1_LHCF", "L1_LHCF_UNPAIRED_ISO", "L1_LHCF_EMPTY",
     
         #CALREQ
         "L1_CALREQ2",
@@ -503,124 +578,244 @@ def defineMenu():
         "L1_ZB",
 
         # BPTX
+        "L1_BPTX0_BGRP0", "L1_BPTX1_BGRP0",
         
         # BCM
-         #'L1_BCM_AC_CA_UNPAIRED_ISO',
-        'L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO',
+        'L1_BCM_Wide_BGRP0','L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO', 'L1_BCM_AC_CA_UNPAIRED_ISO',
         'L1_BCM_AC_UNPAIRED_ISO','L1_BCM_CA_UNPAIRED_ISO',
         'L1_BCM_AC_UNPAIRED_NONISO','L1_BCM_CA_UNPAIRED_NONISO',
         'L1_BCM_AC_ABORTGAPNOTCALIB', 'L1_BCM_CA_ABORTGAPNOTCALIB','L1_BCM_Wide_ABORTGAPNOTCALIB',
         'L1_BCM_AC_CALIB', 'L1_BCM_CA_CALIB','L1_BCM_Wide_CALIB',
 
         #AFP
-#         'L1_AFP_FSC', 
-#        'L1_AFP_C_ANY', 'L1_AFP_C_ANY_UNPAIRED_ISO', 'L1_AFP_C_ANY_UNPAIRED_NONISO', 'L1_AFP_C_ANY_EMPTY', 'L1_AFP_C_ANY_FIRSTEMPTY', 'L1_AFP_C_AND',
+        'L1_AFP_NSC', 'L1_AFP_FSC', 
+        'L1_AFP_C_ANY', 'L1_AFP_C_ANY_UNPAIRED_ISO', 'L1_AFP_C_ANY_UNPAIRED_NONISO', 'L1_AFP_C_ANY_EMPTY', 'L1_AFP_C_ANY_FIRSTEMPTY', 'L1_AFP_C_AND',
 
-#	'L1_EM7_AFP_A_AND_C','L1_EM12_AFP_A_AND_C',
-
-
-          #--------------------------------
+        #--------------------------------
         # TOPO items
         #--------------------------------
 
         # B-jet
-        #'L1_BTAG-MU4J15',
-        #'L1_BTAG-MU6J20',
-
-        # ZH - all removed
-   
-
-        #Higgsino
-        'L1_2MU4_J40_XE50',
-        'L1_MU4_J30_XE40_DPHI-J20s2XE30','L1_MU4_J50_XE50_DPHI-J20s2XE30',
-        'L1_MU4_XE60',
+        'L1_BTAG-MU4J15', 'L1_BTAG-MU4J30', 'L1_BTAG-MU6J20', 'L1_BTAG-MU6J25',
+        #'L1_BTAG-MU4J20',
+        'L1_3J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J30', 'L1_3J15_BTAG-MU6J25', 'L1_3J20_BTAG-MU4J20',
+        #'L1_3J20_BTAG-MU4J30', 'L1_3J20_BTAG-MU6J25',
+
+        # ZH
+        'L1_DPHI-AJ20s2XE50', 'L1_J40_DPHI-J20s2XE50', 'L1_J40_DPHI-J20XE50', 'L1_J40_DPHI-CJ20XE50', #'L1_J40_DPHI-J20s2XE30',
+#SX        'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B',
+#SX        'L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B',
+#SX        'L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO',
+#SX        'L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO',
 
         # HT
+        'L1_HT190-J15.ETA21',
         'L1_HT190-J15s5.ETA21',
+        'L1_HT150-J20.ETA31',
+        'L1_HT150-J20s5.ETA31',   
 
+        "L1_HT150-J20s5.ETA31_MJJ-400",
         "L1_HT150-J20s5.ETA31_MJJ-400-CF",
         
         # Jpsi T&P
-        'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
-#            
+        'L1_JPSI-1M5', 'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
+        'L1_KF-XE40', 'L1_KF-XE50', 'L1_KF-XE55', 'L1_KF-XE60', 'L1_KF-XE65', 'L1_KF-XE75',
         
-        # W T&P - all removed
-
+        # W T&P
+#        'L1_W-05DPHI-JXE-0',
+#        'L1_W-10DPHI-JXE-0',
+#        'L1_W-15DPHI-JXE-0',
+#        'L1_W-05DPHI-EMXE-1',
+        #'L1_W-15DPHI-EMXE-1',
+#        'L1_W-05DPHI-EM15XE-1',
+        #'L1_W-15DPHI-EM15XE-1',
+        'L1_W-05RO-XEHT-0',
+        'L1_W-90RO2-XEHT-0',
+        'L1_W-250RO2-XEHT-0',
+        'L1_W-HT20-JJ15.ETA49',
+        'L1_W-NOMATCH',
+        #'L1_W-NOMATCH_W-05RO-XEEMHT',
+        'L1_EM12_W-MT25',
+#        'L1_EM12_W-MT35',
+        'L1_EM15_W-MT35',
+        'L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE',
+        'L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE',
+        'L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE',
+        'L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE',
+        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+        'L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+        'L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+        'L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+        'L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+        'L1_EM12_W-MT35_XS50',
+        'L1_EM15_W-MT35_XS60',
+        'L1_EM10VH_W-MT35_XS50',
+        'L1_EM15VH_W-MT35_XS60',
+        'L1_EM20VH_W-MT35_XS60',
+        'L1_EM22VHI_W-MT35_XS40',
+        # Old
+        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0',
+        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
+        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE',
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+        #'L1_W-10DPHI-JXE-0',
+        #'L1_W-20DPHI-JXE-1',
+        #'L1_W-20DPHI-JXE-0',
+        #'L1_W-20DPHI-EMXE-1',
+        #'L1_W-20DPHI-EMXE-0',
+        #'L1_W-05RO-XEHT-0',
+        #'L1_W-08RO-XEHT-1',
+        #'L1_W-40RO2-XEHT-0',
+        #'L1_W-90RO2-XEHT-1',
+        #'L1_W-HT20-JJ0.ETA49',
+        #'L1_W-NOMATCH',
+        #'L1_W-NOMATCH_W-05RO-XEEMHT',
+        #'L1_EM3_W-MT20',
+        #'L1_EM3_W-MT40',
+
+        #Bphysics items
+#SX        'L1_BPH-DR-2MU4', 
+#SX        'L1_BPH-2M-2MU4', 
+#SX        'L1_BPH-4M8-2MU4',
+#SX        'L1_BPH-DR-2MU4_BPH-2M-2MU4', 'L1_BPH-DR-2MU4_BPH-4M8-2MU4',
+
+#SX        'L1_BPH-DR-2MU6', 
+#SX        'L1_BPH-2M-2MU6', 'L1_BPH-4M8-2MU6',
+#SX        'L1_BPH-DR-2MU6_BPH-2M-2MU6', 'L1_BPH-DR-2MU6_BPH-4M8-2MU6',
+
+        # temporarily commented out until CTP Simulation is fixed (menu generation and TMC understand multiplicity topo)
+#SX uncommenting
+        'L1_2MU4-BO',
+        'L1_2MU6-BO',
+        'L1_MU6MU4-BO', 
+
+        # L1 items for L1Topo streamers
+#SX        'L1_BPH-2M-2MU4-B',
+#SX        'L1_BPH-2M-2MU4-BO',
+#SX        'L1_BPH-2M-MU6MU4',
+#SX        'L1_BPH-2M-MU6MU4-B',
+#SX        'L1_BPH-2M-MU6MU4-BO',    
+#SX        'L1_BPH-4M8-2MU4-B',
+#SX        'L1_BPH-4M8-2MU4-BO',
+#SX        'L1_BPH-4M8-MU6MU4',
+#SX        'L1_BPH-4M8-MU6MU4-B',        
+#SX        'L1_BPH-4M8-MU6MU4-BO',
+        'L1_DY-DR-2MU4',
+        'L1_EM15VH_2EM8VH_MU6',
+        #'L1_DY-BOX-MU6MU4',
+        'L1_DY-BOX-2MU6',
+        'L1_LFV-MU',
         'L1_LFV-MU6',
-        'L1_LFV-MU11',
         'L1_LFV-EM8I',
         'L1_LFV-EM15I',
+        'L1_EM7_MU15',
+        'L1_EM8VH_MU15',
         'L1_DPHI-J20s2XE50',
         'L1_J40_XE50_DPHI-J20s2XE50',
+        'L1_DPHI-J20XE50',
+        'L1_DPHI-CJ20XE50',
+        'L1_MU4_J20_XE30_DPHI-J20s2XE30',
         'L1_2MU4_J20_XE30_DPHI-J20s2XE30',
+        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30',
+        'L1_3EM3_J40_XE50_DPHI-J20s2XE50',
+        'L1_MJJ-900',
+        'L1_MJJ-800',
         'L1_MJJ-700',
-        'L1_MJJ-300',
-        #'L1_MJJ-100',
-        #'L1_MJJ-400',
-        #'L1_MJJ-800',
-        'L1_MJJ-500-NFF',
-        'L1_J50_DETA20-J50J',
-        'L1_DPHI-2EM3',
-        #'L1_HT150-JJ15.ETA49',
-        #'L1_HT150-JJ15.ETA49_MJJ-400',
-        #'L1_J4-MATCH',
+        'L1_MJJ-400',
+        #'L1_MJJ-350',
+#        'L1_MJJ-300',
+#        'L1_MJJ-200',
+        'L1_MJJ-100',
+        'L1_HT150-JJ15.ETA49',
+        'L1_HT150-JJ15.ETA49_MJJ-400',
+        'L1_J4-MATCH',
         'L1_LLP-RO',
-        #'L1_LLP-NOMATCH',
-        #'L1_EM15TAU12I-J25',
-        'L1_DR-EM15TAU12I-J25',
-        #'L1_TAU20ITAU12I-J25',
+        'L1_LLP-NOMATCH',
+        'L1_DR-MU10TAU12I',    
+#        'L1_TAU12I-J25',    
+        'L1_EM15TAU12I-J25',
+        'L1_DR-EM15TAU12I',    
+        'L1_DR-EM15TAU12I-J25',    
+        'L1_TAU20ITAU12I-J25',
         'L1_DR-TAU20ITAU12I',    
+        'L1_BOX-TAU20ITAU12I',
         'L1_DR-TAU20ITAU12I-J25',
-        #'L1_DR-MU10TAU12I',
 
+        'L1_DR25-TAU20ITAU12I',
+        'L1_DR25-TAU20ITAU12I-J25',
         'L1_30M-EM20ITAU12',
         'L1_MJJ-400-CF',
     
-        #'L1_LAR-EM',
-        #'L1_LAR-J',
-        #'L1_LAR-ZEE',
-        #'L1_LAR-ZEE_LAR-EM',
-        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
-        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
-        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',
-        #'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO',
-
-        #ATR-19720 - no algorithm in master
-#        'L1_BPH-8M15-0DR22-2MU6',
-#        'L1_BPH-2M9-2DR15-2MU6',
-#        'L1_BPH-2M9-0DR15-MU6MU4',
-#        'L1_BPH-8M15-0DR22-MU6MU4-BO',
-#        'L1_BPH-2M9-0DR15-2MU4',
-#
-#        'L1_BPH-0M9-EM7-EM5',        
-#        'L1_BPH-0DR3-EM7J15',
-#        'L1_BPH-0M9-EM7-EM5_MU6',
-#        'L1_BPH-0DR3-EM7J15_MU6',
-#        'L1_BPH-0M9-EM7-EM5_2MU4',
-#        'L1_BPH-0DR3-EM7J15_2MU4',
-#
+        'L1_LAR-EM',
+        'L1_LAR-J',
+#SX        'L1_BPH-DR-2MU4-B',
+#SX        'L1_BPH-DR-2MU4-BO',
+#SX        'L1_BPH-DR-MU6MU4',
+#SX        'L1_BPH-DR-MU6MU4-B',
+#SX        'L1_BPH-DR-MU6MU4-BO',
+
+#new bhysics
+        #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4',
+        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
+        'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4',
+        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4', # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
+        'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
+        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',
+        'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',
+        'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',
+        'L1_2MU4-B',
+        'L1_2MU6-B' ,
+        #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4',
+        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4' ,
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B' ,
+        #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4' ,
+        #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4' ,
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO' ,
+        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+        'L1_MU6_2MU4-B',
+
+        'L1_BPH-2M8-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4',
+        'L1_BPH-8M15-MU6MU4',
+        'L1_BPH-8M15-2MU6',
+        
         # combined L1Topo for VBF
+        'L1_MU6_MJJ-200',
+        'L1_MU6_MJJ-300',
+        'L1_MU6_MJJ-400',
+        'L1_MU6_MJJ-500',
+        'L1_J30_2J20_4J20.0ETA49_MJJ-400',
+        'L1_J30_2J20_4J20.0ETA49_MJJ-700',
+        'L1_J30_2J20_4J20.0ETA49_MJJ-800',
+        'L1_J30_2J20_4J20.0ETA49_MJJ-900',
+        'L1_3J20_4J20.0ETA49_MJJ-400',
+        'L1_3J20_4J20.0ETA49_MJJ-700',
+        'L1_3J20_4J20.0ETA49_MJJ-800',
+        'L1_3J20_4J20.0ETA49_MJJ-900',
         
-        # INVM + DPHI 
-        #'L1_MJJ-400-NFF-0DPHI20',
-        'L1_MJJ-400-NFF-0DPHI22',
-        'L1_MJJ-400-NFF-0DPHI24',
-        'L1_MJJ-400-NFF-0DPHI26',
+        'L1_XE35_MJJ-200',
    
         ### ATR-15062
-        'L1_EM18VHI_MJJ-300',
+        'L1_EM18VH_MJJ-300',
 
-        'L1_LATE-MU10_XE50','L1_LATE-MU10_XE40', 'L1_LATE-MU10_J50',
+        'L1_LATE-MU10_XE50', 'L1_LATE-MU10_J50',
 
         'L1_TAU60_DR-TAU20ITAU12I',
 
-        'L1_SC111-CJ15',
-#        'L1_SC85-CJ15',
+        'L1_SC111',
+        'L1_SC85',
         
         ##     # Partition 1
         ##     'L1_CALREQ0_P1', 'L1_CALREQ1_P1', 'L1_CALREQ2_P1',
 
         #ALFA
+#ALFA_B7R1L_OD        'L1_ALFA_ELAST1',
+#        'L1_ALFA_ELAST2',
+#        'L1_ALFA_ELAST11','L1_ALFA_ELAST12',
+#        'L1_ALFA_ELAST13','L1_ALFA_ELAST14','L1_ALFA_ELAST15','L1_ALFA_ELAST15_Calib',
+#        'L1_ALFA_ELAST16','L1_ALFA_ELAST17','L1_ALFA_ELAST18','L1_ALFA_ELAST18_Calib',
 #        'L1_ALFA_SDIFF5','L1_ALFA_SDIFF6','L1_ALFA_SDIFF7','L1_ALFA_SDIFF8',
 #        'L1_MBTS_1_A_ALFA_C','L1_MBTS_1_C_ALFA_A','L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO',
 #        'L1_MBTS_2_A_ALFA_C','L1_MBTS_2_C_ALFA_A','L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO',
@@ -634,106 +829,64 @@ def defineMenu():
 #
 #        'L1_EM3_ALFA_EINE',
 #        'L1_J12_ALFA_ANY','L1_J12_ALFA_ANY_UNPAIRED_ISO',
-#        'L1_TE5_ALFA_ANY','L1_TE5_ALFA_ANY_UNPAIRED_ISO',
-#         'L1_TE5_ALFA_EINE',
+#        'L1_TE5_ALFA_ANY','L1_TE5_ALFA_ANY_UNPAIRED_ISO','L1_TE5_ALFA_EINE',
 #        'L1_TRT_ALFA_ANY','L1_TRT_ALFA_ANY_UNPAIRED_ISO',
 #        'L1_TRT_ALFA_EINE',
 #        #'L1_LHCF_ALFA_ANY_A',
 #        #'L1_LHCF_ALFA_ANY_C',
 ##        'L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO','L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO',
-#        'L1_ALFA_BGT','L1_ALFA_BGT_UNPAIRED_ISO',
-#        'L1_ALFA_ANY_A_EMPTY','L1_ALFA_ANY_C_EMPTY',
+#        'L1_ALFA_BGT','L1_ALFA_BGT_UNPAIRED_ISO','L1_ALFA_BGT_BGRP10',
+#        'L1_ALFA_SHOWSYST5',
+#        'L1_ALFA_SYST9' ,'L1_ALFA_SYST10','L1_ALFA_SYST11','L1_ALFA_SYST12',
+#        'L1_ALFA_SYST17','L1_ALFA_SYST18',
          'L1_ALFA_ANY',
+#        'L1_ALFA_ANY_EMPTY','L1_ALFA_ANY_FIRSTEMPTY','L1_ALFA_ANY_UNPAIRED_ISO','L1_ALFA_ANY_UNPAIRED_NONISO',
+#        'L1_ALFA_ANY_BGRP10','L1_ALFA_ANY_ABORTGAPNOTCALIB','L1_ALFA_ANY_CALIB',
+        'L1_ALFA_B7L1U','L1_ALFA_B7L1L','L1_ALFA_A7L1U','L1_ALFA_A7L1L','L1_ALFA_A7R1U','L1_ALFA_A7R1L','L1_ALFA_B7R1U','L1_ALFA_B7R1L',
+#        'L1_ALFA_ANY_A_EMPTY','L1_ALFA_ANY_C_EMPTY',
+#        'L1_ALFA_B7L1U_OD','L1_ALFA_B7L1L_OD','L1_ALFA_A7L1U_OD','L1_ALFA_A7L1L_OD','L1_ALFA_A7R1U_OD','L1_ALFA_A7R1L_OD','L1_ALFA_B7R1U_OD','L1_ALFA_B7R1L_OD',
+#        'L1_ALFA_B7L1_OD','L1_ALFA_A7L1_OD','L1_ALFA_B7R1_OD','L1_ALFA_A7R1_OD',
 #
-#         'L1_AFP_C_MBTS_A',
-#         'L1_AFP_C_ZDC_C',
-#         'L1_AFP_C_J12',
-#         'L1_AFP_C_EM3',
-#         'L1_AFP_C_TE5',
-#         'L1_AFP_C_ALFA_C',
-#         'L1_AFP_C_ALFA_A',
-#         'L1_AFP_C_ANY_MBTS_A',
-#         'L1_AFP_C_MU4',
-
-        # Items for beta*=90m run
-#        'L1_J12_ALFA_EINE',
-#        'L1_2EM3_ALFA_EINE',
-#        'L1_MU4_ALFA_ANY',
-#        'L1_MU4_ALFA_ANY_UNPAIRED_ISO',
-#        'L1_MU4_ALFA_ANY_PAIRED_UNPAIRED_ISO',
-#        'L1_MU4_ALFA_EINE',
-
-
-        #ATR-18815
-        #'L1_LFV-EM8I-MU11',
-        #'L1_LFV-EM12I-MU6',
-
-        #ATR-19355
-        'L1_BPH-0M10-3MU4',
-
-        #ATR-18824
-        'L1_ZAFB-04DPHI-EM15I',
-        'L1_ZAFB-25DPHI-EM15I',
-        #'L1_ZAFB-25DPHI-EM18I',
-
-        #ATR-19302: 
-#        'L1_DPHI-M70-2EM10I',
-        'L1_DPHI-M70-2EM12I',
-
-        #ATR-19510
-        'L1_DY-BOX-2MU4',
-        #'L1_DY-DR-2MU4',
-        'L1_DY-BOX-2MU6',
-
-                
-        #ATR-17320
-        'L1_CEP-CJ60',
-        'L1_CEP-CJ50' ,
-
-        #ATR-20174
-        'L1_BPH-8M15-2MU4-BO'
-
-
+         'L1_AFP_C_MBTS_A',
+         'L1_AFP_C_ZDC_C',
+         'L1_AFP_C_J12',
+         'L1_AFP_C_EM3',
+         'L1_AFP_C_TE5',
+         'L1_AFP_C_ALFA_C',
+         'L1_AFP_C_ALFA_A',
+         'L1_AFP_C_ANY_MBTS_A',
+         'L1_AFP_C_MU4',
 
         ]
     
 
-    #CTP IDs are taken from this mapping. Every L1 item needs a unique ctpid.
-    # Run this file as python <this file> to print out available IDs
-    # 463-464 are reserved for L1_RD2_BGRP14 and L1_RD3_BGRP15 (from run 2)
-    # 509-511 are reserved for CALREQ
+    # the CTP ID mapping still has to be defined, currently it is taken from the order of the items
+    #Free slot [ATR-14858], 16-08-16
+    #[82,143,377,378,379,406,409,416,480]
 
     
 
     Lvl1Flags.CtpIdMap = {
-
         'L1_EM3' : 0,
         'L1_EM7' : 1,
         'L1_EM12' : 2,
         'L1_EM8VH' : 3,
         'L1_EM10VH' : 4,
+        'L1_EM13VH' : 5,
         'L1_EM15' : 6,
-        'L1_EM30VHI' : 25,
-        'L1_EM15VHI' : 29,
-        'L1_EM24VHIM' : 30,
         'L1_EM15VH' : 7,
-        'L1_EM18VHI' : 8,
+        'L1_EM18VH' : 8,
         'L1_EM20VH' : 9,
         'L1_EM20VHI' : 10,
         'L1_EM22VHI' : 11,
-        'L1_EM22VH' : 295,
-        'L1_EM24VHI' : 392,
         'L1_EM3_EMPTY' : 12,
         'L1_EM7_EMPTY' : 13,
-        'L1_EM7_UNPAIRED_ISO' : 389,
-        'L1_EM7_FIRSTEMPTY' : 371,
-        'L1_EM20VH_FIRSTEMPTY' : 411,
         'L1_MU4' : 14,
         'L1_MU6' : 15,
         'L1_MU10' : 16,
         'L1_MU11' : 256,
+        'L1_MU15' : 17,
         'L1_MU20' : 18,
-        'L1_MU21' : 17,
         'L1_MU4_EMPTY' : 19,
         'L1_MU6_EMPTY' : 66,
         'L1_MU4_FIRSTEMPTY' : 20,
@@ -741,99 +894,103 @@ def defineMenu():
         'L1_MU4_UNPAIRED_ISO' : 22,
         'L1_2EM3' : 23,
         'L1_2EM7' : 24,
+        'L1_2EM10VH' : 25,
+        'L1_2EM13VH' : 26,
         'L1_2EM15' : 27,
         'L1_2EM15VH' : 28,
-        'L1_2EM15VHI' : 31,
-        'L1_2EM20VH' : 400,
-        'L1_EM20VH_3EM10VH' : 431,
-        'L1_EM7_MU10' : 65,
+        'L1_EM7_2EM3' : 29,
+        'L1_EM12_2EM3' : 30,
+        'L1_EM15VH_3EM7' : 31,
+        'L1_2EM18VH':398,
+        'L1_2EM20VH':400,
+        'L1_EM15VH_3EM10VH':401,
+        'L1_EM18VH_3EM8VH':406,
+        'L1_EM18VH_2EM10VH_3EM7':408,
+        'L1_EM20VH_3EM10VH':431, 
+        'L1_EM20VH_2EM10VH_3EM8VH':432,
         'L1_2MU4' : 32,
         'L1_2MU6' : 33,
         'L1_2MU10' : 34,
         'L1_2MU20_OVERLAY' : 35,
+        'L1_MU10_2MU6' : 36,
         'L1_MU11_2MU6' : 37,
         'L1_3MU4' : 38,
         'L1_MU6_2MU4' : 39,
         'L1_3MU6' : 40,
         'L1_4MU4' : 46,
-        'L1_MU6_3MU4' : 36,
-        'L1_2MU6_3MU4' : 42,
-        'L1_2MU11' : 48,
-        'L1_MU11_2MU10' : 49,
+        'L1_4J15.0ETA25' : 41,
+        'L1_EM15I_MU4' : 42,
         'L1_2EM8VH_MU10' : 43,
         'L1_EM15VH_MU10' : 44,
-        'L1_EM7_MU20' : 483,
-        'L1_EM8VH_MU20' : 484,
-        'L1_TAU5' : 50,
         'L1_TAU12' : 45,
         'L1_TAU12IM' : 47,
+        'L1_TAU20' : 49,
         'L1_TAU20IM' : 51,
         'L1_TAU30' : 53,
-        'L1_TAU30_EMPTY' : 341,
-        'L1_TAU30_UNPAIRED_ISO' : 343,
         'L1_TAU40' : 54,
         'L1_TAU60' : 55,
-        'L1_TAU90' : 56,
         'L1_TAU100' : 52,
+        'L1_TAU8' : 56,
         'L1_TAU8_EMPTY' : 57,
-        'L1_TAU8_UNPAIRED_ISO' : 388,
-        'L1_TAU8_FIRSTEMPTY' : 391,
         'L1_TAU20IM_2TAU12IM' : 58,
-        'L1_TAU60_2TAU40' : 458,
-        'L1_2TAU5' : 59,
-        'L1_2TAU8' : 166,
-        'L1_EM15VHI_2TAU12IM' : 60,
-        'L1_EM15VHI_2TAU12IM_J25_3J12' : 61,
-        'L1_EM15VHI_2TAU12IM_4J12' : 5,
-        'L1_EM15VHI_TAU40_2TAU15' : 62,
+        'L1_TAU20_2TAU12' : 59,
+        'L1_EM15HI_2TAU12IM' : 60,
+        'L1_EM15HI_2TAU12IM_J25_3J12' : 61,
+        'L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15' : 378,
+        'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
+        'L1_EM15HI_TAU40_2TAU15' : 62,
         'L1_MU10_TAU12IM' : 63,
         'L1_MU10_TAU12IM_J25_2J12' : 64,
-        'L1_MU10_TAU12IM_3J12' : 482,
+        'L1_EM7_MU10':65,
+        'L1_TAU30_EMPTY':341,
         'L1_MU10_TAU20IM' : 67,
         'L1_MU11_TAU20IM' : 430,
         'L1_MU10_TAU20IM_J25_2J20' : 377,
+
         'L1_TAU20IM_2TAU12IM_J25_2J20_3J12' : 70,
-        'L1_TAU20IM_2TAU12IM_4J12.0ETA23' : 316,
-        #'L1_TAU20IM_2TAU12IM_4J12.0ETA25' : 73,
-        'L1_TAU20IM_2TAU12IM_4J12.0ETA28' : 77,
-        'L1_TAU25IM_2TAU20IM_2J25_3J20' : 398,
+        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I' : 71,
+        'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
+        'L1_MU10_TAU12I-J25' : 73,
         'L1_TAU20IM_2J20_XE45' : 74,
-        'L1_TAU20IM_2J20_XE50' : 79,
-        'L1_EM15VHI_2TAU12IM_XE35' : 78,
-        'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
+        'L1_TAU30_UNPAIRED_ISO' :343,
+        'L1_TAU60_DR-TAU20ITAU12I' : 76,
+        'L1_EM15HI_2TAU12IM_XE35' : 78,
         'L1_MU10_TAU12IM_XE35' : 81,
+#        'L1_MU10_TAU12IM_XE40' : 82,
         'L1_TAU20IM_2TAU12IM_XE35' : 83,
+        'L1_TAU20_2TAU12_XE35' : 84,
         'L1_TAU40_2TAU12IM_XE40' : 429,
-        'L1_EM18VHI_3J20' : 172,
-        'L1_EM20VH_3J20' : 26,
+#        'L1_EM15VH_JJ15.23ETA49' : 86,
+        'L1_MU4_J12' : 87,
+        'L1_MU4_J50_XE40' : 330,
         'L1_MU6_J20' : 88,
-        'L1_MU6_J30.0ETA49_2J20.0ETA49' : 382,
         'L1_MU6_J40' : 89,
         'L1_MU6_J75' : 90,
-        'L1_MU10_2J20' : 278,
-        'L1_MU10_3J20' : 173,
-        'L1_MU10_2J15_J20' : 255,
-        'L1_MU20_J40' : 428,
+        'L1_2MU4_J40_XE20' : 331,
+        'L1_MU20_J40'  : 428,
         'L1_MU20_XE30' : 433,
-        'L1_MU20_J50' : 82,
+        'L1_J12' : 91,
         'L1_J15' : 92,
         'L1_J20' : 93,
         'L1_J25' : 94,
         'L1_J30' : 95,
+        
         'L1_J40' : 96,
         'L1_J50' : 97,
         'L1_J75' : 98,
         'L1_J85' : 99,
         'L1_J100' : 100,
-        #'L1_J120' : 101,
+        'L1_J120' : 101,
         'L1_J400' : 102,
-        #'L1_4J20.0ETA49' : 383,
         'L1_J20.31ETA49' : 103,
         'L1_J30.31ETA49' : 104,
         'L1_J50.31ETA49' : 105,
         'L1_J75.31ETA49' : 106,
+        'L1_J100.31ETA49' : 107,
+#        'L1_J40.0ETA25' : 108,
+        
         'L1_J15.31ETA49' : 109,
-        'L1_J30.0ETA49_2J20.0ETA49' : 137,
+        'L1_J20.28ETA31' : 110,
         'L1_J12_EMPTY' : 111,
         'L1_J12_FIRSTEMPTY' : 112,
         'L1_J12_UNPAIRED_ISO' : 113,
@@ -848,27 +1005,43 @@ def defineMenu():
         'L1_J50_UNPAIRED_ISO' : 121,
         'L1_J50_UNPAIRED_NONISO' : 122,
         'L1_J50_ABORTGAPNOTCALIB' : 123,
-        'L1_J100_FIRSTEMPTY' : 414,
-        'L1_J45.0ETA20_3J15.0ETA25' : 86,
-        'L1_J50_2J40.0ETA25_3J15.0ETA25' : 87,
+
+        'L1_J20_J20.31ETA49' : 125,
+        'L1_3J15' : 126,
+        'L1_3J20' : 127,
+        'L1_3J40' : 128,
+        'L1_3J15.0ETA25' : 129,
         'L1_3J50' : 130,
         'L1_4J15' : 131,
         'L1_4J20' : 132,
         'L1_3J15.0ETA25_XE40' : 184,
+        
+#        'L1_3J75' : 133,
+#        'L1_4J30' : 134,
         'L1_6J15' : 135,
+        'L1_J75_3J20' : 136,
         'L1_J85_3J30' : 480,
-        'L1_J25.0ETA23_2J15.31ETA49' : 335,
-        'L1_J40.0ETA25_2J15.31ETA49' : 181,
-        'L1_J40.0ETA25_2J25_J20.31ETA49' : 182,
-        'L1_3J25.0ETA23' : 373,
-        'L1_3J35.0ETA23' : 425,
-        'L1_4J15.0ETA25' : 41,
+        'L1_J30.0ETA49_2J20.0ETA49' : 137,
+
+       
+        'L1_TE10' : 138,
+        'L1_TE15' : 82,
+        'L1_TE25' : 143,
+
         'L1_5J15.0ETA25' : 140,
         'L1_2J15_XE55' : 141,
         'L1_J40_XE50' : 142,
-        'L1_2J50_XE40' : 175,
-        'L1_J40_XE60' : 176,
+        #'L1_J75_XE40' : 143,
+        'L1_J75_XE50' : 133,
+
         'L1_XE10': 68,
+        #'L1_XE25': 82,
+        'L1_XE30': 85,
+        'L1_XE65': 108,
+        'L1_XE75': 134,
+        'L1_XE150': 156,
+        'L1_XE300': 187,
+        
         'L1_XE35' : 144,
         'L1_XE40' : 145,
         'L1_XE45' : 146,
@@ -877,23 +1050,129 @@ def defineMenu():
         'L1_XE60' : 149,
         'L1_XE70' : 150,
         'L1_XE80' : 151,
-        'L1_XE30' : 85,
-        'L1_XE300' : 187,
+        'L1_XS20' : 152,
+        'L1_XS30' : 153,
         'L1_EM12_XS20' : 154,
         'L1_EM15_XS30' : 155,
+
+        'L1_TE30' : 157,
+        'L1_TE40' : 158,
+        'L1_TE70' : 159,
+        'L1_TE30.0ETA24' : 160,
+        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
+        'L1_BCM_AC_CA_UNPAIRED_ISO' : 162,
+        'L1_BCM_AC_UNPAIRED_ISO' : 163,
+        'L1_MBTS_1_EMPTY' : 164,
+        'L1_MBTS_1_UNPAIRED_ISO' : 165,
+        'L1_MBTS_2_EMPTY' : 166,
+        'L1_MBTS_2_UNPAIRED_ISO' : 167,
+        'L1_MBTS_1_1_EMPTY' : 168,
+        'L1_MBTS_1_1_UNPAIRED_ISO' : 169,
+
+        'L1_DPHI-AJ20s2XE50' : 171,
+        'L1_EM13VH_3J20' : 172,
+        'L1_EM18VH_3J20' : 295,
+        'L1_MU10_3J20' : 173,
+
+        'L1_2J50_XE40' : 175,
+        'L1_J40_XE60' : 176,
+        'L1_J40.0ETA25_XE50' : 177,
+        'L1_MU10_2J20' : 278,
+        'L1_TAU40_2TAU20IM' : 254,
+        'L1_MU10_2J15_J20' : 255,
+# freeing some CTPIDs  
+#        'L1_MBTSA0' : 170,
+#        'L1_MBTSA1' : 171,
+#        'L1_MBTSA2' : 172,
+#        'L1_MBTSA3' : 173,
+#        'L1_MBTSA4' : 174,
+#        'L1_MBTSA5' : 175,
+#        'L1_MBTSA6' : 176,
+#        'L1_MBTSA7' : 177,
+#        'L1_MBTSA8' : 178,
+#        'L1_MBTSA10' : 179,
+#        'L1_MBTSA12' : 180,
+#        'L1_MBTSA14' : 181,
+#        'L1_MBTSC0' : 182,
+#        'L1_MBTSC1' : 183,
+#        'L1_MBTSC2' : 184,
+#        'L1_MBTSC3' : 185,
+#        'L1_MBTSC4' : 186,
+#        'L1_MBTSC5' : 187,
+#        'L1_MBTSC6' : 188,
+#        'L1_MBTSC7' : 189,
+#        'L1_MBTSC8' : 190,
+#        'L1_MBTSC10' : 191,
+#        'L1_MBTSC12' : 192,
+#        'L1_MBTSC14' : 193,
+
+        
+        'L1_BPH-2M8-2MU4' : 178, # ATR-15197 'L1_BPH-2M9-2MU4' : 178,
+        'L1_BPH-8M15-MU6MU4' : 179,
+        'L1_BPH-8M15-2MU6' : 180,
+        'L1_J15.0ETA25_2J15.31ETA49': 305 , 
+        'L1_J40.0ETA25_2J15.31ETA49' : 181,
+        'L1_J40.0ETA25_2J25_J20.31ETA49' : 182,
+
+        "L1_J40.0ETA25_2J30_J20.31ETA49":250 , 
+
+        "L1_HT150-J20s5.ETA31_MJJ-400": 272 , ## noid(ea)
+        "L1_HT150-J20s5.ETA31_MJJ-400-CF": 273,
+        
+        ## the ctp ids are a mess.. no 7 consequetive ids are free.. but these here are:
+        'L1_AFP_C_MBTS_A':183,
+        'L1_AFP_C_ZDC_C':189,
+        'L1_AFP_C_J12':190,
+        'L1_AFP_C_EM3':191,
+        'L1_AFP_C_TE5':192,
+        'L1_AFP_C_ALFA_C':193,
+        'L1_AFP_C_ALFA_A':170,
+        'L1_AFP_C_ANY_MBTS_A':174,
+        'L1_AFP_C_MU4':379,   
+        
+#        'L1_EM8I' : 183,
+#        'L1_EM15I': 184,
+        'L1_MBTS_4_A_UNPAIRED_ISO' : 185,
+        'L1_MBTS_4_C_UNPAIRED_ISO' : 186,        
+        'L1_MBTS_4_A' : 194,
+        'L1_MBTS_4_C' : 195,
+        'L1_MBTS_1_BGRP9' : 196,
+        'L1_MBTS_2_BGRP9' : 197,
+        'L1_MBTS_1_BGRP11' : 198,
+        'L1_MBTS_2_BGRP11' : 199,
         'L1_RD0_FILLED' : 200,
         'L1_RD0_UNPAIRED_ISO' : 201,
         'L1_RD0_EMPTY' : 202,
+        'L1_RD1_FILLED' : 203,
         'L1_RD1_EMPTY' : 204,
+        'L1_RD1_BGRP10' : 188,
+        'L1_RD2_FILLED' : 205,
         'L1_RD2_EMPTY' : 206,
-        'L1_RD0_ABORTGAPNOTCALIB' : 372,
+        'L1_RD3_FILLED' : 207,
+        'L1_RD3_EMPTY' : 208,
+        'L1_RD0_FIRSTEMPTY' : 209,
+        'L1_RD0_BGRP9' : 210,
+        'L1_RD0_BGRP11' : 211,
+        'L1_LUCID' : 212,
+        'L1_LUCID_EMPTY' : 213,
+        'L1_LUCID_UNPAIRED_ISO' : 214,
+        'L1_LUCID_A_C_EMPTY' : 215,
+        'L1_LUCID_A_C_UNPAIRED_ISO' : 216,
+        'L1_LUCID_A_C_UNPAIRED_NONISO' : 217,
+        'L1_TRT_FILLED' : 218,
+        'L1_TRT_EMPTY' : 219,
         'L1_TGC_BURST' : 220,
-        'L1_ZB' : 240,
+#        'L1_TGC_BURST_EMPTY' : 184,
+        'L1_LHCF' : 221,
+        'L1_BCM_Wide_BGRP0' : 222,
         'L1_BCM_AC_CA_BGRP0' : 223,
         'L1_BCM_Wide_EMPTY' : 224,
         'L1_BCM_Wide_UNPAIRED_ISO' : 225,
-        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
-        'L1_BCM_AC_UNPAIRED_ISO' : 163,
+        'L1_MBTS_1' : 226,
+        'L1_MBTS_2' : 227,
+        'L1_MBTS_1_1' : 228,
+        
+      
         'L1_BCM_CA_UNPAIRED_ISO' : 229,
         'L1_BCM_AC_UNPAIRED_NONISO' : 230,
         'L1_BCM_CA_UNPAIRED_NONISO' : 231,
@@ -903,98 +1182,338 @@ def defineMenu():
         'L1_BCM_AC_CALIB' : 235,
         'L1_BCM_CA_CALIB' : 236,
         'L1_BCM_Wide_CALIB' : 237,
-        #'L1_BTAG-MU4J15' : 238,
-        #'L1_BTAG-MU6J20' : 243,
-        'L1_2MU4_J40_XE50' : 449,
-        'L1_MU4_J30_XE40_DPHI-J20s2XE30' : 452,
-        'L1_MU4_J50_XE50_DPHI-J20s2XE30' : 453,
-        'L1_MU4_XE60' : 454,
+        'L1_BTAG-MU4J15' : 238,
+        'L1_BTAG-MU4J30' : 239,
+        'L1_ZB' : 240,
+        'L1_BPTX0_BGRP0' : 241,
+        'L1_BPTX1_BGRP0' : 242,
+        'L1_BTAG-MU6J20' : 243,
+        'L1_BTAG-MU6J25' : 244,
+#        'L1_BTAG-MU4J20' : 245,
+        'L1_3J15_BTAG-MU4J15' : 246,
+        'L1_3J15_BTAG-MU4J30' : 247,
+        'L1_3J15_BTAG-MU6J25' : 248,
+        'L1_3J20_BTAG-MU4J20' : 249,
+#        'L1_J40_DPHI-Js2XE50' : 250,
+        'L1_J40_DPHI-J20s2XE50' : 251,
+        #'L1_J40_DPHI-J20s2XE30' : 257,
+        'L1_J40_XE50_DPHI-J20s2XE50': 245,
+        'L1_J40_DPHI-J20XE50' : 252,
+        'L1_J40_DPHI-CJ20XE50' : 253,
+        'L1_MU4_J20_XE30_DPHI-J20s2XE30' : 257,
+        'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
+        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30' : 434,
+        'L1_3EM3_J40_XE50_DPHI-J20s2XE50' : 435,
+#SX
+#        'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B' : 254,
+#        'L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B' : 255,
+#        'L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO' : 256,
+#        'L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO' : 257,
+
+        
+        'L1_HT190-J15.ETA21' : 258,
         'L1_HT190-J15s5.ETA21' : 259,
-        'L1_HT150-J20s5.ETA31_MJJ-400-CF' : 91,
+        'L1_HT150-J20.ETA31' : 260,
+        'L1_HT150-J20s5.ETA31' : 261,
+        'L1_JPSI-1M5' : 262,
         'L1_JPSI-1M5-EM7' : 263,
         'L1_JPSI-1M5-EM12' : 264,
+        'L1_KF-XE40' : 265,
+        'L1_KF-XE50' : 266,
+        'L1_KF-XE55' : 267,
+        'L1_KF-XE60' : 268,
+        'L1_KF-XE65' : 269,
+        'L1_KF-XE75' : 270,
+#        'L1_W-05DPHI-JXE-0' : 271,
+#        'L1_W-10DPHI-JXE-0' : 272,
+#        'L1_W-15DPHI-JXE-0' : 273,
+        #'L1_W-15DPHI-EMXE-1' : 271,
+        #'L1_W-15DPHI-EM15XE-1' : 272,
+#        'L1_W-05DPHI-EMXE-1' : 276,
+        'L1_W-05RO-XEHT-0' : 277,
+        'L1_W-90RO2-XEHT-0' : 279,
+        'L1_W-250RO2-XEHT-0' : 280,
+        'L1_W-HT20-JJ15.ETA49' : 281,
+        'L1_W-NOMATCH' : 282,
+        #'L1_W-NOMATCH_W-05RO-XEEMHT' : 283,
+        'L1_EM10_W-MT25' : 284,
+        'L1_EM15_W-MT35' : 286,
+        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0' : 287,
+        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30' : 288,
+        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20' : 289,
+        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE' : 290,
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_W-250RO2-XEHT-0' : 291,
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS60' : 292,
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS30' : 293,
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE' : 294,
+#SX
+#        'L1_BPH-DR-2MU4' : 295,
+#        'L1_BPH-2M-2MU4' : 296,
+#        'L1_BPH-4M8-2MU4' : 297,
+#        'L1_BPH-DR-2MU4_BPH-2M-2MU4' : 298,
+#        'L1_BPH-DR-2MU4_BPH-4M8-2MU4' : 299,
+#        'L1_BPH-DR-2MU6' : 300,
+#        'L1_BPH-2M-2MU6' : 301,
+#        'L1_BPH-4M8-2MU6' : 302,
+#        'L1_BPH-DR-2MU6_BPH-2M-2MU6' : 303,
+#        'L1_BPH-DR-2MU6_BPH-4M8-2MU6' : 304,
+#        'L1_BPH-2M-2MU4-B' : 305,
+#        'L1_BPH-2M-2MU4-BO' : 306,
+#        'L1_BPH-2M-MU6MU4' : 307,
+#        'L1_BPH-2M-MU6MU4-B' : 308,
+#        'L1_BPH-2M-MU6MU4-BO' : 309,
+#        'L1_BPH-4M8-2MU4-B' : 310,
+#        'L1_BPH-4M8-2MU4-BO' : 311,
+#        'L1_BPH-4M8-MU6MU4' : 312,
+#        'L1_BPH-4M8-MU6MU4-B' : 313,
+#        'L1_BPH-4M8-MU6MU4-BO' : 314,
+
+#SX adding
+        #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4' : 295,
+        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4'  : 296, #  ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4'  : 296,
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4'  : 297,
+        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4'  : 298, # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4'  : 298,
+        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4'  : 299,
+        'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6' : 300,
+        'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6'  : 301,
+        'L1_MU6MU4-BO' : 302,
+        'L1_2MU4-B' : 303,
+        'L1_2MU6-B'  : 304,
+        #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4'  : 305,
+        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4'  : 306,
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'  :  307,
+        #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4'   : 308,
+        #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4'  : 309,
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO'  : 310,
+        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4' : 311,
+        'L1_2MU4-BO' : 312,
+        'L1_2MU6-BO' : 313,
+        'L1_MU6_2MU4-B'  : 314,
+
+        ### ATR-14350 - these should be replaced in 2017 with items 296 and 298
+        'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4' : 426,
+        'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' : 427,
+
+
+        'L1_DY-DR-2MU4' : 315,
+        'L1_EM15VH_2EM8VH_MU6' : 316,
+        #'L1_DY-BOX-MU6MU4' : 317,
+        'L1_DY-BOX-2MU6' : 318,
+        'L1_LFV-MU' : 319,
         'L1_LFV-MU6' : 332,
-        'L1_LFV-MU11' : 364,
         'L1_LFV-EM8I' : 320,
         'L1_LFV-EM15I' : 321,
+        'L1_EM7_MU15' : 322,
+        'L1_EM8VH_MU15' : 48,
         'L1_DPHI-J20s2XE50' : 323,
-        'L1_J40_XE50_DPHI-J20s2XE50' : 245,
-        'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
-        'L1_MJJ-700' : 216,
-        'L1_MJJ-300' : 331,
-        #'L1_MJJ-100' : 333,
-        #'L1_MJJ-400' : 329,
-        #'L1_MJJ-800' : 327,
-        'L1_MJJ-500-NFF' : 108,
-        'L1_J50_DETA20-J50J' : 275,
-        'L1_DPHI-2EM3' : 288,
-        #'L1_HT150-JJ15.ETA49' : 334,
-        #'L1_HT150-JJ15.ETA49_MJJ-400' : 416,
-        #'L1_J4-MATCH' : 336,
+        'L1_DPHI-J20XE50' : 324,
+        'L1_DPHI-CJ20XE50' : 325,
+        'L1_MJJ-900' : 326,
+        'L1_MJJ-800' : 327,
+        'L1_MJJ-700' : 328,
+        'L1_MJJ-400' : 329,
+        #'L1_MJJ-350' : 330,
+#        'L1_MJJ-300' : 331,
+#        'L1_MJJ-200' : 332,
+        'L1_MJJ-100' : 333,
+        'L1_HT150-JJ15.ETA49' : 334,
+        'L1_J4-MATCH' : 336,
         'L1_LLP-RO' : 338,
-        #'L1_LLP-NOMATCH' : 339,
-        #'L1_EM15TAU12I-J25' : 345,
-        #'L1_DR-MU10TAU12I' : 340,
-        #'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
+        'L1_LLP-NOMATCH' : 339,
+        'L1_DR-MU10TAU12I' : 340,
+#        'L1_TAU12I-J25' : 341,
+        'L1_EM15TAU12I-J25' : 345,
         'L1_DR-EM15TAU12I-J25' : 346,
-        #'L1_TAU20ITAU12I-J25' : 347,
+        'L1_TAU20ITAU12I-J25' : 347,
         'L1_DR-TAU20ITAU12I' : 348,
+        'L1_BOX-TAU20ITAU12I' : 349,
         'L1_DR-TAU20ITAU12I-J25' : 350,
+
+        'L1_DR25-TAU20ITAU12I' : 337,
+
+        'L1_DR25-TAU20ITAU12I-J25' : 386,
         'L1_30M-EM20ITAU12' : 387,
-        'L1_MJJ-400-CF' : 397,
-        #'L1_LAR-EM' : 351,
-        #'L1_LAR-J' : 352,
-        #'L1_LAR-ZEE' : 71,
-        #'L1_LAR-ZEE_LAR-EM' : 285,
-        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4' : 426,
-        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' : 427,
-        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO' : 488,
-        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6' : 301,
-        'L1_BPH-8M15-0DR22-2MU6' : 107,
-        'L1_BPH-2M9-2DR15-2MU6' : 110,
-        'L1_BPH-2M9-0DR15-MU6MU4' : 125,
-        'L1_BPH-8M15-0DR22-MU6MU4-BO' : 126,
-        'L1_BPH-2M9-0DR15-2MU4' : 127,
-        'L1_BPH-0M9-EM7-EM5' : 80,
-        'L1_BPH-0DR3-EM7J15' : 84,
-        'L1_BPH-0M9-EM7-EM5_MU6' : 124,
-        'L1_BPH-0DR3-EM7J15_MU6' : 134,
-        'L1_BPH-0M9-EM7-EM5_2MU4' : 153,
-        'L1_BPH-0DR3-EM7J15_2MU4' : 156,
-        #'L1_MJJ-400-NFF-0DPHI20' : 128,
-        'L1_MJJ-400-NFF-0DPHI22' : 129,
-        'L1_MJJ-400-NFF-0DPHI24' : 133,
-        'L1_MJJ-400-NFF-0DPHI26' : 136,
-        'L1_EM18VHI_MJJ-300' : 385,
-        'L1_LATE-MU10_XE50' : 354,
-        'L1_LATE-MU10_XE40' : 466,
+        'L1_MJJ-400-CF': 397,
+
+        'L1_LAR-EM' : 351,
+        'L1_LAR-J' : 352,
+        'L1_DR-EM15TAU12I' : 353,        
+        'L1_LATE-MU10_XE50': 354,
         'L1_LATE-MU10_J50' : 355,
-        'L1_TAU60_DR-TAU20ITAU12I' : 76,
-        'L1_SC111-CJ15' : 356,
-        #'L1_LFV-EM8I-MU11' : 138,
-        #'L1_LFV-EM12I-MU6' : 139,
-        'L1_BPH-0M10-3MU4' : 143,
-        'L1_ZAFB-04DPHI-EM15I' : 152,
-        'L1_ZAFB-25DPHI-EM15I' : 157,
-        #'L1_ZAFB-25DPHI-EM18I' : 158,
-        'L1_DPHI-M70-2EM12I' : 159,
-        #'L1_DY-DR-2MU4' : 315,
-        'L1_DY-BOX-2MU6' : 318,
-        'L1_DY-BOX-2MU4' : 160,
-        'L1_CEP-CJ60' : 162,
-        'L1_CEP-CJ50' : 164,
-        'L1_BPH-8M15-2MU4-BO' : 165,
-        'L1_CALREQ2' : 511,
-
-        #ATR-21371
-        'L1_ALFA_B7L1U' : 489,
-        'L1_ALFA_ANY'   : 490,
-        'L1_ALFA_A7L1U' : 491,
-        'L1_ALFA_A7L1L' : 492,
-        'L1_ALFA_A7R1U' : 493,
-        'L1_ALFA_A7R1L' : 494,
-        'L1_ALFA_B7R1U' : 495,
-        'L1_ALFA_B7R1L' : 496,
+        'L1_SC111' : 356,
+        'L1_SC85' : 357,
+#SX
+#        'L1_BPH-DR-2MU4-B' : 353,
+#        'L1_BPH-DR-2MU4-BO' : 354,
+#        'L1_BPH-DR-MU6MU4' : 355,
+#        'L1_BPH-DR-MU6MU4-B' : 356,
+#        'L1_BPH-DR-MU6MU4-BO' : 357,
+        'L1_MU6_MJJ-200' : 358,
+        'L1_MU6_MJJ-300' : 359,
+        'L1_MU6_MJJ-400' : 360,
+        'L1_MU6_MJJ-500' : 361,
+        'L1_J30_2J20_4J20.0ETA49_MJJ-400' : 362,
+        'L1_J30_2J20_4J20.0ETA49_MJJ-700' : 363,
+        'L1_J30_2J20_4J20.0ETA49_MJJ-800' : 364,
+        'L1_J30_2J20_4J20.0ETA49_MJJ-900' : 365,
+        'L1_3J20_4J20.0ETA49_MJJ-400' : 366,
+        'L1_3J20_4J20.0ETA49_MJJ-700' : 367,
+        'L1_3J20_4J20.0ETA49_MJJ-800' : 368,
+        'L1_3J20_4J20.0ETA49_MJJ-900' : 369,
+        'L1_XE35_MJJ-200' : 370,
+        'L1_EM7_FIRSTEMPTY': 371, 
+        'L1_RD0_ABORTGAPNOTCALIB':372,
+        'L1_3J25.0ETA23' : 373,
+        'L1_3J35.0ETA23' : 425,
+        'L1_TE20' : 374,
+        'L1_TE10.0ETA24' : 375,
+        'L1_TE15.ETA24' : 416,
+        'L1_TE20.0ETA24' : 376,
+        'L1_TE25.0ETA24' : 409,
+        #'L1_XS40' : 377,
+        #'L1_XS50' : 378,
+        #'L1_XS60' : 379,
+        'L1_J12_BGRP12' : 380,
+        'L1_J30.31ETA49_BGRP12' : 381,
+        'L1_MU6_J30.0ETA49_2J20.0ETA49' : 382,
+        'L1_4J20.0ETA49' : 383,
+        'L1_HT150-JJ15.ETA49_MJJ400' : 384,
+
+        ### ATR-15062
+        'L1_EM18VH_MJJ-300' : 385,
+        
+#ATR-13743        'L1_MU4_J30' : 386,
+#        'L1_MU4_J50' : 387,
+
+        
+        'L1_TAU8_UNPAIRED_ISO': 388,
+        'L1_EM7_UNPAIRED_ISO': 389,
+        'L1_TAU8_UNPAIRED_NONISO': 467,
+        'L1_EM7_UNPAIRED_NONISO': 468,
+        'L1_MU4_UNPAIRED_NONISO' : 469,
+        'L1_RD2_BGRP12'   : 390,
+        'L1_TAU8_FIRSTEMPTY': 391,
+        'L1_EM24VHI'           : 392,
+        'L1_LHCF_UNPAIRED_ISO' : 393,
+        'L1_LHCF_EMPTY' : 394,
+        'L1_EM15VH_2EM10VH_3EM7': 395,
+        'L1_EM15VH_3EM8VH': 396, 
+        'L1_EM8I_MU10'  : 399,
+        "L1_EM26VHI"    :402,
+        "L1_EM15HI"    :423,
+        "L1_EM15I"    :424,
+        "L1_MU6_3MU4"  :403,
+        "L1_2MU6_3MU4" :404,
+        "L1_BGRP9"     :405,
+        #'L1_TE50'       :406,
+        'L1_TE5'       :407,
+        #'L1_TE60'      :408,
+        #'L1_TE50.0ETA24':409,
+        'L1_TE5.0ETA24':410, 
+        'L1_EM20VH_FIRSTEMPTY':411, 
+        'L1_EM22VHI_FIRSTEMPTY':412, 
+        'L1_MU20_FIRSTEMPTY':413, 
+        'L1_J100_FIRSTEMPTY':414, 
+        'L1_J100.31ETA49_FIRSTEMPTY':415, 
+        #'L1_TE60.0ETA24':416, 
+        'L1_TE70.0ETA24':417, 
+        'L1_TE40.0ETA24':418, 
+
+        # 3 x ZDC
+        'L1_ZDC_A':419,
+        'L1_ZDC_C':420,
+        'L1_ZDC_AND':421, 
+        'L1_ZDC_A_C':422, 
+        
+#ATR-13743        'L1_ALFA_ELAST1'  : 424,
+#        'L1_ALFA_ELAST2'  : 425,
+#        'L1_ALFA_ELAST11' : 426,
+#        'L1_ALFA_ELAST12' : 427,
+#        'L1_ALFA_ELAST13' : 428,
+#        'L1_ALFA_ELAST14' : 429,
+#        'L1_ALFA_ELAST15' : 430,
+#        'L1_ALFA_ELAST15_Calib' : 431,
+#        'L1_ALFA_ELAST16' : 432,
+#        'L1_ALFA_ELAST17' : 433,
+#        'L1_ALFA_ELAST18' : 434,
+#        'L1_ALFA_ELAST18_Calib' : 435,
+#        'L1_ALFA_SDIFF5' : 436,
+#        'L1_ALFA_SDIFF6' : 437,
+#        'L1_ALFA_SDIFF7' : 438,
+#        'L1_ALFA_SDIFF8' : 439,
+#        'L1_MBTS_1_A_ALFA_C' : 440,
+#        'L1_MBTS_1_C_ALFA_A' : 441,
+#        'L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO' : 442,
+#        'L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO' : 443,
+#        'L1_MBTS_2_A_ALFA_C' : 444,
+#        'L1_MBTS_2_C_ALFA_A' : 445,
+#        'L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO' : 446,
+#        'L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO' : 447,
+#        'L1_LUCID_A_ALFA_C' : 448,
+#        'L1_LUCID_C_ALFA_A' : 449,
+#        'L1_LUCID_A_ALFA_C_UNPAIRED_ISO' : 450,
+#        'L1_LUCID_C_ALFA_A_UNPAIRED_ISO' : 451,
+#        'L1_EM3_ALFA_ANY' : 452,
+#        'L1_EM3_ALFA_ANY_UNPAIRED_ISO' : 453,
+#        'L1_EM3_ALFA_EINE' :   454,
+#        'L1_ALFA_ELASTIC_UNPAIRED_ISO' : 455,
+#        'L1_ALFA_ANTI_ELASTIC_UNPAIRED_ISO' : 456,
+#        'L1_ALFA_ANY_A_EMPTY' : 457,
+#        'L1_ALFA_ANY_C_EMPTY' : 458,
+#        'L1_J12_ALFA_ANY' : 459,
+#        'L1_J12_ALFA_ANY_UNPAIRED_ISO' : 460,
+#        'L1_TE5_ALFA_ANY' : 461,
+#        'L1_TE5_ALFA_ANY_UNPAIRED_ISO' : 462,
+#        'L1_TE5_ALFA_EINE' : 463,
+#        'L1_TRT_ALFA_ANY' : 464,
+#        'L1_TRT_ALFA_ANY_UNPAIRED_ISO' : 465,
+#        'L1_TRT_ALFA_EINE' :   466,
+##        'L1_LHCF_ALFA_ANY_A' : 467,
+##        'L1_LHCF_ALFA_ANY_C' : 468,
+##        'L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO' : 469,
+##        'L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO' : 470,
+#        
+#        'L1_ALFA_BGT' : 471,
+#        'L1_ALFA_BGT_UNPAIRED_ISO' : 472,
+#        'L1_ALFA_BGT_BGRP10' : 473,
+#        'L1_ALFA_SHOWSYST5' : 474,
+#        'L1_ALFA_SYST9'  : 475,
+#        'L1_ALFA_SYST10' : 476,
+#        'L1_ALFA_SYST11' : 477,
+#        'L1_ALFA_SYST12' : 478,
+#        'L1_ALFA_SYST17' : 479,
+#        'L1_ALFA_SYST18' : 480,
+#        'L1_ALFA_ANY_EMPTY' : 482,
+#        'L1_ALFA_ANY_FIRSTEMPTY' : 483,
+#        'L1_ALFA_ANY_UNPAIRED_ISO' : 484,
+#        'L1_ALFA_ANY_UNPAIRED_NONISO' : 485,
+#        'L1_ALFA_ANY_BGRP10' : 486,
+#        'L1_ALFA_ANY_ABORTGAPNOTCALIB' : 487,
+#        'L1_ALFA_ANY_CALIB' : 488,
+         'L1_ALFA_B7L1U' : 489,
+         # 'L1_ALFA_B7L1L' : 490,
+         'L1_ALFA_ANY'   : 490,
+         'L1_ALFA_A7L1U' : 491,
+         'L1_ALFA_A7L1L' : 492,
+         'L1_ALFA_A7R1U' : 493,
+         'L1_ALFA_A7R1L' : 494,
+         'L1_ALFA_B7R1U' : 495,
+         'L1_ALFA_B7R1L' : 496,
+
+        
+#        'L1_ALFA_B7L1U_OD' : 497,
+#        'L1_ALFA_B7L1L_OD' : 498,
+#        'L1_ALFA_A7L1U_OD' : 499,
+#        'L1_ALFA_A7L1L_OD' : 500,
+#        'L1_ALFA_A7R1U_OD' : 501,
+#        'L1_ALFA_A7R1L_OD' : 502,
+#        'L1_ALFA_B7R1U_OD' : 503,
+#        'L1_ALFA_B7R1L_OD' : 504,
+#        'L1_ALFA_B7L1_OD'  : 505,
+#        'L1_ALFA_A7L1_OD'  : 506,
+#        'L1_ALFA_B7R1_OD'  : 507,
+#        'L1_ALFA_A7R1_OD'  : 508,
+        'L1_CALREQ2' : 511,  # never use 509-511 for anything else than CALREQ triggers
 }
 
 
-- 
GitLab


From 7a132ecd53cd06bc021bea455a8becbae7662b8a Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Tue, 25 Aug 2020 04:39:48 +0200
Subject: [PATCH 112/422] updates

---
 .../LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py    | 1269 +++++++++++------
 1 file changed, 825 insertions(+), 444 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
index 7c1ea856165f..f32fe825deb0 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 def defineMenu():
     """
@@ -38,13 +38,14 @@ def defineMenu():
         # SLOT 7 / CON 0,1 (EM1,2)
         #-------------------------
         
- 
         # 16 x EM
         'EM3', 'EM7', 'EM8VH',
-        'EM10VH', 'EM12', 'EM15', 'EM15VH',
-        'EM15VHI',
-        'EM18VHI', 'EM20VH', 'EM20VHI', 'EM22VH', 'EM22VHI', 'EM24VHI', 'EM24VHIM', 'EM30VHI', 
-        # 1 x ZB/
+        'EM8I',
+        'EM10VH', 'EM12', 'EM13VH', 'EM15', 'EM15VH',
+        'EM15HI',
+        'EM18VH', 'EM20VH', 'EM20VHI', 'EM22VHI', 'EM24VHI', 'EM26VHI', 
+
+        # 1 x ZB
         'ZB_EM15',
 
         #--------------------------
@@ -52,8 +53,7 @@ def defineMenu():
         #--------------------------
 
         # 16 x TAU
-        'HA5', 'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA15', 'HA20', 'HA20IL', 'HA20IM', 'HA25', 'HA25IM', 'HA30', 'HA40', 'HA60', 'HA90', 'HA100',
- 
+        'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA12IT', 'HA15', 'HA20', 'HA20IL',  'HA20IM', 'HA20IT', 'HA25', 'HA25IT', 'HA30', 'HA40', 'HA60', 'HA100', 
 
         #----------------------
         # SLOT 8 / CON 0 (JET1)
@@ -61,11 +61,9 @@ def defineMenu():
         # 10 x 3-bit JET (can have multiplicity 4 or more)
 
         # 8 x JETs and central jets
-        'J12', 'J12.0ETA23', 'J15', 'J15.0ETA25','J20', 'J25','J25.0ETA23','J30',
-        # 2 x Central Jets
-         'J12.0ETA28', #'J12.0ETA25',
-
-        # VBF Jets
+        'J12', 'J15', 'J15.0ETA25','J20', 'J25','J25.0ETA23','J30', 'J40',
+        
+        # 2 x VBF
         'J20.0ETA49', 'J30.0ETA49',
 
 
@@ -75,33 +73,37 @@ def defineMenu():
         # 15 x 2-bit JET (can have maximum multiplicity of 3) (SLOT 8, CON 1)
 
         # 3 x Central Jet
-        'J35.0ETA23','J40.0ETA25', #'J20.28ETA31',
-
-        # 6 Jets # replace J400 with J45.0ETA20 - ATR-19309
-        'J40', 'J50', 'J75', 'J85', 'J100', 'J45.0ETA20',  'J400', #'J120',
+        'J35.0ETA23','J40.0ETA25', 'J20.28ETA31',
 
+        # 6 Jets
+        'J50', 'J75', 'J85', 'J100', 'J120', 'J400',
 
         # 6 x FJ              
-        'J15.31ETA49', 'J20.31ETA49', 'J30.31ETA49', 'J50.31ETA49', 'J75.31ETA49', 
- 
+        'J15.31ETA49', 'J20.31ETA49', 'J30.31ETA49', 'J50.31ETA49', 'J75.31ETA49', 'J100.31ETA49', 
 
 
         #---------------------
-        # SLOT 8 / CON 2 (EN1) 
+        # SLOT 8 / CON 2 (EN1)
         #---------------------
         # 24 x 1-bit thresholds
-
+        
         # 8 x TE
-        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE50',
-    
+        #'TE3', 'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40',
+        #'TE5', 'TE30', 'TE40', 'TE45', 'TE50', 'TE55', 'TE60', 'TE65',
+        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE70',
+
         # 8 x XE (for standard XE)
+        #'XE35', 'XE40', 'XE45', 'XE50', 'XE55', 'XE60', 'XE70', 'XE80',
+        # 8 x XE (for restricted ETA XE: check ATR-13234 for any further change)
+        #'XE10', 'XE20', 'XE25', 'XE30', 'XE65', 'XE75', 'XE150', 'XE300',
+
         'XE10', 'XE20', 'XE25', 'XE30', 'XE35', 'XE40', 'XE45', 'XE50',
         'XE55', 'XE60', 'XE65', 'XE70', 'XE75', 'XE80', 'XE150', 'XE300',
         
         # 8 x XS
         'XS20', 'XS30', 'XS40', 'XS45', 'XS50', 'XS55', 'XS60', 'XS65', 
 
- 
+
         #---------------------
         # SLOT 8 / CON 3 (EN2)
         #---------------------
@@ -111,18 +113,18 @@ def defineMenu():
         #'RXE35', 'RXE40', 'RXE45', 'RXE50', 'RXE55', 'RXE60', 'RXE70', 'RXE80', # FTHR
 
         # 8 x restricted eta range
-        #'TE5.24ETA49', 'TE10.24ETA49', 'TE15.24ETA49', 'TE20.24ETA49', 'TE25.24ETA49', 'TE30.24ETA49', 'TE40.24ETA49', 'TE70.24ETA49',
-
-
+        #'TE3.0ETA24', 'TE5.0ETA24','TE10.0ETA24', 'TE15.0ETA24', 'TE20.0ETA24', 'TE25.0ETA24', 'TE30.0ETA24', 'TE40.0ETA24',
+        #'TE5.0ETA24', 'TE30.0ETA24','TE40.0ETA24', 'TE45.0ETA24', 'TE50.0ETA24', 'TE55.0ETA24', 'TE60.0ETA24', 'TE65.0ETA24',
+        'TE5.0ETA24', 'TE10.0ETA24', 'TE15.0ETA24', 'TE20.0ETA24', 'TE25.0ETA24', 'TE30.0ETA24', 'TE40.0ETA24', 'TE70.0ETA24',
 
         #------------------------
-        # SLOT 9 / CON 0 (MUCTPi) 
+        # SLOT 9 / CON 0 (MUCTPi)
         #------------------------
         
         # 6 x MU
-        'MU4', 'MU6', 'MU10', 'MU11', 'MU20', 'MU21',
+        'MU4', 'MU6', 'MU10', 'MU11', 'MU15', 'MU20',
+
 
-        
         #------------------------
         # SLOT 9 / CON 1 (CTPCal)
         #------------------------
@@ -151,8 +153,6 @@ def defineMenu():
         # 3 x CALREQ
         'CAL0','CAL1','CAL2',
 
- 
-
         #-----------------------------
         # SLOT 9 / CON 2,3 (NIM1,NIM2)
         #-----------------------------
@@ -160,13 +160,11 @@ def defineMenu():
         # 2 x MBTS
         'MBTS_A', 'MBTS_C',
 
-        # 32 x MBTSSI (all FTHR)
-        # NOTE: THESE ARE OUT OF ORDER FOR A REASON! Do not change!
-        # The order defines the mapping - see ATR-17870.
-        'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4', 'MBTS_A5', 'MBTS_A6', 'MBTS_A7',
-        'MBTS_A8', 'MBTS_A10', 'MBTS_A12', 'MBTS_A14', 'MBTS_A9', 'MBTS_A11','MBTS_A13', 'MBTS_A15',
-        'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4', 'MBTS_C5', 'MBTS_C6', 'MBTS_C7',
-        'MBTS_C8', 'MBTS_C10', 'MBTS_C12', 'MBTS_C14', 'MBTS_C11', 'MBTS_C13','MBTS_C9','MBTS_C15',
+        # 24 x MBTSSI (all FTHR)
+        'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4'  , 'MBTS_A5', 'MBTS_A6', 'MBTS_A7', 
+        'MBTS_A8', 'MBTS_A10', 'MBTS_A12' , 'MBTS_A14',
+        'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4'  , 'MBTS_C5', 'MBTS_C6', 'MBTS_C7', 
+        'MBTS_C8', 'MBTS_C10', 'MBTS_C12' , 'MBTS_C14',
 
         # L1A for CTP monitoring itself
         'NIML1A',
@@ -184,309 +182,382 @@ def defineMenu():
         'NIMTRT',
 
         # AFP
-        'AFP_NSC', 'AFP_NSA',
-        #'AFP_FSA_SIT', 'AFP_FSA_TOF', 'AFP_FSA_LOG',
-        #'AFP_FSC_SIT', 'AFP_FSC_LOG', 'AFP_FSC_TOF',
+        'AFP_NSC', 'AFP_FSC',
 
-        
         #-------------------------------------------------------------------
         #L1 TOPO inputs 
         #-------------------------------------------------------------------
-
-        #B-jets
-        #'BTAG-MU4J15',
-        #'BTAG-MU6J20',
-
+        
         #HT
+        'HT190-AJ15all.ETA21',
         'HT190-J15s5.ETA21',
+        'HT150-AJ20all.ETA31',
         'HT150-J20s5.ETA31',
 
         
 
         #ZH 
-        '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', 
-
+        '10MINDPHI-AJ20s2-XE50', '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', '10MINDPHI-J20ab-XE50', '10MINDPHI-CJ20ab-XE50', 
         #Jpsi T&P
-         '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',        
-
-        #W T&P - all were commented out
- 
+        '1INVM5-EMs1-EMs6', '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',        
+
+        #W T&P
+        '05MINDPHI-AJj10s6-XE0',
+        '10MINDPHI-AJj10s6-XE0',
+        '15MINDPHI-AJj10s6-XE0',
+        '05MINDPHI-EM12s6-XE0',
+        '15MINDPHI-EM12s6-XE0',
+        '05MINDPHI-EM15s6-XE0',
+        '15MINDPHI-EM15s6-XE0',
+        '05RATIO-XE0-HT0-AJj15all.ETA49',
+        '90RATIO2-XE0-HT0-AJj15all.ETA49',
+        '250RATIO2-XE0-HT0-AJj15all.ETA49',
+        'HT20-AJj15all.ETA49',
+        'NOT-02MATCH-EM10s1-AJj15all.ETA49',
+        '25MT-EM12s6-XE0',
+        '35MT-EM12s6-XE0',
+        '35MT-EM15s6-XE0',
+        #'10MINDPHI-AJj15s2-XE0',
+        #'20MINDPHI-AJjs6-XE0',
+        #'20MINDPHI-AJj15s2-XE0',
+        #'10MINDPHI-EM6s1-XE0',
+        #'20MINDPHI-EM9s6-XE0',
+        #'20MINDPHI-EM6s1-XE0',
+        #'05RATIO-XE0-HT0-AJj15all.ETA49',
+        #'08RATIO-XE0-HT0-AJj0all.ETA49',
+        #'40RATIO2-XE0-HT0-AJj15all.ETA49',
+        #'90RATIO2-XE0-HT0-AJj0all.ETA49',
+        #'HT20-AJj0all.ETA49',
+        #'NOT-02MATCH-EM9s1-AJj15all.ETA49',
+        #'05RATIO-XE0-SUM0-EM9s1-HT0-AJj15all.ETA49',
+        #'20MT-EM6s6-XE0',
+        #'30MT-EM6s6-XE0',
+        #'40MT-EM6s6-XE0',
         
         # central muon
         'MULT-CMU4ab',
         'MULT-CMU6ab',
         
-
+        #B-jet
+        '0DR04-MU4ab-CJ15ab', '0DR04-MU4ab-CJ20ab', '0DR04-MU4ab-CJ30ab', '0DR04-MU6ab-CJ20ab', '0DR04-MU6ab-CJ25ab',
         #B-physics
-        '0DR03-EM7ab-CJ15ab',
- 
+#SX        '2DR15-2MU4ab', 
+#SX        '2INVM999-2MU4ab', 
+#SX        '4INVM8-2MU4ab',
+        '2DR15-2MU6ab', 
+#SX        '2INVM999-2MU6ab', 
+#SX        '4INVM8-2MU6ab',
 
         # L1 thresholds for L1Topo streamers
-        #'2DR99_2MU4ab',
+#SX        '2INVM999-CMU4ab-MU4ab',
+#SX        '2INVM999-2CMU4ab',
+#SX        '2INVM999-MU6ab-MU4ab',
+#SX        '2INVM999-ONEBARREL-MU6ab-MU4ab',
+#SX        '2INVM999-CMU6ab-CMU4ab',
+#SX        '4INVM8-CMU4ab-MU4ab',
+#SX        '4INVM8-2CMU4ab',
+#SX        '4INVM8-MU6ab-MU4ab',
+#SX        '4INVM8-ONEBARREL-MU6ab-MU4ab',
+#SX        '4INVM8-CMU6ab-CMU4ab',        
+        '2DR99-2MU4ab',
         '5DETA99-5DPHI99-MU6ab-MU4ab',
         '5DETA99-5DPHI99-2MU6ab',
+        '0DR10-MU10ab-MU6ab',
         '0DR15-2MU6ab',
+#        '0DETA04-0DPHI03-EM8abi-MU10ab',
         '0DETA04-EM8abi-MU10ab',
         '0DPHI03-EM8abi-MU10ab',
+#        '0DETA04-0DPHI03-EM15abi-MUab',
         '0DETA04-EM15abi-MUab',
         '0DPHI03-EM15abi-MUab',
-        #'800INVM9999-AJ30s6-AJ20s6',
+        '10MINDPHI-AJ20s2-XE50',
+        '10MINDPHI-J20s2-XE50',
+        '10MINDPHI-J20ab-XE50',
+        '10MINDPHI-CJ20ab-XE50',
+        '900INVM9999-AJ30s6-AJ20s6',
+        '800INVM9999-AJ30s6-AJ20s6',
         '700INVM9999-AJ30s6-AJ20s6',
+        '500INVM9999-AJ30s6-AJ20s6',
+        '400INVM9999-AJ30s6-AJ20s6',
+        #'350INVM9999-AJ30s6-AJ20s6',
         '300INVM9999-AJ30s6-AJ20s6',
-        #'400INVM9999-AJ30s6-AJ20s6',
-        '500INVM9999-J30s6-AJ20s6',
-        #'100INVM9999-AJ30s6-AJ20s6',
-        '0DETA20-J50s1-Js2',
-        '27DPHI32-EMs1-EMs6',
-        #'HT150-AJj15all.ETA49',
-        #'0MATCH-4AJ20.ETA31-4AJj15.ETA31',
+        '200INVM9999-AJ30s6-AJ20s6',
+        '100INVM9999-AJ30s6-AJ20s6',
+        #'350INVM9999-J30s6-J20s6',
+        #'300INVM9999-J30s6-J20s6',
+        #'250INVM9999-J30s6-J20s6',
+        #'200INVM9999-J30s6-J20s6',
+        'HT150-AJj15all.ETA49',
+        '0MATCH-4AJ20.ETA31-4AJj15.ETA31',
         '100RATIO-0MATCH-TAU30si2-EMall',
-        'NOT-0MATCH-TAU30si1-EMall',
-        #'1DISAMB-TAU12abi-J25ab',
-        #'1DISAMB-EM15his2-TAU12abi-J25ab',
-        '2DISAMB-TAU12abi-J25ab',
-        '2DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
-        #'0DR28-MU10ab-TAU12abi',  # add back if needed
-        #'1DISAMB-TAU20abi-TAU12abi-J25ab',
+        'NOT-0MATCH-TAU30si2-EMall',
+        '0DR28-MU10ab-TAU12abi',
+        '1DISAMB-TAU12abi-J25ab',
+        '1DISAMB-EM15his2-TAU12abi-J25ab',
+        'DISAMB-0DR28-EM15his2-TAU12abi',
+        '1DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
+        '1DISAMB-TAU20abi-TAU12abi-J25ab',
         '0DR25-TAU20abi-TAU12abi',
         '0DR28-TAU20abi-TAU12abi',
-        '2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
-        '2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
+        '0DETA20-0DPHI20-TAU20abi-TAU12abi',
+        '1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
+        '1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
         'DISAMB-30INVM-EM20his2-TAU12ab',
         '400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49',
-
-        '0INVM9-EM7ab-EMab',
-        '400INVM9999-0DPHI20-J30s6-AJ20s6',
-        '400INVM9999-0DPHI22-J30s6-AJ20s6',
-        '400INVM9999-0DPHI24-J30s6-AJ20s6',
-        '400INVM9999-0DPHI26-J30s6-AJ20s6',
+        'LAR-EM50s1',
+        'LAR-J100s1',
+#SX        '2DR15-CMU4ab-MU4ab',
+#SX        '2DR15-2CMU4ab',
+#SX        '2DR15-MU6ab-MU4ab',
+#SX        '2DR15-ONEBARREL-MU6ab-MU4ab',
+#SX        '2DR15-CMU6ab-CMU4ab',
+
+        '2INVM9-2MU6ab',
+        '7INVM15-2MU4ab', 
+        '2INVM8-ONEBARREL-MU6ab-MU4ab', 
+        '0DR24-2CMU4ab', 
+        '0DR22-2MU6ab',
+        '0DR34-2MU4ab', 
+        '0DR24-2MU4ab', 
+        '0DR24-CMU4ab-MU4ab',  
+        '2INVM8-CMU4ab-MU4ab',
+        '0DR15-2MU4ab',  
+        '0DR15-MU6ab-MU4ab',  
+        '0DR22-MU6ab-MU4ab', 
+        '8INVM15-MU6ab-MU4ab',  
+        '8INVM15-2MU6ab', 
+        '2INVM8-2MU4ab',  # ATR-15197 '2INVM9-2MU4ab',
+        '2INVM8-MU6ab-MU4ab', # ATR-15197 '2INVM9-MU6ab-MU4ab',
+        '2INVM9-2MU4ab',
+        '2INVM9-MU6ab-MU4ab',
+        'KF-XE40-AJall',
+        'KF-XE50-AJall',
+        'KF-XE55-AJall',
+        'KF-XE60-AJall',
+        'KF-XE65-AJall',
+        'KF-XE75-AJall',
 
         'LATE-MU10s1',
         'SC111-CJ15ab.ETA26',
-        
+        'SC85-CJ15ab.ETA26',
         
         # ALFA (the replication is needed to build all the combinations in the CTPCore)
         'ALFA_B7R1L', 'ALFA_B7R1U', 'ALFA_A7R1L', 'ALFA_A7R1U', 'ALFA_A7L1L', 'ALFA_A7L1U', 'ALFA_B7L1L', 'ALFA_B7L1U',
         'ALFA2_B7R1L', 'ALFA2_B7R1U', 'ALFA2_A7R1L', 'ALFA2_A7R1U', 'ALFA2_A7L1L', 'ALFA2_A7L1U', 'ALFA2_B7L1L', 'ALFA2_B7L1U',
         'ALFA3_B7R1L', 'ALFA3_B7R1U', 'ALFA3_A7R1L', 'ALFA3_A7R1U', 'ALFA3_A7L1L', 'ALFA3_A7L1U', 'ALFA3_B7L1L', 'ALFA3_B7L1U',
         'ALFA4_B7R1L', 'ALFA4_B7R1U', 'ALFA4_A7R1L', 'ALFA4_A7R1U', 'ALFA4_A7L1L', 'ALFA4_A7L1U', 'ALFA4_B7L1L', 'ALFA4_B7L1U',
-#ATR-13743      
-        'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
-
-        #ATR-19355
-        '0INVM10-3MU4ab',
-
-        #ATR-18815 - Algorithm needs to be moved to master
-#        '0INVM10-0DR15-EM8abi-MU10ab',
-#        '0INVM10-0DR15-EM12abi-MU6ab',
-
-        #ATR-18824
-        '60INVM9999-25DPHI32-EM15abhi-FJj15s623ETA49',
-        '60INVM9999-04DPHI32-EM15abhi-FJj15s623ETA49',
-        #ATR-19302
-        '0INVM70-27DPHI32-EM12his1-EM12his6',
-
-        #ATR-19720
-        #'8INVM15-0DR22-2MU6ab',
-        #'2INVM9-2DR15-2MU6ab',
-        #'2INVM9-0DR15-MU6ab-MU4ab',
-        #'8INVM15-0DR22-MU6ab-MU4ab',
-        #'2INVM9-0DR15-2MU4ab',
-
-        #ATR-19510
-        '5DETA99-5DPHI99-2MU4ab',
-            
-        #ATR-17320
-        'CEP-CJ60s6',
-        'CEP-CJ50s6',
-       
-        #ATR-20174
-        '8INVM15-2CMU4ab'
+#ATR-13743        'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
 
-        
-    ]
+
+        ]
 
     
     Lvl1Flags.items = [
 
+        
         # single EM
 
         'L1_EM3','L1_EM7','L1_EM12', 'L1_EM8VH',
-        'L1_EM10VH', 'L1_EM15',
-        'L1_EM30VHI',
-        'L1_EM15VHI',
-        'L1_EM24VHIM','L1_EM15VH', 'L1_EM18VHI', 'L1_EM20VH', 'L1_EM20VHI', 'L1_EM22VHI', 'L1_EM22VH','L1_EM24VHI', 
-        'L1_EM3_EMPTY', 'L1_EM7_EMPTY', 'L1_EM7_UNPAIRED_ISO', 'L1_EM7_FIRSTEMPTY',
+#        'L1_EM8I',
+        'L1_EM10VH', 'L1_EM13VH', 'L1_EM15',
+        'L1_EM15I','L1_EM15HI',
+        'L1_EM26VHI','L1_EM15VH', 'L1_EM18VH', 'L1_EM20VH', 'L1_EM20VHI', 'L1_EM22VHI', 'L1_EM24VHI', # see Jira ATR-10334'L1_EM22VHLIL', #'L1_EM50V',
+        'L1_EM3_EMPTY', 'L1_EM7_EMPTY', 'L1_EM7_UNPAIRED_ISO', 'L1_EM7_FIRSTEMPTY','L1_EM7_UNPAIRED_NONISO',
         'L1_EM20VH_FIRSTEMPTY',
+        'L1_EM22VHI_FIRSTEMPTY',
+        #'L1_EM15_BGRP7',
 
+        # see savannah https://savannah.cern.ch/bugs/?103935
 
-        # combined EM -jet - all commented
+        # combined EM -jet
+        #'L1_JJ15.23ETA49', # 4x4 window
 
         # single MU
-        "L1_MU4", "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU20", "L1_MU21",
-        
-        "L1_MU4_EMPTY", "L1_MU6_EMPTY", "L1_MU4_FIRSTEMPTY", "L1_MU11_EMPTY",
-        'L1_MU4_UNPAIRED_ISO',
+        "L1_MU4", "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU15", "L1_MU20",
 
+        "L1_MU4_EMPTY", "L1_MU6_EMPTY", "L1_MU4_FIRSTEMPTY", "L1_MU11_EMPTY",
+        'L1_MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_NONISO',
+         'L1_MU20_FIRSTEMPTY',
 
         
+        
         # multi lepton
-        "L1_2EM3", "L1_2EM7",
-        "L1_2EM15", "L1_2EM15VH", "L1_2EM15VHI",
-        "L1_2EM20VH",
-        "L1_EM20VH_3EM10VH", 
+        "L1_2EM3", "L1_2EM7", "L1_2EM10VH", "L1_2EM13VH", "L1_2EM15", "L1_2EM15VH", "L1_EM7_2EM3", "L1_EM12_2EM3", "L1_EM15VH_3EM7", "L1_EM15VH_3EM8VH", "L1_EM15VH_2EM10VH_3EM7",
+        "L1_2EM18VH", "L1_2EM20VH", "L1_EM15VH_3EM10VH", "L1_EM18VH_3EM8VH", "L1_EM18VH_2EM10VH_3EM7", "L1_EM20VH_3EM10VH", "L1_EM20VH_2EM10VH_3EM8VH",
         "L1_EM7_MU10",
-        "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY",  "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4", "L1_2MU11", "L1_MU11_2MU10",
-        "L1_2EM8VH_MU10", "L1_EM15VH_MU10",  "L1_EM7_MU20", "L1_EM8VH_MU20",
+        "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY", "L1_MU10_2MU6", "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4",
+
+        "L1_EM8I_MU10", "L1_EM15I_MU4", "L1_2EM8VH_MU10", "L1_EM15VH_MU10", 
+
 
         # single tau
-        "L1_TAU5", "L1_TAU12", "L1_TAU12IM",   "L1_TAU20IM",
-        "L1_TAU30","L1_TAU30_EMPTY","L1_TAU30_UNPAIRED_ISO", "L1_TAU40", "L1_TAU60", "L1_TAU90", "L1_TAU100", "L1_TAU8_EMPTY", 
-        "L1_TAU8_UNPAIRED_ISO","L1_TAU8_FIRSTEMPTY",
+        "L1_TAU12", "L1_TAU12IM",  "L1_TAU20", "L1_TAU20IM",
+        "L1_TAU30","L1_TAU30_EMPTY","L1_TAU30_UNPAIRED_ISO", "L1_TAU40", "L1_TAU60", "L1_TAU100", "L1_TAU8", "L1_TAU8_EMPTY", 
+        "L1_TAU8_UNPAIRED_ISO","L1_TAU8_FIRSTEMPTY","L1_TAU8_UNPAIRED_NONISO",
 
         # multi tau
-        "L1_TAU20IM_2TAU12IM",   "L1_TAU60_2TAU40", "L1_2TAU5", "L1_2TAU8",
+        "L1_TAU20IM_2TAU12IM", "L1_TAU20_2TAU12", "L1_TAU40_2TAU20IM",
 
         # combined tau - lepton
-        "L1_EM15VHI_2TAU12IM",          
-        "L1_EM15VHI_2TAU12IM_J25_3J12",   
-        "L1_EM15VHI_2TAU12IM_4J12",
-        "L1_EM15VHI_TAU40_2TAU15",
+        "L1_EM15HI_2TAU12IM",          
+        "L1_EM15HI_2TAU12IM_J25_3J12",   
+        "L1_EM15HI_TAU40_2TAU15",
         "L1_MU10_TAU12IM",  
-        "L1_MU10_TAU12IM_J25_2J12",
-        "L1_MU10_TAU12IM_3J12",
-        #'L1_DR-MU10TAU12I_TAU12I-J25',
+        "L1_MU10_TAU12IM_J25_2J12", 
+#        "L1_MU10_TAU12_J25_2J12", 
+#        "L1_MU10_TAU20",
         "L1_MU10_TAU20IM",
         "L1_MU11_TAU20IM",
         "L1_MU10_TAU20IM_J25_2J20",
 
         # combined tau - jet
+#        "L1_TAU25IT_2TAU12IT_2J25_3J12", 
 
-        "L1_TAU20IM_2TAU12IM_J25_2J20_3J12",
-        "L1_TAU20IM_2TAU12IM_4J12.0ETA23",
-        #"L1_TAU20IM_2TAU12IM_4J12.0ETA25",
-        "L1_TAU20IM_2TAU12IM_4J12.0ETA28",
-        "L1_TAU25IM_2TAU20IM_2J25_3J20", 
-
+        "L1_TAU20IM_2TAU12IM_J25_2J20_3J12", 
+        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I',  
+        'L1_DR-MU10TAU12I_TAU12I-J25', 
+        "L1_MU10_TAU12I-J25",
 
 
         # combined tau - xe
         "L1_TAU20IM_2J20_XE45", 
-        "L1_TAU20IM_2J20_XE50", 
-
+#        "L1_TAU20_2J20_XE45", 
+#        "L1_TAU20IM_2J20_XE50",   
 
         #"L1_EM15HI_2TAU12I_XE35", 
-        "L1_EM15VHI_2TAU12IM_XE35", 
+        "L1_EM15HI_2TAU12IM_XE35", 
+        "L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15",
         'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20',
 
 
         "L1_MU10_TAU12IM_XE35",  
+#        "L1_MU10_TAU12IM_XE40",  
 
         "L1_TAU20IM_2TAU12IM_XE35", 
+        "L1_TAU20_2TAU12_XE35",
         "L1_TAU40_2TAU12IM_XE40",  
 
 
 
         # combined em - jet
-        'L1_EM18VHI_3J20',
-        'L1_EM20VH_3J20',
-
-        
+        #'L1_EM15VH_J15.23ETA49',
+#        'L1_EM15VH_JJ15.23ETA49',
+        'L1_EM13VH_3J20',
+        'L1_EM18VH_3J20',
 
         # combined mu - jet
-        'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
+        'L1_MU4_J12',  'L1_MU4_J50_XE40', 'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
+#ATR-13743        'L1_MU4_J30',
+        #'L1_MU4_J50',
         'L1_MU10_2J20','L1_MU10_3J20', 'L1_MU10_2J15_J20',
+        'L1_2MU4_J40_XE20',
         'L1_MU20_J40',
         'L1_MU20_XE30',
-        'L1_MU20_J50',
 
         # single jet
-        "L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100",  "L1_J400", #"L1_J120",
-        "L1_J20.31ETA49", "L1_J30.31ETA49", "L1_J50.31ETA49", "L1_J75.31ETA49", 
-        'L1_J15.31ETA49',
+        "L1_J12","L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100", "L1_J120", "L1_J400",
+        "L1_J20.31ETA49", "L1_J30.31ETA49", "L1_J50.31ETA49", "L1_J75.31ETA49", "L1_J100.31ETA49",
+        #'L1_J15.23ETA49',
+         'L1_J15.31ETA49',
+        "L1_J20.28ETA31",
+        #'L1_J40.0ETA25', 
         "L1_J12_EMPTY","L1_J12_FIRSTEMPTY", "L1_J12_UNPAIRED_ISO", "L1_J12_UNPAIRED_NONISO", "L1_J12_ABORTGAPNOTCALIB", 
         "L1_J15.31ETA49_UNPAIRED_ISO",
         "L1_J30_EMPTY", "L1_J30_FIRSTEMPTY", "L1_J30.31ETA49_EMPTY", "L1_J30.31ETA49_UNPAIRED_ISO",
         "L1_J30.31ETA49_UNPAIRED_NONISO",
         "L1_J50_UNPAIRED_ISO", "L1_J50_UNPAIRED_NONISO", "L1_J50_ABORTGAPNOTCALIB",         
+        "L1_J12_BGRP12", "L1_J30.31ETA49_BGRP12",
         'L1_J100_FIRSTEMPTY',
- 
+        'L1_J100.31ETA49_FIRSTEMPTY',
         
         # multi jet
-        "L1_J45.0ETA20_3J15.0ETA25",
-        "L1_J50_2J40.0ETA25_3J15.0ETA25",
-        "L1_3J50", "L1_4J15", "L1_4J20", #"L1_4J20.0ETA49",
+
+        "L1_J20_J20.31ETA49",
+        "L1_3J15", "L1_3J20","L1_3J40", 'L1_3J15.0ETA25', "L1_3J50", "L1_4J15", "L1_4J20",
+        "L1_4J20.0ETA49",
         "L1_3J15.0ETA25_XE40",
         
+        #"L1_3J75",
+        #"L1_4J30",
         "L1_6J15",
+        "L1_J75_3J20",
         "L1_J85_3J30",
-       # multi jet forward
-        "L1_J25.0ETA23_2J15.31ETA49",
+        "L1_J30.0ETA49_2J20.0ETA49",
+
+        "L1_J15.0ETA25_2J15.31ETA49",
         "L1_J40.0ETA25_2J15.31ETA49",
         "L1_J40.0ETA25_2J25_J20.31ETA49",
-        "L1_J30.0ETA49_2J20.0ETA49",
+        "L1_J40.0ETA25_2J30_J20.31ETA49",
         
         # multi jet central
         "L1_3J25.0ETA23",
         "L1_3J35.0ETA23",
         "L1_4J15.0ETA25",
         "L1_5J15.0ETA25", 
+        
         # combined jet
-        "L1_2J15_XE55", "L1_J40_XE50",
+        "L1_2J15_XE55", "L1_J40_XE50", "L1_J75_XE50",
 
         #'L1_2J40_XE45',
-        "L1_2J50_XE40", "L1_J40_XE60",
-        
+        "L1_2J50_XE40", "L1_J40_XE60","L1_J40.0ETA25_XE50",
 
         # XE
         "L1_XE35", "L1_XE40", "L1_XE45", "L1_XE50", 
         "L1_XE55", "L1_XE60", "L1_XE70", "L1_XE80",
-        'L1_XE30', 'L1_XE300',
-        "L1_XE10",
+        'L1_XE10', 'L1_XE30', 'L1_XE65', 'L1_XE75', 'L1_XE150', 'L1_XE300',
         
         #XS
+        'L1_XS20', 'L1_XS30',
         'L1_EM12_XS20', 'L1_EM15_XS30',
         
         # TE
-#        'L1_TE5', ## disabled?
+        #"L1_TE3",        "L1_TE5",        "L1_TE10",        "L1_TE15",        "L1_TE20",        "L1_TE25",        "L1_TE30",        "L1_TE40",
+        #"L1_TE5",        "L1_TE30",        "L1_TE40",        "L1_TE45",        "L1_TE50",        "L1_TE55",        "L1_TE60",        "L1_TE65",
+        "L1_TE5",        "L1_TE10",        "L1_TE15",   "L1_TE20",  "L1_TE25",  "L1_TE30",        "L1_TE40",      "L1_TE70",      
 
-        #VTE + MBTS
-        #"L1_MBTS_1_VTE2", "L1_MBTS_1_VTE3", "L1_MBTS_1_VTE4", "L1_MBTS_1_VTE5", "L1_MBTS_1_VTE10", "L1_MBTS_2_VTE2", "L1_MBTS_2_VTE3", "L1_MBTS_2_VTE4", "L1_MBTS_2_VTE5", "L1_MBTS_2_VTE10", 
-        
-        #TE + MU
+        #"L1_TE3.0ETA24", "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", 
+        #"L1_TE5.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", "L1_TE45.0ETA24", "L1_TE50.0ETA24", "L1_TE55.0ETA24", "L1_TE60.0ETA24", "L1_TE65.0ETA24", 
+        "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24","L1_TE70.0ETA24",
 
         # MBTS
-        "L1_MBTS_1_EMPTY",
+        "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
+        "L1_MBTS_1_EMPTY", "L1_MBTS_1_UNPAIRED_ISO", 
+        "L1_MBTS_2_EMPTY", "L1_MBTS_2_UNPAIRED_ISO",
+        "L1_MBTS_1_1_EMPTY", "L1_MBTS_1_1_UNPAIRED_ISO","L1_MBTS_4_A_UNPAIRED_ISO","L1_MBTS_4_C_UNPAIRED_ISO",
+#        'L1_MBTSA0' ,'L1_MBTSA1' ,'L1_MBTSA2' ,'L1_MBTSA3' ,'L1_MBTSA4' ,
+#        'L1_MBTSA5' ,'L1_MBTSA6' ,'L1_MBTSA7' ,'L1_MBTSA8' ,
+#        'L1_MBTSA10','L1_MBTSA12','L1_MBTSA14',
+#        'L1_MBTSC0' ,'L1_MBTSC1' ,'L1_MBTSC2' ,'L1_MBTSC3' ,'L1_MBTSC4' ,
+#        'L1_MBTSC5' ,'L1_MBTSC6' ,'L1_MBTSC7' ,'L1_MBTSC8' ,
+#        'L1_MBTSC10','L1_MBTSC12','L1_MBTSC14',
         # beam splashes
-        
-        #Overlay
-#        "L1_MBTS_1_OVERLAY","L1_TE20_OVERLAY",
-        
-        #BeamSpot
-#        "L1_MBTS_1_VTE70",
+        "L1_MBTS_4_A", "L1_MBTS_4_C",
 
         #BGRP9
+        'L1_MBTS_1_BGRP9','L1_MBTS_2_BGRP9',
 
         #BGRP11
+        'L1_MBTS_1_BGRP11','L1_MBTS_2_BGRP11',
 
         # RNDM
-        'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO',  'L1_RD0_EMPTY',
-        "L1_RD1_EMPTY","L1_RD2_EMPTY",
-#        'L1_RD0_FIRSTEMPTY', 
-        'L1_RD0_ABORTGAPNOTCALIB',
-#        'L1_RD2_FILLED', # This is not needed?
+        'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO','L1_RD0_EMPTY',
+        "L1_RD1_FILLED","L1_RD1_EMPTY","L1_RD1_BGRP10",
+        "L1_RD2_FILLED","L1_RD2_EMPTY","L1_RD2_BGRP12",
+        "L1_RD3_FILLED","L1_RD3_EMPTY",
+        'L1_RD0_FIRSTEMPTY', 
+        'L1_RD0_BGRP9', 'L1_RD0_BGRP11', 'L1_RD0_ABORTGAPNOTCALIB',
 
         #LUCID
-#        'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
+        'L1_LUCID', 'L1_LUCID_EMPTY', 'L1_LUCID_UNPAIRED_ISO', 
+        'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
         #'L1_LUCID_COMM_EMPTY', 'L1_LUCID_COMM_UNPAIRED_ISO', 
 
-        
-
         # ZDC
-         # FTHR
+        'L1_ZDC_A', 'L1_ZDC_C', 'L1_ZDC_A_C',
+        'L1_ZDC_AND', # FTHR
 
         # VDM
-         #"L1_BGRP7",
+        'L1_BGRP9', #"L1_BGRP7",
 
         # TRT
         # "L1_TRT",
@@ -498,6 +569,7 @@ def defineMenu():
 #        "L1_TGC_BURST_EMPTY",
 
         # LHCF
+        "L1_LHCF", "L1_LHCF_UNPAIRED_ISO", "L1_LHCF_EMPTY",
     
         #CALREQ
         "L1_CALREQ2",
@@ -506,124 +578,244 @@ def defineMenu():
         "L1_ZB",
 
         # BPTX
+        "L1_BPTX0_BGRP0", "L1_BPTX1_BGRP0",
         
         # BCM
-         #'L1_BCM_AC_CA_UNPAIRED_ISO',
-        'L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO',
+        'L1_BCM_Wide_BGRP0','L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO', 'L1_BCM_AC_CA_UNPAIRED_ISO',
         'L1_BCM_AC_UNPAIRED_ISO','L1_BCM_CA_UNPAIRED_ISO',
         'L1_BCM_AC_UNPAIRED_NONISO','L1_BCM_CA_UNPAIRED_NONISO',
         'L1_BCM_AC_ABORTGAPNOTCALIB', 'L1_BCM_CA_ABORTGAPNOTCALIB','L1_BCM_Wide_ABORTGAPNOTCALIB',
         'L1_BCM_AC_CALIB', 'L1_BCM_CA_CALIB','L1_BCM_Wide_CALIB',
 
         #AFP
-#         'L1_AFP_FSC', 
-#        'L1_AFP_C_ANY', 'L1_AFP_C_ANY_UNPAIRED_ISO', 'L1_AFP_C_ANY_UNPAIRED_NONISO', 'L1_AFP_C_ANY_EMPTY', 'L1_AFP_C_ANY_FIRSTEMPTY', 'L1_AFP_C_AND',
-
-#	'L1_EM7_AFP_A_AND_C','L1_EM12_AFP_A_AND_C',
-
+        'L1_AFP_NSC', 'L1_AFP_FSC', 
+        'L1_AFP_C_ANY', 'L1_AFP_C_ANY_UNPAIRED_ISO', 'L1_AFP_C_ANY_UNPAIRED_NONISO', 'L1_AFP_C_ANY_EMPTY', 'L1_AFP_C_ANY_FIRSTEMPTY', 'L1_AFP_C_AND',
 
-          #--------------------------------
+        #--------------------------------
         # TOPO items
         #--------------------------------
 
         # B-jet
-        #'L1_BTAG-MU4J15',
-        #'L1_BTAG-MU6J20',
-
-        # ZH - all removed
-   
-
-        #Higgsino
-        'L1_2MU4_J40_XE50',
-        'L1_MU4_J30_XE40_DPHI-J20s2XE30','L1_MU4_J50_XE50_DPHI-J20s2XE30',
-        'L1_MU4_XE60',
+        'L1_BTAG-MU4J15', 'L1_BTAG-MU4J30', 'L1_BTAG-MU6J20', 'L1_BTAG-MU6J25',
+        #'L1_BTAG-MU4J20',
+        'L1_3J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J30', 'L1_3J15_BTAG-MU6J25', 'L1_3J20_BTAG-MU4J20',
+        #'L1_3J20_BTAG-MU4J30', 'L1_3J20_BTAG-MU6J25',
+
+        # ZH
+        'L1_DPHI-AJ20s2XE50', 'L1_J40_DPHI-J20s2XE50', 'L1_J40_DPHI-J20XE50', 'L1_J40_DPHI-CJ20XE50', #'L1_J40_DPHI-J20s2XE30',
+#SX        'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B',
+#SX        'L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B',
+#SX        'L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO',
+#SX        'L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO',
 
         # HT
+        'L1_HT190-J15.ETA21',
         'L1_HT190-J15s5.ETA21',
+        'L1_HT150-J20.ETA31',
+        'L1_HT150-J20s5.ETA31',   
 
+        "L1_HT150-J20s5.ETA31_MJJ-400",
         "L1_HT150-J20s5.ETA31_MJJ-400-CF",
         
         # Jpsi T&P
-        'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
-#            
+        'L1_JPSI-1M5', 'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
+        'L1_KF-XE40', 'L1_KF-XE50', 'L1_KF-XE55', 'L1_KF-XE60', 'L1_KF-XE65', 'L1_KF-XE75',
         
-        # W T&P - all removed
-
+        # W T&P
+#        'L1_W-05DPHI-JXE-0',
+#        'L1_W-10DPHI-JXE-0',
+#        'L1_W-15DPHI-JXE-0',
+#        'L1_W-05DPHI-EMXE-1',
+        #'L1_W-15DPHI-EMXE-1',
+#        'L1_W-05DPHI-EM15XE-1',
+        #'L1_W-15DPHI-EM15XE-1',
+        'L1_W-05RO-XEHT-0',
+        'L1_W-90RO2-XEHT-0',
+        'L1_W-250RO2-XEHT-0',
+        'L1_W-HT20-JJ15.ETA49',
+        'L1_W-NOMATCH',
+        #'L1_W-NOMATCH_W-05RO-XEEMHT',
+        'L1_EM12_W-MT25',
+#        'L1_EM12_W-MT35',
+        'L1_EM15_W-MT35',
+        'L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE',
+        'L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE',
+        'L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE',
+        'L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE',
+        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+        'L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+        'L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+        'L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+        'L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+        'L1_EM12_W-MT35_XS50',
+        'L1_EM15_W-MT35_XS60',
+        'L1_EM10VH_W-MT35_XS50',
+        'L1_EM15VH_W-MT35_XS60',
+        'L1_EM20VH_W-MT35_XS60',
+        'L1_EM22VHI_W-MT35_XS40',
+        # Old
+        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0',
+        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
+        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE',
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+        #'L1_W-10DPHI-JXE-0',
+        #'L1_W-20DPHI-JXE-1',
+        #'L1_W-20DPHI-JXE-0',
+        #'L1_W-20DPHI-EMXE-1',
+        #'L1_W-20DPHI-EMXE-0',
+        #'L1_W-05RO-XEHT-0',
+        #'L1_W-08RO-XEHT-1',
+        #'L1_W-40RO2-XEHT-0',
+        #'L1_W-90RO2-XEHT-1',
+        #'L1_W-HT20-JJ0.ETA49',
+        #'L1_W-NOMATCH',
+        #'L1_W-NOMATCH_W-05RO-XEEMHT',
+        #'L1_EM3_W-MT20',
+        #'L1_EM3_W-MT40',
+
+        #Bphysics items
+#SX        'L1_BPH-DR-2MU4', 
+#SX        'L1_BPH-2M-2MU4', 
+#SX        'L1_BPH-4M8-2MU4',
+#SX        'L1_BPH-DR-2MU4_BPH-2M-2MU4', 'L1_BPH-DR-2MU4_BPH-4M8-2MU4',
+
+#SX        'L1_BPH-DR-2MU6', 
+#SX        'L1_BPH-2M-2MU6', 'L1_BPH-4M8-2MU6',
+#SX        'L1_BPH-DR-2MU6_BPH-2M-2MU6', 'L1_BPH-DR-2MU6_BPH-4M8-2MU6',
+
+        # temporarily commented out until CTP Simulation is fixed (menu generation and TMC understand multiplicity topo)
+#SX uncommenting
+        'L1_2MU4-BO',
+        'L1_2MU6-BO',
+        'L1_MU6MU4-BO', 
+
+        # L1 items for L1Topo streamers
+#SX        'L1_BPH-2M-2MU4-B',
+#SX        'L1_BPH-2M-2MU4-BO',
+#SX        'L1_BPH-2M-MU6MU4',
+#SX        'L1_BPH-2M-MU6MU4-B',
+#SX        'L1_BPH-2M-MU6MU4-BO',    
+#SX        'L1_BPH-4M8-2MU4-B',
+#SX        'L1_BPH-4M8-2MU4-BO',
+#SX        'L1_BPH-4M8-MU6MU4',
+#SX        'L1_BPH-4M8-MU6MU4-B',        
+#SX        'L1_BPH-4M8-MU6MU4-BO',
+        'L1_DY-DR-2MU4',
+        'L1_EM15VH_2EM8VH_MU6',
+        #'L1_DY-BOX-MU6MU4',
+        'L1_DY-BOX-2MU6',
+        'L1_LFV-MU',
         'L1_LFV-MU6',
-        'L1_LFV-MU11',
         'L1_LFV-EM8I',
         'L1_LFV-EM15I',
+        'L1_EM7_MU15',
+        'L1_EM8VH_MU15',
         'L1_DPHI-J20s2XE50',
         'L1_J40_XE50_DPHI-J20s2XE50',
+        'L1_DPHI-J20XE50',
+        'L1_DPHI-CJ20XE50',
+        'L1_MU4_J20_XE30_DPHI-J20s2XE30',
         'L1_2MU4_J20_XE30_DPHI-J20s2XE30',
+        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30',
+        'L1_3EM3_J40_XE50_DPHI-J20s2XE50',
+        'L1_MJJ-900',
+        'L1_MJJ-800',
         'L1_MJJ-700',
-        'L1_MJJ-300',
-        #'L1_MJJ-100',
-        #'L1_MJJ-400',
-        #'L1_MJJ-800',
-        'L1_MJJ-500-NFF',
-        'L1_J50_DETA20-J50J',
-        'L1_DPHI-2EM3',
-        #'L1_HT150-JJ15.ETA49',
-        #'L1_HT150-JJ15.ETA49_MJJ-400',
-        #'L1_J4-MATCH',
+        'L1_MJJ-400',
+        #'L1_MJJ-350',
+#        'L1_MJJ-300',
+#        'L1_MJJ-200',
+        'L1_MJJ-100',
+        'L1_HT150-JJ15.ETA49',
+        'L1_HT150-JJ15.ETA49_MJJ-400',
+        'L1_J4-MATCH',
         'L1_LLP-RO',
-        #'L1_LLP-NOMATCH',
-        #'L1_EM15TAU12I-J25',
-        'L1_DR-EM15TAU12I-J25',
-        #'L1_TAU20ITAU12I-J25',
+        'L1_LLP-NOMATCH',
+        'L1_DR-MU10TAU12I',    
+#        'L1_TAU12I-J25',    
+        'L1_EM15TAU12I-J25',
+        'L1_DR-EM15TAU12I',    
+        'L1_DR-EM15TAU12I-J25',    
+        'L1_TAU20ITAU12I-J25',
         'L1_DR-TAU20ITAU12I',    
+        'L1_BOX-TAU20ITAU12I',
         'L1_DR-TAU20ITAU12I-J25',
-        #'L1_DR-MU10TAU12I',
 
+        'L1_DR25-TAU20ITAU12I',
+        'L1_DR25-TAU20ITAU12I-J25',
         'L1_30M-EM20ITAU12',
         'L1_MJJ-400-CF',
     
-        #'L1_LAR-EM',
-        #'L1_LAR-J',
-        #'L1_LAR-ZEE',
-        #'L1_LAR-ZEE_LAR-EM',
-        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
-        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
-        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',
-        #'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO',
-
-        #ATR-19720 - no algorithm in master
-#        'L1_BPH-8M15-0DR22-2MU6',
-#        'L1_BPH-2M9-2DR15-2MU6',
-#        'L1_BPH-2M9-0DR15-MU6MU4',
-#        'L1_BPH-8M15-0DR22-MU6MU4-BO',
-#        'L1_BPH-2M9-0DR15-2MU4',
-#
-#        'L1_BPH-0M9-EM7-EM5',        
-#        'L1_BPH-0DR3-EM7J15',
-#        'L1_BPH-0M9-EM7-EM5_MU6',
-#        'L1_BPH-0DR3-EM7J15_MU6',
-#        'L1_BPH-0M9-EM7-EM5_2MU4',
-#        'L1_BPH-0DR3-EM7J15_2MU4',
-#
+        'L1_LAR-EM',
+        'L1_LAR-J',
+#SX        'L1_BPH-DR-2MU4-B',
+#SX        'L1_BPH-DR-2MU4-BO',
+#SX        'L1_BPH-DR-MU6MU4',
+#SX        'L1_BPH-DR-MU6MU4-B',
+#SX        'L1_BPH-DR-MU6MU4-BO',
+
+#new bhysics
+        #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4',
+        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
+        'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4',
+        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4', # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
+        'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
+        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',
+        'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',
+        'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',
+        'L1_2MU4-B',
+        'L1_2MU6-B' ,
+        #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4',
+        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4' ,
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B' ,
+        #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4' ,
+        #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4' ,
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO' ,
+        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+        'L1_MU6_2MU4-B',
+
+        'L1_BPH-2M8-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4',
+        'L1_BPH-8M15-MU6MU4',
+        'L1_BPH-8M15-2MU6',
+        
         # combined L1Topo for VBF
+        'L1_MU6_MJJ-200',
+        'L1_MU6_MJJ-300',
+        'L1_MU6_MJJ-400',
+        'L1_MU6_MJJ-500',
+        'L1_J30_2J20_4J20.0ETA49_MJJ-400',
+        'L1_J30_2J20_4J20.0ETA49_MJJ-700',
+        'L1_J30_2J20_4J20.0ETA49_MJJ-800',
+        'L1_J30_2J20_4J20.0ETA49_MJJ-900',
+        'L1_3J20_4J20.0ETA49_MJJ-400',
+        'L1_3J20_4J20.0ETA49_MJJ-700',
+        'L1_3J20_4J20.0ETA49_MJJ-800',
+        'L1_3J20_4J20.0ETA49_MJJ-900',
         
-        # INVM + DPHI 
-        #'L1_MJJ-400-NFF-0DPHI20',
-        'L1_MJJ-400-NFF-0DPHI22',
-        'L1_MJJ-400-NFF-0DPHI24',
-        'L1_MJJ-400-NFF-0DPHI26',
+        'L1_XE35_MJJ-200',
    
         ### ATR-15062
-        'L1_EM18VHI_MJJ-300',
+        'L1_EM18VH_MJJ-300',
 
-        'L1_LATE-MU10_XE50','L1_LATE-MU10_XE40', 'L1_LATE-MU10_J50',
+        'L1_LATE-MU10_XE50', 'L1_LATE-MU10_J50',
 
         'L1_TAU60_DR-TAU20ITAU12I',
 
-        'L1_SC111-CJ15',
-#        'L1_SC85-CJ15',
+        'L1_SC111',
+        'L1_SC85',
         
         ##     # Partition 1
         ##     'L1_CALREQ0_P1', 'L1_CALREQ1_P1', 'L1_CALREQ2_P1',
 
         #ALFA
+#ALFA_B7R1L_OD        'L1_ALFA_ELAST1',
+#        'L1_ALFA_ELAST2',
+#        'L1_ALFA_ELAST11','L1_ALFA_ELAST12',
+#        'L1_ALFA_ELAST13','L1_ALFA_ELAST14','L1_ALFA_ELAST15','L1_ALFA_ELAST15_Calib',
+#        'L1_ALFA_ELAST16','L1_ALFA_ELAST17','L1_ALFA_ELAST18','L1_ALFA_ELAST18_Calib',
 #        'L1_ALFA_SDIFF5','L1_ALFA_SDIFF6','L1_ALFA_SDIFF7','L1_ALFA_SDIFF8',
 #        'L1_MBTS_1_A_ALFA_C','L1_MBTS_1_C_ALFA_A','L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO',
 #        'L1_MBTS_2_A_ALFA_C','L1_MBTS_2_C_ALFA_A','L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO',
@@ -637,105 +829,64 @@ def defineMenu():
 #
 #        'L1_EM3_ALFA_EINE',
 #        'L1_J12_ALFA_ANY','L1_J12_ALFA_ANY_UNPAIRED_ISO',
-#        'L1_TE5_ALFA_ANY','L1_TE5_ALFA_ANY_UNPAIRED_ISO',
-#         'L1_TE5_ALFA_EINE',
+#        'L1_TE5_ALFA_ANY','L1_TE5_ALFA_ANY_UNPAIRED_ISO','L1_TE5_ALFA_EINE',
 #        'L1_TRT_ALFA_ANY','L1_TRT_ALFA_ANY_UNPAIRED_ISO',
 #        'L1_TRT_ALFA_EINE',
 #        #'L1_LHCF_ALFA_ANY_A',
 #        #'L1_LHCF_ALFA_ANY_C',
 ##        'L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO','L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO',
-#        'L1_ALFA_BGT','L1_ALFA_BGT_UNPAIRED_ISO',
+#        'L1_ALFA_BGT','L1_ALFA_BGT_UNPAIRED_ISO','L1_ALFA_BGT_BGRP10',
+#        'L1_ALFA_SHOWSYST5',
+#        'L1_ALFA_SYST9' ,'L1_ALFA_SYST10','L1_ALFA_SYST11','L1_ALFA_SYST12',
+#        'L1_ALFA_SYST17','L1_ALFA_SYST18',
+         'L1_ALFA_ANY',
+#        'L1_ALFA_ANY_EMPTY','L1_ALFA_ANY_FIRSTEMPTY','L1_ALFA_ANY_UNPAIRED_ISO','L1_ALFA_ANY_UNPAIRED_NONISO',
+#        'L1_ALFA_ANY_BGRP10','L1_ALFA_ANY_ABORTGAPNOTCALIB','L1_ALFA_ANY_CALIB',
+        'L1_ALFA_B7L1U','L1_ALFA_B7L1L','L1_ALFA_A7L1U','L1_ALFA_A7L1L','L1_ALFA_A7R1U','L1_ALFA_A7R1L','L1_ALFA_B7R1U','L1_ALFA_B7R1L',
 #        'L1_ALFA_ANY_A_EMPTY','L1_ALFA_ANY_C_EMPTY',
+#        'L1_ALFA_B7L1U_OD','L1_ALFA_B7L1L_OD','L1_ALFA_A7L1U_OD','L1_ALFA_A7L1L_OD','L1_ALFA_A7R1U_OD','L1_ALFA_A7R1L_OD','L1_ALFA_B7R1U_OD','L1_ALFA_B7R1L_OD',
+#        'L1_ALFA_B7L1_OD','L1_ALFA_A7L1_OD','L1_ALFA_B7R1_OD','L1_ALFA_A7R1_OD',
 #
-#         'L1_AFP_C_MBTS_A',
-#         'L1_AFP_C_ZDC_C',
-#         'L1_AFP_C_J12',
-#         'L1_AFP_C_EM3',
-#         'L1_AFP_C_TE5',
-#         'L1_AFP_C_ALFA_C',
-#         'L1_AFP_C_ALFA_A',
-#         'L1_AFP_C_ANY_MBTS_A',
-#         'L1_AFP_C_MU4',
-
-        # Items for beta*=90m run
-#        'L1_J12_ALFA_EINE',
-#        'L1_2EM3_ALFA_EINE',
-#        'L1_MU4_ALFA_ANY',
-#        'L1_MU4_ALFA_ANY_UNPAIRED_ISO',
-#        'L1_MU4_ALFA_ANY_PAIRED_UNPAIRED_ISO',
-#        'L1_MU4_ALFA_EINE',
-
-
-        #ATR-18815
-        #'L1_LFV-EM8I-MU11',
-        #'L1_LFV-EM12I-MU6',
-
-        #ATR-19355
-        'L1_BPH-0M10-3MU4',
-
-        #ATR-18824
-        'L1_ZAFB-04DPHI-EM15I',
-        'L1_ZAFB-25DPHI-EM15I',
-        #'L1_ZAFB-25DPHI-EM18I',
-
-        #ATR-19302: 
-#        'L1_DPHI-M70-2EM10I',
-        'L1_DPHI-M70-2EM12I',
-
-        #ATR-19510
-        'L1_DY-BOX-2MU4',
-        #'L1_DY-DR-2MU4',
-        'L1_DY-BOX-2MU6',
-
-                
-        #ATR-17320
-        'L1_CEP-CJ60',
-        'L1_CEP-CJ50' ,
-
-        #ATR-20174
-        'L1_BPH-8M15-2MU4-BO'
-
-
+         'L1_AFP_C_MBTS_A',
+         'L1_AFP_C_ZDC_C',
+         'L1_AFP_C_J12',
+         'L1_AFP_C_EM3',
+         'L1_AFP_C_TE5',
+         'L1_AFP_C_ALFA_C',
+         'L1_AFP_C_ALFA_A',
+         'L1_AFP_C_ANY_MBTS_A',
+         'L1_AFP_C_MU4',
 
         ]
     
 
-    #CTP IDs are taken from this mapping. Every L1 item needs a unique ctpid.
-    # Run this file as python <this file> to print out available IDs
-    # 463-464 are reserved for L1_RD2_BGRP14 and L1_RD3_BGRP15 (from run 2)
-    # 509-511 are reserved for CALREQ
+    # the CTP ID mapping still has to be defined, currently it is taken from the order of the items
+    #Free slot [ATR-14858], 16-08-16
+    #[82,143,377,378,379,406,409,416,480]
 
     
 
     Lvl1Flags.CtpIdMap = {
-
         'L1_EM3' : 0,
         'L1_EM7' : 1,
         'L1_EM12' : 2,
         'L1_EM8VH' : 3,
         'L1_EM10VH' : 4,
+        'L1_EM13VH' : 5,
         'L1_EM15' : 6,
-        'L1_EM30VHI' : 25,
-        'L1_EM15VHI' : 29,
-        'L1_EM24VHIM' : 30,
         'L1_EM15VH' : 7,
-        'L1_EM18VHI' : 8,
+        'L1_EM18VH' : 8,
         'L1_EM20VH' : 9,
         'L1_EM20VHI' : 10,
         'L1_EM22VHI' : 11,
-        'L1_EM22VH' : 295,
-        'L1_EM24VHI' : 392,
         'L1_EM3_EMPTY' : 12,
         'L1_EM7_EMPTY' : 13,
-        'L1_EM7_UNPAIRED_ISO' : 389,
-        'L1_EM7_FIRSTEMPTY' : 371,
-        'L1_EM20VH_FIRSTEMPTY' : 411,
         'L1_MU4' : 14,
         'L1_MU6' : 15,
         'L1_MU10' : 16,
         'L1_MU11' : 256,
+        'L1_MU15' : 17,
         'L1_MU20' : 18,
-        'L1_MU21' : 17,
         'L1_MU4_EMPTY' : 19,
         'L1_MU6_EMPTY' : 66,
         'L1_MU4_FIRSTEMPTY' : 20,
@@ -743,99 +894,103 @@ def defineMenu():
         'L1_MU4_UNPAIRED_ISO' : 22,
         'L1_2EM3' : 23,
         'L1_2EM7' : 24,
+        'L1_2EM10VH' : 25,
+        'L1_2EM13VH' : 26,
         'L1_2EM15' : 27,
         'L1_2EM15VH' : 28,
-        'L1_2EM15VHI' : 31,
-        'L1_2EM20VH' : 400,
-        'L1_EM20VH_3EM10VH' : 431,
-        'L1_EM7_MU10' : 65,
+        'L1_EM7_2EM3' : 29,
+        'L1_EM12_2EM3' : 30,
+        'L1_EM15VH_3EM7' : 31,
+        'L1_2EM18VH':398,
+        'L1_2EM20VH':400,
+        'L1_EM15VH_3EM10VH':401,
+        'L1_EM18VH_3EM8VH':406,
+        'L1_EM18VH_2EM10VH_3EM7':408,
+        'L1_EM20VH_3EM10VH':431, 
+        'L1_EM20VH_2EM10VH_3EM8VH':432,
         'L1_2MU4' : 32,
         'L1_2MU6' : 33,
         'L1_2MU10' : 34,
         'L1_2MU20_OVERLAY' : 35,
+        'L1_MU10_2MU6' : 36,
         'L1_MU11_2MU6' : 37,
         'L1_3MU4' : 38,
         'L1_MU6_2MU4' : 39,
         'L1_3MU6' : 40,
         'L1_4MU4' : 46,
-        'L1_MU6_3MU4' : 36,
-        'L1_2MU6_3MU4' : 42,
-        'L1_2MU11' : 48,
-        'L1_MU11_2MU10' : 49,
+        'L1_4J15.0ETA25' : 41,
+        'L1_EM15I_MU4' : 42,
         'L1_2EM8VH_MU10' : 43,
         'L1_EM15VH_MU10' : 44,
-        'L1_EM7_MU20' : 483,
-        'L1_EM8VH_MU20' : 484,
-        'L1_TAU5' : 50,
         'L1_TAU12' : 45,
         'L1_TAU12IM' : 47,
+        'L1_TAU20' : 49,
         'L1_TAU20IM' : 51,
         'L1_TAU30' : 53,
-        'L1_TAU30_EMPTY' : 341,
-        'L1_TAU30_UNPAIRED_ISO' : 343,
         'L1_TAU40' : 54,
         'L1_TAU60' : 55,
-        'L1_TAU90' : 56,
         'L1_TAU100' : 52,
+        'L1_TAU8' : 56,
         'L1_TAU8_EMPTY' : 57,
-        'L1_TAU8_UNPAIRED_ISO' : 388,
-        'L1_TAU8_FIRSTEMPTY' : 391,
         'L1_TAU20IM_2TAU12IM' : 58,
-        'L1_TAU60_2TAU40' : 458,
-        'L1_2TAU5' : 59,
-        'L1_2TAU8' : 166,
-        'L1_EM15VHI_2TAU12IM' : 60,
-        'L1_EM15VHI_2TAU12IM_J25_3J12' : 61,
-        'L1_EM15VHI_2TAU12IM_4J12' : 5,
-        'L1_EM15VHI_TAU40_2TAU15' : 62,
+        'L1_TAU20_2TAU12' : 59,
+        'L1_EM15HI_2TAU12IM' : 60,
+        'L1_EM15HI_2TAU12IM_J25_3J12' : 61,
+        'L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15' : 378,
+        'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
+        'L1_EM15HI_TAU40_2TAU15' : 62,
         'L1_MU10_TAU12IM' : 63,
         'L1_MU10_TAU12IM_J25_2J12' : 64,
-        'L1_MU10_TAU12IM_3J12' : 482,
+        'L1_EM7_MU10':65,
+        'L1_TAU30_EMPTY':341,
         'L1_MU10_TAU20IM' : 67,
         'L1_MU11_TAU20IM' : 430,
         'L1_MU10_TAU20IM_J25_2J20' : 377,
+
         'L1_TAU20IM_2TAU12IM_J25_2J20_3J12' : 70,
-        'L1_TAU20IM_2TAU12IM_4J12.0ETA23' : 316,
-        #'L1_TAU20IM_2TAU12IM_4J12.0ETA25' : 73,
-        'L1_TAU20IM_2TAU12IM_4J12.0ETA28' : 77,
-        'L1_TAU25IM_2TAU20IM_2J25_3J20' : 398,
+        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I' : 71,
+        'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
+        'L1_MU10_TAU12I-J25' : 73,
         'L1_TAU20IM_2J20_XE45' : 74,
-        'L1_TAU20IM_2J20_XE50' : 79,
-        'L1_EM15VHI_2TAU12IM_XE35' : 78,
-        'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
+        'L1_TAU30_UNPAIRED_ISO' :343,
+        'L1_TAU60_DR-TAU20ITAU12I' : 76,
+        'L1_EM15HI_2TAU12IM_XE35' : 78,
         'L1_MU10_TAU12IM_XE35' : 81,
+#        'L1_MU10_TAU12IM_XE40' : 82,
         'L1_TAU20IM_2TAU12IM_XE35' : 83,
+        'L1_TAU20_2TAU12_XE35' : 84,
         'L1_TAU40_2TAU12IM_XE40' : 429,
-        'L1_EM18VHI_3J20' : 172,
-        'L1_EM20VH_3J20' : 26,
+#        'L1_EM15VH_JJ15.23ETA49' : 86,
+        'L1_MU4_J12' : 87,
+        'L1_MU4_J50_XE40' : 330,
         'L1_MU6_J20' : 88,
-        'L1_MU6_J30.0ETA49_2J20.0ETA49' : 382,
         'L1_MU6_J40' : 89,
         'L1_MU6_J75' : 90,
-        'L1_MU10_2J20' : 278,
-        'L1_MU10_3J20' : 173,
-        'L1_MU10_2J15_J20' : 255,
-        'L1_MU20_J40' : 428,
+        'L1_2MU4_J40_XE20' : 331,
+        'L1_MU20_J40'  : 428,
         'L1_MU20_XE30' : 433,
-        'L1_MU20_J50' : 82,
+        'L1_J12' : 91,
         'L1_J15' : 92,
         'L1_J20' : 93,
         'L1_J25' : 94,
         'L1_J30' : 95,
+        
         'L1_J40' : 96,
         'L1_J50' : 97,
         'L1_J75' : 98,
         'L1_J85' : 99,
         'L1_J100' : 100,
-        #'L1_J120' : 101,
+        'L1_J120' : 101,
         'L1_J400' : 102,
-        #'L1_4J20.0ETA49' : 383,
         'L1_J20.31ETA49' : 103,
         'L1_J30.31ETA49' : 104,
         'L1_J50.31ETA49' : 105,
         'L1_J75.31ETA49' : 106,
+        'L1_J100.31ETA49' : 107,
+#        'L1_J40.0ETA25' : 108,
+        
         'L1_J15.31ETA49' : 109,
-        'L1_J30.0ETA49_2J20.0ETA49' : 137,
+        'L1_J20.28ETA31' : 110,
         'L1_J12_EMPTY' : 111,
         'L1_J12_FIRSTEMPTY' : 112,
         'L1_J12_UNPAIRED_ISO' : 113,
@@ -850,27 +1005,43 @@ def defineMenu():
         'L1_J50_UNPAIRED_ISO' : 121,
         'L1_J50_UNPAIRED_NONISO' : 122,
         'L1_J50_ABORTGAPNOTCALIB' : 123,
-        'L1_J100_FIRSTEMPTY' : 414,
-        'L1_J45.0ETA20_3J15.0ETA25' : 86,
-        'L1_J50_2J40.0ETA25_3J15.0ETA25' : 87,
+
+        'L1_J20_J20.31ETA49' : 125,
+        'L1_3J15' : 126,
+        'L1_3J20' : 127,
+        'L1_3J40' : 128,
+        'L1_3J15.0ETA25' : 129,
         'L1_3J50' : 130,
         'L1_4J15' : 131,
         'L1_4J20' : 132,
         'L1_3J15.0ETA25_XE40' : 184,
+        
+#        'L1_3J75' : 133,
+#        'L1_4J30' : 134,
         'L1_6J15' : 135,
+        'L1_J75_3J20' : 136,
         'L1_J85_3J30' : 480,
-        'L1_J25.0ETA23_2J15.31ETA49' : 335,
-        'L1_J40.0ETA25_2J15.31ETA49' : 181,
-        'L1_J40.0ETA25_2J25_J20.31ETA49' : 182,
-        'L1_3J25.0ETA23' : 373,
-        'L1_3J35.0ETA23' : 425,
-        'L1_4J15.0ETA25' : 41,
+        'L1_J30.0ETA49_2J20.0ETA49' : 137,
+
+       
+        'L1_TE10' : 138,
+        'L1_TE15' : 82,
+        'L1_TE25' : 143,
+
         'L1_5J15.0ETA25' : 140,
         'L1_2J15_XE55' : 141,
         'L1_J40_XE50' : 142,
-        'L1_2J50_XE40' : 175,
-        'L1_J40_XE60' : 176,
+        #'L1_J75_XE40' : 143,
+        'L1_J75_XE50' : 133,
+
         'L1_XE10': 68,
+        #'L1_XE25': 82,
+        'L1_XE30': 85,
+        'L1_XE65': 108,
+        'L1_XE75': 134,
+        'L1_XE150': 156,
+        'L1_XE300': 187,
+        
         'L1_XE35' : 144,
         'L1_XE40' : 145,
         'L1_XE45' : 146,
@@ -879,25 +1050,129 @@ def defineMenu():
         'L1_XE60' : 149,
         'L1_XE70' : 150,
         'L1_XE80' : 151,
-        'L1_XE30' : 85,
-        'L1_XE300' : 187,
+        'L1_XS20' : 152,
+        'L1_XS30' : 153,
         'L1_EM12_XS20' : 154,
         'L1_EM15_XS30' : 155,
+
+        'L1_TE30' : 157,
+        'L1_TE40' : 158,
+        'L1_TE70' : 159,
+        'L1_TE30.0ETA24' : 160,
+        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
+        'L1_BCM_AC_CA_UNPAIRED_ISO' : 162,
+        'L1_BCM_AC_UNPAIRED_ISO' : 163,
+        'L1_MBTS_1_EMPTY' : 164,
+        'L1_MBTS_1_UNPAIRED_ISO' : 165,
+        'L1_MBTS_2_EMPTY' : 166,
+        'L1_MBTS_2_UNPAIRED_ISO' : 167,
+        'L1_MBTS_1_1_EMPTY' : 168,
+        'L1_MBTS_1_1_UNPAIRED_ISO' : 169,
+
+        'L1_DPHI-AJ20s2XE50' : 171,
+        'L1_EM13VH_3J20' : 172,
+        'L1_EM18VH_3J20' : 295,
+        'L1_MU10_3J20' : 173,
+
+        'L1_2J50_XE40' : 175,
+        'L1_J40_XE60' : 176,
+        'L1_J40.0ETA25_XE50' : 177,
+        'L1_MU10_2J20' : 278,
+        'L1_TAU40_2TAU20IM' : 254,
+        'L1_MU10_2J15_J20' : 255,
+# freeing some CTPIDs  
+#        'L1_MBTSA0' : 170,
+#        'L1_MBTSA1' : 171,
+#        'L1_MBTSA2' : 172,
+#        'L1_MBTSA3' : 173,
+#        'L1_MBTSA4' : 174,
+#        'L1_MBTSA5' : 175,
+#        'L1_MBTSA6' : 176,
+#        'L1_MBTSA7' : 177,
+#        'L1_MBTSA8' : 178,
+#        'L1_MBTSA10' : 179,
+#        'L1_MBTSA12' : 180,
+#        'L1_MBTSA14' : 181,
+#        'L1_MBTSC0' : 182,
+#        'L1_MBTSC1' : 183,
+#        'L1_MBTSC2' : 184,
+#        'L1_MBTSC3' : 185,
+#        'L1_MBTSC4' : 186,
+#        'L1_MBTSC5' : 187,
+#        'L1_MBTSC6' : 188,
+#        'L1_MBTSC7' : 189,
+#        'L1_MBTSC8' : 190,
+#        'L1_MBTSC10' : 191,
+#        'L1_MBTSC12' : 192,
+#        'L1_MBTSC14' : 193,
+
+        
+        'L1_BPH-2M8-2MU4' : 178, # ATR-15197 'L1_BPH-2M9-2MU4' : 178,
+        'L1_BPH-8M15-MU6MU4' : 179,
+        'L1_BPH-8M15-2MU6' : 180,
+        'L1_J15.0ETA25_2J15.31ETA49': 305 , 
+        'L1_J40.0ETA25_2J15.31ETA49' : 181,
+        'L1_J40.0ETA25_2J25_J20.31ETA49' : 182,
+
+        "L1_J40.0ETA25_2J30_J20.31ETA49":250 , 
+
+        "L1_HT150-J20s5.ETA31_MJJ-400": 272 , ## noid(ea)
+        "L1_HT150-J20s5.ETA31_MJJ-400-CF": 273,
+        
+        ## the ctp ids are a mess.. no 7 consequetive ids are free.. but these here are:
+        'L1_AFP_C_MBTS_A':183,
+        'L1_AFP_C_ZDC_C':189,
+        'L1_AFP_C_J12':190,
+        'L1_AFP_C_EM3':191,
+        'L1_AFP_C_TE5':192,
+        'L1_AFP_C_ALFA_C':193,
+        'L1_AFP_C_ALFA_A':170,
+        'L1_AFP_C_ANY_MBTS_A':174,
+        'L1_AFP_C_MU4':379,   
+        
+#        'L1_EM8I' : 183,
+#        'L1_EM15I': 184,
+        'L1_MBTS_4_A_UNPAIRED_ISO' : 185,
+        'L1_MBTS_4_C_UNPAIRED_ISO' : 186,        
+        'L1_MBTS_4_A' : 194,
+        'L1_MBTS_4_C' : 195,
+        'L1_MBTS_1_BGRP9' : 196,
+        'L1_MBTS_2_BGRP9' : 197,
+        'L1_MBTS_1_BGRP11' : 198,
+        'L1_MBTS_2_BGRP11' : 199,
         'L1_RD0_FILLED' : 200,
         'L1_RD0_UNPAIRED_ISO' : 201,
         'L1_RD0_EMPTY' : 202,
+        'L1_RD1_FILLED' : 203,
         'L1_RD1_EMPTY' : 204,
+        'L1_RD1_BGRP10' : 188,
+        'L1_RD2_FILLED' : 205,
         'L1_RD2_EMPTY' : 206,
+        'L1_RD3_FILLED' : 207,
+        'L1_RD3_EMPTY' : 208,
+        'L1_RD0_FIRSTEMPTY' : 209,
+        'L1_RD0_BGRP9' : 210,
+        'L1_RD0_BGRP11' : 211,
+        'L1_LUCID' : 212,
+        'L1_LUCID_EMPTY' : 213,
+        'L1_LUCID_UNPAIRED_ISO' : 214,
+        'L1_LUCID_A_C_EMPTY' : 215,
+        'L1_LUCID_A_C_UNPAIRED_ISO' : 216,
+        'L1_LUCID_A_C_UNPAIRED_NONISO' : 217,
         'L1_TRT_FILLED' : 218,
         'L1_TRT_EMPTY' : 219,
-        'L1_RD0_ABORTGAPNOTCALIB' : 372,
         'L1_TGC_BURST' : 220,
-        'L1_ZB' : 240,
+#        'L1_TGC_BURST_EMPTY' : 184,
+        'L1_LHCF' : 221,
+        'L1_BCM_Wide_BGRP0' : 222,
         'L1_BCM_AC_CA_BGRP0' : 223,
         'L1_BCM_Wide_EMPTY' : 224,
         'L1_BCM_Wide_UNPAIRED_ISO' : 225,
-        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
-        'L1_BCM_AC_UNPAIRED_ISO' : 163,
+        'L1_MBTS_1' : 226,
+        'L1_MBTS_2' : 227,
+        'L1_MBTS_1_1' : 228,
+        
+      
         'L1_BCM_CA_UNPAIRED_ISO' : 229,
         'L1_BCM_AC_UNPAIRED_NONISO' : 230,
         'L1_BCM_CA_UNPAIRED_NONISO' : 231,
@@ -907,71 +1182,163 @@ def defineMenu():
         'L1_BCM_AC_CALIB' : 235,
         'L1_BCM_CA_CALIB' : 236,
         'L1_BCM_Wide_CALIB' : 237,
-        #'L1_BTAG-MU4J15' : 238,
-        #'L1_BTAG-MU6J20' : 243,
-        'L1_2MU4_J40_XE50' : 449,
-        'L1_MU4_J30_XE40_DPHI-J20s2XE30' : 452,
-        'L1_MU4_J50_XE50_DPHI-J20s2XE30' : 453,
-        'L1_MU4_XE60' : 454,
+        'L1_BTAG-MU4J15' : 238,
+        'L1_BTAG-MU4J30' : 239,
+        'L1_ZB' : 240,
+        'L1_BPTX0_BGRP0' : 241,
+        'L1_BPTX1_BGRP0' : 242,
+        'L1_BTAG-MU6J20' : 243,
+        'L1_BTAG-MU6J25' : 244,
+#        'L1_BTAG-MU4J20' : 245,
+        'L1_3J15_BTAG-MU4J15' : 246,
+        'L1_3J15_BTAG-MU4J30' : 247,
+        'L1_3J15_BTAG-MU6J25' : 248,
+        'L1_3J20_BTAG-MU4J20' : 249,
+#        'L1_J40_DPHI-Js2XE50' : 250,
+        'L1_J40_DPHI-J20s2XE50' : 251,
+        #'L1_J40_DPHI-J20s2XE30' : 257,
+        'L1_J40_XE50_DPHI-J20s2XE50': 245,
+        'L1_J40_DPHI-J20XE50' : 252,
+        'L1_J40_DPHI-CJ20XE50' : 253,
+        'L1_MU4_J20_XE30_DPHI-J20s2XE30' : 257,
+        'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
+        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30' : 434,
+        'L1_3EM3_J40_XE50_DPHI-J20s2XE50' : 435,
+#SX
+#        'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B' : 254,
+#        'L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B' : 255,
+#        'L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO' : 256,
+#        'L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO' : 257,
+
+        
+        'L1_HT190-J15.ETA21' : 258,
         'L1_HT190-J15s5.ETA21' : 259,
-        'L1_HT150-J20s5.ETA31_MJJ-400-CF' : 91,
+        'L1_HT150-J20.ETA31' : 260,
+        'L1_HT150-J20s5.ETA31' : 261,
+        'L1_JPSI-1M5' : 262,
         'L1_JPSI-1M5-EM7' : 263,
         'L1_JPSI-1M5-EM12' : 264,
+        'L1_KF-XE40' : 265,
+        'L1_KF-XE50' : 266,
+        'L1_KF-XE55' : 267,
+        'L1_KF-XE60' : 268,
+        'L1_KF-XE65' : 269,
+        'L1_KF-XE75' : 270,
+#        'L1_W-05DPHI-JXE-0' : 271,
+#        'L1_W-10DPHI-JXE-0' : 272,
+#        'L1_W-15DPHI-JXE-0' : 273,
+        #'L1_W-15DPHI-EMXE-1' : 271,
+        #'L1_W-15DPHI-EM15XE-1' : 272,
+#        'L1_W-05DPHI-EMXE-1' : 276,
+        'L1_W-05RO-XEHT-0' : 277,
+        'L1_W-90RO2-XEHT-0' : 279,
+        'L1_W-250RO2-XEHT-0' : 280,
+        'L1_W-HT20-JJ15.ETA49' : 281,
+        'L1_W-NOMATCH' : 282,
+        #'L1_W-NOMATCH_W-05RO-XEEMHT' : 283,
+        'L1_EM10_W-MT25' : 284,
+        'L1_EM15_W-MT35' : 286,
+        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0' : 287,
+        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30' : 288,
+        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20' : 289,
+        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE' : 290,
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_W-250RO2-XEHT-0' : 291,
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS60' : 292,
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS30' : 293,
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE' : 294,
+#SX
+#        'L1_BPH-DR-2MU4' : 295,
+#        'L1_BPH-2M-2MU4' : 296,
+#        'L1_BPH-4M8-2MU4' : 297,
+#        'L1_BPH-DR-2MU4_BPH-2M-2MU4' : 298,
+#        'L1_BPH-DR-2MU4_BPH-4M8-2MU4' : 299,
+#        'L1_BPH-DR-2MU6' : 300,
+#        'L1_BPH-2M-2MU6' : 301,
+#        'L1_BPH-4M8-2MU6' : 302,
+#        'L1_BPH-DR-2MU6_BPH-2M-2MU6' : 303,
+#        'L1_BPH-DR-2MU6_BPH-4M8-2MU6' : 304,
+#        'L1_BPH-2M-2MU4-B' : 305,
+#        'L1_BPH-2M-2MU4-BO' : 306,
+#        'L1_BPH-2M-MU6MU4' : 307,
+#        'L1_BPH-2M-MU6MU4-B' : 308,
+#        'L1_BPH-2M-MU6MU4-BO' : 309,
+#        'L1_BPH-4M8-2MU4-B' : 310,
+#        'L1_BPH-4M8-2MU4-BO' : 311,
+#        'L1_BPH-4M8-MU6MU4' : 312,
+#        'L1_BPH-4M8-MU6MU4-B' : 313,
+#        'L1_BPH-4M8-MU6MU4-BO' : 314,
+
+#SX adding
+        #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4' : 295,
+        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4'  : 296, #  ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4'  : 296,
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4'  : 297,
+        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4'  : 298, # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4'  : 298,
+        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4'  : 299,
+        'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6' : 300,
+        'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6'  : 301,
+        'L1_MU6MU4-BO' : 302,
+        'L1_2MU4-B' : 303,
+        'L1_2MU6-B'  : 304,
+        #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4'  : 305,
+        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4'  : 306,
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'  :  307,
+        #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4'   : 308,
+        #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4'  : 309,
+        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO'  : 310,
+        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4' : 311,
+        'L1_2MU4-BO' : 312,
+        'L1_2MU6-BO' : 313,
+        'L1_MU6_2MU4-B'  : 314,
+
+        ### ATR-14350 - these should be replaced in 2017 with items 296 and 298
+        'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4' : 426,
+        'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' : 427,
+
+
+        'L1_DY-DR-2MU4' : 315,
+        'L1_EM15VH_2EM8VH_MU6' : 316,
+        #'L1_DY-BOX-MU6MU4' : 317,
+        'L1_DY-BOX-2MU6' : 318,
+        'L1_LFV-MU' : 319,
         'L1_LFV-MU6' : 332,
-        'L1_LFV-MU11' : 364,
         'L1_LFV-EM8I' : 320,
         'L1_LFV-EM15I' : 321,
+        'L1_EM7_MU15' : 322,
+        'L1_EM8VH_MU15' : 48,
         'L1_DPHI-J20s2XE50' : 323,
-        'L1_J40_XE50_DPHI-J20s2XE50' : 245,
-        'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
-        'L1_MJJ-700' : 216,
-        'L1_MJJ-300' : 331,
-        #'L1_MJJ-100' : 333,
-        #'L1_MJJ-400' : 329,
-        #'L1_MJJ-800' : 327,
-        'L1_MJJ-500-NFF' : 108,
-        'L1_J50_DETA20-J50J' : 275,
-        'L1_DPHI-2EM3' : 288,
-        #'L1_HT150-JJ15.ETA49' : 334,
-        #'L1_HT150-JJ15.ETA49_MJJ-400' : 416,
-        #'L1_J4-MATCH' : 336,
+        'L1_DPHI-J20XE50' : 324,
+        'L1_DPHI-CJ20XE50' : 325,
+        'L1_MJJ-900' : 326,
+        'L1_MJJ-800' : 327,
+        'L1_MJJ-700' : 328,
+        'L1_MJJ-400' : 329,
+        #'L1_MJJ-350' : 330,
+#        'L1_MJJ-300' : 331,
+#        'L1_MJJ-200' : 332,
+        'L1_MJJ-100' : 333,
+        'L1_HT150-JJ15.ETA49' : 334,
+        'L1_J4-MATCH' : 336,
         'L1_LLP-RO' : 338,
-        #'L1_LLP-NOMATCH' : 339,
-        #'L1_EM15TAU12I-J25' : 345,
-        #'L1_DR-MU10TAU12I' : 340,
-        #'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
+        'L1_LLP-NOMATCH' : 339,
+        'L1_DR-MU10TAU12I' : 340,
+#        'L1_TAU12I-J25' : 341,
+        'L1_EM15TAU12I-J25' : 345,
         'L1_DR-EM15TAU12I-J25' : 346,
-        #'L1_TAU20ITAU12I-J25' : 347,
+        'L1_TAU20ITAU12I-J25' : 347,
         'L1_DR-TAU20ITAU12I' : 348,
+        'L1_BOX-TAU20ITAU12I' : 349,
         'L1_DR-TAU20ITAU12I-J25' : 350,
+
+        'L1_DR25-TAU20ITAU12I' : 337,
+
+        'L1_DR25-TAU20ITAU12I-J25' : 386,
         'L1_30M-EM20ITAU12' : 387,
-        'L1_MJJ-400-CF' : 397,
-        #'L1_LAR-EM' : 351,
-        #'L1_LAR-J' : 352,
-        #'L1_LAR-ZEE' : 71,
-        #'L1_LAR-ZEE_LAR-EM' : 285,
-        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4' : 426,
-        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' : 427,
-        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO' : 488,
-        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6' : 301,
-        'L1_BPH-8M15-0DR22-2MU6' : 107,
-        'L1_BPH-2M9-2DR15-2MU6' : 110,
-        'L1_BPH-2M9-0DR15-MU6MU4' : 125,
-        'L1_BPH-8M15-0DR22-MU6MU4-BO' : 126,
-        'L1_BPH-2M9-0DR15-2MU4' : 127,
-        'L1_BPH-0M9-EM7-EM5' : 80,
-        'L1_BPH-0DR3-EM7J15' : 84,
-        'L1_BPH-0M9-EM7-EM5_MU6' : 124,
-        'L1_BPH-0DR3-EM7J15_MU6' : 134,
-        'L1_BPH-0M9-EM7-EM5_2MU4' : 153,
-        'L1_BPH-0DR3-EM7J15_2MU4' : 156,
-        #'L1_MJJ-400-NFF-0DPHI20' : 128,
-        'L1_MJJ-400-NFF-0DPHI22' : 129,
-        'L1_MJJ-400-NFF-0DPHI24' : 133,
-        'L1_MJJ-400-NFF-0DPHI26' : 136,
-        'L1_EM18VHI_MJJ-300' : 385,
-        'L1_LATE-MU10_XE50' : 354,
-        'L1_LATE-MU10_XE40' : 466,
+        'L1_MJJ-400-CF': 397,
+
+        'L1_LAR-EM' : 351,
+        'L1_LAR-J' : 352,
+        'L1_DR-EM15TAU12I' : 353,        
+        'L1_LATE-MU10_XE50': 354,
         'L1_LATE-MU10_J50' : 355,
         'L1_SC111' : 356,
         'L1_SC85' : 357,
@@ -1133,6 +1500,20 @@ def defineMenu():
          'L1_ALFA_B7R1U' : 495,
          'L1_ALFA_B7R1L' : 496,
 
+        
+#        'L1_ALFA_B7L1U_OD' : 497,
+#        'L1_ALFA_B7L1L_OD' : 498,
+#        'L1_ALFA_A7L1U_OD' : 499,
+#        'L1_ALFA_A7L1L_OD' : 500,
+#        'L1_ALFA_A7R1U_OD' : 501,
+#        'L1_ALFA_A7R1L_OD' : 502,
+#        'L1_ALFA_B7R1U_OD' : 503,
+#        'L1_ALFA_B7R1L_OD' : 504,
+#        'L1_ALFA_B7L1_OD'  : 505,
+#        'L1_ALFA_A7L1_OD'  : 506,
+#        'L1_ALFA_B7R1_OD'  : 507,
+#        'L1_ALFA_A7R1_OD'  : 508,
+        'L1_CALREQ2' : 511,  # never use 509-511 for anything else than CALREQ triggers
 }
 
 
-- 
GitLab


From 22bd707ee01635816b34b0af5f7fbe8f0f6ff22f Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Tue, 25 Aug 2020 16:41:47 +0200
Subject: [PATCH 113/422] Pulled changes from upstream to allow
 PFEgamFlowElement Algs to pass jenkins tests

-- 
GitLab


From cf40e233907a09e99bfb8807003a6bf5b43a7a6c Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Tue, 25 Aug 2020 19:56:51 +0100
Subject: [PATCH 114/422] Cleanup

---
 .../TrigInDetConfig/python/TrigInDetConfig.py | 20 +++++++++----------
 .../share/runHLT_standalone_newJO.py          |  9 ++++-----
 2 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
index 7a13525be5f5..493b12233d59 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
@@ -120,7 +120,7 @@ def SiTrackMaker_xkCfg(flags, **kwargs):
   acc.merge( SiDetElementsRoadMaker_xkCfg( flags, **kwargs ) )
   combTrackFinderTool = acc.popToolsAndMerge( SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ) )
 
-  from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline, addFolders
+  from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
   acc.merge(addFoldersSplitOnline( flags, "INDET", '/Indet/Onl/TrkErrorScaling', '/Indet/TrkErrorScaling', className="CondAttrListCollection") )
 
   acc.addCondAlgo( CompFactory.RIO_OnTrackErrorScalingCondAlg(ErrorScalingType = ["PixelRIO_OnTrackErrorScaling", "SCTRIO_OnTrackErrorScaling", "TRTRIO_OnTrackErrorScaling"],
@@ -181,22 +181,20 @@ def InDetTestPixelLayerToolCfg(flags, **kwargs):
 def InDetHoleSearchToolCfg(flags, **kwargs):
   acc = ComponentAccumulator()
 
-  from InDetConfig.InDetRecToolConfig import InDetSCT_ConditionsSummaryToolCfg
-  sctCondSummaryTool = acc.popToolsAndMerge( InDetSCT_ConditionsSummaryToolCfg( flags,withFlaggedCondTool=False, withTdaqTool=False ) )
+# a possible change in HoleSearchTool impl? - This two tools do not seem to be needed now, leaving them commented out  TODO - decide if can be removed ( also func above creting the config ) 
+#  from InDetConfig.InDetRecToolConfig import InDetSCT_ConditionsSummaryToolCfg
+#  sctCondSummaryTool = acc.popToolsAndMerge( InDetSCT_ConditionsSummaryToolCfg( flags,withFlaggedCondTool=False, withTdaqTool=False ) )
 
-  acc.merge( InDetTestPixelLayerToolCfg( flags, **kwargs ) )
+#  acc.merge( InDetTestPixelLayerToolCfg( flags, **kwargs ) )
 
-  from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg
-  acc.merge( InDetExtrapolatorCfg( flags, name = "TrigInDetExtrapolator" ) )
-  #acc.addPublicTool(extrapolator)
+#  from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg
+#  acc.merge( InDetExtrapolatorCfg( flags, name = "TrigInDetExtrapolator" ) )
 
   name = kwargs.pop("name", "InDetTrigHoleSearchTool")
   tool = CompFactory.InDet.InDetTrackHoleSearchTool(name,
                                                     Extrapolator =  acc.getPublicTool( "TrigInDetExtrapolator" ),
-                                                      #usePixel      = flags.Detector.RecoPixel, #DetFlags.haveRIO.pixel_on(),
-                                                      #useSCT        = flags.Detector.RecoSCT, #DetFlags.haveRIO.SCT_on(),
-                                                    #SctSummaryTool = sctCondSummaryTool,
-                                                    #PixelLayerTool = acc.getPublicTool( "InDetTrigTestPixelLayerTool" ),
+                                                    # SctSummaryTool = sctCondSummaryTool,
+                                                    # PixelLayerTool = acc.getPublicTool( "InDetTrigTestPixelLayerTool" ),
                                                     )
   acc.addPublicTool( tool )
   return acc
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py
index 4ee77227c304..f2e036de525c 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py
@@ -60,7 +60,7 @@ flags.InDet.usePixelDCS=False
 flags.lock()
 
 
-from AthenaCommon.Constants import INFO,DEBUG,WARNING,VERBOSE
+from AthenaCommon.Constants import INFO,DEBUG,WARNING
 acc = MainServicesCfg( flags )
 acc.getService('AvalancheSchedulerSvc').VerboseSubSlots = True
 
@@ -93,13 +93,12 @@ logging.getLogger('forcomps').setLevel(DEBUG)
 acc.foreach_component("*/L1Decoder").OutputLevel = DEBUG
 acc.foreach_component("*/L1Decoder/*Tool").OutputLevel = DEBUG # tools
 acc.foreach_component("*HLTTop/*Hypo*").OutputLevel = DEBUG # hypo algs
-acc.foreach_component("*HLTTop/*Hypo*/*Tool*").OutputLevel = DEBUG # hypo tools
-acc.foreach_component("*HLTTop/RoRSeqFilter/*").OutputLevel = DEBUG # filters
+acc.foreach_component("*HLTTop/*Hypo*/*Tool*").OutputLevel = INFO # hypo tools
+acc.foreach_component("*HLTTop/RoRSeqFilter/*").OutputLevel = INFO# filters
 acc.foreach_component("*HLTTop/*Input*").OutputLevel = DEBUG # input makers
-acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = DEBUG # messaging from the EDM creators
+acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = WARNING # messaging from the EDM creators
 acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING # silcence mon tools (addressing by type)
 
-acc.foreach_component("*HLTTop/*/Menu1Electron_step1/*").OutputLevel = VERBOSE 
 
 
 acc.printConfig(withDetails=False, summariseProps=True, printDefaults=True)
-- 
GitLab


From 54b3d68cd0341a28b316d2684941402034d3c9ba Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Wed, 26 Aug 2020 12:34:50 +0200
Subject: [PATCH 115/422] fix q431 error in xAODPflow dictionary

---
 Event/xAOD/xAODPFlow/xAODPFlow/selection.xml   | 2 +-
 Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
index 2a1baeb97edb..25336c37b364 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
@@ -49,6 +49,6 @@
    <class name="std::vector<std::vector<std::pair<ElementLink<xAOD::CaloClusterContainer_v1>,double> > >" />
    <class name="std::vector<xAOD::PFODetails::PFOLeptonType>" />
    <class name="std::vector<std::vector<std::pair<ElementLink<xAOD::FlowElementContainer_v1>, double> > >" /> 
-   <class name="std::vector<std::vector<ElementLink<DataVector<xAOD::FlowElement_v1> > > >  "/>
+   
 
 </lcgdict>
diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h b/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
index bd5b4a687bc1..b5b4191943a2 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
@@ -45,12 +45,10 @@ namespace {
      // xAOD::PFO objects. :-(
      std::pair< ElementLink< xAOD::CaloClusterContainer >, double > dummy1;
      std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > > dummy2;
-     std::vector< std::vector<ElementLink<xAOD::FlowElementContainer_v1>, double >> dummy3;
+     std::vector< std::vector<ElementLink<xAOD::FlowElementContainer_v1>, double >> dummy3; // fixes issues in eflowRec
      std::vector< std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > >  > dummy4;
      std::vector< xAOD::PFODetails::PFOLeptonType > dummy5;
 
-     // fixes some issues in eflowRec
-     std::vector<std::vector<ElementLink<DataVector<xAOD::FlowElement_v1> > > > dummy6;
 
    };
 }
-- 
GitLab


From 4ab20e6cca235e2926731e5eacb090a23a4ff961 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 26 Aug 2020 14:02:26 +0200
Subject: [PATCH 116/422] Working version; problems with automatic BCID

---
 .../AFP/Run3AFPMonitoring/CMakeLists.txt      |   8 +-
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  23 +-
 .../Run3AFPMonitoring/AFPToFAlgorithm.h       |   9 -
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  52 +---
 .../AFP/Run3AFPMonitoring/src/AFPFastReco.cxx |  31 --
 .../src/AFPSiLayerAlgorithm.cxx               | 279 ++++++------------
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx |  57 ----
 7 files changed, 118 insertions(+), 341 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index 4f1c65d2739a..13d0472bee02 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -31,6 +31,10 @@ atlas_depends_on_subdirs(
         Trigger/TrigAnalysis/TrigDecisionTool
         Trigger/TrigAnalysis/TrigAnalysisInterfaces
         MuonSpectrometer/MuonAlignment/MuonAlignmentData
+        
+        Event/EventContainers
+        Tools/PathResolver
+        Control/StoreGate
 )
 
 # External dependencies:
@@ -50,9 +54,9 @@ atlas_add_component( Run3AFPMonitoring
         LumiBlockCompsLib
         LumiBlockData
         TrigDecisionToolLib
-#        TrigAnalysisInterfaces
+        TrigAnalysisInterfaces
         xAODForward
-        #xAODTrigger
+        xAODTrigger
         #Trigger
         AthenaKernel
         SGAudCore
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index a71ff01d4096..c12538f6e0c0 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -12,6 +12,8 @@
 #include "xAODForward/AFPSiHitContainer.h"
 #include "xAODForward/AFPSiHit.h"
 //#include "LumiBlockData/BunchCrossingCondData.h"
+// 2
+#include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
 
 #include "TRandom3.h"
 
@@ -23,27 +25,16 @@ public:
 	virtual ~AFPSiLayerAlgorithm();
 	virtual StatusCode initialize() override;
 	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
-	virtual StatusCode execute(const EventContext& ctx) const override;
+	//virtual StatusCode execute(const EventContext& ctx) const override;
 	
 private:
-<<<<<<< HEAD
 	std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
 	std::map<std::string,int> m_TrackGroup; 
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
-//	ToolHandle<Trig::IBunchCrossingTool> m_bcTool;
-	//SG::ReadCondHandleKey<BunchCrossingCondData>  m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
-	//BunchCrossingCondData m_bunchCrossingCondTool;
-	
-	//SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingCondTool {this, "BunchCrossingCondDataKey", "BunchCrossingData" ,"SG Key of BunchCrossing CDO"};
-	//SG::ReadHandleKey<BunchCrossingCondData> m_bunchCrossingCondTool;
-	//ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool;
-	//ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool{this, "BunchCrossingTool",""};
-	
-=======
-    std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
-    std::map<std::string,int> m_TrackGroup; 
-    SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
->>>>>>> upstream/master
+	// 2
+	ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool;
+
+
 
 protected:
 	std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
index 96b7ec020aa5..0f19a5f3d1b1 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -21,7 +21,6 @@ public:
 	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 
 private:
-<<<<<<< HEAD
 	std::map<std::string,int> m_HitmapGroupsToF;
    
 	SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
@@ -29,15 +28,7 @@ private:
 protected:
 	// Only 0 and 3 are ToF stations (farAside and farCside)
 	std::vector<std::string> m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" };
-=======
-   std::map<std::string,int> m_HitmapGroupsToF;
-   
-   SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
 
-protected:
-   // Only 0 and 3 are ToF stations (farAside and farCside)
-   std::vector<std::string> m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" };
->>>>>>> upstream/master
    
 };
 #endif
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index f1f877db2b4f..9c194969f0d8 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -28,7 +28,6 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
     AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
-<<<<<<< HEAD
     AFPSiGroup.defineHistogram('lb,nSiHits', title='Total number of hits;lb;total number of Hits', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
     AFPSiGroup.defineHistogram('lb,muPerBCID', title='<mu>;lumiBlock;<mu>', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
     #AFPSiGroup.defineHistogram('layerNumber,layerEfficiency', title='LayerEfficiency;layerNumber', path='SiT/', xbins = 16, xmin=0.5, xmax=16.5, ybins=100, ymin=0, ymax=1)
@@ -37,31 +36,23 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPToFGroup.defineHistogram('lb,nTofHits', title='Multiplicity;lb;total number of Hits', type='TProfile', path='ToF/', xbins=1000, xmin=-0.5, xmax=999.5) 
     AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
     AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
-=======
-    AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/',xbins=1000,xmin=-0.5,xmax=999.5 ) 
-    AFPToFGroup.defineHistogram('lb,nTofHits', title='Luminosity Block;lb;total number of Hits', type='TProfile',  path='ToF/',xbins=1000,xmin=-0.5,xmax=999.5) 
-
-    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
-    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
->>>>>>> upstream/master
-
 
     # Using a map of groups
     layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
     combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
 
     array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
-<<<<<<< HEAD
+
     array.defineHistogram('pixelColIDChip', title='Hits per column for {0} layer {1};pixelColIDChip; entries', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
     array.defineHistogram('pixelRowIDChip', title='Hits per row for {0} Layer {1};pixelRowIDChip; entries', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
     array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for {0} Layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
     array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for {0} Layer {1};timeOverThreshold; entries', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
     array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};x [mm];y [mm]', type='TH2F', path='Cluster', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
-    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event by <mu>', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event by <mu>', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event by <mu>', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event by<mu>', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerEvent by <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
+    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerEvent / <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
 
 
     array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
@@ -73,22 +64,6 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
     arrayOneList.defineHistogram('barInTrainID,trainID', title='ToF hit bar vs train {0};barInTrainID;trainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
-=======
-    array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-    array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
-    array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1};pixelColIDChip;pixelRowIDChip', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-    array.defineHistogram('timeOverThreshold', type='TH1F', title='1D Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
-    array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-
-
-    array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/Track/')
-    array.defineHistogram('trackX,trackY', title='Track posistion position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-
-
-
-    arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
-    arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
->>>>>>> upstream/master
 
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
@@ -106,7 +81,7 @@ if __name__=='__main__':
 
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
-<<<<<<< HEAD
+
     #nightly = '/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00361795.calibration_AFP.AODV1_EXT0'
     #file=''
     #file = '/afs/cern.ch/user/l/ladamczy/public/data18_13TeV.00354309.physics_Main.ESD._lb0130._SFO-1._0001.data.r22'
@@ -118,15 +93,8 @@ if __name__=='__main__':
     #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_6/aod0.pool.root']
     #ConfigFlags.Input.Files = ['/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1']
     ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
-=======
-    nightly = ''
-    file ='/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' 
-
-    
-    ConfigFlags.Input.Files = [nightly+file]
->>>>>>> upstream/master
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput46.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput47-Automatic.root'
     
     ConfigFlags.lock()
 
@@ -139,10 +107,6 @@ if __name__=='__main__':
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-<<<<<<< HEAD
     cfg.run(100)
-=======
-    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
 
->>>>>>> upstream/master
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
index e4df48f85d93..9234e1c3a024 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
@@ -26,7 +26,6 @@ void AFPFastReco::recoClusters()
 
     std::list toCluster(m_hitContainer->begin(), m_hitContainer->end());
 
-<<<<<<< HEAD
     while (toCluster.size() > 0) 
 	{
 		auto init = *(toCluster.begin());
@@ -57,36 +56,6 @@ void AFPFastReco::recoClusters()
 		const float z = yPlane * sin(tilt) + dz * layerID;
 
 		m_clusters.emplace_back(x, y, z, stationID, layerID);
-=======
-    while (toCluster.size() > 0) {
-      auto init = *(toCluster.begin());
-      toCluster.pop_front();
-      auto clusteredHits = findAround(init, toCluster);
-
-      float sumX      = 0;
-      float sumY      = 0;
-      float sumCharge = 0;
-      for (const xAOD::AFPSiHit* h : clusteredHits) {
-        const float charge = h->depositedCharge();
-        const float pixX   = dx * h->pixelColIDChip();
-        const float pixY   = dy * h->pixelRowIDChip();
-        sumX += charge * pixX;
-        sumY += charge * pixY;
-        sumCharge += charge;
-      }
-
-      const float xPlane = sumX / sumCharge;
-      const float yPlane = sumY / sumCharge;
-
-      const int stationID = init->stationID();
-      const int layerID   = init->pixelLayerID();
-
-      const float x = xPlane;
-      const float y = yPlane * cos(tilt);
-      const float z = yPlane * sin(tilt) + dz * layerID;
-
-      m_clusters.emplace_back(x, y, z, stationID, layerID);
->>>>>>> upstream/master
     }
 }
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 497d8755488c..e58f5e11bf79 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -13,6 +13,8 @@
 #include "xAODForward/AFPStationID.h"
 #include "EventInfo/EventID.h"
 
+#include <vector>
+
 
 	unsigned int clusterCounter[1000][4][4];
 	unsigned int clusterCounterFront[1000][4][4];
@@ -44,7 +46,7 @@
 	unsigned int counterForEventsStationEnd = 0;
 	unsigned int counterForEventsStationMiddle = 0;
 	
-	
+	/*
 	int frontBCIDs[] = {63,75,87,99,114,126,138,150,165,177,189,201,240,252,264,276,291,303,315,327,342,354,366,378,417,429,441,453,468,480,492,
 504,519,531,543,555,594,606,618,630,645,657,669,681,696,708,720,732,780,792,804,816,831,843,855,867,882,894,906,918,957,969,981,993,1008,1020,
 1032,1044,1059,1071,1083,1095,1134,1146,1158,1170,1185,1197,1209,1221,1236,1248,1260,1272,1311,1323,1335,1347,1362,1374,1386,1398,1413,1425,1437,
@@ -53,7 +55,9 @@
 2319,2331,2343,2382,2394,2406,2418,2433,2445,2457,2469,2484,2496,2508,2520,2568,2580,2592,2604,2619,2631,2643,2655,2670,2682,2694,2706,2745,2757,
 2769,2781,2796,2808,2820,2832,2847,2859,2871,2883,2922,2934,2946,2958,2973,2985,2997,3009,3024,3036,3048,3060,3099,3111,3123,3135,3150,3162,3174,
 3186,3201,3213,3225,3237,3276,3288,3300,3312,3327,3339,3351,3363,3378,3390,3402,3414,-1};
-	
+	*/
+	std::vector<int> frontBCIDsVector;
+	/*
 	int middleBCIDs[] = {64,65,66,67,68,69,76,77,78,79,80,81,88,89,90,91,92,93,100,101,102,103,104,105,115,116,117,118,119,120,127,128,129,130,131,132,139,140,141,142,143,144,151,
 152,153,154,155,156,166,167,168,169,170,171,178,179,180,181,182,183,190,191,192,193,194,195,202,203,204,205,206,207,241,242,243,244,245,246,253,254,255,256,257,258,
 265,266,267,268,269,270,277,278,279,280,281,282,292,293,294,295,296,297,304,305,306,307,308,309,316,317,318,319,320,321,328,329,330,331,332,333,343,344,345,346,347,
@@ -94,7 +98,9 @@
 3278,3279,3280,3281,3282,3289,3290,3291,3292,3293,3294,3301,3302,3303,3304,3305,3306,3313,3314,3315,3316,3317,3318,3328,3329,3330,3331,3332,3333,3340,3341,3342,3343,
 3344,3345,3352,3353,3354,3355,3356,3357,3364,3365,3366,3367,3368,3369,3379,3380,3381,3382,3383,3384,3391,3392,3393,3394,3395,3396,3403,3404,3405,3406,3407,3408,3415,
 3416,3417,3418,3419,3420,-1};
-	
+	*/
+	std::vector<int> middleBCIDsVector;
+	/*
 	int endBCIDs[] = {70,82,94,106,121,133,145,157,172,184,196,208,247,259,271,283,298,310,322,334,349,361,373,385,424,436,448,460,475,487,499,511,526,538,550,562,
 601,613,625,637,652,664,676,688,703,715,727,739,787,799,811,823,838,850,862,874,889,901,913,925,964,976,988,1000,1015,1027,1039,1051,1066,1078,1090,1102,1141,1153,
 1165,1177,1192,1204,1216,1228,1243,1255,1267,1279,1318,1330,1342,1354,1369,1381,1393,1405,1420,1432,1444,1456,1495,1507,1519,1531,1546,1558,1570,1582,1597,1609,1621,
@@ -102,7 +108,9 @@
 2137,2149,2161,2173,2212,2224,2236,2248,2263,2275,2287,2299,2314,2326,2338,2350,2389,2401,2413,2425,2440,2452,2464,2476,2491,2503,2515,2527,2575,2587,2599,2611,2626,
 2638,2650,2662,2677,2689,2701,2713,2752,2764,2776,2788,2803,2815,2827,2839,2854,2866,2878,2890,2929,2941,2953,2965,2980,2992,3004,3016,3031,3043,3055,3067,3106,3118,
 3130,3142,3157,3169,3181,3193,3208,3220,3232,3244,3283,3295,3307,3319,3334,3346,3358,3370,3385,3397,3409,3421,-1};
-	
+	*/
+	std::vector<int> endBCIDsVector;
+		
 	bool isInList(int bcid, int* arr)
 	{
 		int i=0;
@@ -116,16 +124,26 @@
 		}
 		return false;
 	}
+	
+	bool isInListVector(int bcid, std::vector<int> arr)
+	{
+		for(int i=0; i<arr.size(); i++)
+		{
+			if(arr[i] == bcid)
+				return true;
+		}
+		return false;
+	}
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
 , m_afpHitContainerKey("AFPSiHitContainer")
-//, m_bunchCrossingCondTool("BunchCrossingCondData")
-//, m_bcTool("Trig::TrigConfBunchCrossingTool/BunchCrossingTool")
+// 2
+, m_bunchCrossingTool("BunchCrossingTool")
 {
-	declareProperty( "AFPSiHitContainer", m_afpHitContainerKey );
-//	declareProperty("BCTool", m_bcTool);
-	//declareProperty("BunchCrossingCondData", m_bunchCrossingCondTool);
+	declareProperty("AFPSiHitContainer", m_afpHitContainerKey);
+	// 2
+	declareProperty("BunchCrossingTool", m_bunchCrossingTool);
 }
 
 
@@ -133,27 +151,17 @@ AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
 
 
 StatusCode AFPSiLayerAlgorithm::initialize() {
-<<<<<<< HEAD
+
 	using namespace Monitored;
 
 	m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
 	m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
-=======
-    using namespace Monitored;
- 
-    m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
-    m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
-    // We must declare to the framework in initialize what SG objects we are going to use:
-    SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
-    ATH_CHECK(m_afpHitContainerKey.initialize());
->>>>>>> upstream/master
+
 
 	// We must declare to the framework in initialize what SG objects we are going to use:
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
 	ATH_CHECK(m_afpHitContainerKey.initialize());
 	
-	//SG::ReadHandleKey<BunchCrossingCondData> bunchCrossingCondTool("bcidCondTool");
-	//ATH_CHECK(m_bunchCrossingCondTool.initialize());
 	
 	for(int a=0; a<1000; a++)
 	{
@@ -165,111 +173,72 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 			}
 		}
 	}
-	/*
-	StatusCode sc = m_bunchCrossingCondTool.retrieve();
-	if(sc.isFailure())
-	{
-		ATH_MSG_WARNING("\n\n\t\tUnable to retrieve m_bunchCrossingCondTool.\n\n");
-	}
-	else
-	{
-		ATH_MSG_WARNING("\n\n\t\tRetrieve works!!!.\n\n");
-	}
-	*/
-	//ATH_CHECK(m_bunchCrossingKey.initialize());
-	ATH_MSG_INFO("Initializing...");
-//	CHECK(m_bcTool.retrieve());
-	ATH_MSG_INFO("Retrieved the bunch crossing tool.");
+	
+	// 2
+	std::cout << "\n\nKrecemo!...\n\n";
+	m_bunchCrossingTool.setTypeAndName("Trig::MCBunchCrossingTool/BunchCrossingTool"); // this works, but LHCBunch doesn't
+	ATH_CHECK( m_bunchCrossingTool.retrieve() );
+	std::cout << "\n\n\n";
+	ATH_MSG_INFO( "initialization completed" );
+	std::cout << "\n\n\n";
+	std::cout << "Number of filled bunches: " << m_bunchCrossingTool.numberOfFilledBunches() << std::endl;
+	std::cout << "Number of bunch trains: " << m_bunchCrossingTool.numberOfBunchTrains() << std::endl;
 	return AthMonitorAlgorithm::initialize();
 }
 
-StatusCode AFPSiLayerAlgorithm::execute(const EventContext& ctx) const {
-	using namespace Monitored;
-	
+//StatusCode AFPSiLayerAlgorithm::execute(const EventContext& ctx) const {
+//	using namespace Monitored;
 
-<<<<<<< HEAD
-	
 	
-	//std::cout << "\n\t\t MAX_BCID: " << m_bunchCrossingCondTool.m_MAX_BCID;
-		
-	//std::cout << "\n\tNumber of filled bunches: " << m_bunchCrossingCondTool.numberOfFilledBunches() << "\n";	
-	//std::cout << "\tNumber of bunch trains: " << m_bunchCrossingCondTool.numberOfBunchTrains() << "\n";
-	unsigned int bcid_type = GetEventInfo(ctx)->bcid();
-/*	if(m_bcTool->isFilled(bcid_type))
-	{
-		std::cout << "Bunch is filled: " << bcid_type << " \n";
-	}
-*/
-	return StatusCode::SUCCESS;
-=======
-StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
-    using namespace Monitored;
-
-    // Declare the quantities which should be monitored:
-    auto lb = Monitored::Scalar<int>("lb", 0); 
-    auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
-    auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
-    auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
-    auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold", 0.0);
-    auto clusterX = Monitored::Scalar<float>("clusterX", 0.0);
-    auto clusterY = Monitored::Scalar<float>("clusterY", 0.0); 
-    auto trackX = Monitored::Scalar<float>("trackX", 0.0);
-    auto trackY = Monitored::Scalar<float>("trackY", 0.0);
-    
-    lb = GetEventInfo(ctx)->lumiBlock();
- 
-    SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
-    if(! afpHitContainer.isValid())
-    {
-	ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpHitContainerKey);
-	return StatusCode::SUCCESS;
-    }
+//	return StatusCode::SUCCESS;
+//}
 
-    ATH_CHECK( afpHitContainer.initialize() );
-
-    nSiHits = afpHitContainer->size();
-    fill("AFPSiLayerTool", lb, nSiHits);    
+StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
+	using namespace Monitored;
 
-    for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
-    {
-      pixelRowIDChip = hitsItr->pixelRowIDChip();
-      pixelColIDChip = hitsItr->pixelColIDChip();
-      timeOverThreshold = hitsItr->timeOverThreshold();
-	
-      if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
-      {
-        fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
+	for(int j=0; j<3500; j++)
+	{
+		if(!m_bunchCrossingTool->isFilled(j))
+			std::cout << "Not filled " << j << "\n";
+	}
 	
-      }
-	else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
-      }
-
-    AFPMon::AFPFastReco fast(afpHitContainer.get());
-    fast.reco();
-
-    for (const auto& cluster : fast.clusters()) {
-      clusterX = cluster.x;
-      clusterY = cluster.y;
-      fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterX, clusterY);
-    }
-
-    for (const auto& track : fast.tracks()) {
-      trackX = track.x;
-      trackY = track.y;
-      fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackX, trackY);
-    }
- 
-
-    return StatusCode::SUCCESS;
->>>>>>> upstream/master
-}
-
 
-StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
-	using namespace Monitored;
+	// 2
+	unsigned int temp = GetEventInfo(ctx)->bcid();
+	if(m_bunchCrossingTool->isFilled(temp))
+	{
+		std::cout << "Filled " << temp << "\n";
+	}
+	else
+	{
+		std::cout << "\t\tNOT filled " << temp << "\n";	
+	}
+	
+	// !!! Check this logic for exteme values (min and max; 0? and 3564)
+	if(m_bunchCrossingTool->isFilled(temp))
+	{
+		if(!m_bunchCrossingTool->isFilled(temp-1))
+		{
+			frontBCIDsVector.push_back(temp);
+			++counterForEventsFront;
+			++counterForEventsStationFront;
+		}
+		else
+		{
+			if(m_bunchCrossingTool->isFilled(temp+1))
+			{
+				middleBCIDsVector.push_back(temp);
+				++counterForEventsMiddle;
+				++counterForEventsStationMiddle;
+			}
+			else
+			{
+				endBCIDsVector.push_back(temp);
+				++counterForEventsEnd;
+				++counterForEventsStationEnd;
+			}
+		}
+	}
 
 	static unsigned int numberOfClusterStationPlane[4][4] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} };
 	//static unsigned int lumiBlocks[100];
@@ -309,65 +278,18 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	
 	
 	lb = GetEventInfo(ctx)->lumiBlock();
-	muPerBCID = 1;//lbAverageInteractionsPerCrossing(ctx);
+	muPerBCID = lbAverageInteractionsPerCrossing(ctx);
 	//run = GetEventInfo(ctx)->runNumber();
 	fill("AFPSiLayerTool", lb, muPerBCID);
 	
-	//////////////
-	/*
-	unsigned int bcid_type = GetEventInfo(ctx)->bcid();
-	
-	SG::ReadCondHandle<BunchCrossingCondData> bcidHdl(m_bunchCrossingKey,ctx);
-	if (!bcidHdl.isValid()) 
-	{
-		ATH_MSG_ERROR( "Unable to retrieve BunchCrossing conditions object" );
-		return StatusCode::FAILURE;
-	}
-	else
-	{
-		ATH_MSG_WARNING("\n\n\t\tRetrieve works!!!.\n\n");
-	}
-	
-	const BunchCrossingCondData* bcData{*bcidHdl};
-	//bcData->isFilled(bcid_type)
-	int maxbcid = {bcData->m_MAX_BCID};
-	
-	std::cout << "\n\n\tMAX_BCID: " << maxbcid << std::endl;
-	std::cout << "\nThis is for the testing purposes.";
-	std::cout << "\n\n\tNumber of bunch trains: " << bcData->numberOfBunchTrains() << std::endl;
-	std::cout << "\n\n\tNumber of filled bunches: " << bcData->numberOfFilledBunches() << std::endl;
-	
-	if (bcData->isFilled(bcid_type))
-	{
-		std::cout << "\tFilled: " << bcid_type << std::endl;
-	}
-	else
-	{
-		std::cout << "\tNOT filled: " << bcid_type << std::endl;
-	}
-	*/
-	//////////////////
-
 
 	++counterForEvents;		// Counter for the all BCIDs
 	++counterForEventsStation;
 
 	int tempbcid = GetEventInfo(ctx)->bcid();
-
-	// IMPORTANT PART
-	/*
-	EventID::number_type specialBCID = GetEventInfo(ctx)->bcid();
-	if (m_bunchCrossingCondTool->isFilled(specialBCID))
-	{
-		std::cout << "\tFilled: " << specialBCID << std::endl;
-	}
-	else
-	{
-		std::cout << "\tNOT filled: " << specialBCID << std::endl;
-	}
-	*/
-	// END OF IMPORTANT PART
 	
+
+	/* Old way for BCIDs
 	if(isInList(tempbcid, frontBCIDs) == true)
 	{
 		++counterForEventsFront;
@@ -383,6 +305,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		++counterForEventsMiddle;
 		++counterForEventsStationMiddle;
 	}
+	*/
+	
 	//std::cout << "\t\t" << counterForEvents << " lb:" << lb << std::endl;
 	
 
@@ -404,7 +328,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
 	for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
 	{
-				
 		lb = GetEventInfo(ctx)->lumiBlock();
 		pixelRowIDChip = hitsItr->pixelRowIDChip();
 		pixelColIDChip = hitsItr->pixelColIDChip();
@@ -539,7 +462,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		{++clusterCounterStation[lb][cluster.station];}
 	}
 	// ========== Front Station ==========
-	if(isInList(GetEventInfo(ctx)->bcid(), frontBCIDs))
+	if(isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
 	{
 		for(const auto& cluster : fast.clusters()) 
 		{
@@ -573,7 +496,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	// ..... end front station .....
 			
 	// ========== End Station ==========
-	if(isInList(GetEventInfo(ctx)->bcid(), endBCIDs))
+	if(isInListVector(GetEventInfo(ctx)->bcid(), endBCIDsVector))
 	{	
 		for(const auto& cluster : fast.clusters())
 		{
@@ -607,7 +530,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	// ..... end end station .....
 	
 	// ========== Middle Station ==========
-	if(isInList(GetEventInfo(ctx)->bcid(), middleBCIDs))
+	if(isInListVector(GetEventInfo(ctx)->bcid(), middleBCIDsVector))
 	{
 		for(const auto& cluster : fast.clusters())
 		{
@@ -640,7 +563,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			// end stations
 		
 		// ========== Front BCID ========== (planes)
-	if(isInList(GetEventInfo(ctx)->bcid(), frontBCIDs))
+	if(isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
 	{
 		for(const auto& cluster : fast.clusters()) 
 			{
@@ -690,7 +613,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	}
 		
 	// ========== End BCID ==========
-	if(isInList(GetEventInfo(ctx)->bcid(), endBCIDs))
+	if(isInListVector(GetEventInfo(ctx)->bcid(), endBCIDsVector))
 	{
 		for(const auto& cluster : fast.clusters()) 
 		{
@@ -712,8 +635,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 						{
 							clustersPerPlaneEnd = -0.1;
 						}
-						//std::cout << "\tFILL END" << std::endl;
-						//std::cout << "clustersPerPlaneEnd (it was zero on cernbox): " << clustersPerPlaneEnd << std::endl;
 						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
 					}
 				}
@@ -727,8 +648,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			{
 				++clusterCounterEnd[lb][cluster.station][cluster.layer];				
 				previouslbEnd = lb;
-				//std::cout << "\tFirst time" << std::endl;
-				//std::cout << "\tLuminosity block: " << lb << std::endl;
 			}
 			
 			// Lumiblock is same, so proceed
@@ -740,7 +659,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	}
 		
 	// ========== Middle BCID ==========
-	if(isInList(GetEventInfo(ctx)->bcid(), middleBCIDs))
+	if(isInListVector(GetEventInfo(ctx)->bcid(), middleBCIDsVector))
 	{
 		for(const auto& cluster : fast.clusters()) 
 		{
@@ -762,8 +681,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 						{
 							clustersPerPlaneMiddle = -0.1;
 						}
-						//std::cout << "\tFILL Middle" << std::endl;
-						//std::cout << "clustersPerPlaneMiddle (it was zero on cernbox): " << clustersPerPlaneMiddle << std::endl;
 						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
 					}
 				}
@@ -777,8 +694,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			{
 				++clusterCounterMiddle[lb][cluster.station][cluster.layer];				
 				previouslbMiddle = lb;
-				//std::cout << "\tFirst time" << std::endl;
-				//std::cout << "\tLuminosity block: " << lb << std::endl;
 			}
 			
 			// Lumiblock is same, so proceed
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index fd2e6b4e7dec..cde7c1fcce37 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -25,7 +25,6 @@ AFPToFAlgorithm::~AFPToFAlgorithm() {}
 
 
 StatusCode AFPToFAlgorithm::initialize() {
-<<<<<<< HEAD
 	using namespace Monitored;
 
 	m_HitmapGroupsToF = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
@@ -33,22 +32,12 @@ StatusCode AFPToFAlgorithm::initialize() {
 	// We must declare to the framework in initialize what SG objects we are going to use
 	SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
 	ATH_CHECK(m_afpToFHitContainerKey.initialize());
-=======
-    using namespace Monitored;
 
-    m_HitmapGroupsToF = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
-
-    // We must declare to the framework in initialize what SG objects we are going to use
-    SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
-    ATH_CHECK(m_afpToFHitContainerKey.initialize());
->>>>>>> upstream/master
-    
 	return AthMonitorAlgorithm::initialize();
 }
 
 
 StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
-<<<<<<< HEAD
 	using namespace Monitored;
 
 	// Declare the quantities which should be monitored
@@ -67,32 +56,9 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 		ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
 		return StatusCode::SUCCESS;
 	}
-=======
-    using namespace Monitored;
-
-    // Declare the quantities which should be monitored
-    auto lb = Monitored::Scalar<int>("lb", 0);
-    auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
-    auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
-    auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
-    auto trainID = Monitored::Scalar<int>("trainID", 0); 
-    auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
-    
-    lb = GetEventInfo(ctx)->lumiBlock();
- 
-    SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
-    if(! afpToFHitContainer.isValid())
-    {
-	ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
-	return StatusCode::SUCCESS;
-    }
-
-    ATH_CHECK( afpToFHitContainer.initialize() );
->>>>>>> upstream/master
 
 	ATH_CHECK( afpToFHitContainer.initialize() );
 
-<<<<<<< HEAD
 	nTofHits = afpToFHitContainer->size();
 	fill("AFPToFTool", lb, nTofHits);
 
@@ -117,29 +83,6 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 			fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], barInTrainID, trainID);
 		}
 	}
-=======
-
-    for(const xAOD::AFPToFHit *hitsItr: *afpToFHitContainer)
-    {
-	trainID = hitsItr->trainID();
-        barInTrainID = hitsItr->barInTrainID();
-
-	if(hitsItr->isSideA())
-	{
-	    numberOfHit_S0 = hitsItr->trainID();
-            fill("AFPToFTool", numberOfHit_S0);
-	}
-	else if(hitsItr->isSideC())
-	{
-	    numberOfHit_S3 = hitsItr->trainID();
-            fill("AFPToFTool", numberOfHit_S3);
-	}
-
-	if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
-	    fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], trainID, barInTrainID);
-	
-    }
->>>>>>> upstream/master
 
 	return StatusCode::SUCCESS;
 }
-- 
GitLab


From 2c8d3db25b97af986bea433326acddac430ecd65 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 26 Aug 2020 20:42:32 +0200
Subject: [PATCH 117/422] Code works, Automatic BCID works

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   | 11 ++--
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 12 ++++-
 .../src/AFPSiLayerAlgorithm.cxx               | 52 +++++++++++--------
 3 files changed, 49 insertions(+), 26 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index c12538f6e0c0..85b8c6e91cbc 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -11,9 +11,10 @@
 //#include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
 #include "xAODForward/AFPSiHitContainer.h"
 #include "xAODForward/AFPSiHit.h"
-//#include "LumiBlockData/BunchCrossingCondData.h"
+// 4
+#include "LumiBlockData/BunchCrossingCondData.h"
 // 2
-#include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
+//#include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
 
 #include "TRandom3.h"
 
@@ -32,7 +33,11 @@ private:
 	std::map<std::string,int> m_TrackGroup; 
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
 	// 2
-	ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool;
+	//ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool;
+	// 4
+	SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
+	
+	
 
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 9c194969f0d8..b8c3cd211545 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -10,6 +10,11 @@
 def Run3AFPExampleMonitoringConfig(inputFlags):
     '''Function to configures some algorithms in the monitoring system.'''
 
+    from LumiBlockComps.BunchCrossingCondAlgDefault import BunchCrossingCondAlgDefault
+    BunchCrossingCondAlgDefault()
+
+
+    
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
     
@@ -94,7 +99,7 @@ if __name__=='__main__':
     #ConfigFlags.Input.Files = ['/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1']
     ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput47-Automatic.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput48-Automatic-200k.root'
     
     ConfigFlags.lock()
 
@@ -106,7 +111,10 @@ if __name__=='__main__':
     
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
+    
+    from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
+    cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
-    cfg.run(100)
+    cfg.run(200000)
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index e58f5e11bf79..9f06c50862dc 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -13,6 +13,7 @@
 #include "xAODForward/AFPStationID.h"
 #include "EventInfo/EventID.h"
 
+
 #include <vector>
 
 
@@ -139,11 +140,11 @@ AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator*
 :AthMonitorAlgorithm(name,pSvcLocator)
 , m_afpHitContainerKey("AFPSiHitContainer")
 // 2
-, m_bunchCrossingTool("BunchCrossingTool")
+//, m_bunchCrossingTool("BunchCrossingTool")
 {
 	declareProperty("AFPSiHitContainer", m_afpHitContainerKey);
 	// 2
-	declareProperty("BunchCrossingTool", m_bunchCrossingTool);
+	//declareProperty("BunchCrossingTool", m_bunchCrossingTool);
 }
 
 
@@ -174,15 +175,12 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 		}
 	}
 	
-	// 2
-	std::cout << "\n\nKrecemo!...\n\n";
-	m_bunchCrossingTool.setTypeAndName("Trig::MCBunchCrossingTool/BunchCrossingTool"); // this works, but LHCBunch doesn't
-	ATH_CHECK( m_bunchCrossingTool.retrieve() );
+
+	// 4
+	std::cout << "\n\nBunchCrossingKey initialization!...\n\n";
+	ATH_CHECK( m_bunchCrossingKey.initialize());
 	std::cout << "\n\n\n";
 	ATH_MSG_INFO( "initialization completed" );
-	std::cout << "\n\n\n";
-	std::cout << "Number of filled bunches: " << m_bunchCrossingTool.numberOfFilledBunches() << std::endl;
-	std::cout << "Number of bunch trains: " << m_bunchCrossingTool.numberOfBunchTrains() << std::endl;
 	return AthMonitorAlgorithm::initialize();
 }
 
@@ -195,29 +193,41 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 
 StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	using namespace Monitored;
+	
+	//static constexpr int MAX_BCID = BunchCrossingCondData::m_MAX_BCID;
+	//std::cout << MAX_BCID << " to je taj broj.\n\n";
+
 
-	for(int j=0; j<3500; j++)
-	{
-		if(!m_bunchCrossingTool->isFilled(j))
-			std::cout << "Not filled " << j << "\n";
-	}
 	
 
-	// 2
+	// 4
 	unsigned int temp = GetEventInfo(ctx)->bcid();
-	if(m_bunchCrossingTool->isFilled(temp))
+	SG::ReadCondHandle<BunchCrossingCondData> bcidHdl(m_bunchCrossingKey,ctx);
+	if (!bcidHdl.isValid()) {
+		ATH_MSG_ERROR( "Unable to retrieve BunchCrossing conditions object" );
+	}
+	const BunchCrossingCondData* bcData{*bcidHdl};
+	/*
+	for(int j=0; j<3560; j++)
 	{
-		std::cout << "Filled " << temp << "\n";
+		if(!bcData->isFilled(j))
+			std::cout << "\n\nNot filled " << j << "\n";
+	}
+	*/
+	if(bcData->isFilled(temp))
+	{
+		std::cout << "Filled: " << temp << std::endl;
 	}
 	else
 	{
-		std::cout << "\t\tNOT filled " << temp << "\n";	
+		std::cout << "\n\nNOT Filled: " << temp << std::endl;
 	}
+
 	
 	// !!! Check this logic for exteme values (min and max; 0? and 3564)
-	if(m_bunchCrossingTool->isFilled(temp))
+	if(bcData->isFilled(temp))
 	{
-		if(!m_bunchCrossingTool->isFilled(temp-1))
+		if(!bcData->isFilled(temp-1))
 		{
 			frontBCIDsVector.push_back(temp);
 			++counterForEventsFront;
@@ -225,7 +235,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		}
 		else
 		{
-			if(m_bunchCrossingTool->isFilled(temp+1))
+			if(bcData->isFilled(temp+1))
 			{
 				middleBCIDsVector.push_back(temp);
 				++counterForEventsMiddle;
-- 
GitLab


From 97a74005096de6d4514b0b780b2ccdcdcdd7580e Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 31 Aug 2020 14:18:00 +0200
Subject: [PATCH 118/422] Cleaning before MR

---
 .../AFP/Run3AFPMonitoring/CMakeLists.txt      |   1 +
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  12 --
 .../python/Run3AFPExampleMonitorAlgorithm.py  |   8 +-
 .../src/AFPSiLayerAlgorithm.cxx               | 167 ++----------------
 4 files changed, 20 insertions(+), 168 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index 13d0472bee02..e57c24a461cb 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -1,5 +1,6 @@
 ################################################################################
 # Package: Run3AFPMonitoring
+# Author: N. Dikic 
 ################################################################################
 
 # Declare the package name:
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 85b8c6e91cbc..2e5e77654b5d 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -8,13 +8,9 @@
 #include "AthenaMonitoring/AthMonitorAlgorithm.h"
 #include "AthenaMonitoringKernel/Monitored.h"
 #include "StoreGate/ReadHandleKey.h"
-//#include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
 #include "xAODForward/AFPSiHitContainer.h"
 #include "xAODForward/AFPSiHit.h"
-// 4
 #include "LumiBlockData/BunchCrossingCondData.h"
-// 2
-//#include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
 
 #include "TRandom3.h"
 
@@ -26,20 +22,12 @@ public:
 	virtual ~AFPSiLayerAlgorithm();
 	virtual StatusCode initialize() override;
 	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
-	//virtual StatusCode execute(const EventContext& ctx) const override;
 	
 private:
 	std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
 	std::map<std::string,int> m_TrackGroup; 
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
-	// 2
-	//ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool;
-	// 4
 	SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
-	
-	
-
-
 
 protected:
 	std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index b8c3cd211545..e54133cf4edd 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -97,9 +97,11 @@ if __name__=='__main__':
     #ConfigFlags.Input.Files = [nightly+file]
     #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_6/aod0.pool.root']
     #ConfigFlags.Input.Files = ['/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1']
-    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
+    #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
+    #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00334350.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22327000.EXT0._000001.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00334350.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22327000.EXT0._000002.xAOD.root']
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000001.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput48-Automatic-200k.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput52-212k-337371-Aut.root'
     
     ConfigFlags.lock()
 
@@ -115,6 +117,6 @@ if __name__=='__main__':
     from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
     cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
-    cfg.run(200000)
+    cfg.run()
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 9f06c50862dc..ee313fc04005 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -47,69 +47,8 @@
 	unsigned int counterForEventsStationEnd = 0;
 	unsigned int counterForEventsStationMiddle = 0;
 	
-	/*
-	int frontBCIDs[] = {63,75,87,99,114,126,138,150,165,177,189,201,240,252,264,276,291,303,315,327,342,354,366,378,417,429,441,453,468,480,492,
-504,519,531,543,555,594,606,618,630,645,657,669,681,696,708,720,732,780,792,804,816,831,843,855,867,882,894,906,918,957,969,981,993,1008,1020,
-1032,1044,1059,1071,1083,1095,1134,1146,1158,1170,1185,1197,1209,1221,1236,1248,1260,1272,1311,1323,1335,1347,1362,1374,1386,1398,1413,1425,1437,
-1449,1488,1500,1512,1524,1539,1551,1563,1575,1590,1602,1614,1626,1674,1686,1698,1710,1725,1737,1749,1761,1776,1788,1800,1812,1851,1863,1875,1887,
-1902,1914,1926,1938,1953,1965,1977,1989,2028,2040,2052,2064,2079,2091,2103,2115,2130,2142,2154,2166,2205,2217,2229,2241,2256,2268,2280,2292,2307,
-2319,2331,2343,2382,2394,2406,2418,2433,2445,2457,2469,2484,2496,2508,2520,2568,2580,2592,2604,2619,2631,2643,2655,2670,2682,2694,2706,2745,2757,
-2769,2781,2796,2808,2820,2832,2847,2859,2871,2883,2922,2934,2946,2958,2973,2985,2997,3009,3024,3036,3048,3060,3099,3111,3123,3135,3150,3162,3174,
-3186,3201,3213,3225,3237,3276,3288,3300,3312,3327,3339,3351,3363,3378,3390,3402,3414,-1};
-	*/
 	std::vector<int> frontBCIDsVector;
-	/*
-	int middleBCIDs[] = {64,65,66,67,68,69,76,77,78,79,80,81,88,89,90,91,92,93,100,101,102,103,104,105,115,116,117,118,119,120,127,128,129,130,131,132,139,140,141,142,143,144,151,
-152,153,154,155,156,166,167,168,169,170,171,178,179,180,181,182,183,190,191,192,193,194,195,202,203,204,205,206,207,241,242,243,244,245,246,253,254,255,256,257,258,
-265,266,267,268,269,270,277,278,279,280,281,282,292,293,294,295,296,297,304,305,306,307,308,309,316,317,318,319,320,321,328,329,330,331,332,333,343,344,345,346,347,
-348,355,356,357,358,359,360,367,368,369,370,371,372,379,380,381,382,383,384,418,419,420,421,422,423,430,431,432,433,434,435,442,443,444,445,446,447,454,455,456,457,
-458,459,469,470,471,472,473,474,481,482,483,484,485,486,493,494,495,496,497,498,505,506,507,508,509,510,520,521,522,523,524,525,532,533,534,535,536,537,544,545,546,
-547,548,549,556,557,558,559,560,561,595,596,597,598,599,600,607,608,609,610,611,612,619,620,621,622,623,624,631,632,633,634,635,636,646,647,648,649,650,651,658,659,
-660,661,662,663,670,671,672,673,674,675,682,683,684,685,686,687,697,698,699,700,701,702,709,710,711,712,713,714,721,722,723,724,725,726,733,734,735,736,737,738,781,
-782,783,784,785,786,793,794,795,796,797,798,805,806,807,808,809,810,817,818,819,820,821,822,832,833,834,835,836,837,844,845,846,847,848,849,856,857,858,859,860,861,
-868,869,870,871,872,873,883,884,885,886,887,888,895,896,897,898,899,900,907,908,909,910,911,912,919,920,921,922,923,924,958,959,960,961,962,963,970,971,972,973,974,
-975,982,983,984,985,986,987,994,995,996,997,998,999,1009,1010,1011,1012,1013,1014,1021,1022,1023,1024,1025,1026,1033,1034,1035,1036,1037,1038,1045,1046,1047,1048,
-1049,1050,1060,1061,1062,1063,1064,1065,1072,1073,1074,1075,1076,1077,1084,1085,1086,1087,1088,1089,1096,1097,1098,1099,1100,1101,1135,1136,1137,1138,1139,1140,1147,
-1148,1149,1150,1151,1152,1159,1160,1161,1162,1163,1164,1171,1172,1173,1174,1175,1176,1186,1187,1188,1189,1190,1191,1198,1199,1200,1201,1202,1203,1210,1211,1212,1213,
-1214,1215,1222,1223,1224,1225,1226,1227,1237,1238,1239,1240,1241,1242,1249,1250,1251,1252,1253,1254,1261,1262,1263,1264,1265,1266,1273,1274,1275,1276,1277,1278,1312,
-1313,1314,1315,1316,1317,1324,1325,1326,1327,1328,1329,1336,1337,1338,1339,1340,1341,1348,1349,1350,1351,1352,1353,1363,1364,1365,1366,1367,1368,1375,1376,1377,1378,
-1379,1380,1387,1388,1389,1390,1391,1392,1399,1400,1401,1402,1403,1404,1414,1415,1416,1417,1418,1419,1426,1427,1428,1429,1430,1431,1438,1439,1440,1441,1442,1443,1450,
-1451,1452,1453,1454,1455,1489,1490,1491,1492,1493,1494,1501,1502,1503,1504,1505,1506,1513,1514,1515,1516,1517,1518,1525,1526,1527,1528,1529,1530,1540,1541,1542,1543,
-1544,1545,1552,1553,1554,1555,1556,1557,1564,1565,1566,1567,1568,1569,1576,1577,1578,1579,1580,1581,1591,1592,1593,1594,1595,1596,1603,1604,1605,1606,1607,1608,1615,
-1616,1617,1618,1619,1620,1627,1628,1629,1630,1631,1632,1675,1676,1677,1678,1679,1680,1687,1688,1689,1690,1691,1692,1699,1700,1701,1702,1703,1704,1711,1712,1713,1714,
-1715,1716,1726,1727,1728,1729,1730,1731,1738,1739,1740,1741,1742,1743,1750,1751,1752,1753,1754,1755,1762,1763,1764,1765,1766,1767,1777,1778,1779,1780,1781,1782,1789,
-1790,1791,1792,1793,1794,1801,1802,1803,1804,1805,1806,1813,1814,1815,1816,1817,1818,1852,1853,1854,1855,1856,1857,1864,1865,1866,1867,1868,1869,1876,1877,1878,1879,
-1880,1881,1888,1889,1890,1891,1892,1893,1903,1904,1905,1906,1907,1908,1915,1916,1917,1918,1919,1920,1927,1928,1929,1930,1931,1932,1939,1940,1941,1942,1943,1944,1954,
-1955,1956,1957,1958,1959,1966,1967,1968,1969,1970,1971,1978,1979,1980,1981,1982,1983,1990,1991,1992,1993,1994,1995,2029,2030,2031,2032,2033,2034,2041,2042,2043,2044,
-2045,2046,2053,2054,2055,2056,2057,2058,2065,2066,2067,2068,2069,2070,2080,2081,2082,2083,2084,2085,2092,2093,2094,2095,2096,2097,2104,2105,2106,2107,2108,2109,2116,
-2117,2118,2119,2120,2121,2131,2132,2133,2134,2135,2136,2143,2144,2145,2146,2147,2148,2155,2156,2157,2158,2159,2160,2167,2168,2169,2170,2171,2172,2206,2207,2208,2209,
-2210,2211,2218,2219,2220,2221,2222,2223,2230,2231,2232,2233,2234,2235,2242,2243,2244,2245,2246,2247,2257,2258,2259,2260,2261,2262,2269,2270,2271,2272,2273,2274,2281,
-2282,2283,2284,2285,2286,2293,2294,2295,2296,2297,2298,2308,2309,2310,2311,2312,2313,2320,2321,2322,2323,2324,2325,2332,2333,2334,2335,2336,2337,2344,2345,2346,2347,
-2348,2349,2383,2384,2385,2386,2387,2388,2395,2396,2397,2398,2399,2400,2407,2408,2409,2410,2411,2412,2419,2420,2421,2422,2423,2424,2434,2435,2436,2437,2438,2439,2446,
-2447,2448,2449,2450,2451,2458,2459,2460,2461,2462,2463,2470,2471,2472,2473,2474,2475,2485,2486,2487,2488,2489,2490,2497,2498,2499,2500,2501,2502,2509,2510,2511,2512,
-2513,2514,2521,2522,2523,2524,2525,2526,2569,2570,2571,2572,2573,2574,2581,2582,2583,2584,2585,2586,2593,2594,2595,2596,2597,2598,2605,2606,2607,2608,2609,2610,2620,
-2621,2622,2623,2624,2625,2632,2633,2634,2635,2636,2637,2644,2645,2646,2647,2648,2649,2656,2657,2658,2659,2660,2661,2671,2672,2673,2674,2675,2676,2683,2684,2685,2686,
-2687,2688,2695,2696,2697,2698,2699,2700,2707,2708,2709,2710,2711,2712,2746,2747,2748,2749,2750,2751,2758,2759,2760,2761,2762,2763,2770,2771,2772,2773,2774,2775,2782,
-2783,2784,2785,2786,2787,2797,2798,2799,2800,2801,2802,2809,2810,2811,2812,2813,2814,2821,2822,2823,2824,2825,2826,2833,2834,2835,2836,2837,2838,2848,2849,2850,2851,
-2852,2853,2860,2861,2862,2863,2864,2865,2872,2873,2874,2875,2876,2877,2884,2885,2886,2887,2888,2889,2923,2924,2925,2926,2927,2928,2935,2936,2937,2938,2939,2940,2947,
-2948,2949,2950,2951,2952,2959,2960,2961,2962,2963,2964,2974,2975,2976,2977,2978,2979,2986,2987,2988,2989,2990,2991,2998,2999,3000,3001,3002,3003,3010,3011,3012,3013,
-3014,3015,3025,3026,3027,3028,3029,3030,3037,3038,3039,3040,3041,3042,3049,3050,3051,3052,3053,3054,3061,3062,3063,3064,3065,3066,3100,3101,3102,3103,3104,3105,3112,
-3113,3114,3115,3116,3117,3124,3125,3126,3127,3128,3129,3136,3137,3138,3139,3140,3141,3151,3152,3153,3154,3155,3156,3163,3164,3165,3166,3167,3168,3175,3176,3177,3178,
-3179,3180,3187,3188,3189,3190,3191,3192,3202,3203,3204,3205,3206,3207,3214,3215,3216,3217,3218,3219,3226,3227,3228,3229,3230,3231,3238,3239,3240,3241,3242,3243,3277,
-3278,3279,3280,3281,3282,3289,3290,3291,3292,3293,3294,3301,3302,3303,3304,3305,3306,3313,3314,3315,3316,3317,3318,3328,3329,3330,3331,3332,3333,3340,3341,3342,3343,
-3344,3345,3352,3353,3354,3355,3356,3357,3364,3365,3366,3367,3368,3369,3379,3380,3381,3382,3383,3384,3391,3392,3393,3394,3395,3396,3403,3404,3405,3406,3407,3408,3415,
-3416,3417,3418,3419,3420,-1};
-	*/
 	std::vector<int> middleBCIDsVector;
-	/*
-	int endBCIDs[] = {70,82,94,106,121,133,145,157,172,184,196,208,247,259,271,283,298,310,322,334,349,361,373,385,424,436,448,460,475,487,499,511,526,538,550,562,
-601,613,625,637,652,664,676,688,703,715,727,739,787,799,811,823,838,850,862,874,889,901,913,925,964,976,988,1000,1015,1027,1039,1051,1066,1078,1090,1102,1141,1153,
-1165,1177,1192,1204,1216,1228,1243,1255,1267,1279,1318,1330,1342,1354,1369,1381,1393,1405,1420,1432,1444,1456,1495,1507,1519,1531,1546,1558,1570,1582,1597,1609,1621,
-1633,1681,1693,1705,1717,1732,1744,1756,1768,1783,1795,1807,1819,1858,1870,1882,1894,1909,1921,1933,1945,1960,1972,1984,1996,2035,2047,2059,2071,2086,2098,2110,2122,
-2137,2149,2161,2173,2212,2224,2236,2248,2263,2275,2287,2299,2314,2326,2338,2350,2389,2401,2413,2425,2440,2452,2464,2476,2491,2503,2515,2527,2575,2587,2599,2611,2626,
-2638,2650,2662,2677,2689,2701,2713,2752,2764,2776,2788,2803,2815,2827,2839,2854,2866,2878,2890,2929,2941,2953,2965,2980,2992,3004,3016,3031,3043,3055,3067,3106,3118,
-3130,3142,3157,3169,3181,3193,3208,3220,3232,3244,3283,3295,3307,3319,3334,3346,3358,3370,3385,3397,3409,3421,-1};
-	*/
 	std::vector<int> endBCIDsVector;
 		
 	bool isInList(int bcid, int* arr)
@@ -139,12 +78,8 @@
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
 , m_afpHitContainerKey("AFPSiHitContainer")
-// 2
-//, m_bunchCrossingTool("BunchCrossingTool")
 {
 	declareProperty("AFPSiHitContainer", m_afpHitContainerKey);
-	// 2
-	//declareProperty("BunchCrossingTool", m_bunchCrossingTool);
 }
 
 
@@ -176,55 +111,31 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 	}
 	
 
-	// 4
-	std::cout << "\n\nBunchCrossingKey initialization!...\n\n";
-	ATH_CHECK( m_bunchCrossingKey.initialize());
-	std::cout << "\n\n\n";
+	// BCX key
+	std::cout << "BunchCrossingKey initialization!...\n\n";
+	ATH_CHECK(m_bunchCrossingKey.initialize());
+	std::cout << "\n\n";
 	ATH_MSG_INFO( "initialization completed" );
 	return AthMonitorAlgorithm::initialize();
 }
 
-//StatusCode AFPSiLayerAlgorithm::execute(const EventContext& ctx) const {
-//	using namespace Monitored;
-
-	
-//	return StatusCode::SUCCESS;
-//}
-
 StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	using namespace Monitored;
-	
-	//static constexpr int MAX_BCID = BunchCrossingCondData::m_MAX_BCID;
-	//std::cout << MAX_BCID << " to je taj broj.\n\n";
-
 
-	
-
-	// 4
+	// BCX handler
 	unsigned int temp = GetEventInfo(ctx)->bcid();
 	SG::ReadCondHandle<BunchCrossingCondData> bcidHdl(m_bunchCrossingKey,ctx);
 	if (!bcidHdl.isValid()) {
 		ATH_MSG_ERROR( "Unable to retrieve BunchCrossing conditions object" );
 	}
 	const BunchCrossingCondData* bcData{*bcidHdl};
-	/*
-	for(int j=0; j<3560; j++)
-	{
-		if(!bcData->isFilled(j))
-			std::cout << "\n\nNot filled " << j << "\n";
-	}
-	*/
-	if(bcData->isFilled(temp))
-	{
-		std::cout << "Filled: " << temp << std::endl;
-	}
-	else
+
+	if(!bcData->isFilled(temp))
 	{
-		std::cout << "\n\nNOT Filled: " << temp << std::endl;
+		std::cout << "\nNOT Filled: " << temp << std::endl;
 	}
 
-	
-	// !!! Check this logic for exteme values (min and max; 0? and 3564)
+	// Classifying bunches by position in train (Front, Middle, End)
 	if(bcData->isFilled(temp))
 	{
 		if(!bcData->isFilled(temp-1))
@@ -298,28 +209,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 
 	int tempbcid = GetEventInfo(ctx)->bcid();
 	
-
-	/* Old way for BCIDs
-	if(isInList(tempbcid, frontBCIDs) == true)
-	{
-		++counterForEventsFront;
-		++counterForEventsStationFront;
-	} 
-	else if (isInList(tempbcid, endBCIDs) == true)
-	{
-		++counterForEventsEnd;
-		++counterForEventsStationEnd;
-	}
-	else if(isInList(tempbcid, middleBCIDs) == true)
-	{
-		++counterForEventsMiddle;
-		++counterForEventsStationMiddle;
-	}
-	*/
-	
-	//std::cout << "\t\t" << counterForEvents << " lb:" << lb << std::endl;
-	
-
 	SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
 	if(! afpHitContainer.isValid())
 	{
@@ -332,9 +221,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	nSiHits = afpHitContainer->size();
 	//hitsPerPlane = afpHitContainer->size();
 	fill("AFPSiLayerTool", lb, nSiHits);
-	
 
-	
 
 	for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
 	{
@@ -366,7 +253,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	}
 
 // Clusters:
-// Davide's approach
+// Old approach
 	for(int i = 0; i < 4; i++)
 	{
 		for(int j = 0; j < 4; j++)
@@ -384,9 +271,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane2);
 		}
 	}
-// Davide's approach - End
 
-// Kris's approach:
+// New approach:
 	for(const auto& cluster : fast.clusters()) 
 	{
 		clusterX = cluster.x;
@@ -567,10 +453,10 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			}
 			else if (lb == previouslbStationMiddle)
 			{++clusterCounterStationMiddle[lb][cluster.station];}
-			// end middle station
+			// ..... end middle station .....
 		}
 	}
-			// end stations
+			// ..... end stations .....
 		
 		// ========== Front BCID ========== (planes)
 	if(isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
@@ -595,8 +481,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 						{
 							clustersPerPlaneFront = -0.1;
 						}
-						//std::cout << "\tFILL FRONT" << std::endl;
-						//std::cout << "clustersPerPlaneFront (it was zero on cernbox): " << clustersPerPlaneFront << std::endl;
 						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
 					}
 				}
@@ -610,8 +494,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			{
 				++clusterCounterFront[lb][cluster.station][cluster.layer];
 				previouslbFront = lb;
-			//std::cout << "\tFirst time" << std::endl;
-			//std::cout << "\tLuminosity block: " << lb << std::endl;
 			}
 		
 			// Lumiblock is same, so proceed
@@ -656,7 +538,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			// First time in lumiblock (in plane)
 			else if(clusterCounterEnd[lb][cluster.station][cluster.layer] == 0) 
 			{
-				++clusterCounterEnd[lb][cluster.station][cluster.layer];				
+				++clusterCounterEnd[lb][cluster.station][cluster.layer];
 				previouslbEnd = lb;
 			}
 			
@@ -677,7 +559,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			// Time for fill - current and previous lb are different, and the previouslbMiddle is not -1 (it means - this is not the first lb)
 			if(lb > previouslbMiddle && previouslbMiddle != 0)
 			{
-				//std::cout << "\tlb!=previouslbMiddle" << std::endl;
 				for(int i=0; i<4; i++)
 				{
 					for(int j=0; j<4; j++)
@@ -715,26 +596,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	}
 	
 
-
-	// Filling of layerEff 2D histogram
-/*	
-	for(int i = 0; i < 4; i++)
-	{
-		unsigned long tempSum = numberOfHitsStationPlane[i][0] + numberOfHitsStationPlane[i][1] + numberOfHitsStationPlane[i][2] + numberOfHitsStationPlane[i][3];
-		if(tempSum>0)
-		{
-			for(int j = 0; j < 4; j++)
-			{
-				layerNumber = i*4 + j;
-				layerEfficiency = numberOfHitsStationPlane[i][j] / tempSum;
-				layerEfficiency += i*4+j;
-				//fill("AFPSiLayerTool", layerNumber, layerEfficiency);
-				fill("AFPSiLayerTool", layerEfficiency);
-			}
-		}
-	}
-*/	
-
 	return StatusCode::SUCCESS;
 } // end of fillHistograms
 
-- 
GitLab


From a868f4ba79811839a16f59ec35fb9eb6ae2ab435 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Thu, 3 Sep 2020 16:24:08 +0200
Subject: [PATCH 119/422] fixing Menu_LS2_v1

---
 .../LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py    | 1457 ++++++-----------
 1 file changed, 472 insertions(+), 985 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
index f32fe825deb0..3ad22d65e849 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 def defineMenu():
     """
@@ -38,14 +38,13 @@ def defineMenu():
         # SLOT 7 / CON 0,1 (EM1,2)
         #-------------------------
         
+ 
         # 16 x EM
         'EM3', 'EM7', 'EM8VH',
-        'EM8I',
-        'EM10VH', 'EM12', 'EM13VH', 'EM15', 'EM15VH',
-        'EM15HI',
-        'EM18VH', 'EM20VH', 'EM20VHI', 'EM22VHI', 'EM24VHI', 'EM26VHI', 
-
-        # 1 x ZB
+        'EM10VH', 'EM12', 'EM15', 'EM15VH',
+        'EM15VHI',
+        'EM18VHI', 'EM20VH', 'EM20VHI', 'EM22VH', 'EM22VHI', 'EM24VHI', 'EM24VHIM', 'EM30VHI', 
+        # 1 x ZB/
         'ZB_EM15',
 
         #--------------------------
@@ -53,7 +52,8 @@ def defineMenu():
         #--------------------------
 
         # 16 x TAU
-        'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA12IT', 'HA15', 'HA20', 'HA20IL',  'HA20IM', 'HA20IT', 'HA25', 'HA25IT', 'HA30', 'HA40', 'HA60', 'HA100', 
+        'HA5', 'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA15', 'HA20', 'HA20IL', 'HA20IM', 'HA25', 'HA25IM', 'HA30', 'HA40', 'HA60', 'HA90', 'HA100',
+ 
 
         #----------------------
         # SLOT 8 / CON 0 (JET1)
@@ -61,9 +61,11 @@ def defineMenu():
         # 10 x 3-bit JET (can have multiplicity 4 or more)
 
         # 8 x JETs and central jets
-        'J12', 'J15', 'J15.0ETA25','J20', 'J25','J25.0ETA23','J30', 'J40',
-        
-        # 2 x VBF
+        'J12', 'J12.0ETA23', 'J15', 'J15.0ETA25','J20', 'J25','J25.0ETA23','J30',
+        # 2 x Central Jets
+         'J12.0ETA28', #'J12.0ETA25',
+
+        # VBF Jets
         'J20.0ETA49', 'J30.0ETA49',
 
 
@@ -73,37 +75,33 @@ def defineMenu():
         # 15 x 2-bit JET (can have maximum multiplicity of 3) (SLOT 8, CON 1)
 
         # 3 x Central Jet
-        'J35.0ETA23','J40.0ETA25', 'J20.28ETA31',
+        'J35.0ETA23','J40.0ETA25', #'J20.28ETA31',
+
+        # 6 Jets # replace J400 with J45.0ETA20 - ATR-19309
+        'J40', 'J50', 'J75', 'J85', 'J100', 'J45.0ETA20',  'J400', #'J120',
 
-        # 6 Jets
-        'J50', 'J75', 'J85', 'J100', 'J120', 'J400',
 
         # 6 x FJ              
-        'J15.31ETA49', 'J20.31ETA49', 'J30.31ETA49', 'J50.31ETA49', 'J75.31ETA49', 'J100.31ETA49', 
+        'J15.31ETA49', 'J20.31ETA49', 'J30.31ETA49', 'J50.31ETA49', 'J75.31ETA49', 
+ 
 
 
         #---------------------
-        # SLOT 8 / CON 2 (EN1)
+        # SLOT 8 / CON 2 (EN1) 
         #---------------------
         # 24 x 1-bit thresholds
-        
-        # 8 x TE
-        #'TE3', 'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40',
-        #'TE5', 'TE30', 'TE40', 'TE45', 'TE50', 'TE55', 'TE60', 'TE65',
-        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE70',
 
+        # 8 x TE
+        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE50',
+    
         # 8 x XE (for standard XE)
-        #'XE35', 'XE40', 'XE45', 'XE50', 'XE55', 'XE60', 'XE70', 'XE80',
-        # 8 x XE (for restricted ETA XE: check ATR-13234 for any further change)
-        #'XE10', 'XE20', 'XE25', 'XE30', 'XE65', 'XE75', 'XE150', 'XE300',
-
         'XE10', 'XE20', 'XE25', 'XE30', 'XE35', 'XE40', 'XE45', 'XE50',
         'XE55', 'XE60', 'XE65', 'XE70', 'XE75', 'XE80', 'XE150', 'XE300',
         
         # 8 x XS
         'XS20', 'XS30', 'XS40', 'XS45', 'XS50', 'XS55', 'XS60', 'XS65', 
 
-
+ 
         #---------------------
         # SLOT 8 / CON 3 (EN2)
         #---------------------
@@ -113,18 +111,18 @@ def defineMenu():
         #'RXE35', 'RXE40', 'RXE45', 'RXE50', 'RXE55', 'RXE60', 'RXE70', 'RXE80', # FTHR
 
         # 8 x restricted eta range
-        #'TE3.0ETA24', 'TE5.0ETA24','TE10.0ETA24', 'TE15.0ETA24', 'TE20.0ETA24', 'TE25.0ETA24', 'TE30.0ETA24', 'TE40.0ETA24',
-        #'TE5.0ETA24', 'TE30.0ETA24','TE40.0ETA24', 'TE45.0ETA24', 'TE50.0ETA24', 'TE55.0ETA24', 'TE60.0ETA24', 'TE65.0ETA24',
-        'TE5.0ETA24', 'TE10.0ETA24', 'TE15.0ETA24', 'TE20.0ETA24', 'TE25.0ETA24', 'TE30.0ETA24', 'TE40.0ETA24', 'TE70.0ETA24',
+        #'TE5.24ETA49', 'TE10.24ETA49', 'TE15.24ETA49', 'TE20.24ETA49', 'TE25.24ETA49', 'TE30.24ETA49', 'TE40.24ETA49', 'TE70.24ETA49',
+
+
 
         #------------------------
-        # SLOT 9 / CON 0 (MUCTPi)
+        # SLOT 9 / CON 0 (MUCTPi) 
         #------------------------
         
         # 6 x MU
-        'MU4', 'MU6', 'MU10', 'MU11', 'MU15', 'MU20',
-
+        'MU4', 'MU6', 'MU10', 'MU11', 'MU20', 'MU21',
 
+        
         #------------------------
         # SLOT 9 / CON 1 (CTPCal)
         #------------------------
@@ -153,6 +151,8 @@ def defineMenu():
         # 3 x CALREQ
         'CAL0','CAL1','CAL2',
 
+ 
+
         #-----------------------------
         # SLOT 9 / CON 2,3 (NIM1,NIM2)
         #-----------------------------
@@ -160,11 +160,13 @@ def defineMenu():
         # 2 x MBTS
         'MBTS_A', 'MBTS_C',
 
-        # 24 x MBTSSI (all FTHR)
-        'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4'  , 'MBTS_A5', 'MBTS_A6', 'MBTS_A7', 
-        'MBTS_A8', 'MBTS_A10', 'MBTS_A12' , 'MBTS_A14',
-        'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4'  , 'MBTS_C5', 'MBTS_C6', 'MBTS_C7', 
-        'MBTS_C8', 'MBTS_C10', 'MBTS_C12' , 'MBTS_C14',
+        # 32 x MBTSSI (all FTHR)
+        # NOTE: THESE ARE OUT OF ORDER FOR A REASON! Do not change!
+        # The order defines the mapping - see ATR-17870.
+        'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4', 'MBTS_A5', 'MBTS_A6', 'MBTS_A7',
+        'MBTS_A8', 'MBTS_A10', 'MBTS_A12', 'MBTS_A14', 'MBTS_A9', 'MBTS_A11','MBTS_A13', 'MBTS_A15',
+        'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4', 'MBTS_C5', 'MBTS_C6', 'MBTS_C7',
+        'MBTS_C8', 'MBTS_C10', 'MBTS_C12', 'MBTS_C14', 'MBTS_C11', 'MBTS_C13','MBTS_C9','MBTS_C15',
 
         # L1A for CTP monitoring itself
         'NIML1A',
@@ -182,382 +184,309 @@ def defineMenu():
         'NIMTRT',
 
         # AFP
-        'AFP_NSC', 'AFP_FSC',
+        'AFP_NSC', 'AFP_NSA',
+        #'AFP_FSA_SIT', 'AFP_FSA_TOF', 'AFP_FSA_LOG',
+        #'AFP_FSC_SIT', 'AFP_FSC_LOG', 'AFP_FSC_TOF',
 
+        
         #-------------------------------------------------------------------
         #L1 TOPO inputs 
         #-------------------------------------------------------------------
-        
+
+        #B-jets
+        #'BTAG-MU4J15',
+        #'BTAG-MU6J20',
+
         #HT
-        'HT190-AJ15all.ETA21',
         'HT190-J15s5.ETA21',
-        'HT150-AJ20all.ETA31',
         'HT150-J20s5.ETA31',
 
         
 
         #ZH 
-        '10MINDPHI-AJ20s2-XE50', '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', '10MINDPHI-J20ab-XE50', '10MINDPHI-CJ20ab-XE50', 
+        '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', 
+
         #Jpsi T&P
-        '1INVM5-EMs1-EMs6', '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',        
-
-        #W T&P
-        '05MINDPHI-AJj10s6-XE0',
-        '10MINDPHI-AJj10s6-XE0',
-        '15MINDPHI-AJj10s6-XE0',
-        '05MINDPHI-EM12s6-XE0',
-        '15MINDPHI-EM12s6-XE0',
-        '05MINDPHI-EM15s6-XE0',
-        '15MINDPHI-EM15s6-XE0',
-        '05RATIO-XE0-HT0-AJj15all.ETA49',
-        '90RATIO2-XE0-HT0-AJj15all.ETA49',
-        '250RATIO2-XE0-HT0-AJj15all.ETA49',
-        'HT20-AJj15all.ETA49',
-        'NOT-02MATCH-EM10s1-AJj15all.ETA49',
-        '25MT-EM12s6-XE0',
-        '35MT-EM12s6-XE0',
-        '35MT-EM15s6-XE0',
-        #'10MINDPHI-AJj15s2-XE0',
-        #'20MINDPHI-AJjs6-XE0',
-        #'20MINDPHI-AJj15s2-XE0',
-        #'10MINDPHI-EM6s1-XE0',
-        #'20MINDPHI-EM9s6-XE0',
-        #'20MINDPHI-EM6s1-XE0',
-        #'05RATIO-XE0-HT0-AJj15all.ETA49',
-        #'08RATIO-XE0-HT0-AJj0all.ETA49',
-        #'40RATIO2-XE0-HT0-AJj15all.ETA49',
-        #'90RATIO2-XE0-HT0-AJj0all.ETA49',
-        #'HT20-AJj0all.ETA49',
-        #'NOT-02MATCH-EM9s1-AJj15all.ETA49',
-        #'05RATIO-XE0-SUM0-EM9s1-HT0-AJj15all.ETA49',
-        #'20MT-EM6s6-XE0',
-        #'30MT-EM6s6-XE0',
-        #'40MT-EM6s6-XE0',
+         '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',        
+
+        #W T&P - all were commented out
+ 
         
         # central muon
         'MULT-CMU4ab',
         'MULT-CMU6ab',
         
-        #B-jet
-        '0DR04-MU4ab-CJ15ab', '0DR04-MU4ab-CJ20ab', '0DR04-MU4ab-CJ30ab', '0DR04-MU6ab-CJ20ab', '0DR04-MU6ab-CJ25ab',
+
         #B-physics
-#SX        '2DR15-2MU4ab', 
-#SX        '2INVM999-2MU4ab', 
-#SX        '4INVM8-2MU4ab',
-        '2DR15-2MU6ab', 
-#SX        '2INVM999-2MU6ab', 
-#SX        '4INVM8-2MU6ab',
+        '0DR03-EM7ab-CJ15ab',
+ 
 
         # L1 thresholds for L1Topo streamers
-#SX        '2INVM999-CMU4ab-MU4ab',
-#SX        '2INVM999-2CMU4ab',
-#SX        '2INVM999-MU6ab-MU4ab',
-#SX        '2INVM999-ONEBARREL-MU6ab-MU4ab',
-#SX        '2INVM999-CMU6ab-CMU4ab',
-#SX        '4INVM8-CMU4ab-MU4ab',
-#SX        '4INVM8-2CMU4ab',
-#SX        '4INVM8-MU6ab-MU4ab',
-#SX        '4INVM8-ONEBARREL-MU6ab-MU4ab',
-#SX        '4INVM8-CMU6ab-CMU4ab',        
-        '2DR99-2MU4ab',
+        #'2DR99_2MU4ab',
         '5DETA99-5DPHI99-MU6ab-MU4ab',
         '5DETA99-5DPHI99-2MU6ab',
-        '0DR10-MU10ab-MU6ab',
         '0DR15-2MU6ab',
-#        '0DETA04-0DPHI03-EM8abi-MU10ab',
         '0DETA04-EM8abi-MU10ab',
         '0DPHI03-EM8abi-MU10ab',
-#        '0DETA04-0DPHI03-EM15abi-MUab',
         '0DETA04-EM15abi-MUab',
         '0DPHI03-EM15abi-MUab',
-        '10MINDPHI-AJ20s2-XE50',
-        '10MINDPHI-J20s2-XE50',
-        '10MINDPHI-J20ab-XE50',
-        '10MINDPHI-CJ20ab-XE50',
-        '900INVM9999-AJ30s6-AJ20s6',
-        '800INVM9999-AJ30s6-AJ20s6',
+        #'800INVM9999-AJ30s6-AJ20s6',
         '700INVM9999-AJ30s6-AJ20s6',
-        '500INVM9999-AJ30s6-AJ20s6',
-        '400INVM9999-AJ30s6-AJ20s6',
-        #'350INVM9999-AJ30s6-AJ20s6',
         '300INVM9999-AJ30s6-AJ20s6',
-        '200INVM9999-AJ30s6-AJ20s6',
-        '100INVM9999-AJ30s6-AJ20s6',
-        #'350INVM9999-J30s6-J20s6',
-        #'300INVM9999-J30s6-J20s6',
-        #'250INVM9999-J30s6-J20s6',
-        #'200INVM9999-J30s6-J20s6',
-        'HT150-AJj15all.ETA49',
-        '0MATCH-4AJ20.ETA31-4AJj15.ETA31',
+        #'400INVM9999-AJ30s6-AJ20s6',
+        '500INVM9999-J30s6-AJ20s6',
+        #'100INVM9999-AJ30s6-AJ20s6',
+        '0DETA20-J50s1-Js2',
+        '27DPHI32-EMs1-EMs6',
+        #'HT150-AJj15all.ETA49',
+        #'0MATCH-4AJ20.ETA31-4AJj15.ETA31',
         '100RATIO-0MATCH-TAU30si2-EMall',
-        'NOT-0MATCH-TAU30si2-EMall',
-        '0DR28-MU10ab-TAU12abi',
-        '1DISAMB-TAU12abi-J25ab',
-        '1DISAMB-EM15his2-TAU12abi-J25ab',
-        'DISAMB-0DR28-EM15his2-TAU12abi',
-        '1DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
-        '1DISAMB-TAU20abi-TAU12abi-J25ab',
+        'NOT-0MATCH-TAU30si1-EMall',
+        #'1DISAMB-TAU12abi-J25ab',
+        #'1DISAMB-EM15his2-TAU12abi-J25ab',
+        '2DISAMB-TAU12abi-J25ab',
+        '2DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
+        #'0DR28-MU10ab-TAU12abi',  # add back if needed
+        #'1DISAMB-TAU20abi-TAU12abi-J25ab',
         '0DR25-TAU20abi-TAU12abi',
         '0DR28-TAU20abi-TAU12abi',
-        '0DETA20-0DPHI20-TAU20abi-TAU12abi',
-        '1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
-        '1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
+        '2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
+        '2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
         'DISAMB-30INVM-EM20his2-TAU12ab',
         '400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49',
-        'LAR-EM50s1',
-        'LAR-J100s1',
-#SX        '2DR15-CMU4ab-MU4ab',
-#SX        '2DR15-2CMU4ab',
-#SX        '2DR15-MU6ab-MU4ab',
-#SX        '2DR15-ONEBARREL-MU6ab-MU4ab',
-#SX        '2DR15-CMU6ab-CMU4ab',
-
-        '2INVM9-2MU6ab',
-        '7INVM15-2MU4ab', 
-        '2INVM8-ONEBARREL-MU6ab-MU4ab', 
-        '0DR24-2CMU4ab', 
-        '0DR22-2MU6ab',
-        '0DR34-2MU4ab', 
-        '0DR24-2MU4ab', 
-        '0DR24-CMU4ab-MU4ab',  
-        '2INVM8-CMU4ab-MU4ab',
-        '0DR15-2MU4ab',  
-        '0DR15-MU6ab-MU4ab',  
-        '0DR22-MU6ab-MU4ab', 
-        '8INVM15-MU6ab-MU4ab',  
-        '8INVM15-2MU6ab', 
-        '2INVM8-2MU4ab',  # ATR-15197 '2INVM9-2MU4ab',
-        '2INVM8-MU6ab-MU4ab', # ATR-15197 '2INVM9-MU6ab-MU4ab',
-        '2INVM9-2MU4ab',
-        '2INVM9-MU6ab-MU4ab',
-        'KF-XE40-AJall',
-        'KF-XE50-AJall',
-        'KF-XE55-AJall',
-        'KF-XE60-AJall',
-        'KF-XE65-AJall',
-        'KF-XE75-AJall',
+
+        '0INVM9-EM7ab-EMab',
+        '400INVM9999-0DPHI20-J30s6-AJ20s6',
+        '400INVM9999-0DPHI22-J30s6-AJ20s6',
+        '400INVM9999-0DPHI24-J30s6-AJ20s6',
+        '400INVM9999-0DPHI26-J30s6-AJ20s6',
 
         'LATE-MU10s1',
         'SC111-CJ15ab.ETA26',
-        'SC85-CJ15ab.ETA26',
+        
         
         # ALFA (the replication is needed to build all the combinations in the CTPCore)
         'ALFA_B7R1L', 'ALFA_B7R1U', 'ALFA_A7R1L', 'ALFA_A7R1U', 'ALFA_A7L1L', 'ALFA_A7L1U', 'ALFA_B7L1L', 'ALFA_B7L1U',
         'ALFA2_B7R1L', 'ALFA2_B7R1U', 'ALFA2_A7R1L', 'ALFA2_A7R1U', 'ALFA2_A7L1L', 'ALFA2_A7L1U', 'ALFA2_B7L1L', 'ALFA2_B7L1U',
         'ALFA3_B7R1L', 'ALFA3_B7R1U', 'ALFA3_A7R1L', 'ALFA3_A7R1U', 'ALFA3_A7L1L', 'ALFA3_A7L1U', 'ALFA3_B7L1L', 'ALFA3_B7L1U',
         'ALFA4_B7R1L', 'ALFA4_B7R1U', 'ALFA4_A7R1L', 'ALFA4_A7R1U', 'ALFA4_A7L1L', 'ALFA4_A7L1U', 'ALFA4_B7L1L', 'ALFA4_B7L1U',
-#ATR-13743        'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
-
+#ATR-13743      
+        'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
+
+        #ATR-19355
+        '0INVM10-3MU4ab',
+
+        #ATR-18815 - Algorithm needs to be moved to master
+#        '0INVM10-0DR15-EM8abi-MU10ab',
+#        '0INVM10-0DR15-EM12abi-MU6ab',
+
+        #ATR-18824
+        '60INVM9999-25DPHI32-EM15abhi-FJj15s623ETA49',
+        '60INVM9999-04DPHI32-EM15abhi-FJj15s623ETA49',
+        #ATR-19302
+        '0INVM70-27DPHI32-EM12his1-EM12his6',
+
+        #ATR-19720
+        #'8INVM15-0DR22-2MU6ab',
+        #'2INVM9-2DR15-2MU6ab',
+        #'2INVM9-0DR15-MU6ab-MU4ab',
+        #'8INVM15-0DR22-MU6ab-MU4ab',
+        #'2INVM9-0DR15-2MU4ab',
+
+        #ATR-19510
+        '5DETA99-5DPHI99-2MU4ab',
+            
+        #ATR-17320
+        'CEP-CJ60s6',
+        'CEP-CJ50s6',
+       
+        #ATR-20174
+        '8INVM15-2CMU4ab'
 
-        ]
+        
+    ]
 
     
     Lvl1Flags.items = [
 
-        
         # single EM
 
         'L1_EM3','L1_EM7','L1_EM12', 'L1_EM8VH',
-#        'L1_EM8I',
-        'L1_EM10VH', 'L1_EM13VH', 'L1_EM15',
-        'L1_EM15I','L1_EM15HI',
-        'L1_EM26VHI','L1_EM15VH', 'L1_EM18VH', 'L1_EM20VH', 'L1_EM20VHI', 'L1_EM22VHI', 'L1_EM24VHI', # see Jira ATR-10334'L1_EM22VHLIL', #'L1_EM50V',
-        'L1_EM3_EMPTY', 'L1_EM7_EMPTY', 'L1_EM7_UNPAIRED_ISO', 'L1_EM7_FIRSTEMPTY','L1_EM7_UNPAIRED_NONISO',
+        'L1_EM10VH', 'L1_EM15',
+        'L1_EM30VHI',
+        'L1_EM15VHI',
+        'L1_EM24VHIM','L1_EM15VH', 'L1_EM18VHI', 'L1_EM20VH', 'L1_EM20VHI', 'L1_EM22VHI', 'L1_EM22VH','L1_EM24VHI', 
+        'L1_EM3_EMPTY', 'L1_EM7_EMPTY', 'L1_EM7_UNPAIRED_ISO', 'L1_EM7_FIRSTEMPTY',
         'L1_EM20VH_FIRSTEMPTY',
-        'L1_EM22VHI_FIRSTEMPTY',
-        #'L1_EM15_BGRP7',
 
-        # see savannah https://savannah.cern.ch/bugs/?103935
 
-        # combined EM -jet
-        #'L1_JJ15.23ETA49', # 4x4 window
+        # combined EM -jet - all commented
 
         # single MU
-        "L1_MU4", "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU15", "L1_MU20",
-
+        "L1_MU4", "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU20", "L1_MU21",
+        
         "L1_MU4_EMPTY", "L1_MU6_EMPTY", "L1_MU4_FIRSTEMPTY", "L1_MU11_EMPTY",
-        'L1_MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_NONISO',
-         'L1_MU20_FIRSTEMPTY',
+        'L1_MU4_UNPAIRED_ISO',
+
 
-        
         
         # multi lepton
-        "L1_2EM3", "L1_2EM7", "L1_2EM10VH", "L1_2EM13VH", "L1_2EM15", "L1_2EM15VH", "L1_EM7_2EM3", "L1_EM12_2EM3", "L1_EM15VH_3EM7", "L1_EM15VH_3EM8VH", "L1_EM15VH_2EM10VH_3EM7",
-        "L1_2EM18VH", "L1_2EM20VH", "L1_EM15VH_3EM10VH", "L1_EM18VH_3EM8VH", "L1_EM18VH_2EM10VH_3EM7", "L1_EM20VH_3EM10VH", "L1_EM20VH_2EM10VH_3EM8VH",
+        "L1_2EM3", "L1_2EM7",
+        "L1_2EM15", "L1_2EM15VH", "L1_2EM15VHI",
+        "L1_2EM20VH",
+        "L1_EM20VH_3EM10VH", 
         "L1_EM7_MU10",
-        "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY", "L1_MU10_2MU6", "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4",
-
-        "L1_EM8I_MU10", "L1_EM15I_MU4", "L1_2EM8VH_MU10", "L1_EM15VH_MU10", 
-
+        "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY",  "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4", "L1_2MU11", "L1_MU11_2MU10",
+        "L1_2EM8VH_MU10", "L1_EM15VH_MU10",  "L1_EM7_MU20", "L1_EM8VH_MU20",
 
         # single tau
-        "L1_TAU12", "L1_TAU12IM",  "L1_TAU20", "L1_TAU20IM",
-        "L1_TAU30","L1_TAU30_EMPTY","L1_TAU30_UNPAIRED_ISO", "L1_TAU40", "L1_TAU60", "L1_TAU100", "L1_TAU8", "L1_TAU8_EMPTY", 
-        "L1_TAU8_UNPAIRED_ISO","L1_TAU8_FIRSTEMPTY","L1_TAU8_UNPAIRED_NONISO",
+        "L1_TAU5", "L1_TAU12", "L1_TAU12IM",   "L1_TAU20IM",
+        "L1_TAU30","L1_TAU30_EMPTY","L1_TAU30_UNPAIRED_ISO", "L1_TAU40", "L1_TAU60", "L1_TAU90", "L1_TAU100", "L1_TAU8_EMPTY", 
+        "L1_TAU8_UNPAIRED_ISO","L1_TAU8_FIRSTEMPTY",
 
         # multi tau
-        "L1_TAU20IM_2TAU12IM", "L1_TAU20_2TAU12", "L1_TAU40_2TAU20IM",
+        "L1_TAU20IM_2TAU12IM",   "L1_TAU60_2TAU40", "L1_2TAU5", "L1_2TAU8",
 
         # combined tau - lepton
-        "L1_EM15HI_2TAU12IM",          
-        "L1_EM15HI_2TAU12IM_J25_3J12",   
-        "L1_EM15HI_TAU40_2TAU15",
+        "L1_EM15VHI_2TAU12IM",          
+        "L1_EM15VHI_2TAU12IM_J25_3J12",   
+        "L1_EM15VHI_2TAU12IM_4J12",
+        "L1_EM15VHI_TAU40_2TAU15",
         "L1_MU10_TAU12IM",  
-        "L1_MU10_TAU12IM_J25_2J12", 
-#        "L1_MU10_TAU12_J25_2J12", 
-#        "L1_MU10_TAU20",
+        "L1_MU10_TAU12IM_J25_2J12",
+        "L1_MU10_TAU12IM_3J12",
+        #'L1_DR-MU10TAU12I_TAU12I-J25',
         "L1_MU10_TAU20IM",
         "L1_MU11_TAU20IM",
         "L1_MU10_TAU20IM_J25_2J20",
 
         # combined tau - jet
-#        "L1_TAU25IT_2TAU12IT_2J25_3J12", 
 
-        "L1_TAU20IM_2TAU12IM_J25_2J20_3J12", 
-        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I',  
-        'L1_DR-MU10TAU12I_TAU12I-J25', 
-        "L1_MU10_TAU12I-J25",
+        "L1_TAU20IM_2TAU12IM_J25_2J20_3J12",
+        "L1_TAU20IM_2TAU12IM_4J12.0ETA23",
+        #"L1_TAU20IM_2TAU12IM_4J12.0ETA25",
+        "L1_TAU20IM_2TAU12IM_4J12.0ETA28",
+        "L1_TAU25IM_2TAU20IM_2J25_3J20", 
+
 
 
         # combined tau - xe
         "L1_TAU20IM_2J20_XE45", 
-#        "L1_TAU20_2J20_XE45", 
-#        "L1_TAU20IM_2J20_XE50",   
+        "L1_TAU20IM_2J20_XE50", 
+
 
         #"L1_EM15HI_2TAU12I_XE35", 
-        "L1_EM15HI_2TAU12IM_XE35", 
-        "L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15",
+        "L1_EM15VHI_2TAU12IM_XE35", 
         'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20',
 
 
         "L1_MU10_TAU12IM_XE35",  
-#        "L1_MU10_TAU12IM_XE40",  
 
         "L1_TAU20IM_2TAU12IM_XE35", 
-        "L1_TAU20_2TAU12_XE35",
         "L1_TAU40_2TAU12IM_XE40",  
 
 
 
         # combined em - jet
-        #'L1_EM15VH_J15.23ETA49',
-#        'L1_EM15VH_JJ15.23ETA49',
-        'L1_EM13VH_3J20',
-        'L1_EM18VH_3J20',
+        'L1_EM18VHI_3J20',
+        'L1_EM20VH_3J20',
+
+        
 
         # combined mu - jet
-        'L1_MU4_J12',  'L1_MU4_J50_XE40', 'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
-#ATR-13743        'L1_MU4_J30',
-        #'L1_MU4_J50',
+        'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
         'L1_MU10_2J20','L1_MU10_3J20', 'L1_MU10_2J15_J20',
-        'L1_2MU4_J40_XE20',
         'L1_MU20_J40',
         'L1_MU20_XE30',
+        'L1_MU20_J50',
 
         # single jet
-        "L1_J12","L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100", "L1_J120", "L1_J400",
-        "L1_J20.31ETA49", "L1_J30.31ETA49", "L1_J50.31ETA49", "L1_J75.31ETA49", "L1_J100.31ETA49",
-        #'L1_J15.23ETA49',
-         'L1_J15.31ETA49',
-        "L1_J20.28ETA31",
-        #'L1_J40.0ETA25', 
+        "L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100",  "L1_J400", #"L1_J120",
+        "L1_J20.31ETA49", "L1_J30.31ETA49", "L1_J50.31ETA49", "L1_J75.31ETA49", 
+        'L1_J15.31ETA49',
         "L1_J12_EMPTY","L1_J12_FIRSTEMPTY", "L1_J12_UNPAIRED_ISO", "L1_J12_UNPAIRED_NONISO", "L1_J12_ABORTGAPNOTCALIB", 
         "L1_J15.31ETA49_UNPAIRED_ISO",
         "L1_J30_EMPTY", "L1_J30_FIRSTEMPTY", "L1_J30.31ETA49_EMPTY", "L1_J30.31ETA49_UNPAIRED_ISO",
         "L1_J30.31ETA49_UNPAIRED_NONISO",
         "L1_J50_UNPAIRED_ISO", "L1_J50_UNPAIRED_NONISO", "L1_J50_ABORTGAPNOTCALIB",         
-        "L1_J12_BGRP12", "L1_J30.31ETA49_BGRP12",
         'L1_J100_FIRSTEMPTY',
-        'L1_J100.31ETA49_FIRSTEMPTY',
+ 
         
         # multi jet
-
-        "L1_J20_J20.31ETA49",
-        "L1_3J15", "L1_3J20","L1_3J40", 'L1_3J15.0ETA25', "L1_3J50", "L1_4J15", "L1_4J20",
-        "L1_4J20.0ETA49",
+        "L1_J45.0ETA20_3J15.0ETA25",
+        "L1_J50_2J40.0ETA25_3J15.0ETA25",
+        "L1_3J50", "L1_4J15", "L1_4J20", #"L1_4J20.0ETA49",
         "L1_3J15.0ETA25_XE40",
         
-        #"L1_3J75",
-        #"L1_4J30",
         "L1_6J15",
-        "L1_J75_3J20",
         "L1_J85_3J30",
-        "L1_J30.0ETA49_2J20.0ETA49",
-
-        "L1_J15.0ETA25_2J15.31ETA49",
+       # multi jet forward
+        "L1_J25.0ETA23_2J15.31ETA49",
         "L1_J40.0ETA25_2J15.31ETA49",
         "L1_J40.0ETA25_2J25_J20.31ETA49",
-        "L1_J40.0ETA25_2J30_J20.31ETA49",
+        "L1_J30.0ETA49_2J20.0ETA49",
         
         # multi jet central
         "L1_3J25.0ETA23",
         "L1_3J35.0ETA23",
         "L1_4J15.0ETA25",
         "L1_5J15.0ETA25", 
-        
         # combined jet
-        "L1_2J15_XE55", "L1_J40_XE50", "L1_J75_XE50",
+        "L1_2J15_XE55", "L1_J40_XE50",
 
         #'L1_2J40_XE45',
-        "L1_2J50_XE40", "L1_J40_XE60","L1_J40.0ETA25_XE50",
+        "L1_2J50_XE40", "L1_J40_XE60",
+        
 
         # XE
         "L1_XE35", "L1_XE40", "L1_XE45", "L1_XE50", 
         "L1_XE55", "L1_XE60", "L1_XE70", "L1_XE80",
-        'L1_XE10', 'L1_XE30', 'L1_XE65', 'L1_XE75', 'L1_XE150', 'L1_XE300',
+        'L1_XE30', 'L1_XE300',
+        "L1_XE10",
         
         #XS
-        'L1_XS20', 'L1_XS30',
         'L1_EM12_XS20', 'L1_EM15_XS30',
         
         # TE
-        #"L1_TE3",        "L1_TE5",        "L1_TE10",        "L1_TE15",        "L1_TE20",        "L1_TE25",        "L1_TE30",        "L1_TE40",
-        #"L1_TE5",        "L1_TE30",        "L1_TE40",        "L1_TE45",        "L1_TE50",        "L1_TE55",        "L1_TE60",        "L1_TE65",
-        "L1_TE5",        "L1_TE10",        "L1_TE15",   "L1_TE20",  "L1_TE25",  "L1_TE30",        "L1_TE40",      "L1_TE70",      
+#        'L1_TE5', ## disabled?
 
-        #"L1_TE3.0ETA24", "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", 
-        #"L1_TE5.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", "L1_TE45.0ETA24", "L1_TE50.0ETA24", "L1_TE55.0ETA24", "L1_TE60.0ETA24", "L1_TE65.0ETA24", 
-        "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24","L1_TE70.0ETA24",
+        #VTE + MBTS
+        #"L1_MBTS_1_VTE2", "L1_MBTS_1_VTE3", "L1_MBTS_1_VTE4", "L1_MBTS_1_VTE5", "L1_MBTS_1_VTE10", "L1_MBTS_2_VTE2", "L1_MBTS_2_VTE3", "L1_MBTS_2_VTE4", "L1_MBTS_2_VTE5", "L1_MBTS_2_VTE10", 
+        
+        #TE + MU
 
         # MBTS
-        "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
-        "L1_MBTS_1_EMPTY", "L1_MBTS_1_UNPAIRED_ISO", 
-        "L1_MBTS_2_EMPTY", "L1_MBTS_2_UNPAIRED_ISO",
-        "L1_MBTS_1_1_EMPTY", "L1_MBTS_1_1_UNPAIRED_ISO","L1_MBTS_4_A_UNPAIRED_ISO","L1_MBTS_4_C_UNPAIRED_ISO",
-#        'L1_MBTSA0' ,'L1_MBTSA1' ,'L1_MBTSA2' ,'L1_MBTSA3' ,'L1_MBTSA4' ,
-#        'L1_MBTSA5' ,'L1_MBTSA6' ,'L1_MBTSA7' ,'L1_MBTSA8' ,
-#        'L1_MBTSA10','L1_MBTSA12','L1_MBTSA14',
-#        'L1_MBTSC0' ,'L1_MBTSC1' ,'L1_MBTSC2' ,'L1_MBTSC3' ,'L1_MBTSC4' ,
-#        'L1_MBTSC5' ,'L1_MBTSC6' ,'L1_MBTSC7' ,'L1_MBTSC8' ,
-#        'L1_MBTSC10','L1_MBTSC12','L1_MBTSC14',
+        "L1_MBTS_1_EMPTY",
         # beam splashes
-        "L1_MBTS_4_A", "L1_MBTS_4_C",
+        
+        #Overlay
+#        "L1_MBTS_1_OVERLAY","L1_TE20_OVERLAY",
+        
+        #BeamSpot
+#        "L1_MBTS_1_VTE70",
 
         #BGRP9
-        'L1_MBTS_1_BGRP9','L1_MBTS_2_BGRP9',
 
         #BGRP11
-        'L1_MBTS_1_BGRP11','L1_MBTS_2_BGRP11',
 
         # RNDM
-        'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO','L1_RD0_EMPTY',
-        "L1_RD1_FILLED","L1_RD1_EMPTY","L1_RD1_BGRP10",
-        "L1_RD2_FILLED","L1_RD2_EMPTY","L1_RD2_BGRP12",
-        "L1_RD3_FILLED","L1_RD3_EMPTY",
-        'L1_RD0_FIRSTEMPTY', 
-        'L1_RD0_BGRP9', 'L1_RD0_BGRP11', 'L1_RD0_ABORTGAPNOTCALIB',
+        'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO',  'L1_RD0_EMPTY',
+        "L1_RD1_EMPTY","L1_RD2_EMPTY",
+#        'L1_RD0_FIRSTEMPTY', 
+        'L1_RD0_ABORTGAPNOTCALIB',
+#        'L1_RD2_FILLED', # This is not needed?
 
         #LUCID
-        'L1_LUCID', 'L1_LUCID_EMPTY', 'L1_LUCID_UNPAIRED_ISO', 
-        'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
+#        'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
         #'L1_LUCID_COMM_EMPTY', 'L1_LUCID_COMM_UNPAIRED_ISO', 
 
+        
+
         # ZDC
-        'L1_ZDC_A', 'L1_ZDC_C', 'L1_ZDC_A_C',
-        'L1_ZDC_AND', # FTHR
+         # FTHR
 
         # VDM
-        'L1_BGRP9', #"L1_BGRP7",
+         #"L1_BGRP7",
 
         # TRT
         # "L1_TRT",
@@ -569,7 +498,6 @@ def defineMenu():
 #        "L1_TGC_BURST_EMPTY",
 
         # LHCF
-        "L1_LHCF", "L1_LHCF_UNPAIRED_ISO", "L1_LHCF_EMPTY",
     
         #CALREQ
         "L1_CALREQ2",
@@ -578,244 +506,127 @@ def defineMenu():
         "L1_ZB",
 
         # BPTX
-        "L1_BPTX0_BGRP0", "L1_BPTX1_BGRP0",
         
         # BCM
-        'L1_BCM_Wide_BGRP0','L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO', 'L1_BCM_AC_CA_UNPAIRED_ISO',
+         #'L1_BCM_AC_CA_UNPAIRED_ISO',
+        'L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO',
         'L1_BCM_AC_UNPAIRED_ISO','L1_BCM_CA_UNPAIRED_ISO',
         'L1_BCM_AC_UNPAIRED_NONISO','L1_BCM_CA_UNPAIRED_NONISO',
         'L1_BCM_AC_ABORTGAPNOTCALIB', 'L1_BCM_CA_ABORTGAPNOTCALIB','L1_BCM_Wide_ABORTGAPNOTCALIB',
         'L1_BCM_AC_CALIB', 'L1_BCM_CA_CALIB','L1_BCM_Wide_CALIB',
 
         #AFP
-        'L1_AFP_NSC', 'L1_AFP_FSC', 
-        'L1_AFP_C_ANY', 'L1_AFP_C_ANY_UNPAIRED_ISO', 'L1_AFP_C_ANY_UNPAIRED_NONISO', 'L1_AFP_C_ANY_EMPTY', 'L1_AFP_C_ANY_FIRSTEMPTY', 'L1_AFP_C_AND',
+#         'L1_AFP_FSC', 
+#        'L1_AFP_C_ANY', 'L1_AFP_C_ANY_UNPAIRED_ISO', 'L1_AFP_C_ANY_UNPAIRED_NONISO', 'L1_AFP_C_ANY_EMPTY', 'L1_AFP_C_ANY_FIRSTEMPTY', 'L1_AFP_C_AND',
 
-        #--------------------------------
+#	'L1_EM7_AFP_A_AND_C','L1_EM12_AFP_A_AND_C',
+
+
+          #--------------------------------
         # TOPO items
         #--------------------------------
 
         # B-jet
-        'L1_BTAG-MU4J15', 'L1_BTAG-MU4J30', 'L1_BTAG-MU6J20', 'L1_BTAG-MU6J25',
-        #'L1_BTAG-MU4J20',
-        'L1_3J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J30', 'L1_3J15_BTAG-MU6J25', 'L1_3J20_BTAG-MU4J20',
-        #'L1_3J20_BTAG-MU4J30', 'L1_3J20_BTAG-MU6J25',
-
-        # ZH
-        'L1_DPHI-AJ20s2XE50', 'L1_J40_DPHI-J20s2XE50', 'L1_J40_DPHI-J20XE50', 'L1_J40_DPHI-CJ20XE50', #'L1_J40_DPHI-J20s2XE30',
-#SX        'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B',
-#SX        'L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B',
-#SX        'L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO',
-#SX        'L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO',
+        #'L1_BTAG-MU4J15',
+        #'L1_BTAG-MU6J20',
+
+        # ZH - all removed
+   
+
+        #Higgsino
+        'L1_2MU4_J40_XE50',
+        'L1_MU4_J30_XE40_DPHI-J20s2XE30','L1_MU4_J50_XE50_DPHI-J20s2XE30',
+        'L1_MU4_XE60',
 
         # HT
-        'L1_HT190-J15.ETA21',
         'L1_HT190-J15s5.ETA21',
-        'L1_HT150-J20.ETA31',
-        'L1_HT150-J20s5.ETA31',   
 
-        "L1_HT150-J20s5.ETA31_MJJ-400",
         "L1_HT150-J20s5.ETA31_MJJ-400-CF",
         
         # Jpsi T&P
-        'L1_JPSI-1M5', 'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
-        'L1_KF-XE40', 'L1_KF-XE50', 'L1_KF-XE55', 'L1_KF-XE60', 'L1_KF-XE65', 'L1_KF-XE75',
+        'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
+#            
         
-        # W T&P
-#        'L1_W-05DPHI-JXE-0',
-#        'L1_W-10DPHI-JXE-0',
-#        'L1_W-15DPHI-JXE-0',
-#        'L1_W-05DPHI-EMXE-1',
-        #'L1_W-15DPHI-EMXE-1',
-#        'L1_W-05DPHI-EM15XE-1',
-        #'L1_W-15DPHI-EM15XE-1',
-        'L1_W-05RO-XEHT-0',
-        'L1_W-90RO2-XEHT-0',
-        'L1_W-250RO2-XEHT-0',
-        'L1_W-HT20-JJ15.ETA49',
-        'L1_W-NOMATCH',
-        #'L1_W-NOMATCH_W-05RO-XEEMHT',
-        'L1_EM12_W-MT25',
-#        'L1_EM12_W-MT35',
-        'L1_EM15_W-MT35',
-        'L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE',
-        'L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE',
-        'L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE',
-        'L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE',
-        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
-        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM12_W-MT35_XS50',
-        'L1_EM15_W-MT35_XS60',
-        'L1_EM10VH_W-MT35_XS50',
-        'L1_EM15VH_W-MT35_XS60',
-        'L1_EM20VH_W-MT35_XS60',
-        'L1_EM22VHI_W-MT35_XS40',
-        # Old
-        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0',
-        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
-        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE',
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        #'L1_W-10DPHI-JXE-0',
-        #'L1_W-20DPHI-JXE-1',
-        #'L1_W-20DPHI-JXE-0',
-        #'L1_W-20DPHI-EMXE-1',
-        #'L1_W-20DPHI-EMXE-0',
-        #'L1_W-05RO-XEHT-0',
-        #'L1_W-08RO-XEHT-1',
-        #'L1_W-40RO2-XEHT-0',
-        #'L1_W-90RO2-XEHT-1',
-        #'L1_W-HT20-JJ0.ETA49',
-        #'L1_W-NOMATCH',
-        #'L1_W-NOMATCH_W-05RO-XEEMHT',
-        #'L1_EM3_W-MT20',
-        #'L1_EM3_W-MT40',
-
-        #Bphysics items
-#SX        'L1_BPH-DR-2MU4', 
-#SX        'L1_BPH-2M-2MU4', 
-#SX        'L1_BPH-4M8-2MU4',
-#SX        'L1_BPH-DR-2MU4_BPH-2M-2MU4', 'L1_BPH-DR-2MU4_BPH-4M8-2MU4',
-
-#SX        'L1_BPH-DR-2MU6', 
-#SX        'L1_BPH-2M-2MU6', 'L1_BPH-4M8-2MU6',
-#SX        'L1_BPH-DR-2MU6_BPH-2M-2MU6', 'L1_BPH-DR-2MU6_BPH-4M8-2MU6',
-
-        # temporarily commented out until CTP Simulation is fixed (menu generation and TMC understand multiplicity topo)
-#SX uncommenting
-        'L1_2MU4-BO',
-        'L1_2MU6-BO',
-        'L1_MU6MU4-BO', 
-
-        # L1 items for L1Topo streamers
-#SX        'L1_BPH-2M-2MU4-B',
-#SX        'L1_BPH-2M-2MU4-BO',
-#SX        'L1_BPH-2M-MU6MU4',
-#SX        'L1_BPH-2M-MU6MU4-B',
-#SX        'L1_BPH-2M-MU6MU4-BO',    
-#SX        'L1_BPH-4M8-2MU4-B',
-#SX        'L1_BPH-4M8-2MU4-BO',
-#SX        'L1_BPH-4M8-MU6MU4',
-#SX        'L1_BPH-4M8-MU6MU4-B',        
-#SX        'L1_BPH-4M8-MU6MU4-BO',
-        'L1_DY-DR-2MU4',
-        'L1_EM15VH_2EM8VH_MU6',
-        #'L1_DY-BOX-MU6MU4',
-        'L1_DY-BOX-2MU6',
-        'L1_LFV-MU',
+        # W T&P - all removed
+
         'L1_LFV-MU6',
+        'L1_LFV-MU11',
         'L1_LFV-EM8I',
         'L1_LFV-EM15I',
-        'L1_EM7_MU15',
-        'L1_EM8VH_MU15',
         'L1_DPHI-J20s2XE50',
         'L1_J40_XE50_DPHI-J20s2XE50',
-        'L1_DPHI-J20XE50',
-        'L1_DPHI-CJ20XE50',
-        'L1_MU4_J20_XE30_DPHI-J20s2XE30',
         'L1_2MU4_J20_XE30_DPHI-J20s2XE30',
-        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30',
-        'L1_3EM3_J40_XE50_DPHI-J20s2XE50',
-        'L1_MJJ-900',
-        'L1_MJJ-800',
         'L1_MJJ-700',
-        'L1_MJJ-400',
-        #'L1_MJJ-350',
-#        'L1_MJJ-300',
-#        'L1_MJJ-200',
-        'L1_MJJ-100',
-        'L1_HT150-JJ15.ETA49',
-        'L1_HT150-JJ15.ETA49_MJJ-400',
-        'L1_J4-MATCH',
+        'L1_MJJ-300',
+        #'L1_MJJ-100',
+        #'L1_MJJ-400',
+        #'L1_MJJ-800',
+        'L1_MJJ-500-NFF',
+        'L1_J50_DETA20-J50J',
+        'L1_DPHI-2EM3',
+        #'L1_HT150-JJ15.ETA49',
+        #'L1_HT150-JJ15.ETA49_MJJ-400',
+        #'L1_J4-MATCH',
         'L1_LLP-RO',
-        'L1_LLP-NOMATCH',
-        'L1_DR-MU10TAU12I',    
-#        'L1_TAU12I-J25',    
-        'L1_EM15TAU12I-J25',
-        'L1_DR-EM15TAU12I',    
-        'L1_DR-EM15TAU12I-J25',    
-        'L1_TAU20ITAU12I-J25',
+        #'L1_LLP-NOMATCH',
+        #'L1_EM15TAU12I-J25',
+        'L1_DR-EM15TAU12I-J25',
+        #'L1_TAU20ITAU12I-J25',
         'L1_DR-TAU20ITAU12I',    
-        'L1_BOX-TAU20ITAU12I',
         'L1_DR-TAU20ITAU12I-J25',
+        #'L1_DR-MU10TAU12I',
 
-        'L1_DR25-TAU20ITAU12I',
-        'L1_DR25-TAU20ITAU12I-J25',
         'L1_30M-EM20ITAU12',
         'L1_MJJ-400-CF',
     
-        'L1_LAR-EM',
-        'L1_LAR-J',
-#SX        'L1_BPH-DR-2MU4-B',
-#SX        'L1_BPH-DR-2MU4-BO',
-#SX        'L1_BPH-DR-MU6MU4',
-#SX        'L1_BPH-DR-MU6MU4-B',
-#SX        'L1_BPH-DR-MU6MU4-BO',
-
-#new bhysics
-        #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4',
-        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
-        'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4',
-        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4', # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
-        'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
-        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',
-        'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',
-        'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',
-        'L1_2MU4-B',
-        'L1_2MU6-B' ,
-        #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4',
-        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4' ,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B' ,
-        #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4' ,
-        #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4' ,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO' ,
-        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
-        'L1_MU6_2MU4-B',
-
-        'L1_BPH-2M8-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4',
-        'L1_BPH-8M15-MU6MU4',
-        'L1_BPH-8M15-2MU6',
-        
+        #'L1_LAR-EM',
+        #'L1_LAR-J',
+        #'L1_LAR-ZEE',
+        #'L1_LAR-ZEE_LAR-EM',
+        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
+        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
+        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',
+        #'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO',
+
+        #ATR-19720 - no algorithm in master
+#        'L1_BPH-8M15-0DR22-2MU6',
+#        'L1_BPH-2M9-2DR15-2MU6',
+#        'L1_BPH-2M9-0DR15-MU6MU4',
+#        'L1_BPH-8M15-0DR22-MU6MU4-BO',
+#        'L1_BPH-2M9-0DR15-2MU4',
+#
+#        'L1_BPH-0M9-EM7-EM5',        
+#        'L1_BPH-0DR3-EM7J15',
+#        'L1_BPH-0M9-EM7-EM5_MU6',
+#        'L1_BPH-0DR3-EM7J15_MU6',
+#        'L1_BPH-0M9-EM7-EM5_2MU4',
+#        'L1_BPH-0DR3-EM7J15_2MU4',
+#
         # combined L1Topo for VBF
-        'L1_MU6_MJJ-200',
-        'L1_MU6_MJJ-300',
-        'L1_MU6_MJJ-400',
-        'L1_MU6_MJJ-500',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-400',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-700',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-800',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-900',
-        'L1_3J20_4J20.0ETA49_MJJ-400',
-        'L1_3J20_4J20.0ETA49_MJJ-700',
-        'L1_3J20_4J20.0ETA49_MJJ-800',
-        'L1_3J20_4J20.0ETA49_MJJ-900',
         
-        'L1_XE35_MJJ-200',
+        # INVM + DPHI 
+        #'L1_MJJ-400-NFF-0DPHI20',
+        'L1_MJJ-400-NFF-0DPHI22',
+        'L1_MJJ-400-NFF-0DPHI24',
+        'L1_MJJ-400-NFF-0DPHI26',
    
         ### ATR-15062
-        'L1_EM18VH_MJJ-300',
+        'L1_EM18VHI_MJJ-300',
 
-        'L1_LATE-MU10_XE50', 'L1_LATE-MU10_J50',
+        'L1_LATE-MU10_XE50','L1_LATE-MU10_XE40', 'L1_LATE-MU10_J50',
 
         'L1_TAU60_DR-TAU20ITAU12I',
 
-        'L1_SC111',
-        'L1_SC85',
+        'L1_SC111-CJ15',
+#        'L1_SC85-CJ15',
         
         ##     # Partition 1
         ##     'L1_CALREQ0_P1', 'L1_CALREQ1_P1', 'L1_CALREQ2_P1',
 
         #ALFA
-#ALFA_B7R1L_OD        'L1_ALFA_ELAST1',
-#        'L1_ALFA_ELAST2',
-#        'L1_ALFA_ELAST11','L1_ALFA_ELAST12',
-#        'L1_ALFA_ELAST13','L1_ALFA_ELAST14','L1_ALFA_ELAST15','L1_ALFA_ELAST15_Calib',
-#        'L1_ALFA_ELAST16','L1_ALFA_ELAST17','L1_ALFA_ELAST18','L1_ALFA_ELAST18_Calib',
+        'L1_ALFA_ANY',
+        'L1_ALFA_B7L1U','L1_ALFA_B7L1L','L1_ALFA_A7L1U','L1_ALFA_A7L1L','L1_ALFA_A7R1U','L1_ALFA_A7R1L','L1_ALFA_B7R1U','L1_ALFA_B7R1L',
+        
 #        'L1_ALFA_SDIFF5','L1_ALFA_SDIFF6','L1_ALFA_SDIFF7','L1_ALFA_SDIFF8',
 #        'L1_MBTS_1_A_ALFA_C','L1_MBTS_1_C_ALFA_A','L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO',
 #        'L1_MBTS_2_A_ALFA_C','L1_MBTS_2_C_ALFA_A','L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO',
@@ -829,64 +640,105 @@ def defineMenu():
 #
 #        'L1_EM3_ALFA_EINE',
 #        'L1_J12_ALFA_ANY','L1_J12_ALFA_ANY_UNPAIRED_ISO',
-#        'L1_TE5_ALFA_ANY','L1_TE5_ALFA_ANY_UNPAIRED_ISO','L1_TE5_ALFA_EINE',
+#        'L1_TE5_ALFA_ANY','L1_TE5_ALFA_ANY_UNPAIRED_ISO',
+#         'L1_TE5_ALFA_EINE',
 #        'L1_TRT_ALFA_ANY','L1_TRT_ALFA_ANY_UNPAIRED_ISO',
 #        'L1_TRT_ALFA_EINE',
 #        #'L1_LHCF_ALFA_ANY_A',
 #        #'L1_LHCF_ALFA_ANY_C',
 ##        'L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO','L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO',
-#        'L1_ALFA_BGT','L1_ALFA_BGT_UNPAIRED_ISO','L1_ALFA_BGT_BGRP10',
-#        'L1_ALFA_SHOWSYST5',
-#        'L1_ALFA_SYST9' ,'L1_ALFA_SYST10','L1_ALFA_SYST11','L1_ALFA_SYST12',
-#        'L1_ALFA_SYST17','L1_ALFA_SYST18',
-         'L1_ALFA_ANY',
-#        'L1_ALFA_ANY_EMPTY','L1_ALFA_ANY_FIRSTEMPTY','L1_ALFA_ANY_UNPAIRED_ISO','L1_ALFA_ANY_UNPAIRED_NONISO',
-#        'L1_ALFA_ANY_BGRP10','L1_ALFA_ANY_ABORTGAPNOTCALIB','L1_ALFA_ANY_CALIB',
-        'L1_ALFA_B7L1U','L1_ALFA_B7L1L','L1_ALFA_A7L1U','L1_ALFA_A7L1L','L1_ALFA_A7R1U','L1_ALFA_A7R1L','L1_ALFA_B7R1U','L1_ALFA_B7R1L',
+#        'L1_ALFA_BGT','L1_ALFA_BGT_UNPAIRED_ISO',
 #        'L1_ALFA_ANY_A_EMPTY','L1_ALFA_ANY_C_EMPTY',
-#        'L1_ALFA_B7L1U_OD','L1_ALFA_B7L1L_OD','L1_ALFA_A7L1U_OD','L1_ALFA_A7L1L_OD','L1_ALFA_A7R1U_OD','L1_ALFA_A7R1L_OD','L1_ALFA_B7R1U_OD','L1_ALFA_B7R1L_OD',
-#        'L1_ALFA_B7L1_OD','L1_ALFA_A7L1_OD','L1_ALFA_B7R1_OD','L1_ALFA_A7R1_OD',
 #
-         'L1_AFP_C_MBTS_A',
-         'L1_AFP_C_ZDC_C',
-         'L1_AFP_C_J12',
-         'L1_AFP_C_EM3',
-         'L1_AFP_C_TE5',
-         'L1_AFP_C_ALFA_C',
-         'L1_AFP_C_ALFA_A',
-         'L1_AFP_C_ANY_MBTS_A',
-         'L1_AFP_C_MU4',
+#         'L1_AFP_C_MBTS_A',
+#         'L1_AFP_C_ZDC_C',
+#         'L1_AFP_C_J12',
+#         'L1_AFP_C_EM3',
+#         'L1_AFP_C_TE5',
+#         'L1_AFP_C_ALFA_C',
+#         'L1_AFP_C_ALFA_A',
+#         'L1_AFP_C_ANY_MBTS_A',
+#         'L1_AFP_C_MU4',
+
+        # Items for beta*=90m run
+#        'L1_J12_ALFA_EINE',
+#        'L1_2EM3_ALFA_EINE',
+#        'L1_MU4_ALFA_ANY',
+#        'L1_MU4_ALFA_ANY_UNPAIRED_ISO',
+#        'L1_MU4_ALFA_ANY_PAIRED_UNPAIRED_ISO',
+#        'L1_MU4_ALFA_EINE',
+
+
+        #ATR-18815
+        #'L1_LFV-EM8I-MU11',
+        #'L1_LFV-EM12I-MU6',
+
+        #ATR-19355
+        'L1_BPH-0M10-3MU4',
+
+        #ATR-18824
+        'L1_ZAFB-04DPHI-EM15I',
+        'L1_ZAFB-25DPHI-EM15I',
+        #'L1_ZAFB-25DPHI-EM18I',
+
+        #ATR-19302: 
+#        'L1_DPHI-M70-2EM10I',
+        'L1_DPHI-M70-2EM12I',
+
+        #ATR-19510
+        'L1_DY-BOX-2MU4',
+        #'L1_DY-DR-2MU4',
+        'L1_DY-BOX-2MU6',
+
+                
+        #ATR-17320
+        'L1_CEP-CJ60',
+        'L1_CEP-CJ50' ,
+
+        #ATR-20174
+        'L1_BPH-8M15-2MU4-BO'
+
+
 
         ]
     
 
-    # the CTP ID mapping still has to be defined, currently it is taken from the order of the items
-    #Free slot [ATR-14858], 16-08-16
-    #[82,143,377,378,379,406,409,416,480]
+    #CTP IDs are taken from this mapping. Every L1 item needs a unique ctpid.
+    # Run this file as python <this file> to print out available IDs
+    # 463-464 are reserved for L1_RD2_BGRP14 and L1_RD3_BGRP15 (from run 2)
+    # 509-511 are reserved for CALREQ
 
     
 
     Lvl1Flags.CtpIdMap = {
+
         'L1_EM3' : 0,
         'L1_EM7' : 1,
         'L1_EM12' : 2,
         'L1_EM8VH' : 3,
         'L1_EM10VH' : 4,
-        'L1_EM13VH' : 5,
         'L1_EM15' : 6,
+        'L1_EM30VHI' : 25,
+        'L1_EM15VHI' : 29,
+        'L1_EM24VHIM' : 30,
         'L1_EM15VH' : 7,
-        'L1_EM18VH' : 8,
+        'L1_EM18VHI' : 8,
         'L1_EM20VH' : 9,
         'L1_EM20VHI' : 10,
         'L1_EM22VHI' : 11,
+        'L1_EM22VH' : 295,
+        'L1_EM24VHI' : 392,
         'L1_EM3_EMPTY' : 12,
         'L1_EM7_EMPTY' : 13,
+        'L1_EM7_UNPAIRED_ISO' : 389,
+        'L1_EM7_FIRSTEMPTY' : 371,
+        'L1_EM20VH_FIRSTEMPTY' : 411,
         'L1_MU4' : 14,
         'L1_MU6' : 15,
         'L1_MU10' : 16,
         'L1_MU11' : 256,
-        'L1_MU15' : 17,
         'L1_MU20' : 18,
+        'L1_MU21' : 17,
         'L1_MU4_EMPTY' : 19,
         'L1_MU6_EMPTY' : 66,
         'L1_MU4_FIRSTEMPTY' : 20,
@@ -894,103 +746,99 @@ def defineMenu():
         'L1_MU4_UNPAIRED_ISO' : 22,
         'L1_2EM3' : 23,
         'L1_2EM7' : 24,
-        'L1_2EM10VH' : 25,
-        'L1_2EM13VH' : 26,
         'L1_2EM15' : 27,
         'L1_2EM15VH' : 28,
-        'L1_EM7_2EM3' : 29,
-        'L1_EM12_2EM3' : 30,
-        'L1_EM15VH_3EM7' : 31,
-        'L1_2EM18VH':398,
-        'L1_2EM20VH':400,
-        'L1_EM15VH_3EM10VH':401,
-        'L1_EM18VH_3EM8VH':406,
-        'L1_EM18VH_2EM10VH_3EM7':408,
-        'L1_EM20VH_3EM10VH':431, 
-        'L1_EM20VH_2EM10VH_3EM8VH':432,
+        'L1_2EM15VHI' : 31,
+        'L1_2EM20VH' : 400,
+        'L1_EM20VH_3EM10VH' : 431,
+        'L1_EM7_MU10' : 65,
         'L1_2MU4' : 32,
         'L1_2MU6' : 33,
         'L1_2MU10' : 34,
         'L1_2MU20_OVERLAY' : 35,
-        'L1_MU10_2MU6' : 36,
         'L1_MU11_2MU6' : 37,
         'L1_3MU4' : 38,
         'L1_MU6_2MU4' : 39,
         'L1_3MU6' : 40,
         'L1_4MU4' : 46,
-        'L1_4J15.0ETA25' : 41,
-        'L1_EM15I_MU4' : 42,
+        'L1_MU6_3MU4' : 36,
+        'L1_2MU6_3MU4' : 42,
+        'L1_2MU11' : 48,
+        'L1_MU11_2MU10' : 49,
         'L1_2EM8VH_MU10' : 43,
         'L1_EM15VH_MU10' : 44,
+        'L1_EM7_MU20' : 483,
+        'L1_EM8VH_MU20' : 484,
+        'L1_TAU5' : 50,
         'L1_TAU12' : 45,
         'L1_TAU12IM' : 47,
-        'L1_TAU20' : 49,
         'L1_TAU20IM' : 51,
         'L1_TAU30' : 53,
+        'L1_TAU30_EMPTY' : 341,
+        'L1_TAU30_UNPAIRED_ISO' : 343,
         'L1_TAU40' : 54,
         'L1_TAU60' : 55,
+        'L1_TAU90' : 56,
         'L1_TAU100' : 52,
-        'L1_TAU8' : 56,
         'L1_TAU8_EMPTY' : 57,
+        'L1_TAU8_UNPAIRED_ISO' : 388,
+        'L1_TAU8_FIRSTEMPTY' : 391,
         'L1_TAU20IM_2TAU12IM' : 58,
-        'L1_TAU20_2TAU12' : 59,
-        'L1_EM15HI_2TAU12IM' : 60,
-        'L1_EM15HI_2TAU12IM_J25_3J12' : 61,
-        'L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15' : 378,
-        'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
-        'L1_EM15HI_TAU40_2TAU15' : 62,
+        'L1_TAU60_2TAU40' : 458,
+        'L1_2TAU5' : 59,
+        'L1_2TAU8' : 166,
+        'L1_EM15VHI_2TAU12IM' : 60,
+        'L1_EM15VHI_2TAU12IM_J25_3J12' : 61,
+        'L1_EM15VHI_2TAU12IM_4J12' : 5,
+        'L1_EM15VHI_TAU40_2TAU15' : 62,
         'L1_MU10_TAU12IM' : 63,
         'L1_MU10_TAU12IM_J25_2J12' : 64,
-        'L1_EM7_MU10':65,
-        'L1_TAU30_EMPTY':341,
+        'L1_MU10_TAU12IM_3J12' : 482,
         'L1_MU10_TAU20IM' : 67,
         'L1_MU11_TAU20IM' : 430,
         'L1_MU10_TAU20IM_J25_2J20' : 377,
-
         'L1_TAU20IM_2TAU12IM_J25_2J20_3J12' : 70,
-        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I' : 71,
-        'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
-        'L1_MU10_TAU12I-J25' : 73,
+        'L1_TAU20IM_2TAU12IM_4J12.0ETA23' : 316,
+        #'L1_TAU20IM_2TAU12IM_4J12.0ETA25' : 73,
+        'L1_TAU20IM_2TAU12IM_4J12.0ETA28' : 77,
+        'L1_TAU25IM_2TAU20IM_2J25_3J20' : 398,
         'L1_TAU20IM_2J20_XE45' : 74,
-        'L1_TAU30_UNPAIRED_ISO' :343,
-        'L1_TAU60_DR-TAU20ITAU12I' : 76,
-        'L1_EM15HI_2TAU12IM_XE35' : 78,
+        'L1_TAU20IM_2J20_XE50' : 79,
+        'L1_EM15VHI_2TAU12IM_XE35' : 78,
+        'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
         'L1_MU10_TAU12IM_XE35' : 81,
-#        'L1_MU10_TAU12IM_XE40' : 82,
         'L1_TAU20IM_2TAU12IM_XE35' : 83,
-        'L1_TAU20_2TAU12_XE35' : 84,
         'L1_TAU40_2TAU12IM_XE40' : 429,
-#        'L1_EM15VH_JJ15.23ETA49' : 86,
-        'L1_MU4_J12' : 87,
-        'L1_MU4_J50_XE40' : 330,
+        'L1_EM18VHI_3J20' : 172,
+        'L1_EM20VH_3J20' : 26,
         'L1_MU6_J20' : 88,
+        'L1_MU6_J30.0ETA49_2J20.0ETA49' : 382,
         'L1_MU6_J40' : 89,
         'L1_MU6_J75' : 90,
-        'L1_2MU4_J40_XE20' : 331,
-        'L1_MU20_J40'  : 428,
+        'L1_MU10_2J20' : 278,
+        'L1_MU10_3J20' : 173,
+        'L1_MU10_2J15_J20' : 255,
+        'L1_MU20_J40' : 428,
         'L1_MU20_XE30' : 433,
-        'L1_J12' : 91,
+        'L1_MU20_J50' : 82,
         'L1_J15' : 92,
         'L1_J20' : 93,
         'L1_J25' : 94,
         'L1_J30' : 95,
-        
         'L1_J40' : 96,
         'L1_J50' : 97,
         'L1_J75' : 98,
         'L1_J85' : 99,
         'L1_J100' : 100,
-        'L1_J120' : 101,
+        #'L1_J120' : 101,
         'L1_J400' : 102,
+        #'L1_4J20.0ETA49' : 383,
         'L1_J20.31ETA49' : 103,
         'L1_J30.31ETA49' : 104,
         'L1_J50.31ETA49' : 105,
         'L1_J75.31ETA49' : 106,
-        'L1_J100.31ETA49' : 107,
-#        'L1_J40.0ETA25' : 108,
-        
         'L1_J15.31ETA49' : 109,
-        'L1_J20.28ETA31' : 110,
+        'L1_J30.0ETA49_2J20.0ETA49' : 137,
         'L1_J12_EMPTY' : 111,
         'L1_J12_FIRSTEMPTY' : 112,
         'L1_J12_UNPAIRED_ISO' : 113,
@@ -1005,43 +853,27 @@ def defineMenu():
         'L1_J50_UNPAIRED_ISO' : 121,
         'L1_J50_UNPAIRED_NONISO' : 122,
         'L1_J50_ABORTGAPNOTCALIB' : 123,
-
-        'L1_J20_J20.31ETA49' : 125,
-        'L1_3J15' : 126,
-        'L1_3J20' : 127,
-        'L1_3J40' : 128,
-        'L1_3J15.0ETA25' : 129,
+        'L1_J100_FIRSTEMPTY' : 414,
+        'L1_J45.0ETA20_3J15.0ETA25' : 86,
+        'L1_J50_2J40.0ETA25_3J15.0ETA25' : 87,
         'L1_3J50' : 130,
         'L1_4J15' : 131,
         'L1_4J20' : 132,
         'L1_3J15.0ETA25_XE40' : 184,
-        
-#        'L1_3J75' : 133,
-#        'L1_4J30' : 134,
         'L1_6J15' : 135,
-        'L1_J75_3J20' : 136,
         'L1_J85_3J30' : 480,
-        'L1_J30.0ETA49_2J20.0ETA49' : 137,
-
-       
-        'L1_TE10' : 138,
-        'L1_TE15' : 82,
-        'L1_TE25' : 143,
-
+        'L1_J25.0ETA23_2J15.31ETA49' : 335,
+        'L1_J40.0ETA25_2J15.31ETA49' : 181,
+        'L1_J40.0ETA25_2J25_J20.31ETA49' : 182,
+        'L1_3J25.0ETA23' : 373,
+        'L1_3J35.0ETA23' : 425,
+        'L1_4J15.0ETA25' : 41,
         'L1_5J15.0ETA25' : 140,
         'L1_2J15_XE55' : 141,
         'L1_J40_XE50' : 142,
-        #'L1_J75_XE40' : 143,
-        'L1_J75_XE50' : 133,
-
+        'L1_2J50_XE40' : 175,
+        'L1_J40_XE60' : 176,
         'L1_XE10': 68,
-        #'L1_XE25': 82,
-        'L1_XE30': 85,
-        'L1_XE65': 108,
-        'L1_XE75': 134,
-        'L1_XE150': 156,
-        'L1_XE300': 187,
-        
         'L1_XE35' : 144,
         'L1_XE40' : 145,
         'L1_XE45' : 146,
@@ -1050,129 +882,25 @@ def defineMenu():
         'L1_XE60' : 149,
         'L1_XE70' : 150,
         'L1_XE80' : 151,
-        'L1_XS20' : 152,
-        'L1_XS30' : 153,
+        'L1_XE30' : 85,
+        'L1_XE300' : 187,
         'L1_EM12_XS20' : 154,
         'L1_EM15_XS30' : 155,
-
-        'L1_TE30' : 157,
-        'L1_TE40' : 158,
-        'L1_TE70' : 159,
-        'L1_TE30.0ETA24' : 160,
-        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
-        'L1_BCM_AC_CA_UNPAIRED_ISO' : 162,
-        'L1_BCM_AC_UNPAIRED_ISO' : 163,
-        'L1_MBTS_1_EMPTY' : 164,
-        'L1_MBTS_1_UNPAIRED_ISO' : 165,
-        'L1_MBTS_2_EMPTY' : 166,
-        'L1_MBTS_2_UNPAIRED_ISO' : 167,
-        'L1_MBTS_1_1_EMPTY' : 168,
-        'L1_MBTS_1_1_UNPAIRED_ISO' : 169,
-
-        'L1_DPHI-AJ20s2XE50' : 171,
-        'L1_EM13VH_3J20' : 172,
-        'L1_EM18VH_3J20' : 295,
-        'L1_MU10_3J20' : 173,
-
-        'L1_2J50_XE40' : 175,
-        'L1_J40_XE60' : 176,
-        'L1_J40.0ETA25_XE50' : 177,
-        'L1_MU10_2J20' : 278,
-        'L1_TAU40_2TAU20IM' : 254,
-        'L1_MU10_2J15_J20' : 255,
-# freeing some CTPIDs  
-#        'L1_MBTSA0' : 170,
-#        'L1_MBTSA1' : 171,
-#        'L1_MBTSA2' : 172,
-#        'L1_MBTSA3' : 173,
-#        'L1_MBTSA4' : 174,
-#        'L1_MBTSA5' : 175,
-#        'L1_MBTSA6' : 176,
-#        'L1_MBTSA7' : 177,
-#        'L1_MBTSA8' : 178,
-#        'L1_MBTSA10' : 179,
-#        'L1_MBTSA12' : 180,
-#        'L1_MBTSA14' : 181,
-#        'L1_MBTSC0' : 182,
-#        'L1_MBTSC1' : 183,
-#        'L1_MBTSC2' : 184,
-#        'L1_MBTSC3' : 185,
-#        'L1_MBTSC4' : 186,
-#        'L1_MBTSC5' : 187,
-#        'L1_MBTSC6' : 188,
-#        'L1_MBTSC7' : 189,
-#        'L1_MBTSC8' : 190,
-#        'L1_MBTSC10' : 191,
-#        'L1_MBTSC12' : 192,
-#        'L1_MBTSC14' : 193,
-
-        
-        'L1_BPH-2M8-2MU4' : 178, # ATR-15197 'L1_BPH-2M9-2MU4' : 178,
-        'L1_BPH-8M15-MU6MU4' : 179,
-        'L1_BPH-8M15-2MU6' : 180,
-        'L1_J15.0ETA25_2J15.31ETA49': 305 , 
-        'L1_J40.0ETA25_2J15.31ETA49' : 181,
-        'L1_J40.0ETA25_2J25_J20.31ETA49' : 182,
-
-        "L1_J40.0ETA25_2J30_J20.31ETA49":250 , 
-
-        "L1_HT150-J20s5.ETA31_MJJ-400": 272 , ## noid(ea)
-        "L1_HT150-J20s5.ETA31_MJJ-400-CF": 273,
-        
-        ## the ctp ids are a mess.. no 7 consequetive ids are free.. but these here are:
-        'L1_AFP_C_MBTS_A':183,
-        'L1_AFP_C_ZDC_C':189,
-        'L1_AFP_C_J12':190,
-        'L1_AFP_C_EM3':191,
-        'L1_AFP_C_TE5':192,
-        'L1_AFP_C_ALFA_C':193,
-        'L1_AFP_C_ALFA_A':170,
-        'L1_AFP_C_ANY_MBTS_A':174,
-        'L1_AFP_C_MU4':379,   
-        
-#        'L1_EM8I' : 183,
-#        'L1_EM15I': 184,
-        'L1_MBTS_4_A_UNPAIRED_ISO' : 185,
-        'L1_MBTS_4_C_UNPAIRED_ISO' : 186,        
-        'L1_MBTS_4_A' : 194,
-        'L1_MBTS_4_C' : 195,
-        'L1_MBTS_1_BGRP9' : 196,
-        'L1_MBTS_2_BGRP9' : 197,
-        'L1_MBTS_1_BGRP11' : 198,
-        'L1_MBTS_2_BGRP11' : 199,
         'L1_RD0_FILLED' : 200,
         'L1_RD0_UNPAIRED_ISO' : 201,
         'L1_RD0_EMPTY' : 202,
-        'L1_RD1_FILLED' : 203,
         'L1_RD1_EMPTY' : 204,
-        'L1_RD1_BGRP10' : 188,
-        'L1_RD2_FILLED' : 205,
         'L1_RD2_EMPTY' : 206,
-        'L1_RD3_FILLED' : 207,
-        'L1_RD3_EMPTY' : 208,
-        'L1_RD0_FIRSTEMPTY' : 209,
-        'L1_RD0_BGRP9' : 210,
-        'L1_RD0_BGRP11' : 211,
-        'L1_LUCID' : 212,
-        'L1_LUCID_EMPTY' : 213,
-        'L1_LUCID_UNPAIRED_ISO' : 214,
-        'L1_LUCID_A_C_EMPTY' : 215,
-        'L1_LUCID_A_C_UNPAIRED_ISO' : 216,
-        'L1_LUCID_A_C_UNPAIRED_NONISO' : 217,
         'L1_TRT_FILLED' : 218,
         'L1_TRT_EMPTY' : 219,
+        'L1_RD0_ABORTGAPNOTCALIB' : 372,
         'L1_TGC_BURST' : 220,
-#        'L1_TGC_BURST_EMPTY' : 184,
-        'L1_LHCF' : 221,
-        'L1_BCM_Wide_BGRP0' : 222,
+        'L1_ZB' : 240,
         'L1_BCM_AC_CA_BGRP0' : 223,
         'L1_BCM_Wide_EMPTY' : 224,
         'L1_BCM_Wide_UNPAIRED_ISO' : 225,
-        'L1_MBTS_1' : 226,
-        'L1_MBTS_2' : 227,
-        'L1_MBTS_1_1' : 228,
-        
-      
+        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
+        'L1_BCM_AC_UNPAIRED_ISO' : 163,
         'L1_BCM_CA_UNPAIRED_ISO' : 229,
         'L1_BCM_AC_UNPAIRED_NONISO' : 230,
         'L1_BCM_CA_UNPAIRED_NONISO' : 231,
@@ -1182,338 +910,97 @@ def defineMenu():
         'L1_BCM_AC_CALIB' : 235,
         'L1_BCM_CA_CALIB' : 236,
         'L1_BCM_Wide_CALIB' : 237,
-        'L1_BTAG-MU4J15' : 238,
-        'L1_BTAG-MU4J30' : 239,
-        'L1_ZB' : 240,
-        'L1_BPTX0_BGRP0' : 241,
-        'L1_BPTX1_BGRP0' : 242,
-        'L1_BTAG-MU6J20' : 243,
-        'L1_BTAG-MU6J25' : 244,
-#        'L1_BTAG-MU4J20' : 245,
-        'L1_3J15_BTAG-MU4J15' : 246,
-        'L1_3J15_BTAG-MU4J30' : 247,
-        'L1_3J15_BTAG-MU6J25' : 248,
-        'L1_3J20_BTAG-MU4J20' : 249,
-#        'L1_J40_DPHI-Js2XE50' : 250,
-        'L1_J40_DPHI-J20s2XE50' : 251,
-        #'L1_J40_DPHI-J20s2XE30' : 257,
-        'L1_J40_XE50_DPHI-J20s2XE50': 245,
-        'L1_J40_DPHI-J20XE50' : 252,
-        'L1_J40_DPHI-CJ20XE50' : 253,
-        'L1_MU4_J20_XE30_DPHI-J20s2XE30' : 257,
-        'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
-        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30' : 434,
-        'L1_3EM3_J40_XE50_DPHI-J20s2XE50' : 435,
-#SX
-#        'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B' : 254,
-#        'L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B' : 255,
-#        'L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO' : 256,
-#        'L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO' : 257,
-
-        
-        'L1_HT190-J15.ETA21' : 258,
+        #'L1_BTAG-MU4J15' : 238,
+        #'L1_BTAG-MU6J20' : 243,
+        'L1_2MU4_J40_XE50' : 449,
+        'L1_MU4_J30_XE40_DPHI-J20s2XE30' : 452,
+        'L1_MU4_J50_XE50_DPHI-J20s2XE30' : 453,
+        'L1_MU4_XE60' : 454,
         'L1_HT190-J15s5.ETA21' : 259,
-        'L1_HT150-J20.ETA31' : 260,
-        'L1_HT150-J20s5.ETA31' : 261,
-        'L1_JPSI-1M5' : 262,
+        'L1_HT150-J20s5.ETA31_MJJ-400-CF' : 91,
         'L1_JPSI-1M5-EM7' : 263,
         'L1_JPSI-1M5-EM12' : 264,
-        'L1_KF-XE40' : 265,
-        'L1_KF-XE50' : 266,
-        'L1_KF-XE55' : 267,
-        'L1_KF-XE60' : 268,
-        'L1_KF-XE65' : 269,
-        'L1_KF-XE75' : 270,
-#        'L1_W-05DPHI-JXE-0' : 271,
-#        'L1_W-10DPHI-JXE-0' : 272,
-#        'L1_W-15DPHI-JXE-0' : 273,
-        #'L1_W-15DPHI-EMXE-1' : 271,
-        #'L1_W-15DPHI-EM15XE-1' : 272,
-#        'L1_W-05DPHI-EMXE-1' : 276,
-        'L1_W-05RO-XEHT-0' : 277,
-        'L1_W-90RO2-XEHT-0' : 279,
-        'L1_W-250RO2-XEHT-0' : 280,
-        'L1_W-HT20-JJ15.ETA49' : 281,
-        'L1_W-NOMATCH' : 282,
-        #'L1_W-NOMATCH_W-05RO-XEEMHT' : 283,
-        'L1_EM10_W-MT25' : 284,
-        'L1_EM15_W-MT35' : 286,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0' : 287,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30' : 288,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20' : 289,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE' : 290,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_W-250RO2-XEHT-0' : 291,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS60' : 292,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS30' : 293,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE' : 294,
-#SX
-#        'L1_BPH-DR-2MU4' : 295,
-#        'L1_BPH-2M-2MU4' : 296,
-#        'L1_BPH-4M8-2MU4' : 297,
-#        'L1_BPH-DR-2MU4_BPH-2M-2MU4' : 298,
-#        'L1_BPH-DR-2MU4_BPH-4M8-2MU4' : 299,
-#        'L1_BPH-DR-2MU6' : 300,
-#        'L1_BPH-2M-2MU6' : 301,
-#        'L1_BPH-4M8-2MU6' : 302,
-#        'L1_BPH-DR-2MU6_BPH-2M-2MU6' : 303,
-#        'L1_BPH-DR-2MU6_BPH-4M8-2MU6' : 304,
-#        'L1_BPH-2M-2MU4-B' : 305,
-#        'L1_BPH-2M-2MU4-BO' : 306,
-#        'L1_BPH-2M-MU6MU4' : 307,
-#        'L1_BPH-2M-MU6MU4-B' : 308,
-#        'L1_BPH-2M-MU6MU4-BO' : 309,
-#        'L1_BPH-4M8-2MU4-B' : 310,
-#        'L1_BPH-4M8-2MU4-BO' : 311,
-#        'L1_BPH-4M8-MU6MU4' : 312,
-#        'L1_BPH-4M8-MU6MU4-B' : 313,
-#        'L1_BPH-4M8-MU6MU4-BO' : 314,
-
-#SX adding
-        #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4' : 295,
-        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4'  : 296, #  ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4'  : 296,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4'  : 297,
-        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4'  : 298, # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4'  : 298,
-        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4'  : 299,
-        'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6' : 300,
-        'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6'  : 301,
-        'L1_MU6MU4-BO' : 302,
-        'L1_2MU4-B' : 303,
-        'L1_2MU6-B'  : 304,
-        #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4'  : 305,
-        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4'  : 306,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'  :  307,
-        #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4'   : 308,
-        #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4'  : 309,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO'  : 310,
-        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4' : 311,
-        'L1_2MU4-BO' : 312,
-        'L1_2MU6-BO' : 313,
-        'L1_MU6_2MU4-B'  : 314,
-
-        ### ATR-14350 - these should be replaced in 2017 with items 296 and 298
-        'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4' : 426,
-        'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' : 427,
-
-
-        'L1_DY-DR-2MU4' : 315,
-        'L1_EM15VH_2EM8VH_MU6' : 316,
-        #'L1_DY-BOX-MU6MU4' : 317,
-        'L1_DY-BOX-2MU6' : 318,
-        'L1_LFV-MU' : 319,
         'L1_LFV-MU6' : 332,
+        'L1_LFV-MU11' : 364,
         'L1_LFV-EM8I' : 320,
         'L1_LFV-EM15I' : 321,
-        'L1_EM7_MU15' : 322,
-        'L1_EM8VH_MU15' : 48,
         'L1_DPHI-J20s2XE50' : 323,
-        'L1_DPHI-J20XE50' : 324,
-        'L1_DPHI-CJ20XE50' : 325,
-        'L1_MJJ-900' : 326,
-        'L1_MJJ-800' : 327,
-        'L1_MJJ-700' : 328,
-        'L1_MJJ-400' : 329,
-        #'L1_MJJ-350' : 330,
-#        'L1_MJJ-300' : 331,
-#        'L1_MJJ-200' : 332,
-        'L1_MJJ-100' : 333,
-        'L1_HT150-JJ15.ETA49' : 334,
-        'L1_J4-MATCH' : 336,
+        'L1_J40_XE50_DPHI-J20s2XE50' : 245,
+        'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
+        'L1_MJJ-700' : 216,
+        'L1_MJJ-300' : 331,
+        #'L1_MJJ-100' : 333,
+        #'L1_MJJ-400' : 329,
+        #'L1_MJJ-800' : 327,
+        'L1_MJJ-500-NFF' : 108,
+        'L1_J50_DETA20-J50J' : 275,
+        'L1_DPHI-2EM3' : 288,
+        #'L1_HT150-JJ15.ETA49' : 334,
+        #'L1_HT150-JJ15.ETA49_MJJ-400' : 416,
+        #'L1_J4-MATCH' : 336,
         'L1_LLP-RO' : 338,
-        'L1_LLP-NOMATCH' : 339,
-        'L1_DR-MU10TAU12I' : 340,
-#        'L1_TAU12I-J25' : 341,
-        'L1_EM15TAU12I-J25' : 345,
+        #'L1_LLP-NOMATCH' : 339,
+        #'L1_EM15TAU12I-J25' : 345,
+        #'L1_DR-MU10TAU12I' : 340,
+        #'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
         'L1_DR-EM15TAU12I-J25' : 346,
-        'L1_TAU20ITAU12I-J25' : 347,
+        #'L1_TAU20ITAU12I-J25' : 347,
         'L1_DR-TAU20ITAU12I' : 348,
-        'L1_BOX-TAU20ITAU12I' : 349,
         'L1_DR-TAU20ITAU12I-J25' : 350,
-
-        'L1_DR25-TAU20ITAU12I' : 337,
-
-        'L1_DR25-TAU20ITAU12I-J25' : 386,
         'L1_30M-EM20ITAU12' : 387,
-        'L1_MJJ-400-CF': 397,
-
-        'L1_LAR-EM' : 351,
-        'L1_LAR-J' : 352,
-        'L1_DR-EM15TAU12I' : 353,        
-        'L1_LATE-MU10_XE50': 354,
+        'L1_MJJ-400-CF' : 397,
+        #'L1_LAR-EM' : 351,
+        #'L1_LAR-J' : 352,
+        #'L1_LAR-ZEE' : 71,
+        #'L1_LAR-ZEE_LAR-EM' : 285,
+        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4' : 426,
+        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' : 427,
+        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO' : 488,
+        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6' : 301,
+        'L1_BPH-8M15-0DR22-2MU6' : 107,
+        'L1_BPH-2M9-2DR15-2MU6' : 110,
+        'L1_BPH-2M9-0DR15-MU6MU4' : 125,
+        'L1_BPH-8M15-0DR22-MU6MU4-BO' : 126,
+        'L1_BPH-2M9-0DR15-2MU4' : 127,
+        'L1_BPH-0M9-EM7-EM5' : 80,
+        'L1_BPH-0DR3-EM7J15' : 84,
+        'L1_BPH-0M9-EM7-EM5_MU6' : 124,
+        'L1_BPH-0DR3-EM7J15_MU6' : 134,
+        'L1_BPH-0M9-EM7-EM5_2MU4' : 153,
+        'L1_BPH-0DR3-EM7J15_2MU4' : 156,
+        #'L1_MJJ-400-NFF-0DPHI20' : 128,
+        'L1_MJJ-400-NFF-0DPHI22' : 129,
+        'L1_MJJ-400-NFF-0DPHI24' : 133,
+        'L1_MJJ-400-NFF-0DPHI26' : 136,
+        'L1_EM18VHI_MJJ-300' : 385,
+        'L1_LATE-MU10_XE50' : 354,
+        'L1_LATE-MU10_XE40' : 466,
         'L1_LATE-MU10_J50' : 355,
-        'L1_SC111' : 356,
-        'L1_SC85' : 357,
-#SX
-#        'L1_BPH-DR-2MU4-B' : 353,
-#        'L1_BPH-DR-2MU4-BO' : 354,
-#        'L1_BPH-DR-MU6MU4' : 355,
-#        'L1_BPH-DR-MU6MU4-B' : 356,
-#        'L1_BPH-DR-MU6MU4-BO' : 357,
-        'L1_MU6_MJJ-200' : 358,
-        'L1_MU6_MJJ-300' : 359,
-        'L1_MU6_MJJ-400' : 360,
-        'L1_MU6_MJJ-500' : 361,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-400' : 362,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-700' : 363,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-800' : 364,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-900' : 365,
-        'L1_3J20_4J20.0ETA49_MJJ-400' : 366,
-        'L1_3J20_4J20.0ETA49_MJJ-700' : 367,
-        'L1_3J20_4J20.0ETA49_MJJ-800' : 368,
-        'L1_3J20_4J20.0ETA49_MJJ-900' : 369,
-        'L1_XE35_MJJ-200' : 370,
-        'L1_EM7_FIRSTEMPTY': 371, 
-        'L1_RD0_ABORTGAPNOTCALIB':372,
-        'L1_3J25.0ETA23' : 373,
-        'L1_3J35.0ETA23' : 425,
-        'L1_TE20' : 374,
-        'L1_TE10.0ETA24' : 375,
-        'L1_TE15.ETA24' : 416,
-        'L1_TE20.0ETA24' : 376,
-        'L1_TE25.0ETA24' : 409,
-        #'L1_XS40' : 377,
-        #'L1_XS50' : 378,
-        #'L1_XS60' : 379,
-        'L1_J12_BGRP12' : 380,
-        'L1_J30.31ETA49_BGRP12' : 381,
-        'L1_MU6_J30.0ETA49_2J20.0ETA49' : 382,
-        'L1_4J20.0ETA49' : 383,
-        'L1_HT150-JJ15.ETA49_MJJ400' : 384,
-
-        ### ATR-15062
-        'L1_EM18VH_MJJ-300' : 385,
-        
-#ATR-13743        'L1_MU4_J30' : 386,
-#        'L1_MU4_J50' : 387,
-
-        
-        'L1_TAU8_UNPAIRED_ISO': 388,
-        'L1_EM7_UNPAIRED_ISO': 389,
-        'L1_TAU8_UNPAIRED_NONISO': 467,
-        'L1_EM7_UNPAIRED_NONISO': 468,
-        'L1_MU4_UNPAIRED_NONISO' : 469,
-        'L1_RD2_BGRP12'   : 390,
-        'L1_TAU8_FIRSTEMPTY': 391,
-        'L1_EM24VHI'           : 392,
-        'L1_LHCF_UNPAIRED_ISO' : 393,
-        'L1_LHCF_EMPTY' : 394,
-        'L1_EM15VH_2EM10VH_3EM7': 395,
-        'L1_EM15VH_3EM8VH': 396, 
-        'L1_EM8I_MU10'  : 399,
-        "L1_EM26VHI"    :402,
-        "L1_EM15HI"    :423,
-        "L1_EM15I"    :424,
-        "L1_MU6_3MU4"  :403,
-        "L1_2MU6_3MU4" :404,
-        "L1_BGRP9"     :405,
-        #'L1_TE50'       :406,
-        'L1_TE5'       :407,
-        #'L1_TE60'      :408,
-        #'L1_TE50.0ETA24':409,
-        'L1_TE5.0ETA24':410, 
-        'L1_EM20VH_FIRSTEMPTY':411, 
-        'L1_EM22VHI_FIRSTEMPTY':412, 
-        'L1_MU20_FIRSTEMPTY':413, 
-        'L1_J100_FIRSTEMPTY':414, 
-        'L1_J100.31ETA49_FIRSTEMPTY':415, 
-        #'L1_TE60.0ETA24':416, 
-        'L1_TE70.0ETA24':417, 
-        'L1_TE40.0ETA24':418, 
-
-        # 3 x ZDC
-        'L1_ZDC_A':419,
-        'L1_ZDC_C':420,
-        'L1_ZDC_AND':421, 
-        'L1_ZDC_A_C':422, 
-        
-#ATR-13743        'L1_ALFA_ELAST1'  : 424,
-#        'L1_ALFA_ELAST2'  : 425,
-#        'L1_ALFA_ELAST11' : 426,
-#        'L1_ALFA_ELAST12' : 427,
-#        'L1_ALFA_ELAST13' : 428,
-#        'L1_ALFA_ELAST14' : 429,
-#        'L1_ALFA_ELAST15' : 430,
-#        'L1_ALFA_ELAST15_Calib' : 431,
-#        'L1_ALFA_ELAST16' : 432,
-#        'L1_ALFA_ELAST17' : 433,
-#        'L1_ALFA_ELAST18' : 434,
-#        'L1_ALFA_ELAST18_Calib' : 435,
-#        'L1_ALFA_SDIFF5' : 436,
-#        'L1_ALFA_SDIFF6' : 437,
-#        'L1_ALFA_SDIFF7' : 438,
-#        'L1_ALFA_SDIFF8' : 439,
-#        'L1_MBTS_1_A_ALFA_C' : 440,
-#        'L1_MBTS_1_C_ALFA_A' : 441,
-#        'L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO' : 442,
-#        'L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO' : 443,
-#        'L1_MBTS_2_A_ALFA_C' : 444,
-#        'L1_MBTS_2_C_ALFA_A' : 445,
-#        'L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO' : 446,
-#        'L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO' : 447,
-#        'L1_LUCID_A_ALFA_C' : 448,
-#        'L1_LUCID_C_ALFA_A' : 449,
-#        'L1_LUCID_A_ALFA_C_UNPAIRED_ISO' : 450,
-#        'L1_LUCID_C_ALFA_A_UNPAIRED_ISO' : 451,
-#        'L1_EM3_ALFA_ANY' : 452,
-#        'L1_EM3_ALFA_ANY_UNPAIRED_ISO' : 453,
-#        'L1_EM3_ALFA_EINE' :   454,
-#        'L1_ALFA_ELASTIC_UNPAIRED_ISO' : 455,
-#        'L1_ALFA_ANTI_ELASTIC_UNPAIRED_ISO' : 456,
-#        'L1_ALFA_ANY_A_EMPTY' : 457,
-#        'L1_ALFA_ANY_C_EMPTY' : 458,
-#        'L1_J12_ALFA_ANY' : 459,
-#        'L1_J12_ALFA_ANY_UNPAIRED_ISO' : 460,
-#        'L1_TE5_ALFA_ANY' : 461,
-#        'L1_TE5_ALFA_ANY_UNPAIRED_ISO' : 462,
-#        'L1_TE5_ALFA_EINE' : 463,
-#        'L1_TRT_ALFA_ANY' : 464,
-#        'L1_TRT_ALFA_ANY_UNPAIRED_ISO' : 465,
-#        'L1_TRT_ALFA_EINE' :   466,
-##        'L1_LHCF_ALFA_ANY_A' : 467,
-##        'L1_LHCF_ALFA_ANY_C' : 468,
-##        'L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO' : 469,
-##        'L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO' : 470,
-#        
-#        'L1_ALFA_BGT' : 471,
-#        'L1_ALFA_BGT_UNPAIRED_ISO' : 472,
-#        'L1_ALFA_BGT_BGRP10' : 473,
-#        'L1_ALFA_SHOWSYST5' : 474,
-#        'L1_ALFA_SYST9'  : 475,
-#        'L1_ALFA_SYST10' : 476,
-#        'L1_ALFA_SYST11' : 477,
-#        'L1_ALFA_SYST12' : 478,
-#        'L1_ALFA_SYST17' : 479,
-#        'L1_ALFA_SYST18' : 480,
-#        'L1_ALFA_ANY_EMPTY' : 482,
-#        'L1_ALFA_ANY_FIRSTEMPTY' : 483,
-#        'L1_ALFA_ANY_UNPAIRED_ISO' : 484,
-#        'L1_ALFA_ANY_UNPAIRED_NONISO' : 485,
-#        'L1_ALFA_ANY_BGRP10' : 486,
-#        'L1_ALFA_ANY_ABORTGAPNOTCALIB' : 487,
-#        'L1_ALFA_ANY_CALIB' : 488,
-         'L1_ALFA_B7L1U' : 489,
-         # 'L1_ALFA_B7L1L' : 490,
-         'L1_ALFA_ANY'   : 490,
-         'L1_ALFA_A7L1U' : 491,
-         'L1_ALFA_A7L1L' : 492,
-         'L1_ALFA_A7R1U' : 493,
-         'L1_ALFA_A7R1L' : 494,
-         'L1_ALFA_B7R1U' : 495,
-         'L1_ALFA_B7R1L' : 496,
-
-        
-#        'L1_ALFA_B7L1U_OD' : 497,
-#        'L1_ALFA_B7L1L_OD' : 498,
-#        'L1_ALFA_A7L1U_OD' : 499,
-#        'L1_ALFA_A7L1L_OD' : 500,
-#        'L1_ALFA_A7R1U_OD' : 501,
-#        'L1_ALFA_A7R1L_OD' : 502,
-#        'L1_ALFA_B7R1U_OD' : 503,
-#        'L1_ALFA_B7R1L_OD' : 504,
-#        'L1_ALFA_B7L1_OD'  : 505,
-#        'L1_ALFA_A7L1_OD'  : 506,
-#        'L1_ALFA_B7R1_OD'  : 507,
-#        'L1_ALFA_A7R1_OD'  : 508,
-        'L1_CALREQ2' : 511,  # never use 509-511 for anything else than CALREQ triggers
+        'L1_TAU60_DR-TAU20ITAU12I' : 76,
+        'L1_SC111-CJ15' : 356,
+        #'L1_LFV-EM8I-MU11' : 138,
+        #'L1_LFV-EM12I-MU6' : 139,
+        'L1_BPH-0M10-3MU4' : 143,
+        'L1_ZAFB-04DPHI-EM15I' : 152,
+        'L1_ZAFB-25DPHI-EM15I' : 157,
+        #'L1_ZAFB-25DPHI-EM18I' : 158,
+        'L1_DPHI-M70-2EM12I' : 159,
+        #'L1_DY-DR-2MU4' : 315,
+        'L1_DY-BOX-2MU6' : 318,
+        'L1_DY-BOX-2MU4' : 160,
+        'L1_CEP-CJ60' : 162,
+        #'L1_CEP-CJ50' : 164,
+        'L1_MBTS_1_EMPTY' : 164,
+        'L1_BPH-8M15-2MU4-BO' : 165,
+        'L1_CALREQ2' : 511,
+        'L1_ALFA_B7L1U' : 489,
+        'L1_ALFA_ANY'   : 490,
+        'L1_ALFA_A7L1U' : 491,
+        'L1_ALFA_A7L1L' : 492,
+        'L1_ALFA_A7R1U' : 493,
+        'L1_ALFA_A7R1L' : 494,
+        'L1_ALFA_B7R1U' : 495,
+        'L1_ALFA_B7R1L' : 496,
 }
 
 
-- 
GitLab


From dbf551b29813829bb69593990026e98103706bce Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 4 Sep 2020 19:15:36 +0200
Subject: [PATCH 120/422] Fixing suggested issues

---
 .../AFP/Run3AFPMonitoring/CMakeLists.txt      |   4 +-
 .../Run3AFPMonitoring/AFPFastReco.h           |  12 +-
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |   2 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py  |   6 +-
 .../src/AFPSiLayerAlgorithm.cxx               | 131 ++++++------------
 5 files changed, 58 insertions(+), 97 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index e57c24a461cb..5811b24dd26c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -34,8 +34,8 @@ atlas_depends_on_subdirs(
         MuonSpectrometer/MuonAlignment/MuonAlignmentData
         
         Event/EventContainers
-        Tools/PathResolver
-        Control/StoreGate
+        #Tools/PathResolver
+        #Control/StoreGate
 )
 
 # External dependencies:
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
index a77f8e348477..411b81998f88 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
@@ -114,14 +114,18 @@ template <class T> std::vector<T> AFPFastReco::findAround(T init, std::list<T>&
 		for (auto& b : toJoin) 
 		{
 			bool isNew = false;
-        	for (auto& a : element)
-          		if (areNeighbours(a, b)) isNew = true;
+			for (auto& a : element)
+			if (areNeighbours(a, b)) 
+			{
+				isNew = true;
+				break;
+ 			}
 
-        	if (isNew) 
+			if (isNew) 
 			{
 				newNeighbours.push_back(b);
 				element.push_back(b);
-        	}
+			}
 		}
 
 		for (auto& t : newNeighbours)
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 2e5e77654b5d..f88a1b12ed92 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -22,7 +22,7 @@ public:
 	virtual ~AFPSiLayerAlgorithm();
 	virtual StatusCode initialize() override;
 	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
-	
+
 private:
 	std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
 	std::map<std::string,int> m_TrackGroup; 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index e54133cf4edd..32d34d7bae21 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -57,7 +57,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerEvent / <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
+    #array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerEvent / <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
 
 
     array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
@@ -101,7 +101,7 @@ if __name__=='__main__':
     #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00334350.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22327000.EXT0._000001.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00334350.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22327000.EXT0._000002.xAOD.root']
     ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000001.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput52-212k-337371-Aut.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput53-337371-Aut-test.root'
     
     ConfigFlags.lock()
 
@@ -117,6 +117,6 @@ if __name__=='__main__':
     from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
     cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
-    cfg.run()
+    cfg.run(1000)
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index ee313fc04005..097fbad52df3 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -16,16 +16,15 @@
 
 #include <vector>
 
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounter (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounterFront (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounterEnd (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounterMiddle (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
 
-	unsigned int clusterCounter[1000][4][4];
-	unsigned int clusterCounterFront[1000][4][4];
-	unsigned int clusterCounterEnd[1000][4][4];
-	unsigned int clusterCounterMiddle[1000][4][4];
-	
-	unsigned int clusterCounterStation[1000][4];
-	unsigned int clusterCounterStationFront[1000][4];
-	unsigned int clusterCounterStationEnd[1000][4];
-	unsigned int clusterCounterStationMiddle[1000][4];
+	std::vector<std::vector<unsigned int>> clusterCounterStation(1000, std::vector<unsigned int>(4));
+	std::vector<std::vector<unsigned int>> clusterCounterStationFront(1000, std::vector<unsigned int>(4));
+	std::vector<std::vector<unsigned int>> clusterCounterStationEnd(1000, std::vector<unsigned int>(4));
+	std::vector<std::vector<unsigned int>> clusterCounterStationMiddle(1000, std::vector<unsigned int>(4));
 
 	int previouslb = 0;
 	int previouslbFront = 0;
@@ -50,29 +49,39 @@
 	std::vector<int> frontBCIDsVector;
 	std::vector<int> middleBCIDsVector;
 	std::vector<int> endBCIDsVector;
-		
-	bool isInList(int bcid, int* arr)
+	
+	bool isInListVector(const int bcid, const std::vector<int>&arr)
+	{
+		return std::find_if(arr.begin(),arr.end(),[&bcid](const int& ele){return ele==bcid;})!= arr.end();
+	}
+	
+	void fillSynchHistograms(int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, auto &cluster, std::map<std::string,int> &mapa)
 	{
-		int i=0;
-		while(arr[i] != -1)
+		using namespace Monitored;
+		if(lbA > previouslbStationA && previouslbStationA != 0)
 		{
-			if(bcid == arr[i])
+			for(int i = 0; i < 4; i++)
 			{
-				return true;
+				clustersPerStationA = clusterCounterStationA[previouslbStationA][i]*1.0;
+				if(muPerBCIDA != 0)
+				{
+					clustersPerStationA = clustersPerStationA/(muPerBCIDA*counterForEventsStationA*4);
+				}
+				else{clustersPerStationA = -0.1;}
+
+				fill(m_tools[mapa.at(m_stationnames.at(i))], lbA, clustersPerStationA);
 			}
-			i++;
+			previouslbStationA=lbA;
+			++clusterCounterStationA[lbA][cluster.station];
+			counterForEventsStationA=1;
 		}
-		return false;
-	}
-	
-	bool isInListVector(int bcid, std::vector<int> arr)
-	{
-		for(int i=0; i<arr.size(); i++)
+		else if (clusterCounterStationA[lbA][cluster.station] == 0)
 		{
-			if(arr[i] == bcid)
-				return true;
+			++clusterCounterStationA[lbA][cluster.station];
+			previouslbStationA = lbA;
 		}
-		return false;
+		else if (lbA==previouslbStationA)
+		{++clusterCounterStationA[lbA][cluster.station];}
 	}
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
@@ -98,23 +107,8 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
 	ATH_CHECK(m_afpHitContainerKey.initialize());
 	
-	
-	for(int a=0; a<1000; a++)
-	{
-		for(int b=0;b<4;b++)
-		{
-			for(int c=0; c<4; c++)
-			{
-				clusterCounter[a][b][c] = 0;
-			}
-		}
-	}
-	
-
-	// BCX key
-	std::cout << "BunchCrossingKey initialization!...\n\n";
+	ATH_MSG_INFO( "BunchCrossingKey initialization" );
 	ATH_CHECK(m_bunchCrossingKey.initialize());
-	std::cout << "\n\n";
 	ATH_MSG_INFO( "initialization completed" );
 	return AthMonitorAlgorithm::initialize();
 }
@@ -130,11 +124,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	}
 	const BunchCrossingCondData* bcData{*bcidHdl};
 
-	if(!bcData->isFilled(temp))
-	{
-		std::cout << "\nNOT Filled: " << temp << std::endl;
-	}
-
 	// Classifying bunches by position in train (Front, Middle, End)
 	if(bcData->isFilled(temp))
 	{
@@ -160,16 +149,12 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			}
 		}
 	}
-
-	static unsigned int numberOfClusterStationPlane[4][4] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} };
-	//static unsigned int lumiBlocks[100];
 	
 	// Declare the quantities which should be monitored:
 	auto lb = Monitored::Scalar<int>("lb", 0);
 	auto muPerBCID = Monitored::Scalar<float>("muPerBCID", 0.0);
 	auto run = Monitored::Scalar<int>("run",0);
 	auto weight = Monitored::Scalar<float>("weight", 1.0);
-	//auto previouslb = Monitored::Scalar<int>("previouslb", 0);
 
 	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
 	auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 1.0);
@@ -204,10 +189,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	fill("AFPSiLayerTool", lb, muPerBCID);
 	
 
-	++counterForEvents;		// Counter for the all BCIDs
+	++counterForEvents;		
 	++counterForEventsStation;
-
-	int tempbcid = GetEventInfo(ctx)->bcid();
 	
 	SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
 	if(! afpHitContainer.isValid())
@@ -253,34 +236,13 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	}
 
 // Clusters:
-// Old approach
-	for(int i = 0; i < 4; i++)
-	{
-		for(int j = 0; j < 4; j++)
-		{
-			clustersPerPlane2 = numberOfClusterStationPlane[i][j]*1.0;
-			if(muPerBCID != 0)
-			{
-				clustersPerPlane2 /= (muPerBCID*counterForEvents);
-			}
-			else
-			{
-				clustersPerPlane2 = -0.1;
-			}
-			//std::cout <<"\t"<< clustersPerPlane2 << std::endl;
-			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane2);
-		}
-	}
 
-// New approach:
 	for(const auto& cluster : fast.clusters()) 
 	{
 		clusterX = cluster.x;
 		clusterY = cluster.y;
-		fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX); // Swap after suggestion
-		
+		fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX); 
 		lb = GetEventInfo(ctx)->lumiBlock();
-		++numberOfClusterStationPlane[cluster.station][cluster.layer];
 		
 		// Time for fill - current and previous lb are different, and the previouslb is not -1 (it means - this is not the first lb)
 		if(lb > previouslb && previouslb != 0)
@@ -304,15 +266,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 				
 			previouslb = lb;
 			++clusterCounter[lb][cluster.station][cluster.layer];
-			counterForEvents=1;
-			
-			for(int i=0; i<4; i++)
-			{
-				for(int j=0; j<4; j++)
-				{
-					numberOfClusterStationPlane[i][j] = 0;
-				}
-			}
+			counterForEvents = 1;
 		}
 			
 			// First time in lumiblock (in plane)
@@ -333,7 +287,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	// =============== Stations all BCIDs ===============
 	for(const auto& cluster : fast.clusters()) 
 	{
+		
 		lb = GetEventInfo(ctx)->lumiBlock();
+		/*
 		if(lb > previouslbStation && previouslbStation != 0)
 		{
 			for(int i=0; i<4; i++)
@@ -356,6 +312,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		}
 		else if (lb==previouslbStation)
 		{++clusterCounterStation[lb][cluster.station];}
+		*/
+		fillSynchHistograms(lb, previouslbStation, clustersPerStation, clusterCounterStation, counterForEventsStation, muPerBCID, cluster, m_TrackGroup);
+		
 	}
 	// ========== Front Station ==========
 	if(isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
@@ -467,7 +426,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			// Time for fill - current and previous lb are different, and the previouslbFront is not -1 (it means - this is not the first lb)
 			if(lb > previouslbFront && previouslbFront != 0)
 			{
-				//std::cout << "\tlb!=previouslbFront" << std::endl;
 				for(int i=0; i<4; i++)
 				{
 					for(int j=0; j<4; j++)
@@ -513,7 +471,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			// Time for fill - current and previous lb are different, and the previouslbEnd is not -1 (it means - this is not the first lb)
 			if(lb > previouslbEnd && previouslbEnd != 0)
 			{
-				//std::cout << "\tlb!=previouslbEnd" << std::endl;
 				for(int i=0; i<4; i++)
 				{
 					for(int j=0; j<4; j++)
@@ -583,7 +540,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			// First time in lumiblock (in plane)
 			else if(clusterCounterMiddle[lb][cluster.station][cluster.layer] == 0) 
 			{
-				++clusterCounterMiddle[lb][cluster.station][cluster.layer];				
+				++clusterCounterMiddle[lb][cluster.station][cluster.layer];
 				previouslbMiddle = lb;
 			}
 			
-- 
GitLab


From 905db8b0cc30ea858b03e81253280c082661d8ca Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Mon, 7 Sep 2020 16:58:29 +0200
Subject: [PATCH 121/422] trying to fix this q431 by tweaking configs

---
 Event/xAOD/xAODPFlow/xAODPFlow/selection.xml         |  2 +-
 .../xAODPFlow/versions/FlowElementContainer_v1.h     |  3 ++-
 Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h       | 12 ++++++------
 .../eflowRec/eflowRec/PFEGamFlowElementAssoc.h       |  4 ++--
 .../eflowRec/src/PFEGamFlowElementAssoc.cxx          |  4 ++--
 .../eflowRec/src/components/eflowRec_entries.cxx     |  2 +-
 6 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
index 25336c37b364..9d6852e19a20 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
@@ -48,7 +48,7 @@
    <class name="std::vector<std::pair<ElementLink<xAOD::CaloClusterContainer_v1>,double> >" />
    <class name="std::vector<std::vector<std::pair<ElementLink<xAOD::CaloClusterContainer_v1>,double> > >" />
    <class name="std::vector<xAOD::PFODetails::PFOLeptonType>" />
-   <class name="std::vector<std::vector<std::pair<ElementLink<xAOD::FlowElementContainer_v1>, double> > >" /> 
+   <class name="std::vector<std::vector<ElementLink<xAOD::FlowElementContainer_v1> > > " /> 
    
 
 </lcgdict>
diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h b/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h
index 162551e7a791..b670f65b7d70 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h
@@ -13,7 +13,8 @@
 
 // Local include(s):
 #include "xAODPFlow/versions/FlowElement_v1.h"
-
+// initialise the base class of the FlowElementContainer as an IParticle
+DATAVECTOR_BASE(xAOD::FlowElement_v1, xAOD::IParticle);
 namespace xAOD {
    /// The container is a simple typedef for now
    typedef DataVector< xAOD::FlowElement_v1 > FlowElementContainer_v1;
diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h b/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
index b5b4191943a2..0c335ee97b97 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
@@ -43,12 +43,12 @@ namespace {
      XAOD_INSTANTIATE_NS_CONTAINER_TYPES( xAOD, IParticleContainer );
      // Weird/bad types used by the PFO reconstruction as attributes on
      // xAOD::PFO objects. :-(
-     std::pair< ElementLink< xAOD::CaloClusterContainer >, double > dummy1;
-     std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > > dummy2;
-     std::vector< std::vector<ElementLink<xAOD::FlowElementContainer_v1>, double >> dummy3; // fixes issues in eflowRec
-     std::vector< std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > >  > dummy4;
-     std::vector< xAOD::PFODetails::PFOLeptonType > dummy5;
-
+     std::pair< ElementLink< xAOD::CaloClusterContainer >, double > FlowElemdummy1;
+     std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > > FlowElemdummy2;
+     std::vector< std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > > > FlowElemdummy3;
+     std::vector< xAOD::PFODetails::PFOLeptonType > FlowElemdummy4;
+     std::vector< std::vector<ElementLink<xAOD::FlowElementContainer_v1> > > FlowElemdummy5; // fixes issues in eflowRec
+     
 
    };
 }
diff --git a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
index 4845a217febd..fd01a3d93d91 100644
--- a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
+++ b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
@@ -7,7 +7,7 @@
  * Header file for class PFEGamFlowElementAssoc
  *                                                                                                                                                                                     
  *  Created on: 13.03.19                                                                                                                                                            
- *      Author: J. C. MacDonald                                                                                                                                                      
+ *      Author: J. C. MacDonald & Upgraded by M.T. Anthony                                                                                                                                                      
  */
 
 #ifndef PFEGAMFLOWELEMENTASSOC_H
@@ -19,7 +19,7 @@
 
 #include "StoreGate/WriteDecorHandle.h"
 // this should be obsolete, but keeping atm to avoid crashes
-#include "xAODPFlow/PFOContainer.h" // old EDM
+//#include "xAODPFlow/PFOContainer.h" // old EDM
 #include "xAODPFlow/FlowElementContainer.h" // Container to replace it
 /**                                                                                                                                                                                     
 This is the algorithm, which inherits from AthAlgorithm, that adds element links 
diff --git a/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
index 3baf5c053301..f0460975fc67 100644
--- a/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
+++ b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
@@ -10,8 +10,8 @@
 #include "xAODEgamma/ElectronxAODHelpers.h"
 #include "xAODEgamma/EgammaxAODHelpers.h" 
 // keep these for the moment, although we expect to NOT need them
-#include "xAODPFlow/PFOContainer.h" 
-#include "xAODPFlow/PFO.h" 
+//#include "xAODPFlow/PFOContainer.h" 
+//#include "xAODPFlow/PFO.h" 
 // this is the new EDM to replace the above
 #include "xAODPFlow/FlowElementContainer.h"
 #include "xAODPFlow/FlowElement.h"
diff --git a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
index 0f8d8a1b5381..f0ad355de1ce 100644
--- a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
+++ b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
@@ -25,7 +25,6 @@
 DECLARE_COMPONENT( eflowOverlapRemoval )
 DECLARE_COMPONENT( PFLeptonSelector )
 DECLARE_COMPONENT( PFEGammaPFOAssoc )
-DECLARE_COMPONENT( PFEGamFlowElementAssoc )
 DECLARE_COMPONENT( PFClusterSelectorTool )
 DECLARE_COMPONENT( PFTrackSelector )
 DECLARE_COMPONENT( PFAlgorithm )
@@ -45,3 +44,4 @@ DECLARE_COMPONENT( PFTrackClusterMatchingTool )
 DECLARE_COMPONENT( eflowCellEOverPTool_mc12_JetETMiss)
 DECLARE_COMPONENT(  eflowCellEOverPTool_mc12_HLLHC)
 DECLARE_COMPONENT( eflowCellEOverPTool_mc12_LC)
+DECLARE_COMPONENT( PFEGamFlowElementAssoc )
-- 
GitLab


From 275f058069932bdb053a0a43485f9884034974a2 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Tue, 8 Sep 2020 17:06:00 +0200
Subject: [PATCH 122/422] temp commit with more tweaks

---
 Reconstruction/eflowRec/share/PFlowMTConfig.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Reconstruction/eflowRec/share/PFlowMTConfig.py b/Reconstruction/eflowRec/share/PFlowMTConfig.py
index 8fc0211ac214..6c9547942cb9 100644
--- a/Reconstruction/eflowRec/share/PFlowMTConfig.py
+++ b/Reconstruction/eflowRec/share/PFlowMTConfig.py
@@ -246,7 +246,7 @@ topSequence += PFONeutralCreatorAlgorithm
 from eflowRec.eflowRecFlags import jobproperties # set reco flags for eFlowRec algorithms
 jobproperties.eflowRecFlags.usePFEGammaPFOAssoc.set_Value_and_Lock(True)
 jobproperties.eflowRecFlags.useFlowElements.set_Value_and_Lock(True)
-
+print("CONFIG_FLOW_ALG_AND_PFEGAMASSOC")
 if jobproperties.eflowRecFlags.usePFEGammaPFOAssoc:
    
    from eflowRec.eflowRecConf import PFEGammaPFOAssoc
@@ -254,7 +254,7 @@ if jobproperties.eflowRecFlags.usePFEGammaPFOAssoc:
    topSequence += PFEGammaPFOAssoc
 
 #Add new FlowElement creators
-if jobproperties.eflowRecFlags.useFlowElements: 
+if jobproperties.eflowRecFlags.useFlowElements or True: 
   from eflowRec.eflowRecConf import PFChargedFlowElementCreatorAlgorithm
   PFChargedFlowElementCreatorAlgorithm = PFChargedFlowElementCreatorAlgorithm("PFChargedFlowElementCreatorAlgorithm")
   topSequence += PFChargedFlowElementCreatorAlgorithm 
@@ -267,6 +267,7 @@ if jobproperties.eflowRecFlags.useFlowElements:
   PFLCNeutralFlowElementCreatorAlgorithm = PFLCNeutralFlowElementCreatorAlgorithm("PFLCNeutralFlowElementCreatorAlgorithm")
   topSequence += PFLCNeutralFlowElementCreatorAlgorithm 
 
+  print("MATTFLOWALG")
   from eflowRec.eflowRecConf import PFEGamFlowElementAssoc
   PFEGamFlowElementAssoc=PFEGamFlowElementAssoc("PFEGamFlowElementAssoc")
   topSequence +=PFEGamFlowElementAssoc
-- 
GitLab


From 4480a8bc2b70571144eaae63713f79b8ee978307 Mon Sep 17 00:00:00 2001
From: Jannik Geisen <jannik.geisen@cern.ch>
Date: Wed, 9 Sep 2020 12:42:07 +0200
Subject: [PATCH 123/422] Monitor only passing jets for trigger chains,
 changing+adding histograms to monitoring config

---
 .../JetMonitoring/JetMonitoringAlg.h          |  1 +
 .../python/JetStandardHistoSpecs.py           | 46 +++++++++++-------
 .../JetMonitoring/src/JetMonitoringAlg.cxx    | 31 ++++++++++--
 .../Jet/JetMonitoring/src/NumJetVarTool.cxx   |  2 +-
 .../python/TrigJetMonitorAlgorithm.py         | 47 +++++++++++++++----
 5 files changed, 95 insertions(+), 32 deletions(-)

diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
index bab697afa22e..edb66f08da98 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
@@ -39,6 +39,7 @@ private:
   ToolHandleArray<IJetHistoFiller> m_jetFillerTools;
 
   bool m_failureOnMissingContainer;
+  Gaudi::Property<std::string> m_triggerChain {this,"TriggerChain", ""};
   
 };
 #endif
diff --git a/Reconstruction/Jet/JetMonitoring/python/JetStandardHistoSpecs.py b/Reconstruction/Jet/JetMonitoring/python/JetStandardHistoSpecs.py
index 9f9702635b91..59b2cbcafb19 100644
--- a/Reconstruction/Jet/JetMonitoring/python/JetStandardHistoSpecs.py
+++ b/Reconstruction/Jet/JetMonitoring/python/JetStandardHistoSpecs.py
@@ -32,7 +32,15 @@ knownEventVar = dict(
     njetsPt50 = ToolSpec('NumJetVarTool', 'njetsPt50', PtCut=50.),
     njetsEt20 = ToolSpec('NumJetVarTool', 'njetsEt20', EtCut=20.),
     njetsEt50 = ToolSpec('NumJetVarTool', 'njetsEt50', EtCut=50.),
-    njetsEt40Eta1_2 = ToolSpec('NumJetVarTool', 'njetsEt40Eta1_2', EtCut=50., EtaMin=1., EtaMax=2.),
+    njetsEt20Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt20Eta0_32', EtCut=20., EtaMin=0., EtaMax=3.2),
+    njetsEt50Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt50Eta0_32', EtCut=50., EtaMin=0., EtaMax=3.2),
+    njetsEt70Eta0_24 = ToolSpec('NumJetVarTool', 'njetsEt70Eta0_24', EtCut=70., EtaMin=0., EtaMax=2.4),
+    njetsEt60Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt60Eta0_32', EtCut=60., EtaMin=0., EtaMax=3.2),
+    njetsEt100Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt100Eta0_32', EtCut=100., EtaMin=0., EtaMax=3.2),
+    njetsEt260Eta32_49 = ToolSpec('NumJetVarTool', 'njetsEt260Eta32_49', EtCut=260., EtaMin=3.2, EtaMax=4.9),
+    njetsEt200Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt200Eta0_32', EtCut=200., EtaMin=0., EtaMax=3.2),
+    njetsEt330Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt330Eta0_32', EtCut=330., EtaMin=0., EtaMax=3.2),
+
 )
 
 # ***************************************
@@ -50,9 +58,9 @@ _knownHistos = [
     HistoSpec( 'eta',  (50,-5,5) , title='#eta;#eta;Entries'),
     HistoSpec( 'phi',  (50,-3.3,3.3) , title='#phi;#phi;Entries'),
     # Same but we indicate that the variable is to be plotted in GeV by appending ':GeV'
-    HistoSpec( 'pt:GeV',  (100,0,200) , title='p_{T};p_{T} [GeV];'),    
+    HistoSpec( 'pt:GeV',  (100,0,750) , title='p_{T};p_{T} [GeV];'),    
     HistoSpec( 'm:GeV',  (100,0,300) , title='mass;mass [GeV];'),
-    HistoSpec( 'e:GeV',  (100,0,500) , title='E;E [GeV];'),    
+    HistoSpec( 'e:GeV',  (100,0,750) , title='E;E [GeV];'),    
     HistoSpec( 'et:GeV', (100,0,750), title='E_{T};E_{T} [GeV],'),
 
     # We want an other pT histo, with different bins.
@@ -61,22 +69,22 @@ _knownHistos = [
 
     #EventHistoSpec( 'njets', (30,0,30), title='Jet Multiplicity;Njets;Entries' ),
     # When the jet variable is not a simple float, use the xvar argument to refer to a detailed variable spec in 'knownVar'
-    HistoSpec( 'JVF',  (100,0,1.2) , title='Jet Vtx Frac;JVF;', xvar='JVF'),    
+    HistoSpec( 'JVF',  (100,0,1.2) , title='Jet Vtx Frac;JVF;Entries', xvar='JVF'),    
     # if the var name contains '[N]' the system will assume the variable is a vector<float> and setup tools accordingly (so we don't need to specify 'xvar')
-    HistoSpec( 'JVF[0]',  (100,0,1.2) , title='JVF for vtx 0;JVF[0];', ), 
-    HistoSpec( 'JVF[1]',  (100,0,1.2) , title='JVF for vtx 1;JVF[1];', ),
+    HistoSpec( 'JVF[0]',  (100,0,1.2) , title='JVF for vtx 0;JVF[0];Entries', ), 
+    HistoSpec( 'JVF[1]',  (100,0,1.2) , title='JVF for vtx 1;JVF[1];Entries', ),
 
 
     # full list
     HistoSpec('ptN', (250, 0.0, 5000.0), title='Jet Pt;Pt [GeV];', xvar='pt:GeV'),
 
-    HistoSpec('EMFrac', (50, -0.1, 1.4), title='EM Fraction;EM fraction;', ),
-    HistoSpec('LArQuality', (50, -0.4, 1.2), title='LAr quality;Energy;', ),
-    HistoSpec('HECQuality', (50, -0.1, 1.4), title='HEC Quality;HEC Quality;', ),
-    HistoSpec('HECFrac', (50, -0.1, 1.4), title='HEC Fraction;HEC fraction;', ),
-    HistoSpec('AverageLArQF', (100, 0, 65535), title='Average LAr QF;AverageLArQF;', ),
-    HistoSpec('FracSamplingMaxIndex', (24, 0, 24), title='FracSamplingMaxIndex; FracSamplingMaxIndex;', xvar=VarSpec('FracSamplingMaxIndex','int')),
-    HistoSpec('FracSamplingMax', (50, -0.1, 1.2), title='FracSamplingMax; FracSamplingMax;', ),
+    HistoSpec('EMFrac', (50, -0.1, 1.4), title='EM Fraction;EM Fraction;Entries', ),
+    HistoSpec('LArQuality', (50, -0.4, 1.2), title='LAr quality;Energy;Entries', ),
+    HistoSpec('HECQuality', (50, -0.1, 1.4), title='HEC Quality;HEC Quality;Entries', ),
+    HistoSpec('HECFrac', (50, -0.1, 1.4), title='HEC Fraction;HEC Fraction;Entries', ),
+    HistoSpec('AverageLArQF', (100, 0, 65535), title='Average LAr QF;AverageLArQF;Entries', ),
+    HistoSpec('FracSamplingMaxIndex', (24, 0, 24), title='FracSamplingMaxIndex; FracSamplingMaxIndex;Entries', xvar=VarSpec('FracSamplingMaxIndex','int')),
+    HistoSpec('FracSamplingMax', (50, -0.1, 1.2), title='FracSamplingMax; FracSamplingMax;Entries', ),
     HistoSpec('Timing', (40, -20, 20), title='Jet Time info;Time;', ),
 
     
@@ -85,9 +93,9 @@ _knownHistos = [
     HistoSpec('OotFracClusters5', (50, -0.1, 1.2), title='OotFracClusters5; OotFracClusters5;', ),
     HistoSpec('OotFracClusters10', (50, -0.1, 1.2), title='OotFracClusters10; OotFracClusters10;', ),
     
-    HistoSpec('Jvt', (70, -0.2, 1.2), title='Jet JVT;JVT;',  ),
-    HistoSpec('JVFCorr', (120, -1.2, 1.2), title='Jet JVT; JVFCorr;', ),
-    HistoSpec('JvtRpt', (75, 0, 1.5), title='Jet JVT Rpt; JVTRpt;', ),
+    HistoSpec('Jvt', (70, -0.2, 1.2), title='Jet JVT;JVT;Entries',  ),
+    HistoSpec('JVFCorr', (120, -1.2, 1.2), title='Jet JVT; JVFCorr;Entries', ),
+    HistoSpec('JvtRpt', (75, 0, 1.5), title='Jet JVT Rpt; JVTRpt;Entries', ),
     HistoSpec('EM3Frac', (50,-0.1,1.0), title="EM3 fraction;EM3 fraction;Entries"),
     HistoSpec('Tile0Frac', (50,-0.1,1.0), title="Tile0 fraction;Tile0 fraction;Entries"),
 
@@ -178,8 +186,9 @@ _knownHistos = [
 
     HistoSpec('Charge', (100, -2, 2), title='Charge;Charge;', ),
 
-    HistoSpec('ActiveArea', (80, 0, 0.8), title='Active Area;Area;', ),
-    HistoSpec('ActiveArea15', (80, 0, 1.5), title='Active Area;Area;', xvar='ActiveArea'),
+    HistoSpec('DetectorEta', (100,-5,5), title="DetectorEta;Detector #eta;Entries" ), 
+    HistoSpec('ActiveArea', (80,0,0.8), title="ActiveArea;Active Area;Entries" ), 
+    HistoSpec('ActiveArea15', (80, 0, 1.5), title='Active Area;Active Area;Entries', xvar='ActiveArea'),
 
     HistoSpec('PullPhi', (100, -6.3, 6.3), title='PullPhi;PullPhi;', ),
     HistoSpec('PullMag', (100, 0, 100), title='PullMag;PullMag;', ),
@@ -300,3 +309,4 @@ for h in _knownHistos:
 knownSelector = dict(
     LooseBad = ToolSpec('JetCleaningTool' ,  "LooseBadJets" , CutLevel = "LooseBad")
 )
+
diff --git a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
index f46b43c07699..f50a7fedf01d 100644
--- a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
+++ b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
@@ -11,7 +11,6 @@ JetMonitoringAlg::JetMonitoringAlg( const std::string& name, ISvcLocator* pSvcLo
 :AthMonitorAlgorithm(name,pSvcLocator)
 ,m_jetContainerKey("AntiKt4LCTopoJets"), m_jetFillerTools(this), m_failureOnMissingContainer(true)
 {
-
     declareProperty("JetContainerName",m_jetContainerKey);
     declareProperty("FillerTools", m_jetFillerTools);
     declareProperty("FailureOnMissingContainer", m_failureOnMissingContainer);
@@ -28,7 +27,7 @@ StatusCode JetMonitoringAlg::initialize() {
   ATH_CHECK( m_jetFillerTools.retrieve() );
 
   // print out what we have 
-  ATH_MSG_INFO( " Scheduled Histo fillers/selectors : ");
+  ATH_MSG_INFO( "Scheduled Histo fillers/selectors : ");
   for(const auto& t: m_jetFillerTools){
     ATH_MSG_INFO( "--> "<< t->name() );
   }
@@ -40,6 +39,30 @@ StatusCode JetMonitoringAlg::initialize() {
 
 StatusCode JetMonitoringAlg::fillHistograms( const EventContext& ctx ) const {
 
+  if (isPassed(m_triggerChain)) { //trigger was fired - retrieve only jets passing the chain
+    ATH_MSG_DEBUG("JetMonitoringAlg::fillHistograms(const EventContext&) -> if (isPassed("<<m_triggerChain<<")) was passed!");
+   
+    ConstDataVector< xAOD::JetContainer > tmpCont(SG::VIEW_ELEMENTS);
+    const std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > fc = getTrigDecisionTool()->features<xAOD::JetContainer>( m_triggerChain );
+    for(const auto& jetLinkInfo : fc) {
+      if (!jetLinkInfo.isValid()) {
+        ATH_MSG_ERROR("Invalid ElementLink to online jet");
+        continue;
+      }
+      ElementLink<xAOD::JetContainer> j = jetLinkInfo.link;
+      const xAOD::Jet *trigjet = dynamic_cast<const xAOD::Jet*>(*j);
+      tmpCont.push_back( trigjet );
+    }
+    const xAOD::JetContainer * trigJetsCont = tmpCont.asDataVector();
+    if (trigJetsCont->empty()) {
+      ATH_MSG_WARNING("Empty trigger jet container for chain "<<m_triggerChain);
+      return StatusCode::SUCCESS;
+    }
+    for(const auto& t: m_jetFillerTools){
+      ATH_MSG_DEBUG( " now run "<< t->name() );
+      ATH_CHECK( t->processJetContainer(*this, *trigJetsCont, ctx) );
+    }
+  } else {
   // retrieve the jet container
   SG::ReadHandle<xAOD::JetContainer> jets(m_jetContainerKey, ctx);    
   if (! jets.isValid() ) {
@@ -51,13 +74,13 @@ StatusCode JetMonitoringAlg::fillHistograms( const EventContext& ctx ) const {
       return StatusCode::SUCCESS;
     }
   }
-
+ 
   // call each histograming tool on the container
   for(const auto& t: m_jetFillerTools){
     ATH_MSG_DEBUG( " now run "<< t->name() );
     ATH_CHECK( t->processJetContainer(*this, *jets, ctx) );
   }
-  
+ }
   return StatusCode::SUCCESS;
 }
 
diff --git a/Reconstruction/Jet/JetMonitoring/src/NumJetVarTool.cxx b/Reconstruction/Jet/JetMonitoring/src/NumJetVarTool.cxx
index 86d189d2c3bb..a586839c7aaa 100644
--- a/Reconstruction/Jet/JetMonitoring/src/NumJetVarTool.cxx
+++ b/Reconstruction/Jet/JetMonitoring/src/NumJetVarTool.cxx
@@ -30,7 +30,7 @@ float NumJetVarTool::value(const xAOD::EventInfo & /*eventinfo not used in this
       ATH_MSG_ERROR("Input JetContainer could not be found or is empty");
       return 0.;
     } else {
-      ATH_MSG_WARNING("Input JetContainer could not be found or is empty");
+      ATH_MSG_DEBUG("Input JetContainer could not be found or is empty");
       return 0.;
     }
   }
diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
index 771577e14d30..f612024b8672 100644
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
@@ -92,9 +92,9 @@ from JetMonitoring.JetMonitoringConfig import JetMonAlgSpec, HistoSpec, EventHis
 
 # All offline jet collections
 ExtraOfflineHists = [
-  HistoSpec('HECFrac', (50,0,1), title="HECFrac;HEC fraction;Entries" ),
-  HistoSpec('EMFrac', (50,0,1), title="EMFrac;EM fraction;Entries" ),
-  HistoSpec('Jvt', (50,-0.1,1), title="JVT;JVT;Entries" ),
+  "EMFrac",
+  "HECFrac",
+  "Jvt",
   "JVFCorr",
   "JvtRpt",
   "NumTrkPt1000[0]",
@@ -105,11 +105,11 @@ ExtraOfflineHists = [
 
 # All online small-R jet collections
 ExtraSmallROnlineHists = [
-  HistoSpec('HECFrac', (50,0,1), title="HECFrac;HEC fraction;Entries" ),
-  HistoSpec('EMFrac', (50,0,1), title="EMFrac;EM fraction;Entries" ),
-  HistoSpec('DetectorEta', (100,-5,5), title="DetectorEta;Detector #eta;Entries" ), 
-  HistoSpec('ActiveArea', (80,0,0.8), title="ActiveArea;Active Area;Entries" ), 
   HistoSpec('et:GeV;eta',  (100,0,750, 50,-5,5) , title='#eta vs E_{T};E_{T} [GeV];#eta;Entries'),
+  "EMFrac",
+  "HECFrac",
+  "DetectorEta",
+  "ActiveArea", 
   "EM3Frac",
   "Tile0Frac",
 ]
@@ -223,7 +223,9 @@ def basicJetMonAlgSpec(jetcoll,isOnline,athenaMT):
     SelectSpec( 'lowmu', 'avgMu<30', path, isEventVariable=True, FillerTools = ["pt","et","m","phi","eta"]),
     SelectSpec( 'highmu', '30<avgMu', path, isEventVariable=True, FillerTools = ["pt","et","m","phi","eta"]),
 
-    EventHistoSpec('njetsPt20', (20,0,20), title='NJetsPt20;NJetsPt20;Entries' ),
+    EventHistoSpec('njets', (25,0,25), title='NJets;NJets;Entries' ),
+    EventHistoSpec('njetsPt20', (25,0,25), title='NJetsPt20;NJetsPt20;Entries' ),
+    EventHistoSpec('njetsPt50', (25,0,25), title='NJetsPt50;NJetsPt50;Entries' ),
     # Jet multiplicity histograms can be added by using an EventHistoSpec
     # Their specifications (pT cut, ET cut, eta cuts) must be defined in the knownEventVar dictionary within JetStandardHistoSpecs.py
     # The following line is an example for a jet multiplicity histogram with ET>40 GeV, 1.0<|eta|<2.0, and binning of (10,0,10):
@@ -329,6 +331,10 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT):
            "eta",
            "et",
            "phi",
+           EventHistoSpec('njets', (25,0,25), title='njets;njets;Entries' ),
+           EventHistoSpec('njetsEt20Eta0_32', (25,0,25), title='njetsEt20Eta0_32;njetsEt20Eta0_32;Entries' ),
+           EventHistoSpec('njetsEt50Eta0_32', (25,0,25), title='njetsEt50Eta0_32;njetsEt50Eta0_32;Entries' ),
+           EventHistoSpec('njetsEt100Eta0_32', (25,0,25), title='njetsEt100Eta0_32;njetsEt100Eta0_32;Entries' ),
            # we pass directly the ToolSpec
            ToolSpec('JetHistoTriggEfficiency', chain,
                     # below we pass the Properties of this JetHistoTriggEfficiency tool :
@@ -337,7 +343,30 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT):
                                                    # so we use retrieveVarToolConf("pt") which returns a full specification for the "pt" histo variable.
                     ProbeTrigChain=chain,defineHistoFunc=defineHistoForJetTrigg),
    )
-
+   if 'j460' in chain:
+     trigConf.appendHistos(
+       SelectSpec( 'highEt', '460<et:GeV', chainFolder, FillerTools = ["m"] ),
+     )
+   if '2j330' in chain:
+     trigConf.appendHistos(
+       EventHistoSpec('njetsEt330Eta0_32', (25,0,25), title='njetsEt330Eta0_32;njetsEt330Eta0_32;Entries' ),
+     )
+   elif '5j70' in chain:
+     trigConf.appendHistos(
+       EventHistoSpec('njetsEt70Eta0_24', (25,0,25), title='njetsEt70Eta0_24;njetsEt70Eta0_24;Entries' ),
+     )
+   elif '3j200' in chain:
+     trigConf.appendHistos(
+       EventHistoSpec('njetsEt200Eta0_32', (25,0,25), title='njetsEt200Eta0_32;njetsEt200Eta0_32;Entries' ),
+     )
+   elif 'j80_j60' in chain:
+     trigConf.appendHistos(
+       EventHistoSpec('njetsEt60Eta0_32', (25,0,25), title='njetsEt60Eta0_32;njetsEt60Eta0_32;Entries' ),
+     )
+   elif 'j260_320eta490' in chain:
+     trigConf.appendHistos(
+       EventHistoSpec('njetsEt260Eta32_49', (25,0,25), title='njetsEt260Eta32_49;njetsEt260Eta32_49;Entries' ),
+     )
    if 'smc' in chain:
      trigConf.appendHistos(
              SelectSpec( 'm50', '50<m', chainFolder, FillerTools = [
-- 
GitLab


From f3a248710e375b6730e870200cab9b74ca7a7f8e Mon Sep 17 00:00:00 2001
From: Nora Emilia Pettersson <npetters@lxplus780.cern.ch>
Date: Wed, 9 Sep 2020 22:30:31 +0200
Subject: [PATCH 124/422] Add potential fix to prd association bug
 ATLIDTRKCP-274

---
 .../src/SiCombinatorialTrackFinder_xk.cxx              | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx
index aa95b7edc00c..75e10775baa5 100644
--- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx
+++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx
@@ -283,7 +283,15 @@ void InDet::SiCombinatorialTrackFinder_xk::newEvent(const EventContext& ctx, SiC
 void InDet::SiCombinatorialTrackFinder_xk::newEvent
 (const EventContext& ctx, SiCombinatorialTrackFinderData_xk& data, Trk::TrackInfo info, const TrackQualityCuts& Cuts) const
 {
-  if (not data.isInitialized()) initializeCombinatorialData(ctx, data);
+  
+  if (not data.isInitialized()) {
+    //Check if to use PRDAssociation before initializing all the tools
+    int useasso;
+    if(!Cuts.getIntCut   ("UseAssociationTool"  ,useasso      )) useasso = 0;
+    data.tools().setAssociation(useasso);
+
+    initializeCombinatorialData(ctx, data);
+  }
 
   newEvent(ctx, data);
   data.trackinfo() = info;
-- 
GitLab


From 1ca416c789531961aec57aa5604801ae1fd0e8c4 Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Wed, 9 Sep 2020 23:00:19 -0700
Subject: [PATCH 125/422] First commit of neural net TTVA tool

---
 .../TrackVertexAssociationTool/CMakeLists.txt |   4 +-
 .../Root/MVAInputEvaluator.cxx                | 455 ++++++++++++++++++
 .../Root/MVATrackVertexAssociationTool.cxx    | 284 +++++++++++
 .../MVAInputEvaluator.h                       |  77 +++
 .../MVATrackVertexAssociationTool.h           | 116 +++++
 .../TrackVertexAssociationToolDict.h          |   1 +
 .../TrackVertexAssociationTool/selection.xml  |   1 +
 .../TrackVertexAssociationTool_entries.cxx    |   2 +
 8 files changed, 939 insertions(+), 1 deletion(-)
 create mode 100644 InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
 create mode 100644 InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
 create mode 100644 InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVAInputEvaluator.h
 create mode 100644 InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
index d610f999664d..e4dc2954c396 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
@@ -29,13 +29,15 @@ atlas_depends_on_subdirs(
 
 # External dependencies:
 find_package( ROOT COMPONENTS Core Hist RIO )
+find_package( lwtnn REQUIRED )
 
 # Libraries in the package:
 atlas_add_library( TrackVertexAssociationToolLib
    Root/*.cxx
    PUBLIC_HEADERS TrackVertexAssociationTool
+   PRIVATE_INCLUDE_DIRS ${LWTNN_INCLUDE_DIRS}
    LINK_LIBRARIES AthContainers AthLinks AsgTools xAODCore xAODTracking AsgDataHandlesLib
-   PRIVATE_LINK_LIBRARIES xAODEventInfo )
+   PRIVATE_LINK_LIBRARIES xAODEventInfo ${LWTNN_LIBRARIES} )
 
 if( NOT XAOD_STANDALONE )
    atlas_add_component( TrackVertexAssociationTool
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
new file mode 100644
index 000000000000..063ed86dff92
--- /dev/null
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
@@ -0,0 +1,455 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrackVertexAssociationTool/MVAInputEvaluator.h"
+
+#include "AthLinks/ElementLink.h"
+
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODTracking/TrackParticlexAODHelpers.h"
+#include "xAODTracking/Vertex.h"
+
+#include <cmath>
+#include <stdexcept>
+#include <vector>
+
+// Private
+namespace {
+
+using MiniEvaluator = CP::MVAInputEvaluator::MiniEvaluator;
+
+class Pt: public MiniEvaluator {
+public:
+  Pt() {};
+  ~Pt() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.pt();
+  }
+};
+
+class Eta: public MiniEvaluator {
+public:
+  Eta() {};
+  ~Eta() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.eta();
+  }
+};
+
+class M: public MiniEvaluator {
+public:
+  M() {};
+  ~M() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.m();
+  }
+};
+
+class D0: public MiniEvaluator {
+public:
+  D0() {};
+  ~D0() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.d0();
+  }
+};
+
+class ErrD0: public MiniEvaluator {
+public:
+  ErrD0() {};
+  ~ErrD0() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(0, 0));
+  }
+};
+
+class Z0: public MiniEvaluator {
+public:
+  Z0() {};
+  ~Z0() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.z0();
+  }
+};
+
+class ErrZ0: public MiniEvaluator {
+public:
+  ErrZ0() {};
+  ~ErrZ0() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(1, 1));
+  }
+};
+
+class Phi: public MiniEvaluator {
+public:
+  Phi() {};
+  ~Phi() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.phi();
+  }
+};
+
+class ErrPhi: public MiniEvaluator {
+public:
+  ErrPhi() {};
+  ~ErrPhi() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(2, 2));
+  }
+};
+
+class Theta: public MiniEvaluator {
+public:
+  Theta() {};
+  ~Theta() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.theta();
+  }
+};
+
+class ErrTheta: public MiniEvaluator {
+public:
+  ErrTheta() {};
+  ~ErrTheta() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(3, 3));
+  }
+};
+
+class QOverP: public MiniEvaluator {
+public:
+  QOverP() {};
+  ~QOverP() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.qOverP();
+  }
+};
+
+class ErrQOverP: public MiniEvaluator {
+public:
+  ErrQOverP() {};
+  ~ErrQOverP() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(4, 4));
+  }
+};
+
+class ChiSq: public MiniEvaluator {
+public:
+  ChiSq() {};
+  ~ChiSq() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.chiSquared();
+  }
+};
+
+class RedChiSq: public MiniEvaluator {
+public:
+  RedChiSq() {};
+  ~RedChiSq() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return (trk.chiSquared() / trk.numberDoF());
+  }
+};
+
+class D0Sig: public MiniEvaluator {
+public:
+  D0Sig() {};
+  ~D0Sig() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const override final {
+    return xAOD::TrackingHelpers::d0significance(&trk, evt.beamPosSigmaX(), evt.beamPosSigmaY(), evt.beamPosSigmaXY());
+  }
+};
+
+class DZ: public MiniEvaluator {
+public:
+  DZ() {};
+  ~DZ() override final {};
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return (trk.z0() + trk.vz() - vx.z());
+  }
+};
+
+class ErrDZ: public MiniEvaluator {
+public:
+  ErrDZ() {};
+  ~ErrDZ() override final {};
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(1, 1) + std::pow(evt.beamPosSigmaZ(), 2) + vx.covariancePosition()(2, 2));
+  }
+};
+
+class DZSinTheta: public MiniEvaluator {
+public:
+  DZSinTheta() {};
+  ~DZSinTheta() override final {};
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return (trk.z0() + trk.vz() - vx.z()) * std::sin(trk.theta());
+  }
+};
+
+class ErrDZSinTheta: public MiniEvaluator {
+public:
+  ErrDZSinTheta() {};
+  ~ErrDZSinTheta() override final {};
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const override final {
+    float dz         = (trk.z0() + trk.vz() - vx.z());
+    float sinTheta   = std::sin(trk.theta());
+    float cosTheta   = std::cos(trk.theta());
+    float errSqDZ    = trk.definingParametersCovMatrix()(1, 1) + std::pow(evt.beamPosSigmaZ(), 2) + vx.covariancePosition()(2, 2);
+    float errSqTheta = trk.definingParametersCovMatrix()(3, 3);
+    float covZ0Theta = trk.definingParametersCovMatrix()(1, 3);
+    return (errSqDZ * std::pow(sinTheta, 2) + std::pow(dz * cosTheta, 2) * errSqTheta + 2 * sinTheta * dz * cosTheta * covZ0Theta);
+  }
+};
+
+std::vector<const xAOD::TrackParticle*> toVector(const std::vector<ElementLink<xAOD::TrackParticleContainer>>& inTrks) {
+  std::vector<const xAOD::TrackParticle*> outTrks;
+  for (const auto& trkLink : inTrks) {
+    if (trkLink.isValid()) {
+      outTrks.push_back((const xAOD::TrackParticle*)(*trkLink));
+    }
+  }
+  return outTrks;
+}
+
+int inVector(const xAOD::TrackParticle* trk, const std::vector<const xAOD::TrackParticle*>& vec) {
+  int i = 0;
+  for (const auto& ele : vec) {
+    if (trk == ele) {
+      return i;
+    }
+    i++;
+  }
+  return -1;
+}
+
+class FitWeight: public MiniEvaluator {
+public:
+  FitWeight() {};
+  ~FitWeight() override final {};
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    std::vector<const xAOD::TrackParticle*> fitTrks = toVector((const std::vector<ElementLink<xAOD::TrackParticleContainer>>&)vx.trackParticleLinks());
+    float weight = 0.0;
+    int pos = inVector(&trk, fitTrks);
+    if (pos != -1) {
+      weight = vx.trackWeights().at(pos);
+    }
+    return weight;
+  }
+};
+
+class VxX: public MiniEvaluator {
+public:
+  VxX() {};
+  ~VxX() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return vx.x();
+  }
+};
+
+class ErrVxX: public MiniEvaluator {
+public:
+  ErrVxX() {};
+  ~ErrVxX() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(vx.covariancePosition()(0, 0));
+  }
+};
+
+class VxY: public MiniEvaluator {
+public:
+  VxY() {};
+  ~VxY() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return vx.y();
+  }
+};
+
+class ErrVxY: public MiniEvaluator {
+public:
+  ErrVxY() {};
+  ~ErrVxY() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(vx.covariancePosition()(1, 1));
+  }
+};
+
+class VxZ: public MiniEvaluator {
+public:
+  VxZ() {};
+  ~VxZ() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return vx.z();
+  }
+};
+
+class ErrVxZ: public MiniEvaluator {
+public:
+  ErrVxZ() {};
+  ~ErrVxZ() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(vx.covariancePosition()(2, 2));
+  }
+};
+
+} // namespace
+
+namespace CP {
+
+MVAInputEvaluator::~MVAInputEvaluator() {
+  this->clear();
+}
+
+void MVAInputEvaluator::add(const std::string& name, const MVAInputEvaluator::Input& type) {
+  using Input = MVAInputEvaluator::Input;
+  for (auto it = m_evalMap.begin(); it != m_evalMap.end(); it++) {
+    if (name == it->first) {
+      throw std::runtime_error("ERROR in CP::MVAInputEvaluator::add : input name is already present in map: " + name);
+    }
+  }
+  switch (type) {
+    case Input::Pt: {
+      m_evalMap[name] = new ::Pt();
+      break;
+    }
+    case Input::Eta: {
+      m_evalMap[name] = new ::Eta();
+      break;
+    }
+    case Input::M: {
+      m_evalMap[name] = new ::M();
+      break;
+    }
+    case Input::D0: {
+      m_evalMap[name] = new ::D0();
+      break;
+    }
+    case Input::ErrD0: {
+      m_evalMap[name] = new ::ErrD0();
+      break;
+    }
+    case Input::Z0: {
+      m_evalMap[name] = new ::Z0();
+      break;
+    }
+    case Input::ErrZ0: {
+      m_evalMap[name] = new ::ErrZ0();
+      break;
+    }
+    case Input::Phi: {
+      m_evalMap[name] = new ::Phi();
+      break;
+    }
+    case Input::ErrPhi: {
+      m_evalMap[name] = new ::ErrPhi();
+      break;
+    }
+    case Input::Theta: {
+      m_evalMap[name] = new ::Theta();
+      break;
+    }
+    case Input::ErrTheta: {
+      m_evalMap[name] = new ::ErrTheta();
+      break;
+    }
+    case Input::QOverP: {
+      m_evalMap[name] = new ::QOverP();
+      break;
+    }
+    case Input::ErrQOverP: {
+      m_evalMap[name] = new ::ErrQOverP();
+      break;
+    }
+    case Input::ChiSq: {
+      m_evalMap[name] = new ::ChiSq();
+      break;
+    }
+    case Input::RedChiSq: {
+      m_evalMap[name] = new ::RedChiSq();
+      break;
+    }
+    case Input::D0Sig: {
+      m_evalMap[name] = new ::D0Sig();
+      break;
+    }
+    case Input::DZ: {
+      m_evalMap[name] = new ::DZ();
+      break;
+    }
+    case Input::ErrDZ: {
+      m_evalMap[name] = new ::ErrDZ();
+      break;
+    }
+    case Input::DZSinTheta: {
+      m_evalMap[name] = new ::DZSinTheta();
+      break;
+    }
+    case Input::ErrDZSinTheta: {
+      m_evalMap[name] = new ::ErrDZSinTheta();
+      break;
+    }
+    case Input::FitWeight: {
+      m_evalMap[name] = new ::FitWeight();
+      break;
+    }
+    case Input::VxX: {
+      m_evalMap[name] = new ::VxX();
+      break;
+    }
+    case Input::ErrVxX: {
+      m_evalMap[name] = new ::ErrVxX();
+      break;
+    }
+    case Input::VxY: {
+      m_evalMap[name] = new ::VxY();
+      break;
+    }
+    case Input::ErrVxY: {
+      m_evalMap[name] = new ::ErrVxY();
+      break;
+    }
+    case Input::VxZ: {
+      m_evalMap[name] = new ::VxZ();
+      break;
+    }
+    case Input::ErrVxZ: {
+      m_evalMap[name] = new ::ErrVxZ();
+      break;
+    }
+    default: {
+      throw std::runtime_error("ERROR in CP::MVAInputEvaluator::add : unknown input enum: " + std::to_string(type));
+    }
+  }
+  return;
+}
+
+void MVAInputEvaluator::load(const MVAInputEvaluator::InputSelectionMap& selection) {
+  this->clear();
+  std::string k;
+  for (auto it = selection.begin(); it != selection.end(); it++) {
+    this->add(it->first, it->second);
+  }
+  return;
+}
+
+void MVAInputEvaluator::eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt, std::map<std::string, double>& input) const {
+  input.clear();
+  for (auto it = m_evalMap.begin(); it != m_evalMap.end(); it++) {
+    input[it->first] = it->second->eval(trk, vx, evt);
+  }
+  return;
+}
+
+void MVAInputEvaluator::clear() {
+  for (auto it = m_evalMap.begin(); it != m_evalMap.end(); it++) {
+    delete it->second;
+    it->second = nullptr;
+  }
+  m_evalMap.clear();
+  return;
+}
+
+} // namespace CP
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
new file mode 100644
index 000000000000..cc3380b02bd4
--- /dev/null
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -0,0 +1,284 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrackVertexAssociationTool/MVATrackVertexAssociationTool.h"
+
+#include "AsgDataHandles/ReadHandle.h"
+#include "xAODTracking/TrackParticle.h"
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODTracking/Vertex.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODTracking/TrackingPrimitives.h"
+
+#include "lwtnn/NNLayerConfig.hh"
+#include "lwtnn/LightweightNeuralNetwork.hh"
+#include "lwtnn/LightweightGraph.hh"
+#include "lwtnn/parse_json.hh"
+
+#include <fstream>
+#include <iterator>
+#include <stdexcept>
+
+namespace CP {
+
+MVATrackVertexAssociationTool::MVATrackVertexAssociationTool(const std::string& name) :
+  AsgTool(name),
+  m_isSequential(true),
+  m_wp("Tight"),
+  m_cut(-1.0)
+{
+  declareProperty("NetworkFileName", m_fileName,     "Name of the input lwtnn network file."                                                              );
+  declareProperty("InputNames",      m_inputNames,   "Vector of the network's input variable names (std::vector<std::string>)."                           );
+  declareProperty("InputTypes",      m_inputTypes,   "Vector of the network's input variable evaluator types (std::vector<CP::MVAEvaluatorInput::Input>).");
+  declareProperty("OutputNodeName",  m_outputName,   "Name of the output node to cut on for TVA."                                                         );
+  declareProperty("IsSequential",    m_isSequential, "Is the network sequential (true) or functional (false)."                                            );
+  declareProperty("WorkingPoint",    m_wp,           "TVA working point to apply."                                                                        );
+  declareProperty("OutputCut",       m_cut,          "TVA cut value on the output value (set manually with \"Custom\" WP)."                               );
+}
+
+StatusCode MVATrackVertexAssociationTool::initialize() {
+
+  ATH_MSG_INFO("Initializing MVATrackVertexAssociationTool.");
+
+  // Init EventInfo
+  ATH_CHECK(m_eventInfo.initialize());
+
+  // Init network
+  if (this->initializeNetwork()) {
+    ATH_MSG_ERROR("Could not initialize network properly.");
+    return StatusCode::FAILURE;
+  }
+
+  // Map our working point to a cut on the MVA output discriminant
+  if (m_wp == "Tight") {
+    m_cut = 0.85;
+  }
+  else if (m_wp == "Custom") {
+    // Nothing to do here
+  }
+  else {
+    ATH_MSG_ERROR("Invalid TVA working point \"" << m_wp << "\" - for a custom configuration, please provide \"Custom\" for the \"WorkingPoint\" property.");
+    return StatusCode::FAILURE;
+  }
+
+  // Some extra printout for Custom
+  if (m_wp == "Custom") {
+    ATH_MSG_INFO("TVA working point \"Custom\" provided - tool properties are initialized to default values unless explicitly set by the user.");
+  }
+  else {
+    ATH_MSG_INFO("TVA working point \"" << m_wp << "\" provided - tool properties have been configured accordingly.");
+  }
+
+  ATH_MSG_INFO("Cut on MVA output discriminant: " << m_cut);
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode MVATrackVertexAssociationTool::finalize() {
+
+  ATH_MSG_INFO("Finalizing MVATrackVertexAssociationTool.");
+
+  // Finalize network
+  if (this->finalizeNetwork()) {
+    ATH_MSG_ERROR("Could not finalize network properly.");
+    return StatusCode::FAILURE;
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+bool MVATrackVertexAssociationTool::isCompatible(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx) const {
+  float mvaOutput;
+  return isMatch(trk, vx, mvaOutput);
+}
+
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getMatchMap(std::vector<const xAOD::TrackParticle*>& trk_list, std::vector<const xAOD::Vertex*>& vx_list) const {
+  return getMatchMapInternal(trk_list, vx_list);
+}
+
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getMatchMap(const xAOD::TrackParticleContainer& trkCont, const xAOD::VertexContainer& vxCont) const {
+  return getMatchMapInternal(trkCont, vxCont);
+}
+
+const xAOD::Vertex* MVATrackVertexAssociationTool::getUniqueMatchVertex(const xAOD::TrackParticle& trk, std::vector<const xAOD::Vertex*>& vx_list) const {
+  return getUniqueMatchVertexInternal(trk, vx_list);
+}
+
+ElementLink<xAOD::VertexContainer> MVATrackVertexAssociationTool::getUniqueMatchVertexLink(const xAOD::TrackParticle& trk, const xAOD::VertexContainer& vxCont) const {
+  ElementLink<xAOD::VertexContainer> vx_link_tmp;
+  const xAOD::Vertex* vx_tmp = getUniqueMatchVertexInternal(trk, vxCont);
+  if (vx_tmp) {
+    vx_link_tmp.toContainedElement(vxCont, vx_tmp);
+  }
+  return vx_link_tmp;
+}
+
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getUniqueMatchMap(std::vector<const xAOD::TrackParticle*>& trk_list, std::vector<const xAOD::Vertex*>& vx_list) const {
+  return getUniqueMatchMapInternal(trk_list, vx_list);
+}
+
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getUniqueMatchMap(const xAOD::TrackParticleContainer& trkCont, const xAOD::VertexContainer& vxCont) const {
+  return getUniqueMatchMapInternal(trkCont, vxCont);
+}
+
+// --------------- //
+// Private methods //
+// --------------- //
+
+bool MVATrackVertexAssociationTool::isMatch(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, float& mvaOutput) const {
+
+  // Fake vertex, return false
+  if (vx.vertexType() == xAOD::VxType::NoVtx) {
+    return false;
+  }
+
+  // Retrieve our EventInfo
+  SG::ReadHandle<xAOD::EventInfo> evt(m_eventInfo);
+  if (!evt.isValid()) {
+    throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::isMatch : could not retrieve xAOD::EventInfo.");
+  }
+
+  // Evaluate our network and compare against our TVA cut (">= cut" := associated)
+  mvaOutput = this->evaluateNetwork(trk, vx, *evt);
+  return (mvaOutput >= m_cut);
+}
+
+template <typename T, typename V>
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getMatchMapInternal(const T& trk_list, const V& vx_list) const {
+
+  xAOD::TrackVertexAssociationMap trktovxmap;
+
+  for (const auto& vertex : vx_list) {
+    xAOD::TrackVertexAssociationList trktovxlist;
+    trktovxlist.clear();
+    for (const auto& track : trk_list) {
+      if (isCompatible(*track, *vertex)) {
+        trktovxlist.push_back(track);
+      }
+    }
+    trktovxmap[vertex] = trktovxlist;
+  }
+
+  return trktovxmap;
+}
+
+template <typename T>
+const xAOD::Vertex* MVATrackVertexAssociationTool::getUniqueMatchVertexInternal(const xAOD::TrackParticle& trk, const T& vx_list) const {
+
+  bool match;
+  float mvaOutput;
+  float minValue = 999.0; // MVA output ranges between 0 and 1
+  const xAOD::Vertex* bestMatchVertex = nullptr;
+
+  for (const auto& vertex : vx_list) {
+    match = isMatch(trk, *vertex, mvaOutput);
+    if (match && (mvaOutput < minValue)) {
+      minValue = mvaOutput;
+      bestMatchVertex = vertex;
+    }
+  }
+
+  // check if get the matched Vertex, for the tracks not used in vertex fit
+  if (!bestMatchVertex) {
+    ATH_MSG_DEBUG("Could not find any matched vertex for this track.");
+  }
+
+  return bestMatchVertex;
+}
+
+template <typename T, typename V>
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getUniqueMatchMapInternal(const T& trk_list, const V& vx_list) const {
+
+  xAOD::TrackVertexAssociationMap trktovxmap;
+
+  // Initialize map
+  for (const auto& vertex : vx_list) {
+    xAOD::TrackVertexAssociationList trktovxlist;
+    trktovxlist.clear();
+    trktovxmap[vertex] = trktovxlist;
+  }
+
+  // Perform matching
+  for (const auto& track : trk_list) {
+    const xAOD::Vertex* vx_match = getUniqueMatchVertexInternal(*track, vx_list);
+    if (vx_match) {
+      // Found matched vertex
+      trktovxmap[vx_match].push_back(track);
+    }
+  }
+
+  return trktovxmap;
+}
+
+bool MVATrackVertexAssociationTool::initializeNetwork() {
+
+  // Load our input evaluator
+  if (m_inputNames.size() != m_inputTypes.size()) {
+    throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : size of input variable names (" + std::to_string(m_inputNames.size()) + ") does not equal size of input variable types (" + std::to_string(m_inputTypes.size()) + ").");
+  }
+  m_inputMap.clear();
+  for (size_t i = 0; i < m_inputNames.size(); i++) {
+    m_inputMap[m_inputNames[i]] = static_cast<MVAInputEvaluator::Input>(m_inputTypes[i]);
+  }
+  m_inputEval.load(m_inputMap);
+
+  // Load our input file 
+  std::ifstream netFile(m_fileName);
+
+  // For sequential:
+  if (m_isSequential) {
+    lwt::JSONConfig netDef = lwt::parse_json(netFile);
+    m_network = new lwt::LightweightNeuralNetwork(netDef.inputs, netDef.layers, netDef.outputs);
+  }
+  // For functional:
+  else {
+    lwt::GraphConfig netDef = lwt::parse_json_graph(netFile);
+    if (netDef.inputs.size() != 1) {
+      throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : network in file \"" + m_fileName + "\" has more than 1 input node: # of input nodes = " + std::to_string(netDef.inputs.size()));
+    }
+    m_inputNodeName = netDef.inputs[0].name;
+    m_graph = new lwt::LightweightGraph(netDef);
+  }
+
+  return true;
+}
+
+float MVATrackVertexAssociationTool::evaluateNetwork(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const {
+
+  // Evaluate our inputs
+  std::map<std::string, double> input;
+  m_inputEval.eval(trk, vx, evt, input);
+
+  // Evaluate our network
+  std::map<std::string, double> output;
+  // For sequential:
+  if (m_isSequential) {
+    output = m_network->compute(input);
+  }
+  // For functional:
+  else {
+    std::map<std::string, std::map<std::string, double>> wrappedInput;
+    wrappedInput[m_inputNodeName] = input;
+    output = m_graph->compute(wrappedInput);
+  }
+
+  return output[m_outputName];
+}
+
+bool MVATrackVertexAssociationTool::finalizeNetwork() {
+
+  // Clean-up
+  if (m_network) {
+    delete m_network;
+    m_network = nullptr;
+  }
+  if (m_graph) {
+    delete m_graph;
+    m_graph = nullptr;
+  }
+
+  return true;
+}
+
+} // namespace CP
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVAInputEvaluator.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVAInputEvaluator.h
new file mode 100644
index 000000000000..e8824880b3d3
--- /dev/null
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVAInputEvaluator.h
@@ -0,0 +1,77 @@
+#ifndef MVAINPUTEVALUATOR_H
+#define MVAINPUTEVALUATOR_H
+
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODTracking/TrackParticleFwd.h"
+#include "xAODTracking/VertexFwd.h"
+
+#include <iterator>
+#include <map>
+#include <string>
+
+namespace CP {
+
+class MVAInputEvaluator {
+public:
+  MVAInputEvaluator() {};
+  ~MVAInputEvaluator();
+
+  // Nested class for evaluating single input features
+  class MiniEvaluator {
+  public:
+    MiniEvaluator() {};
+    virtual ~MiniEvaluator() {};
+    virtual float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const = 0;
+  };
+
+  // Enumerate the different possible inputs
+  enum Input {
+    Pt,
+    Eta,
+    M,
+    D0,
+    ErrD0,
+    Z0,
+    ErrZ0,
+    Phi,
+    ErrPhi,
+    Theta,
+    ErrTheta,
+    QOverP,
+    ErrQOverP,
+    ChiSq,
+    RedChiSq,
+    D0Sig,
+    DZ,
+    ErrDZ,
+    DZSinTheta,
+    ErrDZSinTheta,
+    FitWeight,
+    VxX,
+    ErrVxX,
+    VxY,
+    ErrVxY,
+    VxZ,
+    ErrVxZ
+  };
+
+  // Handy typedefs
+  // Defines the mapping of strings to Inputs:
+  typedef std::map<std::string, Input> InputSelectionMap;
+  // Defines the mapping of those same strings to MiniEvaluators:
+  typedef std::map<std::string, MiniEvaluator*> InputEvaluatorMap;
+
+  void add(const std::string& name, const MVAInputEvaluator::Input& type);
+  void load(const MVAInputEvaluator::InputSelectionMap& selection);
+  void eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt, std::map<std::string, double>& input) const;
+  void clear();
+
+private:
+  // Loaded evaluator map
+  InputEvaluatorMap m_evalMap = {};
+
+};
+
+} // namepace CP
+
+#endif // MVAINPUTEVALUATOR_H
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
new file mode 100644
index 000000000000..384408f44b51
--- /dev/null
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
@@ -0,0 +1,116 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef MVATRACKVERTEXASSOCIATIONTOOL_H
+#define MVATRACKVERTEXASSOCIATIONTOOL_H
+
+#include "AsgTools/AsgTool.h"
+#include "AthLinks/ElementLink.h"
+#include "AsgDataHandles/ReadHandleKey.h"
+
+#include "TrackVertexAssociationTool/ITrackVertexAssociationTool.h"
+#include "TrackVertexAssociationTool/MVAInputEvaluator.h"
+
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODTracking/TrackParticleFwd.h"
+#include "xAODTracking/TrackParticleContainerFwd.h"
+#include "xAODTracking/VertexFwd.h"
+#include "xAODTracking/VertexContainerFwd.h"
+
+#include <map>
+#include <string>
+#include <vector>
+
+// Forward declarations
+#ifndef __CINT__
+namespace lwt {
+  class LightweightNeuralNetwork;
+  class LightweightGraph;
+}
+#endif
+
+namespace CP {
+
+class MVATrackVertexAssociationTool : public asg::AsgTool, virtual public ITrackVertexAssociationTool
+{
+  ASG_TOOL_CLASS(MVATrackVertexAssociationTool, ITrackVertexAssociationTool)
+public:
+
+  MVATrackVertexAssociationTool(const std::string& name);
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+
+  virtual bool isCompatible(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx) const override;
+
+  virtual xAOD::TrackVertexAssociationMap getMatchMap(std::vector<const xAOD::TrackParticle*>& trk_list, std::vector<const xAOD::Vertex*>& vx_list) const override;
+  virtual xAOD::TrackVertexAssociationMap getMatchMap(const xAOD::TrackParticleContainer& trk_cont, const xAOD::VertexContainer& vx_cont) const override;
+
+  virtual ElementLink<xAOD::VertexContainer> getUniqueMatchVertexLink(const xAOD::TrackParticle& trk, const xAOD::VertexContainer& vx_cont) const override;
+  virtual const xAOD::Vertex* getUniqueMatchVertex(const xAOD::TrackParticle& trk, std::vector<const xAOD::Vertex*>& vx_list) const override;
+
+  virtual xAOD::TrackVertexAssociationMap getUniqueMatchMap(std::vector<const xAOD::TrackParticle*>& trk_list, std::vector<const xAOD::Vertex*>& vx_list) const override;
+  virtual xAOD::TrackVertexAssociationMap getUniqueMatchMap(const xAOD::TrackParticleContainer& trk_cont, const xAOD::VertexContainer& vx_cont) const override;
+
+private:
+
+  bool isMatch(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, float& mvaOutput) const;
+
+  template <typename T, typename V>
+  xAOD::TrackVertexAssociationMap getMatchMapInternal(const T& trk_list, const V& vx_list) const;
+
+  template <typename T, typename V>
+  xAOD::TrackVertexAssociationMap getUniqueMatchMapInternal(const T& trk_list, const V& vx_list) const;
+
+  template <typename T>
+  const xAOD::Vertex* getUniqueMatchVertexInternal(const xAOD::TrackParticle& trk, const T& vx_list) const;
+
+  bool initializeNetwork();
+  float evaluateNetwork(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const;
+  bool finalizeNetwork();
+
+  // Input lwtnn network file
+  std::string m_fileName;
+
+  // Vector of input variable names
+  std::vector<std::string> m_inputNames;
+
+  // Vector of input variable types
+  std::vector<int> m_inputTypes;
+
+  // Name of the output node to cut on
+  std::string m_outputName;
+
+  // Is the network sequential or functional
+  bool m_isSequential;
+
+  // TVA working point
+  std::string m_wp;
+
+  // TVA cut value on the output discriminant
+  float m_cut;
+
+  // Input variable name/type map
+  MVAInputEvaluator::InputSelectionMap m_inputMap;
+
+  // Input variable evaluator
+  MVAInputEvaluator m_inputEval;
+
+  // EventInfo key
+  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo {this, "EventInfo", "EventInfo", "EventInfo key"};
+
+  // Name of the input node (for functional modes)
+  std::string m_inputNodeName = ""; //!
+
+  // Network as implemented using lwtnn
+  #ifndef __CINT__
+  lwt::LightweightNeuralNetwork* m_network = nullptr; //!
+  lwt::LightweightGraph*         m_graph   = nullptr; //!
+  #endif
+
+};
+
+} // namespace CP
+
+#endif // MVATRACKVERTEXASSOCIATIONTOOL_H
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationToolDict.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationToolDict.h
index 252ba8881f12..d7745a294ec8 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationToolDict.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationToolDict.h
@@ -14,5 +14,6 @@
 #include "TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h"
 #include "TrackVertexAssociationTool/ElectronTrackVertexAssociationTool.h"
 #include "TrackVertexAssociationTool/MuonTrackVertexAssociationTool.h"
+#include "TrackVertexAssociationTool/MVATrackVertexAssociationTool.h"
 
 #endif //TrackVertexAssociationTool
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/selection.xml b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/selection.xml
index 457a3ebfd5bd..29a9e40a43b5 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/selection.xml
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/selection.xml
@@ -3,4 +3,5 @@
   <class name="CP::BaseTrackVertexAssociationTool" />
   <class name="CP::ElectronTrackVertexAssociationTool" />
   <class name="CP::MuonTrackVertexAssociationTool" />
+  <class name="CP::MVATrackVertexAssociationTool" />
 </lcgdict>
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/components/TrackVertexAssociationTool_entries.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/components/TrackVertexAssociationTool_entries.cxx
index 1bc9a6406434..31eda59b3a3a 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/components/TrackVertexAssociationTool_entries.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/components/TrackVertexAssociationTool_entries.cxx
@@ -2,6 +2,7 @@
 #include "TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h"
 #include "TrackVertexAssociationTool/ElectronTrackVertexAssociationTool.h"
 #include "TrackVertexAssociationTool/MuonTrackVertexAssociationTool.h"
+#include "TrackVertexAssociationTool/MVATrackVertexAssociationTool.h"
 
 #include "../TrackVertexAssoTestAlg.h"
 
@@ -11,5 +12,6 @@ DECLARE_COMPONENT( CP::TrackVertexAssociationTool )
 DECLARE_COMPONENT( CP::BaseTrackVertexAssociationTool )
 DECLARE_COMPONENT( CP::ElectronTrackVertexAssociationTool )
 DECLARE_COMPONENT( CP::MuonTrackVertexAssociationTool )
+DECLARE_COMPONENT( CP::MVATrackVertexAssociationTool )
 DECLARE_COMPONENT( TrackVertexAssoTestAlg )
 
-- 
GitLab


From 1e46114c017c2aa04b2e346119a86ab4299afd70 Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Thu, 10 Sep 2020 10:09:16 -0700
Subject: [PATCH 126/422] Include path resolver for input network

---
 .../TrackVertexAssociationTool/CMakeLists.txt             | 3 ++-
 .../Root/MVATrackVertexAssociationTool.cxx                | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
index e4dc2954c396..9b2828ed05b7 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
@@ -25,6 +25,7 @@ atlas_depends_on_subdirs(
    Event/xAOD/xAODTracking
    PRIVATE
    Event/xAOD/xAODEventInfo
+   Tools/PathResolver
    ${extra_deps} )
 
 # External dependencies:
@@ -37,7 +38,7 @@ atlas_add_library( TrackVertexAssociationToolLib
    PUBLIC_HEADERS TrackVertexAssociationTool
    PRIVATE_INCLUDE_DIRS ${LWTNN_INCLUDE_DIRS}
    LINK_LIBRARIES AthContainers AthLinks AsgTools xAODCore xAODTracking AsgDataHandlesLib
-   PRIVATE_LINK_LIBRARIES xAODEventInfo ${LWTNN_LIBRARIES} )
+   PRIVATE_LINK_LIBRARIES xAODEventInfo PathResolver ${LWTNN_LIBRARIES} )
 
 if( NOT XAOD_STANDALONE )
    atlas_add_component( TrackVertexAssociationTool
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
index cc3380b02bd4..a8888a9f3950 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -11,6 +11,8 @@
 #include "xAODTracking/VertexContainer.h"
 #include "xAODTracking/TrackingPrimitives.h"
 
+#include "PathResolver/PathResolver.h"
+
 #include "lwtnn/NNLayerConfig.hh"
 #include "lwtnn/LightweightNeuralNetwork.hh"
 #include "lwtnn/LightweightGraph.hh"
@@ -224,7 +226,11 @@ bool MVATrackVertexAssociationTool::initializeNetwork() {
   m_inputEval.load(m_inputMap);
 
   // Load our input file 
-  std::ifstream netFile(m_fileName);
+  std::string fileName = PathResolverFindCalibFile(m_fileName);
+  if (fileName.empty()) {
+    throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : could not find input network file: " + m_fileName);
+  }
+  std::ifstream netFile(fileName);
 
   // For sequential:
   if (m_isSequential) {
-- 
GitLab


From c1ef4b3df0367d5f5711d379ce3ec30076db4a2e Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Thu, 10 Sep 2020 12:21:40 -0700
Subject: [PATCH 127/422] Update test alg in anticipation of MVA tool testing

---
 .../TrackVertexAssociationTool/CMakeLists.txt |  4 +-
 .../share/jobOption_TrackVertexAssoTest.py    | 35 ++++----
 .../src/TrackVertexAssoTestAlg.cxx            | 88 ++++++++-----------
 .../src/TrackVertexAssoTestAlg.h              | 78 +++++++---------
 4 files changed, 91 insertions(+), 114 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
index 9b2828ed05b7..929abff86e9a 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
@@ -11,7 +11,7 @@ set( extra_deps )
 if( XAOD_STANDALONE )
    set( extra_deps Control/xAODRootAccess )
 else()
-   set( extra_deps Control/AthenaBaseComps GaudiKernel )
+   set( extra_deps Control/AthenaBaseComps PhysicsAnalysis/D3PDTools/AnaAlgorithm GaudiKernel )
 endif()
 
 # Declare the package's dependencies:
@@ -43,7 +43,7 @@ atlas_add_library( TrackVertexAssociationToolLib
 if( NOT XAOD_STANDALONE )
    atlas_add_component( TrackVertexAssociationTool
       src/*.h src/*.cxx src/components/*.cxx
-      LINK_LIBRARIES GaudiKernel AthenaBaseComps xAODTracking
+      LINK_LIBRARIES GaudiKernel AthenaBaseComps AnaAlgorithmLib xAODTracking
       TrackVertexAssociationToolLib )
 endif()
 
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/share/jobOption_TrackVertexAssoTest.py b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/share/jobOption_TrackVertexAssoTest.py
index 65e16d6737fa..0d7e24d1de05 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/share/jobOption_TrackVertexAssoTest.py
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/share/jobOption_TrackVertexAssoTest.py
@@ -3,30 +3,35 @@ from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
 from AthenaCommon.AppMgr import ServiceMgr, ToolSvc, theApp
 from AthenaCommon import CfgMgr
 
-#filelist = ['/tmp/boliu/AOD.04607224._000001.pool.root.1']
 filelist = [os.environ["ASG_TEST_FILE_MC"]]
-
 ServiceMgr.EventSelector.InputCollections = filelist
-#ServiceMgr.EventSelector.InputCollections =[] 
 
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
 
-# instantiate the tool
-tvatool=CfgMgr.CP__TrackVertexAssociationTool("TrackVertexAssociationTool",
-                                              WorkingPoint="Nominal")
-ToolSvc += tvatool
-
-testAlg=CfgMgr.TrackVertexAssoTestAlg(
-        TrackContainer="InDetTrackParticles",
-        VertexContainer="PrimaryVertices",
-        TVATool=tvatool
-        )
+# Instantiate the tool
+testMVATool = False
+if testMVATool:
+    tvaTool = None
+else:
+    tvaTool = CfgMgr.CP__TrackVertexAssociationTool("TrackVertexAssociationTool",
+                                                    WorkingPoint = "Nominal")
+ToolSvc += tvaTool
 
+# Instantiate the alg
+testAlg = CfgMgr.TrackVertexAssoTestAlg(TrackContainer  = "InDetTrackParticles",
+                                        VertexContainer = "PrimaryVertices",
+                                        TVATool         = tvaTool)
 topSequence += testAlg
 
+if not hasattr(svcMgr, 'THistSvc'):
+    from GaudiSvc.GaudiSvcConf import THistSvc
+    svcMgr += THistSvc()
+svcMgr.THistSvc.Output += [("ANALYSIS DATAFILE='TrackVertexAssoTestAlg.outputs.root' OPT='RECREATE'")] # Default stream: "ANALYSIS"
+svcMgr.THistSvc.MaxFileSize = -1
+
 theApp.EvtMax = 100
-#testAlg.OutputLevel=DEBUG
-#theApp.setOutputLevel(DEBUG)
+# testAlg.OutputLevel = DEBUG
+# theApp.setOutputLevel(DEBUG)
 ServiceMgr.EventSelector.SkipEvents = 0
 ServiceMgr.MessageSvc.defaultLimit = 999
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.cxx
index e19c0bcc4c73..d53513fd0aed 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.cxx
@@ -1,43 +1,34 @@
 ///////////////////////// -*- C++ -*- /////////////////////////////
-
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
-
-// TrackVertexAssoTestAlg.cxx 
+// TrackVertexAssoTestAlg.cxx
 // Implementation file for class TrackVertexAssoTestAlg
-// Author: Rachid Mazini, Bo Liu 
-/////////////////////////////////////////////////////////////////// 
+// Author: Rachid Mazini, Bo Liu
+///////////////////////////////////////////////////////////////////
 
 // TrackVertexAssociationTool includes
 #include "TrackVertexAssoTestAlg.h"
 
-// STL includes
-
 // FrameWork includes
 #include "Gaudi/Property.h"
+#include "AsgTools/MessageCheck.h"
 
-#include "xAODTracking/TrackParticle.h"
-#include "xAODTracking/Vertex.h"
-#include "xAODTracking/TrackParticleContainer.h"
-#include "xAODTracking/VertexContainer.h"
+// ROOT includes
+#include "TH1F.h"
 
 using namespace std;
 
-/////////////////////////////////////////////////////////////////// 
-// Public methods: 
-/////////////////////////////////////////////////////////////////// 
+///////////////////////////////////////////////////////////////////
+// Public methods:
+///////////////////////////////////////////////////////////////////
 
 // Constructors
 ////////////////
-TrackVertexAssoTestAlg::TrackVertexAssoTestAlg( const std::string& name, 
-			  ISvcLocator* pSvcLocator ) : 
-  ::AthAlgorithm( name, pSvcLocator )
+TrackVertexAssoTestAlg::TrackVertexAssoTestAlg( const std::string& name, ISvcLocator* pSvcLocator ) :
+  EL::AnaAlgorithm( name, pSvcLocator )
 {
-  //
   // Property declaration
-  // 
-  //declareProperty( "Property", m_nProperty );
   declareProperty( "TVATool", m_TVATool );
 }
 
@@ -54,8 +45,19 @@ StatusCode TrackVertexAssoTestAlg::initialize()
 
   ATH_CHECK( m_trkContname.initialize() );
   ATH_CHECK( m_vertexContname.initialize() );
-  //retrieve tool from ToolHandle
-  CHECK(m_TVATool.retrieve());
+
+  // Retrieve tool from ToolHandle
+  ATH_CHECK( m_TVATool.retrieve() );
+
+  // Book our histograms
+  m_h_eff = new TEfficiency("_h_eff", "_h_eff", m_nbins, m_xmin, m_xmax);
+  m_h_eff->SetDirectory(0);
+  m_h_eff->SetStatisticOption(TEfficiency::kFNormal);
+  m_h_imp = new TEfficiency("_h_imp", "_h_imp", m_nbins, m_xmin, m_xmax);
+  m_h_imp->SetDirectory(0);
+  m_h_imp->SetStatisticOption(TEfficiency::kFNormal);
+  ANA_CHECK(book(TH1F("h_eff", "h_eff", m_nbins, m_xmin, m_xmax))); // TVA efficiency vs. eta
+  ANA_CHECK(book(TH1F("h_imp", "h_imp", m_nbins, m_xmin, m_xmax))); // TVA impurity vs. eta
 
   return StatusCode::SUCCESS;
 }
@@ -64,6 +66,18 @@ StatusCode TrackVertexAssoTestAlg::finalize()
 {
   ATH_MSG_INFO ("Finalizing " << name() << "...");
 
+  for (int i = 1; i <= m_nbins; i++) {
+    hist("h_eff")->SetBinContent(i, m_h_eff->GetEfficiency(i));
+    hist("h_eff")->SetBinError(i, m_h_eff->GetEfficiencyErrorUp(i));
+    hist("h_imp")->SetBinContent(i, m_h_imp->GetEfficiency(i));
+    hist("h_imp")->SetBinError(i, m_h_imp->GetEfficiencyErrorUp(i));
+  }
+
+  delete m_h_eff;
+  m_h_eff = nullptr;
+  delete m_h_imp;
+  m_h_imp = nullptr;
+
   return StatusCode::SUCCESS;
 }
 
@@ -71,9 +85,8 @@ StatusCode TrackVertexAssoTestAlg::execute()
 {  
   ATH_MSG_DEBUG ("Executing " << name() << "...");
 
-  // retrieve containers
+  // Retrieve containers
   SG::ReadHandle<xAOD::TrackParticleContainer> trkCont(m_trkContname);
-
   SG::ReadHandle<xAOD::VertexContainer> vxCont(m_vertexContname);
 
   if (!trkCont.isValid() || !vxCont.isValid()) {
@@ -143,34 +156,9 @@ StatusCode TrackVertexAssoTestAlg::execute()
   }
 
   // Example of accessing tracks matched to each vertex. Tracks are stored in a std::vector<xAOD::TrackParticle* >, for more details see TrackVertexAssociationMap.h
-
   // const xAOD::Vertex *pv=vxCont->at(0);
   // xAOD::TrackVertexAssociationList trkvxassoList = trkvxassoMap[pv];
   // ATH_MSG_INFO("Number of tracks associated to the PriVx: " << trkvxassoList.size());
 
-
-
   return StatusCode::SUCCESS;
 }
-
-/////////////////////////////////////////////////////////////////// 
-// Const methods: 
-///////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Non-const methods: 
-/////////////////////////////////////////////////////////////////// 
-
-/////////////////////////////////////////////////////////////////// 
-// Protected methods: 
-/////////////////////////////////////////////////////////////////// 
-
-/////////////////////////////////////////////////////////////////// 
-// Const methods: 
-///////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Non-const methods: 
-/////////////////////////////////////////////////////////////////// 
-
-
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.h
index 6a9580567ddf..47a3d4e83c5d 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.h
@@ -1,13 +1,12 @@
 ///////////////////////// -*- C++ -*- /////////////////////////////
-
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
-
-// TrackVertexAssoTestAlg.h 
+// TrackVertexAssoTestAlg.h
 // Header file for class TrackVertexAssoTestAlg
 // Author: Rachid Mazini, Bo Liu
-/////////////////////////////////////////////////////////////////// 
+///////////////////////////////////////////////////////////////////
+
 #ifndef TRACKVERTEXASSOCIATIONTOOL_TRACKVERTEXASSOTESTALG_H
 #define TRACKVERTEXASSOCIATIONTOOL_TRACKVERTEXASSOTESTALG_H 1
 
@@ -15,73 +14,58 @@
 #include <string>
 
 // FrameWork includes
-#include "AthenaBaseComps/AthAlgorithm.h"
+#include "AnaAlgorithm/AnaAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 
 // Tools
 #include "TrackVertexAssociationTool/ITrackVertexAssociationTool.h"
 
-//xAOD 
+// xAOD
 #include "xAODTracking/TrackParticleContainer.h"
 #include "xAODTracking/VertexContainer.h"
 
-class TrackVertexAssoTestAlg
-  : public ::AthAlgorithm
-{ 
+// ROOT
+#include "TEfficiency.h"
 
-  /////////////////////////////////////////////////////////////////// 
-  // Public methods: 
-  /////////////////////////////////////////////////////////////////// 
- public: 
+class TrackVertexAssoTestAlg : public EL::AnaAlgorithm
+{ 
 
-  // Copy constructor: 
+///////////////////////////////////////////////////////////////////
+// Public methods:
+///////////////////////////////////////////////////////////////////
+public: 
 
-  /// Constructor with parameters: 
+  /// Constructor with parameters:
   TrackVertexAssoTestAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
   /// Destructor: 
-  virtual ~TrackVertexAssoTestAlg(); 
-
-  // Assignment operator: 
-  //TrackVertexAssoTestAlg &operator=(const TrackVertexAssoTestAlg &alg); 
+  virtual ~TrackVertexAssoTestAlg();
 
   // Athena algorithm's Hooks
-  virtual StatusCode  initialize();
-  virtual StatusCode  execute();
-  virtual StatusCode  finalize();
-
-  /////////////////////////////////////////////////////////////////// 
-  // Const methods: 
-  ///////////////////////////////////////////////////////////////////
-
-  /////////////////////////////////////////////////////////////////// 
-  // Non-const methods: 
-  /////////////////////////////////////////////////////////////////// 
+  virtual StatusCode initialize();
+  virtual StatusCode execute();
+  virtual StatusCode finalize();
 
-  /////////////////////////////////////////////////////////////////// 
-  // Private data: 
-  /////////////////////////////////////////////////////////////////// 
- private: 
+///////////////////////////////////////////////////////////////////
+// Private data:
+///////////////////////////////////////////////////////////////////
+private:
 
-  /// Default constructor: 
+  /// Default constructor:
   TrackVertexAssoTestAlg();
 
   ToolHandle<CP::ITrackVertexAssociationTool> m_TVATool;
 
   /// Containers
-  
-  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trkContname 
-                                                  { this, "TrackContainer", "InDetTrackParticles", "Input track particles" };
+  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trkContname { this, "TrackContainer", "InDetTrackParticles", "Input track particles" };
   SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContname { this, "VertexContainer", "PrimaryVertices", "Input vertices" };
 
-}; 
-
-// I/O operators
-//////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Inline methods: 
-/////////////////////////////////////////////////////////////////// 
+  int   m_nbins = 26;
+  float m_xmin  = -2.5;
+  float m_xmax  = +2.5;
+  TEfficiency* m_h_eff = nullptr; //!
+  TEfficiency* m_h_imp = nullptr; //!
 
+};
 
 #endif //> !TRACKVERTEXASSOCIATIONTOOL_TRACKVERTEXASSOTESTALG_H
-- 
GitLab


From 59f9baff585344e24171e0aec22952d61e8eaa67 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Thu, 10 Sep 2020 20:27:14 +0100
Subject: [PATCH 128/422] Fixed tests and compilation

---
 .../src/PixelConditionsSummaryTool.cxx        | 397 +++++++++++-------
 .../HLTMenuConfig/Photon/generatePhoton.py    |   1 -
 2 files changed, 247 insertions(+), 151 deletions(-)

diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx
index a7c05be15fb0..987cbe693841 100644
--- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx
+++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx
@@ -1,30 +1,20 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef SIMULATIONBASE
 #include "PixelConditionsSummaryTool.h"
 
-#define UNUSED_VARIABLE(x) (void)(x)
-
 PixelConditionsSummaryTool::PixelConditionsSummaryTool(const std::string& type, const std::string& name, const IInterface* parent)
   :AthAlgTool(type, name, parent),
-  m_pixelID(0),
-  m_pixelBSErrorsSvc("PixelByteStreamErrorsSvc", name),
-  m_useDCSState(false),
-  m_useByteStream(false),
-  m_useTDAQ(false),
-  m_useDeadMap(true)
+  m_pixelID(nullptr),
+  m_useByteStream(false)
 {
   m_isActiveStatus.push_back("OK");
   m_isActiveStates.push_back("READY");
 
   declareProperty("IsActiveStatus", m_isActiveStatus);
   declareProperty("IsActiveStates", m_isActiveStates);
-  declareProperty("UseDCSState", m_useDCSState, "Switch for usage of DCS");
   declareProperty("UseByteStream", m_useByteStream, "Switch for usage of the ByteStream error service");
-  declareProperty("UseTDAQ", m_useTDAQ, "Switch for usage of TDAQ");
-  declareProperty("UseDeadMap", m_useDeadMap, "Switch for usage of dead map");
 }
 
 PixelConditionsSummaryTool::~PixelConditionsSummaryTool(){}
@@ -34,226 +24,333 @@ StatusCode PixelConditionsSummaryTool::initialize(){
 
   ATH_CHECK(setProperties());
 
-  if (m_useDCSState)   { ATH_CHECK(m_DCSConditionsTool.retrieve()); }
-
-  if (m_useByteStream) { ATH_CHECK(m_pixelBSErrorsSvc.retrieve()); }
+  ATH_CHECK(m_condDCSStateKey.initialize());
+  ATH_CHECK(m_condDCSStatusKey.initialize());
+  ATH_CHECK(m_BSErrContReadKey.initialize(SG::AllowEmpty));
 
   ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID"));
 
-  if (m_useTDAQ || m_useDeadMap) { ATH_CHECK(m_condKey.initialize()); }
+  ATH_CHECK(m_condTDAQKey.initialize( !m_condTDAQKey.empty() ));
+  ATH_CHECK(m_condDeadMapKey.initialize());
+  ATH_CHECK(m_pixelCabling.retrieve());
+
+  for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) {
+    if      (m_isActiveStates[istate]=="READY")      { m_activeState.push_back(PixelDCSStateData::DCSModuleState::READY); }
+    else if (m_isActiveStates[istate]=="ON")         { m_activeState.push_back(PixelDCSStateData::DCSModuleState::ON); }
+    else if (m_isActiveStates[istate]=="UNKNOWN")    { m_activeState.push_back(PixelDCSStateData::DCSModuleState::UNKNOWN); }
+    else if (m_isActiveStates[istate]=="TRANSITION") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::TRANSITION); }
+    else if (m_isActiveStates[istate]=="UNDEFINED")  { m_activeState.push_back(PixelDCSStateData::DCSModuleState::UNDEFINED); }
+    else if (m_isActiveStates[istate]=="NOSTATE")    { m_activeState.push_back(PixelDCSStateData::DCSModuleState::NOSTATE); }
+    else {
+      ATH_MSG_ERROR("No matching DCS state " << m_isActiveStates[istate] << " in DCSModuleState");
+      return StatusCode::FAILURE;
+    }
+  }
+
+  for (unsigned int istatus=0; istatus<m_isActiveStatus.size(); istatus++) {
+    if      (m_isActiveStatus[istatus]=="OK")       { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::OK); }
+    else if (m_isActiveStatus[istatus]=="WARNING")  { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::WARNING); }
+    else if (m_isActiveStatus[istatus]=="ERROR")    { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::ERROR); }
+    else if (m_isActiveStatus[istatus]=="FATAL")    { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::FATAL); }
+    else if (m_isActiveStatus[istatus]=="NOSTATUS") { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::NOSTATUS); }
+    else {
+      ATH_MSG_ERROR("No matching DCS status " << m_isActiveStatus[istatus] << " in DCSModuleStatus");
+      return StatusCode::FAILURE;
+    }
+  }
 
   return StatusCode::SUCCESS;
 }
 
-bool PixelConditionsSummaryTool::isActive(const Identifier & elementId, const InDetConditions::Hierarchy h) const {
-
-  UNUSED_VARIABLE(h);
-
-  IdentifierHash moduleHash = m_pixelID->wafer_hash(elementId);
-
-  if (m_useByteStream && !m_pixelBSErrorsSvc->isActive(moduleHash)) { return false; }
-
-  if (m_useDCSState) {
-    bool isDCSActive = false;
-    std::string dcsState = m_DCSConditionsTool->PixelFSMState(moduleHash);
+const IDCInDetBSErrContainer* PixelConditionsSummaryTool::getContainer(const EventContext& ctx) const {
+  SG::ReadHandle<IDCInDetBSErrContainer> idcErrCont(m_BSErrContReadKey, ctx);
+  if (not idcErrCont.isValid()) { return nullptr; }
+  ATH_MSG_VERBOSE("PixelConditionsSummaryTool IDC Container fetched " << m_BSErrContReadKey.key());
+  return idcErrCont.cptr();
+}
 
-    for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) {
-      if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; }
+PixelConditionsSummaryTool::IDCCacheEntry* PixelConditionsSummaryTool::getCacheEntry(const EventContext& ctx) const {
+  IDCCacheEntry* cacheEntry = m_eventCache.get(ctx);
+  if (cacheEntry->needsUpdate(ctx)) {
+    auto idcErrContPtr = getContainer(ctx);
+    if (idcErrContPtr==nullptr) {     // missing or not, the cache needs to be reset
+      cacheEntry->reset(ctx.evt(), nullptr);
+    }
+    else {
+      cacheEntry->reset(ctx.evt(), idcErrContPtr->cache());
     }
-    if (!isDCSActive) { return isDCSActive; }
+    ATH_MSG_VERBOSE("PixelConditionsSummaryTool Cache for the event reset " << cacheEntry->eventId << " with IDC container" << idcErrContPtr);
   }
+  return cacheEntry;
+}
 
-  if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getTDAQModuleStatus(moduleHash)) { return false; }
+uint64_t PixelConditionsSummaryTool::getBSErrorWord(const IdentifierHash& moduleHash, const EventContext& ctx) const {
+  if (!m_useByteStream) { return 0; }
 
-  if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getModuleStatus(moduleHash)) { return false; }
+  std::lock_guard<std::mutex> lock{m_cacheMutex};
+  auto idcCachePtr = getCacheEntry(ctx)->IDCCache;
+  if (idcCachePtr==nullptr) {
+    ATH_MSG_ERROR("PixelConditionsSummaryTool No cache! " );
+  }
+  uint64_t word = (uint64_t)idcCachePtr->retrieve(moduleHash);
+  return word<m_missingErrorInfo ? word : 0;
+}
 
-  return true;
+bool PixelConditionsSummaryTool::hasBSError(const IdentifierHash& moduleHash) const {
+  const EventContext& ctx{Gaudi::Hive::currentContext()};
+  return hasBSError(moduleHash, ctx);
 }
 
-bool PixelConditionsSummaryTool::isActive(const IdentifierHash & moduleHash) const {
+bool PixelConditionsSummaryTool::hasBSError(const IdentifierHash& moduleHash, Identifier pixid) const {
+  const EventContext& ctx{Gaudi::Hive::currentContext()};
+  return hasBSError(moduleHash, pixid, ctx);
+}
 
-  if (m_useByteStream && !m_pixelBSErrorsSvc->isActive(moduleHash)) { return false; }
+bool PixelConditionsSummaryTool::hasBSError(const IdentifierHash& moduleHash, const EventContext& ctx) const {
+  if (!m_useByteStream) { return false; }
+  uint64_t word = getBSErrorWord(moduleHash,ctx);
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TimeOut))         { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::BCID))            { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LVL1ID))          { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Preamble))        { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Trailer))         { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Decoding))        { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Invalid))         { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LinkMaskedByPPC)) { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Limit))           { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TruncatedROB))    { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MaskedROB))       { return true; }
+
+  return false;
+}
 
-  if (m_useDCSState) {
-    bool isDCSActive = false;
-    std::string dcsState = m_DCSConditionsTool->PixelFSMState(moduleHash);
+bool PixelConditionsSummaryTool::hasBSError(const IdentifierHash& moduleHash, Identifier pixid, const EventContext& ctx) const {
+  if (!m_useByteStream) { return false; }
+
+  if (hasBSError(moduleHash, ctx)) { return true; }
+
+  int maxHash = m_pixelID->wafer_hash_max();
+  Identifier moduleID = m_pixelID->wafer_id(pixid);
+  int chFE = m_pixelCabling->getFE(&pixid,moduleID);
+
+  int indexFE = (1+chFE)*maxHash+(int)moduleHash;    // (FE_channel+1)*2048 + moduleHash
+  uint64_t word = getBSErrorWord(indexFE,ctx);
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TimeOut))         { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::BCID))            { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LVL1ID))          { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Preamble))        { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Trailer))         { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Decoding))        { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Invalid))         { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LinkMaskedByPPC)) { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Limit))           { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TruncatedROB))    { return true; }
+  if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MaskedROB))       { return true; }
+
+  return false;
+}
 
-    for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) {
-      if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; }
-    }
-    if (!isDCSActive) { return isDCSActive; }
-  }
+bool PixelConditionsSummaryTool::isActive(const Identifier& elementId, const InDetConditions::Hierarchy h) const {
+  const EventContext& ctx{Gaudi::Hive::currentContext()};
+  return isActive(elementId, h, ctx);
+}
 
-  if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getTDAQModuleStatus(moduleHash)) { return false; }
+bool PixelConditionsSummaryTool::isActive(const IdentifierHash& moduleHash) const {
+  const EventContext& ctx{Gaudi::Hive::currentContext()};
+  return isActive(moduleHash, ctx);
+}
 
-  if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getModuleStatus(moduleHash)) { return false; }
+bool PixelConditionsSummaryTool::isActive(const IdentifierHash& moduleHash, const Identifier& elementId) const {
+  const EventContext& ctx{Gaudi::Hive::currentContext()};
+  return isActive(moduleHash, elementId, ctx);
+}
 
+bool PixelConditionsSummaryTool::isActive(const Identifier& /*elementId*/, const InDetConditions::Hierarchy /*h*/, const EventContext& /*ctx*/) const {
   return true;
 }
 
-bool PixelConditionsSummaryTool::isActive(const IdentifierHash & moduleHash, const Identifier & elementId) const{
+bool PixelConditionsSummaryTool::isActive(const IdentifierHash& moduleHash, const EventContext& ctx) const {
 
-  UNUSED_VARIABLE(elementId);
+  if (m_useByteStream && hasBSError(moduleHash, ctx)) { return false; }
 
-  if (m_useByteStream && !m_pixelBSErrorsSvc->isActive(moduleHash)) { return false; }
-
-  if (m_useDCSState) {
-    bool isDCSActive = false;
-    std::string dcsState = m_DCSConditionsTool->PixelFSMState(moduleHash);
-
-    for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) {
-      if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; }
-    }
-    if (!isDCSActive) { return isDCSActive; }
+  SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey,ctx);
+  bool isDCSActive = false;
+  for (unsigned int istate=0; istate<m_activeState.size(); istate++) {
+    if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; }
   }
+  if (!isDCSActive) { return false; }
 
-  if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getTDAQModuleStatus(moduleHash)) { return false; }
+  if (!m_condTDAQKey.empty() && SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey,ctx)->getModuleStatus(moduleHash)) { return false; }
 
-  if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getModuleStatus(moduleHash)) { return false; }
+  if (SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey,ctx)->getModuleStatus(moduleHash)) { return false; }
 
   return true;
 }
 
-double PixelConditionsSummaryTool::activeFraction(const IdentifierHash & moduleHash, const Identifier & idStart, const Identifier & idEnd) const {
+bool PixelConditionsSummaryTool::isActive(const IdentifierHash& moduleHash, const Identifier& elementId, const EventContext& ctx) const {
 
-  UNUSED_VARIABLE(idStart);
-  UNUSED_VARIABLE(idEnd);
+  if (m_useByteStream && hasBSError(moduleHash, ctx)) { return false; }
 
-  if (m_useByteStream && !m_pixelBSErrorsSvc->isActive(moduleHash)) { return 0.; }
+  SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey,ctx);
+  bool isDCSActive = false;
+  for (unsigned int istate=0; istate<m_activeState.size(); istate++) {
+    if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; }
+  }
+  if (!isDCSActive) { return false; }
 
-  if (m_useDCSState) {
-    bool isDCSActive = false;
-    std::string dcsState = m_DCSConditionsTool->PixelFSMState(moduleHash);
+  if (!m_condTDAQKey.empty() && SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey,ctx)->getModuleStatus(moduleHash)) { return false; }
 
-    for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) {
-      if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; }
-    }
-    if (!isDCSActive) { return 0.; }
-  }
+  if (SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey,ctx)->getModuleStatus(moduleHash)) { return false; }
 
-  if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getTDAQModuleStatus(moduleHash)) { return 0.0; }
+  return checkChipStatus(moduleHash, elementId);
+}
 
-  if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getModuleStatus(moduleHash)) { return 0.0; }
+double PixelConditionsSummaryTool::activeFraction(const IdentifierHash & /*moduleHash*/, const Identifier & /*idStart*/, const Identifier & /*idEnd*/) const {
+  return 1.0;
+}
+
+double PixelConditionsSummaryTool::activeFraction(const IdentifierHash & /*moduleHash*/, const Identifier & /*idStart*/, const Identifier & /*idEnd*/, const EventContext& /*ctx*/) const {
+  return 1.0;
+}
 
-  // TODO!!!  Calculate active fraction from dead map.
-  
-  return 1.;
+bool PixelConditionsSummaryTool::isGood(const IdentifierHash & moduleHash) const {
+  const EventContext& ctx{Gaudi::Hive::currentContext()};
+  return isGood(moduleHash, ctx);
 }
 
-bool PixelConditionsSummaryTool::isGood(const Identifier & elementId, const InDetConditions::Hierarchy h)const{
+bool PixelConditionsSummaryTool::isGood(const Identifier& elementId, const InDetConditions::Hierarchy h) const {
+  const EventContext& ctx{Gaudi::Hive::currentContext()};
+  return isGood(elementId, h, ctx);
+}
 
-  UNUSED_VARIABLE(h);
+bool PixelConditionsSummaryTool::isGood(const IdentifierHash & moduleHash, const Identifier &elementId) const {
+  const EventContext& ctx{Gaudi::Hive::currentContext()};
+  return isGood(moduleHash, elementId, ctx);
+}
 
+bool PixelConditionsSummaryTool::isGood(const Identifier& elementId, const InDetConditions::Hierarchy h, const EventContext& ctx) const {
   Identifier moduleID       = m_pixelID->wafer_id(elementId);
   IdentifierHash moduleHash = m_pixelID->wafer_hash(moduleID);
 
-  if (m_useByteStream && !m_pixelBSErrorsSvc->isGood(moduleHash)) { return false; }
+  if (m_useByteStream && hasBSError(moduleHash, ctx)) { return false; }
 
-  if (m_useDCSState) {
-    bool isDCSActive = false;
-    std::string dcsState = m_DCSConditionsTool->PixelFSMState(moduleHash);
-    bool isDCSGood = false;
-    std::string dcsStatus = m_DCSConditionsTool->PixelFSMStatus(moduleHash);
+  SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey, ctx);
+  bool isDCSActive = false;
+  for (unsigned int istate=0; istate<m_activeState.size(); istate++) {
+    if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; }
+  }
+  if (!isDCSActive) { return false; }
 
-    for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) {
-      if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; }
-    }
-    for (unsigned int istatus=0; istatus<m_isActiveStatus.size(); istatus++) {
-      if (m_isActiveStatus[istatus]==dcsStatus) { isDCSGood=true; }
-    }
-    if (!(isDCSActive && isDCSGood)) { return false; }
+  SG::ReadCondHandle<PixelDCSStatusData> dcsstatus_data(m_condDCSStatusKey, ctx);
+  bool isDCSGood = false;
+  for (unsigned int istatus=0; istatus<m_activeStatus.size(); istatus++) {
+    if (m_activeStatus[istatus]==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; }
   }
+  if (!isDCSGood) { return false; }
 
-  if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getTDAQModuleStatus(moduleHash)) { return false; }
+  if (!m_condTDAQKey.empty() && SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey,ctx)->getModuleStatus(moduleHash)) { return false; }
 
-  if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getModuleStatus(moduleHash)) { return false; }
+  if (SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey, ctx)->getModuleStatus(moduleHash)) { return false; }
+
+  if (h==InDetConditions::PIXEL_CHIP) {
+    if (!checkChipStatus(moduleHash, elementId)) { return false; }
+    if (m_useByteStream && hasBSError(moduleHash, elementId, ctx)) { return false; }
+  }
 
   return true;
 }
 
-bool PixelConditionsSummaryTool::isGood(const IdentifierHash & moduleHash) const {
+bool PixelConditionsSummaryTool::isGood(const IdentifierHash& moduleHash, const EventContext& ctx) const {
 
-  if (m_useByteStream && !m_pixelBSErrorsSvc->isGood(moduleHash)) { return false; }
+  if (m_useByteStream && hasBSError(moduleHash, ctx)) { return false; }
 
-  if (m_useDCSState) {
-    bool isDCSActive = false;
-    std::string dcsState = m_DCSConditionsTool->PixelFSMState(moduleHash);
-    bool isDCSGood = false;
-    std::string dcsStatus = m_DCSConditionsTool->PixelFSMStatus(moduleHash);
+  SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey, ctx);
+  bool isDCSActive = false;
+  for (unsigned int istate=0; istate<m_activeState.size(); istate++) {
+    if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; }
+  }
+  if (!isDCSActive) { return false; }
 
-    for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) {
-      if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; }
-    }
-    for (unsigned int istatus=0; istatus<m_isActiveStatus.size(); istatus++) {
-      if (m_isActiveStatus[istatus]==dcsStatus) { isDCSGood=true; }
-    }
-    if (!(isDCSActive && isDCSGood)) { return false; }
+  SG::ReadCondHandle<PixelDCSStatusData> dcsstatus_data(m_condDCSStatusKey, ctx);
+  bool isDCSGood = false;
+  for (unsigned int istatus=0; istatus<m_activeStatus.size(); istatus++) {
+    if (m_activeStatus[istatus]==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; }
   }
+  if (!isDCSGood) { return false; }
 
-  if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getTDAQModuleStatus(moduleHash)) { return false; }
+  if (!m_condTDAQKey.empty() && SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey,ctx)->getModuleStatus(moduleHash)) { return false; }
 
-  if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getModuleStatus(moduleHash)) { return false; }
+  if (SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey, ctx)->getModuleStatus(moduleHash)) { return false; }
 
   return true;
 }
 
-bool PixelConditionsSummaryTool::isGood(const IdentifierHash & moduleHash, const Identifier & elementId) const {
+bool PixelConditionsSummaryTool::isGood(const IdentifierHash & moduleHash, const Identifier &elementId, const EventContext& ctx) const {
 
-  UNUSED_VARIABLE(elementId);
+  if (m_useByteStream && hasBSError(moduleHash, ctx)) { return false; }
 
-  if (m_useByteStream && !m_pixelBSErrorsSvc->isGood(moduleHash)) { return false; }
-
-  if (m_useDCSState) {
-    bool isDCSActive = false;
-    std::string dcsState = m_DCSConditionsTool->PixelFSMState(moduleHash);
-    bool isDCSGood = false;
-    std::string dcsStatus = m_DCSConditionsTool->PixelFSMStatus(moduleHash);
+  SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey, ctx);
+  bool isDCSActive = false;
+  for (unsigned int istate=0; istate<m_activeState.size(); istate++) {
+    if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; }
+  }
+  if (!isDCSActive) { return false; }
 
-    for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) {
-      if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; }
-    }
-    for (unsigned int istatus=0; istatus<m_isActiveStatus.size(); istatus++) {
-      if (m_isActiveStatus[istatus]==dcsStatus) { isDCSGood=true; }
-    }
-    if (!(isDCSActive && isDCSGood)) { return false; }
+  SG::ReadCondHandle<PixelDCSStatusData> dcsstatus_data(m_condDCSStatusKey, ctx);
+  bool isDCSGood = false;
+  for (unsigned int istatus=0; istatus<m_activeStatus.size(); istatus++) {
+    if (m_activeStatus[istatus]==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; }
   }
+  if (!isDCSGood) { return false; }
 
-  if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getTDAQModuleStatus(moduleHash)) { return false; }
+  if (!m_condTDAQKey.empty() && SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey,ctx)->getModuleStatus(moduleHash)) { return false; }
 
-  if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getModuleStatus(moduleHash)) { return false; }
+  if (SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey, ctx)->getModuleStatus(moduleHash)) { return false; }
+
+  if (!checkChipStatus(moduleHash, elementId)) { return false; }
+
+  if (m_useByteStream && hasBSError(moduleHash, elementId, ctx)) { return false; }
 
   return true;
 }
 
-double PixelConditionsSummaryTool::goodFraction(const IdentifierHash & moduleHash, const Identifier & idStart, const Identifier & idEnd) const {
+bool PixelConditionsSummaryTool::checkChipStatus(IdentifierHash moduleHash, Identifier pixid) const {
+  const EventContext& ctx{Gaudi::Hive::currentContext()};
+  return checkChipStatus(moduleHash, pixid, ctx);
+}
 
-  UNUSED_VARIABLE(idStart);
-  UNUSED_VARIABLE(idEnd);
+double PixelConditionsSummaryTool::goodFraction(const IdentifierHash & moduleHash, const Identifier & idStart, const Identifier & idEnd) const {
+  const EventContext& ctx{Gaudi::Hive::currentContext()};
+  return goodFraction(moduleHash, idStart, idEnd, ctx);
+}
 
-  if (m_useByteStream && !m_pixelBSErrorsSvc->isGood(moduleHash)) { return 0.; }
+double PixelConditionsSummaryTool::goodFraction(const IdentifierHash & moduleHash, const Identifier & idStart, const Identifier & idEnd, const EventContext& ctx) const {
 
-  if (m_useDCSState) {
-    bool isDCSActive = false;
-    std::string dcsState = m_DCSConditionsTool->PixelFSMState(moduleHash);
-    bool isDCSGood = false;
-    std::string dcsStatus = m_DCSConditionsTool->PixelFSMStatus(moduleHash);
+  if (!isGood(moduleHash, ctx)) { return 0.0; }
 
-    for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) {
-      if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; }
-    }
-    for (unsigned int istatus=0; istatus<m_isActiveStatus.size(); istatus++) {
-      if (m_isActiveStatus[istatus]==dcsStatus) { isDCSGood=true; }
-    }
-    if (!(isDCSActive && isDCSGood)) { return 0.; }
-  }
+  Identifier moduleID = m_pixelID->wafer_id(moduleHash);
 
-  if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getTDAQModuleStatus(moduleHash)) { return 0.0; }
+  int phiStart = m_pixelID->phi_index(idStart);
+  int etaStart = m_pixelID->eta_index(idStart);
 
-  if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condKey)->getModuleStatus(moduleHash)) { return 0.0; }
+  int phiEnd = m_pixelID->phi_index(idEnd);
+  int etaEnd = m_pixelID->eta_index(idEnd);
 
-  // TODO!!!  Calculate active fraction from dead map.
+  double nTotal = (std::abs(phiStart-phiEnd)+1.0)*(std::abs(etaStart-etaEnd)+1.0);
 
-  return 1.0;
+  double nGood = 0.0;
+  for (int i=std::min(phiStart,phiEnd); i<=std::max(phiStart,phiEnd); i++) {
+    for (int j=std::min(etaStart,etaEnd); j<=std::max(etaStart,etaEnd); j++) {
+      if (checkChipStatus(moduleHash, m_pixelID->pixel_id(moduleID,i,j), ctx)) { 
+        if (m_useByteStream) {
+          if (!hasBSError(moduleHash, m_pixelID->pixel_id(moduleID,i,j), ctx)) { nGood++; }
+        }
+        else {
+          nGood++; 
+        }
+      }
+    }
+  }
+  return nGood/nTotal;
 }
 
-#endif // not SIMULATIONBASE
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
index 01211b6388bd..074285b1c74d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
@@ -8,7 +8,6 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 
 from TrigEgammaHypo.TrigEgammaFastCaloHypoTool import TrigEgammaFastCaloHypoToolFromDict
 from TrigEgammaHypo.TrigEgammaFastPhotonHypoTool import TrigEgammaFastPhotonHypoToolFromDict
-from TrigEDMConfig.TriggerEDMRun3 import recordable
 
 import pprint
 from AthenaCommon.Logging import logging
-- 
GitLab


From 59dda440e41334ef46c0824ffd8cc44dcc0e7b5c Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 11 Sep 2020 09:05:02 +0100
Subject: [PATCH 129/422] Removedd MessageSvc and JO SVc from defaults, fixed
 ISF test

---
 Control/AthenaConfiguration/python/ComponentAccumulator.py | 2 +-
 Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py
index 9a7c3d78d52a..38ca24ddc65b 100644
--- a/Control/AthenaConfiguration/python/ComponentAccumulator.py
+++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py
@@ -24,7 +24,7 @@ from AthenaConfiguration.UnifyProperties import unifySet
 
 class ConfigurationError(RuntimeError):
     pass
-_basicServicesToCreate=('MessageSvc','JobOptionsSvc','CoreDumpSvc','GeoModelSvc','DetDescrCnvSvc')
+_basicServicesToCreate=('CoreDumpSvc','GeoModelSvc','DetDescrCnvSvc')
 _basicServicesToCreateOrder=_basicServicesToCreate
 
 
diff --git a/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py b/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py
index fa38e4d8acb5..441273c0e642 100644
--- a/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py
+++ b/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py
@@ -157,7 +157,7 @@ if __name__ == '__main__':
     eventSelector.InitialTimeStamp = myInitialTimeStamp # Necessary to avoid a crash
     if hasattr(eventSelector, "OverrideRunNumberFromInput"):
         eventSelector.OverrideRunNumberFromInput = True
-    cfg.addService(evtIdModifierSvc)
+    cfg.addService(evtIdModifierSvc, create=True)
     # ... up to here?
 
     # add BeamEffectsAlg
-- 
GitLab


From f0f5401bc7ef00877d0e5468ecadaa58623b7c43 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 11 Sep 2020 10:50:41 +0200
Subject: [PATCH 130/422] fillSynchHistogram as member function

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  1 +
 .../src/AFPSiLayerAlgorithm.cxx               | 59 +++++++++----------
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index f88a1b12ed92..54bb9b28006b 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -28,6 +28,7 @@ private:
 	std::map<std::string,int> m_TrackGroup; 
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
 	SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
+	void fillSynchHistograms(const EventContext& ctx, int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPCluster& cluster, std::map<std::string,int> &mapa);
 
 protected:
 	std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 097fbad52df3..94aa1c63681e 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -55,34 +55,7 @@
 		return std::find_if(arr.begin(),arr.end(),[&bcid](const int& ele){return ele==bcid;})!= arr.end();
 	}
 	
-	void fillSynchHistograms(int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, auto &cluster, std::map<std::string,int> &mapa)
-	{
-		using namespace Monitored;
-		if(lbA > previouslbStationA && previouslbStationA != 0)
-		{
-			for(int i = 0; i < 4; i++)
-			{
-				clustersPerStationA = clusterCounterStationA[previouslbStationA][i]*1.0;
-				if(muPerBCIDA != 0)
-				{
-					clustersPerStationA = clustersPerStationA/(muPerBCIDA*counterForEventsStationA*4);
-				}
-				else{clustersPerStationA = -0.1;}
-
-				fill(m_tools[mapa.at(m_stationnames.at(i))], lbA, clustersPerStationA);
-			}
-			previouslbStationA=lbA;
-			++clusterCounterStationA[lbA][cluster.station];
-			counterForEventsStationA=1;
-		}
-		else if (clusterCounterStationA[lbA][cluster.station] == 0)
-		{
-			++clusterCounterStationA[lbA][cluster.station];
-			previouslbStationA = lbA;
-		}
-		else if (lbA==previouslbStationA)
-		{++clusterCounterStationA[lbA][cluster.station];}
-	}
+	//void fillSynchHistograms(int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, auto &cluster, std::map<std::string,int> &mapa);
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
@@ -202,7 +175,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	ATH_CHECK( afpHitContainer.initialize() );
 
 	nSiHits = afpHitContainer->size();
-	//hitsPerPlane = afpHitContainer->size();
 	fill("AFPSiLayerTool", lb, nSiHits);
 
 
@@ -235,7 +207,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackY, trackX);
 	}
 
-// Clusters:
+	// Clusters:
 
 	for(const auto& cluster : fast.clusters()) 
 	{
@@ -556,4 +528,31 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	return StatusCode::SUCCESS;
 } // end of fillHistograms
 
+void AFPSiLayerAlgorithm::fillSynchHistograms(const EventContext& ctx, int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPCluster& cluster, std::map<std::string,int> &mapa)
+{
+	if(lbA > previouslbStationA && previouslbStationA != 0)
+	{
+		for(int i = 0; i < 4; i++)
+		{
+			clustersPerStationA = clusterCounterStationA[previouslbStationA][i]*1.0;
+			if(muPerBCIDA != 0)
+			{
+				clustersPerStationA = clustersPerStationA/(muPerBCIDA*counterForEventsStationA*4);
+			}
+			else{clustersPerStationA = -0.1;}
+
+			fill(m_tools[mapa.at(m_stationnames.at(i))], lbA, clustersPerStationA);
+		}
+		previouslbStationA=lbA;
+		++clusterCounterStationA[lbA][cluster.station];
+		counterForEventsStationA=1;
+	}
+	else if (clusterCounterStationA[lbA][cluster.station] == 0)
+	{
+		++clusterCounterStationA[lbA][cluster.station];
+		previouslbStationA = lbA;
+	}
+	else if (lbA==previouslbStationA)
+	{++clusterCounterStationA[lbA][cluster.station];}
+}
 
-- 
GitLab


From 1ddc608be49f526a2c2a3242ca097cf41d54a0a2 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 11 Sep 2020 12:32:20 +0200
Subject: [PATCH 131/422] Clusters as parameter - solved

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h              | 4 +++-
 .../AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx    | 9 +++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 54bb9b28006b..399759f7bf3a 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -11,6 +11,7 @@
 #include "xAODForward/AFPSiHitContainer.h"
 #include "xAODForward/AFPSiHit.h"
 #include "LumiBlockData/BunchCrossingCondData.h"
+#include <Run3AFPMonitoring/AFPFastReco.h>
 
 #include "TRandom3.h"
 
@@ -28,7 +29,8 @@ private:
 	std::map<std::string,int> m_TrackGroup; 
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
 	SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
-	void fillSynchHistograms(const EventContext& ctx, int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPCluster& cluster, std::map<std::string,int> &mapa);
+	
+	void fillSynchHistograms(int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster) const;
 
 protected:
 	std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 94aa1c63681e..faf16e2d9ac6 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -8,7 +8,6 @@
 */
 
 #include "Run3AFPMonitoring/AFPSiLayerAlgorithm.h"
-#include <Run3AFPMonitoring/AFPFastReco.h>
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPStationID.h"
 #include "EventInfo/EventID.h"
@@ -285,7 +284,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		else if (lb==previouslbStation)
 		{++clusterCounterStation[lb][cluster.station];}
 		*/
-		fillSynchHistograms(lb, previouslbStation, clustersPerStation, clusterCounterStation, counterForEventsStation, muPerBCID, cluster, m_TrackGroup);
+		fillSynchHistograms(lb, previouslbStation, clustersPerStation, clusterCounterStation, counterForEventsStation, muPerBCID, cluster);
+		//void fillSynchHistograms(int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster, std::map<std::string,int> &mapa)
 		
 	}
 	// ========== Front Station ==========
@@ -528,8 +528,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	return StatusCode::SUCCESS;
 } // end of fillHistograms
 
-void AFPSiLayerAlgorithm::fillSynchHistograms(const EventContext& ctx, int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPCluster& cluster, std::map<std::string,int> &mapa)
+void AFPSiLayerAlgorithm::fillSynchHistograms(int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster) const
 {
+	//using namespace Monitored;
 	if(lbA > previouslbStationA && previouslbStationA != 0)
 	{
 		for(int i = 0; i < 4; i++)
@@ -541,7 +542,7 @@ void AFPSiLayerAlgorithm::fillSynchHistograms(const EventContext& ctx, int &lbA,
 			}
 			else{clustersPerStationA = -0.1;}
 
-			fill(m_tools[mapa.at(m_stationnames.at(i))], lbA, clustersPerStationA);
+			fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lbA, clustersPerStationA);
 		}
 		previouslbStationA=lbA;
 		++clusterCounterStationA[lbA][cluster.station];
-- 
GitLab


From a74067cdcdca1ae5f958da562f85d8e1728453e6 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Fri, 11 Sep 2020 18:31:06 +0200
Subject: [PATCH 132/422] added instances for running the Tau RNN_eVeto
 algorithm

---
 .../tauRec/python/TauAlgorithmsHolder.py      |  50 ++++
 Reconstruction/tauRec/python/TauRecRunner.py  |   5 +
 .../tauRecTools/Root/TauJetRNNUtils.cxx       | 214 +++++++++++++++++-
 .../tauRecTools/tauRecTools/TauJetRNNUtils.h  |  24 ++
 4 files changed, 292 insertions(+), 1 deletion(-)

diff --git a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
index 9e3316a7fac3..1f0fc51d2ae5 100644
--- a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
+++ b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
@@ -918,6 +918,56 @@ def getTauIDVarCalculator():
     cached_instances[_name] = myTauIDVarCalculator
     return myTauIDVarCalculator
 
+def getTauEVetoRNNEvaluator(
+        NetworkFile1P="", NetworkFile3P="",
+        OutputVarname="RNNEVetoScore", MinChargedTracks=1, MaxTracks=10,
+        MaxClusters=6, MaxClusterDR=1.0, InputLayerScalar="scalar",
+        InputLayerTracks="tracks", InputLayerClusters="clusters",
+        OutputLayer="rnneveto_output", OutputNode="sig_prob"):
+
+    _name = sPrefix + "TauEVetoRNNEvaluator"
+    from tauRecTools.tauRecToolsConf import TauJetRNNEvaluator
+    tool = ROOT.TauJetRNNEvaluator(name=_name,
+                                   NetworkFile1P=NetworkFile1P,
+                                   NetworkFile3P=NetworkFile3P,
+                                   OutputVarname=OutputVarname,
+                                   MinChargedTracks=MinChargedTracks,
+                                   MaxTracks=MaxTracks,
+                                   MaxClusters=MaxClusters,
+                                   MaxClusterDR=MaxClusterDR,
+                                   InputLayerScalar=InputLayerScalar,
+                                   InputLayerTracks=InputLayerTracks,
+                                   InputLayerClusters=InputLayerClusters,
+                                   OutputLayer=OutputLayer,
+                                   OutputNode=OutputNode,
+                                   IncShowerSubtr = tauFlags.useShowerSubClusters())
+
+    cached_instances[_name] = tool
+    return tool
+
+def getTauWPDecoratorEVetoRNN():
+    import PyUtils.RootUtils as ru
+    ROOT = ru.import_root()
+    import cppyy
+    cppyy.loadDictionary('xAODTau_cDict')
+
+    _name = sPrefix + 'TauWPDecoratorEVetoRNN'
+    from tauRecTools.tauRecToolsConf import TauWPDecorator
+    myTauWPDecorator = TauWPDecorator( name=_name,
+                                       flatteningFile1Prong="rnneveto_mc16d_flat_1p.root",
+                                       flatteningFile3Prong="rnneveto_mc16d_flat_3p.root",
+                                       CutEnumVals =
+                                       [ ROOT.xAOD.TauJetParameters.EVetoRNNSigLoose,
+                                         ROOT.xAOD.TauJetParameters.EVetoRNNSigMedium, ROOT.xAOD.TauJetParameters.EVetoRNNSigTight ],
+                                       SigEff1P = [0.95, 0.90, 0.85],
+                                       SigEff3P = [0.98, 0.95, 0.90],
+                                       ScoreName = "RNNEVetoScore",
+                                       NewScoreName = "RNNEVetoScoreSigTrans",
+                                       DefineWPs = True,
+                                       )
+    cached_instances[_name] = myTauWPDecorator
+    return myTauWPDecorator
+              
 def getTauDecayModeNNClassifier():
     _name = sPrefix + 'TauDecayModeNNClassifier'
 
diff --git a/Reconstruction/tauRec/python/TauRecRunner.py b/Reconstruction/tauRec/python/TauRecRunner.py
index e5bfea25e940..e6c6f42b3d1f 100644
--- a/Reconstruction/tauRec/python/TauRecRunner.py
+++ b/Reconstruction/tauRec/python/TauRecRunner.py
@@ -125,6 +125,11 @@ class TauRecRunner ( TauRecRunConfigured ) :
                                                            weightsFile="EleBDT1PEnd23.root", minNTracks=1, minAbsTrackEta=2.0, 
                                                            maxAbsTrackEta=3.0, outputVarName="BDTEleScore")) #update config?
                 tools.append(taualgs.getTauWPDecoratorEleBDT())
+                tools.append(taualgs.getTauEVetoRNNEvaluator("TauEVetoRNN",
+                                                             NetworkFile1P="taueveto_rnn_mc16d_1p.json",
+                                                             NetworkFile3P="taueveto_rnn_mc16d_3p.json",
+                                                             OutputVarname="RNNEVetoScore", MaxTracks=10, MaxClusters=6))
+                tools.append(taualgs.getTauWPDecoratorEVetoRNN())
                 tools.append(taualgs.getTauDecayModeNNClassifier())
                 tools.append(taualgs.getTauEleOLRDecorator())              
             
diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index 685066fad69e..a7dc6eb05475 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -115,6 +115,19 @@ std::unique_ptr<VarCalc> get_default_calculator() {
     calc->insert("pt", Variables::pt);
     calc->insert("ptDetectorAxis", Variables::ptDetectorAxis);
     calc->insert("ptIntermediateAxis", Variables::ptIntermediateAxis);
+    //---added for the eVeto
+    calc->insert("ptJetSeed_log",              Variables::ptJetSeed_log  );
+    calc->insert("absleadTrackEta",            Variables::absleadTrackEta  );
+    calc->insert("leadTrackDeltaEta",          Variables::leadTrackDeltaEta);
+    calc->insert("leadTrackDeltaPhi",          Variables::leadTrackDeltaPhi);
+    calc->insert("EMFracFixed",                Variables::EMFracFixed      );
+    calc->insert("etHotShotWinOverPtLeadTrk",  Variables::etHotShotWinOverPtLeadTrk);
+    calc->insert("hadLeakFracFixed",           Variables::hadLeakFracFixed);
+    calc->insert("PSFrac",                     Variables::PSFrac);
+    calc->insert("ClustersMeanCenterLambda",   Variables::ClustersMeanCenterLambda  );
+    calc->insert("ClustersMeanFirstEngDens",   Variables::ClustersMeanFirstEngDens  );
+    calc->insert("ClustersMeanPresamplerFrac", Variables::ClustersMeanPresamplerFrac);
+    calc->insert("ClustersMeanSecondR",        Variables::ClustersMeanSecondR  );
 
     // Track variable calculator functions
     calc->insert("pt_log", Variables::Track::pt_log);
@@ -129,6 +142,7 @@ std::unique_ptr<VarCalc> get_default_calculator() {
     calc->insert("nIBLHitsAndExp", Variables::Track::nIBLHitsAndExp);
     calc->insert("nPixelHitsPlusDeadSensors", Variables::Track::nPixelHitsPlusDeadSensors);
     calc->insert("nSCTHitsPlusDeadSensors", Variables::Track::nSCTHitsPlusDeadSensors);
+    calc->insert("eProbabilityHT", Variables::Track::eProbabilityHT);
 
     // Cluster variable calculator functions
     calc->insert("et_log", Variables::Cluster::et_log);
@@ -138,7 +152,10 @@ std::unique_ptr<VarCalc> get_default_calculator() {
     calc->insert("SECOND_R", Variables::Cluster::SECOND_R);
     calc->insert("SECOND_LAMBDA", Variables::Cluster::SECOND_LAMBDA);
     calc->insert("CENTER_LAMBDA", Variables::Cluster::CENTER_LAMBDA);
-
+    //---added for the eVeto
+    calc->insert("SECOND_LAMBDAOverClustersMeanSecondLambda", Variables::Cluster::SECOND_LAMBDAOverClustersMeanSecondLambda);
+    calc->insert("CENTER_LAMBDAOverClustersMeanCenterLambda", Variables::Cluster::CENTER_LAMBDAOverClustersMeanCenterLambda);
+    calc->insert("FirstEngDensOverClustersMeanFirstEngDens" , Variables::Cluster::FirstEngDensOverClustersMeanFirstEngDens);
     return calc;
 }
 
@@ -242,6 +259,91 @@ bool ptIntermediateAxis(const xAOD::TauJet &tau, double &out) {
     return true;
 }
 
+bool ptJetSeed_log(const xAOD::TauJet &tau, double &out) {
+  out = TMath::Log10(std::max(tau.ptJetSeed()/*tau.auxdata<float>("trk_ptJetSeed")*/, 1e-3));// tau.ptJetSeed()
+  return true;
+}
+
+bool     absleadTrackEta(const xAOD::TauJet &tau, double &out){
+  out = std::max(0.f, tau.auxdata<float>("ABS_ETA_LEAD_TRACK"));
+  return true;
+}
+bool     leadTrackDeltaEta(const xAOD::TauJet &tau, double &out){
+  out = std::max(0.f, tau.auxdata<float>("TAU_ABSDELTAETA"));
+  return true;
+}
+bool     leadTrackDeltaPhi(const xAOD::TauJet &tau, double &out){
+  out = std::max(0.f, tau.auxdata<float>("TAU_ABSDELTAPHI"));
+  return true;
+}
+bool     EMFracFixed(const xAOD::TauJet &tau, double &out){
+  float emFracFized = tau.auxdata<float>("EMFracFixed");
+  out = std::max(emFracFized, 0.0f);
+  return true;
+}
+bool     etHotShotWinOverPtLeadTrk(const xAOD::TauJet &tau, double &out){
+  float etHotShotWinOverPtLeadTrk = tau.auxdata<float>("etHotShotWinOverPtLeadTrk");
+  out = std::max(etHotShotWinOverPtLeadTrk, 1e-6f);
+  out = std::log10(out);
+  return true;
+}
+
+bool     hadLeakFracFixed(const xAOD::TauJet &tau, double &out){
+  float hadLeakFracFixed = tau.auxdata<float>("hadLeakFracFixed");
+  out = std::max(0.f, hadLeakFracFixed);
+  return true;
+}
+
+bool     PSFrac(const xAOD::TauJet &tau, double &out){
+  float PSFrac;
+  const auto success = tau.detail(TauDetail::PSSFraction, PSFrac);
+  out = std::max(0.f,PSFrac);
+  
+  return success;
+}
+bool     ClustersMeanCenterLambda(const xAOD::TauJet &tau, double &out){
+  float ClustersMeanCenterLambda;
+  const auto success = tau.detail(TauDetail::ClustersMeanCenterLambda, ClustersMeanCenterLambda);
+  out = std::max(0.f, ClustersMeanCenterLambda);
+
+  return success;
+}
+bool     ClustersMeanEMProbability(const xAOD::TauJet &tau, double &out){
+  float ClustersMeanEMProbability;
+  const auto success = tau.detail(TauDetail::ClustersMeanEMProbability, ClustersMeanEMProbability);
+  out = std::max(0.f, ClustersMeanEMProbability);
+  return success;
+}
+bool     ClustersMeanFirstEngDens(const xAOD::TauJet &tau, double &out){
+  float ClustersMeanFirstEngDens;
+  const auto success = tau.detail(TauDetail::ClustersMeanFirstEngDens, ClustersMeanFirstEngDens);
+  out =  std::max(-10.f, ClustersMeanFirstEngDens);
+  return success;
+}
+bool     ClustersMeanPresamplerFrac(const xAOD::TauJet &tau, double &out){
+  float ClustersMeanPresamplerFrac;
+  const auto success = tau.detail(TauDetail::ClustersMeanPresamplerFrac, ClustersMeanPresamplerFrac);
+  out = ClustersMeanPresamplerFrac;
+
+  if (std::isnan(std::abs(out))){
+	out = 0.;
+  }
+  out = std::max(0., out);
+
+  return success;
+}
+bool     ClustersMeanSecondLambda(const xAOD::TauJet &tau, double &out){
+  float ClustersMeanSecondLambda;
+  const auto success = tau.detail(TauDetail::ClustersMeanSecondLambda, ClustersMeanSecondLambda);
+  out = std::max(0.f, ClustersMeanSecondLambda);
+
+  return success;
+}
+bool     ClustersMeanSecondR(const xAOD::TauJet &tau, double &out){
+  float clustersMeanSecondR = tau.auxdata<float>("ClustersMeanSecondR");
+  out = std::max(0.f, clustersMeanSecondR);
+  return true;
+}
 
 namespace Track {
 
@@ -334,6 +436,16 @@ bool nSCTHitsPlusDeadSensors(const xAOD::TauJet& /*tau*/, const xAOD::TauTrack &
     return success1 && success2;
 }
 
+bool eProbabilityHT(const xAOD::TauJet& /*tau*/, const xAOD::TauTrack &track,
+			     double &out) {
+
+    double tracksEProbabilityHT;
+    const auto success =  track->summaryValue( tracksEProbabilityHT, 
+					       xAOD::eProbabilityHT);
+    out = tracksEProbabilityHT;
+    return success;
+}
+
 } // namespace Track
 
 
@@ -385,6 +497,106 @@ bool CENTER_LAMBDA(const xAOD::TauJet& /*tau*/, const xAOD::CaloCluster &cluster
     return success;
 }
 
+bool SECOND_LAMBDAOverClustersMeanSecondLambda   (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out){
+  (void)tau;
+  float ClustersMeanSecondLambda = tau.auxdata<float>("ClustersMeanSecondLambda");
+
+  double secondLambda(0);
+  const auto success = cluster.retrieveMoment(MomentType::SECOND_LAMBDA, secondLambda);
+
+  out = secondLambda/ClustersMeanSecondLambda;
+
+  return success;
+}
+
+bool CENTER_LAMBDAOverClustersMeanCenterLambda   (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out){
+  (void)tau;
+  float ClustersMeanCenterLambda = tau.auxdata<float>("ClustersMeanCenterLambda");
+
+  double centerLambda(0);
+  const auto success = cluster.retrieveMoment(MomentType::CENTER_LAMBDA, centerLambda);
+  if (ClustersMeanCenterLambda == 0.){
+    out = 250.;
+  }else {
+    out = centerLambda/ClustersMeanCenterLambda;
+  }
+
+  if (std::isnan(std::abs(out))){
+    out = 0.;
+  }
+  if (std::isinf(out)){
+    out = 250.;
+  }
+  out = std::min(out, 250.);
+
+  return success;
+}
+
+
+bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out){
+  const xAOD::Jet *jet_seed = (*tau.jetLink());
+  if (!jet_seed) {
+    return false;
+  }
+
+  std::size_t nClustersTotal = 0;
+  std::vector<const xAOD::CaloCluster *> clusters;
+
+  xAOD::JetConstituentVector jcv = jet_seed->getConstituents();
+  xAOD::JetConstituentVector::const_iterator it = jcv.begin();
+  xAOD::JetConstituentVector::const_iterator it_end = jcv.end();
+  for (; it != it_end; ++it) {
+    auto cl = dynamic_cast<const xAOD::CaloCluster *>((*it)->rawConstituent());
+    if (!cl) {
+	return false;
+    }
+    clusters.push_back(cl);
+    ++nClustersTotal;
+  }
+
+  // Number of tracks to save
+  std::size_t nClustersSave = nClustersTotal;
+  size_t      n_clusterMax(6);
+  if (n_clusterMax > 0) {
+    nClustersSave = std::min(static_cast<std::size_t>(n_clusterMax),
+			       nClustersTotal);
+  }
+  // Sort clusters in descending et order
+  auto et_cmp = [](const xAOD::CaloCluster *lhs,
+		     const xAOD::CaloCluster *rhs) {
+    return lhs->et() > rhs->et();
+  };
+  std::sort(clusters.begin(), clusters.end(), et_cmp);
+
+  TLorentzVector LC_P4;
+  LC_P4.SetPtEtaPhiM(tau.ptDetectorAxis(), tau.etaDetectorAxis(), tau.phiDetectorAxis(), tau.m());
+  
+  float clE(0.), Etot(0.);
+  using MomentType = xAOD::CaloCluster::MomentType;
+  for (std::size_t i = 0; i < nClustersSave; ++i) {
+    auto cls = clusters[i];
+
+    // gipezzul: 2019-09-16
+    //now evaluate the avarage values for: lambda, second lambda, EMProb, presamplerFrac
+    //DR selection from: https://gitlab.cern.ch/atlas/athena/blob/master/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx
+
+    TLorentzVector cluster_P4;
+    cluster_P4.SetPtEtaPhiM(1, cls->eta(), cls->phi(),0);
+    if(LC_P4.DeltaR(cluster_P4)>0.2)            continue;
+    clE = cls->calE();
+    Etot += clE;
+  }
+	
+  // the ClustersMeanFirstEngDens is the log10 of the energy weighted average of the First_ENG_DENS 
+  // divided by ETot to make it dimension-less, 
+  // so we need to evaluate the differance of log10(cluster_firstEngDens) and the ClustersMeanFirstEngDens
+  float min_FirstEng = 1e-10;
+  float cluster_FirstEngDens       = std::max(cluster.getMomentValue(MomentType::FIRST_ENG_DENS), (double)min_FirstEng);
+  out = TMath::Log10(cluster_FirstEngDens/std::max(Etot, min_FirstEng)) - tau.auxdata<float>("ClustersMeanFirstEngDens");
+  
+  return true;
+}
+
 } // namespace Cluster
 } // namespace Variables
 } // namespace TauJetRNNUtils
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h b/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h
index 74ef77af82fb..c9c846b1c8e3 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h
@@ -105,6 +105,23 @@ bool ptDetectorAxis(const xAOD::TauJet &tau, double &out);
 
 bool ptIntermediateAxis(const xAOD::TauJet &tau, double &out);
 
+//functions to calculate input variables needed for the eVeto RNN
+bool ptJetSeed_log             (const xAOD::TauJet &tau, double &out);
+bool absleadTrackEta           (const xAOD::TauJet &tau, double &out);
+bool leadTrackDeltaEta         (const xAOD::TauJet &tau, double &out);
+bool leadTrackDeltaPhi         (const xAOD::TauJet &tau, double &out);
+bool EMFracFixed               (const xAOD::TauJet &tau, double &out);
+bool etHotShotWinOverPtLeadTrk (const xAOD::TauJet &tau, double &out);
+bool hadLeakFracFixed          (const xAOD::TauJet &tau, double &out);
+bool PSFrac                    (const xAOD::TauJet &tau, double &out);
+bool ClustersMeanCenterLambda  (const xAOD::TauJet &tau, double &out);
+bool ClustersMeanEMProbability (const xAOD::TauJet &tau, double &out);
+bool ClustersMeanFirstEngDens  (const xAOD::TauJet &tau, double &out);
+bool ClustersMeanPresamplerFrac(const xAOD::TauJet &tau, double &out);
+bool ClustersMeanSecondLambda  (const xAOD::TauJet &tau, double &out);
+bool ClustersMeanSecondR       (const xAOD::TauJet &tau, double &out);
+bool EMPOverTrkSysP            (const xAOD::TauJet &tau, double &out);
+
 
 namespace Track {
 
@@ -148,6 +165,9 @@ bool nPixelHitsPlusDeadSensors (
 bool nSCTHitsPlusDeadSensors (
     const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out);
 
+bool eProbabilityHT(
+    const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out);
+
 } // namespace Track
 
 
@@ -177,6 +197,10 @@ bool SECOND_LAMBDA(
 bool CENTER_LAMBDA(
     const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out);
 
+bool SECOND_LAMBDAOverClustersMeanSecondLambda   (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out);
+bool CENTER_LAMBDAOverClustersMeanCenterLambda   (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out);
+bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out);
+
 } // namespace Cluster
 } // namespace Variables
 } // namespace TauJetRNNUtils
-- 
GitLab


From 84dcefbc12ce4b05b5915ed90ca93a52e2627c8f Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Mon, 14 Sep 2020 11:30:25 +0200
Subject: [PATCH 133/422] fixed typo

---
 Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index a7dc6eb05475..012f755c3dc5 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -440,8 +440,8 @@ bool eProbabilityHT(const xAOD::TauJet& /*tau*/, const xAOD::TauTrack &track,
 			     double &out) {
 
     double tracksEProbabilityHT;
-    const auto success =  track->summaryValue( tracksEProbabilityHT, 
-					       xAOD::eProbabilityHT);
+    const auto success =  track.track()->summaryValue( tracksEProbabilityHT, 
+						       xAOD::eProbabilityHT);
     out = tracksEProbabilityHT;
     return success;
 }
-- 
GitLab


From fe919a80268b1990206a5ec31d125a56cdd6bb95 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Mon, 14 Sep 2020 10:35:07 +0100
Subject: [PATCH 134/422] reduced output of the job

---
 Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py   | 2 --
 .../TriggerJobOpts/share/runHLT_standalone_newJO.py           | 4 ----
 2 files changed, 6 deletions(-)

diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
index 4df41c646d06..b8bb91cab328 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
@@ -513,9 +513,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
     InDetSCTRawDataProvider.isRoI_Seeded = True
     InDetSCTRawDataProvider.RoIs = roisKey
     InDetSCTRawDataProvider.RDOCacheKey = InDetCacheNames.SCTRDOCacheKey
-
     InDetSCTRawDataProvider.RegSelTool = RegSelTool_SCT
-    InDetSCTRawDataProvider.OutputLevel=DEBUG
     acc.addEventAlgo(InDetSCTRawDataProvider)
 
     # load the SCTEventFlagWriter
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py
index cc944684920a..a3964a1bcd42 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py
@@ -104,10 +104,6 @@ acc.foreach_component("*HLTTop/*Input*").OutputLevel = DEBUG # input makers
 acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = WARNING # messaging from the EDM creators
 acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING # silcence mon tools (addressing by type)
 
-acc.foreach_component("*HLTTop/*InDetPixelRawDataProvider_Electron*").OutputLevel = DEBUG 
-acc.foreach_component("*PixelByteStreamErrorsTool").OutputLevel = DEBUG 
-
-
 
 acc.printConfig(withDetails=False, summariseProps=True, printDefaults=True)
 
-- 
GitLab


From f9e8e82c5bbbf17fd7fc4bc1d8f4aeb98d604f78 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 14 Sep 2020 11:41:20 +0200
Subject: [PATCH 135/422] Stations written in separate function

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  3 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  1 +
 .../src/AFPSiLayerAlgorithm.cxx               | 77 ++++++++++++++-----
 3 files changed, 62 insertions(+), 19 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 399759f7bf3a..d58b43647fa3 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -30,7 +30,8 @@ private:
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
 	SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
 	
-	void fillSynchHistograms(int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster) const;
+	void fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster, char histogramType) const;
+	//void fillSynchHistogramsPlane(Monitored::Scalar<int> &lbA, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster) const;
 
 protected:
 	std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 32d34d7bae21..44bc0a106090 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -63,6 +63,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
     array.defineHistogram('trackY,trackX', title='Track in AFP station {0};x [mm];y [mm]', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
     array.defineHistogram('lb,clustersPerStation', title ='Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lbA,clustersPerStationA', title ='Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerStationFront', title ='(Front) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerStationEnd', title ='(End) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerStationMiddle', title ='(Middle) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index faf16e2d9ac6..cc948969efcc 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -135,8 +135,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
 	auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
 	
-	auto clustersPerStation = Monitored::Scalar<float>("clustersPerStation", 0.0);
-	auto clustersPerStationFront = Monitored::Scalar<float>("clustersPerStationFront", 0.0);
+	//auto clustersPerStation = Monitored::Scalar<float>("clustersPerStation", 0.0);
+	//auto clustersPerStationFront = Monitored::Scalar<float>("clustersPerStationFront", 0.0);
 	auto clustersPerStationEnd = Monitored::Scalar<float>("clustersPerStationEnd", 0.0);
 	auto clustersPerStationMiddle = Monitored::Scalar<float>("clustersPerStationMiddle", 0.0);
 
@@ -284,9 +284,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		else if (lb==previouslbStation)
 		{++clusterCounterStation[lb][cluster.station];}
 		*/
-		fillSynchHistograms(lb, previouslbStation, clustersPerStation, clusterCounterStation, counterForEventsStation, muPerBCID, cluster);
-		//void fillSynchHistograms(int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster, std::map<std::string,int> &mapa)
-		
+		fillSynchHistogramsStation(lb, previouslbStation, clusterCounterStation, counterForEventsStation, muPerBCID, cluster, 'S');
+	
 	}
 	// ========== Front Station ==========
 	if(isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
@@ -294,6 +293,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		for(const auto& cluster : fast.clusters()) 
 		{
 			lb = GetEventInfo(ctx)->lumiBlock();
+			/*
 			if(lb > previouslbStationFront && previouslbStationFront != 0)
 			{
 				for(int i=0; i<4; i++)
@@ -318,6 +318,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			}
 			else if (lb == previouslbStationFront)
 			{++clusterCounterStationFront[lb][cluster.station];}
+			*/
+			fillSynchHistogramsStation(lb, previouslbStationFront, clusterCounterStationFront, counterForEventsStationFront, muPerBCID, cluster, 'F');
 		}
 	}
 	// ..... end front station .....
@@ -328,6 +330,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		for(const auto& cluster : fast.clusters())
 		{
 			lb = GetEventInfo(ctx)->lumiBlock();
+			/*
 			if(lb > previouslbStationEnd && previouslbStationEnd != 0)
 			{
 				for(int i=0; i<4; i++)
@@ -352,6 +355,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			}
 			else if (lb == previouslbStationEnd)
 			{++clusterCounterStationEnd[lb][cluster.station];}
+			*/
+			fillSynchHistogramsStation(lb, previouslbStationEnd, clusterCounterStationEnd, counterForEventsStationEnd, muPerBCID, cluster, 'E');
 		}
 	}
 	// ..... end end station .....
@@ -361,6 +366,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	{
 		for(const auto& cluster : fast.clusters())
 		{
+		/*
 			if(lb > previouslbStationMiddle && previouslbStationMiddle != 0)
 			{
 				for(int i=0; i<4; i++)
@@ -385,6 +391,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			else if (lb == previouslbStationMiddle)
 			{++clusterCounterStationMiddle[lb][cluster.station];}
 			// ..... end middle station .....
+			*/
+			fillSynchHistogramsStation(lb, previouslbStationMiddle, clusterCounterStationMiddle, counterForEventsStationMiddle, muPerBCID, cluster, 'M');
 		}
 	}
 			// ..... end stations .....
@@ -528,32 +536,65 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	return StatusCode::SUCCESS;
 } // end of fillHistograms
 
-void AFPSiLayerAlgorithm::fillSynchHistograms(int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster) const
+void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster, char histogramType) const
 {
 	//using namespace Monitored;
-	if(lbA > previouslbStationA && previouslbStationA != 0)
+	
+	float clustersPerStationFloat = 0;
+	if(lb > previouslbStationA && previouslbStationA != 0)
 	{
 		for(int i = 0; i < 4; i++)
 		{
-			clustersPerStationA = clusterCounterStationA[previouslbStationA][i]*1.0;
+			clustersPerStationFloat = clusterCounterStationA[previouslbStationA][i]*1.0;
 			if(muPerBCIDA != 0)
 			{
-				clustersPerStationA = clustersPerStationA/(muPerBCIDA*counterForEventsStationA*4);
+				clustersPerStationFloat = clustersPerStationFloat/(muPerBCIDA*counterForEventsStationA*4);
 			}
-			else{clustersPerStationA = -0.1;}
+			else{clustersPerStationFloat = -0.1;}
 
-			fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lbA, clustersPerStationA);
+			if(histogramType == 'S')
+			{
+				auto clustersPerStation = Monitored::Scalar<float>("clustersPerStation", 0.0);
+				clustersPerStation = clustersPerStationFloat;
+				fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
+			}
+			else if (histogramType == 'F')
+			{
+				auto clustersPerStationFront = Monitored::Scalar<float>("clustersPerStationFront", 0.0);
+				clustersPerStationFront = clustersPerStationFloat;
+				fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationFront);
+			}
+			else if (histogramType == 'M')
+			{
+				auto clustersPerStationMiddle = Monitored::Scalar<float>("clustersPerStationMiddle", 0.0);
+				clustersPerStationMiddle = clustersPerStationFloat;
+				fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationMiddle);
+			}
+			else if (histogramType == 'E')
+			{
+				auto clustersPerStationEnd = Monitored::Scalar<float>("clustersPerStationEnd", 0.0);
+				clustersPerStationEnd = clustersPerStationFloat;
+				fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationEnd);
+			}
 		}
-		previouslbStationA=lbA;
-		++clusterCounterStationA[lbA][cluster.station];
+		previouslbStationA=lb;
+		++clusterCounterStationA[lb][cluster.station];
 		counterForEventsStationA=1;
 	}
-	else if (clusterCounterStationA[lbA][cluster.station] == 0)
+	else if (clusterCounterStationA[lb][cluster.station] == 0)
 	{
-		++clusterCounterStationA[lbA][cluster.station];
-		previouslbStationA = lbA;
+		++clusterCounterStationA[lb][cluster.station];
+		previouslbStationA = lb;
 	}
-	else if (lbA==previouslbStationA)
-	{++clusterCounterStationA[lbA][cluster.station];}
+	else if (lb==previouslbStationA)
+	{++clusterCounterStationA[lb][cluster.station];}
 }
 
+/*
+void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster) const
+{
+
+
+}
+*/
+
-- 
GitLab


From e5801845db89f3692b0ffad93dfff2092c4059cb Mon Sep 17 00:00:00 2001
From: Jannik Geisen <jannik.geisen@cern.ch>
Date: Mon, 14 Sep 2020 14:03:04 +0200
Subject: [PATCH 136/422] using already existing triggerChainString variable

---
 .../Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h   | 1 -
 .../Jet/JetMonitoring/src/JetMonitoringAlg.cxx           | 9 ++++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
index edb66f08da98..bab697afa22e 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
@@ -39,7 +39,6 @@ private:
   ToolHandleArray<IJetHistoFiller> m_jetFillerTools;
 
   bool m_failureOnMissingContainer;
-  Gaudi::Property<std::string> m_triggerChain {this,"TriggerChain", ""};
   
 };
 #endif
diff --git a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
index f50a7fedf01d..b9d0a9085ee3 100644
--- a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
+++ b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
@@ -38,12 +38,11 @@ StatusCode JetMonitoringAlg::initialize() {
 
 
 StatusCode JetMonitoringAlg::fillHistograms( const EventContext& ctx ) const {
-
-  if (isPassed(m_triggerChain)) { //trigger was fired - retrieve only jets passing the chain
-    ATH_MSG_DEBUG("JetMonitoringAlg::fillHistograms(const EventContext&) -> if (isPassed("<<m_triggerChain<<")) was passed!");
+  if (m_triggerChainString != "") {
+    ATH_MSG_DEBUG("JetMonitoringAlg::fillHistograms(const EventContext&) -> enter triggerChainString = "<<m_triggerChainString);
    
     ConstDataVector< xAOD::JetContainer > tmpCont(SG::VIEW_ELEMENTS);
-    const std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > fc = getTrigDecisionTool()->features<xAOD::JetContainer>( m_triggerChain );
+    const std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > fc = getTrigDecisionTool()->features<xAOD::JetContainer>( m_triggerChainString );
     for(const auto& jetLinkInfo : fc) {
       if (!jetLinkInfo.isValid()) {
         ATH_MSG_ERROR("Invalid ElementLink to online jet");
@@ -55,7 +54,7 @@ StatusCode JetMonitoringAlg::fillHistograms( const EventContext& ctx ) const {
     }
     const xAOD::JetContainer * trigJetsCont = tmpCont.asDataVector();
     if (trigJetsCont->empty()) {
-      ATH_MSG_WARNING("Empty trigger jet container for chain "<<m_triggerChain);
+      ATH_MSG_WARNING("Empty trigger jet container for chain "<<m_triggerChainString);
       return StatusCode::SUCCESS;
     }
     for(const auto& t: m_jetFillerTools){
-- 
GitLab


From fdf760c72f048527255ad4ca4089146d5c6a9d55 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 14 Sep 2020 14:17:42 +0200
Subject: [PATCH 137/422] Planes written in separate functions

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |   4 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py  |   4 +-
 .../src/AFPSiLayerAlgorithm.cxx               | 343 ++++--------------
 3 files changed, 83 insertions(+), 268 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index d58b43647fa3..dea0a27d470a 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -30,8 +30,8 @@ private:
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
 	SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
 	
-	void fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster, char histogramType) const;
-	//void fillSynchHistogramsPlane(Monitored::Scalar<int> &lbA, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster) const;
+	void fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCID, const AFPMon::AFPCluster& cluster, char histogramType) const;
+	void fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbPlane, std::vector<std::vector<std::vector<unsigned int>>> &clusterCounterPlane, unsigned int &counterForEventsPlane, float &muPerBCID, const AFPMon::AFPCluster& cluster, char histogramType) const;
 
 protected:
 	std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 44bc0a106090..73f0c0c6fae4 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -57,13 +57,11 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    #array.defineHistogram('lb,clustersPerPlane2', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clustersPerEvent / <mu>', type='TProfile', path='clustersPerPlane2', xbins=1000, xmin=-0.5, xmax=999.5)
 
 
     array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
     array.defineHistogram('trackY,trackX', title='Track in AFP station {0};x [mm];y [mm]', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
     array.defineHistogram('lb,clustersPerStation', title ='Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lbA,clustersPerStationA', title ='Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerStationFront', title ='(Front) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerStationEnd', title ='(End) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerStationMiddle', title ='(Middle) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
@@ -118,6 +116,6 @@ if __name__=='__main__':
     from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
     cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
-    cfg.run(1000)
+    cfg.run(3000)
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index cc948969efcc..69bfea46dfac 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -129,16 +129,15 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	auto weight = Monitored::Scalar<float>("weight", 1.0);
 
 	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
-	auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 1.0);
-	auto clustersPerPlane2 = Monitored::Scalar<float>("clustersPerPlane2", 0.0);
-	auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
-	auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
-	auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
+	//auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 0.0);
+	//auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
+	//auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
+	//auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
 	
 	//auto clustersPerStation = Monitored::Scalar<float>("clustersPerStation", 0.0);
 	//auto clustersPerStationFront = Monitored::Scalar<float>("clustersPerStationFront", 0.0);
-	auto clustersPerStationEnd = Monitored::Scalar<float>("clustersPerStationEnd", 0.0);
-	auto clustersPerStationMiddle = Monitored::Scalar<float>("clustersPerStationMiddle", 0.0);
+	//auto clustersPerStationEnd = Monitored::Scalar<float>("clustersPerStationEnd", 0.0);
+	//auto clustersPerStationMiddle = Monitored::Scalar<float>("clustersPerStationMiddle", 0.0);
 
 	auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
 	auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
@@ -214,43 +213,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		clusterY = cluster.y;
 		fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX); 
 		lb = GetEventInfo(ctx)->lumiBlock();
-		
-		// Time for fill - current and previous lb are different, and the previouslb is not -1 (it means - this is not the first lb)
-		if(lb > previouslb && previouslb != 0)
-		{
-			for(int i=0; i<4; i++)
-			{
-				for(int j=0; j<4; j++)
-				{
-					clustersPerPlane = clusterCounter[previouslb][i][j]*1.0;
-					if(muPerBCID != 0)
-					{
-						clustersPerPlane = clustersPerPlane/(muPerBCID*counterForEvents);
-					}
-					else
-					{
-						clustersPerPlane = -0.1;
-					}
-					fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
-				}
-			}
-				
-			previouslb = lb;
-			++clusterCounter[lb][cluster.station][cluster.layer];
-			counterForEvents = 1;
-		}
-			
-			// First time in lumiblock (in plane)
-		else if(clusterCounter[lb][cluster.station][cluster.layer] == 0) 
-		{
-			++clusterCounter[lb][cluster.station][cluster.layer];
-			previouslb = lb;
-		}
-			
-		// Lumiblock is same, so proceed
-		else if(lb==previouslb)	// Same lumiblock
-		{++clusterCounter[lb][cluster.station][cluster.layer];}
-			
+	
+
+		fillSynchHistogramsPlane(lb, previouslb, clusterCounter, counterForEvents, muPerBCID, cluster, 'P');
 	}	// ..... end cluster loop .....
 		
 		
@@ -260,30 +225,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	{
 		
 		lb = GetEventInfo(ctx)->lumiBlock();
-		/*
-		if(lb > previouslbStation && previouslbStation != 0)
-		{
-			for(int i=0; i<4; i++)
-			{
-				clustersPerStation = clusterCounterStation[previouslbStation][i]*1.0;
-				if(muPerBCID != 0)
-				{clustersPerStation = clustersPerStation/(muPerBCID*counterForEventsStation*4);}
-				else{clustersPerStation = -0.1;}
-
-				fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
-			}
-			previouslbStation=lb;
-			++clusterCounterStation[lb][cluster.station];
-			counterForEventsStation=1;
-		}
-		else if (clusterCounterStation[lb][cluster.station] == 0)
-		{
-			++clusterCounterStation[lb][cluster.station];
-			previouslbStation = lb;
-		}
-		else if (lb==previouslbStation)
-		{++clusterCounterStation[lb][cluster.station];}
-		*/
 		fillSynchHistogramsStation(lb, previouslbStation, clusterCounterStation, counterForEventsStation, muPerBCID, cluster, 'S');
 	
 	}
@@ -293,32 +234,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		for(const auto& cluster : fast.clusters()) 
 		{
 			lb = GetEventInfo(ctx)->lumiBlock();
-			/*
-			if(lb > previouslbStationFront && previouslbStationFront != 0)
-			{
-				for(int i=0; i<4; i++)
-				{
-					clustersPerStationFront = clusterCounterStationFront[previouslbStationFront][i]*1.0;
-					if(muPerBCID != 0)
-					{
-						clustersPerStationFront = clustersPerStationFront/(muPerBCID*counterForEventsStationFront*4);
-					}
-					else{clustersPerStationFront = -0.1;}
-					
-					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationFront);
-				}
-				previouslbStationFront=lb;
-				++clusterCounterStationFront[lb][cluster.station];
-				counterForEventsStationFront=1;
-			}
-			else if (clusterCounterStationFront[lb][cluster.station] == 0)
-			{
-				++clusterCounterStationFront[lb][cluster.station];
-				previouslbStationFront = lb;
-			}
-			else if (lb == previouslbStationFront)
-			{++clusterCounterStationFront[lb][cluster.station];}
-			*/
 			fillSynchHistogramsStation(lb, previouslbStationFront, clusterCounterStationFront, counterForEventsStationFront, muPerBCID, cluster, 'F');
 		}
 	}
@@ -330,32 +245,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		for(const auto& cluster : fast.clusters())
 		{
 			lb = GetEventInfo(ctx)->lumiBlock();
-			/*
-			if(lb > previouslbStationEnd && previouslbStationEnd != 0)
-			{
-				for(int i=0; i<4; i++)
-				{
-					clustersPerStationEnd = clusterCounterStationEnd[previouslbStationEnd][i]*1.0;
-					if(muPerBCID != 0)
-					{
-						clustersPerStationEnd = clustersPerStationEnd/(muPerBCID*counterForEventsStationEnd*4);
-					}
-					else{clustersPerStationEnd = -0.1;}
-				
-					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationEnd);
-				}
-				previouslbStationEnd=lb;
-				++clusterCounterStationEnd[lb][cluster.station];
-				counterForEventsStationEnd=1;
-			}
-			else if (clusterCounterStationEnd[lb][cluster.station] == 0)
-			{
-				++clusterCounterStationEnd[lb][cluster.station];
-				previouslbStationEnd = lb;
-			}
-			else if (lb == previouslbStationEnd)
-			{++clusterCounterStationEnd[lb][cluster.station];}
-			*/
 			fillSynchHistogramsStation(lb, previouslbStationEnd, clusterCounterStationEnd, counterForEventsStationEnd, muPerBCID, cluster, 'E');
 		}
 	}
@@ -366,32 +255,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	{
 		for(const auto& cluster : fast.clusters())
 		{
-		/*
-			if(lb > previouslbStationMiddle && previouslbStationMiddle != 0)
-			{
-				for(int i=0; i<4; i++)
-				{
-					clustersPerStationMiddle = clusterCounterStationMiddle[previouslbStationMiddle][i]*1.0;
-					if(muPerBCID != 0)
-					{
-						clustersPerStationMiddle = clustersPerStationMiddle/(muPerBCID*counterForEventsStationMiddle*4);
-					}
-					else{clustersPerStationMiddle = -0.1;}
-					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationMiddle);
-				}
-				previouslbStationMiddle=lb;
-				++clusterCounterStationMiddle[lb][cluster.station];
-				counterForEventsStationMiddle=1;
-			}
-			else if (clusterCounterStationMiddle[lb][cluster.station] == 0)
-			{
-				++clusterCounterStationMiddle[lb][cluster.station];
-				previouslbStationMiddle = lb;
-			}
-			else if (lb == previouslbStationMiddle)
-			{++clusterCounterStationMiddle[lb][cluster.station];}
-			// ..... end middle station .....
-			*/
 			fillSynchHistogramsStation(lb, previouslbStationMiddle, clusterCounterStationMiddle, counterForEventsStationMiddle, muPerBCID, cluster, 'M');
 		}
 	}
@@ -401,44 +264,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	if(isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
 	{
 		for(const auto& cluster : fast.clusters()) 
-			{
+		{
 			lb = GetEventInfo(ctx)->lumiBlock();
-			// Time for fill - current and previous lb are different, and the previouslbFront is not -1 (it means - this is not the first lb)
-			if(lb > previouslbFront && previouslbFront != 0)
-			{
-				for(int i=0; i<4; i++)
-				{
-					for(int j=0; j<4; j++)
-					{
-						clustersPerPlaneFront = clusterCounterFront[previouslbFront][i][j]*1.0;
-						if(muPerBCID != 0)
-						{
-							clustersPerPlaneFront = clustersPerPlaneFront/(muPerBCID*counterForEventsFront);
-						}
-						else
-						{
-							clustersPerPlaneFront = -0.1;
-						}
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
-					}
-				}
-				previouslbFront = lb;
-				++clusterCounterFront[lb][cluster.station][cluster.layer];
-				counterForEventsFront=1;
-			}
-		
-		// First time in lumiblock (in plane)
-			else if(clusterCounterFront[lb][cluster.station][cluster.layer] == 0) 
-			{
-				++clusterCounterFront[lb][cluster.station][cluster.layer];
-				previouslbFront = lb;
-			}
-		
-			// Lumiblock is same, so proceed
-			else if(lb==previouslbFront)	// Same lumiblock
-			{
-				++clusterCounterFront[lb][cluster.station][cluster.layer];
-			}
+			fillSynchHistogramsPlane(lb, previouslbFront, clusterCounterFront, counterForEventsFront, muPerBCID, cluster, 'F');
 		}
 	}
 		
@@ -448,42 +276,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		for(const auto& cluster : fast.clusters()) 
 		{
 			lb = GetEventInfo(ctx)->lumiBlock();
-			// Time for fill - current and previous lb are different, and the previouslbEnd is not -1 (it means - this is not the first lb)
-			if(lb > previouslbEnd && previouslbEnd != 0)
-			{
-				for(int i=0; i<4; i++)
-				{
-					for(int j=0; j<4; j++)
-					{
-						clustersPerPlaneEnd = clusterCounterEnd[previouslbEnd][i][j]*1.0;
-						if(muPerBCID != 0)
-						{
-							clustersPerPlaneEnd = clustersPerPlaneEnd/(muPerBCID*counterForEventsEnd);
-						}
-						else
-						{
-							clustersPerPlaneEnd = -0.1;
-						}
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
-					}
-				}
-					previouslbEnd = lb;
-					++clusterCounterEnd[lb][cluster.station][cluster.layer];
-					counterForEventsEnd=1;
-			}
-			
-			// First time in lumiblock (in plane)
-			else if(clusterCounterEnd[lb][cluster.station][cluster.layer] == 0) 
-			{
-				++clusterCounterEnd[lb][cluster.station][cluster.layer];
-				previouslbEnd = lb;
-			}
-			
-			// Lumiblock is same, so proceed
-			else if(lb==previouslbEnd)	// Same lumiblock
-			{
-				++clusterCounterEnd[lb][cluster.station][cluster.layer];
-			}
+			fillSynchHistogramsPlane(lb, previouslbEnd, clusterCounterEnd, counterForEventsEnd, muPerBCID, cluster, 'E');
 		}
 	}
 		
@@ -493,42 +286,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		for(const auto& cluster : fast.clusters()) 
 		{
 			lb = GetEventInfo(ctx)->lumiBlock();
-			// Time for fill - current and previous lb are different, and the previouslbMiddle is not -1 (it means - this is not the first lb)
-			if(lb > previouslbMiddle && previouslbMiddle != 0)
-			{
-				for(int i=0; i<4; i++)
-				{
-					for(int j=0; j<4; j++)
-					{
-						clustersPerPlaneMiddle = clusterCounterMiddle[previouslbMiddle][i][j]*1.0;
-						if(muPerBCID != 0)
-						{
-							clustersPerPlaneMiddle = clustersPerPlaneMiddle/(muPerBCID*counterForEventsMiddle);
-						}
-						else
-						{
-							clustersPerPlaneMiddle = -0.1;
-						}
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
-					}
-				}
-				previouslbMiddle = lb;
-				++clusterCounterMiddle[lb][cluster.station][cluster.layer];
-				counterForEventsMiddle=1;
-			}
-			
-			// First time in lumiblock (in plane)
-			else if(clusterCounterMiddle[lb][cluster.station][cluster.layer] == 0) 
-			{
-				++clusterCounterMiddle[lb][cluster.station][cluster.layer];
-				previouslbMiddle = lb;
-			}
-			
-			// Lumiblock is same, so proceed
-			else if(lb==previouslbMiddle)	// Same lumiblock
-			{
-				++clusterCounterMiddle[lb][cluster.station][cluster.layer];
-			}
+			fillSynchHistogramsPlane(lb, previouslbMiddle, clusterCounterMiddle, counterForEventsMiddle, muPerBCID, cluster, 'M');
 		}
 	}
 	
@@ -536,7 +294,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	return StatusCode::SUCCESS;
 } // end of fillHistograms
 
-void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster, char histogramType) const
+void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCID, const AFPMon::AFPCluster& cluster, char histogramType) const
 {
 	//using namespace Monitored;
 	
@@ -546,9 +304,9 @@ void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb,
 		for(int i = 0; i < 4; i++)
 		{
 			clustersPerStationFloat = clusterCounterStationA[previouslbStationA][i]*1.0;
-			if(muPerBCIDA != 0)
+			if(muPerBCID != 0)
 			{
-				clustersPerStationFloat = clustersPerStationFloat/(muPerBCIDA*counterForEventsStationA*4);
+				clustersPerStationFloat = clustersPerStationFloat/(muPerBCID*counterForEventsStationA*4);
 			}
 			else{clustersPerStationFloat = -0.1;}
 
@@ -590,11 +348,70 @@ void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb,
 	{++clusterCounterStationA[lb][cluster.station];}
 }
 
-/*
-void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, const AFPMon::AFPCluster& cluster) const
-{
-
 
+void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbPlane, std::vector<std::vector<std::vector<unsigned int>>> &clusterCounterPlane, unsigned int &counterForEventsPlane, float &muPerBCID, const AFPMon::AFPCluster& cluster, char histogramType) const
+{
+	float clustersPerPlaneFloat = 0;
+	if(lb > previouslbPlane && previouslbPlane != 0)
+	{
+		for(int i=0; i<4; i++)
+		{
+			for(int j=0; j<4; j++)
+			{
+				clustersPerPlaneFloat = clusterCounterPlane[previouslbPlane][i][j]*1.0;
+				if(muPerBCID != 0)
+				{
+					clustersPerPlaneFloat = clustersPerPlaneFloat/(muPerBCID*counterForEventsPlane);
+				}
+				else
+				{
+					clustersPerPlaneFloat = -0.1;
+				}
+				
+				if(histogramType == 'P')
+				{
+					auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 0.0);
+					clustersPerPlane = clustersPerPlaneFloat;
+					fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
+				}
+				else if(histogramType == 'F')
+				{
+					auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
+					clustersPerPlaneFront = clustersPerPlaneFloat;
+					fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
+				}
+				else if(histogramType == 'M')
+				{
+					auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
+					clustersPerPlaneMiddle = clustersPerPlaneFloat;
+					fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
+				}
+				else if(histogramType == 'E')
+				{
+					auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
+					clustersPerPlaneEnd = clustersPerPlaneFloat;
+					fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
+				}
+					
+			}
+		}
+		previouslbPlane = lb;
+		++clusterCounterPlane[lb][cluster.station][cluster.layer];
+		counterForEventsPlane=1;
+	}
+	// First time in lumiblock (in plane)
+	else if(clusterCounterPlane[lb][cluster.station][cluster.layer] == 0) 
+	{
+		++clusterCounterPlane[lb][cluster.station][cluster.layer];
+		previouslbPlane = lb;
+	}
+	
+	// Lumiblock is same, so proceed
+	else if(lb==previouslbPlane)	// Same lumiblock
+	{
+		++clusterCounterPlane[lb][cluster.station][cluster.layer];
+	}
+	
 }
-*/
+
 
-- 
GitLab


From 5b9da76c08c29e8d2b7fa700e88b62e4d94b33e6 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 14 Sep 2020 14:46:10 +0200
Subject: [PATCH 138/422] Separated stations and planes functions - clean

---
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 14 +---
 .../src/AFPSiLayerAlgorithm.cxx               | 84 ++-----------------
 2 files changed, 10 insertions(+), 88 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 73f0c0c6fae4..a9984ac641d1 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -86,21 +86,9 @@ if __name__=='__main__':
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
-    #nightly = '/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00361795.calibration_AFP.AODV1_EXT0'
-    #file=''
-    #file = '/afs/cern.ch/user/l/ladamczy/public/data18_13TeV.00354309.physics_Main.ESD._lb0130._SFO-1._0001.data.r22'
-    #file ='/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' 
-    #file = '/afs/cern.ch/user/l/ladamczy/public/data17_13TeV.00337176.calibration_AFP.AOD.pool.root'
-    #file = '/afs/cern.ch/user/l/ladamczy/public/data18_13TeV.00354309.physics_Main.ESD._lb0130._SFO-1._0001.data.r22'
-
-    #ConfigFlags.Input.Files = [nightly+file]
-    #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_4/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod0.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod1.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod2.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod3.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_5/aod4.pool.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/new_run_6/aod0.pool.root']
-    #ConfigFlags.Input.Files = ['/eos/atlas/atlastier0/tzero/prod/data17_13TeV/physics_Main/00337176/data17_13TeV.00337176.physics_Main.recon.AOD.f871/data17_13TeV.00337176.physics_Main.recon.AOD.f871._lb0142._0006.1']
-    #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
-    #ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00334350.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22327000.EXT0._000001.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00334350.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22327000.EXT0._000002.xAOD.root']
     ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000001.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput53-337371-Aut-test.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput54-test.root'
     
     ConfigFlags.lock()
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 69bfea46dfac..f671ec1113ab 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -54,7 +54,6 @@
 		return std::find_if(arr.begin(),arr.end(),[&bcid](const int& ele){return ele==bcid;})!= arr.end();
 	}
 	
-	//void fillSynchHistograms(int &lbA, int &previouslbStationA, float &clustersPerStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCIDA, auto &cluster, std::map<std::string,int> &mapa);
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
@@ -129,15 +128,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	auto weight = Monitored::Scalar<float>("weight", 1.0);
 
 	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
-	//auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 0.0);
-	//auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
-	//auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
-	//auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
-	
-	//auto clustersPerStation = Monitored::Scalar<float>("clustersPerStation", 0.0);
-	//auto clustersPerStationFront = Monitored::Scalar<float>("clustersPerStationFront", 0.0);
-	//auto clustersPerStationEnd = Monitored::Scalar<float>("clustersPerStationEnd", 0.0);
-	//auto clustersPerStationMiddle = Monitored::Scalar<float>("clustersPerStationMiddle", 0.0);
 
 	auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
 	auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
@@ -205,7 +195,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackY, trackX);
 	}
 
-	// Clusters:
+	// Clusters and synch histograms:
 
 	for(const auto& cluster : fast.clusters()) 
 	{
@@ -213,83 +203,27 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		clusterY = cluster.y;
 		fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX); 
 		lb = GetEventInfo(ctx)->lumiBlock();
-	
-
-		fillSynchHistogramsPlane(lb, previouslb, clusterCounter, counterForEvents, muPerBCID, cluster, 'P');
-	}	// ..... end cluster loop .....
-		
 		
 		
-	// =============== Stations all BCIDs ===============
-	for(const auto& cluster : fast.clusters()) 
-	{
-		
-		lb = GetEventInfo(ctx)->lumiBlock();
+		fillSynchHistogramsPlane(lb, previouslb, clusterCounter, counterForEvents, muPerBCID, cluster, 'P');
 		fillSynchHistogramsStation(lb, previouslbStation, clusterCounterStation, counterForEventsStation, muPerBCID, cluster, 'S');
-	
-	}
-	// ========== Front Station ==========
-	if(isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
-	{
-		for(const auto& cluster : fast.clusters()) 
+		
+		if (isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
 		{
-			lb = GetEventInfo(ctx)->lumiBlock();
 			fillSynchHistogramsStation(lb, previouslbStationFront, clusterCounterStationFront, counterForEventsStationFront, muPerBCID, cluster, 'F');
+			fillSynchHistogramsPlane(lb, previouslbFront, clusterCounterFront, counterForEventsFront, muPerBCID, cluster, 'F');
 		}
-	}
-	// ..... end front station .....
-			
-	// ========== End Station ==========
-	if(isInListVector(GetEventInfo(ctx)->bcid(), endBCIDsVector))
-	{	
-		for(const auto& cluster : fast.clusters())
-		{
-			lb = GetEventInfo(ctx)->lumiBlock();
-			fillSynchHistogramsStation(lb, previouslbStationEnd, clusterCounterStationEnd, counterForEventsStationEnd, muPerBCID, cluster, 'E');
-		}
-	}
-	// ..... end end station .....
-	
-	// ========== Middle Station ==========
-	if(isInListVector(GetEventInfo(ctx)->bcid(), middleBCIDsVector))
-	{
-		for(const auto& cluster : fast.clusters())
+		else if (isInListVector(GetEventInfo(ctx)->bcid(), middleBCIDsVector))
 		{
 			fillSynchHistogramsStation(lb, previouslbStationMiddle, clusterCounterStationMiddle, counterForEventsStationMiddle, muPerBCID, cluster, 'M');
+			fillSynchHistogramsPlane(lb, previouslbMiddle, clusterCounterMiddle, counterForEventsMiddle, muPerBCID, cluster, 'M');
 		}
-	}
-			// ..... end stations .....
-		
-		// ========== Front BCID ========== (planes)
-	if(isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
-	{
-		for(const auto& cluster : fast.clusters()) 
-		{
-			lb = GetEventInfo(ctx)->lumiBlock();
-			fillSynchHistogramsPlane(lb, previouslbFront, clusterCounterFront, counterForEventsFront, muPerBCID, cluster, 'F');
-		}
-	}
-		
-	// ========== End BCID ==========
-	if(isInListVector(GetEventInfo(ctx)->bcid(), endBCIDsVector))
-	{
-		for(const auto& cluster : fast.clusters()) 
+		else if (isInListVector(GetEventInfo(ctx)->bcid(), endBCIDsVector))
 		{
-			lb = GetEventInfo(ctx)->lumiBlock();
+			fillSynchHistogramsStation(lb, previouslbStationEnd, clusterCounterStationEnd, counterForEventsStationEnd, muPerBCID, cluster, 'E');
 			fillSynchHistogramsPlane(lb, previouslbEnd, clusterCounterEnd, counterForEventsEnd, muPerBCID, cluster, 'E');
 		}
 	}
-		
-	// ========== Middle BCID ==========
-	if(isInListVector(GetEventInfo(ctx)->bcid(), middleBCIDsVector))
-	{
-		for(const auto& cluster : fast.clusters()) 
-		{
-			lb = GetEventInfo(ctx)->lumiBlock();
-			fillSynchHistogramsPlane(lb, previouslbMiddle, clusterCounterMiddle, counterForEventsMiddle, muPerBCID, cluster, 'M');
-		}
-	}
-	
 
 	return StatusCode::SUCCESS;
 } // end of fillHistograms
-- 
GitLab


From c703ec3969670059fd83df2e3b6a0fcdad35ec0b Mon Sep 17 00:00:00 2001
From: Jannik Geisen <jannik.geisen@cern.ch>
Date: Mon, 14 Sep 2020 15:30:28 +0200
Subject: [PATCH 139/422] Simplifying adding NJets histograms for trigger
 chains

---
 .../python/TrigJetMonitorAlgorithm.py         | 51 ++++++++++---------
 1 file changed, 28 insertions(+), 23 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
index f612024b8672..632c96c40819 100644
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
@@ -315,6 +315,30 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT):
        # define the histogram
        group.defineHistogram('trigPassed,jetVar',title='titletrig', type="TEfficiency", path=chainFolder, xbins=100 , xmin=0, xmax=500000. ,)
 
+   # Define helper functions to automatize ET & eta selection strings for NJet histograms of chains
+   def getThreshold(parts):
+     return parts[1].split('_')[0]
+
+   def getEtaRange(chain):
+     if 'eta' in chain:
+       etaParts    = chain.split('eta')
+       etaMinTemp  = etaParts[0].split('_')
+       etaMin      = etaMinTemp[len(etaMinTemp)-1]
+       if int(etaMin) > 0 : etaMin = str(int(int(etaMin)/10))
+       etaMax      = etaParts[1].split('_')[0]
+       if int(etaMax) > 0 : etaMax = str(int(int(etaMax)/10))
+       return 'Eta{}_{}'.format(etaMin,etaMax)
+     else: return 'Eta0_32'
+
+   def getNjetHistName(chain):
+     print('Chain = {}'.format(chain))
+     parts         = chain.split('j')
+     # check if it is a multi-threshold multijet chain or a single-threshold multijet chain
+     multiplicity  = parts[0].split('_')[1] # for single-threshold multijet chains
+     if (chain.count('_j')-chain.count('_jes')) > 1  or multiplicity != '':
+       return 'njetsEt{}{}'.format(getThreshold(parts),getEtaRange(chain))
+     else: return 'NONE'
+
    from JetMonitoring.JetMonitoringConfig import retrieveVarToolConf
    trigConf = JetMonAlgSpec( # the usual JetMonAlgSpec 
        chain+"TrigMon",
@@ -334,7 +358,6 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT):
            EventHistoSpec('njets', (25,0,25), title='njets;njets;Entries' ),
            EventHistoSpec('njetsEt20Eta0_32', (25,0,25), title='njetsEt20Eta0_32;njetsEt20Eta0_32;Entries' ),
            EventHistoSpec('njetsEt50Eta0_32', (25,0,25), title='njetsEt50Eta0_32;njetsEt50Eta0_32;Entries' ),
-           EventHistoSpec('njetsEt100Eta0_32', (25,0,25), title='njetsEt100Eta0_32;njetsEt100Eta0_32;Entries' ),
            # we pass directly the ToolSpec
            ToolSpec('JetHistoTriggEfficiency', chain,
                     # below we pass the Properties of this JetHistoTriggEfficiency tool :
@@ -343,29 +366,11 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT):
                                                    # so we use retrieveVarToolConf("pt") which returns a full specification for the "pt" histo variable.
                     ProbeTrigChain=chain,defineHistoFunc=defineHistoForJetTrigg),
    )
-   if 'j460' in chain:
-     trigConf.appendHistos(
-       SelectSpec( 'highEt', '460<et:GeV', chainFolder, FillerTools = ["m"] ),
-     )
-   if '2j330' in chain:
-     trigConf.appendHistos(
-       EventHistoSpec('njetsEt330Eta0_32', (25,0,25), title='njetsEt330Eta0_32;njetsEt330Eta0_32;Entries' ),
-     )
-   elif '5j70' in chain:
-     trigConf.appendHistos(
-       EventHistoSpec('njetsEt70Eta0_24', (25,0,25), title='njetsEt70Eta0_24;njetsEt70Eta0_24;Entries' ),
-     )
-   elif '3j200' in chain:
-     trigConf.appendHistos(
-       EventHistoSpec('njetsEt200Eta0_32', (25,0,25), title='njetsEt200Eta0_32;njetsEt200Eta0_32;Entries' ),
-     )
-   elif 'j80_j60' in chain:
-     trigConf.appendHistos(
-       EventHistoSpec('njetsEt60Eta0_32', (25,0,25), title='njetsEt60Eta0_32;njetsEt60Eta0_32;Entries' ),
-     )
-   elif 'j260_320eta490' in chain:
+   NjetHistName = getNjetHistName(chain)
+   from JetMonitoring.JetStandardHistoSpecs import knownEventVar
+   if knownEventVar.get(NjetHistName,None) is not None:
      trigConf.appendHistos(
-       EventHistoSpec('njetsEt260Eta32_49', (25,0,25), title='njetsEt260Eta32_49;njetsEt260Eta32_49;Entries' ),
+       EventHistoSpec(NjetHistName, (25,0,25), title=NjetHistName+';'+NjetHistName+';Entries' ),
      )
    if 'smc' in chain:
      trigConf.appendHistos(
-- 
GitLab


From a4ec7ffe7141e60a8e49711a18280778e025f9e7 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Mon, 14 Sep 2020 18:40:24 +0200
Subject: [PATCH 140/422] merge in patch to EDM, and remove duplicate use of
 the DATAVECTOR_BASE macro (temporarily commented out, will remove in due
 course)

---
 .../xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h b/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h
index b670f65b7d70..0e9569b3ac5b 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h
@@ -14,7 +14,7 @@
 // Local include(s):
 #include "xAODPFlow/versions/FlowElement_v1.h"
 // initialise the base class of the FlowElementContainer as an IParticle
-DATAVECTOR_BASE(xAOD::FlowElement_v1, xAOD::IParticle);
+//DATAVECTOR_BASE(xAOD::FlowElement_v1, xAOD::IParticle);
 namespace xAOD {
    /// The container is a simple typedef for now
    typedef DataVector< xAOD::FlowElement_v1 > FlowElementContainer_v1;
-- 
GitLab


From a60909bc8b2f57307037a67245dff758626e8a10 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Mon, 14 Sep 2020 18:47:06 +0200
Subject: [PATCH 141/422] Code review fix

---
 Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h  |   1 +
 .../eflowRec/PFEGamFlowElementAssoc.h         |  31 ++-
 .../eflowRec/src/PFEGamFlowElementAssoc.cxx   | 196 +++++++++---------
 3 files changed, 119 insertions(+), 109 deletions(-)

diff --git a/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h b/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h
index 612098c0f892..c2c012b3272f 100644
--- a/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h
+++ b/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h
@@ -358,6 +358,7 @@ namespace xAOD {
   }; // class Jet
 
 
+
 } // namespace xAOD
 
 // Declare IParticle as a base class of Jet_v1:
diff --git a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
index fd01a3d93d91..d9ab23f033ad 100644
--- a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
+++ b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
@@ -18,9 +18,7 @@
 #include "xAODEgamma/PhotonContainer.h"
 
 #include "StoreGate/WriteDecorHandle.h"
-// this should be obsolete, but keeping atm to avoid crashes
-//#include "xAODPFlow/PFOContainer.h" // old EDM
-#include "xAODPFlow/FlowElementContainer.h" // Container to replace it
+#include "xAODPFlow/FlowElementContainer.h"
 /**                                                                                                                                                                                     
 This is the algorithm, which inherits from AthAlgorithm, that adds element links 
 between particle flow objects (Flow Elements) and Egamma objects. The algorithm associates charged (c) Flow Elements 
@@ -44,24 +42,35 @@ public:
   virtual StatusCode finalize() override final;
   
 private:
+  //instantiate ReadHandle for the Photon/Electron
+  SG::ReadHandleKey<xAOD::ElectronContainer>m_electronReadHandleKey{this,"ElectronContainer","Electron","ReadHandleKey for ElectronContainer"};
+
+  SG::ReadHandleKey<xAOD::PhotonContainer>m_photonReadHandleKey{this,"PhotonContainer","Photon","ReadHandleKey for PhotonContainer"};
+
+  //Readhandles for FlowElements.
+  SG::ReadHandleKey<xAOD::FlowElementContainer> m_neutralfeReadHandleKey{this,"JetEtMissNeutralFlowElementContainer","JetETMissNeutralFlowElement","ReadHandleKey for neutral FlowElements"};
+  
+  SG::ReadHandleKey<xAOD::FlowElementContainer> m_chargedfeReadHandleKey{this,"JetEtMissChargedFlowElementContainer","JetETMissChargedFlowElement","ReadHandleKey for charged FlowElements"};
+
 
   /** The write key for adding Neutral Flow Element element link decorations to electrons */ 
-  SG::WriteDecorHandleKey<xAOD::ElectronContainer> m_electronNeutralPFOWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::ElectronContainer> m_electronNeutralFEWriteDecorKey;
   /** The write key for adding Charged Flow Element element link decorations to electrons */
-  SG::WriteDecorHandleKey<xAOD::ElectronContainer> m_electronChargedPFOWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::ElectronContainer> m_electronChargedFEWriteDecorKey;
   /** The write key for adding electron element link decorations to Neutral Flow Elements */
-  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralpfoElectronWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralfeElectronWriteDecorKey;
   /** The write key for adding electron element link decorations to Charged Flow Elements */
-  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedpfoElectronWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedfeElectronWriteDecorKey;
 
   /** The write key for adding Neutral Flow Element element link decorations to photons */
-  SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonNeutralPFOWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonNeutralFEWriteDecorKey;
   /** The write key for adding Charged Flow Element element link decorations to photons */
-  SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonChargedPFOWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonChargedFEWriteDecorKey;
   /** The write key for adding photon element link decorations to Neutral Flow Elements */
-  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralpfoPhotonWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralfePhotonWriteDecorKey;
   /** The write key for adding photon element link decorations to Charged Flow Elements */
-  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedpfoPhotonWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedfePhotonWriteDecorKey;
+
  
 };
 
diff --git a/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
index f0460975fc67..e798d62a7a24 100644
--- a/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
+++ b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
@@ -3,18 +3,16 @@
 */
 
 #include "StoreGate/WriteDecorHandle.h" 
+// Flow Element EDM
+#include "xAODPFlow/FlowElementContainer.h"
+#include "xAODPFlow/FlowElement.h"
 #include "xAODEgamma/ElectronContainer.h" 
 #include "xAODEgamma/PhotonContainer.h"
 #include "xAODEgamma/Electron.h" 
 #include "xAODEgamma/Photon.h"
 #include "xAODEgamma/ElectronxAODHelpers.h"
 #include "xAODEgamma/EgammaxAODHelpers.h" 
-// keep these for the moment, although we expect to NOT need them
-//#include "xAODPFlow/PFOContainer.h" 
-//#include "xAODPFlow/PFO.h" 
-// this is the new EDM to replace the above
-#include "xAODPFlow/FlowElementContainer.h"
-#include "xAODPFlow/FlowElement.h"
+
 
 #include "eflowRec/PFEGamFlowElementAssoc.h" 
 #include <typeinfo> // temp debug for type checks on objects
@@ -30,17 +28,17 @@ const std::string& name,
   AthAlgorithm(name,pSvcLocator)
 {
 // Class initializer 
-declareProperty ("ElectronNeutralPFODecorKey", m_electronNeutralPFOWriteDecorKey = "Electrons.neutralfeLinks");   
-declareProperty ("ElectronChargedPFODecorKey", m_electronChargedPFOWriteDecorKey = "Electrons.chargedfeLinks");   
+declareProperty ("ElectronNeutralFEDecorKey", m_electronNeutralFEWriteDecorKey = "Electrons.neutralfeLinks");   
+declareProperty ("ElectronChargedFEDecorKey", m_electronChargedFEWriteDecorKey = "Electrons.chargedfeLinks");   
 
-declareProperty ("NeutralPFOElectronDecorKey", m_neutralpfoElectronWriteDecorKey = "JetETMissNeutralFlowElements.fe_ElectronLinks");   
+declareProperty ("NeutralFEElectronDecorKey", m_neutralfeElectronWriteDecorKey = "JetETMissNeutralFlowElements.fe_ElectronLinks");   
 
-declareProperty ("ChargedPFOElectronDecorKey", m_chargedpfoElectronWriteDecorKey = "JetETMissChargedFlowElements.fe_ElectronLinks"); 
+declareProperty ("ChargedFEElectronDecorKey", m_chargedfeElectronWriteDecorKey = "JetETMissChargedFlowElements.fe_ElectronLinks"); 
 
-declareProperty ("PhotonNeutralPFODecorKey", m_photonNeutralPFOWriteDecorKey = "Photons.neutralfeLinks");
-declareProperty ("PhotonChargedPFODecorKey", m_photonChargedPFOWriteDecorKey = "Photons.chargedfeLinks");
-declareProperty ("NeutralPFOPhotonDecorKey", m_neutralpfoPhotonWriteDecorKey = "JetETMissNeutralFlowElements.fe_PhotonLinks");
-declareProperty ("ChargedPFOPhotonDecorKey", m_chargedpfoPhotonWriteDecorKey = "JetETMissChargedFlowElements.fe_PhotonLinks");
+declareProperty ("PhotonNeutralFEDecorKey", m_photonNeutralFEWriteDecorKey = "Photons.neutralfeLinks");
+declareProperty ("PhotonChargedFEDecorKey", m_photonChargedFEWriteDecorKey = "Photons.chargedfeLinks");
+declareProperty ("NeutralFEPhotonDecorKey", m_neutralfePhotonWriteDecorKey = "JetETMissNeutralFlowElements.fe_PhotonLinks");
+declareProperty ("ChargedFEPhotonDecorKey", m_chargedfePhotonWriteDecorKey = "JetETMissChargedFlowElements.fe_PhotonLinks");
 }
 
 // Class destructor 
@@ -50,15 +48,15 @@ StatusCode PFEGamFlowElementAssoc::initialize()
 {
 
 ATH_MSG_DEBUG("Initializing "<<name() << "...");
-ATH_CHECK(m_electronNeutralPFOWriteDecorKey.initialize());   
-ATH_CHECK(m_electronChargedPFOWriteDecorKey.initialize());   
-ATH_CHECK(m_neutralpfoElectronWriteDecorKey.initialize());   
-ATH_CHECK(m_chargedpfoElectronWriteDecorKey.initialize());  
+ATH_CHECK(m_electronNeutralFEWriteDecorKey.initialize());   
+ATH_CHECK(m_electronChargedFEWriteDecorKey.initialize());   
+ATH_CHECK(m_neutralfeElectronWriteDecorKey.initialize());   
+ATH_CHECK(m_chargedfeElectronWriteDecorKey.initialize());  
 
-ATH_CHECK(m_photonNeutralPFOWriteDecorKey.initialize());
-ATH_CHECK(m_photonChargedPFOWriteDecorKey.initialize());
-ATH_CHECK(m_neutralpfoPhotonWriteDecorKey.initialize());
-ATH_CHECK(m_chargedpfoPhotonWriteDecorKey.initialize()); 
+ATH_CHECK(m_photonNeutralFEWriteDecorKey.initialize());
+ATH_CHECK(m_photonChargedFEWriteDecorKey.initialize());
+ATH_CHECK(m_neutralfePhotonWriteDecorKey.initialize());
+ATH_CHECK(m_chargedfePhotonWriteDecorKey.initialize()); 
 
  ATH_MSG_DEBUG("Initialization completed successfully");   
 
@@ -68,61 +66,63 @@ return StatusCode::SUCCESS;
 StatusCode PFEGamFlowElementAssoc::finalize(){
 return StatusCode::SUCCESS;
 }
+/**
+   This algorithm does the following:
+   1) Read the Input containers for Flow Elements, Electrons and Photons
+   2) Match the Clusters in the flow elements to the relevant E/Photon clusters (Neutral) or match tracks to relevant Electron/Photon tracks (Charged)
+   3) Link them
+   4) output the Electron/Photon containers with the linkers to the Flow element containers 
+**/
 StatusCode PFEGamFlowElementAssoc::execute()
 {
-  // This algorithm does the following:
-  // 1) Read the Input containers for Flow Elements, Electrons and Photons
-  // 2) Match the Clusters in the flow elements to the relevant E/Photon clusters (Neutral) or match tracks to relevant Electron/Photon tracks (Charged)
-  // 3) Link them
-  // 4) output the Electron/Photon containers with the linkers to the Flow element containers
 
-  // write decoration handles for the electron, photon and PFO containers -- these are the OUTPUT handles
+  // write decoration handles for the electron, photon and FE containers -- these are the OUTPUT handles
   //Electron Write Handle
-  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronNeutralPFOWriteDecorHandle (m_electronNeutralPFOWriteDecorKey);   
-  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronChargedPFOWriteDecorHandle (m_electronChargedPFOWriteDecorKey);   
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > neutralpfoElectronWriteDecorHandle (m_neutralpfoElectronWriteDecorKey);   
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > chargedpfoElectronWriteDecorHandle (m_chargedpfoElectronWriteDecorKey); 
+  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronNeutralFEWriteDecorHandle (m_electronNeutralFEWriteDecorKey);   
+  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronChargedFEWriteDecorHandle (m_electronChargedFEWriteDecorKey);   
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > neutralfeElectronWriteDecorHandle (m_neutralfeElectronWriteDecorKey);   
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > chargedfeElectronWriteDecorHandle (m_chargedfeElectronWriteDecorKey); 
 
   //Photon Write Handle
-  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonNeutralPFOWriteDecorHandle (m_photonNeutralPFOWriteDecorKey);
-  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonChargedPFOWriteDecorHandle (m_photonChargedPFOWriteDecorKey);
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > neutralpfoPhotonWriteDecorHandle (m_neutralpfoPhotonWriteDecorKey);
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > chargedpfoPhotonWriteDecorHandle (m_chargedpfoPhotonWriteDecorKey);  
+  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonNeutralFEWriteDecorHandle (m_photonNeutralFEWriteDecorKey);
+  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonChargedFEWriteDecorHandle (m_photonChargedFEWriteDecorKey);
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > neutralfePhotonWriteDecorHandle (m_neutralfePhotonWriteDecorKey);
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > chargedfePhotonWriteDecorHandle (m_chargedfePhotonWriteDecorKey);  
   
   
-  // This is the READ handles (so the input containers for electron, photon, PFO)
+  // This is the READ handles (so the input containers for electron, photon, FE)
   
-  SG::ReadHandle<xAOD::ElectronContainer>electronReadHandle (m_electronNeutralPFOWriteDecorKey.contHandleKey());
-  SG::ReadHandle<xAOD::PhotonContainer> photonReadHandle (m_photonNeutralPFOWriteDecorKey.contHandleKey());
+  SG::ReadHandle<xAOD::ElectronContainer>electronReadHandle (m_electronReadHandleKey);
+  SG::ReadHandle<xAOD::PhotonContainer> photonReadHandle (m_photonReadHandleKey);
   
   // Charged and Neutral PFlow "Flow elements"
-  SG::ReadHandle<xAOD::FlowElementContainer> neutralpfoReadHandle (m_neutralpfoElectronWriteDecorKey.contHandleKey());   
-  SG::ReadHandle<xAOD::FlowElementContainer> chargedpfoReadHandle (m_chargedpfoElectronWriteDecorKey.contHandleKey());   
+  SG::ReadHandle<xAOD::FlowElementContainer> neutralfeReadHandle (m_neutralfeReadHandleKey);   
+  SG::ReadHandle<xAOD::FlowElementContainer> chargedfeReadHandle (m_chargedfeReadHandleKey);   
   
   // now initialise some Flow element link containers
-  std::vector<std::vector<FlowElementLink_t>> electronNeutralPFOVec(electronReadHandle->size());
-  std::vector<std::vector<FlowElementLink_t>> electronChargedPFOVec(electronReadHandle->size());
+  std::vector<std::vector<FlowElementLink_t>> electronNeutralFEVec(electronReadHandle->size());
+  std::vector<std::vector<FlowElementLink_t>> electronChargedFEVec(electronReadHandle->size());
   
-  std::vector<std::vector<FlowElementLink_t>> photonNeutralPFOVec(photonReadHandle->size());
-  std::vector<std::vector<FlowElementLink_t>> photonChargedPFOVec(photonReadHandle->size());
+  std::vector<std::vector<FlowElementLink_t>> photonNeutralFEVec(photonReadHandle->size());
+  std::vector<std::vector<FlowElementLink_t>> photonChargedFEVec(photonReadHandle->size());
   //////////////////////////////////////////////////////////////////////////
   ////                      DO MATCHING/LINKING
   //////////////////////////////////////////////////////////////////////////
   
 
   ///////////////////////////
-  // Loop over neutral flow elements (PFOs)
+  // Loop over neutral flow elements (FEs)
   ///////////////////////////
-  for (const xAOD::FlowElement* pfo: *neutralpfoElectronWriteDecorHandle){
-    //Obtain the index of the PFO calo-cluster
-    size_t pfoClusterIndex=pfo->otherObjects().at(0)->index();
+  for (const xAOD::FlowElement* fe: *neutralfeElectronWriteDecorHandle){
+    //Obtain the index of the FE calo-cluster
+    size_t feClusterIndex=fe->otherObjects().at(0)->index();
 
     // init the linkers
-    std::vector<ElectronLink_t> pfoElectronLinks;
-    std::vector<PhotonLink_t> pfoPhotonLinks;
+    std::vector<ElectronLink_t> feElectronLinks;
+    std::vector<PhotonLink_t> fePhotonLinks;
     
     //Loop over electrons:
-    for (const xAOD::Electron* electron: *electronNeutralPFOWriteDecorHandle){
+    for (const xAOD::Electron* electron: *electronNeutralFEWriteDecorHandle){
       // get the calo clusters from the electron
 
       const std::vector<const xAOD::CaloCluster*> electronTopoClusters = xAOD::EgammaHelpers::getAssociatedTopoClusters(electron->caloCluster());
@@ -131,12 +131,12 @@ StatusCode PFEGamFlowElementAssoc::execute()
       for(const xAOD::CaloCluster* cluster : electronTopoClusters){
 	// obtain the index of the electron seed topocluster
 	size_t electronClusterIndex=cluster->index();	
-	//match the indices: Cluster match between Flow Element (PFO) and electron
-	if(electronClusterIndex==pfoClusterIndex){
-	  pfoElectronLinks.push_back( ElectronLink_t(*electronReadHandle,electron->index()) );
-	  //Add Flow Element (PFO) link to a vector
+	//match the indices: Cluster match between Flow Element (FE) and electron
+	if(electronClusterIndex==feClusterIndex){
+	  feElectronLinks.push_back( ElectronLink_t(*electronReadHandle,electron->index()) );
+	  //Add Flow Element (FE) link to a vector
 	  //index() is the unique index of the Flow Element in the container
-	  electronNeutralPFOVec.at(electron->index()).push_back(FlowElementLink_t(*neutralpfoReadHandle, pfo->index()) );
+	  electronNeutralFEVec.at(electron->index()).push_back(FlowElementLink_t(*neutralfeReadHandle, fe->index()) );
 	}// end of matching block
 
       } // end loop over cluster
@@ -144,7 +144,7 @@ StatusCode PFEGamFlowElementAssoc::execute()
     } // end Electron loop
 
     // now loop over photons
-    for (const xAOD::Photon* photon: *photonNeutralPFOWriteDecorHandle){
+    for (const xAOD::Photon* photon: *photonNeutralFEWriteDecorHandle){
       // retrieve clusters from the photon container
       const std::vector<const xAOD::CaloCluster*> photonTopoClusters = xAOD::EgammaHelpers::getAssociatedTopoClusters(photon->caloCluster());
       //loop over clusters, and do the matching
@@ -152,12 +152,12 @@ StatusCode PFEGamFlowElementAssoc::execute()
 	//retrieve index of the cluster
 	size_t photonClusterIndex=cluster->index();
 	//do the matching
-	if(photonClusterIndex==pfoClusterIndex){
-	  // Add flow element (PFO) links to photon
-	  pfoPhotonLinks.push_back( PhotonLink_t(*photonReadHandle,photon->index()) );
-	  //Add Flow Element (PFO) link to a vector
+	if(photonClusterIndex==feClusterIndex){
+	  // Add flow element (FE) links to photon
+	  fePhotonLinks.push_back( PhotonLink_t(*photonReadHandle,photon->index()) );
+	  //Add Flow Element (FE) link to a vector
 	  //index() is the unique index of the Flow Element in the container
-	  photonNeutralPFOVec.at(photon->index()).push_back(FlowElementLink_t(*neutralpfoReadHandle, pfo->index()) );	  
+	  photonNeutralFEVec.at(photon->index()).push_back(FlowElementLink_t(*neutralfeReadHandle, fe->index()) );	  
 	}// end of matching block
       } // end of neutral loop
       
@@ -165,58 +165,58 @@ StatusCode PFEGamFlowElementAssoc::execute()
     }// end of photon loop
     
     //Add vector of electron element links as decoration to FlowElement container
-    neutralpfoElectronWriteDecorHandle (*pfo)=pfoElectronLinks;
-    neutralpfoPhotonWriteDecorHandle (*pfo)=pfoPhotonLinks;
+    neutralfeElectronWriteDecorHandle (*fe)=feElectronLinks;
+    neutralfePhotonWriteDecorHandle (*fe)=fePhotonLinks;
 
-  } // end neutral PFO loop
+  } // end neutral FE loop
 
   ////////////////////////////////////////////////////////
-  //             Loop over charged Flow Elements (PFOs)
+  //             Loop over charged Flow Elements (FEs)
   ////////////////////////////////////////////////////////
-  for (const xAOD::FlowElement* pfo: *chargedpfoElectronWriteDecorHandle){
+  for (const xAOD::FlowElement* fe: *chargedfeElectronWriteDecorHandle){
     // retrieve the track from the Flow element
-    size_t pfoTrackIndex=pfo->chargedObjects().at(0)->index();
+    size_t feTrackIndex=fe->chargedObjects().at(0)->index();
     // Initialise a vector of element links to electrons/Photons
-    std::vector<ElectronLink_t> pfoElectronLinks;
-    std::vector<PhotonLink_t> pfoPhotonLinks;
+    std::vector<ElectronLink_t> feElectronLinks;
+    std::vector<PhotonLink_t> fePhotonLinks;
 
     //loop over electrons
-    for (const xAOD::Electron* electron: *electronChargedPFOWriteDecorHandle){
+    for (const xAOD::Electron* electron: *electronChargedFEWriteDecorHandle){
       //obtain the clusters
        const std::vector<const xAOD::TrackParticle*> electronTrackParticles = xAOD::EgammaHelpers::getTrackParticlesVec(electron, true, true); // useBremAssoc = true (get original non-GSF track), allParticles = true (include all track particles)
        // loop over tracks
        for (const xAOD::TrackParticle* electronTrack: electronTrackParticles){
 	 size_t electronTrackIndex = electronTrack->index();
 
-	 //link to PFO if track indices match
-	 if(electronTrackIndex==pfoTrackIndex){
+	 //link to FE if track indices match
+	 if(electronTrackIndex==feTrackIndex){
 	   // Add electron element link to a vector 
 	   // index() is the unique index of the electron in the electron container 
-	   pfoElectronLinks.push_back( ElectronLink_t(*electronReadHandle, electron->index()) );
-	   // Add pfo element link to a vector 
-	   // index() is the unique index of the cPFO in the cPFO container 
-	   electronChargedPFOVec.at(electron->index()).push_back( FlowElementLink_t(*chargedpfoReadHandle, pfo->index()) );  
+	   feElectronLinks.push_back( ElectronLink_t(*electronReadHandle, electron->index()) );
+	   // Add fe element link to a vector 
+	   // index() is the unique index of the cFE in the cFE container 
+	   electronChargedFEVec.at(electron->index()).push_back( FlowElementLink_t(*chargedfeReadHandle, fe->index()) );  
 
 	 }//end of matching block
 	 
        }//end of loop on clusters
     } // end of loop on electrons
     
-    for(const xAOD::Photon* photon: *photonChargedPFOWriteDecorHandle){
+    for(const xAOD::Photon* photon: *photonChargedFEWriteDecorHandle){
       //obtain indices of the converted photon's original tracks
       const std::set<const xAOD::TrackParticle*> photonTrackParticles = xAOD::EgammaHelpers::getTrackParticles(photon, true);
       // loop over the tracks
       for (const xAOD::TrackParticle* photonTrack: photonTrackParticles){
 	size_t photonTrackIndex=photonTrack->index();
 	
-	// Link the photon to the Flow Element (PFO) if the track indices match
-	if (photonTrackIndex==pfoTrackIndex){
+	// Link the photon to the Flow Element (FE) if the track indices match
+	if (photonTrackIndex==feTrackIndex){
 	            // Add photon element link to a vector
           // index() is the unique index of the photon in the photon container
-          pfoPhotonLinks.push_back( PhotonLink_t(*photonReadHandle, photon->index()) );
-          // Add pfo element link to a vector
-          // index() is the unique index of the cPFO in the cPFO container
-          photonChargedPFOVec.at(photon->index()).push_back( FlowElementLink_t(*chargedpfoReadHandle, pfo->index()) );
+          fePhotonLinks.push_back( PhotonLink_t(*photonReadHandle, photon->index()) );
+          // Add fe element link to a vector
+          // index() is the unique index of the cFE in the cFE container
+          photonChargedFEVec.at(photon->index()).push_back( FlowElementLink_t(*chargedfeReadHandle, fe->index()) );
 	}// end of matching block
 
       }// end of loop on tracks
@@ -224,27 +224,27 @@ StatusCode PFEGamFlowElementAssoc::execute()
     }//end of loop on photons
 
 
-    // Add vector of electron element links as decoration to PFO container     
-    chargedpfoElectronWriteDecorHandle (*pfo) = pfoElectronLinks;  
-    // Add vector of photon element links as decoration to PFO container
-    chargedpfoPhotonWriteDecorHandle (*pfo) = pfoPhotonLinks;
+    // Add vector of electron element links as decoration to FE container     
+    chargedfeElectronWriteDecorHandle (*fe) = feElectronLinks;  
+    // Add vector of photon element links as decoration to FE container
+    chargedfePhotonWriteDecorHandle (*fe) = fePhotonLinks;
 
-  } // end of charged PFO loop
+  } // end of charged FE loop
   
 
 
   ////////////////////////////////////////////////////
   //   WRITE OUTPUT: ADD HANDLES TO EL/PHOT CONTAINERS
   ////////////////////////////////////////////////////
-  // Add the vectors of the Flow Element (PFO) Links as decorations to the electron container
-  for (const xAOD::Electron* electron : *electronNeutralPFOWriteDecorHandle){
-    electronNeutralPFOWriteDecorHandle (*electron) = electronNeutralPFOVec.at(electron->index());
-    electronChargedPFOWriteDecorHandle (*electron) = electronChargedPFOVec.at(electron->index());
+  // Add the vectors of the Flow Element (FE) Links as decorations to the electron container
+  for (const xAOD::Electron* electron : *electronNeutralFEWriteDecorHandle){
+    electronNeutralFEWriteDecorHandle (*electron) = electronNeutralFEVec.at(electron->index());
+    electronChargedFEWriteDecorHandle (*electron) = electronChargedFEVec.at(electron->index());
   } //end of photon loop
-  // Add the vectors of the Flow Element (PFO) Links as decorations to the photon container
-  for (const xAOD::Photon* photon: *photonNeutralPFOWriteDecorHandle){
-    photonNeutralPFOWriteDecorHandle (*photon) = photonNeutralPFOVec.at(photon->index());
-    photonChargedPFOWriteDecorHandle (*photon) = photonChargedPFOVec.at(photon->index());
+  // Add the vectors of the Flow Element (FE) Links as decorations to the photon container
+  for (const xAOD::Photon* photon: *photonNeutralFEWriteDecorHandle){
+    photonNeutralFEWriteDecorHandle (*photon) = photonNeutralFEVec.at(photon->index());
+    photonChargedFEWriteDecorHandle (*photon) = photonChargedFEVec.at(photon->index());
   } // end of loop on photons
 
   ATH_MSG_DEBUG("Execute completed successfully");
-- 
GitLab


From 3763bd81aa68987de41651b3381f7480ab2b9e69 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 14 Sep 2020 21:21:40 +0200
Subject: [PATCH 142/422] Optimized synch histograms. Finished work on synch
 histograms.

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |   4 +-
 .../src/AFPSiLayerAlgorithm.cxx               | 240 +++++++++---------
 2 files changed, 121 insertions(+), 123 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index dea0a27d470a..8b4146f20b30 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -30,8 +30,8 @@ private:
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
 	SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
 	
-	void fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCID, const AFPMon::AFPCluster& cluster, char histogramType) const;
-	void fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbPlane, std::vector<std::vector<std::vector<unsigned int>>> &clusterCounterPlane, unsigned int &counterForEventsPlane, float &muPerBCID, const AFPMon::AFPCluster& cluster, char histogramType) const;
+	void fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const;
+	void fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbPlane, std::vector<std::vector<std::vector<unsigned int>>> &clusterCounterPlane, unsigned int &counterForEventsPlane, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const;
 
 protected:
 	std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index f671ec1113ab..e9bd7664b4f1 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -150,7 +150,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	fill("AFPSiLayerTool", lb, muPerBCID);
 	
 
-	++counterForEvents;		
+	++counterForEvents;
 	++counterForEventsStation;
 	
 	SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
@@ -188,6 +188,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	AFPMon::AFPFastReco fast(afpHitContainer.get());
 	fast.reco();
 
+	// Track histograms:
 	for (const auto& track : fast.tracks()) 
 	{
 		trackX = track.x;
@@ -195,157 +196,154 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackY, trackX);
 	}
 
-	// Clusters and synch histograms:
-
+	// Cluster histograms 
 	for(const auto& cluster : fast.clusters()) 
 	{
 		clusterX = cluster.x;
 		clusterY = cluster.y;
-		fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX); 
-		lb = GetEventInfo(ctx)->lumiBlock();
-		
-		
-		fillSynchHistogramsPlane(lb, previouslb, clusterCounter, counterForEvents, muPerBCID, cluster, 'P');
-		fillSynchHistogramsStation(lb, previouslbStation, clusterCounterStation, counterForEventsStation, muPerBCID, cluster, 'S');
-		
-		if (isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
-		{
-			fillSynchHistogramsStation(lb, previouslbStationFront, clusterCounterStationFront, counterForEventsStationFront, muPerBCID, cluster, 'F');
-			fillSynchHistogramsPlane(lb, previouslbFront, clusterCounterFront, counterForEventsFront, muPerBCID, cluster, 'F');
-		}
-		else if (isInListVector(GetEventInfo(ctx)->bcid(), middleBCIDsVector))
-		{
-			fillSynchHistogramsStation(lb, previouslbStationMiddle, clusterCounterStationMiddle, counterForEventsStationMiddle, muPerBCID, cluster, 'M');
-			fillSynchHistogramsPlane(lb, previouslbMiddle, clusterCounterMiddle, counterForEventsMiddle, muPerBCID, cluster, 'M');
-		}
-		else if (isInListVector(GetEventInfo(ctx)->bcid(), endBCIDsVector))
-		{
-			fillSynchHistogramsStation(lb, previouslbStationEnd, clusterCounterStationEnd, counterForEventsStationEnd, muPerBCID, cluster, 'E');
-			fillSynchHistogramsPlane(lb, previouslbEnd, clusterCounterEnd, counterForEventsEnd, muPerBCID, cluster, 'E');
-		}
+		fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX);
 	}
-
-	return StatusCode::SUCCESS;
-} // end of fillHistograms
-
-void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCID, const AFPMon::AFPCluster& cluster, char histogramType) const
-{
-	//using namespace Monitored;
 	
-	float clustersPerStationFloat = 0;
-	if(lb > previouslbStationA && previouslbStationA != 0)
+	// Synch histograms:
+	lb = GetEventInfo(ctx)->lumiBlock();
+	
+	fillSynchHistogramsStation(lb, previouslbStation, clusterCounterStation, counterForEventsStation, muPerBCID, 'S', fast);
+	fillSynchHistogramsPlane(lb, previouslb, clusterCounter, counterForEvents, muPerBCID, 'P', fast);
+	
+	if (isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
 	{
-		for(int i = 0; i < 4; i++)
-		{
-			clustersPerStationFloat = clusterCounterStationA[previouslbStationA][i]*1.0;
-			if(muPerBCID != 0)
-			{
-				clustersPerStationFloat = clustersPerStationFloat/(muPerBCID*counterForEventsStationA*4);
-			}
-			else{clustersPerStationFloat = -0.1;}
-
-			if(histogramType == 'S')
-			{
-				auto clustersPerStation = Monitored::Scalar<float>("clustersPerStation", 0.0);
-				clustersPerStation = clustersPerStationFloat;
-				fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
-			}
-			else if (histogramType == 'F')
-			{
-				auto clustersPerStationFront = Monitored::Scalar<float>("clustersPerStationFront", 0.0);
-				clustersPerStationFront = clustersPerStationFloat;
-				fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationFront);
-			}
-			else if (histogramType == 'M')
-			{
-				auto clustersPerStationMiddle = Monitored::Scalar<float>("clustersPerStationMiddle", 0.0);
-				clustersPerStationMiddle = clustersPerStationFloat;
-				fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationMiddle);
-			}
-			else if (histogramType == 'E')
-			{
-				auto clustersPerStationEnd = Monitored::Scalar<float>("clustersPerStationEnd", 0.0);
-				clustersPerStationEnd = clustersPerStationFloat;
-				fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationEnd);
-			}
-		}
-		previouslbStationA=lb;
-		++clusterCounterStationA[lb][cluster.station];
-		counterForEventsStationA=1;
+		fillSynchHistogramsStation(lb, previouslbStationFront, clusterCounterStationFront, counterForEventsStationFront, muPerBCID, 'F', fast);
+		fillSynchHistogramsPlane(lb, previouslbFront, clusterCounterFront, counterForEventsFront, muPerBCID, 'F', fast);
 	}
-	else if (clusterCounterStationA[lb][cluster.station] == 0)
+	else if (isInListVector(GetEventInfo(ctx)->bcid(), middleBCIDsVector))
 	{
-		++clusterCounterStationA[lb][cluster.station];
-		previouslbStationA = lb;
+		fillSynchHistogramsStation(lb, previouslbStationMiddle, clusterCounterStationMiddle, counterForEventsStationMiddle, muPerBCID, 'M', fast);
+		fillSynchHistogramsPlane(lb, previouslbMiddle, clusterCounterMiddle, counterForEventsMiddle, muPerBCID, 'M', fast);
+	}
+	else if (isInListVector(GetEventInfo(ctx)->bcid(), endBCIDsVector))
+	{
+		fillSynchHistogramsStation(lb, previouslbStationEnd, clusterCounterStationEnd, counterForEventsStationEnd, muPerBCID, 'E', fast);
+		fillSynchHistogramsPlane(lb, previouslbEnd, clusterCounterEnd, counterForEventsEnd, muPerBCID, 'E', fast);
 	}
-	else if (lb==previouslbStationA)
-	{++clusterCounterStationA[lb][cluster.station];}
-}
 
+	return StatusCode::SUCCESS;
+} // end of fillHistograms
 
-void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbPlane, std::vector<std::vector<std::vector<unsigned int>>> &clusterCounterPlane, unsigned int &counterForEventsPlane, float &muPerBCID, const AFPMon::AFPCluster& cluster, char histogramType) const
+void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const
 {
-	float clustersPerPlaneFloat = 0;
-	if(lb > previouslbPlane && previouslbPlane != 0)
+	float clustersPerStationFloat = 0;
+	for(const auto& cluster : fast.clusters()) 
 	{
-		for(int i=0; i<4; i++)
+		if(lb > previouslbStationA && previouslbStationA != 0)
 		{
-			for(int j=0; j<4; j++)
+			for(int i = 0; i < 4; i++)
 			{
-				clustersPerPlaneFloat = clusterCounterPlane[previouslbPlane][i][j]*1.0;
+				clustersPerStationFloat = clusterCounterStationA[previouslbStationA][i]*1.0;
 				if(muPerBCID != 0)
 				{
-					clustersPerPlaneFloat = clustersPerPlaneFloat/(muPerBCID*counterForEventsPlane);
+					clustersPerStationFloat = clustersPerStationFloat/(muPerBCID*counterForEventsStationA*4);
 				}
-				else
-				{
-					clustersPerPlaneFloat = -0.1;
-				}
-				
-				if(histogramType == 'P')
+				else{clustersPerStationFloat = -0.1;}
+	
+				if(histogramType == 'S')
 				{
-					auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 0.0);
-					clustersPerPlane = clustersPerPlaneFloat;
-					fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
+					auto clustersPerStation = Monitored::Scalar<float>("clustersPerStation", 0.0);
+					clustersPerStation = clustersPerStationFloat;
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
 				}
-				else if(histogramType == 'F')
+				else if (histogramType == 'F')
 				{
-					auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
-					clustersPerPlaneFront = clustersPerPlaneFloat;
-					fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
+					auto clustersPerStationFront = Monitored::Scalar<float>("clustersPerStationFront", 0.0);
+					clustersPerStationFront = clustersPerStationFloat;
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationFront);
 				}
-				else if(histogramType == 'M')
+				else if (histogramType == 'M')
 				{
-					auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
-					clustersPerPlaneMiddle = clustersPerPlaneFloat;
-					fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
+					auto clustersPerStationMiddle = Monitored::Scalar<float>("clustersPerStationMiddle", 0.0);
+					clustersPerStationMiddle = clustersPerStationFloat;
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationMiddle);
 				}
-				else if(histogramType == 'E')
+				else if (histogramType == 'E')
 				{
-					auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
-					clustersPerPlaneEnd = clustersPerPlaneFloat;
-					fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
+					auto clustersPerStationEnd = Monitored::Scalar<float>("clustersPerStationEnd", 0.0);
+					clustersPerStationEnd = clustersPerStationFloat;
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationEnd);
 				}
-					
 			}
+			previouslbStationA=lb;
+			++clusterCounterStationA[lb][cluster.station];
+			counterForEventsStationA=1;
 		}
-		previouslbPlane = lb;
-		++clusterCounterPlane[lb][cluster.station][cluster.layer];
-		counterForEventsPlane=1;
-	}
-	// First time in lumiblock (in plane)
-	else if(clusterCounterPlane[lb][cluster.station][cluster.layer] == 0) 
-	{
-		++clusterCounterPlane[lb][cluster.station][cluster.layer];
-		previouslbPlane = lb;
+		else if (clusterCounterStationA[lb][cluster.station] == 0)
+		{
+			++clusterCounterStationA[lb][cluster.station];
+			previouslbStationA = lb;
+		}
+		else if (lb==previouslbStationA)
+		{++clusterCounterStationA[lb][cluster.station];}
 	}
-	
-	// Lumiblock is same, so proceed
-	else if(lb==previouslbPlane)	// Same lumiblock
+}
+
+void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbPlane, std::vector<std::vector<std::vector<unsigned int>>> &clusterCounterPlane, unsigned int &counterForEventsPlane, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const
+{
+	float clustersPerPlaneFloat = 0;
+	for(const auto& cluster : fast.clusters()) 
 	{
-		++clusterCounterPlane[lb][cluster.station][cluster.layer];
+		if(lb > previouslbPlane && previouslbPlane != 0)
+		{
+			for(int i=0; i<4; i++)
+			{
+				for(int j=0; j<4; j++)
+				{
+					clustersPerPlaneFloat = clusterCounterPlane[previouslbPlane][i][j]*1.0;
+					if(muPerBCID != 0)
+					{
+						clustersPerPlaneFloat = clustersPerPlaneFloat/(muPerBCID*counterForEventsPlane);
+					}
+					else
+					{
+						clustersPerPlaneFloat = -0.1;
+					}
+				
+					if(histogramType == 'P')
+					{
+						auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 0.0);
+						clustersPerPlane = clustersPerPlaneFloat;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
+					}
+					else if(histogramType == 'F')
+					{
+						auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
+						clustersPerPlaneFront = clustersPerPlaneFloat;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
+					}
+					else if(histogramType == 'M')
+					{
+						auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
+						clustersPerPlaneMiddle = clustersPerPlaneFloat;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
+					}
+					else if(histogramType == 'E')
+					{
+						auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
+						clustersPerPlaneEnd = clustersPerPlaneFloat;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
+					}
+				}
+			}
+			previouslbPlane = lb;
+			++clusterCounterPlane[lb][cluster.station][cluster.layer];
+			counterForEventsPlane=1;
+		}
+		// First time in lumiblock (in plane)
+		else if(clusterCounterPlane[lb][cluster.station][cluster.layer] == 0) 
+		{
+			++clusterCounterPlane[lb][cluster.station][cluster.layer];
+			previouslbPlane = lb;
+		}	
+		// Lumiblock is same, so proceed
+		else if(lb==previouslbPlane)	// Same lumiblock
+		{++clusterCounterPlane[lb][cluster.station][cluster.layer];}
 	}
-	
 }
 
-
-- 
GitLab


From 3cf42fcc9a4dffb3a7b9f079abcaa3a2bdb5f0d8 Mon Sep 17 00:00:00 2001
From: Joerg Stelzer <joerg.stelzer@cern.ch>
Date: Mon, 14 Sep 2020 23:43:15 +0200
Subject: [PATCH 143/422] Fix resolution and pickup of LVL1 and HLT menu files
 (ATR-21906)

---
 .../python/TrigConfigSvcConfig.py             | 10 +++----
 .../TriggerJobOpts/python/TriggerFlags.py     | 30 ++++++++-----------
 2 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py
index aa9e51a3481c..59b620da6518 100755
--- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py
@@ -82,7 +82,7 @@ class DefaultHLTConfigSvc( TrigConf__HLTConfigSvc ):
         else:
             mlog.info("Will load algos from xml")
             allalgs = []
-            doc = ET.parse(self.XMLMenuFile)
+            doc = ET.parse( findFileInXMLPATH(self.XMLMenuFile) )
             algs = self.getAllAlgorithms(doc)
             l2TEs, efTEs = self.getTEsByLevel(doc)
 
@@ -111,7 +111,7 @@ class DefaultHLTConfigSvc( TrigConf__HLTConfigSvc ):
             mlog.info("Will load algos from xml")
             l2algs = []
             efalgs = []
-            doc = ET.parse(self.XMLMenuFile)
+            doc = ET.parse( findFileInXMLPATH(self.XMLMenuFile) )
             algs = self.getAllAlgorithms(doc)
             l2TEs, efTEs = self.getTEsByLevel(doc)
 
@@ -130,7 +130,7 @@ class DefaultHLTConfigSvc( TrigConf__HLTConfigSvc ):
         l2TEs = []
         efTEs = []
         #print "INFO parsing: " + self.XMLMenuFile
-        if not doc: doc = ET.parse(self.XMLMenuFile)
+        if not doc: doc = ET.parse( findFileInXMLPATH(self.XMLMenuFile) )
 
         #print "INFO got chains " + str(chainlist)
         for ch in doc.getiterator("CHAIN"):
@@ -173,7 +173,7 @@ class DefaultHLTConfigSvc( TrigConf__HLTConfigSvc ):
 
     def getAllSequenceInputs (self, doc = None):
         """ Produce dictionaries where key is outout TE name and values are tuples of TEs """
-        if not doc: doc = ET.parse(self.XMLMenuFile)
+        if not doc: doc = ET.parse( findFileInXMLPATH(self.XMLMenuFile) )
         inp = {}
         for seq in doc.getiterator("SEQUENCE"):
             #print "INFO Discovered algorithms in the sequence: " + seq.getAttribute("algorithm")
@@ -183,7 +183,7 @@ class DefaultHLTConfigSvc( TrigConf__HLTConfigSvc ):
     def getAllAlgorithms(self, doc = None):
         """ Produce dictionary where key is output TE name of the sequence and value is a list of algos in sequence"""
         #print "INFO parsing: " + self.XMLMenuFile
-        if not doc: doc = ET.parse(self.XMLMenuFile)
+        if not doc: doc = ET.parse( findFileInXMLPATH(self.XMLMenuFile) )
         #print "INFO getting sequences "
         algos = {}
         for seq in doc.getiterator("SEQUENCE"):
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
index dc2a5217125f..bbe0d864e127 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
@@ -494,7 +494,9 @@ class readL1TopoConfigFromXML(JobProperty):
 
     def _do_action(self):
         """ setup some consistency """
-        if self.get_Value() is False:
+        if self.get_Value():
+            TriggerFlags.inputL1TopoConfigFile = "TriggerMenuXML/L1TopoConfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
+        else:
             TriggerFlags.inputL1TopoConfigFile = TriggerFlags.outputL1TopoConfigFile()
 
 _flags.append(readL1TopoConfigFromXML)
@@ -521,6 +523,7 @@ class readLVL1configFromXML(JobProperty):
             TriggerFlags.inputLVL1configFile = TriggerFlags.outputLVL1configFile()
             TriggerFlags.Lvl1.items.set_On()
         else:
+            TriggerFlags.inputLVL1configFile = "TriggerMenuXML/LVL1config_"+_getMenuBaseName(TriggerFlags.triggerMenuSetup())+"_" + TriggerFlags.menuVersion() + ".xml"
             xmlFile=TriggerFlags.inputLVL1configFile()
             from TrigConfigSvc.TrigConfigSvcConfig import findFileInXMLPATH
             if xmlFile!='NONE' and not os.path.exists(findFileInXMLPATH(xmlFile)):
@@ -560,11 +563,10 @@ class readHLTconfigFromXML(JobProperty):
         else:
             if TriggerFlags.inputHLTconfigFile != 'NONE':
                 
-                TriggerFlags.inputHLTconfigFile = "HLTconfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
+                TriggerFlags.inputHLTconfigFile = "TriggerMenuXML/HLTconfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
                 nightlyPaths=os.environ['XMLPATH'].split(':')
 
                 for p in nightlyPaths:
-                    #print p+"/TriggerMenuXML/HLTconfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
                     full_path_name = p+"/TriggerMenuXML/"+TriggerFlags.inputHLTconfigFile()
                     if os.path.exists(full_path_name) is True:
                         log.info("The HLT xml file is: "+full_path_name)
@@ -614,12 +616,7 @@ class outputL1TopoConfigFile(JobProperty):
             # cases, e.g. MC_pp_v5_tight_mc_prescale. Prescaling is
             # not available for L1Topo, therefore that part is being
             # removed.
-            import re
-            menuSetup = TriggerFlags.triggerMenuSetup()
-            m = re.match(r'(.*v\d(?:_primaries)?).*', menuSetup)
-            if m:
-                menuSetup = m.groups()[0]
-            return "L1Topoconfig_" + menuSetup + "_" + TriggerFlags.menuVersion() + ".xml"
+            return "L1Topoconfig_" + _getMenuBaseName(TriggerFlags.triggerMenuSetup()) + "_" + TriggerFlags.menuVersion() + ".xml"
         else:
             return self.get_Value()
         
@@ -707,14 +704,11 @@ class inputLVL1configFile(JobProperty):
 _flags.append(inputLVL1configFile)
 
 # remove prescale suffixes
-def _getMenuBaseName( menuName):
-    log = logging.getLogger('TrigConfigSvcCfg')
-    pattern = re.compile(r'_v\d+|DC14')
-    patternPos = pattern.search(menuName)
-    if patternPos:
-        menuName=menuName[:patternPos.end()]
-    else:
-        log.info('Can\'t find pattern to shorten menu name, either non-existent in name or not implemented.')
+def _getMenuBaseName(menuName):
+    log = logging.getLogger(__name__)
+    m = re.match(r'(.*v\d(?:_primaries)?).*', menuName)
+    if m:
+        menuName = m.groups()[0]
     return menuName
 
 
@@ -861,7 +855,7 @@ class triggerMenuSetup(JobProperty):
         elif self.get_Value() == 'InitialBeam_default':
             self.set_Value(self._default_InitialBeam_menu)
             self._log.info("%s - trigger menu 'InitialBeam_default' changed to '%s'", self.__class__.__name__, self.get_Value())
-            
+
         # filenames for LVL1 and HLT
         if TriggerFlags.readLVL1configFromXML() is True:
             TriggerFlags.inputLVL1configFile = "LVL1config_"+_getMenuBaseName(TriggerFlags.triggerMenuSetup())+"_" + TriggerFlags.menuVersion() + ".xml"
-- 
GitLab


From 231a13893cd9efc60fa07f13f109c5d2c4b6803a Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 14 Sep 2020 23:47:48 +0200
Subject: [PATCH 144/422] Correcting value for no counts on plane / station

---
 .../python/Run3AFPExampleMonitorAlgorithm.py              | 2 +-
 .../AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx     | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index a9984ac641d1..f58861dd66de 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -104,6 +104,6 @@ if __name__=='__main__':
     from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
     cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
-    cfg.run(3000)
+    cfg.run(50000)
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index e9bd7664b4f1..bc42635bc766 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -238,8 +238,8 @@ void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb,
 		{
 			for(int i = 0; i < 4; i++)
 			{
-				clustersPerStationFloat = clusterCounterStationA[previouslbStationA][i]*1.0;
-				if(muPerBCID != 0)
+				clustersPerStationFloat = clusterCounterStationA[previouslbStationA][i];
+				if(muPerBCID != 0 && clustersPerStationFloat!=0)
 				{
 					clustersPerStationFloat = clustersPerStationFloat/(muPerBCID*counterForEventsStationA*4);
 				}
@@ -295,8 +295,8 @@ void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, i
 			{
 				for(int j=0; j<4; j++)
 				{
-					clustersPerPlaneFloat = clusterCounterPlane[previouslbPlane][i][j]*1.0;
-					if(muPerBCID != 0)
+					clustersPerPlaneFloat = clusterCounterPlane[previouslbPlane][i][j];
+					if(muPerBCID != 0 && clustersPerPlaneFloat != 0)
 					{
 						clustersPerPlaneFloat = clustersPerPlaneFloat/(muPerBCID*counterForEventsPlane);
 					}
-- 
GitLab


From 2533a714c8db8fdafba5e9e7d8dfcce6082ce86d Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Mon, 14 Sep 2020 19:14:44 -0700
Subject: [PATCH 145/422] Fix bugs during runtime

---
 .../Root/MVATrackVertexAssociationTool.cxx    | 39 ++++++++++++-------
 .../MVATrackVertexAssociationTool.h           |  7 ++--
 2 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
index a8888a9f3950..f9cfe4e337e5 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -28,15 +28,17 @@ MVATrackVertexAssociationTool::MVATrackVertexAssociationTool(const std::string&
   AsgTool(name),
   m_isSequential(true),
   m_wp("Tight"),
-  m_cut(-1.0)
+  m_cut(-1.0),
+  m_usePathResolver(true)
 {
-  declareProperty("NetworkFileName", m_fileName,     "Name of the input lwtnn network file."                                                              );
-  declareProperty("InputNames",      m_inputNames,   "Vector of the network's input variable names (std::vector<std::string>)."                           );
-  declareProperty("InputTypes",      m_inputTypes,   "Vector of the network's input variable evaluator types (std::vector<CP::MVAEvaluatorInput::Input>).");
-  declareProperty("OutputNodeName",  m_outputName,   "Name of the output node to cut on for TVA."                                                         );
-  declareProperty("IsSequential",    m_isSequential, "Is the network sequential (true) or functional (false)."                                            );
-  declareProperty("WorkingPoint",    m_wp,           "TVA working point to apply."                                                                        );
-  declareProperty("OutputCut",       m_cut,          "TVA cut value on the output value (set manually with \"Custom\" WP)."                               );
+  declareProperty("NetworkFileName", m_fileName,        "Name of the input lwtnn network file."                                                              );
+  declareProperty("InputNames",      m_inputNames,      "Vector of the network's input variable names (std::vector<std::string>)."                           );
+  declareProperty("InputTypes",      m_inputTypes,      "Vector of the network's input variable evaluator types (std::vector<CP::MVAEvaluatorInput::Input>).");
+  declareProperty("OutputNodeName",  m_outputName,      "Name of the output node to cut on for TVA."                                                         );
+  declareProperty("IsSequential",    m_isSequential,    "Is the network sequential (true) or functional (false)."                                            );
+  declareProperty("WorkingPoint",    m_wp,              "TVA working point to apply."                                                                        );
+  declareProperty("OutputCut",       m_cut,             "TVA cut value on the output value (set manually with \"Custom\" WP)."                               );
+  declareProperty("UsePathResolver", m_usePathResolver, "Use the PathResolver for finding the input lwtnn network file."                                     );
 }
 
 StatusCode MVATrackVertexAssociationTool::initialize() {
@@ -47,7 +49,7 @@ StatusCode MVATrackVertexAssociationTool::initialize() {
   ATH_CHECK(m_eventInfo.initialize());
 
   // Init network
-  if (this->initializeNetwork()) {
+  if (!this->initializeNetwork()) {
     ATH_MSG_ERROR("Could not initialize network properly.");
     return StatusCode::FAILURE;
   }
@@ -82,7 +84,7 @@ StatusCode MVATrackVertexAssociationTool::finalize() {
   ATH_MSG_INFO("Finalizing MVATrackVertexAssociationTool.");
 
   // Finalize network
-  if (this->finalizeNetwork()) {
+  if (!this->finalizeNetwork()) {
     ATH_MSG_ERROR("Could not finalize network properly.");
     return StatusCode::FAILURE;
   }
@@ -225,12 +227,21 @@ bool MVATrackVertexAssociationTool::initializeNetwork() {
   }
   m_inputEval.load(m_inputMap);
 
-  // Load our input file 
-  std::string fileName = PathResolverFindCalibFile(m_fileName);
-  if (fileName.empty()) {
-    throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : could not find input network file: " + m_fileName);
+  // Load our input file
+  std::string fileName; 
+  if (m_usePathResolver) {
+    fileName = PathResolverFindCalibFile(m_fileName);
+    if (fileName.empty()) {
+      throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : could not find input network file: " + m_fileName);
+    }
+  }
+  else {
+    fileName = m_fileName;
   }
   std::ifstream netFile(fileName);
+  if (!netFile) {
+    throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : could not properly open file: " + fileName);
+  }
 
   // For sequential:
   if (m_isSequential) {
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
index 384408f44b51..efac5789e215 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
@@ -23,12 +23,10 @@
 #include <vector>
 
 // Forward declarations
-#ifndef __CINT__
 namespace lwt {
   class LightweightNeuralNetwork;
   class LightweightGraph;
 }
-#endif
 
 namespace CP {
 
@@ -91,6 +89,9 @@ private:
   // TVA cut value on the output discriminant
   float m_cut;
 
+  // Use the PathResolver to find our input file
+  bool m_usePathResolver;
+
   // Input variable name/type map
   MVAInputEvaluator::InputSelectionMap m_inputMap;
 
@@ -104,10 +105,8 @@ private:
   std::string m_inputNodeName = ""; //!
 
   // Network as implemented using lwtnn
-  #ifndef __CINT__
   lwt::LightweightNeuralNetwork* m_network = nullptr; //!
   lwt::LightweightGraph*         m_graph   = nullptr; //!
-  #endif
 
 };
 
-- 
GitLab


From 0ec025b51174fd4d7dbeedab0a7eb48cc8c4289c Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Tue, 15 Sep 2020 11:56:58 +0200
Subject: [PATCH 146/422] start to update the Gaudi configuration - still works

---
 .../eflowRec/PFEGamFlowElementAssoc.h         |  8 +++---
 .../eflowRec/src/PFEGamFlowElementAssoc.cxx   | 28 +++++++++++--------
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
index d9ab23f033ad..edc70bae1d76 100644
--- a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
+++ b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
@@ -43,14 +43,14 @@ public:
   
 private:
   //instantiate ReadHandle for the Photon/Electron
-  SG::ReadHandleKey<xAOD::ElectronContainer>m_electronReadHandleKey{this,"ElectronContainer","Electron","ReadHandleKey for ElectronContainer"};
+  SG::ReadHandleKey<xAOD::ElectronContainer>m_electronReadHandleKey{this,"ElectronContainer","Electrons","ReadHandleKey for ElectronContainer"};
 
-  SG::ReadHandleKey<xAOD::PhotonContainer>m_photonReadHandleKey{this,"PhotonContainer","Photon","ReadHandleKey for PhotonContainer"};
+  SG::ReadHandleKey<xAOD::PhotonContainer>m_photonReadHandleKey{this,"PhotonContainer","Photons","ReadHandleKey for PhotonContainer"};
 
   //Readhandles for FlowElements.
-  SG::ReadHandleKey<xAOD::FlowElementContainer> m_neutralfeReadHandleKey{this,"JetEtMissNeutralFlowElementContainer","JetETMissNeutralFlowElement","ReadHandleKey for neutral FlowElements"};
+  SG::ReadHandleKey<xAOD::FlowElementContainer> m_neutralfeReadHandleKey{this,"JetEtMissNeutralFlowElementContainer","JetETMissNeutralFlowElements","ReadHandleKey for neutral FlowElements"};
   
-  SG::ReadHandleKey<xAOD::FlowElementContainer> m_chargedfeReadHandleKey{this,"JetEtMissChargedFlowElementContainer","JetETMissChargedFlowElement","ReadHandleKey for charged FlowElements"};
+  SG::ReadHandleKey<xAOD::FlowElementContainer> m_chargedfeReadHandleKey{this,"JetEtMissChargedFlowElementContainer","JetETMissChargedFlowElements","ReadHandleKey for charged FlowElements"};
 
 
   /** The write key for adding Neutral Flow Element element link decorations to electrons */ 
diff --git a/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
index e798d62a7a24..5e2d863affb2 100644
--- a/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
+++ b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
@@ -47,19 +47,25 @@ PFEGamFlowElementAssoc::~PFEGamFlowElementAssoc(){}
 StatusCode PFEGamFlowElementAssoc::initialize()
 {
 
-ATH_MSG_DEBUG("Initializing "<<name() << "...");
-ATH_CHECK(m_electronNeutralFEWriteDecorKey.initialize());   
-ATH_CHECK(m_electronChargedFEWriteDecorKey.initialize());   
-ATH_CHECK(m_neutralfeElectronWriteDecorKey.initialize());   
-ATH_CHECK(m_chargedfeElectronWriteDecorKey.initialize());  
-
-ATH_CHECK(m_photonNeutralFEWriteDecorKey.initialize());
-ATH_CHECK(m_photonChargedFEWriteDecorKey.initialize());
-ATH_CHECK(m_neutralfePhotonWriteDecorKey.initialize());
-ATH_CHECK(m_chargedfePhotonWriteDecorKey.initialize()); 
+  ATH_MSG_DEBUG("Initializing "<<name() << "...");
+ ATH_CHECK(m_electronNeutralFEWriteDecorKey.initialize());   
+ ATH_CHECK(m_electronChargedFEWriteDecorKey.initialize());   
+ ATH_CHECK(m_neutralfeElectronWriteDecorKey.initialize());   
+ ATH_CHECK(m_chargedfeElectronWriteDecorKey.initialize());  
+
+ ATH_CHECK(m_photonNeutralFEWriteDecorKey.initialize());
+ ATH_CHECK(m_photonChargedFEWriteDecorKey.initialize());
+ ATH_CHECK(m_neutralfePhotonWriteDecorKey.initialize());
+ ATH_CHECK(m_chargedfePhotonWriteDecorKey.initialize());
+
+ //Init ReadHandleKeys
+ ATH_CHECK(m_photonReadHandleKey.initialize());
+ ATH_CHECK(m_electronReadHandleKey.initialize());
+ ATH_CHECK(m_chargedfeReadHandleKey.initialize());
+ ATH_CHECK(m_neutralfeReadHandleKey.initialize());
 
  ATH_MSG_DEBUG("Initialization completed successfully");   
-
+ std::cout<<"I lost the game"<<std::endl;
 return StatusCode::SUCCESS;
 }
 
-- 
GitLab


From 3f97251042c459a53b7b14e0608ccd35d85abb3e Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Tue, 15 Sep 2020 17:02:57 +0200
Subject: [PATCH 147/422] code cleanup and remove debug lines

---
 .../eflowRec/PFEGamFlowElementAssoc.h         | 13 +++++---
 .../eflowRec/share/PFlowMTConfig.py           |  3 +-
 .../eflowRec/src/PFEGamFlowElementAssoc.cxx   | 31 +++++++++----------
 3 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
index edc70bae1d76..bd85a89ff92f 100644
--- a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
+++ b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
@@ -14,6 +14,10 @@
 #define PFEGAMFLOWELEMENTASSOC_H
 
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "StoreGate/DataHandle.h"
+
 #include "xAODEgamma/ElectronContainer.h"
 #include "xAODEgamma/PhotonContainer.h"
 
@@ -29,17 +33,18 @@ The algorithm also adds decorations to the "JetETMissNeutralParticleFlowObjects"
 "JetETMissChargedParticleFlowObjects" containers, 
 in the form of vectors of element links to the associated electrons and photons.
 */
-class PFEGamFlowElementAssoc : public AthAlgorithm {
+class PFEGamFlowElementAssoc : public AthReentrantAlgorithm {
 
 public:
+  using AthReentrantAlgorithm::AthReentrantAlgorithm;
 
   PFEGamFlowElementAssoc(const std::string& name, ISvcLocator* pSvcLocator);
   
   virtual ~PFEGamFlowElementAssoc();
 
-  virtual StatusCode initialize() override final;
-  virtual StatusCode execute() override final;
-  virtual StatusCode finalize() override final;
+  virtual StatusCode initialize();
+  virtual StatusCode execute(const EventContext & ctx) const;
+  virtual StatusCode finalize();
   
 private:
   //instantiate ReadHandle for the Photon/Electron
diff --git a/Reconstruction/eflowRec/share/PFlowMTConfig.py b/Reconstruction/eflowRec/share/PFlowMTConfig.py
index 6c9547942cb9..a169aca78497 100644
--- a/Reconstruction/eflowRec/share/PFlowMTConfig.py
+++ b/Reconstruction/eflowRec/share/PFlowMTConfig.py
@@ -246,7 +246,7 @@ topSequence += PFONeutralCreatorAlgorithm
 from eflowRec.eflowRecFlags import jobproperties # set reco flags for eFlowRec algorithms
 jobproperties.eflowRecFlags.usePFEGammaPFOAssoc.set_Value_and_Lock(True)
 jobproperties.eflowRecFlags.useFlowElements.set_Value_and_Lock(True)
-print("CONFIG_FLOW_ALG_AND_PFEGAMASSOC")
+
 if jobproperties.eflowRecFlags.usePFEGammaPFOAssoc:
    
    from eflowRec.eflowRecConf import PFEGammaPFOAssoc
@@ -267,7 +267,6 @@ if jobproperties.eflowRecFlags.useFlowElements or True:
   PFLCNeutralFlowElementCreatorAlgorithm = PFLCNeutralFlowElementCreatorAlgorithm("PFLCNeutralFlowElementCreatorAlgorithm")
   topSequence += PFLCNeutralFlowElementCreatorAlgorithm 
 
-  print("MATTFLOWALG")
   from eflowRec.eflowRecConf import PFEGamFlowElementAssoc
   PFEGamFlowElementAssoc=PFEGamFlowElementAssoc("PFEGamFlowElementAssoc")
   topSequence +=PFEGamFlowElementAssoc
diff --git a/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
index 5e2d863affb2..1fd39eb658df 100644
--- a/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
+++ b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
@@ -25,7 +25,7 @@ PFEGamFlowElementAssoc::PFEGamFlowElementAssoc(
 const std::string& name,
   ISvcLocator* pSvcLocator
   ):
-  AthAlgorithm(name,pSvcLocator)
+  AthReentrantAlgorithm(name,pSvcLocator)
 {
 // Class initializer 
 declareProperty ("ElectronNeutralFEDecorKey", m_electronNeutralFEWriteDecorKey = "Electrons.neutralfeLinks");   
@@ -65,7 +65,7 @@ StatusCode PFEGamFlowElementAssoc::initialize()
  ATH_CHECK(m_neutralfeReadHandleKey.initialize());
 
  ATH_MSG_DEBUG("Initialization completed successfully");   
- std::cout<<"I lost the game"<<std::endl;
+
 return StatusCode::SUCCESS;
 }
 
@@ -79,31 +79,30 @@ return StatusCode::SUCCESS;
    3) Link them
    4) output the Electron/Photon containers with the linkers to the Flow element containers 
 **/
-StatusCode PFEGamFlowElementAssoc::execute()
+StatusCode PFEGamFlowElementAssoc::execute(const EventContext &ctx) const
 {
-
   // write decoration handles for the electron, photon and FE containers -- these are the OUTPUT handles
   //Electron Write Handle
-  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronNeutralFEWriteDecorHandle (m_electronNeutralFEWriteDecorKey);   
-  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronChargedFEWriteDecorHandle (m_electronChargedFEWriteDecorKey);   
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > neutralfeElectronWriteDecorHandle (m_neutralfeElectronWriteDecorKey);   
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > chargedfeElectronWriteDecorHandle (m_chargedfeElectronWriteDecorKey); 
+  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronNeutralFEWriteDecorHandle (m_electronNeutralFEWriteDecorKey,ctx);   
+  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronChargedFEWriteDecorHandle (m_electronChargedFEWriteDecorKey,ctx);   
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > neutralfeElectronWriteDecorHandle (m_neutralfeElectronWriteDecorKey,ctx);   
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > chargedfeElectronWriteDecorHandle (m_chargedfeElectronWriteDecorKey,ctx); 
 
   //Photon Write Handle
-  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonNeutralFEWriteDecorHandle (m_photonNeutralFEWriteDecorKey);
-  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonChargedFEWriteDecorHandle (m_photonChargedFEWriteDecorKey);
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > neutralfePhotonWriteDecorHandle (m_neutralfePhotonWriteDecorKey);
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > chargedfePhotonWriteDecorHandle (m_chargedfePhotonWriteDecorKey);  
+  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonNeutralFEWriteDecorHandle (m_photonNeutralFEWriteDecorKey,ctx);
+  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonChargedFEWriteDecorHandle (m_photonChargedFEWriteDecorKey,ctx);
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > neutralfePhotonWriteDecorHandle (m_neutralfePhotonWriteDecorKey,ctx);
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > chargedfePhotonWriteDecorHandle (m_chargedfePhotonWriteDecorKey,ctx);  
   
   
   // This is the READ handles (so the input containers for electron, photon, FE)
   
-  SG::ReadHandle<xAOD::ElectronContainer>electronReadHandle (m_electronReadHandleKey);
-  SG::ReadHandle<xAOD::PhotonContainer> photonReadHandle (m_photonReadHandleKey);
+  SG::ReadHandle<xAOD::ElectronContainer>electronReadHandle (m_electronReadHandleKey,ctx);
+  SG::ReadHandle<xAOD::PhotonContainer> photonReadHandle (m_photonReadHandleKey,ctx);
   
   // Charged and Neutral PFlow "Flow elements"
-  SG::ReadHandle<xAOD::FlowElementContainer> neutralfeReadHandle (m_neutralfeReadHandleKey);   
-  SG::ReadHandle<xAOD::FlowElementContainer> chargedfeReadHandle (m_chargedfeReadHandleKey);   
+  SG::ReadHandle<xAOD::FlowElementContainer> neutralfeReadHandle (m_neutralfeReadHandleKey,ctx);   
+  SG::ReadHandle<xAOD::FlowElementContainer> chargedfeReadHandle (m_chargedfeReadHandleKey,ctx);   
   
   // now initialise some Flow element link containers
   std::vector<std::vector<FlowElementLink_t>> electronNeutralFEVec(electronReadHandle->size());
-- 
GitLab


From 7ab907b93b70361f93e6247e9c8df2fc748e8d68 Mon Sep 17 00:00:00 2001
From: Jannik Geisen <jannik.geisen@cern.ch>
Date: Tue, 15 Sep 2020 18:13:57 +0200
Subject: [PATCH 148/422] adding option to run all chain jets, storing plots in
 expert folder

---
 .../JetMonitoring/JetMonitoringAlg.h             |  3 ++-
 .../JetMonitoring/python/JetMonitoringConfig.py  |  2 ++
 .../Jet/JetMonitoring/src/JetMonitoringAlg.cxx   |  5 +++--
 .../python/TrigJetMonitorAlgorithm.py            | 16 ++++++++++++----
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
index bab697afa22e..0a058ed241d4 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
@@ -39,6 +39,7 @@ private:
   ToolHandleArray<IJetHistoFiller> m_jetFillerTools;
 
   bool m_failureOnMissingContainer;
-  
+  bool m_onlyPassingJets;
+
 };
 #endif
diff --git a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py
index 3fcd54da34b1..df7a618cb4f3 100644
--- a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py
+++ b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py
@@ -515,6 +515,7 @@ class JetMonAlgSpec(ConfigDict):
         args.setdefault('topLevelDir', 'Jets/')
         args.setdefault('bottomLevelDir', '')
         args.setdefault('failureOnMissingContainer', True)
+        args.setdefault('onlyPassingJets', True)
         ConfigDict.__init__(self, defaultPath=defaultPath, TriggerChain=TriggerChain, **args)
         tmpL = self.FillerTools
         self.FillerTools = []
@@ -530,6 +531,7 @@ class JetMonAlgSpec(ConfigDict):
         alg.TriggerChain = self.TriggerChain
         alg.JetContainerName = self.JetContainerName
         alg.FailureOnMissingContainer = self.failureOnMissingContainer
+        alg.OnlyPassingJets = self.onlyPassingJets
         
         path = self.defaultPath
         tools = []
diff --git a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
index b9d0a9085ee3..4ca5f409a7f5 100644
--- a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
+++ b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
@@ -9,11 +9,12 @@
 
 JetMonitoringAlg::JetMonitoringAlg( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
-,m_jetContainerKey("AntiKt4LCTopoJets"), m_jetFillerTools(this), m_failureOnMissingContainer(true)
+,m_jetContainerKey("AntiKt4LCTopoJets"), m_jetFillerTools(this), m_failureOnMissingContainer(true), m_onlyPassingJets(true)
 {
     declareProperty("JetContainerName",m_jetContainerKey);
     declareProperty("FillerTools", m_jetFillerTools);
     declareProperty("FailureOnMissingContainer", m_failureOnMissingContainer);
+    declareProperty("OnlyPassingJets", m_onlyPassingJets);
 }
 
 
@@ -38,7 +39,7 @@ StatusCode JetMonitoringAlg::initialize() {
 
 
 StatusCode JetMonitoringAlg::fillHistograms( const EventContext& ctx ) const {
-  if (m_triggerChainString != "") {
+  if (m_triggerChainString != "" && m_onlyPassingJets) {
     ATH_MSG_DEBUG("JetMonitoringAlg::fillHistograms(const EventContext&) -> enter triggerChainString = "<<m_triggerChainString);
    
     ConstDataVector< xAOD::JetContainer > tmpCont(SG::VIEW_ELEMENTS);
diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
index 632c96c40819..af4b59c0fbc3 100644
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
@@ -288,7 +288,7 @@ def l1JetMonitoringConfig(inputFlags,jetcoll,chain=''):
   conf = L1JetMonAlg(name,jetcoll,chain)
   return conf
 
-def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT):
+def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT,onlyUsePassingJets=True):
    '''Function to configures some algorithms in the monitoring system.'''
 
    # Remap online Run 2 jet collections
@@ -304,6 +304,11 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT):
    else:
      chainFolder = chain
 
+   jetMonAlgSpecName = chain+"TrigMon"
+   if not onlyUsePassingJets:
+     chainFolder = chainFolder + "/ExpertHistos"
+     jetMonAlgSpecName = jetMonAlgSpecName + "_ExpertHistos"
+     
    # We schedule a new JetAlg which will be acting only when a TriggerChain fired (using the TriggerChain from the base classes).
    # We'll plot 1 histo build by a dedicated JetHistoTriggEfficiency tool.
    # So we'll have to explicitely give a specification via the generic dicionnary 'ToolSpec'
@@ -341,13 +346,14 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT):
 
    from JetMonitoring.JetMonitoringConfig import retrieveVarToolConf
    trigConf = JetMonAlgSpec( # the usual JetMonAlgSpec 
-       chain+"TrigMon",
+       jetMonAlgSpecName,
        JetContainerName = jetcoll,
        TriggerChain = chain,
        defaultPath = chainFolder,
        topLevelDir="HLT/JetMon/Online/",
        bottomLevelDir=jetcollFolder,
        failureOnMissingContainer=True,
+       onlyPassingJets=onlyUsePassingJets,
        )
    trigConf.appendHistos(
            "pt",
@@ -469,8 +475,10 @@ if __name__=='__main__':
 
   # Loop over HLT jet chains
   for chain,jetcoll in Chain2JetCollDict[InputType].items():
-    chainMonitorConf = jetChainMonitoringConfig(ConfigFlags,jetcoll,chain,AthenaMT)
-    chainMonitorConf.toAlg(helper)
+    chainMonitorConfT = jetChainMonitoringConfig(ConfigFlags,jetcoll,chain,AthenaMT,True)
+    chainMonitorConfT.toAlg(helper)
+    chainMonitorConfF = jetChainMonitoringConfig(ConfigFlags,jetcoll,chain,AthenaMT,False)
+    chainMonitorConfF.toAlg(helper)
 
   cfg.merge(helper.result())
   
-- 
GitLab


From fdbcfc4cc372d64d381ce0fd0e9a6b3710ac5084 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Tue, 15 Sep 2020 23:07:06 +0200
Subject: [PATCH 149/422] Start Cleanup of Vertex Image Maker

---
 .../TrkVertexSeedFinderTools/CMakeLists.txt   |   7 +-
 .../ImagingSeedFinder.h                       | 105 ---
 .../share/ImagingSeedFinder.ref               | 430 ------------
 .../share/ImagingSeedFinder_test.py           |  28 -
 .../src/ImagingSeedFinder.cxx                 | 153 -----
 .../TrkVertexSeedFinderTools_entries.cxx      |   2 -
 .../TrkVertexSeedFinderUtils/CMakeLists.txt   | 157 ++---
 .../IVertexImageMaker.h                       |  50 --
 .../LocalMax1DClusterFinder.h                 |  55 --
 .../SimpleVertexClusterFinder.h               |  67 --
 .../TrkVertexSeedFinderUtils/VertexImage.h    | 116 ----
 .../VertexImageMaker.h                        | 100 ---
 .../share/SimpleVertexClusterFinder_test.ref  |  19 -
 .../src/FsmwMode1dFinder.cxx                  |   2 +-
 .../src/GaussianDensityTestAlg.cxx            |   2 +-
 .../src/GaussianTrackDensity.cxx              |   6 +-
 .../src/ImagingSeedTuningAlg.cxx              | 615 ------------------
 .../src/ImagingSeedTuningAlg.h                | 202 ------
 .../src/LocalMax1DClusterFinder.cxx           | 181 ------
 .../src/SimpleVertexClusterFinder.cxx         | 197 ------
 .../src/VertexImage.cxx                       | 346 ----------
 .../src/VertexImageMaker.cxx                  | 379 -----------
 .../TrkVertexSeedFinderUtils_entries.cxx      |  18 +-
 .../test/GaussianTrackDensity_test.cxx        |  19 +-
 .../test/Mode3dFromFsmw1dFinder_test.cxx      |  16 +-
 .../test/Mode3dTo1dFinder_test.cxx            |  18 +-
 .../test/NewtonTrkDistanceFinder_test.cxx     |  19 +-
 .../test/SeedNewtonTrkDistanceFinder_test.cxx |  16 +-
 .../test/SimpleVertexClusterFinder_test.cxx   | 146 -----
 .../test/Trk2DDistanceFinder_test.cxx         |  16 +-
 .../test/Trk2dDistanceSeeder_test.cxx         |  21 +-
 31 files changed, 131 insertions(+), 3377 deletions(-)
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/ImagingSeedFinder.h
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder.ref
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder_test.py
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/ImagingSeedFinder.cxx
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/IVertexImageMaker.h
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/LocalMax1DClusterFinder.h
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImage.h
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImageMaker.h
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/share/SimpleVertexClusterFinder_test.ref
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.h
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/LocalMax1DClusterFinder.cxx
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/SimpleVertexClusterFinder.cxx
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImage.cxx
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImageMaker.cxx
 delete mode 100644 Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx

diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt
index 4108623f4509..0a438476f252 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt
@@ -33,14 +33,16 @@ atlas_add_library( TrkVertexSeedFinderToolsLib
                    TrkVertexSeedFinderTools/*.h
                    INTERFACE
                    PUBLIC_HEADERS TrkVertexSeedFinderTools
-                   LINK_LIBRARIES GaudiKernel AthenaBaseComps TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib xAODEventInfo GeneratorObjects AtlasHepMCLib CxxUtils )
+                   LINK_LIBRARIES GaudiKernel AthenaBaseComps TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib 
+		   xAODEventInfo GeneratorObjects AtlasHepMCLib CxxUtils )
 
 # Component(s) in the package:
 atlas_add_component( TrkVertexSeedFinderTools
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} 
-                     LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} TrkVertexSeedFinderToolsLib GeoPrimitives EventPrimitives  TruthHelper  TrkEventPrimitives TrkParameters TrkTrack VxVertex  )
+                     LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} TrkVertexSeedFinderToolsLib GeoPrimitives EventPrimitives  
+		     TruthHelper  TrkEventPrimitives TrkParameters TrkTrack VxVertex  )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
@@ -77,5 +79,4 @@ run_seed_test( ZScanSeedFinder )
 run_seed_test( CrossDistancesSeedFinder )
 run_seed_test( IndexedCrossDistancesSeedFinder )
 run_seed_test( TrackDensitySeedFinder )
-run_seed_test( ImagingSeedFinder )
 run_seed_test( MCTrueSeedFinder )
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/ImagingSeedFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/ImagingSeedFinder.h
deleted file mode 100644
index 0692475a33b1..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/ImagingSeedFinder.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRKVERTEXSEEDFINDERTOOLS_IMAGINGSEEDFINDER_H
-#define TRKVERTEXSEEDFINDERTOOLS_IMAGINGSEEDFINDER_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "TrkVertexFitterInterfaces/IVertexSeedFinder.h"
-#include "TrkVertexSeedFinderUtils/VertexImage.h"
-#include "xAODEventInfo/EventInfo.h"
-
-//class IBeamCondSvc; //Beam spot constraint from here
-
-namespace Trk
-{
-
-  class Track;
-  class IVertexImageMaker;
-  class IVertexClusterFinder;
-  class VertexCluster;
-
-  // @author Matt Rudolph (matthew.scott.rudolph@cern.ch) Lars Egholm Pedersen (egholm...)
-  // This class implements a multiseed finder using a filtering technique inspired by imaging algorithms
-  // As a backup, the single findSeed methods are implemented using a cache of the result from findMultiSeed
-  // @ATLAS software
-  // 
-  // ----------------------------------------
-  // Changes:
-  //
-  // David Shope <david.richard.shope@cern.ch> (2016-04-19)
-  //
-  // EDM Migration to xAOD - from Trk::VxCandidate to xAOD::Vertex, 
-  //                         from Trk::RecVertex   to xAOD::Vertex,
-  //                         from Trk::Vertex      to Amg::Vector3D
-
-  class ImagingSeedFinder : public extends<AthAlgTool, IVertexSeedFinder>
-  {
-  public:
-    // Standard Gaudi constructor.
-    ImagingSeedFinder (const std::string& t,
-                       const std::string& n,
-                       const IInterface*  p);
-
-
-    virtual ~ImagingSeedFinder();
-
-
-    virtual StatusCode initialize() override;
-    virtual StatusCode finalize() override;
-
-
-    using IVertexSeedFinder::findSeed;
-
-    /**
-     *  Finds a linearization point out of a vector of tracks
-     *  and returns it as an Amg::Vector3D object. If you want an 
-     *  additional constraint can be taken into account.
-     */
-    virtual Amg::Vector3D
-    findSeed(const std::vector<const Trk::Track*> & vectorTrk,
-             const xAOD::Vertex * constraint=0) const override;
-    
-
-    /** 
-     * Finds a linearization point out of a vector of TrackParameters
-     *  and returns it as an Amg::Vector3D object. If you want an 
-     * additional constraint can be taken into account.
-     */
-    virtual Amg::Vector3D
-    findSeed (const std::vector<const Trk::TrackParameters*> &parametersList,
-              const xAOD::Vertex * constraint=0) const override;
-
-
-    /**
-     * Finds full vector of linearization points from a vector of tracks
-     *  and returns it as an Amg::Vector3D object.  Intended for seed finders that produce all at once.
-     *  If you want an additional constraint can be taken into account.
-     */
-    virtual std::vector<Amg::Vector3D>
-    findMultiSeeds (const std::vector<const Trk::Track*>& vectorTrk,
-                    const xAOD::Vertex * constraint=0) const override;
-
-
-    /**
-     * Finds full vector of linearization points from a vector
-     * of TrackParameters and returns it as an Amg::Vector3D object.
-     * Intended for seed finders that produce all at once.
-     * If you want an additional constraint can be taken into account.
-     */
-    virtual std::vector<Amg::Vector3D>
-    findMultiSeeds(const std::vector<const Trk::TrackParameters*>& parametersList,
-                   const xAOD::Vertex * constraint=0) const override;
-
-
-  private:
-    //Tool that actually makes the image to process
-    ToolHandle< Trk::IVertexImageMaker > m_vertexImageMaker;
-
-    //Clustering util
-    ToolHandle< Trk::IVertexClusterFinder > m_VertexClusterFinder;
-  };
-}
-#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder.ref b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder.ref
deleted file mode 100644
index 57d37f6313a4..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder.ref
+++ /dev/null
@@ -1,430 +0,0 @@
-Sat Mar  7 19:21:22 CET 2020
-Preloading tcmalloc_minimal.so
-Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.12] [x86_64-centos7-gcc8-dbg] [atlas-work3/d935ebad997] -- built on [2020-03-07T1715]
-Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
-Py:Athena            INFO executing ROOT6Setup
-Py:Athena            INFO including file "AthenaCommon/Execution.py"
-Py:Athena            INFO including file "TrkVertexSeedFinderTools/ImagingSeedFinder_test.py"
-Py:Athena            INFO including file "TrkVertexSeedFinderTools/VertexSeedFinderTestCommon.py"
-Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
-Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5514 configurables from 60 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.12
-Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
-Py:ConfiguredFactory    INFO imported 138 confDb modules in 1.54 seconds
-Py:Athena            INFO Importing MagFieldServices.SetupField
-Py:Athena            INFO Importing MagFieldServices.MagFieldServicesSetup
-[ TrackingGeometrySvc ]     base material tag :  AtlasLayerMat_v21_
-[ TrackingGeometrySvc ]     translated to COOL:  /GLOBAL/TrackingGeo/LayerMaterialV2<tag>TagInfoMajor/AtlasLayerMat_v21_/GeoAtlas</tag>
-Py:Athena            INFO including file "AthenaCommon/runbatch.py"
-ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
-ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
-ApplicationMgr    SUCCESS 
-====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v33r0)
-                                          running on lxplus7100.cern.ch on Sat Mar  7 19:21:36 2020
-====================================================================================================================================
-ApplicationMgr       INFO Application Manager Configured successfully
-ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
-StatusCodeSvc        INFO initialize
-AthDictLoaderSvc     INFO in initialize...
-AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO  getRegistryEntries: read 3736 CLIDRegistry entries for module ALL
-CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
-CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
-MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
-AthenaPoolCnvSvc     INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00
-PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
-PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
-PoolSvc              INFO Frontier compression level set to 5
-DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2020-03-06T2143/Athena/22.0.12/InstallArea/x86_64-centos7-gcc8-dbg/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus7100.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
-PoolSvc              INFO Successfully setup replica sorting algorithm
-PoolSvc              INFO Setting up APR FileCatalog and Streams
-PoolSvc           WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
-PoolSvc           WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
-PoolSvc              INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml
-PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml
-DbSession            INFO     Open     DbSession    
-Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
-MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray([])
-IOVDbSvc             INFO Opened read transaction for POOL PersistencySvc
-IOVDbSvc             INFO Only 5 POOL conditions files will be open at once
-IOVDbSvc             INFO Cache alignment will be done in 3 slices
-IOVDbSvc             INFO Global tag: OFLCOND-RUN12-SDR-35 set from joboptions
-IOVDbFolder          INFO Read from meta data only for folder /TagInfo
-IOVDbFolder          INFO Inputfile tag override disabled for /GLOBAL/BField/Maps
-IOVDbSvc             INFO Initialised with 5 connections and 8 folders
-IOVDbSvc             INFO Service IOVDbSvc initialised successfully
-ClassIDSvc           INFO  getRegistryEntries: read 1914 CLIDRegistry entries for module ALL
-IOVDbSvc             INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_INDET/OFLP200
-IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
-IOVSvc.IOVSvcTool    INFO IOVRanges will be checked at every Event
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_TRT/OFLP200
-IOVDbSvc             INFO Disconnecting from COOLOFL_INDET/OFLP200
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_GLOBAL/OFLP200
-IOVDbSvc             INFO Disconnecting from COOLOFL_TRT/OFLP200
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/OFLP200
-IOVDbSvc             INFO Disconnecting from COOLOFL_GLOBAL/OFLP200
-IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/OFLP200
-IOVDbSvc             INFO Added taginfo remove for /EXT/DCS/MAGNETS/SENSORDATA
-IOVDbSvc             INFO Added taginfo remove for /GLOBAL/BField/Maps
-IOVDbSvc             INFO Added taginfo remove for /GLOBAL/TrackingGeo/LayerMaterialV2
-IOVDbSvc             INFO Added taginfo remove for /Indet/Align
-IOVDbSvc             INFO Added taginfo remove for /Indet/IBLDist
-IOVDbSvc             INFO Added taginfo remove for /Indet/PixelDist
-IOVDbSvc             INFO Added taginfo remove for /TRT/Align
-ClassIDSvc           INFO  getRegistryEntries: read 268 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 35 CLIDRegistry entries for module ALL
-DetDescrCnvSvc       INFO  initializing 
-DetDescrCnvSvc       INFO Found DetectorStore service
-DetDescrCnvSvc       INFO  filling proxies for detector managers 
-DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for SCT_ID with CLID 2517 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for TRT_ID with CLID 2518 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for SiliconID with CLID 129452393 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArEM_ID with CLID 163583365 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArEM_SuperCell_ID with CLID 99488227 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArHEC_ID with CLID 3870484 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArHEC_SuperCell_ID with CLID 254277678 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArFCAL_ID with CLID 45738051 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArFCAL_SuperCell_ID with CLID 12829437 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArMiniFCAL_ID with CLID 79264204 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArOnlineID with CLID 158698068 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for TTOnlineID with CLID 38321944 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArOnline_SuperCellID with CLID 115600394 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArHVLineID with CLID 27863673 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArElectrodeID with CLID 80757351 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for TileID with CLID 2901 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for Tile_SuperCell_ID with CLID 49557789 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for TileHWID with CLID 2902 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for TileTBID with CLID 2903 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for MDTIDHELPER with CLID 4170 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for CSCIDHELPER with CLID 4171 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for RPCIDHELPER with CLID 4172 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for TGCIDHELPER with CLID 4173 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for CaloLVL1_ID with CLID 108133391 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for CaloCell_ID with CLID 123500438 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for CaloCell_SuperCell_ID with CLID 128365736 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for CaloDM_ID with CLID 167756483 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for ZdcID with CLID 190591643 and storage type 68 to detector store 
-GeoModelSvc::RD...WARNING  Getting PixTBMatComponents with default tag
-GeoModelSvc::RD...WARNING  Getting PixTBMaterials with default tag
-GeoModelSvc::RD...WARNING  Getting InDetMatComponents with default tag
-GeoModelSvc::RD...WARNING  Getting InDetMaterials with default tag
-IBLParameterSvc      INFO IBL geometry
-EventPersistenc...   INFO Added successfully Conversion service:DetDescrCnvSvc
-PixelIDDetDescrCnv   INFO in createObj: creating a PixelID helper object in the detector store
-IdDictDetDescrCnv    INFO in initialize
-IdDictDetDescrCnv    INFO in createObj: creating a IdDictManager object in the detector store
-IdDictDetDescrCnv    INFO IdDictName:  IdDictParser/ATLAS_IDS.xml
-IdDictDetDescrCnv    INFO Reading InnerDetector    IdDict file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
-IdDictDetDescrCnv    INFO Reading LArCalorimeter   IdDict file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
-IdDictDetDescrCnv    INFO Reading TileCalorimeter  IdDict file IdDictParser/IdDictTileCalorimeter.xml
-IdDictDetDescrCnv    INFO Reading Calorimeter      IdDict file IdDictParser/IdDictCalorimeter_L1Onl.xml
-IdDictDetDescrCnv    INFO Reading MuonSpectrometer IdDict file IdDictParser/IdDictMuonSpectrometer_R.03.xml
-IdDictDetDescrCnv    INFO Reading ForwardDetectors IdDict file IdDictParser/IdDictForwardDetectors_2010.xml
-IdDictDetDescrCnv    INFO Found id dicts:
-IdDictDetDescrCnv    INFO Using dictionary tag: null
-IdDictDetDescrCnv    INFO Dictionary ATLAS                version default              DetDescr tag (using default) file 
-IdDictDetDescrCnv    INFO Dictionary Calorimeter          version default              DetDescr tag CaloIdentifier-LVL1-02 file IdDictParser/IdDictCalorimeter_L1Onl.xml
-IdDictDetDescrCnv    INFO Dictionary ForwardDetectors     version default              DetDescr tag ForDetIdentifier-01       file IdDictParser/IdDictForwardDetectors_2010.xml
-IdDictDetDescrCnv    INFO Dictionary InnerDetector        version IBL-DBM              DetDescr tag InDetIdentifier-IBL3D25-02 file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
-IdDictDetDescrCnv    INFO Dictionary LArCalorimeter       version fullAtlas            DetDescr tag LArIdentifier-DC3-05-Comm file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
-IdDictDetDescrCnv    INFO Dictionary LArElectrode         version fullAtlas            DetDescr tag (using default) file 
-IdDictDetDescrCnv    INFO Dictionary LArHighVoltage       version fullAtlas            DetDescr tag (using default) file 
-IdDictDetDescrCnv    INFO Dictionary MuonSpectrometer     version R.03                 DetDescr tag MuonIdentifier-08         file IdDictParser/IdDictMuonSpectrometer_R.03.xml
-IdDictDetDescrCnv    INFO Dictionary TileCalorimeter      version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00         file IdDictParser/IdDictTileCalorimeter.xml
-PixelID              INFO Initialize from dictionary
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-indet 1 2,4,5,7,10,11,12,13 7 1fffffffffffffff 61 3 0 min/max 2 13 values  2 4 5 7 10 11 12 13 indexes  0 0 1 2 0 3 0 0 4 5 6 7 indices  8 prev  0 next  0 mode  enumerated  cont mode  none  
-pixel 1 1:3 3 e7ffffffffffffff 59 2 3 min/max 1 3 values  indexes  indices  3 prev  0 next  0 mode  both_bounded  cont mode  none  
-bec 1 -4,-2,0,2,4 7 f8ffffffffffffff 56 3 5 min/max -4 4 values  -4 -2 0 2 4 indexes  0 0 1 0 2 0 3 0 4 indices  5 prev  0 next  0 mode  enumerated  cont mode  none  
-bec_shift 0 0 0 0 0 0 0 min/max 0 0 values  indexes  indices  0 prev  0 next  0 mode  both_bounded  cont mode  none  
-lay_disk 0 0:3 3 ff3fffffffffffff 54 2 8 min/max 0 3 values  indexes  indices  4 prev  0 next  0 mode  both_bounded  cont mode  none  
-lay_disk_shift 0 0 0 0 0 0 0 min/max 0 0 values  indexes  indices  0 prev  0 next  0 mode  both_bounded  cont mode  none  
-phi_mod 0 0:63 3f ffc0ffffffffffff 48 6 10 min/max 0 63 values  indexes  indices  64 prev  0 next  0 mode  both_bounded  cont mode  none  
-phi_mod_shift 0 0 0 0 0 0 0 min/max 0 0 values  indexes  indices  0 prev  0 next  0 mode  both_bounded  cont mode  none  
-eta_mod 1 -10:9 1f ffff07ffffffffff 43 5 16 min/max -10 9 values  indexes  indices  20 prev  0 next  0 mode  both_bounded  cont mode  none  
-eta_mod_shift 0 0 0 0 0 0 0 min/max 0 0 values  indexes  indices  0 prev  0 next  0 mode  both_bounded  cont mode  none  
-phi_index 0 0:376 1ff fffff803ffffffff 34 9 21 min/max 0 376 values  indexes  indices  377 prev  0 next  0 mode  both_bounded  cont mode  none  
-eta_index 0 0:335 1ff fffffffc01ffffff 25 9 30 min/max 0 335 values  indexes  indices  336 prev  0 next  0 mode  both_bounded  cont mode  none  
-bec_eta_mod 0 0 0 0 0 0 0 min/max 0 0 values  indexes  indices  0 prev  0 next  0 mode  both_bounded  cont mode  none  
-PixelID::initLevelsFromDict - found levels 
-subdet        0
-part          1
-barrel_endcap 2
-layer or disk 3
-phi_module    4
-eta_module    5
-phi_index     6
-eta_index     7
-InDetGeometryDBSvc   INFO GeometryDBSvc Initialized
-PixelGeoModel        INFO Retrieving Record Sets from database ...
-PixelGeoModel        INFO Key = ATLAS-R2-2016-01-00-01 Node = ATLAS
-PixelGeoModel        INFO ... Record Sets retrieved.
-PixelGeoModel        INFO DBM switch = SetDBMFlag: 1
-PixelGeoModel        INFO Building Pixel Detector
-PixelGeoModel        INFO  Version: Pixel-IBL3D25-33, Name: IBL, Layout: IBL, Code Version: 5.01.00, Description: IBL_Geometry
-GEOPIXELSERVICES pixel : 28.995 245 //  3460
-GEOPIXELSERVICES barrel : 28.997 143 //  -460 460
-GEOPIXELSERVICES endcap : 82 175 //  484 670
-PixelGeoModel        INFO Build detailed stave support description :  layout 5
-PixelGeoModel        INFO Si3D/SiPl radial shift : -0.015
-PixelGeoModel        INFO Module thicknesses :  SiPl P/N 0.31 0.44 20.86  SiPl P/N 0.31 1.72 20.86  //  0.325 1.705
-PixelGeoModel        INFO Pixel modules 12 -> planar/3D : 12 8
-PixelGeoModel        INFO Module length/gap : 41.3 / 20.45 0.205  -> Stave length : 748
-PixelGeoModel        INFO    planar/3D/endblock/NonActive lengths : 497.855 165.24 69.8 7.5525
-PixelGeoModel        INFO Flex thickness (max) : 0.45 computed for 16 modules 
-PixelGeoModel        INFO  Omega MidStaveCenterX  = 1.55
-PixelGeoModel        INFO  Omega MidStaveAngle  = 0.296706
-PixelGeoModel        INFO  Omega MidStaveRadius  = 1.655
-PixelGeoModel        INFO  Omega EndStaveCenterX  = -1.25
-PixelGeoModel        INFO  Omega EndStaveCenterY  = 7.45
-PixelGeoModel        INFO  Omega EndStaveAngle  = 2.35619
-PixelGeoModel        INFO  Omega EndStaveRadius  = 2.155
-PixelGeoModel        INFO  Omega Thickness  = 0.145
-PixelGeoModel        INFO  MechanicalStaveWidth  = 18.8
-PixelGeoModel        INFO  MechanicalStaveLength = 748
-PixelGeoModel        INFO  MechanicalStaveOffset = -0.95
-PixelGeoModel        INFO  StaveModuleOffset     = 0.01
-PixelGeoModel        INFO  MechanicalStaveEndBlockLength = 34.9
-PixelGeoModel        INFO  FacePlateThick  = 0.215
-PixelGeoModel        INFO  TubeOuterDiam   = 1.75
-PixelGeoModel        INFO  TubeInnerDiam   = 1.5
-PixelGeoModel        INFO  TubeMiddlePos   = 1.3
-PixelGeoModel        INFO  FlexBaseThick   = 0.45
-PixelGeoModel        INFO  FlexLayerThick  = 0.02
-PixelGeoModel        INFO  FlexWidth       = 11.5
-PixelGeoModel        INFO  FlexOffset      = 0.6
-PixelGeoModel        INFO  XOffset / ladder = 0.01
-PixelGeoModel        INFO ** OMEGA : with Stycast 0.1
-PixelGeoModel        INFO ***> new material : OmegaGlue_IBL 3.31517
-PixelGeoModel        INFO  ** FacePlate : with Stycast 0.1  grease : 0.07
-PixelGeoModel        INFO ***> new material : FacePlateGlue_IBL 3.31517
-PixelGeoModel        INFO ** FacePlate : with grease
-PixelGeoModel        INFO ***> new material : FacePlateGlueGrease_IBL 3.04977
-PixelGeoModel        INFO Flex angle : 0.296641  Flex pos. in Z : (2.60312,4.19227,22.9025) 0.45 / (2.60312,4.19227,62.2575) 0.45 / (2.60312,4.19227,103.762) 0.45 / (2.60312,4.19227,145.267) 0.45 / (2.60312,4.19227,186.772) 0.45 / (2.60312,4.19227,228.277) 0.45 / (2.60312,4.19227,269.782) 0.45 / (2.60312,4.19227,314.817) 0.45 / 
-PixelGeoModel        INFO ** TUBE : with Stycast 0.1  diam 0.875 0.75
-PixelGeoModel        INFO ***> new material : CoolingPipeGlue_IBL 6.72585
-PixelGeoModel        INFO IBL EOS : mechanical stave length : 374
-PixelGeoModel        INFO IBL EOS :            service Zpos : 366.552
-PixelGeoModel        INFO IBL EOS :           endblock Zpos : 356.552
-PixelGeoModel        INFO IBL EOS :         endblock length : 34.896
-PixelGeoModel        INFO IBL EOS :     endblock srv length : 20
-PixelGeoModel        INFO Flex half thickness srv : 0.45
-PixelGeoModel        INFO  stave xoffset = 0.32
-PixelGeoModel        INFO  stave yoffset = -0.95
-PixelGeoModel        INFO Stave envelop length : 748 ->  339.101
-PixelGeoModel        INFO *** LAYER 0  planar/3D modules : 12 8
-PixelGeoModel        INFO Layer IBL / stave ring :  outer radius max  42.001
-PixelGeoModel        INFO Layer 0 in/out radius 29.7573  42.001
-PixelGeoModel        INFO IBL stave ring support
-PixelGeoModel        INFO Build IBL stave ring services
-PixelGeoModel        INFO Build detailed stave ring support : Brl0A_StaveRing  AC
-PixelGeoModel        INFO Build detailed stave ring support - logVol : Brl0A_StaveRing
-PixelGeoModel        INFO Build detailed stave ring support : Brl0C_StaveRing  AC
-PixelGeoModel        INFO Build detailed stave ring support - logVol : Brl0C_StaveRing
-PixelGeoModel        INFO Build detailed stave ring support : Brl0M_StaveRing  Mid
-PixelGeoModel        INFO Build detailed stave ring support - logVol : Brl0M_StaveRing
-PixelGeoModel        INFO Build IBL I-Flex services
-PixelGeoModel        INFO *** LAYER 1  planar/3D modules : 0 0
-PixelGeoModel        INFO Layer 1 in/out radius 46.2723  64.1329
-PixelGeoModel        INFO *** LAYER 2  planar/3D modules : 0 0
-PixelGeoModel        INFO Layer 2 in/out radius 83.7078  102.132
-PixelGeoModel        INFO *** LAYER 3  planar/3D modules : 0 0
-PixelGeoModel        INFO Layer 3 in/out radius 117.51  136.132
-PixelGeoModel        INFO Build IBL I-Flex services
-PixelGeoModel        INFO Build IBL I-Flex services
-PixelGeoModel        INFO Build IBL I-Flex services
-PixelGeoModel        INFO Build IBL fwd services - CAD tool design / S. model1 : 0/0
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/ID, level 2, with frame global.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIX, level 1, with frame global.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXB1, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXB2, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXB3, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXB4, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEA1, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEA2, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEA3, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEC1, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEC2, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEC3, level 0, with frame local.
-PixelGeoModel        INFO Doing consistency checks.
-PixelGeoModel        INFO Number of barrel elements       : 1736
-PixelGeoModel        INFO Number of endcap elements       : 288
-PixelGeoModel        INFO Number of endcap elements (DBM) : 24
-PixelGeoModel        INFO Total                           : 2048
-PixelGeoModel        INFO MaxHash                         : 2048
-SCT_IDDetDescrCnv    INFO in createObj: creating a SCT_ID helper object in the detector store
-SCT_ID               INFO 
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-SCT_GeoModel         INFO Retrieving Record Sets from database ...
-SCT_GeoModel         INFO Building SCT Detector.
-SCT_GeoModel         INFO  Version: SCT-GEO-00, Name: GEO, Layout: Final, Code Version: 3.06.00, Description: Atlas Geometry 2008
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/ID, level 3, with frame global.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCT, level 2, with frame global.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTB1, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTB2, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTB3, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTB4, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA1, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA2, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA3, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA4, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA5, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA6, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA7, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA8, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA9, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC1, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC2, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC3, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC4, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC5, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC6, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC7, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC8, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC9, level 1, with frame local.
-ClassIDSvc           INFO  getRegistryEntries: read 3566 CLIDRegistry entries for module ALL
-AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
-ClassIDSvc           INFO  getRegistryEntries: read 2837 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 1169 CLIDRegistry entries for module ALL
-CondInputLoader      INFO Initializing CondInputLoader...
-CondInputLoader      INFO Adding base classes:
-  +  ( 'AlignableTransformContainer' , 'ConditionStore+/Indet/Align' )   -> no bases
-  +  ( 'AlignableTransformContainer' , 'ConditionStore+/TRT/Align' )   -> no bases
-  +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' )   ->
-  +  ( 'CondAttrListCollection' , 'ConditionStore+/Indet/IBLDist' )   ->
-  +  ( 'DetCondCFloat' , 'ConditionStore+/Indet/PixelDist' )   -> no bases
-CondInputLoader      INFO Will create WriteCondHandle dependencies for the following DataObjects:
-    +  ( 'AlignableTransformContainer' , 'ConditionStore+/Indet/Align' ) 
-    +  ( 'AlignableTransformContainer' , 'ConditionStore+/TRT/Align' ) 
-    +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) 
-    +  ( 'CondAttrListCollection' , 'ConditionStore+/Indet/IBLDist' ) 
-    +  ( 'DetCondCFloat' , 'ConditionStore+/Indet/PixelDist' ) 
-ClassIDSvc           INFO  getRegistryEntries: read 440 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 764 CLIDRegistry entries for module ALL
-xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
-xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
-xAODMaker::Even...WARNING Beam conditions service not available
-xAODMaker::Even...WARNING Will not fill beam spot information into xAOD::EventInfo
-testalg1            DEBUG Property update for OutputLevel : new value = 1
-testalg1          VERBOSE ServiceLocatorHelper::service: found service EventDataSvc
-testalg1          VERBOSE ServiceLocatorHelper::service: found service TimelineSvc
-testalg1.Imagin...  DEBUG Property update for OutputLevel : new value = 1
-testalg1.Imagin...   INFO ImagingSeedFinder initialization...
-testalg1.Imagin...   INFO Initializing frequency space filter
-testalg1.Imagin...   INFO Allocating memory to fftw - Histogram size : 32 , 32 , 2048
-testalg1.Imagin...   INFO Setting up FFTW plans
-testalg1          VERBOSE ServiceLocatorHelper::service: found service AlgExecStateSvc
-testalg1            DEBUG input handles: 0
-testalg1            DEBUG output handles: 1
-testalg1            DEBUG Adding private ToolHandle tool testalg1.ImagingSeedFinder (Trk::ImagingSeedFinder)
-testalg1            DEBUG Data Deps for testalg1
-  + OUTPUT IGNORED  ( 'McEventCollection' , '' ) 
-ApplicationMgr       INFO Application Manager Initialized successfully
-ClassIDSvc           INFO  getRegistryEntries: read 953 CLIDRegistry entries for module ALL
-CondInputLoader      INFO created CondCont<AlignableTransformContainer> with key 'ConditionStore+/Indet/Align'
-CondInputLoader      INFO created CondCont<AlignableTransformContainer> with key 'ConditionStore+/TRT/Align'
-CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA'
-CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/Indet/IBLDist'
-CondInputLoader      INFO created CondCont<DetCondCFloat> with key 'ConditionStore+/Indet/PixelDist'
-ApplicationMgr       INFO Application Manager Started successfully
-AthenaEventLoopMgr   INFO   ===>>>  start of run 1    <<<===
-EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
-EventPersistenc...   INFO Added successfully Conversion service:TagInfoMgr
-ClassIDSvc           INFO  getRegistryEntries: read 118 CLIDRegistry entries for module ALL
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_INDET/OFLP200
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to InDetAlign_IOVDEP-03 for folder /Indet/Align
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to IBLDist-NULL for folder /Indet/IBLDist
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to InDetPixelDist-nominal for folder /Indet/PixelDist
-IOVDbSvc             INFO Disconnecting from COOLOFL_INDET/OFLP200
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] D0709FD7-6A55-E011-925D-002481043EC0
-Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0001.pool.root
-RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0001.pool.root File version:52600
-PixelDetectorMa...WARNING Cannot set AlignableTransform for identifier  [2.1.0.0.0] at level 2
-PixelDetectorMa...WARNING Subsequent WARNINGS will be printed at DEBUG level.
-PixelDetectorMa...   INFO Processing IBLDist alignment container with key (/Indet/IBLDist) and alignment folder pointing to /Indet/Align
-PixelDetectorMa...WARNING Invalid HashID for identifier [2.1.0.0.0]
-PixelDetectorMa...WARNING No IBLDist corrections can be applied for invalid HashID's - exiting 
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 0 events processed so far  <<<===
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_TRT/OFLP200
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TRTAlign_Nominal2 for folder /TRT/Align
-IOVDbSvc             INFO Disconnecting from COOLOFL_TRT/OFLP200
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 0E3CF1E5-143D-DB11-92C7-000CF1DA62DD
-Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cmccond/cmccond.000001.conditions.simul.pool.v0000/oflcond.000002.conditions.simul.pool.v0000._0029.pool.root__DQ2-1250194490
-Warning in <TClass::Init>: no dictionary for class DataHeader_p1 is available
-Warning in <TClass::Init>: no dictionary for class DataHeaderElement_p1 is available
-RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cmccond/cmccond.000001.conditions.simul.pool.v0000/oflcond.000002.conditions.simul.pool.v0000._0029.pool.root__DQ2-1250194490 File version:51000
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/OFLP200
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to ExtDCSMagnetsSensorData-001 for folder /EXT/DCS/MAGNETS/SENSORDATA
-IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/OFLP200
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8C5D7155-23E9-DC11-99B4-001320DCF58D
-Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cmccond/cmccond.000001.conditions.recon.pool.v0000/oflcond.000001.conditions.recon.pool.v0000._0058.pool.root
-Warning in <TClass::Init>: no dictionary for class DataHeader_p2 is available
-Warning in <TClass::Init>: no dictionary for class DataHeaderElement_p2 is available
-Warning in <TClass::Init>: no dictionary for class PoolToken_p1 is available
-RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cmccond/cmccond.000001.conditions.recon.pool.v0000/oflcond.000001.conditions.recon.pool.v0000._0058.pool.root File version:51400
-SCT_AlignCondAlg     INFO recorded new CDO SCTAlignmentStore with range {[INVALID] - [1,l:4294967294]} into Conditions Store
-SCT_DetectorEle...   INFO recorded new CDO SCT_DetectorElementCollection with range {[INVALID] - [1,l:4294967294]} with size of 8176 into Conditions Store
-PixelDetectorMa...   INFO Processing IBLDist alignment container with key /Indet/IBLDist
-PixelAlignCondAlg    INFO recorded new CDO PixelAlignmentStore with range {[0,t:0,l:0] - [1,l:4294967294]} into Conditions Store
-PixelDetectorEl...   INFO recorded new CDO PixelDetectorElementCollection with range {[0,t:0,l:0] - [1,l:4294967294]} with size of 2048 into Conditions Store
-testalg1          VERBOSE execute
-testalg1          VERBOSE testing 3
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 1 events processed so far  <<<===
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 1 events processed so far  <<<===
-testalg1          VERBOSE execute
-testalg1          VERBOSE testing 3
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 2 events processed so far  <<<===
-/cvmfs/atlas-co...   INFO Database being retired...
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 0E3CF1E5-143D-DB11-92C7-000CF1DA62DD
-/cvmfs/atlas-co...   INFO Database being retired...
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] D0709FD7-6A55-E011-925D-002481043EC0
-/cvmfs/atlas-co...   INFO Database being retired...
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 8C5D7155-23E9-DC11-99B4-001320DCF58D
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
-ApplicationMgr       INFO Application Manager Stopped successfully
-IncidentProcAlg1     INFO Finalize
-CondInputLoader      INFO Finalizing CondInputLoader...
-IncidentProcAlg2     INFO Finalize
-IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /EXT/DCS/MAGNETS/SENSORDATA (AttrListColl) db-read 1/1 objs/chan/bytes 4/4/20 ((     0.04 ))s
-IOVDbFolder          INFO Folder /GLOBAL/BField/Maps (AttrListColl) db-read 0/0 objs/chan/bytes 0/3/0 ((     0.00 ))s
-IOVDbFolder          INFO Folder /GLOBAL/TrackingGeo/LayerMaterialV2 (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
-IOVDbFolder          INFO Folder /Indet/Align (PoolRefColl) db-read 1/2 objs/chan/bytes 34/43/5440 ((     0.05 ))s
-IOVDbFolder          INFO Folder /Indet/IBLDist (AttrListColl) db-read 1/2 objs/chan/bytes 14/14/280 ((     0.02 ))s
-IOVDbFolder          INFO Folder /Indet/PixelDist (PoolRef) db-read 1/1 objs/chan/bytes 1/1/179 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TRT/Align (PoolRefColl) db-read 1/1 objs/chan/bytes 32/32/5120 ((     1.39 ))s
-IOVDbSvc             INFO  bytes in ((      1.52 ))s
-IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_INDET/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: ((     0.09 ))s
-IOVDbSvc             INFO Connection COOLOFL_TRT/OFLP200 : nConnect: 2 nFolders: 1 ReadTime: ((     1.39 ))s
-IOVDbSvc             INFO Connection COOLOFL_GLOBAL/OFLP200 : nConnect: 1 nFolders: 2 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_DCS/OFLP200 : nConnect: 2 nFolders: 1 ReadTime: ((     0.04 ))s
-AthDictLoaderSvc     INFO in finalize...
-ToolSvc              INFO Removing all tools created by ToolSvc
-testalg1.Imagin...   INFO Finalize ImageingSeedFinder successful
-*****Chrono*****     INFO ****************************************************************************************************
-*****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
-*****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=  220 [ms] Ave/Min/Max= 2.18(+- 17.1)/    0/  170 [ms] #=101
-cObj_ALL             INFO Time User   : Tot=  270 [ms] Ave/Min/Max= 38.6(+- 66.6)/    0/  200 [ms] #=  7
-ChronoStatSvc        INFO Time User   : Tot= 24.4  [s]                                             #=  1
-*****Chrono*****     INFO ****************************************************************************************************
-ChronoStatSvc.f...   INFO  Service finalized successfully 
-ApplicationMgr       INFO Application Manager Finalized successfully
-ApplicationMgr       INFO Application Manager Terminated successfully
-Py:Athena            INFO leaving with code 0: "successful run"
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder_test.py b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder_test.py
deleted file mode 100644
index 624ce890a4fd..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder_test.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
-#
-# File: TrkVertexSeedFinderTools/share/ImagingSeedFinder_test.py
-# Author: scott snyder <snyder@bnl.gov>
-# Data: Jun, 2019
-# Brief: Unit test for ImagingSeedFinder.  Incomplete!
-#
-
-
-from __future__ import print_function
-
-
-include ('TrkVertexSeedFinderTools/VertexSeedFinderTestCommon.py')
-
-
-from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import \
-    Trk__VertexSeedFinderTestAlg, Trk__ImagingSeedFinder
-finder = Trk__ImagingSeedFinder ('ImagingSeedFinder', OutputLevel = INFO)
-testalg1 = Trk__VertexSeedFinderTestAlg ('testalg1',
-                                         OutputLevel = VERBOSE,
-                                         VertexSeedFinderTool = finder,
-                                         Expected3 = [ 0.933924,  -0.748513,  7.17455,
-                                                       -0.741989, -0.419237, -2.64877,
-                                                        1.73866,  -1.80412, 11.608,
-                                                       -0.124825,  0.14802, 13.4766,
-                                                        0.817835,  0.747413, 11.0648])
-topSequence += testalg1
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/ImagingSeedFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/ImagingSeedFinder.cxx
deleted file mode 100644
index d680b119127f..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/ImagingSeedFinder.cxx
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*********************************************************************
-          ImagingSeedFinder.cxx - Description in header file
-*********************************************************************/
-//#define ImagingSeedFinder
-
-#include "TrkVertexSeedFinderTools/ImagingSeedFinder.h"
-
-#include "TrkVertexSeedFinderUtils/IVertexImageMaker.h"
-#include "TrkVertexSeedFinderUtils/IVertexClusterFinder.h"
-
-#include "TrkParameters/TrackParameters.h"
-#include "TrkTrack/Track.h"
-#include "GaudiKernel/PhysicalConstants.h"
-
-//Amg
-#include "GeoPrimitives/GeoPrimitives.h"
-
-namespace Trk
-{
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder constructor
-  ImagingSeedFinder::ImagingSeedFinder(const std::string& t, const std::string& n, const IInterface*  p) : 
-    base_class(t,n,p),
-    m_vertexImageMaker("Trk::VertexImageMaker", this),
-    m_VertexClusterFinder( "Trk::SimpleVertexClusterFinder", this)
-  {   
-
-    declareProperty("VertexImageMaker"        , m_vertexImageMaker         );
-    declareProperty("VertexCluster"           , m_VertexClusterFinder      );
-  } //End ImagingSeedFinder constructor
-
-
-  ImagingSeedFinder::~ImagingSeedFinder()
-  {
-  }
-
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder inistialize
-  StatusCode ImagingSeedFinder::initialize() 
-  { 
-    ATH_MSG_INFO( "ImagingSeedFinder initialization..."  );
-
-    ATH_CHECK( m_vertexImageMaker.retrieve() );
-    ATH_CHECK( m_VertexClusterFinder.retrieve() );
-
-    return StatusCode::SUCCESS;
-
-  }// End ImagingSeedFinder initialize
-
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder finalize
-  StatusCode ImagingSeedFinder::finalize() 
-  {
-
-    return StatusCode::SUCCESS;
-  }// End ImagingSeedFinder finalize
-
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder find seed - based on vector of Trk::Track's
-  Amg::Vector3D ImagingSeedFinder::findSeed(const std::vector<const Trk::Track*> & vectorTrk,const xAOD::Vertex * constraint) const
-  {
-    std::vector<Amg::Vector3D> seeds =
-      findMultiSeeds( vectorTrk, constraint);
-
-    if (seeds.empty()) {
-      return Amg::Vector3D(0.,0.,0.);
-    }
-    return seeds[0];
-  } // End ImagingSeedFinder find seed - based on vector of Trk::Track's
-
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder find seed - based on vector of Trk::ParametersBase
-  Amg::Vector3D ImagingSeedFinder::findSeed(const std::vector<const Trk::TrackParameters*> & parametersList,const xAOD::Vertex * constraint) const
-  {
-    std::vector<Amg::Vector3D> seeds =
-      findMultiSeeds( parametersList, constraint);
-
-    if (seeds.empty()) {
-      return Amg::Vector3D(0.,0.,0.);
-    }
-    return seeds[0];
-  } // End  ImagingSeedFinder find seed - based on vector of Trk::ParametersBase
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder find multiseed - based on vector of Trk::Track's
-  std::vector<Amg::Vector3D> ImagingSeedFinder::findMultiSeeds(const std::vector<const Trk::Track*>&  vectorTrk ,const xAOD::Vertex *  constraint ) const {
- 
-    //create perigees from track list
-    std::vector<const Trk::TrackParameters*> perigeeList;
-    perigeeList.reserve (vectorTrk.size());
-
-    for (const Trk::Track* track : vectorTrk) {
-      if (isnan(track->perigeeParameters()->parameters()[Trk::d0])) {
-	continue;
-      }  
-      perigeeList.push_back(track->perigeeParameters());
-    }
-   
-    //create seed from perigee list
-    return findMultiSeeds(perigeeList,constraint);
-
-  } // End ImagingSeedFinder find multiseed - based on vector of Trk::Track's
-
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder find multiseed - based on vector of Trk::ParametersBase
-  std::vector<Amg::Vector3D>
-  ImagingSeedFinder::findMultiSeeds(const std::vector<const Trk::TrackParameters*>& parametersList,
-                                    const xAOD::Vertex * constraint) const
-  {
-    ATH_MSG_DEBUG( "findMultiSeeds using ImagingSeedFinder has been called"  );
-
-    // Make the image from tracks, and immediately
-    std::unique_ptr<VertexImage> image =
-      m_vertexImageMaker->makeVertexImage( parametersList, constraint );
-
-    //Run clustering tool to find vertices
-    //Coordinates are relative to the center of the histogram (constraint or (0,0,0) if no constraint)
-    std::vector<Amg::Vector3D> vertices =
-      m_VertexClusterFinder->findVertexClusters( *image );
-
-    ATH_MSG_DEBUG( "Found " << vertices.size() << " candidate clusters"  );
- 
-    // Loop through the vertices in relative coordinate space, and set x,y to constraint if we have one.
-
-    int counter=0;
-    for (Amg::Vector3D& v : vertices) {
-      if(constraint) {
-        v = Amg::Vector3D (constraint->position().x(),
-                           constraint->position().y(),
-                           constraint->position().z() + v.z());
-      }		
-      ATH_MSG_DEBUG( "  Seed " << counter << " = ( " << v.x() << ", " << v.y() << ", " << v.z() << " )"  );
-
-      counter++;
-    }
-
-
-    return vertices;
-
-  } // End ImagingSeedFinder find multiseed - based on vector of Trk::ParametersBase
-
-
-} //End Trk namespace
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/components/TrkVertexSeedFinderTools_entries.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/components/TrkVertexSeedFinderTools_entries.cxx
index fcf71843aa5f..61c159223e09 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/components/TrkVertexSeedFinderTools_entries.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/components/TrkVertexSeedFinderTools_entries.cxx
@@ -2,7 +2,6 @@
 #include "TrkVertexSeedFinderTools/CrossDistancesSeedFinder.h"
 #include "TrkVertexSeedFinderTools/DummySeedFinder.h"
 #include "TrkVertexSeedFinderTools/ZScanSeedFinder.h"
-#include "TrkVertexSeedFinderTools/ImagingSeedFinder.h"
 #include "TrkVertexSeedFinderTools/TrackDensitySeedFinder.h"
 #include "TrkVertexSeedFinderTools/IndexedCrossDistancesSeedFinder.h"
 #include "../VertexSeedFinderTestAlg.h"
@@ -13,7 +12,6 @@ DECLARE_COMPONENT( MCTrueSeedFinder )
 DECLARE_COMPONENT( CrossDistancesSeedFinder )
 DECLARE_COMPONENT( DummySeedFinder )
 DECLARE_COMPONENT( ZScanSeedFinder )
-DECLARE_COMPONENT( ImagingSeedFinder )
 DECLARE_COMPONENT( TrackDensitySeedFinder )
 DECLARE_COMPONENT( IndexedCrossDistancesSeedFinder )
 DECLARE_COMPONENT( VertexSeedFinderTestAlg )
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
index f16fc669b538..6e3523be6579 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
@@ -1,38 +1,9 @@
-# $Id: CMakeLists.txt 769975 2016-08-25 07:41:26Z krasznaa $
-################################################################################
-# Package: TrkVertexSeedFinderUtils
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrkVertexSeedFinderUtils )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/AthenaBaseComps
-   DetectorDescription/GeoPrimitives
-   Event/xAOD/xAODTracking
-   GaudiKernel
-   MagneticField/MagFieldConditions   # Exposed by NewtonTrkDistanceFinder.h and Trk2dDistanceSeeder.h
-   Tracking/TrkEvent/TrkParameters
-   Tracking/TrkEvent/TrkParticleBase
-   Tracking/TrkEvent/VxVertex
-   InnerDetector/InDetConditions/BeamSpotConditionsData
-   PRIVATE
-   AtlasTest/TestTools
-   Event/EventPrimitives
-   Event/xAOD/xAODTruth
-   InnerDetector/InDetConditions/InDetBeamSpotService
-   InnerDetector/InDetRecTools/InDetTrackSelectionTool
-   MagneticField/MagFieldElements
-   Tracking/TrkEvent/TrkEventPrimitives
-   Tracking/TrkEvent/TrkLinks
-   Tracking/TrkEvent/TrkTrack
-   Tracking/TrkVertexFitter/TrkVertexFitterInterfaces 
-   Tools/PathResolver )
-
 # External dependencies:
-find_package( FFTW )
 find_package( ROOT COMPONENTS Core Tree Hist )
 
 # Component(s) in the package:
@@ -40,87 +11,85 @@ atlas_add_library( TrkVertexSeedFinderUtilsLib
    TrkVertexSeedFinderUtils/*.h
    INTERFACE
    PUBLIC_HEADERS TrkVertexSeedFinderUtils
-   LINK_LIBRARIES AthenaBaseComps GaudiKernel TrkParameters GeoPrimitives
-   VxVertex TrkParticleBase xAODTracking BeamSpotConditionsData )
+   LINK_LIBRARIES  GaudiKernel AthenaBaseComps
+   TrkVertexFitterInterfaces TrkParameters GeoPrimitives xAODTracking
+   MagFieldConditions )
 
 atlas_add_component( TrkVertexSeedFinderUtils
-   src/*.cxx src/components/*.cxx
-   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${FFTW_INCLUDE_DIRS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} EventPrimitives
-   xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-   TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
-
-atlas_install_joboptions( share/*.py )
-atlas_install_joboptions( share/*.txt )
-
-
+   src/*.h src/*.cxx src/components/*.cxx
+   INCLUDE_DIRS  ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES  ${ROOT_LIBRARIES} GaudiKernel
+   AthenaBaseComps TrkParticleBase TrkParameters TrkLinks TrkTrack
+   TrkVertexFitterInterfaces TrkEventPrimitives xAODTracking xAODTruth
+   InDetTrackSelectionToolLib BeamSpotConditionsData EventPrimitives
+   GeoPrimitives MagFieldElements TrkVertexSeedFinderUtilsLib )
+
+# Test(s) in the package.
 atlas_add_test( NewtonTrkDistanceFinder_test
-                SOURCES test/NewtonTrkDistanceFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
-
+   SOURCES test/NewtonTrkDistanceFinder_test.cxx
+           src/NewtonTrkDistanceFinder.cxx
+           src/PointOnTrack.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools MagFieldConditions
+   MagFieldElements CxxUtils GaudiKernel PathResolver SGTools StoreGateLib
+   TrkEventPrimitives TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 atlas_add_test( Trk2dDistanceSeeder_test
-                SOURCES test/Trk2dDistanceSeeder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
+   SOURCES test/Trk2dDistanceSeeder_test.cxx
+           src/Trk2dDistanceSeeder.cxx
+           src/PointOnTrack.cxx
+           src/TwoTracks.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel PathResolver
+   SGTools StoreGateLib MagFieldConditions MagFieldElements TrkParameters
+   TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 
 atlas_add_test( SeedNewtonTrkDistanceFinder_test
-                SOURCES test/SeedNewtonTrkDistanceFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
-
+   SOURCES test/SeedNewtonTrkDistanceFinder_test.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel PathResolver
+   SGTools StoreGateLib MagFieldConditions MagFieldElements
+   TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 atlas_add_test( Trk2DDistanceFinder_test
-                SOURCES test/Trk2DDistanceFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
-
+   SOURCES test/Trk2DDistanceFinder_test.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel PathResolver
+   SGTools StoreGateLib MagFieldConditions MagFieldElements
+   TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 atlas_add_test( GaussianTrackDensity_test
-                SOURCES test/GaussianTrackDensity_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
+   SOURCES test/GaussianTrackDensity_test.cxx
+           src/GaussianTrackDensity.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel TrkTrack
+   TrkEventPrimitives TrkVertexSeedFinderUtilsLib )
+
 # Needed to avoid spurious ubsan warnings.
 set_target_properties( TrkVertexSeedFinderUtils_GaussianTrackDensity_test PROPERTIES ENABLE_EXPORTS True )
 
-
-atlas_add_test( SimpleVertexClusterFinder_test
-                SOURCES test/SimpleVertexClusterFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
-
-
 atlas_add_test( Mode3dFromFsmw1dFinder_test
-                SOURCES test/Mode3dFromFsmw1dFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
+   SOURCES test/Mode3dFromFsmw1dFinder_test.cxx
+           src/Mode3dFromFsmw1dFinder.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel TrkParameters
+   TrkVertexSeedFinderUtilsLib )
+
 # Needed to avoid spurious ubsan warnings.
 set_target_properties( TrkVertexSeedFinderUtils_Mode3dFromFsmw1dFinder_test PROPERTIES ENABLE_EXPORTS True )
 
-
 atlas_add_test( Mode3dTo1dFinder_test
-                SOURCES test/Mode3dTo1dFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
+   SOURCES test/Mode3dTo1dFinder_test.cxx
+           src/Mode3dTo1dFinder.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel TrkParameters
+   TrkVertexSeedFinderUtilsLib )
+
+# Install files from the package.
+atlas_install_joboptions( share/*.py share/*.txt )
+
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/IVertexImageMaker.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/IVertexImageMaker.h
deleted file mode 100644
index c52c9be6349b..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/IVertexImageMaker.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-///////////////////////////////////////////////////////////////////
-//
-///////////////////////////////////////////////////////////////////
-
-#ifndef TRKVERTEXSEEDFINDERUTILS_IVERTEXIMAGEMAKER_H
-#define TRKVERTEXSEEDFINDERUTILS_IVERTEXIMAGEMAKER_H
-
-#include "GaudiKernel/IAlgTool.h"
-#include "TrkParameters/TrackParameters.h"
-#include "xAODTracking/Vertex.h"
-
-namespace Trk
-{
-  /**
-   @class IVertexImageMaker
-
-   Interface tool for vertex image maker
-
-   @author matthew.scott.rudolph@cern.ch
-
-   ------------------------------------
-   Changes:
-
-   David Shope <david.richard.shope@cern.ch> (2016-04-19)
-
-   EDM Migration to xAOD - from Trk::RecVertex to xAOD::Vertex
-
-   */
-
-  class VertexImage;
-
-  class IVertexImageMaker : virtual public IAlgTool {
-
-     public:
-       DeclareInterfaceID( IVertexImageMaker, 1, 0);
-
-
-       //Return a vertex image from the tracks centered around the constraint
-       virtual std::unique_ptr<VertexImage>
-       makeVertexImage( const std::vector<const Trk::TrackParameters*>& parametersList,
-                        const xAOD::Vertex * constraint ) const = 0;
-  };
-}
-
-#endif
-
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/LocalMax1DClusterFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/LocalMax1DClusterFinder.h
deleted file mode 100644
index 72ed68d60aee..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/LocalMax1DClusterFinder.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRKVERTEXSEEDFINDERUTILS_LOCALMAX1DCLUSTERFINDER_H
-#define TRKVERTEXSEEDFINDERUTILS_LOCALMAX1DCLUSTERFINDER_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "TrkVertexSeedFinderUtils/IVertexClusterFinder.h"
-
-
-namespace Trk
-{
-
-  /**
-   @class LocalMax1DClusterFinder
-
-   Projection implementation of a cluster finder with interface IVertexClusterFinder for use with the imaging seed finder.  Adds all neighboring bins above threshold to cluster.
-
-   @author Matt Rudolph <matthew.scott.rudolph@cern.ch
-
-   ------------------------------------
-   Changes:
-
-   David Shope <david.richard.shope@cern.ch> (2016-04-19)
-
-   EDM Migration to xAOD - from Trk::Vertex to Amg::Vector3D
-
-   */
-
-  //Forward declarations.
-  class Vertex;
-  class VertexImage;
-
-  class LocalMax1DClusterFinder : public extends<AthAlgTool, IVertexClusterFinder>
-  {
-  public:
-    //default constructor due to Athena interface
-    LocalMax1DClusterFinder(const std::string& t, const std::string& n, const IInterface*  p);
-    
-    
-    virtual std::vector<Amg::Vector3D> findVertexClusters( const VertexImage & image ) const;
-
-    typedef std::pair<int, float> Projection;
-
-  private:
-
-    float m_weightThreshold;
-    float m_mergeParam;
-    float m_clusterWindowXY;
-    bool  m_refineZ;
-    bool  m_gaussianWindow;
-  };
-}
-#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h
deleted file mode 100644
index 3075ff9c3396..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRKVERTEXSEEDFINDERUTILS_SIMPLEVERTEXCLUSTERFINDER_H
-#define TRKVERTEXSEEDFINDERUTILS_SIMPLEVERTEXCLUSTERFINDER_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "TrkVertexSeedFinderUtils/IVertexClusterFinder.h"
-#include "TrkVertexSeedFinderUtils/VertexImage.h"
-
-namespace Trk
-{
-
-  /**
-   @class SimpleVertexClusterFinder
-
-   Simple implementation of a cluster finder with interface IVertexClusterFinder for use with the imaging seed finder.  Adds all neighboring bins above threshold to cluster.
-
-   @author Matt Rudolph <matthew.scott.rudolph@cern.ch
-   @author Lars ...
-
-   ------------------------------------
-   Changes:
-
-   David Shope <david.richard.shope@cern.ch> (2016-04-19)
-
-   EDM Migration to xAOD - from Trk::Vertex to Amg::Vector3D
-
-   */
-
-  class SimpleVertexClusterFinder : public extends<AthAlgTool, IVertexClusterFinder>
-  {
-  public:
-    //default constructor due to Athena interface
-    SimpleVertexClusterFinder(const std::string& t, const std::string& n, const IInterface*  p);
-    
-
-    //destructor
-    virtual ~SimpleVertexClusterFinder() = default;
-
-    
-    virtual std::vector<Amg::Vector3D> findVertexClusters( const VertexImage & image ) const override;
-
-  private:
-    float m_weightThreshold;
-    float m_seedCutScale;
-
-    typedef std::pair<int, float> binContent;
-    typedef std::vector<binContent> Cluster;
-
-    std::unique_ptr<Cluster>
-    highestCluster( const VertexImage& image,
-                    std::map<int, float>& binsRemaining ) const;
-
-    void addBinsToCluster( const VertexImage& image,
-                           Cluster& clust,
-                           Cluster::size_type oldEdge,
-                           std::map<int, float>& binsRemaining ) const;
-
-    void getCenter( const VertexImage& image,
-                    const Cluster& cl,
-                    float & xpos, float & ypos, float & zpos) const;
-
-  };
-}
-#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImage.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImage.h
deleted file mode 100644
index e0fa2765d57a..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImage.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRKVERTEXSEEDFINDERUTILS_VERTEXIMAGE_H
-#define TRKVERTEXSEEDFINDERUTILS_VERTEXIMAGE_H
-
-#include <vector>
-
-namespace Trk {
-
-
-  // Class used to access vertex image resulting from track back-projection and filtering in ImagingSeedFinder
-
-  class VertexImage {
-
-  public:
-    typedef void arrayDeleter (void*);
-
-    // Construct with pointer to the array, numbers of bins in x,y,z
-    // and flag for whether fourier transforms were done in place.
-    // in-place filtering has extra padding in the array to fit the complex frequency space histogram
-    VertexImage( float* array,
-                 arrayDeleter* deleter,
-                 int nx, int ny, int nz, 
-                 float xrange, float yrange, float zrange);
-
-
-    ~VertexImage()
-    {
-      // Must be inline, because it may be called from another package,
-      // and this package makes only a component library.
-      m_deleter (m_hist_3d);
-    }
-
-    VertexImage (const VertexImage&) = delete;
-    VertexImage& operator= (const VertexImage&) = delete;
-
-    // Direct access to the histogram array
-          float * getHist()       { return m_hist_3d; }
-    const float * getHist() const { return m_hist_3d; }
-
-    // Get the row major index of an x,y,z bin
-    int getRMBin( const int & x, const int & y, const int & z ) const;
-    // Get the x,y,z values of bin index i
-    void getInvRMBin( const int & i, int & x, int & y, int &z ) const;
-
-    // Get the number of bins or array entries
-    int getNBinsX() const { return m_nbinsx; }
-    int getNBinsY() const { return m_nbinsy; }
-    int getNBinsZ() const { return m_nbinsz; }
-    int getNBins() const { return m_binstot; }
-    int getArraySize() const { return m_arraytot; }
-
-    // Get the actual relative (to histogram center) position
-    float getRelPosX(float binx) const { return -m_xrange + binx*m_wx; }
-    float getRelPosY(float biny) const { return -m_yrange + biny*m_wy; }
-    float getRelPosZ(float binz) const { return -m_zrange + binz*m_wz; } 
-
-    // Get the indices of all adjacent bins in 3D
-    std::vector<int> getAdjacentBins( int index ) const;
-
-    // -----------------------------------------------
-    // Get rectangular projections onto 1D z-direction
-    
-    // Project full range
-    std::vector<float> projectRectangleOnZ() const;
-    // Project specified rectangle from {x,y}min inclusive to {x,y}max exclusive
-    std::vector<float> projectRectangleOnZ( int xmin, int xmax, int ymin, int ymax ) const;
-    // Project bins within nsigma standard deviations of the mean of the image
-    std::vector<float> projectRectangleOnZ( float nsigmax, float nsigmay) const;
-
-    // -----------------------------------------------
-    // Fit centroid to 2D Gaussian by projecting onto xy-plane
-    // Returned values are in bins
-    void fitCentroid(float& x, float& y, float& sigmax, float& sigmay) const;
-    // Project on z using a Gaussian window
-    // Input parameters are in bins
-    std::vector<float> projectGaussianOnZ(float x, float y, float sigmax, float sigmay) const;
-    // Project on z using a Gaussian window
-    // Parameters of the Gaussian are found by fitting the xy-projection
-    std::vector<float> projectGaussianOnZ(float scaleFactor) const;
-
-  private:
-
-    // The actual histogram array
-    float * m_hist_3d;
-
-    // Function to delete the array.
-    arrayDeleter* m_deleter;
-
-    // Store number of bins in x,y,z
-    int m_nbinsx;
-    int m_nbinsy;
-    int m_nbinsz;
-    
-    // Physical (half) range of the histogram in x,y,z (spans from -range to +range)
-    float m_xrange;
-    float m_yrange;
-    float m_zrange;
-
-    // Total number of bins in the 3D histogram
-    int m_binstot;
-    // Total entries in the histogram array (different than binstot for in-place transforms)
-    int m_arraytot;
-
-    // Bin widths in the histogram
-    float m_wx;
-    float m_wy;
-    float m_wz;
-
-  };
-
-}
-
-#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImageMaker.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImageMaker.h
deleted file mode 100644
index 299ca09828a8..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImageMaker.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRKVERTEXSEEDFINDERUTILIS_SIMPLEVERTEXCLUSTERFINDER_H
-#define TRKVERTEXSEEDFINDERUTILIS_SIMPLEVERTEXCLUSTERFINDER_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "TrkVertexSeedFinderUtils/IVertexImageMaker.h"
-#include "TrkVertexSeedFinderUtils/VertexImage.h"
-#include "xAODTracking/Vertex.h"
-
-//External library for fourier transforms
-#include "fftw3.h"
-
-namespace Trk
-{
-
-  /**
-   @class VertexImageMaker
-
-   Implementation of vertex imaging from tracks using fast fourier transform with FFTW3 and filtering
-
-   @author Matt Rudolph <matthew.scott.rudolph@cern.ch
-
-   ------------------------------------
-   Changes:
-
-   David Shope <david.richard.shope@cern.ch> (2016-04-19)
-
-   EDM Migration to xAOD - from Trk::RecVertex to xAOD::Vertex
-
-   */
-
-
-  class VertexImageMaker : public extends<AthAlgTool, IVertexImageMaker> {
-  public:
-    VertexImageMaker(const std::string& t, const std::string& n, const IInterface*  p);
-
-    virtual StatusCode initialize() override;
-    virtual StatusCode finalize() override;
-
-
-    virtual std::unique_ptr<VertexImage>
-    makeVertexImage( const std::vector<const Trk::TrackParameters*>& parametersList,
-                     const xAOD::Vertex * constraint ) const override;
-
-
-  private:
-    //------------
-    //Properties:
-
-    //Number of bins in histogram:
-    int    m_xbins;
-    int    m_ybins;
-    int    m_zbins;
-
-    float m_xrange; //Range around histogram center in position space
-    float m_yrange; 
-    float m_zrange;
-    
-    //Filter parameters
-    float m_a0Window;
-    float m_a1Window;
-    float m_a2Window;
-    float m_a3Window;
-    
-    int    m_cutoffFreqDenominator_xy;
-    int    m_cutoffFreqDenominator_z;
-
-    float  m_angularCutoffParameter;
-
-    //Other members:
-
-    //Widths of histogram bins
-    float m_wx;        
-    float m_wy;          
-    float m_wz;
-
-    //Total number of filter bins 
-    int m_filttot;
-
-    //The frequency space filter
-    std::vector<float> m_histFSFilter;
-
-    //the FFTW "plans" -- object that saves how the fourier transform is done
-    fftwf_plan m_plan_r2c;
-    fftwf_plan m_plan_c2r;
-
-    //Method implementing the backprojection into the real space histogram
-    void fillHist( VertexImage& image,
-                   const std::vector<const Trk::TrackParameters*>& parametersList,
-                   const xAOD::Vertex * constraint) const;
-
-    // Filtering methods   
-    void filterFSHist (VertexImage& image) const;
-    void initFSFilter();
-  };
-}
-#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/share/SimpleVertexClusterFinder_test.ref b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/share/SimpleVertexClusterFinder_test.ref
deleted file mode 100644
index 421d4ce48025..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/share/SimpleVertexClusterFinder_test.ref
+++ /dev/null
@@ -1,19 +0,0 @@
-TrkVertexSeedFinderUtils/SimpleVertexClusterFinder_test
-
-
-Initializing Gaudi ApplicationMgr using job opts /home/dcasper/Work/atlas/vtx/build/x86_64-centos7-gcc8-opt/jobOptions/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils_tests.txt
-JobOptionsSvc        INFO Job options successfully read in from /home/dcasper/Work/atlas/vtx/build/x86_64-centos7-gcc8-opt/jobOptions/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils_tests.txt
-ApplicationMgr    SUCCESS 
-====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v33r1)
-                                          running on localhost.localdomain on Thu May 14 05:43:15 2020
-====================================================================================================================================
-ApplicationMgr       INFO Application Manager Configured successfully
-EventLoopMgr      WARNING Unable to locate service "EventSelector" 
-EventLoopMgr      WARNING No events will be processed from external input.
-ApplicationMgr       INFO Application Manager Initialized successfully
-ApplicationMgr Ready
-ToolSvc.Trk::Ve...   INFO Initializing frequency space filter
-ToolSvc.Trk::Ve...   INFO Allocating memory to fftw - Histogram size : 32 , 32 , 2048
-ToolSvc.Trk::Ve...   INFO Setting up FFTW plans
-test1
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/FsmwMode1dFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/FsmwMode1dFinder.cxx
index 70338b49de7d..536899b89fad 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/FsmwMode1dFinder.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/FsmwMode1dFinder.cxx
@@ -9,9 +9,9 @@
 //#define FSMWMODE1DFINDER_DEBUG
 
 #include "TrkVertexSeedFinderUtils/FsmwMode1dFinder.h"
+#include <algorithm>
 #include <cmath>
 #include <vector>
-#include <algorithm>
 
 namespace Trk
 {
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx
index acde5ef4f23b..67c1b5891bb7 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx
@@ -15,8 +15,8 @@
 // FrameWork includes
 #include "Gaudi/Property.h"
 
-#include "xAODTracking/Vertex.h"
 #include "TrkLinks/LinkToXAODTrackParticle.h"
+#include "xAODTracking/Vertex.h"
 
 #include <limits>
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx
index 146e7e668c01..7b8596274acf 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx
@@ -4,12 +4,12 @@
 
 #include "TrkVertexSeedFinderUtils/GaussianTrackDensity.h"
 
-#include "TrkTrack/Track.h"
-#include "TrkEventPrimitives/ParamDefs.h"
 #include "GaudiKernel/PhysicalConstants.h"
-#include <limits>
+#include "TrkEventPrimitives/ParamDefs.h"
+#include "TrkTrack/Track.h"
 #include <algorithm>
 #include <cmath>
+#include <limits>
 
 namespace Trk
 {
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx
deleted file mode 100644
index c5582c8d1020..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx
+++ /dev/null
@@ -1,615 +0,0 @@
-///////////////////////// -*- C++ -*- /////////////////////////////
-
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ImagingSeedTuningAlg.cxx 
-// Implementation file for class ImagingSeedTuningAlg
-// Author: Dave Casper <dcasper@uci.edu>
-/////////////////////////////////////////////////////////////////// 
-
-// TrkVertexSeedFinderUtils includes
-#include "ImagingSeedTuningAlg.h"
-
-// STL includes
-
-// FrameWork includes
-#include "Gaudi/Property.h"
-
-#include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h"
-
-#include "TrkVertexFitterInterfaces/IVertexSeedFinder.h"
-#include "TrkVertexFitterInterfaces/IImpactPoint3dEstimator.h"
-
-#include "TrkVertexSeedFinderUtils/IVertexImageMaker.h"
-#include "TrkVertexSeedFinderUtils/IVertexClusterFinder.h"
-
-#include "TrkLinks/LinkToXAODTrackParticle.h"
-
-#include <limits>
-
-namespace Trk
-{
-/////////////////////////////////////////////////////////////////// 
-// Public methods: 
-/////////////////////////////////////////////////////////////////// 
-
-// Constructors
-////////////////
-ImagingSeedTuningAlg::ImagingSeedTuningAlg( const std::string& name, 
-			  ISvcLocator* pSvcLocator ) : 
-  ::AthAlgorithm( name, pSvcLocator ),
-  m_significanceTruthCut(3.0),
-  m_truthVertexTracks(2),
-  m_truthWindow(0.5),
-  m_useBeamConstraint(true),
-  m_trackFilter("InDet::InDetTrackSelectionTool"),
-  m_seedFinder("Trk::ImagingSeedFinder"),
-  m_impactPoint3dEstimator("Trk::ImpactPoint3dEstimator"),
-  m_iTHistSvc("THistSvc", name),
-  m_h_nTruthVertices(nullptr), m_h_zTruthVertices(nullptr), m_t_seeds(nullptr),
-  m_b_nTruth(0), m_b_nConditions(0), m_iCondition(0)
-{
-  //
-  // Property declaration
-  // 
-  declareProperty( "significanceTruthCut", m_significanceTruthCut );
-  declareProperty( "truthVertexTracks", m_truthVertexTracks );
-  declareProperty( "truthWindow", m_truthWindow );
-  declareProperty( "useBeamConstraint", m_useBeamConstraint );
-  declareProperty( "trackFilter", m_trackFilter );
-  declareProperty( "seedFinder", m_seedFinder );
-  declareProperty( "impactPoint3dEstimator", m_impactPoint3dEstimator );
-  declareProperty( "angularCutoffParameterValues", m_angularCutoffParameterValues );
-  declareProperty( "clusterWindowXYValues", m_clusterWindowXYValues );
-  declareProperty( "mergeParameterValues", m_mergeParameterValues );
-  declareProperty( "weightThresholdValues", m_weightThresholdValues );
-  declareProperty( "refineZValues", m_refineZValues );
-  declareProperty( "gaussianWindowValues", m_gaussianWindowValues );
-}
-
-// Destructor
-///////////////
-ImagingSeedTuningAlg::~ImagingSeedTuningAlg()
-= default;
-
-// Athena Algorithm's Hooks
-////////////////////////////
-StatusCode ImagingSeedTuningAlg::initialize()
-{
-  ATH_MSG_INFO ("Initializing " << name() << "...");
-
-  ATH_CHECK( m_trackParticlesKey.initialize() );
-  ATH_CHECK( m_truthEventsKey.initialize() );
-  ATH_CHECK( m_pileupEventsKey.initialize() );
-
-  Trk::IVertexSeedFinder* p_ivsf;
-  CHECK( m_seedFinder.retrieve(p_ivsf) );
-
-  SmartIF<IProperty> i_seedProp(p_ivsf);
-  if ( !i_seedProp.isValid() ) 
-  {
-    msg(MSG::FATAL) << "Failed to retrieve IProperty interface of " << m_seedFinder << endmsg;
-    return StatusCode::FAILURE;
-  }
-
-  std::string s_imageMaker;
-  CHECK( i_seedProp->getProperty("VertexImageMaker", s_imageMaker) );
-
-  std::string s_clusterFinder;
-  CHECK( i_seedProp->getProperty("VertexCluster", s_clusterFinder) );
-
-  Trk::IVertexImageMaker* p_ivim;
-  ToolHandle< Trk::IVertexImageMaker > h_imageMaker(s_imageMaker);
-  CHECK( h_imageMaker.retrieve(p_ivim) );
-
-  Trk::IVertexClusterFinder* p_ivcf;
-  ToolHandle< Trk::IVertexClusterFinder > h_clusterFinder(s_clusterFinder);
-  CHECK( h_clusterFinder.retrieve(p_ivcf) ); 
-
-  m_imageMakerProperty = SmartIF<IProperty>(p_ivim);
-  if ( !m_imageMakerProperty.isValid() ) 
-  {
-    msg(MSG::FATAL) << "Failed to retrieve IProperty interface for " << s_imageMaker << endmsg;
-    return StatusCode::FAILURE;
-  }
-
-  m_clusterFinderProperty = SmartIF<IProperty>(p_ivcf);
-  if ( !m_clusterFinderProperty.isValid() ) 
-  {
-    msg(MSG::FATAL) << "Failed to retrieve IProperty interface for " << s_clusterFinder << endmsg;
-    return StatusCode::FAILURE;
-  }
-
-  CHECK( m_impactPoint3dEstimator.retrieve() );
-
-  CHECK( m_trackFilter.retrieve() );
-
-  // setup histograms/trees
-  m_h_nTruthVertices = new TH1F("nTruthVtx", "N truth vertices", 60, 0.0, 60.0);
-  m_h_zTruthVertices = new TH1F("zTruthVtx","z (visible truth vertices)",100,-200.0,200.0);
-  m_t_seeds          = new TTree("seeds","seeds");
-
-  CHECK( m_iTHistSvc->regHist("/file1/h/truthVertices", m_h_nTruthVertices) );
-  CHECK( m_iTHistSvc->regHist("/file1/h/zTruthVtx", m_h_zTruthVertices) );
-  CHECK( m_iTHistSvc->regTree("/file1/t/seeds", m_t_seeds) );
-
-  m_t_seeds->Branch("nTruth", &m_b_nTruth, "nTruth/I");
-  m_t_seeds->Branch("nConditions", &m_b_nConditions, "nConditions/I");
-  m_t_seeds->Branch("nGoodTruth", &m_b_nGoodTruth, "nGoodTruth[nConditions]/I");
-  m_t_seeds->Branch("nSeeds", &m_b_nSeeds, "nSeeds[nConditions]/I");
-  m_t_seeds->Branch("nGoodSeeds", &m_b_nGoodSeeds, "nGoodSeeds[nConditions]/I");
-  m_t_seeds->Branch("nLost", &m_b_nLost, "nLost[nConditions]/I");
-  m_t_seeds->Branch("nFake", &m_b_nFake, "nFake[nConditions]/I");
-  m_t_seeds->Branch("nSplit", &m_b_nSplit, "nSplit[nConditions]/I");
-  m_t_seeds->Branch("nMerge", &m_b_nMerge, "nMerge[nConditions]/I");
-  m_t_seeds->Branch("angularCutoff", &m_b_angularCutoffParameter, "angularCutoff[nConditions]/F");
-  m_t_seeds->Branch("weightThreshold", &m_b_weightThreshold, "weightThreshold[nConditions]/F");
-  m_t_seeds->Branch("mergeParameter", &m_b_mergeParameter, "mergeParameter[nConditions]/F");
-  m_t_seeds->Branch("clusterWindowXY", &m_b_clusterWindowXY, "clusterWindowXY[nConditions]/F");
-  m_t_seeds->Branch("refineZ", &m_b_refineZ, "refineZ[nConditions]/I1");
-  m_t_seeds->Branch("gaussianWindow", &m_b_gaussianWindow, "gaussianWindow[nConditions]/I1");
-
-  m_b_nConditions = m_angularCutoffParameterValues.size() *
-    m_clusterWindowXYValues.size()*
-    m_mergeParameterValues.size()*
-    m_weightThresholdValues.size()*
-    m_refineZValues.size()*
-    m_gaussianWindowValues.size();
-
-  ATH_CHECK(m_beamSpotKey.initialize());
-    
-  return StatusCode::SUCCESS;
-}
-
-StatusCode ImagingSeedTuningAlg::finalize()
-{
-  ATH_MSG_INFO ("Finalizing " << name() << "...");
-
-  std::vector<std::pair<std::string, std::pair<float,float> > > performance;
-  typedef std::pair<std::string, std::pair<float, float> > performance_entry;
-  for (auto & allTruth : m_allTruth)
-  {
-    std::string desc = allTruth.first;
-    int nAllTruth = allTruth.second;
-    int nAllSeeds = m_allSeeds[desc];
-    int nFake = m_nFake[desc];
-    int nLost = m_nLost[desc];
-    int nSplit = m_nSplit[desc];
-    int nMerge = m_nMerge[desc];
-    float efficiency = ((float)(nAllTruth - nLost - nMerge))/((float)nAllTruth);
-    float purity = ((float)(nAllSeeds - nFake - nSplit))/((float)nAllSeeds);
-    std::pair<float,float> p(efficiency, purity);
-    performance.emplace_back(desc, p);
-  }
-  std::sort(performance.begin(), performance.end(), [](const performance_entry& a, const performance_entry& b) 
-	    {return a.second.first*a.second.second > b.second.first*b.second.second;});
-
-  int nPrint = 0;
-  for (auto & p : performance)
-  {
-    ATH_MSG_ALWAYS("SeedPerformance for: " << p.first);
-    ATH_MSG_ALWAYS("efficiency: " << p.second.first << ", purity:" << p.second.second << ", product: " << 
-		   p.second.first*p.second.second);
-    float lossRate = ((float)m_nLost[p.first])/m_allTruth[p.first];
-    float mergeRate = ((float)m_nMerge[p.first])/m_allTruth[p.first];
-    float fakeRate = ((float)m_nFake[p.first])/m_allSeeds[p.first];
-    float splitRate = ((float)m_nSplit[p.first])/m_allSeeds[p.first];
-    float simpleEfficiency = ((float)m_goodTruth[p.first]/m_allTruth[p.first]);
-    float simplePurity = ((float)m_goodSeeds[p.first]/m_allSeeds[p.first]);
-    ATH_MSG_ALWAYS("Simple efficiency: " << simpleEfficiency << ", Simple purity: " << simplePurity);
-    ATH_MSG_ALWAYS("Loss: " << lossRate << ", Merge: " << mergeRate << ", Fake: " << fakeRate << ", Split:" << splitRate);
-    ATH_MSG_ALWAYS("----------------------");
-    nPrint++;
-    if (nPrint >= 0.01*performance.size()) break;
-  }
-  return StatusCode::SUCCESS;
-}
-
-StatusCode ImagingSeedTuningAlg::execute()
-{  
-  ATH_MSG_DEBUG ("Executing " << name() << "...");
-
-  SG::ReadHandle<xAOD::TrackParticleContainer> trackParticles(m_trackParticlesKey);
-
-  std::vector<Trk::ITrackLink*> trackVector;
-  selectTracks(trackParticles.cptr(), trackVector);
-
-  std::vector<const Trk::TrackParameters*> perigeeList;
-  analyzeTracks(trackVector, perigeeList);
-
-  std::vector<Amg::Vector3D> truth;
-  CHECK( findTruth(trackVector, truth) );
-  m_h_nTruthVertices->Fill((float) truth.size());
-  m_b_nTruth = truth.size();
-  for (auto & v : truth) m_h_zTruthVertices->Fill(v[2]);
-
-  xAOD::Vertex theConstraint;
-  theConstraint.makePrivateStore();
-  if (m_useBeamConstraint)
-  {
-    SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
-    theConstraint.setPosition(beamSpotHandle->beamVtx().position());
-    theConstraint.setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
-    theConstraint.setFitQuality(beamSpotHandle->beamVtx().fitQuality().chiSquared(), beamSpotHandle->beamVtx().fitQuality().doubleNumberDoF());
-  }
-
-  bool done = true;
-  std::string conditions;
-  CHECK( initializeConditions(conditions) );
-  do
-  {
-    std::vector<Amg::Vector3D> seeds;
-    if (m_useBeamConstraint)
-    {
-      seeds = m_seedFinder->findMultiSeeds(perigeeList, &theConstraint);
-    } else {
-      seeds = m_seedFinder->findMultiSeeds(perigeeList);
-    }
-    analyzeSeeds(conditions, seeds, truth);
-    CHECK( iterateConditions(conditions, done) );
-  } while (!done);
-
-  m_t_seeds->Fill();
-
-  return StatusCode::SUCCESS;
-}
-
-/////////////////////////////////////////////////////////////////// 
-// Non-const methods: 
-/////////////////////////////////////////////////////////////////// 
-
-StatusCode ImagingSeedTuningAlg::initializeConditions(std::string& conditions)
-{
-  m_i_angularCutoffParameter = m_angularCutoffParameterValues.begin();
-  m_i_clusterWindowXY        = m_clusterWindowXYValues.begin();
-  m_i_mergeParameter         = m_mergeParameterValues.begin();
-  m_i_weightThreshold        = m_weightThresholdValues.begin();
-  m_i_refineZ                = m_refineZValues.begin();
-  m_i_gaussianWindow         = m_gaussianWindowValues.begin();
-
-  m_iCondition = 0;
-
-  CHECK( setupConditions(conditions) );
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode ImagingSeedTuningAlg::iterateConditions(std::string& conditions, bool& done)
-{
-  done = true;
-  conditions = "done";
-  m_iCondition++;
-
-  if (++m_i_angularCutoffParameter == m_angularCutoffParameterValues.end())
-  {
-    m_i_angularCutoffParameter = m_angularCutoffParameterValues.begin();
-    if (++m_i_clusterWindowXY == m_clusterWindowXYValues.end())
-    {
-      m_i_clusterWindowXY = m_clusterWindowXYValues.begin();
-      if (++m_i_mergeParameter == m_mergeParameterValues.end())
-      {
-	m_i_mergeParameter = m_mergeParameterValues.begin();
-	if (++m_i_weightThreshold == m_weightThresholdValues.end())
-	{
-	  m_i_weightThreshold = m_weightThresholdValues.begin();
-	  if (++m_i_refineZ == m_refineZValues.end())
-	  {
-	    m_i_refineZ = m_refineZValues.begin();
-	    if (++m_i_gaussianWindow == m_gaussianWindowValues.end())
-	    {
-	      return StatusCode::SUCCESS;
-	    }
-	  }
-	}
-      }
-    }
-  }
-
-  CHECK( setupConditions(conditions) );
-  done = false;
-  return StatusCode::SUCCESS;
-}
-
-StatusCode ImagingSeedTuningAlg::setupConditions(std::string& conditions)
-{
-  m_b_gaussianWindow[m_iCondition] = *m_i_gaussianWindow;
-  m_b_refineZ[m_iCondition] = *m_i_refineZ;
-  m_b_weightThreshold[m_iCondition] = *m_i_weightThreshold;
-  m_b_mergeParameter[m_iCondition] = *m_i_mergeParameter;
-  m_b_clusterWindowXY[m_iCondition] = *m_i_clusterWindowXY;
-  m_b_angularCutoffParameter[m_iCondition] = *m_i_angularCutoffParameter;
-
-  std::string gaussianWindow = std::to_string(*m_i_gaussianWindow);
-  std::string refineZ = std::to_string(*m_i_refineZ);
-  std::string weightThreshold = std::to_string(*m_i_weightThreshold);
-  std::string mergeParameter = std::to_string(*m_i_mergeParameter);
-  std::string clusterWindowXY = std::to_string(*m_i_clusterWindowXY);
-  std::string angularCutoffParameter = std::to_string(*m_i_angularCutoffParameter);
-
-  CHECK( m_imageMakerProperty->setProperty("angularCutoffParameter", angularCutoffParameter) );
-  CHECK( m_clusterFinderProperty->setProperty("clusterWindowXY", clusterWindowXY) );
-  CHECK( m_clusterFinderProperty->setProperty("mergeParameter", mergeParameter) );
-  CHECK( m_clusterFinderProperty->setProperty("weightThreshold", weightThreshold) );
-  CHECK( m_clusterFinderProperty->setProperty("refineZ", refineZ) );
-  CHECK( m_clusterFinderProperty->setProperty("gaussianWindow", gaussianWindow) );
-
-  conditions = "\ngaussianWindow:";
-  conditions += gaussianWindow;
-  conditions += "\nrefineZ:";
-  conditions += refineZ;
-  conditions += "\nweightThreshold:";
-  conditions += weightThreshold;
-  conditions += "\nmergeParameter:";
-  conditions += mergeParameter;
-  conditions += "\nclusterWindowXY:";
-  conditions += clusterWindowXY;
-  conditions += "\nangularCutoffParameter:";
-  conditions += angularCutoffParameter;
-
-  return StatusCode::SUCCESS;
-}
-
-void ImagingSeedTuningAlg::analyzeSeeds(const std::string& conditions,
-					const std::vector<Amg::Vector3D>& seeds, 
-					const std::vector<Amg::Vector3D>& truth)
-{
-  // simple analysis - count seeds that have a true vertex close to them
-  m_allTruth[conditions] += truth.size();
-  m_allSeeds[conditions] += seeds.size();
-  m_b_nSeeds[m_iCondition] = seeds.size();
-  int goodSeeds = 0;
-  for (auto& seed : seeds) {
-    for (auto& tru : truth) {
-      if (std::abs(seed[2] - tru[2]) <= m_truthWindow) {
-	goodSeeds++;
-	break;
-      }
-    }
-  }
-  // simple analysis - count truth vertices that have a seed close to them
-  m_goodSeeds[conditions] += goodSeeds;
-  m_b_nGoodSeeds[m_iCondition] = goodSeeds;
-  int goodTruth = 0;
-  for (auto& tru : truth) {
-    for (auto& seed : seeds) {
-      if (std::abs(seed[2] - tru[2]) <= m_truthWindow){
-	goodTruth++;
-	break;
-      }
-    }
-  }
-  m_goodTruth[conditions] += goodTruth;
-  m_b_nGoodTruth[m_iCondition] = goodTruth;
-
-  // more careful analysis - match seeds and truth
-  std::map<float, float > nearestSeed;
-  std::map<float, float > nearestTruth;
-  m_b_nLost[m_iCondition] = 0;
-  m_b_nFake[m_iCondition] = 0;
-  m_b_nSplit[m_iCondition] = 0;
-  m_b_nMerge[m_iCondition] = 0;
-  for (auto & tru : truth) {
-    nearestSeed[tru[2]] = std::numeric_limits<float>::infinity();
-    for (auto & seed : seeds) {
-      if (std::abs(seed[2] - tru[2]) < 
-	  std::min(m_truthWindow, std::abs(nearestSeed[tru[2]] - tru[2])))
-      {
-	nearestSeed[tru[2]] = seed[2];
-      }
-    }
-    // if a true vertex is not close to any seed, it is "lost"
-    if (nearestSeed[tru[2]] == std::numeric_limits<float>::infinity())
-    {
-      m_b_nLost[m_iCondition]++;
-      m_nLost[conditions]++;
-    }
-  }
-  for (auto & seed : seeds) {
-    nearestTruth[seed[2]] = std::numeric_limits<float>::infinity();
-    for (auto & tru : truth) {
-      if (std::abs(tru[2] - seed[2]) < 
-	  std::min(m_truthWindow, std::abs(nearestTruth[seed[2]] - seed[2])))
-      {
-	nearestTruth[seed[2]] = tru[2];
-      }
-    }
-    // if a seed is not close to any true vertex, it is a "fake"
-    if (nearestTruth[seed[2]] == std::numeric_limits<float>::infinity())
-    {
-      m_b_nFake[m_iCondition]++;
-      m_nFake[conditions]++;
-    }
-  }
-  // if a true vertex is closest to > 1 seed, that true vertex has been "split"
-  for (auto & tru : truth)
-  {
-    if (nearestSeed[tru[2]] == std::numeric_limits<float>::infinity()) continue;
-    int nClosest = 0; // number of seeds that this true vertex is closest to
-    for (auto & seed : seeds)
-    {
-      if (nearestTruth[seed[2]] == tru[2]) nClosest++;
-    }
-    if (nClosest > 1) 
-    {
-      m_nSplit[conditions] += (nClosest - 1);
-      m_b_nSplit[m_iCondition] += (nClosest - 1);
-    }
-  }
-  // if a seed is closest to > 1 true vertex, those true vertices have been "merged"
-  for (auto & seed : seeds)
-  {
-    if (nearestTruth[seed[2]] == std::numeric_limits<float>::infinity()) continue;
-    int nClosest = 0; // number of truth vertices that this seed is closest to
-    for (auto & tru : truth)
-    {
-      if (nearestSeed[tru[2]] == seed[2]) nClosest++;
-    }
-    if (nClosest > 1) 
-    {
-      m_nMerge[conditions] += (nClosest - 1);
-      m_b_nMerge[m_iCondition] += (nClosest - 1);
-    }
-  }
-}
-
-void ImagingSeedTuningAlg::analyzeTracks(const std::vector<Trk::ITrackLink*>& trackVector,
-					 std::vector<const Trk::TrackParameters*>& perigeeList)
-{
-  for (auto seedtrkAtVtxIter = trackVector.begin();
-       seedtrkAtVtxIter != trackVector.end();
-       ++seedtrkAtVtxIter) 
-  {
-    perigeeList.push_back( (*seedtrkAtVtxIter)->parameters() );
-  }
-}
-
-void ImagingSeedTuningAlg::selectTracks(const xAOD::TrackParticleContainer* trackParticles, 
-					std::vector<Trk::ITrackLink*>& trackVector)
-{
-  bool selectionPassed{false};
-  const InDet::BeamSpotData* beamdata = nullptr;
-  if(m_useBeamConstraint){
-     SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
-     beamdata =  beamSpotHandle.retrieve();
-  }
-  for (auto itr  = trackParticles->begin(); itr != trackParticles->end(); ++itr) {
-    if (m_useBeamConstraint) {
-      xAOD::Vertex beamposition;
-      beamposition.makePrivateStore();
-      beamposition.setPosition(beamdata->beamVtx().position());
-      beamposition.setCovariancePosition(beamdata->beamVtx().covariancePosition());
-      selectionPassed=static_cast<bool> (m_trackFilter->accept(**itr,&beamposition));
-    }
-    else
-    {
-      xAOD::Vertex null;
-      null.makePrivateStore();
-      null.setPosition(Amg::Vector3D(0,0,0));
-      AmgSymMatrix(3) vertexError;
-      vertexError.setZero();
-      null.setCovariancePosition(vertexError);
-      selectionPassed=static_cast<bool>(m_trackFilter->accept(**itr,&null));
-    }
-    if (selectionPassed)
-    {
-      ElementLink<xAOD::TrackParticleContainer> link;
-      link.setElement(*itr);
-      Trk::LinkToXAODTrackParticle * linkTT = new Trk::LinkToXAODTrackParticle(link);
-      linkTT->setStorableObject(*trackParticles);
-      trackVector.push_back(linkTT);
-    }
-  }
-}
-
-/////////////////////////////////////////////////////////////////// 
-// Const methods: 
-///////////////////////////////////////////////////////////////////
-StatusCode ImagingSeedTuningAlg::findTruth(const std::vector<Trk::ITrackLink*>& trackVector, std::vector<Amg::Vector3D>& truth) const
-{
-    xAOD::TrackParticle::ConstAccessor<ElementLink<xAOD::TruthParticleContainer> > truthParticleAssoc("truthParticleLink");
-
-    SG::ReadHandle<xAOD::TruthEventContainer> signalEvents(m_truthEventsKey);
-
-    for (const xAOD::TruthEventBase* evt : *signalEvents)
-    {
-      const xAOD::TruthVertex* vLink = *(evt->truthVertexLink(0));
-      Amg::Vector3D vTruth(Amg::Vector3D(vLink->x(),vLink->y(),vLink->z()));
-      int nGoodTracks = 0;
-      for (auto trk : trackVector)
-      {
-	Trk::LinkToXAODTrackParticle* lxtp = dynamic_cast<Trk::LinkToXAODTrackParticle*>(trk);
-        if (lxtp)
-	{
-	  bool isAssoc = truthParticleAssoc(**(*lxtp)).isValid();
-	  if (isAssoc)
-	  {
-	    auto assocParticle = truthParticleAssoc(**(*lxtp));
-	    for (const auto& truthParticle : evt->truthParticleLinks())
-	    {
-	      if (assocParticle == truthParticle)
-	      {
-		double error;
-		double distance = distanceAndError(trk->parameters(), &vTruth, error);
-		if (distance < m_significanceTruthCut * error) nGoodTracks++;
-		break;
-	      }
-	    }
-	  }
-	}
-	if (nGoodTracks >= m_truthVertexTracks)
-	{
-	  truth.push_back(vTruth);
-	  break;
-	}
-      }
-    }
-    SG::ReadHandle<xAOD::TruthPileupEventContainer> pileupEvents(m_pileupEventsKey);
-
-    for (const xAOD::TruthEventBase* evt : *pileupEvents)
-    {
-      const xAOD::TruthVertex* vLink = *(evt->truthVertexLink(0));
-      Amg::Vector3D vTruth(Amg::Vector3D(vLink->x(),vLink->y(),vLink->z()));
-      int nGoodTracks = 0;
-      for (auto trk : trackVector)
-      {
-	Trk::LinkToXAODTrackParticle* lxtp = dynamic_cast<Trk::LinkToXAODTrackParticle*>(trk);
-	bool isAssoc = truthParticleAssoc(**(*lxtp)).isValid();
-	if (isAssoc)
-	{
-	  auto assocParticle = truthParticleAssoc(**(*lxtp));
-	  for (const auto& truthParticle : evt->truthParticleLinks())
-	  {
-	    if (assocParticle == truthParticle)
-	    {
-	      double error;
-	      double distance = distanceAndError(trk->parameters(), &vTruth, error);
-	      if (distance < m_significanceTruthCut * error) nGoodTracks++;
-	      break;
-	    }
-	  }
-	}
-	if (nGoodTracks >= m_truthVertexTracks)
-	{
-	  truth.push_back(vTruth);
-	  break;
-	}
-      }
-    }
-    return StatusCode::SUCCESS;
-}
-
-double ImagingSeedTuningAlg::distanceAndError(const Trk::TrackParameters* params, const Amg::Vector3D * vertex, double & error) const
-{
-    //find distance safely
-    double distance=0.;
-    try {
-      std::unique_ptr<Trk::PlaneSurface> mySurface=m_impactPoint3dEstimator->Estimate3dIP(params,vertex,distance);
-    }
-    catch (error::ImpactPoint3dEstimatorProblem err) {
-      msg(MSG::WARNING) << " ImpactPoin3dEstimator failed to find minimum distance between track and vertex seed: " << 
-        err.p << endmsg;
-    }
-    if (distance<0) {
-      msg(MSG::WARNING) << " Distance between track and seed vtx is negative: " << distance << endmsg;
-    }
-    //very approximate error
-    error= 0.;
-  
-    if(params) {
-      error = std::sqrt( (*params->covariance())(Trk::d0,Trk::d0) + (*params->covariance())(Trk::z0,Trk::z0) );
-    }
-      
-    if (error==0.) {
-      msg(MSG::ERROR) << " Error is zero! " << distance << endmsg;
-      error=1.;
-    }
-    msg(MSG::VERBOSE) << " Distance between track and seed vtx: " << distance << " d/s(d) = " << 
-      distance/error << " err " << error << endmsg;
-
-    return distance;
-}
-
-
-} // namespace
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.h
deleted file mode 100644
index c812dd8b933e..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.h
+++ /dev/null
@@ -1,202 +0,0 @@
-///////////////////////// -*- C++ -*- /////////////////////////////
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ImagingSeedTuningAlg.h 
-// Header file for class ImagingSeedTuningAlg
-// Author: D.Casper<dcasper@uci.edu>
-/////////////////////////////////////////////////////////////////// 
-#ifndef TRKVERTEXSEEDFINDERUTILS_IMAGINGSEEDTUNINGALG_H
-#define TRKVERTEXSEEDFINDERUTILS_IMAGINGSEEDTUNINGALG_H 1
-
-// STL includes
-#include <string>
-#include <vector>
-#include <map>
-
-// FrameWork includes
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ITHistSvc.h"
-
-#include "TrkParticleBase/TrackParticleBaseCollection.h"
-#include "TrkParameters/TrackParameters.h"
-
-#include "xAODTracking/TrackParticleContainer.h"
-#include "xAODTracking/VertexContainer.h"
-#include "xAODTruth/TruthEventContainer.h"
-#include "xAODTruth/TruthPileupEventContainer.h"
-
-//Amg
-#include "GeoPrimitives/GeoPrimitives.h"
-
-#include "TH1F.h"
-#include "TTree.h"
-
-#include "BeamSpotConditionsData/BeamSpotData.h"
-
-namespace InDet
-{
-  class IInDetTrackSelectionTool;
-}
-
-namespace Trk
-{
-  class Track;
-  class ITrackLink;
-  class IVertexSeedFinder;
-  class IImpactPoint3dEstimator;
-
-class ImagingSeedTuningAlg
-  : public ::AthAlgorithm
-{ 
-
-  /////////////////////////////////////////////////////////////////// 
-  // Public methods: 
-  /////////////////////////////////////////////////////////////////// 
- public: 
-
-  // Copy constructor: 
-
-  /// Constructor with parameters: 
-  ImagingSeedTuningAlg( const std::string& name, ISvcLocator* pSvcLocator );
-
-  /// Destructor: 
-  virtual ~ImagingSeedTuningAlg(); 
-
-  // Assignment operator: 
-  //ImagingSeedTuningAlg &operator=(const ImagingSeedTuningAlg &alg); 
-
-  // Athena algorithm's Hooks
-  virtual StatusCode  initialize();
-  virtual StatusCode  execute();
-  virtual StatusCode  finalize();
-
- private:
-  /////////////////////////////////////////////////////////////////// 
-  // Const methods: 
-  ///////////////////////////////////////////////////////////////////
-  // compute track distance of approach to vertex
-  double distanceAndError(const Trk::TrackParameters* params, const Amg::Vector3D * vertex, double & err) const;
-
-  // routine to identify visible truth vertices
-  StatusCode findTruth(const std::vector<Trk::ITrackLink*> & trackVector, std::vector<Amg::Vector3D>& truth) const;
-
-  /////////////////////////////////////////////////////////////////// 
-  // Non-const methods: 
-  /////////////////////////////////////////////////////////////////// 
-  void selectTracks(const xAOD::TrackParticleContainer* trackParticles, std::vector<Trk::ITrackLink*> & trackVector);
-
-  void analyzeTracks(const std::vector<Trk::ITrackLink*> & trackVector, std::vector<const Trk::TrackParameters*>& perigeeList);
-
-  void analyzeSeeds(const std::string& conditions, const std::vector<Amg::Vector3D>& seeds, const std::vector<Amg::Vector3D>& truth);
-
-  StatusCode initializeConditions(std::string& conditions);
-
-  StatusCode iterateConditions(std::string& conditions, bool& done);
-
-  StatusCode setupConditions(std::string& conditions);
-  /////////////////////////////////////////////////////////////////// 
-  // Private data: 
-  /////////////////////////////////////////////////////////////////// 
- private: 
-  // Properties
-  // Reco track must pass within this many sigma of interaction vertex to be "good"
-  double m_significanceTruthCut;
-
-  // This many good reco tracks required for truth vertex to be "good"
-  int m_truthVertexTracks;
-
-  // Window around truth vertex for a seed to be "good"
-  double m_truthWindow;
-
-  // Use beam spot?
-  bool m_useBeamConstraint;
-
-  // Input parameter ranges
-  std::vector<float> m_angularCutoffParameterValues;
-  std::vector<float> m_clusterWindowXYValues;
-  std::vector<float> m_mergeParameterValues;
-  std::vector<float> m_weightThresholdValues;
-  std::vector<bool>  m_refineZValues;
-  std::vector<bool>  m_gaussianWindowValues;
-
-  // Tools
-  ToolHandle< InDet::IInDetTrackSelectionTool > m_trackFilter;
-  ToolHandle< Trk::IVertexSeedFinder > m_seedFinder;
-  ToolHandle< Trk::IImpactPoint3dEstimator > m_impactPoint3dEstimator;
-
-  // Non-property private data
-  
-  // Results
-  std::map<std::string, int> m_allSeeds;
-  std::map<std::string, int> m_allTruth;
-  std::map<std::string, int> m_goodSeeds;
-  std::map<std::string, int> m_goodTruth;
-  std::map<std::string, int> m_nFake;
-  std::map<std::string, int> m_nLost;
-  std::map<std::string, int> m_nSplit;
-  std::map<std::string, int> m_nMerge;
-  // IProperty handles
-  SmartIF<IProperty> m_imageMakerProperty;
-  SmartIF<IProperty> m_clusterFinderProperty;
-
-  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
-  ServiceHandle< ITHistSvc > m_iTHistSvc;
-
-  std::vector<float>::const_iterator m_i_angularCutoffParameter;
-  std::vector<float>::const_iterator m_i_clusterWindowXY;
-  std::vector<float>::const_iterator m_i_mergeParameter;
-  std::vector<float>::const_iterator m_i_weightThreshold;
-  std::vector<bool>::const_iterator  m_i_refineZ;
-  std::vector<bool>::const_iterator  m_i_gaussianWindow;
-
-  /// Default constructor: 
-  ImagingSeedTuningAlg();
-
-  /// Data handle keys
-  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackParticlesKey  { this, "TrackParticles", "InDetTrackParticles", 
-                                                                         "Input track particle collection" };
-  SG::ReadHandleKey<xAOD::TruthEventContainer> m_truthEventsKey        { this, "TruthEvents", "TruthEvents", 
-                                                                         "TruthEvent collection" };
-  SG::ReadHandleKey<xAOD::TruthPileupEventContainer> m_pileupEventsKey { this, "TruthPileupEvents", "TruthPileupEvents", 
-                                                                         "TruthPileupEvent collection" };
-
-  /// Histograms and trees
-
-  TH1* m_h_nTruthVertices;
-  TH1* m_h_zTruthVertices;
-
-  TTree* m_t_seeds;
-  int m_b_nTruth;
-  int m_b_nConditions;
-  int m_b_nSeeds[5000];
-  int m_b_nGoodSeeds[5000];
-  int m_b_nGoodTruth[5000];
-  int m_b_nFake[5000];
-  int m_b_nLost[5000];
-  int m_b_nMerge[5000];
-  int m_b_nSplit[5000];
-  float m_b_angularCutoffParameter[5000];
-  float m_b_weightThreshold[5000];
-  float m_b_mergeParameter[5000];
-  float m_b_clusterWindowXY[5000];
-  int m_b_refineZ[5000];
-  int m_b_gaussianWindow[5000];
-
-  int m_iCondition;
-
-}; // class
-}  // namespace
-// I/O operators
-//////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Inline methods: 
-/////////////////////////////////////////////////////////////////// 
-
-
-#endif //> !TRKVERTEXSEEDFINDERUTILS_IMAGINGSEEDTUNINGALG_H
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/LocalMax1DClusterFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/LocalMax1DClusterFinder.cxx
deleted file mode 100644
index a3410a6006aa..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/LocalMax1DClusterFinder.cxx
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*********************************************************************
-          LocalMax1DClusterFinder.cxx - Description in header file
-*********************************************************************/
-#include "TrkVertexSeedFinderUtils/LocalMax1DClusterFinder.h"
-#include "TrkVertexSeedFinderUtils/VertexImage.h"
-#include <algorithm>
-
-namespace Trk
-{
-  
-  namespace {
-#if 0
-    bool compareMaxZ( LocalMax1DClusterFinder::Projection m1,  LocalMax1DClusterFinder::Projection m2 ) {
-      return (m1.first < m2.first);
-    }
-#endif
-  }
-
-  LocalMax1DClusterFinder::LocalMax1DClusterFinder(const std::string& t, const std::string& n, const IInterface*  p) : 
-    base_class(t,n,p),
-    m_weightThreshold( 1500.0 ) ,
-    m_mergeParam( 0.95 ),
-    m_clusterWindowXY( 0.34 ),
-    m_refineZ( true ),
-    m_gaussianWindow( true )
-  {   
-    //threshold to consider a local max for seeding
-    declareProperty("weightThreshold", m_weightThreshold );
-    //merging parameter for nearby local maxima
-    declareProperty("mergeParameter",m_mergeParam);
-    //window in xy bin space within which clusters are formed
-    declareProperty("clusterWindowXY", m_clusterWindowXY );
-    //do quadratic refinement of peak positions
-    declareProperty("refineZ", m_refineZ);
-    //use gaussian window for z projection
-    declareProperty("gaussianWindow", m_gaussianWindow);
-  }
-  
-  
-  // --------------------------------------------------------------------------------
-  // Find vertex clusters of input image
-  std::vector<Amg::Vector3D> LocalMax1DClusterFinder::findVertexClusters( const VertexImage & image ) const
-  {
-
-    std::vector<float> zproj;
-
-    if (m_gaussianWindow) {
-      zproj = image.projectGaussianOnZ( m_clusterWindowXY );
-    } else {
-      zproj = image.projectRectangleOnZ( m_clusterWindowXY, m_clusterWindowXY);
-    }
-
-    //for (size_t i = 0; i < zproj.size(); i++) ATH_MSG_ALWAYS(i << " : " << image.getRelPosZ(i)<< " : " << zproj[i]);
-
-    // vector to store local maxima
-    std::vector<Projection> vmax;  
-  
-    for( size_t i=1; i< zproj.size()-1; ++i) {
-
-      // Check if bin is a local max
-      if( zproj[i] > m_weightThreshold && zproj[i] > zproj[i-1] && zproj[i] > zproj[i+1] ) {
-        //bin i is a local max
-        vmax.emplace_back(i,zproj[i]);
-      }
-    }
-
-
-    //consider closest z neighbours pair wise for merging
-    if( vmax.size() > 1 ) {
-      for(std::vector<Projection>::iterator it=vmax.begin(); it!=vmax.end(); ) {
-        //get the next iterator
-        std::vector<Projection>::iterator next = it+1;
-        //break out if we are on the last one        
-        if(next==vmax.end())
-          break;
-
-        //get lowest weight between these two max, stepping between them
-        float minw = it->second;
-
-        //must be at least 1 bin between them since they are both local maxima
-        for(int i=it->first+1; i<next->first; ++i) {
-          if(zproj[i] < minw)
-            minw = zproj[i];
-        }
-
-        //Calculate merging parameter
-        float mergeParam = minw / std::min( it->second, next->second );
-        if( mergeParam > m_mergeParam ) { //merge these together
-          if( it->second > next->second ) { //we should keep it and delete next
-            it = vmax.erase( next ); //it now points at the element after next in the original vector
-            it--; //step back so that "it" is pointing at the *same thing* it started on
-            //then we can go to the next part of the loop and compare the same local max to the next one in the list
-          } else { //keep next and delete it
-            it = vmax.erase( it );  //it now points at the element next used to point at
-            //don't need to move it, can go to next part of loop and compare to the one after that
-          }
-        } else { //do not merge
-          //go on to the next one directly
-          it++;
-        }
-        
-      } //loop over maxima
-    } //if we had at least 2 maxima to consider for merging
-
-    // Fill return vector
-    std::vector<Amg::Vector3D> vertices;    
-
-
-    //Set them to relative center of histogram in x,y
-    float x = image.getRelPosX( ((float) image.getNBinsX())/2. );
-    float y = image.getRelPosY( ((float) image.getNBinsY())/2. );
-    for(auto & m : vmax) {
-      if (!m_refineZ || zproj[m.first] <= 0) {
-          vertices.emplace_back( x, y, image.getRelPosZ(m.first) );
-      } else {
-	  float z;
-	  float z2 = image.getRelPosZ(m.first);
-	  // handle edge cases (max at first or last z bin)
-	  if (m.first == 0) {
-	    float z3 = image.getRelPosZ(m.first+1);
-	    if (zproj[m.first+1] > 0 && zproj[m.first + 2] > zproj[m.first+1]) {
-	      float w3 = zproj[m.first+1]*(zproj[m.first]/(zproj[m.first]+zproj[m.first+2]));
-    	      z = (z2*zproj[m.first] + z3*w3)/(zproj[m.first]+w3);
-	    } else if (zproj[m.first+1] > 0) {
-	      z = (z2*zproj[m.first] + z3*zproj[m.first+1])/(zproj[m.first] + zproj[m.first+1]);
-	    } else {
-	      z = image.getRelPosZ(m.first);
-	    }
-	  } else if (m.first == image.getNBinsZ() - 1) {
-	    float z1 = image.getRelPosZ(m.first-1);
-	    if (zproj[m.first-1] > 0 && zproj[m.first-2] > zproj[m.first-1]) {
-	      float w1 = zproj[m.first-1]*(zproj[m.first]/(zproj[m.first]+zproj[m.first-2]));
-	      z = (z1*w1 + z2*zproj[m.first])/(w1 + zproj[m.first]);
-	    } else if (zproj[m.first-1] > 0) {
-	      z = (z1*zproj[m.first-1] + z2*zproj[m.first])/(zproj[m.first-1] + zproj[m.first]);
-	    } else {
-	      z = image.getRelPosZ(m.first);
-	    }
-	  // not at an edge, do quadratic refinement
-	  } else {  
-	    if (zproj[m.first-1] > 0 && zproj[m.first] > 0 && zproj[m.first+1] > 0 ) {
-	      float z1 = image.getRelPosZ(m.first-1);
-	      float w2 = zproj[m.first];
-	      float w1;
-	      float w3;
-	      if (m.first > 1 && zproj[m.first-2] > zproj[m.first-1]) {
-		w1 = zproj[m.first-1] * w2/(w2 + zproj[m.first-2]);
-	      } else {
-		w1 = zproj[m.first-1];
-	      }
-	      if (m.first < image.getNBinsZ() - 2 && zproj[m.first+2] > zproj[m.first+1]) {
-		w3 = zproj[m.first+1] * w2/(w2 + zproj[m.first+2]);
-	      } else {
-		w3 = zproj[m.first+1];
-	      }
-	      if ( 4 * (w2 - w1) + 2 * (w1 - w3) > 0 ) {
-		z = z2 + (z2 - z1) * (w3 - w1)/(4 * (w2 - w1) + 2 * (w1 - w3));
-	      } else {  // degenerate (linear) or concave up cases should never happen since z2 is a local maximum
-		ATH_MSG_WARNING( "unexpected histogram shape ("<<w1<<","<<w2<<","<<w3<<")"  );
-		z = image.getRelPosZ(m.first);
-	      }
-	    } else {
-	      z = image.getRelPosZ(m.first);
-	    }
-	  }
-	  vertices.emplace_back( x, y, z );
-      }
-    }
-
-    ATH_MSG_DEBUG( "returning " << vertices.size() << " clusters"  );
-    return vertices;
-
-  } //End findLocalMax1DClusterFinder
-
-
- 
-} //End Trk namespace
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/SimpleVertexClusterFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/SimpleVertexClusterFinder.cxx
deleted file mode 100644
index fe61f32a4667..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/SimpleVertexClusterFinder.cxx
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*********************************************************************
-          SimpleVertexClusterFinder.cxx - Description in header file
-*********************************************************************/
-#include "TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h"
-
-namespace Trk
-{
-  
-  SimpleVertexClusterFinder::SimpleVertexClusterFinder(const std::string& t, const std::string& n, const IInterface*  p) : 
-    base_class(t,n,p),
-    m_weightThreshold( 0.0015        ) ,
-    m_seedCutScale(    1.2           ) 
-  {   
-    //threshold to consider a bin for clusterization
-    declareProperty("weightThreshold", m_weightThreshold );
-    //cut on max bin in a cluster as a multiple of the threshold above
-    declareProperty("seedCutScale"   , m_seedCutScale    );
-  }
-  
-  
-  // --------------------------------------------------------------------------------
-  // Find vertex clusters of input histogram. Note that this is the public function that
-  // Is called from the ImagingSeedFinder tool. Also, if the m_xbins, m_ybins, m_zbins,
-  // is not exactly what they were in ImagingSeedFinder (length of hist_rs is not binstot), 
-  // the code WILL and should fail. 
-  std::vector<Amg::Vector3D> SimpleVertexClusterFinder::findVertexClusters( const VertexImage & image ) const
-  {
-    int binstot = image.getNBins();
-
-    std::vector<Amg::Vector3D> vertices;    
-
-    std::map<int,float> binsRemaining;
-
-    for( int binnum = 0; binnum<image.getArraySize(); ++binnum ){ //Loop over all histogram bins
-
-      float test_val= image.getHist()[binnum] / binstot; //divide by binstot because of scaling after fourier transforms
-      if( test_val > m_weightThreshold) { //Tested value greater that thresshold
-	binsRemaining[binnum] = test_val;
-      }
-    }
-
-    std::vector<std::unique_ptr<Cluster> > clusts;
-    while (!binsRemaining.empty()) {
-      //get a new cluster, but check that it is filled.  Break if not.  in this case not all the bins above threshold are used because of the seed quality cut
-      std::unique_ptr<Cluster> tmpClust = highestCluster( image, binsRemaining );
-      if(!tmpClust->empty())
-	clusts.push_back( std::move (tmpClust) );
-      else {
-	break;
-      }
-    }
-    
-    //all clusters found passed the check on seed cut in highestCluster method, so can safely add them all and delete them.  The vertices are returned with relative position (in distance space) to center of histogram
-    for (std::unique_ptr<Cluster>& cl : clusts) {
-      float xbin,ybin,zbin;
-      getCenter(image, *cl, xbin,ybin,zbin);
-      vertices.emplace_back( image.getRelPosX(xbin),
-                                         image.getRelPosY(ybin),
-                                         image.getRelPosZ(zbin) );
-    }
-
-    ATH_MSG_DEBUG( "returning " << vertices.size() << " clusters"  );
-    return vertices;
-
-  } //End findSimpleVertexClusterFinders
-
-  // --------------------------------------------------------------------------------
-  // Private functions below
-  // --------------------------------------------------------------------------------
-
-  // --------------------------------------------------------------------------------
-  // Get highest cluster in binsremaining map
-  std::unique_ptr<SimpleVertexClusterFinder::Cluster>
-  SimpleVertexClusterFinder::highestCluster( const VertexImage& image,
-                                             std::map<int, float>& binsRemaining ) const
-  {
-    auto clust = std::make_unique<Cluster>();
-    
-    //find highest bin left above the seed cut scale.  for simple finding that doesnt need merging no point starting a cluster only to delete it later
-    float maxWeight = m_weightThreshold*m_seedCutScale;
-    std::map<int,float>::iterator maxIdx= binsRemaining.end();
-    for(std::map<int,float>::iterator bit = binsRemaining.begin(); bit!= binsRemaining.end(); bit++) {
-      if(bit->second > maxWeight) {
-	maxIdx=bit;
-	maxWeight= bit->second;
-      }
-    }
-    
-    if( maxIdx==binsRemaining.end() ) { //nothing above threshold
-      return clust;
-    } //start the cluster with the highest bin, removing it from future consideration
-      clust->push_back(binContent( maxIdx->first, maxIdx->second ));
-      binsRemaining.erase(maxIdx);
-    
-    
-    //find more bins to add
-    addBinsToCluster( image, *clust, 0, binsRemaining );
-    
-    return clust;
-    
-  } // End GethighestCluster
-  
-
-  // --------------------------------------------------------------------------------
-  // Add bins to cluster
-  void SimpleVertexClusterFinder::addBinsToCluster( const VertexImage& image,
-                                                    Cluster& clust,
-                                                    Cluster::size_type oldEdge,
-                                                    std::map<int, float>& binsRemaining ) const
-  {
-    //plan:
-    //loop over all "edge bins" = last set added by this method
-    //get all their adjacent bins (that are in the binsRemaining?)
-    //any adjacent bin gets put in a list
-    //...bin could be picked by 2 bins or more from the edfe
-    //...so run a duplicate removal
-    //add all new bins to the cluster and update edgeStart
-    //if we added any bins then run this method again
-    
-    int numadded = 0;
-    Cluster::size_type newEdge = clust.size();
-    //loop over all edges first
-    Cluster::const_iterator currEnd = clust.end();
-    for( Cluster::const_iterator bit= clust.begin()+oldEdge; bit!=currEnd; bit++) {
-      
-      //find adjacents, check if they are less and add them to the list
-      std::vector<int> adjIdx = image.getAdjacentBins( bit->first );
-      for(unsigned int i=0; i< adjIdx.size(); i++) {
-
-        //try to find it in bins remaining
-	std::map<int,float>::iterator mit= binsRemaining.find( adjIdx[i] );
-	if( mit!= binsRemaining.end()) {
-	  clust.push_back(binContent(adjIdx[i], mit->second)  );
-
-	  if(numadded==0) {
-            //keep track of the first bin added to the cluster on this call to method
-	    newEdge = clust.size()-1;
-	  }
-
-	  numadded++;
-
-	  binsRemaining.erase( mit );  // delete from remaining bins now
-	  
-	} 
-      }
-    }
-    
-    //if we added anything need to continue looking for more
-    if(numadded > 0) {
-      addBinsToCluster( image, clust, newEdge, binsRemaining);
-    }
-    
-    
-  } //End Add bins to cluster
-
-  
-  // --------------------------------------------------------------------------------
-  // get center
-  void SimpleVertexClusterFinder::getCenter( const VertexImage& image,
-                                             const Cluster& cl,
-                                             float & xpos,
-                                             float & ypos,
-                                             float & zpos) const
-  {
-    xpos=0;
-    ypos=0;
-    zpos=0;
-    
-    float totw=0;
-    
-    for (const binContent& bin : cl) {
-      const double w = bin.second;
-      totw += w;
-      
-      int x,y,z;
-      image.getInvRMBin( bin.first, x, y, z);
-      
-      xpos+= ((float) x)*w;
-      ypos+= ((float) y)*w;
-      zpos+= ((float) z)*w;
-      
-    }
-    
-    //in bin space
-    xpos= xpos/totw;
-    ypos= ypos/totw;
-    zpos= zpos/totw;
-    
-    //
-  } //end get center
-  
-
-} //End Trk namespace
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImage.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImage.cxx
deleted file mode 100644
index ff9e647a3db3..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImage.cxx
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TrkVertexSeedFinderUtils/VertexImage.h"
-#include "EventPrimitives/EventPrimitives.h"
-#include "fftw3.h"
-#include <cmath>
-#include <iostream>
-
-namespace Trk {
-
-  VertexImage::VertexImage( float* array,
-                            arrayDeleter* deleter,
-                            int nx, int ny, int nz, 
-                            float xrange, float yrange, float zrange) :
-    m_hist_3d(array),
-    m_deleter(deleter),
-    m_nbinsx(nx),
-    m_nbinsy(ny),
-    m_nbinsz(nz),
-    m_xrange(xrange),
-    m_yrange(yrange),
-    m_zrange(zrange)
-  {
-    //Calculate size of histogram and storage array
-    m_binstot = m_nbinsx*m_nbinsy*m_nbinsz;
-    m_arraytot = m_nbinsx*m_nbinsy*(m_nbinsz+2);
-
-    //Calculate binwidths
-    m_wx = 2*m_xrange/((float) m_nbinsx);
-    m_wy = 2*m_yrange/((float) m_nbinsy);
-    m_wz = 2*m_zrange/((float) m_nbinsz);
-  }
-
-
-  // Given indices (x,y,z), return overall array index of that bin
-  int VertexImage::getRMBin(const int & x, const int & y, const int & z) const {
-    int ret = z + (m_nbinsz+2)*y + (m_nbinsz+2)*m_nbinsy*x;
-    return ret;
-  }
-
-  // Given overall array index i of a bin, return indices (x,y,z) by reference
-  void VertexImage::getInvRMBin( const int & i, int & x, int & y, int &z ) const {
-    z = i % (m_nbinsz+2);
-    y = ( (i-z)/(m_nbinsz+2) ) % m_nbinsy;
-    x = ( i - z - y*(m_nbinsz+2) )/( (m_nbinsz+2)*m_nbinsy );
-  }
-
-  // Find array indices of all bins adjacent to index
-  std::vector<int> VertexImage::getAdjacentBins( int index ) const {
-    
-    int x,y,z;
-    
-    getInvRMBin( index, x,y,z );
-   
-    std::vector<int> v;
-    
-    if(x!=0) v.push_back(getRMBin( x-1, y, z));
-    if(y!=0) v.push_back(getRMBin( x, y-1, z));
-    if(z!=0) v.push_back(getRMBin( x, y, z-1));
-    
-    if(x<m_nbinsx-1) v.push_back(getRMBin( x+1, y, z));
-    if(y<m_nbinsy-1) v.push_back(getRMBin( x, y+1, z));
-    if(z<m_nbinsz-1) v.push_back(getRMBin( x, y, z+1));
-    
-    return v;
-
-  }
-
-  //Project to a 1D distribution in z using full xy range
-  std::vector<float> VertexImage::projectRectangleOnZ() const {
-    return projectRectangleOnZ( 0, m_nbinsx, 0, m_nbinsy);
-  }
-
-  // Given a rectangle in xy, project down to a 1D distribution in z
-  // min is inclusive, and max is exclusive (so full range is 0 to m_nbins)
-  std::vector<float> VertexImage::projectRectangleOnZ( int xmin, int xmax, int ymin, int ymax ) const {
-
-    //create return structure
-    std::vector<float> vret(m_nbinsz);
-
-    // Loop over z
-    for( int z=0; z<m_nbinsz; ++z ) {
-
-      //Do the projection
-      for(int x=xmin; x < xmax; ++x) {
-        for(int y=ymin; y < ymax; ++y) {
-          int idx = getRMBin(x,y,z);
-          vret[z] += m_hist_3d[idx];
-        }
-      }
- 
-    }
-
-    return vret;
-  }
-
-  // Project bins within nsigma standard deviations of the mean of the image
-  std::vector<float> VertexImage::projectRectangleOnZ( float nsigmax, float nsigmay) const {
-
-    //Calculate the mean and standard deviation in x and y
-    double meanx=0;
-    double mx2=0;
-    double meany=0;
-    double my2=0;
-    double tot=0;
-
-    //----------------------------------------
-    //One pass variant -- having precision issues when including negative weights, so cut them
-    // Loop through all actual bins in the histogram
-    for(int x=0; x < m_nbinsx; ++x) {
-      for(int y=0; y < m_nbinsy; ++y) {
-
-        double w=0;
-        //Add up whole z range to help with computational problems with negative weights
-        for( int z=0; z<m_nbinsz; ++z ) {
-          int i = getRMBin(x,y,z);
-          w+= m_hist_3d[i];
-        }
-
-        if(w < 0)
-          continue;
-
-        tot += w;
-
-        // for tot to be 0 w has to be also (so shouldn't update the values
-        if(tot==0)
-          continue;
-
-        //diff to last x mean
-        double diffx = ((double) x+0.5) - meanx;
-        //update mean x
-        meanx += w*diffx/tot;
-        //update squared difference 
-        mx2 += w * diffx * (((double) x+0.5 ) - meanx);
-        
-        //diff to last y mean
-        double diffy = ((double) y+0.5) - meany;
-        //update mean y
-        meany += w*diffy/tot;
-        //update squared difference 
-        my2 += w * diffy * (((double) y +0.5) - meany);
-        
-      }
-    }
-    
-    //If for some reason the total weight is 0 (empty histogram?), just project everything
-    if( tot == 0 ) {
-      return projectRectangleOnZ();
-    }
-
-    // Finalize standard deviation
-    float sigmax = sqrt( mx2/tot );
-    float sigmay = sqrt( my2/tot );
-
-    //----------------------------------------
-    //End 1 pass variant
-  
-    // Project using any bin touched by n standard deviations:
-    // Cast bounds to int, add 1 to the max 
-    
-    int xmin = meanx - sigmax*nsigmax;
-    int xmax = meanx + sigmax*nsigmax + 1.;
-
-    int ymin = meany - sigmay*nsigmay;
-    int ymax = meany + sigmay*nsigmay + 1.;
-
-    // Ensure no boundary issues (could result from large std. dev.)
-    if(xmin < 0)
-      xmin = 0;
-    if(xmax > m_nbinsx)
-      xmax = m_nbinsx;
-    if(ymin < 0)
-      ymin = 0;
-    if(ymax > m_nbinsy)
-      ymax = m_nbinsy;
-
-    return projectRectangleOnZ( xmin, xmax, ymin, ymax );
-
-  }
-
-  // Project on Z around fitted centroid using Gaussian weighting
-  std::vector<float> VertexImage::projectGaussianOnZ(float scale) const {
-    float x = 0.0;
-    float y = 0.0;
-    float sigmax = 0.0;
-    float sigmay = 0.0;
-    fitCentroid(x, y, sigmax, sigmay);
-    return projectGaussianOnZ(x, y, scale * sigmax, scale * sigmay);
-  }
-
-  // Fit the centroid by projecting on x,y
-  void VertexImage::fitCentroid(float& x, float& y, float& sigmax, float& sigmay) const {
-    // defaults in case something goes wrong
-    x = m_nbinsx/2;
-    y = m_nbinsy/2;
-    sigmax = m_nbinsx/2;
-    sigmay = m_nbinsy/2;
-    
-    float* hxy = new float[m_nbinsx*m_nbinsy];
-    float sumPos = 0.0;
-    int nPos = 0;
-    float sumx = 0;
-    float sumy = 0;
-    float sumx2 = 0;
-    float sumy2 = 0;
-    for (int ix = 0; ix < m_nbinsx; ix++) {
-      for (int iy = 0; iy < m_nbinsy; iy++) {
-	int ibin = ix + iy * m_nbinsx;
-	hxy[ibin] = 0.0;
-	for (int iz = 0; iz < m_nbinsz; iz++) {
-	  int idx = getRMBin(ix, iy, iz);
-	  hxy[ibin] += m_hist_3d[idx];
-	}
-	if (hxy[ibin] > 0) {
-	  sumPos += hxy[ibin];
-	  nPos++;
-	  sumx += (ix * hxy[ibin]);
-	  sumy += (iy * hxy[ibin]);
-	  sumx2+= (ix * ix * hxy[ibin]);
-	  sumy2+= (iy * iy * hxy[ibin]);
-	}
-      }
-    }
-    // compute average position and width of positive weights
-    if (nPos <= 0) {
-      //msg(MSG::WARNING) << "XY projection of image has no positive weights" << endmsg;
-      if (hxy) delete[] hxy;
-      return;
-    }
-    // update fallback quantities to something better
-    x = sumx/sumPos;
-    y = sumy/sumPos;
-    sigmax = sqrt(sumx2/sumPos - x*x);
-    sigmay = sqrt(sumy2/sumPos - y*y);
-    //std::cout << "VertexImage: fallback values " << x << ", " << y << " : " << sigmax << ", " << sigmay << std::endl;
-
-    // we will fit the centroid using only bins which are higher than the average of positive bins
-    // this avoids numerical problems with negative bins
-
-    // if we don't have at least 5 qualifying bins, we can't fit the five unknowns
-    if (nPos < 5) {
-      std::cout << "VertexImage: less than five bins available for fitting centroid" << std::endl;
-      if (hxy) delete[] hxy;
-      return;
-    }
-
-    float avePos = sumPos/nPos;
-    double s_x4 = 0;
-    double s_y4 = 0;
-    double s_x2y2 = 0;
-    double s_x3 = 0;
-    double s_y3 = 0;
-    double s_x2y = 0;
-    double s_xy2 = 0;
-    double s_x2 = 0;
-    double s_y2 = 0;
-    double s_xy = 0;
-    double s_x = 0;
-    double s_y = 0;
-    double s_x2q = 0;
-    double s_y2q = 0;
-    double s_xq = 0;
-    double s_yq = 0;
-    double s_q = 0;
-    int s_n = 0;
-    for (int ix = 0; ix < m_nbinsx; ix++) {
-      for (int iy = 0; iy < m_nbinsy; iy++) {
-	int ibin = ix + iy * m_nbinsx;
-	if (hxy[ibin] < avePos) continue;
-	float q = log(hxy[ibin]);
-	s_q += q;
-	s_x += (double) ix;
-	s_y += (double) iy;
-	s_xq += (double) ix * q;
-	s_yq += (double) iy * q;
-	s_x2 += (double) ix*ix;
-	s_xy += (double) ix*iy;
-	s_y2 += (double) iy*iy;
-	s_x2q += (double) ix*ix*q;
-	s_y2q += (double) iy*iy*q;
-	s_x3 += (double) ix*ix*ix;
-	s_y3 += (double) iy*iy*iy;
-	s_x2y += (double) ix*ix*iy;
-	s_xy2 += (double) ix*iy*iy;
-	s_x4 += (double) ix*ix*ix*ix;
-	s_y4 += (double) iy*iy*iy*iy;
-	s_x2y2 += (double) ix*ix*iy*iy;
-	s_n++;
-      }
-    }
-    if (hxy) delete[] hxy;
-    //AmgMatrix(5,5) m;
-    Eigen::Matrix<double,5,5> m;
-    m << s_x4, s_x2y2, s_x3, s_x2y, s_x2,
-      s_x3, s_xy2, s_x2, s_xy, s_x,
-      s_x2y2, s_y4, s_xy2, s_y3, s_y2,
-      s_x2y, s_y3, s_xy, s_y2, s_y,
-      s_x2, s_y2, s_x, s_y, s_n;
-    Eigen::Matrix<double, 5, 1> v;
-    v << s_x2q, s_xq, s_y2q, s_yq, s_q;
-    Eigen::Matrix<double, 5, 1> sol = m.colPivHouseholderQr().solve(v);
-
-    // transform the solution variables back to the ones we want
-    double sigmax2 = -1/(2*sol[0]);
-    double sigmay2 = -1/(2*sol[1]);
-    double mux = sol[2] * sigmax2;
-    double muy = sol[3] * sigmay2;
-    
-    if (sigmax2 > 0 && sigmay2 > 0) {
-      sigmax = (float) sqrt(sigmax2);
-      sigmay = (float) sqrt(sigmay2);
-      x = (float) mux;
-      y = (float) muy;
-      //std::cout << "VertexImage: Successful gaussian fit: " << x << ", " << y << " : " << sigmax << ", " << sigmay << std::endl;
-    } else {
-      std::cout << "Bad result from gaussian fit" << std::endl;
-      std::cout << "VertexImage : " << sol << std::endl;
-    }
-  }
-
-  // Project on z using Gaussian weighting in x,y
-  std::vector<float> VertexImage::projectGaussianOnZ(float centx, float centy, float sigmax, float sigmay) const {
-    //create return structure
-    std::vector<float> vret(m_nbinsz);
-
-    // Loop over z
-    for( int z=0; z<m_nbinsz; ++z ) {
-      float totalWeight = 0.0;
-      //Do the projection
-      for(int x=0; x < m_nbinsx; ++x) {
-        for(int y=0; y < m_nbinsy; ++y) {
-          int idx = getRMBin(x,y,z);
-	  float gauss = exp(-(x-centx)*(x-centx)/(2*sigmax*sigmax))*exp(-(y-centy)*(y-centy)/(2*sigmay*sigmay));
-          vret[z] += gauss*m_hist_3d[idx];
-	  totalWeight += gauss;
-        }
-      }
-      vret[z] /= totalWeight; 
-    }
-
-    return vret;
-  }
-
-}
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImageMaker.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImageMaker.cxx
deleted file mode 100644
index 7b844102fd3d..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImageMaker.cxx
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TrkVertexSeedFinderUtils/VertexImageMaker.h"
-#include "GaudiKernel/PhysicalConstants.h"
-
-
-namespace Trk
-{
-
-  VertexImageMaker::VertexImageMaker(const std::string& t, const std::string& n, const IInterface*  p) :
-    base_class(t,n,p),
-    m_xbins(                   32         ) , 
-    m_ybins(                   32         ) ,
-    m_zbins(                 2048         ) ,   
-    m_xrange(                   2.0       ) ,
-    m_yrange(                   2.0       ) , 
-    m_zrange(                 200.0       ) ,
-    m_a0Window(                 0.35875   ) ,
-    m_a1Window(                 0.48829   ) ,
-    m_a2Window(                 0.14128   ) ,
-    m_a3Window(                 0.01168   ) ,
-    m_cutoffFreqDenominator_xy( 2         ) ,
-    m_cutoffFreqDenominator_z(  1         ) ,
-    m_angularCutoffParameter(   0.75      ) ,
-    m_wx(0.0f), m_wy(0.0f), m_wz(0.0f), m_filttot(0), 
-    m_plan_r2c(nullptr), m_plan_c2r(nullptr)	          {
-
-    declareProperty("xbins"                   , m_xbins                    );
-    declareProperty("ybins"                   , m_ybins                    );
-    declareProperty("zbins"                   , m_zbins                    );
-    declareProperty("xrange"                  , m_xrange                   );
-    declareProperty("yrange"                  , m_yrange                   );
-    declareProperty("zrange"                  , m_zrange                   );
-    declareProperty("a0Window"                , m_a0Window                 );
-    declareProperty("a1Window"                , m_a1Window                 );
-    declareProperty("a2Window"                , m_a2Window                 );
-    declareProperty("a3Window"                , m_a3Window                 );
-    declareProperty("cutoffFreqDenominator_xy", m_cutoffFreqDenominator_xy );
-    declareProperty("cutoffFreqDenominator_z" , m_cutoffFreqDenominator_z  );
-    declareProperty("angularCutoffParameter"  , m_angularCutoffParameter   );
-    declareInterface<IVertexImageMaker>(this);
-  } //End constructor
-
-
-  StatusCode VertexImageMaker::initialize() {
-    
-    //Calculate binwidths
-    m_wx = 2*m_xrange/((float) m_xbins);
-    m_wy = 2*m_yrange/((float) m_ybins);
-    m_wz = 2*m_zrange/((float) m_zbins);
-
-    //calculate total number of bins needed for filter
-    m_filttot = m_xbins * m_ybins * ( m_zbins/2 + 1);
-
-    ATH_MSG_INFO( "Initializing frequency space filter"  );
-    initFSFilter();
-
-    //Allocate memory to histogram (used for both real and freq space)
-    ATH_MSG_INFO( "Allocating memory to fftw - Histogram size : " << m_xbins << " , " << m_ybins << " , " << m_zbins  );
-    float* histRS = (float*)fftwf_malloc( sizeof(float) * m_filttot * 2 );
-    //Get a complex casted version for easier access to the freq space using same bin numbering
-    fftwf_complex* histFS = (fftwf_complex*) histRS;
-
-    ATH_MSG_INFO( "Setting up FFTW plans"  );
-    m_plan_r2c = fftwf_plan_dft_r2c_3d(m_xbins, m_ybins, m_zbins, histRS, histFS, FFTW_MEASURE);
-    m_plan_c2r = fftwf_plan_dft_c2r_3d(m_xbins, m_ybins, m_zbins, histFS, histRS, FFTW_MEASURE);
-
-    fftwf_free( histRS );
-
-
-    return StatusCode::SUCCESS;
-
-  }// End initialize
-
-
-  StatusCode VertexImageMaker::finalize() 
-  {
-
-    fftwf_destroy_plan(m_plan_r2c);
-    fftwf_destroy_plan(m_plan_c2r);
-    fftwf_cleanup();
-
-    ATH_MSG_INFO( "Finalize ImageingSeedFinder successful"  );
-
-    return StatusCode::SUCCESS;
-  }// End ImagingSeedFinder finalize
-
-
-  std::unique_ptr<VertexImage>
-  VertexImageMaker::makeVertexImage( const std::vector<const Trk::TrackParameters*>& parametersList,
-                                     const xAOD::Vertex * constraint ) const
-  {
-    float* histRS = (float*)fftwf_malloc( sizeof(float) * m_filttot * 2 );
-    fftwf_complex* histFS = (fftwf_complex*) histRS;
-
-    auto image = std::make_unique<VertexImage> (histRS, fftwf_free,
-                                                m_xbins, m_ybins, m_zbins,
-                                                m_xrange, m_yrange, m_zrange);
-
-   //Fill the histogram
-    ATH_MSG_DEBUG("Filling Histogram ..."  );
-    fillHist( *image, parametersList, constraint );
-
-    //Forward transform
-    ATH_MSG_DEBUG("R2C Fourier ..."  );
-    fftwf_execute_dft_r2c ( m_plan_r2c, histRS, histFS );
-
-    ATH_MSG_DEBUG("Filtering ..."  );
-    filterFSHist (*image);
-
-    //back transform
-    ATH_MSG_DEBUG("C2R Fourier"  );
-    fftwf_execute_dft_c2r ( m_plan_c2r, histFS, histRS );
-
-    return image;
-  }
-
-  // --------------------------------------------------------------------------------
-  // VertexImageMaker Fill histogram
-  void VertexImageMaker::fillHist(VertexImage& image,
-                                  const std::vector<const Trk::TrackParameters*>& parametersList,
-                                  const xAOD::Vertex * constraint) const
-  {
-    //Method for backprojecting all the tracks through the bin space
-    //Method based on paper "A Fast Voxel Traversal Algorithm for Ray Tracing" by John Amanatides and Andrew Woo
-    // from Proceedings of EUROGRAPHICS Vol 87, 1987
-
-    //Histogram ranges
-    float x_min = - m_xrange;
-    float x_max =   m_xrange;
-    float y_min = - m_yrange;
-    float y_max =   m_yrange;
-    float z_min = - m_zrange;
-    float z_max =   m_zrange;
-
-
-    //Calculate ranges
-    if( constraint ) {
-      x_min += constraint->position().x();
-      x_max += constraint->position().x();
-      y_min += constraint->position().y();
-      y_max += constraint->position().y();
-      z_min += constraint->position().z();
-      z_max += constraint->position().z();
-    }
-
-    float* histRS = image.getHist();
-    
-    //Resetting histogram
-    for ( int iBin=0; iBin<m_filttot*2/*m_binstot*/; iBin++){
-	histRS[iBin] = 0.0;
-    }
-
-    //loop over track params
-    for (const Trk::TrackParameters* par : parametersList) {
-      //get parametric linearization of track first with t=0 at point given by track parameters (doesn't really matter where it is)
-
-      //position
-      float x = par->position()[Trk::x]; 
-      float y = par->position()[Trk::y];
-      float z = par->position()[Trk::z]; 
-
-      //3d slope of track is 
-      // | sinTheta*cosPhi |
-      // | sinTheta*sinPhi |
-      // |     cosTheta    |
-
-      // vec{pos} = vec{x}_{pca} + t*vec{slope}
-
-      float px = par->momentum()[Trk::px];
-      float py = par->momentum()[Trk::py];
-      float pz = par->momentum()[Trk::pz];
-      float p = sqrt( px*px + py*py + pz*pz );
-
-      float stcp = px / p;
-      float stsp = py / p;
-      float ct = pz / p;
-      float st = sqrt(stcp*stcp + stsp*stsp);  //always positive, as intended
-      float angularCutoffFactor = pow(st, m_angularCutoffParameter);
-
-      //which direction we are headed in bin space
-      //controls direction the bin counter moves
-      int stepX = ( stcp > 0 ) ? 1 : -1;
-      int stepY = ( stsp > 0 ) ? 1 : -1;
-      int stepZ = ( ct > 0 ) ? 1 : -1;
-
-      //how far in t we move to cross bin width in each direction with protection against no slope in that direction
-      float tDeltaX = (stcp != 0) ? fabs(m_wx/stcp) : FLT_MAX;
-      float tDeltaY = (stsp != 0) ? fabs(m_wy/stsp) : FLT_MAX;
-      float tDeltaZ = (ct != 0)   ? fabs(m_wz/ct)   : FLT_MAX;
-
-      //keep track of the next value of t that crosses a boundary during the traversal
-      float tMaxX = 0.0;
-      float tMaxY = 0.0;
-      float tMaxZ = 0.0;
-      
-      //keep track of current value of t -- used to calculate path length in a bin
-      float tcurr = 0.0;
-
-      //bin counters
-      int xbin, ybin, zbin;
-
-      //first solve for the parametric sol'ns for the intersections with the 6 planes of the box
-      float t[6] = {
-        ( x_min - x )/(stcp),
-        ( x_max - x )/(stcp),
-        
-        ( y_min - y )/(stsp),
-        ( y_max - y )/(stsp),
-        
-        ( z_min - z )/(ct),
-        ( z_max - z )/(ct)
-      };
-
-      //need to find the smallest value of t that is inside the box for all variables
-      //start by sorting
-      std::sort( t, t+6);
-      bool fail = true;
-      for(int i=0; i<6; ++i) {
-        
-        float xcurr = x + t[i]*stcp;
-        float ycurr = y + t[i]*stsp;
-        float zcurr = z + t[i]*ct;
-
-        if( xcurr >= x_min && xcurr <= x_max &&
-            ycurr >= y_min && ycurr <= y_max &&
-            zcurr >= z_min && zcurr <= z_max ) {
-
-          //this value of t hits the box, so don't want to skip projecting it
-          fail = false;
-
-          //set starting bin values and current value of t
-          xbin = int ( ((float) m_xbins)*(xcurr-x_min)/(x_max-x_min) );
-          ybin = int ( ((float) m_ybins)*(ycurr-y_min)/(y_max-y_min) );
-          zbin = int ( ((float) m_zbins)*(zcurr-z_min)/(z_max-z_min) );
-          tcurr = t[i];
-
-          //in case curr == max, need to adjust the bin number
-          if(xbin ==  m_xbins)
-            xbin--;
-          if(ybin ==  m_ybins)
-            ybin--;
-          if(zbin ==  m_zbins)
-            zbin--;
-
-          //next value of t to cross a bin boundary in x,y, or z -- only hard to calculate for this first step where we start at unknown point relative to the grid
-          //if one is set to FLT_MAX bc it has no slope in that direction, should always fail the < comparisons in the traversal
-          if(stcp==0)
-            tMaxX = FLT_MAX;
-          else
-            tMaxX = (stepX > 0) ? (x_min + ((float)xbin+1)*m_wx - xcurr)/(stcp) + tcurr : (x_min +((float)(xbin))*m_wx - xcurr)/(stcp) + tcurr;
-          if(stsp==0)
-            tMaxY = FLT_MAX;
-          else
-            tMaxY = (stepY > 0) ? (y_min + ((float)ybin+1)*m_wy - ycurr)/(stsp) + tcurr : (y_min +((float)(ybin))*m_wy - ycurr)/(stsp) + tcurr;
-          if(ct==0)
-            tMaxZ = FLT_MAX;
-          else
-            tMaxZ = (stepZ > 0) ? (z_min + ((float)zbin+1)*m_wz - zcurr)/(ct) + tcurr : (z_min +((float)(zbin))*m_wz - zcurr)/(ct) + tcurr;
-
-          break; //don't keep going or will find instead the exit from the box
-        }
-      }
-      if(fail) //miss box entirely so don't use this track
-        continue;
-      
-      //loop bins until we leave the box
-      while( xbin>=0 && xbin< m_xbins &&
-	     ybin>=0 && ybin< m_ybins &&
-	     zbin>=0 && zbin< m_zbins ) {
-
-        //if two tMax are equal, one will process before the other, but in the "middle" bin of those two steps, tMax - tcurr will be 0
-        //so that bin doesn't get any weight, and the result is the same as if both stepped at same time
-        if( tMaxX < tMaxY ) {
-          if(tMaxX < tMaxZ) { //leave x bin first
-            histRS[image.getRMBin( xbin, ybin, zbin )] += (tMaxX - tcurr)*angularCutoffFactor; //add the path length to the bin we are about to leave
-            tcurr = tMaxX; //set a new current value of t
-            tMaxX += tDeltaX; //set the max in x to the next time the path hits a boundary in x
-            xbin += stepX; //increment the bin
-          } else { //leave z bin first
-            histRS[image.getRMBin( xbin, ybin, zbin )] += (tMaxZ - tcurr)*angularCutoffFactor;
-            tcurr = tMaxZ;
-            tMaxZ += tDeltaZ;
-            zbin+=stepZ;
-          }
-        } else {
-          if(tMaxY < tMaxZ) { //leave y bin first
-            histRS[image.getRMBin( xbin, ybin, zbin )] += (tMaxY - tcurr)*angularCutoffFactor;
-            tcurr = tMaxY;
-            tMaxY += tDeltaY;
-            ybin+=stepY;
-          } else { //leave z bin first
-            histRS[image.getRMBin( xbin, ybin, zbin )] += (tMaxZ - tcurr)*angularCutoffFactor;
-            tcurr = tMaxZ;
-            tMaxZ += tDeltaZ;
-            zbin+=stepZ;
-          }
-        }
-
-      }
-
-    }//loop tracks
-  }//end backproj
-
-  // --------------------------------------------------------------------------------
-  // Initialize vector containing filter values for FS histogram bins
-  void VertexImageMaker::initFSFilter() {
-
-    m_histFSFilter.reserve( m_filttot );
-    m_histFSFilter.resize( m_filttot ); //Allocate to total size of filter
-
-    const int cutx = (m_xbins/2)/m_cutoffFreqDenominator_xy;
-    const int cuty = (m_ybins/2)/m_cutoffFreqDenominator_xy;
-    const int cutz = (m_zbins/2)/m_cutoffFreqDenominator_z; 
-
-    for(int ifilt=0; ifilt<m_filttot; ifilt++) {
-
-      float filtVal = 0.0;
-
-      int ztmp = (m_zbins/2+1);
-      int z = ifilt % ztmp;
-      int y = ( (ifilt-z) / ztmp ) % m_ybins;
-      int x = ( ifilt - z - y * ztmp )/( m_ybins * ztmp );
-
-      //convert to negative frequencies for magnitudes...
-      if( x > m_xbins/2) x = x - m_xbins;
-      if( y > m_ybins/2) y = y - m_ybins;
-      if( z > m_zbins/2) z = z - m_zbins;
-
-      float u1 = (1/m_wx)*((float) x)/((float) m_xbins);
-      float u2 = (1/m_wy)*((float) y)/((float) m_ybins);
-      float u3 = (1/m_wz)*((float) z)/((float) m_zbins);
-
-      //limited acceptance filter
-      
-      float magu = sqrt(u1*u1 + u2*u2 + u3*u3);
-      //either choice for magu=0 gives the same filter
-      float cosPsi = (magu>0) ? fabs(u3/magu)            : 1;
-      if(cosPsi>= 0.16307 ) {// angles corresponding to detector opening angle for tracking
-	filtVal = magu/(Gaudi::Units::twopi);
-      } else {
-        float sinPsi = (magu>0) ? sqrt(u1*u1 + u2*u2)/magu : 0;
-	filtVal = magu/(4*asin(0.98661/sinPsi));
-      }
-
-      //window function...
-      float denx = ((float) m_xbins)/m_cutoffFreqDenominator_xy;
-      float deny = ((float) m_ybins)/m_cutoffFreqDenominator_xy;
-      float denz = ((float) m_zbins)/m_cutoffFreqDenominator_z;
-      
-      float rx =  ((float) x)/(denx);
-      float ry =  ((float) y)/(deny);
-      float rz =  ((float) z)/(denz);
-
-      float winx = (abs(x)<=cutx) ? m_a0Window - m_a1Window*cos(2*Gaudi::Units::pi*(rx-0.5)) + m_a2Window*cos(4*Gaudi::Units::pi*(rx-0.5)) - m_a3Window*cos(6*Gaudi::Units::pi*(rx-0.5)) : 0;
-      float winy = (abs(y)<=cuty) ? m_a0Window - m_a1Window*cos(2*Gaudi::Units::pi*(ry-0.5)) + m_a2Window*cos(4*Gaudi::Units::pi*(ry-0.5)) - m_a3Window*cos(6*Gaudi::Units::pi*(ry-0.5)) : 0;
-      float winz = (abs(z)<=cutz) ? m_a0Window - m_a1Window*cos(2*Gaudi::Units::pi*(rz-0.5)) + m_a2Window*cos(4*Gaudi::Units::pi*(rz-0.5)) - m_a3Window*cos(6*Gaudi::Units::pi*(rz-0.5)) : 0;
-
-      m_histFSFilter[ifilt] = filtVal*winx*winy*winz;
-
-    }
-  } //End FS filter initialization
-
-  // --------------------------------------------------------------------------------
-  // Filter frequency space histogram
-  void VertexImageMaker::filterFSHist (VertexImage& image) const
-  {
-    fftwf_complex* histFS = (fftwf_complex*) image.getHist();
-    
-    for(int ifilt=0; ifilt<m_filttot; ifilt++) {
-      histFS[ifilt][0] *= m_histFSFilter[ifilt];
-      histFS[ifilt][1] *= m_histFSFilter[ifilt];
-    }
-
-  }//End filterFSHist
-
-} //End Trk namespace
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/components/TrkVertexSeedFinderUtils_entries.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/components/TrkVertexSeedFinderUtils_entries.cxx
index 42c6fae7ff14..8fc57da6d776 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/components/TrkVertexSeedFinderUtils_entries.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/components/TrkVertexSeedFinderUtils_entries.cxx
@@ -1,16 +1,12 @@
-#include "TrkVertexSeedFinderUtils/Trk2dDistanceSeeder.h"
-#include "TrkVertexSeedFinderUtils/NewtonTrkDistanceFinder.h"
+#include "../GaussianDensityTestAlg.h"
 #include "TrkVertexSeedFinderUtils/FsmwMode1dFinder.h"
+#include "TrkVertexSeedFinderUtils/GaussianTrackDensity.h"
+#include "TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h"
 #include "TrkVertexSeedFinderUtils/Mode3dTo1dFinder.h"
+#include "TrkVertexSeedFinderUtils/NewtonTrkDistanceFinder.h"
 #include "TrkVertexSeedFinderUtils/SeedNewtonTrkDistanceFinder.h"
 #include "TrkVertexSeedFinderUtils/Trk2DDistanceFinder.h"
-#include "TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h"
-#include "TrkVertexSeedFinderUtils/LocalMax1DClusterFinder.h"
-#include "TrkVertexSeedFinderUtils/VertexImageMaker.h"
-#include "TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h"
-#include "../ImagingSeedTuningAlg.h"
-#include "TrkVertexSeedFinderUtils/GaussianTrackDensity.h"
-#include "../GaussianDensityTestAlg.h"
+#include "TrkVertexSeedFinderUtils/Trk2dDistanceSeeder.h"
 
 using namespace Trk ;
 
@@ -20,10 +16,6 @@ DECLARE_COMPONENT( Mode3dTo1dFinder )
 DECLARE_COMPONENT( SeedNewtonTrkDistanceFinder )
 DECLARE_COMPONENT( FsmwMode1dFinder )
 DECLARE_COMPONENT( Trk2DDistanceFinder )
-DECLARE_COMPONENT( SimpleVertexClusterFinder )
-DECLARE_COMPONENT( LocalMax1DClusterFinder )
-DECLARE_COMPONENT( VertexImageMaker )
 DECLARE_COMPONENT( Mode3dFromFsmw1dFinder )
-DECLARE_COMPONENT( ImagingSeedTuningAlg )
 DECLARE_COMPONENT( GaussianTrackDensity )
 DECLARE_COMPONENT( GaussianDensityTestAlg )
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx
index 906dac6f629d..87a0b00df9b0 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx
@@ -10,23 +10,20 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/GaussianTrackDensity.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
-#include "TestTools/random.h"
-#include "GaudiKernel/SystemOfUnits.h"
 #include "CxxUtils/ubsan_suppress.h"
+#include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TestTools/random.h"
+#include "TrkVertexSeedFinderUtils/GaussianTrackDensity.h"
 #include <cassert>
 #include <cmath>
+#include <iostream>
 
 
-// Can't link against these --- they're in a component library.
-#include "../src/GaussianTrackDensity.cxx"
-
 
 using Gaudi::Units::mm;
 using Gaudi::Units::MeV;
@@ -104,7 +101,7 @@ void test2 (Trk::GaussianTrackDensity& tool)
     else {
       z = z1dist(rng);
     }
-      
+
     Amg::Vector3D pos { x, y, z };
     double pt = ptdist(rng);
     double phi = phidist(rng);
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx
index 34021067c68e..7781124e1f28 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx
@@ -10,22 +10,20 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
-#include "TestTools/random.h"
-#include "GaudiKernel/SystemOfUnits.h"
 #include "CxxUtils/ubsan_suppress.h"
+#include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TestTools/random.h"
+#include "TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h"
 #include <cassert>
 #include <cmath>
+#include <iostream>
 
 
-// Can't link against these --- they're in a component library.
-#include "../src/Mode3dFromFsmw1dFinder.cxx"
 
 
 using Gaudi::Units::mm;
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx
index 2ef92b689398..37a4b4b4bdd1 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx
@@ -10,22 +10,18 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/Mode3dTo1dFinder.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
-#include "TestTools/random.h"
-#include "GaudiKernel/SystemOfUnits.h"
 #include "CxxUtils/ubsan_suppress.h"
+#include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TestTools/random.h"
+#include "TrkVertexSeedFinderUtils/Mode3dTo1dFinder.h"
 #include <cassert>
 #include <cmath>
-
-
-// Can't link against these --- they're in a component library.
-#include "../src/Mode3dTo1dFinder.cxx"
+#include <iostream>
 
 
 using Gaudi::Units::mm;
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx
index be7fb26d3caf..b24e95da9e4c 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx
@@ -10,18 +10,18 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/NewtonTrkDistanceFinder.h"
-#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
 #include "CxxUtils/ubsan_suppress.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TrkVertexSeedFinderUtils/NewtonTrkDistanceFinder.h"
 #include <cassert>
 #include <cmath>
+#include <iostream>
 
 // for the field map
 #include "PathResolver/PathResolver.h"
@@ -30,16 +30,13 @@
 
 // for populating conditions store
 #include "SGTools/TestStore.h"
-#include "StoreGate/WriteCondHandleKey.h"
 #include "StoreGate/WriteCondHandle.h"
+#include "StoreGate/WriteCondHandleKey.h"
 
 // for the conditions data
 #include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 #include "MagFieldElements/AtlasFieldCache.h"
 
-// Can't link against these --- they're in a component library.
-#include "../src/NewtonTrkDistanceFinder.cxx"
-#include "../src/PointOnTrack.cxx"
 
 
 void assertVec3D (const Amg::Vector3D& a, const Amg::Vector3D& b)
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx
index ad910f01235d..fd098be5914a 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx
@@ -10,18 +10,18 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/ITrkDistanceFinder.h"
-#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
 #include "CxxUtils/ubsan_suppress.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TrkVertexSeedFinderUtils/ITrkDistanceFinder.h"
 #include <cassert>
 #include <cmath>
+#include <iostream>
 
 // for the field map
 #include "PathResolver/PathResolver.h"
@@ -30,8 +30,8 @@
 
 // for populating conditions store
 #include "SGTools/TestStore.h"
-#include "StoreGate/WriteCondHandleKey.h"
 #include "StoreGate/WriteCondHandle.h"
+#include "StoreGate/WriteCondHandleKey.h"
 
 // for the conditions data
 #include "MagFieldConditions/AtlasFieldCacheCondObj.h"
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx
deleted file mode 100644
index c8a99749a08f..000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
- */
-/**
- * @file TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx
- * @author scott snyder <snyder@bnl.gov>
- * @date Jun, 2019
- * @brief Simple unit test for SimpleVertexClusterFinder.
- */
-
-
-#undef NDEBUG
-#include "TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h"
-#include "TrkVertexSeedFinderUtils/VertexImageMaker.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
-#include "TestTools/random.h"
-#include "GaudiKernel/SystemOfUnits.h"
-#include "CxxUtils/ubsan_suppress.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "TInterpreter.h"
-#include <iostream>
-#include <cassert>
-#include <cmath>
-
-
-// Can't link against these --- they're in a component library.
-#include "../src/SimpleVertexClusterFinder.cxx"
-#include "../src/VertexImageMaker.cxx"
-#include "../src/VertexImage.cxx"
-
-
-using Gaudi::Units::mm;
-using Gaudi::Units::MeV;
-using Gaudi::Units::GeV;
-
-
-std::unique_ptr<AmgSymMatrix(5)> cov5()
-{
-  auto m = std::make_unique<AmgSymMatrix(5)>();
-  m->setIdentity();
-  return m;
-}
-
-
-void initVertex (xAOD::Vertex& v)
-{
-  v.makePrivateStore();
-  v.setX (1.7);
-  v.setY (1.3);
-  v.setZ (-6);
-
-  AmgSymMatrix(3) cov;
-  cov.setIdentity();
-  v.setCovariancePosition (cov);
-}
-
-
-void assertVec3D (const Amg::Vector3D& a, const Amg::Vector3D& b)
-{
-  assert( Athena_test::isEqual (a.x(), b.x(), 1e-5) );
-  assert( Athena_test::isEqual (a.y(), b.y(), 1e-5) );
-  assert( Athena_test::isEqual (a.z(), b.z(), 1e-5) );
-}
-
-
-#if 0
-std::ostream& printVec3D (const Amg::Vector3D& a)
-{
-  std::cout << a.x() << " " << a.y() << " " << a.z();
-  return std::cout;
-}
-#endif
-void test1 (Trk::VertexImageMaker& tool1, Trk::SimpleVertexClusterFinder& tool2)
-{
-  std::cout << "test1\n";
-
-  Amg::Vector3D pos0 { 0, 0, 0 };
-
-  std::vector<std::unique_ptr<Trk::Perigee> > perigees;
-  std::vector<const Trk::TrackParameters*> pvec;
-  Athena_test::normal_distribution<double> xdist (1*mm, 0.1*mm);
-  Athena_test::normal_distribution<double> ydist (-0.7*mm, 0.1*mm);
-  Athena_test::normal_distribution<double> z1dist (12*mm, 1*mm);
-  Athena_test::normal_distribution<double> z2dist (-3*mm, 0.5*mm);
-  Athena_test::uniform_real_distribution<double> ptdist (0.1*GeV, 100*GeV);
-  Athena_test::uniform_real_distribution<double> phidist (-M_PI, M_PI);
-  Athena_test::uniform_real_distribution<double> etadist (-4, 4);
-  Athena_test::URNG rng;
-  for (unsigned int i=0; i < 200; i++) {
-    double x = xdist(rng);
-    double y = ydist(rng);
-    double z;
-    if ((i%3) == 0) {
-      z = z2dist(rng);
-    }
-    else {
-      z = z1dist(rng);
-    }
-      
-    Amg::Vector3D pos { x, y, z };
-    double pt = ptdist(rng);
-    double phi = phidist(rng);
-    double eta = etadist(rng);
-    Amg::Vector3D mom { pt*cos(phi), pt*sin(phi), pt*sinh(eta) };
-    double charge = etadist(rng) > 0 ? 1 : -1;
-    perigees.emplace_back (std::make_unique<Trk::Perigee> (pos, mom, charge, pos0,
-                                                           cov5().release()));
-    pvec.push_back (perigees.back().get());
-  }
-
-  xAOD::Vertex vert1;
-  initVertex (vert1);
-
-  std::unique_ptr<Trk::VertexImage> image = tool1.makeVertexImage(pvec, &vert1);
-  std::vector<Amg::Vector3D> verts = tool2.findVertexClusters (*image);
-  assert (verts.size() == 4);
-  assertVec3D (verts[0], { -0.778228, -1.80779, 17.8691  });
-  assertVec3D (verts[1], { -0.721533, -1.79632,  2.88162 });
-  assertVec3D (verts[2], { -0.756713,  1.85018, 17.9267  });
-  assertVec3D (verts[3], { -0.788483,  1.85138,  2.82426 });
-#if 0
-  for (const auto& vv : verts) {
-    printVec3D (vv) << "\n";
-  }
-#endif
-}
-
-
-int main()
-{
-  std::cout << "TrkVertexSeedFinderUtils/SimpleVertexClusterFinder_test\n";
-  CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); });
-  ISvcLocator* svcloc = nullptr;
-  Athena_test::initGaudi ("TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils_tests.txt", svcloc);
-
-  ToolHandle<Trk::VertexImageMaker> tool1 ("Trk::VertexImageMaker");
-  assert( tool1.retrieve().isSuccess() );
-  ToolHandle<Trk::SimpleVertexClusterFinder> tool2 ("Trk::SimpleVertexClusterFinder");
-  assert( tool2.retrieve().isSuccess() );
-
-  test1 (*tool1, *tool2);
-
-  return 0;
-}
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx
index 8b63ea0e03bc..259bcb470b58 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx
@@ -10,18 +10,18 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/ITrkDistanceFinder.h"
-#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
 #include "CxxUtils/ubsan_suppress.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TrkVertexSeedFinderUtils/ITrkDistanceFinder.h"
 #include <cassert>
 #include <cmath>
+#include <iostream>
 
 // for the field map
 #include "PathResolver/PathResolver.h"
@@ -30,8 +30,8 @@
 
 // for populating conditions store
 #include "SGTools/TestStore.h"
-#include "StoreGate/WriteCondHandleKey.h"
 #include "StoreGate/WriteCondHandle.h"
+#include "StoreGate/WriteCondHandleKey.h"
 
 // for the conditions data
 #include "MagFieldConditions/AtlasFieldCacheCondObj.h"
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx
index c44be7730464..994cbac4e46d 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx
@@ -10,23 +10,18 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/Trk2dDistanceSeeder.h"
-#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
 #include "CxxUtils/ubsan_suppress.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TrkVertexSeedFinderUtils/Trk2dDistanceSeeder.h"
 #include <cassert>
 #include <cmath>
-
-// Can't link against these --- they're in a component library.
-#include "../src/Trk2dDistanceSeeder.cxx"
-#include "../src/PointOnTrack.cxx"
-#include "../src/TwoTracks.cxx"
+#include <iostream>
 
 // for the field map
 #include "PathResolver/PathResolver.h"
@@ -35,8 +30,8 @@
 
 // for populating conditions store
 #include "SGTools/TestStore.h"
-#include "StoreGate/WriteCondHandleKey.h"
 #include "StoreGate/WriteCondHandle.h"
+#include "StoreGate/WriteCondHandleKey.h"
 
 // for the conditions data
 #include "MagFieldConditions/AtlasFieldCacheCondObj.h"
-- 
GitLab


From 276d3da8619f6d44eb8bb306b880f3a7e8154ecc Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Tue, 15 Sep 2020 23:23:24 +0200
Subject: [PATCH 150/422] remove Med Img Multi vertex finding  job options

---
 .../share/InDetRecLoadTools.py                | 46 -------------------
 1 file changed, 46 deletions(-)

diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
index 800bf2d703a4..0652c33afd8b 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
@@ -562,30 +562,6 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o
     InDetVtxSeedFinder = Trk__TrackDensitySeedFinder(name="GaussianDensitySeedFinder",
                                                      DensityEstimator=GaussDensityEstimator)
 
-  elif (InDetFlags.primaryVertexSetup() == 'MedImgMultiFinding'):
-    from TrkVertexSeedFinderUtils.TrkVertexSeedFinderUtilsConf import Trk__LocalMax1DClusterFinder, Trk__VertexImageMaker
-    InDetMedImgClusterFinder = Trk__LocalMax1DClusterFinder(name="InDetMedImgClusterFinder",
-                                                            weightThreshold=1500.0,
-                                                            mergeParameter=0.95,
-                                                            clusterWindowXY=0.34,
-                                                            refineZ=True,
-                                                            gaussianWindow=True)
-    ToolSvc += InDetMedImgClusterFinder
-    InDetMedImgMaker = Trk__VertexImageMaker(name="InDetMedImgMaker",
-                                             xbins=32,
-                                             ybins=32,
-                                             zbins=2048,
-                                             xrange=2.0,
-                                             yrange=2.0,
-                                             zrange=200.0,
-                                             cutoffFreqDenominator_xy=2,
-                                             cutoffFreqDenominator_z=1,
-                                             angularCutoffParameter=0.75)
-    ToolSvc += InDetMedImgMaker
-    from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__ImagingSeedFinder
-    InDetVtxSeedFinder = Trk__ImagingSeedFinder(name="InDetMedImgSeedFinder",
-                                                VertexCluster=InDetMedImgClusterFinder,
-                                                VertexImageMaker=InDetMedImgMaker)
 
   elif (InDetFlags.doPrimaryVertex3DFinding()):
     from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__CrossDistancesSeedFinder
@@ -780,7 +756,6 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o
   if (InDetFlags.primaryVertexSetup() == 'DefaultKalmanFinding' or
       InDetFlags.primaryVertexSetup() == 'DefaultAdaptiveFinding' or
       InDetFlags.primaryVertexSetup() == 'IterativeFinding' or
-      InDetFlags.primaryVertexSetup() == 'MedImgMultiFinding' or
       InDetFlags.primaryVertexSetup() == 'GaussIterativeFinding' ):
     from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexSmoother
     InDetVertexSmoother = Trk__SequentialVertexSmoother(name = "InDetSequentialVertexSmoother")
@@ -817,27 +792,6 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o
                                                     VertexSmoother         = InDetVertexSmoother
                                                     # VertexUpdator   = # no setting required
                                                     )
-  elif (InDetFlags.primaryVertexSetup() == 'MedImgMultiFinding') :
-
-      from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__CrossDistancesSeedFinder
-      InDet3DVtxSeedFinder = Trk__CrossDistancesSeedFinder(name                = "InDet3DCrossDistancesSeedFinder",
-                                                           trackdistcutoff     = 1.,
-                                                           trackdistexppower   = 2,
-                                                           # Mode1dFinder = # default, no setting needed
-                                                           )
-      ToolSvc+=InDet3DVtxSeedFinder
-      if (InDetFlags.doPrintConfigurables()):
-        printfunc (InDet3DVtxSeedFinder)
-    #
-    # --- load configured adaptive vertex fitter (with simplified seed finder for start point)
-    #
-      from TrkVertexFitters.TrkVertexFittersConf import Trk__AdaptiveVertexFitter
-      InDetVxFitterTool = Trk__AdaptiveVertexFitter(name                         = "InDetAdaptiveVxFitterTool",
-                                                    SeedFinder                   = InDet3DVtxSeedFinder,
-                                                    LinearizedTrackFactory       = InDetLinFactory,
-                                                    ImpactPoint3dEstimator       = InDetImpactPoint3dEstimator,
-                                                    AnnealingMaker               = InDetAnnealingMaker,
-                                                    VertexSmoother               = InDetVertexSmoother)
 
   elif (InDetFlags.primaryVertexSetup() == 'DefaultAdaptiveFinding' or
         InDetFlags.primaryVertexSetup() == 'IterativeFinding' or
-- 
GitLab


From c684da0b9d4baf86515875ef5f4658fc15d97879 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Wed, 16 Sep 2020 04:43:01 +0200
Subject: [PATCH 151/422] update ref files

---
 .../TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref      | 3 +++
 .../TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
index 58829c6ca581..50c81fe0a90a 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
@@ -88,6 +88,9 @@ TrigSignatureMoniMT                                 INFO -- #1834383636 Features
 TrigSignatureMoniMT                                 INFO HLT_5j70_0eta240_L14J20 #1175391812
 TrigSignatureMoniMT                                 INFO -- #1175391812 Events         7          7          0          0          0          0          0          0          0          0          0          0          1          -          1
 TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          0          5          -
+TrigSignatureMoniMT                                 INFO HLT_alfacalib_AlfaPEB_L1ALFA_ANY #4094852824
+TrigSignatureMoniMT                                 INFO -- #4094852824 Events         0          0          0          -          -          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #4094852824 Features                             0          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_beamspot_allTE_trkfast_BeamSpotPEB_L1J15 #3989372080
 TrigSignatureMoniMT                                 INFO -- #3989372080 Events         20         20         20         20         -          -          -          -          -          -          -          -          -          -          20
 TrigSignatureMoniMT                                 INFO -- #3989372080 Features                             20         20         -          -          -          -          -          -          -          -          -          -
diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
index 8ddd9e981dc1..d652c7e50171 100644
--- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
@@ -88,6 +88,9 @@ TrigSignatureMoniMT                                 INFO -- #1834383636 Features
 TrigSignatureMoniMT                                 INFO HLT_5j70_0eta240_L14J20 #1175391812
 TrigSignatureMoniMT                                 INFO -- #1175391812 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
 TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO HLT_alfacalib_AlfaPEB_L1ALFA_ANY #4094852824
+TrigSignatureMoniMT                                 INFO -- #4094852824 Events         20         20         20         -          -          -          -          -          -          -          -          -          -          -          20         
+TrigSignatureMoniMT                                 INFO -- #4094852824 Features                             20         -          -          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_beamspot_allTE_trkfast_BeamSpotPEB_L1J15 #3989372080
 TrigSignatureMoniMT                                 INFO -- #3989372080 Events         20         20         20         20         -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #3989372080 Features                             20         20         -          -          -          -          -          -          -          -          -          -          
-- 
GitLab


From 44a77f2f85609e093eb89d8162477fab5378dd9c Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Wed, 16 Sep 2020 08:10:34 +0100
Subject: [PATCH 152/422] Fixed typo in Tracking cut flag definition

---
 InnerDetector/InDetConfig/python/TrackingCutsFlags.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetConfig/python/TrackingCutsFlags.py b/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
index a59976e2e115..cfa8fe0dc807 100644
--- a/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
+++ b/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
@@ -520,7 +520,7 @@ def createLowPtLargeD0TrackingFlags():
 def createLowPtTrackingFlags():
     icf = createTrackingFlags()
     icf.extension        = "LowPt"
-    icf.maxPT = lambda pcf: (1e6  if pcf.InDet.doMinBias else pcf.InDet.Tracking.minPt + 0.3) * Units.GeV
+    icf.maxPT = lambda pcf: (1e6  if pcf.InDet.doMinBias else pcf.InDet.Tracking.minPT + 0.3) * Units.GeV
     icf.minPT            = 0.050 * Units.GeV
     icf.minClusters      = 5
     icf.minSiNotShared   = 4
-- 
GitLab


From 58a63d62b1b2765e343fd01657fb9e64fb0bafcf Mon Sep 17 00:00:00 2001
From: Tamara Vazquez Schroeder <tvazquez@cern.ch>
Date: Wed, 16 Sep 2020 13:24:20 +0200
Subject: [PATCH 153/422] cleaning up obsolete cosmic prescale function and
 sets in TMMT

---
 .../HLTMenuConfig/Menu/MenuPrescaleConfig.py  | 63 +++----------------
 1 file changed, 9 insertions(+), 54 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
index 5df365ff4afb..ca403b3980e9 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
@@ -28,11 +28,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('LS2_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            addSliceChainsToPrescales(TriggerFlags, Prescales.HLTPrescales_cosmics)
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         elif 'TriggerValidation_mc_prescale' in menu_name:
@@ -47,10 +43,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('Physics_pp_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -61,10 +54,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('PhysicsP1_pp_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.PhysicsP1_pp_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -75,10 +65,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('MC_pp_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.MC_pp_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -89,10 +76,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('PhysicsP1_HI_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.PhysicsP1_HI_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -103,10 +87,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('Dev_HI_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.Dev_HI_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -117,10 +98,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('LS2_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -131,12 +109,8 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('Cosmic_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.Cosmic_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        else:
-            L1Prescales = Prescales.L1Prescales
-            HLTPrescales = Prescales.HLTPrescales
+        L1Prescales = Prescales.L1Prescales
+        HLTPrescales = Prescales.HLTPrescales
             
     else:
         log.fatal ('Menu with name %s is not known in this version of TriggerMenu! ', menu_name)
@@ -144,22 +118,6 @@ def MenuPrescaleConfig(triggerConfigHLT):
 
     return (L1Prescales, HLTPrescales)
 
-def addSliceChainsToPrescales(flags, cosmic_prescales):
-    signatures = []
-    slice_props = [prop for prop in dir(flags) if prop.endswith("Slice")]
-    for slice_prop in slice_props:
-        slice = getattr(flags, slice_prop)
-        if slice.signatures():
-            signatures.extend(slice.signatures())
-        else:
-            log.debug('SKIPPING ' + str(slice_prop))
-
-    chains = [s.name for s in signatures]
-    combined = {chain: [-1, 0, 0] for chain in chains}
-    combined.update(cosmic_prescales)
-    from copy import deepcopy
-    cosmic_prescales = deepcopy(combined)
-
 def disableChains(flags, trigvalid_prescales, type_group):
     signatures = []
     slice_props = [prop for prop in dir(flags) if prop.endswith("Slice")]
@@ -214,9 +172,6 @@ class PrescaleClass(object):
     HLTPrescales = {
         }
 
-    L1Prescales_cosmics  = {}
-    HLTPrescales_cosmics = {}
-
     L1Prescales_trigvalid_mc_prescale  = {}
     HLTPrescales_trigvalid_mc_prescale = {}
 
-- 
GitLab


From 67f707191737277758da0d7bed3ef16b5e88c478 Mon Sep 17 00:00:00 2001
From: Maksim Penzin <penzin.maksim@gmail.com>
Date: Tue, 15 Sep 2020 08:58:37 +0200
Subject: [PATCH 154/422] Migrate to AthReentrantAlgorithm

---
 .../src/MuonCombinedInDetCandidateAlg.cxx     | 32 +++++++++++--------
 .../src/MuonCombinedInDetCandidateAlg.h       | 30 +++++++++--------
 2 files changed, 34 insertions(+), 28 deletions(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx
index 75a82e51714c..d8ac1397b87b 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx
@@ -3,13 +3,14 @@
 */
 
 #include "MuonCombinedInDetCandidateAlg.h"
+
 #include "MuonLayerEvent/MuonSystemExtension.h"
 #include "xAODTruth/TruthParticleContainer.h"
 
 using namespace MuonCombined;
 
 MuonCombinedInDetCandidateAlg::MuonCombinedInDetCandidateAlg(const std::string& name, ISvcLocator* pSvcLocator)
-    : AthAlgorithm(name, pSvcLocator), m_doSiliconForwardMuons(false)
+    : AthReentrantAlgorithm(name, pSvcLocator), m_doSiliconForwardMuons(false)
 {
     declareProperty("TrackParticleLocation", m_indetTrackParticleLocation = {"InDetTrackParticles"});
     declareProperty("ForwardParticleLocation", m_indetForwardTrackParticleLocation = "InDetForwardTrackParticles");
@@ -33,49 +34,51 @@ MuonCombinedInDetCandidateAlg::initialize()
 }
 
 StatusCode
-MuonCombinedInDetCandidateAlg::execute()
+MuonCombinedInDetCandidateAlg::execute(const EventContext& ctx) const
 {
     auto collection = std::make_unique<InDetCandidateCollection>(SG::OWN_ELEMENTS);
 
-    m_currentTrackSelector = m_trackSelector;
+
     for (auto location : m_indetTrackParticleLocation) {
-        if (create(location, collection).isFailure()) {
+        if (create(ctx, m_trackSelector, location, collection).isFailure()) {
             ATH_MSG_FATAL("Could not create InDetCandidateCollection");
             return StatusCode::FAILURE;
         }
     }
     if (m_doSiliconForwardMuons) {
-        m_currentTrackSelector = m_forwardTrackSelector;
-        if (create(m_indetForwardTrackParticleLocation, collection, true).isFailure()) {
+        if (create(ctx, m_forwardTrackSelector, m_indetForwardTrackParticleLocation, collection, true).isFailure()) {
             ATH_MSG_FATAL("Could not create InDetForwardCandidateCollection");
             return StatusCode::FAILURE;
         }
     }
-    SG::WriteHandle<InDetCandidateCollection> indetCandidateCollection(m_candidateCollectionName);
+    SG::WriteHandle<InDetCandidateCollection> indetCandidateCollection(m_candidateCollectionName, ctx);
     ATH_CHECK(indetCandidateCollection.record(std::move(collection)));
 
     return StatusCode::SUCCESS;
 }
 
 StatusCode
-MuonCombinedInDetCandidateAlg::create(const SG::ReadHandleKey<xAOD::TrackParticleContainer>& location,
+MuonCombinedInDetCandidateAlg::create(const EventContext&                                    ctx,
+                                      const ToolHandle<Trk::ITrackSelectorTool>&             currentTrackSelector,
+                                      const SG::ReadHandleKey<xAOD::TrackParticleContainer>& location,
                                       std::unique_ptr<InDetCandidateCollection>&             collection,
                                       bool flagCandidateAsSiAssociate) const
 {
-    SG::ReadHandle<xAOD::TrackParticleContainer> indetTrackParticles(location);
+    SG::ReadHandle<xAOD::TrackParticleContainer> indetTrackParticles(location, ctx);
     if (!indetTrackParticles.isValid()) {
         ATH_MSG_ERROR("Could not read " << location);
         return StatusCode::FAILURE;
     }
     InDetCandidateCollection* tempCandidates = new InDetCandidateCollection(SG::VIEW_ELEMENTS);
-    create(*indetTrackParticles, *tempCandidates, flagCandidateAsSiAssociate);
+    create(currentTrackSelector, *indetTrackParticles, *tempCandidates, flagCandidateAsSiAssociate);
     collection->insert(collection->end(), tempCandidates->begin(), tempCandidates->end());
     delete tempCandidates;
     return StatusCode::SUCCESS;
 }
 
 void
-MuonCombinedInDetCandidateAlg::create(const xAOD::TrackParticleContainer& indetTrackParticles,
+MuonCombinedInDetCandidateAlg::create(const ToolHandle<Trk::ITrackSelectorTool>& currentTrackSelector,
+                                      const xAOD::TrackParticleContainer&        indetTrackParticles,
                                       InDetCandidateCollection& outputContainer, bool flagCandidateAsSiAssociated) const
 {
 
@@ -85,7 +88,7 @@ MuonCombinedInDetCandidateAlg::create(const xAOD::TrackParticleContainer& indetT
 
     for (auto* tp : indetTrackParticles) {
         ++trackIndex;
-        if (!isValidTrackParticle(tp)) continue;
+        if (!isValidTrackParticle(currentTrackSelector, tp)) continue;
 
         ElementLink<xAOD::TrackParticleContainer> link(indetTrackParticles, trackIndex);
         if (!link.isValid()) {
@@ -124,14 +127,15 @@ MuonCombinedInDetCandidateAlg::create(const xAOD::TrackParticleContainer& indetT
 }
 
 bool
-MuonCombinedInDetCandidateAlg::isValidTrackParticle(const xAOD::TrackParticle* const tp) const
+MuonCombinedInDetCandidateAlg::isValidTrackParticle(const ToolHandle<Trk::ITrackSelectorTool>& currentTrackSelector,
+                                                    const xAOD::TrackParticle* const           tp) const
 {
     if (!tp->perigeeParameters().covariance()) {
         ATH_MSG_WARNING("InDet TrackParticle without perigee! ");
         return false;
     }
 
-    if (!m_currentTrackSelector->decision(*tp)) {
+    if (!currentTrackSelector->decision(*tp)) {
         if (msgLvl(MSG::VERBOSE) && tp->pt() > 5000.) printTrackParticleInfo(tp, "Discarding");
         return false;
     }
diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.h b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.h
index 872dc7a17987..72fdb3600997 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.h
@@ -5,7 +5,9 @@
 #ifndef MUONCOMBINEDALGS_MUONCOMBINEDINDETCANDIDATEALG_H
 #define MUONCOMBINEDALGS_MUONCOMBINEDINDETCANDIDATEALG_H
 
-#include "AthenaBaseComps/AthAlgorithm.h"
+#include <string>
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "MuonCombinedEvent/InDetCandidateCollection.h"
 #include "MuonRecToolInterfaces/IMuonSystemExtensionTool.h"
@@ -14,15 +16,13 @@
 #include "TrkToolInterfaces/ITrackSelectorTool.h"
 #include "xAODTracking/TrackParticleContainer.h"
 
-#include <string>
-
-class MuonCombinedInDetCandidateAlg : public AthAlgorithm {
+class MuonCombinedInDetCandidateAlg : public AthReentrantAlgorithm {
   public:
     MuonCombinedInDetCandidateAlg(const std::string& name, ISvcLocator* pSvcLocator);
-    ~MuonCombinedInDetCandidateAlg()=default;
+    ~MuonCombinedInDetCandidateAlg() = default;
 
     StatusCode initialize();
-    StatusCode execute();
+    StatusCode execute(const EventContext& ctx) const;
 
   private:
     bool m_doSiliconForwardMuons;
@@ -30,27 +30,29 @@ class MuonCombinedInDetCandidateAlg : public AthAlgorithm {
     float m_extThreshold;
 
     SG::ReadHandleKeyArray<xAOD::TrackParticleContainer> m_indetTrackParticleLocation;
-    SG::ReadHandleKey<xAOD::TrackParticleContainer> m_indetForwardTrackParticleLocation;
-    SG::WriteHandleKey<InDetCandidateCollection> m_candidateCollectionName;
-    ToolHandle<Trk::ITrackSelectorTool> m_trackSelector{
+    SG::ReadHandleKey<xAOD::TrackParticleContainer>      m_indetForwardTrackParticleLocation;
+    SG::WriteHandleKey<InDetCandidateCollection>         m_candidateCollectionName;
+    ToolHandle<Trk::ITrackSelectorTool>                  m_trackSelector{
         this, "TrackSelector", "InDet::InDetDetailedTrackSelectorTool/MuonCombinedInDetDetailedTrackSelectorTool",
         "Track selector tool"};
     ToolHandle<Trk::ITrackSelectorTool> m_forwardTrackSelector{
         this, "InDetForwardTrackSelector",
         "InDet::InDetDetailedTrackSelectorTool/MuonCombinedInDetDetailedForwardTrackSelectorTool",
         "Forward track selector tool"};
-    ToolHandle<Trk::ITrackSelectorTool> m_currentTrackSelector;
     ToolHandle<Muon::IMuonSystemExtensionTool> m_muonSystemExtensionTool{
         this, "MuonSystemExtensionTool", "Muon::MuonSystemExtensionTool/MuonSystemExtensionTool",
         "Muon system extension tool"};
 
-    void create(const xAOD::TrackParticleContainer& indetTrackParticles, InDetCandidateCollection& outputContainer,
-                bool flagCandidateAsSiAssociated = false) const;
-    StatusCode create(const SG::ReadHandleKey<xAOD::TrackParticleContainer>& location,
+    void       create(const ToolHandle<Trk::ITrackSelectorTool>& currentTrackSelector,
+                      const xAOD::TrackParticleContainer& indetTrackParticles, InDetCandidateCollection& outputContainer,
+                      bool flagCandidateAsSiAssociated = false) const;
+    StatusCode create(const EventContext& ctx, const ToolHandle<Trk::ITrackSelectorTool>& currentTrackSelector,
+                      const SG::ReadHandleKey<xAOD::TrackParticleContainer>& location,
                       std::unique_ptr<InDetCandidateCollection>&             collection,
                       bool                                                   flagCandidateAsSiAssociate = false) const;
 
-    bool isValidTrackParticle(const xAOD::TrackParticle* const tp) const;
+    bool isValidTrackParticle(const ToolHandle<Trk::ITrackSelectorTool>& currentTrackSelector,
+                              const xAOD::TrackParticle* const           tp) const;
     void printTrackParticleInfo(const xAOD::TrackParticle* const tp, const std::string& what) const;
 
     int getCount(const xAOD::TrackParticle& tp, xAOD::SummaryType type) const;
-- 
GitLab


From 3627b003f75bdfbdac9b55d8f9745ad7d9c68059 Mon Sep 17 00:00:00 2001
From: amete <serhanmete@gmail.com>
Date: Wed, 16 Sep 2020 14:16:19 +0200
Subject: [PATCH 155/422] Hephaestus py3 fixes

---
 Control/Hephaestus/python/__init__.py  |  4 ++--
 Control/Hephaestus/src/MemoryTracker.c | 12 +++++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Control/Hephaestus/python/__init__.py b/Control/Hephaestus/python/__init__.py
index 15107d51dc3a..940a0fdc1845 100644
--- a/Control/Hephaestus/python/__init__.py
+++ b/Control/Hephaestus/python/__init__.py
@@ -12,9 +12,9 @@ def setup():
 
   # make sure that 3rd party libraries can see Hephaestus symbols by letting
   # python load the memory tracker in "broadcast" mode
-    import DLFCN, sys
+    import sys
     dlflags = sys.getdlopenflags() 
-    sys.setdlopenflags( DLFCN.RTLD_GLOBAL | DLFCN.RTLD_NOW )
+    sys.setdlopenflags( os.RTLD_GLOBAL | os.RTLD_NOW )
     import MemoryTracker
     sys.setdlopenflags( dlflags )
 
diff --git a/Control/Hephaestus/src/MemoryTracker.c b/Control/Hephaestus/src/MemoryTracker.c
index c37b3b24982c..a655a5284e92 100644
--- a/Control/Hephaestus/src/MemoryTracker.c
+++ b/Control/Hephaestus/src/MemoryTracker.c
@@ -1137,7 +1137,13 @@ static PyMethodDef gFreeStatisticsMethods[] = {
 PyObject* initMemoryTrace();
 PyObject* initDoubleDeleteChecker();
 
-void initMemoryTracker() {
+#if PY_MAJOR_VERSION >= 3
+PyObject *
+PyInit_MemoryTracker(void)
+#else
+void initMemoryTracker()
+#endif
+{
    PyObject *memtrack;
    PyObject *chkpoints, *freestat;
    PyObject *ddcheck, *memtrace;
@@ -1213,4 +1219,8 @@ void initMemoryTracker() {
 /* double delete checker functionality */
    ddcheck = initDoubleDeleteChecker();
    PyModule_AddObject( memtrack, (char*)"DeleteChecker", ddcheck );
+
+#if PY_MAJOR_VERSION >= 3
+   return memtrack;
+#endif
 }
-- 
GitLab


From b1c384ebb975bf94f55703947df92074b35a36fd Mon Sep 17 00:00:00 2001
From: Siarhei Harkusha <Siarhei.Harkusha@cern.ch>
Date: Wed, 16 Sep 2020 15:01:44 +0200
Subject: [PATCH 156/422] TileMonitoring: Fix Tile cell monitoring arrays sizes
 for Run 3

Sizes of arrays in Tile cell monitoring aglorithm for run 3
used to monitor different values per sampling have been reduced
since the last dimention was not used.
---
 .../src/TileCellMonitorAlgorithm.cxx               | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx b/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx
index 8b08b2b976ca..8fe1238535fd 100644
--- a/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx
+++ b/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx
@@ -210,16 +210,16 @@ StatusCode TileCellMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
     detailOccupEnergies[partition].reserve(nChannelsInPartition);
   }
 
-  std::vector<float> occupEta[MAX_SAMP];
-  std::vector<float> occupPhi[MAX_SAMP];
-  std::vector<float> occupEnergy[MAX_SAMP];
+  std::vector<float> occupEta[SAMP_ALL];
+  std::vector<float> occupPhi[SAMP_ALL];
+  std::vector<float> occupEnergy[SAMP_ALL];
 
-  std::vector<float> overThrOccupEta[MAX_SAMP];
-  std::vector<float> overThrOccupPhi[MAX_SAMP];
+  std::vector<float> overThrOccupEta[SAMP_ALL];
+  std::vector<float> overThrOccupPhi[SAMP_ALL];
 
   std::vector<float> sampChanTime[Tile::MAX_ROS - 1][SAMP_ALL];
-  std::vector<float> sampEnergyDiff[Tile::MAX_ROS - 1][MAX_SAMP];
-  std::vector<float> sampTimeDiff[Tile::MAX_ROS - 1][MAX_SAMP];
+  std::vector<float> sampEnergyDiff[Tile::MAX_ROS - 1][SAMP_ALL];
+  std::vector<float> sampTimeDiff[Tile::MAX_ROS - 1][SAMP_ALL];
 
   PairBuilder moduleCorr[MAX_PART];
 
-- 
GitLab


From 0fa4e716c787696b629832992a0ae1c3a4dd90f7 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 8 Sep 2020 12:12:01 -0400
Subject: [PATCH 157/422] TRT_Cabling: Fix cppcheck warnings.

 - Prefer preincrement to postincrement for iterators.
---
 .../TRT_Cabling/src/TRT_FillCablingData_SR1.cxx  | 16 ++++++++--------
 .../src/TRT_FillCablingData_SR1_ECC.cxx          | 16 ++++++++--------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1.cxx b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1.cxx
index 276139525a6f..e0802e224541 100644
--- a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //
@@ -516,7 +516,7 @@ void TRT_FillCablingData_SR1::defineTables()
 
      std::vector<uint32_t>::iterator it = (m_phi_to_source[my_phi]).begin();
      while ( (it != (m_phi_to_source[my_phi]).end()) && (srcId != *it) )
-	it++;
+	++it;
 
      if ( it == m_phi_to_source[my_phi].end() )
      {
@@ -540,7 +540,7 @@ void TRT_FillCablingData_SR1::defineTables()
 #endif // NOTDEF
 
   GlobalCableMap::iterator pos;
-  for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); pos++ )
+  for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); ++pos )
   {
      std::vector< GlobalCableMap_t *> GCM;
 
@@ -550,7 +550,7 @@ void TRT_FillCablingData_SR1::defineTables()
 
      int ConnectorCount=-1;
      std::vector< GlobalCableMap_t *>::iterator it;
-     for ( it=GCM.begin(); it != GCM.end(); it++ )
+     for ( it=GCM.begin(); it != GCM.end(); ++it )
      {
 	ConnectorCount++;
 
@@ -766,7 +766,7 @@ void TRT_FillCablingData_SR1::defineCollID()
    ATH_MSG_INFO( "In defineCollID()" );
 
    GlobalCableMap::iterator pos;
-   for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); pos++ )
+   for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); ++pos )
    {   
       std::vector<IdentifierHash> * vectID = new std::vector<IdentifierHash>();
       fillCollID( pos->first, *vectID);
@@ -838,7 +838,7 @@ std::vector<IdentifierHash> & ids)
 		   (my_map->FEid == "3FL2") || (my_map->FEid == "3FS") )
 	   rings |= 4;
 
-	 it++;
+	 ++it;
 	
 	 if ( it != GCM.end() )
 	 {
@@ -949,7 +949,7 @@ std::vector<IdentifierHash> & ids)
 	   return;
 	 }
 
-	 it++;
+	 ++it;
 	
 	 if ( it != GCM.end() )
 	 {
@@ -1019,7 +1019,7 @@ std::vector<uint32_t> TRT_FillCablingData_SR1::getRobID(Identifier id)
      eformat::helper::SourceIdentifier sid( *it1 );
      v.push_back(sid.code());
 
-     it1++;
+     ++it1;
   }
 
   return v;
diff --git a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1_ECC.cxx b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1_ECC.cxx
index d1bcb65d2920..e7f73973ba00 100644
--- a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1_ECC.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1_ECC.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //
@@ -622,7 +622,7 @@ void TRT_FillCablingData_SR1_ECC::defineTables()
 
      std::vector<uint32_t>::iterator it = (m_phi_to_source[my_phi]).begin();
      while ( (it != (m_phi_to_source[my_phi]).end()) && (srcId != *it) )
-	it++;
+	++it;
 
      if ( it == m_phi_to_source[my_phi].end() )
      {
@@ -646,7 +646,7 @@ void TRT_FillCablingData_SR1_ECC::defineTables()
 #endif // NOTDEF
 
   GlobalCableMap::iterator pos;
-  for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); pos++ )
+  for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); ++pos )
   {
      std::vector< GlobalCableMap_t *> GCM;
 
@@ -656,7 +656,7 @@ void TRT_FillCablingData_SR1_ECC::defineTables()
 
      int ConnectorCount=-1;
      std::vector< GlobalCableMap_t *>::iterator it;
-     for ( it=GCM.begin(); it != GCM.end(); it++ )
+     for ( it=GCM.begin(); it != GCM.end(); ++it )
      {
 	ConnectorCount++;
 
@@ -882,7 +882,7 @@ void TRT_FillCablingData_SR1_ECC::defineCollID()
    ATH_MSG_INFO( "In defineCollID()" );
 
    GlobalCableMap::iterator pos;
-   for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); pos++ )
+   for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); ++pos )
    {   
       std::vector<IdentifierHash> * vectID = new std::vector<IdentifierHash>();
       fillCollID( pos->first, *vectID);
@@ -954,7 +954,7 @@ std::vector<IdentifierHash> & ids)
 		   (my_map->FEid == "3FL2") || (my_map->FEid == "3FS") )
 	   rings |= 4;
 
-	 it++;
+	 ++it;
 	
 	 if ( it != GCM.end() )
 	 {
@@ -1065,7 +1065,7 @@ std::vector<IdentifierHash> & ids)
 	   return;
 	 }
 
-	 it++;
+	 ++it;
 	
 	 if ( it != GCM.end() )
 	 {
@@ -1135,7 +1135,7 @@ std::vector<uint32_t> TRT_FillCablingData_SR1_ECC::getRobID(Identifier id)
      eformat::helper::SourceIdentifier sid( *it1 );
      v.push_back(sid.code());
 
-     it1++;
+     ++it1;
   }
 
   return v;
-- 
GitLab


From a001e59db6c4207ae14f62d4f36950e09df1419a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 21 Aug 2020 23:50:07 -0400
Subject: [PATCH 158/422] TRT_RawDataByteStreamCnv: Fix cppcheck warnings.

Prefer preincrement to postincrement for iterators.
---
 .../TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx       | 8 ++++----
 .../TRT_RawDataByteStreamCnv/src/TRT_RodEncoder.cxx       | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx
index 09bf2cd292cd..a89fb9bac514 100644
--- a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx
+++ b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx
@@ -186,7 +186,7 @@ StatusCode TRT_RodDecoder::initialize()
     std::vector<int>::iterator it;
 
     for ( it=m_LoadCompressTableVersions.begin() ; 
-	  it < m_LoadCompressTableVersions.end(); it++ )
+	  it < m_LoadCompressTableVersions.end(); ++it )
      {
        if ( (*it < 4) || (*it > m_maxCompressionVersion) )
        {
@@ -1743,7 +1743,7 @@ TRT_RodDecoder::update() {
 			  Ctable->m_TableVersion );
 
 	 delete Ctable;
-	 catrIt++;
+	 ++catrIt;
 
 	 continue;
        }
@@ -1754,7 +1754,7 @@ TRT_RodDecoder::update() {
 	 ATH_MSG_DEBUG( "Table " << Ctable->m_TableVersion 
 			  << " already loaded!  Not overwriting" );
 	 delete Ctable;
-	 catrIt++;
+         ++catrIt;
 
 	 continue;
        }
@@ -1843,7 +1843,7 @@ TRT_RodDecoder::update() {
        }
 #endif /* NOTDEF */
 
-       catrIt++;
+       ++catrIt;
 
     }
 
diff --git a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodEncoder.cxx b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodEncoder.cxx
index 87461ac2fff5..d67370a7c0de 100644
--- a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodEncoder.cxx
+++ b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodEncoder.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Implementation of TRT_RodEncoder class 
@@ -65,7 +65,7 @@ TRT_RodEncoder::fillROD( std::vector<uint32_t>&  v32rod )
 
       v32rod[BufferOffset] = StrawWord;
 
-      rdo_it++;
+      ++rdo_it;
    }
 
    return StatusCode::SUCCESS;  
@@ -107,7 +107,7 @@ TRT_RodEncoder::fillROD3( std::vector<uint32_t>&  v32rod )
 
       tmp_data[BufferOffset] = StrawWord;
 
-      rdo_it++;
+      ++rdo_it;
    }
 
    for ( int i=0; i<TRT_MaxBufferSize; i++ )
-- 
GitLab


From 787715ff765539a92bc7ca740adef29548cd983a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 9 Sep 2020 09:23:27 -0400
Subject: [PATCH 159/422] InDetEventTPCnv: Fix cppcheck warnings.

 - Prefer preincrement to postincrement for iterators.
---
 .../CompetingPixelClustersOnTrackCnv_p1.cxx     | 10 +++-------
 .../CompetingSCT_ClustersOnTrackCnv_p1.cxx      | 10 +++-------
 .../CompetingTRT_DriftCirclesOnTrackCnv_p1.cxx  | 10 +++-------
 .../src/InDetPrepRawData/PixelClusterCnv_p2.cxx | 16 +++++++---------
 .../src/InDetPrepRawData/PixelClusterCnv_p3.cxx |  6 +++---
 .../PixelClusterContainerCnv_p1.cxx             |  4 ++--
 .../PixelGangedClusterAmbiguitiesCnv_p1.cxx     | 17 ++++++-----------
 .../src/InDetPrepRawData/SCT_ClusterCnv_p2.cxx  | 16 +++++++---------
 .../src/InDetPrepRawData/SCT_ClusterCnv_p3.cxx  | 16 +++++++---------
 .../SCT_ClusterContainerCnv_p1.cxx              |  4 ++--
 .../TRT_DriftCircleContainerCnv_p1.cxx          |  4 ++--
 .../src/PixelClusterContainerCnv_p2.cxx         |  4 ++--
 .../src/PixelClusterContainerCnv_p3.cxx         |  4 ++--
 .../src/SCT_ClusterContainerCnv_p2.cxx          |  6 +++---
 .../src/SCT_ClusterContainerCnv_p3.cxx          |  6 +++---
 .../src/TRT_DriftCircleContainerCnv_p2.cxx      |  6 +++---
 16 files changed, 58 insertions(+), 81 deletions(-)

diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrackCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrackCnv_p1.cxx
index 07a86d81008b..955d745ecad4 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrackCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrackCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------------
@@ -19,15 +19,11 @@ CompetingPixelClustersOnTrackCnv_p1::persToTrans( const InDet::CompetingPixelClu
                                                        InDet::CompetingPixelClustersOnTrack *transObj, 
                                                        MsgStream &log )
 {
-  
-   std::vector< TPObjRef >::const_iterator  it = persObj->m_containedChildRots.begin(), 
-                                            itE = persObj->m_containedChildRots.end();
-                                            
    auto containedChildRots = new std::vector< const InDet::PixelClusterOnTrack * >;
    
-   for (; it!=itE;it++) {
+   for (const TPObjRef& ref : persObj->m_containedChildRots) {
        ITPConverterFor<Trk::MeasurementBase>  *rotCnv = 0;
-       const InDet::PixelClusterOnTrack* mcot = dynamic_cast<const InDet::PixelClusterOnTrack*>(createTransFromPStore(&rotCnv, *it, log));
+       const InDet::PixelClusterOnTrack* mcot = dynamic_cast<const InDet::PixelClusterOnTrack*>(createTransFromPStore(&rotCnv, ref, log));
        containedChildRots->push_back( mcot );
    }
 
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrackCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrackCnv_p1.cxx
index eef3a1865417..3e650c1de0bc 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrackCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrackCnv_p1.cxx
@@ -13,15 +13,11 @@ CompetingSCT_ClustersOnTrackCnv_p1::persToTrans( const InDet::CompetingSCT_Clust
                                                        InDet::CompetingSCT_ClustersOnTrack *transObj, 
                                                        MsgStream &log )
 {
-  
-   std::vector< TPObjRef >::const_iterator  it = persObj->m_containedChildRots.begin(), 
-                                            itE = persObj->m_containedChildRots.end();
-                                            
    std::vector< const InDet::SCT_ClusterOnTrack * > containedChildRots;
-   
-   for (; it!=itE;it++) {
+
+   for (const TPObjRef& ref : persObj->m_containedChildRots) {
        ITPConverterFor<Trk::MeasurementBase>  *rotCnv = 0;
-       const InDet::SCT_ClusterOnTrack* mcot = dynamic_cast<const InDet::SCT_ClusterOnTrack*>(createTransFromPStore(&rotCnv, *it, log));
+       const InDet::SCT_ClusterOnTrack* mcot = dynamic_cast<const InDet::SCT_ClusterOnTrack*>(createTransFromPStore(&rotCnv, ref, log));
        containedChildRots.push_back( mcot );
    }
 
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrackCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrackCnv_p1.cxx
index 622446b219e8..e914ad54f9bc 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrackCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrackCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------------
@@ -21,15 +21,11 @@ CompetingTRT_DriftCirclesOnTrackCnv_p1::persToTrans( const InDet::CompetingTRT_D
                                                      InDet::CompetingTRT_DriftCirclesOnTrack *transObj, 
                                                        MsgStream &log )
 {
-  
-   std::vector< TPObjRef >::const_iterator  it = persObj->m_containedChildRots.begin(), 
-                                            itE = persObj->m_containedChildRots.end();
-                                            
    auto containedChildRots = new std::vector< const InDet::TRT_DriftCircleOnTrack * >;
    
-   for (; it!=itE;it++) {
+   for (const TPObjRef& ref : persObj->m_containedChildRots) {
        ITPConverterFor<Trk::MeasurementBase>  *rotCnv = 0;
-       const InDet::TRT_DriftCircleOnTrack* mcot = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(createTransFromPStore(&rotCnv, *it, log));
+       const InDet::TRT_DriftCircleOnTrack* mcot = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(createTransFromPStore(&rotCnv, ref, log));
        containedChildRots->push_back( mcot );
    }
    
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p2.cxx
index 066a9784b024..a0185a1883b1 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------------
@@ -29,11 +29,10 @@ PixelClusterCnv_p2::createPixelCluster (const InDet::PixelCluster_p2* persObj,
   Identifier id (persObj->m_clusId);
   Identifier::value_type id32 = id.get_compact();
   std::vector<Identifier>::iterator tit = rdoList.begin();
-  for(std::vector<InDet::PixelCluster_p2::rdo_diff_type>::const_iterator it = persObj->m_rdoList.begin(); 
-                                                            it != persObj->m_rdoList.end();it++)
+  for (const InDet::PixelCluster_p2::rdo_diff_type& rdo : persObj->m_rdoList)
   {
-    *tit = Identifier((Identifier::value_type) *it + id32);
-    tit++;
+    *tit = Identifier((Identifier::value_type) rdo + id32);
+    ++tit;
   }
 
   InDet::SiWidth width;
@@ -99,10 +98,9 @@ void PixelClusterCnv_p2::transToPers( const InDet::PixelCluster *transObj, InDet
   
   
   std::vector<InDet::PixelCluster_p2::rdo_diff_type>::iterator pit = persObj->m_rdoList.begin();
-  for (std::vector<Identifier>::const_iterator it=transObj->rdoList().begin(); it != transObj->rdoList().end(); it++) {
-  
-   *pit = (InDet::PixelCluster_p2::rdo_diff_type)  (it->get_compact()) - persObj->m_clusId  ;
-    pit++;
+  for (const Identifier& id : transObj->rdoList()) {
+   *pit = (InDet::PixelCluster_p2::rdo_diff_type)  (id.get_compact()) - persObj->m_clusId  ;
+   ++pit;
   }
   
 }
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p3.cxx
index 96fdafb1a49e..50aac2cac0f8 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p3.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------------
@@ -158,11 +158,11 @@ void PixelClusterCnv_p3::transToPers( const InDet::PixelCluster *transObj, InDet
   // Save offset to wafer id for the cluster id
   Identifier waferId =  m_pixId2->wafer_id(clusId); // remove the eta/phi of channel id
   *pit = static_cast<InDet::PixelCluster_p3::rdo_diff_type>( m_pixId2->calc_offset(waferId, clusId) );
-  pit++;
+  ++pit;
   
   for (const Identifier& id : transObj->rdoList()) {
     *pit = static_cast<InDet::PixelCluster_p3::rdo_diff_type>( m_pixId2->calc_offset(clusId, id) );
-    pit++;
+    ++pit;
   }
 
   // Setting of cluster properties:
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterContainerCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterContainerCnv_p1.cxx
index e73443f6eddd..21ba9aaa6268 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterContainerCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterContainerCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Athena
@@ -50,7 +50,7 @@ void InDet::PixelClusterContainerCnv_p1::transToPers(const InDet::PixelClusterCo
     unsigned int chanEnd = 0;
     persCont->m_collections.resize(transCont->numberOfCollections());
   
-    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::PixelClusterCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx
index ca87616fd94b..a31249f799dd 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx
@@ -56,7 +56,7 @@ void PixelGangedClusterAmbiguitiesCnv_p1::transToPers
     IdentifierHash          idHash  = pixelCluster->getHashAndIndex().collHash(); // idHash of collection
     
     // loop over dhs
-    for ( ; dh!=dhEnd; dh++ ) 		  {
+    for ( ; dh!=dhEnd; ++dh ) 		  {
       auto coll = dh->indexFindPtr(idHash); //matching collection
       // does coll exist?
       // check prd exists in collection
@@ -77,7 +77,7 @@ void PixelGangedClusterAmbiguitiesCnv_p1::transToPers
     const InDet::SiCluster* keyPixelCluster(0);
     const InDet::SiCluster* gangedPixelCluster(0);
     unsigned int count(1);
-    for( ; itr != itrE ; itr++ ) {
+    for( ; itr != itrE ; ++itr ) {
     
       // for clarity assign the elements
       keyPixelCluster            = itr->first;
@@ -124,20 +124,15 @@ void  PixelGangedClusterAmbiguitiesCnv_p1::persToTrans(const InDet::PixelGangedC
         << persObj->m_pixelClusterContainerName << endmsg;
   }
     
-  std::vector< std::pair<uint32_t, std::vector<uint32_t> > >::const_iterator persItr  = persObj->m_ambiguityMap.begin();
-  std::vector< std::pair<uint32_t, std::vector<uint32_t> > >::const_iterator persItrE = persObj->m_ambiguityMap.end();
-  
   const InDet::PixelCluster* keyPixelCluster(0);
   const InDet::PixelCluster* gangedPixelCluster(0);
-  
-  for( ; persItr != persItrE ; persItr++ )
+
+  for (const std::pair<uint32_t, std::vector<uint32_t> >& mapElement : persObj->m_ambiguityMap)
   {
-    const std::pair<uint32_t, std::vector<uint32_t> >& mapElement = (*persItr);
-    for (std::vector<uint32_t>::const_iterator newItr = (mapElement.second).begin();
-                                              newItr != (mapElement.second).end(); ++newItr)
+    for (uint32_t elt : mapElement.second)
     {
       IdentContIndex keyIdentContIndex(mapElement.first);
-      IdentContIndex gangedIdentContIndex(*newItr);
+      IdentContIndex gangedIdentContIndex(elt);
       for (InDet::PixelClusterContainer::const_iterator contItr  = pCC->begin();
                                                         contItr != pCC->end(); ++contItr)
       {
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p2.cxx
index 22adf0022e4a..9d48c95fb369 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------------
@@ -38,10 +38,9 @@ SCT_ClusterCnv_p2::createSCT_Cluster (const InDet::SCT_Cluster_p2* persObj,
   //Identifier::value_type id32 = transObj->identify().get_compact(); 
   //Identifier id32 = transObj->identify(); 
   std::vector<Identifier>::iterator tit = rdoList.begin();
-  for (std::vector<InDet::SCT_Cluster_p2::rdo_diff_type>::const_iterator it=persObj->m_rdoList.begin(); it != persObj->m_rdoList.end(); it++) {
- 
-    *tit = Identifier(m_sctId2->strip_id_offset(clusId,*it) );
-    tit++;
+  for (const InDet::SCT_Cluster_p2::rdo_diff_type& rdo : persObj->m_rdoList) {
+    *tit = Identifier(m_sctId2->strip_id_offset(clusId,rdo) );
+    ++tit;
   }
   
   InDet::SiWidth sw;
@@ -100,10 +99,9 @@ void SCT_ClusterCnv_p2::transToPers( const InDet::SCT_Cluster *transObj, InDet::
   std::vector<InDet::SCT_Cluster_p2::rdo_diff_type>::iterator pit = persObj->m_rdoList.begin(); 
   
   
-  for (std::vector<Identifier>::const_iterator it=transObj->rdoList().begin(); it != transObj->rdoList().end(); it++) {
-    //*pit = static_cast<InDet::SCT_Cluster_p2::rdo_diff_type>(it->get_compact() - id32);
-    *pit = static_cast<InDet::SCT_Cluster_p2::rdo_diff_type>( m_sctId2->calc_offset(id32, *it) );
-    pit++;
+  for (const Identifier& id : transObj->rdoList()) {
+    *pit = static_cast<InDet::SCT_Cluster_p2::rdo_diff_type>( m_sctId2->calc_offset(id32, id) );
+    ++pit;
   }
   
 }
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p3.cxx
index 134ed0490d4a..6d5f1628030c 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p3.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------------
@@ -39,10 +39,9 @@ SCT_ClusterCnv_p3::createSCT_Cluster (const InDet::SCT_Cluster_p3* persObj,
   //Identifier::value_type id32 = transObj->identify().get_compact(); 
   //Identifier id32 = transObj->identify(); 
   std::vector<Identifier>::iterator tit = rdoList.begin();
-  for (std::vector<InDet::SCT_Cluster_p3::rdo_diff_type>::const_iterator it=persObj->m_rdoList.begin(); it != persObj->m_rdoList.end(); it++) {
- 
-    *tit = Identifier(m_sctId2->strip_id_offset(clusId,*it) );
-    tit++;
+  for (const InDet::SCT_Cluster_p3::rdo_diff_type& rdo : persObj->m_rdoList) {
+    *tit = Identifier(m_sctId2->strip_id_offset(clusId,rdo) );
+    ++tit;
   }
   
   InDet::SiWidth sw;
@@ -106,10 +105,9 @@ void SCT_ClusterCnv_p3::transToPers( const InDet::SCT_Cluster *transObj, InDet::
   std::vector<InDet::SCT_Cluster_p3::rdo_diff_type>::iterator pit = persObj->m_rdoList.begin(); 
   
   
-  for (std::vector<Identifier>::const_iterator it=transObj->rdoList().begin(); it != transObj->rdoList().end(); it++) {
-
-    *pit = static_cast<InDet::SCT_Cluster_p3::rdo_diff_type>( m_sctId2->calc_offset(id32, *it) );
-    pit++;
+  for (const Identifier& id : transObj->rdoList()) {
+    *pit = static_cast<InDet::SCT_Cluster_p3::rdo_diff_type>( m_sctId2->calc_offset(id32, id) );
+    ++pit;
   }
   
 }
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterContainerCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterContainerCnv_p1.cxx
index dc28443ef350..30c40f0b23f3 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterContainerCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterContainerCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetEventTPCnv/InDetPrepRawData/SCT_ClusterContainerCnv_p1.h"
@@ -52,7 +52,7 @@ void InDet::SCT_ClusterContainerCnv_p1::transToPers(const InDet::SCT_ClusterCont
     persCont->m_collections.resize(transCont->numberOfCollections());
 //     if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
   
-    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
 //         if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " New collection" << endmsg;
         const InDet::SCT_ClusterCollection& collection = (**it_Coll);
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/TRT_DriftCircleContainerCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/TRT_DriftCircleContainerCnv_p1.cxx
index 2cec40c90c3a..8c095de94e18 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/TRT_DriftCircleContainerCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/TRT_DriftCircleContainerCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetPrepRawData/TRT_DriftCircle.h"
@@ -56,7 +56,7 @@ void InDet::TRT_DriftCircleContainerCnv_p1::transToPers(const InDet::TRT_DriftCi
     persCont->m_collections.resize(transCont->numberOfCollections());
 //     if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
   
-    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::TRT_DriftCircleCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx
index 65de22842c21..9ff99ce36a97 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Athena
@@ -55,7 +55,7 @@ void PixelClusterContainerCnv_p2::transToPers(const InDet::PixelClusterContainer
     unsigned int chanEnd = 0;
     persCont->m_collections.resize(transCont->numberOfCollections());
     //    if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
-    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::PixelClusterCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p3.cxx
index 08e4fb20dbdd..19e411e31040 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p3.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetEventTPCnv/PixelClusterContainerCnv_p3.h"
@@ -63,7 +63,7 @@ void PixelClusterContainerCnv_p3::transToPers(const InDet::PixelClusterContainer
     unsigned int chanEnd = 0;
     persCont->m_collections.resize(transCont->numberOfCollections());
     //    if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
-    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::PixelClusterCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p2.cxx
index d71a253787aa..a6476bd53033 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetEventTPCnv/SCT_ClusterContainerCnv_p2.h"
@@ -67,7 +67,7 @@ void SCT_ClusterContainerCnv_p2::transToPers(const InDet::SCT_ClusterContainer*
     // to avoid the inside-loop resize
     int totSize = 0; 
     //for ( ; it_Coll != it_CollEnd;  it_Coll++)  {
-    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  it_Coll++)  {
+    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  ++it_Coll)  {
       const InDet::SCT_ClusterCollection& collection = (**it_Coll);
       totSize+=collection.size();
     }
@@ -76,7 +76,7 @@ void SCT_ClusterContainerCnv_p2::transToPers(const InDet::SCT_ClusterContainer*
 
     //    if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
     //for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
-    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::SCT_ClusterCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p3.cxx
index 0a7dff6f89c8..cf7868ddab19 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p3.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetEventTPCnv/SCT_ClusterContainerCnv_p3.h"
@@ -67,7 +67,7 @@ void SCT_ClusterContainerCnv_p3::transToPers(const InDet::SCT_ClusterContainer*
     // to avoid the inside-loop resize
     int totSize = 0; 
     //for ( ; it_Coll != it_CollEnd;  it_Coll++)  {
-    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  it_Coll++)  {
+    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  ++it_Coll)  {
       const InDet::SCT_ClusterCollection& collection = (**it_Coll);
       totSize+=collection.size();
     }
@@ -76,7 +76,7 @@ void SCT_ClusterContainerCnv_p3::transToPers(const InDet::SCT_ClusterContainer*
 
     //    if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
     //for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
-    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::SCT_ClusterCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/TRT_DriftCircleContainerCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/TRT_DriftCircleContainerCnv_p2.cxx
index d728296dc410..b686037dadb5 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/TRT_DriftCircleContainerCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/TRT_DriftCircleContainerCnv_p2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetPrepRawData/TRT_DriftCircle.h"
@@ -67,7 +67,7 @@ void TRT_DriftCircleContainerCnv_p2::transToPers(const InDet::TRT_DriftCircleCon
     // to avoid the inside-loop resize
     int totSize = 0; 
     //for ( ; it_Coll != it_CollEnd;  it_Coll++)  {
-    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  it_Coll++)  {
+    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  ++it_Coll)  {
       const InDet::TRT_DriftCircleCollection& collection = (**it_Coll);
       totSize+=collection.size();
     }
@@ -76,7 +76,7 @@ void TRT_DriftCircleContainerCnv_p2::transToPers(const InDet::TRT_DriftCircleCon
 
     //    if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
     //    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
-    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::TRT_DriftCircleCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
-- 
GitLab


From e212e68dbb9e23313df6037033254aabff6ebc71 Mon Sep 17 00:00:00 2001
From: Bertrand Martin <martindl@cern.ch>
Date: Wed, 16 Sep 2020 16:19:16 +0200
Subject: [PATCH 160/422] tauRecTools: make execute method const in
 TauPi0CreateROI

Hello,

This MR is making the execute method const in TauPi0CreateROI (executePi0CreateROI).
Relevant ticket: ATLTAU-1723 .
Related MR: !36215 .

Cheers,
Bertrand
---
 Reconstruction/tauRecTools/Root/TauRecToolBase.cxx      | 2 +-
 Reconstruction/tauRecTools/src/TauPi0CreateROI.cxx      | 2 +-
 Reconstruction/tauRecTools/src/TauPi0CreateROI.h        | 2 +-
 Reconstruction/tauRecTools/tauRecTools/ITauToolBase.h   | 2 +-
 Reconstruction/tauRecTools/tauRecTools/TauRecToolBase.h | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Reconstruction/tauRecTools/Root/TauRecToolBase.cxx b/Reconstruction/tauRecTools/Root/TauRecToolBase.cxx
index 871595ff2c05..a0d2165874ae 100644
--- a/Reconstruction/tauRecTools/Root/TauRecToolBase.cxx
+++ b/Reconstruction/tauRecTools/Root/TauRecToolBase.cxx
@@ -148,7 +148,7 @@ StatusCode TauRecToolBase::executeDev(xAOD::TauJet&) {
   return StatusCode::FAILURE;
 }
 #else
-StatusCode TauRecToolBase::executePi0CreateROI(xAOD::TauJet& /*pTau*/, CaloCellContainer& /*caloCellContainer*/, std::vector<CaloCell*>& /*map*/ ) {
+StatusCode TauRecToolBase::executePi0CreateROI(xAOD::TauJet& /*pTau*/, CaloCellContainer& /*caloCellContainer*/, std::vector<CaloCell*>& /*map*/ ) const {
   ATH_MSG_ERROR("function not implemented");
   return StatusCode::FAILURE;
 }
diff --git a/Reconstruction/tauRecTools/src/TauPi0CreateROI.cxx b/Reconstruction/tauRecTools/src/TauPi0CreateROI.cxx
index b372dffc1ae1..6611aea2e5f7 100644
--- a/Reconstruction/tauRecTools/src/TauPi0CreateROI.cxx
+++ b/Reconstruction/tauRecTools/src/TauPi0CreateROI.cxx
@@ -42,7 +42,7 @@ StatusCode TauPi0CreateROI::initialize() {
 }
 
 //______________________________________________________________________________
-StatusCode TauPi0CreateROI::executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& pPi0CellContainer, std::vector<CaloCell*>& addedCellsMap) {
+StatusCode TauPi0CreateROI::executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& pPi0CellContainer, std::vector<CaloCell*>& addedCellsMap) const {
 
     //---------------------------------------------------------------------
     // only run on 1-5 prong taus 
diff --git a/Reconstruction/tauRecTools/src/TauPi0CreateROI.h b/Reconstruction/tauRecTools/src/TauPi0CreateROI.h
index b5b7a1fe055f..61413ebbab5f 100644
--- a/Reconstruction/tauRecTools/src/TauPi0CreateROI.h
+++ b/Reconstruction/tauRecTools/src/TauPi0CreateROI.h
@@ -31,7 +31,7 @@ public:
     virtual ~TauPi0CreateROI();
 
     virtual StatusCode initialize() override;
-    virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& Pi0CellContainer, std::vector<CaloCell*>& map) override;
+    virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& Pi0CellContainer, std::vector<CaloCell*>& map) const override;
 
 private:
     SG::ReadHandleKey<CaloCellContainer> m_caloCellInputContainer{this,"Key_caloCellInputContainer", "AllCalo", "input vertex container key"};
diff --git a/Reconstruction/tauRecTools/tauRecTools/ITauToolBase.h b/Reconstruction/tauRecTools/tauRecTools/ITauToolBase.h
index e5770929a71e..24c33d823fb3 100644
--- a/Reconstruction/tauRecTools/tauRecTools/ITauToolBase.h
+++ b/Reconstruction/tauRecTools/tauRecTools/ITauToolBase.h
@@ -68,7 +68,7 @@ class ITauToolBase : virtual public asg::IAsgTool
   virtual StatusCode executeDev(xAOD::TauJet& pTau) = 0;
 #else
   // CaloCellContainer not available in AnalysisBase
-  virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& caloCellContainer, std::vector<CaloCell*>& map ) = 0;
+  virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& caloCellContainer, std::vector<CaloCell*>& map ) const = 0;
 #endif
   
   //-----------------------------------------------------------------
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauRecToolBase.h b/Reconstruction/tauRecTools/tauRecTools/TauRecToolBase.h
index 578ca89cdfc5..b762e5252867 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauRecToolBase.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauRecToolBase.h
@@ -43,7 +43,7 @@ class TauRecToolBase : public asg::AsgTool, virtual public ITauToolBase {
 #ifdef XAOD_ANALYSIS
   virtual StatusCode executeDev(xAOD::TauJet& pTau) override;
 #else
-  virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& caloCellContainer, std::vector<CaloCell*>& map ) override;
+  virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& caloCellContainer, std::vector<CaloCell*>& map ) const override;
 #endif
   virtual StatusCode executeVertexFinder(xAOD::TauJet& pTau, 
                                          const xAOD::VertexContainer* vertexContainer = nullptr, 
-- 
GitLab


From 9854da51ce661b0442814864805799fcd76aa1eb Mon Sep 17 00:00:00 2001
From: "Ewelina.Maria.Lobodzinska" <ewelina.maria.lobodzinska@cern.ch>
Date: Wed, 16 Sep 2020 16:34:27 +0200
Subject: [PATCH 161/422] add common fragments for Sherpa and Filters

---
 .../test/test_gen_pythia8_minbias.sh          |   2 +-
 .../share/common/BSignalFilter.py             |  15 ++
 .../share/common/Base_Fragment.py             | 131 ++++++++++++++++++
 .../share/common/BoostedHadTopAndTopPair.py   |  14 ++
 .../share/common/ChargedTrackFilter.py        |  10 ++
 .../share/common/DecaysFinalStateFilter.py    |  13 ++
 .../share/common/DiBJetFilter.py              |  24 ++++
 .../share/common/DiLeptonMassFilter.py        |  16 +++
 .../share/common/DirectPhotonFilter.py        |  29 ++++
 .../share/common/EW_scheme_sinthetaW_mZ.py    |  38 +++++
 .../GeneratorFilters/share/common/FindJets.py |  35 +++++
 .../share/common/FourLeptonInvMassFilter.py   |   8 ++
 .../share/common/FourLeptonMassFilter.py      |  20 +++
 .../share/common/Fusing_Direct.py             |  10 ++
 .../share/common/Fusing_Fragmentation.py      |   8 ++
 .../share/common/GenerateTruthJets.py         | 118 ++++++++++++++++
 .../GeneratorFilters/share/common/HTFilter.py |  16 +++
 .../share/common/HeavyFlavorHadronFilter.py   |  37 +++++
 .../share/common/JetFilter_JZX.py             |  25 ++++
 .../share/common/LeadingDiBjetFilter.py       |  24 ++++
 .../share/common/LeptonFilter.py              |  14 ++
 .../share/common/LeptonPairFilterExample.py   |  25 ++++
 .../share/common/Lund_Hadronisation.py        |   7 +
 .../share/common/MassRangeFilter.py           |  19 +++
 .../share/common/MissingEtFilter.py           |  12 ++
 .../share/common/MultiElecMuTauFilter.py      |  18 +++
 .../share/common/MultiLeptonFilter.py         |  13 ++
 .../share/common/MultiMuonFilter.py           |  14 ++
 .../share/common/MultiParticleFilter.py       |  17 +++
 .../share/common/NNPDF30NNLO.py               |   8 ++
 .../share/common/NNPDF30NNLO_nf_4.py          |   8 ++
 .../share/common/ParentChildwStatusFilter.py  |  15 ++
 .../share/common/ParticleFilter.py            |  11 ++
 .../share/common/QCDJetFilter.py              |  11 ++
 .../share/common/QCDTruthJetFilter.py         |   7 +
 .../share/common/QCDTruthMultiJetFilter.py    |  21 +++
 .../share/common/TTbarLJetsVptFilter.py       |  12 ++
 .../share/common/TTbarWToLeptonFilter.py      |  15 ++
 .../share/common/TTbarWithJpsimumuFilter.py   |  10 ++
 .../share/common/TransverseMassVVFilter.py    |  13 ++
 .../share/common/VBFForwardJetsFilter.py      |  33 +++++
 .../Example/MC15.999999.Sherpa_Example.py     |  18 ---
 .../Sherpa_i/share/common/Base_Fragment.py    | 131 ++++++++++++++++++
 .../share/common/EW_scheme_sinthetaW_mZ.py    |  38 +++++
 .../Sherpa_i/share/common/Fusing_Direct.py    |  10 ++
 .../share/common/Fusing_Fragmentation.py      |   8 ++
 .../share/common/Lund_Hadronisation.py        |   7 +
 .../Sherpa_i/share/common/NNPDF30NNLO.py      |   8 ++
 .../Sherpa_i/share/common/NNPDF30NNLO_nf_4.py |   8 ++
 .../share/example/999999/mc.Sh_Example.py     |  27 ++++
 .../share/{Example => example}/README         |   4 +-
 .../Sherpa_i/share/validation/SherpaTest.cc   |  73 ++++++++++
 52 files changed, 1207 insertions(+), 21 deletions(-)
 create mode 100644 Generators/GeneratorFilters/share/common/BSignalFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/Base_Fragment.py
 create mode 100644 Generators/GeneratorFilters/share/common/BoostedHadTopAndTopPair.py
 create mode 100644 Generators/GeneratorFilters/share/common/ChargedTrackFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/DecaysFinalStateFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/DiBJetFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/DiLeptonMassFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/DirectPhotonFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/EW_scheme_sinthetaW_mZ.py
 create mode 100644 Generators/GeneratorFilters/share/common/FindJets.py
 create mode 100644 Generators/GeneratorFilters/share/common/FourLeptonInvMassFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/FourLeptonMassFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/Fusing_Direct.py
 create mode 100644 Generators/GeneratorFilters/share/common/Fusing_Fragmentation.py
 create mode 100644 Generators/GeneratorFilters/share/common/GenerateTruthJets.py
 create mode 100644 Generators/GeneratorFilters/share/common/HTFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/HeavyFlavorHadronFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/JetFilter_JZX.py
 create mode 100644 Generators/GeneratorFilters/share/common/LeadingDiBjetFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/LeptonFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/LeptonPairFilterExample.py
 create mode 100644 Generators/GeneratorFilters/share/common/Lund_Hadronisation.py
 create mode 100644 Generators/GeneratorFilters/share/common/MassRangeFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/MissingEtFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/MultiElecMuTauFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/MultiLeptonFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/MultiMuonFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/MultiParticleFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/NNPDF30NNLO.py
 create mode 100644 Generators/GeneratorFilters/share/common/NNPDF30NNLO_nf_4.py
 create mode 100644 Generators/GeneratorFilters/share/common/ParentChildwStatusFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/ParticleFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/QCDJetFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/QCDTruthJetFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/QCDTruthMultiJetFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/TTbarLJetsVptFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/TTbarWToLeptonFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/TTbarWithJpsimumuFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/TransverseMassVVFilter.py
 create mode 100644 Generators/GeneratorFilters/share/common/VBFForwardJetsFilter.py
 delete mode 100644 Generators/Sherpa_i/share/Example/MC15.999999.Sherpa_Example.py
 create mode 100644 Generators/Sherpa_i/share/common/Base_Fragment.py
 create mode 100644 Generators/Sherpa_i/share/common/EW_scheme_sinthetaW_mZ.py
 create mode 100644 Generators/Sherpa_i/share/common/Fusing_Direct.py
 create mode 100644 Generators/Sherpa_i/share/common/Fusing_Fragmentation.py
 create mode 100644 Generators/Sherpa_i/share/common/Lund_Hadronisation.py
 create mode 100644 Generators/Sherpa_i/share/common/NNPDF30NNLO.py
 create mode 100644 Generators/Sherpa_i/share/common/NNPDF30NNLO_nf_4.py
 create mode 100644 Generators/Sherpa_i/share/example/999999/mc.Sh_Example.py
 rename Generators/Sherpa_i/share/{Example => example}/README (52%)
 create mode 100644 Generators/Sherpa_i/share/validation/SherpaTest.cc

diff --git a/Generators/EvgenJobTransforms/test/test_gen_pythia8_minbias.sh b/Generators/EvgenJobTransforms/test/test_gen_pythia8_minbias.sh
index cb25c5ba70ab..2c28dbba22eb 100755
--- a/Generators/EvgenJobTransforms/test/test_gen_pythia8_minbias.sh
+++ b/Generators/EvgenJobTransforms/test/test_gen_pythia8_minbias.sh
@@ -7,7 +7,7 @@
 
 ## Any arguments are considered overrides, and will be added at the end
 export TRF_ECHO=True;
-Gen_tf.py --ecmEnergy=13000 --jobConfig=421113 --maxEvents=10 \
+Gen_tf.py --ecmEnergy=13000 --jobConfig=421113 --maxEvents=100 \
     --outputEVNTFile=test_minbias_inelastic.EVNT.pool.root \
 
 echo "art-result: $? generate"
diff --git a/Generators/GeneratorFilters/share/common/BSignalFilter.py b/Generators/GeneratorFilters/share/common/BSignalFilter.py
new file mode 100644
index 000000000000..4fc335b8a88e
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/BSignalFilter.py
@@ -0,0 +1,15 @@
+## Example configuration for MultiLeptonFilter setting up defaults
+
+if not hasattr( filtSeq, "BSignalFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import BSignalFilter
+    filtSeq += BSignalFilter()
+    pass
+
+"""
+BSignalFilter.LVL1MuonCutOn = True
+BSignalFilter.LVL2MuonCutOn = True
+BSignalFilter.LVL1MuonCutPT = 3500
+BSignalFilter.LVL1MuonCutEta = 2.6
+BSignalFilter.LVL2MuonCutPT = 3500
+BSignalFilter.LVL2MuonCutEta = 2.6
+"""
diff --git a/Generators/GeneratorFilters/share/common/Base_Fragment.py b/Generators/GeneratorFilters/share/common/Base_Fragment.py
new file mode 100644
index 000000000000..acb690d89d7b
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/Base_Fragment.py
@@ -0,0 +1,131 @@
+## Base config for Sherpa
+from Sherpa_i.Sherpa_iConf import Sherpa_i
+genSeq += Sherpa_i()
+evgenConfig.generators = ["Sherpa"]
+genSeq.Sherpa_i.PluginCode = ""
+
+## Tell Sherpa to read its run card sections from the jO
+## TODO: write out Run.dat from genSeq.Sherpa_i.RunCard and read from it
+## instead of the JO
+genSeq.Sherpa_i.Parameters += [ 'RUNDATA=%s' % runArgs.jobConfig[0] ]
+
+## Tell Sherpa to write logs into a separate file
+## (need for production, looping job detection, Wolfgang Ehrenfeld)
+genSeq.Sherpa_i.Parameters += [ 'LOG_FILE=sherpa.log' ]
+
+## General ATLAS parameters
+genSeq.Sherpa_i.Parameters += [
+    "BEAM_1=2212",
+    "BEAM_2=2212",
+    "MAX_PROPER_LIFETIME=10.0",
+    "HEPMC_TREE_LIKE=1",
+    "PRETTY_PRINT=Off",
+    ]
+
+## Cap event weights at |w|<10 in unweighted evgen; set H-event shower mode
+## in the soft region to avoid instable weights 
+genSeq.Sherpa_i.Parameters += [
+    "OVERWEIGHT_THRESHOLD=10",
+    "PP_HPSMODE=0"
+]
+
+## Enable scale variations by default
+genSeq.Sherpa_i.Parameters += [
+    "HEPMC_USE_NAMED_WEIGHTS=1",
+    "CSS_REWEIGHT=1",
+    "REWEIGHT_SPLITTING_PDF_SCALES=1",
+    "REWEIGHT_SPLITTING_ALPHAS_SCALES=1",
+    "CSS_REWEIGHT_SCALE_CUTOFF=5.0",
+    "HEPMC_INCLUDE_ME_ONLY_VARIATIONS=1",
+    "SCALE_VARIATIONS=0.25,0.25 0.25,1. 1.,0.25 1.,1. 1.,4. 4.,1. 4.,4.",
+]
+
+## Switch to EW_SCHEME=0 to be able to set PDG value of thetaW
+genSeq.Sherpa_i.Parameters += [ "EW_SCHEME=0" ]
+
+try:
+    USE_PDG_VALUES
+except NameError:
+    USE_PDG_VALUES = False
+## if USE_PDG_VALUES = True, load PDG value 
+## of sin2thetaW and particle masses/widths 
+## from parameter dictionary located in 
+## EvgenProdTools/python/offline_dict.py 
+## ToDo: Include partial widths for H/W/Z?
+recorded = []
+if USE_PDG_VALUES:
+    from EvgenProdTools.offline_dict import parameters
+    for k,v in parameters.items():
+        if k == 'particles':
+            for key,value in v.items():
+                if 5 < int(key) and int(key) < 26:
+                    ## This includes now the top quark, 
+                    ## the leptons and the bosons
+                    genSeq.Sherpa_i.Parameters += [ 
+                        'MASS['+key+']='+ value['mass'],
+                        'WIDTH['+key+']='+ value['width'],
+                    ]
+                    recorded.append(key)
+        elif k == 'EW_parameters':
+            for key,value in v.items():
+                if key[0] == 'SIN2THETAW':
+                    genSeq.Sherpa_i.Parameters += [
+                        str(key[0])+'='+str(value),
+                    ]
+                    recorded.append(str(key[0]))
+                    break
+
+# Fall-back to the MC15 default values if need be
+defaults = {
+    '6'  : [ "MASS[6]=172.5",    "WIDTH[6]=1.32"         ],
+    '15' : [ "MASS[15]=1.777",   "WIDTH[15]=2.26735e-12" ],
+    '23' : [ "MASS[23]=91.1876", "WIDTH[23]=2.4952"      ],
+    '24' : [ "MASS[24]=80.399",  "WIDTH[24]=2.085"       ],
+    'SIN2THETAW' : [ "SIN2THETAW=0.23113" ],
+}
+for key, value in defaults.items():
+  if key not in recorded:
+    genSeq.Sherpa_i.Parameters += value
+
+
+
+## set/add partial widths for H, W, Z to PDG values
+## cf. https://sherpa.hepforge.org/doc/SHERPA-MC-2.2.4.html#HDH_005fWIDTH
+genSeq.Sherpa_i.Parameters += [
+    "HDH_WIDTH[6,24,5]=1.32",    #updated to comply latest updated top results
+    "HDH_WIDTH[-6,-24,-5]=1.32",  #updated to comply latest updated top results
+    "HDH_WIDTH[25,5,-5]=2.35e-3",
+    "HDH_WIDTH[25,15,-15]=2.57e-4",
+    "HDH_WIDTH[25,13,-13]=8.91e-7",
+    "HDH_WIDTH[25,4,-4]=1.18e-4",
+    "HDH_WIDTH[25,3,-3]=1.00e-6",
+    "HDH_WIDTH[25,21,21]=3.49e-4",
+    "HDH_WIDTH[25,22,22]=9.28e-6",
+    "HDH_WIDTH[24,2,-1]=0.7041",
+    "HDH_WIDTH[24,4,-3]=0.7041",
+    "HDH_WIDTH[24,12,-11]=0.2256",
+    "HDH_WIDTH[24,14,-13]=0.2256",
+    "HDH_WIDTH[24,16,-15]=0.2256",
+    "HDH_WIDTH[-24,-2,1]=0.7041",
+    "HDH_WIDTH[-24,-4,3]=0.7041",
+    "HDH_WIDTH[-24,-12,11]=0.2256",
+    "HDH_WIDTH[-24,-14,13]=0.2256",
+    "HDH_WIDTH[-24,-16,15]=0.2256",
+    "HDH_WIDTH[23,1,-1]=0.3828",
+    "HDH_WIDTH[23,2,-2]=0.2980",
+    "HDH_WIDTH[23,3,-3]=0.3828",
+    "HDH_WIDTH[23,4,-4]=0.2980",
+    "HDH_WIDTH[23,5,-5]=0.3828",
+    "HDH_WIDTH[23,11,-11]=0.0840",
+    "HDH_WIDTH[23,12,-12]=0.1663",
+    "HDH_WIDTH[23,13,-13]=0.0840",
+    "HDH_WIDTH[23,14,-14]=0.1663",
+    "HDH_WIDTH[23,15,-15]=0.0840",
+    "HDH_WIDTH[23,16,-16]=0.1663",
+    ]
+
+## OpenLoops parameters
+genSeq.Sherpa_i.Parameters += [
+    "OL_PREFIX=/cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/openloops/2.0.0/x86_64-slc6-gcc62-opt",
+    "OL_PARAMETERS=preset=2 write_parameters=1",
+]
diff --git a/Generators/GeneratorFilters/share/common/BoostedHadTopAndTopPair.py b/Generators/GeneratorFilters/share/common/BoostedHadTopAndTopPair.py
new file mode 100644
index 000000000000..91cbf50c4c65
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/BoostedHadTopAndTopPair.py
@@ -0,0 +1,14 @@
+if not hasattr(filtSeq, "BoostedHadTopAndTopPair"):
+    from GeneratorFilters.GeneratorFiltersConf import BoostedHadTopAndTopPair
+    filtSeq += BoostedHadTopAndTopPair("BoostedHadTopAndTopPair")
+
+
+## Choose to cut on the pT of the top on the list for m_cutPtOf = 0,
+## or to cut on the pT of the top decay products (b, q, q'bar) on the list for m_cutPtOf = 1
+filtSeq.BoostedHadTopAndTopPair.cutPtOf    = 1
+
+## Default cut params (in MeV)
+filtSeq.BoostedHadTopAndTopPair.tHadPtMin    =       0.0 # if -1 : all decay modes, if >= 0 : at least 1 hadronic top
+filtSeq.BoostedHadTopAndTopPair.tHadPtMax    = 6000000.0
+filtSeq.BoostedHadTopAndTopPair.tPairPtMin   =       0.0
+filtSeq.BoostedHadTopAndTopPair.tPairPtMax   = 6000000.0
diff --git a/Generators/GeneratorFilters/share/common/ChargedTrackFilter.py b/Generators/GeneratorFilters/share/common/ChargedTrackFilter.py
new file mode 100644
index 000000000000..8cc52a4484bb
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/ChargedTrackFilter.py
@@ -0,0 +1,10 @@
+## Default truth ncharged filter setup
+      
+from GeneratorFilters.GeneratorFiltersConf import ChargedTracksFilter             
+if "ChargedTracksFilter" not in filtSeq:
+   filtSeq += ChargedTracksFilter()
+ 
+filtSeq.ChargedTracksFilter.Ptcut = 100.
+filtSeq.ChargedTracksFilter.Etacut = 2.5
+
+  
diff --git a/Generators/GeneratorFilters/share/common/DecaysFinalStateFilter.py b/Generators/GeneratorFilters/share/common/DecaysFinalStateFilter.py
new file mode 100644
index 000000000000..7462154db628
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/DecaysFinalStateFilter.py
@@ -0,0 +1,13 @@
+# Example JO to filter with DecaysFinalStateFilter
+
+if not hasattr( filtSeq, "DecaysFinalStateFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import DecaysFinalStateFilter
+    filtSeq += DecaysFinalStateFilter()
+    pass
+
+"""
+DecaysFinalStateFilter = filtSeq.DecaysFinalStateFilter
+DecaysFinalStateFilter.NQuarks = 2
+DecaysFinalStateFilter.MinNChargedLeptons = 2
+DecaysFinalStateFilter.PDGAllowedParents = [ 23, 24, -24 ]
+"""
diff --git a/Generators/GeneratorFilters/share/common/DiBJetFilter.py b/Generators/GeneratorFilters/share/common/DiBJetFilter.py
new file mode 100644
index 000000000000..bcb779399a98
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/DiBJetFilter.py
@@ -0,0 +1,24 @@
+## Example configuration for DiBJet filter setting up defaults                                                                                                                                   
+
+include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+include("GeneratorFilters/JetFilter_Fragment.py")
+
+if not hasattr( filtSeq, "DiBjetFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import DiBjetFilter
+    filtSeq += DiBjetFilter()
+    pass
+
+"""
+DiBjetFilter = filtSeq.DiBjetFilter
+DiBjetFilter.LeadJetPtMin = 0
+DiBjetFilter.LeadJetPtMax = 50000
+DiBjetFilter.BottomPtMin = 5.0
+DiBjetFilter.BottomEtaMax = 3.0
+DiBjetFilter.JetPtMin = 15.0
+DiBjetFilter.JetEtaMax = 2.7
+DiBjetFilter.DeltaRFromTruth = 0.3
+DiBjetFilter.TruthContainerName = "AntiKt4TruthJets" 
+DiBjetFilter.LightJetSuppressionFactor = 10
+DiBjetFilter.AcceptSomeLightEvents = False
+"""
diff --git a/Generators/GeneratorFilters/share/common/DiLeptonMassFilter.py b/Generators/GeneratorFilters/share/common/DiLeptonMassFilter.py
new file mode 100644
index 000000000000..4378f11caab7
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/DiLeptonMassFilter.py
@@ -0,0 +1,16 @@
+## Example configuration for DiLeptonMassFilter setting up defaults
+
+if not hasattr( filtSeq, "DiLeptonMassFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import DiLeptonMassFilter
+    filtSeq += DiLeptonMassFilter()
+    pass
+
+"""
+DiLeptonMassFilter = filtSeq.DiLeptonMassFilter
+DiLeptonMassFilter.MinPt = 3500.
+DiLeptonMassFilter.MaxEta = 3.0
+DiLeptonMassFilter.MinMass = 4000.
+DiLeptonMassFilter.MaxMass = 10000.
+DiLeptonMassFilter.AllowSameCharge = False
+"""
+ 
diff --git a/Generators/GeneratorFilters/share/common/DirectPhotonFilter.py b/Generators/GeneratorFilters/share/common/DirectPhotonFilter.py
new file mode 100644
index 000000000000..adbb662582da
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/DirectPhotonFilter.py
@@ -0,0 +1,29 @@
+## Example configuration for DirectPhotonFilter setting up defaults
+
+if not hasattr( filtSeq, "DirectPhotonFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import DirectPhotonFilter
+    filtSeq += DirectPhotonFilter()
+    pass
+
+"""
+DirectPhotonFilter = filtSeq.DirectPhotonFilter
+
+DirectPhotonFilter.NPhotons = 1
+
+# apply cut inclusively for any photon in the event (False) or 
+# ordered by pT for the given number of photons (True, default)
+DirectPhotonFilter.OrderPhotons = True
+
+# if OrderPhotons=True: can contain multiple values for leading, subleading, ...
+# if OrderPhotons=False: the first value will be used for the inclusive cut
+DirectPhotonFilter.Ptmin = [ 10000. ]
+
+# optional, unlimited by default
+DirectPhotonFilter.Ptmax = [ 100000000. ]
+
+# eta range
+DirectPhotonFilter.Etacut = 2.50
+
+# Accept also prompt photons from SUSY decays
+DirectPhotonFilter.AllowSUSYDecay = True
+"""
diff --git a/Generators/GeneratorFilters/share/common/EW_scheme_sinthetaW_mZ.py b/Generators/GeneratorFilters/share/common/EW_scheme_sinthetaW_mZ.py
new file mode 100644
index 000000000000..01379742979f
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/EW_scheme_sinthetaW_mZ.py
@@ -0,0 +1,38 @@
+# Use EW scheme which allows specifying sinThetaW and mZ simultaneously at the expense of mW.
+# Three sub-options for specifying the QED coupling are introduced:
+#
+#    EW_SCHEME=20 for alpha(0), mZ, sinThetaW
+#    EW_SCHEME=21 for Gmu, mZ, sinThetaW
+#    EW_SCHEME=22 for alpha(mZ), mZ, sinThetaW
+
+genSeq.Sherpa_i.Parameters += [ "EW_SCHEME=22" ]
+
+try:
+    USE_PDG_VALUES
+except NameError:
+    USE_PDG_VALUES = False
+## if USE_PDG_VALUES = True, load PDG value of 
+## sin2thetaW from parameter dictionary located
+## in EvgenProdTools/python/offline_dict.py 
+if USE_PDG_VALUES:
+    from EvgenProdTools.offline_dict import parameters
+    for k,v in parameters.items():
+        if k == 'EW_parameters':
+            for key,value in v.items():
+                if key[0] == 'SIN2THETAW':
+                    genSeq.Sherpa_i.Parameters += [
+                        str(key[0])+'='+str(value),
+                    ]
+                    break
+            break
+if 'SIN2THETAW' not in genSeq.Sherpa_i.Parameters[-1]:
+    genSeq.Sherpa_i.Parameters += [ "SIN2THETAW=0.23113" ]
+
+
+## Overwrite OL_PREFIX to not use it from cvmfs (which doesn't have this scheme implemented yet)
+## Also adding OL_IGNORE_MODEL (default to SM) since the scheme names aren't synchronised yet
+genSeq.Sherpa_i.Parameters += [
+    "OL_PREFIX=./Process/OpenLoops",
+    "OL_PARAMETERS=ew_renorm_scheme 22 write_parameters 1",
+    "OL_IGNORE_MODEL=1",
+]
diff --git a/Generators/GeneratorFilters/share/common/FindJets.py b/Generators/GeneratorFilters/share/common/FindJets.py
new file mode 100644
index 000000000000..0c78dd232ae6
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/FindJets.py
@@ -0,0 +1,35 @@
+from xAODTruthCnv.xAODTruthCnvConf import xAODMaker__xAODTruthCnvAlg
+if not hasattr(prefiltSeq, 'xAODCnv'):
+    prefiltSeq += xAODMaker__xAODTruthCnvAlg('xAODCnv',WriteTruthMetaData=False)
+prefiltSeq.xAODCnv.AODContainerName = 'GEN_EVENT'
+
+#CreateTruthJets(prefiltSeq,filtSeq,runArgs.ecmEnergy,0.6)
+
+# Turn off ghost association algorithms
+#include("GeneratorFilters/JetFilter_JZX.py")
+#from JetFilter_JZX import JZSlice
+
+#JZSlice(0,prefiltSeq,filtSeq,runArgs.ecmEnergy,0.6)
+
+# Min and max momenta for the slices
+minDict = {0:-1,1:20,2:60,3:160,4:400,5:800,6:1300,7:1800,8:2500,9:3200,10:3900,11:4600,12:5300}
+maxDict = {0:20,1:60,2:160,3:400,4:800,5:1300,6:1800,7:2500,8:3200,9:3900,10:4600,11:5300,12:7000}
+
+def CreateJets(prefiltSeq, jetR, mods=""):
+       include("GeneratorFilters/GenerateTruthJets.py")
+
+       PrepareTruthJetInputs(prefiltSeq)
+       ScheduleAntiKtTruthJets(jetradius=jetR,algseq=prefiltSeq,mods=mods)
+       jetcollname = 'AntiKt{0}{1}TruthJets'.format(int(jetR*10),mods)
+
+def AddJetsFilter(filtSeq,ecmEnergy, jetR, mods=""):       
+       include("GeneratorFilters/QCDJetFilter.py")
+#    from QCDJetFilter import AddJetFilter
+       AddJetFilter(filtSeq,ecmEnergy)
+       jetcollname = 'AntiKt{0}{1}TruthJets'.format(int(jetR*10),mods)
+       filtSeq.QCDTruthJetFilter.TruthJetContainer = jetcollname
+
+def JZSlice(x,filtSeq):
+    from AthenaCommon.SystemOfUnits import GeV
+    filtSeq.QCDTruthJetFilter.MinPt = minDict[x]*GeV
+    filtSeq.QCDTruthJetFilter.MaxPt = maxDict[x]*GeV
diff --git a/Generators/GeneratorFilters/share/common/FourLeptonInvMassFilter.py b/Generators/GeneratorFilters/share/common/FourLeptonInvMassFilter.py
new file mode 100644
index 000000000000..297926508c89
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/FourLeptonInvMassFilter.py
@@ -0,0 +1,8 @@
+## Example configuration for FourLeptonMassFilter setting up defaults
+
+
+if not hasattr( filtSeq, "FourLeptonInvMassFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import FourLeptonInvMassFilter
+    filtSeq += FourLeptonInvMassFilter()
+    pass
+
diff --git a/Generators/GeneratorFilters/share/common/FourLeptonMassFilter.py b/Generators/GeneratorFilters/share/common/FourLeptonMassFilter.py
new file mode 100644
index 000000000000..6421dad991fe
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/FourLeptonMassFilter.py
@@ -0,0 +1,20 @@
+## Example configuration for FourLeptonMassFilter setting up defaults
+
+
+if not hasattr( filtSeq, "FourLeptonMassFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import FourLeptonMassFilter
+    filtSeq += FourLeptonMassFilter()
+    pass
+
+## Setup Defaults as example
+"""
+FourLeptonMassFilter = filtSeq.FourLeptonMassFilter
+FourLeptonMassFilter.MinPt = 5000.
+FourLeptonMassFilter.MaxEta = 3.
+FourLeptonMassFilter.MinMass1 = 60000.
+FourLeptonMassFilter.MaxMass1 = 14000000.
+FourLeptonMassFilter.MinMass2 = 12000.
+FourLeptonMassFilter.MaxMass2 = 14000000.
+FourLeptonMassFilter.AllowElecMu = True
+FourLeptonMassFilter.AllowSameCharge = True
+"""
diff --git a/Generators/GeneratorFilters/share/common/Fusing_Direct.py b/Generators/GeneratorFilters/share/common/Fusing_Direct.py
new file mode 100644
index 000000000000..d88da593d536
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/Fusing_Direct.py
@@ -0,0 +1,10 @@
+# CAUTION: when including this, you have to set the following process-dependent setting in your JO:
+# If two strong couplings are involved at Born level, `FUSING_DIRECT_FACTOR=1` (e.g. Zbb).
+# If there are four such couplings, `FUSING_DIRECT_FACTOR=2` (e.g. ttbb).
+
+# taken from Sherpa examples: Examples/V_plus_Bs/LHC_Fusing/
+
+genSeq.Sherpa_i.Parameters += [ "SHERPA_LDADD=SherpaFusing",
+                                "USERHOOK=Fusing_Direct",
+                                "CSS_SCALE_SCHEME=20",
+                                "CSS_EVOLUTION_SCHEME=30", ]
diff --git a/Generators/GeneratorFilters/share/common/Fusing_Fragmentation.py b/Generators/GeneratorFilters/share/common/Fusing_Fragmentation.py
new file mode 100644
index 000000000000..a3739a60ff02
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/Fusing_Fragmentation.py
@@ -0,0 +1,8 @@
+# taken from Sherpa examples: Examples/V_plus_Bs/LHC_Fusing/
+
+genSeq.Sherpa_i.Parameters += [ "SHERPA_LDADD=SherpaFusing",
+                                "USERHOOK=Fusing_Fragmentation",
+                                "CSS_SCALE_SCHEME=20",
+                                "CSS_EVOLUTION_SCHEME=30",
+                                "FUSING_FRAGMENTATION_STORE_AS_WEIGHT=1",
+]
diff --git a/Generators/GeneratorFilters/share/common/GenerateTruthJets.py b/Generators/GeneratorFilters/share/common/GenerateTruthJets.py
new file mode 100644
index 000000000000..4aa6de3cd9b9
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/GenerateTruthJets.py
@@ -0,0 +1,118 @@
+from AthenaCommon import Logging
+jetlog = Logging.logging.getLogger("GenerateTruthJets")
+
+# Attach jet algorithms
+def PrepareTruthJetInputs(algseq):
+    if hasattr( algseq, "JetTruthCopyAlg" ): 
+        "JetTruthCopyAlg already present, no need to add again"
+        return
+    from AthenaCommon.AppMgr import ToolSvc
+    from MCTruthClassifier import MCTruthClassifierConf
+    from ParticleJetTools import ParticleJetToolsConf
+    from JetRec import JetRecConf
+
+    ToolSvc += MCTruthClassifierConf.MCTruthClassifier("JetMCTruthClassifier",
+                                                       barcodeG4Shift=1000000) # or 200k? Doesn't matter anyway?
+                                                       #barcodeG4Shift=firstSimCreatedBarcode())
+
+    ToolSvc += ParticleJetToolsConf.CopyTruthJetParticles("truthpartcopy",
+                                                          OutputName="JetInputTruthParticles",
+                                                          MCTruthClassifier=ToolSvc.JetMCTruthClassifier,
+                                                          BarCodeFromMetadata=0)
+
+    ToolSvc += ParticleJetToolsConf.CopyTruthJetParticles("truthpartcopywz",
+                                                          OutputName="JetInputTruthParticlesNoWZ",
+                                                          MCTruthClassifier=ToolSvc.JetMCTruthClassifier,
+                                                          IncludePromptLeptons=False,
+                                                          #IncludePromptPhotons=False,
+                                                          BarCodeFromMetadata=0)
+
+    ToolSvc += ParticleJetToolsConf.CopyTruthPartons("truthpartonscopy",
+                                                     OutputName="TruthLabelPartons",
+                                                     PtMin=5000)
+
+    algseq += JetRecConf.JetAlgorithm("JetTruthCopyAlg", Tools=[ToolSvc.truthpartcopy,ToolSvc.truthpartcopywz,ToolSvc.truthpartonscopy])
+
+def ScheduleAntiKtTruthJets(jetradius,algseq,mods=""):
+    jetcollname = 'AntiKt{0}{1}TruthJets'.format(int(jetradius*10),mods)
+    if jetcollname in algseq: return
+    from AthenaCommon.AppMgr import ToolSvc
+    from JetRec import JetRecConf
+
+    if hasattr(algseq, 'JetAlg'+jetcollname):
+        jetlog.warning("Jet algorithm \"{0}\" already scheduled! Skipping...".format(jetcollname))
+        return
+
+    # Set up the PseudoJetGetter
+    pjget = None
+    if mods=="":
+        if "truthget" in ToolSvc:
+            pjget = ToolSvc.truthget
+        else:
+            pjget = JetRecConf.PseudoJetGetter("truthget",
+                                               Label = "Truth",
+                                               InputContainer = ToolSvc.truthpartcopy.OutputName,
+                                               OutputContainer = "PseudoJetTruth",
+                                               GhostScale = 0.0,
+                                               SkipNegativeEnergy = True
+                                               )
+    elif mods=="WZ":
+        if "truthwzget" in ToolSvc:
+            pjget = ToolSvc.truthwzget
+        else:
+            pjget = JetRecConf.PseudoJetGetter("truthwzget",
+                                               Label = "TruthWZ",
+                                               InputContainer = ToolSvc.truthpartcopywz.OutputName,
+                                               OutputContainer = "PseudoJetTruthWZ",
+                                               GhostScale = 0.0,
+                                               SkipNegativeEnergy = True,
+                                               )        
+    if pjget:
+        ToolSvc += pjget
+    else:
+        jetlog.error("Unsupported jet collection \"{0}\" requested!".format(jetcollname))
+
+    # Set up the jet builder (no area moments)
+    if not "jbld" in ToolSvc:
+        ToolSvc += JetRecConf.JetFromPseudojet("jbld")
+
+    # Set up the jet finder
+    finder = JetRecConf.JetFinder(jetcollname+"Finder",
+                                  JetAlgorithm = "AntiKt",
+                                  JetRadius = jetradius,
+                                  JetBuilder = ToolSvc.jbld,
+                                  GhostArea = 0.01,
+                                  PtMin = 5000
+                                  )
+    ToolSvc += finder
+
+    if "truthpartonget" in ToolSvc:
+        truthpartonget = ToolSvc.truthpartonget
+    else:
+        truthpartonget = JetRecConf.PseudoJetGetter("truthpartonget",
+                                                    Label = "GhostPartons",
+                                                    InputContainer = ToolSvc.truthpartonscopy.OutputName,
+                                                    OutputContainer = "PseudoJetGhostPartons",
+                                                    GhostScale = 1e-40,
+                                                    SkipNegativeEnergy = True,
+                                                    )
+        ToolSvc += truthpartonget
+
+
+    from ParticleJetTools import ParticleJetToolsConf
+    partontruthlabel = ParticleJetToolsConf.Analysis__JetPartonTruthLabel("partontruthlabel")
+    ToolSvc += partontruthlabel
+
+    #Now we setup a JetRecTool which will use the above JetFinder
+    jetrectool = JetRecConf.JetRecTool(jetcollname+"Rec",
+                                       JetFinder = finder,
+                                       PseudoJetGetters = [pjget,truthpartonget],
+                                       OutputContainer = jetcollname,
+                                       JetModifiers = [partontruthlabel]
+                                       )
+    ToolSvc += jetrectool
+
+    algseq += JetRecConf.JetAlgorithm(jetcollname+"Alg", Tools=[jetrectool])
+
+def ScheduleAntiKtTruthWZJets(jetradius,algseq):
+    ScheduleAntiKtTruthJets(jetradius,algseq,mods="WZ")
diff --git a/Generators/GeneratorFilters/share/common/HTFilter.py b/Generators/GeneratorFilters/share/common/HTFilter.py
new file mode 100644
index 000000000000..0ff5ecab5421
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/HTFilter.py
@@ -0,0 +1,16 @@
+## HT filter setup for anti-kT R=0.4 truth jets
+#include("GeneratorFilters/AntiKt4TruthWZJets.py")
+include ("GeneratorFilters/FindJets.py")
+CreateJets(prefiltSeq, 0.4,"WZ")
+
+from GeneratorFilters.GeneratorFiltersConf import HTFilter
+if "HTFilter" not in filtSeq:
+    filtSeq += HTFilter()
+
+filtSeq.HTFilter.MinJetPt = 20.*GeV # Min pT to consider jet in HT
+filtSeq.HTFilter.MaxJetEta = 999. # Max eta to consider jet in HT
+filtSeq.HTFilter.MinHT = 200.*GeV # Min HT to keep event
+filtSeq.HTFilter.MaxHT = 1000.*GeV # Max HT to keep event
+filtSeq.HTFilter.TruthJetContainer = "AntiKt4WZTruthJets" # Which jets to use for HT
+filtSeq.HTFilter.UseNeutrinosFromWZTau = False # Include neutrinos from W/Z/tau in the HT
+filtSeq.HTFilter.UseLeptonsFromWZTau = True # Include e/mu from W/Z/tau in the HT
diff --git a/Generators/GeneratorFilters/share/common/HeavyFlavorHadronFilter.py b/Generators/GeneratorFilters/share/common/HeavyFlavorHadronFilter.py
new file mode 100644
index 000000000000..117eb72cc153
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/HeavyFlavorHadronFilter.py
@@ -0,0 +1,37 @@
+## Example configuration for HeavyFlavorHadronFilter setting up defaults
+
+include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+include("GeneratorFilters/JetFilter_Fragment.py")
+
+if not hasattr( filtSeq, "HeavyFlavorHadronFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import HeavyFlavorHadronFilter
+    filtSeq += HeavyFlavorHadronFilter()
+    pass
+
+# Setup defaults as example
+"""
+HeavyFlavorHadronFilter = filtSeq.HeavyFlavorHadronFilter
+HeavyFlavorHadronFilter.CharmPtMin = 2.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.BottomPtMin = 5.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.CharmEtaMax = 3.0
+HeavyFlavorHadronFilter.BottomEtaMax = 3.0
+HeavyFlavorHadronFilter.cPtMin = 0.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.bPtMin = 0.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.cEtaMax = 5.0
+HeavyFlavorHadronFilter.bEtaMax = 5.0
+HeavyFlavorHadronFilter.JetPtMin = 20.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.JetEtaMax = 2.5
+HeavyFlavorHadronFilter.PDGPtMin = 2.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.PDGEtaMax = 2.5
+HeavyFlavorHadronFilter.PDGID = 0
+HeavyFlavorHadronFilter.PDGAntiParticleToo = True
+HeavyFlavorHadronFilter.RequestCharm = True
+HeavyFlavorHadronFilter.RequestBottom = True
+HeavyFlavorHadronFilter.Request_cQuark = True
+HeavyFlavorHadronFilter.Request_bQuark = True
+HeavyFlavorHadronFilter.RequestSpecificPDGID = False
+HeavyFlavorHadronFilter.RequireTruthJet = False
+HeavyFlavorHadronFilter.DeltaRFromTruth = 0.4
+HeavyFlavorHadronFilter.TruthContainerName = "AntiKt4TruthJets"
+"""
diff --git a/Generators/GeneratorFilters/share/common/JetFilter_JZX.py b/Generators/GeneratorFilters/share/common/JetFilter_JZX.py
new file mode 100644
index 000000000000..ee49f4ec0c9a
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/JetFilter_JZX.py
@@ -0,0 +1,25 @@
+## Truth jet filter common config for all JZx and JZxW
+
+#from xAODTruthCnv.xAODTruthCnvConf import xAODMaker__xAODTruthCnvAlg
+#if not hasattr(prefiltSeq, 'xAODCnv'):
+#    prefiltSeq += xAODMaker__xAODTruthCnvAlg('xAODCnv',WriteTruthMetaData=False)
+#prefiltSeq.xAODCnv.AODContainerName = 'GEN_EVENT'
+
+# Min and max momenta for the slices
+minDict = {0:-1,1:20,2:60,3:160,4:400,5:800,6:1300,7:1800,8:2500,9:3200,10:3900,11:4600,12:5300}
+maxDict = {0:20,1:60,2:160,3:400,4:800,5:1300,6:1800,7:2500,8:3200,9:3900,10:4600,11:5300,12:7000}
+
+def JZSlice(x,filtSeq):
+#    include("GeneratorFilters/GenerateTruthJets.py")
+##    from GenerateTruthJets import PrepareTruthJetInputs, ScheduleAntiKtTruthJets
+#    PrepareTruthJetInputs(prefiltSeq)
+#    ScheduleAntiKtTruthJets(jetradius=jetR,algseq=prefiltSeq)
+
+#    include("GeneratorFilters/QCDJetFilter.py") 
+##    from QCDJetFilter import AddJetFilter
+#    AddJetFilter(filtSeq,ecmEnergy)
+    
+    from AthenaCommon.SystemOfUnits import GeV
+#    filtSeq.QCDTruthJetFilter.TruthJetContainer = "AntiKt6TruthJets"
+    filtSeq.QCDTruthJetFilter.MinPt = minDict[x]*GeV
+    filtSeq.QCDTruthJetFilter.MaxPt = maxDict[x]*GeV
diff --git a/Generators/GeneratorFilters/share/common/LeadingDiBjetFilter.py b/Generators/GeneratorFilters/share/common/LeadingDiBjetFilter.py
new file mode 100644
index 000000000000..acce303417bb
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/LeadingDiBjetFilter.py
@@ -0,0 +1,24 @@
+## Example configuration for LeadingDiBjetFilter setting up defaults
+
+include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+include("GeneratorFilters/JetFilter_Fragment.py")
+
+if not hasattr( filtSeq, "LeadingDiBjetFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import LeadingDiBjetFilter
+    filtSeq += LeadingDiBjetFilter()
+    pass
+
+"""
+LeadingDiBjetFilter = filtSeq.LeadingDiBjetFilter
+LeadingDiBjetFilter.LeadJetPtMin = 0 * GeV 
+LeadingDiBjetFilter.LeadJetPtMax = 50000 *CLHEP::GeV
+LeadingDiBjetFilter.BottomPtMin = 5.0 *CLHEP::GeV
+LeadingDiBjetFilter.BottomEtaMax = 3.0
+LeadingDiBjetFilter.JetPtMin = 15.0 *CLHEP::GeV
+LeadingDiBjetFilter.JetEtaMax = 2.7
+LeadingDiBjetFilter.DeltaRFromTruth = 0.3
+LeadingDiBjetFilter.TruthContainerName = "AntiKt4TruthJets"
+LeadingDiBjetFilter.LightJetSuppressionFactor = 10
+LeadingDiBjetFilter.AcceptSomeLightEvents = False
+"""
diff --git a/Generators/GeneratorFilters/share/common/LeptonFilter.py b/Generators/GeneratorFilters/share/common/LeptonFilter.py
new file mode 100644
index 000000000000..33a3212806e4
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/LeptonFilter.py
@@ -0,0 +1,14 @@
+## Instantiate the lepton filter, including adding it to the stream 
+## Configuration of the filter cuts is left to the specific JO
+if not hasattr(filtSeq, "LeptonFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import LeptonFilter
+    filtSeq += LeptonFilter()
+
+## Add this filter to the algs required to be successful for streaming
+#if "LeptonFilter" not in StreamEVGEN.RequireAlgs:
+#    StreamEVGEN.RequireAlgs += ["LeptonFilter"]
+
+## Default cut params
+filtSeq.LeptonFilter.Ptcut = 10000.
+filtSeq.LeptonFilter.Etacut = 2.8
+
diff --git a/Generators/GeneratorFilters/share/common/LeptonPairFilterExample.py b/Generators/GeneratorFilters/share/common/LeptonPairFilterExample.py
new file mode 100644
index 000000000000..e83128ee86bc
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/LeptonPairFilterExample.py
@@ -0,0 +1,25 @@
+# Example of LeptonPairFilter configuration as used in MadGraphControl_SimplifiedModel_BB_tC1.py
+
+evgenLog.info('Using LeptonPairFilter accepting SS lepton pairs with massive parents')
+from GeneratorFilters.GeneratorFiltersConf import LeptonPairFilter
+filtSeq += LeptonPairFilter('SS3LFilter')
+myFilter = filtSeq.SS3LFilter
+myFilter.NLeptons_Min = 0
+myFilter.NLeptons_Max = -1
+myFilter.Ptcut = 10000
+myFilter.Etacut = 2.8
+myFilter.NSFOS_Min = -1
+myFilter.NSFOS_Max = -1
+myFilter.NOFOS_Min = -1
+myFilter.NOFOS_Max = -1
+myFilter.NSFSS_Min = -1
+myFilter.NSFSS_Max = -1
+myFilter.NOFSS_Min = -1
+myFilter.NOFSS_Max = -1
+myFilter.NPairSum_Max = -1
+myFilter.NPairSum_Min = 1
+myFilter.UseSFOSInSum = False
+myFilter.UseSFSSInSum = True
+myFilter.UseOFOSInSum = False
+myFilter.UseOFSSInSum = True
+myFilter.OnlyMassiveParents = True
diff --git a/Generators/GeneratorFilters/share/common/Lund_Hadronisation.py b/Generators/GeneratorFilters/share/common/Lund_Hadronisation.py
new file mode 100644
index 000000000000..00461907d6bd
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/Lund_Hadronisation.py
@@ -0,0 +1,7 @@
+genSeq.Sherpa_i.Parameters += [
+  "FRAGMENTATION=Lund",
+  "DECAYMODEL=Lund",
+  "PARJ(21)=0.36",
+  "PARJ(41)=0.3",
+  "PARJ(42)=0.6"
+]
diff --git a/Generators/GeneratorFilters/share/common/MassRangeFilter.py b/Generators/GeneratorFilters/share/common/MassRangeFilter.py
new file mode 100644
index 000000000000..fe5353642dd3
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MassRangeFilter.py
@@ -0,0 +1,19 @@
+## Example configuration for MassRangeFilter setting up defaults
+
+if not hasattr( filtSeq, "MassRangeFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import MassRangeFilter
+    filtSeq += MassRangeFilter()
+    pass
+
+"""
+MassRangeFilter = filtSeq.MassRangeFilter
+MassRangeFilter.PtCut = 10000.
+MassRangeFilter.PtCut2 = 10000.
+MassRangeFilter.EtaCut = 10.
+MassRangeFilter.EtaCut2 = 10.
+MassRangeFilter.InvMassMin = 0.
+MassRangeFilter.InvMassMax = 14000000.
+MassRangeFilter.PartId = 13
+MassRangeFilter.PartId2 = 13
+MassRangeFilter.PartStatus = 1
+"""
diff --git a/Generators/GeneratorFilters/share/common/MissingEtFilter.py b/Generators/GeneratorFilters/share/common/MissingEtFilter.py
new file mode 100644
index 000000000000..a65a40582d11
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MissingEtFilter.py
@@ -0,0 +1,12 @@
+if not hasattr(filtSeq, "MissingEtFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import MissingEtFilter
+    filtSeq += MissingEtFilter("MissingEtFilter")
+    
+if not hasattr(filtSeq, "MissingEtFilterUpperCut"):
+    filtSeq += MissingEtFilter("MissingEtFilterUpperCut")
+    
+filtSeq.MissingEtFilter.METCut = 60*GeV
+filtSeq.MissingEtFilterUpperCut.METCut = 100000*GeV
+
+
+filtSeq.Expression = "(MissingEtFilter and not MissingEtFilterUpperCut)"
diff --git a/Generators/GeneratorFilters/share/common/MultiElecMuTauFilter.py b/Generators/GeneratorFilters/share/common/MultiElecMuTauFilter.py
new file mode 100644
index 000000000000..42a7cea45754
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MultiElecMuTauFilter.py
@@ -0,0 +1,18 @@
+##
+## Example configuration for MultiElecMuTauFilter setting up defaults
+##
+ 
+if not hasattr(filtSeq, "MultiElecMuTauFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import MultiElecMuTauFilter
+    filtSeq += MultiElecMuTauFilter()
+    pass
+
+# Setup defaults as example
+"""
+MultiElecMuTauFilter = filtSeq.MultiElecMuTauFilter
+MultiElecMuTauFilter.NLeptons  = 3
+MultiElecMuTauFilter.MaxEta = 10.0
+MultiElecMuTauFilter.MinPt = 5000.0
+MultiElecMuTauFilter.MinVisPtHadTau = 10000.0
+MultiElecMuTauFilter.IncludeHadTaus = True
+"""
diff --git a/Generators/GeneratorFilters/share/common/MultiLeptonFilter.py b/Generators/GeneratorFilters/share/common/MultiLeptonFilter.py
new file mode 100644
index 000000000000..61b52f64994a
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MultiLeptonFilter.py
@@ -0,0 +1,13 @@
+## Example configuration for MultiLeptonFilter setting up defaults
+
+if not hasattr( filtSeq, "MultiLeptonFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import MultiLeptonFilter
+    filtSeq += MultiLeptonFilter()
+    pass
+
+"""
+MultiLeptonFilter = filtSeq.MultiLeptonFilter
+MultiLeptonFilter.Ptcut = 10000.
+MultiLeptonFilter.Etacut = 10.0
+MultiLeptonFilter.NLeptons = 4
+"""
diff --git a/Generators/GeneratorFilters/share/common/MultiMuonFilter.py b/Generators/GeneratorFilters/share/common/MultiMuonFilter.py
new file mode 100644
index 000000000000..2aa4b5d5da54
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MultiMuonFilter.py
@@ -0,0 +1,14 @@
+## Example configuration for MultiMuonFilter setting up defaults
+
+if not hasattr( filtSeq, "MultiMuonFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import MultiMuonFilter
+    filtSeq += MultiMuonFilter()
+    pass
+
+"""
+MultiMuonFilter = filtSeq.MultiMuonFilter
+MultiMuonFilter.Ptcut = 4000.
+MultiMuonFilter.Etacut = 2.7
+MultiMuonFilter.NMuons = 4
+"""
+ 
diff --git a/Generators/GeneratorFilters/share/common/MultiParticleFilter.py b/Generators/GeneratorFilters/share/common/MultiParticleFilter.py
new file mode 100644
index 000000000000..f2d67c0a3a44
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MultiParticleFilter.py
@@ -0,0 +1,17 @@
+## Example configuration for MultiParticleFilter setting up defaults
+
+if not hasattr( filtSeq, "MultiParticleFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import MultiParticleFilter
+    filtSeq += MultiParticleFilter()
+    pass
+
+## Setup defaults as example
+"""
+MultiParticleFilter = filtSeq.MultiParticleFilter
+MultiParticleFilter.Np = 1
+MultiParticleFilter.ptMinParticle = 105000.
+MultiParticleFilter.etaRangeParticle = 4.9
+MultiParticleFilter.particlePDG = [11,-11,22]
+MultiParticleFilter.particleStatus = [1]
+"""
+
diff --git a/Generators/GeneratorFilters/share/common/NNPDF30NNLO.py b/Generators/GeneratorFilters/share/common/NNPDF30NNLO.py
new file mode 100644
index 000000000000..8ed2075b408a
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/NNPDF30NNLO.py
@@ -0,0 +1,8 @@
+evgenConfig.tune = "NNPDF3.0 NNLO"
+
+genSeq.Sherpa_i.Parameters += [
+    "PDF_LIBRARY=LHAPDFSherpa",
+    "USE_PDF_ALPHAS=1",
+    "PDF_SET=NNPDF30_nnlo_as_0118_hessian",
+    "PDF_VARIATIONS=NNPDF30_nnlo_as_0118_hessian[all] NNPDF30_nnlo_as_0117 NNPDF30_nnlo_as_0119 MMHT2014nnlo68cl CT14nnlo PDF4LHC15_nnlo_30_pdfas[all] NNPDF31_nnlo_as_0118_hessian",
+    ]
diff --git a/Generators/GeneratorFilters/share/common/NNPDF30NNLO_nf_4.py b/Generators/GeneratorFilters/share/common/NNPDF30NNLO_nf_4.py
new file mode 100644
index 000000000000..44bdff859c51
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/NNPDF30NNLO_nf_4.py
@@ -0,0 +1,8 @@
+evgenConfig.tune = "NNPDF3.0 NNLO"
+
+genSeq.Sherpa_i.Parameters += [
+    "PDF_LIBRARY=LHAPDFSherpa",
+    "USE_PDF_ALPHAS=1",
+    "PDF_SET=NNPDF30_nnlo_as_0118_nf_4",
+    "PDF_VARIATIONS=NNPDF30_nnlo_as_0118_nf_4[all] NNPDF30_nnlo_as_0117_nf_4 NNPDF30_nnlo_as_0119_nf_4 MMHT2014nnlo68cl_nf4 CT14nnlo_NF4 PDF4LHC15_nlo_nf4_30[all]",
+    ]
diff --git a/Generators/GeneratorFilters/share/common/ParentChildwStatusFilter.py b/Generators/GeneratorFilters/share/common/ParentChildwStatusFilter.py
new file mode 100644
index 000000000000..ccdd94608b91
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/ParentChildwStatusFilter.py
@@ -0,0 +1,15 @@
+if not hasattr(filtSeq, "ParentChildwStatusFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import ParentChildwStatusFilter
+    filtSeq += ParentChildwStatusFilter("ParentChildwStatusFilter")
+
+## Example usage for Z leptonic decay from Pythia8
+#filtSeq.ParentChildwStatusFilter.PDGParent  = [23]
+#filtSeq.ParentChildwStatusFilter.StatusParent = [22,52]
+#filtSeq.ParentChildwStatusFilter.PtMinParent =  -1e12
+#filtSeq.ParentChildwStatusFilter.PtMaxParent = 1e12
+#filtSeq.ParentChildwStatusFilter.EtaRangeParent = 1e12
+#filtSeq.ParentChildwStatusFilter.MassMinParent = -1e12
+#filtSeq.ParentChildwStatusFilter.MassMaxParent = 1e12
+#filtSeq.ParentChildwStatusFilter.PDGChild = [11,13,15]
+#filtSeq.ParentChildwStatusFilter.PtMinChild = -1e12
+#filtSeq.ParentChildwStatusFilter.EtaRangeChild = 1e12
diff --git a/Generators/GeneratorFilters/share/common/ParticleFilter.py b/Generators/GeneratorFilters/share/common/ParticleFilter.py
new file mode 100644
index 000000000000..a5eaeb003bc9
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/ParticleFilter.py
@@ -0,0 +1,11 @@
+if not hasattr(filtSeq, "ParticleFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import ParticleFilter
+    filtSeq += ParticleFilter("ParticleFilter")
+
+# Example usage of this filter
+#ParticleFilter = filtSeq.ParticleFilter
+#ParticleFilter.Ptcut = 0.0
+#ParticleFilter.Etacut = 10.0
+#ParticleFilter.PDG = 1000022
+#ParticleFilter.MinParts = 2
+#ParticleFilter.StatusReq = 11
diff --git a/Generators/GeneratorFilters/share/common/QCDJetFilter.py b/Generators/GeneratorFilters/share/common/QCDJetFilter.py
new file mode 100644
index 000000000000..9cd14f069cc6
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/QCDJetFilter.py
@@ -0,0 +1,11 @@
+## Default truth jet filter setup
+## The specified truth jet container must exist
+
+def AddJetFilter(filtSeq,ecmEnergy):	
+    from GeneratorFilters.GeneratorFiltersConf import QCDTruthJetFilter
+    if "QCDTruthJetFilter" not in filtSeq:
+        from AthenaCommon.SystemOfUnits import GeV
+        filtSeq += QCDTruthJetFilter()
+        filtSeq.QCDTruthJetFilter.MaxPt = float(ecmEnergy)*GeV
+
+
diff --git a/Generators/GeneratorFilters/share/common/QCDTruthJetFilter.py b/Generators/GeneratorFilters/share/common/QCDTruthJetFilter.py
new file mode 100644
index 000000000000..ba32f597cba6
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/QCDTruthJetFilter.py
@@ -0,0 +1,7 @@
+## Example configuration for QCDTruthJetFilter setting up defaults
+
+include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+include("GeneratorFilters/JetFilter_Fragment.py")
+
+
diff --git a/Generators/GeneratorFilters/share/common/QCDTruthMultiJetFilter.py b/Generators/GeneratorFilters/share/common/QCDTruthMultiJetFilter.py
new file mode 100644
index 000000000000..e3404db150e9
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/QCDTruthMultiJetFilter.py
@@ -0,0 +1,21 @@
+## Example configuration for QCDTruthMultiJetFilter setting up defaults
+
+include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+include("GeneratorFilters/JetFilter_Fragment.py")
+
+if not hasattr( filtSeq, "QCDTruthMultiJetFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import QCDTruthMultiJetFilter
+    filtSeq += QCDTruthMultiJetFilter()
+    pass
+
+"""
+QCDTruthMultiJetFilter = filtSeq.QCDTruthMultiJetFilter
+QCDTruthMultiJetFilter.Njet = -1
+QCDTruthMultiJetFilter.NjetMinPt = 0. *Gaudi::Units::GeV
+QCDTruthMultiJetFilter.MinLeadJetPt = 0. *Gaudi::Units::GeV
+QCDTruthMultiJetFilter.MaxLeadJetPt = 7000. *Gaudi::Units::GeV # , LHC kinematic limit...
+QCDTruthMultiJetFilter.MaxEta = 10.0
+QCDTruthMultiJetFilter.TruthJetContainer = "AntiKt4TruthJets"
+QCDTruthMultiJetFilter.DoShape = True
+"""
diff --git a/Generators/GeneratorFilters/share/common/TTbarLJetsVptFilter.py b/Generators/GeneratorFilters/share/common/TTbarLJetsVptFilter.py
new file mode 100644
index 000000000000..e52756aa412c
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/TTbarLJetsVptFilter.py
@@ -0,0 +1,12 @@
+## Instantiate the TTbarWToLeptonFilter, including adding it to the stream requirement
+
+if not hasattr(filtSeq, "TTbarLJetsVptFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import TTbarLJetsVptFilter
+    filtSeq += TTbarLJetsVptFilter()
+
+filtSeq.TTbarLJetsVptFilter.NumLeptons = 1
+filtSeq.TTbarLJetsVptFilter.Ptcut =  22000.
+filtSeq.TTbarLJetsVptFilter.Etacut=  3.0
+filtSeq.TTbarLJetsVptFilter.VptMin= 100000
+#filtSeq.TTbarLJetsVptFilter.VptMax= 300000
+filtSeq.TTbarLJetsVptFilter.FollowTaus=True
diff --git a/Generators/GeneratorFilters/share/common/TTbarWToLeptonFilter.py b/Generators/GeneratorFilters/share/common/TTbarWToLeptonFilter.py
new file mode 100644
index 000000000000..ed13b82c58db
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/TTbarWToLeptonFilter.py
@@ -0,0 +1,15 @@
+## Instantiate the TTbarWToLeptonFilter, including adding it to the stream requirement
+## Filter passed if top, antitop and t->W->e/mu/tau in truth chain
+## Configuration of the filter cuts is left to the specific JO
+## christoph.wasicki@cern.ch
+
+if not hasattr(filtSeq, "TTbarWToLeptonFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import TTbarWToLeptonFilter
+    filtSeq += TTbarWToLeptonFilter()
+
+## Add this filter to the algs required to be successful for streaming
+#if "TTbarWToLeptonFilter" not in StreamEVGEN.RequireAlgs:
+#    StreamEVGEN.RequireAlgs += ["TTbarWToLeptonFilter"]
+
+## Default cut params
+filtSeq.TTbarWToLeptonFilter.Ptcut = 1.
diff --git a/Generators/GeneratorFilters/share/common/TTbarWithJpsimumuFilter.py b/Generators/GeneratorFilters/share/common/TTbarWithJpsimumuFilter.py
new file mode 100644
index 000000000000..d6756a0a954d
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/TTbarWithJpsimumuFilter.py
@@ -0,0 +1,10 @@
+## Instantiate the TTbarWithJpsimumuFilter, including adding it to the stream requirement
+## Filter passed if top, antitop and t->b->J/psi->mumu in truth chain
+## Configuration of the filter cuts is left to the specific JO
+
+if not hasattr(filtSeq, "TTbarWithJpsimumuFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import TTbarWithJpsimumuFilter
+    filtSeq += TTbarWithJpsimumuFilter()
+
+## Default cut params
+filtSeq.TTbarWithJpsimumuFilter.JpsipTMinCut = 5000.
\ No newline at end of file
diff --git a/Generators/GeneratorFilters/share/common/TransverseMassVVFilter.py b/Generators/GeneratorFilters/share/common/TransverseMassVVFilter.py
new file mode 100644
index 000000000000..a61c059e8a6f
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/TransverseMassVVFilter.py
@@ -0,0 +1,13 @@
+## Example configuration for TransverseMassVVFilter setting up defaults
+
+if not hasattr( filtSeq, "TransverseMassVVFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import TransverseMassVVFilter
+    filtSeq += TransverseMassVVFilter()
+    pass
+
+"""
+TransverseMassVVFilter = filtSeq.TransverseMassVVFilter
+TransverseMassVVFilter.MinMass = 4000.
+TransverseMassVVFilter.MaxMass = 10000.
+"""
+ 
diff --git a/Generators/GeneratorFilters/share/common/VBFForwardJetsFilter.py b/Generators/GeneratorFilters/share/common/VBFForwardJetsFilter.py
new file mode 100644
index 000000000000..a0e532719233
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/VBFForwardJetsFilter.py
@@ -0,0 +1,33 @@
+## Example configuration for VBFForwardJetsFilter setting up defaults
+
+#include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+#include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+#include("GeneratorFilters/JetFilter_Fragment.py")
+include ("GeneratorFilters/FindJets.py")
+CreateJets(prefiltSeq, 0.6)
+AddJetsFilter(filtSeq,runArgs.ecmEnergy, 0.6)
+
+if not hasattr( filtSeq, "VBFForwardJetsFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import VBFForwardJetsFilter
+    filtSeq += VBFForwardJetsFilter()
+    pass
+
+"""
+VBFForwardJetsFilter = filtSeq.VBFForwardJetsFilter
+VBFForwardJetsFilter.JetMinPt = 10.*Gaudi::Units::GeV
+VBFForwardJetsFilter.JetMaxEta = 5.
+VBFForwardJetsFilter.NJets = 2
+VBFForwardJetsFilter.Jet1MinPt = 20.*Gaudi::Units::GeV
+VBFForwardJetsFilter.Jet1MaxEta = 5.
+VBFForwardJetsFilter.Jet2MinPt = 10.*Gaudi::Units::GeV
+VBFForwardJetsFilter.Jet2MaxEta = 5.
+VBFForwardJetsFilter.UseOppositeSignEtaJet1Jet2 = False
+VBFForwardJetsFilter.MassJJ = 300.*Gaudi::Units::GeV
+VBFForwardJetsFilter.DeltaEtaJJ = 2.0
+VBFForwardJetsFilter.UseLeadingJJ = False
+VBFForwardJetsFilter.TruthJetContainer = "AntiKt4TruthJets"
+VBFForwardJetsFilter.LGMinPt = 10.*Gaudi::Units::GeV
+VBFForwardJetsFilter.LGMaxEta = 2.5
+VBFForwardJetsFilter.DeltaRJLG = 0.05
+VBFForwardJetsFilter.RatioPtJLG = 0.3
+"""
diff --git a/Generators/Sherpa_i/share/Example/MC15.999999.Sherpa_Example.py b/Generators/Sherpa_i/share/Example/MC15.999999.Sherpa_Example.py
deleted file mode 100644
index e06d487ac4fe..000000000000
--- a/Generators/Sherpa_i/share/Example/MC15.999999.Sherpa_Example.py
+++ /dev/null
@@ -1,18 +0,0 @@
-include("MC15JobOptions/Sherpa_NNPDF30NNLO_Common.py")
-
-evgenConfig.description = "Sherpa 2.2.x example JO, Z+0,1-jet production."
-evgenConfig.keywords = [ "Example", "DrellYan" ]
-evgenConfig.contact  = [ "atlas-generators-sherpa@cern.ch", "frank.siegert@cern.ch"]
-
-sherpaRunCard="""
-(processes){
-  Process 93 93 -> 11 -11 93{1}
-  Order (*,2)
-  CKKW sqr(20/E_CMS)
-  End process;
-}(processes)
-
-(selector){
-  Mass 11 -11 40 E_CMS
-}(selector)
-"""
diff --git a/Generators/Sherpa_i/share/common/Base_Fragment.py b/Generators/Sherpa_i/share/common/Base_Fragment.py
new file mode 100644
index 000000000000..acb690d89d7b
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/Base_Fragment.py
@@ -0,0 +1,131 @@
+## Base config for Sherpa
+from Sherpa_i.Sherpa_iConf import Sherpa_i
+genSeq += Sherpa_i()
+evgenConfig.generators = ["Sherpa"]
+genSeq.Sherpa_i.PluginCode = ""
+
+## Tell Sherpa to read its run card sections from the jO
+## TODO: write out Run.dat from genSeq.Sherpa_i.RunCard and read from it
+## instead of the JO
+genSeq.Sherpa_i.Parameters += [ 'RUNDATA=%s' % runArgs.jobConfig[0] ]
+
+## Tell Sherpa to write logs into a separate file
+## (need for production, looping job detection, Wolfgang Ehrenfeld)
+genSeq.Sherpa_i.Parameters += [ 'LOG_FILE=sherpa.log' ]
+
+## General ATLAS parameters
+genSeq.Sherpa_i.Parameters += [
+    "BEAM_1=2212",
+    "BEAM_2=2212",
+    "MAX_PROPER_LIFETIME=10.0",
+    "HEPMC_TREE_LIKE=1",
+    "PRETTY_PRINT=Off",
+    ]
+
+## Cap event weights at |w|<10 in unweighted evgen; set H-event shower mode
+## in the soft region to avoid instable weights 
+genSeq.Sherpa_i.Parameters += [
+    "OVERWEIGHT_THRESHOLD=10",
+    "PP_HPSMODE=0"
+]
+
+## Enable scale variations by default
+genSeq.Sherpa_i.Parameters += [
+    "HEPMC_USE_NAMED_WEIGHTS=1",
+    "CSS_REWEIGHT=1",
+    "REWEIGHT_SPLITTING_PDF_SCALES=1",
+    "REWEIGHT_SPLITTING_ALPHAS_SCALES=1",
+    "CSS_REWEIGHT_SCALE_CUTOFF=5.0",
+    "HEPMC_INCLUDE_ME_ONLY_VARIATIONS=1",
+    "SCALE_VARIATIONS=0.25,0.25 0.25,1. 1.,0.25 1.,1. 1.,4. 4.,1. 4.,4.",
+]
+
+## Switch to EW_SCHEME=0 to be able to set PDG value of thetaW
+genSeq.Sherpa_i.Parameters += [ "EW_SCHEME=0" ]
+
+try:
+    USE_PDG_VALUES
+except NameError:
+    USE_PDG_VALUES = False
+## if USE_PDG_VALUES = True, load PDG value 
+## of sin2thetaW and particle masses/widths 
+## from parameter dictionary located in 
+## EvgenProdTools/python/offline_dict.py 
+## ToDo: Include partial widths for H/W/Z?
+recorded = []
+if USE_PDG_VALUES:
+    from EvgenProdTools.offline_dict import parameters
+    for k,v in parameters.items():
+        if k == 'particles':
+            for key,value in v.items():
+                if 5 < int(key) and int(key) < 26:
+                    ## This includes now the top quark, 
+                    ## the leptons and the bosons
+                    genSeq.Sherpa_i.Parameters += [ 
+                        'MASS['+key+']='+ value['mass'],
+                        'WIDTH['+key+']='+ value['width'],
+                    ]
+                    recorded.append(key)
+        elif k == 'EW_parameters':
+            for key,value in v.items():
+                if key[0] == 'SIN2THETAW':
+                    genSeq.Sherpa_i.Parameters += [
+                        str(key[0])+'='+str(value),
+                    ]
+                    recorded.append(str(key[0]))
+                    break
+
+# Fall-back to the MC15 default values if need be
+defaults = {
+    '6'  : [ "MASS[6]=172.5",    "WIDTH[6]=1.32"         ],
+    '15' : [ "MASS[15]=1.777",   "WIDTH[15]=2.26735e-12" ],
+    '23' : [ "MASS[23]=91.1876", "WIDTH[23]=2.4952"      ],
+    '24' : [ "MASS[24]=80.399",  "WIDTH[24]=2.085"       ],
+    'SIN2THETAW' : [ "SIN2THETAW=0.23113" ],
+}
+for key, value in defaults.items():
+  if key not in recorded:
+    genSeq.Sherpa_i.Parameters += value
+
+
+
+## set/add partial widths for H, W, Z to PDG values
+## cf. https://sherpa.hepforge.org/doc/SHERPA-MC-2.2.4.html#HDH_005fWIDTH
+genSeq.Sherpa_i.Parameters += [
+    "HDH_WIDTH[6,24,5]=1.32",    #updated to comply latest updated top results
+    "HDH_WIDTH[-6,-24,-5]=1.32",  #updated to comply latest updated top results
+    "HDH_WIDTH[25,5,-5]=2.35e-3",
+    "HDH_WIDTH[25,15,-15]=2.57e-4",
+    "HDH_WIDTH[25,13,-13]=8.91e-7",
+    "HDH_WIDTH[25,4,-4]=1.18e-4",
+    "HDH_WIDTH[25,3,-3]=1.00e-6",
+    "HDH_WIDTH[25,21,21]=3.49e-4",
+    "HDH_WIDTH[25,22,22]=9.28e-6",
+    "HDH_WIDTH[24,2,-1]=0.7041",
+    "HDH_WIDTH[24,4,-3]=0.7041",
+    "HDH_WIDTH[24,12,-11]=0.2256",
+    "HDH_WIDTH[24,14,-13]=0.2256",
+    "HDH_WIDTH[24,16,-15]=0.2256",
+    "HDH_WIDTH[-24,-2,1]=0.7041",
+    "HDH_WIDTH[-24,-4,3]=0.7041",
+    "HDH_WIDTH[-24,-12,11]=0.2256",
+    "HDH_WIDTH[-24,-14,13]=0.2256",
+    "HDH_WIDTH[-24,-16,15]=0.2256",
+    "HDH_WIDTH[23,1,-1]=0.3828",
+    "HDH_WIDTH[23,2,-2]=0.2980",
+    "HDH_WIDTH[23,3,-3]=0.3828",
+    "HDH_WIDTH[23,4,-4]=0.2980",
+    "HDH_WIDTH[23,5,-5]=0.3828",
+    "HDH_WIDTH[23,11,-11]=0.0840",
+    "HDH_WIDTH[23,12,-12]=0.1663",
+    "HDH_WIDTH[23,13,-13]=0.0840",
+    "HDH_WIDTH[23,14,-14]=0.1663",
+    "HDH_WIDTH[23,15,-15]=0.0840",
+    "HDH_WIDTH[23,16,-16]=0.1663",
+    ]
+
+## OpenLoops parameters
+genSeq.Sherpa_i.Parameters += [
+    "OL_PREFIX=/cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/openloops/2.0.0/x86_64-slc6-gcc62-opt",
+    "OL_PARAMETERS=preset=2 write_parameters=1",
+]
diff --git a/Generators/Sherpa_i/share/common/EW_scheme_sinthetaW_mZ.py b/Generators/Sherpa_i/share/common/EW_scheme_sinthetaW_mZ.py
new file mode 100644
index 000000000000..01379742979f
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/EW_scheme_sinthetaW_mZ.py
@@ -0,0 +1,38 @@
+# Use EW scheme which allows specifying sinThetaW and mZ simultaneously at the expense of mW.
+# Three sub-options for specifying the QED coupling are introduced:
+#
+#    EW_SCHEME=20 for alpha(0), mZ, sinThetaW
+#    EW_SCHEME=21 for Gmu, mZ, sinThetaW
+#    EW_SCHEME=22 for alpha(mZ), mZ, sinThetaW
+
+genSeq.Sherpa_i.Parameters += [ "EW_SCHEME=22" ]
+
+try:
+    USE_PDG_VALUES
+except NameError:
+    USE_PDG_VALUES = False
+## if USE_PDG_VALUES = True, load PDG value of 
+## sin2thetaW from parameter dictionary located
+## in EvgenProdTools/python/offline_dict.py 
+if USE_PDG_VALUES:
+    from EvgenProdTools.offline_dict import parameters
+    for k,v in parameters.items():
+        if k == 'EW_parameters':
+            for key,value in v.items():
+                if key[0] == 'SIN2THETAW':
+                    genSeq.Sherpa_i.Parameters += [
+                        str(key[0])+'='+str(value),
+                    ]
+                    break
+            break
+if 'SIN2THETAW' not in genSeq.Sherpa_i.Parameters[-1]:
+    genSeq.Sherpa_i.Parameters += [ "SIN2THETAW=0.23113" ]
+
+
+## Overwrite OL_PREFIX to not use it from cvmfs (which doesn't have this scheme implemented yet)
+## Also adding OL_IGNORE_MODEL (default to SM) since the scheme names aren't synchronised yet
+genSeq.Sherpa_i.Parameters += [
+    "OL_PREFIX=./Process/OpenLoops",
+    "OL_PARAMETERS=ew_renorm_scheme 22 write_parameters 1",
+    "OL_IGNORE_MODEL=1",
+]
diff --git a/Generators/Sherpa_i/share/common/Fusing_Direct.py b/Generators/Sherpa_i/share/common/Fusing_Direct.py
new file mode 100644
index 000000000000..d88da593d536
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/Fusing_Direct.py
@@ -0,0 +1,10 @@
+# CAUTION: when including this, you have to set the following process-dependent setting in your JO:
+# If two strong couplings are involved at Born level, `FUSING_DIRECT_FACTOR=1` (e.g. Zbb).
+# If there are four such couplings, `FUSING_DIRECT_FACTOR=2` (e.g. ttbb).
+
+# taken from Sherpa examples: Examples/V_plus_Bs/LHC_Fusing/
+
+genSeq.Sherpa_i.Parameters += [ "SHERPA_LDADD=SherpaFusing",
+                                "USERHOOK=Fusing_Direct",
+                                "CSS_SCALE_SCHEME=20",
+                                "CSS_EVOLUTION_SCHEME=30", ]
diff --git a/Generators/Sherpa_i/share/common/Fusing_Fragmentation.py b/Generators/Sherpa_i/share/common/Fusing_Fragmentation.py
new file mode 100644
index 000000000000..a3739a60ff02
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/Fusing_Fragmentation.py
@@ -0,0 +1,8 @@
+# taken from Sherpa examples: Examples/V_plus_Bs/LHC_Fusing/
+
+genSeq.Sherpa_i.Parameters += [ "SHERPA_LDADD=SherpaFusing",
+                                "USERHOOK=Fusing_Fragmentation",
+                                "CSS_SCALE_SCHEME=20",
+                                "CSS_EVOLUTION_SCHEME=30",
+                                "FUSING_FRAGMENTATION_STORE_AS_WEIGHT=1",
+]
diff --git a/Generators/Sherpa_i/share/common/Lund_Hadronisation.py b/Generators/Sherpa_i/share/common/Lund_Hadronisation.py
new file mode 100644
index 000000000000..00461907d6bd
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/Lund_Hadronisation.py
@@ -0,0 +1,7 @@
+genSeq.Sherpa_i.Parameters += [
+  "FRAGMENTATION=Lund",
+  "DECAYMODEL=Lund",
+  "PARJ(21)=0.36",
+  "PARJ(41)=0.3",
+  "PARJ(42)=0.6"
+]
diff --git a/Generators/Sherpa_i/share/common/NNPDF30NNLO.py b/Generators/Sherpa_i/share/common/NNPDF30NNLO.py
new file mode 100644
index 000000000000..8ed2075b408a
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/NNPDF30NNLO.py
@@ -0,0 +1,8 @@
+evgenConfig.tune = "NNPDF3.0 NNLO"
+
+genSeq.Sherpa_i.Parameters += [
+    "PDF_LIBRARY=LHAPDFSherpa",
+    "USE_PDF_ALPHAS=1",
+    "PDF_SET=NNPDF30_nnlo_as_0118_hessian",
+    "PDF_VARIATIONS=NNPDF30_nnlo_as_0118_hessian[all] NNPDF30_nnlo_as_0117 NNPDF30_nnlo_as_0119 MMHT2014nnlo68cl CT14nnlo PDF4LHC15_nnlo_30_pdfas[all] NNPDF31_nnlo_as_0118_hessian",
+    ]
diff --git a/Generators/Sherpa_i/share/common/NNPDF30NNLO_nf_4.py b/Generators/Sherpa_i/share/common/NNPDF30NNLO_nf_4.py
new file mode 100644
index 000000000000..44bdff859c51
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/NNPDF30NNLO_nf_4.py
@@ -0,0 +1,8 @@
+evgenConfig.tune = "NNPDF3.0 NNLO"
+
+genSeq.Sherpa_i.Parameters += [
+    "PDF_LIBRARY=LHAPDFSherpa",
+    "USE_PDF_ALPHAS=1",
+    "PDF_SET=NNPDF30_nnlo_as_0118_nf_4",
+    "PDF_VARIATIONS=NNPDF30_nnlo_as_0118_nf_4[all] NNPDF30_nnlo_as_0117_nf_4 NNPDF30_nnlo_as_0119_nf_4 MMHT2014nnlo68cl_nf4 CT14nnlo_NF4 PDF4LHC15_nlo_nf4_30[all]",
+    ]
diff --git a/Generators/Sherpa_i/share/example/999999/mc.Sh_Example.py b/Generators/Sherpa_i/share/example/999999/mc.Sh_Example.py
new file mode 100644
index 000000000000..9d26dec441f4
--- /dev/null
+++ b/Generators/Sherpa_i/share/example/999999/mc.Sh_Example.py
@@ -0,0 +1,27 @@
+include("Sherpa_i/Base_Fragment.py")
+include("Sherpa_i/NNPDF30NNLO.py")
+
+evgenConfig.description = "Sherpa 2.2.x example JO, Z+0,1-jet production."
+evgenConfig.keywords = [ "2lepton" ]
+evgenConfig.contact  = [ "atlas-generators-sherpa@cern.ch", "frank.siegert@cern.ch"]
+evgenConfig.nEventsPerJob = 10000
+
+genSeq.Sherpa_i.RunCard="""
+(processes){
+  Process 93 93 -> 11 -11 93{1}
+  Order (*,2)
+  CKKW sqr(20/E_CMS)
+  End process;
+}(processes)
+
+(selector){
+  Mass 11 -11 40 E_CMS
+}(selector)
+"""
+
+genSeq.Sherpa_i.Parameters += []
+genSeq.Sherpa_i.OpenLoopsLibs = []
+genSeq.Sherpa_i.ExtraFiles = []
+genSeq.Sherpa_i.NCores = 1
+
+genSeq.Sherpa_i.CleanupGeneratedFiles = 1
diff --git a/Generators/Sherpa_i/share/Example/README b/Generators/Sherpa_i/share/example/README
similarity index 52%
rename from Generators/Sherpa_i/share/Example/README
rename to Generators/Sherpa_i/share/example/README
index b4e3651fcb0d..260f3493a535 100644
--- a/Generators/Sherpa_i/share/Example/README
+++ b/Generators/Sherpa_i/share/example/README
@@ -1,5 +1,5 @@
 Please refer to
 
-  https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/SherpaForAtlas#MC12
+  https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/SherpaForAtlas
 
-for information and instructions on how to use Sherpa JOs.
+for more information about Sherpa JOs.
diff --git a/Generators/Sherpa_i/share/validation/SherpaTest.cc b/Generators/Sherpa_i/share/validation/SherpaTest.cc
new file mode 100644
index 000000000000..908c808e24ce
--- /dev/null
+++ b/Generators/Sherpa_i/share/validation/SherpaTest.cc
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+#include "Rivet/Analysis.hh"
+#include "HepMC/GenEvent.h"
+
+namespace Rivet {
+
+  /// @brief Analysis for testing trivial reweighting
+  class SherpaTest : public Analysis {
+  public:
+
+    /// @name Constructors etc.
+    //@{
+
+    /// Constructor
+    SherpaTest()
+      : Analysis("SherpaTest")
+    {    }
+
+    //@}
+
+
+  public:
+
+    /// @name Analysis methods
+    //@{
+
+    /// Book histograms before the run
+    void init() {
+      _h_enW  = bookHisto1D("NomEqualsTrivWeightVariationMUR1_MUF1_PDF261000", 2, -0.5, 1.5);
+      _h_enW2  = bookHisto1D("LessThan1e-14RelativeDiffNomTrivWeightVariationMUR1_MUF1_PDF261000", 2, -0.5, 1.5);
+      _h_enW3  = bookHisto1D("LessThan1e-12RelativeDiffNomTrivWeightVariationMUR1_MUF1_PDF261000", 2, -0.5, 1.5);
+    }
+
+
+    /// Perform the per-event analysis
+    void analyze(const Event& event) {
+      double trivWeight = event.genEvent()->weights()["MUR1_MUF1_PDF261000"];
+      double Weight     = event.weight();//= event.genEvent()->weights()["Weight"];
+      _h_enW ->fill((trivWeight==Weight ? 1. : 0.), 1.);
+      double presicion  = 1e-14;
+      double presicion3 = 1e-12;      
+      _h_enW2 ->fill((abs(trivWeight/Weight-1) < presicion ? 1. : 0.), 1.);      
+      _h_enW3 ->fill((abs(trivWeight/Weight-1) < presicion3 ? 1. : 0.), 1.);      
+      /*if (abs(trivWeight/Weight-1) > 1e-16) {
+        std::cout << "Weight:              " << Weight <<std::endl;
+        std::cout << "trivWeight:          " << trivWeight <<std::endl;
+        std::cout << "trivWeight-Weight:   " << trivWeight-Weight <<std::endl;
+        std::cout << "trivWeight/Weight-1: " << trivWeight/Weight-1 <<std::endl;
+        std::cout << "abs(trivWeight/Weight-1): " << abs(trivWeight/Weight-1) <<std::endl;
+        }*/
+    }
+
+
+    /// Normalise histograms etc., after the run
+    void finalize() {
+    }
+
+    //@}
+
+
+  private:
+
+    /// @name Histograms
+    Histo1DPtr _h_enW;
+    Histo1DPtr _h_enW2;
+    Histo1DPtr _h_enW3;
+  };
+
+
+  // The hook for the plugin system
+  DECLARE_RIVET_PLUGIN(SherpaTest);
+
+}
-- 
GitLab


From 241bb1d2db6c41da3683a706db5868a083068564 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 11 Sep 2020 17:06:18 -0400
Subject: [PATCH 162/422] TRT_G4Utilities: Thread-safety cleanup.

Rework to remove most thread-safety annotations.
---
 .../TRT_G4Utilities/TRTOutputFile.hh          | 23 ++----
 .../TRT_G4Utilities/TRTParameters.hh          | 21 ++---
 .../TRTParametersOfBarrelStraws.hh            | 13 ++-
 .../TRTParametersOfModulesA.hh                | 13 ++-
 .../TRTParametersOfModulesB.hh                | 13 ++-
 .../TRTParametersOfModulesC.hh                | 12 +--
 .../TRTParametersOfStrawPlanes.hh             | 12 +--
 .../TRT_G4Utilities/TRTParametersOfWheelsA.hh | 12 +--
 .../TRT_G4Utilities/TRTParametersOfWheelsB.hh | 12 +--
 .../TRT_G4Utilities/TRTParametersOfWheelsC.hh | 12 +--
 .../TRT_G4Utilities/TRTUtilities.hh           | 34 ++------
 .../TRT_G4Utilities/TRTVisualization.hh       | 19 +----
 .../share/ut_TRT_G4UtilitiesTest.ref          |  9 +--
 .../TRT_G4Utilities/src/TRTOutputFile.cc      | 15 ++--
 .../TRT_G4Utilities/src/TRTParameters.cc      | 80 +++++++++----------
 .../src/TRTParametersOfBarrelStraws.cc        | 43 ++++++----
 .../src/TRTParametersOfModulesA.cc            | 10 +--
 .../src/TRTParametersOfModulesB.cc            |  8 +-
 .../src/TRTParametersOfModulesC.cc            | 10 +--
 .../src/TRTParametersOfStrawPlanes.cc         | 44 ++++++----
 .../src/TRTParametersOfWheelsA.cc             | 24 +++---
 .../src/TRTParametersOfWheelsB.cc             | 27 ++++---
 .../src/TRTParametersOfWheelsC.cc             | 24 +++---
 .../TRT_G4Utilities/src/TRTUtilities.cc       | 54 +++----------
 .../TRT_G4Utilities/src/TRTVisualization.cc   | 11 +--
 .../test/ut_TRTParametersTest.cxx             |  3 -
 26 files changed, 241 insertions(+), 317 deletions(-)

diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh
index 1ffa44e9a93f..0373cc1d9185 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh
@@ -11,35 +11,24 @@
 #include "AthenaKernel/MsgStreamMember.h"
 #include "CxxUtils/checker_macros.h"
 
-class ATLAS_NOT_THREAD_SAFE TRTOutputFile // This class needs give non-const reference for output streaming. static TRTOutputFile* m_pOutputFile cannot be static const. Thread unsafe exit is also used.
+class TRTOutputFile
 {
 public:
-  ~TRTOutputFile();
-  
-  static TRTOutputFile* GetPointer()
-  {
-    if (!m_pOutputFile)
-      m_pOutputFile = new TRTOutputFile;
-    return m_pOutputFile;
-    }
+ 
+  static TRTOutputFile* GetPointer();
   
   std::ofstream& GetReference()
   {return m_output;}
  
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
   bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
 
 private:
   TRTOutputFile();
-  
-  
+  ~TRTOutputFile();
   
   std::ofstream m_output;
-  
-  static TRTOutputFile* m_pOutputFile;
-
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
-
+  Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh
index 70e8f70f714e..025bbe958cc5 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh
@@ -11,17 +11,10 @@
 #include "AthenaKernel/MsgStreamMember.h"
 #include "CxxUtils/checker_macros.h"
 
-class ATLAS_NOT_THREAD_SAFE TRTParameters // static variable and thread unsafe exit are used.
+class TRTParameters
 {
 public:
-  ~TRTParameters();
-  
-  static TRTParameters* GetPointer()
-  {
-    if (!s_pParameters)
-      s_pParameters = new TRTParameters;
-    return s_pParameters;
-  }
+  static const TRTParameters* GetPointer();
   
   int GetInteger(std::string) const;
   double GetDouble(std::string) const;
@@ -31,11 +24,12 @@ public:
   void GetPartOfDoubleArray(std::string, int, double*) const;
   int GetElementOfIntegerArray(std::string, int) const;
 
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-  bool msgLevel (MSG::Level lvl)  const  { return m_msg.get().level() <= lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+  bool msgLevel (MSG::Level lvl) { return m_msg.get().level() <= lvl; }
 
 private:
   TRTParameters();
+  ~TRTParameters();
   
   void ReadInputFile(std::string);
   void PrintListOfParameters() const;
@@ -47,10 +41,7 @@ private:
   std::multimap<std::string, double, std::less<std::string> >::const_iterator
   multimapIterator;
   
-  static TRTParameters* s_pParameters;
-
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
-
+  Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh
index 62d1cb3ec7d9..a292913192e6 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfBarrelStraws // Thread unsafe TRTParameters class is used.
+class TRTParametersOfBarrelStraws
 {
   friend class TRTConstructionOfBarrelStraws;
 
@@ -21,14 +21,14 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfBarrelStraws // Thread unsafe TRTPara
     TRTParametersOfBarrelStraws();
     ~TRTParametersOfBarrelStraws();
 
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-    bool msgLevel (MSG::Level lvl) const   { return m_msg.get().level() <= lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+    bool msgLevel (MSG::Level lvl)   { return m_msg.get().level() <= lvl; }
 
   private:
     TRTParametersOfBarrelStraws (const TRTParametersOfBarrelStraws&); 
     TRTParametersOfBarrelStraws& operator= (const TRTParametersOfBarrelStraws&); 
     void DefineParameters();
-    void PrintParameters() const;
+    void PrintParameters(MsgStream& msg) const;
 
     double m_outerRadiusOfStrawHole;
     double m_lengthOfStrawHole;
@@ -61,10 +61,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfBarrelStraws // Thread unsafe TRTPara
     double m_outerRadiusOfWire;
     double m_lengthOfWire;
 
-    TRTParameters* m_pParameters;
-
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    const TRTParameters* m_pParameters;
 
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh
index 61cc54b44570..700dfbeac961 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesA // Thread unsafe TRTParameters class is used.
+class TRTParametersOfModulesA
 {
   friend class TRTConstructionOfModulesA;
   
@@ -21,14 +21,14 @@ public:
   TRTParametersOfModulesA();
   ~TRTParametersOfModulesA();
 
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-  bool msgLevel (MSG::Level lvl) const  { return m_msg.get().level() <= lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+  bool msgLevel (MSG::Level lvl)  { return m_msg.get().level() <= lvl; }
   
 private:
   TRTParametersOfModulesA (const TRTParametersOfModulesA&); 
   TRTParametersOfModulesA& operator= (const TRTParametersOfModulesA&); 
   void DefineParameters();
-  void PrintParameters(double*, double*) const;
+  void PrintParameters(MsgStream& msg, double*, double*) const;
   
   double m_baseOfShellTrd1A;
   double m_heightOfShellTrd1A;
@@ -72,10 +72,9 @@ private:
 
   int m_numberOfShortStrawsA;
   
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
   
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
-
+  Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh
index 95b7c0e93bd8..a72270fd1e24 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesB // Thread unsafe TRTParameters class is used.
+class TRTParametersOfModulesB
 {
   friend class TRTConstructionOfModulesB;
 
@@ -21,14 +21,14 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesB // Thread unsafe TRTParamete
     TRTParametersOfModulesB();
     ~TRTParametersOfModulesB();
    
-     MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-     bool msgLevel (MSG::Level lvl) const    { return m_msg.get().level() <= lvl; }
+     MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+     bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
 
   private:
     TRTParametersOfModulesB (const TRTParametersOfModulesB&); 
     TRTParametersOfModulesB& operator= (const TRTParametersOfModulesB&); 
     void DefineParameters();
-    void PrintParameters(double*, double*) const;
+    void PrintParameters(MsgStream& msg, double*, double*) const;
 
     double m_baseOfShellTrd1B;
     double m_heightOfShellTrd1B;
@@ -75,10 +75,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesB // Thread unsafe TRTParamete
     double* m_xOfHolesForCoolingTubesB;
     double* m_zOfHolesForCoolingTubesB;
 
-    TRTParameters* m_pParameters;
-
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    const TRTParameters* m_pParameters;
 
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh
index 10a02d6d2d3f..73bb514bc89b 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesC // Thread unsafe TRTParameters class is used.
+class TRTParametersOfModulesC
 {
   friend class TRTConstructionOfModulesC;
 
@@ -21,14 +21,14 @@ public:
   TRTParametersOfModulesC();
   ~TRTParametersOfModulesC();
   
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-  bool msgLevel (MSG::Level lvl) const    { return m_msg.get().level() <= lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+  bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
   
 private:
   TRTParametersOfModulesC (const TRTParametersOfModulesC&); 
   TRTParametersOfModulesC& operator= (const TRTParametersOfModulesC&); 
   void DefineParameters();
-  void PrintParameters(double*, double*) const;
+  void PrintParameters(MsgStream& msg, double*, double*) const;
   
   double m_baseOfShellTrd1C;
   double m_heightOfShellTrd1C;
@@ -75,9 +75,9 @@ private:
   double* m_xOfHolesForCoolingTubesC;
   double* m_zOfHolesForCoolingTubesC;
   
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
 
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+  Athena::MsgStreamMember m_msg;
 
 };
 
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh
index 98373f53ff22..430012292369 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfStrawPlanes // Thread unsafe TRTParameters class is used.
+class TRTParametersOfStrawPlanes
 {
   friend class TRTConstructionOfStrawPlanes;
 
@@ -21,14 +21,14 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfStrawPlanes // Thread unsafe TRTParam
     TRTParametersOfStrawPlanes();
     ~TRTParametersOfStrawPlanes();
 
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-    bool msgLevel (MSG::Level lvl) const   { return m_msg.get().level() <= lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+    bool msgLevel (MSG::Level lvl)   { return m_msg.get().level() <= lvl; }
 
   private:
     TRTParametersOfStrawPlanes (const TRTParametersOfStrawPlanes&); 
     TRTParametersOfStrawPlanes& operator= (const TRTParametersOfStrawPlanes&); 
     void DefineParameters();
-    void PrintParameters() const;
+    void PrintParameters(MsgStream& msg) const;
 
     double m_innerRadiusOfStrawPlanesAB;
     double m_innerRadiusOfStrawPlaneC;
@@ -72,9 +72,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfStrawPlanes // Thread unsafe TRTParam
     double m_lengthOfWiresAB;
     double m_lengthOfWireC;
 
-    TRTParameters* m_pParameters;
+    const TRTParameters* m_pParameters;
 
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    Athena::MsgStreamMember m_msg;
 
 };
 
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh
index 7076b52b4e87..a6a79461fe84 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsA // Thread unsafe TRTParameters class is used.
+class TRTParametersOfWheelsA
 {
   friend class TRTConstructionOfWheelsA;
 
@@ -21,15 +21,15 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsA // Thread unsafe TRTParameter
     TRTParametersOfWheelsA();
     ~TRTParametersOfWheelsA();
   
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-    bool msgLevel (MSG::Level lvl) const   { return m_msg.get().level() <= lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+    bool msgLevel (MSG::Level lvl)   { return m_msg.get().level() <= lvl; }
 
   private:
     TRTParametersOfWheelsA (const TRTParametersOfWheelsA&); 
     TRTParametersOfWheelsA& operator= (const TRTParametersOfWheelsA&); 
 
     void DefineParameters();
-    void PrintParameters() const;
+    void PrintParameters(MsgStream& msg) const;
 
     int m_numberOfWheelsA;
     double m_distanceBetweenWheelsA;
@@ -66,9 +66,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsA // Thread unsafe TRTParameter
     double m_outerRadiusOfThinRadiatorA;
     double m_lengthOfThinRadiatorA;
 
-    TRTParameters* m_pParameters;
+    const TRTParameters* m_pParameters;
   
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh
index fbd27905e4da..19a7d530c61d 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsB // Thread unsafe TRTParameters class is used.
+class TRTParametersOfWheelsB
 {
   friend class TRTConstructionOfWheelsB;
 
@@ -21,15 +21,15 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsB // Thread unsafe TRTParameter
     TRTParametersOfWheelsB();
     ~TRTParametersOfWheelsB();
 
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-    bool msgLevel (MSG::Level lvl) const   { return m_msg.get().level() <= lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+    bool msgLevel (MSG::Level lvl) { return m_msg.get().level() <= lvl; }
  
   private:
     TRTParametersOfWheelsB (const TRTParametersOfWheelsB&); 
     TRTParametersOfWheelsB& operator= (const TRTParametersOfWheelsB&); 
 
     void DefineParameters();
-    void PrintParameters() const;
+    void PrintParameters(MsgStream& msg) const;
 
     int m_numberOfWheelsB;
     double m_distanceBetweenWheelsB;
@@ -73,9 +73,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsB // Thread unsafe TRTParameter
     double m_outerRadiusOfMiddleRadiatorB;
     double m_lengthOfMiddleRadiatorB;
 
-    TRTParameters* m_pParameters;
+    const TRTParameters* m_pParameters;
   
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh
index a3b79e86d930..eeb0c82be475 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsC // Thread unsafe TRTParameters class is used.
+class TRTParametersOfWheelsC
 {
   friend class TRTConstructionOfWheelsC;
 
@@ -21,15 +21,15 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsC // Thread unsafe TRTParameter
     TRTParametersOfWheelsC();
     ~TRTParametersOfWheelsC();
 
-     MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-     bool msgLevel (MSG::Level lvl) const   { return m_msg.get().level() <= lvl; }
+     MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+     bool msgLevel (MSG::Level lvl) { return m_msg.get().level() <= lvl; }
 
   private:
     TRTParametersOfWheelsC (const TRTParametersOfWheelsC&); 
     TRTParametersOfWheelsC& operator= (const TRTParametersOfWheelsC&); 
 
     void DefineParameters();
-    void PrintParameters() const;
+    void PrintParameters(MsgStream& msg) const;
 
     int m_numberOfWheelsC;
     double m_distanceBetweenWheelsC;
@@ -66,9 +66,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsC // Thread unsafe TRTParameter
     double m_outerRadiusOfThinRadiatorC;
     double m_lengthOfThinRadiatorC;
 
-    TRTParameters* m_pParameters;
+    const TRTParameters* m_pParameters;
  
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh
index 4f0aaf3bf3cf..5808681ca5ff 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh
@@ -13,38 +13,14 @@
 class TRTOutputFile;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTUtilities // This class uses thread unsafe TRTOutputFile. static TRTUtilities utilities cannot be static const for output streaming.
+namespace TRTUtilities
 {
-public:
-    ~TRTUtilities();
-  
-  static TRTUtilities* GetPointer()
-  {
-    if (!s_pUtilities)
-      s_pUtilities = new TRTUtilities;
-    return s_pUtilities;
-  }
-  
   std::string NumberToString(int);
   
-  void PrintTubeParameters(double, double);
-  void PrintTubeParameters(double, double, double);
-  void PrintTubeParameters(double, double, double, double);
-
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-  bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
-
-private:
-  TRTUtilities();
-  
-  std::ofstream& GetReference();
-
-  TRTOutputFile* m_pOutputFile;
-  
-  static TRTUtilities* s_pUtilities;
-
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+  void PrintTubeParameters(TRTOutputFile& f, double, double);
+  void PrintTubeParameters(TRTOutputFile& f, double, double, double);
+  void PrintTubeParameters(TRTOutputFile& f, double, double, double, double);
+}
 
-};
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh
index 2e469b410c9f..438db2d5f803 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh
@@ -14,26 +14,18 @@ class G4LogicalVolume;
 class G4VisAttributes;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTVisualization // static variable and thread unsafe exit are used.
+class TRTVisualization
 {
   public:
+    TRTVisualization();
     ~TRTVisualization();
 
-    static TRTVisualization* GetPointer()
-    {
-      if (!s_pVisualization)
-        s_pVisualization = new TRTVisualization;
-      return s_pVisualization;
-    }
-
     void Visualize(G4LogicalVolume*, int);
  
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
     bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
 
   private:
-    TRTVisualization();
-
     void Initialize();
 
     G4VisAttributes* m_pVisAttributeRed;
@@ -44,10 +36,7 @@ class ATLAS_NOT_THREAD_SAFE TRTVisualization // static variable and thread unsaf
     G4VisAttributes* m_pVisAttributeCyan;
     G4VisAttributes* m_pVisAttributeBlack;
 
-    static TRTVisualization* s_pVisualization;
-
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
-
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/share/ut_TRT_G4UtilitiesTest.ref b/InnerDetector/InDetG4/TRT_G4Utilities/share/ut_TRT_G4UtilitiesTest.ref
index 852c6dd72d82..3c74de17e85b 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/share/ut_TRT_G4UtilitiesTest.ref
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/share/ut_TRT_G4UtilitiesTest.ref
@@ -1,9 +1,6 @@
 Running 7 test cases...
 Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
 Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-*** No errors detected
+
+*** No errors detected
+
\ No newline at end of file
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTOutputFile.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTOutputFile.cc
index 7ee44c936131..35fa501b3bd5 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTOutputFile.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTOutputFile.cc
@@ -1,15 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
 #include "TRT_G4Utilities/TRTOutputFile.hh"
 #include <fstream>
 
-
-TRTOutputFile* TRTOutputFile::m_pOutputFile = NULL;
-
-
   // Called by GetPointer
 
 TRTOutputFile::TRTOutputFile() : m_output("TRTOutput", std::ios::out), m_msg("TRTOutputFile")
@@ -31,7 +27,12 @@ TRTOutputFile::~TRTOutputFile()
 
   m_output.close();
 
-  m_pOutputFile = NULL;
-
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "####### Destructor TRTOutputFile done" << endmsg;
 }
+
+
+TRTOutputFile* TRTOutputFile::GetPointer()
+{
+  static TRTOutputFile f ATLAS_THREAD_SAFE;
+  return &f;
+}
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc
index b8692eea93f5..2266c13306ea 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc
@@ -8,10 +8,14 @@
 #include <fstream>
 
 
-TRTParameters* TRTParameters::s_pParameters = NULL;
+const TRTParameters* TRTParameters::GetPointer()
+{
+  static TRTParameters parameters ATLAS_THREAD_SAFE;
+  return &parameters;
+}
 
 
-  // Called by GetPointer
+// Called by GetPointer
 
 TRTParameters::TRTParameters() : m_msg("TRTParameters")
 {
@@ -34,15 +38,13 @@ TRTParameters::~TRTParameters()
 {
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "####### Destructor TRTParameters" << endmsg;
 
-  s_pParameters = NULL;
-
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "####### Destructor TRTParameters done" << endmsg;
 }
 
 
   // Called by TRTParameters
 
-void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) // Thread unsafe exit function is used.
+void TRTParameters::ReadInputFile(std::string fileName)
 {
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParameters::ReadInputFile" << endmsg;
 
@@ -55,7 +57,7 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
     std::cerr << "***** TRTParameters::ReadInputFile *****" << std::endl;
     std::cerr << "  Cannot open input file '" << fileName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 
   int inputState = 0;
@@ -88,7 +90,7 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
 	std::cerr << "  Last parameter '" << parameterName << "'." << std::endl;
         std::cerr << "  Cannot find symbol '='." << std::endl;
         std::cerr << "  Exit!" << std::endl << std::endl;
-        exit(0);
+        std::abort();
       }
     }
     else if (inputState == 3)
@@ -108,7 +110,7 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
           std::cerr << "  Last parameter '" << parameterName << "'." << std::endl;
           std::cerr << "  Unexpected symbol '>'." << std::endl;
           std::cerr << "  Exit!" << std::endl << std::endl;
-          exit(0);
+          std::abort();
         }
       }
       else if (inputString == "<")
@@ -119,7 +121,7 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
         std::cerr << "  Last parameter '" << parameterName << "'." << std::endl;
         std::cerr << "  Unexpected symbol '<'." << std::endl;
         std::cerr << "  Exit!" << std::endl << std::endl;
-        exit(0);
+        std::abort();
       }
       else
       {
@@ -138,7 +140,7 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
     std::cerr << "  Last parameter '" << parameterName << "'." << std::endl;
     std::cerr << "  Cannot find symbol '>' at the end of file." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 
   inputFile.close();
@@ -149,10 +151,8 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
 
   // Called by TRTParameters
 
-void TRTParameters::PrintListOfParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTOutputFile class is used.
+void TRTParameters::PrintListOfParameters() const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParameters::PrintListOfParameters" << endmsg;
-
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -164,14 +164,12 @@ void TRTParameters::PrintListOfParameters ATLAS_NOT_THREAD_SAFE () const // Thre
     i != m_multimapOfParameters.end(); ++i)
     output << "  " << (*i).first << "=" << (*i).second << std::endl;
   output << std::endl;
-
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParameters::PrintListOfParameters done" << endmsg;
 }
 
 
   // Called on demand
 
-int TRTParameters::GetInteger ATLAS_NOT_THREAD_SAFE (std::string parameterName) const // Thread unsafe exit function is used.
+int TRTParameters::GetInteger(std::string parameterName) const
 {
   int numberOfItems = m_multimapOfParameters.count(parameterName);
 
@@ -187,7 +185,7 @@ int TRTParameters::GetInteger ATLAS_NOT_THREAD_SAFE (std::string parameterName)
     std::cerr << "***** TRTParameters::GetInteger *****" << std::endl;
     std::cerr << "  Cannot find parameter '" << parameterName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -196,14 +194,14 @@ int TRTParameters::GetInteger ATLAS_NOT_THREAD_SAFE (std::string parameterName)
     std::cerr << "  Parameter '" << parameterName << "' has " << numberOfItems
            << " copies." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-double TRTParameters::GetDouble ATLAS_NOT_THREAD_SAFE (std::string parameterName) const // Thread unsafe exit function is used.
+double TRTParameters::GetDouble(std::string parameterName) const
 {
   int numberOfItems = m_multimapOfParameters.count(parameterName);
 
@@ -219,7 +217,7 @@ double TRTParameters::GetDouble ATLAS_NOT_THREAD_SAFE (std::string parameterName
     std::cerr << "***** TRTParameters::GetDouble *****" << std::endl;
     std::cerr << "  Cannot find parameter '" << parameterName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -228,15 +226,15 @@ double TRTParameters::GetDouble ATLAS_NOT_THREAD_SAFE (std::string parameterName
     std::cerr << "  Parameter '" << parameterName << "' has " << numberOfItems
            << " copies." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-void TRTParameters::GetIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, int arraySize, // Thread unsafe exit function is used.
-  int* array) const
+void TRTParameters::GetIntegerArray(std::string arrayName, int arraySize,
+                                    int* array) const
 {
   int numberOfItems = m_multimapOfParameters.count(arrayName);
 
@@ -252,7 +250,7 @@ void TRTParameters::GetIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName
     std::cerr << "***** TRTParameters::GetIntegerArray *****" << std::endl;
     std::cerr << "  Cannot find array '" << arrayName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -262,15 +260,15 @@ void TRTParameters::GetIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName
            << "." << std::endl;
     std::cerr << "  Demanded size is " << arraySize << "." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-void TRTParameters::GetDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, int arraySize, // Thread unsafe exit function is used.
-  double* array) const
+void TRTParameters::GetDoubleArray(std::string arrayName, int arraySize,
+                                   double* array) const
 {
   int numberOfItems = m_multimapOfParameters.count(arrayName);
 
@@ -286,7 +284,7 @@ void TRTParameters::GetDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arrayName,
     std::cerr << "***** TRTParameters::GetDoubleArray *****" << std::endl;
     std::cerr << "  Cannot find array '" << arrayName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -296,15 +294,15 @@ void TRTParameters::GetDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arrayName,
            << "." << std::endl;
     std::cerr << "  Demanded size is " << arraySize << "." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-void TRTParameters::GetPartOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, // Thread unsafe exit function is used.
-  int numberOfDemandedElements, int* array) const
+void TRTParameters::GetPartOfIntegerArray(std::string arrayName,
+                                          int numberOfDemandedElements, int* array) const
 {
   int numberOfItems = m_multimapOfParameters.count(arrayName);
 
@@ -320,7 +318,7 @@ void TRTParameters::GetPartOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arr
     std::cerr << "***** TRTParameters::GetPartOfIntegerArray *****" << std::endl;
     std::cerr << "  Cannot find array '" << arrayName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -331,15 +329,15 @@ void TRTParameters::GetPartOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arr
     std::cerr << "  Number of demanded elements " << numberOfDemandedElements
            << "." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-void TRTParameters::GetPartOfDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, // Thread unsafe exit function is used.
-  int numberOfDemandedElements, double* array) const
+void TRTParameters::GetPartOfDoubleArray(std::string arrayName,
+                                         int numberOfDemandedElements, double* array) const
 {
   int numberOfItems = m_multimapOfParameters.count(arrayName);
 
@@ -355,7 +353,7 @@ void TRTParameters::GetPartOfDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arra
     std::cerr << "***** TRTParameters::GetPartOfDoubleArray *****" << std::endl;
     std::cerr << "  Cannot find array '" << arrayName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -366,15 +364,15 @@ void TRTParameters::GetPartOfDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arra
     std::cerr << "  Number of demanded elements " << numberOfDemandedElements
            << "." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-int TRTParameters::GetElementOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, // Thread unsafe exit function is used.
-  int elementIndex) const
+int TRTParameters::GetElementOfIntegerArray(std::string arrayName,
+                                            int elementIndex) const
 {
   int numberOfItems = m_multimapOfParameters.count(arrayName);
 
@@ -390,7 +388,7 @@ int TRTParameters::GetElementOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string a
     std::cerr << "***** TRTParameters::GetElementOfIntegerArray *****" << std::endl;
     std::cerr << "  Cannot find array '" << arrayName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -400,6 +398,6 @@ int TRTParameters::GetElementOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string a
            << arrayName << "'." << std::endl;
     std::cerr << "  Array size " << numberOfItems << "." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc
index 028f16c49ae4..9144ee438116 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc
@@ -21,7 +21,7 @@ TRTParametersOfBarrelStraws::TRTParametersOfBarrelStraws(): m_msg("TRTParameters
   DefineParameters();
 
   if (m_pParameters->GetInteger("PrintParametersOfBarrelStraws"))
-    PrintParameters();
+    PrintParameters(m_msg.get());
 
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTParametersOfBarrelStraws done" << endmsg;
 }
@@ -91,12 +91,11 @@ void TRTParametersOfBarrelStraws::DefineParameters()
 
 // Called by TRTParametersOfBarrelStraws
 
-void TRTParametersOfBarrelStraws::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used.
+void TRTParametersOfBarrelStraws::PrintParameters(MsgStream& msg) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfBarrelStraws::PrintParameters"
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfBarrelStraws::PrintParameters"
 						<< endmsg;
 
-  TRTUtilities* pUtilities = TRTUtilities::GetPointer();
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -106,50 +105,60 @@ void TRTParametersOfBarrelStraws::PrintParameters ATLAS_NOT_THREAD_SAFE () const
          << std::endl;
 
   output << "Parameters of barrel straw hole:" << std::endl;
-  pUtilities->PrintTubeParameters(m_outerRadiusOfStrawHole,
-                                  m_lengthOfStrawHole);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_outerRadiusOfStrawHole,
+                                    m_lengthOfStrawHole);
 
   output << std::endl << "Parameters of barrel straw:" << std::endl;
-  pUtilities->PrintTubeParameters(m_outerRadiusOfStraw, m_lengthOfStraw);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_outerRadiusOfStraw, m_lengthOfStraw);
 
   output << std::endl << "Parameters of barrel straw wire:" << std::endl;
-  pUtilities->PrintTubeParameters(m_outerRadiusOfWire, m_lengthOfWire);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_outerRadiusOfWire, m_lengthOfWire);
 
   output << std::endl << "Parameters of barrel straw twister:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfTwister,
-    m_outerRadiusOfTwister, m_lengthOfTwister);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfTwister,
+                                    m_outerRadiusOfTwister, m_lengthOfTwister);
 
   output << std::endl << "Parameters of gas S for short straw:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfGas, m_outerRadiusOfGas,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfGas, m_outerRadiusOfGas,
     m_lengthOfGasS, m_positionOfGasS);
 
   output << std::endl << "Parameters of dead region SA for short straw:"
          << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfDeadRegion,
     m_outerRadiusOfDeadRegion, m_lengthOfDeadRegion, m_positionOfDeadRegionSA);
 
   output << std::endl << "Parameters of long dead region SB for short straw:"
          << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfDeadRegion,
     m_outerRadiusOfDeadRegion, m_lengthOfLongDeadRegion,
     m_positionOfLongDeadRegionSB);
 
   output << std::endl << "Parameters of gas L for long straw:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfGas, m_outerRadiusOfGas,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfGas, m_outerRadiusOfGas,
     m_lengthOfGasL, m_positionOfGasL);
 
   output << std::endl << "Parameters of dead region LA for long straw:"
          << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfDeadRegion,
     m_outerRadiusOfDeadRegion, m_lengthOfDeadRegion, m_positionOfDeadRegionLA);
 
   output << std::endl << "Parameters of dead region LB for long straw:"
          << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfDeadRegion,
     m_outerRadiusOfDeadRegion, m_lengthOfDeadRegion, m_positionOfDeadRegionLB);
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfBarrelStraws::PrintParameters"
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfBarrelStraws::PrintParameters"
 						<< " done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesA.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesA.cc
index e9d4b0599f60..677bc6016828 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesA.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesA.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -245,7 +245,7 @@ void TRTParametersOfModulesA::DefineParameters()
   delete [] numberOfShortStrawsInLayersA;
 
   if (m_pParameters->GetInteger("PrintParametersOfModulesA"))
-    PrintParameters(xGlobalOfHolesA, yGlobalOfHolesA);
+    PrintParameters(m_msg.get(), xGlobalOfHolesA, yGlobalOfHolesA);
 
   delete [] xGlobalOfHolesA;
   delete [] yGlobalOfHolesA;
@@ -256,10 +256,10 @@ void TRTParametersOfModulesA::DefineParameters()
 
   // Called by DefineParameters
 
-void TRTParametersOfModulesA::PrintParameters(double* xGlobalOfHolesA,
+void TRTParametersOfModulesA::PrintParameters(MsgStream& msg, double* xGlobalOfHolesA,
   double* yGlobalOfHolesA) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesA::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesA::PrintParameters" << endmsg;
 
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
@@ -359,5 +359,5 @@ void TRTParametersOfModulesA::PrintParameters(double* xGlobalOfHolesA,
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesA::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesA::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesB.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesB.cc
index 450d5757a6d4..9f6869cbe059 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesB.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesB.cc
@@ -257,7 +257,7 @@ void TRTParametersOfModulesB::DefineParameters()
   delete [] yOfHolesB;
 
   if (m_pParameters->GetInteger("PrintParametersOfModulesB"))
-    PrintParameters(xGlobalOfHolesB, yGlobalOfHolesB);
+    PrintParameters(m_msg.get(), xGlobalOfHolesB, yGlobalOfHolesB);
 
   delete [] xGlobalOfHolesB;
   delete [] yGlobalOfHolesB;
@@ -268,10 +268,10 @@ void TRTParametersOfModulesB::DefineParameters()
 
   // Called by DefineParameters
 
-void TRTParametersOfModulesB::PrintParameters(double* xGlobalOfHolesB,
+void TRTParametersOfModulesB::PrintParameters(MsgStream& msg, double* xGlobalOfHolesB,
   double* yGlobalOfHolesB) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesB::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesB::PrintParameters" << endmsg;
 
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
@@ -383,5 +383,5 @@ void TRTParametersOfModulesB::PrintParameters(double* xGlobalOfHolesB,
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesB::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesB::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesC.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesC.cc
index 81a036bc59d3..1ddc9e2d40f3 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesC.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesC.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -257,7 +257,7 @@ void TRTParametersOfModulesC::DefineParameters()
   delete [] yOfHolesC;
 
   if (m_pParameters->GetInteger("PrintParametersOfModulesC"))
-    PrintParameters(xGlobalOfHolesC, yGlobalOfHolesC);
+    PrintParameters(m_msg.get(), xGlobalOfHolesC, yGlobalOfHolesC);
 
   delete [] xGlobalOfHolesC;
   delete [] yGlobalOfHolesC;
@@ -268,10 +268,10 @@ void TRTParametersOfModulesC::DefineParameters()
 
   // Called by DefineParameters
 
-void TRTParametersOfModulesC::PrintParameters(double* xGlobalOfHolesC,
+void TRTParametersOfModulesC::PrintParameters(MsgStream& msg, double* xGlobalOfHolesC,
   double* yGlobalOfHolesC) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesC::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesC::PrintParameters" << endmsg;
 
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
@@ -384,5 +384,5 @@ void TRTParametersOfModulesC::PrintParameters(double* xGlobalOfHolesC,
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesC::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesC::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc
index 660ccce57294..0c669b471dbd 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc
@@ -22,7 +22,7 @@ TRTParametersOfStrawPlanes::TRTParametersOfStrawPlanes() : m_msg("TRTParametersO
   DefineParameters();
 
   if (m_pParameters->GetInteger("PrintParametersOfStrawPlanes"))
-    PrintParameters();
+    PrintParameters(m_msg.get());
 
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTParametersOfStrawPlanes done" << endmsg;
 }
@@ -130,11 +130,10 @@ void TRTParametersOfStrawPlanes::DefineParameters()
 
   // Called by TRTParametersOfStrawPlanes
 
-void TRTParametersOfStrawPlanes::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used.
+void TRTParametersOfStrawPlanes::PrintParameters(MsgStream& msg) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfStrawPlanes::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfStrawPlanes::PrintParameters" << endmsg;
 
-  TRTUtilities* pUtilities = TRTUtilities::GetPointer();
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -144,7 +143,8 @@ void TRTParametersOfStrawPlanes::PrintParameters ATLAS_NOT_THREAD_SAFE () const
          << std::endl;
 
   output << "Parameters of straw planes AB:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfStrawPlanesAB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfStrawPlanesAB,
     m_outerRadiusOfStrawPlanesAB, m_lengthOfStrawPlane);
   output << "  numberOfStrawsInPlanesAB=" << m_numberOfStrawsInPlanesAB
          << std::endl;
@@ -152,31 +152,37 @@ void TRTParametersOfStrawPlanes::PrintParameters ATLAS_NOT_THREAD_SAFE () const
   if (m_pParameters->GetInteger("SectorsABC"))
   {
     output << std::endl << "Parameters of sectors AB:" << std::endl;
-    pUtilities->PrintTubeParameters(m_innerRadiusOfSectorsAB,
+    TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                      m_innerRadiusOfSectorsAB,
       m_outerRadiusOfSectorsAB, m_lengthOfSector);
     output << "  numberOfStrawsInSectorsAB=" << m_numberOfStrawsInSectorsAB
            << std::endl;
   }
 
   output << std::endl << "Parameters of straws AB:" << std::endl;
-  pUtilities->PrintTubeParameters(m_outerRadiusOfStraw, m_lengthOfStrawsAB);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_outerRadiusOfStraw, m_lengthOfStrawsAB);
   output << "  position=" << m_positionOfStrawsAB << " mm" << std::endl;
 
   output << std::endl << "Parameters of gas AB:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfGas,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfGas,
     m_outerRadiusOfGas, m_lengthOfGasAB);
 
   output << std::endl << "Parameters of dead regions AB:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfDeadRegion,
     m_outerRadiusOfDeadRegion, m_lengthOfDeadRegion, m_positionOfDeadRegionsAB);
 
   output << std::endl << "Parameters of wires AB:" << std::endl;
-  pUtilities->PrintTubeParameters(m_outerRadiusOfWire, m_lengthOfWiresAB);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_outerRadiusOfWire, m_lengthOfWiresAB);
 
   if (m_pParameters->GetInteger("WheelsC"))
   {
     output << std::endl << "Parameters of straw plane C:" << std::endl;
-    pUtilities->PrintTubeParameters(m_innerRadiusOfStrawPlaneC,
+    TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                      m_innerRadiusOfStrawPlaneC,
       m_outerRadiusOfStrawPlaneC, m_lengthOfStrawPlane);
     output << "  numberOfStrawsInPlaneC=" << m_numberOfStrawsInPlaneC
            << std::endl;
@@ -184,29 +190,33 @@ void TRTParametersOfStrawPlanes::PrintParameters ATLAS_NOT_THREAD_SAFE () const
     if (m_pParameters->GetInteger("SectorsABC"))
     {
       output << std::endl << "Parameters of sector C:" << std::endl;
-      pUtilities->PrintTubeParameters(m_innerRadiusOfSectorC,
+      TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                        m_innerRadiusOfSectorC,
         m_outerRadiusOfSectorC, m_lengthOfSector);
       output << "  numberOfStrawsInSectorC=" << m_numberOfStrawsInSectorC
              << std::endl;
     }
 
     output << std::endl << "Parameters of straw C:" << std::endl;
-    pUtilities->PrintTubeParameters(m_outerRadiusOfStraw, m_lengthOfStrawC);
+    TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                      m_outerRadiusOfStraw, m_lengthOfStrawC);
     output << "  position=" << m_positionOfStrawC << " mm" << std::endl;
 
     output << std::endl << "Parameters of gas C:" << std::endl;
-    pUtilities->PrintTubeParameters(m_innerRadiusOfGas,
+    TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                      m_innerRadiusOfGas,
       m_outerRadiusOfGas, m_lengthOfGasC);
 
     output << std::endl << "Parameters of dead region C:" << std::endl;
-    pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+    TRTUtilities::PrintTubeParameters(*pOutputFile,m_innerRadiusOfDeadRegion,
       m_outerRadiusOfDeadRegion, m_lengthOfDeadRegion, m_positionOfDeadRegionC);
 
     output << std::endl << "Parameters of wire C:" << std::endl;
-    pUtilities->PrintTubeParameters(m_outerRadiusOfWire, m_lengthOfWireC);
+    TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                      m_outerRadiusOfWire, m_lengthOfWireC);
   }
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfStrawPlanes::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfStrawPlanes::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc
index 234e8fd99325..28f1047395e4 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc
@@ -21,7 +21,7 @@ TRTParametersOfWheelsA::TRTParametersOfWheelsA() : m_msg("TRTParametersOfWheelsA
   DefineParameters();
 
   if (m_pParameters->GetInteger("PrintParametersOfWheelsA"))
-    PrintParameters();
+    PrintParameters(m_msg.get());
 
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTParametersOfWheelsA done" << endmsg;
 }
@@ -134,11 +134,10 @@ void TRTParametersOfWheelsA::DefineParameters()
 
   // Called by TRTParametersOfWheelsA
 
-void TRTParametersOfWheelsA::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used.
+void TRTParametersOfWheelsA::PrintParameters(MsgStream& msg) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsA::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsA::PrintParameters" << endmsg;
 
-  TRTUtilities* pUtilities = TRTUtilities::GetPointer();
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -156,15 +155,18 @@ void TRTParametersOfWheelsA::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << " mm" << std::endl;
 
   output << std::endl << "Parameters of wheel A:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfWheelA, m_outerRadiusOfWheelA,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfWheelA, m_outerRadiusOfWheelA,
     m_lengthOfWheelA);
 
   output << std::endl << "Parameters of inner support A:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfInnerSupportA,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfInnerSupportA,
     m_outerRadiusOfInnerSupportA, m_lengthOfInnerSupportA);
 
   output << std::endl << "Parameters of outer support A:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfOuterSupportA,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfOuterSupportA,
     m_outerRadiusOfOuterSupportA, m_lengthOfOuterSupportA);
 
   output << std::endl << "Parameters of main radiators A:" << std::endl;
@@ -175,7 +177,8 @@ void TRTParametersOfWheelsA::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfMainRadiatorsA[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of main radiator A:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfMainRadiatorA,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfMainRadiatorA,
     m_outerRadiusOfMainRadiatorA, m_lengthOfMainRadiatorA);
 
   output << std::endl << "Parameters of thin radiators A:" << std::endl;
@@ -186,7 +189,8 @@ void TRTParametersOfWheelsA::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfThinRadiatorsA[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of thin radiator A:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfThinRadiatorA,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfThinRadiatorA,
     m_outerRadiusOfThinRadiatorA, m_lengthOfThinRadiatorA);
 
   output << std::endl << "Parameters of straw planes A:" << std::endl;
@@ -203,5 +207,5 @@ void TRTParametersOfWheelsA::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsA::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsA::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc
index f466a0cc18f0..e6c27e250ff9 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc
@@ -21,7 +21,7 @@ TRTParametersOfWheelsB::TRTParametersOfWheelsB() : m_msg("TRTParametersOfWheelsB
   DefineParameters();
 
   if (m_pParameters->GetInteger("PrintParametersOfWheelsB"))
-    PrintParameters();
+    PrintParameters(m_msg.get());
 
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTParametersOfWheelsB done" << endmsg;
 }
@@ -146,11 +146,10 @@ void TRTParametersOfWheelsB::DefineParameters()
 
   // Called by TRTParametersOfWheelsB
 
-void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used.
+void TRTParametersOfWheelsB::PrintParameters(MsgStream& msg) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsB::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsB::PrintParameters" << endmsg;
 
-  TRTUtilities* pUtilities = TRTUtilities::GetPointer();
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -168,15 +167,18 @@ void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << " mm" << std::endl;
 
   output << std::endl << "Parameters of wheel B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfWheelB, m_outerRadiusOfWheelB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfWheelB, m_outerRadiusOfWheelB,
     m_lengthOfWheelB);
 
   output << std::endl << "Parameters of inner support B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfInnerSupportB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfInnerSupportB,
     m_outerRadiusOfInnerSupportB, m_lengthOfInnerSupportB);
 
   output << std::endl << "Parameters of outer support B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfOuterSupportB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfOuterSupportB,
     m_outerRadiusOfOuterSupportB, m_lengthOfOuterSupportB);
 
   output << std::endl << "Parameters of main radiators B:" << std::endl;
@@ -187,7 +189,8 @@ void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfMainRadiatorsB[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of main radiator B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfMainRadiatorB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfMainRadiatorB,
     m_outerRadiusOfMainRadiatorB, m_lengthOfMainRadiatorB);
 
   output << std::endl << "Parameters of thin radiators B:" << std::endl;
@@ -198,7 +201,8 @@ void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfThinRadiatorsB[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of thin radiator B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfThinRadiatorB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfThinRadiatorB,
     m_outerRadiusOfThinRadiatorB, m_lengthOfThinRadiatorB);
 
   output << std::endl << "Parameters of middle radiators B:" << std::endl;
@@ -209,7 +213,8 @@ void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfMiddleRadiatorsB[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of middle radiator B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfMiddleRadiatorB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfMiddleRadiatorB,
     m_outerRadiusOfMiddleRadiatorB, m_lengthOfMiddleRadiatorB);
 
   output << std::endl << "Parameters of straw planes B:" << std::endl;
@@ -226,5 +231,5 @@ void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsB::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsB::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc
index 7edacf4ed66e..26610b0dc354 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc
@@ -22,7 +22,7 @@ TRTParametersOfWheelsC::TRTParametersOfWheelsC() : m_msg("TRTParametersOfWheelsC
   DefineParameters();
 
   if (m_pParameters->GetInteger("PrintParametersOfWheelsC"))
-    PrintParameters();
+    PrintParameters(m_msg.get());
 
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTParametersOfWheelsC done" << endmsg;
 }
@@ -134,11 +134,10 @@ void TRTParametersOfWheelsC::DefineParameters()
 
   // Called by TRTParametersOfWheelsC
 
-void TRTParametersOfWheelsC::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used.
+void TRTParametersOfWheelsC::PrintParameters(MsgStream& msg) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsC::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsC::PrintParameters" << endmsg;
 
-  TRTUtilities* pUtilities = TRTUtilities::GetPointer();
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -156,15 +155,18 @@ void TRTParametersOfWheelsC::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << " mm" << std::endl;
 
   output << std::endl << "Parameters of wheel C:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfWheelC, m_outerRadiusOfWheelC,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfWheelC, m_outerRadiusOfWheelC,
     m_lengthOfWheelC);
 
   output << std::endl << "Parameters of inner support C:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfInnerSupportC,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfInnerSupportC,
     m_outerRadiusOfInnerSupportC, m_lengthOfInnerSupportC);
 
   output << std::endl << "Parameters of outer support C:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfOuterSupportC,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfOuterSupportC,
     m_outerRadiusOfOuterSupportC, m_lengthOfOuterSupportC);
 
   output << std::endl << "Parameters of main radiators C:" << std::endl;
@@ -175,7 +177,8 @@ void TRTParametersOfWheelsC::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfMainRadiatorsC[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of main radiator C:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfMainRadiatorC,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfMainRadiatorC,
     m_outerRadiusOfMainRadiatorC, m_lengthOfMainRadiatorC);
 
   output << std::endl << "Parameters of thin radiators C:" << std::endl;
@@ -186,7 +189,8 @@ void TRTParametersOfWheelsC::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfThinRadiatorsC[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of thin radiator C:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfThinRadiatorC,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfThinRadiatorC,
     m_outerRadiusOfThinRadiatorC, m_lengthOfThinRadiatorC);
 
   output << std::endl << "Parameters of straw planes C:" << std::endl;
@@ -203,5 +207,5 @@ void TRTParametersOfWheelsC::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsC::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsC::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTUtilities.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTUtilities.cc
index 5527d533abad..667fd2679beb 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTUtilities.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTUtilities.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -10,44 +10,6 @@
 
 
 
-TRTUtilities* TRTUtilities::s_pUtilities = NULL;
-
-
-  // Called by GetPointer
-
-TRTUtilities::TRTUtilities() : m_msg("TRTUtilities")
-{
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTUtilities" << endmsg;
-
-  m_pOutputFile = NULL;
-
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTUtilities done" << endmsg;
-}
-
-
-  // Called by TRTRunAction::EndOfRunAction
-
-TRTUtilities::~TRTUtilities()
-{
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "####### Destructor TRTUtilities" << endmsg;
-
-  s_pUtilities = NULL;
-
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "####### Destructor TRTUtilities done" << endmsg;
-}
-
-
-  // Called by PrintTubeParameters
-
-std::ofstream& TRTUtilities::GetReference()
-{
-  if (!m_pOutputFile)
-    m_pOutputFile = TRTOutputFile::GetPointer();
-
-  return m_pOutputFile->GetReference();
-}
-
-
   // Called on demand
 
 std::string TRTUtilities::NumberToString(int number)
@@ -69,9 +31,9 @@ std::string TRTUtilities::NumberToString(int number)
 
   // Called on demand
 
-void TRTUtilities::PrintTubeParameters(double outerRadius, double length)
+void TRTUtilities::PrintTubeParameters(TRTOutputFile& f, double outerRadius, double length)
 {
-  std::ofstream& output = GetReference();
+  std::ofstream& output = f.GetReference();
 
   output << "  outerRadius=" << outerRadius << " mm";
   output << "  length=" << length << " mm" << std::endl;
@@ -80,10 +42,11 @@ void TRTUtilities::PrintTubeParameters(double outerRadius, double length)
 
   // Called on demand
 
-void TRTUtilities::PrintTubeParameters(double innerRadius,
+void TRTUtilities::PrintTubeParameters(TRTOutputFile& f,
+                                       double innerRadius,
   double outerRadius, double length)
 {
-  std::ofstream& output = GetReference();
+  std::ofstream& output = f.GetReference();
 
   output << "  innerRadius=" << innerRadius << " mm";
   output << "  outerRadius=" << outerRadius << " mm";
@@ -93,10 +56,11 @@ void TRTUtilities::PrintTubeParameters(double innerRadius,
 
   // Called on demand
 
-void TRTUtilities::PrintTubeParameters(double innerRadius,
+void TRTUtilities::PrintTubeParameters(TRTOutputFile& f,
+                                       double innerRadius,
   double outerRadius, double length, double position)
 {
-  std::ofstream& output = GetReference();
+  std::ofstream& output = f.GetReference();
 
   output << "  innerRadius=" << innerRadius << " mm";
   output << "  outerRadius=" << outerRadius << " mm";
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTVisualization.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTVisualization.cc
index c9ae45a927eb..79c817b12304 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTVisualization.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTVisualization.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -10,11 +10,6 @@
 #include "G4Colour.hh"
 
 
-TRTVisualization* TRTVisualization::s_pVisualization = NULL;
-
-
-  // Called by GetPointer
-
 TRTVisualization::TRTVisualization(): m_msg("TRTVisualization")
 {
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTVisualization" << endmsg;
@@ -31,8 +26,6 @@ TRTVisualization::~TRTVisualization()
 {
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Destructor TRTVisualization" << endmsg;
 
-  s_pVisualization = NULL;
-
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Destructor TRTVisualization done" << endmsg;
 }
 
@@ -104,6 +97,6 @@ void TRTVisualization::Visualize(G4LogicalVolume* pLogicalVolume,
       std::cerr << "***** TRTVisualization::Visualize *****" << std::endl;
       std::cerr << "  Invalid colour index " << colourIndex << "." << std::endl;
       std::cerr << "  Exit!" << std::endl << std::endl;
-      exit(0);
+      std::abort();
   }
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx b/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx
index ab30309f4b96..67d27694ed89 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx
@@ -9,7 +9,6 @@
 #include "TRT_G4Utilities/TRTParameters.hh"
 #include "TRT_G4Utilities/TRTOutputFile.hh"
 
-ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // This unit test uses thread unsafe TRTParameters and TRTOutputFile classes.
 
 namespace utf = boost::unit_test;
 
@@ -22,7 +21,6 @@ struct setupParameters{
  
   ~setupParameters(){
     BOOST_TEST_MESSAGE("ending test");
-    delete p;
   }
 };
 
@@ -35,7 +33,6 @@ struct setupOutputFile{
  
   ~setupOutputFile(){
     BOOST_TEST_MESSAGE("ending test");
-    delete p;
   }
 };
 
-- 
GitLab


From 3744e43e80c9dc1b1a1707ce254db163dd823c55 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 5 Sep 2020 16:45:11 -0400
Subject: [PATCH 163/422] GeoModelUtilities: Enable thread-safety checking.

Enable thread-safety checking and fix identified issues.
---
 .../GeoModelUtilities/ATLAS_CHECK_THREAD_SAFETY      |  1 +
 .../GeoModelUtilities/GeoExtendedMaterial.h          | 12 +++++++++---
 .../GeoModelUtilities/GeoModelTool.h                 |  8 +++++---
 .../GeoModelUtilities/GeoOpticalSurface.h            |  6 ++++--
 .../GeoModel/GeoModelUtilities/src/GeoModelTool.cxx  |  7 +++++--
 5 files changed, 24 insertions(+), 10 deletions(-)
 create mode 100644 DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/ATLAS_CHECK_THREAD_SAFETY

diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/ATLAS_CHECK_THREAD_SAFETY b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..ae22b41cc180
--- /dev/null
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+DetectorDescription/GeoModel/GeoModelUtilities
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.h
index bae62e432664..3f758275312e 100755
--- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.h
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GeoExtendedMaterial_h
@@ -37,7 +37,8 @@ class GeoExtendedMaterial : public GeoMaterial
   const double& getPressure() const;
   
   void SetMaterialPropertiesTable(GeoMaterialPropertiesTable* MPT);
-  GeoMaterialPropertiesTable* GetMaterialPropertiesTable() const;
+  GeoMaterialPropertiesTable* GetMaterialPropertiesTable();
+  const GeoMaterialPropertiesTable* GetMaterialPropertiesTable() const;
 
  private:
   GeoExtendedMaterial(const GeoExtendedMaterial &right);
@@ -72,7 +73,12 @@ inline void GeoExtendedMaterial::SetMaterialPropertiesTable(GeoMaterialPropertie
   m_properties->ref();
 }
 
-inline GeoMaterialPropertiesTable* GeoExtendedMaterial::GetMaterialPropertiesTable() const
+inline GeoMaterialPropertiesTable* GeoExtendedMaterial::GetMaterialPropertiesTable()
+{
+  return m_properties;
+}
+
+inline const GeoMaterialPropertiesTable* GeoExtendedMaterial::GetMaterialPropertiesTable() const
 {
   return m_properties;
 }
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelTool.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelTool.h
index 8772c2a4f31b..fe5933ccf309 100755
--- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelTool.h
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOMODELSVC_GEOMODELTOOL_H
@@ -9,6 +9,7 @@
 
 #include "GeoModelInterfaces/IGeoModelTool.h"
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "CxxUtils/checker_macros.h"
 
 class GeoVDetectorManager;
 
@@ -22,10 +23,11 @@ public:
     // Standard Destructor
     virtual ~GeoModelTool();
 
-    virtual GeoVDetectorManager* manager() const;
+    virtual GeoVDetectorManager* manager();
+    virtual const GeoVDetectorManager* manager() const;
 
     virtual StatusCode clear() override;	
-    virtual StatusCode registerCallback() override;
+    virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override;
     virtual StatusCode align(IOVSVC_CALLBACK_ARGS) override;
 
 protected:
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoOpticalSurface.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoOpticalSurface.h
index f9f66d4caa1e..463a23d7dbb9 100644
--- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoOpticalSurface.h
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoOpticalSurface.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GeoOpticalSurface_h
@@ -57,7 +57,9 @@ class GeoOpticalSurface : public RCBase
   void SetMaterialPropertiesTable(GeoMaterialPropertiesTable *mpt)
   { m_materialPropertiesTable = mpt; if(mpt) m_materialPropertiesTable->ref(); };
 
-  GeoMaterialPropertiesTable* GetMaterialPropertiesTable() const
+  GeoMaterialPropertiesTable* GetMaterialPropertiesTable()
+    { return m_materialPropertiesTable;};
+  const GeoMaterialPropertiesTable* GetMaterialPropertiesTable() const
     { return m_materialPropertiesTable;};
  
  private:
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelTool.cxx b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelTool.cxx
index 1728281c98dc..95b06ef427d2 100755
--- a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelTool.cxx
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef BUILDVP1LIGHT
@@ -25,7 +25,10 @@ GeoModelTool::~GeoModelTool()  {
 /**
  ** The Detector Node corresponding to this tool
  **/
-GeoVDetectorManager* GeoModelTool::manager() const {
+GeoVDetectorManager* GeoModelTool::manager() {
+  return m_detector;
+}
+const GeoVDetectorManager* GeoModelTool::manager() const {
   return m_detector;
 }
 
-- 
GitLab


From 8a7e2a626667bb117ed7d9fb14c6ac5c0876339e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 8 Sep 2020 10:53:40 -0400
Subject: [PATCH 164/422] InDetTrackingGeometry: Thread-safety cleanup.

Attributes should match between definitions and declarations.
---
 .../RobustTrackingGeometryBuilder.h                    |  7 +++++--
 .../RobustTrackingGeometryBuilderCond.h                |  6 ++++--
 .../StagedTrackingGeometryBuilder.h                    | 10 +++++++---
 .../StagedTrackingGeometryBuilderCond.h                |  9 ++++++---
 4 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h
index 824463825727..39abd5e741ab 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h
@@ -23,6 +23,8 @@
 #include <vector>
 #include <string>
 
+#include "CxxUtils/checker_macros.h"
+
 #ifndef TRKDETDESCR_TAKESMALLERBIGGER
 #define TRKDETDESCR_TAKESMALLERBIGGER
 #define takeSmaller(current,test) current = current < test ? current : test
@@ -76,7 +78,7 @@ namespace InDet {
       /** AlgTool finalize method */
       StatusCode finalize();
       /** TrackingGeometry Interface methode */
-      const Trk::TrackingGeometry* trackingGeometry(const Trk::TrackingVolume* tvol = 0) const; 
+      const Trk::TrackingGeometry* trackingGeometry ATLAS_NOT_THREAD_SAFE (const Trk::TrackingVolume* tvol = 0) const; 
 
       /** The unique signature */
       Trk::GeometrySignature geometrySignature() const { return Trk::ID; }
@@ -84,7 +86,8 @@ namespace InDet {
     private:
         
       /** Private method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap layers */
-      const Trk::TrackingVolume* packVolumeTriple(const std::vector<const Trk::Layer*>& negLayers,
+      const Trk::TrackingVolume* packVolumeTriple ATLAS_NOT_THREAD_SAFE
+                                                 (const std::vector<const Trk::Layer*>& negLayers,
                                                   const std::vector<const Trk::Layer*>& centralLayers,
                                                   const std::vector<const Trk::Layer*>& posLayers,
                                                   double rMin, double rMax,
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h
index f0f9f84acb95..8f168cfc2281 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h
@@ -16,6 +16,7 @@
 // Athena
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "CxxUtils/CachedUniquePtr.h"
+#include "CxxUtils/checker_macros.h"
 // Gaudi
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
@@ -76,7 +77,7 @@ namespace InDet {
       /** AlgTool finalize method */
       StatusCode finalize();
       /** TrackingGeometry Interface methode */
-      std::pair<EventIDRange, const Trk::TrackingGeometry*> trackingGeometry(const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*> tVolPair) const; 
+      std::pair<EventIDRange, const Trk::TrackingGeometry*> trackingGeometry ATLAS_NOT_THREAD_SAFE (const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*> tVolPair) const; 
 
       /** The unique signature */
       Trk::GeometrySignature geometrySignature() const { return Trk::ID; }
@@ -84,7 +85,8 @@ namespace InDet {
     private:
         
       /** Private method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap layers */
-      const Trk::TrackingVolume* packVolumeTriple(const std::vector<const Trk::Layer*>& negLayers,
+      const Trk::TrackingVolume* packVolumeTriple ATLAS_NOT_THREAD_SAFE
+                                                 (const std::vector<const Trk::Layer*>& negLayers,
                                                   const std::vector<const Trk::Layer*>& centralLayers,
                                                   const std::vector<const Trk::Layer*>& posLayers,
                                                   double rMin, double rMax,
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
index 4c6b835b50ab..e24b76dfe7cc 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
@@ -23,6 +23,8 @@
 #include <vector>
 #include <string>
 
+#include "CxxUtils/checker_macros.h"
+
 #ifndef TRKDETDESCR_TAKESMALLERBIGGER
 #define TRKDETDESCR_TAKESMALLERBIGGER
 #define takeSmaller(current,test) current = current < test ? current : test
@@ -141,7 +143,7 @@ namespace InDet {
       /** AlgTool finalize method */
       StatusCode finalize();
       /** TrackingGeometry Interface methode */
-      const Trk::TrackingGeometry* trackingGeometry(const Trk::TrackingVolume* tvol = 0) const; 
+      const Trk::TrackingGeometry* trackingGeometry ATLAS_NOT_THREAD_SAFE (const Trk::TrackingVolume* tvol = 0) const; 
 
       /** The unique signature */
       Trk::GeometrySignature geometrySignature() const { return Trk::ID; }
@@ -163,7 +165,8 @@ namespace InDet {
                                    
                                    
       /** Private helper method to flush the cache into the id volumes - return volume is the one to be provided */
-      const Trk::TrackingVolume* createFlushVolume(std::vector<InDet::LayerSetup>& layerSetupCache,
+      const Trk::TrackingVolume* createFlushVolume ATLAS_NOT_THREAD_SAFE
+                                                  (std::vector<InDet::LayerSetup>& layerSetupCache,
                                                    double innerRadius, double& outerRadius, double extendZ) const;                                                         
         
       /** Private helper method, creates a TrackingVolume - and checks if configured - for Ring Layout 
@@ -179,7 +182,8 @@ namespace InDet {
       /** Private helper method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap layers
           - in case of a ring layout the subvolumes are created and the rMax is adapted                                             
          */
-      const Trk::TrackingVolume* packVolumeTriple(const LayerSetup& layerSetup,
+      const Trk::TrackingVolume* packVolumeTriple ATLAS_NOT_THREAD_SAFE
+                                                 (const LayerSetup& layerSetup,
                                                   double rMin, double& rMax,
                                                   double zMin, double zPosCentral) const;      
       
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
index 600faa007fa9..fcf44258dd04 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
@@ -18,6 +18,7 @@
 // Athena
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "CxxUtils/CachedUniquePtr.h"
+#include "CxxUtils/checker_macros.h"
 // Gaudi
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
@@ -144,7 +145,7 @@ namespace InDet {
       /** AlgTool finalize method */
       StatusCode finalize();
       /** TrackingGeometry Interface methode */
-      std::pair<EventIDRange, const Trk::TrackingGeometry*> trackingGeometry(const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*> tVolPair) const; 
+      std::pair<EventIDRange, const Trk::TrackingGeometry*> trackingGeometry ATLAS_NOT_THREAD_SAFE (const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*> tVolPair) const; 
 
       /** The unique signature */
       Trk::GeometrySignature geometrySignature() const { return Trk::ID; }
@@ -166,7 +167,8 @@ namespace InDet {
                                    
                                    
       /** Private helper method to flush the cache into the id volumes - return volume is the one to be provided */
-      const Trk::TrackingVolume* createFlushVolume(std::vector<InDet::LayerSetup>& layerSetupCache,
+      const Trk::TrackingVolume* createFlushVolume ATLAS_NOT_THREAD_SAFE
+                                                  (std::vector<InDet::LayerSetup>& layerSetupCache,
                                                    double innerRadius, double& outerRadius, double extendZ) const;                                                         
         
       /** Private helper method, creates a TrackingVolume - and checks if configured - for Ring Layout 
@@ -182,7 +184,8 @@ namespace InDet {
       /** Private helper method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap layers
           - in case of a ring layout the subvolumes are created and the rMax is adapted                                             
          */
-      const Trk::TrackingVolume* packVolumeTriple(const LayerSetup& layerSetup,
+      const Trk::TrackingVolume* packVolumeTriple ATLAS_NOT_THREAD_SAFE
+                                                 (const LayerSetup& layerSetup,
                                                   double rMin, double& rMax,
                                                   double zMin, double zPosCentral) const;      
       
-- 
GitLab


From b2e2350bdcabea3fface372b94b19e4bf2f4caa7 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 15 Sep 2020 19:41:38 +0200
Subject: [PATCH 165/422] PixelGeoModel: Thread-safety fix.

Declaration of PixelDetectorTool::registerCallback also needs to be
annotated as ATLAS_NOT_THREAD_SAFE.
---
 .../InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h
index 4f1c4b43bb44..e33824a5d569 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h
@@ -16,6 +16,8 @@
 #include "PixelGeoModel/IBLParameterSvc.h"
 #include "InDetGeoModelUtils/IInDetServMatBuilderTool.h"
 
+#include "CxxUtils/checker_macros.h"
+
 class PixelGeoModelAthenaComps;
 
 namespace InDetDD {
@@ -35,8 +37,8 @@ class PixelDetectorTool final : public GeoModelTool {
   virtual StatusCode create() override final;
   virtual StatusCode clear() override final;
 
-  // Register callback function on ConDB object
-  virtual StatusCode registerCallback() override final;
+  // Register callback function on CondDB object
+  virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override final;
 
   // Callback function itself
   virtual StatusCode align(IOVSVC_CALLBACK_ARGS) override;
-- 
GitLab


From 2f7cadbe9fa548c24dd192a18bf43318dd99a60d Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 15 Sep 2020 19:47:31 +0200
Subject: [PATCH 166/422] SCT_GeoModel: Thread-safety fix.

Declaration of SCTT_DetectorTool::registerCallback also needs to be
annotated as ATLAS_NOT_THREAD_SAFE.
---
 .../SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h          | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h
index 391ae9d64077..c16e113fb7be 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef SCT_GEOMODEL_SCT_DETECTORTOOL_H
@@ -12,6 +12,8 @@
 #include "GeoModelInterfaces/IGeoDbTagSvc.h"
 #include "RDBAccessSvc/IRDBAccessSvc.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include "GaudiKernel/ServiceHandle.h"
 
 #include <string>
@@ -29,8 +31,8 @@ public:
   virtual StatusCode create() override final;
   virtual StatusCode clear() override final;
 
-  // Register callback function on ConDB object
-  virtual StatusCode registerCallback() override final;
+  // Register callback function on CondDB object
+  virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override final;
 
   // Callback function itself
   virtual StatusCode align(IOVSVC_CALLBACK_ARGS) override;
-- 
GitLab


From e6e62759883ffbb2817d0932a4e472589fcf71e2 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 15 Sep 2020 19:45:07 +0200
Subject: [PATCH 167/422] TRT_GeoModel: Thread-safety fix.

Declaration of TRT_DetectorTool::registerCallback also needs to be
annotated as ATLAS_NOT_THREAD_SAFE.
---
 .../InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h        | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h
index df96a5f6705b..7d6a696c3f15 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h
@@ -9,6 +9,7 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h" //for Argon
+#include "CxxUtils/checker_macros.h"
 #include <string>
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -37,8 +38,8 @@ public:
     virtual StatusCode create() override final;
     virtual StatusCode clear() override final;
 
-    // Register callback function on ConDB object
-    virtual StatusCode registerCallback() override final;
+    // Register callback function on CondDB object
+    virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override final;
 
     // Callback function itself
     virtual StatusCode align(IOVSVC_CALLBACK_ARGS) override final;
-- 
GitLab


From e65ad8d026116c879f10d352e4ff084393558a9c Mon Sep 17 00:00:00 2001
From: Vadim Kostyukhin <vadim.kostyukhin@cern.ch>
Date: Wed, 16 Sep 2020 18:45:08 +0200
Subject: [PATCH 168/422] 1) Improve light jet rejection at high pt 2) Remove
 some code leftovers

---
 .../InDetVKalVxInJetTool.h                    | 15 ++---
 .../InDetVKalVxInJetTool/src/BTagVrtSec.cxx   | 55 +++++++++++--------
 .../src/BTagVrtSecMulti.cxx                   | 19 +++++--
 .../src/InDetVKalVxInJetTool.cxx              | 14 ++---
 .../InDetVKalVxInJetTool/src/Utilities.cxx    |  1 +
 5 files changed, 61 insertions(+), 43 deletions(-)

diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h
index fd3f55764ebc..4304da94a330 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h
@@ -144,8 +144,6 @@ namespace InDet {
       TH1D* m_hb_sig3D2tr{};
       TH1D* m_hb_sig3DNtr{};
       TH1D* m_hb_trkPtMax{};
-      TH1F* m_hb_blshared{};
-      TH1F* m_hb_pxshared{};
       TH1F* m_hb_rawVrtN{};
       TH1F* m_hb_lifetime{};
       TH1F* m_hb_trkPErr{};
@@ -203,7 +201,8 @@ namespace InDet {
       double m_rLayer2{};
       double m_rLayer3{};
 
-      bool     m_useVertexCleaning{};
+      bool     m_useVertexCleaningPix{};
+      bool     m_useVertexCleaningFMP{};
       bool     m_multiVertex{};
       bool     m_multiWithPrimary{};
       bool     m_getNegativeTail{};
@@ -258,7 +257,7 @@ namespace InDet {
        float    wgtB[maxNTrk];
        float    wgtL[maxNTrk];
        float    wgtG[maxNTrk];
-       float   Sig3D[maxNTrk];
+       float   sig3D[maxNTrk];
        int    chg[maxNTrk];
        int  nVrtT[maxNTrk];
        float TotM;
@@ -267,6 +266,7 @@ namespace InDet {
        float VrtSig3D[maxNVrt];
        float VrtSig2D[maxNVrt];
        float VrtDR[maxNVrt];
+       float VrtErrR[maxNVrt];
        float mass[maxNVrt];
        float Chi2[maxNVrt];
        int   itrk[maxNVrt];
@@ -274,6 +274,7 @@ namespace InDet {
        int badVrt[maxNVrt];
        int    ibl[maxNVrt];
        int     bl[maxNVrt];
+       float fhitR[maxNVrt];
        int        NTHF;
        int   itHF[maxNVrt];
        //---
@@ -488,9 +489,9 @@ namespace InDet {
      StatusCode VKalVrtFitFastBase(const std::vector<const xAOD::TrackParticle*>& listPart,Amg::Vector3D& Vertex, Trk::IVKalState& istate) const;
 
      template <class Track>
-     bool  Check2TrVertexInPixel( const Track* p1, const Track* p2, Amg::Vector3D &, std::vector<double> &) const;
+     bool  check2TrVertexInPixel( const Track* p1, const Track* p2, Amg::Vector3D &, std::vector<double> &) const;
      template <class Track>
-     bool  Check1TrVertexInPixel( const Track* p1, Amg::Vector3D &, std::vector<double> & ) const;
+     bool  check1TrVertexInPixel( const Track* p1, Amg::Vector3D &, std::vector<double> & ) const;
 
      void  getPixelLayers(const xAOD::TrackParticle* Part, int &blHit, int &l1Hit, int &l2Hit, int &nLay) const;
      void  getPixelDiscs(const xAOD::TrackParticle* Part, int &d0Hit, int &d1Hit, int &d2Hit) const;
@@ -548,7 +549,7 @@ namespace InDet {
   };
 
    template <class Track>
-   bool InDetVKalVxInJetTool::Check1TrVertexInPixel( const Track* p1, Amg::Vector3D &FitVertex, std::vector<double> &VrtCov)
+   bool InDetVKalVxInJetTool::check1TrVertexInPixel( const Track* p1, Amg::Vector3D &FitVertex, std::vector<double> &VrtCov)
    const
    {
 	int blTrk=0, blP=0, l1Trk=0, l1P=0, l2Trk=0, nLays=0; 
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx
index ff661fb9eac4..8b97cb857af1 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx
@@ -196,24 +196,21 @@ namespace InDet{
       if( listSecondTracks.size()==2 ){         // If there are 2 only tracks
         if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<" Start Ntr=2 vertex check"<<endmsg;
         int Charge=0;
-	uint8_t BLshared=0;
-	uint8_t PXshared=0;
-        for (auto i_ntrk : listSecondTracks) {
-            Charge +=  (int) i_ntrk->charge();
-            uint8_t retval=0;
-            if( i_ntrk->summaryValue( retval, xAOD::numberOfPixelSharedHits)  )  PXshared  += retval;
-            if( i_ntrk->summaryValue( retval, xAOD::numberOfInnermostPixelLayerSharedHits) )  BLshared  += retval;
-        }
+        for (auto i_ntrk : listSecondTracks) { Charge +=  (int) i_ntrk->charge();}
 	vrtVrtDist(primVrt, fitVertex, errorMatrix, Signif3D);
-        if(m_useVertexCleaning){
-          if(!Check2TrVertexInPixel(listSecondTracks[0],listSecondTracks[1],fitVertex,errorMatrix)) return 0;
-          if(m_fillHist){
-            double xDif=fitVertex.x()-m_xLayerB, yDif=fitVertex.y()-m_yLayerB ; 
-            double Dist2D=std::sqrt(xDif*xDif+yDif*yDif);
-            if     (Dist2D < m_rLayerB-vrtRadiusError(fitVertex,errorMatrix))  m_hb_blshared->Fill((float)BLshared,m_w_1);
-            else if(Dist2D > m_rLayerB+vrtRadiusError(fitVertex,errorMatrix))  m_hb_pxshared->Fill((float)PXshared,m_w_1);
-         }
-        } //end 2tr vertex cleaning code
+// Check track pixel hit patterns vs vertex position.
+        if(m_useVertexCleaningPix){
+          if(!check2TrVertexInPixel(listSecondTracks[0],listSecondTracks[1],fitVertex,errorMatrix)) return 0;
+        }
+// Check track first measured points vs vertex position.
+        if(m_useVertexCleaningFMP){
+          float hitR1  = listSecondTracks[0]->radiusOfFirstHit();
+          float hitR2  = listSecondTracks[1]->radiusOfFirstHit();
+          float vrErr  = vrtRadiusError(fitVertex, errorMatrix);
+          if(std::abs(hitR1-hitR2)>25.) return 0;                                 // Hits in different pixel layers
+          if( fitVertex.perp()-std::min(hitR1,hitR2) > 2.*vrErr) return 0; // Vertex is behind hit in pixel 
+        }
+//--------
 //
         if(m_fillHist){ if(Charge){m_hb_totmass2T1->Fill(Momentum.M(),m_w_1);}else{m_hb_totmass2T0->Fill(Momentum.M(),m_w_1);} }
         if( !Charge && std::abs(Momentum.M()-m_massK0)<15. ) {       // Final rejection of K0
@@ -522,10 +519,11 @@ namespace InDet{
                  if(getIdHF(selectedTracks[i]))m_curTup->idMC[i]=2;
 	         if(getMCPileup(selectedTracks[i]))m_curTup->idMC[i]=3;
 		 m_curTup->wgtB[i]=trkScore[i][0]; m_curTup->wgtL[i]=trkScore[i][1]; m_curTup->wgtG[i]=trkScore[i][2]; 
-		 m_curTup->Sig3D[i]=TrkSig3D[i];
+		 m_curTup->sig3D[i]=TrkSig3D[i];
 		 m_curTup->chg[i]=tmpPerigee[4]<0. ? 1: -1;
                  m_curTup->ibl[i]=hitIBL[i];
 		 m_curTup->bl[i]=hitBL[i];
+                 m_curTup->fhitR[i]=selectedTracks[i]->radiusOfFirstHit();
 		 TLorentzVector TLV=selectedTracks[i]->p4();
 		 m_curTup->pTvsJet[i]=TLV.Perp(jetDir.Vect());
 		 TLorentzVector normJ;  normJ.SetPtEtaPhiM(1.,jetDir.Eta(),jetDir.Phi(),0.);
@@ -569,7 +567,7 @@ namespace InDet{
              }
              m_fitSvc->setApproximateVertex(iniVrt.x(), iniVrt.y(), iniVrt.z(),*state);
              tmpVrt.i=i; tmpVrt.j=j;
-             m_fitSvc->setRobustness(4, *state);
+             m_fitSvc->setRobustness(6, *state);
              sc=VKalVrtFitBase(tracksForFit,tmpVrt.fitVertex, tmpVrt.momentum, Charge,
                                tmpVrt.errorMatrix, tmpVrt.chi2PerTrk, tmpVrt.trkAtVrt, tmpVrt.chi2,
                                *state, true);
@@ -578,13 +576,15 @@ namespace InDet{
 	     if(std::abs(tmpVrt.fitVertex.z())> 650.)     continue;  // definitely outside of Pixel detector
              Dist2D=tmpVrt.fitVertex.perp(); 
 	     if(Dist2D    > 180. )             continue;  // can't be from B decay
+
+	     double vrErr  = vrtRadiusError(tmpVrt.fitVertex, tmpVrt.errorMatrix);
+             if(vrErr>1.5&&getVrtScore(i,j,trkScore) < 4.*m_cutBVrtScore) continue;
+
              double mass_PiPi =  tmpVrt.momentum.M();  
 	     if(mass_PiPi > m_Vrt2TrMassLimit)      continue;  // can't be from B decay
              vrtVrtDist(primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, Signif3D);
 	     tmpVrt.signif3D=Signif3D;
              vrtVrtDist2D(primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, tmpVrt.signif2D);
-//This selection should not be used in the multi-vertex with primary mode
-	     if(!m_multiWithPrimary)if(getVrtScore(i,j,trkScore)*(1.-TMath::Prob(Signif3D*Signif3D,3)) < m_cutBVrtScore) continue;
 //---
              TVector3 SVmPV(tmpVrt.fitVertex.x()-primVrt.x(),tmpVrt.fitVertex.y()-primVrt.y(),tmpVrt.fitVertex.z()-primVrt.z());
              tmpVrt.dRSVPV=jetDir.DeltaR(TLorentzVector(SVmPV, 1.)); //DeltaR SV-PV vs jet
@@ -595,8 +595,15 @@ namespace InDet{
              if((!m_multiWithPrimary) &&(!m_getNegativeTail) && (!m_getNegativeTag) &&  jetVrtDir<0. )  continue; /* secondary vertex behind primary*/
 	     if(vPos<-100.) continue;                                              /* Secondary vertex is too far behind primary*/
 //
-// Check pixel hits vs vertex positions.
-             if(m_useVertexCleaning && !Check2TrVertexInPixel(selectedTracks[i],selectedTracks[j],tmpVrt.fitVertex,tmpVrt.errorMatrix)) continue;
+// Check track pixel hit patterns vs vertex position.
+             if(m_useVertexCleaningPix && !check2TrVertexInPixel(selectedTracks[i],selectedTracks[j],tmpVrt.fitVertex,tmpVrt.errorMatrix)) continue;
+// Check track first measured points vs vertex position.
+             if(m_useVertexCleaningFMP){
+               float ihitR  = selectedTracks[i]->radiusOfFirstHit();
+               float jhitR  = selectedTracks[j]->radiusOfFirstHit();
+               if(std::abs(ihitR-jhitR)>25.) continue;                            // Hits in different pixel layers
+               if( tmpVrt.fitVertex.perp()-std::min(ihitR,jhitR) > 2.*vrErr) continue; // Vertex is behind hit in pixel 
+             }
 //--------
 //
              double signif3Dproj=vrtVrtDist( primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, jetDir);
@@ -776,7 +783,7 @@ namespace InDet{
 
 
    template <class Track>
-   bool InDetVKalVxInJetTool::Check2TrVertexInPixel( const Track* p1, const Track* p2,
+   bool InDetVKalVxInJetTool::check2TrVertexInPixel( const Track* p1, const Track* p2,
                                               Amg::Vector3D &fitVertex, std::vector<double> & vrtErr)
    const
    {
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSecMulti.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSecMulti.cxx
index 3971a4807f7e..13e8cdfd2973 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSecMulti.cxx
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSecMulti.cxx
@@ -450,7 +450,7 @@ InDetVKalVxInJetTool::getVrtSecMulti(workVectorArrxAOD* xAODwrk,
           vrtVrtDist(primVrt,curVrt.vertex, curVrt.vertexCov, Signif3D); //VK non-projected Signif3D is worse
           double tmpProb=TMath::Prob( curVrt.chi2, 1);                 //Chi2 of the original 2tr vertex
           bool trkGood=false;
-          if(xAODwrk)trkGood=Check1TrVertexInPixel(xAODwrk->listJetTracks[curVrt.selTrk[0]],curVrt.vertex,curVrt.vertexCov);
+          if(xAODwrk)trkGood=check1TrVertexInPixel(xAODwrk->listJetTracks[curVrt.selTrk[0]],curVrt.vertex,curVrt.vertexCov);
           if(trkGood && tmpProb>0.01){  /* accept only good tracks coming from good 2tr vertex*/
              //if( useMaterialRejection && insideMatLayer(curVrt.vertex.x(),curVrt.vertex.y()) ) continue;
              std::vector<double> Impact,ImpactError;   double Signif3DP = 0;
@@ -489,10 +489,19 @@ InDetVKalVxInJetTool::getVrtSecMulti(workVectorArrxAOD* xAODwrk,
 //        Dist3D=((*wrkVrtSet)[iv].vertex-primVrt.position()).mag();            /* Not needed currently*/
 //        if(PrmVrtAdded && iv==PrmVrtAdded && Dist3D<3.5) continue;  /* Skip added primary vertex */
 //-----------------------------------------------------------------------------------------
-          if(nth==2 && m_useVertexCleaning){
-        if(xAODwrk){
-	       if(!Check2TrVertexInPixel(xAODwrk->tmpListTracks[0],xAODwrk->tmpListTracks[1],curVrt.vertex,curVrt.vertexCov))continue;
-            }
+          if(nth==2 && xAODwrk){
+// Check track pixel hit patterns vs vertex position.
+             if(m_useVertexCleaningPix){
+	       if(!check2TrVertexInPixel(xAODwrk->tmpListTracks[0],xAODwrk->tmpListTracks[1],curVrt.vertex,curVrt.vertexCov))continue;
+             }
+// Check track first measured points vs vertex position.
+             if(m_useVertexCleaningFMP){
+               float ihitR  = xAODwrk->tmpListTracks[0]->radiusOfFirstHit();
+               float jhitR  = xAODwrk->tmpListTracks[1]->radiusOfFirstHit();
+	       float vrErr  = vrtRadiusError(curVrt.vertex, curVrt.vertexCov);
+               if(std::abs(ihitR-jhitR)>25.) continue;                            // Hits in different pixel layers
+               if( curVrt.vertex.perp()-std::min(ihitR,jhitR) > 2.*vrErr) continue; // Vertex is behind hit in pixel 
+             }
 	  }
 //
 //---  Check interactions on pixel layers
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx
index f2c8e4a0935b..ca297c489c9f 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx
@@ -62,7 +62,8 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
     m_rLayerB   (0.),  // in jobO or initialize()
     m_rLayer1   (0.),
     m_rLayer2   (0.),
-    m_useVertexCleaning(false),
+    m_useVertexCleaningPix(false),
+    m_useVertexCleaningFMP(false),
     m_multiVertex(false),
     m_multiWithPrimary(false),
     m_getNegativeTail(false),
@@ -120,7 +121,8 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
     declareProperty("Rlayer1",   m_rLayer1  );
     declareProperty("Rlayer2",   m_rLayer2  );
 
-    declareProperty("useVertexCleaning",     m_useVertexCleaning,    "Clean vertices by requiring pixel hit presence according to vertex position" );
+    declareProperty("useVertexCleaningPix", m_useVertexCleaningPix, "Clean vertices requiring track pixel hit patterns according to vertex position" );
+    declareProperty("useVertexCleaningFMP", m_useVertexCleaningFMP, "Clean vertices requiring track F(irst) M(easured) P(oints) matching to vertex position" );
 
     declareProperty("MultiVertex",        m_multiVertex,       "Run Multiple Secondary Vertices in jet finder"  );
     declareProperty("MultiWithPrimary",   m_multiWithPrimary,  "Find Multiple Secondary Vertices + primary vertex in jet. MultiVertex Finder only!"  );
@@ -245,8 +247,6 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
          m_hb_distVV     = new TH1D("distvv","Vertex-Vertex dist", 100,0., 20.);
          m_hb_diffPS     = new TH1D("diffPS","Primary-Secondary assoc", 200,-20., 20.);
          m_hb_trkPtMax   = new TH1D("trkPtMax","Maximal track Pt to jet", 100, 0., 5000.);
-         m_hb_blshared   = new TH1F("blshared","Number of shared hits in B-layer for R<BL", 5, 0., 5.);
-         m_hb_pxshared   = new TH1F("pxshared","Number of shared hits in pixel for R>BL", 5, 0., 5.);
          m_hb_rawVrtN    = new TH1F("rawVrtN","Number of raw vertices multivertex case", 20, 0., 20.);
          m_hb_lifetime   = new TH1F("lifetime","Distance/momentum", 100, 0., 5.);
          m_hb_trkPErr    = new TH1F("trkPErr","Track momentum error for P>10 GeV", 100, 0., 0.5);
@@ -299,8 +299,6 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
        sc = hist_root->regHist(histDir+"distVV",    m_hb_distVV);
        sc = hist_root->regHist(histDir+"diffPS",    m_hb_diffPS);
        sc = hist_root->regHist(histDir+"trkPtMax",  m_hb_trkPtMax);
-       sc = hist_root->regHist(histDir+"blshared",  m_hb_blshared);
-       sc = hist_root->regHist(histDir+"pxshared",  m_hb_pxshared);
        sc = hist_root->regHist(histDir+"rawVrtN",   m_hb_rawVrtN);
        sc = hist_root->regHist(histDir+"lifetime",  m_hb_lifetime);
        sc = hist_root->regHist(histDir+"trkPErr",   m_hb_trkPErr);
@@ -332,10 +330,11 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
           m_tuple->Branch("wgtB",        &m_curTup->wgtB,      "wgtB[ntrk]/F");
           m_tuple->Branch("wgtL",        &m_curTup->wgtL,      "wgtL[ntrk]/F");
           m_tuple->Branch("wgtG",        &m_curTup->wgtG,      "wgtG[ntrk]/F");
-          m_tuple->Branch("Sig3D",       &m_curTup->Sig3D,     "Sig3D[ntrk]/F");
+          m_tuple->Branch("sig3D",       &m_curTup->sig3D,     "sig3D[ntrk]/F");
           m_tuple->Branch("idMC",        &m_curTup->idMC,      "idMC[ntrk]/I");
           m_tuple->Branch("ibl",         &m_curTup->ibl,       "ibl[ntrk]/I");
           m_tuple->Branch("bl",          &m_curTup->bl,        "bl[ntrk]/I");
+          m_tuple->Branch("fhitR",       &m_curTup->fhitR,     "fhitRR[ntrk]/F");
           m_tuple->Branch("SigR",        &m_curTup->SigR,      "SigR[ntrk]/F");
           m_tuple->Branch("SigZ",        &m_curTup->SigZ,      "SigZ[ntrk]/F");
           m_tuple->Branch("d0",          &m_curTup->d0,        "d0[ntrk]/F");
@@ -352,6 +351,7 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
           m_tuple->Branch("VrtSig3D",    &m_curTup->VrtSig3D,  "VrtSig3D[nvrt]/F");
           m_tuple->Branch("VrtSig2D",    &m_curTup->VrtSig2D,  "VrtSig2D[nvrt]/F");
           m_tuple->Branch("VrtDR",       &m_curTup->VrtDR,     "VrtDR[nvrt]/F");
+          m_tuple->Branch("VrtErrR",     &m_curTup->VrtErrR,   "VrtErrR[nvrt]/F");
           m_tuple->Branch("itrk",        &m_curTup->itrk,      "itrk[nvrt]/I");
           m_tuple->Branch("jtrk",        &m_curTup->jtrk,      "jtrk[nvrt]/I");
           m_tuple->Branch("badV",        &m_curTup->badVrt,    "badV[nvrt]/I");
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx
index 486b9f8105d9..afdf92fa24ef 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx
@@ -605,6 +605,7 @@ namespace InDet{
 	   m_curTup->Chi2[ipnt]=vrt.chi2;
 	   m_curTup->badVrt[ipnt]=vrt.badVrt;
 	   m_curTup->VrtDR[ipnt]=vrt.dRSVPV;
+	   m_curTup->VrtErrR[ipnt]= vrtRadiusError(vrt.fitVertex, vrt.errorMatrix);
            ipnt++; m_curTup->nVrt=ipnt;
         }
   } 
-- 
GitLab


From 4e162a74e7074694442efb0c6b16b605c899e678 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Wed, 16 Sep 2020 18:43:09 +0100
Subject: [PATCH 169/422] Added GeoModeSvc and DetDescrSvc only in complete
 jobs

---
 Control/AthenaConfiguration/python/ComponentAccumulator.py | 4 ++--
 Control/AthenaConfiguration/python/MainServicesConfig.py   | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py
index 38ca24ddc65b..79abef8a0f44 100644
--- a/Control/AthenaConfiguration/python/ComponentAccumulator.py
+++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py
@@ -24,8 +24,8 @@ from AthenaConfiguration.UnifyProperties import unifySet
 
 class ConfigurationError(RuntimeError):
     pass
-_basicServicesToCreate=('CoreDumpSvc','GeoModelSvc','DetDescrCnvSvc')
-_basicServicesToCreateOrder=_basicServicesToCreate
+_basicServicesToCreate=()
+_basicServicesToCreateOrder=("CoreDumpSvc","GeoModelSvc", "DetDescrCnvSvc")+_basicServicesToCreate
 
 
 
diff --git a/Control/AthenaConfiguration/python/MainServicesConfig.py b/Control/AthenaConfiguration/python/MainServicesConfig.py
index 83dacda189f6..de49472b6d3e 100644
--- a/Control/AthenaConfiguration/python/MainServicesConfig.py
+++ b/Control/AthenaConfiguration/python/MainServicesConfig.py
@@ -77,7 +77,10 @@ def MainServicesCfg(cfgFlags):
     cfg.addService(StoreGateSvc("DetectorStore"))
     cfg.addService(StoreGateSvc("HistoryStore"))
     cfg.addService(StoreGateSvc("ConditionStore"))
-    
+
+    cfg.addService(CompFactory.GeoModelSvc(), create=True)
+    cfg.addService(CompFactory.DetDescrCnvSvc(), create=True)
+
     cfg.addService(CompFactory.CoreDumpSvc())
 
     cfg.setAppProperty('InitializationLoopCheck',False)
-- 
GitLab


From a78804f59f3730a544482808852cf385b2b64aaa Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Wed, 16 Sep 2020 11:07:34 -0700
Subject: [PATCH 170/422] Best vertex has max MVA score, don't include beam err
 Z in DZ calculations

---
 .../TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx | 8 ++++----
 .../Root/MVATrackVertexAssociationTool.cxx                | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
index 063ed86dff92..1554b0a52755 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
@@ -176,8 +176,8 @@ class ErrDZ: public MiniEvaluator {
 public:
   ErrDZ() {};
   ~ErrDZ() override final {};
-  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const override final {
-    return std::sqrt(trk.definingParametersCovMatrix()(1, 1) + std::pow(evt.beamPosSigmaZ(), 2) + vx.covariancePosition()(2, 2));
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(1, 1) + vx.covariancePosition()(2, 2));
   }
 };
 
@@ -194,11 +194,11 @@ class ErrDZSinTheta: public MiniEvaluator {
 public:
   ErrDZSinTheta() {};
   ~ErrDZSinTheta() override final {};
-  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const override final {
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
     float dz         = (trk.z0() + trk.vz() - vx.z());
     float sinTheta   = std::sin(trk.theta());
     float cosTheta   = std::cos(trk.theta());
-    float errSqDZ    = trk.definingParametersCovMatrix()(1, 1) + std::pow(evt.beamPosSigmaZ(), 2) + vx.covariancePosition()(2, 2);
+    float errSqDZ    = trk.definingParametersCovMatrix()(1, 1) + vx.covariancePosition()(2, 2);
     float errSqTheta = trk.definingParametersCovMatrix()(3, 3);
     float covZ0Theta = trk.definingParametersCovMatrix()(1, 3);
     return (errSqDZ * std::pow(sinTheta, 2) + std::pow(dz * cosTheta, 2) * errSqTheta + 2 * sinTheta * dz * cosTheta * covZ0Theta);
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
index f9cfe4e337e5..02d6024696db 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -172,13 +172,13 @@ const xAOD::Vertex* MVATrackVertexAssociationTool::getUniqueMatchVertexInternal(
 
   bool match;
   float mvaOutput;
-  float minValue = 999.0; // MVA output ranges between 0 and 1
+  float maxValue = -1.0; // MVA output ranges between 0 and 1
   const xAOD::Vertex* bestMatchVertex = nullptr;
 
   for (const auto& vertex : vx_list) {
     match = isMatch(trk, *vertex, mvaOutput);
-    if (match && (mvaOutput < minValue)) {
-      minValue = mvaOutput;
+    if (match && (maxValue < mvaOutput)) {
+      maxValue = mvaOutput;
       bestMatchVertex = vertex;
     }
   }
-- 
GitLab


From 2772d3a016cba31aaa3353916e6964d02eb65170 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 21 Aug 2020 13:22:58 -0400
Subject: [PATCH 171/422] MuonByteStreamCnvTest: Fix cppcheck warnings.

Avoid using postincrement for iterators.
Change to range-for.
---
 .../src/MuonRdoToMuonDigitTool.cxx              |  7 +++----
 .../src/TgcRdoToTgcDigit.cxx                    | 17 +++++++----------
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx
index 2e2a2dfb3abd..b5c9db86e373 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx
@@ -730,11 +730,10 @@ StatusCode MuonRdoToMuonDigitTool::decodeTgc (const TgcRdo& rdoColl,
               }
 
 	      // check duplicate digits
-	      TgcDigitCollection::const_iterator it_tgcDigit;
 	      bool duplicate = false;
-	      for (it_tgcDigit=coll->begin(); it_tgcDigit != coll->end(); it_tgcDigit++) {
-		if ((newDigit->identify() == (*it_tgcDigit)->identify()) && 
-		    (newDigit->bcTag()    == (*it_tgcDigit)->bcTag())) {
+              for (const TgcDigit* digit : *coll) {
+		if ((newDigit->identify() == digit->identify()) && 
+		    (newDigit->bcTag()    == digit->bcTag())) {
 		  duplicate = true;
 		  ATH_MSG_DEBUG( "Duplicate TGC Digit removed"   );
 		  break;
diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcRdoToTgcDigit.cxx b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcRdoToTgcDigit.cxx
index f0ce17ddafc3..cac20878035f 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcRdoToTgcDigit.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcRdoToTgcDigit.cxx
@@ -99,10 +99,8 @@ StatusCode TgcRdoToTgcDigit::decodeTgc( const TgcRdo *rdoColl,
       }
     }
     // Covert to original hit patterns
-    std::map<std::vector<uint16_t>, uint16_t>::iterator jtMap   = stripMap.begin();
-    std::map<std::vector<uint16_t>, uint16_t>::iterator jtMap_e = stripMap.end();
-    for(; jtMap!=jtMap_e; jtMap++) {
-      if(jtMap->second<=31) {
+    for (auto& jtPair : stripMap) {
+      if(jtPair.second<=31) {
         // x    : 5-bit variable
         // f(x) : OR function above, Digit->RDO conversion
         // g(x) : originalHitBits which satisfies f(g(f(x))) = f(x), RDO->Digit conversion
@@ -116,9 +114,9 @@ StatusCode TgcRdoToTgcDigit::decodeTgc( const TgcRdo *rdoColl,
           // 24  25  26  27  28  29  30  31
           16, 17,  0, 19, 24, 25, 28, 31
         };
-        jtMap->second = originalHitBits[jtMap->second];
+        jtPair.second = originalHitBits[jtPair.second];
       } else {
-        jtMap->second = 0;
+        jtPair.second = 0;
       }
     }
     // TGC2 Endcap Strip OR channel treatement preparation end
@@ -248,11 +246,10 @@ StatusCode TgcRdoToTgcDigit::decodeTgc( const TgcRdo *rdoColl,
           }
 
           // check duplicate digits
-          TgcDigitCollection::const_iterator it_tgcDigit;
           bool duplicate = false;
-          for (it_tgcDigit=collection->begin(); it_tgcDigit != collection->end(); it_tgcDigit++) {
-            if ((newDigit->identify() == (*it_tgcDigit)->identify()) &&
-                (newDigit->bcTag()    == (*it_tgcDigit)->bcTag())) {
+          for (const TgcDigit* digit : *collection) {
+            if ((newDigit->identify() == digit->identify()) &&
+                (newDigit->bcTag()    == digit->bcTag())) {
               duplicate = true;
               ATH_MSG_DEBUG( "Duplicate TGC Digit removed"   );
               break;
-- 
GitLab


From d29479fce9fb36cb42e3ee5be4bbf722842f3d72 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 12 Sep 2020 16:43:12 -0400
Subject: [PATCH 172/422] G4AtlasInterfaces: Fix cppcheck warning.

 - Pass class instances by const reference, not by value.
---
 .../G4AtlasInterfaces/IDetectorGeometryTool.h                 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IDetectorGeometryTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IDetectorGeometryTool.h
index 07cc9a9e830f..40ad9ab57c79 100644
--- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IDetectorGeometryTool.h
+++ b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IDetectorGeometryTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASINTERFACES_IDETECTORGEOMETRYTOOL_H
@@ -53,7 +53,7 @@ class IDetectorGeometryTool : virtual public IAlgTool {
   
   virtual std::string GetDetectorName() const = 0;
   
-  virtual void SetDetectorName(std::string) = 0;
+  virtual void SetDetectorName(const std::string&) = 0;
   
   virtual void SetParent(IDetectorGeometryTool*) = 0;
   
-- 
GitLab


From 1475278323ada57e9962cbd850e5b092f719cb5a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 12 Sep 2020 16:44:27 -0400
Subject: [PATCH 173/422] G4AtlasTools: Fix cppcheck warnings.

 - Pass class instances by const reference, not by value.
---
 .../G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h    | 2 +-
 .../G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h  | 2 +-
 Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx    | 2 +-
 Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h
index e62faf61727d..7c46b8eb3157 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h
@@ -52,7 +52,7 @@ public:
 
   std::string GetDetectorName() const override;
 
-  void SetDetectorName(const std::string) override;
+  void SetDetectorName(const std::string&) override;
 
   void SetParent(IDetectorGeometryTool*) override;
 
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h
index 64e3149c22bf..dc62378f8b2d 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h
@@ -55,7 +55,7 @@ class G4FieldManagerToolBase : public extends<AthAlgTool, IFieldManagerTool>
 #if G4VERSION_NUMBER < 1040
     /// Common method to construct a stepper of requested type.
     G4MagIntegratorStepper*
-    getStepper(std::string stepperType, G4MagneticField* field) const;
+    getStepper(const std::string& stepperType, G4MagneticField* field) const;
 #endif
 
     /// Common method to apply configuredfield parameters
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx b/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx
index ed9f7ada0b82..f3b716184fd0 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx
@@ -162,7 +162,7 @@ void DetectorGeometryBase::ResetEnvelope()
 {
 }
 
-void DetectorGeometryBase::SetDetectorName(const std::string s)
+void DetectorGeometryBase::SetDetectorName(const std::string& s)
 {
   m_detectorName=s;
 }
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx b/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx
index 57d0e2281df9..72c9ba445d1d 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx
@@ -190,7 +190,7 @@ G4FieldManagerToolBase::createDriverAndStepper(std::string name, G4MagneticField
 // Create the stepper (Geant4 < 10.4)
 //=============================================================================
 G4MagIntegratorStepper*
-G4FieldManagerToolBase::getStepper(std::string name, G4MagneticField* field) const
+G4FieldManagerToolBase::getStepper(const std::string& name, G4MagneticField* field) const
 {
   ATH_MSG_DEBUG("getStepper");
   G4Mag_EqRhs* eqRhs(nullptr);
-- 
GitLab


From fa03c3696a716df19337284662f7b7562fd55064 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sun, 13 Sep 2020 13:42:37 -0400
Subject: [PATCH 174/422] LArG4H6SD: Fix cppcheck warnings.

 - Prefer using an initializer list to assigning members
   in a ctor body.
 - Prefer preincrement (or range for) to postincrement for iterators.
---
 LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H6WarmTCSD.cc     | 6 +++---
 .../LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.cc      | 8 ++++----
 .../LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.h       | 6 +++---
 .../LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.cc     | 6 +++---
 .../LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.h      | 6 +++---
 5 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H6WarmTCSD.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H6WarmTCSD.cc
index cb401764dfb3..20c296c9fabb 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H6WarmTCSD.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H6WarmTCSD.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArG4H6WarmTCSD.h"
@@ -181,9 +181,9 @@ void LArG4H6WarmTCSD::EndOfAthenaEvent()
   //G4int HCID;
   G4String cnam;
   hitIt i;
-  for (i = m_hits.begin(); i != m_hits.end(); i++ ) {
+  for (const auto& p : m_hits) {
     //      m_Collection->insert( i->second );
-    m_Collection->push_back(i->second);
+    m_Collection->push_back(p.second);
   }
   m_hits.clear();
 }
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.cc
index a30ac65cb485..081e227cf5b8 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // LArG4TBECBeamChCalculator
@@ -12,10 +12,10 @@
 #include "globals.hh"
 
 LArG4TBECBeamChCalculator::LArG4TBECBeamChCalculator(void)
+  : m_number (-1),
+    m_x (0),
+    m_y (0)
 {
-  m_number = -1;
-  m_x = 0.;
-  m_y = 0.;
   G4cout << "LArG4TBECBeamChCalculator ready" << G4endl;
 }
 
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.h b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.h
index 32c9e8ed12bc..db0133d3bfdf 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.h
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.h
@@ -1,9 +1,9 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef __LArG4TBECBeamChCalculator_H__
-#define __LArG4TBECBeamChCalculator_H__
+#ifndef LARG4H6SD_LARG4TBECBEAMCHCALCULATOR_H
+#define LARG4H6SD_LARG4TBECBEAMCHCALCULATOR_H
 
 #include "globals.hh"
 #include "G4ThreeVector.hh"
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.cc
index ae95f9549ebc..71e51032f259 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // LArG4TBECBeamChSensitiveDetector
@@ -85,8 +85,8 @@ G4bool LArG4TBECBeamChSensitiveDetector::ProcessHits(G4Step* a_step,
 #endif
 
         G4bool found = false;
-        for(m_Hit_pointer i = m_Hits.begin(); i != m_Hits.end(); i ++){
-                if((*i)->getIdentifier() == ident){
+        for (const LArG4TBECBeamChHit* hit : m_Hits) {
+                if(hit->getIdentifier() == ident){
                         found = true;
                         break;
                 }
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.h b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.h
index 0064ec9f5576..727a0575e596 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.h
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.h
@@ -1,10 +1,10 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // LArG4TBECBeamChSensitiveDetector.hh
-#ifndef __LArG4TBECBeamChSensitiveDetector_H__
-#define __LArG4TBECBeamChSensitiveDetector_H__
+#ifndef  LARG4H6SD_LARG4TBECBEAMCHSENSITIVEDETECTOR_H
+#define  LARG4H6SD_LARG4TBECBEAMCHSENSITIVEDETECTOR_H
 
 #include "LArG4TBECBeamChHit.h"
 
-- 
GitLab


From e4c6babcacba7577e60b4b3e5edf6f1912537bfc Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sun, 13 Sep 2020 14:23:58 -0400
Subject: [PATCH 175/422] TrackWriteFastSim: const fix

Update to work with upcoming const fix in MCTruth.
---
 .../G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx b/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx
index 0e49b78b3285..80473b6ece8f 100644
--- a/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx
+++ b/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrackWriteFastSim/NeutronFastSim.h"
@@ -51,7 +51,7 @@ G4bool NeutronFastSim::ModelTrigger(const G4FastTrack& fastTrack)
 
   // Not a neutron... Pick it up if the primary had eta>6.0
   AtlasG4EventUserInfo *atlasG4EvtUserInfo=static_cast<AtlasG4EventUserInfo*>(G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetUserInformation());
-  HepMC::GenParticlePtr gp = atlasG4EvtUserInfo->GetCurrentPrimary();
+  HepMC::ConstGenParticlePtr gp = atlasG4EvtUserInfo->GetCurrentPrimary();
   if (std::abs(gp->momentum().eta())>m_etaCut && HepMC::barcode(gp)<200000){
     return true;
   } else {
-- 
GitLab


From a1fbce8e3c06074f6fcc44d24357b915f2dd3b7b Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 14 Sep 2020 09:20:09 -0400
Subject: [PATCH 176/422] TrkRIO_OnTrackCreator: Rework to remove thread-safety
 annotations.

Add a lock to make KitManager explicitly thread-safe.
Allows removing most thread-safety annotations.
---
 .../TrkRIO_OnTrackCreator/src/KitManager.cxx        |  3 +++
 .../TrkTools/TrkRIO_OnTrackCreator/src/KitManager.h | 13 ++++++++-----
 .../src/RIO_OnTrackErrorScalingCondAlg.cxx          | 10 +++++-----
 .../src/RIO_OnTrackErrorScalingCondAlg.h            |  2 +-
 .../RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx    |  2 +-
 .../src/RIO_OnTrackErrorScalingIDKits.cxx           |  2 +-
 .../src/RIO_OnTrackErrorScalingMuonKits.cxx         |  2 +-
 7 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.cxx
index ef3026908652..6dc17028dd38 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.cxx
@@ -9,10 +9,12 @@ KitManagerBase::KitManagerBase() {}
 KitManagerBase::~KitManagerBase() {}
 
 const void *KitManagerBase::kitPtr(const std::string &name) const {
+  std::lock_guard<std::mutex> lock (m_mutex);
   return m_registry.at(name);
 }
 
 bool KitManagerBase::registerKit(const std::string& name, const void *a_kit) {
+  std::lock_guard<std::mutex> lock (m_mutex);
   std::pair<std::string, const void *> elm = std::make_pair(name, a_kit);
   if (!m_registry.insert(elm).second) {
     std::stringstream message;
@@ -23,6 +25,7 @@ bool KitManagerBase::registerKit(const std::string& name, const void *a_kit) {
 }
 
 void KitManagerBase::dumpKits(std::ostream &out) const {
+  std::lock_guard<std::mutex> lock (m_mutex);
   for(const std::pair<const std::string, const void *> &elm: m_registry) {
     out << " " << elm.first;
   }
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.h b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.h
index dae3f24c8fee..3c1a7d4bfd7e 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.h
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.h
@@ -1,12 +1,13 @@
 /*
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
-#ifndef _KitManager_H_
-#define _KitManager_H_
+#ifndef TRKRIO_ONTRACKCREATOR_KITMANAGER_H
+#define TRKRIO_ONTRACKCREATOR_KITMANAGER_H
 
 #include <ostream>
 #include <map>
 #include <memory>
+#include <mutex>
 #include "CxxUtils/checker_macros.h"
 
 class KitManagerBase
@@ -19,6 +20,7 @@ protected:
 
   bool registerKit(const std::string& name, const void *a_kit);
 
+  mutable std::mutex m_mutex;
   std::map<std::string, const void * > m_registry;
 public:
   void dumpKits(std::ostream &out) const;
@@ -45,11 +47,12 @@ public:
   }
 
   static
-  KitManager<T_KitInterface>& instance ATLAS_NOT_THREAD_SAFE () {
+  KitManager<T_KitInterface>& instance() {
     /* in C++11 this is to happen once the issue is that we return a ref
      * rather than const ref. To be thread safe we need to have static const */
-    static std::unique_ptr<KitManager<T_KitInterface>> s_instance = std::make_unique<KitManager<T_KitInterface>>();
-    return *s_instance;
+    // Map is protected with a lock.
+    static KitManager<T_KitInterface> s_instance ATLAS_THREAD_SAFE;
+    return s_instance;
   }
 };
 
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx
index f41665819214..9add5a3cc823 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx
@@ -15,7 +15,7 @@ RIO_OnTrackErrorScalingCondAlg::RIO_OnTrackErrorScalingCondAlg(const std::string
 {
 }
 
-StatusCode RIO_OnTrackErrorScalingCondAlg::initialize ATLAS_NOT_THREAD_SAFE() {
+StatusCode RIO_OnTrackErrorScalingCondAlg::initialize() {
   ATH_CHECK(m_condSvc.retrieve());
   ATH_CHECK(m_readKey.initialize());
 
@@ -61,13 +61,13 @@ StatusCode RIO_OnTrackErrorScalingCondAlg::addErrorScaling (const std::string &t
   catch (std::runtime_error &err) {
     std::stringstream types;
     RIO_OnTrackErrorScalingKitManager::instance().dumpKits(types);
-    ATH_MSG_FATAL( "Invalide ErrorScalking type name : " << type_name << ". Registered types:" << types.str() );
+    ATH_MSG_FATAL( "Invalid ErrorScaling type name : " << type_name << ". Registered types:" << types.str() );
     return StatusCode::FAILURE;
   }
   catch (std::exception &err) {
     std::stringstream types;
     RIO_OnTrackErrorScalingKitManager::instance().dumpKits(types);
-    ATH_MSG_FATAL( "Caught exception: " << err.what() << " Invalide ErrorScalking type name : " << type_name << ". Registered types:" << types.str() );
+    ATH_MSG_FATAL( "Caught exception: " << err.what() << " Invalid ErrorScaling type name : " << type_name << ". Registered types:" << types.str() );
     return StatusCode::FAILURE;
   }
   m_kits.push_back(the_kit);
@@ -87,10 +87,10 @@ public:
   }
 
   template <typename T_Obj>
-  std::string dumpKeys ATLAS_NOT_THREAD_SAFE () const {
+  std::string dumpKeys() const {
     std::stringstream out;
     std::vector<std::string> keys_out;
-    const_cast<StoreGateSvc *>(this->getCS())->keys<T_Obj>(keys_out,true,false);
+    this->getCS()->template keys<T_Obj>(keys_out,true,false);
     for(const std::string &a_key : keys_out) {
       out << " " << a_key;
     }
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.h b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.h
index fd4c86c764d3..8b616737e041 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.h
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.h
@@ -29,7 +29,7 @@ class RIO_OnTrackErrorScalingCondAlg : public AthAlgorithm
 
  private:
 
-  StatusCode addErrorScaling ATLAS_NOT_THREAD_SAFE (const std::string &type_name);
+  StatusCode addErrorScaling(const std::string &type_name);
   void registerAttribute(const std::string& name, unsigned int type_idx, unsigned int param_idx);
 
   SG::ReadCondHandleKey<CondAttrListCollection> m_readKey
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx
index af9494ba61ee..45b2d1f1ceec 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx
@@ -13,7 +13,7 @@ RIO_OnTrackErrorScalingDbOverrideCondAlg::RIO_OnTrackErrorScalingDbOverrideCondA
 {
 }
 
-StatusCode RIO_OnTrackErrorScalingDbOverrideCondAlg::initialize ATLAS_NOT_THREAD_SAFE () {
+StatusCode RIO_OnTrackErrorScalingDbOverrideCondAlg::initialize() {
   ATH_CHECK(m_condSvc.retrieve());
   if (m_writeKey.key().empty()) {
     ATH_MSG_FATAL("No conditions data write key specified.");
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx
index 81871ac93b0e..0011bb440f25 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx
@@ -58,7 +58,7 @@ public:
 
 namespace {
   // register all kits with the help of a dumm function which sets a global anonymous bool
-  bool registered = ( []() ATLAS_NOT_THREAD_SAFE-> bool {
+  bool registered = ( []() -> bool {
     return
          RIO_OnTrackErrorScalingKitManager::instance().registerKit("PixelRIO_OnTrackErrorScaling",    new PixelRIO_OnTrackErrorScalingKit)
       && RIO_OnTrackErrorScalingKitManager::instance().registerKit("PixelRIO_OnTrackErrorScalingRun1",new PixelRIO_OnTrackErrorScalingRun1Kit)
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx
index 743c37f3b2f5..d4627607fc30 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx
@@ -55,7 +55,7 @@ public:
 
 namespace {
   // register all kits with the help of a dummy function which sets a global anonymous bool
-  bool registered = ( [] () ATLAS_NOT_THREAD_SAFE -> bool {
+  bool registered = ( [] () -> bool {
     return
          RIO_OnTrackErrorScalingKitManager::instance().registerKit("RPCRIO_OnTrackErrorScaling",    new MuonEtaPhiRIO_OnTrackErrorScalingKit("RPC"))
       && RIO_OnTrackErrorScalingKitManager::instance().registerKit("TGCRIO_OnTrackErrorScaling",    new MuonEtaPhiRIO_OnTrackErrorScalingKit("TGC"))
-- 
GitLab


From 05f8040305e526447398e48de81f3ff91f965cd0 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Thu, 17 Sep 2020 05:23:52 +0200
Subject: [PATCH 177/422] added EleRNN WPs

---
 Event/xAOD/xAODTau/xAODTau/TauDefs.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Event/xAOD/xAODTau/xAODTau/TauDefs.h b/Event/xAOD/xAODTau/xAODTau/TauDefs.h
index f8c7bbea70ad..d3606712c007 100644
--- a/Event/xAOD/xAODTau/xAODTau/TauDefs.h
+++ b/Event/xAOD/xAODTau/xAODTau/TauDefs.h
@@ -144,6 +144,9 @@ namespace TauJetParameters
         JetRNNSigLoose          = 29,
         JetRNNSigMedium         = 30,
         JetRNNSigTight          = 31,
+        EleRNNLoose          = 32,
+        EleRNNMedium         = 33,
+        EleRNNTight          = 34,	
       };
 
     //-------------------------------------------------------------------------
-- 
GitLab


From fd4ba578b6c52c1012845cd00da0ce5a7df5dc02 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 14 Sep 2020 23:32:54 -0400
Subject: [PATCH 178/422] InDetLowBetaFinder: Clean up thread-safety
 annotations.

Thread-safety annotations should match between declarations and definitions.
---
 .../InDetLowBetaFinder/TrtToolsBetaLiklihood.h        |  3 ++-
 .../InDetLowBetaFinder/src/TrtToolsBetaLiklihood.cxx  |  4 ++--
 .../InDetLowBetaFinder/src/TrtToolsBetaWrapper.cxx    | 11 ++++++-----
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/InDetLowBetaFinder/TrtToolsBetaLiklihood.h b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/InDetLowBetaFinder/TrtToolsBetaLiklihood.h
index fc0361116468..3b251f7ef3f4 100644
--- a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/InDetLowBetaFinder/TrtToolsBetaLiklihood.h
+++ b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/InDetLowBetaFinder/TrtToolsBetaLiklihood.h
@@ -101,7 +101,8 @@ private:
   void TRT_SelectFEhits();                                                                                        //chooses decent looking hits to pass on to fitting
   void TRT_BitPattern(int hitP, int *lowPat, int *highPat, HIT &hit);                                             //parses TRT hits into useful info.  
   void TRT_PropLenCorr(HIT hit, int *corrLBits, float *corrLBitWeight, int *corrFBits, float *corrFBitWeight);    //fixes reflection in electronics.  
-  void TRT_FEbeta_min(float &beta, float &betaSigmaLo, float &betaSigmaUp);                                       //handles MINUIT for the TRT FE beta fit. 
+  void TRT_FEbeta_min ATLAS_NOT_THREAD_SAFE
+    (float &beta, float &betaSigmaLo, float &betaSigmaUp);                                       //handles MINUIT for the TRT FE beta fit. 
   void TRT_SelectFEpriors(TrtToolBetaLiklihood::HIT hit, int *corrLBits, float *corrLBitWeight);
   //void TRT_solveCubic(float DCrad, float &estDrift);
 };
diff --git a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaLiklihood.cxx b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaLiklihood.cxx
index a92be98d31d5..e49c33ec4ca1 100644
--- a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaLiklihood.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaLiklihood.cxx
@@ -199,11 +199,11 @@ void TrtToolBetaLiklihood::TRT_BitPattern(int hitP, int *lowPat, int *highPat, H
 
 
 //MINUIT apparently doesn't cope with member functions...
-void TRT_FEbeta_fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
+void TRT_FEbeta_fcn ATLAS_NOT_THREAD_SAFE (Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
 //...and also functions called therein:
 void TRT_solveCubic(float DCrad, float &estDrift);
 
-void TrtToolBetaLiklihood::TRT_FEbeta_min(float &beta, float &betaSigmaLo, float &betaSigmaUp){
+void TrtToolBetaLiklihood::TRT_FEbeta_min ATLAS_NOT_THREAD_SAFE (float &beta, float &betaSigmaLo, float &betaSigmaUp){
   //std::cout << "waypoint 6" << std::endl;
   // Minuit variables
   Double_t arglist[10] = {0,0,0,0,0,0,0,0,0,0};
diff --git a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaWrapper.cxx b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaWrapper.cxx
index 44dfdad41131..ad7cdebaf596 100644
--- a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaWrapper.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaWrapper.cxx
@@ -566,17 +566,18 @@ StatusCode InDet::LowBetaAlg::parseDataForTrtToolBetaLiklihood(const Trk::Track&
 
 // Prints the input of TRT_FEbeta() to file (hard-set)
 // This is a temporary debug method, and may be removed later
-int printTrtToolBetaLiklihoodDebugFile ATLAS_NOT_THREAD_SAFE // This method is not thread safe because static variable is used.
+int printTrtToolBetaLiklihoodDebugFile
 (std::vector<int> TRT_bitpattern, std::vector<int> TRT_bec, std::vector<int> TRT_strawlayer, std::vector<int> TRT_layer,
  std::vector<float> TRT_t0, std::vector<float> TRT_R, std::vector<float> TRT_R_track,
  std::vector<float> TrackX, std::vector<float> TrackY, std::vector<float> TrackZ, float RecPt, float RecEta)
 {
-    static int trackNum = 0; // static variable is not thread safe.
+        static std::atomic<int> trackNum = 0;
 	const char* FILENAME_C = "/afs/cern.ch/user/s/sschramm/testarea/16.0.2/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/debugFile.log";
 	FILE* outFile;
 	unsigned int i;
-	
-	if (trackNum == 0)
+
+        int tn = trackNum++;
+	if (tn == 0)
 	  outFile = fopen(FILENAME_C,"w");
 	else
 	  outFile = fopen(FILENAME_C,"a");
@@ -584,7 +585,7 @@ int printTrtToolBetaLiklihoodDebugFile ATLAS_NOT_THREAD_SAFE // This method is n
 	if (outFile == NULL)
 	  return -1;
 	
-	fprintf(outFile,"#\n#Track Number %d\n#RecPt = %f, RecEta = %f\n#\n",trackNum++,RecPt,RecEta);
+	fprintf(outFile,"#\n#Track Number %d\n#RecPt = %f, RecEta = %f\n#\n",tn,RecPt,RecEta);
 	
 	fprintf(outFile,"%%Start TRT_bitpattern:\n");
 	for (i = 0; i < TRT_bitpattern.size(); i++)
-- 
GitLab


From dfe3613653ac313b5e2de81cd4248d69ef6e5550 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Thu, 17 Sep 2020 05:24:17 +0200
Subject: [PATCH 179/422] fixing typos

---
 .../tauRec/python/TauAlgorithmsHolder.py      | 48 +++++++++----------
 Reconstruction/tauRec/python/TauRecRunner.py  |  8 ++--
 .../tauRecTools/Root/TauJetRNNUtils.cxx       |  2 +
 3 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
index 4d8c9f9d272a..a51d944360e5 100644
--- a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
+++ b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
@@ -918,51 +918,51 @@ def getTauIDVarCalculator():
     cached_instances[_name] = myTauIDVarCalculator
     return myTauIDVarCalculator
 
-def getTauEVetoRNNEvaluator(
+def getTauEleRNNEvaluator(_n,
         NetworkFile1P="", NetworkFile3P="",
-        OutputVarname="RNNEVetoScore", MinChargedTracks=1, MaxTracks=10,
+        OutputVarname="RNNEleScore", MaxTracks=10,
         MaxClusters=6, MaxClusterDR=1.0, InputLayerScalar="scalar",
         InputLayerTracks="tracks", InputLayerClusters="clusters",
         OutputLayer="rnneveto_output", OutputNode="sig_prob"):
 
-    _name = sPrefix + "TauEVetoRNNEvaluator"
+    _name = sPrefix + _n 
     from tauRecTools.tauRecToolsConf import TauJetRNNEvaluator
-    tool = ROOT.TauJetRNNEvaluator(name=_name,
-                                   NetworkFile1P=NetworkFile1P,
-                                   NetworkFile3P=NetworkFile3P,
-                                   OutputVarname=OutputVarname,
-                                   MinChargedTracks=MinChargedTracks,
-                                   MaxTracks=MaxTracks,
-                                   MaxClusters=MaxClusters,
-                                   MaxClusterDR=MaxClusterDR,
-                                   InputLayerScalar=InputLayerScalar,
-                                   InputLayerTracks=InputLayerTracks,
-                                   InputLayerClusters=InputLayerClusters,
-                                   OutputLayer=OutputLayer,
-                                   OutputNode=OutputNode,
-                                   IncShowerSubtr = tauFlags.useShowerSubClusters())
+    tool = TauJetRNNEvaluator(name=_name,
+                              NetworkFile1P=NetworkFile1P,
+                              NetworkFile3P=NetworkFile3P,
+                              OutputVarname=OutputVarname,
+                              MaxTracks=MaxTracks,
+                              MaxClusters=MaxClusters,
+                              MaxClusterDR=MaxClusterDR,
+                              InputLayerScalar=InputLayerScalar,
+                              InputLayerTracks=InputLayerTracks,
+                              InputLayerClusters=InputLayerClusters,
+                              OutputLayer=OutputLayer,
+                              OutputNode=OutputNode,
+                              IncShowerSubtr = tauFlags.useShowerSubClusters())
 
     cached_instances[_name] = tool
     return tool
 
-def getTauWPDecoratorEVetoRNN():
+def getTauWPDecoratorEleRNN():
     import PyUtils.RootUtils as ru
     ROOT = ru.import_root()
     import cppyy
-    cppyy.loadDictionary('xAODTau_cDict')
+    cppyy.load_library('libxAODTau_cDict')
 
-    _name = sPrefix + 'TauWPDecoratorEVetoRNN'
+    _name = sPrefix + 'TauWPDecoratorEleRNN'
     from tauRecTools.tauRecToolsConf import TauWPDecorator
     myTauWPDecorator = TauWPDecorator( name=_name,
                                        flatteningFile1Prong="rnneveto_mc16d_flat_1p.root",
                                        flatteningFile3Prong="rnneveto_mc16d_flat_3p.root",
                                        CutEnumVals =
-                                       [ ROOT.xAOD.TauJetParameters.EVetoRNNSigLoose,
-                                         ROOT.xAOD.TauJetParameters.EVetoRNNSigMedium, ROOT.xAOD.TauJetParameters.EVetoRNNSigTight ],
+                                       [ ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNLoose,
+                                         ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNMedium,
+                                         ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNTight ],
                                        SigEff1P = [0.95, 0.90, 0.85],
                                        SigEff3P = [0.98, 0.95, 0.90],
-                                       ScoreName = "RNNEVetoScore",
-                                       NewScoreName = "RNNEVetoScoreSigTrans",
+                                       ScoreName = "RNNEleScore",
+                                       NewScoreName = "RNNEleScoreSigTrans",
                                        DefineWPs = True,
                                        )
     cached_instances[_name] = myTauWPDecorator
diff --git a/Reconstruction/tauRec/python/TauRecRunner.py b/Reconstruction/tauRec/python/TauRecRunner.py
index 168ab741e93c..cdf93586c241 100644
--- a/Reconstruction/tauRec/python/TauRecRunner.py
+++ b/Reconstruction/tauRec/python/TauRecRunner.py
@@ -124,11 +124,11 @@ class TauRecRunner ( TauRecRunConfigured ) :
                                                        weightsFile="EleBDT1PEnd23.root", minNTracks=1, minAbsTrackEta=2.0, 
                                                        maxAbsTrackEta=3.0, outputVarName="BDTEleScore")) #update config?
             tools.append(taualgs.getTauWPDecoratorEleBDT())
-            tools.append(taualgs.getTauEVetoRNNEvaluator("TauEVetoRNN",
+            tools.append(taualgs.getTauEleRNNEvaluator("TauEleRNN",
                                                          NetworkFile1P="taueveto_rnn_mc16d_1p.json",
-                                                         NetworkFile3P="taueveto_rnn_mc16d_3p.json",
-                                                         OutputVarname="RNNEVetoScore", MaxTracks=10, MaxClusters=6))
-            tools.append(taualgs.getTauWPDecoratorEVetoRNN())
+                                                         NetworkFile3P="taueveto_rnn_mc16d_1p.json",#test
+                                                         OutputVarname="RNNEleScore", MaxTracks=10, MaxClusters=6))
+            tools.append(taualgs.getTauWPDecoratorEleRNN())
             tools.append(taualgs.getTauDecayModeNNClassifier())
             tools.append(taualgs.getTauEleOLRDecorator())              
             
diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index bfa84f8db471..4d30b1ba4a25 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -341,6 +341,8 @@ bool     ClustersMeanSecondLambda(const xAOD::TauJet &tau, double &out){
 }
 bool     ClustersMeanSecondR(const xAOD::TauJet &tau, double &out){
   float clustersMeanSecondR = tau.auxdata<float>("ClustersMeanSecondR");
+  //double ClustersMeanSecondR(0);
+  //  const auto success = tau.detail(TauDetail::ClustersMeanSecondR, ClustersMeanSecondR);
   out = std::max(0.f, clustersMeanSecondR);
   return true;
 }
-- 
GitLab


From 1573eb4055d10282df5ed3b8fe474b846dd7f324 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 16 Sep 2020 18:47:52 +0200
Subject: [PATCH 180/422] TrigConfData: Fix clang warnings.

Missing override keywords.
---
 .../TrigConfData/TrigConfData/HLTPrescalesSet.h                 | 2 +-
 .../TrigConfData/TrigConfData/L1PrescalesSet.h                  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTPrescalesSet.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTPrescalesSet.h
index 544bf8f9e99a..5845a78f5ec5 100644
--- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTPrescalesSet.h
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTPrescalesSet.h
@@ -60,7 +60,7 @@ namespace TrigConf {
    private:
 
       /** Update the internal prescale map after modification of the data object */
-      virtual void update();
+      virtual void update() override;
 
       /** the prescale key */
       unsigned int m_psk {0};
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1PrescalesSet.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1PrescalesSet.h
index 041ec9e03419..54af67b0f445 100644
--- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1PrescalesSet.h
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1PrescalesSet.h
@@ -57,7 +57,7 @@ namespace TrigConf {
    private:
 
       /** Update the internal prescale map after modification of the data object */
-      virtual void update();
+      virtual void update() override;
 
       /** the prescale key */
       unsigned int m_psk {0};
-- 
GitLab


From 4bed1388befc3ab84efb7d9ceca3bc65b456a05e Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 16 Sep 2020 18:49:35 +0200
Subject: [PATCH 181/422] CscClusterization: Fix clang warning.

Unused private data member.
---
 .../src/CscPeakThresholdClusterBuilderTool.cxx                 | 3 +--
 .../CscClusterization/src/CscPeakThresholdClusterBuilderTool.h | 3 ---
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx
index 1564738d8225..28befc2018ed 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx
@@ -72,8 +72,7 @@ CscPeakThresholdClusterBuilderTool::CscPeakThresholdClusterBuilderTool(const std
                                                                        const std::string& aname,
                                                                        const IInterface*  parent)
     : AthAlgTool(type, aname, parent),
-      m_digit_key("CSC_Measurements"),
-      m_fullEventDone(false)
+      m_digit_key("CSC_Measurements")
 {
 
     declareInterface<ICscClusterBuilder>(this);
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h
index 2b7326056c1e..7ebb1026e07d 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h
@@ -150,9 +150,6 @@ class CscPeakThresholdClusterBuilderTool : virtual public ICscClusterBuilder, pu
         "MuonDetectorManager",
         "Key of input MuonDetectorManager condition data",
     };
-
-    // keep track of full event being already processed
-    bool m_fullEventDone;
 };
 
 #endif
-- 
GitLab


From 716d7a8457be73cfef62b82bdd1147f79e71b6e9 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Thu, 17 Sep 2020 06:00:56 +0200
Subject: [PATCH 182/422] added definitions of the RNNEleScore

---
 Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc              | 2 ++
 Event/xAOD/xAODTau/Root/TauJetAuxContainer_v3.cxx           | 4 ++++
 Event/xAOD/xAODTau/xAODTau/TauDefs.h                        | 6 +++++-
 Event/xAOD/xAODTau/xAODTau/versions/TauJetAuxContainer_v3.h | 4 ++++
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc b/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc
index 7c47d7168287..34c935fffec3 100644
--- a/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc
+++ b/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc
@@ -32,10 +32,12 @@ break;
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, EleMatchLikelihoodScore );
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, BDTJetScore );	
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, RNNJetScore );	
+      DEFINE_TAUJETPARAMETER_ACCESSOR( float, RNNEleScore );	
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, BDTEleScore );	
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, PanTauScore );   
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, BDTJetScoreSigTrans );   
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, RNNJetScoreSigTrans );   
+      DEFINE_TAUJETPARAMETER_ACCESSOR( float, RNNEleScoreSigTrans );   
       //DEFINE_TAUJETPARAMETER_ACCESSOR( float, BDTJetScoreBkgTrans );   
 
     default:
diff --git a/Event/xAOD/xAODTau/Root/TauJetAuxContainer_v3.cxx b/Event/xAOD/xAODTau/Root/TauJetAuxContainer_v3.cxx
index e868ef0507fd..32dc32e9af27 100644
--- a/Event/xAOD/xAODTau/Root/TauJetAuxContainer_v3.cxx
+++ b/Event/xAOD/xAODTau/Root/TauJetAuxContainer_v3.cxx
@@ -266,6 +266,10 @@ namespace xAOD {
     // RNN tau ID
     AUX_VARIABLE( RNNJetScore );
     AUX_VARIABLE( RNNJetScoreSigTrans ); 
+
+    //RNN tau eVeto
+    AUX_VARIABLE( RNNEleScore );
+    AUX_VARIABLE( RNNEleScoreSigTrans ); 
     
   }
   
diff --git a/Event/xAOD/xAODTau/xAODTau/TauDefs.h b/Event/xAOD/xAODTau/xAODTau/TauDefs.h
index d3606712c007..67715716a56e 100644
--- a/Event/xAOD/xAODTau/xAODTau/TauDefs.h
+++ b/Event/xAOD/xAODTau/xAODTau/TauDefs.h
@@ -90,7 +90,11 @@ namespace TauJetParameters
         //! RNN score for Jet rejection (not transformed)
         RNNJetScore           = 21,
         //! RNN score which is signal transformed/flattened
-        RNNJetScoreSigTrans   = 22 // new
+        RNNJetScoreSigTrans   = 22, // new
+        //! RNN score for Ele rejection (not transformed)
+        RNNEleScore           = 23,
+        //! RNN score which is signal transformed/flattened
+        RNNEleScoreSigTrans   = 24 // new
       };
 
     //-------------------------------------------------------------------------
diff --git a/Event/xAOD/xAODTau/xAODTau/versions/TauJetAuxContainer_v3.h b/Event/xAOD/xAODTau/xAODTau/versions/TauJetAuxContainer_v3.h
index cad0612b9fdb..58fa1316fe76 100644
--- a/Event/xAOD/xAODTau/xAODTau/versions/TauJetAuxContainer_v3.h
+++ b/Event/xAOD/xAODTau/xAODTau/versions/TauJetAuxContainer_v3.h
@@ -318,6 +318,10 @@ namespace xAOD {
     // RNN tau ID
     std::vector< float > RNNJetScore;
     std::vector< float > RNNJetScoreSigTrans;
+
+    // RNN tau eVeto
+    std::vector< float > RNNEleScore;
+    std::vector< float > RNNEleScoreSigTrans;
     
   }; // class TauJetAuxContainer_v3
 
-- 
GitLab


From 3bb86038ecc5ac0262269ceb7dc53fdd02942d3d Mon Sep 17 00:00:00 2001
From: Rupert Tombs <rt500@cam.ac.uk>
Date: Thu, 17 Sep 2020 09:12:33 +0100
Subject: [PATCH 183/422] Fix Sim.RunToTimestampDict import. Test it in digi PU

---
 Simulation/Digitization/test/DigitizationPUConfigNew_test.py | 3 +++
 Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py      | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Simulation/Digitization/test/DigitizationPUConfigNew_test.py b/Simulation/Digitization/test/DigitizationPUConfigNew_test.py
index 0260498c9b67..5e117a63a425 100755
--- a/Simulation/Digitization/test/DigitizationPUConfigNew_test.py
+++ b/Simulation/Digitization/test/DigitizationPUConfigNew_test.py
@@ -72,6 +72,9 @@ ConfigFlags.Digitization.PU.LowPtMinBiasInputCols = cols
 
 ConfigFlags.lock()
 
+# test this flag
+ConfigFlags.Sim.RunToTimestampDict
+
 # Core components
 acc = MainServicesCfg(ConfigFlags)
 acc.merge(PoolReadCfg(ConfigFlags))
diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
index 00129b473b64..07c6cb6083c2 100644
--- a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
+++ b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
@@ -131,7 +131,7 @@ def createSimConfigFlags():
     # map from runNumber to timestamp; migrated from RunDMCFlags.py
     def getRunToTimestampDict():
         # this wrapper is intended to avoid an initial import
-        from RunToTimestampData import RunToTimestampDict
+        from G4AtlasApps.RunToTimestampData import RunToTimestampDict
         return RunToTimestampDict
     scf.addFlag("Sim.RunToTimestampDict", lambda prevFlags: getRunToTimestampDict())
 
-- 
GitLab


From 8450df4f0305ae7c281c794d40beda878daf9743 Mon Sep 17 00:00:00 2001
From: Daniela Boerner <daniela.boerner@cern.ch>
Date: Thu, 17 Sep 2020 10:27:33 +0200
Subject: [PATCH 184/422] add conversion radius difference to standard ART
 plots

---
 .../egamma/egammaValidation/src/TruthPhotonHistograms.cxx   | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Reconstruction/egamma/egammaValidation/src/TruthPhotonHistograms.cxx b/Reconstruction/egamma/egammaValidation/src/TruthPhotonHistograms.cxx
index 04f3686451ed..d54c31b6a9dd 100644
--- a/Reconstruction/egamma/egammaValidation/src/TruthPhotonHistograms.cxx
+++ b/Reconstruction/egamma/egammaValidation/src/TruthPhotonHistograms.cxx
@@ -18,6 +18,7 @@ StatusCode TruthPhotonHistograms::initializePlots() {
   ATH_CHECK(ParticleHistograms::initializePlots());
 
   histoMap["convRadius"] = new TH1D(Form("%s_%s",m_name.c_str(),"convRadius"), ";Conversion Radius [mm]; Conversion Radius Events", 14, m_cR_bins);
+  histoMap["convRadiusTrueVsReco"] = new TH1D(Form("%s_%s",m_name.c_str(),"convRadiusTrueVsReco"), ";R^{reco}_{conv. vtx} - R^{true}_{conv. vtx} [mm]; Events", 100, -200, 200);
 
   histoMap["resolution_e"] = new TH1D(Form("%s_%s", m_name.c_str(), "resolution_e"), "; E_{reco} - E_{true} / E_{truth}; Events", 40, -0.2, 0.2);
   histoMap["resolution_pT"] = new TH1D(Form("%s_%s", m_name.c_str(), "resolution_pT"), "; p_{T}_{reco} - p_{T}_{true} / p_{T}_{truth}; Events", 40, -0.2, 0.2);
@@ -28,6 +29,7 @@ StatusCode TruthPhotonHistograms::initializePlots() {
   histo2DMap["resolution_e_vs_eta"] = new TH2D(Form("%s_%s",m_name.c_str(),"resolution_e_vs_eta"), ";#eta;E_{reco} - E_{true} / E_{truth}", 20, 0, 3, 160, -0.2, 0.2); 
 
   ATH_CHECK(m_rootHistSvc->regHist(m_folder+"convRadius", histoMap["convRadius"]));
+  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"convRadiusTrueVsReco", histoMap["convRadiusTrueVsReco"]));
 
   ATH_CHECK(m_rootHistSvc->regHist(m_folder+"resolution_e", histoMap["resolution_e"]));
   ATH_CHECK(m_rootHistSvc->regHist(m_folder+"resolution_pT", histoMap["resolution_pT"]));
@@ -48,6 +50,7 @@ void TruthPhotonHistograms::fill(const xAOD::IParticle& phrec) {
   float res_pT = -999;
   float res_eta = -999;
   float res_phi = -999;
+  float recoR = -999;
 
   ParticleHistograms::fill(phrec);
 
@@ -75,10 +78,13 @@ void TruthPhotonHistograms::fill(const xAOD::IParticle& phrec) {
       res_pT = (photon->pt() - truth->pt())/truth->pt();
       res_eta = photon->eta() - truth->eta();
       res_phi = photon->phi() - truth->phi();
+      recoR = xAOD::EgammaHelpers::conversionRadius(photon);
 
     }
   }
 
+  histoMap["convRadiusTrueVsReco"]->Fill(recoR - trueR);
+
   histoMap["resolution_e"]->Fill(res_e);
   histoMap["resolution_pT"]->Fill(res_pT);
   histoMap["resolution_eta"]->Fill(res_eta);
-- 
GitLab


From 5d3dc7ceb67d597593de1df8143c981a5635352a Mon Sep 17 00:00:00 2001
From: Daniela Boerner <daniela.boerner@cern.ch>
Date: Thu, 17 Sep 2020 10:28:20 +0200
Subject: [PATCH 185/422] plot conversion radius difference as comparison for
 various conversion types

---
 .../scripts/EgammaARTmonitoring_plotsMaker.py | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
index f11c90defd2f..96b4eebcb734 100755
--- a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
+++ b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
@@ -117,6 +117,14 @@ photon_fraction_list = [
     {'name': 'truthPhotonConvRecoUnconvEfficiency', 'color': kPink + 2, 'title': 'True Conv #rightarrow Unconv'}
 ]
 
+photon_conversion_list = [
+    {'name': 'truthConvRecoConv2Si', 'color': kGreen + 2, 'title': 'True Conv #rightarrow Si-Si Conv'},
+    {'name': 'truthConvRecoConv1Si', 'color': kBlue + 2, 'title': 'True Conv #rightarrow 1 Si Conv'},
+    {'name': 'truthConvRecoConv1TRT', 'color': kRed + 2, 'title': 'True Conv #rightarrow 1 TRT Conv'},
+    {'name': 'truthConvRecoConv2TRT', 'color': kOrange + 2, 'title': 'True Conv #rightarrow TRT-TRT Conv'},
+    {'name': 'truthConvRecoConv2SiTRT', 'color': kCyan + 2, 'title': 'True Conv #rightarrow Si-TRT Conv'},
+]
+
 
 def get_key_names(file, directory=""):
     """
@@ -190,7 +198,65 @@ def make_profile_plots(f_base, f_nightly, result_file, particle_type):
               h_base_profile.SetTitle("")
               make_ratio_plot(h_base_profile, h_nightly_profile, folder['title'], result_file, y_axis_label)
 
+def make_conversion_plot(f_base, f_nightly, result_file):
+    """
+    This function creates conversion plots to study reco vs true 
+    converion radius for the various conversion categoried
+    """
+    for histo in get_key_names(f_nightly, 'truthConvRecoConv2Si'):
+        variable_name = histo.split("_", 1)[1]
+
+        if variable_name != "convRadiusTrueVsReco":
+            continue
+
+        c1 = TCanvas()
+
+        leg = TLegend(0.1, 0.75, 0.9, 0.9)
+        leg.SetNColumns(2)
+
+        for i, folder in enumerate(photon_conversion_list):
+
+            baseline = f_base.Get(folder['name'] + '/' + folder['name'] + "_" + variable_name)
+            baseline.SetDirectory(0)
+            nightly = f_nightly.Get(folder['name'] + '/' + folder['name'] + "_" + variable_name)
+            nightly.SetDirectory(0)
+
+            if baseline.Integral() != 0:
+                baseline.Scale(1/baseline.Integral())
+            if nightly.Integral() != 0:
+                nightly.Scale(1/nightly.Integral())
+
+            baseline.SetMinimum(min(baseline.GetMinimum(), baseline.GetMinimum()) * 0.7)
+            baseline.SetMaximum(max(baseline.GetMaximum(), baseline.GetMaximum()) * 1.3)
+
+            baseline.GetYaxis().SetTitle("normalized to unity")
+
+            baseline.SetLineColor(folder['color'])
+            nightly.SetLineColor(folder['color'])
+            baseline.SetMarkerColor(folder['color'])
+            nightly.SetMarkerColor(folder['color'])
+
+            baseline.SetMarkerStyle(1)
+            nightly.SetMarkerStyle(20)
+
+            leg.AddEntry(nightly, folder['title'], "p")
+
+            if i == 0:
+                baseline.Draw("hist ")
+            else:
+                baseline.Draw("same hist")
+
+            nightly.Draw("p same")
+
+        leg.Draw()
+
+        c1.Update()
+
+        result_file.cd()
+
+        c1.SaveAs("ConversionRadiusTrueVsReco.png")
 
+        c1.Write("ConversionRadiusTrueVsReco")
 
 
 def make_photon_fraction_plot(f_base, f_nightly, result_file):
@@ -376,6 +442,7 @@ if __name__ == '__main__':
     if particle_type == 'gamma':
 
         make_photon_fraction_plot(baseline_file, nightly_file,output_file)
+        make_conversion_plot(baseline_file, nightly_file, output_file)
 
 
 
-- 
GitLab


From 3ce0378f2a71e50e88018ed110bc08de842f4fb7 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Thu, 17 Sep 2020 10:51:46 +0200
Subject: [PATCH 186/422] modify MergedPixelsTool to omit duplicate pixel RDOs

---
 .../SiClusterizationTool/MergedPixelsTool.h   | 18 ++++------
 .../src/MergedPixelsTool.cxx                  | 33 ++++++++++---------
 2 files changed, 24 insertions(+), 27 deletions(-)

diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.h
index 3a232c2015e9..74506f93da9c 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.h
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.h
@@ -31,6 +31,7 @@
 
 #include <atomic>
 #include <vector>
+#include <array>
 
 class PixelID;
 
@@ -56,25 +57,18 @@ namespace InDet {
     Identifier ID ;
   };
 
-  class network {
+  struct network {
   public:
-    network():
-      NC(0), CON({0,0,0,0,0,0,0,0}) {};
-      
-    ~network() {};
-
-    int               NC;
-    std::array<int,8> CON;
+    int               NC{};
+    std::array<int,8> CON{};
   };
   
   const auto pixel_less = [] (rowcolID const&  id1,rowcolID const& id2) -> bool {
-    if(id1.COL == id2.COL) 
-      return id1.ROW < id2.ROW;
+    if(id1.COL == id2.COL) return id1.ROW < id2.ROW;
     return id1.COL < id2.COL;
   };
  
-  class MergedPixelsTool : public PixelClusteringToolBase
-  {
+  class MergedPixelsTool : public PixelClusteringToolBase{
   public:
 
 
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx
index 37edd8fb85d5..0f0d077f6992 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx
@@ -25,6 +25,7 @@
 
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "EventPrimitives/EventPrimitives.h"
+#include <unordered_set>
 
 using CLHEP::micrometer;
 
@@ -41,15 +42,12 @@ namespace InDet {
     }
   
   StatusCode  MergedPixelsTool::initialize(){
-    
     if (m_IBLParameterSvc.retrieve().isFailure()) { 
       ATH_MSG_WARNING( "Could not retrieve IBLParameterSvc"); 
     } else { 
       m_IBLParameterSvc->setBoolParameters(m_IBLAbsent,"IBLAbsent");
     }  
-    
     ATH_CHECK(m_pixelDetEleCollKey.initialize());
-    
     return PixelClusteringToolBase::initialize();
   }
 
@@ -340,12 +338,15 @@ namespace InDet {
     // loop on the rdo collection and save the relevant quantities for each fired pixel
     // rowcolID contains: number of connected pixels, phi/eta pixel indices, tot, lvl1, rdo identifier
     std::vector<rowcolID> collectionID;
-
+    std::unordered_set<Identifier> setOfIdentifiers{};
     for(const auto & rdo : collection) {
-      
       const Identifier rdoID= rdo->identify();
       if (m_usePixelMap and !(m_summaryTool->isGood(idHash,rdoID))) continue;
-          
+      //check for duplication:
+      //add to set of existing identifiers. If it fails (.second = false) then skip it.
+      if (not setOfIdentifiers.insert(rdoID).second)   continue;
+      // note that we don't understand, for now, why these duplicated RDO's occur
+      //
       const int lvl1= rdo->getLVL1A();      
       if (m_checkDuplicatedRDO and checkDuplication(pixelID, rdoID, lvl1, collectionID)) continue;
       
@@ -353,7 +354,6 @@ namespace InDet {
       
       rowcolID   RCI(-1, pixelID.phi_index(rdoID), pixelID.eta_index(rdoID), tot, lvl1, rdoID); 
       collectionID.push_back(RCI);
-      
       // check if this is a ganged pixel    
       Identifier gangedID;
       const bool ganged = isGanged(rdoID, element, gangedID);  
@@ -376,8 +376,7 @@ namespace InDet {
 
     // Network production
     //
-    int collectionSize = collectionID.size();
-    
+    int collectionSize = collectionID.size();    
     // the maximum number of elements to save can be either 2 or 3
     // m_addCorners == true requires saving the bottom (or top), the side and the corner connection for each pixel,
     // otherwise you only save bottom (or top) and the side
@@ -389,16 +388,16 @@ namespace InDet {
       int NB  = 0;
       int row = collectionID.at(currentPixel).ROW;
       int col = collectionID.at(currentPixel).COL; 
-      
+      //
+      auto & currentConnection = connections.at(currentPixel);
       for(int otherPixel = currentPixel+1; otherPixel!=collectionSize; ++otherPixel) {
+        auto & otherConnection = connections.at(otherPixel);
         int deltaCol = std::abs(collectionID.at(otherPixel).COL - col);
         int deltaRow = std::abs(collectionID.at(otherPixel).ROW - row);
-
         // break if you are too far way in columns, as these ones will be taken in the next iterations
         if( deltaCol > 1) {
           break;
         }
-        
         // if you need the corners, you jump the next rows, as these ones will be taken in the next iterations
         if ( m_addCorners and deltaRow > 1 ) {
           continue;
@@ -415,8 +414,12 @@ namespace InDet {
         
         // this builds the single pixel connection and breaks if the max number of elements is reached:        
         if( (deltaCol+deltaRow) == 1 or (m_addCorners and deltaCol == 1 and deltaRow == 1) ) {
-          connections.at(currentPixel).CON.at(connections.at(currentPixel).NC++) = otherPixel;
-          connections.at(otherPixel).CON.at(connections.at(otherPixel).NC++) = currentPixel ;
+          try{
+            currentConnection.CON.at(currentConnection.NC++) = otherPixel;
+            otherConnection.CON.at(otherConnection.NC++) = currentPixel ;
+          } catch (const std::out_of_range & ){
+            throw std::runtime_error("attempt to access connection array beyond its size in MergedPixelsTool::clusterize");
+          }
           if(++NB==maxElements) {
             break;
           }
@@ -512,7 +515,7 @@ namespace InDet {
                                           const int& Ncluster,
                                           const std::vector<network>& connections,                                         
                                           std::vector<rowcolID>& collectionID) const {
-    for(int i=0; i!=connections.at(r).NC; ++i) {      
+    for(int i=0; i!=connections.at(r).NC; ++i) {  
       const int k = connections.at(r).CON.at(i);
       if(collectionID.at(k).NCL < 0) {
         collectionID.at(k).NCL = Ncluster;
-- 
GitLab


From 7b7ddb9e5fac14b2510a53fe4495b39d8ed84031 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Thu, 17 Sep 2020 11:53:37 +0200
Subject: [PATCH 187/422] MdtRdoToMdtPrepData: remove duplicate property.
 Update test references

---
 .../src/MdtRdoToMdtPrepData.cxx               |    1 -
 .../MuonConfig/share/MuonDataDecodeTest.ref   | 1060 +++++++++++++++-
 .../share/MuonDataDecodeTest_Cache.ref        | 1061 ++++++++++++++++-
 3 files changed, 2119 insertions(+), 3 deletions(-)

diff --git a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx
index bca0f102d8ef..e4becf6d13fb 100755
--- a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx
@@ -20,7 +20,6 @@ m_seededDecoding(false),
 m_roiCollectionKey("OutputRoIs"),
 m_mdtCollection("MDT_DriftCircles")
 {
-    declareProperty("DecodingTool",       m_tool,       "mdt rdo to prep data conversion tool" );
     declareProperty("PrintInputRdo",      m_print_inputRdo, "If true, will dump information about the input RDOs");
     declareProperty("PrintPrepData",      m_print_prepData, "If true, will dump information about the resulting PRDs");
     declareProperty("DoSeededDecoding",   m_seededDecoding, "If true decode only in RoIs");
diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
index dcb83378af3e..f0596d84c5fc 100644
--- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
+++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
@@ -1,21 +1,588 @@
+Flag Name                                : Value
+Beam.BunchSpacing                        : 25
+Beam.Energy                              : [function]
+Beam.NumberOfCollisions                  : [function]
+Beam.Type                                : [function]
+Beam.estimatedLuminosity                 : [function]
+Common.Project                           : 'Athena'
+Common.bunchCrossingSource               : [function]
+Common.doExpressProcessing               : False
+Common.isOnline                          : False
+Common.useOnlineLumi                     : [function]
+Concurrency.NumConcurrentEvents          : 0
+Concurrency.NumProcs                     : 0
+Concurrency.NumThreads                   : 0
+Exec.DebugStage                          : ''
+Exec.MaxEvents                           : -1
+Exec.OutputLevel                         : 3
+Exec.SkipEvents                          : 0
+GeoModel.Align.Dynamic                   : [function]
+GeoModel.AtlasVersion                    : 'ATLAS-R2-2016-01-00-01'
+GeoModel.IBLLayout                       : [function]
+GeoModel.Layout                          : 'atlas'
+GeoModel.Run                             : [function]
+GeoModel.StripGeoType                    : [function]
+GeoModel.Type                            : [function]
+IOVDb.DatabaseInstance                   : [function]
+IOVDb.GlobalTag                          : 'CONDBR2-BLKPA-2018-13'
+Input.Collections                        : [function]
+Input.Files                              : ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1']
+Input.Format                             : [function]
+Input.ProjectName                        : [function]
+Input.RunNumber                          : [function]
+Input.SecondaryCollections               : [function]
+Input.SecondaryFiles                     : []
+Input.isMC                               : [function]
+Output.AODFileName                       : ''
+Output.ESDFileName                       : ''
+Output.EVNTFileName                      : ''
+Output.HISTFileName                      : ''
+Output.HITSFileName                      : ''
+Output.RDOFileName                       : ''
+Output.RDO_SGNLFileName                  : ''
+Output.doESD                             : [function]
+Output.doWriteAOD                        : [function]
+Output.doWriteBS                         : False
+Output.doWriteESD                        : [function]
+Output.doWriteRDO                        : [function]
+Output.doWriteRDO_SGNL                   : [function]
+Random.Engine                            : 'dSFMT'
+Scheduler.CheckDependencies              : True
+Scheduler.ShowControlFlow                : True
+Scheduler.ShowDataDeps                   : True
+Scheduler.ShowDataFlow                   : True
+TrackingGeometry.MagneticFileMode        : 6
+TrackingGeometry.MaterialSource          : 'COOL'
+Flag categories that can be loaded dynamically
+Category                  :                 Generator name : Defined in
+BField                    :                       __bfield : AthenaConfiguration/AllConfigFlags.py
+BTagging                  :                     __btagging : AthenaConfiguration/AllConfigFlags.py
+Calo                      :                         __calo : AthenaConfiguration/AllConfigFlags.py
+DQ                        :                           __dq : AthenaConfiguration/AllConfigFlags.py
+Detector                  :                     __detector : AthenaConfiguration/AllConfigFlags.py
+Digitization              :                 __digitization : AthenaConfiguration/AllConfigFlags.py
+Egamma                    :                       __egamma : AthenaConfiguration/AllConfigFlags.py
+InDet                     :                        __indet : AthenaConfiguration/AllConfigFlags.py
+LAr                       :                          __lar : AthenaConfiguration/AllConfigFlags.py
+MET                       :                          __met : AthenaConfiguration/AllConfigFlags.py
+Muon                      :                         __muon : AthenaConfiguration/AllConfigFlags.py
+MuonCombined              :                 __muoncombined : AthenaConfiguration/AllConfigFlags.py
+Overlay                   :                      __overlay : AthenaConfiguration/AllConfigFlags.py
+PF                        :                        __pflow : AthenaConfiguration/AllConfigFlags.py
+PerfMon                   :                      __perfmon : AthenaConfiguration/AllConfigFlags.py
+Sim                       :                   __simulation : AthenaConfiguration/AllConfigFlags.py
+Tile                      :                         __tile : AthenaConfiguration/AllConfigFlags.py
+Trigger                   :                      __trigger : AthenaConfiguration/AllConfigFlags.py
+Py:Athena            INFO About to setup Raw data decoding
+Py:Athena            INFO using release [WorkDir-22.0.18] [x86_64-centos7-gcc8-opt] [removeDuplicateProp/12d6dd5] -- built on [2020-09-17T1141]
+Py:AutoConfigFlags    INFO Obtaining metadata of auto-configuration by peeking into /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1
+Py:MetaReader        INFO Current mode used: peeker
+Py:MetaReader        INFO Current filenames: ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1']
+Py:ConfigurableDb    INFO Read module info for 5566 configurables from 4 genConfDb files
+Py:ConfigurableDb    INFO No duplicates have been found: that's good !
+EventInfoMgtInit: Got release version  Athena-22.0.18
+Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
+Py:Athena            INFO Print Config
+Py:ComponentAccumulator    INFO Event Inputs
+Py:ComponentAccumulator    INFO Event Algorithm Sequences
+Py:ComponentAccumulator    INFO AthSequencer('AthAlgSeq', Sequential=True, Members=[RpcRawDataProvider('RpcRawDataProvider', ProviderTool=RPC_RawDataProviderToolMT('RPC_RawDataProviderToolMT', Decoder=RpcROD_Decoder('RpcROD_Decoder'), RdoLocation='RPCPAD')), TgcRawDataProvider('TgcRawDataProvider', ProviderTool=TGC_RawDataProviderToolMT('TGC_RawDataProviderToolMT', Decoder=TGC_RodDecoderReadout('TgcROD_Decoder'), RdoLocation='TGCRDO')), MdtRawDataProvider('MdtRawDataProvider', ProviderTool=MDT_RawDataProviderToolMT('MDT_RawDataProviderToolMT', Decoder=MdtROD_Decoder('MdtROD_Decoder'), RdoLocation='MDTCSM')), CscRawDataProvider('CscRawDataProvider', ProviderTool=CSC_RawDataProviderToolMT('CSC_RawDataProviderToolMT', Decoder=CscROD_Decoder('CscROD_Decoder'), RdoLocation='CSCRDO')), RpcRdoToRpcPrepData('RpcRdoToRpcPrepData', DecodingTool=RpcRdoToPrepDataToolMT('RpcRdoToRpcPrepDataTool'), PrintPrepData=False, RegSel_RPC=RegSelTool('RegSelTool_RPC', RegSelLUT='RegSelLUTCondData_RPC', Initialised=True)), TgcRdoToTgcPrepData('TgcRdoToTgcPrepData', DecodingTool=TgcRdoToPrepDataToolMT('TgcRdoToTgcPrepDataTool'), PrintPrepData=False, RegSel_TGC=RegSelTool('RegSelTool_TGC', RegSelLUT='RegSelLUTCondData_TGC', Initialised=True)), MdtRdoToMdtPrepData('MdtRdoToMdtPrepData', DecodingTool=MdtRdoToPrepDataToolMT('MdtRdoToMdtPrepDataTool'), PrintPrepData=False, RegSel_MDT=RegSelTool('RegSelTool_MDT', RegSelLUT='RegSelLUTCondData_MDT', Initialised=True)), CscRdoToCscPrepData('CscRdoToCscPrepData', CscRdoToCscPrepDataTool=CscRdoToCscPrepDataToolMT('CscRdoToCscPrepDataTool'), PrintPrepData=False, RegSel_CSC=RegSelTool('RegSelTool_CSC', RegSelLUT='RegSelLUTCondData_CSC', Initialised=True)), CscThresholdClusterBuilder('CscThresholdClusterBuilder', cluster_builder=CscThresholdClusterBuilderTool('CscThresholdClusterBuilderTool'))])
+Py:ComponentAccumulator    INFO Condition Algorithms
+Py:ComponentAccumulator    INFO  \__ CondInputLoader (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonAlignmentCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonDetectorCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RpcCablingCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonMDT_CablingAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ AtlasFieldMapCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ AtlasFieldCacheCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RpcCondDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_RPC (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_TGC (cond alg)
+Py:ComponentAccumulator    INFO  \__ MdtCalibDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_MDT (cond alg)
+Py:ComponentAccumulator    INFO  \__ CscCondDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_CSC (cond alg)
+Py:ComponentAccumulator    INFO Services
+Py:ComponentAccumulator    INFO ['ByteStreamCnvSvc', 'ByteStreamInputSvc', 'EventSelector', 'EventPersistencySvc', 'ROBDataProviderSvc', 'ByteStreamAddressProviderSvc', 'MetaDataStore', 'InputMetaDataStore', 'MetaDataSvc', 'ProxyProviderSvc', 'GeoModelSvc', 'DetDescrCnvSvc', 'TagInfoMgr', 'AGDDtoGeoSvc', 'MuonIdHelperSvc', 'IOVDbSvc', 'PoolSvc', 'CondSvc', 'DBReplicaSvc', 'AthenaPoolCnvSvc', 'RPCcablingServerSvc', 'MuonRPC_CablingSvc', 'LVL1TGC::TGCRecRoiSvc', 'TGCcablingServerSvc', 'MuonMDT_CablingSvc', 'CSCcablingSvc']
+Py:ComponentAccumulator    INFO Public Tools
+Py:ComponentAccumulator    INFO [
+Py:ComponentAccumulator    INFO   IOVDbMetaDataTool/IOVDbMetaDataTool,
+Py:ComponentAccumulator    INFO   ByteStreamMetadataTool/ByteStreamMetadataTool,
+Py:ComponentAccumulator    INFO   RPCCablingDbTool/RPCCablingDbTool,
+Py:ComponentAccumulator    INFO   Muon::RPC_RawDataProviderToolMT/RPC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   Muon::TGC_RawDataProviderToolMT/TGC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   MDTCablingDbTool/MDTCablingDbTool,
+Py:ComponentAccumulator    INFO   Muon::MDT_RawDataProviderToolMT/MDT_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   Muon::CSC_RawDataProviderToolMT/CSC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO ]
+Py:ComponentAccumulator    INFO Private Tools
+Py:ComponentAccumulator    INFO [
+Py:ComponentAccumulator    INFO ]
+Py:ComponentAccumulator    INFO TheApp properties
+Py:ComponentAccumulator    INFO   EvtSel : EventSelector
+Py:Athena            INFO Save Config
+
+JOs reading stage finished, launching CARunner from pickle file
+
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on pcaz004 on Thu Sep 17 11:43:35 2020
+====================================================================================================================================
+ApplicationMgr       INFO Application Manager Configured successfully
+CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
+ClassIDSvc           INFO  getRegistryEntries: read 4008 CLIDRegistry entries for module ALL
+MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
+PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
+PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
+PoolSvc              INFO Frontier compression level set to 5
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-16T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host pcaz004.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO COOL SQLite replicas will be excluded if matching pattern /DBRelease/
+PoolSvc              INFO Successfully setup replica sorting algorithm
+PoolSvc              INFO Setting up APR FileCatalog and Streams
+PoolSvc              INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml
+PoolSvc           WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for prfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml
+DbSession            INFO     Open     DbSession    
+Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
+ToolSvc.ByteStr...   INFO Initializing ToolSvc.ByteStreamMetadataTool - package version ByteStreamCnvSvc-00-00-00
+MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray(['IOVDbMetaDataTool/IOVDbMetaDataTool','ByteStreamMetadataTool/ByteStreamMetadataTool'])
+OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
+ByteStreamAddre...   INFO Initializing ByteStreamAddressProviderSvc - package version ByteStreamCnvSvcBase-00-00-00
+ByteStreamAddre...   INFO initialized 
+ByteStreamAddre...   INFO -- Will fill Store with id =  0
+IOVDbSvc             INFO Opened read transaction for POOL PersistencySvc
+IOVDbSvc             INFO Only 5 POOL conditions files will be open at once
+IOVDbSvc             INFO Cache alignment will be done in 3 slices
+IOVDbSvc             INFO Global tag: CONDBR2-BLKPA-2018-13 set from joboptions
+IOVDbFolder          INFO Inputfile tag override disabled for /GLOBAL/BField/Maps
+IOVDbSvc             INFO Initialised with 10 connections and 29 folders
+IOVDbSvc             INFO Service IOVDbSvc initialised successfully
+ClassIDSvc           INFO  getRegistryEntries: read 2789 CLIDRegistry entries for module ALL
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2
+IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
+IOVSvc.IOVSvcTool    INFO IOVRanges will be checked at every Event
+IOVDbSvc             INFO Opening COOL connection for COOLONL_RPC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_TGC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_RPC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_TGC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_RPC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_RPC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Added taginfo remove for /CSC/FTHOLD
+IOVDbSvc             INFO Added taginfo remove for /CSC/NOISE
+IOVDbSvc             INFO Added taginfo remove for /CSC/PED
+IOVDbSvc             INFO Added taginfo remove for /CSC/PSLOPE
+IOVDbSvc             INFO Added taginfo remove for /CSC/RMS
+IOVDbSvc             INFO Added taginfo remove for /CSC/STAT
+IOVDbSvc             INFO Added taginfo remove for /CSC/T0BASE
+IOVDbSvc             INFO Added taginfo remove for /CSC/T0PHASE
+IOVDbSvc             INFO Added taginfo remove for /EXT/DCS/MAGNETS/SENSORDATA
+IOVDbSvc             INFO Added taginfo remove for /GLOBAL/BField/Maps
+IOVDbSvc             INFO Added taginfo remove for /MDT/CABLING/MAP_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /MDT/CABLING/MEZZANINE_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /MDT/RTBLOB
+IOVDbSvc             INFO Added taginfo remove for /MDT/T0BLOB
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/CSC/ILINES
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ASBUILTPARAMS
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/BARREL
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEA
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEC
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/TGC/SIDEA
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/TGC/SIDEC
+IOVDbSvc             INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA_CORR
+IOVDbSvc             INFO Added taginfo remove for /RPC/DCS/DeadRopanels
+IOVDbSvc             INFO Added taginfo remove for /RPC/DCS/OffRopanels
+IOVDbSvc             INFO Added taginfo remove for /RPC/DQMF/ELEMENT_STATUS
+IOVDbSvc             INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_ETA
+IOVDbSvc             INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_PHI
+IOVDbSvc             INFO Added taginfo remove for /TGC/CABLING/MAP_SCHEMA
+GeoModelSvc          INFO Explicitly initializing DetDescrCnvSvc
+DetDescrCnvSvc       INFO  initializing 
+DetDescrCnvSvc       INFO Found DetectorStore service
+DetDescrCnvSvc       INFO  filling proxies for detector managers 
+DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for SCT_ID with CLID 2517 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TRT_ID with CLID 2518 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for SiliconID with CLID 129452393 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArEM_ID with CLID 163583365 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArEM_SuperCell_ID with CLID 99488227 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHEC_ID with CLID 3870484 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHEC_SuperCell_ID with CLID 254277678 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArFCAL_ID with CLID 45738051 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArFCAL_SuperCell_ID with CLID 12829437 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArMiniFCAL_ID with CLID 79264204 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArOnlineID with CLID 158698068 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TTOnlineID with CLID 38321944 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArOnline_SuperCellID with CLID 115600394 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHVLineID with CLID 27863673 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArElectrodeID with CLID 80757351 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileID with CLID 2901 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for Tile_SuperCell_ID with CLID 49557789 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileHWID with CLID 2902 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileTBID with CLID 2903 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for MDTIDHELPER with CLID 4170 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CSCIDHELPER with CLID 4171 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for RPCIDHELPER with CLID 4172 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TGCIDHELPER with CLID 4173 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloLVL1_ID with CLID 108133391 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloCell_ID with CLID 123500438 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloCell_SuperCell_ID with CLID 128365736 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloDM_ID with CLID 167756483 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for ZdcID with CLID 190591643 and storage type 68 to detector store 
+GeoModelSvc.Muo...   INFO Initializing ...
+GeoModelSvc::RD...WARNING  Getting PixTBMatComponents with default tag
+GeoModelSvc::RD...WARNING  Getting PixTBMaterials with default tag
+GeoModelSvc::RD...WARNING  Getting InDetMatComponents with default tag
+GeoModelSvc::RD...WARNING  Getting InDetMaterials with default tag
+MuonGeoModel         INFO MuonDetectorFactory - constructor  MuonSystem OuterRadius 13000 Length 22030
+GeoModelSvc.Muo...   INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00
+GeoModelSvc.Muo...   INFO (from GeoModelSvc)    AtlasVersion = <ATLAS-R2-2016-01-00-01>  MuonVersion = <>
+GeoModelSvc.Muo...   INFO Keys for Muon Switches are  (key) ATLAS-R2-2016-01-00-01 (node) ATLAS
+GeoModelSvc.Muo...   INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01>  default MuonVersion is <MuonSpectrometer-R.08.01>
+GeoModelSvc.Muo...   INFO Properties have been set as follows: 
+GeoModelSvc.Muo...   INFO     LayoutName                     R
+GeoModelSvc.Muo...   INFO     IncludeCutouts                 0
+GeoModelSvc.Muo...   INFO     IncludeCutoutsBog              0
+GeoModelSvc.Muo...   INFO     IncludeCtbBis                  0
+GeoModelSvc.Muo...   INFO     ControlAlines                  111111
+GeoModelSvc.Muo...   INFO     MinimalGeoFlag                 0
+GeoModelSvc.Muo...   INFO     EnableCscIntAlignment          1
+GeoModelSvc.Muo...   INFO     EnableCscIntAlignmentFromGM    0
+GeoModelSvc.Muo...   INFO     ControlCscIntAlines            111111
+GeoModelSvc.Muo...   INFO     EnableMdtDeformations          1
+GeoModelSvc.Muo...   INFO     EnableMdtAsBuiltParameters     1
+MuGM:MuonFactory     INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures 
+MuGM:MuonFactory     INFO                    BOG cutouts are activated 1 , all other cutouts are disabled 1
+MuGM:MuonFactory     INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuonGeoModel.MYSQL   INFO GeometryVersion set to <R.08.01>
+MuGM:MuonFactory     INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+EventPersistenc...   INFO Added successfully Conversion service:ByteStreamCnvSvc
+EventPersistenc...   INFO Added successfully Conversion service:DetDescrCnvSvc
+MDT_IDDetDescrCnv    INFO in createObj: creating a MdtIdHelper object in the detector store
+IdDictDetDescrCnv    INFO in initialize
+IdDictDetDescrCnv    INFO in createObj: creating a IdDictManager object in the detector store
+IdDictDetDescrCnv    INFO IdDictName:  IdDictParser/ATLAS_IDS.xml
+IdDictDetDescrCnv    INFO Reading InnerDetector    IdDict file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
+IdDictDetDescrCnv    INFO Reading LArCalorimeter   IdDict file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
+IdDictDetDescrCnv    INFO Reading TileCalorimeter  IdDict file IdDictParser/IdDictTileCalorimeter.xml
+IdDictDetDescrCnv    INFO Reading Calorimeter      IdDict file IdDictParser/IdDictCalorimeter_L1Onl.xml
+IdDictDetDescrCnv    INFO Reading MuonSpectrometer IdDict file IdDictParser/IdDictMuonSpectrometer_R.03.xml
+IdDictDetDescrCnv    INFO Reading ForwardDetectors IdDict file IdDictParser/IdDictForwardDetectors_2010.xml
+IdDictDetDescrCnv    INFO Found id dicts:
+IdDictDetDescrCnv    INFO Using dictionary tag: null
+IdDictDetDescrCnv    INFO Dictionary ATLAS                version default              DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary Calorimeter          version default              DetDescr tag CaloIdentifier-LVL1-02 file IdDictParser/IdDictCalorimeter_L1Onl.xml
+IdDictDetDescrCnv    INFO Dictionary ForwardDetectors     version default              DetDescr tag ForDetIdentifier-01       file IdDictParser/IdDictForwardDetectors_2010.xml
+IdDictDetDescrCnv    INFO Dictionary InnerDetector        version IBL-DBM              DetDescr tag InDetIdentifier-IBL3D25-02 file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
+IdDictDetDescrCnv    INFO Dictionary LArCalorimeter       version fullAtlas            DetDescr tag LArIdentifier-DC3-05-Comm file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
+IdDictDetDescrCnv    INFO Dictionary LArElectrode         version fullAtlas            DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary LArHighVoltage       version fullAtlas            DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary MuonSpectrometer     version R.03                 DetDescr tag MuonIdentifier-08         file IdDictParser/IdDictMuonSpectrometer_R.03.xml
+IdDictDetDescrCnv    INFO Dictionary TileCalorimeter      version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00         file IdDictParser/IdDictTileCalorimeter.xml
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+MdtIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+MdtIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 241
+MdtIdHelper          INFO MultiRange built successfully to tube: MultiRange size is 241
+MdtIdHelper          INFO Initializing MDT hash indices ... 
+MdtIdHelper          INFO The element hash max is 1188
+MdtIdHelper          INFO The detector element hash max is 2328
+MdtIdHelper          INFO Initializing MDT hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO MDTIDHELPER retrieved from DetStore
+RPC_IDDetDescrCnv    INFO in createObj: creating a RpcIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+RpcIdHelper          INFO MultiRange built successfully to doubletR: MultiRange size is 241
+RpcIdHelper          INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 241
+RpcIdHelper          INFO MultiRange built successfully to rpcStrip: MultiRange size is 241
+RpcIdHelper          INFO Initializing RPC hash indices ... 
+RpcIdHelper          INFO The element hash max is 600
+RpcIdHelper          INFO The detector element hash max is 1122
+RpcIdHelper          INFO Initializing RPC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO RPCIDHELPER retrieved from DetStore
+TGC_IDDetDescrCnv    INFO in createObj: creating a TgcIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+TgcIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+TgcIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 210
+TgcIdHelper          INFO MultiRange built successfully to channel: MultiRange size is 241
+TgcIdHelper          INFO Initializing TGC hash indices ... 
+TgcIdHelper          INFO The element hash max is 1578
+TgcIdHelper          INFO The detector element hash max is 1578
+TgcIdHelper          INFO Initializing TGC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO TGCIDHELPER retrieved from DetStore
+CSC_IDDetDescrCnv    INFO in createObj: creating a CcscIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+CscIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+CscIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 237
+CscIdHelper          INFO MultiRange built successfully to cscStrip: MultiRange size is 241
+CscIdHelper          INFO Initializing CSC hash indices ... 
+CscIdHelper          INFO The element hash max is 32
+CscIdHelper          INFO The detector element hash max is 64
+CscIdHelper          INFO The channel hash max is 61440
+CscIdHelper          INFO Initializing CSC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO CSCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ************************
+MuGM:MuonFactory     INFO  *** Start building the Muon Geometry Tree **********************
+MuGM:RDBReadAtlas    INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS>
+RDBAccessSvc      WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO After getQuery XtomoData
+In DblQ00Xtomo(data)
+No XtomoData table in the MuonDD Database
+MuGM:RDBReadAtlas    INFO After new DblQ00Xtomo
+MuGM:RDBReadAtlas    INFO No Ascii aszt input found: looking for A-lines in ORACLE
+MuGM:RDBReadAtlas    INFO ASZT table found in Oracle
+MuGM:RDBReadAtlas    INFO ASZT size is 32
+MuGM:RDBReadAtlas    INFO No Ascii iacsc input found: looking for A-lines in ORACLE
+RDBAccessSvc      WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO No ISZT table in Oracle
+MuGM:RDBReadAtlas    INFO Access granted for all dbObjects needed by muon detectors
+MuonGeoModel.MYSQL   INFO LayoutName (from DBAM) set to <R.08>  -- relevant for CTB2004
+MuGM:ProcStations    INFO  Processing Stations and Components
+MuGM:ProcStations    INFO  Processing Stations and Components DONE
+MuGM:ProcTechnol.s   INFO nMDT 13 nCSC 2 nTGC 22 nRPC 25
+MuGM:ProcTechnol.s   INFO nDED 2 nSUP 4 nSPA 2
+MuGM:ProcTechnol.s   INFO nCHV 7 nCRO 7 nCMI 6 nLBI 6
+MuGM:ProcPosition    INFO  *** N. of stations positioned in the setup 234
+MuGM:ProcPosition    INFO  *** N. of stations described in mysql      234
+MuGM:ProcPosition    INFO  *** N. of types  32 size of jtypvec 32
+MuGM:ProcPosition    INFO  *** : 234 kinds of stations (type*sub_type) 
+MuGM:ProcPosition    INFO  *** : 1758 physical stations in space - according to the MuonDD DataBase
+MuGM:ProcCutouts     INFO  Processing Cutouts for geometry layout R.08
+MuGM:ProcCutouts     INFO  Processing Cutouts DONE
+MuGM:RDBReadAtlas    INFO  ProcessTGCreadout - version 7 wirespacing 1.8
+MuGM:RDBReadAtlas    INFO Intermediate Objects built from primary numbers
+MuGM:MuonFactory     INFO  theMaterialManager retrieven successfully from the DetStore
+MuGM:MuonFactory     INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS>
+MuGM:MuonFactory     INFO  TreeTop added to the Manager
+MuGM:MuonFactory     INFO  Muon Layout R.08.01
+MuGM:MuonFactory     INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction)
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ****************************
+MuGM:MuonFactory     INFO  *** The Muon Chamber Geometry Tree is built with 
+MuGM:MuonFactory     INFO  *** 1758 child volumes 
+MuGM:MuonFactory     INFO  *** 1839 independent elements and 
+MuGM:MuonFactory     INFO  *** 11473 elements cloned or shared 
+MuGM:MuonFactory     INFO  *** 234 kinds of stations
+MuGM:MuonFactory     INFO  *** 1758 stations with alignable transforms
+MuGM:MuonFactory     INFO  *** 148 stations are described as Assemblies
+MuGM:MuonFactory     INFO  *** 1758 MuonStations 
+MuGM:MuonFactory     INFO  *** 	 2324 MDT Readout Elements 	 1186 MDT Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 32 CSC Readout Elements 	 32 CSC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1122 RPC Readout Elements 	 600 RPC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1578 TGC Readout Elements 	 1578 TGC Detector Elements 
+MuGM:MuonFactory     INFO  ********************************************************************
+MuGM:MuonFactory     INFO  *** Inert Material built according to DB switches and config. ****** 
+MuGM:MuonFactory     INFO  *** The Muon Geometry Tree has 1758 child vol.s in total ********
+MuGM:MuonFactory     INFO  ********************************************************************
+
+MGM::MuonDetect...   INFO Init A/B Line Containers - done - size is respectively 1758/0
+MGM::MuonDetect...   INFO Init of CSC I-Lines will be done via Conditions DB
+MGM::MuonDetect...   INFO Init I-Line Container - done - size is respectively 128
+MGM::MuonDetect...   INFO I-Line for CSC wire layers loaded (Csc Internal Alignment)
+MGM::MuonDetect...   INFO According to configuration they WILL be used 
+MGM::MuonDetect...   INFO Filling cache
+GeoModelSvc          INFO GeoModelSvc.MuonDetectorTool	 SZ= 228524Kb 	 Time = 0.94S
+ClassIDSvc           INFO  getRegistryEntries: read 4462 CLIDRegistry entries for module ALL
+AGDDtoGeoSvc         INFO  this is AGDDtoGeoSvc::initialize()
+AGDDtoGeoSvc.Mu...   INFO  initializing AGDD builder
+AGDDtoGeoSvc.Mu...   INFO  XML file 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO  Sections 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO  Volumes 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO MuonAGDDTool::initialize
+AGDDtoGeoSvc.Mu...   INFO AGDDtoGeoSvc.MuonSpectrometer::construct()
+AGDDtoGeoSvc.Mu...   INFO  Reading AGDD2GeoSwitches flags 
+AGDDtoGeoSvc.Mu...   INFO  ----> ECT_Toroids
+AGDDtoGeoSvc.Mu...   INFO  ----> BAR_Toroid
+AGDDtoGeoSvc.Mu...   INFO  ----> Feet
+AGDDtoGeoSvc.Mu...   INFO  ----> RailAssembly
+AGDDtoGeoSvc.Mu...   INFO  ----> JFSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> JDSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> JTSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> pp2
+AGDDtoGeoSvc.Mu...   INFO  ----> MBAP_AccessPlatform
+AGDDtoGeoSvc.Mu...   INFO  ----> MBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> SADL_CalorimeterSaddle
+AGDDtoGeoSvc.Mu...   INFO  ----> TBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> TGC3_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> TGC1_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> MDTRail
+AGDDtoGeoSvc.Mu...   INFO  ----> servicesAtZ0
+AGDDtoGeoSvc.Mu...   INFO  ----> HFTruckRail
+AGDDtoGeoSvc.Mu...   INFO  ----> RUN2_Services
+AGDDtoGeoSvc.Mu...   INFO  now reading AGDD blob 
+AGDDtoGeoSvc.Mu...   INFO  now dumping the flags 
+AGDDtoGeoSvc.Mu...   INFO 		----- ECT_Toroids ECT_Toroids
+AGDDtoGeoSvc.Mu...   INFO 		----- BAR_Toroid BAR_Toroid
+AGDDtoGeoSvc.Mu...   INFO 		----- Feet Feet
+AGDDtoGeoSvc.Mu...   INFO 		----- RailAssembly RailAssembly
+AGDDtoGeoSvc.Mu...   INFO 		----- JFSH_Shield JFSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- JDSH_Shield JDSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- JTSH_Shield JTSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- pp2 pp2
+AGDDtoGeoSvc.Mu...   INFO 		----- MBAP_AccessPlatform MBAP_AccessPlatform
+AGDDtoGeoSvc.Mu...   INFO 		----- MBWH_BigWheels MBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- SADL_CalorimeterSaddle SADL_CalorimeterSaddle
+AGDDtoGeoSvc.Mu...   INFO 		----- TBWH_BigWheels TBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- TGC3_BigWheels TGC3_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- TGC1_BigWheels TGC1_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- MDTRail MDTRail
+AGDDtoGeoSvc.Mu...   INFO 		----- servicesAtZ0 servicesAtZ0
+AGDDtoGeoSvc.Mu...   INFO 		----- HFTruckRail HFTruckRail
+AGDDtoGeoSvc.Mu...   INFO 		----- RUN2_Services RUN2_Services
+AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
+ClassIDSvc           INFO  getRegistryEntries: read 1315 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 251 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 310 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 242 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1064 CLIDRegistry entries for module ALL
+CondInputLoader      INFO Initializing CondInputLoader...
+CondInputLoader      INFO Adding base classes:
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' )   ->
+CondInputLoader      INFO Will create WriteCondHandle dependencies for the following DataObjects:
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' ) 
+MuonAlignmentCo...   INFO Initilalizing
+MuonAlignmentCo...   INFO In initialize ---- # of folders registered is 7
+MuonAlignmentCo...   INFO geometry version from the MuonDetectorManager = R.08.01
+MuonDetectorCon...   INFO Initializing ...
+AtlasFieldMapCo...   INFO Initialize: Key  ( 'AtlasFieldMapCondObj' , 'ConditionStore+fieldMapCondObj' )  has been succesfully registered 
+AtlasFieldMapCo...   INFO Initialize: Will update the field map from conditions
+AtlasFieldCache...   INFO Initialize: Key  ( 'AtlasFieldCacheCondObj' , 'ConditionStore+fieldCondObj' )  has been succesfully registered 
+AtlasFieldCache...   INFO Initialize: Will update current from conditions
+AtlasFieldCache...   INFO Initialize: useDCS, useSoleCurrent, useToroCurrent. 1,  'UseSoleCurrent':7730.0000,  'UseToroCurrent':20400.000 LockMapCurrents 0
+RegSelCondAlg_RPC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_RPC'
+RegSelCondAlg_TGC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_TGC'
+RegSelCondAlg_MDT    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_MDT'
+RegSelCondAlg_CSC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_CSC'
+ClassIDSvc           INFO  getRegistryEntries: read 8930 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 683 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1588 CLIDRegistry entries for module ALL
 RpcRawDataProvider   INFO RpcRawDataProvider::initialize
 RpcRawDataProvider   INFO  'DoSeededDecoding':False
+ClassIDSvc           INFO  getRegistryEntries: read 990 CLIDRegistry entries for module ALL
+ROBDataProviderSvc   INFO Initializing ROBDataProviderSvc - package version ByteStreamCnvSvcBase-00-00-00
+ROBDataProviderSvc   INFO  ---> Filter out empty ROB fragments                               =  'filterEmptyROB':False
+ROBDataProviderSvc   INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
+ROBDataProviderSvc   INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 RpcRawDataProvi...   INFO initialize() successful in RpcRawDataProvider.RPC_RawDataProviderToolMT
 TgcRawDataProvider   INFO TgcRawDataProvider::initialize
 TgcRawDataProvider   INFO  'DoSeededDecoding':False
+ClassIDSvc           INFO  getRegistryEntries: read 1240 CLIDRegistry entries for module ALL
 TgcRawDataProvi...   INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT.TgcROD_Decoder
+MuonTGC_CablingSvc   INFO for 1/12 sector initialize
+MuonTGC_Cabling...   INFO initialize
+ToolSvc.TGCCabl...   INFO initialize
+ToolSvc.TGCCabl...   INFO readTGCMap from text
+ToolSvc.TGCCabl...   INFO readTGCMap found file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-16T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/ASD2PP_diff_12_ONL.db
+ToolSvc.TGCCabl...   INFO giveASD2PP_DIFF_12 (m_ASD2PP_DIFF_12 is not NULL)
 TgcRawDataProvi...   INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT
 MdtRawDataProvider   INFO MdtRawDataProvider::initialize
 MdtRawDataProvider   INFO  'DoSeededDecoding':False
-MdtRawDataProvi...   INFO Retrieved service ServiceHandle('ROBDataProviderSvc')
+ClassIDSvc           INFO  getRegistryEntries: read 1427 CLIDRegistry entries for module ALL
+MdtRawDataProvi...   INFO Retrieved service ROBDataProviderSvc = ServiceHandle('ROBDataProviderSvc')
 MdtRawDataProvi...   INFO Processing configuration for layouts with BME chambers.
 MdtRawDataProvi...   INFO Processing configuration for layouts with BMG chambers.
 MdtRawDataProvi...   INFO Retrieved tool Decoder = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder')
 MdtRawDataProvi...   INFO initialize() successful in MdtRawDataProvider.MDT_RawDataProviderToolMT
+ClassIDSvc           INFO  getRegistryEntries: read 1008 CLIDRegistry entries for module ALL
 CscRawDataProvi...   INFO Retrieved service ServiceHandle('ROBDataProviderSvc')
 CscRawDataProvi...   INFO Retrieved tool Decoder = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder')
 CscRawDataProvi...   INFO The Muon Geometry version is R.08.01
 CscRawDataProvi...   INFO initialize() successful in CscRawDataProvider.CSC_RawDataProviderToolMT
+ClassIDSvc           INFO  getRegistryEntries: read 54 CLIDRegistry entries for module ALL
+RpcRdoToRpcPrep...   INFO package version = MuonRPC_CnvTools-00-00-00
 RpcRdoToRpcPrep...   INFO properties are 
 RpcRdoToRpcPrep...   INFO produceRpcCoinDatafromTriggerWords 1
 RpcRdoToRpcPrep...   INFO reduceCablingOverlap               1
@@ -24,15 +591,495 @@ RpcRdoToRpcPrep...   INFO timeShift                          -12.5
 RpcRdoToRpcPrep...   INFO etaphi_coincidenceTime             20
 RpcRdoToRpcPrep...   INFO overlap_timeTolerance              10
 RpcRdoToRpcPrep...   INFO Correct prd time from cool db      0
+MuonRPC_CablingSvc   INFO Initializing MuonRPC_CablingSvc - package version MuonRPC_Cabling-00-00-00
+ToolSvc.RPCCabl...   INFO Initializing - folders names are: conf /RPC/CABLING/MAP_SCHEMA / corr /RPC/CABLING/MAP_SCHEMA_CORR
+MuonRPC_CablingSvc   INFO RPCCablingDbTool retrieved with handle TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool')
+MuonRPC_CablingSvc   INFO Register call-back  against 2 folders listed below 
+MuonRPC_CablingSvc   INFO  Folder n. 1 </RPC/CABLING/MAP_SCHEMA>     found in the DetStore
+ClassIDSvc           INFO  getRegistryEntries: read 242 CLIDRegistry entries for module ALL
+MuonRPC_CablingSvc   INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA>
+MuonRPC_CablingSvc   INFO  Folder n. 2 </RPC/CABLING/MAP_SCHEMA_CORR>     found in the DetStore
+MuonRPC_CablingSvc   INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA_CORR>
+MuonRPC_CablingSvc   INFO RPCTriggerDbTool retrieved with statusCode = SUCCESS pointer = TheRpcTriggerDbTool = PublicToolHandle('RPCTriggerDbTool')
+MuonRPC_CablingSvc   INFO Register call-back  against 2 folders listed below 
+MuonRPC_CablingSvc   INFO  Folder n. 1 </RPC/TRIGGER/CM_THR_ETA>     found in the DetStore
+MuonRPC_CablingSvc   INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_ETA>
+MuonRPC_CablingSvc   INFO  Folder n. 2 </RPC/TRIGGER/CM_THR_PHI>     found in the DetStore
+MuonRPC_CablingSvc   INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_PHI>
 RpcRdoToRpcPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::RpcRdoToPrepDataToolMT/RpcRdoToRpcPrepDataTool')
+ClassIDSvc           INFO  getRegistryEntries: read 169 CLIDRegistry entries for module ALL
 TgcRdoToTgcPrep...   INFO initialize() successful in TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool
 TgcRdoToTgcPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::TgcRdoToPrepDataToolMT/TgcRdoToTgcPrepDataTool')
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BMG chambers.
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BME chambers.
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BMG chambers.
 MdtRdoToMdtPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::MdtRdoToPrepDataToolMT/MdtRdoToMdtPrepDataTool')
+ClassIDSvc           INFO  getRegistryEntries: read 116 CLIDRegistry entries for module ALL
 CscRdoToCscPrep...   INFO Retrieved CscRdoToCscPrepDataTool = PrivateToolHandle('Muon::CscRdoToCscPrepDataToolMT/CscRdoToCscPrepDataTool')
+ByteStreamInputSvc   INFO Initializing ByteStreamInputSvc - package version ByteStreamCnvSvc-00-00-00
+ClassIDSvc           INFO  getRegistryEntries: read 452 CLIDRegistry entries for module ALL
+EventSelector        INFO reinitialization...
+AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr    SUCCESS ****************************** Algorithm Sequence ****************************
+ApplicationMgr    SUCCESS AthSequencer/AthMasterSeq
+ApplicationMgr    SUCCESS      AthSequencer/AthAlgEvtSeq
+ApplicationMgr    SUCCESS           AthSequencer/AthBeginSeq
+ApplicationMgr    SUCCESS                AthIncFirerAlg/BeginIncFiringAlg
+ApplicationMgr    SUCCESS                IncidentProcAlg/IncidentProcAlg1
+ApplicationMgr    SUCCESS           AthSequencer/AthAllAlgSeq
+ApplicationMgr    SUCCESS                AthSequencer/AthCondSeq
+ApplicationMgr    SUCCESS                     CondInputLoader/CondInputLoader
+ApplicationMgr    SUCCESS                     MuonAlignmentCondAlg/MuonAlignmentCondAlg
+ApplicationMgr    SUCCESS                     MuonDetectorCondAlg/MuonDetectorCondAlg
+ApplicationMgr    SUCCESS                     RpcCablingCondAlg/RpcCablingCondAlg
+ApplicationMgr    SUCCESS                     MuonMDT_CablingAlg/MuonMDT_CablingAlg
+ApplicationMgr    SUCCESS                     MagField::AtlasFieldMapCondAlg/AtlasFieldMapCondAlg
+ApplicationMgr    SUCCESS                     MagField::AtlasFieldCacheCondAlg/AtlasFieldCacheCondAlg
+ApplicationMgr    SUCCESS                     RpcCondDbAlg/RpcCondDbAlg
+ApplicationMgr    SUCCESS                     RPC_RegSelCondAlg/RegSelCondAlg_RPC
+ApplicationMgr    SUCCESS                     TGC_RegSelCondAlg/RegSelCondAlg_TGC
+ApplicationMgr    SUCCESS                     MdtCalibDbAlg/MdtCalibDbAlg
+ApplicationMgr    SUCCESS                     MDT_RegSelCondAlg/RegSelCondAlg_MDT
+ApplicationMgr    SUCCESS                     CscCondDbAlg/CscCondDbAlg
+ApplicationMgr    SUCCESS                     CSC_RegSelCondAlg/RegSelCondAlg_CSC
+ApplicationMgr    SUCCESS                AthSequencer/AthAlgSeq
+ApplicationMgr    SUCCESS                     Muon::RpcRawDataProvider/RpcRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::TgcRawDataProvider/TgcRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::MdtRawDataProvider/MdtRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::CscRawDataProvider/CscRawDataProvider
+ApplicationMgr    SUCCESS                     RpcRdoToRpcPrepData/RpcRdoToRpcPrepData
+ApplicationMgr    SUCCESS                     TgcRdoToTgcPrepData/TgcRdoToTgcPrepData
+ApplicationMgr    SUCCESS                     MdtRdoToMdtPrepData/MdtRdoToMdtPrepData
+ApplicationMgr    SUCCESS                     CscRdoToCscPrepData/CscRdoToCscPrepData
+ApplicationMgr    SUCCESS                     CscThresholdClusterBuilder/CscThresholdClusterBuilder
+ApplicationMgr    SUCCESS           AthSequencer/AthEndSeq
+ApplicationMgr    SUCCESS                AthIncFirerAlg/EndIncFiringAlg
+ApplicationMgr    SUCCESS                IncidentProcAlg/IncidentProcAlg2
+ApplicationMgr    SUCCESS      AthSequencer/AthOutSeq
+ApplicationMgr    SUCCESS ******************************************************************************
+ByteStreamInputSvc   INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/FTHOLD'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/NOISE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PED'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PSLOPE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/RMS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/STAT'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0BASE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0PHASE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/GLOBAL/BField/Maps'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MAP_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/RTBLOB'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/T0BLOB'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/CSC/ILINES'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/BARREL'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEC'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/DeadRopanels'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/OffRopanels'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI'
+ApplicationMgr       INFO Application Manager Started successfully
+EventInfoByteSt...   INFO IsSimulation : 0
+EventInfoByteSt...   INFO IsTestbeam : 0
+EventInfoByteSt...   INFO IsCalibration : 0
+AthenaEventLoopMgr   INFO   ===>>>  start of run 327265    <<<===
+EventPersistenc...   INFO Added successfully Conversion service:TagInfoMgr
+IOVDbSvc             INFO Opening COOL connection for COOLONL_RPC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchema_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchemaCorr_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA_CORR
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrEta_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_ETA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrPhi_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_PHI
+IOVDbSvc             INFO Disconnecting from COOLONL_RPC/CONDBR2
+EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
+MuonRPC_CablingSvc   INFO initMappingModel has been called
+MuonRPC_CablingSvc   INFO ToolHandle in initMappingModel - <TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool')>
+MuonRPC_CablingSvc   INFO Retrieving cabling singleton; to create an empty one or to get the existing one
+RPCcabling           INFO CablingRPC---singleton constructor ---- this must be executed just once
+RPCcabling           INFO CablingRPC---The singleton will fill the maps from the COOL streams
+RPCcabling           INFO CablingRPC---InitMaps from COOL cannot be executed NOW: empty string
+RPCcabling           INFO CablingRPC---The singleton is created here
+RPCcabling           INFO CablingRPC--- cacheCleared: s_status = 0
+MuonRPC_CablingSvc   INFO Cabling singleton cache has been cleared
+MuonRPC_CablingSvc   INFO  Trigger roads will be loaded from COOL
+ToolSvc.RPCCabl...   INFO LoadParameters /RPC/CABLING/MAP_SCHEMA I=2 
+ToolSvc.RPCCabl...   INFO loadRPCMap --- Load Map from DB
+ToolSvc.RPCCabl...   INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA>
+ToolSvc.RPCCabl...   INFO  CondAttrListCollection from DB folder have been obtained with size 1
+ToolSvc.RPCCabl...   INFO After Reading folder, Configuration string size is 222202
+ToolSvc.RPCCabl...   INFO LoadParameters /RPC/CABLING/MAP_SCHEMA_CORR I=2 
+ToolSvc.RPCCabl...   INFO loadRPCCorr --- Load Corrections from DB
+ToolSvc.RPCCabl...   INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA_CORR>
+ToolSvc.RPCCabl...   INFO  CondAttrListCollection from DB folder have been obtained with size 1
+ToolSvc.RPCCabl...   INFO After Reading folder, Correction string size is 29369
+MuonRPC_CablingSvc   INFO  InitMappingModel: Trigger roads not yet loaded from COOL - postpone cabling initialization 
+MuonRPC_CablingSvc   INFO initTrigRoadsModel has been called
+MuonRPC_CablingSvc   INFO  Trigger roads will be loaded from COOL
+MuonRPC_CablingSvc   INFO Retrieve the pointer to the cabling singleton 
+RPCcabling           INFO CablingRPC--- cacheCleared: s_status = 0
+MuonRPC_CablingSvc   INFO Cabling singleton cache has been cleared
+ToolSvc.RPCTrig...   INFO LoadParameters /RPC/TRIGGER/CM_THR_ETA I=2 
+ToolSvc.RPCTrig...   INFO LoadParameters /RPC/TRIGGER/CM_THR_PHI I=2 
+MuonRPC_CablingSvc   INFO ======== RPC Trigger Roads from COOL - Header infos ========
+MuonRPC_CablingSvc   INFO 
+RPC LVL1 Configuration 10.6 with roads from Feb 2012
+L1 THRESHOLDS:   MU4 MU6 MU10 MU11 MU15 MU20
+Road version: "road_files_120209"
+CMA            th0    th1   th2
+eta low-pt     mu4    mu6   mu10
+phi low-pt     mu4    mu6   mu10
+eta high-pt    mu11  mu15   mu20
+phi high-pt    mu11  mu15   mu15
+
+
+RPCcabling           INFO CablingRPC---InitMaps from COOL: going to read configuration
+RPCcabling           INFO CablingRPC--->> RPC cabling map from COOL <<
+RPCcabling           INFO CablingRPC--- ReadConf: map has size 222202
+RPCcabling           INFO CablingRPC--- ReadConf: map n. of lines read is 924
+RPCcabling           INFO CablingRPC--- ReadConf: version is 5.0 Atlas R_07_03_RUN2ver104
+RPCcabling           INFO CablingRPC--- buildRDOmap
+RPCcabling           INFO CablingRPC---InitMaps from COOL: going to read corrections to configuration
+RPCcabling           INFO CablingRPC--->> RPC cabling corrections from COOL <<
+RPCcabling           INFO CablingRPC--- ReadCorr: CorrMap has size 29369
+RPCcabling           INFO CablingRPC--- ReadConf: CorrMap n. of lines read is 743
+RPCcabling           INFO CablingRPC---InitMaps from COOL - maps have been parsed
+MuonRPC_CablingSvc   INFO InitTrigRoadsModel: RPC cabling model is loaded!
+Level-1 configuration database version 5.0 Atlas R_07_03_RUN2ver104 read.
+Contains 26 Trigger Sector Types:
+negative sectors  0 - 15 ==> 18  2 24  3 19  2 24  4 20  2 24  1 18  5 25  6 
+negative sectors 16 - 31 ==> 21 13 26  6 21  7 16  8 14  7 16  6 21 13 26  1 
+positive sectors 32 - 47 ==>  9 24  2 22  9 24  2 23 10 24  2 18  1 25  5 18 
+positive sectors 48 - 63 ==>  1 26 13 21  6 17 12 15 11 17 12 21  6 26 13 22 
+
+MuonRPC_CablingSvc   INFO buildOfflineOnlineMap
+MuonRPC_CablingSvc   INFO Applying FeetPadThresholds : 0,2,5
+MuonRPC_CablingSvc   INFO MuonRPC_CablingSvc initialized succesfully
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186525031, run #327265 0 events processed so far  <<<===
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_CSC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscFthold-RUN2-BLK-UPD1-007-00 for folder /CSC/FTHOLD
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscNoise-RUN2-BLK-UPD1-007-00 for folder /CSC/NOISE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPed-RUN2-BLK-UPD1-007-00 for folder /CSC/PED
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPslope-RUN2-BLK-UPD1-000-00 for folder /CSC/PSLOPE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscRms-RUN2-BLK-UPD1-003-00 for folder /CSC/RMS
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscStat-RUN2-BLK-UPD1-008-00 for folder /CSC/STAT
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0base-RUN2-BLK-UPD1-001-00 for folder /CSC/T0BASE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0phase-RUN2-BLK-UPD2-001-00 for folder /CSC/T0PHASE
+IOVDbSvc             INFO Disconnecting from COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to BFieldMap-Run1-14m-v01 for folder /GLOBAL/BField/Maps
+IOVDbSvc             INFO Disconnecting from COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_MDT/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMapSchema_BMG_01 for folder /MDT/CABLING/MAP_SCHEMA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMezzanineSchema_M5-RUN2 for folder /MDT/CABLING/MEZZANINE_SCHEMA
+IOVDbSvc             INFO Disconnecting from COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MDT/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTRT-RUN2-UPD4-21 for folder /MDT/RTBLOB
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTT0-RUN2-UPD4-21 for folder /MDT/T0BLOB
+IOVDbSvc             INFO Disconnecting from COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignCscIlines-UPD1-02 for folder /MUONALIGN/CSC/ILINES
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMdtAsbuiltparams-RUN2-BA_ONLY-UPD4-00 for folder /MUONALIGN/MDT/ASBUILTPARAMS
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTBarrelAlign-RUN2-BA_ROLLING_11-BLKP-UPD4-00 for folder /MUONALIGN/MDT/BARREL
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapAAlign-RUN2-ECA_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapCAlign-RUN2-ECC_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEC
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapAAlign-RUN2-TGCA_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapCAlign-RUN2-TGCC_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEC
+IOVDbSvc             INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_RPC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCDQMFElementStatus_Run1_UPD4-RUN2-01 for folder /RPC/DQMF/ELEMENT_STATUS
+IOVDbSvc             INFO Disconnecting from COOLOFL_RPC/CONDBR2
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/CSC/ILINES>
+MuonAlignmentCo...   INFO Size of CSC/ILINES CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' )  readCscILinesCdo->size()= 1
+MuonAlignmentCo...   INFO Range of CSC/ILINES input is {[0,0,t:1425168000] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO recorded new CscInternalAlignmentMapContainer with range {[0,0,t:1425168000] - [t:4294967294.854775807]} into Conditions Store
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ASBUILTPARAMS>
+MuonAlignmentCo...   INFO Size of MDT/ASBUILTPARAMS CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' )  ->size()= 1
+MuonAlignmentCo...   INFO Range of MDT/ASBUILTPARAMS input is {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO recorded new MdtAsBuiltMapContainer with range {[0,0,t:0] - [t:4294967294.854775807]} into Conditions Store
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/BARREL>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/BARREL CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/BARREL input is, ALines: {[0,0,t:1497851700] - [t:1498737300]} BLines: {[0,0,t:1497851700] - [t:1498737300]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/BARREL have IoV = 195569
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/BARREL> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEA CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEA input is, ALines: {[0,0,t:1497891240] - [t:1497898380]} BLines: {[0,0,t:1497891240] - [t:1497898380]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEA have IoV = 195588
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEC CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEC input is, ALines: {[0,0,t:1497892260] - [t:1497899460]} BLines: {[0,0,t:1497892260] - [t:1497899460]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEC have IoV = 195599
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEA>
+MuonAlignmentCo...   INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEA
+MuonAlignmentCo...   INFO Size of /MUONALIGN/TGC/SIDEA CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/TGC/SIDEA input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/TGC/SIDEA have IoV = 82360
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEA> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEC>
+MuonAlignmentCo...   INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEC
+MuonAlignmentCo...   INFO Size of /MUONALIGN/TGC/SIDEC CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/TGC/SIDEC input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/TGC/SIDEC have IoV = 82359
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEC> loaded
+MuonAlignmentCo...   INFO recorded new ALineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+MuonAlignmentCo...   INFO recorded new BLineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+MuonGeoModel         INFO MuonDetectorFactory - constructor  MuonSystem OuterRadius 13000 Length 22030
+MuonDetectorCon...   INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00
+MuonDetectorCon...   INFO (from GeoModelSvc)    AtlasVersion = <ATLAS-R2-2016-01-00-01>  MuonVersion = <>
+MuonDetectorCon...   INFO Keys for Muon Switches are  (key) ATLAS-R2-2016-01-00-01 (node) ATLAS
+MuonDetectorCon...   INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01>  default MuonVersion is <MuonSpectrometer-R.08.01>
+MuonDetectorCon...   INFO Properties have been set as follows: 
+MuonDetectorCon...   INFO     LayoutName                     R
+MuonDetectorCon...   INFO     IncludeCutouts                 0
+MuonDetectorCon...   INFO     IncludeCutoutsBog              0
+MuonDetectorCon...   INFO     IncludeCtbBis                  0
+MuonDetectorCon...   INFO     ControlAlines                  111111
+MuonDetectorCon...   INFO     MinimalGeoFlag                 0
+MuonDetectorCon...   INFO     EnableCscIntAlignment          1
+MuonDetectorCon...   INFO     EnableCscIntAlignmentFromGM    0
+MuonDetectorCon...   INFO     ControlCscIntAlines            111111
+MuonDetectorCon...   INFO     EnableMdtDeformations          1
+MuonDetectorCon...   INFO     EnableMdtAsBuiltParameters     1
+MuGM:MuonFactory     INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures 
+MuGM:MuonFactory     INFO                    BOG cutouts are activated 1 , all other cutouts are disabled 1
+MuGM:MuonFactory     INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuonGeoModel.MYSQL   INFO GeometryVersion set to <R.08.01>
+MuGM:MuonFactory     INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuGM:MuonFactory     INFO MDTIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO RPCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO TGCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO CSCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ************************
+MuGM:MuonFactory     INFO  *** Start building the Muon Geometry Tree **********************
+MuGM:RDBReadAtlas    INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS>
+RDBAccessSvc      WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO After getQuery XtomoData
+In DblQ00Xtomo(data)
+No XtomoData table in the MuonDD Database
+MuGM:RDBReadAtlas    INFO After new DblQ00Xtomo
+MuGM:RDBReadAtlas    INFO No Ascii aszt input found: looking for A-lines in ORACLE
+MuGM:RDBReadAtlas    INFO ASZT table found in Oracle
+MuGM:RDBReadAtlas    INFO ASZT size is 32
+MuGM:RDBReadAtlas    INFO No Ascii iacsc input found: looking for A-lines in ORACLE
+RDBAccessSvc      WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO No ISZT table in Oracle
+MuGM:RDBReadAtlas    INFO Access granted for all dbObjects needed by muon detectors
+MuonGeoModel.MYSQL   INFO LayoutName (from DBAM) set to <R.08>  -- relevant for CTB2004
+MuGM:ProcStations    INFO  Processing Stations and Components
+MuGM:ProcStations    INFO  Processing Stations and Components DONE
+MuGM:ProcTechnol.s   INFO nMDT 26 nCSC 4 nTGC 44 nRPC 50
+MuGM:ProcTechnol.s   INFO nDED 4 nSUP 8 nSPA 4
+MuGM:ProcTechnol.s   INFO nCHV 14 nCRO 14 nCMI 12 nLBI 12
+MuGM:ProcPosition    INFO  *** N. of stations positioned in the setup 234
+MuGM:ProcPosition    INFO  *** N. of stations described in mysql      234
+MuGM:ProcPosition    INFO  *** N. of types  32 size of jtypvec 32
+MuGM:ProcPosition    INFO  *** : 234 kinds of stations (type*sub_type) 
+MuGM:ProcPosition    INFO  *** : 1758 physical stations in space - according to the MuonDD DataBase
+MuGM:ProcCutouts     INFO  Processing Cutouts for geometry layout R.08
+MuGM:ProcCutouts     INFO  Processing Cutouts DONE
+MuGM:RDBReadAtlas    INFO  ProcessTGCreadout - version 7 wirespacing 1.8
+MuGM:RDBReadAtlas    INFO Intermediate Objects built from primary numbers
+MuGM:MuonFactory     INFO  theMaterialManager retrieven successfully from the DetStore
+MuGM:MuonFactory     INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS>
+MuGM:MuonFactory     INFO  TreeTop added to the Manager
+MuGM:MuonFactory     INFO  Muon Layout R.08.01
+MuGM:MuonFactory     INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction)
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ****************************
+MuGM:MuonFactory     INFO  *** The Muon Chamber Geometry Tree is built with 
+MuGM:MuonFactory     INFO  *** 1758 child volumes 
+MuGM:MuonFactory     INFO  *** 1839 independent elements and 
+MuGM:MuonFactory     INFO  *** 11473 elements cloned or shared 
+MuGM:MuonFactory     INFO  *** 234 kinds of stations
+MuGM:MuonFactory     INFO  *** 1758 stations with alignable transforms
+MuGM:MuonFactory     INFO  *** 148 stations are described as Assemblies
+MuGM:MuonFactory     INFO  *** 1758 MuonStations 
+MuGM:MuonFactory     INFO  *** 	 2324 MDT Readout Elements 	 1186 MDT Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 32 CSC Readout Elements 	 32 CSC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1122 RPC Readout Elements 	 600 RPC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1578 TGC Readout Elements 	 1578 TGC Detector Elements 
+MuGM:MuonFactory     INFO  ********************************************************************
+MuGM:MuonFactory     INFO  *** Inert Material built according to DB switches and config. ****** 
+MuGM:MuonFactory     INFO  *** The Muon Geometry Tree has 1758 child vol.s in total ********
+MuGM:MuonFactory     INFO  ********************************************************************
+
+MGM::MuonDetect...   INFO Init A/B Line Containers - done - size is respectively 1758/0
+MGM::MuonDetect...   INFO Init of CSC I-Lines will be done via Conditions DB
+MGM::MuonDetect...   INFO Init I-Line Container - done - size is respectively 128
+MGM::MuonDetect...   INFO I-Line for CSC wire layers loaded (Csc Internal Alignment)
+MGM::MuonDetect...   INFO According to configuration they WILL be used 
+MGM::MuonDetect...   INFO Filling cache
+MGM::MuonDetect...   INFO temporary CSC I-line container with size = 128
+MGM::MuonDetect...   INFO # of CSC I-lines read from the ILineMapContainer in StoreGate is 128
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to A-lines             is 128
+MGM::MuonDetect...   INFO # of entries in the CSC I-lines historical container          is 128
+MGM::MuonDetect...   INFO temporary As-Built container with size = 628
+MGM::MuonDetect...   INFO # of MDT As-Built read from the MdtAsBuiltMapContainer in StoreGate is 628
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to As-Built                  is 628
+MGM::MuonDetect...   INFO # of entries in the MdtAsBuilt historical container                 is 628
+MGM::MuonDetect...   INFO temporary A-line container with size = 2694
+MGM::MuonDetect...   INFO # of A-lines read from the ALineMapContainer in StoreGate is 2694
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to A-lines         is 2694
+MGM::MuonDetect...   INFO # of entries in the A-lines historical container          is 2814
+MGM::MuonDetect...   INFO In updateDeformations()
+MGM::MuonDetect...   INFO temporary B-line container with size = 1206
+MGM::MuonDetect...   INFO # of B-lines read from the ALineMapContainer in StoreGate   is 1206
+MGM::MuonDetect...   INFO # of deform-Transforms updated according to B-lines         is 1174
+MGM::MuonDetect...   INFO # of entries in the B-lines historical container            is 1174
+MuonDetectorCon...   INFO recorded new MuonDetectorManager with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+RpcCablingCondAlg    INFO maps configuration have been parsed
+RpcCablingCondAlg    INFO recorded new RpcCablingCondData with range {[315000,l:0] - [999999,l:0]}
+MuonMDT_CablingAlg   INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' )  readCdoMez->size()= 24
+MuonMDT_CablingAlg   INFO Range of input is {[0,l:0] - [INVALID]}
+MuonMDT_CablingAlg   INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' )  readCdoMap->size()= 2312
+MuonMDT_CablingAlg   INFO Range of input is {[327264,l:4294640031] - [327265,l:4294640030]}
+MuonMDT_CablingAlg   INFO recorded new MuonMDT_CablingMap with range {[327264,t:0,l:4294640031] - [327265,l:4294640030]} into Conditions Store
+AtlasFieldMapCo...   INFO updateFieldMap: Update map from conditions
+AtlasFieldMapCo...   INFO updateFieldMap: Update map from conditions: Range of input/output is {[0,l:0] - [INVALID]}
+AtlasFieldMapCo...   INFO updateFieldMap: reading magnetic field map filenames from COOL
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type GlobalMap with soleCur=7730 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_7730_20400_14m.root)
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type SolenoidMap with soleCur=7730 toroCur=0 (path file:MagneticFieldMaps/bfieldmap_7730_0_14m.root)
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type ToroidMap with soleCur=0 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_0_20400_14m.root)
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Range of input currents is {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Attempt 1 at reading currents from DCS (using channel name)
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Currents read from DCS - solenoid 7729.99 toroid 20399.9
+AtlasFieldMapCo...   INFO updateFieldMap: currents are OK, will use nominal maps
+AtlasFieldMapCo...   INFO updateFieldMap: tagInfoH  ( 'TagInfo' , 'DetectorStore+ProcessingTags' )  is valid. 
+AtlasFieldMapCo...   INFO updateFieldMap: DID NOT reset currents from TagInfo
+AtlasFieldMapCo...   INFO updateFieldMap: Set map currents from FieldSvc: solenoid/toroid 7730,20400
+AtlasFieldMapCo...   INFO updateFieldMap: Use map file MagneticFieldMaps/bfieldmap_7730_20400_14m.root
+AtlasFieldMapCo...   INFO updateFieldMap: Initialized the field map from /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/MagneticFieldMaps/bfieldmap_7730_20400_14m.root
+AtlasFieldMapCo...   INFO execute: solenoid zone id  7000
+AtlasFieldMapCo...   INFO execute: recorded AtlasFieldMapCondObj with EventRange {[0,l:0] - [INVALID]}
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Range of input/output is {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Attempt 1 at reading currents from DCS (using channel name)
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Currents read from DCS - solenoid 7729.99 toroid 20399.9
+AtlasFieldCache...   INFO scaleField: Solenoid field scale factor 1. Desired current and map current: 7729.99,7730
+AtlasFieldCache...   INFO scaleField: Toroid field scale factor 1. Desired current and map current: 20399.9,20400
+AtlasFieldCache...   INFO execute: initialized AtlasFieldCacheCondObj and cache with SFs - sol/tor 1/1, EventRange {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldCache...   INFO execute: solenoid zone id  7000
+RegSelCondAlg_RPC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_RPC'
+RegSelCondAlg_TGC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_TGC'
+MdtCalibDbAlg        INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' )  readCdoRt->size()= 1186
+MdtCalibDbAlg        INFO Range of input is {[327265,l:0] - [327342,l:0]}
+MdtCalibDbAlg        INFO MdtCalibDbAlg::loadRt Read 1188RTs from COOL
+MdtCalibDbAlg        INFO recorded new MdtRtRelationCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store
+MdtCalibDbAlg        INFO recorded new MdtCorFuncSetCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store
+MdtCalibDbAlg        INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML -6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1
+MdtCalibDbAlg        INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML stationEta 6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1
+MdtCalibDbAlg        INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' )  readCdoTube->size()= 1186
+MdtCalibDbAlg        INFO Range of input is {[319000,l:0] - [INVALID]}
+MdtCalibDbAlg        INFO recorded new MdtTubeCalibContainerCollection with range {[319000,l:0] - [INVALID]} into Conditions Store
+RegSelCondAlg_MDT    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_MDT'
+RegSelCondAlg_CSC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_CSC'
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186525031, run #327265 1 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186524665, run #327265 1 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186524665, run #327265 2 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186542447, run #327265 2 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186542447, run #327265 3 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186543405, run #327265 3 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186543405, run #327265 4 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186548387, run #327265 4 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186548387, run #327265 5 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186515186, run #327265 5 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186515186, run #327265 6 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186556019, run #327265 6 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186556019, run #327265 7 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186542866, run #327265 7 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186542866, run #327265 8 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186537901, run #327265 8 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186537901, run #327265 9 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186517811, run #327265 9 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186517811, run #327265 10 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186534221, run #327265 10 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186534221, run #327265 11 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186540986, run #327265 11 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186540986, run #327265 12 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186535104, run #327265 12 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186535104, run #327265 13 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186539903, run #327265 13 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186539903, run #327265 14 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186552713, run #327265 14 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186552713, run #327265 15 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186524730, run #327265 15 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186524730, run #327265 16 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186547632, run #327265 16 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186547632, run #327265 17 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186555621, run #327265 17 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186555621, run #327265 18 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186568452, run #327265 18 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186568452, run #327265 19 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186580451, run #327265 19 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186580451, run #327265 20 events processed so far  <<<===
+Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
+ApplicationMgr       INFO Application Manager Stopped successfully
+IncidentProcAlg1     INFO Finalize
+CondInputLoader      INFO Finalizing CondInputLoader...
+IncidentProcAlg2     INFO Finalize
+IOVDbFolder          INFO Folder /CSC/FTHOLD (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/322656 ((     0.06 ))s
+IOVDbFolder          INFO Folder /CSC/NOISE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/350062 ((     0.06 ))s
+IOVDbFolder          INFO Folder /CSC/PED (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411187 ((     0.07 ))s
+IOVDbFolder          INFO Folder /CSC/PSLOPE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/353376 ((     0.03 ))s
+IOVDbFolder          INFO Folder /CSC/RMS (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411395 ((     0.04 ))s
+IOVDbFolder          INFO Folder /CSC/STAT (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/230496 ((     0.04 ))s
+IOVDbFolder          INFO Folder /CSC/T0BASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/314380 ((     0.02 ))s
+IOVDbFolder          INFO Folder /CSC/T0PHASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/3136 ((     0.03 ))s
+IOVDbFolder          INFO Folder /EXT/DCS/MAGNETS/SENSORDATA (AttrListColl) db-read 1/1 objs/chan/bytes 4/4/20 ((     0.04 ))s
+IOVDbFolder          INFO Folder /GLOBAL/BField/Maps (AttrListColl) db-read 1/1 objs/chan/bytes 3/3/202 ((     0.03 ))s
+IOVDbFolder          INFO Folder /MDT/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 2312/2437/216520 ((     0.13 ))s
+IOVDbFolder          INFO Folder /MDT/CABLING/MEZZANINE_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 24/24/288 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MDT/RTBLOB (AttrListColl) db-read 1/1 objs/chan/bytes 2372/1186/2251209 ((     0.13 ))s
+IOVDbFolder          INFO Folder /MDT/T0BLOB (AttrListColl) db-read 1/1 objs/chan/bytes 1186/1186/1374284 ((     0.12 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/CSC/ILINES (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/10814 ((     0.03 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ASBUILTPARAMS (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/128992 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/BARREL (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/140293 ((     0.04 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65494 ((     0.04 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65497 ((     0.04 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/TGC/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 ((     0.03 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/TGC/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 ((     0.03 ))s
+IOVDbFolder          INFO Folder /RPC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/222235 ((     0.06 ))s
+IOVDbFolder          INFO Folder /RPC/CABLING/MAP_SCHEMA_CORR (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/29402 ((     0.04 ))s
+IOVDbFolder          INFO Folder /RPC/DCS/DeadRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 32/48/6200 ((     0.00 ))s
+IOVDbFolder          INFO Folder /RPC/DCS/OffRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 4/48/16 ((     0.00 ))s
+IOVDbFolder          INFO Folder /RPC/DQMF/ELEMENT_STATUS (AttrListColl) db-read 1/1 objs/chan/bytes 8320/8320/6180700 ((     0.18 ))s
+IOVDbFolder          INFO Folder /RPC/TRIGGER/CM_THR_ETA (AttrListColl) db-read 1/2 objs/chan/bytes 1613/1613/7562651 ((     0.10 ))s
+IOVDbFolder          INFO Folder /RPC/TRIGGER/CM_THR_PHI (AttrListColl) db-read 1/2 objs/chan/bytes 1612/1612/8096306 ((     0.07 ))s
+IOVDbFolder          INFO Folder /TGC/CABLING/MAP_SCHEMA (AttrListColl) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
+IOVDbSvc             INFO  bytes in ((      1.49 ))s
+IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=CONDBR2 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
+IOVDbSvc             INFO Connection COOLOFL_MUONALIGN/CONDBR2 : nConnect: 2 nFolders: 7 ReadTime: ((     0.23 ))s
+IOVDbSvc             INFO Connection COOLONL_RPC/CONDBR2 : nConnect: 2 nFolders: 4 ReadTime: ((     0.27 ))s
+IOVDbSvc             INFO Connection COOLONL_TGC/CONDBR2 : nConnect: 1 nFolders: 1 ReadTime: ((     0.00 ))s
+IOVDbSvc             INFO Connection COOLONL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: ((     0.15 ))s
+IOVDbSvc             INFO Connection COOLONL_GLOBAL/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: ((     0.03 ))s
+IOVDbSvc             INFO Connection COOLOFL_DCS/CONDBR2 : nConnect: 2 nFolders: 3 ReadTime: ((     0.04 ))s
+IOVDbSvc             INFO Connection COOLOFL_RPC/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: ((     0.18 ))s
+IOVDbSvc             INFO Connection COOLOFL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: ((     0.25 ))s
+IOVDbSvc             INFO Connection COOLOFL_CSC/CONDBR2 : nConnect: 2 nFolders: 8 ReadTime: ((     0.34 ))s
+ToolSvc              INFO Removing all tools created by ToolSvc
+TgcRdoToTgcPrep...   INFO finalize(): input RDOs->output PRDs [Hit: 6807->6807, Tracklet: 28->28, TrackletEIFI: 692->692, HiPt: 4031->4031, SL: 3->3]
 MdtRawDataProvi...   INFO Fraction of fills that use the cache = 0
+ToolSvc.TGCCabl...   INFO finalize
+MuonTGC_Cabling...   INFO finalize
 TgcRawDataProvi...   INFO Fraction of fills that use the cache = 0
 RpcROD_Decoder:...   INFO  ============ FINAL RPC DATA FORMAT STAT. =========== 
 RpcROD_Decoder:...   INFO  RX Header Errors.............0
@@ -49,3 +1096,14 @@ RpcROD_Decoder:...   INFO  SL Footer Errors.............0
 RpcROD_Decoder:...   INFO  RX Footer Errors.............0
 RpcROD_Decoder:...   INFO  CRC8 check Failures..........0
 RpcROD_Decoder:...   INFO  ==================================================== 
+ToolSvc.ByteStr...   INFO in finalize()
+IdDictDetDescrCnv    INFO in finalize
+*****Chrono*****     INFO ****************************************************************************************************
+*****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
+*****Chrono*****     INFO ****************************************************************************************************
+cObj_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 32
+ChronoStatSvc        INFO Time User   : Tot= 15.1  [s]  #=  1
+*****Chrono*****     INFO ****************************************************************************************************
+ChronoStatSvc.f...   INFO  Service finalized successfully 
+ApplicationMgr       INFO Application Manager Finalized successfully
+ApplicationMgr       INFO Application Manager Terminated successfully
diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
index dcb83378af3e..6d55261a126c 100644
--- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
+++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
@@ -1,21 +1,588 @@
+Flag Name                                : Value
+Beam.BunchSpacing                        : 25
+Beam.Energy                              : [function]
+Beam.NumberOfCollisions                  : [function]
+Beam.Type                                : [function]
+Beam.estimatedLuminosity                 : [function]
+Common.Project                           : 'Athena'
+Common.bunchCrossingSource               : [function]
+Common.doExpressProcessing               : False
+Common.isOnline                          : False
+Common.useOnlineLumi                     : [function]
+Concurrency.NumConcurrentEvents          : 0
+Concurrency.NumProcs                     : 0
+Concurrency.NumThreads                   : 0
+Exec.DebugStage                          : ''
+Exec.MaxEvents                           : -1
+Exec.OutputLevel                         : 3
+Exec.SkipEvents                          : 0
+GeoModel.Align.Dynamic                   : [function]
+GeoModel.AtlasVersion                    : 'ATLAS-R2-2016-01-00-01'
+GeoModel.IBLLayout                       : [function]
+GeoModel.Layout                          : 'atlas'
+GeoModel.Run                             : [function]
+GeoModel.StripGeoType                    : [function]
+GeoModel.Type                            : [function]
+IOVDb.DatabaseInstance                   : [function]
+IOVDb.GlobalTag                          : 'CONDBR2-BLKPA-2018-13'
+Input.Collections                        : [function]
+Input.Files                              : ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1']
+Input.Format                             : [function]
+Input.ProjectName                        : [function]
+Input.RunNumber                          : [function]
+Input.SecondaryCollections               : [function]
+Input.SecondaryFiles                     : []
+Input.isMC                               : [function]
+Output.AODFileName                       : ''
+Output.ESDFileName                       : ''
+Output.EVNTFileName                      : ''
+Output.HISTFileName                      : ''
+Output.HITSFileName                      : ''
+Output.RDOFileName                       : ''
+Output.RDO_SGNLFileName                  : ''
+Output.doESD                             : [function]
+Output.doWriteAOD                        : [function]
+Output.doWriteBS                         : False
+Output.doWriteESD                        : [function]
+Output.doWriteRDO                        : [function]
+Output.doWriteRDO_SGNL                   : [function]
+Random.Engine                            : 'dSFMT'
+Scheduler.CheckDependencies              : True
+Scheduler.ShowControlFlow                : True
+Scheduler.ShowDataDeps                   : True
+Scheduler.ShowDataFlow                   : True
+TrackingGeometry.MagneticFileMode        : 6
+TrackingGeometry.MaterialSource          : 'COOL'
+Flag categories that can be loaded dynamically
+Category                  :                 Generator name : Defined in
+BField                    :                       __bfield : AthenaConfiguration/AllConfigFlags.py
+BTagging                  :                     __btagging : AthenaConfiguration/AllConfigFlags.py
+Calo                      :                         __calo : AthenaConfiguration/AllConfigFlags.py
+DQ                        :                           __dq : AthenaConfiguration/AllConfigFlags.py
+Detector                  :                     __detector : AthenaConfiguration/AllConfigFlags.py
+Digitization              :                 __digitization : AthenaConfiguration/AllConfigFlags.py
+Egamma                    :                       __egamma : AthenaConfiguration/AllConfigFlags.py
+InDet                     :                        __indet : AthenaConfiguration/AllConfigFlags.py
+LAr                       :                          __lar : AthenaConfiguration/AllConfigFlags.py
+MET                       :                          __met : AthenaConfiguration/AllConfigFlags.py
+Muon                      :                         __muon : AthenaConfiguration/AllConfigFlags.py
+MuonCombined              :                 __muoncombined : AthenaConfiguration/AllConfigFlags.py
+Overlay                   :                      __overlay : AthenaConfiguration/AllConfigFlags.py
+PF                        :                        __pflow : AthenaConfiguration/AllConfigFlags.py
+PerfMon                   :                      __perfmon : AthenaConfiguration/AllConfigFlags.py
+Sim                       :                   __simulation : AthenaConfiguration/AllConfigFlags.py
+Tile                      :                         __tile : AthenaConfiguration/AllConfigFlags.py
+Trigger                   :                      __trigger : AthenaConfiguration/AllConfigFlags.py
+Py:Athena            INFO About to setup Raw data decoding
+Py:Athena            INFO using release [WorkDir-22.0.18] [x86_64-centos7-gcc8-opt] [removeDuplicateProp/12d6dd5] -- built on [2020-09-17T1141]
+Py:AutoConfigFlags    INFO Obtaining metadata of auto-configuration by peeking into /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1
+Py:MetaReader        INFO Current mode used: peeker
+Py:MetaReader        INFO Current filenames: ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1']
+Py:ConfigurableDb    INFO Read module info for 5566 configurables from 4 genConfDb files
+Py:ConfigurableDb    INFO No duplicates have been found: that's good !
+EventInfoMgtInit: Got release version  Athena-22.0.18
+Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
+Py:Athena            INFO Print Config
+Py:ComponentAccumulator    INFO Event Inputs
+Py:ComponentAccumulator    INFO Event Algorithm Sequences
+Py:ComponentAccumulator    INFO AthSequencer('AthAlgSeq', Sequential=True, Members=[MuonCacheCreator('MuonCacheCreator', MdtCsmCacheKey='MdtCsmRdoCache', CscCacheKey='CscRdoCache', RpcCacheKey='RpcRdoCache', TgcCacheKey='TgcRdoCache'), RpcRawDataProvider('RpcRawDataProvider', ProviderTool=RPC_RawDataProviderToolMT('RPC_RawDataProviderToolMT', Decoder=RpcROD_Decoder('RpcROD_Decoder'), RdoLocation='RPCPAD', RpcContainerCacheKey='RpcRdoCache', WriteOutRpcSectorLogic=False), RoIs='HLT_MURoIs'), TgcRawDataProvider('TgcRawDataProvider', ProviderTool=TGC_RawDataProviderToolMT('TGC_RawDataProviderToolMT', Decoder=TGC_RodDecoderReadout('TgcROD_Decoder'), RdoLocation='TGCRDO', TgcContainerCacheKey='TgcRdoCache')), MdtRawDataProvider('MdtRawDataProvider', ProviderTool=MDT_RawDataProviderToolMT('MDT_RawDataProviderToolMT', Decoder=MdtROD_Decoder('MdtROD_Decoder'), RdoLocation='MDTCSM', CsmContainerCacheKey='MdtCsmRdoCache')), CscRawDataProvider('CscRawDataProvider', ProviderTool=CSC_RawDataProviderToolMT('CSC_RawDataProviderToolMT', Decoder=CscROD_Decoder('CscROD_Decoder'), RdoLocation='CSCRDO', CscContainerCacheKey='CscRdoCache')), RpcRdoToRpcPrepData('RpcRdoToRpcPrepData', DecodingTool=RpcRdoToPrepDataToolMT('RpcRdoToRpcPrepDataTool'), PrintPrepData=False, RegSel_RPC=RegSelTool('RegSelTool_RPC', RegSelLUT='RegSelLUTCondData_RPC', Initialised=True)), TgcRdoToTgcPrepData('TgcRdoToTgcPrepData', DecodingTool=TgcRdoToPrepDataToolMT('TgcRdoToTgcPrepDataTool'), PrintPrepData=False, RegSel_TGC=RegSelTool('RegSelTool_TGC', RegSelLUT='RegSelLUTCondData_TGC', Initialised=True)), MdtRdoToMdtPrepData('MdtRdoToMdtPrepData', DecodingTool=MdtRdoToPrepDataToolMT('MdtRdoToMdtPrepDataTool'), PrintPrepData=False, RegSel_MDT=RegSelTool('RegSelTool_MDT', RegSelLUT='RegSelLUTCondData_MDT', Initialised=True)), CscRdoToCscPrepData('CscRdoToCscPrepData', CscRdoToCscPrepDataTool=CscRdoToCscPrepDataToolMT('CscRdoToCscPrepDataTool'), PrintPrepData=False, RegSel_CSC=RegSelTool('RegSelTool_CSC', RegSelLUT='RegSelLUTCondData_CSC', Initialised=True)), CscThresholdClusterBuilder('CscThresholdClusterBuilder', cluster_builder=CscThresholdClusterBuilderTool('CscThresholdClusterBuilderTool'))])
+Py:ComponentAccumulator    INFO Condition Algorithms
+Py:ComponentAccumulator    INFO  \__ CondInputLoader (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonAlignmentCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonDetectorCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RpcCablingCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonMDT_CablingAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ AtlasFieldMapCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ AtlasFieldCacheCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RpcCondDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_RPC (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_TGC (cond alg)
+Py:ComponentAccumulator    INFO  \__ MdtCalibDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_MDT (cond alg)
+Py:ComponentAccumulator    INFO  \__ CscCondDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_CSC (cond alg)
+Py:ComponentAccumulator    INFO Services
+Py:ComponentAccumulator    INFO ['ByteStreamCnvSvc', 'ByteStreamInputSvc', 'EventSelector', 'EventPersistencySvc', 'ROBDataProviderSvc', 'ByteStreamAddressProviderSvc', 'MetaDataStore', 'InputMetaDataStore', 'MetaDataSvc', 'ProxyProviderSvc', 'GeoModelSvc', 'DetDescrCnvSvc', 'TagInfoMgr', 'AGDDtoGeoSvc', 'MuonIdHelperSvc', 'IOVDbSvc', 'PoolSvc', 'CondSvc', 'DBReplicaSvc', 'AthenaPoolCnvSvc', 'RPCcablingServerSvc', 'MuonRPC_CablingSvc', 'LVL1TGC::TGCRecRoiSvc', 'TGCcablingServerSvc', 'MuonMDT_CablingSvc', 'CSCcablingSvc']
+Py:ComponentAccumulator    INFO Public Tools
+Py:ComponentAccumulator    INFO [
+Py:ComponentAccumulator    INFO   IOVDbMetaDataTool/IOVDbMetaDataTool,
+Py:ComponentAccumulator    INFO   ByteStreamMetadataTool/ByteStreamMetadataTool,
+Py:ComponentAccumulator    INFO   RPCCablingDbTool/RPCCablingDbTool,
+Py:ComponentAccumulator    INFO   Muon::RPC_RawDataProviderToolMT/RPC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   Muon::TGC_RawDataProviderToolMT/TGC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   MDTCablingDbTool/MDTCablingDbTool,
+Py:ComponentAccumulator    INFO   Muon::MDT_RawDataProviderToolMT/MDT_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   Muon::CSC_RawDataProviderToolMT/CSC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO ]
+Py:ComponentAccumulator    INFO Private Tools
+Py:ComponentAccumulator    INFO [
+Py:ComponentAccumulator    INFO ]
+Py:ComponentAccumulator    INFO TheApp properties
+Py:ComponentAccumulator    INFO   EvtSel : EventSelector
+Py:Athena            INFO Save Config
+
+JOs reading stage finished, launching CARunner from pickle file
+
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on pcaz004 on Thu Sep 17 11:43:58 2020
+====================================================================================================================================
+ApplicationMgr       INFO Application Manager Configured successfully
+CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
+ClassIDSvc           INFO  getRegistryEntries: read 4008 CLIDRegistry entries for module ALL
+MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
+PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
+PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
+PoolSvc              INFO Frontier compression level set to 5
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-16T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host pcaz004.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO COOL SQLite replicas will be excluded if matching pattern /DBRelease/
+PoolSvc              INFO Successfully setup replica sorting algorithm
+PoolSvc              INFO Setting up APR FileCatalog and Streams
+PoolSvc              INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml
+PoolSvc           WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for prfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml
+DbSession            INFO     Open     DbSession    
+Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
+ToolSvc.ByteStr...   INFO Initializing ToolSvc.ByteStreamMetadataTool - package version ByteStreamCnvSvc-00-00-00
+MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray(['IOVDbMetaDataTool/IOVDbMetaDataTool','ByteStreamMetadataTool/ByteStreamMetadataTool'])
+OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
+ByteStreamAddre...   INFO Initializing ByteStreamAddressProviderSvc - package version ByteStreamCnvSvcBase-00-00-00
+ByteStreamAddre...   INFO initialized 
+ByteStreamAddre...   INFO -- Will fill Store with id =  0
+IOVDbSvc             INFO Opened read transaction for POOL PersistencySvc
+IOVDbSvc             INFO Only 5 POOL conditions files will be open at once
+IOVDbSvc             INFO Cache alignment will be done in 3 slices
+IOVDbSvc             INFO Global tag: CONDBR2-BLKPA-2018-13 set from joboptions
+IOVDbFolder          INFO Inputfile tag override disabled for /GLOBAL/BField/Maps
+IOVDbSvc             INFO Initialised with 10 connections and 29 folders
+IOVDbSvc             INFO Service IOVDbSvc initialised successfully
+ClassIDSvc           INFO  getRegistryEntries: read 2789 CLIDRegistry entries for module ALL
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2
+IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
+IOVSvc.IOVSvcTool    INFO IOVRanges will be checked at every Event
+IOVDbSvc             INFO Opening COOL connection for COOLONL_RPC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_TGC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_RPC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_TGC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_RPC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_RPC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Added taginfo remove for /CSC/FTHOLD
+IOVDbSvc             INFO Added taginfo remove for /CSC/NOISE
+IOVDbSvc             INFO Added taginfo remove for /CSC/PED
+IOVDbSvc             INFO Added taginfo remove for /CSC/PSLOPE
+IOVDbSvc             INFO Added taginfo remove for /CSC/RMS
+IOVDbSvc             INFO Added taginfo remove for /CSC/STAT
+IOVDbSvc             INFO Added taginfo remove for /CSC/T0BASE
+IOVDbSvc             INFO Added taginfo remove for /CSC/T0PHASE
+IOVDbSvc             INFO Added taginfo remove for /EXT/DCS/MAGNETS/SENSORDATA
+IOVDbSvc             INFO Added taginfo remove for /GLOBAL/BField/Maps
+IOVDbSvc             INFO Added taginfo remove for /MDT/CABLING/MAP_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /MDT/CABLING/MEZZANINE_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /MDT/RTBLOB
+IOVDbSvc             INFO Added taginfo remove for /MDT/T0BLOB
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/CSC/ILINES
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ASBUILTPARAMS
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/BARREL
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEA
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEC
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/TGC/SIDEA
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/TGC/SIDEC
+IOVDbSvc             INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA_CORR
+IOVDbSvc             INFO Added taginfo remove for /RPC/DCS/DeadRopanels
+IOVDbSvc             INFO Added taginfo remove for /RPC/DCS/OffRopanels
+IOVDbSvc             INFO Added taginfo remove for /RPC/DQMF/ELEMENT_STATUS
+IOVDbSvc             INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_ETA
+IOVDbSvc             INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_PHI
+IOVDbSvc             INFO Added taginfo remove for /TGC/CABLING/MAP_SCHEMA
+GeoModelSvc          INFO Explicitly initializing DetDescrCnvSvc
+DetDescrCnvSvc       INFO  initializing 
+DetDescrCnvSvc       INFO Found DetectorStore service
+DetDescrCnvSvc       INFO  filling proxies for detector managers 
+DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for SCT_ID with CLID 2517 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TRT_ID with CLID 2518 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for SiliconID with CLID 129452393 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArEM_ID with CLID 163583365 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArEM_SuperCell_ID with CLID 99488227 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHEC_ID with CLID 3870484 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHEC_SuperCell_ID with CLID 254277678 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArFCAL_ID with CLID 45738051 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArFCAL_SuperCell_ID with CLID 12829437 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArMiniFCAL_ID with CLID 79264204 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArOnlineID with CLID 158698068 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TTOnlineID with CLID 38321944 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArOnline_SuperCellID with CLID 115600394 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHVLineID with CLID 27863673 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArElectrodeID with CLID 80757351 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileID with CLID 2901 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for Tile_SuperCell_ID with CLID 49557789 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileHWID with CLID 2902 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileTBID with CLID 2903 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for MDTIDHELPER with CLID 4170 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CSCIDHELPER with CLID 4171 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for RPCIDHELPER with CLID 4172 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TGCIDHELPER with CLID 4173 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloLVL1_ID with CLID 108133391 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloCell_ID with CLID 123500438 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloCell_SuperCell_ID with CLID 128365736 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloDM_ID with CLID 167756483 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for ZdcID with CLID 190591643 and storage type 68 to detector store 
+GeoModelSvc.Muo...   INFO Initializing ...
+GeoModelSvc::RD...WARNING  Getting PixTBMatComponents with default tag
+GeoModelSvc::RD...WARNING  Getting PixTBMaterials with default tag
+GeoModelSvc::RD...WARNING  Getting InDetMatComponents with default tag
+GeoModelSvc::RD...WARNING  Getting InDetMaterials with default tag
+MuonGeoModel         INFO MuonDetectorFactory - constructor  MuonSystem OuterRadius 13000 Length 22030
+GeoModelSvc.Muo...   INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00
+GeoModelSvc.Muo...   INFO (from GeoModelSvc)    AtlasVersion = <ATLAS-R2-2016-01-00-01>  MuonVersion = <>
+GeoModelSvc.Muo...   INFO Keys for Muon Switches are  (key) ATLAS-R2-2016-01-00-01 (node) ATLAS
+GeoModelSvc.Muo...   INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01>  default MuonVersion is <MuonSpectrometer-R.08.01>
+GeoModelSvc.Muo...   INFO Properties have been set as follows: 
+GeoModelSvc.Muo...   INFO     LayoutName                     R
+GeoModelSvc.Muo...   INFO     IncludeCutouts                 0
+GeoModelSvc.Muo...   INFO     IncludeCutoutsBog              0
+GeoModelSvc.Muo...   INFO     IncludeCtbBis                  0
+GeoModelSvc.Muo...   INFO     ControlAlines                  111111
+GeoModelSvc.Muo...   INFO     MinimalGeoFlag                 0
+GeoModelSvc.Muo...   INFO     EnableCscIntAlignment          1
+GeoModelSvc.Muo...   INFO     EnableCscIntAlignmentFromGM    0
+GeoModelSvc.Muo...   INFO     ControlCscIntAlines            111111
+GeoModelSvc.Muo...   INFO     EnableMdtDeformations          1
+GeoModelSvc.Muo...   INFO     EnableMdtAsBuiltParameters     1
+MuGM:MuonFactory     INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures 
+MuGM:MuonFactory     INFO                    BOG cutouts are activated 1 , all other cutouts are disabled 1
+MuGM:MuonFactory     INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuonGeoModel.MYSQL   INFO GeometryVersion set to <R.08.01>
+MuGM:MuonFactory     INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+EventPersistenc...   INFO Added successfully Conversion service:ByteStreamCnvSvc
+EventPersistenc...   INFO Added successfully Conversion service:DetDescrCnvSvc
+MDT_IDDetDescrCnv    INFO in createObj: creating a MdtIdHelper object in the detector store
+IdDictDetDescrCnv    INFO in initialize
+IdDictDetDescrCnv    INFO in createObj: creating a IdDictManager object in the detector store
+IdDictDetDescrCnv    INFO IdDictName:  IdDictParser/ATLAS_IDS.xml
+IdDictDetDescrCnv    INFO Reading InnerDetector    IdDict file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
+IdDictDetDescrCnv    INFO Reading LArCalorimeter   IdDict file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
+IdDictDetDescrCnv    INFO Reading TileCalorimeter  IdDict file IdDictParser/IdDictTileCalorimeter.xml
+IdDictDetDescrCnv    INFO Reading Calorimeter      IdDict file IdDictParser/IdDictCalorimeter_L1Onl.xml
+IdDictDetDescrCnv    INFO Reading MuonSpectrometer IdDict file IdDictParser/IdDictMuonSpectrometer_R.03.xml
+IdDictDetDescrCnv    INFO Reading ForwardDetectors IdDict file IdDictParser/IdDictForwardDetectors_2010.xml
+IdDictDetDescrCnv    INFO Found id dicts:
+IdDictDetDescrCnv    INFO Using dictionary tag: null
+IdDictDetDescrCnv    INFO Dictionary ATLAS                version default              DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary Calorimeter          version default              DetDescr tag CaloIdentifier-LVL1-02 file IdDictParser/IdDictCalorimeter_L1Onl.xml
+IdDictDetDescrCnv    INFO Dictionary ForwardDetectors     version default              DetDescr tag ForDetIdentifier-01       file IdDictParser/IdDictForwardDetectors_2010.xml
+IdDictDetDescrCnv    INFO Dictionary InnerDetector        version IBL-DBM              DetDescr tag InDetIdentifier-IBL3D25-02 file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
+IdDictDetDescrCnv    INFO Dictionary LArCalorimeter       version fullAtlas            DetDescr tag LArIdentifier-DC3-05-Comm file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
+IdDictDetDescrCnv    INFO Dictionary LArElectrode         version fullAtlas            DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary LArHighVoltage       version fullAtlas            DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary MuonSpectrometer     version R.03                 DetDescr tag MuonIdentifier-08         file IdDictParser/IdDictMuonSpectrometer_R.03.xml
+IdDictDetDescrCnv    INFO Dictionary TileCalorimeter      version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00         file IdDictParser/IdDictTileCalorimeter.xml
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+MdtIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+MdtIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 241
+MdtIdHelper          INFO MultiRange built successfully to tube: MultiRange size is 241
+MdtIdHelper          INFO Initializing MDT hash indices ... 
+MdtIdHelper          INFO The element hash max is 1188
+MdtIdHelper          INFO The detector element hash max is 2328
+MdtIdHelper          INFO Initializing MDT hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO MDTIDHELPER retrieved from DetStore
+RPC_IDDetDescrCnv    INFO in createObj: creating a RpcIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+RpcIdHelper          INFO MultiRange built successfully to doubletR: MultiRange size is 241
+RpcIdHelper          INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 241
+RpcIdHelper          INFO MultiRange built successfully to rpcStrip: MultiRange size is 241
+RpcIdHelper          INFO Initializing RPC hash indices ... 
+RpcIdHelper          INFO The element hash max is 600
+RpcIdHelper          INFO The detector element hash max is 1122
+RpcIdHelper          INFO Initializing RPC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO RPCIDHELPER retrieved from DetStore
+TGC_IDDetDescrCnv    INFO in createObj: creating a TgcIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+TgcIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+TgcIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 210
+TgcIdHelper          INFO MultiRange built successfully to channel: MultiRange size is 241
+TgcIdHelper          INFO Initializing TGC hash indices ... 
+TgcIdHelper          INFO The element hash max is 1578
+TgcIdHelper          INFO The detector element hash max is 1578
+TgcIdHelper          INFO Initializing TGC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO TGCIDHELPER retrieved from DetStore
+CSC_IDDetDescrCnv    INFO in createObj: creating a CcscIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+CscIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+CscIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 237
+CscIdHelper          INFO MultiRange built successfully to cscStrip: MultiRange size is 241
+CscIdHelper          INFO Initializing CSC hash indices ... 
+CscIdHelper          INFO The element hash max is 32
+CscIdHelper          INFO The detector element hash max is 64
+CscIdHelper          INFO The channel hash max is 61440
+CscIdHelper          INFO Initializing CSC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO CSCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ************************
+MuGM:MuonFactory     INFO  *** Start building the Muon Geometry Tree **********************
+MuGM:RDBReadAtlas    INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS>
+RDBAccessSvc      WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO After getQuery XtomoData
+In DblQ00Xtomo(data)
+No XtomoData table in the MuonDD Database
+MuGM:RDBReadAtlas    INFO After new DblQ00Xtomo
+MuGM:RDBReadAtlas    INFO No Ascii aszt input found: looking for A-lines in ORACLE
+MuGM:RDBReadAtlas    INFO ASZT table found in Oracle
+MuGM:RDBReadAtlas    INFO ASZT size is 32
+MuGM:RDBReadAtlas    INFO No Ascii iacsc input found: looking for A-lines in ORACLE
+RDBAccessSvc      WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO No ISZT table in Oracle
+MuGM:RDBReadAtlas    INFO Access granted for all dbObjects needed by muon detectors
+MuonGeoModel.MYSQL   INFO LayoutName (from DBAM) set to <R.08>  -- relevant for CTB2004
+MuGM:ProcStations    INFO  Processing Stations and Components
+MuGM:ProcStations    INFO  Processing Stations and Components DONE
+MuGM:ProcTechnol.s   INFO nMDT 13 nCSC 2 nTGC 22 nRPC 25
+MuGM:ProcTechnol.s   INFO nDED 2 nSUP 4 nSPA 2
+MuGM:ProcTechnol.s   INFO nCHV 7 nCRO 7 nCMI 6 nLBI 6
+MuGM:ProcPosition    INFO  *** N. of stations positioned in the setup 234
+MuGM:ProcPosition    INFO  *** N. of stations described in mysql      234
+MuGM:ProcPosition    INFO  *** N. of types  32 size of jtypvec 32
+MuGM:ProcPosition    INFO  *** : 234 kinds of stations (type*sub_type) 
+MuGM:ProcPosition    INFO  *** : 1758 physical stations in space - according to the MuonDD DataBase
+MuGM:ProcCutouts     INFO  Processing Cutouts for geometry layout R.08
+MuGM:ProcCutouts     INFO  Processing Cutouts DONE
+MuGM:RDBReadAtlas    INFO  ProcessTGCreadout - version 7 wirespacing 1.8
+MuGM:RDBReadAtlas    INFO Intermediate Objects built from primary numbers
+MuGM:MuonFactory     INFO  theMaterialManager retrieven successfully from the DetStore
+MuGM:MuonFactory     INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS>
+MuGM:MuonFactory     INFO  TreeTop added to the Manager
+MuGM:MuonFactory     INFO  Muon Layout R.08.01
+MuGM:MuonFactory     INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction)
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ****************************
+MuGM:MuonFactory     INFO  *** The Muon Chamber Geometry Tree is built with 
+MuGM:MuonFactory     INFO  *** 1758 child volumes 
+MuGM:MuonFactory     INFO  *** 1839 independent elements and 
+MuGM:MuonFactory     INFO  *** 11473 elements cloned or shared 
+MuGM:MuonFactory     INFO  *** 234 kinds of stations
+MuGM:MuonFactory     INFO  *** 1758 stations with alignable transforms
+MuGM:MuonFactory     INFO  *** 148 stations are described as Assemblies
+MuGM:MuonFactory     INFO  *** 1758 MuonStations 
+MuGM:MuonFactory     INFO  *** 	 2324 MDT Readout Elements 	 1186 MDT Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 32 CSC Readout Elements 	 32 CSC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1122 RPC Readout Elements 	 600 RPC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1578 TGC Readout Elements 	 1578 TGC Detector Elements 
+MuGM:MuonFactory     INFO  ********************************************************************
+MuGM:MuonFactory     INFO  *** Inert Material built according to DB switches and config. ****** 
+MuGM:MuonFactory     INFO  *** The Muon Geometry Tree has 1758 child vol.s in total ********
+MuGM:MuonFactory     INFO  ********************************************************************
+
+MGM::MuonDetect...   INFO Init A/B Line Containers - done - size is respectively 1758/0
+MGM::MuonDetect...   INFO Init of CSC I-Lines will be done via Conditions DB
+MGM::MuonDetect...   INFO Init I-Line Container - done - size is respectively 128
+MGM::MuonDetect...   INFO I-Line for CSC wire layers loaded (Csc Internal Alignment)
+MGM::MuonDetect...   INFO According to configuration they WILL be used 
+MGM::MuonDetect...   INFO Filling cache
+GeoModelSvc          INFO GeoModelSvc.MuonDetectorTool	 SZ= 228460Kb 	 Time = 0.92S
+ClassIDSvc           INFO  getRegistryEntries: read 4462 CLIDRegistry entries for module ALL
+AGDDtoGeoSvc         INFO  this is AGDDtoGeoSvc::initialize()
+AGDDtoGeoSvc.Mu...   INFO  initializing AGDD builder
+AGDDtoGeoSvc.Mu...   INFO  XML file 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO  Sections 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO  Volumes 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO MuonAGDDTool::initialize
+AGDDtoGeoSvc.Mu...   INFO AGDDtoGeoSvc.MuonSpectrometer::construct()
+AGDDtoGeoSvc.Mu...   INFO  Reading AGDD2GeoSwitches flags 
+AGDDtoGeoSvc.Mu...   INFO  ----> ECT_Toroids
+AGDDtoGeoSvc.Mu...   INFO  ----> BAR_Toroid
+AGDDtoGeoSvc.Mu...   INFO  ----> Feet
+AGDDtoGeoSvc.Mu...   INFO  ----> RailAssembly
+AGDDtoGeoSvc.Mu...   INFO  ----> JFSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> JDSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> JTSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> pp2
+AGDDtoGeoSvc.Mu...   INFO  ----> MBAP_AccessPlatform
+AGDDtoGeoSvc.Mu...   INFO  ----> MBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> SADL_CalorimeterSaddle
+AGDDtoGeoSvc.Mu...   INFO  ----> TBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> TGC3_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> TGC1_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> MDTRail
+AGDDtoGeoSvc.Mu...   INFO  ----> servicesAtZ0
+AGDDtoGeoSvc.Mu...   INFO  ----> HFTruckRail
+AGDDtoGeoSvc.Mu...   INFO  ----> RUN2_Services
+AGDDtoGeoSvc.Mu...   INFO  now reading AGDD blob 
+AGDDtoGeoSvc.Mu...   INFO  now dumping the flags 
+AGDDtoGeoSvc.Mu...   INFO 		----- ECT_Toroids ECT_Toroids
+AGDDtoGeoSvc.Mu...   INFO 		----- BAR_Toroid BAR_Toroid
+AGDDtoGeoSvc.Mu...   INFO 		----- Feet Feet
+AGDDtoGeoSvc.Mu...   INFO 		----- RailAssembly RailAssembly
+AGDDtoGeoSvc.Mu...   INFO 		----- JFSH_Shield JFSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- JDSH_Shield JDSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- JTSH_Shield JTSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- pp2 pp2
+AGDDtoGeoSvc.Mu...   INFO 		----- MBAP_AccessPlatform MBAP_AccessPlatform
+AGDDtoGeoSvc.Mu...   INFO 		----- MBWH_BigWheels MBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- SADL_CalorimeterSaddle SADL_CalorimeterSaddle
+AGDDtoGeoSvc.Mu...   INFO 		----- TBWH_BigWheels TBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- TGC3_BigWheels TGC3_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- TGC1_BigWheels TGC1_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- MDTRail MDTRail
+AGDDtoGeoSvc.Mu...   INFO 		----- servicesAtZ0 servicesAtZ0
+AGDDtoGeoSvc.Mu...   INFO 		----- HFTruckRail HFTruckRail
+AGDDtoGeoSvc.Mu...   INFO 		----- RUN2_Services RUN2_Services
+AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
+ClassIDSvc           INFO  getRegistryEntries: read 1315 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 251 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 310 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 242 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1064 CLIDRegistry entries for module ALL
+CondInputLoader      INFO Initializing CondInputLoader...
+CondInputLoader      INFO Adding base classes:
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' )   ->
+CondInputLoader      INFO Will create WriteCondHandle dependencies for the following DataObjects:
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' ) 
+MuonAlignmentCo...   INFO Initilalizing
+MuonAlignmentCo...   INFO In initialize ---- # of folders registered is 7
+MuonAlignmentCo...   INFO geometry version from the MuonDetectorManager = R.08.01
+MuonDetectorCon...   INFO Initializing ...
+AtlasFieldMapCo...   INFO Initialize: Key  ( 'AtlasFieldMapCondObj' , 'ConditionStore+fieldMapCondObj' )  has been succesfully registered 
+AtlasFieldMapCo...   INFO Initialize: Will update the field map from conditions
+AtlasFieldCache...   INFO Initialize: Key  ( 'AtlasFieldCacheCondObj' , 'ConditionStore+fieldCondObj' )  has been succesfully registered 
+AtlasFieldCache...   INFO Initialize: Will update current from conditions
+AtlasFieldCache...   INFO Initialize: useDCS, useSoleCurrent, useToroCurrent. 1,  'UseSoleCurrent':7730.0000,  'UseToroCurrent':20400.000 LockMapCurrents 0
+RegSelCondAlg_RPC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_RPC'
+RegSelCondAlg_TGC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_TGC'
+RegSelCondAlg_MDT    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_MDT'
+RegSelCondAlg_CSC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_CSC'
+ClassIDSvc           INFO  getRegistryEntries: read 8930 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 683 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1588 CLIDRegistry entries for module ALL
 RpcRawDataProvider   INFO RpcRawDataProvider::initialize
 RpcRawDataProvider   INFO  'DoSeededDecoding':False
+ClassIDSvc           INFO  getRegistryEntries: read 990 CLIDRegistry entries for module ALL
+ROBDataProviderSvc   INFO Initializing ROBDataProviderSvc - package version ByteStreamCnvSvcBase-00-00-00
+ROBDataProviderSvc   INFO  ---> Filter out empty ROB fragments                               =  'filterEmptyROB':False
+ROBDataProviderSvc   INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
+ROBDataProviderSvc   INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 RpcRawDataProvi...   INFO initialize() successful in RpcRawDataProvider.RPC_RawDataProviderToolMT
 TgcRawDataProvider   INFO TgcRawDataProvider::initialize
 TgcRawDataProvider   INFO  'DoSeededDecoding':False
+ClassIDSvc           INFO  getRegistryEntries: read 1240 CLIDRegistry entries for module ALL
 TgcRawDataProvi...   INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT.TgcROD_Decoder
+MuonTGC_CablingSvc   INFO for 1/12 sector initialize
+MuonTGC_Cabling...   INFO initialize
+ToolSvc.TGCCabl...   INFO initialize
+ToolSvc.TGCCabl...   INFO readTGCMap from text
+ToolSvc.TGCCabl...   INFO readTGCMap found file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-16T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/ASD2PP_diff_12_ONL.db
+ToolSvc.TGCCabl...   INFO giveASD2PP_DIFF_12 (m_ASD2PP_DIFF_12 is not NULL)
 TgcRawDataProvi...   INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT
 MdtRawDataProvider   INFO MdtRawDataProvider::initialize
 MdtRawDataProvider   INFO  'DoSeededDecoding':False
-MdtRawDataProvi...   INFO Retrieved service ServiceHandle('ROBDataProviderSvc')
+ClassIDSvc           INFO  getRegistryEntries: read 1427 CLIDRegistry entries for module ALL
+MdtRawDataProvi...   INFO Retrieved service ROBDataProviderSvc = ServiceHandle('ROBDataProviderSvc')
 MdtRawDataProvi...   INFO Processing configuration for layouts with BME chambers.
 MdtRawDataProvi...   INFO Processing configuration for layouts with BMG chambers.
 MdtRawDataProvi...   INFO Retrieved tool Decoder = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder')
 MdtRawDataProvi...   INFO initialize() successful in MdtRawDataProvider.MDT_RawDataProviderToolMT
+ClassIDSvc           INFO  getRegistryEntries: read 1008 CLIDRegistry entries for module ALL
 CscRawDataProvi...   INFO Retrieved service ServiceHandle('ROBDataProviderSvc')
 CscRawDataProvi...   INFO Retrieved tool Decoder = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder')
 CscRawDataProvi...   INFO The Muon Geometry version is R.08.01
 CscRawDataProvi...   INFO initialize() successful in CscRawDataProvider.CSC_RawDataProviderToolMT
+ClassIDSvc           INFO  getRegistryEntries: read 54 CLIDRegistry entries for module ALL
+RpcRdoToRpcPrep...   INFO package version = MuonRPC_CnvTools-00-00-00
 RpcRdoToRpcPrep...   INFO properties are 
 RpcRdoToRpcPrep...   INFO produceRpcCoinDatafromTriggerWords 1
 RpcRdoToRpcPrep...   INFO reduceCablingOverlap               1
@@ -24,15 +591,496 @@ RpcRdoToRpcPrep...   INFO timeShift                          -12.5
 RpcRdoToRpcPrep...   INFO etaphi_coincidenceTime             20
 RpcRdoToRpcPrep...   INFO overlap_timeTolerance              10
 RpcRdoToRpcPrep...   INFO Correct prd time from cool db      0
+MuonRPC_CablingSvc   INFO Initializing MuonRPC_CablingSvc - package version MuonRPC_Cabling-00-00-00
+ToolSvc.RPCCabl...   INFO Initializing - folders names are: conf /RPC/CABLING/MAP_SCHEMA / corr /RPC/CABLING/MAP_SCHEMA_CORR
+MuonRPC_CablingSvc   INFO RPCCablingDbTool retrieved with handle TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool')
+MuonRPC_CablingSvc   INFO Register call-back  against 2 folders listed below 
+MuonRPC_CablingSvc   INFO  Folder n. 1 </RPC/CABLING/MAP_SCHEMA>     found in the DetStore
+ClassIDSvc           INFO  getRegistryEntries: read 242 CLIDRegistry entries for module ALL
+MuonRPC_CablingSvc   INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA>
+MuonRPC_CablingSvc   INFO  Folder n. 2 </RPC/CABLING/MAP_SCHEMA_CORR>     found in the DetStore
+MuonRPC_CablingSvc   INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA_CORR>
+MuonRPC_CablingSvc   INFO RPCTriggerDbTool retrieved with statusCode = SUCCESS pointer = TheRpcTriggerDbTool = PublicToolHandle('RPCTriggerDbTool')
+MuonRPC_CablingSvc   INFO Register call-back  against 2 folders listed below 
+MuonRPC_CablingSvc   INFO  Folder n. 1 </RPC/TRIGGER/CM_THR_ETA>     found in the DetStore
+MuonRPC_CablingSvc   INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_ETA>
+MuonRPC_CablingSvc   INFO  Folder n. 2 </RPC/TRIGGER/CM_THR_PHI>     found in the DetStore
+MuonRPC_CablingSvc   INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_PHI>
 RpcRdoToRpcPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::RpcRdoToPrepDataToolMT/RpcRdoToRpcPrepDataTool')
+ClassIDSvc           INFO  getRegistryEntries: read 169 CLIDRegistry entries for module ALL
 TgcRdoToTgcPrep...   INFO initialize() successful in TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool
 TgcRdoToTgcPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::TgcRdoToPrepDataToolMT/TgcRdoToTgcPrepDataTool')
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BMG chambers.
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BME chambers.
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BMG chambers.
 MdtRdoToMdtPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::MdtRdoToPrepDataToolMT/MdtRdoToMdtPrepDataTool')
+ClassIDSvc           INFO  getRegistryEntries: read 116 CLIDRegistry entries for module ALL
 CscRdoToCscPrep...   INFO Retrieved CscRdoToCscPrepDataTool = PrivateToolHandle('Muon::CscRdoToCscPrepDataToolMT/CscRdoToCscPrepDataTool')
+ByteStreamInputSvc   INFO Initializing ByteStreamInputSvc - package version ByteStreamCnvSvc-00-00-00
+ClassIDSvc           INFO  getRegistryEntries: read 452 CLIDRegistry entries for module ALL
+EventSelector        INFO reinitialization...
+AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr    SUCCESS ****************************** Algorithm Sequence ****************************
+ApplicationMgr    SUCCESS AthSequencer/AthMasterSeq
+ApplicationMgr    SUCCESS      AthSequencer/AthAlgEvtSeq
+ApplicationMgr    SUCCESS           AthSequencer/AthBeginSeq
+ApplicationMgr    SUCCESS                AthIncFirerAlg/BeginIncFiringAlg
+ApplicationMgr    SUCCESS                IncidentProcAlg/IncidentProcAlg1
+ApplicationMgr    SUCCESS           AthSequencer/AthAllAlgSeq
+ApplicationMgr    SUCCESS                AthSequencer/AthCondSeq
+ApplicationMgr    SUCCESS                     CondInputLoader/CondInputLoader
+ApplicationMgr    SUCCESS                     MuonAlignmentCondAlg/MuonAlignmentCondAlg
+ApplicationMgr    SUCCESS                     MuonDetectorCondAlg/MuonDetectorCondAlg
+ApplicationMgr    SUCCESS                     RpcCablingCondAlg/RpcCablingCondAlg
+ApplicationMgr    SUCCESS                     MuonMDT_CablingAlg/MuonMDT_CablingAlg
+ApplicationMgr    SUCCESS                     MagField::AtlasFieldMapCondAlg/AtlasFieldMapCondAlg
+ApplicationMgr    SUCCESS                     MagField::AtlasFieldCacheCondAlg/AtlasFieldCacheCondAlg
+ApplicationMgr    SUCCESS                     RpcCondDbAlg/RpcCondDbAlg
+ApplicationMgr    SUCCESS                     RPC_RegSelCondAlg/RegSelCondAlg_RPC
+ApplicationMgr    SUCCESS                     TGC_RegSelCondAlg/RegSelCondAlg_TGC
+ApplicationMgr    SUCCESS                     MdtCalibDbAlg/MdtCalibDbAlg
+ApplicationMgr    SUCCESS                     MDT_RegSelCondAlg/RegSelCondAlg_MDT
+ApplicationMgr    SUCCESS                     CscCondDbAlg/CscCondDbAlg
+ApplicationMgr    SUCCESS                     CSC_RegSelCondAlg/RegSelCondAlg_CSC
+ApplicationMgr    SUCCESS                AthSequencer/AthAlgSeq
+ApplicationMgr    SUCCESS                     MuonCacheCreator/MuonCacheCreator
+ApplicationMgr    SUCCESS                     Muon::RpcRawDataProvider/RpcRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::TgcRawDataProvider/TgcRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::MdtRawDataProvider/MdtRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::CscRawDataProvider/CscRawDataProvider
+ApplicationMgr    SUCCESS                     RpcRdoToRpcPrepData/RpcRdoToRpcPrepData
+ApplicationMgr    SUCCESS                     TgcRdoToTgcPrepData/TgcRdoToTgcPrepData
+ApplicationMgr    SUCCESS                     MdtRdoToMdtPrepData/MdtRdoToMdtPrepData
+ApplicationMgr    SUCCESS                     CscRdoToCscPrepData/CscRdoToCscPrepData
+ApplicationMgr    SUCCESS                     CscThresholdClusterBuilder/CscThresholdClusterBuilder
+ApplicationMgr    SUCCESS           AthSequencer/AthEndSeq
+ApplicationMgr    SUCCESS                AthIncFirerAlg/EndIncFiringAlg
+ApplicationMgr    SUCCESS                IncidentProcAlg/IncidentProcAlg2
+ApplicationMgr    SUCCESS      AthSequencer/AthOutSeq
+ApplicationMgr    SUCCESS ******************************************************************************
+ByteStreamInputSvc   INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/FTHOLD'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/NOISE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PED'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PSLOPE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/RMS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/STAT'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0BASE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0PHASE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/GLOBAL/BField/Maps'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MAP_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/RTBLOB'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/T0BLOB'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/CSC/ILINES'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/BARREL'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEC'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/DeadRopanels'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/OffRopanels'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI'
+ApplicationMgr       INFO Application Manager Started successfully
+EventInfoByteSt...   INFO IsSimulation : 0
+EventInfoByteSt...   INFO IsTestbeam : 0
+EventInfoByteSt...   INFO IsCalibration : 0
+AthenaEventLoopMgr   INFO   ===>>>  start of run 327265    <<<===
+EventPersistenc...   INFO Added successfully Conversion service:TagInfoMgr
+IOVDbSvc             INFO Opening COOL connection for COOLONL_RPC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchema_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchemaCorr_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA_CORR
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrEta_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_ETA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrPhi_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_PHI
+IOVDbSvc             INFO Disconnecting from COOLONL_RPC/CONDBR2
+EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
+MuonRPC_CablingSvc   INFO initMappingModel has been called
+MuonRPC_CablingSvc   INFO ToolHandle in initMappingModel - <TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool')>
+MuonRPC_CablingSvc   INFO Retrieving cabling singleton; to create an empty one or to get the existing one
+RPCcabling           INFO CablingRPC---singleton constructor ---- this must be executed just once
+RPCcabling           INFO CablingRPC---The singleton will fill the maps from the COOL streams
+RPCcabling           INFO CablingRPC---InitMaps from COOL cannot be executed NOW: empty string
+RPCcabling           INFO CablingRPC---The singleton is created here
+RPCcabling           INFO CablingRPC--- cacheCleared: s_status = 0
+MuonRPC_CablingSvc   INFO Cabling singleton cache has been cleared
+MuonRPC_CablingSvc   INFO  Trigger roads will be loaded from COOL
+ToolSvc.RPCCabl...   INFO LoadParameters /RPC/CABLING/MAP_SCHEMA I=2 
+ToolSvc.RPCCabl...   INFO loadRPCMap --- Load Map from DB
+ToolSvc.RPCCabl...   INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA>
+ToolSvc.RPCCabl...   INFO  CondAttrListCollection from DB folder have been obtained with size 1
+ToolSvc.RPCCabl...   INFO After Reading folder, Configuration string size is 222202
+ToolSvc.RPCCabl...   INFO LoadParameters /RPC/CABLING/MAP_SCHEMA_CORR I=2 
+ToolSvc.RPCCabl...   INFO loadRPCCorr --- Load Corrections from DB
+ToolSvc.RPCCabl...   INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA_CORR>
+ToolSvc.RPCCabl...   INFO  CondAttrListCollection from DB folder have been obtained with size 1
+ToolSvc.RPCCabl...   INFO After Reading folder, Correction string size is 29369
+MuonRPC_CablingSvc   INFO  InitMappingModel: Trigger roads not yet loaded from COOL - postpone cabling initialization 
+MuonRPC_CablingSvc   INFO initTrigRoadsModel has been called
+MuonRPC_CablingSvc   INFO  Trigger roads will be loaded from COOL
+MuonRPC_CablingSvc   INFO Retrieve the pointer to the cabling singleton 
+RPCcabling           INFO CablingRPC--- cacheCleared: s_status = 0
+MuonRPC_CablingSvc   INFO Cabling singleton cache has been cleared
+ToolSvc.RPCTrig...   INFO LoadParameters /RPC/TRIGGER/CM_THR_ETA I=2 
+ToolSvc.RPCTrig...   INFO LoadParameters /RPC/TRIGGER/CM_THR_PHI I=2 
+MuonRPC_CablingSvc   INFO ======== RPC Trigger Roads from COOL - Header infos ========
+MuonRPC_CablingSvc   INFO 
+RPC LVL1 Configuration 10.6 with roads from Feb 2012
+L1 THRESHOLDS:   MU4 MU6 MU10 MU11 MU15 MU20
+Road version: "road_files_120209"
+CMA            th0    th1   th2
+eta low-pt     mu4    mu6   mu10
+phi low-pt     mu4    mu6   mu10
+eta high-pt    mu11  mu15   mu20
+phi high-pt    mu11  mu15   mu15
+
+
+RPCcabling           INFO CablingRPC---InitMaps from COOL: going to read configuration
+RPCcabling           INFO CablingRPC--->> RPC cabling map from COOL <<
+RPCcabling           INFO CablingRPC--- ReadConf: map has size 222202
+RPCcabling           INFO CablingRPC--- ReadConf: map n. of lines read is 924
+RPCcabling           INFO CablingRPC--- ReadConf: version is 5.0 Atlas R_07_03_RUN2ver104
+RPCcabling           INFO CablingRPC--- buildRDOmap
+RPCcabling           INFO CablingRPC---InitMaps from COOL: going to read corrections to configuration
+RPCcabling           INFO CablingRPC--->> RPC cabling corrections from COOL <<
+RPCcabling           INFO CablingRPC--- ReadCorr: CorrMap has size 29369
+RPCcabling           INFO CablingRPC--- ReadConf: CorrMap n. of lines read is 743
+RPCcabling           INFO CablingRPC---InitMaps from COOL - maps have been parsed
+MuonRPC_CablingSvc   INFO InitTrigRoadsModel: RPC cabling model is loaded!
+Level-1 configuration database version 5.0 Atlas R_07_03_RUN2ver104 read.
+Contains 26 Trigger Sector Types:
+negative sectors  0 - 15 ==> 18  2 24  3 19  2 24  4 20  2 24  1 18  5 25  6 
+negative sectors 16 - 31 ==> 21 13 26  6 21  7 16  8 14  7 16  6 21 13 26  1 
+positive sectors 32 - 47 ==>  9 24  2 22  9 24  2 23 10 24  2 18  1 25  5 18 
+positive sectors 48 - 63 ==>  1 26 13 21  6 17 12 15 11 17 12 21  6 26 13 22 
+
+MuonRPC_CablingSvc   INFO buildOfflineOnlineMap
+MuonRPC_CablingSvc   INFO Applying FeetPadThresholds : 0,2,5
+MuonRPC_CablingSvc   INFO MuonRPC_CablingSvc initialized succesfully
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186525031, run #327265 0 events processed so far  <<<===
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_CSC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscFthold-RUN2-BLK-UPD1-007-00 for folder /CSC/FTHOLD
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscNoise-RUN2-BLK-UPD1-007-00 for folder /CSC/NOISE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPed-RUN2-BLK-UPD1-007-00 for folder /CSC/PED
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPslope-RUN2-BLK-UPD1-000-00 for folder /CSC/PSLOPE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscRms-RUN2-BLK-UPD1-003-00 for folder /CSC/RMS
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscStat-RUN2-BLK-UPD1-008-00 for folder /CSC/STAT
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0base-RUN2-BLK-UPD1-001-00 for folder /CSC/T0BASE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0phase-RUN2-BLK-UPD2-001-00 for folder /CSC/T0PHASE
+IOVDbSvc             INFO Disconnecting from COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to BFieldMap-Run1-14m-v01 for folder /GLOBAL/BField/Maps
+IOVDbSvc             INFO Disconnecting from COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_MDT/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMapSchema_BMG_01 for folder /MDT/CABLING/MAP_SCHEMA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMezzanineSchema_M5-RUN2 for folder /MDT/CABLING/MEZZANINE_SCHEMA
+IOVDbSvc             INFO Disconnecting from COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MDT/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTRT-RUN2-UPD4-21 for folder /MDT/RTBLOB
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTT0-RUN2-UPD4-21 for folder /MDT/T0BLOB
+IOVDbSvc             INFO Disconnecting from COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignCscIlines-UPD1-02 for folder /MUONALIGN/CSC/ILINES
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMdtAsbuiltparams-RUN2-BA_ONLY-UPD4-00 for folder /MUONALIGN/MDT/ASBUILTPARAMS
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTBarrelAlign-RUN2-BA_ROLLING_11-BLKP-UPD4-00 for folder /MUONALIGN/MDT/BARREL
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapAAlign-RUN2-ECA_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapCAlign-RUN2-ECC_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEC
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapAAlign-RUN2-TGCA_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapCAlign-RUN2-TGCC_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEC
+IOVDbSvc             INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_RPC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCDQMFElementStatus_Run1_UPD4-RUN2-01 for folder /RPC/DQMF/ELEMENT_STATUS
+IOVDbSvc             INFO Disconnecting from COOLOFL_RPC/CONDBR2
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/CSC/ILINES>
+MuonAlignmentCo...   INFO Size of CSC/ILINES CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' )  readCscILinesCdo->size()= 1
+MuonAlignmentCo...   INFO Range of CSC/ILINES input is {[0,0,t:1425168000] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO recorded new CscInternalAlignmentMapContainer with range {[0,0,t:1425168000] - [t:4294967294.854775807]} into Conditions Store
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ASBUILTPARAMS>
+MuonAlignmentCo...   INFO Size of MDT/ASBUILTPARAMS CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' )  ->size()= 1
+MuonAlignmentCo...   INFO Range of MDT/ASBUILTPARAMS input is {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO recorded new MdtAsBuiltMapContainer with range {[0,0,t:0] - [t:4294967294.854775807]} into Conditions Store
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/BARREL>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/BARREL CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/BARREL input is, ALines: {[0,0,t:1497851700] - [t:1498737300]} BLines: {[0,0,t:1497851700] - [t:1498737300]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/BARREL have IoV = 195569
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/BARREL> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEA CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEA input is, ALines: {[0,0,t:1497891240] - [t:1497898380]} BLines: {[0,0,t:1497891240] - [t:1497898380]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEA have IoV = 195588
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEC CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEC input is, ALines: {[0,0,t:1497892260] - [t:1497899460]} BLines: {[0,0,t:1497892260] - [t:1497899460]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEC have IoV = 195599
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEA>
+MuonAlignmentCo...   INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEA
+MuonAlignmentCo...   INFO Size of /MUONALIGN/TGC/SIDEA CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/TGC/SIDEA input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/TGC/SIDEA have IoV = 82360
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEA> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEC>
+MuonAlignmentCo...   INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEC
+MuonAlignmentCo...   INFO Size of /MUONALIGN/TGC/SIDEC CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/TGC/SIDEC input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/TGC/SIDEC have IoV = 82359
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEC> loaded
+MuonAlignmentCo...   INFO recorded new ALineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+MuonAlignmentCo...   INFO recorded new BLineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+MuonGeoModel         INFO MuonDetectorFactory - constructor  MuonSystem OuterRadius 13000 Length 22030
+MuonDetectorCon...   INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00
+MuonDetectorCon...   INFO (from GeoModelSvc)    AtlasVersion = <ATLAS-R2-2016-01-00-01>  MuonVersion = <>
+MuonDetectorCon...   INFO Keys for Muon Switches are  (key) ATLAS-R2-2016-01-00-01 (node) ATLAS
+MuonDetectorCon...   INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01>  default MuonVersion is <MuonSpectrometer-R.08.01>
+MuonDetectorCon...   INFO Properties have been set as follows: 
+MuonDetectorCon...   INFO     LayoutName                     R
+MuonDetectorCon...   INFO     IncludeCutouts                 0
+MuonDetectorCon...   INFO     IncludeCutoutsBog              0
+MuonDetectorCon...   INFO     IncludeCtbBis                  0
+MuonDetectorCon...   INFO     ControlAlines                  111111
+MuonDetectorCon...   INFO     MinimalGeoFlag                 0
+MuonDetectorCon...   INFO     EnableCscIntAlignment          1
+MuonDetectorCon...   INFO     EnableCscIntAlignmentFromGM    0
+MuonDetectorCon...   INFO     ControlCscIntAlines            111111
+MuonDetectorCon...   INFO     EnableMdtDeformations          1
+MuonDetectorCon...   INFO     EnableMdtAsBuiltParameters     1
+MuGM:MuonFactory     INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures 
+MuGM:MuonFactory     INFO                    BOG cutouts are activated 1 , all other cutouts are disabled 1
+MuGM:MuonFactory     INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuonGeoModel.MYSQL   INFO GeometryVersion set to <R.08.01>
+MuGM:MuonFactory     INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuGM:MuonFactory     INFO MDTIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO RPCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO TGCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO CSCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ************************
+MuGM:MuonFactory     INFO  *** Start building the Muon Geometry Tree **********************
+MuGM:RDBReadAtlas    INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS>
+RDBAccessSvc      WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO After getQuery XtomoData
+In DblQ00Xtomo(data)
+No XtomoData table in the MuonDD Database
+MuGM:RDBReadAtlas    INFO After new DblQ00Xtomo
+MuGM:RDBReadAtlas    INFO No Ascii aszt input found: looking for A-lines in ORACLE
+MuGM:RDBReadAtlas    INFO ASZT table found in Oracle
+MuGM:RDBReadAtlas    INFO ASZT size is 32
+MuGM:RDBReadAtlas    INFO No Ascii iacsc input found: looking for A-lines in ORACLE
+RDBAccessSvc      WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO No ISZT table in Oracle
+MuGM:RDBReadAtlas    INFO Access granted for all dbObjects needed by muon detectors
+MuonGeoModel.MYSQL   INFO LayoutName (from DBAM) set to <R.08>  -- relevant for CTB2004
+MuGM:ProcStations    INFO  Processing Stations and Components
+MuGM:ProcStations    INFO  Processing Stations and Components DONE
+MuGM:ProcTechnol.s   INFO nMDT 26 nCSC 4 nTGC 44 nRPC 50
+MuGM:ProcTechnol.s   INFO nDED 4 nSUP 8 nSPA 4
+MuGM:ProcTechnol.s   INFO nCHV 14 nCRO 14 nCMI 12 nLBI 12
+MuGM:ProcPosition    INFO  *** N. of stations positioned in the setup 234
+MuGM:ProcPosition    INFO  *** N. of stations described in mysql      234
+MuGM:ProcPosition    INFO  *** N. of types  32 size of jtypvec 32
+MuGM:ProcPosition    INFO  *** : 234 kinds of stations (type*sub_type) 
+MuGM:ProcPosition    INFO  *** : 1758 physical stations in space - according to the MuonDD DataBase
+MuGM:ProcCutouts     INFO  Processing Cutouts for geometry layout R.08
+MuGM:ProcCutouts     INFO  Processing Cutouts DONE
+MuGM:RDBReadAtlas    INFO  ProcessTGCreadout - version 7 wirespacing 1.8
+MuGM:RDBReadAtlas    INFO Intermediate Objects built from primary numbers
+MuGM:MuonFactory     INFO  theMaterialManager retrieven successfully from the DetStore
+MuGM:MuonFactory     INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS>
+MuGM:MuonFactory     INFO  TreeTop added to the Manager
+MuGM:MuonFactory     INFO  Muon Layout R.08.01
+MuGM:MuonFactory     INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction)
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ****************************
+MuGM:MuonFactory     INFO  *** The Muon Chamber Geometry Tree is built with 
+MuGM:MuonFactory     INFO  *** 1758 child volumes 
+MuGM:MuonFactory     INFO  *** 1839 independent elements and 
+MuGM:MuonFactory     INFO  *** 11473 elements cloned or shared 
+MuGM:MuonFactory     INFO  *** 234 kinds of stations
+MuGM:MuonFactory     INFO  *** 1758 stations with alignable transforms
+MuGM:MuonFactory     INFO  *** 148 stations are described as Assemblies
+MuGM:MuonFactory     INFO  *** 1758 MuonStations 
+MuGM:MuonFactory     INFO  *** 	 2324 MDT Readout Elements 	 1186 MDT Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 32 CSC Readout Elements 	 32 CSC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1122 RPC Readout Elements 	 600 RPC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1578 TGC Readout Elements 	 1578 TGC Detector Elements 
+MuGM:MuonFactory     INFO  ********************************************************************
+MuGM:MuonFactory     INFO  *** Inert Material built according to DB switches and config. ****** 
+MuGM:MuonFactory     INFO  *** The Muon Geometry Tree has 1758 child vol.s in total ********
+MuGM:MuonFactory     INFO  ********************************************************************
+
+MGM::MuonDetect...   INFO Init A/B Line Containers - done - size is respectively 1758/0
+MGM::MuonDetect...   INFO Init of CSC I-Lines will be done via Conditions DB
+MGM::MuonDetect...   INFO Init I-Line Container - done - size is respectively 128
+MGM::MuonDetect...   INFO I-Line for CSC wire layers loaded (Csc Internal Alignment)
+MGM::MuonDetect...   INFO According to configuration they WILL be used 
+MGM::MuonDetect...   INFO Filling cache
+MGM::MuonDetect...   INFO temporary CSC I-line container with size = 128
+MGM::MuonDetect...   INFO # of CSC I-lines read from the ILineMapContainer in StoreGate is 128
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to A-lines             is 128
+MGM::MuonDetect...   INFO # of entries in the CSC I-lines historical container          is 128
+MGM::MuonDetect...   INFO temporary As-Built container with size = 628
+MGM::MuonDetect...   INFO # of MDT As-Built read from the MdtAsBuiltMapContainer in StoreGate is 628
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to As-Built                  is 628
+MGM::MuonDetect...   INFO # of entries in the MdtAsBuilt historical container                 is 628
+MGM::MuonDetect...   INFO temporary A-line container with size = 2694
+MGM::MuonDetect...   INFO # of A-lines read from the ALineMapContainer in StoreGate is 2694
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to A-lines         is 2694
+MGM::MuonDetect...   INFO # of entries in the A-lines historical container          is 2814
+MGM::MuonDetect...   INFO In updateDeformations()
+MGM::MuonDetect...   INFO temporary B-line container with size = 1206
+MGM::MuonDetect...   INFO # of B-lines read from the ALineMapContainer in StoreGate   is 1206
+MGM::MuonDetect...   INFO # of deform-Transforms updated according to B-lines         is 1174
+MGM::MuonDetect...   INFO # of entries in the B-lines historical container            is 1174
+MuonDetectorCon...   INFO recorded new MuonDetectorManager with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+RpcCablingCondAlg    INFO maps configuration have been parsed
+RpcCablingCondAlg    INFO recorded new RpcCablingCondData with range {[315000,l:0] - [999999,l:0]}
+MuonMDT_CablingAlg   INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' )  readCdoMez->size()= 24
+MuonMDT_CablingAlg   INFO Range of input is {[0,l:0] - [INVALID]}
+MuonMDT_CablingAlg   INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' )  readCdoMap->size()= 2312
+MuonMDT_CablingAlg   INFO Range of input is {[327264,l:4294640031] - [327265,l:4294640030]}
+MuonMDT_CablingAlg   INFO recorded new MuonMDT_CablingMap with range {[327264,t:0,l:4294640031] - [327265,l:4294640030]} into Conditions Store
+AtlasFieldMapCo...   INFO updateFieldMap: Update map from conditions
+AtlasFieldMapCo...   INFO updateFieldMap: Update map from conditions: Range of input/output is {[0,l:0] - [INVALID]}
+AtlasFieldMapCo...   INFO updateFieldMap: reading magnetic field map filenames from COOL
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type GlobalMap with soleCur=7730 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_7730_20400_14m.root)
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type SolenoidMap with soleCur=7730 toroCur=0 (path file:MagneticFieldMaps/bfieldmap_7730_0_14m.root)
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type ToroidMap with soleCur=0 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_0_20400_14m.root)
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Range of input currents is {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Attempt 1 at reading currents from DCS (using channel name)
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Currents read from DCS - solenoid 7729.99 toroid 20399.9
+AtlasFieldMapCo...   INFO updateFieldMap: currents are OK, will use nominal maps
+AtlasFieldMapCo...   INFO updateFieldMap: tagInfoH  ( 'TagInfo' , 'DetectorStore+ProcessingTags' )  is valid. 
+AtlasFieldMapCo...   INFO updateFieldMap: DID NOT reset currents from TagInfo
+AtlasFieldMapCo...   INFO updateFieldMap: Set map currents from FieldSvc: solenoid/toroid 7730,20400
+AtlasFieldMapCo...   INFO updateFieldMap: Use map file MagneticFieldMaps/bfieldmap_7730_20400_14m.root
+AtlasFieldMapCo...   INFO updateFieldMap: Initialized the field map from /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/MagneticFieldMaps/bfieldmap_7730_20400_14m.root
+AtlasFieldMapCo...   INFO execute: solenoid zone id  7000
+AtlasFieldMapCo...   INFO execute: recorded AtlasFieldMapCondObj with EventRange {[0,l:0] - [INVALID]}
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Range of input/output is {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Attempt 1 at reading currents from DCS (using channel name)
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Currents read from DCS - solenoid 7729.99 toroid 20399.9
+AtlasFieldCache...   INFO scaleField: Solenoid field scale factor 1. Desired current and map current: 7729.99,7730
+AtlasFieldCache...   INFO scaleField: Toroid field scale factor 1. Desired current and map current: 20399.9,20400
+AtlasFieldCache...   INFO execute: initialized AtlasFieldCacheCondObj and cache with SFs - sol/tor 1/1, EventRange {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldCache...   INFO execute: solenoid zone id  7000
+RegSelCondAlg_RPC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_RPC'
+RegSelCondAlg_TGC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_TGC'
+MdtCalibDbAlg        INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' )  readCdoRt->size()= 1186
+MdtCalibDbAlg        INFO Range of input is {[327265,l:0] - [327342,l:0]}
+MdtCalibDbAlg        INFO MdtCalibDbAlg::loadRt Read 1188RTs from COOL
+MdtCalibDbAlg        INFO recorded new MdtRtRelationCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store
+MdtCalibDbAlg        INFO recorded new MdtCorFuncSetCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store
+MdtCalibDbAlg        INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML -6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1
+MdtCalibDbAlg        INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML stationEta 6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1
+MdtCalibDbAlg        INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' )  readCdoTube->size()= 1186
+MdtCalibDbAlg        INFO Range of input is {[319000,l:0] - [INVALID]}
+MdtCalibDbAlg        INFO recorded new MdtTubeCalibContainerCollection with range {[319000,l:0] - [INVALID]} into Conditions Store
+RegSelCondAlg_MDT    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_MDT'
+RegSelCondAlg_CSC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_CSC'
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186525031, run #327265 1 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186524665, run #327265 1 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186524665, run #327265 2 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186542447, run #327265 2 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186542447, run #327265 3 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186543405, run #327265 3 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186543405, run #327265 4 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186548387, run #327265 4 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186548387, run #327265 5 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186515186, run #327265 5 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186515186, run #327265 6 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186556019, run #327265 6 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186556019, run #327265 7 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186542866, run #327265 7 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186542866, run #327265 8 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186537901, run #327265 8 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186537901, run #327265 9 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186517811, run #327265 9 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186517811, run #327265 10 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186534221, run #327265 10 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186534221, run #327265 11 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186540986, run #327265 11 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186540986, run #327265 12 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186535104, run #327265 12 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186535104, run #327265 13 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186539903, run #327265 13 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186539903, run #327265 14 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186552713, run #327265 14 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186552713, run #327265 15 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186524730, run #327265 15 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186524730, run #327265 16 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186547632, run #327265 16 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186547632, run #327265 17 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186555621, run #327265 17 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186555621, run #327265 18 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186568452, run #327265 18 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186568452, run #327265 19 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186580451, run #327265 19 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186580451, run #327265 20 events processed so far  <<<===
+Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
+ApplicationMgr       INFO Application Manager Stopped successfully
+IncidentProcAlg1     INFO Finalize
+CondInputLoader      INFO Finalizing CondInputLoader...
+IncidentProcAlg2     INFO Finalize
+IOVDbFolder          INFO Folder /CSC/FTHOLD (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/322656 ((     0.03 ))s
+IOVDbFolder          INFO Folder /CSC/NOISE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/350062 ((     0.02 ))s
+IOVDbFolder          INFO Folder /CSC/PED (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411187 ((     0.03 ))s
+IOVDbFolder          INFO Folder /CSC/PSLOPE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/353376 ((     0.02 ))s
+IOVDbFolder          INFO Folder /CSC/RMS (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411395 ((     0.03 ))s
+IOVDbFolder          INFO Folder /CSC/STAT (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/230496 ((     0.02 ))s
+IOVDbFolder          INFO Folder /CSC/T0BASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/314380 ((     0.02 ))s
+IOVDbFolder          INFO Folder /CSC/T0PHASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/3136 ((     0.02 ))s
+IOVDbFolder          INFO Folder /EXT/DCS/MAGNETS/SENSORDATA (AttrListColl) db-read 1/1 objs/chan/bytes 4/4/20 ((     0.02 ))s
+IOVDbFolder          INFO Folder /GLOBAL/BField/Maps (AttrListColl) db-read 1/1 objs/chan/bytes 3/3/202 ((     0.05 ))s
+IOVDbFolder          INFO Folder /MDT/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 2312/2437/216520 ((     0.13 ))s
+IOVDbFolder          INFO Folder /MDT/CABLING/MEZZANINE_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 24/24/288 ((     0.01 ))s
+IOVDbFolder          INFO Folder /MDT/RTBLOB (AttrListColl) db-read 1/1 objs/chan/bytes 2372/1186/2251209 ((     0.12 ))s
+IOVDbFolder          INFO Folder /MDT/T0BLOB (AttrListColl) db-read 1/1 objs/chan/bytes 1186/1186/1374284 ((     0.06 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/CSC/ILINES (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/10814 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ASBUILTPARAMS (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/128992 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/BARREL (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/140293 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65494 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65497 ((     0.04 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/TGC/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 ((     0.03 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/TGC/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 ((     0.03 ))s
+IOVDbFolder          INFO Folder /RPC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/222235 ((     0.03 ))s
+IOVDbFolder          INFO Folder /RPC/CABLING/MAP_SCHEMA_CORR (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/29402 ((     0.02 ))s
+IOVDbFolder          INFO Folder /RPC/DCS/DeadRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 32/48/6200 ((     0.01 ))s
+IOVDbFolder          INFO Folder /RPC/DCS/OffRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 4/48/16 ((     0.01 ))s
+IOVDbFolder          INFO Folder /RPC/DQMF/ELEMENT_STATUS (AttrListColl) db-read 1/1 objs/chan/bytes 8320/8320/6180700 ((     0.15 ))s
+IOVDbFolder          INFO Folder /RPC/TRIGGER/CM_THR_ETA (AttrListColl) db-read 1/2 objs/chan/bytes 1613/1613/7562651 ((     0.09 ))s
+IOVDbFolder          INFO Folder /RPC/TRIGGER/CM_THR_PHI (AttrListColl) db-read 1/2 objs/chan/bytes 1612/1612/8096306 ((     0.06 ))s
+IOVDbFolder          INFO Folder /TGC/CABLING/MAP_SCHEMA (AttrListColl) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
+IOVDbSvc             INFO  bytes in ((      1.13 ))s
+IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=CONDBR2 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
+IOVDbSvc             INFO Connection COOLOFL_MUONALIGN/CONDBR2 : nConnect: 2 nFolders: 7 ReadTime: ((     0.17 ))s
+IOVDbSvc             INFO Connection COOLONL_RPC/CONDBR2 : nConnect: 2 nFolders: 4 ReadTime: ((     0.21 ))s
+IOVDbSvc             INFO Connection COOLONL_TGC/CONDBR2 : nConnect: 1 nFolders: 1 ReadTime: ((     0.00 ))s
+IOVDbSvc             INFO Connection COOLONL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: ((     0.15 ))s
+IOVDbSvc             INFO Connection COOLONL_GLOBAL/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: ((     0.05 ))s
+IOVDbSvc             INFO Connection COOLOFL_DCS/CONDBR2 : nConnect: 2 nFolders: 3 ReadTime: ((     0.04 ))s
+IOVDbSvc             INFO Connection COOLOFL_RPC/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: ((     0.15 ))s
+IOVDbSvc             INFO Connection COOLOFL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: ((     0.18 ))s
+IOVDbSvc             INFO Connection COOLOFL_CSC/CONDBR2 : nConnect: 2 nFolders: 8 ReadTime: ((     0.19 ))s
+ToolSvc              INFO Removing all tools created by ToolSvc
+TgcRdoToTgcPrep...   INFO finalize(): input RDOs->output PRDs [Hit: 6807->6807, Tracklet: 28->28, TrackletEIFI: 692->692, HiPt: 4031->4031, SL: 3->3]
 MdtRawDataProvi...   INFO Fraction of fills that use the cache = 0
+ToolSvc.TGCCabl...   INFO finalize
+MuonTGC_Cabling...   INFO finalize
 TgcRawDataProvi...   INFO Fraction of fills that use the cache = 0
 RpcROD_Decoder:...   INFO  ============ FINAL RPC DATA FORMAT STAT. =========== 
 RpcROD_Decoder:...   INFO  RX Header Errors.............0
@@ -49,3 +1097,14 @@ RpcROD_Decoder:...   INFO  SL Footer Errors.............0
 RpcROD_Decoder:...   INFO  RX Footer Errors.............0
 RpcROD_Decoder:...   INFO  CRC8 check Failures..........0
 RpcROD_Decoder:...   INFO  ==================================================== 
+ToolSvc.ByteStr...   INFO in finalize()
+IdDictDetDescrCnv    INFO in finalize
+*****Chrono*****     INFO ****************************************************************************************************
+*****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
+*****Chrono*****     INFO ****************************************************************************************************
+cObj_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 32
+ChronoStatSvc        INFO Time User   : Tot= 14.9  [s]  #=  1
+*****Chrono*****     INFO ****************************************************************************************************
+ChronoStatSvc.f...   INFO  Service finalized successfully 
+ApplicationMgr       INFO Application Manager Finalized successfully
+ApplicationMgr       INFO Application Manager Terminated successfully
-- 
GitLab


From 90d6e62b596106d6c69b4a5b55a47accd97c7c9c Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Thu, 17 Sep 2020 13:09:29 +0200
Subject: [PATCH 188/422] HLTCaloFEBTool + HLTMinBiasMonTool: Remove duplicate
 declareProperty lines

---
 .../TrigMonitoring/TrigCaloMonitoring/src/HLTCaloFEBTool.cxx   | 1 -
 .../TrigMinBiasMonitoring/src/HLTMinBiasMonTool.cxx            | 3 ---
 2 files changed, 4 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigCaloMonitoring/src/HLTCaloFEBTool.cxx b/Trigger/TrigMonitoring/TrigCaloMonitoring/src/HLTCaloFEBTool.cxx
index da0752ae2fd2..149e560d00ad 100644
--- a/Trigger/TrigMonitoring/TrigCaloMonitoring/src/HLTCaloFEBTool.cxx
+++ b/Trigger/TrigMonitoring/TrigCaloMonitoring/src/HLTCaloFEBTool.cxx
@@ -42,7 +42,6 @@ HLTCaloFEBTool::HLTCaloFEBTool(const std::string & type, const std::string & nam
         declareProperty ("sigma", m_nsigma);
         declareProperty ("useLoadFullCollection", m_useloadfullcoll);
         declareProperty ("DiffLimit", m_difflimit);
-        declareProperty ("TCRTools", m_tcrAlgTools);
 	// Nothing for the moment
 	return;
 }
diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasMonTool.cxx b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasMonTool.cxx
index c8422a49cb08..d01ebe5a5513 100755
--- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasMonTool.cxx
+++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasMonTool.cxx
@@ -108,9 +108,6 @@ HLTMinBiasMonTool::HLTMinBiasMonTool(const std::string & type, const std::string
 	//Lvl-2 containers
 	declareProperty("SPContainerName", m_spContainerName);
 
-	// Cut made on time over-threshold before any multiplicities are calculated.
-	declareProperty("PixelCLToTCut", m_timeOverThresholdCut = 20.);
-
 	// If set to false the trigger combination of Pixel and SCT is an OR.
 	declareProperty("TriggerTypeAND", m_triggerTypeAND = true);
 
-- 
GitLab


From 9bdf412d26801b61927a6dd6cee4e1b70a1382ef Mon Sep 17 00:00:00 2001
From: Bertrand Martin Dit Latour <bertrand.martindl@cern.ch>
Date: Thu, 17 Sep 2020 11:33:27 +0000
Subject: [PATCH 189/422] tauRecTools: minor TauPi0ClusterCreator cleanup

Hello,

This MR is just accessing some enum in a cleaner way.
It does not change the reconstruction output.

Cheers,
Bertrand
---
 .../tauRecTools/src/TauPi0ClusterCreator.cxx  | 28 +++++++++----------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
index eed20fb0e6a3..7d5a894fc305 100644
--- a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
+++ b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
@@ -107,21 +107,19 @@ StatusCode TauPi0ClusterCreator::executePi0ClusterCreator(xAOD::TauJet& pTau, xA
         double ENG_FRAC_CORE = 0.0;
         double SECOND_ENG_DENS = 0.0;
 
-        // TODO: Replace numbers by human readable enums
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 404, CENTER_MAG) ) ATH_MSG_WARNING("Couldn't retrieve CENTER_MAG moment. Set it to 0.");
-
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 102, FIRST_ETA) )       ATH_MSG_WARNING("Couldn't retrieve FIRST_ETA moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 201, SECOND_R) )        ATH_MSG_WARNING("Couldn't retrieve SECOND_R moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 202, SECOND_LAMBDA) )   ATH_MSG_WARNING("Couldn't retrieve SECOND_LAMBDA moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 301, DELTA_PHI) )       ATH_MSG_WARNING("Couldn't retrieve DELTA_PHI moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 302, DELTA_THETA) )     ATH_MSG_WARNING("Couldn't retrieve DELTA_THETA moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 501, CENTER_LAMBDA) )   ATH_MSG_WARNING("Couldn't retrieve CENTER_LAMBDA moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 601, LATERAL) )         ATH_MSG_WARNING("Couldn't retrieve LATERAL moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 602, LONGITUDINAL) )    ATH_MSG_WARNING("Couldn't retrieve LONGITUDINAL moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 701, ENG_FRAC_EM) )     ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_EM moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 702, ENG_FRAC_MAX) )    ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_MAX moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 703, ENG_FRAC_CORE) )   ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_CORE moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 805, SECOND_ENG_DENS) ) ATH_MSG_WARNING("Couldn't retrieve SECOND_ENG_DENS moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::CENTER_MAG, CENTER_MAG) ) ATH_MSG_WARNING("Couldn't retrieve CENTER_MAG moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::FIRST_ETA, FIRST_ETA) ) ATH_MSG_WARNING("Couldn't retrieve FIRST_ETA moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::SECOND_R, SECOND_R) ) ATH_MSG_WARNING("Couldn't retrieve SECOND_R moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::SECOND_LAMBDA, SECOND_LAMBDA) ) ATH_MSG_WARNING("Couldn't retrieve SECOND_LAMBDA moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::DELTA_PHI, DELTA_PHI) ) ATH_MSG_WARNING("Couldn't retrieve DELTA_PHI moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::DELTA_THETA, DELTA_THETA) ) ATH_MSG_WARNING("Couldn't retrieve DELTA_THETA moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::CENTER_LAMBDA, CENTER_LAMBDA) ) ATH_MSG_WARNING("Couldn't retrieve CENTER_LAMBDA moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::LATERAL, LATERAL) ) ATH_MSG_WARNING("Couldn't retrieve LATERAL moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::LONGITUDINAL, LONGITUDINAL) ) ATH_MSG_WARNING("Couldn't retrieve LONGITUDINAL moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::ENG_FRAC_EM, ENG_FRAC_EM) ) ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_EM moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::ENG_FRAC_MAX, ENG_FRAC_MAX) ) ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_MAX moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::ENG_FRAC_CORE, ENG_FRAC_CORE) ) ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_CORE moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::SECOND_ENG_DENS, SECOND_ENG_DENS) ) ATH_MSG_WARNING("Couldn't retrieve SECOND_ENG_DENS moment. Set it to 0.");
 
        	float E_EM1 = pPi0Cluster->eSample(CaloSampling::EMB1) + pPi0Cluster->eSample(CaloSampling::EME1);
 	      float E_EM2 = pPi0Cluster->eSample(CaloSampling::EMB2) + pPi0Cluster->eSample(CaloSampling::EME2);
-- 
GitLab


From fdeee3493a4b1d67ce2555051353e92a1b52f818 Mon Sep 17 00:00:00 2001
From: Nicolas Koehler <nicolas.koehler@cern.ch>
Date: Thu, 17 Sep 2020 11:56:09 +0000
Subject: [PATCH 190/422] Only use MuonDetectorManager as member variable if
 needed

---
 .../MuonByteStreamCnvTest/RpcDigitToRpcRDO.h  |  2 +-
 .../src/CSC_RawDataProviderToolCore.cxx       |  8 ----
 .../src/CSC_RawDataProviderToolCore.h         |  7 ----
 .../src/MdtRdoToPrepDataToolCore.cxx          | 10 ++---
 .../src/MdtRdoToPrepDataToolCore.h            |  5 +--
 .../MuonCondTest/AlignCondAthTest.h           | 15 +-------
 .../MuonCondTest/src/AlignCondAthTest.cxx     | 21 +----------
 .../CSC_Digitization/CSC_Digitizer.h          | 17 +++------
 .../CSC_Digitization/CscDigitizationTool.h    |  1 -
 .../src/CscDigitizationTool.cxx               |  5 ++-
 .../MDT_Digitization/MDT_Response_DigiTool.h  |  5 +--
 .../MDT_Digitization/MdtDigitizationTool.h    |  2 +-
 .../MDT_Digitization/RT_Relation_DigiTool.h   |  5 +--
 .../src/MDT_Response_DigiTool.cxx             | 32 +++++++---------
 .../src/MdtDigitizationTool.cxx               |  8 ++--
 .../src/RT_Relation_DigiTool.cxx              | 26 +++++--------
 .../MM_Digitization/MM_Response_DigitTool.h   |  9 -----
 .../src/MM_Response_DigitTool.cxx             |  9 -----
 .../TGC_Digitization/src/TgcDigitMaker.h      |  4 +-
 .../MuonIdHelpersAlgs/CscHashId.h             | 10 +----
 .../MuonIdHelpersAlgs/src/CscHashId.cxx       | 20 ++--------
 .../src/CscAlignmentTool.cxx                  | 33 ++++-------------
 .../CscClusterization/src/CscAlignmentTool.h  | 27 ++++----------
 .../src/CscBipolarStripFitter.cxx             | 23 ++----------
 .../src/CscBipolarStripFitter.h               | 16 ++------
 .../src/CscClusterUtilTool.cxx                | 34 ++++-------------
 .../src/CscClusterUtilTool.h                  | 22 +++--------
 .../src/SimpleCscClusterFitter.cxx            |  1 -
 .../src/SimpleCscClusterFitter.h              |  2 -
 .../MuonClusterization/MdtHitClustering.h     |  2 +-
 .../MuonLayerHoughTool.h                      |  3 +-
 .../src/MuonLayerHoughTool.cxx                | 10 ++---
 .../MuonTGRecTools/MuonTGMeasurementTool.h    |  2 +-
 .../MdtIntersectGeometry.h                    |  2 +-
 .../RPC_LinearSegmentMakerTool.h              |  9 +----
 .../src/RPC_LinearSegmentMakerTool.cxx        | 37 +++++--------------
 .../TGC_LinearSegmentMakerTool.h              |  7 ----
 .../src/TGC_LinearSegmentMakerTool.cxx        | 25 ++-----------
 38 files changed, 117 insertions(+), 359 deletions(-)

diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/MuonByteStreamCnvTest/RpcDigitToRpcRDO.h b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/MuonByteStreamCnvTest/RpcDigitToRpcRDO.h
index 6d11c6fef749..254e219210b7 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/MuonByteStreamCnvTest/RpcDigitToRpcRDO.h
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/MuonByteStreamCnvTest/RpcDigitToRpcRDO.h
@@ -53,7 +53,7 @@ private:
   //       RDOs produced in release 22. The fillTagInfo() function thus needs to stay in release 22 until the workflow changes
   StatusCode fillTagInfo() const;
 
-  const MuonGM::MuonDetectorManager* m_MuonMgr;
+  const MuonGM::MuonDetectorManager* m_MuonMgr; // no ReadCondHandleKey used here for now, since no alignment applied in digitisation
 
   IntegerProperty m_fast_debug{this, "FastDebug", 0, "bits for debugging 'fast' algos"};
   IntegerProperty m_monitoring{this, "Monitoring", 0, "bits for monitoring sequence"};
diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.cxx b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.cxx
index f8364e43444e..42a115e25837 100644
--- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.cxx
@@ -2,10 +2,6 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// CSC_RawDataProviderToolCore.cxx, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
 #include "CSC_RawDataProviderToolCore.h"
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "ByteStreamData/ROBData.h"
@@ -28,7 +24,6 @@ Muon::CSC_RawDataProviderToolCore::CSC_RawDataProviderToolCore(const std::string
                                                        const std::string& n,
                                                        const IInterface*  p) :
   AthAlgTool(t, n, p),
-  m_muonMgr(nullptr),
   m_robDataProvider("ROBDataProviderSvc",n),
   m_cabling("CSCcablingSvc", n)
 {
@@ -40,7 +35,6 @@ Muon::CSC_RawDataProviderToolCore::CSC_RawDataProviderToolCore(const std::string
 StatusCode Muon::CSC_RawDataProviderToolCore::initialize()
 {
   
-  ATH_CHECK( detStore()->retrieve( m_muonMgr ) );
   ATH_CHECK( m_cabling.retrieve() );
   ATH_CHECK( m_robDataProvider.retrieve() );
   ATH_MSG_INFO ( "Retrieved service " << m_robDataProvider );
@@ -52,8 +46,6 @@ StatusCode Muon::CSC_RawDataProviderToolCore::initialize()
   ATH_CHECK(m_decoder.retrieve());
   ATH_MSG_INFO ( "Retrieved tool " << m_decoder );
 
-  ATH_MSG_INFO ( "The Muon Geometry version is " << m_muonMgr->geometryVersion() );
-
   ATH_CHECK( m_containerKey.initialize() );
   ATH_CHECK( m_eventInfoKey.initialize() );
 
diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.h b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.h
index 5f321b068458..0a62b270e047 100644
--- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.h
+++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.h
@@ -18,11 +18,6 @@
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
 
-namespace MuonGM
-{
-    class MuonDetectorManager;
-}
-
 namespace Muon
 {
 
@@ -47,8 +42,6 @@ protected:
 
   /** member variables for algorithm properties: */
   ToolHandle<ICSC_ROD_Decoder> m_decoder{this,"Decoder","Muon::CscROD_Decoder/CscROD_Decoder"};
-
-  const MuonGM::MuonDetectorManager* m_muonMgr;
   
   ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
 
diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx
index 753250ad4d10..fd346bf9618d 100644
--- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx
@@ -29,7 +29,6 @@ namespace {
 
 Muon::MdtRdoToPrepDataToolCore::MdtRdoToPrepDataToolCore(const std::string& t, const std::string& n, const IInterface* p) :
   AthAlgTool(t,n,p),
-  m_muonMgr(nullptr),
   m_mdtCalibSvcSettings(new MdtCalibrationSvcSettings()),
   m_calibratePrepData(true),
   m_fullEventDone(false),
@@ -63,7 +62,8 @@ Muon::MdtRdoToPrepDataToolCore::MdtRdoToPrepDataToolCore(const std::string& t, c
 
 StatusCode Muon::MdtRdoToPrepDataToolCore::initialize() {
   ATH_CHECK(AthAlgTool::initialize());
-  ATH_CHECK(detStore()->retrieve(m_muonMgr));
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+  ATH_CHECK(detStore()->retrieve(muDetMgr));
   ATH_CHECK(m_calibrationTool.retrieve());
   ATH_MSG_VERBOSE("MdtCalibrationTool retrieved with pointer = "<<m_calibrationTool);
   ATH_CHECK(m_idHelperSvc.retrieve());
@@ -102,10 +102,10 @@ StatusCode Muon::MdtRdoToPrepDataToolCore::initialize() {
     for(int phi=6; phi<8; phi++) { // phi sectors
       for(int eta=1; eta<4; eta++) { // eta sectors
         for(int side=-1; side<2; side+=2) { // side
-          if( !m_muonMgr->getMuonStation("BMG", side*eta, phi) ) continue;
-          for(int roe=1; roe<=( m_muonMgr->getMuonStation("BMG", side*eta, phi) )->nMuonReadoutElements(); roe++) { // iterate on readout elemets
+          if( !muDetMgr->getMuonStation("BMG", side*eta, phi) ) continue;
+          for(int roe=1; roe<=( muDetMgr->getMuonStation("BMG", side*eta, phi) )->nMuonReadoutElements(); roe++) { // iterate on readout elemets
             const MdtReadoutElement* mdtRE =
-                  dynamic_cast<const MdtReadoutElement*> ( ( m_muonMgr->getMuonStation("BMG", side*eta, phi) )->getMuonReadoutElement(roe) ); // has to be an MDT
+                  dynamic_cast<const MdtReadoutElement*> ( ( muDetMgr->getMuonStation("BMG", side*eta, phi) )->getMuonReadoutElement(roe) ); // has to be an MDT
             if(mdtRE) initDeadChannels(mdtRE);
           }
         }
diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.h b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.h
index 4b938535173e..d31aa3d533b1 100644
--- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.h
+++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.h
@@ -88,10 +88,7 @@ namespace Muon
 
     const MdtCsmContainer* getRdoContainer();
     void processPRDHashes( const std::vector<IdentifierHash>& chamberHashInRobs, std::vector<IdentifierHash>& idWithDataVect );
-    bool handlePRDHash( IdentifierHash hash, const MdtCsmContainer& rdoContainer, std::vector<IdentifierHash>& idWithDataVect );
-  
-    /// Muon Detector Descriptor
-    const MuonGM::MuonDetectorManager* m_muonMgr;
+    bool handlePRDHash( IdentifierHash hash, const MdtCsmContainer& rdoContainer, std::vector<IdentifierHash>& idWithDataVect );    
         
     ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
         
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/MuonCondTest/AlignCondAthTest.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/MuonCondTest/AlignCondAthTest.h
index 0874ad5755ac..26f34292880e 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/MuonCondTest/AlignCondAthTest.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/MuonCondTest/AlignCondAthTest.h
@@ -1,9 +1,7 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-//
-//
 #ifndef ALIGNCONDATHTEST
 #define ALIGNCONDATHTEST
 
@@ -16,25 +14,16 @@
 
 #include <fstream>
 
-namespace MuonGM
-{
-    class MuonDetectorManager;
-    class MdtReadoutElement;
-}
-
 class AlignCondAthTest:public AthAlgorithm {
 public:
   AlignCondAthTest (const std::string& name, ISvcLocator* pSvcLocator);
 
 public:
-
    StatusCode initialize();
    StatusCode execute();
-   StatusCode finalize();
 
 private:
-
-   const MuonGM::MuonDetectorManager*  m_MuonDetMgrDS;
+   const MuonGM::MuonDetectorManager* m_MuonDetMgrDS; // nominal MuonDetectorManager (no alignment) from the DetectorStore (needed in this test alg to compare against the ConditionsObject)
    SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", 
       "MuonDetectorManager", 
       "Key of input MuonDetectorManager condition data"};    
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/src/AlignCondAthTest.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/src/AlignCondAthTest.cxx
index 0d1759254e2c..5bfbdf761cce 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/src/AlignCondAthTest.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/src/AlignCondAthTest.cxx
@@ -2,16 +2,13 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-
 #include "MuonCondTest/AlignCondAthTest.h"
-#include "MuonReadoutGeometry/MuonDetectorManager.h"
+
 #include "MuonReadoutGeometry/MdtReadoutElement.h"
 #include "MuonReadoutGeometry/RpcReadoutElement.h"
 #include "MuonReadoutGeometry/TgcReadoutElement.h"
 #include "MuonReadoutGeometry/CscReadoutElement.h"
 #include "MuonAlignmentData/CorrContainer.h"
-#include "Identifier/IdentifierHash.h"
-#include "Identifier/Identifier.h"
 #include "GeoPrimitives/GeoPrimitivesToStringConverter.h"
 
 AlignCondAthTest::AlignCondAthTest(const std::string& name, ISvcLocator* pSvcLocator) :
@@ -32,13 +29,8 @@ AlignCondAthTest::AlignCondAthTest(const std::string& name, ISvcLocator* pSvcLoc
 }
  
 StatusCode AlignCondAthTest::initialize(){
-//
 
-  ATH_MSG_INFO( "in initialize()"  );
-  if (StatusCode::SUCCESS != detStore()->retrieve(m_MuonDetMgrDS)) {
-    ATH_MSG_FATAL("Couldn't load MuonDetectorManager");
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK(detStore()->retrieve(m_MuonDetMgrDS));
 
   ATH_CHECK(m_idHelperSvc.retrieve());
 
@@ -137,15 +129,6 @@ StatusCode AlignCondAthTest::execute() {
   return StatusCode::SUCCESS;
 //
 }
- 
-StatusCode AlignCondAthTest::finalize() {
-//
-
-  ATH_MSG_INFO( "in finalize()"  );
-//
-  return StatusCode::SUCCESS;
-//
-}
 
 StatusCode AlignCondAthTest::checkALines(const MuonGM::MuonDetectorManager* manager, std::ofstream* fout) 
 {
diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.h b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.h
index a3a78d7cae1b..cd8f0acc9412 100644
--- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.h
+++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MUONDIGITIZATION_CSC_DIGITIZER_H
@@ -113,9 +113,6 @@ private:
   void fillMaps(const IdentifierHash hash, const double driftTime, const double stripCharge,
 		std::vector<IdentifierHash>& hashVec,
 		std::map<IdentifierHash,std::pair<double,double> >& data_map);
-  //  void fillSampleMaps(const IdentifierHash hash, const double driftTime, const double stripCharge,
-  //                      std::vector<IdentifierHash>& hashVec,
-  //                      std::map<IdentifierHash,std::vector<float> >& data_map); // new interface trying to provide 4 samples instead of q,t
   void fillSampleMaps(const IdentifierHash hash, const double driftTime, const double stripCharge,
                       std::vector<IdentifierHash>& hashVec,
                       std::map<IdentifierHash,std::vector<float> >& data_map, bool phase=0); // new interface trying to provide 4 samples instead of q,t
@@ -123,15 +120,11 @@ private:
 private:
   
   // private data members
-  CscHitIdHelper * m_cscHitHelper;
-  const   CscIdHelper * m_cscIdHelper;
-  const   MuonGM::MuonDetectorManager * m_muonMgr;
+  CscHitIdHelper* m_cscHitHelper;
+  const CscIdHelper* m_cscIdHelper;
+  const MuonGM::MuonDetectorManager* m_muonMgr; // cannot use ReadCondHandleKey since no athena component
   ICscCalibTool* m_pcalib;
-  // Calibration tool.
-  //  double m_FlatDist;
-  //  double m_GaussDist;  
-  //  double m_PoissonDist;  
-  //  double m_GammaDist;
+
   int    m_maxElectron;
   bool    m_NInterFromEnergyLoss;
   double m_electronEnergy;
diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h
index ef250e8c3257..173e4faebf29 100644
--- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h
+++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h
@@ -92,7 +92,6 @@ private:
   SG::WriteHandleKey<CscSimDataCollection> m_cscSimDataCollectionWriteHandleKey{this,"CSCSimDataCollectionOutputName","CSC_SDO","WriteHandleKey for Output CscSimDataCollection"};
   SG::WriteHandleKey<CscDigitContainer> m_cscDigitContainerKey{this,"OutputObjectName","CSC_DIGITS","CSC digit container object"};
 
-  const MuonGM::MuonDetectorManager* m_geoMgr{nullptr};
   std::unique_ptr<CSC_Digitizer> m_cscDigitizer{nullptr};
 
   ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx
index 6bf855c38b28..01fbe8172e36 100644
--- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx
@@ -40,7 +40,8 @@ StatusCode CscDigitizationTool::initialize() {
   ATH_MSG_DEBUG ( "  CscDigitContainer key     " << m_cscDigitContainerKey.key());
 
   // initialize transient detector store and MuonDetDescrManager
-  ATH_CHECK(detStore()->retrieve(m_geoMgr));
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+  ATH_CHECK(detStore()->retrieve(muDetMgr));
   ATH_MSG_DEBUG ( "MuonDetectorManager retrieved from StoreGate.");
 
   if (m_onlyUseContainerName) {
@@ -54,7 +55,7 @@ StatusCode CscDigitizationTool::initialize() {
   ATH_CHECK(m_pcalib.retrieve());
 
   //initialize the CSC digitizer
-  m_cscDigitizer = std::make_unique<CSC_Digitizer>(CscHitIdHelper::GetHelper(), m_geoMgr, &*(m_pcalib));
+  m_cscDigitizer = std::make_unique<CSC_Digitizer>(CscHitIdHelper::GetHelper(), muDetMgr, &*(m_pcalib));
   m_cscDigitizer->setAmplification(m_amplification);
   m_cscDigitizer->setDebug        ( msgLvl(MSG::DEBUG) );
   m_cscDigitizer->setDriftVelocity(m_driftVelocity);
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MDT_Response_DigiTool.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MDT_Response_DigiTool.h
index 63ab8b9bedf8..3858fecda5ed 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MDT_Response_DigiTool.h
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MDT_Response_DigiTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MDT_DIGITIZATION_MDT_RESPONSE_DIGITOOL_H
@@ -38,7 +38,7 @@ class MDT_Response_DigiTool : public AthAlgTool,
 
   StatusCode initialize();
 
-  bool initializeTube();
+  bool initializeTube(const MuonGM::MuonDetectorManager* detMgr);
 
  private:
   MDT_Response m_tube;
@@ -47,7 +47,6 @@ class MDT_Response_DigiTool : public AthAlgTool,
   double m_threshold;
   double m_attenuationLength;
 
-  const MuonGM::MuonDetectorManager* m_muonGeoMgr;
   const MdtIdHelper*         m_idHelper;
   bool m_DoQballGamma;
 };
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MdtDigitizationTool.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MdtDigitizationTool.h
index d0c465bc84f9..7d51e51e655a 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MdtDigitizationTool.h
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MdtDigitizationTool.h
@@ -136,7 +136,7 @@ class MdtDigitizationTool : public PileUpToolBase {
  private:
   CLHEP::HepRandomEngine*   getRandomEngine(const std::string& streamName, const EventContext& ctx) const;
   int                       digitizeTime(double time, bool isHPTDC, CLHEP::HepRandomEngine *rndmEngine) const;
-  double                    minimumTof(Identifier DigitId) const;
+  double                    minimumTof(Identifier DigitId, const MuonGM::MuonDetectorManager* detMgr) const;
 
   bool                      insideMatchingWindow(double time) const;
   bool                      insideMaskWindow(double time) const;
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h
index 8c004f60c83a..8bf9724161b9 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MDT_DIGITIZATION_RT_RELATION_DIGITOOL_H
@@ -38,7 +38,7 @@ class RT_Relation_DigiTool : public AthAlgTool,
   
   virtual StatusCode initialize() override;
 
-  bool initializeTube();
+  bool initializeTube(const MuonGM::MuonDetectorManager* detMgr);
 
  private:
   double getDriftTime(double radius) const;
@@ -50,7 +50,6 @@ class RT_Relation_DigiTool : public AthAlgTool,
 
   std::vector <Rt_relation *> m_rt;
 
-  const MuonGM::MuonDetectorManager* m_muonGeoMgr;
   const MdtIdHelper*         m_idHelper;
 
 };
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MDT_Response_DigiTool.cxx b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MDT_Response_DigiTool.cxx
index ccdebb35a37c..510fb343612a 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MDT_Response_DigiTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MDT_Response_DigiTool.cxx
@@ -11,13 +11,9 @@
 
 using namespace MuonGM;
 
-MDT_Response_DigiTool::MDT_Response_DigiTool( const std::string& type,
-					      const std::string& name,
-					      const IInterface* parent )
-  : AthAlgTool(type,name,parent)
-	 , m_muonGeoMgr(0)
-	 , m_idHelper(0)
-{
+MDT_Response_DigiTool::MDT_Response_DigiTool( const std::string& type, const std::string& name, const IInterface* parent) :
+  AthAlgTool(type,name,parent),
+	m_idHelper(nullptr) {
   declareInterface<IMDT_DigitizationTool>(this);
 
   declareProperty("ClusterDensity",   m_clusterDensity = 8.5);
@@ -62,30 +58,28 @@ MDT_Response_DigiTool::digitize(const MdtDigiToolInput& input, CLHEP::HepRandomE
 
 StatusCode MDT_Response_DigiTool::initialize()
 {
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
   if(detStore()->contains<MuonDetectorManager>( "Muon" )){
-    StatusCode status = detStore()->retrieve(m_muonGeoMgr);
-    if (status.isFailure()) {
-      ATH_MSG_FATAL("Could not retrieve MuonGeoModelDetectorManager!");
-      return status;
-    }
-    else {
+      ATH_CHECK(detStore()->retrieve(muDetMgr));
       ATH_MSG_DEBUG("MuonGeoModelDetectorManager retrieved from StoreGate.");
       //initialize the MdtIdHelper
-      m_idHelper = m_muonGeoMgr->mdtIdHelper();
+      m_idHelper = muDetMgr->mdtIdHelper();
       ATH_MSG_DEBUG("MdtIdHelper: " << m_idHelper );
-      if(!m_idHelper) return status;
-    }
+      if(!m_idHelper) {
+        ATH_MSG_ERROR("MdtIdHelper is nullptr");
+        return StatusCode::FAILURE;
+      }
   }
  
-  initializeTube();
+  initializeTube(muDetMgr);
 
   return StatusCode::SUCCESS;
 }
 
-bool MDT_Response_DigiTool::initializeTube(){
+bool MDT_Response_DigiTool::initializeTube(const MuonGM::MuonDetectorManager* detMgr) {
 
   // initialize MDT_Response
-  double innerR(m_muonGeoMgr->getGenericMdtDescriptor()->innerRadius);
+  double innerR(detMgr->getGenericMdtDescriptor()->innerRadius);
 
   ATH_MSG_DEBUG("INITIALIZED Inner tube radius to " << innerR );
   m_tube.SetTubeRadius(innerR);
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx
index 08c1781544f3..deff99b51f64 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx
@@ -759,7 +759,7 @@ bool MdtDigitizationTool::checkMDTSimHit(const MDTSimHit& hit) const {
   }
   
   if (m_useTof) {
-    double minTof = minimumTof(DigitId);
+    double minTof = minimumTof(DigitId, m_MuonGeoMgr);
     if(( hit.globalTime() < 0 || hit.globalTime() > 10*minTof) && m_DiscardEarlyHits) {
       ok = false;
       ATH_MSG_DEBUG( "MDTSimHit has invalid global time: " << hit.globalTime() << "   minimum Tof " << minTof );
@@ -854,7 +854,7 @@ bool MdtDigitizationTool::createDigits(MdtDigitContainer* digitContainer, MuonSi
     
     // check if the hits lies within the TDC time window
     // subtrack the minimum Tof (= globalPosition().mag()/c) from the tof of the hit 
-    double relativeTime = driftTime - minimumTof(idDigit);
+    double relativeTime = driftTime - minimumTof(idDigit, m_MuonGeoMgr);
     bool insideMatch = insideMatchingWindow( relativeTime );
     bool insideMask = insideMaskWindow( relativeTime );
     if( insideMask && insideMatch ) {
@@ -964,12 +964,12 @@ int MdtDigitizationTool::digitizeTime(double time, bool isHPTDC, CLHEP::HepRando
 }
 
 
-double MdtDigitizationTool::minimumTof(Identifier DigitId) const { 
+double MdtDigitizationTool::minimumTof(Identifier DigitId, const MuonGM::MuonDetectorManager* detMgr) const { 
   if(!m_useTof) return 0.;
   
   // get distance to vertex for tof correction before applying the time window
   double distanceToVertex(0.);
-  const MuonGM::MdtReadoutElement* element = m_MuonGeoMgr->getMdtReadoutElement(DigitId);
+  const MuonGM::MdtReadoutElement* element = detMgr->getMdtReadoutElement(DigitId);
   
   if (0 == element) {
     ATH_MSG_ERROR( "MuonGeoManager does not return valid element for given id!" );
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/RT_Relation_DigiTool.cxx b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/RT_Relation_DigiTool.cxx
index 386be81f8504..b0207758948c 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/RT_Relation_DigiTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/RT_Relation_DigiTool.cxx
@@ -19,7 +19,6 @@ RT_Relation_DigiTool::RT_Relation_DigiTool( const std::string& type,
 					    const IInterface* parent )
   : AthAlgTool(type,name,parent)
   , m_maxRadius(0)
-  , m_muonGeoMgr(0)
   , m_idHelper(0)
 {
   declareInterface<IMDT_DigitizationTool>(this);
@@ -43,30 +42,27 @@ MdtDigiToolOutput RT_Relation_DigiTool::digitize(const MdtDigiToolInput& input,C
 
 StatusCode RT_Relation_DigiTool::initialize()
 {
-
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
   if(detStore()->contains<MuonDetectorManager>( "Muon" )){
-    StatusCode status = detStore()->retrieve(m_muonGeoMgr);
-    if (status.isFailure()) {
-      ATH_MSG_FATAL("Could not retrieve MuonGeoModelDetectorManager!");
-      return status;
-    }
-    else {
+      ATH_CHECK(detStore()->retrieve(muDetMgr));
       ATH_MSG_DEBUG("MuonGeoModelDetectorManager retrieved from StoreGate.");
       //initialize the MdtIdHelper
-      m_idHelper = m_muonGeoMgr->mdtIdHelper();
+      m_idHelper = muDetMgr->mdtIdHelper();
       ATH_MSG_DEBUG("MdtIdHelper: " << m_idHelper );
-      if(!m_idHelper) return status;
-    }
+      if(!m_idHelper) {
+        ATH_MSG_ERROR("MdtIdHelper is nullptr");
+        return StatusCode::FAILURE;
+      }
   }
 
-  initializeTube();
+  initializeTube(muDetMgr);
 
   return StatusCode::SUCCESS;
 }
 
-bool RT_Relation_DigiTool::initializeTube(){
+bool RT_Relation_DigiTool::initializeTube(const MuonGM::MuonDetectorManager* detMgr){
 
-  m_maxRadius = m_muonGeoMgr->getGenericMdtDescriptor()->innerRadius;
+  m_maxRadius = detMgr->getGenericMdtDescriptor()->innerRadius;
 
   if (m_rt.size() < 1) {
     std::string inputFile = RT_DATA;
@@ -86,8 +82,6 @@ bool RT_Relation_DigiTool::initializeTube(){
     m_rt[0]->read_rt(rt_file);
   }
 
-  m_maxRadius = m_muonGeoMgr->getGenericMdtDescriptor()->innerRadius;
-
   ATH_MSG_DEBUG("Initialized Inner tube radius to " << m_maxRadius );
 
   return true;
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h
index 89de12db0b9b..c9aff61fca44 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h
@@ -23,10 +23,6 @@ input quantities into the output
 -----------------------------------------------*/
 /*******************************************************************************/
 
-namespace MuonGM{
-  class MuonDetectorManager;
-}
-
 class MM_Response_DigitTool : public AthAlgTool, virtual public IMM_DigitizationTool {
  public:
   MM_Response_DigitTool( const std::string& type, const std::string& name, const IInterface* parent);
@@ -35,11 +31,6 @@ class MM_Response_DigitTool : public AthAlgTool, virtual public IMM_Digitization
   StatusCode initialize();
   bool initializeStrip();
 
- private:
-
-  // const MuonGM::MuonDetectorManager* m_muonGeoMgr;
-  // ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
-
  protected:
   CLHEP::HepRandomEngine *m_rndmEngine;    // Random number engine used - not init in SiDigitization
   std::string m_rndmEngineName;// name of random engine
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx
index 577c1c8c2c5e..124f7c648c54 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx
@@ -5,17 +5,13 @@
 #include "MM_Digitization/MM_Response_DigitTool.h"
 
 #include "MM_Digitization/MM_DigitToolInput.h"
-// #include "MuonReadoutGeometry/MuonDetectorManager.h"
 
 #include <iostream>
 #include <vector>
 
-using namespace MuonGM;
-
 /*******************************************************************************/
 MM_Response_DigitTool::MM_Response_DigitTool(const std::string& type, const std::string& name, const IInterface* parent) :
   AthAlgTool(type,name,parent),
-  // m_muonGeoMgr(0),
   m_rndmEngine(0),
   m_rndmEngineName("MuonDigitization"),
   m_rndmSvc("AtRndmGenSvc", name )
@@ -35,11 +31,6 @@ MM_DigitToolOutput MM_Response_DigitTool::digitize( /*const MmDigitToolInput& in
 /*******************************************************************************/
 StatusCode MM_Response_DigitTool::initialize()
 {
-  // if(detStore()->contains<MuonDetectorManager>( "Muon" )){
-  //   ATH_CHECK( detStore()->retrieve(m_muonGeoMgr) );
-  //   ATH_MSG_DEBUG("MuonGeoModelDetectorManager retrieved from StoreGate.");
-  // }
-  // ATH_CHECK(m_idHelperSvc.retrieve());
   ATH_CHECK( m_rndmSvc.retrieve() );
 
   // getting our random numbers stream
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h
index 5fc861efdef3..b4c6a69ef672 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // TgcDigitMaker.h
@@ -174,7 +174,7 @@ class TgcDigitMaker {
 
   TgcHitIdHelper* m_hitIdHelper;
   unsigned int m_runperiod;
-  const MuonGM::MuonDetectorManager* m_mdManager;
+  const MuonGM::MuonDetectorManager* m_mdManager; // cannot use ReadCondHandleKey since no athena component
   const TgcIdHelper* m_idHelper;
   float m_efficiencyOfWireGangs;
   float m_efficiencyOfStrips;
diff --git a/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/CscHashId.h b/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/CscHashId.h
index cedc0afa963d..794d5c0cc05a 100644
--- a/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/CscHashId.h
+++ b/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/CscHashId.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef CSCHASHID_H
@@ -12,9 +12,6 @@
 
 class StoreGateSvc;
 class CscIdHelper;
-namespace MuonGM {
-class MuonDetectorManager;
-}
 
 /////////////////////////////////////////////////////////////////////////////
 
@@ -23,20 +20,17 @@ class CscHashId: public AthAlgorithm {
 public:
 
   CscHashId (const std::string& name, ISvcLocator* pSvcLocator);
-  ~CscHashId();
+  ~CscHashId()=default;
 
   StatusCode initialize();
   StatusCode execute();
-  StatusCode finalize();
 
 private:
 
   StatusCode cscHash();
 
 private:
-
   const CscIdHelper          * m_cscId;
-  const MuonGM::MuonDetectorManager  * m_muon_mgr;
 
 };
 
diff --git a/MuonSpectrometer/MuonIdHelpersAlgs/src/CscHashId.cxx b/MuonSpectrometer/MuonIdHelpersAlgs/src/CscHashId.cxx
index ba3e1944544e..b44fa1a9d33f 100644
--- a/MuonSpectrometer/MuonIdHelpersAlgs/src/CscHashId.cxx
+++ b/MuonSpectrometer/MuonIdHelpersAlgs/src/CscHashId.cxx
@@ -16,22 +16,16 @@
 
 CscHashId::CscHashId(const std::string& name, ISvcLocator* pSvcLocator) :
   AthAlgorithm(name, pSvcLocator),
-  m_cscId(NULL), m_muon_mgr(NULL)
-   {
-
+  m_cscId(nullptr) {
 }
-
-CscHashId::~CscHashId()
-{}
-
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 
 StatusCode CscHashId::initialize(){
 
   ATH_MSG_DEBUG( " in initialize()"  );
-            
-  ATH_CHECK( detStore()->retrieve( m_muon_mgr ) );
-  m_cscId = m_muon_mgr->cscIdHelper();
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+  ATH_CHECK(detStore()->retrieve(muDetMgr));
+  m_cscId = muDetMgr->cscIdHelper();
 
   return StatusCode::SUCCESS;
 }
@@ -47,12 +41,6 @@ StatusCode CscHashId::execute() {
   return StatusCode::SUCCESS;
 }
 
-StatusCode CscHashId::finalize() {
- 
-  ATH_MSG_DEBUG( "in finalize()"  );
-  return StatusCode::SUCCESS;
-}
-
 StatusCode CscHashId::cscHash() {
   ATH_MSG_DEBUG( "in execute(): testing CSC IdHelper"  );
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.cxx
index 62df9088a77b..f203666f1ef5 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // CscAlignmentTool.cxx
@@ -9,15 +9,11 @@
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "MuonIdHelpers/CscIdHelper.h"
 
-using std::vector;
-using std::string;
-
 //**********************************************************************
 
-CscAlignmentTool::
-CscAlignmentTool(string type, string aname, const IInterface* parent)
-  : AthAlgTool(type, aname, parent),
-    m_pmuon_detmgr(0), m_phelper(0)
+CscAlignmentTool::CscAlignmentTool(const std::string& type, const std::string& aname, const IInterface* parent) :
+  AthAlgTool(type, aname, parent),
+  m_phelper(nullptr)
 {
   declareInterface<ICscAlignmentTool>(this);
   declareProperty("useAlignment", m_useAlignment=false); // in strips
@@ -28,10 +24,6 @@ CscAlignmentTool(string type, string aname, const IInterface* parent)
 
 //**********************************************************************
 
-CscAlignmentTool::~CscAlignmentTool() { }
-
-//**********************************************************************
-
 StatusCode CscAlignmentTool::initialize() {
 
   ATH_MSG_DEBUG ( "Initializing " << name() );
@@ -39,22 +31,11 @@ StatusCode CscAlignmentTool::initialize() {
   ATH_MSG_DEBUG ( "     EtaPos AlignConsts size :" << m_etaposAlignconsts.size() );
   ATH_MSG_DEBUG ( "     PhiPos AlignConsts size :" << m_phiposAlignconsts.size() );
 
-  // Retrieve the detector descriptor.
-  if ( detStore()->retrieve(m_pmuon_detmgr).isFailure() ) {
-    ATH_MSG_ERROR ( " Cannot retrieve MuonGeoModel " );
-    return StatusCode::RECOVERABLE;
-  }
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+  ATH_CHECK_RECOVERABLE(detStore()->retrieve(muDetMgr));
   ATH_MSG_DEBUG ( "Retrieved geometry." );
-  m_phelper = m_pmuon_detmgr->cscIdHelper();
-
-
-  return StatusCode::SUCCESS;
-}
-
-//**********************************************************************
+  m_phelper = muDetMgr->cscIdHelper();
 
-StatusCode CscAlignmentTool::finalize() {
-  ATH_MSG_VERBOSE ( "Finalizing " << name() );
   return StatusCode::SUCCESS;
 }
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.h
index 5cb813306a7b..5c203c0eaf49 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.h
@@ -1,9 +1,7 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-// CscAlignmentTool.h
-
 #ifndef CscAlignmentTool_H
 #define CscAlignmentTool_H
 
@@ -12,43 +10,32 @@
 //
 // Strip fitter using the parabolic fit fron the CSC calibration tool.
 
-#include <vector>
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "CscClusterization/ICscAlignmentTool.h"
+
+#include <string>
+#include <vector>
+
 class Identifier;
 class CscIdHelper;
-namespace MuonGM 
-{
-    class MuonDetectorManager;
-}
 
 class CscAlignmentTool : virtual public ICscAlignmentTool, public AthAlgTool {
 
 public:  // Ctors and dtor.
 
   // Constructor.
-  CscAlignmentTool(std::string, std::string, const IInterface*);
+  CscAlignmentTool(const std::string&, const std::string&, const IInterface*);
 
   // Destructor.
-  ~CscAlignmentTool();
-
-public:  // AlgTool methods
+  ~CscAlignmentTool()=default;
 
   // Initialization.
   StatusCode initialize();
 
-  // Finalization.
-  StatusCode finalize();
-
 public:
   double getAlignmentOffset(Identifier pstripId) const;
 
-  
-
 private:  // data
-  // Pointer to muon geometry manager.
-  const MuonGM::MuonDetectorManager* m_pmuon_detmgr;
   const CscIdHelper* m_phelper;
 
   // Strip fitter.
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx
index d8ce1fb2dc60..545302aabd03 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx
@@ -20,16 +20,14 @@
 //
 
 using Muon::CscStripPrepData;
-using std::string;
 
 typedef ICscStripFitter::Result     Result;
 typedef ICscStripFitter::ChargeList ChargeList;
 
 //**********************************************************************
 
-CscBipolarStripFitter::CscBipolarStripFitter(string type, string aname, const IInterface *parent)
+CscBipolarStripFitter::CscBipolarStripFitter(const std::string& type, const std::string& aname, const IInterface *parent)
     : AthAlgTool(type, aname, parent),
-      m_pmuon_detmgr(0),
       m_phelper(0),
       m_n(0),
       m_n2(0),
@@ -50,10 +48,6 @@ CscBipolarStripFitter::CscBipolarStripFitter(string type, string aname, const II
 
 //**********************************************************************
 
-CscBipolarStripFitter::~CscBipolarStripFitter() {}
-
-//**********************************************************************
-
 StatusCode
 CscBipolarStripFitter::initialize()
 {
@@ -70,11 +64,11 @@ CscBipolarStripFitter::initialize()
     /** CSC calibratin tool for the Condtiions Data base access */
     ATH_CHECK_RECOVERABLE(m_cscCalibTool.retrieve());
 
-    // Retrieve the detector descriptor.
-    ATH_CHECK_RECOVERABLE(detStore()->retrieve(m_pmuon_detmgr));
+    const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+    ATH_CHECK_RECOVERABLE(detStore()->retrieve(muDetMgr));
     ATH_MSG_DEBUG("Retrieved geometry.");
 
-    m_phelper = m_pmuon_detmgr->cscIdHelper();
+    m_phelper = muDetMgr->cscIdHelper();
 
     m_n          = m_cscCalibTool->getNumberOfIntegration();   // 12.;
     m_n2         = m_cscCalibTool->getNumberOfIntegration2();  // 11.66;
@@ -93,15 +87,6 @@ CscBipolarStripFitter::initialize()
 
 //**********************************************************************
 
-StatusCode
-CscBipolarStripFitter::finalize()
-{
-    ATH_MSG_DEBUG("Finalizing " << name());
-    return StatusCode::SUCCESS;
-}
-
-//**********************************************************************
-
 Result
 CscBipolarStripFitter::fit(const ChargeList &chgs, double period, Identifier &stripId) const
 {
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h
index 0b2a1c2d1ffc..093bd88d290c 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h
@@ -2,8 +2,6 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-// CscBipolarStripFitter.h
-
 #ifndef CscBipolarStripFitter_H
 #define CscBipolarStripFitter_H
 ///////////////////////////////////////////
@@ -25,27 +23,21 @@ class CscIdHelper;
 namespace Muon {
 class CscStripPrepData;
 }
-namespace MuonGM {
-class MuonDetectorManager;
-}
 
 
 class CscBipolarStripFitter : virtual public ICscStripFitter, public AthAlgTool {
 
   public:  // Ctors and dtor.
     // Constructor.
-    CscBipolarStripFitter(std::string, std::string, const IInterface *);
+    CscBipolarStripFitter(const std::string&, const std::string&, const IInterface*);
 
     // Destructor.
-    ~CscBipolarStripFitter();
+    ~CscBipolarStripFitter()=default;
 
   public:  // AlgTool methods
     // Initialization.
     StatusCode initialize();
 
-    // Finalization.
-    StatusCode finalize();
-
   public:  // Interface methods
     // Tell compiler not to hide other fit methods.
     using ICscStripFitter::fit;
@@ -54,9 +46,7 @@ class CscBipolarStripFitter : virtual public ICscStripFitter, public AthAlgTool
     // If that fit fails, the peak channel is used.
     Result fit(const ChargeList &charges, double samplingTime, Identifier &stripId) const;
 
-  private:  // data
-    // Pointer to muon geometry manager.
-    const MuonGM::MuonDetectorManager *m_pmuon_detmgr;
+  private:
     const CscIdHelper *                m_phelper;
 
     // Calibration tool.
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx
index 96a36efbb86a..6047001b41ea 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx
@@ -2,8 +2,6 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-// CscClusterUtilTool.cxx
-
 #include "CscClusterUtilTool.h"
 
 #include "CscClusterization/ICscClusterFitter.h"
@@ -20,14 +18,11 @@ using Muon::CscPrepData;
 using Muon::CscStripPrepData;
 using Muon::CscStripPrepDataCollection;
 using Muon::CscStripPrepDataContainer;
-using std::string;
-using std::vector;
 
 //**********************************************************************
 
-CscClusterUtilTool::CscClusterUtilTool(string type, string aname, const IInterface* parent)
+CscClusterUtilTool::CscClusterUtilTool(const std::string& type, const std::string& aname, const IInterface* parent)
     : AthAlgTool(type, aname, parent),
-      m_pmuon_detmgr(0),
       m_phelper(0),
       m_cscStripLocation("CSC_Measurements")
 {
@@ -37,10 +32,6 @@ CscClusterUtilTool::CscClusterUtilTool(string type, string aname, const IInterfa
 
 //**********************************************************************
 
-CscClusterUtilTool::~CscClusterUtilTool() {}
-
-//**********************************************************************
-
 StatusCode
 CscClusterUtilTool::initialize()
 {
@@ -58,23 +49,14 @@ CscClusterUtilTool::initialize()
     ATH_CHECK(m_precClusterFitter.retrieve());
     ATH_MSG_DEBUG("Retrieved CSC precision cluster fitting tool");
 
-    // Retrieve the detector descriptor.
-    ATH_CHECK_RECOVERABLE(detStore()->retrieve(m_pmuon_detmgr));
+    const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+    ATH_CHECK_RECOVERABLE(detStore()->retrieve(muDetMgr));
     ATH_MSG_DEBUG("Retrieved geometry.");
-    m_phelper = m_pmuon_detmgr->cscIdHelper();
+    m_phelper = muDetMgr->cscIdHelper();
 
     return StatusCode::SUCCESS;
 }
 
-//**********************************************************************
-
-StatusCode
-CscClusterUtilTool::finalize()
-{
-    ATH_MSG_VERBOSE("Finalizing " << name());
-    return StatusCode::SUCCESS;
-}
-
 //**********************************************************************
 void
 CscClusterUtilTool::getStripFits(const Trk::RIO_OnTrack* rot, ICscClusterFitter::StripFitList& sfits) const
@@ -123,7 +105,7 @@ CscClusterUtilTool::getStripFits(const CscPrepData* MClus, ICscClusterFitter::St
 
     sfits.clear();
 
-    vector<const CscStripPrepData*> strPrepDatas = getStrips(MClus);
+    std::vector<const CscStripPrepData*> strPrepDatas = getStrips(MClus);
     for (unsigned int i = 0; i < strPrepDatas.size(); ++i) {
         ICscClusterFitter::StripFit sfit;
         sfit = m_stripFitter->fit(*strPrepDatas[i]);
@@ -155,17 +137,17 @@ CscClusterUtilTool::getRefitCluster(const CscPrepData* MClus, double tantheta) c
 }
 /////////////////////////////////////////////////////////////////////////////
 
-vector<const CscStripPrepData*>
+std::vector<const CscStripPrepData*>
 CscClusterUtilTool::getStrips(const CscPrepData* MClus) const
 {
 
-    vector<const CscStripPrepData*> strips;
+    std::vector<const CscStripPrepData*> strips;
     if (!MClus) {
         ATH_MSG_WARNING(" Muon::CscPrepData* pprd is empty !");
         return strips;
     }
 
-    vector<Identifier> prd_digit_ids = MClus->rdoList();
+    std::vector<Identifier> prd_digit_ids = MClus->rdoList();
 
     SG::ReadHandle<Muon::CscStripPrepDataContainer> pdigcont(m_cscStripLocation);
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h
index 5df430ed5a18..5127e82d2aba 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h
@@ -18,14 +18,11 @@
 #include "CscClusterization/ICscClusterUtilTool.h"
 #include "GaudiKernel/ToolHandle.h"
 class CscIdHelper;
-namespace MuonGM {
-class MuonDetectorManager;
-}
 namespace Muon {
 class CscClusterOnTrack;
 class CscPrepData;
 class CscStripPrepData;
-}  // namespace Muon
+}
 namespace Trk {
 class RIO_OnTrack;
 }
@@ -34,19 +31,13 @@ class CscClusterUtilTool : virtual public ICscClusterUtilTool, public AthAlgTool
 
   public:  // Ctors and dtor.
     // Constructor.
-    CscClusterUtilTool(std::string, std::string, const IInterface*);
+    CscClusterUtilTool(const std::string&, const std::string&, const IInterface*);
 
     // Destructor.
-    ~CscClusterUtilTool();
+    ~CscClusterUtilTool()=default;
 
-  public:  // AlgTool methods
-    // Initialization.
     StatusCode initialize();
 
-    // Finalization.
-    StatusCode finalize();
-
-  public:
     ICscClusterFitter::Results getRefitCluster(const Muon::CscPrepData* MClus, double tantheta) const;
 
     void getStripFits(const Trk::RIO_OnTrack* rot, ICscClusterFitter::StripFitList& sfits) const;
@@ -55,11 +46,8 @@ class CscClusterUtilTool : virtual public ICscClusterUtilTool, public AthAlgTool
 
     std::vector<const Muon::CscStripPrepData*> getStrips(const Muon::CscPrepData* MClus) const;
 
-
-  private:  // data
-    // Pointer to muon geometry manager.
-    const MuonGM::MuonDetectorManager* m_pmuon_detmgr;
-    const CscIdHelper*                 m_phelper;
+  private:
+    const CscIdHelper* m_phelper;
 
     // Strip fitter.
     ToolHandle<ICscStripFitter> m_stripFitter{
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx
index 09c175ef1a07..e0d9ee28ed5f 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx
@@ -46,7 +46,6 @@ SimpleCscClusterFitter::initialize()
     ATH_MSG_DEBUG("  Position option: " << m_option);
     ATH_MSG_DEBUG("  Intrinsic width: " << m_intrinsic_cluster_width << " mm");
 
-    ATH_CHECK(detStore()->retrieve(m_detMgr, "Muon"));
     ATH_CHECK(m_idHelperSvc.retrieve());
 
     if (m_alignmentTool.retrieve().isFailure()) {
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h
index bcffb8c22a26..c7ba21c88d1d 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h
@@ -46,8 +46,6 @@ class SimpleCscClusterFitter : virtual public ICscClusterFitter, public AthAlgTo
     double      m_defaultErrorScaler_eta;
     double      m_defaultErrorScaler_phi;
 
-    const MuonGM::MuonDetectorManager* m_detMgr;
-
     ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc",
                                                         "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/MuonClusterization/MdtHitClustering.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/MuonClusterization/MdtHitClustering.h
index 4036d55365b4..996cfa02457b 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/MuonClusterization/MdtHitClustering.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/MuonClusterization/MdtHitClustering.h
@@ -106,7 +106,7 @@ namespace Muon {
     void layers( const MdtCluster& cl, int& all, int& inTime, int& inTimeAndBefore ) const;
 
     const MdtIdHelper* m_mdtIdHelper;
-    const MuonGM::MuonDetectorManager* m_detMgr;
+    const MuonGM::MuonDetectorManager* m_detMgr; // cannot use ReadCondHandleKey since no athena component
     const MuonGM::MdtReadoutElement* detEl1;
     const MuonGM::MdtReadoutElement* detEl2;
     unsigned int nlay;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h
index 95649b1bd63a..28bc66cf3bab 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h
@@ -218,7 +218,7 @@ namespace Muon {
     void insertHash( int sector, const IdentifierHash& hash, const Identifier& id );
 
     void matchTruth( std::set<Identifier>& truthHits, const PRD_MultiTruthCollection& truthCol, const Identifier& id, MuonHough::HitDebugInfo& debug ) const;
-    void initializeSectorMapping();
+    void initializeSectorMapping(const MuonGM::MuonDetectorManager* detMgr);
     void getTruth() const;
     void printTruthSummary( std::set<Identifier>& truth, std::set<Identifier>& found ) const;
 
@@ -232,7 +232,6 @@ namespace Muon {
     ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
     ToolHandle<MuonEDMPrinterTool> m_printer{this, "printerTool", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
     ToolHandle<Muon::IMuonTruthSummaryTool> m_truthSummaryTool{this, "MuonTruthSummaryTool", "Muon::MuonTruthSummaryTool/MuonTruthSummaryTool"};
-    const MuonGM::MuonDetectorManager* m_detMgr;
 
     std::vector<MuonHough::MuonLayerHoughSelector> m_selectors;
     std::vector<MuonHough::MuonLayerHoughSelector> m_selectorsLoose;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx
index 8c99a27f0a2e..cca10df314b6 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx
@@ -21,7 +21,6 @@ namespace Muon {
 
   MuonLayerHoughTool::MuonLayerHoughTool(const std::string& type, const std::string& name, const IInterface* parent):
     AthAlgTool(type,name,parent),
-    m_detMgr(nullptr),
     m_ntechnologies(UINT_MAX), // gets set inside initialize()
     m_techToTruthNameIdx()
   {
@@ -39,7 +38,8 @@ namespace Muon {
     } else {
       m_truthSummaryTool.disable();
     }
-    ATH_CHECK( detStore()->retrieve( m_detMgr ) );
+    const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+    ATH_CHECK( detStore()->retrieve( muDetMgr ) );
 
     if( m_doNtuple ){
       if (Gaudi::Concurrency::ConcurrencyFlags::concurrent() && Gaudi::Concurrency::ConcurrencyFlags::numThreads()>1) {
@@ -62,7 +62,7 @@ namespace Muon {
       m_ntuple = 0;
     }
     
-    initializeSectorMapping();
+    initializeSectorMapping(muDetMgr);
 
     // if m_truthNames is empty, fill it if running on truth
     if( m_truthNames.empty() && m_doTruth ){
@@ -2156,7 +2156,7 @@ namespace Muon {
   }
 
   // all chambers are mapped onto a layer and sector map
-  void MuonLayerHoughTool::initializeSectorMapping() {
+  void MuonLayerHoughTool::initializeSectorMapping(const MuonGM::MuonDetectorManager* detMgr) {
     m_collectionsPerSector.resize(MuonStationIndex::numberOfSectors());
     // set sector numbers
     unsigned int nsectorHashMax = MuonStationIndex::sectorLayerHashMax();
@@ -2229,7 +2229,7 @@ namespace Muon {
     it = m_idHelperSvc->tgcIdHelper().module_begin();
     it_end = m_idHelperSvc->tgcIdHelper().module_end();
     for( ;it!=it_end; ++it ){
-      const MuonGM::TgcReadoutElement* detEl = m_detMgr->getTgcReadoutElement(*it);
+      const MuonGM::TgcReadoutElement* detEl = detMgr->getTgcReadoutElement(*it);
       if( !detEl ) {
         ATH_MSG_DEBUG(" No detector element found for " << m_idHelperSvc->toString(*it) );
         continue;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h
index c057ed1b5ec1..6a7ab591ba23 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h
@@ -89,7 +89,7 @@ private:
   SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", 
       "MuonDetectorManager", 
       "Key of input MuonDetectorManager condition data"};    
-  const MuonGM::MuonDetectorManager* m_muonDetMgr;
+  const MuonGM::MuonDetectorManager* m_muonDetMgr; // nominal MuonDetectorManager from DetectorStore (used if UseDSManager=true)
  
   // -- algorithm members
   mutable MuonTGHits* m_hits           ATLAS_THREAD_SAFE; //Marked as thread-safe because it's disabled when running multi-threaded
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/MuonStationIntersectSvc/MdtIntersectGeometry.h b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/MuonStationIntersectSvc/MdtIntersectGeometry.h
index c464247efaa8..1cb2f0457dc6 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/MuonStationIntersectSvc/MdtIntersectGeometry.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/MuonStationIntersectSvc/MdtIntersectGeometry.h
@@ -47,7 +47,7 @@ namespace Muon {
     TrkDriftCircleMath::MdtChamberGeometry* m_mdtGeometry;
     const MuonGM::MdtReadoutElement*        m_detElMl0;
     const MuonGM::MdtReadoutElement*        m_detElMl1;
-    const MuonGM::MuonDetectorManager*      m_detMgr;
+    const MuonGM::MuonDetectorManager*      m_detMgr; // cannot use ReadCondHandleKey since no athena component
     const MdtCondDbData*                    m_dbData;
     const Muon::IMuonIdHelperSvc*           m_idHelperSvc;
     std::set<Identifier>                    m_deadTubesML;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool.h b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool.h
index 01218cd6de12..e8462e30282f 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef RPC_LINEARSEGMENTMAKERTOOL_H
@@ -10,11 +10,6 @@
 
 class RpcIdHelper;
 
-namespace MuonGM
-{
-    class MuonDetectorManager;
-}
-
 class RPC_LinearSegmentMakerTool : virtual public Muon::IMuonSegmentMaker, public AthAlgTool
 {
 public:
@@ -23,7 +18,6 @@ public:
                                const IInterface* pIID);
 
     StatusCode initialize();
-    StatusCode Finalize();
     virtual void
       find(const std::vector<const Trk::RIO_OnTrack*>&,
 	   Trk::SegmentCollection*) const
@@ -65,7 +59,6 @@ private:
                     double& z, int& nZ,
                     double& phi, int& nPhi);
 
-    const MuonGM::MuonDetectorManager* m_pMuonMgr;
     const RpcIdHelper*                 m_pIdHelper;
     DoubleProperty                     m_fExclChi2;
 };
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/src/RPC_LinearSegmentMakerTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/src/RPC_LinearSegmentMakerTool.cxx
index 9579acffb2c2..a3f16212a903 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/src/RPC_LinearSegmentMakerTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/src/RPC_LinearSegmentMakerTool.cxx
@@ -1,7 +1,7 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
 #include "RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool.h"
 #include "MuonLinearSegmentMakerUtilities/Fit2D.h"
 #include "MuonLinearSegmentMakerUtilities/MuonLinearSegmentMakerUtilities.h"
@@ -19,7 +19,7 @@ RPC_LinearSegmentMakerTool::RPC_LinearSegmentMakerTool(const std::string& type,
                                                        const std::string& name,
                                                        const IInterface* pIID) :
 AthAlgTool(type, name, pIID),
-m_pIdHelper(NULL)
+m_pIdHelper(nullptr)
 {
     declareInterface<Muon::IMuonSegmentMaker>(this);
     declareProperty("OutlierChi2", m_fExclChi2 = 10.0);
@@ -28,28 +28,11 @@ m_pIdHelper(NULL)
 StatusCode RPC_LinearSegmentMakerTool::initialize()
 {
     ATH_MSG_INFO("Initializing RPC_LinearSegmentMakerTool - package version " << PACKAGE_VERSION );
-    StatusCode sc = StatusCode::SUCCESS;
 
-    // initialize RpcIdHelper
-    StoreGateSvc* pDetStore = NULL;
-    sc = svcLoc()->service("DetectorStore", pDetStore);
-    if (sc.isFailure() || pDetStore == NULL)
-    {
-        ATH_MSG_ERROR("Cannot locate DetectorStore");
-        return sc;
-    }
-    sc = pDetStore->retrieve(m_pMuonMgr);
-    if (sc.isFailure() || m_pMuonMgr == NULL)
-    {
-        ATH_MSG_ERROR("Cannot retrieve MuonDetectorManager");
-        return sc;
-    }
-    m_pIdHelper = m_pMuonMgr->rpcIdHelper();
-    return StatusCode::SUCCESS;
-}
+    const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+    ATH_CHECK(detStore()->retrieve(muDetMgr));
 
-StatusCode RPC_LinearSegmentMakerTool::Finalize()
-{
+    m_pIdHelper = muDetMgr->rpcIdHelper();
     return StatusCode::SUCCESS;
 }
 
@@ -82,11 +65,11 @@ static inline double getFirstPointR(const Muon::Fit2D::PointArray& points)
     return 0.0;
 }
 
-void
+void
 RPC_LinearSegmentMakerTool::find(const Trk::TrackRoad& road,
                                  const std::vector< std::vector< const Muon::MdtDriftCircleOnTrack* > >&,
                                  const std::vector< std::vector< const Muon::MuonClusterOnTrack* > >& clusters,
-				 Trk::SegmentCollection*,
+				 Trk::SegmentCollection*,
                                  bool,double) const
 {
     ATH_MSG_DEBUG("RPC_LinearSegmentMakerTool::find");
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool.h b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool.h
index 3edd22f91b6d..9070f0e7f4f9 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool.h
@@ -8,21 +8,15 @@
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "MuonRecToolInterfaces/IMuonSegmentMaker.h"
-//#include "CLHEP/Vector/TwoVector.h"
 #include "TrkExInterfaces/IIntersector.h"
 
 class TgcIdHelper;
 
-namespace MuonGM {
-class MuonDetectorManager;
-}
-
 class TGC_LinearSegmentMakerTool : virtual public Muon::IMuonSegmentMaker, public AthAlgTool {
   public:
     TGC_LinearSegmentMakerTool(const std::string& type, const std::string& name, const IInterface* pIID);
 
     StatusCode   initialize();
-    StatusCode   Finalize();
     virtual void find(const std::vector<const Trk::RIO_OnTrack*>&, Trk::SegmentCollection*) const {}
 
     virtual void find(const std::vector<const Trk::RIO_OnTrack*>&, const std::vector<const Trk::RIO_OnTrack*>&) const {}
@@ -46,7 +40,6 @@ class TGC_LinearSegmentMakerTool : virtual public Muon::IMuonSegmentMaker, publi
                       double momentum = 1e9) const;
 
   private:
-    const MuonGM::MuonDetectorManager* m_pMuonMgr;
     const TgcIdHelper*                 m_pIdHelper;
     DoubleProperty                     m_fExclChi2;
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx
index f06ac81cb784..b215c2cd34ce 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx
@@ -25,7 +25,7 @@
 TGC_LinearSegmentMakerTool::TGC_LinearSegmentMakerTool(const std::string& type, const std::string& name,
                                                        const IInterface* pIID)
     : AthAlgTool(type, name, pIID),
-      m_pIdHelper(NULL)
+      m_pIdHelper(nullptr)
 {
     declareInterface<Muon::IMuonSegmentMaker>(this);
     declareProperty("OutlierChi2", m_fExclChi2 = 10.0);
@@ -35,32 +35,15 @@ StatusCode
 TGC_LinearSegmentMakerTool::initialize()
 {
     ATH_MSG_INFO("Initializing TGC_LinearSegmentMakerTool - package version " << PACKAGE_VERSION);
-    StatusCode sc = StatusCode::SUCCESS;
 
-    // initialize TgcIdHelper
-    StoreGateSvc* pDetStore = NULL;
-    sc                      = svcLoc()->service("DetectorStore", pDetStore);
-    if (sc.isFailure() || pDetStore == NULL) {
-        ATH_MSG_ERROR("Cannot locate DetectorStore");
-        return sc;
-    }
-    sc = pDetStore->retrieve(m_pMuonMgr);
-    if (sc.isFailure() || m_pMuonMgr == NULL) {
-        ATH_MSG_ERROR("Cannot retrieve MuonDetectorManager");
-        return sc;
-    }
-    m_pIdHelper = m_pMuonMgr->tgcIdHelper();
+    const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+    ATH_CHECK(detStore()->retrieve(muDetMgr));
+    m_pIdHelper = muDetMgr->tgcIdHelper();
 
     ATH_CHECK(m_pIntersector.retrieve());
     return StatusCode::SUCCESS;
 }
 
-StatusCode
-TGC_LinearSegmentMakerTool::Finalize()
-{
-    return StatusCode::SUCCESS;
-}
-
 static std::string
 point2String(const Amg::Vector3D& pt)
 {
-- 
GitLab


From 4554e02214cc078053060152a87303a9ac948aa8 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Thu, 17 Sep 2020 14:32:35 +0200
Subject: [PATCH 191/422] TrkExTools: Remove overly verbose log output

---
 .../TrkExTools/TrkExTools/EnergyLossUpdator.h  |  7 +------
 .../TrkExTools/MultipleScatteringUpdator.h     |  3 ---
 .../TrkExTools/src/EnergyLossUpdator.cxx       | 18 ------------------
 .../TrkExTools/src/Extrapolator.cxx            |  1 -
 .../src/MultipleScatteringUpdator.cxx          |  7 -------
 .../TrkExTools/src/Navigator.cxx               |  4 +---
 6 files changed, 2 insertions(+), 38 deletions(-)

diff --git a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/EnergyLossUpdator.h b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/EnergyLossUpdator.h
index 7c0bfec4c263..05d9d36f5a75 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/EnergyLossUpdator.h
+++ b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/EnergyLossUpdator.h
@@ -106,13 +106,8 @@ namespace Trk {
       EnergyLossUpdator(const std::string&,const std::string&,const IInterface*);
 
       /**Virtual destructor*/
-      virtual ~EnergyLossUpdator();
+      virtual ~EnergyLossUpdator() = default;
        
-      /** AlgTool initailize method.*/
-      virtual StatusCode initialize() override;
-      /** AlgTool finalize method */
-      virtual StatusCode finalize() override;
-        
       /** dEdX calculation when providing MaterialProperties,
         a momentum, a pathlength, and a ParicleHypothesis:
         
diff --git a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h
index 601ee9fae845..4ad913d3d599 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h
+++ b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h
@@ -52,9 +52,6 @@ namespace Trk {
       /** AlgTool initailize method.*/
       virtual StatusCode initialize() override;
       
-      /** AlgTool finalize method */
-      virtual StatusCode finalize() override;
-        
       /** Calculate the sigma on theta introduced by multiple scattering,
           according to the RutherFord-Scott Formula           
       */
diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx
index e061f15c2164..3b3cde267df7 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx
@@ -57,24 +57,6 @@ Trk::EnergyLossUpdator::EnergyLossUpdator(const std::string &t, const std::strin
   declareProperty("OptimalRadiation", m_optimalRadiation);
 }
 
-// destructor
-Trk::EnergyLossUpdator::~EnergyLossUpdator() {
-}
-
-// Athena standard methods
-// initialize
-StatusCode
-Trk::EnergyLossUpdator::initialize() {
-  ATH_MSG_INFO("initialize()");
-  return StatusCode::SUCCESS;
-}
-
-// finalize
-StatusCode
-Trk::EnergyLossUpdator::finalize() {
-  ATH_MSG_INFO("finalize() successful");
-  return StatusCode::SUCCESS;
-}
 
 // public interface method
 double
diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx
index f2b290f55545..5340f8a854f4 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx
@@ -447,7 +447,6 @@ Trk::Extrapolator::finalize()
                  << Trk::Extrapolator::Cache::s_containerSizeMax.val());
   }
 
-  ATH_MSG_INFO("finalize() successful");
   return StatusCode::SUCCESS;
 }
 
diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx
index 37cc7d4c7327..1478dc36f732 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx
@@ -97,13 +97,6 @@ Trk::MultipleScatteringUpdator::initialize() {
   return StatusCode::SUCCESS;
 }
 
-// finalize
-StatusCode
-Trk::MultipleScatteringUpdator::finalize() {
-  ATH_MSG_INFO("finalize() successful");
-  return StatusCode::SUCCESS;
-}
-
 double
 Trk::MultipleScatteringUpdator::sigmaSquare(const MaterialProperties &mat,
                                             double p,
diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx
index 3ab740e92dba..591357e4341a 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx
@@ -90,7 +90,7 @@ Trk::Navigator::initialize() {
   // get the TrackingGeometrySvc
   if (!m_useConditions) {
     if (m_trackingGeometrySvc.retrieve().isSuccess()) {
-      ATH_MSG_INFO("Successfully retrieved " << m_trackingGeometrySvc);
+      ATH_MSG_DEBUG("Successfully retrieved " << m_trackingGeometrySvc);
       m_trackingGeometryName = m_trackingGeometrySvc->trackingGeometryName();
     } else {
       ATH_MSG_WARNING("Couldn't retrieve " << m_trackingGeometrySvc << ". ");
@@ -108,7 +108,6 @@ Trk::Navigator::initialize() {
   //This is no-op for the Navigator only relevant for
   //derivated Validation for now
   validationInitialize();
-  ATH_MSG_DEBUG("initialize() successful");
   return StatusCode::SUCCESS;
 }
 
@@ -614,7 +613,6 @@ Trk::Navigator::finalize() {
     ATH_MSG_DEBUG(" ---------------------------------------------------------------------");
   }
 
-  ATH_MSG_INFO("finalize() successful");
   return StatusCode::SUCCESS;
 }
 
-- 
GitLab


From 34f28209294683746b583646ad7d79b03da40fc6 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Thu, 17 Sep 2020 12:46:45 +0000
Subject: [PATCH 192/422] SchedulerMonSvc: add more histograms and clean up
 python configuration

---
 .../python/TrigSteerMonitorConfig.py          | 70 +++++++++++--------
 .../TrigSteerMonitor/src/SchedulerMonSvc.cxx  | 68 ++++++++++++++++--
 2 files changed, 105 insertions(+), 33 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py b/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py
index 3b6a9030b494..99c55a625895 100644
--- a/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py
+++ b/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py
@@ -8,39 +8,53 @@ def SchedulerMonSvcCfg(flags, name='SchedulerMonSvc'):
     monsvc = CompFactory.SchedulerMonSvc(name)
     monsvc.MonTool = GenericMonitoringTool('MonTool', HistPath='HLTFramework/'+name)
 
+    # Plots vs snapshot number can be enabled with flags.SchedulerMonSvc.enablePlotsVsSnapNumber
+    # They are disabled by default as they don't give much information on top of the plots vs walltime
+    enablePlotsVsSnapNumber = False
+    if flags.hasCategory('SchedulerMonSvc') and flags.SchedulerMonSvc.hasFlag('enablePlotsVsSnapNumber'):
+        enablePlotsVsSnapNumber = flags.SchedulerMonSvc.enablePlotsVsSnapNumber
+
     # From GaudiHive AlgsExecutionStates::State enum
     stateNames = ['INITIAL', 'CONTROLREADY', 'DATAREADY', 'RESOURCELESS',
                   'SCHEDULED', 'EVTACCEPTED', 'EVTREJECTED', 'ERROR']
+    activeStates = ['CONTROLREADY', 'DATAREADY', 'RESOURCELESS', 'SCHEDULED']
+
+    # Helper functions
+    def defineHist1D(varName, varLabel, labels=None, **kwargs):
+        monsvc.MonTool.defineHistogram(varName, path='EXPERT', type='TH1D',
+                                title=varLabel+';'+varLabel+';Snapshots',
+                                xlabels=labels, opt='kCanRebin', **kwargs)
+
+    def defineHistVsWallTime(varName, varLabel, _type, labels=None, **kwargs):
+        monsvc.MonTool.defineHistogram(
+            'WallTimeSeconds,'+varName, path='EXPERT', type=_type,
+            title=varLabel+' vs time;Time [s];'+varLabel,
+            xbins=600, xmin=0, xmax=60, ylabels=labels, opt='kCanRebin', **kwargs)
+
+    def defineHistVsSnapNumber(varName, varLabel, _type, labels=None, **kwargs):
+        monsvc.MonTool.defineHistogram(
+            'SnapNumber,'+varName, path='EXPERT', type=_type,
+            title=varLabel+' vs time (snap number);Snap number;'+varLabel,
+            xbins=1000, xmin=0, xmax=1000, ylabels=labels, opt='kCanRebin', **kwargs)
+
+    def defineStandardHistogramSet(varName, varLabel, nbins, min, max, labels=None, type2D='TProfile', **kwargs):
+        defineHist1D(varName, varLabel, labels, xbins=nbins, xmin=min, xmax=max, **kwargs)
+        defineHistVsWallTime(varName, varLabel, type2D, labels, ybins=nbins, ymin=min, ymax=max, **kwargs)
+        if enablePlotsVsSnapNumber:
+            defineHistVsSnapNumber(varName, varLabel, type2D, labels, ybins=nbins, ymin=min, ymax=max, **kwargs)
+
+    # Histogram definitions
+    defineStandardHistogramSet('AlgStates', 'Algorithm state', 8, -0.5, 7.5, labels=stateNames, type2D='TH2D', weight='StateTotalCounts')
+    defineStandardHistogramSet('FreeSlots', 'Number of free slots', 10, 0, 10)
+    for state in stateNames:
+        defineStandardHistogramSet(state, 'N algs in '+state+' state', 100, 0, 100)
+    for state in activeStates:
+        defineStandardHistogramSet(state+'_Over_Threads', 'N '+state+' / N threads', 100, 0, 10)
+        defineStandardHistogramSet(state+'_Over_Active', 'N '+state+' / N active states', 100, 0, 1)
 
-    monsvc.MonTool.defineHistogram('SnapNumber,AlgStates', weight='StateTotalCounts', path='EXPERT', type='TH2D',
-                            title='Scheduler algorithm states vs time (snap number);Snap number;Algorithm state',
-                            xbins=1000, xmin=0, xmax=1000,
-                            ybins=8, ymin=-0.5, ymax=7.5, ylabels=stateNames,
-                            opt='kCanRebin')
-    monsvc.MonTool.defineHistogram('WallTimeSeconds,AlgStates', weight='StateTotalCounts', path='EXPERT', type='TH2D',
-                            title='Scheduler algorithm states vs time;Time [s];Algorithm state',
-                            xbins=600, xmin=0, xmax=60,
-                            ybins=8, ymin=-0.5, ymax=7.5, ylabels=stateNames,
-                            opt='kCanRebin')
-    monsvc.MonTool.defineHistogram('SnapNumber,FreeSlots', path='EXPERT', type='TProfile',
-                            title='Number of free slots vs time (snap number);Snap number;Number of free slots',
-                            xbins=1000, xmin=0, xmax=1000,
-                            ybins=10, ymin=0, ymax=10,
-                            opt='kCanRebin')
-    monsvc.MonTool.defineHistogram('WallTimeSeconds,FreeSlots', path='EXPERT', type='TProfile',
-                            title='Number of free slots vs time ;Time [s];Number of free slots',
-                            xbins=600, xmin=0, xmax=60,
-                            ybins=10, ymin=0, ymax=10,
-                            opt='kCanRebin')
-    monsvc.MonTool.defineHistogram('AlgStates', weight='StateTotalCounts', path='EXPERT', type='TH1D',
-                            title='Scheduler algorithm states;Algorithm states;Snapshots',
-                            xbins=8, xmin=-0.5, xmax=7.5, xlabels=stateNames)
-    monsvc.MonTool.defineHistogram('FreeSlots', path='EXPERT', type='TH1D',
-                            title='Number of free slots;Free slots;Snapshots',
-                            xbins=10, xmin=0, xmax=10, opt='kCanRebin')
     monsvc.MonTool.defineHistogram('TIME_monCallback', path='EXPERT', type='TH1D',
-                            title='Time of callback calls;Time [us];Calls',
-                            xbins=500, xmin=0, xmax=5000)
+                                    title='Time of callback calls;Time [us];Calls',
+                                    xbins=500, xmin=0, xmax=5000)
 
     acc = ComponentAccumulator()
     acc.addService(monsvc)
diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/src/SchedulerMonSvc.cxx b/Trigger/TrigMonitoring/TrigSteerMonitor/src/SchedulerMonSvc.cxx
index e6665eb8afa7..25d833903861 100644
--- a/Trigger/TrigMonitoring/TrigSteerMonitor/src/SchedulerMonSvc.cxx
+++ b/Trigger/TrigMonitoring/TrigSteerMonitor/src/SchedulerMonSvc.cxx
@@ -4,10 +4,39 @@
 
 #include "SchedulerMonSvc.h"
 
+using namespace std::string_literals;
+using namespace std::literals::string_view_literals;
+
 namespace {
-  /// This is AlgsExecutionStates::State::MAXVALUE which cannot be used here directly because it is not in a public header
-  static constexpr size_t s_numAlgStates = 8;
+  /// This is AlgsExecutionStates::State which cannot be used here directly because it is not in a public header
+  enum class AlgState : size_t {
+    INITIAL      = 0,
+    CONTROLREADY = 1,
+    DATAREADY    = 2,
+    RESOURCELESS = 3,
+    SCHEDULED    = 4,
+    EVTACCEPTED  = 5,
+    EVTREJECTED  = 6,
+    ERROR        = 7,
+    MAXVALUE     = 8
+  };
+  /// AlgState enum as strings
+  static constexpr std::array<std::string_view,8> s_algStateNames = {{
+    "INITIAL"sv, "CONTROLREADY"sv, "DATAREADY"sv, "RESOURCELESS"sv, "SCHEDULED"sv, "EVTACCEPTED"sv, "EVTREJECTED"sv, "ERROR"sv
+  }};
+  /// AlgState enum as size_t
   static constexpr std::array<size_t,8> s_algStateNumbers = {0,1,2,3,4,5,6,7};
+  /// AlgStates counted as "active"
+  static constexpr std::array<size_t,4> s_activeAlgStateNumbers = {
+    static_cast<size_t>(AlgState::CONTROLREADY),
+    static_cast<size_t>(AlgState::DATAREADY),
+    static_cast<size_t>(AlgState::RESOURCELESS),
+    static_cast<size_t>(AlgState::SCHEDULED)
+  };
+  /// Cast two numbers to double and divide one by the other
+  template<typename Ta, typename Tb> constexpr double divAsDouble(const Ta& a, const Tb& b) {
+    return static_cast<double>(a) / static_cast<double>(b);
+  }
 }
 
 // =============================================================================
@@ -31,6 +60,9 @@ StatusCode SchedulerMonSvc::startMonitoring() {
     }
   }
 
+  // Get the number of threads
+  int numThreads = std::stoi( SmartIF<IProperty>(m_scheduler)->getProperty("ThreadPoolSize").toString() );
+
   // Flag the monitoring as running (prevents going past this point twice)
   if (bool expected = false; not m_running.compare_exchange_strong(expected, true)) {
     ATH_MSG_ERROR("startMonitoring called but it is already running");
@@ -38,7 +70,7 @@ StatusCode SchedulerMonSvc::startMonitoring() {
   }
 
   // Construct the callback and pass it to the scheduler monitoring API
-  auto monCallback = [this](IScheduler::OccupancySnapshot snap) -> void {
+  auto monCallback = [this, &numThreads](IScheduler::OccupancySnapshot snap) -> void {
     auto monTime = Monitored::Timer("TIME_monCallback");
     // Calculate and update snap counters
     const ClockType::duration wallTime = snap.time - m_startTime;
@@ -53,7 +85,7 @@ StatusCode SchedulerMonSvc::startMonitoring() {
     }
 
     // Monitor total state counts across all slots
-    std::vector<int> stateTotalCounts(s_numAlgStates, 0);
+    std::vector<int> stateTotalCounts(static_cast<size_t>(AlgState::MAXVALUE), 0);
     for (size_t slot=0; slot < snap.states.size(); ++slot) {
       for (size_t state=0; state < snap.states[slot].size(); ++state) {
         stateTotalCounts[state] += snap.states[slot][state];
@@ -62,15 +94,41 @@ StatusCode SchedulerMonSvc::startMonitoring() {
     auto mon_stateNumber = Monitored::Collection("AlgStates", s_algStateNumbers);
     auto mon_stateTotalCounts = Monitored::Collection("StateTotalCounts", stateTotalCounts);
 
+    // Monitor alg state counts absolute numbers and ratios to N threads and N active states
+    std::vector<Monitored::Scalar<int>> mon_stateCounts;
+    std::vector<Monitored::Scalar<double>> mon_stateCountsOverThreads;
+    std::vector<Monitored::Scalar<double>> mon_stateCountsOverActive;
+    mon_stateCounts.reserve(static_cast<size_t>(AlgState::MAXVALUE));
+    mon_stateCountsOverThreads.reserve(static_cast<size_t>(AlgState::MAXVALUE));
+    mon_stateCountsOverActive.reserve(static_cast<size_t>(AlgState::MAXVALUE));
+    int activeCount = 0;
+    for (size_t i : s_activeAlgStateNumbers) {
+      activeCount += stateTotalCounts[i];
+    }
+    for (size_t i : s_algStateNumbers) {
+      mon_stateCounts.emplace_back(s_algStateNames[i].data(), stateTotalCounts[i]);
+      mon_stateCountsOverThreads.emplace_back(s_algStateNames[i].data()+"_Over_Threads"s, divAsDouble(stateTotalCounts[i], numThreads));
+      double toActive = (activeCount > 0) ? divAsDouble(stateTotalCounts[i], activeCount) : 0;
+      mon_stateCountsOverActive.emplace_back(s_algStateNames[i].data()+"_Over_Active"s, toActive);
+    }
+
     // Monitor number of free slots
     auto mon_freeSlots = Monitored::Scalar("FreeSlots", m_scheduler->freeSlots());
 
+    // Reserve vector of references with size equal to the number of variables added into the vector in the loop below
+    std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> allMonVars;
+    allMonVars.reserve(5 + mon_stateCounts.size() + mon_stateCountsOverThreads.size() + mon_stateCountsOverActive.size());
     // Fill monitoring histograms once for each sampling period passed since the last fill
     // If multiple sampling periods passed, it means the scheduler state didn't change during that time
     for (size_t snapNumber=lastSnapCounter+1; snapNumber<=thisSnapCounter; ++snapNumber) {
       auto mon_snapNumber = Monitored::Scalar("SnapNumber", snapNumber);
       auto mon_wallTimeSec = Monitored::Scalar("WallTimeSeconds", snapNumber*m_samplingPeriodMillisec.value()*1e-3);
-      Monitored::Group(m_monTool, mon_snapNumber, mon_wallTimeSec, mon_freeSlots, mon_stateNumber, mon_stateTotalCounts);
+      allMonVars.clear();
+      allMonVars.insert(allMonVars.end(), mon_stateCounts.begin(), mon_stateCounts.end());
+      allMonVars.insert(allMonVars.end(), mon_stateCountsOverThreads.begin(), mon_stateCountsOverThreads.end());
+      allMonVars.insert(allMonVars.end(), mon_stateCountsOverActive.begin(), mon_stateCountsOverActive.end());
+      allMonVars.insert(allMonVars.end(), {mon_stateNumber, mon_stateTotalCounts, mon_freeSlots, mon_snapNumber, mon_wallTimeSec});
+      Monitored::Group(m_monTool, allMonVars);
     }
     monTime.stop();
     Monitored::Group(m_monTool, monTime);
-- 
GitLab


From 8052631123c218d5615e558f57f83a10097e65e9 Mon Sep 17 00:00:00 2001
From: Johannes Josef Junggeburth <johannes.josef.junggeburth@cern.ch>
Date: Thu, 17 Sep 2020 12:53:21 +0000
Subject: [PATCH 193/422] Insert smart pointers in the MuonDetectorManager

---
 .../MuonReadoutGeometry/MuonDetectorManager.h |  34 +--
 .../src/MuonDetectorManager.cxx               | 224 +++++-------------
 2 files changed, 75 insertions(+), 183 deletions(-)

diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h
index f1ca79d974de..869cff1fa435 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h
@@ -106,15 +106,21 @@ namespace MuonGM {
 
     const MuonClusterReadoutElement* getMuonClusterReadoutElement(Identifier) const;//!< access via extended identifier (requires unpacking)
 
+    /// Returns the const detector readout elements
     const MdtReadoutElement* getMdtReadoutElement(int i1, int i2, int i3, int i4) const;
-    MdtReadoutElement* getMdtReadoutElement(int i1, int i2, int i3, int i4);
     const sTgcReadoutElement* getsTgcReadoutElement(int i1, int i2, int i3, int i4) const;
     const MMReadoutElement* getMMReadoutElement(int i1, int i2, int i3, int i4) const;
     const TgcReadoutElement* getTgcReadoutElement(int i1, int i2, int i3) const;
-    TgcReadoutElement* getTgcReadoutElement(int i1, int i2, int i3);
     const CscReadoutElement* getCscReadoutElement(int i1, int i2, int i3, int i4) const;
+
+    //// Non const version
+    MdtReadoutElement* getMdtReadoutElement(int i1, int i2, int i3, int i4);
+    sTgcReadoutElement* getsTgcReadoutElement(int i1, int i2, int i3, int i4);
+    MMReadoutElement* getMMReadoutElement(int i1, int i2, int i3, int i4);
+    TgcReadoutElement* getTgcReadoutElement(int i1, int i2, int i3);
     CscReadoutElement* getCscReadoutElement(int i1, int i2, int i3, int i4);
 
+
     const MdtReadoutElement* getMdtRElement_fromIdFields(int i1, int i2, int i3, int i4) const;
     //!< access via extended identifier field (no unpacking)
 
@@ -397,19 +403,19 @@ namespace MuonGM {
     const MmIdHelper* m_mmIdHelper;
 
     // 115.6 kBytes.
-    MdtReadoutElement*   m_mdtArray[NMdtStatType][NMdtStatEta][NMdtStatPhi][NMdtMultilayer];
-    CscReadoutElement*   m_cscArray[NCscStatType][NCscStatEta][NCscStatPhi][NCscChamberLayer];
-    RpcReadoutElement*   m_rpcArray[NRpcStatType][NRpcStatEta][NRpcStatPhi][NDoubletR][NDoubletZ];
-    TgcReadoutElement*   m_tgcArray[NTgcStatType][NTgcStatEta][NTgcStatPhi];
-    sTgcReadoutElement*  m_stgArray[NsTgStatEta][NsTgStatPhi][NsTgChamberLayer];
-    MMReadoutElement*    m_mmcArray[NMMcStatEta][NMMcStatPhi][NMMcChamberLayer];
+    std::unique_ptr<MdtReadoutElement>   m_mdtArray[NMdtStatType][NMdtStatEta][NMdtStatPhi][NMdtMultilayer];
+    std::unique_ptr<CscReadoutElement>   m_cscArray[NCscStatType][NCscStatEta][NCscStatPhi][NCscChamberLayer];
+    std::unique_ptr<RpcReadoutElement>   m_rpcArray[NRpcStatType][NRpcStatEta][NRpcStatPhi][NDoubletR][NDoubletZ];
+    std::unique_ptr<TgcReadoutElement>   m_tgcArray[NTgcStatType][NTgcStatEta][NTgcStatPhi];
+    std::unique_ptr<sTgcReadoutElement>  m_stgArray[NsTgStatEta][NsTgStatPhi][NsTgChamberLayer];
+    std::unique_ptr<MMReadoutElement>    m_mmcArray[NMMcStatEta][NMMcStatPhi][NMMcChamberLayer];
     //
     const MdtReadoutElement *m_mdtArrayByHash[MdtRElMaxHash];
     const CscReadoutElement *m_cscArrayByHash[CscRElMaxHash];
     const RpcReadoutElement *m_rpcArrayByHash[RpcRElMaxHash];
     const TgcReadoutElement *m_tgcArrayByHash[TgcRElMaxHash];
 
-    std::map< std::string, MuonStation * > m_MuonStationMap;
+    std::map< std::string, std::unique_ptr<MuonStation> > m_MuonStationMap;
 
     unsigned int m_n_mdtRE;
     unsigned int m_n_cscRE;
@@ -426,10 +432,10 @@ namespace MuonGM {
     // pointers to the XxxDetectorElements (with granularity a la EDM)
     std::vector<std::unique_ptr<const TgcReadoutParams> > m_TgcReadoutParamsVec;
 
-    MdtDetectorElement* m_mdtDEArray[MdtDetElMaxHash];
-    RpcDetectorElement* m_rpcDEArray[RpcDetElMaxHash];
-    TgcDetectorElement* m_tgcDEArray[TgcDetElMaxHash];
-    CscDetectorElement* m_cscDEArray[CscDetElMaxHash];
+    std::unique_ptr<MdtDetectorElement> m_mdtDEArray[MdtDetElMaxHash];
+    std::unique_ptr<RpcDetectorElement> m_rpcDEArray[RpcDetElMaxHash];
+    std::unique_ptr<TgcDetectorElement> m_tgcDEArray[TgcDetElMaxHash];
+    std::unique_ptr<CscDetectorElement> m_cscDEArray[CscDetElMaxHash];
 
     ALineMapContainer m_aLineContainer;
     BLineMapContainer m_bLineContainer;
@@ -438,7 +444,7 @@ namespace MuonGM {
     /// RPC name caches
     std::map<int,int> m_rpcStatToIdx;
     std::map<int,int> m_rpcIdxToStat;
-    
+
 
   };
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx
index 544385e89328..2c7a31795e3f 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx
@@ -32,38 +32,6 @@ namespace MuonGM {
 
 MuonDetectorManager::MuonDetectorManager() {
 
-  for (unsigned int i=0; i<NRpcStatType; i++)
-    for (unsigned int j=0; j<NRpcStatEta; j++)
-      for (unsigned int k=0; k<NRpcStatPhi; k++)
-        for (unsigned int l=0; l<NDoubletR; l++)
-          for (unsigned int h=0; h<NDoubletZ; h++)
-              m_rpcArray[i][j][k][l][h] = nullptr;
-  for (unsigned int i=0; i<NMdtStatType; i++)
-    for (unsigned int j=0; j<NMdtStatEta; j++)
-      for (unsigned int k=0; k<NMdtStatPhi; k++)
-        for (unsigned int l=0; l<NMdtMultilayer; l++)
-                   m_mdtArray[i][j][k][l] = nullptr;
-  for (unsigned int i=0; i<NCscStatType; i++)
-    for (unsigned int j=0; j<NCscStatEta; j++)
-      for (unsigned int k=0; k<NCscStatPhi; k++)
-        for (unsigned int l=0; l<NCscChamberLayer; l++)
-                   m_cscArray[i][j][k][l] = nullptr;
-  for (unsigned int i=0; i<NTgcStatType; i++)
-    for (unsigned int j=0; j<NTgcStatEta; j++)
-      for (unsigned int k=0; k<NTgcStatPhi; k++)
-                 m_tgcArray[i][j][k] = nullptr;
-
-  for (unsigned int j=0; j<NsTgStatEta; j++)
-    for (unsigned int k=0; k<NsTgStatPhi; k++)
-      for (unsigned int l=0; l<NsTgChamberLayer; l++)
-    m_stgArray[j][k][l] = nullptr;
-
-  for (unsigned int j=0; j<NMMcStatEta; j++)
-    for (unsigned int k=0; k<NMMcStatPhi; k++)
-      for (unsigned int l=0; l<NMMcChamberLayer; l++)
-    m_mmcArray[j][k][l] = nullptr;
-
-
   for (unsigned int i=0; i<MdtRElMaxHash; ++i)
       m_mdtArrayByHash[i] = nullptr;
   for (unsigned int i=0; i<CscRElMaxHash; ++i)
@@ -73,14 +41,7 @@ MuonDetectorManager::MuonDetectorManager() {
   for (unsigned int i=0; i<TgcRElMaxHash; ++i)
       m_tgcArrayByHash[i] = nullptr;
 
-     for (unsigned int i=0; i<TgcDetElMaxHash; ++i)
-         m_tgcDEArray[i] = nullptr;
-  for (unsigned int i=0; i<MdtDetElMaxHash; ++i)
-      m_mdtDEArray[i] = nullptr;
-   for (unsigned int i=0; i<CscDetElMaxHash; ++i)
-        m_cscDEArray[i] = nullptr;
-     for (unsigned int i=0; i<RpcDetElMaxHash; ++i)
-        m_rpcDEArray[i] = nullptr;
+
 
   m_n_mdtDE = m_n_cscDE = m_n_tgcDE = m_n_rpcDE = 0;
   m_n_mdtRE = m_n_cscRE = m_n_tgcRE = m_n_rpcRE = m_n_mmcRE = m_n_stgRE = 0;
@@ -108,65 +69,9 @@ MuonDetectorManager::MuonDetectorManager() {
 }
 
 MuonDetectorManager::~MuonDetectorManager() {
-
-
   for (unsigned int p=0;p<m_envelope.size();++p) {
       m_envelope[p]->unref();
   }
-
-
-  for (unsigned int i=0; i<NRpcStatType; ++i)
-    for (unsigned int j=0; j<NRpcStatEta; ++j)
-      for (unsigned int k=0; k<NRpcStatPhi; ++k)
-        for (unsigned int l=0; l<NDoubletR; ++l)
-          for (unsigned int h=0; h<NDoubletZ; ++h) {
-            delete m_rpcArray[i][j][k][l][h]; m_rpcArray[i][j][k][l][h] = nullptr;
-          }
-  for (unsigned int i=0; i<NMdtStatType; ++i)
-    for (unsigned int j=0; j<NMdtStatEta; ++j)
-      for (unsigned int k=0; k<NMdtStatPhi; ++k)
-        for (unsigned int l=0; l<NMdtMultilayer; ++l) {
-          delete m_mdtArray[i][j][k][l]; m_mdtArray[i][j][k][l] = nullptr;
-        }
-  for (unsigned int i=0; i<NTgcStatType; ++i)
-    for (unsigned int j=0; j<NTgcStatEta; ++j)
-      for (unsigned int k=0; k<NTgcStatPhi; ++k) {
-        delete m_tgcArray[i][j][k]; m_tgcArray[i][j][k] = nullptr;
-      }
-  for (unsigned int i=0; i<NCscStatType; ++i)
-    for (unsigned int j=0; j<NCscStatEta; ++j)
-      for (unsigned int k=0; k<NCscStatPhi; ++k)
-        for (unsigned int l=0; l<NCscChamberLayer; ++l) {
-          delete m_cscArray[i][j][k][l]; m_cscArray[i][j][k][l] = nullptr;
-        }
-  for (unsigned int j=0; j<NsTgStatEta; j++)
-    for (unsigned int k=0; k<NsTgStatPhi; k++)
-      for (unsigned int l=0; l<NsTgChamberLayer; l++){
-          delete m_stgArray[j][k][l]; m_stgArray[j][k][l] = nullptr;
-      }
-  for (unsigned int j=0; j<NMMcStatEta; j++)
-    for (unsigned int k=0; k<NMMcStatPhi; k++)
-      for (unsigned int l=0; l<NMMcChamberLayer; l++){
-         delete m_mmcArray[j][k][l]; m_mmcArray[j][k][l] = nullptr;
-      }
-
-  for (unsigned int i=0; i<MdtDetElMaxHash; ++i) {
-    delete m_mdtDEArray[i]; m_mdtDEArray[i] = nullptr;
-  }
-  for (unsigned int i=0; i<RpcDetElMaxHash; ++i) {
-    delete m_rpcDEArray[i]; m_rpcDEArray[i] = nullptr;
-  }
-  for (unsigned int i=0; i<CscDetElMaxHash; ++i) {
-    delete m_cscDEArray[i]; m_cscDEArray[i] = nullptr;
-  }
-  for (unsigned int i=0; i<TgcDetElMaxHash; ++i) {
-    delete m_tgcDEArray[i]; m_tgcDEArray[i] = nullptr;
-  }
-  for (std::map< std::string, MuonStation * >::iterator i =
-           m_MuonStationMap.begin(); i != m_MuonStationMap.end(); ++i)
-  {
-    delete i->second; i->second = nullptr;
-  }
 }
 
 
@@ -299,8 +204,7 @@ void MuonDetectorManager::fillCache()
     fillTgcCache();
     fillCscCache();
 }
-void MuonDetectorManager::fillMdtCache()
-{
+void MuonDetectorManager::fillMdtCache() {
     for (unsigned int i=0; i<NMdtStatType; ++i)
       for (unsigned int j=0; j<NMdtStatEta; ++j)
         for (unsigned int k=0; k<NMdtStatPhi; ++k)
@@ -308,8 +212,7 @@ void MuonDetectorManager::fillMdtCache()
               if (m_mdtArray[i][j][k][l]) m_mdtArray[i][j][k][l]->fillCache();
           }
 }
-void MuonDetectorManager::fillRpcCache()
-{
+void MuonDetectorManager::fillRpcCache() {
     for (unsigned int i=0; i<NRpcStatType; ++i)
       for (unsigned int j=0; j<NRpcStatEta; ++j)
         for (unsigned int k=0; k<NRpcStatPhi; ++k)
@@ -318,16 +221,14 @@ void MuonDetectorManager::fillRpcCache()
               if( m_rpcArray[i][j][k][l][h] ) m_rpcArray[i][j][k][l][h]->fillCache() ;
             }
 }
-void MuonDetectorManager::fillTgcCache()
-{
+void MuonDetectorManager::fillTgcCache() {
     for (unsigned int i=0; i<NTgcStatType; ++i)
       for (unsigned int j=0; j<NTgcStatEta; ++j)
         for (unsigned int k=0; k<NTgcStatPhi; ++k) {
           if ( m_tgcArray[i][j][k] ) m_tgcArray[i][j][k]->fillCache();
         }
 }
-void MuonDetectorManager::fillCscCache()
-{
+void MuonDetectorManager::fillCscCache() {
   if (nCscRE()<1) return;
     for (unsigned int i=0; i<NCscStatType; ++i)
       for (unsigned int j=0; j<NCscStatEta; ++j)
@@ -354,7 +255,7 @@ void MuonDetectorManager::addTreeTop( PVLink pV) {
 void MuonDetectorManager::addMuonStation (MuonStation* mst)
 {
     std::string key = muonStationKey(mst->getStationType(), mst->getEtaIndex(), mst->getPhiIndex());
-    m_MuonStationMap[key] = mst;
+    m_MuonStationMap[key] = std::unique_ptr<MuonStation>(mst);
 }
 
 std::string
@@ -378,8 +279,8 @@ MuonDetectorManager::getMuonStation(std::string stName, int stEtaIndex, int stPh
 
     std::string key = muonStationKey(stName, stEtaIndex, stPhiIndex);
 
-    std::map< std::string, MuonStation *>::const_iterator it = m_MuonStationMap.find(key);
-    if ( it != m_MuonStationMap.end()) return (*it).second;
+    std::map< std::string,  std::unique_ptr<MuonStation>>::const_iterator it = m_MuonStationMap.find(key);
+    if ( it != m_MuonStationMap.end()) return (*it).second.get();
     else return nullptr;
 }
 
@@ -389,8 +290,8 @@ MuonDetectorManager::getMuonStation(std::string stName, int stEtaIndex, int stPh
 
     std::string key = muonStationKey(stName, stEtaIndex, stPhiIndex);
 
-    std::map< std::string, MuonStation *>::const_iterator it = m_MuonStationMap.find(key);
-    if ( it != m_MuonStationMap.end()) return (*it).second;
+    std::map< std::string,  std::unique_ptr<MuonStation>>::const_iterator it = m_MuonStationMap.find(key);
+    if ( it != m_MuonStationMap.end()) return (*it).second.get();
     else return nullptr;
 }
 
@@ -468,7 +369,7 @@ void MuonDetectorManager::addRpcReadoutElement (RpcReadoutElement* x, Identifier
     {
 	if ( !(m_rpcDEArray[idh]) )
 	{
-	    m_rpcDEArray[idh] = new RpcDetectorElement(0, this, m_rpcIdHelper->elementID(id), idh);
+	    m_rpcDEArray[idh] = std::make_unique<RpcDetectorElement>(nullptr, this, m_rpcIdHelper->elementID(id), idh);
 	    m_n_rpcDE++;
 	}
 	m_rpcDEArray[idh]->addRpcReadoutElement(x, dbz_index);
@@ -480,7 +381,7 @@ void MuonDetectorManager::addRpcReadoutElement (RpcReadoutElement* x, Identifier
   if (m_rpcArray[stname_index][steta_index][stphi_index][dbr_index][dbz_index] != nullptr) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addRpcReadoutElement() - this place is taken [%d][%d][%d][%d][%d] current id is %s stored id %s", __FILE__, __LINE__, stname_index, steta_index, stphi_index, dbr_index, dbz_index, m_rpcIdHelper->show_to_string(id).c_str(), m_rpcIdHelper->show_to_string(m_rpcArray[stname_index][steta_index][stphi_index][dbr_index][dbz_index]->identify()).c_str()));
   }
-  m_rpcArray[stname_index][steta_index][stphi_index][dbr_index][dbz_index] = x;
+  m_rpcArray[stname_index][steta_index][stphi_index][dbr_index][dbz_index] = std::unique_ptr<RpcReadoutElement>(x);
   m_n_rpcRE++;
 
 }
@@ -550,7 +451,7 @@ const MMReadoutElement* MuonDetectorManager::getMMRElement_fromIdFields(int isSm
   if (ml_index < 0 || ml_index >= NMMcChamberLayer) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::getMMRElement_fromIdFields() - ml_index out of range %d 0-%d", __FILE__, __LINE__, ml_index, NMMcChamberLayer-1));
   }
-  return m_mmcArray[steta_index][stphi_index][ml_index];
+  return m_mmcArray[steta_index][stphi_index][ml_index].get();
 }
 void MuonDetectorManager::addMMReadoutElement_withIdFields(MMReadoutElement* x, int isSmall, int stEta, int stPhi, int ml)
 {
@@ -572,7 +473,7 @@ void MuonDetectorManager::addMMReadoutElement_withIdFields(MMReadoutElement* x,
   if (m_mmcArray[steta_index][stphi_index][ml_index] != nullptr) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addMMReadoutElement_withIdFields() - this place is taken [%d][%d][%d] ......... this RE cannot be added", __FILE__, __LINE__, steta_index, stphi_index, ml_index));
   }
-  m_mmcArray[steta_index][stphi_index][ml_index] = x;
+  m_mmcArray[steta_index][stphi_index][ml_index] = std::unique_ptr<MMReadoutElement>(x);
   m_n_mmcRE++;
 }
 void MuonDetectorManager::addsTgcReadoutElement_withIdFields(sTgcReadoutElement* x, int isSmall, int stEta, int stPhi, int ml)
@@ -595,7 +496,7 @@ void MuonDetectorManager::addsTgcReadoutElement_withIdFields(sTgcReadoutElement*
   if (m_stgArray[steta_index][stphi_index][ml_index] != nullptr) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addsTgcReadoutElement_withIdFields() - this place is taken [%d][%d][%d] ......... this RE cannot be added", __FILE__, __LINE__, steta_index, stphi_index, ml_index));
   }
-  m_stgArray[steta_index][stphi_index][ml_index] = x;
+  m_stgArray[steta_index][stphi_index][ml_index] = std::unique_ptr<sTgcReadoutElement>(x);
   m_n_stgRE++;
 }
 const sTgcReadoutElement* MuonDetectorManager::getsTgcRElement_fromIdFields(int isSmall, int stEta, int stPhi, int ml) const
@@ -615,7 +516,7 @@ const sTgcReadoutElement* MuonDetectorManager::getsTgcRElement_fromIdFields(int
   if (ml_index < 0 || ml_index >= NsTgChamberLayer) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::getsTgcRElement_fromIdFields() - ml_index out of range %d 0-%d", __FILE__, __LINE__, ml_index, NsTgChamberLayer-1));
   }
-  return m_stgArray[steta_index][stphi_index][ml_index];
+  return m_stgArray[steta_index][stphi_index][ml_index].get();
 }
 
 void MuonDetectorManager::addMMReadoutElement (MMReadoutElement* x, Identifier id)
@@ -659,7 +560,7 @@ void MuonDetectorManager::addMdtReadoutElement (MdtReadoutElement* x, Identifier
     IdentifierHash idh = x->collectionHash();
     if (idh< MdtDetElMaxHash) {
 	if ( !(m_mdtDEArray[idh]) ) {
-	    m_mdtDEArray[idh] = new MdtDetectorElement(0, this, m_mdtIdHelper->elementID(id), idh);
+	    m_mdtDEArray[idh] = std::make_unique<MdtDetectorElement>(nullptr, this, m_mdtIdHelper->elementID(id), idh);
 	    m_n_mdtDE++;
 	}
 	m_mdtDEArray[idh]->addMdtReadoutElement(x, ml);
@@ -699,7 +600,7 @@ void MuonDetectorManager::addMdtReadoutElement (MdtReadoutElement* x, Identifier
   if (m_mdtArray[stname_index][steta_index][stphi_index][ml_index] != nullptr) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addMdtReadoutElement() - this place is taken [%d][%d][%d][%d] current id is %s stored id %s", __FILE__, __LINE__, stname_index, steta_index, stphi_index, ml_index, m_mdtIdHelper->show_to_string(id).c_str(), m_mdtIdHelper->show_to_string(m_mdtArray[stname_index][steta_index][stphi_index][ml_index]->identify()).c_str()));
   }
-  m_mdtArray[stname_index][steta_index][stphi_index][ml_index] = x;
+  m_mdtArray[stname_index][steta_index][stphi_index][ml_index] = std::unique_ptr<MdtReadoutElement>(x);
 
   m_n_mdtRE++;
 }
@@ -746,7 +647,7 @@ void MuonDetectorManager::addCscReadoutElement (CscReadoutElement* x, Identifier
     IdentifierHash idh = x->detectorElementHash();
     if ( idh< CscDetElMaxHash ) {
 	if ( !(m_cscDEArray[idh]) ) {
-	    m_cscDEArray[idh] = new CscDetectorElement(0, this, m_cscIdHelper->elementID(id), idh);
+	    m_cscDEArray[idh] = std::make_unique<CscDetectorElement>(nullptr, this, m_cscIdHelper->elementID(id), idh);
 	    m_n_cscDE++;
 	}
 	m_cscDEArray[idh]->setReadoutElement(x);
@@ -781,7 +682,7 @@ void MuonDetectorManager::addCscReadoutElement (CscReadoutElement* x, Identifier
     if (m_cscArray[stname_index][steta_index][stphi_index][ml_index] != nullptr) {
       throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addCscReadoutElement() - this place is taken [%d][%d][%d][%d] current id is %s stored id %s", __FILE__, __LINE__, stname_index, steta_index, stphi_index, ml_index, m_cscIdHelper->show_to_string(id).c_str(), m_cscIdHelper->show_to_string(m_cscArray[stname_index][steta_index][stphi_index][ml_index]->identify()).c_str()));
     }
-    m_cscArray[stname_index][steta_index][stphi_index][ml_index] = x;
+    m_cscArray[stname_index][steta_index][stphi_index][ml_index] = std::unique_ptr<CscReadoutElement>(x);
     m_n_cscRE++;
 
 }
@@ -825,7 +726,7 @@ void MuonDetectorManager::addTgcReadoutElement (TgcReadoutElement* x, Identifier
     IdentifierHash idh = x->collectionHash();
     if (idh< TgcDetElMaxHash) {
 	if ( !(m_tgcDEArray[idh]) ) {
-	    m_tgcDEArray[idh] = new TgcDetectorElement(0, this, m_tgcIdHelper->elementID(id), idh);
+	    m_tgcDEArray[idh] = std::make_unique<TgcDetectorElement>(nullptr, this, m_tgcIdHelper->elementID(id), idh);
 	    m_n_tgcDE++;
 	}
 	m_tgcDEArray[idh]->setReadoutElement(x);
@@ -853,7 +754,7 @@ void MuonDetectorManager::addTgcReadoutElement (TgcReadoutElement* x, Identifier
       throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addTgcReadoutElement() - this place is taken [%d][%d][%d] current id is %s stored id %s", __FILE__, __LINE__, stname_index, steta_index, stphi_index, m_tgcIdHelper->show_to_string(id).c_str(), m_tgcIdHelper->show_to_string(m_tgcArray[stname_index][steta_index][stphi_index]->identify()).c_str()));
     }
 
-    m_tgcArray[stname_index][steta_index][stphi_index] = x;
+    m_tgcArray[stname_index][steta_index][stphi_index] = std::unique_ptr<TgcReadoutElement>(x);
 
   m_n_tgcRE++;
 }
@@ -922,16 +823,13 @@ void MuonDetectorManager::checkMdtReadoutElementIndices(int i1, int i2, int i3,
   }
 }
 
-const MdtReadoutElement* MuonDetectorManager::getMdtReadoutElement(int i1, int i2, int i3, int i4)const
-{
+const MdtReadoutElement* MuonDetectorManager::getMdtReadoutElement(int i1, int i2, int i3, int i4)const {
   checkMdtReadoutElementIndices(i1, i2, i3, i4);
-  return m_mdtArray[i1][i2][i3][i4];
+  return m_mdtArray[i1][i2][i3][i4].get();
 }
-
-MdtReadoutElement* MuonDetectorManager::getMdtReadoutElement(int i1, int i2, int i3, int i4)
-{
+MdtReadoutElement* MuonDetectorManager::getMdtReadoutElement(int i1, int i2, int i3, int i4) {
   checkMdtReadoutElementIndices(i1, i2, i3, i4);
-  return m_mdtArray[i1][i2][i3][i4];
+  return m_mdtArray[i1][i2][i3][i4].get();
 }
 
 const CscReadoutElement* MuonDetectorManager::getCscRElement_fromIdFields(int i1,
@@ -964,22 +862,22 @@ void MuonDetectorManager::checkCscReadoutElementIndices(int i1, int i2, int i3,
   }
 }
 
-const CscReadoutElement* MuonDetectorManager::getCscReadoutElement(int i1, int i2, int i3, int i4)const
-{
+const CscReadoutElement* MuonDetectorManager::getCscReadoutElement(int i1, int i2, int i3, int i4)const {
   checkCscReadoutElementIndices(i1, i2, i3, i4);
-  return m_cscArray[i1][i2][i3][i4];
+  return m_cscArray[i1][i2][i3][i4].get();
 }
 
-CscReadoutElement* MuonDetectorManager::getCscReadoutElement(int i1, int i2, int i3, int i4)
-{
+CscReadoutElement* MuonDetectorManager::getCscReadoutElement(int i1, int i2, int i3, int i4) {
   checkCscReadoutElementIndices(i1, i2, i3, i4);
-  return m_cscArray[i1][i2][i3][i4];
+  return m_cscArray[i1][i2][i3][i4].get();
 }
 
 const RpcReadoutElement* MuonDetectorManager::getRpcRElement_fromIdFields(int i1,
                                                                           int i2,
-                                                                          int i3, int i4, int i5, int i6) const
-{
+                                                                          int i3,
+                                                                          int i4,
+                                                                          int i5,
+                                                                          int i6) const {
       int steta_index  = i2 + NRpcStEtaOffset;
       int stphi_index  = i3 - 1;
       int dbr_index    = i4 - 1;
@@ -1048,16 +946,14 @@ void MuonDetectorManager::checkRpcReadoutElementIndices(int i1, int i2, int i3,
   }
 }
 
-const RpcReadoutElement* MuonDetectorManager::getRpcReadoutElement(int i1, int i2, int i3, int i4, int i5)const
-{
+const RpcReadoutElement* MuonDetectorManager::getRpcReadoutElement(int i1, int i2, int i3, int i4, int i5)const {
   checkRpcReadoutElementIndices(i1, i2, i3, i4, i5);
-  return m_rpcArray[i1][i2][i3][i4][i5];
+  return m_rpcArray[i1][i2][i3][i4][i5].get();
 }
 
-RpcReadoutElement* MuonDetectorManager::getRpcReadoutElement(int i1, int i2, int i3, int i4, int i5)
-{
+RpcReadoutElement* MuonDetectorManager::getRpcReadoutElement(int i1, int i2, int i3, int i4, int i5) {
   checkRpcReadoutElementIndices(i1, i2, i3, i4, i5);
-  return m_rpcArray[i1][i2][i3][i4][i5];
+  return m_rpcArray[i1][i2][i3][i4][i5].get();
 }
 
 const TgcReadoutElement* MuonDetectorManager::getTgcRElement_fromIdFields(int i1,
@@ -1073,8 +969,7 @@ const TgcReadoutElement* MuonDetectorManager::getTgcRElement_fromIdFields(int i1
     return getTgcReadoutElement(stname_index, steta_index, stphi_index);
 }
 
-void MuonDetectorManager::checkTgcReadoutElementIndices (int i1, int i2, int i3)const
-{
+void MuonDetectorManager::checkTgcReadoutElementIndices (int i1, int i2, int i3)const {
   if (i1<0 || i1 >= NTgcStatType) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::getTgcReadoutElement() - stNameindex out of range %d 0-%d", __FILE__, __LINE__, i1, NTgcStatType-1));
   }
@@ -1086,16 +981,13 @@ void MuonDetectorManager::checkTgcReadoutElementIndices (int i1, int i2, int i3)
   }
 }
 
-const TgcReadoutElement* MuonDetectorManager::getTgcReadoutElement(int i1, int i2, int i3)const
-{
+const TgcReadoutElement* MuonDetectorManager::getTgcReadoutElement(int i1, int i2, int i3) const {
   checkTgcReadoutElementIndices (i1, i2, i3);
-  return m_tgcArray[i1][i2][i3];
+  return m_tgcArray[i1][i2][i3].get();
 }
-
-TgcReadoutElement* MuonDetectorManager::getTgcReadoutElement(int i1, int i2, int i3)
-{
+TgcReadoutElement* MuonDetectorManager::getTgcReadoutElement(int i1, int i2, int i3) {
   checkTgcReadoutElementIndices (i1, i2, i3);
-  return m_tgcArray[i1][i2][i3];
+  return m_tgcArray[i1][i2][i3].get();
 }
 
 void
@@ -1108,10 +1000,8 @@ MuonDetectorManager::initABlineContainers()
     if (log.level()<=MSG::DEBUG) log << MSG::DEBUG << "Init A/B Line Containers - pointers are <" <<(uintptr_t)&m_aLineContainer << "> and <" << (uintptr_t)&m_bLineContainer << ">" << endmsg;
 
     // loop over stations to fill the A-line map at start-up
-    for (std::map< std::string, MuonStation * >::const_iterator ist=m_MuonStationMap.begin();
-         ist!=m_MuonStationMap.end(); ++ist)
-    {
-        MuonStation * ms = (*ist).second;
+    for (auto&  ist :m_MuonStationMap) {
+        MuonStation * ms = ist.second.get();
         int jff = ms->getPhiIndex();
         int jzz = ms->getEtaIndex();
         std::string stType = ms->getStationType();
@@ -1211,9 +1101,8 @@ MuonDetectorManager::updateAlignment(const ALineMapContainer& alineData)
 {
 #ifdef TESTBLINES
   {
-    for (std::map< std::string, MuonStation *>::const_iterator it(m_MuonStationMap.begin()), end(m_MuonStationMap.end());
-	it!=end; ++it) {
-      MuonStation* station = it->second;
+   for (auto& it: m_MuonStationMap) {
+      MuonStation* station = it.second.get();
       station->setDelta_fromAline( 0., 0., 0., 0., 0., 0.); //double tras, double traz, double trat, double rots, double rotz, double rott
       if (cacheFillingFlag())
       {
@@ -1361,9 +1250,8 @@ MuonDetectorManager::updateDeformations(const BLineMapContainer& blineData)
 {
 #ifdef TESTBLINES
   {
-    for (std::map< std::string, MuonStation *>::const_iterator it(m_MuonStationMap.begin()), end(m_MuonStationMap.end());
-	it!=end; ++it) {
-      MuonStation* station = it->second;
+    for (auto& it : m_MuonStationMap) {
+      MuonStation* station = it.second.get();
       station->clearBLineCache();
       BLinePar* BLine = new BLinePar();
       BLine->setParameters(0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.);
@@ -1517,10 +1405,8 @@ StatusCode MuonDetectorManager::initCSCInternalAlignmentMap()
       log<<MSG::INFO<<"Init of CSC I-Lines will be done via Conditions DB"<<endmsg;
       m_cscALineContainer.clear();
 
-      for (std::map< std::string, MuonStation * >::const_iterator ist=m_MuonStationMap.begin();
-           ist!=m_MuonStationMap.end(); ++ist)
-      {
-          MuonStation * ms = (*ist).second;
+      for (auto& ist :m_MuonStationMap){
+          MuonStation * ms = ist.second.get();
           std::string stType = ms->getStationType();
           if (stType.substr(0,1)!="C") continue;
 
@@ -1830,7 +1716,7 @@ const MdtDetectorElement* MuonDetectorManager::getMdtDetectorElement(IdentifierH
     return nullptr;
   }
 #endif
-  return m_mdtDEArray[id];
+  return m_mdtDEArray[id].get();
 }
 
 const TgcDetectorElement* MuonDetectorManager::getTgcDetectorElement(IdentifierHash id) const {
@@ -1841,7 +1727,7 @@ const TgcDetectorElement* MuonDetectorManager::getTgcDetectorElement(IdentifierH
     return nullptr;
   }
 #endif
-  return m_tgcDEArray[id];
+  return m_tgcDEArray[id].get();
 }
 
 const CscDetectorElement* MuonDetectorManager::getCscDetectorElement(IdentifierHash id) const {
@@ -1852,7 +1738,7 @@ const CscDetectorElement* MuonDetectorManager::getCscDetectorElement(IdentifierH
     return nullptr;
   }
 #endif
-  return m_cscDEArray[id];
+  return m_cscDEArray[id].get();
 }
 
 const RpcDetectorElement* MuonDetectorManager::getRpcDetectorElement(IdentifierHash id) const {
@@ -1863,7 +1749,7 @@ const RpcDetectorElement* MuonDetectorManager::getRpcDetectorElement(IdentifierH
     return nullptr;
   }
 #endif
-  return m_rpcDEArray[id];
+  return m_rpcDEArray[id].get();
 }
 
 unsigned int MuonDetectorManager::rpcStationTypeIdx(const int stationName) const {
-- 
GitLab


From 3a6ca13f7bcac0b94d58f3e2c4bce84d3b5adb06 Mon Sep 17 00:00:00 2001
From: Heather Russell <heather.russell@cern.ch>
Date: Thu, 17 Sep 2020 13:00:01 +0000
Subject: [PATCH 194/422] add functionality for muXnoL1 combined chains

---
 .../share/ref_RDOtoRDOTrig_mt1_build.ref      | 319 +++++++++---------
 .../share/ref_data_v1Dev_build.ref            | 319 +++++++++---------
 .../TriggerJobOpts/python/TriggerConfig.py    |   5 +-
 .../Menu/ChainConfigurationBase.py            |  25 +-
 .../HLTMenuConfig/Menu/ChainDictTools.py      |   2 +-
 .../python/HLTMenuConfig/Menu/ChainMerging.py |  25 +-
 .../HLTMenuConfig/Menu/DictFromChainName.py   |  17 +-
 .../HLTMenuConfig/Menu/GenerateMenuMT.py      | 219 ++++++------
 .../python/HLTMenuConfig/Menu/LS2_v1.py       |   1 +
 .../HLTMenuConfig/Menu/MenuAlignmentTools.py  |  71 ++--
 .../HLTMenuConfig/Menu/MenuComponents.py      |   7 +-
 .../HLTMenuConfig/Menu/SignatureDicts.py      | 183 +++++-----
 .../Muon/GenerateMuonChainDefs.py             |  16 -
 13 files changed, 635 insertions(+), 574 deletions(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
index a180a162a138..ddd1fe7f5676 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
@@ -20,11 +20,11 @@ TrigSignatureMoniMT                                 INFO HLT_2g35_medium_L12EM20
 TrigSignatureMoniMT                                 INFO -- #3965466087 Events         2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3965466087 Features                             0          0          0          0          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_2j330_a10t_lcw_jes_35smcINF_L1J100 #1295975955
-TrigSignatureMoniMT                                 INFO -- #1295975955 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1295975955 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #1295975955 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1295975955 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_2j60_L1J15 #927735533
-TrigSignatureMoniMT                                 INFO -- #927735533 Events          20         20         0          0          0          0          0          0          0          0          0          0          10         -          10
-TrigSignatureMoniMT                                 INFO -- #927735533 Features                              0          0          0          0          0          0          0          0          0          0          28         -
+TrigSignatureMoniMT                                 INFO -- #927735533 Events          20         20         0          0          0          0          0          0          0          0          0          10         -          -          10
+TrigSignatureMoniMT                                 INFO -- #927735533 Features                              0          0          0          0          0          0          0          0          0          28         -          -
 TrigSignatureMoniMT                                 INFO HLT_2mu10_bJpsimumu_L12MU10 #3498558358
 TrigSignatureMoniMT                                 INFO -- #3498558358 Events         3          3          0          0          0          0          3          3          3          2          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3498558358 Features                             0          0          0          0          12         12         16         4          -          -          -          -
@@ -68,11 +68,11 @@ TrigSignatureMoniMT                                 INFO HLT_2mu6_muonqual_L12MU
 TrigSignatureMoniMT                                 INFO -- #2398136098 Events         4          4          0          0          0          0          4          3          3          3          -          -          -          -          3
 TrigSignatureMoniMT                                 INFO -- #2398136098 Features                             0          0          0          0          16         12         18         16         -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_3j200_L1J100 #2199422919
-TrigSignatureMoniMT                                 INFO -- #2199422919 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #2199422919 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #2199422919 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2199422919 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_3j200_L1J20 #493765146
-TrigSignatureMoniMT                                 INFO -- #493765146 Events          19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #493765146 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #493765146 Events          19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #493765146 Features                              0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_3mu6_L13MU6 #1832399408
 TrigSignatureMoniMT                                 INFO -- #1832399408 Events         0          0          0          0          0          0          0          0          0          0          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1832399408 Features                             0          0          0          0          0          0          0          0          -          -          -          -
@@ -86,8 +86,8 @@ TrigSignatureMoniMT                                 INFO HLT_4mu4_L14MU4 #183438
 TrigSignatureMoniMT                                 INFO -- #1834383636 Events         0          0          0          0          0          0          0          0          0          0          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1834383636 Features                             0          0          0          0          0          0          0          0          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_5j70_0eta240_L14J20 #1175391812
-TrigSignatureMoniMT                                 INFO -- #1175391812 Events         7          7          0          0          0          0          0          0          0          0          0          0          1          -          1
-TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          0          5          -
+TrigSignatureMoniMT                                 INFO -- #1175391812 Events         7          7          0          0          0          0          0          0          0          0          0          1          -          -          1
+TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          5          -          -
 TrigSignatureMoniMT                                 INFO HLT_beamspot_allTE_trkfast_BeamSpotPEB_L1J15 #3989372080
 TrigSignatureMoniMT                                 INFO -- #3989372080 Events         20         20         20         20         -          -          -          -          -          -          -          -          -          -          20
 TrigSignatureMoniMT                                 INFO -- #3989372080 Features                             20         20         -          -          -          -          -          -          -          -          -          -
@@ -221,131 +221,131 @@ TrigSignatureMoniMT                                 INFO HLT_g5_tight_L1EM3 #328
 TrigSignatureMoniMT                                 INFO -- #3280865118 Events         20         20         16         16         16         9          -          -          -          -          -          -          -          -          9
 TrigSignatureMoniMT                                 INFO -- #3280865118 Features                             45         45         84         9          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_j0_perf_L1J12_EMPTY #1341875780
-TrigSignatureMoniMT                                 INFO -- #1341875780 Events         0          0          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1341875780 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #1341875780 Events         0          0          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1341875780 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151
-TrigSignatureMoniMT                                 INFO -- #4034799151 Events         19         19         0          0          0          0          0          0          0          0          0          0          15         -          15
-TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             0          0          0          0          0          0          0          0          0          0          402        -
+TrigSignatureMoniMT                                 INFO -- #4034799151 Events         19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             0          0          0          0          0          0          0          0          0          402        -          -
 TrigSignatureMoniMT                                 INFO HLT_j225_ftf_subjesgscIS_bmv2c1040_split_L1J100 #3992507557
-TrigSignatureMoniMT                                 INFO -- #3992507557 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO -- #3992507557 Features                             0          0          0          0          0          0          0          0          0          0          0          0
+TrigSignatureMoniMT                                 INFO -- #3992507557 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #3992507557 Features                             0          0          0          0          0          0          0          0          0          0          0          -
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J20 #3084792704
-TrigSignatureMoniMT                                 INFO -- #3084792704 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #3084792704 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J75_31ETA49 #3769257182
-TrigSignatureMoniMT                                 INFO -- #3769257182 Events         2          2          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3769257182 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #3769257182 Events         2          2          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3769257182 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_bmv2c1060_split_L1J100 #1211559599
-TrigSignatureMoniMT                                 INFO -- #1211559599 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO -- #1211559599 Features                             0          0          0          0          0          0          0          0          0          0          0          0
+TrigSignatureMoniMT                                 INFO -- #1211559599 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #1211559599 Features                             0          0          0          0          0          0          0          0          0          0          0          -
 TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_boffperf_split_L1J100 #588317894
-TrigSignatureMoniMT                                 INFO -- #588317894 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO -- #588317894 Features                              0          0          0          0          0          0          0          0          0          0          0          0
+TrigSignatureMoniMT                                 INFO -- #588317894 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #588317894 Features                              0          0          0          0          0          0          0          0          0          0          0          -
 TrigSignatureMoniMT                                 INFO HLT_j300_ftf_subjesgscIS_bmv2c1070_split_L1J100 #3706723666
-TrigSignatureMoniMT                                 INFO -- #3706723666 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO -- #3706723666 Features                             0          0          0          0          0          0          0          0          0          0          0          0
+TrigSignatureMoniMT                                 INFO -- #3706723666 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #3706723666 Features                             0          0          0          0          0          0          0          0          0          0          0          -
 TrigSignatureMoniMT                                 INFO HLT_j360_ftf_subjesgscIS_bmv2c1077_split_L1J100 #1837565816
-TrigSignatureMoniMT                                 INFO -- #1837565816 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO -- #1837565816 Features                             0          0          0          0          0          0          0          0          0          0          0          0
+TrigSignatureMoniMT                                 INFO -- #1837565816 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #1837565816 Features                             0          0          0          0          0          0          0          0          0          0          0          -
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J100 #2659902019
-TrigSignatureMoniMT                                 INFO -- #2659902019 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #2659902019 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #2659902019 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2659902019 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J20 #2205518067
-TrigSignatureMoniMT                                 INFO -- #2205518067 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #2205518067 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j420_ftf_subjesgscIS_L1J20 #4179085188
-TrigSignatureMoniMT                                 INFO -- #4179085188 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #4179085188 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #4179085188 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #4179085188 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_L1J15 #1364976160
-TrigSignatureMoniMT                                 INFO -- #1364976160 Events         20         20         0          0          0          0          0          0          0          0          0          0          19         -          19
-TrigSignatureMoniMT                                 INFO -- #1364976160 Features                             0          0          0          0          0          0          0          0          0          0          50         -
+TrigSignatureMoniMT                                 INFO -- #1364976160 Events         20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #1364976160 Features                             0          0          0          0          0          0          0          0          0          50         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_cssktc_nojcalib_L1J20 #3295122398
-TrigSignatureMoniMT                                 INFO -- #3295122398 Events         19         19         0          0          0          0          0          0          0          0          0          0          15         -          15
-TrigSignatureMoniMT                                 INFO -- #3295122398 Features                             0          0          0          0          0          0          0          0          0          0          27         -
+TrigSignatureMoniMT                                 INFO -- #3295122398 Events         19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #3295122398 Features                             0          0          0          0          0          0          0          0          0          27         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_L1J15 #868405538
-TrigSignatureMoniMT                                 INFO -- #868405538 Events          20         20         0          0          0          0          0          0          0          0          0          0          19         -          19
-TrigSignatureMoniMT                                 INFO -- #868405538 Features                              0          0          0          0          0          0          0          0          0          0          50         -
+TrigSignatureMoniMT                                 INFO -- #868405538 Events          20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #868405538 Features                              0          0          0          0          0          0          0          0          0          50         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_csskpf_nojcalib_L1J20 #3533281867
-TrigSignatureMoniMT                                 INFO -- #3533281867 Events         19         19         0          0          0          0          0          0          0          0          0          0          16         -          16
-TrigSignatureMoniMT                                 INFO -- #3533281867 Features                             0          0          0          0          0          0          0          0          0          0          30         -
+TrigSignatureMoniMT                                 INFO -- #3533281867 Events         19         19         0          0          0          0          0          0          0          0          0          16         -          -          16
+TrigSignatureMoniMT                                 INFO -- #3533281867 Features                             0          0          0          0          0          0          0          0          0          30         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_L1J20 #1335156103
-TrigSignatureMoniMT                                 INFO -- #1335156103 Events         19         19         0          0          0          0          0          0          0          0          0          0          18         -          18
-TrigSignatureMoniMT                                 INFO -- #1335156103 Features                             0          0          0          0          0          0          0          0          0          0          39         -
+TrigSignatureMoniMT                                 INFO -- #1335156103 Events         19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
+TrigSignatureMoniMT                                 INFO -- #1335156103 Features                             0          0          0          0          0          0          0          0          0          39         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_nojcalib_L1J20 #3658890913
-TrigSignatureMoniMT                                 INFO -- #3658890913 Events         19         19         0          0          0          0          0          0          0          0          0          0          17         -          17
-TrigSignatureMoniMT                                 INFO -- #3658890913 Features                             0          0          0          0          0          0          0          0          0          0          37         -
+TrigSignatureMoniMT                                 INFO -- #3658890913 Events         19         19         0          0          0          0          0          0          0          0          0          17         -          -          17
+TrigSignatureMoniMT                                 INFO -- #3658890913 Features                             0          0          0          0          0          0          0          0          0          37         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_011jvt_L1J15 #2857031468
-TrigSignatureMoniMT                                 INFO -- #2857031468 Events         20         20         0          0          0          0          0          0          0          0          0          0          16         -          16
-TrigSignatureMoniMT                                 INFO -- #2857031468 Features                             0          0          0          0          0          0          0          0          0          0          33         -
+TrigSignatureMoniMT                                 INFO -- #2857031468 Events         20         20         0          0          0          0          0          0          0          0          0          16         -          -          16
+TrigSignatureMoniMT                                 INFO -- #2857031468 Features                             0          0          0          0          0          0          0          0          0          33         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_015jvt_L1J15 #2938374624
-TrigSignatureMoniMT                                 INFO -- #2938374624 Events         20         20         0          0          0          0          0          0          0          0          0          0          16         -          16
-TrigSignatureMoniMT                                 INFO -- #2938374624 Features                             0          0          0          0          0          0          0          0          0          0          33         -
+TrigSignatureMoniMT                                 INFO -- #2938374624 Events         20         20         0          0          0          0          0          0          0          0          0          16         -          -          16
+TrigSignatureMoniMT                                 INFO -- #2938374624 Features                             0          0          0          0          0          0          0          0          0          33         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_059jvt_L1J15 #1593009344
-TrigSignatureMoniMT                                 INFO -- #1593009344 Events         20         20         0          0          0          0          0          0          0          0          0          0          16         -          16
-TrigSignatureMoniMT                                 INFO -- #1593009344 Features                             0          0          0          0          0          0          0          0          0          0          33         -
+TrigSignatureMoniMT                                 INFO -- #1593009344 Events         20         20         0          0          0          0          0          0          0          0          0          16         -          -          16
+TrigSignatureMoniMT                                 INFO -- #1593009344 Features                             0          0          0          0          0          0          0          0          0          33         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_L1J15 #3341539267
-TrigSignatureMoniMT                                 INFO -- #3341539267 Events         20         20         0          0          0          0          0          0          0          0          0          0          19         -          19
-TrigSignatureMoniMT                                 INFO -- #3341539267 Features                             0          0          0          0          0          0          0          0          0          0          50         -
+TrigSignatureMoniMT                                 INFO -- #3341539267 Events         20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #3341539267 Features                             0          0          0          0          0          0          0          0          0          50         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339
-TrigSignatureMoniMT                                 INFO -- #991419339 Events          19         19         0          0          0          0          0          0          0          0          0          0          19         10         10
-TrigSignatureMoniMT                                 INFO -- #991419339 Features                              0          0          0          0          0          0          0          0          0          0          49         21
+TrigSignatureMoniMT                                 INFO -- #991419339 Events          19         19         0          0          0          0          0          0          0          0          0          19         10         -          10
+TrigSignatureMoniMT                                 INFO -- #991419339 Features                              0          0          0          0          0          0          0          0          0          49         21         -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049
-TrigSignatureMoniMT                                 INFO -- #1961149049 Events         19         19         0          0          0          0          0          0          0          0          0          0          19         19         19
-TrigSignatureMoniMT                                 INFO -- #1961149049 Features                             0          0          0          0          0          0          0          0          0          0          49         49
+TrigSignatureMoniMT                                 INFO -- #1961149049 Events         19         19         0          0          0          0          0          0          0          0          0          19         19         -          19
+TrigSignatureMoniMT                                 INFO -- #1961149049 Features                             0          0          0          0          0          0          0          0          0          49         49         -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_pf_L1J20 #761060030
-TrigSignatureMoniMT                                 INFO -- #761060030 Events          19         19         0          0          0          0          0          0          0          0          0          0          18         -          18
-TrigSignatureMoniMT                                 INFO -- #761060030 Features                              0          0          0          0          0          0          0          0          0          0          39         -
+TrigSignatureMoniMT                                 INFO -- #761060030 Events          19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
+TrigSignatureMoniMT                                 INFO -- #761060030 Features                              0          0          0          0          0          0          0          0          0          39         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_L1J15 #1509925407
-TrigSignatureMoniMT                                 INFO -- #1509925407 Events         20         20         0          0          0          0          0          0          0          0          0          0          19         -          19
-TrigSignatureMoniMT                                 INFO -- #1509925407 Features                             0          0          0          0          0          0          0          0          0          0          45         -
+TrigSignatureMoniMT                                 INFO -- #1509925407 Events         20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #1509925407 Features                             0          0          0          0          0          0          0          0          0          45         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_pf_L1J20 #4012311417
-TrigSignatureMoniMT                                 INFO -- #4012311417 Events         19         19         0          0          0          0          0          0          0          0          0          0          18         -          18
-TrigSignatureMoniMT                                 INFO -- #4012311417 Features                             0          0          0          0          0          0          0          0          0          0          39         -
+TrigSignatureMoniMT                                 INFO -- #4012311417 Events         19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
+TrigSignatureMoniMT                                 INFO -- #4012311417 Features                             0          0          0          0          0          0          0          0          0          39         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_nojcalib_L1J20 #2042444294
-TrigSignatureMoniMT                                 INFO -- #2042444294 Events         19         19         0          0          0          0          0          0          0          0          0          0          17         -          17
-TrigSignatureMoniMT                                 INFO -- #2042444294 Features                             0          0          0          0          0          0          0          0          0          0          39         -
+TrigSignatureMoniMT                                 INFO -- #2042444294 Events         19         19         0          0          0          0          0          0          0          0          0          17         -          -          17
+TrigSignatureMoniMT                                 INFO -- #2042444294 Features                             0          0          0          0          0          0          0          0          0          39         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_sktc_nojcalib_L1J20 #1542468090
-TrigSignatureMoniMT                                 INFO -- #1542468090 Events         19         19         0          0          0          0          0          0          0          0          0          0          15         -          15
-TrigSignatureMoniMT                                 INFO -- #1542468090 Features                             0          0          0          0          0          0          0          0          0          0          26         -
+TrigSignatureMoniMT                                 INFO -- #1542468090 Events         19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #1542468090 Features                             0          0          0          0          0          0          0          0          0          26         -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J100 #3327656707
-TrigSignatureMoniMT                                 INFO -- #3327656707 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3327656707 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #3327656707 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3327656707 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J20 #215408633
-TrigSignatureMoniMT                                 INFO -- #215408633 Events          19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #215408633 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #215408633 Events          19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #215408633 Features                              0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J100 #1151767619
-TrigSignatureMoniMT                                 INFO -- #1151767619 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1151767619 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #1151767619 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1151767619 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J20 #3875082669
-TrigSignatureMoniMT                                 INFO -- #3875082669 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #3875082669 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_lcw_nojcalib_L1J100 #3093997295
-TrigSignatureMoniMT                                 INFO -- #3093997295 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3093997295 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #3093997295 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3093997295 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_30smcINF_L1J100 #2296827117
-TrigSignatureMoniMT                                 INFO -- #2296827117 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #2296827117 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #2296827117 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2296827117 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_L1J100 #436385969
-TrigSignatureMoniMT                                 INFO -- #436385969 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #436385969 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #436385969 Events          3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #436385969 Features                              0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j80_0eta240_2j60_320eta490_j0_dijetSEP80j1etSEP0j1eta240SEP80j2etSEP0j2eta240SEP700djmass_L1J20 #3634067472
-TrigSignatureMoniMT                                 INFO -- #3634067472 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3634067472 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #3634067472 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3634067472 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j80_L1J15 #2440872308
-TrigSignatureMoniMT                                 INFO -- #2440872308 Events         20         20         0          0          0          0          0          0          0          0          0          0          13         -          13
-TrigSignatureMoniMT                                 INFO -- #2440872308 Features                             0          0          0          0          0          0          0          0          0          0          23         -
+TrigSignatureMoniMT                                 INFO -- #2440872308 Events         20         20         0          0          0          0          0          0          0          0          0          13         -          -          13
+TrigSignatureMoniMT                                 INFO -- #2440872308 Features                             0          0          0          0          0          0          0          0          0          23         -          -
 TrigSignatureMoniMT                                 INFO HLT_j80_j60_L1J15 #582699527
-TrigSignatureMoniMT                                 INFO -- #582699527 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #582699527 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #582699527 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #582699527 Features                              0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j85_L1J20 #510475538
-TrigSignatureMoniMT                                 INFO -- #510475538 Events          19         19         0          0          0          0          0          0          0          0          0          0          13         -          13
-TrigSignatureMoniMT                                 INFO -- #510475538 Features                              0          0          0          0          0          0          0          0          0          0          21         -
+TrigSignatureMoniMT                                 INFO -- #510475538 Events          19         19         0          0          0          0          0          0          0          0          0          13         -          -          13
+TrigSignatureMoniMT                                 INFO -- #510475538 Features                              0          0          0          0          0          0          0          0          0          21         -          -
 TrigSignatureMoniMT                                 INFO HLT_j85_ftf_L1J20 #877042532
-TrigSignatureMoniMT                                 INFO -- #877042532 Events          19         19         0          0          0          0          0          0          0          0          0          0          13         -          13
-TrigSignatureMoniMT                                 INFO -- #877042532 Features                              0          0          0          0          0          0          0          0          0          0          21         -
+TrigSignatureMoniMT                                 INFO -- #877042532 Events          19         19         0          0          0          0          0          0          0          0          0          13         -          -          13
+TrigSignatureMoniMT                                 INFO -- #877042532 Features                              0          0          0          0          0          0          0          0          0          21         -          -
 TrigSignatureMoniMT                                 INFO HLT_j85_ftf_pf_L1J20 #1538535401
-TrigSignatureMoniMT                                 INFO -- #1538535401 Events         19         19         0          0          0          0          0          0          0          0          0          0          11         -          11
-TrigSignatureMoniMT                                 INFO -- #1538535401 Features                             0          0          0          0          0          0          0          0          0          0          16         -
+TrigSignatureMoniMT                                 INFO -- #1538535401 Events         19         19         0          0          0          0          0          0          0          0          0          11         -          -          11
+TrigSignatureMoniMT                                 INFO -- #1538535401 Features                             0          0          0          0          0          0          0          0          0          16         -          -
 TrigSignatureMoniMT                                 INFO HLT_mb_sptrk_L1RD0_FILLED #4097312640
 TrigSignatureMoniMT                                 INFO -- #4097312640 Events         20         20         20         20         -          -          -          -          -          -          -          -          -          -          20
 TrigSignatureMoniMT                                 INFO -- #4097312640 Features                             20         20         -          -          -          -          -          -          -          -          -          -
@@ -389,20 +389,23 @@ TrigSignatureMoniMT                                 INFO HLT_mu14_L1MU10 #169690
 TrigSignatureMoniMT                                 INFO -- #1696906927 Events         10         10         0          0          0          0          10         7          7          7          -          -          -          -          7
 TrigSignatureMoniMT                                 INFO -- #1696906927 Features                             0          0          0          0          13         8          8          8          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu20_2mu4noL1_L1MU20 #1029128679
-TrigSignatureMoniMT                                 INFO -- #1029128679 Events         8          8          0          0          0          0          8          5          5          5          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #1029128679 Features                             0          0          0          0          10         6          6          6          2          2          -          -
+TrigSignatureMoniMT                                 INFO -- #1029128679 Events         8          8          0          0          0          0          8          5          5          5          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #1029128679 Features                             0          0          0          0          10         6          6          6          0          0          2          2
 TrigSignatureMoniMT                                 INFO HLT_mu20_ivar_L1MU6 #2083734526
 TrigSignatureMoniMT                                 INFO -- #2083734526 Events         10         10         0          0          0          0          10         5          5          -          -          -          -          -          5
 TrigSignatureMoniMT                                 INFO -- #2083734526 Features                             0          0          0          0          14         6          5          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_mu20_ivarmedium_mu8noL1_L1MU20 #3249386942
+TrigSignatureMoniMT                                 INFO -- #3249386942 Events         8          8          0          0          0          0          8          5          5          5          3          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #3249386942 Features                             0          0          0          0          10         6          6          6          3          0          1          1
 TrigSignatureMoniMT                                 INFO HLT_mu22_2mu4noL1_L1MU20 #3427670100
-TrigSignatureMoniMT                                 INFO -- #3427670100 Events         8          8          0          0          0          0          8          5          5          5          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #3427670100 Features                             0          0          0          0          10         6          6          6          2          2          -          -
+TrigSignatureMoniMT                                 INFO -- #3427670100 Events         8          8          0          0          0          0          8          5          5          5          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #3427670100 Features                             0          0          0          0          10         6          6          6          0          0          2          2
 TrigSignatureMoniMT                                 INFO HLT_mu22_mu8noL1_L1MU20 #3165652409
-TrigSignatureMoniMT                                 INFO -- #3165652409 Events         8          8          0          0          0          0          8          5          5          5          2          2          -          -          2
-TrigSignatureMoniMT                                 INFO -- #3165652409 Features                             0          0          0          0          10         6          6          6          3          3          -          -
+TrigSignatureMoniMT                                 INFO -- #3165652409 Events         8          8          0          0          0          0          8          5          5          5          0          0          2          2          2
+TrigSignatureMoniMT                                 INFO -- #3165652409 Features                             0          0          0          0          10         6          6          6          0          0          3          3
 TrigSignatureMoniMT                                 INFO HLT_mu24_2mu4noL1_L1MU20 #3233544630
-TrigSignatureMoniMT                                 INFO -- #3233544630 Events         8          8          0          0          0          0          8          5          5          5          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #3233544630 Features                             0          0          0          0          10         6          6          6          2          2          -          -
+TrigSignatureMoniMT                                 INFO -- #3233544630 Events         8          8          0          0          0          0          8          5          5          5          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #3233544630 Features                             0          0          0          0          10         6          6          6          0          0          2          2
 TrigSignatureMoniMT                                 INFO HLT_mu24_L1MU20 #417425162
 TrigSignatureMoniMT                                 INFO -- #417425162 Events          8          8          0          0          0          0          8          5          5          5          -          -          -          -          5
 TrigSignatureMoniMT                                 INFO -- #417425162 Features                              0          0          0          0          10         6          6          6          -          -          -          -
@@ -413,8 +416,8 @@ TrigSignatureMoniMT                                 INFO HLT_mu24_ivarmedium_L1M
 TrigSignatureMoniMT                                 INFO -- #737407430 Events          8          8          0          0          0          0          8          5          5          5          3          -          -          -          3
 TrigSignatureMoniMT                                 INFO -- #737407430 Features                              0          0          0          0          10         6          6          6          3          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu24_mu10noL1_L1MU20 #2563354236
-TrigSignatureMoniMT                                 INFO -- #2563354236 Events         8          8          0          0          0          0          8          5          5          5          2          2          -          -          2
-TrigSignatureMoniMT                                 INFO -- #2563354236 Features                             0          0          0          0          10         6          6          6          3          3          -          -
+TrigSignatureMoniMT                                 INFO -- #2563354236 Events         8          8          0          0          0          0          8          5          5          5          0          0          2          2          2
+TrigSignatureMoniMT                                 INFO -- #2563354236 Features                             0          0          0          0          10         6          6          6          0          0          3          3
 TrigSignatureMoniMT                                 INFO HLT_mu26_L1MU20 #311138376
 TrigSignatureMoniMT                                 INFO -- #311138376 Events          8          8          0          0          0          0          8          5          4          3          -          -          -          -          3
 TrigSignatureMoniMT                                 INFO -- #311138376 Features                              0          0          0          0          10         6          5          4          -          -          -          -
@@ -422,17 +425,17 @@ TrigSignatureMoniMT                                 INFO HLT_mu26_ivarmedium_L1M
 TrigSignatureMoniMT                                 INFO -- #3411723090 Events         8          8          0          0          0          0          8          5          4          3          2          -          -          -          2
 TrigSignatureMoniMT                                 INFO -- #3411723090 Features                             0          0          0          0          10         6          5          4          2          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu26_mu10noL1_L1MU20 #2318302287
-TrigSignatureMoniMT                                 INFO -- #2318302287 Events         8          8          0          0          0          0          8          5          4          3          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #2318302287 Features                             0          0          0          0          10         6          5          4          2          2          -          -
+TrigSignatureMoniMT                                 INFO -- #2318302287 Events         8          8          0          0          0          0          8          5          4          3          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #2318302287 Features                             0          0          0          0          10         6          5          4          0          0          2          2
 TrigSignatureMoniMT                                 INFO HLT_mu26_mu8noL1_L1MU20 #2233067926
-TrigSignatureMoniMT                                 INFO -- #2233067926 Events         8          8          0          0          0          0          8          5          4          3          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #2233067926 Features                             0          0          0          0          10         6          5          4          2          2          -          -
+TrigSignatureMoniMT                                 INFO -- #2233067926 Events         8          8          0          0          0          0          8          5          4          3          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #2233067926 Features                             0          0          0          0          10         6          5          4          0          0          2          2
 TrigSignatureMoniMT                                 INFO HLT_mu28_ivarmedium_L1MU20 #1963262787
 TrigSignatureMoniMT                                 INFO -- #1963262787 Events         8          8          0          0          0          0          8          5          4          3          2          -          -          -          2
 TrigSignatureMoniMT                                 INFO -- #1963262787 Features                             0          0          0          0          10         6          5          3          2          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu28_mu8noL1_L1MU20 #86648125
-TrigSignatureMoniMT                                 INFO -- #86648125 Events           8          8          0          0          0          0          8          5          4          3          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #86648125 Features                               0          0          0          0          10         6          5          3          1          1          -          -
+TrigSignatureMoniMT                                 INFO -- #86648125 Events           8          8          0          0          0          0          8          5          4          3          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #86648125 Features                               0          0          0          0          10         6          5          3          0          0          1          1
 TrigSignatureMoniMT                                 INFO HLT_mu35_ivarmedium_L1MU20 #597064890
 TrigSignatureMoniMT                                 INFO -- #597064890 Events          8          8          0          0          0          0          8          5          3          2          1          -          -          -          1
 TrigSignatureMoniMT                                 INFO -- #597064890 Features                              0          0          0          0          10         6          4          2          1          -          -          -
@@ -467,17 +470,17 @@ TrigSignatureMoniMT                                 INFO HLT_mu6_mu4_L12MU4 #171
 TrigSignatureMoniMT                                 INFO -- #1713982776 Events         4          4          0          0          0          0          4          4          4          4          -          -          -          -          4
 TrigSignatureMoniMT                                 INFO -- #1713982776 Features                             0          0          0          0          8          8          12         10         -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu6_mu6noL1_L1MU6 #451489897
-TrigSignatureMoniMT                                 INFO -- #451489897 Events          10         10         0          0          0          0          10         10         10         10         5          4          -          -          5
-TrigSignatureMoniMT                                 INFO -- #451489897 Features                              0          0          0          0          14         13         16         15         8          7          -          -
+TrigSignatureMoniMT                                 INFO -- #451489897 Events          10         10         0          0          0          0          10         10         10         10         0          0          5          4          4
+TrigSignatureMoniMT                                 INFO -- #451489897 Features                              0          0          0          0          14         13         16         15         0          0          8          7
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_L1MU6 #3518031697
 TrigSignatureMoniMT                                 INFO -- #3518031697 Events         10         10         0          0          0          0          10         -          -          -          -          -          -          -          10
 TrigSignatureMoniMT                                 INFO -- #3518031697 Features                             0          0          0          0          14         -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_j45_nojcalib_L1J20 #1776326110
-TrigSignatureMoniMT                                 INFO -- #1776326110 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1776326110 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #1776326110 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1776326110 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_xe30_mht_L1XE10 #1876869651
-TrigSignatureMoniMT                                 INFO -- #1876869651 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1876869651 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #1876869651 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1876869651 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu80_L1MU20 #387900377
 TrigSignatureMoniMT                                 INFO -- #387900377 Events          8          8          0          0          0          0          8          5          0          0          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #387900377 Features                              0          0          0          0          10         6          0          0          -          -          -          -
@@ -776,65 +779,65 @@ TrigSignatureMoniMT                                 INFO HLT_timeburner_L1All #8
 TrigSignatureMoniMT                                 INFO -- #819160059 Events          20         20         0          -          -          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #819160059 Features                              0          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe100_mht_L1XE50 #532175988
-TrigSignatureMoniMT                                 INFO -- #532175988 Events          10         10         0          0          0          0          0          0          0          0          0          0          9          -          9
-TrigSignatureMoniMT                                 INFO -- #532175988 Features                              0          0          0          0          0          0          0          0          0          0          9          -
+TrigSignatureMoniMT                                 INFO -- #532175988 Events          10         10         0          0          0          0          0          0          0          0          0          9          -          -          9
+TrigSignatureMoniMT                                 INFO -- #532175988 Features                              0          0          0          0          0          0          0          0          0          9          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe100_pfsum_L1XE50 #1890237897
-TrigSignatureMoniMT                                 INFO -- #1890237897 Events         10         10         0          0          0          0          0          0          0          0          0          0          4          -          4
-TrigSignatureMoniMT                                 INFO -- #1890237897 Features                             0          0          0          0          0          0          0          0          0          0          4          -
+TrigSignatureMoniMT                                 INFO -- #1890237897 Events         10         10         0          0          0          0          0          0          0          0          0          4          -          -          4
+TrigSignatureMoniMT                                 INFO -- #1890237897 Features                             0          0          0          0          0          0          0          0          0          4          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe100_tcpufit_L1XE50 #2803198799
-TrigSignatureMoniMT                                 INFO -- #2803198799 Events         10         10         0          0          0          0          0          0          0          0          0          0          6          -          6
-TrigSignatureMoniMT                                 INFO -- #2803198799 Features                             0          0          0          0          0          0          0          0          0          0          6          -
+TrigSignatureMoniMT                                 INFO -- #2803198799 Events         10         10         0          0          0          0          0          0          0          0          0          6          -          -          6
+TrigSignatureMoniMT                                 INFO -- #2803198799 Features                             0          0          0          0          0          0          0          0          0          6          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe100_trkmht_L1XE50 #1055916731
-TrigSignatureMoniMT                                 INFO -- #1055916731 Events         10         10         0          0          0          0          0          0          0          0          0          0          7          -          7
-TrigSignatureMoniMT                                 INFO -- #1055916731 Features                             0          0          0          0          0          0          0          0          0          0          7          -
+TrigSignatureMoniMT                                 INFO -- #1055916731 Events         10         10         0          0          0          0          0          0          0          0          0          7          -          -          7
+TrigSignatureMoniMT                                 INFO -- #1055916731 Features                             0          0          0          0          0          0          0          0          0          7          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe100_trkmht_xe85_tcpufit_xe65_cell_L1XE50 #451622546
-TrigSignatureMoniMT                                 INFO -- #451622546 Events          10         10         0          0          0          0          0          0          0          0          0          0          6          -          6
-TrigSignatureMoniMT                                 INFO -- #451622546 Features                              0          0          0          0          0          0          0          0          0          0          6          -
+TrigSignatureMoniMT                                 INFO -- #451622546 Events          10         10         0          0          0          0          0          0          0          0          0          6          -          -          6
+TrigSignatureMoniMT                                 INFO -- #451622546 Features                              0          0          0          0          0          0          0          0          0          6          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe110_mht_L1XE50 #3030733259
-TrigSignatureMoniMT                                 INFO -- #3030733259 Events         10         10         0          0          0          0          0          0          0          0          0          0          7          -          7
-TrigSignatureMoniMT                                 INFO -- #3030733259 Features                             0          0          0          0          0          0          0          0          0          0          7          -
+TrigSignatureMoniMT                                 INFO -- #3030733259 Events         10         10         0          0          0          0          0          0          0          0          0          7          -          -          7
+TrigSignatureMoniMT                                 INFO -- #3030733259 Features                             0          0          0          0          0          0          0          0          0          7          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe110_tc_em_L1XE50 #607113828
-TrigSignatureMoniMT                                 INFO -- #607113828 Events          10         10         0          0          0          0          0          0          0          0          0          0          5          -          5
-TrigSignatureMoniMT                                 INFO -- #607113828 Features                              0          0          0          0          0          0          0          0          0          0          5          -
+TrigSignatureMoniMT                                 INFO -- #607113828 Events          10         10         0          0          0          0          0          0          0          0          0          5          -          -          5
+TrigSignatureMoniMT                                 INFO -- #607113828 Features                              0          0          0          0          0          0          0          0          0          5          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe110_tcpufit_L1XE50 #892853397
-TrigSignatureMoniMT                                 INFO -- #892853397 Events          10         10         0          0          0          0          0          0          0          0          0          0          6          -          6
-TrigSignatureMoniMT                                 INFO -- #892853397 Features                              0          0          0          0          0          0          0          0          0          0          6          -
+TrigSignatureMoniMT                                 INFO -- #892853397 Events          10         10         0          0          0          0          0          0          0          0          0          6          -          -          6
+TrigSignatureMoniMT                                 INFO -- #892853397 Features                              0          0          0          0          0          0          0          0          0          6          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_cell_L1XE10 #1649696554
-TrigSignatureMoniMT                                 INFO -- #1649696554 Events         19         19         0          0          0          0          0          0          0          0          0          0          17         -          17
-TrigSignatureMoniMT                                 INFO -- #1649696554 Features                             0          0          0          0          0          0          0          0          0          0          17         -
+TrigSignatureMoniMT                                 INFO -- #1649696554 Events         19         19         0          0          0          0          0          0          0          0          0          17         -          -          17
+TrigSignatureMoniMT                                 INFO -- #1649696554 Features                             0          0          0          0          0          0          0          0          0          17         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_cell_xe30_tcpufit_L1XE10 #3768353779
-TrigSignatureMoniMT                                 INFO -- #3768353779 Events         19         19         0          0          0          0          0          0          0          0          0          0          14         -          14
-TrigSignatureMoniMT                                 INFO -- #3768353779 Features                             0          0          0          0          0          0          0          0          0          0          14         -
+TrigSignatureMoniMT                                 INFO -- #3768353779 Events         19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
+TrigSignatureMoniMT                                 INFO -- #3768353779 Features                             0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_cvfpufit_L1XE10 #3860749499
-TrigSignatureMoniMT                                 INFO -- #3860749499 Events         19         19         0          0          0          0          0          0          0          0          0          0          14         -          14
-TrigSignatureMoniMT                                 INFO -- #3860749499 Features                             0          0          0          0          0          0          0          0          0          0          14         -
+TrigSignatureMoniMT                                 INFO -- #3860749499 Events         19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
+TrigSignatureMoniMT                                 INFO -- #3860749499 Features                             0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_mht_L1XE10 #3626903018
-TrigSignatureMoniMT                                 INFO -- #3626903018 Events         19         19         0          0          0          0          0          0          0          0          0          0          19         -          19
-TrigSignatureMoniMT                                 INFO -- #3626903018 Features                             0          0          0          0          0          0          0          0          0          0          19         -
+TrigSignatureMoniMT                                 INFO -- #3626903018 Events         19         19         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #3626903018 Features                             0          0          0          0          0          0          0          0          0          19         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_mhtpufit_em_subjesgscIS_L1XE10 #689201557
-TrigSignatureMoniMT                                 INFO -- #689201557 Events          19         19         0          0          0          0          0          0          0          0          0          0          15         -          15
-TrigSignatureMoniMT                                 INFO -- #689201557 Features                              0          0          0          0          0          0          0          0          0          0          15         -
+TrigSignatureMoniMT                                 INFO -- #689201557 Events          19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #689201557 Features                              0          0          0          0          0          0          0          0          0          15         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_mhtpufit_pf_subjesgscIS_L1XE10 #1886909707
-TrigSignatureMoniMT                                 INFO -- #1886909707 Events         19         19         0          0          0          0          0          0          0          0          0          0          14         -          14
-TrigSignatureMoniMT                                 INFO -- #1886909707 Features                             0          0          0          0          0          0          0          0          0          0          14         -
+TrigSignatureMoniMT                                 INFO -- #1886909707 Events         19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
+TrigSignatureMoniMT                                 INFO -- #1886909707 Features                             0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_pfopufit_L1XE10 #2252641537
-TrigSignatureMoniMT                                 INFO -- #2252641537 Events         19         19         0          0          0          0          0          0          0          0          0          0          14         -          14
-TrigSignatureMoniMT                                 INFO -- #2252641537 Features                             0          0          0          0          0          0          0          0          0          0          14         -
+TrigSignatureMoniMT                                 INFO -- #2252641537 Events         19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
+TrigSignatureMoniMT                                 INFO -- #2252641537 Features                             0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_pfsum_L1XE10 #998713382
-TrigSignatureMoniMT                                 INFO -- #998713382 Events          19         19         0          0          0          0          0          0          0          0          0          0          16         -          16
-TrigSignatureMoniMT                                 INFO -- #998713382 Features                              0          0          0          0          0          0          0          0          0          0          16         -
+TrigSignatureMoniMT                                 INFO -- #998713382 Events          19         19         0          0          0          0          0          0          0          0          0          16         -          -          16
+TrigSignatureMoniMT                                 INFO -- #998713382 Features                              0          0          0          0          0          0          0          0          0          16         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_tcpufit_L1XE10 #1583719916
-TrigSignatureMoniMT                                 INFO -- #1583719916 Events         19         19         0          0          0          0          0          0          0          0          0          0          14         -          14
-TrigSignatureMoniMT                                 INFO -- #1583719916 Features                             0          0          0          0          0          0          0          0          0          0          14         -
+TrigSignatureMoniMT                                 INFO -- #1583719916 Events         19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
+TrigSignatureMoniMT                                 INFO -- #1583719916 Features                             0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_trkmht_L1XE10 #2468872349
-TrigSignatureMoniMT                                 INFO -- #2468872349 Events         19         19         0          0          0          0          0          0          0          0          0          0          17         -          17
-TrigSignatureMoniMT                                 INFO -- #2468872349 Features                             0          0          0          0          0          0          0          0          0          0          17         -
+TrigSignatureMoniMT                                 INFO -- #2468872349 Events         19         19         0          0          0          0          0          0          0          0          0          17         -          -          17
+TrigSignatureMoniMT                                 INFO -- #2468872349 Features                             0          0          0          0          0          0          0          0          0          17         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe65_cell_L1XE50 #531141817
-TrigSignatureMoniMT                                 INFO -- #531141817 Events          10         10         0          0          0          0          0          0          0          0          0          0          7          -          7
-TrigSignatureMoniMT                                 INFO -- #531141817 Features                              0          0          0          0          0          0          0          0          0          0          7          -
+TrigSignatureMoniMT                                 INFO -- #531141817 Events          10         10         0          0          0          0          0          0          0          0          0          7          -          -          7
+TrigSignatureMoniMT                                 INFO -- #531141817 Features                              0          0          0          0          0          0          0          0          0          7          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe65_cell_xe110_tcpufit_L1XE50 #115518400
-TrigSignatureMoniMT                                 INFO -- #115518400 Events          10         10         0          0          0          0          0          0          0          0          0          0          5          -          5
-TrigSignatureMoniMT                                 INFO -- #115518400 Features                              0          0          0          0          0          0          0          0          0          0          5          -
+TrigSignatureMoniMT                                 INFO -- #115518400 Events          10         10         0          0          0          0          0          0          0          0          0          5          -          -          5
+TrigSignatureMoniMT                                 INFO -- #115518400 Features                              0          0          0          0          0          0          0          0          0          5          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe95_trkmht_xe90_tcpufit_xe75_cell_L1XE50 #302256132
-TrigSignatureMoniMT                                 INFO -- #302256132 Events          10         10         0          0          0          0          0          0          0          0          0          0          4          -          4
-TrigSignatureMoniMT                                 INFO -- #302256132 Features                              0          0          0          0          0          0          0          0          0          0          4          -
+TrigSignatureMoniMT                                 INFO -- #302256132 Events          10         10         0          0          0          0          0          0          0          0          0          4          -          -          4
+TrigSignatureMoniMT                                 INFO -- #302256132 Features                              0          0          0          0          0          0          0          0          0          4          -          -
diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
index 55ca65ac6a46..c3d2d19188bf 100644
--- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
@@ -20,11 +20,11 @@ TrigSignatureMoniMT                                 INFO HLT_2g35_medium_L12EM20
 TrigSignatureMoniMT                                 INFO -- #3965466087 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3965466087 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2j330_a10t_lcw_jes_35smcINF_L1J100 #1295975955
-TrigSignatureMoniMT                                 INFO -- #1295975955 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1295975955 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #1295975955 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1295975955 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2j60_L1J15 #927735533
-TrigSignatureMoniMT                                 INFO -- #927735533 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #927735533 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #927735533 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #927735533 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2mu10_bJpsimumu_L12MU10 #3498558358
 TrigSignatureMoniMT                                 INFO -- #3498558358 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3498558358 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
@@ -68,11 +68,11 @@ TrigSignatureMoniMT                                 INFO HLT_2mu6_muonqual_L12MU
 TrigSignatureMoniMT                                 INFO -- #2398136098 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #2398136098 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_3j200_L1J100 #2199422919
-TrigSignatureMoniMT                                 INFO -- #2199422919 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2199422919 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #2199422919 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2199422919 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_3j200_L1J20 #493765146
-TrigSignatureMoniMT                                 INFO -- #493765146 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #493765146 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #493765146 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #493765146 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_3mu6_L13MU6 #1832399408
 TrigSignatureMoniMT                                 INFO -- #1832399408 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1832399408 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
@@ -86,8 +86,8 @@ TrigSignatureMoniMT                                 INFO HLT_4mu4_L14MU4 #183438
 TrigSignatureMoniMT                                 INFO -- #1834383636 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1834383636 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_5j70_0eta240_L14J20 #1175391812
-TrigSignatureMoniMT                                 INFO -- #1175391812 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #1175391812 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_beamspot_allTE_trkfast_BeamSpotPEB_L1J15 #3989372080
 TrigSignatureMoniMT                                 INFO -- #3989372080 Events         20         20         20         20         -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #3989372080 Features                             20         20         -          -          -          -          -          -          -          -          -          -          
@@ -221,131 +221,131 @@ TrigSignatureMoniMT                                 INFO HLT_g5_tight_L1EM3 #328
 TrigSignatureMoniMT                                 INFO -- #3280865118 Events         20         20         9          9          9          1          -          -          -          -          -          -          -          -          1          
 TrigSignatureMoniMT                                 INFO -- #3280865118 Features                             13         13         30         1          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j0_perf_L1J12_EMPTY #1341875780
-TrigSignatureMoniMT                                 INFO -- #1341875780 Events         20         20         0          0          0          0          0          0          0          0          0          0          8          -          8          
-TrigSignatureMoniMT                                 INFO -- #1341875780 Features                             0          0          0          0          0          0          0          0          0          0          117        -          
+TrigSignatureMoniMT                                 INFO -- #1341875780 Events         20         20         0          0          0          0          0          0          0          0          0          8          -          -          8          
+TrigSignatureMoniMT                                 INFO -- #1341875780 Features                             0          0          0          0          0          0          0          0          0          117        -          -          
 TrigSignatureMoniMT                                 INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151
-TrigSignatureMoniMT                                 INFO -- #4034799151 Events         20         20         0          0          0          0          0          0          0          0          0          0          2          -          2          
-TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             0          0          0          0          0          0          0          0          0          0          24         -          
+TrigSignatureMoniMT                                 INFO -- #4034799151 Events         20         20         0          0          0          0          0          0          0          0          0          2          -          -          2          
+TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             0          0          0          0          0          0          0          0          0          24         -          -          
 TrigSignatureMoniMT                                 INFO HLT_j225_ftf_subjesgscIS_bmv2c1040_split_L1J100 #3992507557
-TrigSignatureMoniMT                                 INFO -- #3992507557 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #3992507557 Features                             0          0          0          0          0          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3992507557 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #3992507557 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J20 #3084792704
-TrigSignatureMoniMT                                 INFO -- #3084792704 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #3084792704 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J75_31ETA49 #3769257182
-TrigSignatureMoniMT                                 INFO -- #3769257182 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3769257182 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #3769257182 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3769257182 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_bmv2c1060_split_L1J100 #1211559599
-TrigSignatureMoniMT                                 INFO -- #1211559599 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #1211559599 Features                             0          0          0          0          0          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #1211559599 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #1211559599 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
 TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_boffperf_split_L1J100 #588317894
-TrigSignatureMoniMT                                 INFO -- #588317894 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #588317894 Features                              0          0          0          0          0          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #588317894 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #588317894 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
 TrigSignatureMoniMT                                 INFO HLT_j300_ftf_subjesgscIS_bmv2c1070_split_L1J100 #3706723666
-TrigSignatureMoniMT                                 INFO -- #3706723666 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #3706723666 Features                             0          0          0          0          0          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3706723666 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #3706723666 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
 TrigSignatureMoniMT                                 INFO HLT_j360_ftf_subjesgscIS_bmv2c1077_split_L1J100 #1837565816
-TrigSignatureMoniMT                                 INFO -- #1837565816 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #1837565816 Features                             0          0          0          0          0          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #1837565816 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #1837565816 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J100 #2659902019
-TrigSignatureMoniMT                                 INFO -- #2659902019 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2659902019 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #2659902019 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2659902019 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J20 #2205518067
-TrigSignatureMoniMT                                 INFO -- #2205518067 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #2205518067 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j420_ftf_subjesgscIS_L1J20 #4179085188
-TrigSignatureMoniMT                                 INFO -- #4179085188 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #4179085188 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #4179085188 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #4179085188 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_L1J15 #1364976160
-TrigSignatureMoniMT                                 INFO -- #1364976160 Events         20         20         0          0          0          0          0          0          0          0          0          0          6          -          6          
-TrigSignatureMoniMT                                 INFO -- #1364976160 Features                             0          0          0          0          0          0          0          0          0          0          6          -          
+TrigSignatureMoniMT                                 INFO -- #1364976160 Events         20         20         0          0          0          0          0          0          0          0          0          6          -          -          6          
+TrigSignatureMoniMT                                 INFO -- #1364976160 Features                             0          0          0          0          0          0          0          0          0          6          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_cssktc_nojcalib_L1J20 #3295122398
-TrigSignatureMoniMT                                 INFO -- #3295122398 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #3295122398 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #3295122398 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3295122398 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_L1J15 #868405538
-TrigSignatureMoniMT                                 INFO -- #868405538 Events          20         20         0          0          0          0          0          0          0          0          0          0          6          -          6          
-TrigSignatureMoniMT                                 INFO -- #868405538 Features                              0          0          0          0          0          0          0          0          0          0          6          -          
+TrigSignatureMoniMT                                 INFO -- #868405538 Events          20         20         0          0          0          0          0          0          0          0          0          6          -          -          6          
+TrigSignatureMoniMT                                 INFO -- #868405538 Features                              0          0          0          0          0          0          0          0          0          6          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_csskpf_nojcalib_L1J20 #3533281867
-TrigSignatureMoniMT                                 INFO -- #3533281867 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #3533281867 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #3533281867 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3533281867 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_L1J20 #1335156103
-TrigSignatureMoniMT                                 INFO -- #1335156103 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #1335156103 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #1335156103 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #1335156103 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_nojcalib_L1J20 #3658890913
-TrigSignatureMoniMT                                 INFO -- #3658890913 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #3658890913 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #3658890913 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3658890913 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_011jvt_L1J15 #2857031468
-TrigSignatureMoniMT                                 INFO -- #2857031468 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #2857031468 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #2857031468 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2857031468 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_015jvt_L1J15 #2938374624
-TrigSignatureMoniMT                                 INFO -- #2938374624 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #2938374624 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #2938374624 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2938374624 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_059jvt_L1J15 #1593009344
-TrigSignatureMoniMT                                 INFO -- #1593009344 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #1593009344 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #1593009344 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #1593009344 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_L1J15 #3341539267
-TrigSignatureMoniMT                                 INFO -- #3341539267 Events         20         20         0          0          0          0          0          0          0          0          0          0          7          -          7          
-TrigSignatureMoniMT                                 INFO -- #3341539267 Features                             0          0          0          0          0          0          0          0          0          0          7          -          
+TrigSignatureMoniMT                                 INFO -- #3341539267 Events         20         20         0          0          0          0          0          0          0          0          0          7          -          -          7          
+TrigSignatureMoniMT                                 INFO -- #3341539267 Features                             0          0          0          0          0          0          0          0          0          7          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339
-TrigSignatureMoniMT                                 INFO -- #991419339 Events          20         20         0          0          0          0          0          0          0          0          0          0          5          1          1          
-TrigSignatureMoniMT                                 INFO -- #991419339 Features                              0          0          0          0          0          0          0          0          0          0          5          1          
+TrigSignatureMoniMT                                 INFO -- #991419339 Events          20         20         0          0          0          0          0          0          0          0          0          5          1          -          1          
+TrigSignatureMoniMT                                 INFO -- #991419339 Features                              0          0          0          0          0          0          0          0          0          5          1          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049
-TrigSignatureMoniMT                                 INFO -- #1961149049 Events         20         20         0          0          0          0          0          0          0          0          0          0          5          5          5          
-TrigSignatureMoniMT                                 INFO -- #1961149049 Features                             0          0          0          0          0          0          0          0          0          0          5          5          
+TrigSignatureMoniMT                                 INFO -- #1961149049 Events         20         20         0          0          0          0          0          0          0          0          0          5          5          -          5          
+TrigSignatureMoniMT                                 INFO -- #1961149049 Features                             0          0          0          0          0          0          0          0          0          5          5          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_pf_L1J20 #761060030
-TrigSignatureMoniMT                                 INFO -- #761060030 Events          20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #761060030 Features                              0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #761060030 Events          20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #761060030 Features                              0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_L1J15 #1509925407
-TrigSignatureMoniMT                                 INFO -- #1509925407 Events         20         20         0          0          0          0          0          0          0          0          0          0          7          -          7          
-TrigSignatureMoniMT                                 INFO -- #1509925407 Features                             0          0          0          0          0          0          0          0          0          0          7          -          
+TrigSignatureMoniMT                                 INFO -- #1509925407 Events         20         20         0          0          0          0          0          0          0          0          0          7          -          -          7          
+TrigSignatureMoniMT                                 INFO -- #1509925407 Features                             0          0          0          0          0          0          0          0          0          7          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_pf_L1J20 #4012311417
-TrigSignatureMoniMT                                 INFO -- #4012311417 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #4012311417 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #4012311417 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #4012311417 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_nojcalib_L1J20 #2042444294
-TrigSignatureMoniMT                                 INFO -- #2042444294 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #2042444294 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #2042444294 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2042444294 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_sktc_nojcalib_L1J20 #1542468090
-TrigSignatureMoniMT                                 INFO -- #1542468090 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #1542468090 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #1542468090 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #1542468090 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J100 #3327656707
-TrigSignatureMoniMT                                 INFO -- #3327656707 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3327656707 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #3327656707 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3327656707 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J20 #215408633
-TrigSignatureMoniMT                                 INFO -- #215408633 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #215408633 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #215408633 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #215408633 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J100 #1151767619
-TrigSignatureMoniMT                                 INFO -- #1151767619 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1151767619 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #1151767619 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1151767619 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J20 #3875082669
-TrigSignatureMoniMT                                 INFO -- #3875082669 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #3875082669 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_lcw_nojcalib_L1J100 #3093997295
-TrigSignatureMoniMT                                 INFO -- #3093997295 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3093997295 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #3093997295 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3093997295 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_30smcINF_L1J100 #2296827117
-TrigSignatureMoniMT                                 INFO -- #2296827117 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2296827117 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #2296827117 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2296827117 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_L1J100 #436385969
-TrigSignatureMoniMT                                 INFO -- #436385969 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #436385969 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #436385969 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #436385969 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j80_0eta240_2j60_320eta490_j0_dijetSEP80j1etSEP0j1eta240SEP80j2etSEP0j2eta240SEP700djmass_L1J20 #3634067472
-TrigSignatureMoniMT                                 INFO -- #3634067472 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3634067472 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #3634067472 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3634067472 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j80_L1J15 #2440872308
-TrigSignatureMoniMT                                 INFO -- #2440872308 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #2440872308 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #2440872308 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2440872308 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j80_j60_L1J15 #582699527
-TrigSignatureMoniMT                                 INFO -- #582699527 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #582699527 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #582699527 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #582699527 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j85_L1J20 #510475538
-TrigSignatureMoniMT                                 INFO -- #510475538 Events          20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #510475538 Features                              0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #510475538 Events          20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #510475538 Features                              0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j85_ftf_L1J20 #877042532
-TrigSignatureMoniMT                                 INFO -- #877042532 Events          20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #877042532 Features                              0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #877042532 Events          20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #877042532 Features                              0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j85_ftf_pf_L1J20 #1538535401
-TrigSignatureMoniMT                                 INFO -- #1538535401 Events         20         20         0          0          0          0          0          0          0          0          0          0          2          -          2          
-TrigSignatureMoniMT                                 INFO -- #1538535401 Features                             0          0          0          0          0          0          0          0          0          0          2          -          
+TrigSignatureMoniMT                                 INFO -- #1538535401 Events         20         20         0          0          0          0          0          0          0          0          0          2          -          -          2          
+TrigSignatureMoniMT                                 INFO -- #1538535401 Features                             0          0          0          0          0          0          0          0          0          2          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mb_sptrk_L1RD0_FILLED #4097312640
 TrigSignatureMoniMT                                 INFO -- #4097312640 Events         20         20         20         19         -          -          -          -          -          -          -          -          -          -          19         
 TrigSignatureMoniMT                                 INFO -- #4097312640 Features                             20         19         -          -          -          -          -          -          -          -          -          -          
@@ -389,20 +389,23 @@ TrigSignatureMoniMT                                 INFO HLT_mu14_L1MU10 #169690
 TrigSignatureMoniMT                                 INFO -- #1696906927 Events         20         20         0          0          0          0          1          1          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1696906927 Features                             0          0          0          0          1          1          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu20_2mu4noL1_L1MU20 #1029128679
-TrigSignatureMoniMT                                 INFO -- #1029128679 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1029128679 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #1029128679 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #1029128679 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu20_ivar_L1MU6 #2083734526
 TrigSignatureMoniMT                                 INFO -- #2083734526 Events         20         20         0          0          0          0          1          1          1          -          -          -          -          -          1          
 TrigSignatureMoniMT                                 INFO -- #2083734526 Features                             0          0          0          0          1          1          1          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_mu20_ivarmedium_mu8noL1_L1MU20 #3249386942
+TrigSignatureMoniMT                                 INFO -- #3249386942 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3249386942 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu22_2mu4noL1_L1MU20 #3427670100
-TrigSignatureMoniMT                                 INFO -- #3427670100 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3427670100 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #3427670100 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3427670100 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu22_mu8noL1_L1MU20 #3165652409
-TrigSignatureMoniMT                                 INFO -- #3165652409 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3165652409 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #3165652409 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3165652409 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu24_2mu4noL1_L1MU20 #3233544630
-TrigSignatureMoniMT                                 INFO -- #3233544630 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3233544630 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #3233544630 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3233544630 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu24_L1MU20 #417425162
 TrigSignatureMoniMT                                 INFO -- #417425162 Events          20         20         0          0          0          0          1          1          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #417425162 Features                              0          0          0          0          1          1          0          0          -          -          -          -          
@@ -413,8 +416,8 @@ TrigSignatureMoniMT                                 INFO HLT_mu24_ivarmedium_L1M
 TrigSignatureMoniMT                                 INFO -- #737407430 Events          20         20         0          0          0          0          1          1          0          0          0          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #737407430 Features                              0          0          0          0          1          1          0          0          0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu24_mu10noL1_L1MU20 #2563354236
-TrigSignatureMoniMT                                 INFO -- #2563354236 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2563354236 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #2563354236 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #2563354236 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu26_L1MU20 #311138376
 TrigSignatureMoniMT                                 INFO -- #311138376 Events          20         20         0          0          0          0          1          1          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #311138376 Features                              0          0          0          0          1          1          0          0          -          -          -          -          
@@ -422,17 +425,17 @@ TrigSignatureMoniMT                                 INFO HLT_mu26_ivarmedium_L1M
 TrigSignatureMoniMT                                 INFO -- #3411723090 Events         20         20         0          0          0          0          1          1          0          0          0          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3411723090 Features                             0          0          0          0          1          1          0          0          0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu26_mu10noL1_L1MU20 #2318302287
-TrigSignatureMoniMT                                 INFO -- #2318302287 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2318302287 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #2318302287 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #2318302287 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu26_mu8noL1_L1MU20 #2233067926
-TrigSignatureMoniMT                                 INFO -- #2233067926 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2233067926 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #2233067926 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #2233067926 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu28_ivarmedium_L1MU20 #1963262787
 TrigSignatureMoniMT                                 INFO -- #1963262787 Events         20         20         0          0          0          0          1          1          0          0          0          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1963262787 Features                             0          0          0          0          1          1          0          0          0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu28_mu8noL1_L1MU20 #86648125
-TrigSignatureMoniMT                                 INFO -- #86648125 Events           20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #86648125 Features                               0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #86648125 Events           20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #86648125 Features                               0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu35_ivarmedium_L1MU20 #597064890
 TrigSignatureMoniMT                                 INFO -- #597064890 Events          20         20         0          0          0          0          1          1          0          0          0          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #597064890 Features                              0          0          0          0          1          1          0          0          0          -          -          -          
@@ -467,17 +470,17 @@ TrigSignatureMoniMT                                 INFO HLT_mu6_mu4_L12MU4 #171
 TrigSignatureMoniMT                                 INFO -- #1713982776 Events         20         20         0          0          0          0          1          0          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1713982776 Features                             0          0          0          0          2          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu6_mu6noL1_L1MU6 #451489897
-TrigSignatureMoniMT                                 INFO -- #451489897 Events          20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #451489897 Features                              0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #451489897 Events          20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #451489897 Features                              0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_L1MU6 #3518031697
 TrigSignatureMoniMT                                 INFO -- #3518031697 Events         20         20         0          0          0          0          1          -          -          -          -          -          -          -          1          
 TrigSignatureMoniMT                                 INFO -- #3518031697 Features                             0          0          0          0          1          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_j45_nojcalib_L1J20 #1776326110
-TrigSignatureMoniMT                                 INFO -- #1776326110 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1776326110 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #1776326110 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1776326110 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_xe30_mht_L1XE10 #1876869651
-TrigSignatureMoniMT                                 INFO -- #1876869651 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1876869651 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #1876869651 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1876869651 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu80_L1MU20 #387900377
 TrigSignatureMoniMT                                 INFO -- #387900377 Events          20         20         0          0          0          0          1          1          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #387900377 Features                              0          0          0          0          1          1          0          0          -          -          -          -          
@@ -776,65 +779,65 @@ TrigSignatureMoniMT                                 INFO HLT_timeburner_L1All #8
 TrigSignatureMoniMT                                 INFO -- #819160059 Events          20         20         0          -          -          -          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #819160059 Features                              0          -          -          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe100_mht_L1XE50 #532175988
-TrigSignatureMoniMT                                 INFO -- #532175988 Events          20         20         0          0          0          0          0          0          0          0          0          0          1          -          1          
-TrigSignatureMoniMT                                 INFO -- #532175988 Features                              0          0          0          0          0          0          0          0          0          0          1          -          
+TrigSignatureMoniMT                                 INFO -- #532175988 Events          20         20         0          0          0          0          0          0          0          0          0          1          -          -          1          
+TrigSignatureMoniMT                                 INFO -- #532175988 Features                              0          0          0          0          0          0          0          0          0          1          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe100_pfsum_L1XE50 #1890237897
-TrigSignatureMoniMT                                 INFO -- #1890237897 Events         20         20         0          0          0          0          0          0          0          0          0          0          1          -          1          
-TrigSignatureMoniMT                                 INFO -- #1890237897 Features                             0          0          0          0          0          0          0          0          0          0          1          -          
+TrigSignatureMoniMT                                 INFO -- #1890237897 Events         20         20         0          0          0          0          0          0          0          0          0          1          -          -          1          
+TrigSignatureMoniMT                                 INFO -- #1890237897 Features                             0          0          0          0          0          0          0          0          0          1          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe100_tcpufit_L1XE50 #2803198799
-TrigSignatureMoniMT                                 INFO -- #2803198799 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2803198799 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #2803198799 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2803198799 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe100_trkmht_L1XE50 #1055916731
-TrigSignatureMoniMT                                 INFO -- #1055916731 Events         20         20         0          0          0          0          0          0          0          0          0          0          1          -          1          
-TrigSignatureMoniMT                                 INFO -- #1055916731 Features                             0          0          0          0          0          0          0          0          0          0          1          -          
+TrigSignatureMoniMT                                 INFO -- #1055916731 Events         20         20         0          0          0          0          0          0          0          0          0          1          -          -          1          
+TrigSignatureMoniMT                                 INFO -- #1055916731 Features                             0          0          0          0          0          0          0          0          0          1          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe100_trkmht_xe85_tcpufit_xe65_cell_L1XE50 #451622546
-TrigSignatureMoniMT                                 INFO -- #451622546 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #451622546 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #451622546 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #451622546 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe110_mht_L1XE50 #3030733259
-TrigSignatureMoniMT                                 INFO -- #3030733259 Events         20         20         0          0          0          0          0          0          0          0          0          0          1          -          1          
-TrigSignatureMoniMT                                 INFO -- #3030733259 Features                             0          0          0          0          0          0          0          0          0          0          1          -          
+TrigSignatureMoniMT                                 INFO -- #3030733259 Events         20         20         0          0          0          0          0          0          0          0          0          1          -          -          1          
+TrigSignatureMoniMT                                 INFO -- #3030733259 Features                             0          0          0          0          0          0          0          0          0          1          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe110_tc_em_L1XE50 #607113828
-TrigSignatureMoniMT                                 INFO -- #607113828 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #607113828 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #607113828 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #607113828 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe110_tcpufit_L1XE50 #892853397
-TrigSignatureMoniMT                                 INFO -- #892853397 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #892853397 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #892853397 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #892853397 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_cell_L1XE10 #1649696554
-TrigSignatureMoniMT                                 INFO -- #1649696554 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #1649696554 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #1649696554 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #1649696554 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_cell_xe30_tcpufit_L1XE10 #3768353779
-TrigSignatureMoniMT                                 INFO -- #3768353779 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #3768353779 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #3768353779 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3768353779 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_cvfpufit_L1XE10 #3860749499
-TrigSignatureMoniMT                                 INFO -- #3860749499 Events         20         20         0          0          0          0          0          0          0          0          0          0          6          -          6          
-TrigSignatureMoniMT                                 INFO -- #3860749499 Features                             0          0          0          0          0          0          0          0          0          0          6          -          
+TrigSignatureMoniMT                                 INFO -- #3860749499 Events         20         20         0          0          0          0          0          0          0          0          0          6          -          -          6          
+TrigSignatureMoniMT                                 INFO -- #3860749499 Features                             0          0          0          0          0          0          0          0          0          6          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_mht_L1XE10 #3626903018
-TrigSignatureMoniMT                                 INFO -- #3626903018 Events         20         20         0          0          0          0          0          0          0          0          0          0          14         -          14         
-TrigSignatureMoniMT                                 INFO -- #3626903018 Features                             0          0          0          0          0          0          0          0          0          0          14         -          
+TrigSignatureMoniMT                                 INFO -- #3626903018 Events         20         20         0          0          0          0          0          0          0          0          0          14         -          -          14         
+TrigSignatureMoniMT                                 INFO -- #3626903018 Features                             0          0          0          0          0          0          0          0          0          14         -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_mhtpufit_em_subjesgscIS_L1XE10 #689201557
-TrigSignatureMoniMT                                 INFO -- #689201557 Events          20         20         0          0          0          0          0          0          0          0          0          0          5          -          5          
-TrigSignatureMoniMT                                 INFO -- #689201557 Features                              0          0          0          0          0          0          0          0          0          0          5          -          
+TrigSignatureMoniMT                                 INFO -- #689201557 Events          20         20         0          0          0          0          0          0          0          0          0          5          -          -          5          
+TrigSignatureMoniMT                                 INFO -- #689201557 Features                              0          0          0          0          0          0          0          0          0          5          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_mhtpufit_pf_subjesgscIS_L1XE10 #1886909707
-TrigSignatureMoniMT                                 INFO -- #1886909707 Events         20         20         0          0          0          0          0          0          0          0          0          0          4          -          4          
-TrigSignatureMoniMT                                 INFO -- #1886909707 Features                             0          0          0          0          0          0          0          0          0          0          4          -          
+TrigSignatureMoniMT                                 INFO -- #1886909707 Events         20         20         0          0          0          0          0          0          0          0          0          4          -          -          4          
+TrigSignatureMoniMT                                 INFO -- #1886909707 Features                             0          0          0          0          0          0          0          0          0          4          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_pfopufit_L1XE10 #2252641537
-TrigSignatureMoniMT                                 INFO -- #2252641537 Events         20         20         0          0          0          0          0          0          0          0          0          0          4          -          4          
-TrigSignatureMoniMT                                 INFO -- #2252641537 Features                             0          0          0          0          0          0          0          0          0          0          4          -          
+TrigSignatureMoniMT                                 INFO -- #2252641537 Events         20         20         0          0          0          0          0          0          0          0          0          4          -          -          4          
+TrigSignatureMoniMT                                 INFO -- #2252641537 Features                             0          0          0          0          0          0          0          0          0          4          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_pfsum_L1XE10 #998713382
-TrigSignatureMoniMT                                 INFO -- #998713382 Events          20         20         0          0          0          0          0          0          0          0          0          0          5          -          5          
-TrigSignatureMoniMT                                 INFO -- #998713382 Features                              0          0          0          0          0          0          0          0          0          0          5          -          
+TrigSignatureMoniMT                                 INFO -- #998713382 Events          20         20         0          0          0          0          0          0          0          0          0          5          -          -          5          
+TrigSignatureMoniMT                                 INFO -- #998713382 Features                              0          0          0          0          0          0          0          0          0          5          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_tcpufit_L1XE10 #1583719916
-TrigSignatureMoniMT                                 INFO -- #1583719916 Events         20         20         0          0          0          0          0          0          0          0          0          0          6          -          6          
-TrigSignatureMoniMT                                 INFO -- #1583719916 Features                             0          0          0          0          0          0          0          0          0          0          6          -          
+TrigSignatureMoniMT                                 INFO -- #1583719916 Events         20         20         0          0          0          0          0          0          0          0          0          6          -          -          6          
+TrigSignatureMoniMT                                 INFO -- #1583719916 Features                             0          0          0          0          0          0          0          0          0          6          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_trkmht_L1XE10 #2468872349
-TrigSignatureMoniMT                                 INFO -- #2468872349 Events         20         20         0          0          0          0          0          0          0          0          0          0          4          -          4          
-TrigSignatureMoniMT                                 INFO -- #2468872349 Features                             0          0          0          0          0          0          0          0          0          0          4          -          
+TrigSignatureMoniMT                                 INFO -- #2468872349 Events         20         20         0          0          0          0          0          0          0          0          0          4          -          -          4          
+TrigSignatureMoniMT                                 INFO -- #2468872349 Features                             0          0          0          0          0          0          0          0          0          4          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe65_cell_L1XE50 #531141817
-TrigSignatureMoniMT                                 INFO -- #531141817 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #531141817 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #531141817 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #531141817 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe65_cell_xe110_tcpufit_L1XE50 #115518400
-TrigSignatureMoniMT                                 INFO -- #115518400 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #115518400 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #115518400 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #115518400 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe95_trkmht_xe90_tcpufit_xe75_cell_L1XE50 #302256132
-TrigSignatureMoniMT                                 INFO -- #302256132 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #302256132 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #302256132 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #302256132 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
index 05bf7f0d3c65..c4284359f650 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
@@ -173,13 +173,14 @@ def triggerSummaryCfg(flags, hypos):
     allChains = OrderedDict()
 
     
-    for stepName, stepHypos in sorted( hypos.items() ):
+    # lambda sort because we have strings Step1 Step2 ... Step10 Step11 and python sorts that
+    # to Step10 Step11 Step1 Step2
+    for stepName, stepHypos in sorted( hypos.items(), key=lambda x : int(x[0].split('_')[0][4:]) ):
         # order hypos so that ComboHypos are last ones
         orderedStepHypos = sorted(stepHypos, key=lambda hypo: __isCombo(hypo))  
         for hypo in orderedStepHypos:
             hypoChains,hypoOutputKey = __decisionsFromHypo( hypo )
             allChains.update( OrderedDict.fromkeys( hypoChains, hypoOutputKey ) )
-
     from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
     from L1Decoder.L1DecoderConfig import mapThresholdToL1DecisionCollection
     if len(TriggerConfigHLT.dicts()) == 0:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
index b40874b46402..c3553ff78002 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
@@ -59,9 +59,32 @@ class ChainConfigurationBase(object):
         return ChainStep(stepName, Sequences=[], multiplicity=[] ,chainDicts=[self.dict])
  
     def buildChain(self, chainSteps):
+    
+        alignmentGroups = []
+        if isinstance(self.chainPart, dict):
+            alignmentGroups = [self.chainPart['alignmentGroup']]
+        elif isinstance(self.chainPart, list):
+            
+            alignmentGroups = [cp['alignmentGroup'] for cp in self.chainPart]
+            testAlignGrps = list(set(alignmentGroups))
+            if not(len(testAlignGrps) == 1 and testAlignGrps[0] == 'JetMET'):
+                log.error("ChainConfigurationBase.buildChain(): number of chainParts does not correspond chainSteps")    
+                log.error('ChainConfigurationBase.buildChain() chainPart: %s',self.chainPart)
+                log.error("ChainConfigurationBase.buildChain() alignmentGroups: %s", alignmentGroups)
+                log.error("ChainConfigurationBase.buildChain() chainName: %s", self.chainName)
+                log.error("ChainConfigurationBase.buildChain() chainSteps: %s", chainSteps)               
+            else:
+                alignmentGroups = testAlignGrps            
+   
+        else:
+            log.error("ChainConfigurationBase.buildChain(): chainPart is not a list or dict, not sure what to do here! %s	", self.chainPart)
+              
         myChain = Chain(name = self.chainName,
                         ChainSteps = chainSteps,
-                        L1Thresholds = [self.L1Threshold] )
+                        L1Thresholds = [self.L1Threshold],
+                        nSteps = [len(chainSteps)], # not true for combined chains
+                        alignmentGroups = alignmentGroups
+                         )
 
         return myChain
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py
index e2752a8dcdfe..3bedb1670031 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py
@@ -65,7 +65,7 @@ def splitInterSignatureChainDict(chainDict):
                     
     #log.info("ListOfSplitChainDicts", chainPart['chainPartName'])
     
-    #oder the splitted dicts
+    #order the splitted dicts
     orderedListOfSplitChainDicts = []
     if "mergingOrder" not in chainDict:
         log.debug("No merging order given for chain %s.", chainDict['chainName'])
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
index 0ae26774ca47..6bdde51d52cf 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
@@ -10,6 +10,9 @@ import re
 
 def mergeChainDefs(listOfChainDefs, chainDict):
 
+    #chainDefList is a list of Chain() objects
+    #one for each part in the chain
+
     strategy = chainDict["mergingStrategy"]
     offset = chainDict["mergingOffset"]
     log.info("%s: Combine by using %s merging", chainDict['chainName'], strategy)
@@ -33,18 +36,23 @@ def mergeParallel(chainDefList, offset):
     nSteps = []
     chainName = ''
     l1Thresholds = []
-
+    alignmentGroups = []
 
     for cConfig in chainDefList:
         if chainName == '':
             chainName = cConfig.name
         elif chainName != cConfig.name:
             log.error("Something is wrong with the combined chain name: cConfig.name = %s while chainName = %s", cConfig.name, chainName)
-            
+        
         allSteps.append(cConfig.steps)
         nSteps.append(len(cConfig.steps))
         l1Thresholds.extend(cConfig.vseeds)
-
+        if len(cConfig.alignmentGroups) > 1:
+            log.error("Merging an already merged chain? This is odd! %s",cConfig.alignmentGroups)
+        elif len(cConfig.alignmentGroups) == 1:
+            alignmentGroups.append(cConfig.alignmentGroups[0])
+        else: 
+            log.info("Alignment groups are empty for this combined chain - if this is not _newJO, this is not ok!")
     import itertools
     if 'zip_longest' in dir(itertools):
         from itertools import zip_longest
@@ -61,7 +69,8 @@ def mergeParallel(chainDefList, offset):
         combStep = makeCombinedStep(mySteps, step_index+1, chainDefList)
         combChainSteps.append(combStep)
                                   
-    combinedChainDef = Chain(chainName, ChainSteps=combChainSteps, L1Thresholds=l1Thresholds)
+    combinedChainDef = Chain(chainName, ChainSteps=combChainSteps, L1Thresholds=l1Thresholds, 
+                                nSteps = nSteps, alignmentGroups = alignmentGroups)
 
     log.debug("Parallel merged chain %s with these steps:", chainName)
     for step in combinedChainDef.steps:
@@ -113,7 +122,7 @@ def mergeSerial(chainDefList):
     nSteps = []
     chainName = ''
     l1Thresholds = []
-
+    alignmentGroups = []
     log.debug('Merge chainDefList:')
     log.debug(chainDefList)
 
@@ -126,6 +135,9 @@ def mergeSerial(chainDefList):
         allSteps.append(cConfig.steps)
         nSteps.append(len(cConfig.steps))
         l1Thresholds.extend(cConfig.vseeds)
+        if len(cConfig.alignmentGroups) > 1:
+            log.error("Merging an already merged chain? This is odd! %s",cConfig.alignmentGroups)
+        alignmentGroups.append(cConfig.alignmentGroups[0])
 
     serialSteps = serial_zip(allSteps, chainName)
     mySerialSteps = deepcopy(serialSteps)
@@ -142,7 +154,8 @@ def mergeSerial(chainDefList):
     else:
         log.info("Have to deal with uneven number of chain steps, there might be none's appearing in sequence list => to be fixed")
                                   
-    combinedChainDef = Chain(chainName, ChainSteps=combChainSteps, L1Thresholds=l1Thresholds)
+    combinedChainDef = Chain(chainName, ChainSteps=combChainSteps, L1Thresholds=l1Thresholds,
+                               nSteps = nSteps, alignmentGroups = alignmentGroups)
 
     log.debug("Serial merged chain %s with these steps:", chainName)
     for step in combinedChainDef.steps:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
index ba67d57d9066..0c5dc44a5162 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
@@ -221,7 +221,9 @@ def analyseChainName(chainName, L1thresholds, L1item):
     # ---- obtain dictionary parts for signature defining patterns ----
     from .SignatureDicts import getSignatureNameFromToken, AllowedCosmicChainIdentifiers, \
         AllowedCalibChainIdentifiers, AllowedMonitorChainIdentifiers, AllowedBeamspotChainIdentifiers
-
+    
+    from .MenuAlignmentTools import getAlignmentGroupFromPattern
+    
     def buildDict(signature, sigToken ):
         groupdict = {'signature': signature, 'threshold': '', 'multiplicity': '',
                      'trigType': sigToken, 'extra': ''}
@@ -256,7 +258,10 @@ def analyseChainName(chainName, L1thresholds, L1item):
             log.debug("multichainindex: %s", multichainindex)
 
             sName = getSignatureNameFromToken(cpart)
+            
             groupdict['signature'] = sName
+            groupdict['alignmentGroup'] = getAlignmentGroupFromPattern(sName, groupdict['extra'])
+            
             log.debug('groupdictionary groupdict: %s', groupdict)
             mdicts.append(groupdict)
 
@@ -338,6 +343,7 @@ def analyseChainName(chainName, L1thresholds, L1item):
         chainProperties['multiplicity'] = multiplicity
         chainProperties['threshold']=mdicts[chainindex]['threshold']
         chainProperties['signature']=mdicts[chainindex]['signature']
+        chainProperties['alignmentGroup'] = getAlignmentGroupFromPattern(mdicts[chainindex]['signature'], mdicts[chainindex]['extra'])
 
         # if we have a L1 topo in a multi-chain then we want to remove it from the chain name
         # but only if it's the same as the L1item_main; otherwise it belongs to chain part and we q
@@ -358,11 +364,13 @@ def analyseChainName(chainName, L1thresholds, L1item):
             parts.pop(0)
 
 
-        #---- Check if topo is a bphsyics topo -> change signature ----
+        #---- Check if topo is a bphysics topo -> change signature ----
         from .SignatureDicts import AllowedTopos_Bphysics
         for t in genchainDict['topo']:
             if (t in AllowedTopos_Bphysics):
                 chainProperties['signature'] = 'Bphysics'
+                chainProperties['alignmentGroup'] = getAlignmentGroupFromPattern('Bphysics', mdicts[chainindex]['extra'])
+
 
 
         # ---- import the relevant dictionaries for each part of the chain ----
@@ -448,7 +456,9 @@ def analyseChainName(chainName, L1thresholds, L1item):
     for cPart in allChainProperties:
         if cPart['signature'] == 'Jet' and cPart['bTag'] != '':
             cPart['signature'] = 'Bjet'
+            cPart['alignmentGroup'] = getAlignmentGroupFromPattern('Bjet', cPart['extra'])
         genchainDict['signatures'] += [cPart['signature']]
+        genchainDict['alignmentGroups'] += [cPart['alignmentGroup']]
 
     #genchainDict['signature'] = allChainProperties[0]['signature']
 
@@ -480,7 +490,8 @@ def dictFromChainName(chainInfo):
         mergingOrder    = []
         topoStartFrom   = ''
 
-    elif 'ChainProp' in str(type(chainInfo)):
+    elif 'ChainProp' in str(type(chainInfo)):	
+        #this is how we define chains in the menu - the normal behaviour of this function
         chainName       = chainInfo.name
         l1Thresholds    = chainInfo.l1SeedThresholds
         stream          = chainInfo.stream
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index fd6cedfbc4a8..f58f6db1bed4 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -16,7 +16,7 @@ from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import dictFromChainName
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitInterSignatureChainDict
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuPrescaleConfig import MenuPrescaleConfig, applyHLTPrescale
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainMerging import mergeChainDefs
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuAlignmentTools import analyseCombinations, groupSignatures, setChainSignatures
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuAlignmentTools import analyseCombinations
 from TriggerMenuMT.HLTMenuConfig.CommonSequences import EventBuildingSequenceSetup
 
 from AthenaCommon.Logging import logging
@@ -168,7 +168,7 @@ class GenerateMenuMT(object):
 
         all_chains = []
         combinations_in_menu = []
-        signatures_to_align = set()
+        alignmentGroups_to_align = set()
         length_of_configs = {}
         for chain in chainsInMenu:
             log.debug("Now processing chain: %s ", chain) 
@@ -185,46 +185,33 @@ class GenerateMenuMT(object):
             
             all_chains += [(chainDict,chainConfig,lengthOfChainConfigs)]
             
-            #update the signature length dictionary if we have a longer number of steps
+            #update the alignment group length dictionary if we have a longer number of steps
             #or the signature isn't registered in the dictionary yet
-            for config_length, config_sig in lengthOfChainConfigs:
-                if config_sig in length_of_configs:
-                    if config_length > length_of_configs[config_sig]:
-                        length_of_configs[config_sig] = config_length
+            for config_length, config_grp in lengthOfChainConfigs:
+                if config_grp in length_of_configs:
+                    if config_length > length_of_configs[config_grp]:
+                        length_of_configs[config_grp] = config_length
                 else:
-                    length_of_configs[config_sig] = config_length
-
-            # find the chains that contain more than one signature - what combinations do we need to deal with?
-            # using sets here so we don't end up with duplicates - though in the future this may have to be revisited
-            # if we split signatures into multiple types of algorithm
-            if len(set(chainDict['signatures'])) > 1:  
-                combinations_in_menu += [list(set(chainDict['signatures']))]
-                for sig in list(set(chainDict['signatures'])):
-                    signatures_to_align.update([sig])
+                    length_of_configs[config_grp] = config_length
+
+            # find the chains that contain more than one alignment group, to keep track
+            # of what combinations do we need to deal with.
+            # we're using sets here so we don't end up with duplicates
+            if len(set(chainDict['alignmentGroups'])) > 1:  
+                combinations_in_menu += [list(set(chainDict['alignmentGroups']))]
+                for align_group in list(set(chainDict['alignmentGroups'])):
+                    alignmentGroups_to_align.update([align_group])
         
         # align event building sequences
         EventBuildingSequenceSetup.alignEventBuildingSteps(all_chains)
 
-        #will likely always be true, but the grouping could be redefined
-        groupPeskySignatures = True
-        
-        if groupPeskySignatures:    
-            # do some replacing of Electron --> Egamma, Photon --> Egamma
-            # Jet/MET/b-jet --> JetMET
-            # B-physics chains are hard-coded as muon chains, since they run muons
-            #    --> any B-->ee chains would need to be set as egamma!
-        
-            # these modified signatures are only used for the aligning! We don't overwrite 
-            # any of the signatures the chains are in.
-            combinations_in_menu,signatures_to_align,length_of_configs = groupSignatures(combinations_in_menu, signatures_to_align,length_of_configs)
-
-
         #dict of signature: set it belongs to
         #e.g. {'Electron': ['Electron','Muon','Photon']}        
-        signature_sets_to_align = analyseCombinations(combinations_in_menu, signatures_to_align, doGroupSignatures = groupPeskySignatures)
-        
-        log.debug('Aligning the following signatures with sets: %s',signature_sets_to_align)
+        alignmentGroup_sets_to_align = analyseCombinations(combinations_in_menu, alignmentGroups_to_align)
         
+        log.debug('Aligning the following signatures with sets: %s',alignmentGroup_sets_to_align)
+        log.debug('Length of each of the alignment groups: %s',length_of_configs)
+
         for chainDict,chainConfig,lengthOfChainConfigs in all_chains:
         
               # start by ordering electron, photon, muon by having e+mu, g+mu, e+g chains
@@ -236,50 +223,47 @@ class GenerateMenuMT(object):
               # is greater than the number of electron steps combined chain. Assume that the max length of an electron chain occurs 
               # in a combined chain.
               
-              signatures = chainDict['signatures']
-              
-              if groupPeskySignatures:
-                signatures, lengthOfChainConfigs = setChainSignatures(signatures, lengthOfChainConfigs)
-    
+              alignmentGroups = chainDict['alignmentGroups']
+            
               #parallel-merged single-signature chains or single signature chains. Anything that needs no splitting!
-              if len(set(signatures)) == 1: 
-                  if signatures[0] not in signature_sets_to_align or len(signature_sets_to_align[signatures[0]]) == 1:
-                      # no need to align lonely signatures
-                      # the latter condition should never happen, because we only put in signatures that are 
+              if len(set(alignmentGroups)) == 1: 
+                  if alignmentGroups[0] not in alignmentGroup_sets_to_align or len(alignmentGroup_sets_to_align[alignmentGroups[0]]) == 1:
+                      # no need to align lonely alignment groups
+                      # the latter condition should never happen, because we only put in alignment groups that are 
                       # in combined chains, and thus will need *some* aligning. but good to check in any case.
-                      log.debug("Finished with retrieving chain configuration for chain %s", chain.name)
+                      log.debug("Finished with retrieving chain configuration for chain %s", chainDict['chainName'])
                       chainConfig.numberAllSteps()
                       TriggerConfigHLT.registerChain( chainDict, chainConfig )
                       continue
-                  elif signatures[0] == signature_sets_to_align[signatures[0]][0]:
+                  elif alignmentGroups[0] == alignmentGroup_sets_to_align[alignmentGroups[0]][0]:
                       # if it's the first chain in the set to be aligned, again - nothing to do here.
-                      log.debug("Finished with retrieving chain configuration for chain %s", chain.name) 
+                      log.debug("Finished with retrieving chain configuration for chain %s", chainDict['chainName']) 
                       chainConfig.numberAllSteps()
                       TriggerConfigHLT.registerChain( chainDict, chainConfig )
                       continue                       
                   else:
                       # now we know that empty steps are necessary before this chain. we can loop through and add accordingly
                       # but we want to do this in reverse
-                      the_align_sigs = signature_sets_to_align[signatures[0]][:signature_sets_to_align[signatures[0]].index(signatures[0])]
+                      the_align_sigs = alignmentGroup_sets_to_align[alignmentGroups[0]][:alignmentGroup_sets_to_align[alignmentGroups[0]].index(alignmentGroups[0])]
                       the_align_sigs.reverse()
                       
                       for align_sig in the_align_sigs:
                           chainConfig.insertEmptySteps(chainDict,'Empty'+align_sig+'Align',length_of_configs[align_sig],0)         
 
-                      log.debug("Finished with retrieving chain configuration for chain %s", chain.name)
+                      log.debug("Finished with retrieving chain configuration for chain %s", chainDict['chainName'])
                       chainConfig.numberAllSteps()
                       TriggerConfigHLT.registerChain( chainDict, chainConfig )
                           
-              elif len(signatures) == 2:
+              elif len(alignmentGroups) == 2:
                   #check for a few bad conditions first:
-                  if(signatures[0] not in signature_sets_to_align or signatures[1] not in signature_sets_to_align):
-                      log.error(" one of the signatures in %s is not available in the sets to align dictionary!", signatures)
-                  elif signature_sets_to_align[signatures[0]] != signature_sets_to_align[signatures[1]]:
-                      log.error(" the two signatures %s point to different sets in the sets to align dictionary. Set1: %s, set2: %s!", 
-                                signatures, signature_sets_to_align[signatures[0]],signature_sets_to_align[signatures[1]])
+                  if(alignmentGroups[0] not in alignmentGroup_sets_to_align or alignmentGroups[1] not in alignmentGroup_sets_to_align):
+                      log.error(" one of the alignmentGroups in %s is not available in the sets to align dictionary!", alignmentGroups)
+                  elif alignmentGroup_sets_to_align[alignmentGroups[0]] != alignmentGroup_sets_to_align[alignmentGroups[1]]:
+                      log.error(" the two alignmentGroups %s point to different sets in the sets to align dictionary. Set1: %s, set2: %s!", 
+                                alignmentGroups, alignmentGroup_sets_to_align[alignmentGroups[0]],alignmentGroup_sets_to_align[alignmentGroups[1]])
                 
-                  if len(signature_sets_to_align[signatures[0]]) == 2:
-                      
+                  if len(alignmentGroup_sets_to_align[alignmentGroups[0]]) == 2:
+
                       # if the pair is on its own, then we just make sure the first signature's number
                       # of steps is equal to the max in that signature (so the next signature starts at the right step)
                       
@@ -287,63 +271,74 @@ class GenerateMenuMT(object):
                       # overwrite duplicates yet. 
                       # probably, at some point, will need to divide this beyond signature but instead as unique sequence within a signature. 
                       # munoL1 is already one case...
-                      length_firstsig = 0
-                      max_length_firstsig = length_of_configs[signature_sets_to_align[signatures[0]][0]]
-                      for config_length,config_sig in lengthOfChainConfigs:
-                          if config_sig == signature_sets_to_align[signatures[0]][0]:
-                              length_firstsig = config_length
-                      if length_firstsig < max_length_firstsig:
-                          #too short! gotta add padding steps between two signatures...
-                          needed_steps = max_length_firstsig - length_firstsig
-                          chainConfig.insertEmptySteps(chainDict,'Empty'+signature_sets_to_align[signatures[0]][0]+'Align',needed_steps,length_firstsig) 
+                      length_firstgrp = 0
+                      max_length_firstgrp = length_of_configs[alignmentGroup_sets_to_align[alignmentGroups[0]][0]]
+                      for config_length,config_grp in lengthOfChainConfigs:
+                          if config_grp == alignmentGroup_sets_to_align[alignmentGroups[0]][0]:
+                              length_firstgrp = config_length
+                      if length_firstgrp < max_length_firstgrp:
+                          #too short! need to add padding steps between two alignment groups...
+                          needed_steps = max_length_firstgrp - length_firstgrp
+                          chainConfig.insertEmptySteps(chainDict,'Empty'+alignmentGroup_sets_to_align[alignmentGroups[0]][0]+'Align',needed_steps,length_firstgrp) 
                       
-                      elif length_firstsig > max_length_firstsig:
-                          log.error("%s first signature length %d is greater than the max calculated, %d",chainDict.name,length_firstsig, max_length_firstsig)     
+                      elif length_firstgrp > max_length_firstgrp:
+                          log.error("%s first signature length %d is greater than the max calculated, %d",chainDict.name,length_firstgrp, max_length_firstgrp)     
                   
-                      log.debug("Finished with retrieving chain configuration for chain %s", chain.name)
+                      log.debug("Finished with retrieving chain configuration for chain %s", chainDict['chainName'])
                       chainConfig.numberAllSteps()
                       TriggerConfigHLT.registerChain( chainDict, chainConfig )
   
 
                   #this should probably work for signatures > 2, but might be a few gotchas (and errors need updating)
-                  if len(signature_sets_to_align[signatures[0]]) > 2:
-                      if(signatures[0] not in signature_sets_to_align or signatures[1] not in signature_sets_to_align):
-                          log.error(" one of the signatures in %s is not available in the sets to align dictionary!", signatures)
-                      elif signature_sets_to_align[signatures[0]] != signature_sets_to_align[signatures[1]]:
-                          log.error(" the two signatures %s point to different sets in the sets to align dictionary. Set1: %s, set2: %s!", 
-                                     signatures, signature_sets_to_align[signatures[0]], signature_sets_to_align[signatures[1]])
+                  elif len(alignmentGroup_sets_to_align[alignmentGroups[0]]) > 2:
+                      if(alignmentGroups[0] not in alignmentGroup_sets_to_align or alignmentGroups[1] not in alignmentGroup_sets_to_align):
+                          log.error(" one of the alignmentGroups in %s is not available in the sets to align dictionary!", alignmentGroups)
+                      elif alignmentGroup_sets_to_align[alignmentGroups[0]] != alignmentGroup_sets_to_align[alignmentGroups[1]]:
+                          log.error(" the two alignmentGroups %s point to different sets in the sets to align dictionary. Set1: %s, set2: %s!", 
+                                     alignmentGroups, alignmentGroup_sets_to_align[alignmentGroups[0]], alignmentGroup_sets_to_align[alignmentGroups[1]])
                       
-                      # we need to know which signatures are in the chain in which order. Assume this is always stored correctly.
+                      # we need to know which alignmentGroups are in the chain in which order. Assume this is always stored correctly.
                       # (this should be true)
                       
                       # never need to align the last chain - it can end a different length, no problem.
                       # ignore any signatures after the end of those in this chain
 
-                      the_align_sigs = signature_sets_to_align[signatures[1]][:signature_sets_to_align[signatures[1]].index(signatures[1])]
-                      the_align_sigs.reverse()
-                      
-                      for align_sig in the_align_sigs:
-                          max_length_sig = length_of_configs[align_sig]
-                          if align_sig in signatures:
-                              length_sig = 0
-                              for config_length,config_sig in lengthOfChainConfigs:
-                                  if config_sig == align_sig:
-                                      length_sig = config_length
-                              if length_sig < max_length_sig:
-                                  #too short! gotta add padding steps between two signatures...
-                                  needed_steps = max_length_sig - length_sig
-                                  chainConfig.insertEmptySteps(chainDict,'Empty'+align_sig+'Align',needed_steps,length_sig) 
+                      alignGroups_set = alignmentGroup_sets_to_align[alignmentGroups[1]][:alignmentGroup_sets_to_align[alignmentGroups[1]].index(alignmentGroups[1])]
+                      alignGroups_set.reverse()
+                      grp_masks = [x in alignmentGroups for x in alignGroups_set]
+                      grp_lengths = []
+                      for align_grp,grp_in_chain in zip(alignGroups_set,grp_masks):
+                          if grp_in_chain:
+                              for config_length,config_grp in lengthOfChainConfigs:
+                                if config_grp == align_grp: 
+                                    grp_lengths += [config_length]
+                          else:
+                              grp_lengths += [0]
+                          
+                      for istep,(align_grp,grp_in_chain,length_in_chain) in enumerate(zip(alignGroups_set,grp_masks,grp_lengths)):
+                          # We're working our way backwards through the chain 
+                          # need to know how many steps are already before us!
+                          nSteps_before_grp = 0
+                          if istep < len(grp_lengths)-1: 
+                              nSteps_before_grp = sum(grp_lengths[istep+1:])
+                          max_length_grp = length_of_configs[align_grp]
+                          if grp_in_chain:
+                              if length_in_chain < max_length_grp:
+                                  #too short! gotta add padding steps between two alignmentGroups...
+                                  needed_steps = max_length_grp - length_in_chain
+                                  start_step = nSteps_before_grp + length_in_chain
+                                  chainConfig.insertEmptySteps(chainDict,'Empty'+align_grp+'Align',needed_steps,start_step) 
                           else:
                               # this sig isn't in the chain, but we still will need empty steps for it
                               # always add them to the start, because we're running in reverse order
-                              chainConfig.insertEmptySteps(chainDict,'Empty'+align_sig+'Align',length_of_configs[align_sig],0) 
+                              chainConfig.insertEmptySteps(chainDict,'Empty'+align_grp+'Align',length_of_configs[align_grp],nSteps_before_grp) 
                     
-                      log.debug("Finished with retrieving chain configuration for chain %s", chain.name) 
+                      log.debug("Finished with retrieving chain configuration for chain %s", chainDict['chainName']) 
                       chainConfig.numberAllSteps()
                       TriggerConfigHLT.registerChain( chainDict, chainConfig )               
               
               else: 
-                  log.error("Menu can't deal with combined chains with more than two signatures at the moment. oops...")
+                  log.error("Menu can't deal with combined chains with more than two alignmentGroups at the moment. oops...")
 
               if not TriggerConfigHLT.isChainRegistered(chainDict['chainName']):
                 log.error("Chain %s has not been registered in the menu!", chainDict['chainName'])
@@ -445,13 +440,17 @@ class GenerateMenuMT(object):
 
         # Loop over all chainDicts and send them off to their respective assembly code
         listOfChainConfigs = []
-        lengthOfChainConfigs = []
-
-        for chainDict in chainDicts:
-            chainConfigs = None
-            currentSig = chainDict['signature']
-            chainName = chainDict['chainName']
-            log.debug('Checking chainDict for chain %s in signature %s' , chainName, currentSig)
+        tmp_lengthOfChainConfigs = []
+
+        for chainPartDict in chainDicts:
+            chainPartConfig = None
+            currentSig = chainPartDict['signature']
+            currentAlignGroup = None
+            if len(chainPartDict['chainParts']) == 1:
+                currentAlignGroup = chainPartDict['chainParts'][0]['alignmentGroup']
+            
+            chainName = chainPartDict['chainName']
+            log.debug('Checking chainDict for chain %s in signature %s, alignment group %s' , chainName, currentSig, currentAlignGroup)
 
             sigFolder = ''
             if currentSig == 'Electron' or currentSig == 'Photon':
@@ -464,16 +463,28 @@ class GenerateMenuMT(object):
             if currentSig in self.availableSignatures and currentSig != 'Combined':
                 try:                    
                     log.debug("Trying to get chain config for %s in folder %s", currentSig, sigFolder)
-                    functionToCall ='TriggerMenuMT.HLTMenuConfig.' + sigFolder + '.Generate' + currentSig + 'ChainDefs.generateChainConfigs(chainDict)' 
-                    chainConfigs = eval(functionToCall)
+                    functionToCall ='TriggerMenuMT.HLTMenuConfig.' + sigFolder + '.Generate' + currentSig + 'ChainDefs.generateChainConfigs(chainPartDict)' 
+                    chainPartConfig = eval(functionToCall)
                 except RuntimeError:
                     log.exception( 'Problems creating ChainDef for chain\n %s ', chainName)
                     continue
             else:
-                log.error('Chain %s ignored - Signature not available', chainDict['chainName'])
-            listOfChainConfigs.append(chainConfigs)
-            lengthOfChainConfigs.append((len(chainConfigs.steps),currentSig))
-
+                log.error('Chain %s ignored - Signature not available', chainPartDict['chainName'])
+            log.debug("Chain %s chain configs: %s",chainPartDict['chainName'],chainPartConfig)
+            listOfChainConfigs.append(chainPartConfig)
+            tmp_lengthOfChainConfigs.append((chainPartConfig.nSteps,chainPartConfig.alignmentGroups))
+
+        # this will be a list of lists for inter-sig combined chains and a list with one 
+        # multi-element list for intra-sig combined chains
+        # here, we flatten it accordingly (works for both cases!)
+        lengthOfChainConfigs = []
+        for nSteps, aGrps in tmp_lengthOfChainConfigs:
+            if len(nSteps) != len(aGrps):
+                log.error("Chain part has %s steps and %s alignment groups - these don't match!",nSteps,aGrps)
+            else:
+                for a,b in zip(nSteps,aGrps):
+                    lengthOfChainConfigs.append((a,b))         
+            
         ## if log.isEnabledFor(logging.DEBUG):
         ##     import pprint
         ##     pp = pprint.PrettyPrinter(indent=4, depth=8)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 9a450d254159..926328d87d39 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -34,6 +34,7 @@ def setupMenu():
         ChainProp(name='HLT_mu6_idperf_L1MU6', groups=SingleMuonGroup),
         ChainProp(name='HLT_mu24_idperf_L1MU20', groups=SingleMuonGroup),
         ChainProp(name='HLT_mu6_mu6noL1_L1MU6', l1SeedThresholds=['MU6','FSNOSEED'], mergingStrategy='serial', groups=MultiMuonGroup),
+        ChainProp(name='HLT_mu20_ivarmedium_mu8noL1_L1MU20', l1SeedThresholds=['MU20','FSNOSEED'], mergingStrategy='serial', groups=MultiMuonGroup),
     
         #test chains
         ChainProp(name='HLT_mu6fast_L1MU6', groups=SingleMuonGroup),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
index 42273176c43f..7f45f471ed3d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
@@ -20,28 +20,39 @@ the_signature_grouping = OrderedDict([
     ('Jet','JetMET'),
     ('MET','JetMET'),
     ('Bjet','JetMET'),
+    ('MuonnoL1', 'MuonnoL1')
     ])
 
+def getAlignmentGroupFromPattern(sName, extra):
+    signature_for_alignment = sName + extra
+    
+    if signature_for_alignment in the_signature_grouping.keys():
+        return the_signature_grouping[signature_for_alignment]
+    elif sName in  the_signature_grouping.keys():
+        return the_signature_grouping[sName]
+    else:
+        log.info("No alignment grouping for signature %s (%s)",sName,extra)
+        return sName
+
 # Here, we use a list of all the signature combinations in the menu and the signature
 # groupings/orderings we've defined in the_signature_grouping to calculate which signatures
 # need to be ordered compared to which others.
 # The function returns a dictionary of an ordered list of signatures each signature belongs to
 #    e.g. 'Muon' : ['Egamma','Muon']    
-def analyseCombinations(combinations_in_menu, signatures_in_combinations, doGroupSignatures = True):
+def analyseCombinations(combinations_in_menu, alignmentGroups_in_combinations):
     
-        # need to find out of if a signature, or anything in combination with that signature, 
-        # is in combination with any other signature
-        # 1 electron, 2 photon, 3 muon, 4 tau, 5 jet, 6 met, 7 b-jet, 8 B-physics
-        # but some of these share input makers and algorithms, so they need to be grouped!
-        # alternatively, the IMs/signatures/etc. could have their names unique for each signature
-        sig_dict = {"Electron":0,"Photon":1,"Muon":2,"Tau":3,"Jet":4,"MET":5,"Bjet":6,"Bphysics":7}
+        # need to find out of if an alignment group, or anything in combination with that
+        # aligment group, is in combination with any other alignment group.
+        
+        # first we make a dictionary of the ordering, based on the_signature_grouping 
+        # e.g. 1 electron+photon, 2 muon, 3 tau, 4 jet/met/b-jet, 5 noL1 muons
+        sig_dict = {}
+        igrp = 0
+        for _,v in the_signature_grouping.items():
+            if v not in sig_dict:
+                sig_dict[v] = igrp
+                igrp += 1
         
-        # Egamma = Electron+Photon, JetMET = Jet/MET/Bjet shared for now, because they share an input maker!
-        # HT chain are (will be) part of the jet signature.
-        if doGroupSignatures:
-            seen = set()
-            sig_dict = dict((x,len(seen)-1) for x in the_signature_grouping.values() if not (x in seen or seen.add(x)))
-            log.debug('Grouping of signatures to align: %s',sig_dict)
         inv_sig_dict = {v: k for k, v in sig_dict.items()}
         
         the_matrix = np.eye((len(sig_dict)))
@@ -87,45 +98,13 @@ def analyseCombinations(combinations_in_menu, signatures_in_combinations, doGrou
         unique_by_sig = [[ inv_sig_dict[sig_int] for sig_int in setlist ] for setlist in unique_sets]
 
         sig_to_set = {}
-        for sig in signatures_in_combinations:
+        for sig in alignmentGroups_in_combinations:
             for aset in unique_by_sig:
                 if sig in aset:
                     sig_to_set[sig] = aset
          
         return sig_to_set
-        
-# redefine the various signature lists/dicts to use the grouped signatures (e.g. not
-# electron, photon but instead egamma)
-def groupSignatures(combinations_in_menu, signatures_to_align, length_of_configs):
-    for icomb,comb in enumerate(combinations_in_menu):
-        if any([acomb in the_signature_grouping for acomb in comb]):
-            tmpcomb = []
-            for asig in comb:
-                if asig in the_signature_grouping:
-                    tmpcomb += [the_signature_grouping[asig]]
-                else:
-                    # not sure this could come up - but if we have something random like minbias + muon chains? 
-                    tmpcomb += [asig]
-
-        combinations_in_menu[icomb] = tmpcomb
-        
-    signatures_to_align = list(signatures_to_align) #was a set, make a list!
-    for isig, asig in enumerate(signatures_to_align):
-        if asig in the_signature_grouping:
-            signatures_to_align[isig] = the_signature_grouping[asig]
-                                        
-    signatures_to_align = list(set(signatures_to_align)) #get rid of duplicates
-          
-    log.debug('Signatures that are going to be aligned: %s',signatures_to_align)
-    log.debug('Signature combinations that are in the menu: %s',combinations_in_menu)
-
-    for newsig in set(the_signature_grouping.values()):
-        if newsig not in length_of_configs:
-            # get all the signatures in the new sig:
-            corresponding_sig_lengths = [length_of_configs.get(oldsig,0) for oldsig in the_signature_grouping if the_signature_grouping[oldsig] == newsig]
-            length_of_configs[newsig] = max(corresponding_sig_lengths)
 
-    return combinations_in_menu, signatures_to_align, length_of_configs
 
 # takes the list of signatures in a chain and changes it to be the post-grouping signatures
 # e.g. ['Electron','Muon'] ==> ['Egamma','Muon] 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
index 6d5a84fe8621..180a86b256a0 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
@@ -517,15 +517,16 @@ class CAMenuSequence(MenuSequence):
 
 class Chain(object):
     """Basic class to define the trigger menu """
-    __slots__='name','steps','vseeds','L1decisions'
-    def __init__(self, name, ChainSteps, L1Thresholds):
+    __slots__ ='name','steps','nSteps','alignmentGroups','vseeds','L1decisions'
+    def __init__(self, name, ChainSteps, L1Thresholds, nSteps = [], alignmentGroups = []):
         """
         Construct the Chain from the steps
         Out of all arguments the ChainSteps & L1Thresholds are most relevant, the chain name is used in debug messages
         """
         self.name = name
         self.steps=ChainSteps
-
+        self.nSteps = nSteps
+        self.alignmentGroups = alignmentGroups
         self.vseeds=L1Thresholds
 
         from L1Decoder.L1DecoderConfig import mapThresholdToL1DecisionCollection
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 81ead00974c7..4040349be14f 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -50,6 +50,7 @@ ChainDictTemplate = {
     'L1item'        : '',
     'topo'          : '',
     'signatures'    : [],
+    'alignmentGroups' : [],
     'stream'        : '',
     'groups'        : [],
     'EBstep'        : '',
@@ -64,6 +65,7 @@ ChainDictTemplate = {
 TestChainParts = {
     'L1threshold'    : '',
     'signature'      : ['Test'],
+    'alignmentGroup' : ['Test'],
     'chainPartName'  : '',
     'multiplicity'   : '',
     'extra'          : ['muv1', 'muv1step', 'muv2', 'ev1', 'ev2', 'ev3', 'gv1', 'muEmpty1', 'muEmpty2', 'ev1dr', 'muv1dr'],
@@ -75,6 +77,7 @@ TestChainParts = {
 # ---- Test Dictionary of default Values ----
 TestChainParts_Default = {
     'signature'      : ['Test'],
+    'alignmentGroup' : ['Test'],
     'L1threshold'    : '',
     'multiplicity'   : '',
     'trigType'       : '',
@@ -88,13 +91,14 @@ TestChainParts_Default = {
 AllowedTopos_jet = []
 # ---- Jet Dictinary of all allowed Values ----
 JetChainParts = {
-    'signature'    : ['Jet'],
-    'L1threshold'  : '',
-    'chainPartName': '',
-    'threshold'    : '',
-    'multiplicity' : '',
-    'etaRange'     : ['0eta320', '320eta490', '0eta240', '0eta290'],
-    'jvt'          : ['011jvt', '015jvt', '059jvt'],
+    'signature'     : ['Jet'],
+    'alignmentGroup': ['Jet','JetMET'],
+    'L1threshold'   : '',
+    'chainPartName' : '',
+    'threshold'     : '',
+    'multiplicity'  : '',
+    'etaRange'      : ['0eta320', '320eta490', '0eta240', '0eta290'],
+    'jvt'           : ['011jvt', '015jvt', '059jvt'],
     # May need to reinstate in the event that preselection is
     # needed before running tracking
     #'gscThreshold' : ['gsc'],
@@ -132,31 +136,32 @@ JetChainParts = {
 
 # ---- Jet Dictinary of default Values ----
 JetChainParts_Default = {
-    'signature'    : ['Jet'],
-    'L1threshold'  : '',
-    'threshold'    : '',
-    'multiplicity' : '',
-    'etaRange'     : '0eta320',
-    'jvt'          : '',
-    'trigType'     :'j',
-    'extra'        : '',
-    'cleaning'     : 'noCleaning',
-    'recoAlg'      :'a4',
-    'dataType'     :'tc',
-    'calib'        :'em',
-    'jetCalib'     :'subjesIS',
-    'scan'         :'FS',
-    'addInfo'      : [],
-    'TLA'          : '',
-    'topo'         : [],
-    'bTag'         : '',
-    'bTracking'    : '',
-    'bConfig'      : [],
-    'bMatching'    : [],
-    'dataScouting' : '',
-    'trkopt'       : 'notrk',
-    'hypoScenario' : 'simple',
-    'smc'          : 'nosmc',
+    'signature'     : ['Jet'],
+    'alignmentGroup': ['Jet'],
+    'L1threshold'   : '',
+    'threshold'     : '',
+    'multiplicity'  : '',
+    'etaRange'      : '0eta320',
+    'jvt'           : '',
+    'trigType'      :'j',
+    'extra'         : '',
+    'cleaning'      : 'noCleaning',
+    'recoAlg'       :'a4',
+    'dataType'      :'tc',
+    'calib'         :'em',
+    'jetCalib'      :'subjesIS',
+    'scan'          :'FS',
+    'addInfo'       : [],
+    'TLA'           : '',
+    'topo'          : [],
+    'bTag'          : '',
+    'bTracking'     : '',
+    'bConfig'       : [],
+    'bMatching'     : [],
+    'dataScouting'  : '',
+    'trkopt'        : 'notrk',
+    'hypoScenario'  : 'simple',
+    'smc'           : 'nosmc',
 }
 
 # ---- bJet Dictionary of default Values that are different to the ones for normal jet chains ----
@@ -187,6 +192,7 @@ AllowedTopos_mu = []
 # ---- Muon Dictinary of all allowed Values ----
 MuonChainParts = {
     'signature'      : ['Muon'],
+    'alignmentGroup' : ['Muon','MuonnoL1'],
     'L1threshold'    : '',
     'chainPartName'  : [],
     'multiplicity'   : '',
@@ -204,6 +210,7 @@ MuonChainParts = {
 # ---- MuonDictinary of default Values ----
 MuonChainParts_Default = {
     'signature'      : ['Muon'],
+    'alignmentGroup' : ['Muon'],
     'L1threshold'    : '',
     'multiplicity'   : '',
     'trigType'       : ['mu'],
@@ -240,36 +247,38 @@ AllowedTopos_tau = []
 
 # ---- Tau Dictionary of all allowed Values ----
 TauChainParts = {
-    'signature'    : ['Tau'],
-    'L1threshold'  : '',
-    'chainPartName': '',
-    'threshold'    : '',
-    'preselection' : ['track', 'tracktwo', 'tracktwoEF', 'tracktwoMVA', 'tracktwoEFmvaTES', 'ptonly', ],
-    'selection'    : ['medium1', 'verylooseRNN', 'looseRNN', 'mediumRNN', 'tightRNN', 'perf', 'idperf'],
-    'multiplicity' : '',
-    'trigType'     : ['tau'],
-    'trkInfo'      : '',
-    'extra'        : '',
-    'recoAlg'      : '',
-    'calib'        : '',
-    'addInfo'      : ['IdTest'],
-    'topo'         : AllowedTopos_tau,
+    'signature'     : ['Tau'],
+    'alignmentGroup': ['Tau'],
+    'L1threshold'   : '',
+    'chainPartName' : '',
+    'threshold'     : '',
+    'preselection'  : ['track', 'tracktwo', 'tracktwoEF', 'tracktwoMVA', 'tracktwoEFmvaTES', 'ptonly', ],
+    'selection'     : ['medium1', 'verylooseRNN', 'looseRNN', 'mediumRNN', 'tightRNN', 'perf', 'idperf'],
+    'multiplicity'  : '',
+    'trigType'      : ['tau'],
+    'trkInfo'       : '',
+    'extra'         : '',
+    'recoAlg'       : '',
+    'calib'         : '',
+    'addInfo'       : ['IdTest'],
+    'topo'          : AllowedTopos_tau,
 }
 TauChainParts_Default = {
-    'signature'    : ['Tau'],
-    'L1threshold'  : '',
-    'chainPartName': '',
-    'threshold'    : '20',
-    'preselection' : 'tracktwo',
-    'selection'    : 'medium1',
-    'multiplicity' : '',
-    'trigType'     : ['tau'],
-    'trkInfo'      : [],
-    'extra'        : '',
-    'recoAlg'      : '',
-    'calib'        : '',
-    'addInfo'      : '',
-    'topo'         : [],
+    'signature'     : ['Tau'],
+    'alignmentGroup': ['Tau'],
+    'L1threshold'   : '',
+    'chainPartName' : '',
+    'threshold'     : '20',
+    'preselection'  : 'tracktwo',
+    'selection'     : 'medium1',
+    'multiplicity'  :  '',
+    'trigType'      : ['tau'],
+    'trkInfo'       : [],
+    'extra'         : '',
+    'recoAlg'       : '',
+    'calib'         : '',
+    'addInfo'       :  '',
+    'topo'          : [],
 }
 
 #==========================================================
@@ -278,26 +287,28 @@ TauChainParts_Default = {
 AllowedTopos_xe = []
 # ---- Met Dictinary of all allowed Values ----
 METChainParts = {
-    'signature'    : ['MET'],
-    'L1threshold'  : '',
-    'chainPartName': '',
-    'threshold'    : '',
-    'multiplicity' : '',
-    'topo'         : AllowedTopos_xe,
-    'trigType'     : ['xe'],
-    'extra'        : ['noL1'],
-    'calib'        : ['lcw','em'],
-    'jetCalib'     : JetChainParts['jetCalib'],
-    'L2recoAlg'    : [],
-    'EFrecoAlg'    : ['cell', 'tc', 'tcpufit', 'mht', 'trkmht', 'pfsum', 'cvfpufit', 'pfopufit', 'mhtpufit'],
-    'jetDataType'  : JetChainParts['dataType'],
-    'L2muonCorr'   : [],
-    'EFmuonCorr'   : [],
-    'addInfo'      : ['FStracks'],
+    'signature'      : ['MET'],
+    'alignmentGroup' : ['MET','JetMET'],
+    'L1threshold'    : '',
+    'chainPartName'  : '',
+    'threshold'      : '',
+    'multiplicity'   : '',
+    'topo'           : AllowedTopos_xe,
+    'trigType'       : ['xe'],
+    'extra'          : ['noL1'],
+    'calib'          : ['lcw','em'],
+    'jetCalib'       : JetChainParts['jetCalib'],
+    'L2recoAlg'      : [],
+    'EFrecoAlg'      : ['cell', 'tc', 'tcpufit', 'mht', 'trkmht', 'pfsum', 'cvfpufit', 'pfopufit', 'mhtpufit'],
+    'jetDataType'    : JetChainParts['dataType'],
+    'L2muonCorr'     : [],
+    'EFmuonCorr'     : [],
+    'addInfo'        : ['FStracks'],
 }
 # ---- MetDictinary of default Values ----
 METChainParts_Default = {
     'signature'      : ['MET'],
+    'alignmentGroup' : ['MET'],
     'L1threshold'    : '',
     'trigType'       : ['xe'],
     'threshold'      : '',
@@ -345,6 +356,7 @@ AllowedTopos_e = ["Jpsiee","Zeg","Zee"]
 # ---- Electron Dictinary of all allowed Values ----
 ElectronChainParts = {
     'signature'      : ['Electron'],
+    'alignmentGroup' : ['Electron','Egamma'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'extra'          : '',
@@ -363,6 +375,7 @@ ElectronChainParts = {
 # ---- Egamma Dictinary of default Values ----
 ElectronChainParts_Default = {
     'signature'      : ['Electron'],
+    'alignmentGroup' : ['Electron'],
     'multiplicity'   : '',
     'L1threshold'         : '',
     'trigType'       : '',
@@ -390,6 +403,7 @@ ElectronChainParts_Default = {
 PhotonChainParts = {
     'L1threshold'    : '',
     'signature'      : ['Photon'],
+    'alignmentGroup' : ['Photon','Egamma'],
     'chainPartName'  : '',
     'multiplicity'   : '',    
     'trigType'       : ['g'],
@@ -409,6 +423,7 @@ PhotonChainParts = {
 # ---- Photon Dictinary of default Values ----
 PhotonChainParts_Default = {
     'signature'      : ['Photon'],
+    'alignmentGroup' : ['Photon'],
     'L1threshold'    : '',
     'multiplicity'   : '',    
     'trigType'       : '',
@@ -431,6 +446,7 @@ PhotonChainParts_Default = {
 # ---- MinBias Dictionary of all allowed Values ----
 MinBiasChainParts = {
     'signature'      : ['MinBias'],
+    'alignmentGroup' : ['MinBias'],
     'L1threshold'    : '',
     'chainPartName'  : '',
     'multiplicity'   : '',    
@@ -456,6 +472,7 @@ MinBiasChainParts = {
 # ---- MinBiasDictinary of default Values ----
 MinBiasChainParts_Default = {
     'signature'      : ['MinBias'],
+    'alignmentGroup' : ['MinBias'],
     'L1threshold'    : '',
     'chainPartName'  : '',
     'multiplicity'   : '',    
@@ -479,6 +496,7 @@ MinBiasChainParts_Default = {
 # ---- HeavyIon Dictionary of all allowed Values ----
 HeavyIonChainParts = {
     'signature'      : ['HeavyIon'],
+    'alignmentGroup' : ['HeavyIon'],
     'L1threshold'    : '',
     'chainPartName'  : '',
     'multiplicity'   : '',
@@ -501,6 +519,7 @@ HeavyIonChainParts = {
 # ---- HeavyIonDictinary of default Values ----
 HeavyIonChainParts_Default = { 
     'signature'      : ['HeavyIon'],
+    'alignmentGroup' : ['HeavyIon'],
     'L1threshold'    : '',
     'chainPartName'  : '',
     'multiplicity'   : '',
@@ -530,6 +549,7 @@ AllowedCosmicChainIdentifiers = ['larps','larhec',
 # ---- Cosmic Chain Dictinary of all allowed Values ----
 CosmicChainParts = {
     'signature'      : ['Cosmic'],
+    'alignmentGroup' : ['Cosmic'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'purpose'        : AllowedCosmicChainIdentifiers,
@@ -545,6 +565,7 @@ CosmicChainParts = {
 # ---- Cosmic Chain Default Dictinary of all allowed Values ----
 CosmicChainParts_Default = {
     'signature'      : ['Cosmic'],
+    'alignmentGroup' : ['Cosmic'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'purpose'        : [],
@@ -566,6 +587,7 @@ AllowedStreamingChainIdentifiers = ['noalg']
 # ---- Streaming Chain Dictinary of all allowed Values ----
 StreamingChainParts = {
     'signature'      : ['Streaming'],
+    'alignmentGroup' : ['Streaming'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'threshold'      : '',
@@ -583,6 +605,7 @@ StreamingChainParts = {
 # ---- Cosmic Chain Default Dictinary of all allowed Values ----
 StreamingChainParts_Default = {
     'signature'      : ['Streaming'],
+    'alignmentGroup' : ['Streaming'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'threshold'      : '',
@@ -610,6 +633,7 @@ AllowedCalibChainIdentifiers = ['csccalib',     'larcalib',
 
 CalibChainParts = {
     'signature'      : ['Calibration'],
+    'alignmentGroup' : ['Calibration'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'purpose'        : AllowedCalibChainIdentifiers,
@@ -626,6 +650,7 @@ CalibChainParts = {
 # ---- Calib Chain Default Dictinary of all allowed Values ----
 CalibChainParts_Default = {
     'signature'      : ['Calibration'],
+    'alignmentGroup' : ['Calibration'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'purpose'        : [],
@@ -653,6 +678,7 @@ AllowedMonitorChainIdentifiers = ['robrequest', 'timeburner',  'costmonitor',
 # ---- Monitor Chain Dictinary of all allowed Values ----
 MonitorChainParts = {
     'signature'      : ['Monitor'],
+    'alignmentGroup' : ['Monitor'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'monType'        : AllowedMonitorChainIdentifiers,
@@ -666,6 +692,7 @@ MonitorChainParts = {
 # ---- Monitor Chain Default Dictinary of all allowed Values ----
 MonitorChainParts_Default = {
     'signature'      : ['Monitor'],
+    'alignmentGroup' : ['Monitor'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'monType'        : [],
@@ -685,6 +712,7 @@ AllowedEBChainIdentifiers = ['eb']
 # ---- Enhanced Bias Chain Dictinary of all allowed Values ----
 EnhancedBiasChainParts = {
     'signature'      : ['EnhancedBias'],
+    'alignmentGroup' : ['EnhancedBias'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'algType'        : ['high','firstempty','empty','unpairediso','unpairednoniso', 'low'],
@@ -697,6 +725,7 @@ EnhancedBiasChainParts = {
 # ---- EnhancedBias Chain Default Dictinary of all allowed Values ----
 EnhancedBiasChainParts_Default = {
     'signature'      : ['EnhancedBias'],
+    'alignmentGroup' : ['EnhancedBias'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'algType'        : 'physics',
@@ -712,6 +741,7 @@ EnhancedBiasChainParts_Default = {
 AllowedBeamspotChainIdentifiers = ['beamspot',]
 BeamspotChainParts = {
     'signature'      : ['Beamspot'],
+    'alignmentGroup' : ['Beamspot'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'monType'        : AllowedBeamspotChainIdentifiers,
@@ -728,6 +758,7 @@ BeamspotChainParts = {
 # ---- Beamspot Chain Default Dictinary of all allowed Values ----
 BeamspotChainParts_Default = {
     'signature'      : ['Beamspot'],
+    'alignmentGroup' : ['Beamspot'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'monType'        : [],
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/GenerateMuonChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/GenerateMuonChainDefs.py
index 69b1ae0d476c..29c246a4ebe2 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/GenerateMuonChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/GenerateMuonChainDefs.py
@@ -33,19 +33,3 @@ def generateChainConfigs(chainDict):
     return theChainDef
 
 
-# this is obsolete: can we remove ? FP
-def mergeSerial(listOfChainDefs):
-
-    chaindef = listOfChainDefs[0]
-    listOfChainDefs.pop(0)
-    steps = chaindef.steps
-
-    for cdef in listOfChainDefs:
-        csteps = cdef.steps 
-        for step in csteps:
-            steps.append(step)
-
-    return chaindef
-
-
-
-- 
GitLab


From aad60768a6d6937d0099185ccdacdf468f97779f Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Thu, 17 Sep 2020 13:05:23 +0000
Subject: [PATCH 195/422] LArRawEvent: Enable thread-safety checking.

Make static data const.
---
 .../CaloSimEvent/CaloSimEvent/ATLAS_CHECK_THREAD_SAFETY       | 1 +
 .../LArRawEvent/LArRawEvent/ATLAS_CHECK_THREAD_SAFETY         | 1 +
 LArCalorimeter/LArRawEvent/LArRawEvent/LArFebErrorSummary.h   | 4 ++--
 LArCalorimeter/LArRawEvent/src/LArFebErrorSummary.cxx         | 4 ++--
 TestBeam/TBEvent/TBEvent/ATLAS_CHECK_THREAD_SAFETY            | 1 +
 5 files changed, 7 insertions(+), 4 deletions(-)
 create mode 100644 Calorimeter/CaloSimEvent/CaloSimEvent/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 LArCalorimeter/LArRawEvent/LArRawEvent/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 TestBeam/TBEvent/TBEvent/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Calorimeter/CaloSimEvent/CaloSimEvent/ATLAS_CHECK_THREAD_SAFETY b/Calorimeter/CaloSimEvent/CaloSimEvent/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..f1fce840a8ce
--- /dev/null
+++ b/Calorimeter/CaloSimEvent/CaloSimEvent/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Calorimeter/CaloSimEvent
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/ATLAS_CHECK_THREAD_SAFETY b/LArCalorimeter/LArRawEvent/LArRawEvent/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..dadd1ea69efe
--- /dev/null
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+LArCalorimeter/LArRawEvent
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebErrorSummary.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebErrorSummary.h
index 2333b158a8af..dd8aa2f36433 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebErrorSummary.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebErrorSummary.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef LARFEBERRORSUMMARY_H
@@ -54,7 +54,7 @@ class LArFebErrorSummary
   /** @brief  error is stored in a map with key = feb id */
   std::map<unsigned int,uint16_t> m_feb_errors; 
 
-  static std::string  m_errorStrings[N_LArFebErrorType] ; 
+  static const std::string  m_errorStrings[N_LArFebErrorType] ; 
 };
 
 CLASS_DEF(LArFebErrorSummary,223531796,0)
diff --git a/LArCalorimeter/LArRawEvent/src/LArFebErrorSummary.cxx b/LArCalorimeter/LArRawEvent/src/LArFebErrorSummary.cxx
index 0ef4c543f59a..0be28049001f 100644
--- a/LArCalorimeter/LArRawEvent/src/LArFebErrorSummary.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArFebErrorSummary.cxx
@@ -1,11 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArRawEvent/LArFebErrorSummary.h"
 
 // static constants
-std::string LArFebErrorSummary::m_errorStrings[N_LArFebErrorType] = {
+const std::string LArFebErrorSummary::m_errorStrings[N_LArFebErrorType] = {
     "Parity","BCID","SampleHeader","EVTID","ScacStatus","ScaOutOfRange",
     "GainMismatch","TypeMismatch","NumOfSamples","EmptyDataBlock","DspBlockSize","CheckSum", "MissingHeader",
     "BadGain" } ;
diff --git a/TestBeam/TBEvent/TBEvent/ATLAS_CHECK_THREAD_SAFETY b/TestBeam/TBEvent/TBEvent/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..509c4777fb77
--- /dev/null
+++ b/TestBeam/TBEvent/TBEvent/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+TestBeam/TBEvent
-- 
GitLab


From 8369e8229cae6de168b9aa7ac6f403c92215df0c Mon Sep 17 00:00:00 2001
From: Malik Aliev <malik.aliev@cern.ch>
Date: Thu, 17 Sep 2020 13:33:09 +0000
Subject: [PATCH 196/422] Moving mb zb chains from ls2 to phys p1 menu

---
 .../TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py       | 6 +++---
 .../python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py       | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 78c615c0530f..ebef0a410b3d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -13,7 +13,7 @@ from TriggerMenuMT.HLTMenuConfig.Menu.ChainDefInMenu import ChainProp
 import TriggerMenuMT.HLTMenuConfig.Menu.MC_pp_run3_v1 as mc_menu
 import TriggerMenuMT.HLTMenuConfig.Menu.PhysicsP1_pp_run3_v1 as p1_menu
 
-from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import PhysicsStream,SingleMuonGroup,MultiMuonGroup,SingleElectronGroup,MultiElectronGroup,SinglePhotonGroup,MultiPhotonGroup,SingleMETGroup,MultiMETGroup,SingleJetGroup,MultiJetGroup,SingleBjetGroup,SingleTauGroup,MultiTauGroup,BphysicsGroup,MinBiasGroup,ZeroBiasGroup
+from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import PhysicsStream,SingleMuonGroup,MultiMuonGroup,SingleElectronGroup,MultiElectronGroup,SinglePhotonGroup,MultiPhotonGroup,SingleMETGroup,MultiMETGroup,SingleJetGroup,MultiJetGroup,SingleBjetGroup,SingleTauGroup,MultiTauGroup,BphysicsGroup,MinBiasGroup
 
 def setupMenu():
 
@@ -310,8 +310,8 @@ def setupMenu():
     ]
 
     TriggerFlags.StreamingSlice.signatures = TriggerFlags.StreamingSlice.signatures() + [
-        ChainProp(name='HLT_noalg_mb_L1RD2_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup),
-        ChainProp(name='HLT_noalg_zb_L1ZB', l1SeedThresholds=['FSNOSEED'], stream=['ZeroBias'], groups=ZeroBiasGroup),
+        #ChainProp(name='HLT_noalg_mb_L1RD2_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup),
+        #ChainProp(name='HLT_noalg_zb_L1ZB', l1SeedThresholds=['FSNOSEED'], stream=['ZeroBias'], groups=ZeroBiasGroup),
         ChainProp(name='HLT_noalg_L1MBTS_2_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup), #ATR-21999
         ChainProp(name='HLT_noalg_L1MBTS_1_1_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup), #ATR-21999
     ]
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
index e5c42f7c2991..b6fc381fd0b4 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
@@ -13,7 +13,7 @@ from TriggerMenuMT.HLTMenuConfig.Menu.ChainDefInMenu import ChainProp
 
 import TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 as physics_menu 
 
-from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import PhysicsStream,SingleMuonGroup,SinglePhotonGroup,EgammaStreamersGroup,TauStreamersGroup,JetStreamersGroup,METStreamersGroup,MinBiasGroup
+from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import PhysicsStream,SingleMuonGroup,SinglePhotonGroup,EgammaStreamersGroup,TauStreamersGroup,JetStreamersGroup,METStreamersGroup,MinBiasGroup,ZeroBiasGroup
 
 
 def addP1Signatures():
@@ -134,6 +134,8 @@ def addP1Signatures():
 
         # MBTS
         ChainProp(name='HLT_noalg_L1MBTS_1_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup), #ATR-21740
+        ChainProp(name='HLT_noalg_mb_L1RD2_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup), # ATR-21367
+        ChainProp(name='HLT_noalg_zb_L1ZB',        l1SeedThresholds=['FSNOSEED'], stream=['ZeroBias'],groups=ZeroBiasGroup),# ATR-21367
     ]
     TriggerFlags.MonitorSlice.signatures   = TriggerFlags.MonitorSlice.signatures() + [
           ChainProp(name='HLT_costmonitor_CostMonDS_L1All',        l1SeedThresholds=['FSNOSEED'], stream=['CostMonitoring'], groups=['RATE:Monitoring','BW:Other']),
-- 
GitLab


From 893cbeb108427c12ca8c56e50cf024b0bdca15c6 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Thu, 17 Sep 2020 13:34:50 +0000
Subject: [PATCH 197/422] TrigAnalysisTest: Set/change menu name in all tests

---
 ...d.ref => ref_RDOtoRDOTrig_v1Dev_build.ref} |  6 +--
 ...est_trigAna_BStoBStoESDAOD_v1Dev_build.py} |  2 +-
 ... test_trigAna_HITtoRDOTrig_v1Dev_build.py} |  1 +
 ...> test_trigAna_HITtoRDOTrig_v1Dev_grid.py} |  1 +
 ...trigAna_HITtoRDOTrig_v7Primaries_build.py} |  7 ++++
 ..._trigAna_HITtoRDOTrig_v7Primaries_grid.py} |  7 ++++
 ...test_trigAna_PhysValWeb_comp_v1v7_grid.py} |  4 +-
 ... => test_trigAna_PhysValWeb_v1Dev_grid.py} |  8 +++-
 ...st_trigAna_PhysValWeb_v7Primaries_grid.py} |  8 +++-
 ...y => test_trigAna_RDOtoAOD_v1Dev_build.py} |  8 +++-
 ...py => test_trigAna_RDOtoAOD_v1Dev_grid.py} |  8 +++-
 ...est_trigAna_RDOtoAOD_v7Primaries_build.py} |  8 +++-
 ...test_trigAna_RDOtoAOD_v7Primaries_grid.py} |  8 +++-
 ... test_trigAna_RDOtoPhysval_v1Dev_build.py} | 13 +++++--
 ...> test_trigAna_RDOtoPhysval_v1Dev_grid.py} | 12 ++++--
 ...trigAna_RDOtoPhysval_v7Primaries_build.py} |  8 +++-
 ..._trigAna_RDOtoPhysval_v7Primaries_grid.py} |  8 +++-
 .../test_trigAna_RDOtoRDOTrig_mt1_build.py    | 38 +++----------------
 .../test_trigAna_RDOtoRDOTrig_v1Dev_build.py  | 38 +++++++++++++++++++
 ...> test_trigAna_RDOtoRDOTrig_v1Dev_grid.py} |  8 +++-
 ...trigAna_RDOtoRDOTrig_v7Primaries_build.py} |  8 +++-
 ..._trigAna_RDOtoRDOTrig_v7Primaries_grid.py} |  8 +++-
 ...=> test_trigAna_RDOtoT0Mon_v1Dev_build.py} |  9 ++++-
 ... => test_trigAna_RDOtoT0Mon_v1Dev_grid.py} |  9 ++++-
 .../TrigValTools/bin/runTrigART.py            |  2 +-
 25 files changed, 176 insertions(+), 61 deletions(-)
 rename Trigger/TrigValidation/TrigAnalysisTest/share/{ref_RDOtoRDOTrig_mt1_build.ref => ref_RDOtoRDOTrig_v1Dev_build.ref} (99%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_BStoBStoESDAOD_mt1_build.py => test_trigAna_BStoBStoESDAOD_v1Dev_build.py} (98%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_HITtoRDOTrig_mt1_build.py => test_trigAna_HITtoRDOTrig_v1Dev_build.py} (95%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_HITtoRDOTrig_mt1_grid.py => test_trigAna_HITtoRDOTrig_v1Dev_grid.py} (96%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_HITtoRDOTrig_build.py => test_trigAna_HITtoRDOTrig_v7Primaries_build.py} (87%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_HITtoRDOTrig_grid.py => test_trigAna_HITtoRDOTrig_v7Primaries_grid.py} (89%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_PhysValWeb_mt1_compLegacy_grid.py => test_trigAna_PhysValWeb_comp_v1v7_grid.py} (91%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_PhysValWeb_mt1_grid.py => test_trigAna_PhysValWeb_v1Dev_grid.py} (88%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_PhysValWeb_grid.py => test_trigAna_PhysValWeb_v7Primaries_grid.py} (88%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoAOD_mt1_build.py => test_trigAna_RDOtoAOD_v1Dev_build.py} (74%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoAOD_mt1_grid.py => test_trigAna_RDOtoAOD_v1Dev_grid.py} (80%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoAOD_build.py => test_trigAna_RDOtoAOD_v7Primaries_build.py} (74%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoAOD_grid.py => test_trigAna_RDOtoAOD_v7Primaries_grid.py} (81%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoPhysval_mt1_build.py => test_trigAna_RDOtoPhysval_v1Dev_build.py} (72%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoPhysval_mt1_grid.py => test_trigAna_RDOtoPhysval_v1Dev_grid.py} (80%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoPhysval_build.py => test_trigAna_RDOtoPhysval_v7Primaries_build.py} (81%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoPhysval_grid.py => test_trigAna_RDOtoPhysval_v7Primaries_grid.py} (88%)
 create mode 100755 Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_build.py
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoRDOTrig_mt1_grid.py => test_trigAna_RDOtoRDOTrig_v1Dev_grid.py} (80%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoRDOTrig_build.py => test_trigAna_RDOtoRDOTrig_v7Primaries_build.py} (74%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoRDOTrig_grid.py => test_trigAna_RDOtoRDOTrig_v7Primaries_grid.py} (81%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoT0Mon_mt1_build.py => test_trigAna_RDOtoT0Mon_v1Dev_build.py} (82%)
 rename Trigger/TrigValidation/TrigAnalysisTest/test/{test_trigAna_RDOtoT0Mon_mt1_grid.py => test_trigAna_RDOtoT0Mon_v1Dev_grid.py} (85%)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
similarity index 99%
rename from Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
rename to Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index a281e726a854..84c10d7132a1 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -365,8 +365,8 @@ TrigSignatureMoniMT                                 INFO HLT_j85_ftf_pf_L1J20 #1
 TrigSignatureMoniMT                                 INFO -- #1538535401 Events         19         19         0          0          0          0          0          0          0          0          0          0          11         -          11
 TrigSignatureMoniMT                                 INFO -- #1538535401 Features                             0          0          0          0          0          0          0          0          0          0          16         -
 TrigSignatureMoniMT                                 INFO HLT_mb_sptrk_L1RD0_FILLED #4097312640
-TrigSignatureMoniMT                                 INFO -- #4097312640 Events         20         20         20         20         -          -          -          -          -          -          -          -          -          -          20
-TrigSignatureMoniMT                                 INFO -- #4097312640 Features                             20         20         -          -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO -- #4097312640 Events         20         0          0          0          -          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #4097312640 Features                             0          0          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu0_muoncalib_L1MU20 #997163309
 TrigSignatureMoniMT                                 INFO -- #997163309 Events          8          8          0          0          0          0          0          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #997163309 Features                              0          0          0          0          0          -          -          -          -          -          -          -
@@ -791,7 +791,7 @@ TrigSignatureMoniMT                                 INFO HLT_tilecalib_laser_Til
 TrigSignatureMoniMT                                 INFO -- #1063154655 Events         0          0          0          -          -          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1063154655 Features                             0          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_timeburner_L1All #819160059
-TrigSignatureMoniMT                                 INFO -- #819160059 Events          20         20         0          -          -          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #819160059 Events          20         0          0          -          -          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #819160059 Features                              0          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe100_mht_L1XE50 #532175988
 TrigSignatureMoniMT                                 INFO -- #532175988 Events          10         10         0          0          0          0          0          0          0          0          0          0          9          -          9
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_v1Dev_build.py
similarity index 98%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_mt1_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_v1Dev_build.py
index 33a7943e29a2..5a7c2cbbbfc5 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_v1Dev_build.py
@@ -11,7 +11,7 @@ def findFile(pattern):
     '''Bash inline file name finder'''
     return '`find . -name \'{:s}\' | tail -n 1`'.format(pattern)
 
-menu_name = 'LS2_v1'
+menu_name = 'LS2_v1_TriggerValidation_mc_prescale'
 
 # Run athena BS->BS job
 BStoBS = ExecStep.ExecStep("BStoBS")
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_build.py
similarity index 95%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_build.py
index ac269b817e68..43049cca423f 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_build.py
@@ -33,6 +33,7 @@ rdo2rdotrig.input = ''
 rdo2rdotrig.explicit_input = True
 rdo2rdotrig.threads = 1
 rdo2rdotrig.args = '--inputRDOFile=RDO.pool.root --outputRDO_TRIGFile=RDO_TRIG.pool.root'
+rdo2rdotrig.args += ' --preExec="setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'"'
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_grid.py
similarity index 96%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_grid.py
index fb2786c0b7bf..fa43f3d8a1b0 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_grid.py
@@ -49,6 +49,7 @@ rdo2rdotrig.input = ''
 rdo2rdotrig.explicit_input = True
 rdo2rdotrig.threads = 1
 rdo2rdotrig.args = '--inputRDOFile=RDO.pool.root --outputRDO_TRIGFile=RDO_TRIG.pool.root'
+rdo2rdotrig.args += ' --preExec="setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'"'
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_build.py
similarity index 87%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_build.py
index f5a87ae59008..035a8c1dfd9b 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_build.py
@@ -27,11 +27,18 @@ hit2rdo.args += ' --jobNumber="1"'
 hit2rdo.args += ' --preExec "HITtoRDO:userRunLumiOverride={\'run\':300000, \'startmu\':40.0, \'endmu\':70.0, \'stepmu\':1.0, \'startlb\':1, \'timestamp\': 1500000000};ScaleTaskLength=0.1"'
 hit2rdo.args += ' --preInclude "HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_muRange.py"'
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2rdotrig = ExecStep.ExecStep('RDOtoRDOTrigger')
 rdo2rdotrig.type = 'Reco_tf'
 rdo2rdotrig.input = ''
 rdo2rdotrig.explicit_input = True
 rdo2rdotrig.args = '--inputRDOFile=RDO.pool.root --outputRDO_TRIGFile=RDO_TRIG.pool.root'
+rdo2rdotrig.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_grid.py
similarity index 89%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_grid.py
index 57293d8ce399..e431d5089f85 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_grid.py
@@ -46,11 +46,18 @@ hit2rdo.args += ' --jobNumber="1"'
 hit2rdo.args += ' --preExec "HITtoRDO:userRunLumiOverride={\'run\':300000, \'startmu\':40.0, \'endmu\':70.0, \'stepmu\':1.0, \'startlb\':1, \'timestamp\': 1500000000};ScaleTaskLength=0.1"'
 hit2rdo.args += ' --preInclude "HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_muRange.py"'
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2rdotrig = ExecStep.ExecStep('RDOtoRDOTrigger')
 rdo2rdotrig.type = 'Reco_tf'
 rdo2rdotrig.input = ''
 rdo2rdotrig.explicit_input = True
 rdo2rdotrig.args = '--inputRDOFile=RDO.pool.root --outputRDO_TRIGFile=RDO_TRIG.pool.root'
+rdo2rdotrig.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_compLegacy_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_comp_v1v7_grid.py
similarity index 91%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_compLegacy_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_comp_v1v7_grid.py
index 2aa9c0cfd7c2..f0a4fd6df08d 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_compLegacy_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_comp_v1v7_grid.py
@@ -26,10 +26,10 @@ from TrigValTools.TrigValSteering import Test, CheckSteps
 from TrigAnalysisTest.TrigAnalysisSteps import add_physvalweb_steps
 
 downloadLegacyTrig = CheckSteps.DownloadRefStep('DownloadLegacyTriggerNTUP')
-downloadLegacyTrig.artjobname = 'test_trigAna_PhysValWeb_grid.py'
+downloadLegacyTrig.artjobname = 'test_trigAna_PhysValWeb_v7Primaries_grid.py'
 
 downloadRun3Trig = CheckSteps.DownloadRefStep('DownloadRun3TriggerNTUP')
-downloadRun3Trig.artjobname = 'test_trigAna_PhysValWeb_mt1_grid.py'
+downloadRun3Trig.artjobname = 'test_trigAna_PhysValWeb_v1Dev_grid.py'
 downloadRun3Trig.args += ' --dst="."'
 
 test = Test.Test()
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v1Dev_grid.py
similarity index 88%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v1Dev_grid.py
index 412ce230290e..c6b3d27f4b8c 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v1Dev_grid.py
@@ -30,13 +30,19 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.threads = 1
 rdo2aod.max_events = 500
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 physval = ExecStep.ExecStep('PhysVal')
 physval.type = 'Reco_tf'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v7Primaries_grid.py
similarity index 88%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v7Primaries_grid.py
index 70d873a2f345..449f67c86dd6 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v7Primaries_grid.py
@@ -30,12 +30,18 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.max_events = 500
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 physval = ExecStep.ExecStep('PhysVal')
 physval.type = 'Reco_tf'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_build.py
similarity index 74%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_build.py
index eebc78e513e5..eef1d2bd060c 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_build.py
@@ -9,12 +9,18 @@
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 from TrigAnalysisTest.TrigAnalysisSteps import add_analysis_steps
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep()
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG"'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_grid.py
similarity index 80%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_grid.py
index b664ceef626c..6d2e343c59cc 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_grid.py
@@ -25,13 +25,19 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep()
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.max_events = 500
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG"'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_build.py
similarity index 74%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_build.py
index b648c0dbee4d..635043ed1f61 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_build.py
@@ -9,11 +9,17 @@
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 from TrigAnalysisTest.TrigAnalysisSteps import add_analysis_steps
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep()
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG"'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_grid.py
similarity index 81%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_grid.py
index 9feb2ba0b778..3db85cbc4bee 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_grid.py
@@ -28,12 +28,18 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep()
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.max_events = 500
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG"'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_build.py
similarity index 72%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_build.py
index 6b78a0855d8e..b5dcaf75f9ff 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_build.py
@@ -8,13 +8,18 @@
 
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
-rdo2aod.args += ' --postInclude="TriggerTest/disableChronoStatSvcPrintout.py"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 physval = ExecStep.ExecStep('PhysVal')
 physval.type = 'Reco_tf'
@@ -24,8 +29,8 @@ physval.args = '--inputAODFile=AOD.pool.root --outputNTUP_PHYSVALFile=NTUP_PHYSV
 physval.args += ' --postInclude="TriggerTest/disableChronoStatSvcPrintout.py"'
 
 validationFlags = 'doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet'
-preExec = 'TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(3); from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
-physval.args += ' --validationFlags="{:s}" --preExec="{:s}"'.format(validationFlags, preExec)
+validationPreExec = 'TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(3); from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
+physval.args += ' --validationFlags="{:s}" --preExec="{:s}"'.format(validationFlags, validationPreExec)
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_grid.py
similarity index 80%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_grid.py
index bea9664847ba..c1c2591cd0d6 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_grid.py
@@ -30,13 +30,19 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.max_events = 500
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 physval = ExecStep.ExecStep('PhysVal')
 physval.type = 'Reco_tf'
@@ -45,8 +51,8 @@ physval.explicit_input = True
 physval.args = '--inputAODFile=AOD.pool.root --outputNTUP_PHYSVALFile=NTUP_PHYSVAL.pool.root --valid=True'
 
 validationFlags = 'doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet'
-preExec = 'TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(3); from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
-physval.args += ' --validationFlags="{:s}" --preExec="{:s}"'.format(validationFlags, preExec)
+validationPreExec = 'TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(3); from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
+physval.args += ' --validationFlags="{:s}" --preExec="{:s}"'.format(validationFlags, validationPreExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_build.py
similarity index 81%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_build.py
index 3b395a78f85b..92589a1b2111 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_build.py
@@ -8,11 +8,17 @@
 
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 physval = ExecStep.ExecStep('PhysVal')
 physval.type = 'Reco_tf'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_grid.py
similarity index 88%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_grid.py
index 903577ca19f9..4991416463dd 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_grid.py
@@ -30,12 +30,18 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.max_events = 500
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 physval = ExecStep.ExecStep('PhysVal')
 physval.type = 'Reco_tf'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_build.py
index 36ff6edd29ff..9d4a70250294 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_build.py
@@ -1,32 +1,6 @@
-#!/usr/bin/env python
-
-# art-description: Test of the RDOtoRDOTrigger transform with threads=1
-# art-type: build
-# art-include: master/Athena
-# Skipping art-output which has no effect for build tests.
-# If you create a grid version, check art-output in existing grid tests.
-
-from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
-
-ex = ExecStep.ExecStep()
-ex.type = 'Reco_tf'
-ex.input = 'ttbar'
-ex.threads = 1
-ex.args = '--outputRDO_TRIGFile=RDO_TRIG.pool.root'
-ex.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
-
-test = Test.Test()
-test.art_type = 'build'
-test.exec_steps = [ex]
-test.check_steps = CheckSteps.default_check_steps(test)
-
-# Add a step comparing counts in the log against reference
-refcomp = CheckSteps.RegTestStep("CountRefComp")
-refcomp.input_base_name = 'athena.merged'
-refcomp.regex = r'TrigSignatureMoniMT\s*INFO\sHLT_.*|TrigSignatureMoniMT\s*INFO\s-- #[0-9]+ (Events|Features).*'
-refcomp.reference = 'TrigAnalysisTest/ref_RDOtoRDOTrig_mt1_build.ref'
-refcomp.required = True # Final exit code depends on this step
-CheckSteps.add_step_after_type(test.check_steps, CheckSteps.LogMergeStep, refcomp)
-
-import sys
-sys.exit(test.run())
+#!/bin/sh
+# flake8: noqa
+# This is just a hacky link to a renamed test script, which is needed until the test name in CI configuration is updated
+test_trigAna_RDOtoRDOTrig_v1Dev_build.py
+exit_code=$?
+exit ${exit_code}
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_build.py
new file mode 100755
index 000000000000..9c99e46102b2
--- /dev/null
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_build.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+
+# art-description: Test of the RDOtoRDOTrigger transform with threads=1
+# art-type: build
+# art-include: master/Athena
+# Skipping art-output which has no effect for build tests.
+# If you create a grid version, check art-output in existing grid tests.
+
+from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
+
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
+ex = ExecStep.ExecStep()
+ex.type = 'Reco_tf'
+ex.input = 'ttbar'
+ex.threads = 1
+ex.args = '--outputRDO_TRIGFile=RDO_TRIG.pool.root'
+ex.args += ' --preExec="all:{:s};"'.format(preExec)
+
+test = Test.Test()
+test.art_type = 'build'
+test.exec_steps = [ex]
+test.check_steps = CheckSteps.default_check_steps(test)
+
+# Add a step comparing counts in the log against reference
+refcomp = CheckSteps.RegTestStep("CountRefComp")
+refcomp.input_base_name = 'athena.merged'
+refcomp.regex = r'TrigSignatureMoniMT\s*INFO\sHLT_.*|TrigSignatureMoniMT\s*INFO\s-- #[0-9]+ (Events|Features).*'
+refcomp.reference = 'TrigAnalysisTest/ref_RDOtoRDOTrig_v1Dev_build.ref'
+refcomp.required = True # Final exit code depends on this step
+CheckSteps.add_step_after_type(test.check_steps, CheckSteps.LogMergeStep, refcomp)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_grid.py
similarity index 80%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_grid.py
index da9410f010f9..5b3917f2750b 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_grid.py
@@ -25,12 +25,18 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 ex = ExecStep.ExecStep()
 ex.type = 'Reco_tf'
 ex.input = 'ttbar'
 ex.threads = 1
 ex.args = '--outputRDO_TRIGFile=RDO_TRIG.pool.root'
-ex.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+ex.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_build.py
similarity index 74%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_build.py
index a81c81307761..d76ab9aaa67e 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_build.py
@@ -9,11 +9,17 @@
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 from TrigAnalysisTest.TrigAnalysisSteps import add_analysis_steps
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 ex = ExecStep.ExecStep()
 ex.type = 'Reco_tf'
 ex.input = 'ttbar'
 ex.args = '--outputRDO_TRIGFile=RDO_TRIG.pool.root'
-ex.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+ex.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_grid.py
similarity index 81%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_grid.py
index cec6e80d6bf4..beb3016bd90e 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_grid.py
@@ -28,12 +28,18 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 ex = ExecStep.ExecStep()
 ex.type = 'Reco_tf'
 ex.input = 'ttbar'
 ex.max_events = 500
 ex.args = '--outputRDO_TRIGFile=RDO_TRIG.pool.root'
-ex.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+ex.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_build.py
similarity index 82%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_build.py
index 3b4872d75765..507ca598f30e 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_build.py
@@ -8,13 +8,18 @@
 
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
-rdo2aod.args += ' --postInclude="TriggerTest/disableChronoStatSvcPrintout.py"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 tzmon = ExecStep.ExecStep('Tier0Mon')
 tzmon.type = 'other'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_grid.py
similarity index 85%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_grid.py
index 88578c234423..bbb8900ed994 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_grid.py
@@ -24,14 +24,19 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.max_events = 500
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
-rdo2aod.args += ' --postInclude="TriggerTest/disableChronoStatSvcPrintout.py"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 tzmon = ExecStep.ExecStep('Tier0Mon')
 tzmon.type = 'other'
diff --git a/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py b/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py
index 69b6d38dfc0d..cb1562d3eefa 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py
@@ -17,7 +17,7 @@ from TrigValTools.TrigARTUtils import package_prefix, find_scripts, remember_cwd
 def minimal_pattern(package):
     dict = {'TriggerTest':      '(test_trig_data_v1Dev_build|test_trig_data_newJO_build)',
             'TrigP1Test':       'test_trigP1_v1Dev_build',
-            'TrigAnalysisTest': 'test_trigAna_RDOtoRDOTrig_mt1_build'}
+            'TrigAnalysisTest': 'test_trigAna_RDOtoRDOTrig_v1Dev_build'}
     if package == 'ALL':
         return '({})'.format('|'.join([v for v in dict.values() if v]))
     elif package in dict and dict[package] is not None:
-- 
GitLab


From 989e37d98206deb1868aab17ffdec79dca5e7a17 Mon Sep 17 00:00:00 2001
From: Marcin Nowak <marcin.nowak@cern.ch>
Date: Thu, 17 Sep 2020 13:38:21 +0000
Subject: [PATCH 198/422] Add locking to file metadata tools

---
 .../AthenaKernel/AthenaKernel/IMetaDataTool.h | 14 +++++-
 .../AthenaServices/src/AthenaOutputStream.cxx |  3 ++
 Control/AthenaServices/src/MetaDataSvc.cxx    | 21 +++++++++
 Control/AthenaServices/src/MetaDataSvc.h      | 18 +++++++-
 .../IOVDbMetaDataTools/IIOVDbMetaDataTool.h   |  9 ++--
 .../src/IOVDbMetaDataTool.cxx                 | 23 +++++++++-
 .../src/IOVDbMetaDataTool.h                   | 15 +++++--
 Database/IOVDbSvc/CMakeLists.txt              |  1 +
 Database/IOVDbSvc/src/IOVDbFolder.cxx         | 38 ++++++++--------
 Database/IOVDbSvc/src/IOVDbFolder.h           | 24 ++++++----
 Database/IOVDbSvc/src/IOVDbSvc.cxx            |  7 +--
 .../IOVDbSvc/src/ReadFromFileMetaData.cxx     | 44 ++++++++++++++++---
 Database/IOVDbSvc/src/ReadFromFileMetaData.h  | 26 ++++++++++-
 Database/IOVDbSvc/test/IOVDbFolder_test.cxx   |  4 +-
 14 files changed, 195 insertions(+), 52 deletions(-)

diff --git a/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h b/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h
index 2558e16bda49..f4c1c0b4fd90 100755
--- a/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h
+++ b/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h
@@ -32,10 +32,20 @@ public: // Non-static members
   virtual StatusCode metaDataStop() = 0;
 
   /// Gaudi boilerplate
-   static const InterfaceID& interfaceID();
-private: // Data
+  static const InterfaceID& interfaceID();
 };
 
+/** @class ILockableTool
+ *  @brief This class provides the locking interface that MetaData tools can implement.
+           MetaDataSvc will use these methods when writing out MetaData
+ **/
+class ILockableTool {
+public:
+   virtual void lock_shared() const = 0;
+   virtual void unlock_shared() const = 0;
+};
+
+
 inline const InterfaceID& IMetaDataTool::interfaceID() {
    static const InterfaceID IID("IMetaDataTool", 1, 0);
    return(IID);
diff --git a/Control/AthenaServices/src/AthenaOutputStream.cxx b/Control/AthenaServices/src/AthenaOutputStream.cxx
index 2a902b9c6fea..1472648ee1f1 100644
--- a/Control/AthenaServices/src/AthenaOutputStream.cxx
+++ b/Control/AthenaServices/src/AthenaOutputStream.cxx
@@ -418,6 +418,9 @@ void AthenaOutputStream::writeMetaData(const std::string outputFN)
    if( m_metaDataSvc->prepareOutput(outputFN).isFailure() ) {
       throw GaudiException("Failed on MetaDataSvc prepareOutput", name(), StatusCode::FAILURE);
    }
+   // lock all metadata to prevent updates during writing
+   MetaDataSvc::ToolLockGuard   tool_guard( *m_metaDataSvc );
+
    // Always force a final commit in stop - mainly applies to AthenaPool
    if (m_writeOnFinalize) {
       if (write().isFailure()) {  // true mean write AND commit
diff --git a/Control/AthenaServices/src/MetaDataSvc.cxx b/Control/AthenaServices/src/MetaDataSvc.cxx
index 7163e5c9ec75..2a81f9dd6bb0 100644
--- a/Control/AthenaServices/src/MetaDataSvc.cxx
+++ b/Control/AthenaServices/src/MetaDataSvc.cxx
@@ -581,6 +581,7 @@ StatusCode MetaDataSvc::initInputMetaDataStore(const std::string& fileName) {
       }
       for (SG::TransientAddress* tad : tList) {
          CLID clid = tad->clID();
+          ATH_MSG_VERBOSE("initInputMetaDataStore: add proxy for clid = " << clid << ", key = " << tad->name());
          if (m_inputDataStore->contains(tad->clID(), tad->name())) {
             ATH_MSG_DEBUG("initInputMetaDataStore: MetaData Store already contains clid = " << clid << ", key = " << tad->name());
          } else {
@@ -620,3 +621,23 @@ CLID MetaDataSvc::remapMetaContCLID( const CLID& item_id ) const
    }
    return item_id;
 }
+
+
+void MetaDataSvc::lockTools() const
+{
+   ATH_MSG_DEBUG("Locking metadata tools");
+   for(auto tool : m_metaDataTools ) {
+      ILockableTool *lockable = dynamic_cast<ILockableTool*>( tool.get() );
+      if( lockable ) lockable->lock_shared();
+   }
+}
+
+
+void MetaDataSvc::unlockTools() const
+{
+   ATH_MSG_DEBUG("Unlocking metadata tools");
+   for(auto tool : m_metaDataTools ) {
+      ILockableTool *lockable = dynamic_cast<ILockableTool*>( tool.get() );
+      if( lockable ) lockable->unlock_shared();
+   }
+}
diff --git a/Control/AthenaServices/src/MetaDataSvc.h b/Control/AthenaServices/src/MetaDataSvc.h
index b7e6fbc4ea44..4a6c181c12f6 100644
--- a/Control/AthenaServices/src/MetaDataSvc.h
+++ b/Control/AthenaServices/src/MetaDataSvc.h
@@ -113,6 +113,19 @@ public: // Non-static members
 
    CLID remapMetaContCLID( const CLID& item_id ) const;
 
+   class ToolLockGuard {
+   public:
+      ToolLockGuard(const MetaDataSvc& mds) : m_mds(mds) { m_mds.lockTools(); }
+      ~ToolLockGuard() { m_mds.unlockTools(); }
+      ToolLockGuard(const ToolLockGuard&) = delete;
+      void operator=(const ToolLockGuard&) = delete;
+   private:
+      const MetaDataSvc& m_mds;
+   };
+
+   void lockTools() const;
+   void unlockTools() const;
+
 private:
    /// Add proxy to input metadata store - can be called directly or via BeginInputFile incident
    StatusCode addProxyToInputMetaDataStore(const std::string& tokenStr);
@@ -139,8 +152,9 @@ private: // data
 private: // properties
    /// MetaDataContainer, POOL container name for MetaData.
    StringProperty                 m_metaDataCont;
-   /// MetaDataTools, vector with the MetaData tools.
+   /// MetaDataTools, vector with the MetaData tools
    ToolHandleArray<IMetaDataTool> m_metaDataTools;
+
 };
- 
+
 #endif
diff --git a/Database/IOVDbMetaDataTools/IOVDbMetaDataTools/IIOVDbMetaDataTool.h b/Database/IOVDbMetaDataTools/IOVDbMetaDataTools/IIOVDbMetaDataTool.h
index 0bc0733326c7..61827e45d42c 100755
--- a/Database/IOVDbMetaDataTools/IOVDbMetaDataTools/IIOVDbMetaDataTool.h
+++ b/Database/IOVDbMetaDataTools/IOVDbMetaDataTools/IIOVDbMetaDataTool.h
@@ -18,11 +18,12 @@
 # define IOVDBMETADATATOOL_IIOVDBMETADATATOOL_H
 
 // Gaudi
-#include "GaudiKernel/IAlgTool.h"
+#include "AthenaKernel/IMetaDataTool.h"
 #include <string>
 
 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
 class CondAttrListCollection;
+class IOVMetaDataContainer;
 
 /** 
  ** @class IIOVDbMetaDataTool
@@ -38,10 +39,11 @@ class CondAttrListCollection;
  **    - EndEvent:<pre>        End event number</pre>
  **/
 
-class IIOVDbMetaDataTool : virtual public IAlgTool 
+class IIOVDbMetaDataTool : virtual public IMetaDataTool,
+                           virtual public ILockableTool
 {
 
-public:    
+public:
   
     /// Retrieve interface ID
     static const InterfaceID& interfaceID() { 
@@ -69,6 +71,7 @@ public:
     /// occurs before BeginInputFile incident.
     virtual StatusCode  processInputFileMetaData(const std::string& fileName) = 0;
 
+    virtual IOVMetaDataContainer* findMetaDataContainer(const std::string& folderName) const = 0;
 };
 
 
diff --git a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx
index 43ee27d70338..fd43710ca9f6 100755
--- a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx
+++ b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx
@@ -231,10 +231,12 @@ StatusCode
 IOVDbMetaDataTool::registerFolder(const std::string& folderName, 
                                   const std::string& folderDescription) const
 {
+    // lock the tool before getMetaDataContainer() call
+    std::scoped_lock  guard( m_mutex );
+
     ATH_MSG_DEBUG("begin registerFolder ");
 
-    IOVMetaDataContainer* cont = getMetaDataContainer(folderName, folderDescription);
-    if (!cont) {
+    if( ! getMetaDataContainer(folderName, folderDescription) ) {
         ATH_MSG_ERROR("Unable to register folder " << folderName);
         return(StatusCode::FAILURE);
     } 
@@ -250,6 +252,9 @@ IOVDbMetaDataTool::registerFolder(const std::string& folderName,
 StatusCode IOVDbMetaDataTool::addPayload (const std::string& folderName
 					  , CondAttrListCollection* payload) const
 {
+  // lock the tool while it is modifying the folder
+  std::scoped_lock  guard( m_mutex );
+
   ATH_MSG_DEBUG("begin addPayload ");
   
   // Check if the  folder has already been found
@@ -302,6 +307,7 @@ StatusCode
 IOVDbMetaDataTool::modifyPayload ATLAS_NOT_THREAD_SAFE  (const std::string& folderName, 
                                                          CondAttrListCollection*& coll) const
 {
+    // protected by lock in processInputFileMetaData()
 
     /// Modify a Payload for a particular folder - replaces one of the
     /// internal attributes
@@ -384,10 +390,20 @@ IOVDbMetaDataTool::modifyPayload ATLAS_NOT_THREAD_SAFE  (const std::string& fold
 
 //--------------------------------------------------------------------------
 
+IOVMetaDataContainer*
+IOVDbMetaDataTool::findMetaDataContainer(const std::string& folderName) const
+{
+  // lock the tool before this call
+  // Return the folder if it is in the meta data store
+  return m_metaDataStore->tryRetrieve<IOVMetaDataContainer>(folderName);
+}
+
+
 IOVMetaDataContainer* 
 IOVDbMetaDataTool::getMetaDataContainer(const std::string& folderName
                                         , const std::string& folderDescription) const
 {
+  // protected by locks in addPayload() and registerFolder()
   ATH_MSG_DEBUG("begin getMetaDataContainer ");
 
   IOVMetaDataContainer* cont{nullptr};
@@ -419,6 +435,9 @@ IOVDbMetaDataTool::getMetaDataContainer(const std::string& folderName
 
 StatusCode IOVDbMetaDataTool::processInputFileMetaData(const std::string& fileName)
 {
+  // lock the tool while it is processing input metadata 
+  std::scoped_lock  guard( m_mutex );
+
   ATH_MSG_DEBUG("processInputFileMetaData: file name " << fileName);
 
   // Retrieve all meta data containers from InputMetaDataStore
diff --git a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h
index 8e4ce5408dec..9c5a3aebfee3 100755
--- a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h
+++ b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h
@@ -20,10 +20,10 @@
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/IIncidentListener.h"
-#include "AthenaKernel/IMetaDataTool.h"
 #include "IOVDbMetaDataTools/IIOVDbMetaDataTool.h"
 
 #include <string>  
+#include <shared_mutex>
 
 class StoreGateSvc;
 class IOVMetaDataContainer;
@@ -37,7 +37,6 @@ class IOVMetaDataContainer;
  **/
 
 class IOVDbMetaDataTool : virtual public AthAlgTool,
-                          virtual public IMetaDataTool,
                           virtual public IIncidentListener,
                           virtual public IIOVDbMetaDataTool
 {
@@ -88,9 +87,15 @@ public:
     /// occurs before BegininputFile incident.
     virtual StatusCode processInputFileMetaData(const std::string& fileName) override;
 
+    virtual IOVMetaDataContainer* findMetaDataContainer(const std::string& folderName) const override final;
+
+    // ILockableTool API implementation
+    virtual void lock_shared() const override final { m_mutex.lock_shared(); }
+    virtual void unlock_shared() const override final { m_mutex.unlock_shared(); }
+
 private:
 
-    /// return meta data containerr from the meta data store
+    /// return meta data container from the meta data store
     IOVMetaDataContainer* getMetaDataContainer(const std::string& folderName, 
                                                const std::string& folderDescription) const;
 
@@ -145,6 +150,10 @@ private:
     StringArrayProperty  m_attributesToBeRemoved;
     bool                 m_modifyFolders;
 
+    // mutex for R/W locking of the entire tool (and supposedly all metadata objects it works with)
+    mutable std::shared_mutex    m_mutex  ATLAS_THREAD_SAFE;
 };
 
 #endif // IOVDBMETADATATOOLS_IOVDBMETADATATOOL_H
+
+
diff --git a/Database/IOVDbSvc/CMakeLists.txt b/Database/IOVDbSvc/CMakeLists.txt
index 555ab7d5b36a..e6144a92ce52 100644
--- a/Database/IOVDbSvc/CMakeLists.txt
+++ b/Database/IOVDbSvc/CMakeLists.txt
@@ -96,6 +96,7 @@ atlas_add_test( ReadFromFileMetaData_test
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${CORAL_LIBRARIES}
    AthenaKernel IOVDbDataModel AthenaPoolUtilities CoraCool CxxUtils TestTools
+   IOVDbMetaDataToolsLib
    POST_EXEC_SCRIPT "nopost.sh" )
 
 atlas_add_test( IOVDbFolder_test
diff --git a/Database/IOVDbSvc/src/IOVDbFolder.cxx b/Database/IOVDbSvc/src/IOVDbFolder.cxx
index fa3bfb3c3355..8adae94a0650 100644
--- a/Database/IOVDbSvc/src/IOVDbFolder.cxx
+++ b/Database/IOVDbSvc/src/IOVDbFolder.cxx
@@ -42,10 +42,8 @@
 #include "AthenaPoolUtilities/CondAttrListVecAddress.h"
 
 #include "GeoModelInterfaces/IGeoModelSvc.h"
-#include "EventInfo/TagInfo.h"
 
 #include "IOVDbMetaDataTools/IIOVDbMetaDataTool.h"
-#include "IOVDbDataModel/IOVMetaDataContainer.h"
 
 #include "IOVDbConn.h"
 
@@ -75,10 +73,12 @@ namespace{
 
 IOVDbFolder::IOVDbFolder(IOVDbConn* conn,
                          const IOVDbParser& folderprop, MsgStream& msg,
-                         IClassIDSvc* clidsvc, const bool checklock, const bool outputToFile,
+                         IClassIDSvc* clidsvc, IIOVDbMetaDataTool* metadatatool,
+                         const bool checklock, const bool outputToFile,
                          const std::string & source):
   AthMessaging(Athena::getMessageSvc(), "IOVDbFolder"),
   p_clidSvc(clidsvc),
+  p_metaDataTool(metadatatool),
   m_conn(conn),
   m_checklock(checklock),
   m_foldertype(AttrList),
@@ -155,9 +155,9 @@ IOVDbFolder::~IOVDbFolder() {
   if (m_cachespec!=0) m_cachespec->release();
 }
 
-void IOVDbFolder::setMetaCon(const IOVMetaDataContainer* metacon) {
+void IOVDbFolder::useFileMetaData() {
   // enable folder from FLMD at given connection
-  m_metacon=metacon;
+  m_useFileMetaData = true;
   // if previously connected to a real DB connection, remove association
   if (m_conn!=0) {
     m_conn->decUsage();
@@ -176,8 +176,7 @@ IOVDbFolder::setTagOverride(const std::string& tag,const bool setFlag) {
   m_jotag=IOVDbNamespace::spaceStrip(tag);
 }
 
-void IOVDbFolder::setWriteMeta(IIOVDbMetaDataTool* metadatatool) {
-  p_metaDataTool=metadatatool;
+void IOVDbFolder::setWriteMeta() {
   m_writemeta=true;
 }
 
@@ -638,8 +637,9 @@ IOVDbFolder::getAddress(const cool::ValidityKey reftime,
   CondAttrListVec* attrListVec=0;
   cool::ValidityKey naystart=0;
   cool::ValidityKey naystop=cool::ValidityKeyMax;
-  if (m_metacon) {    
-    IOVDbNamespace::ReadFromFileMetaData readFromMetaData(m_metacon, reftime, m_timestamp);
+  if( m_useFileMetaData ) {    
+    IOVDbNamespace::SafeReadFromFileMetaData
+       readFromMetaData(m_foldername, p_metaDataTool, reftime, m_timestamp);
     if (not readFromMetaData.isValid()){
       ATH_MSG_ERROR( "read:Could not find IOVPayloadContainer for folder "<< m_foldername );
       return false;
@@ -887,39 +887,37 @@ IOVDbFolder::preLoadFolder(StoreGateSvc* detStore, const unsigned int cacheRun,
   // and sets up cache length, taking into account optional overrides
   // returns null pointer in case of problem
   p_detStore=detStore;
-  std::string folderdesc;
-  if (not m_metacon) {
+  if( not m_useFileMetaData ) {
     if(m_source=="CREST"){
       const std::string  tagName=sanitiseCrestTag(m_foldername);
-      folderdesc=folderDescriptionForTag(tagName);
+      m_folderDescription = folderDescriptionForTag(tagName);
     } else {
       //folder desc from db
-      std::tie(m_multiversion, folderdesc) = IOVDbNamespace::folderMetadata(m_conn, m_foldername);
+      std::tie(m_multiversion, m_folderDescription) = IOVDbNamespace::folderMetadata(m_conn, m_foldername);
     }
   } else {
-    // folder from meta-data
-    folderdesc=m_metacon->folderDescription();
+    // folder description from meta-data set already earlier
   }
-  ATH_MSG_DEBUG( "Folder description " << folderdesc);
+  ATH_MSG_DEBUG( "Folder description " << m_folderDescription);
   // register folder with meta-data tool if writing metadata
   if (m_writemeta) {
-    if (StatusCode::SUCCESS!=p_metaDataTool->registerFolder(m_foldername,folderdesc)) {
+    if (StatusCode::SUCCESS!=p_metaDataTool->registerFolder(m_foldername,m_folderDescription)) {
       ATH_MSG_ERROR( "Failed to register folder " << m_foldername<< " for meta-data write" );
       return nullptr;
     }
   }
   // parse the description string
-  IOVDbParser folderpar(folderdesc,msg());
+  IOVDbParser folderpar(m_folderDescription, msg());
   //use the overrides in the folderdescription, return nullptr immediately if something went wrong
   if (not overrideOptionsFromParsedDescription(folderpar)) return nullptr;
   // setup channel list and folder type
-  if (not m_metacon) {
+  if( not m_useFileMetaData ) {
     if(m_source=="CREST"){
         const auto & crestTag=sanitiseCrestTag(m_foldername);
         m_channums=channelListForTag(crestTag);
         const std::string & payloadSpec = payloadSpecificationForTag(crestTag);
         //determine foldertype from the description, the spec and the number of channels
-        m_foldertype = IOVDbNamespace::determineFolderType(folderdesc, payloadSpec, m_channums);
+        m_foldertype = IOVDbNamespace::determineFolderType(m_folderDescription, payloadSpec, m_channums);
     } else {
       // data being read from COOL
       auto fldPtr=m_conn->getFolderPtr<cool::IFolderPtr>(m_foldername);
diff --git a/Database/IOVDbSvc/src/IOVDbFolder.h b/Database/IOVDbSvc/src/IOVDbFolder.h
index 987b1a763e9a..dfa618101218 100644
--- a/Database/IOVDbSvc/src/IOVDbFolder.h
+++ b/Database/IOVDbSvc/src/IOVDbFolder.h
@@ -30,7 +30,6 @@
 
 class MsgStream;
 class IOVDbConn;
-class IOVMetaDataContainer;
 class IOpaqueAddress;
 class IAddressCreator;
 class StoreGateSvc;
@@ -40,7 +39,8 @@ class CondAttrListCollection;
 class IOVDbFolder : public AthMessaging {
 public:
   IOVDbFolder(IOVDbConn* conn, const IOVDbParser& folderprop, MsgStream& msg,
-              IClassIDSvc* clidsvc,const bool checklock, const bool outputToFile=false,
+              IClassIDSvc* clidsvc, IIOVDbMetaDataTool* metadatatool,
+              const bool checklock, const bool outputToFile=false,
               const std::string & source="COOL_DATABASE");
   ~IOVDbFolder();
   
@@ -73,12 +73,16 @@ public:
   IOVRange currentRange() const;
 
   // set methods - used after folder creation to set properties externally
-  void setMetaCon(const IOVMetaDataContainer* con);
+
+  // mark this folder as using metadata from an input file
+  void useFileMetaData();
+  // set folder description
+  void setFolderDescription(const std::string& description);
   // set tag override, set override flag as well if setFlag is true
   // override flag prevents reading of FLMD for this folder if present
   void setTagOverride(const std::string& tag,const bool setFlag);
   // set writeMeta flag
-  void setWriteMeta(IIOVDbMetaDataTool* metadatatool);
+  void setWriteMeta();
   // set IOV overrides
   void setIOVOverride(const unsigned int run,const unsigned int lumiblock,
                       const unsigned int time);
@@ -212,19 +216,21 @@ private:
 
   void 
   specialCacheUpdate(const cool::IObject& obj,const ServiceHandle<IIOVSvc>& iovSvc);
- 
-  
+
+
   StoreGateSvc*        p_detStore{nullptr};     // pointer to detector store
   IClassIDSvc*         p_clidSvc{nullptr};      // pointer to CLID service
   IIOVDbMetaDataTool*  p_metaDataTool{nullptr}; // pointer to metadata tool (writing)
   IOVDbConn*           m_conn{nullptr};         // pointer to corresponding IOVDbConn object (=0 FLMD)
   std::string m_foldername;       // COOL foldername
   std::string m_key;              // SG key where data is loaded (unique)
+  std::string m_folderDescription;// folder description
   bool m_multiversion{false};     // is folder multiversion
   bool m_timestamp{false};        // is folder indexed by timestamp (else runLB)
   bool m_tagoverride{false};      // is tag reset from override (needed for FLMD)
   bool m_notagoverride{false};    // tag must not be overridden from input file
   bool m_writemeta{false};        // is writing to metadata
+  bool m_useFileMetaData{false};  // is using input File MetaData
   bool m_fromMetaDataOnly{false}; // to be read from metadata only
   bool m_extensible{false};       // is this an extensible folder?
   bool m_named{false};            // folder has named channels
@@ -235,7 +241,6 @@ private:
   bool m_checklock{true};         // indicates if global tags should be checked locked
   cool::ValidityKey m_iovoverride{0};             // validity key to use
   IOVDbNamespace::FolderType m_foldertype;        // type of data in folder (enum)
-  const IOVMetaDataContainer* m_metacon{nullptr}; // metadata container (=0 if not FLMD)
 
   cool::ValidityKey m_cachelength{0}; // length of cache
   int m_cachehint{0};                 // cachehint value (set initial size to Nxchan)
@@ -298,7 +303,10 @@ inline bool IOVDbFolder::retrieved() const { return m_retrieved; }
 inline IOVDbNamespace::FolderType IOVDbFolder::folderType() const 
 {return m_foldertype;}
 
-inline bool IOVDbFolder::readMeta() const { return (m_metacon!=0); }
+inline void IOVDbFolder::setFolderDescription(const std::string& description)
+{ m_folderDescription = description; }
+
+inline bool IOVDbFolder::readMeta() const { return m_useFileMetaData; }
 
 inline bool IOVDbFolder::writeMeta() const { return m_writemeta; }
 
diff --git a/Database/IOVDbSvc/src/IOVDbSvc.cxx b/Database/IOVDbSvc/src/IOVDbSvc.cxx
index 3ddd72691c64..aec06b21e3a8 100644
--- a/Database/IOVDbSvc/src/IOVDbSvc.cxx
+++ b/Database/IOVDbSvc/src/IOVDbSvc.cxx
@@ -213,7 +213,8 @@ StatusCode IOVDbSvc::preLoadAddresses(StoreID::type storeID,tadList& tlist) {
         // take data from FLMD only if tag override is NOT set
         if (thisNamePtrPair.second->folderName()==fname && !(thisNamePtrPair.second->tagOverride())) {
           ATH_MSG_INFO( "Folder " << fname << " will be taken from file metadata" );
-          thisNamePtrPair.second->setMetaCon(&*cont);
+          thisNamePtrPair.second->useFileMetaData();
+          thisNamePtrPair.second->setFolderDescription( cont->folderDescription() );
           ++nused;
           break;
         }
@@ -905,7 +906,7 @@ StatusCode IOVDbSvc::setupFolders() {
     }
     // create the new folder, but only if a folder for this SG key has not
     // already been requested
-    IOVDbFolder* folder=new IOVDbFolder(conn,folderdata,msg(),&(*m_h_clidSvc),
+    IOVDbFolder* folder=new IOVDbFolder(conn,folderdata,msg(),&(*m_h_clidSvc), &(*m_h_metaDataTool),
                                         m_par_checklock, m_outputToFile.value(), m_par_source);
     const std::string& key=folder->key();
     if (m_foldermap.find(key)==m_foldermap.end()) {  //This check is too weak. For POOL-based folders, the SG key is in the folder description (not known at this point).
@@ -930,7 +931,7 @@ StatusCode IOVDbSvc::setupFolders() {
     for (const auto & thisFolder : m_foldermap) {
       IOVDbFolder* fptr=thisFolder.second;
       if ((fptr->folderName()).substr(0,match.size())==match) {
-        fptr->setWriteMeta(&(*m_h_metaDataTool));
+        fptr->setWriteMeta();
         ATH_MSG_INFO( "Folder " << fptr->folderName() << " will be written to file metadata" );
       }
     }//end loop over FolderMap
diff --git a/Database/IOVDbSvc/src/ReadFromFileMetaData.cxx b/Database/IOVDbSvc/src/ReadFromFileMetaData.cxx
index d6588dbbc443..740b9f4713d2 100644
--- a/Database/IOVDbSvc/src/ReadFromFileMetaData.cxx
+++ b/Database/IOVDbSvc/src/ReadFromFileMetaData.cxx
@@ -9,14 +9,15 @@
 #include "IOVDbDataModel/IOVPayloadContainer.h"
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
 #include "AthenaPoolUtilities/AthenaAttributeList.h"
+#include "IOVDbMetaDataTools/IIOVDbMetaDataTool.h"
 
 using IOVDbNamespace::makeEpochOrRunLumi;
 
 namespace IOVDbNamespace{
-  ReadFromFileMetaData::ReadFromFileMetaData( const IOVMetaDataContainer* container, 
-        const IOVTime & refTime, const bool useEpochTimestamp):
+  ReadFromFileMetaData::ReadFromFileMetaData( const IOVMetaDataContainer* container,
+        const IOVTime & refTime, const bool useEpochTimestamp) :
         m_metaContainer(container), 
-        m_referenceTime(refTime){
+        m_referenceTime(refTime) {
     m_payload = (container) ? (container->payloadContainer()) : (nullptr);
     if (m_payload){
       IOVPayloadContainer::const_iterator pitr=m_payload->find(m_referenceTime);
@@ -30,10 +31,12 @@ namespace IOVDbNamespace{
     }
   }
   //
-  ReadFromFileMetaData::ReadFromFileMetaData( const IOVMetaDataContainer* container, 
+  ReadFromFileMetaData::ReadFromFileMetaData( const IOVMetaDataContainer* container,
         const cool::ValidityKey & refTimeKey, const bool useEpochTimestamp)
-        :ReadFromFileMetaData(container,makeEpochOrRunLumi(refTimeKey,useEpochTimestamp),useEpochTimestamp){
-  }
+     : ReadFromFileMetaData( container,
+                             makeEpochOrRunLumi(refTimeKey,useEpochTimestamp),
+                             useEpochTimestamp )
+  { } 
   //
   ReadFromFileMetaData::~ReadFromFileMetaData(){
     if (m_newedPtr) delete m_pptr;
@@ -101,7 +104,36 @@ namespace IOVDbNamespace{
     return m_attrList;
   }
 
+//-----------------------------------------------------------------------
+   FMDReadLock::FMDReadLock( IIOVDbMetaDataTool* metadatatool )
+      : m_metadatatool(metadatatool)
+   {
+      m_metadatatool->lock_shared();
+   }
+
+   IOVMetaDataContainer* FMDReadLock::findFolder( const std::string& folderName )
+   {
+      return m_metadatatool->findMetaDataContainer( folderName );
+   }
+
+   FMDReadLock::~FMDReadLock() {
+      m_metadatatool->unlock_shared();
+   }
 
 
+  SafeReadFromFileMetaData::SafeReadFromFileMetaData(
+     const std::string& folderName,
+     IIOVDbMetaDataTool* metadatatool,
+     const IOVTime & refTime, const bool useEpochTimestamp )
+     :  FMDReadLock(metadatatool),
+        ReadFromFileMetaData( FMDReadLock::findFolder(folderName), refTime, useEpochTimestamp )
+  {  }
 
+  SafeReadFromFileMetaData::SafeReadFromFileMetaData(
+     const std::string& folderName,
+     IIOVDbMetaDataTool* metadatatool,
+     const cool::ValidityKey & refTimeKey, const bool useEpochTimestamp)
+     :  FMDReadLock(metadatatool),
+        ReadFromFileMetaData( FMDReadLock::findFolder(folderName), refTimeKey, useEpochTimestamp )
+  {  }
 }
diff --git a/Database/IOVDbSvc/src/ReadFromFileMetaData.h b/Database/IOVDbSvc/src/ReadFromFileMetaData.h
index 67eecee8946d..e362f7812b7b 100644
--- a/Database/IOVDbSvc/src/ReadFromFileMetaData.h
+++ b/Database/IOVDbSvc/src/ReadFromFileMetaData.h
@@ -17,6 +17,7 @@
 #include "IOVDbDataModel/IOVPayloadContainer.h"
 
 //fwd declarations
+class IIOVDbMetaDataTool;
 class IOVMetaDataContainer;
 class CondAttrListCollection;
 class AthenaAttributeList;
@@ -53,7 +54,30 @@ namespace IOVDbNamespace{
     CondAttrListCollection * m_attrListColl{};
     IOVDbNamespace::FolderType m_folderType{UNKNOWN};
     bool m_newedPtr{};
-  
   };
+
+
+   class FMDReadLock {
+   public:
+      FMDReadLock( const FMDReadLock& )=delete;
+      void operator=( const FMDReadLock& )=delete;
+      FMDReadLock( IIOVDbMetaDataTool* metadatatool );
+      ~FMDReadLock();
+      IOVMetaDataContainer* findFolder( const std::string& folderName );
+     private:
+      IIOVDbMetaDataTool* m_metadatatool {};
+   };
+
+   class SafeReadFromFileMetaData : private FMDReadLock, public ReadFromFileMetaData
+   {
+   public:
+      SafeReadFromFileMetaData( const std::string& folderName,
+                                IIOVDbMetaDataTool* metadatatool,
+                                const IOVTime & refTime, const bool useEpochTimestamp );
+      SafeReadFromFileMetaData( const std::string& folderName,
+                                IIOVDbMetaDataTool* metadatatool,
+                                const cool::ValidityKey & refTimeKey, const bool useEpochTimestamp);
+   };
+
 }//namespace
 #endif
diff --git a/Database/IOVDbSvc/test/IOVDbFolder_test.cxx b/Database/IOVDbSvc/test/IOVDbFolder_test.cxx
index b70a17f2b5a5..98d6704b123b 100644
--- a/Database/IOVDbSvc/test/IOVDbFolder_test.cxx
+++ b/Database/IOVDbSvc/test/IOVDbFolder_test.cxx
@@ -79,13 +79,13 @@ BOOST_FIXTURE_TEST_SUITE(IOVDbFolderTest , GaudiKernelFixture)
   //tests construction
   BOOST_AUTO_TEST_CASE(IOVDbFolderConstruction){
     //note:default construction is not explicitly deleted; perhaps it should be.
-    BOOST_CHECK_NO_THROW(IOVDbFolder f(&(connectionFixture.connection), parserFixture.parser, parserFixture.log, clidSvc.get(),false));
+    BOOST_CHECK_NO_THROW(IOVDbFolder f(&(connectionFixture.connection), parserFixture.parser, parserFixture.log, clidSvc.get(), nullptr, false));
   }
   BOOST_FIXTURE_TEST_SUITE(IOVDbFolderMethods, TestFolderFixture)
     BOOST_AUTO_TEST_CASE(PublicMethods){
       //preload tests
       IOVDbConn connection("sqlite://;schema=IOVDbFolderTest.db;dbname=OFLP200", true, parserFixture.log);
-      IOVDbFolder iovDbFolder(&connection, parserFixture.parser, parserFixture.log, clidSvc.get(),false,true);
+      IOVDbFolder iovDbFolder(&connection, parserFixture.parser, parserFixture.log, clidSvc.get(), nullptr, false, true);
       BOOST_TEST_CHECKPOINT("After instantiation, but before any loading method call");
       BOOST_TEST(iovDbFolder.folderName() == "/key1");
       BOOST_TEST(iovDbFolder.key() == "/key1");
-- 
GitLab


From fe88a61615f2228485312300b10d809f70e386ff Mon Sep 17 00:00:00 2001
From: Christian Grefe <christian.grefe@cern.ch>
Date: Thu, 17 Sep 2020 13:43:37 +0000
Subject: [PATCH 199/422] Remove caching of variables for tau track classifier

---
 .../tauRecTools/Root/HelperFunctions.cxx      |  49 ++++-
 .../tauRecTools/Root/TauTrackClassifier.cxx   | 205 +++++++-----------
 .../tauRecTools/tauRecTools/HelperFunctions.h |   2 +
 .../tauRecTools/TauTrackClassifier.h          |  11 +-
 4 files changed, 125 insertions(+), 142 deletions(-)

diff --git a/Reconstruction/tauRecTools/Root/HelperFunctions.cxx b/Reconstruction/tauRecTools/Root/HelperFunctions.cxx
index d2f8d07bde76..0a0af34dfb98 100644
--- a/Reconstruction/tauRecTools/Root/HelperFunctions.cxx
+++ b/Reconstruction/tauRecTools/Root/HelperFunctions.cxx
@@ -67,26 +67,27 @@ std::vector<TString> tauRecTools::parseStringMVAUtilsBDT(const TString& str, con
 
 //________________________________________________________________________________
 std::unique_ptr<MVAUtils::BDT> tauRecTools::configureMVABDT( std::map<TString, float*> &availableVars, const TString& weightFile){
+  using namespace tauRecTools::msgHelperFunction;
   std::unique_ptr<TFile> fBDT(TFile::Open(weightFile));
   if(!fBDT){
-    std::cerr << "ERROR Cannot find tau input BDT file: " << weightFile << std::endl;
+    ANA_MSG_ERROR("configureMVABDT: Cannot find tau input BDT file: " << weightFile );
     return nullptr;
   }
   
   TTree* tBDT = dynamic_cast<TTree*> (fBDT->Get("BDT"));
   if(!tBDT){
-    std::cerr << "ERROR Cannot find tau input BDT tree" << std::endl;
+    ANA_MSG_ERROR("configureMVABDT: Cannot find tau input BDT tree");
     return nullptr;
   }    
 
-  std::cout << "tauRecTools::configureMVABDT opened file: " << weightFile << std::endl;
+  ANA_MSG_INFO("configureMVABDT: opened file: " << weightFile);
 
   std::vector<float*> vars;
 
   //parsing of variables done here from TNamed object
   TNamed* n_varList = dynamic_cast<TNamed*> (fBDT->Get("varList"));
   if(!n_varList) {
-    std::cerr << "ERROR no Variable List in file : " << weightFile << std::endl;
+    ANA_MSG_ERROR("configureMVABDT: no Variable List in file: " << weightFile );
     return nullptr;
   }
   std::vector<TString> varList_ar = tauRecTools::parseStringMVAUtilsBDT(n_varList->GetTitle());
@@ -96,7 +97,7 @@ std::unique_ptr<MVAUtils::BDT> tauRecTools::configureMVABDT( std::map<TString, f
     if(str.Length()==0) continue;
     std::map<TString, float*>::iterator itr = availableVars.find(str);
     if(itr==availableVars.end()){
-      std::cerr << "ERROR Variable : " << str << " is not available" << std::endl;
+      ANA_MSG_ERROR("configureMVABDT: Variable : " << str << " is not available" );
       return nullptr;
     }
     vars.push_back( itr->second );
@@ -109,6 +110,44 @@ std::unique_ptr<MVAUtils::BDT> tauRecTools::configureMVABDT( std::map<TString, f
   return reader;
 }
 
+//________________________________________________________________________________
+std::unique_ptr<MVAUtils::BDT> tauRecTools::configureMVABDT(std::vector<TString>& availableVars, const TString& weightFile) {
+  using namespace tauRecTools::msgHelperFunction;
+  std::unique_ptr<TFile> fBDT(TFile::Open(weightFile));
+  if(!fBDT){
+    ANA_MSG_ERROR("configureMVABDT: Cannot find tau input BDT file: " << weightFile );
+    return nullptr;
+  }
+  
+  TTree* tBDT = dynamic_cast<TTree*> (fBDT->Get("BDT"));
+  if(!tBDT){
+    ANA_MSG_ERROR("configureMVABDT: Cannot find tau input BDT tree");
+    return nullptr;
+  }    
+
+  ANA_MSG_INFO("configureMVABDT: opened file: " << weightFile);
+
+  //parsing of variables done here from TNamed object
+  TNamed* n_varList = dynamic_cast<TNamed*> (fBDT->Get("varList"));
+  if(!n_varList) {
+    ANA_MSG_ERROR("configureMVABDT: no Variable List in file: " << weightFile );
+    return nullptr;
+  }
+  std::vector<TString> varList_ar = tauRecTools::parseStringMVAUtilsBDT(n_varList->GetTitle());
+  delete n_varList;
+
+  availableVars.clear();
+  for(const TString& str : varList_ar) {
+    availableVars.push_back( str );
+  }
+  
+  auto reader = std::make_unique<MVAUtils::BDT>(tBDT);
+
+  fBDT->Close();
+  return reader;
+}
+
+
 //________________________________________________________________________________
 const StatusCode tauRecTools::GetJetClusterList(const xAOD::Jet* jet, std::vector<const xAOD::CaloCluster*> &clusterList, bool incShowerSubtracted, TLorentzVector dRVector, double dRCut){
 
diff --git a/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx b/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
index 7268663e5c91..7fd0488d019a 100644
--- a/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
+++ b/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
@@ -98,7 +98,7 @@ TrackMVABDT::TrackMVABDT(const std::string& sName)
   , m_iBackgroundType(xAOD::TauJetParameters::classifiedFake)
   , m_iExpectedFlag(xAOD::TauJetParameters::unclassified)
   , m_rReader(nullptr)
-  , m_mAvailableVars({})
+  , m_inputVariableNames()
 {
   declareProperty( "InputWeightsPath", m_sInputWeightsPath );
   declareProperty( "Threshold", m_fThreshold );
@@ -115,91 +115,27 @@ TrackMVABDT::~TrackMVABDT()
 //______________________________________________________________________________
 StatusCode TrackMVABDT::finalize()
 {
-  for( std::pair<TString, float*> p : m_mAvailableVars ) delete p.second;
-  m_mAvailableVars.clear();
   return StatusCode::SUCCESS;
 }
 
 //______________________________________________________________________________
 StatusCode TrackMVABDT::initialize()
 {
-  m_mAvailableVars={
-    {"TracksAuxDyn.tauPt", new float(0)}
-    , {"TracksAuxDyn.jetSeedPt", new float(0)}
-    , {"TracksAuxDyn.tauEta", new float(0)}
-    , {"TracksAuxDyn.trackEta", new float(0)}
-    , {"TracksAuxDyn.z0sinThetaTJVA", new float(0)}
-    , {"TracksAuxDyn.rConv", new float(0)}
-    , {"TracksAuxDyn.rConvII", new float(0)}
-    , {"TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII", new float(0)}
-    , {"TracksAuxDyn.DRJetSeedAxis", new float(0)}
-    , {"TracksAuxDyn.dRJetSeedAxis", new float(0)}
-    , {"TracksAux.d0", new float(0)}
-    , {"TracksAux.qOverP", new float(0)}
-    , {"TracksAux.theta", new float(0)}
-    , {"TracksAux.eProbabilityHT", new float(0)}
-    , {"TracksAux.numberOfInnermostPixelLayerHits", new float(0)}
-    , {"TracksAux.numberOfPixelHits", new float(0)}
-    , {"TracksAux.numberOfPixelDeadSensors", new float(0)}
-    , {"TracksAux.numberOfPixelSharedHits", new float(0)}
-    , {"TracksAux.numberOfSCTHits", new float(0)}
-    , {"TracksAux.numberOfSCTDeadSensors", new float(0)}
-    , {"TracksAux.numberOfSCTSharedHits", new float(0)}
-    , {"TracksAux.numberOfTRTHighThresholdHits", new float(0)}
-    , {"TracksAux.numberOfTRTHits", new float(0)}
-    , {"TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors", new float(0)}
-    , {"TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors+TracksAux.numberOfSCTHits+TracksAux.numberOfSCTDeadSensors", new float(0)}
-    
-    , {"TauTracksAuxDyn.tauPt", new float(0)}
-    , {"TauTracksAuxDyn.jetSeedPt", new float(0)}
-    , {"TauTracksAuxDyn.tauEta", new float(0)}
-    , {"TauTracksAuxDyn.trackEta", new float(0)}
-    , {"TauTracksAuxDyn.z0sinThetaTJVA", new float(0)}
-    , {"TauTracksAuxDyn.rConv", new float(0)}
-    , {"TauTracksAuxDyn.rConvII", new float(0)}
-    , {"TauTracksAuxDyn.dRJetSeedAxis", new float(0)}
-    , {"TauTracksAuxDyn.d0", new float(0)}
-    , {"TauTracksAuxDyn.qOverP", new float(0)}
-    , {"TauTracksAuxDyn.theta", new float(0)}
-    , {"TauTracksAuxDyn.eProbabilityHT", new float(0)}
-    , {"TauTracksAuxDyn.numberOfInnermostPixelLayerHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelDeadSensors", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelSharedHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfSCTHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfSCTDeadSensors", new float(0)}
-    , {"TauTracksAuxDyn.numberOfSCTSharedHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfTRTHighThresholdHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfTRTHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors", new float(0)}
-    
-    
-    , {"1/(TauTracksAuxDyn.trackPt)", new float(0)}
-    , {"fabs(TauTracksAuxDyn.qOverP)", new float(0)}
-    , {"TauTracksAuxDyn.numberOfContribPixelLayers", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors+TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHoles", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
-    , {"TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
-    , {"TauTracksAux.pt", new float(0)}
-  };
-    
   ATH_CHECK(addWeightsFile());
   
   return StatusCode::SUCCESS;
 }
 
 //______________________________________________________________________________
-StatusCode TrackMVABDT::classifyTrack(xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau)
+StatusCode TrackMVABDT::classifyTrack(xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau) const
 {
   /// If TT/IT gives TT, only run TT/CR; otherwise, run IT/FT 
   if (xTrack.flag((xAOD::TauJetParameters::TauTrackFlag) m_iExpectedFlag)==false)
     return StatusCode::SUCCESS;
   
-  ATH_CHECK(setVars(xTrack, xTau));
-  double dValue = m_rReader->GetClassification();
+  std::vector<float> values;
+  ATH_CHECK(calculateVariables(xTrack, xTau, values));
+  double dValue = m_rReader->GetClassification(values);
   
   xTrack.setFlag((xAOD::TauJetParameters::TauTrackFlag) m_iExpectedFlag, false);
   if (m_fThreshold < dValue)
@@ -218,7 +154,7 @@ StatusCode TrackMVABDT::addWeightsFile()
   m_sInputWeightsPath = find_file(m_sInputWeightsPath);
   ATH_MSG_DEBUG("InputWeightsPath: " << m_sInputWeightsPath);
   
-  m_rReader = tauRecTools::configureMVABDT( m_mAvailableVars, m_sInputWeightsPath.c_str() );
+  m_rReader = tauRecTools::configureMVABDT( m_inputVariableNames, m_sInputWeightsPath.c_str() );
   if(m_rReader==nullptr) {
     ATH_MSG_FATAL("Couldn't configure MVA");
     return StatusCode::FAILURE;
@@ -228,7 +164,7 @@ StatusCode TrackMVABDT::addWeightsFile()
 }
 
 //______________________________________________________________________________
-StatusCode TrackMVABDT::setVars(const xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau)
+StatusCode TrackMVABDT::calculateVariables(const xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau, std::vector<float>& values) const
 {
   const xAOD::TrackParticle* xTrackParticle = xTrack.track();
   uint8_t iTracksNumberOfInnermostPixelLayerHits = 0; ATH_CHECK( xTrackParticle->summaryValue(iTracksNumberOfInnermostPixelLayerHits, xAOD::numberOfInnermostPixelLayerHits) );
@@ -263,67 +199,74 @@ StatusCode TrackMVABDT::setVars(const xAOD::TauTrack& xTrack, const xAOD::TauJet
   float fNumberOfPixelHoles = float(iNumberOfPixelHoles);
   float fNumberOfSCTHoles = float(iNumberOfSCTHoles);
 
+  std::map<TString, float> valueMap;
   // Could use the same naming convention in the BDT to simplify 
-  setVar("TracksAuxDyn.jetSeedPt") = xTau.ptJetSeed();
-  setVar("TracksAuxDyn.tauPt") = xTau.ptIntermediateAxis();
-  setVar("TracksAuxDyn.tauEta") = xTau.etaIntermediateAxis();
-  setVar("TracksAuxDyn.z0sinThetaTJVA") = xTrack.z0sinThetaTJVA(xTau);
-  setVar("TracksAuxDyn.rConv") = xTrack.rConv(xTau);
-  setVar("TracksAuxDyn.rConvII") = xTrack.rConvII(xTau);
-  setVar("TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII") = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
-  setVar("TracksAuxDyn.DRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
-  setVar("TracksAuxDyn.dRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
-  setVar("TracksAuxDyn.trackEta") = xTrackParticle->eta();
-  setVar("TracksAux.d0") = xTrackParticle->d0();
-  setVar("TracksAux.qOverP") = xTrackParticle->qOverP();
-  setVar("TracksAux.theta") = xTrackParticle->theta();
-  setVar("TracksAux.eProbabilityHT") = fTracksEProbabilityHT;
-  setVar("TracksAux.numberOfInnermostPixelLayerHits") = fTracksNumberOfInnermostPixelLayerHits;
-  setVar("TracksAux.numberOfPixelHits") = fTracksNPixelHits;
-  setVar("TracksAux.numberOfPixelDeadSensors") = fTracksNPixelDeadSensors;
-  setVar("TracksAux.numberOfPixelSharedHits") = fTracksNPixelSharedHits;
-  setVar("TracksAux.numberOfSCTHits") = fTracksNSCTHits;
-  setVar("TracksAux.numberOfSCTDeadSensors") = fTracksNSCTDeadSensors;
-  setVar("TracksAux.numberOfSCTSharedHits") = fTracksNSCTSharedHits;
-  setVar("TracksAux.numberOfTRTHighThresholdHits") = fTracksNTRTHighThresholdHits;
-  setVar("TracksAux.numberOfTRTHits") = fTracksNTRTHits;
-  setVar("TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors") = fTracksNPixHits;
-  setVar("TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors+TracksAux.numberOfSCTHits+TracksAux.numberOfSCTDeadSensors") = fTracksNSiHits;
-
-  setVar("TauTracksAuxDyn.jetSeedPt") = xTau.ptJetSeed();
-  setVar("TauTracksAuxDyn.tauPt") = xTau.ptIntermediateAxis();
-  setVar("TauTracksAuxDyn.tauEta") = xTau.etaIntermediateAxis();
-  setVar("TauTracksAuxDyn.z0sinThetaTJVA") = xTrack.z0sinThetaTJVA(xTau);
-  setVar("TauTracksAuxDyn.rConv") = xTrack.rConv(xTau);
-  setVar("TauTracksAuxDyn.rConvII") = xTrack.rConvII(xTau);
-  setVar("TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII") = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
-  setVar("TauTracksAuxDyn.dRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
-  setVar("TauTracksAuxDyn.trackEta") = xTrackParticle->eta();
-  setVar("TauTracksAuxDyn.d0") = xTrackParticle->d0();
-  setVar("TauTracksAuxDyn.qOverP") = xTrackParticle->qOverP();
-  setVar("TauTracksAuxDyn.theta") = xTrackParticle->theta();
-  setVar("TauTracksAuxDyn.eProbabilityHT") = fTracksEProbabilityHT;
-  setVar("TauTracksAuxDyn.numberOfInnermostPixelLayerHits") = fTracksNumberOfInnermostPixelLayerHits;
-  setVar("TauTracksAuxDyn.numberOfPixelHits") = fTracksNPixelHits;
-  setVar("TauTracksAuxDyn.numberOfPixelDeadSensors") = fTracksNPixelDeadSensors;
-  setVar("TauTracksAuxDyn.numberOfPixelSharedHits") = fTracksNPixelSharedHits;
-  setVar("TauTracksAuxDyn.numberOfSCTHits") = fTracksNSCTHits;
-  setVar("TauTracksAuxDyn.numberOfSCTDeadSensors") = fTracksNSCTDeadSensors;
-  setVar("TauTracksAuxDyn.numberOfSCTSharedHits") = fTracksNSCTSharedHits;
-  setVar("TauTracksAuxDyn.numberOfTRTHighThresholdHits") = fTracksNTRTHighThresholdHits;
-  setVar("TauTracksAuxDyn.numberOfTRTHits") = fTracksNTRTHits;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors") = fTracksNPixHits;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors") = fTracksNSiHits;
-
-  setVar("1/(TauTracksAuxDyn.trackPt)") = 1./xTrackParticle->pt();
-  setVar("fabs(TauTracksAuxDyn.qOverP)") = std::abs(xTrackParticle->qOverP());
-  setVar("TauTracksAuxDyn.numberOfContribPixelLayers") = fNumberOfContribPixelLayers;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles") = fTracksNPixHits+fNumberOfPixelHoles;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors+TauTracksAuxDyn.numberOfSCTHoles") = fTracksNSiHits+fNumberOfPixelHoles+fNumberOfSCTHoles;
-  setVar("TauTracksAuxDyn.numberOfPixelHoles") = fNumberOfPixelHoles;
-  setVar("TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHoles") = fNumberOfPixelHoles+fNumberOfSCTHoles;
-  setVar("TauTracksAuxDyn.numberOfSCTHoles") = fNumberOfSCTHoles;
-  setVar("TauTracksAux.pt") = xTrackParticle->pt();
+  valueMap["TracksAuxDyn.jetSeedPt"] = xTau.ptJetSeed();
+  valueMap["TracksAuxDyn.tauPt"] = xTau.ptIntermediateAxis();
+  valueMap["TracksAuxDyn.tauEta"] = xTau.etaIntermediateAxis();
+  valueMap["TracksAuxDyn.z0sinThetaTJVA"] = xTrack.z0sinThetaTJVA(xTau);
+  valueMap["TracksAuxDyn.rConv"] = xTrack.rConv(xTau);
+  valueMap["TracksAuxDyn.rConvII"] = xTrack.rConvII(xTau);
+  valueMap["TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII"] = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
+  valueMap["TracksAuxDyn.DRJetSeedAxis"] = xTrack.dRJetSeedAxis(xTau);
+  valueMap["TracksAuxDyn.dRJetSeedAxis"] = xTrack.dRJetSeedAxis(xTau);
+  valueMap["TracksAuxDyn.trackEta"] = xTrackParticle->eta();
+  valueMap["TracksAux.d0"] = xTrackParticle->d0();
+  valueMap["TracksAux.qOverP"] = xTrackParticle->qOverP();
+  valueMap["TracksAux.theta"] = xTrackParticle->theta();
+  valueMap["TracksAux.eProbabilityHT"] = fTracksEProbabilityHT;
+  valueMap["TracksAux.numberOfInnermostPixelLayerHits"] = fTracksNumberOfInnermostPixelLayerHits;
+  valueMap["TracksAux.numberOfPixelHits"] = fTracksNPixelHits;
+  valueMap["TracksAux.numberOfPixelDeadSensors"] = fTracksNPixelDeadSensors;
+  valueMap["TracksAux.numberOfPixelSharedHits"] = fTracksNPixelSharedHits;
+  valueMap["TracksAux.numberOfSCTHits"] = fTracksNSCTHits;
+  valueMap["TracksAux.numberOfSCTDeadSensors"] = fTracksNSCTDeadSensors;
+  valueMap["TracksAux.numberOfSCTSharedHits"] = fTracksNSCTSharedHits;
+  valueMap["TracksAux.numberOfTRTHighThresholdHits"] = fTracksNTRTHighThresholdHits;
+  valueMap["TracksAux.numberOfTRTHits"] = fTracksNTRTHits;
+  valueMap["TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors"] = fTracksNPixHits;
+  valueMap["TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors+TracksAux.numberOfSCTHits+TracksAux.numberOfSCTDeadSensors"] = fTracksNSiHits;
+
+  valueMap["TauTracksAuxDyn.jetSeedPt"] = xTau.ptJetSeed();
+  valueMap["TauTracksAuxDyn.tauPt"] = xTau.ptIntermediateAxis();
+  valueMap["TauTracksAuxDyn.tauEta"] = xTau.etaIntermediateAxis();
+  valueMap["TauTracksAuxDyn.z0sinThetaTJVA"] = xTrack.z0sinThetaTJVA(xTau);
+  valueMap["TauTracksAuxDyn.rConv"] = xTrack.rConv(xTau);
+  valueMap["TauTracksAuxDyn.rConvII"] = xTrack.rConvII(xTau);
+  valueMap["TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII"] = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
+  valueMap["TauTracksAuxDyn.dRJetSeedAxis"] = xTrack.dRJetSeedAxis(xTau);
+  valueMap["TauTracksAuxDyn.trackEta"] = xTrackParticle->eta();
+  valueMap["TauTracksAuxDyn.d0"] = xTrackParticle->d0();
+  valueMap["TauTracksAuxDyn.qOverP"] = xTrackParticle->qOverP();
+  valueMap["TauTracksAuxDyn.theta"] = xTrackParticle->theta();
+  valueMap["TauTracksAuxDyn.eProbabilityHT"] = fTracksEProbabilityHT;
+  valueMap["TauTracksAuxDyn.numberOfInnermostPixelLayerHits"] = fTracksNumberOfInnermostPixelLayerHits;
+  valueMap["TauTracksAuxDyn.numberOfPixelHits"] = fTracksNPixelHits;
+  valueMap["TauTracksAuxDyn.numberOfPixelDeadSensors"] = fTracksNPixelDeadSensors;
+  valueMap["TauTracksAuxDyn.numberOfPixelSharedHits"] = fTracksNPixelSharedHits;
+  valueMap["TauTracksAuxDyn.numberOfSCTHits"] = fTracksNSCTHits;
+  valueMap["TauTracksAuxDyn.numberOfSCTDeadSensors"] = fTracksNSCTDeadSensors;
+  valueMap["TauTracksAuxDyn.numberOfSCTSharedHits"] = fTracksNSCTSharedHits;
+  valueMap["TauTracksAuxDyn.numberOfTRTHighThresholdHits"] = fTracksNTRTHighThresholdHits;
+  valueMap["TauTracksAuxDyn.numberOfTRTHits"] = fTracksNTRTHits;
+  valueMap["TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors"] = fTracksNPixHits;
+  valueMap["TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors"] = fTracksNSiHits;
+
+  valueMap["1/(TauTracksAuxDyn.trackPt)"] = 1./xTrackParticle->pt();
+  valueMap["fabs(TauTracksAuxDyn.qOverP)"] = std::abs(xTrackParticle->qOverP());
+  valueMap["TauTracksAuxDyn.numberOfContribPixelLayers"] = fNumberOfContribPixelLayers;
+  valueMap["TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles"] = fTracksNPixHits+fNumberOfPixelHoles;
+  valueMap["TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors+TauTracksAuxDyn.numberOfSCTHoles"] = fTracksNSiHits+fNumberOfPixelHoles+fNumberOfSCTHoles;
+  valueMap["TauTracksAuxDyn.numberOfPixelHoles"] = fNumberOfPixelHoles;
+  valueMap["TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHoles"] = fNumberOfPixelHoles+fNumberOfSCTHoles;
+  valueMap["TauTracksAuxDyn.numberOfSCTHoles"] = fNumberOfSCTHoles;
+  valueMap["TauTracksAux.pt"] = xTrackParticle->pt();
+
+  values.clear();
+  values.reserve(m_inputVariableNames.size());
+  for (auto varName : m_inputVariableNames) {
+    values.push_back(valueMap[varName]);
+  }
 
   return StatusCode::SUCCESS;  
 }
diff --git a/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h b/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h
index 0dfd6a818070..153704156507 100644
--- a/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h
+++ b/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h
@@ -28,6 +28,8 @@ namespace tauRecTools
   bool sortTracks(const ElementLink<xAOD::TauTrackContainer> &l1, const ElementLink<xAOD::TauTrackContainer> &l2);
 
   std::unique_ptr<MVAUtils::BDT> configureMVABDT( std::map<TString, float*> &availableVars, const TString& weightFile);
+  // initialise the BDT and return the list of input variable names
+  std::unique_ptr<MVAUtils::BDT> configureMVABDT(std::vector<TString>& variableNames, const TString& weightFile);
 
   std::vector<TString> parseString(const TString& str, const TString& delim=",");
   std::vector<TString> parseStringMVAUtilsBDT(const TString& str, const TString& delim=",");
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h b/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h
index 219c1a34a6b1..d578ba763a3a 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h
@@ -72,9 +72,9 @@ class TrackMVABDT
   
   // executes MVA object to get the BDT score, makes the decision and resets
   // classification flags
-  StatusCode classifyTrack(xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau);
-  // set BDT input variables in the corresponding map entries
-  StatusCode setVars(const xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau);
+  StatusCode classifyTrack(xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau) const;
+  // calculate all input variables
+  StatusCode calculateVariables(const xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau, std::vector<float>& values) const;
 
   // load the root weights file and configure the MVA object with the correct
   // variable addresses
@@ -89,9 +89,8 @@ private:
   int m_iExpectedFlag;
   
   std::unique_ptr<MVAUtils::BDT> m_rReader; //!
-  
-  std::map<TString, float*> m_mAvailableVars; //!
-  inline float& setVar(const TString& var) { return *(m_mAvailableVars[var]); } //!< not-stateless, many such examples need to be fixed for r22
+
+  std::vector<TString> m_inputVariableNames; //!
 
 }; // class TrackMVABDT
 
-- 
GitLab


From 8b2e119a2b3727cc2ea54c5a3ab89292574199de Mon Sep 17 00:00:00 2001
From: Eleonora Rossi <eleonora.rossi@cern.ch>
Date: Thu, 17 Sep 2020 13:53:19 +0000
Subject: [PATCH 200/422] New MicroMegas package for offline Data Quality

---
 .../MMRawDataMonitoring/CMakeLists.txt        |  22 +
 .../MMRawDataMonitoring/MMRawDataMonAlg.h     | 118 ++++
 .../MMRawDataMonitoring/python/MMMonUtils.py  |  22 +
 .../python/MMMonitorAlgorithm.py              | 201 ++++++
 .../python/MMRawMonLabels.py                  |  36 ++
 .../share/MMMonRecOptions.py                  |  69 +++
 .../share/MMMonitorAlgorithm_oldCnf.py        |  52 ++
 .../share/MMRaw_MonitoringOptions.py          |  29 +
 .../src/MMRawDataMonAlg.cxx                   | 577 ++++++++++++++++++
 .../src/MMRawDataUtils.cxx                    | 179 ++++++
 .../MMRawDataMonitoring_entries.cxx           |   9 +
 11 files changed, 1314 insertions(+)
 create mode 100644 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/CMakeLists.txt
 create mode 100755 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h
 create mode 100644 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonUtils.py
 create mode 100644 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonitorAlgorithm.py
 create mode 100644 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMRawMonLabels.py
 create mode 100644 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonRecOptions.py
 create mode 100644 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonitorAlgorithm_oldCnf.py
 create mode 100755 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py
 create mode 100755 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataMonAlg.cxx
 create mode 100644 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx
 create mode 100755 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/components/MMRawDataMonitoring_entries.cxx

diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/CMakeLists.txt b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/CMakeLists.txt
new file mode 100644
index 000000000000..755061059cce
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/CMakeLists.txt
@@ -0,0 +1,22 @@
+################################################################################
+# Package: MMRawDataMonitoring
+################################################################################
+
+# Declare the package name:
+atlas_subdir( MMRawDataMonitoring )
+
+# External dependencies:
+find_package( ROOT COMPONENTS Graf Core Tree MathCore Hist RIO pthread Graf3d Gpad Html Postscript Gui GX11TTF GX11 )
+
+# Component(s) in the package:
+atlas_add_component( MMRawDataMonitoring
+                     src/*.cxx
+                     src/components/*.cxx
+                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+ 		     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaMonitoringLib EventInfo MuonIdHelpersLib MuonPrepRawData MuonDQAUtilsLib TrkSegment Identifier xAODEventInfo xAODTrigger GaudiKernel MuonCalibIdentifier MuonReadoutGeometry MuonRIO_OnTrack MuonSegment AnalysisTriggerEvent LWHists TrkEventPrimitives GeoModelUtilities MuonAnalysisInterfacesLib) 
+
+#
+# Install files from the package:
+atlas_install_headers( MMRawDataMonitoring )
+atlas_install_joboptions( share/*.py )
+atlas_install_python_modules( python/*.py )
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h
new file mode 100755
index 000000000000..23e6a4682269
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h
@@ -0,0 +1,118 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////////////////////////////
+// Package : MMRawDataMonitoring
+// Author:  M. Biglietti, E. Rossi (Roma Tre)
+//
+// DESCRIPTION:
+// Subject: MM-->Offline Muon Data Quality
+///////////////////////////////////////////////////////////////////////////////////////////
+
+#ifndef MMRawDataMonAlg_H
+#define MMRawDataMonAlg_H
+
+//Core Include
+#include "AthenaMonitoring/AthMonitorAlgorithm.h"
+#include "AthenaMonitoringKernel/Monitored.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h" 
+#include "AsgTools/ToolHandleArray.h"
+
+//Helper Includes
+
+#include "MuonAnalysisInterfaces/IMuonSelectionTool.h"
+#include "MuonDQAUtils/MuonDQAHistMap.h"
+#include "MuonPrepRawData/MuonCluster.h"
+#include "MuonPrepRawData/MuonPrepDataContainer.h"
+#include "MuonPrepRawData/MMPrepDataCollection.h"
+#include "MuonIdHelpers/IMuonIdHelperSvc.h"
+#include "MuonReadoutGeometry/MuonDetectorManager.h"
+#include "TrkSegment/SegmentCollection.h"
+#include "AthenaMonitoring/DQAtlasReadyFilterTool.h"
+#include "EventInfo/EventInfo.h"
+#include "EventInfo/EventID.h"
+#include "xAODTrigger/MuonRoIContainer.h"
+#include "xAODMuon/MuonContainer.h"
+#include "MuonPrepRawData/MuonPrepDataContainer.h"
+#include "MuonPrepRawData/MMPrepDataContainer.h"
+#include "MuonPrepRawData/MMPrepData.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "StoreGate/ReadHandleKey.h"
+
+//standard library includes
+#include <fstream> 
+#include <cstdlib>
+#include <iostream>
+
+namespace Muon {
+  class MMPrepData;
+  }
+
+namespace {
+  struct MMOverviewHistogramStruct;
+  struct MMSummaryHistogramStruct;
+}
+
+//stl includes                                                                                              
+                                                                    
+#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
+#include <set>
+
+//root includes
+class TString;
+
+class MMRawDataMonAlg: public AthMonitorAlgorithm {
+ public:
+
+  MMRawDataMonAlg( const std::string& name, ISvcLocator* pSvcLocator );
+
+  //  virtual ~MMRawDataMonAlg();
+  virtual ~MMRawDataMonAlg()=default;
+  virtual StatusCode initialize() override;
+  virtual StatusCode fillHistograms(const EventContext& ctx) const override;
+  
+ private:  
+
+  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
+
+  ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool{this,"MuonSelectionTool","CP::MuonSelectionTool/MuonSelectionTool"};
+  SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey",
+     "MuonDetectorManager","Key of input MuonDetectorManager condition data"};
+ 
+  virtual StatusCode  fillMMOverviewVects(const Muon::MMPrepData*, MMOverviewHistogramStruct& vects) const;
+  virtual void  fillMMOverviewHistograms(const MMOverviewHistogramStruct& vects,const int lb) const;
+  virtual StatusCode  fillMMSummaryVects( const Muon::MMPrepData*, MMSummaryHistogramStruct (&vects)[2][2][8][2][2][4]) const; //[side][sector][stationPhi][stationEta][multiplet][gas_gap]
+  virtual StatusCode  fillMMHistograms( const Muon::MMPrepData* ) const;                                      
+  virtual StatusCode  fillMMSummaryHistograms( const MMSummaryHistogramStruct (&vects)[2][2][8][2][2][4]) const;
+
+  void clusterFromTrack(const xAOD::TrackParticleContainer*,const int lb) const;
+  
+  int get_PCB_from_channel(const int channel) const;
+  int get_sectorPhi_from_stationPhi_stName(const int stationPhi, const std::string& stName) const;
+  int get_sectorEta_from_stationEta(const int stationEta) const;
+
+  int get_bin_for_occ_CSide_hist(const int stationEta, const int multiplet, const int gas_gap) const;
+  int get_bin_for_occ_ASide_hist(const int stationEta, const int multiplet, const int gas_gap) const;
+  int get_bin_for_occ_CSide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const;
+  int get_bin_for_occ_CSide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const;
+  int get_bin_for_occ_ASide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const;
+  int get_bin_for_occ_ASide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const;
+  int get_bin_for_occ_lb_CSide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB,const int isector) const;
+  int get_bin_for_occ_lb_CSide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB,int isector) const;
+  int get_bin_for_occ_lb_ASide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB,int isector) const;
+  int get_bin_for_occ_lb_ASide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB, const int isector) const;
+
+  SG::ReadHandleKey<Muon::MMPrepDataContainer> m_MMContainerKey{this,"MMPrepDataContainerName","MM_Measurements"};
+  SG::ReadHandleKey<xAOD::MuonContainer> m_muonKey{this,"MuonKey","Muons","muons"};
+
+  Gaudi::Property<bool> m_doMMESD{this,"DoMMESD",true};
+  Gaudi::Property<bool> m_do_mm_overview{this,"do_mm_overview",true};
+  
+   
+};    
+#endif
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonUtils.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonUtils.py
new file mode 100644
index 000000000000..093e4ba8b193
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonUtils.py
@@ -0,0 +1,22 @@
+#                                                                
+#Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# 
+
+import MMRawDataMonitoring.MMRawMonLabels as labels
+from MMRawDataMonitoring.MMRawMonLabels import *
+
+def getMMLabel(x,y):
+
+    labelx = getattr(labels, x)
+    labely = getattr(labels, y)
+    return labelx,labely
+
+def getMMLabelY(y):
+
+    labely = getattr(labels, y)
+    return labely
+
+def getMMLabelX(x):
+
+    labelx = getattr(labels, x)
+    return labelx
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonitorAlgorithm.py
new file mode 100644
index 000000000000..b85f5ff7b974
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonitorAlgorithm.py
@@ -0,0 +1,201 @@
+#
+#Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration                                    
+        
+#
+
+from AthenaConfiguration.ComponentFactory import CompFactory
+from MMMonUtils import getMMLabel,getMMLabelY
+
+def MMMonitoringConfig(inputFlags):
+    '''Function to configures some algorithms in the monitoring system.'''
+
+    ### STEP 1 ###
+    # Define one top-level monitoring algorithm. The new configuration 
+    # framework uses a component accumulator.
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    result = ComponentAccumulator()
+    # Make sure muon geometry is configured
+    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
+    result.merge(MuonGeoModelCfg(inputFlags))
+
+    # The following class will make a sequence, configure algorithms, and link
+    # them to GenericMonitoringTools
+
+    from AthenaMonitoring import AthMonitorCfgHelper
+    helper = AthMonitorCfgHelper(inputFlags,'MMAthMonitorCfg')
+    
+    # Adding an algorithm to the helper. 
+
+    mmMonAlg = helper.addAlgorithm(CompFactory.MMRawDataMonAlg,'MMMonAlg')
+    mmMonAlg.DoMMESD = True    
+    
+    # Add a generic monitoring tool (a "group" in old language). The returned                                
+    # object here is the standard GenericMonitoringTool. 
+
+    mmGroup = helper.addGroup(mmMonAlg,'mmMonitor','Muon/MuonRawDataMonitoring/MM/')
+    
+    # Configure histograms
+
+    # Overview histograms
+    mmGroup.defineHistogram('charge_all;Charge',  type='TH1F',
+                            title='Charge;Charge[fC];Number of Entries',
+                        path='Overview',   xbins=120, xmin=0., xmax=1200.
+                       )
+
+    mmGroup.defineHistogram('x_mon,y_mon;Posy_vs_Posx', type='TH2F', title="Posy vs Posx;MM-GlobalX [mm];MM-GlobalY [mm];", path='Overview',xbins=500, xmin=-5000, xmax=5000., ybins=500, ymin=-5000.,ymax=5000.)
+    
+    mmGroup.defineHistogram('R_mon,z_mon;Posz_vs_R', type='TH2F', title="Posz vs R;MM-GlobalR [mm];MM-GlobalZ [mm];", path='Overview',xbins=500, xmin=0, xmax=5000., ybins=1000, ymin=-8000 ,ymax=8000)
+    
+    mmGroup.defineHistogram('numberofstrips_percluster;Number_of_strips_percluster',  type='TH1F',
+                        title='Number of strips per cluster;Number of strips;Number of Entries',
+                            path='Overview',   xbins=20, xmin=0., xmax=20.)
+    
+    mmGroup.defineHistogram('mu_TPC_angle;uTPC_angle',  type='TH1F',
+                            title='#mu TPC angle;#mu TPC angle [degrees];Number of Entries',
+                            path='Overview',   xbins=2000, xmin=-100, xmax=100)
+
+    mmGroup.defineHistogram('mu_TPC_chi2;uTPC_chi2',  type='TH1F',
+                        title='#mu TPC #chi2; #mu TPC #chi2;Number of Entries',
+                        path='Overview',   xbins=100, xmin=0., xmax=1.)
+
+    mmGroup.defineHistogram('time_all;Time',  type='TH1F',
+                        title='Time;Time[ns];Number of Entries',
+                        path='Overview',   xbins=1000, xmin=0., xmax=10000.)
+
+    mmGroup.defineHistogram('statEta_strip,strip_number;Strip_Numbers_vs_StationEta',    type='TH2F',
+                            title='Strip Numbers vs Station Eta;; Strip Numbers;',
+                            path='Overview',   xbins=5, xmin=-2, xmax=3., xlabels=['#eta-2','#eta-1','','#eta1','#eta2'], ybins=5120, ymin=0., ymax=5120.)
+
+    thisLabelx,thisLabely=getMMLabel("x_lab_occ_etaminus1","y_lab_occ_etaminus1")
+
+    mmGroup.defineHistogram('sector_CSide_eta1,stationPhi_CSide_eta1;Occupancy_CSide_eta1_PCB', type='TH2F', title='Occupancy CSide eta1 PCB; ; ;', path='Occupancy', xbins=40, xmin=0, xmax=40., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx, ylabels=thisLabely)
+
+    mmGroup.defineHistogram('sector_CSide_eta1_ontrack,stationPhi_CSide_eta1_ontrack;Occupancy_CSide_eta1_PCB_ontrack', type='TH2F', title='Occupancy CSide eta1 PCB ontrack; ; ;', path='Occupancy_ontrack', xbins=40, xmin=0, xmax=40., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx, ylabels=thisLabely)
+
+    thisLabelx1,thisLabely1=getMMLabel("x_lab_occ_etaminus2","y_lab_occ_etaminus2")
+
+    mmGroup.defineHistogram('sector_CSide_eta2,stationPhi_CSide_eta2;Occupancy_CSide_eta2_PCB', type='TH2F', title='Occupancy CSide eta2 PCB; ; ;', path='Occupancy', xbins=24, xmin=0, xmax=24., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx1, ylabels=thisLabely1)
+
+    mmGroup.defineHistogram('sector_CSide_eta2_ontrack,stationPhi_CSide_eta2_ontrack;Occupancy_CSide_eta2_PCB_ontrack', type='TH2F', title='Occupancy CSide eta2 PCB ontrack; ; ;', path='Occupancy_ontrack', xbins=24, xmin=0, xmax=24., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx1, ylabels=thisLabely1)
+
+    thisLabelx2,thisLabely2=getMMLabel("x_lab_occ_eta1","y_lab_occ_eta1")
+
+    mmGroup.defineHistogram('sector_ASide_eta1,stationPhi_ASide_eta1;Occupancy_ASide_eta1_PCB', type='TH2F', title='Occupancy ASide eta1 PCB; ; ;', path='Occupancy', xbins=40, xmin=0, xmax=40., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx2, ylabels=thisLabely2)
+
+    mmGroup.defineHistogram('sector_ASide_eta1_ontrack,stationPhi_ASide_eta1_ontrack;Occupancy_ASide_eta1_PCB_ontrack', type='TH2F', title='Occupancy ASide eta1 PCB ontrack; ; ;', path='Occupancy_ontrack', xbins=40, xmin=0, xmax=40., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx2, ylabels=thisLabely2)
+
+    thisLabelx3,thisLabely3=getMMLabel("x_lab_occ_eta2","y_lab_occ_eta2")
+
+    mmGroup.defineHistogram('sector_ASide_eta2,stationPhi_ASide_eta2;Occupancy_ASide_eta2_PCB', type='TH2F', title='Occupancy ASide eta2 PCB; ; ;', path='Occupancy', xbins=24, xmin=0, xmax=24., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx3, ylabels=thisLabely3)
+
+    mmGroup.defineHistogram('sector_ASide_eta2_ontrack,stationPhi_ASide_eta2_ontrack;Occupancy_ASide_eta2_PCB_ontrack', type='TH2F', title='Occupancy ASide eta2 PCB ontrack; ; ;', path='Occupancy_ontrack', xbins=24, xmin=0, xmax=24., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx3, ylabels=thisLabely3)
+
+    thisLabely4=getMMLabelY("y_lab_lb_CSide_eta2")
+
+    mmGroup.defineHistogram('lb_mon,sector_lb_CSide_eta2;Occupancy_lb_CSide_eta2_PCB', type='TH2F', title="Occupancy lb CSide eta2 PCB; ; ;", path='Occupancy', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=49,ylabels=thisLabely4,opt='kAddBinsDynamically')
+
+    mmGroup.defineHistogram('lb_ontrack,sector_lb_CSide_eta2_ontrack;Occupancy_lb_CSide_eta2_PCB_ontrack', type='TH2F', title="Occupancy lb CSide eta2 PCB ontrack; ; ;", path='Occupancy_ontrack', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=49, ylabels=thisLabely4, opt='kAddBinsDynamically')
+
+    thisLabely5=getMMLabelY("y_lab_lb_CSide_eta1")
+
+    mmGroup.defineHistogram('lb_mon,sector_lb_CSide_eta1;Occupancy_lb_CSide_eta1_PCB', type='TH2F', title="Occupancy lb CSide eta1 PCB; ; ;", path='Occupancy', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=81,ylabels=thisLabely5,opt='kAddBinsDynamically')
+
+    mmGroup.defineHistogram('lb_ontrack,sector_lb_CSide_eta1_ontrack;Occupancy_lb_CSide_eta1_PCB_ontrack', type='TH2F', title="Occupancy lb CSide eta1 PCB ontrack; ; ;", path='Occupancy_ontrack', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=81,ylabels=thisLabely5,opt='kAddBinsDynamically')
+
+    thisLabely6=getMMLabelY("y_lab_lb_ASide_eta1")
+
+    mmGroup.defineHistogram('lb_mon,sector_lb_ASide_eta1;Occupancy_lb_ASide_eta1_PCB', type='TH2F', title="Occupancy lb ASide eta1 PCB; ; ;", path='Occupancy', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=81,ylabels=thisLabely6,opt='kAddBinsDynamically')
+
+    mmGroup.defineHistogram('lb_ontrack,sector_lb_ASide_eta1_ontrack;Occupancy_lb_ASide_eta1_PCB_ontrack', type='TH2F', title="Occupancy lb ASide eta1 PCB ontrack; ; ;", path='Occupancy_ontrack', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=81,ylabels=thisLabely6,opt='kAddBinsDynamically')
+
+    thisLabely7=getMMLabelY("y_lab_lb_ASide_eta2")
+
+    mmGroup.defineHistogram('lb_mon,sector_lb_ASide_eta2;Occupancy_lb_ASide_eta2_PCB', type='TH2F', title="Occupancy lb ASide eta2 PCB; ; ;", path='Occupancy', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=49,ylabels=thisLabely7,opt='kAddBinsDynamically')
+
+    mmGroup.defineHistogram('lb_ontrack,sector_lb_ASide_eta2_ontrack;Occupancy_lb_ASide_eta2_PCB_ontrack', type='TH2F', title="Occupancy lb ASide eta2 PCB ontrack; ; ;", path='Occupancy_ontrack', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=49,ylabels=thisLabely7,opt='kAddBinsDynamically')
+
+    side = ["CSide","ASide"]
+    sector = ["MMS","MML"]
+    etasector  = ["1","2"]
+    for iside in side:
+
+        if iside=="ASide":
+            thisLabelx11,thisLabely11=getMMLabel("x_lab_occ_ASide","y_lab_occ_ASide")
+        if iside=="CSide":
+            thisLabelx11,thisLabely11=getMMLabel("x_lab_occ_CSide","y_lab_occ_CSide")
+
+        MM_SideGroup="MM_sideGroup{0}".format(iside)
+        mmSideGroup=helper.addGroup(mmMonAlg, MM_SideGroup, "Muon/MuonRawDataMonitoring/MM/"+iside)
+        
+        # Histograms for each sector
+        phimax=8
+        multipletmin=1
+        multipletmax=2
+        for isector in sector:
+            for phi in range(1, phimax+1):
+                title_MMSummary="Number of strips per cluster,"+iside+" "+isector+" stPhi "+str(phi)   
+                var="sector_strip_"+iside+"_"+isector+"_phi"+str(phi)+",strip_number_"+iside+"_"+isector+"_phi"+str(phi)+";Strip_number_pergap_"+iside+"_"+isector+"stPhi"+str(phi)
+                mmSideGroup.defineHistogram(var, type='TH2F', title=title_MMSummary+"; ;Strip Number",      path='Number_of_strips_percluster_perPhiSector',   xbins=16, xmin=0, xmax=16, xlabels=thisLabelx11, ybins=5120, ymin=0., ymax=5120.)
+                for eta in etasector:
+                    for multi in range(multipletmin, multipletmax+1):
+                        for gas_gap in range(1,5):
+
+                            # Histograms for each layer
+
+                            title_MMSummary_charge="Charge "+iside+" "+isector+" stPhi"+str(phi)+" stEta"+str(eta)+" multiplet"+str(multi)+" gap"+str(gas_gap)
+                            var1="charge_"+iside+"_sector_"+isector+"_phi"+str(phi)+"_stationEta"+str(eta)+"_multiplet"+str(multi)+"_gas_gap"+str(gas_gap)+";Charge_"+iside+"_"+isector+"_stPhi"+str(phi)+"_stEta"+str(eta)+"_multiplet"+str(multi)+"_gap"+str(gas_gap)
+                            mmSideGroup.defineHistogram(var1,  type='TH1F', title=title_MMSummary_charge+';Charge [fC];Number of Entries',path='Charge_perLayer',   xbins=120, xmin=0., xmax=1200.)
+                            title_MMSummary_angle="uTPC angle "+iside+" "+isector+" stPhi"+str(phi)+" stEta"+str(eta)+" multiplet"+str(multi)+" gap"+str(gas_gap)
+                            var3="mu_TPC_angle_"+iside+"_sector_"+isector+"_phi"+str(phi)+"_stationEta"+str(eta)+"_multiplet"+str(multi)+"_gas_gap"+str(gas_gap)+";uTPCangle_"+iside+"_"+isector+"_stPhi"+str(phi)+"_stEta"+str(eta)+"_multiplet"+str(multi)+"_gap"+str(gas_gap)
+                            mmSideGroup.defineHistogram(var3,  type='TH1F', title=title_MMSummary_angle+"; #muTPC angle [degrees];Number of Entries",path='uTPC_angle_perLayer',    xbins=2000, xmin=-100, xmax=100)
+
+        for gas1 in range(1, 5):
+            for multi1 in range(1, 3):
+                title_ontrack="Posy vs Posx "+iside+" multiplet"+str(multi1)+" gap"+str(gas1)+" ontrack"
+                var_ontrack="x_"+iside+"_multiplet"+str(multi1)+"_gas_gap_"+str(gas1)+"_ontrack,y_"+iside+"_multiplet"+str(multi1)+"_gas_gap_"+str(gas1)+"_ontrack;Posy_vs_Posx_"+iside+"_multiplet"+str(multi1)+"_gas_gap_"+str(gas1)+"_ontrack"
+                mmSideGroup.defineHistogram(var_ontrack, type='TH2F', title=title_ontrack+";MM-GlobalX [mm];MM-GlobalY [mm];", path='PosY_vs_Posx_perLayer_ontrack',xbins=500, xmin=-5000, xmax=5000., ybins=500, ymin=-5000.,ymax=5000.)
+
+
+#    mmMonAlg.TriggerChain = ''
+
+    ####acc, seq = helper.result()
+    acc = helper.result()
+    result.merge(acc)
+    return result
+
+if __name__=='__main__':
+    # Setup the Run III behavior
+    from AthenaCommon.Configurable import Configurable
+    Configurable.configurableRun3Behavior = 1
+
+    from AthenaCommon.Constants import DEBUG
+    
+    # Set the Athena configuration flags
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    #ConfigFlags.Input.Files = ['/afs/cern.ch/work/e/elrossi/DQ_Run3/WorkDir/group.det-muon/group.det-muon.21673292.EXT1._000048.ESD.pool.root']
+    #ConfigFlags.Input.Files = ['/afs/cern.ch/work/e/elrossi/DQ_Run3/WorkDir/group.det-muon_Sym/group.det-muon.21823259.EXT1._000045_uTPC.ESD.pool.root']
+    #ConfigFlags.Input.Files = ["/afs/cern.ch/user/b/bigliett/work/DQ/group.det-muon.DiMuon10_100GeV.ESD.rel213_2020-06-18T2149_R3S_uTPC_v01_EXT1/group.det-muon.21673283.EXT1._000037.ESD.pool.root"]
+    #ConfigFlags.Input.Files = ['/afs/cern.ch/work/e/elrossi/DQ_updated_308/WorkDir/group.det-muon/group.det-muon.22415666.EXT1._000048.ESD.pool.root']
+    ConfigFlags.Input.Files = ['/afs/cern.ch/work/e/elrossi/DQ_Run3/WorkDir/group.det-muon_Sym/group.det-muon.21670802.EXT1._000006.ESD.pool.root','/afs/cern.ch/work/e/elrossi/DQ_updated/WorkDir/group.det-muon_Sym/group.det-muon.21670802.EXT1._000045.ESD.pool.root','/afs/cern.ch/work/e/elrossi/DQ_updated/WorkDir/group.det-muon_Sym/group.det-muon.21670802.EXT1._000030.ESD.pool.root','/afs/cern.ch/work/e/elrossi/DQ_updated/WorkDir/group.det-muon_Sym/group.det-muon.21670802.EXT1._000046.ESD.pool.root','/afs/cern.ch/work/e/elrossi/DQ_updated/WorkDir/group.det-muon_Sym/group.det-muon.21670802.EXT1._000014.ESD.pool.root']
+    #from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+  #  ConfigFlags.Input.isMC = True
+    ConfigFlags.Output.HISTFileName = 'monitor.root'
+
+    ConfigFlags.Detector.GeometryMM=True
+    ConfigFlags.Muon.doMicromegas = True
+    ConfigFlags.DQ.useTrigger=False
+
+    ConfigFlags.lock()
+    ConfigFlags.dump()
+    # Initialize configuration object, add accumulator, merge, and run.
+    from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
+    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+    cfg = MainServicesCfg(ConfigFlags)
+    cfg.merge(PoolReadCfg(ConfigFlags))
+    
+    mmMonitorAcc  =  MMMonitoringConfig(ConfigFlags)
+    mmMonitorAcc.OutputLevel=DEBUG
+    cfg.merge(mmMonitorAcc)
+    #cfg.printConfig(withDetails=True, summariseProps = True)  
+    # number of events selected in the ESD
+    cfg.run(1000)
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMRawMonLabels.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMRawMonLabels.py
new file mode 100644
index 000000000000..db27532b997c
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMRawMonLabels.py
@@ -0,0 +1,36 @@
+#                                                           
+#Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#
+
+#x-y labels for occupancy plots
+ 
+
+x_lab_occ_etaminus1=['#eta-1 ml1 gp1 PCB 1','#eta-1 ml1 gp1 PCB 2','#eta-1 ml1 gp1 PCB 3','#eta-1 ml1 gp1 PCB 4','#eta-1 ml1 gp1 PCB 5', '#eta-1 ml1 gp2 PCB 1','#eta-1 ml1 gp2 PCB 2','#eta-1 ml1 gp2 PCB 3','#eta-1 ml1 gp2 PCB 4','#eta-1 ml1 gp2 PCB 5', '#eta-1 ml1 gp3 PCB 1','#eta-1 ml1 gp3 PCB 2','#eta-1 ml1 gp3 PCB 3','#eta-1 ml1 gp3 PCB 4', '#eta-1 ml1 gp3 PCB 5', '#eta-1 ml1 gp4 PCB 1','#eta-1 ml1 gp4 PCB 2','#eta-1 ml1 gp4 PCB 3','#eta-1 ml1 gp4 PCB 4','#eta-1 ml1 gp4 PCB 5','#eta-1 ml2 gp1 PCB 1','#eta-1 ml2 gp1 PCB 2','#eta-1 ml2 gp1 PCB 3','#eta-1 ml2 gp1 PCB 4','#eta-1 ml2 gp1 PCB 5','#eta-1 ml2 gp2 PCB 1','#eta-1 ml2 gp2 PCB 2','#eta-1 ml2 gp2 PCB 3','#eta-1 ml2 gp2 PCB 4','#eta-1 ml2 gp2 PCB 5','#eta-1 ml2 gp3 PCB 1','#eta-1 ml2 gp3 PCB 2','#eta-1 ml2 gp3 PCB 3','#eta-1 ml2 gp3 PCB 4','#eta-1 ml2 gp3 PCB 5','#eta-1 ml2 gp4 PCB 1','#eta-1 ml2 gp4 PCB 2','#eta-1 ml2 gp4 PCB 3','#eta-1 ml2 gp4 PCB 4','#eta-1 ml2 gp4 PCB 5']
+y_lab_occ_etaminus1=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+
+x_lab_occ_etaminus2=['#eta-2 ml1 gp1 PCB 1','#eta-2 ml1 gp1 PCB 2','#eta-2 ml1 gp1 PCB 3', '#eta-2 ml1 gp2 PCB 1','#eta-2 ml1 gp2 PCB 2','#eta-2 ml1 gp2 PCB 3', '#eta-2 ml1 gp3 PCB 1','#eta-2 ml1 gp3 PCB 2','#eta-2 ml1 gp3 PCB 3', '#eta-2 ml1 gp4 PCB 1','#eta-2 ml1 gp4 PCB 2','#eta-2 ml1 gp4 PCB 3','#eta-2 ml2 gp1 PCB 1','#eta-2 ml2 gp1 PCB 2','#eta-2 ml2 gp1 PCB 3','#eta-2 ml2 gp2 PCB 1','#eta-2 ml2 gp2 PCB 2','#eta-2 ml2 gp2 PCB 3','#eta-2 ml2 gp3 PCB 1','#eta-2 ml2 gp3 PCB 2','#eta-2 ml2 gp3 PCB 3','#eta-2 ml2 gp4 PCB 1','#eta-2 ml2 gp4 PCB 2','#eta-2 ml2 gp4 PCB 3']
+y_lab_occ_etaminus2=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+x_lab_occ_ASide=['#eta1 ml1 gp1','#eta1 ml1 gp2', '#eta1 ml1 gp3', '#eta1 ml1 gp4', '#eta1 ml2 gp1','#eta1 ml2 gp2','#eta1 ml2 gp3','#eta1 ml2 gp4','#eta2 ml1 gp1','#eta2 ml1 gp2','#eta2 ml1 gp3','#eta2 ml1 gp4','#eta2 ml2 gp1','#eta2 ml2 gp2','#eta2 ml2 gp3','#eta2 ml2 gp4']
+y_lab_occ_ASide=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+
+x_lab_occ_CSide=['#eta-2 ml1 gp1', '#eta-2 ml1 gp2', '#eta-2 ml1 gp3', '#eta-2 ml1 gp4','#eta-2 ml2 gp1','#eta-2 ml2gp2','#eta-2 ml2 gp3','#eta-2 ml2gp4','#eta-1 ml1 gp1','#eta-1 ml1 gp2','#eta-1 ml1 gp3', '#eta-1 ml1 gp4','#eta-1 ml2 gp1','#eta-1 ml2 gp2','#eta-1 ml2 gp3','#eta-1 ml2 gp4']
+y_lab_occ_CSide=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+
+
+x_lab_occ_eta1=['#eta1 ml1 gp1 PCB 1','#eta1 ml1 gp1 PCB 2','#eta1 ml1 gp1 PCB 3','#eta1 ml1 gp1 PCB 4','#eta1 ml1 gp1 PCB 5', '#eta1 ml1 gp2 PCB 1','#eta1 ml1 gp2 PCB 2','#eta1 ml1 gp2 PCB 3','#eta1 ml1 gp2 PCB 4','#eta1 ml1 gp2 PCB 5', '#eta1 ml1 gp3 PCB 1','#eta1 ml1 gp3 PCB 2','#eta1 ml1 gp3 PCB 3','#eta1 ml1 gp3 PCB 4', '#eta1 ml1 gp3 PCB 5', '#eta1 ml1 gp4 PCB 1','#eta1 ml1 gp4 PCB 2','#eta1 ml1 gp4 PCB 3','#eta1 ml1 gp4 PCB 4','#eta1 ml1 gp4 PCB 5','#eta1 ml2 gp1 PCB 1','#eta1 ml2 gp1 PCB 2','#eta1 ml2 gp1 PCB 3','#eta1 ml2 gp1 PCB 4','#eta1 ml2 gp1 PCB 5','#eta1 ml2 gp2 PCB 1','#eta1 ml2 gp2 PCB 2','#eta1 ml2 gp2 PCB 3','#eta1 ml2 gp2 PCB 4','#eta1 ml2 gp2 PCB 5','#eta1 ml2 gp3 PCB 1','#eta1 ml2 gp3 PCB 2','#eta1 ml2 gp3 PCB 3','#eta1 ml2 gp3 PCB 4','#eta1 ml2 gp3 PCB 5','#eta1 ml2 gp4 PCB 1','#eta1 ml2 gp4 PCB 2','#eta1 ml2 gp4 PCB 3','#eta1 ml2 gp4 PCB 4','#eta1 ml2 gp4 PCB 5']
+y_lab_occ_eta1=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+x_lab_occ_eta2=['#eta2 ml1 gp1 PCB 1','#eta2 ml1 gp1 PCB 2','#eta2 ml1 gp1 PCB 3', '#eta2 ml1 gp2 PCB 1','#eta2 ml1 gp2 PCB 2','#eta2 ml1 gp2 PCB 3', '#eta2 ml1 gp3 PCB 1','#eta2 ml1 gp3 PCB 2','#eta2 ml1 gp3 PCB 3', '#eta2 ml1 gp4 PCB 1','#eta2 ml1 gp4 PCB 2','#eta2 ml1 gp4 PCB 3','#eta2 ml2 gp1 PCB 1','#eta2 ml2 gp1 PCB 2','#eta2 ml2 gp1 PCB 3','#eta2 ml2 gp2 PCB 1','#eta2 ml2 gp2 PCB 2','#eta2 ml2 gp2 PCB 3','#eta2 ml2 gp3 PCB 1','#eta2 ml2 gp3 PCB 2','#eta2 ml2 gp3 PCB 3','#eta2 ml2 gp4 PCB 1','#eta2 ml2 gp4 PCB 2','#eta2 ml2 gp4 PCB 3']
+y_lab_occ_eta2=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+y_lab_lb_ASide_eta1=['#eta1 ml1 gp1 PCB 1 MMS','#eta1 ml1 gp1 PCB 2 MMS','#eta1 ml1 gp1 PCB 3 MMS','#eta1 ml1 gp1 PCB 4 MMS','#eta1 ml1 gp1 PCB 5 MMS','#eta1 ml1 gp1 PCB 1 MML','#eta1 ml1 gp1 PCB 2 MML','#eta1 ml1 gp1 PCB 3 MML','#eta1 ml1 gp1 PCB 4 MML','#eta1 ml1 gp1 PCB 5 MML','#eta1 ml1 gp2 PCB 1 MMS','#eta1 ml1 gp2 PCB 2 MMS','#eta1 ml1 gp2 PCB 3 MMS','#eta1 ml1 gp2 PCB 4 MMS','#eta1 ml1 gp2 PCB 5 MMS','#eta1 ml1 gp2 PCB 1 MML','#eta1 ml1 gp2 PCB 2 MML','#eta1 ml1 gp2 PCB 3 MML','#eta1 ml1 gp2 PCB 4 MML','#eta1 ml1 gp2 PCB 5 MML', '#eta1 ml1 gp3 PCB 1 MMS','#eta1 ml1 gp3 PCB 2 MMS','#eta1 ml1 gp3 PCB 3 MMS','#eta1 ml1 gp3 PCB 4 MMS','#eta1 ml1 gp3 PCB 5 MMS','#eta1 ml1 gp3 PCB 1 MML','#eta1 ml1 gp3 PCB 2 MML','#eta1 ml1 gp3 PCB 3 MML','#eta1 ml1 gp3 PCB 4 MML','#eta1 ml1 gp3 PCB 5 MML', '#eta1 ml1 gp4 PCB 1 MMS','#eta1 ml1 gp4 PCB 2 MMS','#eta1 ml1 gp4 PCB 3 MMS','#eta1 ml1 gp4 PCB 4 MMS','#eta1 ml1 gp4 PCB 5 MMS','#eta1 ml1 gp4 PCB 1 MML','#eta1 ml1 gp4 PCB 2 MML','#eta1 ml1 gp4 PCB 3 MML','#eta1 ml1 gp4 PCB 4 MML','#eta1 ml1 gp4 PCB 5 MML', '#eta1 ml2 gp1 PCB 1 MMS','#eta1 ml2 gp1 PCB 2 MMS','#eta1 ml2 gp1 PCB 3 MMS','#eta1 ml2 gp1 PCB 4 MMS','#eta1 ml2 gp1 PCB 5 MMS','#eta1 ml2 gp1 PCB 1 MML','#eta1 ml2 gp1 PCB 2 MML','#eta1 ml2 gp1 PCB 3 MML','#eta1 ml2 gp1 PCB 4 MML','#eta1 ml2 gp1 PCB 5 MML','#eta1 ml2 gp2 PCB 1 MMS','#eta1 ml2 gp2 PCB 2 MMS','#eta1 ml2 gp2 PCB 3 MMS','#eta1 ml2 gp2 PCB 4 MMS','#eta1 ml2 gp2 PCB 5 MMS','#eta1 ml2 gp2 PCB 1 MML','#eta1 ml2 gp2 PCB 2 MML','#eta1 ml2 gp2 PCB 3 MML','#eta1 ml2 gp2 PCB 4 MML','#eta1 ml2 gp2 PCB 5 MML','#eta1 ml2 gp3 PCB 1 MMS','#eta1 ml2 gp3 PCB 2 MMS','#eta1 ml2 gp3 PCB 3 MMS','#eta1 ml2 gp3 PCB 4 MMS','#eta1 ml2 gp3 PCB 5 MMS','#eta1 ml2 gp3 PCB 1 MML','#eta1 ml2 gp3 PCB 2 MML','#eta1 ml2 gp3 PCB 3 MML','#eta1 ml2 gp3 PCB 4 MML','#eta1 ml2 gp3 PCB 5 MML','#eta1 ml2 gp4 PCB 1 MMS','#eta1 ml2 gp4 PCB 2 MMS','#eta1 ml2 gp4 PCB 3 MMS','#eta1 ml2 gp4 PCB 4 MMS','#eta1 ml2 gp4 PCB 5 MMS','#eta1 ml2 gp4 PCB 1 MML','#eta1 ml2 gp4 PCB 2 MML','#eta1 ml2 gp4 PCB 3 MML','#eta1 ml2 gp4 PCB 4 MML','#eta1 ml2 gp4 PCB 5 MML']
+
+y_lab_lb_ASide_eta2=['#eta2 ml1 gp1 PCB 1 MMS','#eta2 ml1 gp1 PCB 2 MMS','#eta2 ml1 gp1 PCB 3 MMS','#eta2 ml1 gp1 PCB 1 MML','#eta2 ml1 gp1 PCB 2 MML','#eta2 ml1 gp1 PCB 3 MML','#eta2 ml1 gp2 PCB 1 MMS','#eta2 ml1 gp2 PCB 2 MMS','#eta2 ml1 gp2 PCB 3 MMS','#eta2 ml1 gp2 PCB 1 MML','#eta2 ml1 gp2 PCB 2 MML','#eta2 ml1 gp2 PCB 3 MML','#eta2 ml1 gp3 PCB 1 MMS','#eta2 ml1 gp3 PCB 2 MMS','#eta2 ml1 gp3 PCB 3 MMS','#eta2 ml1 gp3 PCB 1 MML','#eta2 ml1 gp3 PCB 2 MML','#eta2 ml1 gp3 PCB 3 MML','#eta2 ml1 gp4 PCB 1 MMS','#eta2 ml1 gp4 PCB 2 MMS','#eta2 ml1 gp4 PCB 3 MMS','#eta2 ml1 gp4 PCB 1 MML','#eta2 ml1 gp4 PCB 2 MML','#eta2 ml1 gp4 PCB 3 MML','#eta2 ml2 gp1 PCB 1 MMS','#eta2 ml2 gp1 PCB 2 MMS','#eta2 ml2 gp1 PCB 3 MMS','#eta2 ml2 gp1 PCB 1 MML','#eta2 ml2 gp1 PCB 2 MML','#eta2 ml2 gp1 PCB 3 MML','#eta2 ml2 gp2 PCB 1 MMS','#eta2 ml2 gp2 PCB 2 MMS','#eta2 ml2 gp2 PCB 3 MMS','#eta2 ml2 gp2 PCB 1 MML','#eta2 ml2 gp2 PCB 2 MML','#eta2 ml2 gp2 PCB 3 MML','#eta2 ml2 gp3 PCB 1 MMS','#eta2 ml2 gp3 PCB 2 MMS','#eta2 ml2 gp3 PCB 3 MMS','#eta2 ml2 gp3 PCB 1 MML','#eta2 ml2 gp3 PCB 2 MML','#eta2 ml2 gp3 PCB 3 MML','#eta2 ml2 gp4 PCB 1 MMS','#eta2 ml2 gp4 PCB 2 MMS','#eta2 ml2 gp4 PCB 3 MMS','#eta2 ml2 gp4 PCB 1 MML','#eta2 ml2 gp4 PCB 2 MML','#eta2 ml2 gp4 PCB 3 MML']
+
+y_lab_lb_CSide_eta2=['#eta-2 ml1 gp1 PCB 1 MMS','#eta-2 ml1 gp1 PCB 2 MMS','#eta-2 ml1 gp1 PCB 3 MMS','#eta-2 ml1 gp1 PCB 1 MML','#eta-2 ml1 gp1 PCB 2 MML','#eta-2 ml1 gp1 PCB 3 MML', '#eta-2 ml1 gp2 PCB 1 MMS','#eta-2 ml1 gp2 PCB 2 MMS','#eta-2 ml1 gp2 PCB 3 MMS','#eta-2 ml1 gp2 PCB 1 MML','#eta-2 ml1 gp2 PCB 2 MML','#eta-2 ml1 gp2 PCB 3 MML', '#eta-2 ml1 gp3 PCB 1 MMS','#eta-2 ml1 gp3 PCB 2 MMS','#eta-2 ml1 gp3 PCB 3 MMS','#eta-2 ml1 gp3 PCB 1 MML','#eta-2 ml1 gp3 PCB 2 MML','#eta-2 ml1 gp3 PCB 3 MML', '#eta-2 ml1 gp4 PCB 1 MMS','#eta-2 ml1 gp4 PCB 2 MMS','#eta-2 ml1 gp4 PCB 3 MMS','#eta-2 ml1 gp4 PCB 1 MML','#eta-2 ml1 gp4 PCB 2 MML','#eta-2 ml1 gp4 PCB 3 MML','#eta-2 ml2 gp1 PCB 1 MMS','#eta-2 ml2 gp1 PCB 2 MMS','#eta-2 ml2 gp1 PCB 3 MMS','#eta-2 ml2 gp1 PCB 1 MML','#eta-2 ml2 gp1 PCB 2 MML','#eta-2 ml2 gp1 PCB 3 MML','#eta-2 ml2 gp2 PCB 1 MMS','#eta-2 ml2 gp2 PCB 2 MMS','#eta-2 ml2 gp2 PCB 3 MMS','#eta-2 ml2 gp2 PCB 1 MML','#eta-2 ml2 gp2 PCB 2 MML','#eta-2 ml2 gp2 PCB 3 MML','#eta-2 ml2 gp3 PCB 1 MMS','#eta-2 ml2 gp3 PCB 2 MMS','#eta-2 ml2 gp3 PCB 3 MMS','#eta-2 ml2 gp3 PCB 1 MML','#eta-2 ml2 gp3 PCB 2 MML','#eta-2 ml2 gp3 PCB 3 MML','#eta-2 ml2 gp4 PCB 1 MMS','#eta-2 ml2 gp4 PCB 2 MMS','#eta-2 ml2 gp4 PCB 3 MMS','#eta-2 ml2 gp4 PCB 1 MML','#eta-2 ml2 gp4 PCB 2 MML','#eta-2 ml2 gp4 PCB 3 MML']
+
+y_lab_lb_CSide_eta1=['#eta-1 ml1 gp1 PCB 1 MMS','#eta-1 ml1 gp1 PCB 2 MMS','#eta-1 ml1 gp1 PCB 3 MMS','#eta-1 ml1 gp1 PCB 4 MMS','#eta-1 ml1 gp1 PCB 5 MMS','#eta-1 ml1 gp1 PCB 1 MML','#eta-1 ml1 gp1 PCB 2 MML','#eta-1 ml1 gp1 PCB 3 MML','#eta-1 ml1 gp1 PCB 4 MML','#eta-1 ml1 gp1 PCB 5 MML','#eta-1 ml1 gp2 PCB 1 MMS','#eta-1 ml1 gp2 PCB 2 MMS','#eta-1 ml1 gp2 PCB 3 MMS','#eta-1 ml1 gp2 PCB 4 MMS','#eta-1 ml1 gp2 PCB 5 MMS','#eta-1 ml1 gp2 PCB 1 MML','#eta-1 ml1 gp2 PCB 2 MML','#eta-1 ml1 gp2 PCB 3 MML','#eta-1 ml1 gp2 PCB 4 MML','#eta-1 ml1 gp2 PCB 5 MML','#eta-1 ml1 gp3 PCB 1 MMS','#eta-1 ml1 gp3 PCB 2 MMS','#eta-1 ml1 gp3 PCB 3 MMS','#eta-1 ml1 gp3 PCB 4 MMS','#eta-1 ml1 gp3 PCB 5 MMS','#eta-1 ml1 gp3 PCB 1 MML','#eta-1 ml1 gp3 PCB 2 MML','#eta-1 ml1 gp3 PCB 3 MML','#eta-1 ml1 gp3 PCB 4 MML','#eta-1 ml1 gp3 PCB 5 MML', '#eta-1 ml1 gp4 PCB 1 MMS','#eta-1 ml1 gp4 PCB 2 MMS','#eta-1 ml1 gp4 PCB 3 MMS','#eta-1 ml1 gp4 PCB 4 MMS','#eta-1 ml1 gp4 PCB 5 MMS','#eta-1 ml1 gp4 PCB 1 MMS','#eta-1 ml1 gp4 PCB 2 MMS','#eta-1 ml1 gp4 PCB 3 MMS','#eta-1 ml1 gp4 PCB 4 MMS','#eta-1 ml1 gp4 PCB 5 MMS','#eta-1 ml2 gp1 PCB 1 MMS','#eta-1 ml2 gp1 PCB 2 MMS','#eta-1 ml2 gp1 PCB 3 MMS','#eta-1 ml2 gp1 PCB 4 MMS','#eta-1 ml2 gp1 PCB 5 MMS','#eta-1 ml2 gp1 PCB 1 MML','#eta-1 ml2 gp1 PCB 2 MML','#eta-1 ml2 gp1 PCB 3 MML','#eta-1 ml2 gp1 PCB 4 MML','#eta-1 ml2 gp1 PCB 5 MML','#eta-1 ml2 gp2 PCB 1 MMS','#eta-1 ml2 gp2 PCB 2 MMS','#eta-1 ml2 gp2 PCB 3 MMS','#eta-1 ml2 gp2 PCB 4 MMS','#eta-1 ml2 gp2 PCB 5 MMS','#eta-1 ml2 gp2 PCB 1 MML','#eta-1 ml2 gp2 PCB 2 MML','#eta-1 ml2 gp2 PCB 3 MML','#eta-1 ml2 gp2 PCB 4 MML','#eta-1 ml2 gp2 PCB 5 MML','#eta-1 ml2 gp3 PCB 1 MMS','#eta-1 ml2 gp3 PCB 2 MMS','#eta-1 ml2 gp3 PCB 3 MMS','#eta-1 ml2 gp3 PCB 4 MMS','#eta-1 ml2 gp3 PCB 5 MMS','#eta-1 ml2 gp3 PCB 1 MMS','#eta-1 ml2 gp3 PCB 2 MMS','#eta-1 ml2 gp3 PCB 3 MMS','#eta-1 ml2 gp3 PCB 4 MMS','#eta-1 ml2 gp3 PCB 5 MMS','#eta-1 ml2 gp4 PCB 1 MMS','#eta-1 ml2 gp4 PCB 2 MMS','#eta-1 ml2 gp4 PCB 3 MMS','#eta-1 ml2 gp4 PCB 4 MMS','#eta-1 ml2 gp4 PCB 5 MMS','#eta-1 ml2 gp4 PCB 1 MML','#eta-1 ml2 gp4 PCB 2 MML','#eta-1 ml2 gp4 PCB 3 MML','#eta-1 ml2 gp4 PCB 4 MML','#eta-1 ml2 gp4 PCB 5 MML']
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonRecOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonRecOptions.py
new file mode 100644
index 000000000000..07d0e971ab76
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonRecOptions.py
@@ -0,0 +1,69 @@
+###### Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ####### 
+
+from RecExConfig.RecFlags import rec
+from RecExConfig.RecAlgsFlags import recAlgs
+recAlgs.doTrigger=False
+
+# reat ESD don't write anything
+rec.readESD=True
+rec.doWriteAOD=False
+rec.doWriteESD=False
+rec.doWriteTAG=False
+rec.doAOD=False
+rec.doDPD=False
+rec.doESD=False
+doTAG=False
+# switch off as much as possible
+rec.doTruth=False
+rec.doRecoTiming=False
+
+rec.doShowSizeStatistics=False
+rec.readTAG=False
+rec.readRDO=False
+rec.doContainerRemapping=False
+rec.doJiveXML=False
+rec.doEdmMonitor=False
+rec.doDumpPoolInputContent=False
+rec.doHeavyIon=False
+rec.doHIP=False
+rec.doWriteBS=False
+rec.doPhysValMonHists=False
+rec.doVP1=False
+rec.doJiveXML=False
+rec.doCheckDictionary=False
+rec.doFileMetaData=False
+rec.doAODCaloCells=False
+recAlgs.doAtlfast=False
+recAlgs.doMonteCarloReact=False
+rec.doEgamma=False
+rec.CBNTAthenaAware=False
+rec.doAODSelect=False
+rec.doWritexAOD=False
+rec.doPerfMon=False
+rec.doTagRawSummary=False
+rec.doBTagging=False
+rec.doSemiDetailedPerfMon=False
+rec.doAODall=False
+rec.doTau=False
+rec.doJetMissingETTag=False
+
+recAlgs.doCaloTrkMuId=False
+recAlgs.doEFlow=False
+recAlgs.doMissingET=False
+recAlgs.doMuGirl=False
+recAlgs.doMuTag=False
+recAlgs.doMuonIDCombined=False
+recAlgs.doMuonIDStandAlone=False
+recAlgs.doStaco=False
+recAlgs.doTileMuID=False
+recAlgs.doTrackParticleCellAssociation=False
+recAlgs.doTrackRecordFilter=False
+
+rec.AutoConfiguration = [ "everything" ]
+
+from AthenaCommon.DetFlags import DetFlags      
+DetFlags.detdescr.all_setOn()
+
+
+include("RecExCommon/RecExCommon_topOptions.py")
+
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonitorAlgorithm_oldCnf.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonitorAlgorithm_oldCnf.py
new file mode 100644
index 000000000000..76bf55240d95
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonitorAlgorithm_oldCnf.py
@@ -0,0 +1,52 @@
+###### Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ####### 
+
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+athenaCommonFlags.FilesInput = ["/afs/cern.ch/user/b/bigliett/work/DQ/group.det-muon.DiMuon10_100GeV.ESD.rel213_2020-06-18T2149_R3S_uTPC_v01_EXT1/group.det-muon.21673283.EXT1._000037.ESD.pool.root"]
+
+include("MMRawDataMonitoring/MMMonRecOptions.py")
+
+from AthenaCommon.AlgSequence import AlgSequence
+topSequence = AlgSequence()
+
+from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
+topSequence += AthenaMonManager("mmMonManager")
+
+from AthenaMonitoring.DQMonFlags import DQMonFlags
+DQMonFlags.useTrigger=False
+DQMonFlags.monManFileKey             = "MON"
+
+from AthenaCommon.AppMgr import ServiceMgr
+ServiceMgr.THistSvc.Output += [ DQMonFlags.monManFileKey()+" DATAFILE='monitoring.root' OPT='RECREATE'" ]
+
+mmMonMan = topSequence.mmMonManager
+
+from AthenaMonitoring import AthMonitorCfgHelperOld
+helper = AthMonitorCfgHelperOld(DQMonFlags,'MMAthMonitorCfg')
+
+from MMRawDataMonitoring.MMRawDataMonitoringConf import MMRawDataMonAlg
+mmMonAlg = helper.addAlgorithm(MMRawDataMonAlg,'MMMonAlg')
+
+mmMonAlg.TriggerChain = ''
+
+mmGroup = helper.addGroup(mmMonAlg,'mmMonitor','Muon/MuonRawDataMonitoring/MM/')
+
+mmGroup.defineHistogram('charge_all;Charge',  type='TH1F',
+                        title='Charge;Charge[ADC];Number of Entries',
+                        path='Overview',   xbins=20000, xmin=0., xmax=10000000.
+                       )
+mmGroup.defineHistogram('numberstrips;Number_of_strips',  type='TH1F',
+                        title='Number_of_strips;Number of strips;Number of Entries',
+                        path='Overview',   xbins=20, xmin=0., xmax=20.
+                       )
+mmGroup.defineHistogram('time_all;Time',  type='TH1F',
+                        title='Time;Time[ns];Number of Entries',
+                        path='Overview',   xbins=1000, xmin=0., xmax=100000.
+                       )
+mmGroup.defineHistogram('statEta,channel_mon;Channels_vs_StationEta',    type='TH2F',
+                            title='Channels vs Station Eta;; Channel;',
+                            path='Overview',   xbins=5, xmin=-2, xmax=3., xlabels=['#eta-2','#eta-1','','#eta1','#eta2'], ybins=5300, ymin=0., ymax=5300.
+                            )
+
+topSequence += helper.result()
+
+
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py
new file mode 100755
index 000000000000..adda051d091e
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py
@@ -0,0 +1,29 @@
+###### Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration #######
+
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+isTier0Flag = not athenaCommonFlags.isOnline()
+
+if not 'MuonDQAFlags' in dir():
+    print "MuonDQAFlags.py: MuonDQAFlags not yet imported - I import them now"
+    from MuonDQAMonFlags.MuonDQAFlags import MuonDQAFlags as MuonDQAFlags
+
+mmRawMonMan = AthenaMonManager(name="MMRawMonManager",
+                                FileKey             = DQMonFlags.monManFileKey(),
+                                Environment         = DQMonFlags.monManEnvironment(),
+                                OutputLevel         = muonOutputLevel)
+
+############# MMRawDataValAlg #############
+from MMRawDataMonitoring.MMRawDataMonitoringConf import MMRawDataValAlg
+
+#This it the main tool w/ detailed histograms
+mmRawDataValAlg_main = MMRawDataValAlg(name='mmRawDataValAlg_main',
+                                       Title='MM',
+                                       OutputLevel = INFO
+                                       )
+
+mmRawMonMan.AthenaMonTools += [ mmRawDataValAlg_main ]
+
+
+topSequence += mmRawMonMan
+print mmRawMonMan
+##################################################################
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataMonAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataMonAlg.cxx
new file mode 100755
index 000000000000..aa2187a5f2a5
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataMonAlg.cxx
@@ -0,0 +1,577 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Package : MMRawDataMonAlg
+// Authors:   M. Biglietti, E. Rossi (Roma Tre)
+// 
+//
+// DESCRIPTION:
+// Subject: MM-->Offline Muon Data Quality
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#include "MuonReadoutGeometry/MuonDetectorManager.h"
+#include "MuonReadoutGeometry/MuonStation.h"
+#include "MuonReadoutGeometry/MMReadoutElement.h"
+#include "MuonDQAUtils/MuonChamberNameConverter.h"
+#include "MuonDQAUtils/MuonChambersRange.h"
+#include "MuonDQAUtils/MuonDQAHistMap.h"
+#include "MuonCalibIdentifier/MuonFixedId.h"
+#include "MuonSegment/MuonSegment.h"
+
+#include "MMRawDataMonitoring/MMRawDataMonAlg.h"
+#include "TrkEventPrimitives/FitQuality.h"
+
+#include "AnalysisTriggerEvent/LVL1_ROI.h"
+#include "xAODMuon/Muon.h"
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODTracking/TrackParticle.h"
+#include "xAODTracking/TrackingPrimitives.h"
+#include "MuonPrepRawData/MuonPrepDataContainer.h"
+#include "MuonRIO_OnTrack/MMClusterOnTrack.h"
+#include "TrkTrack/TrackCollection.h"
+#include "TrkTrack/Track.h"
+#include "GaudiKernel/MsgStream.h"
+#include "AthenaMonitoring/AthenaMonManager.h"
+#include "MuonPrepRawData/MMPrepData.h"
+
+//root includes
+#include <TMath.h>
+#include <math.h>
+#include <sstream>
+#include <TH2F.h>
+#include <cmath>
+
+namespace {
+
+  int PCB;
+  static constexpr double const toDeg = 180/M_PI;
+
+  //1e=1.6X10-4 fC                                                                                          
+  static constexpr double conversion_charge=1.6E-04;
+
+  static const std::array<std::string,2> MM_Side = {"CSide", "ASide"};
+  static const std::array<std::string,2> MM_Sector = {"MMS", "MML"};
+  static const std::array<std::string,2> EtaSector = {"1","2"};
+
+
+  struct MMOverviewHistogramStruct {
+
+    std::vector<int> statEta_strip;
+    std::vector<int> charge_all;
+    std::vector<int> time_all;
+    std::vector<int> strip_number;
+    std::vector<int> numberofstrips_percluster;
+    std::vector<float> mu_TPC_angle;
+    std::vector<float> mu_TPC_chi2;
+    std::vector<float> R_mon;
+    std::vector<float> z_mon;
+    std::vector<float> x_mon;
+    std::vector<float> y_mon;
+    std::vector<int> stationPhi_ASide_eta1_ontrack;
+    std::vector<int> stationPhi_ASide_eta2_ontrack;
+    std::vector<int> stationPhi_CSide_eta1_ontrack;
+    std::vector<int> stationPhi_CSide_eta2_ontrack;
+    std::vector<int> sector_ASide_eta2_ontrack;
+    std::vector<int> sector_CSide_eta1_ontrack;
+    std::vector<int> sector_ASide_eta1_ontrack;
+    std::vector<int> sector_CSide_eta2_ontrack;
+    std::vector<int> sector_lb_ASide_eta1_ontrack;
+    std::vector<int> sector_lb_ASide_eta2_ontrack;
+    std::vector<int> sector_lb_CSide_eta1_ontrack;
+    std::vector<int> sector_lb_CSide_eta2_ontrack;
+    std::vector<int> stationPhi_ASide_eta1;
+    std::vector<int> stationPhi_ASide_eta2;
+    std::vector<int> stationPhi_CSide_eta1;
+    std::vector<int> stationPhi_CSide_eta2;
+    std::vector<int> sector_CSide_eta2;
+    std::vector<int> sector_ASide_eta2;
+    std::vector<int> sector_CSide_eta1;
+    std::vector<int> sector_ASide_eta1;
+    std::vector<int> sector_lb_ASide_eta1;
+    std::vector<int> sector_lb_ASide_eta2;
+    std::vector<int> sector_lb_CSide_eta1;
+    std::vector<int> sector_lb_CSide_eta2;
+
+  };
+
+  struct MMSummaryHistogramStruct {
+    
+    std::vector<int> strip_number;
+    std::vector<int> sector_strip;
+    std::vector<int> charge;
+    std::vector<float> mu_TPC_angle;
+    std::vector<float> x_ontrack;
+    std::vector<float> y_ontrack;
+  };
+
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// *********************************************************************
+// Public Methods
+// ********************************************************************* 
+
+MMRawDataMonAlg::MMRawDataMonAlg( const std::string& name, ISvcLocator* pSvcLocator )
+  :AthMonitorAlgorithm(name,pSvcLocator),
+   m_muonSelectionTool("CP::MuonSelectionTool/MuonSelectionTool"),
+   m_MMContainerKey("MM_Measurements")
+{
+  //Declare the property 
+  declareProperty("MMPrepDataContainerName",m_MMContainerKey);
+}
+
+/*---------------------------------------------------------*/
+StatusCode MMRawDataMonAlg::initialize()
+/*---------------------------------------------------------*/
+{   
+  // init message stream
+  ATH_MSG_DEBUG("initialize MMRawDataMonAlg" );
+  ATH_MSG_DEBUG("******************" );
+  ATH_MSG_DEBUG("doMMESD: " << m_doMMESD );
+  ATH_MSG_DEBUG("******************" );
+  
+  ATH_CHECK(AthMonitorAlgorithm::initialize());
+  ATH_CHECK(m_DetectorManagerKey.initialize());
+  ATH_CHECK(m_idHelperSvc.retrieve());
+
+  ATH_MSG_INFO(" Found the MuonIdHelperSvc " );
+  ATH_CHECK(m_muonKey.initialize());
+  ATH_CHECK(m_MMContainerKey.initialize() );
+  
+  ATH_MSG_DEBUG(" end of initialize " );
+  ATH_MSG_INFO("MMRawDataMonAlg initialization DONE " );
+
+  return StatusCode::SUCCESS;
+} 
+
+StatusCode MMRawDataMonAlg::fillHistograms(const EventContext& ctx) const
+{  
+  int lumiblock = -1;
+
+  lumiblock = GetEventInfo(ctx)->lumiBlock();
+
+  ATH_MSG_INFO("MMRawDataMonAlg::MM RawData Monitoring Histograms being filled" );
+
+  SG::ReadHandle<Muon::MMPrepDataContainer> mm_container(m_MMContainerKey,ctx);
+
+  ATH_MSG_INFO("****** mmContainer->size() : " << mm_container->size());
+
+  if (m_doMMESD) {
+    MMOverviewHistogramStruct overviewPlots;
+    MMSummaryHistogramStruct summaryPlots[2][2][8][2][2][4];
+
+  //loop in MMPrepDataContainer                                                                             
+         
+  for(const Muon::MMPrepDataCollection* coll : *mm_container) {
+
+    for (const Muon::MMPrepData* prd : *coll){
+
+      ATH_CHECK(fillMMOverviewVects(prd, overviewPlots));
+      ATH_CHECK(fillMMSummaryVects(prd, summaryPlots));
+      ATH_CHECK(fillMMHistograms(prd));
+    }
+  }
+
+  if (m_do_mm_overview) fillMMOverviewHistograms(overviewPlots,lumiblock);
+
+  ATH_CHECK( fillMMSummaryHistograms(summaryPlots) );
+
+  const xAOD::TrackParticleContainer* meTPContainer = nullptr;
+  ATH_CHECK(evtStore()->retrieve(meTPContainer,"ExtrapolatedMuonTrackParticles" ));
+  clusterFromTrack(meTPContainer,lumiblock);
+  
+  }
+
+ return StatusCode::SUCCESS;
+
+}
+
+StatusCode MMRawDataMonAlg::fillMMOverviewVects( const Muon::MMPrepData* prd, MMOverviewHistogramStruct& vects ) const {
+
+  Identifier Id = prd->identify();
+  const std::vector<Identifier>& stripIds = prd->rdoList();
+  unsigned int nStrips = stripIds.size();  // number of strips in this cluster (cluster size)               
+  const std::vector<uint16_t>& stripNumbers=prd->stripNumbers();
+ 
+  std::string stName   = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(Id));
+  int gas_gap          = m_idHelperSvc->mmIdHelper().gasGap(Id);
+  int stationNumber    = m_idHelperSvc->mmIdHelper().stationName(Id);
+  int stationEta       = m_idHelperSvc->mmIdHelper().stationEta(Id);
+  int stationPhi       = m_idHelperSvc->mmIdHelper().stationPhi(Id);
+  int multiplet        = m_idHelperSvc->mmIdHelper().multilayer(Id);
+  int channel          = m_idHelperSvc->mmIdHelper().channel(Id);
+   
+  // Returns the charge (number of electrons) converted in fC
+  int charge=prd->charge()*conversion_charge;
+  // Returns the time (in ns)
+  int drift_time=prd->time();
+  // Returns the microTPC angle (radians converted in degrees)
+  float mu_TPC_angle=prd->angle()*toDeg;
+  // Returns the microTPC chisq Prob.
+  float mu_TPC_chi2=prd->chisqProb();
+
+  Amg::Vector3D pos    = prd->globalPosition();
+  TVector3 v (pos.x(),pos.y(),pos.z());
+  
+  float R=std::hypot(pos.x(),pos.y());
+
+  PCB=get_PCB_from_channel(channel);
+
+  //MM gaps are back to back, so the direction of the drift (time) is different for the even and odd gaps -> flip for the even gaps
+
+  if (gas_gap % 2 == 0) { mu_TPC_angle = -mu_TPC_angle; } 
+  
+  vects.charge_all.push_back(charge);
+  vects.time_all.push_back(drift_time);
+  vects.numberofstrips_percluster.push_back(nStrips);
+  vects.mu_TPC_angle.push_back(mu_TPC_angle);
+  vects.mu_TPC_chi2.push_back(mu_TPC_chi2);
+  vects.x_mon.push_back(pos.x());
+  vects.y_mon.push_back(pos.y());
+  vects.z_mon.push_back(pos.z());
+  vects.R_mon.push_back(R);
+
+    
+  //MMS and MML phi sectors
+  int phisec=0;
+  if (stationNumber%2 == 0) phisec=1;
+    
+  //16 phi sectors, 8 stationPhi times 2 stName, MMS and MML
+  int sectorPhi=get_sectorPhi_from_stationPhi_stName(stationPhi,stName);  
+  
+  //Occupancy plots with PCB granularity further divided for each eta sector: -2, -1, 1, 2
+  
+  //Filling Vectors for stationEta=-2
+  if (stationEta==-2){
+    vects.sector_CSide_eta2.push_back(get_bin_for_occ_CSide_pcb_eta2_hist(stationEta,multiplet,gas_gap,PCB));
+    vects.stationPhi_CSide_eta2.push_back(sectorPhi);
+    vects.sector_lb_CSide_eta2.push_back(get_bin_for_occ_lb_CSide_pcb_eta2_hist(stationEta,multiplet,gas_gap,PCB,phisec));
+  }
+  //Filling Vectors for stationEta=-1
+  else if (stationEta==-1){
+    vects.sector_CSide_eta1.push_back(get_bin_for_occ_CSide_pcb_eta1_hist(stationEta,multiplet,gas_gap,PCB));
+    vects.stationPhi_CSide_eta1.push_back(sectorPhi);
+    vects.sector_lb_CSide_eta1.push_back(get_bin_for_occ_lb_CSide_pcb_eta1_hist(stationEta,multiplet,gas_gap,PCB,phisec));
+  }
+  //Filling Vectors for stationEta=1
+  else if (stationEta==1){
+    vects.sector_ASide_eta1.push_back(get_bin_for_occ_ASide_pcb_eta1_hist(stationEta,multiplet,gas_gap,PCB));
+    vects.stationPhi_ASide_eta1.push_back(sectorPhi);
+    vects.sector_lb_ASide_eta1.push_back(get_bin_for_occ_lb_ASide_pcb_eta1_hist(stationEta,multiplet,gas_gap,PCB,phisec));
+  }
+  //Filling Vectors for stationEta=2
+  else {
+    vects.sector_ASide_eta2.push_back(get_bin_for_occ_ASide_pcb_eta2_hist(stationEta,multiplet,gas_gap,PCB));
+    vects.stationPhi_ASide_eta2.push_back(sectorPhi);
+    vects.sector_lb_ASide_eta2.push_back(get_bin_for_occ_lb_ASide_pcb_eta2_hist(stationEta,multiplet,gas_gap,PCB,phisec));
+  }
+
+  //loop on each strip                                                                                       
+  
+  int sIdx = 0; // index-counter for the vector of Id's                                
+  for (const Identifier& id : stripIds){    
+    
+    std::string stName_strip   = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(id));
+    int stationEta_strip       = m_idHelperSvc->mmIdHelper().stationEta(id);
+
+    vects.statEta_strip.push_back(stationEta_strip);
+    vects.strip_number.push_back(stripNumbers[sIdx]);
+  }
+  return StatusCode::SUCCESS;
+}
+
+
+void MMRawDataMonAlg::fillMMOverviewHistograms( const MMOverviewHistogramStruct& vects, int lb ) const {
+
+  auto charge_all = Monitored::Collection("charge_all", vects.charge_all);
+  auto numberofstrips_percluster = Monitored::Collection("numberofstrips_percluster", vects.numberofstrips_percluster);
+  fill("mmMonitor",charge_all,numberofstrips_percluster);
+
+  auto time_all = Monitored::Collection("time_all", vects.time_all);
+  auto mu_TPC_angle=Monitored::Collection("mu_TPC_angle", vects.mu_TPC_angle);
+  auto mu_TPC_chi2=Monitored::Collection("mu_TPC_chi2", vects.mu_TPC_chi2);
+  auto strip_number = Monitored::Collection("strip_number", vects.strip_number);
+  auto statEta_strip = Monitored::Collection("statEta_strip", vects.statEta_strip);
+
+  fill("mmMonitor",time_all,mu_TPC_angle,mu_TPC_chi2,strip_number,statEta_strip);
+
+  auto x_mon = Monitored::Collection("x_mon", vects.x_mon);
+  auto y_mon = Monitored::Collection("y_mon", vects.y_mon);
+  auto z_mon = Monitored::Collection("z_mon", vects.z_mon);
+  auto R_mon = Monitored::Collection("R_mon", vects.R_mon);
+
+  fill("mmMonitor",x_mon,y_mon,z_mon,R_mon);
+    
+  auto lb_mon = Monitored::Scalar<int>("lb_mon", lb);
+    
+  auto sector_lb_CSide_eta2 = Monitored::Collection("sector_lb_CSide_eta2",vects.sector_lb_CSide_eta2);
+  auto sector_lb_CSide_eta1 = Monitored::Collection("sector_lb_CSide_eta1",vects.sector_lb_CSide_eta1);
+  auto sector_lb_ASide_eta2 = Monitored::Collection("sector_lb_ASide_eta2",vects.sector_lb_ASide_eta2);
+  auto sector_lb_ASide_eta1 = Monitored::Collection("sector_lb_ASide_eta1",vects.sector_lb_ASide_eta1);
+    
+  fill("mmMonitor",lb_mon,sector_lb_CSide_eta2,sector_lb_CSide_eta1,sector_lb_ASide_eta1,sector_lb_ASide_eta2);
+    
+  auto sector_CSide_eta2 = Monitored::Collection("sector_CSide_eta2",vects.sector_CSide_eta2);
+  auto sector_CSide_eta1 = Monitored::Collection("sector_CSide_eta1",vects.sector_CSide_eta1);
+  auto sector_ASide_eta1 = Monitored::Collection("sector_ASide_eta1",vects.sector_ASide_eta1);
+  auto sector_ASide_eta2 = Monitored::Collection("sector_ASide_eta2",vects.sector_ASide_eta2);
+  auto stationPhi_CSide_eta1 = Monitored::Collection("stationPhi_CSide_eta1",vects.stationPhi_CSide_eta1);
+  auto stationPhi_CSide_eta2 = Monitored::Collection("stationPhi_CSide_eta2",vects.stationPhi_CSide_eta2);
+  auto stationPhi_ASide_eta1 = Monitored::Collection("stationPhi_ASide_eta1",vects.stationPhi_ASide_eta1);
+  auto stationPhi_ASide_eta2 = Monitored::Collection("stationPhi_ASide_eta2",vects.stationPhi_ASide_eta2);
+  
+  fill("mmMonitor",sector_CSide_eta1,sector_CSide_eta2,sector_ASide_eta1,sector_ASide_eta2,stationPhi_CSide_eta1,stationPhi_CSide_eta2,stationPhi_ASide_eta1,stationPhi_ASide_eta2);
+    
+    
+
+}
+
+StatusCode MMRawDataMonAlg::fillMMSummaryVects( const Muon::MMPrepData* prd, MMSummaryHistogramStruct (&vects)[2][2][8][2][2][4]) const{
+
+  Identifier Id = prd->identify();
+  const std::vector<Identifier>& stripIds = prd->rdoList();
+
+  std::string stName   = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(Id));
+  int thisStationNumber    = m_idHelperSvc->mmIdHelper().stationName(Id);
+  int thisStationEta       = m_idHelperSvc->mmIdHelper().stationEta(Id);
+  int thisStationPhi       = m_idHelperSvc->mmIdHelper().stationPhi(Id);
+  int thisMultiplet        = m_idHelperSvc->mmIdHelper().multilayer(Id);
+  int thisGasgap          = m_idHelperSvc->mmIdHelper().gasGap(Id);
+  int thisCharge=prd->charge()*conversion_charge;
+
+  float thisMu_TPC_angle=prd->angle()*toDeg;
+    
+  if ( thisGasgap % 2 == 0 ) { thisMu_TPC_angle = - thisMu_TPC_angle; }
+    
+  //MMS and MML phi sectors
+  int phisec=0;
+  if (thisStationNumber%2 == 0) phisec=1;
+  
+  //CSide and ASide
+  int iside=0;
+  if(thisStationEta>0) iside=1;
+  
+  //2 eta sectors depending on Eta=+-1 (0) and +-2 (1)
+  int sectorEta=get_sectorEta_from_stationEta(thisStationEta);
+
+  auto& Vectors = vects[iside][phisec][thisStationPhi-1][sectorEta][thisMultiplet-1][thisGasgap-1];
+  
+  Vectors.mu_TPC_angle.push_back(thisMu_TPC_angle);
+  Vectors.charge.push_back(thisCharge);
+  
+  //loop on strips
+  int sIdx = 0;
+  const std::vector<uint16_t>& stripNumbers=prd->stripNumbers();
+  
+  for ( const Identifier& id : stripIds){
+    
+    int stationEta       = m_idHelperSvc->mmIdHelper().stationEta(id);
+    int gas_gap          = m_idHelperSvc->mmIdHelper().gasGap(Id);
+    int multiplet        = m_idHelperSvc->mmIdHelper().multilayer(Id); 
+
+    //    Filling Vectors for both sides, considering each strip  
+    Vectors.strip_number.push_back(stripNumbers[sIdx]);
+    Vectors.sector_strip.push_back(get_bin_for_occ_ASide_hist(stationEta,multiplet,gas_gap));
+    
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode MMRawDataMonAlg::fillMMSummaryHistograms( const MMSummaryHistogramStruct (&vects)[2][2][8][2][2][4]) const{
+  
+    
+  for (int iside=0;iside<2;iside++){
+    std::string MM_sideGroup = "MM_sideGroup"+MM_Side[iside];
+    
+    for (int isector=0;isector<2;isector++){
+      for( int statPhi=0; statPhi<8; statPhi++) {
+	for( int statEta=0; statEta<2; statEta++) {
+	  for( int multiplet=0; multiplet<2; multiplet++) {
+	    for( int gas_gap=0; gas_gap<4; gas_gap++) {
+	      
+	      auto& Vectors = vects[iside][isector][statPhi][statEta][multiplet][gas_gap];
+                          
+	      auto sector_strip=Monitored::Collection("sector_strip_"+MM_Side[iside]+"_"+MM_Sector[isector]+"_phi"+std::to_string(statPhi+1),Vectors.sector_strip);
+	      auto strip_number = Monitored::Collection("strip_number_"+MM_Side[iside]+"_"+MM_Sector[isector]+"_phi"+std::to_string(statPhi+1), Vectors.strip_number);
+	      
+	      fill(MM_sideGroup,strip_number,sector_strip);
+
+	      auto charge_perLayer = Monitored::Collection("charge_"+MM_Side[iside]+"_sector_"+MM_Sector[isector]+"_phi"+std::to_string(statPhi+1)+"_stationEta"+EtaSector[statEta]+"_multiplet"+std::to_string(multiplet+1)+"_gas_gap"+std::to_string(gas_gap+1), Vectors.charge);
+	      auto mu_TPC_angle_perLayer = Monitored::Collection("mu_TPC_angle_"+MM_Side[iside]+"_sector_"+MM_Sector[isector]+"_phi"+std::to_string(statPhi+1)+"_stationEta"+EtaSector[statEta]+"_multiplet"+std::to_string(multiplet+1)+"_gas_gap"+std::to_string(gas_gap+1),Vectors.mu_TPC_angle);
+
+	      fill(MM_sideGroup,charge_perLayer,mu_TPC_angle_perLayer);
+	      
+	    }
+	  }
+	}
+      }
+    }
+  }
+ 
+  return StatusCode::SUCCESS;
+    
+}
+
+StatusCode MMRawDataMonAlg::fillMMHistograms( const Muon::MMPrepData* ) const{
+
+  return StatusCode::SUCCESS;
+}
+
+                                                                                                           
+      
+void MMRawDataMonAlg::clusterFromTrack(const xAOD::TrackParticleContainer*  muonContainer, int lb) const{
+
+  MMSummaryHistogramStruct summaryPlots[2][2][4];
+  MMOverviewHistogramStruct overviewPlots;
+  int nmu=0;
+
+  for (const xAOD::TrackParticle* meTP  : *muonContainer){
+
+    if (meTP) {
+      nmu++;
+
+      // retrieve the original track                                                       
+      const Trk::Track* meTrack = meTP->track();
+      if (meTrack) {
+        // get the vector of measurements on track                                                           
+       
+	const DataVector<const Trk::MeasurementBase>* meas = meTrack->measurementsOnTrack();
+	
+	for(const Trk::MeasurementBase* it: *meas){
+	
+	  const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(it);
+	  
+	  if (rot) {
+	      
+	    Identifier rot_id = rot->identify();
+	    if (m_idHelperSvc->isMM(rot_id)) {
+	      const Muon::MMClusterOnTrack* cluster = dynamic_cast<const Muon::MMClusterOnTrack*>(rot);
+	      
+	      if (cluster) {
+		
+		std::string stName   = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(rot_id));
+		int stNumber    = m_idHelperSvc->mmIdHelper().stationName(rot_id);
+		int stEta= m_idHelperSvc->mmIdHelper().stationEta(rot_id);
+		int stPhi= m_idHelperSvc->mmIdHelper().stationPhi(rot_id);
+		int multi = m_idHelperSvc->mmIdHelper().multilayer(rot_id);
+		int gap=  m_idHelperSvc->mmIdHelper().gasGap(rot_id);
+		int ch=  m_idHelperSvc->mmIdHelper().channel(rot_id);
+                        
+		//MMS and MML phi sectors                                                                    
+		int phisec=0;
+		if (stNumber%2 == 0) phisec=1;
+		
+		int sectorPhi=get_sectorPhi_from_stationPhi_stName(stPhi,stName);
+		
+		PCB=get_PCB_from_channel(ch);
+		
+		auto& vects=overviewPlots;
+		
+		//Occupancy plots with PCB granularity further divided for each eta sector: -2, -1, 1, 2  
+		//Filling Vectors for stationEta=-1 - cluster on track
+		if (stEta==-1){
+		  vects.stationPhi_CSide_eta1_ontrack.push_back(sectorPhi);
+		  vects.sector_CSide_eta1_ontrack.push_back(get_bin_for_occ_CSide_pcb_eta1_hist(stEta,multi,gap,PCB));
+		  vects.sector_lb_CSide_eta1_ontrack.push_back(get_bin_for_occ_lb_CSide_pcb_eta1_hist(stEta,multi,gap,PCB,phisec));
+		}
+		//Filling Vectors for stationEta=-2 - cluster on track 
+		else if (stEta==-2){
+		  vects.stationPhi_CSide_eta2_ontrack.push_back(sectorPhi);
+		  vects.sector_CSide_eta2_ontrack.push_back(get_bin_for_occ_CSide_pcb_eta2_hist(stEta,multi,gap,PCB));
+		  vects.sector_lb_CSide_eta2_ontrack.push_back(get_bin_for_occ_lb_CSide_pcb_eta2_hist(stEta,multi,gap,PCB,phisec));
+		}
+		//Filling Vectors for stationEta=1 - cluster on track 
+		else if (stEta==1){
+		  vects.stationPhi_ASide_eta1_ontrack.push_back(sectorPhi);
+		  vects.sector_ASide_eta1_ontrack.push_back(get_bin_for_occ_ASide_pcb_eta1_hist(stEta,multi,gap,PCB));
+		  vects.sector_lb_ASide_eta1_ontrack.push_back(get_bin_for_occ_lb_ASide_pcb_eta1_hist(stEta,multi,gap,PCB,phisec));
+		}
+		//Filling Vectors for stationEta=2 - cluster on track 
+		else {
+		  vects.stationPhi_ASide_eta2_ontrack.push_back(sectorPhi);
+		  vects.sector_ASide_eta2_ontrack.push_back(get_bin_for_occ_ASide_pcb_eta2_hist(stEta,multi,gap,PCB));
+		  vects.sector_lb_ASide_eta2_ontrack.push_back(get_bin_for_occ_lb_ASide_pcb_eta2_hist(stEta,multi,gap,PCB,phisec));
+		  
+		  }
+	                      
+	      } //if cluster
+	    } //isMM
+	  } // if rot
+	} // loop on meas
+	
+	for (const Trk::TrackStateOnSurface* trkState: *meTrack->trackStateOnSurfaces()) {
+	  
+	  if(!(trkState)) continue;
+	  Identifier surfaceId = (trkState)->surface().associatedDetectorElementIdentifier();
+	  if(!m_idHelperSvc->isMM(surfaceId)) continue;
+	  
+	  const Amg::Vector3D& pos    = (trkState)->trackParameters()->position();
+	  int stEta= m_idHelperSvc->mmIdHelper().stationEta(surfaceId);
+	  int multi = m_idHelperSvc->mmIdHelper().multilayer(surfaceId);
+	  int gap=  m_idHelperSvc->mmIdHelper().gasGap(surfaceId);
+
+	  //CSide and ASide                                                                                  
+	  int iside=0;
+	  if(stEta>0) iside=1;
+
+	  auto& Vectors = summaryPlots[iside][multi-1][gap-1];
+	  
+	  //Filling x-y position vectors using the trackStateonSurface 
+	    Vectors.x_ontrack.push_back(pos.x());
+	    Vectors.y_ontrack.push_back(pos.y());
+	
+	  
+	}
+      } // if meTrack
+    } // if muon
+  } //loop on muonContainer
+
+  auto& vects=overviewPlots;
+
+  auto stationPhi_CSide_eta1_ontrack = Monitored::Collection("stationPhi_CSide_eta1_ontrack",vects.stationPhi_CSide_eta1_ontrack);
+  auto stationPhi_CSide_eta2_ontrack = Monitored::Collection("stationPhi_CSide_eta2_ontrack",vects.stationPhi_CSide_eta2_ontrack);
+  auto stationPhi_ASide_eta1_ontrack = Monitored::Collection("stationPhi_ASide_eta1_ontrack",vects.stationPhi_ASide_eta1_ontrack);
+  auto stationPhi_ASide_eta2_ontrack = Monitored::Collection("stationPhi_ASide_eta2_ontrack",vects.stationPhi_ASide_eta2_ontrack);
+  auto sector_ASide_eta1_ontrack = Monitored::Collection("sector_ASide_eta1_ontrack",vects.sector_ASide_eta1_ontrack);
+  auto sector_ASide_eta2_ontrack = Monitored::Collection("sector_ASide_eta2_ontrack",vects.sector_ASide_eta2_ontrack);
+  auto sector_CSide_eta2_ontrack = Monitored::Collection("sector_CSide_eta2_ontrack",vects.sector_CSide_eta2_ontrack);                                                                                         
+  auto sector_CSide_eta1_ontrack = Monitored::Collection("sector_CSide_eta1_ontrack",vects.sector_CSide_eta1_ontrack);   
+
+  auto lb_ontrack = Monitored::Scalar<int>("lb_ontrack", lb);
+
+  auto sector_lb_CSide_eta2_ontrack = Monitored::Collection("sector_lb_CSide_eta2_ontrack",vects.sector_lb_CSide_eta2_ontrack);
+  auto sector_lb_CSide_eta1_ontrack = Monitored::Collection("sector_lb_CSide_eta1_ontrack",vects.sector_lb_CSide_eta1_ontrack);
+  auto sector_lb_ASide_eta2_ontrack = Monitored::Collection("sector_lb_ASide_eta2_ontrack",vects.sector_lb_ASide_eta2_ontrack);
+  auto sector_lb_ASide_eta1_ontrack = Monitored::Collection("sector_lb_ASide_eta1_ontrack",vects.sector_lb_ASide_eta1_ontrack);
+
+  fill("mmMonitor",stationPhi_CSide_eta1_ontrack,stationPhi_CSide_eta2_ontrack,stationPhi_ASide_eta1_ontrack,stationPhi_ASide_eta2_ontrack,sector_CSide_eta1_ontrack,sector_CSide_eta2_ontrack,sector_ASide_eta1_ontrack,sector_ASide_eta2_ontrack,sector_lb_CSide_eta2_ontrack,sector_lb_CSide_eta1_ontrack,sector_lb_ASide_eta2_ontrack,sector_lb_ASide_eta1_ontrack,lb_ontrack);
+    
+  for (int iside=0;iside<2;iside++){
+   std::string MM_sideGroup = "MM_sideGroup"+MM_Side[iside];
+   for( int multiplet=0; multiplet<2; multiplet++) {
+     for( int gas_gap=0; gas_gap<4; gas_gap++) {
+	      
+       auto& Vectors = summaryPlots[iside][multiplet][gas_gap];
+
+       auto x_ontrack = Monitored::Collection("x_"+MM_Side[iside]+"_multiplet"+std::to_string(multiplet+1)+"_gas_gap_"+std::to_string(gas_gap+1)+"_ontrack", Vectors.x_ontrack);
+       auto y_ontrack = Monitored::Collection("y_"+MM_Side[iside]+"_multiplet"+std::to_string(multiplet+1)+"_gas_gap_"+std::to_string(gas_gap+1)+"_ontrack", Vectors.y_ontrack);
+      
+       fill(MM_sideGroup,x_ontrack,y_ontrack);
+     }          
+   }
+  }
+           
+  
+}
+                                                                                                             
+        
+                                                                                                           
+         
+          
+        
+
+                                                                                                                      
+                                                                                                             
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx
new file mode 100644
index 000000000000..7305096e21bc
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx
@@ -0,0 +1,179 @@
+/*                                                                                                        
+													
+													  
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration                                   
+ 
+*/
+///////////////////////////////////////////////////////////////////////////                                  
+//Utils for the main MMRawDataMonAlg.cxx                                                                    
+        
+//Part of MMRawDataMonAlg.h                                                                                 
+         
+//Authors                                                                                                   
+         
+//   see MMRawDataMonAlg.cxx                                                                                
+        
+///////////////////////////////////////////////////////////////////////////                                 
+         
+
+#include "MMRawDataMonitoring/MMRawDataMonAlg.h"
+#include <TError.h>
+#include <string>
+#include <TBox.h>
+#include <TList.h>
+#include <TLine.h>
+#include <TColor.h>
+#include <TString.h>
+#include <TRegexp.h>
+#include <stdexcept>
+
+int MMRawDataMonAlg::get_PCB_from_channel(int channel) const {
+
+  if (channel>0 && channel<=1024) return 1;
+  if (channel>1024 && channel<=2048) return 2;
+  if (channel>2048 && channel<=3072) return 3;
+  if (channel>3072 && channel<=4096) return 4;
+  if (channel>4096 && channel<=5120) return 5;
+
+  throw std::invalid_argument( "channel is not valid!" );
+}
+
+int MMRawDataMonAlg::get_sectorPhi_from_stationPhi_stName(int stationPhi,const std::string & stName) const {
+  
+  if (stationPhi==1 && stName=="MMS") return 1;
+  if (stationPhi==1 && stName=="MML") return 2;
+  if (stationPhi==2 && stName=="MMS") return 3;
+  if (stationPhi==2 && stName=="MML") return 4;
+  if (stationPhi==3 && stName=="MMS") return 5;
+  if (stationPhi==3 && stName=="MML") return 6;
+  if (stationPhi==4 && stName=="MMS") return 7;
+  if (stationPhi==4 && stName=="MML") return 8;
+  if (stationPhi==5 && stName=="MMS") return 9;
+  if (stationPhi==5 && stName=="MML") return 10;
+  if (stationPhi==6 && stName=="MMS") return 11;
+  if (stationPhi==6 && stName=="MML") return 12;
+  if (stationPhi==7 && stName=="MMS") return 13;
+  if (stationPhi==7 && stName=="MML") return 14;
+  if (stationPhi==8 && stName=="MMS") return 15;
+  if (stationPhi==8 && stName=="MML") return 16;
+
+  throw std::invalid_argument( "stationPhi and stName are not valid!" );
+
+}
+
+int MMRawDataMonAlg::get_sectorEta_from_stationEta(int stationEta) const {
+ 
+  //  1<-0  0-> 1
+  if (std::abs(stationEta==1)) return 0;                                                            
+  if (std::abs(stationEta==2)) return 1;
+
+  return -1;
+
+}
+
+int MMRawDataMonAlg::get_bin_for_occ_CSide_hist(int stationEta, int multiplet, int gas_gap) const {
+
+  static const int max_gas_gap = 4;
+  static const int max_multiplet = 2;
+
+  return (stationEta+2)*(max_gas_gap*max_multiplet)+(multiplet-1)*max_gas_gap +(gas_gap-1);
+
+}
+
+int MMRawDataMonAlg::get_bin_for_occ_ASide_hist(int stationEta, int multiplet, int gas_gap) const {
+
+  static const int max_gas_gap = 4;
+  static const int max_multiplet = 2;
+
+  return (stationEta-1)*(max_gas_gap*max_multiplet)+(multiplet-1)*max_gas_gap +(gas_gap-1);
+
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_CSide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
+
+  static const int max_pcb = 3;
+  static const int max_gas_gap = 4;
+  if (stationEta != -2) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
+
+}
+
+int MMRawDataMonAlg::get_bin_for_occ_CSide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
+
+  static const int max_pcb = 5;
+  static const int max_gas_gap = 4;
+  if (stationEta != -1) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
+
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_ASide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
+
+  static const int max_pcb = 3;
+  static const int max_gas_gap = 4;
+  if (stationEta != 2) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
+
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_ASide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
+
+  static const int max_pcb = 5;
+  static const int max_gas_gap = 4;
+  if (stationEta != 1) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_lb_CSide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
+
+  static const int max_pcb = 3;
+  static const int max_gas_gap = 4;
+  static const int max_isector = 2;
+  if (stationEta != -2) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb+ (PCB-1);
+
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_lb_CSide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
+
+  static const int max_pcb = 5;
+  static const int max_gas_gap = 4;
+  static const int max_isector = 2;
+  if (stationEta != -1) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
+
+}
+
+int MMRawDataMonAlg::get_bin_for_occ_lb_ASide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
+
+  static const int max_pcb = 5;
+  static const int max_gas_gap = 4;
+  static const int max_isector = 2;
+  if (stationEta != 1) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_lb_ASide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
+
+  static const int max_pcb = 3;
+  static const int max_gas_gap = 4;
+  static const int max_isector = 2;
+  if (stationEta != 2) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
+
+}
+
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/components/MMRawDataMonitoring_entries.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/components/MMRawDataMonitoring_entries.cxx
new file mode 100755
index 000000000000..cbf926754cdb
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/components/MMRawDataMonitoring_entries.cxx
@@ -0,0 +1,9 @@
+/*                                                                                                           
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration                                     
+*/
+//////////// MM ///////////////////////////////
+
+#include "MMRawDataMonitoring/MMRawDataMonAlg.h"
+
+DECLARE_COMPONENT( MMRawDataMonAlg )
+ 
-- 
GitLab


From 313c2ba7db913b8918dae21f54cc7652b6680ae0 Mon Sep 17 00:00:00 2001
From: Dan Guest <daniel.hay.guest@cern.ch>
Date: Thu, 17 Sep 2020 14:06:22 +0000
Subject: [PATCH 201/422] Cleanup b-tagging track info accessor

---
 .../FlavorTagDiscriminants/CMakeLists.txt     |  2 +-
 .../BTagMuonAugmenter.h                       |  4 +-
 ...TrackAugmenter.h => BTagTrackIpAccessor.h} | 14 +++---
 .../Root/BTagMuonAugmenter.cxx                |  6 +--
 ...kAugmenter.cxx => BTagTrackIpAccessor.cxx} | 47 ++++++++++---------
 .../FlavorTagDiscriminants/Root/DL2.cxx       | 16 +++----
 .../Root/customGetter.cxx                     | 10 ++--
 7 files changed, 49 insertions(+), 50 deletions(-)
 rename PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/{BTagTrackAugmenter.h => BTagTrackIpAccessor.h} (85%)
 rename PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/{BTagTrackAugmenter.cxx => BTagTrackIpAccessor.cxx} (69%)

diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt
index 15d5161eb53f..0cf8ec9ebb0c 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt
@@ -32,7 +32,7 @@ atlas_depends_on_subdirs(
 # Build a shared library:
 atlas_add_library( FlavorTagDiscriminants
   Root/BTagJetAugmenter.cxx
-  Root/BTagTrackAugmenter.cxx
+  Root/BTagTrackIpAccessor.cxx
   Root/BTagAugmenterTool.cxx
   Root/BTagMuonAugmenter.cxx
   Root/BTagMuonAugmenterTool.cxx
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagMuonAugmenter.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagMuonAugmenter.h
index 03f43afaffec..fe60ee7d8132 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagMuonAugmenter.h
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagMuonAugmenter.h
@@ -10,7 +10,7 @@
 #include "xAODMuon/MuonContainer.h"
 #include "xAODEventInfo/EventInfo.h"
 #include "FlavorTagDiscriminants/FlipTagEnums.h"
-#include "FlavorTagDiscriminants/BTagTrackAugmenter.h"
+#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h"
 
 namespace FlavorTagDiscriminants {
 
@@ -31,7 +31,7 @@ namespace FlavorTagDiscriminants {
     void augment(const xAOD::Jet& jet) const;
   private:
     // You'll probably have to add some accessors here
-    BTagTrackAugmenter m_btag_track_aug;
+    BTagTrackIpAccessor m_btag_track_aug;
     std::string m_muonAssociationName;
     float m_muonMinDR;
     float m_muonMinpT;
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackAugmenter.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackIpAccessor.h
similarity index 85%
rename from PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackAugmenter.h
rename to PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackIpAccessor.h
index 81d2812f122e..c60760faad90 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackAugmenter.h
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackIpAccessor.h
@@ -3,8 +3,8 @@
 */
 
 
-#ifndef BTAG_TRACK_AUGMENTER_HH
-#define BTAG_TRACK_AUGMENTER_HH
+#ifndef BTAG_TRACK_IP_ACCESSOR_HH
+#define BTAG_TRACK_IP_ACCESSOR_HH
 
 
 #include <vector>
@@ -26,9 +26,9 @@ struct BTagSignedIP {
   double ip3d_grade;
 };
 
-class BTagTrackAugmenter {
+class BTagTrackIpAccessor {
 public:
-  BTagTrackAugmenter(const std::string& prefix = "btagIp_" );
+  BTagTrackIpAccessor(const std::string& prefix = "btagIp_" );
   void augment(const xAOD::TrackParticle &track, const xAOD::Jet &jet);
 
   // NOTE: this should be called in the derivations if possible,
@@ -41,20 +41,18 @@ public:
   // imediately afterword: it is only valid for the jet it is
   // assigned to!
   //
-  // Better advice: don't use this at all, use get_signed_ip() instead
+  // Better advice: don't use this at all, use getSignedIp() instead
   void augment_with_ip(const xAOD::TrackParticle &track, const xAOD::Jet &jet);
   double d0(const xAOD::TrackParticle &track) const;
   double d0Uncertainty(const xAOD::TrackParticle &track) const;
   double z0SinTheta(const xAOD::TrackParticle &track) const;
   double z0SinThetaUncertainty(const xAOD::TrackParticle &track) const;
 
-  BTagSignedIP get_signed_ip(const xAOD::TrackParticle &track, const xAOD::Jet &jet) const;
+  BTagSignedIP getSignedIp(const xAOD::TrackParticle &track, const xAOD::Jet &jet) const;
   std::set<std::string> getTrackIpDataDependencyNames() const;
 private:
   typedef SG::AuxElement AE;
 
-  AE::ConstAccessor<float> m_ip_d0;
-  AE::ConstAccessor<float> m_ip_z0;
   AE::ConstAccessor<float> m_ip_d0_sigma;
   AE::ConstAccessor<float> m_ip_z0_sigma;
   AE::ConstAccessor<std::vector<float> > m_track_displacement;
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagMuonAugmenter.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagMuonAugmenter.cxx
index 8c52554153b8..cb56e99eedfb 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagMuonAugmenter.cxx
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagMuonAugmenter.cxx
@@ -5,7 +5,7 @@
 #include "xAODMuon/Muon.h"
 #include "xAODMuon/MuonContainer.h"
 #include "FlavorTagDiscriminants/BTagMuonAugmenter.h"
-#include "FlavorTagDiscriminants/BTagTrackAugmenter.h"
+#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h"
 
 namespace FlavorTagDiscriminants {
 
@@ -32,7 +32,7 @@ namespace FlavorTagDiscriminants {
   {
     // you probably have to initialize something here
     using namespace FlavorTagDiscriminants;
-    m_btag_track_aug = BTagTrackAugmenter();
+    m_btag_track_aug = BTagTrackIpAccessor();
     m_muonAssociationName = muonAssociationName;
     m_muonMinDR = muonMinDR;
     m_muonMinpT = muonMinpT;
@@ -130,7 +130,7 @@ namespace FlavorTagDiscriminants {
         muon_pTrel = myjet.Vect().Perp(mymu.Vect()); // VD: everything MUST be in MeV
 
         //Muon ID track IP information
-        muon_ip = m_btag_track_aug.get_signed_ip(*IDMuTrack, jet);
+        muon_ip = m_btag_track_aug.getSignedIp(*IDMuTrack, jet);
         muon_ip3d_d0 = muon_ip.ip3d_signed_d0;
         muon_ip3d_z0 = muon_ip.ip3d_signed_z0;
         muon_ip3d_d0_significance = muon_ip.ip3d_signed_d0_significance;
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackAugmenter.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackIpAccessor.cxx
similarity index 69%
rename from PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackAugmenter.cxx
rename to PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackIpAccessor.cxx
index 3035543edf0a..95a76bc481c1 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackAugmenter.cxx
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackIpAccessor.cxx
@@ -2,23 +2,19 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "FlavorTagDiscriminants/BTagTrackAugmenter.h"
+#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h"
 
 #include <cmath>
 #include <cstddef>
 
 namespace str {
-  const std::string d0 = "d0";
-  const std::string z0SinTheta = "z0SinTheta";
   const std::string d0Uncertainty = "d0Uncertainty";
   const std::string z0SinThetaUncertainty = "z0SinThetaUncertainty";
   const std::string trackDisplacement = "trackDisplacement";
   const std::string trackMomentum = "trackMomentum";
 }
 
-BTagTrackAugmenter::BTagTrackAugmenter(const std::string& prefix):
-  m_ip_d0(prefix + str::d0),
-  m_ip_z0(prefix + str::z0SinTheta),
+BTagTrackIpAccessor::BTagTrackIpAccessor(const std::string& prefix):
   m_ip_d0_sigma(prefix + str::d0Uncertainty),
   m_ip_z0_sigma(prefix + str::z0SinThetaUncertainty),
   m_track_displacement(prefix + str::trackDisplacement),
@@ -49,54 +45,61 @@ namespace {
   }
 }
 
-void BTagTrackAugmenter::augment(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
+void BTagTrackIpAccessor::augment(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
   augment_with_grades(track, jet);
   augment_with_ip(track, jet);
 }
 
-BTagSignedIP BTagTrackAugmenter::get_signed_ip(const xAOD::TrackParticle &track, const xAOD::Jet &jet) const {
+BTagSignedIP BTagTrackIpAccessor::getSignedIp(const xAOD::TrackParticle &track, const xAOD::Jet &jet) const {
   const TLorentzVector jet_fourVector = jet.p4();
   const Amg::Vector3D jet_threeVector(jet_fourVector.X(),jet_fourVector.Y(),jet_fourVector.Z());
   const Amg::Vector3D track_displacement = get_vector3d(m_track_displacement(track));
   const Amg::Vector3D track_momentum = get_vector3d(m_track_momentum(track));
 
   BTagSignedIP ip;
-  const double ip_d0 = m_ip_d0(track);
+  const double ip_d0 = d0(track);
   ip.ip2d_signed_d0 = std::copysign(ip_d0, std::sin(jet_threeVector.phi() - track_momentum.phi()) * ip_d0);
   const double ip3d_signed_d0 = std::copysign(ip_d0, jet_threeVector.cross(track_momentum).dot(track_momentum.cross(-track_displacement)));
   ip.ip3d_signed_d0 = ip3d_signed_d0;
   ip.ip3d_signed_d0_significance = ip3d_signed_d0 / m_ip_d0_sigma(track);
 
-  const double ip_z0 = m_ip_z0(track);
+  const double ip_z0 = z0SinTheta(track);
   const double signed_z0 = std::copysign(ip_z0, (jet_threeVector.eta() - track_momentum.eta()) * ip_z0);
   ip.ip3d_signed_z0 = signed_z0;
   ip.ip3d_signed_z0_significance = signed_z0 / m_ip_z0_sigma(track);
   return ip;
 }
 
-double BTagTrackAugmenter::d0(const xAOD::TrackParticle &track) const {
-  return m_ip_d0(track);
+double BTagTrackIpAccessor::d0(const xAOD::TrackParticle &track) const {
+  const Amg::Vector3D track_displacement = get_vector3d(m_track_displacement(track));
+  const Amg::Vector3D track_momentum = get_vector3d(m_track_momentum(track));
+  return std::copysign(
+    std::hypot(track_displacement[Amg::x], track_displacement[Amg::y]),
+    track_momentum.cross(track_displacement)[Amg::z]);
 }
-double BTagTrackAugmenter::d0Uncertainty(const xAOD::TrackParticle &track)
+double BTagTrackIpAccessor::d0Uncertainty(const xAOD::TrackParticle &track)
   const {
   return m_ip_d0_sigma(track);
 }
-double BTagTrackAugmenter::z0SinTheta(const xAOD::TrackParticle &track) const {
-  return m_ip_z0(track);
+double BTagTrackIpAccessor::z0SinTheta(const xAOD::TrackParticle &track) const {
+  const Amg::Vector3D track_displacement = get_vector3d(m_track_displacement(track));
+  const Amg::Vector3D track_momentum = get_vector3d(m_track_momentum(track));
+  return track_displacement[Amg::z] * std::sqrt(
+    1 - std::pow(track_momentum[Amg::z],2) / track_momentum.squaredNorm());
 }
-double BTagTrackAugmenter::z0SinThetaUncertainty(const xAOD::TrackParticle &track) const {
-  return m_ip_z0(track);
+double BTagTrackIpAccessor::z0SinThetaUncertainty(const xAOD::TrackParticle &track) const {
+  return m_ip_z0_sigma(track);
 }
 
-void BTagTrackAugmenter::augment_with_ip(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
-  BTagSignedIP ip = get_signed_ip(track, jet);
+void BTagTrackIpAccessor::augment_with_ip(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
+  BTagSignedIP ip = getSignedIp(track, jet);
   m_ip2d_signed_d0(track) = ip.ip2d_signed_d0;
   m_ip3d_signed_d0(track) = ip.ip3d_signed_d0;
   m_ip3d_signed_d0_significance(track) = ip.ip3d_signed_d0_significance;
   m_ip3d_signed_z0(track) = ip.ip3d_signed_z0;
   m_ip3d_signed_z0_significance(track) = ip.ip3d_signed_z0_significance;
 }
-void BTagTrackAugmenter::augment_with_grades(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
+void BTagTrackIpAccessor::augment_with_grades(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
   int ip3d_grade = -1;
   const xAOD::BTagging &btagging = *jet.btagging();
   const std::vector<ElementLink<xAOD::TrackParticleContainer> > ip3d_tracks = m_ip3d_trackParticleLinks(btagging);
@@ -119,11 +122,9 @@ void BTagTrackAugmenter::augment_with_grades(const xAOD::TrackParticle &track, c
   m_ip2d_grade(track) = ip2d_grade;
 }
 
-std::set<std::string> BTagTrackAugmenter::getTrackIpDataDependencyNames() const
+std::set<std::string> BTagTrackIpAccessor::getTrackIpDataDependencyNames() const
 {
   return {
-    m_prefix + str::d0,
-    m_prefix + str::z0SinTheta,
     m_prefix + str::d0Uncertainty,
     m_prefix + str::z0SinThetaUncertainty,
     m_prefix + str::trackDisplacement,
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2.cxx
index fe2da2cdbb21..c1ea9db0120b 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2.cxx
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2.cxx
@@ -3,7 +3,7 @@
 */
 
 #include "FlavorTagDiscriminants/DL2.h"
-#include "FlavorTagDiscriminants/BTagTrackAugmenter.h"
+#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h"
 #include "lwtnn/LightweightGraph.hh"
 #include "lwtnn/NanReplacer.hh"
 
@@ -255,7 +255,7 @@ namespace FlavorTagDiscriminants {
       TrackSortVar trackSortVar(SortOrder order) {
         typedef xAOD::TrackParticle Tp;
         typedef xAOD::Jet Jet;
-        BTagTrackAugmenter aug;
+        BTagTrackIpAccessor aug;
         switch(order) {
         case SortOrder::ABS_D0_SIGNIFICANCE_DESCENDING:
           return [aug](const Tp* tp, const Jet&) {
@@ -263,7 +263,7 @@ namespace FlavorTagDiscriminants {
                  };
         case SortOrder::D0_SIGNIFICANCE_DESCENDING:
           return [aug](const Tp* tp, const Jet& j) {
-                   return aug.get_signed_ip(*tp, j).ip3d_signed_d0_significance;
+                   return aug.getSignedIp(*tp, j).ip3d_signed_d0_significance;
                  };
         case SortOrder::PT_DESCENDING:
           return [](const Tp* tp, const Jet&) {return tp->pt();};
@@ -280,7 +280,7 @@ namespace FlavorTagDiscriminants {
 
         typedef xAOD::TrackParticle Tp;
         typedef SG::AuxElement AE;
-        BTagTrackAugmenter aug;
+        BTagTrackIpAccessor aug;
         auto data_deps = aug.getTrackIpDataDependencyNames();
 
         // make sure we record accessors as data dependencies
@@ -344,7 +344,7 @@ namespace FlavorTagDiscriminants {
           };
         case EDMType::CUSTOM_GETTER: return {
             customNamedSeqGetter(cfg.name),
-            BTagTrackAugmenter().getTrackIpDataDependencyNames()
+            BTagTrackIpAccessor().getTrackIpDataDependencyNames()
           };
         default: {
           throw std::logic_error("Unknown EDM type");
@@ -357,7 +357,7 @@ namespace FlavorTagDiscriminants {
       // start by defining the raw functions, there's a factory
       // function below to convert the configuration enums to a
       // std::function
-      Tracks negativeIpOnly(BTagTrackAugmenter& aug,
+      Tracks negativeIpOnly(BTagTrackIpAccessor& aug,
                             const Tracks& tracks,
                             const xAOD::Jet& j) {
         Tracks filtered;
@@ -365,7 +365,7 @@ namespace FlavorTagDiscriminants {
         // flipping
         for (auto ti = tracks.crbegin(); ti != tracks.crend(); ti++) {
           const xAOD::TrackParticle* tp = *ti;
-          double sip = aug.get_signed_ip(*tp, j).ip3d_signed_d0_significance;
+          double sip = aug.getSignedIp(*tp, j).ip3d_signed_d0_significance;
           if (sip < 0) filtered.push_back(tp);
         }
         return filtered;
@@ -376,7 +376,7 @@ namespace FlavorTagDiscriminants {
         FlipTagConfig cfg)
       {
         namespace ph = std::placeholders;  // for _1, _2, _3
-        BTagTrackAugmenter aug;
+        BTagTrackIpAccessor aug;
         switch(cfg) {
         case FlipTagConfig::NEGATIVE_IP_ONLY:
           // flips order and removes tracks with negative IP
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx
index 800a1d54da7e..c2267e096611 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 #include "FlavorTagDiscriminants/customGetter.h"
-#include "FlavorTagDiscriminants/BTagTrackAugmenter.h"
+#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h"
 
 namespace {
   // ______________________________________________________________________
@@ -31,7 +31,7 @@ namespace {
   class SignedD0SequenceGetter
   {
   private:
-    BTagTrackAugmenter m_augmenter;
+    BTagTrackIpAccessor m_augmenter;
   public:
     SignedD0SequenceGetter():
       m_augmenter()
@@ -42,7 +42,7 @@ namespace {
       std::vector<double> signed_d0;
       for (const auto* track: tracks) {
         signed_d0.push_back(
-          m_augmenter.get_signed_ip(*track, jet).ip3d_signed_d0_significance);
+          m_augmenter.getSignedIp(*track, jet).ip3d_signed_d0_significance);
       }
       return signed_d0;
     }
@@ -50,7 +50,7 @@ namespace {
   class SignedZ0SequenceGetter
   {
   private:
-    BTagTrackAugmenter m_augmenter;
+    BTagTrackIpAccessor m_augmenter;
   public:
     SignedZ0SequenceGetter():
       m_augmenter()
@@ -61,7 +61,7 @@ namespace {
       std::vector<double> signed_z0;
       for (const auto* track: tracks) {
         signed_z0.push_back(
-          m_augmenter.get_signed_ip(*track, jet).ip3d_signed_z0_significance);
+          m_augmenter.getSignedIp(*track, jet).ip3d_signed_z0_significance);
       }
       return signed_z0;
     }
-- 
GitLab


From 2e5db138cf8d60db6c397a5cf715f11252543108 Mon Sep 17 00:00:00 2001
From: Nicholas Styles <nicholas.styles@desy.de>
Date: Thu, 17 Sep 2020 16:23:52 +0200
Subject: [PATCH 202/422] Fix coordinate definition for ITkStrip sensitive
 detectord

---
 InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx
index 6a8ef0e94b1b..b6919875be1f 100644
--- a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx
+++ b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx
@@ -49,14 +49,13 @@ G4bool SctSensorGmxSD::ProcessHits(G4Step *aStep, G4TouchableHistory * /* not us
   G4ThreeVector localPosition2 = transformation.TransformPoint(coord2);
   HepGeom::Point3D<double> lP1, lP2;
 
-  // GeoModelXml sensors with depth along local z
-  lP1[SiHit::xEta] = localPosition1[0]*CLHEP::mm;
+  lP1[SiHit::xEta] = localPosition1[2]*CLHEP::mm;
   lP1[SiHit::xPhi] = localPosition1[1]*CLHEP::mm;
-  lP1[SiHit::xDep] = localPosition1[2]*CLHEP::mm;
+  lP1[SiHit::xDep] = localPosition1[0]*CLHEP::mm;
 
-  lP2[SiHit::xEta] = localPosition2[0]*CLHEP::mm;
+  lP2[SiHit::xEta] = localPosition2[2]*CLHEP::mm;
   lP2[SiHit::xPhi] = localPosition2[1]*CLHEP::mm;
-  lP2[SiHit::xDep] = localPosition2[2]*CLHEP::mm;
+  lP2[SiHit::xDep] = localPosition2[0]*CLHEP::mm;
 
   //
   //    Get the indexes of which detector the hit is in
-- 
GitLab


From ed8568877de8d89ebcfa556cabe435ac1266fb9e Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Thu, 17 Sep 2020 14:40:18 +0000
Subject: [PATCH 203/422] AFP Run 3 monitoring, adding automatic check

---
 .../AFP/Run3AFPMonitoring/CMakeLists.txt      |  14 +-
 .../Run3AFPMonitoring/AFPFastReco.h           | 181 ++++----
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  26 +-
 .../Run3AFPMonitoring/AFPToFAlgorithm.h       |  17 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py  |  62 +--
 .../AFP/Run3AFPMonitoring/src/AFPFastReco.cxx | 196 ++++-----
 .../src/AFPSiLayerAlgorithm.cxx               | 389 ++++++++++++++----
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx |  94 ++---
 8 files changed, 637 insertions(+), 342 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index 1d99ae5b68e4..5811b24dd26c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -1,5 +1,6 @@
 ################################################################################
 # Package: Run3AFPMonitoring
+# Author: N. Dikic 
 ################################################################################
 
 # Declare the package name:
@@ -12,9 +13,9 @@ atlas_depends_on_subdirs(
         Control/AthenaBaseComps
         Control/AthenaMonitoringKernel
         GaudiKernel
-	Event/xAOD/xAODForward
-	xAODForward/AFPSiHit
-	xAODForward/AFPToFHit	
+        Event/xAOD/xAODForward
+        xAODForward/AFPSiHit
+        xAODForward/AFPToFHit
         LumiBlock/LumiBlockComps
         LumiBlock/LumiBlockData
         Trigger/TrigEvent/TrigDecisionInterface
@@ -31,6 +32,10 @@ atlas_depends_on_subdirs(
         Trigger/TrigAnalysis/TrigDecisionTool
         Trigger/TrigAnalysis/TrigAnalysisInterfaces
         MuonSpectrometer/MuonAlignment/MuonAlignmentData
+        
+        Event/EventContainers
+        #Tools/PathResolver
+        #Control/StoreGate
 )
 
 # External dependencies:
@@ -50,7 +55,10 @@ atlas_add_component( Run3AFPMonitoring
         LumiBlockCompsLib
         LumiBlockData
         TrigDecisionToolLib
+        TrigAnalysisInterfaces
         xAODForward
+        xAODTrigger
+        #Trigger
         AthenaKernel
         SGAudCore
         AthenaPoolUtilities
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
index 38080060f69b..411b81998f88 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
@@ -11,118 +11,129 @@
 
 namespace AFPMon {
 
-  struct AFPCluster {
-    AFPCluster(float x_, float y_, float z_, int s, int l)
+struct AFPCluster 
+{
+	AFPCluster(float x_, float y_, float z_, int s, int l)
         : x {x_}, y {y_}, z {z_}, station {s}, layer {l} {}
 
-    float x;
-    float y;
-    float z;
-    int station;
-    int layer;
-  };
-
-  inline bool operator==(const AFPCluster& lhs, const AFPCluster& rhs) {
-    if (lhs.x != rhs.x) return false;
-    if (lhs.y != rhs.y) return false;
-    if (lhs.z != rhs.z) return false;
-    if (lhs.station != rhs.station) return false;
-    if (lhs.layer != rhs.layer) return false;
-
-    return true;
-  }
-
-  struct AFPTrack {
-    AFPTrack(float x_, float y_, int s, std::array<int, 4> a)
+	float x;
+	float y;
+	float z;
+	int station;
+	int layer;
+ };
+
+inline bool operator==(const AFPCluster& lhs, const AFPCluster& rhs) 
+{
+	if (lhs.x != rhs.x) return false;
+	if (lhs.y != rhs.y) return false;
+	if (lhs.z != rhs.z) return false;
+	if (lhs.station != rhs.station) return false;
+	if (lhs.layer != rhs.layer) return false;
+
+	return true;
+}
+
+struct AFPTrack 
+{
+	AFPTrack(float x_, float y_, int s, std::array<int, 4> a)
         : x {x_}, y {y_}, station {s}, layerClusters {std::move(a)} {}
 
-    float x;
-    float y;
-    int station;
-    std::array<int, 4> layerClusters;
-  };
+	float x;
+	float y;
+	int station;
+	std::array<int, 4> layerClusters;
+};
 
-  class AFPFastReco {
-  public:
-    /// Constructor. Sets input hit container
-    AFPFastReco(const xAOD::AFPSiHitContainer* hits) : m_hitContainer {hits} {}
+class AFPFastReco 
+{
+	public:
+	/// Constructor. Sets input hit container
+	AFPFastReco(const xAOD::AFPSiHitContainer* hits) : m_hitContainer {hits} {}
 
-    /// Performs fast reconstruction of clusters and tracks
-    void reco();
+	/// Performs fast reconstruction of clusters and tracks
+	void reco();
 
-    /// Returns vector of clusters
-    std::vector<AFPCluster> clusters() const { return m_clusters; }
+	/// Returns vector of clusters
+	std::vector<AFPCluster> clusters() const { return m_clusters; }
 
-    /// Returns vector of tracks
-    std::vector<AFPTrack> tracks() const { return m_tracks; }
+	/// Returns vector of tracks
+	std::vector<AFPTrack> tracks() const { return m_tracks; }
 
-  private:
-    /// Performs fast cluster reconstruction
-    void recoClusters();
+  	private:
+	/// Performs fast cluster reconstruction
+	void recoClusters();
 
-    /// Performs fast track reconstruction
-    void recoTracks();
+	/// Performs fast track reconstruction
+	void recoTracks();
 
-    /// Returns parameters of fitted line
-    std::pair<double, double> linReg(std::vector<std::pair<double, double>> YX) const;
+	/// Returns parameters of fitted line
+	std::pair<double, double> linReg(std::vector<std::pair<double, double>> YX) const;
 
-    /// Finds hits/clusters around given init element
-    template <class T>
-    std::vector<T> findAround(T init, std::list<T>& toJoin) const;
+	/// Finds hits/clusters around given init element
+	template <class T>
+	std::vector<T> findAround(T init, std::list<T>& toJoin) const;
 
-    /// Checks if given hits are neighbours
-    bool areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const;
+	/// Checks if given hits are neighbours
+	bool areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const;
 
-    /// Checks if given clusters are neighbours
-    bool areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const;
+	/// Checks if given clusters are neighbours
+	bool areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const;
 
-    /// Pointer to hit container
-    const xAOD::AFPSiHitContainer* m_hitContainer;
+	/// Pointer to hit container
+	const xAOD::AFPSiHitContainer* m_hitContainer;
 
-    /// Vector of clusters
-    std::vector<AFPCluster> m_clusters;
+	/// Vector of clusters
+	std::vector<AFPCluster> m_clusters;
 
-    /// Vector of tracks
-    std::vector<AFPTrack> m_tracks;
+	/// Vector of tracks
+	std::vector<AFPTrack> m_tracks;
 
-    /// Number of AFP stations
-    static constexpr int s_afpStations = 4;
+	/// Number of AFP stations
+	static constexpr int s_afpStations = 4;
 
-    /// Number of layers in each station
-    static constexpr int s_afpLayers = 4;
+	/// Number of layers in each station
+	static constexpr int s_afpLayers = 4;
 
-    /// Minimum number of clusters in track
-    static constexpr int s_trackSize = 3;
+	/// Minimum number of clusters in track
+	static constexpr int s_trackSize = 3;
 
-    /// Maximum distance between cluster
-    static constexpr float s_clusterDistance = 0.4;
-  };
+	/// Maximum distance between cluster
+	static constexpr float s_clusterDistance = 0.4;
+ };
 
-  template <class T>
-  std::vector<T> AFPFastReco::findAround(T init, std::list<T>& toJoin) const {
-    std::vector<T> element;
-    element.push_back(init);
+template <class T> std::vector<T> AFPFastReco::findAround(T init, std::list<T>& toJoin) const 
+{
+	std::vector<T> element;
+	element.push_back(init);
 
-    std::vector<T> newNeighbours;
-    do {
-      newNeighbours.clear();
-      for (auto& b : toJoin) {
-        bool isNew = false;
-        for (auto& a : element)
-          if (areNeighbours(a, b)) isNew = true;
+	std::vector<T> newNeighbours;
+	do 
+	{
+		newNeighbours.clear();
+		for (auto& b : toJoin) 
+		{
+			bool isNew = false;
+			for (auto& a : element)
+			if (areNeighbours(a, b)) 
+			{
+				isNew = true;
+				break;
+ 			}
 
-        if (isNew) {
-          newNeighbours.push_back(b);
-          element.push_back(b);
-        }
-      }
+			if (isNew) 
+			{
+				newNeighbours.push_back(b);
+				element.push_back(b);
+			}
+		}
 
-      for (auto& t : newNeighbours)
-        toJoin.remove(t);
+		for (auto& t : newNeighbours)
+			toJoin.remove(t);
 
-    } while (newNeighbours.size() > 0);
+	} while (newNeighbours.size() > 0);
 
-    return element;
+	return element;
   }
 
 }  // namespace AFPMon
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 463d7bbf1b5b..8b4146f20b30 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -10,24 +10,32 @@
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPSiHitContainer.h"
 #include "xAODForward/AFPSiHit.h"
+#include "LumiBlockData/BunchCrossingCondData.h"
+#include <Run3AFPMonitoring/AFPFastReco.h>
 
 #include "TRandom3.h"
 
+class BunchCrossingCondData;
+
 class AFPSiLayerAlgorithm : public AthMonitorAlgorithm {
 public:
-    AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
-    virtual ~AFPSiLayerAlgorithm();
-    virtual StatusCode initialize() override;
-    virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+	AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
+	virtual ~AFPSiLayerAlgorithm();
+	virtual StatusCode initialize() override;
+	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 
 private:
-    std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
-    std::map<std::string,int> m_TrackGroup; 
-    SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
+	std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
+	std::map<std::string,int> m_TrackGroup; 
+	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
+	SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
+	
+	void fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const;
+	void fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbPlane, std::vector<std::vector<std::vector<unsigned int>>> &clusterCounterPlane, unsigned int &counterForEventsPlane, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const;
 
 protected:
-    std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
-    std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
+	std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
+	std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
 
 };
 #endif
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
index fea6a733f502..0f19a5f3d1b1 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -15,19 +15,20 @@
 
 class AFPToFAlgorithm : public AthMonitorAlgorithm {
 public:
-    AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
-    virtual ~AFPToFAlgorithm();
-    virtual StatusCode initialize() override;
-    virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+	AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
+	virtual ~AFPToFAlgorithm();
+	virtual StatusCode initialize() override;
+	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 
 private:
-   std::map<std::string,int> m_HitmapGroupsToF;
+	std::map<std::string,int> m_HitmapGroupsToF;
    
-   SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
+	SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
 
 protected:
-   // Only 0 and 3 are ToF stations (farAside and farCside)
-   std::vector<std::string> m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" };
+	// Only 0 and 3 are ToF stations (farAside and farCside)
+	std::vector<std::string> m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" };
+
    
 };
 #endif
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 99fc57844329..f58861dd66de 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -3,15 +3,18 @@
 #
 
 '''@file Run3AFPExampleMonitorAlgorithm.py
-@author C. D. Burton
-@author P. Onyisi
-@date 2018-01-11
-@brief Example python configuration for the Run III AthenaMonitoring package
+@author N. Dikic
+@date 2020-08-12
 '''
 
 def Run3AFPExampleMonitoringConfig(inputFlags):
     '''Function to configures some algorithms in the monitoring system.'''
 
+    from LumiBlockComps.BunchCrossingCondAlgDefault import BunchCrossingCondAlgDefault
+    BunchCrossingCondAlgDefault()
+
+
+    
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
     
@@ -30,32 +33,41 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
     AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
-    AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/',xbins=1000,xmin=-0.5,xmax=999.5 ) 
-    AFPToFGroup.defineHistogram('lb,nTofHits', title='Luminosity Block;lb;total number of Hits', type='TProfile',  path='ToF/',xbins=1000,xmin=-0.5,xmax=999.5) 
-
-    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
-    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
+    AFPSiGroup.defineHistogram('lb,nSiHits', title='Total number of hits;lb;total number of Hits', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
+    AFPSiGroup.defineHistogram('lb,muPerBCID', title='<mu>;lumiBlock;<mu>', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
+    #AFPSiGroup.defineHistogram('layerNumber,layerEfficiency', title='LayerEfficiency;layerNumber', path='SiT/', xbins = 16, xmin=0.5, xmax=16.5, ybins=100, ymin=0, ymax=1)
+    #AFPSiGroup.defineHistogram('layerEfficiency', type='TH1F', title='1D layer efficiency;layerEfficiency', path='SiT/', xbins=16, xmin=0.5, xmax=16.5)
 
+    AFPToFGroup.defineHistogram('lb,nTofHits', title='Multiplicity;lb;total number of Hits', type='TProfile', path='ToF/', xbins=1000, xmin=-0.5, xmax=999.5) 
+    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
+    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
 
     # Using a map of groups
     layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
     combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
 
     array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
-    array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-    array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
-    array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1};pixelColIDChip;pixelRowIDChip', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-    array.defineHistogram('timeOverThreshold', type='TH1F', title='1D Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
-    array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-
 
-    array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/Track/')
-    array.defineHistogram('trackX,trackY', title='Track posistion position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    array.defineHistogram('pixelColIDChip', title='Hits per column for {0} layer {1};pixelColIDChip; entries', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
+    array.defineHistogram('pixelRowIDChip', title='Hits per row for {0} Layer {1};pixelRowIDChip; entries', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
+    array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for {0} Layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
+    array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for {0} Layer {1};timeOverThreshold; entries', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
+    array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};x [mm];y [mm]', type='TH2F', path='Cluster', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
+    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
 
 
+    array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
+    array.defineHistogram('trackY,trackX', title='Track in AFP station {0};x [mm];y [mm]', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
+    array.defineHistogram('lb,clustersPerStation', title ='Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationFront', title ='(Front) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationEnd', title ='(End) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationMiddle', title ='(Middle) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
 
     arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
-    arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
+    arrayOneList.defineHistogram('barInTrainID,trainID', title='ToF hit bar vs train {0};barInTrainID;trainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
 
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
@@ -73,13 +85,10 @@ if __name__=='__main__':
 
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    nightly = ''
-    file ='/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' 
 
-    
-    ConfigFlags.Input.Files = [nightly+file]
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000001.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput54-test.root'
     
     ConfigFlags.lock()
 
@@ -88,10 +97,13 @@ if __name__=='__main__':
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
     cfg = MainServicesCfg(ConfigFlags)
     cfg.merge(PoolReadCfg(ConfigFlags))
-
+    
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
+    
+    from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
+    cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
-    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
+    cfg.run(50000)
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
index 217c1dc607fb..9234e1c3a024 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
@@ -11,124 +11,136 @@
 
 namespace AFPMon {
 
-  void AFPFastReco::reco() {
-    recoClusters();
-    recoTracks();
-  }
-
-  void AFPFastReco::recoClusters() {
-    constexpr float dx   = 0.25;  // [mm]
+void AFPFastReco::reco() 
+{
+	recoClusters();
+	recoTracks();
+}
+
+void AFPFastReco::recoClusters() 
+{
+	constexpr float dx   = 0.25;  // [mm]
     constexpr float dy   = 0.05;  // [mm]
     constexpr float dz   = 9.00;  // [mm]
     constexpr float tilt = 14. / 180. * 3.14159;
 
     std::list toCluster(m_hitContainer->begin(), m_hitContainer->end());
 
-    while (toCluster.size() > 0) {
-      auto init = *(toCluster.begin());
-      toCluster.pop_front();
-      auto clusteredHits = findAround(init, toCluster);
-
-      float sumX      = 0;
-      float sumY      = 0;
-      float sumCharge = 0;
-      for (const xAOD::AFPSiHit* h : clusteredHits) {
-        const float charge = h->depositedCharge();
-        const float pixX   = dx * h->pixelColIDChip();
-        const float pixY   = dy * h->pixelRowIDChip();
-        sumX += charge * pixX;
-        sumY += charge * pixY;
-        sumCharge += charge;
-      }
-
-      const float xPlane = sumX / sumCharge;
-      const float yPlane = sumY / sumCharge;
-
-      const int stationID = init->stationID();
-      const int layerID   = init->pixelLayerID();
-
-      const float x = xPlane;
-      const float y = yPlane * cos(tilt);
-      const float z = yPlane * sin(tilt) + dz * layerID;
-
-      m_clusters.emplace_back(x, y, z, stationID, layerID);
+    while (toCluster.size() > 0) 
+	{
+		auto init = *(toCluster.begin());
+		toCluster.pop_front();
+		auto clusteredHits = findAround(init, toCluster);
+
+		float sumX      = 0;
+		float sumY      = 0;
+		float sumCharge = 0;
+		for (const xAOD::AFPSiHit* h : clusteredHits) 
+		{
+        	const float charge = h->depositedCharge();
+			const float pixX   = dx * h->pixelColIDChip();
+			const float pixY   = dy * h->pixelRowIDChip();
+			sumX += charge * pixX;
+			sumY += charge * pixY;
+			sumCharge += charge;
+		}
+
+		const float xPlane = sumX / sumCharge;
+		const float yPlane = sumY / sumCharge;
+
+		const int stationID = init->stationID();
+		const int layerID   = init->pixelLayerID();
+
+		const float x = xPlane;
+		const float y = yPlane * cos(tilt);
+		const float z = yPlane * sin(tilt) + dz * layerID;
+
+		m_clusters.emplace_back(x, y, z, stationID, layerID);
     }
-  }
+}
 
-  void AFPFastReco::recoTracks() {
-    std::list toTrack(m_clusters.begin(), m_clusters.end());
+void AFPFastReco::recoTracks() 
+{
+	std::list toTrack(m_clusters.begin(), m_clusters.end());
 
-    while (toTrack.size() > 0) {
-      auto init = *(toTrack.begin());
-      toTrack.pop_front();
-      auto trackCandidate = findAround(init, toTrack);
+	while (toTrack.size() > 0) 
+	{
+		auto init = *(toTrack.begin());
+		toTrack.pop_front();
+		auto trackCandidate = findAround(init, toTrack);
 
-      if (trackCandidate.size() < s_trackSize) continue;
+		if (trackCandidate.size() < s_trackSize) continue;
 
-      std::array<int, 4> clusters {};
+		std::array<int, 4> clusters {};
 
-      std::vector<std::pair<double, double>> XZ;
-      std::vector<std::pair<double, double>> YZ;
+		std::vector<std::pair<double, double>> XZ;
+		std::vector<std::pair<double, double>> YZ;
 
-      for (const auto& cluster : trackCandidate) {
-        clusters[cluster.layer]++;
+		for (const auto& cluster : trackCandidate) 
+		{
+			clusters[cluster.layer]++;
 
-        XZ.emplace_back(cluster.x, cluster.z);
-        YZ.emplace_back(cluster.y, cluster.z);
-      }
+			XZ.emplace_back(cluster.x, cluster.z);
+			YZ.emplace_back(cluster.y, cluster.z);
+		}
 
-      const auto [x, xSlope] = linReg(XZ);
-      const auto [y, ySlope] = linReg(YZ);
-      const int station      = trackCandidate[0].station;
+		const auto [x, xSlope] = linReg(XZ);
+		const auto [y, ySlope] = linReg(YZ);
+		const int station      = trackCandidate[0].station;
 
-      m_tracks.emplace_back(x, y, station, clusters);
+		m_tracks.emplace_back(x, y, station, clusters);
     }
-  }
+}
 
-  std::pair<double, double> AFPFastReco::linReg(std::vector<std::pair<double, double>> YX) const {
+std::pair<double, double> AFPFastReco::linReg(std::vector<std::pair<double, double>> YX) const 
+{
     double meanx = 0;
     double meany = 0;
-    for (const auto& yx : YX) {
-      meany += yx.first;
-      meanx += yx.second;
+    for (const auto& yx : YX) 
+	{
+		meany += yx.first;
+		meanx += yx.second;
     }
 
-    meanx /= YX.size();
+	meanx /= YX.size();
     meany /= YX.size();
 
     double numerator   = 0;
     double denumerator = 0;
-    for (const auto& yx : YX) {
-      const double dy = yx.first - meany;
-      const double dx = yx.second - meanx;
-      numerator += dx * dy;
-      denumerator += dx * dx;
-    }
-
-    const double slope    = numerator / denumerator;
-    const double position = meany - slope * meanx;
-
-    return {position, slope};
-  }
-
-  bool AFPFastReco::areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const {
-    if (lhs->stationID() != rhs->stationID()) return false;
-    if (lhs->pixelLayerID() != rhs->pixelLayerID()) return false;
-    if (lhs->pixelColIDChip() != rhs->pixelColIDChip()) return false;
-    if (abs(lhs->pixelRowIDChip() - rhs->pixelRowIDChip()) != 1) return false;
-
-    return true;
-  }
-
-  bool AFPFastReco::areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const {
-    if (lhs.station != rhs.station) return false;
-
-    const float dx = lhs.x - rhs.x;
-    const float dy = lhs.y - rhs.y;
-    if (dx * dx + dy * dy > s_clusterDistance) return false;
-
-    return true;
-  }
+    for (const auto& yx : YX) 
+	{
+		const double dy = yx.first - meany;
+		const double dx = yx.second - meanx;
+		numerator += dx * dy;
+		denumerator += dx * dx;
+	}
+
+	const double slope    = numerator / denumerator;
+	const double position = meany - slope * meanx;
+
+	return {position, slope};
+}
+
+bool AFPFastReco::areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const 
+{
+	if (lhs->stationID() != rhs->stationID()) return false;
+	if (lhs->pixelLayerID() != rhs->pixelLayerID()) return false;
+	if (lhs->pixelColIDChip() != rhs->pixelColIDChip()) return false;
+	if (abs(lhs->pixelRowIDChip() - rhs->pixelRowIDChip()) != 1) return false;
+
+	return true;
+}
+
+bool AFPFastReco::areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const 
+{
+	if (lhs.station != rhs.station) return false;
+
+	const float dx = lhs.x - rhs.x;
+	const float dy = lhs.y - rhs.y;
+	if (dx * dx + dy * dy > s_clusterDistance) return false;
+
+	return true;
+}
 
 }  // namespace AFPMon
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 280dd3b541b1..bc42635bc766 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -10,16 +10,56 @@
 #include "Run3AFPMonitoring/AFPSiLayerAlgorithm.h"
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPStationID.h"
+#include "EventInfo/EventID.h"
 
-#include <Run3AFPMonitoring/AFPFastReco.h>
 
+#include <vector>
+
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounter (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounterFront (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounterEnd (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounterMiddle (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
+
+	std::vector<std::vector<unsigned int>> clusterCounterStation(1000, std::vector<unsigned int>(4));
+	std::vector<std::vector<unsigned int>> clusterCounterStationFront(1000, std::vector<unsigned int>(4));
+	std::vector<std::vector<unsigned int>> clusterCounterStationEnd(1000, std::vector<unsigned int>(4));
+	std::vector<std::vector<unsigned int>> clusterCounterStationMiddle(1000, std::vector<unsigned int>(4));
+
+	int previouslb = 0;
+	int previouslbFront = 0;
+	int previouslbEnd = 0;
+	int previouslbMiddle = 0;
+	
+	int previouslbStation = 0;
+	int previouslbStationFront = 0;
+	int previouslbStationEnd = 0;
+	int previouslbStationMiddle = 0;
+
+	unsigned int counterForEvents = 0;
+	unsigned int counterForEventsFront = 0;
+	unsigned int counterForEventsEnd = 0;
+	unsigned int counterForEventsMiddle = 0;
+	
+	unsigned int counterForEventsStation = 0;
+	unsigned int counterForEventsStationFront = 0;
+	unsigned int counterForEventsStationEnd = 0;
+	unsigned int counterForEventsStationMiddle = 0;
+	
+	std::vector<int> frontBCIDsVector;
+	std::vector<int> middleBCIDsVector;
+	std::vector<int> endBCIDsVector;
+	
+	bool isInListVector(const int bcid, const std::vector<int>&arr)
+	{
+		return std::find_if(arr.begin(),arr.end(),[&bcid](const int& ele){return ele==bcid;})!= arr.end();
+	}
+	
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
 , m_afpHitContainerKey("AFPSiHitContainer")
-
 {
-    declareProperty( "AFPSiHitContainer", m_afpHitContainerKey );
+	declareProperty("AFPSiHitContainer", m_afpHitContainerKey);
 }
 
 
@@ -27,80 +67,283 @@ AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
 
 
 StatusCode AFPSiLayerAlgorithm::initialize() {
-    using namespace Monitored;
- 
-    m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
-    m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
-    // We must declare to the framework in initialize what SG objects we are going to use:
-    SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
-    ATH_CHECK(m_afpHitContainerKey.initialize());
-
-    return AthMonitorAlgorithm::initialize();
-}
 
+	using namespace Monitored;
+
+	m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
+	m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
+
+
+	// We must declare to the framework in initialize what SG objects we are going to use:
+	SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
+	ATH_CHECK(m_afpHitContainerKey.initialize());
+	
+	ATH_MSG_INFO( "BunchCrossingKey initialization" );
+	ATH_CHECK(m_bunchCrossingKey.initialize());
+	ATH_MSG_INFO( "initialization completed" );
+	return AthMonitorAlgorithm::initialize();
+}
 
 StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
-    using namespace Monitored;
-
-    // Declare the quantities which should be monitored:
-    auto lb = Monitored::Scalar<int>("lb", 0); 
-    auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
-    auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
-    auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
-    auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold", 0.0);
-    auto clusterX = Monitored::Scalar<float>("clusterX", 0.0);
-    auto clusterY = Monitored::Scalar<float>("clusterY", 0.0); 
-    auto trackX = Monitored::Scalar<float>("trackX", 0.0);
-    auto trackY = Monitored::Scalar<float>("trackY", 0.0);
-    
-    lb = GetEventInfo(ctx)->lumiBlock();
- 
-    SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
-    if(! afpHitContainer.isValid())
-    {
-	ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpHitContainerKey);
+	using namespace Monitored;
+
+	// BCX handler
+	unsigned int temp = GetEventInfo(ctx)->bcid();
+	SG::ReadCondHandle<BunchCrossingCondData> bcidHdl(m_bunchCrossingKey,ctx);
+	if (!bcidHdl.isValid()) {
+		ATH_MSG_ERROR( "Unable to retrieve BunchCrossing conditions object" );
+	}
+	const BunchCrossingCondData* bcData{*bcidHdl};
+
+	// Classifying bunches by position in train (Front, Middle, End)
+	if(bcData->isFilled(temp))
+	{
+		if(!bcData->isFilled(temp-1))
+		{
+			frontBCIDsVector.push_back(temp);
+			++counterForEventsFront;
+			++counterForEventsStationFront;
+		}
+		else
+		{
+			if(bcData->isFilled(temp+1))
+			{
+				middleBCIDsVector.push_back(temp);
+				++counterForEventsMiddle;
+				++counterForEventsStationMiddle;
+			}
+			else
+			{
+				endBCIDsVector.push_back(temp);
+				++counterForEventsEnd;
+				++counterForEventsStationEnd;
+			}
+		}
+	}
+	
+	// Declare the quantities which should be monitored:
+	auto lb = Monitored::Scalar<int>("lb", 0);
+	auto muPerBCID = Monitored::Scalar<float>("muPerBCID", 0.0);
+	auto run = Monitored::Scalar<int>("run",0);
+	auto weight = Monitored::Scalar<float>("weight", 1.0);
+
+	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
+
+	auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
+	auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
+
+	auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold", 0.0);
+
+	auto clusterX = Monitored::Scalar<float>("clusterX", 0.0);
+	auto clusterY = Monitored::Scalar<float>("clusterY", 0.0); 
+
+	auto trackX = Monitored::Scalar<float>("trackX", 0.0);
+	auto trackY = Monitored::Scalar<float>("trackY", 0.0);
+
+	auto layerEfficiency = Monitored::Scalar<float>("layerEfficiency", 0.0);
+	auto layerNumber = Monitored::Scalar<int>("layerNumber", 0);
+	
+	
+	lb = GetEventInfo(ctx)->lumiBlock();
+	muPerBCID = lbAverageInteractionsPerCrossing(ctx);
+	//run = GetEventInfo(ctx)->runNumber();
+	fill("AFPSiLayerTool", lb, muPerBCID);
+	
+
+	++counterForEvents;
+	++counterForEventsStation;
+	
+	SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
+	if(! afpHitContainer.isValid())
+	{
+		ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpHitContainerKey);
+		return StatusCode::SUCCESS;
+	}
+
+	ATH_CHECK( afpHitContainer.initialize() );
+
+	nSiHits = afpHitContainer->size();
+	fill("AFPSiLayerTool", lb, nSiHits);
+
+
+	for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
+	{
+		lb = GetEventInfo(ctx)->lumiBlock();
+		pixelRowIDChip = hitsItr->pixelRowIDChip();
+		pixelColIDChip = hitsItr->pixelColIDChip();
+		timeOverThreshold = hitsItr->timeOverThreshold();
+		
+		if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
+		{
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
+			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
+			
+		}
+		else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
+	}
+	
+	// Filling of cluster and track 2D histograms
+	AFPMon::AFPFastReco fast(afpHitContainer.get());
+	fast.reco();
+
+	// Track histograms:
+	for (const auto& track : fast.tracks()) 
+	{
+		trackX = track.x;
+		trackY = track.y;
+		fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackY, trackX);
+	}
+
+	// Cluster histograms 
+	for(const auto& cluster : fast.clusters()) 
+	{
+		clusterX = cluster.x;
+		clusterY = cluster.y;
+		fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX);
+	}
+	
+	// Synch histograms:
+	lb = GetEventInfo(ctx)->lumiBlock();
+	
+	fillSynchHistogramsStation(lb, previouslbStation, clusterCounterStation, counterForEventsStation, muPerBCID, 'S', fast);
+	fillSynchHistogramsPlane(lb, previouslb, clusterCounter, counterForEvents, muPerBCID, 'P', fast);
+	
+	if (isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
+	{
+		fillSynchHistogramsStation(lb, previouslbStationFront, clusterCounterStationFront, counterForEventsStationFront, muPerBCID, 'F', fast);
+		fillSynchHistogramsPlane(lb, previouslbFront, clusterCounterFront, counterForEventsFront, muPerBCID, 'F', fast);
+	}
+	else if (isInListVector(GetEventInfo(ctx)->bcid(), middleBCIDsVector))
+	{
+		fillSynchHistogramsStation(lb, previouslbStationMiddle, clusterCounterStationMiddle, counterForEventsStationMiddle, muPerBCID, 'M', fast);
+		fillSynchHistogramsPlane(lb, previouslbMiddle, clusterCounterMiddle, counterForEventsMiddle, muPerBCID, 'M', fast);
+	}
+	else if (isInListVector(GetEventInfo(ctx)->bcid(), endBCIDsVector))
+	{
+		fillSynchHistogramsStation(lb, previouslbStationEnd, clusterCounterStationEnd, counterForEventsStationEnd, muPerBCID, 'E', fast);
+		fillSynchHistogramsPlane(lb, previouslbEnd, clusterCounterEnd, counterForEventsEnd, muPerBCID, 'E', fast);
+	}
+
 	return StatusCode::SUCCESS;
-    }
-
-    ATH_CHECK( afpHitContainer.initialize() );
-
-    nSiHits = afpHitContainer->size();
-    fill("AFPSiLayerTool", lb, nSiHits);    
-
-    for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
-    {
-      pixelRowIDChip = hitsItr->pixelRowIDChip();
-      pixelColIDChip = hitsItr->pixelColIDChip();
-      timeOverThreshold = hitsItr->timeOverThreshold();
-	
-      if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
-      {
-        fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
-	
-      }
-	else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
-      }
-
-    AFPMon::AFPFastReco fast(afpHitContainer.get());
-    fast.reco();
-
-    for (const auto& cluster : fast.clusters()) {
-      clusterX = cluster.x;
-      clusterY = cluster.y;
-      fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterX, clusterY);
-    }
-
-    for (const auto& track : fast.tracks()) {
-      trackX = track.x;
-      trackY = track.y;
-      fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackX, trackY);
-    }
- 
-
-    return StatusCode::SUCCESS;
+} // end of fillHistograms
+
+void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const
+{
+	float clustersPerStationFloat = 0;
+	for(const auto& cluster : fast.clusters()) 
+	{
+		if(lb > previouslbStationA && previouslbStationA != 0)
+		{
+			for(int i = 0; i < 4; i++)
+			{
+				clustersPerStationFloat = clusterCounterStationA[previouslbStationA][i];
+				if(muPerBCID != 0 && clustersPerStationFloat!=0)
+				{
+					clustersPerStationFloat = clustersPerStationFloat/(muPerBCID*counterForEventsStationA*4);
+				}
+				else{clustersPerStationFloat = -0.1;}
+	
+				if(histogramType == 'S')
+				{
+					auto clustersPerStation = Monitored::Scalar<float>("clustersPerStation", 0.0);
+					clustersPerStation = clustersPerStationFloat;
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
+				}
+				else if (histogramType == 'F')
+				{
+					auto clustersPerStationFront = Monitored::Scalar<float>("clustersPerStationFront", 0.0);
+					clustersPerStationFront = clustersPerStationFloat;
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationFront);
+				}
+				else if (histogramType == 'M')
+				{
+					auto clustersPerStationMiddle = Monitored::Scalar<float>("clustersPerStationMiddle", 0.0);
+					clustersPerStationMiddle = clustersPerStationFloat;
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationMiddle);
+				}
+				else if (histogramType == 'E')
+				{
+					auto clustersPerStationEnd = Monitored::Scalar<float>("clustersPerStationEnd", 0.0);
+					clustersPerStationEnd = clustersPerStationFloat;
+					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationEnd);
+				}
+			}
+			previouslbStationA=lb;
+			++clusterCounterStationA[lb][cluster.station];
+			counterForEventsStationA=1;
+		}
+		else if (clusterCounterStationA[lb][cluster.station] == 0)
+		{
+			++clusterCounterStationA[lb][cluster.station];
+			previouslbStationA = lb;
+		}
+		else if (lb==previouslbStationA)
+		{++clusterCounterStationA[lb][cluster.station];}
+	}
 }
 
+void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbPlane, std::vector<std::vector<std::vector<unsigned int>>> &clusterCounterPlane, unsigned int &counterForEventsPlane, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const
+{
+	float clustersPerPlaneFloat = 0;
+	for(const auto& cluster : fast.clusters()) 
+	{
+		if(lb > previouslbPlane && previouslbPlane != 0)
+		{
+			for(int i=0; i<4; i++)
+			{
+				for(int j=0; j<4; j++)
+				{
+					clustersPerPlaneFloat = clusterCounterPlane[previouslbPlane][i][j];
+					if(muPerBCID != 0 && clustersPerPlaneFloat != 0)
+					{
+						clustersPerPlaneFloat = clustersPerPlaneFloat/(muPerBCID*counterForEventsPlane);
+					}
+					else
+					{
+						clustersPerPlaneFloat = -0.1;
+					}
+				
+					if(histogramType == 'P')
+					{
+						auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 0.0);
+						clustersPerPlane = clustersPerPlaneFloat;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
+					}
+					else if(histogramType == 'F')
+					{
+						auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
+						clustersPerPlaneFront = clustersPerPlaneFloat;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
+					}
+					else if(histogramType == 'M')
+					{
+						auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
+						clustersPerPlaneMiddle = clustersPerPlaneFloat;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
+					}
+					else if(histogramType == 'E')
+					{
+						auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
+						clustersPerPlaneEnd = clustersPerPlaneFloat;
+						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
+					}
+				}
+			}
+			previouslbPlane = lb;
+			++clusterCounterPlane[lb][cluster.station][cluster.layer];
+			counterForEventsPlane=1;
+		}
+		// First time in lumiblock (in plane)
+		else if(clusterCounterPlane[lb][cluster.station][cluster.layer] == 0) 
+		{
+			++clusterCounterPlane[lb][cluster.station][cluster.layer];
+			previouslbPlane = lb;
+		}	
+		// Lumiblock is same, so proceed
+		else if(lb==previouslbPlane)	// Same lumiblock
+		{++clusterCounterPlane[lb][cluster.station][cluster.layer];}
+	}
+}
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index 9d8fb4668222..cde7c1fcce37 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -17,7 +17,7 @@ AFPToFAlgorithm::AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLoca
 , m_afpToFHitContainerKey("AFPToFHitContainer")
 
 {
-    declareProperty( "AFPToFHitContainer", m_afpToFHitContainerKey );
+	declareProperty( "AFPToFHitContainer", m_afpToFHitContainerKey );
 }
 
 
@@ -25,65 +25,65 @@ AFPToFAlgorithm::~AFPToFAlgorithm() {}
 
 
 StatusCode AFPToFAlgorithm::initialize() {
-    using namespace Monitored;
+	using namespace Monitored;
 
-    m_HitmapGroupsToF = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
+	m_HitmapGroupsToF = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
 
-    // We must declare to the framework in initialize what SG objects we are going to use
-    SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
-    ATH_CHECK(m_afpToFHitContainerKey.initialize());
-    
-    return AthMonitorAlgorithm::initialize();
+	// We must declare to the framework in initialize what SG objects we are going to use
+	SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
+	ATH_CHECK(m_afpToFHitContainerKey.initialize());
+
+	return AthMonitorAlgorithm::initialize();
 }
 
 
 StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
-    using namespace Monitored;
-
-    // Declare the quantities which should be monitored
-    auto lb = Monitored::Scalar<int>("lb", 0);
-    auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
-    auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
-    auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
-    auto trainID = Monitored::Scalar<int>("trainID", 0); 
-    auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
+	using namespace Monitored;
+
+	// Declare the quantities which should be monitored
+	auto lb = Monitored::Scalar<int>("lb", 0);
+	auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
+	auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
+	auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
+	auto trainID = Monitored::Scalar<int>("trainID", 0); 
+	auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
     
-    lb = GetEventInfo(ctx)->lumiBlock();
+	lb = GetEventInfo(ctx)->lumiBlock();
  
-    SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
-    if(! afpToFHitContainer.isValid())
-    {
-	ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
-	return StatusCode::SUCCESS;
-    }
-
-    ATH_CHECK( afpToFHitContainer.initialize() );
-
-    nTofHits = afpToFHitContainer->size();
-    fill("AFPToFTool", lb, nTofHits);
+	SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
+	if(! afpToFHitContainer.isValid())
+	{
+		ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
+		return StatusCode::SUCCESS;
+	}
 
+	ATH_CHECK( afpToFHitContainer.initialize() );
 
-    for(const xAOD::AFPToFHit *hitsItr: *afpToFHitContainer)
-    {
-	trainID = hitsItr->trainID();
-        barInTrainID = hitsItr->barInTrainID();
+	nTofHits = afpToFHitContainer->size();
+	fill("AFPToFTool", lb, nTofHits);
 
-	if(hitsItr->isSideA())
-	{
-	    numberOfHit_S0 = hitsItr->trainID();
-            fill("AFPToFTool", numberOfHit_S0);
-	}
-	else if(hitsItr->isSideC())
+	for(const xAOD::AFPToFHit *hitsItr: *afpToFHitContainer)
 	{
-	    numberOfHit_S3 = hitsItr->trainID();
-            fill("AFPToFTool", numberOfHit_S3);
+		trainID = hitsItr->trainID();
+		barInTrainID = hitsItr->barInTrainID();
+
+		if(hitsItr->isSideA())
+		{
+			numberOfHit_S0 = hitsItr->trainID();
+			fill("AFPToFTool", numberOfHit_S0);
+		}
+		else if(hitsItr->isSideC())
+		{
+			numberOfHit_S3 = hitsItr->trainID();
+			fill("AFPToFTool", numberOfHit_S3);
+		}
+
+		if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
+		{
+			fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], barInTrainID, trainID);
+		}
 	}
 
-	if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
-	    fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], trainID, barInTrainID);
-	
-    }
-
-    return StatusCode::SUCCESS;
+	return StatusCode::SUCCESS;
 }
 
-- 
GitLab


From 947caf89d45e1dfd9cf2646087eb3ea1f226bfb7 Mon Sep 17 00:00:00 2001
From: Daniela Boerner <daniela.boerner@cern.ch>
Date: Thu, 17 Sep 2020 17:00:13 +0200
Subject: [PATCH 204/422] add title to x-axis

---
 .../egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py   | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
index 96b4eebcb734..dad40c59be9b 100755
--- a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
+++ b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
@@ -229,6 +229,7 @@ def make_conversion_plot(f_base, f_nightly, result_file):
             baseline.SetMinimum(min(baseline.GetMinimum(), baseline.GetMinimum()) * 0.7)
             baseline.SetMaximum(max(baseline.GetMaximum(), baseline.GetMaximum()) * 1.3)
 
+            baseline.GetXaxis().SetTitle("R^{reco}_{conv. vtx} - R^{true}_{conv. vtx} [mm]")
             baseline.GetYaxis().SetTitle("normalized to unity")
 
             baseline.SetLineColor(folder['color'])
-- 
GitLab


From 7d64b54ddf052afc15afe95255f86176aea603c6 Mon Sep 17 00:00:00 2001
From: Nicholas Styles <nstyles@atlas07.desy.de>
Date: Thu, 17 Sep 2020 17:07:36 +0200
Subject: [PATCH 205/422] reduce WARNING frequency when running with only one
 subdetector

---
 .../GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc              | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc
index 7eb02a03cd25..7a8b878e87b4 100755
--- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc
+++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc
@@ -32,7 +32,8 @@ inline void GeoSiHit::init() {
 
 inline GeoSiHit::GeoSiHit (const SiHit & h) {
   m_hit = &h;
-  if (!s_sct || ! s_pix) init();
+  //If neither manager exists, may need to re-initialize...
+  if (!s_sct && !s_pix) init();
 }
 
 inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const {
-- 
GitLab


From a8a43ade15522084864fbbe4af558b5734e1b7e3 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Thu, 17 Sep 2020 17:20:25 +0200
Subject: [PATCH 206/422] cleanup

---
 Reconstruction/tauRec/python/TauRecRunner.py            | 2 +-
 Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx      | 8 --------
 Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h | 1 -
 3 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/Reconstruction/tauRec/python/TauRecRunner.py b/Reconstruction/tauRec/python/TauRecRunner.py
index cdf93586c241..ffc69a2fda45 100644
--- a/Reconstruction/tauRec/python/TauRecRunner.py
+++ b/Reconstruction/tauRec/python/TauRecRunner.py
@@ -126,7 +126,7 @@ class TauRecRunner ( TauRecRunConfigured ) :
             tools.append(taualgs.getTauWPDecoratorEleBDT())
             tools.append(taualgs.getTauEleRNNEvaluator("TauEleRNN",
                                                          NetworkFile1P="taueveto_rnn_mc16d_1p.json",
-                                                         NetworkFile3P="taueveto_rnn_mc16d_1p.json",#test
+                                                         NetworkFile3P="taueveto_rnn_mc16d_3p.json",
                                                          OutputVarname="RNNEleScore", MaxTracks=10, MaxClusters=6))
             tools.append(taualgs.getTauWPDecoratorEleRNN())
             tools.append(taualgs.getTauDecayModeNNClassifier())
diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index 4d30b1ba4a25..47e6da63838d 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -127,7 +127,6 @@ std::unique_ptr<VarCalc> get_default_calculator() {
     calc->insert("ClustersMeanCenterLambda",   Variables::ClustersMeanCenterLambda  );
     calc->insert("ClustersMeanFirstEngDens",   Variables::ClustersMeanFirstEngDens  );
     calc->insert("ClustersMeanPresamplerFrac", Variables::ClustersMeanPresamplerFrac);
-    calc->insert("ClustersMeanSecondR",        Variables::ClustersMeanSecondR  );
 
     // Track variable calculator functions
     calc->insert("pt_log", Variables::Track::pt_log);
@@ -339,13 +338,6 @@ bool     ClustersMeanSecondLambda(const xAOD::TauJet &tau, double &out){
 
   return success;
 }
-bool     ClustersMeanSecondR(const xAOD::TauJet &tau, double &out){
-  float clustersMeanSecondR = tau.auxdata<float>("ClustersMeanSecondR");
-  //double ClustersMeanSecondR(0);
-  //  const auto success = tau.detail(TauDetail::ClustersMeanSecondR, ClustersMeanSecondR);
-  out = std::max(0.f, clustersMeanSecondR);
-  return true;
-}
 
 namespace Track {
 
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h b/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h
index c9c846b1c8e3..1b5b3665864c 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h
@@ -119,7 +119,6 @@ bool ClustersMeanEMProbability (const xAOD::TauJet &tau, double &out);
 bool ClustersMeanFirstEngDens  (const xAOD::TauJet &tau, double &out);
 bool ClustersMeanPresamplerFrac(const xAOD::TauJet &tau, double &out);
 bool ClustersMeanSecondLambda  (const xAOD::TauJet &tau, double &out);
-bool ClustersMeanSecondR       (const xAOD::TauJet &tau, double &out);
 bool EMPOverTrkSysP            (const xAOD::TauJet &tau, double &out);
 
 
-- 
GitLab


From 4eee034497512c96f5bba0d19aa1ce25e1d32d3c Mon Sep 17 00:00:00 2001
From: Daniela Boerner <daniela.boerner@cern.ch>
Date: Thu, 17 Sep 2020 17:24:00 +0200
Subject: [PATCH 207/422] change ordering to keep x-axis text for first plots

---
 .../scripts/EgammaARTmonitoring_plotsMaker.py          | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
index dad40c59be9b..149cbbfe35a0 100755
--- a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
+++ b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
@@ -435,16 +435,16 @@ if __name__ == '__main__':
 
     output_file = TFile("BN_ComparisonPlots_" + particle_type + ".hist.root", "RECREATE")
 
-    make_comparison_plots(particle_type, baseline_file, nightly_file, output_file)
-
-    make_profile_plots(baseline_file, nightly_file, output_file, particle_type)
-
-
     if particle_type == 'gamma':
 
         make_photon_fraction_plot(baseline_file, nightly_file,output_file)
         make_conversion_plot(baseline_file, nightly_file, output_file)
 
+    make_comparison_plots(particle_type, baseline_file, nightly_file, output_file)
+
+    make_profile_plots(baseline_file, nightly_file, output_file, particle_type)
+
+
 
 
 
-- 
GitLab


From ad3626db66231dcde308874ba30c05d0b34b659c Mon Sep 17 00:00:00 2001
From: Jannik Geisen <jannik.geisen@cern.ch>
Date: Thu, 17 Sep 2020 18:08:37 +0200
Subject: [PATCH 208/422] sort jets in run3 chain retrieval, turn run3 chain
 retrieval off for legacy sample

---
 .../Jet/JetMonitoring/src/JetMonitoringAlg.cxx        | 11 +++++++----
 .../python/TrigJetMonitorAlgorithm.py                 |  7 +++++--
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
index 4ca5f409a7f5..7d4f2ef4ab7b 100644
--- a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
+++ b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
@@ -6,7 +6,6 @@
 
 #include "xAODJet/Jet.h"
 
-
 JetMonitoringAlg::JetMonitoringAlg( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
 ,m_jetContainerKey("AntiKt4LCTopoJets"), m_jetFillerTools(this), m_failureOnMissingContainer(true), m_onlyPassingJets(true)
@@ -39,10 +38,10 @@ StatusCode JetMonitoringAlg::initialize() {
 
 
 StatusCode JetMonitoringAlg::fillHistograms( const EventContext& ctx ) const {
+
   if (m_triggerChainString != "" && m_onlyPassingJets) {
     ATH_MSG_DEBUG("JetMonitoringAlg::fillHistograms(const EventContext&) -> enter triggerChainString = "<<m_triggerChainString);
-   
-    ConstDataVector< xAOD::JetContainer > tmpCont(SG::VIEW_ELEMENTS);
+    std::list<const xAOD::Jet*> tmpList;
     const std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > fc = getTrigDecisionTool()->features<xAOD::JetContainer>( m_triggerChainString );
     for(const auto& jetLinkInfo : fc) {
       if (!jetLinkInfo.isValid()) {
@@ -51,8 +50,12 @@ StatusCode JetMonitoringAlg::fillHistograms( const EventContext& ctx ) const {
       }
       ElementLink<xAOD::JetContainer> j = jetLinkInfo.link;
       const xAOD::Jet *trigjet = dynamic_cast<const xAOD::Jet*>(*j);
-      tmpCont.push_back( trigjet );
+      tmpList.push_back( trigjet );
     }
+    auto sort = [this] (const xAOD::Jet * j1, const xAOD::Jet * j2) {return j1->p4().Et() > j2->p4().Et(); } ;
+    tmpList.sort( sort );
+    ConstDataVector< xAOD::JetContainer > tmpCont(SG::VIEW_ELEMENTS);
+    for(const xAOD::Jet* jet : tmpList ) tmpCont.push_back(jet);
     const xAOD::JetContainer * trigJetsCont = tmpCont.asDataVector();
     if (trigJetsCont->empty()) {
       ATH_MSG_WARNING("Empty trigger jet container for chain "<<m_triggerChainString);
diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
index e54283c73ad4..b1565ea994f8 100644
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
@@ -351,6 +351,8 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT,onlyUsePassingJet
    else:
      chainFolder = chain
 
+   if not athenaMT:
+     onlyUsePassingJets = False #does not work for legacy samples yet
    jetMonAlgSpecName = chain+"TrigMon"
    if not onlyUsePassingJets:
      chainFolder = chainFolder + "/ExpertHistos"
@@ -562,8 +564,9 @@ if __name__=='__main__':
 
   # Loop over HLT jet chains
   for chain,jetcoll in Chain2JetCollDict[InputType].items():
-    chainMonitorConfT = jetChainMonitoringConfig(ConfigFlags,jetcoll,chain,AthenaMT,True)
-    chainMonitorConfT.toAlg(helper)
+    if AthenaMT:
+      chainMonitorConfT = jetChainMonitoringConfig(ConfigFlags,jetcoll,chain,AthenaMT,True)
+      chainMonitorConfT.toAlg(helper)
     chainMonitorConfF = jetChainMonitoringConfig(ConfigFlags,jetcoll,chain,AthenaMT,False)
     chainMonitorConfF.toAlg(helper)
 
-- 
GitLab


From aaad53028084ba40714cb7c8eb5a4c92c7d57885 Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Thu, 17 Sep 2020 10:14:23 -0700
Subject: [PATCH 209/422] Revert "Update test alg in anticipation of MVA tool
 testing"

This reverts commit c1ef4b3df0367d5f5711d379ce3ec30076db4a2e.
---
 .../TrackVertexAssociationTool/CMakeLists.txt |  4 +-
 .../share/jobOption_TrackVertexAssoTest.py    | 35 ++++----
 .../src/TrackVertexAssoTestAlg.cxx            | 88 +++++++++++--------
 .../src/TrackVertexAssoTestAlg.h              | 78 +++++++++-------
 4 files changed, 114 insertions(+), 91 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
index 929abff86e9a..9b2828ed05b7 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
@@ -11,7 +11,7 @@ set( extra_deps )
 if( XAOD_STANDALONE )
    set( extra_deps Control/xAODRootAccess )
 else()
-   set( extra_deps Control/AthenaBaseComps PhysicsAnalysis/D3PDTools/AnaAlgorithm GaudiKernel )
+   set( extra_deps Control/AthenaBaseComps GaudiKernel )
 endif()
 
 # Declare the package's dependencies:
@@ -43,7 +43,7 @@ atlas_add_library( TrackVertexAssociationToolLib
 if( NOT XAOD_STANDALONE )
    atlas_add_component( TrackVertexAssociationTool
       src/*.h src/*.cxx src/components/*.cxx
-      LINK_LIBRARIES GaudiKernel AthenaBaseComps AnaAlgorithmLib xAODTracking
+      LINK_LIBRARIES GaudiKernel AthenaBaseComps xAODTracking
       TrackVertexAssociationToolLib )
 endif()
 
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/share/jobOption_TrackVertexAssoTest.py b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/share/jobOption_TrackVertexAssoTest.py
index 0d7e24d1de05..65e16d6737fa 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/share/jobOption_TrackVertexAssoTest.py
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/share/jobOption_TrackVertexAssoTest.py
@@ -3,35 +3,30 @@ from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
 from AthenaCommon.AppMgr import ServiceMgr, ToolSvc, theApp
 from AthenaCommon import CfgMgr
 
+#filelist = ['/tmp/boliu/AOD.04607224._000001.pool.root.1']
 filelist = [os.environ["ASG_TEST_FILE_MC"]]
+
 ServiceMgr.EventSelector.InputCollections = filelist
+#ServiceMgr.EventSelector.InputCollections =[] 
 
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
 
-# Instantiate the tool
-testMVATool = False
-if testMVATool:
-    tvaTool = None
-else:
-    tvaTool = CfgMgr.CP__TrackVertexAssociationTool("TrackVertexAssociationTool",
-                                                    WorkingPoint = "Nominal")
-ToolSvc += tvaTool
+# instantiate the tool
+tvatool=CfgMgr.CP__TrackVertexAssociationTool("TrackVertexAssociationTool",
+                                              WorkingPoint="Nominal")
+ToolSvc += tvatool
 
-# Instantiate the alg
-testAlg = CfgMgr.TrackVertexAssoTestAlg(TrackContainer  = "InDetTrackParticles",
-                                        VertexContainer = "PrimaryVertices",
-                                        TVATool         = tvaTool)
-topSequence += testAlg
+testAlg=CfgMgr.TrackVertexAssoTestAlg(
+        TrackContainer="InDetTrackParticles",
+        VertexContainer="PrimaryVertices",
+        TVATool=tvatool
+        )
 
-if not hasattr(svcMgr, 'THistSvc'):
-    from GaudiSvc.GaudiSvcConf import THistSvc
-    svcMgr += THistSvc()
-svcMgr.THistSvc.Output += [("ANALYSIS DATAFILE='TrackVertexAssoTestAlg.outputs.root' OPT='RECREATE'")] # Default stream: "ANALYSIS"
-svcMgr.THistSvc.MaxFileSize = -1
+topSequence += testAlg
 
 theApp.EvtMax = 100
-# testAlg.OutputLevel = DEBUG
-# theApp.setOutputLevel(DEBUG)
+#testAlg.OutputLevel=DEBUG
+#theApp.setOutputLevel(DEBUG)
 ServiceMgr.EventSelector.SkipEvents = 0
 ServiceMgr.MessageSvc.defaultLimit = 999
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.cxx
index d53513fd0aed..e19c0bcc4c73 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.cxx
@@ -1,34 +1,43 @@
 ///////////////////////// -*- C++ -*- /////////////////////////////
+
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-// TrackVertexAssoTestAlg.cxx
+
+// TrackVertexAssoTestAlg.cxx 
 // Implementation file for class TrackVertexAssoTestAlg
-// Author: Rachid Mazini, Bo Liu
-///////////////////////////////////////////////////////////////////
+// Author: Rachid Mazini, Bo Liu 
+/////////////////////////////////////////////////////////////////// 
 
 // TrackVertexAssociationTool includes
 #include "TrackVertexAssoTestAlg.h"
 
+// STL includes
+
 // FrameWork includes
 #include "Gaudi/Property.h"
-#include "AsgTools/MessageCheck.h"
 
-// ROOT includes
-#include "TH1F.h"
+#include "xAODTracking/TrackParticle.h"
+#include "xAODTracking/Vertex.h"
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODTracking/VertexContainer.h"
 
 using namespace std;
 
-///////////////////////////////////////////////////////////////////
-// Public methods:
-///////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////// 
+// Public methods: 
+/////////////////////////////////////////////////////////////////// 
 
 // Constructors
 ////////////////
-TrackVertexAssoTestAlg::TrackVertexAssoTestAlg( const std::string& name, ISvcLocator* pSvcLocator ) :
-  EL::AnaAlgorithm( name, pSvcLocator )
+TrackVertexAssoTestAlg::TrackVertexAssoTestAlg( const std::string& name, 
+			  ISvcLocator* pSvcLocator ) : 
+  ::AthAlgorithm( name, pSvcLocator )
 {
+  //
   // Property declaration
+  // 
+  //declareProperty( "Property", m_nProperty );
   declareProperty( "TVATool", m_TVATool );
 }
 
@@ -45,19 +54,8 @@ StatusCode TrackVertexAssoTestAlg::initialize()
 
   ATH_CHECK( m_trkContname.initialize() );
   ATH_CHECK( m_vertexContname.initialize() );
-
-  // Retrieve tool from ToolHandle
-  ATH_CHECK( m_TVATool.retrieve() );
-
-  // Book our histograms
-  m_h_eff = new TEfficiency("_h_eff", "_h_eff", m_nbins, m_xmin, m_xmax);
-  m_h_eff->SetDirectory(0);
-  m_h_eff->SetStatisticOption(TEfficiency::kFNormal);
-  m_h_imp = new TEfficiency("_h_imp", "_h_imp", m_nbins, m_xmin, m_xmax);
-  m_h_imp->SetDirectory(0);
-  m_h_imp->SetStatisticOption(TEfficiency::kFNormal);
-  ANA_CHECK(book(TH1F("h_eff", "h_eff", m_nbins, m_xmin, m_xmax))); // TVA efficiency vs. eta
-  ANA_CHECK(book(TH1F("h_imp", "h_imp", m_nbins, m_xmin, m_xmax))); // TVA impurity vs. eta
+  //retrieve tool from ToolHandle
+  CHECK(m_TVATool.retrieve());
 
   return StatusCode::SUCCESS;
 }
@@ -66,18 +64,6 @@ StatusCode TrackVertexAssoTestAlg::finalize()
 {
   ATH_MSG_INFO ("Finalizing " << name() << "...");
 
-  for (int i = 1; i <= m_nbins; i++) {
-    hist("h_eff")->SetBinContent(i, m_h_eff->GetEfficiency(i));
-    hist("h_eff")->SetBinError(i, m_h_eff->GetEfficiencyErrorUp(i));
-    hist("h_imp")->SetBinContent(i, m_h_imp->GetEfficiency(i));
-    hist("h_imp")->SetBinError(i, m_h_imp->GetEfficiencyErrorUp(i));
-  }
-
-  delete m_h_eff;
-  m_h_eff = nullptr;
-  delete m_h_imp;
-  m_h_imp = nullptr;
-
   return StatusCode::SUCCESS;
 }
 
@@ -85,8 +71,9 @@ StatusCode TrackVertexAssoTestAlg::execute()
 {  
   ATH_MSG_DEBUG ("Executing " << name() << "...");
 
-  // Retrieve containers
+  // retrieve containers
   SG::ReadHandle<xAOD::TrackParticleContainer> trkCont(m_trkContname);
+
   SG::ReadHandle<xAOD::VertexContainer> vxCont(m_vertexContname);
 
   if (!trkCont.isValid() || !vxCont.isValid()) {
@@ -156,9 +143,34 @@ StatusCode TrackVertexAssoTestAlg::execute()
   }
 
   // Example of accessing tracks matched to each vertex. Tracks are stored in a std::vector<xAOD::TrackParticle* >, for more details see TrackVertexAssociationMap.h
+
   // const xAOD::Vertex *pv=vxCont->at(0);
   // xAOD::TrackVertexAssociationList trkvxassoList = trkvxassoMap[pv];
   // ATH_MSG_INFO("Number of tracks associated to the PriVx: " << trkvxassoList.size());
 
+
+
   return StatusCode::SUCCESS;
 }
+
+/////////////////////////////////////////////////////////////////// 
+// Const methods: 
+///////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////// 
+// Non-const methods: 
+/////////////////////////////////////////////////////////////////// 
+
+/////////////////////////////////////////////////////////////////// 
+// Protected methods: 
+/////////////////////////////////////////////////////////////////// 
+
+/////////////////////////////////////////////////////////////////// 
+// Const methods: 
+///////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////// 
+// Non-const methods: 
+/////////////////////////////////////////////////////////////////// 
+
+
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.h
index 47a3d4e83c5d..6a9580567ddf 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/TrackVertexAssoTestAlg.h
@@ -1,12 +1,13 @@
 ///////////////////////// -*- C++ -*- /////////////////////////////
+
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-// TrackVertexAssoTestAlg.h
+
+// TrackVertexAssoTestAlg.h 
 // Header file for class TrackVertexAssoTestAlg
 // Author: Rachid Mazini, Bo Liu
-///////////////////////////////////////////////////////////////////
-
+/////////////////////////////////////////////////////////////////// 
 #ifndef TRACKVERTEXASSOCIATIONTOOL_TRACKVERTEXASSOTESTALG_H
 #define TRACKVERTEXASSOCIATIONTOOL_TRACKVERTEXASSOTESTALG_H 1
 
@@ -14,58 +15,73 @@
 #include <string>
 
 // FrameWork includes
-#include "AnaAlgorithm/AnaAlgorithm.h"
+#include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 
 // Tools
 #include "TrackVertexAssociationTool/ITrackVertexAssociationTool.h"
 
-// xAOD
+//xAOD 
 #include "xAODTracking/TrackParticleContainer.h"
 #include "xAODTracking/VertexContainer.h"
 
-// ROOT
-#include "TEfficiency.h"
-
-class TrackVertexAssoTestAlg : public EL::AnaAlgorithm
+class TrackVertexAssoTestAlg
+  : public ::AthAlgorithm
 { 
 
-///////////////////////////////////////////////////////////////////
-// Public methods:
-///////////////////////////////////////////////////////////////////
-public: 
+  /////////////////////////////////////////////////////////////////// 
+  // Public methods: 
+  /////////////////////////////////////////////////////////////////// 
+ public: 
+
+  // Copy constructor: 
 
-  /// Constructor with parameters:
+  /// Constructor with parameters: 
   TrackVertexAssoTestAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
   /// Destructor: 
-  virtual ~TrackVertexAssoTestAlg();
+  virtual ~TrackVertexAssoTestAlg(); 
+
+  // Assignment operator: 
+  //TrackVertexAssoTestAlg &operator=(const TrackVertexAssoTestAlg &alg); 
 
   // Athena algorithm's Hooks
-  virtual StatusCode initialize();
-  virtual StatusCode execute();
-  virtual StatusCode finalize();
+  virtual StatusCode  initialize();
+  virtual StatusCode  execute();
+  virtual StatusCode  finalize();
+
+  /////////////////////////////////////////////////////////////////// 
+  // Const methods: 
+  ///////////////////////////////////////////////////////////////////
+
+  /////////////////////////////////////////////////////////////////// 
+  // Non-const methods: 
+  /////////////////////////////////////////////////////////////////// 
 
-///////////////////////////////////////////////////////////////////
-// Private data:
-///////////////////////////////////////////////////////////////////
-private:
+  /////////////////////////////////////////////////////////////////// 
+  // Private data: 
+  /////////////////////////////////////////////////////////////////// 
+ private: 
 
-  /// Default constructor:
+  /// Default constructor: 
   TrackVertexAssoTestAlg();
 
   ToolHandle<CP::ITrackVertexAssociationTool> m_TVATool;
 
   /// Containers
-  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trkContname { this, "TrackContainer", "InDetTrackParticles", "Input track particles" };
+  
+  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trkContname 
+                                                  { this, "TrackContainer", "InDetTrackParticles", "Input track particles" };
   SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContname { this, "VertexContainer", "PrimaryVertices", "Input vertices" };
 
-  int   m_nbins = 26;
-  float m_xmin  = -2.5;
-  float m_xmax  = +2.5;
-  TEfficiency* m_h_eff = nullptr; //!
-  TEfficiency* m_h_imp = nullptr; //!
+}; 
+
+// I/O operators
+//////////////////////
+
+/////////////////////////////////////////////////////////////////// 
+// Inline methods: 
+/////////////////////////////////////////////////////////////////// 
 
-};
 
 #endif //> !TRACKVERTEXASSOCIATIONTOOL_TRACKVERTEXASSOTESTALG_H
-- 
GitLab


From 6d54c8339ab96215bf308c0c5ae945e467a27bd3 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Thu, 17 Sep 2020 20:23:33 +0200
Subject: [PATCH 210/422] TriggerJobOpts+TrigEDMConfig: Improve configuration
 of writing Run-3 HLT Navigation to output

---
 .../TrigEDMConfig/python/TriggerEDMRun3.py    | 17 +++++++
 .../TriggerJobOpts/python/TriggerConfig.py    | 48 +++++++------------
 .../TriggerJobOpts/share/runHLT_standalone.py |  8 +++-
 3 files changed, 40 insertions(+), 33 deletions(-)

diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index fdfd2365cb52..39c9ab60e897 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -456,6 +456,8 @@ TriggerHLTListRun3 = [
     ('xAOD::TrigCompositeAuxContainer#HLT_TrackCountAux.ntrks.pTcuts.z0cuts.counts',            'BS ESD AODFULL AODSLIM', 'MinBias'),
 ]
 
+# HLTNav_* object list is built dynamically during job configuration, here we only define its output targets
+HLTNavEDMTargets = 'BS CostMonDS ESD AODFULL AODSLIM'
 
 #-------------------------------------------------------------------------------
 # EDM details list to store the transient-persistent version
@@ -496,3 +498,18 @@ def tpMap():
             continue
         l[tr] = persistent(tr)
     return l
+
+
+def addHLTNavigationToEDMList(edmList, allDecisions, hypoDecisions):
+    """
+    Extend TriggerHLTListRun3 with HLT Navigation objects
+    """
+    for decisionCollection in allDecisions:
+        dynamic = '.-' # Exclude dynamic
+        if decisionCollection in hypoDecisions:
+            dynamic = '.' # Include dynamic
+        typeName = 'xAOD::TrigCompositeContainer#{:s}'.format(decisionCollection)
+        typeNameAux = 'xAOD::TrigCompositeAuxContainer#{:s}Aux{:s}'.format(decisionCollection, dynamic)
+        edmList.extend([
+            (typeName,    HLTNavEDMTargets, 'Steer'),
+            (typeNameAux, HLTNavEDMTargets, 'Steer')])
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
index c4284359f650..7a35b55d7ca5 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
@@ -244,7 +244,7 @@ def triggerMonitoringCfg(flags, hypos, filters, l1Decoder):
 
 
 
-def triggerOutputCfg(flags, decObj, decObjHypoOut, summaryAlg):
+def triggerOutputCfg(flags, summaryAlg):
     # Following cases are considered:
     # 1) Running in partition or athenaHLT - configure BS output written by the HLT framework
     # 2) Running offline athena and writing BS - configure BS output written by OutputStream alg
@@ -283,7 +283,7 @@ def triggerOutputCfg(flags, decObj, decObjHypoOut, summaryAlg):
     # Create the configuration
     if onlineWriteBS:
         __log.info("Configuring online ByteStream HLT output")
-        acc = triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg)
+        acc = triggerBSOutputCfg(flags, summaryAlg)
         # Configure the online HLT result maker to use the above tools
         # For now use old svcMgr interface as this service is not available from acc.getService()
         from AthenaCommon.AppMgr import ServiceMgr as svcMgr
@@ -296,10 +296,10 @@ def triggerOutputCfg(flags, decObj, decObjHypoOut, summaryAlg):
                 hltEventLoopMgr.ResultMaker.MakerTools += [ conf2toConfigurable(tool) ]
     elif offlineWriteBS:
         __log.info("Configuring offline ByteStream HLT output")
-        acc = triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg, offline=True)
+        acc = triggerBSOutputCfg(flags, summaryAlg, offline=True)
     elif writePOOL:
         __log.info("Configuring POOL HLT output")
-        acc = triggerPOOLOutputCfg(flags, decObj, decObjHypoOut, edmSet)
+        acc = triggerPOOLOutputCfg(flags, edmSet)
     else:
         __log.info("No HLT output writing is configured")
         acc = ComponentAccumulator()
@@ -307,7 +307,7 @@ def triggerOutputCfg(flags, decObj, decObjHypoOut, summaryAlg):
     return acc, edmSet
 
 
-def triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg, offline=False):
+def triggerBSOutputCfg(flags, summaryAlg, offline=False):
     """
     Returns CA with algorithms and/or tools required to do the serialisation
 
@@ -320,28 +320,17 @@ def triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg, offline=False):
     from TrigEDMConfig import DataScoutingInfo
     from TrigEDMConfig.TriggerEDM import getRun3BSList
 
-    # handle the collectiosn defined in the EDM config
-    collectionsToBS = getRun3BSList( ["BS"]+ DataScoutingInfo.getAllDataScoutingIdentifiers() )
+    # Get list of all output collections for ByteStream (including DataScouting)
+    collectionsToBS = getRun3BSList( ["BS"] + DataScoutingInfo.getAllDataScoutingIdentifiers() )
 
+    # Build an output dictionary with key = collection type#name, value = list of ROBFragment module IDs
     ItemModuleDict = OrderedDict()
     for typekey, bsfragments in collectionsToBS:
-        # translate readable frament names like BS, CostMonDS names to ROB fragment IDs 0 - for the BS, 1,...- for DS fragments
+        # Translate readable fragment names like BS, CostMonDS to ROB fragment IDs 0 (full result), 1, ... (DS results)
         moduleIDs = [ DataScoutingInfo.getFullHLTResultID() if f == 'BS' else DataScoutingInfo.getDataScoutingResultID(f)
                       for f in bsfragments ]
         ItemModuleDict[typekey] = moduleIDs
 
-    # Add decision containers (navigation)
-    for item in decObj:
-        dynamic = '.-' # Exclude dynamic
-        if item in decObjHypoOut:
-            dynamic = '.' # Include dynamic
-        typeName = 'xAOD::TrigCompositeContainer#{:s}'.format(item)
-        typeNameAux = 'xAOD::TrigCompositeAuxContainer#{:s}Aux{:s}'.format(item, dynamic)
-        if typeName not in list(ItemModuleDict.keys()):
-            ItemModuleDict[typeName] = [DataScoutingInfo.getFullHLTResultID(), DataScoutingInfo.getDataScoutingResultID('CostMonDS')]
-        if typeNameAux not in list(ItemModuleDict.keys()):
-            ItemModuleDict[typeNameAux] = [DataScoutingInfo.getFullHLTResultID(), DataScoutingInfo.getDataScoutingResultID('CostMonDS')]
-
     from TrigOutputHandling.TrigOutputHandlingConfig import TriggerEDMSerialiserToolCfg, StreamTagMakerToolCfg, TriggerBitsMakerToolCfg
 
     # Tool serialising EDM objects to fill the HLT result
@@ -385,7 +374,7 @@ def triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg, offline=False):
     return acc
 
 
-def triggerPOOLOutputCfg(flags, decObj, decObjHypoOut, edmSet):
+def triggerPOOLOutputCfg(flags, edmSet):
     # Get the list of output collections from TriggerEDM
     from TrigEDMConfig.TriggerEDM import getTriggerEDMList
     edmList = getTriggerEDMList(edmSet, flags.Trigger.EDMDecodingVersion)
@@ -395,14 +384,6 @@ def triggerPOOLOutputCfg(flags, decObj, decObjHypoOut, edmSet):
     for edmType, edmKeys in six.iteritems (edmList):
         itemsToRecord.extend([edmType+'#'+collKey for collKey in edmKeys])
 
-    # Add decision containers (navigation)
-    for item in decObj:
-        dynamic = '.-' # Exclude dynamic
-        if item in decObjHypoOut:
-            dynamic = '.' # Include dynamic
-        itemsToRecord.append('xAOD::TrigCompositeContainer#{:s}'.format(item))
-        itemsToRecord.append('xAOD::TrigCompositeAuxContainer#{:s}Aux{:s}'.format(item, dynamic))
-
     # Add EventInfo
     itemsToRecord.append('xAOD::EventInfo#EventInfo')
     itemsToRecord.append('xAOD::EventAuxInfo#EventInfoAux.')
@@ -591,12 +572,15 @@ def triggerRunCfg( flags, seqName = None, menu=None ):
     __log.info( "Of which, %d are the outputs of hypos", len( decObjHypoOut ) )
     __log.info( str( decObj ) )
 
-
-
     # configure components need to normalise output before writing out
     viewMakers = collectViewMakers( HLTSteps )
 
-    outputAcc, edmSet = triggerOutputCfg( flags, decObj, decObjHypoOut, summaryAlg )
+    # Add HLT Navigation to EDM list
+    from TrigEDMConfig import TriggerEDMRun3
+    TriggerEDMRun3.addHLTNavigationToEDMList(TriggerEDMRun3.TriggerHLTListRun3, decObj, decObjHypoOut)
+
+    # Configure output writing
+    outputAcc, edmSet = triggerOutputCfg( flags, summaryAlg )
     acc.merge( outputAcc )
 
     if edmSet:
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 84ec1543d4cc..381efafe28d6 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -585,7 +585,13 @@ if opt.doWriteBS or opt.doWriteRDOTrigger:
         log.error("Failed to find L1Decoder or DecisionSummaryMakerAlg, cannot determine Decision names for output configuration")
         decObj = []
         decObjHypoOut = []
-    CAtoGlobalWrapper( triggerOutputCfg, ConfigFlags, decObj=decObj, decObjHypoOut=decObjHypoOut, summaryAlg=summaryMakerAlg)
+
+    # Add HLT Navigation to EDM list
+    from TrigEDMConfig import TriggerEDMRun3
+    TriggerEDMRun3.addHLTNavigationToEDMList(TriggerEDMRun3.TriggerHLTListRun3, decObj, decObjHypoOut)
+
+    # Configure output writing
+    CAtoGlobalWrapper( triggerOutputCfg, ConfigFlags, summaryAlg=summaryMakerAlg)
 
 #-------------------------------------------------------------
 # Non-ComponentAccumulator Cost Monitoring
-- 
GitLab


From d2846dbfee51100c5e301fd5d46e88259641af3b Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Thu, 17 Sep 2020 20:37:21 +0200
Subject: [PATCH 211/422] fixed typos and clean up

---
 Reconstruction/tauRec/python/TauRecRunner.py       | 4 ++--
 Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Reconstruction/tauRec/python/TauRecRunner.py b/Reconstruction/tauRec/python/TauRecRunner.py
index ffc69a2fda45..0bac7a6dafbb 100644
--- a/Reconstruction/tauRec/python/TauRecRunner.py
+++ b/Reconstruction/tauRec/python/TauRecRunner.py
@@ -125,8 +125,8 @@ class TauRecRunner ( TauRecRunConfigured ) :
                                                        maxAbsTrackEta=3.0, outputVarName="BDTEleScore")) #update config?
             tools.append(taualgs.getTauWPDecoratorEleBDT())
             tools.append(taualgs.getTauEleRNNEvaluator("TauEleRNN",
-                                                         NetworkFile1P="taueveto_rnn_mc16d_1p.json",
-                                                         NetworkFile3P="taueveto_rnn_mc16d_3p.json",
+                                                         NetworkFile1P="rnneveto_mc16d_config_1p.json",
+                                                         NetworkFile3P="rnneveto_mc16d_config_3p.json",
                                                          OutputVarname="RNNEleScore", MaxTracks=10, MaxClusters=6))
             tools.append(taualgs.getTauWPDecoratorEleRNN())
             tools.append(taualgs.getTauDecayModeNNClassifier())
diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index 47e6da63838d..852e9a54c4de 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -562,8 +562,7 @@ bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const
   };
   std::sort(clusters.begin(), clusters.end(), et_cmp);
 
-  TLorentzVector LC_P4;
-  LC_P4.SetPtEtaPhiM(tau.ptDetectorAxis(), tau.etaDetectorAxis(), tau.phiDetectorAxis(), tau.m());
+  TLorentzVector LC_P4 = pTau.p4(xAOD::TauJetParameters::DetectorAxis);
   
   float clE(0.), Etot(0.);
   using MomentType = xAOD::CaloCluster::MomentType;
-- 
GitLab


From ef3cc0dae095bfd3f03b8dc223a50101ab34ab95 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Thu, 17 Sep 2020 20:41:18 +0200
Subject: [PATCH 212/422] fixed typos

---
 Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index 852e9a54c4de..67f01a8699fd 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -562,7 +562,7 @@ bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const
   };
   std::sort(clusters.begin(), clusters.end(), et_cmp);
 
-  TLorentzVector LC_P4 = pTau.p4(xAOD::TauJetParameters::DetectorAxis);
+  TLorentzVector LC_P4 = tau.p4(xAOD::TauJetParameters::DetectorAxis);
   
   float clE(0.), Etot(0.);
   using MomentType = xAOD::CaloCluster::MomentType;
-- 
GitLab


From 08e524ee08789f6dd616884b29623061e75ef6d7 Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Thu, 17 Sep 2020 12:00:42 -0700
Subject: [PATCH 213/422] Return sqrt of dz*sinTheta err

---
 .../TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
index 1554b0a52755..8de11d5a6eac 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
@@ -201,7 +201,7 @@ public:
     float errSqDZ    = trk.definingParametersCovMatrix()(1, 1) + vx.covariancePosition()(2, 2);
     float errSqTheta = trk.definingParametersCovMatrix()(3, 3);
     float covZ0Theta = trk.definingParametersCovMatrix()(1, 3);
-    return (errSqDZ * std::pow(sinTheta, 2) + std::pow(dz * cosTheta, 2) * errSqTheta + 2 * sinTheta * dz * cosTheta * covZ0Theta);
+    return std::sqrt(errSqDZ * std::pow(sinTheta, 2) + std::pow(dz * cosTheta, 2) * errSqTheta + 2 * sinTheta * dz * cosTheta * covZ0Theta);
   }
 };
 
-- 
GitLab


From 01a3fad42dcdf456a2980ec532ac908d93587167 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 17 Sep 2020 21:45:41 +0200
Subject: [PATCH 214/422] const fixes

---
 .../InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h        | 2 +-
 .../InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h        | 2 +-
 InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.cxx     | 4 ++--
 .../InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h         | 2 +-
 .../InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h         | 2 +-
 InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h    | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h
index 541580f50800..04355929ff18 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h
@@ -22,7 +22,7 @@ private:
 
   int m_printMessages; //FIXME not used
 
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
   TRTProcessingOfBarrelHits* m_pProcessingOfBarrelHits;
 
   int m_verboseLevel;
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h
index af25dcf46a0e..f633561f31a5 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h
@@ -22,7 +22,7 @@ private:
 
   int m_printMessages; // FIXME not used?
 
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
   TRTProcessingOfEndCapHits* m_pProcessingOfEndCapHits;
 
   int m_verboseLevel;
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.cxx
index f6ca6c31915b..be2060cf8059 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Class header
@@ -17,7 +17,7 @@
 
 TRTPrintingOfHits::TRTPrintingOfHits(): m_msg("TRTPrintingOfHits")
 {
-  TRTParameters* pParameters = TRTParameters::GetPointer();
+  const TRTParameters* pParameters = TRTParameters::GetPointer();
 
   m_printMessages = pParameters->GetInteger("PrintMessages");
 
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h
index 03308dd8cc8d..1ef37d5cfa5d 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h
@@ -51,7 +51,7 @@ private:
   int* m_strawIDToLayerIDB;
   int* m_strawIDToLayerIDC;
 
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
   TRTSensitiveDetector* m_pSensitiveDetector;
 
   int m_verboseLevel;
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h
index 56cc07d087dd..ea4e0ce8ec5d 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h
@@ -46,7 +46,7 @@ private:
   int m_numberOfStrawsInIDSectorsAB;
   int m_numberOfStrawsInIDSectorC;
 
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
   TRTSensitiveDetector* m_pSensitiveDetector;
 
   int m_verboseLevel;
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h
index 50dfe58d5b82..0f811912fb9f 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h
@@ -84,7 +84,7 @@ class ATLAS_NOT_THREAD_SAFE TRTSensitiveDetector : public G4VSensitiveDetector /
   // The hits collection
   SG::WriteHandle<TRTUncompressedHitCollection> m_HitColl; //pUncompressedHitCollection;
 
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
 
   TRTProcessingOfBarrelHits* m_pProcessingOfBarrelHits;
   TRTProcessingOfEndCapHits* m_pProcessingOfEndCapHits;
-- 
GitLab


From 51d5a9b38e9b0b4cb607795865e0945350c308fd Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Thu, 17 Sep 2020 21:35:41 -0700
Subject: [PATCH 215/422] Small touchup

---
 .../Root/MVATrackVertexAssociationTool.cxx                    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
index 02d6024696db..d538e703cf74 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -240,7 +240,7 @@ bool MVATrackVertexAssociationTool::initializeNetwork() {
   }
   std::ifstream netFile(fileName);
   if (!netFile) {
-    throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : could not properly open file: " + fileName);
+    throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : could not properly open input network file: " + fileName);
   }
 
   // For sequential:
@@ -252,7 +252,7 @@ bool MVATrackVertexAssociationTool::initializeNetwork() {
   else {
     lwt::GraphConfig netDef = lwt::parse_json_graph(netFile);
     if (netDef.inputs.size() != 1) {
-      throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : network in file \"" + m_fileName + "\" has more than 1 input node: # of input nodes = " + std::to_string(netDef.inputs.size()));
+      throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : network in file \"" + fileName + "\" has more than 1 input node: # of input nodes = " + std::to_string(netDef.inputs.size()));
     }
     m_inputNodeName = netDef.inputs[0].name;
     m_graph = new lwt::LightweightGraph(netDef);
-- 
GitLab


From 6ca35990c4f7441ceb6fc2f382491ac3f94d0cf9 Mon Sep 17 00:00:00 2001
From: Joerg Stelzer <joerg.stelzer@cern.ch>
Date: Fri, 18 Sep 2020 08:57:13 +0200
Subject: [PATCH 216/422] Ensure that right package is used for XML pickup

---
 Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
index bbe0d864e127..9d5cc5d2d5d9 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
@@ -523,7 +523,8 @@ class readLVL1configFromXML(JobProperty):
             TriggerFlags.inputLVL1configFile = TriggerFlags.outputLVL1configFile()
             TriggerFlags.Lvl1.items.set_On()
         else:
-            TriggerFlags.inputLVL1configFile = "TriggerMenuXML/LVL1config_"+_getMenuBaseName(TriggerFlags.triggerMenuSetup())+"_" + TriggerFlags.menuVersion() + ".xml"
+            menuXMLPackage = "TriggerMenuMT" if TriggerFlags.doMT() else "TriggerMenuXML"
+            TriggerFlags.inputLVL1configFile = menuXMLPackage + "/LVL1config_"+_getMenuBaseName(TriggerFlags.triggerMenuSetup())+"_" + TriggerFlags.menuVersion() + ".xml"
             xmlFile=TriggerFlags.inputLVL1configFile()
             from TrigConfigSvc.TrigConfigSvcConfig import findFileInXMLPATH
             if xmlFile!='NONE' and not os.path.exists(findFileInXMLPATH(xmlFile)):
@@ -567,7 +568,7 @@ class readHLTconfigFromXML(JobProperty):
                 nightlyPaths=os.environ['XMLPATH'].split(':')
 
                 for p in nightlyPaths:
-                    full_path_name = p+"/TriggerMenuXML/"+TriggerFlags.inputHLTconfigFile()
+                    full_path_name = p+"/"+TriggerFlags.inputHLTconfigFile()
                     if os.path.exists(full_path_name) is True:
                         log.info("The HLT xml file is: "+full_path_name)
                         success = True
-- 
GitLab


From ed9dbd69d46feb2730b5a6727efbaa1419bd6d04 Mon Sep 17 00:00:00 2001
From: Stephen Nicholas Swatman <s.swatman@nikhef.nl>
Date: Fri, 18 Sep 2020 08:24:58 +0000
Subject: [PATCH 217/422] Make TrackSummaryTool a friend of TrackSummary

We're going to need to access some private members of Trk::TrackSummary
in Trk::TrackSummaryTool, and as such we mark them as friends.
---
 .../TrkTrackSummary/TrackSummary.h            |  2 ++
 .../src/TrackSummaryTool.cxx                  | 27 ++++++++++---------
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h b/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
index 427d843a059f..24ed209335f3 100755
--- a/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
+++ b/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
@@ -36,6 +36,7 @@ namespace Trk {
     class Track;
     class InDetTrackSummary;
     class MuonTrackSummary;
+    class TrackSummaryTool;
 
 /** enumerates the different types of information stored in Summary. Use in get(const SummaryType type), for for example, summary.get(numOfPixelHits)
 When adding a new transient information type, please make sure to increase numberOfTrackSummaryTypes.*/
@@ -197,6 +198,7 @@ class TrackSummary
 public:
     friend class InDet::InDetTrackSummaryHelperTool;
     friend class Muon::MuonTrackSummaryHelperTool;
+    friend class Trk::TrackSummaryTool;
 
     /** Value set in the cxx file to -1. If any of the values returned by get(const SummaryType& type)==SummaryTypeNotSet then this means that 
     the information has not been filled. i.e. ID information cannot be filled if the TrackSummaryTool does not have access to the InDetTrackSummaryHelperTool*/
diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
index b7fc117d42e1..f84bcee4a5df 100755
--- a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
+++ b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
@@ -160,15 +160,18 @@ Trk::TrackSummaryTool::createSummary( const Track& track,
                                       bool doHolesInDet,
                                       bool doHolesMuon) const
 {
-  // first check if track has summary already and then return a clone
+  std::unique_ptr<Trk::TrackSummary> ts;
+
+  // first check if track has summary already and then clone it.
   if (track.trackSummary()!=nullptr) {
     ATH_MSG_DEBUG ("Return cached summary for author : "<<track.info().dumpInfo());
-    return std::make_unique<Trk::TrackSummary>(*(track.trackSummary()));
+    ts = std::make_unique<Trk::TrackSummary>(*(track.trackSummary()));
+  } else {
+    ts = std::make_unique<Trk::TrackSummary>();
   }
-  // Create and initialize information vector and bit pattern
-  unsigned int numberOfTrackSummaryTypes = Trk::numberOfTrackSummaryTypes+1;
-  // put values to -1 of they are not evaluated
-  std::vector<int> information(numberOfTrackSummaryTypes,-1);
+
+  std::vector<int> & information = ts->m_information;
+  information.resize(std::min(information.size(), static_cast<size_t>(numberOfTrackSummaryTypes)));
 
   // Troels.Petersen@cern.ch:
   unsigned int numberOfeProbabilityTypes = Trk::numberOfeProbabilityTypes+1;
@@ -294,12 +297,12 @@ Trk::TrackSummaryTool::createSummary( const Track& track,
     eProbability.push_back(0.0);
   }
 
-  std::unique_ptr<TrackSummary> ts=std::make_unique<TrackSummary>(information,
-                                                                  eProbability,
-                                                                  hitPattern,
-                                                                  dedx,
-                                                                  nhitsuseddedx,
-                                                                  noverflowhitsdedx);
+  ts->m_eProbability = eProbability;
+  ts->m_idHitPattern = hitPattern.to_ulong();
+  ts->m_dedx = dedx;
+  ts->m_nhitsdedx = nhitsuseddedx;
+  ts->m_nhitsoverflowdedx = noverflowhitsdedx;
+
   // add detailed summary for indet
   if( m_addInDetDetailedSummary && !m_idTool.empty() ){
     m_idTool->addDetailedTrackSummary(track,*ts);
-- 
GitLab


From e800f4693aa9ee2d9162b04b96f3f4e662264d33 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Fri, 18 Sep 2020 10:29:24 +0200
Subject: [PATCH 218/422] Add smart pointers for FlowElementContainer

---
 Event/xAOD/xAODPFlow/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Event/xAOD/xAODPFlow/CMakeLists.txt b/Event/xAOD/xAODPFlow/CMakeLists.txt
index c230887d74cc..aad1df5cc882 100644
--- a/Event/xAOD/xAODPFlow/CMakeLists.txt
+++ b/Event/xAOD/xAODPFlow/CMakeLists.txt
@@ -18,7 +18,7 @@ atlas_add_library( xAODPFlow
 atlas_add_xaod_smart_pointer_dicts(
    INPUT xAODPFlow/selection.xml
    OUTPUT _selectionFile
-   CONTAINERS "xAOD::PFOContainer_v1" "xAOD::TrackCaloClusterContainer_v1" )
+   CONTAINERS "xAOD::PFOContainer_v1" "xAOD::TrackCaloClusterContainer_v1"  "xAOD::FlowElementContainer_v1")
 
 atlas_add_dictionary( xAODPFlowDict
    xAODPFlow/xAODPFlowDict.h
-- 
GitLab


From 2d90c3cb2c3c9047fac32ab593ab036c44541ae4 Mon Sep 17 00:00:00 2001
From: Savanna Marie Shaw <savanna.marie.shaw@cern.ch>
Date: Fri, 18 Sep 2020 11:14:26 +0200
Subject: [PATCH 219/422] Add protection for empty CSCCluster fits

In the trigger we can run into the case where we have some empty CSC clusters which is resulting in empty CSCCluster fit results, so adding some protection to avoid accessing these empty fit results. Fixes ATR-22055.
---
 .../src/CscClusterOnTrackCreator.cxx                        | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
index 7c4cfd1227ce..2a4595e3883e 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
@@ -330,7 +330,11 @@ namespace Muon {
       std::vector<ICscClusterFitter::Result> results, results0;
       results = m_clusterUtilTool->getRefitCluster(MClus,tantheta);
       results0 = m_clusterUtilTool->getRefitCluster(MClus,0);
-      
+
+      if(&results[0]==nullptr || &results0[0]==nullptr){
+	ATH_MSG_VERBOSE("No fit result");
+	return new CscClusterOnTrack(MClus,locpar,loce,positionAlongStrip,MClus->status(),MClus->timeStatus(),MClus->time());
+      }
       ICscClusterFitter::Result res, res0;
       res = results[0];
       res0 = results0[0]; // result at normal angle to make error blown correctly in case of cosmic
-- 
GitLab


From fc376d427c02509b1c384b8c84483ce856dfabf3 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 18 Sep 2020 10:53:07 +0100
Subject: [PATCH 220/422] Sorted out remaining issues in tests (added create
 option where it was necessary)

---
 .../python/ComponentAccumulator.py            | 32 ++++++++-----------
 .../python/MainServicesConfig.py              |  3 +-
 .../python/TileConditionsConfig.py            |  2 +-
 .../python/TileInfoLoaderConfig.py            |  2 +-
 4 files changed, 17 insertions(+), 22 deletions(-)

diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py
index f6f7043e71f7..2746fa952f30 100644
--- a/Control/AthenaConfiguration/python/ComponentAccumulator.py
+++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py
@@ -24,8 +24,7 @@ from AthenaConfiguration.UnifyProperties import unifySet
 
 class ConfigurationError(RuntimeError):
     pass
-_basicServicesToCreate=()
-_basicServicesToCreateOrder=("CoreDumpSvc","GeoModelSvc", "DetDescrCnvSvc")+_basicServicesToCreate
+_basicServicesToCreateOrder=("CoreDumpSvc/CoreDumpSvc", "GeoModelSvc/GeoModelSvc", "DetDescrCnvSvc/DetDescrCnvSvc")
 
 
 
@@ -79,7 +78,7 @@ class ComponentAccumulator(object):
         self._algorithms = {}            #Flat algorithms list, useful for merging
         self._conditionsAlgs=[]          #Unordered list of conditions algorithms + their private tools
         self._services=[]                #List of service, not yet sure if the order matters here in the MT age
-        self._servicesToCreate=list(_basicServicesToCreate)
+        self._servicesToCreate=[]
         self._privateTools=None          #A placeholder to carry a private tool(s) not yet attached to its parent
         self._primaryComp=None           #A placeholder to designate the primary service 
 
@@ -393,20 +392,12 @@ class ComponentAccumulator(object):
             #keep a ref of the de-duplicated public tool as primary component
             self._primaryComp=self.__getOne( self._services, newSvc.name, "Services") 
         self._lastAddedComponent=newSvc.name
-        if create:
-            if newSvc.getName in self._servicesToCreate: # done already
-                return
-            if newSvc.getName not in _basicServicesToCreateOrder:
-                self._servicesToCreate.append( newSvc.name )
-            else:
-                for basicSvc in reversed(_basicServicesToCreateOrder[:_basicServicesToCreateOrder.index(newSvc.name)]):
-                    if basicSvc in self._servicesToCreate:
-                        self._basicServicesToCreate.insert(self._basicServicesToCreate.index(basicSvc)+1, newSvc.name)
-                        break
-                else:
-                    self._servicesToCreate.insert( 0, newSvc.name )
-        return 
 
+        if create:
+            sname = newSvc.getFullJobOptName()
+            if sname not in self._servicesToCreate:
+                self._servicesToCreate.append(sname)
+        return
 
     def addPublicTool(self,newTool,primary=False):
         if newTool.__component_type__ != "AlgTool":
@@ -581,7 +572,7 @@ class ComponentAccumulator(object):
             self.addCondAlgo(condAlg) #Profit from deduplicaton here
 
         for svc in other._services:
-            self.addService(svc, create = svc.name in self._servicesToCreate) #Profit from deduplicaton here
+            self.addService(svc, create = svc.getFullJobOptName() in other._servicesToCreate) #Profit from deduplicaton here
 
         for pt in other._publicTools:
             self.addPublicTool(pt) #Profit from deduplicaton here
@@ -674,9 +665,14 @@ class ComponentAccumulator(object):
             extSvc += [
                 svc.getFullJobOptName(),
             ]
-            if svc.name in self._servicesToCreate:
+            if svc.getFullJobOptName() in self._servicesToCreate:
                 svcToCreate.append(svc.getFullJobOptName())
 
+        # order basic services
+        for bs in reversed(_basicServicesToCreateOrder):
+            if bs in svcToCreate:
+                svcToCreate.insert(0, svcToCreate.pop( svcToCreate.index(bs) ) )
+
         extSvc.append("PyAthena::PyComponentMgr/PyComponentMgr")
 
         appPropsToSet["ExtSvc"] = str(extSvc)
diff --git a/Control/AthenaConfiguration/python/MainServicesConfig.py b/Control/AthenaConfiguration/python/MainServicesConfig.py
index de49472b6d3e..072ec1ea40fd 100644
--- a/Control/AthenaConfiguration/python/MainServicesConfig.py
+++ b/Control/AthenaConfiguration/python/MainServicesConfig.py
@@ -80,8 +80,7 @@ def MainServicesCfg(cfgFlags):
 
     cfg.addService(CompFactory.GeoModelSvc(), create=True)
     cfg.addService(CompFactory.DetDescrCnvSvc(), create=True)
-
-    cfg.addService(CompFactory.CoreDumpSvc())
+    cfg.addService(CompFactory.CoreDumpSvc(), create=True)
 
     cfg.setAppProperty('InitializationLoopCheck',False)
 
diff --git a/TileCalorimeter/TileConditions/python/TileConditionsConfig.py b/TileCalorimeter/TileConditions/python/TileConditionsConfig.py
index 39020d50af26..1de3f861de64 100644
--- a/TileCalorimeter/TileConditions/python/TileConditionsConfig.py
+++ b/TileCalorimeter/TileConditions/python/TileConditionsConfig.py
@@ -111,7 +111,7 @@ def tileCondCfg( flags ):
     TileInfoLoader, TileCablingSvc=CompFactory.getComps("TileInfoLoader","TileCablingSvc",)
     infoLoaderSvc = TileInfoLoader()
     infoLoaderSvc.NoiseScaleIndex= 2
-    acc.addService( infoLoaderSvc ) 
+    acc.addService(infoLoaderSvc, create = True)
 #    acc.addToAppProperty('CreateSvc', [infoLoaderSvc.getFullName()] )
 
 
diff --git a/TileCalorimeter/TileConditions/python/TileInfoLoaderConfig.py b/TileCalorimeter/TileConditions/python/TileInfoLoaderConfig.py
index be971c6d2dbb..966587c1cb11 100644
--- a/TileCalorimeter/TileConditions/python/TileInfoLoaderConfig.py
+++ b/TileCalorimeter/TileConditions/python/TileInfoLoaderConfig.py
@@ -72,7 +72,7 @@ def TileInfoLoaderCfg(flags, **kwargs):
 
 
     TileInfoLoader=CompFactory.TileInfoLoader
-    acc.addService(TileInfoLoader(**kwargs), primary = True)
+    acc.addService(TileInfoLoader(**kwargs), primary = True, create=True)
 
     return acc
 
-- 
GitLab


From e4cadc42773fbd447c0cc4b4d45fdda1acc6f653 Mon Sep 17 00:00:00 2001
From: Ruggero Turra <ruggero.turra@cern.ch>
Date: Fri, 18 Sep 2020 12:43:04 +0200
Subject: [PATCH 221/422] make photonSuperClusterBuilder and
 electronSuperClusterBuilder inherits from AthReentrantAlgorithm

---
 .../egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx   | 2 +-
 .../egamma/egammaAlgs/src/egammaSuperClusterBuilder.h     | 4 ++--
 .../egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx | 2 +-
 .../egamma/egammaAlgs/src/electronSuperClusterBuilder.h   | 8 +-------
 .../egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx   | 2 +-
 .../egamma/egammaAlgs/src/photonSuperClusterBuilder.h     | 8 +-------
 6 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx
index d38f58395d36..91446362a14b 100644
--- a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx
@@ -106,7 +106,7 @@ etaphi_range(const CaloDetDescrManager& dd_man,
 // Constructor.
 egammaSuperClusterBuilder::egammaSuperClusterBuilder(const std::string& name,
                                                      ISvcLocator* pSvcLocator)
-  : AthAlgorithm(name, pSvcLocator)
+  : AthReentrantAlgorithm(name, pSvcLocator)
 {
 
   m_searchWindowPhiBarrel = m_searchWindowPhiCellsBarrel * s_cellPhiSize * 0.5;
diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
index 87de0d6277ca..f925bbd605fd 100644
--- a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
+++ b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
@@ -6,7 +6,7 @@
 #define EGAMMAALGS_EGAMMASUPERCLUSTERBUILDER_H
 
 // INCLUDE HEADER FILES:
-#include "AthenaBaseComps/AthAlgorithm.h"
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "GaudiKernel/EventContext.h"
 #include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/ToolHandle.h"
@@ -29,7 +29,7 @@ class CaloDetDescrManager;
  *  The inheritance should be private. This class should never be instantiated
  *  by itself, and hence has no interface class
  **/
-class egammaSuperClusterBuilder : public AthAlgorithm
+class egammaSuperClusterBuilder : public AthReentrantAlgorithm
 {
 
 protected:
diff --git a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx
index 2297cf933cc7..2da7b8a630ad 100644
--- a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx
@@ -55,7 +55,7 @@ electronSuperClusterBuilder::finalize()
 }
 
 StatusCode
-electronSuperClusterBuilder::execute_r(const EventContext& ctx) const
+electronSuperClusterBuilder::execute(const EventContext& ctx) const
 {
 
   SG::ReadHandle<EgammaRecContainer> egammaRecs(m_inputEgammaRecContainerKey, ctx);
diff --git a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h
index cc4b46c97617..6458fd3d1906 100644
--- a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h
+++ b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h
@@ -29,13 +29,7 @@ public:
   // Tool standard routines.
   virtual StatusCode initialize() override final;
   virtual StatusCode finalize() override final;
-  virtual StatusCode execute() override final
-  {
-    return execute_r(Algorithm::getContext());
-  }
-  // This will become the normal execute when
-  // inheriting from AthReentrantAlgorithm
-  StatusCode execute_r(const EventContext& ctx) const;
+  StatusCode execute(const EventContext& ctx) const override final;
 
 private:
   bool matchSameTrack(const xAOD::TrackParticle& seedTrack,
diff --git a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx
index ae573e4b9019..0342ef800e5a 100644
--- a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx
@@ -58,7 +58,7 @@ photonSuperClusterBuilder::finalize()
 }
 
 StatusCode
-photonSuperClusterBuilder::execute_r(const EventContext& ctx) const
+photonSuperClusterBuilder::execute(const EventContext& ctx) const
 {
 
   // Retrieve input egammaRec container.
diff --git a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h
index b5408a0c199e..038869eeb6e7 100644
--- a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h
+++ b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h
@@ -28,13 +28,7 @@ public:
   // Tool standard routines.
   virtual StatusCode initialize() override final;
   virtual StatusCode finalize() override final;
-  virtual StatusCode execute() override final
-  {
-    return execute_r(Algorithm::getContext());
-  }
-  // This will become the normal execute when
-  // inheriting from AthReentrantAlgorithm
-  StatusCode execute_r(const EventContext& ctx) const;
+  virtual StatusCode execute(const EventContext& ctx) const override final;
 
 private:
   /** Return extra clusters that can be added to make supercluster */
-- 
GitLab


From fd7c4cf29f39fb0f53ae38070b0f6ed3368fccce Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 18 Sep 2020 12:48:19 +0200
Subject: [PATCH 222/422] Pseudo efficiency histograms

---
 .../Run3AFPMonitoring/AFPSiLayerAlgorithm.h   |  4 +-
 .../Run3AFPMonitoring/AFPToFAlgorithm.h       |  3 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 40 ++++++++--------
 .../src/AFPSiLayerAlgorithm.cxx               | 46 +++++++++++--------
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx |  3 ++
 5 files changed, 55 insertions(+), 41 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 8b4146f20b30..585d439e6ef6 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -25,8 +25,8 @@ public:
 	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 
 private:
-	std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
-	std::map<std::string,int> m_TrackGroup; 
+	std::map<std::string,std::map<std::string,int>> m_StationPlaneGroup;
+	std::map<std::string,int> m_StationGroup; 
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
 	SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
 	
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
index 0f19a5f3d1b1..db04a6ace502 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -22,14 +22,13 @@ public:
 
 private:
 	std::map<std::string,int> m_HitmapGroupsToF;
-   
+
 	SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
 
 protected:
 	// Only 0 and 3 are ToF stations (farAside and farCside)
 	std::vector<std::string> m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" };
 
-   
 };
 #endif
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index f58861dd66de..18272d8881c6 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -12,8 +12,6 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     from LumiBlockComps.BunchCrossingCondAlgDefault import BunchCrossingCondAlgDefault
     BunchCrossingCondAlgDefault()
-
-
     
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
@@ -35,6 +33,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     AFPSiGroup.defineHistogram('lb,nSiHits', title='Total number of hits;lb;total number of Hits', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
     AFPSiGroup.defineHistogram('lb,muPerBCID', title='<mu>;lumiBlock;<mu>', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
+    AFPSiGroup.defineHistogram('planeHitsAll', title='Number of hits per plane;plane; hits', type='TH1F', path='SiT/HitsPerPlanes', xbins=16, xmin=-0.5, xmax=15.5)
     #AFPSiGroup.defineHistogram('layerNumber,layerEfficiency', title='LayerEfficiency;layerNumber', path='SiT/', xbins = 16, xmin=0.5, xmax=16.5, ybins=100, ymin=0, ymax=1)
     #AFPSiGroup.defineHistogram('layerEfficiency', type='TH1F', title='1D layer efficiency;layerEfficiency', path='SiT/', xbins=16, xmin=0.5, xmax=16.5)
 
@@ -44,31 +43,33 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
     # Using a map of groups
     layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
-    combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
+    stationList = ['farAside', 'nearAside', 'nearCside', 'farCside']
 
-    array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
+    array = helper.addArray([stationList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
 
-    array.defineHistogram('pixelColIDChip', title='Hits per column for {0} layer {1};pixelColIDChip; entries', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-    array.defineHistogram('pixelRowIDChip', title='Hits per row for {0} Layer {1};pixelRowIDChip; entries', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
-    array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for {0} Layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
-    array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for {0} Layer {1};timeOverThreshold; entries', path='SiTimeOverThreshold', xbins=16, xmin=0.5, xmax=16.5)
-    array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};x [mm];y [mm]', type='TH2F', path='Cluster', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
-    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlane', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneFront', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneEnd', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
-    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneMiddle', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('pixelColIDChip', title='Hits per column for station {0}, layer {1};pixelColIDChip; entries', path='PixelColIDChip/{0}', xbins=80, xmin=0.5, xmax=80.5)
+    array.defineHistogram('pixelRowIDChip', title='Hits per row for station {0}, layer {1};pixelRowIDChip; entries', path='PixelRowIDChip/{0}', xbins=336, xmin=0.5, xmax=336.5)
+    array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for station {0}, layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D/{0}', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
+    array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for station {0}, layer {1};timeOverThreshold; entries', path='SiTimeOverThreshold/{0}', xbins=16, xmin=0.5, xmax=16.5)
+    
+    array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};x [mm];y [mm]', type='TH2F', path='Cluster/{0}', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
+    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlane/{0}', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneFront/{0}', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneEnd/{0}', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneMiddle/{0}', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
 
 
-    array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
+    array = helper.addArray([stationList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
+    array.defineHistogram('planeHits', type='TH1F', title='Number of hits per plane, station {0};plane; hits', path='HitsPerPlanes', xbins=4, xmin=-0.5, xmax=3.5)
     array.defineHistogram('trackY,trackX', title='Track in AFP station {0};x [mm];y [mm]', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
     array.defineHistogram('lb,clustersPerStation', title ='Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerStationFront', title ='(Front) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerStationEnd', title ='(End) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerStationMiddle', title ='(Middle) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
 
-    arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
+    arrayOneList = helper.addArray([stationList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
     arrayOneList.defineHistogram('barInTrainID,trainID', title='ToF hit bar vs train {0};barInTrainID;trainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
-
+    
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
     
@@ -86,9 +87,10 @@ if __name__=='__main__':
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
-    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000001.xAOD.root']
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
+
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput54-test.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput56-337176-efficiency.root'
     
     ConfigFlags.lock()
 
@@ -104,6 +106,6 @@ if __name__=='__main__':
     from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
     cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
-    cfg.run(50000)
+    cfg.run(1000)
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index bc42635bc766..895c0ec4fada 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -49,6 +49,8 @@
 	std::vector<int> middleBCIDsVector;
 	std::vector<int> endBCIDsVector;
 	
+	unsigned int efficiencyHistogramCounter=0;
+	
 	bool isInListVector(const int bcid, const std::vector<int>&arr)
 	{
 		return std::find_if(arr.begin(),arr.end(),[&bcid](const int& ele){return ele==bcid;})!= arr.end();
@@ -70,8 +72,8 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 
 	using namespace Monitored;
 
-	m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
-	m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
+	m_StationPlaneGroup = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
+	m_StationGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
 
 
 	// We must declare to the framework in initialize what SG objects we are going to use:
@@ -124,7 +126,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	// Declare the quantities which should be monitored:
 	auto lb = Monitored::Scalar<int>("lb", 0);
 	auto muPerBCID = Monitored::Scalar<float>("muPerBCID", 0.0);
-	auto run = Monitored::Scalar<int>("run",0);
+	//auto run = Monitored::Scalar<int>("run",0);
 	auto weight = Monitored::Scalar<float>("weight", 1.0);
 
 	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
@@ -143,6 +145,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	auto layerEfficiency = Monitored::Scalar<float>("layerEfficiency", 0.0);
 	auto layerNumber = Monitored::Scalar<int>("layerNumber", 0);
 	
+	auto planeHits = Monitored::Scalar<int>("planeHits", 0);
+	auto planeHitsAll = Monitored::Scalar<int>("planeHitsAll", 0);
+	
 	
 	lb = GetEventInfo(ctx)->lumiBlock();
 	muPerBCID = lbAverageInteractionsPerCrossing(ctx);
@@ -165,7 +170,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	nSiHits = afpHitContainer->size();
 	fill("AFPSiLayerTool", lb, nSiHits);
 
-
 	for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
 	{
 		lb = GetEventInfo(ctx)->lumiBlock();
@@ -175,10 +179,15 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 		
 		if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
 		{
-			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
-			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
-			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
-			fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
+			fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
+			fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
+			fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
+			fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
+			
+			planeHits = hitsItr->pixelLayerID();
+			fill(m_tools[m_StationGroup.at(m_stationnames.at(hitsItr->stationID()))], planeHits);
+			planeHitsAll = (hitsItr->stationID())*4+hitsItr->pixelLayerID();
+			fill("AFPSiLayerTool", planeHitsAll);
 			
 		}
 		else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
@@ -193,7 +202,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	{
 		trackX = track.x;
 		trackY = track.y;
-		fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackY, trackX);
+		fill(m_tools[m_StationGroup.at(m_stationnames.at(track.station))], trackY, trackX);
 	}
 
 	// Cluster histograms 
@@ -201,7 +210,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	{
 		clusterX = cluster.x;
 		clusterY = cluster.y;
-		fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX);
+		fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX);
 	}
 	
 	// Synch histograms:
@@ -249,25 +258,25 @@ void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb,
 				{
 					auto clustersPerStation = Monitored::Scalar<float>("clustersPerStation", 0.0);
 					clustersPerStation = clustersPerStationFloat;
-					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
+					fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
 				}
 				else if (histogramType == 'F')
 				{
 					auto clustersPerStationFront = Monitored::Scalar<float>("clustersPerStationFront", 0.0);
 					clustersPerStationFront = clustersPerStationFloat;
-					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationFront);
+					fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lb, clustersPerStationFront);
 				}
 				else if (histogramType == 'M')
 				{
 					auto clustersPerStationMiddle = Monitored::Scalar<float>("clustersPerStationMiddle", 0.0);
 					clustersPerStationMiddle = clustersPerStationFloat;
-					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationMiddle);
+					fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lb, clustersPerStationMiddle);
 				}
 				else if (histogramType == 'E')
 				{
 					auto clustersPerStationEnd = Monitored::Scalar<float>("clustersPerStationEnd", 0.0);
 					clustersPerStationEnd = clustersPerStationFloat;
-					fill(m_tools[m_TrackGroup.at(m_stationnames.at(i))], lb, clustersPerStationEnd);
+					fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lb, clustersPerStationEnd);
 				}
 			}
 			previouslbStationA=lb;
@@ -309,25 +318,25 @@ void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, i
 					{
 						auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 0.0);
 						clustersPerPlane = clustersPerPlaneFloat;
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
+						fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
 					}
 					else if(histogramType == 'F')
 					{
 						auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
 						clustersPerPlaneFront = clustersPerPlaneFloat;
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
+						fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
 					}
 					else if(histogramType == 'M')
 					{
 						auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
 						clustersPerPlaneMiddle = clustersPerPlaneFloat;
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
+						fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
 					}
 					else if(histogramType == 'E')
 					{
 						auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
 						clustersPerPlaneEnd = clustersPerPlaneFloat;
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
+						fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
 					}
 				}
 			}
@@ -347,3 +356,4 @@ void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, i
 	}
 }
 
+
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index cde7c1fcce37..aa5b51fff544 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -66,6 +66,9 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	{
 		trainID = hitsItr->trainID();
 		barInTrainID = hitsItr->barInTrainID();
+		
+		std::cout << "\t\t\tTrainID: " << trainID << "\n";
+		std::cout << "\t\t\tBarInTrainID: " << barInTrainID << "\n";
 
 		if(hitsItr->isSideA())
 		{
-- 
GitLab


From 77f3c503156d9a524be56e074528b0a117011a67 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Fri, 18 Sep 2020 10:58:29 +0000
Subject: [PATCH 223/422] Fix/improve Trigger ART timeout handling

Fix: decode bytes from subprocess.check_output to string
Improvements:
* drop LCG96 workaround
* catch exception when killing process or producing backtrace
---
 .../TrigValTools/bin/check_log.py             |  4 +---
 .../TrigValTools/bin/messageCounter.py        |  8 +++----
 .../TrigValTools/bin/runTrigART.py            |  3 +--
 .../TrigValTools/bin/runTrigCI.py             |  3 +--
 .../TrigValTools/bin/trig-test-json.py        |  3 +--
 .../python/TrigValSteering/CheckSteps.py      | 16 ++++++--------
 .../python/TrigValSteering/Step.py            | 21 ++++++++++---------
 7 files changed, 24 insertions(+), 34 deletions(-)

diff --git a/Trigger/TrigValidation/TrigValTools/bin/check_log.py b/Trigger/TrigValidation/TrigValTools/bin/check_log.py
index 75e21bf84d8b..7d720c44e5a8 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/check_log.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/check_log.py
@@ -6,7 +6,6 @@ import re
 import argparse
 import sys
 import os
-import six
 
 desc = 'Tool to check for error messages in a log file. By default ERROR, FATAL \
   and CRITICAL messages are considered. The config file may be used to \
@@ -131,8 +130,7 @@ def scanLogfile():
     msgLevels = re.compile('|'.join(pattern))
     igLevels = re.compile('|'.join(ignorePattern))
     logFileAddress = args.logfile
-    encargs = {} if six.PY2 else {'encoding' : 'utf-8'}
-    with open(logFileAddress,'r',**encargs) as logFile:
+    with open(logFileAddress,'r', encoding='utf-8') as logFile:
         tracing = False
         for line in logFile:
             #Tracing only makes sense for errors
diff --git a/Trigger/TrigValidation/TrigValTools/bin/messageCounter.py b/Trigger/TrigValidation/TrigValTools/bin/messageCounter.py
index 44148ce9c9ce..69a28999024b 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/messageCounter.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/messageCounter.py
@@ -16,7 +16,6 @@ import logging
 import argparse
 import json
 from collections import OrderedDict
-import six
 
 
 default_ignore_patterns = [
@@ -106,11 +105,11 @@ def make_summary(result):
 
 def print_result(summary, full_result, print_messages=False):
     summary_str = 'Found the following number of messages:\n'
-    for p, n in six.iteritems(summary):
+    for p, n in summary.items():
         summary_str += '{:8d} {:s} messages\n'.format(n, p)
     logging.info(summary_str)
     if print_messages:
-        for p, lines in six.iteritems(full_result):
+        for p, lines in full_result.items():
             logging.info('##### The following %s messages were found #####', p)
             for line in lines:
                 print(line, end='')  # noqa: ATL901
@@ -144,8 +143,7 @@ def main():
             logging.error('Cannot open file %s, skipping', fname)
             continue
         logging.info('Analysing file %s', fname)
-        encargs = {} if six.PY2 else {'encoding' : 'utf-8'}
-        with open(fname, **encargs) as f:
+        with open(fname, encoding='utf-8') as f:
             messages = extract_messages(f, start, end, ignore)
         summary = make_summary(messages)
         print_result(summary, messages, args.printMessages)
diff --git a/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py b/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py
index cb1562d3eefa..fccc693b67e1 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py
@@ -10,7 +10,6 @@ import argparse
 import shutil
 import subprocess
 import json
-import six
 from TrigValTools.TrigARTUtils import package_prefix, find_scripts, remember_cwd
 
 
@@ -121,7 +120,7 @@ def analyse_results(all_test_results):
     max_len_col1 = len(max(table.keys(), key=len))
     max_len_col2 = len(max(table.values(), key=len))
     logging.info('-'*(max_len_col1+max_len_col2+7))
-    for k, v in six.iteritems(table):
+    for k, v in table.items():
         logging.info('| {col1:<{width1}} | {col2:<{width2}} |'.format(
             col1=k, width1=max_len_col1,
             col2=v, width2=max_len_col2))
diff --git a/Trigger/TrigValidation/TrigValTools/bin/runTrigCI.py b/Trigger/TrigValidation/TrigValTools/bin/runTrigCI.py
index ddb93bbcdbb2..fb8ac6167d20 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/runTrigCI.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/runTrigCI.py
@@ -11,7 +11,6 @@ import logging
 import argparse
 import subprocess
 import errno
-from six import iteritems
 from collections import OrderedDict
 from TrigValTools.TrigARTUtils import find_scripts, remember_cwd
 
@@ -117,7 +116,7 @@ def main():
     logging.info('RESULTS SUMMARY:')
     logging.info('='*(max_name_len+11))
     final_code = 0
-    for script, result in iteritems(results):
+    for script, result in results.items():
         logging.info('| %s : %4d |', '{:{width}s}'.format(script, width=max_name_len), result)
         if abs(result) > final_code:
             final_code = abs(result)
diff --git a/Trigger/TrigValidation/TrigValTools/bin/trig-test-json.py b/Trigger/TrigValidation/TrigValTools/bin/trig-test-json.py
index ec1b3e6a8531..75d2d79cd4d0 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/trig-test-json.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/trig-test-json.py
@@ -12,7 +12,6 @@ import re
 import sys
 import logging
 import os
-import six
 from collections import OrderedDict
 from TrigValTools.TrigARTUtils import first_existing_file, newest_file
 
@@ -84,7 +83,7 @@ def convert_to_megabytes(number, unit):
         "GB": 1024,
         'TB': 1024**2
     }
-    for unit_name, mult in six.iteritems(multipliers):
+    for unit_name, mult in multipliers.items():
         if unit_name == unit:
             return float(number)*mult
     logging.error("Unit conversion failed from {} to MB".format(unit))
diff --git a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py
index 4b7b19a736ec..02b2a8137303 100644
--- a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py
+++ b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py
@@ -10,7 +10,6 @@ import os
 import re
 import subprocess
 import json
-import six
 import glob
 
 from TrigValTools.TrigValSteering.Step import Step, get_step_from_list
@@ -147,9 +146,8 @@ class LogMergeStep(Step):
                 self.log_files.append(f)
 
     def merge_logs(self):
-        encargs = {} if six.PY2 else {'encoding' : 'utf-8'}
         try:
-            with open(self.merged_name, 'w', **encargs) as merged_file:
+            with open(self.merged_name, 'w', encoding='utf-8') as merged_file:
                 for log_name in self.log_files:
                     if not os.path.isfile(log_name):
                         if self.warn_if_missing:
@@ -157,7 +155,7 @@ class LogMergeStep(Step):
                             merged_file.write(
                                 '### WARNING Missing {} ###\n'.format(log_name))
                         continue
-                    with open(log_name, **encargs) as log_file:
+                    with open(log_name, encoding='utf-8') as log_file:
                         merged_file.write('### {} ###\n'.format(log_name))
                         for line in log_file:
                             merged_file.write(line)
@@ -305,11 +303,10 @@ class RegTestStep(RefComparisonStep):
         if not os.path.isfile(log_file):
             self.log.error('%s input file %s is missing', self.name, log_file)
             return False
-        encargs = {} if six.PY2 else {'encoding' : 'utf-8'}
-        with open(log_file, **encargs) as f_in:
+        with open(log_file, encoding='utf-8') as f_in:
             matches = re.findall('({}.*).*$'.format(self.regex),
                                  f_in.read(), re.MULTILINE)
-            with open(self.input_file, 'w', **encargs) as f_out:
+            with open(self.input_file, 'w', encoding='utf-8') as f_out:
                 for line in matches:
                     linestr = str(line[0]) if type(line) is tuple else line
                     f_out.write(linestr+'\n')
@@ -563,8 +560,7 @@ class ZeroCountsStep(Step):
                 self.name, input_file)
             return -1
         lines_checked = 0
-        encargs = {} if six.PY2 else {'encoding' : 'utf-8'}
-        with open(input_file, **encargs) as f_in:
+        with open(input_file, encoding='utf-8') as f_in:
             for line in f_in.readlines():
                 split_line = line.split()
                 lines_checked += 1
@@ -648,7 +644,7 @@ class MessageCountStep(Step):
                 self.log.warning('%s cannot open file %s', self.name, json_file)
             with open(json_file) as f:
                 summary = json.load(f)
-                for level, threshold in six.iteritems(self.thresholds):
+                for level, threshold in self.thresholds.items():
                     if summary[level] > threshold:
                         self.result += 1
                         self.log.info(
diff --git a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py
index 58bcaf906843..bdb5bf6a2f78 100644
--- a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py
+++ b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py
@@ -12,6 +12,7 @@ import signal
 import subprocess
 import time
 import re
+import psutil
 from enum import Enum
 from threading import Timer
 from TrigValTools.TrigValSteering.Common import get_logger, art_result, running_in_CI
@@ -86,24 +87,24 @@ class Step(object):
         where the first is filled with the backtrace by this function
         (it has to be a list to be mutable).
         '''
-        # Produce backtrace for the parent and all children
-
         try:
-            import psutil
+            # Produce backtrace for the parent and all children
             parent = psutil.Process(pid)
             backtrace = ''
             for proc in [parent] + parent.children(recursive=True):
                 backtrace += '\nTraceback for {} PID {}:\n'.format(proc.name(), proc.pid)
                 backtrace += subprocess.check_output('$ROOTSYS/etc/gdb-backtrace.sh {}'.format(proc.pid),
-                                                     stderr=subprocess.STDOUT, shell=True)
-        except ImportError:
-            # psutil is missing in LCG_96 python3
-            backtrace = 'psutil not available; no backtrace generated'
+                                                        stderr=subprocess.STDOUT, shell=True).decode('utf-8')
+            backtrace_list[0] = backtrace
 
-        backtrace_list[0] = backtrace
+            # Kill the process
+            os.killpg(pid, signal)
 
-        # Kill the process
-        os.killpg(pid, signal)
+        except Exception as e:
+            # This may happen e.g. if one of the processes finishes before we generate backtrace
+            msg = 'Caught exception while generating backtrace: ' + str(e)
+            backtrace_list[0] = msg
+            self.log.error(msg)
 
     def __execute_with_timeout(self, cmd, timeout_sec):
         '''
-- 
GitLab


From d884cc2958b17b982139de0032596a5e55379c41 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 18 Sep 2020 13:07:37 +0200
Subject: [PATCH 224/422] Number of events, run 337176

---
 .../Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 18272d8881c6..1fb883df508c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -106,6 +106,6 @@ if __name__=='__main__':
     from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
     cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
-    cfg.run(1000)
+    cfg.run(10000)
 
 
-- 
GitLab


From ef612109d6e2f050821d4239649e9ae203fd1b00 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Fri, 18 Sep 2020 13:14:52 +0200
Subject: [PATCH 225/422] Add HLTNav dynamic variables to EDM explicitly

---
 Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index 39c9ab60e897..9f920e8e1332 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -507,7 +507,10 @@ def addHLTNavigationToEDMList(edmList, allDecisions, hypoDecisions):
     for decisionCollection in allDecisions:
         dynamic = '.-' # Exclude dynamic
         if decisionCollection in hypoDecisions:
-            dynamic = '.' # Include dynamic
+            # Include dynamic
+            dynamic = '.remap_linkColIndices.remap_linkColKeys'
+            if 'PEBInfoWriter' in decisionCollection:
+                dynamic += '.PEBROBList.PEBSubDetList'
         typeName = 'xAOD::TrigCompositeContainer#{:s}'.format(decisionCollection)
         typeNameAux = 'xAOD::TrigCompositeAuxContainer#{:s}Aux{:s}'.format(decisionCollection, dynamic)
         edmList.extend([
-- 
GitLab


From 338a27ad0b5f5eccc5450e96f8a22346f5354c9b Mon Sep 17 00:00:00 2001
From: Joerg Stelzer <joerg.stelzer@cern.ch>
Date: Fri, 18 Sep 2020 11:18:44 +0000
Subject: [PATCH 226/422] Add script to copy the Run 2 MC TriggerDB to SQLite

This script is currently not installed. It will only be run by hand.
---
 .../TrigConfIO/scripts/AtlTriggerDBCopy.py    | 289 ++++++++++++++++++
 1 file changed, 289 insertions(+)
 create mode 100755 Trigger/TrigConfiguration/TrigConfIO/scripts/AtlTriggerDBCopy.py

diff --git a/Trigger/TrigConfiguration/TrigConfIO/scripts/AtlTriggerDBCopy.py b/Trigger/TrigConfiguration/TrigConfIO/scripts/AtlTriggerDBCopy.py
new file mode 100755
index 000000000000..0e84acaddab7
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/scripts/AtlTriggerDBCopy.py
@@ -0,0 +1,289 @@
+#!/usr/bin/env python
+
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
+# script to produce a one-to-one copy of the oracle Run 2 MC TriggerDB to sqlite
+
+from TrigConfIO.TriggerConfigAccessBase import ConfigDBLoader
+
+import sqlite3
+
+def parseCmdline():
+    import argparse
+    parser = argparse.ArgumentParser(prog = "AtlTriggerDBCopy.py")
+    parser.add_argument("-d", "--dbalias", dest="dbalias", help="TriggerDB connection alias for the source DB")
+    parser.add_argument("-c", "--create", dest="createfile", help="create sqlite db file")
+    parser.add_argument("-u", "--update", dest="updatefile", help="update sqlite db file")
+    parser.add_argument("-v", help="increase output verbosity", action="count", default=0)
+    args = parser.parse_args()
+    if not args.dbalias:
+        print("No source Trigger DB specified")
+        parser.print_help()
+        return None
+    if not args.createfile and not args.updatefile:
+        print("No sqlite target file specified (use create or update)")
+        parser.print_help()
+        return None
+    return args
+
+# class to handle the oracle db connection
+# it uses the CORAL authentication method implemented in the TrigConfIO.TriggerConfigAccessBase (ConfigDBLoader)
+class DBConnection:
+    def __init__(self, dbalias):
+        self.dbalias = dbalias
+        self.connection = None
+        self.schema = None
+
+    def __enter__(self):
+        credentials = ConfigDBLoader.getConnectionParameters(self.dbalias)
+        self.connection, self.schema = ConfigDBLoader.getConnection(credentials)
+        print(f"Opening connection to {self.dbalias}")
+        return self
+
+    def __exit__(self, type, value, traceback):
+        self.connection.close()
+        print(f"Closing connection to {self.dbalias}" )
+
+    def cursor(self):
+        return self.connection.cursor()
+
+    def schema(self):
+        return self.schema
+
+# class to handle the insertion of schema and data on the sqlite side
+class SQLiteInserter:
+
+    def __init__(self, filename = None):
+        self.filename = filename
+        self.connection = None
+        self.activeTransaction = False
+        self.insCountInTrans = 0
+        self.maxInsertsPerTransaction = 1000
+        if self.filename is None:
+            print("Not connected to an output file, will print the insert commands instead")
+        import os
+        if filename and os.path.exists(filename):
+            print(f"File or path {filename} exists already, will not overwrite it and only print the insert commands instead")
+            self.filename = None
+        if self.filename is not None:
+            self.connection = sqlite3.connect(self.filename)
+            self.cursor = self.connection.cursor()
+    def commit(self):
+        if self.activeTransaction:
+            self.cursor.execute('COMMIT')
+            self.activeTransaction = False
+            self.insCountInTrans = 0
+
+    def insert(self, statement, data):
+        if self.connection is None:
+            return            
+        if not self.activeTransaction:
+            self.cursor.execute('BEGIN TRANSACTION')
+            self.activeTransaction = True
+        self.cursor.execute(statement, data)
+        self.insCountInTrans += 1
+        if self.insCountInTrans==self.maxInsertsPerTransaction:
+            self.commit()
+
+    def insertBulk(self, statement, data):
+        if self.connection is None:
+            return
+        self.cursor.executemany(statement, iter(data))
+        self.connection.commit()
+
+    def createSchema(self, creationFileName):
+        if self.connection is None:
+            return
+        with open(creationFileName) as fh:
+            print("Creating sqlite db %s from %s" % (self.filename, creationFileName) )
+            self.cursor.executescript( fh.read() )
+
+
+# class to handle the extraction of schema and data on the oracle side
+class OracleExporter:
+
+    def __init__(self, connection):
+        self.connection = connection
+        self.primaryKeys = None
+        self.foreignKeys = None
+        self.tables = None
+        self.ignoreTablesR2 = [ 'TT_WRITELOCK', 'HLT_SMT_TO_HRE', 'HLT_PARAMETER', 'HLT_RELEASE', 'TRIGGER_LOG',
+                                'DBCOPY_SOURCE_DATABASE', 'HLT_RULE_SET', 'TEMP', 'HLT_RULE_PARAMETER', 'HLT_RULE_COMPONENT',
+                                'ACTIVE_MASTERS', 'HLT_SETUP', 'TT_USERS', 'HLT_RULE', "HLT_HRC_TO_HRP", "HLT_HRE_TO_HRS", 
+                                "HLT_HRS_TO_HRU", "HLT_HRU_TO_HRC", "HLT_PRESCALE_SET_ALIAS", "HLT_PRESCALE_SET_COLL",
+                                "PRESCALE_SET_ALIAS", "TRIGGER_ALIAS", "L1_PRESCALE_SET_ALIAS", "L1_PITS", "L1_CALO_SIN_COS",
+                                "L1_CI_TO_CSC", "L1_DEAD_TIME", "L1_JET_INPUT", "L1_MUON_THRESHOLD_SET", "HLT_TRIGGER_TYPE",
+                                "L1_CTP_FILES", "L1_CTP_SMX" ]
+
+    def getTables(self, isRun2MC = True):
+        if self.tables:
+            return self.tables
+        query_ListAllTables = "SELECT table_name FROM all_tables WHERE owner=:SCHEMA"
+        data = { "SCHEMA" : self.connection.schema }
+        result = self.executeQuery(query_ListAllTables, data)
+        self.tables = [x[0] for x in result]
+        if isRun2MC:
+            for x in self.ignoreTablesR2:
+                self.tables.remove(x)
+        return self.tables
+
+    def executeQuery(self, query, data = {}):
+        cursor = self.connection.cursor()
+        cursor.arraysize = 1000
+        cursor.execute( query, **data )
+        return cursor        
+
+    def tableSize(self,tableName):
+        query_TableSize = "SELECT COUNT(*) FROM {schema}.{tableName}"
+        qdict = { "schema" : self.connection.schema, "tableName" : tableName }
+        result = self.executeQuery( query_TableSize.format(**qdict) )
+        row = result.fetchone()
+        return row[0]
+
+    def columnNames(self,tableName):
+        query_ColumnNames = "SELECT column_name, data_type FROM sys.all_tab_columns WHERE owner = :SCHEMA AND table_name = :TABLE_NAME ORDER BY column_id"
+        data = { "SCHEMA" : self.connection.schema, "TABLE_NAME" : tableName }
+        result = self.executeQuery( query = query_ColumnNames, data = data )
+        colNames, colTypes = zip(*result)
+        return colNames, colTypes
+
+    def getPrimaryKeys(self):
+        if self.primaryKeys is not None:
+            return self.primaryKeys
+        print("retrieving primary key constraints from Oracle")
+        query_PrimaryKeys = """
+        SELECT table_name, column_name, position FROM sys.all_cons_columns WHERE owner = :SCHEMA AND constraint_name in 
+        (SELECT constraint_name FROM sys.all_constraints WHERE owner = :SCHEMA AND constraint_type='P') 
+        ORDER BY table_name, position
+        """
+        data = { "SCHEMA" : self.connection.schema }
+        pk = {}
+        result = self.executeQuery( query = query_PrimaryKeys, data = data )
+        for table_name, column_name, _ in result:
+            if table_name not in pk:
+                pk[table_name] = []
+            pk[table_name] += [ column_name ]
+        self.primaryKeys = pk
+        return self.primaryKeys
+
+    def getForeignKeys(self):
+        if self.foreignKeys is not None:
+            return self.foreignKeys
+        print("retrieving foreign key constraints from Oracle")
+        query_ForeignKeys = """
+        SELECT c.table_name, c.constraint_name, a.column_name, c.r_constraint_name, r.table_name, r.column_name 
+        FROM sys.all_constraints c
+        INNER JOIN
+        sys.all_cons_columns a
+        on (c.constraint_type='R' and c.constraint_name = a.constraint_name and c.owner = :SCHEMA and a.owner = :SCHEMA)
+        INNER JOIN
+        sys.all_cons_columns r
+        on (c.r_constraint_name = r.constraint_name and r.owner = :SCHEMA)
+        """        
+        data = { "SCHEMA" : self.connection.schema }
+        fk = {}
+        result = self.executeQuery( query = query_ForeignKeys, data = data )
+        for table, _, fkcol, _, rtable, rcol in result:
+            if table not in fk:
+                fk[table] = []
+            fk[table] += [ { "col" : fkcol, "rtab" : rtable, "rcol" : rcol } ]
+        self.foreignKeys = fk
+        return self.foreignKeys
+
+    def sqliteType(self, oraType):
+        if oraType.startswith("TIMESTAMP"):
+            return "TEXT"
+        d = { "VARCHAR2" : "TEXT",
+              "CHAR" : "TEXT",
+              "NUMBER" : "INTEGER",
+              "CLOB" : "TEXT"
+          }
+        return d[oraType]
+
+    def tableCreationCommand(self, tableName, primaryKeys, foreignKeys):
+        colNames, colTypes = self.columnNames(tableName)
+        lines = []
+        for colName, colType in zip(colNames,colTypes):
+            lines.append( "%s %s" % (colName, self.sqliteType(colType)) )
+        lines.append( "PRIMARY KEY (%s)" % ",".join(primaryKeys) )
+        for fk in foreignKeys:
+            lines.append( "FOREIGN KEY (%s) REFERENCES %s (%s)" % (fk["col"], fk["rtab"], fk["rcol"]) )
+        creationCommand = f"CREATE TABLE IF NOT EXISTS {tableName} (\n    "
+        creationCommand += ",\n    ".join(lines)
+        creationCommand += "\n);\n"
+        return creationCommand
+
+    def extractSchema(self, creationFileName, isRun2MC = True):
+        fk = self.getForeignKeys()
+        pk = self.getPrimaryKeys()
+        with open(creationFileName, "w") as fh:
+            print("Creating schema file for sqlite: %s" % creationFileName)
+            for tableName in self.getTables(isRun2MC):
+                print(self.tableCreationCommand(tableName, pk[tableName], fk[tableName] if tableName in fk else []), file = fh)
+
+    def copyTable(self, tableName, sqliteInserter, size):
+        # build insert statement
+        schema = self.connection.schema
+        colNames,_ = self.columnNames(tableName)
+        colNameList = ",".join(colNames)
+        bindVarList = ",".join(len(colNames)*["?"])
+        insertStatement = f"INSERT INTO {tableName} ({colNameList}) VALUES ({bindVarList})"
+        # select entries from oracle
+        selectQuery = f"SELECT {colNameList} FROM {schema}.{tableName}"
+        #print(selectQuery)
+        result = self.executeQuery( selectQuery )
+        useBulkInsert = True
+        if useBulkInsert:
+            sqliteInserter.insertBulk(insertStatement, result)
+        else:
+            c = 0
+            for data in result:
+                if c%10000==0:
+                    print("%i / %i" % (c, size))
+                c+=1
+                sqliteInserter.insert(insertStatement, data)
+                if c==size:
+                    break # just doing some timing measurements
+        sqliteInserter.commit()
+
+
+def main():
+    args = parseCmdline()
+    if args is None:
+        return 1
+
+    # instantiate the sqlite inserter with the sqlite db filename
+    sqliteInserter = SQLiteInserter(args.createfile)
+
+    # connect to oracle and do the work
+    with DBConnection(args.dbalias) as oraConn:
+        oraExp = OracleExporter(oraConn)
+
+        # extract the schema into a temporary file and create it on the sqlite side
+        tempTableCreationFileName = "tmpCreateTablesSQLite.sql"
+        oraExp.extractSchema(tempTableCreationFileName)
+        sqliteInserter.createSchema(tempTableCreationFileName)
+
+        # collect some info about the size, to not run completely blind
+        entries = {}
+        for tableName in oraExp.getTables():
+            entries[tableName] = oraExp.tableSize(tableName)
+            print("  table %s has %i entries" % (tableName, entries[tableName]) )
+        totalEntries = sum(entries.values())
+        print("\nTotal number of entries: %i" %totalEntries)
+
+        # copy the data one table at the time
+        print("Start copying data")
+        copiedEntries = 0
+        for tableName in oraExp.getTables():            
+            print("Copying table %s" % tableName, end = '', flush=True)
+            oraExp.copyTable(tableName, sqliteInserter, entries[tableName])
+            copiedEntries += entries[tableName]
+            print(" => done %i / %i (%f%%)" % (copiedEntries, totalEntries, 100 * copiedEntries/totalEntries))
+
+    sqliteInserter.connection.close()
+
+
+if __name__ == "__main__":
+    import sys
+    sys.exit(main())
-- 
GitLab


From 80296f36d0b6243a0b57f7c510f9c5f6a94b7697 Mon Sep 17 00:00:00 2001
From: Aleksandra Poreba <aleksandra.poreba@cern.ch>
Date: Fri, 18 Sep 2020 11:52:25 +0000
Subject: [PATCH 227/422] Add dynamic lookup in AlgToChainTool

---
 .../TrigConfigSvc/src/AlgToChainTool.cxx      |  59 ---------
 .../src/components/TrigConfigSvc_entries.cxx  |   5 +-
 .../TrigCompositeUtils/CMakeLists.txt         |   8 +-
 .../Root/AlgToChainTool.cxx                   | 123 ++++++++++++++++++
 .../TrigCompositeUtils}/AlgToChainTool.h      |  23 +++-
 .../components/TrigCompositeUtils_entries.cxx |   3 +
 6 files changed, 151 insertions(+), 70 deletions(-)
 delete mode 100644 Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.cxx
 create mode 100644 Trigger/TrigSteer/TrigCompositeUtils/Root/AlgToChainTool.cxx
 rename Trigger/{TrigConfiguration/TrigConfigSvc/src => TrigSteer/TrigCompositeUtils/TrigCompositeUtils}/AlgToChainTool.h (57%)
 create mode 100644 Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/components/TrigCompositeUtils_entries.cxx

diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.cxx
deleted file mode 100644
index cb9c3b9eb272..000000000000
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.cxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "AlgToChainTool.h"
-
-TrigConf::AlgToChainTool::AlgToChainTool(const std::string& type,
-                        const std::string& name,
-                        const IInterface* parent)
-    : AthAlgTool (type, name, parent) 
-    {}
-
-
-TrigConf::AlgToChainTool::~AlgToChainTool() {}
-
-
-StatusCode TrigConf::AlgToChainTool::initialize() {
-    ATH_CHECK( m_HLTMenuKey.initialize() );
-
-    return StatusCode::SUCCESS;
-}
-
-
-StatusCode TrigConf::AlgToChainTool::start() {
-    SG::ReadHandle<TrigConf::HLTMenu>  hltMenuHandle = SG::makeHandle( m_HLTMenuKey );
-    ATH_CHECK( hltMenuHandle.isValid() );
-
-    // fill the maps
-    for ( const TrigConf::Chain& chain : *hltMenuHandle ) {
-        for ( const std::string& sequencer : chain.sequencers() ) {
-            m_sequencerToChainMap[sequencer].push_back(chain.name());
-        }
-    }
-
-    for ( const auto& sequencer : hltMenuHandle->sequencers() ) {
-        for ( const std::string& algorithm : sequencer.second ) {
-            // save just second part of algorithm ex. RoRSeqFilter/FFastCaloElectron -> FFastCaloElectron
-            m_algToSequencersMap[algorithm.substr(algorithm.find('/') + 1)]
-                .push_back(sequencer.first);
-        }
-    }
-
-    return StatusCode::SUCCESS;
-}
-
-
-std::set<std::string> TrigConf::AlgToChainTool::getChainsForAlg(const std::string& algorithmName) const {
-    std::set<std::string> result;
-
-    try {
-        for ( const std::string& sequencer : m_algToSequencersMap.at(algorithmName) ) {
-            result.insert(m_sequencerToChainMap.at(sequencer).begin(), m_sequencerToChainMap.at(sequencer).end());
-        }
-    } catch ( const std::out_of_range & ex ) {
-        ATH_MSG_ERROR ( algorithmName << " is not part of the menu!" );
-    }
-
-    return result;
-}
\ No newline at end of file
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx
index bdf1972f66a5..2e708b1b4c42 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx
@@ -8,7 +8,6 @@
 #include "../L1PrescaleCondAlg.h"
 #include "../HLTPrescaleCondAlg.h"
 
-#include "../AlgToChainTool.h"
 
 DECLARE_COMPONENT( TrigConf::L1TopoConfigSvc )
 DECLARE_COMPONENT( TrigConf::LVL1ConfigSvc )
@@ -18,6 +17,4 @@ DECLARE_COMPONENT( TrigConf::DSConfigSvc )
 DECLARE_COMPONENT( TrigConf::TrigConfigSvc )
 
 DECLARE_COMPONENT( TrigConf::L1PrescaleCondAlg )
-DECLARE_COMPONENT( TrigConf::HLTPrescaleCondAlg )
-
-DECLARE_COMPONENT( TrigConf::AlgToChainTool )
\ No newline at end of file
+DECLARE_COMPONENT( TrigConf::HLTPrescaleCondAlg )
\ No newline at end of file
diff --git a/Trigger/TrigSteer/TrigCompositeUtils/CMakeLists.txt b/Trigger/TrigSteer/TrigCompositeUtils/CMakeLists.txt
index 889df3253c32..dca99bc423be 100644
--- a/Trigger/TrigSteer/TrigCompositeUtils/CMakeLists.txt
+++ b/Trigger/TrigSteer/TrigCompositeUtils/CMakeLists.txt
@@ -6,7 +6,7 @@ atlas_subdir( TrigCompositeUtils )
 # Set up the (non-)standalone compilation.
 set( extra_libs )
 if( NOT XAOD_STANDALONE )
-  set( extra_libs GaudiKernel AthenaKernel AthLinks StoreGateLib AthContainers )
+  set( extra_libs GaudiKernel AthenaKernel AthLinks StoreGateLib AthContainers AthenaBaseComps TrigConfData )
 endif()
 
 # Add the package's dual use library.
@@ -15,6 +15,12 @@ atlas_add_library( TrigCompositeUtilsLib
   PUBLIC_HEADERS TrigCompositeUtils
   LINK_LIBRARIES TrigConfHLTUtilsLib CxxUtils AsgMessagingLib AsgDataHandlesLib AsgTools TrigDecisionInterface xAODBase xAODTrigger ${extra_libs}  )
 
+if( NOT XAOD_STANDALONE )
+  atlas_add_component( TrigCompositeUtils
+    TrigCompositeUtils/components/*.cxx
+    LINK_LIBRARIES TrigCompositeUtilsLib )
+endif()
+
 # Install files from the package.
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 
diff --git a/Trigger/TrigSteer/TrigCompositeUtils/Root/AlgToChainTool.cxx b/Trigger/TrigSteer/TrigCompositeUtils/Root/AlgToChainTool.cxx
new file mode 100644
index 000000000000..91c6e8acd60a
--- /dev/null
+++ b/Trigger/TrigSteer/TrigCompositeUtils/Root/AlgToChainTool.cxx
@@ -0,0 +1,123 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigCompositeUtils/AlgToChainTool.h"
+
+#ifndef XAOD_STANDALONE
+
+TrigCompositeUtils::AlgToChainTool::AlgToChainTool(const std::string& type,
+                        const std::string& name,
+                        const IInterface* parent)
+    : AthAlgTool (type, name, parent) 
+    {}
+
+
+TrigCompositeUtils::AlgToChainTool::~AlgToChainTool() {}
+
+
+StatusCode TrigCompositeUtils::AlgToChainTool::initialize() {
+    ATH_CHECK( m_HLTMenuKey.initialize() );
+
+    return StatusCode::SUCCESS;
+}
+
+
+StatusCode TrigCompositeUtils::AlgToChainTool::start() {
+    SG::ReadHandle<TrigConf::HLTMenu>  hltMenuHandle = SG::makeHandle( m_HLTMenuKey );
+    ATH_CHECK( hltMenuHandle.isValid() );
+
+    // Fill the maps
+    for ( const TrigConf::Chain& chain : *hltMenuHandle ) {
+        for ( const std::string& sequencer : chain.sequencers() ) {
+            m_sequencerToChainMap[sequencer].push_back(chain.name());
+        }
+    }
+
+    for ( const auto& sequencer : hltMenuHandle->sequencers() ) {
+        for ( const std::string& algorithm : sequencer.second ) {
+            // Save just second part of algorithm ex. RoRSeqFilter/FFastCaloElectron -> FFastCaloElectron
+            m_algToSequencersMap[algorithm.substr(algorithm.find('/') + 1)]
+                .push_back(sequencer.first);
+        }
+    }
+
+    return StatusCode::SUCCESS;
+}
+
+
+std::set<std::string> TrigCompositeUtils::AlgToChainTool::getChainsForAlg(const std::string& algorithmName) const {
+    std::set<std::string> result;
+
+    try {
+        for ( const std::string& sequencer : m_algToSequencersMap.at(algorithmName) ) {
+            result.insert(m_sequencerToChainMap.at(sequencer).begin(), m_sequencerToChainMap.at(sequencer).end());
+        }
+    } catch ( const std::out_of_range & ex ) {
+        ATH_MSG_ERROR ( algorithmName << " is not part of the menu!" );
+    }
+
+    return result;
+}
+
+std::set<std::string> TrigCompositeUtils::AlgToChainTool::getActiveChainsForAlg(const std::string& algorithmName, const EventContext& context) const {
+    std::set<std::string> result;
+
+    std::set<std::string> allActiveChains = retrieveActiveChains(context);
+    std::set<std::string> allAlgChains = getChainsForAlg(algorithmName);
+
+    // Save the chains that are used by selected algorithm and active
+    std::set_intersection(allAlgChains.begin(), allAlgChains.end(),
+        allActiveChains.begin(), allActiveChains.end(),
+        std::inserter(result, result.begin()));
+
+    return result;
+}
+
+std::set<std::string> TrigCompositeUtils::AlgToChainTool::retrieveActiveChains(const EventContext& context) const {
+    std::set<TrigCompositeUtils::DecisionID> activeChainsID;
+
+    // Retrieve EventStore and keys
+    IProxyDict* storeProxy = Atlas::getExtendedEventContext(context).proxy();
+    SmartIF<SGImplSvc> eventStore (storeProxy);
+
+    std::vector<std::string> keys;
+    eventStore->keys(static_cast<CLID>( ClassID_traits<TrigCompositeUtils::DecisionContainer>::ID() ), keys);
+
+    // Retrieve active chains
+    std::set<std::string> activeChains;
+
+    for ( const std::string& key : keys ) {
+        if( key.find("HLTNav") != 0 || key == "HLTNav_Summary" ) {
+            continue;
+        }
+
+        SG::DataProxy* dp = eventStore->proxy(
+            static_cast<CLID>(ClassID_traits<TrigCompositeUtils::DecisionContainer>::ID()), key, true);
+
+        SG::ReadHandle<TrigCompositeUtils::DecisionContainer> dc (dp);
+        if ( !dc.isValid() ) {            
+            ATH_MSG_WARNING("Failed to retrieve " << key << " from event store.");            
+            continue;        
+        }
+
+        for ( const TrigCompositeUtils::Decision* d : *dc ) {
+            TrigCompositeUtils::DecisionIDContainer chainsID;
+            TrigCompositeUtils::decisionIDs( d, chainsID );
+
+            // Save the active chains IDs
+            activeChainsID.insert( chainsID.begin(), chainsID.end() );
+        } 
+    }
+
+    // Convert DecisionID to names
+    std::set<std::string> activeChainsNames;
+
+    for ( const TrigCompositeUtils::DecisionID& id : activeChainsID ) {
+        activeChainsNames.insert( HLT::Identifier(id).name() );
+    }
+
+    return activeChainsNames;
+}
+
+#endif // XAOD_STANDALONE
\ No newline at end of file
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.h b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/AlgToChainTool.h
similarity index 57%
rename from Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.h
rename to Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/AlgToChainTool.h
index de01f55feb69..e305a8020193 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.h
+++ b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/AlgToChainTool.h
@@ -2,8 +2,10 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef TRIGCONFDATA_ALGTOCHAINTOOL_H
-#define TRIGCONFDATA_ALGTOCHAINTOOL_H
+#ifndef TrigCompositeUtils_AlgToChainTool_h
+#define TrigCompositeUtils_AlgToChainTool_h
+
+#ifndef XAOD_STANDALONE
 
 #include <string>
 #include <set>
@@ -11,13 +13,14 @@
 #include <map>
 
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "TrigCompositeUtils/TrigCompositeUtils.h"
 #include "TrigConfData/HLTMenu.h"
 
 
-namespace TrigConf {
+namespace TrigCompositeUtils {
 
   /** @class AlgToChainTool
-   *  @brief Provide the reverse mapping: algorithms to set fo chain names
+   *  @brief Provide the reverse mapping: algorithm name to set of chain names
    **/
 
   class AlgToChainTool : public AthAlgTool {
@@ -29,14 +32,22 @@ namespace TrigConf {
 
       virtual StatusCode start() override;
 
-      /// Request set of chains for given algorithm
+      /// Request set of chains for given algorithm - static lookup
       std::set<std::string> getChainsForAlg(const std::string& algorithmName) const;
 
+      /// Request set of active chains for given algorithm - dynamic lookup
+      std::set<std::string> getActiveChainsForAlg(const std::string& algorithmName, const EventContext& context) const;
+
   private:
+      std::set<std::string> retrieveActiveChains(const EventContext& context) const;
+
       SG::ReadHandleKey<TrigConf::HLTMenu> m_HLTMenuKey{ this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu" };
+
       std::map<std::string, std::vector<std::string>> m_sequencerToChainMap;
       std::map<std::string, std::vector<std::string>> m_algToSequencersMap;
   };
 }
 
-#endif // TRIGCONFDATA_ALGTOCHAINTOOL_H
+#endif // XAOD_STANDALONE
+
+#endif // TrigCompositeUtils_AlgToChainTool_h
\ No newline at end of file
diff --git a/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/components/TrigCompositeUtils_entries.cxx b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/components/TrigCompositeUtils_entries.cxx
new file mode 100644
index 000000000000..67816acc2ce4
--- /dev/null
+++ b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/components/TrigCompositeUtils_entries.cxx
@@ -0,0 +1,3 @@
+#include "../AlgToChainTool.h"
+
+DECLARE_COMPONENT( TrigCompositeUtils::AlgToChainTool )
\ No newline at end of file
-- 
GitLab


From e87ac1ae5711048b7b98af64ab829dfed0bb4794 Mon Sep 17 00:00:00 2001
From: Katherine Pachal <katepachal@gmail.com>
Date: Fri, 18 Sep 2020 11:55:52 +0000
Subject: [PATCH 228/422] Add NN access for pixel clustering via lwtnn to r22

---
 .../InDetConfig/python/InDetConfigFlags.py    |   1 +
 .../python/InDetJobProperties.py              |   7 +
 .../InDetRecExample/python/TrackingCommon.py  |  48 ++++-
 .../share/InDetRecConditionsAccess.py         |   3 +-
 .../SiClusterizationTool/CMakeLists.txt       |  18 +-
 .../SiClusterizationTool/LWTNNCollection.h    |  30 +++
 .../NnClusterizationFactory.h                 |  47 +++-
 .../SiClusterizationTool/src/LWTNNCondAlg.cxx | 182 ++++++++++++++++
 .../SiClusterizationTool/src/LWTNNCondAlg.h   |  85 ++++++++
 .../src/NnClusterizationFactory.cxx           | 200 +++++++++++++++---
 .../SiClusterizationTool_entries.cxx          |   3 +-
 11 files changed, 577 insertions(+), 47 deletions(-)
 create mode 100644 InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/LWTNNCollection.h
 create mode 100644 InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.cxx
 create mode 100644 InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.h

diff --git a/InnerDetector/InDetConfig/python/InDetConfigFlags.py b/InnerDetector/InDetConfig/python/InDetConfigFlags.py
index b04a31baeb1c..f5a76d284f66 100644
--- a/InnerDetector/InDetConfig/python/InDetConfigFlags.py
+++ b/InnerDetector/InDetConfig/python/InDetConfigFlags.py
@@ -173,6 +173,7 @@ def createInDetConfigFlags():
   icf.addFlag("InDet.doSLHCVeryForward", False ) # Turn running of SLHC reconstruction for Very Forward extension on and off 
   icf.addFlag("InDet.doTRTGlobalOccupancy", False) # Turn running of Event Info TRT Occupancy Filling Alg on and off (also whether it is used in TRT PID calculation) 
   icf.addFlag("InDet.doNNToTCalibration", False ) # USe ToT calibration for NN clustering rather than Charge 
+  icf.addFlag("InDet.useNNTTrainedNetworks", True ) # Use older NNs stored as TTrainedNetworks in place of default MDNs/other more recent networks. This is necessary for older configuration tags where the trainings were not available.
   icf.addFlag("InDet.keepAdditionalHitsOnTrackParticle", False) # Do not drop first/last hits on track (only for special cases - will blow up TrackParticle szie!!!) 
   icf.addFlag("InDet.doSCTModuleVeto", False) # Turn on SCT_ModuleVetoSvc, allowing it to be configured later 
   icf.addFlag("InDet.doParticleConversion", False) # In case anyone still wants to do Rec->xAOD TrackParticle Conversion 
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
index 160c7f3fcfe4..e988de6ed2e5 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
@@ -1145,6 +1145,12 @@ class doNNToTCalibration(InDetFlagsJobProperty):
   allowedTypes = ['bool']
   StoredValue  = False
 
+class useNNTTrainedNetworks(InDetFlagsJobProperty):
+  """Use older NNs stored as TTrainedNetworks in place of default MDNs/other more recent networks. This is necessary for older configuration tags where the trainings were not available."""
+  statusOn     = True
+  allowedTypes = ['bool']
+  StoredValue  = True
+
 class keepAdditionalHitsOnTrackParticle(InDetFlagsJobProperty): 
   """Do not drop first/last hits on track (only for special cases - will blow up TrackParticle szie!!!)""" 
   statusOn     = True 
@@ -2757,6 +2763,7 @@ _list_InDetJobProperties = [Enabled,
                             doSLHCVeryForward,
                             doTRTGlobalOccupancy,
                             doNNToTCalibration,
+                            useNNTTrainedNetworks,
                             keepAdditionalHitsOnTrackParticle,
                             doSCTModuleVeto,
                             doDBMstandalone,
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
index 088720d63265..082a8dcb2f97 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
@@ -274,6 +274,23 @@ def getPixelClusterNnCondAlg(**kwargs) :
     from SiClusterizationTool.SiClusterizationToolConf import InDet__TTrainedNetworkCondAlg
     return InDet__TTrainedNetworkCondAlg(kwargs.pop("name", 'PixelClusterNnCondAlg'), **kwargs)
 
+def getLWTNNCondAlg(**kwargs) :
+
+    # Check for the folder
+    from IOVDbSvc.CondDB import conddb
+    if not conddb.folderRequested('/PIXEL/PixelClustering/PixelClusNNCalibJSON'):
+        # COOL binding
+        conddb.addFolderSplitOnline("PIXEL","/PIXEL/Onl/PixelClustering/PixelNNCalibJSON",
+                                    "/PIXEL/PixelClustering/PixelNNCalibJSON",className='CondAttrListCollection')
+
+    # What we'll store it as
+    kwargs=setDefaults(kwargs,
+                       WriteKey = 'PixelClusterNNJSON')
+
+    # Set up the algorithm
+    from SiClusterizationTool.SiClusterizationToolConf import InDet__LWTNNCondAlg
+    return InDet__LWTNNCondAlg(kwargs.pop("name", "LWTNNCondAlg"),**kwargs)
+
 def getPixelClusterNnWithTrackCondAlg(**kwargs) :
 
     kwargs = setDefaults( kwargs,
@@ -306,10 +323,33 @@ def getNnClusterizationFactory(name='NnClusterizationFactory', **kwargs) :
     if 'PixelLorentzAngleTool' not in kwargs :
         kwargs = setDefaults( kwargs, PixelLorentzAngleTool = getPixelLorentzAngleTool())
 
+    from InDetRecExample.InDetJobProperties import InDetFlags
+    useTTrainedNetworks = InDetFlags.useNNTTrainedNetworks()
     from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags
     do_runI = geoFlags.Run() not in ["RUN2", "RUN3"]
-    createAndAddCondAlg( getPixelClusterNnCondAlg,         'PixelClusterNnCondAlg',          GetInputsInfo = do_runI)
-    createAndAddCondAlg( getPixelClusterNnWithTrackCondAlg,'PixelClusterNnWithTrackCondAlg', GetInputsInfo = do_runI)
+    
+    if useTTrainedNetworks :
+      log.debug("Setting up TTrainedNetworks")
+      createAndAddCondAlg( getPixelClusterNnCondAlg,         'PixelClusterNnCondAlg',          GetInputsInfo = do_runI)
+      createAndAddCondAlg( getPixelClusterNnWithTrackCondAlg,'PixelClusterNnWithTrackCondAlg', GetInputsInfo = do_runI)
+    else :
+
+      ######################################
+      # Temporary - pixel clustering setup #
+      ######################################
+      # Allow use of folder that exists but is not yet in global tag.
+      # Different names in different DB instances....
+      if not ('conddb' in dir()):
+        from IOVDbSvc.CondDB import conddb
+
+      if (conddb.dbmc == "OFLP200" or (conddb.dbdata=="OFLP200" and globalflags.DataSource=='data')) :
+        conddb.addOverride("/PIXEL/PixelClustering/PixelNNCalibJSON","PixelNNCalibJSON-SIM-RUN2-000-00")
+      if ((conddb.dbmc == "CONDBR2" and globalflags.DataSource!='data') or conddb.dbdata == "CONDBR2") :
+        conddb.addOverride("/PIXEL/PixelClustering/PixelNNCalibJSON","PixelNNCalibJSON-DATA-RUN2-000-00")
+      ## End of temporary code
+
+      log.debug("Setting up lwtnn system")
+      createAndAddCondAlg( getLWTNNCondAlg,                  'LWTNNCondAlg')
 
     from InDetRecExample.InDetJobProperties import InDetFlags
     kwargs = setDefaults( kwargs,
@@ -319,8 +359,10 @@ def getNnClusterizationFactory(name='NnClusterizationFactory', **kwargs) :
                           useRecenteringNNWithTracks         = False if do_runI else False,  # default,
                           correctLorShiftBarrelWithoutTracks = 0,
                           correctLorShiftBarrelWithTracks    = 0.030 if do_runI else 0.000,  # default,
+                          useTTrainedNetworks                = useTTrainedNetworks,
                           NnCollectionReadKey                = 'PixelClusterNN',
-                          NnCollectionWithTrackReadKey       = 'PixelClusterNNWithTrack')
+                          NnCollectionWithTrackReadKey       = 'PixelClusterNNWithTrack',
+                          NnCollectionJSONReadKey            = 'PixelClusterNNJSON')
     return InDet__NnClusterizationFactory(name=the_name, **kwargs)
 
 @makePublicTool
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
index c6282395efc3..335ae6e7d84d 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
@@ -228,8 +228,7 @@ if DetFlags.pixel_on():
                 PixeldEdxAlg.CalibrationFile="dtpar_signed_234.txt"
             else:
                 PixeldEdxAlg.CalibrationFile="mcpar_signed_234.txt"
-
-
+ 
 #
 # --- Load SCT Conditions Services
 #
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt b/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt
index 5c1639fc50ed..f9cf31ff7235 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt
@@ -41,27 +41,33 @@ atlas_depends_on_subdirs(
    Tracking/TrkEvent/VxVertex )
 
 # External dependencies:
+find_package( lwtnn )
 find_package( CLHEP )
 find_package( ROOT COMPONENTS Core MathCore Hist )
+find_package( COOL COMPONENTS CoolKernel CoolApplication )
 
 # Component(s) in the package:
 atlas_add_library( SiClusterizationToolLib
    SiClusterizationTool/*.h src/*.cxx
    PUBLIC_HEADERS SiClusterizationTool
-   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-   PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${LWTNN_INCLUDE_DIRS}
+   PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS}
    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives
+   LINK_LIBRARIES ${ROOT_LIBRARIES} ${LWTNN_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives
    Identifier EventPrimitives GaudiKernel InDetSimData InDetIdentifier
    InDetReadoutGeometry PixelReadoutGeometry SCT_ReadoutGeometry InDetRawData InDetPrepRawData InDetRecToolInterfaces InDetConditionsSummaryService
    TrkParameters TrkNeuralNetworkUtilsLib PixelConditionsData
    PixelGeoModelLib PixelCablingLib BeamSpotConditionsData
-   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaPoolUtilities FileCatalog AtlasDetDescr
-   TrkSurfaces TrkEventPrimitives VxVertex PixelGeoModelLib PoolSvcLib DetDescrCondToolsLib )
+   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} ${COOL_LIBRARIES} AthenaPoolUtilities FileCatalog AtlasDetDescr
+   TrkSurfaces TrkEventPrimitives VxVertex PixelGeoModelLib PoolSvcLib DetDescrCondToolsLib stdc++fs)
 
 atlas_add_component( SiClusterizationTool
    src/components/*.cxx
-   LINK_LIBRARIES GaudiKernel PixelConditionsData SiClusterizationToolLib PoolSvcLib )
+   INCLUDE_DIRS ${COOL_INCLUDE_DIRS}
+   LINK_LIBRARIES ${COOL_LIBRARIES} GaudiKernel PixelConditionsData SiClusterizationToolLib PoolSvcLib )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
+# These files can be added by the user for testing in Grid environments,
+# in which case un-comment this line and re-cmake
+# atlas_install_data( share/*.db )
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/LWTNNCollection.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/LWTNNCollection.h
new file mode 100644
index 000000000000..885b24a055af
--- /dev/null
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/LWTNNCollection.h
@@ -0,0 +1,30 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef _LWTNNCollection_H_
+#define _LWTNNCollection_H_
+
+//#include <vector>
+#include "lwtnn/LightweightGraph.hh"
+
+class LWTNNCollection 
+  :  public std::map<int, std::unique_ptr<lwt::LightweightGraph> >
+{
+public:
+
+private:
+
+};
+
+// These values produced using clid script.
+// clid LWTNNCollection
+// 1196174442 LWTNNCollection None
+#include "AthenaKernel/CLASS_DEF.h"
+CLASS_DEF(LWTNNCollection, 1196174442, 1)
+// clid -cs LWTNNCollection
+// 1226994220
+#include "AthenaKernel/CondCont.h"
+CONDCONT_DEF(LWTNNCollection, 1226994220);
+
+#endif
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h
index a84861a41e94..01039990556a 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h
@@ -2,13 +2,13 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
- #ifndef BTAGTOOL_NnClusterizationFactory_C
- #define BTAGTOOL_NnClusterizationFactory_C
+ #ifndef SICLUSTERIZATIONTOOL_NnClusterizationFactory_C
+ #define SICLUSTERIZATIONTOOL_NnClusterizationFactory_C
 
  /******************************************************
      @class NnClusterizationFactory
      @author Giacinto Piacquadio (PH-ADE-ID)
-     Package : JetTagTools
+     Package : SiClusterizationTool
      Created : January 2011
      DESCRIPTION: Load neural networks used for clustering
                   and deal with:
@@ -37,6 +37,7 @@
 #include "EventPrimitives/EventPrimitives.h"
 #include "InDetCondTools/ISiLorentzAngleTool.h"
 #include "SiClusterizationTool/TTrainedNetworkCollection.h"
+#include "SiClusterizationTool/LWTNNCollection.h"
 #include "PixelCabling/IPixelCablingSvc.h"
 #include "PixelConditionsData/PixelModuleData.h"
 #include "PixelConditionsData/PixelChargeCalibCondData.h"
@@ -46,6 +47,11 @@
  class TH1;
  class ICoolHistSvc;
 
+namespace lwt {
+  class NanReplacer;    
+  class LightweightGraph;
+}
+
 namespace Trk {
   class NeuralNetworkToHistoTool;
   class Surface;
@@ -106,6 +112,7 @@ namespace InDet {
                                                   int sizeX=7,
                                                   int sizeY=7) const;
 
+    /* Public-facing method 1: no track parameters */
     std::vector<Amg::Vector2D> estimatePositions(const InDet::PixelCluster& pCluster,
                                                       Amg::Vector3D & beamSpotPosition,
                                                       std::vector<Amg::MatrixX> & errors,
@@ -113,7 +120,7 @@ namespace InDet {
                                                       int sizeX=7,
                                                       int sizeY=7) const;
 
-
+    /* Public-facing method 1: with track parameters */
     std::vector<Amg::Vector2D> estimatePositions(const InDet::PixelCluster& pCluster,
                                                       const Trk::Surface& pixelSurface,
                                                       const Trk::TrackParameters& trackParsAtSurface,
@@ -124,8 +131,13 @@ namespace InDet {
 
    private:
 
-    /* estimate position for both with and w/o tracks */
-    std::vector<Amg::Vector2D> estimatePositions(const TTrainedNetworkCollection &nn_collection,
+    // Handling lwtnn inputs
+    typedef std::map<std::string, std::map<std::string, double> > InputMap;
+
+    /* Estimate position for both with and w/o tracks */
+    /* Method 1: using older TTrainedNetworks */
+    std::vector<Amg::Vector2D> estimatePositionsTTN(
+                                                 const TTrainedNetworkCollection &nn_collection,
                                                  std::vector<double> inputData,
                                                  const NNinput& input,
                                                  const InDet::PixelCluster& pCluster,
@@ -134,6 +146,20 @@ namespace InDet {
                                                  int numberSubClusters,
                                                  std::vector<Amg::MatrixX> & errors) const;
 
+    /* Estimate position for both with and w/o tracks */
+    /* Method 2: using lwtnn for more flexible interfacing */
+    std::vector<Amg::Vector2D> estimatePositionsLWTNN(
+                                                NnClusterizationFactory::InputMap & input, 
+                                                NNinput& rawInput,
+                                                const InDet::PixelCluster& pCluster,
+                                                int numberSubClusters,
+                                                std::vector<Amg::MatrixX> & errors) const;
+
+    // For error formatting in lwtnn cases
+    double correctedRMSX(double posPixels) const;
+
+    double correctedRMSY(double posPixels, double sizeY, std::vector<float>& pitches) const; 
+
      /* algorithmic component */
     NNinput createInput(const InDet::PixelCluster& pCluster,
                         Amg::Vector3D & beamSpotPosition,
@@ -157,7 +183,7 @@ namespace InDet {
                                       int sizeX,
                                       int sizeY) const;
 
-
+    InputMap flattenInput(NNinput & input) const;
 
     std::vector<Amg::Vector2D> getPositionsFromOutput(std::vector<double> & output,
                                                       const NNinput & input,
@@ -225,6 +251,10 @@ namespace InDet {
        {this, "NnCollectionWithTrackReadKey", "PixelClusterNNWithTrack",
         "The conditions store key for the pixel cluster NNs which needs tracks as input"};
 
+    SG::ReadCondHandleKey<LWTNNCollection> m_readKeyJSON
+       {this, "NnCollectionJSONReadKey", "PixelClusterNNJSON",
+        "The conditions key for the pixel cluster NNs configured via JSON file and accessed with lwtnn"};
+
     Gaudi::Property<unsigned int> m_maxSubClusters
        {this, "MaxSubClusters", 3, "Maximum number of sub cluster supported by the networks." };
 
@@ -243,6 +273,9 @@ namespace InDet {
     Gaudi::Property<bool> m_doRunI
        {this, "doRunI", false, "Use runI style network (outputs are not normalised; add pitches; use charge if not m_useToT)"};
 
+    Gaudi::Property<bool> m_useTTrainedNetworks
+       {this, "useTTrainedNetworks", false, "Use earlier (release-21-like) neural networks stored in ROOT files and accessed via TTrainedNetowrk."};
+
     Gaudi::Property<bool> m_useRecenteringNNWithouTracks
        {this, "useRecenteringNNWithoutTracks",false,"Recenter x position when evaluating NN without track input."};
 
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.cxx
new file mode 100644
index 000000000000..0a733ff61e79
--- /dev/null
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.cxx
@@ -0,0 +1,182 @@
+/*
+  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+*/
+/*
+ *   */
+
+#include "LWTNNCondAlg.h"
+
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include "AthenaPoolUtilities/AthenaAttributeList.h"
+#include "CoolKernel/IObject.h"
+#include "FileCatalog/IFileCatalog.h"
+
+// NN includes
+#include "lwtnn/parse_json.hh"
+#include "lwtnn/Exceptions.hh"
+#include "lwtnn/lightweight_nn_streamers.hh"
+#include "lwtnn/NanReplacer.hh"
+
+// JSON parsers
+#include <boost/property_tree/ptree.hpp>
+#include <boost/property_tree/json_parser.hpp>
+#include "boost/property_tree/exceptions.hpp"
+
+
+// for error messages
+#include <typeinfo>
+
+namespace InDet {
+
+  LWTNNCondAlg::LWTNNCondAlg (const std::string& name, ISvcLocator* pSvcLocator)
+    : ::AthAlgorithm( name, pSvcLocator )
+  {}
+
+  StatusCode LWTNNCondAlg::initialize() {
+    ATH_CHECK( m_condSvc.retrieve() );
+
+    // Condition Handles
+    ATH_CHECK( m_readKey.initialize() );
+    ATH_CHECK( m_writeKey.initialize() );
+
+    // Register write handle
+    if (m_condSvc->regHandle(this, m_writeKey).isFailure()) {
+      ATH_MSG_ERROR("Unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc");
+      return StatusCode::FAILURE;
+    }
+
+    return StatusCode::SUCCESS;
+  }
+
+  StatusCode LWTNNCondAlg::finalize()
+  {
+    return StatusCode::SUCCESS;
+  }
+
+  StatusCode LWTNNCondAlg::configureLwtnn(std::unique_ptr<lwt::LightweightGraph> & thisNN, 
+                                        std::string thisJson) {
+
+    // Read DNN weights from input json config
+    lwt::GraphConfig config;
+    try {
+      std::istringstream input_cfg( thisJson );
+      config = lwt::parse_json_graph(input_cfg);
+    } catch (boost::property_tree::ptree_error& err) {
+      ATH_MSG_ERROR("NN file unreadable!");
+      return StatusCode::FAILURE;
+    }
+
+    // Build the network
+    try {
+      thisNN.reset(new lwt::LightweightGraph(config, "merge_1"));
+    } catch (lwt::NNConfigurationException& exc) {
+      ATH_MSG_ERROR("NN configuration problem: " << exc.what());
+      return StatusCode::FAILURE;
+    }
+
+    return StatusCode::SUCCESS;   
+
+  }
+
+  StatusCode LWTNNCondAlg::execute() {
+
+    SG::WriteCondHandle<LWTNNCollection> NnWriteHandle{m_writeKey};
+    if (NnWriteHandle.isValid()) {
+      ATH_MSG_DEBUG("Write CondHandle "<< NnWriteHandle.fullKey() << " is already valid");
+      return StatusCode::SUCCESS;
+    }
+
+    SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey};
+    if(!readHandle.isValid()) {
+      ATH_MSG_ERROR("Invalid read handle " << m_readKey.key());
+      return StatusCode::FAILURE;
+    }
+    const CondAttrListCollection* atrcol{*readHandle};
+    assert( atrcol != nullptr);
+
+    // So now we have the string containing the json. Access it.
+    // Retrieve channel 0 (only channel there is)
+    const coral::AttributeList& attrList=atrcol->attributeList(0);
+
+    // Check that it is filled as expected
+    if ((attrList["NNConfigurations"]).isNull()) {
+      ATH_MSG_ERROR( "NNConfigurations is NULL !" );
+      return StatusCode::FAILURE;
+    }
+
+    // Retrieve the string
+    // This is for a single LOB when it is all a giant block
+    const std::string megajson = attrList["NNConfigurations"].data<cool::String16M>();
+
+    // Parse the large json to extract the individual configurations for the NNs
+    std::istringstream initializerStream(megajson);
+    namespace pt = boost::property_tree;    
+    pt::ptree parentTree;
+    pt::read_json(initializerStream, parentTree);
+    std::ostringstream configStream;
+
+    // This is for handling IOVs
+    EventIDRange cdo_iov;
+    if(!readHandle.range(cdo_iov)) {
+      ATH_MSG_ERROR("Failed to get valid validity range from  " << readHandle.key());
+      return StatusCode::FAILURE;
+    }
+
+    // Here I create a pointer to the object I want to write
+    // And what I want to write is the map with my lwtnn networks.
+    std::unique_ptr<LWTNNCollection> writeCdo{std::make_unique<LWTNNCollection>()};
+
+    // First, extract configuration for the number network.
+    pt::ptree subtreeNumberNetwork = parentTree.get_child("NumberNetwork");
+    writeCdo->insert(std::make_pair(0,std::unique_ptr<lwt::LightweightGraph>(nullptr)));
+    // If this json is empty, just fill a null pointer.
+    if(subtreeNumberNetwork.empty()) {
+      ATH_MSG_INFO("Not using lwtnn for number network.");
+    }
+    // Otherwise, set up lwtnn.
+    else {      
+      ATH_MSG_INFO("Setting up lwtnn for number network...");
+      pt::write_json(configStream, subtreeNumberNetwork);
+      std::string numberNetworkConfig = configStream.str();
+      if ((configureLwtnn(writeCdo->at(0), numberNetworkConfig)).isFailure())
+        return StatusCode::FAILURE;     
+    }
+
+    // Now extract configuration for each position network.
+    // For simplicity, we'll require all three configurations
+    // in order to use lwtnn for positions.
+    for (int i=1; i<4; i++) {
+      const std::string key = "PositionNetwork_N"+std::to_string(i);
+      configStream.str("");
+      pt::ptree subtreePosNetwork = parentTree.get_child(key);
+      pt::write_json(configStream, subtreePosNetwork);
+      std::string posNetworkConfig = configStream.str();
+      
+      // Put a lwt network into the map
+      writeCdo->insert(std::make_pair(i,std::unique_ptr<lwt::LightweightGraph>(nullptr)));
+
+      // Now do empty check: if any one of these is empty we won't use lwtnn
+      if(subtreePosNetwork.empty()) {
+        ATH_MSG_INFO("Not using lwtnn for position networks.");
+      } else {
+        // Otherwise, set up lwtnn
+        ATH_MSG_INFO("Setting up lwtnn for n = " << i << " position network...");
+        if ((configureLwtnn(writeCdo->at(i), posNetworkConfig)).isFailure())
+          return StatusCode::FAILURE;
+      }
+
+    }
+    
+    // Write the networks to the store
+
+    if(NnWriteHandle.record(cdo_iov,std::move(writeCdo)).isFailure()) {
+      ATH_MSG_ERROR("Failed to record Trained network collection to " 
+                    << NnWriteHandle.key()
+                    << " with IOV " << cdo_iov );
+      return StatusCode::FAILURE;
+    }
+
+    return StatusCode::SUCCESS;
+  }
+
+}
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.h b/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.h
new file mode 100644
index 000000000000..23a94d535fa2
--- /dev/null
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.h
@@ -0,0 +1,85 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef _InDet_LWTNNCondAlg_H_
+#define _InDet_LWTNNCondAlg_H_
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "StoreGate/WriteCondHandleKey.h"
+
+#include "GaudiKernel/ICondSvc.h"
+#include "PoolSvc/IPoolSvc.h"
+
+//#include "TrkNeuralNetworkUtils/NeuralNetworkToHistoTool.h"
+#include "SiClusterizationTool/LWTNNCollection.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include <string>
+
+class IPoolSvc;
+
+namespace lwt {
+  class NanReplacer;    
+  class LightweightGraph;
+}
+
+namespace InDet {
+
+  /**
+  */
+class LWTNNCondAlg : public AthAlgorithm {
+
+ public:
+
+  LWTNNCondAlg (const std::string& name, ISvcLocator* pSvcLocator);
+  ~LWTNNCondAlg() = default;
+
+  StatusCode initialize();
+  StatusCode execute();
+  StatusCode finalize();
+
+ private:
+//  TTrainedNetwork* retrieveNetwork(TFile &input_file, const std::string& folder) const;
+
+  ServiceHandle<ICondSvc> m_condSvc
+    {this, "CondSvc", "CondSvc", "The conditions service to register new conditions data."};
+/*  ServiceHandle<IPoolSvc> m_poolsvc
+    {this, "PoolSvc", "PoolSvc", "The service to retrieve files by GUID."};
+  ToolHandle<Trk::NeuralNetworkToHistoTool> m_networkToHistoTool
+    {this,"NetworkToHistoTool", "Trk::NeuralNetworkToHistoTool/NeuralNetworkToHistoTool", "Tool to create a neural network from a set of histograms." };
+*/
+  StatusCode configureLwtnn(std::unique_ptr<lwt::LightweightGraph> & thisNN, std::string thisJson);
+
+  SG::ReadCondHandleKey<CondAttrListCollection> m_readKey
+    {this, "ReadKey", "/PIXEL/PixelClustering/PixelNNCalibJSON", "Cool folder name for the cluster NN input histogram file."};
+
+  SG::WriteCondHandleKey<LWTNNCollection> m_writeKey
+    {this, "WriteKey", "PixelClusterNNJSON", "The conditions statore key for the pixel cluster NNs"};
+
+  Gaudi::Property< std::vector<std::string> > m_nnOrder
+    {this, "NetworkNames", {
+          "NumberNetwork",
+          "PositionNetwork_N1",
+          "PositionNetwork_N2",
+          "PositionNetwork_N3"},
+        "List of network names, which are indexe in map in this order"};
+/*
+  Gaudi::Property<std::string> m_layerInfoHistogram
+  {this, "LayerInfoHistogram",      "LayersInfo","Name about the layer info histogram."};
+
+  Gaudi::Property<std::string> m_layerPrefix
+  {this, "LayerPrefix",             "Layer",     "Prefix of the pre layer weight and threshold histograms."}; 
+
+  Gaudi::Property<std::string> m_weightIndicator
+  {this, "LayerWeightIndicator",    "_weights",  "Suffix of the weight histograms."};
+
+  Gaudi::Property<std::string> m_thresholdIndicator
+  {this, "LayerThresholdIndicator", "_thresholds","Suffix of the threshold histograms."};
+
+  Gaudi::Property<bool> m_getInputsInfo
+  {this, "GetInputsInfo", false,"Also read a histogram which contains information about the inputs (Run I)."};
+  */
+};
+}
+#endif
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx
index e847f6f1ad5d..28feb5fa6854 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx
@@ -156,6 +156,7 @@ namespace InDet {
 
     ATH_CHECK( m_readKeyWithoutTrack.initialize( !m_readKeyWithoutTrack.key().empty() ) );
     ATH_CHECK( m_readKeyWithTrack.initialize( !m_readKeyWithTrack.key().empty() ) );
+    ATH_CHECK( m_readKeyJSON.initialize( !m_readKeyJSON.key().empty() ) );
 
     return StatusCode::SUCCESS;
   }
@@ -255,6 +256,43 @@ namespace InDet {
     return inputData;
   }
 
+  NnClusterizationFactory::InputMap NnClusterizationFactory::flattenInput(NNinput & input) const
+  {
+
+    // Format for use with lwtnn
+    std::map<std::string, std::map<std::string, double> > flattened;
+
+    // Fill it!
+    // Variable names here need to match the ones in the configuration.    
+
+    std::map<std::string, double> simpleInputs;
+    for (unsigned int x = 0; x < input.matrixOfToT.size(); x++) {
+      for (unsigned int y = 0; y < input.matrixOfToT.at(0).size(); y++) {
+        unsigned int index = x*input.matrixOfToT.at(0).size()+y;
+        std::string varname = "NN_matrix"+std::to_string(index);
+        simpleInputs[varname] = input.matrixOfToT.at(x).at(y);
+      }
+    }
+
+    for (unsigned int p = 0; p < input.vectorOfPitchesY.size(); p++) {
+      std::string varname = "NN_pitches" + std::to_string(p);
+      simpleInputs[varname] = input.vectorOfPitchesY.at(p);
+    }
+
+    simpleInputs["NN_layer"] = input.ClusterPixLayer;
+    simpleInputs["NN_barrelEC"] = input.ClusterPixBarrelEC;
+    simpleInputs["NN_phi"] = input.phi;
+    simpleInputs["NN_theta"] = input.theta;
+
+    if (input.useTrackInfo) simpleInputs["NN_etaModule"] = input.etaModule;
+
+    // We have only one node for now, so we just store things there.
+    flattened["NNinputs"] = simpleInputs;
+
+    return flattened;
+
+
+  }
 
   std::vector<double> NnClusterizationFactory::estimateNumberOfParticles(const InDet::PixelCluster& pCluster,
                                                                          Amg::Vector3D & beamSpotPosition,
@@ -339,12 +377,6 @@ namespace InDet {
                                                                              int sizeY) const
   {
 
-    SG::ReadCondHandle<TTrainedNetworkCollection> nn_collection( m_readKeyWithoutTrack );
-    if (!nn_collection.isValid()) {
-      std::stringstream msg; msg << "Failed to get trained network collection with key " << m_readKeyWithoutTrack.key();
-      throw std::runtime_error( msg.str() );
-    }
-
     ATH_MSG_VERBOSE(" Starting to estimate positions...");
 
     double tanl=0;
@@ -360,14 +392,23 @@ namespace InDet {
       return std::vector<Amg::Vector2D>();
     }
 
-
     std::vector<double> inputData=(this->*m_assembleInput)(input,sizeX,sizeY);
 
+    // If using old TTrainedNetworks, fetch correct ones for the
+    // without-track situation and call them now.
+    if (m_useTTrainedNetworks) {
+      SG::ReadCondHandle<TTrainedNetworkCollection> nn_collection( m_readKeyWithoutTrack );
+      if (!nn_collection.isValid()) {
+        std::stringstream msg; msg << "Failed to get trained network collection with key " << m_readKeyWithoutTrack.key();
+        throw std::runtime_error( msg.str() );
+      }
+      // *(ReadCondHandle<>) returns a pointer rather than a reference ...
+      return estimatePositionsTTN(**nn_collection, inputData,input,pCluster,sizeX,sizeY,numberSubClusters,errors);
+    }
 
-    // *(ReadCondHandle<>) returns a pointer rather than a reference ...
-    return estimatePositions(**nn_collection, inputData,input,pCluster,sizeX,sizeY,numberSubClusters,errors);
-
-
+    // Otherwise, prepare lwtnn input map and use new networks.
+    NnClusterizationFactory::InputMap nnInputData = flattenInput(input);
+    return estimatePositionsLWTNN(nnInputData,input,pCluster,numberSubClusters,errors);
 
   }
 
@@ -380,12 +421,8 @@ namespace InDet {
                                                                         int sizeX,
                                                                         int sizeY) const
   {
-    SG::ReadCondHandle<TTrainedNetworkCollection> nn_collection( m_readKeyWithTrack );
-    if (!nn_collection.isValid()) {
-      std::stringstream msg; msg << "Failed to get trained network collection with key " << m_readKeyWithTrack.key();
-      throw std::runtime_error( msg.str() );
-    }
 
+    ATH_MSG_VERBOSE(" Starting to estimate positions...");
 
     Amg::Vector3D dummyBS(0,0,0);
 
@@ -402,24 +439,39 @@ namespace InDet {
        return std::vector<Amg::Vector2D>();
     }
 
-
     addTrackInfoToInput(input,pixelSurface,trackParsAtSurface,tanl);
 
     std::vector<double> inputData=(this->*m_assembleInput)(input,sizeX,sizeY);
 
+    // If using old TTrainedNetworks, fetch correct ones for the
+    // without-track situation and call them now.
+    if (m_useTTrainedNetworks) {
+      SG::ReadCondHandle<TTrainedNetworkCollection> nn_collection( m_readKeyWithTrack );
+      if (!nn_collection.isValid()) {
+        std::stringstream msg; msg << "Failed to get trained network collection with key " << m_readKeyWithTrack.key();
+        throw std::runtime_error( msg.str() );
+      }
+
+      return estimatePositionsTTN(**nn_collection, inputData,input,pCluster,sizeX,sizeY,numberSubClusters,errors);
+    }
+
+    // Otherwise, prepare lwtnn input map and use new networks.
+    NnClusterizationFactory::InputMap nnInputData = flattenInput(input);
+    return estimatePositionsLWTNN(nnInputData,input,pCluster,numberSubClusters,errors);
 
-    return estimatePositions(**nn_collection, inputData,input,pCluster,sizeX,sizeY,numberSubClusters,errors);
   }
 
-  std::vector<Amg::Vector2D> NnClusterizationFactory::estimatePositions(const TTrainedNetworkCollection &nn_collection,
-                                                                        std::vector<double> inputData,
-                                                                        const NNinput& input,
-                                                                        const InDet::PixelCluster& pCluster,
-                                                                        int sizeX,
-                                                                        int sizeY,
-                                                                        int numberSubClusters,
-                                                                        std::vector<Amg::MatrixX> & errors) const
+  std::vector<Amg::Vector2D> NnClusterizationFactory::estimatePositionsTTN(
+                                                const TTrainedNetworkCollection &nn_collection,
+                                                std::vector<double> inputData,
+                                                const NNinput& input,
+                                                const InDet::PixelCluster& pCluster,
+                                                int sizeX,
+                                                int sizeY,
+                                                int numberSubClusters,
+                                                std::vector<Amg::MatrixX> & errors) const
   {
+
     bool applyRecentering=(!input.useTrackInfo && m_useRecenteringNNWithouTracks)  || (input.useTrackInfo && m_useRecenteringNNWithTracks);
 
     std::vector<Amg::Vector2D> allPositions;
@@ -432,8 +484,8 @@ namespace InDet {
 
       assert( position1P.size() % 2 == 0);
       for (unsigned int i=0; i<position1P.size()/2 ; ++i) {
-        ATH_MSG_VERBOSE(" RAW Estimated positions (" << i << ") x: " << back_posX(position1P[0+i*2],applyRecentering) << " y: " << back_posY(position1P[1+i*2]));
-        ATH_MSG_VERBOSE(" Estimated myPositions ("   << i << ") x: " << myPosition1[i][Trk::locX] << " y: " << myPosition1[i][Trk::locY]);
+        ATH_MSG_DEBUG(" Original RAW Estimated positions (" << i << ") x: " << back_posX(position1P[0+i*2],applyRecentering) << " y: " << back_posY(position1P[1+i*2]));
+        ATH_MSG_DEBUG(" Original estimated myPositions ("   << i << ") x: " << myPosition1[i][Trk::locX] << " y: " << myPosition1[i][Trk::locY]);
       }
 
       std::vector<double> inputDataNew=inputData;
@@ -462,7 +514,99 @@ namespace InDet {
     return allPositions;
   }
 
+  std::vector<Amg::Vector2D> NnClusterizationFactory::estimatePositionsLWTNN(
+                                                                NnClusterizationFactory::InputMap & input, 
+                                                                NNinput& rawInput,
+                                                                const InDet::PixelCluster& pCluster,
+                                                                int numberSubClusters,
+                                                                std::vector<Amg::MatrixX> & errors) const 
+    {
+    
+    SG::ReadCondHandle<LWTNNCollection> lwtnn_collection(m_readKeyJSON) ;
+    if (!lwtnn_collection.isValid()) {
+      std::stringstream msg; msg << "Failed to get LWTNN network collection with key " << m_readKeyJSON.key();
+      throw std::runtime_error( msg.str() );      
+    }
+
+    // Need to evaluate the correct network once per cluster we're interested in.
+    // Save the output
+    std::vector<double> positionValues;
+    std::vector<Amg::MatrixX> errorMatrices;
+    for (int cluster = 1; cluster < numberSubClusters+1; cluster++) {
+
+      // Check that the network is defined. 
+      // If not, we are outside an IOV and should fail
+      if (not lwtnn_collection->at(numberSubClusters)) {
+        std::stringstream msg; msg << "No lwtnn network configured for this run! If you are outside the valid range for lwtnn-based configuration, plesae run with useNNTTrainedNetworks instead." << m_readKeyJSON.key();
+        throw std::runtime_error( msg.str() );
+      }
+
+      std::string outNodeName = "merge_"+std::to_string(cluster);
+      std::map<std::string, double> position = lwtnn_collection->at(numberSubClusters)->compute(input, {},outNodeName);
+
+      ATH_MSG_DEBUG("Testing for numberSubClusters " << numberSubClusters << " and cluster " << cluster);
+      for (auto item : position) {
+        ATH_MSG_DEBUG(item.first << ": " << item.second);
+      }
+      positionValues.push_back(position["mean_x"]);
+      positionValues.push_back(position["mean_y"]);
+
+      // Fill errors.
+      // Values returned by NN are inverse of variance, and we want variances.
+      float rawRmsX = sqrt(1.0/position["prec_x"]);
+      float rawRmsY = sqrt(1.0/position["prec_y"]);
+      // Now convert to real space units
+      double rmsX = correctedRMSX(rawRmsX);
+      double rmsY = correctedRMSY(rawRmsY, 7., rawInput.vectorOfPitchesY);
+      ATH_MSG_DEBUG(" Estimated RMS errors (1) x: " << rmsX << ", y: " << rmsY);  
+
+      // Fill matrix    
+      Amg::MatrixX erm(2,2);
+      erm.setZero();
+      erm(0,0)=rmsX*rmsX;
+      erm(1,1)=rmsY*rmsY;
+      errorMatrices.push_back(erm); 
+
+    }
+
+    std::vector<Amg::Vector2D> myPositions = getPositionsFromOutput(positionValues,rawInput,pCluster);
+    ATH_MSG_DEBUG(" Estimated myPositions (1) x: " << myPositions[0][Trk::locX] << " y: " << myPositions[0][Trk::locY]);
+    
+    for (unsigned int index = 0; index < errorMatrices.size(); index++) errors.push_back(errorMatrices.at(index));
+
+    return myPositions;
+
+  }
+
+  double NnClusterizationFactory::correctedRMSX(double posPixels) const
+  {
+
+    // This gives location in pixels
+    double pitch = 0.05;
+    double corrected = posPixels * pitch;
+
+    return corrected;
+  }
+
+  double NnClusterizationFactory::correctedRMSY(double posPixels,
+         double sizeY,
+        std::vector<float>& pitches) const
+  {
+    double p = posPixels + (sizeY - 1) / 2.0;
+    double p_Y = -100;
+    double p_center = -100;
+    double p_actual = 0;
+
+    for (int i = 0; i < sizeY; i++) {
+      if (p >= i && p <= (i + 1))
+        p_Y = p_actual + (p - i + 0.5) * pitches.at(i);
+      if (i == (sizeY - 1) / 2)
+        p_center = p_actual + 0.5 * pitches.at(i);
+      p_actual += pitches.at(i);
+    }
 
+    return abs(p_Y - p_center);
+  }  
 
   void NnClusterizationFactory::getErrorMatrixFromOutput(std::vector<double>& outputX,
                                                          std::vector<double>& outputY,
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/components/SiClusterizationTool_entries.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/components/SiClusterizationTool_entries.cxx
index 19e4588a84fb..c6f4dc085f7b 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/components/SiClusterizationTool_entries.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/components/SiClusterizationTool_entries.cxx
@@ -10,7 +10,7 @@
 #include "SiClusterizationTool/TruthPixelClusterSplitter.h"
 #include "SiClusterizationTool/TruthClusterizationFactory.h"
 #include "SiClusterizationTool/TruthPixelClusterSplitProbTool.h"
-
+#include "../LWTNNCondAlg.h"
 #include "../TTrainedNetworkCondAlg.h"
 
 DECLARE_COMPONENT( InDet::MergedPixelsTool )
@@ -21,6 +21,7 @@ DECLARE_COMPONENT( InDet::TotPixelClusterSplitter )
 DECLARE_COMPONENT( InDet::NnPixelClusterSplitter )
 DECLARE_COMPONENT( InDet::NnClusterizationFactory )
 DECLARE_COMPONENT( InDet::TTrainedNetworkCondAlg )
+DECLARE_COMPONENT( InDet::LWTNNCondAlg )
 DECLARE_COMPONENT( InDet::NnPixelClusterSplitProbTool )
 DECLARE_COMPONENT( InDet::TruthPixelClusterSplitter )
 DECLARE_COMPONENT( InDet::TruthClusterizationFactory )
-- 
GitLab


From e9ab305cf4f91a9d375bb4879eeb67a2423596e4 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Fri, 18 Sep 2020 13:59:08 +0200
Subject: [PATCH 229/422] undo fix to xAODPFlowDict since it is not needed now

---
 Event/xAOD/xAODPFlow/xAODPFlow/selection.xml   | 2 +-
 Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
index 9d6852e19a20..e1595e273a9d 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
@@ -48,7 +48,7 @@
    <class name="std::vector<std::pair<ElementLink<xAOD::CaloClusterContainer_v1>,double> >" />
    <class name="std::vector<std::vector<std::pair<ElementLink<xAOD::CaloClusterContainer_v1>,double> > >" />
    <class name="std::vector<xAOD::PFODetails::PFOLeptonType>" />
-   <class name="std::vector<std::vector<ElementLink<xAOD::FlowElementContainer_v1> > > " /> 
+   <!-- <class name="std::vector<std::vector<ElementLink<xAOD::FlowElementContainer_v1> > > " />  -->
    
 
 </lcgdict>
diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h b/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
index 0c335ee97b97..4829da63e9a1 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
@@ -47,7 +47,6 @@ namespace {
      std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > > FlowElemdummy2;
      std::vector< std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > > > FlowElemdummy3;
      std::vector< xAOD::PFODetails::PFOLeptonType > FlowElemdummy4;
-     std::vector< std::vector<ElementLink<xAOD::FlowElementContainer_v1> > > FlowElemdummy5; // fixes issues in eflowRec
      
 
    };
-- 
GitLab


From 6f9633d052ccdab45f370b2f6195d8b4ff5af5fe Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Fri, 18 Sep 2020 13:59:46 +0200
Subject: [PATCH 230/422] remove commented out block in xml

---
 Event/xAOD/xAODPFlow/xAODPFlow/selection.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
index e1595e273a9d..50f7f3202b41 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
@@ -48,7 +48,6 @@
    <class name="std::vector<std::pair<ElementLink<xAOD::CaloClusterContainer_v1>,double> >" />
    <class name="std::vector<std::vector<std::pair<ElementLink<xAOD::CaloClusterContainer_v1>,double> > >" />
    <class name="std::vector<xAOD::PFODetails::PFOLeptonType>" />
-   <!-- <class name="std::vector<std::vector<ElementLink<xAOD::FlowElementContainer_v1> > > " />  -->
    
 
 </lcgdict>
-- 
GitLab


From 634f5bc02e9115fa181cd36dcb3e9ed3412b4d06 Mon Sep 17 00:00:00 2001
From: Yasuyuki Okumura <yasuyuki.okumura@cern.ch>
Date: Fri, 18 Sep 2020 14:46:09 +0200
Subject: [PATCH 231/422] reorganize webdisplay tests in master (ATR-21961)

---
 .../test_trigAna_PhysValWeb_comp_v1v7_grid.py |  4 +-
 .../test_trigAna_PhysValWeb_v1Dev_grid.py     | 70 -------------------
 ...est_trigAna_PhysValWeb_v7Primaries_grid.py | 69 ------------------
 3 files changed, 2 insertions(+), 141 deletions(-)
 delete mode 100755 Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v1Dev_grid.py
 delete mode 100755 Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v7Primaries_grid.py

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_comp_v1v7_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_comp_v1v7_grid.py
index f0a4fd6df08d..f23612e58685 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_comp_v1v7_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_comp_v1v7_grid.py
@@ -26,10 +26,10 @@ from TrigValTools.TrigValSteering import Test, CheckSteps
 from TrigAnalysisTest.TrigAnalysisSteps import add_physvalweb_steps
 
 downloadLegacyTrig = CheckSteps.DownloadRefStep('DownloadLegacyTriggerNTUP')
-downloadLegacyTrig.artjobname = 'test_trigAna_PhysValWeb_v7Primaries_grid.py'
+downloadLegacyTrig.artjobname = 'test_trigAna_RDOtoPhysval_v7Primaries_grid.py'
 
 downloadRun3Trig = CheckSteps.DownloadRefStep('DownloadRun3TriggerNTUP')
-downloadRun3Trig.artjobname = 'test_trigAna_PhysValWeb_v1Dev_grid.py'
+downloadRun3Trig.artjobname = 'test_trigAna_RDOtoPhysval_v1Dev_grid.py'
 downloadRun3Trig.args += ' --dst="."'
 
 test = Test.Test()
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v1Dev_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v1Dev_grid.py
deleted file mode 100755
index c6b3d27f4b8c..000000000000
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v1Dev_grid.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env python
-
-# art-description: Test of transform RDO->RDO_TRIG->ESD->AOD with AthenaMT and AOD->NTUP_PHYSVAL with serial athena to produce webdisplay
-# art-type: grid
-# art-include: master/Athena
-# art-output: *.txt
-# art-output: *.log
-# art-output: log.*
-# art-output: *.out
-# art-output: *.err
-# art-output: *.log.tar.gz
-# art-output: *.new
-# art-output: *.json
-# art-output: *.root
-# art-output: *.pmon.gz
-# art-output: *perfmon*
-# art-output: prmon*
-# art-output: *.check*
-# art-output: HLTconfig*.xml
-# art-output: L1Topoconfig*.xml
-# art-output: LVL1config*.xml
-# art-output: PHYSVAL_WEB
-# art-html: PHYSVAL_WEB
-
-from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
-from TrigAnalysisTest.TrigAnalysisSteps import add_physvalweb_steps
-import os
-
-# To run single-process transform on MCORE sites
-if 'ATHENA_NPROC_NUM' in os.environ:
-    del os.environ['ATHENA_NPROC_NUM']
-
-preExec = ';'.join([
-  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
-  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
-  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
-])
-
-rdo2aod = ExecStep.ExecStep('RDOtoAOD')
-rdo2aod.type = 'Reco_tf'
-rdo2aod.input = 'ttbar'
-rdo2aod.threads = 1
-rdo2aod.max_events = 500
-rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
-
-physval = ExecStep.ExecStep('PhysVal')
-physval.type = 'Reco_tf'
-physval.input = ''
-physval.explicit_input = True
-physval.args = '--inputAODFile=AOD.pool.root --outputNTUP_PHYSVALFile=NTUP_PHYSVAL.pool.root --valid=True'
-
-validationFlags = 'doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet'
-physval.args += ' --validationFlags="{:s}"'.format(validationFlags)
-
-test = Test.Test()
-test.art_type = 'grid'
-test.exec_steps = [rdo2aod,physval]
-test.check_steps = CheckSteps.default_check_steps(test)
-
-# Add web display steps
-slice_names = [
-    'JetMon', 'TauMon', 'MuonMon', 'IDMon',
-    'BphysMon', 'HLTCaloESD', 'ResultMon', 'BjetMon',
-    'METMon', 'MinBiasMon', 'Egamma']
-download = CheckSteps.DownloadRefStep()
-add_physvalweb_steps(test, slice_names, download)
-
-import sys
-sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v7Primaries_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v7Primaries_grid.py
deleted file mode 100755
index 449f67c86dd6..000000000000
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_v7Primaries_grid.py
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env python
-
-# art-description: Test of transform RDO->RDO_TRIG->ESD->AOD->NTUP_PHYSVAL with serial athena (legacy trigger) and produce webdisplay
-# art-type: grid
-# art-include: master/Athena
-# art-output: *.txt
-# art-output: *.log
-# art-output: log.*
-# art-output: *.out
-# art-output: *.err
-# art-output: *.log.tar.gz
-# art-output: *.new
-# art-output: *.json
-# art-output: *.root
-# art-output: *.pmon.gz
-# art-output: *perfmon*
-# art-output: prmon*
-# art-output: *.check*
-# art-output: HLTconfig*.xml
-# art-output: L1Topoconfig*.xml
-# art-output: LVL1config*.xml
-# art-output: PHYSVAL_WEB
-# art-html: PHYSVAL_WEB
-
-from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
-from TrigAnalysisTest.TrigAnalysisSteps import add_physvalweb_steps
-import os
-
-# To run single-process transform on MCORE sites
-if 'ATHENA_NPROC_NUM' in os.environ:
-    del os.environ['ATHENA_NPROC_NUM']
-
-preExec = ';'.join([
-  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
-  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
-  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
-])
-
-rdo2aod = ExecStep.ExecStep('RDOtoAOD')
-rdo2aod.type = 'Reco_tf'
-rdo2aod.input = 'ttbar'
-rdo2aod.max_events = 500
-rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
-
-physval = ExecStep.ExecStep('PhysVal')
-physval.type = 'Reco_tf'
-physval.input = ''
-physval.explicit_input = True
-physval.args = '--inputAODFile=AOD.pool.root --outputNTUP_PHYSVALFile=NTUP_PHYSVAL.pool.root --valid=True'
-
-validationFlags = 'doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet'
-physval.args += ' --validationFlags="{:s}"'.format(validationFlags)
-
-test = Test.Test()
-test.art_type = 'grid'
-test.exec_steps = [rdo2aod,physval]
-test.check_steps = CheckSteps.default_check_steps(test)
-
-# Add web display steps
-slice_names = [
-    'JetMon', 'TauMon', 'MuonMon', 'IDMon',
-    'BphysMon', 'HLTCaloESD', 'ResultMon', 'BjetMon',
-    'METMon', 'MinBiasMon', 'Egamma']
-download = CheckSteps.DownloadRefStep()
-add_physvalweb_steps(test, slice_names, download)
-
-import sys
-sys.exit(test.run())
-- 
GitLab


From 79442c0c584d54a4ae2b751a910775dbd4ffef83 Mon Sep 17 00:00:00 2001
From: Moe Wakida <moe.wakida@cern.ch>
Date: Fri, 18 Sep 2020 12:51:30 +0000
Subject: [PATCH 232/422] Implement ratio and etaphi2D plots for non-specific
 chain, ATR-20317

---
 .../python/EFMuonMonConfig.py                 | 173 +++++----
 .../python/L1MuonMonConfig.py                 |   9 +-
 .../python/L2MuonSAMonConfig.py               | 335 +++++++++---------
 .../python/L2muCombMonConfig.py               | 104 +++---
 .../TrigMuonMonitoringMT/src/EFMuonMonMT.cxx  | 134 ++++---
 .../TrigMuonMonitoringMT/src/EFMuonMonMT.h    |   8 +
 .../src/L2MuonSAMonMT.cxx                     | 169 +++++----
 .../TrigMuonMonitoringMT/src/L2MuonSAMonMT.h  |   6 +
 .../src/L2muCombMonMT.cxx                     | 111 +++---
 .../TrigMuonMonitoringMT/src/L2muCombMonMT.h  |   6 +
 .../src/MuonMatchingTool.cxx                  |  52 +++
 .../src/MuonMatchingTool.h                    |  54 ++-
 .../src/MuonMatchingTool.icc                  |  40 +++
 .../src/TrigMuonMonitorAlgorithm.h            |  37 ++
 .../src/TrigMuonMonitorAlgorithm.icc          |  65 ++++
 15 files changed, 856 insertions(+), 447 deletions(-)
 create mode 100644 Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.icc

diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py
index e5a8303c0368..0561a361f78a 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py
@@ -5,90 +5,109 @@ import ROOT
 def EFMuonMonConfig(helper):
     
     from AthenaConfiguration.ComponentFactory import CompFactory
+
+    GroupName = 'EFMuon'
+
+    monAlg = helper.addAlgorithm(CompFactory.EFMuonMonMT,'EFMuonMonMT')
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20']
+    monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20']
+    monAlg.Group = GroupName
 
-    for chain in Chains:
+    # configuration of etaphi2D and Ratio plots for non-specific chain
+    histGroupNonSpecificChain = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/')
 
-        GroupName = 'EFMuon_'+chain
+    histGroupNonSpecificChain.defineHistogram('EFSAEta,EFSAPhi;EFSA_Eta_vs_Phi',
+                                              title='EFSA Eta vs Phi ;#eta;#phi',
+                                              type='TH2F', path='etaphi2D',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        monAlg = helper.addAlgorithm(CompFactory.EFMuonMonMT,'EFMuonMonMT_'+chain)
-        monAlg.MuonType = ROOT.xAOD.Muon_v1.MuonStandAlone
-        monAlg.MonitoredChains = [chain]
-        monAlg.Group = GroupName
+    histGroupNonSpecificChain.defineHistogram('EFCBEta,EFCBPhi;EFCB_Eta_vs_Phi',
+                                              title='EFCB Eta vs Phi ;#eta;#phi',
+                                              type='TH2F', path='etaphi2D',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/EFMuon/'+chain)
-    
+    histGroupNonSpecificChain.defineHistogram('EFSAAboveCut,LB;EFSA_Over_OfflineSA_4GeV_Cut',
+                                              title='EFSA Over OfflineSA 4GeV Cut;LB;Ratio',
+                                              type='TEfficiency', path='Ratio',xbins=400,xmin=1.,xmax=801.)
+
+    histGroupNonSpecificChain.defineHistogram('EFCBAboveCut,LB;EFCB_Over_OfflineCB_4GeV_Cut',
+                                              title='EFCB Over OfflineCB 4GeV Cut;LB;Ratio',
+                                              type='TEfficiency', path='Ratio',xbins=400,xmin=1.,xmax=801.)
+
+
+    # configration for specific chain
+    for chain in monAlg.MonitoredChains:
+
+        histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/EFMuon/'+chain)
     
+
         # basic EDM variables
         # EFSA
-        histGroup.defineHistogram(GroupName+'_EFSA_Pt;EFSA_Pt',
+        histGroup.defineHistogram(chain+'_EFSA_Pt;EFSA_Pt',
                                   title='EFSA Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_EFSA_Eta;EFSA_Eta',
+        histGroup.defineHistogram(chain+'_EFSA_Eta;EFSA_Eta',
                                   title='EFSA Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_EFSA_Phi;EFSA_Phi',
+        histGroup.defineHistogram(chain+'_EFSA_Phi;EFSA_Phi',
                                   title='EFSA Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_EFSA_Eta,'+GroupName+'_EFSA_Phi;EFSA_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_EFSA_Eta,'+chain+'_EFSA_Phi;EFSA_Eta_vs_Phi',
                                   title='EFSA Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
         # EFCB
-        histGroup.defineHistogram(GroupName+'_EFCB_Pt;EFCB_Pt',
+        histGroup.defineHistogram(chain+'_EFCB_Pt;EFCB_Pt',
                                   title='EFCB Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_EFCB_Eta;EFCB_Eta',
+        histGroup.defineHistogram(chain+'_EFCB_Eta;EFCB_Eta',
                                   title='EFCB Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_EFCB_Phi;EFCB_Phi',
+        histGroup.defineHistogram(chain+'_EFCB_Phi;EFCB_Phi',
                                   title='EFCB Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_EFCB_Eta,'+GroupName+'_EFCB_Phi;EFCB_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_EFCB_Eta,'+chain+'_EFCB_Phi;EFCB_Eta_vs_Phi',
                                   title='EFCB Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
         # OfflineSA
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Pt;OfflineSA_Pt',
+        histGroup.defineHistogram(chain+'_OfflineSA_Pt;OfflineSA_Pt',
                                   title='OfflineSA Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Eta;OfflineSA_Eta',
+        histGroup.defineHistogram(chain+'_OfflineSA_Eta;OfflineSA_Eta',
                                   title='OfflineSA Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Phi;OfflineSA_Phi',
+        histGroup.defineHistogram(chain+'_OfflineSA_Phi;OfflineSA_Phi',
                                   title='OfflineSA Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_OfflineSA_Phi;OfflineSA_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_OfflineSA_Eta,'+chain+'_OfflineSA_Phi;OfflineSA_Eta_vs_Phi',
                                   title='OfflineSA Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
         # OfflineCB
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Pt;OfflineCB_Pt',
+        histGroup.defineHistogram(chain+'_OfflineCB_Pt;OfflineCB_Pt',
                                   title='OfflineCB Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Eta;OfflineCB_Eta',
+        histGroup.defineHistogram(chain+'_OfflineCB_Eta;OfflineCB_Eta',
                                   title='OfflineCB Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Phi;OfflineCB_Phi',
+        histGroup.defineHistogram(chain+'_OfflineCB_Phi;OfflineCB_Phi',
                                   title='OfflineCB Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Eta,'+GroupName+'_OfflineCB_Phi;OfflineCB_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_OfflineCB_Eta,'+chain+'_OfflineCB_Phi;OfflineCB_Eta_vs_Phi',
                                   title='OfflineCB Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
@@ -96,140 +115,140 @@ def EFMuonMonConfig(helper):
 
         # correlation histograms
         # EFSA vs. OfflineSA muons
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Pt,'+GroupName+'_MatchedEFSA_Pt;EFSA_OfflineSA_PtCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Pt,'+chain+'_MatchedEFSA_Pt;EFSA_OfflineSA_PtCor',
                                   title='PtCor EFSA OfflineSA '+chain+';OfflineSA p_{T} [GeV];EFSA p_{T} [GeV]',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Phi,'+GroupName+'_MatchedEFSA_Phi;EFSA_OfflineSA_PhiCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Phi,'+chain+'_MatchedEFSA_Phi;EFSA_OfflineSA_PhiCor',
                                   title='PhiCor EFSA OfflineSA '+chain+';OfflineSA #phi;EFSA #phi',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_MatchedEFSA_Eta;EFSA_OfflineSA_EtaCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Eta,'+chain+'_MatchedEFSA_Eta;EFSA_OfflineSA_EtaCor',
                                   title='EtaCor EFSA OfflineSA '+chain+';OfflineSA #eta;EFSA #eta',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_SAdPt;EFSA_OfflineSA_dPt',
+        histGroup.defineHistogram(chain+'_SAdPt;EFSA_OfflineSA_dPt',
                                   title='dPt EFSA OfflineSA '+chain+';dPt [GeV];Events', 
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=100,xmin=-10.,xmax=10.)
 
-        histGroup.defineHistogram(GroupName+'_SAdEta;EFSA_OfflineSA_dEta',
+        histGroup.defineHistogram(chain+'_SAdEta;EFSA_OfflineSA_dEta',
                                   title='dEta EFSA OfflineSA '+chain+';dEta;Events', 
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=200,xmin=-5.,xmax=5.)
 
-        histGroup.defineHistogram(GroupName+'_SAdPhi;EFSA_OfflineSA_dPhi',
+        histGroup.defineHistogram(chain+'_SAdPhi;EFSA_OfflineSA_dPhi',
                                   title='dPhi EFSA OfflineSA '+chain+';dPhi;Events', 
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_SAdR;EFSA_OfflineSA_dR',
+        histGroup.defineHistogram(chain+'_SAdR;EFSA_OfflineSA_dR',
                                   title='dR EFSA OfflineSA '+chain+';dR;Events', 
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=110,xmin=0.,xmax=11.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Pt;OfflineSA_Pt_AwareEFSA',
+        histGroup.defineHistogram(chain+'_OfflineSA_Pt;OfflineSA_Pt_AwareEFSA',
                                   title='OfflineSA Pt AwareEFSA '+chain+';OfflineSA p_{T} [GeV];Events',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Phi;OfflineSA_Phi_AwareEFSA',
+        histGroup.defineHistogram(chain+'_OfflineSA_Phi;OfflineSA_Phi_AwareEFSA',
                                   title='OfflineSA Phi AwareEFSA '+chain+';OfflineSA #phi;Events',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Eta;OfflineSA_Eta_AwareEFSA',
+        histGroup.defineHistogram(chain+'_OfflineSA_Eta;OfflineSA_Eta_AwareEFSA',
                                   title='OfflineSA Eta AwareEFSA '+chain+';OfflineSA #eta;Events',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
 
         # OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA)
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Pt,'+GroupName+'_OfflineSAmatchedL2SA_Pt;OfflineSA_matchedEFSA_matchedL2SA_PtCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Pt,'+chain+'_OfflineSAmatchedL2SA_Pt;OfflineSA_matchedEFSA_matchedL2SA_PtCor',
                                   title='PtCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA p_{T} [GeV];OfflineSA matched to L2SA p_{T} [GeV]',
-                                  cutmask=GroupName+'_matchedL2SA',
+                                  cutmask=chain+'_matchedL2SA',
                                   type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Phi,'+GroupName+'_OfflineSAmatchedL2SA_Phi;OfflineSA_matchedEFSA_matchedL2SA_PhiCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Phi,'+chain+'_OfflineSAmatchedL2SA_Phi;OfflineSA_matchedEFSA_matchedL2SA_PhiCor',
                                   title='PhiCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA #phi;OfflineSA matched to L2SA #phi',
-                                  cutmask=GroupName+'_matchedL2SA',
+                                  cutmask=chain+'_matchedL2SA',
                                   type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_OfflineSAmatchedL2SA_Eta;OfflineSA_matchedEFSA_matchedL2SA_EtaCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Eta,'+chain+'_OfflineSAmatchedL2SA_Eta;OfflineSA_matchedEFSA_matchedL2SA_EtaCor',
                                   title='EtaCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA #eta;OfflineSA matched to L2SA #eta',
-                                  cutmask=GroupName+'_matchedL2SA',
+                                  cutmask=chain+'_matchedL2SA',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
 
 
         # EFCB vs. OfflineCB muons
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Pt,'+GroupName+'_MatchedEFCB_Pt;EFCB_OfflineCB_PtCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Pt,'+chain+'_MatchedEFCB_Pt;EFCB_OfflineCB_PtCor',
                                   title='PtCor EFCB OfflineCB '+chain+';OfflineCB p_{T} [GeV];EFCB p_{T} [GeV];',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Phi,'+GroupName+'_MatchedEFCB_Phi;EFCB_OfflineCB_PhiCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Phi,'+chain+'_MatchedEFCB_Phi;EFCB_OfflineCB_PhiCor',
                                   title='PhiCor EFCB OfflineCB '+chain+';OfflineCB #phi;EFCB #phi;',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Eta,'+GroupName+'_MatchedEFCB_Eta;EFCB_OfflineCB_EtaCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Eta,'+chain+'_MatchedEFCB_Eta;EFCB_OfflineCB_EtaCor',
                                   title='EtaCor EFCB OfflineCB '+chain+';OfflineCB #eta;EFCB #eta;',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_CBdPt;EFCB_OfflineCB_dPt',
+        histGroup.defineHistogram(chain+'_CBdPt;EFCB_OfflineCB_dPt',
                                   title='dPt EFCB OfflineCB '+chain+';dPt [GeV];Events', 
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=100,xmin=-10.,xmax=10.)
 
-        histGroup.defineHistogram(GroupName+'_CBdEta;EFCB_OfflineCB_dEta',
+        histGroup.defineHistogram(chain+'_CBdEta;EFCB_OfflineCB_dEta',
                                   title='dEta EFCB OfflineCB '+chain+';dEta;Events', 
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=200,xmin=-5.,xmax=5.)
 
-        histGroup.defineHistogram(GroupName+'_CBdPhi;EFCB_OfflineCB_dPhi',
+        histGroup.defineHistogram(chain+'_CBdPhi;EFCB_OfflineCB_dPhi',
                                   title='dPhi EFCB OfflineCB '+chain+';dPhi;Events', 
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_CBdR;EFCB_OfflineCB_dR',
+        histGroup.defineHistogram(chain+'_CBdR;EFCB_OfflineCB_dR',
                                   title='dR EFCB OfflineCB '+chain+';dR;Events', 
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=110,xmin=0.,xmax=11.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Pt;OfflineCB_Pt_AwareEFCB',
+        histGroup.defineHistogram(chain+'_OfflineCB_Pt;OfflineCB_Pt_AwareEFCB',
                                   title='OfflineCB Pt AwareEFCB '+chain+';OfflineCB p_{T} [GeV];Events',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Phi;OfflineCB_Phi_AwareEFCB',
+        histGroup.defineHistogram(chain+'_OfflineCB_Phi;OfflineCB_Phi_AwareEFCB',
                                   title='OfflineCB Phi AwareEFCB '+chain+';OfflineCB #phi;Events',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Eta;OfflineCB_Eta_AwareEFCB',
+        histGroup.defineHistogram(chain+'_OfflineCB_Eta;OfflineCB_Eta_AwareEFCB',
                                   title='OfflineCB Eta AwareEFCB '+chain+';OfflineCB #eta;Events',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
 
         # OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB)
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Pt,'+GroupName+'_OfflineCBmatchedL2CB_Pt;OfflineCB_matchedEFCB_matchedL2CB_PtCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Pt,'+chain+'_OfflineCBmatchedL2CB_Pt;OfflineCB_matchedEFCB_matchedL2CB_PtCor',
                                   title='PtCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB p_{T} [GeV];OfflineCB matched to L2CB p_{T} [GeV]',
-                                  cutmask=GroupName+'_matchedL2CB',
+                                  cutmask=chain+'_matchedL2CB',
                                   type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Phi,'+GroupName+'_OfflineCBmatchedL2CB_Phi;OfflineCB_matchedEFCB_matchedL2CB_PhiCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Phi,'+chain+'_OfflineCBmatchedL2CB_Phi;OfflineCB_matchedEFCB_matchedL2CB_PhiCor',
                                   title='PhiCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB #phi;OfflineCB matched to L2CB #phi',
-                                  cutmask=GroupName+'_matchedL2CB',
+                                  cutmask=chain+'_matchedL2CB',
                                   type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Eta,'+GroupName+'_OfflineCBmatchedL2CB_Eta;OfflineCB_matchedEFCB_matchedL2CB_EtaCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Eta,'+chain+'_OfflineCBmatchedL2CB_Eta;OfflineCB_matchedEFCB_matchedL2CB_EtaCor',
                                   title='EtaCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB #eta;OfflineCB matched to L2CB #eta',
-                                  cutmask=GroupName+'_matchedL2CB',
+                                  cutmask=chain+'_matchedL2CB',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
 
     return
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py
index 6e1713a725f4..740775e19655 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py
@@ -7,12 +7,13 @@ def L1MuonMonConfig(helper):
     monAlg = helper.addAlgorithm(CompFactory.L1MuonMonMT,'L1MuonMonMT')
 
 
-    histGroup = helper.addGroup(monAlg, 'L1MuonMonMT', 'HLT/MuonMon/L1Muon')
+    histGroup = helper.addGroup(monAlg, 'L1MuonMonMT', 'HLT/MuonMon/')
 
 
     import ROOT
-    histGroup.defineHistogram('l1Thres',title='L1Muon Thresholds;L1 threshold number;Events', type='TH1F', path='',xbins=6,xmin=1.0,xmax=7.0)
-    histGroup.defineHistogram('l1Eta',title='L1Muon Eta;#eta;Events', type='TH1F', path='',xbins=25,xmin=-3.0,xmax=3.0)
-    histGroup.defineHistogram('l1Phi',title='L1Muon Phi;#phi;Events', type='TH1F', path='',xbins=25,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
+    histGroup.defineHistogram('l1Thres',title='L1Muon Thresholds;L1 threshold number;Events', type='TH1F', path='L1Muon',xbins=6,xmin=1.0,xmax=7.0)
+    histGroup.defineHistogram('l1Eta',title='L1Muon Eta;#eta;Events', type='TH1F', path='L1Muon',xbins=25,xmin=-3.0,xmax=3.0)
+    histGroup.defineHistogram('l1Phi',title='L1Muon Phi;#phi;Events', type='TH1F', path='L1Muon',xbins=25,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
+    histGroup.defineHistogram('l1Eta,l1Phi;L1Muon_Eta_vs_Phi',title='L1Muon Eta vs Phi;#eta;#phi;Events', type='TH2F', path='etaphi2D',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
     return
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py
index 849df16bc877..c28dd2979f50 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py
@@ -1,459 +1,472 @@
 #  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
+import ROOT
 
 def L2MuonSAMonConfig(helper):
     
     from AthenaConfiguration.ComponentFactory import CompFactory
+
+    GroupName = 'L2MuonSA'
+
+    monAlg = helper.addAlgorithm(CompFactory.L2MuonSAMonMT,'L2MuonSAMonMT')
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20']
+    monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20']
+    monAlg.Group = GroupName
+
+    # configuration of etaphi2D and Ratio plots for non-specific chain
+    histGroupNonSpecificChain = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/')
 
-    for chain in Chains:
+    histGroupNonSpecificChain.defineHistogram('L2SAEta,L2SAPhi;L2MuonSA_Eta_vs_Phi',
+                                              title='L2MuonSA Eta vs Phi ;#eta;#phi',
+                                              type='TH2F', path='etaphi2D',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        GroupName = 'L2MuonSA_'+chain
+    histGroupNonSpecificChain.defineHistogram('L2SAAboveCut,LB;L2MuonSA_Over_OfflineSA_4GeV_Cut',
+                                              title='L2MuonSA Over OfflineSA 4GeV Cut;LB;Ratio', 
+                                              type='TEfficiency', path='Ratio',xbins=400,xmin=1.,xmax=801.)
 
-        monAlg = helper.addAlgorithm(CompFactory.L2MuonSAMonMT,'L2MuonSAMonMT_'+chain)
-        monAlg.MonitoredChains = [chain]
-        monAlg.Group = GroupName
 
-        histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/L2MuonSA/'+chain)
+    # configration for specific chain
+    for chain in monAlg.MonitoredChains:
+
+        histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/L2MuonSA/'+chain)
     
     
-        import ROOT
         # basic EDM variables
-        histGroup.defineHistogram(GroupName+'_Pt;L2MuonSA_Pt',
+        histGroup.defineHistogram(chain+'_Pt;L2MuonSA_Pt',
                                   title='L2MuonSA Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_Pt;L2MuonSA_Pt_Barrel',
+        histGroup.defineHistogram(chain+'_Pt;L2MuonSA_Pt_Barrel',
                                   title='L2MuonSA Pt Barrel '+chain+';p_{T} [GeV];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_Pt;L2MuonSA_Pt_Endcap',
+        histGroup.defineHistogram(chain+'_Pt;L2MuonSA_Pt_Endcap',
                                   title='L2MuonSA Pt Endcap '+chain+';p_{T} [GeV];Events',
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_Eta;L2MuonSA_Eta',
+        histGroup.defineHistogram(chain+'_Eta;L2MuonSA_Eta',
                                   title='L2MuonSA Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_Phi;L2MuonSA_Phi',
+        histGroup.defineHistogram(chain+'_Phi;L2MuonSA_Phi',
                                   title='L2MuonSA Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_Phi;L2MuonSA_Phi_Barrel',
+        histGroup.defineHistogram(chain+'_Phi;L2MuonSA_Phi_Barrel',
                                   title='L2MuonSA Phi Barrel '+chain+';#phi;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_Phi;L2MuonSA_Phi_Endcap',
+        histGroup.defineHistogram(chain+'_Phi;L2MuonSA_Phi_Endcap',
                                   title='L2MuonSA Phi Endcap '+chain+';#phi;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_Eta,'+GroupName+'_Phi;L2MuonSA_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_Eta,'+chain+'_Phi;L2MuonSA_Eta_vs_Phi',
                                   title='L2MuonSA Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
 
         # position and superpoint
-        histGroup.defineHistogram(GroupName+'_saddr;L2MuonSA_saddr',
+        histGroup.defineHistogram(chain+'_saddr;L2MuonSA_saddr',
                                   title='L2MuonSA station address '+chain+';address;Events',
                                   type='TH1I', path='',xbins=6,xmin=-1,xmax=5)
 
-        histGroup.defineHistogram(GroupName+'_MDTpoints_z,'+GroupName+'_MDTpoints_r;L2MuonSA_MDTpoints_z_vs_r',
+        histGroup.defineHistogram(chain+'_MDTpoints_z,'+chain+'_MDTpoints_r;L2MuonSA_MDTpoints_z_vs_r',
                                   title='L2MuonSA MDT superpoint Z vs R (mm) '+chain+';Z[mm];R[mm]', 
                                   type='TH2F', path='',xbins=200,xmin=-24000,xmax=24000, ybins=200,ymin=-14000,ymax=14000)
 
 
 
         # L1 RoI eta vs. phi in case mF failed
-        histGroup.defineHistogram(GroupName+'_roiEta,'+GroupName+'_roiPhi;L2MuonSA_failed_L1_eta_vs_phi',
+        histGroup.defineHistogram(chain+'_roiEta,'+chain+'_roiPhi;L2MuonSA_failed_L1_eta_vs_phi',
                                   title='L1 RoI Eta vs. Phi in case of L2MuonSA failure '+chain+';#eta;#phi', 
-                                  cutmask=GroupName+'_mf_failure',
+                                  cutmask=chain+'_mf_failure',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
 
         # MuonFeatureDetails
         # process floe
-        histGroup.defineHistogram(GroupName+'_proc_flow;L2MuonSA_proc_flow',
+        histGroup.defineHistogram(chain+'_proc_flow;L2MuonSA_proc_flow',
                                   title='L2MuonSA process flow '+chain+';;Events', 
                                   type='TH1I', path='',xbins=6,xmin=1,xmax=7,
                                   xlabels=["input","n L1 hits > 0","L1 emu ok at trigger layer","n MDT hits > 0 at middle layer","MDT fit ok at middle layer","MDT fit ok at >= 2 layers"])
 
 
         # RPC
-        histGroup.defineHistogram(GroupName+'_RPC_Pad_N;L2MuonSA_RPC_Pad_N',
+        histGroup.defineHistogram(chain+'_RPC_Pad_N;L2MuonSA_RPC_Pad_N',
                                   title='L2MuonSA RPC number of hits '+chain+';RPC number of hits;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1I', path='',xbins=20,xmin=0,xmax=20)
 
 
         # TGC
-        histGroup.defineHistogram(GroupName+'_TGC_Mid_rho_chi2;L2MuonSA_TGC_Mid_rho_chi2',
+        histGroup.defineHistogram(chain+'_TGC_Mid_rho_chi2;L2MuonSA_TGC_Mid_rho_chi2',
                                   title='L2MuonSA TGC big wheel rho fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_TGC_Mid_phi_chi2;L2MuonSA_TGC_Mid_phi_chi2',
+        histGroup.defineHistogram(chain+'_TGC_Mid_phi_chi2;L2MuonSA_TGC_Mid_phi_chi2',
                                   title='L2MuonSA TGC big wheel phi fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_TGC_Mid_rho_N;L2MuonSA_TGC_Mid_rho_N',
+        histGroup.defineHistogram(chain+'_TGC_Mid_rho_N;L2MuonSA_TGC_Mid_rho_N',
                                   title='L2MuonSA TGC big wheel number of hits in rho '+chain+';TGC BW rho nhits;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=20,xmin=0,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_TGC_Mid_phi_N;L2MuonSA_TGC_Mid_phi_N',
+        histGroup.defineHistogram(chain+'_TGC_Mid_phi_N;L2MuonSA_TGC_Mid_phi_N',
                                   title='L2MuonSA TGC big wheel number of hits in phi '+chain+';TGC BW phi nhits;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=20,xmin=0,xmax=20)
 
 
         # MDT
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_fit_chi2;L2MuonSA_MDT_Inn_fit_chi2_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Inn_fit_chi2;L2MuonSA_MDT_Inn_fit_chi2_barrel',
                                   title='L2MuonSA barrel MDT Inner station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_fit_chi2;L2MuonSA_MDT_Mid_fit_chi2_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Mid_fit_chi2;L2MuonSA_MDT_Mid_fit_chi2_barrel',
                                   title='L2MuonSA barrel MDT Middle station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_fit_chi2;L2MuonSA_MDT_Out_fit_chi2_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Out_fit_chi2;L2MuonSA_MDT_Out_fit_chi2_barrel',
                                   title='L2MuonSA barrel MDT Outer station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_fit_chi2;L2MuonSA_MDT_Inn_fit_chi2_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Inn_fit_chi2;L2MuonSA_MDT_Inn_fit_chi2_endcap',
                                   title='L2MuonSA endcap MDT Inner station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_fit_chi2;L2MuonSA_MDT_Mid_fit_chi2_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Mid_fit_chi2;L2MuonSA_MDT_Mid_fit_chi2_endcap',
                                   title='L2MuonSA endcap MDT Middle station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_fit_chi2;L2MuonSA_MDT_Out_fit_chi2_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Out_fit_chi2;L2MuonSA_MDT_Out_fit_chi2_endcap',
                                   title='L2MuonSA endcap MDT Outer station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_N;L2MuonSA_MDT_N_barrel',
+        histGroup.defineHistogram(chain+'_MDT_N;L2MuonSA_MDT_N_barrel',
                                   title='L2MuonSA barrel MDT number of hits '+chain+';MDT nhits;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_N;L2MuonSA_MDT_Inn_N_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Inn_N;L2MuonSA_MDT_Inn_N_barrel',
                                   title='L2MuonSA barrel MDT Inner number of hits '+chain+';MDT nhits Inner;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_N;L2MuonSA_MDT_Mid_N_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Mid_N;L2MuonSA_MDT_Mid_N_barrel',
                                   title='L2MuonSA barrel MDT Middle number of hits '+chain+';MDT nhits Middle;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_N;L2MuonSA_MDT_Out_N_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Out_N;L2MuonSA_MDT_Out_N_barrel',
                                   title='L2MuonSA barrel MDT Outer number of hits '+chain+';MDT nhits Outer;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_N;L2MuonSA_MDT_N_endcap',
+        histGroup.defineHistogram(chain+'_MDT_N;L2MuonSA_MDT_N_endcap',
                                   title='L2MuonSA endcap MDT number of hits '+chain+';MDT nhits;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_N;L2MuonSA_MDT_Inn_N_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Inn_N;L2MuonSA_MDT_Inn_N_endcap',
                                   title='L2MuonSA endcap MDT Inner number of hits '+chain+';MDT nhits Inner;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_N;L2MuonSA_MDT_Mid_N_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Mid_N;L2MuonSA_MDT_Mid_N_endcap',
                                   title='L2MuonSA endcap MDT Middle number of hits '+chain+';MDT nhits Middle;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_N;L2MuonSA_MDT_Out_N_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Out_N;L2MuonSA_MDT_Out_N_endcap',
                                   title='L2MuonSA endcap MDT Outer number of hits '+chain+';MDT nhits Outer;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_barrel',
                                   title='L2MuonSA barrel MDT Inner station residual '+chain+';MDT Inner barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_barrel',
                                   title='L2MuonSA barrel MDT Middle station residual '+chain+';MDT Middle barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_barrel',
                                   title='L2MuonSA barrel MDT Outer station residual '+chain+';MDT Outer barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_residual_OffMatch;L2MuonSA_MDT_Inn_residual_barrel_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Inn_residual_OffMatch;L2MuonSA_MDT_Inn_residual_barrel_OffMatch',
                                   title='L2MuonSA barrel MDT Inner station residual matched with Offline '+chain+';MDT Inner barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_residual_OffMatch;L2MuonSA_MDT_Mid_residual_barrel_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Mid_residual_OffMatch;L2MuonSA_MDT_Mid_residual_barrel_OffMatch',
                                   title='L2MuonSA barrel MDT Middle station residual matched with Offline '+chain+';MDT Middle barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_residual_OffMatch;L2MuonSA_MDT_Out_residual_barrel_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Out_residual_OffMatch;L2MuonSA_MDT_Out_residual_barrel_OffMatch',
                                   title='L2MuonSA barrel MDT Outer station residual matched with Offline '+chain+';MDT Outer barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_barrel_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_barrel_vs_LB',
                                   title='L2MuonSA barrel MDT Inner station residual vs LB '+chain+';LB;MDT Inner barrel residual [cm]', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_barrel_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_barrel_vs_LB',
                                   title='L2MuonSA barrel MDT Middle station residual vs LB '+chain+';LB;MDT Middle barrel residual [cm]', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_barrel_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_barrel_vs_LB',
                                   title='L2MuonSA barrel MDT Outer station residual vs LB '+chain+';LB;MDT Outer barrel residual [cm]', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_endcap',
                                   title='L2MuonSA endcap MDT Inner station residual '+chain+';MDT Inner endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_endcap',
                                   title='L2MuonSA endcap MDT Middle station residual '+chain+';MDT Middle endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_endcap',
                                   title='L2MuonSA endcap MDT Outer station residual '+chain+';MDT Outer endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_residual_OffMatch;L2MuonSA_MDT_Inn_residual_endcap_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Inn_residual_OffMatch;L2MuonSA_MDT_Inn_residual_endcap_OffMatch',
                                   title='L2MuonSA endcap MDT Inner station residual matched with Offline '+chain+';MDT Inner endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_residual_OffMatch;L2MuonSA_MDT_Mid_residual_endcap_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Mid_residual_OffMatch;L2MuonSA_MDT_Mid_residual_endcap_OffMatch',
                                   title='L2MuonSA endcap MDT Middle station residual matched with Offline '+chain+';MDT Middle endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_residual_OffMatch;L2MuonSA_MDT_Out_residual_endcap_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Out_residual_OffMatch;L2MuonSA_MDT_Out_residual_endcap_OffMatch',
                                   title='L2MuonSA endcap MDT Outer station residual matched with Offline '+chain+';MDT Outer endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_endcap_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_endcap_vs_LB',
                                   title='L2MuonSA endcap MDT Inner station residual vs LB '+chain+';LB;MDT Inner endcap residual [cm]', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_endcap_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_endcap_vs_LB',
                                   title='L2MuonSA endcap MDT Middle station residual vs LB '+chain+';LB;MDT Middle endcap residual [cm]', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_endcap_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_endcap_vs_LB',
                                   title='L2MuonSA endcap MDT Outer station residual vs LB '+chain+';LB;MDT Outer endcap residual [cm]', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
 
 
         # Comparison to Offline
         # dR wrt Offline
-        histGroup.defineHistogram(GroupName+'_dRmin;L2MuonSA_dR_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_dRmin;L2MuonSA_dR_toRecMuonCB',
                                   title='dR between L2MuonSA and Offline '+chain+';#DeltaR;Events', 
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=2)
 
 
         # L1 RoI wrt offline
-        histGroup.defineHistogram(GroupName+'_initialRoI_dR;L2MuonSA_initialRoI_dR_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_initialRoI_dR;L2MuonSA_initialRoI_dR_toRecMuonCB',
                                   title='L2MuonSA initialRoI dR wrt offline CB '+chain+';dR(initialRoI vs offl CB);Events', 
                                   type='TH1F', path='',xbins=100,xmin=0.,xmax=0.5)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_initialRoI_dEta;L2MuonSA_initialRoI_dEta_vs_Eta_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_initialRoI_dEta;L2MuonSA_initialRoI_dEta_vs_Eta_toRecMuonCB',
                                   title='L2MuonSA initialRoI wrt Offline CB muon, d#eta '+chain+';offl CB #eta;d#eta(initialRoI vs offl CB)', 
                                   type='TH2F', path='',xbins=54,xmin=-2.7,xmax=2.7, ybins=60,ymin=-0.3,ymax=0.3)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_initialRoI_dPhi;L2MuonSA_initialRoI_dPhi_vs_Eta_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_initialRoI_dPhi;L2MuonSA_initialRoI_dPhi_vs_Eta_toRecMuonCB',
                                   title='L2MuonSA initialRoI wrt Offline CB muon, d#phi '+chain+';offl CB #eta;d#phi(initialRoI vs offl CB)', 
                                   type='TH2F', path='',xbins=54,xmin=-2.7,xmax=2.7, ybins=44,ymin=-0.2,ymax=0.2)
 
 
         # pt resolution (barrel, endcap1, endcap2, or endcap3) (A-side or C-side)
-        histGroup.defineHistogram(GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB',
                                   title='L2MuonSA pT resolution wrt Offline '+chain+';p_{T} resol;Events', 
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_BR',
+        histGroup.defineHistogram(chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_BR',
                                   title='L2MuonSA pT resolution wrt Offline Barrel '+chain+';p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC1',
+        histGroup.defineHistogram(chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC1',
                                   title='L2MuonSA pT resolution wrt Offline Endcap1 '+chain+';p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap1',
+                                  cutmask=chain+'_isEndcap1',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC2',
+        histGroup.defineHistogram(chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC2',
                                   title='L2MuonSA pT resolution wrt Offline Endcap2 '+chain+';p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap2',
+                                  cutmask=chain+'_isEndcap2',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC3',
+        histGroup.defineHistogram(chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC3',
                                   title='L2MuonSA pT resolution wrt Offline Endcap3 '+chain+';p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap3',
+                                  cutmask=chain+'_isEndcap3',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
 
-        histGroup.defineHistogram(GroupName+'_offPt_signed,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_barrel_A',
+        histGroup.defineHistogram(chain+'_offPt_signed,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_barrel_A',
                                   title='L2MuonSA barrel A pT resolution wrt Offline in pt '+chain+';p_{T} [GeV/c];p_{T} resol', 
-                                  cutmask=GroupName+'_isBarrelA',
+                                  cutmask=chain+'_isBarrelA',
                                   type='TH2F', path='',xbins=104,xmin=-52.,xmax=52.,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offPt_signed,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_barrel_C',
+        histGroup.defineHistogram(chain+'_offPt_signed,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_barrel_C',
                                   title='L2MuonSA barrel C pT resolution wrt Offline in pt '+chain+';p_{T} [GeV/c];p_{T} resol', 
-                                  cutmask=GroupName+'_isBarrelC',
+                                  cutmask=chain+'_isBarrelC',
                                   type='TH2F', path='',xbins=104,xmin=-52.,xmax=52.,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offPt_signed,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_endcap_A',
+        histGroup.defineHistogram(chain+'_offPt_signed,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_endcap_A',
                                   title='L2MuonSA endcap A pT resolution wrt Offline in pt '+chain+';p_{T} [GeV/c];p_{T} resol', 
-                                  cutmask=GroupName+'_isEndcapA',
+                                  cutmask=chain+'_isEndcapA',
                                   type='TH2F', path='',xbins=104,xmin=-52.,xmax=52.,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offPt_signed,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_endcap_C',
+        histGroup.defineHistogram(chain+'_offPt_signed,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_endcap_C',
                                   title='L2MuonSA endcap C pT resolution wrt Offline in pt '+chain+';p_{T} [GeV/c];p_{T} resol', 
-                                  cutmask=GroupName+'_isEndcapC',
+                                  cutmask=chain+'_isEndcapC',
                                   type='TH2F', path='',xbins=104,xmin=-52.,xmax=52.,ybins=100,ymin=-2.,ymax=2.)
 
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta',
                                   title='L2MuonSA pT resolution wrt Offline in eta '+chain+';#eta;p_{T} resol', 
                                   type='TH2F', path='',xbins=27,xmin=-2.7,xmax=2.7,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT4_6',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT4_6',
                                   title='L2MuonSA pT resolution wrt Offline in eta (pT4GeV-6GeV) '+chain+';#eta;p_{T} resol', 
-                                  cutmask=GroupName+'_pt4to6',
+                                  cutmask=chain+'_pt4to6',
                                   type='TH2F', path='',xbins=27,xmin=-2.7,xmax=2.7,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT6_8',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT6_8',
                                   title='L2MuonSA pT resolution wrt Offline in eta (pT6GeV-8GeV) '+chain+';#eta;p_{T} resol', 
-                                  cutmask=GroupName+'_pt6to8',
+                                  cutmask=chain+'_pt6to8',
                                   type='TH2F', path='',xbins=27,xmin=-2.7,xmax=2.7,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT8_x',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT8_x',
                                   title='L2MuonSA pT resolution wrt Offline in eta (pT over 8GeV) '+chain+';#eta;p_{T} resol', 
-                                  cutmask=GroupName+'_ptover8',
+                                  cutmask=chain+'_ptover8',
                                   type='TH2F', path='',xbins=27,xmin=-2.7,xmax=2.7,ybins=100,ymin=-2.,ymax=2.)
 
 
         # inverse pt resolution (positive or negative muon) (A-side or C-side) (barrel, endcap1, endcap2, or endcap3)
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos',
                                   title='L2MuonSA pT resolution wrt Offline positive muons '+chain+';1/p_{T} resol;Events', 
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg',
                                   title='L2MuonSA pT resolution wrt Offline negative muons '+chain+';1/p_{T} resol;Events', 
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_BR_A',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_BR_A',
                                   title='L2MuonSA pT resolution wrt Offline pos muons Barrel A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isBarrelA',
+                                  cutmask=chain+'_isBarrelA',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_BR_A',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_BR_A',
                                   title='L2MuonSA pT resolution wrt Offline neg muons Barrel A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isBarrelA',
+                                  cutmask=chain+'_isBarrelA',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC1_A',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC1_A',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap1 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap1A',
+                                  cutmask=chain+'_isEndcap1A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC1_A',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC1_A',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap1 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap1A',
+                                  cutmask=chain+'_isEndcap1A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC2_A',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC2_A',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap2 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap2A',
+                                  cutmask=chain+'_isEndcap2A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC2_A',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC2_A',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap2 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap2A',
+                                  cutmask=chain+'_isEndcap2A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC3_A',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC3_A',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap3 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap3A',
+                                  cutmask=chain+'_isEndcap3A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC3_A',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC3_A',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap3 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap3A',
+                                  cutmask=chain+'_isEndcap3A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_BR_C',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_BR_C',
                                   title='L2MuonSA pT resolution wrt Offline pos muons Barrel C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isBarrelC',
+                                  cutmask=chain+'_isBarrelC',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_BR_C',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_BR_C',
                                   title='L2MuonSA pT resolution wrt Offline neg muons Barrel C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isBarrelC',
+                                  cutmask=chain+'_isBarrelC',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC1_C',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC1_C',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap1 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap1C',
+                                  cutmask=chain+'_isEndcap1C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC1_C',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC1_C',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap1 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap1C',
+                                  cutmask=chain+'_isEndcap1C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC2_C',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC2_C',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap2 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap2C',
+                                  cutmask=chain+'_isEndcap2C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC2_C',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC2_C',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap2 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap2C',
+                                  cutmask=chain+'_isEndcap2C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC3_C',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC3_C',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap3 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap3C',
+                                  cutmask=chain+'_isEndcap3C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC3_C',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC3_C',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap3 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap3C',
+                                  cutmask=chain+'_isEndcap3C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
+
     return
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py
index 05d0edcb00bb..d76221f436dd 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py
@@ -1,162 +1,176 @@
 #  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
+import ROOT
 
 def L2muCombMonConfig(helper):
     
     from AthenaConfiguration.ComponentFactory import CompFactory
+
+    GroupName = 'L2muComb'
+
+    monAlg = helper.addAlgorithm(CompFactory.L2muCombMonMT,'L2muCombMonMT')
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20']
+    monAlg.MonitoredChains =  ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20']
+    monAlg.Group = GroupName
 
-    for chain in Chains:
+    # configuration of etaphi2D and Ratio plots for non-specific chain
+    histGroupNonSpecificChain = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/')
 
-        GroupName = 'L2muComb_'+chain
+    histGroupNonSpecificChain.defineHistogram('L2CBEta,L2CBPhi;L2muComb_Eta_vs_Phi',
+                                              title='L2muComb Eta vs Phi ;#eta;#phi',
+                                              type='TH2F', path='etaphi2D',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        monAlg = helper.addAlgorithm(CompFactory.L2muCombMonMT,'L2muCombMonMT_'+chain)
-        monAlg.MonitoredChains = [chain]
-        monAlg.Group = GroupName
+    histGroupNonSpecificChain.defineHistogram('L2CBAboveCut,LB;L2muComb_Over_OfflineCB_4GeV_Cut',
+                                              title='L2muComb Over OfflineCB 4GeV Cut;LB;Ratio',
+                                              type='TEfficiency', path='Ratio',xbins=400,xmin=1.,xmax=801.)
 
-        histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/L2muComb/'+chain)
-    
+
+    # configration for specific chain
+    for chain in monAlg.MonitoredChains:
+
+        histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/L2muComb/'+chain)
     
-        import ROOT
+
         # basic EDM variables
-        histGroup.defineHistogram(GroupName+'_Pt;L2muComb_Pt',
+        histGroup.defineHistogram(chain+'_Pt;L2muComb_Pt',
                                   title='L2muComb Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_Eta;L2muComb_Eta',
+        histGroup.defineHistogram(chain+'_Eta;L2muComb_Eta',
                                   title='L2muComb Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_Phi;L2muComb_Phi',
+        histGroup.defineHistogram(chain+'_Phi;L2muComb_Phi',
                                   title='L2muComb Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_Eta,'+GroupName+'_Phi;L2muComb_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_Eta,'+chain+'_Phi;L2muComb_Eta_vs_Phi',
                                   title='L2muComb Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
         #  eta vs. phi Combine success or failure, and matched or not offline muon
-        histGroup.defineHistogram(GroupName+'_Eta,'+GroupName+'_Phi;L2muComb_Eta_vs_Phi_L2CB_success',
+        histGroup.defineHistogram(chain+'_Eta,'+chain+'_Phi;L2muComb_Eta_vs_Phi_L2CB_success',
                                   title='L2muComb Eta vs Phi (L2CB reconstruction success) '+chain+';#eta;#phi', 
-                                  cutmask=GroupName+'_L2CB_success',
+                                  cutmask=chain+'_L2CB_success',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_Eta,'+GroupName+'_Phi;L2muComb_Eta_vs_Phi_L2CBOFFmatching_failure',
+        histGroup.defineHistogram(chain+'_Eta,'+chain+'_Phi;L2muComb_Eta_vs_Phi_L2CBOFFmatching_failure',
                                   title='L2muComb Eta vs Phi (L2CB reconstruction success Off match failure) '+chain+';#eta;#phi', 
-                                  cutmask=GroupName+'_L2CBOFFmatching_failure',
+                                  cutmask=chain+'_L2CBOFFmatching_failure',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_saEta,'+GroupName+'_saPhi;L2MuonSA_Eta_vs_Phi_L2CB_failure',
+        histGroup.defineHistogram(chain+'_saEta,'+chain+'_saPhi;L2MuonSA_Eta_vs_Phi_L2CB_failure',
                                   title='L2MuonSA Eta vs Phi (L2CB reconstruction failure L2SA Off match success) '+chain+';#eta;#phi', 
-                                  cutmask=GroupName+'_L2CB_failure',
+                                  cutmask=chain+'_L2CB_failure',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
         # L2MuonSA EDM variables in case of L2muComb failure
-        histGroup.defineHistogram(GroupName+'_saPt;L2muComb_failed_saPt',
+        histGroup.defineHistogram(chain+'_saPt;L2muComb_failed_saPt',
                                   title='L2MuonSA Pt (GeV/c) for muComb fails '+chain+';p_{T} [GeV];Events', 
-                                  cutmask=GroupName+'_L2SA_success',
+                                  cutmask=chain+'_L2SA_success',
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_saEta;L2muComb_failed_saEta',
+        histGroup.defineHistogram(chain+'_saEta;L2muComb_failed_saEta',
                                   title='L2MuonSA Eta for muComb fails '+chain+';#eta;Events', 
-                                  cutmask=GroupName+'_L2SA_success',
+                                  cutmask=chain+'_L2SA_success',
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_saPhi;L2muComb_failed_saPhi',
+        histGroup.defineHistogram(chain+'_saPhi;L2muComb_failed_saPhi',
                                   title='L2MuonSA Phi for muComb fails '+chain+';#phi;Events', 
-                                  cutmask=GroupName+'_L2SA_success',
+                                  cutmask=chain+'_L2SA_success',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
 
         # comparison L2muComb vs L2MuonSA
-        histGroup.defineHistogram(GroupName+'_ptratio_toSA;L2muComb_ptratio_toSA',
+        histGroup.defineHistogram(chain+'_ptratio_toSA;L2muComb_ptratio_toSA',
                                   title='L2muComb pt / L2MuonSA pt '+chain+';p_{T} ratio;Events', 
                                   type='TH1F', path='',xbins=140,xmin=-0.5,xmax=3.)
 
-        histGroup.defineHistogram(GroupName+'_dR_toSA;L2muComb_dR_toSA',
+        histGroup.defineHistogram(chain+'_dR_toSA;L2muComb_dR_toSA',
                                   title='L2muComb delta R to L2MuonSA '+chain+';#DeltaR;Events', 
                                   type='TH1F', path='',xbins=100,xmin=0.,xmax=0.5)
 
-        histGroup.defineHistogram(GroupName+'_dEta_toSA;L2muComb_dEta_toSA',
+        histGroup.defineHistogram(chain+'_dEta_toSA;L2muComb_dEta_toSA',
                                   title='L2muComb delta eta to L2MuonSA '+chain+';#Delta#eta;Events', 
                                   type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
 
-        histGroup.defineHistogram(GroupName+'_dPhi_toSA;L2muComb_dPhi_toSA',
+        histGroup.defineHistogram(chain+'_dPhi_toSA;L2muComb_dPhi_toSA',
                                   title='L2muComb delta phi to L2MuonSA '+chain+';#Delta#phi;Events', 
                                   type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
 
-        histGroup.defineHistogram(GroupName+'_MF_error;L2muComb_MF_error',
+        histGroup.defineHistogram(chain+'_MF_error;L2muComb_MF_error',
                                   title='L2muComb pointer to MuonFeature Error '+chain+';;Events',
                                   type='TH1I', path='',xbins=4,xmin=0,xmax=4,
                                   xlabels=["No error","Missing muSATrackLink","TrackLink and ElementLinnk matching error","SA reconstruction Error"])
 
 
         # ID variables
-        histGroup.defineHistogram(GroupName+'_trkPt;L2muComb_trkPt',
+        histGroup.defineHistogram(chain+'_trkPt;L2muComb_trkPt',
                                   title='L2muComb Trk Pt (GeV/c) '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_trkEta;L2muComb_trkEta',
+        histGroup.defineHistogram(chain+'_trkEta;L2muComb_trkEta',
                                   title='L2muComb Trk Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_trkPhi;L2muComb_trkPhi',
+        histGroup.defineHistogram(chain+'_trkPhi;L2muComb_trkPhi',
                                   title='L2muComb Trk Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_trkZ0;L2muComb_trkZ0',
+        histGroup.defineHistogram(chain+'_trkZ0;L2muComb_trkZ0',
                                   title='L2muComb Trk z0 (mm) '+chain+';z0[mm];Events', 
                                   type='TH1F', path='',xbins=150,xmin=-300.,xmax=300.)
 
-        histGroup.defineHistogram(GroupName+'_trkChi2;L2muComb_trkChi2',
+        histGroup.defineHistogram(chain+'_trkChi2;L2muComb_trkChi2',
                                   title='L2muComb Trk chi2 '+chain+';#chi^{2};Events', 
                                   type='TH1F', path='',xbins=50,xmin=0.,xmax=10.)
 
 
         # comparison L2muComb (ID track) vs L2MuonSA
-        histGroup.defineHistogram(GroupName+'_ptratio_TrktoSA;L2muComb_ptratio_TrktoSA',
+        histGroup.defineHistogram(chain+'_ptratio_TrktoSA;L2muComb_ptratio_TrktoSA',
                                   title='L2muComb Trk  pt / L2MuonSA pt '+chain+';p_{T} ratio;Events', 
                                   type='TH1F', path='',xbins=140,xmin=-0.5,xmax=3.)
 
-        histGroup.defineHistogram(GroupName+'_dR_TrktoSA;L2muComb_dR_TrktoSA',
+        histGroup.defineHistogram(chain+'_dR_TrktoSA;L2muComb_dR_TrktoSA',
                                   title='L2muComb delta R Trk to L2MuonSA '+chain+';#DeltaR;Events', 
                                   type='TH1F', path='',xbins=100,xmin=0.,xmax=0.5)
 
-        histGroup.defineHistogram(GroupName+'_dEta_TrktoSA;L2muComb_dEta_TrktoSA',
+        histGroup.defineHistogram(chain+'_dEta_TrktoSA;L2muComb_dEta_TrktoSA',
                                   title='L2muComb delta eta Trk to L2MuonSA '+chain+';#Delta#eta;Events', 
                                   type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
 
-        histGroup.defineHistogram(GroupName+'_dPhi_TrktoSA;L2muComb_dPhi_TrktoSA',
+        histGroup.defineHistogram(chain+'_dPhi_TrktoSA;L2muComb_dPhi_TrktoSA',
                                   title='L2muComb delta phi Trk to L2MuonSA '+chain+';#Delta#phi;Events', 
                                   type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
 
 
         # Comparison to Offline
-        histGroup.defineHistogram(GroupName+'_dRmin;L2muComb_dR_toOffl',
+        histGroup.defineHistogram(chain+'_dRmin;L2muComb_dR_toOffl',
                                   title='dR between L2muComb and Offline '+chain+';#DeltaR;Events', 
                                   type='TH1F', path='',xbins=100,xmin=0.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_ptresol;L2muComb_ptresol_toOffl',
+        histGroup.defineHistogram(chain+'_ptresol;L2muComb_ptresol_toOffl',
                                   title='L2muComb pT resolution wrt Offline '+chain+';p_{T} resol;Events', 
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_ptresol;L2muComb_ptresol_toOffl_eta',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_ptresol;L2muComb_ptresol_toOffl_eta',
                                   title='L2muComb pT resolution wrt Offline in eta '+chain+';#eta;p_{T} resol', 
                                   type='TH2F', path='',xbins=16,xmin=-3.2,xmax=3.2, ybins=100,ymin=-2.,ymax=2.)
 
 
         # Comparison HLT_Roi_L2SAMuon variables to Offline
-        histGroup.defineHistogram(GroupName+'_L2SARoI_dR;L2MuonSA_L2SARoI_dR_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_L2SARoI_dR;L2MuonSA_L2SARoI_dR_toRecMuonCB',
                                   title='L2MuonSA L2SARoI dR wrt offline CB '+chain+';dR(L2SARoI vs offl CB);Events', 
                                   type='TH1F', path='',xbins=100,xmin=0.,xmax=0.5)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_L2SARoI_dEta;L2MuonSA_L2SARoI_dEta_vs_Eta_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_L2SARoI_dEta;L2MuonSA_L2SARoI_dEta_vs_Eta_toRecMuonCB',
                                   title='L2MuonSA L2SARoI wrt Offline CB muon, d#eta '+chain+';offl CB #eta;d#eta(L2SARoI vs offl CB)', 
                                   type='TH2F', path='',xbins=54,xmin=-2.7,xmax=2.7, ybins=60,ymin=-0.3,ymax=0.3)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_L2SARoI_dPhi;L2MuonSA_L2SARoI_dPhi_vs_Eta_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_L2SARoI_dPhi;L2MuonSA_L2SARoI_dPhi_vs_Eta_toRecMuonCB',
                                   title='L2MuonSA L2SARoI wrt Offline CB muon, d#phi '+chain+';offl CB #eta;d#phi(L2SARoI vs offl CB)', 
                                   type='TH2F', path='',xbins=54,xmin=-2.7,xmax=2.7, ybins=44,ymin=-0.2,ymax=0.2)
+
+    return
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx
index 3247ad55b440..bd5fb0120e73 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx
@@ -11,6 +11,15 @@ EFMuonMonMT :: EFMuonMonMT(const std::string& name, ISvcLocator* pSvcLocator )
   : TrigMuonMonitorAlgorithm(name, pSvcLocator)
 {}
 
+
+StatusCode EFMuonMonMT :: initialize(){
+  StatusCode sc = TrigMuonMonitorAlgorithm::initialize();
+  ATH_CHECK( m_EFSAMuonContainerKey.initialize() );
+  ATH_CHECK( m_EFCBMuonContainerKey.initialize() );
+  return sc;
+}
+
+
 StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext& , const std::string &chain) const {
 
   ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
@@ -20,18 +29,19 @@ StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext& , const std:
   for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muSALinkInfo : featureContSA) {
     ATH_CHECK( muSALinkInfo.isValid() );
     const ElementLink<xAOD::MuonContainer> muSAEL = muSALinkInfo.link;
-    if ( ! (*muSAEL)->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle) ) continue;
+    const xAOD::TrackParticle* EFSATrack = (*muSAEL)->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
+    if ( !EFSATrack ) continue;
 
     // basic EDM variables
-    auto EFSAPt = Monitored::Scalar<float>(m_group+"_EFSA_Pt",-999.);
-    auto EFSAEta = Monitored::Scalar<float>(m_group+"_EFSA_Eta",-999.);
-    auto EFSAPhi = Monitored::Scalar<float>(m_group+"_EFSA_Phi",-999.);
+    auto EFSAPt = Monitored::Scalar<float>(chain+"_EFSA_Pt",-999.);
+    auto EFSAEta = Monitored::Scalar<float>(chain+"_EFSA_Eta",-999.);
+    auto EFSAPhi = Monitored::Scalar<float>(chain+"_EFSA_Phi",-999.);
 
-    EFSAPt = (*muSAEL)->pt()/1e3 * (*muSAEL)->charge(); // convert to GeV
-    EFSAEta = (*muSAEL)->eta();
-    EFSAPhi = (*muSAEL)->phi();
+    EFSAPt = EFSATrack->pt()/1e3 * EFSATrack->charge(); // convert to GeV
+    EFSAEta = EFSATrack->eta();
+    EFSAPhi = EFSATrack->phi();
 
-    fill(m_group, EFSAPt, EFSAEta, EFSAPhi);
+    fill(m_group+"_"+chain, EFSAPt, EFSAEta, EFSAPhi);
   }
 
 
@@ -40,18 +50,19 @@ StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext& , const std:
   for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muCBLinkInfo : featureContCB) {
     ATH_CHECK( muCBLinkInfo.isValid() );
     const ElementLink<xAOD::MuonContainer> muCBEL = muCBLinkInfo.link;
-    if ( ! (*muCBEL)->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle) ) continue;
+    const xAOD::TrackParticle* EFCBTrack = (*muCBEL)->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle);
+    if ( !EFCBTrack ) continue;
 
     // basic EDM variables
-    auto EFCBPt = Monitored::Scalar<float>(m_group+"_EFCB_Pt",-999.);
-    auto EFCBEta = Monitored::Scalar<float>(m_group+"_EFCB_Eta",-999.);
-    auto EFCBPhi = Monitored::Scalar<float>(m_group+"_EFCB_Phi",-999.);
+    auto EFCBPt = Monitored::Scalar<float>(chain+"_EFCB_Pt",-999.);
+    auto EFCBEta = Monitored::Scalar<float>(chain+"_EFCB_Eta",-999.);
+    auto EFCBPhi = Monitored::Scalar<float>(chain+"_EFCB_Phi",-999.);
 
-    EFCBPt = (*muCBEL)->pt()/1e3 * (*muCBEL)->charge(); // convert to GeV
-    EFCBEta = (*muCBEL)->eta();
-    EFCBPhi = (*muCBEL)->phi();
+    EFCBPt = EFCBTrack->pt()/1e3 * EFCBTrack->charge(); // convert to GeV
+    EFCBEta = EFCBTrack->eta();
+    EFCBPhi = EFCBTrack->phi();
 
-    fill(m_group, EFCBPt, EFCBEta, EFCBPhi);
+    fill(m_group+"_"+chain, EFCBPt, EFCBEta, EFCBPhi);
   }
 
   return StatusCode::SUCCESS;
@@ -68,25 +79,25 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext
 
   // OfflineSA
   if( OfflineSATrack ){
-    auto OfflineSAPt = Monitored::Scalar<float>(m_group+"_OfflineSA_Pt",-999.);
-    auto OfflineSAEta = Monitored::Scalar<float>(m_group+"_OfflineSA_Eta",-999.);
-    auto OfflineSAPhi = Monitored::Scalar<float>(m_group+"_OfflineSA_Phi",-999.);
+    auto OfflineSAPt = Monitored::Scalar<float>(chain+"_OfflineSA_Pt",-999.);
+    auto OfflineSAEta = Monitored::Scalar<float>(chain+"_OfflineSA_Eta",-999.);
+    auto OfflineSAPhi = Monitored::Scalar<float>(chain+"_OfflineSA_Phi",-999.);
 
-    auto matchedEFSA = Monitored::Scalar<bool>(m_group+"_matchedEFSA",false);
-    auto matchedL2SA = Monitored::Scalar<bool>(m_group+"_matchedL2SA",false);
+    auto matchedEFSA = Monitored::Scalar<bool>(chain+"_matchedEFSA",false);
+    auto matchedL2SA = Monitored::Scalar<bool>(chain+"_matchedL2SA",false);
 
-    auto OfflineSAmatchedL2SAPt = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Pt",-999.);
-    auto OfflineSAmatchedL2SAEta = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Eta",-999.);
-    auto OfflineSAmatchedL2SAPhi = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Phi",-999.);
+    auto OfflineSAmatchedL2SAPt = Monitored::Scalar<float>(chain+"_OfflineSAmatchedL2SA_Pt",-999.);
+    auto OfflineSAmatchedL2SAEta = Monitored::Scalar<float>(chain+"_OfflineSAmatchedL2SA_Eta",-999.);
+    auto OfflineSAmatchedL2SAPhi = Monitored::Scalar<float>(chain+"_OfflineSAmatchedL2SA_Phi",-999.);
  
-    auto MatchedEFSAPt = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Pt",-999.);
-    auto MatchedEFSAEta = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Eta",-999.);
-    auto MatchedEFSAPhi = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Phi",-999.);
+    auto MatchedEFSAPt = Monitored::Scalar<float>(chain+"_MatchedEFSA_Pt",-999.);
+    auto MatchedEFSAEta = Monitored::Scalar<float>(chain+"_MatchedEFSA_Eta",-999.);
+    auto MatchedEFSAPhi = Monitored::Scalar<float>(chain+"_MatchedEFSA_Phi",-999.);
 
-    auto SAdR = Monitored::Scalar<float>(m_group+"_SAdR",1000.);
-    auto SAdPt = Monitored::Scalar<float>(m_group+"_SAdPt",-999.);
-    auto SAdEta = Monitored::Scalar<float>(m_group+"_SAdEta",-999.);
-    auto SAdPhi = Monitored::Scalar<float>(m_group+"_SAdPhi",-999.);
+    auto SAdR = Monitored::Scalar<float>(chain+"_SAdR",1000.);
+    auto SAdPt = Monitored::Scalar<float>(chain+"_SAdPt",-999.);
+    auto SAdEta = Monitored::Scalar<float>(chain+"_SAdEta",-999.);
+    auto SAdPhi = Monitored::Scalar<float>(chain+"_SAdPhi",-999.);
 
     // basic EDM variables
     OfflineSAPt = OfflineSATrack->pt()/1e3 * OfflineSATrack->charge(); // convert to GeV
@@ -132,32 +143,32 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext
         }
       }
     }
-    fill(m_group, OfflineSAPt, OfflineSAEta, OfflineSAPhi, OfflineSAmatchedL2SAPt, OfflineSAmatchedL2SAEta, OfflineSAmatchedL2SAPhi,
+    fill(m_group+"_"+chain, OfflineSAPt, OfflineSAEta, OfflineSAPhi, OfflineSAmatchedL2SAPt, OfflineSAmatchedL2SAEta, OfflineSAmatchedL2SAPhi,
          MatchedEFSAPt, MatchedEFSAEta, MatchedEFSAPhi, SAdPt, SAdEta, SAdPhi, SAdR, matchedEFSA, matchedL2SA);
   }
 
 
   // OfflineCB
   if( OfflineCBTrack ){
-    auto OfflineCBPt = Monitored::Scalar<float>(m_group+"_OfflineCB_Pt",-999.);
-    auto OfflineCBEta = Monitored::Scalar<float>(m_group+"_OfflineCB_Eta",-999.);
-    auto OfflineCBPhi = Monitored::Scalar<float>(m_group+"_OfflineCB_Phi",-999.);
+    auto OfflineCBPt = Monitored::Scalar<float>(chain+"_OfflineCB_Pt",-999.);
+    auto OfflineCBEta = Monitored::Scalar<float>(chain+"_OfflineCB_Eta",-999.);
+    auto OfflineCBPhi = Monitored::Scalar<float>(chain+"_OfflineCB_Phi",-999.);
 
-    auto matchedEFCB = Monitored::Scalar<bool>(m_group+"_matchedEFCB",false);
-    auto matchedL2CB = Monitored::Scalar<bool>(m_group+"_matchedL2CB",false);
+    auto matchedEFCB = Monitored::Scalar<bool>(chain+"_matchedEFCB",false);
+    auto matchedL2CB = Monitored::Scalar<bool>(chain+"_matchedL2CB",false);
 
-    auto OfflineCBmatchedL2CBPt = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Pt",-999.);
-    auto OfflineCBmatchedL2CBEta = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Eta",-999.);
-    auto OfflineCBmatchedL2CBPhi = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Phi",-999.);
+    auto OfflineCBmatchedL2CBPt = Monitored::Scalar<float>(chain+"_OfflineCBmatchedL2CB_Pt",-999.);
+    auto OfflineCBmatchedL2CBEta = Monitored::Scalar<float>(chain+"_OfflineCBmatchedL2CB_Eta",-999.);
+    auto OfflineCBmatchedL2CBPhi = Monitored::Scalar<float>(chain+"_OfflineCBmatchedL2CB_Phi",-999.);
  
-    auto MatchedEFCBPt = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Pt",-999.);
-    auto MatchedEFCBEta = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Eta",-999.);
-    auto MatchedEFCBPhi = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Phi",-999.);
+    auto MatchedEFCBPt = Monitored::Scalar<float>(chain+"_MatchedEFCB_Pt",-999.);
+    auto MatchedEFCBEta = Monitored::Scalar<float>(chain+"_MatchedEFCB_Eta",-999.);
+    auto MatchedEFCBPhi = Monitored::Scalar<float>(chain+"_MatchedEFCB_Phi",-999.);
   
-    auto CBdR = Monitored::Scalar<float>(m_group+"_CBdR",1000.);
-    auto CBdPt = Monitored::Scalar<float>(m_group+"_CBdPt",-999.);
-    auto CBdEta = Monitored::Scalar<float>(m_group+"_CBdEta",-999.);
-    auto CBdPhi = Monitored::Scalar<float>(m_group+"_CBdPhi",-999.);
+    auto CBdR = Monitored::Scalar<float>(chain+"_CBdR",1000.);
+    auto CBdPt = Monitored::Scalar<float>(chain+"_CBdPt",-999.);
+    auto CBdEta = Monitored::Scalar<float>(chain+"_CBdEta",-999.);
+    auto CBdPhi = Monitored::Scalar<float>(chain+"_CBdPhi",-999.);
 
     // basic EDM variables
     OfflineCBPt = OfflineCBTrack->pt()/1e3 * OfflineCBTrack->charge(); // convert to GeV
@@ -203,9 +214,36 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext
         }
       }
     }
-    fill(m_group, OfflineCBPt, OfflineCBEta, OfflineCBPhi, OfflineCBmatchedL2CBPt, OfflineCBmatchedL2CBEta, OfflineCBmatchedL2CBPhi,
+    fill(m_group+"_"+chain, OfflineCBPt, OfflineCBEta, OfflineCBPhi, OfflineCBmatchedL2CBPt, OfflineCBmatchedL2CBEta, OfflineCBmatchedL2CBPhi,
          MatchedEFCBPt, MatchedEFCBEta, MatchedEFCBPhi, CBdPt, CBdEta, CBdPhi, CBdR, matchedEFCB, matchedL2CB);
   }
 
   return StatusCode::SUCCESS;
 }
+
+
+StatusCode EFMuonMonMT :: fillVariables(const EventContext &ctx) const {
+
+  ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
+
+  ATH_CHECK( fillVariableEtaPhi<xAOD::Muon>(ctx, m_EFSAMuonContainerKey, "EFSA", &MuonMatchingTool::PosForMatchSATrack));
+  ATH_CHECK( fillVariableEtaPhi<xAOD::Muon>(ctx, m_EFCBMuonContainerKey, "EFCB", &MuonMatchingTool::PosForMatchCBTrack));
+
+  return StatusCode::SUCCESS;
+
+}
+
+
+StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const {
+
+  ATH_CHECK( fillVariablesRatioPlots<xAOD::Muon>(ctx, mu, "EFSA", xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle,
+                                                 [this](const EventContext &ctx, const xAOD::Muon *mu){ return m_matchTool->matchEFSAReadHandle(ctx,mu); }
+                                                 )); 
+
+  ATH_CHECK( fillVariablesRatioPlots<xAOD::Muon>(ctx, mu, "EFCB", xAOD::Muon::TrackParticleType::CombinedTrackParticle,
+                                                 [this](const EventContext &ctx, const xAOD::Muon *mu){ return m_matchTool->matchEFCBReadHandle(ctx,mu); }
+                                                 )); 
+
+  return StatusCode::SUCCESS;
+
+}
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h
index 24b80ad36ba7..1475e7fe8af5 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h
@@ -16,9 +16,17 @@ class EFMuonMonMT : public TrigMuonMonitorAlgorithm{
  public:
   EFMuonMonMT(const std::string& name, ISvcLocator* pSvcLocator );
 
+  virtual StatusCode initialize() override;
+
  protected:
   virtual StatusCode fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const override;
   virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext &ctx, const xAOD::Muon* mu, const std::string &chain) const override;
+  virtual StatusCode fillVariables(const EventContext& ctx) const override;
+  virtual StatusCode fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const override;
+
+ private:
+  SG::ReadHandleKey<xAOD::MuonContainer> m_EFSAMuonContainerKey {this, "EFSAMuonContainerName", "HLT_Muons_RoI", "EFSAMuon container"};
+  SG::ReadHandleKey<xAOD::MuonContainer> m_EFCBMuonContainerKey {this, "EFCBMuonContainerName", "HLT_MuonsCB_RoI", "EFCBMuon container"};
 
 };
 
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx
index bbbb10f6010e..c6efdba50540 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx
@@ -12,11 +12,18 @@ L2MuonSAMonMT :: L2MuonSAMonMT(const std::string& name, ISvcLocator* pSvcLocator
 {}
 
 
+StatusCode L2MuonSAMonMT :: initialize(){
+  StatusCode sc = TrigMuonMonitorAlgorithm::initialize();
+  ATH_CHECK( m_L2MuonSAContainerKey.initialize() );
+  return sc;
+}
+
+
 StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const {
 
   ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
 
-  auto lb = Monitored::Scalar<int>(m_group+"_LB",-1.0);
+  auto lb = Monitored::Scalar<int>(chain+"_LB",-1.0);
   lb = GetEventInfo(ctx)->lumiBlock();
 
   const float ZERO_LIMIT = 0.00001;
@@ -28,13 +35,13 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
 
 
     // basic EDM variables
-    auto saPt = Monitored::Scalar<float>(m_group+"_Pt",-999.);
-    auto saEta = Monitored::Scalar<float>(m_group+"_Eta",-999.);
-    auto saPhi = Monitored::Scalar<float>(m_group+"_Phi",-999.);
-    auto saddr = Monitored::Scalar<int>(m_group+"_saddr",-999.);
-    auto roiEta = Monitored::Scalar<float>(m_group+"_roiEta",-999.);
-    auto roiPhi = Monitored::Scalar<float>(m_group+"_roiPhi",-999.);
-    auto mf_failure = Monitored::Scalar<bool>(m_group+"_mf_failure",false);
+    auto saPt = Monitored::Scalar<float>(chain+"_Pt",-999.);
+    auto saEta = Monitored::Scalar<float>(chain+"_Eta",-999.);
+    auto saPhi = Monitored::Scalar<float>(chain+"_Phi",-999.);
+    auto saddr = Monitored::Scalar<int>(chain+"_saddr",-999.);
+    auto roiEta = Monitored::Scalar<float>(chain+"_roiEta",-999.);
+    auto roiPhi = Monitored::Scalar<float>(chain+"_roiPhi",-999.);
+    auto mf_failure = Monitored::Scalar<bool>(chain+"_mf_failure",false);
 
     saPt = (*muEL)->pt();
     saEta = (*muEL)->eta();
@@ -46,22 +53,22 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     ATH_MSG_DEBUG("saPt = " << saPt << ", saEta =" << saEta << ", saPhi = " << saPhi << ", saddr = " << saddr);
     if(std::abs(saPt) < ZERO_LIMIT) mf_failure = true;
 
-    fill(m_group, roiEta, roiPhi, mf_failure);
+    fill(m_group+"_"+chain, roiEta, roiPhi, mf_failure);
     if( mf_failure ) continue;
 
     // define barrel or endcap
-    auto isBarrel = Monitored::Scalar<bool>(m_group+"_isBarrel",false);
-    auto isEndcap = Monitored::Scalar<bool>(m_group+"_isEndcap",false);
+    auto isBarrel = Monitored::Scalar<bool>(chain+"_isBarrel",false);
+    auto isEndcap = Monitored::Scalar<bool>(chain+"_isEndcap",false);
 
     if(saddr == -1)  isEndcap = true;
     else isBarrel = true;;
 
-    fill(m_group, saPt, saEta, saPhi, saddr, isBarrel, isEndcap);
+    fill(m_group+"_"+chain, saPt, saEta, saPhi, saddr, isBarrel, isEndcap);
 
 
     // define process flow
     std::vector<int> proc_flow;
-    auto mon_proc_flow = Monitored::Collection(m_group+"_proc_flow", proc_flow);
+    auto mon_proc_flow = Monitored::Collection(chain+"_proc_flow", proc_flow);
 
     bool isL1hitThere               = false;
     bool isL1emuOkForTriggerPlane   = false;
@@ -72,11 +79,11 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
 
     // detector variables
     // RPC and TGC
-    auto nRPC = Monitored::Scalar<int>(m_group+"_RPC_Pad_N",0);
-    auto TGCMidRhoChi2 = Monitored::Scalar<float>(m_group+"_TGC_Mid_rho_chi2",-1.0);
-    auto TGCMidPhiChi2 = Monitored::Scalar<float>(m_group+"_TGC_Mid_phi_chi2",-1.0);
-    auto nTGCMidRho = Monitored::Scalar<int>(m_group+"_TGC_Mid_rho_N",0);
-    auto nTGCMidPhi = Monitored::Scalar<int>(m_group+"_TGC_Mid_phi_N",0);
+    auto nRPC = Monitored::Scalar<int>(chain+"_RPC_Pad_N",0);
+    auto TGCMidRhoChi2 = Monitored::Scalar<float>(chain+"_TGC_Mid_rho_chi2",-1.0);
+    auto TGCMidPhiChi2 = Monitored::Scalar<float>(chain+"_TGC_Mid_phi_chi2",-1.0);
+    auto nTGCMidRho = Monitored::Scalar<int>(chain+"_TGC_Mid_rho_N",0);
+    auto nTGCMidPhi = Monitored::Scalar<int>(chain+"_TGC_Mid_phi_N",0);
 
     nRPC = (*muEL)->rpcHitLayer().size();
     TGCMidRhoChi2 = (*muEL)->tgcMidRhoChi2();
@@ -84,7 +91,7 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     nTGCMidRho = (*muEL)->tgcMidRhoN();
     nTGCMidPhi = (*muEL)->tgcMidPhiN();
 
-    fill(m_group, nRPC, TGCMidRhoChi2, TGCMidPhiChi2, nTGCMidRho, nTGCMidPhi, isBarrel, isEndcap);
+    fill(m_group+"_"+chain, nRPC, TGCMidRhoChi2, TGCMidPhiChi2, nTGCMidRho, nTGCMidPhi, isBarrel, isEndcap);
 
 
     // use process flow
@@ -124,8 +131,8 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     sp_r.clear();
     sp_z.clear();
 
-    auto mon_sp_r= Monitored::Collection(m_group+"_MDTpoints_r", sp_r);
-    auto mon_sp_z= Monitored::Collection(m_group+"_MDTpoints_z", sp_z);
+    auto mon_sp_r= Monitored::Collection(chain+"_MDTpoints_r", sp_r);
+    auto mon_sp_z= Monitored::Collection(chain+"_MDTpoints_z", sp_z);
 
     if( std::abs((*muEL)->superPointR(inner)) > ZERO_LIMIT ) {
       sp_r.push_back( sign * (*muEL)->superPointR(inner) );
@@ -140,17 +147,17 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
       sp_z.push_back( (*muEL)->superPointZ(outer) );
     }
 
-    fill(m_group, mon_sp_r, mon_sp_z);
+    fill(m_group+"_"+chain, mon_sp_r, mon_sp_z);
 
 
     // MDT
-    auto MDTInnChi2 = Monitored::Scalar<float>(m_group+"_MDT_Inn_fit_chi2",-1.0);
-    auto MDTMidChi2 = Monitored::Scalar<float>(m_group+"_MDT_Mid_fit_chi2",-1.0);
-    auto MDTOutChi2 = Monitored::Scalar<float>(m_group+"_MDT_Out_fit_chi2",-1.0);
-    auto n_mdt_hits = Monitored::Scalar<int>(m_group+"_MDT_N",0);
-    auto n_mdt_hits_inner = Monitored::Scalar<int>(m_group+"_MDT_Inn_N",0);
-    auto n_mdt_hits_middle = Monitored::Scalar<int>(m_group+"_MDT_Mid_N",0);
-    auto n_mdt_hits_outer = Monitored::Scalar<int>(m_group+"_MDT_Out_N",0);
+    auto MDTInnChi2 = Monitored::Scalar<float>(chain+"_MDT_Inn_fit_chi2",-1.0);
+    auto MDTMidChi2 = Monitored::Scalar<float>(chain+"_MDT_Mid_fit_chi2",-1.0);
+    auto MDTOutChi2 = Monitored::Scalar<float>(chain+"_MDT_Out_fit_chi2",-1.0);
+    auto n_mdt_hits = Monitored::Scalar<int>(chain+"_MDT_N",0);
+    auto n_mdt_hits_inner = Monitored::Scalar<int>(chain+"_MDT_Inn_N",0);
+    auto n_mdt_hits_middle = Monitored::Scalar<int>(chain+"_MDT_Mid_N",0);
+    auto n_mdt_hits_outer = Monitored::Scalar<int>(chain+"_MDT_Out_N",0);
 
     MDTInnChi2 = (*muEL)->superPointChi2(inner);
     MDTMidChi2 = (*muEL)->superPointChi2(middle);
@@ -162,9 +169,9 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     res_mid.clear();
     res_out.clear();
 
-    auto mon_res_inn = Monitored::Collection(m_group+"_MDT_Inn_residual",res_inn);
-    auto mon_res_mid = Monitored::Collection(m_group+"_MDT_Mid_residual",res_mid);
-    auto mon_res_out = Monitored::Collection(m_group+"_MDT_Out_residual",res_out);
+    auto mon_res_inn = Monitored::Collection(chain+"_MDT_Inn_residual",res_inn);
+    auto mon_res_mid = Monitored::Collection(chain+"_MDT_Mid_residual",res_mid);
+    auto mon_res_out = Monitored::Collection(chain+"_MDT_Out_residual",res_out);
 
 
     n_mdt_hits = (*muEL)->nMdtHits();
@@ -187,7 +194,7 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
       }
     }
 
-    fill(m_group, MDTInnChi2, MDTMidChi2, MDTOutChi2, n_mdt_hits, n_mdt_hits_inner, n_mdt_hits_middle, n_mdt_hits_outer, mon_res_inn, mon_res_mid, mon_res_out, lb, isBarrel, isEndcap);
+    fill(m_group+"_"+chain, MDTInnChi2, MDTMidChi2, MDTOutChi2, n_mdt_hits, n_mdt_hits_inner, n_mdt_hits_middle, n_mdt_hits_outer, mon_res_inn, mon_res_mid, mon_res_out, lb, isBarrel, isEndcap);
 
 
     // use process flow
@@ -206,7 +213,7 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     if( isMDTFitOkForTriggerPlane )    proc_flow.push_back(5);
     if( isMDTFitOkFor2Plane )          proc_flow.push_back(6);
 
-    fill(m_group, mon_proc_flow);
+    fill(m_group+"_"+chain, mon_proc_flow);
 
 
     // matching to offline
@@ -217,11 +224,11 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     std::vector<float> res_mid_OffMatch = res_mid;
     std::vector<float> res_out_OffMatch = res_out;
 
-    auto mon_res_inn_OffMatch = Monitored::Collection(m_group+"_MDT_Inn_residual_OffMatch",res_inn_OffMatch);
-    auto mon_res_mid_OffMatch = Monitored::Collection(m_group+"_MDT_Mid_residual_OffMatch",res_mid_OffMatch);
-    auto mon_res_out_OffMatch = Monitored::Collection(m_group+"_MDT_Out_residual_OffMatch",res_out_OffMatch);
+    auto mon_res_inn_OffMatch = Monitored::Collection(chain+"_MDT_Inn_residual_OffMatch",res_inn_OffMatch);
+    auto mon_res_mid_OffMatch = Monitored::Collection(chain+"_MDT_Mid_residual_OffMatch",res_mid_OffMatch);
+    auto mon_res_out_OffMatch = Monitored::Collection(chain+"_MDT_Out_residual_OffMatch",res_out_OffMatch);
 
-    fill(m_group, mon_res_inn_OffMatch, mon_res_mid_OffMatch, mon_res_out_OffMatch, isBarrel, isEndcap);
+    fill(m_group+"_"+chain, mon_res_inn_OffMatch, mon_res_mid_OffMatch, mon_res_out_OffMatch, isBarrel, isEndcap);
 
   }
 
@@ -238,8 +245,8 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
 
 
   // offline muon variables
-  auto offEta = Monitored::Scalar<float>(m_group+"_offEta",-999.);
-  auto offPt_signed = Monitored::Scalar<float>(m_group+"_offPt_signed",-999.);
+  auto offEta = Monitored::Scalar<float>(chain+"_offEta",-999.);
+  auto offPt_signed = Monitored::Scalar<float>(chain+"_offPt_signed",-999.);
   offEta = mu->eta();
 
   float offPt = mu->pt()/1e3;
@@ -255,10 +262,10 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
 
 
   // dR wrt offline
-  auto dRmin = Monitored::Scalar<float>(m_group+"_dRmin",1000.);
+  auto dRmin = Monitored::Scalar<float>(chain+"_dRmin",1000.);
   dRmin = xAOD::P4Helpers::deltaR(mu, *muEL, false); 
 
-  fill(m_group, dRmin);
+  fill(m_group+"_"+chain, dRmin);
   if( ! m_matchTool->isMatchedL2SA( *muEL, mu) ) return StatusCode::SUCCESS; // not matched to L2MuonSA
 
   
@@ -267,20 +274,20 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
   float roiEta = (*muEL)->roiEta();
   float roiPhi = (*muEL)->roiPhi();
 
-  auto roidEta = Monitored::Scalar<float>(m_group+"_initialRoI_dEta",-999.);
-  auto roidPhi = Monitored::Scalar<float>(m_group+"_initialRoI_dPhi",-999.);
-  auto roidR = Monitored::Scalar<float>(m_group+"_initialRoI_dR",-999.);
+  auto roidEta = Monitored::Scalar<float>(chain+"_initialRoI_dEta",-999.);
+  auto roidPhi = Monitored::Scalar<float>(chain+"_initialRoI_dPhi",-999.);
+  auto roidR = Monitored::Scalar<float>(chain+"_initialRoI_dR",-999.);
 
   roidEta = roiEta - offEta;
   roidPhi = xAOD::P4Helpers::deltaPhi(offPhi, roiPhi);
   roidR = sqrt(roidEta*roidEta + roidPhi*roidPhi);
   
-  fill(m_group, roidEta, roidPhi, roidR, offEta);
+  fill(m_group+"_"+chain, roidEta, roidPhi, roidR, offEta);
 
 
   // pt resolution, inverse pt resolution
-  auto ptresol = Monitored::Scalar<float>(m_group+"_ptresol",-999.);
-  auto invptresol = Monitored::Scalar<float>(m_group+"_invptresol",-999.);
+  auto ptresol = Monitored::Scalar<float>(chain+"_ptresol",-999.);
+  auto invptresol = Monitored::Scalar<float>(chain+"_invptresol",-999.);
   if ( std::abs(offPt) > ZERO_LIMIT && std::abs(saPt) > ZERO_LIMIT ) {
     ptresol = std::abs(saPt)/std::abs(offPt) - 1.;
     invptresol = (1./(offPt * offCharge) - 1./saPt) / (1./(offPt * offCharge));
@@ -292,8 +299,8 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
   invptresol_pos.clear();
   invptresol_neg.clear();
 
-  auto mon_invptresol_pos = Monitored::Collection(m_group+"_invptresol_pos",invptresol_pos);
-  auto mon_invptresol_neg = Monitored::Collection(m_group+"_invptresol_neg",invptresol_neg);
+  auto mon_invptresol_pos = Monitored::Collection(chain+"_invptresol_pos",invptresol_pos);
+  auto mon_invptresol_neg = Monitored::Collection(chain+"_invptresol_neg",invptresol_neg);
 
   if( offCharge > 0. ) invptresol_pos.push_back(invptresol);
   else invptresol_neg.push_back(invptresol);
@@ -305,25 +312,25 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
   const float ETA_OF_ENDCAP2   = 2.0;
   const float ETA_OF_ENDCAP3   = 2.5;
 
-  auto isBarrel = Monitored::Scalar<bool>(m_group+"_isBarrel",false);
-  auto isBarrelA = Monitored::Scalar<bool>(m_group+"_isBarrelA",false);
-  auto isBarrelC = Monitored::Scalar<bool>(m_group+"_isBarrelC",false);
-  auto isEndcapA = Monitored::Scalar<bool>(m_group+"_isEndcapA",false);
-  auto isEndcapC = Monitored::Scalar<bool>(m_group+"_isEndcapC",false);
-  auto isEndcap1 = Monitored::Scalar<bool>(m_group+"_isEndcap1",false);
-  auto isEndcap2 = Monitored::Scalar<bool>(m_group+"_isEndcap2",false);
-  auto isEndcap3 = Monitored::Scalar<bool>(m_group+"_isEndcap3",false);
-  auto isEndcap1A = Monitored::Scalar<bool>(m_group+"_isEndcap1A",false);
-  auto isEndcap2A = Monitored::Scalar<bool>(m_group+"_isEndcap2A",false);
-  auto isEndcap3A = Monitored::Scalar<bool>(m_group+"_isEndcap3A",false);
-  auto isEndcap1C = Monitored::Scalar<bool>(m_group+"_isEndcap1C",false);
-  auto isEndcap2C = Monitored::Scalar<bool>(m_group+"_isEndcap2C",false);
-  auto isEndcap3C = Monitored::Scalar<bool>(m_group+"_isEndcap3C",false);
+  auto isBarrel = Monitored::Scalar<bool>(chain+"_isBarrel",false);
+  auto isBarrelA = Monitored::Scalar<bool>(chain+"_isBarrelA",false);
+  auto isBarrelC = Monitored::Scalar<bool>(chain+"_isBarrelC",false);
+  auto isEndcapA = Monitored::Scalar<bool>(chain+"_isEndcapA",false);
+  auto isEndcapC = Monitored::Scalar<bool>(chain+"_isEndcapC",false);
+  auto isEndcap1 = Monitored::Scalar<bool>(chain+"_isEndcap1",false);
+  auto isEndcap2 = Monitored::Scalar<bool>(chain+"_isEndcap2",false);
+  auto isEndcap3 = Monitored::Scalar<bool>(chain+"_isEndcap3",false);
+  auto isEndcap1A = Monitored::Scalar<bool>(chain+"_isEndcap1A",false);
+  auto isEndcap2A = Monitored::Scalar<bool>(chain+"_isEndcap2A",false);
+  auto isEndcap3A = Monitored::Scalar<bool>(chain+"_isEndcap3A",false);
+  auto isEndcap1C = Monitored::Scalar<bool>(chain+"_isEndcap1C",false);
+  auto isEndcap2C = Monitored::Scalar<bool>(chain+"_isEndcap2C",false);
+  auto isEndcap3C = Monitored::Scalar<bool>(chain+"_isEndcap3C",false);
 
   // offline pt variables
-  auto pt4to6 = Monitored::Scalar<bool>(m_group+"_pt4to6",false);
-  auto pt6to8 = Monitored::Scalar<bool>(m_group+"_pt6to8",false);
-  auto ptover8 = Monitored::Scalar<bool>(m_group+"_ptover8",false);
+  auto pt4to6 = Monitored::Scalar<bool>(chain+"_pt4to6",false);
+  auto pt6to8 = Monitored::Scalar<bool>(chain+"_pt6to8",false);
+  auto ptover8 = Monitored::Scalar<bool>(chain+"_ptover8",false);
 
 
   // define region
@@ -366,9 +373,33 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
   }
 
 
-  fill(m_group, ptresol, offPt_signed, offEta, isBarrel, isEndcap1, isEndcap2, isEndcap3, isBarrelA, isBarrelC, isEndcapA, isEndcapC, pt4to6, pt6to8, ptover8);  
-  fill(m_group, mon_invptresol_pos, mon_invptresol_neg, isBarrelA, isBarrelC, isEndcap1A, isEndcap2A, isEndcap3A, isEndcap1C, isEndcap2C, isEndcap3C);
+  fill(m_group+"_"+chain, ptresol, offPt_signed, offEta, isBarrel, isEndcap1, isEndcap2, isEndcap3, isBarrelA, isBarrelC, isEndcapA, isEndcapC, pt4to6, pt6to8, ptover8);  
+  fill(m_group+"_"+chain, mon_invptresol_pos, mon_invptresol_neg, isBarrelA, isBarrelC, isEndcap1A, isEndcap2A, isEndcap3A, isEndcap1C, isEndcap2C, isEndcap3C);
 
   
   return StatusCode::SUCCESS;
 }
+
+
+
+StatusCode L2MuonSAMonMT :: fillVariables(const EventContext &ctx) const {
+
+  ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
+
+  ATH_CHECK( fillVariableEtaPhi<xAOD::L2StandAloneMuon>(ctx, m_L2MuonSAContainerKey, "L2SA"));
+
+  return StatusCode::SUCCESS;
+
+}
+
+
+
+StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const {
+
+  ATH_CHECK( fillVariablesRatioPlots<xAOD::L2StandAloneMuon>(ctx, mu, "L2SA", xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle,
+                                                             [this](const EventContext &ctx, const xAOD::Muon *mu){ return m_matchTool->matchL2SAReadHandle(ctx,mu); }
+                                                             ));
+
+  return StatusCode::SUCCESS;
+
+}
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h
index 5edf8cc10ba8..92f23b13f5da 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h
@@ -16,10 +16,16 @@ class L2MuonSAMonMT : public TrigMuonMonitorAlgorithm{
  public:
   L2MuonSAMonMT(const std::string& name, ISvcLocator* pSvcLocator );
 
+  virtual StatusCode initialize() override;
+
  protected:
   virtual StatusCode fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const override;
   virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext& ctx, const xAOD::Muon* mu, const std::string &chain) const override;
+  virtual StatusCode fillVariables(const EventContext& ctx) const override;
+  virtual StatusCode fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const override;
 
+ private:
+  SG::ReadHandleKey<xAOD::L2StandAloneMuonContainer> m_L2MuonSAContainerKey {this, "L2StandAloneMuonContainerName", "HLT_MuonL2SAInfo", "L2MuonSA container"};
 
 };
 
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx
index 606678a98e7b..f35b45fead82 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx
@@ -12,6 +12,13 @@ L2muCombMonMT :: L2muCombMonMT(const std::string& name, ISvcLocator* pSvcLocator
 {}
 
 
+StatusCode L2muCombMonMT :: initialize(){
+  StatusCode sc = TrigMuonMonitorAlgorithm::initialize();
+  ATH_CHECK( m_L2muCombContainerKey.initialize() );
+  return sc;
+}
+
+
 StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const {
 
   ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
@@ -33,17 +40,17 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
 
 
     // basic EDM variables
-    auto cbPt = Monitored::Scalar<float>(m_group+"_Pt",-999.);
-    auto cbEta = Monitored::Scalar<float>(m_group+"_Eta",-999.);
-    auto cbPhi = Monitored::Scalar<float>(m_group+"_Phi",-999.);
+    auto cbPt = Monitored::Scalar<float>(chain+"_Pt",-999.);
+    auto cbEta = Monitored::Scalar<float>(chain+"_Eta",-999.);
+    auto cbPhi = Monitored::Scalar<float>(chain+"_Phi",-999.);
 
     cbPt = (*muEL)->pt()/1e3 * (*muEL)->charge(); // convert to GeV
     cbEta = (*muEL)->eta();
     cbPhi = (*muEL)->phi();
 
-    auto saPt = Monitored::Scalar<float>(m_group+"_saPt",-999.);
-    auto saEta = Monitored::Scalar<float>(m_group+"_saEta",-999.);
-    auto saPhi = Monitored::Scalar<float>(m_group+"_saPhi",-999.);
+    auto saPt = Monitored::Scalar<float>(chain+"_saPt",-999.);
+    auto saEta = Monitored::Scalar<float>(chain+"_saEta",-999.);
+    auto saPhi = Monitored::Scalar<float>(chain+"_saPhi",-999.);
 
     saPt = (*saEL)->pt();
     saEta = (*saEL)->eta();
@@ -60,10 +67,10 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
 
 
     // CB and Offline matching
-    auto L2SA_success = Monitored::Scalar<bool>(m_group+"_L2SA_success",false);
-    auto L2CB_success = Monitored::Scalar<bool>(m_group+"_L2CB_success",false);
-    auto L2CBOFFmatching_failure = Monitored::Scalar<bool>(m_group+"_L2CBOFFmatching_failure",false);
-    auto L2CB_failure = Monitored::Scalar<bool>(m_group+"_L2CB_failure",false);
+    auto L2SA_success = Monitored::Scalar<bool>(chain+"_L2SA_success",false);
+    auto L2CB_success = Monitored::Scalar<bool>(chain+"_L2CB_success",false);
+    auto L2CBOFFmatching_failure = Monitored::Scalar<bool>(chain+"_L2CBOFFmatching_failure",false);
+    auto L2CB_failure = Monitored::Scalar<bool>(chain+"_L2CB_failure",false);
     bool off_cb_match = false;
     bool off_sa_match = false;
     L2SA_success = (std::abs(saPt) > ZERO_LIMIT)? true:false;
@@ -83,18 +90,18 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     else if (off_sa_match) L2CB_failure = true;
 
     if( !L2CB_success ){
-      fill(m_group, saPt, saEta, saPhi, L2SA_success, L2CB_failure);
+      fill(m_group+"_"+chain, saPt, saEta, saPhi, L2SA_success, L2CB_failure);
       continue;
     }
 
-    fill(m_group, cbPt, cbEta, cbPhi, L2CB_success, L2CBOFFmatching_failure);
+    fill(m_group+"_"+chain, cbPt, cbEta, cbPhi, L2CB_success, L2CBOFFmatching_failure);
 
 
     // comparison L2muComb vs L2MuonSA
-    auto ptratio_toSA = Monitored::Scalar<float>(m_group+"_ptratio_toSA",-999.);
-    auto dEta_toSA = Monitored::Scalar<float>(m_group+"_dEta_toSA",-999.);
-    auto dPhi_toSA = Monitored::Scalar<float>(m_group+"_dPhi_toSA",-999.);
-    auto dR_toSA = Monitored::Scalar<float>(m_group+"_dR_toSA",-999.);
+    auto ptratio_toSA = Monitored::Scalar<float>(chain+"_ptratio_toSA",-999.);
+    auto dEta_toSA = Monitored::Scalar<float>(chain+"_dEta_toSA",-999.);
+    auto dPhi_toSA = Monitored::Scalar<float>(chain+"_dPhi_toSA",-999.);
+    auto dR_toSA = Monitored::Scalar<float>(chain+"_dR_toSA",-999.);
   
     if( (*muEL)->muSATrackLink().isValid() && std::abs(saPt) > ZERO_LIMIT ){
       ptratio_toSA = std::abs(cbPt / saPt);
@@ -102,16 +109,16 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
       dPhi_toSA = xAOD::P4Helpers::deltaPhi(cbPhi, saPhi);
       dR_toSA = sqrt(dEta_toSA*dEta_toSA + dPhi_toSA*dPhi_toSA);
      
-      fill(m_group, ptratio_toSA, dEta_toSA, dPhi_toSA, dR_toSA);
+      fill(m_group+"_"+chain, ptratio_toSA, dEta_toSA, dPhi_toSA, dR_toSA);
     }
 
 
     // get IDTrack
-    auto trkPt = Monitored::Scalar<float>(m_group+"_trkPt",-999.);
-    auto trkEta = Monitored::Scalar<float>(m_group+"_trkEta",-999.);
-    auto trkPhi = Monitored::Scalar<float>(m_group+"_trkPhi",-999.);
-    auto trkZ0 = Monitored::Scalar<float>(m_group+"_trkZ0",-999.);
-    auto trkChi2 = Monitored::Scalar<float>(m_group+"_trkChi2",-999.);
+    auto trkPt = Monitored::Scalar<float>(chain+"_trkPt",-999.);
+    auto trkEta = Monitored::Scalar<float>(chain+"_trkEta",-999.);
+    auto trkPhi = Monitored::Scalar<float>(chain+"_trkPhi",-999.);
+    auto trkZ0 = Monitored::Scalar<float>(chain+"_trkZ0",-999.);
+    auto trkChi2 = Monitored::Scalar<float>(chain+"_trkChi2",-999.);
 
     const xAOD::TrackParticle* idtrk = nullptr;
     if( (*muEL)->idTrackLink().isValid() ) {
@@ -123,15 +130,15 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
       trkChi2 = idtrk->chiSquared();
     }
 
-    fill(m_group, trkPt);
-    if( std::abs(trkPt) > ZERO_LIMIT)  fill(m_group, trkEta, trkPhi, trkZ0, trkChi2);
+    fill(m_group+"_"+chain, trkPt);
+    if( std::abs(trkPt) > ZERO_LIMIT)  fill(m_group+"_"+chain, trkEta, trkPhi, trkZ0, trkChi2);
 
 
     // comparison L2muComb (IDTrack) vs L2MuonSA
-    auto ptratio_TrktoSA = Monitored::Scalar<float>(m_group+"_ptratio_TrktoSA",-999.);
-    auto dEta_TrktoSA = Monitored::Scalar<float>(m_group+"_dEta_TrktoSA",-999.);
-    auto dPhi_TrktoSA = Monitored::Scalar<float>(m_group+"_dPhi_TrktoSA",-999.);
-    auto dR_TrktoSA = Monitored::Scalar<float>(m_group+"_dR_TrktoSA",-999.);
+    auto ptratio_TrktoSA = Monitored::Scalar<float>(chain+"_ptratio_TrktoSA",-999.);
+    auto dEta_TrktoSA = Monitored::Scalar<float>(chain+"_dEta_TrktoSA",-999.);
+    auto dPhi_TrktoSA = Monitored::Scalar<float>(chain+"_dPhi_TrktoSA",-999.);
+    auto dR_TrktoSA = Monitored::Scalar<float>(chain+"_dR_TrktoSA",-999.);
     
     if( (*muEL)->idTrackLink().isValid() && std::abs(saPt) > ZERO_LIMIT ){
       ptratio_TrktoSA = std::abs(cbPt / saPt);
@@ -139,14 +146,14 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
       dPhi_TrktoSA = xAOD::P4Helpers::deltaPhi(cbPhi, saPhi);
       dR_TrktoSA = sqrt(dEta_TrktoSA*dEta_TrktoSA + dPhi_TrktoSA*dPhi_TrktoSA);
       
-      fill(m_group, ptratio_TrktoSA, dEta_TrktoSA, dPhi_TrktoSA, dR_TrktoSA);
+      fill(m_group+"_"+chain, ptratio_TrktoSA, dEta_TrktoSA, dPhi_TrktoSA, dR_TrktoSA);
     } 
 
 
     // Muon Feature error
     std::vector<int> vec_MF_error;
     vec_MF_error.clear();
-    auto MF_error = Monitored::Collection(m_group+"_MF_error",vec_MF_error);
+    auto MF_error = Monitored::Collection(chain+"_MF_error",vec_MF_error);
 
     bool error = false;
     if( SATrack ){
@@ -164,7 +171,7 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     }
     if(!error)  vec_MF_error.push_back(0);
 
-    fill(m_group, MF_error);
+    fill(m_group+"_"+chain, MF_error);
 
   }
 
@@ -178,9 +185,9 @@ StatusCode L2muCombMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
 
   const float ZERO_LIMIT = 0.00001;
 
-  auto offEta = Monitored::Scalar<float>(m_group+"_offEta",-999.);
-  auto ptresol = Monitored::Scalar<float>(m_group+"_ptresol",-999.);
-  auto dR = Monitored::Scalar<float>(m_group+"_dR",-999.);
+  auto offEta = Monitored::Scalar<float>(chain+"_offEta",-999.);
+  auto ptresol = Monitored::Scalar<float>(chain+"_ptresol",-999.);
+  auto dR = Monitored::Scalar<float>(chain+"_dR",-999.);
 
   float offPt = mu->pt()/1e3;
   float offPhi = mu->phi();
@@ -194,16 +201,16 @@ StatusCode L2muCombMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
 
 
   // dR wrt offline
-  auto dRmin = Monitored::Scalar<float>(m_group+"_dRmin",1000.);
+  auto dRmin = Monitored::Scalar<float>(chain+"_dRmin",1000.);
   dRmin = xAOD::P4Helpers::deltaR(mu, *muEL, false);
-  fill(m_group, dRmin);
+  fill(m_group+"_"+chain, dRmin);
   if( ! m_matchTool->isMatchedL2CB(*muEL, mu) ) return StatusCode::SUCCESS; // not matched to L2muComb
 
 
   // pt resolution
   float cbPt  = (*muEL)->pt()/1e3;
   if ( std::abs(offPt) > ZERO_LIMIT && std::abs(cbPt) > ZERO_LIMIT ) ptresol = std::abs(cbPt)/std::abs(offPt) - 1.;
-  fill(m_group, offEta, ptresol);
+  fill(m_group+"_"+chain, offEta, ptresol);
 
 
   // HLT_Roi_L2SAMuon variables
@@ -214,16 +221,38 @@ StatusCode L2muCombMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
   float SAroiEta = (*roiEL)->eta();
   float SAroiPhi = (*roiEL)->phi();
 
-  auto roidEta = Monitored::Scalar<float>(m_group+"_L2SARoI_dEta",-999.);
-  auto roidPhi = Monitored::Scalar<float>(m_group+"_L2SARoI_dPhi",-999.);
-  auto roidR = Monitored::Scalar<float>(m_group+"_L2SARoI_dR",-999.);
+  auto roidEta = Monitored::Scalar<float>(chain+"_L2SARoI_dEta",-999.);
+  auto roidPhi = Monitored::Scalar<float>(chain+"_L2SARoI_dPhi",-999.);
+  auto roidR = Monitored::Scalar<float>(chain+"_L2SARoI_dR",-999.);
 
   roidEta = SAroiEta - offEta;
   roidPhi = xAOD::P4Helpers::deltaPhi(offPhi, SAroiPhi);
   roidR = sqrt(roidEta*roidEta + roidPhi*roidPhi);
   
-  fill(m_group, roidEta, roidPhi, roidR, offEta);
+  fill(m_group+"_"+chain, roidEta, roidPhi, roidR, offEta);
 
 
   return StatusCode::SUCCESS;
 }
+
+
+StatusCode L2muCombMonMT :: fillVariables(const EventContext &ctx) const {
+
+  ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
+
+  ATH_CHECK( fillVariableEtaPhi<xAOD::L2CombinedMuon>(ctx, m_L2muCombContainerKey, "L2CB"));
+
+  return StatusCode::SUCCESS;
+
+}
+
+
+StatusCode L2muCombMonMT :: fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const {
+
+  ATH_CHECK( fillVariablesRatioPlots<xAOD::L2CombinedMuon>(ctx, mu, "L2CB", xAOD::Muon::TrackParticleType::CombinedTrackParticle,
+                                                           [this](const EventContext &ctx, const xAOD::Muon *mu){ return m_matchTool->matchL2CBReadHandle(ctx,mu); }
+                                                           ));
+
+  return StatusCode::SUCCESS;
+
+}
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h
index 0e0f5a8629be..b6dae880c4f3 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h
@@ -16,10 +16,16 @@ class L2muCombMonMT : public TrigMuonMonitorAlgorithm{
  public:
   L2muCombMonMT(const std::string& name, ISvcLocator* pSvcLocator );
 
+  virtual StatusCode initialize() override;
+
  protected:
   virtual StatusCode fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const override;
   virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext&, const xAOD::Muon* mu, const std::string &chain) const override;
+  virtual StatusCode fillVariables(const EventContext& ctx) const override;
+  virtual StatusCode fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const override;
 
+ private:
+  SG::ReadHandleKey<xAOD::L2CombinedMuonContainer> m_L2muCombContainerKey {this, "L2CombinedMuonContainerName", "HLT_MuonL2CBInfo", "L2muComb container"};
 
 };
 
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx
index ad4e8c749e0f..527b9503a059 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx
@@ -20,6 +20,10 @@ StatusCode MuonMatchingTool :: initialize(){
   }
   ATH_CHECK( m_MuonContainerKey.initialize() );
   ATH_CHECK( m_MuonRoIContainerKey.initialize() );
+  ATH_CHECK( m_L2MuonSAContainerKey.initialize() );
+  ATH_CHECK( m_L2muCombContainerKey.initialize() );
+  ATH_CHECK( m_EFSAMuonContainerKey.initialize() );
+  ATH_CHECK( m_EFCBMuonContainerKey.initialize() );
 
   return StatusCode::SUCCESS;
 }
@@ -79,6 +83,20 @@ const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> MuonMatchingTool :: matc
   return MuonTrack ? matchLinkInfo<xAOD::Muon>(MuonTrack, trig, m_EFreqdR, pass, "HLT_Muons_", &MuonMatchingTool::PosForMatchSATrack) : muonLinkInfo;
 }
 
+const xAOD::Muon* MuonMatchingTool :: matchEFSAReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const {
+  ATH_MSG_DEBUG("MuonMonitoring::matchEFSAReadHandle()");
+  const xAOD::TrackParticle* MuonTrack = nullptr;
+  using Type = xAOD::Muon::TrackParticleType;
+  std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle,
+                            Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
+                            Type::MuonSpectrometerTrackParticle};
+  for (Type type : types){
+    MuonTrack = mu->trackParticle(type);
+    if (MuonTrack) break;
+  }
+  return MuonTrack ? matchReadHandle<xAOD::Muon>( MuonTrack, m_EFreqdR, m_EFSAMuonContainerKey, ctx, &MuonMatchingTool::PosForMatchSATrack) : nullptr;
+}
+
 
 const xAOD::Muon* MuonMatchingTool :: matchEFCB(  const xAOD::Muon *mu, std::string trig, bool &pass) const {
   ATH_MSG_DEBUG("MuonMonitoring::matchEFCB()");
@@ -94,6 +112,12 @@ const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> MuonMatchingTool :: matc
   return MuonTrack ? matchLinkInfo<xAOD::Muon>(MuonTrack, trig, m_EFreqdR, pass, "HLT_MuonsCB", &MuonMatchingTool::PosForMatchCBTrack) : muonLinkInfo;
 }
 
+const xAOD::Muon* MuonMatchingTool :: matchEFCBReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const {
+  ATH_MSG_DEBUG("MuonMonitoring::matchEFCBReadHandle()");
+  const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
+  return MuonTrack ? matchReadHandle<xAOD::Muon>( MuonTrack, m_EFreqdR, m_EFCBMuonContainerKey, ctx, &MuonMatchingTool::PosForMatchCBTrack) : nullptr;
+}
+
 
 const xAOD::Muon* MuonMatchingTool :: matchEFIso(  const xAOD::Muon *mu, std::string trig, bool &pass) const {
   ATH_MSG_DEBUG("MuonMonitoring::matchEFIso()");
@@ -121,6 +145,28 @@ const TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer> MuonMatching
   return matchLinkInfo<xAOD::L2StandAloneMuon>( mu, trig, 1000., pass, "HLT_MuonL2SAInfo");
 }
 
+const xAOD::L2StandAloneMuon* MuonMatchingTool :: matchL2SAReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const {
+  ATH_MSG_DEBUG("MuonMonitoring::matchL2SAReadHandle()");
+  float reqdR = m_L2SAreqdR;
+  if(m_use_extrapolator){
+    reqdR = reqdRL1byPt(mu->pt());
+    const Amg::Vector3D extPos = offlineMuonAtPivot(mu);
+    if(extPos.norm()>ZERO_LIMIT){
+      return matchReadHandle<xAOD::L2StandAloneMuon>( &extPos, reqdR, m_L2MuonSAContainerKey, ctx);
+    }
+  }
+  const xAOD::TrackParticle* MuonTrack = nullptr;
+  using Type = xAOD::Muon::TrackParticleType;
+  std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle,
+                            Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
+                            Type::MuonSpectrometerTrackParticle};
+  for (Type type : types){
+    MuonTrack = mu->trackParticle(type);
+    if (MuonTrack) break;
+  }
+  return MuonTrack ? matchReadHandle<xAOD::L2StandAloneMuon>( MuonTrack, reqdR, m_L2MuonSAContainerKey, ctx) : nullptr;
+}
+
 
 const xAOD::L2CombinedMuon* MuonMatchingTool :: matchL2CB(  const xAOD::Muon *mu, std::string trig, bool &pass) const {
   ATH_MSG_DEBUG("MuonMonitoring::matchL2CB()");
@@ -133,6 +179,12 @@ const TrigCompositeUtils::LinkInfo<xAOD::L2CombinedMuonContainer> MuonMatchingTo
   return matchLinkInfo<xAOD::L2CombinedMuon>( mu, trig,  1000., pass, "HLT_MuonL2CBInfo");
 }
 
+const xAOD::L2CombinedMuon* MuonMatchingTool :: matchL2CBReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const {
+  ATH_MSG_DEBUG("MuonMonitoring::matchL2CBReadHandle()");
+  const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
+  return MuonTrack ? matchReadHandle<xAOD::L2CombinedMuon>( MuonTrack, m_L2CBreqdR, m_L2muCombContainerKey, ctx) : nullptr;
+}
+
 
 const xAOD::MuonRoI* MuonMatchingTool :: matchL1(  const xAOD::Muon *mu, const EventContext& ctx, std::string trig, bool &pass) const {
 
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h
index 9db618a7f43f..9a39791eb98b 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h
@@ -63,6 +63,13 @@ class MuonMatchingTool : public AthAlgTool {
    */
   const TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer> searchL2SALinkInfo(const xAOD::Muon *mu, std::string trigger) const;
 
+  /**
+   * @brief Function that searches for an L2 standalone muon (L2MuonSA) candidate by ReadHandle and judges if it is matched to a given offlineSA muon.
+   * @param mu Offline muon around which L2MuonSA candidates are searched.
+   * @return Pointer to the matched candidate. This is @c nullptr when there is no candidate found.
+   */
+  const xAOD::L2StandAloneMuon* matchL2SAReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const;
+
   /**
    * @brief Function that searches for an L2 combined muon (L2muComb) candidate and judges if it is matched to a given offline muon.
    * @param mu Offline muon around which L2muComb candidates are searched.
@@ -84,6 +91,13 @@ class MuonMatchingTool : public AthAlgTool {
    */
   const TrigCompositeUtils::LinkInfo<xAOD::L2CombinedMuonContainer> searchL2CBLinkInfo(const xAOD::Muon *mu, std::string trigger) const;
 
+  /**
+   * @brief Function that searches for an L2 combined muon (L2muComb) candidate by ReadHandle and judges if it is matched to a given offlineCB muon.
+   * @param mu Offline muon around which L2muComb candidates are searched.
+   * @return Pointer to the matched candidate. This is @c nullptr when there is no candidate found.
+   */
+  const xAOD::L2CombinedMuon* matchL2CBReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const;
+
   /**
    * @brief Function that searches for an EF standalone muon (EFSA) candidate and judges if it is matched to a given offline muon.
    * @param mu Offline muon around which EFSA candidates are searched.
@@ -103,6 +117,13 @@ class MuonMatchingTool : public AthAlgTool {
    */
   const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> matchEFSALinkInfo( const xAOD::Muon *mu, std::string trig) const;
 
+  /**
+   * @brief Function that searches for an EF standalone muon (EFSA) candidate by ReadHandle and judges if it is matched to a given offlineSA muon.
+   * @param mu Offline muon around which EFSA candidates are searched.
+   * @return Pointer to the matched candidate. This is @c nullptr when there is no candidate found.
+   */
+  const xAOD::Muon* matchEFSAReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const;
+
   /**
    * @brief Function that searches for an EF combined muon (EFCB) candidate and judges if it is matched to a given offline muon.
    * @param mu Offline muon around which EFCB candidates are searched.
@@ -122,6 +143,13 @@ class MuonMatchingTool : public AthAlgTool {
    */
   const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> matchEFCBLinkInfo( const xAOD::Muon *mu, std::string trig) const;
 
+  /**
+   * @brief Function that searches for an EF combined muon (EFCB) candidate by ReadHandle and judges if it is matched to a given offlineCB muon.
+   * @param mu Offline muon around which EFCB candidates are searched.
+   * @return Pointer to the matched candidate. This is @c nullptr when there is no candidate found.
+   */
+  const xAOD::Muon* matchEFCBReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const;
+
   /**
    * @brief Function that searches for an EF isolation muon (EFIso) candidate and judges if it is matched to a given offline muon.
    * @param mu Offline muon around which EFIso candidates are searched.
@@ -172,6 +200,10 @@ class MuonMatchingTool : public AthAlgTool {
   static double reqdRL1byPt(double mupt);
 
 
+  static std::tuple<bool,double,double> PosForMatchSATrack(const xAOD::Muon *mu);
+  static std::tuple<bool,double,double> PosForMatchCBTrack(const xAOD::Muon *mu);
+
+  
  private:
 
   enum L1Items{ L1_MU4=1, L1_MU6, L1_MU10, L1_MU11, L1_MU15, L1_MU20, L1_MU21,ERROR};
@@ -191,6 +223,22 @@ class MuonMatchingTool : public AthAlgTool {
   const float m_EFreqdR = 0.03;
 
   // private methods
+  /**
+   * @brief Function that searches for an online muon candidate of type T by ReadHandle and judges if it is matched to a given offline muon.
+   * @param offl Position of the offline muon used for computing dR.
+   * @param reqdR Requirement of dR used for the matching. Note that reqdR is updated with the dR of the found candidate.
+   * @param ReadHandleKey SG::ReadHandleKey of online muon.
+   * @param ctx EventContext. 
+   * @param trigPosForMatchFunc Function pointer that implements cuts for the online muon candidates.
+   * @return Pointer to the matched candidate. This is @c nullptr when there is no candidate found.
+   * @see MuonMatchingTool.icc for the implementation and MuonMatchingTool.cxx for the instantiation.
+   * @todo Consider improving the argument list.
+   */
+  template<class T, class OFFL> const T* matchReadHandle(const OFFL* offl, float reqdR,
+                                                         SG::ReadHandleKey<DataVector<T> > ReadHandleKey, const EventContext& ctx,
+                                                         std::tuple<bool,double,double> (*trigPosForMatchFunc)(const T*) = &MuonMatchingTool::trigPosForMatch<T>) const;
+
+
   /**
    * @brief Function that searches for an online muon candidate of type T closest to a given offline muon. 
    * @param offl Position of the offline muon used for computing dR.
@@ -245,11 +293,13 @@ class MuonMatchingTool : public AthAlgTool {
   // static methods
   // Template methods that perform different matching schemes for T=xAOD::L2StandAloneMuon, xAOD::L2CombinedMuon and xAOD::Muon (EF).
   template<class T> static inline std::tuple<bool,double,double> trigPosForMatch(const T *trig);
-  static inline std::tuple<bool,double,double> PosForMatchSATrack(const xAOD::Muon *mu);
-  static inline std::tuple<bool,double,double> PosForMatchCBTrack(const xAOD::Muon *mu);
 
   SG::ReadHandleKey<xAOD::MuonRoIContainer> m_MuonRoIContainerKey {this, "MuonRoIContainerName", "LVL1MuonRoIs", "Level 1 muon container"};
   SG::ReadHandleKey<xAOD::MuonContainer> m_MuonContainerKey {this, "MuonContainerName", "Muons", "Offline muon container"};
+  SG::ReadHandleKey<xAOD::L2StandAloneMuonContainer> m_L2MuonSAContainerKey {this, "L2StandAloneMuonContainerName", "HLT_MuonL2SAInfo", "L2MuonSA container"};
+  SG::ReadHandleKey<xAOD::L2CombinedMuonContainer> m_L2muCombContainerKey {this, "L2CombinedMuonContainerName", "HLT_MuonL2CBInfo", "L2muComb container"};
+  SG::ReadHandleKey<xAOD::MuonContainer> m_EFSAMuonContainerKey {this, "EFSAMuonContainerName", "HLT_Muons_RoI", "EFSAMuon container"};
+  SG::ReadHandleKey<xAOD::MuonContainer> m_EFCBMuonContainerKey {this, "EFCBMuonContainerName", "HLT_MuonsCB_RoI", "EFCBMuon container"};
 
   // properties
   Gaudi::Property<bool> m_use_extrapolator {this, "UseExtrapolator", false, "Flag to enable the extrapolator for matching offline and trigger muons"};
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc
index 37d1da447bec..cc8ddca2c77f 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc
@@ -8,6 +8,45 @@ template<class T> std::tuple<bool,double,double> MuonMatchingTool :: trigPosForM
 }
 
 
+template<class T, class OFFL>
+const T* MuonMatchingTool :: matchReadHandle(const OFFL* offl, float reqdR,
+                                             SG::ReadHandleKey<DataVector<T> > ReadHandleKey, const EventContext& ctx,
+                                             std::tuple<bool,double,double> (*trigPosForMatchFunc)(const T*)) const {
+
+  ATH_MSG_DEBUG("MuonMonitoring::matchReadHandle<T>");
+
+  using CONTAINER = DataVector<T>;
+  const T* ptr = nullptr;
+
+  SG::ReadHandle<CONTAINER> trigmuons(ReadHandleKey, ctx);
+  if (! trigmuons.isValid() ) {
+    ATH_MSG_ERROR("evtStore() does not contain collection with name " << ReadHandleKey);
+    return ptr;
+  }
+
+  double offlEta = offl->eta();
+  double offlPhi = offl->phi();
+
+  for(const auto& trigmu : *trigmuons){
+    const auto [status, trigEta, trigPhi] = trigPosForMatchFunc(trigmu);
+    if(!status) continue;
+    double deta = offlEta - trigEta;
+    double dphi = xAOD::P4Helpers::deltaPhi(offlPhi, trigPhi);
+    double dR = sqrt(deta*deta + dphi*dphi);
+
+    ATH_MSG_VERBOSE("Trigger muon candidate eta=" << trigEta << " phi=" << trigPhi  << " pt=" << trigmu->pt() << " dR=" << dR);
+    if( dR<reqdR ){
+      reqdR = dR;
+      ATH_MSG_DEBUG("* Trigger muon eta=" << trigEta << " phi=" << trigPhi  << " pt=" << trigmu->pt() << " dR=" << dR);
+      ptr = trigmu; 
+    }
+  }
+  
+  return ptr;
+
+}
+
+
 template<class T, class OFFL>
 const T* MuonMatchingTool :: match(const OFFL* offl, std::string trig, float reqdR, bool &pass,
                                    const std::string containerSGKey,
@@ -100,3 +139,4 @@ const xAOD::Muon* MuonMatchingTool :: matchOff(const EventContext& ctx, const T*
 
   return muon;
 } 
+
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.h
index 0268054dcef8..80b1cefce2ae 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.h
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.h
@@ -91,6 +91,39 @@ class TrigMuonMonitorAlgorithm : public AthMonitorAlgorithm {
    */
   virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext &ctx, const xAOD::Muon* mu, const std::string &chain) const;
 
+
+  /**
+   * @brief Function that fills variables of ratio plots.
+   * @see @c TrigMuonMonitorAlgorithm.icc for the implementation
+   * @param ctx @c EventContext provided by athenaMT
+   * @param mu Pointer to an offline muon provided in @c fillHistograms
+   * @param trigstep trigger step
+   * @param type xAOD::Muon::TrackParticleType of offline muon
+   * @param matchFunc Function pointer that implements cuts for the online muon candidates gotten by ReadHandle. 
+   */
+  template <class T, class FUNCT>
+  StatusCode fillVariablesRatioPlots(const EventContext &ctx, const xAOD::Muon* mu,
+                                     std::string &&trigstep,
+                                     xAOD::Muon::TrackParticleType type,
+                                     FUNCT matchFunc) const;
+
+  /**
+   * @brief Function that fills variables of etaphi2D plots.
+   * @see @c TrigMuonMonitorAlgorithm.icc for the implementation
+   * @param ctx @c EventContext provided by athenaMT
+   * @param ReadHandleKey SG::ReadHandleKey of online muon.
+   * @param trigstep trigger step
+   * @param PosFunc Function pointer that implements cuts for the online muon candidates. 
+   */
+  template<class T>
+  StatusCode fillVariableEtaPhi(const EventContext &ctx,
+                                SG::ReadHandleKey<DataVector<T> > ReadHandleKey,
+                                std::string &&trigstep,
+                                std::tuple<bool,double,double> (*PosFunc)(const T*) = &TrigMuonMonitorAlgorithm::defaultPosFunc<T>) const;
+
+  template<class T> static inline std::tuple<bool, double, double> defaultPosFunc(const T* trig);
+
+
   // ToolHandle
   ToolHandle<MuonMatchingTool> m_matchTool {this, "MuonMatchingTool", "MuonMatchingTool", "Tool for matching offline and online objects"};
 
@@ -105,7 +138,11 @@ class TrigMuonMonitorAlgorithm : public AthMonitorAlgorithm {
   /// Name of monitored group
   Gaudi::Property<std::string> m_group {this, "Group", "", "Histogram group"};
 
+  /// Threshold for ratio measurement
+  const float m_ratio_measurement_threshold = 4;
 
 };
 
+#include "TrigMuonMonitorAlgorithm.icc"
+
 #endif //TRIGMUONMONITORINGMT_TRIGMUONMONITORALGORITHM_H
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.icc b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.icc
new file mode 100644
index 000000000000..16b2cd8f9324
--- /dev/null
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.icc
@@ -0,0 +1,65 @@
+/* -*- mode:c++ -*-
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+
+template <class T, class FUNCT>
+StatusCode TrigMuonMonitorAlgorithm::fillVariablesRatioPlots(const EventContext &ctx, const xAOD::Muon* mu,
+                                                             std::string &&trigstep,
+                                                             xAOD::Muon::TrackParticleType type, 
+                                                             FUNCT matchFunc) const
+{
+
+  const xAOD::TrackParticle* OfflineTrack = mu->trackParticle(type);
+  if ( OfflineTrack ){
+    auto AboveCut = Monitored::Scalar<bool>(trigstep+"AboveCut",false);
+    float OffPt = OfflineTrack->pt()/1e3;
+    if ( OffPt > m_ratio_measurement_threshold ){
+      const T *trigMu = matchFunc(ctx, mu);
+      if ( trigMu ){
+        if ( std::abs( trigMu->pt() ) > m_ratio_measurement_threshold ) AboveCut = true;
+      }
+    }
+
+    auto lb = Monitored::Scalar<int>("LB",-1.0);
+    lb = GetEventInfo(ctx)->lumiBlock();
+    fill(m_group, lb, AboveCut);
+  }
+
+  return StatusCode::SUCCESS;
+
+}
+
+template<class T>
+StatusCode TrigMuonMonitorAlgorithm::fillVariableEtaPhi(const EventContext &ctx,
+                                                        SG::ReadHandleKey<DataVector<T> > ReadHandleKey,
+                                                        std::string &&trigstep,
+                                                        std::tuple<bool,double,double> (*PosFunc)(const T*)) const
+{
+
+  using CONTAINER = DataVector<T>;
+  SG::ReadHandle<CONTAINER> trigmuons(ReadHandleKey, ctx);
+  if (! trigmuons.isValid() ) {
+    ATH_MSG_ERROR("evtStore() does not contain collection with name "<< ReadHandleKey);
+    return StatusCode::FAILURE;
+  }
+
+  for (const auto& trigmu : *trigmuons) {
+
+    auto Eta = Monitored::Scalar<float>(trigstep+"Eta",-999.);
+    auto Phi = Monitored::Scalar<float>(trigstep+"Phi",-999.);
+
+    const auto [status, trigEta, trigPhi] = PosFunc(trigmu);
+    if(!status) continue;
+    Eta = trigEta;
+    Phi = trigPhi;
+    fill(m_group, Eta, Phi);
+
+  }
+
+  return StatusCode::SUCCESS;
+
+}
+
+template<class T>
+std::tuple<bool, double, double> TrigMuonMonitorAlgorithm::defaultPosFunc(const T* trig){ return std::forward_as_tuple(true, trig->eta(), trig->phi()); }
-- 
GitLab


From dde54185f091527b5856963f50d00f94f628ed8c Mon Sep 17 00:00:00 2001
From: Savanna Marie Shaw <savanna.marie.shaw@cern.ch>
Date: Fri, 18 Sep 2020 14:55:39 +0200
Subject: [PATCH 233/422] Update contents of event view data verifier for
 standalone muons

Since we now run the decoding for the muon trigger directly inside the SA muon views, the related containers can be removed from the event view data verifier for this step.
---
 .../python/HLTMenuConfig/Muon/MuonSetup.py           | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
index 9c9de6dcf44b..7f7b73870e7b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
@@ -575,18 +575,6 @@ def muEFSARecoSequence( RoIs, name ):
   if not conddb.folderRequested( "/MDT/TUBE_STATUS/DEAD_TUBE" ):
     EFMuonViewDataVerifier.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/MDT/TUBE_STATUS/DEAD_TUBE' )]
 
-  if name != 'FS':
-    # we now try to share the data preparation algorithms with L2, so we tell the view that it should expect the MDT, TGC, CSC and RPC PRDs to be available
-    EFMuonViewDataVerifier.DataObjects += [( 'Muon::MdtPrepDataContainer' , 'StoreGateSvc+MDT_DriftCircles' ),
-                                           ( 'Muon::TgcPrepDataContainer' , 'StoreGateSvc+TGC_Measurements' ),
-                                           ( 'Muon::RpcPrepDataContainer' , 'StoreGateSvc+RPC_Measurements' )]
-    if MuonGeometryFlags.hasCSC():
-      EFMuonViewDataVerifier.DataObjects += [( 'Muon::CscStripPrepDataContainer' , 'StoreGateSvc+CSC_Measurements' ),
-                                             ( 'Muon::CscPrepDataContainer' , 'StoreGateSvc+CSC_Clusters' )]
-    if (MuonGeometryFlags.hasSTGC() and MuonGeometryFlags.hasMM()): 
-      EFMuonViewDataVerifier.DataObjects += [( 'Muon::MMPrepDataContainer'       , 'StoreGateSvc+MM_Measurements'),
-                                             ( 'Muon::sTgcPrepDataContainer'     , 'StoreGateSvc+STGC_Measurements')]
-
   #need MdtCondDbAlg for the MuonStationIntersectSvc (required by segment and track finding)
   from AthenaCommon.AlgSequence import AthSequencer
   from MuonCondAlg.MuonTopCondAlgConfigRUN2 import MdtCondDbAlg
-- 
GitLab


From aa3c4551fd11a3beebd747f7bf3515e1a52bc98f Mon Sep 17 00:00:00 2001
From: Stephen Nicholas Swatman <stephen.nicholas.swatman@cern.ch>
Date: Fri, 18 Sep 2020 14:45:37 +0200
Subject: [PATCH 234/422] Avoid recomputation of holes in TrackSummaryTool

As of !36404, the TrackSummaryTool no longer ignores tracks with
existing track summaries. However, this has introduced a bit of a
performance regression where it recomputes hole searches for tracks
that already have that infomation attached. This commit adds a
constraint to the hole search code such that it only runs if the track
does not already have hole search information attached to it. As far as
I can tell this solves the performance bug.
---
 .../TrkTrackSummaryTool/TrackSummaryTool.h             |  4 ++++
 .../TrkTrackSummaryTool/src/TrackSummaryTool.cxx       | 10 +++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h
index c134eb940a35..bcdd9b114d7f 100755
--- a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h
+++ b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h
@@ -280,6 +280,10 @@ private:
                                                1,
                                                "" };
 
+  Gaudi::Property<bool> m_alwaysRecomputeHoles {
+    this, "AlwaysRecomputeHoles", false, ""
+  };
+
   /**atlas id helper*/
   const AtlasDetectorID* m_detID;
 
diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
index f84bcee4a5df..4710bcd56047 100755
--- a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
+++ b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
@@ -270,7 +270,15 @@ Trk::TrackSummaryTool::createSummary( const Track& track,
       <<track.info().dumpInfo()<<"). This should never happen! ");
   }
 
-  if (doHolesInDet || doHolesMuon)
+  bool hole_search_done = (
+    information[Trk::numberOfPixelHoles] != -1 &&
+    information[Trk::numberOfSCTHoles] != -1 &&
+    information[Trk::numberOfSCTDoubleHoles] != -1 &&
+    information[Trk::numberOfPixelDeadSensors] != -1 &&
+    information[Trk::numberOfSCTDeadSensors] != -1
+  );
+
+  if ((doHolesInDet || doHolesMuon) && (!hole_search_done || m_alwaysRecomputeHoles.value()))
   {
     if (m_pixelExists)
     {
-- 
GitLab


From ef261d1cc662a5fdc95ae832c110881c1252fd97 Mon Sep 17 00:00:00 2001
From: Stephen Nicholas Swatman <stephen.nicholas.swatman@cern.ch>
Date: Mon, 14 Sep 2020 18:30:00 +0200
Subject: [PATCH 235/422] Allow GlobalChi2Fitter to create track summaries

As we move towards fitters (possibly) returning tracks with fitters, we
will need some infrastructure for track fitters to return summaries.
This simple commit adds a flag to the Trk::GlobalChi2Fitter that makes
it return empty track summaries in addition to the tracks themselves.
---
 .../TrkGlobalChi2Fitter/GlobalChi2Fitter.h      |  1 +
 .../src/GlobalChi2Fitter.cxx                    | 17 ++++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h
index 6822055ca363..50928716eec8 100755
--- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h
+++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h
@@ -790,6 +790,7 @@ namespace Trk {
     Gaudi::Property<bool> m_asymeloss {this, "AsymmetricEnergyLoss", true};
     Gaudi::Property<bool> m_useCaloTG {this, "UseCaloTG", false};
     Gaudi::Property<bool> m_rejectLargeNScat {this, "RejectLargeNScat", false};
+    Gaudi::Property<bool> m_createSummary {this, "CreateTrackSummary", true};
 
     Gaudi::Property<double> m_outlcut {this, "OutlierCut", 5.0};
     Gaudi::Property<double> m_p {this, "Momentum", 0.0};
diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
index b73626e76205..d85eb877e0d5 100644
--- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
+++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
@@ -33,6 +33,7 @@
 #include "TrkGeometry/MaterialProperties.h"
 #include "TrkTrack/TrackStateOnSurface.h"
 #include "TrkTrack/Track.h"
+#include "TrkTrackSummary/TrackSummary.h"
 #include "TrkEventPrimitives/FitQuality.h"
 
 #include "TrkRIO_OnTrack/RIO_OnTrack.h"
@@ -7188,7 +7189,21 @@ namespace Trk {
       info.setTrackProperties(TrackInfo::StraightTrack);
     }
 
-    return std::make_unique<Track>(info, trajectory.release(), qual.release());
+    std::unique_ptr<Track> rv = std::make_unique<Track>(info, trajectory.release(), qual.release());
+
+    /*
+     * Here, we create a track summary and attach it to our newly created
+     * track. Note that this code only runs if the m_createSummary Gaudi
+     * property is set. In cases where having a track summary on the track is
+     * not desired, such as for compatibility with other tools, this can be
+     * turned off.
+     */
+    if (m_createSummary.value()) {
+      std::unique_ptr<TrackSummary> ts = std::make_unique<TrackSummary>();
+      rv->setTrackSummary(std::move(ts));
+    }
+
+    return rv;
   }
 
   GlobalChi2Fitter::~GlobalChi2Fitter() {
-- 
GitLab


From 3432b0ccfffeb3458313acb7427e54af761a24bb Mon Sep 17 00:00:00 2001
From: Will Kalderon <william.kalderon@cern.ch>
Date: Fri, 18 Sep 2020 14:11:46 +0000
Subject: [PATCH 236/422] Add some combined chains for ATR-21909

---
 .../share/ref_RDOtoRDOTrig_mt1_build.ref      | 18 +++++++++++++++++
 .../share/ref_data_v1Dev_build.ref            | 18 +++++++++++++++++
 .../python/HLTMenuConfig/Menu/LS2_v1.py       | 20 +++++++++++++------
 3 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
index a281e726a854..0b48bdbe5d1f 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
@@ -1,3 +1,6 @@
+TrigSignatureMoniMT                                 INFO HLT_2e12_lhloose_mu10_L12EM8VH_MU10 #2518246928
+TrigSignatureMoniMT                                 INFO -- #2518246928 Events         1          1          0          0          0          0          0          0          0          0          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2518246928 Features                             0          0          0          0          0          0          0          0          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_2e17_etcut_L12EM15VH #3136730292
 TrigSignatureMoniMT                                 INFO -- #3136730292 Events         2          2          2          2          2          -          -          -          -          -          -          -          -          -          2
 TrigSignatureMoniMT                                 INFO -- #3136730292 Features                             12         296        14         -          -          -          -          -          -          -          -          -
@@ -13,6 +16,9 @@ TrigSignatureMoniMT                                 INFO -- #1796849979 Features
 TrigSignatureMoniMT                                 INFO HLT_2e3_etcut_L12EM3 #2613484113
 TrigSignatureMoniMT                                 INFO -- #2613484113 Events         20         20         20         20         20         -          -          -          -          -          -          -          -          -          20
 TrigSignatureMoniMT                                 INFO -- #2613484113 Features                             342        3678       780        -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_2g10_loose_mu20_L1MU20 #3765708828
+TrigSignatureMoniMT                                 INFO -- #3765708828 Events         8          8          1          1          1          0          0          0          0          0          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3765708828 Features                             2          2          6          0          0          0          0          0          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_2g20_tight_L12EM15VH #3837353071
 TrigSignatureMoniMT                                 INFO -- #3837353071 Events         2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3837353071 Features                             0          0          0          0          -          -          -          -          -          -          -          -
@@ -112,6 +118,9 @@ TrigSignatureMoniMT                                 INFO -- #843341480 Features
 TrigSignatureMoniMT                                 INFO HLT_cscmon_L1All #1000936179
 TrigSignatureMoniMT                                 INFO -- #1000936179 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20
 TrigSignatureMoniMT                                 INFO -- #1000936179 Features                             -          -          -          -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_e12_lhloose_2mu10_L12MU10 #4167710884
+TrigSignatureMoniMT                                 INFO -- #4167710884 Events         3          3          0          0          0          0          0          0          0          0          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #4167710884 Features                             0          0          0          0          0          0          0          0          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_e140_lhloose_L1EM22VHI #3471067710
 TrigSignatureMoniMT                                 INFO -- #3471067710 Events         6          6          0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3471067710 Features                             0          0          0          0          -          -          -          -          -          -          -          -
@@ -127,6 +136,12 @@ TrigSignatureMoniMT                                 INFO -- #140779220 Features
 TrigSignatureMoniMT                                 INFO HLT_e20_lhmedium_e15_lhmedium_Zee_L12EM3 #1784800924
 TrigSignatureMoniMT                                 INFO -- #1784800924 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1784800924 Features                             0          0          0          0          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_e24_lhmedium_2g12_loose_L1EM20VH_3EM10VH #2668628593
+TrigSignatureMoniMT                                 INFO -- #2668628593 Events         2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2668628593 Features                             0          0          0          0          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_e24_lhmedium_g25_medium_L12EM20VH #2785977835
+TrigSignatureMoniMT                                 INFO -- #2785977835 Events         2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2785977835 Features                             0          0          0          0          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_e24_lhvloose_2e12_lhvloose_L1EM20VH_3EM10VH #9348946
 TrigSignatureMoniMT                                 INFO -- #9348946 Events            2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #9348946 Features                                0          0          0          0          -          -          -          -          -          -          -          -
@@ -220,6 +235,9 @@ TrigSignatureMoniMT                                 INFO -- #3370790749 Features
 TrigSignatureMoniMT                                 INFO HLT_g300_etcut_L1EM22VHI #310189774
 TrigSignatureMoniMT                                 INFO -- #310189774 Events          6          6          0          0          0          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #310189774 Features                              0          0          0          -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_g35_loose_mu18_L1EM24VHI #3939387897
+TrigSignatureMoniMT                                 INFO -- #3939387897 Events         6          6          2          2          2          2          2          1          1          1          -          -          -          -          1
+TrigSignatureMoniMT                                 INFO -- #3939387897 Features                             2          2          4          2          2          1          1          1          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_g35_medium_g25_medium_L12EM20VH #1158879722
 TrigSignatureMoniMT                                 INFO -- #1158879722 Events         2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1158879722 Features                             0          0          0          0          -          -          -          -          -          -          -          -
diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
index 0b92e9e37a22..12078902069a 100644
--- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
@@ -1,3 +1,6 @@
+TrigSignatureMoniMT                                 INFO HLT_2e12_lhloose_mu10_L12EM8VH_MU10 #2518246928
+TrigSignatureMoniMT                                 INFO -- #2518246928 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2518246928 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2e17_etcut_L12EM15VH #3136730292
 TrigSignatureMoniMT                                 INFO -- #3136730292 Events         20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3136730292 Features                             0          0          0          -          -          -          -          -          -          -          -          -          
@@ -13,6 +16,9 @@ TrigSignatureMoniMT                                 INFO -- #1796849979 Features
 TrigSignatureMoniMT                                 INFO HLT_2e3_etcut_L12EM3 #2613484113
 TrigSignatureMoniMT                                 INFO -- #2613484113 Events         20         20         13         13         13         -          -          -          -          -          -          -          -          -          13         
 TrigSignatureMoniMT                                 INFO -- #2613484113 Features                             92         324        178        -          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_2g10_loose_mu20_L1MU20 #3765708828
+TrigSignatureMoniMT                                 INFO -- #3765708828 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3765708828 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2g20_tight_L12EM15VH #3837353071
 TrigSignatureMoniMT                                 INFO -- #3837353071 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3837353071 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
@@ -112,6 +118,9 @@ TrigSignatureMoniMT                                 INFO -- #843341480 Features
 TrigSignatureMoniMT                                 INFO HLT_cscmon_L1All #1000936179
 TrigSignatureMoniMT                                 INFO -- #1000936179 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #1000936179 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_e12_lhloose_2mu10_L12MU10 #4167710884
+TrigSignatureMoniMT                                 INFO -- #4167710884 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #4167710884 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_e140_lhloose_L1EM22VHI #3471067710
 TrigSignatureMoniMT                                 INFO -- #3471067710 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3471067710 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
@@ -127,6 +136,12 @@ TrigSignatureMoniMT                                 INFO -- #140779220 Features
 TrigSignatureMoniMT                                 INFO HLT_e20_lhmedium_e15_lhmedium_Zee_L12EM3 #1784800924
 TrigSignatureMoniMT                                 INFO -- #1784800924 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1784800924 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_e24_lhmedium_2g12_loose_L1EM20VH_3EM10VH #2668628593
+TrigSignatureMoniMT                                 INFO -- #2668628593 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2668628593 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_e24_lhmedium_g25_medium_L12EM20VH #2785977835
+TrigSignatureMoniMT                                 INFO -- #2785977835 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2785977835 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_e24_lhvloose_2e12_lhvloose_L1EM20VH_3EM10VH #9348946
 TrigSignatureMoniMT                                 INFO -- #9348946 Events            20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #9348946 Features                                0          0          0          0          -          -          -          -          -          -          -          -          
@@ -220,6 +235,9 @@ TrigSignatureMoniMT                                 INFO -- #3370790749 Features
 TrigSignatureMoniMT                                 INFO HLT_g300_etcut_L1EM22VHI #310189774
 TrigSignatureMoniMT                                 INFO -- #310189774 Events          20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #310189774 Features                              0          0          0          -          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_g35_loose_mu18_L1EM24VHI #3939387897
+TrigSignatureMoniMT                                 INFO -- #3939387897 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3939387897 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_g35_medium_g25_medium_L12EM20VH #1158879722
 TrigSignatureMoniMT                                 INFO -- #1158879722 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1158879722 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 78c615c0530f..e63968bbf523 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -283,16 +283,24 @@ def setupMenu():
         # Primary e-mu chains
         ChainProp(name='HLT_e17_lhloose_mu14_L1EM15VH_MU10', l1SeedThresholds=['EM15VH','MU10'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
         ChainProp(name='HLT_e7_lhmedium_mu24_L1MU20',l1SeedThresholds=['EM3','MU20'],  mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
-        # Test photon-muon chain (isolation is there to have different number of steps)
+        ChainProp(name='HLT_e12_lhloose_2mu10_L12MU10', l1SeedThresholds=['EM8VH','MU10'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
+        ChainProp(name='HLT_2e12_lhloose_mu10_L12EM8VH_MU10', l1SeedThresholds=['EM8VH','MU10'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
+
+        # Primary g-mu chains
         ChainProp(name='HLT_g25_medium_mu24_ivarmedium_L1MU20',l1SeedThresholds=['EM15VH','MU20'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
-    
-        # electron + photon stay in the same step - these need to be parallel merged!
+        ChainProp(name='HLT_g35_loose_mu18_L1EM24VHI', l1SeedThresholds=['EM24VHI','MU10'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
+        ChainProp(name='HLT_2g10_loose_mu20_L1MU20', l1SeedThresholds=['EM7','MU20'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup), # unsure what EM seed should be    
+
+        # Primary e-g chains: electron + photon stay in the same step - these need to be parallel merged!
+        # test
         ChainProp(name='HLT_e3_etcut1step_g5_etcut_L12EM3',l1SeedThresholds=['EM3','EM3'], mergingStrategy='parallel', stream=[PhysicsStream], groups=MultiElectronGroup),
-  
+        # primaries
+        ChainProp(name='HLT_e24_lhmedium_g25_medium_L12EM20VH', l1SeedThresholds=['EM20VH','EM20VH'], mergingStrategy='parallel', stream=[PhysicsStream], groups=MultiElectronGroup),
+        ChainProp(name='HLT_e24_lhmedium_2g12_loose_L1EM20VH_3EM10VH', l1SeedThresholds=['EM20VH','EM10VH'], mergingStrategy='parallel', stream=[PhysicsStream], groups=MultiElectronGroup), # unsure about l1SeedThresholds
+
         # Test chains for muon + jet/MET merging/aligning
         ChainProp(name='HLT_mu6fast_xe30_mht_L1XE10', l1SeedThresholds=['MU6','XE10'], mergingStrategy='serial', stream=[PhysicsStream], groups=SingleMETGroup),
-        ChainProp(name='HLT_mu6fast_j45_nojcalib_L1J20', l1SeedThresholds=['MU6','J20'], mergingStrategy='serial', stream=[PhysicsStream], groups=SingleMETGroup),
-    
+        ChainProp(name='HLT_mu6fast_j45_nojcalib_L1J20', l1SeedThresholds=['MU6','J20'], mergingStrategy='serial', stream=[PhysicsStream], groups=SingleMETGroup),    
     
     ]
     TriggerFlags.HeavyIonSlice.signatures  = TriggerFlags.HeavyIonSlice.signatures() + []
-- 
GitLab


From 58b09417b00e7fdf66991021726d0c83b03bd2f9 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 17 Sep 2020 20:26:35 +0200
Subject: [PATCH 237/422] InDetConfig: Fix typo in flag name.

minPt -> minPT.
---
 InnerDetector/InDetConfig/python/TrackingCutsFlags.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetConfig/python/TrackingCutsFlags.py b/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
index a59976e2e115..cfa8fe0dc807 100644
--- a/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
+++ b/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
@@ -520,7 +520,7 @@ def createLowPtLargeD0TrackingFlags():
 def createLowPtTrackingFlags():
     icf = createTrackingFlags()
     icf.extension        = "LowPt"
-    icf.maxPT = lambda pcf: (1e6  if pcf.InDet.doMinBias else pcf.InDet.Tracking.minPt + 0.3) * Units.GeV
+    icf.maxPT = lambda pcf: (1e6  if pcf.InDet.doMinBias else pcf.InDet.Tracking.minPT + 0.3) * Units.GeV
     icf.minPT            = 0.050 * Units.GeV
     icf.minClusters      = 5
     icf.minSiNotShared   = 4
-- 
GitLab


From e50ecc528d748c9303e9ee82a5a8bae97c24e3d1 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Fri, 18 Sep 2020 16:43:35 +0200
Subject: [PATCH 238/422] AFPToF pseudo efficiency histograms

---
 .../Run3AFPMonitoring/AFPToFAlgorithm.h       |  5 +-
 .../python/Run3AFPExampleMonitorAlgorithm.py  | 22 +++---
 .../src/AFPSiLayerAlgorithm.cxx               | 70 ++-----------------
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx | 15 ++--
 4 files changed, 28 insertions(+), 84 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
index b1b8d35539c3..05dd2d8cbd0c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -21,13 +21,14 @@ public:
 	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 
 private:
-	std::map<std::string,int> m_HitmapGroupsToF;
+	std::map<std::string,int> m_StationNamesGroup;
+	std::map<std::string,int> m_TrainsToFGroup;
 	SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
 
 protected:
 	// Only 0 and 3 are ToF stations (farAside and farCside)
 	std::vector<std::string> m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" };
-
+	std::vector<std::string> m_trainsToF = { "train0", "train1" , "train2" , "train3" };
 };
 #endif
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 35aab2a18c61..e09bd1c9318a 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -34,19 +34,21 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPSiGroup.defineHistogram('lb,nSiHits', title='Total number of hits;lb;total number of Hits', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
     AFPSiGroup.defineHistogram('lb,muPerBCID', title='<mu>;lumiBlock;<mu>', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
     AFPSiGroup.defineHistogram('planeHitsAll', title='Number of hits per plane;plane; hits', type='TH1F', path='SiT/HitsPerPlanes', xbins=16, xmin=-0.5, xmax=15.5)
-
     #AFPSiGroup.defineHistogram('layerNumber,layerEfficiency', title='LayerEfficiency;layerNumber', path='SiT/', xbins = 16, xmin=0.5, xmax=16.5, ybins=100, ymin=0, ymax=1)
     #AFPSiGroup.defineHistogram('layerEfficiency', type='TH1F', title='1D layer efficiency;layerEfficiency', path='SiT/', xbins=16, xmin=0.5, xmax=16.5)
 
     AFPToFGroup.defineHistogram('lb,nTofHits', title='Multiplicity;lb;total number of Hits', type='TProfile', path='ToF/', xbins=1000, xmin=-0.5, xmax=999.5) 
     AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
     AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
+    AFPToFGroup.defineHistogram('barInTrainAll', title='Number of hits in bar per plane; barInTrain;hits',type='TH1F', path='ToF/HitsPerBarsInTrain', xbins=16, xmin=-0.5, xmax=15.5)
 
     # Using a map of groups
     layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
     stationList = ['farAside', 'nearAside', 'nearCside', 'farCside']
+    trainList = ['train0', 'train1', 'train2', 'train3']
 
     array = helper.addArray([stationList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
+
     array.defineHistogram('pixelColIDChip', title='Hits per column for station {0}, layer {1};pixelColIDChip; entries', path='PixelColIDChip/{0}', xbins=80, xmin=0.5, xmax=80.5)
     array.defineHistogram('pixelRowIDChip', title='Hits per row for station {0}, layer {1};pixelRowIDChip; entries', path='PixelRowIDChip/{0}', xbins=336, xmin=0.5, xmax=336.5)
     array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for station {0}, layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D/{0}', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
@@ -60,6 +62,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
 
 
     array = helper.addArray([stationList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
+    
     array.defineHistogram('planeHits', type='TH1F', title='Number of hits per plane, station {0};plane; hits', path='HitsPerPlanes', xbins=4, xmin=-0.5, xmax=3.5)
     array.defineHistogram('trackY,trackX', title='Track in AFP station {0};x [mm];y [mm]', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
     array.defineHistogram('lb,clustersPerStation', title ='Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
@@ -67,8 +70,12 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     array.defineHistogram('lb,clustersPerStationEnd', title ='(End) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
     array.defineHistogram('lb,clustersPerStationMiddle', title ='(Middle) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
 
-    arrayOneList = helper.addArray([stationList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
-    arrayOneList.defineHistogram('barInTrainID,trainID', title='ToF hit bar vs train {0};barInTrainID;trainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
+
+    arrayToF = helper.addArray([stationList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
+    
+    arrayToF.defineHistogram('barInTrainID,trainID', title='ToF hit bar vs train {0};barInTrainID;trainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
+    arrayToF = helper.addArray([trainList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
+    arrayToF.defineHistogram('barInTrainID', title='Total hits per bars in {}; barID; hits', type='TH1F', path='HitsPerBarsInTrain', xbins=4,xmin=-0.5,xmax=3.5)
     
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
@@ -87,10 +94,10 @@ if __name__=='__main__':
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
-    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000002.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337176.calibration_AFP.AODV1_EXT0/user.ladamczy.21473705.EXT0._000003.xAOD.root']
-
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000001.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput56-337176-efficiency.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput59-test.root'
+    
     ConfigFlags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
@@ -105,7 +112,6 @@ if __name__=='__main__':
     from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
     cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
-    cfg.run(10000)
-
+    cfg.run(5000)
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 2d900b3066e0..895c0ec4fada 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -50,7 +50,7 @@
 	std::vector<int> endBCIDsVector;
 	
 	unsigned int efficiencyHistogramCounter=0;
-
+	
 	bool isInListVector(const int bcid, const std::vector<int>&arr)
 	{
 		return std::find_if(arr.begin(),arr.end(),[&bcid](const int& ele){return ele==bcid;})!= arr.end();
@@ -75,6 +75,7 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
 	m_StationPlaneGroup = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
 	m_StationGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
 
+
 	// We must declare to the framework in initialize what SG objects we are going to use:
 	SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
 	ATH_CHECK(m_afpHitContainerKey.initialize());
@@ -126,7 +127,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	auto lb = Monitored::Scalar<int>("lb", 0);
 	auto muPerBCID = Monitored::Scalar<float>("muPerBCID", 0.0);
 	//auto run = Monitored::Scalar<int>("run",0);
-
 	auto weight = Monitored::Scalar<float>("weight", 1.0);
 
 	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
@@ -147,7 +147,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	
 	auto planeHits = Monitored::Scalar<int>("planeHits", 0);
 	auto planeHitsAll = Monitored::Scalar<int>("planeHitsAll", 0);
-
+	
 	
 	lb = GetEventInfo(ctx)->lumiBlock();
 	muPerBCID = lbAverageInteractionsPerCrossing(ctx);
@@ -188,6 +188,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 			fill(m_tools[m_StationGroup.at(m_stationnames.at(hitsItr->stationID()))], planeHits);
 			planeHitsAll = (hitsItr->stationID())*4+hitsItr->pixelLayerID();
 			fill("AFPSiLayerTool", planeHitsAll);
+			
 		}
 		else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
 	}
@@ -209,7 +210,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
 	{
 		clusterX = cluster.x;
 		clusterY = cluster.y;
-
 		fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX);
 	}
 	
@@ -356,66 +356,4 @@ void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, i
 	}
 }
 
-void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbPlane, std::vector<std::vector<std::vector<unsigned int>>> &clusterCounterPlane, unsigned int &counterForEventsPlane, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const
-{
-	float clustersPerPlaneFloat = 0;
-	for(const auto& cluster : fast.clusters()) 
-	{
-		if(lb > previouslbPlane && previouslbPlane != 0)
-		{
-			for(int i=0; i<4; i++)
-			{
-				for(int j=0; j<4; j++)
-				{
-					clustersPerPlaneFloat = clusterCounterPlane[previouslbPlane][i][j];
-					if(muPerBCID != 0 && clustersPerPlaneFloat != 0)
-					{
-						clustersPerPlaneFloat = clustersPerPlaneFloat/(muPerBCID*counterForEventsPlane);
-					}
-					else
-					{
-						clustersPerPlaneFloat = -0.1;
-					}
-				
-					if(histogramType == 'P')
-					{
-						auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 0.0);
-						clustersPerPlane = clustersPerPlaneFloat;
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
-					}
-					else if(histogramType == 'F')
-					{
-						auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
-						clustersPerPlaneFront = clustersPerPlaneFloat;
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
-					}
-					else if(histogramType == 'M')
-					{
-						auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
-						clustersPerPlaneMiddle = clustersPerPlaneFloat;
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
-					}
-					else if(histogramType == 'E')
-					{
-						auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
-						clustersPerPlaneEnd = clustersPerPlaneFloat;
-						fill(m_tools[m_HitmapGroups.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
-					}
-				}
-			}
-			previouslbPlane = lb;
-			++clusterCounterPlane[lb][cluster.station][cluster.layer];
-			counterForEventsPlane=1;
-		}
-		// First time in lumiblock (in plane)
-		else if(clusterCounterPlane[lb][cluster.station][cluster.layer] == 0) 
-		{
-			++clusterCounterPlane[lb][cluster.station][cluster.layer];
-			previouslbPlane = lb;
-		}	
-		// Lumiblock is same, so proceed
-		else if(lb==previouslbPlane)	// Same lumiblock
-		{++clusterCounterPlane[lb][cluster.station][cluster.layer];}
-	}
-}
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index c9d4442f2f9d..17e3c625ab1e 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -27,7 +27,8 @@ AFPToFAlgorithm::~AFPToFAlgorithm() {}
 StatusCode AFPToFAlgorithm::initialize() {
 	using namespace Monitored;
 
-	m_HitmapGroupsToF = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
+	m_StationNamesGroup = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
+	m_TrainsToFGroup = buildToolMap<int>(m_tools, "AFPToFTool", m_trainsToF);
 
 	// We must declare to the framework in initialize what SG objects we are going to use
 	SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
@@ -47,6 +48,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
 	auto trainID = Monitored::Scalar<int>("trainID", 0); 
 	auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
+	auto barInTrainAll = Monitored::Scalar<int>("barInTrainAll", 0);
     
 	lb = GetEventInfo(ctx)->lumiBlock();
  
@@ -66,12 +68,6 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	{
 		trainID = hitsItr->trainID();
 		barInTrainID = hitsItr->barInTrainID();
-<<<<<<< HEAD
-		
-		std::cout << "\t\t\tTrainID: " << trainID << "\n";
-		std::cout << "\t\t\tBarInTrainID: " << barInTrainID << "\n";
-=======
->>>>>>> upstream/master
 
 		if(hitsItr->isSideA())
 		{
@@ -86,7 +82,10 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 
 		if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
 		{
-			fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], barInTrainID, trainID);
+			fill(m_tools[m_StationNamesGroup.at(m_stationNamesToF.at(hitsItr->stationID()))], barInTrainID, trainID);
+			fill(m_tools[m_TrainsToFGroup.at(m_trainsToF.at(trainID))], barInTrainID);
+			barInTrainAll = (trainID*4)+barInTrainID;
+			fill("AFPToFTool", barInTrainAll);
 		}
 	}
 
-- 
GitLab


From 8923cc05a0ed7ac8b2fdb3d066ee66041ef4d03b Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Fri, 18 Sep 2020 16:51:17 +0200
Subject: [PATCH 239/422] using now the tauRecoTools::GetJetCluster function +
 fixed other minor style issues

---
 .../tauRecTools/Root/TauJetRNNUtils.cxx       | 37 +++++++++----------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index 67f01a8699fd..0d062daa6a76 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -3,6 +3,7 @@
 */
 
 #include "tauRecTools/TauJetRNNUtils.h"
+#include "tauRecTools/HelperFunctions.h"
 
 #define GeV 1000
 
@@ -267,19 +268,23 @@ bool     absleadTrackEta(const xAOD::TauJet &tau, double &out){
   out = std::max(0.f, tau.auxdata<float>("ABS_ETA_LEAD_TRACK"));
   return true;
 }
+
 bool     leadTrackDeltaEta(const xAOD::TauJet &tau, double &out){
   out = std::max(0.f, tau.auxdata<float>("TAU_ABSDELTAETA"));
   return true;
 }
+
 bool     leadTrackDeltaPhi(const xAOD::TauJet &tau, double &out){
   out = std::max(0.f, tau.auxdata<float>("TAU_ABSDELTAPHI"));
   return true;
 }
+
 bool     EMFracFixed(const xAOD::TauJet &tau, double &out){
   float emFracFized = tau.auxdata<float>("EMFracFixed");
   out = std::max(emFracFized, 0.0f);
   return true;
 }
+
 bool     etHotShotWinOverPtLeadTrk(const xAOD::TauJet &tau, double &out){
   float etHotShotWinOverPtLeadTrk = tau.auxdata<float>("etHotShotWinOverPtLeadTrk");
   out = std::max(etHotShotWinOverPtLeadTrk, 1e-6f);
@@ -300,6 +305,7 @@ bool     PSFrac(const xAOD::TauJet &tau, double &out){
   
   return success;
 }
+
 bool     ClustersMeanCenterLambda(const xAOD::TauJet &tau, double &out){
   float ClustersMeanCenterLambda;
   const auto success = tau.detail(TauDetail::ClustersMeanCenterLambda, ClustersMeanCenterLambda);
@@ -307,18 +313,21 @@ bool     ClustersMeanCenterLambda(const xAOD::TauJet &tau, double &out){
 
   return success;
 }
+
 bool     ClustersMeanEMProbability(const xAOD::TauJet &tau, double &out){
   float ClustersMeanEMProbability;
   const auto success = tau.detail(TauDetail::ClustersMeanEMProbability, ClustersMeanEMProbability);
   out = std::max(0.f, ClustersMeanEMProbability);
   return success;
 }
+
 bool     ClustersMeanFirstEngDens(const xAOD::TauJet &tau, double &out){
   float ClustersMeanFirstEngDens;
   const auto success = tau.detail(TauDetail::ClustersMeanFirstEngDens, ClustersMeanFirstEngDens);
   out =  std::max(-10.f, ClustersMeanFirstEngDens);
   return success;
 }
+
 bool     ClustersMeanPresamplerFrac(const xAOD::TauJet &tau, double &out){
   float ClustersMeanPresamplerFrac;
   const auto success = tau.detail(TauDetail::ClustersMeanPresamplerFrac, ClustersMeanPresamplerFrac);
@@ -331,6 +340,7 @@ bool     ClustersMeanPresamplerFrac(const xAOD::TauJet &tau, double &out){
 
   return success;
 }
+
 bool     ClustersMeanSecondLambda(const xAOD::TauJet &tau, double &out){
   float ClustersMeanSecondLambda;
   const auto success = tau.detail(TauDetail::ClustersMeanSecondLambda, ClustersMeanSecondLambda);
@@ -533,27 +543,18 @@ bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const
     return false;
   }
 
-  std::size_t nClustersTotal = 0;
   std::vector<const xAOD::CaloCluster *> clusters;
-
-  xAOD::JetConstituentVector jcv = jet_seed->getConstituents();
-  xAOD::JetConstituentVector::const_iterator it = jcv.begin();
-  xAOD::JetConstituentVector::const_iterator it_end = jcv.end();
-  for (; it != it_end; ++it) {
-    auto cl = dynamic_cast<const xAOD::CaloCluster *>((*it)->rawConstituent());
-    if (!cl) {
-	return false;
-    }
-    clusters.push_back(cl);
-    ++nClustersTotal;
-  }
+  bool            incShowerSubtracted(true);
+  TLorentzVector  LC_P4 = tau.p4(xAOD::TauJetParameters::DetectorAxis);
+  double          dRCut(0.2);
+  auto        check_clusters = tauRecTools::GetJetClusterList(jet_seed, clusters, incShowerSubtracted, LC_P4, dRCut);
+  std::size_t nClustersTotal = clusters.size();
 
   // Number of tracks to save
   std::size_t nClustersSave = nClustersTotal;
-  size_t      n_clusterMax(6);
+  std::size_t n_clusterMax(6);
   if (n_clusterMax > 0) {
-    nClustersSave = std::min(static_cast<std::size_t>(n_clusterMax),
-			       nClustersTotal);
+    nClustersSave = std::min((n_clusterMax),nClustersTotal);
   }
   // Sort clusters in descending et order
   auto et_cmp = [](const xAOD::CaloCluster *lhs,
@@ -561,8 +562,6 @@ bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const
     return lhs->et() > rhs->et();
   };
   std::sort(clusters.begin(), clusters.end(), et_cmp);
-
-  TLorentzVector LC_P4 = tau.p4(xAOD::TauJetParameters::DetectorAxis);
   
   float clE(0.), Etot(0.);
   using MomentType = xAOD::CaloCluster::MomentType;
@@ -575,7 +574,7 @@ bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const
 
     TLorentzVector cluster_P4;
     cluster_P4.SetPtEtaPhiM(1, cls->eta(), cls->phi(),0);
-    if(LC_P4.DeltaR(cluster_P4)>0.2)            continue;
+    if(LC_P4.DeltaR(cluster_P4)>dRCut)            continue;
     clE = cls->calE();
     Etot += clE;
   }
-- 
GitLab


From ebccbe0015772c78503ef2cdf33342f94a846fa9 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 18 Sep 2020 16:36:49 +0200
Subject: [PATCH 240/422] LArROD: Fix LArRawChannelBuilderAlg configuration for
 run1 data.

Fix configuration of LArRawChanneBuilderAlg for run1 data.
Fixes crashes introduced by !36247.
See ATR-22071.
---
 .../LArROD/LArROD/LArRawChannelBuilderAlg.h   |  4 +-
 LArCalorimeter/LArROD/python/LArRODConfig.py  |  4 +-
 .../python/LArRawChannelBuilderAlgConfig.py   | 16 +++++-
 .../python/LArRawChannelBuilderDefault.py     | 21 ++++---
 .../LArROD/src/LArRawChannelBuilderAlg.cxx    | 57 +++++++++++++++----
 5 files changed, 78 insertions(+), 24 deletions(-)

diff --git a/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilderAlg.h b/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilderAlg.h
index 64a61755bde9..110d90c70253 100644
--- a/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilderAlg.h
+++ b/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilderAlg.h
@@ -14,6 +14,7 @@
 
 #include "LArElecCalib/ILArPedestal.h"
 #include "LArRawConditions/LArADC2MeV.h"
+#include "LArRawConditions/LArDSPThresholdsComplete.h"
 #include "LArElecCalib/ILArOFC.h"
 #include "LArElecCalib/ILArShape.h" 
 #include "LArCabling/LArOnOffIdMapping.h"
@@ -51,7 +52,8 @@ class LArRawChannelBuilderAlg : public AthReentrantAlgorithm {
 
 
   SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
-  SG::ReadCondHandleKey<AthenaAttributeList> m_thresholdsKey{this, "DSPThresholdsKey","/LAR/NoiseOfl/DSPThresholds", "SG Key for thresholds to compute time and quality"};
+  SG::ReadCondHandleKey<LArDSPThresholdsComplete> m_run1DSPThresholdsKey{this, "Run1DSPThresholdsKey","", "SG Key for thresholds to compute time and quality, run 1"};
+  SG::ReadCondHandleKey<AthenaAttributeList> m_run2DSPThresholdsKey{this, "Run2DSPThresholdsKey","", "SG Key for thresholds to compute time and quality, run 2"};
 
 
   //Other jobOptions:
diff --git a/LArCalorimeter/LArROD/python/LArRODConfig.py b/LArCalorimeter/LArROD/python/LArRODConfig.py
index 48053f898a74..6c300275aa37 100644
--- a/LArCalorimeter/LArROD/python/LArRODConfig.py
+++ b/LArCalorimeter/LArROD/python/LArRODConfig.py
@@ -1,9 +1,8 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon import CfgMgr
 
 def getLArRawChannelBuilder(name="LArRawChannelBuilder" , **kwargs):
-    
     from AthenaCommon.AppMgr import ToolSvc
 
     kwargs.setdefault('LArRawChannelKey', "LArRawChannels")
@@ -36,6 +35,7 @@ def getLArRawChannelBuilder(name="LArRawChannelBuilder" , **kwargs):
     condSeq = AthSequencer("AthCondSeq")
     condLoader=condSeq.CondInputLoader
     fld="/LAR/NoiseOfl/DSPThresholds"
+    kwargs.setdefault('Run2DSPThresholdsKey', fld)
     iovDbSvc.Folders.append(fld+"<db>COOLOFL_LAR/OFLP200</db>")
     condLoader.Load.append(("AthenaAttributeList",fld))
     
diff --git a/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py b/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py
index 5aed1203514d..580530e7c80c 100644
--- a/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py
+++ b/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py
@@ -11,12 +11,15 @@ def LArRawChannelBuilderAlgCfg(configFlags, **kwargs):
 
     kwargs.setdefault("name", "LArRawChannelBuilder")
     kwargs.setdefault("firstSample", configFlags.LAr.ROD.FirstSample)
+    obj = "AthenaAttributeList"
+    dspkey = 'Run2DSPThresholdsKey'
     if configFlags.Input.isMC:
         # need OFC configuration, which includes appropriate ElecCalibDb
         acc.merge(LArOFCCondAlgCfg(configFlags))
         kwargs.setdefault("LArRawChannelKey", "LArRawChannels")
         kwargs.setdefault("ShapeKey", "LArShapeSym")
         fld="/LAR/NoiseOfl/DSPThresholds"
+        sgkey=fld
         dbString="OFLP200"
         dbInstance="LAR_OFL"
         if configFlags.Digitization.PileUpPremixing:
@@ -30,14 +33,21 @@ def LArRawChannelBuilderAlgCfg(configFlags, **kwargs):
             kwargs.setdefault("LArRawChannelKey", "LArRawChannels")
         else:
             kwargs.setdefault("LArRawChannelKey", "LArRawChannels_FromDigits")
-        fld="/LAR/Configuration/DSPThresholdFlat/Thresholds"
+        if 'COMP200' in configFlags.IOVDb.DatabaseInstance:
+            fld='/LAR/Configuration/DSPThreshold/Thresholds'
+            obj='LArDSPThresholdsComplete'
+            dspkey = 'Run1DSPThresholdsKey'
+            sgkey='LArDSPThresholds'
+        else:
+            fld="/LAR/Configuration/DSPThresholdFlat/Thresholds"
+            sgkey=fld
         dbString="CONDBR2"
         dbInstance="LAR_ONL"
 
     from IOVDbSvc.IOVDbSvcConfig import addFolders
-    acc.merge(addFolders(configFlags,fld, dbInstance, className="AthenaAttributeList", db=dbString))
+    acc.merge(addFolders(configFlags,fld, dbInstance, className=obj, db=dbString))
 
-    kwargs.setdefault("DSPThresholdsKey",fld)
+    kwargs.setdefault(dspkey, sgkey)
 
     acc.addEventAlgo(LArRawChannelBuilderAlg(**kwargs))
 
diff --git a/LArCalorimeter/LArROD/python/LArRawChannelBuilderDefault.py b/LArCalorimeter/LArROD/python/LArRawChannelBuilderDefault.py
index 2856101b1d6a..aba9745ef5b9 100644
--- a/LArCalorimeter/LArROD/python/LArRawChannelBuilderDefault.py
+++ b/LArCalorimeter/LArROD/python/LArRawChannelBuilderDefault.py
@@ -1,4 +1,4 @@
-from __future__ import print_function
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from LArROD.LArRODFlags import larRODFlags
 from AthenaCommon.GlobalFlags import globalflags
@@ -7,7 +7,6 @@ from LArByteStream.LArByteStreamConf import LArRawDataReadingAlg
 def LArRawChannelBuilderDefault():
     from AthenaCommon.AlgSequence import AlgSequence
     topSequence = AlgSequence()
-    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 
     if larRODFlags.readDigits() and globalflags.InputFormat() == 'bytestream':
         if LArRawDataReadingAlg() not in topSequence:
@@ -23,16 +22,24 @@ def LArRawChannelBuilderDefault():
         if larRODFlags.keepDSPRaw():
             theLArRawChannelBuilder.LArRawChannelKey=larRODFlags.RawChannelFromDigitsContainerName()
 
+        obj = "AthenaAttributeList"
+        db = 'LAR_ONL'
         if globalflags.DataSource() == 'data':
-           fld="/LAR/Configuration/DSPThresholdFlat/Thresholds"
-           dbString="<db>COOLONL_LAR/CONDBR2</db>"
+            from IOVDbSvc.CondDB import conddb
+            if conddb.GetInstance() == 'COMP200':
+                fld='/LAR/Configuration/DSPThreshold/Thresholds'
+                theLArRawChannelBuilder.Run1DSPThresholdsKey='LArDSPThresholds'
+                obj='LArDSPThresholdsComplete'
+            else:
+                fld="/LAR/Configuration/DSPThresholdFlat/Thresholds"
+                theLArRawChannelBuilder.Run2DSPThresholdsKey=fld
         else:   
            fld="/LAR/NoiseOfl/DSPThresholds"
-           dbString="<db>COOLOFL_LAR/OFLP200</db>"
+           theLArRawChannelBuilder.Run2DSPThresholdsKey=fld
+           db = 'LAR_OFL'
 
-        theLArRawChannelBuilder.DSPThresholdsKey=fld
         from IOVDbSvc.CondDB import conddb
-        conddb.addFolder ("", fld+dbString, className="AthenaAttributeList")   
+        conddb.addFolder (db, fld, className=obj)
 
         topSequence += theLArRawChannelBuilder
 
diff --git a/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx b/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx
index fa210727ac50..929fd976e6f4 100644
--- a/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx
+++ b/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx
@@ -21,12 +21,22 @@ StatusCode LArRawChannelBuilderAlg::initialize() {
   ATH_CHECK(m_ofcKey.initialize());	 
   ATH_CHECK(m_shapeKey.initialize());
   ATH_CHECK(m_cablingKey.initialize() );
-  ATH_CHECK(m_thresholdsKey.initialize(m_useDBFortQ) );
+  ATH_CHECK(m_run1DSPThresholdsKey.initialize(SG::AllowEmpty) );
+  ATH_CHECK(m_run2DSPThresholdsKey.initialize(SG::AllowEmpty) );
+  if (m_useDBFortQ) {
+    if (m_run1DSPThresholdsKey.empty() && m_run2DSPThresholdsKey.empty()) {
+      ATH_MSG_ERROR ("useDB requested but neither Run1DSPThresholdsKey nor Run2DSPThresholdsKey initialized.");
+      return StatusCode::FAILURE;
+    }
+  }
 
   ATH_CHECK(detStore()->retrieve(m_onlineId,"LArOnlineID"));
 
   const std::string cutmsg = m_absECutFortQ.value() ? " fabs(E) < " : " E < "; 
-  ATH_MSG_INFO("Energy cut for time and quality computation: " << cutmsg << " taken from COOL folder "<<m_thresholdsKey.key());
+  ATH_MSG_INFO("Energy cut for time and quality computation: " << cutmsg << 
+               " taken from COOL folder "<<
+               m_run1DSPThresholdsKey.key() << " (run1) " <<
+               m_run2DSPThresholdsKey.key() << " (run2) ");
   return StatusCode::SUCCESS;
 }     
 
@@ -58,15 +68,26 @@ StatusCode LArRawChannelBuilderAlg::execute(const EventContext& ctx) const {
 
   SG::ReadCondHandle<LArOnOffIdMapping> cabling(m_cablingKey,ctx);
   
-  std::unique_ptr<LArDSPThresholdsFlat> dspThreshFlat;
+  std::unique_ptr<LArDSPThresholdsFlat> run2DSPThresh;
+  const LArDSPThresholdsComplete* run1DSPThresh = nullptr;
   if (m_useDBFortQ) {
-     SG::ReadCondHandle<AthenaAttributeList> dspThrshAttr (m_thresholdsKey, ctx);
-     dspThreshFlat = std::unique_ptr<LArDSPThresholdsFlat>(new LArDSPThresholdsFlat(*dspThrshAttr));
-     if (ATH_UNLIKELY(!dspThreshFlat->good())) {
-         ATH_MSG_ERROR( "Failed to initialize LArDSPThresholdFlat from attribute list loaded from " << m_thresholdsKey.key()
-                   << ". Aborting." ); 
-         return StatusCode::FAILURE;
-     }
+    if (!m_run2DSPThresholdsKey.empty()) {
+      SG::ReadCondHandle<AthenaAttributeList> dspThrshAttr (m_run2DSPThresholdsKey, ctx);
+      run2DSPThresh = std::unique_ptr<LArDSPThresholdsFlat>(new LArDSPThresholdsFlat(*dspThrshAttr));
+      if (ATH_UNLIKELY(!run2DSPThresh->good())) {
+        ATH_MSG_ERROR( "Failed to initialize LArDSPThresholdFlat from attribute list loaded from " << m_run2DSPThresholdsKey.key()
+                       << ". Aborting." ); 
+        return StatusCode::FAILURE;
+      }
+    }
+    else if (!m_run1DSPThresholdsKey.empty()) {
+      SG::ReadCondHandle<LArDSPThresholdsComplete> dspThresh (m_run1DSPThresholdsKey, ctx);
+      run1DSPThresh = dspThresh.cptr();
+    }
+    else {
+      ATH_MSG_ERROR( "No DSP threshold configured.");
+      return StatusCode::FAILURE;
+    }
   }
 
   //Loop over digits:
@@ -130,7 +151,21 @@ StatusCode LArRawChannelBuilderAlg::execute(const EventContext& ctx) const {
 
     const float E1=m_absECutFortQ.value() ? std::fabs(E) : E;
     float ecut(0.);
-    if (m_useDBFortQ) { ecut = dspThreshFlat->tQThr(id);} else { ecut = m_eCutFortQ;}
+    if (m_useDBFortQ) {
+      if (run2DSPThresh) {
+        ecut = run2DSPThresh->tQThr(id);
+      }
+      else if (run1DSPThresh) {
+        ecut = run1DSPThresh->tQThr(id);
+      }
+      else {
+        ATH_MSG_ERROR ("DSP threshold problem");
+        return StatusCode::FAILURE;
+      }
+    }
+    else {
+      ecut = m_eCutFortQ;
+    }
     if (E1 > ecut) {
       ATH_MSG_VERBOSE("Channel " << m_onlineId->channel_name(id) << " gain " << gain << " above threshold for tQ computation");
       prov|=0x2000; //  fill bit in provenance that time+quality information are available
-- 
GitLab


From af17b92ac0f8d3863ce380ccb5720d88eed4dd8c Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 15 Sep 2020 10:21:03 -0400
Subject: [PATCH 241/422] TRT_CalibAlgs: Thread-safety cleanups.

Thread-safety annotations should match between declarations and definitions.
Clean up some static variables.
TRTCalibrationMgr is not thread-safe due to its use of TRTCalibrator.
---
 .../TRT_CalibAlgs/TRTCalibrationMgr.h            |  4 +++-
 .../TRT_CalibAlgs/src/TRTOccupancyInclude.cxx    | 16 ++++++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRTCalibrationMgr.h b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRTCalibrationMgr.h
index e885ff7cdd1e..db416918d329 100755
--- a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRTCalibrationMgr.h
+++ b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRTCalibrationMgr.h
@@ -21,6 +21,7 @@
 #include "CommissionEvent/ComTime.h"
 #include "TRT_ConditionsData/RtRelationMultChanContainer.h"
 #include "TRT_ConditionsData/StrawT0MultChanContainer.h"
+#include "CxxUtils/checker_macros.h"
 
 
 namespace TRT{
@@ -58,7 +59,8 @@ made and Dt0 is set to the mean of that. The new t0 is then the old t0
 
 */
 
-class TRTCalibrationMgr: public AthAlgorithm
+// TRTCalibrator is not thread-safe.
+class ATLAS_NOT_THREAD_SAFE TRTCalibrationMgr: public AthAlgorithm
 {
 
 public:
diff --git a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRTOccupancyInclude.cxx b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRTOccupancyInclude.cxx
index c35f014f13be..9d761c14355a 100755
--- a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRTOccupancyInclude.cxx
+++ b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRTOccupancyInclude.cxx
@@ -45,7 +45,7 @@ StatusCode TRTOccupancyInclude::initialize()
 
 //---------------------------------------------------------------------
 
-StatusCode TRTOccupancyInclude::execute ATLAS_NOT_THREAD_SAFE () // static variables are used.
+StatusCode TRTOccupancyInclude::execute()
 {
   msg(MSG::DEBUG) << "execute()" << endmsg;
 
@@ -60,25 +60,25 @@ StatusCode TRTOccupancyInclude::execute ATLAS_NOT_THREAD_SAFE () // static varia
   std::vector<float> TRTOccu = m_LocalOccTool->GlobalOccupancy( );
   if (TRTOccu.size() > 6) {
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy0("TRTOccGlobal"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy0("TRTOccGlobal"); 
   decEventInfo_occupancy0( *eventInfo ) = TRTOccu.at(0); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy1("TRTOccBarrelC"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy1("TRTOccBarrelC"); 
   decEventInfo_occupancy1( *eventInfo ) = TRTOccu.at(1); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy2("TRTOccEndcapAC"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy2("TRTOccEndcapAC"); 
   decEventInfo_occupancy2( *eventInfo ) = TRTOccu.at(2); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy3("TRTOccEndcapBC"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy3("TRTOccEndcapBC"); 
   decEventInfo_occupancy3( *eventInfo ) = TRTOccu.at(3); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy4("TRTOccBarrelA"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy4("TRTOccBarrelA"); 
   decEventInfo_occupancy4( *eventInfo ) = TRTOccu.at(4); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy5("TRTOccEndcapAA"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy5("TRTOccEndcapAA"); 
   decEventInfo_occupancy5( *eventInfo ) = TRTOccu.at(5); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy6("TRTOccEndcapBA"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy6("TRTOccEndcapBA"); 
   decEventInfo_occupancy6( *eventInfo ) = TRTOccu.at(6); 
   }
 
-- 
GitLab


From 5a827682a4cf485f914ecaa32efc393966e7ce00 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 15 Sep 2020 15:32:18 -0400
Subject: [PATCH 242/422] ParticleTruth: Enable thread-safety checking.

Enable thread-safety checking.
---
 .../ParticleTruth/ParticleTruth/ATLAS_CHECK_THREAD_SAFETY        | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 Reconstruction/ParticleTruth/ParticleTruth/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Reconstruction/ParticleTruth/ParticleTruth/ATLAS_CHECK_THREAD_SAFETY b/Reconstruction/ParticleTruth/ParticleTruth/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..15237f7b2edb
--- /dev/null
+++ b/Reconstruction/ParticleTruth/ParticleTruth/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Reconstruction/ParticleTruth
-- 
GitLab


From f1210f38694037dda3c5417feee194960d4289c4 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Fri, 18 Sep 2020 17:36:43 +0200
Subject: [PATCH 243/422] HLTConfigSvc: Restore running from DB for MC jobs

Restore running from the DB for MC jobs (partial revert of !36139).
Remove code for filling of histograms, which was only useful in the online.

Fixes ATR-22056.
---
 .../TrigConfigSvc/src/HLTConfigSvc.cxx        | 84 +++++++++----------
 .../TrigConfigSvc/src/HLTConfigSvc.h          |  5 --
 2 files changed, 40 insertions(+), 49 deletions(-)

diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx
index 1f0fadd7393b..3536edb0cae8 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx
@@ -56,16 +56,13 @@ using namespace TrigConf;
 
 HLTConfigSvc::HLTConfigSvc( const string& name, ISvcLocator* pSvcLocator ) :
    base_class(name, pSvcLocator),
-   m_eventStore( "StoreGateSvc/StoreGateSvc",  name ),
-   m_histProp_timePrescaleUpdate(Gaudi::Histo1DDef("Time for prescale update",0,200,100))
+   m_eventStore( "StoreGateSvc/StoreGateSvc",  name )
 {
    base_class::declareCommonProperties();
 
    declareProperty( "DBHLTPSKey",       m_dbHLTPSKey );
    declareProperty( "DBHLTPSKeySet",    m_dbHLTPSKeySet,
                     "List of HLT Prescale keys associated with start Lumiblocks LB1uPSK1cLB2uPSK2" );
-   declareProperty( "HistTimePrescaleUpdate", m_histProp_timePrescaleUpdate,
-                    "Histogram of time for prescale update");
    declareProperty( "doMergedHLT",      m_setMergedHLT,
                     "Set true to run the merged HLT processing");
    declareProperty( "doMonitoring",     m_doMon,
@@ -286,8 +283,6 @@ TrigConf::HLTConfigSvc::start() {
 
    ATH_MSG_INFO("HLTConfigSvc::start");
 
-   // Book histograms
-   if (m_doMon) bookHistograms().ignore();
    m_currentLumiblock = 0;
 
    if( ! fromDB() ) // xml config
@@ -339,39 +334,6 @@ TrigConf::HLTConfigSvc::applyPrescaleSet(const TrigConf::HLTPrescaleSet& pss) {
 }
 
 
-StatusCode
-TrigConf::HLTConfigSvc::bookHistograms() {
-
-   ServiceHandle<ITHistSvc> histSvc("THistSvc", name());
-
-   CHECK(histSvc.retrieve());
-
-   const std::string histPath = "/EXPERT/" + name() + "/";
-
-   m_hist_timePrescaleUpdate = new TH1F("TimePrescaleUpdate",
-                                        (m_histProp_timePrescaleUpdate.value().title() + ";time [ms]").c_str(),
-                                        m_histProp_timePrescaleUpdate.value().bins(),
-                                        m_histProp_timePrescaleUpdate.value().lowEdge(),
-                                        m_histProp_timePrescaleUpdate.value().highEdge());
-   const int nLB(1), nKey(1);
-   m_hist_prescaleLB = new TH2I("PrescaleKey_LB","Prescale key used in LB;Lumiblock;Prescale key",
-                                nLB, 0, nLB, nKey, 0, nKey);
-
-   // try to register, delete if failure
-   TH1** hists[] = { (TH1**)&m_hist_timePrescaleUpdate,
-                     (TH1**)&m_hist_prescaleLB };
-   for ( TH1** h: hists ) {
-      if ( *h && histSvc->regHist(histPath + (*h)->GetName(), *h).isFailure() ) {
-         ATH_MSG_WARNING("Cannot register histogram " << (*h)->GetName());
-         delete *h;
-         *h = 0;
-      }
-   }
-
-   return StatusCode::SUCCESS;
-}
-
-
 StatusCode
 TrigConf::HLTConfigSvc::finalize() {
    ATH_MSG_DEBUG("Finalizing");
@@ -428,26 +390,60 @@ TrigConf::HLTConfigSvc::setL2LowerChainCounter(const CTPConfig* ctpcfg) {
 // query the TriggerDB for the list of lumiblocks and corresponding prescalekeys
 // will then load the and prescaleSets that have not yet been loaded
 StatusCode
-TrigConf::HLTConfigSvc::updatePrescaleSets(uint /*requestcount*/) {
+TrigConf::HLTConfigSvc::updatePrescaleSets(uint requestcount) {
 
    if( ! fromDB() ) { // xml 
       ATH_MSG_WARNING("Configured to not run from the database!");
       return StatusCode::SUCCESS;
    }
 
-   ATH_MSG_ERROR("Running from DB is no longer supported in legacy trigger");
-   return StatusCode::FAILURE;
+   if( !m_dbconfig->m_hltkeys.empty() ) {
+      ATH_MSG_WARNING("Has list of [(lb1,psk1), (lb2,psk2),...] defined!");
+      return StatusCode::SUCCESS;
+   }
+
+   // Load prescale set
+   CHECK(initStorageMgr());
+
+   bool loadSuccess = dynamic_cast<TrigConf::StorageMgr*>
+     (m_storageMgr)->hltPrescaleSetCollectionLoader().load( m_HLTFrame.thePrescaleSetCollection(), requestcount, "" );
+
+   CHECK(freeStorageMgr());
+
+   if(!loadSuccess) {
+      ATH_MSG_WARNING("HLTConfigSvc::updatePrescaleSets(): loading failed");
+      return StatusCode::FAILURE;
+   } else {
+      ATH_MSG_INFO ( m_HLTFrame.thePrescaleSetCollection() );
+   }
+   return StatusCode::SUCCESS;
 }
 
 
 // Assigns the prescales that are valid for a given lumiblock to the chains
 // This method is called by TrigSteer on *every* event (keep it fast)
 StatusCode
-TrigConf::HLTConfigSvc::assignPrescalesToChains(uint /*lumiblock*/) {
+TrigConf::HLTConfigSvc::assignPrescalesToChains(uint lumiblock) {
 
    if(! fromDB() ) // xml
       return StatusCode::SUCCESS;
 
-   ATH_MSG_ERROR("Running from DB is no longer supported in legacy trigger");
+   // get the HLTPrescaleSet
+   const HLTPrescaleSet* pss = m_HLTFrame.getPrescaleSetCollection().prescaleSet(lumiblock);
+   if (pss == 0) {
+      ATH_MSG_ERROR("Could not retrieve HLT prescale set for lumiblock = " << lumiblock);
+      return StatusCode::FAILURE;
+   }
+
+   // still the same HLTPSS -> nothing to do
+   if(pss->id() ==  m_currentPSS) {
+      return StatusCode::SUCCESS;
+   }
+
+   ATH_MSG_INFO("Changing PSK from " << m_currentPSS << " to " << pss->id()
+                << " for lumiblock " << lumiblock);
+
+   applyPrescaleSet(*pss);
+
    return StatusCode::FAILURE;
 }
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.h
index 1f1ad5d266d9..6b993fa48ca1 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.h
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.h
@@ -92,11 +92,6 @@ namespace TrigConf {
       // Properties:
       bool            m_setMergedHLT { true }; 
       bool            m_doMon { false };
-      Histo1DProperty m_histProp_timePrescaleUpdate;
-
-      // Histograms:
-      TH1F* m_hist_timePrescaleUpdate { nullptr };
-      TH2I* m_hist_prescaleLB { nullptr };
    };
 }
 
-- 
GitLab


From dabc458b91e86dccd7d1b2084a74491031ef7731 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 15 Sep 2020 11:27:56 -0400
Subject: [PATCH 244/422] TrigInDetPattRecoEvent: Fix clang warning.

Default the copy ctor to avoid warning about a deprecated implicit
assignment op.
---
 .../TrigInDetPattRecoEvent/TrigInDetTriplet.h                | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Trigger/TrigEvent/TrigInDetPattRecoEvent/TrigInDetPattRecoEvent/TrigInDetTriplet.h b/Trigger/TrigEvent/TrigInDetPattRecoEvent/TrigInDetPattRecoEvent/TrigInDetTriplet.h
index 8f04a760c9bb..d1dfe16b6761 100644
--- a/Trigger/TrigEvent/TrigInDetPattRecoEvent/TrigInDetPattRecoEvent/TrigInDetTriplet.h
+++ b/Trigger/TrigEvent/TrigInDetPattRecoEvent/TrigInDetPattRecoEvent/TrigInDetTriplet.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef __TRIG_IN_DET_TRIPLET_H__
@@ -18,8 +18,7 @@ class TrigInDetTriplet {
  TrigInDetTriplet(const TrigSiSpacePointBase& s1, const TrigSiSpacePointBase& s2, const TrigSiSpacePointBase& s3, float Q) : 
     m_s1(s1), m_s2(s2), m_s3(s3), m_Q(Q) {};
 
- TrigInDetTriplet(const TrigInDetTriplet& t) :
-    m_s1(t.m_s1), m_s2(t.m_s2), m_s3(t.m_s3), m_Q(t.m_Q) {};
+ TrigInDetTriplet(const TrigInDetTriplet& t) = default;
  TrigInDetTriplet(TrigInDetTriplet* t) :
     m_s1(t->m_s1), m_s2(t->m_s2), m_s3(t->m_s3), m_Q(t->m_Q) {};
 
-- 
GitLab


From b3f001d11f1f1a623c5d91537c4f02303fe223ed Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 15 Sep 2020 14:17:22 -0400
Subject: [PATCH 245/422] TrigEFMissingET: Fix clang warnings.

---
 .../TrigEFMissingET/TrigEFMissingET/PufitMultiGrid.h            | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/PufitMultiGrid.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/PufitMultiGrid.h
index e3579c36d907..d64e82b01a9f 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/PufitMultiGrid.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/PufitMultiGrid.h
@@ -90,6 +90,8 @@ namespace HLT
          */
         Tower(PufitMultiGrid *parent, std::size_t index);
 
+        Tower(const Tower&) = default;
+
         /**
          * @brief Copy assignment operator
          *
-- 
GitLab


From bb53133573413910850bd1f02aafa68413daf62a Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Fri, 18 Sep 2020 08:55:48 -0700
Subject: [PATCH 246/422] Move member init to header

---
 .../Root/MVATrackVertexAssociationTool.cxx                | 6 +-----
 .../MVATrackVertexAssociationTool.h                       | 8 ++++----
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
index d538e703cf74..97b2f4b62c63 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -25,11 +25,7 @@
 namespace CP {
 
 MVATrackVertexAssociationTool::MVATrackVertexAssociationTool(const std::string& name) :
-  AsgTool(name),
-  m_isSequential(true),
-  m_wp("Tight"),
-  m_cut(-1.0),
-  m_usePathResolver(true)
+  AsgTool(name)
 {
   declareProperty("NetworkFileName", m_fileName,        "Name of the input lwtnn network file."                                                              );
   declareProperty("InputNames",      m_inputNames,      "Vector of the network's input variable names (std::vector<std::string>)."                           );
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
index efac5789e215..d46da2e11490 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
@@ -81,16 +81,16 @@ private:
   std::string m_outputName;
 
   // Is the network sequential or functional
-  bool m_isSequential;
+  bool m_isSequential = true;
 
   // TVA working point
-  std::string m_wp;
+  std::string m_wp = "Tight";
 
   // TVA cut value on the output discriminant
-  float m_cut;
+  float m_cut = -1.0;
 
   // Use the PathResolver to find our input file
-  bool m_usePathResolver;
+  bool m_usePathResolver = true;
 
   // Input variable name/type map
   MVAInputEvaluator::InputSelectionMap m_inputMap;
-- 
GitLab


From 04d0f559f227668c3cf48e21419a7765902b6afc Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Fri, 18 Sep 2020 18:18:09 +0200
Subject: [PATCH 247/422] Fix ATLASDQ-802

---
 .../python/Run3AFPExampleMonitorAlgorithm.py       | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index f58861dd66de..4c354c9f9cfc 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -9,11 +9,11 @@
 
 def Run3AFPExampleMonitoringConfig(inputFlags):
     '''Function to configures some algorithms in the monitoring system.'''
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    result = ComponentAccumulator()
 
-    from LumiBlockComps.BunchCrossingCondAlgDefault import BunchCrossingCondAlgDefault
-    BunchCrossingCondAlgDefault()
-
-
+    from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
+    result.merge(BunchCrossingCondAlgCfg(inputFlags))
     
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
@@ -70,7 +70,8 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     arrayOneList.defineHistogram('barInTrainID,trainID', title='ToF hit bar vs train {0};barInTrainID;trainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
 
     # Finalize. The return value should be a tuple of the ComponentAccumulator
-    return helper.result()
+    result.merge(helper.result())
+    return result
     
 
 if __name__=='__main__':
@@ -100,9 +101,6 @@ if __name__=='__main__':
     
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
-    
-    from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
-    cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
     cfg.run(50000)
 
-- 
GitLab


From 687da740c102181ae26238bca7d5cb53c0c96feb Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 18 Sep 2020 17:29:41 +0100
Subject: [PATCH 248/422] Create EvtIdModifierSvc also in Digitization

---
 Simulation/Digitization/python/RunDependentConfigNew.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Simulation/Digitization/python/RunDependentConfigNew.py b/Simulation/Digitization/python/RunDependentConfigNew.py
index 6b2b24b0bb8e..8aa31ec86093 100644
--- a/Simulation/Digitization/python/RunDependentConfigNew.py
+++ b/Simulation/Digitization/python/RunDependentConfigNew.py
@@ -111,7 +111,7 @@ def EvtIdModifierSvcCfg(flags, name="EvtIdModifierSvc", **kwargs):
     if len(Modifiers) > 0:
         kwargs.setdefault("Modifiers", Modifiers)
 
-    acc.addService(CompFactory.EvtIdModifierSvc(name, **kwargs))
+    acc.addService(CompFactory.EvtIdModifierSvc(name, **kwargs), create=True)
     return acc
 
 
-- 
GitLab


From e84a0ec95c0df3c8e3b20e8fe2acb8fa04bb3b47 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 16 Sep 2020 13:41:09 -0400
Subject: [PATCH 249/422] InDetBoundaryCheckTool: cmake fixes

Fix library dependencies.
---
 .../InDetBoundaryCheckTool/CMakeLists.txt            | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/CMakeLists.txt
index 8340c6d1b917..b4e81d934322 100644
--- a/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/CMakeLists.txt
@@ -6,16 +6,6 @@ atlas_subdir(
     InDetBoundaryCheckTool
 )
 
-# Declare the package's dependencies
-atlas_depends_on_subdirs( 
-    PUBLIC
-    Control/AthenaBaseComps
-    Tracking/TrkTools/TrkToolInterfaces
-    InnerDetector/InDetConditions/InDetConditionsSummaryService
-    InnerDetector/InDetDetDescr/InDetReadoutGeometry
-    InnerDetector/InDetRecToolInterfaces
-)
-
 # Component(s) in the package:
 atlas_add_component(
     InDetBoundaryCheckTool
@@ -28,6 +18,8 @@ atlas_add_component(
     TrkToolInterfaces
     TrkTrack
     InDetReadoutGeometry
+    InDetConditionsSummaryService
+    InDetRecToolInterfaces
 )
 
 # Install files from the package:
-- 
GitLab


From cce55f22d8541e3f240f012987800b420aff0d2c Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Fri, 18 Sep 2020 09:48:08 -0700
Subject: [PATCH 250/422] Use property typedefs in header

---
 .../Root/MVATrackVertexAssociationTool.cxx       |  9 +--------
 .../MVATrackVertexAssociationTool.h              | 16 ++++++++--------
 2 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
index 97b2f4b62c63..20398643027a 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -27,14 +27,7 @@ namespace CP {
 MVATrackVertexAssociationTool::MVATrackVertexAssociationTool(const std::string& name) :
   AsgTool(name)
 {
-  declareProperty("NetworkFileName", m_fileName,        "Name of the input lwtnn network file."                                                              );
-  declareProperty("InputNames",      m_inputNames,      "Vector of the network's input variable names (std::vector<std::string>)."                           );
-  declareProperty("InputTypes",      m_inputTypes,      "Vector of the network's input variable evaluator types (std::vector<CP::MVAEvaluatorInput::Input>).");
-  declareProperty("OutputNodeName",  m_outputName,      "Name of the output node to cut on for TVA."                                                         );
-  declareProperty("IsSequential",    m_isSequential,    "Is the network sequential (true) or functional (false)."                                            );
-  declareProperty("WorkingPoint",    m_wp,              "TVA working point to apply."                                                                        );
-  declareProperty("OutputCut",       m_cut,             "TVA cut value on the output value (set manually with \"Custom\" WP)."                               );
-  declareProperty("UsePathResolver", m_usePathResolver, "Use the PathResolver for finding the input lwtnn network file."                                     );
+  ;
 }
 
 StatusCode MVATrackVertexAssociationTool::initialize() {
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
index d46da2e11490..3dabf1dda4f9 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
@@ -69,28 +69,28 @@ private:
   bool finalizeNetwork();
 
   // Input lwtnn network file
-  std::string m_fileName;
+  StringProperty m_fileName {this, "NetworkFileName", "", "Name of the input lwtnn network file."};
 
   // Vector of input variable names
-  std::vector<std::string> m_inputNames;
+  StringArrayProperty m_inputNames {this, "NetworkFileName", {}, "Vector of the network's input variable names (std::vector<std::string>)."};
 
   // Vector of input variable types
-  std::vector<int> m_inputTypes;
+  IntegerArrayProperty m_inputTypes {this, "InputTypes", {}, "Vector of the network's input variable evaluator types (std::vector<CP::MVAEvaluatorInput::Input>)."};
 
   // Name of the output node to cut on
-  std::string m_outputName;
+  StringProperty m_outputName {this, "OutputNodeName", "", "Name of the output node to cut on for TVA."};
 
   // Is the network sequential or functional
-  bool m_isSequential = true;
+  BooleanProperty m_isSequential {this, "IsSequential", true, "Is the network sequential (true) or functional (false)."};
 
   // TVA working point
-  std::string m_wp = "Tight";
+  StringProperty m_wp {this, "WorkingPoint", "Tight", "TVA working point to apply."};
 
   // TVA cut value on the output discriminant
-  float m_cut = -1.0;
+  FloatProperty m_cut {this, "OutputCut", -1.0, "TVA cut value on the output value (set manually with \"Custom\" WP)."};
 
   // Use the PathResolver to find our input file
-  bool m_usePathResolver = true;
+  BooleanProperty m_usePathResolver {this, "UsePathResolver", true, "Use the PathResolver for finding the input lwtnn network file."};
 
   // Input variable name/type map
   MVAInputEvaluator::InputSelectionMap m_inputMap;
-- 
GitLab


From ef69ae298e2834204bc0a9a604cbf1146beaa5d4 Mon Sep 17 00:00:00 2001
From: Joerg Stelzer <joerg.stelzer@cern.ch>
Date: Fri, 18 Sep 2020 20:07:11 +0200
Subject: [PATCH 251/422] Fix L1Topo file naming

---
 Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
index 9d5cc5d2d5d9..764f7f1e0ab9 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
@@ -495,7 +495,7 @@ class readL1TopoConfigFromXML(JobProperty):
     def _do_action(self):
         """ setup some consistency """
         if self.get_Value():
-            TriggerFlags.inputL1TopoConfigFile = "TriggerMenuXML/L1TopoConfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
+            TriggerFlags.inputL1TopoConfigFile = "TriggerMenuXML/L1Topoconfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
         else:
             TriggerFlags.inputL1TopoConfigFile = TriggerFlags.outputL1TopoConfigFile()
 
@@ -670,7 +670,7 @@ class inputL1TopoConfigFile(JobProperty):
     If TriggerFlags.readL1TopoConfigFromXML()==True, then this file is
     used for L1TopoConfiguration.
     
-    Defaults to L1TopoConfig_<triggerMenuSetup>_<menuVersion>.xml
+    Defaults to L1Topoconfig_<triggerMenuSetup>_<menuVersion>.xml
     """
     statusOn=True
     allowedType=['str']
@@ -678,7 +678,7 @@ class inputL1TopoConfigFile(JobProperty):
 
     def __call__(self):
         if self.get_Value() == "":
-            return "L1TopoConfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
+            return "L1Topoconfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
         else:
             return self.get_Value()
         
-- 
GitLab


From efd6c502793cd03d13165d0dc874163545611d5c Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Fri, 18 Sep 2020 20:36:24 +0200
Subject: [PATCH 252/422] Refactor the Muon RegSelCondAlgs

The RPC has it's own cabling conditions data now, so the extraction of the
cabling has ben moved from the base class into the derived classes for each
muon subsystem
---
 .../src/CSC_RegSelCondAlg.cxx                 | 18 +++++++++++++-
 .../src/CSC_RegSelCondAlg.h                   |  7 +++++-
 .../src/MDT_RegSelCondAlg.cxx                 | 23 ++++++++++++++++--
 .../src/MDT_RegSelCondAlg.h                   |  7 +++++-
 .../src/MM_RegSelCondAlg.cxx                  | 17 ++++++++++++-
 .../MuonRegionSelector/src/MM_RegSelCondAlg.h |  7 +++++-
 .../src/MuonRegSelCondAlg.cxx                 | 24 ++++---------------
 .../src/MuonRegSelCondAlg.h                   | 10 +++-----
 .../src/RPC_RegSelCondAlg.cxx                 | 15 ++++++++----
 .../src/RPC_RegSelCondAlg.h                   |  7 ++++--
 .../src/TGC_RegSelCondAlg.cxx                 | 15 +++++++++++-
 .../src/TGC_RegSelCondAlg.h                   |  7 +++++-
 .../src/sTGC_RegSelCondAlg.cxx                | 19 ++++++++++++++-
 .../src/sTGC_RegSelCondAlg.h                  |  7 +++++-
 14 files changed, 140 insertions(+), 43 deletions(-)

diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.cxx
index 315462d996d0..b1f67570644e 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.cxx
@@ -49,7 +49,23 @@ CSC_RegSelCondAlg::CSC_RegSelCondAlg(const std::string& name, ISvcLocator* pSvcL
 
 
 
-std::unique_ptr<RegSelSiLUT> CSC_RegSelCondAlg::createTable( const MuonMDT_CablingMap* /* mdtCabling */ ) const { 
+StatusCode CSC_RegSelCondAlg::initialize() {
+  ATH_CHECK(MuonRegSelCondAlg::initialize());
+  ATH_CHECK(m_mdtCablingKey.initialize());
+  return StatusCode::SUCCESS;
+}
+
+
+
+std::unique_ptr<RegSelSiLUT> CSC_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
+
+  SG::ReadCondHandle<MuonMDT_CablingMap> mdtCabling( m_mdtCablingKey, ctx );
+
+  if( !mdtCabling.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << mdtCabling.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
+  
 
   /// now get the CSC cabling service ...
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.h
index fa51fe5f81dc..49d7fbcde03f 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.h
@@ -21,8 +21,13 @@ public:
 
   CSC_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* mdtCabling ) const;
+  std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const override;
 
+  virtual StatusCode initialize() override;
+
+  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_mdtCablingKey
+    { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
+  
 };
 
 #endif // CSC_RegSelCondAlg_h
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.cxx
index 93d4e4ebd2fb..ac71366973cd 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.cxx
@@ -39,8 +39,27 @@ MDT_RegSelCondAlg::MDT_RegSelCondAlg(const std::string& name, ISvcLocator* pSvcL
 
 
 
-std::unique_ptr<RegSelSiLUT> MDT_RegSelCondAlg::createTable( const MuonMDT_CablingMap* cabling ) const { 
-  
+
+StatusCode MDT_RegSelCondAlg::initialize() {
+  ATH_CHECK(MuonRegSelCondAlg::initialize());
+  ATH_CHECK(m_cablingKey.initialize());
+  return StatusCode::SUCCESS;
+}
+
+
+
+
+std::unique_ptr<RegSelSiLUT> MDT_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
+
+  SG::ReadCondHandle<MuonMDT_CablingMap> cabling( m_cablingKey, ctx );
+
+  if( !cabling.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << cabling.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
+
+  /// create the new lookup table
+
   const MuonGM::MuonDetectorManager* manager = nullptr; // again 0 would do as well here 
   
   StatusCode sc = detStore()->retrieve( manager );
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.h
index 1de2560110d4..ff42d174c7c6 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.h
@@ -20,7 +20,12 @@ public:
 
   MDT_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* cabling ) const override;   
+  std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const override;   
+
+  virtual StatusCode initialize() override;
+
+  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_cablingKey
+    { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
 
 };
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.cxx
index 686fdc8981fa..fb5a9645592f 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.cxx
@@ -51,8 +51,23 @@ MM_RegSelCondAlg::MM_RegSelCondAlg(const std::string& name, ISvcLocator* pSvcLoc
 
 
 
+StatusCode MM_RegSelCondAlg::initialize() {
+  ATH_CHECK(MuonRegSelCondAlg::initialize());
+  ATH_CHECK(m_mdtCablingKey.initialize());
+  return StatusCode::SUCCESS;
+}
+
+
+
+std::unique_ptr<RegSelSiLUT> MM_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
 
-std::unique_ptr<RegSelSiLUT> MM_RegSelCondAlg::createTable( const MuonMDT_CablingMap* /* mdtCabling */ ) const { 
+  SG::ReadCondHandle<MuonMDT_CablingMap> mdtCabling( m_mdtCablingKey, ctx );
+ 
+  if( !mdtCabling.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << mdtCabling.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
+  
 
   /// no NSW cabling available at the moment ...
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.h
index f21403219f32..10449d690f18 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.h
@@ -21,8 +21,13 @@ public:
 
   MM_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* mdtCabling ) const;
+  std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const override;
 
+  virtual StatusCode initialize() override;
+
+  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_mdtCablingKey
+    { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
+  
 };
 
 #endif // CSC_RegSelCondAlg_h
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.cxx
index e008e4a45892..a7799acd7afc 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.cxx
@@ -14,17 +14,14 @@
 
 #include "GaudiKernel/EventIDRange.h"
 #include "StoreGate/WriteCondHandle.h"
+#include "MuonRegSelCondAlg.h"
+
 
 #include <iostream>
 #include <fstream>
 #include <string>
 
 
-#include "MuonCablingData/MuonMDT_CablingMap.h"
-
-#include "MDT_RegSelCondAlg.h"
-
-
 
 MuonRegSelCondAlg::MuonRegSelCondAlg(const std::string& name, ISvcLocator* pSvcLocator):
   AthReentrantAlgorithm( name, pSvcLocator ),
@@ -42,7 +39,6 @@ MuonRegSelCondAlg::MuonRegSelCondAlg(const std::string& name, ISvcLocator* pSvcL
 StatusCode MuonRegSelCondAlg::initialize()
 {
   ATH_MSG_DEBUG("MuonRegSelCondAlg::initialize() ");
-  ATH_CHECK(m_cablingKey.initialize());
   ATH_CHECK(m_tableKey.initialize());
   ATH_MSG_INFO("MuonRegSelCondAlg::initialize() " << m_tableKey );
   return StatusCode::SUCCESS;
@@ -50,7 +46,7 @@ StatusCode MuonRegSelCondAlg::initialize()
 
 
 
-StatusCode MuonRegSelCondAlg::execute(const EventContext& ctx)  const
+StatusCode MuonRegSelCondAlg::execute(const EventContext& ctx )  const
 {
   ATH_MSG_DEBUG("MuonRegSelCondAlg::execute() -- enter -- ");
   
@@ -69,21 +65,11 @@ StatusCode MuonRegSelCondAlg::execute(const EventContext& ctx)  const
     return StatusCode::SUCCESS;
   }
 
-
- 
-
-  SG::ReadCondHandle<MuonMDT_CablingMap> cabling( m_cablingKey, ctx );
+  /// create the new lookup table
 
   EventIDRange id_range;
-  
-  if( !cabling.range( id_range ) ) {
-    ATH_MSG_ERROR("Failed to retrieve validity range for " << cabling.key());
-    return StatusCode::FAILURE;
-  }   
-
-  /// create the new lookuo table
 
-  std::unique_ptr<IRegSelLUT> rd = createTable( *cabling );
+  std::unique_ptr<IRegSelLUT> rd = createTable( ctx, id_range );
 
   if ( !rd ) return StatusCode::FAILURE;
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.h
index 3b67f5531661..758b4cf9de7f 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.h
@@ -11,6 +11,7 @@
 #ifndef MuonRegSelCondAlg_h
 #define MuonRegSelCondAlg_h
 
+#include "GaudiKernel/EventIDRange.h"
 #include "GaudiKernel/ISvcLocator.h"
 
 #include "AthenaBaseComps/AthReentrantAlgorithm.h"
@@ -38,24 +39,19 @@ public:
   MuonRegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
   virtual StatusCode  initialize() override;
-  virtual StatusCode  execute (const EventContext& ctx) const override;
+  virtual StatusCode  execute(const EventContext& ctx) const override;
 
-  virtual std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* cabling ) const = 0;   
+  virtual std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const = 0;   
 
  private:
 
   std::string m_managerName;
   bool        m_printTable;
  
-  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_cablingKey
-    { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
-
   /// Output conditions object
   SG::WriteCondHandleKey<IRegSelLUTCondData> m_tableKey  
     { this, "RegSelLUT", "RegSelLUTCondData", "Region Selector lookup table" };
 
-
-
 };
 
 #endif // MuonRegSelCondAlg_h
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx
index 440e412f305b..5e3797a37b40 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx
@@ -42,10 +42,17 @@ StatusCode RPC_RegSelCondAlg::initialize() {
   return StatusCode::SUCCESS;
 }
 
-std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const MuonMDT_CablingMap* /* mdtCabling */ ) const { 
+std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
 
-  SG::ReadCondHandle<RpcCablingCondData> cablingCondData{m_rpcReadKey, Gaudi::Hive::currentContext()};
-  const RpcCablingCondData* rpcCabling{*cablingCondData};
+  SG::ReadCondHandle<RpcCablingCondData> cablingCondData( m_rpcReadKey, ctx );
+
+  if( !cablingCondData.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << cablingCondData.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
+
+
+  const RpcCablingCondData* cabling{*cablingCondData};
 
   const MuonGM::MuonDetectorManager* manager = nullptr;
 
@@ -78,7 +85,7 @@ std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const MuonMDT_Cabli
     }
     
     std::vector<uint32_t> robIds;
-    if ( (rpcCabling->giveROB_fromPRD(prdHashId, robIds)).isFailure() ) { 
+    if ( (cabling->giveROB_fromPRD(prdHashId, robIds)).isFailure() ) { 
       ATH_MSG_ERROR( "RegSelCondAlg_RPC could not get ROBid" );
       return std::unique_ptr<RegSelSiLUT>(nullptr);
     }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h
index 11f8b1fcc0be..76cc137f864e 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h
@@ -28,11 +28,14 @@ public:
 
   RPC_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* mdtCabling ) const override;
+  std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const override;
 
   virtual StatusCode initialize() override;
+
 private:
-  SG::ReadCondHandleKey<RpcCablingCondData> m_rpcReadKey{this, "RpcCablingKey", "RpcCablingCondData", "Key of RpcCablingCondData"};
+
+  SG::ReadCondHandleKey<RpcCablingCondData> m_rpcReadKey
+    { this, "RpcCablingKey", "RpcCablingCondData", "Key of RpcCablingCondData" };
 
 };
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.cxx
index 634918e7a81e..1beb92246523 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.cxx
@@ -48,10 +48,23 @@ TGC_RegSelCondAlg::TGC_RegSelCondAlg(const std::string& name, ISvcLocator* pSvcL
 
 
 
+StatusCode TGC_RegSelCondAlg::initialize() {
+  ATH_CHECK(MuonRegSelCondAlg::initialize());
+  ATH_CHECK(m_mdtCablingKey.initialize());
+  return StatusCode::SUCCESS;
+}
+
+
 
+std::unique_ptr<RegSelSiLUT> TGC_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
 
+  SG::ReadCondHandle<MuonMDT_CablingMap> mdtCabling( m_mdtCablingKey, ctx );
+
+  if( !mdtCabling.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << mdtCabling.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
 
-std::unique_ptr<RegSelSiLUT> TGC_RegSelCondAlg::createTable( const MuonMDT_CablingMap* /* mdtCabling */ ) const { 
 
   /// now get the TGC cabling service ...
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.h
index aa0ce6d5bfa6..afdb30389b04 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.h
@@ -20,7 +20,12 @@ public:
 
   TGC_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* mdtCabling ) const;
+  std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const override;
+
+  virtual StatusCode initialize() override;
+
+  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_mdtCablingKey
+    { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
 
 };
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.cxx
index dcafed588279..5a93655c60df 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.cxx
@@ -50,8 +50,25 @@ sTGC_RegSelCondAlg::sTGC_RegSelCondAlg(const std::string& name, ISvcLocator* pSv
 
 
 
+StatusCode sTGC_RegSelCondAlg::initialize() {
+  ATH_CHECK(MuonRegSelCondAlg::initialize());
+  ATH_CHECK(m_mdtCablingKey.initialize());
+  return StatusCode::SUCCESS;
+}
+
+
+
+std::unique_ptr<RegSelSiLUT> sTGC_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
 
-std::unique_ptr<RegSelSiLUT> sTGC_RegSelCondAlg::createTable( const MuonMDT_CablingMap* /* mdtCabling */ ) const { 
+  /// get the MDT cabling map as a proxy for the id_range
+  
+  SG::ReadCondHandle<MuonMDT_CablingMap> mdtCabling( m_mdtCablingKey, ctx );
+ 
+  if( !mdtCabling.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << mdtCabling.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
+  
 
   /// no NSW cabling available at the moment ...
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.h
index ace1a281544f..ff6c22c2a7d7 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.h
@@ -25,8 +25,13 @@ public:
 
   sTGC_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* mdtCabling ) const;
+  std::unique_ptr<RegSelSiLUT> createTable(  const EventContext& ctx, EventIDRange& id_range ) const override;
 
+  virtual StatusCode initialize() override;
+
+  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_mdtCablingKey
+     { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
+  
 };
 
 #endif // sTGC_RegSelCondAlg_h
-- 
GitLab


From 27e17e4d476ffc5e7eb32a34277e35e4711004ba Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Fri, 18 Sep 2020 20:44:01 +0100
Subject: [PATCH 253/422] BetheHeitlerEffects 1st pass in trying to simplify
 code a bit

---
 .../GsfBetheHeitlerEffects.h                  |  34 +-
 .../src/GsfBetheHeitlerEffects.cxx            | 319 +++++++++---------
 2 files changed, 171 insertions(+), 182 deletions(-)

diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h
index 6b2c5c8d28ae..591ad3021788 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h
@@ -26,7 +26,7 @@ class GsfBetheHeitlerEffects
   , virtual public IBetheHeitlerEffects
 {
 
-private:
+public:
   /** Helper class for construction and evaluation of polynomial */
   class Polynomial
   {
@@ -76,7 +76,6 @@ private:
     double variance;
   };
 
-public:
   GsfBetheHeitlerEffects(const std::string&,
                          const std::string&,
                          const IInterface*);
@@ -86,9 +85,6 @@ public:
   /** AlgTool initialise method */
   virtual StatusCode initialize() override final;
 
-  /** AlgTool finalise method */
-  virtual StatusCode finalize() override final;
-
   virtual void compute(Trk::GSFEnergyLossCache& cache,
                        const ComponentParameters& componentParameters,
                        const MaterialProperties& materialProperties,
@@ -106,37 +102,31 @@ private:
   // Read coeffients for a single polynomial fit
   Polynomial readPolynomial(std::ifstream&, const int);
 
-  // Get mixture parameters
-  void getMixtureParameters(const double, MixtureParameters&) const;
-
-  // Get mixture parameters
-  void getMixtureParametersHighX0(const double, MixtureParameters&) const;
-
-private:
-  std::string m_parameterisationFileName;
 
-  int m_numberOfComponents;
-  int m_transformationCode;
   std::vector<Polynomial> m_polynomialWeights;
   std::vector<Polynomial> m_polynomialMeans;
   std::vector<Polynomial> m_polynomialVariances;
+  std::vector<Polynomial> m_polynomialWeightsHighX0;
+  std::vector<Polynomial> m_polynomialMeansHighX0;
+  std::vector<Polynomial> m_polynomialVariancesHighX0;
 
-  int m_correctionFlag;
-
-  std::string m_parameterisationFileNameHighX0;
 
+  int m_numberOfComponents;
+  int m_transformationCode;
+  int m_correctionFlag;
   int m_numberOfComponentsHighX0;
   int m_transformationCodeHighX0;
-  std::vector<Polynomial> m_polynomialWeightsHighX0;
-  std::vector<Polynomial> m_polynomialMeansHighX0;
-  std::vector<Polynomial> m_polynomialVariancesHighX0;
 
   double m_singleGaussianRange;
   double m_lowerRange;
   double m_xOverRange;
   double m_upperRange;
-  bool m_useHighX0;
   double m_componentMeanCut;
+  
+  bool m_useHighX0;
+  std::string m_parameterisationFileName;
+  std::string m_parameterisationFileNameHighX0;
+
 };
 
 }
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx
index 062fb266825c..9b95a0ab243f 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx
@@ -119,19 +119,61 @@ correctedFirstVariance(
   return std::max(varianceBH / mixture[0].weight, 0.);
 }
 
+Trk::GsfBetheHeitlerEffects::MixtureParameters
+getTranformedMixtureParameters(
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialWeights,
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialMeans,
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialVariances,
+  const double pathlengthInX0,
+  const int numberOfComponents)
+{
+
+  Trk::GsfBetheHeitlerEffects::MixtureParameters mixture;
+  mixture.reserve(numberOfComponents);
+  for (int i = 0; i < numberOfComponents; ++i) {
+    const double updatedWeight = polynomialWeights[i](pathlengthInX0);
+    const double updatedMean = polynomialMeans[i](pathlengthInX0);
+    const double updatedVariance = polynomialVariances[i](pathlengthInX0);
+    mixture.emplace_back(logisticFunction(updatedWeight),
+                         logisticFunction(updatedMean),
+                         exp(updatedVariance));
+  }
+  return mixture;
+}
+
+Trk::GsfBetheHeitlerEffects::MixtureParameters
+getMixtureParameters(
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialWeights,
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialMeans,
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialVariances,
+  const double pathlengthInX0,
+  const int numberOfComponents)
+{
+
+  Trk::GsfBetheHeitlerEffects::MixtureParameters mixture;
+  mixture.reserve(numberOfComponents);
+  for (int i = 0; i < numberOfComponents; ++i) {
+    const double updatedWeight = polynomialWeights[i](pathlengthInX0);
+    const double updatedMean = polynomialMeans[i](pathlengthInX0);
+    const double updatedVariance = polynomialVariances[i](pathlengthInX0);
+    mixture.emplace_back(
+      updatedWeight, updatedMean, updatedVariance * updatedVariance);
+  }
+  return mixture;
+}
 } // end of Anonymous namespace for Helper methods
 
 Trk::GsfBetheHeitlerEffects::GsfBetheHeitlerEffects(const std::string& type,
                                                     const std::string& name,
                                                     const IInterface* parent)
   : AthAlgTool(type, name, parent)
-  , m_parameterisationFileName("GeantSim_LT01_cdf_nC6_O5.par")
   , m_numberOfComponents(0)
   , m_transformationCode(0)
   , m_correctionFlag(0)
-  , m_parameterisationFileNameHighX0("GeantSim_GT01_cdf_nC6_O5.par")
   , m_numberOfComponentsHighX0(0)
   , m_transformationCodeHighX0(0)
+  , m_parameterisationFileName("GeantSim_LT01_cdf_nC6_O5.par")
+  , m_parameterisationFileNameHighX0("GeantSim_GT01_cdf_nC6_O5.par")
 {
 
   declareInterface<IBetheHeitlerEffects>(this);
@@ -152,7 +194,6 @@ Trk::GsfBetheHeitlerEffects::GsfBetheHeitlerEffects(const std::string& type,
 StatusCode
 Trk::GsfBetheHeitlerEffects::initialize()
 {
-
   if (m_correctionFlag == 1) {
     ATH_MSG_INFO("1st moment of mixture will be corrected");
   } else if (m_correctionFlag == 2) {
@@ -160,29 +201,19 @@ Trk::GsfBetheHeitlerEffects::initialize()
   } else if (m_correctionFlag == 0) {
     ATH_MSG_INFO("Moments of mixture will not be corrected");
   } else {
-    ATH_MSG_INFO("Inappropriate setting for Bethe-Heitler mixture correction! "
-                 "...Exiting!");
+    ATH_MSG_ERROR("Inappropriate setting for Bethe-Heitler mixture correction! "
+                  "...Exiting!");
     return StatusCode::FAILURE;
   }
-
   if (this->readParameters()) {
     ATH_MSG_INFO("Parameters successfully imported from file");
     ATH_MSG_INFO("Initialisation of " << name() << " was successful");
     return StatusCode::SUCCESS;
   }
-
   ATH_MSG_ERROR("Parameters could NOT be successfully imported from file");
   return StatusCode::FAILURE;
 }
 
-StatusCode
-Trk::GsfBetheHeitlerEffects::finalize()
-{
-
-  ATH_MSG_INFO("Finalisation of " << name() << " was successful");
-  return StatusCode::SUCCESS;
-}
-
 bool
 Trk::GsfBetheHeitlerEffects::readParameters()
 {
@@ -291,11 +322,8 @@ Trk::GsfBetheHeitlerEffects::readParameters()
 Trk::GsfBetheHeitlerEffects::Polynomial
 Trk::GsfBetheHeitlerEffects::readPolynomial(std::ifstream& fin, const int order)
 {
-
   std::vector<double> coefficients(order + 1);
-
   int orderIndex = 0;
-
   for (; orderIndex < (order + 1); ++orderIndex) {
     if (!fin) {
       throw std::runtime_error(
@@ -303,7 +331,6 @@ Trk::GsfBetheHeitlerEffects::readPolynomial(std::ifstream& fin, const int order)
     }
     fin >> coefficients[orderIndex];
   }
-
   return Polynomial(coefficients);
 }
 
@@ -322,166 +349,138 @@ Trk::GsfBetheHeitlerEffects::compute(
   const Trk::TrackParameters* trackParameters = componentParameters.first.get();
   const Amg::Vector3D& globalMomentum = trackParameters->momentum();
 
-  double radiationLength = materialProperties.x0();
+  const double radiationLength = materialProperties.x0();
+  const double momentum = globalMomentum.mag();
   double pathlengthInX0 = pathLength / radiationLength;
-  double momentum = globalMomentum.mag();
-
-  // Produce a multi-component State
-  if (pathlengthInX0 > m_singleGaussianRange) {
-
-    // If the amount of material is between 0.0001 and 0.01 return the gaussian
-    // approximation to the Bethe-Heitler distribution
-    if (pathlengthInX0 < m_lowerRange) {
-
-      const double meanZ = exp(-1. * pathlengthInX0);
-      const double sign = (direction == Trk::oppositeMomentum) ? 1. : -1.;
-      const double varZ = exp(-1. * pathlengthInX0 * log(3.) / log(2.)) -
-                          exp(-2. * pathlengthInX0);
-      double deltaP(0.);
-      double varQoverP(0.);
-      if (direction == Trk::alongMomentum) {
-        deltaP = sign * momentum * (1. - meanZ);
-        varQoverP = 1. / (meanZ * meanZ * momentum * momentum) * varZ;
-      } else {
-        deltaP = sign * momentum * (1. / meanZ - 1.);
-        varQoverP = varZ / (momentum * momentum);
-      }
-      cache.deltaPs.push_back(deltaP);
-      cache.weights.push_back(1.);
-      cache.deltaQOvePCov.push_back(varQoverP);
-      ATH_MSG_VERBOSE("Weight / deltaP / var (delta q/p) "
-                      << 1. << "\t" << deltaP << "\t" << varQoverP);
-      return;
-    }
 
-    if (pathlengthInX0 > m_upperRange) {
-      pathlengthInX0 = m_upperRange;
-    }
-
-    MixtureParameters mixture;
-    mixture.reserve(m_numberOfComponents);
-    if (m_useHighX0 && pathlengthInX0 > m_xOverRange) {
-      getMixtureParametersHighX0(pathlengthInX0, mixture);
-    } else {
-      getMixtureParameters(pathlengthInX0, mixture);
-    }
-    correctWeights(mixture);
-
-    if (m_correctionFlag == 1) {
-      mixture[0].mean = correctedFirstMean(pathlengthInX0, mixture);
-    }
-    if (m_correctionFlag == 2) {
-      mixture[0].mean = correctedFirstMean(pathlengthInX0, mixture);
-      mixture[0].variance = correctedFirstVariance(pathlengthInX0, mixture);
-    }
-
-    int componentIndex = 0;
-    double weightToBeRemoved(0.);
-    int componentWithHighestMean(0);
-
-    for (; componentIndex < m_numberOfComponents; ++componentIndex) {
-      if (mixture[componentIndex].mean >
-          mixture[componentWithHighestMean].mean) {
-        componentWithHighestMean = componentIndex;
-      }
-      if (mixture[componentIndex].mean >= m_componentMeanCut) {
-        continue;
-      }
-      weightToBeRemoved += mixture[componentIndex].weight;
-    }
-    componentIndex = 0;
-    for (; componentIndex < m_numberOfComponents; ++componentIndex) {
-      double varianceInverseMomentum;
-      // This is not mathematically correct but it does stabilize the GSF
-      if (mixture[componentIndex].mean < m_componentMeanCut) {
-        continue;
-      }
-      if (componentIndex == componentWithHighestMean) {
-        cache.weights.push_back(mixture[componentIndex].weight +
-                                weightToBeRemoved);
-      } else {
-        cache.weights.push_back(mixture[componentIndex].weight);
-      }
-
-      double deltaP(0.);
-      if (direction == alongMomentum) {
-        // For forward propagation
-        deltaP = momentum * (mixture[componentIndex].mean - 1.);
-        cache.deltaPs.push_back(deltaP);
-        double f = 1. / (momentum * mixture[componentIndex].mean);
-        varianceInverseMomentum = f * f * mixture[componentIndex].variance;
-      } // end forward propagation if clause
-      else {
-        // For backwards propagation
-        deltaP = momentum * (1. / mixture[componentIndex].mean - 1.);
-        cache.deltaPs.push_back(deltaP);
-        varianceInverseMomentum =
-          mixture[componentIndex].variance / (momentum * momentum);
-      } // end backwards propagation if clause
-
-      AmgSymMatrix(5) newCovarianceMatrix;
-      newCovarianceMatrix.setZero();
-      newCovarianceMatrix(Trk::qOverP, Trk::qOverP) = varianceInverseMomentum;
-      cache.deltaQOvePCov.push_back(varianceInverseMomentum);
-    } // end for loop over all components
-
-  } // end material limiting if clause
-
-  else {
+  if (pathlengthInX0 < m_singleGaussianRange) {
     ATH_MSG_DEBUG("Trying to apply energy loss to "
                   << pathlengthInX0
                   << " x/x0. No Bethe-Heitler effects applied");
     cache.weights.push_back(1.);
     cache.deltaPs.push_back(0.);
     cache.deltaQOvePCov.push_back(0.);
+    return;
   }
-}
 
-void
-Trk::GsfBetheHeitlerEffects::getMixtureParameters(
-  const double pathlengthInX0,
-  Trk::GsfBetheHeitlerEffects::MixtureParameters& mixture) const
-{
+  // If the amount of material is between 0.0001 and 0.01 return the gaussian
+  // approximation to the Bethe-Heitler distribution
+  if (pathlengthInX0 < m_lowerRange) {
+    const double meanZ = exp(-1. * pathlengthInX0);
+    const double sign = (direction == Trk::oppositeMomentum) ? 1. : -1.;
+    const double varZ =
+      exp(-1. * pathlengthInX0 * log(3.) / log(2.)) - exp(-2. * pathlengthInX0);
+    double deltaP(0.);
+    double varQoverP(0.);
+    if (direction == Trk::alongMomentum) {
+      deltaP = sign * momentum * (1. - meanZ);
+      varQoverP = 1. / (meanZ * meanZ * momentum * momentum) * varZ;
+    } else {
+      deltaP = sign * momentum * (1. / meanZ - 1.);
+      varQoverP = varZ / (momentum * momentum);
+    }
+    cache.deltaPs.push_back(deltaP);
+    cache.weights.push_back(1.);
+    cache.deltaQOvePCov.push_back(varQoverP);
+    return;
+  }
 
-  int componentIndex = 0;
-  for (; componentIndex < m_numberOfComponents; ++componentIndex) {
-    double updatedWeight = m_polynomialWeights[componentIndex](pathlengthInX0);
-    double updatedMean = m_polynomialMeans[componentIndex](pathlengthInX0);
-    double updatedVariance =
-      m_polynomialVariances[componentIndex](pathlengthInX0);
+  // Now we do the full calculation
+  if (pathlengthInX0 > m_upperRange) {
+    pathlengthInX0 = m_upperRange;
+  }
+
+  // Get proper mixture parameters
+  MixtureParameters mixture;
+  if (m_useHighX0 && pathlengthInX0 > m_xOverRange) {
+    if (m_transformationCodeHighX0) {
+      mixture = getTranformedMixtureParameters(m_polynomialWeightsHighX0,
+                                               m_polynomialMeansHighX0,
+                                               m_polynomialVariancesHighX0,
+                                               pathlengthInX0,
+                                               m_numberOfComponents);
+    } else {
+      mixture = getMixtureParameters(m_polynomialWeightsHighX0,
+                                     m_polynomialMeansHighX0,
+                                     m_polynomialVariancesHighX0,
+                                     pathlengthInX0,
+                                     m_numberOfComponents);
+    }
+  } else {
     if (m_transformationCode) {
-      updatedWeight = logisticFunction(updatedWeight);
-      updatedMean = logisticFunction(updatedMean);
-      updatedVariance = exp(updatedVariance);
+      mixture = getTranformedMixtureParameters(m_polynomialWeights,
+                                               m_polynomialMeans,
+                                               m_polynomialVariances,
+                                               pathlengthInX0,
+                                               m_numberOfComponents);
     } else {
-      updatedVariance = updatedVariance * updatedVariance;
+      mixture = getMixtureParameters(m_polynomialWeights,
+                                     m_polynomialMeans,
+                                     m_polynomialVariances,
+                                     pathlengthInX0,
+                                     m_numberOfComponents);
     }
-    mixture.emplace_back(updatedWeight, updatedMean, updatedVariance);
   }
-}
 
-void
-Trk::GsfBetheHeitlerEffects::getMixtureParametersHighX0(
-  const double pathlengthInX0,
-  Trk::GsfBetheHeitlerEffects::MixtureParameters& mixture) const
-{
+  // Correct the mixture
+  correctWeights(mixture);
+
+  if (m_correctionFlag == 1) {
+    mixture[0].mean = correctedFirstMean(pathlengthInX0, mixture);
+  }
+  if (m_correctionFlag == 2) {
+    mixture[0].mean = correctedFirstMean(pathlengthInX0, mixture);
+    mixture[0].variance = correctedFirstVariance(pathlengthInX0, mixture);
+  }
 
+  //
   int componentIndex = 0;
-  for (; componentIndex < m_numberOfComponentsHighX0; ++componentIndex) {
-    double updatedWeight =
-      m_polynomialWeightsHighX0[componentIndex](pathlengthInX0);
-    double updatedMean =
-      m_polynomialMeansHighX0[componentIndex](pathlengthInX0);
-    double updatedVariance =
-      m_polynomialVariancesHighX0[componentIndex](pathlengthInX0);
-    if (m_transformationCodeHighX0) {
-      updatedWeight = logisticFunction(updatedWeight);
-      updatedMean = logisticFunction(updatedMean);
-      updatedVariance = exp(updatedVariance);
-    } else {
-      updatedVariance = updatedVariance * updatedVariance;
+  double weightToBeRemoved(0.);
+  int componentWithHighestMean(0);
+  for (; componentIndex < m_numberOfComponents; ++componentIndex) {
+    if (mixture[componentIndex].mean > mixture[componentWithHighestMean].mean) {
+      componentWithHighestMean = componentIndex;
+    }
+    if (mixture[componentIndex].mean >= m_componentMeanCut) {
+      continue;
     }
-    mixture.emplace_back(updatedWeight, updatedMean, updatedVariance);
+    weightToBeRemoved += mixture[componentIndex].weight;
   }
+  // Fill the cache to be returned
+  componentIndex = 0;
+  for (; componentIndex < m_numberOfComponents; ++componentIndex) {
+    double varianceInverseMomentum;
+    // This is not mathematically correct but it does stabilize the GSF
+    if (mixture[componentIndex].mean < m_componentMeanCut) {
+      continue;
+    }
+    if (componentIndex == componentWithHighestMean) {
+      cache.weights.push_back(mixture[componentIndex].weight +
+                              weightToBeRemoved);
+    } else {
+      cache.weights.push_back(mixture[componentIndex].weight);
+    }
+
+    double deltaP(0.);
+    if (direction == alongMomentum) {
+      // For forward propagation
+      deltaP = momentum * (mixture[componentIndex].mean - 1.);
+      cache.deltaPs.push_back(deltaP);
+      const double f = 1. / (momentum * mixture[componentIndex].mean);
+      varianceInverseMomentum = f * f * mixture[componentIndex].variance;
+    } // end forward propagation if clause
+    else {
+      // For backwards propagation
+      deltaP = momentum * (1. / mixture[componentIndex].mean - 1.);
+      cache.deltaPs.push_back(deltaP);
+      varianceInverseMomentum =
+        mixture[componentIndex].variance / (momentum * momentum);
+    } // end backwards propagation if clause
+
+    AmgSymMatrix(5) newCovarianceMatrix;
+    newCovarianceMatrix.setZero();
+    newCovarianceMatrix(Trk::qOverP, Trk::qOverP) = varianceInverseMomentum;
+    cache.deltaQOvePCov.push_back(varianceInverseMomentum);
+  } // end for loop over all components
 }
 
-- 
GitLab


From 4c04d5195dfc582ae88160e765af318fae519985 Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Fri, 18 Sep 2020 15:13:15 -0500
Subject: [PATCH 254/422] remove atlas_depends_on_subdir()

---
 .../AsgAnalysisAlgorithms/CMakeLists.txt      | 29 +------------------
 1 file changed, 1 insertion(+), 28 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/CMakeLists.txt
index f27b528157a0..8ab33ccf6cef 100644
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/CMakeLists.txt
@@ -4,40 +4,13 @@
 
 atlas_subdir( AsgAnalysisAlgorithms )
 
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/AthContainers
-   Control/AthContainersInterfaces
-   Control/AthToolSupport/AsgTools
-   Event/xAOD/xAODBase
-   Event/xAOD/xAODCutFlow
-   Event/xAOD/xAODEventInfo
-   Event/xAOD/xAODMetaData
-   PhysicsAnalysis/Algorithms/SelectionHelpers
-   PhysicsAnalysis/Algorithms/SystematicsHandles
-   PhysicsAnalysis/AnalysisCommon/PATCore
-   PhysicsAnalysis/AnalysisCommon/PATInterfaces
-   PhysicsAnalysis/AnalysisCommon/IsolationSelection
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
-   PhysicsAnalysis/Interfaces/PMGAnalysisInterfaces
-   PRIVATE
-   Event/xAOD/xAODCore
-   Event/xAOD/xAODJet
-   Event/xAOD/xAODMuon
-   Event/xAOD/xAODTau
-   Event/xAOD/xAODEgamma
-   Event/xAOD/xAODTracking
-   Event/xAOD/xAODTruth
-   PhysicsAnalysis/D3PDTools/RootCoreUtils )
-
 atlas_add_library( AsgAnalysisAlgorithmsLib
    AsgAnalysisAlgorithms/*.h AsgAnalysisAlgorithms/*.icc Root/*.cxx
    PUBLIC_HEADERS AsgAnalysisAlgorithms
    LINK_LIBRARIES AthContainers AthContainersInterfaces AsgTools xAODBase
      xAODEventInfo SelectionHelpersLib SystematicsHandlesLib PATCoreLib
      PATInterfaces AnaAlgorithmLib AsgAnalysisInterfaces AssociationUtilsLib
-     IsolationSelectionLib
+     IsolationSelectionLib PMGAnalysisInterfacesLib
    PRIVATE_LINK_LIBRARIES xAODCore xAODCutFlow xAODMetaData xAODJet xAODMuon xAODTau xAODEgamma xAODTracking xAODTruth
      RootCoreUtils )
 
-- 
GitLab


From 747e608b916ebed8725f764440f0d6a8764746fa Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Fri, 18 Sep 2020 15:13:55 -0500
Subject: [PATCH 255/422] configuration updates

---
 .../python/ElectronAnalysisSequence.py                      | 6 ++++--
 .../python/PhotonAnalysisSequence.py                        | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/ElectronAnalysisSequence.py b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/ElectronAnalysisSequence.py
index aa66052b6429..049d0cd4bbb4 100644
--- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/ElectronAnalysisSequence.py
+++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/ElectronAnalysisSequence.py
@@ -10,6 +10,8 @@ from AnaAlgorithm.DualUseConfig import createAlgorithm, addPrivateTool
 # E/gamma import(s).
 from xAODEgamma.xAODEgammaParameters import xAOD
 
+import PATCore.ParticleDataType
+
 def makeElectronAnalysisSequence( dataType, workingPoint,
                                   deepCopyOutput = False,
                                   shallowViewOutput = True,
@@ -260,10 +262,10 @@ def makeElectronAnalysisSequence( dataType, workingPoint,
     alg.efficiencyCorrectionTool.CorrelationModel = "TOTAL"
     if dataType == 'afii':
         alg.efficiencyCorrectionTool.ForceDataType = \
-          ROOT.PATCore.ParticleDataType.Fast
+          PATCore.ParticleDataType.Fast
     elif dataType == 'mc':
         alg.efficiencyCorrectionTool.ForceDataType = \
-          ROOT.PATCore.ParticleDataType.Full
+          PATCore.ParticleDataType.Full
         pass
     alg.outOfValidity = 2 #silent
     alg.outOfValidityDeco = 'bad_eff' + postfix
diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py
index 377aaadb2b8d..9c9826c5cd9d 100644
--- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py
+++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py
@@ -10,6 +10,8 @@ from AnaAlgorithm.DualUseConfig import createAlgorithm, addPrivateTool
 # E/gamma import(s).
 from xAODEgamma.xAODEgammaParameters import xAOD
 
+import PATCore.ParticleDataType
+
 def makePhotonAnalysisSequence( dataType, workingPoint,
                                 deepCopyOutput = False,
                                 postfix = '',
@@ -167,10 +169,10 @@ def makePhotonAnalysisSequence( dataType, workingPoint,
         'PhotonEfficiencyCorrection/2015_2017/rel21.2/Winter2018_Prerec_v1/map0.txt'
     if dataType == 'afii':
         alg.efficiencyCorrectionTool.ForceDataType = \
-          ROOT.PATCore.ParticleDataType.Fast
+          PATCore.ParticleDataType.Fast
     elif dataType == 'mc':
         alg.efficiencyCorrectionTool.ForceDataType = \
-          ROOT.PATCore.ParticleDataType.Full
+          PATCore.ParticleDataType.Full
         pass
     alg.outOfValidity = 2 #silent
     alg.outOfValidityDeco = 'bad_eff' + postfix
-- 
GitLab


From 191e11238741806ca8f5b3cce5720af677aeb4e2 Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Fri, 18 Sep 2020 15:14:41 -0500
Subject: [PATCH 256/422] remove atlas_depends_on_subdirs()

---
 .../EgammaAnalysisAlgorithms/CMakeLists.txt           | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/CMakeLists.txt
index d9f908147e5f..a0366cf2cc08 100644
--- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/CMakeLists.txt
@@ -6,17 +6,6 @@
 # The name of the package:
 atlas_subdir( EgammaAnalysisAlgorithms )
 
-# The package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Event/xAOD/xAODEgamma
-   PhysicsAnalysis/Algorithms/SelectionHelpers
-   PhysicsAnalysis/Algorithms/SystematicsHandles
-   PhysicsAnalysis/AnalysisCommon/IsolationSelection
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PhysicsAnalysis/ElectronPhotonID/IsolationCorrections
-   PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces )
-
 atlas_add_library( EgammaAnalysisAlgorithmsLib
    EgammaAnalysisAlgorithms/*.h EgammaAnalysisAlgorithms/*.icc Root/*.cxx
    PUBLIC_HEADERS EgammaAnalysisAlgorithms
-- 
GitLab


From 993b5496c8c7229e8e54d72f4b3182a7fa8c19e9 Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Fri, 18 Sep 2020 15:15:08 -0500
Subject: [PATCH 257/422] remove atlas_depends_on_subdirs()

---
 .../Algorithms/FTagAnalysisAlgorithms/CMakeLists.txt      | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/CMakeLists.txt
index b2c5d14bf3d3..bab42b461ce3 100644
--- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/CMakeLists.txt
@@ -6,14 +6,6 @@
 # The name of the package:
 atlas_subdir( FTagAnalysisAlgorithms )
 
-atlas_depends_on_subdirs(
-    PUBLIC
-    Event/xAOD/xAODJet
-    PhysicsAnalysis/Algorithms/SelectionHelpers
-    PhysicsAnalysis/Algorithms/SystematicsHandles
-    PhysicsAnalysis/D3PDTools/AnaAlgorithm
-    PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces )
-
 atlas_add_library( FTagAnalysisAlgorithmsLib
    FTagAnalysisAlgorithms/*.h FTagAnalysisAlgorithms/*.icc Root/*.cxx
    PUBLIC_HEADERS FTagAnalysisAlgorithms
-- 
GitLab


From fc8f226a2ed69ea3dd7e258bd10429448158388e Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Fri, 18 Sep 2020 15:15:33 -0500
Subject: [PATCH 258/422] remove atlas_depends_on_subdirs()

---
 .../Algorithms/SelectionHelpers/CMakeLists.txt       | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/SelectionHelpers/CMakeLists.txt b/PhysicsAnalysis/Algorithms/SelectionHelpers/CMakeLists.txt
index 2b7655fb9e8c..94a83a8e72ab 100644
--- a/PhysicsAnalysis/Algorithms/SelectionHelpers/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/SelectionHelpers/CMakeLists.txt
@@ -5,18 +5,6 @@
 
 atlas_subdir( SelectionHelpers )
 
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/AthContainers
-   Control/AthToolSupport/AsgTools
-   Event/xAOD/xAODBase
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PRIVATE
-   Control/AthToolSupport/AsgTesting
-   Event/xAOD/xAODJet
-   PhysicsAnalysis/AnalysisCommon/PATCore
-   PhysicsAnalysis/AnalysisCommon/PATInterfaces )
-
 atlas_add_library( SelectionHelpersLib
    SelectionHelpers/*.h SelectionHelpers/*.icc Root/*.cxx
    PUBLIC_HEADERS SelectionHelpers
-- 
GitLab


From acc6a4cd3ce0f25012e6cbe081495ef37a882e43 Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Fri, 18 Sep 2020 15:15:54 -0500
Subject: [PATCH 259/422] remove atlas_depends_on_subdirs()

---
 .../StandaloneAnalysisAlgorithms/CMakeLists.txt        | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/CMakeLists.txt
index ff41deca6757..35c2dcf694b5 100644
--- a/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/CMakeLists.txt
@@ -8,16 +8,6 @@ if( NOT XAOD_STANDALONE )
    return()
 endif()
 
-# Set the package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/xAODRootAccess
-   PhysicsAnalysis/Algorithms/SystematicsHandles
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PRIVATE
-   Control/AthContainers
-   PhysicsAnalysis/D3PDTools/EventLoop )
-
 # External(s):
 find_package( ROOT COMPONENTS Core RIO )
 
-- 
GitLab


From 6d85d5b74d6138837db59ee50fd0b40f2e293b59 Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Fri, 18 Sep 2020 15:16:29 -0500
Subject: [PATCH 260/422] remove atlas_depends_on_subdirs()

---
 .../SystematicsHandles/CMakeLists.txt           | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/SystematicsHandles/CMakeLists.txt b/PhysicsAnalysis/Algorithms/SystematicsHandles/CMakeLists.txt
index f9a7839aeb65..d787b1012767 100644
--- a/PhysicsAnalysis/Algorithms/SystematicsHandles/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/SystematicsHandles/CMakeLists.txt
@@ -5,23 +5,6 @@
 
 atlas_subdir( SystematicsHandles )
 
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/AthContainers
-   Control/AthToolSupport/AsgTools
-   PhysicsAnalysis/AnalysisCommon/PATInterfaces
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   Event/xAOD/xAODBase
-   Event/xAOD/xAODCore
-   Event/xAOD/xAODEventInfo
-   PRIVATE
-   Control/xAODRootAccess
-   Event/xAOD/xAODJet
-   Event/xAOD/xAODMuon
-   Event/xAOD/xAODEgamma
-   Event/xAOD/xAODTau
-   PhysicsAnalysis/D3PDTools/RootCoreUtils )
-
 atlas_add_library( SystematicsHandlesLib
    SystematicsHandles/*.h SystematicsHandles/*.icc Root/*.cxx
    PUBLIC_HEADERS SystematicsHandles
-- 
GitLab


From c79a0b6ec5e34a7fbf28a2fcdd6679d552f8e55e Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Fri, 18 Sep 2020 15:17:00 -0500
Subject: [PATCH 261/422] remove atlas_depends_on_subdirs()

---
 .../Algorithms/TauAnalysisAlgorithms/CMakeLists.txt      | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/CMakeLists.txt
index 94f341d66482..f9e3e98448df 100644
--- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/CMakeLists.txt
@@ -6,15 +6,6 @@
 # The name of the package:
 atlas_subdir( TauAnalysisAlgorithms )
 
-# The package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Event/xAOD/xAODTau
-   PhysicsAnalysis/Algorithms/SelectionHelpers
-   PhysicsAnalysis/Algorithms/SystematicsHandles
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PhysicsAnalysis/TauID/TauAnalysisTools )
-
 atlas_add_library( TauAnalysisAlgorithmsLib
    TauAnalysisAlgorithms/*.h TauAnalysisAlgorithms/*.icc Root/*.cxx
    PUBLIC_HEADERS TauAnalysisAlgorithms
-- 
GitLab


From 4c0abdc8f25284d5a1bfbc7c3fc218a03c696e4d Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Fri, 18 Sep 2020 15:17:29 -0500
Subject: [PATCH 262/422] remove atlas_depends_on_subdirs()

---
 .../Algorithms/TrackingAnalysisAlgorithms/CMakeLists.txt   | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/CMakeLists.txt
index 70e73676e4d5..5866e557426a 100644
--- a/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/CMakeLists.txt
@@ -3,13 +3,6 @@
 # The name of the package:
 atlas_subdir( TrackingAnalysisAlgorithms )
 
-# The package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PRIVATE
-   Event/xAOD/xAODTracking )
-
 # Components in the package:
 atlas_add_library( TrackingAnalysisAlgorithmsLib
    TrackingAnalysisAlgorithms/*.h Root/*.cxx
-- 
GitLab


From 2a1886bbde0368376ad1f2eec6ce6a0f92250dab Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Fri, 18 Sep 2020 15:17:57 -0500
Subject: [PATCH 263/422] remove atlas_depends_on_subdirs(), enable unit tests

---
 .../TriggerAnalysisAlgorithms/CMakeLists.txt  | 31 ++++++-------------
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt
index 73816a792040..25126a762396 100644
--- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt
@@ -4,22 +4,11 @@
 
 atlas_subdir( TriggerAnalysisAlgorithms )
 
-atlas_depends_on_subdirs(
-   PUBLIC
-   Event/xAOD/xAODEventInfo
-   PhysicsAnalysis/Algorithms/SelectionHelpers
-   PhysicsAnalysis/Algorithms/SystematicsHandles
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
-   Trigger/TrigEvent/TrigDecisionInterface
-   PRIVATE
-   PhysicsAnalysis/D3PDTools/RootCoreUtils )
-
 atlas_add_library( TriggerAnalysisAlgorithmsLib
    TriggerAnalysisAlgorithms/*.h TriggerAnalysisAlgorithms/*.icc Root/*.cxx
    PUBLIC_HEADERS TriggerAnalysisAlgorithms
    LINK_LIBRARIES xAODEventInfo SelectionHelpersLib SystematicsHandlesLib
-      AnaAlgorithmLib AsgAnalysisInterfaces
+      AnaAlgorithmLib AsgAnalysisInterfaces TrigDecisionInterface
    PRIVATE_LINK_LIBRARIES RootCoreUtils )
 
 atlas_add_dictionary( TriggerAnalysisAlgorithmsDict
@@ -41,15 +30,15 @@ if( XAOD_STANDALONE )
   # FIX ME: temporarily disabled as part of the migration of AnalysisBase
   #         to master
 
-  # atlas_add_test( TriggerAlgorithmsTestJobData
-  #    SCRIPT TriggerAlgorithmsTest_eljob.py --data-type data --unit-test
-  #    PROPERTIES TIMEOUT 600 )
-  # atlas_add_test( TriggerAlgorithmsTestJobFullSim
-  #    SCRIPT TriggerAlgorithmsTest_eljob.py --data-type mc --unit-test
-  #    PROPERTIES TIMEOUT 600 )
-  # atlas_add_test( TriggerAlgorithmsTestJobFastSim
-  #    SCRIPT TriggerAlgorithmsTest_eljob.py --data-type afii --unit-test
-  #    PROPERTIES TIMEOUT 600 )
+  atlas_add_test( TriggerAlgorithmsTestJobData
+     SCRIPT TriggerAlgorithmsTest_eljob.py --data-type data --unit-test
+     PROPERTIES TIMEOUT 600 )
+  atlas_add_test( TriggerAlgorithmsTestJobFullSim
+     SCRIPT TriggerAlgorithmsTest_eljob.py --data-type mc --unit-test
+     PROPERTIES TIMEOUT 600 )
+  atlas_add_test( TriggerAlgorithmsTestJobFastSim
+     SCRIPT TriggerAlgorithmsTest_eljob.py --data-type afii --unit-test
+     PROPERTIES TIMEOUT 600 )
 else()
    atlas_add_test( TriggerAlgorithmsTestJobData
       SCRIPT athena.py
-- 
GitLab


From 3086fddbbdb762fb0028b98c1c2893218489bd15 Mon Sep 17 00:00:00 2001
From: Andrew Beddall <Andrew.Beddall@cern.ch>
Date: Fri, 18 Sep 2020 22:25:55 +0200
Subject: [PATCH 264/422] TRT RDO Reduction 2 (p3)

---
 .../InDetEventAthenaPoolCnvDict.h             |   3 +-
 .../InDetRawDataContainer_p3.h                |  33 +++
 .../InDetEventAthenaPool/selection.xml        |   1 +
 .../src/TRT_LoLumRawDataContainerCnv_p3.cxx   | 240 ++++++++++++++++++
 .../src/TRT_LoLumRawDataContainerCnv_p3.h     |  46 ++++
 .../src/TRT_RDO_ContainerCnv.cxx              |  13 +-
 .../src/TRT_RDO_ContainerCnv.h                |  12 +-
 .../src/TRT_RDO_Elements.h                    |  90 +++++++
 8 files changed, 431 insertions(+), 7 deletions(-)
 create mode 100644 InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetRawDataContainer_p3.h
 create mode 100644 InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.cxx
 create mode 100644 InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.h
 create mode 100644 InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_Elements.h

diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h
index abf7ea017fef..c906216533e9 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETEVENTATHENAPOOLDICT_H
@@ -18,6 +18,7 @@
 #include "InDetEventAthenaPool/InDetRawDataCollection_p1.h"
 #include "InDetEventAthenaPool/InDetRawDataContainer_p1.h"
 #include "InDetEventAthenaPool/InDetRawDataContainer_p2.h"
+#include "InDetEventAthenaPool/InDetRawDataContainer_p3.h"
 #include "InDetEventAthenaPool/SCT_RawDataContainer_p1.h"
 #include "InDetEventAthenaPool/SCT_RawDataContainer_p2.h"
 #include "InDetEventAthenaPool/SCT_RawDataContainer_p3.h"
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetRawDataContainer_p3.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetRawDataContainer_p3.h
new file mode 100644
index 000000000000..bd9bb5002cd6
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetRawDataContainer_p3.h
@@ -0,0 +1,33 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef INDETRAWDATACONTAINER_P3_H
+#define INDETRAWDATACONTAINER_P3_H
+
+/*
+   For the TRT, the channel Ids are dropped from the persistent container and so
+   the p2 version "std::vector<InDetRawData_p2> m_rawdata;" is replaced with
+   the p3 version "std::vector<unsigned int>    m_rawdata;".
+*/
+
+#include <vector>
+#include <string>
+#include "InDetEventAthenaPool/InDetRawDataCollection_p1.h"
+
+class InDetRawDataContainer_p3
+{
+ public:
+/// Default constructor
+  InDetRawDataContainer_p3 ();
+  friend class TRT_LoLumRawDataContainerCnv_p3;
+ private:
+  std::vector<InDetRawDataCollection_p1>  m_collections;
+  std::vector<unsigned int>               m_rawdata;
+};
+
+// inlines
+inline
+InDetRawDataContainer_p3::InDetRawDataContainer_p3 () {}
+
+#endif
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml
index 04f9a62a2feb..6ec53a8d40f7 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml
@@ -29,6 +29,7 @@
   <class name="std::vector<SCT3_RawData_p4>" />
   <class name="InDetRawDataContainer_p1" id="DA76970C-E019-43D2-B2F9-25660DCECD9D" />
   <class name="InDetRawDataContainer_p2" id="7138342E-0A80-4A32-A387-2842A01C2539" />
+  <class name="InDetRawDataContainer_p3" id="D0313948-9BC8-415F-BE58-7BA8178F93CD" />
   <class name="SCT_RawDataContainer_p1" id="8E13963E-13E5-4D10-AA8B-73F00AFF8FA8" />
   <class name="SCT_RawDataContainer_p2" id="D1258125-2CBA-476E-8578-E09D54F477E1" />
   <class name="SCT_RawDataContainer_p3" id="5FBC8D4D-7B4D-433A-8487-0EA0C870CBDB" />
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.cxx
new file mode 100644
index 000000000000..2315df926a59
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.cxx
@@ -0,0 +1,240 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+#include "InDetEventAthenaPool/InDetRawDataCollection_p1.h"
+#include "InDetRawData/TRT_RDO_Container.h"
+#include "InDetIdentifier/TRT_ID.h"
+#include "TRT_LoLumRawDataContainerCnv_p3.h"
+#include "TRT_RDO_Elements.h"
+#include "MsgUtil.h"
+
+void TRT_LoLumRawDataContainerCnv_p3::transToPers(const TRT_RDO_Container* transCont, InDetRawDataContainer_p3* persCont, MsgStream &log)
+{
+
+  // The transient model has a container holding collections (up to 14912 TRT detector elements/modules)
+  // and the collections hold channels (e.g. up to 24 straws in the TRT endcaps). There are a total of 350848 TRT straws.
+  // The persistent model flattens this so that the persistent container has two vectors: 1) all collections, 2) all RDO
+  // The persistent collections then only maintain indexes into the container's vector of all channels.
+  // So here we loop over all collection and add their channels to the container's vector, saving the indexes in the collection.
+
+  // Hard-code the number of collections their ids and their sizes to generate collections and channels for the whole detector
+  const unsigned int dummy_digit=0;
+  const unsigned int trt_number_of_collections=14912;
+  const unsigned int trt_number_of_channels=350848;
+  const unsigned int trt_channel_id_increment=0x20u;
+
+  std::vector<unsigned int> trt_collection_id;   // There are 14912 elements/modules in the TRT
+  std::vector<unsigned int> trt_collection_size; // Each element has a specific number of straws
+
+  set_vectors_of_collection_ids_and_size(trt_collection_id,
+                                         trt_collection_size,
+                                         trt_number_of_collections);
+
+  unsigned int trt_collection_index=0; // module index (0,14911), initialized first collection
+  unsigned int trt_channel_index=0;    // straw index (0,350847)
+  unsigned int trt_channel_id;         // straw id (32-bit), initialized to the first channel in the first collection
+  unsigned int tcoll_id;               // transient collection id from transCont
+  unsigned int tchan_id;               // transient channel id from transCont
+  unsigned int tchan_word;             // transient channel word from transCont
+
+  typedef TRT_RDO_Container TRANS;
+  TRANS::const_iterator it_transColl     = transCont->begin(); // The transient container has an incomplete list of collections
+  TRANS::const_iterator it_transCollEnd  = transCont->end();   // and channels, we can access them with this iterator
+
+  persCont->m_collections.resize(trt_number_of_collections);
+  persCont->m_rawdata.resize(trt_number_of_channels);
+
+  // Loop over all existing transient collections, add missing collections and missing channels
+  for (; it_transColl != it_transCollEnd; it_transColl++) {
+
+    const TRT_RDO_Collection& collection = (**it_transColl);
+    tcoll_id = collection.identify().get_identifier32().get_compact();
+
+    // create collections and channels until we find a match to a transient container
+    while ( trt_collection_id[trt_collection_index] != tcoll_id ) {
+      // The transient collection is missing; create the persistent collection with empty digits
+      trt_channel_id = trt_collection_id[trt_collection_index];
+      InDetRawDataCollection_p1& pcollection = persCont->m_collections[trt_collection_index];
+      pcollection.m_id     = 0;
+      pcollection.m_hashId = 0; // no hashId for this empty collection
+      pcollection.m_begin  = 0;
+      pcollection.m_end    = 0;
+      // Fill all the channels with with empty digits.
+      for (unsigned int i=0; i<trt_collection_size[trt_collection_index]; ++i) {
+        persCont->m_rawdata[trt_channel_index] = dummy_digit;
+        trt_channel_id += trt_channel_id_increment;
+        trt_channel_index++;
+      }
+      trt_collection_index++;
+    }
+
+    // Here we have a match to a transient collection
+    // create the persistent collection just as we did above
+    trt_channel_id = trt_collection_id[trt_collection_index];
+    InDetRawDataCollection_p1& pcollection = persCont->m_collections[trt_collection_index];
+    pcollection.m_id     = 0;
+    pcollection.m_hashId = (unsigned int) collection.identifyHash(); // Required by the overlay alogrithm (not the reco algorithms)
+    pcollection.m_begin  = 0;
+    pcollection.m_end    = 0;
+
+    const unsigned int collection_end = trt_channel_index+trt_collection_size[trt_collection_index];
+
+    // Fill all the channels; some with existing digits, the others with empty digits.
+    for (unsigned int i = 0; i < collection.size(); ++i) {
+
+      // Get the channel id and word from the digitization transient object
+      // We will use the id to determine when to insert missing straws to create a container that represents the complete detector.
+      // We will only store the digit word.
+      const TRT_LoLumRawData* tchan0 = dynamic_cast<const TRT_LoLumRawData*>(collection[i]);
+      tchan_id   = tchan0->identify().get_identifier32().get_compact(); // the i'th channel id in the transient collection
+      tchan_word = tchan0->getWord();                                   // the i'th channel word in the transient collection
+
+      while ( trt_channel_id != tchan_id) {
+        persCont->m_rawdata[trt_channel_index] = dummy_digit;
+        trt_channel_id += trt_channel_id_increment;
+        trt_channel_index++;
+      }
+
+      // Here we have a matching transient channel; write it.
+      persCont->m_rawdata[trt_channel_index]=tchan_word;
+      trt_channel_id += trt_channel_id_increment;
+      trt_channel_index++;
+
+    } // end transient channel loop
+
+    // write all other missing channels
+    while (trt_channel_index != collection_end) {
+      persCont->m_rawdata[trt_channel_index] = dummy_digit;
+      trt_channel_id += trt_channel_id_increment;
+      trt_channel_index++;
+    }
+
+    // increment to the next collection
+    trt_collection_index++;
+
+  } // end transient collection loop
+
+  // Finally, create any remaining missing collections
+    while ( trt_collection_index < trt_number_of_collections ) {
+      // The transient collection is missing; create the persistent collection with empty digits
+      trt_channel_id = trt_collection_id[trt_collection_index];
+      InDetRawDataCollection_p1& pcollection = persCont->m_collections[trt_collection_index];
+      pcollection.m_id     = 0;
+      pcollection.m_hashId = 0; // no hashId for this empty collection
+      pcollection.m_begin  = 0;
+      pcollection.m_end    = 0;
+
+      // Fill all the channels with with empty digits.
+      for (unsigned int i=0; i<trt_collection_size[trt_collection_index]; ++i) {
+        persCont->m_rawdata[trt_channel_index] = dummy_digit;
+        trt_channel_id += trt_channel_id_increment;
+        trt_channel_index++;
+      }
+      trt_collection_index++;
+    }
+
+  MSG_DEBUG(log," Prepared " << persCont->m_collections.size() << "Collections");
+  MSG_DEBUG(log," ***  Writing TRT_RDO_Container (TRT_LoLumRawData concrete type)");
+
+  trt_collection_id.clear();
+  trt_collection_size.clear();
+
+} // end of transToPers
+
+
+void  TRT_LoLumRawDataContainerCnv_p3::persToTrans(const InDetRawDataContainer_p3* persCont, TRT_RDO_Container* transCont, MsgStream &log)
+{
+
+  // The transient model has a container holding collections (up to 14912 TRT detector elements/modules)
+  // and the collections hold channels (e.g. up to 24 straws in the TRT endcaps). There are a total of 350848 TRT straws.
+  // The persistent model flattens this so that the persistent container has two vectors: 1) all collections, 2) all RDO
+  // The persistent collections then only maintain indexes into the container's vector of all channels.
+  // So here we loop over all collection and extract their channels from the vector.
+
+  // Hard-code the number of collections, their ids and their sizes to generate collections and channels for the whole detector
+  const unsigned int dummy_digit=0;
+  const unsigned int trt_number_of_collections=14912;
+  const unsigned int trt_channel_id_increment=0x20u;
+  std::vector<unsigned int> trt_collection_id;   // There are 14912 elements/modules in the TRT
+  std::vector<unsigned int> trt_collection_size; // Each element has a specific number of straws
+
+  set_vectors_of_collection_ids_and_size(trt_collection_id,
+                                         trt_collection_size,
+                                         trt_number_of_collections);
+
+  unsigned int trt_channel_id;
+  unsigned int trt_channel_index=0;
+  unsigned int trt_channel_index_old;
+  unsigned int total_number_of_channels=0;
+
+  TRT_RDO_Collection* tcoll=0;         // transient collection to be constructed
+
+  MSG_DEBUG(log," Reading " << persCont->m_collections.size() << "Collections");
+  if (persCont->m_collections.size() != trt_number_of_collections)
+    log << MSG::ERROR << "TRT_LoLumRawDataContainerCnv_p3::persToTrans expected 14912 collections but got " << persCont->m_collections.size() << ". We should be reading the whole detector!" << endmsg;
+
+  for (unsigned int trt_collection_index=0; trt_collection_index<trt_number_of_collections; ++trt_collection_index) {
+
+    // Create trans collection - in NOT owner of TRT_RDO_RawData (SG::VIEW_ELEMENTS); IDet collection don't have the Ownership policy c'tor
+
+    // count the number of non-dummy digits and skip to the next persistent collection if there are none.
+    unsigned int nchans = trt_collection_size[trt_collection_index];
+    trt_channel_index_old = trt_channel_index; // the beginning of this collection
+    unsigned int mchans = 0;
+    for (unsigned int ichan = 0; ichan < nchans; ++ichan) {
+      const unsigned int pword = persCont->m_rawdata[trt_channel_index];
+      if ( pword != dummy_digit ) mchans++;
+      trt_channel_index++;
+    }
+    if (!mchans) continue;
+
+    // This collection has "mchans" digits
+    total_number_of_channels += mchans;
+
+    // Create the transeint collection and fill with channels
+    tcoll = new TRT_RDO_Collection(IdentifierHash(trt_collection_index));
+    tcoll->setIdentifier(Identifier(trt_collection_id[trt_collection_index]));
+    tcoll->resize(mchans);
+
+    trt_channel_id = trt_collection_id[trt_collection_index]; // the id of the first channel in this collection
+    trt_channel_index = trt_channel_index_old; // go back to the beginning of this collection and process it again
+
+    unsigned int jchan=0; // counter for the non-dummy digits
+    for (unsigned int ichan = 0; ichan < nchans; ++ichan) {
+      const unsigned int pword = persCont->m_rawdata[trt_channel_index];
+      if ( pword == dummy_digit ) {
+        // advance to the next straw
+        trt_channel_id += trt_channel_id_increment;
+        trt_channel_index++;
+        continue; // don't write a dummy digit
+      }
+
+      TRT_LoLumRawData* tchan = new TRT_LoLumRawData(Identifier(trt_channel_id),pword);
+
+      (*tcoll)[jchan] = tchan;
+      jchan++;
+
+      // advance to the next straw
+      trt_channel_id += trt_channel_id_increment;
+      trt_channel_index++;
+    }
+
+    // register the rdo collection in IDC with hash - faster addCollection
+    StatusCode sc = transCont->addCollection(tcoll, IdentifierHash(trt_collection_index));
+    if (sc.isFailure()) throw std::runtime_error("Failed to add collection to ID Container");
+    MSG_VERBOSE(log,"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id / coll_id = " << trt_collection_index << " / " << trt_collection_id[trt_collection_index] << ", added to Identifiable container.");
+  }
+
+  trt_collection_id.clear();
+  trt_collection_size.clear();
+
+  MSG_DEBUG(log," ***  Reading TRT_RDO_Container (TRT_LoLumRawData concrete type)");
+
+} // end of persToTrans
+
+//================================================================
+TRT_RDO_Container* TRT_LoLumRawDataContainerCnv_p3::createTransient(const InDetRawDataContainer_p3* persObj, MsgStream& log) {
+  std::unique_ptr<TRT_RDO_Container> trans(std::make_unique<TRT_RDO_Container>(m_trtId->straw_layer_hash_max()));
+  persToTrans(persObj, trans.get(), log);
+  return(trans.release());
+}
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.h
new file mode 100644
index 000000000000..4c2cd31ab08a
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.h
@@ -0,0 +1,46 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRT_LOLUMRAWDATACONTAINERCNV_P3_H
+#define TRT_LOLUMRAWDATACONTAINERCNV_P3_H
+
+// TRT_LoLumRawDataContainerCnv_p3, T/P separation of TRT Raw data
+// author D.Costanzo <davide.costanzo@cern.ch>
+
+#include "InDetRawData/TRT_RDO_Container.h"
+#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
+#include "InDetEventAthenaPool/InDetRawDataContainer_p3.h"
+class TRT_ID;
+
+
+// We do NOT use T_AthenaPoolTPCnvIDCont because we do all of the
+// conversion in the .cxx. Same as for the LAr Raw Channels
+// Note that this is used for a container of TRT Raw Data
+// that containes only TRT_LoLumRawData concrete types
+// TRT_RDO_ContainerCnv.cxx delegates the conversion to this
+// converter if the objects are of the correct type
+
+
+class TRT_LoLumRawDataContainerCnv_p3 : public T_AthenaPoolTPCnvBase<TRT_RDO_Container, InDetRawDataContainer_p3>
+{
+private:
+  const TRT_ID *m_trtId;
+public:
+  TRT_LoLumRawDataContainerCnv_p3() : m_trtId(0) {};
+
+  virtual void persToTrans(const InDetRawDataContainer_p3* persCont,
+                           TRT_RDO_Container* transCont,
+                           MsgStream &log) ;
+  virtual void transToPers(const TRT_RDO_Container* transCont,
+                           InDetRawDataContainer_p3* persCont,
+                           MsgStream &log) ;
+  virtual TRT_RDO_Container* createTransient(const InDetRawDataContainer_p3* persObj, MsgStream& log) ;
+
+
+  // ID helper can't be used in the constructor, need initialize()
+  void initialize(const TRT_ID *idhelper) { m_trtId = idhelper; }
+
+};
+
+#endif
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx
index 3b2c9d76bfc8..22540ccb26ed 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TRT_RDO_ContainerCnv.h"
@@ -73,6 +73,7 @@ StatusCode TRT_RDO_ContainerCnv::initialize() {
    m_converter_p1.initialize(idhelper, m_storeGate);
    m_converter_TP1.initialize(idhelper);
    m_converter_TP2.initialize(idhelper);
+   m_converter_TP3.initialize(idhelper);
 
    ATH_MSG_DEBUG("Converter initialized");
 
@@ -126,9 +127,17 @@ TRT_RDO_Container* TRT_RDO_ContainerCnv::createTransient() {
   static const pool::Guid   p1_guid("CFBDB7A8-C788-4EE7-A260-3C8B680234FE"); // with TRT_RDORawData
   static const pool::Guid   TP1_guid("DA76970C-E019-43D2-B2F9-25660DCECD9D"); // for t/p separated version with InDetRawDataContainer_p1
   static const pool::Guid   TP2_guid("7138342E-0A80-4A32-A387-2842A01C2539"); // for t/p separated version with InDetRawDataContainer_p2
+  static const pool::Guid   TP3_guid("D0313948-9BC8-415F-BE58-7BA8178F93CD"); // for t/p separated version with InDetRawDataContainer_p3
   ATH_MSG_DEBUG("createTransient(): main converter");
 
-  if( compareClassGuid(TP2_guid) ) {
+  if( compareClassGuid(TP3_guid) ) {
+    ATH_MSG_DEBUG("createTransient(): New TP version - TP3 branch");
+    std::unique_ptr< InDetRawDataContainer_p3 >   col_vect( poolReadObject< InDetRawDataContainer_p3 >() );
+    TRT_RDO_Container *res = m_converter_TP3.createTransient( col_vect.get(), msg() );
+    ATH_MSG_DEBUG("createTransient(), TP3 branch: returns TRANS = "<<shortPrint(res));
+    return res;
+  }
+  else if( compareClassGuid(TP2_guid) ) {
     ATH_MSG_DEBUG("createTransient(): New TP version - TP2 branch");
     std::unique_ptr< InDetRawDataContainer_p2 >   col_vect( poolReadObject< InDetRawDataContainer_p2 >() );
     TRT_RDO_Container *res = m_converter_TP2.createTransient( col_vect.get(), msg() );
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h
index ef4b23321d69..e8b39c0770d1 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRT_RDO_CONTAINERCNV_H
@@ -17,11 +17,14 @@
 #include "TRT_RDO_ContainerCnv_p1.h"
 #include "TRT_LoLumRawDataContainerCnv_p1.h"
 #include "TRT_LoLumRawDataContainerCnv_p2.h"
+#include "TRT_LoLumRawDataContainerCnv_p3.h"
 
 
 // the latest persistent representation type of DataCollection:
-typedef  InDetRawDataContainer_p2         TRT_RDO_Container_PERS;
-typedef  TRT_LoLumRawDataContainerCnv_p2  TRT_RDO_ContainerCnv_PERS;
+//typedef  InDetRawDataContainer_p2         TRT_RDO_Container_PERS;
+//typedef  TRT_LoLumRawDataContainerCnv_p2  TRT_RDO_ContainerCnv_PERS;
+typedef  InDetRawDataContainer_p3         TRT_RDO_Container_PERS;
+typedef  TRT_LoLumRawDataContainerCnv_p3  TRT_RDO_ContainerCnv_PERS;
 
 typedef  T_AthenaPoolCustomCnv<TRT_RDO_Container, TRT_RDO_Container_PERS >   TRT_RDO_ContainerCnvBase;
 
@@ -30,10 +33,11 @@ class TRT_RDO_ContainerCnv : public TRT_RDO_ContainerCnvBase {
 
   // Converters need to be initialized (use ID helpers)
   // Thus they can't be local
-  TRT_RDO_ContainerCnv_p1   m_converter_p1;
+  TRT_RDO_ContainerCnv_p1           m_converter_p1;
   TRT_RDO_ContainerCnv_p0           m_converter_p0;
   TRT_LoLumRawDataContainerCnv_p1   m_converter_TP1;
   TRT_LoLumRawDataContainerCnv_p2   m_converter_TP2;
+  TRT_LoLumRawDataContainerCnv_p3   m_converter_TP3;
   TRT_RDO_ContainerCnv_PERS         m_converter_PERS;
 
   // Should not be needed at some point.
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_Elements.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_Elements.h
new file mode 100644
index 000000000000..3fe1b15fd51a
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_Elements.h
@@ -0,0 +1,90 @@
+void set_vectors_of_collection_ids_and_size(std::vector<unsigned int> &element, std::vector<unsigned int> &nstraws, const unsigned int number_of_elements) {
+
+  // The transient model has a container holding collections (TRT detector elements/modules)
+  // and the collections hold channels (e.g. up to 24 straws in the TRT endcaps).
+  // Here we construct, for the whole detector, the ids of the collections (14912 TRT detector elements/modules)
+  // and the number of channels (straws) in each collection according to the numbering scheme in the TRT RDO container.
+  // A total 350848 straw ids can be defined using these two vectors since the id of each straw simply follows from the
+  // previous id starting from the id of the collection that contains it.
+
+  /*
+    5120 endcap elements : 32(6*(15*1,17),7*(7*1,25),7*1,601)
+    4672 barrel elements : 64(18*1,14,23*1,9,29*1,931)
+    5120 endcap elements : 32(6*(15*1,17),7*(7*1,25),7*1,601)
+    ----
+   14912  << number_of_elements
+    ----
+  */
+
+  element.resize(number_of_elements);
+  nstraws.resize(number_of_elements,24); // all endcap modules have 24 straws. The barrels will need a more detailed assignment.
+
+  const unsigned int first_straw = 0x10000000u;
+  unsigned int i,j,k,n;
+  unsigned int c=0;
+
+  n=0;
+  element[n++]=0;
+  for (i=0; i<32; i++) {
+    for (j=0; j<6; j++) { for (k=0; k<15; k++) { c++; element[n++]=c; }; c=c+17; element[n++]=c; }
+    for (j=0; j<7; j++) { for (k=0; k< 7; k++) { c++; element[n++]=c; }; c=c+25; element[n++]=c; }
+    for (j=0; j<7; j++) { c++; element[n++]=c; }; c=c+601; element[n++]=c;
+  }
+  for (i=0; i<64; i++) {
+    for (k=0; k<18; k++) { c++; element[n++]=c; }; c=c+14;  element[n++]=c;
+    for (k=0; k<23; k++) { c++; element[n++]=c; }; c=c+9;   element[n++]=c;
+    for (k=0; k<29; k++) { c++; element[n++]=c; }; c=c+931; element[n++]=c;
+  }
+  for (i=0; i<32; i++) {
+    for (j=0; j<6; j++) { for (k=0; k<15; k++) { c++; element[n++]=c; }; c=c+17; element[n++]=c; }
+    for (j=0; j<7; j++) { for (k=0; k< 7; k++) { c++; element[n++]=c; }; c=c+25; element[n++]=c; }
+    for (j=0; j<7; j++) { c++; element[n++]=c; }; c=c+601; if (n<number_of_elements) element[n++]=c;
+  } // the very last item in the pattern is dropped.
+
+  // Finally convert from 22 bit to 32 bit form.
+  for (i=0; i<number_of_elements; i++) element[i] = (element[i]<<10)+first_straw;
+
+  /*
+    5120 endcap elements : 24
+    4672 barrel elements : 64(15,4*16,5*17,5*18,3*19,18,19,5*20,5*21,5*22,5*23,2*24,2*23,4*24,5*25,5*26,5*27,5*28,4*29,28)
+    5120 endcap elements : 24
+  */
+  n=5120;
+  for (i=0; i<64; i++) {
+    nstraws[n++]=15;
+    for (j=0; j<4; j++) nstraws[n++]=16;
+    for (j=0; j<5; j++) nstraws[n++]=17;
+    for (j=0; j<5; j++) nstraws[n++]=18;
+    for (j=0; j<3; j++) nstraws[n++]=19;
+    nstraws[n++]=18; nstraws[n++]=19;
+    for (j=0; j<5; j++) nstraws[n++]=20;
+    for (j=0; j<5; j++) nstraws[n++]=21;
+    for (j=0; j<5; j++) nstraws[n++]=22;
+    for (j=0; j<5; j++) nstraws[n++]=23;
+    for (j=0; j<2; j++) nstraws[n++]=24;
+    for (j=0; j<2; j++) nstraws[n++]=23;
+    for (j=0; j<4; j++) nstraws[n++]=24;
+    for (j=0; j<5; j++) nstraws[n++]=25;
+    for (j=0; j<5; j++) nstraws[n++]=26;
+    for (j=0; j<5; j++) nstraws[n++]=27;
+    for (j=0; j<5; j++) nstraws[n++]=28;
+    for (j=0; j<4; j++) nstraws[n++]=29;
+    nstraws[n++]=28;
+  }
+
+/*
+  // DEBUG dump out all straw ids (32-bit representation; no information is lost)
+  unsigned int trt_strawid[350848];
+  unsigned int istraw=0;
+  for (unsigned int i=0; i<trt_number_of_collections; i++) {
+    trt_strawid[istraw++] = trt_collection_id[i];
+    for (unsigned int j=1; j<trt_collection_size[i]; j++) {
+      trt_strawid[istraw]=trt_strawid[istraw-1]+0x20u;
+      istraw++;
+    }
+  }
+  std::cout << "AJB DUMP number of straws is " << istraw << std::endl;
+  for (unsigned int k=0; k<350848; k++) std::cout << "AJB DUMP " << std::hex << trt_strawid[k] << std::endl;
+*/
+
+}
-- 
GitLab


From 0966652baf535780015bc3a89babd189d0aee364 Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <attila.krasznahorkay@cern.ch>
Date: Fri, 18 Sep 2020 20:51:33 +0000
Subject: [PATCH 265/422] (AnalysisBase) LCG_98python3 Update

---
 AtlasTest/GoogleTestTools/CMakeLists.txt      |  10 +-
 .../share/GoogleTestToolsTests.ref            |  13 +-
 .../test/gt_AnaToolHandle_test.cxx            |   6 +-
 .../IMyPackageTool.h                          |   0
 .../{src => AthAsgExUnittest}/MyPackageTool.h |  14 +-
 .../AthAsgExUnittest/CMakeLists.txt           |  27 +--
 .../AthAsgExUnittest/Root/MyPackageTool.cxx   |   7 +-
 .../AthAsgExUnittest/src/MyPackageAlg.h       |  14 +-
 .../components/AthAsgExUnittest_entries.cxx   |   9 +-
 .../test/gt_AthAsgExUnittest.cxx              |  43 ++---
 .../test/gt_AthExUnittest.cxx                 |  16 +-
 Control/AthenaPython/CMakeLists.txt           |  25 +--
 Control/AthenaServices/CMakeLists.txt         |  18 +-
 .../PerfMonComps/CMakeLists.txt               |   5 +-
 Control/RootUtils/CMakeLists.txt              |   1 +
 Control/StoreGateBindings/CMakeLists.txt      |  18 +-
 Control/xAODRootAccess/Root/TPyEvent.cxx      |   9 +-
 Control/xAODRootAccess/Root/TPyStore.cxx      |  11 +-
 .../test/ut_xaodrootaccess_tpyevent_test.py   |   7 +-
 .../test/ut_xaodrootaccess_transtree2_test.py |   4 +-
 .../xAODRootAccess/xAODRootAccess/TEvent.h    |   2 +-
 .../xAODRootAccess/xAODRootAccess/TPyEvent.h  |   4 +-
 .../xAODRootAccess/xAODRootAccess/TPyStore.h  |   4 +-
 .../xAODRootAccess/xAODRootAccess/TStore.h    |   5 +
 Database/IOVDbDataModel/CMakeLists.txt        |  12 +-
 .../test/ut_xaodtruth_helpers_test.py         |   8 +-
 .../share/HepMcParticleLink_test.ref          |  16 +-
 .../test/ut_InDetTrackSelectionTool.cxx       |  24 +--
 .../share/EventAlgorithmsTest_eljob.py        |   9 +-
 .../share/EventAlgorithmsTest_jobOptions.py   |   4 +-
 .../share/GeneratorAlgorithmsTest_eljob.py    |   4 +-
 .../GeneratorAlgorithmsTest_jobOptions.py     |   4 +-
 .../share/OverlapAlgorithmsTest_eljob.py      |   4 +-
 .../share/OverlapAlgorithmsTest_jobOptions.py |   6 +-
 .../share/MuonAnalysisAlgorithmsTest_eljob.py |   7 +-
 .../share/TauAnalysisAlgorithmsTest_eljob.py  |  13 +-
 .../test/ut_assocUtilsDict.py                 |  14 +-
 .../AnaAlgorithm/AnaAlgorithmConfig.h         |   9 +
 .../AnaAlgorithm/python/AlgSequence.py        |  10 +-
 .../AnaAlgorithm/python/AnaAlgSequence.py     |  18 +-
 .../AnaAlgorithm/python/AnaAlgorithmConfig.py |  16 +-
 .../D3PDTools/EventLoop/Root/Worker.cxx       |  15 +-
 .../EventLoopTest/Root/UnitTestAlg.cxx        |   5 +-
 .../EventLoopTest/Root/UnitTestAlg1.cxx       |   5 +-
 .../EventLoopTest/Root/UnitTestAlg2.cxx       |   5 +-
 .../EventLoopTest/test/gt_DirectDriver.cxx    |   6 +-
 .../EventLoopTest/test/gt_LSFDriver_EOS.cxx   |   6 +-
 .../EventLoopTest/test/gt_LeakChecks.cxx      |  18 +-
 .../EventLoopTest/test/gt_LocalDriver.cxx     |   6 +-
 .../D3PDTools/SampleHandler/CMakeLists.txt    |   7 +-
 .../util/EgEfficiencyCorr_testFixedInput.py   |  12 +-
 ...AnalysisBaseReleaseEnvironmentConfig.cmake |  11 +-
 Projects/AnalysisBase/externals.txt           |   2 +-
 Projects/AnalysisBase/version.txt             |   2 +-
 Projects/AthDataQuality/CMakeLists.txt        |   4 +-
 Projects/AthDataQuality/build_externals.sh    |   3 +-
 Projects/AthDataQuality/externals.txt         |   2 +-
 Projects/AthDataQuality/version.txt           |   2 +-
 Projects/AthGeneration/externals.txt          |   2 +-
 Projects/AthGeneration/version.txt            |   2 +-
 Projects/AthSimulation/externals.txt          |   2 +-
 Projects/AthSimulation/version.txt            |   2 +-
 Projects/Athena/externals.txt                 |   2 +-
 Projects/VP1Light/externals.txt               |   2 +-
 Projects/VP1Light/version.txt                 |   2 +-
 .../Jet/JetRec/share/ExtractorUnitTests.ref   |   6 +-
 Reconstruction/Jet/JetRec/share/TestTests.ref |   4 +-
 .../test/ut_egammaLayerRecalibrationTool.py   |  90 +++++-----
 .../BeamEffects/share/BeamEffectsAlg_test.ref |  21 ++-
 .../TrkVertexSeedFinderUtils/CMakeLists.txt   | 159 ++++++++----------
 .../TrkVertexSeedFinderUtils/VertexImage.h    |  18 +-
 .../VertexImageMaker.h                        |  20 +--
 .../src/VertexImage.cxx                       |  43 +++--
 .../src/VertexImageMaker.cxx                  |  70 ++++----
 .../test/GaussianTrackDensity_test.cxx        |   5 +-
 .../test/Mode3dFromFsmw1dFinder_test.cxx      |   6 +-
 .../test/Mode3dTo1dFinder_test.cxx            |   6 +-
 .../test/NewtonTrkDistanceFinder_test.cxx     |   6 +-
 .../test/SimpleVertexClusterFinder_test.cxx   |   8 +-
 .../test/Trk2dDistanceSeeder_test.cxx         |   7 +-
 .../TrigNavStructure/TrigHolderStructure.h    |  25 +--
 81 files changed, 526 insertions(+), 543 deletions(-)
 rename Control/AthenaExamples/AthAsgExUnittest/{src => AthAsgExUnittest}/IMyPackageTool.h (100%)
 rename Control/AthenaExamples/AthAsgExUnittest/{src => AthAsgExUnittest}/MyPackageTool.h (86%)

diff --git a/AtlasTest/GoogleTestTools/CMakeLists.txt b/AtlasTest/GoogleTestTools/CMakeLists.txt
index 33da7bfd397f..f0d291151800 100644
--- a/AtlasTest/GoogleTestTools/CMakeLists.txt
+++ b/AtlasTest/GoogleTestTools/CMakeLists.txt
@@ -4,7 +4,7 @@
 atlas_subdir( GoogleTestTools )
 
 # External package dependencies:
-find_package( GMock )
+find_package( GTest )
 
 # In standalone mode we just use the headers from the package. While in
 # offline mode we build a proper library.
@@ -17,13 +17,11 @@ else()
   atlas_add_library( GoogleTestTools
     GoogleTestTools/*.h src/*.cxx
     PUBLIC_HEADERS GoogleTestTools
-    INCLUDE_DIRS ${GMOCK_INCLUDE_DIRS}
-    LINK_LIBRARIES ${GMOCK_LIBRARIES}
-    PRIVATE_LINK_LIBRARIES GaudiKernel )
+    INCLUDE_DIRS ${GTEST_INCLUDE_DIRS}
+    LINK_LIBRARIES ${GTEST_LIBRARIES} GaudiKernel )
 endif()
 
 # Unit tests for InitGaudiGoogleTest:
 atlas_add_test( GoogleTestToolsTests
   SOURCES test/gt_GoogleTestTools.cxx
-  INCLUDE_DIRS ${GMOCK_INCLUDE_DIRS} 
-  LINK_LIBRARIES ${GMOCK_LIBRARIES} GaudiKernel GoogleTestTools )
+  LINK_LIBRARIES GoogleTestTools )
diff --git a/AtlasTest/GoogleTestTools/share/GoogleTestToolsTests.ref b/AtlasTest/GoogleTestTools/share/GoogleTestToolsTests.ref
index 1a12a640a5ec..778320606134 100644
--- a/AtlasTest/GoogleTestTools/share/GoogleTestToolsTests.ref
+++ b/AtlasTest/GoogleTestTools/share/GoogleTestToolsTests.ref
@@ -1,22 +1,21 @@
-[==========] Running 1 test from 1 test case.
+[==========] Running 1 test from 1 test suite.
 [----------] Global test environment set-up.
 [----------] 1 test from InitGaudiGoogleTestTest
 [ RUN      ] InitGaudiGoogleTestTest.basictest
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
-                                          running on karma on Wed Jul  4 10:48:30 2018
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on 36d5a1e47246 on Sat Sep 12 19:51:31 2020
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
-HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 EventLoopMgr         INFO Histograms converted successfully according to request.
 ToolSvc              INFO Removing all tools created by ToolSvc
 ApplicationMgr       INFO Application Manager Finalized successfully
 ApplicationMgr       INFO Application Manager Terminated successfully
-[       OK ] InitGaudiGoogleTestTest.basictest (44 ms)
-[----------] 1 test from InitGaudiGoogleTestTest (44 ms total)
+[       OK ] InitGaudiGoogleTestTest.basictest (382 ms)
+[----------] 1 test from InitGaudiGoogleTestTest (382 ms total)
 
 [----------] Global test environment tear-down
-[==========] 1 test from 1 test case ran. (44 ms total)
+[==========] 1 test from 1 test suite ran. (382 ms total)
 [  PASSED  ] 1 test.
diff --git a/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx b/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx
index d540cef446b3..17fcdc4782df 100644
--- a/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx
+++ b/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx
@@ -1006,7 +1006,7 @@ namespace asg
     {
       ASSERT_SUCCESS (th3.setProperty ("usePublic", true));
     }
-    
+
     ASSERT_SUCCESS (th3.initialize ());
     if (value == -1)
     {
@@ -1018,7 +1018,7 @@ namespace asg
     }
   }
 
-  INSTANTIATE_TEST_CASE_P
+  INSTANTIATE_TEST_SUITE_P
   (MySubtoolTest1, SubtoolTest, ::testing::Values
    (std::make_tuple ("regPublicHandle",  "public",  "ATH"),
     std::make_tuple ("anaPublicHandle",  "public",  "ATH"),
@@ -1037,7 +1037,7 @@ namespace asg
     std::make_tuple ("regPrivateHandle", "private", "empty"),
     std::make_tuple ("anaPrivateHandle", "private", "empty"),
     std::make_tuple ("regPrivateHandle", "private", "none"),
-    std::make_tuple ("anaPrivateHandle", "private", "none")),);
+    std::make_tuple ("anaPrivateHandle", "private", "none")));
 }
 
 ATLAS_GOOGLE_TEST_MAIN
diff --git a/Control/AthenaExamples/AthAsgExUnittest/src/IMyPackageTool.h b/Control/AthenaExamples/AthAsgExUnittest/AthAsgExUnittest/IMyPackageTool.h
similarity index 100%
rename from Control/AthenaExamples/AthAsgExUnittest/src/IMyPackageTool.h
rename to Control/AthenaExamples/AthAsgExUnittest/AthAsgExUnittest/IMyPackageTool.h
diff --git a/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageTool.h b/Control/AthenaExamples/AthAsgExUnittest/AthAsgExUnittest/MyPackageTool.h
similarity index 86%
rename from Control/AthenaExamples/AthAsgExUnittest/src/MyPackageTool.h
rename to Control/AthenaExamples/AthAsgExUnittest/AthAsgExUnittest/MyPackageTool.h
index ebc1bef9cbf1..7cb9a2c8b5b4 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageTool.h
+++ b/Control/AthenaExamples/AthAsgExUnittest/AthAsgExUnittest/MyPackageTool.h
@@ -6,26 +6,26 @@
 #define ATHASGEXUNITTEST_MYPACKAGETOOL_H 1
 
 #include "AsgTools/AsgTool.h"
-#include "IMyPackageTool.h"
+#include "AthAsgExUnittest/IMyPackageTool.h"
 
-class MyPackageTool: public asg::AsgTool, public virtual IMyPackageTool { 
-public: 
+class MyPackageTool: public asg::AsgTool, public virtual IMyPackageTool {
+public:
 
   ASG_TOOL_CLASS( MyPackageTool, IMyPackageTool )
   // Add another constructor for non-athena use cases
   MyPackageTool( const std::string& name );
-  
+
   // Initialize is required by AsgTool base class
   virtual StatusCode initialize() override;
 
   // This tools method
   virtual double useTheProperty() override;
 
-private: 
+private:
 
   double m_nProperty;
-  unsigned int m_enumProperty; 
+  unsigned int m_enumProperty;
 
-}; 
+};
 
 #endif //> !ATHASGEXUNITTEST_MYPACKAGETOOL_H
diff --git a/Control/AthenaExamples/AthAsgExUnittest/CMakeLists.txt b/Control/AthenaExamples/AthAsgExUnittest/CMakeLists.txt
index 238619534964..9a01371f64cf 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/CMakeLists.txt
+++ b/Control/AthenaExamples/AthAsgExUnittest/CMakeLists.txt
@@ -3,30 +3,37 @@
 # Declare the package name:
 atlas_subdir( AthAsgExUnittest )
 
+# Necessary external(s).
+find_package( GTest )
+find_package( GMock )
+
 # Libraries in the package:
 atlas_add_library( AthAsgExUnittestLib
-                   MyPackage/*.h src/*.cxx
-                   Root/*.cxx
-                   NO_PUBLIC_HEADERS
-                   LINK_LIBRARIES GaudiKernel AsgTools AthAnalysisBaseCompsLib )
+   AthAsgExUnittest/*.h Root/*.cxx
+   PUBLIC_HEADERS AthAsgExUnittest
+   LINK_LIBRARIES AsgTools )
 
 atlas_add_component( AthAsgExUnittest
-                     src/components/*.cxx
-                     LINK_LIBRARIES AthAsgExUnittestLib )
+   src/*.h src/*.cxx src/components/*.cxx
+   LINK_LIBRARIES AthAnalysisBaseCompsLib AsgTools AthAsgExUnittestLib )
 
 # Add tests:
 atlas_add_test( gt_AthAsgExUnittest
   SOURCES test/gt_AthAsgExUnittest.cxx
-  LINK_LIBRARIES GaudiKernel GoogleTestTools AthAsgExUnittestLib )
+  LINK_LIBRARIES GaudiKernel GoogleTestTools AsgTools AthAnalysisBaseCompsLib
+  AthAsgExUnittestLib )
 
 atlas_add_test( gt_AthExUnittest
   SOURCES test/gt_AthExUnittest.cxx
-  LINK_LIBRARIES GaudiKernel GoogleTestTools AthenaBaseComps AsgTools )
+  LINK_LIBRARIES GaudiKernel GoogleTestTools AthenaBaseComps
+  AthAsgExUnittestLib )
 
 atlas_add_test( gt_MockxAODJet
   SOURCES test/gt_MockxAODJet.cxx
-  LINK_LIBRARIES xAODJet GoogleTestTools )
+  INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS}
+  LINK_LIBRARIES ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} xAODJet )
 
 atlas_add_test( gt_xAODJet
   SOURCES test/gt_xAODJet.cxx
-  LINK_LIBRARIES xAODJet GoogleTestTools )
+  INCLUDE_DIRS ${GTEST_INCLUDE_DIRS}
+  LINK_LIBRARIES ${GTEST_LIBRARIES} xAODJet )
diff --git a/Control/AthenaExamples/AthAsgExUnittest/Root/MyPackageTool.cxx b/Control/AthenaExamples/AthAsgExUnittest/Root/MyPackageTool.cxx
index 0350e0f3b4c1..a2412ea53aa9 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/Root/MyPackageTool.cxx
+++ b/Control/AthenaExamples/AthAsgExUnittest/Root/MyPackageTool.cxx
@@ -4,13 +4,13 @@
 //
 
 // MyPackage includes
-#include "../src/MyPackageTool.h"
+#include "AthAsgExUnittest/MyPackageTool.h"
 
 MyPackageTool::MyPackageTool( const std::string& name ) : asg::AsgTool( name ) {
   //example property declarations with default values
-  declareProperty( "Property", m_nProperty = 3.0, 
+  declareProperty( "Property", m_nProperty = 3.0,
                    "Please describe the property here" );
-  declareProperty( "ENumProperty", m_enumProperty = Val1, 
+  declareProperty( "ENumProperty", m_enumProperty = Val1,
                    "Please define enums inside your classes, not just in namespaces" );
 }
 
@@ -27,4 +27,3 @@ StatusCode MyPackageTool::initialize() {
 double MyPackageTool::useTheProperty() {
   return m_nProperty;
 }
-
diff --git a/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageAlg.h b/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageAlg.h
index e8a9607eb7ed..083cd15d3266 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageAlg.h
+++ b/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageAlg.h
@@ -1,6 +1,6 @@
 // -*- mode: c++ -*-
 //
-//  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+//  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 //
 
 #ifndef ATHASGEXUNITTEST_MYPACKAGEALG_H
@@ -12,24 +12,24 @@
 #include "AsgTools/AnaToolHandle.h" //use asg::AnaToolHandle instead of regular ToolHandles for full dual-use experience!
 #endif
 
-#include "IMyPackageTool.h"
+#include "AthAsgExUnittest/IMyPackageTool.h"
 
 
-class MyPackageAlg: public ::AthAnalysisAlgorithm { 
-public: 
+class MyPackageAlg: public ::AthAnalysisAlgorithm {
+public:
 
   MyPackageAlg( const std::string& name, ISvcLocator* pSvcLocator );
-  virtual ~MyPackageAlg(); 
+  virtual ~MyPackageAlg();
 
   virtual StatusCode initialize() override;
   virtual StatusCode execute() override;
   virtual StatusCode finalize() override;
 
-private: 
+private:
 
   int m_property;
   ToolHandle<IMyPackageTool> m_tool;
 
-}; 
+};
 
 #endif //> !ATHASGEXUNITTEST_MYPACKAGEALG_H
diff --git a/Control/AthenaExamples/AthAsgExUnittest/src/components/AthAsgExUnittest_entries.cxx b/Control/AthenaExamples/AthAsgExUnittest/src/components/AthAsgExUnittest_entries.cxx
index ef5eb1e88d28..c0eca92882a1 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/src/components/AthAsgExUnittest_entries.cxx
+++ b/Control/AthenaExamples/AthAsgExUnittest/src/components/AthAsgExUnittest_entries.cxx
@@ -1,8 +1,9 @@
+//
+// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+//
+
+#include "AthAsgExUnittest/MyPackageTool.h"
 #include "../MyPackageAlg.h"
 
 DECLARE_COMPONENT( MyPackageAlg )
-
-
-#include "../MyPackageTool.h"
 DECLARE_COMPONENT( MyPackageTool )
-
diff --git a/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthAsgExUnittest.cxx b/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthAsgExUnittest.cxx
index d0de4e2dff09..1f095366e2ae 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthAsgExUnittest.cxx
+++ b/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthAsgExUnittest.cxx
@@ -12,10 +12,11 @@
 #include "AsgTools/AnaToolHandle.h"
 #include "AthAnalysisBaseComps/AthAnalysisHelper.h"
 
-#include "../src/IMyPackageTool.h"
+#include "AthAsgExUnittest/IMyPackageTool.h"
+#include "AthAsgExUnittest/MyPackageTool.h"
 
-#include "../src/MyPackageTool.h"
-#include "../src/MyPackageAlg.h"
+#include "GaudiKernel/IAlgManager.h"
+#include "Gaudi/Algorithm.h"
 
 #include <iostream>
 #include <fstream>
@@ -44,25 +45,19 @@ namespace Athena_test {
     EXPECT_TRUE( myTool.getProperty( "Property", prop ).isSuccess() );
     EXPECT_EQ( std::stod( prop ), 42.0 );
   }
-  
+
   TEST_F( MyPackageToolTest, enumProperty ) {
     EXPECT_TRUE( myTool.setProperty( "EnumProperty", IMyPackageTool::Val2 ).isSuccess() );
     EXPECT_TRUE( myTool.initialize().isSuccess() );
     std::string prop;
     EXPECT_TRUE( myTool.getProperty( "EnumProperty", prop ).isSuccess() );
-    EXPECT_EQ( std::stoi( prop ), IMyPackageTool::Val2 ); 
+    EXPECT_EQ( std::stoi( prop ), IMyPackageTool::Val2 );
   }
-  
+
   // Algorithm test suite:
 
   class MyPackageAlgTest : public InitGaudiGoogleTest {
   public:
-
-    MyPackageAlgTest() 
-    //  : InitGaudiGoogleTest( MSG::INFO ) // get usual message blurb
-      : myAlg(nullptr)
-    {}
-
     virtual void SetUp() override {
       // Algorithm and Tool properties via service:
       // see: Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
@@ -76,8 +71,15 @@ namespace Athena_test {
       EXPECT_TRUE( AthAnalysisHelper::addPropertyToCatalogue( "MyPackageAlg.AnotherName",
                                                               "Property",
                                                               42.0 ).isSuccess() );
-      // Create instance of my algorithm directly in dual_use package
-      myAlg= new MyPackageAlg( "MyPackageAlg", Gaudi::svcLocator() );
+      // Create instance of my algorithm through Gaudi.
+      IAlgManager* algMgr = svcMgr.as< IAlgManager >();
+      EXPECT_TRUE( algMgr != nullptr );
+      IAlgorithm* alg = nullptr;
+      EXPECT_TRUE( algMgr->createAlgorithm( "MyPackageAlg", "MyPackageAlg",
+                                            alg ).isSuccess() );
+      EXPECT_TRUE( alg != nullptr );
+      myAlg = dynamic_cast< Algorithm* >( alg );
+      EXPECT_TRUE( myAlg != nullptr );
     }
 
     MyPackageTool* getMyTool() {
@@ -89,14 +91,14 @@ namespace Athena_test {
       return mpt;
     }
 
-    MyPackageAlg* myAlg;
+    Algorithm* myAlg = nullptr;
 
   };
-  
+
   TEST_F( MyPackageAlgTest, initialise ) {
     EXPECT_TRUE( myAlg->initialize().isSuccess() );
   }
-  
+
   TEST_F( MyPackageAlgTest, setProperty ) {
     EXPECT_TRUE( myAlg->setProperty( "MyProperty", 5 ).isSuccess() );
     EXPECT_TRUE( myAlg->initialize().isSuccess() );
@@ -104,14 +106,14 @@ namespace Athena_test {
     EXPECT_TRUE( myAlg->getProperty( "MyProperty", prop ).isSuccess() );
     EXPECT_EQ( prop, "5" );
   }
-  
+
   TEST_F( MyPackageAlgTest, sysInitialize ) {
     EXPECT_TRUE( myAlg->sysInitialize().isSuccess() );
     std::string prop;
     EXPECT_TRUE( myAlg->getProperty( "MyProperty", prop ).isSuccess() );
     EXPECT_EQ( std::stoi( prop ), 21 );
   }
-  
+
   TEST_F( MyPackageAlgTest, toolProperty ) {
     // sysInitialize() gets properties then call initialize()
     EXPECT_TRUE( myAlg->sysInitialize().isSuccess() );
@@ -120,11 +122,10 @@ namespace Athena_test {
     EXPECT_TRUE( mpt->getProperty( "Property", prop ).isSuccess() );
     EXPECT_EQ( std::stod( prop ), 42.0 );
   }
-  
+
 }
 
 int main( int argc, char **argv ) {
   ::testing::InitGoogleTest( &argc, argv );
   return RUN_ALL_TESTS();
 }
-
diff --git a/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthExUnittest.cxx b/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthExUnittest.cxx
index 8772ce7043c2..6ef392c53035 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthExUnittest.cxx
+++ b/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthExUnittest.cxx
@@ -12,7 +12,7 @@
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "AthenaBaseComps/AthService.h"
 
-#include "../src/IMyPackageTool.h"
+#include "AthAsgExUnittest/IMyPackageTool.h"
 
 #include <string>
 #include <iostream>
@@ -25,7 +25,7 @@ namespace Athena_test {
   class MyPackageAlgTest : public InitGaudiGoogleTest {
   public:
 
-    MyPackageAlgTest() 
+    MyPackageAlgTest()
     //  : InitGaudiGoogleTest( MSG::INFO ) // get usual message blurb
       : myAlg(nullptr)
     {}
@@ -61,29 +61,29 @@ namespace Athena_test {
     Gaudi::Algorithm* myAlg;
 
   };
-  
+
   TEST_F( MyPackageAlgTest, getDefaultPropertyValue ) {
     int prop= getIntProperty( "MyProperty" );
     EXPECT_EQ( prop, 1 );
   }
-  
+
   TEST_F( MyPackageAlgTest, initialise ) {
     EXPECT_TRUE( myAlg->initialize().isSuccess() );
   }
-  
+
   TEST_F( MyPackageAlgTest, setProperty ) {
     EXPECT_TRUE( myAlg->setProperty( "MyProperty", 5 ).isSuccess() );
     EXPECT_TRUE( myAlg->initialize().isSuccess() );
     int prop= getIntProperty( "MyProperty" );
     EXPECT_EQ( prop, 5 );
   }
-  
+
   TEST_F( MyPackageAlgTest, getPropertyFromCatalogue ) {
     EXPECT_TRUE( myAlg->sysInitialize().isSuccess() );
     int prop= getIntProperty( "MyProperty" );
     EXPECT_EQ( prop, 21 );
   }
-  
+
   TEST_F( MyPackageAlgTest, toolProperty ) {
     // sysInitialize() gets properties then calls initialize()
     EXPECT_TRUE( myAlg->sysInitialize().isSuccess() );
@@ -91,7 +91,7 @@ namespace Athena_test {
     double prop= mpt->useTheProperty();
     EXPECT_EQ( prop, 42.0 );
   }
-  
+
 }
 
 int main( int argc, char **argv ) {
diff --git a/Control/AthenaPython/CMakeLists.txt b/Control/AthenaPython/CMakeLists.txt
index e248f15c17e7..460c29c03f83 100644
--- a/Control/AthenaPython/CMakeLists.txt
+++ b/Control/AthenaPython/CMakeLists.txt
@@ -5,27 +5,28 @@ atlas_subdir( AthenaPython )
 
 # External dependencies:
 find_package( Python COMPONENTS Development )
-find_package( ROOT COMPONENTS Core PyROOT ROOTTPython cppyy3_7)
+find_package( ROOT COMPONENTS Core PyROOT ROOTTPython
+   cppyy${Python_VERSION_MAJOR}_${Python_VERSION_MINOR} )
 
 # Component(s) in the package:
 atlas_add_library( AthenaPython
-                   src/*.cxx
-                   PUBLIC_HEADERS AthenaPython
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
-                   LINK_LIBRARIES AthenaBaseComps AthenaKernel GaudiKernel
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} CxxUtils DataModelRoot RootUtils )
+   AthenaPython/*.h src/*.cxx
+   PUBLIC_HEADERS AthenaPython
+   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
+   LINK_LIBRARIES AthenaBaseComps GaudiKernel CxxUtils
+   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} DataModelRoot
+   RootUtilsPyROOT )
 
 atlas_add_component( AthenaPythonComps
-                     src/components/*.cxx
-                     LINK_LIBRARIES AthenaPython )
+   src/components/*.cxx
+   LINK_LIBRARIES AthenaPython )
 
 atlas_add_dictionary( AthenaPythonDict
-                      AthenaPython/AthenaPythonDict.h
-                      AthenaPython/selection.xml
-                      LINK_LIBRARIES AthenaPython )
+   AthenaPython/AthenaPythonDict.h
+   AthenaPython/selection.xml
+   LINK_LIBRARIES GaudiKernel AthenaKernel AthenaBaseComps AthenaPython )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py python/tests
                               POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py share/tests/*.py )
-
diff --git a/Control/AthenaServices/CMakeLists.txt b/Control/AthenaServices/CMakeLists.txt
index 92dd6d0831c6..661a54d6b713 100644
--- a/Control/AthenaServices/CMakeLists.txt
+++ b/Control/AthenaServices/CMakeLists.txt
@@ -10,13 +10,15 @@ find_package( Python COMPONENTS Development )
 find_package( yampl )
 
 # Component(s) in the package:
-atlas_add_component( AthenaServices src/*.cxx src/components/*.cxx
+atlas_add_component( AthenaServices
+   src/*.h src/*.cxx src/components/*.cxx
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
    ${CLHEP_INCLUDE_DIRS} ${YAMPL_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES} ${Python_LIBRARIES} ${YAMPL_LIBRARIES}
-   ${CLHEP_LIBRARIES} z TestTools AsgTools AthenaBaseComps AthenaKernel RootUtils CxxUtils
-   AthContainers AthContainersInterfaces DataModelRoot Navigation PerfMonEvent PerfMonKernel SGTools
-   StoreGateLib SGtests PersistentDataModel EventInfo xAODCore xAODEventInfo EventInfoUtils GaudiKernel )
+   ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel RootUtilsPyROOT CxxUtils
+   AthContainers AthContainersInterfaces DataModelRoot PerfMonEvent
+   PerfMonKernel SGTools StoreGateLib PersistentDataModel EventInfo xAODCore
+   xAODEventInfo EventInfoUtils GaudiKernel )
 
 # Test library checking the ability to build T/P converters:
 atlas_add_tpcnv_library( AthenaServicesTest src/test/*.cxx
@@ -92,10 +94,10 @@ atlas_install_joboptions( share/AthTPCnvSvc_test.py
    share/TestSeedRunEvent.py
    share/AthDictLoaderSvc_test.py
    share/ReadAthenaPoolSeek_jobOptions.py
-   share/test_tpcnvdb.py 
-   share/AthenaOutputStream_test.txt 
-   share/FPEControlSvc_test.txt 
-   share/AthenaEventLoopMgr_test.txt 
+   share/test_tpcnvdb.py
+   share/AthenaOutputStream_test.txt
+   share/FPEControlSvc_test.txt
+   share/AthenaEventLoopMgr_test.txt
    share/ConditionsCleanerSvc_test.txt
    share/RCUSvc_test.txt
    share/DelayedConditionsCleanerSvc_test.txt
diff --git a/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt b/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
index 7ad7a696c0a6..e2512aedb0f2 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
+++ b/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
@@ -7,7 +7,8 @@ atlas_subdir( PerfMonComps )
 find_package( AIDA )
 find_package( Boost )
 find_package( Python COMPONENTS Development )
-find_package( ROOT COMPONENTS Core PyROOT cppyy3_7 )
+find_package( ROOT COMPONENTS Core ROOTTPython
+   cppyy${Python_VERSION_MAJOR}_${Python_VERSION_MINOR} )
 find_package( nlohmann_json )
 find_package( psutil )
 
@@ -17,7 +18,7 @@ atlas_add_component( PerfMonComps
    INCLUDE_DIRS ${AIDA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
    ${Python_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${Python_LIBRARIES}
-   ${CMAKE_DL_LIBS} AthenaBaseComps AthenaKernel RootUtils CxxUtils
+   ${CMAKE_DL_LIBS} AthenaBaseComps AthenaKernel RootUtilsPyROOT CxxUtils
    PerfMonEvent PerfMonKernel SGTools StoreGateLib GaudiKernel
    AthDSoCallBacks nlohmann_json::nlohmann_json)
 
diff --git a/Control/RootUtils/CMakeLists.txt b/Control/RootUtils/CMakeLists.txt
index 6cad2d3f313f..176cd0a728e9 100644
--- a/Control/RootUtils/CMakeLists.txt
+++ b/Control/RootUtils/CMakeLists.txt
@@ -59,5 +59,6 @@ atlas_add_test( TTreePatch_test
                 SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/test/TTreePatch_t.py )
 endif()
 
+
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Control/StoreGateBindings/CMakeLists.txt b/Control/StoreGateBindings/CMakeLists.txt
index a29160e8217f..65f5d72ff5bc 100644
--- a/Control/StoreGateBindings/CMakeLists.txt
+++ b/Control/StoreGateBindings/CMakeLists.txt
@@ -5,19 +5,21 @@ atlas_subdir( StoreGateBindings )
 
 # External dependencies:
 find_package( Python COMPONENTS Development )
-find_package( ROOT COMPONENTS PyROOT Core Tree MathCore Hist RIO pthread ROOTTPython cppyy3_7)
+find_package( ROOT COMPONENTS Core ROOTTPython
+   cppyy${Python_VERSION_MAJOR}_${Python_VERSION_MINOR} )
 
 # Component(s) in the package:
 atlas_add_library( StoreGateBindings
-                   src/*.cxx
-                   PUBLIC_HEADERS StoreGateBindings
-                   PRIVATE_INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                   PRIVATE_LINK_LIBRARIES ${Python_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel DataModelRoot GaudiKernel RootUtils SGTools StoreGateLib )
+   StoreGateBindings/*.h src/*.cxx
+   PUBLIC_HEADERS StoreGateBindings
+   PRIVATE_INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+   PRIVATE_LINK_LIBRARIES ${Python_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel
+   DataModelRoot GaudiKernel RootUtils RootUtilsPyROOT SGTools StoreGateLib )
 
 atlas_add_dictionary( StoreGateBindingsDict
-                      src/StoreGateBindingsDict.h
-                      StoreGateBindings/selection.xml
-                      LINK_LIBRARIES StoreGateLib )
+   src/StoreGateBindingsDict.h
+   StoreGateBindings/selection.xml
+   LINK_LIBRARIES StoreGateLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Control/xAODRootAccess/Root/TPyEvent.cxx b/Control/xAODRootAccess/Root/TPyEvent.cxx
index 187fd2b37618..224215389884 100644
--- a/Control/xAODRootAccess/Root/TPyEvent.cxx
+++ b/Control/xAODRootAccess/Root/TPyEvent.cxx
@@ -10,11 +10,6 @@
 
 namespace xAOD {
 
-   TPyEvent::TPyEvent()
-      : TEvent() {
-
-   }
-
    ::Bool_t TPyEvent::contains( const std::string& key,
                                 const std::string& type ) {
 
@@ -49,7 +44,7 @@ namespace xAOD {
                     "Type name \"%s\" not known", type.c_str() );
          return kFALSE;
       }
-      
+
       // Check if the dictionary can return a type_info:
       const std::type_info* ti = cl->GetTypeInfo();
       if( ! ti ) {
@@ -58,7 +53,7 @@ namespace xAOD {
                     type.c_str() );
          return kFALSE;
       }
-      
+
       // Let the base class do the work:
       return TEvent::transientContains( key, *ti, kFALSE );
    }
diff --git a/Control/xAODRootAccess/Root/TPyStore.cxx b/Control/xAODRootAccess/Root/TPyStore.cxx
index b0480825934d..82fc6f1c3aa1 100644
--- a/Control/xAODRootAccess/Root/TPyStore.cxx
+++ b/Control/xAODRootAccess/Root/TPyStore.cxx
@@ -1,9 +1,7 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-// $Id: TPyStore.cxx 659468 2015-04-08 14:31:56Z krasznaa $
-
 // ROOT include(s):
 #include <TClass.h>
 #include <TError.h>
@@ -14,11 +12,6 @@
 
 namespace xAOD {
 
-   TPyStore::TPyStore()
-      : TStore() {
-
-   }
-
    /// This function can be used in the same manner as
    /// TStore::contains<...>(...), but instead of providing a type, one gives it
    /// a type name.
@@ -77,7 +70,7 @@ namespace xAOD {
                     "Type name \"%s\" not known", type.c_str() );
          return kFALSE;
       }
-      
+
       // Check if the dictionary can return a type_info:
       const std::type_info* ti = cl->GetTypeInfo();
       if( ! ti ) {
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_tpyevent_test.py b/Control/xAODRootAccess/test/ut_xaodrootaccess_tpyevent_test.py
index ff4e880ff601..088b885dbad5 100755
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_tpyevent_test.py
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_tpyevent_test.py
@@ -26,6 +26,11 @@ def main():
         logger.error( "Failed to call xAOD::Init(...)" )
         return 1
 
+    # Pre-load some dictionaries. To avoid ROOT-10940.
+    ROOT.xAOD.L2CombinedMuonContainer()
+    ROOT.xAOD.TrigElectronContainer()
+    ROOT.xAOD.MuonContainer()
+
     # Create the objects to test:
     from xAODRootAccess.TPyEvent import TPyEvent
     event = TPyEvent()
@@ -59,7 +64,7 @@ def main():
         return 1
 
     # Loop over 10 events from the input file:
-    for entry in xrange( 10 ):
+    for entry in range( 10 ):
 
         # Load the event:
         tree.GetEntry( entry )
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_transtree2_test.py b/Control/xAODRootAccess/test/ut_xaodrootaccess_transtree2_test.py
index 06257601501e..81ea4bf06448 100755
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_transtree2_test.py
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_transtree2_test.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # Unit test for the transient tree creating infrastructure
 #
@@ -64,7 +64,7 @@ def main():
     import xAODRootAccess.GenerateDVIterators
 
     # Loop over a few event:
-    for entry in xrange( 10 ):
+    for entry in range( 10 ):
         # Load the event:
         if mgr.eventTree().GetEntry( entry ) < 0:
             logger.error( "Couldn't load entry %i" % entry )
diff --git a/Control/xAODRootAccess/xAODRootAccess/TEvent.h b/Control/xAODRootAccess/xAODRootAccess/TEvent.h
index d134471bc5b3..763a44d58725 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TEvent.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TEvent.h
@@ -102,7 +102,7 @@ namespace xAOD {
       /// Constructor connecting the objects to an input TTree/TChain
       TEvent( ::TTree* tree, EAuxMode mode = kUndefinedAccess );
       /// Destructor
-      ~TEvent();
+      virtual ~TEvent();
 
       /// Do not allow copy-constructing this object:
       TEvent( const TEvent& parent ) = delete;
diff --git a/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h b/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h
index 4afc407e0e83..670e44c85d61 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h
@@ -29,8 +29,8 @@ namespace xAOD {
    class TPyEvent : public TEvent {
 
    public:
-      /// Default constructor
-      TPyEvent();
+      /// Inherit the constructor(s) of @c xAOD::TEvent
+      using TEvent::TEvent;
 
       /// Function checking if an object is available from the store
       ::Bool_t contains( const std::string& key, const std::string& type );
diff --git a/Control/xAODRootAccess/xAODRootAccess/TPyStore.h b/Control/xAODRootAccess/xAODRootAccess/TPyStore.h
index b43931875024..442e10b116b3 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TPyStore.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TPyStore.h
@@ -30,8 +30,8 @@ namespace xAOD {
    class TPyStore : public TStore {
 
    public:
-      /// Default constructor
-      TPyStore();
+      /// Inherit the constructor(s) of @c xAOD::TStore
+      using TStore::TStore;
 
       /// Function checking if an object with a given key and type is available
       ::Bool_t contains( const std::string& key,
diff --git a/Control/xAODRootAccess/xAODRootAccess/TStore.h b/Control/xAODRootAccess/xAODRootAccess/TStore.h
index ce47b0d5e0fb..9652657ad1cc 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TStore.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TStore.h
@@ -47,9 +47,14 @@ namespace xAOD {
    public:
       /// Default constructor
       TStore();
+      /// Disallow copying the object
+      TStore( const TStore& ) = delete;
       /// Destructor
       virtual ~TStore();
 
+      /// Disallow copying the object
+      TStore& operator=( const TStore& ) = delete;
+
       /// Set this as the active transient store in the application
       void setActive();
 
diff --git a/Database/IOVDbDataModel/CMakeLists.txt b/Database/IOVDbDataModel/CMakeLists.txt
index ac8ec282e2da..cd3bbcc1b303 100644
--- a/Database/IOVDbDataModel/CMakeLists.txt
+++ b/Database/IOVDbDataModel/CMakeLists.txt
@@ -5,11 +5,11 @@ atlas_subdir( IOVDbDataModel )
 
 # Component(s) in the package:
 atlas_add_library( IOVDbDataModel
-                   src/*.cxx
-                   PUBLIC_HEADERS IOVDbDataModel
-                   LINK_LIBRARIES AthenaKernel AthenaPoolUtilities GaudiKernel RootUtils )
+   IOVDbDataModel/*.h src/*.cxx
+   PUBLIC_HEADERS IOVDbDataModel
+   LINK_LIBRARIES AthenaKernel AthenaPoolUtilities GaudiKernel )
 
 atlas_add_dictionary( IOVDbDataModelDict
-                      IOVDbDataModel/IOVDbDataModelDict.h
-                      IOVDbDataModel/selection.xml
-                      LINK_LIBRARIES IOVDbDataModel )
+   IOVDbDataModel/IOVDbDataModelDict.h
+   IOVDbDataModel/selection.xml
+   LINK_LIBRARIES RootUtilsPyROOT IOVDbDataModel )
diff --git a/Event/xAOD/xAODTruth/test/ut_xaodtruth_helpers_test.py b/Event/xAOD/xAODTruth/test/ut_xaodtruth_helpers_test.py
index 327f904731e1..a510da3fba49 100755
--- a/Event/xAOD/xAODTruth/test/ut_xaodtruth_helpers_test.py
+++ b/Event/xAOD/xAODTruth/test/ut_xaodtruth_helpers_test.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+#
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # This is a simple unit test for checking the health of the truth helper
 # functions in the standalone analysis environment.
@@ -33,7 +33,7 @@ def main():
     t = treeMgr.eventTree()
 
     # Loop on the first few events:
-    for entry in xrange( 10 ):
+    for entry in range( 10 ):
         # Load the event:
         if t.GetEntry( entry ) < 0:
             print( "Couldn't load entry %i from the input!" % entry )
@@ -56,7 +56,7 @@ def main():
             pass
         pass
 
-    return 0;
+    return 0
 
 # Execute the main function:
 if __name__ == "__main__":
diff --git a/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref b/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref
index d811c94b30f3..3483c9b21c37 100644
--- a/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref
+++ b/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref
@@ -1,9 +1,9 @@
-[==========] Running 9 tests from 1 test case.
+[==========] Running 9 tests from 1 test suite.
 [----------] Global test environment set-up.
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v33r1)
-                                          running on pc-camb05 on Wed Apr 29 13:48:28 2020
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on 36d5a1e47246 on Sat Sep 12 19:54:17 2020
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
@@ -13,12 +13,12 @@ ApplicationMgr Ready
 [----------] 9 tests from HepMcParticleLink_test
 [ RUN      ] HepMcParticleLink_test.old_test
 *** HepMcParticleLink_test starts ***
-ClassIDSvc           INFO  getRegistryEntries: read 817 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 821 CLIDRegistry entries for module ALL
 HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
 *** HepMcParticleLink_test OK ***
-[       OK ] HepMcParticleLink_test.old_test (53 ms)
+[       OK ] HepMcParticleLink_test.old_test (45 ms)
 [ RUN      ] HepMcParticleLink_test.broken_event_link
-ClassIDSvc           INFO  getRegistryEntries: read 1070 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1086 CLIDRegistry entries for module ALL
 [       OK ] HepMcParticleLink_test.broken_event_link (1 ms)
 [ RUN      ] HepMcParticleLink_test.truth_event_link_first_event
 [       OK ] HepMcParticleLink_test.truth_event_link_first_event (0 ms)
@@ -37,8 +37,8 @@ HepMcParticleLink WARNING cptr: Mc Truth not stored for event with event number
 [       OK ] HepMcParticleLink_test.truth_event_link_cut_events (0 ms)
 [ RUN      ] HepMcParticleLink_test.max_event_number
 [       OK ] HepMcParticleLink_test.max_event_number (0 ms)
-[----------] 9 tests from HepMcParticleLink_test (54 ms total)
+[----------] 9 tests from HepMcParticleLink_test (46 ms total)
 
 [----------] Global test environment tear-down
-[==========] 9 tests from 1 test case ran. (176 ms total)
+[==========] 9 tests from 1 test suite ran. (255 ms total)
 [  PASSED  ] 9 tests.
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/test/ut_InDetTrackSelectionTool.cxx b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/test/ut_InDetTrackSelectionTool.cxx
index eed21a37bfd4..b545ab9afd1c 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/test/ut_InDetTrackSelectionTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/test/ut_InDetTrackSelectionTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // A unit test for the track selection tool. Currently this compares the pre-defined cut levels
@@ -46,7 +46,7 @@ uint8_t getSum(const TrackParticle&, xAOD::SummaryType);
 void dumpTrack( const TrackParticle& );
 
 int main( int argc, char* argv[] ) {
-  
+
    // The application's name:
    const char* APP_NAME = argv[ 0 ];
 #define CHECK( ARG ) do {ASG_CHECK_SA( APP_NAME, ARG );} while (false)
@@ -58,7 +58,7 @@ int main( int argc, char* argv[] ) {
      Error( APP_NAME, "Could not find $ROOTCORE_TEST_FILE." );
      return 1;
    }
- 
+
   // fail on an unchecked StatusCode
    StatusCode::enableFailure();
 
@@ -113,8 +113,10 @@ int main( int argc, char* argv[] ) {
       if( e < entries ) {
          entries = e;
       }
+   } else if( entries > 100 ) {
+      entries = 100;
    }
-   
+
    for (Long64_t entry = 0; entry < entries; ++entry) {
      CHECK( !event.getEntry(entry) );
 
@@ -179,7 +181,7 @@ bool passNoCut( const TrackParticle&, const xAOD::Vertex* )
 bool passLoose( const TrackParticle& trk, const xAOD::Vertex* )
 {
   if (std::fabs(trk.eta()) > 2.5) return false;
-  
+
   uint8_t nPixHits = getSum(trk, xAOD::numberOfPixelHits) + getSum(trk, xAOD::numberOfPixelDeadSensors);
   uint8_t nSctHits = getSum(trk, xAOD::numberOfSCTHits) + getSum(trk, xAOD::numberOfSCTDeadSensors);
   if (nPixHits + nSctHits < 7) return false;
@@ -193,7 +195,7 @@ bool passLoose( const TrackParticle& trk, const xAOD::Vertex* )
   if (nSiHoles > 2) return false;
   if (nPixHoles > 1) return false;
 
-  return true;  
+  return true;
 }
 
 bool passLoosePrimary( const TrackParticle& trk, const xAOD::Vertex* )
@@ -300,7 +302,7 @@ bool passMinBias( const TrackParticle& trk, const xAOD::Vertex* vtx )
   if (nPixHits < 1) return false;
   uint8_t nSctHits = getSum(trk, xAOD::numberOfSCTHits) + getSum(trk, xAOD::numberOfSCTDeadSensors);
   if (nSctHits < 6) return false;
-  
+
   if (trk.pt() > 10.0*1e3 && TMath::Prob(trk.chiSquared(), trk.numberDoF()) < 0.01) return false;
 
   if (std::fabs(trk.d0()) > 1.5) return false;
@@ -331,7 +333,7 @@ bool passHILoose( const TrackParticle& trk, const xAOD::Vertex* vtx )
   if (pt >= 0.4 && nSctHits < 6) return false;
   else if (pt >= 0.3 && nSctHits < 4) return false;
   else if (nSctHits < 2) return false;
-  
+
   if (std::fabs(trk.d0()) > 1.5) return false;
   if (vtx != nullptr) {
     if (std::fabs(trk.z0() + trk.vz() - vtx->z())*std::sin(trk.theta()) > 1.5) return false;
@@ -360,14 +362,14 @@ bool passHITight( const TrackParticle& trk, const xAOD::Vertex* vtx )
   if (pt >= 0.4 && nSctHits < 8) return false;
   else if (pt >= 0.3 && nSctHits < 6) return false;
   else if (nSctHits < 4) return false;
-  
+
   if (std::fabs(trk.d0()) > 1.0) return false;
   if (vtx != nullptr) {
     if (std::fabs(trk.z0() + trk.vz() - vtx->z())*std::sin(trk.theta()) > 1.0) return false;
   }
 
   if (trk.chiSquared() / trk.numberDoF() > 6.0) return false;
-  
+
   return true;
 }
 
@@ -381,7 +383,7 @@ bool passExpPix( const TrackParticle& trk, const xAOD::Vertex* )
   uint8_t nIBLHits = getSum(trk, xAOD::numberOfInnermostPixelLayerHits);
   uint8_t expectBL = getSum(trk, xAOD::expectNextToInnermostPixelLayerHit);
   uint8_t nBLHits = getSum(trk, xAOD::numberOfNextToInnermostPixelLayerHits);
-  
+
   // make an exception is there is an IBL hit, and the hole is in the BLayer
   if (nIBLHits >= 1) {
     if (expectBL && nBLHits ==0) return true;
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py
index efd9a38e6f08..a7edaae82088 100755
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # @author Tadej Novak
 
@@ -24,6 +24,11 @@ parser.add_option( '-u', '--unit-test', dest='unit_test',
 import ROOT
 ROOT.xAOD.Init().ignore()
 
+# Force-load some xAOD dictionaries. To avoid issues from ROOT-10940.
+ROOT.xAOD.CaloClusterContainer()
+ROOT.xAOD.MuonContainer()
+ROOT.xAOD.TauJetContainer()
+
 # ideally we'd run over all of them, but we don't have a mechanism to
 # configure per-sample right now
 
@@ -53,7 +58,7 @@ job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeEventAlgorithmsSequence
 algSeq = makeEventAlgorithmsSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 for alg in algSeq:
     job.algsAdd( alg )
     pass
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.py
index 348981c7f084..6fd7280dd7e3 100644
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # @author Tadej Novak
 
@@ -29,7 +29,7 @@ svcMgr.EventSelector.InputCollections = [testFile]
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeEventAlgorithmsSequence
 algSeq = makeEventAlgorithmsSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 
 # Add all algorithms from the sequence to the job.
 athAlgSeq += algSeq
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_eljob.py
index 2fff23fdec47..b1821c6bd1d4 100755
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_eljob.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # @author Tadej Novak
 
@@ -52,7 +52,7 @@ job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeGeneratorAlgorithmsSequence
 algSeq = makeGeneratorAlgorithmsSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 for alg in algSeq:
     job.algsAdd( alg )
     pass
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_jobOptions.py
index f1c19a2b1063..bae994afbe05 100644
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_jobOptions.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_jobOptions.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # @author Tadej Novak
 
@@ -28,7 +28,7 @@ svcMgr.EventSelector.InputCollections = [testFile]
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeGeneratorAlgorithmsSequence
 algSeq = makeGeneratorAlgorithmsSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 
 # Add all algorithms from the sequence to the job.
 athAlgSeq += algSeq
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py
index a213be63996c..b9fd75d88366 100755
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # @author Nils Krumnack
 
@@ -53,7 +53,7 @@ job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeOverlapSequence
 algSeq = makeOverlapSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 for alg in algSeq :
     job.algsAdd( alg )
     pass
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.py
index 4e753b0d1357..607ba7885078 100644
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # @author Nils Krumnack
 
@@ -15,7 +15,7 @@ dataType = athArgs.data_type
 if not dataType in ["data", "mc", "afii"] :
     raise Exception ("invalid data type: " + dataType)
 
-print("Running on data type: " + dataType)
+print("Running on data type: %s" % str(dataType))
 
 inputfile = {"data": 'ASG_TEST_FILE_DATA',
              "mc":   'ASG_TEST_FILE_MC',
@@ -29,7 +29,7 @@ svcMgr.EventSelector.InputCollections = [testFile]
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeOverlapSequence
 algSeq = makeOverlapSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 
 # Add all algorithms from the sequence to the job.
 athAlgSeq += algSeq
diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py
index 70d19f314de8..e1f700beb12b 100755
--- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020  CERN for the benefit of the ATLAS collaboration
 #
 # @author Nils Krumnack
 
@@ -24,6 +24,9 @@ parser.add_option( '-u', '--unit-test', dest='unit_test',
 import ROOT
 ROOT.xAOD.Init().ignore()
 
+# Force-load some xAOD dictionaries. To avoid issues from ROOT-10940.
+ROOT.xAOD.TauJetContainer()
+
 # ideally we'd run over all of them, but we don't have a mechanism to
 # configure per-sample right now
 
@@ -58,7 +61,7 @@ job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
 
 from MuonAnalysisAlgorithms.MuonAnalysisAlgorithmsTest import makeSequence
 algSeq = makeSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 for alg in algSeq:
     job.algsAdd( alg )
     pass
diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py
index 0b1755dd1058..ffb0a0087737 100755
--- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # @author Nils Krumnack
 
@@ -24,10 +24,11 @@ parser.add_option( '-u', '--unit-test', dest='unit_test',
 import ROOT
 ROOT.xAOD.Init().ignore()
 
-# this forces the tau algorithms dictionary to be loaded before
-# anything else, which works around some strange dictionary issues I
-# don't understand.
-ROOT.CP.TauSmearingAlg ("dummy", None)
+# Force-load some xAOD dictionaries. To avoid issues from ROOT-10940.
+ROOT.xAOD.CaloClusterContainer()
+ROOT.xAOD.MuonContainer()
+ROOT.xAOD.TauJetContainer()
+ROOT.xAOD.ParticleContainer()
 
 # ideally we'd run over all of them, but we don't have a mechanism to
 # configure per-sample right now
@@ -62,7 +63,7 @@ job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
 
 from TauAnalysisAlgorithms.TauAnalysisAlgorithmsTest import makeSequence
 algSeq = makeSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 for alg in algSeq:
     job.algsAdd( alg )
     pass
diff --git a/PhysicsAnalysis/AnalysisCommon/AssociationUtils/test/ut_assocUtilsDict.py b/PhysicsAnalysis/AnalysisCommon/AssociationUtils/test/ut_assocUtilsDict.py
index 03dd766b26fd..f7737faace23 100755
--- a/PhysicsAnalysis/AnalysisCommon/AssociationUtils/test/ut_assocUtilsDict.py
+++ b/PhysicsAnalysis/AnalysisCommon/AssociationUtils/test/ut_assocUtilsDict.py
@@ -1,17 +1,13 @@
 #!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
+#
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#
 # Test the reflex dictionary usage in PyROOT to
 # instantiate and configure the overlap removal tool(s).
 
 import sys
 sys.argv.append('-b')
 
-# Setup libs
-from ROOT import gROOT
-gROOT.Macro('$ROOTCOREDIR/scripts/load_packages.C')
-
 # Import using the PyROOT bindings and reflex dictionary
 from ROOT import ORUtils
 
@@ -25,11 +21,11 @@ def test_sc(statuscode):
 def test_tool_init(tool_type, verbose=False):
     """Performs simple construction and default initialization of a tool"""
     if verbose:
-        print 'Initializing tool', tool_type.__name__
+        print( 'Initializing tool %s' % tool_type.__name__ )
     tool = tool_type(tool_type.__name__)
     test_sc(tool.initialize())
     if verbose:
-        print '  => Success'
+        print( '  => Success' )
     return tool
 
 # Configure the new master tool
diff --git a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/AnaAlgorithm/AnaAlgorithmConfig.h b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/AnaAlgorithm/AnaAlgorithmConfig.h
index 0f3686b30907..44d6bf50984f 100644
--- a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/AnaAlgorithm/AnaAlgorithmConfig.h
+++ b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/AnaAlgorithm/AnaAlgorithmConfig.h
@@ -54,6 +54,15 @@ namespace EL
     explicit AnaAlgorithmConfig (const std::string& val_typeAndName);
 
 
+    /// \brief Virtual destructor, to make PyROOT happy
+    ///
+    /// Without it ROOT 6.22+ does not allow Python classes to inherit from this
+    /// type.
+    ///
+  public:
+    virtual ~AnaAlgorithmConfig() = default;
+
+
     /// \brief whether we use XAODs
     /// \par Guarantee
     ///   no-fail
diff --git a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py
index 29e8588e50cf..97826fab142e 100644
--- a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py
+++ b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Check if we have the Athena package available. If yes, just use that code.
 try:
@@ -241,7 +241,7 @@ except ImportError:
             """
             return self
 
-        def next( self ):
+        def __next__( self ):
             """Function implementing the recursive iteration over an AlgSequence
 
             This is where most of the logic is. The iterator loops over the
@@ -263,14 +263,14 @@ except ImportError:
             # sub-sequence.
             if self._iterator:
                 try:
-                    return self._iterator.next()
+                    return self._iterator.__next__()
                 except StopIteration:
                     # If the sub-sequence is exhaused, then switch to the
                     # next element in our sequence, and call this function
                     # recursively.
                     self._index += 1
                     self._iterator = None
-                    return self.next()
+                    return self.__next__()
                 pass
 
             # If we are not iterating over a sub-sequence at the moment, let's
@@ -281,7 +281,7 @@ except ImportError:
             # iterating mode", and call this function recursively in that mode.
             if isinstance( element, AlgSequence ):
                 self._iterator = AlgSequenceIterator( element )
-                return self.next()
+                return self.__next__()
 
             # Apparently it's an algorithm we found. So update the internal
             # index, and simply return the algorithm.
diff --git a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py
index 31090b947d17..0c6b6663b2a5 100644
--- a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py
+++ b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # System import(s):
 import copy
@@ -152,7 +152,7 @@ class AnaAlgSequence( AlgSequence ):
                 continue
 
             # Set the input name(s):
-            for inputLabel, inputPropName in meta.inputPropName.iteritems():
+            for inputLabel, inputPropName in meta.inputPropName.items():
                 if not inputLabel in currentInputs.keys():
                     continue
                 setattr( alg, inputPropName, currentInputs[ inputLabel ] )
@@ -174,7 +174,7 @@ class AnaAlgSequence( AlgSequence ):
                   copy.deepcopy( affectingSystematics )
 
                 # Loop over the outputs of the algorithm.
-                for outputLabel, outputPropName in meta.outputPropName.iteritems():
+                for outputLabel, outputPropName in meta.outputPropName.items():
                     if outputLabel not in tmpIndex.keys():
                         tmpIndex[ outputLabel ] = 1
                         pass
@@ -241,7 +241,7 @@ class AnaAlgSequence( AlgSequence ):
         # Set the output name(s) of the last algorithm (that provides output)
         # to the requested value:
         currentOutputs = copy.deepcopy( outputNameDict )
-        for alg, meta in reversed( zip( self, self._algorithmMeta ) ):
+        for alg, meta in reversed( list( zip( self, self._algorithmMeta ) ) ):
 
             # Stop the loop if we're already done.
             if len( currentOutputs ) == 0:
@@ -250,7 +250,7 @@ class AnaAlgSequence( AlgSequence ):
             # If the algorithm has (an) output(s), set them up appropriately.
             # Remembering which "final" output still needs to be set.
             if meta.outputPropName:
-                for outputLabel, outputKey in meta.outputPropName.iteritems():
+                for outputLabel, outputKey in meta.outputPropName.items():
                     if outputLabel in currentOutputs.keys():
                         setattr( alg, outputKey, currentOutputs[ outputLabel ] )
                         del currentOutputs[ outputLabel ]
@@ -260,7 +260,7 @@ class AnaAlgSequence( AlgSequence ):
 
             # Set up the input name(s) of the algorithm correctly, in case this
             # is needed...
-            for inputLabel, inputKey in meta.inputPropName.iteritems():
+            for inputLabel, inputKey in meta.inputPropName.items():
                 if inputLabel in currentOutputs.keys():
                     setattr( alg, inputKey, currentOutputs[ inputLabel ] )
                     pass
@@ -377,7 +377,7 @@ class AnaAlgSequence( AlgSequence ):
         if algIndex == -1:
             raise AttributeError( 'Algorithm/sequence with name "%s" was not ' \
                                   'found' % name )
-        
+
         # Remove the element from the base class:
         super( AnaAlgSequence, self ).__delattr__( name )
 
@@ -587,14 +587,14 @@ class TestAnaAlgSeqMultiInputContainer( unittest.TestCase ):
         self.assertEqual( self.seq.ZCombiner.container2Regex,
                           '(^$)|(^MU_.*)' )
         self.assertEqual( self.seq.ZCalibrator.inputRegex,
-                          '(^$)|(^MU_.*)|(^EL_.*)|(^EG_.*)' )
+                          '(^$)|(^EL_.*)|(^EG_.*)|(^MU_.*)' )
         return
 
     ## Test that the correct value is returned for the users for the affecting
     ## systematics.
     def test_affectingSystematics( self ):
         self.assertEqual( self.seq.affectingSystematics(),
-                          '(^$)|(^MU_.*)|(^EL_.*)|(^EG_.*)' )
+                          '(^$)|(^EL_.*)|(^EG_.*)|(^MU_.*)' )
         return
 
 ## Test case for a sequence starting from a single container, producing
diff --git a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgorithmConfig.py b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgorithmConfig.py
index b2cbd4afd993..ef1e29c8070d 100644
--- a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgorithmConfig.py
+++ b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgorithmConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Import(s):
 import ROOT
@@ -15,7 +15,7 @@ class AnaAlgorithmConfig( ROOT.EL.AnaAlgorithmConfig ):
 
     An example of using it in configuring an EventLoop job could look like:
 
-       job = ROOT.EL.Job() 
+       job = ROOT.EL.Job()
        ...
        from AnaAlgorithm.AnaAlgorithmConfig import AnaAlgorithmConfig
        alg = AnaAlgorithmConfig( "EL::UnitTestAlg2/TestAlg",
@@ -45,14 +45,16 @@ class AnaAlgorithmConfig( ROOT.EL.AnaAlgorithmConfig ):
                                      property = 1.23 )
         """
 
-        # Call the base class's constructor:
-        super( AnaAlgorithmConfig, self ).__init__( typeAndName )
+        # Call the base class's constructor. Use the default constructor instead
+        # of the one receiving the type and name, to avoid ROOT-10872.
+        super( AnaAlgorithmConfig, self ).__init__()
+        self.setTypeAndName( typeAndName )
 
         # Initialise the properties of the algorihm:
         self._props = {}
 
         # Set the properties on the object:
-        for key, value in kwargs.iteritems():
+        for key, value in kwargs.items():
             self.setPropertyFromString( key, stringPropValue( value ) )
             self._props[ key ] = copy.deepcopy( value )
             pass
@@ -160,7 +162,7 @@ class AnaAlgorithmConfig( ROOT.EL.AnaAlgorithmConfig ):
             pass
         result = AnaAlgorithmConfig._printHeader( name )
         result += '\n'
-        for key, value in sorted( self._props.iteritems() ):
+        for key, value in sorted( self._props.items() ):
             if isinstance( value, str ):
                 printedValue = "'%s'" % value
             else:
@@ -330,7 +332,7 @@ class PrivateToolConfig( object ):
         result = ' \n'
         result += AnaAlgorithmConfig._printHeader( name )
         result += '\n'
-        for key, value in sorted( self._props.iteritems() ):
+        for key, value in sorted( self._props.items() ):
             if isinstance( value, str ):
                 printedValue = "'%s'" % value
             else:
diff --git a/PhysicsAnalysis/D3PDTools/EventLoop/Root/Worker.cxx b/PhysicsAnalysis/D3PDTools/EventLoop/Root/Worker.cxx
index 77ccd7bf2a13..dc962a7957b8 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoop/Root/Worker.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoop/Root/Worker.cxx
@@ -1,8 +1,8 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-//          
+//
 // Distributed under the Boost Software License, Version 1.0.
 //    (See accompanying file LICENSE_1_0.txt or copy at
 //          http://www.boost.org/LICENSE_1_0.txt)
@@ -50,6 +50,7 @@
 #include <TROOT.h>
 #include <TSystem.h>
 #include <TTree.h>
+#include <TObjString.h>
 #include <fstream>
 #include <memory>
 
@@ -400,7 +401,7 @@ namespace EL
 
     for (auto& module : m_modules)
       ANA_CHECK (module->preInitialize (*this));
-    
+
     return ::StatusCode::SUCCESS;
   }
 
@@ -967,7 +968,7 @@ namespace EL
     addModule (std::make_unique<Detail::GridReportingModule> ());
     ANA_CHECK (initialize());
 
-    std::vector<std::string> fileList; 
+    std::vector<std::string> fileList;
     {
       std::ifstream infile("input.txt");
       while (infile) {
@@ -980,7 +981,7 @@ namespace EL
           fileList.push_back(sFile);
         }
       }
-    } 
+    }
     if (fileList.size() == 0) {
       ANA_MSG_ERROR ("no input files provided");
       //User was expecting input after all.
@@ -1018,12 +1019,12 @@ namespace EL
       summaryfile << "Files read: " << nFiles << std::endl;
       for (unsigned int i = 0; i < nFiles; i++) {
         summaryfile << "  " << fileList.at(i) << std::endl;
-      }      
+      }
       summaryfile << "Events Read:    " << eventsProcessed << std::endl;
       summaryfile.close();
     }
     else {
       //cout << "Failed to write summary file.\n";
-    } 
+    }
   }
 }
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg.cxx
index f101b028e792..d92256a3d118 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg.cxx
@@ -1,8 +1,8 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-//          
+//
 // Distributed under the Boost Software License, Version 1.0.
 //    (See accompanying file LICENSE_1_0.txt or copy at
 //          http://www.boost.org/LICENSE_1_0.txt)
@@ -25,6 +25,7 @@
 #include <TFile.h>
 #include <TH1.h>
 #include <TTree.h>
+#include <TObjString.h>
 
 #include <AsgTools/MsgStream.h>
 #include <AsgTools/MsgStreamMacros.h>
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg1.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg1.cxx
index d5a5b72d8dbd..e44d142c08e4 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg1.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg1.cxx
@@ -1,8 +1,8 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-//          
+//
 // Distributed under the Boost Software License, Version 1.0.
 //    (See accompanying file LICENSE_1_0.txt or copy at
 //          http://www.boost.org/LICENSE_1_0.txt)
@@ -25,6 +25,7 @@
 #include <TFile.h>
 #include <TH1.h>
 #include <TTree.h>
+#include <TObjString.h>
 
 #include <AsgTools/MsgStream.h>
 #include <AsgTools/MsgStreamMacros.h>
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg2.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg2.cxx
index dd94437076fb..5746aeff0f58 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg2.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //          Copyright Nils Krumnack 2011.
@@ -25,6 +25,7 @@
 #include <TFile.h>
 #include <TH1.h>
 #include <TTree.h>
+#include <TObjString.h>
 
 #include <AsgTools/MsgStream.h>
 #include <AsgTools/MsgStreamMacros.h>
@@ -46,7 +47,7 @@ namespace EL
 
 
   UnitTestAlg2 ::
-  UnitTestAlg2 (const std::string& name, 
+  UnitTestAlg2 (const std::string& name,
                 ISvcLocator* pSvcLocator)
     : AnaAlgorithm (name, pSvcLocator),
       makeOutput (true),
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_DirectDriver.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_DirectDriver.cxx
index cd1b17e2f7fd..505a3db852c5 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_DirectDriver.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_DirectDriver.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /// @author Nils Krumnack
@@ -39,8 +39,8 @@ struct MyUnitTestConfig : public EL::UnitTestConfig
 
 namespace EL
 {
-  INSTANTIATE_TEST_CASE_P(DirectDriverTest, UnitTestFixture,
-			  ::testing::Values(MyUnitTestConfig()),);
+  INSTANTIATE_TEST_SUITE_P(DirectDriverTest, UnitTestFixture,
+                           ::testing::Values(MyUnitTestConfig()));
 }
 
 int main (int argc, char **argv)
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LSFDriver_EOS.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LSFDriver_EOS.cxx
index f4e456e09135..3b1cbfed930a 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LSFDriver_EOS.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LSFDriver_EOS.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /// @author Nils Krumnack
@@ -65,8 +65,8 @@ namespace EL
 {
   // this has to be SLOW, since it requires the entire release to have
   // been build for it to work
-  INSTANTIATE_TEST_CASE_P(MANUAL_LSFDriverTest, UnitTestFixture,
-			  ::testing::Values(MyUnitTestConfig()),);
+  INSTANTIATE_TEST_SUITE_P(MANUAL_LSFDriverTest, UnitTestFixture,
+                           ::testing::Values(MyUnitTestConfig()));
 }
 
 int main (int argc, char **argv)
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LeakChecks.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LeakChecks.cxx
index 10efb6ebe993..d0c53e0188b2 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LeakChecks.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LeakChecks.cxx
@@ -112,15 +112,15 @@ TEST_P( LeakCheckTests, batch ) {
 }
 
 // Perform the test with a number of different settings.
-INSTANTIATE_TEST_CASE_P( AllLeakCheckTests, LeakCheckTests,
-                         ::testing::Values( TestParams{ 0, 0 },
-                                            TestParams{ 1000, 0 },
-                                            TestParams{ 5000, 0 },
-                                            TestParams{ 20000, 0 },
-                                            TestParams{ 0, 1 },
-                                            TestParams{ 1000, 1 },
-                                            TestParams{ 5000, 1 },
-                                            TestParams{ 20000, 1 } ), );
+INSTANTIATE_TEST_SUITE_P( AllLeakCheckTests, LeakCheckTests,
+                          ::testing::Values( TestParams{ 0, 0 },
+                                             TestParams{ 1000, 0 },
+                                             TestParams{ 5000, 0 },
+                                             TestParams{ 20000, 0 },
+                                             TestParams{ 0, 1 },
+                                             TestParams{ 1000, 1 },
+                                             TestParams{ 5000, 1 },
+                                             TestParams{ 20000, 1 } ) );
 
 // Declare the main() function.
 ATLAS_GOOGLE_TEST_MAIN
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LocalDriver.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LocalDriver.cxx
index 0ab803abeefb..0abd349b2141 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LocalDriver.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LocalDriver.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /// @author Nils Krumnack
@@ -41,8 +41,8 @@ namespace EL
 {
   // this has to be SLOW, since it requires the entire release to have
   // been build for it to work
-  INSTANTIATE_TEST_CASE_P(SLOW_LocalDriverTest, UnitTestFixture,
-			  ::testing::Values(MyUnitTestConfig()),);
+  INSTANTIATE_TEST_SUITE_P(SLOW_LocalDriverTest, UnitTestFixture,
+                           ::testing::Values(MyUnitTestConfig()));
 }
 
 int main (int argc, char **argv)
diff --git a/PhysicsAnalysis/D3PDTools/SampleHandler/CMakeLists.txt b/PhysicsAnalysis/D3PDTools/SampleHandler/CMakeLists.txt
index 0ac4d2322377..b06dd71880fe 100644
--- a/PhysicsAnalysis/D3PDTools/SampleHandler/CMakeLists.txt
+++ b/PhysicsAnalysis/D3PDTools/SampleHandler/CMakeLists.txt
@@ -1,7 +1,4 @@
-# $Id: CMakeLists.txt 786914 2016-11-28 14:58:47Z krumnack $
-################################################################################
-# Package: SampleHandler
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( SampleHandler )
@@ -15,7 +12,7 @@ atlas_depends_on_subdirs(
    Control/AthToolSupport/AsgTesting )
 
 # External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO PyROOT Proof )
+find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO ROOTTPython Proof )
 find_package( GTest )
 
 # Component(s) in the package:
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_testFixedInput.py b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_testFixedInput.py
index 0e2384ed3302..32e7613fd792 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_testFixedInput.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_testFixedInput.py
@@ -1,9 +1,9 @@
 #! /usr/bin/env python
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 import subprocess
 
 if __name__ == "__main__":
-	
+
 	recFile="ElectronEfficiencyCorrection/2015_2017/rel21.2/Summer2017_Prerec_v1/offline/efficiencySF.offline.LooseAndBLayerLLH_d0z0_v13.root"
 	models=["FULL","COMBMCTOYS"]
 	etas=["-2.469","0.0","2.469"]
@@ -12,9 +12,9 @@ if __name__ == "__main__":
 	for runnumber in runnumbers:
 		for model in models:
 			for eta in etas:
-				for pt in pts:	
-					cmdopts = ["EgEfficiencyCorr_testEgEfficiencyCorrWithoutFile", 
-							"-f" + recFile, 
+				for pt in pts:
+					cmdopts = ["EgEfficiencyCorr_testEgEfficiencyCorrWithoutFile",
+							"-f" + recFile,
 							"-tFullSim",
 							"-c"+model,
 							"-r"+ runnumber,
@@ -22,4 +22,4 @@ if __name__ == "__main__":
 							"-p" +pt ]
 					rawoutput=subprocess.check_output(cmdopts,universal_newlines=True)
 					maplines=rawoutput.split('\n')
-					print maplines[1]
+					print(str(maplines[1]))
diff --git a/Projects/AnalysisBase/cmake/AnalysisBaseReleaseEnvironmentConfig.cmake b/Projects/AnalysisBase/cmake/AnalysisBaseReleaseEnvironmentConfig.cmake
index e5c10d01cad5..e2396d665b7e 100644
--- a/Projects/AnalysisBase/cmake/AnalysisBaseReleaseEnvironmentConfig.cmake
+++ b/Projects/AnalysisBase/cmake/AnalysisBaseReleaseEnvironmentConfig.cmake
@@ -22,11 +22,12 @@ set( AnalysisBaseReleaseEnvironment_ENVIRONMENT
    SET ROOTCOREDIR \${AnalysisBase_DIR}
    SET ROOTCOREBIN \${AnalysisBase_DIR} )
 
-# Since this project may be built on platforms that provide Python 3
-# out of the box, let's explicitly stick to Python 2 (coming from the
-# externals project) for now.
-set( ATLAS_FORCE_PYTHON2 TRUE CACHE BOOL
-   "Force the usage of Python 2 in the AnalysisBase project" )
+# Find the first "acceptable" Python version according to our search path, and
+# don't search for the absolute newest. (Which could result in picking up
+# Python from /usr on modern OS-es.)
+set( Python_FIND_STRATEGY "LOCATION" CACHE STRING
+   "Search mode for FindPython.cmake" )
+mark_as_advanced( Python_FIND_STRATEGY )
 
 # Do not use Boost's CMake code when building AnalysisBase.
 set( Boost_NO_BOOST_CMAKE TRUE CACHE BOOL
diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt
index da4a5823bdee..e6c276c98962 100644
--- a/Projects/AnalysisBase/externals.txt
+++ b/Projects/AnalysisBase/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AnalysisBaseExternalsVersion = 2.0.75
+AnalysisBaseExternalsVersion = 2.0.77
diff --git a/Projects/AnalysisBase/version.txt b/Projects/AnalysisBase/version.txt
index 3c1b7f674146..c0b885324f71 100644
--- a/Projects/AnalysisBase/version.txt
+++ b/Projects/AnalysisBase/version.txt
@@ -1 +1 @@
-22.0.17
+22.0.18
diff --git a/Projects/AthDataQuality/CMakeLists.txt b/Projects/AthDataQuality/CMakeLists.txt
index bb85aab942e7..69d278c0814e 100644
--- a/Projects/AthDataQuality/CMakeLists.txt
+++ b/Projects/AthDataQuality/CMakeLists.txt
@@ -18,9 +18,9 @@ set( TDAQ-COMMON_ATROOT
 find_package( AtlasCMake REQUIRED )
 
 # Build the project against LCG:
-set( LCG_VERSION_POSTFIX "a_ATLAS_1"
+set( LCG_VERSION_POSTFIX "python3"
    CACHE STRING "Version postfix for the LCG release to use" )
-set( LCG_VERSION_NUMBER 97
+set( LCG_VERSION_NUMBER 98
    CACHE STRING "Version number for the LCG release to use" )
 find_package( LCG ${LCG_VERSION_NUMBER} EXACT REQUIRED )
 
diff --git a/Projects/AthDataQuality/build_externals.sh b/Projects/AthDataQuality/build_externals.sh
index 848619a66d15..e0eb7dc0b8c2 100755
--- a/Projects/AthDataQuality/build_externals.sh
+++ b/Projects/AthDataQuality/build_externals.sh
@@ -22,7 +22,6 @@ BUILDDIR=""
 BUILDTYPE="RelWithDebInfo"
 FORCE=""
 CI=""
-EXTRACMAKE=(-DLCG_VERSION_NUMBER=98 -DLCG_VERSION_POSTFIX="python3")
 while getopts ":t:b:fch" opt; do
     case $opt in
         t)
@@ -101,4 +100,4 @@ AtlasExternalsVersion=$(awk '/^AtlasExternalsVersion/{print $3}' ${thisdir}/exte
 # Check out AthenaExternals from the right branch/tag:
 ${scriptsdir}/checkout_atlasexternals.sh \
     -t ${AtlasExternalsVersion} \
-    -s ${BUILDDIR}/src/atlasexternals 2>&1 | tee ${BUILDDIR}/src/checkout.atlasexternals.log 
+    -s ${BUILDDIR}/src/atlasexternals 2>&1 | tee ${BUILDDIR}/src/checkout.atlasexternals.log
diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt
index 30f3dcbbc157..1479e8bf5f12 100644
--- a/Projects/AthDataQuality/externals.txt
+++ b/Projects/AthDataQuality/externals.txt
@@ -5,4 +5,4 @@
 # an "origin/" prefix before it. For tags however this is explicitly
 # forbidden.
 
-AtlasExternalsVersion = 2.0.75
+AtlasExternalsVersion = 2.0.77
diff --git a/Projects/AthDataQuality/version.txt b/Projects/AthDataQuality/version.txt
index 3c1b7f674146..c0b885324f71 100644
--- a/Projects/AthDataQuality/version.txt
+++ b/Projects/AthDataQuality/version.txt
@@ -1 +1 @@
-22.0.17
+22.0.18
diff --git a/Projects/AthGeneration/externals.txt b/Projects/AthGeneration/externals.txt
index f24529601a85..523826ba6f85 100644
--- a/Projects/AthGeneration/externals.txt
+++ b/Projects/AthGeneration/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthGenerationExternalsVersion = 2.0.75
+AthGenerationExternalsVersion = 2.0.77
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v34r0.004
diff --git a/Projects/AthGeneration/version.txt b/Projects/AthGeneration/version.txt
index 3c1b7f674146..c0b885324f71 100644
--- a/Projects/AthGeneration/version.txt
+++ b/Projects/AthGeneration/version.txt
@@ -1 +1 @@
-22.0.17
+22.0.18
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index 2e95ca67549a..c55ec4ebba96 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthSimulationExternalsVersion = 2.0.75
+AthSimulationExternalsVersion = 2.0.77
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v34r0.004
diff --git a/Projects/AthSimulation/version.txt b/Projects/AthSimulation/version.txt
index 3c1b7f674146..c0b885324f71 100644
--- a/Projects/AthSimulation/version.txt
+++ b/Projects/AthSimulation/version.txt
@@ -1 +1 @@
-22.0.17
+22.0.18
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index fdc05b490d5f..16b150ed4be3 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthenaExternalsVersion = 2.0.75
+AthenaExternalsVersion = 2.0.77
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v34r0.004
diff --git a/Projects/VP1Light/externals.txt b/Projects/VP1Light/externals.txt
index 0ab152fc7e5c..e3134d942295 100644
--- a/Projects/VP1Light/externals.txt
+++ b/Projects/VP1Light/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-VP1LightExternalsVersion = 2.0.75
+VP1LightExternalsVersion = 2.0.77
diff --git a/Projects/VP1Light/version.txt b/Projects/VP1Light/version.txt
index 3c1b7f674146..c0b885324f71 100644
--- a/Projects/VP1Light/version.txt
+++ b/Projects/VP1Light/version.txt
@@ -1 +1 @@
-22.0.17
+22.0.18
diff --git a/Reconstruction/Jet/JetRec/share/ExtractorUnitTests.ref b/Reconstruction/Jet/JetRec/share/ExtractorUnitTests.ref
index ed9f8df82646..87ac93dbad54 100644
--- a/Reconstruction/Jet/JetRec/share/ExtractorUnitTests.ref
+++ b/Reconstruction/Jet/JetRec/share/ExtractorUnitTests.ref
@@ -1,10 +1,10 @@
-[==========] Running 1 test from 1 test case.
+[==========] Running 1 test from 1 test suite.
 [----------] Global test environment set-up.
 [----------] 1 test from ExtractorTest
 [ RUN      ] ExtractorTest.addJet
 [       OK ] ExtractorTest.addJet (0 ms)
-[----------] 1 test from ExtractorTest (1 ms total)
+[----------] 1 test from ExtractorTest (0 ms total)
 
 [----------] Global test environment tear-down
-[==========] 1 test from 1 test case ran. (1 ms total)
+[==========] 1 test from 1 test suite ran. (0 ms total)
 [  PASSED  ] 1 test.
diff --git a/Reconstruction/Jet/JetRec/share/TestTests.ref b/Reconstruction/Jet/JetRec/share/TestTests.ref
index a3d707bd886f..685701175880 100644
--- a/Reconstruction/Jet/JetRec/share/TestTests.ref
+++ b/Reconstruction/Jet/JetRec/share/TestTests.ref
@@ -1,4 +1,4 @@
-[==========] Running 1 test from 1 test case.
+[==========] Running 1 test from 1 test suite.
 [----------] Global test environment set-up.
 [----------] 1 test from TestTest
 [ RUN      ] TestTest.test
@@ -6,5 +6,5 @@
 [----------] 1 test from TestTest (0 ms total)
 
 [----------] Global test environment tear-down
-[==========] 1 test from 1 test case ran. (0 ms total)
+[==========] 1 test from 1 test suite ran. (0 ms total)
 [  PASSED  ] 1 test.
diff --git a/Reconstruction/egamma/egammaLayerRecalibTool/test/ut_egammaLayerRecalibrationTool.py b/Reconstruction/egamma/egammaLayerRecalibTool/test/ut_egammaLayerRecalibrationTool.py
index cff18c8b93f3..b2d2079dd259 100755
--- a/Reconstruction/egamma/egammaLayerRecalibTool/test/ut_egammaLayerRecalibrationTool.py
+++ b/Reconstruction/egamma/egammaLayerRecalibTool/test/ut_egammaLayerRecalibrationTool.py
@@ -1,12 +1,17 @@
 #! /usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+#
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#
 
 import unittest
 import ROOT
 import itertools
-ROOT.PyConfig.IgnoreCommandLineOptions = True
+import sys
 
+# Do the xAOD environment setup before anything else. To avoid any unwanted
+# warning messages while opening xAOD files (for testing whether they can) be
+# opened...
+ROOT.xAOD.Init().ignore()
 
 def arange(xmin, xmax, delta):
     # just to don't inject dep from numpy
@@ -31,7 +36,9 @@ def xAOD_electron_generator(tree):
 class TestLayer(unittest.TestCase):
     def setUp(self):
         self.egammaLayerRecalibTool = ROOT.egammaLayerRecalibTool
-        self.output_file = ROOT.TFile("test_output.root", "recreate")
+        self.output_file = ROOT.TFile.Open("test_output.root", "recreate")
+        self.assertTrue( self.output_file != ROOT.nullptr )
+        ROOT.CP.CorrectionCode.enableFailure()
 
     def tearDown(self):
         self.output_file.Close()
@@ -83,7 +90,7 @@ class TestLayer(unittest.TestCase):
 
         inputs = self.example_inputs()
 
-        tool.scale_inputs(inputs)
+        self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
         self.assertAlmostEqual(inputs.E0raw,
                                self.example_inputs().E0raw * (1 + 0.01), places=5)
         self.assertAlmostEqual(inputs.E1raw, self.example_inputs().E1raw)
@@ -95,7 +102,7 @@ class TestLayer(unittest.TestCase):
         tool.add_scale(modifier2, amounter2)
 
         inputs.eta = -0.03
-        tool.scale_inputs(inputs)
+        self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
         self.assertAlmostEqual(inputs.E1raw,
                                self.example_inputs().E1raw, places=5)
         self.assertAlmostEqual(inputs.E0raw,
@@ -103,7 +110,7 @@ class TestLayer(unittest.TestCase):
 
         inputs = self.example_inputs()
         inputs.eta = 0.03
-        tool.scale_inputs(inputs)
+        self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
         self.assertAlmostEqual(inputs.E1raw,
                                self.example_inputs().E1raw * (1. + 0.05), places=5)
         self.assertAlmostEqual(inputs.E0raw,
@@ -114,7 +121,7 @@ class TestLayer(unittest.TestCase):
         inputs = self.example_inputs()
         inputs.eta = 2.
 
-        tool.scale_inputs(inputs)
+        self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
         self.assertAlmostEqual(inputs.E1raw,
                                self.example_inputs().E1raw * (1. + 0.01), places=5)
         self.assertAlmostEqual(inputs.E0raw,
@@ -122,7 +129,7 @@ class TestLayer(unittest.TestCase):
 
         inputs = self.example_inputs()
         inputs.eta = -2.
-        tool.scale_inputs(inputs)
+        self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
         self.assertAlmostEqual(inputs.E1raw,
                                self.example_inputs().E1raw * (1. + 0.01), places=5)
         self.assertAlmostEqual(inputs.E0raw,
@@ -139,7 +146,7 @@ class TestLayer(unittest.TestCase):
             inputs.eta = i * 0.05 - 2.5
             bin = histo_ps_tot_error.FindBin(inputs.eta)
             amount = histo_ps_tot_error.GetBinContent(bin)
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
             self.assertAlmostEqual(inputs.E0raw,
                                    self.example_inputs().E0raw / amount, places=5)
 
@@ -157,7 +164,7 @@ class TestLayer(unittest.TestCase):
         for i in range(100):
             inputs = self.example_inputs()
             inputs.eta = i * 0.05 - 2.5
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
             self.assertAlmostEqual(inputs.E0raw, self.example_inputs().E0raw)
             self.assertAlmostEqual(inputs.E1raw, self.example_inputs().E1raw)
 
@@ -169,7 +176,7 @@ class TestLayer(unittest.TestCase):
             inputs = self.example_inputs()
             inputs.eta = eta
             inputs.RunNumber = 200803
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
             self.assertAlmostEqual(inputs.E1raw, self.example_inputs().E1raw)
             self.assertAlmostEqual(inputs.E2raw, self.example_inputs().E2raw)
             self.assertAlmostEqual(inputs.eta, eta, 4)
@@ -179,7 +186,7 @@ class TestLayer(unittest.TestCase):
             inputs = self.example_inputs()
             inputs.eta = eta
             inputs.RunNumber = 212810
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
             if eta > 1.5:
                 self.assertAlmostEqual(inputs.E0raw, self.example_inputs().E0raw)
 
@@ -192,7 +199,7 @@ class TestLayer(unittest.TestCase):
 
             alpha = 0.97 if (abs(inputs.eta) < 1.425) else 1
 
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
 
             self.assertAlmostEqual(inputs.E0raw, self.example_inputs().E0raw, 5)
             self.assertAlmostEqual(inputs.E1raw, self.example_inputs().E1raw / alpha, 5)
@@ -200,7 +207,8 @@ class TestLayer(unittest.TestCase):
     def _test_layer1_2010_v5(self): # TODO: fix path
         tool = self.egammaLayerRecalibTool('layer1_2010_v5')
 
-        f = ROOT.TFile("$ROOTCOREDIR/data/egammaLayerRecalibTool/egammaLayerRecalibTunes.root")
+        f = ROOT.TFile.Open("$ROOTCOREDIR/data/egammaLayerRecalibTool/egammaLayerRecalibTunes.root", "READ")
+        self.assertTrue(f != ROOT.nullptr)
         histo = f.Get("hE1E2ave_2010")
         etas = [histo.GetBinCenter(i) for i in range(histo.GetNbinsX())]
 
@@ -221,7 +229,8 @@ class TestLayer(unittest.TestCase):
     def _oldtest_multi_modifier(self): # TODO: fix path
         tool = self.egammaLayerRecalibTool('layer1_2')
         tool.add_scale('ps_1')
-        f = ROOT.TFile("$ROOTCOREDIR/data/egammaLayerRecalibTool/EnergyRescalerData.root")
+        f = ROOT.TFile.Open("$ROOTCOREDIR/data/egammaLayerRecalibTool/EnergyRescalerData.root", "READ")
+        self.assertTrue(f != ROOT.nullptr)
         histo_ps_tot_error = f.Get("Scales/2011/alphaPSmod_b12Fit_errTot")
 
         for i in range(100):
@@ -233,49 +242,43 @@ class TestLayer(unittest.TestCase):
 
             alpha = 0.97 if (abs(inputs.eta) < 1.425) else 1.05
 
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
             self.assertAlmostEqual(inputs.E0raw, self.example_inputs().E0raw / amount, places=5)
             self.assertAlmostEqual(inputs.E1raw, self.example_inputs().E1raw / alpha, 5)
 
 
 def is_file_readable(path):
-    f = ROOT.TFile.Open(path)
+    f = ROOT.TFile.Open(path, "READ")
     return bool(f)
 
 
-@unittest.skipIf(not is_file_readable('root://eosatlas.cern.ch//eos/atlas/user/t/turra/user.blenzi.4956574.EXT0._000001.AOD.pool.root'),
+filename = 'root://eosatlas.cern.ch//eos/atlas/user/t/turra/user.blenzi.4956574.EXT0._000001.AOD.pool.root'
+@unittest.skipIf(not is_file_readable(filename),
                  "input file not available")
 class TestLayerxAOD(unittest.TestCase):
-    @classmethod
-    def setUpClass(cls):
-        """ using a filename where the egamma.e() is already computed
-        v1 MVA calibration
-        """
-        filename = 'root://eosatlas.cern.ch//eos/atlas/user/t/turra/user.blenzi.4956574.EXT0._000001.AOD.pool.root'
-        if (not ROOT.xAOD.Init().isSuccess()):
-            print("Failed xAOD.Init()")
 
+    def setUp(self):
         treeName = "CollectionTree"
+        self.file = ROOT.TFile.Open(filename, "READ")
+        self.assertTrue(self.file != ROOT.nullptr)
+        self.tree = ROOT.xAOD.MakeTransientTree(self.file, treeName)
+        self.assertTrue(self.tree != ROOT.nullptr)
 
-        f = ROOT.TFile.Open(filename)
-        if not f:
-            print("file %s not found" % filename)
-        cls.tree = ROOT.xAOD.MakeTransientTree(f, treeName)
-
-    @classmethod
-    def tearDownClass(cls):
+    def tearDown(self):
         ROOT.xAOD.ClearTransientTrees()
+        self.file.Close()
 
     def test_decoration(self):
         tune = "2012_alt_with_layer2"
         tool = ROOT.egammaLayerRecalibTool(tune)
+        ROOT.CP.CorrectionCode.enableFailure()
 
         N = 200
         i = 0
         for el in itertools.islice(xAOD_electron_generator(self.tree), None, N):
             event_info = self.tree.EventInfo
 
-            self.assertTrue(tool.applyCorrection(el, event_info).code() == ROOT.CP.CorrectionCode.Ok)
+            self.assertTrue(tool.applyCorrection(el, event_info) == ROOT.CP.CorrectionCode.Ok)
 
             inputs = ROOT.StdCalibrationInputs()
             inputs.RunNumber = event_info.runNumber()
@@ -286,12 +289,12 @@ class TestLayerxAOD(unittest.TestCase):
             inputs.phi = el.caloCluster().phi()
             inputs.eta = el.caloCluster().eta()
 
-            tool.scale_inputs(inputs)
-            self.assertAlmostEqual(inputs.E0raw, el.caloCluster().auxdataConst("double")("correctedcl_Es0"))
-            self.assertAlmostEqual(inputs.E1raw, el.caloCluster().auxdataConst("double")("correctedcl_Es1"))
-            self.assertAlmostEqual(inputs.E2raw, el.caloCluster().auxdataConst("double")("correctedcl_Es2"))
-            self.assertAlmostEqual(inputs.E3raw, el.caloCluster().auxdataConst("double")("correctedcl_Es3"))
-#            self.assertTrue(el.caloCluster().auxdataConst("string")("layer_correction") == tune) # TODO: check why not working in 2.4
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
+            self.assertAlmostEqual(inputs.E0raw, el.caloCluster().auxdataConst["double"]("correctedcl_Es0"))
+            self.assertAlmostEqual(inputs.E1raw, el.caloCluster().auxdataConst["double"]("correctedcl_Es1"))
+            self.assertAlmostEqual(inputs.E2raw, el.caloCluster().auxdataConst["double"]("correctedcl_Es2"))
+            self.assertAlmostEqual(inputs.E3raw, el.caloCluster().auxdataConst["double"]("correctedcl_Es3"))
+#            self.assertTrue(el.caloCluster().auxdataConst["string"]("layer_correction") == tune) # TODO: check why not working in 2.4
             i += 1
 
         self.assertGreater(i, 10, msg="too few electrons")
@@ -311,10 +314,11 @@ class TestLayerxAOD(unittest.TestCase):
 
 
 if __name__ == '__main__':
-    ROOT.gROOT.ProcessLine(".x $ROOTCOREDIR/scripts/load_packages.C")
     ROOT.gStyle.SetCanvasDefH(800)
     ROOT.gStyle.SetCanvasDefW(800)
     ROOT.gStyle.SetPadTickX(1)
     ROOT.gStyle.SetPadTickY(1)
 
-    unittest.main()
+    ROOT.PyConfig.IgnoreCommandLineOptions = True
+
+    sys.exit( unittest.main() )
diff --git a/Simulation/BeamEffects/share/BeamEffectsAlg_test.ref b/Simulation/BeamEffects/share/BeamEffectsAlg_test.ref
index bb42b8c5d058..6c7319f09e73 100644
--- a/Simulation/BeamEffects/share/BeamEffectsAlg_test.ref
+++ b/Simulation/BeamEffects/share/BeamEffectsAlg_test.ref
@@ -1,37 +1,36 @@
-[==========] Running 7 tests from 1 test case.
+[==========] Running 7 tests from 1 test suite.
 [----------] Global test environment set-up.
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
-                                          running on karma on Fri Feb 17 22:54:02 2017
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on 36d5a1e47246 on Sat Sep 12 19:55:44 2020
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
 EventLoopMgr      WARNING No events will be processed from external input.
-HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 [----------] 7 tests from BeamEffectsAlg_test
 [ RUN      ] BeamEffectsAlg_test.empty_alg_execute
-ClassIDSvc           INFO  getRegistryEntries: read 1507 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2101 CLIDRegistry entries for module ALL
 BeamEffectsAlg      FATAL No input McEventCollection called GEN_EVENT in StoreGate.
-[       OK ] BeamEffectsAlg_test.empty_alg_execute (179 ms)
+[       OK ] BeamEffectsAlg_test.empty_alg_execute (16 ms)
 [ RUN      ] BeamEffectsAlg_test.set_properties
-ClassIDSvc           INFO  getRegistryEntries: read 359 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 430 CLIDRegistry entries for module ALL
 [       OK ] BeamEffectsAlg_test.set_properties (1 ms)
 [ RUN      ] BeamEffectsAlg_test.patchSignalProcessVertex_empty_GenEvent
 BeamEffectsAlg    WARNING No signal_process_vertex found. Empty GenEvent!
 [       OK ] BeamEffectsAlg_test.patchSignalProcessVertex_empty_GenEvent (0 ms)
 [ RUN      ] BeamEffectsAlg_test.signal_process_vertex_exists
-[       OK ] BeamEffectsAlg_test.signal_process_vertex_exists (1 ms)
+[       OK ] BeamEffectsAlg_test.signal_process_vertex_exists (0 ms)
 [ RUN      ] BeamEffectsAlg_test.add_signal_process_vertex_atlasG4
 [       OK ] BeamEffectsAlg_test.add_signal_process_vertex_atlasG4 (0 ms)
 [ RUN      ] BeamEffectsAlg_test.add_signal_process_vertex_isfG4
 [       OK ] BeamEffectsAlg_test.add_signal_process_vertex_isfG4 (0 ms)
 [ RUN      ] BeamEffectsAlg_test.execute_pass_through
-[       OK ] BeamEffectsAlg_test.execute_pass_through (0 ms)
-[----------] 7 tests from BeamEffectsAlg_test (19 ms total)
+[       OK ] BeamEffectsAlg_test.execute_pass_through (1 ms)
+[----------] 7 tests from BeamEffectsAlg_test (18 ms total)
 
 [----------] Global test environment tear-down
-[==========] 7 tests from 1 test case ran. (75 ms total)
+[==========] 7 tests from 1 test suite ran. (244 ms total)
 [  PASSED  ] 7 tests.
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
index f16fc669b538..dc8a0e3cb907 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
@@ -1,36 +1,8 @@
-# $Id: CMakeLists.txt 769975 2016-08-25 07:41:26Z krasznaa $
-################################################################################
-# Package: TrkVertexSeedFinderUtils
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrkVertexSeedFinderUtils )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/AthenaBaseComps
-   DetectorDescription/GeoPrimitives
-   Event/xAOD/xAODTracking
-   GaudiKernel
-   MagneticField/MagFieldConditions   # Exposed by NewtonTrkDistanceFinder.h and Trk2dDistanceSeeder.h
-   Tracking/TrkEvent/TrkParameters
-   Tracking/TrkEvent/TrkParticleBase
-   Tracking/TrkEvent/VxVertex
-   InnerDetector/InDetConditions/BeamSpotConditionsData
-   PRIVATE
-   AtlasTest/TestTools
-   Event/EventPrimitives
-   Event/xAOD/xAODTruth
-   InnerDetector/InDetConditions/InDetBeamSpotService
-   InnerDetector/InDetRecTools/InDetTrackSelectionTool
-   MagneticField/MagFieldElements
-   Tracking/TrkEvent/TrkEventPrimitives
-   Tracking/TrkEvent/TrkLinks
-   Tracking/TrkEvent/TrkTrack
-   Tracking/TrkVertexFitter/TrkVertexFitterInterfaces 
-   Tools/PathResolver )
-
 # External dependencies:
 find_package( FFTW )
 find_package( ROOT COMPONENTS Core Tree Hist )
@@ -40,87 +12,92 @@ atlas_add_library( TrkVertexSeedFinderUtilsLib
    TrkVertexSeedFinderUtils/*.h
    INTERFACE
    PUBLIC_HEADERS TrkVertexSeedFinderUtils
-   LINK_LIBRARIES AthenaBaseComps GaudiKernel TrkParameters GeoPrimitives
-   VxVertex TrkParticleBase xAODTracking BeamSpotConditionsData )
+   INCLUDE_DIRS ${FFTW_INCLUDE_DIRS}
+   LINK_LIBRARIES ${FFTW_LIBRARIES} GaudiKernel AthenaBaseComps
+   TrkVertexFitterInterfaces TrkParameters GeoPrimitives xAODTracking
+   MagFieldConditions )
 
 atlas_add_component( TrkVertexSeedFinderUtils
-   src/*.cxx src/components/*.cxx
-   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${FFTW_INCLUDE_DIRS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} EventPrimitives
-   xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-   TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
-
-atlas_install_joboptions( share/*.py )
-atlas_install_joboptions( share/*.txt )
-
-
+   src/*.h src/*.cxx src/components/*.cxx
+   INCLUDE_DIRS ${FFTW_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${FFTW_LIBRARIES} ${ROOT_LIBRARIES} GaudiKernel
+   AthenaBaseComps TrkParticleBase TrkParameters TrkLinks TrkTrack
+   TrkVertexFitterInterfaces TrkEventPrimitives xAODTracking xAODTruth
+   InDetTrackSelectionToolLib BeamSpotConditionsData EventPrimitives
+   GeoPrimitives MagFieldElements TrkVertexSeedFinderUtilsLib )
+
+# Test(s) in the package.
 atlas_add_test( NewtonTrkDistanceFinder_test
-                SOURCES test/NewtonTrkDistanceFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
-
+   SOURCES test/NewtonTrkDistanceFinder_test.cxx
+           src/NewtonTrkDistanceFinder.cxx
+           src/PointOnTrack.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools MagFieldConditions
+   MagFieldElements CxxUtils GaudiKernel PathResolver SGTools StoreGateLib
+   TrkEventPrimitives TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 atlas_add_test( Trk2dDistanceSeeder_test
-                SOURCES test/Trk2dDistanceSeeder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
+   SOURCES test/Trk2dDistanceSeeder_test.cxx
+           src/Trk2dDistanceSeeder.cxx
+           src/PointOnTrack.cxx
+           src/TwoTracks.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel PathResolver
+   SGTools StoreGateLib MagFieldConditions MagFieldElements TrkParameters
+   TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 
 atlas_add_test( SeedNewtonTrkDistanceFinder_test
-                SOURCES test/SeedNewtonTrkDistanceFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
-
+   SOURCES test/SeedNewtonTrkDistanceFinder_test.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel PathResolver
+   SGTools StoreGateLib MagFieldConditions MagFieldElements
+   TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 atlas_add_test( Trk2DDistanceFinder_test
-                SOURCES test/Trk2DDistanceFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
-
+   SOURCES test/Trk2DDistanceFinder_test.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel PathResolver
+   SGTools StoreGateLib MagFieldConditions MagFieldElements
+   TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 atlas_add_test( GaussianTrackDensity_test
-                SOURCES test/GaussianTrackDensity_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
+   SOURCES test/GaussianTrackDensity_test.cxx
+           src/GaussianTrackDensity.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel TrkTrack
+   TrkEventPrimitives TrkVertexSeedFinderUtilsLib )
 # Needed to avoid spurious ubsan warnings.
 set_target_properties( TrkVertexSeedFinderUtils_GaussianTrackDensity_test PROPERTIES ENABLE_EXPORTS True )
 
-
 atlas_add_test( SimpleVertexClusterFinder_test
-                SOURCES test/SimpleVertexClusterFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
-
+   SOURCES test/SimpleVertexClusterFinder_test.cxx
+           src/SimpleVertexClusterFinder.cxx
+           src/VertexImageMaker.cxx
+           src/VertexImage.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel
+   EventPrimitives TrkVertexSeedFinderUtilsLib )
 
 atlas_add_test( Mode3dFromFsmw1dFinder_test
-                SOURCES test/Mode3dFromFsmw1dFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
+   SOURCES test/Mode3dFromFsmw1dFinder_test.cxx
+           src/Mode3dFromFsmw1dFinder.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel TrkParameters
+   TrkVertexSeedFinderUtilsLib )
 # Needed to avoid spurious ubsan warnings.
 set_target_properties( TrkVertexSeedFinderUtils_Mode3dFromFsmw1dFinder_test PROPERTIES ENABLE_EXPORTS True )
 
-
 atlas_add_test( Mode3dTo1dFinder_test
-                SOURCES test/Mode3dTo1dFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
+   SOURCES test/Mode3dTo1dFinder_test.cxx
+           src/Mode3dTo1dFinder.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel TrkParameters
+   TrkVertexSeedFinderUtilsLib )
+
+# Install files from the package.
+atlas_install_joboptions( share/*.py share/*.txt )
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImage.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImage.h
index e0fa2765d57a..cbdd6d59c315 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImage.h
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImage.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRKVERTEXSEEDFINDERUTILS_VERTEXIMAGE_H
@@ -20,9 +20,9 @@ namespace Trk {
     // Construct with pointer to the array, numbers of bins in x,y,z
     // and flag for whether fourier transforms were done in place.
     // in-place filtering has extra padding in the array to fit the complex frequency space histogram
-    VertexImage( float* array,
+    VertexImage( double* array,
                  arrayDeleter* deleter,
-                 int nx, int ny, int nz, 
+                 int nx, int ny, int nz,
                  float xrange, float yrange, float zrange);
 
 
@@ -37,8 +37,8 @@ namespace Trk {
     VertexImage& operator= (const VertexImage&) = delete;
 
     // Direct access to the histogram array
-          float * getHist()       { return m_hist_3d; }
-    const float * getHist() const { return m_hist_3d; }
+          double * getHist()       { return m_hist_3d; }
+    const double * getHist() const { return m_hist_3d; }
 
     // Get the row major index of an x,y,z bin
     int getRMBin( const int & x, const int & y, const int & z ) const;
@@ -55,14 +55,14 @@ namespace Trk {
     // Get the actual relative (to histogram center) position
     float getRelPosX(float binx) const { return -m_xrange + binx*m_wx; }
     float getRelPosY(float biny) const { return -m_yrange + biny*m_wy; }
-    float getRelPosZ(float binz) const { return -m_zrange + binz*m_wz; } 
+    float getRelPosZ(float binz) const { return -m_zrange + binz*m_wz; }
 
     // Get the indices of all adjacent bins in 3D
     std::vector<int> getAdjacentBins( int index ) const;
 
     // -----------------------------------------------
     // Get rectangular projections onto 1D z-direction
-    
+
     // Project full range
     std::vector<float> projectRectangleOnZ() const;
     // Project specified rectangle from {x,y}min inclusive to {x,y}max exclusive
@@ -84,7 +84,7 @@ namespace Trk {
   private:
 
     // The actual histogram array
-    float * m_hist_3d;
+    double * m_hist_3d;
 
     // Function to delete the array.
     arrayDeleter* m_deleter;
@@ -93,7 +93,7 @@ namespace Trk {
     int m_nbinsx;
     int m_nbinsy;
     int m_nbinsz;
-    
+
     // Physical (half) range of the histogram in x,y,z (spans from -range to +range)
     float m_xrange;
     float m_yrange;
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImageMaker.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImageMaker.h
index 299ca09828a8..8c08ec302554 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImageMaker.h
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImageMaker.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRKVERTEXSEEDFINDERUTILIS_SIMPLEVERTEXCLUSTERFINDER_H
@@ -56,15 +56,15 @@ namespace Trk
     int    m_zbins;
 
     float m_xrange; //Range around histogram center in position space
-    float m_yrange; 
+    float m_yrange;
     float m_zrange;
-    
+
     //Filter parameters
     float m_a0Window;
     float m_a1Window;
     float m_a2Window;
     float m_a3Window;
-    
+
     int    m_cutoffFreqDenominator_xy;
     int    m_cutoffFreqDenominator_z;
 
@@ -73,26 +73,26 @@ namespace Trk
     //Other members:
 
     //Widths of histogram bins
-    float m_wx;        
-    float m_wy;          
+    float m_wx;
+    float m_wy;
     float m_wz;
 
-    //Total number of filter bins 
+    //Total number of filter bins
     int m_filttot;
 
     //The frequency space filter
     std::vector<float> m_histFSFilter;
 
     //the FFTW "plans" -- object that saves how the fourier transform is done
-    fftwf_plan m_plan_r2c;
-    fftwf_plan m_plan_c2r;
+    FFTW_MANGLE_DOUBLE(plan) m_plan_r2c;
+    FFTW_MANGLE_DOUBLE(plan) m_plan_c2r;
 
     //Method implementing the backprojection into the real space histogram
     void fillHist( VertexImage& image,
                    const std::vector<const Trk::TrackParameters*>& parametersList,
                    const xAOD::Vertex * constraint) const;
 
-    // Filtering methods   
+    // Filtering methods
     void filterFSHist (VertexImage& image) const;
     void initFSFilter();
   };
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImage.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImage.cxx
index ff9e647a3db3..0b9c63efc324 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImage.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImage.cxx
@@ -1,18 +1,17 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrkVertexSeedFinderUtils/VertexImage.h"
 #include "EventPrimitives/EventPrimitives.h"
-#include "fftw3.h"
 #include <cmath>
 #include <iostream>
 
 namespace Trk {
 
-  VertexImage::VertexImage( float* array,
+  VertexImage::VertexImage( double* array,
                             arrayDeleter* deleter,
-                            int nx, int ny, int nz, 
+                            int nx, int ny, int nz,
                             float xrange, float yrange, float zrange) :
     m_hist_3d(array),
     m_deleter(deleter),
@@ -49,21 +48,21 @@ namespace Trk {
 
   // Find array indices of all bins adjacent to index
   std::vector<int> VertexImage::getAdjacentBins( int index ) const {
-    
+
     int x,y,z;
-    
+
     getInvRMBin( index, x,y,z );
-   
+
     std::vector<int> v;
-    
+
     if(x!=0) v.push_back(getRMBin( x-1, y, z));
     if(y!=0) v.push_back(getRMBin( x, y-1, z));
     if(z!=0) v.push_back(getRMBin( x, y, z-1));
-    
+
     if(x<m_nbinsx-1) v.push_back(getRMBin( x+1, y, z));
     if(y<m_nbinsy-1) v.push_back(getRMBin( x, y+1, z));
     if(z<m_nbinsz-1) v.push_back(getRMBin( x, y, z+1));
-    
+
     return v;
 
   }
@@ -90,7 +89,7 @@ namespace Trk {
           vret[z] += m_hist_3d[idx];
         }
       }
- 
+
     }
 
     return vret;
@@ -132,19 +131,19 @@ namespace Trk {
         double diffx = ((double) x+0.5) - meanx;
         //update mean x
         meanx += w*diffx/tot;
-        //update squared difference 
+        //update squared difference
         mx2 += w * diffx * (((double) x+0.5 ) - meanx);
-        
+
         //diff to last y mean
         double diffy = ((double) y+0.5) - meany;
         //update mean y
         meany += w*diffy/tot;
-        //update squared difference 
+        //update squared difference
         my2 += w * diffy * (((double) y +0.5) - meany);
-        
+
       }
     }
-    
+
     //If for some reason the total weight is 0 (empty histogram?), just project everything
     if( tot == 0 ) {
       return projectRectangleOnZ();
@@ -156,10 +155,10 @@ namespace Trk {
 
     //----------------------------------------
     //End 1 pass variant
-  
+
     // Project using any bin touched by n standard deviations:
-    // Cast bounds to int, add 1 to the max 
-    
+    // Cast bounds to int, add 1 to the max
+
     int xmin = meanx - sigmax*nsigmax;
     int xmax = meanx + sigmax*nsigmax + 1.;
 
@@ -197,7 +196,7 @@ namespace Trk {
     y = m_nbinsy/2;
     sigmax = m_nbinsx/2;
     sigmay = m_nbinsy/2;
-    
+
     float* hxy = new float[m_nbinsx*m_nbinsy];
     float sumPos = 0.0;
     int nPos = 0;
@@ -307,7 +306,7 @@ namespace Trk {
     double sigmay2 = -1/(2*sol[1]);
     double mux = sol[2] * sigmax2;
     double muy = sol[3] * sigmay2;
-    
+
     if (sigmax2 > 0 && sigmay2 > 0) {
       sigmax = (float) sqrt(sigmax2);
       sigmay = (float) sqrt(sigmay2);
@@ -337,7 +336,7 @@ namespace Trk {
 	  totalWeight += gauss;
         }
       }
-      vret[z] /= totalWeight; 
+      vret[z] /= totalWeight;
     }
 
     return vret;
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImageMaker.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImageMaker.cxx
index 7b844102fd3d..7b61ebe4003a 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImageMaker.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImageMaker.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrkVertexSeedFinderUtils/VertexImageMaker.h"
@@ -11,11 +11,11 @@ namespace Trk
 
   VertexImageMaker::VertexImageMaker(const std::string& t, const std::string& n, const IInterface*  p) :
     base_class(t,n,p),
-    m_xbins(                   32         ) , 
+    m_xbins(                   32         ) ,
     m_ybins(                   32         ) ,
-    m_zbins(                 2048         ) ,   
+    m_zbins(                 2048         ) ,
     m_xrange(                   2.0       ) ,
-    m_yrange(                   2.0       ) , 
+    m_yrange(                   2.0       ) ,
     m_zrange(                 200.0       ) ,
     m_a0Window(                 0.35875   ) ,
     m_a1Window(                 0.48829   ) ,
@@ -24,7 +24,7 @@ namespace Trk
     m_cutoffFreqDenominator_xy( 2         ) ,
     m_cutoffFreqDenominator_z(  1         ) ,
     m_angularCutoffParameter(   0.75      ) ,
-    m_wx(0.0f), m_wy(0.0f), m_wz(0.0f), m_filttot(0), 
+    m_wx(0.0f), m_wy(0.0f), m_wz(0.0f), m_filttot(0),
     m_plan_r2c(nullptr), m_plan_c2r(nullptr)	          {
 
     declareProperty("xbins"                   , m_xbins                    );
@@ -45,7 +45,7 @@ namespace Trk
 
 
   StatusCode VertexImageMaker::initialize() {
-    
+
     //Calculate binwidths
     m_wx = 2*m_xrange/((float) m_xbins);
     m_wy = 2*m_yrange/((float) m_ybins);
@@ -59,15 +59,15 @@ namespace Trk
 
     //Allocate memory to histogram (used for both real and freq space)
     ATH_MSG_INFO( "Allocating memory to fftw - Histogram size : " << m_xbins << " , " << m_ybins << " , " << m_zbins  );
-    float* histRS = (float*)fftwf_malloc( sizeof(float) * m_filttot * 2 );
+    double* histRS = static_cast<double*>(FFTW_MANGLE_DOUBLE(malloc)( sizeof(double) * m_filttot * 2 ));
     //Get a complex casted version for easier access to the freq space using same bin numbering
-    fftwf_complex* histFS = (fftwf_complex*) histRS;
+    FFTW_MANGLE_DOUBLE(complex)* histFS = reinterpret_cast<FFTW_MANGLE_DOUBLE(complex)*>(histRS);
 
     ATH_MSG_INFO( "Setting up FFTW plans"  );
-    m_plan_r2c = fftwf_plan_dft_r2c_3d(m_xbins, m_ybins, m_zbins, histRS, histFS, FFTW_MEASURE);
-    m_plan_c2r = fftwf_plan_dft_c2r_3d(m_xbins, m_ybins, m_zbins, histFS, histRS, FFTW_MEASURE);
+    m_plan_r2c = FFTW_MANGLE_DOUBLE(plan_dft_r2c_3d)(m_xbins, m_ybins, m_zbins, histRS, histFS, FFTW_MEASURE);
+    m_plan_c2r = FFTW_MANGLE_DOUBLE(plan_dft_c2r_3d)(m_xbins, m_ybins, m_zbins, histFS, histRS, FFTW_MEASURE);
 
-    fftwf_free( histRS );
+    FFTW_MANGLE_DOUBLE(free)( histRS );
 
 
     return StatusCode::SUCCESS;
@@ -75,12 +75,12 @@ namespace Trk
   }// End initialize
 
 
-  StatusCode VertexImageMaker::finalize() 
+  StatusCode VertexImageMaker::finalize()
   {
 
-    fftwf_destroy_plan(m_plan_r2c);
-    fftwf_destroy_plan(m_plan_c2r);
-    fftwf_cleanup();
+    FFTW_MANGLE_DOUBLE(destroy_plan)(m_plan_r2c);
+    FFTW_MANGLE_DOUBLE(destroy_plan)(m_plan_c2r);
+    FFTW_MANGLE_DOUBLE(cleanup)();
 
     ATH_MSG_INFO( "Finalize ImageingSeedFinder successful"  );
 
@@ -92,10 +92,10 @@ namespace Trk
   VertexImageMaker::makeVertexImage( const std::vector<const Trk::TrackParameters*>& parametersList,
                                      const xAOD::Vertex * constraint ) const
   {
-    float* histRS = (float*)fftwf_malloc( sizeof(float) * m_filttot * 2 );
-    fftwf_complex* histFS = (fftwf_complex*) histRS;
+    double* histRS = static_cast<double*>(FFTW_MANGLE_DOUBLE(malloc)( sizeof(double) * m_filttot * 2 ));
+    FFTW_MANGLE_DOUBLE(complex)* histFS = reinterpret_cast<FFTW_MANGLE_DOUBLE(complex)*>(histRS);
 
-    auto image = std::make_unique<VertexImage> (histRS, fftwf_free,
+    auto image = std::make_unique<VertexImage> (histRS, FFTW_MANGLE_DOUBLE(free),
                                                 m_xbins, m_ybins, m_zbins,
                                                 m_xrange, m_yrange, m_zrange);
 
@@ -105,14 +105,14 @@ namespace Trk
 
     //Forward transform
     ATH_MSG_DEBUG("R2C Fourier ..."  );
-    fftwf_execute_dft_r2c ( m_plan_r2c, histRS, histFS );
+    FFTW_MANGLE_DOUBLE(execute_dft_r2c) ( m_plan_r2c, histRS, histFS );
 
     ATH_MSG_DEBUG("Filtering ..."  );
     filterFSHist (*image);
 
     //back transform
     ATH_MSG_DEBUG("C2R Fourier"  );
-    fftwf_execute_dft_c2r ( m_plan_c2r, histFS, histRS );
+    FFTW_MANGLE_DOUBLE(execute_dft_c2r) ( m_plan_c2r, histFS, histRS );
 
     return image;
   }
@@ -146,8 +146,8 @@ namespace Trk
       z_max += constraint->position().z();
     }
 
-    float* histRS = image.getHist();
-    
+    double* histRS = image.getHist();
+
     //Resetting histogram
     for ( int iBin=0; iBin<m_filttot*2/*m_binstot*/; iBin++){
 	histRS[iBin] = 0.0;
@@ -158,11 +158,11 @@ namespace Trk
       //get parametric linearization of track first with t=0 at point given by track parameters (doesn't really matter where it is)
 
       //position
-      float x = par->position()[Trk::x]; 
+      float x = par->position()[Trk::x];
       float y = par->position()[Trk::y];
-      float z = par->position()[Trk::z]; 
+      float z = par->position()[Trk::z];
 
-      //3d slope of track is 
+      //3d slope of track is
       // | sinTheta*cosPhi |
       // | sinTheta*sinPhi |
       // |     cosTheta    |
@@ -195,7 +195,7 @@ namespace Trk
       float tMaxX = 0.0;
       float tMaxY = 0.0;
       float tMaxZ = 0.0;
-      
+
       //keep track of current value of t -- used to calculate path length in a bin
       float tcurr = 0.0;
 
@@ -206,10 +206,10 @@ namespace Trk
       float t[6] = {
         ( x_min - x )/(stcp),
         ( x_max - x )/(stcp),
-        
+
         ( y_min - y )/(stsp),
         ( y_max - y )/(stsp),
-        
+
         ( z_min - z )/(ct),
         ( z_max - z )/(ct)
       };
@@ -219,7 +219,7 @@ namespace Trk
       std::sort( t, t+6);
       bool fail = true;
       for(int i=0; i<6; ++i) {
-        
+
         float xcurr = x + t[i]*stcp;
         float ycurr = y + t[i]*stsp;
         float zcurr = z + t[i]*ct;
@@ -265,7 +265,7 @@ namespace Trk
       }
       if(fail) //miss box entirely so don't use this track
         continue;
-      
+
       //loop bins until we leave the box
       while( xbin>=0 && xbin< m_xbins &&
 	     ybin>=0 && ybin< m_ybins &&
@@ -313,7 +313,7 @@ namespace Trk
 
     const int cutx = (m_xbins/2)/m_cutoffFreqDenominator_xy;
     const int cuty = (m_ybins/2)/m_cutoffFreqDenominator_xy;
-    const int cutz = (m_zbins/2)/m_cutoffFreqDenominator_z; 
+    const int cutz = (m_zbins/2)/m_cutoffFreqDenominator_z;
 
     for(int ifilt=0; ifilt<m_filttot; ifilt++) {
 
@@ -334,7 +334,7 @@ namespace Trk
       float u3 = (1/m_wz)*((float) z)/((float) m_zbins);
 
       //limited acceptance filter
-      
+
       float magu = sqrt(u1*u1 + u2*u2 + u3*u3);
       //either choice for magu=0 gives the same filter
       float cosPsi = (magu>0) ? fabs(u3/magu)            : 1;
@@ -349,7 +349,7 @@ namespace Trk
       float denx = ((float) m_xbins)/m_cutoffFreqDenominator_xy;
       float deny = ((float) m_ybins)/m_cutoffFreqDenominator_xy;
       float denz = ((float) m_zbins)/m_cutoffFreqDenominator_z;
-      
+
       float rx =  ((float) x)/(denx);
       float ry =  ((float) y)/(deny);
       float rz =  ((float) z)/(denz);
@@ -367,8 +367,8 @@ namespace Trk
   // Filter frequency space histogram
   void VertexImageMaker::filterFSHist (VertexImage& image) const
   {
-    fftwf_complex* histFS = (fftwf_complex*) image.getHist();
-    
+    FFTW_MANGLE_DOUBLE(complex)* histFS = reinterpret_cast<FFTW_MANGLE_DOUBLE(complex)*>(image.getHist());
+
     for(int ifilt=0; ifilt<m_filttot; ifilt++) {
       histFS[ifilt][0] *= m_histFSFilter[ifilt];
       histFS[ifilt][1] *= m_histFSFilter[ifilt];
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx
index 906dac6f629d..4f8194532e1b 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx
@@ -24,9 +24,6 @@
 #include <cmath>
 
 
-// Can't link against these --- they're in a component library.
-#include "../src/GaussianTrackDensity.cxx"
-
 
 using Gaudi::Units::mm;
 using Gaudi::Units::MeV;
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx
index 34021067c68e..1a386089faeb 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx
@@ -24,10 +24,6 @@
 #include <cmath>
 
 
-// Can't link against these --- they're in a component library.
-#include "../src/Mode3dFromFsmw1dFinder.cxx"
-
-
 using Gaudi::Units::mm;
 using Gaudi::Units::MeV;
 using Gaudi::Units::GeV;
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx
index 2ef92b689398..5d6303bde35a 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx
@@ -24,10 +24,6 @@
 #include <cmath>
 
 
-// Can't link against these --- they're in a component library.
-#include "../src/Mode3dTo1dFinder.cxx"
-
-
 using Gaudi::Units::mm;
 using Gaudi::Units::MeV;
 using Gaudi::Units::GeV;
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx
index be7fb26d3caf..d1e5860f65ca 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx
@@ -37,10 +37,6 @@
 #include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 #include "MagFieldElements/AtlasFieldCache.h"
 
-// Can't link against these --- they're in a component library.
-#include "../src/NewtonTrkDistanceFinder.cxx"
-#include "../src/PointOnTrack.cxx"
-
 
 void assertVec3D (const Amg::Vector3D& a, const Amg::Vector3D& b)
 {
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx
index c8a99749a08f..09d6a2a834fa 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx
@@ -25,12 +25,6 @@
 #include <cmath>
 
 
-// Can't link against these --- they're in a component library.
-#include "../src/SimpleVertexClusterFinder.cxx"
-#include "../src/VertexImageMaker.cxx"
-#include "../src/VertexImage.cxx"
-
-
 using Gaudi::Units::mm;
 using Gaudi::Units::MeV;
 using Gaudi::Units::GeV;
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx
index c44be7730464..5922cc75224b 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx
@@ -23,11 +23,6 @@
 #include <cassert>
 #include <cmath>
 
-// Can't link against these --- they're in a component library.
-#include "../src/Trk2dDistanceSeeder.cxx"
-#include "../src/PointOnTrack.cxx"
-#include "../src/TwoTracks.cxx"
-
 // for the field map
 #include "PathResolver/PathResolver.h"
 #include "TFile.h"
diff --git a/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigHolderStructure.h b/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigHolderStructure.h
index 66e02d07febb..7ee305780887 100644
--- a/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigHolderStructure.h
+++ b/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigHolderStructure.h
@@ -1,12 +1,13 @@
 // Emacs -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRIGNAVSTRUCTURE_TRIGHOLDERSTRUCTURE
 #define TRIGNAVSTRUCTURE_TRIGHOLDERSTRUCTURE
 #include <map>
+#include <memory>
 #include <string>
 
 #include <boost/variant.hpp>
@@ -20,23 +21,23 @@ namespace HLT{
   class TrigHolderStructure : public asg::AsgMessaging {
   public:
     TrigHolderStructure();
- 
+
     void reset();
-    
+
     bool registerHolder(const std::shared_ptr<BaseHolder>& holder);
-    
+
     template<typename HolderType = BaseHolder>
-    HolderType* getHolder(class_id_type clid, const boost::variant<sub_index_type,std::string>& stiOrLabel) const {    
+    HolderType* getHolder(class_id_type clid, const boost::variant<sub_index_type,std::string>& stiOrLabel) const {
       return getCastHolder<HolderType>(getBaseHolder(clid,getSubTypeIndex(clid,stiOrLabel)));
     }
 
     template<typename HolderType = BaseHolder>
-    HolderType* getHolderForFeature(const TriggerElement::FeatureAccessHelper& fea) const {    
+    HolderType* getHolderForFeature(const TriggerElement::FeatureAccessHelper& fea) const {
       return getCastHolder<HolderType>(getBaseHolder(fea.getCLID(),fea.getIndex().subTypeIndex()));
     }
-    
+
     template<typename HolderType = BaseHolder>
-    std::vector<HolderType*> getAllHolders() const {    
+    std::vector<HolderType*> getAllHolders() const {
       std::vector<HolderType*> result;
       for(auto& clid_indexmap : m_holderByClidAndIndex){
 	for(auto& index_holder : clid_indexmap.second){
@@ -53,7 +54,7 @@ namespace HLT{
       if(lookup_it == m_holderByClidAndIndex.end()) return result;
 
       for(auto& index_holder : lookup_it->second){
-	result.push_back(getCastHolder<HolderType>(index_holder.second.get()));	
+	result.push_back(getCastHolder<HolderType>(index_holder.second.get()));
       }
       return result;
     }
@@ -67,7 +68,7 @@ namespace HLT{
 
       auto lookup_it = m_lookupSubIndex.find(clid);
       if(lookup_it == m_lookupSubIndex.end()) return invalid_sub_index;
-      
+
       auto it = lookup_it->second.find(boost::get<std::string>(stiOrLabel));
       if(it==lookup_it->second.end()) return invalid_sub_index;
 
@@ -84,14 +85,14 @@ namespace HLT{
 
       auto lookup_it = m_lookupLabels.find(clid);
       if(lookup_it == m_lookupLabels.end()) return invalid_label;
-      
+
       auto it = lookup_it->second.find(boost::get<sub_index_type>(stiOrLabel));
       if(it==lookup_it->second.end()) return invalid_label;
 
       return  it->second;
     }
 
-    
+
   private:
 
     BaseHolder* getBaseHolder(class_id_type clid,sub_index_type sti) const;
-- 
GitLab


From 05f3f488e2eb5d52ffc12b765cd250adf1251ff2 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Fri, 18 Sep 2020 23:27:34 +0200
Subject: [PATCH 266/422] added missing paramter in TauWPDecoratorEleRNN

---
 Reconstruction/tauRec/python/TauAlgorithmsHolder.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
index a51d944360e5..b289f3a285b0 100644
--- a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
+++ b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
@@ -961,6 +961,7 @@ def getTauWPDecoratorEleRNN():
                                          ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNTight ],
                                        SigEff1P = [0.95, 0.90, 0.85],
                                        SigEff3P = [0.98, 0.95, 0.90],
+                                       UseEleBDT = True ,
                                        ScoreName = "RNNEleScore",
                                        NewScoreName = "RNNEleScoreSigTrans",
                                        DefineWPs = True,
-- 
GitLab


From 84b46ac0043da02d71ec01c5fac23dffa7652460 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Sat, 19 Sep 2020 00:03:31 +0200
Subject: [PATCH 267/422] Fixed segfault in building MuonGeoModel from a local
 amdb file

---
 MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb.h |  2 ++
 MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx  | 11 ++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb.h b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb.h
index a856709c32cc..14b6f95fd171 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb.h
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb.h
@@ -108,6 +108,8 @@ class AmdcDb final : public AthService, virtual public IRDBAccessSvcWithUpdate {
    std::vector<int>         m_ValFromRDBEpsLengthCM  ; //!< Control precision printing  
    std::vector<int>         m_ValFromRDBEpsAngle     ; //!< Control precision printing
    
+   IRDBRecordset_ptr m_emptyRecordset ; //!< Pointer on an empty Recordset
+
    ServiceHandle<AmdcsimrecAthenaSvc> p_AmdcsimrecAthenaSvc;  //!< Pointer On AmdcsimrecAthenaSvc
 
    //Db Keys
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx
index d5b99e55be78..98baf256284f 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx
@@ -21,6 +21,7 @@
 /// Standard Constructor
 AmdcDb::AmdcDb(const std::string& name,ISvcLocator* svc)
   : AthService(name,svc) 
+  , m_emptyRecordset(new AmdcDbRecordset())
   , p_AmdcsimrecAthenaSvc ( "AmdcsimrecAthenaSvc",name )
 {
   p_AmdcDbSvcFromAmdc = 0 ;
@@ -306,15 +307,15 @@ IRDBRecordset_ptr AmdcDb::getRecordsetPtr(const std::string& node,
                                           const std::string& /*tag2node*/ ,
                                           const std::string& /*connName*/)
 {
-  IRDBRecordset_ptr pIRDBRecordset; 
   if(tag=="RDB") {
-    pIRDBRecordset = p_AmdcDbSvcFromRDB->getRecordset(node);
+    return p_AmdcDbSvcFromRDB->getRecordset(node);
   }
   else if(tag=="Amdc") {
-    pIRDBRecordset = p_AmdcDbSvcFromAmdc->getRecordset(node);
+    return p_AmdcDbSvcFromAmdc->getRecordset(node);
+  }
+  else {
+    return m_emptyRecordset;
   }
-
-  return pIRDBRecordset;
 }
 
 // Functions of IRDBAccessSvc Not implemented
-- 
GitLab


From 42a88d1d11745e9c62263c63ba059096eecd6c8f Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Fri, 18 Sep 2020 15:48:02 -0700
Subject: [PATCH 268/422] Typo in name

---
 .../TrackVertexAssociationTool/MVATrackVertexAssociationTool.h  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
index 3dabf1dda4f9..ac99838d920a 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
@@ -72,7 +72,7 @@ private:
   StringProperty m_fileName {this, "NetworkFileName", "", "Name of the input lwtnn network file."};
 
   // Vector of input variable names
-  StringArrayProperty m_inputNames {this, "NetworkFileName", {}, "Vector of the network's input variable names (std::vector<std::string>)."};
+  StringArrayProperty m_inputNames {this, "InputNames", {}, "Vector of the network's input variable names (std::vector<std::string>)."};
 
   // Vector of input variable types
   IntegerArrayProperty m_inputTypes {this, "InputTypes", {}, "Vector of the network's input variable evaluator types (std::vector<CP::MVAEvaluatorInput::Input>)."};
-- 
GitLab


From f9bddc0886731bdffb9244f6ab85260669513fd9 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 18 Sep 2020 19:56:15 +0200
Subject: [PATCH 269/422] PyDumper: Fix nullptr handling.

Don't fail if JetAssociationBase or Muon are not available.
cf ATLASSIM-4772
---
 Event/PyDumper/python/Dumpers.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Event/PyDumper/python/Dumpers.py b/Event/PyDumper/python/Dumpers.py
index 21f328527e0f..df924f27a2fb 100644
--- a/Event/PyDumper/python/Dumpers.py
+++ b/Event/PyDumper/python/Dumpers.py
@@ -44,8 +44,10 @@ getattr (ROOT.xAOD, 'TrackParticleContainer_v1', None)
 getattr (ROOT.xAOD, 'Jet_v1', None)
 
 #Typed nullptr:
-jetAssocNull=cppyy.bind_object(cppyy.nullptr,cppyy.gbl.JetAssociationBase)
-muonNull=cppyy.bind_object(cppyy.nullptr,cppyy.gbl.Analysis.Muon)
+JetAssociationBase = getattr (cppyy.gbl, 'JetAssociationBase', None)
+Muon = getattr (cppyy.gbl, 'Muon', None)
+jetAssocNull = cppyy.bind_object(cppyy.nullptr, JetAssociationBase) if JetAssociationBase else None
+muonNull = cppyy.bind_object(cppyy.nullptr, Muon) if Muon else None
 
 
 # Work around a cling bug.
-- 
GitLab


From 9f62698f6f5f5cac1887e43902d24b274c5970d9 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 5 Sep 2020 17:30:22 -0400
Subject: [PATCH 270/422] GeoModelUtilities: Fix cppcheck warnings.

Pass class instances by const reference, not value.
Prefer preincrement to postincrement.
---
 .../GeoModelUtilities/GeoModelUtilities/GeoBorderSurface.h    | 4 ++--
 .../GeoModel/GeoModelUtilities/src/GeoBorderSurface.cxx       | 4 ++--
 .../GeoModelUtilities/src/GeoMaterialPropertiesTable.cxx      | 4 ++--
 .../GeoModel/GeoModelUtilities/src/GeoModelExperiment.cxx     | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurface.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurface.h
index 12bf856954db..932296603fe7 100644
--- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurface.h
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurface.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GeoBorderSurface_h
@@ -13,7 +13,7 @@ class GeoOpticalSurface;
 class GeoBorderSurface 
 {
  public:
-  GeoBorderSurface(std::string name,
+  GeoBorderSurface(const std::string& name,
 		   GeoOpticalPhysVol* pv1,
 		   GeoOpticalPhysVol* pv2,
 		   GeoOpticalSurface* opticalSurface);
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoBorderSurface.cxx b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoBorderSurface.cxx
index 746570e8c4f2..adcac3a7dd72 100644
--- a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoBorderSurface.cxx
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoBorderSurface.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "GeoModelUtilities/GeoBorderSurface.h"
@@ -8,7 +8,7 @@
 
 #include <exception>
 
-GeoBorderSurface::GeoBorderSurface(std::string name,
+GeoBorderSurface::GeoBorderSurface(const std::string& name,
 				   GeoOpticalPhysVol* pv1,
 				   GeoOpticalPhysVol* pv2,
 				   GeoOpticalSurface* opticalSurface):
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoMaterialPropertiesTable.cxx b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoMaterialPropertiesTable.cxx
index 6f08401d0486..5e902c5c3e15 100644
--- a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoMaterialPropertiesTable.cxx
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoMaterialPropertiesTable.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "GeoModelUtilities/GeoMaterialPropertiesTable.h"
@@ -89,7 +89,7 @@ GeoMaterialPropertiesTable::GeoMatPMap_ConstIt GeoMaterialPropertiesTable::endPM
 
 void GeoMaterialPropertiesTable::DumpTable() const
 {
-  for(GeoMatPVMap_ConstIt i=m_MPT.begin(); i!=m_MPT.end(); i++) 
+  for(GeoMatPVMap_ConstIt i=m_MPT.begin(); i!=m_MPT.end(); ++i) 
   {
     std::cout << (*i).first << "\n";
     if((*i).second != 0)
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelExperiment.cxx b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelExperiment.cxx
index 69c4a0fc21e3..0357f770867b 100755
--- a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelExperiment.cxx
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelExperiment.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "GeoModelUtilities/GeoModelExperiment.h"
@@ -23,7 +23,7 @@ GeoModelExperiment::GeoModelExperiment( GeoPhysVol * physVol )
 GeoModelExperiment::~GeoModelExperiment()  {
   // Unref all temporary volumes
   std::vector<GeoPhysVol*>::iterator it = m_tmpVolumes.begin();
-  for(; it!=m_tmpVolumes.end(); it++) 
+  for(; it!=m_tmpVolumes.end(); ++it) 
     (*it)->unref();
 
   m_physVol->unref();
-- 
GitLab


From 60c7bd1e98bd5c923e51da909d038cf79f36e46a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 12 Sep 2020 20:22:44 -0400
Subject: [PATCH 271/422] LArRawEvent: Fix cppcheck warnings.

 - Pass class instances by const reference, not by value.
 - Signed/unsigned fix.
 - Unused private data member.
---
 .../LArRawEvent/LArRawEvent/LArAccumulatedDigit.h  |  8 +++++---
 .../LArRawEvent/LArAccumulatedDigitContainer.h     |  4 +---
 LArCalorimeter/LArRawEvent/LArRawEvent/LArDigit.h  |  4 ++--
 .../LArRawEvent/LArRawEvent/LArFebHeader.h         |  4 ++--
 .../LArRawEvent/LArRawEvent/LArRawChannel.h        |  9 +++++++--
 .../LArRawEvent/src/LArAccumulatedDigit.cxx        | 14 ++++++++------
 .../src/LArAccumulatedDigitContainer.cxx           |  4 ++--
 LArCalorimeter/LArRawEvent/src/LArDigit.cxx        |  4 ++--
 .../LArRawEvent/src/LArDigitContainer.cxx          |  4 ++--
 LArCalorimeter/LArRawEvent/src/LArFebHeader.cxx    |  6 +++---
 10 files changed, 34 insertions(+), 27 deletions(-)

diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigit.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigit.h
index 667e24ee8d1f..3a3b72c496ee 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigit.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigit.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -102,8 +102,10 @@ public:
 
 
   /** @brief Accumulate new values  */
-  bool setAddSubStep(const CaloGain::CaloGain gain_value, const HWIdentifier chid, 
-		     const std::vector<uint64_t> sampleSum, const std::vector <uint64_t> sampleSquare, 
+  bool setAddSubStep(const CaloGain::CaloGain gain_value,
+                     const HWIdentifier chid, 
+		     const std::vector<uint64_t>& sampleSum,
+                     const std::vector <uint64_t>& sampleSquare, 
 		     const unsigned nTrigger);
 
   void setAddSubStep(CaloGain::CaloGain gain_value, std::vector<uint32_t> sampleSum, 
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigitContainer.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigitContainer.h
index edf1bef9d175..f81541587bfb 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigitContainer.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigitContainer.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /** 
@@ -34,8 +34,6 @@ class LArAccumulatedDigitContainer : public DataVector<LArAccumulatedDigit> {
   inline int isLastStep() const { return (m_StepIndex==m_NStep-1); }
   //private:    
 
-  /** @brief SG ownership policy  */
-  SG::OwnershipPolicy  m_ownPolicy ;
   unsigned int m_NStep, m_StepIndex;
 };
 
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArDigit.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArDigit.h
index e7664a36caa6..d1c0888805ba 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArDigit.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArDigit.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef LARDIGIT_H
@@ -73,7 +73,7 @@ class LArDigit  {
     /** @brief Set new digits in object.
         @param[in] samples  vector of ADC time samples
     */
-    void setSamples( std::vector < short > samples);
+    void setSamples( const std::vector < short >& samples);
 
     /** @brief Destructor */
     virtual ~LArDigit() { }
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebHeader.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebHeader.h
index 093bd614bbed..8964dd43f6a5 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebHeader.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebHeader.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef LARFEBHEADER_H
@@ -184,7 +184,7 @@ class LArFebHeader
  private:
 
   /** @brief like explained in: http://mathworld.wolfram.com/GrayCode.html */
-  int degray(int x);
+  int degray(unsigned int x);
 
   /** @brief Feb Identifier */
   const HWIdentifier m_FEBId;  
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawChannel.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawChannel.h
index d824feebd254..9ed675d01072 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawChannel.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawChannel.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef LArRawChannel_H
@@ -140,6 +140,7 @@ LArRawChannel::LArRawChannel( HWIdentifier chan_id,
         m_time(time), 
         m_gain(gain)
 { m_qualProv[0] = quality;
+  // cppcheck-suppress objectIndex
   m_qualProv[1] = provenance;
 } 
 
@@ -169,7 +170,11 @@ LArRawChannel::quality() const { return m_qualProv[0]; }
 
 inline
 uint16_t
-LArRawChannel::provenance() const { return m_qualProv[1]; }
+LArRawChannel::provenance() const
+{
+  // cppcheck-suppress objectIndex
+  return m_qualProv[1];
+}
 
 inline
 CaloGain::CaloGain 
diff --git a/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigit.cxx b/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigit.cxx
index 5fb170c11cca..c2be80ae14dc 100755
--- a/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigit.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigit.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArRawEvent/LArAccumulatedDigit.h"
@@ -32,10 +32,10 @@ LArAccumulatedDigit::LArAccumulatedDigit(HWIdentifier & channel_value,
 
   /** @brief Constructor (second type)*/      
 LArAccumulatedDigit::LArAccumulatedDigit(HWIdentifier & channel_value)
+  : m_hardwareID (channel_value),
+    m_gain       ((CaloGain::CaloGain) 0),
+    m_nTrigger   (0)
 {
-  m_hardwareID = channel_value;
-  m_gain       = (CaloGain::CaloGain) 0;
-  m_nTrigger   = 0;
 }
 
 /** Destructor */
@@ -114,8 +114,10 @@ bool LArAccumulatedDigit::setAddDigit(const std::vector<short>& digit) {
 
 
 
-bool LArAccumulatedDigit::setAddSubStep(const CaloGain::CaloGain gain_value, const HWIdentifier chid, 
-					const std::vector<uint64_t> sampleSum, const std::vector <uint64_t> sampleSquare, 
+bool LArAccumulatedDigit::setAddSubStep(const CaloGain::CaloGain gain_value,
+                                        const HWIdentifier chid, 
+					const std::vector<uint64_t>& sampleSum,
+                                        const std::vector <uint64_t>& sampleSquare, 
 					const unsigned nTrigger)
 {
   size_t i;
diff --git a/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigitContainer.cxx b/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigitContainer.cxx
index 08ff2f4147bc..e7568c99acc5 100755
--- a/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigitContainer.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigitContainer.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArRawEvent/LArAccumulatedDigitContainer.h" 
@@ -7,7 +7,7 @@
 
 LArAccumulatedDigitContainer::LArAccumulatedDigitContainer(SG::OwnershipPolicy ownPolicy ) : 
   DataVector<LArAccumulatedDigit>(ownPolicy),
-  m_ownPolicy(ownPolicy),m_NStep(0),m_StepIndex(0)
+  m_NStep(0),m_StepIndex(0)
 {}
 
 LArAccumulatedDigitContainer::~LArAccumulatedDigitContainer() 
diff --git a/LArCalorimeter/LArRawEvent/src/LArDigit.cxx b/LArCalorimeter/LArRawEvent/src/LArDigit.cxx
index 93ba0440e634..e40b05335265 100755
--- a/LArCalorimeter/LArRawEvent/src/LArDigit.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArDigit.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <typeinfo>
@@ -68,7 +68,7 @@ LArDigit::operator std::string() const{
 }
 
 // set method
-void LArDigit::setSamples(std::vector<short> samples)
+void LArDigit::setSamples(const std::vector<short>& samples)
 {
   m_samples.clear();
   m_samples = samples;
diff --git a/LArCalorimeter/LArRawEvent/src/LArDigitContainer.cxx b/LArCalorimeter/LArRawEvent/src/LArDigitContainer.cxx
index 4280c8bbd869..12e82b09fd1c 100755
--- a/LArCalorimeter/LArRawEvent/src/LArDigitContainer.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArDigitContainer.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArRawEvent/LArDigitContainer.h"
@@ -27,7 +27,7 @@ LArDigitContainer::operator std::string () const {
  int counter = 0 ;
  const LArDigit * digit ;    
  
-     for(it = this->begin() ; it != this->end() ; it++ ){ // Loop over Hits
+     for(it = this->begin() ; it != this->end() ; ++it ){ // Loop over Hits
      
        digit = *it ;
              
diff --git a/LArCalorimeter/LArRawEvent/src/LArFebHeader.cxx b/LArCalorimeter/LArRawEvent/src/LArFebHeader.cxx
index 222a9ed5b707..6a5220183aa4 100755
--- a/LArCalorimeter/LArRawEvent/src/LArFebHeader.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArFebHeader.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArRawEvent/LArFebHeader.h"
@@ -35,7 +35,7 @@ LArFebHeader::LArFebHeader(const HWIdentifier febid):m_FEBId(febid) {
 LArFebHeader::~LArFebHeader() 
 {}
 
-int LArFebHeader::degray(int x)
+int LArFebHeader::degray(unsigned int x)
 { // like explained in: http://mathworld.wolfram.com/GrayCode.html
 
   int i,j,sum;
@@ -62,7 +62,7 @@ int LArFebHeader::degray(int x)
               else
                 tmp1 = 0;
               if (i>0)
-                tmp2 = x & ((1<<i)-1);
+                tmp2 = x & ((1u<<i)-1);
               //    printf("tmp1 =%x tmp2=%x\n",tmp1,tmp2 );
 
               x=tmp1|tmp2;
-- 
GitLab


From b431d6c2012f2bd039f28d00ae3299b6b9dc2dc4 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 12 Sep 2020 20:31:39 -0400
Subject: [PATCH 272/422] CaloSimEvent; Fix cppcheck warnings.

 - Prefer using an initializer list to assigning members
   in a ctor body.
 - Prefer preincrement (or range for) to postincrement for iterators.
---
 .../CaloSimEvent/CaloSimEvent/CaloCalibrationHit.h | 14 +++++++-------
 .../src/CaloCalibrationHitContainer.cxx            |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHit.h b/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHit.h
index 50b7b0a469f3..12c292b10784 100755
--- a/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHit.h
+++ b/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHit.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // CaloCalibrationHit
@@ -75,13 +75,13 @@ class CaloCalibrationHit
 
   /** Copy constructor **/
   CaloCalibrationHit(const CaloCalibrationHit &cchSource)
+    : m_ID (cchSource.m_ID),
+      m_energy0 (cchSource.m_energy0),
+      m_energy1 (cchSource.m_energy1),
+      m_energy2 (cchSource.m_energy2),
+      m_energy3 (cchSource.m_energy3),
+      m_particleID (cchSource.m_particleID)
   {
-    m_ID = cchSource.m_ID;
-    m_energy0 = cchSource.m_energy0;
-    m_energy1 = cchSource.m_energy1;
-    m_energy2 = cchSource.m_energy2;
-    m_energy3 = cchSource.m_energy3;
-    m_particleID = cchSource.m_particleID;
   }
 
   /** Assignment operator **/
diff --git a/Calorimeter/CaloSimEvent/src/CaloCalibrationHitContainer.cxx b/Calorimeter/CaloSimEvent/src/CaloCalibrationHitContainer.cxx
index 4f4302493a38..ed516d887829 100755
--- a/Calorimeter/CaloSimEvent/src/CaloCalibrationHitContainer.cxx
+++ b/Calorimeter/CaloSimEvent/src/CaloCalibrationHitContainer.cxx
@@ -38,7 +38,7 @@ CaloCalibrationHitContainer::operator std::string () const
  int counter = 0 ;
  CaloCalibrationHit * hit ;    
  
-     for(it = this->begin() ; it != this->end() ; it++ ){ // Loop over Hits
+     for(it = this->begin() ; it != this->end() ; ++it ){ // Loop over Hits
      
        hit = *it ;
              
-- 
GitLab


From 2f7d171c7124bad072ed0f3ed45f889bbae6ad09 Mon Sep 17 00:00:00 2001
From: Edward Moyse <edward.moyse@cern.ch>
Date: Sat, 19 Sep 2020 09:31:25 +0200
Subject: [PATCH 273/422] Revert some changes which are permitted.

---
 .../SiSpacePointsSeedMakerEventData.h         |  6 ++--
 .../src/SiSpacePointsSeedMaker_ATLxk.cxx      | 28 +++++++++----------
 .../Root/TrackVertexAssociationTool.cxx       |  2 +-
 .../BaseTrackVertexAssociationTool.h          |  4 +--
 .../TrackVertexAssociationTool.h              |  2 +-
 .../xAOD/TopFakes/Root/FakesWeights.cxx       | 12 ++++----
 .../src/EnergyLossSamplerBetheHeitler.cxx     |  4 +--
 ...ultipleScatteringSamplerGeneralMixture.cxx |  4 +--
 .../MultipleScatteringSamplerGeneralMixture.h |  2 +-
 .../src/GeoShapeConverter.cxx                 |  2 +-
 .../src/TrigT1CaloTauFex.cxx                  |  2 +-
 11 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointsSeedMakerEventData.h b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointsSeedMakerEventData.h
index e903727ef0ee..b036fdd90f65 100644
--- a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointsSeedMakerEventData.h
+++ b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointsSeedMakerEventData.h
@@ -87,7 +87,7 @@ namespace InDet {
     float dzdrmin{0.};    //<! store eta cuts interpreted as dz/dr 
     float dzdrmax{0.};    //<! store eta cuts interpreted as dz/dr 
     float ipt2C{0.};  ///< inverse of 90% of the pt cut, squared, multiplied by a magic conversion factor 
-    float ipt2K{0.};  ///< 1 / (K * 0.9 * pt cut)^2, allows us to directly apply our pt cut on the (2R)^2 estimate we obtain from the seed
+    float ipt2K{0.};  ///< 1 / (K * 0.9 * pt cut)², allows us to directly apply our pt cut on the (2R)² estimate we obtain from the seed
     float COFK{0.};   ///< a magic number 
     float zminU{0.};
     float zmaxU{0.};
@@ -131,8 +131,8 @@ namespace InDet {
     std::vector<float> Zo;    ///< z0 estimate from 2 points
     std::vector<float> Tz;    ///< 1/tan(theta) == dz/dr estimate from 2 points
     std::vector<float> R;     ///< inverse distance to the central space point 
-    std::vector<float> U;     ///< transformed U coordinate (x/(x^2+y^2)) in frame around central SP 
-    std::vector<float> V;     ///< transformed V coordinate (y/(x^2+y^2)) in frame around central SP 
+    std::vector<float> U;     ///< transformed U coordinate (x/(x²+y²)) in frame around central SP 
+    std::vector<float> V;     ///< transformed V coordinate (y/(x²+y²)) in frame around central SP 
     std::vector<float> X;
     std::vector<float> Y;
     std::vector<float> Er;    ///< error component on 1/tan(theta)==dz/dr from the position errors on the space-points
diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
index 29da598b26ba..9c5bbb9b71ed 100644
--- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
+++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
@@ -123,7 +123,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newEvent(const EventContext& ctx, Even
       * allows to set the circle-radius to pT conversion factor.
       * 
       * See for example ATLAS-CONF-2010-072 
-      * R[mm] =pT[GeV] / (3*10^-4*B[T]) =  pT[MeV] / (300 *Bz[kT])
+      * R[mm] =pT[GeV] / (3·10−4×B[T]) =  pT[MeV] / (300 *Bz[kT])
       * 
       * We actually estimate the circle diameter, 2R, in the seeding. 
       * So what we want is: 2R = pT[MeV] x 2  / (300 x Bz) = K x pT[MeV]. 
@@ -134,7 +134,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newEvent(const EventContext& ctx, Even
     }
     /** helper variables allowing us to directly apply our pt cut on the variables
     * available at seed level. 
-    * ipt2K is 1 / (K * 0.9 * pt cut)^2 
+    * ipt2K is 1 / (K * 0.9 * pt cut)² 
     **/ 
     data.ipt2K = m_ipt2/(data.K*data.K);
     /// related to the mysterious magic number, m_COF{134*.05*9}
@@ -1884,9 +1884,9 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
       float  Erb  = data.Er[b];       ///< this is the uncertainty in 1/tanTheta on the bottom segment resulting from the position errors in the 2 SP
       float  Vb   = data.V [b];       ///< v-coordinate of bottom SP  
       float  Ub   = data.U [b];       ///< u-coordinate of bottom SP
-      float  Tzb2 = (1.+Tzb*Tzb);     ///< 1+1/tan^2theta - converts transverse to total squared pt
-      float sTzb2 = sqrt(Tzb2);       ///< sqrt (1+1/tan^2theta) - used to convert pt to |p|
-      float sigmaSquaredScatteringPtDependent  = Tzb2*COFK;        ///< this, when divided by the 2R^2, yields an approximated multiple scattering term assuming the measured pt. 
+      float  Tzb2 = (1.+Tzb*Tzb);     ///< 1+1/tan²theta - converts transverse to total squared pt
+      float sTzb2 = sqrt(Tzb2);       ///< sqrt (1+1/tan²theta) - used to convert pt to |p|
+      float sigmaSquaredScatteringPtDependent  = Tzb2*COFK;        ///< this, when divided by the 2R², yields an approximated multiple scattering term assuming the measured pt. 
       float sigmaSquaredScatteringMinPt  = Tzb2*ipt2C;       ///< this is an approximate worst case multiple scattering term assuming the lowest 
                                       ///  pt we allow and the estimated theta angle
       /// max IP
@@ -1916,7 +1916,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
         if (remainingSquaredDelta  - sigmaSquaredScatteringMinPt > 0 ) continue;    
 
         /** 
-        * The following exploits the transformation u:=x/(x^2+y^2); v:=y/(x^2+y^2); 
+        * The following exploits the transformation u:=x/(x²+y²); v:=y/(x²+y²); 
         * This is applied on the x,y coordinates in the frame described above, where the 
         * origin is put in the central SP and the x axis defined to point directly away from the IP.
         * 
@@ -1924,7 +1924,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
         * a linear function V = (-x0/y0) x U + 1/(2y0) =: A x U + B.
         * Here, x0 and y0 describe the center point of the circle in the x-y frame. 
         * As the origin of the x-y frame (the middle space point of our seed) is on the circle, 
-        * we have x0^2+y0^2=R^2 with circle radius R. 
+        * we have x0²+y0²=R² with circle radius R. 
         * 
         * For our seed, we can experimentally obtain A as the slope of the linear function, 
         * delta V / delta U, 
@@ -1933,8 +1933,8 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
         * B is then obtained by inserting the obtained A into the 
         * linear equation for the bottom SP, A x U + B = V --> B = V - A x U 
         * 
-        * With x0^2+y0^2=R^2, and x0=-A/2B and y0=1/2B, the radius of the circle is 
-        * then obtained as (2R)^2=(1+A^2)/B^2. 
+        * With x0²+y0²=R², and x0=-A/2B and y0=1/2B, the radius of the circle is 
+        * then obtained as (2R)²=(1+A²)/B². 
         **/ 
         float deltaU  = data.U[t]-Ub;
         if (deltaU == 0.) continue;       ///< delta U = 0 blocks the evaluation of A. 
@@ -1944,8 +1944,8 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
         float BSquare  = B*B;
 
         /** With this radius (and pT) estimate, we can apply our pt cut. 
-         * Reminder, ipt2K is 1 / (K x 0.9 x pt-cut)^2, where K translates pt into 2R. 
-         * So here we can apply the pt cut directly on the (2R)^2 estimate without
+         * Reminder, ipt2K is 1 / (K x 0.9 x pt-cut)², where K translates pt into 2R. 
+         * So here we can apply the pt cut directly on the (2R)² estimate without
          * the extra overhead of conversion / division.
          * The second check is a refinement of the above Tz compatibility cut,
          * replacing the sigmaSquaredScatteringMinPt scattering contribution which assumes the lowest pt 
@@ -1961,14 +1961,14 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
         * The reasoning is that, in the x-y frame with the central SP as origin and 
         * the x axis pointing away from the IP, we have for the distance between
         * the IP and the middle of the circle: 
-        * (x0 - r_central)^2+y0^2 = (R + d0)^2, 
+        * (x0 - r_central)²+y0² = (R + d0)², 
         * with R being the circle radius and r_central 
         * the radial location of the central SP, placing the IP at IP at (-r_central, 0). 
         * 
-        * First simplify using R^2 =x0^2+y0^2, then apply the approximation d0^2/R^2 ~ 0. 
+        * First simplify using R² =x0²+y0², then apply the approximation d0²/R² ~ 0. 
         * 
         * Finally, consider that locally close to the central SP, the circle is parallel to the x axis, 
-        * so A = 0 --> expand (2R)^2=(1+A^2)/B^2 around this point to obtain 
+        * so A = 0 --> expand (2R)²=(1+A²)/B² around this point to obtain 
         * d0 = r_central x (r_central x B - A). 
         * Note that below, the variable R is the radial coordinate fo the central SP, 
         * corresponding to r_central in the notation above. 
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx
index c9fa0f74cd81..3af91028a5cc 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/TrackVertexAssociationTool.cxx
@@ -236,7 +236,7 @@ TrackVertexAssociationTool::MatchStatus TrackVertexAssociationTool::isMatch(cons
   float trk_z0 = trk.z0();
   float beamspot_z0 = trk.vz();
   float theta = trk.theta();
-  // calculate deltaz * sin theta
+  // calculate Δz * sin θ
   dzSinTheta = fabs((trk_z0 - vx_z0 + beamspot_z0) * sin(theta));
 
   // If vertex fit information is flagged to be used,
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h
index 4f32a26b2e05..21035bd9f9c3 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h
@@ -60,7 +60,7 @@ public:
               const xAOD::VertexContainer &vxCont) const;
 
   /// Compares the track trk with each track in vx_list using isCompatible,
-  /// and returns the compatible track with the smallest delta z * sin theta.
+  /// and returns the compatible track with the smallest Δz * sin θ.
   const xAOD::Vertex *
   getUniqueMatchVertex(const xAOD::TrackParticle &trk,
                        std::vector<const xAOD::Vertex *> &vx_list) const;
@@ -87,7 +87,7 @@ private:
   SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo { this, "EventInfo", "EventInfo", "EventInfo key" };
 
   /// Checks if a track-vertex pair passes the cuts.  Returns
-  /// deltaz * sin theta of the pair in `dzSinTheta` if successful.
+  /// Δz * sin θ of the pair in `dzSinTheta` if successful.
   bool isMatch(const xAOD::TrackParticle &trk, const xAOD::Vertex &vx,
                float &dzSinTheta) const;
 
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationTool.h
index e833460dbd25..26f7e90c49c4 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationTool.h
@@ -64,7 +64,7 @@ namespace CP {
       SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo { this, "EventInfo", "EventInfo", "EventInfo key" };
 
       /// Checks if a track-vertex pair passes the cuts.  Returns
-      /// deltaz * sin theta of the pair in `dzSinTheta` if successful.
+      /// Δz * sin θ of the pair in `dzSinTheta` if successful.
       MatchStatus isMatch(const xAOD::TrackParticle &trk, const xAOD::Vertex &vx,
                    float &dzSinTheta) const;
 
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopFakes/Root/FakesWeights.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopFakes/Root/FakesWeights.cxx
index 8b2d3b113f0a..5d5a3222c876 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopFakes/Root/FakesWeights.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopFakes/Root/FakesWeights.cxx
@@ -134,15 +134,15 @@ void FakesWeights::SetupWeighter(int channel, std::string aReal, std::string aFa
   std::cout << "--------------------------------------------------------" << std::endl;
   std::cout << "  FakesWeights::INFO: Setting-up Matrix Method Weighter." << std::endl;
   if(channel==EJETS)  std::cout << "    channel:  e+jets" << std::endl;
-  if(channel==MUJETS) std::cout << "    channel:  mu+jets" << std::endl;
+  if(channel==MUJETS) std::cout << "    channel:  µ+jets" << std::endl;
   if(channel==EE)     std::cout << "    channel:  ee" << std::endl;
-  if(channel==MUMU)   std::cout << "    channel:  mumu" << std::endl;
-  if(channel==EMU)    std::cout << "    channel:  emu" << std::endl;
+  if(channel==MUMU)   std::cout << "    channel:  µµ" << std::endl;
+  if(channel==EMU)    std::cout << "    channel:  eµ" << std::endl;
   if(channel==EMU){
     std::cout << "    real eff(e): " << aReal << std::endl;
     std::cout << "    fake eff(e): " << aFake << std::endl;    
-    std::cout << "    real eff(mu): " << aReal2 << std::endl;
-    std::cout << "    fake eff(mu): " << aFake2 << std::endl;    
+    std::cout << "    real eff(µ): " << aReal2 << std::endl;
+    std::cout << "    fake eff(µ): " << aFake2 << std::endl;    
   }
   else{
     std::cout << "    real eff: " << aReal << std::endl;
@@ -201,7 +201,7 @@ void FakesWeights::SetupWeighter(int channel, std::string aReal, std::string aFa
   // setup firt lepton, for all the channels
   _EffSet[0]->SetupEff(aReal);
   _EffSet[1]->SetupEff(aFake);
-  // setup the second lepton in the same way as the first one for ee and mumu, but following aReal2/aFake2 for emu
+  // setup the second lepton in the same way as the first one for ee and µµ, but following aReal2/aFake2 for eµ
   if(channel==EE || channel==EMU || channel==MUMU){
     if(aReal2!="") _EffSet[2]->SetupEff(aReal2);
     else _EffSet[2]->SetupEff(aReal);
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/EnergyLossSamplerBetheHeitler.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/EnergyLossSamplerBetheHeitler.cxx
index b991cab5be8b..95393d247010 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/EnergyLossSamplerBetheHeitler.cxx
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/EnergyLossSamplerBetheHeitler.cxx
@@ -111,8 +111,8 @@ Trk::EnergyLoss* iFatras::EnergyLossSamplerBetheHeitler::energyLoss( const Trk::
 
 
   //Bethe-Heitler for electron brem description as described here:
-  // "A Gaussian-mixture approximation of the Bethe-Heitler model of electron energy loss by bremsstrahlung"
-  // R. Fruehwirth
+  // "A Gaussian-mixture approximation of the Bethe–Heitler model of electron energy loss by bremsstrahlung"
+  // R. Frühwirth
   
   double u = CLHEP::RandGamma::shoot(m_randomEngine, pathLength / log(2.), 1.);
   double z = exp( -1. * u );
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.cxx
index a3fe3be47e9e..e0370add52c0 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.cxx
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.cxx
@@ -103,8 +103,8 @@ double iFatras::MultipleScatteringSamplerGeneralMixture::simTheta(const Trk::Mat
   
   if (particle != Trk::electron) {
     //----------------------------------------------------------------------------------------------//
-    //see Mixture models of multiple scattering: computation and simulation. - R.Fruehwirth, M. Liendl. -
-    //Computer Physics Communications 141 (2001) 230 246
+    //see Mixture models of multiple scattering: computation and simulation. - R.Frühwirth, M. Liendl. -
+    //Computer Physics Communications 141 (2001) 230–246
     //----------------------------------------------------------------------------------------------//
     std::vector<double> scattering_params;
     // Decide which mixture is best
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.h b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.h
index 11e32b5b00b7..191fcf2a6349 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.h
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/src/MultipleScatteringSamplerGeneralMixture.h
@@ -76,7 +76,7 @@ namespace iFatras {
       static double         s_log_RossiGreisen;      //!< main factor for Rossi-Greisen formula
       
       
-      // ========= General mixture model R.Fruehwirth, M. Liendl. Comp. Phys. Comm. 141 (2001) 230-246 =========
+      // ========= General mixture model R.Frühwirth, M. Liendl. Comp. Phys. Comm. 141 (2001) 230–246 =========
       static double	    s_genMixScale;	    //!< General mixture model: Scaling factor
       
       //!< General mixture model: get parameters for single gaussian simulation
diff --git a/Tracking/TrkDetDescr/TrkDetDescrGeoModelCnv/src/GeoShapeConverter.cxx b/Tracking/TrkDetDescr/TrkDetDescrGeoModelCnv/src/GeoShapeConverter.cxx
index 16a6b384416b..e62ddccfe22e 100755
--- a/Tracking/TrkDetDescr/TrkDetDescrGeoModelCnv/src/GeoShapeConverter.cxx
+++ b/Tracking/TrkDetDescr/TrkDetDescrGeoModelCnv/src/GeoShapeConverter.cxx
@@ -49,7 +49,7 @@
 namespace {
 	//commonly used axes
 	const Amg::Vector3D gXAxis(1.0, 0.0, 0.0), gYAxis(0.0, 1.0, 0.0), gZAxis(0.0, 0.0, 1.0);
-	//commonly used angles, +-90 degree, 180 degree
+	//commonly used angles, ±90°, 180°
 	const double p90deg(90.0 * Gaudi::Units::deg), m90deg(-90.0 * Gaudi::Units::deg), p180deg(180.0 * Gaudi::Units::deg);
 }
 
diff --git a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
index 050344c8be66..d1d3bfca4e4e 100644
--- a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
+++ b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
@@ -326,7 +326,7 @@ void TrigT1CaloTauFex::IsolationCorett(const std::vector<const CaloCell*>& scell
         float deltaphiInner = 0.05;
         for(auto scell : scells) {
                 if ( std::abs( scell->eta() - etacell) > deltaetaOuter2 ) continue;
-                if (scell->caloDDE()->getSampling()!=1 && scell->caloDDE()->getSampling()!=5 && cell->caloDDE()->getSampling()!=4 && cell->caloDDE()->getSampling()!=8) deltaetaOuter1 = 1.0; // tighter isolation in 1 deg  and 2 deg layers
+                if (scell->caloDDE()->getSampling()!=1 && scell->caloDDE()->getSampling()!=5 && cell->caloDDE()->getSampling()!=4 && cell->caloDDE()->getSampling()!=8) deltaetaOuter1 = 1.0; // tighter isolation in 1° and 2° layers
                 float dphi = std::abs( scell->phi() - phicell);
                 dphi = std::abs( M_PI - dphi );
                 dphi = std::abs( M_PI - dphi );
-- 
GitLab


From ff3ceca1093ac2619c0319642b6010709e5ab8e0 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Sat, 19 Sep 2020 11:41:04 +0200
Subject: [PATCH 274/422] build_externals: Fix build caching for LCG version
 change

The externals build caching did not work correctly when the LCG version
was being changed via a cmake command line argument. Fix this by adding
a hash of the extra cmake parameters to the stamp file.

Fixes ATLINFR-3018.
---
 Projects/AnalysisBase/build_externals.sh  | 4 +++-
 Projects/AthGeneration/build_externals.sh | 4 +++-
 Projects/AthSimulation/build_externals.sh | 4 +++-
 Projects/Athena/build_externals.sh        | 4 +++-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/Projects/AnalysisBase/build_externals.sh b/Projects/AnalysisBase/build_externals.sh
index 6a7361bf9c66..081074ee028a 100755
--- a/Projects/AnalysisBase/build_externals.sh
+++ b/Projects/AnalysisBase/build_externals.sh
@@ -84,9 +84,11 @@ fi
 
 # Get the version of AnalysisBase for the build.
 version=`cat ${thisdir}/version.txt`
+# Generate hash of any extra cmake arguments.
+cmakehash=`echo -n "${EXTRACMAKE}" | openssl md5 | awk '{print $2}'`
 
 # Check if previous externals build can be reused:
-externals_stamp=${BUILDDIR}/build/AnalysisBaseExternals/externals-${version}.stamp
+externals_stamp=${BUILDDIR}/build/AnalysisBaseExternals/externals-${version}-${cmakehash}.stamp
 if [ -f ${externals_stamp} ]; then
     if diff -q ${externals_stamp} ${thisdir}/externals.txt; then
         echo "Correct version of externals already available in ${BUILDDIR}"
diff --git a/Projects/AthGeneration/build_externals.sh b/Projects/AthGeneration/build_externals.sh
index 91b6fd9b743f..1273378fd15f 100755
--- a/Projects/AthGeneration/build_externals.sh
+++ b/Projects/AthGeneration/build_externals.sh
@@ -97,9 +97,11 @@ fi
 
 # Get the version of AthGeneration for the build.
 version=`cat ${thisdir}/version.txt`
+# Generate hash of any extra cmake arguments.
+cmakehash=`echo -n "${EXTRACMAKE}" | openssl md5 | awk '{print $2}'`
 
 # Check if previous externals build can be reused:
-externals_stamp=${BUILDDIR}/build/AthGenerationExternals/externals-${version}.stamp
+externals_stamp=${BUILDDIR}/build/AthGenerationExternals/externals-${version}-${cmakehash}.stamp
 if [ -f ${externals_stamp} ]; then
     if diff -q ${externals_stamp} ${thisdir}/externals.txt; then
         echo "Correct version of externals already available in ${BUILDDIR}"
diff --git a/Projects/AthSimulation/build_externals.sh b/Projects/AthSimulation/build_externals.sh
index 96ec95ad708c..e6467a5ff31f 100755
--- a/Projects/AthSimulation/build_externals.sh
+++ b/Projects/AthSimulation/build_externals.sh
@@ -89,9 +89,11 @@ fi
 
 # Get the version of AthSimulation for the build.
 version=`cat ${thisdir}/version.txt`
+# Generate hash of any extra cmake arguments.
+cmakehash=`echo -n "${EXTRACMAKE}" | openssl md5 | awk '{print $2}'`
 
 # Check if previous externals build can be reused:
-externals_stamp=${BUILDDIR}/build/AthSimulationExternals/externals-${version}.stamp
+externals_stamp=${BUILDDIR}/build/AthSimulationExternals/externals-${version}-${cmakehash}.stamp
 if [ -f ${externals_stamp} ]; then
     if diff -q ${externals_stamp} ${thisdir}/externals.txt; then
         echo "Correct version of externals already available in ${BUILDDIR}"
diff --git a/Projects/Athena/build_externals.sh b/Projects/Athena/build_externals.sh
index 8cbe9cb809a1..20771cdb68c2 100755
--- a/Projects/Athena/build_externals.sh
+++ b/Projects/Athena/build_externals.sh
@@ -97,9 +97,11 @@ fi
 
 # Get the version of Athena for the build.
 version=`cat ${thisdir}/version.txt`
+# Generate hash of any extra cmake arguments.
+cmakehash=`echo -n "${EXTRACMAKE}" | openssl md5 | awk '{print $2}'`
 
 # Check if previous externals build can be reused:
-externals_stamp=${BUILDDIR}/build/AthenaExternals/externals-${version}.stamp
+externals_stamp=${BUILDDIR}/build/AthenaExternals/externals-${version}-${cmakehash}.stamp
 if [ -f ${externals_stamp} ]; then
     if diff -q ${externals_stamp} ${thisdir}/externals.txt; then
         echo "Correct version of externals already available in ${BUILDDIR}"
-- 
GitLab


From b341755b743bb4af756ee5a41ad257ed3b09d7ce Mon Sep 17 00:00:00 2001
From: Nicolas Koehler <nicolas.koehler@cern.ch>
Date: Sat, 19 Sep 2020 10:36:17 +0000
Subject: [PATCH 275/422] Make dump-geo running in python3

---
 .../DumpGeo/share/dump-geo.py                 | 54 +++++--------------
 .../share/vp1FragmentConstructVP1ATLREL.py    |  6 ++-
 .../DumpGeo/share/vp1FragmentFixDBReplica.py  | 46 ++++++++--------
 3 files changed, 40 insertions(+), 66 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py
index c80d81024135..e5aa8a114cd8 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py
@@ -43,7 +43,7 @@ if not 'vp1MuonAGDD2GeoSwitches' in dir(): vp1MuonAGDD2GeoSwitches=[]
 if not 'vp1NSWAGDDFiles' in dir(): vp1NSWAGDDFiles=[]
 if not 'vp1MuonLayout' in dir(): vp1MuonLayout=""
 
-def vp1CfgErr(s): print "VP1 CONFIGURATION ERROR: %s" % s
+def vp1CfgErr(s): print ("VP1 CONFIGURATION ERROR: %s" % s)
 
 if (vp1Fatras and not vp1ID):
     vp1CfgErr("Fatras can not be enabled without inner detector. Turning off Fatras.")
@@ -64,13 +64,6 @@ if ( vp1FatrasTruthKey != "" and not vp1Fatras ):
     vp1CfgErr("FatrasTruthKey set but Fatras not enabled. Unsetting FatrasTruthKey.")
     vp1FatrasTruthKey=""
 
-#print "*** VP1 NOTE *** setting COIN_GLXGLUE env vars to make screenshots working remotely..."
-#print "*** VP1 NOTE *** COIN_GLXGLUE_NO_GLX13_PBUFFERS=1 - " + "COIN_GLXGLUE_NO_PBUFFERS=1"
-#os.putenv("COIN_GLXGLUE_NO_GLX13_PBUFFERS","1")
-#os.putenv("COIN_GLXGLUE_NO_PBUFFERS","1")
-
-
-
 #Set VP1ATLREL integer so we can do e.g. "if VP1ATLREL>=160002:"
 include('DumpGeo/vp1FragmentConstructVP1ATLREL.py')
 
@@ -181,9 +174,9 @@ if (vp1ZDC): DetFlags.ZDC_setOn()
 else:          DetFlags.ZDC_setOff()
 DetFlags.Print()
 if (vp1CustomGeometry):
-    print "Configuring Custom geometry."
+    print ("Configuring Custom geometry.")
 if (vp1SLHC):
-  print "Setting up SLHC configuration"
+  print ("Setting up SLHC configuration")
   rec.doTrigger.set_Value_and_Lock(False)
   from AthenaCommon.GlobalFlags import globalflags
   from AthenaCommon.GlobalFlags import jobproperties
@@ -221,16 +214,16 @@ from AtlasGeoModel import GeoModelInit
 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 
 if vp1GeoModelStats:
-  print "printing GeoModel stats to file (Svc.StatisticsToFile=TRUE)..."
+  print ("printing GeoModel stats to file (Svc.StatisticsToFile=TRUE)...")
   svcMgr.GeoModelSvc.StatisticsToFile = True
 
 if vp1Cavern:
-  print "vp1.py - Initializing the visualization of the Cavern Infrastructure..."
+  print ("vp1.py - Initializing the visualization of the Cavern Infrastructure...")
   from CavernInfraGeoModel.CavernInfraGeoModelConf import CavernInfraDetectorTool
   svcMgr.GeoModelSvc.DetectorTools += [ CavernInfraDetectorTool() ]
 
 if vp1ToyDetector:
-  print "vp1.py - Initializing the visualization of the GeoModelExamples 'ToyDetector'..."
+  print ("vp1.py - Initializing the visualization of the GeoModelExamples 'ToyDetector'...")
   from GeoModelExamples.GeoModelExamplesConf import ToyDetectorTool
   svcMgr.GeoModelSvc.DetectorTools += [ ToyDetectorTool() ]
 
@@ -283,30 +276,7 @@ if (vp1Muon):
                     b.ReadAGDD=False
                     b.XMLFiles=vp1NSWAGDDFiles
 
-    # if(vp1FullToroids or vp1NSW):
-    #     from AtlasGeoModel import Agdd2Geo
-    # else:
-    #     from AthenaCommon.GlobalFlags import globalflags
-    #     DDV = globalflags.DetDescrVersion()
-    #     if(DDV.__contains__('ATLAS-GEO')):
-    #         seconddash = DDV.find('-',8);
-    #         majorddversstr = DDV[seconddash+1:seconddash+3];
-    #         majorddversint = int(majorddversstr);
-    #         if(majorddversint>10):
-    #             # Additional material in the muon system
-    #             from AGDD2Geo.AGDD2GeoConf import AGDD2GeoSvc
-    #             AGDD2GeoSvc=AGDD2GeoSvc()
-    #             AGDD2GeoSvc.PrintSections=False
-    #             AGDD2GeoSvc.Sections += ["ATLAS Feet"]
-    #             AGDD2GeoSvc.Sections += ["Atlas Barrel Toroidal Magnets"]
-    #             AGDD2GeoSvc.Sections += ["Atlas ECT Toroidal Magnets"]
-    #             AGDD2GeoSvc.DisableSections = False
-    #             AGDD2GeoSvc.Locked = False
-    #             theApp.CreateSvc += ["AGDD2GeoSvc"]
-    #             svcMgr += AGDD2GeoSvc
-
 #MagneticField:
-#include("BFieldAth/BFieldAth_jobOptions.py") # OLD
 import MagFieldServices.SetupField # NEW
 
 if (vp1Fatras):
@@ -436,14 +406,14 @@ if vp1Extrapolator and (vp1ID or vp1Muon):
     #                                Propagators = [ VP1Propagator ] )
 
     ToolSvc += VP1Extrapolator
-    print VP1Extrapolator
+    print (VP1Extrapolator)
     #We should append to variable instead:
     os.putenv("VP1_JOBCFG_EXTRA_VP1_EXTRAPOLATORS","Trk::Extrapolator/"+VP1ExtraPolatorName)
 
     from TrkExEngine.AtlasExtrapolationEngine import AtlasExtrapolationEngine
     ExtrapolationEngine = AtlasExtrapolationEngine(name='Extrapolation', nameprefix='Atlas')
     ToolSvc += ExtrapolationEngine
-    print ExtrapolationEngine
+    print (ExtrapolationEngine)
 
 #Fitter:
 if vp1Fitter and vp1Extrapolator and (vp1ID or vp1Muon):
@@ -499,8 +469,8 @@ if vp1Fitter and vp1Extrapolator and (vp1ID or vp1Muon):
        ToolMuonDriftCircle = MdtTubeHitOnTrackCreator ,
                                                  Mode = 'all')
     ToolSvc += VP1RotCreator
-    print VP1RotCreator
-    print MdtTubeHitOnTrackCreator
+    print (VP1RotCreator)
+    print (MdtTubeHitOnTrackCreator)
 
     from TrkKalmanFitter.TrkKalmanFitterConf import Trk__KalmanFitter as ConfiguredKalmanFitter
     VP1KalmanFitter = ConfiguredKalmanFitter(name                           = 'VP1KalmanFitter',
@@ -515,7 +485,7 @@ if vp1Fitter and vp1Extrapolator and (vp1ID or vp1Muon):
 
     ToolSvc += VP1KalmanFitter
 
-    print VP1KalmanFitter
+    print (VP1KalmanFitter)
     os.putenv("VP1_JOBCFG_EXTRA_VP1_FITTERS",VP1KalmanFitter.name())
 
 
@@ -545,7 +515,7 @@ if vp1Fitter and vp1Extrapolator and (vp1ID or vp1Muon):
                                              SignedDriftRadius     = True,
                                              RecalculateDerivatives= True
                                              )
-    print VP1GlobalChi2Fitter
+    print (VP1GlobalChi2Fitter)
     ToolSvc += VP1GlobalChi2Fitter
 
     VP1GlobalChi2Fitter.OutputLevel=DEBUG
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentConstructVP1ATLREL.py b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentConstructVP1ATLREL.py
index e0eb714e0fcd..d3c8662e09a0 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentConstructVP1ATLREL.py
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentConstructVP1ATLREL.py
@@ -1,3 +1,7 @@
+#/*
+#  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#*/
+
 #Construct VP1ATLREL integer based on AtlasVersion environment
 #variable, needed to make script work across releases. As an example
 #14.0.1 becomes 140001. Any parts not recognised are replaced with 99.
@@ -17,4 +21,4 @@ if not 'VP1ATLREL' in dir():
         if versionMinor>99: versionMinor=99
         if versionMinor==99 or versionPatch>99: versionPatch=99
         VP1ATLREL=10000*versionMajor+100*versionMinor+versionPatch
-        print "VP1ATLREL: "+str(VP1ATLREL)
+        print ("VP1ATLREL: "+str(VP1ATLREL))
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py
index 7883ce348a7d..530b877a6fa4 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py
@@ -1,5 +1,5 @@
 #/*
-#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #*/
 
 from AthenaCommon.GlobalFlags import globalflags
@@ -8,41 +8,41 @@ import os
 if globalflags.DataSource() == 'data' and os.getenv("FRONTIER_SERVER") == None :
 
     # Patch dblookup.xml to avoid any attempt to use sqlite replicas
-    print "VP1 Info: real data mode and Frontier environment not set - need to patch dblookup.xml to avoid using local sqlite replicas."
+    print ("VP1 Info: real data mode and Frontier environment not set - need to patch dblookup.xml to avoid using local sqlite replicas.")
     if os.path.exists("dblookup.xml"):
         print "VP1 Warning: dblookup.xml already found in run directory. Will not attempt to created patched copy."
         os.putenv("CORAL_DBLOOKUP_PATH",".")
     else:
         if os.getenv("CORAL_AUTH_PATH") == None or not os.path.isdir(os.getenv("CORAL_AUTH_PATH")):
-            print "VP1 Warning: CORAL_AUTH_PATH is not set or does not point to directory. Can't create patched dblookup.xml."
+            print ("VP1 Warning: CORAL_AUTH_PATH is not set or does not point to directory. Can't create patched dblookup.xml.")
         else:
             dblookupFileLocation=os.getenv("CORAL_AUTH_PATH")+"/dblookup.xml"
             if not os.path.exists(dblookupFileLocation) or not os.path.isfile(dblookupFileLocation):
-                print "VP1 Warning: Did not find CORAL_AUTH_PATH/dblookup.xml. Can't create patched dblookup.xml."
+                print ("VP1 Warning: Did not find CORAL_AUTH_PATH/dblookup.xml. Can't create patched dblookup.xml.")
             else:
-                print "VP1 Warning: Attempting to create patched dblookup.xml in current directory"
+                print ("VP1 Warning: Attempting to create patched dblookup.xml in current directory")
                 os.system("cat $CORAL_AUTH_PATH/dblookup.xml |grep -v 'ALLP200.db'> dblookup.xml")
                 os.putenv("CORAL_DBLOOKUP_PATH",".")
 
     if os.getenv("ATLAS_CONDDB")==None and (os.getenv("HOSTNAME") == None or os.getenv("HOSTNAME").find('.')<=0):
-        print "VP1 Warning: Unable to determine domain from runtime environment. Disabling attempt to find nearest replica."
+        print ("VP1 Warning: Unable to determine domain from runtime environment. Disabling attempt to find nearest replica.")
         PoolSvc = Service( "PoolSvc" )
         PoolSvc.SortReplicas = False
 
-        print ""
-        print "  ==========>"
-        print "  ========>"
-        print "  ======>"
-        print "  ====>"
-        print "  ====> VP1 Warning: Can't find nearest Oracle replica and you are running on real data."
-        print "  ====> Thus conditions data will have to come from the default, CERN (or you might crash!)."
-        print "  ====>"
-        print "  ====> Notice that this might SIGNIFICANTLY slow down (or even time-out) your job depending"
-        print "  ====> on your location and connection! You can avoid the issue (and this warning) by fixing"
-        print "  ====> your environment: either ATLAS_CONDDB or HOSTNAME. Alternatively you can edit a dblookup.xml file in your2"
-        print "  ====> directory to only leave in references to a closer replica in sections where such a replica is available."
-        print "  ====>"
-        print "  ======>"
-        print "  ========>"
-        print "  ==========>"
-        print ""
+        print ("")
+        print ("  ==========>")
+        print ("  ========>")
+        print ("  ======>")
+        print ("  ====>")
+        print ("  ====> VP1 Warning: Can't find nearest Oracle replica and you are running on real data.")
+        print ("  ====> Thus conditions data will have to come from the default, CERN (or you might crash!).")
+        print ("  ====>")
+        print ("  ====> Notice that this might SIGNIFICANTLY slow down (or even time-out) your job depending")
+        print ("  ====> on your location and connection! You can avoid the issue (and this warning) by fixing")
+        print ("  ====> your environment: either ATLAS_CONDDB or HOSTNAME. Alternatively you can edit a dblookup.xml file in your2")
+        print ("  ====> directory to only leave in references to a closer replica in sections where such a replica is available.")
+        print ("  ====>")
+        print ("  ======>")
+        print ("  ========>")
+        print ("  ==========>")
+        print ("")
-- 
GitLab


From fe917a80e2db6c00546ac62ebebfb859b5bf7eba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20K=C3=B6hler?= <nicolas.koehler@cern.ch>
Date: Sat, 19 Sep 2020 14:55:04 +0200
Subject: [PATCH 276/422] fix GGLN from AmdcDb reading

---
 .../MuonGeoModel/src/RDBReaderAtlas.cxx         | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx b/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
index 0bc1b2a361e8..e84fa4a899cd 100755
--- a/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
@@ -613,28 +613,31 @@ void RDBReaderAtlas::ProcessTGCreadout () {
         m_mgr->storeTgcReadoutParams(std::move(rpar));
       }
     }
-  } else { //if (getGeometryVersion().substr(0,1) == "Q")
+  } else {
     //
     // in case of layout Q and following
     //
     AmdcDb* theAmdcDb = dynamic_cast<AmdcDb*>(m_pRDBAccess);
-    IRDBRecordset_ptr ggln = m_pRDBAccess->getRecordsetPtr("GGLN",m_geoTag,m_geoNode);
-    if (theAmdcDb) ggln = theAmdcDb->getRecordsetPtr("GGLN",m_geoTag,m_geoNode);
+    IRDBRecordset_ptr ggln = theAmdcDb ? theAmdcDb->getRecordsetPtr("GGLN","Amdc")  : m_pRDBAccess->getRecordsetPtr("GGLN",m_geoTag,m_geoNode);
 
     int version(0);
     float wirespacing(0);
-    if(ggln->size()){
+    unsigned int gglnSize(0);
+    if (ggln) gglnSize = ggln->size();
+    else {
+      log << MSG::WARNING << " ProcessTGCreadout - IRDBRecordset_ptr GGLN is nullptr" << endmsg;
+    }
+    if(gglnSize){
       version = (int) (*ggln)[0]->getInt("VERS");
       wirespacing = (*ggln)[0]->getFloat("WIRESP")*Gaudi::Units::mm;
     }
 
-    log << MSG::INFO
-        << " ProcessTGCreadout - version " << version << " wirespacing " << wirespacing << endmsg;
+    log << MSG::INFO << " ProcessTGCreadout - version " << version << " wirespacing " << wirespacing << endmsg;
 
     MYSQL *mysql = MYSQL::GetPointer();
 
     // loop over the banks of station components: ALMN
-    for (unsigned int ich = 0; ich<ggln->size(); ++ich) {
+    for (unsigned int ich = 0; ich<gglnSize; ++ich) {
       int type = (int)(*ggln)[ich]->getInt("JSTA");
       std::string name = "TGCReadout"+MuonGM::buildString(type,2);
 
-- 
GitLab


From ad8fc403998d04f5c0007d7556d3039bfa9f9c4b Mon Sep 17 00:00:00 2001
From: scott snyder <scott.snyder@cern.ch>
Date: Tue, 7 Mar 2017 23:17:49 -0500
Subject: [PATCH 277/422] Remove write to cout.

---
 .../G4Utilities/TrackWriteFastSim/src/TrackRecorderSDTool.cxx | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Simulation/G4Utilities/TrackWriteFastSim/src/TrackRecorderSDTool.cxx b/Simulation/G4Utilities/TrackWriteFastSim/src/TrackRecorderSDTool.cxx
index 9801b1097750..8b29c7ca8988 100644
--- a/Simulation/G4Utilities/TrackWriteFastSim/src/TrackRecorderSDTool.cxx
+++ b/Simulation/G4Utilities/TrackWriteFastSim/src/TrackRecorderSDTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Track Recorder Sensitive Detector Tool.
@@ -18,8 +18,6 @@ TrackRecorderSDTool::TrackRecorderSDTool(const std::string& type, const std::str
   , m_SD_type(1)
 {
   declareProperty("SD_type", m_SD_type);
-  std::cout << "TrackRecorderSDTool Constructor: name" << name << std::endl;
-
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-- 
GitLab


From e49f9232a0551c1ac207e5d0c0de16bebdfa636d Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 14 Sep 2020 09:40:20 -0400
Subject: [PATCH 278/422] TrkRIO_OnTrackCreator: Fix cppcheck warnings.

 - Prefer using an initializer list to assigning members
   in a ctor body.
 - Suppress warnings about side-effects in assert (from params() calls).
 - Delete copy ctor/assignment for MuonEtaPhiRIO_OnTrackErrorScalingKit.
---
 .../TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx | 4 ++--
 .../src/RIO_OnTrackErrorScalingCondAlg.cxx                    | 1 +
 .../src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx          | 1 +
 .../src/RIO_OnTrackErrorScalingMuonKits.cxx                   | 4 ++++
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx
index c77d174f2a09..e76ff4a5a359 100755
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx
@@ -34,12 +34,12 @@ Trk::RIO_OnTrackCreator::RIO_OnTrackCreator(const std::string& t,
      m_muonDriftCircleCor("Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackTool", this),
      m_muonClusterCor    ("Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackTool", this),
      m_mmClusterCor      ("Muon::MMClusterOnTrackCreator/MMClusterOnTrackTool", this),
+     m_mode ("all"),
+     m_nwarning (new int(0)),
      m_doPixel(true),
      m_doSCT(true),
      m_doTRT(true)
  {
-   m_mode     = "all";
-   m_nwarning = new int(0);
    declareInterface<IRIO_OnTrackCreator>(this);
    declareProperty("ToolPixelCluster"   ,m_pixClusCor);
    declareProperty("ToolSCT_Cluster"    ,m_sctClusCor);
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx
index 9add5a3cc823..96c0c89fa6c2 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx
@@ -134,6 +134,7 @@ StatusCode RIO_OnTrackErrorScalingCondAlg::execute() {
         std::pair<unsigned int, unsigned int> idx = m_attributeMap.at(attr_name);
         if (idx.first != std::numeric_limits<unsigned int>::max()) {
           assert( idx.first < error_scaling.size());
+          // cppcheck-suppress assertWithSideEffect
           assert( idx.second < error_scaling[idx.first]->params().size());
 
           const int nvals=alist[att_i++].data<int>();
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx
index 45b2d1f1ceec..693719367af6 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx
@@ -98,6 +98,7 @@ StatusCode RIO_OnTrackErrorScalingDbOverrideCondAlg::execute() {
     std::vector<float>::const_iterator  param_iter = m_errorScalingParameters.begin();
     unsigned int set_i=0;
     for (unsigned int n_params : m_useNParametersPerSet ) {
+      // cppcheck-suppress assertWithSideEffect
       assert( set_i < error_scaling->params().size() );
       error_scaling->params()[set_i].clear();
       error_scaling->params()[set_i].reserve(n_params);
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx
index d4627607fc30..2189d6471f31 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx
@@ -25,6 +25,10 @@ public:
     }
     delete [] m_names;
   }
+
+  MuonEtaPhiRIO_OnTrackErrorScalingKit (const MuonEtaPhiRIO_OnTrackErrorScalingKit&) = delete;
+  MuonEtaPhiRIO_OnTrackErrorScalingKit& operator= (const MuonEtaPhiRIO_OnTrackErrorScalingKit&) = delete;
+
   virtual unsigned int nParametres() const override {
     return MuonEtaPhiRIO_OnTrackErrorScaling::kNParamTypes;
   }
-- 
GitLab


From ebe3452ca003a6c33fe41ef3402c45611e86eeb6 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 18 Sep 2020 19:06:45 +0200
Subject: [PATCH 279/422] MMRawDataMonitoring: Fix clang warnings.

Fix apparent typos in abs() calls that were giving warnings with clang.
---
 .../MMRawDataMonitoring/src/MMRawDataUtils.cxx                | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx
index 7305096e21bc..d9d32f063b50 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx
@@ -64,8 +64,8 @@ int MMRawDataMonAlg::get_sectorPhi_from_stationPhi_stName(int stationPhi,const s
 int MMRawDataMonAlg::get_sectorEta_from_stationEta(int stationEta) const {
  
   //  1<-0  0-> 1
-  if (std::abs(stationEta==1)) return 0;                                                            
-  if (std::abs(stationEta==2)) return 1;
+  if (std::abs(stationEta)==1) return 0;                                                            
+  if (std::abs(stationEta)==2) return 1;
 
   return -1;
 
-- 
GitLab


From 00c6d13692a5b33e14212d4914f9d4df27edcb26 Mon Sep 17 00:00:00 2001
From: Will Leight <wleight@cern.ch>
Date: Sat, 19 Sep 2020 16:28:04 +0200
Subject: [PATCH 280/422] Fix for ATLASRECTS-5665

Add an else to ensure that if the track is deleted because it has no DOF, no further attempt is made to use it.
---
 .../src/MuonCandidateTool.cxx                  | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx
index d04466d5bd82..7092da07242c 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx
@@ -81,14 +81,16 @@ namespace MuonCombined {
 	  standaloneTrack=0;
 	  ATH_MSG_DEBUG("extrapolated track has no DOF, don't use it");
 	}
-	double mschi2=2.5; //a default we should hopefully never have to use (taken from CombinedMuonTrackBuilder)
-	if(msTrack.fitQuality()->doubleNumberDoF()>0) mschi2=msTrack.fitQuality()->chiSquared()/msTrack.fitQuality()->doubleNumberDoF();
-	//choice of 1000 is slightly arbitrary, the point is that the fit should be really be terrible
-	if(standaloneTrack->fitQuality()->chiSquared()/standaloneTrack->fitQuality()->doubleNumberDoF()>1000*mschi2){
-	  delete standaloneTrack;
-	  standaloneTrack=0;
-	  ATH_MSG_DEBUG("extrapolated track has a degraded fit, don't use it");
-        }
+	else{
+	  double mschi2=2.5; //a default we should hopefully never have to use (taken from CombinedMuonTrackBuilder)
+	  if(msTrack.fitQuality()->doubleNumberDoF()>0) mschi2=msTrack.fitQuality()->chiSquared()/msTrack.fitQuality()->doubleNumberDoF();
+	  //choice of 1000 is slightly arbitrary, the point is that the fit should be really be terrible
+	  if(standaloneTrack->fitQuality()->chiSquared()/standaloneTrack->fitQuality()->doubleNumberDoF()>1000*mschi2){
+	    delete standaloneTrack;
+	    standaloneTrack=0;
+	    ATH_MSG_DEBUG("extrapolated track has a degraded fit, don't use it");
+	  }
+	}
       }
       if (standaloneTrack) {
 	standaloneTrack->info().setParticleHypothesis(Trk::muon);
-- 
GitLab


From 02203809b1e8247e7bcd11693abc41fab01c2e73 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 16 Sep 2020 12:26:25 -0400
Subject: [PATCH 281/422] TrigInDetTruthAlgs: Const fixes.

Add some missing const declarations.
Needed to go with upcoming thread-safety changes in TrigInDetEvent.
---
 .../src/TrigInDetTrackTruthMaker.cxx               | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/Trigger/TrigAnalysis/TrigInDetTruthAlgs/src/TrigInDetTrackTruthMaker.cxx b/Trigger/TrigAnalysis/TrigInDetTruthAlgs/src/TrigInDetTrackTruthMaker.cxx
index d67356efa4df..4b18d66a9a60 100644
--- a/Trigger/TrigAnalysis/TrigInDetTruthAlgs/src/TrigInDetTrackTruthMaker.cxx
+++ b/Trigger/TrigAnalysis/TrigInDetTruthAlgs/src/TrigInDetTrackTruthMaker.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**************************************************************************
@@ -292,7 +292,7 @@ bool TrigInDetTrackTruthMaker::TrackTruth(const TrigInDetTrack* p_trk, TrigInDet
   std::map<HepMcParticleLink, unsigned int> true_hits_map_trt;
   
   // get TrigSiSpacePoints
-  std::vector <const TrigSiSpacePoint*>* p_sp_vec = p_trk->siSpacePoints();
+  const std::vector <const TrigSiSpacePoint*>* p_sp_vec = p_trk->siSpacePoints();
   
   // check TrigSiSpacePoints are there and if so carry on
   if (p_sp_vec) {
@@ -300,8 +300,8 @@ bool TrigInDetTrackTruthMaker::TrackTruth(const TrigInDetTrack* p_trk, TrigInDet
     if (msgLvl(MSG::VERBOSE)) msg() << MSG::VERBOSE << "TrackTruth() : TrigInDetTrack has " 
            << p_sp_vec->size() << " SiSpacePoints" << endmsg;
 
-    std::vector<const TrigSiSpacePoint*>::iterator spIter = p_sp_vec->begin();
-    std::vector<const TrigSiSpacePoint*>::iterator lastSP = p_sp_vec->end();
+    std::vector<const TrigSiSpacePoint*>::const_iterator spIter = p_sp_vec->begin();
+    std::vector<const TrigSiSpacePoint*>::const_iterator lastSP = p_sp_vec->end();
     
     // make local vector to contain GenParticles corresponding to space point
     std::vector<HepMcParticleLink>* p_gp_vec = new std::vector<HepMcParticleLink>;
@@ -354,15 +354,15 @@ bool TrigInDetTrackTruthMaker::TrackTruth(const TrigInDetTrack* p_trk, TrigInDet
   } // ! if (siSpacePoints exist)
 
   // get TRT_DriftCircles
-  std::vector<const InDet::TRT_DriftCircle*>* p_dc_vec = p_trk->trtDriftCircles();
+  const std::vector<const InDet::TRT_DriftCircle*>* p_dc_vec = p_trk->trtDriftCircles();
   
   // check TRT_DriftCircles are there and if so carry on
   if (p_dc_vec) {
     if (msgLvl(MSG::VERBOSE)) msg() << MSG::VERBOSE << "TrackTruth() : TrigInDetTrack has " 
            << p_dc_vec->size() << " TRT_DriftCircles" << endmsg;
     
-    std::vector<const InDet::TRT_DriftCircle*>::iterator dcIter = p_dc_vec->begin();
-    std::vector<const InDet::TRT_DriftCircle*>::iterator lastSP = p_dc_vec->end();
+    std::vector<const InDet::TRT_DriftCircle*>::const_iterator dcIter = p_dc_vec->begin();
+    std::vector<const InDet::TRT_DriftCircle*>::const_iterator lastSP = p_dc_vec->end();
     
     // make vector to contain GenParticles corresponding to drift circle
     std::vector<HepMcParticleLink>* p_gp_vec = new std::vector<HepMcParticleLink>;
-- 
GitLab


From 79e4fe43e9e051a9d60bb32189bfc64026804523 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 16 Sep 2020 15:32:45 -0400
Subject: [PATCH 282/422] TrigJiveXML: Const fixes.

Const fixes.
Needed to go with upcoming thread-safety changes in TrigInDetEvent.
---
 .../TrigJiveXML/src/TrigInDetTrackRetriever.cxx  | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/Trigger/TrigAnalysis/TrigJiveXML/src/TrigInDetTrackRetriever.cxx b/Trigger/TrigAnalysis/TrigJiveXML/src/TrigInDetTrackRetriever.cxx
index 90227f4789df..7816d2b8d3ee 100755
--- a/Trigger/TrigAnalysis/TrigJiveXML/src/TrigInDetTrackRetriever.cxx
+++ b/Trigger/TrigAnalysis/TrigJiveXML/src/TrigInDetTrackRetriever.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrigJiveXML/TrigInDetTrackRetriever.h"
@@ -99,20 +99,18 @@ namespace JiveXML {
 	  //Get associated hits
 	  int numHits = 0;
 	  if ( (*itr)->siSpacePoints() ){
-	    std::vector<const TrigSiSpacePoint*>::iterator itus = (*itr)->siSpacePoints()->begin();
-	    for (; itus != (*itr)->siSpacePoints()->end() ; ++itus){
-	      hitsvec.push_back(DataType(((*itus)->clusters( ).first)->identify().get_compact()));
+            for (const TrigSiSpacePoint* sp : *(*itr)->siSpacePoints()) {
+	      hitsvec.push_back(DataType((sp->clusters( ).first)->identify().get_compact()));
 	      ++numHits;
-	      if((*itus)->clusters( ).second != 0){
-		hitsvec.push_back(DataType(((*itus)->clusters( ).second)->identify().get_compact()));
+	      if(sp->clusters( ).second != 0){
+		hitsvec.push_back(DataType((sp->clusters( ).second)->identify().get_compact()));
 		++numHits;
 	      }
 	    }
 	  }
 	  if ( (*itr)->trtDriftCircles() ) {
-	    std::vector<const InDet::TRT_DriftCircle*>::iterator itus = (*itr)->trtDriftCircles()->begin();
-	    for (; itus != (*itr)->trtDriftCircles()->end() ; ++itus){
-	      hitsvec.push_back(DataType(((*itus)->identify().get_compact())));
+            for (const InDet::TRT_DriftCircle* dc : *(*itr)->trtDriftCircles()) {
+	      hitsvec.push_back(DataType((dc->identify().get_compact())));
 	      ++numHits;
 	    }
 	  }
-- 
GitLab


From b8e124e9c3b5d7474010e07171a0d3e4ba20a6b8 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 16 Sep 2020 11:46:11 -0400
Subject: [PATCH 283/422] IDScanHitFilter: Thread-safety cleanup.

Remove use of static data.
Allows removing ATLAS_NOT_THREAD_SAFE annotations.
---
 .../TrigTools/IDScanHitFilter/src/FilterBin.cxx |  5 +----
 .../TrigTools/IDScanHitFilter/src/FilterBin.h   | 17 +++++------------
 .../IDScanHitFilter/src/IDScanHitFilter.cxx     | 11 ++++-------
 .../IDScanHitFilter/src/iHitFilter.cxx          | 11 ++++++-----
 .../TrigTools/IDScanHitFilter/src/iHitFilter.h  |  7 ++++---
 5 files changed, 20 insertions(+), 31 deletions(-)

diff --git a/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.cxx b/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.cxx
index 38784fc8a17a..59b6feb0d1d7 100644
--- a/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.cxx
+++ b/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 //
 //   @file    FilterBin.cxx         
@@ -12,6 +12,3 @@
 
 
 #include "FilterBin.h"
-
-long FilterBin::m_maxLayers      = 19;
-long FilterBin::m_maxBarrelLayer = 6;
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.h b/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.h
index 144e603b72f9..0263c23f8228 100644
--- a/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.h
+++ b/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -40,7 +40,7 @@ class FilterBin
   void AddLdirect( long layer_id );
   void AddLindirect( FixedBitSet& bits );
 
-  void AddHit( IdScanSpPoint* spptr );
+  void AddHit( IdScanSpPoint* spptr, long maxLayers, long maxBarrelLayer);
   void AddTriplet( IdScanSpPoint* iPtr,
 		   IdScanSpPoint* jPtr,
 		   IdScanSpPoint* kPtr );
@@ -49,9 +49,6 @@ class FilterBin
   std::list<IdScanSpPoint* >&       hitList();
   const std::list<IdScanSpPoint* >& hitList() const;
 
-  static void setMaxLayers ATLAS_NOT_THREAD_SAFE (long layer)      { m_maxLayers = layer; }
-  static void setMaxBarrelLayer ATLAS_NOT_THREAD_SAFE (long layer) { m_maxBarrelLayer = layer; }
-
 private:
   void neighborKeys( long key, long* np ) const; 
 
@@ -60,10 +57,6 @@ private:
 
   FixedBitSet m_Ldirect;                        // keeps direct layers
   FixedBitSet m_Ltotal;                         // keeps direct+indirect layers
-
-  // statics set once during initialize() via the above non-thread-safe methods:
-  static long m_maxLayers ATLAS_THREAD_SAFE;
-  static long m_maxBarrelLayer ATLAS_THREAD_SAFE;
 };
 
 
@@ -102,14 +95,14 @@ inline void FilterBin::AddLindirect( FixedBitSet& bits ) {
 }
 
 
-inline void FilterBin::AddHit(IdScanSpPoint* spptr) 
+inline void FilterBin::AddHit(IdScanSpPoint* spptr, long maxLayers, long maxBarrelLayer) 
 { 
 
   m_HitList.push_back( spptr ); 
   long lr = spptr->layer();
   this->AddLdirect( lr );
-  if ( lr==0 || lr==m_maxBarrelLayer ){
-    this->AddLdirect( m_maxLayers+lr );
+  if ( lr==0 || lr==maxBarrelLayer ){
+    this->AddLdirect( maxLayers+lr );
   }
 
 }
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx b/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx
index 32296e9c71cb..834b75178052 100755
--- a/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx
+++ b/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -66,7 +66,7 @@ IDScanHitFilter::IDScanHitFilter(const std::string& t,
 
 }
 
-StatusCode IDScanHitFilter::initialize ATLAS_NOT_THREAD_SAFE()
+StatusCode IDScanHitFilter::initialize()
 {
   m_dPhidRCut = 0.3/m_pTcutInMeV;
 
@@ -90,13 +90,10 @@ StatusCode IDScanHitFilter::initialize ATLAS_NOT_THREAD_SAFE()
   /// NB: decrement the endcap pixels, as we want the layer number 
   ///     of the last barrel layer, not the number of the first 
   ///     endcap pixel layer
-  FilterBin::setMaxLayers( maxSiliconLayerNum );
-  FilterBin::setMaxBarrelLayer( offsetEndcapPixels-1 );
-
-  /// initialisise the HitFilter with the correct number of layers
+  /// initialise the HitFilter with the correct number of layers
   /// NB: DO NOT pass in the max eta here, but remember that it can be set here!!
   ///     the parameter initialisation is very messy for this stuff 
-  iHitFilter::initialise( maxSiliconLayerNum ); /// , 3.0 ); 
+  iHitFilter::initialise( maxSiliconLayerNum, offsetEndcapPixels-1 ); /// , 3.0 ); 
 
   // NB: Now set the other way - ie, set m_fullScan=true, 
   //     then this will enforce m_ROIphiHalfWidth=M_PI, but in 
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.cxx b/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.cxx
index 8892d4dfc174..b40a435d2e46 100755
--- a/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.cxx
+++ b/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -32,10 +32,11 @@ using std::cerr;
 using std::endl;
 using std::memset;
 
-int iHitFilter::initialise(long maxlayers, double maxeta) 
+int iHitFilter::initialise(long maxlayers, long maxBarrelLayer, double maxeta) 
 {
 
   m_IdScan_MaxNumLayers = maxlayers;
+  m_maxBarrelLayer      = maxBarrelLayer;
   m_IdScan_MaxEta       = maxeta;
 
   if ( m_fullScan ) m_useROIphiHalfWidth = M_PI;
@@ -272,7 +273,7 @@ GroupList iHitFilter::execute()
 
   for ( ; hitItr != hitEnd;  ++hitItr ) {
     sp_key = makeHashKey( (*hitItr)->rotatedPhi(), (*hitItr)->eta() );
-    (*m_binMap)[sp_key].AddHit( *hitItr );
+    (*m_binMap)[sp_key].AddHit( *hitItr, m_IdScan_MaxNumLayers, m_maxBarrelLayer );
 #ifdef IDSCAN_DEBUG
     std::cout << "IDSCAN_DEBUG hitfilter: layer/phi/z/eta/sp_key: " 
 	      << (*hitItr)->layer() << " / " << (*hitItr)->phi() << " / " << (*hitItr)->z() << " / " << sp_key << std::endl;
@@ -289,8 +290,8 @@ GroupList iHitFilter::execute()
     for ( hitItr = m_internalSPs->begin(); hitItr != hitEnd;  ++hitItr ) {
       if ( (*hitItr)->layer() == 0 ) {
  	sp_key = this->makeHashKey( (*hitItr)->rotatedPhi(), (*hitItr)->eta() );
-	(*m_binMap)[sp_key+offset].AddHit( *hitItr );
-	(*m_binMap)[sp_key-offset].AddHit( *hitItr );
+	(*m_binMap)[sp_key+offset].AddHit( *hitItr, m_IdScan_MaxNumLayers, m_maxBarrelLayer );
+	(*m_binMap)[sp_key-offset].AddHit( *hitItr, m_IdScan_MaxNumLayers, m_maxBarrelLayer );
       }
     }
   }
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.h b/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.h
index 18c7c9694331..99b92cf2816b 100644
--- a/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.h
+++ b/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.h
@@ -1,7 +1,7 @@
 // emacs: this is -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -51,7 +51,7 @@ public:
  
   ~iHitFilter();
   
-  int initialise(long maxlayers=19, double maxeta=3.0);
+  int initialise(long maxlayers, long maxBarrelLayer, double maxeta=3.0);
 
   double  getLayerThreshold() const { return m_layerThreshold; }
 
@@ -145,7 +145,8 @@ protected:                      // data members
   /// locally set parameters for number of layers (and max eta ??)
   long   m_IdScan_MaxNumLayers;
   double m_IdScan_MaxEta;
-  
+
+  long m_maxBarrelLayer = 6;
 };
 
 
-- 
GitLab


From 23ec97f1e751b54280be4f9850a66eae2856ff2b Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 16 Sep 2020 12:24:30 -0400
Subject: [PATCH 284/422] TrigInDetTruthEvent: Enable thread-safety checking.

Enable thread-safety checking.
---
 .../TrigInDetTruthEvent/ATLAS_CHECK_THREAD_SAFETY                | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 Trigger/TrigTruthEvent/TrigInDetTruthEvent/TrigInDetTruthEvent/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Trigger/TrigTruthEvent/TrigInDetTruthEvent/TrigInDetTruthEvent/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTruthEvent/TrigInDetTruthEvent/TrigInDetTruthEvent/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..c32223935608
--- /dev/null
+++ b/Trigger/TrigTruthEvent/TrigInDetTruthEvent/TrigInDetTruthEvent/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigTruthEvent/TrigInDetTruthEvent
-- 
GitLab


From b54f34adf57f04d4251d41ac25e5fb2afb2497d4 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 5 Sep 2020 20:40:43 -0400
Subject: [PATCH 285/422] InDetGeoModelUtils: thread-cppcheck

---
 .../InDetGeoModelUtils/InDetDDAthenaComps.h   | 20 ++++---------------
 .../InDetDetectorFactoryBase.h                | 10 +++++-----
 .../InDetGeoModelUtils/InDetMaterialManager.h |  8 ++++----
 .../InDetSubDetectorFactoryBase.h             | 14 ++++++-------
 .../InDetGeoModelUtils/ServiceVolumeMaker.h   |  8 ++++----
 .../InDetGeoModelUtils/VolumeBuilder.h        |  6 +++---
 .../InDetGeoModelUtils/VolumeSplitter.h       |  4 ++--
 .../src/InDetMaterialManager.cxx              |  8 ++++----
 .../src/ServiceVolumeMaker.cxx                |  6 +++---
 .../InDetGeoModelUtils/src/VolumeSplitter.cxx |  4 ++--
 10 files changed, 38 insertions(+), 50 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
index 7dd8641b422f..96ba01fe6e3f 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
@@ -24,19 +24,17 @@ public:
   AthenaComps(const std::string & msgStreamName);
 
   //Declaring the Message method for further use
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
 
   //Declaring the Method providing Verbosity Level
-  bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; }
+  bool msgLvl (MSG::Level lvl) { return m_msg.get().level() <= lvl; }
 
   void setDetStore(StoreGateSvc *);
   void setGeoDbTagSvc(IGeoDbTagSvc *);
   void setRDBAccessSvc(IRDBAccessSvc *);
   void setGeometryDBSvc(IGeometryDBSvc *);
 
-  StoreGateSvc * detStore() const;
   const IGeoDbTagSvc * geoDbTagSvc() const;
-  IRDBAccessSvc * rdbAccessSvc() const;
   const IGeometryDBSvc * geomDB() const;
   
   StoreGateSvc * detStore();
@@ -46,7 +44,7 @@ public:
   
 private:
   //Declaring private message stream member.
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+  Athena::MsgStreamMember m_msg;
   
   StoreGateSvc * m_detStore;
   IGeoDbTagSvc * m_geoDbTagSvc;
@@ -55,7 +53,7 @@ private:
 
 };
 
-inline StoreGateSvc * AthenaComps::detStore ATLAS_NOT_THREAD_SAFE () const
+inline StoreGateSvc * AthenaComps::detStore()
 {
   return m_detStore;
 }
@@ -65,21 +63,11 @@ inline const IGeoDbTagSvc * AthenaComps::geoDbTagSvc() const
   return m_geoDbTagSvc;
 }
 
-inline IRDBAccessSvc * AthenaComps::rdbAccessSvc ATLAS_NOT_THREAD_SAFE () const
-{
-  return m_rdbAccessSvc;
-}
-
 inline const IGeometryDBSvc * AthenaComps::geomDB() const
 {
   return m_geometryDBSvc;
 }
 
-inline StoreGateSvc * AthenaComps::detStore()
-{
-  return m_detStore;
-}
-
 inline IGeoDbTagSvc * AthenaComps::geoDbTagSvc()
 {
   return m_geoDbTagSvc;
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
index dfd46b3e9d47..b9da0eeb23d3 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
@@ -20,15 +20,15 @@ class DetectorFactoryBase : public GeoVDetectorFactory
 { 
 
 public:
-  DetectorFactoryBase(const InDetDD::AthenaComps * athenaComps)
+  DetectorFactoryBase(InDetDD::AthenaComps * athenaComps)
     : m_athenaComps(athenaComps)
   {}
 
-  StoreGateSvc * detStore ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->detStore();}
+  StoreGateSvc * detStore () {return m_athenaComps->detStore();}
 
   const IGeoDbTagSvc * geoDbTagSvc() const {return m_athenaComps->geoDbTagSvc();}
 
-  IRDBAccessSvc * rdbAccessSvc ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->rdbAccessSvc();}
+  IRDBAccessSvc * rdbAccessSvc() {return m_athenaComps->rdbAccessSvc();}
   
   const IGeometryDBSvc * geomDB() const {return m_athenaComps->geomDB();}
 
@@ -38,11 +38,11 @@ public:
   //Declaring the Method providing Verbosity Level
   bool msgLvl (MSG::Level lvl) const { return m_athenaComps->msgLvl(lvl); }
 
-  const InDetDD::AthenaComps *  getAthenaComps() {return m_athenaComps;}
+  InDetDD::AthenaComps *  getAthenaComps() {return m_athenaComps;}
 
 private:
   
-  const InDetDD::AthenaComps *  m_athenaComps;
+  InDetDD::AthenaComps *  m_athenaComps;
 
 };
 
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h
index 33bd2ada2b50..5f17b84770f8 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h
@@ -47,7 +47,7 @@ public:
 		       IRDBRecordset_ptr compositionTable,
 		       const std::string & space = "");
   InDetMaterialManager(const std::string & managerName, 
-		       const InDetDD::AthenaComps *) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe AthenaComps::detStore() const is used.
+		       InDetDD::AthenaComps *);
   ~InDetMaterialManager();
 
   void addWeightTable(IRDBRecordset_ptr weightTable, const std::string & space = "");
@@ -102,7 +102,7 @@ public:
   // in the arguments as a vector of materials and multiplictive factors.
   const GeoMaterial * getMaterialForVolumeLength(const std::string & name,
 						 const std::vector<std::string> & materialComponents, 
-						 const std::vector<double> factors, 
+						 const std::vector<double>& factors, 
 						 double volume, 
 						 double length);
   
@@ -132,7 +132,7 @@ public:
   void addMaterial(GeoMaterial *material);
 
   //Declaring the Message method for further use
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
 
   //Declaring the Method providing Verbosity Level
   bool msgLvl (MSG::Level lvl){ return m_msg.get().level() <= lvl; }
@@ -233,7 +233,7 @@ private:
   ExtraScaleFactorMap m_scalingMap;
 
   //Declaring private message stream member.
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+  Athena::MsgStreamMember m_msg;
 
   // Has linear weight flag. 
   bool m_extraFunctionality;
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h
index d09860ce6f81..166eb76e1e83 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h
@@ -26,26 +26,26 @@ class SubDetectorFactoryBase
 { 
 
 public:
-  SubDetectorFactoryBase(const InDetDD::AthenaComps * athenaComps)
+  SubDetectorFactoryBase(InDetDD::AthenaComps * athenaComps)
     : m_athenaComps(athenaComps),
       m_materialManager(0)
   {}
 
-  SubDetectorFactoryBase(const InDetDD::AthenaComps * athenaComps,
+  SubDetectorFactoryBase(InDetDD::AthenaComps * athenaComps,
 			 InDetMaterialManager * matManager)
     : m_athenaComps(athenaComps),
       m_materialManager(matManager)
   {}
 
-  StoreGateSvc * detStore ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->detStore();} // const method returns non-const pointer
+  StoreGateSvc * detStore() {return m_athenaComps->detStore();}
 
   const IGeoDbTagSvc * geoDbTagSvc() const {return m_athenaComps->geoDbTagSvc();}
 
-  IRDBAccessSvc * rdbAccessSvc ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->rdbAccessSvc();} // const method returns non-const pointer
+  IRDBAccessSvc * rdbAccessSvc() const {return m_athenaComps->rdbAccessSvc();}
   
   const IGeometryDBSvc * geomDB() const {return m_athenaComps->geomDB();}
 
-  InDetMaterialManager * materialManager ATLAS_NOT_THREAD_SAFE () const {return m_materialManager;} // const method returns non-const pointer
+  InDetMaterialManager * materialManager() {return m_materialManager;}
 
  //Declaring the Message method for further use
   MsgStream& msg (MSG::Level lvl) const { return m_athenaComps->msg(lvl); }
@@ -53,10 +53,10 @@ public:
   //Declaring the Method providing Verbosity Level
   bool msgLvl (MSG::Level lvl) const { return m_athenaComps->msgLvl(lvl); }
 
-  const InDetDD::AthenaComps *  getAthenaComps() {return m_athenaComps;}
+  InDetDD::AthenaComps *  getAthenaComps() {return m_athenaComps;}
   
 private:
-  const InDetDD::AthenaComps *  m_athenaComps;
+  InDetDD::AthenaComps *  m_athenaComps;
   
 protected:
   InDetMaterialManager * m_materialManager;
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.h
index 39d2dae48557..44c095c5e0cd 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef ServiceVolumeMaker_H 
@@ -99,7 +99,7 @@ namespace InDetDD {
   class ServiceVolumeMakerMgr {
   public:
     ServiceVolumeMakerMgr(IRDBRecordset_ptr table, const ServiceVolumeSchema & schema, 
-			  const InDetDD::AthenaComps * athenaComps);
+			  InDetDD::AthenaComps * athenaComps);
     
     double rmin(int index) const;
     double rmax(int index) const;
@@ -130,7 +130,7 @@ namespace InDetDD {
     IRDBRecordset_ptr m_table;
     IRDBRecordset_ptr m_layer;
     ServiceVolumeSchema m_schema;
-    const InDetDD::AthenaComps * m_athenaComps;
+    InDetDD::AthenaComps * m_athenaComps;
   };
 
   class ServiceVolumeMaker {
@@ -138,7 +138,7 @@ namespace InDetDD {
     ServiceVolumeMaker(const std::string & label,
 		       IRDBRecordset_ptr table, 
 		       const ServiceVolumeSchema & schema,
-		       const InDetDD::AthenaComps *) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe ServiceVolumeMakerMgr::readLayerShift method is used.
+		       InDetDD::AthenaComps *);
 		ServiceVolumeMaker(const ServiceVolumeMaker &) = delete;
 		ServiceVolumeMaker & operator =(const ServiceVolumeMaker &) = delete;
     ~ServiceVolumeMaker();
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h
index 39e1be7b0d97..46c3b99e2c64 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h
@@ -47,8 +47,8 @@ namespace InDetDD {
     GeoTransform * getPlacement(int iElement, int iCopy);
     GeoTransform * getPlacementEnvelope(int iElement, int iCopy,  int iMothElement);
 
-    MsgStream& msg (MSG::Level lvl) const { return m_msg.get() << lvl; }
-    bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg.get() << lvl; }
+    bool msgLvl (MSG::Level lvl) { return m_msg.get().level() <= lvl; }
 
     bool isEnvelopeOrChild(int iElement);
     int  getEnvelopeNum(int iElement);
@@ -59,7 +59,7 @@ namespace InDetDD {
   private:
     //const GeoShape * getShape(const ServiceVolume & param, double & volume);
     
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    Athena::MsgStreamMember m_msg;
     std::string m_region;
     double m_zcenter;
     const std::vector<const ServiceVolume *>* m_services;
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeSplitter.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeSplitter.h
index 6591156b0f3d..a3c58310e77a 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeSplitter.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeSplitter.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef InDetGeoModelUtils_VolumeSplitter_H
@@ -18,7 +18,7 @@ namespace InDetDD {
   public:
     VolumeSplitter();
     ~VolumeSplitter();
-    const std::vector<const ServiceVolume *> & splitAll(const Zone & zone,  const std::vector<const ServiceVolume *>);
+    const std::vector<const ServiceVolume *> & splitAll(const Zone & zone,  const std::vector<const ServiceVolume *>&);
     void split(const Zone & zone, const ServiceVolume & origVolume);
     const std::vector<const ServiceVolume *> & getVolumes() const {return m_volumes;}
     // Take ownership of volumes. If called user must delete the volumes. 
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx
index 286b443389e0..bcaf9930f2e4 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
  */
 
 #include "InDetGeoModelUtils/InDetMaterialManager.h"
@@ -65,7 +65,7 @@ InDetMaterialManager::InDetMaterialManager(const std::string& managerName, Store
 }
 
 InDetMaterialManager::InDetMaterialManager(const std::string& managerName,
-                                           const InDetDD::AthenaComps* athenaComps)
+                                           InDetDD::AthenaComps* athenaComps)
   : m_managerName(managerName),
   m_msg(managerName),
   m_extraFunctionality(true),
@@ -557,7 +557,7 @@ InDetMaterialManager::getMaterialForVolumeLength(const std::string& materialName
 
     std::vector<double> factors;
     std::vector<std::string> components;
-    for (MaterialCompositionMap::const_iterator iter = iterRange.first; iter != iterRange.second; iter++) {
+    for (MaterialCompositionMap::const_iterator iter = iterRange.first; iter != iterRange.second; ++iter) {
       double factorTmp = iter->second.factor;
       if (iter->second.actualLength > 0) factorTmp *= iter->second.actualLength / length;
       factors.push_back(factorTmp);
@@ -606,7 +606,7 @@ InDetMaterialManager::getMaterialForVolumeLength(const std::string& name,
 const GeoMaterial*
 InDetMaterialManager::getMaterialForVolumeLength(const std::string& name,
                                                  const std::vector<std::string>& materialComponents,
-                                                 const std::vector<double> factors,
+                                                 const std::vector<double>& factors,
                                                  double volume,
                                                  double length) {
   // Make sure we have a valid volume size.
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx
index 00ee4b9fc97e..051655368a5a 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx
@@ -84,7 +84,7 @@ namespace InDetDD {
   }
 
   ServiceVolumeMakerMgr::ServiceVolumeMakerMgr(IRDBRecordset_ptr table, const ServiceVolumeSchema& schema,
-                                               const InDetDD::AthenaComps* athenaComps)
+                                               InDetDD::AthenaComps* athenaComps)
     : m_table(table),
     m_schema(schema),
     m_athenaComps(athenaComps)
@@ -218,7 +218,7 @@ namespace InDetDD {
   }
 
   std::vector<double>
-  ServiceVolumeMakerMgr::readLayerShift ATLAS_NOT_THREAD_SAFE () const { // Thread unsafe IRDBAccessSvc* InDetDD::AthenaComps::rdbAccessSvc() const is used.
+  ServiceVolumeMakerMgr::readLayerShift() const {
     std::vector<double> layerShift;
 
     IRDBAccessSvc* rdbSvc = m_athenaComps->rdbAccessSvc();
@@ -243,7 +243,7 @@ namespace InDetDD {
 
   ServiceVolumeMaker::ServiceVolumeMaker(const std::string& label,
                                          IRDBRecordset_ptr table, const ServiceVolumeSchema& schema,
-                                         const InDetDD::AthenaComps* athenaComps)
+                                         InDetDD::AthenaComps* athenaComps)
     : m_label(label) {
     m_mgr = new ServiceVolumeMakerMgr(table, schema, athenaComps);
     m_layerShift = m_mgr->readLayerShift();
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitter.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitter.cxx
index 26586912aa58..c42abfce85fa 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitter.cxx
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitter.cxx
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
  */
 
 #include "InDetGeoModelUtils/VolumeSplitter.h"
@@ -25,7 +25,7 @@ namespace InDetDD {
   }
 
   const std::vector<const ServiceVolume*>&
-  VolumeSplitter::splitAll(const Zone& zone, const std::vector<const ServiceVolume*> origVolumeList) {
+  VolumeSplitter::splitAll(const Zone& zone, const std::vector<const ServiceVolume*>& origVolumeList) {
     for (unsigned int i = 0; i < origVolumeList.size(); ++i) {
       split(zone, *(origVolumeList[i]));
     }
-- 
GitLab


From 1a8238f96c3cb600ed602b607dd3d7ad3994b6b5 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sat, 19 Sep 2020 04:52:57 +0200
Subject: [PATCH 286/422] PixelGeoModel: Const adjustments.

Const adjustments to go with thread-safety cleanups in InDetGeoModelUtilities.
---
 .../PixelGeoModel/src/OraclePixGeoManager.cxx              | 2 +-
 .../InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h  | 2 +-
 .../PixelGeoModel/src/PixelDetectorFactory.cxx             | 2 +-
 .../InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h | 2 +-
 .../PixelGeoModel/src/PixelDetectorFactoryDC2.cxx          | 2 +-
 .../PixelGeoModel/src/PixelDetectorFactoryDC2.h            | 2 +-
 .../PixelGeoModel/src/PixelDetectorFactorySR1.cxx          | 2 +-
 .../PixelGeoModel/src/PixelDetectorFactorySR1.h            | 2 +-
 .../PixelGeoModel/src/PixelGeometryManager.cxx             | 4 ++--
 .../InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.h | 7 ++++---
 10 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx
index 5ddd97ad6741..113d7f1cde55 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx
@@ -41,7 +41,7 @@ using InDetDD::PixelDetectorManager;
 
 using namespace std;
 
-OraclePixGeoManager::OraclePixGeoManager(const PixelGeoModelAthenaComps * athenaComps)
+OraclePixGeoManager::OraclePixGeoManager(PixelGeoModelAthenaComps * athenaComps)
   : PixelGeometryManager(athenaComps), 
     m_eta(0),
     m_phi(0),
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h
index 1ad1b7df82d5..15c423c69ac8 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h
@@ -174,7 +174,7 @@ class OraclePixGeoManager : public PixelGeometryManager {
 
  public:
 
-  OraclePixGeoManager(const PixelGeoModelAthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe init method is used.
+  OraclePixGeoManager(PixelGeoModelAthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe init method is used.
   ~OraclePixGeoManager();
   
   void init();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx
index 4dd77253ff85..aca2adef16ec 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx
@@ -32,7 +32,7 @@
 using InDetDD::PixelDetectorManager; 
 using InDetDD::SiCommonItems; 
 
-PixelDetectorFactory::PixelDetectorFactory(const PixelGeoModelAthenaComps * athenaComps,
+PixelDetectorFactory::PixelDetectorFactory(PixelGeoModelAthenaComps * athenaComps,
 					   const PixelSwitches & switches)
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_detectorManager(0),
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h
index f24855015125..5dfd2b11d15b 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h
@@ -21,7 +21,7 @@ class PixelDetectorFactory : public InDetDD::DetectorFactoryBase {
  public:
   
   // Constructor:
-  PixelDetectorFactory(const PixelGeoModelAthenaComps * athenaComps,
+  PixelDetectorFactory(PixelGeoModelAthenaComps * athenaComps,
 		       const PixelSwitches & switches) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe GeoVPixelFactory class is used.
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx
index 709bb24f4a1f..ad7183b444da 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx
@@ -30,7 +30,7 @@ using InDetDD::SiCommonItems;
 using namespace PixelGeoDC2;
 
 
-PixelDetectorFactoryDC2::PixelDetectorFactoryDC2(const PixelGeoModelAthenaComps * athenaComps,
+PixelDetectorFactoryDC2::PixelDetectorFactoryDC2(PixelGeoModelAthenaComps * athenaComps,
 						 const PixelSwitches & switches)						 
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_detectorManager(0)
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h
index 3f30fb601be5..b0b0f119fa60 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h
@@ -19,7 +19,7 @@ class PixelDetectorFactoryDC2 : public InDetDD::DetectorFactoryBase {
  public:
   
   // Constructor:
-  PixelDetectorFactoryDC2(const PixelGeoModelAthenaComps * athenaComps,
+  PixelDetectorFactoryDC2(PixelGeoModelAthenaComps * athenaComps,
 			  const PixelSwitches & switches) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::DetectorFactoryBase::detStore method is used.
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx
index be566a3cdcd8..a0a5593c539e 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx
@@ -31,7 +31,7 @@
 using InDetDD::PixelDetectorManager; 
 using InDetDD::SiCommonItems; 
 
-PixelDetectorFactorySR1::PixelDetectorFactorySR1(const PixelGeoModelAthenaComps * athenaComps,
+PixelDetectorFactorySR1::PixelDetectorFactorySR1(PixelGeoModelAthenaComps * athenaComps,
 						 const PixelSwitches & switches)
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_detectorManager(0)
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h
index 56e72a015ed0..bdd8df13e7d1 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h
@@ -20,7 +20,7 @@ class PixelDetectorFactorySR1 : public InDetDD::DetectorFactoryBase {
  public:
   
   // Constructor:
-  PixelDetectorFactorySR1(const PixelGeoModelAthenaComps * athenaComps,
+  PixelDetectorFactorySR1(PixelGeoModelAthenaComps * athenaComps,
 			  const PixelSwitches & switches) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe GeoVPixelFactory class is used.
     
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx
index b8f2f517b623..db6c95719e64 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx
@@ -1,12 +1,12 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "PixelGeometryManager.h"
 
 using namespace std;
 
-PixelGeometryManager::PixelGeometryManager(const PixelGeoModelAthenaComps * athenaComps) :
+PixelGeometryManager::PixelGeometryManager(PixelGeoModelAthenaComps * athenaComps) :
   m_athenaComps(athenaComps)
 {}
 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.h
index 7a4785c3da8e..14bb7670cbcc 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelGeometryManager_H
@@ -29,7 +29,7 @@ class PixelGeometryManager {
 
 public:
   
-  PixelGeometryManager(const PixelGeoModelAthenaComps * athenaComps);
+  PixelGeometryManager(PixelGeoModelAthenaComps * athenaComps);
   virtual ~PixelGeometryManager();
 
   //
@@ -621,6 +621,7 @@ public:
   //Declaring the Method providing Verbosity Level
   bool msgLvl (MSG::Level lvl) const { return m_athenaComps->msgLvl(lvl); }
 
+  PixelGeoModelAthenaComps * athenaComps() {return m_athenaComps;}
   const PixelGeoModelAthenaComps * athenaComps() const {return m_athenaComps;}
 
   /////
@@ -661,7 +662,7 @@ public:
 private:
   
   // Access to athena components
-  const PixelGeoModelAthenaComps * m_athenaComps;
+  PixelGeoModelAthenaComps * m_athenaComps;
 
 
 };
-- 
GitLab


From 85f595b1de213e2a6ba99423c6337d32f478f6a2 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sat, 19 Sep 2020 04:53:56 +0200
Subject: [PATCH 287/422] SCT_GeoModel: Const adjustments.

Const adjustments to go with thread-safety cleanups in InDetGeoModelUtilities.
---
 .../InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h  | 6 +++---
 .../SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h         | 2 +-
 .../InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx         | 4 ++--
 .../InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx  | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
index f59eee96d252..7f960b3832b5 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
@@ -19,9 +19,9 @@ class SCT_DataBase
   
 public:
 
-  SCT_DataBase(const SCT_GeoModelAthenaComps* athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe AthenaComps::rdbAccessSvc const method is used.
+  SCT_DataBase(SCT_GeoModelAthenaComps* athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe AthenaComps::rdbAccessSvc const method is used.
 
-  const SCT_GeoModelAthenaComps* athenaComps() const;
+  SCT_GeoModelAthenaComps* athenaComps();
 
   IRDBRecordset_ptr weightTable() const;
   IRDBRecordset_ptr scalingTable() const;
@@ -100,7 +100,7 @@ private:
 
 private:
 
-  const SCT_GeoModelAthenaComps* m_athenaComps;
+  SCT_GeoModelAthenaComps* m_athenaComps;
 
   std::string m_sctVersionTag;
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
index be3d76c245d8..4158c1406879 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
@@ -24,7 +24,7 @@ class SCT_DetectorFactory : public InDetDD::DetectorFactoryBase
   
  public: 
   // Constructor
-  SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaComps, 
+  SCT_DetectorFactory(SCT_GeoModelAthenaComps * athenaComps, 
 		      const SCT_Options & options) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::DetectorFactoryBase::rdbAccessSvc() method is used.
 
   // Destructor
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
index 8b211df7544e..be090e023fb7 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
@@ -15,7 +15,7 @@
 
 #include <iostream>
 
-SCT_DataBase::SCT_DataBase(const SCT_GeoModelAthenaComps * athenaComps)
+SCT_DataBase::SCT_DataBase(SCT_GeoModelAthenaComps * athenaComps)
 {
   m_athenaComps = athenaComps;
 
@@ -188,7 +188,7 @@ SCT_DataBase::SCT_DataBase(const SCT_GeoModelAthenaComps * athenaComps)
 
 }
 
-const SCT_GeoModelAthenaComps* SCT_DataBase::athenaComps() const { return m_athenaComps; }
+SCT_GeoModelAthenaComps* SCT_DataBase::athenaComps() { return m_athenaComps; }
 
 IRDBRecordset_ptr SCT_DataBase::weightTable() const {return m_weightTable;}
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx
index bf0223e215cc..610527dc10bd 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx
@@ -63,7 +63,7 @@
 using InDetDD::SCT_DetectorManager; 
 using InDetDD::SiCommonItems; 
 
-SCT_DetectorFactory::SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaComps,
+SCT_DetectorFactory::SCT_DetectorFactory(SCT_GeoModelAthenaComps * athenaComps,
 					 const SCT_Options & options)
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_useDynamicAlignFolders(false)
-- 
GitLab


From a6b9499ac18be1421027c89dbb1b501ebdb71248 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sat, 19 Sep 2020 04:54:59 +0200
Subject: [PATCH 288/422] TRT_GeoModel: Const adjustments.

Const adjustments to go with thread-safety cleanups in InDetGeoModelUtilities.
---
 .../TRT_GeoModel/src/TRTDetectorFactory_Full.cxx              | 2 +-
 .../InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h  | 2 +-
 .../TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx    | 2 +-
 .../TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h      | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx
index 63ae8c42e0d8..3ced1b74b7ca 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx
@@ -82,7 +82,7 @@ double magn(GeoTrf::Vector2D& vector)
 }
 /////////////////////////////////// Constructor //////////////////////////////////
 //
-TRTDetectorFactory_Full::TRTDetectorFactory_Full(const InDetDD::AthenaComps * athenaComps,
+TRTDetectorFactory_Full::TRTDetectorFactory_Full(InDetDD::AthenaComps * athenaComps,
 						 const ITRT_StrawStatusSummaryTool* sumTool, // added for Argon
 						 bool useOldActiveGasMixture,
 						 bool DC2CompatibleBarrelCoordinates,
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
index 561fa50e21b7..eed23fcd1885 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
@@ -36,7 +36,7 @@ class ATLAS_NOT_THREAD_SAFE TRTDetectorFactory_Full : public InDetDD::DetectorFa
   //--------------------------Public Interface:--------------------------------//
   //                                                                           //
   // Constructor:                                                              //
-  TRTDetectorFactory_Full(const InDetDD::AthenaComps * athenaComps,            //
+  TRTDetectorFactory_Full(InDetDD::AthenaComps * athenaComps,                  //
 			  const ITRT_StrawStatusSummaryTool * sumTool,         //
 			  bool useOldActiveGasMixture,                         //
 			  bool DC2CompatibleBarrelCoordinates,                 //
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
index 09c2173e1872..02fd09c0bb6a 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
@@ -14,7 +14,7 @@
 #include "InDetGeoModelUtils/InDetDDAthenaComps.h"
 
 //_________________________________________________________________________________________
-TRT_DetDescrDB_ParameterInterface::TRT_DetDescrDB_ParameterInterface(const InDetDD::AthenaComps * athenaComps) :
+TRT_DetDescrDB_ParameterInterface::TRT_DetDescrDB_ParameterInterface(InDetDD::AthenaComps * athenaComps) :
   TRTParameterInterface(),  m_athenaComps(athenaComps), m_distortedMatManager(0), m_placements(0)
 { SetValues(); }
 
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
index 704469026c05..7d294887ce1e 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
@@ -23,7 +23,7 @@ public:
 
    
   // Only allowed constructor
-  TRT_DetDescrDB_ParameterInterface(const InDetDD::AthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe SetValues method is used.
+  TRT_DetDescrDB_ParameterInterface(InDetDD::AthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe SetValues method is used.
 
   ~TRT_DetDescrDB_ParameterInterface();
   // delete copy c'tor
@@ -49,7 +49,7 @@ public:
   
 private:
 
-  const InDetDD::AthenaComps * m_athenaComps;
+  InDetDD::AthenaComps * m_athenaComps;
 
   const InDetDD::DistortedMaterialManager * m_distortedMatManager;
   TopLevelPlacements * m_placements;
-- 
GitLab


From db07b5d094d71c90164c72fa1175894a9972d934 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sat, 19 Sep 2020 04:41:03 +0200
Subject: [PATCH 289/422] InDetServMatGeoModel: Const adjustments.

Const adjustments to go with thread-safety cleanups in InDetGeoModelUtilities.
---
 .../InDetServMatGeoModel/EndPlateFactory.h                  | 4 ++--
 .../InDetServMatGeoModel/InDetServMatFactory.h              | 2 +-
 .../InDetServMatGeoModel/InDetServMatFactoryDC3.h           | 4 ++--
 .../InDetServMatGeoModel/InDetServMatFactorySLHC.h          | 6 +++---
 .../InDetServMatGeoModel/InDetServMatGeometryManager.h      | 4 ++--
 .../InDetServMatGeoModel/PixelServMatFactory.h              | 4 ++--
 .../InDetServMatGeoModel/PixelServMatFactoryDC3.h           | 4 ++--
 .../InDetServMatGeoModel/SCT_ServMatFactory.h               | 4 ++--
 .../InDetServMatGeoModel/SCT_ServMatFactoryDC3.h            | 4 ++--
 .../InDetServMatGeoModel/SquirrelCageFactory.h              | 4 ++--
 .../InDetServMatGeoModel/SupportRailFactory.h               | 4 ++--
 .../InDetServMatGeoModel/TRT_ServMatFactory.h               | 4 ++--
 .../InDetServMatGeoModel/TRT_ServMatFactoryDC3.h            | 4 ++--
 .../InDetServMatGeoModel/src/EndPlateFactory.cxx            | 2 +-
 .../InDetServMatGeoModel/src/InDetServMatFactory.cxx        | 2 +-
 .../InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx     | 2 +-
 .../InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx    | 2 +-
 .../src/InDetServMatGeometryManager.cxx                     | 2 +-
 .../InDetServMatGeoModel/src/PixelServMatFactory.cxx        | 2 +-
 .../InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx     | 2 +-
 .../InDetServMatGeoModel/src/SCT_ServMatFactory.cxx         | 2 +-
 .../InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx      | 2 +-
 .../InDetServMatGeoModel/src/SquirrelCageFactory.cxx        | 2 +-
 .../InDetServMatGeoModel/src/SupportRailFactory.cxx         | 2 +-
 .../InDetServMatGeoModel/src/TRT_ServMatFactory.cxx         | 2 +-
 .../InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx      | 2 +-
 26 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactory.h
index 1917d6a747c0..79d6e7922659 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactory.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_ENDPLATEFACTORY_H
@@ -14,7 +14,7 @@ class EndPlateFactory : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  EndPlateFactory(const InDetDD::AthenaComps * athenaComps, 
+  EndPlateFactory(InDetDD::AthenaComps * athenaComps, 
 		  InDetMaterialManager * matManager);
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactory.h
index 7ba70123cfb7..2b5d19214b4c 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactory.h
@@ -18,7 +18,7 @@ class InDetServMatFactory : public InDetDD::DetectorFactoryBase  {
  public:
   
   // Constructor:
-  InDetServMatFactory(const InDetDD::AthenaComps * athenaComps);
+  InDetServMatFactory(InDetDD::AthenaComps * athenaComps);
 
   // Destructor:
   ~InDetServMatFactory();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC3.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC3.h
index 7bac6f690f0f..18ea92b01bc9 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC3.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC3.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_INDETSERVMATFACTORYDC3_H
@@ -17,7 +17,7 @@ class InDetServMatFactoryDC3: public InDetDD::DetectorFactoryBase  {
  public:
   
   // Constructor:
-  InDetServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps);
+  InDetServMatFactoryDC3(InDetDD::AthenaComps * athenaComps);
   
   // Destructor:
   ~InDetServMatFactoryDC3();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactorySLHC.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactorySLHC.h
index 5599b6e4376c..bf452be441cf 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactorySLHC.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactorySLHC.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_INDETSERVMATFACTORYSLHC_H
@@ -17,7 +17,7 @@ class InDetServMatFactorySLHC : public InDetDD::DetectorFactoryBase {
  public:
   
   // Constructor:
-  InDetServMatFactorySLHC(const InDetServMatAthenaComps * athenaComps);
+  InDetServMatFactorySLHC(InDetServMatAthenaComps * athenaComps);
 
   // Destructor:
   ~InDetServMatFactorySLHC();
@@ -46,7 +46,7 @@ class InDetServMatFactorySLHC : public InDetDD::DetectorFactoryBase {
   IRDBRecordset_ptr m_InDetServGenEnvelope;
 
   // Need acceess to derived version
-  const InDetServMatAthenaComps * m_athenaComps;
+  InDetServMatAthenaComps * m_athenaComps;
 
   // private data
   InDetDD::InDetServMatManager *m_manager;
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h
index 0155f5478548..2f033050610d 100644
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h
@@ -15,7 +15,7 @@ class InDetMaterialManager;
 class InDetServMatGeometryManager
 {
 public:
-  InDetServMatGeometryManager(const InDetDD::AthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::AthenaComps::rdbAccessSvc method is used.
+  InDetServMatGeometryManager(InDetDD::AthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::AthenaComps::rdbAccessSvc method is used.
  
   ~InDetServMatGeometryManager();
   
@@ -182,7 +182,7 @@ private:
   IRDBRecordset_ptr m_scalingTable;
 
   // Access to athena components
-  const InDetDD::AthenaComps * m_athenaComps;
+  InDetDD::AthenaComps * m_athenaComps;
 
   // Material Manager
   InDetMaterialManager * m_matMgr;
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactory.h
index 5fb67d75e559..2b90d5006f72 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactory.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_PIXELSERVMATFACTORY_H
@@ -15,7 +15,7 @@ class PixelServMatFactory  : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  PixelServMatFactory(const InDetDD::AthenaComps * athenaComps);
+  PixelServMatFactory(InDetDD::AthenaComps * athenaComps);
   
   // Destructor:
   ~PixelServMatFactory();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC3.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC3.h
index 5bf2b510a761..2c550cb27553 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC3.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC3.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_PIXELSERVMATFACTORYDC3_H
@@ -13,7 +13,7 @@ class PixelServMatFactoryDC3 : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  PixelServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+  PixelServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 			 InDetMaterialManager * matManager);
 
   
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactory.h
index 45d4ff1ce811..9df267ccda17 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactory.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_SCT_SERVMATFACTORY_H
@@ -17,7 +17,7 @@ class SCT_ServMatFactory : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  SCT_ServMatFactory(const InDetDD::AthenaComps * athenaComps);
+  SCT_ServMatFactory(InDetDD::AthenaComps * athenaComps);
 
   // Destructor:
   ~SCT_ServMatFactory();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC3.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC3.h
index fcaab9256eba..7c68863a9d85 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC3.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC3.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_SCT_SERVMATFACTORYDC3_H
@@ -20,7 +20,7 @@ class SCT_ServMatFactoryDC3 : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  SCT_ServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+  SCT_ServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 			InDetMaterialManager * matManager);
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactory.h
index b205da8ee6a4..b1340ab3dbfc 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactory.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_SQUIRRELCAGEFACTORY_H
@@ -14,7 +14,7 @@ class SquirrelCageFactory : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  SquirrelCageFactory(const InDetDD::AthenaComps * athenaComps, 
+  SquirrelCageFactory(InDetDD::AthenaComps * athenaComps, 
 		      InDetMaterialManager * matManager);
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactory.h
index 63f2b30e4ff7..185d0e9d54f9 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactory.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_SUPPORTRAILFACTORY_H
@@ -14,7 +14,7 @@ class SupportRailFactory : public InDetDD::SubDetectorFactoryBase {
  public:
   
   // Constructor:
-  SupportRailFactory(const InDetDD::AthenaComps * athenaComps, 
+  SupportRailFactory(InDetDD::AthenaComps * athenaComps, 
 		     InDetMaterialManager * matManager);
     
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactory.h
index 32e6d4f4d4b6..9b107941590f 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactory.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_TRT_SERVMATFACTORY_H
@@ -17,7 +17,7 @@ class TRT_ServMatFactory : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  TRT_ServMatFactory(const InDetDD::AthenaComps * athenaComps);
+  TRT_ServMatFactory(InDetDD::AthenaComps * athenaComps);
 
   // Destructor:
   ~TRT_ServMatFactory();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC3.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC3.h
index 19ac5f7fde09..b6129dc92b96 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC3.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC3.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_TRT_SERVMATFACTORYDC3_H
@@ -19,7 +19,7 @@ class TRT_ServMatFactoryDC3 : public InDetDD::SubDetectorFactoryBase {
  public:
   
   // Constructor:
-  TRT_ServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+  TRT_ServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 			InDetMaterialManager * matManager);
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx
index e8213943495a..a546533a46cc 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx
@@ -30,7 +30,7 @@
 #include <iostream>
 
 
-EndPlateFactory::EndPlateFactory(const InDetDD::AthenaComps * athenaComps, InDetMaterialManager * matManager)
+EndPlateFactory::EndPlateFactory(InDetDD::AthenaComps * athenaComps, InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
 }
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx
index d6131c8fd554..f5168e20530f 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx
@@ -41,7 +41,7 @@
 
 #include <iostream>
 
-InDetServMatFactory::InDetServMatFactory(const InDetDD::AthenaComps * athenaComps)
+InDetServMatFactory::InDetServMatFactory(InDetDD::AthenaComps * athenaComps)
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_manager(0)
 {  
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx
index 7940808e20f6..da80a1fb0eac 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx
@@ -40,7 +40,7 @@
 #include "GaudiKernel/PhysicalConstants.h"
 #include <iostream>
 
-InDetServMatFactoryDC3::InDetServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps)
+InDetServMatFactoryDC3::InDetServMatFactoryDC3(InDetDD::AthenaComps * athenaComps)
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_manager(0)
 {}
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx
index a6fb9a02b8bb..5ddc937358ac 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx
@@ -40,7 +40,7 @@
 #include "GaudiKernel/PhysicalConstants.h"
 #include <iostream>
 
-InDetServMatFactorySLHC::InDetServMatFactorySLHC(const InDetServMatAthenaComps * athenaComps)
+InDetServMatFactorySLHC::InDetServMatFactorySLHC(InDetServMatAthenaComps * athenaComps)
   :  InDetDD::DetectorFactoryBase(athenaComps),
      m_athenaComps(athenaComps),
      m_manager(0)
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx
index f5e9a48132ad..33ba286ac6fe 100644
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx
@@ -12,7 +12,7 @@
 
 #include "GaudiKernel/SystemOfUnits.h"
 
-InDetServMatGeometryManager::InDetServMatGeometryManager(const InDetDD::AthenaComps * athenaComps)   
+InDetServMatGeometryManager::InDetServMatGeometryManager(InDetDD::AthenaComps * athenaComps)   
   : m_athenaComps(athenaComps),
     m_matMgr(0)
 {
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx
index 1cd41e4df1a7..a200789c0e62 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx
@@ -30,7 +30,7 @@
 #include <iostream>
 
 
-PixelServMatFactory::PixelServMatFactory(const InDetDD::AthenaComps * athenaComps)
+PixelServMatFactory::PixelServMatFactory(InDetDD::AthenaComps * athenaComps)
   : InDetDD::SubDetectorFactoryBase(athenaComps)
 {}
 
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx
index 90351e689cd3..c81a5897ff25 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx
@@ -32,7 +32,7 @@
 #define SKIPCYLINDER 3
 //#define NUMBEROFCYLINDER 7
 
-PixelServMatFactoryDC3::PixelServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+PixelServMatFactoryDC3::PixelServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 					       InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx
index e6eb4ee1b487..7811c6d21eb0 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx
@@ -32,7 +32,7 @@
 #include <sstream>
 #include <iostream>
 
-SCT_ServMatFactory::SCT_ServMatFactory(const InDetDD::AthenaComps * athenaComps)
+SCT_ServMatFactory::SCT_ServMatFactory(InDetDD::AthenaComps * athenaComps)
   : InDetDD::SubDetectorFactoryBase(athenaComps)
 {
 }
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx
index fd3a7bd810d0..babf016ac03f 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx
@@ -35,7 +35,7 @@
 
 #include <sstream>
 
-SCT_ServMatFactoryDC3::SCT_ServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+SCT_ServMatFactoryDC3::SCT_ServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 					     InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx
index 083a0be6babd..1de085da22d8 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx
@@ -30,7 +30,7 @@
 #include <iostream>
 
 
-SquirrelCageFactory::SquirrelCageFactory(const InDetDD::AthenaComps * athenaComps, 
+SquirrelCageFactory::SquirrelCageFactory(InDetDD::AthenaComps * athenaComps, 
 					 InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx
index d7dd2a222df1..21fc8b9e3005 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx
@@ -32,7 +32,7 @@
 #include <math.h>
 
 
-SupportRailFactory::SupportRailFactory(const InDetDD::AthenaComps * athenaComps, 
+SupportRailFactory::SupportRailFactory(InDetDD::AthenaComps * athenaComps, 
 				       InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx
index 274ee7b48c7b..81ad9c3262f6 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx
@@ -33,7 +33,7 @@
 #include <sstream>
 #include <iostream>
 
-TRT_ServMatFactory::TRT_ServMatFactory(const InDetDD::AthenaComps * athenaComps)
+TRT_ServMatFactory::TRT_ServMatFactory(InDetDD::AthenaComps * athenaComps)
   : InDetDD::SubDetectorFactoryBase(athenaComps)
 {
 }
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx
index 493d0eb15808..9341703b36a2 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx
@@ -33,7 +33,7 @@
 #include <sstream>
 #include <iostream>
 
-TRT_ServMatFactoryDC3::TRT_ServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+TRT_ServMatFactoryDC3::TRT_ServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 					     InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
-- 
GitLab


From 351a2d2075e11553c0d01f2ba38b9558da52f0ae Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sat, 19 Sep 2020 19:40:27 +0200
Subject: [PATCH 290/422] Thread-safety warnings.

---
 .../SubDetectorEnvelopes/CMakeLists.txt            |  2 +-
 .../SubDetectorEnvelopes/IEnvelopeDefSvc.h         | 14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt b/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt
index d186c2168089..416349c21213 100644
--- a/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt
+++ b/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt
@@ -10,7 +10,7 @@ find_package( CLHEP )
 atlas_add_library( SubDetectorEnvelopesLib
                    INTERFACE
                    PUBLIC_HEADERS SubDetectorEnvelopes
-                   LINK_LIBRARIES GaudiKernel AtlasDetDescr )
+                   LINK_LIBRARIES GaudiKernel AtlasDetDescr CxxUtils )
 
 atlas_add_component( SubDetectorEnvelopes
                      src/*.cxx
diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.h b/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.h
index 76671fd8cf5e..3883433a218c 100644
--- a/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.h
+++ b/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -17,6 +17,8 @@
 // SubDetectorEnvelopes includes
 #include "SubDetectorEnvelopes/RZPair.h"
 
+#include "CxxUtils/checker_macros.h"
+
 class IEnvelopeDefSvc : virtual public IInterface {
   /**
    @class IEnvelopeDefSvc
@@ -51,11 +53,11 @@ class IEnvelopeDefSvc : virtual public IInterface {
     /** legacy methods
           Any client should update to use the methods defined above!
           The following lecagy methods will be phased out once all clients have migrated to the new methods above */
-    RZPairVector &getBeamPipeRZValues( unsigned short = 0) const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasForward) ); }
-    RZPairVector &getInDetRZValues( unsigned short = 0)    const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasID) );      }
-    RZPairVector &getCaloRZValues( unsigned short = 0)     const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasCalo) );    }
-    RZPairVector &getMuonRZValues( unsigned short = 0)     const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasMS) );      }
-    RZPairVector &getCavernRZValues( unsigned short = 0)   const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasCavern) );  }
+    RZPairVector &getBeamPipeRZValues ATLAS_NOT_THREAD_SAFE ( unsigned short = 0) const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasForward) ); }
+    RZPairVector &getInDetRZValues ATLAS_NOT_THREAD_SAFE ( unsigned short = 0)    const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasID) );      }
+    RZPairVector &getCaloRZValues ATLAS_NOT_THREAD_SAFE ( unsigned short = 0)     const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasCalo) );    }
+    RZPairVector &getMuonRZValues ATLAS_NOT_THREAD_SAFE ( unsigned short = 0)     const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasMS) );      }
+    RZPairVector &getCavernRZValues ATLAS_NOT_THREAD_SAFE ( unsigned short = 0)   const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasCavern) );  }
 
   protected:
     /** mirror the given srcRZ RZPairVector in the XY-plane to describe all corner points
-- 
GitLab


From 0d8a420691a3e4acf10e8f06ca6e87841c703d3b Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Sat, 19 Sep 2020 21:19:47 +0000
Subject: [PATCH 291/422] Merge branch 'LUTTR' into '21.3'

Simulation r-index endless loop fix

See merge request atlas/athena!36067

(cherry picked from commit 32fb661d3f0b7d0e63bb2d8253f7bcd7a394a2e3)

5ee570b5 fixing endless loop at rindex bit assignment
4d7c6566 fixed warning message
50a74202 fixed unasigned type
---
 .../TrigT1NSWSimTools/src/StripSegmentTool.cxx       | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx
index 91cb62d41dac..198d12de34f1 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx
@@ -142,6 +142,11 @@ namespace NSWL1 {
     float step=(range.second-range.first)/nSlices;
     if(val<=range.first) return 0;
     if(val>=range.second) return nSlices-1;
+
+    //the loop gets stuck if the value is between the last and second-to-last step (255-256)
+    if(val>=range.first+(nSlices-1)*step){
+      return nSlices-1;
+    }
     for(uint8_t i=0;i<nSlices;i++){
             if(range.first+i*step>=val){
                 return i;
@@ -288,6 +293,7 @@ namespace NSWL1 {
             continue;
          }
          
+         //S.I instead of doing all these stuff like below, which is quite error prone  why dont we use TVectors?
          if(glx>=0 && gly>=0){
              phi=atan(gly/glx);
          }
@@ -304,7 +310,7 @@ namespace NSWL1 {
          else{
             ATH_MSG_ERROR("Unexpected error, global x or global y are not a number");//S.I does this even necessary ? then what ?
          }
-        
+
         //However it needs to be kept an eye on... will be something in between 7 and 15 mrad needs to be decided 
         //if(std::abs(dtheta)>15) return StatusCode::SUCCESS; 
         
@@ -315,14 +321,12 @@ namespace NSWL1 {
         sign= (std::abs(theta_inf)<std::abs(theta)) ? 1: -1;
         float delta_r=delta_z*tan(theta_inf);
         float rfar=avg_r+sign*delta_r;
-
  
         if( rfar > m_rbounds.second || rfar < m_rbounds.first ){
             ATH_MSG_WARNING("measured r is out of detector envelope! rfar="<<rfar<<" rmax="<<m_rbounds.second);
             return StatusCode::SUCCESS;
         }
         
-        
         uint8_t rIndex=0;
         switch(m_ridxScheme){
             case 0:
@@ -335,7 +339,6 @@ namespace NSWL1 {
                 break;   
         }
         
-        
         bool phiRes=true;
         bool lowRes=false;//we do not have a recipe  for a singlewedge trigger.  so lowres is always false for now
         uint8_t dtheta_int=findDtheta(dtheta);
@@ -441,3 +444,4 @@ namespace NSWL1 {
     }
 
 }
+ 
-- 
GitLab


From 2ebb124ba8fe58548b8c9ac401ea6d67bf2d97a8 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Sun, 20 Sep 2020 03:51:51 +0200
Subject: [PATCH 292/422] fixed style issues

---
 .../tauRecTools/Root/TauJetRNNUtils.cxx       | 38 ++++++++-----------
 1 file changed, 15 insertions(+), 23 deletions(-)

diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index 0d062daa6a76..c2b5331a954f 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -260,45 +260,45 @@ bool ptIntermediateAxis(const xAOD::TauJet &tau, double &out) {
 }
 
 bool ptJetSeed_log(const xAOD::TauJet &tau, double &out) {
-  out = TMath::Log10(std::max(tau.ptJetSeed()/*tau.auxdata<float>("trk_ptJetSeed")*/, 1e-3));// tau.ptJetSeed()
+  out = TMath::Log10(std::max(tau.ptJetSeed(), 1e-3));
   return true;
 }
 
-bool     absleadTrackEta(const xAOD::TauJet &tau, double &out){
+bool absleadTrackEta(const xAOD::TauJet &tau, double &out){
   out = std::max(0.f, tau.auxdata<float>("ABS_ETA_LEAD_TRACK"));
   return true;
 }
 
-bool     leadTrackDeltaEta(const xAOD::TauJet &tau, double &out){
+bool leadTrackDeltaEta(const xAOD::TauJet &tau, double &out){
   out = std::max(0.f, tau.auxdata<float>("TAU_ABSDELTAETA"));
   return true;
 }
 
-bool     leadTrackDeltaPhi(const xAOD::TauJet &tau, double &out){
+bool leadTrackDeltaPhi(const xAOD::TauJet &tau, double &out){
   out = std::max(0.f, tau.auxdata<float>("TAU_ABSDELTAPHI"));
   return true;
 }
 
-bool     EMFracFixed(const xAOD::TauJet &tau, double &out){
+bool EMFracFixed(const xAOD::TauJet &tau, double &out){
   float emFracFized = tau.auxdata<float>("EMFracFixed");
   out = std::max(emFracFized, 0.0f);
   return true;
 }
 
-bool     etHotShotWinOverPtLeadTrk(const xAOD::TauJet &tau, double &out){
+bool etHotShotWinOverPtLeadTrk(const xAOD::TauJet &tau, double &out){
   float etHotShotWinOverPtLeadTrk = tau.auxdata<float>("etHotShotWinOverPtLeadTrk");
   out = std::max(etHotShotWinOverPtLeadTrk, 1e-6f);
-  out = std::log10(out);
+  out = TMath::Log10(out);
   return true;
 }
 
-bool     hadLeakFracFixed(const xAOD::TauJet &tau, double &out){
+bool hadLeakFracFixed(const xAOD::TauJet &tau, double &out){
   float hadLeakFracFixed = tau.auxdata<float>("hadLeakFracFixed");
   out = std::max(0.f, hadLeakFracFixed);
   return true;
 }
 
-bool     PSFrac(const xAOD::TauJet &tau, double &out){
+bool PSFrac(const xAOD::TauJet &tau, double &out){
   float PSFrac;
   const auto success = tau.detail(TauDetail::PSSFraction, PSFrac);
   out = std::max(0.f,PSFrac);
@@ -306,7 +306,7 @@ bool     PSFrac(const xAOD::TauJet &tau, double &out){
   return success;
 }
 
-bool     ClustersMeanCenterLambda(const xAOD::TauJet &tau, double &out){
+bool ClustersMeanCenterLambda(const xAOD::TauJet &tau, double &out){
   float ClustersMeanCenterLambda;
   const auto success = tau.detail(TauDetail::ClustersMeanCenterLambda, ClustersMeanCenterLambda);
   out = std::max(0.f, ClustersMeanCenterLambda);
@@ -314,21 +314,21 @@ bool     ClustersMeanCenterLambda(const xAOD::TauJet &tau, double &out){
   return success;
 }
 
-bool     ClustersMeanEMProbability(const xAOD::TauJet &tau, double &out){
+bool ClustersMeanEMProbability(const xAOD::TauJet &tau, double &out){
   float ClustersMeanEMProbability;
   const auto success = tau.detail(TauDetail::ClustersMeanEMProbability, ClustersMeanEMProbability);
   out = std::max(0.f, ClustersMeanEMProbability);
   return success;
 }
 
-bool     ClustersMeanFirstEngDens(const xAOD::TauJet &tau, double &out){
+bool ClustersMeanFirstEngDens(const xAOD::TauJet &tau, double &out){
   float ClustersMeanFirstEngDens;
   const auto success = tau.detail(TauDetail::ClustersMeanFirstEngDens, ClustersMeanFirstEngDens);
   out =  std::max(-10.f, ClustersMeanFirstEngDens);
   return success;
 }
 
-bool     ClustersMeanPresamplerFrac(const xAOD::TauJet &tau, double &out){
+bool ClustersMeanPresamplerFrac(const xAOD::TauJet &tau, double &out){
   float ClustersMeanPresamplerFrac;
   const auto success = tau.detail(TauDetail::ClustersMeanPresamplerFrac, ClustersMeanPresamplerFrac);
   out = ClustersMeanPresamplerFrac;
@@ -341,7 +341,7 @@ bool     ClustersMeanPresamplerFrac(const xAOD::TauJet &tau, double &out){
   return success;
 }
 
-bool     ClustersMeanSecondLambda(const xAOD::TauJet &tau, double &out){
+bool ClustersMeanSecondLambda(const xAOD::TauJet &tau, double &out){
   float ClustersMeanSecondLambda;
   const auto success = tau.detail(TauDetail::ClustersMeanSecondLambda, ClustersMeanSecondLambda);
   out = std::max(0.f, ClustersMeanSecondLambda);
@@ -502,7 +502,6 @@ bool CENTER_LAMBDA(const xAOD::TauJet& /*tau*/, const xAOD::CaloCluster &cluster
 }
 
 bool SECOND_LAMBDAOverClustersMeanSecondLambda   (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out){
-  (void)tau;
   float ClustersMeanSecondLambda = tau.auxdata<float>("ClustersMeanSecondLambda");
 
   double secondLambda(0);
@@ -514,7 +513,6 @@ bool SECOND_LAMBDAOverClustersMeanSecondLambda   (const xAOD::TauJet &tau, const
 }
 
 bool CENTER_LAMBDAOverClustersMeanCenterLambda   (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out){
-  (void)tau;
   float ClustersMeanCenterLambda = tau.auxdata<float>("ClustersMeanCenterLambda");
 
   double centerLambda(0);
@@ -525,12 +523,6 @@ bool CENTER_LAMBDAOverClustersMeanCenterLambda   (const xAOD::TauJet &tau, const
     out = centerLambda/ClustersMeanCenterLambda;
   }
 
-  if (std::isnan(std::abs(out))){
-    out = 0.;
-  }
-  if (std::isinf(out)){
-    out = 250.;
-  }
   out = std::min(out, 250.);
 
   return success;
@@ -538,7 +530,7 @@ bool CENTER_LAMBDAOverClustersMeanCenterLambda   (const xAOD::TauJet &tau, const
 
 
 bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out){
-  const xAOD::Jet *jet_seed = (*tau.jetLink());
+  const xAOD::Jet *jet_seed = tau.jet();
   if (!jet_seed) {
     return false;
   }
-- 
GitLab


From 1b63d62a9d57998ae6a01db3e55f09f316d57d54 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sun, 20 Sep 2020 05:58:49 +0200
Subject: [PATCH 293/422] const fix

---
 .../InDetGeoModelUtils/InDetDDAthenaComps.h                | 7 +++++++
 .../InDetGeoModelUtils/InDetDetectorFactoryBase.h          | 1 +
 2 files changed, 8 insertions(+)

diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
index 96ba01fe6e3f..cfeb09814f61 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
@@ -34,6 +34,7 @@ public:
   void setRDBAccessSvc(IRDBAccessSvc *);
   void setGeometryDBSvc(IGeometryDBSvc *);
 
+  const StoreGateSvc * detStore() const;
   const IGeoDbTagSvc * geoDbTagSvc() const;
   const IGeometryDBSvc * geomDB() const;
   
@@ -58,6 +59,11 @@ inline StoreGateSvc * AthenaComps::detStore()
   return m_detStore;
 }
 
+inline const StoreGateSvc * AthenaComps::detStore() const
+{
+  return m_detStore;
+}
+
 inline const IGeoDbTagSvc * AthenaComps::geoDbTagSvc() const
 {
   return m_geoDbTagSvc;
@@ -73,6 +79,7 @@ inline IGeoDbTagSvc * AthenaComps::geoDbTagSvc()
   return m_geoDbTagSvc;
 }
 
+
 inline IRDBAccessSvc * AthenaComps::rdbAccessSvc()
 {
   return m_rdbAccessSvc;
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
index b9da0eeb23d3..c6202402d9c9 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
@@ -25,6 +25,7 @@ public:
   {}
 
   StoreGateSvc * detStore () {return m_athenaComps->detStore();}
+  const StoreGateSvc * detStore () const {return m_athenaComps->detStore();}
 
   const IGeoDbTagSvc * geoDbTagSvc() const {return m_athenaComps->geoDbTagSvc();}
 
-- 
GitLab


From 792eac67b3da99398c6b284dbf600e9362ba5706 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Sun, 20 Sep 2020 13:39:21 +0200
Subject: [PATCH 294/422] add art input directives

---
 .../TrigInDetValidation/test/test_trigID_fsjet_pu40.py          | 1 +
 .../TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py       | 1 +
 .../TrigInDetValidation/test/test_trigID_minbias.py             | 1 +
 .../TrigInDetValidation/test/test_trigID_minbias_mt.py          | 2 ++
 4 files changed, 5 insertions(+)

diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py
index 1ae91bacce43..7215b315d0af 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py
@@ -3,6 +3,7 @@
 # art-description: art job for fsjet_pu40
 # art-type: grid
 # art-include: master/Athena
+# art-input: valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.RDO.e4993_s3214_r11315
 # art-input-nfiles: 3
 # art-athena-mt: 4
 # art-memory: 4096
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py
index 4360e666a676..8ffa41345cf0 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py
@@ -3,6 +3,7 @@
 # art-description: art job for fsjet_pu40_mt
 # art-type: grid
 # art-include: master/Athena
+# art-input: valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.RDO.e4993_s3214_r11315
 # art-input-nfiles: 3
 # art-athena-mt: 4
 # art-memory: 4096
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py
index 9ea8361af669..66b7477c5d5a 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py
@@ -5,6 +5,7 @@
 # art-type: grid
 # art-include: master/Athena
 # art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir=
+# art-input: mc15_13TeV.361203.Pythia8_A2_MSTW2008LO_ND_minbias.recon.RDO.e3639_s2606_s2174_r7661_tid07858100_00
 # art-athena-mt: 4
 # art-memory: 4096
 # art-output: *.txt
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py
index d3e2b1525602..99fed652af5e 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py
@@ -5,6 +5,8 @@
 # art-type: grid
 # art-include: master/Athena
 # art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir=
+# art-input: mc15_13TeV.361203.Pythia8_A2_MSTW2008LO_ND_minbias.recon.RDO.e3639_s2606_s2174_r7661_tid07858100_00
+# art-athena-nfiles: 4
 # art-athena-mt: 4
 # art-memory: 4096
 # art-output: *.txt
-- 
GitLab


From 25677404cbcdaa8b9e645faf8d27ffd1fb1e030c Mon Sep 17 00:00:00 2001
From: Bertrand Martin <martindl@cern.ch>
Date: Sun, 20 Sep 2020 17:52:52 +0200
Subject: [PATCH 295/422] tauRec: make TauProcessorAlg re-entrant

Hello,

This MR is changing TauRunnerAlg from AthAlgorithm to AthReentrantAlgorithm (ATLTAU-1723).
The EventContext is now explicitly passed to the execute method.
The tool handles are now const, and consequently, the non-const tool::finalize() methods are no longer called from within TauRunnerAlg::finalize(), which is dropped.
I ran a standalone tau reconstruction from ESD over 200 events. The reconstruction output is identical for AthAlgorithm with 1 thread, AthAlgorithm with 5 threads, and AthReentrantAlgorithm with 5 threads.

Performance with AthAlgorithm and 5 threads:
```
PerfMonMTSvc                                                  INFO ***************************************************************************************
PerfMonMTSvc                                                  INFO Number of events processed:        1000
PerfMonMTSvc                                                  INFO CPU usage per event [ms]:          232
PerfMonMTSvc                                                  INFO Events per second:                 5.352
PerfMonMTSvc                                                  INFO ***************************************************************************************
PerfMonMTSvc                                                  INFO Max Vmem:                          3.49 GB
PerfMonMTSvc                                                  INFO Max Rss:                           2.12 GB
PerfMonMTSvc                                                  INFO Max Pss:                           2.12 GB
PerfMonMTSvc                                                  INFO ***************************************************************************************
```
Performance with AthReentrantAlgorithm and 5 threads:
```
PerfMonMTSvc                                                  INFO ***************************************************************************************
PerfMonMTSvc                                                  INFO Number of events processed:        1000
PerfMonMTSvc                                                  INFO CPU usage per event [ms]:          235
PerfMonMTSvc                                                  INFO Events per second:                 5.742
PerfMonMTSvc                                                  INFO ***************************************************************************************
PerfMonMTSvc                                                  INFO Max Vmem:                          3.53 GB
PerfMonMTSvc                                                  INFO Max Rss:                           2.08 GB
PerfMonMTSvc                                                  INFO Max Pss:                           2.08 GB
PerfMonMTSvc                                                  INFO ***************************************************************************************
```

The memory saving is not obvious :-(
We still need to migrate TauRunnerAlg to AthReentrantAlgorithm, but this requires some underlying tool to have a const execute method ( !36215 ).

Cheers,
Bertrand
---
 Reconstruction/tauRec/src/TauProcessorAlg.cxx | 191 ++++++++----------
 .../tauRec/tauRec/TauProcessorAlg.h           |  63 +++---
 .../tauRecTools/Root/TauTrackClassifier.cxx   |   6 -
 .../tauRecTools/tauRecTools/MvaTESEvaluator.h |   1 -
 .../tauRecTools/TauTrackClassifier.h          |   1 -
 5 files changed, 111 insertions(+), 151 deletions(-)

diff --git a/Reconstruction/tauRec/src/TauProcessorAlg.cxx b/Reconstruction/tauRec/src/TauProcessorAlg.cxx
index 220c4e9e7ae2..3a8ce013473a 100644
--- a/Reconstruction/tauRec/src/TauProcessorAlg.cxx
+++ b/Reconstruction/tauRec/src/TauProcessorAlg.cxx
@@ -7,7 +7,6 @@
 #include "xAODJet/Jet.h"
 #include "xAODJet/JetContainer.h"
 
-
 #include "xAODTau/TauJetContainer.h"
 #include "xAODTau/TauJetAuxContainer.h"
 #include "xAODTau/TauDefs.h"
@@ -27,8 +26,8 @@ using Gaudi::Units::GeV;
 // Constructor
 //-----------------------------------------------------------------------------
 TauProcessorAlg::TauProcessorAlg(const std::string &name,
-    ISvcLocator * pSvcLocator) :
-AthAlgorithm(name, pSvcLocator) {
+				 ISvcLocator * pSvcLocator) :
+  AthReentrantAlgorithm(name, pSvcLocator) {
 }
 
 //-----------------------------------------------------------------------------
@@ -43,67 +42,36 @@ TauProcessorAlg::~TauProcessorAlg() {
 StatusCode TauProcessorAlg::initialize() {
   ATH_CHECK( detStore()->retrieve(m_cellID) );
     
-    ATH_CHECK( m_jetInputContainer.initialize() );
-    ATH_CHECK( m_tauOutputContainer.initialize() );
-    ATH_CHECK( m_tauTrackOutputContainer.initialize() );
-    ATH_CHECK( m_tauShotClusOutputContainer.initialize() );
-    ATH_CHECK( m_tauShotPFOOutputContainer.initialize() );
-    ATH_CHECK( m_tauPi0CellOutputContainer.initialize() );
-
-    ATH_CHECK( m_cellMakerTool.retrieve() );
-
-    //-------------------------------------------------------------------------
-    // No tools allocated!
-    //-------------------------------------------------------------------------
-    if (m_tools.size() == 0) {
-        ATH_MSG_ERROR("no tools given!");
-        return StatusCode::FAILURE;
-    }
-
-    //-------------------------------------------------------------------------
-    // Allocate tools
-    //-------------------------------------------------------------------------
-    ATH_CHECK( m_tools.retrieve() );
-    
-    ATH_MSG_INFO("List of tools in execution sequence:");
-    ATH_MSG_INFO("------------------------------------");
-
-    unsigned int tool_count = 0;
-
-    for (ToolHandle<ITauToolBase>& tool : m_tools) {
-      ++tool_count;
-      ATH_MSG_INFO(tool->type() << " - " << tool->name());
-    }
-    ATH_MSG_INFO(" ");
-    ATH_MSG_INFO("------------------------------------");
-
-    if (tool_count == 0) {
-        ATH_MSG_ERROR("could not allocate any tool!");
-        return StatusCode::FAILURE;
-    }
-
-    return StatusCode::SUCCESS;
-}
-
-//-----------------------------------------------------------------------------
-// Finalizer
-//-----------------------------------------------------------------------------
-StatusCode TauProcessorAlg::finalize() {
+  ATH_CHECK( m_jetInputContainer.initialize() );
+  ATH_CHECK( m_tauOutputContainer.initialize() );
+  ATH_CHECK( m_tauTrackOutputContainer.initialize() );
+  ATH_CHECK( m_tauShotClusOutputContainer.initialize() );
+  ATH_CHECK( m_tauShotPFOOutputContainer.initialize() );
+  ATH_CHECK( m_tauPi0CellOutputContainer.initialize() );
+
+  ATH_CHECK( m_cellMakerTool.retrieve() );
+
+  //-------------------------------------------------------------------------
+  // No tools allocated!
+  //-------------------------------------------------------------------------
+  if (m_tools.size() == 0) {
+    ATH_MSG_ERROR("no tools given!");
+    return StatusCode::FAILURE;
+  }
 
-  StatusCode sc;
+  //-------------------------------------------------------------------------
+  // Allocate tools
+  //-------------------------------------------------------------------------    
+  ATH_MSG_INFO("List of tools in execution sequence:");
+  ATH_MSG_INFO("------------------------------------");
 
-  //-----------------------------------------------------------------
-  // Loop stops when Failure indicated by one of the tools
-  //-----------------------------------------------------------------
-  for (ToolHandle<ITauToolBase>& tool : m_tools) {
-    ATH_MSG_VERBOSE("Invoking tool " << tool->name());
-    sc = tool->finalize();
-    if (sc.isFailure()) break;
+  for (const ToolHandle<ITauToolBase>& tool : m_tools) {
+    ATH_CHECK( tool.retrieve() );
+    ATH_MSG_INFO(tool->type() << " - " << tool->name());
   }
 
-  if (sc.isSuccess()) {
-    ATH_MSG_VERBOSE("All the invoded tools are finilized successfully.");
-  } 
+  ATH_MSG_INFO(" ");
+  ATH_MSG_INFO("------------------------------------");
 
   return StatusCode::SUCCESS;
 }
@@ -111,8 +79,7 @@ StatusCode TauProcessorAlg::finalize() {
 //-----------------------------------------------------------------------------
 // Execution
 //-----------------------------------------------------------------------------
-StatusCode TauProcessorAlg::execute() {
-  const EventContext& ctx = Gaudi::Hive::currentContext();
+StatusCode TauProcessorAlg::execute(const EventContext& ctx) const {
 
   /// record output containers
   SG::WriteHandle<xAOD::TauJetContainer> tauHandle( m_tauOutputContainer, ctx );
@@ -167,60 +134,60 @@ StatusCode TauProcessorAlg::execute() {
       continue;
     }
 
-      //-----------------------------------------------------------------                                                                 
-      // Seed passed cuts --> create tau candidate
-      //-----------------------------------------------------------------                                                                           
-      xAOD::TauJet* pTau = new xAOD::TauJet();
-      pContainer->push_back( pTau );
-      pTau->setJet(pSeedContainer, pSeed);
+    //-----------------------------------------------------------------                                                                 
+    // Seed passed cuts --> create tau candidate
+    //-----------------------------------------------------------------                                                                           
+    xAOD::TauJet* pTau = new xAOD::TauJet();
+    pContainer->push_back( pTau );
+    pTau->setJet(pSeedContainer, pSeed);
       
-      //-----------------------------------------------------------------
-      // Loop stops when Failure indicated by one of the tools
-      //-----------------------------------------------------------------
-      StatusCode sc;
-      for (ToolHandle<ITauToolBase>& tool : m_tools) {
-	ATH_MSG_DEBUG("ProcessorAlg Invoking tool " << tool->name());
-
-	if (tool->type() == "TauVertexFinder" ) {
-	  sc = tool->executeVertexFinder(*pTau);
-	}
-	else if ( tool->type() == "TauTrackFinder") {
-	  sc = tool->executeTrackFinder(*pTau, *pTauTrackCont);
-	}
-	else if ( tool->type() == "tauRecTools::TauTrackClassifier" || tool->type() == "tauRecTools::TauTrackRNNClassifier" ) {
-	  sc = tool->executeTrackClassifier(*pTau, *pTauTrackCont);
-	}
-	else if ( tool->type() == "TauShotFinder"){
-	  sc = tool->executeShotFinder(*pTau, *tauShotClusContainer, *tauShotPFOContainer);
-	}
-	else if ( tool->type() == "TauPi0CreateROI"){
-	  sc = tool->executePi0CreateROI(*pTau, *Pi0CellContainer, addedCellsMap);
-	}
-	else {
-	  sc = tool->execute(*pTau);
-	}
-	if (sc.isFailure())  break;
+    //-----------------------------------------------------------------
+    // Loop stops when Failure indicated by one of the tools
+    //-----------------------------------------------------------------
+    StatusCode sc;
+    for (const ToolHandle<ITauToolBase>& tool : m_tools) {
+      ATH_MSG_DEBUG("ProcessorAlg Invoking tool " << tool->name());
+
+      if (tool->type() == "TauVertexFinder" ) {
+	sc = tool->executeVertexFinder(*pTau);
+      }
+      else if ( tool->type() == "TauTrackFinder") {
+	sc = tool->executeTrackFinder(*pTau, *pTauTrackCont);
+      }
+      else if ( tool->type() == "tauRecTools::TauTrackClassifier" || tool->type() == "tauRecTools::TauTrackRNNClassifier" ) {
+	sc = tool->executeTrackClassifier(*pTau, *pTauTrackCont);
+      }
+      else if ( tool->type() == "TauShotFinder"){
+	sc = tool->executeShotFinder(*pTau, *tauShotClusContainer, *tauShotPFOContainer);
+      }
+      else if ( tool->type() == "TauPi0CreateROI"){
+	sc = tool->executePi0CreateROI(*pTau, *Pi0CellContainer, addedCellsMap);
       }
-
-      if (sc.isSuccess()) {
-	ATH_MSG_VERBOSE("The tau candidate has been registered");
-      } 
       else {
-	//remove orphaned tracks before tau is deleted via pop_back
-	xAOD::TauJet* bad_tau = pContainer->back();
-	ATH_MSG_DEBUG("Deleting " << bad_tau->nAllTracks() << "Tracks associated with tau: ");
-	pTauTrackCont->erase(pTauTrackCont->end()-bad_tau->nAllTracks(), pTauTrackCont->end());
-
-	pContainer->pop_back();
-      } 
-    }// loop through seeds
-
-    // Check this is needed for the cell container?
-    // symlink as INavigable4MomentumCollection (as in CaloRec/CaloCellMaker)
-    ATH_CHECK(evtStore()->symLink(Pi0CellContainer, static_cast<INavigable4MomentumCollection*> (0)));
+	sc = tool->execute(*pTau);
+      }
+      if (sc.isFailure())  break;
+    }
+
+    if (sc.isSuccess()) {
+      ATH_MSG_VERBOSE("The tau candidate has been registered");
+    } 
+    else {
+      //remove orphaned tracks before tau is deleted via pop_back
+      xAOD::TauJet* bad_tau = pContainer->back();
+      ATH_MSG_DEBUG("Deleting " << bad_tau->nAllTracks() << "Tracks associated with tau: ");
+      pTauTrackCont->erase(pTauTrackCont->end()-bad_tau->nAllTracks(), pTauTrackCont->end());
+
+      pContainer->pop_back();
+    } 
+  }// loop through seeds
+
+  // Check this is needed for the cell container?
+  // symlink as INavigable4MomentumCollection (as in CaloRec/CaloCellMaker)
+  ATH_CHECK(evtStore()->symLink(Pi0CellContainer, static_cast<INavigable4MomentumCollection*> (0)));
   
-    // sort the cell container by hash
-    ATH_CHECK( m_cellMakerTool->process(static_cast<CaloCellContainer*> (Pi0CellContainer), ctx) );
+  // sort the cell container by hash
+  ATH_CHECK( m_cellMakerTool->process(static_cast<CaloCellContainer*> (Pi0CellContainer), ctx) );
 
   ATH_MSG_VERBOSE("The tau candidate container has been modified");
   
diff --git a/Reconstruction/tauRec/tauRec/TauProcessorAlg.h b/Reconstruction/tauRec/tauRec/TauProcessorAlg.h
index 87be74c9064e..205ba5fe1da0 100644
--- a/Reconstruction/tauRec/tauRec/TauProcessorAlg.h
+++ b/Reconstruction/tauRec/tauRec/TauProcessorAlg.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TAUREC_TAUPROCESSORALG_H
@@ -10,7 +10,9 @@
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
-#include "AthenaBaseComps/AthAlgorithm.h"
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+
 #include "xAODTau/TauJetContainer.h"
 #include "xAODPFlow/PFOContainer.h"
 #include "xAODPFlow/PFOAuxContainer.h"
@@ -29,44 +31,43 @@
 
 class CaloCell_ID;
 
-class TauProcessorAlg: public AthAlgorithm
+class TauProcessorAlg: public AthReentrantAlgorithm
 {
-    public:
-        //-----------------------------------------------------------------
-        // Contructor and destructor
-        //-----------------------------------------------------------------
-        TauProcessorAlg( const std::string &name, ISvcLocator *pSvcLocator );
-        ~TauProcessorAlg();
+ public:
+  //-----------------------------------------------------------------
+  // Contructor and destructor
+  //-----------------------------------------------------------------
+  TauProcessorAlg( const std::string &name, ISvcLocator *pSvcLocator );
+  ~TauProcessorAlg();
 
-        //-----------------------------------------------------------------
-        // Gaudi algorithm hooks
-        //-----------------------------------------------------------------
-        virtual StatusCode initialize();
-        virtual StatusCode execute();
-        virtual StatusCode finalize();
+  //-----------------------------------------------------------------
+  // Gaudi algorithm hooks
+  //-----------------------------------------------------------------
+  virtual StatusCode initialize();
+  virtual StatusCode execute(const EventContext& ctx) const;
 
-    private:
+ private:
        
-    Gaudi::Property<double> m_maxEta {this, "MaxEta", 2.5, "maximum eta for jet seed"};
-    Gaudi::Property<double> m_minPt {this, "MinPt", 10 * Gaudi::Units::GeV, "minimum pT for jet seed"};
+  Gaudi::Property<double> m_maxEta {this, "MaxEta", 2.5, "maximum eta for jet seed"};
+  Gaudi::Property<double> m_minPt {this, "MinPt", 10 * Gaudi::Units::GeV, "minimum pT for jet seed"};
 
-    ToolHandleArray<ITauToolBase>  m_tools {this, "Tools", {}, "Tools processing taus"};
-	ToolHandle<ICaloCellMakerTool> m_cellMakerTool {this, "CellMakerTool", "", "Tool to sort the CaloCellContainer"};
+  const ToolHandleArray<ITauToolBase> m_tools {this, "Tools", {}, "Tools processing taus"};
+  const ToolHandle<ICaloCellMakerTool> m_cellMakerTool {this, "CellMakerTool", "", "Tool to sort the CaloCellContainer"};
 
-	SG::ReadHandleKey<xAOD::JetContainer> m_jetInputContainer{this,"Key_jetInputContainer","AntiKt4LCTopoJets","input jet key"};
+  SG::ReadHandleKey<xAOD::JetContainer> m_jetInputContainer{this,"Key_jetInputContainer","AntiKt4LCTopoJets","input jet key"};
 	
-    SG::WriteHandleKey<xAOD::TauJetContainer> m_tauOutputContainer{this,"Key_tauOutputContainer","tmp_TauJets","output tau data key"};
-	SG::WriteHandleKey<xAOD::TauTrackContainer> m_tauTrackOutputContainer{this,"Key_tauTrackOutputContainer","TauTracks","output tau tracks data key"};
-	SG::WriteHandleKey<xAOD::CaloClusterContainer> m_tauShotClusOutputContainer{this,"Key_tauShotClusOutputContainer", "TauShotClusters", "tau shot clusters out key"};
-	SG::WriteHandleKey<xAOD::PFOContainer> m_tauShotPFOOutputContainer{this,"Key_tauShotPFOOutputContainer", "TauShotParticleFlowObjects", "tau pfo out key"};
-	SG::WriteHandleKey<CaloCellContainer> m_tauPi0CellOutputContainer{this,"Key_tauPi0CellOutputContainer","TauCommonPi0Cells","output calo cell key"};
+  SG::WriteHandleKey<xAOD::TauJetContainer> m_tauOutputContainer{this,"Key_tauOutputContainer","tmp_TauJets","output tau data key"};
+  SG::WriteHandleKey<xAOD::TauTrackContainer> m_tauTrackOutputContainer{this,"Key_tauTrackOutputContainer","TauTracks","output tau tracks data key"};
+  SG::WriteHandleKey<xAOD::CaloClusterContainer> m_tauShotClusOutputContainer{this,"Key_tauShotClusOutputContainer", "TauShotClusters", "tau shot clusters out key"};
+  SG::WriteHandleKey<xAOD::PFOContainer> m_tauShotPFOOutputContainer{this,"Key_tauShotPFOOutputContainer", "TauShotParticleFlowObjects", "tau pfo out key"};
+  SG::WriteHandleKey<CaloCellContainer> m_tauPi0CellOutputContainer{this,"Key_tauPi0CellOutputContainer","TauCommonPi0Cells","output calo cell key"};
     
-    const CaloCell_ID* m_cellID;
+  const CaloCell_ID* m_cellID;
     
-    // These are needed to read ESD and AOD in AthenaMT for P->T conversion of ID tracks.
-    SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
-    SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
-    SG::ReadCondHandleKey<InDetDD::TRT_DetElementContainer> m_trtDetEleContKey{this, "TRTDetEleContKey", "TRT_DetElementContainer", "Key of TRT_DetElementContainer"}; 
+  // These are needed to read ESD and AOD in AthenaMT for P->T conversion of ID tracks.
+  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
+  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
+  SG::ReadCondHandleKey<InDetDD::TRT_DetElementContainer> m_trtDetEleContKey{this, "TRTDetEleContKey", "TRT_DetElementContainer", "Key of TRT_DetElementContainer"}; 
 
 };
 
diff --git a/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx b/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
index 7fd0488d019a..d669aabd04fa 100644
--- a/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
+++ b/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
@@ -112,12 +112,6 @@ TrackMVABDT::~TrackMVABDT()
 {
 }
 
-//______________________________________________________________________________
-StatusCode TrackMVABDT::finalize()
-{
-  return StatusCode::SUCCESS;
-}
-
 //______________________________________________________________________________
 StatusCode TrackMVABDT::initialize()
 {
diff --git a/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h b/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h
index 9278fce1243e..c1f438416a1b 100644
--- a/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h
+++ b/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h
@@ -23,7 +23,6 @@ class MvaTESEvaluator
     
   virtual StatusCode initialize() override;
   virtual StatusCode execute(xAOD::TauJet& xTau) const override;
-  virtual StatusCode finalize() override { return StatusCode::SUCCESS; }
   
  private:
   // MVA input variables (provide all variables in float)
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h b/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h
index d578ba763a3a..6fbb507d4942 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h
@@ -68,7 +68,6 @@ class TrackMVABDT
   // for possible MVA inputs. Only Variables defined in the root weights file
   // are passed to the MVA object
   StatusCode initialize() override;
-  StatusCode finalize() override;
   
   // executes MVA object to get the BDT score, makes the decision and resets
   // classification flags
-- 
GitLab


From bb3cabb5d5d61e0408b119601dd5258217ba089a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 12 Sep 2020 16:06:36 -0400
Subject: [PATCH 296/422] MCTruth: Enable thread-safety checking.

Enable thread-safety checking.
Clean up use of singleton.
---
 .../G4Sim/MCTruth/MCTruth/ATLAS_CHECK_THREAD_SAFETY   |  1 +
 .../G4Sim/MCTruth/MCTruth/AtlasG4EventUserInfo.h      |  5 +++--
 Simulation/G4Sim/MCTruth/MCTruth/TruthController.h    | 11 +++++------
 Simulation/G4Sim/MCTruth/src/TruthController.cxx      | 10 ++++------
 4 files changed, 13 insertions(+), 14 deletions(-)
 create mode 100644 Simulation/G4Sim/MCTruth/MCTruth/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Simulation/G4Sim/MCTruth/MCTruth/ATLAS_CHECK_THREAD_SAFETY b/Simulation/G4Sim/MCTruth/MCTruth/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..ab4fc576a398
--- /dev/null
+++ b/Simulation/G4Sim/MCTruth/MCTruth/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Simulation/G4Sim/MCTruth
diff --git a/Simulation/G4Sim/MCTruth/MCTruth/AtlasG4EventUserInfo.h b/Simulation/G4Sim/MCTruth/MCTruth/AtlasG4EventUserInfo.h
index c706742692f3..cfda36acc877 100644
--- a/Simulation/G4Sim/MCTruth/MCTruth/AtlasG4EventUserInfo.h
+++ b/Simulation/G4Sim/MCTruth/MCTruth/AtlasG4EventUserInfo.h
@@ -31,9 +31,10 @@ public:
 
         void SetCurrentlyTraced(HepMC::GenParticlePtr p) {m_currentlyTraced=p;}
 
-        HepMC::GenParticlePtr GetCurrentPrimary() const {return m_currentPrimary;}
+        HepMC::ConstGenParticlePtr GetCurrentPrimary() const {return m_currentPrimary;}
 
-        HepMC::GenParticlePtr GetCurrentlyTraced() const {return m_currentlyTraced;}
+        HepMC::GenParticlePtr GetCurrentlyTraced() {return m_currentlyTraced;}
+        HepMC::ConstGenParticlePtr GetCurrentlyTraced() const {return m_currentlyTraced;}
         int SecondaryParticleBarCode() {m_secondaryParticleBarCode++;
                                         return m_secondaryParticleBarCode;}
         int SecondaryVertexBarCode() {m_secondaryVertexBarCode--;
diff --git a/Simulation/G4Sim/MCTruth/MCTruth/TruthController.h b/Simulation/G4Sim/MCTruth/MCTruth/TruthController.h
index a43cadba15e6..14d3729710ea 100644
--- a/Simulation/G4Sim/MCTruth/MCTruth/TruthController.h
+++ b/Simulation/G4Sim/MCTruth/MCTruth/TruthController.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TruthController_H
@@ -9,18 +9,17 @@ class TrackVisualizationHelper;
 
 class TruthController {
 public:
-  static TruthController *getTruthController();
+  static const TruthController *getTruthController();
   void setVisualizationHelper(TrackVisualizationHelper *);
-  TrackVisualizationHelper* getVisualizationHelper() const
+  const TrackVisualizationHelper* getVisualizationHelper() const
   {
     return m_theVisHelper;
   }
 private:
   // this is a singleton
-  static TruthController *s_thePointer;
   TruthController();
-  TruthController(const TruthController&) {}
-  TruthController& operator= (const TruthController&);
+  TruthController(const TruthController&) = delete;
+  TruthController& operator= (const TruthController&) = delete;
   ~TruthController();
   TrackVisualizationHelper *m_theVisHelper;
 };
diff --git a/Simulation/G4Sim/MCTruth/src/TruthController.cxx b/Simulation/G4Sim/MCTruth/src/TruthController.cxx
index 7a1886ac06af..953f24f736de 100644
--- a/Simulation/G4Sim/MCTruth/src/TruthController.cxx
+++ b/Simulation/G4Sim/MCTruth/src/TruthController.cxx
@@ -1,16 +1,14 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MCTruth/TruthController.h"
 #include "SimHelpers/TrackVisualizationHelper.h"
 
-TruthController* TruthController::s_thePointer=TruthController::getTruthController() ;
-
-TruthController* TruthController::getTruthController()
+const TruthController* TruthController::getTruthController()
 {
-  if (!s_thePointer) s_thePointer = new TruthController;
-  return s_thePointer;
+  static const TruthController tc;
+  return &tc;
 }
 
 TruthController::TruthController()
-- 
GitLab


From db7167a6d38481266b5bc537627b18a3647c89ab Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 15 Sep 2020 07:55:36 -0400
Subject: [PATCH 297/422] PixelCalibAlgs: Thread-safety cleanup.

Clean up to remove most thread-safety annotations.
Algorithm PixelChargeToTConversion is marked as not thread-safe
because it modifies data in SG.
---
 .../PlotChargeSharingConstants.cxx            |  2 +-
 .../PlotPixelClusterOnTrackErrors.cxx         |  2 +-
 .../Application/createDeadModuleList.C        | 28 +++++++++--------
 .../Application/doPixelOfflineCalib.cxx       | 12 ++++----
 .../Application/doPixelOfflineCalibG4.cxx     | 10 +++----
 .../Application/hackNoiseMapsForStudyCP.C     | 15 +++++-----
 .../Application/updateDeadMaps.C              | 17 ++++++-----
 .../Application/updateNoiseMaps.C             | 17 ++++++-----
 .../PixelCalibAlgs/OfflineCalibrationLoop.h   |  2 +-
 .../PixelCalibAlgs/PixelBarrelSurvey.h        |  4 ++-
 .../PixelChargeInterpolationCalibration.h     |  4 +--
 .../PixelChargeInterpolationPlot.h            |  4 +--
 .../PixelCalibAlgs/PixelChargeToTConversion.h |  3 +-
 .../PixelClusterOnTrackErrorPlot.h            |  4 +--
 .../PixelCalibAlgs/PixelConvert.h             | 14 +++++++--
 .../PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h |  2 +-
 .../PixelCalibAlgs/src/NoiseMapBuilder.cxx    |  4 +--
 .../PixelCalibAlgs/src/PixMapDBWriter.cxx     |  2 +-
 .../src/PixMapOverlayWriter.cxx               |  2 +-
 .../PixelCalibAlgs/src/PixelBarrelSurvey.cxx  |  4 +--
 .../src/PixelChargeInterpolationPlot.cxx      |  9 +++---
 .../src/PixelChargeToTConversion.cxx          |  2 +-
 .../src/PixelClusterOnTrackErrorPlot.cxx      |  8 ++---
 .../PixelCalibAlgs/src/PixelConvert.cxx       | 30 +++++++++----------
 24 files changed, 105 insertions(+), 96 deletions(-)

diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx
index 902b4225c197..b3fabc9054e5 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx
@@ -14,7 +14,7 @@
 
 using namespace PixelCalib;
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread unsafe PixelChargeInterpolationPlot class is used.
+int main (int argc, char *argv[]){
 
 	TApplication myapp("application", 0 , 0);
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx
index a19e1af68d27..062a9ef5a43e 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx
@@ -14,7 +14,7 @@
 
 using namespace PixelCalib;
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread usnafe PixelClusterOnTrackErrorPlot class is used.
+int main (int argc, char *argv[]){
 
 	TApplication myapp("application", 0 , 0);
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C
index 12cda424d708..60cbc45bd324 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C
@@ -21,11 +21,11 @@
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
-std::vector< std::pair< std::string, std::vector<int> > > pixelMapping;
-std::vector< std::pair< int, std::vector<int> > > hashMapping;
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta);
-int getHashFromPosition (int barrel_ec, int layer, int module_phi, int module_eta);
-std::vector<int> getPositionFromDCSID (const std::string& module_name);
+using PixelMap_t = std::vector< std::pair< std::string, std::vector<int> > >;
+using HashMap_t = std::vector< std::pair< int, std::vector<int> > >;
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta);
+int getHashFromPosition (HashMap_t& hashMapping, int barrel_ec, int layer, int module_phi, int module_eta);
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name);
 
 std::vector<std::string> &splitter(const std::string &s, char delim, std::vector<std::string> &elems) {
   std::stringstream ss(s);
@@ -51,7 +51,7 @@ bool is_file_exist(const char *fileName)
 
 using namespace std;
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
+int main (int argc, char* argv[]){
   const bool isIBL = true;
 
   //-----------------------------------
@@ -220,8 +220,10 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   const unsigned int maxPathStringLength{3000};
   if((not tmppath) or (strlen(tmppath) > maxPathStringLength) ){
       std::cout << "FATAL: Unable to retrieve environmental DATAPATH" << std::endl;
-      exit(EXIT_FAILURE);
+      return(EXIT_FAILURE);
   }
+  PixelMap_t pixelMapping;
+  HashMap_t hashMapping;
   std::stringstream tmpSstr{};
   tmpSstr<<tmppath;
   std::string cmtpath(tmpSstr.str());
@@ -338,12 +340,12 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
     std::vector<std::string>::const_iterator module_iter;
     for(module_iter = (iter->second).begin(); module_iter != (iter->second).end(); ++module_iter){
       std::string moduleID = *module_iter;
-      std::vector<int> position = getPositionFromDCSID(moduleID);
+      std::vector<int> position = getPositionFromDCSID(pixelMapping, moduleID);
       int barrel = position[0];
       int layer = position[1];
       int module_phi = position[2];
       int module_eta = position[3];
-      pyFile << getHashFromPosition(barrel, layer, module_phi, module_eta) << ", ";
+      pyFile << getHashFromPosition(hashMapping, barrel, layer, module_phi, module_eta) << ", ";
     }
     pyFile << "])" << std::endl;;
   }
@@ -505,7 +507,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
     int layer = position[1];
     int module_phi = position[2];
     int module_eta = position[3];
-    pyFile[LB] << "job.PixMapOverlayWriter.Modules += [ " << getHashFromPosition(barrel, layer, module_phi, module_eta) << " ] # " << moduleID << std::endl;
+    pyFile[LB] << "job.PixMapOverlayWriter.Modules += [ " << getHashFromPosition(hashMapping, barrel, layer, module_phi, module_eta) << " ] # " << moduleID << std::endl;
   }
   pyFile[LB].close();
 } 
@@ -518,7 +520,7 @@ delete hitMapFile;
 return 0;
 }
 
-std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -534,7 +536,7 @@ std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer
   return std::string("Error!");
 }
 
-int getHashFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
+int getHashFromPosition (HashMap_t& hashMapping, int barrel_ec, int layer, int module_phi, int module_eta){
   for(unsigned int ii = 0; ii < hashMapping.size(); ii++) {
     if (hashMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -550,7 +552,7 @@ int getHashFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int mod
   return 0;
 }
 
-std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
       return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx
index 7e053795a162..674623f61209 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx
@@ -11,11 +11,11 @@
 using namespace PixelCalib;
 
 /// the function that does the job!
-int doAll ATLAS_NOT_THREAD_SAFE (std::string input_file, std::string input_tag, // Thread unsafe OfflineCalibrationLoop class is used.
-	  std::string output_tag,
-		std::string collection,
-	  std::string reference_file, std::string reference_tag,
-	  int maxentries){
+int doAll (std::string input_file, std::string input_tag,
+           std::string output_tag,
+           std::string collection,
+           std::string reference_file, std::string reference_tag,
+           int maxentries){
 
 	OfflineCalibrationLoop *s = 0;
 
@@ -38,7 +38,7 @@ int doAll ATLAS_NOT_THREAD_SAFE (std::string input_file, std::string input_tag,
 }
 
 /// main does include the input interpretation
-int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread unsafe doAll function is used.
+int main (int argc, char *argv[]){
 
 std::cout << "ciao" << std::endl;
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx
index 046b142859a0..eae67aa709a9 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx
@@ -12,10 +12,10 @@
 using namespace PixelCalib;
 
 /// the function that does the job!
-int doAll ATLAS_NOT_THREAD_SAFE (std::string input_file, std::string input_tag, // Thread unsafe PixelRIOs class is used.
-	  std::string output_tag,
-	  std::string reference_file, std::string reference_tag,
-	  int maxentries){
+int doAll (std::string input_file, std::string input_tag,
+           std::string output_tag,
+           std::string reference_file, std::string reference_tag,
+           int maxentries){
 
 	PixelRIOs *s = 0;
 
@@ -38,7 +38,7 @@ int doAll ATLAS_NOT_THREAD_SAFE (std::string input_file, std::string input_tag,
 }
 
 /// main does include the input interpretation
-int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread unsafe doAll function is used.
+int main (int argc, char *argv[]){
 
 	if(argc < 4 || argc > 5){
 		std::cout << std::endl;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C
index 51a217b1f0bb..2662594b31da 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C
@@ -25,9 +25,9 @@
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
-std::vector< std::pair< std::string, std::vector<int> > > pixelMapping;
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta);
-std::vector<int> getPositionFromDCSID (const std::string& module_name);
+using PixelMap_t = std::vector< std::pair< std::string, std::vector<int> > >;
+std::string getDCSIDFromPosition (PixelMap_t& map, int barrel_ec, int layer, int module_phi, int module_eta);
+std::vector<int> getPositionFromDCSID (PixelMap_t& map, const std::string& module_name);
 
 double ComputeMuChip(TH2D* modhisto, int chip)
 {
@@ -122,7 +122,7 @@ int ComputePoisson(double probcut, double mu) {
   return nhits;
 }
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
+int main (int argc, char* argv[]){
 
   //std::string option;
 
@@ -567,6 +567,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   int tmp_barrel_ec; int tmp_layer; int tmp_module_phi; int tmp_module_eta; std::string tmp_module_name;
   std::vector<int> tmp_position;
   tmp_position.resize(4);
+  PixelMap_t pixelMapping;
   //int counter = 0; // debug
   while(ifs >> tmp_barrel_ec >> tmp_layer >> tmp_module_phi >> tmp_module_eta >> tmp_module_name) {
     tmp_position[0] = tmp_barrel_ec;
@@ -594,7 +595,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
       noiseMap = noiseMaps[moduleID];
     }
 
-    std::vector<int> position = getPositionFromDCSID(moduleID);
+    std::vector<int> position = getPositionFromDCSID(pixelMapping, moduleID);
     int barrel = position[0];
     int layer = position[1];
     int module_phi = position[2];
@@ -984,7 +985,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   return 0;
 }
 
-std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -1000,7 +1001,7 @@ std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer
   return std::string("Error!");
 }
 
-std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
     return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C
index 026c1bfca796..ce89507d616a 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C
@@ -21,9 +21,9 @@
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
-std::vector< std::pair< std::string, std::vector<int> > > pixelMapping;
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta);
-std::vector<int> getPositionFromDCSID (const std::string& module_name);
+using PixelMap_t =  std::vector< std::pair< std::string, std::vector<int> > >;
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta);
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name);
 
 std::vector<std::string> &splitter(const std::string &s, char delim, std::vector<std::string> &elems) {
   std::stringstream ss(s);
@@ -49,7 +49,7 @@ bool is_file_exist(const char *fileName)
 
 using namespace std;
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
+int main (int argc, char* argv[]){
   bool isIBL = true;
 
   int minEventNumber = 2000000;
@@ -411,12 +411,13 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   const unsigned int maxPathStringLength{3000};
   if((not tmppath) or (strlen(tmppath) > maxPathStringLength) ){
       std::cout << "FATAL: Unable to retrieve environmental DATAPATH" << std::endl;
-      exit(EXIT_FAILURE);
+      return (EXIT_FAILURE);
   }
   std::stringstream tmpSstr{};
   tmpSstr<<tmppath;
   std::string cmtpath(tmpSstr.str());
   std::vector<std::string> paths = splitter(cmtpath, ':');
+  PixelMap_t pixelMapping;
   std::ifstream ifs;
   for (const auto& x : paths){
     if(is_file_exist((x + "/PixelMapping_Run2.dat").c_str())){
@@ -463,7 +464,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
       deadmap = deadMaps[moduleID];
     }
 
-    std::vector<int> position = getPositionFromDCSID(moduleID);
+    std::vector<int> position = getPositionFromDCSID(pixelMapping, moduleID);
     int barrel = position[0];
     int layer = position[1];
     int module_phi = position[2];
@@ -793,7 +794,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   return 0;
 }
 
-std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -809,7 +810,7 @@ std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer
   return std::string("Error!");
 }
 
-std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
     return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C
index dfd11aa47515..7d4bfaacc09c 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C
@@ -23,9 +23,9 @@
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
-std::vector< std::pair< std::string, std::vector<int> > > pixelMapping;
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta);
-std::vector<int> getPositionFromDCSID (const std::string& module_name);
+using PixelMap_t = std::vector< std::pair< std::string, std::vector<int> > >;
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta);
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name);
 
 std::vector<std::string> &splitter(const std::string &s, char delim, std::vector<std::string> &elems) {
   std::stringstream ss(s);
@@ -136,7 +136,7 @@ int ComputePoisson(double probcut, double mu) {
 }
 
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
+int main (int argc, char* argv[]){
 
   std::string option;
 
@@ -519,13 +519,14 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   const unsigned int maxPathStringLength{3000};
   if((not tmppath) or (strlen(tmppath) > maxPathStringLength) ){
       std::cout << "FATAL: Unable to retrieve environmental DATAPATH" << std::endl;
-      exit(EXIT_FAILURE);
+      return (EXIT_FAILURE);
   }
   std::stringstream tmpSstr{};
   tmpSstr<<tmppath;
   std::string cmtpath(tmpSstr.str());
   std::vector<std::string> paths = splitter(cmtpath, ':');
   std::ifstream ifs;
+  PixelMap_t pixelMapping;
   for (const auto& x : paths){
     if(is_file_exist((x + "/PixelMapping_Run2.dat").c_str())){
       if(isIBL){
@@ -568,7 +569,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
       noiseMap = noiseMaps[moduleID];
     }
 
-    std::vector<int> position = getPositionFromDCSID(moduleID);
+    std::vector<int> position = getPositionFromDCSID(pixelMapping, moduleID);
     int barrel = position[0];
     int layer = position[1];
     int module_phi = position[2];
@@ -877,7 +878,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   return 0;
 }
 
-std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -893,7 +894,7 @@ std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer
   return std::string("Error!");
 }
 
-std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
     return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h
index 8ff1054824b5..ed0776c8f764 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h
@@ -19,7 +19,7 @@ class PixelChargeInterpolationValidation;
 
 class OfflineCalibrationLoop;
 
-class ATLAS_NOT_THREAD_SAFE OfflineCalibrationLoop: public PixelNtupleTracks { // Thread unsafe PixelChargeInterpolationCalibration class is used.
+class OfflineCalibrationLoop: public PixelNtupleTracks {
 
 public :
 	// Modified stuff
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurvey.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurvey.h
index 4cdb4c9222fd..de803378bd83 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurvey.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurvey.h
@@ -1,11 +1,12 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 #include "PixelCalibAlgs/PixelBarrelSurveyUtils.h"
+#include "PixelCalibAlgs/PixelConvert.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include <vector>
 #include <string>
@@ -39,5 +40,6 @@ class PixelBarrelSurvey:public AthAlgorithm {
   SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
   AlignableTransform *m_transforms;
   DetCondCFloat *m_distorsions;
+  PixelConvert::Map m_map;
 };
  
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h
index 20c37bb7403c..f601c2d988b2 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h
@@ -17,9 +17,7 @@ class PixelChargeInterpolationHistograms;
 class PixelChargeInterpolationPlot;
 class PixelChargeInterpolationParameters;
 
-class PixelChargeInterpolationCalibration;
-
-class ATLAS_NOT_THREAD_SAFE PixelChargeInterpolationCalibration{ // Thread unsafe PixelChargeInterpolationPlot class is used.
+class PixelChargeInterpolationCalibration{
 
 public :
 	// Modified stuff
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h
index 10dcd3620bb1..437ab3ba8858 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h
@@ -17,9 +17,7 @@ namespace PixelCalib{
 
 class PixelChargeInterpolationParameters;
 
-class PixelChargeInterpolationPlot;
-
-class ATLAS_NOT_THREAD_SAFE PixelChargeInterpolationPlot{ // static variable is used.
+class PixelChargeInterpolationPlot{
 
 public :
   PixelChargeInterpolationPlot(const PixelChargeInterpolationParameters &parameters, bool oneconst = false);
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeToTConversion.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeToTConversion.h
index 4652dc939a6d..fb7a9f470131 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeToTConversion.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeToTConversion.h
@@ -22,7 +22,8 @@
 
 class IBLParameterSvc;
 
-class PixelChargeToTConversion: public AthAlgorithm{
+// FIXME: Modifies data in SG!
+class ATLAS_NOT_THREAD_SAFE PixelChargeToTConversion : public AthAlgorithm{
   
  public:
   PixelChargeToTConversion(const std::string& name, ISvcLocator* pSvcLocator);
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h
index d292a867ff95..8306ee55da2f 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h
@@ -17,9 +17,7 @@ namespace PixelCalib{
 
 class PixelClusterOnTrackErrorData;
 
-class PixelClusterOnTrackErrorPlot;
-
-class ATLAS_NOT_THREAD_SAFE PixelClusterOnTrackErrorPlot{ // static variable is used.
+class PixelClusterOnTrackErrorPlot{
 
 public :
 	PixelClusterOnTrackErrorPlot(PixelClusterOnTrackErrorData &parameters,
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.h
index a13764e001ea..49a58dbbee9a 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PIXELCALIBALGS_PIXELCONVERT_H
@@ -10,6 +10,7 @@
 #include <iostream>
 #include <fstream>
 #include <map>
+#include <memory>
 
 
 /*
@@ -184,8 +185,15 @@ namespace PixelConvert {
   */
   std::string DCSID(const std::string& OnlineID);
 
-  int ReadMap(const std::string& filename);
-  unsigned int GetID(const unsigned int moduleID);
+
+  struct Map
+  {
+    typedef std::map<unsigned int,unsigned int> modulemap;
+    std::unique_ptr<modulemap> m_hashIndex;
+    std::unique_ptr<modulemap> m_SNIndex;
+  };
+  int ReadMap(const std::string& filename, Map& map);
+  unsigned int GetID(const Map& map, const unsigned int moduleID);
 
 }
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h
index fe8da3838d08..d6bb79dacade 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h
@@ -20,7 +20,7 @@ class PixelChargeInterpolationCalibration;
 class PixelChargeInterpolationValidation;
 
 
-class ATLAS_NOT_THREAD_SAFE PixelRIOs { // Thread unsafe PixelChargeInterpolationCalibration class is used.
+class PixelRIOs {
 public :
    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
    Int_t           fCurrent; //!current Tree number in a TChain
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx
index dc7386c78135..66343d7e9f0f 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx
@@ -314,7 +314,7 @@ StatusCode NoiseMapBuilder::registerHistograms(){
 // execute
 //
 //=========================================================
-StatusCode NoiseMapBuilder::execute ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe DataHandle template is used.
+StatusCode NoiseMapBuilder::execute(){
   ATH_MSG_DEBUG( "Executing NoiseMapBuilder" );
 
   // retrieve EventInfo
@@ -334,7 +334,7 @@ StatusCode NoiseMapBuilder::execute ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe D
   }
 
   // retrieve PixelRDO container
-  const DataHandle< PixelRDO_Container > pixelRDOs;
+  const PixelRDO_Container* pixelRDOs = nullptr;
   sc = sgSvc()->retrieve(pixelRDOs, m_pixelRDOKey);
   if( !sc.isSuccess() ){
     ATH_MSG_FATAL( "Unable to retrieve pixel RDO container at " << m_pixelRDOKey );
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx
index d05f7c08efeb..8723295eb898 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx
@@ -90,7 +90,7 @@ StatusCode PixMapDBWriter::execute(){
 }
 
 
-StatusCode PixMapDBWriter::finalize ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe DetectorSpecialPixelMap and ModuleSpecialPixelMap classes are used.
+StatusCode PixMapDBWriter::finalize (){
   ATH_MSG_INFO( "Finalizing PixMapDBWriter" );
 
   ATH_MSG_DEBUG( "Reading map of special pixels from file" );
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx
index 52d1c1f07de7..f313a1bff54c 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx
@@ -71,7 +71,7 @@ StatusCode PixMapOverlayWriter::initialize(){
   return StatusCode::SUCCESS;
 }
 
-StatusCode PixMapOverlayWriter::execute ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe ModuleSpecialPixelMap class is used.
+StatusCode PixMapOverlayWriter::execute (){
 
   auto spm = std::make_unique<DetectorSpecialPixelMap>();
   for(unsigned int i = 0; i < m_pixelID->wafer_hash_max(); i++){
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurvey.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurvey.cxx
index c48880739149..b1c50dbf5c43 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurvey.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurvey.cxx
@@ -78,7 +78,7 @@ StatusCode PixelBarrelSurvey::initialize(){
     return StatusCode::FAILURE;
   } 
 
-  int sc = PixelConvert::ReadMap(file_name);
+  int sc = PixelConvert::ReadMap(file_name, m_map);
   if ( sc ) {
     msg(MSG::FATAL) << "Error in accessing file " << file_name << endmsg;
     return StatusCode::FAILURE;
@@ -143,7 +143,7 @@ StatusCode PixelBarrelSurvey::execute() {
       HepGeom::Point3D<double> v0=trans*x0;
       HepGeom::Point3D<double> v1=trans*x1;
       unsigned int prodID=(theStave->module[i].serialNumber)%1000000;
-      Identifier hashID(PixelConvert::GetID(prodID));
+      Identifier hashID(PixelConvert::GetID(m_map, prodID));
       std::cout << m_pixelID->show_to_string(hashID) 
 	  << " " << v0.x() << " " << v0.y() << " " << v0.z()
 	  << " " << v1.x() << " " << v1.y() << " " << v1.z()
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationPlot.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationPlot.cxx
index 6f35c00e79bf..758a2280615a 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationPlot.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationPlot.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelChargeInterpolationPlot_cxx
@@ -8,6 +8,7 @@
 #include <vector>
 #include <string>
 #include <sstream>
+#include <atomic>
 
 #include <TH1.h>
 #include <TCanvas.h>
@@ -161,11 +162,11 @@ std::vector < TH1F* > *PixelChargeInterpolationPlot::HistogramsFromConstants(
 //	std::cout << "n bins: " << nbinhisto << std::endl;
 //	std::cout << "===============================================" << std::endl;
 
-	static int pass = 0;
-	pass++; 
+	static std::atomic<int> pass = 0;
+        int p = pass++;
 	for(int i = 0; i < nhisto; i++){
 		std::ostringstream NameString, TitleString;
-		NameString << csbins[i] << "_" << direction << pass
+		NameString << csbins[i] << "_" << direction << p
 			<< "clustersize_ " << csbins[i+1];
 		if(title != "") TitleString << title;
 		else TitleString << "Local " + xory + " - "
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx
index 767740d200ba..dbbbfb92c55f 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx
@@ -42,7 +42,7 @@ StatusCode PixelChargeToTConversion::initialize(){
   return StatusCode::SUCCESS;
 }
 
-StatusCode PixelChargeToTConversion::execute ATLAS_NOT_THREAD_SAFE (){ // const_cast is used.
+StatusCode PixelChargeToTConversion::execute(){
   const EventContext &ctx = Gaudi::Hive::currentContext();
   SG::ReadHandle<InDet::PixelClusterContainer> pixel_container( m_pixelsClustersKey, ctx);
   if (!pixel_container.isValid())
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelClusterOnTrackErrorPlot.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelClusterOnTrackErrorPlot.cxx
index aa587653862b..bdd748e1acb6 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelClusterOnTrackErrorPlot.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelClusterOnTrackErrorPlot.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelClusterOnTrackErrorPlot_cxx
@@ -158,11 +158,11 @@ std::vector < TH1F* > *PixelClusterOnTrackErrorPlot::HistogramsFromConstants(
 //	std::cout << "n bins: " << nbinhisto << std::endl;
 //	std::cout << "===============================================" << std::endl;
 
-	static int pass = 0;
-	pass++; 
+	static std::atomic<int> pass = 0;
+        int p = pass++;
 	for(int i = 0; i < nhisto; i++){
 		std::ostringstream NameString, TitleString;
-		NameString << csbins[i] << "_" << direction << pass
+		NameString << csbins[i] << "_" << direction << p
 			<< "clustersize_ " << csbins[i]+1;
 		if(title != "") TitleString << title;
 		else TitleString << "Local " + xory + " - "
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx
index a27ea5f63d73..c1d996a19928 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx
@@ -382,10 +382,6 @@ namespace PixelConvert {
     return ID;
   }
 
-  typedef std::map<unsigned int,unsigned int> modulemap;
-
-  modulemap* hashIndex=0;
-  modulemap* SNIndex=0;
   const std::string datafile("NamingConversions.txt");
 
   /*
@@ -400,15 +396,17 @@ namespace PixelConvert {
    * file named as in the string datafile initialized above.
    */
 
-  int ReadMap ATLAS_NOT_THREAD_SAFE (const std::string& filename ) {
 // Global variables are used.
+  int ReadMap (const std::string& filename,
+               Map& map)
+  {
     std::cerr << "INFO: Opening data file " << filename << std::endl; 
     std::ifstream f(filename.c_str());
     if ( !f.good() ) {
       std::cerr << "ERROR: Cannot open data file " << filename << std::endl; 
       return -1;
     }
-    hashIndex= new modulemap;
-    SNIndex= new modulemap;
+    map.m_hashIndex = std::make_unique<PixelConvert::Map::modulemap>();
+    map.m_SNIndex = std::make_unique<PixelConvert::Map::modulemap>();
     unsigned int hashID, SN;
     std::string dummy;
     getline(f,dummy); // read header line
@@ -418,28 +416,28 @@ namespace PixelConvert {
       // std::cerr << "Read from " << filename << "\t" << hashID << "\t" << SN << std::endl; 
       if ( f.bad() ) {
 	std::cerr << "ERROR: error reading " << filename 
-		  << " after " << hashIndex->size() << " entries" 
+		  << " after " << map.m_hashIndex->size() << " entries" 
 		  << std::endl;
 	f.close();
 	return -2;
       } else if ( f.eof() ) break;
-      hashIndex->insert(std::make_pair(hashID,SN));
-      SNIndex->insert(std::make_pair(SN,hashID));
+      map.m_hashIndex->insert(std::make_pair(hashID,SN));
+      map.m_SNIndex->insert(std::make_pair(SN,hashID));
     }
     std::cerr << "INFO: end of file " << filename 
-	      << " after " << hashIndex->size() << " entries" 
+	      << " after " << map.m_hashIndex->size() << " entries" 
 	      << std::endl;
     f.close();
     return 0;
   }
 
-  unsigned int GetID ATLAS_NOT_THREAD_SAFE (const unsigned int moduleID) {
 // Global variables are used.
-    // if maps are not previously loaded, read in the file 
-    if ( !hashIndex || !SNIndex ) ReadMap(datafile);
+  unsigned int GetID (const Map& map,
+                      const unsigned int moduleID)
+  {
     if ( moduleID>=510000 && moduleID<=519999 ) 
-      return (*SNIndex)[moduleID];
+      return (*map.m_SNIndex)[moduleID];
     else 
-      return (*hashIndex)[moduleID];
+      return (*map.m_hashIndex)[moduleID];
   }
 
 }
-- 
GitLab


From 0ba531b194ac0bb1b05498617407571562fef196 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 15 Sep 2020 08:42:14 -0400
Subject: [PATCH 298/422] TRT_CalibTools: Thread-safety consistency.

Thread-safety annotations should match between declarations and definitions.
---
 .../TRT_CalibTools/ITRTCalibrator.h           | 19 ++++++-------------
 .../TRT_CalibTools/src/Calibrator.h           | 11 ++++++-----
 .../TRT_CalibTools/src/TRTCalibrator.cxx      |  4 ++--
 .../TRT_CalibTools/src/TRTCalibrator.h        | 10 +++++-----
 4 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/TRT_CalibTools/ITRTCalibrator.h b/InnerDetector/InDetCalibTools/TRT_CalibTools/TRT_CalibTools/ITRTCalibrator.h
index 04a418767b16..ea662e52cd66 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/TRT_CalibTools/ITRTCalibrator.h
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/TRT_CalibTools/ITRTCalibrator.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRT_CALIBTOOLS__ITRTCALIBRATOR_H
@@ -16,6 +16,7 @@ PURPOSE:
 
 ********************************************************************/
 
+#include "CxxUtils/checker_macros.h"
 #include "GaudiKernel/IAlgTool.h"
 
 namespace Trk{
@@ -25,21 +26,13 @@ namespace TRT{
 class TrackInfo;
 }
 
-static const InterfaceID IID_ITRTCalibrator("ITRTCalibrator", 1, 0);
-
-class ITRTCalibrator : virtual public IAlgTool {
+class ATLAS_NOT_THREAD_SAFE ITRTCalibrator : virtual public IAlgTool {
 public:
-
+  DeclareInterfaceID( ITRTCalibrator, 1, 0 );
   virtual bool fill(const Trk::Track* aTrack, TRT::TrackInfo* output) = 0;
-  virtual bool calibrate() = 0;
-
-  static const InterfaceID& interfaceID();
+  // uses thread-unsafe methods from Calibrator.
+  virtual bool calibrate ATLAS_NOT_THREAD_SAFE () = 0;
 };
 
-inline const InterfaceID& ITRTCalibrator::interfaceID()
-{ 
-        return IID_ITRTCalibrator; 
-}
-
 #endif // TRT_CALIBTOOLS__ITRTCALIBRATOR_H
 
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.h b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.h
index 5c85ee62a83f..d59d7a4ea978 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.h
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /********************************************************************
@@ -14,6 +14,7 @@ PURPOSE: Class for calibrating a TRT sub-level
           
 ********************************************************************/
 
+#include "CxxUtils/checker_macros.h"
 #include <vector>
 #include <map>
 #include <set>
@@ -241,7 +242,7 @@ public:
      @param[in] caldata_above the caldata object from the sub-module above the one to be calibrated
      @return the root directory where the histgrams were written
   */
-  TDirectory* Calibrate(TDirectory*, std::string, std::string, caldata*);
+  TDirectory* Calibrate ATLAS_NOT_THREAD_SAFE (TDirectory*, std::string, std::string, caldata*);
 
   /**
      Makes the R-t fit
@@ -249,7 +250,7 @@ public:
      @param[in] rtHist the 2D root histogram with the R-t data
      @return the t0 from the R-t fit
   */
-  float FitRt(std::string,std::string,TH2F*,TDirectory*);
+  float FitRt ATLAS_NOT_THREAD_SAFE (std::string,std::string,TH2F*,TDirectory*);
 
   /**
      Makes the time residual fit
@@ -257,7 +258,7 @@ public:
      @param[in] tresHist the 1D root histogram with the time residuals
      @return the mean value of the time residual fit
   */
-  float FitTimeResidual(std::string,TH1F*);
+  float FitTimeResidual ATLAS_NOT_THREAD_SAFE (std::string,TH1F*);
 
   /**
      Makes the residual fit
@@ -265,7 +266,7 @@ public:
      @param[in] resHist the 1D root histogram with the residuals
      @return the mean value of the residual fit
   */
-  float FitResidual(std::string,TH1F*);
+  float FitResidual ATLAS_NOT_THREAD_SAFE (std::string,TH1F*);
 
   /**
      Creates an ntuple with entries containing data associated with the sub-modules in a sub level
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx
index 4f0b6c2a49b6..ebcd7e2a3c72 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /********************************************************************
@@ -367,7 +367,7 @@ void TRTCalibrator::MakeBDKeys(int bec, int low, int mod, int brd, int chp, int
 
 }
 
-bool TRTCalibrator::calibrate() {
+bool TRTCalibrator::calibrate ATLAS_NOT_THREAD_SAFE () {
 
   float run,evt,trk,r,dr,t,rtrack,ttrack,t0,ephase,sid;
   Identifier ident;
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.h b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.h
index 4628bb2a6566..0f5de05eae42 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.h
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRT_CALIBTOOLS__TRTCALIBRATOR_H
@@ -72,10 +72,10 @@ public:
       "-1" & "1": calibration of the barrel C- & A-side
       "X_Y": calibration of layer Y in barrel X-side
   */
-  virtual StatusCode initialize();
-  virtual StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
 
-  virtual bool fill(const Trk::Track* aTrack, TRT::TrackInfo* output);
+  virtual bool fill(const Trk::Track* aTrack, TRT::TrackInfo* output) override;
 
   bool IncludedLevels(std::string, int*);
 
@@ -107,7 +107,7 @@ public:
   /**
      Method for doing the actual calibration
   */
-  virtual bool calibrate();
+  virtual bool calibrate ATLAS_NOT_THREAD_SAFE () override;
 
 private:
   const AtlasDetectorID* m_DetID;
-- 
GitLab


From af6a506e37fdbeb150dfeb6bda1a82be43da463b Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 17 Sep 2020 08:35:54 -0400
Subject: [PATCH 299/422] InDetDiMuonMonitoring: Thread-safety cleanups.

Thread-safety annotations should match between declarations and definitions.
---
 .../InDetDiMuonMonitoring/src/DiMuMon.cxx     | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.cxx b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.cxx
index 55c8e18d5f58..4cd7b6f0df4c 100644
--- a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.cxx
+++ b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.cxx
@@ -4,6 +4,7 @@
 
 #include <sstream>
 #include "GaudiKernel/PhysicalConstants.h"
+#include "AthContainers/ConstDataVector.h"
 
 #include "DiMuMon.h"
 
@@ -243,7 +244,7 @@ StatusCode DiMuMon::bookHistograms()
 }
 
 
-StatusCode DiMuMon::fillHistograms ATLAS_NOT_THREAD_SAFE () // const_cast is used.
+StatusCode DiMuMon::fillHistograms()
 {
 
   const double muonMass = 105.66*Gaudi::Units::MeV;
@@ -255,7 +256,7 @@ StatusCode DiMuMon::fillHistograms ATLAS_NOT_THREAD_SAFE () // const_cast is use
   } else ATH_MSG_DEBUG("Muon container successfully retrieved.");
 
   //make a new container
-  xAOD::MuonContainer* goodMuons = new xAOD::MuonContainer( SG::VIEW_ELEMENTS );
+  ConstDataVector<xAOD::MuonContainer> goodMuons( SG::VIEW_ELEMENTS );
 
   //pick out the good muon tracks and store in the new container
   for(const auto* muon : *muons ) {
@@ -287,15 +288,15 @@ StatusCode DiMuMon::fillHistograms ATLAS_NOT_THREAD_SAFE () // const_cast is use
     if (fabs(idTrkEta)>2.5) continue;
     m_stat->Fill("eta<2.5",1);
 
-    goodMuons->push_back(const_cast<xAOD::Muon*>(muon));
+    goodMuons.push_back(muon);
   }
 
   //pair up the tracks of the good muons and fill histograms
-  int nMuons = goodMuons->size();
+  int nMuons = goodMuons.size();
 
   if (nMuons>1){
-    xAOD::MuonContainer::const_iterator mu1 = goodMuons->begin();
-    xAOD::MuonContainer::const_iterator muEnd = goodMuons->end();
+    xAOD::MuonContainer::const_iterator mu1 = goodMuons.begin();
+    xAOD::MuonContainer::const_iterator muEnd = goodMuons.end();
     for (; mu1!=muEnd;mu1++){
       const xAOD::TrackParticle *id1 = (*mu1)->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
       xAOD::MuonContainer::const_iterator mu2 = mu1+1;
@@ -451,7 +452,7 @@ StatusCode DiMuMon::fillHistograms ATLAS_NOT_THREAD_SAFE () // const_cast is use
 }
 
 
-StatusCode DiMuMon::procHistograms ATLAS_NOT_THREAD_SAFE () // Thread unsafe DiMuMon::iterativeGausFit is used.
+StatusCode DiMuMon::procHistograms()
 {
 
 
@@ -483,7 +484,7 @@ StatusCode DiMuMon::procHistograms ATLAS_NOT_THREAD_SAFE () // Thread unsafe DiM
 }
 
 
-void DiMuMon::iterativeGausFit ATLAS_NOT_THREAD_SAFE (TH2F* hin, std::vector<TH1F*> hout, int mode){ // Global gStyle is used.
+void DiMuMon::iterativeGausFit (TH2F* hin, std::vector<TH1F*> hout, int mode){
   // a canvas may be needed when implmenting this into the post-processing file
   TString hname =  hin->GetName();
   TString psName = hname + m_triggerChainName + ".ps";
@@ -511,7 +512,7 @@ void DiMuMon::iterativeGausFit ATLAS_NOT_THREAD_SAFE (TH2F* hin, std::vector<TH1
 	sigma= fn->GetParameter(2);
 	fn->SetRange(mean-1.2*sigma,mean+1.2*sigma);
 	fn->SetParameters(float(htemp->GetEntries())/10.,mean,sigma);
-	gStyle->SetOptStat(1);
+	//gStyle->SetOptStat(1); // not thread-safe
 	if (m_doSaveFits) {
 	  htemp->Fit("fn","RML");
 	  ctemp->Print(psName);
-- 
GitLab


From 514dda01a2ea6d765e99363d6c93a666bc503bf3 Mon Sep 17 00:00:00 2001
From: Will Leight <wleight@cern.ch>
Date: Sun, 20 Sep 2020 22:47:58 +0200
Subject: [PATCH 300/422] Fix for ATLASRECTS-5661

Using the dynamic ID alignment leads to rare crashes in when calculating the etcone isolation for muons.
This turns out to be because extrapolation into the calorimeter from the ID exit fails.
During standard reco, extrapolation into the calorimeter is done using the perigee: as it turns out, this works with dynamic ID alignment as well.
Therefore this fix updates the ParticleCaloCellAssociationTool to ensure that its instance of the ParticleCaloExtensionTool always starts from the perigee.
The MuonCreatorTool is also updated, as the association of cells to muon to form a cluster will fail otherwise (although this does not lead to a crash).
In principle, for muons the difference between starting the extrapolation at the ID exit and the perigee should be negligible.
While it would be good to understand exactly why the use of the alignment causes this crash, this fix will be much simpler and quicker to implement.
---
 .../python/MuonCombinedRecToolsConfig.py                   | 2 +-
 .../python/MuonCombinedRecExampleConfigDb.py               | 2 +-
 Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py  | 7 ++++++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
index 0d44883535c6..4df13ee9e279 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
@@ -224,7 +224,7 @@ def MuonCreatorToolCfg(flags, name="MuonCreatorTool", **kwargs):
     kwargs.setdefault("TrackParticleCreator", acc.getPrimary() )
     result.merge(acc)
 
-    acc = ParticleCaloExtensionToolCfg(flags)
+    acc = ParticleCaloExtensionToolCfg(flags,StartFromPerigee=True)
     kwargs.setdefault("ParticleCaloExtensionTool", acc.getPrimary() )
     result.merge(acc)
 
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
index a961d6ff4a81..14fd62753504 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
@@ -50,7 +50,7 @@ addAlgorithm("MuonCombinedRecExample.MuonCombinedAlgs.StauCreatorAlg","StauCreat
 
 # tracking tools
 addTool("TrkTrackSummaryTool.AtlasTrackSummaryTool.AtlasTrackSummaryTool", "AtlasTrackSummaryTool" )
-addTool("Trk::ParticleCaloExtensionTool", "MuonParticleCaloExtensionTool", Extrapolator = "AtlasExtrapolator")
+addTool("Trk::ParticleCaloExtensionTool", "MuonParticleCaloExtensionTool", Extrapolator = "AtlasExtrapolator", StartFromPerigee = True)
 
 # put this here until it is set in the appropriate package
 addTool("MuonCombinedRecExample.MuonSegmentTaggerTools.MuTagMatchingTool","MuTagMatchingTool")
diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
index 64ca2286f629..b6b2fbfe1588 100644
--- a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
+++ b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
@@ -68,8 +68,13 @@ from egammaTools.egammaExtrapolators import egammaExtrapolator
 CaloExtensionTool =  ToolFactory (Trk__ParticleCaloExtensionTool,
                                   Extrapolator = egammaExtrapolator)
 
+#adding this to address a rare crash when calculating etCone iso for muons, the tool is not used by any other part of the code
+MuonCaloExtensionTool =  ToolFactory (Trk__ParticleCaloExtensionTool,
+                                      Extrapolator = egammaExtrapolator,
+                                      StartFromPerigee = True)
+
 CaloCellAssocTool =  ToolFactory (Rec__ParticleCaloCellAssociationTool,
-                                  ParticleCaloExtensionTool = CaloExtensionTool)
+                                  ParticleCaloExtensionTool = MuonCaloExtensionTool)
 
 
 # configuration for ED computation
-- 
GitLab


From bca3c0fdbf4461e8b05a1a61a208291b8d6ecfd5 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Mon, 21 Sep 2020 01:51:58 +0200
Subject: [PATCH 301/422] converted the TMath::Log10 to std::log10 + set int
 incShowerSubtracted option to false

---
 .../tauRecTools/Root/TauJetRNNUtils.cxx       | 42 +++++++++----------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index c2b5331a954f..dd262c75a361 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -174,7 +174,7 @@ bool etOverPtLeadTrk(const xAOD::TauJet &tau, double &out) {
     float etOverPtLeadTrk;
     const auto success = tau.detail(TauDetail::etOverPtLeadTrk,
                                     etOverPtLeadTrk);
-    out = TMath::Log10(std::max(etOverPtLeadTrk, 0.1f));
+    out = std::log10(std::max(etOverPtLeadTrk, 0.1f));
     return success;
 }
 
@@ -203,7 +203,7 @@ bool SumPtTrkFrac(const xAOD::TauJet &tau, double &out) {
 bool EMPOverTrkSysP(const xAOD::TauJet &tau, double &out) {
     float EMPOverTrkSysP;
     const auto success = tau.detail(TauDetail::EMPOverTrkSysP, EMPOverTrkSysP);
-    out = TMath::Log10(std::max(EMPOverTrkSysP, 1e-3f));
+    out = std::log10(std::max(EMPOverTrkSysP, 1e-3f));
     return success;
 }
 
@@ -218,7 +218,7 @@ bool ptRatioEflowApprox(const xAOD::TauJet &tau, double &out) {
 bool mEflowApprox(const xAOD::TauJet &tau, double &out) {
     float mEflowApprox;
     const auto success = tau.detail(TauDetail::mEflowApprox, mEflowApprox);
-    out = TMath::Log10(std::max(mEflowApprox, 140.0f));
+    out = std::log10(std::max(mEflowApprox, 140.0f));
     return success;
 }
 
@@ -233,34 +233,34 @@ bool trFlightPathSig(const xAOD::TauJet &tau, double &out) {
     float trFlightPathSig;
     const auto success = tau.detail(TauDetail::trFlightPathSig,
                                     trFlightPathSig);
-    out = TMath::Log10(std::max(trFlightPathSig, 0.01f));
+    out = std::log10(std::max(trFlightPathSig, 0.01f));
     return success;
 }
 
 bool massTrkSys(const xAOD::TauJet &tau, double &out) {
     float massTrkSys;
     const auto success = tau.detail(TauDetail::massTrkSys, massTrkSys);
-    out = TMath::Log10(std::max(massTrkSys, 140.0f));
+    out = std::log10(std::max(massTrkSys, 140.0f));
     return success;
 }
 
 bool pt(const xAOD::TauJet &tau, double &out) {
-    out = TMath::Log10(std::min(tau.pt() / GeV, 100.0));
+    out = std::log10(std::min(tau.pt() / GeV, 100.0));
     return true;
 }
 
 bool ptDetectorAxis(const xAOD::TauJet &tau, double &out) {
-    out = TMath::Log10(std::min(tau.ptDetectorAxis() / GeV, 100.0));
+    out = std::log10(std::min(tau.ptDetectorAxis() / GeV, 100.0));
     return true;
 }
 
 bool ptIntermediateAxis(const xAOD::TauJet &tau, double &out) {
-    out = TMath::Log10(std::min(tau.ptIntermediateAxis() /GeV, 100.0));
+    out = std::log10(std::min(tau.ptIntermediateAxis() /GeV, 100.0));
     return true;
 }
 
 bool ptJetSeed_log(const xAOD::TauJet &tau, double &out) {
-  out = TMath::Log10(std::max(tau.ptJetSeed(), 1e-3));
+  out = std::log10(std::max(tau.ptJetSeed(), 1e-3));
   return true;
 }
 
@@ -288,7 +288,7 @@ bool EMFracFixed(const xAOD::TauJet &tau, double &out){
 bool etHotShotWinOverPtLeadTrk(const xAOD::TauJet &tau, double &out){
   float etHotShotWinOverPtLeadTrk = tau.auxdata<float>("etHotShotWinOverPtLeadTrk");
   out = std::max(etHotShotWinOverPtLeadTrk, 1e-6f);
-  out = TMath::Log10(out);
+  out = std::log10(out);
   return true;
 }
 
@@ -353,25 +353,25 @@ namespace Track {
 
 bool pt_log(const xAOD::TauJet& /*tau*/, const xAOD::TauTrack &track,
             double &out) {
-    out = TMath::Log10(track.pt());
+    out = std::log10(track.pt());
     return true;
 }
 
 bool pt_jetseed_log(const xAOD::TauJet &tau, const xAOD::TauTrack& /*track*/,
                     double &out) {
-    out = TMath::Log10(tau.ptJetSeed());
+    out = std::log10(tau.ptJetSeed());
     return true;
 }
 
 bool d0_abs_log(const xAOD::TauJet& /*tau*/, const xAOD::TauTrack &track,
                 double &out) {
-    out = TMath::Log10(TMath::Abs(track.track()->d0()) + 1e-6);
+    out = std::log10(TMath::Abs(track.track()->d0()) + 1e-6);
     return true;
 }
 
 bool z0sinThetaTJVA_abs_log(const xAOD::TauJet& tau, const xAOD::TauTrack &track,
                             double &out) {
-    out = TMath::Log10(TMath::Abs(track.z0sinThetaTJVA(tau)) + 1e-6);
+    out = std::log10(TMath::Abs(track.z0sinThetaTJVA(tau)) + 1e-6);
     return true;
 }
 
@@ -458,13 +458,13 @@ using MomentType = xAOD::CaloCluster::MomentType;
 
 bool et_log(const xAOD::TauJet& /*tau*/, const xAOD::CaloCluster &cluster,
             double &out) {
-    out = TMath::Log10(cluster.et());
+    out = std::log10(cluster.et());
     return true;
 }
 
 bool pt_jetseed_log(const xAOD::TauJet &tau, const xAOD::CaloCluster& /*cluster*/,
                     double &out) {
-    out = TMath::Log10(tau.ptJetSeed());
+    out = std::log10(tau.ptJetSeed());
     return true;
 }
 
@@ -483,21 +483,21 @@ bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster,
 bool SECOND_R(const xAOD::TauJet& /*tau*/, const xAOD::CaloCluster &cluster,
               double &out) {
     const auto success = cluster.retrieveMoment(MomentType::SECOND_R, out);
-    out = TMath::Log10(out + 0.1);
+    out = std::log10(out + 0.1);
     return success;
 }
 
 bool SECOND_LAMBDA(const xAOD::TauJet& /*tau*/, const xAOD::CaloCluster &cluster,
                    double &out) {
     const auto success = cluster.retrieveMoment(MomentType::SECOND_LAMBDA, out);
-    out = TMath::Log10(out + 0.1);
+    out = std::log10(out + 0.1);
     return success;
 }
 
 bool CENTER_LAMBDA(const xAOD::TauJet& /*tau*/, const xAOD::CaloCluster &cluster,
                    double &out) {
     const auto success = cluster.retrieveMoment(MomentType::CENTER_LAMBDA, out);
-    out = TMath::Log10(out + 1e-6);
+    out = std::log10(out + 1e-6);
     return success;
 }
 
@@ -536,7 +536,7 @@ bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const
   }
 
   std::vector<const xAOD::CaloCluster *> clusters;
-  bool            incShowerSubtracted(true);
+  bool            incShowerSubtracted(false);
   TLorentzVector  LC_P4 = tau.p4(xAOD::TauJetParameters::DetectorAxis);
   double          dRCut(0.2);
   auto        check_clusters = tauRecTools::GetJetClusterList(jet_seed, clusters, incShowerSubtracted, LC_P4, dRCut);
@@ -576,7 +576,7 @@ bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const
   // so we need to evaluate the differance of log10(cluster_firstEngDens) and the ClustersMeanFirstEngDens
   float min_FirstEng = 1e-10;
   float cluster_FirstEngDens       = std::max(cluster.getMomentValue(MomentType::FIRST_ENG_DENS), (double)min_FirstEng);
-  out = TMath::Log10(cluster_FirstEngDens/std::max(Etot, min_FirstEng)) - tau.auxdata<float>("ClustersMeanFirstEngDens");
+  out = std::log10(cluster_FirstEngDens/std::max(Etot, min_FirstEng)) - tau.auxdata<float>("ClustersMeanFirstEngDens");
   
   return true;
 }
-- 
GitLab


From 2f37e791351b4c777a32530f34b7415f9633fa61 Mon Sep 17 00:00:00 2001
From: Martin Rybar <martin.rybar@cern.ch>
Date: Mon, 21 Sep 2020 09:25:50 +0200
Subject: [PATCH 302/422] Fix for the ATLASRECTS-5659 - changing
 "InputContainer" to "JetContainer" in HIJetRecUtils.py reflecting earlier
 change in JetMomentTools package

---
 Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py
index d2c57793ad46..81a1276ab396 100644
--- a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py
+++ b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py
@@ -84,14 +84,14 @@ def AddPtAssociationTools(R, doTracks=True) :
         tname='hitrackassoc_04'
         if tname not in jtm.tools:
             JetPtAssociationTool=CompFactory.JetPtAssociationTool
-            jtm.add(JetPtAssociationTool(tname, InputContainer=cname, AssociationName="GhostTrack"))
+            jtm.add(JetPtAssociationTool(tname, JetContainer=cname, AssociationName="GhostTrack"))
         tlist += [ jtm.tools[tname] ]
     if jetFlags.useTruth():
         cname='AntiKt%dTruthJets' % int(10*R)
         tname='truthassoc_0%d' % int(10*R)
         if tname not in jtm.tools:
             JetPtAssociationTool=CompFactory.JetPtAssociationTool
-            jtm.add(JetPtAssociationTool(tname, InputContainer=cname, AssociationName="GhostTruth"))
+            jtm.add(JetPtAssociationTool(tname, JetContainer=cname, AssociationName="GhostTruth"))
         tlist += [ jtm.tools[tname] ]
     return tlist
 
-- 
GitLab


From 8b032f91ddc03f258426b88b133eb699658cb598 Mon Sep 17 00:00:00 2001
From: Rupert Tombs <rt500@cam.ac.uk>
Date: Tue, 15 Sep 2020 17:47:41 +0100
Subject: [PATCH 303/422] Add FileName argument for JobOptsDumperCfg, use it in
 digi config. Relocate to central config folder. Create and use an
 Overlay-specific version.

Remove unused import
---
 Control/AthenaConfiguration/python/JobOptsDumper.py | 13 +++++++++++++
 .../test/DigitizationComparisonNew_test.py          |  4 ++--
 .../test/DigitizationPUConfigNew_test.py            |  2 ++
 .../python/OverlayTestHelpers.py                    | 10 +++-------
 .../OverlayConfiguration/test/OverlayTest.py        |  4 ++--
 .../test/test_DataOverlay_ConfigTest_Zmumu.sh       |  2 +-
 .../test/test_DataOverlay_ConfigTest_Zmumu_BCM.sh   |  2 +-
 .../test/test_DataOverlay_ConfigTest_Zmumu_LAr.sh   |  2 +-
 .../test/test_DataOverlay_ConfigTest_Zmumu_Muon.sh  |  2 +-
 .../test/test_DataOverlay_ConfigTest_Zmumu_Pixel.sh |  2 +-
 .../test/test_DataOverlay_ConfigTest_Zmumu_SCT.sh   |  2 +-
 .../test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh   |  2 +-
 .../test/test_DataOverlay_ConfigTest_Zmumu_Tile.sh  |  2 +-
 .../test/test_DataOverlay_ConfigTest_Zmumu_Truth.sh |  2 +-
 .../test_DataOverlay_ConfigTest_Zmumu_sequential.sh |  2 +-
 .../test/test_MCOverlay_ConfigTest_ttbar.sh         |  2 +-
 .../test/test_MCOverlay_ConfigTest_ttbar_BCM.sh     |  2 +-
 .../test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh  |  2 +-
 .../test/test_MCOverlay_ConfigTest_ttbar_LAr.sh     |  2 +-
 .../test/test_MCOverlay_ConfigTest_ttbar_Muon.sh    |  2 +-
 .../test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh   |  2 +-
 .../test/test_MCOverlay_ConfigTest_ttbar_SCT.sh     |  2 +-
 .../test/test_MCOverlay_ConfigTest_ttbar_TRT.sh     |  2 +-
 .../test/test_MCOverlay_ConfigTest_ttbar_Tile.sh    |  2 +-
 .../test/test_MCOverlay_ConfigTest_ttbar_Truth.sh   |  2 +-
 .../test_MCOverlay_ConfigTest_ttbar_sequential.sh   |  2 +-
 .../test_DataOverlay_MT_Zmumu_8threads_NewConfig.sh |  2 +-
 .../test_MCOverlay_MT_ttbar_8threads_NewConfig.sh   |  2 +-
 28 files changed, 45 insertions(+), 34 deletions(-)
 create mode 100644 Control/AthenaConfiguration/python/JobOptsDumper.py

diff --git a/Control/AthenaConfiguration/python/JobOptsDumper.py b/Control/AthenaConfiguration/python/JobOptsDumper.py
new file mode 100644
index 000000000000..96f7ce28dc24
--- /dev/null
+++ b/Control/AthenaConfiguration/python/JobOptsDumper.py
@@ -0,0 +1,13 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+
+
+def JobOptsDumperCfg(flags, FileName="JobOptsConfig.txt"):
+    """Return ComponentAccumulator with JobOptsDumperAlg.
+
+    This dumps the configuration to text in a file named by FileName.
+    """
+    acc = ComponentAccumulator()
+    acc.addEventAlgo(CompFactory.JobOptsDumperAlg(FileName=FileName))
+    return acc
diff --git a/Simulation/Digitization/test/DigitizationComparisonNew_test.py b/Simulation/Digitization/test/DigitizationComparisonNew_test.py
index 0f0dd4d13dc7..d98f9518b78d 100755
--- a/Simulation/Digitization/test/DigitizationComparisonNew_test.py
+++ b/Simulation/Digitization/test/DigitizationComparisonNew_test.py
@@ -23,7 +23,7 @@ from MuonConfig.CSC_DigitizationConfig import CSC_DigitizationDigitToRDOCfg
 from LArDigitization.LArDigitizationConfigNew import LArTriggerDigitizationCfg
 from TileSimAlgs.TileDigitizationConfig import TileDigitizationCfg, TileTriggerDigitizationCfg
 from MCTruthSimAlgs.RecoTimingConfig import MergeRecoTimingObjCfg
-from OverlayConfiguration.OverlayTestHelpers import JobOptsDumperCfg
+from AthenaConfiguration.JobOptsDumper import JobOptsDumperCfg
 from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
 
 # Set up logging and new style config
@@ -103,7 +103,7 @@ TileRChMaker.TileRawChannelBuilderFitOverflow.TimeMaxForAmpCorrection = 25.
 TileRChMaker.TileRawChannelBuilderFitOverflow.TimeMinForAmpCorrection = -25.
 
 # Dump config
-acc.merge(JobOptsDumperCfg(ConfigFlags))
+acc.merge(JobOptsDumperCfg(ConfigFlags, FileName="DigiComparisonConfig.txt"))
 acc.getService("StoreGateSvc").Dump = True
 acc.getService("ConditionStore").Dump = True
 acc.printConfig(withDetails=True, summariseProps=True)
diff --git a/Simulation/Digitization/test/DigitizationPUConfigNew_test.py b/Simulation/Digitization/test/DigitizationPUConfigNew_test.py
index 5e117a63a425..c224fe37e8f4 100755
--- a/Simulation/Digitization/test/DigitizationPUConfigNew_test.py
+++ b/Simulation/Digitization/test/DigitizationPUConfigNew_test.py
@@ -15,6 +15,7 @@ from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
 from Digitization.DigitizationParametersConfig import writeDigitizationMetadata
 from MCTruthSimAlgs.RecoTimingConfig import MergeRecoTimingObjCfg
+from AthenaConfiguration.JobOptsDumper import JobOptsDumperCfg
 from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
 from DigitizationPUConfigNew_test_setup import (
     test_HighPtMinbiasHitsFile,
@@ -109,6 +110,7 @@ acc.merge(MergeCalibHitsCfg(ConfigFlags))
 #acc.getEventAlgo("OutputStreamRDO").AcceptAlgs = ["StandardPileUpToolsAlg"]
 
 # Dump config
+acc.merge(JobOptsDumperCfg(ConfigFlags, FileName="DigiPUConfig.txt"))
 acc.getService("StoreGateSvc").Dump = True
 acc.getService("ConditionStore").Dump = True
 acc.printConfig(withDetails=True)
diff --git a/Simulation/Overlay/OverlayConfiguration/python/OverlayTestHelpers.py b/Simulation/Overlay/OverlayConfiguration/python/OverlayTestHelpers.py
index 9c7db234860a..3b2b330a25f5 100644
--- a/Simulation/Overlay/OverlayConfiguration/python/OverlayTestHelpers.py
+++ b/Simulation/Overlay/OverlayConfiguration/python/OverlayTestHelpers.py
@@ -6,17 +6,13 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from argparse import ArgumentParser
 
-from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
-from AthenaConfiguration.ComponentFactory import CompFactory
 from OverlayConfiguration.OverlayHelpers import setupOverlayDetectorFlags
+from AthenaConfiguration.JobOptsDumper import JobOptsDumperCfg
 
 
-def JobOptsDumperCfg(flags):
+def OverlayJobOptsDumperCfg(flags):
     """Configure event loop for overlay"""
-    JobOptsDumperAlg = CompFactory.JobOptsDumperAlg
-    acc = ComponentAccumulator()
-    acc.addEventAlgo(JobOptsDumperAlg(FileName="OverlayTestConfig.txt"))
-    return acc
+    return JobOptsDumperCfg(flags, FileName="OverlayTestConfig.txt")
 
 
 def CommonTestArgumentParser(prog):
diff --git a/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py b/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py
index e166ed0bed14..76bb9784aeb4 100755
--- a/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py
+++ b/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py
@@ -13,7 +13,7 @@ from AthenaConfiguration.AllConfigFlags import ConfigFlags
 from OverlayConfiguration.OverlayHelpers import OverlayMessageSvcCfg
 from OverlayConfiguration.OverlaySteering import OverlayMainCfg
 from OverlayConfiguration.OverlayTestHelpers import \
-    CommonTestArgumentParser, JobOptsDumperCfg, \
+    CommonTestArgumentParser, OverlayJobOptsDumperCfg, \
     defaultTestFlags, postprocessAndLockFlags, printAndRun
 
 # Set up logging and new style config
@@ -49,7 +49,7 @@ acc = OverlayMainCfg(ConfigFlags)
 if args.profile:
     from PerfMonVTune.PerfMonVTuneConfig import VTuneProfilerServiceCfg
     acc.merge(VTuneProfilerServiceCfg(ConfigFlags))
-acc.merge(JobOptsDumperCfg(ConfigFlags))
+acc.merge(OverlayJobOptsDumperCfg(ConfigFlags))
 acc.merge(OverlayMessageSvcCfg(ConfigFlags))
 
 # dump pickle
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu.sh
index a72500534453..0f5569b30a19 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu.sh
@@ -57,7 +57,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_BCM.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_BCM.sh
index c8705d707309..45674f1124c3 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_BCM.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_BCM.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_LAr.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_LAr.sh
index dffd006687e4..218bad3223ad 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_LAr.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_LAr.sh
@@ -60,7 +60,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Muon.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Muon.sh
index 298f30bc0eed..85a06a9f1e90 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Muon.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Muon.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Pixel.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Pixel.sh
index 2f4452b84c51..731a983326b5 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Pixel.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Pixel.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_SCT.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_SCT.sh
index 49d46e585043..951ae1b5d280 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_SCT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_SCT.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh
index 1ba8e0728185..23c4d193328d 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Tile.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Tile.sh
index 734297ccd6fb..9447175a33bb 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Tile.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Tile.sh
@@ -60,7 +60,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Truth.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Truth.sh
index 34f8e15218c4..16fc71878097 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Truth.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Truth.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_sequential.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_sequential.sh
index 9ffa8d802c09..ee3ba7315466 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_sequential.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_sequential.sh
@@ -19,7 +19,7 @@ Overlay_tf.py \
 --outputRDOFile dataOverlayRDO.pool.root \
 --maxEvents 10 \
 --conditionsTag CONDBR2-BLKPA-2016-12 \
---postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+--postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
 --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
 --imf False
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
index 695791ba9ab5..ac1a0d292654 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
@@ -54,7 +54,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
index 3146eab4e250..e18715077086 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh
index d834df674906..b3b33d265c88 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
index 5f56e46cfb9e..a8aaba5f0927 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
index 4650a1c984a2..44e81b1def54 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
index a263754792b2..a383bf4a038c 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
index 3f51c4028ed3..ce8b070a4326 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
index f24e9bc69b51..08c99763a9b9 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
index dfda47534efa..475ce8227650 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
index 8b6bccd77673..4ea7787c22d9 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
index 3a6bc9adc051..c72fee4c9042 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
@@ -20,7 +20,7 @@ Overlay_tf.py \
 --maxEvents 10 \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
---postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+--postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
 --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
 --imf False
 
diff --git a/Simulation/Tests/OverlayTestsMT/test/test_DataOverlay_MT_Zmumu_8threads_NewConfig.sh b/Simulation/Tests/OverlayTestsMT/test/test_DataOverlay_MT_Zmumu_8threads_NewConfig.sh
index c485c9b2f7a1..3cf75227136a 100755
--- a/Simulation/Tests/OverlayTestsMT/test/test_DataOverlay_MT_Zmumu_8threads_NewConfig.sh
+++ b/Simulation/Tests/OverlayTestsMT/test/test_DataOverlay_MT_Zmumu_8threads_NewConfig.sh
@@ -23,7 +23,7 @@ Overlay_tf.py \
 --outputRDOFile dataOverlayRDO.pool.root \
 --maxEvents 100 \
 --conditionsTag CONDBR2-BLKPA-2016-12 \
---postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+--postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
 --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
 --imf False
 
diff --git a/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh b/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh
index 16988c951df7..4cdf44b15b7a 100755
--- a/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh
+++ b/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh
@@ -24,7 +24,7 @@ Overlay_tf.py \
 --maxEvents 50 --skipEvents 10 --digiSeedOffset1 511 --digiSeedOffset2 727 \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
---postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+--postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
 --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
 --imf False
 
-- 
GitLab


From ed2c6631d6dc065ecf45db202d0eec071c9abf87 Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <mhodgkin@aiatlas025.cern.ch>
Date: Mon, 21 Sep 2020 13:06:43 +0200
Subject: [PATCH 304/422] Add new reco test to run latest MC configuration with
 pileup.

---
 .../test/test_mcLatest_13TeV.sh                    | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100755 Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_13TeV.sh

diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_13TeV.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_13TeV.sh
new file mode 100755
index 000000000000..008085ac0193
--- /dev/null
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_13TeV.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# art-description: Reco_tf for PhysVal, updated with q221 (2017-11-13) + pileup
+# art-athena-mt: 4
+# art-type: grid
+# art-include: master/Athena
+
+export TRF_ECHO=True;
+Reco_tf.py --AMI=r11976 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/eos/atlas/atlascerngroupdisk/data-art/grid-input/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputHighPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/HITS.10501933._000008.pool.root.1 --inputLowPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/HITS.10501925._000027.pool.root.1 --maxEvents=5 --jobNumber=1 --imf False
+RES=$?
+echo "art-result: $RES Reco"
+if [ $RES -ne 0 ];then
+return $RES
+fi
-- 
GitLab


From 82f3279d2e2345bd73961cf1cae68734bf870930 Mon Sep 17 00:00:00 2001
From: Teng Jian Khoo <teng.jian.khoo@cern.ch>
Date: Mon, 21 Sep 2020 12:19:35 +0000
Subject: [PATCH 305/422] Adding SD CSSK (jes, and nojcalib) chains

also nojcalib LCTopo to help comparing

NOTE: Not working (some restructuring is needed)
---
 .../python/JetCalibToolsConfig.py             |  14 +-
 .../DecisionHandling/python/jetMenuHelper.py  |   5 +-
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    | 156 +++++---
 .../share/ref_data_v1Dev_build.ref            | 144 ++++---
 .../TrigEDMConfig/python/TriggerEDMRun3.py    |  18 +
 .../Jet/JetChainConfiguration.py              |   3 +-
 .../HLTMenuConfig/Jet/JetMenuSequences.py     |   8 +-
 .../HLTMenuConfig/Jet/JetRecoConfiguration.py |  42 +-
 .../HLTMenuConfig/Jet/JetRecoSequences.py     | 360 +++++++++---------
 .../python/HLTMenuConfig/MET/AlgConfigs.py    |  14 +-
 .../python/HLTMenuConfig/Menu/LS2_v1.py       |  40 +-
 .../HLTMenuConfig/Menu/Physics_pp_run3_v1.py  |   8 +-
 12 files changed, 464 insertions(+), 348 deletions(-)

diff --git a/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py b/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py
index bbdba4c998b6..8d419d0281c6 100644
--- a/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py
+++ b/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py
@@ -48,6 +48,7 @@ fatjetcontexts = {
     "TAMass":        ("JES_MC16recommendation_FatJet_JMS_TA_29Nov2017.config","00-04-81","EtaJES_JMS"),
     "TrigUngroomed": ("JES_Full2012dataset_Rscan_June2014.config","00-04-77","JetArea_EtaJES"),
     "TrigTrimmed":   ("JES_MC15recommendation_FatJet_June2015.config","00-04-77","EtaJES_JMS"),
+    "TrigSoftDrop":  ("JES_MC16recommendation_R10_UFO_CSSK_SoftDrop_JMS_01April2020.config","00-04-82","EtaJES_JMS"),
 }
 
 # List AFII config files separately, to avoid needing to specify a different context
@@ -65,6 +66,8 @@ calibcontexts = {
     "AntiKt10LCTopo":fatjetcontexts,
     # Standard trimmed
     "AntiKt10LCTopoTrimmedPtFrac5SmallR20":fatjetcontexts,
+    # Large-R PFlow Soft Drop CSSK
+    "AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10":fatjetcontexts,
     # R-Scan
     "AntiKt2LCTopo":rscanlc2,
     "AntiKt6LCTopo":rscanlc6,
@@ -77,10 +80,6 @@ hasInSitu = ["AntiKt4LCTopo", "AntiKt4EMTopo", "AntiKt4EMPFlow", "TrigAntiKt4EMT
 # then forwards the configuration to defineJetCalibTool, returning the output.
 # At present the interface allows for the calibseq to be chosen freely, other
 # than checking that the data source is data for the in situ correction.
-# The calibarea could be made configurable as well, but then might need to be
-# added to the tool name to ensure uniqueness.
-# Due to the hackiness of DualUseConfig public tool handling, we need to pass
-# an AlgSequence...
 def getJetCalibTool(jetcollection, context, data_type, calibseq = "", rhoname = "", pvname = "PrimaryVertices", gscdepth = "auto"):
     # In principle we could autoconfigure
     if data_type not in ['data','mc','afii']:
@@ -119,7 +118,11 @@ def getJetCalibTool(jetcollection, context, data_type, calibseq = "", rhoname =
         _pvname = ""
         if "Residual" in _calibseq or "GSC" in _calibseq and gscdepth!="EM3":
             _pvname = pvname
-        return defineJetCalibTool(jetcollection, _configfile, calibarea, _calibseq, _data_type, rhoname, _pvname, gscdepth)
+        # HACK: For testing while we don't have finalised calibrations for trigger PF jets
+        _jetcollection = jetcollection
+        if "PFlow" in jetcollection and context=="TrigSoftDrop":
+            _jetcollection = jetcollection.replace("EMPFlow","UFO")
+        return defineJetCalibTool(_jetcollection, _configfile, calibarea, _calibseq, _data_type, rhoname, _pvname, gscdepth)
     except KeyError as e:
         jetcaliblog.error("Context '{0}' not found for jet collection '{1}'".format(context,jetcollection))
         jetcaliblog.error("Options are '{0}".format(','.join(jetcontexts.keys())))
@@ -151,6 +154,7 @@ def getJetCalibToolPrereqs(modspec,jetdef):
     calibcontext, data_type, calibseq, rhoname, pvname, gscdepth = getCalibSpecsFromString(modspec)
     if calibseq=="":
         cfg, calibarea, calibseq = calibcontexts[jetdef.basename][calibcontext]
+
     # For now, only dependent on calibseq -- can ignore Insitu, which is
     # added when getting the concrete tool
     prereqs = []
diff --git a/Trigger/TrigSteer/DecisionHandling/python/jetMenuHelper.py b/Trigger/TrigSteer/DecisionHandling/python/jetMenuHelper.py
index 3196b89e2a16..818527083c4b 100644
--- a/Trigger/TrigSteer/DecisionHandling/python/jetMenuHelper.py
+++ b/Trigger/TrigSteer/DecisionHandling/python/jetMenuHelper.py
@@ -2,6 +2,7 @@
 #
 
 from TriggerMenuMT.HLTMenuConfig.Jet.JetMenuSequences import jetMenuSequence, jetCFSequence
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
 def jetDictFromString(jet_def_string):
     """ Function to retrieve the jet dictionaory from string"""
@@ -36,10 +37,10 @@ def jetDictFromString(jet_def_string):
 def jetCFSequenceFromString(jet_def_string):
     """ Function to retrieve jet Reco sequence from string"""
     jetRecoDict=jetDictFromString(jet_def_string)
-    return jetCFSequence(None,**jetRecoDict)	
+    return jetCFSequence(ConfigFlags,**jetRecoDict)	
     
  
 def jetMenuSequenceFromString(jet_def_string):
     """ Function to retrieve jet menu sequence from string"""
     jetRecoDict=jetDictFromString(jet_def_string)
-    return jetMenuSequence(None,**jetRecoDict) # First arg dummy flags for RecoFragmentsPool
+    return jetMenuSequence(ConfigFlags,**jetRecoDict) # First arg dummy flags for RecoFragmentsPool
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index f78638aa5577..c653679fa411 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -31,9 +31,18 @@ TrigSignatureMoniMT                                 INFO -- #3965466087 Features
 TrigSignatureMoniMT                                 INFO HLT_2g50_loose_L12EM20VH #3590373854
 TrigSignatureMoniMT                                 INFO -- #3590373854 Events         2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3590373854 Features                             0          0          0          0          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10sd_csskpf_jes_ftf_35smcINF_L1J100 #3495282139
+TrigSignatureMoniMT                                 INFO -- #3495282139 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3495282139 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100 #2680976232
+TrigSignatureMoniMT                                 INFO -- #2680976232 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2680976232 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_2j330_a10t_lcw_jes_35smcINF_L1J100 #1295975955
 TrigSignatureMoniMT                                 INFO -- #1295975955 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1295975955 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10t_lcw_nojcalib_35smcINF_L1J100 #891415013
+TrigSignatureMoniMT                                 INFO -- #891415013 Events          3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #891415013 Features                              0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_2j60_L1J15 #927735533
 TrigSignatureMoniMT                                 INFO -- #927735533 Events          20         20         0          0          0          0          0          0          0          0          0          10         -          -          10
 TrigSignatureMoniMT                                 INFO -- #927735533 Features                              0          0          0          0          0          0          0          0          0          28         -          -
@@ -244,87 +253,87 @@ TrigSignatureMoniMT                                 INFO -- #1341875780 Features
 TrigSignatureMoniMT                                 INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151
 TrigSignatureMoniMT                                 INFO -- #4034799151 Events         19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
 TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             0          0          0          0          0          0          0          0          0          402        -          -
-TrigSignatureMoniMT                                 INFO HLT_j225_ftf_subjesgscIS_bmv2c1040_split_L1J100 #3992507557
-TrigSignatureMoniMT                                 INFO -- #3992507557 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3992507557 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO HLT_j225_subjesgscIS_ftf_bmv2c1040_split_L1J100 #219711753
+TrigSignatureMoniMT                                 INFO -- #219711753 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #219711753 Features                              0          0          0          0          0          0          0          0          0          0          0          -
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J20 #3084792704
 TrigSignatureMoniMT                                 INFO -- #3084792704 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J75_31ETA49 #3769257182
 TrigSignatureMoniMT                                 INFO -- #3769257182 Events         2          2          0          0          0          0          0          0          0          0          0          0          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3769257182 Features                             0          0          0          0          0          0          0          0          0          0          -          -
-TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_bmv2c1060_split_L1J100 #1211559599
-TrigSignatureMoniMT                                 INFO -- #1211559599 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1211559599 Features                             0          0          0          0          0          0          0          0          0          0          0          -
-TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_boffperf_split_L1J100 #588317894
-TrigSignatureMoniMT                                 INFO -- #588317894 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #588317894 Features                              0          0          0          0          0          0          0          0          0          0          0          -
-TrigSignatureMoniMT                                 INFO HLT_j300_ftf_subjesgscIS_bmv2c1070_split_L1J100 #3706723666
-TrigSignatureMoniMT                                 INFO -- #3706723666 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3706723666 Features                             0          0          0          0          0          0          0          0          0          0          0          -
-TrigSignatureMoniMT                                 INFO HLT_j360_ftf_subjesgscIS_bmv2c1077_split_L1J100 #1837565816
-TrigSignatureMoniMT                                 INFO -- #1837565816 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1837565816 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO HLT_j275_subjesgscIS_ftf_bmv2c1060_split_L1J100 #710546402
+TrigSignatureMoniMT                                 INFO -- #710546402 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #710546402 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO HLT_j275_subjesgscIS_ftf_boffperf_split_L1J100 #540369970
+TrigSignatureMoniMT                                 INFO -- #540369970 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #540369970 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO HLT_j300_subjesgscIS_ftf_bmv2c1070_split_L1J100 #2074989613
+TrigSignatureMoniMT                                 INFO -- #2074989613 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #2074989613 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO HLT_j360_subjesgscIS_ftf_bmv2c1077_split_L1J100 #4176355792
+TrigSignatureMoniMT                                 INFO -- #4176355792 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #4176355792 Features                             0          0          0          0          0          0          0          0          0          0          0          -
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J100 #2659902019
 TrigSignatureMoniMT                                 INFO -- #2659902019 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
 TrigSignatureMoniMT                                 INFO -- #2659902019 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J20 #2205518067
 TrigSignatureMoniMT                                 INFO -- #2205518067 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
 TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          0          0          0          0          0          0          0          0          0          -          -
-TrigSignatureMoniMT                                 INFO HLT_j420_ftf_subjesgscIS_L1J20 #4179085188
-TrigSignatureMoniMT                                 INFO -- #4179085188 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
-TrigSignatureMoniMT                                 INFO -- #4179085188 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j420_subjesgscIS_ftf_L1J20 #2116995085
+TrigSignatureMoniMT                                 INFO -- #2116995085 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2116995085 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_L1J15 #1364976160
 TrigSignatureMoniMT                                 INFO -- #1364976160 Events         20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
-TrigSignatureMoniMT                                 INFO -- #1364976160 Features                             0          0          0          0          0          0          0          0          0          50         -          -
+TrigSignatureMoniMT                                 INFO -- #1364976160 Features                             0          0          0          0          0          0          0          0          0          49         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_csskpf_nojcalib_ftf_L1J20 #2528888897
+TrigSignatureMoniMT                                 INFO -- #2528888897 Events         19         19         0          0          0          0          0          0          0          0          0          16         -          -          16
+TrigSignatureMoniMT                                 INFO -- #2528888897 Features                             0          0          0          0          0          0          0          0          0          30         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_cssktc_nojcalib_L1J20 #3295122398
 TrigSignatureMoniMT                                 INFO -- #3295122398 Events         19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
 TrigSignatureMoniMT                                 INFO -- #3295122398 Features                             0          0          0          0          0          0          0          0          0          27         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_L1J15 #868405538
 TrigSignatureMoniMT                                 INFO -- #868405538 Events          20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
-TrigSignatureMoniMT                                 INFO -- #868405538 Features                              0          0          0          0          0          0          0          0          0          50         -          -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_csskpf_nojcalib_L1J20 #3533281867
-TrigSignatureMoniMT                                 INFO -- #3533281867 Events         19         19         0          0          0          0          0          0          0          0          0          16         -          -          16
-TrigSignatureMoniMT                                 INFO -- #3533281867 Features                             0          0          0          0          0          0          0          0          0          30         -          -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_L1J20 #1335156103
-TrigSignatureMoniMT                                 INFO -- #1335156103 Events         19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
-TrigSignatureMoniMT                                 INFO -- #1335156103 Features                             0          0          0          0          0          0          0          0          0          39         -          -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_nojcalib_L1J20 #3658890913
-TrigSignatureMoniMT                                 INFO -- #3658890913 Events         19         19         0          0          0          0          0          0          0          0          0          17         -          -          17
-TrigSignatureMoniMT                                 INFO -- #3658890913 Features                             0          0          0          0          0          0          0          0          0          37         -          -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_011jvt_L1J15 #2857031468
-TrigSignatureMoniMT                                 INFO -- #2857031468 Events         20         20         0          0          0          0          0          0          0          0          0          16         -          -          16
-TrigSignatureMoniMT                                 INFO -- #2857031468 Features                             0          0          0          0          0          0          0          0          0          33         -          -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_015jvt_L1J15 #2938374624
-TrigSignatureMoniMT                                 INFO -- #2938374624 Events         20         20         0          0          0          0          0          0          0          0          0          16         -          -          16
-TrigSignatureMoniMT                                 INFO -- #2938374624 Features                             0          0          0          0          0          0          0          0          0          33         -          -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_059jvt_L1J15 #1593009344
-TrigSignatureMoniMT                                 INFO -- #1593009344 Events         20         20         0          0          0          0          0          0          0          0          0          16         -          -          16
-TrigSignatureMoniMT                                 INFO -- #1593009344 Features                             0          0          0          0          0          0          0          0          0          33         -          -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_L1J15 #3341539267
-TrigSignatureMoniMT                                 INFO -- #3341539267 Events         20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
-TrigSignatureMoniMT                                 INFO -- #3341539267 Features                             0          0          0          0          0          0          0          0          0          50         -          -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339
-TrigSignatureMoniMT                                 INFO -- #991419339 Events          19         19         0          0          0          0          0          0          0          0          0          19         10         -          10
-TrigSignatureMoniMT                                 INFO -- #991419339 Features                              0          0          0          0          0          0          0          0          0          49         21         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049
-TrigSignatureMoniMT                                 INFO -- #1961149049 Events         19         19         0          0          0          0          0          0          0          0          0          19         19         -          19
-TrigSignatureMoniMT                                 INFO -- #1961149049 Features                             0          0          0          0          0          0          0          0          0          49         49         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_pf_L1J20 #761060030
-TrigSignatureMoniMT                                 INFO -- #761060030 Events          19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
-TrigSignatureMoniMT                                 INFO -- #761060030 Features                              0          0          0          0          0          0          0          0          0          39         -          -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_L1J15 #1509925407
-TrigSignatureMoniMT                                 INFO -- #1509925407 Events         20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
-TrigSignatureMoniMT                                 INFO -- #1509925407 Features                             0          0          0          0          0          0          0          0          0          45         -          -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_pf_L1J20 #4012311417
-TrigSignatureMoniMT                                 INFO -- #4012311417 Events         19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
-TrigSignatureMoniMT                                 INFO -- #4012311417 Features                             0          0          0          0          0          0          0          0          0          39         -          -
+TrigSignatureMoniMT                                 INFO -- #868405538 Features                              0          0          0          0          0          0          0          0          0          49         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_nojcalib_L1J20 #2042444294
 TrigSignatureMoniMT                                 INFO -- #2042444294 Events         19         19         0          0          0          0          0          0          0          0          0          17         -          -          17
 TrigSignatureMoniMT                                 INFO -- #2042444294 Features                             0          0          0          0          0          0          0          0          0          39         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_ftf_L1J20 #3679554988
+TrigSignatureMoniMT                                 INFO -- #3679554988 Events         19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
+TrigSignatureMoniMT                                 INFO -- #3679554988 Features                             0          0          0          0          0          0          0          0          0          38         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_nojcalib_ftf_L1J20 #4202219904
+TrigSignatureMoniMT                                 INFO -- #4202219904 Events         19         19         0          0          0          0          0          0          0          0          0          17         -          -          17
+TrigSignatureMoniMT                                 INFO -- #4202219904 Features                             0          0          0          0          0          0          0          0          0          37         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_subjesgscIS_ftf_L1J20 #2187173741
+TrigSignatureMoniMT                                 INFO -- #2187173741 Events         19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
+TrigSignatureMoniMT                                 INFO -- #2187173741 Features                             0          0          0          0          0          0          0          0          0          38         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_subresjesgscIS_ftf_L1J20 #3567642453
+TrigSignatureMoniMT                                 INFO -- #3567642453 Events         19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
+TrigSignatureMoniMT                                 INFO -- #3567642453 Features                             0          0          0          0          0          0          0          0          0          38         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_sktc_nojcalib_L1J20 #1542468090
 TrigSignatureMoniMT                                 INFO -- #1542468090 Events         19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
 TrigSignatureMoniMT                                 INFO -- #1542468090 Features                             0          0          0          0          0          0          0          0          0          26         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_011jvt_L1J15 #266323220
+TrigSignatureMoniMT                                 INFO -- #266323220 Events          20         20         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #266323220 Features                              0          0          0          0          0          0          0          0          0          32         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_015jvt_L1J15 #3102941497
+TrigSignatureMoniMT                                 INFO -- #3102941497 Events         20         20         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #3102941497 Features                             0          0          0          0          0          0          0          0          0          32         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_059jvt_L1J15 #2237035634
+TrigSignatureMoniMT                                 INFO -- #2237035634 Events         20         20         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #2237035634 Features                             0          0          0          0          0          0          0          0          0          32         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_L1J15 #1960278431
+TrigSignatureMoniMT                                 INFO -- #1960278431 Events         20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #1960278431 Features                             0          0          0          0          0          0          0          0          0          50         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_bmv2c1070_split_L1J20 #980453000
+TrigSignatureMoniMT                                 INFO -- #980453000 Events          19         19         0          0          0          0          0          0          0          0          0          19         10         -          10
+TrigSignatureMoniMT                                 INFO -- #980453000 Features                              0          0          0          0          0          0          0          0          0          49         21         -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20 #3374916154
+TrigSignatureMoniMT                                 INFO -- #3374916154 Events         19         19         0          0          0          0          0          0          0          0          0          19         19         -          19
+TrigSignatureMoniMT                                 INFO -- #3374916154 Features                             0          0          0          0          0          0          0          0          0          49         49         -
+TrigSignatureMoniMT                                 INFO HLT_j45_subresjesgscIS_ftf_L1J15 #1213239619
+TrigSignatureMoniMT                                 INFO -- #1213239619 Events         20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #1213239619 Features                             0          0          0          0          0          0          0          0          0          45         -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J100 #3327656707
 TrigSignatureMoniMT                                 INFO -- #3327656707 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3327656707 Features                             0          0          0          0          0          0          0          0          0          0          -          -
@@ -337,15 +346,36 @@ TrigSignatureMoniMT                                 INFO -- #1151767619 Features
 TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J20 #3875082669
 TrigSignatureMoniMT                                 INFO -- #3875082669 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_jes_ftf_35smcINF_L1J100 #3781128663
+TrigSignatureMoniMT                                 INFO -- #3781128663 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3781128663 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_jes_ftf_L1J100 #1509950051
+TrigSignatureMoniMT                                 INFO -- #1509950051 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1509950051 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100 #249842682
+TrigSignatureMoniMT                                 INFO -- #249842682 Events          3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #249842682 Features                              0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_nojcalib_ftf_L1J100 #3452032818
+TrigSignatureMoniMT                                 INFO -- #3452032818 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3452032818 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_lcw_nojcalib_L1J100 #3093997295
 TrigSignatureMoniMT                                 INFO -- #3093997295 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3093997295 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_pf_nojcalib_ftf_L1J100 #2138269254
+TrigSignatureMoniMT                                 INFO -- #2138269254 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2138269254 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_30smcINF_L1J100 #2296827117
 TrigSignatureMoniMT                                 INFO -- #2296827117 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
 TrigSignatureMoniMT                                 INFO -- #2296827117 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_L1J100 #436385969
 TrigSignatureMoniMT                                 INFO -- #436385969 Events          3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
 TrigSignatureMoniMT                                 INFO -- #436385969 Features                              0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_nojcalib_35smcINF_L1J100 #3224465417
+TrigSignatureMoniMT                                 INFO -- #3224465417 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3224465417 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_nojcalib_L1J100 #1966129844
+TrigSignatureMoniMT                                 INFO -- #1966129844 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1966129844 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j80_0eta240_2j60_320eta490_j0_dijetSEP80j1etSEP0j1eta240SEP80j2etSEP0j2eta240SEP700djmass_L1J20 #3634067472
 TrigSignatureMoniMT                                 INFO -- #3634067472 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3634067472 Features                             0          0          0          0          0          0          0          0          0          0          -          -
@@ -361,9 +391,9 @@ TrigSignatureMoniMT                                 INFO -- #510475538 Features
 TrigSignatureMoniMT                                 INFO HLT_j85_ftf_L1J20 #877042532
 TrigSignatureMoniMT                                 INFO -- #877042532 Events          19         19         0          0          0          0          0          0          0          0          0          13         -          -          13
 TrigSignatureMoniMT                                 INFO -- #877042532 Features                              0          0          0          0          0          0          0          0          0          21         -          -
-TrigSignatureMoniMT                                 INFO HLT_j85_ftf_pf_L1J20 #1538535401
-TrigSignatureMoniMT                                 INFO -- #1538535401 Events         19         19         0          0          0          0          0          0          0          0          0          11         -          -          11
-TrigSignatureMoniMT                                 INFO -- #1538535401 Features                             0          0          0          0          0          0          0          0          0          16         -          -
+TrigSignatureMoniMT                                 INFO HLT_j85_pf_ftf_L1J20 #789444389
+TrigSignatureMoniMT                                 INFO -- #789444389 Events          19         19         0          0          0          0          0          0          0          0          0          10         -          -          10
+TrigSignatureMoniMT                                 INFO -- #789444389 Features                              0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_mb_sptrk_L1RD0_FILLED #4097312640
 TrigSignatureMoniMT                                 INFO -- #4097312640 Events         20         0          0          0          -          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #4097312640 Features                             0          0          -          -          -          -          -          -          -          -          -          -
@@ -833,11 +863,11 @@ TrigSignatureMoniMT                                 INFO HLT_xe30_mht_L1XE10 #36
 TrigSignatureMoniMT                                 INFO -- #3626903018 Events         19         19         0          0          0          0          0          0          0          0          0          19         -          -          19
 TrigSignatureMoniMT                                 INFO -- #3626903018 Features                             0          0          0          0          0          0          0          0          0          19         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_mhtpufit_em_subjesgscIS_L1XE10 #689201557
-TrigSignatureMoniMT                                 INFO -- #689201557 Events          19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
-TrigSignatureMoniMT                                 INFO -- #689201557 Features                              0          0          0          0          0          0          0          0          0          15         -          -
+TrigSignatureMoniMT                                 INFO -- #689201557 Events          19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
+TrigSignatureMoniMT                                 INFO -- #689201557 Features                              0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_mhtpufit_pf_subjesgscIS_L1XE10 #1886909707
-TrigSignatureMoniMT                                 INFO -- #1886909707 Events         19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
-TrigSignatureMoniMT                                 INFO -- #1886909707 Features                             0          0          0          0          0          0          0          0          0          14         -          -
+TrigSignatureMoniMT                                 INFO -- #1886909707 Events         19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #1886909707 Features                             0          0          0          0          0          0          0          0          0          15         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_pfopufit_L1XE10 #2252641537
 TrigSignatureMoniMT                                 INFO -- #2252641537 Events         19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
 TrigSignatureMoniMT                                 INFO -- #2252641537 Features                             0          0          0          0          0          0          0          0          0          14         -          -
diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
index 82dc48d1fc4e..3875cbdeadc5 100644
--- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
@@ -31,9 +31,18 @@ TrigSignatureMoniMT                                 INFO -- #3965466087 Features
 TrigSignatureMoniMT                                 INFO HLT_2g50_loose_L12EM20VH #3590373854
 TrigSignatureMoniMT                                 INFO -- #3590373854 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3590373854 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10sd_csskpf_jes_ftf_35smcINF_L1J100 #3495282139
+TrigSignatureMoniMT                                 INFO -- #3495282139 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3495282139 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100 #2680976232
+TrigSignatureMoniMT                                 INFO -- #2680976232 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2680976232 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2j330_a10t_lcw_jes_35smcINF_L1J100 #1295975955
 TrigSignatureMoniMT                                 INFO -- #1295975955 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1295975955 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10t_lcw_nojcalib_35smcINF_L1J100 #891415013
+TrigSignatureMoniMT                                 INFO -- #891415013 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #891415013 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2j60_L1J15 #927735533
 TrigSignatureMoniMT                                 INFO -- #927735533 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #927735533 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
@@ -244,87 +253,87 @@ TrigSignatureMoniMT                                 INFO -- #1341875780 Features
 TrigSignatureMoniMT                                 INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151
 TrigSignatureMoniMT                                 INFO -- #4034799151 Events         20         20         0          0          0          0          0          0          0          0          0          2          -          -          2          
 TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             0          0          0          0          0          0          0          0          0          24         -          -          
-TrigSignatureMoniMT                                 INFO HLT_j225_ftf_subjesgscIS_bmv2c1040_split_L1J100 #3992507557
-TrigSignatureMoniMT                                 INFO -- #3992507557 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3992507557 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO HLT_j225_subjesgscIS_ftf_bmv2c1040_split_L1J100 #219711753
+TrigSignatureMoniMT                                 INFO -- #219711753 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #219711753 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J20 #3084792704
 TrigSignatureMoniMT                                 INFO -- #3084792704 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J75_31ETA49 #3769257182
 TrigSignatureMoniMT                                 INFO -- #3769257182 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3769257182 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_bmv2c1060_split_L1J100 #1211559599
-TrigSignatureMoniMT                                 INFO -- #1211559599 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1211559599 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
-TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_boffperf_split_L1J100 #588317894
-TrigSignatureMoniMT                                 INFO -- #588317894 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #588317894 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
-TrigSignatureMoniMT                                 INFO HLT_j300_ftf_subjesgscIS_bmv2c1070_split_L1J100 #3706723666
-TrigSignatureMoniMT                                 INFO -- #3706723666 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3706723666 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
-TrigSignatureMoniMT                                 INFO HLT_j360_ftf_subjesgscIS_bmv2c1077_split_L1J100 #1837565816
-TrigSignatureMoniMT                                 INFO -- #1837565816 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1837565816 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO HLT_j275_subjesgscIS_ftf_bmv2c1060_split_L1J100 #710546402
+TrigSignatureMoniMT                                 INFO -- #710546402 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #710546402 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO HLT_j275_subjesgscIS_ftf_boffperf_split_L1J100 #540369970
+TrigSignatureMoniMT                                 INFO -- #540369970 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #540369970 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO HLT_j300_subjesgscIS_ftf_bmv2c1070_split_L1J100 #2074989613
+TrigSignatureMoniMT                                 INFO -- #2074989613 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #2074989613 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO HLT_j360_subjesgscIS_ftf_bmv2c1077_split_L1J100 #4176355792
+TrigSignatureMoniMT                                 INFO -- #4176355792 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #4176355792 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J100 #2659902019
 TrigSignatureMoniMT                                 INFO -- #2659902019 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #2659902019 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J20 #2205518067
 TrigSignatureMoniMT                                 INFO -- #2205518067 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j420_ftf_subjesgscIS_L1J20 #4179085188
-TrigSignatureMoniMT                                 INFO -- #4179085188 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #4179085188 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j420_subjesgscIS_ftf_L1J20 #2116995085
+TrigSignatureMoniMT                                 INFO -- #2116995085 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2116995085 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_L1J15 #1364976160
 TrigSignatureMoniMT                                 INFO -- #1364976160 Events         20         20         0          0          0          0          0          0          0          0          0          6          -          -          6          
 TrigSignatureMoniMT                                 INFO -- #1364976160 Features                             0          0          0          0          0          0          0          0          0          6          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_csskpf_nojcalib_ftf_L1J20 #2528888897
+TrigSignatureMoniMT                                 INFO -- #2528888897 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2528888897 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_cssktc_nojcalib_L1J20 #3295122398
 TrigSignatureMoniMT                                 INFO -- #3295122398 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
 TrigSignatureMoniMT                                 INFO -- #3295122398 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_L1J15 #868405538
 TrigSignatureMoniMT                                 INFO -- #868405538 Events          20         20         0          0          0          0          0          0          0          0          0          6          -          -          6          
 TrigSignatureMoniMT                                 INFO -- #868405538 Features                              0          0          0          0          0          0          0          0          0          6          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_csskpf_nojcalib_L1J20 #3533281867
-TrigSignatureMoniMT                                 INFO -- #3533281867 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
-TrigSignatureMoniMT                                 INFO -- #3533281867 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_L1J20 #1335156103
-TrigSignatureMoniMT                                 INFO -- #1335156103 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
-TrigSignatureMoniMT                                 INFO -- #1335156103 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_nojcalib_L1J20 #3658890913
-TrigSignatureMoniMT                                 INFO -- #3658890913 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
-TrigSignatureMoniMT                                 INFO -- #3658890913 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_011jvt_L1J15 #2857031468
-TrigSignatureMoniMT                                 INFO -- #2857031468 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
-TrigSignatureMoniMT                                 INFO -- #2857031468 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_015jvt_L1J15 #2938374624
-TrigSignatureMoniMT                                 INFO -- #2938374624 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
-TrigSignatureMoniMT                                 INFO -- #2938374624 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_059jvt_L1J15 #1593009344
-TrigSignatureMoniMT                                 INFO -- #1593009344 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
-TrigSignatureMoniMT                                 INFO -- #1593009344 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_L1J15 #3341539267
-TrigSignatureMoniMT                                 INFO -- #3341539267 Events         20         20         0          0          0          0          0          0          0          0          0          7          -          -          7          
-TrigSignatureMoniMT                                 INFO -- #3341539267 Features                             0          0          0          0          0          0          0          0          0          7          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339
-TrigSignatureMoniMT                                 INFO -- #991419339 Events          20         20         0          0          0          0          0          0          0          0          0          5          1          -          1          
-TrigSignatureMoniMT                                 INFO -- #991419339 Features                              0          0          0          0          0          0          0          0          0          5          1          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049
-TrigSignatureMoniMT                                 INFO -- #1961149049 Events         20         20         0          0          0          0          0          0          0          0          0          5          5          -          5          
-TrigSignatureMoniMT                                 INFO -- #1961149049 Features                             0          0          0          0          0          0          0          0          0          5          5          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_pf_L1J20 #761060030
-TrigSignatureMoniMT                                 INFO -- #761060030 Events          20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
-TrigSignatureMoniMT                                 INFO -- #761060030 Features                              0          0          0          0          0          0          0          0          0          3          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_L1J15 #1509925407
-TrigSignatureMoniMT                                 INFO -- #1509925407 Events         20         20         0          0          0          0          0          0          0          0          0          7          -          -          7          
-TrigSignatureMoniMT                                 INFO -- #1509925407 Features                             0          0          0          0          0          0          0          0          0          7          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_pf_L1J20 #4012311417
-TrigSignatureMoniMT                                 INFO -- #4012311417 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
-TrigSignatureMoniMT                                 INFO -- #4012311417 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_nojcalib_L1J20 #2042444294
 TrigSignatureMoniMT                                 INFO -- #2042444294 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
 TrigSignatureMoniMT                                 INFO -- #2042444294 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_ftf_L1J20 #3679554988
+TrigSignatureMoniMT                                 INFO -- #3679554988 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3679554988 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_nojcalib_ftf_L1J20 #4202219904
+TrigSignatureMoniMT                                 INFO -- #4202219904 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #4202219904 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_subjesgscIS_ftf_L1J20 #2187173741
+TrigSignatureMoniMT                                 INFO -- #2187173741 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2187173741 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_subresjesgscIS_ftf_L1J20 #3567642453
+TrigSignatureMoniMT                                 INFO -- #3567642453 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3567642453 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_sktc_nojcalib_L1J20 #1542468090
 TrigSignatureMoniMT                                 INFO -- #1542468090 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
 TrigSignatureMoniMT                                 INFO -- #1542468090 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_011jvt_L1J15 #266323220
+TrigSignatureMoniMT                                 INFO -- #266323220 Events          20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #266323220 Features                              0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_015jvt_L1J15 #3102941497
+TrigSignatureMoniMT                                 INFO -- #3102941497 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3102941497 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_059jvt_L1J15 #2237035634
+TrigSignatureMoniMT                                 INFO -- #2237035634 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2237035634 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_L1J15 #1960278431
+TrigSignatureMoniMT                                 INFO -- #1960278431 Events         20         20         0          0          0          0          0          0          0          0          0          7          -          -          7          
+TrigSignatureMoniMT                                 INFO -- #1960278431 Features                             0          0          0          0          0          0          0          0          0          7          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_bmv2c1070_split_L1J20 #980453000
+TrigSignatureMoniMT                                 INFO -- #980453000 Events          20         20         0          0          0          0          0          0          0          0          0          5          1          -          1          
+TrigSignatureMoniMT                                 INFO -- #980453000 Features                              0          0          0          0          0          0          0          0          0          5          1          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20 #3374916154
+TrigSignatureMoniMT                                 INFO -- #3374916154 Events         20         20         0          0          0          0          0          0          0          0          0          5          5          -          5          
+TrigSignatureMoniMT                                 INFO -- #3374916154 Features                             0          0          0          0          0          0          0          0          0          5          5          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subresjesgscIS_ftf_L1J15 #1213239619
+TrigSignatureMoniMT                                 INFO -- #1213239619 Events         20         20         0          0          0          0          0          0          0          0          0          7          -          -          7          
+TrigSignatureMoniMT                                 INFO -- #1213239619 Features                             0          0          0          0          0          0          0          0          0          7          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J100 #3327656707
 TrigSignatureMoniMT                                 INFO -- #3327656707 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3327656707 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
@@ -337,15 +346,36 @@ TrigSignatureMoniMT                                 INFO -- #1151767619 Features
 TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J20 #3875082669
 TrigSignatureMoniMT                                 INFO -- #3875082669 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_jes_ftf_35smcINF_L1J100 #3781128663
+TrigSignatureMoniMT                                 INFO -- #3781128663 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3781128663 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_jes_ftf_L1J100 #1509950051
+TrigSignatureMoniMT                                 INFO -- #1509950051 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1509950051 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100 #249842682
+TrigSignatureMoniMT                                 INFO -- #249842682 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #249842682 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_nojcalib_ftf_L1J100 #3452032818
+TrigSignatureMoniMT                                 INFO -- #3452032818 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3452032818 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_lcw_nojcalib_L1J100 #3093997295
 TrigSignatureMoniMT                                 INFO -- #3093997295 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3093997295 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_pf_nojcalib_ftf_L1J100 #2138269254
+TrigSignatureMoniMT                                 INFO -- #2138269254 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2138269254 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_30smcINF_L1J100 #2296827117
 TrigSignatureMoniMT                                 INFO -- #2296827117 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #2296827117 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_L1J100 #436385969
 TrigSignatureMoniMT                                 INFO -- #436385969 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #436385969 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_nojcalib_35smcINF_L1J100 #3224465417
+TrigSignatureMoniMT                                 INFO -- #3224465417 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3224465417 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_nojcalib_L1J100 #1966129844
+TrigSignatureMoniMT                                 INFO -- #1966129844 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1966129844 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j80_0eta240_2j60_320eta490_j0_dijetSEP80j1etSEP0j1eta240SEP80j2etSEP0j2eta240SEP700djmass_L1J20 #3634067472
 TrigSignatureMoniMT                                 INFO -- #3634067472 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3634067472 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
@@ -361,9 +391,9 @@ TrigSignatureMoniMT                                 INFO -- #510475538 Features
 TrigSignatureMoniMT                                 INFO HLT_j85_ftf_L1J20 #877042532
 TrigSignatureMoniMT                                 INFO -- #877042532 Events          20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
 TrigSignatureMoniMT                                 INFO -- #877042532 Features                              0          0          0          0          0          0          0          0          0          3          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j85_ftf_pf_L1J20 #1538535401
-TrigSignatureMoniMT                                 INFO -- #1538535401 Events         20         20         0          0          0          0          0          0          0          0          0          2          -          -          2          
-TrigSignatureMoniMT                                 INFO -- #1538535401 Features                             0          0          0          0          0          0          0          0          0          2          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j85_pf_ftf_L1J20 #789444389
+TrigSignatureMoniMT                                 INFO -- #789444389 Events          20         20         0          0          0          0          0          0          0          0          0          2          -          -          2          
+TrigSignatureMoniMT                                 INFO -- #789444389 Features                              0          0          0          0          0          0          0          0          0          2          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mb_sptrk_L1RD0_FILLED #4097312640
 TrigSignatureMoniMT                                 INFO -- #4097312640 Events         20         20         20         19         -          -          -          -          -          -          -          -          -          -          19         
 TrigSignatureMoniMT                                 INFO -- #4097312640 Features                             20         19         -          -          -          -          -          -          -          -          -          -          
diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index fdfd2365cb52..a9a8edccd4ea 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -302,9 +302,27 @@ TriggerHLTListRun3 = [
     ('xAOD::JetContainer#HLT_AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets_jes',                'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet'),
     ('xAOD::JetAuxContainer#HLT_AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets_jesAux.'+JetVars, 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet'),
 
+    ('xAOD::JetContainer#HLT_AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets_nojcalib',                'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets_nojcalibAux.'+JetVars, 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet'),
+
     ('xAOD::JetContainer#HLT_AntiKt10LCTopoSoftDropBeta100Zcut10Jets_nojcalib',                'BS ESD AODFULL', 'Jet'),
     ('xAOD::JetAuxContainer#HLT_AntiKt10LCTopoSoftDropBeta100Zcut10Jets_nojcalibAux.'+JetVars, 'BS ESD AODFULL', 'Jet'),
 
+    ('xAOD::JetContainer#HLT_AntiKt10EMPFlowJets_nojcalib_ftf',                       'BS ESD AODFULL', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10EMPFlowJets_nojcalib_ftfAux.'+JetVars,        'BS ESD AODFULL', 'Jet'),
+
+    ('xAOD::JetContainer#HLT_AntiKt10EMPFlowSoftDropBeta100Zcut10Jets_nojcalib_ftf',                'BS ESD AODFULL', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10EMPFlowSoftDropBeta100Zcut10Jets_nojcalib_ftfAux.'+JetVars, 'BS ESD AODFULL', 'Jet'),
+
+    ('xAOD::JetContainer#HLT_AntiKt10EMPFlowCSSKJets_nojcalib_ftf',                       'BS ESD AODFULL', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10EMPFlowCSSKJets_nojcalib_ftfAux.'+JetVars,        'BS ESD AODFULL', 'Jet'),
+
+    ('xAOD::JetContainer#HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_nojcalib_ftf',                'BS ESD AODFULL', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_nojcalib_ftfAux.'+JetVars, 'BS ESD AODFULL', 'Jet'),
+
+    ('xAOD::JetContainer#HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftf',                'BS ESD AODFULL', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftfAux.'+JetVars, 'BS ESD AODFULL', 'Jet'),
+
     ('xAOD::JetContainer#HLT_AntiKt4EMPFlowJets_subjesIS_ftf',                'BS ESD AODFULL', 'Jet'),
     ('xAOD::JetAuxContainer#HLT_AntiKt4EMPFlowJets_subjesIS_ftfAux.'+JetVars, 'BS ESD AODFULL', 'Jet'),
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
index 6808b79af94d..3ffa4b5744a5 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
@@ -82,7 +82,8 @@ class JetChainConfiguration(ChainConfigurationBase):
         jetDefStr = jetRecoDictToString(self.recoDict)
 
         stepName = "Step1_jet_"+jetDefStr
-        jetSeq1 = RecoFragmentsPool.retrieve( jetMenuSequence, None, **self.recoDict ) # the None will be used for flags in future
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags
+        jetSeq1 = RecoFragmentsPool.retrieve( jetMenuSequence, ConfigFlags, **self.recoDict ) # the None will be used for flags in future
 
         return ChainStep(stepName, [jetSeq1], multiplicity=[1], chainDicts=[self.dict])
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetMenuSequences.py
index f33061578354..b32595769aa9 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetMenuSequences.py
@@ -4,15 +4,15 @@
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import RecoFragmentsPool, MenuSequence
 from TriggerMenuMT.HLTMenuConfig.Jet.JetRecoSequences import jetAthSequence, jetRecoDictToString
     
-def jetCFSequence(dummyFlags,**recoDict):
+def jetCFSequence(configFlags,**recoDict):
     """ Function to create the jet Menu Sequence"""
     
     #reco sequence
-    (JetAthSequence, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(jetAthSequence,None,**recoDict)
+    (JetAthSequence, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(jetAthSequence,configFlags,**recoDict)
     return (JetAthSequence, InputMakerAlg, sequenceOut) 
 
-def jetMenuSequence(dummyFlags,**recoDict):
-    (JetAthSequence, InputMakerAlg, sequenceOut)= jetCFSequence(dummyFlags,**recoDict)    
+def jetMenuSequence(configFlags,**recoDict):
+    (JetAthSequence, InputMakerAlg, sequenceOut)= jetCFSequence(configFlags,**recoDict)    
     #hypo
     from TrigHLTJetHypo.TrigHLTJetHypoConf import TrigJetHypoAlgMT
     from TrigHLTJetHypo.TrigJetHypoToolConfig import trigJetHypoToolFromDict
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py
index 6c2472e4a42d..7e871e53d952 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py
@@ -71,19 +71,23 @@ def defineJetConstit(jetRecoDict,clustersKey=None,pfoPrefix=None):
             jetConstit.inputname = clustersKey
     return jetConstit
 
+    
+def interpretRecoAlg(recoAlg):
+    import re
+    jetalg, jetradius, jetextra = re.split(r'(\d+)',recoAlg)    
+    return jetalg, int(jetradius), jetextra
+
 # Arbitrary min pt for fastjet, set to be low enough for MHT(?)
 # Could/should adjust higher for large-R
 def defineJets(jetRecoDict,clustersKey=None,pfoPrefix=None):
     minpt = {
-        "a4":  7000,
-        "a10": 50000,
-        "a10r": 50000,
-        "a10t": 50000,
-        "a10sd": 50000,
+        4:  7000,
+        10: 50000,
     }
-    radius = float(jetRecoDict["recoAlg"].lstrip("a").rstrip("trsd"))/10
+    jetalg, jetradius, jetextra = interpretRecoAlg(jetRecoDict["recoAlg"])
+    actualradius = float(jetradius)/10
     jetConstit = defineJetConstit(jetRecoDict,clustersKey,pfoPrefix)
-    jetDef = JetDefinition( "AntiKt", radius, jetConstit, ptmin=minpt[jetRecoDict["recoAlg"]])
+    jetDef = JetDefinition( "AntiKt", actualradius, jetConstit, ptmin=minpt[jetradius])
     return jetDef
 
 def defineReclusteredJets(jetRecoDict):
@@ -120,6 +124,7 @@ def defineTrackMods(trkopt):
 # Translate calib specification into something understood by
 # the calibration config helper
 def defineCalibFilterMods(jetRecoDict,dataSource,rhoKey="auto"):
+
     # Minimum modifier set for calibration w/o track GSC
     # Should eventually build in more mods, depend on track info etc
     jetalg = jetRecoDict["recoAlg"]
@@ -132,12 +137,12 @@ def defineCalibFilterMods(jetRecoDict,dataSource,rhoKey="auto"):
         if jetRecoDict["trkopt"]=="notrk" and "subres" in jetRecoDict["jetCalib"]:
             raise ValueError("Pileup residual calibration requested but no track source provided!")
 
-        if jetRecoDict["dataType"]=="tc":
+        if jetRecoDict["dataType"].endswith("tc"):
             calibContext,calibSeq = {
                 ("a4","subjes"):   ("TrigRun2","JetArea_EtaJES_GSC"),        # Calo GSC only
-                ("a4","subjesIS"): ("TrigRun2","JetArea_EtaJES_GSC_Insitu"), # Calo GSC only
-                ("a4","subjesgscIS"): ("TrigRun2GSC","JetArea_EtaJES_GSC_Insitu"), # Calo+Trk GSC
-                ("a4","subresjesgscIS"): ("TrigRun2GSC","JetArea_Residual_EtaJES_GSC_Insitu"), # pu residual + calo+trk GSC
+                ("a4","subjesIS"): ("TrigRun2","JetArea_EtaJES_GSC"), # Calo GSC only
+                ("a4","subjesgscIS"): ("TrigRun2GSC","JetArea_EtaJES_GSC"), # Calo+Trk GSC
+                ("a4","subresjesgscIS"): ("TrigRun2GSC","JetArea_Residual_EtaJES_GSC"), # pu residual + calo+trk GSC
                 ("a10","subjes"):  ("TrigUngroomed","JetArea_EtaJES"),
                 ("a10t","jes"):    ("TrigTrimmed","EtaJES_JMS"),
                 }[(jetRecoDict["recoAlg"],jetRecoDict["jetCalib"])]
@@ -148,14 +153,19 @@ def defineCalibFilterMods(jetRecoDict,dataSource,rhoKey="auto"):
                 gscDepth = "trackWIDTH"
                 pvname = "HLT_IDVertex_FS"
 
-        elif jetRecoDict["dataType"]=="pf":
+        elif jetRecoDict["dataType"].endswith("pf"):
             gscDepth = "auto"
-            calibContext = "TrigLS2"
-            calibSeq = "JetArea_Residual_EtaJES_GSC"
-            if jetRecoDict["jetCalib"].endswith("IS"):
-                calibSeq += "_Insitu"
+            if 'sd' in jetRecoDict["recoAlg"]:
+                calibContext = "TrigSoftDrop"
+                calibSeq = "EtaJES_JMS"
+            else:
+                calibContext = "TrigLS2"
+                calibSeq = "JetArea_Residual_EtaJES_GSC"
             pvname = "HLT_IDVertex_FS"
 
+        if jetRecoDict["jetCalib"].endswith("IS") and (dataSource=="data"):
+            calibSeq += "_Insitu"
+
         calibSpec = ":".join( [calibContext, dataSource, calibSeq, rhoKey, pvname, gscDepth] )
         from .TriggerJetMods import ConstitFourMom_copy
         if jetalg=="a4":
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py
index 915086c5693d..54d1b7d8202a 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py
@@ -6,7 +6,8 @@ from AthenaCommon.CFElements import parOR, seqAND
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import RecoFragmentsPool
 from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable
 from TriggerMenuMT.HLTMenuConfig.Jet import JetRecoConfiguration
-
+from JetRecConfig.JetRecConfig import getConstitPJGAlg, getJetAlgorithm
+from TrigEDMConfig.TriggerEDMRun3 import recordable
 
 # Translate the reco dict to a string for suffixing etc
 def jetRecoDictToString(jetRecoDict):
@@ -17,200 +18,209 @@ def jetRecoDictToString(jetRecoDict):
 
 # Configure reco from a dict of options
 # Start from a FullScan inputs maker
-def jetAthSequence(dummyFlags, **jetRecoDict):
+def jetAthSequence(configFlags, **jetRecoDict):
     from TrigT2CaloCommon.CaloDef import clusterFSInputMaker
     InputMakerAlg= conf2toConfigurable(clusterFSInputMaker())
 
-    # Does nothing now, but may need to use this to toggle Insitu calib step
-    # in which case it should be deduced from input flags
-    dataSource = "data" # or mc
-
-    (recoSequence, sequenceOut) = RecoFragmentsPool.retrieve( jetRecoSequence, None, dataSource=dataSource, **jetRecoDict )
+    (recoSequence, sequenceOut, jetDef) = RecoFragmentsPool.retrieve( jetRecoSequence, configFlags, **jetRecoDict )
 
     jetDefString = jetRecoDictToString(jetRecoDict)
     JetAthSequence =  seqAND("jetAthSequence_"+jetDefString,[InputMakerAlg, recoSequence ])
     return (JetAthSequence, InputMakerAlg, sequenceOut)
 
+jetNamePrefix = "HLT_"
+
 # Dummy flag arg needed so that each reco sequence is held separately
 # in the RecoFragmentsPool -- only the kwargs are used to distinguish
 # different sequences. New convention is just to pass "None" for flags
-def jetRecoSequence( dummyFlags, dataSource, RoIs = 'HLT_FSJETRoI', **jetRecoDict):
+def jetRecoSequence( configFlags, RoIs = 'HLT_FSJETRoI', **jetRecoDict ):
+
+    jetalg, jetradius, extra = JetRecoConfiguration.interpretRecoAlg(jetRecoDict["recoAlg"])
+    doGrooming = extra in ["t","sd"]
+    doRecluster = extra == "r"
+    dataSource = "mc" if configFlags.Input.isMC else "data"
 
+    if doRecluster:
+        return RecoFragmentsPool.retrieve( reclusteredJetRecoSequence, configFlags, dataSource=dataSource, RoIs=RoIs, **jetRecoDict)
+    elif doGrooming:
+        return RecoFragmentsPool.retrieve( groomedJetRecoSequence, configFlags, dataSource=dataSource, RoIs=RoIs, **jetRecoDict)
+    else:
+        return RecoFragmentsPool.retrieve( standardJetRecoSequence, configFlags, dataSource=dataSource, RoIs=RoIs, **jetRecoDict)
+
+# Normal jet reconstruction, no reclustering or grooming
+def standardJetRecoSequence( configFlags, dataSource, RoIs, **jetRecoDict ):
     jetDefString = jetRecoDictToString(jetRecoDict)
     recoSeq = parOR( "JetRecSeq_"+jetDefString, [])
 
-    recoAlg = jetRecoDict["recoAlg"]
-    doGrooming = recoAlg.endswith("t") or recoAlg.endswith("sd") # trimming or soft drop
-    doRecluster = recoAlg.endswith("r")
-    jetNamePrefix = "HLT_"
+    # Start by adding the topocluster reco sequence
+    from TriggerMenuMT.HLTMenuConfig.CommonSequences.CaloSequenceSetup import (
+            caloClusterRecoSequence, LCCaloClusterRecoSequence)
+    if jetRecoDict["calib"] == "em":
+        topoClusterSequence, clustersKey = RecoFragmentsPool.retrieve(
+                caloClusterRecoSequence, flags=None, RoIs=RoIs)
+    elif jetRecoDict["calib"] == "lcw":
+        topoClusterSequence, clustersKey = RecoFragmentsPool.retrieve(
+                LCCaloClusterRecoSequence, flags=None, RoIs=RoIs)
+    else:
+        raise ValueError("Invalid value for calib: '{}'".format(jetRecoDict["calib"]))
+    recoSeq += topoClusterSequence
 
-    from TrigEDMConfig.TriggerEDMRun3 import recordable
-    from JetRecConfig import ConfigurableCompatibility
-    ConfigurableCompatibility.Convert2Configurable = True
-    from JetRecConfig.JetRecConfig import getConstitPJGAlg, getJetAlgorithm
-    if doRecluster:
-        # Reclustering -- recursively call the basic jet reco and add this to the sequence,
-        # then add another jet algorithm to run the reclustering step
-        basicJetRecoDict = dict(jetRecoDict)
-        basicJetRecoDict["recoAlg"] = "a4" # Standard size for reclustered
-        (basicJetRecoSequence,basicJetsName) = RecoFragmentsPool.retrieve(jetRecoSequence,None,dataSource=dataSource, **basicJetRecoDict)
-        recoSeq += basicJetRecoSequence
-
-        rcJetPtMin = 15e3 # 15 GeV minimum pt for jets to be reclustered
-        from JetRec.JetRecConf import JetViewAlg
-        filteredJetsName = basicJetsName+"_pt15"
-        recoSeq += JetViewAlg("jetview_"+filteredJetsName,
-                              InputContainer=basicJetsName,
-                              OutputContainer=filteredJetsName,
-                              PtMin=rcJetPtMin)
-    
-        rcJetDef = JetRecoConfiguration.defineReclusteredJets(jetRecoDict)
-        rcJetDef.inputdef.inputname = filteredJetsName
-        rcJetsFullName = jetNamePrefix+rcJetDef.basename+"RCJets_"+jetRecoDict["jetCalib"]
-        rcModList = [] # Could set substructure mods
-        rcJetDef.modifiers = rcModList
-
-        rcConstitPJAlg = getConstitPJGAlg( rcJetDef.inputdef )
-        rcConstitPJKey = rcConstitPJAlg.OutputContainer
-        recoSeq += conf2toConfigurable( rcConstitPJAlg )
-
-        # Get online monitoring tool
-        from JetRec import JetOnlineMon
-        monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+rcJetsFullName+"/")
-
-        rcPJs = [rcConstitPJKey]
-        rcJetRecAlg = getJetAlgorithm(rcJetsFullName, rcJetDef, rcPJs, rcModList, monTool)
-
-        recoSeq += conf2toConfigurable( rcJetRecAlg )
-
-        sequenceOut = recordable(rcJetsFullName)
+    # Set up tracking sequence -- may need to reorganise or relocate
+    # depending on how we want to handle HLT preselection
+    trkcolls = None
+    if jetRecoDict["trkopt"] != "notrk":
+        from .JetTrackingConfig import JetTrackingSequence
+        (jettrkseq, trkcolls) = RecoFragmentsPool.retrieve( JetTrackingSequence, configFlags, trkopt=jetRecoDict["trkopt"], RoIs=RoIs)
+        recoSeq += jettrkseq
+
+    # Potentially add particle flow reconstruction
+    # Work in progress
+    if "pf" in jetRecoDict["dataType"]:
+        if jetRecoDict["trkopt"] == "notrk":
+            raise RuntimeError("PFlow jet chain requested with no tracking option!")
+        from eflowRec.PFHLTSequence import PFHLTSequence
+        (pfseq, pfoPrefix) = RecoFragmentsPool.retrieve(PFHLTSequence, configFlags, clustersin=clustersKey, tracktype=jetRecoDict["trkopt"])
+        recoSeq += pfseq
+        jetDef = JetRecoConfiguration.defineJets(jetRecoDict,pfoPrefix=pfoPrefix)
+    else:
+        jetDef = JetRecoConfiguration.defineJets(jetRecoDict,clustersKey=clustersKey)
+    useConstitMods = ["sktc","cssktc", "pf", "csskpf"]
+    doConstitMods = jetRecoDict["dataType"] in useConstitMods
 
-    elif doGrooming:
-        # Grooming needs to be set up similarly to reclustering
-        # --> build ungroomed jets, then add a grooming alg
-        ungroomedJetRecoDict = dict(jetRecoDict)
-        ungroomedJetRecoDict["recoAlg"] = ungroomedJetRecoDict["recoAlg"].rstrip("tsd") # Drop grooming spec
-        ungroomedJetRecoDict["jetCalib"] = "nojcalib" # No need to calibrate
-        ungroomedDef = JetRecoConfiguration.defineJets(ungroomedJetRecoDict)
+    # chosen jet collection
+    jetsFullName = jetNamePrefix+jetDef.basename+"Jets_"+jetRecoDict["jetCalib"]
+    if jetRecoDict["trkopt"] != "notrk":
+        jetsFullName += "_{}".format(jetRecoDict["trkopt"])
+    sequenceOut = recordable(jetsFullName)
 
-        (ungroomedJetRecoSequence,ungroomedJetsName) = RecoFragmentsPool.retrieve(jetRecoSequence,None,dataSource=dataSource, **ungroomedJetRecoDict)
-        recoSeq += conf2toConfigurable( ungroomedJetRecoSequence )
-        # Need to forward the pseudojets of the parents to the groomer
-        parentpjs = getattr(ungroomedJetRecoSequence,"jetalg_{}".format(ungroomedJetsName)).Tools[0].InputPseudoJets
+    if doConstitMods:
+        # Get online monitoring jet rec tool
+        from JetRecTools import OnlineMon                                                  
+        monJetRecTool = OnlineMon.getMonTool_Algorithm("HLTJets/"+jetsFullName+"/")
 
-        groomDef = JetRecoConfiguration.defineGroomedJets(jetRecoDict,ungroomedDef,ungroomedJetsName)
-        groomedJetsFullName = jetNamePrefix+groomDef.basename+"Jets_"+jetRecoDict["jetCalib"]
+        from JetRecConfig.ConstModHelpers import getConstitModAlg
+        if jetRecoDict["trkopt"] == "notrk":
+            recoSeq += getConstitModAlg(jetDef.inputdef,suffix="HLT",tvaKey="JetTrackVtxAssoc",vtxKey="PrimaryVertices",monTool=monJetRecTool)
+        else:
+            recoSeq += getConstitModAlg(jetDef.inputdef,suffix="HLT",tvaKey=trkcolls["TVA"],vtxKey=trkcolls["Vertices"],monTool=monJetRecTool)
+
+    # Add the PseudoJetGetter alg to the sequence
+    constitPJAlg = getConstitPJGAlg( jetDef.inputdef )
+    constitPJKey = constitPJAlg.OutputContainer
+    recoSeq += conf2toConfigurable( constitPJAlg )
+    # Basic list of PseudoJets is just the constituents
+    # Append ghosts (tracks) if desired
+    pjs = [constitPJKey]
+    if trkcolls:
+        pjs.append(trkcolls["GhostTracks"])
+
+    from JetRecConfig import JetRecConfig
+    jetModList = []
+    if jetRecoDict["trkopt"] != "notrk":
+        trkMods = JetRecoConfiguration.defineTrackMods(jetRecoDict["trkopt"])
+        jetModList += trkMods
+
+    rhoKey = "auto"
+    if "sub" in jetRecoDict["jetCalib"]:
+        # Add the event shape alg if needed for area subtraction
+        eventShapeAlg = JetRecConfig.getEventShapeAlg( jetDef.inputdef, constitPJKey, "HLT_" )
+        recoSeq += conf2toConfigurable(eventShapeAlg)
+        # Not currently written because impossible to merge
+        # across event views, which is maybe a concern in
+        # the case of regional PFlow
+        rhoKey = eventShapeAlg.EventDensityTool.OutputContainer
+
+    # Import the standard jet modifiers as defined for offline
+    # We can add/configure these differently if desired. In particular,
+    # we could define a TriggerJetMods module if settings need to
+    # diverge substantially e.g. track/vertex collections
+    calibMods = JetRecoConfiguration.defineCalibFilterMods(jetRecoDict,dataSource, rhoKey)
+    jetModList += calibMods
+
+    # Get online monitoring tool
+    from JetRec import JetOnlineMon
+    monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+jetsFullName+"/")
+
+    # Generate a JetAlgorithm to run the jet finding and modifiers
+    # (via a JetRecTool instance).
+    jetRecAlg = JetRecConfig.getJetAlgorithm(jetsFullName, jetDef, pjs, jetModList, monTool)
+    recoSeq += conf2toConfigurable( jetRecAlg )
+    # End of basic jet reco
+    return recoSeq, sequenceOut, jetDef
+
+# Grooming needs the ungroomed jets to be built first,
+# so call the basic jet reco seq, then add a grooming alg
+def groomedJetRecoSequence( configFlags, dataSource, RoIs, **jetRecoDict ):
+    jetDefString = jetRecoDictToString(jetRecoDict)
+    recoSeq = parOR( "JetGroomSeq_"+jetDefString, [])
+    ungroomedJetRecoDict = dict(jetRecoDict)
+    ungroomedJetRecoDict["recoAlg"] = ungroomedJetRecoDict["recoAlg"].rstrip("tsd") # Drop grooming spec
+    ungroomedJetRecoDict["jetCalib"] = "nojcalib" # No need to calibrate
 
-        groomedModList = JetRecoConfiguration.defineCalibFilterMods(jetRecoDict,dataSource)
-        # Can add substructure mods here
+    (ungroomedJetRecoSequence,ungroomedJetsName, ungroomedDef) = RecoFragmentsPool.retrieve(standardJetRecoSequence,configFlags,dataSource=dataSource,RoIs=RoIs,**ungroomedJetRecoDict)
+    recoSeq += conf2toConfigurable( ungroomedJetRecoSequence )
+    # Need to forward the pseudojets of the parents to the groomer
+    parentpjs = getattr(ungroomedJetRecoSequence,"jetalg_{}".format(ungroomedJetsName)).Tools[0].InputPseudoJets
 
-        # Get online monitoring tool
-        from JetRec import JetOnlineMon
-        monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+groomedJetsFullName+"/")
+    groomDef = JetRecoConfiguration.defineGroomedJets(jetRecoDict,ungroomedDef,ungroomedJetsName)
+    groomedJetsFullName = jetNamePrefix+groomDef.basename+"Jets_"+jetRecoDict["jetCalib"]
+    if jetRecoDict["trkopt"]!="notrk":
+        groomedJetsFullName += "_"+jetRecoDict["trkopt"]
 
-        from JetRecConfig.JetGroomConfig import getJetGroomAlg
-        groomalg = getJetGroomAlg(groomedJetsFullName,groomDef,parentpjs,groomedModList,monTool)
-        recoSeq += conf2toConfigurable( groomalg )
+    groomedModList = JetRecoConfiguration.defineCalibFilterMods(jetRecoDict,dataSource)
+    # Can add substructure mods here
 
-        sequenceOut = recordable(groomedJetsFullName)
-    else:
-        # Normal jet reconstruction, no reclustering or grooming
-
-        # Start by adding the topocluster reco sequence
-        # This makes EM clusters!
-        from TriggerMenuMT.HLTMenuConfig.CommonSequences.CaloSequenceSetup import (
-                caloClusterRecoSequence, LCCaloClusterRecoSequence)
-        if jetRecoDict["calib"] == "em":
-            topoClusterSequence, clustersKey = RecoFragmentsPool.retrieve(
-                    caloClusterRecoSequence, flags=None, RoIs=RoIs)
-        elif jetRecoDict["calib"] == "lcw":
-            topoClusterSequence, clustersKey = RecoFragmentsPool.retrieve(
-                    LCCaloClusterRecoSequence, flags=None, RoIs=RoIs)
-        else:
-            raise ValueError("Invalid value for calib: '{}'".format(jetRecoDict["calib"]))
-        recoSeq += topoClusterSequence
-
-        # Set up tracking sequence -- may need to reorganise or relocate
-        # depending on how we want to handle HLT preselection
-        trkcolls = None
-        if jetRecoDict["trkopt"] != "notrk":
-            from .JetTrackingConfig import JetTrackingSequence
-            (jettrkseq, trkcolls) = RecoFragmentsPool.retrieve( JetTrackingSequence, None, trkopt=jetRecoDict["trkopt"], RoIs=RoIs)
-            recoSeq += jettrkseq
-
-        # Potentially add particle flow reconstruction
-        # Work in progress
-        if "pf" in jetRecoDict["dataType"]:
-            if jetRecoDict["trkopt"] == "notrk":
-                raise RuntimeError("PFlow jet chain requested with no tracking option!")
-            from eflowRec.PFHLTSequence import PFHLTSequence
-            (pfseq, pfoPrefix) = RecoFragmentsPool.retrieve(PFHLTSequence, None, clustersin=clustersKey, tracktype=jetRecoDict["trkopt"])
-            recoSeq += pfseq
-            jetDef = JetRecoConfiguration.defineJets(jetRecoDict,pfoPrefix=pfoPrefix)
-        else:
-            jetDef = JetRecoConfiguration.defineJets(jetRecoDict,clustersKey=clustersKey)
-        useConstitMods = ["sktc","cssktc", "pf", "csskpf"]
-        doConstitMods = jetRecoDict["dataType"] in useConstitMods
-
-        # chosen jet collection
-        jetsFullName = jetNamePrefix+jetDef.basename+"Jets_"+jetRecoDict["jetCalib"]
-        if jetRecoDict["trkopt"] != "notrk":
-            jetsFullName += "_{}".format(jetRecoDict["trkopt"])
-        sequenceOut = recordable(jetsFullName)
-
-        if doConstitMods:
-            # Get online monitoring jet rec tool
-            from JetRecTools import OnlineMon                                                  
-            monJetRecTool = OnlineMon.getMonTool_Algorithm("HLTJets/"+jetsFullName+"/")
-
-            from JetRecConfig.ConstModHelpers import getConstitModAlg
-            if jetRecoDict["trkopt"] == "notrk":
-                recoSeq += getConstitModAlg(jetDef.inputdef,suffix="HLT",tvaKey="JetTrackVtxAssoc",vtxKey="PrimaryVertices",monTool=monJetRecTool)
-            else:
-                recoSeq += getConstitModAlg(jetDef.inputdef,suffix="HLT",tvaKey=trkcolls["TVA"],vtxKey=trkcolls["Vertices"],monTool=monJetRecTool)
-
-        # Add the PseudoJetGetter alg to the sequence
-        constitPJAlg = getConstitPJGAlg( jetDef.inputdef )
-        constitPJKey = constitPJAlg.OutputContainer
-        recoSeq += conf2toConfigurable( constitPJAlg )
-        # Basic list of PseudoJets is just the constituents
-        # Append ghosts (tracks) if desired
-        pjs = [constitPJKey]
-        if trkcolls:
-            pjs.append(trkcolls["GhostTracks"])
-
-        from JetRecConfig import JetRecConfig
-        jetModList = []
-        if jetRecoDict["trkopt"] != "notrk":
-            trkMods = JetRecoConfiguration.defineTrackMods(jetRecoDict["trkopt"])
-            jetModList += trkMods
-
-        rhoKey = "auto"
-        if "sub" in jetRecoDict["jetCalib"]:
-            # Add the event shape alg if needed for area subtraction
-            eventShapeAlg = JetRecConfig.getEventShapeAlg( jetDef.inputdef, constitPJKey, "HLT_" )
-            recoSeq += conf2toConfigurable(eventShapeAlg)
-            # Not currently written because impossible to merge
-            # across event views, which is maybe a concern in
-            # the case of regional PFlow
-            rhoKey = eventShapeAlg.EventDensityTool.OutputContainer
-
-        # Import the standard jet modifiers as defined for offline
-        # We can add/configure these differently if desired. In particular,
-        # we could define a TriggerJetMods module if settings need to
-        # diverge substantially e.g. track/vertex collections
-        calibMods = JetRecoConfiguration.defineCalibFilterMods(jetRecoDict,dataSource, rhoKey)
-        jetModList += calibMods
-
-        # Get online monitoring tool
-        from JetRec import JetOnlineMon
-        monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+jetsFullName+"/")
-
-        # Generate a JetAlgorithm to run the jet finding and modifiers
-        # (via a JetRecTool instance).
-        jetRecAlg = JetRecConfig.getJetAlgorithm(jetsFullName, jetDef, pjs, jetModList, monTool)
-        recoSeq += conf2toConfigurable( jetRecAlg )
-        # End of basic jet reco
-        pass
-
-    return (recoSeq,sequenceOut)
+    # Get online monitoring tool
+    from JetRec import JetOnlineMon
+    monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+groomedJetsFullName+"/")
+
+    from JetRecConfig.JetGroomConfig import getJetGroomAlg
+    groomalg = getJetGroomAlg(groomedJetsFullName,groomDef,parentpjs,groomedModList,monTool)
+    recoSeq += conf2toConfigurable( groomalg )
+
+    sequenceOut = recordable(groomedJetsFullName)
+    jetDef = groomDef
+    return recoSeq, sequenceOut, jetDef
+
+
+# Reclustering -- call the basic jet reco and add this to the sequence,
+# then add another jet algorithm to run the reclustering step
+def reclusteredJetRecoSequence( configFlags, dataSource, RoIs, **jetRecoDict ):
+    jetDefString = jetRecoDictToString(jetRecoDict)
+    recoSeq = parOR( "JetReclusterSeq_"+jetDefString, [])
+
+    basicJetRecoDict = dict(jetRecoDict)
+    basicJetRecoDict["recoAlg"] = "a4" # Standard size for reclustered
+    (basicJetRecoSequence,basicJetsName, basicJetDef) = RecoFragmentsPool.retrieve(standardJetRecoSequence,configFlags,dataSource=dataSource,RoIs=RoIs,**basicJetRecoDict)
+    recoSeq += basicJetRecoSequence
+
+    rcJetPtMin = 15e3 # 15 GeV minimum pt for jets to be reclustered
+    from JetRec.JetRecConf import JetViewAlg
+    filteredJetsName = basicJetsName+"_pt15"
+    recoSeq += JetViewAlg("jetview_"+filteredJetsName,
+                          InputContainer=basicJetsName,
+                          OutputContainer=filteredJetsName,
+                          PtMin=rcJetPtMin)
+
+    rcJetDef = JetRecoConfiguration.defineReclusteredJets(jetRecoDict)
+    rcJetDef.inputdef.inputname = filteredJetsName
+    rcJetsFullName = jetNamePrefix+rcJetDef.basename+"RCJets_"+jetRecoDict["jetCalib"]
+    rcModList = [] # Could set substructure mods
+    rcJetDef.modifiers = rcModList
+
+    rcConstitPJAlg = getConstitPJGAlg( rcJetDef.inputdef )
+    rcConstitPJKey = rcConstitPJAlg.OutputContainer
+    recoSeq += conf2toConfigurable( rcConstitPJAlg )
+
+    # Get online monitoring tool
+    from JetRec import JetOnlineMon
+    monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+rcJetsFullName+"/")
+
+    rcPJs = [rcConstitPJKey]
+    rcJetRecAlg = getJetAlgorithm(rcJetsFullName, rcJetDef, rcPJs, rcModList, monTool)
+
+    recoSeq += conf2toConfigurable( rcJetRecAlg )
+
+    sequenceOut = recordable(rcJetsFullName)
+    jetDef = rcJetDef
+    return recoSeq, sequenceOut, jetDef
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgConfigs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgConfigs.py
index 7a4936428fde..0d8ee40c27af 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgConfigs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgConfigs.py
@@ -8,6 +8,8 @@ from ..Menu.SignatureDicts import METChainParts
 import GaudiKernel.SystemOfUnits as Units
 import TrigEFMissingET.PUClassification as PUClassification
 
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+
 from AthenaCommon.Logging import logging
 
 log = logging.getLogger(__name__)
@@ -121,8 +123,8 @@ class MHTConfig(AlgConfig):
         # TODO - right now jet calibration is hardcoded to EM
         jetRecoDict["calib"] = "em"
         jetRecoDict["jetCalib"] = "subjes"
-        jetSeq, jetName = RecoFragmentsPool.retrieve(
-            jetRecoSequence, None, dataSource="data", **jetRecoDict
+        jetSeq, jetName, jetDef = RecoFragmentsPool.retrieve(
+            jetRecoSequence, ConfigFlags, **jetRecoDict
         )
 
         self.inputs = [jetSeq]
@@ -142,8 +144,8 @@ class TrkMHTConfig(AlgConfig):
         jetRecoDict = jetRecoDictForMET(trkopt="ftf", **recoDict)
         # TODO - right now jet calibration is hardcoded to EM
         jetRecoDict["calib"] = "em"
-        jetSeq, jetName = RecoFragmentsPool.retrieve(
-            jetRecoSequence, None, dataSource="data", **jetRecoDict
+        jetSeq, jetName, jetDef = RecoFragmentsPool.retrieve(
+            jetRecoSequence, ConfigFlags, **jetRecoDict
         )
 
         # These are the names set by the upstream algorithms. Unfortunately
@@ -281,8 +283,8 @@ class MHTPufitConfig(AlgConfig):
         # If this is PFlow then set the calib type to "em"
         if recoDict["jetDataType"] == "pf":
             jetRecoDict["calib"] = "em"
-        jetSeq, jetName = RecoFragmentsPool.retrieve(
-            jetRecoSequence, flags=None, dataSource="data", **jetRecoDict
+        jetSeq, jetName, jetDef = RecoFragmentsPool.retrieve(
+            jetRecoSequence, flags=ConfigFlags, **jetRecoDict
         )
 
         # We need to get the input name that the jet sequence used
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 292ef2aad3e2..ffd4855a3ee2 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -191,33 +191,43 @@ def setupMenu():
         ChainProp(name='HLT_j85_L1J20', groups=SingleJetGroup),
         ChainProp(name='HLT_j45_L1J15', groups=SingleJetGroup),
         ChainProp(name='HLT_j420_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subjesgscIS_L1J15', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subresjesgscIS_L1J15', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subjesgscIS_011jvt_L1J15', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subjesgscIS_015jvt_L1J15', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subjesgscIS_059jvt_L1J15', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_subjesgscIS_ftf_L1J15', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_subresjesgscIS_ftf_L1J15', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_subjesgscIS_ftf_011jvt_L1J15', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_subjesgscIS_ftf_015jvt_L1J15', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_subjesgscIS_ftf_059jvt_L1J15', groups=SingleJetGroup),
         ChainProp(name='HLT_j45_ftf_L1J15', groups=SingleJetGroup),
         ChainProp(name='HLT_j85_ftf_L1J20', groups=SingleJetGroup),
 
 
-        ChainProp(name='HLT_j45_ftf_pf_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subjesgscIS_pf_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subresjesgscIS_pf_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j85_ftf_pf_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_pf_ftf_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_pf_subjesgscIS_ftf_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_pf_subresjesgscIS_ftf_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j85_pf_ftf_L1J20', groups=SingleJetGroup),
 
-        ChainProp(name='HLT_j420_ftf_subjesgscIS_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j420_subjesgscIS_ftf_L1J20', groups=SingleJetGroup),
 
         ChainProp(name='HLT_j45_nojcalib_L1J20', groups=SingleJetGroup),
         ChainProp(name='HLT_j45_sktc_nojcalib_L1J20', groups=SingleJetGroup),
         ChainProp(name='HLT_j45_cssktc_nojcalib_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_pf_nojcalib_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_csskpf_nojcalib_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_pf_nojcalib_ftf_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_csskpf_nojcalib_ftf_L1J20', groups=SingleJetGroup),
 
         ChainProp(name='HLT_j260_320eta490_L1J20', groups=SingleJetGroup),
 
         ChainProp(name='HLT_j460_a10_lcw_subjes_L1J20', groups=SingleJetGroup),
         ChainProp(name='HLT_j460_a10r_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10t_lcw_nojcalib_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10t_lcw_nojcalib_35smcINF_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_2j330_a10t_lcw_nojcalib_35smcINF_L1J100', groups=SingleJetGroup),
         ChainProp(name='HLT_j460_a10sd_lcw_nojcalib_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10sd_pf_nojcalib_ftf_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10sd_csskpf_nojcalib_ftf_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_2j330_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10sd_csskpf_jes_ftf_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10sd_csskpf_jes_ftf_35smcINF_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_2j330_a10sd_csskpf_jes_ftf_35smcINF_L1J100', groups=SingleJetGroup),
 
         ChainProp(name='HLT_3j200_L1J20', groups=MultiJetGroup),
         ChainProp(name='HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20', groups=SingleJetGroup),
@@ -227,9 +237,9 @@ def setupMenu():
     ]
 
     TriggerFlags.BjetSlice.signatures = TriggerFlags.BjetSlice.signatures() + [
-        ChainProp(name="HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20", groups=SingleBjetGroup),
-        ChainProp(name="HLT_j275_ftf_subjesgscIS_boffperf_split_L1J100", groups=SingleBjetGroup),
-        ChainProp(name="HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j275_subjesgscIS_ftf_boffperf_split_L1J100", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j45_subjesgscIS_ftf_bmv2c1070_split_L1J20", groups=SingleBjetGroup),
     ]
 
     TriggerFlags.TauSlice.signatures = TriggerFlags.TauSlice.signatures() + [
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
index f084522a0b36..f00186c181c1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
@@ -106,10 +106,10 @@ def setupMenu():
     ]
 
     TriggerFlags.BjetSlice.signatures = [
-        ChainProp(name="HLT_j225_ftf_subjesgscIS_bmv2c1040_split_L1J100", groups=SingleBjetGroup),
-        ChainProp(name="HLT_j275_ftf_subjesgscIS_bmv2c1060_split_L1J100", groups=SingleBjetGroup),
-        ChainProp(name="HLT_j300_ftf_subjesgscIS_bmv2c1070_split_L1J100", groups=SingleBjetGroup),
-        ChainProp(name="HLT_j360_ftf_subjesgscIS_bmv2c1077_split_L1J100", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j225_subjesgscIS_ftf_bmv2c1040_split_L1J100", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j275_subjesgscIS_ftf_bmv2c1060_split_L1J100", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j300_subjesgscIS_ftf_bmv2c1070_split_L1J100", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j360_subjesgscIS_ftf_bmv2c1077_split_L1J100", groups=SingleBjetGroup),
     ]
 
     TriggerFlags.TauSlice.signatures = [
-- 
GitLab


From 99231c0f173d3e1c65564140c93e91ef879622c7 Mon Sep 17 00:00:00 2001
From: Rupert Tombs <rt500@cam.ac.uk>
Date: Mon, 21 Sep 2020 13:24:24 +0100
Subject: [PATCH 306/422] Remove 'The Muon Geometry version is' lines

These were removed in commit 49c6bc59caaeb94cb733fc2a0fecc4ffd6abb459

Fixes tests MuonConfig_MuonDataDecodeTest_ctest and MuonConfig_MuonDataDecodeTest_Cache_ctest
---
 MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref       | 1 -
 MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref | 1 -
 2 files changed, 2 deletions(-)

diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
index f0596d84c5fc..25dd304d912e 100644
--- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
+++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
@@ -579,7 +579,6 @@ MdtRawDataProvi...   INFO initialize() successful in MdtRawDataProvider.MDT_RawD
 ClassIDSvc           INFO  getRegistryEntries: read 1008 CLIDRegistry entries for module ALL
 CscRawDataProvi...   INFO Retrieved service ServiceHandle('ROBDataProviderSvc')
 CscRawDataProvi...   INFO Retrieved tool Decoder = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder')
-CscRawDataProvi...   INFO The Muon Geometry version is R.08.01
 CscRawDataProvi...   INFO initialize() successful in CscRawDataProvider.CSC_RawDataProviderToolMT
 ClassIDSvc           INFO  getRegistryEntries: read 54 CLIDRegistry entries for module ALL
 RpcRdoToRpcPrep...   INFO package version = MuonRPC_CnvTools-00-00-00
diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
index 6d55261a126c..9f298ca18984 100644
--- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
+++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
@@ -579,7 +579,6 @@ MdtRawDataProvi...   INFO initialize() successful in MdtRawDataProvider.MDT_RawD
 ClassIDSvc           INFO  getRegistryEntries: read 1008 CLIDRegistry entries for module ALL
 CscRawDataProvi...   INFO Retrieved service ServiceHandle('ROBDataProviderSvc')
 CscRawDataProvi...   INFO Retrieved tool Decoder = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder')
-CscRawDataProvi...   INFO The Muon Geometry version is R.08.01
 CscRawDataProvi...   INFO initialize() successful in CscRawDataProvider.CSC_RawDataProviderToolMT
 ClassIDSvc           INFO  getRegistryEntries: read 54 CLIDRegistry entries for module ALL
 RpcRdoToRpcPrep...   INFO package version = MuonRPC_CnvTools-00-00-00
-- 
GitLab


From be28a3f5cfaf9ac57161b66e8aff87d2873ac38f Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Fri, 11 Sep 2020 16:13:47 +0200
Subject: [PATCH 307/422] Fix ordering in printouts

---
 Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py  | 2 +-
 .../python/HLTMenuConfig/Menu/DictFromChainName.py            | 4 ++--
 .../TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py | 2 +-
 .../TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py    | 2 +-
 .../python/HLTMenuConfig/Menu/MenuAlignmentTools.py           | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
index c4284359f650..4f3a8c558c60 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
@@ -109,7 +109,7 @@ def collectL1DecoderDecisionObjects(l1decoder):
 
 def collectHypoDecisionObjects(hypos, inputs = True, outputs = True):
     decisionObjects = set()
-    for step, stepHypos in six.iteritems (hypos):
+    for step, stepHypos in sorted(six.iteritems (hypos)):
         for hypoAlg in stepHypos:
             __log.debug( "Hypo %s with input %s and output %s ",
                          hypoAlg.getName(), hypoAlg.HypoInputDecisions, hypoAlg.HypoOutputDecisions )
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
index 0c5dc44a5162..103ecceeadc5 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
@@ -440,8 +440,8 @@ def analyseChainName(chainName, L1thresholds, L1item):
 
         # ---- remove properties that aren't allowed in the chain properties for a given siganture ----
         forbiddenProperties = set(chainProperties.keys()) - set(allowedSignaturePropertiesAndValues.keys())
-        log.debug('chainPropertie:s %s', set(chainProperties.keys()))
-        log.debug('allowedSignaturePropertiesAndValues: %s', set(allowedSignaturePropertiesAndValues.keys()))
+        log.debug('chainProperties: %s', sorted(set(chainProperties.keys())))
+        log.debug('allowedSignaturePropertiesAndValues: %s', sorted(set(allowedSignaturePropertiesAndValues.keys())))
         for fb in forbiddenProperties:
             forbiddenValue = chainProperties.pop(fb)
             assert forbiddenValue == '', "Property {} not allowed for signature '{}', but specified '{}'".format (fb, chainProperties['signature'], forbiddenValue)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index f58f6db1bed4..ed86e2d0c3d4 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -209,7 +209,7 @@ class GenerateMenuMT(object):
         #e.g. {'Electron': ['Electron','Muon','Photon']}        
         alignmentGroup_sets_to_align = analyseCombinations(combinations_in_menu, alignmentGroups_to_align)
         
-        log.debug('Aligning the following signatures with sets: %s',alignmentGroup_sets_to_align)
+        log.debug('Aligning the following signatures with sets: %s',sorted(alignmentGroup_sets_to_align))
         log.debug('Length of each of the alignment groups: %s',length_of_configs)
 
         for chainDict,chainConfig,lengthOfChainConfigs in all_chains:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
index 5181bf3b5fa5..b4a112df0a0b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
@@ -105,7 +105,7 @@ def createCFTree(CFseq):
     recoSeqSet=set()
     hypoSet=set()
     for menuseq in CFseq.step.sequences:
-        menuseq.addToSequencer(recoSeqSet, hypoSet)
+        menuseq.addToSequencer(recoSeqSet,hypoSet)
   
     #list(dict.fromkeys()) is guaranteed to respect ordering from python 3.7 onwards
     stepReco += list(dict.fromkeys([recoseq for recoseq in recoSeqSet]))
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
index 7f45f471ed3d..55a0690d6188 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
@@ -105,7 +105,6 @@ def analyseCombinations(combinations_in_menu, alignmentGroups_in_combinations):
          
         return sig_to_set
 
-
 # takes the list of signatures in a chain and changes it to be the post-grouping signatures
 # e.g. ['Electron','Muon'] ==> ['Egamma','Muon] 
 def setChainSignatures(signatures, lengthOfChainConfigs):
@@ -122,4 +121,5 @@ def setChainSignatures(signatures, lengthOfChainConfigs):
         # else it'll be a signature that doesn't need aligning, like beamspot or something.
         # maybe they should all be added to the_signature_grouping, even if they never
         # need to be merged together
-    return signatures, lengthOfChainConfigs
\ No newline at end of file
+    return signatures, lengthOfChainConfigs
+
-- 
GitLab


From 60c9e379ba7701487589ada70309cd9036002b6f Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <mhodgkin@aiatlas025.cern.ch>
Date: Mon, 21 Sep 2020 14:39:00 +0200
Subject: [PATCH 308/422] Increase number of events to 500 in mcLatest test.
 Add a no pileup version of that test.

---
 .../test/test_mcLatest_13TeV.sh                    |  4 ++--
 .../test/test_mcLatest_nopileup_13TeV.sh           | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100755 Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV.sh

diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_13TeV.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_13TeV.sh
index 008085ac0193..c334ef915439 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_13TeV.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_13TeV.sh
@@ -1,12 +1,12 @@
 #!/bin/sh
 #
-# art-description: Reco_tf for PhysVal, updated with q221 (2017-11-13) + pileup
+# art-description: Run reco with a latest (September 2020) MC setup with pileup
 # art-athena-mt: 4
 # art-type: grid
 # art-include: master/Athena
 
 export TRF_ECHO=True;
-Reco_tf.py --AMI=r11976 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/eos/atlas/atlascerngroupdisk/data-art/grid-input/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputHighPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/HITS.10501933._000008.pool.root.1 --inputLowPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/HITS.10501925._000027.pool.root.1 --maxEvents=5 --jobNumber=1 --imf False
+Reco_tf.py --AMI=r11976 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/eos/atlas/atlascerngroupdisk/data-art/grid-input/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputHighPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/HITS.10501933._000008.pool.root.1 --inputLowPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/HITS.10501925._000027.pool.root.1 --maxEvents=500 --jobNumber=1 --imf False
 RES=$?
 echo "art-result: $RES Reco"
 if [ $RES -ne 0 ];then
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV.sh
new file mode 100755
index 000000000000..e3238a254e27
--- /dev/null
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# art-description: Run latest (Sep 2020) MC setup without pileup.
+# art-athena-mt: 4
+# art-type: grid
+# art-include: master/Athena
+
+export TRF_ECHO=True;
+Reco_tf.py --AMI=r11976 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/eos/atlas/atlascerngroupdisk/data-art/grid-input/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500 --jobNumber=1 --imf False
+RES=$?
+echo "art-result: $RES Reco"
+if [ $RES -ne 0 ];then
+return $RES
+fi
-- 
GitLab


From 40b21fde44fbd6f8cec19b95f926c52559305e50 Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <mhodgkin@aiatlas025.cern.ch>
Date: Mon, 21 Sep 2020 14:47:24 +0200
Subject: [PATCH 309/422] Add version of mcLatest test using stdcmalloc without
 pileup.

---
 .../test_mcLatest_nopileup_stdcmalloc_13TeV.sh     | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100755 Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_stdcmalloc_13TeV.sh

diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_stdcmalloc_13TeV.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_stdcmalloc_13TeV.sh
new file mode 100755
index 000000000000..f802a4492c01
--- /dev/null
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_stdcmalloc_13TeV.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# art-description: Run latest (Sep 2020) MC setup without pileup and with stdcmalloc enabled.
+# art-athena-mt: 4
+# art-type: grid
+# art-include: master/Athena
+
+export TRF_ECHO=True;
+Reco_tf.py --AMI=r11976 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/eos/atlas/atlascerngroupdisk/data-art/grid-input/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500 --jobNumber=1 --imf False --athenaopts="--stdcmalloc"
+RES=$?
+echo "art-result: $RES Reco"
+if [ $RES -ne 0 ];then
+return $RES
+fi
-- 
GitLab


From 2f051b77834d30592a1130f3708e2b32b7cbf811 Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <mhodgkin@aiatlas025.cern.ch>
Date: Mon, 21 Sep 2020 14:48:36 +0200
Subject: [PATCH 310/422] Remove old mc5 tests, that are now replaced with
 mcLatest tests.

---
 .../test/test_reco_mc15_13tev.sh              | 30 -------------------
 .../test/test_reco_mc15_13tev_nopileup.sh     | 18 -----------
 ...est_reco_mc15_13tev_nopileup_stdcmalloc.sh | 18 -----------
 3 files changed, 66 deletions(-)
 delete mode 100755 Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev.sh
 delete mode 100755 Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup.sh
 delete mode 100755 Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup_stdcmalloc.sh

diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev.sh
deleted file mode 100755
index 2e3249d89888..000000000000
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# art-description: Reco_tf for PhysVal, updated with q221 (2017-11-13) + pileup
-# art-athena-mt: 4
-# art-type: grid
-# art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
-# art-include: master/Athena
-# art-include: 21.3/Athena
-# art-include: 21.9/Athena
-
-
-export TRF_ECHO=True; Reco_tf.py --conditionsTag all:OFLCOND-RUN12-SDR-19 --ignoreErrors 'False' --autoConfiguration='everything' --digiSeedOffset2 '1'  --preExec  'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.);from LArROD.LArRODFlags import larRODFlags;larRODFlags.nSamples.set_Value_and_Lock(4);from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet="AODFULL"'  'HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.overrideMetadata+=["PhysicsList"];'  'RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup="MC_pp_v7";from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False;' --digiSeedOffset1 '1' --steering 'doRDO_TRIG' --DataRunNumber '222525' --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc15_13TeV.410500.PowhegPythia8EvtGen_A14_ttbar_hdamp172p5_nonallhad.simul.HITS.e4797_s2726.50events.pool.root --inputHighPtMinbiasHitsFile='/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc15_13TeV.361035.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic_high.merge.HITS.e3581_s2578_s2195/*' --inputLowPtMinbiasHitsFile='/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc15_13TeV.361034.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e3581_s2578_s2195/*' --numberOfCavernBkg="0" --numberOfHighPtMinBias="0.12268057" --numberOfLowPtMinBias="39.8773194" --pileupFinalBunch 6 --imf False --maxEvents '500'
-RES=$?
-echo "art-result: $RES Reco"
-if [ $RES -ne 0 ];then
-return $RES
-fi
-
-Reco_tf.py --inputAODFile myAOD.pool.root --outputNTUP_PHYSVALFile PhysVal_13TeV_Example.pool.root --validationFlags doExample
-RES=$?
-echo "art-result: $RES PhysVal"
-if [ $RES -ne 0 ];then
-return $RES
-fi
-
-Reco_tf.py --validationFlags 'doExample,doMET,doPFlow,doTau,doEgamma,doBtag,doZee,doJet,doTopoCluster,doMuon,doTrigMinBias,doTrigIDtrk,doTrigBphys,doTrigMET,doTrigJet,doTrigTau, doTrigEgamma,doTrigMuon,doTrigBjet,doTrigHLTResult' --inputAODFile=myAOD.pool.root  --outputNTUP_PHYSVALFile=myNTUP_PHYSVAL.root
-RES=$?
-echo "art-result: $RES Ntup"
-return $RES
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup.sh
deleted file mode 100755
index 193b3769af96..000000000000
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-#
-# art-description: Reco_tf for PhysVal, updated with q221 (2017-11-13), no pileup
-# art-athena-mt: 4
-# art-type: grid
-# art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
-# art-include: master/Athena
-# art-include: 21.3/Athena
-# art-include: 21.9/Athena
-
-
-export TRF_ECHO=True; Reco_tf.py --conditionsTag all:OFLCOND-RUN12-SDR-19 --ignoreErrors 'False' --autoConfiguration='everything' --digiSeedOffset2 '1'  --preExec  'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.);from LArROD.LArRODFlags import larRODFlags;larRODFlags.nSamples.set_Value_and_Lock(4);from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet="AODFULL"'  'HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.overrideMetadata+=["PhysicsList"];'  'RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup="MC_pp_v7";from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False;' --digiSeedOffset1 '1' --steering 'doRDO_TRIG' --DataRunNumber '222525' --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc15_13TeV.410500.PowhegPythia8EvtGen_A14_ttbar_hdamp172p5_nonallhad.simul.HITS.e4797_s2726.50events.pool.root --imf False --maxEvents '500'
-
-RES=$?
-echo "art-result: $RES Reco"
-return $RES
-
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup_stdcmalloc.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup_stdcmalloc.sh
deleted file mode 100755
index e445ef38514e..000000000000
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup_stdcmalloc.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-#
-# art-description: Reco_tf for PhysVal, updated with q221 (2017-11-13), no pileup, with stdcmalloc
-# art-athena-mt: 4
-# art-type: grid
-# art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
-# art-include: master/Athena
-# art-include: 21.3/Athena
-# art-include: 21.9/Athena
-
-
-export TRF_ECHO=True; Reco_tf.py --conditionsTag all:OFLCOND-RUN12-SDR-19 --ignoreErrors 'False' --autoConfiguration='everything' --digiSeedOffset2 '1'  --preExec  'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.);from LArROD.LArRODFlags import larRODFlags;larRODFlags.nSamples.set_Value_and_Lock(4);from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet="AODFULL"'  'HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.overrideMetadata+=["PhysicsList"];'  'RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup="MC_pp_v7";from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False;' --digiSeedOffset1 '1' --steering 'doRDO_TRIG' --DataRunNumber '222525' --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc15_13TeV.410500.PowhegPythia8EvtGen_A14_ttbar_hdamp172p5_nonallhad.simul.HITS.e4797_s2726.50events.pool.root --imf False --maxEvents '500' --athenaopts="--stdcmalloc"
-
-RES=$?
-echo "art-result: $RES Reco"
-return $RES
-
-- 
GitLab


From ffb78a237ab9c48bdf5bd99db71a67ead7daf540 Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Mon, 21 Sep 2020 15:41:46 +0200
Subject: [PATCH 311/422] Updated all projects to atlasexternals-2.0.78.

---
 Projects/AnalysisBase/externals.txt   | 2 +-
 Projects/AthDataQuality/externals.txt | 2 +-
 Projects/AthGeneration/externals.txt  | 2 +-
 Projects/AthSimulation/externals.txt  | 2 +-
 Projects/Athena/externals.txt         | 2 +-
 Projects/VP1Light/externals.txt       | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt
index e6c276c98962..042f340bf18b 100644
--- a/Projects/AnalysisBase/externals.txt
+++ b/Projects/AnalysisBase/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AnalysisBaseExternalsVersion = 2.0.77
+AnalysisBaseExternalsVersion = 2.0.78
diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt
index 1479e8bf5f12..d94fd24c8789 100644
--- a/Projects/AthDataQuality/externals.txt
+++ b/Projects/AthDataQuality/externals.txt
@@ -5,4 +5,4 @@
 # an "origin/" prefix before it. For tags however this is explicitly
 # forbidden.
 
-AtlasExternalsVersion = 2.0.77
+AtlasExternalsVersion = 2.0.78
diff --git a/Projects/AthGeneration/externals.txt b/Projects/AthGeneration/externals.txt
index 523826ba6f85..9e3fc448673e 100644
--- a/Projects/AthGeneration/externals.txt
+++ b/Projects/AthGeneration/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthGenerationExternalsVersion = 2.0.77
+AthGenerationExternalsVersion = 2.0.78
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v34r0.004
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index c55ec4ebba96..cc1aa0a4b08c 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthSimulationExternalsVersion = 2.0.77
+AthSimulationExternalsVersion = 2.0.78
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v34r0.004
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index 16b150ed4be3..7955b584ecac 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthenaExternalsVersion = 2.0.77
+AthenaExternalsVersion = 2.0.78
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v34r0.004
diff --git a/Projects/VP1Light/externals.txt b/Projects/VP1Light/externals.txt
index e3134d942295..52c304c08b24 100644
--- a/Projects/VP1Light/externals.txt
+++ b/Projects/VP1Light/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-VP1LightExternalsVersion = 2.0.77
+VP1LightExternalsVersion = 2.0.78
-- 
GitLab


From 1ee451d0187d4468c4714989eb618f86efc047dd Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Mon, 21 Sep 2020 16:52:29 +0200
Subject: [PATCH 312/422] MaterialEffectsUpdator.cxx: Demote msg about config
 INFO->DEBUG

---
 .../TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx
index 808554d48839..0db3e8be12ec 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx
@@ -90,7 +90,7 @@ StatusCode
 Trk::MaterialEffectsUpdator::initialize()
 {
 
-  ATH_MSG_INFO("Minimal momentum cut for material update : " << m_momentumCut << " MeV");
+  ATH_MSG_DEBUG("Minimal momentum cut for material update : " << m_momentumCut << " MeV");
 
   // retrieve the EnergyLoss Updator and Material Effects updator
   if (m_doEloss) {
-- 
GitLab


From 8fd83fea721e79d8d63456f16536e6504e2e6283 Mon Sep 17 00:00:00 2001
From: ecarquin <e.carquin.pphysics@gmail.com>
Date: Sun, 20 Sep 2020 22:05:44 +0200
Subject: [PATCH 313/422] Fix ATR-22058 - Move writehandle record above to
 capture correctly element links

---
 .../TrigTauRec/src/TrigTauRecMergedMT.cxx     | 66 ++++++++++---------
 .../TrigTauRec/src/TrigTauRecMergedMT.h       | 23 +++----
 .../src/TrigTauMonitorAlgorithm.cxx           | 17 ++---
 .../TrigEDMConfig/python/TriggerEDMRun3.py    |  2 +-
 4 files changed, 49 insertions(+), 59 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx
index 8837948894cb..e160628d3186 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx
+++ b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx
@@ -1,6 +1,5 @@
-
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "GaudiKernel/SystemOfUnits.h"
@@ -193,29 +192,40 @@ StatusCode TrigTauRecMergedMT::execute(const EventContext& ctx) const
     ATH_MSG_DEBUG("Tau Track Container Size " << pTauTrackContainer->size());
   }
 
-
   // Make new container which is deep copy of that
-  xAOD::TauJetContainer*    pContainer    = nullptr;
-  xAOD::TauJetAuxContainer* pAuxContainer = nullptr;
+  std::unique_ptr<xAOD::TauJetContainer>    pContainer    = std::make_unique<xAOD::TauJetContainer>();
+  std::unique_ptr<xAOD::TauJetAuxContainer> pAuxContainer = std::make_unique<xAOD::TauJetAuxContainer>();
+  pContainer->setStore(pAuxContainer.get());
+
+  // Write final taujets container
+  SG::WriteHandle<xAOD::TauJetContainer> outputTauHandle(m_trigtauRecOutKey, ctx);
+  ATH_CHECK(outputTauHandle.record(std::move(pContainer),std::move(pAuxContainer)));
+
   xAOD::TauJet* tau(0);
   xAOD::TauJet* p_tau(0);
 
-  xAOD::TauTrackContainer*    pTrackContainer    = nullptr;
-  xAOD::TauTrackAuxContainer* pTrackAuxContainer = nullptr;
-  xAOD::TauTrack* tautrack(0);
+  ATH_CHECK(deepCopy(outputTauHandle, tau, pTauContainer));
+  if(outputTauHandle->size()>0) p_tau = outputTauHandle->back();
 
-  ATH_CHECK(deepCopy(pContainer, pAuxContainer, tau, pTauContainer));
-  if(pContainer->size()>0) p_tau = pContainer->back();
+  std::unique_ptr<xAOD::TauTrackContainer>    pTrackContainer    = std::make_unique<xAOD::TauTrackContainer>();
+  std::unique_ptr<xAOD::TauTrackAuxContainer> pTrackAuxContainer = std::make_unique<xAOD::TauTrackAuxContainer>();
+  pTrackContainer->setStore(pTrackAuxContainer.get());
 
-  ATH_CHECK(deepCopy(pTrackContainer, pTrackAuxContainer, tautrack, pTauTrackContainer));
+  SG::WriteHandle<xAOD::TauTrackContainer> tauTrackHandle(m_trigtauTrkOutKey, ctx);
+  ATH_MSG_DEBUG("  write: " << tauTrackHandle.key() << " = " << "..." );
+  ATH_CHECK(tauTrackHandle.record(std::move(pTrackContainer), std::move(pTrackAuxContainer)));
+
+  xAOD::TauTrack* tautrack(0);
+
+  ATH_CHECK(deepCopy(tauTrackHandle, tautrack, pTauTrackContainer));
 
   if(!m_trigTauTrackInKey.key().empty() && m_clustersKey.key().empty()){
     p_tau->clearTauTrackLinks();
-    if(pTrackContainer != nullptr){
-      ATH_MSG_DEBUG("TauTrackContainer size: " << pTrackContainer->size());
-      for( xAOD::TauTrack* track : *pTrackContainer){
+    if(tauTrackHandle.isValid() && tauTrackHandle->size()>0){
+      ATH_MSG_DEBUG("TauTrackContainer size: " << tauTrackHandle->size());
+      for( xAOD::TauTrack* track : *tauTrackHandle){
         ElementLink<xAOD::TauTrackContainer> linkToTauTrack;
-        linkToTauTrack.toContainedElement(*pTrackContainer, track);
+        linkToTauTrack.toContainedElement(*tauTrackHandle, track);
         p_tau->addTauTrackLink(linkToTauTrack);
       }
     }
@@ -241,7 +251,7 @@ StatusCode TrigTauRecMergedMT::execute(const EventContext& ctx) const
 
     if(p_tau==nullptr){
       p_tau = new xAOD::TauJet();
-      pContainer->push_back(p_tau);
+      outputTauHandle->push_back(p_tau);
       p_tau->setROIWord(roiDescriptor->roiWord());
     }
 
@@ -363,7 +373,7 @@ StatusCode TrigTauRecMergedMT::execute(const EventContext& ctx) const
       processStatus = tool->executeVertexFinder(*p_tau);
     }
     else if (tool->type() == "TauTrackFinder") {
-      processStatus = tool->executeTrackFinder(*p_tau, *pTrackContainer);
+      processStatus = tool->executeTrackFinder(*p_tau, *tauTrackHandle);
     }
     else if (tool->type() == "TauVertexVariables" ) {
       processStatus = tool->executeVertexVariables(*p_tau, dummyVxCont);
@@ -384,15 +394,17 @@ StatusCode TrigTauRecMergedMT::execute(const EventContext& ctx) const
     }
   }
 
+  ATH_MSG_DEBUG("This tau has " << p_tau->allTracks() << " tracks linked");
+
   //check status
   if ( !processStatus.isSuccess() )  {   // some problem
     ATH_MSG_DEBUG("The tau object has NOT been registered in the tau container");
 
-    xAOD::TauJet* bad_tau = pContainer->back();
+    xAOD::TauJet* bad_tau = outputTauHandle->back();
     ATH_MSG_DEBUG("Deleting " << bad_tau->nAllTracks() << " tracks associated with tau");
-    pTrackContainer->erase(pTrackContainer->end()-bad_tau->nAllTracks(), pTrackContainer->end());
+    tauTrackHandle->erase(tauTrackHandle->end()-bad_tau->nAllTracks(), tauTrackHandle->end());
 
-    pContainer->pop_back();
+    outputTauHandle->pop_back();
 
     ATH_MSG_DEBUG("Clean up done after jet seed");
   }
@@ -479,22 +491,12 @@ StatusCode TrigTauRecMergedMT::execute(const EventContext& ctx) const
   // all done, register the tau Container in TDS.
   //-------------------------------------------------------------------------
   
-  ATH_MSG_DEBUG("Output TauJetContainer size:"<< pContainer->size());
-  ATH_MSG_DEBUG("Output TauTrackJetContainer size:"<< pTrackContainer->size());
+  ATH_MSG_DEBUG("Output TauJetContainer size:"<< outputTauHandle->size());
+  ATH_MSG_DEBUG("Output TauJetTrackContainer size:"<< tauTrackHandle->size());
   
   
   ATH_MSG_DEBUG("Recorded a tau container: HLT_TrigTauRecMergedMT");
   ATH_MSG_DEBUG("the tau object has been registered in the tau container");
-
-  SG::WriteHandle<xAOD::TauTrackContainer> tauTrackHandle(m_trigtauTrkOutKey, ctx);
-  ATH_MSG_DEBUG("  write: " << tauTrackHandle.key() << " = " << "..." );
-  ATH_CHECK(tauTrackHandle.record(std::unique_ptr<xAOD::TauTrackContainer>(pTrackContainer), 
-                       std::unique_ptr<xAOD::TauTrackAuxContainer>(pTrackAuxContainer)));
-
-  // Write final taujets container
-  SG::WriteHandle<xAOD::TauJetContainer> outputTauHandle(m_trigtauRecOutKey, ctx);
-  ATH_CHECK(outputTauHandle.record(std::unique_ptr<xAOD::TauJetContainer>(pContainer),
-                       std::unique_ptr<xAOD::TauJetAuxContainer>(pAuxContainer)));
   
   return StatusCode::SUCCESS;
 }
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h
index 305ca60b1da9..f773ee659e8e 100755
--- a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h
+++ b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h
@@ -39,8 +39,7 @@ class TrigTauRecMergedMT: public AthReentrantAlgorithm {
 
   template<class T, class U, class V> StatusCode deepCopy(T*& containerOut, U*& containerStoreOut, const V* dummyContainerType,
                                  const T*& oldContainer);
-  template<class T, class U, class V> StatusCode deepCopy(T*& containerOut,
-                                                          U*& containerStoreOut,
+  template<class W, class V, class T> StatusCode deepCopy(W& writeHandle,
                                                           const V* dummyContainerType,
                                                           const T*& oldContainer) const;
 
@@ -89,25 +88,19 @@ class TrigTauRecMergedMT: public AthReentrantAlgorithm {
 };
 
   // Function to perform deep copy on container
-  template<class T, class U, class V>
-  StatusCode TrigTauRecMergedMT::deepCopy(T*& container,
-                                          U*& containerStore,
-                                          const V* /*dummyContainerElementType*/,
+  template<class W, class V, class T>
+    StatusCode TrigTauRecMergedMT::deepCopy(W& writeHandle,
+                                          const V* ,
                                           const T*& oldContainer) const {
-   // The new container should be null, check here
-   if(container==0 && containerStore==0){
-     container = new T();
-     containerStore = new U();
-     container->setStore(containerStore);
-   }else{
-     ATH_MSG_FATAL("Proviced non-null containters, not initializing please provide null containers: ");
-     return StatusCode::FAILURE;
+   if(!writeHandle.isValid()){
+      ATH_MSG_FATAL("Provided with an invalid write handle ");
+      return StatusCode::FAILURE;
    }
    if(oldContainer != nullptr){
      for( const V* v : *oldContainer ){
        V* newV = new V();
        // Put objects into new container
-       container->push_back(newV);
+       writeHandle->push_back(newV);
        // Copy across aux store
        *newV = *v;
      }
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
index d479100e0f78..114a3df0814b 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
@@ -135,6 +135,7 @@ void TrigTauMonitorAlgorithm::fillDistributions(std::vector< std::pair< const xA
     if(nTracks==1){
        tau_vec_1p.push_back(pairObj.first);
     }else if(nTracks>1){
+       ATH_MSG_DEBUG("NTracks Offline: " << nTracks);
        tau_vec_np.push_back(pairObj.first);
     }
   }
@@ -162,6 +163,7 @@ void TrigTauMonitorAlgorithm::fillDistributions(std::vector< std::pair< const xA
     if(nTracks==1){
       tau_vec_1p.push_back(feat);
     }else if(nTracks>1){
+      ATH_MSG_DEBUG("NTracks Online: " << nTracks);
       tau_vec_np.push_back(feat);
     }
   }
@@ -223,17 +225,14 @@ void TrigTauMonitorAlgorithm::fillRNNInputVars(const std::string trigger, std::v
                                                     }return detail;});
   auto ptDetectorAxis     = Monitored::Collection("ptDetectorAxis", tau_vec,  [] (const xAOD::TauJet* tau){
                                                     return TMath::Log10(std::min(tau->ptDetectorAxis() / 1000.0, 100.0));});
-
-  auto massTrkSys         = Monitored::Collection("massTrkSys", tau_vec,  [] (const xAOD::TauJet* tau){
+  auto massTrkSys         = Monitored::Collection("massTrkSys", tau_vec,  [&nProng] (const xAOD::TauJet* tau){
                                                 float detail = -999;
-                                                if ((tau->detail(xAOD::TauJetParameters::massTrkSys, detail))&&(tau->nTracks()>1)){
+                                                if ( tau->detail(xAOD::TauJetParameters::massTrkSys, detail) && nProng.find("MP") != std::string::npos ){
                                                   detail = TMath::Log10(std::max(detail, 140.0f));
                                                 }return detail;});
 
-
-
     
-  fill(monGroup, centFrac,etOverPtLeadTrk,dRmax,absipSigLeadTrk,sumPtTrkFrac,emPOverTrkSysP,ptRatioEflowApprox,mEflowApprox,ptDetectorAxis,massTrkSys);                                              
+  fill(monGroup, centFrac,etOverPtLeadTrk,dRmax,absipSigLeadTrk,sumPtTrkFrac,emPOverTrkSysP,ptRatioEflowApprox,mEflowApprox,ptDetectorAxis,massTrkSys);     
   
 }
 
@@ -316,7 +315,7 @@ void TrigTauMonitorAlgorithm::fillRNNCluster(const std::string trigger, std::vec
 
     float max_cluster_dr = 1.0;
     
-    if(tau->jetLink().isValid()) {
+    if(!tau->jetLink().isValid()) {
       continue;
     }
 
@@ -325,8 +324,6 @@ void TrigTauMonitorAlgorithm::fillRNNCluster(const std::string trigger, std::vec
       ATH_MSG_ERROR("Tau jet link is invalid.");
     } 
 
-    ATH_MSG_DEBUG("After trying to get the jet link " << jetSeed->pt());
-
     if(!jetSeed->getConstituents().isValid()) {
       continue;
     }
@@ -344,8 +341,6 @@ void TrigTauMonitorAlgorithm::fillRNNCluster(const std::string trigger, std::vec
 	clusters.push_back(cl);
       }
     }
-
-    ATH_MSG_DEBUG("After loop on jet constituents");
   
     auto et_cmp = [](const xAOD::CaloCluster *lhs,
 		     const xAOD::CaloCluster *rhs) {
diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index fdfd2365cb52..f940b6bf69f0 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -381,7 +381,7 @@ TriggerHLTListRun3 = [
     #('xAOD::TauJetAuxContainer#HLT_TrigTauRecMerged_CaloOnlyMVAAux.',                  'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau'),
 
     ('xAOD::TauJetContainer#HLT_TrigTauRecMerged_MVA',                     'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau', 'inViews:TAUFTFIsoViews,TAUEFViews'),
-    ('xAOD::TauJetAuxContainer#HLT_TrigTauRecMerged_MVAAux.jetLink',              'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau'),
+    ('xAOD::TauJetAuxContainer#HLT_TrigTauRecMerged_MVAAux.',              'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau'),
 
     ('xAOD::TauJetContainer#HLT_TrigTauRecMerged_Precision',                     'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau', 'inViews:TAUFTFIdViews,TAUFTFTrackViews,TAUFTFTrackTwoViews'),
     ('xAOD::TauJetAuxContainer#HLT_TrigTauRecMerged_PrecisionAux.',              'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau'),
-- 
GitLab


From 2a8ae88652af05aafa934039d39afbaf56877d02 Mon Sep 17 00:00:00 2001
From: Semen Turchikhin <semen.turchikhin@cern.ch>
Date: Mon, 21 Sep 2020 15:17:17 +0000
Subject: [PATCH 314/422] Update Bphys trigger monitoring configuration for
 Run-3 chains validation

Use chain names with _L1* suffixes even for legacy triggers, as they are
supposed to be added like that to Physics_pp_v7_primaries menu. Adjust
the m(mumu) histogram ranges to cover all dimuon topologies.
---
 .../python/TrigBphysMonitCategory.py          | 48 +++++++++++--------
 .../python/TrigBphysMonitoringConfig.py       |  8 +++-
 2 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
index bcd080533a13..c5417da529f7 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
@@ -3,7 +3,29 @@
 from TriggerJobOpts.TriggerFlags import TriggerFlags
 
 monitoring_bphys = [
-                    #'HLT_mu11_mu6_bDimu', 
+                    # For individual chain monitoring folders, to fill DetailedIndividualChains - put them first
+                    'HLT_2mu4_bJpsimumu_L12MU4',
+                    'HLT_2mu4_bUpsimumu_L12MU4',
+                    'HLT_2mu4_bDimu_L12MU4',
+                    'HLT_mu6_mu4_bJpsimumu_L1MU6_2MU4',
+                    'HLT_mu6_mu4_bUpsimumu_L1MU6_2MU4',
+                    'HLT_mu6_mu4_bDimu_L1MU6_2MU4',
+                    'HLT_2mu6_bJpsimumu_L12MU6',
+                    'HLT_2mu6_bUpsimumu_L12MU6',
+                    'HLT_2mu6_bDimu_L12MU6',
+                    'HLT_mu11_mu6_bJpsimumu_L1MU11_2MU6',
+                    'HLT_mu11_mu6_bUpsimumu_L1MU11_2MU6',
+                    'HLT_mu11_mu6_bDimu_L1MU11_2MU6',
+                    'HLT_mu11_mu6_bPhi_L1MU11_2MU6',
+                    'HLT_mu11_mu6_bTau_L1MU11_2MU6',
+                    'HLT_mu11_mu6_bBmumu_L1MU11_2MU6',
+                    'HLT_mu11_mu6_bDimu2700_L1MU11_2MU6',
+                    'HLT_2mu4_bBmumux_BsmumuPhi_L12MU4',
+                    'HLT_mu6_mu4_bBmumux_BsmumuPhi_L1MU6_2MU4',
+                    'HLT_2mu4_bBmumux_BpmumuKp_L12MU4',
+                    'HLT_mu6_mu4_bBmumux_BpmumuKp_L1MU6_2MU4',
+                    # Other chains that used to be here
+                    'HLT_mu11_mu6_bDimu', 
                     'HLT_mu11_mu6_bBmumuxv2', 
                     'HLT_mu6_2mu4_bJpsi',
                     'HLT_mu20_bJpsi_Trkloose', 
@@ -14,7 +36,7 @@ monitoring_bphys = [
                     'HLT_mu11_mu6_bTau', 
                     'HLT_2mu6_bDimu_L1BPH-2M9-2MU6_BPH-2DR15-2MU6', 
                     'HLT_mu11_mu6_bDimu_novtx_noos', 
-                    #'HLT_mu11_mu6_bJpsimumu',
+                    'HLT_mu11_mu6_bJpsimumu',
                     'HLT_mu11_mu6_bBmumu',
                     'HLT_mu6_mu4_bUpsimumu_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',
                     'HLT_mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
@@ -25,23 +47,7 @@ monitoring_bphys = [
                     'HLT_2mu6_bBmumux_BsmumuPhi_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',
                     'HLT_mu6_bJpsi_Trkloose',
                     'HLT_mu4_mu4_idperf_bJpsimumu_noid',
-                    # For individual chain monitoring folders, to fill DetailedIndividualChains
-                    'HLT_2mu4_bJpsimumu',
-                    'HLT_2mu4_bUpsimumu',
-                    'HLT_2mu4_bDimu',
-                    'HLT_mu6_mu4_bJpsimumu',
-                    'HLT_mu6_mu4_bUpsimumu',
-                    'HLT_mu6_mu4_bDimu',
-                    'HLT_2mu6_bJpsimumu',
-                    'HLT_2mu6_bUpsimumu',
-                    'HLT_2mu6_bDimu',
-                    'HLT_mu11_mu6_bJpsimumu',
-                    'HLT_mu11_mu6_bUpsimumu',
-                    'HLT_mu11_mu6_bDimu',
-                    'HLT_2mu4_bBmumux_BsmumuPhi',
-                    'HLT_mu6_mu4_bBmumux_BsmumuPhi_delayed',
-                    'HLT_2mu4_bBmumux_BpmumuKp',
-                    'HLT_mu6_mu4_bBmumux_BpmumuKp',
+                    
                     ]
 
 primary_bphys = [ 
@@ -83,6 +89,10 @@ if TriggerFlags.EDMDecodingVersion == 3 :
                       'HLT_mu11_mu6_bJpsimumu_L1MU11_2MU6',
                       'HLT_mu11_mu6_bUpsimumu_L1MU11_2MU6',
                       'HLT_mu11_mu6_bDimu_L1MU11_2MU6',
+                      'HLT_mu11_mu6_bPhi_L1MU11_2MU6',
+                      'HLT_mu11_mu6_bTau_L1MU11_2MU6',
+                      'HLT_mu11_mu6_bBmumu_L1MU11_2MU6',
+                      'HLT_mu11_mu6_bDimu2700_L1MU11_2MU6',
                       'HLT_2mu4_bBmumux_BsmumuPhi_L12MU4',
                       'HLT_mu6_mu4_bBmumux_BsmumuPhi_L1MU6_2MU4',
                       'HLT_2mu4_bBmumux_BpmumuKp_L12MU4',
diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
index 5d3ce0d7874e..de36f5b2fefc 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
@@ -47,6 +47,10 @@ DetailedIndividualChains = {
                   "HLT_mu11_mu6_bJpsimumu" : "HLT_mu11_mu6_bJpsimumu(_L1(?!BPH).*)?$",
                   "HLT_mu11_mu6_bUpsimumu" : "HLT_mu11_mu6_bUpsimumu(_L1(?!BPH).*)?$",
                   "HLT_mu11_mu6_bDimu"     : "HLT_mu11_mu6_bDimu(_L1(?!BPH).*)?$",
+                  "HLT_mu11_mu6_bPhi"     : "HLT_mu11_mu6_bPhi(_L1(?!BPH).*)?$",
+                  "HLT_mu11_mu6_bTau"     : "HLT_mu11_mu6_bTau(_L1(?!BPH).*)?$",
+                  "HLT_mu11_mu6_bBmumu"     : "HLT_mu11_mu6_bBmumu(_L1(?!BPH).*)?$",
+                  "HLT_mu11_mu6_bDimu2700"     : "HLT_mu11_mu6_bDimu2700(_L1(?!BPH).*)?$",
                   "HLT_2mu4_bBmumux_BsmumuPhi"     : "HLT_2mu4_bBmumux_BsmumuPhi(_delayed)?(_L1(?!BPH).*)?$",
                   "HLT_mu6_mu4_bBmumux_BsmumuPhi"     : "HLT_mu6_mu4_bBmumux_BsmumuPhi(_delayed)?(_L1(?!BPH).*)?$",
                   "HLT_2mu4_bBmumux_BpmumuKp"     : "HLT_2mu4_bBmumux_BpmumuKp(_delayed)?(_L1(?!BPH).*)?$",
@@ -155,8 +159,8 @@ def TrigBphysMonitoringTool():
                                   DeltaR_max          =  3.,
                                   PtSum_min           =  0.,
                                   PtSum_max           =  100.,
-                                  OniaMass_min        =  2000,
-                                  OniaMass_max        =  12000,
+                                  OniaMass_min        =  0,
+                                  OniaMass_max        =  14000,
                                   TauMass_min         =  0,
                                   TauMass_max         =  3000,
                                   OniaPt_min          =  8,
-- 
GitLab


From 7bb14c215b66a82478a33d1e1c5508a3a4e6a023 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Mon, 21 Sep 2020 17:52:20 +0200
Subject: [PATCH 315/422] additional code cleanup for efadditional cleanup for
 eflowRec/PFEGamFlowElementAssoc

---
 Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h     |  1 -
 Event/xAOD/xAODPFlow/xAODPFlow/selection.xml     |  1 -
 .../xAODPFlow/versions/FlowElementContainer_v1.h |  3 +--
 .../eflowRec/eflowRec/PFEGamFlowElementAssoc.h   | 16 +++++++---------
 Reconstruction/eflowRec/share/PFlowMTConfig.py   |  2 +-
 5 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h b/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h
index c2c012b3272f..612098c0f892 100644
--- a/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h
+++ b/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h
@@ -358,7 +358,6 @@ namespace xAOD {
   }; // class Jet
 
 
-
 } // namespace xAOD
 
 // Declare IParticle as a base class of Jet_v1:
diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
index 50f7f3202b41..2c6e4664db7c 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/selection.xml
@@ -48,6 +48,5 @@
    <class name="std::vector<std::pair<ElementLink<xAOD::CaloClusterContainer_v1>,double> >" />
    <class name="std::vector<std::vector<std::pair<ElementLink<xAOD::CaloClusterContainer_v1>,double> > >" />
    <class name="std::vector<xAOD::PFODetails::PFOLeptonType>" />
-   
 
 </lcgdict>
diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h b/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h
index 0e9569b3ac5b..162551e7a791 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/versions/FlowElementContainer_v1.h
@@ -13,8 +13,7 @@
 
 // Local include(s):
 #include "xAODPFlow/versions/FlowElement_v1.h"
-// initialise the base class of the FlowElementContainer as an IParticle
-//DATAVECTOR_BASE(xAOD::FlowElement_v1, xAOD::IParticle);
+
 namespace xAOD {
    /// The container is a simple typedef for now
    typedef DataVector< xAOD::FlowElement_v1 > FlowElementContainer_v1;
diff --git a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
index bd85a89ff92f..4388401c8747 100644
--- a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
+++ b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
@@ -24,15 +24,13 @@
 #include "StoreGate/WriteDecorHandle.h"
 #include "xAODPFlow/FlowElementContainer.h"
 /**                                                                                                                                                                                     
-This is the algorithm, which inherits from AthAlgorithm, that adds element links 
-between particle flow objects (Flow Elements) and Egamma objects. The algorithm associates charged (c) Flow Elements 
-to all electron and converted photon tracks, and neutral (n) Flow Elements to all electron and photon clusters. 
-This is done by adding decorations to the "Electron" and "Photon" container, for charged Charged Flow Elements and Neutral Flow Elements separately, 
-in the form of vectors of element links to the associated Flow Elements. 
-The algorithm also adds decorations to the "JetETMissNeutralParticleFlowObjects" and 
-"JetETMissChargedParticleFlowObjects" containers, 
-in the form of vectors of element links to the associated electrons and photons.
-*/
+This is the algorithm, which inherits from AthAlgorithm, that adds element links between particle flow objects (Flow Elements) and Egamma objects. The algorithm associates charged (c) Flow Elements to all electron and converted photon tracks, and neutral (n) Flow Elements to all electron and photon clusters. 
+
+This is done by adding decorations to the "Electron" and "Photon" container, for charged Charged Flow Elements and Neutral Flow Elements separately, in the form of vectors of element links to the associated Flow Elements. 
+The algorithm also adds decorations to the "JetETMissNeutralFlowElements" and 
+"JetETMissChargedParticleFlowElements" containers, in the form of vectors of element links to the associated electrons and photons.
+
+**/
 class PFEGamFlowElementAssoc : public AthReentrantAlgorithm {
 
 public:
diff --git a/Reconstruction/eflowRec/share/PFlowMTConfig.py b/Reconstruction/eflowRec/share/PFlowMTConfig.py
index a169aca78497..8fc0211ac214 100644
--- a/Reconstruction/eflowRec/share/PFlowMTConfig.py
+++ b/Reconstruction/eflowRec/share/PFlowMTConfig.py
@@ -254,7 +254,7 @@ if jobproperties.eflowRecFlags.usePFEGammaPFOAssoc:
    topSequence += PFEGammaPFOAssoc
 
 #Add new FlowElement creators
-if jobproperties.eflowRecFlags.useFlowElements or True: 
+if jobproperties.eflowRecFlags.useFlowElements: 
   from eflowRec.eflowRecConf import PFChargedFlowElementCreatorAlgorithm
   PFChargedFlowElementCreatorAlgorithm = PFChargedFlowElementCreatorAlgorithm("PFChargedFlowElementCreatorAlgorithm")
   topSequence += PFChargedFlowElementCreatorAlgorithm 
-- 
GitLab


From b592d7281109f48ecf8f88e259f4f4ed0d26a6ab Mon Sep 17 00:00:00 2001
From: Will Leight <wleight@cern.ch>
Date: Mon, 21 Sep 2020 18:45:46 +0200
Subject: [PATCH 316/422] Made a mistake by changing the muon version of the
 ParticleCaloExtensionTool, affecting multiple other tools. This should only
 change the version used by the MuonCreatorTool.  (This was much easier to do
 with the new configuration.)

---
 .../MuonCombinedRecExample/python/MuonCombinedAlgs.py           | 2 ++
 .../python/MuonCombinedRecExampleConfigDb.py                    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py
index 4bfc65d950b6..955b15c1d02e 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py
@@ -175,6 +175,8 @@ class MuonCombinedReconstruction(ConfiguredMuonRec):
 
         # runs over outputs and create xAODMuon collection
         topSequence += getAlgorithm("MuonCreatorAlg")
+        # setting this here, in the new configuration it will be easier to do
+        topSequence.MuonCreatorAlg.MuonCreatorTool.ParticleCaloExtensionTool.StartFromPerigee=True
 
         if muonCombinedRecFlags.doMuGirl() and muonCombinedRecFlags.doMuGirlLowBeta():
             topSequence += getAlgorithm("StauCreatorAlg")
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
index 14fd62753504..a961d6ff4a81 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
@@ -50,7 +50,7 @@ addAlgorithm("MuonCombinedRecExample.MuonCombinedAlgs.StauCreatorAlg","StauCreat
 
 # tracking tools
 addTool("TrkTrackSummaryTool.AtlasTrackSummaryTool.AtlasTrackSummaryTool", "AtlasTrackSummaryTool" )
-addTool("Trk::ParticleCaloExtensionTool", "MuonParticleCaloExtensionTool", Extrapolator = "AtlasExtrapolator", StartFromPerigee = True)
+addTool("Trk::ParticleCaloExtensionTool", "MuonParticleCaloExtensionTool", Extrapolator = "AtlasExtrapolator")
 
 # put this here until it is set in the appropriate package
 addTool("MuonCombinedRecExample.MuonSegmentTaggerTools.MuTagMatchingTool","MuTagMatchingTool")
-- 
GitLab


From 9bedc53fed8595df2d02bf0b727da1a166c37125 Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Mon, 21 Sep 2020 09:53:59 -0700
Subject: [PATCH 317/422] Implement comments

---
 .../Root/MVAInputEvaluator.cxx                | 77 +++++++++----------
 .../Root/MVATrackVertexAssociationTool.cxx    | 57 ++++----------
 .../MVAInputEvaluator.h                       |  3 +-
 .../MVATrackVertexAssociationTool.h           | 17 ++--
 4 files changed, 62 insertions(+), 92 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
index 8de11d5a6eac..a2742eb20f70 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
@@ -231,7 +231,7 @@ public:
   FitWeight() {};
   ~FitWeight() override final {};
   float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
-    std::vector<const xAOD::TrackParticle*> fitTrks = toVector((const std::vector<ElementLink<xAOD::TrackParticleContainer>>&)vx.trackParticleLinks());
+    std::vector<const xAOD::TrackParticle*> fitTrks = toVector(vx.trackParticleLinks());
     float weight = 0.0;
     int pos = inVector(&trk, fitTrks);
     if (pos != -1) {
@@ -300,123 +300,123 @@ public:
 namespace CP {
 
 MVAInputEvaluator::~MVAInputEvaluator() {
-  this->clear();
+  clear();
 }
 
 void MVAInputEvaluator::add(const std::string& name, const MVAInputEvaluator::Input& type) {
   using Input = MVAInputEvaluator::Input;
-  for (auto it = m_evalMap.begin(); it != m_evalMap.end(); it++) {
-    if (name == it->first) {
+  for (const auto& kv : m_evalMap) {
+    if (name == kv.first) {
       throw std::runtime_error("ERROR in CP::MVAInputEvaluator::add : input name is already present in map: " + name);
     }
   }
   switch (type) {
     case Input::Pt: {
-      m_evalMap[name] = new ::Pt();
+      m_evalMap[name] = std::make_unique<::Pt>(::Pt());
       break;
     }
     case Input::Eta: {
-      m_evalMap[name] = new ::Eta();
+      m_evalMap[name] = std::make_unique<::Eta>(::Eta());
       break;
     }
     case Input::M: {
-      m_evalMap[name] = new ::M();
+      m_evalMap[name] = std::make_unique<::M>(::M());
       break;
     }
     case Input::D0: {
-      m_evalMap[name] = new ::D0();
+      m_evalMap[name] = std::make_unique<::D0>(::D0());
       break;
     }
     case Input::ErrD0: {
-      m_evalMap[name] = new ::ErrD0();
+      m_evalMap[name] = std::make_unique<::ErrD0>(::ErrD0());
       break;
     }
     case Input::Z0: {
-      m_evalMap[name] = new ::Z0();
+      m_evalMap[name] = std::make_unique<::Z0>(::Z0());
       break;
     }
     case Input::ErrZ0: {
-      m_evalMap[name] = new ::ErrZ0();
+      m_evalMap[name] = std::make_unique<::ErrZ0>(::ErrZ0());
       break;
     }
     case Input::Phi: {
-      m_evalMap[name] = new ::Phi();
+      m_evalMap[name] = std::make_unique<::Phi>(::Phi());
       break;
     }
     case Input::ErrPhi: {
-      m_evalMap[name] = new ::ErrPhi();
+      m_evalMap[name] = std::make_unique<::ErrPhi>(::ErrPhi());
       break;
     }
     case Input::Theta: {
-      m_evalMap[name] = new ::Theta();
+      m_evalMap[name] = std::make_unique<::Theta>(::Theta());
       break;
     }
     case Input::ErrTheta: {
-      m_evalMap[name] = new ::ErrTheta();
+      m_evalMap[name] = std::make_unique<::ErrTheta>(::ErrTheta());
       break;
     }
     case Input::QOverP: {
-      m_evalMap[name] = new ::QOverP();
+      m_evalMap[name] = std::make_unique<::QOverP>(::QOverP());
       break;
     }
     case Input::ErrQOverP: {
-      m_evalMap[name] = new ::ErrQOverP();
+      m_evalMap[name] = std::make_unique<::ErrQOverP>(::ErrQOverP());
       break;
     }
     case Input::ChiSq: {
-      m_evalMap[name] = new ::ChiSq();
+      m_evalMap[name] = std::make_unique<::ChiSq>(::ChiSq());
       break;
     }
     case Input::RedChiSq: {
-      m_evalMap[name] = new ::RedChiSq();
+      m_evalMap[name] = std::make_unique<::RedChiSq>(::RedChiSq());
       break;
     }
     case Input::D0Sig: {
-      m_evalMap[name] = new ::D0Sig();
+      m_evalMap[name] = std::make_unique<::D0Sig>(::D0Sig());
       break;
     }
     case Input::DZ: {
-      m_evalMap[name] = new ::DZ();
+      m_evalMap[name] = std::make_unique<::DZ>(::DZ());
       break;
     }
     case Input::ErrDZ: {
-      m_evalMap[name] = new ::ErrDZ();
+      m_evalMap[name] = std::make_unique<::ErrDZ>(::ErrDZ());
       break;
     }
     case Input::DZSinTheta: {
-      m_evalMap[name] = new ::DZSinTheta();
+      m_evalMap[name] = std::make_unique<::DZSinTheta>(::DZSinTheta());
       break;
     }
     case Input::ErrDZSinTheta: {
-      m_evalMap[name] = new ::ErrDZSinTheta();
+      m_evalMap[name] = std::make_unique<::ErrDZSinTheta>(::ErrDZSinTheta());
       break;
     }
     case Input::FitWeight: {
-      m_evalMap[name] = new ::FitWeight();
+      m_evalMap[name] = std::make_unique<::FitWeight>(::FitWeight());
       break;
     }
     case Input::VxX: {
-      m_evalMap[name] = new ::VxX();
+      m_evalMap[name] = std::make_unique<::VxX>(::VxX());
       break;
     }
     case Input::ErrVxX: {
-      m_evalMap[name] = new ::ErrVxX();
+      m_evalMap[name] = std::make_unique<::ErrVxX>(::ErrVxX());
       break;
     }
     case Input::VxY: {
-      m_evalMap[name] = new ::VxY();
+      m_evalMap[name] = std::make_unique<::VxY>(::VxY());
       break;
     }
     case Input::ErrVxY: {
-      m_evalMap[name] = new ::ErrVxY();
+      m_evalMap[name] = std::make_unique<::ErrVxY>(::ErrVxY());
       break;
     }
     case Input::VxZ: {
-      m_evalMap[name] = new ::VxZ();
+      m_evalMap[name] = std::make_unique<::VxZ>(::VxZ());
       break;
     }
     case Input::ErrVxZ: {
-      m_evalMap[name] = new ::ErrVxZ();
+      m_evalMap[name] = std::make_unique<::ErrVxZ>(::ErrVxZ());
       break;
     }
     default: {
@@ -427,27 +427,22 @@ void MVAInputEvaluator::add(const std::string& name, const MVAInputEvaluator::In
 }
 
 void MVAInputEvaluator::load(const MVAInputEvaluator::InputSelectionMap& selection) {
-  this->clear();
-  std::string k;
-  for (auto it = selection.begin(); it != selection.end(); it++) {
-    this->add(it->first, it->second);
+  clear();
+  for (const auto& kv : selection) {
+    add(kv.first, kv.second);
   }
   return;
 }
 
 void MVAInputEvaluator::eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt, std::map<std::string, double>& input) const {
   input.clear();
-  for (auto it = m_evalMap.begin(); it != m_evalMap.end(); it++) {
-    input[it->first] = it->second->eval(trk, vx, evt);
+  for (const auto& kv : m_evalMap) {
+    input[kv.first] = kv.second->eval(trk, vx, evt);
   }
   return;
 }
 
 void MVAInputEvaluator::clear() {
-  for (auto it = m_evalMap.begin(); it != m_evalMap.end(); it++) {
-    delete it->second;
-    it->second = nullptr;
-  }
   m_evalMap.clear();
   return;
 }
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
index 20398643027a..4ea6e7b3856d 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -14,8 +14,6 @@
 #include "PathResolver/PathResolver.h"
 
 #include "lwtnn/NNLayerConfig.hh"
-#include "lwtnn/LightweightNeuralNetwork.hh"
-#include "lwtnn/LightweightGraph.hh"
 #include "lwtnn/parse_json.hh"
 
 #include <fstream>
@@ -26,9 +24,7 @@ namespace CP {
 
 MVATrackVertexAssociationTool::MVATrackVertexAssociationTool(const std::string& name) :
   AsgTool(name)
-{
-  ;
-}
+{}
 
 StatusCode MVATrackVertexAssociationTool::initialize() {
 
@@ -38,9 +34,9 @@ StatusCode MVATrackVertexAssociationTool::initialize() {
   ATH_CHECK(m_eventInfo.initialize());
 
   // Init network
-  if (!this->initializeNetwork()) {
-    ATH_MSG_ERROR("Could not initialize network properly.");
-    return StatusCode::FAILURE;
+  StatusCode initNetworkStatus = initializeNetwork();
+  if (initNetworkStatus != StatusCode::SUCCESS) {
+    return initNetworkStatus;
   }
 
   // Map our working point to a cut on the MVA output discriminant
@@ -69,15 +65,7 @@ StatusCode MVATrackVertexAssociationTool::initialize() {
 }
 
 StatusCode MVATrackVertexAssociationTool::finalize() {
-
   ATH_MSG_INFO("Finalizing MVATrackVertexAssociationTool.");
-
-  // Finalize network
-  if (!this->finalizeNetwork()) {
-    ATH_MSG_ERROR("Could not finalize network properly.");
-    return StatusCode::FAILURE;
-  }
-
   return StatusCode::SUCCESS;
 }
 
@@ -144,7 +132,7 @@ xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getMatchMapIntern
 
   for (const auto& vertex : vx_list) {
     xAOD::TrackVertexAssociationList trktovxlist;
-    trktovxlist.clear();
+    trktovxlist.reserve(100);
     for (const auto& track : trk_list) {
       if (isCompatible(*track, *vertex)) {
         trktovxlist.push_back(track);
@@ -204,11 +192,12 @@ xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getUniqueMatchMap
   return trktovxmap;
 }
 
-bool MVATrackVertexAssociationTool::initializeNetwork() {
+StatusCode MVATrackVertexAssociationTool::initializeNetwork() {
 
   // Load our input evaluator
   if (m_inputNames.size() != m_inputTypes.size()) {
-    throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : size of input variable names (" + std::to_string(m_inputNames.size()) + ") does not equal size of input variable types (" + std::to_string(m_inputTypes.size()) + ").");
+    ATH_MSG_ERROR("Size of input variable names (" + std::to_string(m_inputNames.size()) + ") does not equal size of input variable types (" + std::to_string(m_inputTypes.size()) + ").");
+    return StatusCode::FAILURE;
   }
   m_inputMap.clear();
   for (size_t i = 0; i < m_inputNames.size(); i++) {
@@ -221,7 +210,8 @@ bool MVATrackVertexAssociationTool::initializeNetwork() {
   if (m_usePathResolver) {
     fileName = PathResolverFindCalibFile(m_fileName);
     if (fileName.empty()) {
-      throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : could not find input network file: " + m_fileName);
+      ATH_MSG_ERROR("Could not find input network file: " + m_fileName);
+      return StatusCode::FAILURE;
     }
   }
   else {
@@ -229,25 +219,27 @@ bool MVATrackVertexAssociationTool::initializeNetwork() {
   }
   std::ifstream netFile(fileName);
   if (!netFile) {
-    throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : could not properly open input network file: " + fileName);
+    ATH_MSG_ERROR("Could not properly open input network file: " + fileName);
+    return StatusCode::FAILURE;
   }
 
   // For sequential:
   if (m_isSequential) {
     lwt::JSONConfig netDef = lwt::parse_json(netFile);
-    m_network = new lwt::LightweightNeuralNetwork(netDef.inputs, netDef.layers, netDef.outputs);
+    m_network = std::move(std::unique_ptr<lwt::LightweightNeuralNetwork>(new lwt::LightweightNeuralNetwork(netDef.inputs, netDef.layers, netDef.outputs)));
   }
   // For functional:
   else {
     lwt::GraphConfig netDef = lwt::parse_json_graph(netFile);
     if (netDef.inputs.size() != 1) {
-      throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::initializeNetwork : network in file \"" + fileName + "\" has more than 1 input node: # of input nodes = " + std::to_string(netDef.inputs.size()));
+      ATH_MSG_ERROR("Network in file \"" + fileName + "\" has more than 1 input node: # of input nodes = " + std::to_string(netDef.inputs.size()));
+      return StatusCode::FAILURE;
     }
     m_inputNodeName = netDef.inputs[0].name;
-    m_graph = new lwt::LightweightGraph(netDef);
+    m_graph = std::move(std::unique_ptr<lwt::LightweightGraph>(new lwt::LightweightGraph(netDef)));
   }
 
-  return true;
+  return StatusCode::SUCCESS;
 }
 
 float MVATrackVertexAssociationTool::evaluateNetwork(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const {
@@ -272,19 +264,4 @@ float MVATrackVertexAssociationTool::evaluateNetwork(const xAOD::TrackParticle&
   return output[m_outputName];
 }
 
-bool MVATrackVertexAssociationTool::finalizeNetwork() {
-
-  // Clean-up
-  if (m_network) {
-    delete m_network;
-    m_network = nullptr;
-  }
-  if (m_graph) {
-    delete m_graph;
-    m_graph = nullptr;
-  }
-
-  return true;
-}
-
 } // namespace CP
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVAInputEvaluator.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVAInputEvaluator.h
index e8824880b3d3..741343fd6489 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVAInputEvaluator.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVAInputEvaluator.h
@@ -7,6 +7,7 @@
 
 #include <iterator>
 #include <map>
+#include <memory>
 #include <string>
 
 namespace CP {
@@ -59,7 +60,7 @@ public:
   // Defines the mapping of strings to Inputs:
   typedef std::map<std::string, Input> InputSelectionMap;
   // Defines the mapping of those same strings to MiniEvaluators:
-  typedef std::map<std::string, MiniEvaluator*> InputEvaluatorMap;
+  typedef std::map<std::string, std::unique_ptr<MiniEvaluator>> InputEvaluatorMap;
 
   void add(const std::string& name, const MVAInputEvaluator::Input& type);
   void load(const MVAInputEvaluator::InputSelectionMap& selection);
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
index ac99838d920a..d60f0d124bbb 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
@@ -18,16 +18,14 @@
 #include "xAODTracking/VertexFwd.h"
 #include "xAODTracking/VertexContainerFwd.h"
 
+#include "lwtnn/LightweightNeuralNetwork.hh"
+#include "lwtnn/LightweightGraph.hh"
+
 #include <map>
+#include <memory>
 #include <string>
 #include <vector>
 
-// Forward declarations
-namespace lwt {
-  class LightweightNeuralNetwork;
-  class LightweightGraph;
-}
-
 namespace CP {
 
 class MVATrackVertexAssociationTool : public asg::AsgTool, virtual public ITrackVertexAssociationTool
@@ -64,9 +62,8 @@ private:
   template <typename T>
   const xAOD::Vertex* getUniqueMatchVertexInternal(const xAOD::TrackParticle& trk, const T& vx_list) const;
 
-  bool initializeNetwork();
+  StatusCode initializeNetwork();
   float evaluateNetwork(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const;
-  bool finalizeNetwork();
 
   // Input lwtnn network file
   StringProperty m_fileName {this, "NetworkFileName", "", "Name of the input lwtnn network file."};
@@ -105,8 +102,8 @@ private:
   std::string m_inputNodeName = ""; //!
 
   // Network as implemented using lwtnn
-  lwt::LightweightNeuralNetwork* m_network = nullptr; //!
-  lwt::LightweightGraph*         m_graph   = nullptr; //!
+  std::unique_ptr<lwt::LightweightNeuralNetwork> m_network; //!
+  std::unique_ptr<lwt::LightweightGraph>         m_graph;   //!
 
 };
 
-- 
GitLab


From 50aae89f1a24cf1fd1799f4c5f1d51c7064ca3ed Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Mon, 21 Sep 2020 19:58:01 +0200
Subject: [PATCH 318/422] Fix trigger stream configuration (ATLASDQ-811,
 ATR-22076)

---
 .../TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py    | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py
index 9bb36266a578..14fd384f1e0a 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py
@@ -38,9 +38,8 @@ def TrigMuonMonitoringTool():
 
 
 def getTriggerStreamOfFile():
-	from PyUtils.MetaReaderPeeker import metadata
-	stag = metadata['triggerStreamOfFile']
-	return stag
+	from RecExConfig.RecFlags import rec
+	return rec.triggerStream()
 
 
 def setL2HypoTENames( HLTMuonMon, hltmonList):
-- 
GitLab


From a4ef2b43607bd4915acf51bf9acd994fa1b30c0a Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Mon, 21 Sep 2020 19:58:12 +0200
Subject: [PATCH 319/422] Fix Py2 prints

---
 .../InDetVertexMonitoring/run/Mon_topOptions.py               | 2 +-
 .../MuonDQAMonitoring/share/MuonDQAMonitoring_Tier0.py        | 2 +-
 .../MuonDQAMonitoring/share/MuonDQAMonitoring_jobOptions.py   | 4 ++--
 .../MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py      | 2 +-
 .../share/TrigT1CaloMonitoring_forRecExCommission_Run1.py     | 2 +-
 .../share/TrigT1CaloMonitoring_forRecExCommission_cpu.py      | 2 +-
 .../share/TrigT1Monitoring_forRecExCommission_cpu.py          | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/InDetVertexMonitoring/run/Mon_topOptions.py b/InnerDetector/InDetMonitoring/InDetVertexMonitoring/run/Mon_topOptions.py
index 050790e557b2..715351dadc3e 100644
--- a/InnerDetector/InDetMonitoring/InDetVertexMonitoring/run/Mon_topOptions.py
+++ b/InnerDetector/InDetMonitoring/InDetVertexMonitoring/run/Mon_topOptions.py
@@ -81,7 +81,7 @@ myVx.DoControlPlots = False
 myVx.OutputLevel = WARNING
 
 if not 'DQMonFlags' in dir():
-    print "DQMonFlags not yet imported - I import them now"
+    print("DQMonFlags not yet imported - I import them now")
     from AthenaMonitoring.DQMonFlags import DQMonFlags
 
 #DQMonFlags.useTrigger = False 
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_Tier0.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_Tier0.py
index c79b4612390d..2609022fc766 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_Tier0.py
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_Tier0.py
@@ -25,7 +25,7 @@ else:
 #--------------------------------------------------------------  
 
 if not 'DQMonFlags' in dir():
-   print "MuonDQAMonitoring_Tier0.py: DQMonFlags not yet imported - I import them now"
+   print("MuonDQAMonitoring_Tier0.py: DQMonFlags not yet imported - I import them now")
    from AthenaMonitoring.DQMonFlags import DQMonFlags
 
 if DQMonFlags.monManEnvironment() == 'tier0Raw':
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_jobOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_jobOptions.py
index 9e9428ffe70f..88bd322a3dea 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_jobOptions.py
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_jobOptions.py
@@ -17,7 +17,7 @@ from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
 
 if not 'MuonDQAFlags' in dir():
-    print "MuonDQAFlags.py: MuonDQAFlags not yet imported - I import them now"
+    print("MuonDQAFlags.py: MuonDQAFlags not yet imported - I import them now")
     from MuonDQAMonFlags.MuonDQAFlags import MuonDQAFlags as MuonDQAFlags
 
 #--------------------------------------------------------------  
@@ -31,7 +31,7 @@ else:
 MuonDQAFlags.doMuonMonitoring = True
  
 if not 'DQMonFlags' in dir():
-    print "DataQualityMon_RecExCommon_Flags_jobOptions.py: DQMonFlags not yet imported - I import them now"
+    print("DataQualityMon_RecExCommon_Flags_jobOptions.py: DQMonFlags not yet imported - I import them now")
     from AthenaMonitoring.DQMonFlags import DQMonFlags
     monEnv="tier0ESD"
 
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py
index adda051d091e..b1292dab253e 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py
@@ -4,7 +4,7 @@ from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
 isTier0Flag = not athenaCommonFlags.isOnline()
 
 if not 'MuonDQAFlags' in dir():
-    print "MuonDQAFlags.py: MuonDQAFlags not yet imported - I import them now"
+    print("MuonDQAFlags.py: MuonDQAFlags not yet imported - I import them now")
     from MuonDQAMonFlags.MuonDQAFlags import MuonDQAFlags as MuonDQAFlags
 
 mmRawMonMan = AthenaMonManager(name="MMRawMonManager",
diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py
index 3d3e33ca0ae7..f0c78923b0e1 100644
--- a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py
+++ b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py
@@ -5,7 +5,7 @@
 # @authors Johanna Fleckner, Andrea Neusiedl, Peter Faulkner
 #
 if not 'DQMonFlags' in dir():
-    print "TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now"
+    print("TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now")
     from AthenaMonitoring.DQMonFlags import DQMonFlags
     
 # On Tier0 select monitoring tools according to processing step
diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py
index 61c7dc8413d4..8f94f119c576 100644
--- a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py
+++ b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py
@@ -6,7 +6,7 @@
 # @author Peter Faulkner
 #
 if not 'DQMonFlags' in dir():
-    print "TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now"
+    print("TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now")
     from AthenaMonitoring.DQMonFlags import DQMonFlags
     
 # On Tier0 select monitoring tools according to processing step
diff --git a/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py b/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py
index 41a39a3e8078..2d758fc57c79 100644
--- a/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py
+++ b/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py
@@ -6,7 +6,7 @@
 #
 from AthenaCommon.GlobalFlags import globalflags
 if not 'DQMonFlags' in dir():
-    print "TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now"
+    print("TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now")
     from AthenaMonitoring.DQMonFlags import DQMonFlags
 
 # On Tier0 select monitoring tools according to processing step
-- 
GitLab


From 419d400edbd7e0b55fa62aff7990967541c07c14 Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Mon, 21 Sep 2020 11:15:13 -0700
Subject: [PATCH 320/422] Add lwtnn to public headers/link libraries

---
 .../InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
index 9b2828ed05b7..06f807baf05a 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
@@ -36,9 +36,9 @@ find_package( lwtnn REQUIRED )
 atlas_add_library( TrackVertexAssociationToolLib
    Root/*.cxx
    PUBLIC_HEADERS TrackVertexAssociationTool
-   PRIVATE_INCLUDE_DIRS ${LWTNN_INCLUDE_DIRS}
-   LINK_LIBRARIES AthContainers AthLinks AsgTools xAODCore xAODTracking AsgDataHandlesLib
-   PRIVATE_LINK_LIBRARIES xAODEventInfo PathResolver ${LWTNN_LIBRARIES} )
+   INCLUDE_DIRS ${LWTNN_INCLUDE_DIRS}
+   LINK_LIBRARIES AthContainers AthLinks AsgTools xAODCore xAODTracking AsgDataHandlesLib ${LWTNN_LIBRARIES}
+   PRIVATE_LINK_LIBRARIES xAODEventInfo PathResolver )
 
 if( NOT XAOD_STANDALONE )
    atlas_add_component( TrackVertexAssociationTool
-- 
GitLab


From 52399fe3948fd5481f978ffcc9cb5fa427094539 Mon Sep 17 00:00:00 2001
From: amete <serhanmete@gmail.com>
Date: Mon, 21 Sep 2020 21:00:46 +0200
Subject: [PATCH 321/422] Instead of Incidents PerfMonSvc now triggers event
 beginning/ending via AthMasterSeq

---
 .../PerfMonComps/src/PerfMonSvc.cxx           | 56 +++++++++----------
 1 file changed, 25 insertions(+), 31 deletions(-)

diff --git a/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonSvc.cxx b/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonSvc.cxx
index 5a91438576a7..c160ec3bcc04 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonSvc.cxx
+++ b/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonSvc.cxx
@@ -594,10 +594,6 @@ StatusCode PerfMonSvc::initialize()
     PMON_ERROR("Unable to get the IncidentSvc");
     return StatusCode::FAILURE;
   }
-  const long highestPriority = static_cast<long>(-1);
-  const long lowestPriority  = 0;
-  incSvc->addListener( this, IncidentType::BeginEvent, highestPriority );
-  incSvc->addListener( this, IncidentType::EndEvent,    lowestPriority );
   incSvc->addListener( this, IncidentType::SvcPostFinalize );
 
   // make sure the correct auditor is configured and running
@@ -853,33 +849,6 @@ void PerfMonSvc::handle( const Incident& inc )
     return;
   }
 
-  // Performing performance-monitoring for BeginEvent incident
-  if ( inc.type() == IncidentType::BeginEvent ) {
-    static bool s_firstEvt = true;
-    if ( s_firstEvt ) {
-      s_firstEvt = false;
-      stopAud( "ini", "PerfMonSlice" );
-      // capture the number of algorithms - here
-      ServiceHandle<IAlgManager> mgr("ApplicationMgr", this->name());
-      m_nalgs = mgr->getAlgorithms().size();
-      m_ntuple.comp["ini"].clear();
-      m_ntuple.comp["cbk"].clear();
-      m_ntuple.comp["preLoadProxies"].clear();
-    }
-    startAud( "evt", "PerfMonSlice" );
-    PMON_VERBOSE("[" << IncidentType::BeginEvent << "] handled");
-    return;
-  }
-
-  // Performing performance-monitoring for EndEvent incident
-  if ( inc.type() == IncidentType::EndEvent ) {
-    // make sure we update the data from declareInfo...
-    poll();
-    stopAud( "evt", "PerfMonSlice" );
-    PMON_VERBOSE("[" << IncidentType::EndEvent << "] handled");
-    return;
-  }
-
   return;
 }
 
@@ -1146,6 +1115,23 @@ do_msg_mon(int lvl,
 void PerfMonSvc::startAud( const std::string& stepName,
                            const std::string& compName )
 {
+  // Performing performance-monitoring for BeginEvent
+  if ( compName == "AthMasterSeq" && stepName == "evt" ) {
+    static bool s_firstEvt = true;
+    if ( s_firstEvt ) {
+      s_firstEvt = false;
+      stopAud( "ini", "PerfMonSlice" );
+      // capture the number of algorithms - here
+      ServiceHandle<IAlgManager> mgr("ApplicationMgr", this->name());
+      m_nalgs = mgr->getAlgorithms().size();
+      m_ntuple.comp["ini"].clear();
+      m_ntuple.comp["cbk"].clear();
+      m_ntuple.comp["preLoadProxies"].clear();
+    }
+    startAud( "evt", "PerfMonSlice" );
+    return;
+  }
+
   if (m_extraPrintouts) {
     double vmem,rss;
     PMonSD::get_vmem_rss_kb(vmem,rss);
@@ -1172,6 +1158,14 @@ void PerfMonSvc::startAud( const std::string& stepName,
 void PerfMonSvc::stopAud( const std::string& stepName,
                           const std::string& compName )
 {
+  // Performing performance-monitoring for EndEvent
+  if ( compName == "AthMasterSeq" && stepName == "evt" ) {
+    // make sure we update the data from declareInfo...
+    poll();
+    stopAud( "evt", "PerfMonSlice" );
+    return;
+  }
+
   if (m_pmonsd)
     m_pmonsd->stopAud(stepName,compName,m_nevts);
 
-- 
GitLab


From 2a888589c37d3f23cd3987889cebfef0845eeed9 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Mon, 21 Sep 2020 21:19:28 +0200
Subject: [PATCH 322/422] New ToF efficiency histograns and histograms output
 structure

---
 .../python/Run3AFPExampleMonitorAlgorithm.py   | 12 +++++++-----
 .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx  | 18 ++++++++++++++----
 2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index e09bd1c9318a..b512c4350d5a 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -40,7 +40,8 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPToFGroup.defineHistogram('lb,nTofHits', title='Multiplicity;lb;total number of Hits', type='TProfile', path='ToF/', xbins=1000, xmin=-0.5, xmax=999.5) 
     AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
     AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
-    AFPToFGroup.defineHistogram('barInTrainAll', title='Number of hits in bar per plane; barInTrain;hits',type='TH1F', path='ToF/HitsPerBarsInTrain', xbins=16, xmin=-0.5, xmax=15.5)
+    AFPToFGroup.defineHistogram('barInTrainAllA', title='Number of hits in bar per plane; barInTrain;hits',type='TH1F', path='ToF/HitsPerBarsInTrain', xbins=16, xmin=-0.5, xmax=15.5)
+    AFPToFGroup.defineHistogram('barInTrainAllC', title='Number of hits in bar per plane; barInTrain;hits',type='TH1F', path='ToF/HitsPerBarsInTrain', xbins=16, xmin=-0.5, xmax=15.5)
 
     # Using a map of groups
     layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
@@ -75,7 +76,8 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     
     arrayToF.defineHistogram('barInTrainID,trainID', title='ToF hit bar vs train {0};barInTrainID;trainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
     arrayToF = helper.addArray([trainList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
-    arrayToF.defineHistogram('barInTrainID', title='Total hits per bars in {}; barID; hits', type='TH1F', path='HitsPerBarsInTrain', xbins=4,xmin=-0.5,xmax=3.5)
+    arrayToF.defineHistogram('barInTrainIDA', title='Total hits per bars in {}; barID; hits', type='TH1F', path='HitsPerBarsInTrain/farAside', xbins=4,xmin=-0.5,xmax=3.5)
+    arrayToF.defineHistogram('barInTrainIDC', title='Total hits per bars in {}; barID; hits', type='TH1F', path='HitsPerBarsInTrain/farCside', xbins=4,xmin=-0.5,xmax=3.5)
     
     # Finalize. The return value should be a tuple of the ComponentAccumulator
     return helper.result()
@@ -94,9 +96,9 @@ if __name__=='__main__':
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
-    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000001.xAOD.root']
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000001.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000002.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput59-test.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput61-337371-449k.root'
     
     ConfigFlags.lock()
 
@@ -112,6 +114,6 @@ if __name__=='__main__':
     from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
     cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
-    cfg.run(5000)
+    cfg.run()
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index 17e3c625ab1e..8bf07a93bb17 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -48,7 +48,10 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 	auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
 	auto trainID = Monitored::Scalar<int>("trainID", 0); 
 	auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
-	auto barInTrainAll = Monitored::Scalar<int>("barInTrainAll", 0);
+	auto barInTrainAllA = Monitored::Scalar<int>("barInTrainAllA", 0);
+	auto barInTrainIDA = Monitored::Scalar<int>("barInTrainIDA", 0); 
+	auto barInTrainAllC = Monitored::Scalar<int>("barInTrainAllC", 0);
+	auto barInTrainIDC = Monitored::Scalar<int>("barInTrainIDC", 0); 
     
 	lb = GetEventInfo(ctx)->lumiBlock();
  
@@ -73,19 +76,26 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
 		{
 			numberOfHit_S0 = hitsItr->trainID();
 			fill("AFPToFTool", numberOfHit_S0);
+			
+			barInTrainIDA = hitsItr->barInTrainID();
+			fill(m_tools[m_TrainsToFGroup.at(m_trainsToF.at(hitsItr->trainID()))], barInTrainIDA);
+			barInTrainAllA = (hitsItr->trainID()*4)+barInTrainIDA;
+			fill("AFPToFTool", barInTrainAllA);
 		}
 		else if(hitsItr->isSideC())
 		{
 			numberOfHit_S3 = hitsItr->trainID();
 			fill("AFPToFTool", numberOfHit_S3);
+			
+			barInTrainIDC = hitsItr->barInTrainID();
+			fill(m_tools[m_TrainsToFGroup.at(m_trainsToF.at(hitsItr->trainID()))], barInTrainIDC);
+			barInTrainAllC = (hitsItr->trainID()*4)+barInTrainIDC;
+			fill("AFPToFTool", barInTrainAllC);
 		}
 
 		if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
 		{
 			fill(m_tools[m_StationNamesGroup.at(m_stationNamesToF.at(hitsItr->stationID()))], barInTrainID, trainID);
-			fill(m_tools[m_TrainsToFGroup.at(m_trainsToF.at(trainID))], barInTrainID);
-			barInTrainAll = (trainID*4)+barInTrainID;
-			fill("AFPToFTool", barInTrainAll);
 		}
 	}
 
-- 
GitLab


From f904e3c5b11dcc420ab0fc97071bcf2047598e8e Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Mon, 21 Sep 2020 20:27:28 +0100
Subject: [PATCH 323/422] GaussianSumFitter switch to unique_ptr in a few more
 places

---
 .../TrkGaussianSumFilter/GaussianSumFitter.h  |   9 +-
 .../src/GaussianSumFitter.cxx                 | 100 ++++++------------
 2 files changed, 39 insertions(+), 70 deletions(-)

diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h
index 5e29de448805..4d1492a70378 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h
@@ -114,14 +114,15 @@ private:
   const MultiComponentStateOnSurface* makePerigee(
     const EventContext& ctx,
     Trk::IMultiStateExtrapolator::Cache&,
-    const SmoothedTrajectory*,
+    const SmoothedTrajectory&,
     const ParticleHypothesis particleHypothesis = nonInteracting) const;
 
   //* Calculate the fit quality */
-  const Trk::FitQuality* buildFitQuality(const Trk::SmoothedTrajectory&) const;
+  std::unique_ptr<Trk::FitQuality> buildFitQuality(
+    const Trk::SmoothedTrajectory&) const;
 
   /** Gsf smoothe trajectory*/
-  SmoothedTrajectory* fit(
+  std::unique_ptr<SmoothedTrajectory> fit(
     const EventContext& ctx,
     Trk::IMultiStateExtrapolator::Cache&,
     const ForwardTrajectory&,
@@ -137,7 +138,7 @@ private:
     const EventContext& ctx,
     const Trk::TrackStateOnSurface* currentState,
     const Trk::CaloCluster_OnTrack* ccot,
-    Trk::SmoothedTrajectory* smoothedTrajectory) const;
+    Trk::SmoothedTrajectory& smoothedTrajectory) const;
 
   /** Forward GSF fit using PrepRawData */
   std::unique_ptr<ForwardTrajectory> fitPRD(
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
index 63b782bfba77..19e878182473 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
@@ -10,10 +10,10 @@
  */
 
 #include "TrkGaussianSumFilter/GaussianSumFitter.h"
-#include "TrkGaussianSumFilter/IMultiStateExtrapolator.h"
-#include "TrkGaussianSumFilter/MultiComponentStateCombiner.h"
 #include "TrkEventUtils/MeasurementBaseComparisonFunction.h"
 #include "TrkEventUtils/PrepRawDataComparisonFunction.h"
+#include "TrkGaussianSumFilter/IMultiStateExtrapolator.h"
+#include "TrkGaussianSumFilter/MultiComponentStateCombiner.h"
 #include "TrkParameters/TrackParameters.h"
 
 #include "TrkCaloCluster_OnTrack/CaloCluster_OnTrack.h"
@@ -286,52 +286,42 @@ Trk::GaussianSumFitter::fit(
   Trk::IMultiStateExtrapolator::Cache extrapolatorCache;
 
   // Perform GSF forwards fit
-  ForwardTrajectory* forwardTrajectory = fitPRD(ctx,
-                                                extrapolatorCache,
-                                                sortedPrepRawDataSet,
-                                                estimatedParametersNearOrigin,
-                                                particleHypothesis)
-                                           .release();
-
-  if (!forwardTrajectory) {
+  std::unique_ptr<ForwardTrajectory> forwardTrajectory =
+    fitPRD(ctx,
+           extrapolatorCache,
+           sortedPrepRawDataSet,
+           estimatedParametersNearOrigin,
+           particleHypothesis);
+
+  if (!forwardTrajectory || forwardTrajectory->empty()) {
     ATH_MSG_DEBUG("Forward GSF fit failed... Exiting!");
     ++m_ForwardFailure;
     return nullptr;
   }
 
-  if (forwardTrajectory->empty()) {
-    ATH_MSG_DEBUG("No states in forward trajectory... Exiting!");
-    ++m_ForwardFailure;
-    delete forwardTrajectory;
-    return nullptr;
-  }
-
   // Perform GSF smoother operation
-  SmoothedTrajectory* smoothedTrajectory =
+  std::unique_ptr<SmoothedTrajectory> smoothedTrajectory =
     fit(ctx, extrapolatorCache, *forwardTrajectory, particleHypothesis);
 
   // Protect against failed smoother fit
   if (!smoothedTrajectory) {
     ATH_MSG_DEBUG("Smoother GSF fit failed... Exiting!");
     ++m_SmootherFailure;
-    delete forwardTrajectory;
     return nullptr;
   }
 
   // Outlier m_logic and track finalisation
-  const FitQuality* fitQuality = buildFitQuality(*smoothedTrajectory);
+  std::unique_ptr<FitQuality> fitQuality = buildFitQuality(*smoothedTrajectory);
   if (!fitQuality) {
     ATH_MSG_DEBUG("Chi squared could not be calculated... Bailing");
     ++m_fitQualityFailure;
-    delete forwardTrajectory;
-    delete smoothedTrajectory;
     return nullptr;
   }
 
   if (m_makePerigee) {
     const Trk::MultiComponentStateOnSurface* perigeeMultiStateOnSurface =
       makePerigee(
-        ctx, extrapolatorCache, smoothedTrajectory, particleHypothesis);
+        ctx, extrapolatorCache, *smoothedTrajectory, particleHypothesis);
     ATH_MSG_DEBUG(
       "perigeeMultiStateOnSurface  :" << perigeeMultiStateOnSurface);
     if (perigeeMultiStateOnSurface) {
@@ -339,15 +329,10 @@ Trk::GaussianSumFitter::fit(
     } else {
       ATH_MSG_DEBUG("Perigee asked to be created but failed.....Exiting");
       ++m_PerigeeFailure;
-      delete smoothedTrajectory;
-      delete forwardTrajectory;
-      delete fitQuality;
       return nullptr;
     }
   }
 
-  // Delete forward trajectory. New memory was assigned in ForwardGsfFitter.
-  delete forwardTrajectory;
   // Reverse the order of the TSOS's to make be order flow from inside to out
   std::reverse(smoothedTrajectory->begin(), smoothedTrajectory->end());
 
@@ -358,14 +343,13 @@ Trk::GaussianSumFitter::fit(
     for (const Trk::TrackStateOnSurface* tsos : *smoothedTrajectory) {
       slimmedSmoothedTrajectory->push_back(new Trk::TrackStateOnSurface(*tsos));
     }
-    delete smoothedTrajectory;
     // Create new track
     Trk::TrackInfo info(Trk::TrackInfo::GaussianSumFilter, particleHypothesis);
     info.setTrackProperties(TrackInfo::BremFit);
     info.setTrackProperties(TrackInfo::BremFitSuccessful);
     ++m_fitSuccess;
     return std::make_unique<Track>(
-      info, slimmedSmoothedTrajectory.release(), fitQuality);
+      info, slimmedSmoothedTrajectory.release(), fitQuality.release());
   }
 
   // Create new track
@@ -373,7 +357,8 @@ Trk::GaussianSumFitter::fit(
   info.setTrackProperties(TrackInfo::BremFit);
   info.setTrackProperties(TrackInfo::BremFitSuccessful);
   ++m_fitSuccess;
-  return std::make_unique<Track>(info, smoothedTrajectory, fitQuality);
+  return std::make_unique<Track>(
+    info, smoothedTrajectory.release(), fitQuality.release());
 }
 
 /*
@@ -444,13 +429,12 @@ Trk::GaussianSumFitter::fit(
   Trk::IMultiStateExtrapolator::Cache extrapolatorCache;
 
   // Perform GSF forwards fit - new memory allocated in forwards fitter
-  ForwardTrajectory* forwardTrajectory =
+  std::unique_ptr<ForwardTrajectory> forwardTrajectory =
     fitMeasurements(ctx,
                     extrapolatorCache,
                     sortedMeasurementSet,
                     estimatedParametersNearOrigin,
-                    particleHypothesis)
-      .release();
+                    particleHypothesis);
 
   if (!forwardTrajectory) {
     ATH_MSG_DEBUG("Forward GSF fit failed... Exiting!");
@@ -460,39 +444,35 @@ Trk::GaussianSumFitter::fit(
 
   if (forwardTrajectory->empty()) {
     ATH_MSG_DEBUG("No states in forward trajectory... Exiting!");
-    delete forwardTrajectory;
     ++m_ForwardFailure;
     return nullptr;
   }
 
   // Perform GSF smoother operation
 
-  SmoothedTrajectory* smoothedTrajectory =
+  std::unique_ptr<SmoothedTrajectory> smoothedTrajectory =
     fit(ctx, extrapolatorCache, *forwardTrajectory, particleHypothesis, ccot);
 
   // Protect against failed smoother fit
   if (!smoothedTrajectory) {
     ATH_MSG_DEBUG("Smoother GSF fit failed... Exiting!");
     ++m_SmootherFailure;
-    delete forwardTrajectory;
     return nullptr;
   }
 
   // Outlier m_logic and track finalisation
-  const FitQuality* fitQuality = buildFitQuality(*smoothedTrajectory);
+  std::unique_ptr<FitQuality> fitQuality = buildFitQuality(*smoothedTrajectory);
 
   if (!fitQuality) {
     ATH_MSG_DEBUG("Chi squared could not be calculated... Bailing");
     ++m_fitQualityFailure;
-    delete forwardTrajectory;
-    delete smoothedTrajectory;
     return nullptr;
   }
 
   if (m_makePerigee) {
     const Trk::MultiComponentStateOnSurface* perigeeMultiStateOnSurface =
       makePerigee(
-        ctx, extrapolatorCache, smoothedTrajectory, particleHypothesis);
+        ctx, extrapolatorCache, *smoothedTrajectory, particleHypothesis);
     ATH_MSG_DEBUG(
       "perigeeMultiStateOnSurface  :" << perigeeMultiStateOnSurface);
 
@@ -501,16 +481,10 @@ Trk::GaussianSumFitter::fit(
     } else {
       ATH_MSG_DEBUG("Perigee asked to be created but failed.....Exiting");
       ++m_PerigeeFailure;
-      delete fitQuality;
-      delete forwardTrajectory;
-      delete smoothedTrajectory;
       return nullptr;
     }
   }
 
-  // Delete forward trajectory. New memory was assigned in ForwardGsfFitter.
-  delete forwardTrajectory;
-
   // Reverse the order of the TSOS's to make be order flow from inside to out
   std::reverse(smoothedTrajectory->begin(), smoothedTrajectory->end());
 
@@ -521,14 +495,13 @@ Trk::GaussianSumFitter::fit(
     for (const Trk::TrackStateOnSurface* tsos : *smoothedTrajectory) {
       slimmedSmoothedTrajectory->push_back(new Trk::TrackStateOnSurface(*tsos));
     }
-    delete smoothedTrajectory;
     // Create new track
     Trk::TrackInfo info(Trk::TrackInfo::GaussianSumFilter, particleHypothesis);
     info.setTrackProperties(TrackInfo::BremFit);
     info.setTrackProperties(TrackInfo::BremFitSuccessful);
     ++m_fitSuccess;
     return std::make_unique<Track>(
-      info, slimmedSmoothedTrajectory.release(), fitQuality);
+      info, slimmedSmoothedTrajectory.release(), fitQuality.release());
   }
 
   // Create new track
@@ -536,7 +509,8 @@ Trk::GaussianSumFitter::fit(
   info.setTrackProperties(TrackInfo::BremFit);
   info.setTrackProperties(TrackInfo::BremFitSuccessful);
   ++m_fitSuccess;
-  return std::make_unique<Track>(info, smoothedTrajectory, fitQuality);
+  return std::make_unique<Track>(
+    info, smoothedTrajectory.release(), fitQuality.release());
 }
 
 std::unique_ptr<Trk::Track>
@@ -696,14 +670,14 @@ const Trk::MultiComponentStateOnSurface*
 Trk::GaussianSumFitter::makePerigee(
   const EventContext& ctx,
   Trk::IMultiStateExtrapolator::Cache& extrapolatorCache,
-  const Trk::SmoothedTrajectory* smoothedTrajectory,
+  const Trk::SmoothedTrajectory& smoothedTrajectory,
   const Trk::ParticleHypothesis particleHypothesis) const
 {
 
   // Propagate track to perigee
   const Trk::PerigeeSurface perigeeSurface;
   const Trk::TrackStateOnSurface* stateOnSurfaceNearestOrigin =
-    smoothedTrajectory->back();
+    smoothedTrajectory.back();
   const Trk::MultiComponentStateOnSurface*
     multiComponentStateOnSurfaceNearestOrigin = nullptr;
 
@@ -782,27 +756,23 @@ Trk::GaussianSumFitter::makePerigee(
   return perigeeMultiStateOnSurface;
 }
 
-const Trk::FitQuality*
+std::unique_ptr<Trk::FitQuality>
 Trk::GaussianSumFitter::buildFitQuality(
   const Trk::SmoothedTrajectory& smoothedTrajectory) const
 {
 
   double chiSquared = 0.;
   int numberDoF = -5;
-
   // Loop over all TrackStateOnSurface objects in trajectory
   SmoothedTrajectory::const_iterator stateOnSurface =
     smoothedTrajectory.begin();
-
   for (; stateOnSurface != smoothedTrajectory.end(); ++stateOnSurface) {
-
     if (!(*stateOnSurface)->type(TrackStateOnSurface::Measurement)) {
       continue;
     }
     if ((*stateOnSurface)->fitQualityOnSurface() == nullptr) {
       continue;
     }
-
     chiSquared += (*stateOnSurface)->fitQualityOnSurface()->chiSquared();
     numberDoF += (*stateOnSurface)->fitQualityOnSurface()->numberDoF();
   }
@@ -811,9 +781,7 @@ Trk::GaussianSumFitter::buildFitQuality(
     return nullptr;
   }
 
-  const FitQuality* fitQuality = new FitQuality(chiSquared, numberDoF);
-
-  return fitQuality;
+  return std::make_unique<FitQuality>(chiSquared, numberDoF);
 }
 
 /*
@@ -1083,7 +1051,7 @@ Trk::GaussianSumFitter::stepForwardFit(
   return true;
 }
 
-Trk::SmoothedTrajectory*
+std::unique_ptr<Trk::SmoothedTrajectory>
 Trk::GaussianSumFitter::fit(
   const EventContext& ctx,
   Trk::IMultiStateExtrapolator::Cache& extrapolatorCache,
@@ -1384,14 +1352,14 @@ Trk::GaussianSumFitter::fit(
       if (ccot && trackStateOnSurface == secondLastTrackStateOnSurface) {
 
         Trk::MultiComponentState ccotState =
-          addCCOT(ctx, updatedStateOnSurface, ccot, smoothedTrajectory.get());
+          addCCOT(ctx, updatedStateOnSurface, ccot, *smoothedTrajectory);
         if (!ccotState.empty()) {
           updatedState = std::move(ccotState);
         }
       }
     }
   } // End for loop over all components
-  return smoothedTrajectory.release();
+  return smoothedTrajectory;
 }
 
 Trk::MultiComponentState
@@ -1497,7 +1465,7 @@ Trk::GaussianSumFitter::addCCOT(
   const EventContext& ctx,
   const Trk::TrackStateOnSurface* currentState,
   const Trk::CaloCluster_OnTrack* ccot,
-  Trk::SmoothedTrajectory* smoothedTrajectory) const
+  Trk::SmoothedTrajectory& smoothedTrajectory) const
 {
 
   const Trk::MultiComponentStateOnSurface* currentMultiStateOS = nullptr;
@@ -1594,8 +1562,8 @@ Trk::GaussianSumFitter::addCCOT(
       combinedState.release(),
       MultiComponentStateHelpers::clone(extrapolatedState).release(),
       combinedFitQuality.release());
-  smoothedTrajectory->push_back(updatedMCSOS);
-  smoothedTrajectory->push_back(finalSOS);
+  smoothedTrajectory.push_back(updatedMCSOS);
+  smoothedTrajectory.push_back(finalSOS);
 
   return extrapolatedState;
 }
-- 
GitLab


From 1fd086606fcff87636c7ed0503fddbec7aadf415 Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Mon, 21 Sep 2020 14:35:29 -0500
Subject: [PATCH 324/422] replace CP::ISelectionTool with IAsgSelectionTool

We somehow ended up with two copies of the same interface class.  The
problem with having two interfaces for the same task was that tools
implementing the different interfaces could not be used
interchangeably.  That specifically broke the configuration of some of
the common CP algorithm sequences, which use the same algorithm class
for all selection tools.

I was somewhat torn between which of the two classes to keep, and
while I originally wanted to keep `CP::ISelectionTool`, it turned out
that `IAsgSelectionTool` was much easier to keep.  That is because the
`AcceptInfo` and `AcceptData` classes are in the same package as the
interface class, and anybody who wants to use or implement that
interface will need those two classes as well.

One could potentially move all three classes together to
AsgAnalysisInterfaces if that is considered advantageous, but that
would be a bigger undertaking and they would all have to be moved
together.
---
 .../InDetSecVtxTrackSelectionTool.h           |  2 +-
 .../IInDetTrackSelectionTool.h                |  4 +-
 .../InDetTrackSelectionTool.h                 |  2 +-
 .../AsgElectronIsEMSelector.h                 |  2 +-
 .../AsgElectronLikelihoodTool.h               |  2 +-
 .../AsgForwardElectronIsEMSelector.h          |  2 +-
 .../AsgPhotonIsEMSelector.h                   |  2 +-
 .../AsgAnalysisInterfacesDict.h               |  1 -
 .../AsgAnalysisInterfaces/ISelectionTool.h    | 66 -------------------
 .../AsgAnalysisInterfaces/selection.xml       |  1 -
 .../IAsgEGammaIsEMSelector.h                  |  8 +--
 .../IAsgElectronChargeIDSelectorTool.h        |  8 +--
 .../IAsgElectronLikelihoodTool.h              |  8 +--
 .../IAsgElectronMultiLeptonSelector.h         |  8 +--
 .../egamma/egammaTools/src/EMPIDBuilder.h     |  2 +-
 15 files changed, 25 insertions(+), 93 deletions(-)
 delete mode 100644 PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/ISelectionTool.h

diff --git a/InnerDetector/InDetRecTools/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool.h
index c6f3291b1d10..7909befc4727 100644
--- a/InnerDetector/InDetRecTools/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool.h
@@ -39,7 +39,7 @@ namespace InDet {
 
     /// Create a proper constructor for Athena
     ASG_TOOL_CLASS2( InDetSecVtxTrackSelectionTool,
-		     CP::ISelectionTool,
+		     IAsgSelectionTool,
 		     InDet::IInDetTrackSelectionTool )
     
   public:
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/IInDetTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/IInDetTrackSelectionTool.h
index 1a92b89c762b..773d9ca21295 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/IInDetTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/IInDetTrackSelectionTool.h
@@ -8,7 +8,7 @@
 #define INDETTRACKSELECTIONTOOL_IINDETTRACKSELECTIONTOOL_H
 
 // Framework include(s):
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
+#include "PATCore/IAsgSelectionTool.h"
 #include "PATCore/AcceptData.h"
 #include "PATCore/AcceptInfo.h"
 
@@ -48,7 +48,7 @@ namespace InDet {
   /// @author Michael Clark <michael.ryan.clark@cern.ch>
   /// 
   ///
-  class IInDetTrackSelectionTool : public virtual CP::ISelectionTool
+  class IInDetTrackSelectionTool : public virtual IAsgSelectionTool
 { 
     /// Declare the interface that the class provides
     ASG_TOOL_INTERFACE( InDet::IInDetTrackSelectionTool )
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/InDetTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/InDetTrackSelectionTool.h
index 26cb7d809678..f29f13432283 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/InDetTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/InDetTrackSelectionTool.h
@@ -40,7 +40,7 @@ namespace InDet {
 
     /// Create a proper constructor for Athena
     ASG_TOOL_CLASS2( InDetTrackSelectionTool,
-		     CP::ISelectionTool,
+		     IAsgSelectionTool,
 		     InDet::IInDetTrackSelectionTool )
     
   public:
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h
index 97044e4e07a5..b964df708a5a 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h
@@ -39,7 +39,7 @@ class AsgElectronIsEMSelector :  public asg::AsgTool,
 {
 
   ASG_TOOL_CLASS3(AsgElectronIsEMSelector, IAsgElectronIsEMSelector,
-		  IAsgEGammaIsEMSelector, CP::ISelectionTool)
+		  IAsgEGammaIsEMSelector, IAsgSelectionTool)
 
   public:
   /** Standard constructor */
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h
index 5cedcbe49b91..09b86500901e 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h
@@ -27,7 +27,7 @@ namespace Root{
 class AsgElectronLikelihoodTool : public asg::AsgTool, 
 				  virtual public IAsgElectronLikelihoodTool
 {
-  ASG_TOOL_CLASS2(AsgElectronLikelihoodTool, IAsgElectronLikelihoodTool, CP::ISelectionTool)
+  ASG_TOOL_CLASS2(AsgElectronLikelihoodTool, IAsgElectronLikelihoodTool, IAsgSelectionTool)
 
 public:
   /** Standard constructor */
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h
index 9dcc1f33bc55..2bb1a3a9bb22 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h
@@ -42,7 +42,7 @@ class AsgForwardElectronIsEMSelector : public asg::AsgTool,
 {
 
   ASG_TOOL_CLASS3(AsgForwardElectronIsEMSelector, IAsgForwardElectronIsEMSelector,
-		  IAsgEGammaIsEMSelector, CP::ISelectionTool)
+		  IAsgEGammaIsEMSelector, IAsgSelectionTool)
 
   public:
   /** Standard constructor */
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h
index 24d90cbdb3fb..e6bed435ecaf 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h
@@ -39,7 +39,7 @@ class AsgPhotonIsEMSelector : public asg::AsgTool,
 
 {
   ASG_TOOL_CLASS3(AsgPhotonIsEMSelector, IAsgPhotonIsEMSelector,
-		  IAsgEGammaIsEMSelector, CP::ISelectionTool)
+		  IAsgEGammaIsEMSelector, IAsgSelectionTool)
 
   public:
 
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h
index 441fcfa14dc5..21f21bd13040 100644
--- a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h
+++ b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h
@@ -11,7 +11,6 @@
 // Local include(s):
 #include "AsgAnalysisInterfaces/IClassificationTool.h"
 #include "AsgAnalysisInterfaces/IEfficiencyScaleFactorTool.h"
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
 #include "AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h"
 #include "AsgAnalysisInterfaces/IObservableTool.h"
 #include "AsgAnalysisInterfaces/IPileupReweightingTool.h"
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/ISelectionTool.h b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/ISelectionTool.h
deleted file mode 100644
index cff312a53a75..000000000000
--- a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/ISelectionTool.h
+++ /dev/null
@@ -1,66 +0,0 @@
-///////////////////////// -*- C++ -*- /////////////////////////////
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// IAsgSelectionTool.h 
-// Header file for class IAsgSelectionTool
-// Author: Karsten Koeneke <karsten.koeneke@cern.ch>
-/////////////////////////////////////////////////////////////////// 
-#ifndef ASGANALYSISINTERFACES_IASGMTSELECTIONTOOL_H
-#define ASGANALYSISINTERFACES_IASGMTSELECTIONTOOL_H
-
-// STL includes
-
-
-// FrameWork includes
-#include <AsgTools/IAsgTool.h>
-
-namespace asg {
-  class AcceptInfo;
-  class AcceptData;
-}
-
-// Forward declaration
-namespace xAOD{
-  class IParticle;
-}
-
-namespace CP {
-
-  class ISelectionTool
-    : virtual public asg::IAsgTool
-  { 
-    /// Declare the interface ID for this pure-virtual interface class to the Athena framework
-    ASG_TOOL_INTERFACE(ISelectionTool)
-
-
-    /////////////////////////////////////////////////////////////////// 
-    // Public methods: 
-    /////////////////////////////////////////////////////////////////// 
-    public: 
-
-    /////////////////////////////////////////////////////////////////// 
-    // Const methods: 
-    ///////////////////////////////////////////////////////////////////
-
-    /** Method to get the plain AcceptInfo.
-        This is needed so that one can already get the AcceptInfo 
-        and query what cuts are defined before the first object 
-        is passed to the tool. */
-    virtual const asg::AcceptInfo& getAcceptInfo() const = 0;
-
-    /** Backward compatibility method */
-    [[deprecated("please use getAcceptInfo() instead")]]
-    inline const asg::AcceptInfo& getTAccept () const {
-      return getAcceptInfo();};
-
-    /** The main accept method: the actual cuts are applied here */
-    virtual asg::AcceptData accept( const xAOD::IParticle* /*part*/ ) const = 0;
-
-
-  }; 
-}
-
-#endif //> !PATCORE_IASGSELECTIONTOOL_H
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/selection.xml b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/selection.xml
index dd85df090701..4272830e0d79 100644
--- a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/selection.xml
+++ b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/selection.xml
@@ -3,7 +3,6 @@
   <namespace name="CP"/>
   <class name="CP::IClassificationTool" />
   <class name="CP::IEfficiencyScaleFactorTool" />
-  <class name="CP::ISelectionTool" />
   <class name="CP::IPileupReweightingTool" />
   <class name="IGoodRunsListSelectionTool" />
   <class name="IObservableTool" />
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h
index b1da503644a3..949abe831a10 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h
@@ -18,24 +18,24 @@
 */
 
 // Include the interfaces
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
+#include "PATCore/IAsgSelectionTool.h"
 #include "xAODEgamma/EgammaFwd.h"
 #include "xAODEgamma/PhotonFwd.h"
 #include "xAODEgamma/ElectronFwd.h"
 
 class EventContext;
 
-class IAsgEGammaIsEMSelector : virtual public CP::ISelectionTool
+class IAsgEGammaIsEMSelector : virtual public IAsgSelectionTool
 {
 
   ASG_TOOL_INTERFACE(IAsgEGammaIsEMSelector)
 
 public:
 
-  /// @name IAsgEGammaIsEMSelector methods in Addition to the ISelectionTool
+  /// @name IAsgEGammaIsEMSelector methods in Addition to the IAsgSelectionTool
   /// @{
 
-  /// accept with pointer to  IParticle  so as to not hide the ISelectionTool one
+  /// accept with pointer to  IParticle  so as to not hide the IAsgSelectionTool one
   virtual asg::AcceptData accept( const xAOD::IParticle* part ) const = 0;
   virtual asg::AcceptData accept( const EventContext& ctx, const xAOD::IParticle* part ) const = 0;
 
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronChargeIDSelectorTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronChargeIDSelectorTool.h
index d39775c815e8..da1817cb6778 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronChargeIDSelectorTool.h
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronChargeIDSelectorTool.h
@@ -14,23 +14,23 @@
 */
 
 // Include the interfaces
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
+#include "PATCore/IAsgSelectionTool.h"
 #include "xAODEgamma/ElectronFwd.h"
 #include "xAODEgamma/EgammaFwd.h"
 #include "GaudiKernel/EventContext.h"
 
-class IAsgElectronChargeIDSelectorTool : virtual public CP::ISelectionTool
+class IAsgElectronChargeIDSelectorTool : virtual public IAsgSelectionTool
 {
 
   ASG_TOOL_INTERFACE(IAsgElectronChargeIDSelectorTool)
 
  public:
 
-  /// @name IAsgElectronChargeIDSelectorTool  methods in Addition to the ISelectionTool ones
+  /// @name IAsgElectronChargeIDSelectorTool  methods in Addition to the IAsgSelectionTool ones
   /// Some are there to mainly support the calls done from the online/Trigger side 
   /// @{
 
-  /// accept with pointer to  IParticle  so as to not hide the ISelectionTool one
+  /// accept with pointer to  IParticle  so as to not hide the IAsgSelectionTool one
   virtual asg::AcceptData accept( const xAOD::IParticle* part ) const = 0;
   /// accept method with pointer to electron 
   virtual asg::AcceptData accept( const xAOD::Electron* part ) const = 0;
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h
index 541d726d71a1..384ae2e08318 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h
@@ -15,24 +15,24 @@
 */
 
 // Include the interfaces
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
+#include "PATCore/IAsgSelectionTool.h"
 #include "xAODEgamma/ElectronFwd.h"
 #include "xAODEgamma/EgammaFwd.h"
 
 class EventContext;
 
-class IAsgElectronLikelihoodTool : virtual public CP::ISelectionTool
+class IAsgElectronLikelihoodTool : virtual public IAsgSelectionTool
 {
 
   ASG_TOOL_INTERFACE(IAsgElectronLikelihoodTool)
 
  public:
 
-  /// @name IAsgElectronLikelihoodTool  methods in Addition to the ISelectionTool ones
+  /// @name IAsgElectronLikelihoodTool  methods in Addition to the IAsgSelectionTool ones
   /// Some are there to mainly support the calls done from the online/Trigger side 
   /// @{
 
-  /// accept with pointer to  IParticle  so as to not hide the ISelectionTool one
+  /// accept with pointer to  IParticle  so as to not hide the IAsgSelectionTool one
   virtual asg::AcceptData accept( const xAOD::IParticle* part ) const = 0;
   virtual asg::AcceptData accept( const EventContext& ctx, const xAOD::IParticle* part ) const = 0;
   /// accept method with pointer to electron 
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h
index 2cf4643eaa5b..1a0fd9ff7b59 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h
@@ -13,20 +13,20 @@
 
 */
 // Include the interfaces
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
+#include "PATCore/IAsgSelectionTool.h"
 #include "xAODEgamma/ElectronFwd.h"
 
-class IAsgElectronMultiLeptonSelector : virtual public CP::ISelectionTool
+class IAsgElectronMultiLeptonSelector : virtual public IAsgSelectionTool
 {
 
   ASG_TOOL_INTERFACE(IAsgElectronMultiLeptonSelector)
 
 public:
 
-  /// @name IAsgElectronMultiLeptonSelector methods in addition to the ISelectionTool ones
+  /// @name IAsgElectronMultiLeptonSelector methods in addition to the IAsgSelectionTool ones
   ///{@
 
-  /// accept with pointer to  IParticle  so as to not hide the ISelectionTool one
+  /// accept with pointer to  IParticle  so as to not hide the IAsgSelectionTool one
   virtual asg::AcceptData accept( const xAOD::IParticle* part ) const = 0;
 
   /// accept method with pointer to electron */
diff --git a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h
index cd7e7798891f..8ff922000e33 100644
--- a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h
+++ b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h
@@ -69,7 +69,7 @@ private:
     "The selector result names"
   };
 
-  ToolHandleArray<CP::ISelectionTool> m_genericIsEMselectors{
+  ToolHandleArray<IAsgSelectionTool> m_genericIsEMselectors{
     this,
     "genericIsEMselectors",
     {},
-- 
GitLab


From fac025a5e7857b33ce52471656a3f2258df548eb Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Mon, 21 Sep 2020 01:20:57 +0200
Subject: [PATCH 325/422] InDetRecExample: Conditions dependency fix.

If NnClusterizationFactory.useTTrainedNetworks is set, then we should
also clear NnClusterizationFactory.NnCollectionJSONReadKey,
to prevent having a spurious conditions dependency.
---
 .../InDetExample/InDetRecExample/python/TrackingCommon.py       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
index 082a8dcb2f97..b143f5df1412 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
@@ -362,7 +362,7 @@ def getNnClusterizationFactory(name='NnClusterizationFactory', **kwargs) :
                           useTTrainedNetworks                = useTTrainedNetworks,
                           NnCollectionReadKey                = 'PixelClusterNN',
                           NnCollectionWithTrackReadKey       = 'PixelClusterNNWithTrack',
-                          NnCollectionJSONReadKey            = 'PixelClusterNNJSON')
+                          NnCollectionJSONReadKey            = '' if useTTrainedNetworks else 'PixelClusterNNJSON')
     return InDet__NnClusterizationFactory(name=the_name, **kwargs)
 
 @makePublicTool
-- 
GitLab


From e671039afbb5d916e5b2f4cf31751acc32ed587e Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 21 Sep 2020 22:06:43 +0200
Subject: [PATCH 326/422] Fix typos in ISF_ServicesConfig.py and
 ISF_ServicesConfigNew.py

A few copy-paste errors made it into `ISF_ServicesConfig.py` and
`ISF_ServicesConfigNew.py` as part of !35630. The fix was to
replace:
```
AtlasRegion = ROOT.AtlasDetDescr
```
with
```
AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
```
Should fix ATLASSIM-4776.
---
 .../ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py  | 6 +++---
 .../ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py   | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py
index 464c668b7a4b..185d371fab45 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py
+++ b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py
@@ -164,7 +164,7 @@ def getMC12LLPTruthService(name="ISF_MC12TruthLLPService", **kwargs):
 
 
 def getMC12PlusTruthService(name="ISF_MC12PlusTruthService", **kwargs):
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
     kwargs.setdefault('ForceEndVtxInRegions', [AtlasRegion.fAtlasID] )
     return getMC12TruthService(name, **kwargs)
 
@@ -190,7 +190,7 @@ def getMC15MSTruthStrategies():
 
 
 def getMC15TruthService(name="ISF_MC15TruthService", **kwargs):
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
     kwargs.setdefault('TruthStrategies', ['ISF_MCTruthStrategyGroupID_MC15',
                                           'ISF_MCTruthStrategyGroupIDHadInt_MC15',
                                           'ISF_MCTruthStrategyGroupCaloMuBrem', #FIXME this should be ISF_MCTruthStrategyGroupCaloMuBrem_MC15!!
@@ -207,7 +207,7 @@ def getMC15aTruthService(name="ISF_MC15aTruthService", **kwargs):
 
 
 def getMC15aPlusTruthService(name="ISF_MC15aPlusTruthService", **kwargs):
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
     kwargs.setdefault('ForceEndVtxInRegions', [AtlasRegion.fAtlasID])
     return getMC15TruthService(name, **kwargs)
 
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py
index 10a5e25c35d5..d791a274b2a6 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py
+++ b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py
@@ -217,7 +217,7 @@ def MC12LLPTruthServiceCfg(ConfigFlags, name="ISF_MC12TruthLLPService", **kwargs
 
 
 def MC12PlusTruthServiceCfg(ConfigFlags, name="ISF_MC12PlusTruthService", **kwargs):
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
     kwargs.setdefault("ForceEndVtxInRegions", [AtlasRegion.fAtlasID] )
     return MC12TruthServiceCfg(ConfigFlags, name, **kwargs)
 
@@ -240,7 +240,7 @@ def MC15MSTruthStrategies():
 
 def MC15TruthServiceCfg(ConfigFlags, name="ISF_MC15TruthService", **kwargs):
     result = ComponentAccumulator()
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
 
     if "TruthStrategies" not in kwargs:
         truthCfgs = [
@@ -267,7 +267,7 @@ def MC15aTruthServiceCfg(ConfigFlags, name="ISF_MC15aTruthService", **kwargs):
 
 
 def MC15aPlusTruthServiceCfg(ConfigFlags, name="ISF_MC15aPlusTruthService", **kwargs):
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
 
     kwargs.setdefault("ForceEndVtxInRegions", [AtlasRegion.fAtlasID])
     result = MC15TruthServiceCfg(ConfigFlags, name, **kwargs)
-- 
GitLab


From 95a40a0d7cf28f24c6718ecf49a89b07358c4b21 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 16 Sep 2020 13:54:52 -0400
Subject: [PATCH 327/422] InDetTrigRecExample: Fix python 3.8 warnings.

Don't use `is' with string literal.
---
 .../python/InDetTrigConfigRecLoadTools.py     | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
index 8cdd29a1ce71..b6b7ddd76e5d 100755
--- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
+++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
@@ -225,11 +225,11 @@ if InDetTrigFlags.loadRotCreator():
 #
 if InDetTrigFlags.loadUpdator():
    
-  if InDetTrigFlags.kalmanUpdator() is "fast" :
+  if InDetTrigFlags.kalmanUpdator() == "fast" :
     # fast Kalman updator tool
     from TrkMeasurementUpdator_xk.TrkMeasurementUpdator_xkConf import Trk__KalmanUpdator_xk
     InDetTrigUpdator = Trk__KalmanUpdator_xk(name = 'InDetTrigUpdator')
-  elif InDetTrigFlags.kalmanUpdator() is "weight" :
+  elif InDetTrigFlags.kalmanUpdator() == "weight" :
     from TrkMeasurementUpdator.TrkMeasurementUpdatorConf import Trk__KalmanWeightUpdator as ConfiguredWeightUpdator
     InDetTrigUpdator = ConfiguredWeightUpdator(name='InDetTrigUpdator')
   else :
@@ -241,7 +241,7 @@ if InDetTrigFlags.loadUpdator():
     print (     InDetTrigUpdator)
 
   # ---------- control loading of the gsf updator
-  if InDetTrigFlags.trackFitterType() is 'GaussianSumFilter' :
+  if InDetTrigFlags.trackFitterType() == 'GaussianSumFilter' :
     # Load the Gsf Measurement Updator
 
     from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__GsfMeasurementUpdator
@@ -271,7 +271,7 @@ if InDetTrigFlags.loadExtrapolator():
   InDetTrigRKPropagator = Trk__RungeKuttaPropagator(name = 'InDetTrigRKPropagator')
   ToolSvc += InDetTrigRKPropagator
   
-  if InDetTrigFlags.propagatorType() is "STEP":
+  if InDetTrigFlags.propagatorType() == "STEP":
     InDetTrigPropagator = InDetTrigStepPropagator
   else:
     InDetTrigPropagator = InDetTrigRKPropagator
@@ -341,7 +341,7 @@ if InDetTrigFlags.loadExtrapolator():
 # ----------- control loading of fitters
 #
 if InDetTrigFlags.loadFitter():
-  if InDetTrigFlags.trackFitterType() is 'KalmanFitter' or InDetTrigFlags.trackFitterType() is 'KalmanDNAFitter':
+  if InDetTrigFlags.trackFitterType() == 'KalmanFitter' or InDetTrigFlags.trackFitterType() == 'KalmanDNAFitter':
 
     from InDetCompetingRIOsOnTrackTool.InDetCompetingRIOsOnTrackToolConf \
          import InDet__CompetingPixelClustersOnTrackTool as IDCPCOTT
@@ -378,7 +378,7 @@ if InDetTrigFlags.loadFitter():
     if (InDetTrigFlags.doPrintConfigurables()):
       print (InDetTrigKalmanInternalDAF)
 
-    if InDetTrigFlags.trackFitterType() is 'KalmanDNAFitter':
+    if InDetTrigFlags.trackFitterType() == 'KalmanDNAFitter':
       from TrkDynamicNoiseAdjustor.TrkDynamicNoiseAdjustorConf import Trk__InDetDynamicNoiseAdjustment
       InDetTrigDNAdjustor = Trk__InDetDynamicNoiseAdjustment(name       = 'InDetTrigDNAdjustor')
       ToolSvc += InDetTrigDNAdjustor
@@ -447,7 +447,7 @@ if InDetTrigFlags.loadFitter():
                                                       InternalDAFHandle              = InDetTrigKalmanInternalDAF)
 
     
-  elif InDetTrigFlags.trackFitterType() is 'DistributedKalmanFilter' :
+  elif InDetTrigFlags.trackFitterType() == 'DistributedKalmanFilter' :
    
     from TrkDistributedKalmanFilter.TrkDistributedKalmanFilterConf import Trk__DistributedKalmanFilter
     InDetTrigTrackFitter = Trk__DistributedKalmanFilter(name             = 'InDetTrigTrackFitter',
@@ -456,7 +456,7 @@ if InDetTrigFlags.loadFitter():
                                                         #sortingReferencePoint = ???
                                                         )
    
-  elif InDetTrigFlags.trackFitterType() is 'GlobalChi2Fitter' :
+  elif InDetTrigFlags.trackFitterType() == 'GlobalChi2Fitter' :
 
     from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter
     InDetTrigTrackFitter = Trk__GlobalChi2Fitter(name                  = 'InDetTrigTrackFitter',
@@ -561,7 +561,7 @@ if InDetTrigFlags.loadFitter():
     if InDetTrigFlags.doRobustReco():
       InDetTrigTrackFitterTRT.MaxOutliers=99
             
-  elif InDetTrigFlags.trackFitterType() is 'GaussianSumFilter' :
+  elif InDetTrigFlags.trackFitterType() == 'GaussianSumFilter' :
     #
     # component Reduction
     #
@@ -610,7 +610,7 @@ if InDetTrigFlags.loadFitter():
   if (InDetTrigFlags.doPrintConfigurables()):
     print (     InDetTrigTrackFitter)
     
-  if InDetTrigFlags.trackFitterType() is not 'GlobalChi2Fitter' :
+  if InDetTrigFlags.trackFitterType() != 'GlobalChi2Fitter' :
     InDetTrigTrackFitterTRT=InDetTrigTrackFitter
     InDetTrigTrackFitterLowPt=InDetTrigTrackFitter
     ToolSvc += InDetTrigTrackFitterLowPt
-- 
GitLab


From 9782cbd5610e0ef96af9d7ee85779db27d32244f Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 16 Sep 2020 16:42:42 -0400
Subject: [PATCH 328/422] AthenaInterprocess: Enable thread-safety checking.

Enable thread-safety checking.
Mark as not safe code that exits after calling a thread loop.
---
 .../AthenaInterprocess/ATLAS_CHECK_THREAD_SAFETY      |  1 +
 .../AthenaInterprocess/ProcessGroup.h                 | 11 ++++++-----
 Control/AthenaInterprocess/src/ProcessGroup.cxx       | 10 +++++-----
 3 files changed, 12 insertions(+), 10 deletions(-)
 create mode 100644 Control/AthenaInterprocess/AthenaInterprocess/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Control/AthenaInterprocess/AthenaInterprocess/ATLAS_CHECK_THREAD_SAFETY b/Control/AthenaInterprocess/AthenaInterprocess/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..ab67b8a7d68b
--- /dev/null
+++ b/Control/AthenaInterprocess/AthenaInterprocess/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Control/AthenaInterprocess
diff --git a/Control/AthenaInterprocess/AthenaInterprocess/ProcessGroup.h b/Control/AthenaInterprocess/AthenaInterprocess/ProcessGroup.h
index 614710d95abc..72fe47d101c9 100644
--- a/Control/AthenaInterprocess/AthenaInterprocess/ProcessGroup.h
+++ b/Control/AthenaInterprocess/AthenaInterprocess/ProcessGroup.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef ATHENAINTERPROCESS_PROCESSGROUP_H
@@ -7,6 +7,7 @@
 
 #include "AthenaInterprocess/Process.h"
 #include "AthenaInterprocess/IdentifiedSharedQueue.h"
+#include "CxxUtils/checker_macros.h"
 #include <vector>
 
 namespace AthenaInterprocess {
@@ -29,10 +30,10 @@ class ProcessGroup {
 
    virtual ~ProcessGroup();
 
-   pid_t launchProcess();  // Add one new process to the group
+   pid_t launchProcess ATLAS_NOT_THREAD_SAFE ();  // Add one new process to the group
 
-   int map_async(const IMessageDecoder* func, const ScheduledWork* args, pid_t pid=0); // If pid=0 map on the entire group
-   int wait(int options = 0); 
+   int map_async ATLAS_NOT_THREAD_SAFE (const IMessageDecoder* func, const ScheduledWork* args, pid_t pid=0); // If pid=0 map on the entire group
+   int wait ATLAS_NOT_THREAD_SAFE (int options = 0); 
    pid_t wait_once(bool& flag); // flag=true if process succeeded, flag=false otherwise
    ProcessResult* pullOneResult(); // The caller takes ownership on the result 
 
@@ -41,7 +42,7 @@ class ProcessGroup {
    const std::vector<ProcessStatus>& getStatuses() const;
 
  private:
-   bool create();
+   bool create ATLAS_NOT_THREAD_SAFE ();
 
    std::vector<Process> m_processes;
    std::vector<ProcessStatus> m_statuses;
diff --git a/Control/AthenaInterprocess/src/ProcessGroup.cxx b/Control/AthenaInterprocess/src/ProcessGroup.cxx
index b4b2a4c985cf..18f3c77fe958 100644
--- a/Control/AthenaInterprocess/src/ProcessGroup.cxx
+++ b/Control/AthenaInterprocess/src/ProcessGroup.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "AthenaInterprocess/ProcessGroup.h"
@@ -46,7 +46,7 @@ ProcessGroup::~ProcessGroup()
 {
 }
 
-pid_t ProcessGroup::launchProcess()
+pid_t ProcessGroup::launchProcess ATLAS_NOT_THREAD_SAFE ()
 {
   if(m_pgid==-1)
     return -1;
@@ -72,7 +72,7 @@ pid_t ProcessGroup::launchProcess()
   return newpid;
 }
 
-int ProcessGroup::map_async(const IMessageDecoder* func, const ScheduledWork* args, pid_t pid) {
+int ProcessGroup::map_async ATLAS_NOT_THREAD_SAFE (const IMessageDecoder* func, const ScheduledWork* args, pid_t pid) {
   // If pid=0, map the function-object 'func' onto all current child processes. Does
   // not wait for the results, but will return success only if the writing to
   // all the child queues succeeds.
@@ -105,7 +105,7 @@ int ProcessGroup::map_async(const IMessageDecoder* func, const ScheduledWork* ar
   }
 }
 
-int ProcessGroup::wait(int options)
+int ProcessGroup::wait ATLAS_NOT_THREAD_SAFE (int options)
 {
   // Wait for all child processes and store their status codes in m_statuses
   if(m_processes.empty())
@@ -206,7 +206,7 @@ const std::vector<ProcessStatus>& ProcessGroup::getStatuses() const
   return m_statuses;
 }
 
-bool ProcessGroup::create()
+bool ProcessGroup::create ATLAS_NOT_THREAD_SAFE ()
 {
 // TODO: this code leaves the queues from the previous children visible to all
 // their subsequent siblings. This can be helped by creating the queue first
-- 
GitLab


From da3380b826fdf2a3f7e7852f35f5f33936d6b35b Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 14 Sep 2020 23:07:06 -0400
Subject: [PATCH 329/422] InDetAmbiTrackSelectionTool: Clean up thread-safety
 annotations.

Thread-safety annotations should match between declarations and definitions.
---
 .../InDetAmbiTrackSelectionTool.h                     |  5 +++--
 .../InDetDenseEnvAmbiTrackSelectionTool.h             | 11 +++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h
index 1f5483216a5c..4e6fbbe456a5 100755
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h
@@ -1,7 +1,7 @@
 // -*- C++ -*-
 
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -57,7 +57,8 @@ namespace InDet
     /** standard Athena-Algorithm method */
     virtual StatusCode finalize() override;
 
-    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack(const Trk::Track *track, const Trk::TrackScore score, Trk::PRDtoTrackMap &prd_to_track_map) const override;
+    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack ATLAS_NOT_THREAD_SAFE
+      (const Trk::Track *track, const Trk::TrackScore score, Trk::PRDtoTrackMap &prd_to_track_map) const override;
 
   private:
       
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
index 4a8ce5c7fefc..062edc8c302d 100755
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
@@ -28,6 +28,8 @@
 #include "TrkToolInterfaces/IPRDtoTrackMapTool.h"
 #include "TrkEventUtils/PRDtoTrackMap.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include "GaudiKernel/ToolHandle.h"
 
 #include <cmath> //for std::fabs in implementation of structs in this header
@@ -69,9 +71,10 @@ namespace InDet
     /** standard Athena-Algorithm method */
     virtual StatusCode finalize() override;
 
-    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack(const Trk::Track*,
-                                                            const Trk::TrackScore score,
-                                                            Trk::PRDtoTrackMap &prd_to_track_map) const override;
+    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack ATLAS_NOT_THREAD_SAFE
+      (const Trk::Track*,
+       const Trk::TrackScore score,
+       Trk::PRDtoTrackMap &prd_to_track_map) const override;
 
   private:
     
@@ -286,7 +289,7 @@ namespace InDet
                                CacheEntry* ent) const;
 
     /** Update the pixel clusters split information*/
-    void updatePixelClusterInformation(TSoS_Details& tsosDetails) const;
+    void updatePixelClusterInformation ATLAS_NOT_THREAD_SAFE (TSoS_Details& tsosDetails) const;
       
     /** Check if the cluster is compatible with a hadronic cluster*/
     bool isHadCaloCompatible(const Trk::TrackParameters& Tp, CacheEntry* ent) const;
-- 
GitLab


From ba27d1a75db977a36d023c10d86a70ecb6608d2f Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 14 Sep 2020 09:17:01 -0400
Subject: [PATCH 330/422] TrkToolInterfaces: Enable thread-safety checking.

Enable thread-safety checking.
---
 .../TrkTools/TrkToolInterfaces/CMakeLists.txt | 22 +------------------
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../IAmbiTrackSelectionTool.h                 | 21 ++++++++----------
 3 files changed, 11 insertions(+), 33 deletions(-)
 create mode 100644 Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Tracking/TrkTools/TrkToolInterfaces/CMakeLists.txt b/Tracking/TrkTools/TrkToolInterfaces/CMakeLists.txt
index 7bec32392796..c72223fa9523 100644
--- a/Tracking/TrkTools/TrkToolInterfaces/CMakeLists.txt
+++ b/Tracking/TrkTools/TrkToolInterfaces/CMakeLists.txt
@@ -5,28 +5,8 @@
 # Declare the package name:
 atlas_subdir( TrkToolInterfaces )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthContainers
-                          Control/AthLinks
-                          Event/EventPrimitives
-                          Event/xAOD/xAODTracking
-                          Event/xAOD/xAODTruth
-                          GaudiKernel
-                          Tracking/TrkDetDescr/TrkSurfaces
-                          Tracking/TrkEvent/TrkCompetingRIOsOnTrack
-                          Tracking/TrkEvent/TrkEventPrimitives
-                          Tracking/TrkEvent/TrkEventUtils
-                          Tracking/TrkEvent/TrkMaterialOnTrack
-                          Tracking/TrkEvent/TrkParameters
-                          Tracking/TrkEvent/TrkParticleBase
-                          Tracking/TrkEvent/TrkSegment
-                          Tracking/TrkEvent/TrkTrack
-                          Tracking/TrkEvent/TrkTrackSummary
-                          Tracking/TrkEvent/TrkEventUtils )
-
 # Component(s) in the package:
 atlas_add_library( TrkToolInterfaces
                    PUBLIC_HEADERS TrkToolInterfaces
-                   LINK_LIBRARIES AthContainers AthLinks EventPrimitives xAODTracking xAODTruth GaudiKernel TrkSurfaces TrkCompetingRIOsOnTrack TrkEventPrimitives TrkEventUtils TrkMaterialOnTrack TrkParameters TrkParticleBase TrkSegment TrkTrack TrkTrackSummary TrkEventUtils )
+                   LINK_LIBRARIES AthContainers AthLinks EventPrimitives xAODTracking xAODTruth GaudiKernel TrkSurfaces TrkCompetingRIOsOnTrack TrkEventPrimitives TrkEventUtils TrkMaterialOnTrack TrkParameters TrkParticleBase TrkSegment TrkTrack TrkTrackSummary TrkEventUtils CxxUtils )
 
diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..ebc8e8153e0f
--- /dev/null
+++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkTools/TrkToolInterfaces
diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.h b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.h
index 9f6274ddef65..9bedd6c2317b 100755
--- a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.h
+++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -10,6 +10,7 @@
 
 #include "GaudiKernel/IAlgTool.h"
 #include "TrkEventPrimitives/TrackScore.h"
+#include "CxxUtils/checker_macros.h"
 #include <vector>
 
 namespace Trk 
@@ -18,8 +19,6 @@ namespace Trk
   class PrepRawData;
   class PRDtoTrackMap;
   
-  static const InterfaceID IID_IAmbiTrackSelectionTool("InDet::IAmbiTrackSelectionTool", 1, 0);
-
   /** @class Trk::IAmbiTrackSelectionTool
       @brief Interface for building new tracks using information about shared and already associated hits.
 
@@ -28,7 +27,7 @@ namespace Trk
 
   class IAmbiTrackSelectionTool : virtual public IAlgTool {
   public:
-    static const InterfaceID& interfaceID( ) ;
+    DeclareInterfaceID( IAmbiTrackSelectionTool, 1, 0 );
 
     /** Performs cleaning of a track from already used hits.
         @param track the input track to be checked and cleaned.
@@ -40,16 +39,14 @@ namespace Trk
         replacing the input track. The second element of the returned tuple is true if the input track does not
         reuire cleaning, fulfils the quality criteria and should be kept.
     */
-    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack(const Trk::Track *track,
-                                                            const Trk::TrackScore score,
-                                                            Trk::PRDtoTrackMap &prd_to_track_map) const =0;
+    // Implementation in InDetDenseEnvAmbiTrackSelectionTool
+    // is not thread-safe.
+    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack ATLAS_NOT_THREAD_SAFE
+      (const Trk::Track *track,
+       const Trk::TrackScore score,
+       Trk::PRDtoTrackMap &prd_to_track_map) const =0;
   };
 
-  inline const InterfaceID& Trk::IAmbiTrackSelectionTool::interfaceID()
-    { 
-      return IID_IAmbiTrackSelectionTool; 
-    }
-
 } // end of namespace
 
 #endif 
-- 
GitLab


From 25a3072b43341fd75c3e28be0928386d67874e19 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Mon, 21 Sep 2020 20:03:35 +0200
Subject: [PATCH 331/422] AthenaCommon: Update test reference files.

Update for changes in how properties are dumped.
Fixeso
 failures in master.
---
 Control/AthenaCommon/share/bootstrap.pkl      | Bin 12570 -> 12004 bytes
 .../AthenaCommon/share/bootstrap_threaded.pkl | Bin 14179 -> 13562 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/Control/AthenaCommon/share/bootstrap.pkl b/Control/AthenaCommon/share/bootstrap.pkl
index 044ddef8f837497bc320600ffa749dc69f6670cd..1fbadb9efe48ecbc16fa3f336a726c78b3defb91 100644
GIT binary patch
literal 12004
zcmcIqWnd#mvfgmAVdkti7e$+7ZP{LogI;s8hFIQsHa=%>EX_)j9ck1(BSZG)E(bYg
zW@cu-d(7|PF*Ds`rhE8R_4LfNMvimzN1CpxuCA)CuI{St$4;wMe9v<#q3bt;?N#Tv
z-S)z&TM4&|ZIzX_>xC}C8F0$u;?#L@+AiyYZQHgDw_2WCv8ms5O^VYaamFs|LPCJo
zsvSC$ZV>u%L!4=y0qD5x1&%mNb@gfs8!czpbM3$h#M##AAUN666Nz)IvlQzYyWxoK
z)<tL)&5?@YTx+``deD&ph8O2qrxIOJoUa6ESKV;ftNGFm>y1EMkP+ZQ>wM}<6lF)Q
zx)qFnQ3ijp;!XGk-}eG>Nd|eTbq+d@NC(=LS1aN&YZ2|Go+6O~P>TPHJ-d5~!(n|C
zRy*w5RYwxC6Tnm>zH~<0jTRAPzKcD};&L|2s0Sgg;LoKVK(DmU#h7EwRag4WhSLni
zRjK)|W&y`m0Y2>eEpd%?8Hh;~r)ei(Ojl7{Yn@4aR>Ns~U0lZo>>Uu-YiQZ=#0}c4
zJ9vb#bvG0})+y-LFLo-z^^ojvqxBs?H?srT(pMHpK3Vr^CkX5sS+bOVGG?k-ajQ^*
zP?>MWLF74__aJndl?|d`#Y`AevIEwn-5{c*F=~f408BBn&~AAwK=Q@#`DV2-;WVjV
z`pKA)I?V2uLz`tYT8uA4RcAu^M=9ILV@I73%MO;IE_rmkd^W+3_)VA<&Y$8(JUa-c
zMoH-OllgXf-goJWaOV5`mDv`D2x4!v$W@=ht7?qBK`oC!+>}{31@@!~U))^Z$u619
zMrPVXk$tK-GdnX@6uYb|;b>D$C~14{qa0_*r$_2e<%GB;!~9l`DXC0zc32m;Y2V$=
z<7KdZ5K@Ff*yz<Xeb%KID?=lln53jh`mKu%5}1KPm>A%QW7?-E20KJz(mh%A_A*84
z_Dr$QIuC;sQ)p4_=M_EM4$C3JPD30>Bf&v7dV*pOw`UhTP%YiDD26z2DA-|V73=#B
zUdwyLog8N8ymrlPjyfytnnK@&xgw?Kq}!x$8k8N;#+q})-5KlO!v>g>e#?=e>jX?K
z?#)mPb4Z<c!nSOV_*F+70%HpE^X;a+;yGeO*$`nKktqfi#i(@!Xt2_-J5_m!Py6r&
z1odW3jAi(bb9Y*j?SS|z51GhNOtM|EQd+akvRiA~o|wv@?_&WmqtkY)McnVV22?yl
ztck;g3NqQ)f#s`ldL?JkiHFmINg4*litnEoX|4_p(IQ|nf)Fhlym04zKcu!nrGc90
z$p=KpnOSc%qL$nQ^Vo^ZCN9;*gi{ze%pM88h!xtF)2YMG@B&!yTW}^ZYwf`FV$VQu
z(vBr5FiqQt>=Gd2IM?Q>0~mdvD8S-@NX+lD&PH!Y&*4v$t!vm<GO<@{rU(|8o)}QD
z6-Tr~B(YjNsP@(MP});XESo?q^4eco78X+@x=C9tpFkYdxQE!2r=7+M=1?qIWl}1q
z(;){-i&RqQ0z=<n&x3B8Ajg_j!YqrYvXjp^PSvT-JAvPpbaGkNVmz!|m=`DoOmU3O
zz98F<c$!wWHM{CaiH%j*DR!mJ5k^@UV~I*6svYKawleQ=)4Vl3Vrt%c&b+Rc{gJ$R
zPiUNHT>^tn)tZ>KahydRIfqTosftFbLDQH5Uw3VFwV2Rosbx&95~MuCjNir6BifNz
z?J&&RR)$$O4YQ#KO%3yC&M+snh)>TOCepZP7)n3W+Sk?Z=#;RDXT?6ZEFSA>r)TMb
zo~=br?ev_~PS0(#`0yU>;^Og0Jg>t{&)>>SFEGvYLOo_`rWfVR^kOaHOY&xVsm8s`
zFw@JeNo^*aD#u;vNSL9-qALKRKOnSB^|2E>TZM=^+5=dVujp#ISL(4})ww2Lo!ad+
zZAQXw@f3;IM&flHW_$fsW_yEawm0U@_NJWK-mJxYOWtg6)ws7AW_!B^zoV<d@6_mb
z>G4xnd3UPvdy+t-f|_`5B;MDd@%y*Z_yeZKAJikJj`E?L#vj)5eI&2(M>XzahQ=Sa
z#=AKR1phAGWDsuhiLO@rq#pTGoo@2!)MlSa!cej+iqA&ka~)>;{8ncBf@!ud=FRq{
zoY}st1^i0hY+u#5uNh|h5$k|98=?-M6?sd?`cZp#xBZU}u)M|nXjeP^m>%lKJMHun
zshxf@@h!zo{8S`<y2D66vz3v4)-=-3<&E_7IV1gomhKnxM*6zOeZw%)H#PWMUG@DX
zjs9gle!7}|CDr&>;{cLm)Z*77@$0Ms7dL#IMt;L8s_F1*h%%wG9>%B=Cd7omO@A}s
z(|#@(ir<RFZ+F=8ceb+S@0zy!J*`W+PJcgV%RkVX|6$&if247L%w9mD8|521==@3M
zApfU)l+lqo5P!x=)>4sm;uHdU{&`ok|Aijl+igC?8kxQL%SikcTW8W;br$Px=p6EG
zS;a|L{IwF6N-pu?Ui?kKLZ(T$_}fVQ9qT)CcxrU?5Kb~Uy#2j(9ZyfibE|#T6<Qk;
zHs<q~1}uwz2v`H!BhqAF{9`2kX&1B8s*)i8oP+#}%Il=RzJXnA6$d}6!iazE4*oZ_
zm1l}j;@>0jAMCp-X$r)DvTc?I26p!x*xj>tchA9P@tuHy=6U<SBJtmO5&tJA;{SG+
z<^Q^Z<u+txZJxf4NGwkQCX%P(*Ys3*8bDh(t2~`(D4)>zfjomCl#6q^5SMf0nFQtP
zTbd=vvj|A#$E9U?w(geA734V?itY4G)yvd_<+%h)N~H2UYEqq1Pi`R3ClHCVRD|NO
zBg+d2N(I-BtUz8!h*+eH@ZIL}26r=aHhD3yk-UWHNiU?Cx+p3y%`mwP-vLiak`%_i
zE-z;eSKxOSyTMem?yk5Y)nJ@JUYTKX6@8PMoL<SRGpK9ut#&%*FE`li@>+l+c^!Up
zt|YIg?j*Ce5<FYpKtL)P!`%&^mpeAa^Z?W5PMTAE;v0}Vfr{jf_*LWctg7TtK7|;@
zHol3zX?l!lFJvfgrtfZ3Rm>3W!gp6m2IVb4Me<hs<|Vl;!(umm=OpRPQ1sDvH%Uqv
zqJDg<FqqcF$i7q+iR2)D)nxN_GVY?D;y&ugJ;WjP<Gs}6`vBUbl0u#%_nCD2sY!Jv
z<~HxRy5#4`119A`YLa#_Wf0mjl((BiL)6UG_~jiY)t%JjTLcmgwIeXP%Ots*nzRmi
zG<al7-eXeSOHHmr9GRXQpE^7yhY6zYBIF_Zri+pZ&tI{<QFXHt$Pt3mg$I@M<tVkt
zk28fiIR;?;P9~ZgUYL~QM07cbihX@0U)5ntkN7Kn_zsG4g3x4_xuXk{vopgZ3sbW*
za+092EK?@M-0=MHbXne)p}1dD%sVY#hDVxhWZCjCLDMOnrY2dfJT^Q(GRd;d5Uhc5
zihV;R`*={QII`JSsh7Y&mV#0cG&ivEl<W}Y>E1P8p4d~OYo%)M`oaCj_V4YjVCVFM
z1HH9M<zO!qDs2Xb!l)~ua2pJjDyt0)rFb^oT0QhodhF9fOXyGv)=CX7B^^VSh3k)F
zoADj&AMEe#zrA;`e_?Q-f1ormd}MU0G&tDT-#2g&c^}*iB^p#;pOj=z&ICVP4V1#)
zvkE^<<0{b*DB&fz5&RxyEXrAOJ6c5xN9V@m9JS~^OI;qw2hdgr<g}J9=K+jl8Nc14
z*8;IfUHu3(yG5@DO}a&Dc8^|EUC(elO3hsKddMVNqGmpNJ=LUIre;U<de|g6Molw%
zJ<X)BsYx~)_hrKl<qEa0A{!QZ#tQ=n7YpUWfyKgnVWFqczgU<q$_i0*#;PiSh*e}N
z+gr0YP=fb-Np*PX5PcHqj_clv?6BK#Ls_HVJ6Yq3-)>@?u<7>Lk#(X@r^BTt1=A|s
zPozUULhxjW6VxKRFqIm?BiLzx?d$KC4QkLF#P{5aq?sl0sX-Hpkb%pIa=X=%xTi$e
zku5^8&!Ma;1+_>d)Kp1ft+gaL-6x^8y+)}5SJS0aMLk;vgd_>MlNvrGn3k}uxgN(g
zrI&JDB{<bW!F9!J8%)<UQ|_afu4kEUP=mb6Z65bio{thZG2TgPk;f2`V)FDXlSni1
z{94Vas{5!wK0`A(iTiu`OwA;4aAid9ARp5Nyx%>GTC`_^fbW{*vkm-nGWanvtbDG4
ze>{U9Clkr%8TjW@i!PVIe+r7o7Z~UlQj6>lG+qy^_}HXgWKg^~L$PSfCMtsRB?iSy
zsYQkg>i!yCI|cG(1WLX2<p~9_e3>R+0T3LWh7R3^6R){f5+Pl46$?ju3yt1FwWlyS
zRG1zrly?`77v-x6Pa8k39x4usPil3PRrz1On$XDvzJ^*P7j|Br<UqcbK&f1>qb8k?
zvA{_6)D>QDaC!r^Xqm)x${XHDQ0=F0(yZ2$jZ#)`)}7(08;<AsYvlNE(a@M)v3zTm
z<=fCub)4ifUcMc$NWKHV-O`J9Qup`}{x13^RaJWN?hNWZ^i7dYow4M5Gr0HRTcsXG
zs`q|?Bl!XR=2MRkQuof(<3j}OntFVAQ_M$zX{-F2FLwj^Q9vU3G5mI<u^%TUPkhHE
zKS4A`8v99t&^#KteTtwYe>R`_Gy!8%enxjQ@|n+OC_YEuw94X(FZuZl@(c9cEyeg^
zhUiQ9Znyg$`@udxqDhYL7tge=M<ag~mlRS_3Ob9I3zZDj<@(vN1@H`sqGf{MtM%<1
ze%1L!Ia1u~T;2uJg9cNd$4fm0;%O3XDn>rVgctBo23%aoosn_rOVo?3U9cCj|4r_r
zQ945XCC<r{OI>~03~Z9OgK2t$n<aSS%V@CB*Up>XMS}+NnH7evZ*!Ei9fZ1mWP+(E
zmdI|RQZ-CC=JjH>DO5$ipiOv*p4&?~6hKmX_;eXV@$l(#1y%2vuCTt%=I(sf1z|WD
z%)Mp;BAx2&V<sSUS%EB{`6kVtw7C)!Y&LyK#4IIWG(h@zDf^BI2&24NGFsFx8!yaP
zOr1zQZQLW*HCxWfA<e2Lq0@?K_5~9VSan;xrK8@sBkuN;4k%-Jbv$39Cv~*i5$s@H
z{d(!DblVhH^B&6&@vhNcbS*FXlrOL4>zI(<FX15_9Su`FKT5j60&JVuvH6pvp8AeW
z-y-b<F8gfeMi$$6HG_v(bO7K|A3p%RDHF63C_UFK=v6=u{cZ+ldMKE<S!PAyRTiBv
zSShs^s^F*I2;D+S&bB?`R+bF1@Vm|1Sb4Ov4@7r!Py-O>E`GJyi%~hl>Ub~OSHGI!
zbhOI8=qUltJ8b7erG6HoA8)Zp`Sf|_VEh`R+cN%s9BNtYQMyp=h?oarFJ#N5ZDL=n
z2?q__x#$O}`vK<-IP;400DIQSNF02^hi|u|YrLbUkC}!5e1gYPcf?|#u-VE!(z+9H
zI*?|bX5AH=@^0R(@-M&cK^JmtC_^5vU+~_mg&*$By2YVLjO6`hH1?Y@79c&0i*dcc
zCX6gWOltTPds=+D7x!uK{hCpHX2)A3b(#^=nh~cHVn)MfHJsB3F{j}VuoqzfmA{C2
zjVO0LI*SF3Kf;zV6I47aip5xD|1c6TJS>WlN11i!QCd92N-gPQ^fKNT<r7Xk4Wd=C
z6epXAc9d%_<82Vpa!QyS&c(yLvX)c|nUEf1Xh-^vcSEsscK3W(tZ-!DH%67svlLO)
ye4H*dWpO+bHI~#YlZv|T<p#V~GSOW;5{VP+2KrvgW8<3lQjLI)m&;;X-~R*71?a^9

literal 12570
zcmcgy+iu%P5`Fhq7y}rdhu9J?mgKy7d`Y~B6T|XsFbD<)Eip28Xi-a1PCSGC_dRv0
zZzSbxW){0IiPhKY>gqbDsyLffWtq>KqFSzZ=K1GrQ#SKr*6ggJogZg+clVp3Y>MUG
z-Hx`#JI&21*_rN7o2t&=WKBMOn(gnb(w!gYt0S~uE@#C&UpCr2>a~n_*3<p#y88Nz
zf1WV3){zs8+|qo!v&Q(-hq_u;(<U>^Mnl;yiZJJG@sxjjD4P7IDy!$ZRurS-{0UN=
zWld(<60UU8Jp7a|isdx_C!~%jb|iA2e{JgQ!=_nnnzi(Z<ez?(zbNtfQ^ONWgNWKW
zegrwq8kbA6L_D-h#F6x3%MC;-vJ#8LBI0em$>nc|Hr>C<AMf*8_Kwq?=?|awAu5!4
zQPg>TQZ5D*TN{ey0xkQmcAd7NxtR>I+Bd(W{a=5;dPlPU`#hiL^P7BKZR%OhecTyi
zp7AVqXN<dN9H0|sQq@)qvAG#o!P(|<rAkhCFNxgCv{)>&QnpFtsGp+f)$aJ!Zu)9>
zB3e!KI{sGOe^}A@%mTcSL@s1{esXjA_WI=Ztqd1Y4_^<m&+EY~ua}3jhrwo@*Ms$7
zy<R@UiUwIzX6u75RsCDC7>L=<557)Dccb)R2CY}?@xfv?n;cZDX7Ez`Kb$nL2eYR~
z?4^q?i^W4z7Ww+n?p^1rYOww?c+A#KULPE+p5r^*SH8^dURpdJ#>0c*<RD6K<7gNS
z-kkh=b~%XS!{K2x!NskctSnFJJo_&3zEctZhjZw$|MEfp=XzH8@VsF*Fv!0ssMsJM
z$;oD3;F)A~BTe#5F0iUR<Agqd{g=x^-g)u6w5Q?+?4XpcK>f_S{3#b-kjeu|_IL0|
zb@jY{D)fn_;%eR8)DLN@mCTff;<`uD{idw$v+_(mxjesgj4_{fcjeWk6B%;$^VRjm
z<-2ofI7X-6`J#Y|RO+Kp>LW^h{mbp!5AUx}ZceVIn0q8*`?)uH5uW-el>CU2o40%<
zLLVLu@Dc@e26%Oc_*-N>;t_7}xa#KTB_8-(8sz}?kVia$N^){~d->tLjBuy8{pDJY
zH4@?9e|XQoDLWMl=VvZ%B(mEzM+O??X5rw7XCpeIk%-EvRW0(3;D*FAmy6SC+2mgv
z(>Lg~(D9C7G0^uZ9Mk&p%q%<+=o*Q{r|&M$&VITmN_yilWX9UFvX~#v@5Q;l$sp04
zZ4ggB##yi+Od1xX5H^lwy|HM!17Typh(g$y01!afSlnp`!p4eo0)r01#$w+@!7+^+
zQ&u0I^123YLmd-QvjMRQ)$BoRLa#4IHzB<B;b-FHn^3+0ekNV{dhjz*)%HOV`%%La
z(Qrp2$09F}b4+OijU0=(9gQ4QaIWDra_odYrqBY<)4WztKNhjARUK2G7Ldhyj-gH5
zFl8n?p^+R@vwihMLnkfZg74Pjb2RMA+tW}qG-lmAz*y&o@C=pl48^cJ+KGlDzH*+S
z8bd&OhFwO014Tp1-quhAa%PtSLxZ_?tR^BoGiDP-RI<052%OAKe}T9}0XtKA7T8YI
z<7a)<2wl^6bVUF+$^l~&S_!(=R}KlADo6QRU_6m9wyyO=O1nDBiM@`MbhTJvMBZgp
zBNQv-g%RkLA%;2&Y-9jm0OupZfYHKf;CHLjI12F|5r`QU++u1<(a3g%m;oXJQ%kys
z>+2JQ&FIt1BKwV~PXK3MpM*};rvhiFPeNwrHAV`Z9eolzbs1nKBya0871^ymftE6$
z?Zcu}Zp00t-3QhP#N4KG7ej2(_z7rSxp?6^&h;hoIsm@guY=gDhf?GXuY<4~>ZX4k
zz+Q75W;@&kAXsdh;M;xpfL;6K0Je}RybB<1-?o9cGOPs_5m8sg9_hmmBc6zuYZWb+
z+p=u{u2FOt^g#YU8S=z*su7TTyKV)-jgu32Zkzh3d)B^gf!w0ou3*qG09-T-jP6@I
zP}=SasFwMGYb8*JH!7}GF}npX5n<cnOSBEJBahgTLUss1kpMOj2*P{(i4?iFcm)sP
zkz#mghD7gB=)S51)^XHngP`V705Afsi;4i=eH8(=t%`u%9TgF|!`);x1LAEXB#^5S
zDt-r#*@Jha=)L98#BejeXCH##EkEBsw7@xpe}B7Kl_ob51Icmh7$`3Jk%!{GXs$Cv
zi=q>Rh4$RBAhwJ^0)ai^yeLWxyhe|P4eWAO91B!aTZnS6kw7RAkuGP?$~I%bHn%3<
zTt0!S*w6w&s9Roe8fz$)i06V_Kxvr?eD2*<>@hk<@<e1_ERhHRl|__w4Yo_-9uua`
zi;sJGl(+}f+;)p+iGx&%$)&WNc-%^-^ztc$XI12jxeyP`aX%aK9qAC051|UJ|A!Ve
zBN8(u(s8@7N8MOaH*gAZ4|PR3g0to}93zdH8`0Bgh>CX-vh<ixYp+4U)<23^uvTK4
z4sWoWaVx+P-I!WZQ0~8@*aLH{z#KS_n6Ml^=iWPt1+2xeOghmew4enbwpb<u+pbOp
zug#lz30`9lud%{w8^>ZItSZzXX-A4!?m_`I-Ug_#2h>;rb&G<Ct7eyNHt*3i7Bqz}
zuJZLdTUe(8I2A1bNT>Usk>)H<tFo$3D@JCq!s+h*eTfv~E-taglicN%DKsLAyRX)H
zdlJ2hrV3(3N0SnMS3DN<Nkqt_;ZQUnP&nO3&g&kYZnIj|kPi{PbV)F4NmVRSE5_Be
zh!@Bxp!mb5-Tg0;zU>I9D4CUCvgftioIr`KvD*5f`Xc#Yx=>)HkGo=^BnFs(zm=1S
z0h!@I<`UL<b0O-Z*y1Klt|SInVx407xpD#kDyRGA^gu^@D&H@cVf%fy#^)VkU}7Kv
z@DOWURP|#<?GhOGb}#m#$;Z9v-uUC*&ED<q-tgnzm52w3v?mK4IYV7b3t~W}9n?xg
z#emCTYv80E7G!;5U}iXoXMlz-p#_luu;~>9sKgTJJ>fO6UleQ=2((21Jip%{T@u_o
zAkqy=fQ=ZW7afjDh?Zul1R#k~U$T0M+_zPC0=%^9P7v5)1X4y^M9d;#kZbjlAiBkX
zcIGVsc-qw4tlBJb&J4AXCrNH3jClQY8au5@{HqKgfVu%1>p~l6a$xoo+4VUk8s|2}
zWA3gyA&l<*a<KP!us7e`d;5Ct>h<3A)!t{$rmyGAb_XV)s(mGjr`YdY9u{ZN_u2g@
zZ&@uC`P?(Ggh=|w?(V;2f?_EWKC>J&TTec9<$**)UbCKpDz^K(Iu6b!L9qiUFA{8x
z&1)vaRDG|;-MEtgW8KvOU2!wC6W=d3VonMSMZZzKNxTwJo$i687$Hx!WkNtzZ)gBi
zj4>wE9tNWpKlGfJW%Wh9WCB#haGdv}8l9Y%fvh!2psF}!z*?&=k^o@gmlKAt7B_5h
zLkVD5AWMLgSY=D)D`D<;YX?q(IfBqgGgnIjsmKS+<ksTGyIYICyKU6_)*VFq+d2T9
zvh~SoRTi^MHoscX_5h@^HK7yH@9py{KPiiBO^%x|8EmailfgH6v#FN`t`efCTFPy;
z!UA#}K~cGvE;aEv8v<IQ5PMx0OL(Hi+NM9agggmnCMIf?!r;3~-!M@Y8vw-^5=px`
zlE$#$2DrUbgfNYsrIk8PG>$!AJ{71?K4M|nRls-O9#`S^{44P@Vfd*BJrPfXRo{ZK
zSM@U|$}Kr@fwj=}&4vKWZn+ld9s&lfz*-E0kXPAi1@|Z;B?uMOfl-<g=zzzw^-y61
zuw2_`jX3P4Sc^J)#L5Hrqc!5bs(w3NKD~Y|aR-M<i;Tq&0{Tr=HS)VP$~M|T5V9S(
zsI2WaE(bZ=t&TUgn>pCY-0t&dX}6nq4^pBA{yuvo3^29cH+XOn8OLgn52}(D6-kte
zND7WIFmFb#*!mDe>sZ7WK_x2WAh~Gr9B>@e=QUivs!(95VCKAHCf}W{Xb|rJpHEY4
z`Sc;5{U%E?nD@gOY5I+E74l>`P>i?L!&Z8CVO*QFJX*i5I2*q%LuP#~a=o%Ko}ifG
zZB><M8kqliMR<5;_}JiGmFaf?lFe*2aMY=<F%N>j&4p>QfEOW46Zx4ga6)OG09Od;
zG6XeYnt&RXpo?X=gxrU1*X0J^2oT5}m@#>vFSkP?NQx4>*j4sbj?Fy6LBv0)6tB|j
zI+wRkrkpUPz`1XPVI?F-y3IBN#*mbS0aM*dwKM=<y~^tbC2G1sjuQ4^b&zUm!OLK7
zI|XfWm9o@j8Pr_e7`bBgk$Q4x&8gN2gb;mLYQ>*hhh8^zMFKU5RA|$S2H|RO1Ky~X
z<HTF};Ai0fq<I9W=DvTBtz_2syB4Qxu~GLUbayVLGjM-#kDKNE@lC#zdHzo|-0-uN
zLHi>Xk&eJ^zM&a}KR7#VaDI-B{cZ|eKflo1VG6RfuSpL4pIo>51pnll#M<7<L?^9Z
z`esw*%DiD9He6cszyx8+(vUM+<;-U#A9bopCuN(drk$`pJ|FS8mug|ij^VrW)?)3M
zc_-g27OUUycu}vbb>rS>O45us3SZr`3`_=%2KPxxmu>Pc1z(1rXVD$$C(P_7{!*l(
z+z60OySTkYS$M1q%X12>Tm(kCsn@1Fc?)ez$(FZv0PXNq%j_?H1m+cnn-H-?UO86p
zD+F;N)P`m&LpP3!txS^x`HzM)IobJW$fhZ~>{C;f%v5?_M04qqB{iEC_oT^ms3&48
zxTtRsPu6b?eeTmvSd(|XFdkg3BbU$;>x=47U9)mdn2?O^P)?ZA!mQHbnM`Z`A(5PB
zHT`WE9>MsF*kaxgqb|)kQFz>%e>`GRQXF`JGU8!>gE6AlJq>yF?uYfDGT_^M5hE-!
ze333<%=fu;4E%1gD541m7qZ*tg#H-qcGj3oSh`wSrYO-}pC~Gy?D9l+r7d#Ecv^gh
zCVIC;2-Xx{CWd1><Xddej`22wTeB2U%(vAcPn%}!TSF3qB(SHe9fFAX));S#q9M4o
z&E05`$zhtc7Hl0sW2KhnyoH}J8@!F4F(a((tVIF+r%%{GNgETx<ZPN3hDuuS;uFJ?
z7e)lms1T!|A4IkCdb%tZw)LL@6@vnY*y6b2Xb>D@vp&T`d~9^+uf<#;znL-=Q9qe-
zc4kM&C2u8l2#K*Bs6@!=5DZ%%MDK(XOCbEhiMO&ioYI4CNaD~Dpj(T>q3gTfyL-bg
z`5#By0s@B(JZTI08#-EqtwZ0?O|rF>y>&Znc&+rT+e^7E>UTRk)D7L9u7%7E9siY`
zVZJvaQDEzre$7Uk?~^uUJB(?#8wk9m7>Y0g`!ycZYTgcvHKN$isc&fV!%NX(Wc++i
z37KCCJ821?75FXn4PS)U>H?B`Ca>N7RPLpeC=2jPW5_MBg3EpT%DWccdwFjL?3}E@
zdOzpw3+`HP-&R^--Q5)P^t-usG|Ers)ZJ~#bxMH&Z`Ncw#kpurp;w%dngRxDX$Hn2
z<s%uc)rD3Xm~{o7OKS?<G%Ukv?I#h&WSb(_a)JP!t0i2RS`0p)GmKHo2$*FP-C948
vS@Mk>eAVY}`Aa^S6Y*L73Z$3M<}e;>`K)flDgxz;q=>LS{IOg`JBR-U0VFg7

diff --git a/Control/AthenaCommon/share/bootstrap_threaded.pkl b/Control/AthenaCommon/share/bootstrap_threaded.pkl
index b3064d2da12442802dbb8bdf73140b05893e90a5..4e2911ba5c7b415b01039392ef0b7c154a956adc 100644
GIT binary patch
literal 13562
zcmcIrcYGX0vNq9Ra?T()#0s#qk}$RrQC70R3a6Fv7@_lxc1PO9voqU0vkEo?T;Ouf
zIdeJZz~!8CjxXn&<Grt{r+21jRu;$m-5*|0S5<dcRaaMcRhJ$(rd;-2*C~fJ-wU=>
zoJG6ohLu`5+#)uW7n(IUtPz|6M?ENxo)O1%S*LB<v}w>?nsEZZDa+2Z@4MpINF3K?
zodnEOGi)@&J<hV@isP-L0J%<VwvNaDvwj2J#0l2vXv`G`!|H?`gpMpZqA)K`Y+9!R
zKG<luwX#hNO)N>VB@!paGlI!wJ9Ku}g3y<1;$-VMkdNAK;D}RHS9fW4t>Fy1H9K$u
zajJDJ2o862MB+4Svl@ERt~=s%W}slsR1jxaTNKfqjtnrpIMX^BfI>l>r9^I4Y9R#h
zWi71M193KwKP#J#ILA7Lx)MRjk;}C*raw2u-+5|i!p}lmfjB>fyudmUork0Y;Y!P8
zaiO&j?YWKukpfVR|1WfG?I5KMV>R~pb_I$9G7Dg;AzwPf&3c0fQs0G+d2tbQJ?w&s
zi}`b|1JFx&=|;Ten)JQ8<AvhVM0=MpgColT@A3VH=&;Twy<ld?vv=2)ofZl!RuGr-
zVvj6`6ZWdOf_2#4Cmy4rCD_H4TC<%z%gAai6j!mW^ooKaTn$MVUDm@`gY|Sl`t+3+
zTAwWcgcAhz5^1xTd@^R-E7vLzgixt(#)0K&T6)-|S6(9u7R-b(CEMVVwChCFY7E<<
z4FFS2&Ndq^Gtl~C_>5Pnk2xOoOFkJhRE6sOQfM=8MvL(!i0X_f8!4t6dF-$gVoO6a
z)FqFOchEZ6A>V^qVgCt!$hCuDe3+O{K6%`%_5F_K2!k$-4GfSC!E|VR)_7Wx8Ansh
zv=tZ2wrhLks#C(hO4E&ZMmwnHx{c)$?`^=`W42az+?vM=n)+tk?f$}4gB>UdV6<q%
zUCq8>gzZ^v@<3dZ+Wyz_UKsPm)@s2z8yl--PbtF_-MlLblT(u;1<_-j2fA?&%VfK?
zL+mVRXAV`J@<CBd4c^O+G2v<24y&S1@4kMXFNO7kaFEXeah;~wW}St(QZ&+uNv_u<
z+pRMU5~zXvu-L(Fvyk)!q9Ar=SYpx}(&7y;MY3_3;zpjNFzz`rOi%@J6FVmyI;9XE
zv@UK=oZ2m{`4)<Yxs^qZeV00_RL6q2Eq8nkRyXreG3_>&YTmH3&|FgI+Ab^=$viD<
z9vuk*j<6=2h9ibj${%L=r={Nj&ow7tYB7?c80B+e#tEC!8}ciT7{kDHRLwL!d%<<Y
zZlyvTRoEXfupq{*b3p@Ffup;^J7&U%G2meGmc;F;@$ca7<Wrgfjjs%3Pl{r~I+=&^
z8&h7Xw&dBam`tIkm_e-DgxzS+=+jmoj&wL=ILmmO=Jzc8kH%?Nl-|-U1E>AcY8Vs?
zzJGAYTOJsoJ-}oHAzHE_ItXWcKcu!nrGc90k$ZITnc8kNqvqTM^V}_-O<W?22`4Y`
zShhus3s<3aIg^-biS0kWAkA8rVNIZ8I3#UYlDt!LUBZZao4j-Y!vG;DD8-$T*w<y9
zfZpJq{kO2J3)KQAhliF-5$tDr8h}m<ahEoT7QL8LmxI+%+T$MXc7eE?xBlF`m}hD@
zH)*TQ6o|)Z+yS=a38%h*H58AxN+eWHrd<xU7I-hH%Z(xLpzA`mb&w-og)sBNW+R_;
zoQhM?chW#CXg12qgn5IKzZ4Z#JKx(JEo@_I*^v@A1F@K3mzwNbl!h^vs79ieQSUt)
zsrR6%URTeUsJEU|ucvwU^XhGAoUqP>LdTaptlB6p>W-YoDeY8*Oe6@5B?y&W;mGA>
zRCmat(SkagZPmG~r(MwkBr01?CR|GyWxRIcP$Uj#w07@CT8m7r-KQr_w03_^YY%7^
zpODwu6E*HhhDM%jUEkIy*S9*l9VxSWu&th+q9=N)W;xN*(-J*By~*suw6y(;XGG$e
z88tm?BQ-tSRMT_xoQayAn^V*CG>6a6tLX(A_d-KWFS2%PHQ~-YT9b~1hKkI(0^n!>
zg!Zt$RO8qy6H%t!2Mc>~Tg|;h&;8QuhJ9J0x0g2=3BAP&Azl%QS7y}qs*Tk4YEx~m
z$*b+PIkmk`v-kSE+TNgXZ#2~QCJlb5t-x>A=(p(k6H|F>BJ$f>UPyU7@%Bi(BO~!U
zH<I{Wro`{oGbV=eo}9$*)%?9LFY)^|?gNIzAGAi>844Kx9nGX4X7Zu7TKlk``6F2~
z`DmiEkG0%T>&O%zkHjZ3YI}GiwSCf5+o$qs`*coipV16{Hm|nNY24=xwSB?bq16W8
z!WT(C@3DW>!QSq0q<bx&e_w2?r!VQLzMR$5R}wvawPjmsH1V}ad_AM2Z)~KbZ<<Q_
zR$fWp&ME0Tn!E4jmGnK0`@W&1A87Co+sgYRjsCHoKiN$`NhJPh>_A%i0`ap*{G27=
z^o@_J$}g<j)pEE?@G_yZ8pbFJK1~QMOlfS$uh)?pQe)ykHQKP`Uk27W7;&&&Kq`I}
ziC=edG{Lv?VW;7E$WW9KFo@qIjQ;^&AnB5<&TX(F{!m>i)5p2^Bi6OLjHzJdj}gUC
z%C1!PSBQJ*yQ8kZBK{<G&;L^ni->||FnIX06xpA1WHwtxq*bA`U#WJ;5r4snn?CWE
zO_m~eDu};|#9wEO>TfnOs=qaj>hJWTCJyWGb4K+K+64YFZ&d%JasSNQfzB{w>gYQ7
zFDd!{l`nky$O^>2vAlBymWcx`tmePBwZH$+6Z~hBSH(!+i2sVjf3tQd)v>Qy3!PoQ
zEh~rz#Q!K}DZ3VjK;nM`W-`gOh~GwX6XGrwd1%l0@bE5N`J6x=MZk;MTFY*&(o<O=
ziyX6IiU%}cULFmqfJLEGGfD2qV}OX{vG`TFTP->GlE=}|l+aBBk0&6dZ*jb@uHk1H
zcV<f5$j$3wP5?$-cT%ZHc_N^Z+(Nx5;8n3_AWtFyB~$16`nGoL*xIpeYsb!cc{0F(
z+5zd@mOO<=ITgQo0ZyZ#vI3k=z_tRMu`cFJVAQQRbCAiifQjVU_%-cYo<oBjIq;I_
z5)H*_I`)$15hRYsTZS&rCn(9mVU~)(<OKwz^z_`kyij*b$6@lK6vf5#P1)_l?&T!}
zYo*ZTrPQQEv|jE&UPd5dXRZLjWAm3C1SNlxiMZtDgos(X0^jNkPABx_V*rlimH6%A
zfoV5z*hv=DN&R!uUqw)QJ(w)Hei+CC+Eut3%1ZIrW~?o{fRE(W)Qfb6^nlLD%WDW2
zGk7h&12%+KFdy$exs^xg#%~u}+_+b*E!09vongoIqy{O{H>r>pMfRpplqFFL;PK@e
ziz)j7j^uUt&D-lX>YlaN>j~J_UbnA{*#S(GJL$EIFXMf3Cs2{R0l#Ygv`G!nfU$aR
zq;Faa!=!FXQQS=5?abho6w$5tZp%r(ybY*G4&pb@$*$B8L-d{FWH?1JLf`E;8BGz5
z;afRoBONJs10Kn7{Hn#~LwvM`JQ$8Pc{`1e?2$XDNi#83EC1@qJto}*H7P&HbTdv(
zXKEceX;My6lcb9&gV2_toHmIbOU>K^lbkWBO4Q^REV_pv=ZAr2O_IITq&?2F!6F;-
zPLpCEH93E@cVc>Ue9wra!=0_7P>}oSn;z-LTz|oKht+doAnzhLJ+{$XlANO!*>UO;
zBJTze_YfkQ9-Q4R=ZT0eMTMT8qOa2D#e4jP9()G{`8Yz8UZ(fY?w*<)9GV@Unv@3!
zN)`%U9&b`i56%oul%$=aSkM$RPQ#bsUayJlh%6H{S<(tMNo%E%!I`1m%$q~7I_4?#
z3>59fpjdXK*Hf+*F@P)v#USw3aOxH95bq-0E51B<U6I~OE8VL*w;$NPt-Fk~+z)ni
zFO|zXyCG0<JvanLK9JsC2a4t8I;K)%dbOo$=;8+0qo<aTp%|<b>-=JR00A(bDh{kS
zZhvooZ+Gtv-Tl3@{e8WC#j(M?!{f#N{+`~RzMTlkVP;6J;THFZID2F&`29+t1b);a
z{63YdSc9X4mEbk{QSw-ji)41RL1y<)kH{rz(YdGId}I}E6}u#_AF>8uB=5m*JMVRn
zhDc1^rDi+tRX6E8YPR=YzDe1jX3l#FlSooC@4W((Dx_w{do@jxWonw<YsI8kr6%cY
z)R%QTlxx(!oOIaPG1|GUcVB0zbKAbonNFuO=-f#kvmKp)P88%JBF#Fj!vMy?lkKk9
zYj{I(eMt`~@?N5Exx7gCR%Cl>2nXeT)Vsi<m;I&}j(awhFgWslqE6Q30cw(0t<VEg
zGQ|@J-kRcx)FK5jm73v6fMEt&fw*)-!Jn+)w1)5!ct<KV8x4s!ad;Z}pdOYo;PNTd
zqREl|CegHfPbE0rvG5GBLh%Yed`PE)#|-&2LJ}|BNzM6mz`zR)wTKYXO@?{~QB$rO
zLoK*XW29&5k+_c<=~-$dGMSpU=qCd`n}}Nqc@DM69EeEud~VXy^_P~Mih9}$<nwgT
z!>9(4&(}Qz2ak8OuJQ$%fKRX&Qj1PO5b&#?e35~FaSA^|dXq0P@Gni_M@bp-Wd{D`
z)S{>d<Bx-T`3eL5N@|gMfkrLLf{$b8RR+bYQxyAb=^_0pUt>_bmRh8p05Ls100#1P
z1WL^A^(_iuIa46t01(!YrVjDo9q*zy5+OY}7CQHLch<W*D;=G?2RbJPI!jwS7Yp)D
zgr}n%k3eMynLcIaB`yvM<U@pRt=gNZMSS5b<&_QOTL_f!^;T-qjTbwGL{HZLZN^A%
zrxuxhOs7oX9e_dv>c65Clk|V5?g2wwb6n&=$e7=yp)tK0=iNMxN{_WFIOKZ(jpTdr
z+b%SCAB_}Wpx;m5B$NsbK9E9vkiN-Fsr!-qPzv{9e5-4!@hl@h0(c}pir-A2`7!Fe
zL7@3@qA>!^PY{H3$5BaKR3aZHDEYv2RPadx#zK8ccQc}bPp2q8L*KM>N9~$BzBuV~
zo<M$<z{wJSj+$f=l**EyPxb!-eYd;Ie=$Y$C48&c%3%M?07vpG_|3;wU#0HZ*y?Kp
zY#UpBeO=5qfN83X1=kw{@|%D}@>}@LEX}uRkPVjRJ49nF&36fsTbl0?G`lq4Ct$oZ
zKhWKbrTJls;z#sNPA7hml|N1)e?s5w^#0Qn(a-R$5;>_782NKRBl!#bcJc7j2t1Hi
zlfR^%$(sL)nshqMIAvc}^a%3T1SebI<LEbNHJd#TJgT}x8r>}Fi^~#ev&C=g$6J@6
zk$;A6y%Qk8x0xLjWyDoU$qBKN#ffa%Ed&>oY~iC#-2v5xj(eTN(k7QRraqaKoGD^K
z`63<FMqtX+r}BIT9Horpo{=xnRRpJ7T~HcQH0u;(ARmYa|2VnPs%nValr3x}Krm=h
z!jL97ay15q&~+E<7Gr=0{F$kmw$*it+YF&DSTMl`?<Oh{!-QjT&tRQGR0LjHg{shV
zZXSi6WGdj4N*B-OWk>1aISQ&O63?|B!j_xM6=#BRj;eF@h(IJpkS<3ALg!~l^Qmu=
z>=CPL!{uuoU&YoJO^}oyrYjMFFf!LgqecDFKG&>6%p&!&agSWrbY3inH1pJiPLkp2
z8blzl^){%8rQRr#Xjc$REFYl&k%l)5o#_ck7n#rt2(i}oU8mR<%H(a!4A-kZ#Q54*
zl9i;sX)MDxWNHuR#d&P&I1$iOmmZpx$K-gq7WhK#<1S*im5j@dNL30`@gXXO$;~Es
zt|+|J0&J7GZ2fw|j_PIW77|_#T)OD(3TE4=c|-XyT^c#z%QeVX@{Lrv-E0Z6=+xVo
zYK^bL=<AkM7Wn94!PKQexp4JxcC`h^it6=im^<*p)#KN)0y5{!R`$vO;=azc<K38*
zW9>}UdQbHNhSQZiU6WS?oUbC;Qo~+mq8CM*q=2MKyg#m|$`*-}J^p`o#5_tr>4aft
zri#_Kfwx=$FRqUzVM6Q*T^7H+b(*69l&>tQs`8y|W``qj!x2kZ2QYSg2TJM^Zv^lN
zb&og2{NTpfNY`853^)mts<ON#*6FQ$?&ga)Z$lTpOqhRAFsPZ|l}*Hmp-2qp4QM1b
zpi#C*6;6pUuEN?NA%VhA;yDQbQS+&8dZ_PAN2cNq4d2678b_33LW3vuKyjQXrZi?+
z55yrXDiq@hW;C2bS5eaNS++n-pkijRS0nCh8?K3c8gH>O&FqHQud#QrZ5fe1Dh^{_
z?rs~&q3n>fGpD1tc@!PedYL&4aezC|#rX?t3`$?jqY{y57mXxETtqmh5)>`c1>UQf
z+>a=0?ka4g>C}sGV$)h=)5>LE#8P#~`mwU8>XB=0-YUdBkvPb_o9TDq>R$EWNM6y4
zgx|%M7~h3crG(^LTK8I15XS0PkH*vVR!)B;q})NMv2hHRs<{`-M<{ey;f3bM?*;w%
zy~-L)zY&TxURwt7#X%g>uAucKDh}t~lf}J}h<FFYFUjIQp3Zni7WW4fTg;11J^u$5
CP0;xO

literal 14179
zcmcgzU2hx5l6}{&5CRCwgC%l4^yN22vSckRSrC;C0^`CMkz<OR5r;b@Wos|?zwbGx
zx@UTZBge_b-G?M%cTab9b#<LnRh{v;EQ)-*nw9hA)+GOut&7!UHePKlqOG6DpFcmW
zXT@qZ|NME&TH~$N-6Gi<?T%Jum0xD7eDplt-CCquKTj41Xuq0|XOn!svgX5$mZPoZ
zX!o`%zrEmJ&lp<S$YYG`X+GInV*J@-RnE)NDs$6DLoOFZ_~!lWIsff(w#t7gvua{<
zMKL<wJwuA~Y?ZmTL^E|;C3i%@IgvKy##8jpCL;-dGb+l}5_^s)bF`~@Pgjq><kQ)F
zl>aw-PAFeIq!`~;RrYbcTCDX=OqoCZ17qTtnt1oT(jsi=QEQxP5a+m>`za``O>xLx
zEV;&3XIa5Xj?j5ut#kf;%<k*_=^?KuZ+x;f`svdyM8zRp%&NRPEv5sBZ4I;e6fL`N
zw(C>GiHteOpQ`&E?f&DZtwl2A{5N?%$tQRDvRqf=oa-d@9uw{HJg@hdboV$wC(N&`
zycQDd7_;8bp7LTgch;30P@f5p<SrkV)x>vmwP44Ic6^&vP8$h!ynB%qOR6J<xS09$
zIV-aH_%R>hpUJxL2AIO&CySJ(bN^W7+2pn?i_z?V^eM&WNso5zC_m)SIn|w}=t$H-
zQ~OY6Flg!!T|B1IrH;+o*=Q&BSbjY#=c}qLE{gIi+qsEaQ0?OEF(3bNo-gt_uG4rX
z&8FOsJKY0me}t*Ha%bQHkHF7&fK!0vU0DtiZuo#ZpnQ<xpth_7$=R{p0}3g_JCKAI
z*{rzwa#QNs^7ByJhY~L^??Z~zxlo682U_NRNL_1{LmB_3eI3?f9!ku>z78p3xX6Zm
z9YS;{;|$*GeEqbr%YLZ)dc^xWnoZ|07;NWAW*kLtwvXOyr*F28d25eMm;X^dd|b$B
z+5|_^<q>r`dUtwv_Wt(t{ym3N)cv=E?8|a6&a3(U_;Ija=G9<1ST5%;FqT2KDzfF?
z*RuK}nGWb~Cwt$H4?iEKdt=<{a(T2j9gmOq%EfB%TKj+1(!3pvpP#UnO*)@VA6ErT
zXWy?~<%@E#{5p8bmaDwl+grTEpWzSkdG`6W$>U)>+#4S6Md^JU4Wq&3>96NkgE-zF
z?nlRP49itk6sNc_KP27{D&qfPAGYnky^(*ro=rYnL6{8;@^1=C8`LE^T~B6k!*Gpk
z3f;|-F0=Zt<}-Rub9zVNbw1X0ZacqYUJ!GBHhW$@&kO>N=|;W(IR^B?@0tMR0_z|1
zqSW07?7l3@hpad^2EyxiOmF{bdz-iJSipP!>-Fu$)rWU%AoR-ZYTAn#RAf>ghf<$N
z>f7J%-+#QhJ-s`<9^u;)irsvBm(RjopM;X1NOE_VPbl>M{s1?TY-xa7w~xOm>xs5-
zhs#y1ex2ij)0>`f1Adby#(N~m>Dm3&#~Y5QcX9vwEw^<-;cq_P@b73S;k7@Yt2;T|
zz+l#BXzoaZfT5yd(NNAP8d6@@Lm{IfoDuQAm=b*QZ!6b1*k~aI7+s!~PfxRYQ0KQ8
zKs1DH(VN1BEw9e~`bPwoXvp22eYiS5|K(y<2*08sHV6^M#cZ-adEhda8SLV-Zy>FR
z!0tFHE&%M!5h`#!&S}i9O{t=&MvN#jzSNMaNZc+&1ZpB`;H{=r5!jsro(Rki0^qB~
z$LGANz*6-UPsgEe1agNV4Y`UMW)~T?+XSvi6i?U|8M6zZD~gE~p`;tw6~(6RP0EHn
zf%#EGAblI8Ga~adOpT1R1-KlEu7&Gzug2U&02&R6y_xu=X|QgP$WdMy^^CyM8iS9(
z)-b{oM;Rcg8ctv0i-?;M8EflNm*|_VNAfn>4b=s{_Gjt>nRA8&gP%A{O6_)txpfFm
zB+lj*G!qFdNgS=Kr&N~G(UWMJP2*Tv$C5<Pyd{yIwJZt5%%2w68Txuu(@?d@xLT+h
z5w%d#O-mw!!_2s2*P;SWIiPSfB9OODBNBnLT{+$sC`YU<T#`m)1g@i;hP_2b-&*lY
zBnIbIL$cOV4TzcxVeBjLngR9z2S$rV>;;d4->pvPMC4jP@%r^?WRF-Ak>a&Y4eajE
zObyh}>9diAb186%0KuF36bPF>4T8f<De&#;(?GbRPoc0)1Js4&ZG8fK8>a=_<$#Vg
z9`oLMl>>G$B=Bp%-aeJr(Qc2%PeBNa=_|+a&TgWP12B%oddyoWZksX;56xQu9_nV(
zyn*8GINWkL3xGLoTQJ_e_yBN!<pA4|DLe~ccl-EhCBSYDYlSY6@LOWXhTg5Sh=tuw
z(V*3BMaO_`r|2*|hx~srIFIF3W59o}Ze!8_mp>qUw@f`AcK5oW+Zebm-4;_H^fOY1
zPGX=tG>j+#3$&?XtXxeZ)^%SlU>zJ!G`ECA<Ai7zF%X?gbob64C2V4$dgl;hpt|3f
zWom*$jFqejjYa|>z0^UmSXmoS+hU+P1!)~~41D(s0nyPPqFfAQ=dK`pgK;sy9pg4F
zJqD!La~aERvL&&=JQRBKGyv^X)o6tX?1?BF1L1iJg7vP70PB7=fH`;8`0yB*zG3Gv
zK%K+d3Q#7->>QYm{>ER#K=XPDskdj-KyyC^Fplqo>m4fv^ZiW&!@233`}Lx5DWVvF
z&TR|AujY@lhuP{jLuf0VAn#HyD1k+4s4W0^-6L_$aM=ay_FVvM86<Oxx5%c=5I)bx
zFGhG{AUKy6ZlBGc!H9eu6f3=AngV2V4udN?M=o(_U-H&<&k7J-FE7cirgLO1z@-rq
z-hyx|%7}&4-l+hiu|#;Nfa=Xd1zK}h`%r<_em!6``f&y!|BV6HHBQ99X$%R@9av4X
zZ)KSVtzYJs0O9zs$0(G3F;xMLF(xz$fO2~qn>PU{UF+B54^#|f=HVz4(^au>*)6I4
zgqi~=x0mFB0hb|JM{~esuQ{MG`n#G_IPA~J!r?%3jE2n(8eBA_<`oF_Y*xM!=-sbR
z3!s&1cJXuISrkBj|B?ZNsZa0Q>eMf^08FM%1;kyQDu6bfTKL>^)WTplrq919bawqX
zmrW^Ro&_LSQZTsbNRa@3-H{|f-ChMHK;U{z&xJ@7Kud}Qm`N$F^W`#|`lK|_6YD2}
z%rD5n7H4HqR%fN6#f0JSPoK7T9||Pnx51Js+}CX$SpuBIWQZ&u%4OdANYLq$9tkiL
z!(373!wj)FcAY2$9tug3wtIm8TQ3$B1Vd6n{Q==iEFMM(OSuB!h@TYhD=Q}*=`1+T
zim%zrvRRcL%2r(><;+qH9cv<3^=O%(?g5FFR_LTvk`}Bc2CK__bwRyxBEwWm_aug@
zv-y{@7J#Vg1kiSx4$>Ku%q{G5C5f=L77hV2gu5uKr%Z|zxbAFU?4-lrc1AntZ##E8
z`Ob3Zn19@F@1XTsk~NzOJbMC|ZKB--XzO?0N}?q~+*$?$UC9~btP&w_Ge}ng%DI99
zD1pJP(~SWxdQWvi>K9V@eu+EDAJ$0o1V?U|>joL>+8MV;=}!1jx)oouYL3cKt#C!o
zrf_7s^tDVu$Xjp1DjjVWm?(r!WV_>XJ;w$!lpdd%T}cGQ&F6vA0Ye-hIIaf}kw?2w
z!#Q`V{!nyaF}hc%A~gptEZ+HjZ|7-mXR^KX{_W27+nv#yoiF-YO4l{6cM5d&riF#x
z@fK+)?}ERiRthP~=`^1-BrH)a<e%Hy|H}`o7J?eyI0u=xEsvUVnFZEP=N4LHx&Jix
zpznF5{el)$!^T&>2$d+Lwi9tqrQU)t+qz^DO-FN~WsbPfN)0E(@j7jp7+Uitw#>w^
z+KFsv?aZV-3`asY^O6^=bD8%ePV3};GsEHzRXOoH1XR=60{+{TL7+ALt>R{nO2)tv
zVRg4nCZysN{uPv(6XA7l2aF0U6JL=CFXsYC$_D`F(h8<K%P5!KZIdzeu0WIO?J%4>
zT`Y>(IOF2iQ&}63T1yk<?$+}7ln4+EPrF!PRM@IpahI>w)!YM-0NG5S4!sgUvreX)
zENKEUJ1ihI6mnb5=I}Sur6(wofR4Amk3MV$LH<zMg;m^)1prelt}7a1pW9d+LE{Y1
z5WTEK)f2_ge%jQ+=y&ty8D0Q9VREdTDvoxSE44WK-8Z3Q${^aK0bL7beGjr;RxkRH
zAkxgOQ^M-k*<t|?rx7?GS}cg5dpj_Y-2Nc}fgFbE`@D^Y-CA#2WlxxSQ2%I+cqq$1
z5GcHT%UD9g*ut^+AvnG(%N2jOM)^iR2tu}l5tFsurs*JOyS1jz?Pd+GWp4L1dug}Z
zwN62UU@5T3o9u}WJyrgH!=6(kKjw3qKq(dTsgK5}4>Na)YdM{Gk8=?z69l8(rV7hQ
zPlI^C!WZ~6JZ!NL{JKPir-Tjbh?P5NR#FP2#%$d@8mY?fnv#yP8LqTXvoMb0{$-*4
zg8YOc@sJ?4)d`vpZmaxM&u!FMm!cr<YQ5x@trr#}suwm&WcS2Rt+-)(_nr?GU~BHb
zIzwE$b3Eg*hX?HJHfU5(1s?=|yA!pXg-(i76XeqtrAm!b!7)$=r^PH=>JF!(R{nxA
zLt!zgJ(&=3(iz<rYdo0|fO{-Um9{W%)g}+An3RzR82)wkjq<1@v4^J__*1S51_$JH
zWH?nxLTg=;Nu^>^HhZ6yYY5NV)!<V1prk4nIo_1yOF2S~;$hc^W7Ub~kiAK$M&ajT
zH9~nYv*~&aJ(hV%+i+v@U|RS>!Q|ZDC2;8$&q|GFA^dShL5f8O)@u|j!KzF+(5YI*
zkS?tWYzEDrGLZn;>Q_KqieLS>|EZNtQ>=f4KC#Z_4C=qM#@&4KbeYfjUGt|IZ}=!|
z(0(FD=~~fk_(NZZ4Ye~=<7T%6u3ld0?XU$d-PA(|&7YdLdkz2Mz2vqo-@YZB0!68m
z4Rpe74D+%q?uNfjioQ2cgZ`IM+>e=O7sM%hAGY%g|3Hf(27hby=AN*(^~-r4tE$OH
zAwE3!>QTAPG<*P+T5avTFwdl#n#TvLsbPA&(h1PrDr-htQ>(2t=I$?~N^4hhT==Gs
z_s;5Ujkveva@DwU)!g7|aA7y>n;(nCr3wpt?lD#BP6>w85_jFaWvc9*8v)4klY3jl
z#0UpK4^xEz!Cj@m;{M$>p>z)cO~w0rJK(?Zf@u6VABr{#!*Nh7%1i3F@#2HjSbKF;
zxZk?)_=7Xh|JHQY(k80ji2#Sh!FYrEL>hEq>?)&-L%tBY0tg6xK(E_=9jMwu{{_Jp
zQmS5|J_N5&8A!FRC(A~h8ysMi^VO|~RV7EXbtXnIA_QY(x-7p;plF__DIxNy^E{1^
zjn6k&7hoGY)8o)4S`bQOXe)#;v~EWb3^lp|1ei-t&aw#~l;{%T^#%{zi-%7GZfVMg
z4z!O~yvr8ffntvac|qWCv^8}zwW0;pBmSv4T*`0k(UV4QPaMI!60$P8blL#yHt->k
zoYkFI;sdz8?}P{Ft(^mXU;V=)AqRXvIKT)W2D};@V9bv}GY0-}WI)jvNini%2LR1B
z+U?5s8;60F`LIAo+l_LK#cTux^^t}bx~bRz4QT8eaUOudnZm140MNn>d7b(LMBJFh
zW^if_Cxj)f4)_kkl%_Rg`@$93*(TWswz#EQbQ_@Jo4Xua)ghTRFooBF?;n^+6{u*L
z9(t`*Qy;q)&=|RHF=)N(&}>-1IJfFVqTH@b)InLnj;@c@h{Bk~6^Xj!6t?x}#0Y}|
zx7dnT=xi)g1pw<%b)>2`PSG8q9(_1^Zm&LSJM$x6CFgwbvBAxexpHgOgq$TN_=~<B
z_p)*9vY{Oz8AnHe<t;9bt{=Yd^&NiA|J3w5AmUh{A>SbnM@NfzcW5}eLvS60KlH{B
z(TM+_NIE3E`>Eviyr<jQq2QFNevue5aCH1jcE)wTL%%tFn{98fZw~nj<l6-9A=$5S
zZ+sBY?H2V$SL2v?`mJAb)<~_=q0%s0yj$s2SHH9hXl+J;%ZKw(X4Ty&D}^@3?5>n*
zp_}yDs-lfZEq1LOE4&bdYv$u}dS0bMXHPYaFP99*?VZtPxubbzWUq{nc6T)wl{V$X
z_>>5hgjbUH%%j>GmMO&ybzP=;RAkA~x)Pzp=$}`fEJ50-|0z9c9=xyo$5+EsJ0i;_
z_{54m95xT%ld9)SV)`kUsi#AYkW0nRH;RXPSd5`oJA_rSuxTHNIk##Td?D-<6j_FF
zqcUX=g{5o055|(+asyuk`$;S_h&6oO$KC|n=av>k=Y=aP@<DL@rI*eZa`+6m?v&+!
k=~i+15}0aH5jWhb5qYfC6fyWD*iR=KzyEWwh_?3s4?3nZNdN!<

-- 
GitLab


From 955f5d3ac0ea2edd1da0c9ca577182ddc83f3819 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Mon, 21 Sep 2020 19:54:00 +0200
Subject: [PATCH 332/422] AthenaConfiguration: Fix confTool behaviour for old
 configurations.

Previously, when reading old configurations, confTool would merge
together the two dictionaries that were written.  This is needed
for proper handling of JobOptionsSvc; the properties we want to compare
are those from the second dictionary.  (The first dictionary
contains properties such as the search path which we want to ignore.)
This was changed when confTool was unified for the old and new
configurations.  Tweak it to get back to the previous behavior.
---
 Control/AthenaConfiguration/share/confTool.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Control/AthenaConfiguration/share/confTool.py b/Control/AthenaConfiguration/share/confTool.py
index 7e6054d81e18..3ae4bc6447e5 100755
--- a/Control/AthenaConfiguration/share/confTool.py
+++ b/Control/AthenaConfiguration/share/confTool.py
@@ -123,9 +123,9 @@ def _loadSingleFile(fname, args):
                 conf = [to_json, props[0], props[1]]
 
             elif isinstance(cfg, collections.defaultdict):  # old configuration
+                cfg.update(pickle.load(input_file))
+                conf.append(pickle.load(input_file))
                 conf.append(cfg)
-                for _ in range(2):
-                    conf.append(pickle.load(input_file))
         print("... Read", len(conf), "items from python pickle file: ", fname)
 
     elif fname.endswith(".json"):
-- 
GitLab


From 6f8d6600aa71ab32c242671e48e40cb26f08ea84 Mon Sep 17 00:00:00 2001
From: Nicolas Koehler <nicolas.koehler@cern.ch>
Date: Mon, 21 Sep 2020 21:05:52 +0000
Subject: [PATCH 333/422] delete commented code

---
 .../MonitoringFile_CSCChamberEfficiency.cxx   |   4 +-
 .../src/MonitoringFile_CSCClusterFit.cxx      |   8 +-
 .../MuonSegmentToCalibSegment.h               |   4 -
 .../MuonRecRTT/share/MuonRec_plot.C           |  85 ---------
 .../src/MuonCombinedTimingTool.cxx            | 178 +-----------------
 .../src/MuonCombinedTimingTool.h              |  13 +-
 6 files changed, 4 insertions(+), 288 deletions(-)

diff --git a/DataQuality/DataQualityUtils/src/MonitoringFile_CSCChamberEfficiency.cxx b/DataQuality/DataQualityUtils/src/MonitoringFile_CSCChamberEfficiency.cxx
index 0b955dae7fca..101f4ae32937 100644
--- a/DataQuality/DataQualityUtils/src/MonitoringFile_CSCChamberEfficiency.cxx
+++ b/DataQuality/DataQualityUtils/src/MonitoringFile_CSCChamberEfficiency.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /* Methods to perform post-processing on run_nnnnnn/Muon/MuonSegmMonitoring/EndCapN/Detail/<Collection>/CSC* histograms
@@ -40,8 +40,6 @@ namespace dqutils {
     bool dbgLevel = false;
     if(dbgLevel) std::cout << "--> CSCChamberEfficiency: Calculate chamber efficiency by layer" << std::endl;
     std::string endc_label[2] = {"A","C"};
-    //std::string coll_dir_label[2] = {"ConvertedMBoySegments","MooreSegments"};
-    //std::string coll_hist_label[2] = {"MuBoy","Moore"};
     std::string coll_dir_label[1] = {"MuonSegments"};
     std::string coll_hist_label[1] = {"Muon"};
 
diff --git a/DataQuality/DataQualityUtils/src/MonitoringFile_CSCClusterFit.cxx b/DataQuality/DataQualityUtils/src/MonitoringFile_CSCClusterFit.cxx
index 5a526840e292..73e7d37cf2d4 100644
--- a/DataQuality/DataQualityUtils/src/MonitoringFile_CSCClusterFit.cxx
+++ b/DataQuality/DataQualityUtils/src/MonitoringFile_CSCClusterFit.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /* Methods to perform post-processing on run_nnnnnn/Muon/MuonRawDataMonitoring/CSC/CSCE[AC]/Overview/lfitmean histograms
@@ -44,13 +44,9 @@ namespace dqutils {
     endc_label.push_back("C");
     
     std::vector<std::string> coll_dir_label;
-    //coll_dir_label.push_back("ConvertedMBoySegments");
-    //coll_dir_label.push_back("MooreSegments");
     coll_dir_label.push_back("MuonSegments");
 
     std::vector<std::string> coll_hist_label;
-    //coll_hist_label.push_back("MuBoy");
-    //coll_hist_label.push_back("Moore");
     coll_hist_label.push_back("Muon");
 
     f->cd("/");
@@ -62,8 +58,6 @@ namespace dqutils {
       if (!run_dir.Contains("run") )  { continue;}
 
       std::string run_dir2 = run_dir.Data();
-      //int run_number = atoi( (run_dir2.substr(4, run_dir2.size()-4 )).c_str() );
-      //run_number=run_number;
 
       for(std::size_t iec = 0; iec < endc_label.size(); iec++){
         for(std::size_t icoll = 0; icoll < coll_dir_label.size(); icoll++){
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h b/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h
index 63a2daad71d6..e0f33a3339d7 100644
--- a/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h
+++ b/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h
@@ -44,10 +44,6 @@ output the muon calibration input.
     StatusCode execute();
 
   private:
-
-    /** retrieve patterns and segments from storegate */
-    //    const Muon::MuonSegmentCollection* retrieveSegments();
-  
     /** retrieve patterns from storegate */
     const MuonSegmentCombinationCollection* retrieveSegmentCombinations() const;
     const Trk::SegmentCollection* retrieveSegments(const std::string colName) const;
diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/share/MuonRec_plot.C b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/share/MuonRec_plot.C
index e247ee34482d..c1b03a4d6995 100644
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/share/MuonRec_plot.C
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/share/MuonRec_plot.C
@@ -76,60 +76,33 @@
 
 
   //c6 Canvas 
-//  int trmaxmboy = tree2->GetMaximum("MboyTrkVT_NTrk");
-//  int trbinmboy = trmaxmboy+1;
   TH1F *mboytracks = new TH1F("mboytracks"," Muonboy tracks per event", 10, 0, 10);
   TH1F *mboytracksqoverp = new TH1F("mboytracksqoverp"," Muonboy track q/p (1/MeV) ", 60, -150000., 150000.);
   TH1F *mboytrackspt = new TH1F("mboytrackspt"," Muonboy track pt (MeV)", 50, 0., 100000.);
   TH1F *mboytrackseta = new TH1F("mboytrackseta"," Muonboy track eta", 60, -3., 3.);
   TH1F *mboytracksphi = new TH1F("mboytracksphi"," Muonboy track phi", 60, -3.1416, 3.1416);
-
-  //TH1F *mboytrackseta = new TH1F("mboytrackseta"," Eta distribution of Muonboy Tracks per Event", 112, -2.7,2.7);
-  //TH1F *mboytracksphi = new TH1F("mboytracksphi"," Phi distribution of Muonboy Tracks per Event", 72, 0,3.5);
-  //TH1F *mboytracksimpa0 = new TH1F("mboytracksimpa0"," Impact parameter distribution (mm) in Rphi plane of extrapolated to the vertex Mboy Tracks ", 440, -11000, 11000);
-  //TH1F *mboytracksimpZ = new TH1F("mboytracksimpZ"," Impact parameter distribution (mm) in Z plane of extrapolated to the vertex Mboy Tracks ", 800, -20000, 20000);
-  //TH1F *mboytracksX =new TH1F("mboytracksX", " X at closest approach (mm) of extrapolated to the vertex Mboy Tracks", 440, -11000, 11000);
-  //TH1F *mboytracksY =new TH1F("mboytracksY", " Y at closest approach (mm) of extrapolated to the vertex Mboy Tracks", 440, -11000, 11000);
-  //TH1F *mboytracksZ =new TH1F("mboytracksZ", " Z at closest approach (mm) of extrapolated to the vertex Mboy Tracks", 800, -20000, 20000);
-
   //c61 Canvas
   TH1F *mboyhitsontracks = new TH1F("mboyhitsontracks"," Muonboy Hits on Track per Event", 50, 0,100);
   TH1F *mboyhitstech = new TH1F("mboyhitstech","Muonboy hits belong to MDT/RPC/TGC/CSC=1/2/3/4 ",8,0.,8);
   TH1F *mboytrackresiduals = new TH1F("mboytrackresiduals", " Muonboy MDT residuals on Track per Event", 50, -5, 5);
-  // TH1F *mboymdthitsontrack = new TH1F("mboymdthitsontrack", " Muonboy MDT hits on Track per Event", 50,0,50);
-  // TH1F *mboyrpchitsontrack = new TH1F("mboyrpchitsontrack", " Muonboy RPC hits on Track per Event", 50,0,50);
-  // TH1F *mboytgchitsontrack = new TH1F("mboytgchitsontrack", " Muonboy TGC hits on Track per Event", 50,0,50);
   TH1F *mboyhitsrpctime = new TH1F("mboyhitsrpctime", "Muonboy hits on Track time measured from RC",50,0,200);
   TH1F *mboyhitstgcchannel = new TH1F("mboyhitstgcchannel","Muonboy hits on Track TGC number of strip",500,0,500);
   TH1F *mboyhitscscwirelayer = new TH1F("mboyhitscscwirelayer","Muonboy hits on Track CSC wire layer ",4,0,4);
 
   //c62 Canvas 
-//  int segmaxmboy = tree2->GetMaximum("MboySeg_nseg");
-//  int segbinmboy = segmaxmboy+1;
   TH1F *mboyseg = new TH1F("mboyseg"," Muonboy Segments per Event", 100, 0, 100);
   TH1F *mboyhitsonseg = new TH1F("mboyhitsonseg"," Muonboy Total number of hits per Segment", 20, 0,20);
-  //TH1F *mboyhitsonsegX = new TH1F("mboyhitsonsegX", "Muonboy Segments X of crossing point (mm)",440, -11000, 11000);
-  //TH1F *mboyhitsonsegY =  new TH1F("mboyhitsonsegY",  "Muonboy Segments Y of crossing point (mm)",440, -11000, 11000);
-  //TH1F *mboyhitsonsegZ =  new TH1F("mboyhitsonsegZ",  "Muonboy Segments Z of crossing point (mm)",800, -20000, 20000); 
   TH1F *mboysegtheta = new TH1F("mboysegtheta"," Muonboy Segments Theta distribution ", 60,0,3.1416);
   TH1F *mboysegphi = new TH1F("mboysegphi"," Muonboy Segments Phi distribution ", 60, -3.1416, 3.1416);
 
 
  //c8 Canvas
-//  int trmaxmoore = tree2->GetMaximum("Moore_nmuon");
-//  int trbinmoore = trmaxmoore+1;
   TH1F *mooretracks = new TH1F("mooretracks"," Moore Tracks per Event", 10, 0, 10);
   TH1F *mooretracksqoverp = new TH1F("mooretracksqoverp"," Moore track q/p (1/MeV) ", 60, -150000., 150000.);
   TH1F *mooretrackspt = new TH1F("mooretrackspt"," Moore track pt (MeV)", 50, 0., 100000.);
   TH1F *mooretrackseta = new TH1F("mooretrackseta"," Moore track eta", 60, -3., 3.);
   TH1F *mooretracksphi = new TH1F("mooretracksphi"," Moore track phi", 60, -3.1416, 3.1416);
 
-  //TH1F *mooretracksimpa0 = new TH1F("mooretracksimpa0"," Impact parameter distribution (mm) in Rphi plane of Moore Tracks ", 440, -11000, 11000);
-  //TH1F *mooretracksimpZ = new TH1F("mooretracksimpZ"," Impact parameter distribution (mm) in Z plane of  Moore Tracks ", 800, -20000, 20000);
-  //TH1F *mooretracksX =new TH1F("mooretracksX", " X at closest approach (mm) of extrapolated to the vertex Moore Tracks", 440, -11000, 11000);
-  //TH1F *mooretracksY =new TH1F("mooretracksY", " Y at closest approach (mm) of extrapolated to the vertex Moore Tracks", 440, -11000, 11000);
-  //TH1F *mooretracksZ =new TH1F("mooretracksZ", " Z at closest approach (mm) of extrapolated to the vertex Moore Tracks", 800, -20000, 20000);
-
   //c81 Canvas
   TH1F *mooremdthitsontrack = new TH1F("mooremdthitsontrack"," Moore MDT hits on Track ", 50,0,50);
   TH1F *moorecscetahitsontrack = new TH1F("moorecscetahitsontrack"," Moore CSC eta hits on Track ", 10,0,10);
@@ -142,8 +115,6 @@
   TH1F *mooretgcphihitsontrack = new TH1F("mooretgcphihitsontrack"," Moore TGC phi hits on Track ", 10,0,10);
  
   //c85 Canvas
-//  int segmaxmoore = tree2->GetMaximum("MooreSegments_nseg");
-//  int segbinmoore = segmaxmoore+1;
   TH1F *mooreseg = new TH1F("mooreseg"," Moore Segments per Event", 100, 0, 100);
   TH1F *moorehitsonseg = new TH1F("moorehitsonseg"," Moore Hits per Segment", 20,0,20);
   TH1F *mooresegtheta = new TH1F("mooresegtheta"," Moore Segments Theta distribution ", 60,0,3.1416);
@@ -186,13 +157,6 @@
 
   //c6 Canvas
   tree2.Draw("MboyTrkVT_NTrk>>mboytracks");
-  //tree2.Draw("(-1.*log(tan(atan2(1.,MboyTrkVT_CotTh)/2.)))>>mboytrackseta");
-  //tree2.Draw("MboyTrkVT_Phi>>mboytracksphi");
-  //tree2.Draw("MboyTrkVT_A0>>mboytracksimpa0");
-  //tree2.Draw("MboyTrkVT_Z>>mboytracksimpZ");
-  //tree2.Draw("MboyTrkVT_Xpt>>mboytracksX");
-  //tree2.Draw("MboyTrkVT_Ypt>>mboytracksY");
-  //tree2.Draw("MboyTrkVT_Zpt>>mboytracksZ");
 
   tree1.Draw("1./trk_qOverP>>mboytracksqoverp","trk_author==100");
   tree1.Draw("sin(trk_theta)/abs(trk_qOverP)>>mboytrackspt","trk_author==100");
@@ -203,19 +167,12 @@
   tree2.Draw("MboyTrkVT_digits>>mboyhitsontracks");
   tree2.Draw("MboyTrkVT_TrHi_ChamberTech>>mboyhitstech");
   tree2.Draw("MboyTrkVT_TrHi_Rdigi-MboyTrkVT_TrHi_Rtrack>>mboytrackresiduals","MboyTrkVT_TrHi_ChamberTech==1");
-  //  tree2.Draw("MboyTrkVT_TrHi_hits>>mboymdthitsontrack","MboyTrkVT_TrHi_ChamberTech==1");
-  //  tree2.Draw("MboyTrkVT_TrHi_hits>>mboyrpchitsontrack","MboyTrkVT_TrHi_ChamberTech==2");
-  //  tree2.Draw("MboyTrkVT_TrHi_hits>>mboytgchitsontrack","MboyTrkVT_TrHi_ChamberTech==3");
   tree2.Draw("MboyTrkVT_TrHi_RpcTime>>mboyhitsrpctime");
   tree2.Draw("MboyTrkVT_TrHi_Channel>>mboyhitstgcchannel");
   tree2.Draw("MboyTrkVT_TrHi_ChamberLayer>>mboyhitscscwirelayer");
 
   //c72 Canvas
   tree2.Draw("MboySeg_nseg>>mboyseg"); 
-  //tree2.Draw("MboySeg_Ndigits>>mboyhitsonseg");
-  //tree2.Draw("MboySeg_Xpt>>mboyhitsonsegX");
-  //tree2.Draw("MboySeg_Ypt>>mboyhitsonsegY");
-  //tree2.Draw("MboySeg_Zpt>>mboyhitsonsegZ");
   tree1.Draw("seg_nHits>>mboyhitsonseg","seg_author==3");
   tree1.Draw("acos(seg_gDirZ)>>mboysegtheta","seg_author==3");
   tree1.Draw("atan2(seg_gDirY,seg_gDirX)>>mboysegphi","seg_author==3");
@@ -246,9 +203,6 @@
 
   //c85 Canvas
   tree2.Draw("MooreSegments_nseg>>mooreseg");
-  //tree2.Draw("MooreSegments_nhit>>moorehitsonseg");
-  //tree2.Draw("MooreSegments_theta>>mooresegtheta");
-  //tree2.Draw("MooreSegments_phi>>mooresegphi");
   tree1.Draw("seg_nHits>>moorehitsonseg","seg_author==4");
   tree1.Draw("acos(seg_gDirZ)>>mooresegtheta","seg_author==4");
   tree1.Draw("atan2(seg_gDirY,seg_gDirX)>>mooresegphi","seg_author==4");
@@ -257,8 +211,6 @@
   tree2.Draw("MooreSegments_nseg>>seg_nsegMoo");
   tree2.Draw("MboySeg_nseg>>seg_nsegMB");
 
-  //double eta = -1.*log(tan(atan2(double(1.),double(MboyTrkVT_CotTh))/double(2.)));
-
 //Prepare canvas with plots 
 
   //c1:MDT part I raw info 
@@ -377,22 +329,6 @@
   mboytracksphi.SetMinimum(0);
   mboytracksphi.SetFillColor(2);
   mboytracksphi.Draw();
-  //c6.cd(4);
-  //mboytracksimpa0.SetFillColor(2);
-  //mboytracksimpa0.Draw();
-  //c6.cd(5);
-  //mboytracksimpZ.SetFillColor(2);
-  //mboytracksimpZ.Draw();
-  //c6.cd(6);
-  //c6.cd(7);
-  //mboytracksX.SetFillColor(2);
-  //mboytracksX.Draw();
-  //c6.cd(8);
-  //mboytracksY.SetFillColor(2);
-  //mboytracksY.Draw();
-  //c6.cd(9);
-  //mboytracksZ.SetFillColor(2);
-  //mboytracksZ.Draw();
   c6.Update();
   c6.SaveAs("AAN_mboytracks.gif");
 
@@ -430,16 +366,6 @@
   c62.cd(2);
   mboyhitsonseg.SetFillColor(2);
   mboyhitsonseg.Draw();
-  //c62.cd(3);
-  //c62.cd(4);
-  //mboyhitsonsegX.SetFillColor(2);
-  //mboyhitsonsegX.Draw();
-  //c62.cd(5);
-  //mboyhitsonsegY.SetFillColor(2);
-  //mboyhitsonsegY.Draw();
-  //c62.cd(6);
-  //mboyhitsonsegZ.SetFillColor(2);
-  //mboyhitsonsegZ.Draw();
   c62.cd(3);
   mboysegtheta.SetFillColor(2);
   mboysegtheta.Draw();
@@ -460,27 +386,16 @@
   c8.cd(2);
   mooretracksqoverp.SetFillColor(2);
   mooretracksqoverp.Draw();
-  //mooretracksimpa0.SetFillColor(2);
-  //mooretracksimpa0.Draw();
   c8.cd(3);
   mooretrackspt.SetFillColor(2);
   mooretrackspt.Draw();
-  //mooretracksimpZ.SetFillColor(2);
-  //mooretracksimpZ.Draw();
   c8.cd(4);
   mooretrackseta.SetFillColor(2);
   mooretrackseta.Draw();
-  //mooretracksX.SetFillColor(2);
-  //mooretracksX.Draw();
   c8.cd(5);
   mooretracksphi.SetMinimum(0);
   mooretracksphi.SetFillColor(2);
   mooretracksphi.Draw();
-  //mooretracksY.SetFillColor(2);
-  //mooretracksY.Draw();
-  //c8.cd(6);
-  //mooretracksZ.SetFillColor(2);
-  //mooretracksZ.Draw();
   c8.Update();
   c8.SaveAs("AAN_mooretracks.gif");
 
diff --git a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx
index ec1dde08a283..08e2b4979ef6 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx
@@ -2,15 +2,10 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// MuonCombinedTimingTool.cxx, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
 #include "MuonCombinedTimingTool.h"
 
 #include "TrkSpaceTimePoint/SpaceTimePoint.h"
 
-
 //================ Constructor =================================================
 
 Rec::MuonCombinedTimingTool::MuonCombinedTimingTool(const std::string& t, const std::string& n, const IInterface* p)
@@ -19,11 +14,6 @@ Rec::MuonCombinedTimingTool::MuonCombinedTimingTool(const std::string& t, const
     declareInterface<IMuonCombinedTimingTool>(this);
 }
 
-//================ Destructor =================================================
-
-Rec::MuonCombinedTimingTool::~MuonCombinedTimingTool() {}
-
-
 //================ Initialisation =================================================
 
 StatusCode
@@ -50,26 +40,10 @@ Rec::MuonCombinedTimingTool::initialize()
         ATH_MSG_DEBUG("Retrieved " << m_rpcTimingTool.name());
     }
 
-    /*
-    if (!m_cscTimingTool.empty()) {
-      if (m_cscTimingTool.retrieve().isFailure()) {
-        ATH_MSG_ERROR ("Could not retrieve "<<m_cscTimingTool.name());
-        return StatusCode::FAILURE;
-      } else ATH_MSG_DEBUG ("Retrieved " << m_cscTimingTool.name());
-      } */
-
     ATH_MSG_DEBUG("initialize() successful in " << name());
     return StatusCode::SUCCESS;
 }
 
-//================ Finalisation =================================================
-
-StatusCode
-Rec::MuonCombinedTimingTool::finalize()
-{
-    return StatusCode::SUCCESS;
-}
-
 //============================================================================================
 std::vector<Trk::SpaceTimePoint*>
 Rec::MuonCombinedTimingTool::timeMeasurements(const xAOD::Muon&) const
@@ -77,128 +51,6 @@ Rec::MuonCombinedTimingTool::timeMeasurements(const xAOD::Muon&) const
     std::vector<Trk::SpaceTimePoint*> spaceTimePoints;  // empty vector
     ATH_MSG_WARNING(
         "This tool is not migrated to xAOD yet, please volunteer to update it if you need the information filled");
-    //   // return empty vector in case no segment container was associated to the muon
-    //   if (!getSegmentContainer(muon)) return spaceTimePoints;
-
-    //   // ***
-    //   // *** first choice: primary author combined muon or MuGirl refitted
-    //   // ***
-    //   if (muon.hasCombinedMuonTrackParticle() ) {
-    // //  || muon.hasInnerExtrapolatedTrackParticle() ) // analysis will be based on MuGirl segments
-
-    //     const Rec::TrackParticle* muonParticle = muon.hasCombinedMuonTrackParticle() ?
-    //     muon.combinedMuonTrackParticle() : muon.innerExtrapolatedTrackParticle();
-
-    //     const Trk::Track* combinedTrack = muonParticle ? muonParticle->originalTrack() : NULL;
-
-    //     if (combinedTrack==NULL) return spaceTimePoints;
-
-    //     const Trk::Track* inDetTrack = muon.inDetTrkTrack();
-    //     if (!m_trtTimingTool.empty() && inDetTrack!= NULL) {
-    //       // in case a refit is attempted, better give only the ID track to the tool.
-    //       std::vector<Trk::SpaceTimePoint*> v1
-    // 	= m_trtTimingTool->timeMeasurements(*inDetTrack);
-    //       if (!v1.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v1.begin(), v1.end());
-    //     }
-
-    //     if (!m_caloTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v2 = m_caloTimingTool->timeMeasurements(*combinedTrack);
-    //       if (!v2.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v2.begin(), v2.end());
-    //     }
-
-    //     if (!m_mdtSegmentTimingTool.empty()) {
-    //       const Trk::SegmentCollection* segments = getSegmentContainer(muon);
-    //       std::vector<Trk::SpaceTimePoint*> v3 = m_mdtSegmentTimingTool->timeMeasurements(*combinedTrack, segments);
-    //       if (!v3.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v3.begin(), v3.end());
-    //       // if at some point consider passing tracks, in case t0 determined on the fly
-    //       // std::vector<Trk::SpaceTimePoint*> v3 = m_mdtSegmentTimingTool->timeMeasurements(*combinedTrack);
-    //       // if (!v3.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v3.begin(), v3.end());
-    //     }
-    //     if (!m_rpcTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v4 = m_rpcTimingTool->timeMeasurements(*combinedTrack);
-    //       if (!v4.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v4.begin(), v4.end());
-    //     }
-    //     return spaceTimePoints;
-    //   }
-
-    //   // ***
-    //   // *** second choice: primary author segment-tagger
-    //   // ***
-    //   if ( (muon.hasInDetTrackParticle() || muon.hasInnerExtrapolatedTrackParticle()) && !muon.isCaloMuonId()) {
-    //     const Rec::TrackParticle* idParticle = muon.inDetTrackParticle();
-    //     const Trk::Track* idTrack = idParticle ? idParticle->originalTrack() : NULL;
-    //     if (idTrack==NULL) return spaceTimePoints;
-    //     if (!m_trtTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v1 = m_trtTimingTool->timeMeasurements(*idTrack);
-    //       if (!v1.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v1.begin(), v1.end());
-    //     }
-    //     if (!m_caloTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v2 = m_caloTimingTool->timeMeasurements(*idTrack);
-    //       if (!v2.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v2.begin(), v2.end());
-    //     }
-    //     if (!m_mdtSegmentTimingTool.empty() || !m_rpcTimingTool.empty()) {
-    //       std::vector<const Trk::Segment*> segments;
-    //       unsigned int nSeg = muon.numberOfSegments();
-    //       segments.reserve(nSeg);
-    //       for( unsigned int si=0;si<nSeg;++si ) {
-    //         const Trk::Segment* seg = muon.muonSegment(si);
-    //         if( seg ) segments.push_back(seg);
-    //       }
-    //       if (!m_mdtSegmentTimingTool.empty()) {
-    // 	std::vector<Trk::SpaceTimePoint*> v3 = m_mdtSegmentTimingTool->timeMeasurements(segments);
-    //         if (!v3.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v3.begin(), v3.end());
-    //       }
-    //       if (!m_rpcTimingTool.empty()) {
-    //         std::vector<Trk::SpaceTimePoint*> v4 = m_rpcTimingTool->timeMeasurements(segments);
-    //         if (!v4.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v4.begin(), v4.end());
-    //       }
-    //     }
-    //     return spaceTimePoints;
-    //   }
-
-    //   // ***
-    //   // *** third choice: standalone muon
-    //   // ***
-    //   if (muon.hasMuonExtrapolatedTrackParticle()){
-    //     const Rec::TrackParticle* muonParticle = muon.muonExtrapolatedTrackParticle();
-    //     const Trk::Track* msTrack = muonParticle ? muonParticle->originalTrack() : NULL;
-    //     if (msTrack==NULL) {
-    //        ATH_MSG_WARNING ("No muon track or segments associated to SA muon !?");
-    //        return spaceTimePoints;
-    //      }
-    //     if (!m_caloTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v2 = m_caloTimingTool->timeMeasurements(*msTrack);
-    //       if (!v2.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v2.begin(), v2.end());
-    //     }
-    //     if (!m_mdtSegmentTimingTool.empty()) {
-    //       const Trk::SegmentCollection* segments = getSegmentContainer(muon);
-    //       std::vector<Trk::SpaceTimePoint*> v3 = m_mdtSegmentTimingTool->timeMeasurements(*msTrack, segments);
-    //       if (!v3.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v3.begin(), v3.end());
-    //     }
-    //     if (!m_rpcTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v4 = m_rpcTimingTool->timeMeasurements(*msTrack);
-    //       if (!v4.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v4.begin(), v4.end());
-    //     }
-    //     return spaceTimePoints;
-    //   }
-
-    //   // ***
-    //   // *** fourth choice: calo tagged muon
-    //   // ***
-    //   if (muon.hasInDetTrackParticle() && muon.isCaloMuonId()){
-    //     const Rec::TrackParticle* idParticle = muon.inDetTrackParticle();
-    //     const Trk::Track* idTrack = idParticle ? idParticle->originalTrack() : NULL;
-    //     if (idTrack==NULL) return spaceTimePoints;
-    //     if (!m_trtTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v1 = m_trtTimingTool->timeMeasurements(*idTrack);
-    //       if (!v1.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v1.begin(), v1.end());
-    //     }
-    //     if (!m_caloTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v2 = m_caloTimingTool->timeMeasurements(*idTrack);
-    //       if (!v2.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v2.begin(), v2.end());
-    //     }
-    //     return spaceTimePoints;
-    //   }
 
     return spaceTimePoints;
 }
@@ -209,33 +61,5 @@ Rec::MuonCombinedTimingTool::timeMeasurements(const xAOD::Muon&) const
 const Trk::SegmentCollection*
 Rec::MuonCombinedTimingTool::getSegmentContainer(const xAOD::Muon&) const
 {
-    //   std::string containerName = "";
-
-    //   MuonParameters::Author auth = muon.author();
-
-    //   // FIXME At the moment, space-time points are constructed only for muid.
-    //   // TODO In the future, 3rd muon chain has to be treated as well.
-    //   //First check if muon is Muonboy/STACO
-    // //  if(auth == MuonParameters::MuonboySP || auth == MuonParameters::Muonboy ||
-    // //     auth == MuonParameters::STACO) {// MuonboySP or Muonboy or STACO
-    // //    containerName = "ConvertedMBoySegments";
-    // //  } else
-    //   if (auth == MuonParameters::MOORE || auth == MuonParameters::MuidSA ||
-    // 	     auth == MuonParameters::MuidCo) { //MOORE or MuidSA or MuidCo
-    //     containerName = "MooreSegments";
-    //   }
-
-    //   if( evtStore()->contains<Trk::SegmentCollection>(containerName) ){
-    //     const Trk::SegmentCollection* segs = NULL;
-
-    //     if( evtStore()->retrieve(segs, containerName).isFailure() ){
-    //       ATH_MSG_DEBUG("Could not find segment container");
-    //     }else{
-    //       ATH_MSG_DEBUG("Successfully retrieved segment container");
-
-    //       return segs;
-    //     }
-    //   }
-
-    return NULL;
+    return nullptr;
 }
diff --git a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h
index 7ed265021db3..d528b8b75812 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h
@@ -2,10 +2,6 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// MuonCombinedTimingTool.h, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
 #ifndef RECMUONCOMBINEDTIMINGTOOL_H
 #define RECMUONCOMBINEDTIMINGTOOL_H
 
@@ -16,11 +12,6 @@
 #include "TrkToolInterfaces/ITrackTimingTool.h"
 #include "xAODMuon/Muon.h"
 
-namespace Trk {
-class ITrackTimingTool;
-}
-// namespace Muon { class ISegmentTimingTool; }
-
 namespace Rec {
 class IMuonPropertiesTool;
 
@@ -38,12 +29,10 @@ class MuonCombinedTimingTool : virtual public IMuonCombinedTimingTool, public At
     MuonCombinedTimingTool(const std::string&, const std::string&, const IInterface*);
 
     /** default destructor */
-    virtual ~MuonCombinedTimingTool();
+    virtual ~MuonCombinedTimingTool()=default;
 
     /** standard Athena-Algorithm method */
     virtual StatusCode initialize();
-    /** standard Athena-Algorithm method */
-    virtual StatusCode finalize();
 
     virtual std::vector<Trk::SpaceTimePoint*> timeMeasurements(const xAOD::Muon& muon) const;
 
-- 
GitLab


From 2d2f1f650e9d49bba3b2a650e8e85fb8731acef4 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Tue, 22 Sep 2020 00:33:01 +0200
Subject: [PATCH 334/422] fixed style issues

---
 .../tauRecTools/Root/TauJetRNNUtils.cxx         | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index dd262c75a361..bafc43445152 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -537,7 +537,7 @@ bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const
 
   std::vector<const xAOD::CaloCluster *> clusters;
   bool            incShowerSubtracted(false);
-  TLorentzVector  LC_P4 = tau.p4(xAOD::TauJetParameters::DetectorAxis);
+  const TLorentzVector&  LC_P4 = tau.p4(xAOD::TauJetParameters::DetectorAxis);
   double          dRCut(0.2);
   auto        check_clusters = tauRecTools::GetJetClusterList(jet_seed, clusters, incShowerSubtracted, LC_P4, dRCut);
   std::size_t nClustersTotal = clusters.size();
@@ -555,20 +555,15 @@ bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const
   };
   std::sort(clusters.begin(), clusters.end(), et_cmp);
   
-  float clE(0.), Etot(0.);
+  float Etot(0.);
   using MomentType = xAOD::CaloCluster::MomentType;
+  const xAOD::CaloCluster *cls(0);
   for (std::size_t i = 0; i < nClustersSave; ++i) {
-    auto cls = clusters[i];
+    cls = clusters[i];
 
-    // gipezzul: 2019-09-16
-    //now evaluate the avarage values for: lambda, second lambda, EMProb, presamplerFrac
-    //DR selection from: https://gitlab.cern.ch/atlas/athena/blob/master/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx
-
-    TLorentzVector cluster_P4;
-    cluster_P4.SetPtEtaPhiM(1, cls->eta(), cls->phi(),0);
+    TLorentzVector cluster_P4 = cls->p4(xAOD::CaloCluster::State::CALIBRATED);
     if(LC_P4.DeltaR(cluster_P4)>dRCut)            continue;
-    clE = cls->calE();
-    Etot += clE;
+    Etot += cls->calE();
   }
 	
   // the ClustersMeanFirstEngDens is the log10 of the energy weighted average of the First_ENG_DENS 
-- 
GitLab


From bf074a77a7b986fffa8107cf6a0524897eeb2612 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Tue, 22 Sep 2020 00:43:43 +0100
Subject: [PATCH 335/422]  MultiComponentStateModeCalculator : Refactor and add
 simple unit test

---
 .../TrkGaussianSumFilter/CMakeLists.txt       |  12 +-
 .../MultiComponentStateModeCalculator.h       |  34 +--
 ...ponents => ut_GSF_testMergeComponents.ref} |   0
 .../src/MultiComponentStateModeCalculator.cxx | 243 ++++++++----------
 4 files changed, 122 insertions(+), 167 deletions(-)
 rename Tracking/TrkFitter/TrkGaussianSumFilter/share/{ut_GSF_testMergeComponents => ut_GSF_testMergeComponents.ref} (100%)

diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt
index ddbed75050f1..8d8288fd72e6 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt
@@ -25,14 +25,19 @@ atlas_install_runtime( Data/*.par )
 #Executables for tests
 atlas_add_executable( GSF_testFindMinimumIndex
 	test/testFindMinimumIndex.cxx src/KLGaussianMixtureReduction.cxx
-        LINK_LIBRARIES CxxUtils )
+  LINK_LIBRARIES CxxUtils )
 
 atlas_add_executable( GSF_testAlignedDynArray
 	test/testAlignedDynArray.cxx)
 
 atlas_add_executable( GSF_testMergeComponents
 	test/testMergeComponents.cxx src/KLGaussianMixtureReduction.cxx
-        LINK_LIBRARIES CxxUtils )
+  LINK_LIBRARIES CxxUtils )
+
+atlas_add_executable( GSF_testFindMode
+	test/testFindMode.cxx src/MultiComponentStateModeCalculator.cxx
+  LINK_LIBRARIES CxxUtils TrkMultiComponentStateOnSurface)
+
 
 #Tests
 atlas_add_test(ut_GSF_testFindMinimumIndex
@@ -44,3 +49,6 @@ atlas_add_test(ut_GSF_testAlignedDynArray
 atlas_add_test(ut_GSF_testMergeComponents
 	SCRIPT GSF_testMergeComponents)
 
+atlas_add_test(ut_GSF_testFindMode
+	SCRIPT GSF_testFindMode)
+
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h
index 1f1096cd9e25..d330191b8c12 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h
@@ -21,9 +21,9 @@
 namespace Trk {
 namespace MultiComponentStateModeCalculator {
 
+// Simple representation of 1D component
 struct Component
 {
-  // Default ctors/dtor/assignment operators
   Component() = default;
   ~Component() = default;
   Component(const Component&) = default;
@@ -41,36 +41,14 @@ struct Component
   double sigma = 0;
 };
 
-/** @brief  Method to calculate mode*/
+/** @brief  Method to calculate mode with MultiComponentState
+ * state as input */
 std::array<double, 10>
 calculateMode(const MultiComponentState&);
 
-/**
- * method to extract the weight, mean and sigma values from the
-  multi-component state*/
-void
-fillMixture(const MultiComponentState&,
-            std::array<std::vector<Component>, 5>& mixture);
-
-/**
- * method to find the mode using the Newton-Raphson method based on a
- *   starting guess
- */
-double
-findMode(double, int, const std::array<std::vector<Component>, 5>& mixture);
-
-double
-findModeGlobal(double,
-               int,
-               const std::array<std::vector<Component>, 5>& mixture);
-
-double
-findRoot(double& result,
-         double xlo,
-         double xhi,
-         double value,
-         double i,
-         const std::array<std::vector<Component>, 5>& mixture);
+/** @brief  Method to calculate mode*/
+std::array<double, 10>
+calculateMode(const std::array<std::vector<Component>, 5>& mixture);
 
 } // namespace MultiComponentStateModeCalculator
 
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testMergeComponents b/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testMergeComponents.ref
similarity index 100%
rename from Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testMergeComponents
rename to Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testMergeComponents.ref
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
index 8a64b86d297f..0a9d1e11a2b4 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
@@ -13,7 +13,6 @@
 #include "TrkGaussianSumFilter/MultiComponentStateModeCalculator.h"
 #include "CxxUtils/phihelper.h"
 #include "TrkMultiComponentStateOnSurface/MultiComponentState.h"
-#include "TrkParameters/TrackParameters.h"
 #include <cmath>
 
 namespace {
@@ -63,7 +62,6 @@ d1pdf(double x, int i, const std::array<std::vector<Component>, 5>& mixture)
   }
   return result;
 }
-
 /** @brief method to determine the second order derivative of the pdf at a given
  * value*/
 double
@@ -93,94 +91,10 @@ width(int i, const std::array<std::vector<Component>, 5>& mixture)
   return pdf;
 }
 
-} // end of anonymous namespace
-
-std::array<double, 10>
-Trk::MultiComponentStateModeCalculator::calculateMode(
-  const Trk::MultiComponentState& multiComponentState)
-{
-  std::array<double, 10> modes{};
-  // Check to see if the multi-component state is measured
-  if (!MultiComponentStateHelpers::isMeasured(multiComponentState)) {
-    return modes;
-  }
-
-  std::array<std::vector<Component>, 5> mixture;
-
-  fillMixture(multiComponentState, mixture);
-
-  /* loop over the 5 direction , d0,z0,phi,theta,qOverP*/
-
-  for (int i = 0; i < 5; i++) {
-
-    double largerPdfComponent = 0.0;
-    double largerMeanComponent = 0.0;
-    /*
-     * Loop over the mixture in the ith direction and find the  component
-     * whose mean give the larger value for the Gaussian Mixture pdf.
-     * This should be a good enough starting point for the mode
-     * finding in this direction
-     */
-    for (const Component& component : mixture[i]) {
-      double pdfValue = pdf(component.mean, i, mixture);
-      if (pdfValue > largerPdfComponent) {
-        largerPdfComponent = pdfValue;
-        largerMeanComponent = component.mean;
-      }
-    }
-    modes[i] = findMode(largerMeanComponent, i, mixture);
-    // Calculate the FWHM and return this back so that it can be used to correct
-    // the covariance matrix
-    if (largerMeanComponent != modes[i]) {
-      // mode calculation was successful now calulate FWHM
-      double currentWidth = width(i, mixture);
-      modes[i + 5] = -1; // Failure is flagged with a value less than 0;
-
-      double pdfVal = pdf(modes[i], i, mixture);
-      double highX(0);
-      double lowX(0);
-
-      double upperbound = modes[i] + 1.5 * currentWidth;
-      while (true) {
-        if (pdf(upperbound, i, mixture) > pdfVal * 0.5) {
-          upperbound += currentWidth;
-        } else {
-          break;
-        }
-      }
-
-      bool highXFound =
-        findRoot(highX, modes[i], upperbound, pdfVal * 0.5, i, mixture);
-
-      double lowerbound = modes[i] - 1.5 * currentWidth;
-      while (true) {
-        if (pdf(lowerbound, i, mixture) > pdfVal * 0.5) {
-          lowerbound -= currentWidth;
-        } else {
-          break;
-        }
-      }
-      bool lowXFound =
-        findRoot(lowX, lowerbound, modes[i], pdfVal * 0.5, i, mixture);
-      if (highXFound && lowXFound) {
-        double FWHM = highX - lowX;
-        modes[i + 5] = FWHM / 2.35482; // 2 * sqrt( 2* log(2))
-      }
-      // Ensure that phi is between -pi and pi
-      if (i == 2) {
-        modes[i] = CxxUtils::wrapToPi(modes[i]);
-      }
-    }
-  }
-  return modes;
-}
-
 void
-Trk::MultiComponentStateModeCalculator::fillMixture(
-  const Trk::MultiComponentState& multiComponentState,
-  std::array<std::vector<Component>, 5>& mixture)
+fillMixture(const Trk::MultiComponentState& multiComponentState,
+            std::array<std::vector<Component>, 5>& mixture)
 {
-
   constexpr Trk::ParamDefs parameter[5] = {
     Trk::d0, Trk::z0, Trk::phi, Trk::theta, Trk::qOverP
   };
@@ -209,9 +123,8 @@ Trk::MultiComponentStateModeCalculator::fillMixture(
       // FIXME ATLASRECTS-598 this std::abs() should not be necessary... for
       // some reason cov(qOverP,qOverP) can be negative
       double sigma = sqrt(std::abs((*measuredCov)(parameter[i], parameter[i])));
-
-      // Ensure that we don't have any problems with the cyclical nature of phi
-      // Use first state as reference point
+      // Ensure that we don't have any problems with the cyclical nature of
+      // phi Use first state as reference point
       if (i == 2) { // phi
         double deltaPhi =
           multiComponentState.begin()->first->parameters()[2] - mean;
@@ -223,14 +136,14 @@ Trk::MultiComponentStateModeCalculator::fillMixture(
       }
       mixture[i].emplace_back(weight, mean, sigma);
     }
+
   }
 }
 
 double
-Trk::MultiComponentStateModeCalculator::findMode(
-  double xStart,
-  int i,
-  const std::array<std::vector<Component>, 5>& mixture)
+findMode(double xStart,
+         int i,
+         const std::array<std::vector<Component>, 5>& mixture)
 {
 
   int iteration(0);
@@ -271,49 +184,17 @@ Trk::MultiComponentStateModeCalculator::findMode(
 }
 
 double
-Trk::MultiComponentStateModeCalculator::findModeGlobal(
-  double mean,
-  int i,
-  const std::array<std::vector<Component>, 5>& mixture)
+findRoot(double& result,
+         double xlo,
+         double xhi,
+         double value,
+         double i,
+         const std::array<std::vector<Component>, 5>& mixture)
 {
-
-  double start(-1);
-  double end(1);
-  if (mean > 0.0) {
-    start = mean / 2;
-    end = 3 * mean / 2;
-  } else if (mean < 0.0) {
-    start = 3 * mean / 2;
-    end = mean / 2;
-  }
-
-  double mode(0);
-  double maximum(-1);
-  double iterate(std::abs(mean / 1000));
-
-  for (double counter(start); counter < end; counter += iterate) {
-    double value(pdf(counter, i, mixture));
-    if (value > maximum) {
-      maximum = value;
-      mode = counter;
-    }
-  }
-  return mode;
-}
-
-double
-Trk::MultiComponentStateModeCalculator::findRoot(
-  double& result,
-  double xlo,
-  double xhi,
-  double value,
-  double i,
-  const std::array<std::vector<Component>, 5>& mixture)
-{
-  // Do the root finding using the Brent-Decker method. Returns a boolean status
-  // and loads 'result' with our best guess at the root if true. Prints a
-  // warning if the initial interval does not bracket a single root or if the
-  // root is not found after a fixed number of iterations.
+  // Do the root finding using the Brent-Decker method. Returns a boolean
+  // status and loads 'result' with our best guess at the root if true. Prints
+  // a warning if the initial interval does not bracket a single root or if
+  // the root is not found after a fixed number of iterations.
 
   double a(xlo);
   double b(xhi);
@@ -416,3 +297,91 @@ Trk::MultiComponentStateModeCalculator::findRoot(
 
   return false;
 }
+
+} // end of anonymous namespace
+
+std::array<double, 10>
+Trk::MultiComponentStateModeCalculator::calculateMode(
+  const Trk::MultiComponentState& multiComponentState)
+{
+  // Check to see if the multi-component state is measured
+  if (!MultiComponentStateHelpers::isMeasured(multiComponentState)) {
+    return {};
+  }
+
+  std::array<std::vector<Component>, 5> mixture;
+
+  fillMixture(multiComponentState, mixture);
+  return calculateMode(mixture);
+}
+
+std::array<double, 10>
+Trk::MultiComponentStateModeCalculator::calculateMode(
+  const std::array<std::vector<Component>, 5>& mixture)
+{
+  std::array<double, 10> modes{};
+  /* loop over the 5 direction , d0,z0,phi,theta,qOverP*/
+
+  for (int i = 0; i < 5; i++) {
+
+    double largerPdfComponent = 0.0;
+    double largerMeanComponent = 0.0;
+    /*
+     * Loop over the mixture in the ith direction and find the  component
+     * whose mean give the larger value for the Gaussian Mixture pdf.
+     * This should be a good enough starting point for the mode
+     * finding in this direction
+     */
+    for (const Component& component : mixture[i]) {
+      double pdfValue = pdf(component.mean, i, mixture);
+      if (pdfValue > largerPdfComponent) {
+        largerPdfComponent = pdfValue;
+        largerMeanComponent = component.mean;
+      }
+    }
+    modes[i] = findMode(largerMeanComponent, i, mixture);
+    // Calculate the FWHM and return this back so that it can be used to correct
+    // the covariance matrix
+    if (largerMeanComponent != modes[i]) {
+      // mode calculation was successful now calulate FWHM
+      double currentWidth = width(i, mixture);
+      modes[i + 5] = -1; // Failure is flagged with a value less than 0;
+
+      double pdfVal = pdf(modes[i], i, mixture);
+      double highX(0);
+      double lowX(0);
+
+      double upperbound = modes[i] + 1.5 * currentWidth;
+      while (true) {
+        if (pdf(upperbound, i, mixture) > pdfVal * 0.5) {
+          upperbound += currentWidth;
+        } else {
+          break;
+        }
+      }
+
+      bool highXFound =
+        findRoot(highX, modes[i], upperbound, pdfVal * 0.5, i, mixture);
+
+      double lowerbound = modes[i] - 1.5 * currentWidth;
+      while (true) {
+        if (pdf(lowerbound, i, mixture) > pdfVal * 0.5) {
+          lowerbound -= currentWidth;
+        } else {
+          break;
+        }
+      }
+      bool lowXFound =
+        findRoot(lowX, lowerbound, modes[i], pdfVal * 0.5, i, mixture);
+      if (highXFound && lowXFound) {
+        double FWHM = highX - lowX;
+        modes[i + 5] = FWHM / 2.35482; // 2 * sqrt( 2* log(2))
+      }
+      // Ensure that phi is between -pi and pi
+      if (i == 2) {
+        modes[i] = CxxUtils::wrapToPi(modes[i]);
+      }
+    }
+  }
+  return modes;
+}
-- 
GitLab


From b76b31e4fe9cff884b5f759220cf5b9b3c8e29b8 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Tue, 22 Sep 2020 00:47:07 +0100
Subject: [PATCH 336/422]  MultiComponentStateModeCalculator : Refactor and add
 simple unit test

---
 .../share/ut_GSF_testFindMode.ref             | 10 +++
 .../test/testFindMode.cxx                     | 76 +++++++++++++++++++
 2 files changed, 86 insertions(+)
 create mode 100644 Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testFindMode.ref
 create mode 100644 Tracking/TrkFitter/TrkGaussianSumFilter/test/testFindMode.cxx

diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testFindMode.ref b/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testFindMode.ref
new file mode 100644
index 000000000000..7834719fda33
--- /dev/null
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testFindMode.ref
@@ -0,0 +1,10 @@
+-27.9078
+38.4943
+-1.0267
+2.94981
+-7.99292e-05
+0.0539087
+0.758757
+0.000448727
+0.0011341
+1.23707e-05
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/test/testFindMode.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/test/testFindMode.cxx
new file mode 100644
index 000000000000..c43854aef3dd
--- /dev/null
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/test/testFindMode.cxx
@@ -0,0 +1,76 @@
+
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+#include "TrkGaussianSumFilter/MultiComponentStateModeCalculator.h"
+#include <iostream>
+
+int
+main()
+{
+
+  using namespace Trk::MultiComponentStateModeCalculator;
+
+  std::vector<Component> vec0 = {
+    { 0.973657, -27.9079, 0.0538001 },    { 0.024202, -27.9023, 0.0580491 },
+    { 0.00146762, -27.9063, 0.0594736 },  { 0.000452399, -27.8908, 0.0591268 },
+    { 0.000152378, -27.8987, 0.0604233 }, { 5.65349e-05, -27.9603, 0.0517557 },
+    { 5.81047e-06, -27.9495, 0.0553466 }, { 5.21863e-06, -27.9006, 0.0603241 },
+    { 6.61547e-07, -27.9117, 0.0626188 }, { 1.19371e-07, -27.8984, 0.060867 },
+    { 1.11035e-07, -27.9323, 0.0585395 }
+  };
+
+  std::vector<Component> vec1 = {
+    { 0.973657, 38.4958, 0.757618 },    { 0.024202, 38.4292, 0.801337 },
+    { 0.00146762, 38.4686, 0.814726 },  { 0.000452399, 38.285, 0.811128 },
+    { 0.000152378, 38.382, 0.826285 },  { 5.65349e-05, 39.137, 0.728419 },
+    { 5.81047e-06, 39.0091, 0.763217 }, { 5.21863e-06, 38.3888, 0.824838 },
+    { 6.61547e-07, 38.5323, 0.858115 }, { 1.19371e-07, 38.2937, 0.834079 },
+    { 1.11035e-07, 38.7643, 0.802247 }
+  };
+
+  std::vector<Component> vec2 = { { 0.973657, -1.0267, 0.000445822 },
+                                  { 0.024202, -1.02727, 0.000738283 },
+                                  { 0.00146762, -1.03185, 0.000786109 },
+                                  { 0.000452399, -1.02815, 0.000729393 },
+                                  { 0.000152378, -1.03015, 0.00159626 },
+                                  { 5.65349e-05, -1.03469, 0.000698825 },
+                                  { 5.81047e-06, -1.04587, 0.00150398 },
+                                  { 5.21863e-06, -1.03862, 0.00246934 },
+                                  { 6.61547e-07, -1.05081, 0.00301325 },
+                                  { 1.19371e-07, -1.08593, 0.0072159 },
+                                  { 1.11035e-07, -1.07377, 0.0038744 } };
+
+  std::vector<Component> vec3 = {
+    { 0.973657, 2.94981, 0.00113228 },    { 0.024202, 2.94985, 0.00120513 },
+    { 0.00146762, 2.94994, 0.00120203 },  { 0.000452399, 2.95008, 0.00122586 },
+    { 0.000152378, 2.94981, 0.00140487 }, { 5.65349e-05, 2.94921, 0.00108731 },
+    { 5.81047e-06, 2.94948, 0.00113324 }, { 5.21863e-06, 2.95005, 0.00141219 },
+    { 6.61547e-07, 2.9482, 0.00391511 },  { 1.19371e-07, 2.94952, 0.00241575 },
+    { 1.11035e-07, 2.94963, 0.0014292 }
+  };
+
+  std::vector<Component> vec4 = { { 0.973657, -7.99235e-05, 1.2352e-05 },
+                                  { 0.024202, -0.000165865, 6.85227e-05 },
+                                  { 0.00146762, -0.000731881, 4.43473e-05 },
+                                  { 0.000452399, -0.000297975, 2.98129e-05 },
+                                  { 0.000152378, -0.000534431, 0.00017548 },
+                                  { 5.65349e-05, -0.000996226, 5.45339e-05 },
+                                  { 5.81047e-06, -0.00246959, 0.00014759 },
+                                  { 5.21863e-06, -0.0015881, 0.000274361 },
+                                  { 6.61547e-07, -0.00321585, 0.000282572 },
+                                  { 1.19371e-07, -0.00750016, 0.000670315 },
+                                  { 1.11035e-07, -0.0059806, 0.000365448 } };
+
+  std::array<std::vector<Component>, 5> mixture = {
+    vec0, vec1, vec2, vec3, vec4
+  };
+
+  std::array<double, 10> result =
+    Trk::MultiComponentStateModeCalculator::calculateMode(mixture);
+  for (double i : result) {
+    std::cout << i << '\n';
+  }
+
+  return 0;
+}
-- 
GitLab


From 63320df09b31e9a2549967f4a796fa2c72779b2e Mon Sep 17 00:00:00 2001
From: Rachid Mazini <rachid.mazini@cern.ch>
Date: Mon, 21 Sep 2020 15:05:30 +0000
Subject: [PATCH 337/422] Merge branch '21.0-Nikola-Webdisplay' into '21.0'

AFP webdisplay [rel 21]

See merge request atlas/athena!36401

(cherry picked from commit 6ec2ea6a5f0acedf1d6129493c5c8f3ec2154c22)

94c25dc1 Added AFP
9f9e1d2e Created AFP config file
884473f4 Merge branch '21.0' of https://gitlab.cern.ch:8443/atlas/athena into 21.0-Nikola-Webdisplay
264f1e6a Changed values for AFPBinContentComp parameters
f80c671a Added copyright statement
---
 .../config/AFP/collisions_run.config          | 969 ++++++++++++++++++
 .../config/AFP/collisions_run.hcfg            | Bin 0 -> 2786 bytes
 2 files changed, 969 insertions(+)
 create mode 100644 DataQuality/DataQualityConfigurations/config/AFP/collisions_run.config
 create mode 100644 DataQuality/DataQualityConfigurations/config/AFP/collisions_run.hcfg

diff --git a/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.config b/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.config
new file mode 100644
index 000000000000..902fe0284263
--- /dev/null
+++ b/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.config
@@ -0,0 +1,969 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+############################################################
+# AFP
+# Nikola Dikic
+############################################################
+
+############################################################
+ # Reference
+reference AFPBinContentReference {
+	 location = /eos/atlas/atlascerngroupdisk/data-dqm/references/Other/,root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/Other/
+	 file = data18_13TeV.00337176.physics_Main.merge.HIST.f940_h308.root
+	 path = run_337176
+	 name = same_name
+}
+############################################################
+
+############################################################
+# Output
+############################################################
+
+output top_level {
+	output AFP {
+		output SiT {
+			output pixelColRow2D {
+			}
+			output PixelColIDChip {
+			}
+			output PixelRowIDChip {
+			}
+			output SiTimeOverThreshold {
+			}
+			output Cluster {
+			}
+			output Track {
+			}
+			output clustersPerPlane {
+			}
+			output clustersPerStation {
+			}
+			output clustersPerPlaneFront {
+			}
+			output clustersPerPlaneEnd {
+			}
+			output clustersPerPlaneMiddle {
+			}
+		}
+		output ToF {
+			output HitBarvsTrain {
+			}
+		}
+	}
+}
+
+############################################################
+# Histogram Assessments
+############################################################
+
+dir AFP {
+	dir SiT {
+		dir pixelColRow2D {
+			hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+		}
+		dir PixelColIDChip {
+			hist pixelColIDChip_nearAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+		}
+		dir PixelRowIDChip {
+			hist pixelRowIDChip_nearAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+		}
+		dir SiTimeOverThreshold {
+			hist timeOverThreshold_nearAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+		}
+		dir Cluster {
+			hist clusterX_vs_clusterY_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+		}
+		dir Track {
+			hist trackX_vs_trackY_nearAside {
+				algorithm = HNE
+				output = AFP/SiT/Track
+				display = LogZ,Draw=COLZ
+			}
+			hist trackX_vs_trackY_nearCside {
+				algorithm = HNE
+				output = AFP/SiT/Track
+				display = LogZ,Draw=COLZ
+			}
+			hist trackX_vs_trackY_farAside {
+				algorithm = HNE
+				output = AFP/SiT/Track
+				display = LogZ,Draw=COLZ
+			}
+			hist trackX_vs_trackY_farCside {
+				algorithm = HNE
+				output = AFP/SiT/Track
+				display = LogZ,Draw=COLZ
+			}
+		}
+		dir clustersPerPlane {
+			hist clustersPerPlane_vs_lb_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+		}
+		dir clustersPerPlaneFront {
+			hist clustersPerPlaneFront_vs_lb_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+		}
+		dir clustersPerPlaneEnd {
+			hist clustersPerPlaneEnd_vs_lb_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+		}
+		dir clustersPerPlaneMiddle {
+			hist clustersPerPlaneMiddle_vs_lb_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+		}
+		dir clustersPerStation {
+			hist clustersPerStation_vs_lb_farAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStation_vs_lb_farCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStation_vs_lb_nearAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStation_vs_lb_nearCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationFront_vs_lb_farAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationFront_vs_lb_farCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationFront_vs_lb_nearAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationFront_vs_lb_nearCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationEnd_vs_lb_farAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationEnd_vs_lb_farCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationEnd_vs_lb_nearAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationEnd_vs_lb_nearCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationMiddle_vs_lb_farAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationMiddle_vs_lb_farCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationMiddle_vs_lb_nearAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationMiddle_vs_lb_nearCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+		}
+		hist nSiHits_vs_lb {
+			algorithm = HNE
+			output = AFP/SiT
+			display = Draw=HIST
+		}
+		hist muPerBCID_vs_lb {
+			algorithm = HNE
+			output = AFP/SiT
+			display = Draw=HIST
+		}
+	}
+	dir ToF {
+		hist numberOfHit_S0 {
+			algorithm = HNE
+			output = AFP/ToF
+			display = Draw=HIST
+		}
+		hist numberOfHit_S3 {
+			algorithm = HNE
+			output = AFP/ToF
+			display = Draw=HIST
+		}
+		dir HitBarvsTrain {
+			hist trainID_vs_barInTrainID_farAside {
+				algorithm = HNE
+				output = AFP/ToF/HitBarvsTrain
+				display = Draw=COLZ
+			}
+			hist trainID_vs_barInTrainID_farCside {
+				algorithm = HNE
+				output = AFP/ToF/HitBarvsTrain
+				display = Draw=COLZ
+			}
+		}
+	}
+}
+
+############################################################
+# Algorithms
+
+algorithm HNE {
+	libname = libdqm_algorithms.so
+	name = Histogram_Not_Empty
+}
+
+algorithm AFPBinContentComp {
+	libname = libdqm_algorithms.so
+	name = BinContentComp
+	thresholds = AFPTestThreshold
+	NSigma = 3
+	reference = AFPBinContentReference
+	publish = 1
+	NormRef = 1
+}
+############################################################
+
+
+############################################################
+# Thresholds
+thresholds AFPTestThreshold {
+	limits NBins {
+		warning = 3
+		error = 5
+	}
+}
+###########################################################
diff --git a/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.hcfg b/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.hcfg
new file mode 100644
index 0000000000000000000000000000000000000000..df62dc20436da44684e8df4182b5dcaf9b9ce1f2
GIT binary patch
literal 2786
zcmcJRc{G%L8^`ZqWEW$n&{!gS#!^Q1GDbzngDiu47>r?Ntl0)xD!UR&MX47>Sz1si
zB-skt8QHfGNyYQr=6TO~pFiHy`<(Nf_jk^9-@o&_?(2J9zw4a)^ZSuWBq{)`9R>iv
z0{}QCAS;CC`jEjOGlxSD5CB+J0Dw6VfT6`AbRLWH%@;OR<Db^P_zZdf)`$mog{;7$
zw{Sp{p$ugM02Z6$1YeNfo#g9Fpb$uY6c=)!pNf||-V^w*ivY{60z(CW@k0XUkTH}1
zV2}9!EH9K%1)34B$Ead{H=e`Bgg^$}sU&hJry0)gBuK@1;HbF2&i|SiFoc5iAY%kW
zn;3)=@7F{9qAxa##Da{(`n!o??z@TMHYaiZ+++|>AqA4%!QG^MhEnoAV5m|M&NmQL
zkRsyz4FG@-U}jVcFhNoO9&qVhO_2qLrZYqH3FPwN_Xr>yJqm5ZnB<2ic%C4W0{z*k
zB!3rQFbMROHI(w)U6CT;rEnAqNTHC(6e*mahZKqG1(N@CQXDMUYMFrr5g-J%bglC=
zzo9^j=MYL+-PKBF$AFo}yKayK-)mBN_imQSo!c9exQea|DT}FxYlu^>rRvQhojdFj
z>$BZ?65FhoS3S@nQmgZ=<9Q>*2x4}1UY4=A96_t%3;yVrtrwwRf(j-lRFNi0YGzC(
zQkFkgE+GzcR5?V{_iz><vprZGngiOl1T-xovN6RWF4|3kRjv}z?eJ<*tJ$-DE`qY4
zooCOxlIGIevE5Qy6Tcrh50|ZZv?1Sojaol;xq<3k!PW>6l0;uCbRBa#FsY3$!_~mb
zYfjjDyS0h7koP&}r=w14%Vy3yw0~6*sfP1@OR=J<ubxOEUFp<&a#~o}Iz#AV)&A$=
z8e9Wv)IEh;c>kO72SjVXdMM?jcz9`@xs?jaK2*#L+rl$_>_e=gl@n!+OLKKdD0{a@
zT<xuHVLb7AM~Fp-wB{ZvAmf(!E?9D!hQrOX(h}OK4g7s~nMk#<_C^u#kFiI*1q70G
z!8+{0Yc|g255UJ=YXwF>4}=_R(8~+6d|-*v#9X;OC9__E-YX;%Udl_?L+hh-+GX-b
z<%4re^Dldu24eBzx(ePGb0jECYj@phdS`g9yEa)7*xdo;ln+0csyT^k#Qdw|E;>!4
z>!?=r<_1s9)N)+7_GDgy{d$+gvh>z;$r^W5Q%#Bi?Nh)vYYN~1hNZXMq(2!p5~&|C
zXjWf5=b3p_5v!D)b~1FR$3C@nackvz^QD(IZ4$_Kk$82jQ{sv78p*0K|B!zf#gvUd
zs}IP0*$<z`{Y;HaOkR1I9hBkuT6-m?OyZJ`TcQ6eG&NC_DRd$=qboi6$of6zcWD*t
zy3_WTLknc_`He6h?Vg6<<onFLhq=V7$~{?lVR`jB8!Zm!6vT>#H))@Qnj`9zm)}Gw
z`Sm+hj&Jp9B>bQ?>GjlabL2N#4q{rD!fVFr>Qt(7eNta0bzq7C7t?!(Zpp+X1T9o_
zpMiZ?z18UBsfvE`)##J5!8SX`YI5<~aSVO{ota$waK-oeXi?rK%=(H-6a~?FZ}BkC
z9?m80I9=r4Fm&L$yki(#-0cI1zR@u66dmZ)_1S#58Jk*ZSHO4bo>)DMu3KrkvOS5c
z#Awp_Ysb3Jx6*v~`ITSL?$2Qt*cq5?8l%U%+q=n1x5*T5=u%a8I?8Bb^rx8dt9t{Y
zey4x?q1`r?T7D{eYu{)nEc#{L$ImM>D;WnJS@RC@YL7Q!-yzP8u5CpeZ2n+9Yyb~$
z#rBctDU~tH^HXs@nJx3gTp<`3GO+U}FB!apPz7P@@9+-#4x$u4LtvD_7zVZ>$U=<y
z1-2nKGi3jOv;go=XbAxSPcSkLK?u9--i($Q>|%HKXxwdy1%X24vZj(j91$dA{O}}%
z2`SLcH&n`(;O7H+Kradv0;>`;;LQ$!wa%6S*2tQXH7u7EpOwl&s)+Hr8%j>5nV7_J
zr~kc>RX56bz|Sr?`0X+iLbYzLHDtw1Cv<Z{(siOcHYz5H$&U2BovJX@nA;_<nv)Y0
zG<}}*VslzNc8^b%+y&R-S=U^{`C-y;&jh~9QBFqnl>{^{DvO~KRotEprx``z1Kaa+
zb8(}nP4DWBu9*ey@1wP~+)^x#0_<5Xp*gD&)hxVV_8F(0IP3Aqxs@D{rhpHYzpzu7
zc=27eCsJ%-{W?372HVq{t+Ro;Y|o}N?8YizJ?}u@pksUSx1SYjv`ic;8d(T?HB+)+
zJ5*61+y6P&nQf7|dL_B;(rNDji@9TR@Aq_<q&y9<sSvyP279OAW_EgNi?k$Jkz1%w
zlI9RIVp<~?DKlUxdg~1fQZw;t?w#7EYX=3lOXKt<6ZGk4{hcw#4b*5Z!ulCXP8~G$
z*!%koXUv*jvLeEic=X24Dy7p4$748%4>6UO)fG8s&BYNcS!u^Fim)~ess%+g-Ve0v
z;BDYSa&ktxmZsgmVk)}XTg{K07v@4L-?Ow0vQ?e_0^WFnFwJU;;rXGqx^X<*O?BY@
zjPZbEa?LzN(V3JKA@s;aMlglECNMM66>C=NzVVxuDstU4DL;Ewcw+VyLeI18rwglT
zMPFfTvhlJ#ZOGZ{djZ?k$p)beFGV$%v&v`R0}chrS=i}8RPer@OYL=-*hEdtP}8?8
zn|0Z_iTW#)((6luxXx3>>6zf%9oyIZtMD5pG3e9;i@4qj@se26P|3HB+zM4uHDB|J
zh`o1FMM-AH*h*?UT`42;#ZbIFC>Vh~^_+8%=VB4~Lav{HVl#S7P`s{dRz<E*m@>)9
zB0nyB(7*qK`Cz2JbiF@Ou#v}%ZF~MIuWf04f_qk4xiqt~lkfpF)OmM%rymH6WtoFd
z_nV?lG45L21g_aV`m|_eK&8pTm?I}*6y;dSl2MIa8e}3C-bhtYX+!&Tb<Er}a$})w
zmJ7oV1wUuEVE@?s2=TNB{f%iynmZC<C~Vf0Gwq?$QJsXGY<%FW<~j1ZQ(A9$omHeG
dX!o|I&)^Wpe>lXrr2dja(4WaM5v-X7`~j``XLkSq

literal 0
HcmV?d00001

-- 
GitLab


From c4619abdae7fa8af2382addb0db113fdcb9d5f01 Mon Sep 17 00:00:00 2001
From: Rachid Mazini <rachid.mazini@cern.ch>
Date: Mon, 21 Sep 2020 15:08:35 +0000
Subject: [PATCH 338/422] Merge branch '21.0-overlay-HEC' into '21.0'

Add overrides for HEC in overlay HI production

See merge request atlas/athena!36563

(cherry picked from commit 67ab0ca7f9030bb84336352ae8893d38a96759d2)

b40cc37b Override BadChannels folders for HI production (ATLHI-200)
---
 .../share/Rt_override_CONDBR2-BLKPA-2015-12.py             | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py
index 3c0d0f16074b..8aff6fb2e836 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py
@@ -127,6 +127,13 @@ conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",forc
 conddb.blockFolder("/SCT/DAQ/Config/Module")
 conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True)
 
+conddb.blockFolder("/LAR/BadChannels/BadChannels")
+conddb.blockFolder("/LAR/BadChannelsOfl/BadChannels")
+conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LARBadChannelsBadChannels-HECAQ3Missing",force=True,forceMC=True)
+conddb.blockFolder("/LAR/BadChannels/MissingFEBs")
+conddb.blockFolder("/LAR/BadChannelsOfl/MissingFEBs")
+conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True)
+
 dofolderoverrides = True
 if dofolderoverrides:
 	printfunc ("ACH - overriding folder access patterns")
-- 
GitLab


From b8f0b08888507a1154058c6bcb91109fa06130ba Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Tue, 22 Sep 2020 04:08:40 +0200
Subject: [PATCH 339/422] Improved reference track selection for offline
 reference.

The offline reference includes unwanted TRT-only tracks, but where these might
be of some interest to the cosmic tests, they are of no interest for the
collision signatures where we only use tracks seeded by the silicon detectors
---
 .../TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py      | 2 +-
 .../TrigInDetValidation/test/test_trigID_all_ttbar_pu40_mt.py   | 2 +-
 .../TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py      | 2 +-
 .../TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py   | 2 +-
 .../TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py  | 2 +-
 .../TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py  | 2 +-
 .../TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py   | 2 +-
 .../TrigInDetValidation/test/test_trigID_el_singlee_7-80.py     | 2 +-
 .../test/test_trigID_el_singlee_7-80_larged0.py                 | 2 +-
 .../test/test_trigID_el_singlee_7-80_larged0_mt.py              | 2 +-
 .../test/test_trigID_el_singlee_7-80_larged0_pu_mt.py           | 2 +-
 .../test/test_trigID_el_singlee_7-80_pu40.py                    | 2 +-
 .../test/test_trigID_el_singlee_7-80_pu40_mt.py                 | 2 +-
 .../TrigInDetValidation/test/test_trigID_el_zee_pu40.py         | 2 +-
 .../TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py      | 2 +-
 .../TrigInDetValidation/test/test_trigID_mu_bphys.py            | 2 +-
 .../TrigInDetValidation/test/test_trigID_mu_bphys_mt.py         | 2 +-
 .../TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py | 2 +-
 .../test/test_trigID_mu_singlemu_larged0_mt.py                  | 2 +-
 .../test/test_trigID_mu_singlemu_larged0_pu.py                  | 2 +-
 .../test/test_trigID_mu_singlemu_larged0_pu_mt.py               | 2 +-
 .../TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py       | 2 +-
 .../TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py    | 2 +-
 23 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py
index 1e81a1f8047b..e63df8970ebe 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py
@@ -73,7 +73,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40_mt.py
index 1a109d69602a..dab5f4d764a8 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40_mt.py
@@ -73,7 +73,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py
index 7bcc7ded921f..b4059b9915c3 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py
@@ -73,7 +73,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py
index 40340a0c3a25..378b33fe8329 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py
@@ -73,7 +73,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py
index 6ba9a89522f8..7ef225f72347 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py
@@ -73,7 +73,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py
index 1bdf788263d1..9ff4e7edcc96 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py
@@ -72,7 +72,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py
index 46112b85709b..69ec8f6584f9 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py
index ff53bba222a4..4cd643a07d04 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py
index 5c77e74e4359..1c43c8664a8b 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py
index 0803e57c1129..c7f1fa50f7b4 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py
index 19119606eae5..07649383b633 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py
index efe7ed36cc10..092c2a68e3ba 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py
index 2beb57eff13e..3576f7f167d5 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py
index c84d08fd35ea..34b754fab8bf 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py
index 4cf057e3f605..bbc1c4c283ba 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py
index 4992954e7dc8..5fdbf2ce1b07 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py
@@ -74,7 +74,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py
index 452c86cd0948..899cff53906c 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py
@@ -74,7 +74,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py
index 02befe2d3ef0..f88401a4f6f9 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py
index 33a704cb5aac..ff730d9aa732 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py
index 9a64a0be59e2..e9b5f086437a 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py
index 4c8958edb38f..bd05f49197d3 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py
index 5c253a98bd12..202d49a31921 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py
index bf5914208cee..b3886bb083bb 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
-- 
GitLab


From 40898a68148eda2027b65ff69df27f1551b5c67a Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Tue, 22 Sep 2020 10:49:04 +0200
Subject: [PATCH 340/422] PyJobTransforms: per-substep CA flag with AMI support

---
 Tools/PyJobTransforms/python/trfArgs.py        |  3 ++-
 Tools/PyJobTransforms/python/trfExe.py         | 18 +++++++++++++++++-
 Tools/PyJobTransforms/python/trfJobOptions.py  |  8 ++++----
 Tools/PyJobTransforms/scripts/HelloWorld_tf.py |  1 +
 .../PyJobTransforms/test/test_HelloWorldTrf.sh | 10 ++++++++++
 5 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/Tools/PyJobTransforms/python/trfArgs.py b/Tools/PyJobTransforms/python/trfArgs.py
index 854fd04b7382..b4c94be325b7 100644
--- a/Tools/PyJobTransforms/python/trfArgs.py
+++ b/Tools/PyJobTransforms/python/trfArgs.py
@@ -16,7 +16,8 @@ from PyJobTransforms.trfLogger import stdLogLevels
 
 ## Add standard transform arguments to an argparse ArgumentParser
 def addStandardTrfArgs(parser):
-    parser.add_argument('--CA', action='store_true', help='Use ComponentAccumulator base configuration')
+    parser.add_argument('--CA', type=argFactory(trfArgClasses.argSubstepBool, runarg=False), nargs='?',
+                        help='Use ComponentAccumulator base configuration')
     parser.add_argument('--verbose', '--debug', action='store_true', help='Set transform loglevel to DEBUG')
     parser.add_argument('--loglevel', choices=list(stdLogLevels), help='Set transform logging level')
     parser.add_argument('--argJSON', '--argjson', metavar='FILE', help='File containing JSON serialised argument dictionary')
diff --git a/Tools/PyJobTransforms/python/trfExe.py b/Tools/PyJobTransforms/python/trfExe.py
index 05a017c984d9..8c961cee0bf7 100755
--- a/Tools/PyJobTransforms/python/trfExe.py
+++ b/Tools/PyJobTransforms/python/trfExe.py
@@ -1205,6 +1205,22 @@ class athenaExecutor(scriptExecutor):
         self._valStop = os.times()
         msg.debug('valStop time is {0}'.format(self._valStop))
 
+    ## @brief Check if running with CA
+    def _isCAEnabled(self):
+        # CA not present, not running with CA
+        if 'CA' not in self.conf.argdict:
+            return False
+
+        # CA present but None, all substeps running with CA
+        if self.conf.argdict['CA'] is None:
+            return True
+
+        # CA enabled for a substep, running with CA
+        if self.conf.argdict['CA'].returnMyValue(name=self.name, substep=self.substep) is True:
+            return True
+
+        return False
+
     ## @brief Prepare the correct command line to be used to invoke athena
     def _prepAthenaCommandLine(self):
         ## Start building up the command line
@@ -1307,7 +1323,7 @@ class athenaExecutor(scriptExecutor):
                 self._cmd.append('--nprocs=%s' % str(self._athenaMP))
 
         #Switch to ComponentAccumulator based config if requested
-        if 'CA' in self.conf.argdict:
+        if self._isCAEnabled():
             self._cmd.append("--CA")
 
         # Add topoptions
diff --git a/Tools/PyJobTransforms/python/trfJobOptions.py b/Tools/PyJobTransforms/python/trfJobOptions.py
index 624f3dffb610..e5f437839e64 100644
--- a/Tools/PyJobTransforms/python/trfJobOptions.py
+++ b/Tools/PyJobTransforms/python/trfJobOptions.py
@@ -58,12 +58,12 @@ class JobOptionsTemplate(object):
         msg.info('Writing runArgs to file \"%s\"', self._runArgsFile)
 
         ## Check consistency btw --CA flag and provided skeletons:
-        if 'CA' in self._exe.conf.argdict:
+        if self._exe._isCAEnabled():
             if self._exe._skeletonCA is None:
                 errMsg = "Got the --CA option but this transform doesn't supply a ComponentAccumulator-based skeleton file"
                 msg.error(errMsg)
                 raise  trfExceptions.TransformExecutionException(trfExit.nameToCode('TRF_EXEC_RUNARGS_ERROR'),errMsg)
-        else: # 'CA' not in self._exe.conf.argdict
+        else: # not self._exe._isCAEnabled():
             if self._exe._skeleton is None:
                 errMsg = "No --CA option given, but this transform doesn't supply old-style skeleton file"
                 msg.error(errMsg)
@@ -203,7 +203,7 @@ class JobOptionsTemplate(object):
                             raise trfExceptions.TransformExecutionException(trfExit.nameToCode("TRF_EXEC_RUNARGS_ERROR"), "Failed to find file: {0} required by athenaMP option: --athenaMPUseEventOrders true".format(self._exe._athenaMPEventOrdersFile))
                     if 'athenaMPEventsBeforeFork' in self._exe.conf.argdict:
                         print('AthenaMPJobProps.AthenaMPFlags.EventsBeforeFork={0}'.format(self._exe.conf.argdict['athenaMPEventsBeforeFork'].value), file=runargsFile)
-                if 'CA' in self._exe.conf.argdict:
+                if self._exe._isCAEnabled():
                     print(os.linesep, '# Threading flags', file=runargsFile)
                     #Pass the number of threads
                     threads = self._exe._athenaMT
@@ -251,7 +251,7 @@ class JobOptionsTemplate(object):
         self.writeRunArgs(input = input, output = output)
         # Make sure runArgs and skeleton are valid
         self.ensureJobOptions()
-        if 'CA' in self._exe.conf.argdict:
+        if self._exe._isCAEnabled():
             #ComponentAccumulator based config, use only runargs file
             return [ self._runArgsFile ]
         else:
diff --git a/Tools/PyJobTransforms/scripts/HelloWorld_tf.py b/Tools/PyJobTransforms/scripts/HelloWorld_tf.py
index caa2a6afff4b..24a55b0b2a04 100755
--- a/Tools/PyJobTransforms/scripts/HelloWorld_tf.py
+++ b/Tools/PyJobTransforms/scripts/HelloWorld_tf.py
@@ -33,6 +33,7 @@ def main():
 ## Get the base transform with all arguments added
 def getTransform():
     trf = transform(executor = athenaExecutor(name = 'athena', 
+                                              substep='HelloWorld',
                                               skeletonFile=None,
                                               skeletonCA="PyJobTransforms.HelloWorldSkeleton"))
     addAthenaArguments(trf.parser)
diff --git a/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh b/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh
index f5f19a399300..989703b84fb3 100755
--- a/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh
+++ b/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh
@@ -19,3 +19,13 @@ ATHENA_CORE_NUMBER=2 HelloWorld_tf.py --maxEvents=5 --CA --multithreaded
 
 grep 'runArgs.threads = 2' runargs.athena.py
 grep 'runArgs.concurrentEvents = 2' runargs.athena.py
+
+# CA arg test 1
+HelloWorld_tf.py --maxEvents=5 --CA HelloWorld:True
+
+# CA arg test 2
+set +e
+
+if HelloWorld_tf.py --maxEvents=5; then
+  exit 1
+fi
-- 
GitLab


From c77da169605de220cf748cceabfe67aa2f1284a0 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Tue, 22 Sep 2020 11:01:28 +0200
Subject: [PATCH 341/422] DataQuality: cmake configuration cleanup

Remove `atlas_depends_on_subdirs` and fix link dependencies where needed.
---
 DataQuality/DCSCalculator2/CMakeLists.txt     | 11 +-----
 DataQuality/DQDefects/CMakeLists.txt          |  8 +----
 DataQuality/DQUtils/CMakeLists.txt            |  9 +----
 .../DataQualityConfigurations/CMakeLists.txt  |  8 +----
 .../DataQualityInterfaces/CMakeLists.txt      | 15 +++-----
 DataQuality/DataQualityUtils/CMakeLists.txt   | 12 ++-----
 DataQuality/GoodRunsLists/CMakeLists.txt      | 35 ++-----------------
 DataQuality/GoodRunsListsUser/CMakeLists.txt  | 16 ++-------
 DataQuality/ZLumiScripts/CMakeLists.txt       |  7 +---
 9 files changed, 17 insertions(+), 104 deletions(-)

diff --git a/DataQuality/DCSCalculator2/CMakeLists.txt b/DataQuality/DCSCalculator2/CMakeLists.txt
index 828e03df1d32..5428b74761ac 100644
--- a/DataQuality/DCSCalculator2/CMakeLists.txt
+++ b/DataQuality/DCSCalculator2/CMakeLists.txt
@@ -1,17 +1,8 @@
-################################################################################
-# Package: DCSCalculator2
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DCSCalculator2 )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Database/CoolRunQuery
-                          TileCalorimeter/TileCalib/TileCalibBlobObjs
-                          DataQuality/DQDefects
-                          DataQuality/DQUtils )
-
 # External dependencies:
 find_package( sqlalchemy )
 find_package( ipython )
diff --git a/DataQuality/DQDefects/CMakeLists.txt b/DataQuality/DQDefects/CMakeLists.txt
index 78af5128d1f2..c852b89d64f5 100644
--- a/DataQuality/DQDefects/CMakeLists.txt
+++ b/DataQuality/DQDefects/CMakeLists.txt
@@ -1,14 +1,8 @@
-################################################################################
-# Package: DQDefects
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DQDefects )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          DataQuality/DQUtils )
-
 # External dependencies:
 find_package( Oracle )
 find_package( pyyaml )
diff --git a/DataQuality/DQUtils/CMakeLists.txt b/DataQuality/DQUtils/CMakeLists.txt
index 5ffbd7d58b04..70e8fd0e45dd 100644
--- a/DataQuality/DQUtils/CMakeLists.txt
+++ b/DataQuality/DQUtils/CMakeLists.txt
@@ -1,14 +1,8 @@
-################################################################################
-# Package: DQUtils
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DQUtils )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Database/CoraCool )
-
 # External dependencies:
 find_package( Boost COMPONENTS filesystem thread system )
 find_package( COOL COMPONENTS CoolKernel CoolApplication )
@@ -21,7 +15,6 @@ find_package( sqlalchemy )
 
 string(REPLACE "-Wl,--as-needed" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
 
-
 # Component(s) in the package:
 atlas_add_library( DQUtils
                    src/quick_retrieve.cxx
diff --git a/DataQuality/DataQualityConfigurations/CMakeLists.txt b/DataQuality/DataQualityConfigurations/CMakeLists.txt
index 4e11aa4cc5d6..2a673e40cd41 100644
--- a/DataQuality/DataQualityConfigurations/CMakeLists.txt
+++ b/DataQuality/DataQualityConfigurations/CMakeLists.txt
@@ -1,14 +1,8 @@
-################################################################################
-# Package: DataQualityConfigurations
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DataQualityConfigurations )
 
-# Requires DQI for binary build - this turns out not to do much, but keep for indication
-# Actual heavy lifting done by DEPENDS in add_custom_command
-atlas_depends_on_subdirs(PRIVATE DataQuality/DataQualityInterfaces)
-
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
 atlas_install_scripts( scripts/MergeConfigs.py scripts/UploadDQAMITag.py
diff --git a/DataQuality/DataQualityInterfaces/CMakeLists.txt b/DataQuality/DataQualityInterfaces/CMakeLists.txt
index 380a68b28a7b..5082eaa13739 100644
--- a/DataQuality/DataQualityInterfaces/CMakeLists.txt
+++ b/DataQuality/DataQualityInterfaces/CMakeLists.txt
@@ -1,6 +1,4 @@
-################################################################################
-# Package: DataQualityInterfaces
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DataQualityInterfaces )
@@ -17,7 +15,7 @@ find_package( nlohmann_json )
 atlas_add_root_dictionary( DataQualityInterfaces
                            DataQualityInterfacesDictSource
                            ROOT_HEADERS DataQualityInterfaces/DatabaseConfig.h DataQualityInterfaces/MiniConfig.h DataQualityInterfaces/MiniConfigTreeNode.h DataQualityInterfaces/HanApp.h DataQualityInterfaces/HanConfig.h DataQualityInterfaces/HanConfigAlgLimit.h DataQualityInterfaces/HanConfigAlgPar.h DataQualityInterfaces/HanConfigParMap.h DataQualityInterfaces/HanConfigAssessor.h DataQualityInterfaces/HanConfigCompAlg.h DataQualityInterfaces/HanConfigGroup.h DataQualityInterfaces/HanConfigMetadata.h DataQualityInterfaces/ConditionsSingleton.h DataQualityInterfaces/LinkDef.h
-                           EXTERNAL_PACKAGES ROOT  Boost tdaq-common COOL CORAL nlohmann_json)
+                           EXTERNAL_PACKAGES ROOT Boost tdaq-common COOL CORAL nlohmann_json)
 
 atlas_add_library( DataQualityInterfaces
                    src/HanAlgorithmConfig.cxx
@@ -45,15 +43,12 @@ atlas_add_library( DataQualityInterfaces
 
 atlas_add_executable( han
                       src/han.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} DataQualityInterfaces )
+                      LINK_LIBRARIES DataQualityInterfaces )
 
 atlas_add_executable( han-config-gen
                       src/han_config_gen.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}  nlohmann_json::nlohmann_json ${COOL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} DataQualityInterfaces nlohmann_json::nlohmann_json ${CORAL_LIBRARIES} ${COOL_LIBRARIES} )
+                      LINK_LIBRARIES DataQualityInterfaces )
 
 atlas_add_executable( han-config-print
                       src/han_config_print.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} DataQualityInterfaces )
+                      LINK_LIBRARIES DataQualityInterfaces )
diff --git a/DataQuality/DataQualityUtils/CMakeLists.txt b/DataQuality/DataQualityUtils/CMakeLists.txt
index 565713764670..efb1dc25eb00 100644
--- a/DataQuality/DataQualityUtils/CMakeLists.txt
+++ b/DataQuality/DataQualityUtils/CMakeLists.txt
@@ -1,15 +1,8 @@
-################################################################################
-# Package: DataQualityUtils
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DataQualityUtils )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          DataQuality/DataQualityInterfaces
-                          DataQuality/ZLumiScripts )
-
 # External dependencies:
 find_package( Boost COMPONENTS regex filesystem thread system )
 find_package( COOL COMPONENTS CoolKernel CoolApplication )
@@ -76,8 +69,7 @@ atlas_add_library( DataQualityUtils
 
 atlas_add_executable( han-results-print
                       src/han_results_print.cxx
-                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} DataQualityInterfaces DataQualityUtils )
+                      LINK_LIBRARIES DataQualityUtils )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py
diff --git a/DataQuality/GoodRunsLists/CMakeLists.txt b/DataQuality/GoodRunsLists/CMakeLists.txt
index 8abe281e81d4..9683d2affca7 100644
--- a/DataQuality/GoodRunsLists/CMakeLists.txt
+++ b/DataQuality/GoodRunsLists/CMakeLists.txt
@@ -1,36 +1,8 @@
-# $Id: CMakeLists.txt 777875 2016-10-11 17:17:13Z krasznaa $
-################################################################################
-# Package: GoodRunsLists
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( GoodRunsLists )
 
-# Declare the package's dependencies:
-if( XAOD_STANDALONE )
-   atlas_depends_on_subdirs(
-      PUBLIC
-      Control/AthToolSupport/AsgTools
-      Event/xAOD/xAODEventInfo
-      PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
-      PRIVATE
-      Tools/PathResolver )
-else()
-   atlas_depends_on_subdirs(
-      PUBLIC
-      Control/AthToolSupport/AsgTools
-      Control/AthenaBaseComps
-      Control/AthenaKernel
-      Event/xAOD/xAODEventInfo
-      PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
-      GaudiKernel
-      PRIVATE
-      Control/StoreGate
-      Event/EventInfo
-      Tools/PathResolver
-      AtlasTest/TestTools )
-endif()
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree TreePlayer XMLIO XMLParser )
 find_package( LibXml2 )
@@ -48,14 +20,13 @@ atlas_add_library( GoodRunsListsLib
    PUBLIC_HEADERS GoodRunsLists
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
    PRIVATE_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo AsgAnalysisInterfaces
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AsgAnalysisInterfaces
    PRIVATE_LINK_LIBRARIES ${LIBXML2_LIBRARIES} PathResolver )
 
 if( NOT XAOD_STANDALONE )
    atlas_add_component( GoodRunsLists
       src/*.cxx src/components/*.cxx
-      LINK_LIBRARIES AthenaBaseComps AthenaKernel xAODEventInfo GaudiKernel
-      StoreGateLib EventInfo PathResolver GoodRunsListsLib )
+      LINK_LIBRARIES AthenaBaseComps AthenaKernel EventInfo GaudiKernel GoodRunsListsLib PathResolver StoreGateLib xAODEventInfo )
 endif()
 
 atlas_add_dictionary( GoodRunsListsDict
diff --git a/DataQuality/GoodRunsListsUser/CMakeLists.txt b/DataQuality/GoodRunsListsUser/CMakeLists.txt
index 092b549ae130..4aa54cc50002 100644
--- a/DataQuality/GoodRunsListsUser/CMakeLists.txt
+++ b/DataQuality/GoodRunsListsUser/CMakeLists.txt
@@ -1,20 +1,8 @@
-################################################################################
-# Package: GoodRunsListsUser
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( GoodRunsListsUser )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Control/StoreGate
-                          DataQuality/GoodRunsLists
-                          Event/EventInfo
-                          GaudiKernel
-                          Trigger/TrigAnalysis/TrigDecisionTool
-                          Trigger/TrigEvent/TrigDecisionEvent )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
 
@@ -25,7 +13,7 @@ atlas_add_component( GoodRunsListsUser
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GoodRunsListsLib EventInfo GaudiKernel TrigDecisionToolLib TrigDecisionEvent )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GoodRunsListsLib EventInfo GaudiKernel TrigDecisionToolLib TrigDecisionEvent )
 
 # Install files from the package:
 atlas_install_headers( GoodRunsListsUser )
diff --git a/DataQuality/ZLumiScripts/CMakeLists.txt b/DataQuality/ZLumiScripts/CMakeLists.txt
index b658acb5bba6..5378b300298e 100644
--- a/DataQuality/ZLumiScripts/CMakeLists.txt
+++ b/DataQuality/ZLumiScripts/CMakeLists.txt
@@ -1,13 +1,8 @@
-################################################################################
-# Package: ZLumiScripts
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( ZLumiScripts )
 
-# Declare the package's dependencies:
-#atlas_depends_on_subdirs( )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
-- 
GitLab


From 3022ccda72188f0b3a9c652e8c9977b90b68c35d Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Mon, 14 Sep 2020 15:12:47 +0200
Subject: [PATCH 342/422] PyUtils: Revert XML import hack

Revert workarounds (!31320,!31424) for ATEAM-597 as those
are no longer needed in LCG_98.
---
 Tools/PyUtils/python/Helpers.py | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/Tools/PyUtils/python/Helpers.py b/Tools/PyUtils/python/Helpers.py
index 3bb6d39c358e..fb04164a374b 100644
--- a/Tools/PyUtils/python/Helpers.py
+++ b/Tools/PyUtils/python/Helpers.py
@@ -14,10 +14,6 @@ import six
 
 from AthenaCommon.Logging import log
 
-# import xml before ROOT to prevent crashes (LCG_96): ATEAM-597
-# should be OK to remove from LCG_97 on
-import xml.etree.cElementTree  # noqa: F401
-
 def ROOT6Setup():
    log.info('executing ROOT6Setup')
    if six.PY3:
@@ -30,8 +26,7 @@ def ROOT6Setup():
    def root6_importhook(name, globals={}, locals={}, fromlist=[], level=-1):
        if six.PY3 and level < 0: level = 0
        m = oldimporthook(name, globals, locals, fromlist, level)
-       if m and (m.__name__== 'ROOT' or name[0:4]=='ROOT') \
-             and (name!='ROOT' or fromlist is not None): # prevent triggering on just 'import ROOT'; see ATEAM-597
+       if m and (m.__name__== 'ROOT' or name[0:4]=='ROOT'):
           log.debug('Python import module=%s  fromlist=%s', name, str(fromlist))
           if fromlist:
              #MN: in this case 'm' is the final nested module already, don't walk the full 'name'
-- 
GitLab


From 5daafff20c426afee9bd4a013eeae0fe51a4e481 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Mon, 14 Sep 2020 15:17:55 +0200
Subject: [PATCH 343/422] PyUtils.Helpers: remove Python2
 backwards-compatibility code

---
 Tools/PyUtils/python/Helpers.py | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/Tools/PyUtils/python/Helpers.py b/Tools/PyUtils/python/Helpers.py
index fb04164a374b..40b9d594df9c 100644
--- a/Tools/PyUtils/python/Helpers.py
+++ b/Tools/PyUtils/python/Helpers.py
@@ -4,27 +4,20 @@
 # @date:   March 2007
 #
 #
-from __future__ import with_statement, print_function
-
-__author__  = "Sebastien Binet <binet@cern.ch>"
 
 import sys
 import os
-import six
 
 from AthenaCommon.Logging import log
 
 def ROOT6Setup():
    log.info('executing ROOT6Setup')
-   if six.PY3:
-      import builtins as builtin_mod
-   else:
-      import __builtin__ as builtin_mod
+   import builtins as builtin_mod
    oldimporthook = builtin_mod.__import__
    autoload_var_name = 'ROOT6_NamespaceAutoloadHook'
    
    def root6_importhook(name, globals={}, locals={}, fromlist=[], level=-1):
-       if six.PY3 and level < 0: level = 0
+       if level < 0: level = 0
        m = oldimporthook(name, globals, locals, fromlist, level)
        if m and (m.__name__== 'ROOT' or name[0:4]=='ROOT'):
           log.debug('Python import module=%s  fromlist=%s', name, str(fromlist))
@@ -111,8 +104,7 @@ class ShutUp(object):
     def __filterRootMessages(self, fd):
         fd.seek(0)
         for l in fd.readlines():
-            if six.PY3:
-               l = l.decode()
+            l = l.decode()
             printOut = True
             for filter in self.filters:
                 if re.match(filter, l):
-- 
GitLab


From 13900410af61c8f19a95eb25620d6e366cd948b7 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Mon, 14 Sep 2020 15:44:12 +0200
Subject: [PATCH 344/422] PyUtils: Add batch option to ROOT6Setup

With the new PyROOT the command line argument `-b` is no longer parsed
to set the batch mode. Add an option to `ROOT6Setup` to set batch mode
whenever the first `ROOT` import is done. This can then be used by
`athena.py` to set the batch mode but without having to actually import
ROOT early in the boostrap.
---
 Tools/PyUtils/python/Helpers.py | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/Tools/PyUtils/python/Helpers.py b/Tools/PyUtils/python/Helpers.py
index 40b9d594df9c..372334917715 100644
--- a/Tools/PyUtils/python/Helpers.py
+++ b/Tools/PyUtils/python/Helpers.py
@@ -10,34 +10,47 @@ import os
 
 from AthenaCommon.Logging import log
 
-def ROOT6Setup():
+def ROOT6Setup(batch=False):
    log.info('executing ROOT6Setup')
    import builtins as builtin_mod
    oldimporthook = builtin_mod.__import__
    autoload_var_name = 'ROOT6_NamespaceAutoloadHook'
-   
-   def root6_importhook(name, globals={}, locals={}, fromlist=[], level=-1):
-       if level < 0: level = 0
+   batch_mode = bool(batch)
+
+   def root6_importhook(name, globals={}, locals={}, fromlist=[], level=0):
+       nonlocal batch_mode
+       isroot = False
+       bm = batch_mode
+       if name=='ROOT' or (name[0:4]=='ROOT' and name!='ROOT.pythonization'):
+          isroot = True
+          batch_mode = None  # only set it on first ROOT import
+
        m = oldimporthook(name, globals, locals, fromlist, level)
-       if m and (m.__name__== 'ROOT' or name[0:4]=='ROOT'):
-          log.debug('Python import module=%s  fromlist=%s', name, str(fromlist))
+
+       if m and isroot:
+          log.debug('Python import module=%s, fromlist=%s', name, fromlist)
+          if bm is not None:
+             log.debug('Setting ROOT batch mode to %s', bm)
+             m.gROOT.SetBatch(bm)
+
           if fromlist:
-             #MN: in this case 'm' is the final nested module already, don't walk the full 'name'
+             # in this case 'm' is the final nested module already, don't walk the full 'name'
              vars = [ '.'.join(['', fl, autoload_var_name]) for fl in fromlist]
           else:
              vars = [ '.'.join([name, autoload_var_name]) ]
+
           for v in vars:
              try:
                 mm = m
-                #MN: walk the module chain and try to touch 'autoload_var_name' to trigger ROOT autoloading of namespaces
+                # walk the module chain and try to touch 'autoload_var_name' to trigger ROOT autoloading of namespaces
                 for comp in v.split('.')[1:]:
                    mm = getattr(mm, comp)
              except Exception:
                 pass
+
        return m
-   
+
    builtin_mod.__import__ = root6_importhook
-      
 
 
 import re
-- 
GitLab


From 495676e95cc5248306d92143e0b2c7a7a5fb854d Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Tue, 22 Sep 2020 11:22:08 +0200
Subject: [PATCH 345/422] athena.py: Set ROOT batch mode

Set ROOT batch mode according to `-i` command line flag.
---
 Control/AthenaCommon/share/Preparation.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Control/AthenaCommon/share/Preparation.py b/Control/AthenaCommon/share/Preparation.py
index 8bf10b03a4de..de3afe83a052 100644
--- a/Control/AthenaCommon/share/Preparation.py
+++ b/Control/AthenaCommon/share/Preparation.py
@@ -75,7 +75,7 @@ else:
    min_cppyy_vmem_growth = None
 
 from PyUtils.Helpers import ROOT6Setup
-ROOT6Setup()
+ROOT6Setup(batch=opts.run_batch)
 
 if min_cppyy_vmem_growth:
    grow_vmem( vmem_before_cppyy + min_cppyy_vmem_growth )
-- 
GitLab


From 315a041963fad25157bd9a5601a6b8524f27ab20 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Tue, 22 Sep 2020 11:08:28 +0100
Subject: [PATCH 346/422] TrkVertexFitter Thread safety issue : Remove
 const_cast

---
 .../TrkVertexBilloirTools/FastVertexFitter.h             | 3 +--
 .../TrkVertexBilloirTools/src/FastVertexFitter.cxx       | 9 +++++----
 .../TrkVertexFitterInterfaces/ATLAS_CHECK_THREAD_SAFETY  | 1 +
 .../TrkVertexFitters/DummyVertexSmoother.h               | 2 +-
 .../TrkVertexFitters/src/DummyVertexSmoother.cxx         | 5 ++---
 5 files changed, 10 insertions(+), 10 deletions(-)
 create mode 100644 Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Tracking/TrkVertexFitter/TrkVertexBilloirTools/TrkVertexBilloirTools/FastVertexFitter.h b/Tracking/TrkVertexFitter/TrkVertexBilloirTools/TrkVertexBilloirTools/FastVertexFitter.h
index ba763e34b386..09eff0b9df54 100755
--- a/Tracking/TrkVertexFitter/TrkVertexBilloirTools/TrkVertexBilloirTools/FastVertexFitter.h
+++ b/Tracking/TrkVertexFitter/TrkVertexBilloirTools/TrkVertexBilloirTools/FastVertexFitter.h
@@ -33,8 +33,7 @@ EDM Migration to xAOD - from Trk::VxCandidate to xAOD::Vertex,
                         from Trk::Vertex      to Amg::Vector3D
 */
 
-class ATLAS_NOT_THREAD_SAFE FastVertexFitter //const_cast the extrapolator result
-  : public extends<AthAlgTool, IVertexFitter>
+class FastVertexFitter : public extends<AthAlgTool, IVertexFitter>
 {
 public:
   // The following 'using' can be removed when IVertexFitter::fit has been fully
diff --git a/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx b/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx
index a35a85d78b88..3de822d35296 100755
--- a/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx
@@ -318,14 +318,15 @@ namespace Trk
 					// you need to extrapolate the original perigee ((*BTIter).originalPerigee) really to the
 					// found vertex. The first propagation above is only to the starting point. But here we
 					// want to store it wrt. to the last fitted vertex
-					Trk::TrackParameters * extrapolatedPerigee = const_cast<Trk::TrackParameters*> ( m_extrapolator->extrapolate ( * ( *BTIter ).originalPerigee, perigeeSurface ) );
+					auto extrapolatedPerigee = std::unique_ptr<const Trk::TrackParameters> ( m_extrapolator->extrapolate ( * ( *BTIter ).originalPerigee, perigeeSurface ) );
 					if ( extrapolatedPerigee==nullptr )
 					{
-						extrapolatedPerigee = ( ( *BTIter ).originalPerigee )->clone();
+						extrapolatedPerigee = std::unique_ptr<const Trk::TrackParameters>(((*BTIter).originalPerigee)->clone());
 						ATH_MSG_DEBUG("Could not extrapolate these track parameters to final vertex position! Storing original position as final one ...");
 					}
-
-					Trk::VxTrackAtVertex* tmpVxTrkAtVtx = new Trk::VxTrackAtVertex ( ( *BTIter ).chi2, extrapolatedPerigee, ( *BTIter ).originalPerigee ) ;
+          //VxTrackAtVertex will own the clone of the extrapolatedPerigee
+					Trk::VxTrackAtVertex* tmpVxTrkAtVtx = new Trk::VxTrackAtVertex ( ( *BTIter ).chi2, extrapolatedPerigee->clone(), 
+                                                                           ( *BTIter ).originalPerigee ) ;
 					tracksAtVertex.push_back ( *tmpVxTrkAtVtx );
 					// TODO: here is where the vxTracksAtVertex pointers are deleted
 					delete tmpVxTrkAtVtx; // TODO: is this ok?
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..415ac0cee8d0
--- /dev/null
+++ b/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkVertexFitter/TrkVertexFitterInterfaces
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h b/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h
index a48d3de9e74c..4e4fc91aad7c 100755
--- a/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h
+++ b/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h
@@ -40,7 +40,7 @@ namespace Trk
    */ 
 
   //Not THREAD_SAFE due to const_cast 
-  class ATLAS_NOT_THREAD_SAFE DummyVertexSmoother : public AthAlgTool, virtual public IVertexSmoother
+  class DummyVertexSmoother : public AthAlgTool, virtual public IVertexSmoother
   {
   public:
   
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx b/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx
index bad68a45f101..03a19f720072 100755
--- a/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx
@@ -75,14 +75,13 @@ namespace Trk
 
           if(initPar != nullptr)
           {
-            //This does not play well with const correctness
             //Either we should return non-const parameters from the extrapolator
             //as the owner here has to delete them
             //Or we need to clone  
-            const Trk::TrackParameters* extrapolatedPerigee(m_extrapolator->extrapolate(*initPar,perigeeSurface));
+            auto extrapolatedPerigee = std::unique_ptr<const Trk::TrackParameters>(m_extrapolator->extrapolate(*initPar,perigeeSurface));
             if(extrapolatedPerigee != nullptr)
             {
-              (*t_it).setPerigeeAtVertex(const_cast<Trk::TrackParameters*>(extrapolatedPerigee));
+              (*t_it).setPerigeeAtVertex(extrapolatedPerigee->clone());
             } else {
               msg(MSG::ERROR)  << " Extrapolation failed; VxTrackAtertex will not be updated" << endmsg;
             }//end of successfull extrapolation check
-- 
GitLab


From ec97e0c2f98b72e97faf2d8b0fbbfe3de88a002d Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Tue, 22 Sep 2020 12:32:43 +0200
Subject: [PATCH 347/422] Migrate clients of  IEnvelopeDefSvc to
 const-accessors

---
 .../src/CaloTrackingGeometryBuilder.cxx       |  5 ++-
 .../src/CaloTrackingGeometryBuilderCond.cxx   |  5 ++-
 .../src/RobustTrackingGeometryBuilder.cxx     |  2 +-
 .../src/RobustTrackingGeometryBuilderCond.cxx |  2 +-
 .../src/StagedTrackingGeometryBuilder.cxx     |  2 +-
 .../src/StagedTrackingGeometryBuilderCond.cxx |  2 +-
 .../src/MuonTrackingGeometryBuilder.cxx       |  4 +--
 .../src/MuonTrackingGeometryBuilderCond.cxx   |  4 +--
 .../src/PunchThroughTool.cxx                  |  4 +--
 .../src/GenericGeometryBuilder.cxx            | 31 ++++++++---------
 .../src/GenericGeometryBuilderCond.cxx        | 33 ++++++++-----------
 11 files changed, 42 insertions(+), 52 deletions(-)

diff --git a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx
index 863c05aae82b..876a01a83c1d 100755
--- a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx
+++ b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx
@@ -233,8 +233,7 @@ const Trk::TrackingGeometry* Calo::CaloTrackingGeometryBuilder::trackingGeometry
     keyDim.push_back(RZPair(enclosedInnerSectorRadius, enclosedInnerSectorHalflength));
   }   
   // get the dimensions from the envelope service
-  RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getCaloRZValues(0);
-  //RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues(0);
+  const RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getCaloRZBoundary();
 
   // find the max,max pair
   unsigned int ii=0;
@@ -316,7 +315,7 @@ const Trk::TrackingGeometry* Calo::CaloTrackingGeometryBuilder::trackingGeometry
  
   // BEAM PIPE
   //std::cout <<"envelope svc : number of BeamPipe Volumes:"<< m_enclosingEnvelopeSvc->getBeamPipeNumVols()<< std::endl;  
-  RZPairVector& bpDefs = m_enclosingEnvelopeSvc->getBeamPipeRZValues(0);
+  const RZPairVector& bpDefs = m_enclosingEnvelopeSvc->getBeamPipeRZBoundary();
   
   ATH_MSG_VERBOSE( "BeamPipe envelope definition retrieved:" );   
   m_bpCutouts.clear();
diff --git a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx
index ad91e5844852..1992999c271b 100755
--- a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx
+++ b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx
@@ -240,8 +240,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Calo::CaloTrackingGeometry
     keyDim.push_back(RZPair(enclosedInnerSectorRadius, enclosedInnerSectorHalflength));
   }   
   // get the dimensions from the envelope service
-  RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getCaloRZValues(0);
-  //RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues(0);
+  const RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getCaloRZBoundary();
 
   // find the max,max pair
   unsigned int ii=0;
@@ -323,7 +322,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Calo::CaloTrackingGeometry
  
   // BEAM PIPE
   //std::cout <<"envelope svc : number of BeamPipe Volumes:"<< m_enclosingEnvelopeSvc->getBeamPipeNumVols()<< std::endl;  
-  RZPairVector& bpDefs = m_enclosingEnvelopeSvc->getBeamPipeRZValues(0);
+  const RZPairVector& bpDefs = m_enclosingEnvelopeSvc->getBeamPipeRZBoundary();
   
   ATH_MSG_VERBOSE( "BeamPipe envelope definition retrieved:" );   
   m_bpCutouts.clear();
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
index 4252dae946b9..26f66afbe716 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
@@ -531,7 +531,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome
                                                                    "Container");
                                                                    
    // get the dimensions from the envelope service 
-   RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
+   const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZBoundary();
    ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
    double enclosingVolumeRadius = envelopeDefs[1].first;
    double enclosingVolumeHalfZ  = fabs(envelopeDefs[1].second);
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
index fc37f3dd3106..b4857202b0bc 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
@@ -542,7 +542,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome
                                                                    "Container");
                                                                    
    // get the dimensions from the envelope service 
-   RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
+   const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZBoundary();
    ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
    double enclosingVolumeRadius = envelopeDefs[1].first;
    double enclosingVolumeHalfZ  = fabs(envelopeDefs[1].second);
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
index ff798f6dfb71..4a975bc65e50 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
@@ -134,7 +134,7 @@ const Trk::TrackingGeometry* InDet::StagedTrackingGeometryBuilder::trackingGeome
    Trk::TrackingGeometry* trackingGeometry = 0;   
 
    // get the dimensions from the envelope service 
-   RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
+   const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZBoundary();
    ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
    double envelopeVolumeRadius = envelopeDefs[1].first;
    double envelopeVolumeHalfZ  = fabs(envelopeDefs[1].second);
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
index c297b686c964..f88833a8d419 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
@@ -135,7 +135,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::StagedTrackingGeome
    Trk::TrackingGeometry* trackingGeometry = 0;   
 
    // get the dimensions from the envelope service 
-   RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
+   const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZBoundary();
    ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
    double envelopeVolumeRadius = envelopeDefs[1].first;
    double envelopeVolumeHalfZ  = fabs(envelopeDefs[1].second);
diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilder.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilder.cxx
index c481613211d0..a36167934d7a 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilder.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilder.cxx
@@ -178,7 +178,7 @@ const Trk::TrackingGeometry* Muon::MuonTrackingGeometryBuilder::trackingGeometry
   RZPairVector envelopeDefs;
   if (m_enclosingEnvelopeSvc) {
     // get the dimensions from the envelope service
-    RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getMuonRZValues();
+    const RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getMuonRZBoundary();
 
     // find the max,max pair
     unsigned int ii=0;
@@ -379,7 +379,7 @@ const Trk::TrackingGeometry* Muon::MuonTrackingGeometryBuilder::trackingGeometry
     
   } else {     // no input, create the enclosed volume
     if (m_loadMSentry && m_enclosingEnvelopeSvc ) {
-      RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues();
+      const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZBoundary();
       // to be implemented in detail - for the moment, take just maximal extent
       ATH_MSG_DEBUG( " m_loadMSentry " << m_loadMSentry << " m_enclosingEnvelopeSvc " << m_enclosingEnvelopeSvc );
       double rmax = 0.; double zmax = 0.;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx
index 4b4dfeb861e7..eee3037e4e40 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx
@@ -185,7 +185,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Muon::MuonTrackingGeometry
   RZPairVector envelopeDefs;
   if (m_enclosingEnvelopeSvc) {
     // get the dimensions from the envelope service
-    RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getMuonRZValues();
+    const RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getMuonRZBoundary();
 
     // find the max,max pair
     unsigned int ii=0;
@@ -386,7 +386,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Muon::MuonTrackingGeometry
     
   } else {     // no input, create the enclosed volume
     if (m_loadMSentry && m_enclosingEnvelopeSvc ) {
-      RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues();
+      const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZBoundary();
       // to be implemented in detail - for the moment, take just maximal extent
       ATH_MSG_DEBUG( " m_loadMSentry " << m_loadMSentry << " m_enclosingEnvelopeSvc " << m_enclosingEnvelopeSvc );
       double rmax = 0.; double zmax = 0.;
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/src/PunchThroughTool.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/src/PunchThroughTool.cxx
index 36bf78563c3f..f75ac5915aa3 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/src/PunchThroughTool.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/src/PunchThroughTool.cxx
@@ -263,8 +263,8 @@ StatusCode ISF::PunchThroughTool::initialize()
 
   // get the calo-MS border coordinates. Look at calo and MS geometry definitions, if same R and Z -> boundary surface
 
-  RZPairVector* rzMS = &(m_envDefSvc->getMuonRZValues());
-  RZPairVector* rzCalo = &(m_envDefSvc->getCaloRZValues());
+  const RZPairVector* rzMS = &(m_envDefSvc->getMuonRZBoundary());
+  const RZPairVector* rzCalo = &(m_envDefSvc->getCaloRZBoundary());
 
   bool found1, found2;
   found1=false; found2=false;
diff --git a/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilder.cxx b/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilder.cxx
index dc1188ec97cc..1681a09595f8 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilder.cxx
+++ b/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilder.cxx
@@ -111,25 +111,22 @@ const Trk::TrackingGeometry* Trk::GenericGeometryBuilder::trackingGeometry(const
     // vacuum
     Trk::Material vacuum;
     
-    RZPairVector envelopeDefs;  
-    // build the inner detector if configured
-    if (m_geometrySignature == Trk::ID){
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
-    } else if ( m_geometrySignature == Trk::Calo  ){
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Calorimeter envelope definitions at size " << envelopeDefs.size());
-    } else if ( m_geometrySignature == Trk::MS ) {
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getMuonRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Muon System envelope definitions at size " << envelopeDefs.size());
-    } else {
-        ATH_MSG_WARNING("No geometry signature found, return 0.");
-        return 0;
+    const std::map<int,AtlasDetDescr::AtlasRegion> trk2DetDesc{
+      {Trk::ID,AtlasDetDescr::fAtlasID},
+      {Trk::Calo,AtlasDetDescr::fAtlasCalo},
+      {Trk::MS,AtlasDetDescr::fAtlasMS}
+    };
+
+    const auto addId=trk2DetDesc.find(m_geometrySignature);
+    if (addId==trk2DetDesc.end()) {
+      ATH_MSG_WARNING("No geometry signature found, return 0.");
+      //dummy infinite range
+      EventIDRange range;
+      return nullptr;
     }
 
+    const RZPairVector& envelopeDefs=m_enclosingEnvelopeSvc->getRZBoundary(addId->second);
+
     // ------------------------------- overall dimensions ----------------------------------------------
     // get the maximum extend in R
     for ( auto& rzIter : envelopeDefs){
diff --git a/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilderCond.cxx b/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilderCond.cxx
index f65cdef1ce26..6ffd400006ea 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilderCond.cxx
+++ b/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilderCond.cxx
@@ -111,27 +111,22 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Trk::GenericGeometryBuilde
     // vacuum
     Trk::Material vacuum;
     
-    RZPairVector envelopeDefs;  
-    // build the inner detector if configured
-    if (m_geometrySignature == Trk::ID){
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
-    } else if ( m_geometrySignature == Trk::Calo  ){
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Calorimeter envelope definitions at size " << envelopeDefs.size());
-    } else if ( m_geometrySignature == Trk::MS ) {
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getMuonRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Muon System envelope definitions at size " << envelopeDefs.size());
-    } else {
-        ATH_MSG_WARNING("No geometry signature found, return 0.");
-        //dummy infinite range
-        EventIDRange range;
-        return std::make_pair(range,tGeometry);
+    const std::map<int,AtlasDetDescr::AtlasRegion> trk2DetDesc{
+      {Trk::ID,AtlasDetDescr::fAtlasID},
+      {Trk::Calo,AtlasDetDescr::fAtlasCalo},
+      {Trk::MS,AtlasDetDescr::fAtlasMS}
+    };
+
+    const auto addId=trk2DetDesc.find(m_geometrySignature);
+    if (addId==trk2DetDesc.end()) {
+      ATH_MSG_WARNING("No geometry signature found, return 0.");
+      //dummy infinite range
+      EventIDRange range;
+      return std::make_pair(range,tGeometry);
     }
 
+    const RZPairVector& envelopeDefs=m_enclosingEnvelopeSvc->getRZBoundary(addId->second);
+
     // ------------------------------- overall dimensions ----------------------------------------------
     // get the maximum extend in R
     for ( auto& rzIter : envelopeDefs){
-- 
GitLab


From e0217b18698eac292faef662671159ac007dfd48 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Tue, 22 Sep 2020 12:33:20 +0200
Subject: [PATCH 348/422] drop non-const accessors from IEnvelopeDefSvc.h

---
 .../SubDetectorEnvelopes/IEnvelopeDefSvc.h               | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.h b/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.h
index 76671fd8cf5e..0a0ef4454d30 100644
--- a/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.h
+++ b/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.h
@@ -48,15 +48,6 @@ class IEnvelopeDefSvc : virtual public IInterface {
     const RZPairVector &getMuonRZBoundary()     const { return getRZBoundary(AtlasDetDescr::fAtlasMS);      }
     const RZPairVector &getCavernRZBoundary()   const { return getRZBoundary(AtlasDetDescr::fAtlasCavern);  }
 
-    /** legacy methods
-          Any client should update to use the methods defined above!
-          The following lecagy methods will be phased out once all clients have migrated to the new methods above */
-    RZPairVector &getBeamPipeRZValues( unsigned short = 0) const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasForward) ); }
-    RZPairVector &getInDetRZValues( unsigned short = 0)    const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasID) );      }
-    RZPairVector &getCaloRZValues( unsigned short = 0)     const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasCalo) );    }
-    RZPairVector &getMuonRZValues( unsigned short = 0)     const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasMS) );      }
-    RZPairVector &getCavernRZValues( unsigned short = 0)   const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasCavern) );  }
-
   protected:
     /** mirror the given srcRZ RZPairVector in the XY-plane to describe all corner points
      in (r,z) space in the dstRZ RZPairVector */
-- 
GitLab


From 77537c231d708989bb49a29bab77bd0025a98698 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Tue, 22 Sep 2020 12:43:40 +0200
Subject: [PATCH 349/422] Add possible post exec implementation

---
 .../python/TrigInDetArtSteps.py               |  9 +++-
 .../share/TIDAml_extensions.py                |  7 +++
 .../share/TrigInDetValidation_Base.py         |  7 ++-
 .../test/test_trigID_fsjet_ml_pu40.py         | 47 +++++++++++++++++++
 4 files changed, 67 insertions(+), 3 deletions(-)
 create mode 100644 Trigger/TrigValidation/TrigInDetValidation/share/TIDAml_extensions.py
 create mode 100755 Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_ml_pu40.py

diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
index 6de0b967eea2..a2729962d6a8 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
@@ -22,7 +22,7 @@ from AthenaCommon.Utils.unixtools import FindFile
 
 class TrigInDetReco(ExecStep):
 
-    def __init__(self, name='TrigInDetReco'):
+    def __init__(self, name='TrigInDetReco', postexec_file='' ):
         ExecStep.__init__(self, name)
 ##        super(TrigInDetReco, self).__init__(name)
         self.type = 'Reco_tf'
@@ -57,6 +57,12 @@ class TrigInDetReco(ExecStep):
             'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
         ])
         self.postexec_trig = "from AthenaCommon.AppMgr import ServiceMgr; ServiceMgr.AthenaPoolCnvSvc.MaxFileSizes=['tmp.RDO_TRIG=100000000000']"
+
+        if postexec_file!='' : 
+            pe_file = open( postexec_file )
+            self.postexec_trig += ";"+pe_file.read()            
+            print( "postexec_trig: ", self.postexec_trig )
+
         self.postexec_reco = "from AthenaCommon.AppMgr import ServiceMgr; ServiceMgr.AthenaPoolCnvSvc.MaxFileSizes=['tmp.ESD=100000000000']"
         self.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" '
 
@@ -140,6 +146,7 @@ class TrigInDetdictStep(Step):
         os.system( 'get_files -data TIDAdata_cuts.dat' )
         os.system( 'get_files -data TIDAdata-run3-offline.dat' )
         os.system( 'get_files -data TIDAdata_cuts-offline.dat' )
+        os.system( 'get_files -jo   TIDAml_extensions.py' ) 
         super(TrigInDetdictStep, self).configure(test)
 
 
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TIDAml_extensions.py b/Trigger/TrigValidation/TrigInDetValidation/share/TIDAml_extensions.py
new file mode 100644
index 000000000000..7cc870252a8e
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TIDAml_extensions.py
@@ -0,0 +1,7 @@
+ftf = findAlgorithm(topSequence, "TrigFastTrackFinder_JetFS")
+ftf.doSeedRedundancyCheck = True
+ftf.UseTrigSeedML  = 1 #can be 0, 1, 2, or 3, 0 means the
+# ML-based seed filtering is off
+ftf.TrigSeedML_LUT = 'trigseed_ML_medium.lut' 
+ftf.OutputLevel=DEBUG 
+
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py
index eb8bbd1512b4..010a4e1cf97b 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py
@@ -34,6 +34,7 @@ local    = False
 exclude  = False
 postproc = False
 
+
 for opt,arg in opts:
     if opt in ("-l", "--local"):
         local=True
@@ -44,8 +45,10 @@ for opt,arg in opts:
     if opt=="-n":
         LEvents=arg
 
-
-rdo2aod = TrigInDetReco()
+if 'postexec' in dir() :
+    rdo2aod = TrigInDetReco( postexec_file=postexec )
+else :
+    rdo2aod = TrigInDetReco()
 
 # test specific variables ...
 
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_ml_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_ml_pu40.py
new file mode 100755
index 000000000000..6fe968139ba3
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_ml_pu40.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+# art-description: art job for fsjet_ml_pu40
+# art-type: grid
+# art-include: master/Athena
+# art-input: valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.RDO.e4993_s3214_r11315
+# art-input-nfiles: 3
+# art-athena-mt: 4
+# art-memory: 4096
+# art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir=
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+Slices  = ['fsjet']
+RunEF   = False
+Events  = 2000 
+Threads = 1 
+Slots   = 1 # what about the mt: 4 art directive ? nfiles: 3 ?
+Input   = 'ttbar'    # defined in TrigValTools/share/TrigValInputs.json  
+
+# post exec doesn't quite work yet
+# postexec_file = 'TIDAml_extensions.py'
+
+TrackReference = [ 'Truth', 'Offline' ]
+
+
+from AthenaCommon.Include import include 
+include("TrigInDetValidation/TrigInDetValidation_Base.py")
+
+
+ 
-- 
GitLab


From 79cee4dcabfeefdfdc6390e8bf31c2e45280a97f Mon Sep 17 00:00:00 2001
From: Nicolas Koehler <nicolas.koehler@cern.ch>
Date: Tue, 22 Sep 2020 10:45:52 +0000
Subject: [PATCH 350/422] fix python3 printout

---
 .../GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py
index 530b877a6fa4..596940e127a2 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py
@@ -10,7 +10,7 @@ if globalflags.DataSource() == 'data' and os.getenv("FRONTIER_SERVER") == None :
     # Patch dblookup.xml to avoid any attempt to use sqlite replicas
     print ("VP1 Info: real data mode and Frontier environment not set - need to patch dblookup.xml to avoid using local sqlite replicas.")
     if os.path.exists("dblookup.xml"):
-        print "VP1 Warning: dblookup.xml already found in run directory. Will not attempt to created patched copy."
+        print ("VP1 Warning: dblookup.xml already found in run directory. Will not attempt to created patched copy.")
         os.putenv("CORAL_DBLOOKUP_PATH",".")
     else:
         if os.getenv("CORAL_AUTH_PATH") == None or not os.path.isdir(os.getenv("CORAL_AUTH_PATH")):
-- 
GitLab


From 09958f7311570ea1e4a228cefa6ecd07751a1c4d Mon Sep 17 00:00:00 2001
From: amete <serhanmete@gmail.com>
Date: Tue, 22 Sep 2020 13:21:44 +0200
Subject: [PATCH 351/422] Pipe debug message into log

---
 .../InDetExample/InDetRecExample/python/TrackingCommon.py       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
index 082a8dcb2f97..d27dfcbc2709 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
@@ -95,7 +95,7 @@ def makePublicTool(tool_creator) :
             if the_name != tool.name() :
                 raise Exception('Tool has not the exepected name %s but %s' % (the_name, tool.name()))
             if private is False :
-                print ('DEBUG add to ToolSvc %s' % (tool.name()))
+                log.debug ('DEBUG add to ToolSvc %s' % (tool.name()))
                 ToolSvc += tool
             return tool
         else :
-- 
GitLab


From 652bc88bfd23e7bdbcc1d4fce323930cddd58571 Mon Sep 17 00:00:00 2001
From: Savanna Marie Shaw <savanna.marie.shaw@cern.ch>
Date: Tue, 22 Sep 2020 14:48:38 +0200
Subject: [PATCH 352/422] Fix compiler warning in MscMlusterOnTrackCreator

Fixing a compiler warning introduced in the clang build by https://gitlab.cern.ch/atlas/athena/-/merge_requests/36503.
---
 .../MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
index 2a4595e3883e..6e4323af41a1 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
@@ -331,7 +331,7 @@ namespace Muon {
       results = m_clusterUtilTool->getRefitCluster(MClus,tantheta);
       results0 = m_clusterUtilTool->getRefitCluster(MClus,0);
 
-      if(&results[0]==nullptr || &results0[0]==nullptr){
+      if(results.empty() || results0.empty()){
 	ATH_MSG_VERBOSE("No fit result");
 	return new CscClusterOnTrack(MClus,locpar,loce,positionAlongStrip,MClus->status(),MClus->timeStatus(),MClus->time());
       }
-- 
GitLab


From 3e357607b9717b37f593cdc5d6847cb164a4ad81 Mon Sep 17 00:00:00 2001
From: Savanna Marie Shaw <savanna.marie.shaw@cern.ch>
Date: Tue, 22 Sep 2020 15:28:04 +0200
Subject: [PATCH 353/422] Switch back to default pixel cluster tool for
 MuonRotCreator

Reverting one of the changes from https://gitlab.cern.ch/atlas/athena/-/merge_requests/36431 which updated the pixel cluster tool used by default in the MuonRotCreator. This tool is not actually used (it's disabled in the muon 'mode'), so it shouldn't really matter which tool is configured here. However, it seems that as it is now is somehow configuring some tracking tools out of place in some offline and trigger jobs (maybe the import is picking up something not wanted in this particular case). See also ATLASRECTS-5664.
---
 .../MuonReconstruction/MuonRecExample/python/MuonRecTools.py  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
index 65f39261428b..f967c9556df0 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
@@ -156,8 +156,6 @@ class MuonRotCreator(Trk__RIO_OnTrackCreator,ConfiguredBase):
         kwargs.setdefault("ToolMuonDriftCircle", "MdtDriftCircleOnTrackCreator")
         kwargs.setdefault("ToolMuonCluster", "MuonClusterOnTrackCreator")
         kwargs.setdefault("Mode", 'muon' )
-        from InDetRecExample.TrackingCommon import getInDetPixelClusterOnTrackToolDigital
-        kwargs.setdefault("ToolPixelCluster", getInDetPixelClusterOnTrackToolDigital( "PixelClusterOnTrackTool" ) )
         super(MuonRotCreator,self).__init__(name,**kwargs)
 # end of class MuonRotCreator
 
@@ -499,4 +497,4 @@ def MuonLayerSegmentFinderTool(name='MuonLayerSegmentFinderTool',extraFlags=None
     kwargs.setdefault("Csc4DSegmentMaker", getPublicTool("Csc4dSegmentMaker") if MuonGeometryFlags.hasCSC() else "")
     kwargs.setdefault("MuonClusterSegmentFinder",getPublicTool("MuonClusterSegmentFinder"))
 
-    return CfgMgr.Muon__MuonLayerSegmentFinderTool(name,**kwargs)
\ No newline at end of file
+    return CfgMgr.Muon__MuonLayerSegmentFinderTool(name,**kwargs)
-- 
GitLab


From 68713f0da3a153ff0248539a74c57e26fa9695fa Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Tue, 22 Sep 2020 15:31:15 +0200
Subject: [PATCH 354/422] TrigServices: Use ROOT in athenaHLT always in batch
 mode

Always put ROOT into batch mode to avoid additional GUI threads being
created that could cause problems during forking (ATR-21890).
---
 .../TrigControl/TrigServices/python/TriggerUnixStandardSetup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
index ee0c6cad6bd2..8904eec9b96b 100644
--- a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
+++ b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
@@ -68,7 +68,7 @@ def setupCommonServices():
 
     # setup ROOT6
     from PyUtils.Helpers import ROOT6Setup
-    ROOT6Setup()
+    ROOT6Setup(batch=True)
 
     # Setup online THistSvc unless specifically configured otherwise
     #    setup the THistSvc early and force the creation of the THistSvc 
-- 
GitLab


From 8d352641f0f98fc9b85265d03f8a7b282062915d Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Tue, 22 Sep 2020 14:52:46 +0100
Subject: [PATCH 355/422] CaloExtensionAlg : Make independent of Tracking
 selection, make re-entrant, do extensions for all bar TRT-alone

---
 .../RecExCommon/share/CombinedRec_config.py   |  2 +-
 .../share/RecExRecoTest_ART_egamma_fromESD.py |  2 +-
 .../python/CaloExtensionBuilderAlgCfg.py      |  6 +--
 .../python/CaloExtensionBuilderAlgConfig.py   | 21 +-------
 .../src/CaloExtensionBuilderAlg.cxx           | 50 ++++++++++++-------
 .../TrackToCalo/src/CaloExtensionBuilderAlg.h | 31 ++----------
 6 files changed, 41 insertions(+), 71 deletions(-)

diff --git a/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py b/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py
index 3ea4098ff55b..b788aea37e9d 100755
--- a/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py
+++ b/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py
@@ -29,7 +29,7 @@ pdr.flag_domain('CaloExtensionBuilder')
 if (rec.doESD()) and (recAlgs.doEFlow() or rec.doTau() or rec.doEgamma()) : #   or rec.readESD()
     try:        
         from TrackToCalo.CaloExtensionBuilderAlgConfig import CaloExtensionBuilder
-        CaloExtensionBuilder("NoCut", 500.) #Arguments are cutLevel and minPt for track selection
+        CaloExtensionBuilder() 
     except Exception:
         treatException("Cannot include CaloExtensionBuilder !")
 
diff --git a/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_egamma_fromESD.py b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_egamma_fromESD.py
index 9562a1025f44..544e960c4fbb 100644
--- a/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_egamma_fromESD.py
+++ b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_egamma_fromESD.py
@@ -159,7 +159,7 @@ except Exception:
 include( "McParticleAlgs/TruthParticleBuilder_jobOptions.py" )
 
 from TrackToCalo.CaloExtensionBuilderAlgConfig import CaloExtensionBuilder
-CaloExtensionBuilder("NoCut", 500.) 
+CaloExtensionBuilder() 
 
 from egammaRec.egammaRecFlags import jobproperties
 
diff --git a/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgCfg.py b/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgCfg.py
index 3d02a50f0cd7..576e4c5c6ac1 100644
--- a/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgCfg.py
+++ b/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgCfg.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 from AthenaConfiguration.ComponentFactory import CompFactory
 
-def getCaloExtenstionBuilderAlgorithm(inputFlags, cutLevel = "TightPrimary", minPT = 100.0):
+def getCaloExtenstionBuilderAlgorithm(inputFlags):
     from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg    
     Trk__ParticleCaloExtensionTool = CompFactory.Trk.ParticleCaloExtensionTool
     extrapPFlowCfg = AtlasExtrapolatorCfg(inputFlags)
@@ -9,9 +9,5 @@ def getCaloExtenstionBuilderAlgorithm(inputFlags, cutLevel = "TightPrimary", min
         
     CaloExtensionBuilderAlg = CompFactory.Trk.CaloExtensionBuilderAlg 
     CaloExtensionBuilderAlg = CaloExtensionBuilderAlg(LastCaloExtentionTool = pcExtensionTool)
-
-    InDet__InDetTrackSelectionTool = CompFactory.InDet.InDetTrackSelectionTool    
-    TrackSelectionToolHC = InDet__InDetTrackSelectionTool(name = "CaloExtensionBuilderTrackSelectionTool",minPt = minPT, CutLevel = cutLevel, minNSiHits = 7) # SiHits = PixelHits + SCTHits + PixelDeadSensors + SCTDeadSensors    
-    CaloExtensionBuilderAlg.TrkSelection = TrackSelectionToolHC
      
     return CaloExtensionBuilderAlg
diff --git a/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgConfig.py b/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgConfig.py
index 1f7f5c57901e..4dfed02938ff 100644
--- a/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgConfig.py
+++ b/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgConfig.py
@@ -1,13 +1,11 @@
 ## CaloExtensionBuilderAlg Stuff
-# Defined as function such that the user can change the cut level and minPt
 
-
-def CaloExtensionBuilder( cutLevel = "TightPrimary", minPT = 100.0 ):
+def CaloExtensionBuilder():
     try: 
         from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
         from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
     except:
-        mlog.error("could not import TrackToCaloConf.Trk__ParticleCaloExtensionTool")
+        mlog.error("could not import" "TrackToCaloConf.Trk__ParticleCaloExtensionTool")
         mlog.error("could not import TrkExTools.AtlasExtrapolator")
         mlog.error (traceback.format_exc())
     try:
@@ -15,12 +13,6 @@ def CaloExtensionBuilder( cutLevel = "TightPrimary", minPT = 100.0 ):
     except:
         mlog.error("could not import TrackToCaloConf.Trk__CaloExtensionBuilderAlg")
         mlog.error (traceback.format_exc())
-    try:
-        from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool
-        from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool
-    except:
-        mlog.error("could not import InDetTrackSelectionTool.InDet__InDetTrackSelectionTool")
-        mlog.error (traceback.format_exc())
     try:
         from AthenaCommon.AppMgr import ToolSvc
     except:
@@ -43,15 +35,6 @@ def CaloExtensionBuilder( cutLevel = "TightPrimary", minPT = 100.0 ):
     CaloExtensionBuilderTool = CaloExtensionBuilderAlg(LastCaloExtentionTool = pcExtensionTool)
 
     from AthenaCommon.BeamFlags import jobproperties
-
-    TrackSelectionToolHC = InDet__InDetTrackSelectionTool(name            = "CaloExtensionBuilderTrackSelectionTool",
-                                                           minPt           = minPT,
-                                                           CutLevel        = cutLevel,
-                                                           minNSiHits      = 7) # PixelHits + SCTHits + PixelDeadSensors + SCTDeadSensors
-    
-        
-    CaloExtensionBuilderTool.TrkSelection         = TrackSelectionToolHC    
-
     ToolSvc += CaloExtensionBuilderTool.LastCaloExtentionTool
 
     topSequence += CaloExtensionBuilderTool
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.cxx b/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.cxx
index d38034896abb..b55feae8f458 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.cxx
+++ b/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.cxx
@@ -6,7 +6,8 @@
 NAME:     CaloExtensionBuilderAlg
 PACKAGE:  offline/Reconstruction/RecoTools/TrackToCalo/CaloExtensionBuilderAlg
 
-Based on: offline/Reconstruction/egamma/egammaTrackTools/EMGSFCaloExtensionBuilder
+Based on:
+offline/Reconstruction/egamma/egammaTrackTools/EMGSFCaloExtensionBuilder
 
 AUTHORS:  Anastopoulos/Capriles
 PURPOSE:  Performs Calo Extension for all selected tracks
@@ -34,45 +35,58 @@ PURPOSE:  Performs Calo Extension for all selected tracks
 StatusCode
 Trk::CaloExtensionBuilderAlg::initialize()
 {
-
-  ATH_CHECK(m_TrkSelection.retrieve());
   ATH_CHECK(m_particleCaloExtensionTool.retrieve());
-
   ATH_CHECK(m_ParticleCacheKey.initialize());
   ATH_CHECK(m_TrkPartContainerKey.initialize());
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode
-Trk::CaloExtensionBuilderAlg::CaloExtensionBuilderAlg::finalize()
-{
   return StatusCode::SUCCESS;
 }
 
 StatusCode
-Trk::CaloExtensionBuilderAlg::execute_r(const EventContext& ctx) const
+Trk::CaloExtensionBuilderAlg::execute(const EventContext& ctx) const
 {
 
-  SG::ReadHandle<xAOD::TrackParticleContainer> tracks(m_TrkPartContainerKey, ctx);
+  SG::ReadHandle<xAOD::TrackParticleContainer> tracks(m_TrkPartContainerKey,
+                                                      ctx);
   if (!tracks.isValid()) {
-    ATH_MSG_FATAL("Failed to retrieve TrackParticle container: " << m_TrkPartContainerKey.key());
+    ATH_MSG_FATAL("Failed to retrieve TrackParticle container: "
+                  << m_TrkPartContainerKey.key());
     return StatusCode::FAILURE;
   }
 
   // creating and saving the calo extension collection
-  SG::WriteHandle<CaloExtensionCollection> lastCache(m_ParticleCacheKey,ctx);
+  SG::WriteHandle<CaloExtensionCollection> lastCache(m_ParticleCacheKey, ctx);
   ATH_CHECK(lastCache.record(std::make_unique<CaloExtensionCollection>()));
 
   const xAOD::TrackParticleContainer* ptrTracks = tracks.cptr();
   CaloExtensionCollection* ptrPart = lastCache.ptr();
   std::vector<bool> mask(ptrTracks->size(), false);
   for (auto track : *tracks) {
-    if (static_cast<bool>(m_TrkSelection->accept(*track, nullptr)))
-      mask[track->index()] = true;
+    if (track->pt() < 500) {
+      continue;
+    }
+    uint8_t dummy(0);
+    uint8_t nSiHits(0);
+    if (track->summaryValue(dummy, xAOD::numberOfPixelHits)) {
+      nSiHits += dummy;
+    }
+    if (track->summaryValue(dummy, xAOD::numberOfPixelDeadSensors)) {
+      nSiHits += dummy;
+    }
+    if (track->summaryValue(dummy, xAOD::numberOfSCTHits)) {
+      nSiHits += dummy;
+    }
+    if (track->summaryValue(dummy, xAOD::numberOfSCTDeadSensors)) {
+      nSiHits += dummy;
+    }
+    // Cut out TRT alone, but do it for all else
+    if (nSiHits < 4) {
+      continue;
+    }
+    mask[track->index()] = true;
   }
 
-  ATH_CHECK(m_particleCaloExtensionTool->caloExtensionCollection(ctx, *ptrTracks, mask, *ptrPart));
+  ATH_CHECK(m_particleCaloExtensionTool->caloExtensionCollection(
+    ctx, *ptrTracks, mask, *ptrPart));
 
   return StatusCode::SUCCESS;
 }
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.h b/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.h
index 3c79ad3fbc28..12288abb1163 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.h
+++ b/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.h
@@ -11,20 +11,14 @@
   Track Particles
   */
 
-#include "AthenaBaseComps/AthAlgorithm.h"
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "StoreGate/ReadHandleKey.h"
 #include "StoreGate/WriteHandleKey.h"
 
 #include "RecoToolInterfaces/IParticleCaloExtensionTool.h"
 #include "TrkCaloExtension/CaloExtensionCollection.h"
-
-#include "ITrackToVertex/ITrackToVertex.h"
-#include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h"
-#include "TrkToolInterfaces/ITrackSelectorTool.h"
-
 #include "xAODTracking/TrackParticleContainer.h"
-#include "xAODTracking/VertexContainer.h"
 
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 #include "TRT_ReadoutGeometry/TRT_DetElementContainer.h"
@@ -57,20 +51,12 @@ to be done: `uniqueExtension = theTrackExtrapolatorTool->caloExtension(*track);`
 theTrackExtrapolatorTool->caloExtension(*track).get();` as it has unpredictable
 behavior.
 */
-class CaloExtensionBuilderAlg : public AthAlgorithm
+class CaloExtensionBuilderAlg : public AthReentrantAlgorithm
 {
 public:
-  using AthAlgorithm::AthAlgorithm;
-
+  using AthReentrantAlgorithm::AthReentrantAlgorithm;
   virtual StatusCode initialize() override final;
-  virtual StatusCode finalize() override final;
-  virtual StatusCode execute() override final
-  {
-    return execute_r(Algorithm::getContext());
-  }
-  // This will become the normal execute when
-  // inheriting from AthReentrantAlgorithm
-  StatusCode execute_r(const EventContext& ctx) const;
+  virtual StatusCode execute(const EventContext& ctx) const override final;
 
 private:
   /** @brief the Calo Extension tool*/
@@ -80,15 +66,6 @@ private:
     "Trk::CaloExtensionBuilderTool"
   };
 
-  /// Manages the track selection. It should be able to handle both pflow and
-  /// tau selections
-  ToolHandle<InDet::IInDetTrackSelectionTool> m_TrkSelection{
-    this,
-    "TrkSelection",
-    "TrkSelectionCaloExtensionBuilder",
-    "Tool that handles the track selection"
-  };
-
   /// output particle calo extension collection
   SG::WriteHandleKey<CaloExtensionCollection> m_ParticleCacheKey{
     this,
-- 
GitLab


From e13a14751d89de88d633289cf3bb382af22791ed Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Tue, 22 Sep 2020 13:56:15 +0000
Subject: [PATCH 356/422] MagFieldElements: Fix compilation with clang 10.

Need <cstdlib> for size_t.
---
 .../python/ComponentAccumulator.py            |  66 +-
 .../python/BadLBFilterToolConfig.py           |   2 +-
 Control/AthenaMonitoring/python/DQMonFlags.py |   9 +-
 .../python/TriggerInterface.py                |  10 +-
 .../share/DQMonFlagsConfig_jobOptions.py      | 110 +--
 .../share/DataQualityInit_jobOptions.py       |   2 +-
 .../share/DataQualitySteering_jobOptions.py   | 690 +++++++++---------
 .../share/TrigDecTool_jobOptions.py           |  29 +-
 Database/IOVDbSvc/python/CondDB.py            |   2 +-
 .../python/PixelConditionsConfig.py           | 265 +++----
 .../python/PixelMonitoringConfig.py           |   5 +-
 .../SCT_Monitoring/python/SCTTracksMonAlg.py  |   2 +-
 .../python/TrackSummaryToolWorkaround.py      |  16 +-
 .../python/TRTMonitoringRun3RAW_Alg.py        |  26 +-
 .../python/LArBadChannelConfig.py             |  49 +-
 .../python/LArBadFebsConfig.py                |  52 +-
 .../LArCalibUtils/python/LArHVScaleConfig.py  |   2 +-
 .../LArMonitoring/python/LArFEBMonAlg.py      |  21 +-
 .../python/MuonTrackMonitorAlgorithm.py       |   2 +-
 .../python/JetTagMonitorAlgorithm.py          |  11 +-
 .../python/JetMonitoringStandard.py           |  12 +-
 .../python/METMonitorAlgorithm.py             |  12 +-
 .../share/RecExCommon_topOptions.py           |  30 +-
 .../python/TauMonitoringConfig.py             |   6 +-
 .../python/TileInfoConfigurator.py            |   6 +-
 .../share/TileConditions_jobOptions.py        |   7 +-
 .../python/TrigCaloDataAccessConfig.py        |   6 +-
 27 files changed, 768 insertions(+), 682 deletions(-)

diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py
index d5c540af4306..45d34b1a1048 100644
--- a/Control/AthenaConfiguration/python/ComponentAccumulator.py
+++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py
@@ -829,6 +829,8 @@ def __indent( indent = ""):
 def __setProperties( destConfigurableInstance, sourceConf2Instance, indent="" ):
     _log = logging.getLogger( "__setProperties".ljust(30) )
     for pname, pvalue in six.iteritems( sourceConf2Instance._properties ):
+        if destConfigurableInstance.__class__.__name__ == 'AlgSequence' and pname == 'Members':
+            continue
         propType = sourceConf2Instance._descriptors[pname].cpp_type
         if "PrivateToolHandleArray" in propType:
             setattr( destConfigurableInstance, pname, [conf2toConfigurable( tool, __indent( indent ) ) for tool in pvalue] )
@@ -854,7 +856,7 @@ def __setProperties( destConfigurableInstance, sourceConf2Instance, indent="" ):
                 pass
             setattr( destConfigurableInstance, pname, pvalue )
 
-def conf2toConfigurable( comp, indent="" ):
+def conf2toConfigurable( comp, indent="", suppressDupes=False ):
     """
     Method converts from Conf2 ( comp argument ) to old Configurable
     If the Configurable of the same name exists, the properties merging process is invoked
@@ -929,9 +931,11 @@ def conf2toConfigurable( comp, indent="" ):
             return listOrDictHelper
 
     def __areSettingsSame( existingConfigurableInstance, newConf2Instance, indent="" ):
-        _log.debug( "{}Checking if setting is the same {}".format( indent, existingConfigurableInstance.getFullName() ) )
+        _log.debug( "{}Checking if setting is the same {} {}".format( indent, existingConfigurableInstance.getFullName(), newConf2Instance.getFullJobOptName() ) )
         alreadySetProperties = dict([ (pname, pvalue) for pname,pvalue
                                       in six.iteritems(existingConfigurableInstance.getValuedProperties()) ])
+        _log.debug("Existing properties: {}".format(alreadySetProperties))
+        _log.debug("New properties: {}".format(newConf2Instance._properties))
         for pname, pvalue in six.iteritems( newConf2Instance._properties ): # six.iteritems(comp._properties):
             if __isOldConfigurable( pvalue ):
                 _log.warning( "{}New configuration object {} property {} has legacy configuration components assigned to it {}"
@@ -939,10 +943,31 @@ def conf2toConfigurable( comp, indent="" ):
                 _log.warning( "Skipping comparison, no guarantees about configuration consistency" )
                 continue
             propType = newConf2Instance._descriptors[pname].cpp_type
-            _log.debug("{}Comparing type: {}".format(indent, propType))
+            _log.debug("{}Comparing type: {} for: {}".format(indent, propType, pname))
             if  "PrivateToolHandleArray" in  propType:
-                for oldC, newC in zip( alreadySetProperties[pname], pvalue):
-                    __areSettingsSame( oldC, newC, __indent(indent))
+                toolDict = {_.getName(): _ for _ in alreadySetProperties[pname]}
+                _log.debug('Private tool properties? {}'.format(toolDict))
+                newCdict = {_.getName() : _ for _ in pvalue}
+                oldCset = set(toolDict); newCset = set(newCdict)
+                _log.debug('Private tool property names? {} {}'.format(oldCset, newCset))
+                for oldC in oldCset & newCset:
+                    __areSettingsSame( toolDict[oldC], newCdict[oldC], __indent(indent))
+                for newC in newCset-oldCset:
+                    # clone new config to old array
+                    alreadySetProperties[pname].append(conf2toConfigurable(newCdict[newC]))
+            elif "PublicToolHandleArray" in propType:
+                toolSet = {_.getName() for _ in alreadySetProperties[pname]}
+                _log.debug('Public tool handle array properties? {} {}'.format(toolSet, pvalue))
+                # strings?
+                for newC in pvalue:
+                    if isinstance(newC, six.string_types):
+                        pubtoolclass, pubtoolname = newC.split('/')
+                        if pubtoolname not in toolSet:
+                            klass = __findConfigurableClass( pubtoolclass )
+                            alreadySetProperties[pname].append(klass( pubtoolname ))
+                    else:
+                        _log.warning('Not handling actual Configurable2s for public tool merging yet')
+                        raise Exception()           
             elif "PrivateToolHandle" in propType or "GaudiConfig2.Configurables" in propType or "ServiceHandle" in propType:
                 existingVal = getattr(existingConfigurableInstance, pname)
                 if isinstance( pvalue, str ):
@@ -951,10 +976,13 @@ def conf2toConfigurable( comp, indent="" ):
                     _log.debug( "{}Some kind of handle  and, object type {} existing {}".format( indent, type(pvalue), type(existingVal) ) )
                     __areSettingsSame( existingVal, pvalue, indent)
             else:
-                pvalue=__listHelperToList(pvalue)
+                if isinstance(pvalue,(GaudiConfig2.semantics._ListHelper,GaudiConfig2.semantics._DictHelper)):
+                    pvalue=pvalue.data
+
                 if pname not in alreadySetProperties:
-                    continue
-                if alreadySetProperties[pname] != pvalue:
+                    _log.info("{}Adding property: {} for {}".format(indent, pname, newConf2Instance.getName() ))
+                    setattr(existingConfigurableInstance, pname, pvalue)
+                elif alreadySetProperties[pname] != pvalue:
                     _log.info("{}Merging property: {} for {}".format(indent, pname, newConf2Instance.getName() ))
                     # create surrogate
                     clone = newConf2Instance.getInstance("Clone")
@@ -971,7 +999,7 @@ def conf2toConfigurable( comp, indent="" ):
         _log.debug( "{}Pre-existing configurable {} was found, checking if has the same properties".format( indent, comp.getName() ) )
         __areSettingsSame( existingConfigurable, comp )
         _log.debug( "{}Pre-existing configurable was found to have the same properties".format( indent, comp.name ) )
-        instance = existingConfigurable
+        instance = existingConfigurable if not suppressDupes else None
     else: # create new configurable
         _log.debug( "{}Creating component configurable {}".format( indent, comp.getFullJobOptName() ) )
         configurableClass = __findConfigurableClass( comp.getFullJobOptName().split( "/" )[0] )
@@ -1004,6 +1032,13 @@ def appendCAtoAthena(ca):
 
 
     from AthenaCommon.AppMgr import ServiceMgr,ToolSvc,theApp,athCondSeq,athOutSeq,athAlgSeq,topSequence
+    if len( ca.getPublicTools() ) != 0:
+        _log.info( "Merging public tools" )
+        for comp in ca.getPublicTools():
+            instance = conf2toConfigurable( comp, indent="  " )
+            if instance not in ToolSvc:
+                ToolSvc += instance
+
     if len(ca.getServices()) != 0:
         _log.info( "Merging services" )
         for comp in ca.getServices():
@@ -1018,13 +1053,6 @@ def appendCAtoAthena(ca):
             if instance not in athCondSeq:
                 athCondSeq += instance
 
-    if len( ca.getPublicTools() ) != 0:
-        _log.info( "Merging public tools" )
-        for comp in ca.getPublicTools():
-            instance = conf2toConfigurable( comp, indent="  " )
-            if instance not in ToolSvc:
-                ToolSvc += instance
-
     if len( ca.getAppProps() ) != 0:
         _log.info( "Merging ApplicationMgr properties" )
         for (propName, propValue) in six.iteritems(ca.getAppProps()):
@@ -1066,8 +1094,10 @@ def appendCAtoAthena(ca):
             if el.__class__.__name__ == "AthSequencer":
                 __mergeSequences( sequence, el, __indent( indent ) )
             elif el.getGaudiType() == "Algorithm":
-                sequence += conf2toConfigurable( el, indent=__indent( indent ) )
-                _log.info( "{}Algorithm {} and added to the sequence {}".format( __indent( indent ),  el.getFullJobOptName(), sequence.name() ) )
+                toadd = conf2toConfigurable( el, indent=__indent( indent ), suppressDupes=True)
+                if toadd is not None:
+                    sequence += toadd
+                    _log.info( "{}Algorithm {} and added to the sequence {}".format( __indent( indent ),  el.getFullJobOptName(), sequence.name() ) )
 
 
     preconfigured = [athCondSeq,athOutSeq,athAlgSeq,topSequence]
diff --git a/Control/AthenaMonitoring/python/BadLBFilterToolConfig.py b/Control/AthenaMonitoring/python/BadLBFilterToolConfig.py
index 86384e7caebc..62b3f0ac2524 100644
--- a/Control/AthenaMonitoring/python/BadLBFilterToolConfig.py
+++ b/Control/AthenaMonitoring/python/BadLBFilterToolConfig.py
@@ -66,7 +66,7 @@ def BadLBFilterToolCfg(inputFlags,name, defects, alwaysReturnTrue=False, ignoreR
 
     sgkey = 'DQBadLBFilterAlgResult_%s' % name
     #Schedule required cond-algo
-    result.merge(BadLBFilterAlgCfg(inputFlags,name,defects,sgkey,ignoreRecoverable, origDbTag))
+    result.merge(BadLBFilterAlgCfg(inputFlags,name+'_Alg',defects,sgkey,ignoreRecoverable, origDbTag))
 
     monFilterTool=CompFactory.DQBadLBFilterTool(name,alwaysReturnTrue=alwaysReturnTrue,
                                                 ReadKey= sgkey)
diff --git a/Control/AthenaMonitoring/python/DQMonFlags.py b/Control/AthenaMonitoring/python/DQMonFlags.py
index e624702ee23d..8b733d2b926f 100644
--- a/Control/AthenaMonitoring/python/DQMonFlags.py
+++ b/Control/AthenaMonitoring/python/DQMonFlags.py
@@ -227,7 +227,7 @@ class doAFPMon(JobProperty):
     """Switch for AFP monitoring"""
     statusOn=True
     allowedTypes=['bool']
-    StoredValue=False
+    StoredValue=True
 list+=[doAFPMon]
 
 class doHIMon(JobProperty):
@@ -414,6 +414,13 @@ class specialCleaningConfiguration(JobProperty):
     StoredValue={}
 list+=[specialCleaningConfiguration]
 
+class doNewMonitoring(JobProperty):
+    """ Global switch for monitoring """
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=False
+list+=[doNewMonitoring]
+
 ##-----------------------------------------------------------------------------
 ## 2nd step
 ## Definition of the DQMon flag container
diff --git a/Control/AthenaMonitoring/python/TriggerInterface.py b/Control/AthenaMonitoring/python/TriggerInterface.py
index 83848acfbb52..fd3f07f7602a 100644
--- a/Control/AthenaMonitoring/python/TriggerInterface.py
+++ b/Control/AthenaMonitoring/python/TriggerInterface.py
@@ -18,8 +18,7 @@ def getTrigDecisionTool(flags):
     rv = ComponentAccumulator()
 
     if flags.DQ.isReallyOldStyle:
-        from AthenaCommon.AppMgr import ToolSvc
-        rv.addPublicTool(ToolSvc.TrigDecisionTool)
+        rv.addPublicTool(CompFactory.Trig.TrigDecisionTool('TrigDecisionTool'))
         getTrigDecisionTool.rv = rv
         return getTrigDecisionTool.rv
 
@@ -29,7 +28,12 @@ def getTrigDecisionTool(flags):
     tdt = CompFactory.Trig.TrigDecisionTool('TrigDecisionTool')
     tdt.TrigConfigSvc = cfgsvc
 
-    tdt.NavigationFormat = "TrigComposite" if 'HLTNav_Summary' in flags.Input.Collections else "TriggerElement"
+    if not flags.Input.isMC and flags.Input.Format == 'BS' and min(flags.Input.RunNumber) <= 380000:
+        # need to work through exact details here
+        # tdt.UseOldEventInfoDecisionFormat = True
+        tdt.NavigationFormat = "TrigComposite"
+    else:
+        tdt.NavigationFormat = "TrigComposite" if 'HLTNav_Summary' in flags.Input.Collections else "TriggerElement"
     rv.addPublicTool(tdt)
     # Other valid option of NavigationFormat is "TriggerElement" for Run 2 navigation. 
     # This option to be removed and "TrigComposite" the only valid choice once a R2->R3 converter is put in place. 
diff --git a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
index 38ef6113f109..dfb1421e9168 100644
--- a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
@@ -17,12 +17,6 @@ if not 'rec' in dir():
 
 from RecExConfig.RecAlgsFlags import recAlgs
 
-if rec.doTrigger() == False:
-   DQMonFlags.useTrigger=False     # steers trigger-awareness
-   DQMonFlags.doLVL1CaloMon=False
-   DQMonFlags.doCTPMon=False
-   DQMonFlags.doHLTMon=False
-
 # Set the data type based on beamType/HI flag
 if globalflags.DataSource.get_Value() == 'geant4':
    DQMonFlags.monManDataType = 'monteCarlo'
@@ -71,6 +65,13 @@ elif DQMonFlags.monType=='BSall':
 else:
    local_logger.warning("invalid DQMonFlags.monType: %s, using default monManEnvironment", DQMonFlags.monType())
 
+# the meaning of this flag has changed in MT
+if rec.doTrigger() == False and not (TriggerFlags.doMT() and DQMonFlags.monManEnvironment=='tier0ESD'):
+   DQMonFlags.useTrigger=False     # steers trigger-awareness
+   DQMonFlags.doLVL1CaloMon=False
+   DQMonFlags.doCTPMon=False
+   DQMonFlags.doHLTMon=False
+
 if not DQMonFlags.doMonitoring():
    local_logger.info("monitoring globally switched off")
    DQMonFlags.doGlobalMon=False
@@ -104,53 +105,54 @@ if not DQMonFlags.doMonitoring():
 else:
    local_logger.info("monitoring environment set to %s", DQMonFlags.monManEnvironment())
 
-   # AOD monitoring
-   if DQMonFlags.monManEnvironment == 'AOD':
-      DQMonFlags.histogramFile='MonitorAOD.root'
-      DQMonFlags.doCaloMon=False
-      DQMonFlags.doLArMon=False
-      DQMonFlags.doTileMon=False
-#      DQMonFlags.doJetMon=False
-      # ??
-      DQMonFlags.doCTPMon=False
-      DQMonFlags.doPixelMon=False
-      DQMonFlags.doSCTMon=False
-      DQMonFlags.doTRTMon=False
-      DQMonFlags.doTRTElectronMon=False
-      DQMonFlags.doInDetGlobalMon=False
-      DQMonFlags.doInDetAlignMon=False
+   # new-style monitoring drives this internally so skip this section
+   if not DQMonFlags.doNewMonitoring:
 
-      DQMonFlags.doGlobalMon=False
-      DQMonFlags.doLVL1CaloMon=False
-      DQMonFlags.doHLTMon=False
-      DQMonFlags.doEgammaMon=False
-      DQMonFlags.doMuonRawMon=False
-      DQMonFlags.doLucidMon=False
+      # AOD monitoring
+      if DQMonFlags.monManEnvironment == 'AOD':
+         DQMonFlags.histogramFile='MonitorAOD.root'
+         DQMonFlags.doCaloMon=False
+         DQMonFlags.doLArMon=False
+         DQMonFlags.doTileMon=False
+         DQMonFlags.doCTPMon=False
+         DQMonFlags.doPixelMon=False
+         DQMonFlags.doSCTMon=False
+         DQMonFlags.doTRTMon=False
+         DQMonFlags.doTRTElectronMon=False
+         DQMonFlags.doInDetGlobalMon=False
+         DQMonFlags.doInDetAlignMon=False
 
-   # ESD monitoring: switch off DQ monitoring packages which are not yet migrated:
-   elif DQMonFlags.monManEnvironment == 'tier0ESD':
-      DQMonFlags.histogramFile='MonitorESD.root'
-      DQMonFlags.doCTPMon=False
-      DQMonFlags.doPixelMon=False
-      DQMonFlags.doSCTMon=False
-      DQMonFlags.doTRTMon=False
-      DQMonFlags.doTRTElectronMon=False
-      DQMonFlags.doInDetGlobalMon=False
-      DQMonFlags.doInDetAlignMon=False
-   # ESD monitoring: packages which use only ESD: disable when running over BS
-   elif DQMonFlags.monManEnvironment == 'tier0Raw':
-      DQMonFlags.doInDetPerfMon=False
-      DQMonFlags.doMissingEtMon=False
-      DQMonFlags.doTauMon=False
-      DQMonFlags.doMuonTrackMon=False
-      DQMonFlags.doMuonAlignMon=False
-      DQMonFlags.doMuonPhysicsMon=False
-      DQMonFlags.doMuonSegmentMon=False
-      DQMonFlags.doMuonTrkPhysMon=False
-      DQMonFlags.doMuonCombinedMon=False
-      DQMonFlags.doLucidMon=False
-      DQMonFlags.doJetTagMon=False
-      DQMonFlags.doJetMon=False
+         DQMonFlags.doGlobalMon=False
+         DQMonFlags.doLVL1CaloMon=False
+         DQMonFlags.doHLTMon=False
+         DQMonFlags.doEgammaMon=False
+         DQMonFlags.doMuonRawMon=False
+         DQMonFlags.doLucidMon=False
+
+      # ESD monitoring: switch off DQ monitoring packages which are not yet migrated:
+      elif DQMonFlags.monManEnvironment == 'tier0ESD':
+         DQMonFlags.histogramFile='MonitorESD.root'
+         DQMonFlags.doCTPMon=False
+         DQMonFlags.doPixelMon=False
+         DQMonFlags.doSCTMon=False
+         DQMonFlags.doTRTMon=False
+         DQMonFlags.doTRTElectronMon=False
+         DQMonFlags.doInDetGlobalMon=False
+         DQMonFlags.doInDetAlignMon=False
+      # ESD monitoring: packages which use only ESD: disable when running over BS
+      elif DQMonFlags.monManEnvironment == 'tier0Raw':
+         DQMonFlags.doInDetPerfMon=False
+         DQMonFlags.doMissingEtMon=False
+         DQMonFlags.doTauMon=False
+         DQMonFlags.doMuonTrackMon=False
+         DQMonFlags.doMuonAlignMon=False
+         DQMonFlags.doMuonPhysicsMon=False
+         DQMonFlags.doMuonSegmentMon=False
+         DQMonFlags.doMuonTrkPhysMon=False
+         DQMonFlags.doMuonCombinedMon=False
+         DQMonFlags.doLucidMon=False
+         DQMonFlags.doJetTagMon=False
+         DQMonFlags.doJetMon=False
       
    # switch off monitoring if reco is off during BS reading
    if rec.readRDO() and not 'DetFlags' in dir():
@@ -246,9 +248,9 @@ if (not rec.doJetMissingETTag() or (rec.readRDO() and not jobproperties.JetRecFl
 if (not rec.doTau()):
    DQMonFlags.doTauMon=False
 
-# covered now by doJetMissingETTag
-# if (not recAlgs.doMissingET()):
-#    DQMonFlags.doMissingEtMon=False
+if not rec.doAFP() or DQMonFlags.monManDataType == 'monteCarlo':
+   DQMonFlags.doAFPMon=False
+
 
 #
 # Stream Aware Monitoring
diff --git a/Control/AthenaMonitoring/share/DataQualityInit_jobOptions.py b/Control/AthenaMonitoring/share/DataQualityInit_jobOptions.py
index 2ba251977e06..83bcd2cbffa8 100644
--- a/Control/AthenaMonitoring/share/DataQualityInit_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DataQualityInit_jobOptions.py
@@ -11,7 +11,7 @@ try:
 except Exception:
    treatException("Could not load AthenaMonitoring/DQMonFlagsConfig_jobOptions.py")
 
-if DQMonFlags.doMonitoring(): 
+if DQMonFlags.doMonitoring() and not DQMonFlags.doNewMonitoring():
    if DQMonFlags.useTrigger():
       # trigger decision tool
       try:
diff --git a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
index e26b89599447..fababdb80e0a 100644
--- a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
@@ -13,331 +13,371 @@ TRTELEMON=False
 local_logger = logging.getLogger('DataQualitySteering_jobOptions')
 
 if DQMonFlags.doMonitoring():
-   if DQMonFlags.useTrigger():
-      if not hasattr(ToolSvc, DQMonFlags.nameTrigDecTool()):
-         local_logger.debug("trigger decision tool not found, including it now")
-         include("AthenaMonitoring/TrigDecTool_jobOptions.py")
-
-
-   # don't set up lumi access if in MC or enableLumiAccess == False
-   if globalflags.DataSource.get_Value() != 'geant4' and DQMonFlags.enableLumiAccess():
-      if athenaCommonFlags.isOnline:
-         local_logger.debug("luminosity tool not found, importing online version")
-         from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgOnlineDefault
-         LuminosityCondAlgOnlineDefault()
-      else:
-         local_logger.debug("luminosity tool not found, importing offline version")
-         from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgDefault 
-         LuminosityCondAlgDefault()
-
-      from LumiBlockComps.LBDurationCondAlgDefault import LBDurationCondAlgDefault 
-      LBDurationCondAlgDefault()
-
-      from LumiBlockComps.TrigLiveFractionCondAlgDefault import TrigLiveFractionCondAlgDefault 
-      TrigLiveFractionCondAlgDefault()
-
-   from AthenaMonitoring.AtlasReadyFilterTool import GetAtlasReadyFilterTool
-   from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool
-
-   #---------------------------#
-   # Inner detector monitoring #
-   #---------------------------#
-   if DQMonFlags.doPixelMon() or DQMonFlags.doSCTMon() or DQMonFlags.doTRTMon() or \
-         DQMonFlags.doInDetGlobalMon() or DQMonFlags.doInDetAlignMon():
-      try:
-         include("InDetRecExample/InDetMonitoring.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up inner detector monitoring")
-
-   #----------------------------#
-   # Global combined monitoring #
-   #----------------------------#
-   if DQMonFlags.doGlobalMon():
-      try:
-         include("DataQualityTools/DataQualityMon_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up global monitoring")
-   
-   #--------------------#
-   # Trigger monitoring #
-   #--------------------#
-   if DQMonFlags.doLVL1CaloMon():
-      try:
-         include("TrigT1CaloMonitoring/TrigT1CaloMonitoring_forRecExCommission.py")
-         include("TrigT1Monitoring/TrigT1Monitoring_forRecExCommission.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up L1 Calo monitoring")
-
-   if DQMonFlags.doCTPMon():
-      try:
-         include("TrigT1CTMonitoring/TrigT1CTMonitoringJobOptions_forRecExCommission.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up central trigger monitoring")
-
-   if DQMonFlags.doHLTMon():
-      try:
-         include("TrigHLTMonitoring/HLTMonitoring_topOptions.py")
-         HLTMonMan = topSequence.HLTMonManager
-         HLTMonMan.FileKey = DQMonFlags.monManFileKey()  
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up HLT monitoring")
-
-   #--------------#
-   # TRT electron #
-   #--------------#
-   if DQMonFlags.doTRTElectronMon() and TRTELEMON:
-      try:
-         include("InDetPerformanceMonitoring/TRT_Monitoring_RecExCommonAddOn_jobOptions.py") 
-         TRTElMonMan = topSequence.TRTElectronMonManager
-         TRTElMonMan.FileKey     = DQMonFlags.monManFileKey()
-         TRTElMonMan.Environment = DQMonFlags.monManEnvironment()
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up TRT electron monitoring")
-
-   #----------------#
-   # ID performance #
-   #----------------#
-   if DQMonFlags.doInDetPerfMon():
-      try:
-         include("InDetPerformanceMonitoring/IDPerfMon_jobOptions.py")
-         IDPerfMonManager = topSequence.IDPerfMonManager
-         IDPerfMonManager.FileKey          = DQMonFlags.monManFileKey()
-         IDPerfMonManager.Environment      = DQMonFlags.monManEnvironment()
-         include("InDetDiMuonMonitoring/InDetDiMuMon_jobOptions.py")
-         InDetDiMuMonManager = topSequence.InDetDiMuMonManager
-         InDetDiMuMonManager.FileKey          = DQMonFlags.monManFileKey()
-         InDetDiMuMonManager.Environment      = DQMonFlags.monManEnvironment()
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up InDetPerformance/InDetDiMuon monitoring")
-
-   #--------------------#
-   # TileCal monitoring #
-   #--------------------#
-   if DQMonFlags.doTileMon():
-      try:
-      	 include("TileMonitoring/TileMon_jobOptions.py")
+   if not DQMonFlags.doNewMonitoring():
+      if DQMonFlags.useTrigger():
+         if not hasattr(ToolSvc, DQMonFlags.nameTrigDecTool()):
+            local_logger.debug("trigger decision tool not found, including it now")
+            include("AthenaMonitoring/TrigDecTool_jobOptions.py")
+
+
+      # don't set up lumi access if in MC or enableLumiAccess == False
+      if globalflags.DataSource.get_Value() != 'geant4' and DQMonFlags.enableLumiAccess():
+         if athenaCommonFlags.isOnline:
+            local_logger.debug("luminosity tool not found, importing online version")
+            from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgOnlineDefault
+            LuminosityCondAlgOnlineDefault()
+         else:
+            local_logger.debug("luminosity tool not found, importing offline version")
+            from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgDefault 
+            LuminosityCondAlgDefault()
+
+         from LumiBlockComps.LBDurationCondAlgDefault import LBDurationCondAlgDefault 
+         LBDurationCondAlgDefault()
+
+         from LumiBlockComps.TrigLiveFractionCondAlgDefault import TrigLiveFractionCondAlgDefault 
+         TrigLiveFractionCondAlgDefault()
+
+      from AthenaMonitoring.AtlasReadyFilterTool import GetAtlasReadyFilterTool
+      from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool
+
+      #---------------------------#
+      # Inner detector monitoring #
+      #---------------------------#
+      if DQMonFlags.doPixelMon() or DQMonFlags.doSCTMon() or DQMonFlags.doTRTMon() or \
+            DQMonFlags.doInDetGlobalMon() or DQMonFlags.doInDetAlignMon():
+         try:
+            include("InDetRecExample/InDetMonitoring.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up inner detector monitoring")
+
+      #----------------------------#
+      # Global combined monitoring #
+      #----------------------------#
+      if DQMonFlags.doGlobalMon():
+         try:
+            include("DataQualityTools/DataQualityMon_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up global monitoring")
+      
+      #--------------------#
+      # Trigger monitoring #
+      #--------------------#
+      if DQMonFlags.doLVL1CaloMon():
+         try:
+            include("TrigT1CaloMonitoring/TrigT1CaloMonitoring_forRecExCommission.py")
+            include("TrigT1Monitoring/TrigT1Monitoring_forRecExCommission.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up L1 Calo monitoring")
+
+      if DQMonFlags.doCTPMon():
+         try:
+            include("TrigT1CTMonitoring/TrigT1CTMonitoringJobOptions_forRecExCommission.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up central trigger monitoring")
+
+      if DQMonFlags.doHLTMon():
+         try:
+            include("TrigHLTMonitoring/HLTMonitoring_topOptions.py")
+            HLTMonMan = topSequence.HLTMonManager
+            HLTMonMan.FileKey = DQMonFlags.monManFileKey()  
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up HLT monitoring")
+
+      #--------------#
+      # TRT electron #
+      #--------------#
+      if DQMonFlags.doTRTElectronMon() and TRTELEMON:
+         try:
+            include("InDetPerformanceMonitoring/TRT_Monitoring_RecExCommonAddOn_jobOptions.py") 
+            TRTElMonMan = topSequence.TRTElectronMonManager
+            TRTElMonMan.FileKey     = DQMonFlags.monManFileKey()
+            TRTElMonMan.Environment = DQMonFlags.monManEnvironment()
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up TRT electron monitoring")
+
+      #----------------#
+      # ID performance #
+      #----------------#
+      if DQMonFlags.doInDetPerfMon():
+         try:
+            include("InDetPerformanceMonitoring/IDPerfMon_jobOptions.py")
+            IDPerfMonManager = topSequence.IDPerfMonManager
+            IDPerfMonManager.FileKey          = DQMonFlags.monManFileKey()
+            IDPerfMonManager.Environment      = DQMonFlags.monManEnvironment()
+            include("InDetDiMuonMonitoring/InDetDiMuMon_jobOptions.py")
+            InDetDiMuMonManager = topSequence.InDetDiMuMonManager
+            InDetDiMuMonManager.FileKey          = DQMonFlags.monManFileKey()
+            InDetDiMuMonManager.Environment      = DQMonFlags.monManEnvironment()
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up InDetPerformance/InDetDiMuon monitoring")
+
+      #--------------------#
+      # TileCal monitoring #
+      #--------------------#
+      if DQMonFlags.doTileMon():
+         try:
+            include("TileMonitoring/TileMon_jobOptions.py")
+      
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Tile monitoring")
+
+      #------------------#
+      # LAr monitoring   #
+      #------------------#
+      if DQMonFlags.doLArMon():
+         try:
+            LArMon = AthenaMonManager(name="LArMonManager",
+                           FileKey             = DQMonFlags.monManFileKey(),
+                           Environment         = DQMonFlags.monManEnvironment(),
+                           ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(),
+                           DataType            = DQMonFlags.monManDataType())
+            topSequence += LArMon
+            include("LArMonTools/LArAllMonitoring_jobOptions.py")
+            include("LArMonitoring/LArMonitoring_jobOption.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up LAr monitoring")
+
+      #-------------------------------------------------------------------------#
+      # Calo monitoring - cells and clusters independent of LAr or Tile origin  #
+      #-------------------------------------------------------------------------#
+      if DQMonFlags.doCaloMon():
+         try:
+            include("CaloMonitoring/CaloAllMonitoring_jobOptions.py")
+            include("CaloMonitoring/CaloNewMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Calo monitoring")
+
+      #-------------------#
+      # Egamma monitoring #
+      #-------------------#
+      if DQMonFlags.doEgammaMon():
+         try:
+            include("egammaPerformance/egammaMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Egamma monitoring")
+
+      #----------------#
+      # MET monitoring #
+      #----------------#
+      if DQMonFlags.doMissingEtMon():
+         try:
+            include("MissingETMonitoring/MissingET_Monitoring.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up ETmiss monitoring")
+
+      #----------------#
+      # Jet monitoring #
+      #----------------#
+      if DQMonFlags.doJetMon():
+         try:
+            include("JetMonitoring/JetMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Jet monitoring")
+
+      #----------------#
+      # Tau monitoring #
+      #----------------#
+      if DQMonFlags.doTauMon():
+         try:
+            include("tauMonitoring/tauMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Tau monitoring")
+
+      #--------------------#
+      # Jet tag monitoring #
+      #--------------------#
+      if DQMonFlags.doJetTagMon():
+         try:
+            include("JetTagMonitoring/JetTagMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up jet-tag monitoring")
+
+      #-----------------------------#
+      # MuonSpectrometer monitoring #
+      #-----------------------------#
+      if (DQMonFlags.doMuonRawMon() or DQMonFlags.doMuonSegmentMon()
+         or DQMonFlags.doMuonTrackMon() or DQMonFlags.doMuonAlignMon()
+         or DQMonFlags.doMuonTrkPhysMon() or DQMonFlags.doMuonPhysicsMon()):
+         try:
+            include("MuonDQAMonitoring/MuonDetMonitoring.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Muon detector monitoring")
    
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up Tile monitoring")
-
-   #------------------#
-   # LAr monitoring   #
-   #------------------#
-   if DQMonFlags.doLArMon():
-      try:
-         LArMon = AthenaMonManager(name="LArMonManager",
-                          FileKey             = DQMonFlags.monManFileKey(),
-                          Environment         = DQMonFlags.monManEnvironment(),
-                          ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(),
-                          DataType            = DQMonFlags.monManDataType())
-         topSequence += LArMon
-         include("LArMonTools/LArAllMonitoring_jobOptions.py")
-         include("LArMonitoring/LArMonitoring_jobOption.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up LAr monitoring")
-
-   #-------------------------------------------------------------------------#
-   # Calo monitoring - cells and clusters independent of LAr or Tile origin  #
-   #-------------------------------------------------------------------------#
-   if DQMonFlags.doCaloMon():
-      try:
-         include("CaloMonitoring/CaloAllMonitoring_jobOptions.py")
-         include("CaloMonitoring/CaloNewMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up Calo monitoring")
-
-   #-------------------#
-   # Egamma monitoring #
-   #-------------------#
-   if DQMonFlags.doEgammaMon():
-      try:
-         include("egammaPerformance/egammaMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up Egamma monitoring")
-
-   #----------------#
-   # MET monitoring #
-   #----------------#
-   if DQMonFlags.doMissingEtMon():
-      try:
-         include("MissingETMonitoring/MissingET_Monitoring.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up ETmiss monitoring")
-
-   #----------------#
-   # Jet monitoring #
-   #----------------#
-   if DQMonFlags.doJetMon():
-      try:
-         include("JetMonitoring/JetMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up Jet monitoring")
-
-   #----------------#
-   # Tau monitoring #
-   #----------------#
-   if DQMonFlags.doTauMon():
-      try:
-         include("tauMonitoring/tauMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up Tau monitoring")
-
-   #--------------------#
-   # Jet tag monitoring #
-   #--------------------#
-   if DQMonFlags.doJetTagMon():
-      try:
-         include("JetTagMonitoring/JetTagMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up jet-tag monitoring")
-
-   #-----------------------------#
-   # MuonSpectrometer monitoring #
-   #-----------------------------#
-   if (DQMonFlags.doMuonRawMon() or DQMonFlags.doMuonSegmentMon()
-       or DQMonFlags.doMuonTrackMon() or DQMonFlags.doMuonAlignMon()
-       or DQMonFlags.doMuonTrkPhysMon() or DQMonFlags.doMuonPhysicsMon()):
-     try:
-        include("MuonDQAMonitoring/MuonDetMonitoring.py")
-     except Exception:
-        treatException("DataQualitySteering_jobOptions.py: exception when setting up Muon detector monitoring")
-  
-   #------------------#
-   # LUCID monitoring #
-   #------------------#
-   if DQMonFlags.doLucidMon():
-      try:
-         include("LUCID_Monitoring/LUCIDMon_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up LUCID monitoring")
-
-   #------------------#                                                                                                                       
-   # AFP monitoring   #                                                                                                                       
-   #------------------#                                                                                                                       
-   if DQMonFlags.doAFPMon():
-      try:
-         include("AFP_Monitoring/AFPMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up AFP monitoring")
-
-
-   #---------------------#
-   # HeavyIon monitoring #
-   #---------------------#
-   if DQMonFlags.doHIMon():
-      try:
-         include("HIMonitoring/HIMonitoringSteering_jo.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up HI monitoring")
-
-   #------------------------#
-   # Trigger chain steering #
-   #------------------------#
-   trigMap = DQMonFlags.triggerChainMap.get_Value()
-   for toolName, trigChain in six.iteritems(trigMap):
-      local_logger.debug("Applying trigger %s to %s", trigChain, toolName)
-      if hasattr(ToolSvc,toolName):
-         tool = getattr(ToolSvc,toolName)
-         tool.TriggerChain = trigChain
-      else:
-         local_logger.debug("%s is not found in ToolSvc. Cannot set trigger chain!", toolName)
-
-   #--------------------------#
-   # Post-setup configuration #
-   #--------------------------#
-   # force conditions update because the converter can't do it
-   if DQMonFlags.monManEnvironment in ('tier0ESD', 'AOD'):
-      from AthenaCommon.AlgSequence import AthSequencer
-      from AthenaMonitoring.AthenaMonitoringConf import ForceIDConditionsAlg
-      asq = AthSequencer("AthBeginSeq") 
-      asq += [ForceIDConditionsAlg()]
-
-   if rec.triggerStream()=='express':
-      include("AthenaMonitoring/AtlasReadyFilterTool_jobOptions.py")
-   local_logger.debug('DQ Post-Setup Configuration')
-   import re
-   from AthenaMonitoring.EventFlagFilterTool import GetEventFlagFilterTool
-
-   # now the DQ tools are private, extract them from the set of monitoring algorithms
-   toolset = set()
-   from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
-   for _ in topSequence:
-      if isinstance(_, AthenaMonManager):
-         toolset.update(_.AthenaMonTools)
-
-         # in MT the initialization can be in random order ... force all managers to have common setup
-         _.FileKey             = DQMonFlags.monManFileKey()
-         _.ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup()
-         _.DataType            = DQMonFlags.monManDataType()
-         _.Environment         = DQMonFlags.monManEnvironment()
-         _.LBsInLowStatInterval = DQMonFlags.monManLBsInLowStatInterval()
-         _.LBsInMediumStatInterval = DQMonFlags.monManLBsInMediumStatInterval()
-         _.LBsInHighStatInterval = DQMonFlags.monManLBsInHighStatInterval()
-         _.ManualRunLBSetup    = DQMonFlags.monManManualRunLBSetup()
-         _.Run                 = DQMonFlags.monManRun()
-         _.LumiBlock           = DQMonFlags.monManLumiBlock()
-
-   for tool in toolset:
-      # stop lumi access if we're in MC or enableLumiAccess == False
-      if 'EnableLumi' in dir(tool):
-         if globalflags.DataSource.get_Value() == 'geant4' or not DQMonFlags.enableLumiAccess():
-            tool.EnableLumi = False
+      #------------------#
+      # LUCID monitoring #
+      #------------------#
+      if DQMonFlags.doLucidMon():
+         try:
+            include("LUCID_Monitoring/LUCIDMon_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up LUCID monitoring")
+
+      #------------------#                                                                                                                       
+      # AFP monitoring   #                                                                                                                       
+      #------------------#                                                                                                                       
+      if DQMonFlags.doAFPMon():
+         try:
+            include("AFP_Monitoring/AFPMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up AFP monitoring")
+
+
+      #---------------------#
+      # HeavyIon monitoring #
+      #---------------------#
+      if DQMonFlags.doHIMon():
+         try:
+            include("HIMonitoring/HIMonitoringSteering_jo.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up HI monitoring")
+
+      #------------------------#
+      # Trigger chain steering #
+      #------------------------#
+      trigMap = DQMonFlags.triggerChainMap.get_Value()
+      for toolName, trigChain in six.iteritems(trigMap):
+         local_logger.debug("Applying trigger %s to %s", trigChain, toolName)
+         if hasattr(ToolSvc,toolName):
+            tool = getattr(ToolSvc,toolName)
+            tool.TriggerChain = trigChain
          else:
-            tool.EnableLumi = True
-      # if we have the FilterTools attribute, assume this is in fact a
-      # monitoring tool
-      if hasattr(tool, 'FilterTools'):
-         # if express: use ATLAS Ready filter
-         local_logger.debug('Setting up filters for tool %s', tool)
-         if rec.triggerStream()=='express':
-            local_logger.info('Stream is express and we will add ready tool for %s', tool)
-            tool.FilterTools += [GetAtlasReadyFilterTool()]
-         # if requested: configure a generic event cleaning tool
-         if not athenaCommonFlags.isOnline() and any(re.match(_, tool.name()) for _ in DQMonFlags.includeInCleaning()):
-            if tool.name() in DQMonFlags.specialCleaningConfiguration():
-               config_ = DQMonFlags.specialCleaningConfiguration()[tool.name()].copy()
-               for _ in config_:
-                  try:
-                     config_[_] = bool(config_[_])
-                  except:
-                     local_logger.error('Unable to enact special event cleaning configuration for tool %s; cannot cast %s=%s to bool', tool.name(), _, config_[_])
-               config_['name'] = 'DQEventFlagFilterTool_%s' % tool.name()
-               tool.FilterTools += [GetEventFlagFilterTool(**config_)]
-               del config_
-               local_logger.info('Configurating special event cleaning for tool %s', tool)
+            local_logger.debug("%s is not found in ToolSvc. Cannot set trigger chain!", toolName)
+
+      #--------------------------#
+      # Post-setup configuration #
+      #--------------------------#
+      # force conditions update because the converter can't do it
+      if DQMonFlags.monManEnvironment in ('tier0ESD', 'AOD'):
+         from AthenaCommon.AlgSequence import AthSequencer
+         from AthenaMonitoring.AthenaMonitoringConf import ForceIDConditionsAlg
+         asq = AthSequencer("AthBeginSeq") 
+         asq += [ForceIDConditionsAlg()]
+
+      if rec.triggerStream()=='express':
+         include("AthenaMonitoring/AtlasReadyFilterTool_jobOptions.py")
+      local_logger.debug('DQ Post-Setup Configuration')
+      import re
+      from AthenaMonitoring.EventFlagFilterTool import GetEventFlagFilterTool
+
+      # now the DQ tools are private, extract them from the set of monitoring algorithms
+      toolset = set()
+      from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
+      for _ in topSequence:
+         if isinstance(_, AthenaMonManager):
+            toolset.update(_.AthenaMonTools)
+
+            # in MT the initialization can be in random order ... force all managers to have common setup
+            _.FileKey             = DQMonFlags.monManFileKey()
+            _.ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup()
+            _.DataType            = DQMonFlags.monManDataType()
+            _.Environment         = DQMonFlags.monManEnvironment()
+            _.LBsInLowStatInterval = DQMonFlags.monManLBsInLowStatInterval()
+            _.LBsInMediumStatInterval = DQMonFlags.monManLBsInMediumStatInterval()
+            _.LBsInHighStatInterval = DQMonFlags.monManLBsInHighStatInterval()
+            _.ManualRunLBSetup    = DQMonFlags.monManManualRunLBSetup()
+            _.Run                 = DQMonFlags.monManRun()
+            _.LumiBlock           = DQMonFlags.monManLumiBlock()
+
+      for tool in toolset:
+         # stop lumi access if we're in MC or enableLumiAccess == False
+         if 'EnableLumi' in dir(tool):
+            if globalflags.DataSource.get_Value() == 'geant4' or not DQMonFlags.enableLumiAccess():
+               tool.EnableLumi = False
             else:
-               local_logger.info('Configuring generic event cleaning for tool %s', tool)
-               tool.FilterTools += [GetEventFlagFilterTool('DQEventFlagFilterTool')]
-         else:
-            local_logger.info('NOT configuring event cleaning for tool %s', tool)
-
-         # give all the tools the trigger translator
-         if DQMonFlags.useTrigger():
-            tool.TrigDecisionTool = monTrigDecTool
-            tool.TriggerTranslatorTool = monTrigTransTool
-
-         if DQMonFlags.monToolPostExec():
-            postprocfunc = eval(DQMonFlags.monToolPostExec())
-            local_logger.debug('Applying postexec transform to  ===> %s', tool)
-            postprocfunc(tool)
-            del postprocfunc
-
-   # # set up new-style monitoring with new-style configuration
-   # # only enable this when we understand details better...
-   # local_logger.info('Setting up new-style DQ monitoring')
-   # from AthenaMonitoring.AthenaMonitoringCfg import AthenaMonitoringCfg
-   # from AthenaCommon.Configurable import Configurable
-
-   # _ = Configurable.configurableRun3Behavior
-   # Configurable.configurableRun3Behavior = 1
-   # from AthenaConfiguration.AllConfigFlags import ConfigFlags
-   # ConfigFlags.Input.Files = jobproperties.AthenaCommonFlags.FilesInput()
-   # ConfigFlags.Output.HISTFileName = DQMonFlags.histogramFile()
-   # ConfigFlags.DQ.isReallyOldStyle = True
-   # _2 = AthenaMonitoringCfg(ConfigFlags)
-   # Configurable.configurableRun3Behavior = _
-   # _2.printConfig()
-   # _2.appendToGlobals()
-   # del _, _2
-
-del local_logger
+               tool.EnableLumi = True
+         # if we have the FilterTools attribute, assume this is in fact a
+         # monitoring tool
+         if hasattr(tool, 'FilterTools'):
+            # if express: use ATLAS Ready filter
+            local_logger.debug('Setting up filters for tool %s', tool)
+            if rec.triggerStream()=='express':
+               local_logger.info('Stream is express and we will add ready tool for %s', tool)
+               tool.FilterTools += [GetAtlasReadyFilterTool()]
+            # if requested: configure a generic event cleaning tool
+            if not athenaCommonFlags.isOnline() and any(re.match(_, tool.name()) for _ in DQMonFlags.includeInCleaning()):
+               if tool.name() in DQMonFlags.specialCleaningConfiguration():
+                  config_ = DQMonFlags.specialCleaningConfiguration()[tool.name()].copy()
+                  for _ in config_:
+                     try:
+                        config_[_] = bool(config_[_])
+                     except:
+                        local_logger.error('Unable to enact special event cleaning configuration for tool %s; cannot cast %s=%s to bool', tool.name(), _, config_[_])
+                  config_['name'] = 'DQEventFlagFilterTool_%s' % tool.name()
+                  tool.FilterTools += [GetEventFlagFilterTool(**config_)]
+                  del config_
+                  local_logger.info('Configurating special event cleaning for tool %s', tool)
+               else:
+                  local_logger.info('Configuring generic event cleaning for tool %s', tool)
+                  tool.FilterTools += [GetEventFlagFilterTool('DQEventFlagFilterTool')]
+            else:
+               local_logger.info('NOT configuring event cleaning for tool %s', tool)
+
+            # give all the tools the trigger translator
+            if DQMonFlags.useTrigger():
+               tool.TrigDecisionTool = monTrigDecTool
+               tool.TriggerTranslatorTool = monTrigTransTool
+
+            if DQMonFlags.monToolPostExec():
+               postprocfunc = eval(DQMonFlags.monToolPostExec())
+               local_logger.debug('Applying postexec transform to  ===> %s', tool)
+               postprocfunc(tool)
+               del postprocfunc
+
+   else:
+      local_logger.info("DQ: setting up ConfigFlags")
+      from AthenaConfiguration.AllConfigFlags import ConfigFlags
+      if globalflags.InputFormat() == 'bytestream':
+         ConfigFlags.Input.Files=athenaCommonFlags.BSRDOInput()
+      elif globalflags.InputFormat() == 'pool':
+         ConfigFlags.Input.Files=svcMgr.EventSelector.InputCollections
+
+      ConfigFlags.GeoModel.Align.Dynamic=InDetFlags.useDynamicAlignFolders()
+      ConfigFlags.Detector.GeometryPixel=DetFlags.pixel_on()
+      ConfigFlags.Detector.GeometrySCT=DetFlags.SCT_on()
+      ConfigFlags.Detector.GeometryTRT=DetFlags.TRT_on()
+      ConfigFlags.InDet.usePixelDCS=InDetFlags.usePixelDCS()
+
+      ConfigFlags.Output.HISTFileName=DQMonFlags.histogramFile()
+      ConfigFlags.DQ.FileKey=DQMonFlags.monManFileKey()
+      ConfigFlags.DQ.Environment=DQMonFlags.monManEnvironment()
+      ConfigFlags.DQ.useTrigger=DQMonFlags.useTrigger()
+      ConfigFlags.IOVDb.GlobalTag=globalflags.ConditionsTag()
+      ConfigFlags.DQ.isReallyOldStyle=False
+
+      from AthenaConfiguration import ComponentAccumulator
+      from AthenaMonitoring.AthenaMonitoringCfg import AthenaMonitoringCfg
+      from AthenaMonitoring.DQConfigFlags import allSteeringFlagsOff
+      from AthenaMonitoring import AthenaMonitoringConf
+
+      Steering = ConfigFlags.DQ.Steering
+      Steering.doGlobalMon=DQMonFlags.doGlobalMon()
+      Steering.doLVL1CaloMon=DQMonFlags.doLVL1CaloMon()
+      Steering.doCTPMon=DQMonFlags.doCTPMon()
+      Steering.doHLTMon=DQMonFlags.doHLTMon()
+      Steering.doPixelMon=DQMonFlags.doPixelMon()
+      Steering.doSCTMon=DQMonFlags.doSCTMon()
+      Steering.doTRTMon=DQMonFlags.doTRTMon()
+      Steering.doLArMon=DQMonFlags.doLArMon()
+      Steering.doTileMon=DQMonFlags.doTileMon()
+      Steering.doCaloGlobalMon=DQMonFlags.doCaloMon()
+      Steering.Muon.doRawMon=DQMonFlags.doMuonRawMon()
+      Steering.Muon.doTrackMon=DQMonFlags.doMuonTrackMon()
+      Steering.doMuonMon=(Steering.Muon.doRawMon or Steering.Muon.doTrackMon)
+      Steering.doLucidMon=DQMonFlags.doLucidMon()
+      Steering.doAFPMon=DQMonFlags.doAFPMon()
+      Steering.doHIMon=DQMonFlags.doHIMon()
+      Steering.doEgammaMon=DQMonFlags.doEgammaMon()
+      Steering.doJetMon=DQMonFlags.doJetMon()
+      Steering.doMissingEtMon=DQMonFlags.doMissingEtMon()
+      Steering.doTauMon=DQMonFlags.doTauMon()
+      Steering.doJetTagMon=DQMonFlags.doJetTagMon()
+
+      ConfigFlags.dump()
+      ComponentAccumulator.CAtoGlobalWrapper(AthenaMonitoringCfg, ConfigFlags)
+
+      if len([_ for _ in AthSequencer("AthCondSeq") if _.getName()=="PixelDetectorElementCondAlg"]) > 0:
+         local_logger.info("DQ: force ID conditions loading")
+         asq = AthSequencer("AthBeginSeq")
+         asq += AthenaMonitoringConf.ForceIDConditionsAlg("ForceIDConditionsAlg")
+
+del local_logger
\ No newline at end of file
diff --git a/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py b/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py
index 5d8e8bf5e25a..e52c842f3091 100644
--- a/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py
+++ b/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py
@@ -21,22 +21,19 @@ if DQMonFlags.useTrigger():
          cfg = TriggerConfigGetter()
 
    if not hasattr(ToolSvc, DQMonFlags.nameTrigDecTool().split('/')[-1]):
-      tdt_local_logger.error('DQ Monitoring is being asked to set up the TrigDecisionTool for some reason.  THIS IS A TERRIBLE IDEA AND SHOULD BE CONSIDERED A BUG!')
-      from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
-      monTrigDecTool = Trig__TrigDecisionTool(name=DQMonFlags.nameTrigDecTool(),
-                                              OutputLevel=ERROR,
-                                              PublicChainGroups = {"EFTau": "EF_[0-9]?tau.*",
-                                                                   "EFPhoton": "EF_[0-9]?g*",
-                                                                   "EFJets":"EF_J.*",
-                                                                  }
-                                             )
-      ToolSvc += monTrigDecTool
-      # The following should be provided automatically when setting up the tool, but is not
-      # Still needs to be provided by the trigger
-      # When trigger has a standard procedure for this, switch
-      ToolSvc.TrigDecisionTool.TrigConfigSvc = "Trig::TrigConfigSvc/TrigConfigSvc"
-      from TrigEDMConfig.TriggerEDM import EDMLibraries
-      ToolSvc.TrigDecisionTool.Navigation.Dlls = [e for e in  EDMLibraries if 'TPCnv' not in e]
+      if rec.doTrigger():
+         tdt_local_logger.error('DQ Monitoring is being asked to set up the TrigDecisionTool for some reason.  THIS IS A TERRIBLE IDEA AND SHOULD BE CONSIDERED A BUG!')
+      from AthenaMonitoring.TriggerInterface import getTrigDecisionTool
+      from AthenaConfiguration.AllConfigFlags import ConfigFlags
+      if globalflags.InputFormat() == 'bytestream':
+         ConfigFlags.Input.Files=athenaCommonFlags.BSRDOInput()
+      elif globalflags.InputFormat() == 'pool':
+         ConfigFlags.Input.Files=svcMgr.EventSelector.InputCollections
+
+      from AthenaConfiguration import ComponentAccumulator
+      ComponentAccumulator.CAtoGlobalWrapper(getTrigDecisionTool, ConfigFlags)
+
+      monTrigDecTool = getattr(ToolSvc, 'TrigDecisionTool')
    else:
       monTrigDecTool = getattr(ToolSvc, DQMonFlags.nameTrigDecTool().split('/')[-1])
    tdt_local_logger.info('Scheduled monitoring TDT %s', monTrigDecTool)
diff --git a/Database/IOVDbSvc/python/CondDB.py b/Database/IOVDbSvc/python/CondDB.py
index 61aea2f0846e..fc854f8f1c8b 100644
--- a/Database/IOVDbSvc/python/CondDB.py
+++ b/Database/IOVDbSvc/python/CondDB.py
@@ -231,7 +231,7 @@ This allows the possibility of later adding a new IOV using IOVSvc::setRange."""
         self.iovdbsvc.Folders+=[folderadd]
 
         if className:
-            key = (className, self.extractFolder(folder))
+            key = [className, self.extractFolder(folder)]
             if key not in condInputLoader.Load:
                 condInputLoader.Load += [ key ]
 
diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py
index 6d2cddef950c..45a1de73d1b8 100644
--- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py
+++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py
@@ -20,8 +20,8 @@ def PixelConfigCondAlgCfg(flags, name="PixelConfigCondAlg", **kwargs):
     CondArgs.update(
         UseCalibConditions=True,
         UseDeadmapConditions=True,
-        UseDCSStateConditions=False,
-        UseDCSStatusConditions=False,
+        UseDCSStateConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS),
+        UseDCSStatusConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS),
         UseDCSHVConditions=True,
         UseDCSTemperatureConditions=True,
         UseTDAQConditions=False,
@@ -52,137 +52,138 @@ def PixelConfigCondAlgCfg(flags, name="PixelConfigCondAlg", **kwargs):
             EndcapTimeOffset=[5.0,5.0,5.0],
             DBMTimeOffset=[5.0,5.0,5.0]
         )
-    # Digitization parameters
-    CondArgs.update(
-        BunchSpace=25.0,
-        FEI4BarrelHitDiscConfig=[2]
-    )
 
-    #====================================================================================
-    # Run-dependent SIMULATION(digitization) parameters:
-    #====================================================================================
-    # RUN2 2015/2016
-    CondArgs.update(
-        BarrelToTThreshold2016       = [   -1,    5,    5,    5],
-        FEI3BarrelLatency2016        = [    0,  151,  256,  256],
-        FEI3BarrelHitDuplication2016 = [False,False,False,False],
-        FEI3BarrelSmallHitToT2016    = [   -1,   -1,   -1,   -1],
-        FEI3BarrelTimingSimTune2016  = [   -1, 2015, 2015, 2015],
-        BarrelCrossTalk2016          = [ 0.30, 0.06, 0.06, 0.06],
-        BarrelNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8, 5e-8],
-        BarrelDisableProbability2016 = [ 9e-3, 9e-3, 9e-3, 9e-3],
-        EndcapToTThreshold2016       = [    5,    5,    5],
-        FEI3EndcapLatency2016        = [  256,  256,  256],
-        FEI3EndcapHitDuplication2016 = [False,False,False],
-        FEI3EndcapSmallHitToT2016    = [   -1,   -1,   -1],
-        FEI3EndcapTimingSimTune2016  = [ 2015, 2015, 2015],
-        EndcapCrossTalk2016          = [ 0.06, 0.06, 0.06],
-        EndcapNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8],
-        EndcapDisableProbability2016 = [ 9e-3, 9e-3, 9e-3],
-        DBMToTThreshold2016       = [   -1,   -1,   -1],
-        DBMCrossTalk2016          = [ 0.06, 0.06, 0.06],
-        DBMNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8],
-        DBMDisableProbability2016 = [ 9e-3, 9e-3, 9e-3],
-        IBLNoiseShape2016    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
-        BLayerNoiseShape2016 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
-        PixelNoiseShape2016  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
-        # Layer-2 noise shape                     [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2129, 0.4016, 0.5477, 0.6599, 0.7435, 0.8160, 0.8779, 0.9340, 0.9798, 1.0]
-        # So far, Gaudi::Property does not support 2D vector.
-        #EndcapNoiseShape=[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1748, 0.3409, 0.4760, 0.5850, 0.6754, 0.7538, 0.8264, 0.8962, 0.9655, 1.0],
-        #                  [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1852, 0.3528, 0.4881, 0.5961, 0.6855, 0.7640, 0.8374, 0.9068, 0.9749, 1.0],
-        #                  [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1735, 0.3380, 0.4733, 0.5829, 0.6730, 0.7516, 0.8234, 0.8916, 0.9595, 1.0]]
-    )
-    #====================================================================================
-    # RUN2 2017
-    CondArgs.update(
-        BarrelToTThreshold2017       = [   -1,    5,    5,    5],
-        FEI3BarrelLatency2017        = [    0,  151,  256,  256],
-        FEI3BarrelHitDuplication2017 = [False,False,False,False],
-        FEI3BarrelSmallHitToT2017    = [   -1,   -1,   -1,   -1],
-        FEI3BarrelTimingSimTune2017  = [   -1, 2018, 2018, 2018],
-        BarrelCrossTalk2017          = [ 0.30, 0.06, 0.06, 0.06],
-        BarrelNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8, 5e-8],
-        BarrelDisableProbability2017 = [ 9e-3, 9e-3, 9e-3, 9e-3],
-        EndcapToTThreshold2017       = [    5,    5,    5],
-        FEI3EndcapLatency2017        = [  256,  256,  256],
-        FEI3EndcapHitDuplication2017 = [False,False,False],
-        FEI3EndcapSmallHitToT2017    = [   -1,   -1,   -1],
-        FEI3EndcapTimingSimTune2017  = [ 2018, 2018, 2018],
-        EndcapCrossTalk2017          = [ 0.06, 0.06, 0.06],
-        EndcapNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8],
-        EndcapDisableProbability2017 = [ 9e-3, 9e-3, 9e-3],
-        DBMToTThreshold2017       = [   -1,   -1,   -1],
-        DBMCrossTalk2017          = [ 0.06, 0.06, 0.06],
-        DBMNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8],
-        DBMDisableProbability2017 = [ 9e-3, 9e-3, 9e-3],
-        IBLNoiseShape2017    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
-        BLayerNoiseShape2017 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
-        PixelNoiseShape2017  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
-    )
-    #====================================================================================
-    # RUN2 2018
-    CondArgs.update(
-        BarrelToTThreshold2018       = [   -1,    3,    5,    5],
-        FEI3BarrelLatency2018        = [    0,  151,  256,  256],
-        FEI3BarrelHitDuplication2018 = [False,False,False,False],
-        FEI3BarrelSmallHitToT2018    = [   -1,   -1,   -1,   -1],
-        FEI3BarrelTimingSimTune2018  = [   -1, 2018, 2018, 2018],
-        BarrelCrossTalk2018          = [ 0.30, 0.06, 0.06, 0.06],
-        BarrelNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8, 5e-8],
-        BarrelDisableProbability2018 = [ 9e-3, 9e-3, 9e-3, 9e-3],
-        EndcapToTThreshold2018       = [    5,    5,    5],
-        FEI3EndcapLatency2018        = [  256,  256,  256],
-        FEI3EndcapHitDuplication2018 = [False,False,False],
-        FEI3EndcapSmallHitToT2018    = [   -1,   -1,   -1],
-        FEI3EndcapTimingSimTune2018  = [ 2018, 2018, 2018],
-        EndcapCrossTalk2018          = [ 0.06, 0.06, 0.06],
-        EndcapNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8],
-        EndcapDisableProbability2018 = [ 9e-3, 9e-3, 9e-3],
-        DBMToTThreshold2018       = [   -1,   -1,   -1],
-        DBMCrossTalk2018          = [ 0.06, 0.06, 0.06],
-        DBMNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8],
-        DBMDisableProbability2018 = [ 9e-3, 9e-3, 9e-3],
-        IBLNoiseShape2018    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
-        BLayerNoiseShape2018 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
-        PixelNoiseShape2018  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
-    )
-    #====================================================================================
-    # RUN1
-    CondArgs.update(
-        BarrelToTThresholdRUN1       = [    3,    3,    3],
-        FEI3BarrelLatencyRUN1        = [  256,  256,  256],
-        FEI3BarrelHitDuplicationRUN1 = [ True, True, True],
-        FEI3BarrelSmallHitToTRUN1    = [    7,    7,    7],
-        FEI3BarrelTimingSimTuneRUN1  = [ 2009, 2009, 2009],
-        BarrelCrossTalkRUN1          = [ 0.06, 0.06, 0.06],
-        BarrelNoiseOccupancyRUN1     = [ 5e-8, 5e-8, 5e-8],
-        BarrelDisableProbabilityRUN1 = [ 9e-3, 9e-3, 9e-3],
-        EndcapToTThresholdRUN1       = [    3,    3,    3],
-        FEI3EndcapLatencyRUN1        = [  256,  256,  256],
-        FEI3EndcapHitDuplicationRUN1 = [ True, True, True],
-        FEI3EndcapSmallHitToTRUN1    = [    7,    7,    7],
-        FEI3EndcapTimingSimTuneRUN1  = [ 2009, 2009, 2009],
-        EndcapCrossTalkRUN1          = [ 0.06, 0.06, 0.06],
-        EndcapNoiseOccupancyRUN1     = [ 5e-8, 5e-8, 5e-8],
-        EndcapDisableProbabilityRUN1 = [ 9e-3, 9e-3, 9e-3],
-        BLayerNoiseShapeRUN1 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
-        PixelNoiseShapeRUN1  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
-    )
-    #====================================================================================
-    # ITK
-    CondArgs.update(
-        BarrelToTThresholdITK       = [    3,    3,    3,    3,    3],
-        BarrelCrossTalkITK          = [ 0.06, 0.06, 0.06, 0.06, 0.06],
-        BarrelNoiseOccupancyITK     = [ 5e-8, 5e-8, 5e-8, 5e-8, 5e-8],
-        BarrelDisableProbabilityITK = [ 9e-3, 9e-3, 9e-3, 9e-3, 9e-3],
-        EndcapToTThresholdITK       = [    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3],
-        EndcapCrossTalkITK          = [ 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06],
-        EndcapNoiseOccupancyITK     = [ 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8],
-        EndcapDisableProbabilityITK = [ 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3],
-        InnermostNoiseShapeITK     = [0.0, 1.0],
-        NextInnermostNoiseShapeITK = [0.0, 1.0],
-        PixelNoiseShapeITK         = [0.0, 1.0]
-    )
+    if flags.Input.isMC:
+        # Digitization parameters
+        CondArgs.update(
+            BunchSpace=25.0,
+            FEI4BarrelHitDiscConfig=[2]
+        )
+        #====================================================================================
+        # Run-dependent SIMULATION(digitization) parameters:
+        #====================================================================================
+        # RUN2 2015/2016
+        CondArgs.update(
+            BarrelToTThreshold2016       = [   -1,    5,    5,    5],
+            FEI3BarrelLatency2016        = [    0,  151,  256,  256],
+            FEI3BarrelHitDuplication2016 = [False,False,False,False],
+            FEI3BarrelSmallHitToT2016    = [   -1,   -1,   -1,   -1],
+            FEI3BarrelTimingSimTune2016  = [   -1, 2015, 2015, 2015],
+            BarrelCrossTalk2016          = [ 0.30, 0.06, 0.06, 0.06],
+            BarrelNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8, 5e-8],
+            BarrelDisableProbability2016 = [ 9e-3, 9e-3, 9e-3, 9e-3],
+            EndcapToTThreshold2016       = [    5,    5,    5],
+            FEI3EndcapLatency2016        = [  256,  256,  256],
+            FEI3EndcapHitDuplication2016 = [False,False,False],
+            FEI3EndcapSmallHitToT2016    = [   -1,   -1,   -1],
+            FEI3EndcapTimingSimTune2016  = [ 2015, 2015, 2015],
+            EndcapCrossTalk2016          = [ 0.06, 0.06, 0.06],
+            EndcapNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8],
+            EndcapDisableProbability2016 = [ 9e-3, 9e-3, 9e-3],
+            DBMToTThreshold2016       = [   -1,   -1,   -1],
+            DBMCrossTalk2016          = [ 0.06, 0.06, 0.06],
+            DBMNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8],
+            DBMDisableProbability2016 = [ 9e-3, 9e-3, 9e-3],
+            IBLNoiseShape2016    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
+            BLayerNoiseShape2016 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
+            PixelNoiseShape2016  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
+            # Layer-2 noise shape                     [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2129, 0.4016, 0.5477, 0.6599, 0.7435, 0.8160, 0.8779, 0.9340, 0.9798, 1.0]
+            # So far, Gaudi::Property does not support 2D vector.
+            #EndcapNoiseShape=[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1748, 0.3409, 0.4760, 0.5850, 0.6754, 0.7538, 0.8264, 0.8962, 0.9655, 1.0],
+            #                  [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1852, 0.3528, 0.4881, 0.5961, 0.6855, 0.7640, 0.8374, 0.9068, 0.9749, 1.0],
+            #                  [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1735, 0.3380, 0.4733, 0.5829, 0.6730, 0.7516, 0.8234, 0.8916, 0.9595, 1.0]]
+        )
+        #====================================================================================
+        # RUN2 2017
+        CondArgs.update(
+            BarrelToTThreshold2017       = [   -1,    5,    5,    5],
+            FEI3BarrelLatency2017        = [    0,  151,  256,  256],
+            FEI3BarrelHitDuplication2017 = [False,False,False,False],
+            FEI3BarrelSmallHitToT2017    = [   -1,   -1,   -1,   -1],
+            FEI3BarrelTimingSimTune2017  = [   -1, 2018, 2018, 2018],
+            BarrelCrossTalk2017          = [ 0.30, 0.06, 0.06, 0.06],
+            BarrelNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8, 5e-8],
+            BarrelDisableProbability2017 = [ 9e-3, 9e-3, 9e-3, 9e-3],
+            EndcapToTThreshold2017       = [    5,    5,    5],
+            FEI3EndcapLatency2017        = [  256,  256,  256],
+            FEI3EndcapHitDuplication2017 = [False,False,False],
+            FEI3EndcapSmallHitToT2017    = [   -1,   -1,   -1],
+            FEI3EndcapTimingSimTune2017  = [ 2018, 2018, 2018],
+            EndcapCrossTalk2017          = [ 0.06, 0.06, 0.06],
+            EndcapNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8],
+            EndcapDisableProbability2017 = [ 9e-3, 9e-3, 9e-3],
+            DBMToTThreshold2017       = [   -1,   -1,   -1],
+            DBMCrossTalk2017          = [ 0.06, 0.06, 0.06],
+            DBMNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8],
+            DBMDisableProbability2017 = [ 9e-3, 9e-3, 9e-3],
+            IBLNoiseShape2017    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
+            BLayerNoiseShape2017 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
+            PixelNoiseShape2017  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
+        )
+        #====================================================================================
+        # RUN2 2018
+        CondArgs.update(
+            BarrelToTThreshold2018       = [   -1,    3,    5,    5],
+            FEI3BarrelLatency2018        = [    0,  151,  256,  256],
+            FEI3BarrelHitDuplication2018 = [False,False,False,False],
+            FEI3BarrelSmallHitToT2018    = [   -1,   -1,   -1,   -1],
+            FEI3BarrelTimingSimTune2018  = [   -1, 2018, 2018, 2018],
+            BarrelCrossTalk2018          = [ 0.30, 0.06, 0.06, 0.06],
+            BarrelNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8, 5e-8],
+            BarrelDisableProbability2018 = [ 9e-3, 9e-3, 9e-3, 9e-3],
+            EndcapToTThreshold2018       = [    5,    5,    5],
+            FEI3EndcapLatency2018        = [  256,  256,  256],
+            FEI3EndcapHitDuplication2018 = [False,False,False],
+            FEI3EndcapSmallHitToT2018    = [   -1,   -1,   -1],
+            FEI3EndcapTimingSimTune2018  = [ 2018, 2018, 2018],
+            EndcapCrossTalk2018          = [ 0.06, 0.06, 0.06],
+            EndcapNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8],
+            EndcapDisableProbability2018 = [ 9e-3, 9e-3, 9e-3],
+            DBMToTThreshold2018       = [   -1,   -1,   -1],
+            DBMCrossTalk2018          = [ 0.06, 0.06, 0.06],
+            DBMNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8],
+            DBMDisableProbability2018 = [ 9e-3, 9e-3, 9e-3],
+            IBLNoiseShape2018    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
+            BLayerNoiseShape2018 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
+            PixelNoiseShape2018  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
+        )
+        #====================================================================================
+        # RUN1
+        CondArgs.update(
+            BarrelToTThresholdRUN1       = [    3,    3,    3],
+            FEI3BarrelLatencyRUN1        = [  256,  256,  256],
+            FEI3BarrelHitDuplicationRUN1 = [ True, True, True],
+            FEI3BarrelSmallHitToTRUN1    = [    7,    7,    7],
+            FEI3BarrelTimingSimTuneRUN1  = [ 2009, 2009, 2009],
+            BarrelCrossTalkRUN1          = [ 0.06, 0.06, 0.06],
+            BarrelNoiseOccupancyRUN1     = [ 5e-8, 5e-8, 5e-8],
+            BarrelDisableProbabilityRUN1 = [ 9e-3, 9e-3, 9e-3],
+            EndcapToTThresholdRUN1       = [    3,    3,    3],
+            FEI3EndcapLatencyRUN1        = [  256,  256,  256],
+            FEI3EndcapHitDuplicationRUN1 = [ True, True, True],
+            FEI3EndcapSmallHitToTRUN1    = [    7,    7,    7],
+            FEI3EndcapTimingSimTuneRUN1  = [ 2009, 2009, 2009],
+            EndcapCrossTalkRUN1          = [ 0.06, 0.06, 0.06],
+            EndcapNoiseOccupancyRUN1     = [ 5e-8, 5e-8, 5e-8],
+            EndcapDisableProbabilityRUN1 = [ 9e-3, 9e-3, 9e-3],
+            BLayerNoiseShapeRUN1 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
+            PixelNoiseShapeRUN1  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
+        )
+        #====================================================================================
+        # ITK
+        CondArgs.update(
+            BarrelToTThresholdITK       = [    3,    3,    3,    3,    3],
+            BarrelCrossTalkITK          = [ 0.06, 0.06, 0.06, 0.06, 0.06],
+            BarrelNoiseOccupancyITK     = [ 5e-8, 5e-8, 5e-8, 5e-8, 5e-8],
+            BarrelDisableProbabilityITK = [ 9e-3, 9e-3, 9e-3, 9e-3, 9e-3],
+            EndcapToTThresholdITK       = [    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3],
+            EndcapCrossTalkITK          = [ 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06],
+            EndcapNoiseOccupancyITK     = [ 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8],
+            EndcapDisableProbabilityITK = [ 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3],
+            InnermostNoiseShapeITK     = [0.0, 1.0],
+            NextInnermostNoiseShapeITK = [0.0, 1.0],
+            PixelNoiseShapeITK         = [0.0, 1.0]
+        )
 
     # Charge calibration parameters
     CondArgs.update(
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py
index 77bdacc15a16..64331dad8eff 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py
@@ -70,13 +70,10 @@ def PixelMonitoringConfig(flags):
         
         PixelAthClusterMonAlgCfg(helper, pixelAthClusterMonAlg, **kwargsClusMonAlg)
 
-        from PixelMonitoring.PixelMonitoringConf import PixelAthErrorMonAlg
         from PixelMonitoring.PixelAthErrorMonAlgCfg import PixelAthErrorMonAlgCfg
-        pixelAthMonAlgErrorMonAlg = helper.addAlgorithm(PixelAthErrorMonAlg, 'PixelAthErrorMonAlg')
+        pixelAthMonAlgErrorMonAlg = helper.addAlgorithm(CompFactory.PixelAthErrorMonAlg, 'PixelAthErrorMonAlg')
         for k, v in kwargsErrMonAlg.items():
             setattr(pixelAthMonAlgErrorMonAlg, k, v)
-        from PixelConditionsTools.PixelConditionsToolsConf import PixelByteStreamErrorsTool
-        pixelAthMonAlgErrorMonAlg.PixelByteStreamErrorsTool = PixelByteStreamErrorsTool(ReadingESD = (flags.DQ.Environment == 'tier0ESD'))
         PixelAthErrorMonAlgCfg(helper, pixelAthMonAlgErrorMonAlg, **kwargsErrMonAlg)
         acc.merge(helper.result())
 
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTTracksMonAlg.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTTracksMonAlg.py
index e0d34db1d10f..7fb4538d0065 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTTracksMonAlg.py
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTTracksMonAlg.py
@@ -35,7 +35,7 @@ def SCTTracksMonAlgConfig(inputFlags):
         myMonAlg.FilterTools += [GetFilledBunchFilterTool()]
 
     doTrigger = False
-    if not inputFlags.isMC:
+    if not inputFlags.Input.isMC:
         if inputFlags.Trigger.doHLT:
             doTrigger = True
     myMonAlg.doTrigger = doTrigger
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py
index c589bb357c64..a66b8c0877b0 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py
@@ -20,8 +20,8 @@ def TrackSummaryToolWorkaround(flags):
     result.merge(PixelConfigCondAlgCfg(flags,
                                     UseCalibConditions=True,
                                     UseDeadmapConditions=True,
-                                    UseDCSStateConditions=False,
-                                    UseDCSStatusConditions=False,
+                                    UseDCSStateConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS),
+                                    UseDCSStatusConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS),
                                     UseDCSHVConditions=True,
                                     UseDCSTemperatureConditions=True,
                                     UseTDAQConditions=False))
@@ -87,15 +87,15 @@ def TrackSummaryToolWorkaround(flags):
                                                           CountDeadModulesAfterLastHit = True,
                                                           BoundaryCheckTool=InDetBoundaryCheckTool)
     result.addPublicTool(InDetHoleSearchTool)
-    InDetPrdAssociationTool = CompFactory.InDet.InDetPRD_AssociationToolGangedPixels(name                           = "InDetPrdAssociationTool",
+    InDetPrdAssociationTool = CompFactory.InDet.InDetPRD_AssociationToolGangedPixels(name                           = "InDetPrdAssociationTool_setup",
                                                                           PixelClusterAmbiguitiesMapName = "PixelClusterAmbiguitiesMap",
                                                                           SetupCorrect                   = True,
                                                                           addTRToutliers                 = True)
     result.addPublicTool(InDetPrdAssociationTool)
     InDetTrackSummaryHelperTool = CompFactory.InDet.InDetTrackSummaryHelperTool(name            = "InDetSummaryHelper",
                                                                      AssoTool        = InDetPrdAssociationTool,
-                                                                     PixelToTPIDTool = None,
-                                                                     TestBLayerTool  = None,
+                                                                     PixelToTPIDTool = '',
+                                                                     TestBLayerTool  = '',
                                                                      RunningTIDE_Ambi = True,
                                                                      DoSharedHits    = False,
                                                                      HoleSearch      = InDetHoleSearchTool,
@@ -106,9 +106,9 @@ def TrackSummaryToolWorkaround(flags):
                                                   InDetSummaryHelperTool = InDetTrackSummaryHelperTool,
                                                   doSharedHits           = False,
                                                   doHolesInDet           = True,
-                                                  TRT_ElectronPidTool    = None,
-                                                  TRT_ToT_dEdxTool       = None,
-                                                  PixelToTPIDTool        = None)
+                                                  TRT_ElectronPidTool    = '',
+                                                  TRT_ToT_dEdxTool       = '',
+                                                  PixelToTPIDTool        = '')
     result.setPrivateTools(InDetTrackSummaryTool)
     ############################## WORKAROUND (END) ############################
 
diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
index ceae33541b16..4ff8ded4e02d 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
@@ -2,16 +2,28 @@
 #  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 def TRTMonitoringRun3RAW_AlgConfig(inputFlags):
-    from AthenaMonitoring import AthMonitorCfgHelperOld as AthMonitorCfgHelper
+    from AthenaConfiguration.ComponentFactory import isRun3Cfg
+    if isRun3Cfg():
+        from AthenaMonitoring import AthMonitorCfgHelper
+        isOnline = inputFlags.Common.isOnline
+        from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+        rv = ComponentAccumulator()
+    else:
+        from AthenaMonitoring import AthMonitorCfgHelperOld as AthMonitorCfgHelper
+        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+        isOnline = athenaCommonFlags.isOnline
     helper = AthMonitorCfgHelper(inputFlags, 'TRTMonitoringCfg')
 
     from AthenaConfiguration.ComponentFactory import CompFactory
     algTRTMonitoringRun3RAW = helper.addAlgorithm(CompFactory.TRTMonitoringRun3RAW_Alg,
                                                   'AlgTRTMonitoringRun3RAW',
-                                                  ByteStreamErrors= "" if inputFlags.isMC else "TRT_ByteStreamErrs"
+                                                  ByteStreamErrors= "" if inputFlags.Input.isMC else "TRT_ByteStreamErrs",
+                                                  TrackSummaryTool= "InDetTrackSummaryTool"
                                               )
 
-    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+    if isRun3Cfg():
+        from SCT_Monitoring.TrackSummaryToolWorkaround import TrackSummaryToolWorkaround
+        algTRTMonitoringRun3RAW.TrackSummaryTool = rv.popToolsAndMerge(TrackSummaryToolWorkaround(inputFlags))
 
     maxLumiBlock         = 200
     numberOfBarrelStacks = 32
@@ -108,7 +120,7 @@ def TRTMonitoringRun3RAW_AlgConfig(inputFlags):
                 rdoEndcapGroup.defineHistogram('HitWMap_Ar_passed,HitWMap_Ar;hHitWMap_Ar_{0}'.format(side[iside]),type='TEfficiency',title='Leading Edge in Time Window: Argon Straws (E{0});Straw Number in Stack;Probability'.format(side[iside]),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe])   
         for iside in range(2):
             regionTag = ' (' + beId[ibe] + sideId[iside] + ')'
-            regionMarker = (beId[ibe] + sideId[iside]) if athenaCommonFlags.isOnline is True else (sideId[iside])
+            regionMarker = (beId[ibe] + sideId[iside]) if isOnline is True else (sideId[iside])
             rdoLLHLOccGroup = helper.addGroup(algTRTMonitoringRun3RAW,'RDOLLHLOccHistograms{0}{1}'.format(ibe,iside))
             rdoLLHLOccGroup.defineHistogram('AvgHLOcc_side_x,AvgHLOcc_side_y;hAvgHLOcc_{0}'.format(regionMarker),type='TProfile',title='Avg. HL Occupancy{0};{1};Occupancy'.format(regionTag,stackOrSector[ibe]),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=32,xmin=1,xmax=33)
             rdoLLHLOccGroup.defineHistogram('AvgLLOcc_side_x,AvgLLOcc_side_y;hAvgLLOcc_{0}'.format(regionMarker),type='TProfile',title='Avg. LL Occupancy{0};{1};Occupancy'.format(regionTag,stackOrSector[ibe]),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=32,xmin=1,xmax=33)
@@ -209,4 +221,8 @@ def TRTMonitoringRun3RAW_AlgConfig(inputFlags):
                 shiftTrackEndcapGroup.defineHistogram('StrawEffDetPhi_E_passed,StrawEffDetPhi_E;hStrawEffDetPhi_{0}'.format(sideId[iside]),type='TEfficiency',title='Straw Efficiency on Track with {0} mm Cut vs #phi(2D){1};Stack;Avg. Straw Efficiency'.format(distance,regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=32,xmin=0,xmax=32)
     ### Finished Booking TRT Hits Histograms ###
 
-    return helper.result()
+    if isRun3Cfg():
+        rv.merge(helper.result())
+        return rv
+    else:
+        return helper.result()
diff --git a/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py b/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py
index 1e3fae2056c4..44ff1145650a 100644
--- a/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py
+++ b/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py
@@ -4,46 +4,37 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 LArBadChannelCondAlg, LArBadFebCondAlg, LArBadChannelMasker=CompFactory.getComps("LArBadChannelCondAlg","LArBadFebCondAlg","LArBadChannelMasker",)
 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
-from IOVDbSvc.IOVDbSvcConfig import addFolders
+from IOVDbSvc.IOVDbSvcConfig import addFolders, addFoldersSplitOnline
 
-def LArBadChannelCfg(configFlags, tag=""):
+def LArBadChannelCfg(configFlags, tag=None):
 
     result=LArOnOffIdMappingCfg(configFlags)
-    
-    if configFlags.Common.isOnline or configFlags.Input.isMC:
-        foldername="/LAR/BadChannels/BadChannels"
-    else:
-        foldername="/LAR/BadChannelsOfl/BadChannels"
-        pass
-    
-    if configFlags.Common.isOnline: 
-        dbname="LAR"
-    else:
-        dbname="LAR_OFL"
+    rekey="/LAR/BadChannels/BadChannels"
 
-    result.merge(addFolders(configFlags,foldername + tag,detDb=dbname,className="CondAttrListCollection"))
-    
-    theLArBadChannelCondAlgo=LArBadChannelCondAlg(ReadKey=foldername)
+    if configFlags.Input.isMC:
+        result.merge(addFolders(configFlags,"/LAR/BadChannels/BadChannels","LAR_OFL",tag=tag,
+                                className="CondAttrListCollection"))
+    else:
+        result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/BadChannels",
+                                        f"/LAR/BadChannelsOfl/BadChannels<key>{rekey}</key>",tag=tag,
+                                        className="CondAttrListCollection"))  
+    theLArBadChannelCondAlgo=LArBadChannelCondAlg(ReadKey=rekey)
     result.addCondAlgo(theLArBadChannelCondAlgo)
     return result
 
 
-def LArBadFebCfg(configFlags, tag=""):
+def LArBadFebCfg(configFlags, tag=None):
     result=ComponentAccumulator()
+    rekey="/LAR/BadChannels/MissingFEBs"
 
-    if configFlags.Common.isOnline or configFlags.Input.isMC:
-        foldername="/LAR/BadChannels/MissingFEBs"
-    else:
-        foldername="/LAR/BadChannelsOfl/MissingFEBs"
-        pass
-
-    if configFlags.Common.isOnline: 
-        dbname="LAR"
+    if configFlags.Input.isMC:
+        result.merge(addFolders(configFlags,"/LAR/BadChannels/MissingFEBs","LAR_OFL",tag=tag,
+                                className="AthenaAttributeList"))
     else:
-        dbname="LAR_OFL"
-
-    result.merge(addFolders(configFlags,foldername + tag,detDb=dbname,className="AthenaAttributeList"))
-    result.addCondAlgo(LArBadFebCondAlg(ReadKey=foldername))
+        result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/MissingFEBs",
+                                           f"/LAR/BadChannelsOfl/MissingFEBs<key>{rekey}</key>",tag=tag,
+                                           className="AthenaAttributeList"))  
+    result.addCondAlgo(LArBadFebCondAlg(ReadKey=rekey))
     return result
 
 
diff --git a/LArCalorimeter/LArBadChannelTool/python/LArBadFebsConfig.py b/LArCalorimeter/LArBadChannelTool/python/LArBadFebsConfig.py
index ce39d215f7ab..f85841409216 100644
--- a/LArCalorimeter/LArBadChannelTool/python/LArBadFebsConfig.py
+++ b/LArCalorimeter/LArBadChannelTool/python/LArBadFebsConfig.py
@@ -3,52 +3,34 @@
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 LArBadFebCondAlg=CompFactory.LArBadFebCondAlg
-from IOVDbSvc.IOVDbSvcConfig import addFolders
+from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
 
-def LArKnownBadFebCfg(configFlags, tag=""):
+def LArKnownBadFebCfg(configFlags, tag=None):
     result=ComponentAccumulator()
 
     if configFlags.GeoModel.Run == "RUN1":
-        foldername=""
+        rekey=""
     else:    
-        if configFlags.Common.isOnline or configFlags.Input.isMC:
-            foldername="/LAR/BadChannels/KnownBADFEBs"
-        else:
-            foldername="/LAR/BadChannelsOfl/KnownBADFEBs"
-        pass
- 
-        if configFlags.Common.isOnline: 
-            dbname="LAR"
-        else:
-            dbname="LAR_OFL"
-        pass
-    pass    
+        rekey="/LAR/BadChannels/KnownBADFEBs"
+        result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/KnownBADFEBs",
+                                           f"/LAR/BadChannelsOfl/KnownBADFEBs<key>{rekey}</key>",tag=tag,
+                                           className="AthenaAttributeList"))  
 
-    result.merge(addFolders(configFlags,foldername + tag,detDb=dbname,className="AthenaAttributeList"))
-    result.addCondAlgo(LArBadFebCondAlg("LArKonwnBadFebCondAlg",ReadKey=foldername,WriteKey="LArKnownBadFEBs"))
+    result.addCondAlgo(LArBadFebCondAlg("LArKnownBadFebAlg",ReadKey=rekey,WriteKey="LArKnownBadFEBs"))
     return result
 
-def LArKnownMNBFebCfg(configFlags, tag=""):
+def LArKnownMNBFebCfg(configFlags, tag=None):
     result=ComponentAccumulator()
 
     if configFlags.GeoModel.Run == "RUN1":
-        foldername=""
-    else:    
-        if configFlags.Common.isOnline or configFlags.Input.isMC:
-            foldername="/LAR/BadChannels/KnownMNBFEBs"
-        else:
-            foldername="/LAR/BadChannelsOfl/KnownMNBFEBs"
-        pass
- 
-        if configFlags.Common.isOnline: 
-            dbname="LAR"
-        else:
-            dbname="LAR_OFL"
-        pass
-    pass    
-
-    result.merge(addFolders(configFlags,foldername + tag,detDb=dbname,className="AthenaAttributeList"))
-    result.addCondAlgo(LArBadFebCondAlg("LArKonwnMNBFebCondAlg",ReadKey=foldername,WriteKey="LArKnownMNBFEBs"))
+        rekey=""
+    else:
+        rekey="/LAR/BadChannels/KnownMNBFEBs"
+        result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/KnownMNBFEBs",
+                                           f"/LAR/BadChannelsOfl/KnownMNBFEBs<key>{rekey}</key>",tag=tag,
+                                           className="AthenaAttributeList"))   
+
+    result.addCondAlgo(LArBadFebCondAlg("LArKnownMNBFebAlg",ReadKey=rekey,WriteKey="LArKnownMNBFEBs"))
     return result
 
 
diff --git a/LArCalorimeter/LArCalibUtils/python/LArHVScaleConfig.py b/LArCalorimeter/LArCalibUtils/python/LArHVScaleConfig.py
index 772629cab37f..1f3db3321df7 100644
--- a/LArCalorimeter/LArCalibUtils/python/LArHVScaleConfig.py
+++ b/LArCalorimeter/LArCalibUtils/python/LArHVScaleConfig.py
@@ -39,7 +39,7 @@ def LArHVScaleCfg(configFlags):
         result.addCondAlgo(hvpath)
 
         LArHVCondAlg=CompFactory.LArHVCondAlg
-        hvcond = LArHVCondAlg("LArHVPathologyAlg",HVPathologies="LArHVPathology",OutputHVData="LArHVData")
+        hvcond = LArHVCondAlg(HVPathologies="LArHVPathology",OutputHVData="LArHVData")
         result.addCondAlgo(hvcond)
 
         from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDbCfg
diff --git a/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py
index 513447a42d1d..ac701c906374 100644
--- a/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py
+++ b/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py
@@ -12,14 +12,22 @@ def LArFEBMonConfigOld(inputFlags, cellDebug=False, dspDebug=False):
 
 
 def LArFEBMonConfig(inputFlags, cellDebug=False, dspDebug=False):
-
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'LArFEBMonAlgCfg')
 
     from AthenaConfiguration.ComponentFactory import CompFactory
     LArFEBMonConfigCore(helper, CompFactory.LArFEBMonAlg,inputFlags,cellDebug, dspDebug)
 
-    return helper.result()
+    rv = ComponentAccumulator()
+
+    # adding LArFebErrorSummary algo
+    from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
+    rv.merge(LArFebErrorSummaryMakerCfg(inputFlags))
+    
+    rv.merge(helper.result())
+
+    return rv
 
 def LArFEBMonConfigCore(helper,algoinstance,inputFlags, cellDebug=False, dspDebug=False):
 
@@ -74,14 +82,7 @@ def LArFEBMonConfigCore(helper,algoinstance,inputFlags, cellDebug=False, dspDebu
            conddb.addFolder (db, fld, className=obj)
        larFEBMonAlg.Run1DSPThresholdsKey = 'LArDSPThresholds'
 
-    # adding LArFebErrorSummary algo
-    if isRun3Cfg() :
-        from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
-        acc = LArFebErrorSummaryMakerCfg(inputFlags)
-        helper.resobj.merge(acc)
-    else :
-        #put here what to do else
-        pass
+
     Group = helper.addGroup(
         larFEBMonAlg,
         GroupName,
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py
index 17a556f53384..7c7a3050f650 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py
@@ -16,7 +16,7 @@ def MuonTrackConfig(inputFlags, isOld=False):
 
     helper = AthMonitorCfgHelper(inputFlags, "MuonTrackMonitoringConfig")
 
-    muonTrackAlg = helper.addAlgorithm(MuonTrackMonitorAlgorithm, "MuonTrackMonitorAlgorithm")
+    muonTrackAlg = helper.addAlgorithm(MuonTrackMonitorAlgorithm, "MuonTrackMonitorAlg")
 
     myGroup = helper.addGroup(muonTrackAlg, "MuonTrackMonitorAlgorithm", "MuonPhysics/")
 
diff --git a/PhysicsAnalysis/JetTagging/JetTagMonitoring/python/JetTagMonitorAlgorithm.py b/PhysicsAnalysis/JetTagging/JetTagMonitoring/python/JetTagMonitorAlgorithm.py
index 3b53019c7f02..bfcb72281de7 100644
--- a/PhysicsAnalysis/JetTagging/JetTagMonitoring/python/JetTagMonitorAlgorithm.py
+++ b/PhysicsAnalysis/JetTagging/JetTagMonitoring/python/JetTagMonitorAlgorithm.py
@@ -16,8 +16,12 @@ def JetTagMonitorConfig(inputFlags):
     ### STEP 1 ###
     # Define one top-level monitoring algorithm. The new configuration 
     # framework uses a component accumulator.
-    #from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
-    #result = ComponentAccumulator()
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    result = ComponentAccumulator()
+
+    # do not run monitoring in RAWtoESD
+    if inputFlags.DQ.Environment == 'tier0Raw':
+        return result
 
     # The following class will make a sequence, configure algorithms, and link
     # them to GenericMonitoringTools
@@ -307,7 +311,8 @@ def JetTagMonitorConfig(inputFlags):
     # and the sequence containing the created algorithms. If we haven't called
     # any configuration other than the AthMonitorCfgHelper here, then we can 
     # just return directly (and not create "result" above)
-    return helper.result()
+    result.merge(helper.result())
+    return result
     
     # # Otherwise, merge with result object and return
     # acc, seq = helper.result()
diff --git a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringStandard.py b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringStandard.py
index c04cef28d225..6378161ce16a 100644
--- a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringStandard.py
+++ b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringStandard.py
@@ -9,7 +9,7 @@
 '''
 
 from __future__ import print_function
-from JetMonitoring.JetMonitoringConfig import JetMonAlgSpec, HistoSpec,  SelectSpec, ToolSpec
+from JetMonitoring.JetMonitoringConfig import JetMonAlgSpec, HistoSpec,  SelectSpec
 
 
 # *********************************************
@@ -145,6 +145,13 @@ def standardJetMonitoring(inputFlags):
     Details of what goes into jet monitoring is implemented by dedicated functions such as jetMonAlgConfig().
     """
 
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    rv = ComponentAccumulator()
+
+    # do not run monitoring in RAWtoESD
+    if inputFlags.DQ.Environment == 'tier0Raw':
+        return rv
+
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'JetMonitoring')
 
@@ -161,4 +168,5 @@ def standardJetMonitoring(inputFlags):
     for conf in jetAlgConfs:        
         conf.toAlg(helper) # adds the conf as a JetMonitoringAlg to the helper
     
-    return helper.result() # the AthMonitorCfgHelper returns an accumulator to be used by the general configuration system.
+    rv.merge(helper.result())  # the AthMonitorCfgHelper returns an accumulator to be used by the general configuration system.
+    return rv
diff --git a/Reconstruction/MissingETMonitoring/python/METMonitorAlgorithm.py b/Reconstruction/MissingETMonitoring/python/METMonitorAlgorithm.py
index 934393e2f386..a01eac977871 100644
--- a/Reconstruction/MissingETMonitoring/python/METMonitorAlgorithm.py
+++ b/Reconstruction/MissingETMonitoring/python/METMonitorAlgorithm.py
@@ -49,8 +49,12 @@ def defineHistogramsCalo(monAlg, group,helper,histoNameSuffix=""):
 def METMonitoringConfig(inputFlags):    
 # '''Function to configures some algorithms in the monitoring system.'''
 
-#    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator  
-#    result = ComponentAccumulator()
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    result = ComponentAccumulator()
+
+    # do not run monitoring in RAWtoESD
+    if inputFlags.DQ.Environment == 'tier0Raw':
+        return result
 
     from AthenaMonitoring import AthMonitorCfgHelper     
 #    helper = AthMonitorCfgHelper(inputFlags,'AthMonitorCfg') 
@@ -289,4 +293,6 @@ def METMonitoringConfig(inputFlags):
     BadJetsGroup = helper.addGroup(BadJets_EMTopoMETMonAlg,"METMonitor","MissingEt/AllTriggers/BadJets/MET_Calo/EMTopo")
     for mets in emtopomet_types:
         defineHistograms(BadJets_EMTopoMETMonAlg, BadJetsGroup,helper,mets)
-    return helper.result()
+
+    result.merge(helper.result())
+    return result
diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
index 98d249a73373..2fd95abd9dc0 100644
--- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
+++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
@@ -676,20 +676,6 @@ if rec.doESD() and not rec.readESD() and rec.doBeamBackgroundFiller():
 if recAlgs.doMonteCarloReact():
     protectedInclude ("MonteCarloReactTools/MonteCarloReact_for_RecExCommon.py")
 
-# run monitoring
-# ----------------------------------------------------------------------------
-# Monitoring Algorithms and Tools
-# ----------------------------------------------------------------------------
-
-pdr.flag_domain('monitoring')
-if rec.doMonitoring():
-    protectedInclude ("AthenaMonitoring/DataQualitySteering_jobOptions.py")
-
-
-
-# run"Fast Phsyics Monitoring"
-if rec.doFastPhysMonitoring():
-    protectedInclude("FastPhysMonExample/FastPhysicsMonitoring_jobOptions.py")
 
 # ----------------------------------------------------------------------------
 
@@ -981,6 +967,7 @@ if rec.doFileMetaData():
 
     pass
 
+
 ##--------------------------------------------------------
 ###=== Only run reco on events that pass selected triggers
 ##--------------------------------------------------------
@@ -1611,6 +1598,21 @@ if rec.readAOD():
     ServiceMgr.AthenaEventLoopMgr.EventPrintoutInterval = 100
     logRecExCommon_topOptions.info("AOD reading case: Set EventPrintoutInterval=100")
 
+# run monitoring
+# ----------------------------------------------------------------------------
+# Monitoring Algorithms and Tools
+# ----------------------------------------------------------------------------
+
+pdr.flag_domain('monitoring')
+if rec.doMonitoring():
+    protectedInclude ("AthenaMonitoring/DataQualitySteering_jobOptions.py")
+
+
+
+# run"Fast Phsyics Monitoring"
+if rec.doFastPhysMonitoring():
+    protectedInclude("FastPhysMonExample/FastPhysicsMonitoring_jobOptions.py")
+
 
 ###################
 ## Common Utils  ##
diff --git a/Reconstruction/tauMonitoring/python/TauMonitoringConfig.py b/Reconstruction/tauMonitoring/python/TauMonitoringConfig.py
index a2cb5d279c74..4f802ce165cb 100644
--- a/Reconstruction/tauMonitoring/python/TauMonitoringConfig.py
+++ b/Reconstruction/tauMonitoring/python/TauMonitoringConfig.py
@@ -6,7 +6,9 @@ def TauMonitoringConfig(flags):
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     result = ComponentAccumulator()
 
-    from .tauMonitorAlgorithm import tauMonitoringConfig
-    result.merge(tauMonitoringConfig(flags))
+    # the following should not run in RAW to ESD, if we're in two-step
+    if flags.DQ.Environment != 'tier0Raw':
+        from .tauMonitorAlgorithm import tauMonitoringConfig
+        result.merge(tauMonitoringConfig(flags))
 
     return result
diff --git a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py
index cdc268889277..15455299d151 100644
--- a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py
+++ b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py
@@ -381,11 +381,11 @@ class _TileInfoConfigurator( TileInfoLoader ):
             dbConnStr = 'DCS_OFL'
             from IOVDbSvc.CondDB import conddb
             if useHV:
-                conddb.addFolder(dbConnStr, "/TILE/DCS/HV", className = 'CondAttrListCollection')
+                conddb.addFolder(dbConnStr, "/TILE/DCS/HV<key>/TILE/DCS/HV</key>", className = 'CondAttrListCollection')
             if useHVSET:
-                conddb.addFolder(dbConnStr, "/TILE/DCS/HVSET", className = 'CondAttrListCollection')
+                conddb.addFolder(dbConnStr, "/TILE/DCS/HVSET<key>/TILE/DCS/HVSET</key>", className = 'CondAttrListCollection')
             if useSTATUS:
-                conddb.addFolder(dbConnStr, "/TILE/DCS/STATES", className = 'CondAttrListCollection')
+                conddb.addFolder(dbConnStr, "/TILE/DCS/STATES<key>/TILE/DCS/STATES</key>", className = 'CondAttrListCollection')
 
             from TileConditions.TileConditionsConf import TileDCSCondAlg
             condSequence += TileDCSCondAlg(name = dcsCondAlg,
diff --git a/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py b/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py
index 83b62e933e58..502cc03b192a 100644
--- a/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py
+++ b/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py
@@ -143,12 +143,7 @@ if not 'TileCommissioning' in dir():
     if jobproperties.Beam.beamType != 'collisions':
         TileCommissioning = True
     else:
-        try:
-            from RecExConfig.RecFlags import rec
-            TileCommissioning = rec.Commissioning()
-        except:
-            msg.info("No RecFlags available - looks like a simulation job")
-            TileCommissioning = False
+        TileCommissioning = False
         
 if TileCommissioning:
     msg.info("Adjusting TileInfo to return cell noise for Opt.Filter with iterations")
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
index 814312213c79..d0adaf914a41 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
@@ -49,9 +49,9 @@ def trigCaloDataAccessSvcCfg( flags ):
     acc.merge( createLArRoI_Map( flags ) )
 
     # Needed by bad channel maskers, refrerenced from LArCellCont.
-    from IOVDbSvc.IOVDbSvcConfig import addFolders
-    acc.merge(addFolders(flags, ['/LAR/BadChannels/BadChannels'], 'LAR'))
-    acc.merge(addFolders(flags, ['/LAR/BadChannels/MissingFEBs'], 'LAR'))
+    from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
+    acc.merge(LArBadChannelCfg(flags))
+    acc.merge(LArBadFebCfg(flags))
 
     from TileConditions.TileEMScaleConfig import TileEMScaleCondAlgCfg
     acc.merge( TileEMScaleCondAlgCfg(flags) )
-- 
GitLab


From 41f89cf257225b712c657e2661cb2466e2ddeef9 Mon Sep 17 00:00:00 2001
From: Jannik Geisen <jannik.geisen@cern.ch>
Date: Tue, 22 Sep 2020 16:17:30 +0200
Subject: [PATCH 357/422] Avoid running ChainConfig twice in Legacy with same
 settings

---
 .../TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py      | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
index b1565ea994f8..994f265356be 100644
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
@@ -204,8 +204,9 @@ def TrigJetMonConfig(inputFlags):
   # Loop over HLT jet chains
   for chain,jetcoll in Chain2JetCollDict[InputType].items():
     # kinematic plots
-    chainMonitorConfT = jetChainMonitoringConfig(inputFlags,jetcoll,chain,AthenaMT,True)
-    chainMonitorConfT.toAlg(helper)
+    if AthenaMT:
+      chainMonitorConfT = jetChainMonitoringConfig(inputFlags,jetcoll,chain,AthenaMT,True)
+      chainMonitorConfT.toAlg(helper)
     chainMonitorConfF = jetChainMonitoringConfig(inputFlags,jetcoll,chain,AthenaMT,False)
     chainMonitorConfF.toAlg(helper)
     # efficiency plots
-- 
GitLab


From e5ef5283d4ee7ba72712ffeaf17a507b805009f1 Mon Sep 17 00:00:00 2001
From: xiaozhon Huang <xiaozhong.huang@cern.ch>
Date: Tue, 22 Sep 2020 14:32:32 +0000
Subject: [PATCH 358/422] tauRecTools: use consistent treatments of vertex
 correction (ATLTAU-1716)

The vertex correction is not applied consistently in the tau
reconstruction. In addition, it is applied to the four momentum already
corrected by PV0, indicating an over correction.

Ideally, we could apply the vertex correction to the four momentum
before the origin correction in jet reconstruction. But it is not
straight forward to obtain this information. Alternatively, we
apply the vertex correction relative to the jet vertex to fix
this bug.
---
 .../tauRec/python/TauAlgorithmsHolder.py      |  37 ++-
 Reconstruction/tauRecTools/CMakeLists.txt     |   1 +
 .../tauRecTools/Root/CaloClusterVariables.cxx |  80 +++----
 .../tauRecTools/Root/HelperFunctions.cxx      | 136 ++++-------
 Reconstruction/tauRecTools/Root/LinkDef.h     |   3 +
 .../Root/MvaTESVariableDecorator.cxx          |  50 ++--
 .../tauRecTools/Root/TauIDVarCalculator.cxx   |  42 ++--
 .../tauRecTools/Root/TauJetRNNEvaluator.cxx   |  32 ++-
 .../Root/TauSubstructureVariables.cxx         |  92 ++++----
 .../tauRecTools/Root/TauVertexCorrection.cxx  | 218 ++++++++++++++++++
 .../tauRecTools/src/JetSeedBuilder.cxx        |  11 +-
 .../tauRecTools/src/TauAxisSetter.cxx         |  46 ++--
 .../tauRecTools/src/TauAxisSetter.h           |  10 +-
 .../tauRecTools/src/TauCellVariables.cxx      |  10 +-
 .../src/TauElectronVetoVariables.cxx          |   6 +-
 .../src/TauElectronVetoVariables.h            |   2 +-
 .../tauRecTools/src/TauPi0ClusterCreator.cxx  |  70 ++++--
 .../tauRecTools/src/TauPi0ClusterCreator.h    |  14 +-
 .../tauRecTools/src/TauPi0ClusterScaler.cxx   |   2 +-
 .../tauRecTools/src/TauTrackFinder.cxx        |   3 +-
 .../tauRecTools/src/TauVertexFinder.cxx       |   3 +-
 .../tauRecTools/src/TauVertexVariables.cxx    |   9 +-
 .../src/components/tauRecTools_entries.cxx    |   2 +
 .../tauRecTools/CaloClusterVariables.h        |  28 +--
 .../tauRecTools/tauRecTools/HelperFunctions.h |  16 +-
 .../tauRecTools/ITauVertexCorrection.h        |  83 +++++++
 .../tauRecTools/MvaTESVariableDecorator.h     |  11 +-
 .../tauRecTools/TauIDVarCalculator.h          |  10 +-
 .../tauRecTools/TauJetRNNEvaluator.h          |  12 +-
 .../tauRecTools/TauSubstructureVariables.h    |  12 +-
 .../tauRecTools/TauVertexCorrection.h         |  98 ++++++++
 .../python/TrigTauAlgorithmsHolder.py         |  38 ++-
 32 files changed, 854 insertions(+), 333 deletions(-)
 create mode 100644 Reconstruction/tauRecTools/Root/TauVertexCorrection.cxx
 create mode 100644 Reconstruction/tauRecTools/tauRecTools/ITauVertexCorrection.h
 create mode 100644 Reconstruction/tauRecTools/tauRecTools/TauVertexCorrection.h

diff --git a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
index d095185b9c1c..02c74c1cf1fa 100644
--- a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
+++ b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
@@ -78,6 +78,7 @@ def getTauAxis():
     TauAxisSetter = TauAxisSetter(  name = _name, 
                                     ClusterCone = 0.2,
                                     VertexCorrection = True,
+                                    TauVertexCorrection = getTauVertexCorrection(),
                                     IncShowerSubtr = tauFlags.useShowerSubClusters() )
                                     
     cached_instances[_name] = TauAxisSetter                
@@ -309,7 +310,7 @@ def getTauSubstructure():
     
     from tauRecTools.tauRecToolsConf import TauSubstructureVariables
     TauSubstructureVariables = TauSubstructureVariables(  name = _name,
-                                                          VertexCorrection = True,
+                                                          TauVertexCorrection = getTauVertexCorrection(),
                                                           IncShowerSubtr = tauFlags.useShowerSubClusters()
                                                        )
     
@@ -388,6 +389,7 @@ def getPi0ClusterCreator():
     from tauRecTools.tauRecToolsConf import TauPi0ClusterCreator
     TauPi0ClusterCreator = TauPi0ClusterCreator(name = _name,
                                                 Key_Pi0ClusterContainer="TauPi0SubtractedClusters",
+                                                TauVertexCorrection = getTauVertexCorrection(),
                                                 IncShowerSubtr = tauFlags.useShowerSubClusters()
                                                 )
     
@@ -678,6 +680,7 @@ def getMvaTESVariableDecorator():
     from tauRecTools.tauRecToolsConf import MvaTESVariableDecorator
     MvaTESVariableDecorator = MvaTESVariableDecorator(name = _name,
                                                       Key_vertexInputContainer=_DefaultVertexContainer,
+                                                      TauVertexCorrection = getTauVertexCorrection(),
                                                       IncShowerSubtr = tauFlags.useShowerSubClusters() )
     cached_instances[_name] = MvaTESVariableDecorator
     return MvaTESVariableDecorator
@@ -891,6 +894,7 @@ def getTauJetRNNEvaluator(_n, NetworkFile0P="", NetworkFile1P="", NetworkFile3P=
                                               InputLayerClusters=InputLayerClusters,
                                               OutputLayer=OutputLayer,
                                               OutputNode=OutputNode,
+                                              TauVertexCorrection = getTauVertexCorrection(),
                                               IncShowerSubtr = tauFlags.useShowerSubClusters() )
     cached_instances[_name] = myTauJetRNNEvaluator
     return myTauJetRNNEvaluator
@@ -911,9 +915,11 @@ def getTauJetBDTEvaluator(_n, weightsFile="", minNTracks=0, maxNTracks=10000, ou
 
 def getTauIDVarCalculator():
     _name = sPrefix + 'TauIDVarCalculator'
-    from tauRecTools.tauRecToolsConf import TauIDVarCalculator            
+    from tauRecTools.tauRecToolsConf import TauIDVarCalculator   
+
     myTauIDVarCalculator = TauIDVarCalculator(name=_name,
-                                              IncShowerSubtr = tauFlags.useShowerSubClusters() )
+                                              IncShowerSubtr = tauFlags.useShowerSubClusters(),
+                                              TauVertexCorrection = getTauVertexCorrection())
     cached_instances[_name] = myTauIDVarCalculator
     return myTauIDVarCalculator
 
@@ -937,6 +943,31 @@ def getTauEleOLRDecorator():
     cached_instances[_name] = myTauEleOLRDecorator
     return myTauEleOLRDecorator
 
+def getTauVertexCorrection():
+    from tauRec.tauRecFlags import tauFlags
+    from tauRecTools.tauRecToolsConf import TauVertexCorrection
+    from JetRec.JetRecFlags import jetFlags
+
+    _name = sPrefix + 'TauVertexCorrection'
+    
+    if _name in cached_instances:
+        return cached_instances[_name]
+  
+    doJetVertexCorrection = False
+    if tauFlags.isStandalone:
+        doJetVertexCorrection = True
+    if jetFlags.useVertices() and jetFlags.useTracks():
+        doJetVertexCorrection = True
+
+    myTauVertexCorrection = TauVertexCorrection(name = _name,
+                                                SeedJet = tauFlags.tauRecSeedJetCollection(), 
+                                                VertexCorrection = True,
+                                                JetVertexCorrection = doJetVertexCorrection)
+    
+    cached_instances[_name] = myTauVertexCorrection
+    return myTauVertexCorrection
+
+
 def getParticleCache():
     #If reading from ESD we not create a cache of extrapolations to the calorimeter, so we should signify this by setting the cache key to a null string
     from RecExConfig.RecFlags import rec
diff --git a/Reconstruction/tauRecTools/CMakeLists.txt b/Reconstruction/tauRecTools/CMakeLists.txt
index 3813187ab2f3..d9b7d10bf341 100644
--- a/Reconstruction/tauRecTools/CMakeLists.txt
+++ b/Reconstruction/tauRecTools/CMakeLists.txt
@@ -29,6 +29,7 @@ atlas_add_root_dictionary( tauRecToolsLib tauRecToolsLibCintDict
   tauRecTools/TauJetRNNEvaluator.h
   tauRecTools/TauIDVarCalculator.h
   tauRecTools/TauDecayModeNNClassifier.h
+  tauRecTools/TauVertexCorrection.h
   Root/LinkDef.h
   EXTERNAL_PACKAGES ROOT
   )
diff --git a/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx b/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx
index 2f3f5e5a07d0..adb2157ab41d 100644
--- a/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx
+++ b/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx
@@ -22,7 +22,6 @@ m_totMass(DEFAULT),
 m_effMass(DEFAULT),
 m_totEnergy(DEFAULT),
 m_effEnergy(DEFAULT),
-m_doVertexCorrection(false),
 m_incShowerSubtr(true){
 }
 
@@ -30,28 +29,29 @@ m_incShowerSubtr(true){
 // update/fill the cluster based variables
 //*******************************************
 
-bool CaloClusterVariables::update(const xAOD::TauJet& pTau) {
+bool CaloClusterVariables::update(const xAOD::TauJet& pTau, const ToolHandle<ITauVertexCorrection>& tauVertexCorrection) {
+    
+    if (! pTau.jetLink().isValid()) return false;
 
-    const xAOD::Jet* pSeed = pTau.jet();
-    if(!pSeed) return false;
+    const xAOD::Jet* jetSeed = pTau.jet();
+    const xAOD::Vertex* jetVertex = tauVertexCorrection->getJetVertex(*jetSeed);
 
-    // Loop through jets, get links to clusters
+    const xAOD::Vertex* tauVertex = nullptr;
+    if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
+ 
     std::vector<const xAOD::CaloCluster*> clusterList;
-    StatusCode sc = tauRecTools::GetJetClusterList(pSeed, clusterList, m_incShowerSubtr);
-
-    std::vector<CaloVertexedClusterType> constituents;
-    for (auto pCluster : clusterList){
-      // correct cluster
-      if (pTau.vertexLink() && m_doVertexCorrection)
-	constituents.emplace_back (*pCluster, pTau.vertex()->position());
-      else
-        constituents.emplace_back (*pCluster);
+    StatusCode sc = tauRecTools::GetJetClusterList(jetSeed, clusterList, m_incShowerSubtr);
+
+    std::vector<TLorentzVector> clusterP4Vector;
+    for (const xAOD::CaloCluster* cluster : clusterList) {
+      TLorentzVector clusterP4 = tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+      clusterP4Vector.push_back(clusterP4);
     }
 
-    this->m_numConstit = (int) constituents.size();
+    this->m_numConstit = (int) clusterP4Vector.size();
 
     // Order constituents by energy
-    sort(constituents.begin(), constituents.end(), CaloClusterCompare());
+    sort(clusterP4Vector.begin(), clusterP4Vector.end(), CaloClusterCompare());
 
     //****************************************
     // Looping over all constituents
@@ -63,24 +63,16 @@ bool CaloClusterVariables::update(const xAOD::TauJet& pTau) {
     double sum_e = 0;
     double sum_of_E2 = 0;
     double sum_radii = 0;
-    TLorentzVector centroid = calculateTauCentroid(this->m_numConstit, constituents);
+    TLorentzVector centroid = calculateTauCentroid(this->m_numConstit, clusterP4Vector);
 
-    for (const CaloVertexedClusterType& c : constituents) {
-        double energy = c.e();
+    for (const TLorentzVector& clusterP4 : clusterP4Vector) {
+        double energy = clusterP4.E();
         sum_of_E2 += energy*energy;
 
-        double px = c.p4().Px();
-        double py = c.p4().Py();
-        double pz = c.p4().Pz();
-        // FF: phi is wrong in case px,py AND pz is negative when using HepLorentzVector(px,py,pz,1)
-        // because phi = atan(py/px)
-        // in trigger many clusters have negative energies/momentum
-        // negative values of px and py are only treated correctly if pz is positive.
-        // Otherwise px and py must be taken as positive values
-        // so using cluster eta/phi directly instead of creating a HLV.
-        //CLHEP::HepLorentzVector constituentHLV(px, py, pz, 1);
-        //sum_radii += centroid.deltaR(constituentHLV);
-        double dr = std::sqrt( std::pow(c.eta() - centroid.Eta(),2) + std::pow(c.phi() - centroid.Phi(),2));
+        double px = clusterP4.Px();
+        double py = clusterP4.Py();
+        double pz = clusterP4.Pz();
+        double dr = clusterP4.DeltaR(centroid);
         sum_radii += dr;
         sum_e += energy;
         sum_px += px;
@@ -122,18 +114,18 @@ bool CaloClusterVariables::update(const xAOD::TauJet& pTau) {
     sum_e = 0;
     sum_of_E2 = 0;
     sum_radii = 0;
-    centroid = calculateTauCentroid(this->m_effNumConstit_int, constituents);
+    centroid = calculateTauCentroid(this->m_effNumConstit_int, clusterP4Vector);
 
     int icount = this->m_effNumConstit_int;
-    for (const CaloVertexedClusterType& c : constituents) {
+    for (const TLorentzVector& clusterP4 : clusterP4Vector) {
       if (icount <= 0) break;
       --icount;
 
-        double energy = c.e();
-        double px = c.p4().Px();
-        double py = c.p4().Py();
-        double pz = c.p4().Pz();
-        double dr = std::sqrt( std::pow(c.eta() - centroid.Eta(),2) + std::pow(c.phi() - centroid.Phi(),2));
+        double energy = clusterP4.E();
+        double px = clusterP4.Px();
+        double py = clusterP4.Py();
+        double pz = clusterP4.Pz();
+        double dr = clusterP4.DeltaR(centroid);
         sum_radii += dr;
 
         sum_e += energy;
@@ -162,20 +154,20 @@ bool CaloClusterVariables::update(const xAOD::TauJet& pTau) {
 //***********************************************************
 // Calculate the geometrical center of the tau constituents
 //***********************************************************
-TLorentzVector CaloClusterVariables::calculateTauCentroid(int nConst, const std::vector<CaloVertexedClusterType>& constituents) {
+TLorentzVector CaloClusterVariables::calculateTauCentroid(int nConst, const std::vector<TLorentzVector>& clusterP4Vector) {
 
     double px = 0;
     double py = 0;
     double pz = 0;
     double current_px, current_py, current_pz, modulus;
 
-    for (const CaloVertexedClusterType& c : constituents) {
+    for (const TLorentzVector& clusterP4: clusterP4Vector) {
       if (nConst <= 0) break;
       --nConst;
-        current_px = c.p4().Px();
-        current_py = c.p4().Py();
-        current_pz = c.p4().Pz();
-        modulus = std::sqrt(current_px * current_px + current_py * current_py + current_pz * current_pz);
+        current_px = clusterP4.Px();
+        current_py = clusterP4.Py();
+        current_pz = clusterP4.Pz();
+        modulus = sqrt(current_px * current_px + current_py * current_py + current_pz * current_pz);
         px += current_px / modulus;
         py += current_py / modulus;
         pz += current_pz / modulus;
diff --git a/Reconstruction/tauRecTools/Root/HelperFunctions.cxx b/Reconstruction/tauRecTools/Root/HelperFunctions.cxx
index 0a0af34dfb98..354236c3b8a1 100644
--- a/Reconstruction/tauRecTools/Root/HelperFunctions.cxx
+++ b/Reconstruction/tauRecTools/Root/HelperFunctions.cxx
@@ -2,7 +2,6 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-// local include(s)
 #include "tauRecTools/HelperFunctions.h"
 
 #include <TObjString.h>
@@ -148,74 +147,55 @@ std::unique_ptr<MVAUtils::BDT> tauRecTools::configureMVABDT(std::vector<TString>
 }
 
 
-//________________________________________________________________________________
-const StatusCode tauRecTools::GetJetClusterList(const xAOD::Jet* jet, std::vector<const xAOD::CaloCluster*> &clusterList, bool incShowerSubtracted, TLorentzVector dRVector, double dRCut){
 
+const StatusCode tauRecTools::GetJetClusterList(const xAOD::Jet* jet, std::vector<const xAOD::CaloCluster*> &clusterList, bool incShowerSubtracted) {
   using namespace tauRecTools::msgHelperFunction;
+
   // If using subtracted clusters, need to store unmodified to check if charged are duplicates
   std::vector<const xAOD::CaloCluster*> dupList;
 
   // Loop over jet constituents
-  xAOD::JetConstituentVector jVec = jet->getConstituents();
-  for(auto jCon : jVec){
+  xAOD::JetConstituentVector constituents = jet->getConstituents();
+  for(const xAOD::JetConstituent* constituent : constituents){
     ANA_MSG_DEBUG("JetConstituent: ");
-    ANA_MSG_DEBUG("eta: " << jCon->eta() << " phi: " << jCon->phi() << " e: " << jCon->e()); 
-
-    // do deltaR check against jet constituent
-    bool PassdR = true;
-    if (dRCut > 0){
-      TLorentzVector tempClusterVector;
-      tempClusterVector.SetPtEtaPhiE( jCon->pt(), jCon->eta(), jCon->phi(), jCon->e() );
-      ANA_MSG_DEBUG("Apply dR cut on JetConstituent: " << dRCut );
-      ANA_MSG_DEBUG("JetConstituent Pt: " << tempClusterVector.Pt() << ", Eta: " << tempClusterVector.Eta() << ", Phi: " << tempClusterVector.Phi());
-      ANA_MSG_DEBUG("dR " << dRVector.DeltaR(tempClusterVector));
-      if (dRVector.DeltaR(tempClusterVector) > dRCut){
-	ANA_MSG_DEBUG("Failed dR Cut ");
-	PassdR = false;
-      }
-    }
+    ANA_MSG_DEBUG("eta: " << constituent->eta() << " phi: " << constituent->phi() << " e: " << constituent->e()); 
 
-    if (PassdR){
-      if( jCon->type() == xAOD::Type::CaloCluster ) {
-	const xAOD::CaloCluster* cluster = static_cast<const xAOD::CaloCluster*>( jCon->rawConstituent() );
-	ANA_MSG_DEBUG("CaloCluster: ");
-	ANA_MSG_DEBUG("eta: " << cluster->eta() << " phi: " << cluster->phi() << " e: " << cluster->e());
-	ANA_MSG_DEBUG("rawEta: " << cluster->rawEta() << " rawPhi: " << cluster->rawPhi() << " rawE: " << cluster->rawE());
-	ANA_MSG_DEBUG("calEta: " << cluster->calEta() << " calPhi: " << cluster->calPhi() << " calE: " << cluster->calE());
+    if( constituent->type() == xAOD::Type::CaloCluster ) {
+	  const xAOD::CaloCluster* cluster = static_cast<const xAOD::CaloCluster*>( constituent->rawConstituent() );
+	  ANA_MSG_DEBUG("CaloCluster: ");
+	  ANA_MSG_DEBUG("eta: " << cluster->eta() << " phi: " << cluster->phi() << " e: " << cluster->e());
 
-	clusterList.push_back(cluster);
+	  clusterList.push_back(cluster);
+    }
+    else if ( constituent->type() == xAOD::Type::ParticleFlow ) {
+	  const xAOD::PFO* pfo = static_cast<const xAOD::PFO*>( constituent->rawConstituent() );
+	  
+      if (pfo->isCharged()) continue;
+	  if (pfo->nCaloCluster()!=1){
+	    ANA_MSG_WARNING("Neutral PFO has " << std::to_string(pfo->nCaloCluster()) << " clusters, expected exactly 1!\n");
+        continue;
       }
-      else if( jCon->type() == xAOD::Type::ParticleFlow ) {
-	const xAOD::PFO* pfo = static_cast<const xAOD::PFO*>( jCon->rawConstituent() );
-	if( !pfo->isCharged() ){
-	  if( pfo->nCaloCluster()==1 ){
-
-	    if (incShowerSubtracted){
-	      ElementLink<xAOD::CaloClusterContainer> subClusLink;
-	      pfo->attribute("PFOShowerSubtractedClusterLink", subClusLink);
-	      if ( !subClusLink.isValid() ){
-		ANA_MSG_ERROR("Tau HelperFunctions: Found invalid link to shower subtracted cluster");
-		return StatusCode::FAILURE;
-	      }
-	      else {
-		clusterList.push_back( (*subClusLink) );
-		dupList.push_back( pfo->cluster(0) );
-	      }
+
+	  if (incShowerSubtracted){
+	    ElementLink<xAOD::CaloClusterContainer> subClusLink;
+	    pfo->attribute("PFOShowerSubtractedClusterLink", subClusLink);
+	    if ( !subClusLink.isValid() ){
+	      ANA_MSG_ERROR("Tau HelperFunctions: Found invalid link to shower subtracted cluster");
+	      return StatusCode::FAILURE;
 	    }
 	    else {
-	      clusterList.push_back(pfo->cluster(0));
+	      clusterList.push_back( (*subClusLink) );
+	      dupList.push_back( pfo->cluster(0) );
 	    }
-
 	  }
-	  else ANA_MSG_WARNING("Neutral PFO has " << std::to_string(pfo->nCaloCluster()) << " clusters, expected exactly 1!\n");
-
-	}// neutral PFO check
-      }
-      else{
-	ANA_MSG_ERROR("GetJetConstCluster: Seed jet constituent type not supported!");
-	return StatusCode::FAILURE;
-      }
-    }// dR check
+	  else {
+	    clusterList.push_back(pfo->cluster(0));
+	  }
+	}
+    else {
+	  ANA_MSG_ERROR("GetJetConstCluster: Seed jet constituent type not supported!");
+	  return StatusCode::FAILURE;
+    }
   }
 
   // Get clusters from charged PFOs
@@ -223,41 +203,21 @@ const StatusCode tauRecTools::GetJetClusterList(const xAOD::Jet* jet, std::vecto
   if (incShowerSubtracted) checkList = dupList;
   else checkList = clusterList;
 
-  for(auto jCon : jVec){
-
-    if( jCon->type() == xAOD::Type::ParticleFlow ) {
-
-      bool PassdR = true;
-      if (dRCut > 0){
-	TLorentzVector tempClusterVector;
-	tempClusterVector.SetPtEtaPhiE( jCon->pt(), jCon->eta(), jCon->phi(), jCon->e() );
-	ANA_MSG_DEBUG("Apply dR cut on JetConstituent: " << dRCut );
-	ANA_MSG_DEBUG("JetConstituent Pt: " << tempClusterVector.Pt() << ", Eta: " << tempClusterVector.Eta() << ", Phi: " << tempClusterVector.Phi());
-	ANA_MSG_DEBUG("dR " << dRVector.DeltaR(tempClusterVector));
-	if (dRVector.DeltaR(tempClusterVector) > dRCut){
-	  ANA_MSG_DEBUG("Failed dR Cut ");
-	  PassdR = false;
-	}
-      }
-
-      if (PassdR){
-	const xAOD::PFO* pfo = static_cast<const xAOD::PFO*>( jCon->rawConstituent() );
-	if( pfo->isCharged() ){
-
-	  // loop through clusters linked to charged PFO
-	  for (u_int cc=0; cc<pfo->nCaloCluster(); cc++){
-	    const xAOD::CaloCluster* cluster = pfo->cluster(cc);
-	    // check it is not duplicate of one in neutral list
-	    if ( std::find(checkList.begin(), checkList.end(), cluster) == checkList.end() ){
-	      clusterList.push_back(cluster);
-	      checkList.push_back(cluster);
-	    }
+  for (const xAOD::JetConstituent* constituent : constituents){
+    if ( constituent->type() != xAOD::Type::ParticleFlow ) break;
+	
+    const xAOD::PFO* pfo = static_cast<const xAOD::PFO*>( constituent->rawConstituent() );
+	if (! pfo->isCharged()) continue;
+
+	for (u_int index=0; index<pfo->nCaloCluster(); index++){
+	  const xAOD::CaloCluster* cluster = pfo->cluster(index);
+	  // check it is not duplicate of one in neutral list
+	  if ( std::find(checkList.begin(), checkList.end(), cluster) == checkList.end() ) {
+	    clusterList.push_back(cluster);
+	    checkList.push_back(cluster);
 	  }
-
 	}
-      }// dR check
-    }
-  }// loop through jet constituents
+  }
 
   return StatusCode::SUCCESS;
 }
diff --git a/Reconstruction/tauRecTools/Root/LinkDef.h b/Reconstruction/tauRecTools/Root/LinkDef.h
index 2861a22edbf6..9078305d9444 100644
--- a/Reconstruction/tauRecTools/Root/LinkDef.h
+++ b/Reconstruction/tauRecTools/Root/LinkDef.h
@@ -17,6 +17,7 @@
 #include "tauRecTools/TauIDVarCalculator.h"
 #include "tauRecTools/TauJetRNNEvaluator.h"
 #include "tauRecTools/TauDecayModeNNClassifier.h"
+#include "tauRecTools/TauVertexCorrection.h"
 
 #ifdef __CINT__
 
@@ -42,5 +43,7 @@
 #pragma link C++ class TauIDVarCalculator+;
 #pragma link C++ class TauJetRNNEvaluator+;
 #pragma link C++ class TauDecayModeNNClassifier+;
+#pragma link C++ class ITauVertexCorrection+;
+#pragma link C++ class TauVertexCorrection+;
 
 #endif
diff --git a/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx b/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx
index e109b2cac42c..07f56f54b077 100644
--- a/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx
+++ b/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx
@@ -24,9 +24,9 @@ MvaTESVariableDecorator::~MvaTESVariableDecorator() {
 
 StatusCode MvaTESVariableDecorator::initialize() {
 
-  ATH_CHECK( m_aveIntPerXKey.initialize() );
-
-  ATH_CHECK( m_vertexInputContainer.initialize(!m_vertexInputContainer.key().empty()) );
+  ATH_CHECK(m_tauVertexCorrection.retrieve()); 
+  ATH_CHECK(m_aveIntPerXKey.initialize());
+  ATH_CHECK(m_vertexContainerKey.initialize(SG::AllowEmpty));
   
   return StatusCode::SUCCESS;
 }
@@ -46,9 +46,9 @@ StatusCode MvaTESVariableDecorator::execute(xAOD::TauJet& xTau) const {
   } 
 
   int nVtxPU = 0;
-  if(!m_vertexInputContainer.key().empty()) {
+  if(!m_vertexContainerKey.empty()) {
     // Get the primary vertex container from StoreGate
-    SG::ReadHandle<xAOD::VertexContainer> vertexInHandle( m_vertexInputContainer );
+    SG::ReadHandle<xAOD::VertexContainer> vertexInHandle( m_vertexContainerKey );
     if (!vertexInHandle.isValid()) {
       ATH_MSG_WARNING ("Could not retrieve HiveDataObj with key " << vertexInHandle.key() << ", will set nVtxPU=0.");
     }
@@ -68,8 +68,6 @@ StatusCode MvaTESVariableDecorator::execute(xAOD::TauJet& xTau) const {
   acc_nVtxPU(xTau) = nVtxPU;
 
   // Decorate jet seed variables
-  const xAOD::Jet* jet_seed = xTau.jet();
-  
   double center_lambda=0.       , first_eng_dens=0.      , em_probability=0.      , second_lambda=0.      ;
   double mean_center_lambda=0.  , mean_first_eng_dens=0. , mean_em_probability=0. , mean_second_lambda=0. ;
   double mean_presampler_frac=0., lead_cluster_frac = 0. ;
@@ -80,42 +78,56 @@ StatusCode MvaTESVariableDecorator::execute(xAOD::TauJet& xTau) const {
   clusters_EM_P4.SetPtEtaPhiM(0,0,0,0);
   TLorentzVector clusters_had_P4;
   clusters_had_P4.SetPtEtaPhiM(0,0,0,0);
+ 
+  if (! xTau.jetLink().isValid()) {
+    ATH_MSG_ERROR("Tau jet link is invalid.");
+    return StatusCode::FAILURE;
+  }
+  const xAOD::Jet *jetSeed = xTau.jet();
+  
+  const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed); 
+
+  const xAOD::Vertex* tauVertex = nullptr;
+  if (xTau.vertexLink().isValid()) tauVertex = xTau.vertex();
 
-  const TLorentzVector& LC_P4 = xTau.p4(xAOD::TauJetParameters::DetectorAxis);
+  TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(xTau);
 
   // Loop through jets, get links to clusters
   std::vector<const xAOD::CaloCluster*> clusterList;
-  ATH_CHECK(tauRecTools::GetJetClusterList(jet_seed, clusterList, m_incShowerSubtr, LC_P4, 0.2));
+  ATH_CHECK(tauRecTools::GetJetClusterList(jetSeed, clusterList, m_incShowerSubtr));
 
   // Loop through clusters and jet constituents
-  for (auto cl : clusterList){
+  for (const xAOD::CaloCluster* cluster : clusterList){
+    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+  
+    if (clusterP4.DeltaR(tauAxis) > 0.2) continue;
 
-    clE = cl->calE();
+    clE = cluster->calE();
     Etot += clE;
 
     if(clE>lead_cluster_frac) lead_cluster_frac = clE;
 
-    if(cl->retrieveMoment(xAOD::CaloCluster::MomentType::CENTER_LAMBDA,center_lambda))
+    if(cluster->retrieveMoment(xAOD::CaloCluster::MomentType::CENTER_LAMBDA,center_lambda))
       mean_center_lambda += clE*center_lambda;
     else ATH_MSG_WARNING("Failed to retrieve moment: CENTER_LAMBDA");
 
-    if(cl->retrieveMoment(xAOD::CaloCluster::MomentType::FIRST_ENG_DENS,first_eng_dens))
+    if(cluster->retrieveMoment(xAOD::CaloCluster::MomentType::FIRST_ENG_DENS,first_eng_dens))
       mean_first_eng_dens += clE*first_eng_dens;
     else ATH_MSG_WARNING("Failed to retrieve moment: FIRST_ENG_DENS");
 
-    if(cl->retrieveMoment(xAOD::CaloCluster::MomentType::EM_PROBABILITY,em_probability)) {
+    if(cluster->retrieveMoment(xAOD::CaloCluster::MomentType::EM_PROBABILITY,em_probability)) {
       mean_em_probability += clE*em_probability;
 
-      if(em_probability>0.5) clusters_EM_P4 += cl->p4(xAOD::CaloCluster::State::CALIBRATED);      
-      else clusters_had_P4 += cl->p4(xAOD::CaloCluster::State::CALIBRATED);
+      if(em_probability>0.5) clusters_EM_P4 += cluster->p4(xAOD::CaloCluster::State::CALIBRATED);      
+      else clusters_had_P4 += cluster->p4(xAOD::CaloCluster::State::CALIBRATED);
     }
     else ATH_MSG_WARNING("Failed to retrieve moment: EM_PROBABILITY");
 
-    if(cl->retrieveMoment(xAOD::CaloCluster::MomentType::SECOND_LAMBDA,second_lambda))
+    if(cluster->retrieveMoment(xAOD::CaloCluster::MomentType::SECOND_LAMBDA,second_lambda))
       mean_second_lambda += clE*second_lambda;
     else ATH_MSG_WARNING("Failed to retrieve moment: SECOND_LAMBDA");
 
-    mean_presampler_frac += (cl->eSample(CaloSampling::PreSamplerB) + cl->eSample(CaloSampling::PreSamplerE));
+    mean_presampler_frac += (cluster->eSample(CaloSampling::PreSamplerB) + cluster->eSample(CaloSampling::PreSamplerE));
   }
   
   // ----calculate mean values
@@ -154,7 +166,7 @@ StatusCode MvaTESVariableDecorator::execute(xAOD::TauJet& xTau) const {
 
   // ----retrieve Ghost Muon Segment Count (for punch-through studies)
   int nMuSeg=0;
-  if(!jet_seed->getAttribute<int>("GhostMuonSegmentCount", nMuSeg)) nMuSeg=0;
+  if(!jetSeed->getAttribute<int>("GhostMuonSegmentCount", nMuSeg)) nMuSeg=0;
   xTau.setDetail(xAOD::TauJetParameters::GhostMuonSegmentCount, nMuSeg);
   
   // ----summing corrected Pi0 PFO energies
diff --git a/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
index fcddc9dc877a..614cfe0d6232 100644
--- a/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
+++ b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
@@ -26,8 +26,14 @@ TauIDVarCalculator::TauIDVarCalculator(const std::string& name):
   declareProperty("IncShowerSubtr", m_incShowerSubtr);
 }
 
+StatusCode TauIDVarCalculator::initialize()
+{  
+  ATH_CHECK(m_tauVertexCorrection.retrieve()); 
+  return StatusCode::SUCCESS;
+}
+
 StatusCode TauIDVarCalculator::execute(xAOD::TauJet& tau) const
-{ 
+{
   static const SG::AuxElement::Accessor<float> acc_absipSigLeadTrk("absipSigLeadTrk");
   float ipSigLeadTrk=0.;
   if(!tau.detail(xAOD::TauJetParameters::ipSigLeadTrk, ipSigLeadTrk))
@@ -75,33 +81,37 @@ StatusCode TauIDVarCalculator::execute(xAOD::TauJet& tau) const
   std::vector<CaloSampling::CaloSample> Had1Samps = { 
         CaloSampling::HEC0, CaloSampling::TileBar0, CaloSampling::TileGap1, CaloSampling::TileExt0};
 
-  // Get Clusters via Jet Seed 
-  const xAOD::Jet *jetSeed = tau.jet();
-  if (!jetSeed) {
+  if (! tau.jetLink().isValid()) {
     ATH_MSG_ERROR("Tau jet link is invalid.");
     return StatusCode::FAILURE;
-  } 
+  }
+  const xAOD::Jet *jetSeed = tau.jet();
+  
+  const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+  
+  const xAOD::Vertex* tauVertex = nullptr;
+  if (tau.vertexLink().isValid()) tauVertex = tau.vertex();
+  
+  TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(tau);
 
-  const TLorentzVector& p4IntAxis = tau.p4(xAOD::TauJetParameters::IntermediateAxis);
+  std::vector<const xAOD::CaloCluster*> clusterList;
+  ATH_CHECK(tauRecTools::GetJetClusterList(jetSeed, clusterList, m_incShowerSubtr));
+  
   float eEMAtEMScaleFixed = 0.;
   float eHadAtEMScaleFixed = 0.;
   float eHad1AtEMScaleFixed = 0.;
 
-  // Loop through jets, get links to clusters
-  std::vector<const xAOD::CaloCluster*> clusterList;
-  ATH_CHECK(tauRecTools::GetJetClusterList(jetSeed, clusterList, m_incShowerSubtr));
-
-  for( auto cl : clusterList){
+  for (const xAOD::CaloCluster* cluster  : clusterList) {
+    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
     
-    // Only take clusters with dR<0.2 w.r.t IntermediateAxis
-    if( p4IntAxis.DeltaR(cl->p4(xAOD::CaloCluster::UNCALIBRATED)) > 0.2 ) continue;
+    if( tauAxis.DeltaR(clusterP4) > 0.2 ) continue;
     
     for( auto samp : EMSamps )
-      eEMAtEMScaleFixed += cl->eSample(samp);
+      eEMAtEMScaleFixed += cluster->eSample(samp);
     for( auto samp : HadSamps )
-      eHadAtEMScaleFixed += cl->eSample(samp);
+      eHadAtEMScaleFixed += cluster->eSample(samp);
     for( auto samp : Had1Samps )
-      eHad1AtEMScaleFixed += cl->eSample(samp);  
+      eHad1AtEMScaleFixed += cluster->eSample(samp);  
   }
   acc_EMFracFixed(tau) = ( eEMAtEMScaleFixed + eHadAtEMScaleFixed ) != 0. ? 
       eEMAtEMScaleFixed / ( eEMAtEMScaleFixed + eHadAtEMScaleFixed ) : LOW_NUMBER;
diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx
index bfa52f0a8e03..82ac97fe9ca8 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx
@@ -3,12 +3,13 @@
 */
 
 #include "tauRecTools/TauJetRNNEvaluator.h"
+#include "tauRecTools/TauJetRNN.h"
+#include "tauRecTools/HelperFunctions.h"
+
+#include "PathResolver/PathResolver.h"
 
 #include <algorithm>
 
-#include "PathResolver/PathResolver.h"
-#include "tauRecTools/TauJetRNN.h"
-#include "tauRecTools/HelperFunctions.h"
 
 TauJetRNNEvaluator::TauJetRNNEvaluator(const std::string &name): 
     TauRecToolBase(name),
@@ -38,6 +39,8 @@ TauJetRNNEvaluator::~TauJetRNNEvaluator() {}
 
 StatusCode TauJetRNNEvaluator::initialize() {
     ATH_MSG_INFO("Initializing TauJetRNNEvaluator");
+  
+    ATH_CHECK(m_tauVertexCorrection.retrieve()); 
 
     std::string weightfile_0p("");
     std::string weightfile_1p("");
@@ -177,23 +180,34 @@ StatusCode TauJetRNNEvaluator::get_tracks(
 StatusCode TauJetRNNEvaluator::get_clusters(
     const xAOD::TauJet &tau, std::vector<const xAOD::CaloCluster *> &out) const {
 
-    const xAOD::Jet *jet_seed = tau.jet();
-    if (!jet_seed) {
+    if (! tau.jetLink().isValid()) {
         ATH_MSG_ERROR("Tau jet link is invalid.");
         return StatusCode::FAILURE;
     }
+    const xAOD::Jet *jetSeed = tau.jet();
+    
+    const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+    
+    const xAOD::Vertex* tauVertex = nullptr;
+    if (tau.vertexLink().isValid()) tauVertex = tau.vertex();
+    
+    TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(tau);
 
     std::vector<const xAOD::CaloCluster*> clusters;
-    ATH_CHECK(tauRecTools::GetJetClusterList(jet_seed, clusters, m_incShowerSubtr));
+    ATH_CHECK(tauRecTools::GetJetClusterList(jetSeed, clusters, m_incShowerSubtr));
 
     // remove clusters that do not meet dR requirement
     auto cItr = clusters.begin();
     while( cItr != clusters.end() ){
-      const auto lc_p4 = tau.p4(xAOD::TauJetParameters::DetectorAxis);
-      if (lc_p4.DeltaR((*cItr)->p4()) > m_max_cluster_dr) {
+      const xAOD::CaloCluster* cluster = (*cItr);
+      TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+
+      if (tauAxis.DeltaR(clusterP4) > m_max_cluster_dr) {
         clusters.erase(cItr);
       }
-      else ++cItr;
+      else {
+        ++cItr;
+      }
     }
 
     // Sort by descending et
diff --git a/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx b/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx
index 05437d8655be..5fdc7a493676 100644
--- a/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx
+++ b/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx
@@ -23,44 +23,33 @@
 #define GeV 1000
 const float TauSubstructureVariables::DEFAULT = -1111.;
 
-//**********************************
-// Constructor
-//**********************************
+
 
 TauSubstructureVariables::TauSubstructureVariables( const std::string& name )
   : TauRecToolBase(name) {
-  declareProperty("VertexCorrection", m_doVertexCorrection = false);
   declareProperty("IncShowerSubtr", m_incShowerSubtr = true);
 }
 
-//**********************************
-// Destructor
-//**********************************
+
 
 TauSubstructureVariables::~TauSubstructureVariables() {
 }
 
-//************************************
-// Execute method
-//************************************
 
-StatusCode TauSubstructureVariables::execute(xAOD::TauJet& pTau) const {
 
-  const xAOD::Jet* taujetseed = pTau.jet();
-  if (!taujetseed) {
-    ATH_MSG_ERROR("Tau jet link is invalid.");
-    return StatusCode::FAILURE;
-  } 
+StatusCode TauSubstructureVariables::initialize() {
+  ATH_CHECK(m_tauVertexCorrection.retrieve()); 
+  return StatusCode::SUCCESS;
+}
+
 
-  //*****************************************************
-  // calculate some tau substructure variables
-  //*****************************************************
+
+StatusCode TauSubstructureVariables::execute(xAOD::TauJet& pTau) const {
 
   CaloClusterVariables CaloClusterVariablesTool;
-  CaloClusterVariablesTool.setVertexCorrection(m_doVertexCorrection);
   CaloClusterVariablesTool.setIncSub(m_incShowerSubtr);
 
-  bool isFilled = CaloClusterVariablesTool.update(pTau);
+  bool isFilled = CaloClusterVariablesTool.update(pTau, m_tauVertexCorrection);
 
   if (!isFilled) {
     ATH_MSG_DEBUG("problem in calculating calo cluster variables -> will be set to -1111");
@@ -95,50 +84,49 @@ StatusCode TauSubstructureVariables::execute(xAOD::TauJet& pTau) const {
   double clusELead = DEFAULT;
   double clusESubLead = DEFAULT;
 
-  // Loop through jets, get links to clusters
-  std::vector<const xAOD::CaloCluster*> vClusters;
-  ATH_CHECK(tauRecTools::GetJetClusterList(taujetseed, vClusters, m_incShowerSubtr));
+  if (! pTau.jetLink().isValid()) {
+    ATH_MSG_ERROR("Tau jet link is invalid.");
+    return StatusCode::FAILURE;
+  }
+  const xAOD::Jet *jetSeed = pTau.jet();
+  
+  const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+  
+  const xAOD::Vertex* tauVertex = nullptr;
+  if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
 
-  for (auto incluster : vClusters){
+  TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(pTau);
 
-    // calc total energy
-    totalEnergy += incluster->e();
+  std::vector<const xAOD::CaloCluster*> vClusters;
+  ATH_CHECK(tauRecTools::GetJetClusterList(jetSeed, vClusters, m_incShowerSubtr));
+  
+  for (auto cluster : vClusters){
+    totalEnergy += cluster->e();
 		
-    //apply Vertex correction on a temporary
-    TLorentzVector tempclusvec;
-    if (m_doVertexCorrection && pTau.vertexLink())
-      tempclusvec = CaloVertexedClusterType(*incluster, pTau.vertex()->position()).p4();
-    else
-      tempclusvec = CaloVertexedClusterType(*incluster).p4();
-
-    dr = pTau.p4().DeltaR(tempclusvec);
-    if (0.2 <= dr && dr < 0.4) 
-      {
-	calo_iso += tempclusvec.Et();
-      }
-    else if (dr < 0.2)
-      {
-	double clusEnergyBE = ( incluster->energyBE(0) + incluster->energyBE(1) + incluster->energyBE(2) );
+    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+    dr = tauAxis.DeltaR(clusterP4);    
+    
+    if (0.2 <= dr && dr < 0.4) {
+	  calo_iso += clusterP4.Et();
+    }
+    else if (dr < 0.2) {
+	  double clusEnergyBE = ( cluster->energyBE(0) + cluster->energyBE(1) + cluster->energyBE(2) );
 		    
-	if (clusEnergyBE > clusELead) 
-	  {
+	  if (clusEnergyBE > clusELead) {
 	    //change current leading cluster to subleading
 	    clusESubLead = clusELead;
 	    subLeadClusVec = leadClusVec;
 
 	    //set energy and 4-vector of leading cluster
 	    clusELead = clusEnergyBE;
-	    leadClusVec.SetPtEtaPhiM(clusELead/std::cosh(tempclusvec.Eta()), tempclusvec.Eta(), tempclusvec.Phi(), 0.);
+	    leadClusVec.SetPtEtaPhiM(clusELead/std::cosh(clusterP4.Eta()), clusterP4.Eta(), clusterP4.Phi(), 0.);
 	  }
-	else if (clusEnergyBE > clusESubLead) 
-	  {
+	  else if (clusEnergyBE > clusESubLead) {
 	    //set energy and 4-vector of subleading cluster only
 	    clusESubLead = clusEnergyBE;
-	    subLeadClusVec.SetPtEtaPhiM(clusESubLead/std::cosh(tempclusvec.Eta()), tempclusvec.Eta(), tempclusvec.Phi(), 0.);
+	    subLeadClusVec.SetPtEtaPhiM(clusESubLead/std::cosh(clusterP4.Eta()), clusterP4.Eta(), clusterP4.Phi(), 0.);
 	  }
-
-      }
-		
+    }	
   }
 
   if (clusELead > 0.) {
@@ -219,7 +207,7 @@ StatusCode TauSubstructureVariables::execute(xAOD::TauJet& pTau) const {
     float dR = 0.;
 
     for (size_t i=0; i < numTrack; ++i) {
-      dR = pTau.track(i)->p4().DeltaR(pTau.p4());
+      dR = pTau.track(i)->p4().DeltaR(tauAxis);
       if (dR > dRmax) dRmax = dR;
     }
     pTau.setDetail(xAOD::TauJetParameters::dRmax, dRmax);
diff --git a/Reconstruction/tauRecTools/Root/TauVertexCorrection.cxx b/Reconstruction/tauRecTools/Root/TauVertexCorrection.cxx
new file mode 100644
index 000000000000..56365e41b8df
--- /dev/null
+++ b/Reconstruction/tauRecTools/Root/TauVertexCorrection.cxx
@@ -0,0 +1,218 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "tauRecTools/TauVertexCorrection.h"
+
+#include "xAODCaloEvent/CaloVertexedTopoCluster.h"
+
+TauVertexCorrection::TauVertexCorrection(const std::string& name):
+  asg::AsgTool(name) {
+  declareProperty("SeedJet", m_seedJet = ""); 
+  declareProperty("VertexCorrection", m_doVertexCorrection = true);
+  declareProperty("JetVertexCorrection", m_doJetVertexCorrection = true);
+}
+
+
+
+StatusCode TauVertexCorrection::initialize() {  
+ 
+  ATH_MSG_INFO("in initialize");
+
+  if (m_seedJet == "AntiKt4LCTopoJets") {
+    m_isPFO = false;
+    m_isEMScale = false;
+  }
+  else if (m_seedJet == "AntiKt4EMPFlowJets") {
+    m_isPFO = true;
+    m_isEMScale = true;
+  }
+  else {
+    ATH_MSG_ERROR("Seed jet " << m_seedJet << " not supported !");
+    return StatusCode::FAILURE;
+  }
+
+  ATH_MSG_INFO("VertexCorrection: " << m_doVertexCorrection);
+  ATH_MSG_INFO("JetVertexCorrection: " << m_doJetVertexCorrection);
+  ATH_MSG_INFO("SeedJet: " <<  m_seedJet);
+  ATH_MSG_INFO("PFO: " << m_isPFO);
+  ATH_MSG_INFO("EMScale: " << m_isEMScale);
+
+  return StatusCode::SUCCESS;
+}
+
+
+  
+const xAOD::Vertex* TauVertexCorrection::getJetVertex(const xAOD::Jet& jet) const {
+  
+  const xAOD::Vertex* jetVertex = nullptr;
+  
+  if (m_doJetVertexCorrection) {
+    bool isAvailable = jet.getAssociatedObject("OriginVertex", jetVertex);
+    if (!isAvailable) {
+      ATH_MSG_WARNING("OriginVertex not available !");
+      jetVertex = nullptr;
+    }
+  }
+
+  return jetVertex;
+}
+
+
+
+TLorentzVector TauVertexCorrection::getTauAxis(const xAOD::TauJet& tau) const {
+  TLorentzVector tauAxis;
+  if (m_doVertexCorrection) {
+    tauAxis = tau.p4(xAOD::TauJetParameters::IntermediateAxis);
+  }
+  else {
+    tauAxis = tau.p4(xAOD::TauJetParameters::DetectorAxis);
+  }
+
+  return tauAxis;
+}
+
+
+
+TLorentzVector TauVertexCorrection::getVertexCorrectedP4(const xAOD::CaloCluster& cluster,
+                                                 const Amg::Vector3D& position) const {
+  
+  TLorentzVector vertexCorrectedP4 = xAOD::CaloVertexedTopoCluster(cluster, position).p4();
+  
+  ATH_MSG_DEBUG("Cluster: " << &cluster);
+  ATH_MSG_DEBUG("Original cluster four momentum, pt: " << cluster.pt() << 
+                " eta: " << cluster.eta() << " phi: " << cluster.phi() << " e: " << cluster.e());
+  ATH_MSG_DEBUG("Vertex corrected four momentum, pt: " << vertexCorrectedP4.Pt() << 
+                " eta: " << vertexCorrectedP4.Eta() << " phi: " << vertexCorrectedP4.Phi() << " e: " << vertexCorrectedP4.E());
+
+  return vertexCorrectedP4;
+} 
+
+
+
+TLorentzVector TauVertexCorrection::getVertexCorrectedP4(const xAOD::PFO& pfo,
+                                                 const Amg::Vector3D& position) const {
+  TLorentzVector vertexCorrectedP4;
+  
+  if (!pfo.isCharged()) {
+    TVector3 pos(position.x(), position.y(), position.z()); 
+
+    if (m_isEMScale) {
+      vertexCorrectedP4 = pfo.GetVertexCorrectedEMFourVec(pos); 
+    }
+    else {
+      vertexCorrectedP4 = pfo.GetVertexCorrectedFourVec(pos);
+    }
+  }
+  else {
+    vertexCorrectedP4 = pfo.p4();  
+  }
+  
+  if (m_isEMScale) {
+    ATH_MSG_DEBUG("Original pfo four momentum, pt: " << pfo.ptEM() << 
+                  " eta: " << pfo.etaEM() << " phi: " << pfo.phiEM() << " e: " << pfo.eEM());
+  }
+  else {
+    ATH_MSG_DEBUG("Original pfo four momentum, pt: " << pfo.pt() << 
+                  " eta: " << pfo.eta() << " phi: " << pfo.phi() << " e: " << pfo.e());
+  }
+
+  ATH_MSG_DEBUG("Vertex corrected four momentum, pt: " << vertexCorrectedP4.Pt() << 
+                " eta: " << vertexCorrectedP4.Eta() << " phi: " << vertexCorrectedP4.Phi() << " e: " << vertexCorrectedP4.E());
+
+  return vertexCorrectedP4;
+} 
+
+
+
+TLorentzVector TauVertexCorrection::getVertexCorrectedP4(const xAOD::CaloCluster& cluster, 
+                                                    const xAOD::Vertex* tauVertex,
+                                                    const xAOD::Vertex* jetVertex) const { 
+  TLorentzVector vertexCorrectedP4 = cluster.p4();
+  Amg::Vector3D position;
+
+  // In jet reconstruction:
+  // Clusters in Topo jets are corrected to point at PV0 when m_doJetVertexCorrection is true
+  // Clusters in PFlow jets are not corrected in jet reconstruction 
+  // In tau reconstruction:
+  // If we want to do the vertex correction using tau vertexs, use the position of the tau vertex 
+  // for PFlow jets, while the relative position of the tau vertex and default vertex for Topo jets
+  // If not, use the default vertex to correct clusters from PFlow jets 
+  if (m_doVertexCorrection) {
+    if (m_isPFO) { // use the position of tau vertex 
+      if (tauVertex) {
+        position = tauVertex->position();
+        vertexCorrectedP4 = getVertexCorrectedP4(cluster, position);
+      }
+    }
+    else { // use the relative position of tau vertex and default vertex
+      if (tauVertex && tauVertex != jetVertex) {         
+        position = tauVertex->position();
+        if (m_doJetVertexCorrection && jetVertex) {
+          position -= jetVertex->position();
+        }
+        vertexCorrectedP4 = getVertexCorrectedP4(cluster, position);
+      }
+    }
+  }
+  else if (m_doJetVertexCorrection && m_isPFO) { // use the position of default vertex
+    if (jetVertex) {
+      position = jetVertex->position();
+      vertexCorrectedP4 = getVertexCorrectedP4(cluster, position);
+    }
+  }
+  
+  return vertexCorrectedP4;
+}
+
+
+
+TLorentzVector TauVertexCorrection::getVertexCorrectedP4(const xAOD::PFO& pfo,
+                                                    const xAOD::Vertex* tauVertex,
+                                                    const xAOD::Vertex* jetVertex) const {
+  TLorentzVector vertexCorrectedP4 = pfo.p4();
+  Amg::Vector3D position;
+
+  // In jet reconstruction:
+  // PFOs are corrected to point at PV0 when m_doJetVertexCorrection is true
+  
+  // In tau reconstruction:
+  // If we want to do the vertex correction using tau vertexs, use the relative position 
+  // of the tau vertex and default vertex
+  
+  if (m_doVertexCorrection) {
+    // use the relative position of tau vertex and default vertex
+    if (tauVertex) {         
+      position = tauVertex->position();
+      if (m_doJetVertexCorrection && jetVertex) {
+        position -= jetVertex->position();
+      }
+      vertexCorrectedP4 = getVertexCorrectedP4(pfo, position);
+    }
+  }
+  
+  return vertexCorrectedP4;
+}
+
+
+
+TLorentzVector TauVertexCorrection::getVertexCorrectedP4(const xAOD::JetConstituent& constituent,
+                                                    const xAOD::Vertex* tauVertex,
+                                                    const xAOD::Vertex* jetVertex) const {
+  TLorentzVector vertexCorrectedP4;
+  
+  if (constituent.type() == xAOD::Type::CaloCluster) {
+	const xAOD::CaloCluster* cluster = static_cast<const xAOD::CaloCluster*>( constituent.rawConstituent() );
+    vertexCorrectedP4 = getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
+  }
+  else if (constituent.type() == xAOD::Type::ParticleFlow) {
+	const xAOD::PFO* pfo = static_cast<const xAOD::PFO*>( constituent.rawConstituent() );
+    vertexCorrectedP4 = getVertexCorrectedP4(*pfo, tauVertex, jetVertex); 
+  }
+  else {
+	ATH_MSG_WARNING("Seed jet constituent type not supported, will not do vertex correction !");
+    vertexCorrectedP4.SetPtEtaPhiE(constituent.pt(), constituent.eta(), constituent.phi(), constituent.e());
+  }
+ 
+  return vertexCorrectedP4; 
+}
diff --git a/Reconstruction/tauRecTools/src/JetSeedBuilder.cxx b/Reconstruction/tauRecTools/src/JetSeedBuilder.cxx
index 17950599553c..1d9682db60d2 100644
--- a/Reconstruction/tauRecTools/src/JetSeedBuilder.cxx
+++ b/Reconstruction/tauRecTools/src/JetSeedBuilder.cxx
@@ -24,16 +24,11 @@ JetSeedBuilder::~JetSeedBuilder() {
 //______________________________________________________________________________
 StatusCode JetSeedBuilder::execute(xAOD::TauJet& pTau) const {
 
-  ATH_MSG_DEBUG("Starting execute");
-
-  const xAOD::Jet* jetSeed = nullptr;
-  if (pTau.jetLink().isValid()) {
-    jetSeed = pTau.jet();
-  }
-  else { 
-    ATH_MSG_ERROR("seed is not a jet -> tau will not be reconstructed");
+  if (! pTau.jetLink().isValid()) {
+    ATH_MSG_ERROR("Tau jet link is invalid.");
     return StatusCode::FAILURE;
   }
+  const xAOD::Jet* jetSeed = pTau.jet();
 
   ATH_MSG_DEBUG("seed is Jet with"
 		<< " pt=" << jetSeed->pt()
diff --git a/Reconstruction/tauRecTools/src/TauAxisSetter.cxx b/Reconstruction/tauRecTools/src/TauAxisSetter.cxx
index 281811a695e9..05a0d8c9362f 100644
--- a/Reconstruction/tauRecTools/src/TauAxisSetter.cxx
+++ b/Reconstruction/tauRecTools/src/TauAxisSetter.cxx
@@ -10,7 +10,6 @@
 #include "xAODTau/TauJetContainer.h"
 #include "xAODTau/TauJetAuxContainer.h"
 #include "xAODTau/TauJet.h"
-#include "CaloUtils/CaloVertexedCluster.h"
 
 //______________________________________________________________________________
 TauAxisSetter::TauAxisSetter(const std::string& name) :
@@ -21,19 +20,26 @@ TauRecToolBase(name) {
 TauAxisSetter::~TauAxisSetter() { 
 }
 
-//______________________________________________________________________________
-StatusCode TauAxisSetter::execute(xAOD::TauJet& pTau) const {
 
-  const xAOD::Jet* pJetSeed = pTau.jet();
-  if (!pJetSeed) {
+
+StatusCode TauAxisSetter::initialize() {
+  ATH_CHECK(m_tauVertexCorrection.retrieve()); 
+  return StatusCode::SUCCESS;
+}
+
+
+
+StatusCode TauAxisSetter::execute(xAOD::TauJet& pTau) const {
+  if (! pTau.jetLink().isValid()) {
     ATH_MSG_ERROR("Tau jet link is invalid.");
     return StatusCode::FAILURE;
   }
+  const xAOD::Jet* jetSeed = pTau.jet();
 
   // Barycenter is the sum of cluster p4 in the seed jet
   TLorentzVector baryCenter;  
   
-  xAOD::JetConstituentVector constituents = pJetSeed->getConstituents();
+  xAOD::JetConstituentVector constituents = jetSeed->getConstituents();
   for (const xAOD::JetConstituent* constituent : constituents) {
     TLorentzVector constituentP4;
     constituentP4.SetPtEtaPhiE(constituent->pt(), constituent->eta(), constituent->phi(), constituent->e());
@@ -74,18 +80,28 @@ StatusCode TauAxisSetter::execute(xAOD::TauJet& pTau) const {
   pTau.setP4(xAOD::TauJetParameters::DetectorAxis, tauDetectorAxis.Pt(), tauDetectorAxis.Eta(), tauDetectorAxis.Phi(), tauDetectorAxis.M());
 
 
-  if(m_doVertexCorrection) {
+  if (m_doVertexCorrection) {
+    const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+
+    const xAOD::Vertex* tauVertex = nullptr;
+    if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
+    
     // calculate tau intermediate axis (corrected for tau vertex)
     TLorentzVector tauInterAxis;
 
-    std::vector<const xAOD::CaloCluster*> clusterList;
-    ATH_CHECK(tauRecTools::GetJetClusterList(pJetSeed, clusterList, m_incShowerSubtr, baryCenter, m_clusterCone));
-    for (auto cluster : clusterList){
-      if (pTau.vertexLink()) {
-        tauInterAxis += xAOD::CaloVertexedCluster(*cluster, pTau.vertex()->position()).p4();
-      }
-      else {
-        tauInterAxis += xAOD::CaloVertexedCluster(*cluster).p4();
+    if (tauVertex == jetVertex) {
+      tauInterAxis = tauDetectorAxis;
+    }
+    else {
+      for (const xAOD::JetConstituent* constituent : constituents) {
+        TLorentzVector constituentP4;
+        constituentP4.SetPtEtaPhiE(constituent->pt(), constituent->eta(), constituent->phi(), constituent->e());
+      
+        double dR = baryCenter.DeltaR(constituentP4);
+        if (dR > m_clusterCone) continue;
+        
+        TLorentzVector vertexCorrectedP4 = m_tauVertexCorrection->getVertexCorrectedP4(*constituent, tauVertex, jetVertex); 
+        tauInterAxis += vertexCorrectedP4;
       }
     }
 
diff --git a/Reconstruction/tauRecTools/src/TauAxisSetter.h b/Reconstruction/tauRecTools/src/TauAxisSetter.h
index 09095467f33a..f6d7e7caca63 100644
--- a/Reconstruction/tauRecTools/src/TauAxisSetter.h
+++ b/Reconstruction/tauRecTools/src/TauAxisSetter.h
@@ -6,7 +6,9 @@
 #define TAUREC_TAUAXISSETTER_H
 
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
 
+#include "AsgTools/ToolHandle.h"
 
 /**
  * @brief Set Tau "Detector Axis" and "Intermediate Axis". 
@@ -33,14 +35,20 @@ class TauAxisSetter : public TauRecToolBase {
     /** @brief Destructor */
     ~TauAxisSetter();
 
+    /** @brief Initialization of this tool */ 
+    virtual StatusCode initialize() override;
+    
     /** @brief Execution of this tool */ 
     virtual StatusCode execute(xAOD::TauJet& pTau) const override;
 
   private:
 
     Gaudi::Property<double> m_clusterCone {this, "ClusterCone", 0.2, "cone of tau candidate"};
-    Gaudi::Property<bool> m_doVertexCorrection {this, "VertexCorrection", true, "switch of vertex correction"};
+    Gaudi::Property<bool> m_doVertexCorrection {this, "VertexCorrection", true, "switch of tau vertex correction"};
     Gaudi::Property<bool> m_incShowerSubtr {this, "IncShowerSubtr", true, "use shower subtracted clusters in calo calculations"};
+
+    ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 #endif
diff --git a/Reconstruction/tauRecTools/src/TauCellVariables.cxx b/Reconstruction/tauRecTools/src/TauCellVariables.cxx
index ddceb6ffbfb6..3584cce767a3 100644
--- a/Reconstruction/tauRecTools/src/TauCellVariables.cxx
+++ b/Reconstruction/tauRecTools/src/TauCellVariables.cxx
@@ -27,11 +27,11 @@ TauCellVariables::~TauCellVariables() {
 //______________________________________________________________________________
 StatusCode TauCellVariables::execute(xAOD::TauJet& pTau) const {
 
-  const xAOD::Jet* pJetSeed = pTau.jet();
-  if (!pJetSeed) {
+  if (! pTau.jetLink().isValid()) {
     ATH_MSG_ERROR("tau does not have jet seed for cell variable calculation");
     return StatusCode::FAILURE;
   }
+  const xAOD::Jet* pJetSeed = pTau.jet();
   
   ATH_MSG_VERBOSE("cluster position is eta=" << pTau.eta() << " phi=" << pTau.phi() );
 
@@ -76,17 +76,19 @@ StatusCode TauCellVariables::execute(xAOD::TauJet& pTau) const {
       double cellEta = cell->eta();
       double cellET = cell->et();
       double cellEnergy = cell->energy();
+      TLorentzVector tauAxis = pTau.p4(xAOD::TauJetParameters::DetectorAxis);
 
       // correct cell four momentum based on tau vertex
-      if (m_doVertexCorrection && pTau.vertexLink()) {
+      if (m_doVertexCorrection && pTau.vertexLink().isValid()) {
         CaloVertexedCell vxCell (*cell, pTau.vertex()->position());
         cellPhi = vxCell.phi();
         cellEta = vxCell.eta();
         cellET = vxCell.et();
         cellEnergy = vxCell.energy();
+        tauAxis = pTau.p4(xAOD::TauJetParameters::IntermediateAxis);
       }
       
-      double dR = Tau1P3PKineUtils::deltaR(pTau.eta(),pTau.phi(),cellEta,cellPhi);
+      double dR = Tau1P3PKineUtils::deltaR(tauAxis.Eta(), tauAxis.Phi(), cellEta, cellPhi);
       CaloSampling::CaloSample calo = cell->caloDDE()->getSampling();
       
       // use cells with dR < m_cellCone relative to tau intermediate axis:
diff --git a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx
index a47162cb0ab4..0dc129375acd 100644
--- a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx
+++ b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx
@@ -168,11 +168,11 @@ StatusCode TauElectronVetoVariables::execute(xAOD::TauJet& pTau) const
       }
     }
 
-    const xAOD::Jet* pJetSeed = pTau.jet();
-    if (!pJetSeed) {
+    if (! pTau.jetLink().isValid()) {
       ATH_MSG_ERROR("tau does not have jet seed for electron veto cell variable calculation");
       return StatusCode::FAILURE;
     }
+    const xAOD::Jet* pJetSeed = pTau.jet();
 
     // Loop through jets, get links to clusters
     std::vector<const xAOD::CaloCluster*> clusterList;
@@ -193,7 +193,7 @@ StatusCode TauElectronVetoVariables::execute(xAOD::TauJet& pTau) const
 	    if (cellSeen.test(pCell->caloDDE()->calo_hash())) continue;
 	    else cellSeen.set(pCell->caloDDE()->calo_hash());
 
-        if (m_doVertexCorrection && pTau.vertexLink()) {
+        if (m_doVertexCorrection && pTau.vertexLink().isValid()) {
           CaloVertexedCell vxCell (*pCell, pTau.vertex()->position());
           cellPhi = vxCell.phi();
           cellEta = vxCell.eta();
diff --git a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.h b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.h
index 975c731e4403..335aa6f8ec30 100644
--- a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.h
+++ b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.h
@@ -33,7 +33,7 @@ public:
     virtual StatusCode initialize() override;
 
 private:
-    Gaudi::Property<bool> m_doVertexCorrection {this, "VertexCorrection", false, "switch of vertex correction"}; 
+    Gaudi::Property<bool> m_doVertexCorrection {this, "VertexCorrection", true, "switch of vertex correction"}; 
     Gaudi::Property<bool> m_useOldCalo{this,"useOldCalo",false,"If true, it uses the CaloExtensionTool for calculating track extrapolation. Otherwise, it allows the code to read from the cache created by CaloExtensionBuilderalg."};
     Gaudi::Property<bool> m_incShowerSubtr {this, "IncShowerSubtr", true, "use shower subtracted clusters in calo calculations"};
     ToolHandle<Trk::IParticleCaloExtensionTool> m_caloExtensionTool {this, 
diff --git a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
index 7d5a894fc305..7db492683bd0 100644
--- a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
+++ b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
@@ -33,6 +33,12 @@ TauPi0ClusterCreator::~TauPi0ClusterCreator()
 {
 }
 
+
+StatusCode TauPi0ClusterCreator::initialize() {
+  ATH_CHECK(m_tauVertexCorrection.retrieve()); 
+  return StatusCode::SUCCESS;
+}
+
 //______________________________________________________________________________
 StatusCode TauPi0ClusterCreator::executePi0ClusterCreator(xAOD::TauJet& pTau, xAOD::PFOContainer& neutralPFOContainer,
 							  xAOD::PFOContainer& hadronicClusterPFOContainer,
@@ -61,14 +67,28 @@ StatusCode TauPi0ClusterCreator::executePi0ClusterCreator(xAOD::TauJet& pTau, xA
         shotVector.push_back( thisShot );
     }
     std::map<unsigned, xAOD::CaloCluster*> clusterToShotMap = getClusterToShotMap(shotVector, pPi0ClusterContainer, pTau);
+ 
+    if (! pTau.jetLink().isValid()) {
+      ATH_MSG_ERROR("Tau jet link is invalid.");
+      return StatusCode::FAILURE;
+    }
+    const xAOD::Jet *jetSeed = pTau.jet();
+    
+    const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+    
+    const xAOD::Vertex* tauVertex = nullptr;
+    if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
+    
+    TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(pTau);
 
     for (auto cluster: pPi0ClusterContainer){
-
+        TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+        
         // selection
-        if (cluster->pt() < m_clusterEtCut)   continue;
+        if (clusterP4.Pt() < m_clusterEtCut)   continue;
         // Cluster container has clusters for all taus.
         // Only run on clusters that belong to this tau
-        if (cluster->p4().DeltaR(pTau.p4()) > .4) continue;
+        if (clusterP4.DeltaR(tauAxis) > 0.4) continue;
 
         // Get shots in this cluster. Need to use (CaloCluster*) (*clusterItr) 
         // (not a copy!) since the pointer will otherwise be different than in clusterToShotMap
@@ -237,13 +257,28 @@ std::map<unsigned, xAOD::CaloCluster*> TauPi0ClusterCreator::getClusterToShotMap
                                                    clusterItrEnd(pPi0ClusterContainer.end());
         float weightInCluster=-1.;
         float weightInPreviousCluster=-1;
+    
+        const xAOD::Jet *jetSeed = pTau.jet();
+        if (!jetSeed) {
+          ATH_MSG_ERROR("Tau jet link is invalid.");
+          return clusterToShotMap;
+        }
+        const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+    
+        const xAOD::Vertex* tauVertex = nullptr;
+        if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
+      
+        TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(pTau);
+
         for (; clusterItr != clusterItrEnd; ++clusterItr){
             xAOD::CaloCluster* cluster = (xAOD::CaloCluster*) (*clusterItr);
+            TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+            
             weightInCluster=-1.;
-            if (cluster->p4().Et() < m_clusterEtCut) continue; // Not interested in clusters that fail the Et cut
+            if (clusterP4.Et() < m_clusterEtCut) continue; // Not interested in clusters that fail the Et cut
             // Cluster container has clusters for all taus.
             // Only run on clusters that belong to this tau
-            if (cluster->p4().DeltaR(pTau.p4()) > .4)  continue;
+            if (clusterP4.DeltaR(tauAxis) > 0.4)  continue;
             const CaloClusterCellLink* theCellLink = cluster->getCellLinks();
             CaloClusterCellLink::const_iterator cellItr  = theCellLink->begin();
             CaloClusterCellLink::const_iterator cellItrE = theCellLink->end();
@@ -391,14 +426,21 @@ std::vector<float> TauPi0ClusterCreator::get2ndEtaMomWRTCluster( const xAOD::Cal
 //______________________________________________________________________________
 bool TauPi0ClusterCreator::setHadronicClusterPFOs(xAOD::TauJet& pTau, xAOD::PFOContainer& pHadronPFOContainer) const
 {
-    const xAOD::Jet* tauJetSeed = pTau.jet();
-    if (!tauJetSeed) {
-        ATH_MSG_ERROR("Could not retrieve tau jet seed");
-        return false;
+    if (! pTau.jetLink().isValid()) {
+      ATH_MSG_ERROR("Tau jet link is invalid.");
+      return false;
     }
+    const xAOD::Jet *jetSeed = pTau.jet();
+    
+    const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+    
+    const xAOD::Vertex* tauVertex = nullptr;
+    if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
+    
+    TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(pTau);
+    
     std::vector<const xAOD::CaloCluster*> clusterList;
-
-    StatusCode sc = tauRecTools::GetJetClusterList(tauJetSeed, clusterList, m_incShowerSubtr);
+    StatusCode sc = tauRecTools::GetJetClusterList(jetSeed, clusterList, m_incShowerSubtr);
     if (!sc) return false;
 
     for (auto cluster : clusterList){
@@ -408,10 +450,12 @@ bool TauPi0ClusterCreator::setHadronicClusterPFOs(xAOD::TauJet& pTau, xAOD::PFOC
         // - Ignore clusters outside 0.2 cone and those with overall negative energy or negative energy in Hcal
 
         // Don't create PFOs for clusters with overall (Ecal+Hcal) negative energy (noise)
-        if(cluster->e()<=0.) continue;
+        TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+        
+        if(clusterP4.E()<=0.) continue;
 
         // Only need clusters in core cone. Others are not needed for subtraction
-        if(pTau.p4().DeltaR(cluster->p4()) > 0.2) continue;
+        if(tauAxis.DeltaR(clusterP4) > 0.2) continue;
 
         // Loop over cells to calculate cluster energy in Hcal
         double clusterE_Hcal=0.;
diff --git a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h
index 6185d81cb347..9395ffac3662 100644
--- a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h
+++ b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h
@@ -5,13 +5,18 @@
 #ifndef TAUREC_TAUPI0CLUSTERCREATOR_H
 #define	TAUREC_TAUPI0CLUSTERCREATOR_H
 
-#include <string>
-#include <vector>
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
+
 #include "xAODPFlow/PFOAuxContainer.h"
 #include "xAODCaloEvent/CaloClusterAuxContainer.h"
+
+#include "AsgTools/ToolHandle.h"
 #include "GaudiKernel/SystemOfUnits.h"
 
+#include <string>
+#include <vector>
+
 /**
  * @brief Creates Pi0 clusters (Pi0 Finder).
  * 
@@ -26,6 +31,7 @@ public:
     ASG_TOOL_CLASS2(TauPi0ClusterCreator, TauRecToolBase, ITauToolBase);
     virtual ~TauPi0ClusterCreator();
 
+    virtual StatusCode initialize() override;
     virtual StatusCode executePi0ClusterCreator(xAOD::TauJet& pTau, xAOD::PFOContainer& neutralPFOContainer, 
 						xAOD::PFOContainer& hadronicClusterPFOContainer,
 						xAOD::CaloClusterContainer& pi0CaloClusContainer,
@@ -60,13 +66,13 @@ private:
     /** @brief get hadronic cluster PFOs*/
     bool setHadronicClusterPFOs(xAOD::TauJet& pTau, xAOD::PFOContainer& pHadronicClusterContainer) const;
 
-    /** @brief pt threshold for pi0 candidate clusters */
     Gaudi::Property<double> m_clusterEtCut {this, "ClusterEtCut", 0.5 * Gaudi::Units::GeV, "Et threshould for pi0 candidate clusters"};
-    
     Gaudi::Property<bool> m_incShowerSubtr {this, "IncShowerSubtr", true, "use shower subtracted clusters in calo calculations"};
 
     SG::ReadHandleKey<xAOD::CaloClusterContainer> m_pi0ClusterInputContainer{this,"Key_Pi0ClusterContainer", "TauPi0SubtractedClusters", "input pi0 cluster"};
 
+    ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 #endif	/* TAUPI0CLUSTERCREATOR_H */
diff --git a/Reconstruction/tauRecTools/src/TauPi0ClusterScaler.cxx b/Reconstruction/tauRecTools/src/TauPi0ClusterScaler.cxx
index 6877ae6ce937..45aeb323e2db 100644
--- a/Reconstruction/tauRecTools/src/TauPi0ClusterScaler.cxx
+++ b/Reconstruction/tauRecTools/src/TauPi0ClusterScaler.cxx
@@ -77,7 +77,7 @@ void TauPi0ClusterScaler::resetNeutralPFOs(xAOD::TauJet& pTau, xAOD::PFOContaine
         const xAOD::CaloCluster* cl = pfo->cluster(0);
 
         // apply cluster vertex correction 
-        if(pTau.vertexLink()){
+        if(pTau.vertexLink().isValid()){
             auto clcorr = xAOD::CaloVertexedTopoCluster(*cl, pTau.vertex()->position());
             pfo->setP4(clcorr.pt(), clcorr.eta(), clcorr.phi(), 0.0);
         }
diff --git a/Reconstruction/tauRecTools/src/TauTrackFinder.cxx b/Reconstruction/tauRecTools/src/TauTrackFinder.cxx
index 996718a98892..7819dcef8aa0 100644
--- a/Reconstruction/tauRecTools/src/TauTrackFinder.cxx
+++ b/Reconstruction/tauRecTools/src/TauTrackFinder.cxx
@@ -68,7 +68,8 @@ StatusCode TauTrackFinder::executeTrackFinder(xAOD::TauJet& pTau, xAOD::TauTrack
   }
 
   // get the primary vertex
-  const xAOD::Vertex* pVertex = pTau.vertexLink() ? pTau.vertex() : nullptr;
+  const xAOD::Vertex* pVertex = nullptr;
+  if (pTau.vertexLink().isValid()) pVertex = pTau.vertex();
 
   // retrieve tracks wrt a vertex                                                                                                                              
   // as a vertex is used: tau origin / PV / beamspot / 0,0,0 (in this order, depending on availability)                                                        
diff --git a/Reconstruction/tauRecTools/src/TauVertexFinder.cxx b/Reconstruction/tauRecTools/src/TauVertexFinder.cxx
index a40c2bb93fec..2612c7bd6c0c 100644
--- a/Reconstruction/tauRecTools/src/TauVertexFinder.cxx
+++ b/Reconstruction/tauRecTools/src/TauVertexFinder.cxx
@@ -25,8 +25,7 @@ TauVertexFinder::~TauVertexFinder() {
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 StatusCode TauVertexFinder::initialize() {
   ATH_CHECK( m_vertexInputContainer.initialize(SG::AllowEmpty) );
-  if (inTrigger())
-    ATH_CHECK( m_trackPartInputContainer.initialize(SG::AllowEmpty) );
+  ATH_CHECK( m_trackPartInputContainer.initialize(SG::AllowEmpty) );
   ATH_CHECK( m_jetTrackVtxAssoc.initialize() );
   
   if (m_useTJVA) ATH_MSG_INFO("using TJVA to determine tau vertex");
diff --git a/Reconstruction/tauRecTools/src/TauVertexVariables.cxx b/Reconstruction/tauRecTools/src/TauVertexVariables.cxx
index 1fecbc1b0bfb..92ba975c10ed 100644
--- a/Reconstruction/tauRecTools/src/TauVertexVariables.cxx
+++ b/Reconstruction/tauRecTools/src/TauVertexVariables.cxx
@@ -74,7 +74,7 @@ StatusCode TauVertexVariables::executeVertexVariables(xAOD::TauJet& pTau, xAOD::
         ATH_MSG_DEBUG("No Beamspot object in tau candidate");
       }
     }
-    else if (pTau.vertexLink()) { // offline: obtain tau vertex by link
+    else if (pTau.vertexLink().isValid()) { // offline: obtain tau vertex by link
       vxcand = pTau.vertex() ;
       //check if vertex has a valid type (skip if vertex has type NoVtx)
       if (vxcand->vertexType() != xAOD::VxType::NoVtx) {
@@ -118,7 +118,7 @@ StatusCode TauVertexVariables::executeVertexVariables(xAOD::TauJet& pTau, xAOD::
   pTau.setDetail(xAOD::TauJetParameters::trFlightPathSig, (float)(-1111.));
   
   //try to find secondary vertex if more than 1 track and the tau vertex is available
-  if ( pTau.nTracks() < 2 ||  !pTau.vertexLink() ) {
+  if ( pTau.nTracks() < 2 ||  !pTau.vertexLink().isValid() ) {
     return StatusCode::SUCCESS;
   }
 
@@ -171,12 +171,11 @@ StatusCode TauVertexVariables::executeVertexVariables(xAOD::TauJet& pTau, xAOD::
 //-------------------------------------------------------------------------
 double TauVertexVariables::trFlightPathSig(const xAOD::TauJet& pTau, const xAOD::Vertex& secVertex) const {
 
-  const xAOD::Vertex* pVertex = nullptr;
-  if (pTau.vertexLink()) pVertex = pTau.vertex();
-  if (!pVertex) {
+  if (! pTau.vertexLink().isValid()) {
     ATH_MSG_WARNING("No primary vertex information for calculation of transverse flight path significance");
     return -11111.;
   }
+  const xAOD::Vertex* pVertex = pTau.vertex();
 
   double fpx = secVertex.position().x() - pVertex->position().x();
   double fpy = secVertex.position().y() - pVertex->position().y();
diff --git a/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx b/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx
index e7ff8455c948..207cd195446f 100644
--- a/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx
+++ b/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx
@@ -28,6 +28,7 @@
 #include "tauRecTools/TauIDVarCalculator.h"
 #include "tauRecTools/TauJetRNNEvaluator.h"
 #include "tauRecTools/TauDecayModeNNClassifier.h"
+#include "tauRecTools/TauVertexCorrection.h"
 
 #ifndef XAOD_ANALYSIS
 DECLARE_COMPONENT( JetSeedBuilder )
@@ -61,3 +62,4 @@ DECLARE_COMPONENT( TauEleOLRDecorator )
 DECLARE_COMPONENT( TauIDVarCalculator )
 DECLARE_COMPONENT( TauJetRNNEvaluator )
 DECLARE_COMPONENT( TauDecayModeNNClassifier )
+DECLARE_COMPONENT( TauVertexCorrection )
diff --git a/Reconstruction/tauRecTools/tauRecTools/CaloClusterVariables.h b/Reconstruction/tauRecTools/tauRecTools/CaloClusterVariables.h
index 32fc490e512f..cad3ea1d6789 100644
--- a/Reconstruction/tauRecTools/tauRecTools/CaloClusterVariables.h
+++ b/Reconstruction/tauRecTools/tauRecTools/CaloClusterVariables.h
@@ -5,18 +5,14 @@
 #ifndef CALOCLUSTERVARIABLES_H
 #define CALOCLUSTERVARIABLES_H
 
-#include <vector>
-#include "xAODCaloEvent/CaloVertexedTopoCluster.h"
-#ifndef XAOD_ANALYSIS
-#include "CaloUtils/CaloVertexedCluster.h"
-typedef xAOD::CaloVertexedCluster CaloVertexedClusterType;
-#else
-typedef xAOD::CaloVertexedTopoCluster CaloVertexedClusterType;
-#endif
-#include "CxxUtils/fpcompare.h"
+#include "tauRecTools/ITauVertexCorrection.h"
+
 #include "xAODTau/TauJet.h"
+#include "AsgTools/ToolHandle.h"
+#include "CxxUtils/fpcompare.h"
 
 #include "TLorentzVector.h"
+#include <vector>
 
 
 /** Provide calculations of cluster based variables using the clusters associated to the jet seed of the tau candidate. */
@@ -30,9 +26,8 @@ public:
     ~CaloClusterVariables() {
     }
 
-    bool update(const xAOD::TauJet& pTau); //!< update the internal variables for the given tau
+    bool update(const xAOD::TauJet& pTau, const ToolHandle<ITauVertexCorrection>& handle); //!< update the internal variables for the given tau
 
-    void setVertexCorrection(bool flag) {m_doVertexCorrection=flag;}
     void setIncSub(bool flag) {m_incShowerSubtr=flag;}
 
     // ID Variables
@@ -63,25 +58,20 @@ private:
     double m_effEnergy;
 
     // Calculate the geometrical center of the tau constituents
-    TLorentzVector calculateTauCentroid(int nConst, const std::vector<CaloVertexedClusterType>& constituents);
-
-    // Enable cell origin correction.
-    // Eta and phi of the cells are corrected wrt to the origin of the tau vertex
-    bool m_doVertexCorrection;
+    TLorentzVector calculateTauCentroid(int nConst, const std::vector<TLorentzVector>& clusterP4Vector);
 
     // use shower subtracted clusters with PFlow jet seeds
     bool m_incShowerSubtr;
-
 };
 
 //-------------------------------------------------------------------------
 //! Descending order by energy
 //-------------------------------------------------------------------------
 struct CaloClusterCompare { 
-  bool operator()(const CaloVertexedClusterType& left, const CaloVertexedClusterType& right) {
+  bool operator()(const TLorentzVector& left, const TLorentzVector& right) {
     //volatile double leftE = left.e();
     //volatile double rightE = right.e();
-    return CxxUtils::fpcompare::greater (left.e(),right.e());
+    return CxxUtils::fpcompare::greater (left.E(),right.E());
   }
 };
 
diff --git a/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h b/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h
index 153704156507..7768759f7010 100644
--- a/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h
+++ b/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h
@@ -5,24 +5,26 @@
 #ifndef TAURECTOOLS_HELPERFUNCTIONS_H
 #define TAURECTOOLS_HELPERFUNCTIONS_H
 
-#include "MVAUtils/BDT.h"
 #include "AsgMessaging/MessageCheck.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODTau/TauJet.h"
+#include "xAODCaloEvent/CaloCluster.h"
+#include "xAODPFlow/PFO.h"
 
-#include <vector>
-#include <map>
+#include "MVAUtils/BDT.h"
 
-// ROOT include(s)
 #include "TLorentzVector.h"
 #include "TString.h"
 
-// EDM include(s):
-#include "xAODTau/TauJet.h"
+#include <vector>
+#include <map>
+
 
 namespace tauRecTools
 {
   ANA_MSG_HEADER(msgHelperFunction)
 
-    const StatusCode GetJetClusterList(const xAOD::Jet* jet, std::vector<const xAOD::CaloCluster*> &clusterList, bool incShowerSubtracted, TLorentzVector dRVector = TLorentzVector(0.,0.,0.,0.), double dRCut = -1);
+  const StatusCode GetJetClusterList(const xAOD::Jet* jet, std::vector<const xAOD::CaloCluster*> &clusterList, bool incShowerSubtracted);
 
   xAOD::TauTrack::TrackFlagType isolateClassifiedBits(xAOD::TauTrack::TrackFlagType flag);
   bool sortTracks(const ElementLink<xAOD::TauTrackContainer> &l1, const ElementLink<xAOD::TauTrackContainer> &l2);
diff --git a/Reconstruction/tauRecTools/tauRecTools/ITauVertexCorrection.h b/Reconstruction/tauRecTools/tauRecTools/ITauVertexCorrection.h
new file mode 100644
index 000000000000..35fa425b67bc
--- /dev/null
+++ b/Reconstruction/tauRecTools/tauRecTools/ITauVertexCorrection.h
@@ -0,0 +1,83 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ITAUVERTEXCORRECTION_H
+#define ITAUVERTEXCORRECTION_H
+
+#include "AsgTools/IAsgTool.h"
+
+#include "xAODTracking/VertexContainer.h"
+#include "xAODPFlow/PFOContainer.h"
+#include "xAODCaloEvent/CaloClusterContainer.h"
+#include "xAODTau/TauJet.h"
+
+
+/**
+ * @brief Tool to perform the vertex correction for the tau candidate
+ */
+
+class ITauVertexCorrection : virtual public asg::IAsgTool {
+ 
+public:
+
+  ASG_TOOL_INTERFACE(ITauVertexCorrection) 
+
+  virtual ~ITauVertexCorrection() = default;
+
+  virtual StatusCode initialize() = 0;
+  
+  /** Get the jet vertex */
+  virtual const xAOD::Vertex* getJetVertex(const xAOD::Jet& jet) const = 0;
+
+  /** Get the tau axis */
+  virtual TLorentzVector getTauAxis(const xAOD::TauJet& tau) const = 0;
+  
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param cluster input cluster
+   * @param vertex the vertex of the tau candidate
+   * @param relativeVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::CaloCluster& cluster, 
+                                      const xAOD::Vertex* vertex,
+                                      const xAOD::Vertex* relativeVertex = nullptr) const = 0;
+  
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param pfo input PFO
+   * @param vertex the vertex of the tau candidate
+   * @param relativeVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::PFO& pfo, 
+                                      const xAOD::Vertex* vertex, 
+                                      const xAOD::Vertex* relativeVertex = nullptr) const = 0; 
+
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param constituent input constituent
+   * @param vertex the vertex of the tau candiate
+   * @param relativeVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::JetConstituent& constituent, 
+                                      const xAOD::Vertex* vertex, 
+                                      const xAOD::Vertex* relativeVertex = nullptr) const = 0; 
+
+private:
+
+  /**@brief Get the vertex corrected four momentum
+   * @param cluster input cluster
+   * @param position position of the vertex
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::CaloCluster& cluster, 
+                                      const Amg::Vector3D& position) const = 0;
+  
+  /**@brief Get the vertex corrected four momentum
+   * @param pfo input PFO
+   * @param position position of the vertex
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::PFO& pfo, 
+                                      const Amg::Vector3D& position) const = 0;
+};
+
+#endif // ITAUVERTEXCORRECTION_H
diff --git a/Reconstruction/tauRecTools/tauRecTools/MvaTESVariableDecorator.h b/Reconstruction/tauRecTools/tauRecTools/MvaTESVariableDecorator.h
index d59716827b4b..2ca20797ba62 100644
--- a/Reconstruction/tauRecTools/tauRecTools/MvaTESVariableDecorator.h
+++ b/Reconstruction/tauRecTools/tauRecTools/MvaTESVariableDecorator.h
@@ -6,10 +6,12 @@
 #define TAURECTOOLSDEV_MVATESVARIABLEDECORATOR_H
 
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
 
+#include "xAODEventInfo/EventInfo.h"
 #include "AsgDataHandles/ReadHandleKey.h"
 #include "AsgDataHandles/ReadDecorHandleKey.h"
-#include "xAODEventInfo/EventInfo.h"
+#include "AsgTools/ToolHandle.h"
 
 
 class MvaTESVariableDecorator
@@ -27,17 +29,20 @@ class MvaTESVariableDecorator
 
  private:
 
+  bool m_incShowerSubtr;
+
   SG::ReadDecorHandleKey<xAOD::EventInfo> m_aveIntPerXKey {this, 
       "AveIntPerXKey", 
       "EventInfo.AveIntPerXDecor",
       "Decoration for Average Interaction Per Crossing"};
   
-  SG::ReadHandleKey<xAOD::VertexContainer> m_vertexInputContainer {this,
+  SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContainerKey {this,
       "Key_vertexInputContainer",
       "PrimaryVertices",
       "input vertex container key"};
 
-  bool m_incShowerSubtr;
+  ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h b/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h
index b474b597504e..aba97746476e 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h
@@ -13,8 +13,11 @@
 #define TAUIDVARCALCULATOR_H
 
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
 
-class TauIDVarCalculator: public TauRecToolBase
+#include "AsgTools/ToolHandle.h"
+
+class TauIDVarCalculator: public TauRecToolBase 
 {
   ASG_TOOL_CLASS2(TauIDVarCalculator, TauRecToolBase, ITauToolBase)
 
@@ -24,6 +27,8 @@ class TauIDVarCalculator: public TauRecToolBase
   
   virtual ~TauIDVarCalculator() {}
 
+  virtual StatusCode initialize() override;
+
   virtual StatusCode execute(xAOD::TauJet&) const override;
 
   static const float LOW_NUMBER;
@@ -31,6 +36,9 @@ class TauIDVarCalculator: public TauRecToolBase
  private:
 
   bool m_incShowerSubtr;
+
+  ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 #endif
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauJetRNNEvaluator.h b/Reconstruction/tauRecTools/tauRecTools/TauJetRNNEvaluator.h
index ecc5b89fcbc6..18eac022bc2e 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauJetRNNEvaluator.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauJetRNNEvaluator.h
@@ -5,14 +5,15 @@
 #ifndef TAUREC_TAUJETRNNEVALUATOR_H
 #define TAUREC_TAUJETRNNEVALUATOR_H
 
-#include <memory>
-
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
 
-// xAOD includes
 #include "xAODTau/TauJet.h"
 
-// Forward declarations
+#include "AsgTools/ToolHandle.h"
+
+#include <memory>
+
 class TauJetRNN;
 
 /**
@@ -70,6 +71,9 @@ private:
     std::unique_ptr<TauJetRNN> m_net_3p; //!
 
     bool m_incShowerSubtr;
+
+    ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauSubstructureVariables.h b/Reconstruction/tauRecTools/tauRecTools/TauSubstructureVariables.h
index 3530a60331af..c515d3bf6107 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauSubstructureVariables.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauSubstructureVariables.h
@@ -6,6 +6,9 @@
 #define TAUREC_TAUSUBSTRUCTUREBUILDER_H
 
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
+
+#include "AsgTools/ToolHandle.h"
 
 /**
  * @brief Calculate variables from the tau substructure.
@@ -26,16 +29,15 @@ class TauSubstructureVariables : public TauRecToolBase
 
         ~TauSubstructureVariables();
 
+        virtual StatusCode initialize() override;
         virtual StatusCode execute(xAOD::TauJet& pTau) const override;
 
     private:
-        // enable cell origin correction
-        // eta and phi of the cells are corrected wrt to the origin of the tau vertex
-	bool m_doVertexCorrection;
-
 	// use shower subtracted clusters with PFlow jet seeds
 	bool m_incShowerSubtr;
-
+  
+    ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 #endif
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauVertexCorrection.h b/Reconstruction/tauRecTools/tauRecTools/TauVertexCorrection.h
new file mode 100644
index 000000000000..d28681b59d85
--- /dev/null
+++ b/Reconstruction/tauRecTools/tauRecTools/TauVertexCorrection.h
@@ -0,0 +1,98 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TAUVERTEXCORRECTION_H
+#define TAUVERTEXCORRECTION_H
+
+#include "tauRecTools/ITauVertexCorrection.h"
+
+#include "AsgTools/AsgTool.h"
+#include "AsgDataHandles/ReadHandleKey.h"
+
+/**
+ * @brief Tool to perform the vertex correction for the tau candidate
+ * @author Xiaozhong Huang <xiaozhong.huang@cern.ch>  
+ */
+
+class TauVertexCorrection : public asg::AsgTool, virtual public ITauVertexCorrection {
+ 
+public:
+
+  ASG_TOOL_INTERFACE(TauVertexCorrection)
+  ASG_TOOL_CLASS1(TauVertexCorrection, ITauVertexCorrection)
+
+  TauVertexCorrection(const std::string& name);
+  virtual ~TauVertexCorrection() = default;
+
+  virtual StatusCode initialize() override;
+  
+  /** Get the jet vertex */
+  virtual const xAOD::Vertex* getJetVertex(const xAOD::Jet& jet) const override;
+  
+  /** Get the tau axis */
+  virtual TLorentzVector getTauAxis(const xAOD::TauJet& tau) const override;
+  
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param cluster input cluster
+   * @param tauVertex the vertex of the tau candidate
+   * @param jetVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::CaloCluster& cluster, 
+                                      const xAOD::Vertex* tauVertex,
+                                      const xAOD::Vertex* jetVertex = nullptr) const override;
+  
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param pfo input PFO
+   * @param tauVertex the vertex of the tau candidate
+   * @param jetVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::PFO& pfo, 
+                                      const xAOD::Vertex* tauVertex, 
+                                      const xAOD::Vertex* jetVertex = nullptr) const override; 
+
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param constituent input constituent
+   * @param tauVertex the vertex of the tau candiate
+   * @param jetVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::JetConstituent& constituent, 
+                                      const xAOD::Vertex* tauVertex, 
+                                      const xAOD::Vertex* jetVertex = nullptr) const override; 
+
+private:
+  
+  /**@brief Get the vertex corrected four momentum
+   * @param cluster input cluster
+   * @param position position of the vertex
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::CaloCluster& cluster, 
+                                      const Amg::Vector3D& position) const override;
+  
+  /**@brief Get the vertex corrected four momentum
+   * @param pfo input PFO
+   * @param position position of the vertex
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::PFO& pfo, 
+                                      const Amg::Vector3D& position) const override;
+  
+  /// Name of the seed jet
+  std::string m_seedJet;
+
+  /// Switch of the tau vertex correction
+  bool m_doVertexCorrection; 
+
+  /// Switch of the jet vertex correction
+  bool m_doJetVertexCorrection;
+
+  /// Whether the seed jet is at EM scale 
+  bool m_isEMScale = false; //!
+
+  /// Whehter the seed jet is PFO 
+  bool m_isPFO = false; //!
+};
+
+#endif // ITAUVERTEXCORRECTION_H
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
index 0131a57dfe65..322a14c5c333 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
+++ b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
@@ -52,6 +52,30 @@ def getAtlasExtrapolator():
     return theAtlasExtrapolator
 
 ########################################################################
+def getTauVertexCorrection():
+    from tauRec.tauRecFlags import tauFlags
+    from tauRecTools.tauRecToolsConf import TauVertexCorrection
+
+    _name = sPrefix + 'TauVertexCorrection'
+    
+    if _name in cached_instances:
+        return cached_instances[_name]
+  
+    # FIXME:doJetVertexCorrection need to be False even though origin correction
+    # is turned on in jet reconstruction. 
+    # If the seed jet is PFlow jets, then the tau axis will be corrected to point 
+    # at PV0, but the clusters will not be corrected.
+
+    doJetVertexCorrection = False
+
+    myTauVertexCorrection = TauVertexCorrection(name = _name,
+                                                SeedJet = tauFlags.tauRecSeedJetCollection(), 
+                                                VertexCorrection = doVertexCorrection,
+                                                JetVertexCorrection = doJetVertexCorrection)
+    
+    cached_instances[_name] = myTauVertexCorrection
+    return myTauVertexCorrection
+
 # JetSeedBuilder
 def getJetSeedBuilder():
     _name = sPrefix + 'JetSeedBuilder'
@@ -76,7 +100,8 @@ def getTauAxis():
     from tauRecTools.tauRecToolsConf import TauAxisSetter
     TauAxisSetter = TauAxisSetter(  name = _name, 
                                     ClusterCone = 0.2,
-                                    VertexCorrection = doVertexCorrection
+                                    VertexCorrection = doVertexCorrection,
+                                    TauVertexCorrection = getTauVertexCorrection()
                                   )
     # No Axis correction at trigger level
                                     
@@ -123,7 +148,8 @@ def getMvaTESVariableDecorator():
 
     from AthenaCommon.AppMgr import ToolSvc
     from tauRecTools.tauRecToolsConf import MvaTESVariableDecorator
-    MvaTESVariableDecorator = MvaTESVariableDecorator(name = _name)
+    MvaTESVariableDecorator = MvaTESVariableDecorator(name = _name,
+                                                      TauVertexCorrection = getTauVertexCorrection())
 
     MvaTESVariableDecorator.Key_vertexInputContainer = ""
 
@@ -357,7 +383,7 @@ def getTauSubstructure():
     
     from tauRecTools.tauRecToolsConf import TauSubstructureVariables
     TauSubstructureVariables = TauSubstructureVariables(  name = _name,
-                                                          VertexCorrection = doVertexCorrection
+                                                          TauVertexCorrection = getTauVertexCorrection()
                                                         )
     
     cached_instances[_name] = TauSubstructureVariables
@@ -745,7 +771,8 @@ def getTauIDVarCalculator():
     
     from AthenaCommon.AppMgr import ToolSvc
     from tauRecTools.tauRecToolsConf import TauIDVarCalculator            
-    TauIDVarCalculator = TauIDVarCalculator(name=_name)
+    TauIDVarCalculator = TauIDVarCalculator(name=_name,
+                                            TauVertexCorrection=getTauVertexCorrection())
     
     ToolSvc += TauIDVarCalculator                                 
     cached_instances[_name] = TauIDVarCalculator
@@ -797,7 +824,8 @@ def getTauJetRNNEvaluator(NetworkFile0P="", NetworkFile1P="", NetworkFile3P="",
                                       InputLayerTracks=InputLayerTracks,
                                       InputLayerClusters=InputLayerClusters,
                                       OutputLayer=OutputLayer,
-                                      OutputNode=OutputNode)
+                                      OutputNode=OutputNode,
+                                      TauVertexCorrection=getTauVertexCorrection())
 
     ToolSvc += TauJetRNNEvaluator
     cached_instances[_name] = TauJetRNNEvaluator
-- 
GitLab


From 01a942857fa20b64cf413c58d77b3f747e20c448 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Tue, 22 Sep 2020 16:36:03 +0200
Subject: [PATCH 359/422] fixed issue with Calib chain name

---
 .../TriggerJobOpts/share/runHLT_standalone.py |  1 -
 ...guration.py => CalibChainConfiguration.py} |  4 ++--
 ...ChainDefs.py => GenerateCalibChainDefs.py} |  4 ++--
 .../HLTMenuConfig/Menu/DictFromChainName.py   |  4 ++--
 .../HLTMenuConfig/Menu/GenerateMenuMT.py      | 22 ++++++++-----------
 .../HLTMenuConfig/Menu/SignatureDicts.py      |  8 +++----
 6 files changed, 19 insertions(+), 24 deletions(-)
 rename Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/{CalibrationChainConfiguration.py => CalibChainConfiguration.py} (89%)
 rename Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/{GenerateCalibrationChainDefs.py => GenerateCalibChainDefs.py} (84%)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index d63ac387e50f..feb016b3507b 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -45,7 +45,6 @@ class opt:
     enableL1CaloLegacy = True         # Enable Run-2 L1Calo simulation and/or decoding (possible even if enablePhase1 is True)
 #Individual slice flags
     doCalibSlice        = True
-    # doCalibrationSlice  = True
     doTestSlice         = True
     doHeavyIonSlice     = True
     doEnhancedBiasSlice = True
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibrationChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
similarity index 89%
rename from Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibrationChainConfiguration.py
rename to Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
index 5cc0d787e9fa..3a9ea2d4fb54 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibrationChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
@@ -2,12 +2,12 @@
 
 from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
-log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibrationChainConfiguration")
+log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibChainConfiguration")
 
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
 
 #----------------------------------------------------------------
-class CalibrationChainConfiguration(ChainConfigurationBase):
+class CalibChainConfiguration(ChainConfigurationBase):
 
     def __init__(self, chainDict):
         ChainConfigurationBase.__init__(self,chainDict)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibrationChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py
similarity index 84%
rename from Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibrationChainDefs.py
rename to Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py
index 3a1d29498c3a..7db53d3b1c51 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibrationChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDict
-from TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibrationChainConfiguration import CalibrationChainConfiguration as CalibrationChainConfiguration
+from TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibChainConfiguration import CalibChainConfiguration as CalibChainConfiguration
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainMerging import mergeChainDefs
 
 
@@ -22,7 +22,7 @@ def generateChainConfigs( chainDict ):
     #needed to move to the correct format [{}]->{}
     for subChainDict in listOfChainDicts:
         
-        Calib = CalibrationChainConfiguration(subChainDict).assembleChain() 
+        Calib = CalibChainConfiguration(subChainDict).assembleChain() 
 
         listOfChainDefs += [Calib]
         log.debug('length of chaindefs %s', len(listOfChainDefs) )
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
index ba67d57d9066..7db4cebf523f 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
@@ -268,7 +268,7 @@ def analyseChainName(chainName, L1thresholds, L1item):
             for chainCategory in [(['mb'], 'MinBias', 'mb'),
                                   (['hi'], 'HeavyIon', 'mb'),
                                   (AllowedCosmicChainIdentifiers, 'Cosmic', 'cosmic'),
-                                  (AllowedCalibChainIdentifiers, 'Calibration', 'calib'),
+                                  (AllowedCalibChainIdentifiers, 'Calib', 'calib'),
                                   (AllowedMonitorChainIdentifiers, 'Monitor', 'calib'),
                                   (AllowedBeamspotChainIdentifiers, 'Beamspot', 'beamspot'),
                                   (['eb'], 'EnhancedBias', 'eb') ]:
@@ -351,7 +351,7 @@ def analyseChainName(chainName, L1thresholds, L1item):
 
         log.debug('Chainparts: %s', chainparts)
         if (chainProperties['signature'] != 'Cosmic') \
-                & (chainProperties['signature'] != 'Calibration')\
+                & (chainProperties['signature'] != 'Calib')\
                 & (chainProperties['signature'] != 'Streaming') \
                 & (chainProperties['signature'] != 'Beamspot') \
                 & (chainProperties['signature'] != 'Monitor') :
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index 99f1f73f30ad..3786c62900dc 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -65,8 +65,8 @@ class GenerateMenuMT(object):
         self.signaturesToGenerate = []
         self.allSignatures = ['Egamma', 'Muon', 'Jet', 'Bjet', 'Bphysics', 'MET', 'Tau',
                               'HeavyIon', 'Beamspot', 'Cosmic', 'EnhancedBias',
-                              'Monitor', 'Calibration', 'Streaming', 'Combined', 'MinBias', 'Test'] #, AFP
-        self.calibCosmicMonSigs = ['Streaming','Monitor','Beamspot','Cosmic', 'Calibration'] #others not implemented yet ['Beamspot', 'Cosmic', 'EnhancedBias', 'Monitor', 'Calib', 'Streaming']
+                              'Monitor', 'Calib', 'Streaming', 'Combined', 'MinBias', 'Test'] #, AFP
+        self.calibCosmicMonSigs = ['Streaming','Monitor','Beamspot','Cosmic', 'Calib'] #others not implemented yet ['Beamspot', 'Cosmic', 'EnhancedBias', 'Monitor', 'Calib', 'Streaming']
 
         # flags
         self.doEgammaChains         = True
@@ -80,8 +80,7 @@ class GenerateMenuMT(object):
         self.doMinBiasChains        = True
         self.doHeavyIonChains       = True
         self.doCosmicChains         = True
-        self.doCalibrationChains    = True
-        # self.doCalibChains    = True
+        self.doCalibChains    = True
         self.doStreamingChains      = True
         self.doMonitorChains        = True
         self.doBeamspotChains       = True
@@ -367,17 +366,14 @@ class GenerateMenuMT(object):
         #ConfigFlags.lock()
 
         for sig in self.allSignatures:
-            sig2 = sig
-            if sig2 == 'Calibration': 
-                sig2 = 'Calib'
-            if eval('TriggerFlags.' + sig2 + 'Slice.signatures()') and eval('self.do' + sig + 'Chains'):
-                log.debug("Adding %s chains to the list of chains to be configured", sig2)
-                chains+= eval('TriggerFlags.' + sig2 + 'Slice.signatures()')
+            if eval('TriggerFlags.' + sig + 'Slice.signatures()') and eval('self.do' + sig + 'Chains'):
+                log.debug("Adding %s chains to the list of chains to be configured", sig)
+                chains+= eval('TriggerFlags.' + sig + 'Slice.signatures()')
                 self.signaturesToGenerate.append(sig)
-            elif not eval('TriggerFlags.' + sig2 + 'Slice.signatures()'):
-                log.debug('Signature %s is not switched on (no chains in menu)', sig2)
+            elif not eval('TriggerFlags.' + sig + 'Slice.signatures()'):
+                log.debug('Signature %s is not switched on (no chains in menu)', sig)
             elif not eval('self.do' + sig + 'Chains'):
-                log.debug('Signature %s is not switched on (disabled by flag)', sig2)
+                log.debug('Signature %s is not switched on (disabled by flag)', sig)
 
         log.info("The following signature(s) is (are) enabled: %s", self.signaturesToGenerate)
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 5eca9479c525..c228e498a8ea 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -22,7 +22,7 @@ SliceIDDict = {
     'MinBias' : 'mb',
     'HeavyIon' : 'hi',
     'Cosmic'  : 'cosmic',
-    'Calibration'   : 'calib',
+    'Calib'   : 'calib',
     #'Calib'   : 'calib',
     'Streaming'     : 'streamer',
     'Monitor'    : 'mon',
@@ -609,7 +609,7 @@ AllowedCalibChainIdentifiers = ['csccalib',     'larcalib',
 ##stramingInfo not use in ChainConfiguration, only to distinguish streaming
 
 CalibChainParts = {
-    'signature'      : ['Calibration'],
+    'signature'      : ['Calib'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'purpose'        : AllowedCalibChainIdentifiers,
@@ -625,7 +625,7 @@ CalibChainParts = {
 
 # ---- Calib Chain Default Dictinary of all allowed Values ----
 CalibChainParts_Default = {
-    'signature'      : ['Calibration'],
+    'signature'      : ['Calib'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'purpose'        : [],
@@ -818,7 +818,7 @@ def getSignatureInformation(signature):
         return [HeavyIonChainParts_Default, HeavyIonChainParts]
     if signature == "Cosmic":
         return [CosmicChainParts_Default, CosmicChainParts]
-    if signature == "Calibration":
+    if signature == "Calib":
         return [CalibChainParts_Default, CalibChainParts]
     if signature == "Streaming":
         return [StreamingChainParts_Default, StreamingChainParts]
-- 
GitLab


From 3b5c055663ed9fb756b8fbcdcfb38a33d029dec0 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Tue, 22 Sep 2020 16:43:38 +0200
Subject: [PATCH 360/422] TrigFake: Delete package

Delete this unused package and cleanup references to it.
---
 Trigger/TrigFake/CMakeLists.txt               |  13 -
 .../src/FakeLvl1MultipleRoIsatFixedEtaPhi.cxx | 289 -------------
 .../src/FakeLvl1MultipleRoIsatFixedEtaPhi.h   |  58 ---
 .../TrigFake/src/FakeLvl1RoIatFixedEtaPhi.cxx | 268 -------------
 .../TrigFake/src/FakeLvl1RoIatFixedEtaPhi.h   |  57 ---
 Trigger/TrigFake/src/FakeLvl1RoIfromKine.cxx  | 379 ------------------
 Trigger/TrigFake/src/FakeLvl1RoIfromKine.h    |  57 ---
 Trigger/TrigFake/src/FakeRoI.h                |  27 --
 Trigger/TrigFake/src/Trajectory.cxx           | 124 ------
 Trigger/TrigFake/src/Trajectory.h             |  46 ---
 Trigger/TrigFake/src/ZVertexFromKine.cxx      |  95 -----
 Trigger/TrigFake/src/ZVertexFromKine.h        |  29 --
 .../src/components/TrigFake_entries.cxx       |  13 -
 .../share/pureSteering_jobOptions.py          |  34 --
 .../TriggerJobOpts/python/Modifiers.py        |  21 -
 15 files changed, 1510 deletions(-)
 delete mode 100644 Trigger/TrigFake/CMakeLists.txt
 delete mode 100644 Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.cxx
 delete mode 100755 Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.h
 delete mode 100644 Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.cxx
 delete mode 100755 Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.h
 delete mode 100644 Trigger/TrigFake/src/FakeLvl1RoIfromKine.cxx
 delete mode 100755 Trigger/TrigFake/src/FakeLvl1RoIfromKine.h
 delete mode 100755 Trigger/TrigFake/src/FakeRoI.h
 delete mode 100644 Trigger/TrigFake/src/Trajectory.cxx
 delete mode 100755 Trigger/TrigFake/src/Trajectory.h
 delete mode 100644 Trigger/TrigFake/src/ZVertexFromKine.cxx
 delete mode 100755 Trigger/TrigFake/src/ZVertexFromKine.h
 delete mode 100644 Trigger/TrigFake/src/components/TrigFake_entries.cxx

diff --git a/Trigger/TrigFake/CMakeLists.txt b/Trigger/TrigFake/CMakeLists.txt
deleted file mode 100644
index 0d79ad93b1fe..000000000000
--- a/Trigger/TrigFake/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-# Declare the package name:
-atlas_subdir( TrigFake )
-
-# External dependencies:
-find_package( CLHEP )
-
-# Component(s) in the package:
-atlas_add_component( TrigFake
-                     src/*.cxx src/components/*.cxx
-                     INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib GeneratorObjects TrigConfHLTData TrigInDetEvent TrigSteeringEvent TrigSteeringLib TrigT1Interfaces TrigT1Result )
diff --git a/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.cxx b/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.cxx
deleted file mode 100644
index bda6b320806c..000000000000
--- a/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.cxx
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/********************************************************************
-
-
-NAME:     FakeLvl1MultipleRoIsatFixedEtaPhi.cxx
-PACKAGE:
-
-AUTHORS: J. Boyd (copied from and then adapted FakeLvl1RoIatFixedEtaPhi
-
-CREATED:  Apr, 2007
-
-PURPOSE:  Fake Lvl1 RoI for seeding Lvl2
-
-Modified :
-
-
-********************************************************************/
-
-#include <stdlib.h>
-#include <vector>
-#include <utility>
-// INCLUDE GAUDI HEADER FILES:
-#include "GaudiKernel/MsgStream.h"
-#include "Gaudi/Property.h"
-#include "GaudiKernel/ISvcLocator.h"
-
-
-# include "CLHEP/Units/SystemOfUnits.h"
-
-#include "TrigSteeringEvent/TrigRoiDescriptor.h"
-#include "FakeLvl1MultipleRoIsatFixedEtaPhi.h"
-#include "FakeRoI.h"
-#include "Trajectory.h"
-
-#include "TrigInterfaces/AlgoConfig.h"
-#include "TrigSteering/SteeringChain.h"
-#include "TrigNavigation/Navigation.h"
-#include "TrigNavigation/TriggerElement.h"
-#include "TrigConfHLTData/HLTTriggerElement.h"
-
-#include "CLHEP/Vector/ThreeVector.h"
-
-#include "TrigT1Result/EMTauRoI.h"
-#include "TrigT1Result/JetEnergyResult.h"
-
-#include "TrigT1Interfaces/TrigT1Interfaces_ClassDEF.h"
-#include "TrigT1Interfaces/RecMuonRoI.h"
-#include "TrigT1Interfaces/RecMuonRoiSvc.h"
-
-
-
-
-////////////////////////////////////////////////////////////////
-//  CONSTRUCTOR:
-
-FakeLvl1MultipleRoIsatFixedEtaPhi::FakeLvl1MultipleRoIsatFixedEtaPhi(const std::string& name, const std::string& type,
-						   const IInterface* parent)
-  : HLT::LvlConverter(name, type, parent), 
-    m_roiId(0),
-    m_lvl1ID(1)
-{
-  declareProperty( "FakeEmRoiPhi", m_emRoiPhi);
-  declareProperty( "FakeEmRoiEta", m_emRoiEta);
-
-  declareProperty( "FakeTauRoiPhi", m_tauRoiPhi);
-  declareProperty( "FakeTauRoiEta", m_tauRoiEta);
-
-  declareProperty( "FakeMuonRoiPhi", m_muonRoiPhi);
-  declareProperty( "FakeMuonRoiEta", m_muonRoiEta);
-
-  declareProperty( "FakeJetRoiPhi", m_jetRoiPhi);
-  declareProperty( "FakeJetRoiEta", m_jetRoiEta);
-
-  declareProperty( "FakeEmRoiLabel",   m_emRoiLabel  );
-  declareProperty( "FakeMuonRoiLabel", m_muonRoiLabel);
-  declareProperty( "FakeJetRoiLabel",  m_jetRoiLabel );
-  declareProperty( "FakeTauRoiLabel",  m_tauRoiLabel );
-
-}
-
-// DESTRUCTOR:
-
-FakeLvl1MultipleRoIsatFixedEtaPhi::~FakeLvl1MultipleRoIsatFixedEtaPhi()
-{ }
-
-
-
-/////////////////////////////////////////////////////////////////
-// INITIALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1MultipleRoIsatFixedEtaPhi::hltInitialize()
-{
-  // check that the vectors for emRoi are the same length
-  if (m_emRoiPhi.size() != m_emRoiEta.size() || m_emRoiPhi.size() != m_emRoiLabel.size()) {    msg() << MSG::FATAL << " problem configuring EMROI sizes of Phi, Eta, Label vectors different, phi " << m_muonRoiPhi.size()  << "  eta " << m_emRoiEta.size()  << "  label "<<m_emRoiLabel.size()  <<endmsg;
-  return HLT::BAD_JOB_SETUP;
-  }
-  if (m_emRoiPhi.size() == 0) msg() << MSG::INFO << " Not forming any fake EMROIs" << endmsg;
-
-  for (size_t em=0;em<m_emRoiPhi.size();em++){
-    if ( m_emRoiPhi.at(em) <= M_PI && m_emRoiPhi.at(em) >= -M_PI ) {
-      msg() << MSG::INFO << " Forming fake EMROI with name " << m_emRoiLabel.at(em)  <<" at phi =  " <<
-        m_emRoiPhi.at(em) << " eta = "  << m_emRoiEta.at(em) << endmsg;
-    } else {
-      msg() << MSG::INFO << " Not forming fake EMROI " <<m_emRoiLabel.at(em)  << " phi out of range"<< endmsg;
-    }
-  }
-
-  // check that the vectors for tauRoi are the same length
-  if (m_tauRoiPhi.size() != m_tauRoiEta.size() || m_tauRoiPhi.size() != m_tauRoiLabel.size()) {
-    msg() << MSG::FATAL << " problem configuring TAUROI sizes of Phi, Eta, Label vectors different, phi " << m_muonRoiPhi.size()  << "  eta " << m_tauRoiEta.size()  << "  label "<< m_tauRoiLabel.size()  <<endmsg;
-    return HLT::BAD_JOB_SETUP;
-  }
-  if (m_tauRoiPhi.size() == 0) msg() << MSG::INFO << " Not forming any fake TAUROIs" <<
-endmsg;
-  for (size_t tau=0;tau<m_tauRoiPhi.size();tau++){
-    if ( m_tauRoiPhi.at(tau) <= M_PI && m_tauRoiPhi.at(tau) >= -M_PI ) {
-      msg() << MSG::INFO << " Forming fake TAUROI with name " << m_tauRoiLabel.at(tau)
-<< " at phi =  " <<
-        m_tauRoiPhi.at(tau) << " eta = "  << m_tauRoiEta.at(tau) << endmsg;
-    } else {
-      msg() << MSG::INFO << " Not forming fake TAUROI " <<m_tauRoiLabel.at(tau)  << " phi out of range"<< endmsg;
-    }
-  }
-  // check that the vectors for muonRoi are the same length
-  if (m_muonRoiPhi.size() != m_muonRoiEta.size() || m_muonRoiPhi.size() != m_muonRoiLabel.size()) {
-    msg() << MSG::FATAL << " problem configuring MUONROI sizes of Phi, Eta, Label vectors different, phi " << m_muonRoiPhi.size()  << "  eta " << m_muonRoiEta.size()  << "  label "<< m_muonRoiLabel.size()  <<endmsg;
-    return HLT::BAD_JOB_SETUP;
-  }
-  if (m_muonRoiPhi.size() == 0) msg() << MSG::INFO << " Not forming any fake MUONROIs" << endmsg;
-
-  // print out the MUONROIs that will be created...
-  for (size_t mu=0;mu<m_muonRoiPhi.size();mu++){
-    if ( m_muonRoiPhi.at(mu) <= M_PI && m_muonRoiPhi.at(mu) >= -M_PI ) {
-      msg() << MSG::INFO << " Forming fake MUONROI " <<mu<< " with name " << m_muonRoiLabel.at(mu)  << "  at phi =  " <<
-        m_muonRoiPhi.at(mu) << " eta = "   << m_muonRoiEta.at(mu) << endmsg;
-    } else {
-      msg() << MSG::INFO << " Not forming fake MUONROI " <<mu << "phi out of range " <<endmsg;
-    }
-  }
-
-
-  // check that the vectors for jetRoi are the same length
-  if (m_jetRoiPhi.size() != m_jetRoiEta.size() || m_jetRoiPhi.size() != m_jetRoiLabel.size()) {
-    msg() << MSG::FATAL << " problem configuring JETROI sizes of Phi, Eta, Label vectors different, phi " << m_muonRoiPhi.size()  << "  eta " << m_jetRoiEta.size()  << "  label "<< m_jetRoiLabel.size()  <<endmsg;
-    return HLT::BAD_JOB_SETUP;
-  }
-  if (m_jetRoiPhi.size() == 0) msg() << MSG::INFO << " Not forming any fake JETROIs" <<
-endmsg;
-  for (size_t j=0;j<m_jetRoiPhi.size();j++){
-    if ( m_jetRoiPhi.at(j) <= M_PI && m_jetRoiPhi.at(j) >= -M_PI ) {
-      msg() << MSG::INFO << " Forming fake JETROI with name " << m_jetRoiLabel.at(j)  << "  at phi =  " <<
-        m_jetRoiPhi.at(j) << " eta = "  <<  m_jetRoiEta.at(j) << endmsg;
-    } else {
-      msg() << MSG::INFO << " Not forming fake JETROI " <<m_jetRoiLabel.at(j)  << " phi out of range "<< endmsg;
-    }
-  }
-
-
-  msg() << MSG::INFO << name() << ": Initialization completed successfully" << endmsg;
-
-  return HLT::OK;
-}
-
-
-/////////////////////////////////////////////////////////////////
-// EXECUTE METHOD:
-
-HLT::ErrorCode FakeLvl1MultipleRoIsatFixedEtaPhi::hltExecute( std::vector<HLT::SteeringChain*>& activeSteeringChains ) {
-
-
-
-
-
-  msg() << MSG::DEBUG << "Executing FakeLvl1MultipleRoIsatFixedEtaPhi" << endmsg;
-
-  // activate all configured chains:
-  msg() << MSG::DEBUG << "activating all configured chains." << endmsg;
-
-  for (std::vector<HLT::SteeringChain*>::const_iterator it = m_configuredChains->begin();
-       it != m_configuredChains->end(); ++it) {
-    // set to active:
-    (*it)->setActive();
-    // set pass through state:
-    (*it)->setPassThroughState();
-    activeSteeringChains.push_back( (*it) );
-  }
-
-  HLT::TriggerElement* initialTE = m_config->getNavigation()->getInitialNode();
-  msg() << MSG::DEBUG << "initial Navigation node created." << endmsg;
-
-  // set Lvl1 ID in AlgoConfig:
-  m_config->setLvl1Id(m_lvl1ID);
-
-
-  m_roiId=0;
-  const float zspread = 168.;
-
-  for (size_t em=0; em<m_emRoiPhi.size();em++){
-    if ( m_emRoiPhi.at(em) <= M_PI && m_emRoiPhi.at(em) >= -M_PI ) {
-      HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-      TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId++,
-							       m_emRoiEta.at(em), m_emRoiEta.at(em)-0.1,m_emRoiEta.at(em)+0.1,
-							       m_emRoiPhi.at(em), m_emRoiPhi.at(em)-0.1, m_emRoiPhi.at(em)+0.1,
-							       0.,-zspread,zspread);
-      
-      std::string key;
-      m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-      
-      // build threshold TE
-      unsigned int teId;
-      TrigConf::HLTTriggerElement::getId(m_emRoiLabel.at(em).c_str(), teId);
-      m_config->getNavigation()->addNode(roiTE, teId);
-      
-      msg() << MSG::DEBUG << "created "<< m_emRoiLabel.at(em) << endmsg;
-    }
-  }
-  
-  for (size_t t=0; t<m_tauRoiPhi.size();t++){
-    if ( m_tauRoiPhi.at(t) <= M_PI && m_tauRoiPhi.at(t) >= -M_PI ) {
-      HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-      TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId++,
-							       m_tauRoiEta.at(t), m_tauRoiEta.at(t)-0.4, m_tauRoiEta.at(t)+0.4,
-							       m_tauRoiPhi.at(t), m_tauRoiPhi.at(t)-0.4, m_tauRoiPhi.at(t)+0.4,
-							       0.,-zspread,zspread);
-      
-      std::string key;
-      m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-      // build threshold TE
-      unsigned int teId;
-      TrigConf::HLTTriggerElement::getId(m_tauRoiLabel.at(t).c_str(), teId);
-      m_config->getNavigation()->addNode(roiTE, teId);
-      msg() << MSG::DEBUG << "created" << m_tauRoiLabel.at(t) << endmsg;
-    }
-  }
-
-  for (size_t m=0; m<m_muonRoiPhi.size();m++){
-    if ( m_muonRoiPhi.at(m) <= M_PI && m_muonRoiPhi.at(m) >= -M_PI ) {
-    HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-    TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId++,
-							     m_muonRoiEta.at(m),m_muonRoiEta.at(m)-0.1,m_muonRoiEta.at(m)+0.1,
-							     m_muonRoiPhi.at(m),m_muonRoiPhi.at(m)-0.1,m_muonRoiPhi.at(m)+0.1,
-							       0.,-zspread,zspread);
-
-    std::string key;
-    m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-    // build threshold TE
-    unsigned int teId;
-    TrigConf::HLTTriggerElement::getId(m_muonRoiLabel.at(m).c_str(), teId);
-    m_config->getNavigation()->addNode(roiTE, teId);
-    msg() << MSG::DEBUG << "created"<< m_muonRoiLabel.at(m) << endmsg;
-    }
-  }
-
-  for (size_t j=0; j<m_jetRoiPhi.size();j++){
-    if ( m_jetRoiPhi.at(j) <= M_PI && m_jetRoiPhi.at(j) >= -M_PI ) {
-      HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-      TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId++,
-							       m_jetRoiEta.at(j),m_jetRoiEta.at(j)-0.4,m_jetRoiEta.at(j)+0.4,
-							       m_jetRoiPhi.at(j),m_jetRoiPhi.at(j)-0.4,m_jetRoiPhi.at(j)+0.4,
-							       0.,-zspread,zspread);
-
-
-      std::string key;
-      m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-      
-      // build threshold TE
-      unsigned int teId;
-      TrigConf::HLTTriggerElement::getId(m_jetRoiLabel.at(j).c_str(), teId);
-      m_config->getNavigation()->addNode(roiTE, teId);
-    msg() << MSG::DEBUG << "created " << m_jetRoiLabel.at(j) << endmsg;
-    }
-  }
-
-  m_lvl1ID++;
-  return HLT::OK;
-}
-
-/////////////////////////////////////////////////////////////////
-// FINALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1MultipleRoIsatFixedEtaPhi::hltFinalize() 
-{ 
-  return HLT::OK; 
-}
diff --git a/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.h b/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.h
deleted file mode 100755
index 42b797f6226c..000000000000
--- a/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef FAKELVL1MULTIPLEROISATFIXEDETAPHI_H
-#define FAKELVL1MULTIPLEROISATFIXEDETAPHI_H
-
-#include <string>
-#include <vector>
-#include "TrigSteering/LvlConverter.h"
-
-#define DEFAULT_RoIBRDOLocation "/RoIB/RoIBRDOLocation"
-#define DEFAULT_CaloConfigLocation "/Run/CaloTrigConfig"
-
-class StoreGateSvc;
-class FakeRoI;
-class HepLorentzVector;
-class Hep3Vector;
-
-
-class FakeLvl1MultipleRoIsatFixedEtaPhi : public HLT::LvlConverter
-{
- public:
-
-  FakeLvl1MultipleRoIsatFixedEtaPhi(const std::string& name, const std::string& type,
-			   const IInterface* parent); //!< constructor
-  ~FakeLvl1MultipleRoIsatFixedEtaPhi();
-
-  HLT::ErrorCode hltInitialize();
-  HLT::ErrorCode hltExecute(std::vector<HLT::SteeringChain*>& activeSteeringChains);
-  HLT::ErrorCode hltFinalize();
-
- private:
-
-  unsigned int m_roiId;
-  std::vector<double> m_muonRoiPhi;
-  std::vector<double> m_muonRoiEta;
-  std::vector<std::string> m_muonRoiLabel;
-
-  std::vector<double> m_tauRoiPhi;
-  std::vector<double> m_tauRoiEta;
-  std::vector<std::string> m_tauRoiLabel;
-
-  std::vector<double> m_emRoiPhi;
-  std::vector<double> m_emRoiEta;
-  std::vector<std::string> m_emRoiLabel;
-
-  std::vector<double> m_jetRoiPhi;
-  std::vector<double> m_jetRoiEta;
-  std::vector<std::string> m_jetRoiLabel;
-
-  unsigned int m_lvl1ID; //!< Level 1 ID, in case Level 1 result is read from file
-
-
-};
-
-
-#endif
diff --git a/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.cxx b/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.cxx
deleted file mode 100644
index 164b12a3ea10..000000000000
--- a/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.cxx
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/********************************************************************
-
-NAME:     FakeLvl1RoIatFixedEtaPhi.cxx
-PACKAGE:
-
-AUTHORS: J. Baines        john.baines@rl.ac.uk based on TrigSteer/Lvl1Converstion by
-         G. Comune        gianluca.comune@cern.ch (http://cern.ch/gcomune)
-
-CREATED:  Nov, 2002
-
-PURPOSE:  Fake Lvl1 RoI for seeding Lvl2
-
-Modified :
-
-
-********************************************************************/
-
-#include <stdlib.h>
-#include <vector>
-#include <utility>
-// INCLUDE GAUDI HEADER FILES:
-
-# include "CLHEP/Units/SystemOfUnits.h"
-
-#include "TrigSteeringEvent/TrigRoiDescriptor.h"
-#include "FakeLvl1RoIatFixedEtaPhi.h"
-#include "FakeRoI.h"
-#include "Trajectory.h"
-
-#include "TrigInterfaces/AlgoConfig.h"
-#include "TrigSteering/SteeringChain.h"
-#include "TrigNavigation/Navigation.h"
-#include "TrigNavigation/TriggerElement.h"
-#include "TrigConfHLTData/HLTTriggerElement.h"
-
-#include "CLHEP/Vector/ThreeVector.h"
-
-#include "TrigT1Result/EMTauRoI.h"
-#include "TrigT1Result/JetEnergyResult.h"
-
-#include "TrigT1Interfaces/TrigT1Interfaces_ClassDEF.h"
-#include "TrigT1Interfaces/RecMuonRoI.h"
-#include "TrigT1Interfaces/RecMuonRoiSvc.h"
-
-
-
-
-////////////////////////////////////////////////////////////////
-//  CONSTRUCTOR:
-
-FakeLvl1RoIatFixedEtaPhi::FakeLvl1RoIatFixedEtaPhi(const std::string& name, const std::string& type,
-						   const IInterface* parent)
-  : HLT::LvlConverter(name, type, parent), 
-    m_roiId(0),
-    m_tauRoiPhi(99.),
-    m_tauRoiEta(0.),
-    m_emRoiPhi(99.),
-    m_emRoiEta(0.),
-    m_muonRoiPhi(99.),
-    m_muonRoiEta(0.),
-    m_jetRoiPhi(99.),
-    m_jetRoiEta(0.),
-    m_lvl1ID(1)
-{
-  declareProperty( "FakeEmRoiPhi", m_emRoiPhi=99.);
-  declareProperty( "FakeEmRoiEta", m_emRoiEta);
-
-  declareProperty( "FakeTauRoiPhi", m_tauRoiPhi=99.);
-  declareProperty( "FakeTauRoiEta", m_tauRoiEta);
-
-  declareProperty( "FakeMuonRoiPhi", m_muonRoiPhi=99.);
-  declareProperty( "FakeMuonRoiEta", m_muonRoiEta);
-
-  declareProperty( "FakeJetRoiPhi", m_jetRoiPhi=99.);
-  declareProperty( "FakeJetRoiEta", m_jetRoiEta);
-
-  declareProperty( "FakeEmRoiLabel",   m_emRoiLabel  ="EM01");
-  declareProperty( "FakeMuonRoiLabel", m_muonRoiLabel="MU06");
-  declareProperty( "FakeJetRoiLabel",  m_jetRoiLabel ="JT00");
-  declareProperty( "FakeTauRoiLabel",  m_tauRoiLabel ="TAU01");
-
-}
-
-// DESTRUCTOR:
-
-FakeLvl1RoIatFixedEtaPhi::~FakeLvl1RoIatFixedEtaPhi()
-{ }
-
-
-
-/////////////////////////////////////////////////////////////////
-// INITIALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIatFixedEtaPhi::hltInitialize()
-{
-  msg() << MSG::INFO << " FakeLvl1RoIatFixedEtaPhi creating the following RoI:  " << endmsg;
-  if ( m_emRoiPhi <= M_PI && m_emRoiPhi >= -M_PI ) {
-    msg() << MSG::INFO << " Forming fake EMROI with name " << m_emRoiLabel  << " at phi =  " <<
-      m_emRoiPhi << " eta = "  << m_emRoiEta << endmsg;
-
-  } else {
-    msg() << MSG::INFO << " Not forming fake EMROI" << endmsg;
-  }
-
-  if ( m_tauRoiPhi <= M_PI && m_tauRoiPhi >= -M_PI ) {
-    msg() << MSG::INFO << " Forming fake TAUROI with name " << m_tauRoiLabel  << " at phi =  " <<
-      m_tauRoiPhi << " eta = "  << m_tauRoiEta << endmsg;
-
-  } else {
-    msg() << MSG::INFO << " Not forming fake TAUROI" << endmsg;
-  }
-
-
-
-  if ( m_muonRoiPhi <= M_PI && m_muonRoiPhi >= -M_PI ) {
-    msg() << MSG::INFO << " Forming fake MUONROI with name " << m_muonRoiLabel  << "  at phi =  " <<
-      m_muonRoiPhi << " eta = "   << m_muonRoiEta << endmsg;
-
-  } else {
-    msg() << MSG::INFO << " Not forming fake MUONROI" << endmsg;
-  }
-
-
-  if ( m_jetRoiPhi <= M_PI && m_jetRoiPhi >= -M_PI ) {
-    msg() << MSG::INFO << " Forming fake JETROI with name " << m_jetRoiLabel  << "  at phi =  " <<
-      m_jetRoiPhi << " eta = "  <<  m_jetRoiEta << endmsg;
-
-  } else {
-    msg() << MSG::INFO << " Not forming fake JETROI" << endmsg;
-  }
-
-  msg() << MSG::INFO << name() << ": Initialization completed successfully" << endmsg;
-
-  return HLT::OK;
-}
-
-
-/////////////////////////////////////////////////////////////////
-// EXECUTE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIatFixedEtaPhi::hltExecute( std::vector<HLT::SteeringChain*>& activeSteeringChains ) {
-
-
-
-
-
-  msg() << MSG::DEBUG << "Executing FakeLvl1RoIatFixedEtaPhi" << endmsg;
-
-  // activate all configured chains:
-  msg() << MSG::DEBUG << "activating all configured chains." << endmsg;
-
-  for (std::vector<HLT::SteeringChain*>::const_iterator it = m_configuredChains->begin();
-       it != m_configuredChains->end(); ++it) {
-    // set to active:
-    (*it)->setActive();
-    // set pass through state:
-    (*it)->setPassThroughState();
-    activeSteeringChains.push_back( (*it) );
-  }
-
-  HLT::TriggerElement* initialTE = m_config->getNavigation()->getInitialNode();
-  msg() << MSG::DEBUG << "initial Navigation node created." << endmsg;
-
-  // set Lvl1 ID in AlgoConfig:
-  m_config->setLvl1Id(m_lvl1ID);
-
-
-  m_roiId=0;
-  const float zspread = 168.;
-  if ( m_emRoiPhi <= M_PI && m_emRoiPhi >= -M_PI ) {
-    //    getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,m_emRoiEta, m_emRoiPhi, Frame::instance()->getId2Str(m_emRoiLabel), m_roiId++));
-
-    HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-    TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId,
-							     m_emRoiEta, m_emRoiEta-0.1,m_emRoiEta+0.1,
-							     m_emRoiPhi,m_emRoiPhi-0.1,m_emRoiPhi+0.1,
-							     0., -zspread, zspread);
-
-
-    std::string key;
-    m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-    // build threshold TE
-    unsigned int teId;
-    TrigConf::HLTTriggerElement::getId(m_emRoiLabel.c_str(), teId);
-    m_config->getNavigation()->addNode(roiTE, teId);
-
-    msg() << MSG::DEBUG << "created "<< m_emRoiLabel << endmsg;
-  }
-
-  if ( m_tauRoiPhi <= M_PI && m_tauRoiPhi >= -M_PI ) {
-    //    getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,m_tauRoiEta, m_tauRoiPhi, Frame::instance()->getId2Str(m_tauRoiLabel), m_roiId++));
-
-    HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-    TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId,
-							     m_tauRoiEta,m_tauRoiEta-0.4,m_tauRoiEta+0.4,
-							     m_tauRoiPhi,m_tauRoiPhi-0.4,m_tauRoiPhi+0.4,
-							     0., -zspread, zspread);
-
-
-    std::string key;
-    m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-
-    // build threshold TE
-    unsigned int teId;
-    TrigConf::HLTTriggerElement::getId(m_tauRoiLabel.c_str(), teId);
-    m_config->getNavigation()->addNode(roiTE, teId);
-    msg() << MSG::DEBUG << "created" << m_tauRoiLabel << endmsg;
-  }
-
-  if ( m_muonRoiPhi <= M_PI && m_muonRoiPhi >= -M_PI ) {
-    //    getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000, m_muonRoiEta, m_muonRoiPhi, Frame::instance()->getId2Str(m_muonRoiLabel) ,m_roiId++));
-    HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-    TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId,
-							     m_muonRoiEta,m_muonRoiEta-0.1,m_muonRoiEta+0.1,
-							     m_muonRoiPhi,m_muonRoiPhi-0.1,m_muonRoiPhi+0.1,
-							     0., -zspread, zspread);
-
-
-
-
-    std::string key;
-    m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-
-    // build threshold TE
-    unsigned int teId;
-    TrigConf::HLTTriggerElement::getId(m_muonRoiLabel.c_str(), teId);
-    m_config->getNavigation()->addNode(roiTE, teId);
-    msg() << MSG::DEBUG << "created"<< m_muonRoiLabel << endmsg;
-
-  }
-
-  if ( m_jetRoiPhi <= M_PI && m_jetRoiPhi >= -M_PI ) {
-    //    getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,m_jetRoiEta, m_jetRoiPhi, Frame::instance()->getId2Str(m_jetRoiLabel) ,m_roiId++));
-    HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-    TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId,
-							     m_jetRoiEta,m_jetRoiEta-0.4,m_jetRoiEta+0.4,
-							     m_jetRoiPhi,m_jetRoiPhi-0.4,m_jetRoiPhi+0.4,   
-							     0., -zspread, zspread);
-
-    std::string key;
-    m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-
-    // build threshold TE
-    unsigned int teId;
-    TrigConf::HLTTriggerElement::getId(m_jetRoiLabel.c_str(), teId);
-    m_config->getNavigation()->addNode(roiTE, teId);
-    msg() << MSG::DEBUG << "created " << m_jetRoiLabel << endmsg;
-  }
-
-  m_lvl1ID++;
-  return HLT::OK;
-}
-
-/////////////////////////////////////////////////////////////////
-// FINALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIatFixedEtaPhi::hltFinalize() 
-{ 
-  return HLT::OK; 
-}
diff --git a/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.h b/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.h
deleted file mode 100755
index 6aa57d8a8365..000000000000
--- a/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef FAKELVL1ROIATFIXEDETAPHI_H
-#define FAKELVL1ROIATFIXEDETAPHI_H
-
-#include <string>
-#include <vector>
-#include "TrigSteering/LvlConverter.h"
-
-#define DEFAULT_RoIBRDOLocation "/RoIB/RoIBRDOLocation"
-#define DEFAULT_CaloConfigLocation "/Run/CaloTrigConfig"
-
-class StoreGateSvc;
-class FakeRoI;
-class HepLorentzVector;
-class Hep3Vector;
-
-
-class FakeLvl1RoIatFixedEtaPhi : public HLT::LvlConverter
-{
- public:
-
-  FakeLvl1RoIatFixedEtaPhi(const std::string& name, const std::string& type,
-			   const IInterface* parent); //!< constructor
-  ~FakeLvl1RoIatFixedEtaPhi();
-
-  HLT::ErrorCode hltInitialize();
-  HLT::ErrorCode hltExecute(std::vector<HLT::SteeringChain*>& activeSteeringChains);
-  HLT::ErrorCode hltFinalize();
-
- private:
-
-  unsigned int m_roiId;
-
-  double m_tauRoiPhi;
-  double m_tauRoiEta;
-  double m_emRoiPhi;
-  double m_emRoiEta;
-  double m_muonRoiPhi;
-  double m_muonRoiEta;
-  double m_jetRoiPhi;
-  double m_jetRoiEta;
-
-  std::string m_emRoiLabel;
-  std::string m_muonRoiLabel;
-  std::string m_jetRoiLabel;
-  std::string m_tauRoiLabel;
-
-  unsigned int m_lvl1ID; //!< Level 1 ID, in case Level 1 result is read from file
-
-
-};
-
-
-#endif
diff --git a/Trigger/TrigFake/src/FakeLvl1RoIfromKine.cxx b/Trigger/TrigFake/src/FakeLvl1RoIfromKine.cxx
deleted file mode 100644
index ec18ce925878..000000000000
--- a/Trigger/TrigFake/src/FakeLvl1RoIfromKine.cxx
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*******************************************************************e
-
-NAME:     FakeLvl1RoIfromKine.cxx
-PACKAGE:
-
-AUTHORS: J. Baines        john.baines@rl.ac.uk based on TrigSteer/Lvl1Converstion by
-         G. Comune        gianluca.comune@cern.ch (http://cern.ch/gcomune)
-
-CREATED:  Nov, 2002
-
-PURPOSE:  Fake Lvl1 RoI for seeding Lvl2
-
-Modified :
-
-
-********************************************************************/
-
-#include <stdlib.h>
-#include <vector>
-#include <utility>
-// INCLUDE GAUDI HEADER FILES:
-#include "Gaudi/Property.h"
-#include "GaudiKernel/ISvcLocator.h"
-
-# include "CLHEP/Units/SystemOfUnits.h"
-
-#include "AtlasHepMC/GenEvent.h"
-#include "AtlasHepMC/GenParticle.h"
-#include "GeneratorObjects/McEventCollection.h"
-
-#include "TrigSteeringEvent/TrigRoiDescriptor.h"
-#include "FakeLvl1RoIfromKine.h"
-#include "FakeRoI.h"
-#include "Trajectory.h"
-
-
-#include "TrigInterfaces/AlgoConfig.h"
-#include "TrigSteering/SteeringChain.h"
-#include "TrigNavigation/Navigation.h"
-#include "TrigNavigation/TriggerElement.h"
-#include "TrigConfHLTData/HLTTriggerElement.h"
-
-#include "CLHEP/Vector/ThreeVector.h"
-
-#include "TrigT1Result/EMTauRoI.h"
-#include "TrigT1Result/JetEnergyResult.h"
-
-#include "TrigT1Interfaces/TrigT1Interfaces_ClassDEF.h"
-#include "TrigT1Interfaces/RecMuonRoI.h"
-#include "TrigT1Interfaces/RecMuonRoiSvc.h"
-
-
-
-using namespace TrigFake; // for Trajectory
-using namespace LVL1;
-
-
-////////////////////////////////////////////////////////////////
-//  CONSTRUCTOR:
-
-FakeLvl1RoIfromKine::FakeLvl1RoIfromKine(const std::string& name, const std::string& type,
-						   const IInterface* parent)
-  : HLT::LvlConverter(name, type, parent),
-    m_roiId(0),
-    m_mcEventCollectionName("")
-{
-
-  declareProperty("McEventCollectionName", m_mcEventCollectionName="GEN_EVENT");
-
-  declareProperty( "FakeEmTauRoiParticleIDs", m_emTauRoiParticles);
-  declareProperty( "FakeEmTauRoiPtMin", m_emTauRoiPtMin=20.*CLHEP::GeV);
-  declareProperty( "FakeEmTauRoiEtaMax", m_emTauRoiEtaMax=2.5);
-
-  declareProperty( "FakeMuonRoiParticleIDs",  m_muonRoiParticles);
-  declareProperty( "FakeMuonRoiPtMin",  m_muonRoiPtMin=20.*CLHEP::GeV);
-  declareProperty( "FakeMuonRoiEtaMax",  m_muonRoiEtaMax=2.5);
-
-  declareProperty( "FakeJetRoiParticleIDs",   m_jetRoiParticles);
-  declareProperty( "FakeJetRoiPtMin",   m_jetRoiPtMin=20.*CLHEP::GeV);
-  declareProperty( "FakeJetRoiEtaMax",   m_jetRoiEtaMax=2.5);
-
-  declareProperty( "FakeEmRoiLabel",   m_emRoiLabel  ="EM10");
-  declareProperty( "FakeMuonRoiLabel", m_muonRoiLabel="MU06");
-  declareProperty( "FakeJetRoiLabel",  m_jetRoiLabel ="JET20");
-  declareProperty( "FakeTauRoiLabel",  m_tauRoiLabel ="HA10");
-
-}
-
-// DESTRUCTOR:
-
-FakeLvl1RoIfromKine::~FakeLvl1RoIfromKine()
-{ }
-
-/////////////////////////////////////////////////////////////////
-// INITIALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIfromKine::hltInitialize()
-{
-  //  if ( m_particleDataTable.empty() ) {
-  //(*m_log) << MSG::WARNING << "FakeLvl1RoIfromKine failed to read particleDataTable" << endmsg;
-  //return StatusCode::FAILURE;
-  // }
-
-  if (! m_emTauRoiParticles.empty()) {
-    std::vector<int>::iterator emParticle=m_emTauRoiParticles.begin();
-    std::vector<int>::iterator lastEmParticle=m_emTauRoiParticles.end();
-    msg(MSG::INFO) << " Forming fake EMROI (" << m_emRoiLabel << ") from the following kine particle IDs : ";
-    for ( ; emParticle != lastEmParticle ; emParticle++ ) {
-      msg() << *emParticle << " " ;
-    }
-    msg() << endmsg;
-    ATH_MSG_INFO(" with ET > " << m_emTauRoiPtMin <<
-                 " and |eta| < " << m_emTauRoiEtaMax);
-  } else {
-    ATH_MSG_INFO(" Not forming fake EMROI (" << m_emRoiLabel << ")");
-  }
-
-  if ( ! m_muonRoiParticles.empty()) {
-    std::vector<int>::iterator muParticle=m_muonRoiParticles.begin();
-    std::vector<int>::iterator lastMuParticle=m_muonRoiParticles.end();
-    msg(MSG::INFO) << " Forming fake MUONROI (" << m_muonRoiLabel << ") from the following kine particle IDs : ";
-    for ( ; muParticle != lastMuParticle ; muParticle++ ) {
-      msg() << *muParticle << " " ;
-    }
-    msg() << endmsg;
-    ATH_MSG_INFO(" with pT > " << m_muonRoiPtMin <<
-                 " and |eta| < " << m_muonRoiEtaMax);
-  } else {
-    ATH_MSG_INFO(" Not forming fake MUONROI (" << m_muonRoiLabel << ")");
-  }
-
-
-  if ( ! m_jetRoiParticles.empty()) {
-    std::vector<int>::iterator muParticle=m_jetRoiParticles.begin();
-    std::vector<int>::iterator lastMuParticle=m_jetRoiParticles.end();
-    msg(MSG::INFO) << " Forming fake JETROI (" <<  m_jetRoiLabel << ") from the following kine particle IDs : ";
-    for ( ; muParticle != lastMuParticle ; muParticle++ ) {
-      msg() << *muParticle << " " ;
-    }
-    msg() << endmsg;
-    ATH_MSG_INFO(" with pT > " << m_jetRoiPtMin<<
-                 " and |eta| < " << m_jetRoiEtaMax);
-  } else {
-    ATH_MSG_INFO(" Not forming fake JETROI (" <<  m_jetRoiLabel << ")");
-  }
-
-  return HLT::OK;
-}
-
-/////////////////////////////////////////////////////////////////
-// FINALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIfromKine::hltFinalize()
-{
-  return HLT::OK;
-}
-
-/////////////////////////////////////////////////////////////////
-// EXECUTE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIfromKine::hltExecute( std::vector<HLT::SteeringChain*>& activeSteeringChains )
-{
-  ATH_MSG_DEBUG("Executing FakeLvl1RoIfromKine");
-
-  // activate all configured chains:
-  ATH_MSG_DEBUG("activating all configured chains.");
-
-  for (std::vector<HLT::SteeringChain*>::const_iterator it = m_configuredChains->begin();
-       it != m_configuredChains->end(); ++it) {
-    // set to active:
-    (*it)->setActive();
-    // set pass through state:
-    (*it)->setPassThroughState();
-    activeSteeringChains.push_back( (*it) );
-  }
-
-
-  //  HLT::TriggerElement* initialTE = m_config->getNavigation()->getInitialNode();
-  //  (*m_log) << MSG::DEBUG << "initial Navigation node created." << endmsg;
-
-  m_roiId=0;
-  std::vector<FakeRoI> *roiList;
-  roiList = createRoIfromMC();
-
-
-  int nCreatedRoI=0;
-  std::vector< FakeRoI>::iterator firstroi =  roiList->begin();
-  std::vector< FakeRoI>::iterator lastRoi =   roiList->end();
-  for ( std::vector< FakeRoI>::iterator iroi = firstroi; iroi != lastRoi; iroi++) {
-
-    // skip duplicate roi
-    bool doneAlready = false;
-    std::vector< FakeRoI>::iterator jroi = firstroi;
-    for (; jroi != iroi; jroi++ ) {
-      if ( iroi->type() == jroi->type()){
-	double deta = fabs (jroi->eta() - iroi->eta());
-	double dphi = (jroi->phi() - iroi->phi());
-	double absdphi = fabs(dphi);
-	if (2.*M_PI-absdphi < absdphi) {
-	  if (dphi > 0) { dphi = dphi - 2.*M_PI;} else { dphi = 2*M_PI - absdphi;}
-	}
-        if ((fabs(deta) < 0.1) && (fabs (dphi) < 0.1)) doneAlready=true;
-      }
-    }
-    if (not doneAlready) {
-      if ( (this)->createRoI(*iroi).isSuccess()) nCreatedRoI++;
-    }
-  }
-
-  if ( nCreatedRoI == 0) {
-    ATH_MSG_DEBUG("FakeLvl1RoIfromKine did not create any RoI");
-} else {
-    ATH_MSG_DEBUG("FakeLvl1RoIfromKine created " << nCreatedRoI << " RoI");
-  }
-
-  delete roiList;
-
-  return HLT::OK;
-}
-
-StatusCode FakeLvl1RoIfromKine::createRoI(FakeRoI &fakeRoi) {
-
-
-
-  HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( m_config->getNavigation()->getInitialNode() );
-  const float zspread = 168.;
-  
-  TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, 0, m_roiId,
-							   fakeRoi.eta(),fakeRoi.eta()-0.1,fakeRoi.eta()+0.1,
-							   fakeRoi.phi(),fakeRoi.phi()-0.1,fakeRoi.phi()+0.1,
-							   0.-zspread, zspread);
-  std::string key;
-  m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-  // build threshold TE
-  unsigned int teId;
-  TrigConf::HLTTriggerElement::getId(fakeRoi.type().c_str(), teId);
-  m_config->getNavigation()->addNode(roiTE, teId);
-
-  m_roiId++;
-
-  /*
-    if(fakeRoi.type() == m_emRoiLabel) getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,fakeRoi.eta(), fakeRoi.phi(), Frame::instance()->getId2Str(m_emRoiLabel), m_roiId++));
-    if(fakeRoi.type() == m_muonRoiLabel) getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,fakeRoi.eta(), fakeRoi.phi(), Frame::instance()->getId2Str(m_muonRoiLabel) ,m_roiId++));
-    if(fakeRoi.type() == m_jetRoiLabel) getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,fakeRoi.eta(), fakeRoi.phi(), Frame::instance()->getId2Str(m_jetRoiLabel) ,m_roiId++));
-    if(fakeRoi.type() == m_tauRoiLabel) getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,fakeRoi.eta(), fakeRoi.phi(), Frame::instance()->getId2Str(m_tauRoiLabel) ,m_roiId++));
-  */
-
-
-  ATH_MSG_DEBUG(" REGTEST created an " <<  fakeRoi.type() << " RoI " << *roiDescriptor);
-
-
-  return StatusCode::SUCCESS;
-}
-
-std::vector<FakeRoI> * FakeLvl1RoIfromKine::createRoIfromMC() {
-
-  std::vector<FakeRoI> *fakeRoiList = new std::vector<FakeRoI>;
-
-  //  Get the collection generator events (physics and pile-up) making up this event
-
-  const McEventCollection* mcEvents;
-  StatusCode sc = evtStore()->retrieve( mcEvents, m_mcEventCollectionName );
-  if( sc.isFailure() ) {
-    ATH_MSG_INFO("Could not retrieve mcEventCollection with key " << m_mcEventCollectionName);
-    return fakeRoiList;
-  };
-
-  // Loop over the generator events
-  McEventCollection::const_iterator  evt = mcEvents->begin();
-  //McEventCollection::const_iterator  lastevt = mcEvents->end();
-
-  // for ( ; evt != lastevt; evt++) {
-  double qq = 0;
-
-  // loop over Particles in this generator event
-  for ( HepMC::GenEvent::particle_const_iterator p = (*evt)->particles_begin();
-	p != (*evt)->particles_end(); ++p ) {
-
-    int pdgid= (*p)->pdg_id();
-
-    std::vector<int>::iterator emParticle=m_emTauRoiParticles.begin();
-    std::vector<int>::iterator lastEmParticle=m_emTauRoiParticles.end();
-    bool formEmTauRoi=false;
-    for ( ; emParticle != lastEmParticle ; emParticle++ ) {
-      if (pdgid == *emParticle && (*p)->momentum().perp() > m_emTauRoiPtMin &&
-	 (*p)->momentum().pseudoRapidity() < m_emTauRoiEtaMax ) formEmTauRoi=true;
-    }
-    if ( formEmTauRoi ) {
-      // temp fix:
-      if (pdgid == 22) {
-	qq = 0.;
-      } else if (pdgid > 0) { qq = -1; } else { qq = 1; };
-      Trajectory track((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(),
-		       (*p)->production_vertex()->position().x(),
-		       (*p)->production_vertex()->position().y(),
-		       (*p)->production_vertex()->position().z(), qq);
-
-      ATH_MSG_VERBOSE(" Forming EMROI (" << m_emRoiLabel << ") from kine ID " << pdgid << " charge " << qq);
-      ATH_MSG_VERBOSE(" Address " << std::hex << (*p) << std::dec);
-      ATH_MSG_VERBOSE(" px " << (*p)->momentum().px() <<
-                      " py " <<  (*p)->momentum().py() << " pz " << (*p)->momentum().pz());
-      ATH_MSG_VERBOSE(" vx " << (*p)->production_vertex()->position().x() <<
-                      " vy " <<  (*p)->production_vertex()->position().y() <<
-                      " vz " << (*p)->production_vertex()->position().z());
-      ATH_MSG_VERBOSE(" pt " << (*p)->momentum().perp() <<
-                      " phi " << (*p)->momentum().phi() << " eta " << track.eta());
-      ATH_MSG_VERBOSE(" Closest approach to origin : d0 " << track.d0() <<
-                      " phi0 " << track.phi0() << " z0 " << track.z0());
-#define RCAL 147.
-#define ZCAL 380.
-      std::pair<double, double> etaPhi = track.etaPhiAtCylinder(RCAL, ZCAL);
-
-      ATH_MSG_VERBOSE(" At calorimeter : phi " << etaPhi.second <<
-	" eta " << etaPhi.first);
-      FakeRoI fakeRoi(m_emRoiLabel, etaPhi.second, etaPhi.first);
-      fakeRoiList->push_back(fakeRoi);
-    }
-
-    // MUONROI
-
-    std::vector<int>::iterator muParticle=m_muonRoiParticles.begin();
-    std::vector<int>::iterator lastMuParticle=m_muonRoiParticles.end();
-    bool formMuonRoi=false;
-    for ( ; muParticle != lastMuParticle ; muParticle++ ) {
-      if (pdgid == *muParticle && (*p)->momentum().perp() > m_muonRoiPtMin &&
-	 (*p)->momentum().pseudoRapidity() < m_muonRoiEtaMax) formMuonRoi=true;
-    }
-    if ( formMuonRoi ) {
-
-      ATH_MSG_VERBOSE(" Forming MUONROI (" << m_muonRoiLabel << ") from kine ID " << pdgid <<
-                      " pt " << (*p)->momentum().perp() <<
-                      " phi " << (*p)->momentum().phi() <<
-                      " eta " << (*p)->momentum().pseudoRapidity());
-
-
-      Trajectory track((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(),
-		       (*p)->production_vertex()->position().x(),
-		       (*p)->production_vertex()->position().y(),
-		       (*p)->production_vertex()->position().z(), qq);
-
-#define RCAL 147.
-#define ZCAL 380.
-      std::pair<double, double> etaPhi = track.etaPhiAtCylinder(RCAL, ZCAL);
-
-      ATH_MSG_VERBOSE(" At ID outer radius : phi " << etaPhi.second <<
-                      " eta " << etaPhi.first);
-      FakeRoI fakeRoi(m_muonRoiLabel, etaPhi.second, etaPhi.first);
-      fakeRoiList->push_back(fakeRoi);
-
-    }
-
-    // JETROI
-
-    std::vector<int>::iterator jetParticle=m_jetRoiParticles.begin();
-    std::vector<int>::iterator lastJetParticle=m_jetRoiParticles.end();
-    bool formJetRoi=false;
-    for ( ; jetParticle != lastJetParticle ; jetParticle++ ) {
-      if (pdgid == *jetParticle && (*p)->momentum().perp() > m_jetRoiPtMin &&
-	 (*p)->momentum().pseudoRapidity() < m_jetRoiEtaMax) formJetRoi=true;
-    }
-    if ( formJetRoi ) {
-
-      ATH_MSG_VERBOSE(" Forming JETROI (" <<  m_jetRoiLabel << ") from kine ID " << pdgid <<
-                      " pt " << (*p)->momentum().perp() <<
-                      " phi " << (*p)->momentum().phi() <<
-                      " eta " << (*p)->momentum().pseudoRapidity());
-      FakeRoI fakeRoi(m_jetRoiLabel,(*p)->momentum().phi() ,(*p)->momentum().pseudoRapidity());
-      fakeRoiList->push_back(fakeRoi);
-    }
-
-  }
-  //}
-  return fakeRoiList;
-}
diff --git a/Trigger/TrigFake/src/FakeLvl1RoIfromKine.h b/Trigger/TrigFake/src/FakeLvl1RoIfromKine.h
deleted file mode 100755
index 230eee2a38e9..000000000000
--- a/Trigger/TrigFake/src/FakeLvl1RoIfromKine.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef FAKELVL1ROIFROMKINE_H
-#define FAKELVL1ROIFROMKINE_H
-
-#include <string>
-#include <vector>
-#include "TrigSteering/LvlConverter.h"
-
-#define DEFAULT_RoIBRDOLocation "/RoIB/RoIBRDOLocation"
-#define DEFAULT_CaloConfigLocation "/Run/CaloTrigConfig"
-
-class StoreGateSvc;
-class FakeRoI;
-class HepLorentzVector;
-class Hep3Vector;
-
-class FakeLvl1RoIfromKine : public HLT::LvlConverter {
- public:
-  FakeLvl1RoIfromKine(const std::string& name, const std::string& type,
-		      const IInterface* parent); //!< constructor
-  ~FakeLvl1RoIfromKine();
-
-  HLT::ErrorCode hltInitialize();
-  HLT::ErrorCode hltExecute(std::vector<HLT::SteeringChain*>& activeSteeringChains);
-  HLT::ErrorCode hltFinalize();
-
- private:
-
-  std::vector<FakeRoI> * createRoIfromMC();
-  StatusCode createRoI(FakeRoI &roi);
-
- private:
-
-  unsigned int m_roiId;
-
-  std::string m_mcEventCollectionName;
-  double m_emTauRoiPtMin;
-  double m_emTauRoiEtaMax;
-  double m_muonRoiPtMin;
-  double m_muonRoiEtaMax;
-  double m_jetRoiPtMin;
-  double m_jetRoiEtaMax;
-  std::vector<int> m_emTauRoiParticles;
-  std::vector<int> m_muonRoiParticles;
-  std::vector<int> m_jetRoiParticles;
-
-  std::string m_emRoiLabel;
-  std::string m_muonRoiLabel;
-  std::string m_jetRoiLabel;
-  std::string m_tauRoiLabel;
-
-};
-
-#endif
diff --git a/Trigger/TrigFake/src/FakeRoI.h b/Trigger/TrigFake/src/FakeRoI.h
deleted file mode 100755
index 22345cd2c6fb..000000000000
--- a/Trigger/TrigFake/src/FakeRoI.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef FAKEROI_H
-#define FAKEROI_H
-#include <string> 
-
-class FakeRoI {
- public:
-
-  FakeRoI(std::string type, double phi, double eta) : 
-    m_type(type), m_phi(phi), m_eta(eta) {};
-
-  ~FakeRoI() {};
-  
- public:
-  std::string type () const { return m_type; } ;
-  double phi () const { return m_phi ; } ;
-  double eta () const { return m_eta ; } ;
-  
- private:
-  std::string m_type;
-  double m_phi;
-  double m_eta;
-};
-#endif
diff --git a/Trigger/TrigFake/src/Trajectory.cxx b/Trigger/TrigFake/src/Trajectory.cxx
deleted file mode 100644
index 44113db61aec..000000000000
--- a/Trigger/TrigFake/src/Trajectory.cxx
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include<cmath>
-#include "Trajectory.h"
-
-namespace TrigFake{
-Trajectory::Trajectory(double px_MeV, double py_MeV, double pz_MeV, 
-		       double vx_mm, double vy_mm, double vz_mm, double q) {
-
-  double px = px_MeV/1000; // GeV
-  double py = py_MeV/1000; // GeV
-  double pz = pz_MeV/1000; // GeV
-		       
-  double vx = vx_mm/10; // cm
-  double vy = vy_mm/10; // cm
-  double vz = vz_mm/10; // cm
-
-  m_q = q;
-  m_pz = pz; 
-
-  m_pT = sqrt( px*px + py*py ); 
-  m_theta = atan2(m_pT,m_pz);
-  
-  double pzpt=m_pz/m_pT;
-
-  m_eta=log(pzpt+sqrt(1.0+pzpt*pzpt));
-
-  double Rv  = sqrt( vx*vx + vy*vy ); 
-
-  // calculate parameters at closest approach to origin
-  
-#define Bfield 2.
-  m_Rcurv = 100. * m_pT/(0.3*Bfield);  // cm; 
-  
-  if (m_q != 0) {
-    double phiR = atan2(py,px) - m_q*M_PI_2;
-    double Ox = vx + m_Rcurv * cos(phiR);
-    double Oy = vy + m_Rcurv * sin(phiR);
-    double Ro = sqrt(Ox*Ox + Oy*Oy);
-    double d01 = Ro + m_Rcurv;
-    double d02 = Ro - m_Rcurv;
-    if (d01*d02 > 0) {
-      m_d0 = std::min(fabs(d01), fabs(d02));
-    } else {
-      m_d0 = -std::min(fabs(d01), fabs(d02));
-    }
-    m_phi0 = atan2(Oy,Ox) + m_q*M_PI_2;
-    m_z0 = vz - m_pz * (Rv - fabs(m_d0)) / m_pT;
-  } else {
-    m_phi0 = atan2(py,px);
-    m_d0 = fabs(vx * sin(m_phi0) - vy * cos(m_phi0));
-    m_z0 = vz - m_pz * (Rv - m_d0) / m_pT;
-  }
-
-  while (m_phi0 < -M_PI) m_phi0 = m_phi0 + 2.*M_PI;
-  while (m_phi0 > M_PI) m_phi0 = m_phi0 - 2.*M_PI;
-
-}
-
-
-/* ---------------------------------------------------------------------- */
-std::pair<double,double> Trajectory::etaPhiAtCylinder(double rC_mm, double zC_mm) const {
-    
-  double rC = rC_mm/10.; //cm
-  double zC = zC_mm/10.; //cm 
-
-  // Calculate intercept with cylinder
-  
-  double phiC = 0;
-  // double etaC = 0; // etaC is not being used -> compiler warnings
-  if (rC > 0  && fabs(zC) > 0 && m_pT != 0 && fabs(m_z0) < zC) {
-
-    /* r, z of intersection with cylinder */
-    
-    double r;
-    double z = m_z0 + m_pz * (rC - fabs(m_d0)) / m_pT;
-    if (fabs(z) > fabs(zC)) {
-      /* track passes through the end of the cylinder */
-      if (z > 0) z = fabs(zC); else z = -fabs(zC); 
-      r = fabs(m_d0) + (z - m_z0) * m_pT / m_pz;
-      r = fabs(r);   /* NOT SURE IF -ve r is handled correctly */
-    } else r = rC;      /* hits barrel of cylinder */
-    
-    /* etaC is not being used -> compiler warnings
-       double theta = atan2(r, fabs(z)) / 2.;
-
-       if (z > 0) etaC = -log(tan(theta));
-       else etaC = log(tan(theta));
-    */
-
-    /* Now calculate phiC */
-
-    if (m_q == 0) {                /* Neutral Track */
-      if (fabs(m_d0) <= r) phiC = m_phi0 - asin(fabs(m_d0)/r);
-    } else {                      /* Charged track */
-      double xD = 2. * r*(m_Rcurv + m_d0);
-      if (xD != 0) {
-	double xN = m_d0 * m_d0 + r * r + 2. * m_Rcurv * m_d0;
-	if (fabs(xN)/fabs(xD) > 1) {
-	  /* trajectory does not reach r, track loops
-	  ***temporary set dphi to 0 for this case */
-	  phiC = 2. * M_PI;
-	} else {
-	  double dphi = m_q*acos(xN/xD);
-	  /* two solutions from the 2 intersections of the 2 circles,
-	     but phi0 defines a direction, so the first solution
-	     should be the one we want....*/
-	  phiC = m_phi0 - m_q*M_PI_2 + dphi;
-	}
-      }   else phiC = 0; /* means track is orbiting the origin */
-      
-    }
-    /* fold back into 0-2pi */
-    while (phiC > M_PI) phiC = phiC - 2. * M_PI;
-    while (phiC < -M_PI) phiC = phiC + 2. * M_PI;
-  }
-
-  std::pair<double, double> etaPhi(m_eta, phiC);
-  return etaPhi;
-}
-
-}
diff --git a/Trigger/TrigFake/src/Trajectory.h b/Trigger/TrigFake/src/Trajectory.h
deleted file mode 100755
index ccff309d5021..000000000000
--- a/Trigger/TrigFake/src/Trajectory.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRAJECTORY_H
-#define TRAJECTORY_H
-#include <string> 
-#include <utility>
-
-namespace TrigFake{
-
-class Trajectory {
- public:
-  Trajectory(double px, double py, double pz, double vx, double vy, double vz, double q);
-  ~Trajectory(){};
-
- public:
-  
-  double d0() const { return m_d0; };
-  double phi0() const { return m_phi0; };
-  double z0() const { return m_z0; };
-  double Rcurv() const { return m_Rcurv; };
-  double eta() const { return m_eta; };
-  double theta() const { return m_theta; };
-  double pz() const { return m_pz; };
-  double pT() const { return m_pT; };
-
-  std::pair<double,double> etaPhiAtCylinder(double rC, double zC) const ;
-  
-
- private:
-  
-  double m_d0; 
-  double m_phi0;
-  double m_Rcurv;
-  double m_z0;
-  double m_q;
-  double m_eta;
-  double m_theta;
-  double m_pz;
-  double m_pT;
-
-
-};
-}
-#endif
diff --git a/Trigger/TrigFake/src/ZVertexFromKine.cxx b/Trigger/TrigFake/src/ZVertexFromKine.cxx
deleted file mode 100644
index 9b0f9d3b6e1c..000000000000
--- a/Trigger/TrigFake/src/ZVertexFromKine.cxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/********************************************************************                               
-                               
-NAME:     ZVertexFromKine.cxx                               
-PACKAGE:                                 
-                               
-AUTHOR:   Nikos Konstantinidis
-         
-CREATED:  May 2005                               
-                               
-PURPOSE:  Make z of first MC particle available to algorithms
-                               
-Modified :
-         
-                               
-********************************************************************/                               
-
-#include "AtlasHepMC/GenEvent.h"
-#include "AtlasHepMC/GenParticle.h"
-#include "GeneratorObjects/McEventCollection.h"
-
-#include "TrigInDetEvent/TrigVertexCollection.h"
-#include "TrigInDetEvent/TrigVertex.h"
-
-#include "ZVertexFromKine.h"                               
-
-
-
-      
-////////////////////////////////////////////////////////////////                               
-//  CONSTRUCTOR:                               
-                                   
-ZVertexFromKine::ZVertexFromKine(const std::string& name, ISvcLocator* pSvcLocator):                                
-  AthAlgorithm(name, pSvcLocator)
-{
-
-  declareProperty("McEventCollectionName", m_mcEventCollectionName="GEN_EVENT");
-
-}                               
-                               
-// DESTRUCTOR:                               
-                                  
-ZVertexFromKine::~ZVertexFromKine()                               
-{ }                               
-                               
-/////////////////////////////////////////////////////////////////                               
-// INITIALIZE METHOD:                               
-                                      
-StatusCode ZVertexFromKine::initialize()                               
-{                               
-  return StatusCode::SUCCESS;                               
-}                               
-                               
-/////////////////////////////////////////////////////////////////                               
-// FINALIZE METHOD:                               
-                                 
-StatusCode ZVertexFromKine::finalize() { return StatusCode::SUCCESS; }                               
-                               
-/////////////////////////////////////////////////////////////////                               
-// EXECUTE METHOD:                               
-                                 
-StatusCode ZVertexFromKine::execute()                               
-{                                
-                               
-   ATH_MSG_DEBUG("Executing ZVertexFromKine");
-
-  //  Get the collection generator events (physics and pile-up) making up this event 
-  
-  const McEventCollection* mcEvents;
-  StatusCode sc = evtStore()->retrieve( mcEvents, m_mcEventCollectionName );
-  if( sc.isFailure() ) {
-     ATH_MSG_INFO( "Could not retrieve mcEventCollection with key " << m_mcEventCollectionName); 
-     return StatusCode::SUCCESS; 
-  };
-
-  McEventCollection::const_iterator  event = mcEvents->begin();
-  HepMC::GenVertex* vertex = *((*event)->vertices_begin());
-
-  TrigVertexCollection* zinfo = new TrigVertexCollection();
-  TrigVertex* zvert = new TrigVertex( vertex->position().z() );
-  zinfo->push_back(zvert);
-
-  if( evtStore()->record( zinfo, "TrueTrigVertexColl" ) ) {
-     ATH_MSG_DEBUG("Stored TrueTrigVertexColl");
-  }
-  else {
-     ATH_MSG_WARNING("Failed to Store TrueTrigVertexColl");
-  }
-
-  return StatusCode::SUCCESS;
-}
-
diff --git a/Trigger/TrigFake/src/ZVertexFromKine.h b/Trigger/TrigFake/src/ZVertexFromKine.h
deleted file mode 100755
index 16caa84c5f48..000000000000
--- a/Trigger/TrigFake/src/ZVertexFromKine.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ZVERTEXFROMKINE_H
-#define ZVERTEXFROMKINE_H
-
-#include <string>
-
-#include "AthenaBaseComps/AthAlgorithm.h"
-
-class ZVertexFromKine : public AthAlgorithm 
-{
-public:
-  
-   ZVertexFromKine(const std::string& name, ISvcLocator* pSvcLocator);
-   ~ZVertexFromKine();
-  
-   StatusCode initialize();
-   StatusCode execute();
-   StatusCode finalize();
-
-private:
-
-   std::string m_mcEventCollectionName;
-};
-
-
-#endif
diff --git a/Trigger/TrigFake/src/components/TrigFake_entries.cxx b/Trigger/TrigFake/src/components/TrigFake_entries.cxx
deleted file mode 100644
index 78d495b978e9..000000000000
--- a/Trigger/TrigFake/src/components/TrigFake_entries.cxx
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "../FakeLvl1RoIatFixedEtaPhi.h"
-#include "../FakeLvl1MultipleRoIsatFixedEtaPhi.h"
-//#include "TrigFake/FakeLvl1ConversionTestBeam.h"
-#include "../FakeLvl1RoIfromKine.h"
-#include "../ZVertexFromKine.h"
-
-
-DECLARE_COMPONENT( FakeLvl1RoIfromKine )
-  //DECLARE_COMPONENT( FakeLvl1ConversionTestBeam )
-DECLARE_COMPONENT( FakeLvl1RoIatFixedEtaPhi )
-DECLARE_COMPONENT( FakeLvl1MultipleRoIsatFixedEtaPhi )
-DECLARE_COMPONENT( ZVertexFromKine )
-
diff --git a/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py b/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py
index b0661a7e89cc..1f389d2ad7c3 100755
--- a/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py
+++ b/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py
@@ -27,7 +27,6 @@ if not "usePrescaleMenu" in dir(): usePrescaleMenu = False
 if not "useMultiSeedingMenu" in dir(): useMultiSeedingMenu = False
 if not "useMenuWithAcceptInput" in dir(): useMenuWithAcceptInput = False
 if not "useBusyEventSetup" in dir(): useBusyEventSetup = False
-if not "l1SeedingTest" in dir(): l1SeedingTest = False
 
 # Default L1 RoIs if not set otherwise below
 
@@ -100,24 +99,6 @@ EM15i,EM25i
 EM15i,EM25i
 """
 
-elif l1SeedingTest:
-    include("TrigSteering/pureSteering_l1Seeding_menu.py")
-    RoIs = "MU6, MU20\n"*7
-    # see for info about 
-    # 106 is ctp ID of L1_MU06 120 is for L1_MU20 and 121 for L1_MU21
-    #
-    ctpbits = "106:1,0 120:1,1\n" 
-    ctpbits += "106:1,1 120:0,0 121:1,1\n" # L1_MU21 active
-    ctpbits += "106:1,0 120:1,1 121:0,0\n"  # L1_MU20 acts ( the other is inactive )
-    ctpbits += "106:1,1 120:1,1 121:0,0\n"
-    ctpbits += "106:1,1 120:1,1 121:0,0\n"
-    ctpbits += "106:1,1 120:1,1 121:0,0\n"
-    ctpbits += "106:1,1 120:1,0 121:0,0\n" # L1_MU20 activated but prescaled
-
-    ctpfile=open("Lvl1CTPResults.txt", "w")
-    ctpfile.write(ctpbits)
-    ctpfile.close()
-
 else:
     include("TrigSteering/pureSteering_menu.py")
 
@@ -191,21 +172,6 @@ if runMergedSteering:
         hltSteer.ResultBuilder.ErrorStreamTags = ["ABORT_CHAIN ALGO_ERROR GAUDI_EXCEPTION: hltexceptions physics", "ABORT_EVENT ALGO_ERROR TIMEOUT: hlttimeout debug"]
         hltSteer.softEventTimeout = 1 * Units.s
 
-    if l1SeedingTest:
-        from TrigSteering.TestingTrigSteeringConfig import TestingLvl1Converter
-        lvl1Converter = TestingLvl1Converter()
-        hltSteer += lvl1Converter        
-        hltSteer.LvlConverterTool = lvl1Converter
-        hltSteer.LvlConverterTool.useL1Calo = False
-        hltSteer.LvlConverterTool.useL1Muon = False
-        hltSteer.LvlConverterTool.useL1JetEnergy = False
-        hltSteer.LvlConverterTool.OutputLevel = DEBUG
-        from TrigFake.TrigFakeConf import FakeRoIB
-        fakeRoIB = FakeRoIB()
-        fakeRoIB.OutputLevel = DEBUG
-        fakeRoIB.InputFile="Lvl1CTPResults.txt"
-        job += fakeRoIB
-
     job += hltSteer
 
 
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
index 634c3b2c8cdb..08b09f487c81 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
@@ -589,27 +589,6 @@ class forceMuonDataPrep(_modifier):
     def preSetup(self):
         pass  # the actual modifier is implemented in share/Trigger_topOptions_standalone.py
 
-class FakeLVL1(_modifier):
-    """
-    setup fake LVL1 RoIs
-    """
-    def postSetup(self):
-        from TrigFake.TrigFakeConf import FakeLvl1RoIatFixedEtaPhi
-        fake = FakeLvl1RoIatFixedEtaPhi()
-        fake.FakeMuonRoiPhi=TriggerFlags.CosmicSlice.FakeLVL1ROIPhi()
-        fake.FakeMuonRoiEta=TriggerFlags.CosmicSlice.FakeLVL1ROIEta()
-        #fake.FakeMuonRoiEta=0.5
-        fake.FakeMuonRoiLabel=TriggerFlags.CosmicSlice.FakeLVL1Threshold()
-        from AthenaCommon.AlgSequence import AlgSequence
-        topSequence = AlgSequence()
-        if hasattr(topSequence,"TrigSteer_HLT"):
-            topSequence.TrigSteer_HLT.LvlConverterTool =  fake
-            if (TriggerFlags.CosmicSlice.forceLVL2Accept()):
-                svcMgr.HltEventLoopMgr.ForceLvl2Accept =  True
-            if (TriggerFlags.CosmicSlice.filterEmptyROB()):
-                svcMgr.ROBDataProviderSvc.filterEmptyROB=True
-
-
 class rerunLVL1(_modifier):
     """
     Reruns the L1 simulation on real data
-- 
GitLab


From 517e03dc3d6fc98d146ef41b4f5ec5ebe83ef8c9 Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Tue, 22 Sep 2020 08:02:20 -0700
Subject: [PATCH 361/422] Add preprocessor directives for workaround re: AB vs.
 Ath

---
 .../Root/MVATrackVertexAssociationTool.cxx    | 15 ++++++++-
 .../MVATrackVertexAssociationTool.h           | 32 +++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
index 4ea6e7b3856d..b8793af58a66 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -24,7 +24,18 @@ namespace CP {
 
 MVATrackVertexAssociationTool::MVATrackVertexAssociationTool(const std::string& name) :
   AsgTool(name)
-{}
+{
+  #ifndef XAOD_STANDALONE
+  declareProperty("NetworkFileName", m_fileName,        "Name of the input lwtnn network file."                                                              );
+  declareProperty("InputNames",      m_inputNames,      "Vector of the network's input variable names (std::vector<std::string>)."                           );
+  declareProperty("InputTypes",      m_inputTypes,      "Vector of the network's input variable evaluator types (std::vector<CP::MVAEvaluatorInput::Input>).");
+  declareProperty("OutputNodeName",  m_outputName,      "Name of the output node to cut on for TVA."                                                         );
+  declareProperty("IsSequential",    m_isSequential,    "Is the network sequential (true) or functional (false)."                                            );
+  declareProperty("WorkingPoint",    m_wp,              "TVA working point to apply."                                                                        );
+  declareProperty("OutputCut",       m_cut,             "TVA cut value on the output value (set manually with \"Custom\" WP)."                               );
+  declareProperty("UsePathResolver", m_usePathResolver, "Use the PathResolver for finding the input lwtnn network file."                                     );
+  #endif
+}
 
 StatusCode MVATrackVertexAssociationTool::initialize() {
 
@@ -64,10 +75,12 @@ StatusCode MVATrackVertexAssociationTool::initialize() {
   return StatusCode::SUCCESS;
 }
 
+#ifndef XAOD_STANDALONE
 StatusCode MVATrackVertexAssociationTool::finalize() {
   ATH_MSG_INFO("Finalizing MVATrackVertexAssociationTool.");
   return StatusCode::SUCCESS;
 }
+#endif
 
 bool MVATrackVertexAssociationTool::isCompatible(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx) const {
   float mvaOutput;
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
index d60f0d124bbb..317eb235e9ba 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
@@ -65,6 +65,36 @@ private:
   StatusCode initializeNetwork();
   float evaluateNetwork(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const;
 
+  // For AnalysisBase
+  #ifndef XAOD_STANDALONE
+
+  // Input lwtnn network file
+  std::string m_fileName = "";
+
+  // Vector of input variable names
+  std::vector<std::string> m_inputNames = {};
+
+  // Vector of input variable types
+  std::vector<int> m_inputTypes = {};
+
+  // Name of the output node to cut on
+  std::string m_outputName = "";
+
+  // Is the network sequential or functional
+  bool m_isSequential = true;
+
+  // TVA working point
+  std::string m_wp = "Tight";
+
+  // TVA cut value on the output discriminant
+  float m_cut = -1.0;
+
+  // Use the PathResolver to find our input file
+  bool m_usePathResolver = true;
+
+  // For Athena
+  #else
+
   // Input lwtnn network file
   StringProperty m_fileName {this, "NetworkFileName", "", "Name of the input lwtnn network file."};
 
@@ -89,6 +119,8 @@ private:
   // Use the PathResolver to find our input file
   BooleanProperty m_usePathResolver {this, "UsePathResolver", true, "Use the PathResolver for finding the input lwtnn network file."};
 
+  #endif
+
   // Input variable name/type map
   MVAInputEvaluator::InputSelectionMap m_inputMap;
 
-- 
GitLab


From 76394ddaf0f95e8b40adbfdafad51367b133c2f5 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Tue, 22 Sep 2020 17:18:03 +0200
Subject: [PATCH 362/422] TrigCostD3PDMaker: Delete package

Delete unused TrigCostD3PDMaker package and code referencing it.
---
 .../TrigCostD3PDMaker/CMakeLists.txt          |   22 -
 .../python/TrigCostConfMetadata.py            |   84 --
 .../TrigCostD3PDMaker/python/__init__.py      |   23 -
 .../python/addTrigCostData.py                 |   63 -
 .../TrigCostD3PDMaker_prodJobOFragment.py     |   27 -
 .../TrigEBWeightD3PDMaker_prodJobOFragment.py |   27 -
 .../TrigRateD3PDMaker_prodJobOFragment.py     |   27 -
 .../src/TrigCostConfMetadataTool.cxx          |  510 -------
 .../src/TrigCostConfMetadataTool.h            |  168 ---
 .../src/TrigCostD3PDMakerTool.cxx             | 1214 -----------------
 .../src/TrigCostD3PDMakerTool.h               |  272 ----
 .../components/TrigCostD3PDMaker_entries.cxx  |    6 -
 .../TrigCostMonitor/share/readTrigCost.py     |  119 --
 .../share/testCommonSliceAthenaTrigRDO.py     |   10 -
 .../testCommonSliceAthenaTrigRDOtoAOD.py      |   10 -
 .../TriggerJobOpts/python/Modifiers.py        |   39 -
 .../TriggerJobOpts/share/runHLT_standalone.py |    1 -
 17 files changed, 2622 deletions(-)
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/CMakeLists.txt
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/TrigCostConfMetadata.py
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/__init__.py
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/addTrigCostData.py
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigCostD3PDMaker_prodJobOFragment.py
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigEBWeightD3PDMaker_prodJobOFragment.py
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigRateD3PDMaker_prodJobOFragment.py
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.cxx
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.h
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.cxx
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.h
 delete mode 100644 PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/components/TrigCostD3PDMaker_entries.cxx
 delete mode 100644 Trigger/TrigMonitoring/TrigCostMonitor/share/readTrigCost.py

diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/CMakeLists.txt b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/CMakeLists.txt
deleted file mode 100644
index 64a102198686..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-################################################################################
-# Package: TrigCostD3PDMaker
-################################################################################
-
-# Declare the package name:
-atlas_subdir( TrigCostD3PDMaker )
-
-# Component(s) in the package:
-atlas_add_library( TrigCostD3PDMakerLib
-                   src/*.cxx
-                   NO_PUBLIC_HEADERS
-                   LINK_LIBRARIES StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES AthenaBaseComps AthenaKernel GaudiKernel TrigConfHLTData TrigConfL1Data TrigMonitoringEvent D3PDMakerInterfaces TrigConfInterfaces )
-
-atlas_add_component( TrigCostD3PDMaker
-                     src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps AthenaKernel StoreGateLib SGtests GaudiKernel TrigConfHLTData TrigConfL1Data TrigMonitoringEvent TrigCostD3PDMakerLib D3PDMakerInterfaces TrigConfInterfaces )
-
-# Install files from the package:
-atlas_install_python_modules( python/*.py )
-atlas_install_joboptions( share/*.py )
-
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/TrigCostConfMetadata.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/TrigCostConfMetadata.py
deleted file mode 100644
index e6d11edbef36..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/TrigCostConfMetadata.py
+++ /dev/null
@@ -1,84 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# $Id: TrigConfMetadata.py 618376 2014-09-24 15:33:35Z tamartin $
-#
-# This module holds the code that should be used to add trigger configuration
-# metadata to the D3PD.
-#
-
-def addTrigCostConfMetadata( d3pdalg = None, doCostL2 = False, doCostEF = False, doCostHLT = False, tuplePath = "" ):
-
-    """Helper function that adds the necessary tool(s) and service(s) to the
-       job to save the trigger configuration metadata to the output D3PD
-       file.
-
-        Arguments:
-          d3pdalg: The D3PD::MakerAlg that is creating the D3PD. If not specified,
-                   the configuration is saved in a file called TrigConfig.root
-          useTrigConfEventSummaries:	Set true when running in AtlasP1HLT or trigger BS
-                   to gather detailed configuration from TrigConfEvent
-                   summary objects (TrigCost running). 
-    """
-
-    # Create a logger for the function:
-    if "logger" in dir(): orig_logger = logger
-    from AthenaCommon.Logging import logging
-    logger = logging.getLogger( "addTrigConfMetadata" )
-
-    # Let the user know what we're doing:
-    logger.info( "Adding trigger configuration metadata to the D3PD" )
-
-    # The tool needs a special D3PDSvc in which the indexing is turned off
-    # for the TTree-s:
-    _d3pdSvcName = "TrigConfD3PDSvc"
-    from AthenaCommon.AppMgr import ServiceMgr
-    if not hasattr( ServiceMgr, _d3pdSvcName ):
-        from D3PDMakerRoot.D3PDMakerRootConf import D3PD__RootD3PDSvc
-        ServiceMgr += D3PD__RootD3PDSvc( _d3pdSvcName )
-        ServiceMgr.TrigConfD3PDSvc.MasterTree = ""
-        ServiceMgr.TrigConfD3PDSvc.IndexMajor = ""
-    else:
-        logger.info( "The private D3PDSvc for the metadata TTree already exists" )
-    _d3pdSvc = getattr( ServiceMgr, _d3pdSvcName )
-
-    # If no D3PD::MakerAlg has been provided, create a dummy one:
-    if d3pdalg == None:
-        logger.warning( "No D3PD MakerAlg given to function!" )
-        logger.warning( "The trigger configuration will be saved into file: " +
-                        "\"TrigConfig.root\"" )
-        from AthenaCommon.AlgSequence import AlgSequence
-        theJob = AlgSequence()
-        import D3PDMakerCoreComps
-        d3pdalg = D3PDMakerCoreComps.MakerAlg( "trigConf", theJob, file = "TrigConfig.root",
-                                               D3PDSvc = _d3pdSvc )
-
-    # Add the metadata tool:
-    _d3pdToolName = "TrigCostConfMetadataTool"
-    if not _d3pdToolName in [ t.name() for t in d3pdalg.MetadataTools ]:
-        import TrigCostD3PDMaker
-        if (tuplePath == ""):
-          tuplePath = d3pdalg.TuplePath
-        _trigConfTool = TrigCostD3PDMaker.TrigCostConfMetadataTool( _d3pdToolName,
-                                                                   D3PDSvc = _d3pdSvc,
-                                                                   ConfigDir = tuplePath + "Meta" )
-        # Figure out if old or new style HLT if using CostMon to get correct storegate key
-        # Old key fomat was HLT_OPI_HLT_monitoring_config
-        if (doCostL2 == True or doCostEF == True or doCostHLT == True):
-          logger.info( "TrigCostConfMetadataTool will use passed arguments [L2="+str(doCostL2)+",EF="+str(doCostEF)+",HLT="+str(doCostHLT)+"]" )
-          if (doCostL2 == True or doCostEF == True):
-            _trigConfTool.keyConfig = "HLT_TrigMonConfigCollection_OPI_EF_monitoring_config"
-          elif (doCostHLT == True):
-            _trigConfTool.keyConfig = "HLT_TrigMonConfigCollection_OPI_HLT_monitoring_config"
-        else: 
-          logger.info( "TrigCostConfMetadataTool will use TriggerFlags flags for config" )
-          from TriggerJobOpts.TriggerFlags import TriggerFlags
-          if TriggerFlags.doHLT() and not (TriggerFlags.doEF() or TriggerFlags.doLVL2()):
-            _trigConfTool.keyConfig = "HLT_TrigMonConfigCollection_OPI_HLT_monitoring_config"
-          elif TriggerFlags.doEF() or TriggerFlags.doLVL2():
-            _trigConfTool.keyConfig = "HLT_TrigMonConfigCollection_OPI_EF_monitoring_config"
-        logger.info( "TrigConfMetadataTool will use the StoreGate key " + _trigConfTool.keyConfig )
-        d3pdalg.MetadataTools += [ _trigConfTool ]
-    else:
-      logger.info( "TrigCostConfMetadataTool was already added to the D3PD::MakerAlg" )
-
-    return
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/__init__.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/__init__.py
deleted file mode 100644
index 1cb74541566b..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/__init__.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# $Id$
-#
-# @file TriggerD3PDMaker/python/__init__.py
-# @author scott snyder <snyder@bnl.gov>
-# @date Sep, 2009
-# @brief Define shortcuts for referencing configurables in this package.
-#
-# With this, instead of writing
-#
-#   TrigCostD3PDMaker.TrigCostD3PDMakerConf.D3PD__FourMomFillerTool
-#
-# we can write
-#
-#   TrigCostD3PDMaker.FourMomFillerTool
-#
-
-import TrigCostD3PDMaker.TrigCostD3PDMakerConf
-for k, v in TrigCostD3PDMakerConf.__dict__.items():
-    if k.startswith ('D3PD__'):
-        globals()[k[6:]] = v
-
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/addTrigCostData.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/addTrigCostData.py
deleted file mode 100644
index bfff78e7939a..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/addTrigCostData.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# $Id: addTrigCostD3PD.py tamartin
-#
-# Add a trig cost D3PD output stream
-
-def addTrigCostData(mode = "COST", fileName = "trig_cost.root", costConfigL2 = False, costConfigEF = False, costConfigHLT = True):
-
-    # Set up a logger:
-    from AthenaCommon.Logging import logging
-    addTrigCostData_msg = logging.getLogger( 'addTrigCostData' )
-
-    # Construct the stream and file names for the Trigger D3PD:
-    streamName = "StreamNTUP_TRIG" + mode
-    addTrigCostData_msg.info( "Configuring Trigger Cost D3PD from bytestream with streamName '%s' and fileName '%s'" % ( streamName, fileName ) )
-
-    # Create the D3PD stream(s):
-    # We dont actually use the default stream! 
-    from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
-    d3pdalg = MSMgr.NewRootStream( streamName, fileName, "dummy" )
-      
-    # As we are running from bytestream, need to disable data headers.
-    from AthenaCommon.AlgSequence import AlgSequence
-    theJob = AlgSequence()
-    fullStreamName = "StreamNTUP_TRIG" + mode + "AANTStream"
-    if hasattr(theJob, fullStreamName):
-        streamRef = getattr( theJob, fullStreamName )
-        streamRef.ExistDataHeader = False
-        streamRef.WriteInputDataHeader = False
-
-    # The tool needs a special D3PDSvc in which the indexing is turned off for the TTree-s:
-    _costD3PDSvcName = "TrigCostD3PDSvc_" + mode
-    from AthenaCommon.AppMgr import ServiceMgr
-    if not hasattr( ServiceMgr, _costD3PDSvcName ):
-        from D3PDMakerRoot.D3PDMakerRootConf import D3PD__RootD3PDSvc
-        ServiceMgr += D3PD__RootD3PDSvc( _costD3PDSvcName )
-    else:
-        addTrigCostData_msg.info( "The private D3PDSvc for the cost monitoring TTree already exists" )
-    _costD3PDSvc = getattr( ServiceMgr, _costD3PDSvcName )
-    _costD3PDSvc.MasterTree = ""
-    _costD3PDSvc.IndexMajor = ""
-
-    # Add the tool:
-    _costD3PDToolName = "TrigCostD3PDMakerTool_" + mode
-    _tuplePath = "/StreamNTUP_TRIG" + mode + "/trig_cost"
-    if not _costD3PDToolName in [ t.name() for t in d3pdalg.MetadataTools ]:
-        import TrigCostD3PDMaker
-        _trigCostTool = TrigCostD3PDMaker.TrigCostD3PDMakerTool( _costD3PDToolName, D3PDSvc = _costD3PDSvc, dir = _tuplePath )
-        _trigCostTool.mode = mode
-        if (costConfigL2 == True):
-            _trigCostTool.keyEvent = "HLT_TrigMonEventCollection_OPI_L2_monitoring_event"
-            _trigCostTool.prefix = "TrigCostL2_"
-        elif (costConfigEF == True):
-            _trigCostTool.keyEvent = "HLT_TrigMonEventCollection_OPI_EF_monitoring_event"
-            _trigCostTool.prefix = "TrigCostEF_"
-        elif (costConfigHLT == True):
-            _trigCostTool.keyEvent = "HLT_TrigMonEventCollection_OPI_HLT_monitoring_event"
-            _trigCostTool.prefix = "TrigCostHLT_"
-        d3pdalg.MetadataTools += [ _trigCostTool ]
-
-    if (mode != "EBWEIGHT"):
-      from TrigCostD3PDMaker.TrigCostConfMetadata import addTrigCostConfMetadata
-      addTrigCostConfMetadata( d3pdalg, costConfigL2, costConfigEF, costConfigHLT, _tuplePath )
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigCostD3PDMaker_prodJobOFragment.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigCostD3PDMaker_prodJobOFragment.py
deleted file mode 100644
index 224ac76003a4..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigCostD3PDMaker_prodJobOFragment.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# $Id: TrigCostD3PD_prodJobOFragment.py tamartin
-#
-# Top jobO fragment setting up the common Trig Cost (NTUP_TRIG_COST).
-
-# This jobO should not be included more than once:
-include.block( "TrigCost3PDMaker/TrigCostD3PDMaker_prodJobOFragment.py" )
-
-from AthenaCommon.Logging import logging
-TrigCostD3PDStream_msg = logging.getLogger( 'TrigCostD3PDMaker_prodJobOFragment' )
-
-costConfigL2 = False
-costConfigEF = False
-costConfigHLT = False
-if ('costD3PD_doL2' in dir() or 'costD3PD_doEF' in dir() or 'costD3PD_doHLT' in dir()):
-    TrigCostD3PDStream_msg.info( "Configuring via cosD3PD flags" );
-    if ('costD3PD_doL2' in dir() and bool(costD3PD_doL2) == True):   costConfigL2 = True
-    if ('costD3PD_doEF' in dir() and bool(costD3PD_doEF) == True):   costConfigEF = True
-    if ('costD3PD_doHLT' in dir() and bool(costD3PD_doHLT) == True): costConfigHLT = True
-else:
-    TrigCostD3PDStream_msg.info( "Configuring via TriggerFlags" );
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-    if TriggerFlags.doLVL2(): costConfigL2 = True
-    if TriggerFlags.doEF():   costConfigEF = True
-    if TriggerFlags.doHLT():  costConfigHLT = True
-
-from TrigCostD3PDMaker.addTrigCostData import addTrigCostData
-addTrigCostData("COST", "trig_cost.root", costConfigL2, costConfigEF, costConfigHLT);
\ No newline at end of file
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigEBWeightD3PDMaker_prodJobOFragment.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigEBWeightD3PDMaker_prodJobOFragment.py
deleted file mode 100644
index 52c81eb68ec8..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigEBWeightD3PDMaker_prodJobOFragment.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# $Id: TrigCostD3PD_prodJobOFragment.py tamartin
-#
-# Top jobO fragment setting up the common Trig Cost (NTUP_TRIG_COST).
-
-# This jobO should not be included more than once:
-include.block( "TrigCost3PDMaker/TrigEBWeightD3PDMaker_prodJobOFragment.py" )
-
-from AthenaCommon.Logging import logging
-TrigEBWeightD3PDStream_msg = logging.getLogger( 'TrigEBWeightD3PDMaker_prodJobOFragment' )
-
-costConfigL2 = False
-costConfigEF = False
-costConfigHLT = False
-if ('costD3PD_doL2' in dir() or 'costD3PD_doEF' in dir() or 'costD3PD_doHLT' in dir()):
-    TrigEBWeightD3PDStream_msg.info( "Configuring via cosD3PD flags" );
-    if ('costD3PD_doL2' in dir() and bool(costD3PD_doL2) == True):   costConfigL2 = True
-    if ('costD3PD_doEF' in dir() and bool(costD3PD_doEF) == True):   costConfigEF = True
-    if ('costD3PD_doHLT' in dir() and bool(costD3PD_doHLT) == True): costConfigHLT = True
-else:
-    TrigEBWeightD3PDStream_msg.info( "Configuring via TriggerFlags" );
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-    if TriggerFlags.doLVL2(): costConfigL2 = True
-    if TriggerFlags.doEF():   costConfigEF = True
-    if TriggerFlags.doHLT():  costConfigHLT = True
-
-from TrigCostD3PDMaker.addTrigCostData import addTrigCostData
-addTrigCostData("EBWEIGHT", "trig_ebweight.root", costConfigL2, costConfigEF, costConfigHLT);
\ No newline at end of file
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigRateD3PDMaker_prodJobOFragment.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigRateD3PDMaker_prodJobOFragment.py
deleted file mode 100644
index cc0f28d25147..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigRateD3PDMaker_prodJobOFragment.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# $Id: TrigCostD3PD_prodJobOFragment.py tamartin
-#
-# Top jobO fragment setting up the common Trig Cost (NTUP_TRIG_COST).
-
-# This jobO should not be included more than once:
-include.block( "TrigCost3PDMaker/TrigRateD3PDMaker_prodJobOFragment.py" )
-
-from AthenaCommon.Logging import logging
-TrigRateD3PDStream_msg = logging.getLogger( 'TrigRateD3PDMaker_prodJobOFragment' )
-
-costConfigL2 = False
-costConfigEF = False
-costConfigHLT = False
-if ('costD3PD_doL2' in dir() or 'costD3PD_doEF' in dir() or 'costD3PD_doHLT' in dir()):
-    TrigRateD3PDStream_msg.info( "Configuring via cosD3PD flags" );
-    if ('costD3PD_doL2' in dir() and bool(costD3PD_doL2) == True):   costConfigL2 = True
-    if ('costD3PD_doEF' in dir() and bool(costD3PD_doEF) == True):   costConfigEF = True
-    if ('costD3PD_doHLT' in dir() and bool(costD3PD_doHLT) == True): costConfigHLT = True
-else:
-    TrigRateD3PDStream_msg.info( "Configuring via TriggerFlags" );
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-    if TriggerFlags.doLVL2(): costConfigL2 = True
-    if TriggerFlags.doEF():   costConfigEF = True
-    if TriggerFlags.doHLT():  costConfigHLT = True
-
-from TrigCostD3PDMaker.addTrigCostData import addTrigCostData
-addTrigCostData("RATE", "trig_rate.root", costConfigL2, costConfigEF, costConfigHLT);
\ No newline at end of file
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.cxx b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.cxx
deleted file mode 100644
index d58388207065..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.cxx
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: TrigConfMetadataTool.cxx 729020 2016-03-10 17:55:29Z tamartin $
-
-// Athena/Gaudi include(s):
-#include "AthenaKernel/errorcheck.h"
-
-// STL include(s):
-#include "limits.h"
-
-// Trigger configuration include(s):
-#include "TrigConfL1Data/CTPConfig.h"
-#include "TrigConfL1Data/Menu.h"
-#include "TrigConfL1Data/TriggerItem.h"
-#include "TrigConfL1Data/PrescaleSet.h"
-#include "TrigConfHLTData/HLTChainList.h"
-#include "TrigConfHLTData/HLTChain.h"
-
-// Trigger [TrigMonConfig] data include(s):
-#include "TrigMonitoringEvent/TrigMonConfigCollection.h"
-#include "TrigMonitoringEvent/TrigMonEventCollection.h"
-#include "TrigMonitoringEvent/TrigConfChain.h"
-#include "TrigMonitoringEvent/TrigConfSeq.h"
-#include "TrigMonitoringEvent/TrigConfSig.h"
-#include "TrigMonitoringEvent/TrigConfAlg.h"
-
-// D3PDMaker include(s):
-#include "D3PDMakerInterfaces/ID3PD.h"
-
-// Local include(s):
-#include "TrigCostConfMetadataTool.h"
-
-namespace D3PD {
-
-   TrigCostConfMetadataTool::TrigCostConfMetadataTool( const std::string& type,
-                                               const std::string& name,
-                                               const IInterface* parent )
-      : AthAlgTool( type, name, parent ),
-        m_configDir( "" ),
-        m_trigConfSvc( "TrigConf::TrigConfigSvc/TrigConfigSvc", name ),
-        m_incidentSvc( "IncidentSvc", name ),
-        m_d3pdSvc( "D3PD::RootD3PDSvc/TrigConfD3PDSvc", name ),
-        m_storeGate( "StoreGateSvc", name),
-        m_configKeyCache(),
-        m_configTree( 0 ), m_smk( 0 ), m_l1psk( 0 ), m_hltpsk( 0 ),
-        m_lvl1ConfigNameMap( 0 ), m_lvl1ConfigPSKMap( 0 ),
-        m_hltConfigNameMap( 0 ), m_hltConfigPSKMap( 0 ),
-        m_hltConfigRPSKMap( 0 ), m_hltConfigPTMap( 0 ),
-        m_hltConfigLowerChainNameMap( 0 ),
-
-        m_chainN (nullptr),
-        m_chainID (nullptr),
-        m_chainCounter (nullptr),
-        m_chainName (nullptr),
-        m_chainLowerID (nullptr),
-        m_chainLowerIDs (nullptr),
-        m_chainLowerName (nullptr),
-        m_chainLowerCounter (nullptr),
-        m_chainLevel (nullptr),
-        m_chainPrescale (nullptr),
-        m_chainPassthrough (nullptr),
-        m_chainStreamNames (nullptr),
-        m_chainStreamPrescales (nullptr),
-        m_chainGroupNames (nullptr),
-        m_chainEBHypoNames (nullptr),
-        m_chainSigN (nullptr),
-        m_chainSigCounter (nullptr),
-        m_chainSigLogic (nullptr),
-        m_chainSigLabel (nullptr),
-        m_chainSigOutputTEn (nullptr),
-        m_chainSigOutputTEIndex (nullptr),
-        m_chainSigOutputTEs (nullptr),
-        m_seqN (nullptr),
-        m_seqID (nullptr),
-        m_seqIndex (nullptr),
-        m_seqName (nullptr),
-        m_seqTopoTEID (nullptr),
-        m_seqInputTEs (nullptr),
-        m_seqAlgN (nullptr),
-        m_seqAlgIndex (nullptr),
-        m_seqAlgPosition (nullptr),
-        m_seqAlgNameID (nullptr),
-        m_seqAlgTypeID (nullptr),
-        m_seqAlgName (nullptr),
-        m_seqAlgTypeName (nullptr),
-        m_confVarKey (nullptr),
-        m_confVarVal (nullptr),
-        m_confStringKey (nullptr),
-        m_confStringVal (nullptr)
-   {
-
-      declareProperty( "ConfigDir", m_configDir = "/D3PD/d3pdMeta" );
-      declareProperty( "TrigConfigSvc", m_trigConfSvc );
-      declareProperty( "IncidentSvc", m_incidentSvc );
-      declareProperty( "D3PDSvc", m_d3pdSvc );
-      declareProperty( "keyConfig", m_keyConfig = "HLT_OPI_HLT_monitoring_config"); ///< [TrigMonConfig] Name of TrigerConfigurationObject
-   }
-
-   StatusCode TrigCostConfMetadataTool::initialize() {
-
-      ATH_MSG_INFO( "Initializing. Package version: " << PACKAGE_VERSION );
-
-      // Retrieve the needed services:
-      CHECK( m_trigConfSvc.retrieve() );
-      CHECK( m_incidentSvc.retrieve() );
-      CHECK( m_d3pdSvc.retrieve() );
-      CHECK( m_storeGate.retrieve() );
-
-      // Set up the tool to listen to a few incidents:
-       m_incidentSvc->addListener( this, IncidentType::EndEvent );
-
-      // Create the configuration objects through the D3PD service:
-      CHECK( m_d3pdSvc->make( m_configDir + "/TrigConfTree", m_configTree ) );
-
-      // Add the variables to the configuration "tree":
-      CHECK( m_configTree->addVariable( "SMK",    m_smk,
-                                        "Super Master Key" ) );
-      CHECK( m_configTree->addVariable( "L1PSK",  m_l1psk,
-                                        "LVL1 PreScale Key" ) );
-      CHECK( m_configTree->addVariable( "HLTPSK", m_hltpsk,
-                                        "HLT PreScale Key" ) );
-
-      CHECK( m_configTree->addVariable( "LVL1NameMap", m_lvl1ConfigNameMap,
-                                        "LVL1 item name -> CTP ID mapping" ) );
-      CHECK( m_configTree->addVariable( "LVL1PrescaleMap", m_lvl1ConfigPSKMap,
-                                        "LVL1 item name -> Prescale value mapping" ) );
-      CHECK( m_configTree->addVariable( "HLTNameMap", m_hltConfigNameMap,
-                                        "HLT chain name -> Chain ID mapping" ) );
-      CHECK( m_configTree->addVariable( "HLTPrescaleMap", m_hltConfigPSKMap,
-                                        "HLT chain name -> Prescale value mapping" ) );
-      CHECK( m_configTree->addVariable( "HLTRerunPrescaleMap", m_hltConfigRPSKMap,
-                                        "HLT chain name -> Re-run prescale value mapping" ) );
-      CHECK( m_configTree->addVariable( "HLTPassthroughMap", m_hltConfigPTMap,
-                                        "HLT chain name -> Passthrough value mapping" ) );
-      CHECK( m_configTree->addVariable( "HLTLowerChainNameMap",
-                                        m_hltConfigLowerChainNameMap,
-                                        "HLT chain name -> Lower chain/item name mapping" ) );
-                                        
-      // variables for CHAIN
-      CHECK( m_configTree->addVariable( "chainConfig_n", m_chainN, "Number of chains (including L1)" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_ID", m_chainID, "Hash value of chain name" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_counter", m_chainCounter, "HLT chain counter or L1 CTPID" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_name", m_chainName, "Chain name" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_lowerID", m_chainLowerID, "Hash of lower seeding chain name" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_lowerChainIDs", m_chainLowerIDs, "Vector of hashes of lower seeding chain names for multi-seeded chains" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_lowerName", m_chainLowerName, "Name of lower seeding chain(s), comma separated" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_lowerCounter", m_chainLowerCounter, "Counter of lower seeding chain" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_level", m_chainLevel, "Level of chain (1,2,3)" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_prescale", m_chainPrescale, "Chain prescale setting" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_passthrough", m_chainPassthrough, "Chain passthrough setting" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_streamNames", m_chainStreamNames, "Vector of chain stream names" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_streamPrescales", m_chainStreamPrescales, "Vector of stream prescales for chain" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_groupNames", m_chainGroupNames, "Vector of group names for chain" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_EBHypoNames", m_chainEBHypoNames, "Vector of L1 items from EB Hypo" ) );
-      // variables for CHAIN -> SIGNATURE
-      CHECK( m_configTree->addVariable( "chainConfig_sig_n", m_chainSigN, "Number of signatures in chain" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sig_counter", m_chainSigCounter, "Signature position in chain" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sig_logic", m_chainSigLogic, "Singmature logic" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sig_label", m_chainSigLabel, "Singature label" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sig_outputTE_n", m_chainSigOutputTEn, "Number of output Trigger Elements from signature" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sig_outputTE_index", m_chainSigOutputTEIndex, "Index in vector containing Trigger Element outputs" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sigOutputTEs", m_chainSigOutputTEs, "Vector of vector<TE_Outputs>, use outputTE_index to locate the correct entry" ) );
-                                   
-      // variables for SEQUENCE
-      CHECK( m_configTree->addVariable( "seqConfig_n", m_seqN, "Number of sequences in configuration" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_outputTEID", m_seqID, "ID of trigger element output" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_outputTEIndex", m_seqIndex, "Index of output TE" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_outputTEName", m_seqName, "Name of output TE" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_topoTEID", m_seqTopoTEID, "ID of topo start TE" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_inputTEs", m_seqInputTEs, "Vector of input TE IDs" ) );
-      // variables for SEQUENCE -> ALG
-      CHECK( m_configTree->addVariable( "seqConfig_alg_n", m_seqAlgN, "Number of algorithms in sequence" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_index", m_seqAlgIndex, "Unique algorithm index in current configuration" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_position", m_seqAlgPosition, "Position of algorithm in sequence" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_nameID", m_seqAlgNameID, "Hash of alg name" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_typeID", m_seqAlgTypeID, "Hash of class name" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_name", m_seqAlgName, "Algorithm instance name" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_typeName", m_seqAlgTypeName, "Algorithm base class name" ) );
-      // variables for misc other config data
-      CHECK( m_configTree->addVariable( "config_miscVarKey", m_confVarKey, "Key to misc additional config int payload" ) );
-      CHECK( m_configTree->addVariable( "config_miscVarVal", m_confVarVal, "Value of additional config int payload" ) );
-      CHECK( m_configTree->addVariable( "config_miscStringKey", m_confStringKey, "Key to misc additional config string payload" ) );
-      CHECK( m_configTree->addVariable( "config_miscStringVal", m_confStringVal, "alue of additional config string payload" ) );
-            
-      // Clear the cache, just to be sure:
-      m_configKeyCache.clear();
-
-      return StatusCode::SUCCESS;
-   }
-
-   StatusCode TrigCostConfMetadataTool::queryInterface( const InterfaceID& riid,
-                                                    void** ppvIf ) {
-
-      if( riid == IMetadataTool::interfaceID() ) {
-         *ppvIf = static_cast< IMetadataTool* >( this );
-         addRef();
-         return StatusCode::SUCCESS;
-      } else if( riid == IIncidentListener::interfaceID() ) {
-         *ppvIf = static_cast< IIncidentListener* >( this );
-         addRef();
-         return StatusCode::SUCCESS;
-      }
-
-      return AthAlgTool::queryInterface( riid, ppvIf );
-   }
-
-   /**
-    * The function is actually empty. The metadata should already be in the output
-    * file at this point...
-    */
-   StatusCode TrigCostConfMetadataTool::writeMetadata( ID3PD* ) {
-
-      ATH_MSG_INFO( "Trigger configuration available in the D3PD in directory: \""
-                    << m_configDir << "\"" );
-
-      return StatusCode::SUCCESS;
-   }
-
-   /**
-    * This function is called whenever an incident happens that the tool
-    * was set up to listen to. The function has to decide what kind of
-    * incident it was, and the call the appropriate internal function to
-    * handle that incident.
-    *
-    * @param inc The incident that happened
-    */
-   void TrigCostConfMetadataTool::handle( const Incident& inc ) {
-
-      //
-      // Handle trigger configuration change incidents:
-      //
-      if( inc.type() == IncidentType::EndEvent ) { 
-         handleNewTrigConfFromDataStore( inc );
-         return;
-      }
-
-      ATH_MSG_WARNING( "Received incident not recognised" );
-      return;
-   }
-   
-   
-    /**
-    * This function translates a *full* trigger configuration into a ROOT 
-    * native format, instead of Oracle - it uses TrigConfEvent objects
-    * from the trigger cost monitor as its source of summarised trigger
-    * configuration data.
-    *
-    * To get this full summary, set UseTrigConfEventSummaries=True and
-    * ensure that the cost monitoring infrastructure is enabled.
-    */
-   void TrigCostConfMetadataTool::handleNewTrigConfFromDataStore( const Incident& ) {
-      
-      const TrigMonConfigCollection *configCol = 0;
- 
-      if( !m_storeGate->contains<TrigMonConfigCollection>(m_keyConfig) ) {
-         ATH_MSG_DEBUG( "No TrigMonConfigCollection in this event Key:" << m_keyConfig );
-         return;
-      } else {
-         ATH_MSG_INFO( "TrigMonConfigCollection in this event Key:" << m_keyConfig << ". The configs will be saved." );
-      }
-   
-      if( m_storeGate->retrieve(configCol, m_keyConfig).isFailure() || !configCol) {
-         ATH_MSG_WARNING( "TrigMonConfigCollection present, however failed to retrieve from SG. Key:" << m_keyConfig );
-         return;
-      }
-      
-      ATH_MSG_DEBUG( "Got TrigMonConfigCollection: " << m_keyConfig << " Size:" << configCol->size() );
-
-      for( TrigMonConfigCollection::const_iterator it = configCol->begin(); it != configCol->end(); ++it) {
-         const TrigMonConfig* tmc = *it;
-         if(!tmc) continue;
-
-         Keys config_keys;
-
-         // Find out if the configuration that's just been loaded by the
-         // configuration service, has been already translated in this job.
-         // In that case there's no reason to translate it again.
-         // TimM - now use the info from the object
-         config_keys.first = tmc->getMasterKey();
-         config_keys.second.first = tmc->getLV1PrescaleKey();
-         config_keys.second.second = tmc->getHLTPrescaleKey();
-         if( m_configKeyCache.find( config_keys ) != m_configKeyCache.end() ) {
-            ATH_MSG_INFO( "Configuration with keys from triggerKeyTool SMK: "
-                           << config_keys.first << ", L1PSK: "
-                           << config_keys.second.first
-                           << ", HLT PSK: "
-                           << config_keys.second.second
-                           << " already translated" );
-            continue;
-         }
-
-         // Let the user know what we're doing:
-         // Use keys from tool as keys stored in object appear to be wrong
-         // Object keys are tmc->getMasterKey(), tmc->getLV1PrescaleKey(), mc->getHLTPrescaleKey()
-         ATH_MSG_INFO( "Translating trigger configuration from TrigMonConfig source" );
-         ATH_MSG_INFO( "  SMK: " << config_keys.first
-                    << ", L1 PSK: " << config_keys.second.first
-                    << ", HLT PSK: " << config_keys.second.second ); 
-  
-         /// Save detailed Sequence and Algorithm details
-         const std::vector<TrigConfSeq> configSeqs   = tmc->getVec<TrigConfSeq>();
-         *m_seqN          = configSeqs.size();
-         // variables for SEQUENCE
-         m_seqID          ->clear();
-         m_seqIndex       ->clear();
-         m_seqName        ->clear();
-         m_seqTopoTEID    ->clear();
-         m_seqInputTEs    ->clear();
-         //
-         m_seqID          ->resize( configSeqs.size() );
-         m_seqIndex       ->resize( configSeqs.size() );
-         m_seqName        ->resize( configSeqs.size() );
-         m_seqTopoTEID    ->resize( configSeqs.size() );
-         m_seqInputTEs    ->resize( configSeqs.size() );
-         // variables for SEQUENCE -> ALG
-         m_seqAlgN        ->clear();
-         m_seqAlgIndex    ->clear();
-         m_seqAlgPosition ->clear();
-         m_seqAlgNameID   ->clear();
-         m_seqAlgTypeID   ->clear();
-         m_seqAlgName     ->clear();
-         m_seqAlgTypeName ->clear();
-         //
-         m_seqAlgN        ->resize( configSeqs.size() );
-         m_seqAlgIndex    ->resize( configSeqs.size() );
-         m_seqAlgPosition ->resize( configSeqs.size() );
-         m_seqAlgNameID   ->resize( configSeqs.size() );
-         m_seqAlgTypeID   ->resize( configSeqs.size() );
-         m_seqAlgName     ->resize( configSeqs.size() );
-         m_seqAlgTypeName ->resize( configSeqs.size() );
-         for(unsigned int i = 0; i < configSeqs.size(); ++i) {
-            m_seqID       ->at(i) = configSeqs.at(i).getId();
-            m_seqIndex    ->at(i) = configSeqs.at(i).getIndex();
-            m_seqName     ->at(i) = configSeqs.at(i).getName();
-            m_seqTopoTEID ->at(i) = configSeqs.at(i).getTopoTE();
-            m_seqInputTEs ->at(i) = configSeqs.at(i).getInputTEs(); //Direct fetch vector
-            // Loop over Alg items
-            const std::vector<TrigConfAlg> configSeqAlgs = configSeqs.at(i).getAlg();
-            m_seqAlgN         ->at(i)  = configSeqAlgs.size();
-            (m_seqAlgIndex    ->at(i)).resize( configSeqAlgs.size() );
-            (m_seqAlgPosition ->at(i)).resize( configSeqAlgs.size() );
-            (m_seqAlgNameID   ->at(i)).resize( configSeqAlgs.size() );
-            (m_seqAlgTypeID   ->at(i)).resize( configSeqAlgs.size() );
-            (m_seqAlgName     ->at(i)).resize( configSeqAlgs.size() );
-            (m_seqAlgTypeName ->at(i)).resize( configSeqAlgs.size() );
-            for (unsigned int j = 0; j < configSeqAlgs.size(); ++j) {
-               (m_seqAlgIndex    ->at(i)).at(j) = configSeqAlgs.at(j).getIndex();    
-               (m_seqAlgPosition ->at(i)).at(j) = configSeqAlgs.at(j).getPosition();
-               (m_seqAlgNameID   ->at(i)).at(j) = configSeqAlgs.at(j).getNameId();
-               (m_seqAlgTypeID   ->at(i)).at(j) = configSeqAlgs.at(j).getTypeId();
-               (m_seqAlgName     ->at(i)).at(j) = configSeqAlgs.at(j).getName();
-               (m_seqAlgTypeName ->at(i)).at(j) = configSeqAlgs.at(j).getType();
-            }
-         }
-         
-         /// Save Chain and Sig details
-         int TEIndex = 0;
-         const std::vector<TrigConfChain> configChains = tmc->getVec<TrigConfChain>();
-         *m_chainN               = configChains.size();
-         /// variables for CHAIN
-         m_chainID               ->clear();
-         m_chainCounter          ->clear();
-         m_chainName             ->clear();
-         m_chainLowerID          ->clear();
-         m_chainLowerIDs         ->clear();
-         m_chainLowerName        ->clear();
-         m_chainLowerCounter     ->clear();
-         m_chainLevel            ->clear();
-         m_chainPrescale         ->clear();
-         m_chainPassthrough      ->clear();
-         m_chainStreamNames      ->clear();
-         m_chainStreamPrescales  ->clear();
-         m_chainGroupNames       ->clear();
-         m_chainEBHypoNames      ->clear();
-         //
-         m_chainID               ->resize( configChains.size() );
-         m_chainCounter          ->resize( configChains.size() );
-         m_chainName             ->resize( configChains.size() );
-         m_chainLowerID          ->resize( configChains.size() );
-         m_chainLowerIDs         ->resize( configChains.size() );
-         m_chainLowerName        ->resize( configChains.size() );
-         m_chainLowerCounter     ->resize( configChains.size() );
-         m_chainLevel            ->resize( configChains.size() );
-         m_chainPrescale         ->resize( configChains.size() );
-         m_chainPassthrough      ->resize( configChains.size() );
-         m_chainStreamNames      ->resize( configChains.size() );
-         m_chainStreamPrescales  ->resize( configChains.size() );
-         m_chainGroupNames       ->resize( configChains.size() );
-         m_chainEBHypoNames      ->resize( configChains.size() );
-         /// variables for CHAIN -> SIGNATURE
-         m_chainSigN             ->clear();
-         m_chainSigCounter       ->clear();
-         m_chainSigLogic         ->clear();
-         m_chainSigLabel         ->clear();
-         m_chainSigOutputTEn     ->clear();
-         m_chainSigOutputTEIndex ->clear(); 
-         m_chainSigOutputTEs     ->clear();
-         //
-         m_chainSigN             ->resize( configChains.size() );
-         m_chainSigCounter       ->resize( configChains.size() );
-         m_chainSigLogic         ->resize( configChains.size() );
-         m_chainSigLabel         ->resize( configChains.size() );
-         m_chainSigOutputTEn     ->resize( configChains.size() );
-         m_chainSigOutputTEIndex ->resize( configChains.size() );
-         // We cannot resize m_chainSigOutputTEs as we don't know a priori how big it'll be.
-         for(unsigned int i = 0; i < configChains.size(); ++i) {
-            m_chainID             ->at(i) = configChains.at(i).getId();
-            m_chainCounter        ->at(i) = configChains.at(i).getCounter();
-            m_chainName           ->at(i) = configChains.at(i).getChainName();
-            m_chainLowerID        ->at(i) = configChains.at(i).getLowerId();
-            m_chainLowerIDs       ->at(i) = configChains.at(i).getLowerIds(); //Direct vector fetch
-            m_chainLowerName      ->at(i) = configChains.at(i).getLowerName();
-            m_chainLowerCounter   ->at(i) = configChains.at(i).getLowerCounter();
-            m_chainLevel          ->at(i) = configChains.at(i).getLevelId();
-            m_chainPrescale       ->at(i) = configChains.at(i).getPrescale();
-            m_chainPassthrough    ->at(i) = configChains.at(i).getPassThrough();
-            m_chainStreamNames    ->at(i) = configChains.at(i).getStream();
-            //m_chainStreamPrescales->at(i) = configChains.at(i).getStreamPS();
-            m_chainGroupNames     ->at(i) = configChains.at(i).getGroup();
-            m_chainEBHypoNames    ->at(i) = configChains.at(i).getEBHypo();
-            // Loop over Sig items
-            const std::vector<TrigConfSig> configChainSigs = configChains.at(i).getSignature();
-            m_chainSigN->at(i)       = configChainSigs.size();
-            (m_chainSigCounter       ->at(i)).resize( configChainSigs.size() );
-            (m_chainSigLogic         ->at(i)).resize( configChainSigs.size() );
-            (m_chainSigLabel         ->at(i)).resize( configChainSigs.size() );
-            (m_chainSigOutputTEn     ->at(i)).resize( configChainSigs.size() );
-            (m_chainSigOutputTEIndex ->at(i)).resize( configChainSigs.size() );
-            for (unsigned int j = 0; j < configChainSigs.size(); ++j) {
-               (m_chainSigCounter         ->at(i)).at(j) = configChainSigs.at(j).getCounter();
-               (m_chainSigLogic           ->at(i)).at(j) = configChainSigs.at(j).getLogic();
-               (m_chainSigLabel           ->at(i)).at(j) = configChainSigs.at(j).getLabel();
-               // We shall not go deeper than vector<vector<int> >, so store this vector<int> "up one level"
-               // and make a note of its position in the branch (TEIndex)
-               (m_chainSigOutputTEn       ->at(i)).at(j) = configChainSigs.at(j).getOutputTEs().size();
-               (m_chainSigOutputTEIndex   ->at(i)).at(j) = TEIndex++;
-               m_chainSigOutputTEs        ->push_back( configChainSigs.at(j).getOutputTEs() ); //Direct vector fetch
-            }      
-         }
-
-         // Save misc data
-         m_confVarKey   ->clear();
-         m_confVarVal   ->clear();
-         m_confStringKey->clear();
-         m_confStringVal->clear();
-         m_confVarKey    ->assign( tmc->getVarName().begin(),tmc->getVarName().end() );
-         m_confVarVal    ->assign( tmc->getVarId().begin()  ,tmc->getVarId().end()   );
-         m_confStringKey ->assign( tmc->getPairKey().begin(),tmc->getPairKey().end() );
-         m_confStringVal ->assign( tmc->getPairVal().begin(),tmc->getPairVal().end() );
- 
-         // Fill the information into the "classic" map format for compatability with other tools which utilise this data
-         *m_smk    = config_keys.first;
-         *m_l1psk  = config_keys.second.first;
-         *m_hltpsk = config_keys.second.second;
-
-         // Fill the LVL1 maps:
-         ATH_MSG_DEBUG( "Filling config maps" );
-         m_lvl1ConfigNameMap->clear();
-         m_lvl1ConfigPSKMap->clear();
-         // Fill the HLT maps:
-         m_hltConfigNameMap->clear();
-         m_hltConfigPSKMap->clear();
-         m_hltConfigRPSKMap->clear();
-         m_hltConfigPTMap->clear();
-         m_hltConfigLowerChainNameMap->clear();
-         for(unsigned int i = 0; i < configChains.size(); ++i) {
-            if( configChains.at(i).getLevelId() == 1 ) {
-
-               ( *m_lvl1ConfigNameMap )[ configChains.at(i).getChainName() ] = configChains.at(i).getCounter();
-               ( *m_lvl1ConfigPSKMap )[ configChains.at(i).getChainName() ] = configChains.at(i).getPrescale();
-
-                REPORT_MESSAGE( MSG::VERBOSE )
-                   << "   \"" << configChains.at(i).getChainName()
-                   << "\" CTP id = " << configChains.at(i).getCounter()
-                   << ", prescale = "
-                   << configChains.at(i).getPrescale();
-            } else {
-
-               // "classic" tool maps
-               ( *m_hltConfigNameMap )[ configChains.at(i).getChainName() ]           = configChains.at(i).getCounter();
-               ( *m_hltConfigPSKMap )[ configChains.at(i).getChainName() ]            = configChains.at(i).getPrescale();
-               ( *m_hltConfigRPSKMap )[ configChains.at(i).getChainName() ]           = 0; // This information is not present in the summary
-               ( *m_hltConfigPTMap )[ configChains.at(i).getChainName() ]             = configChains.at(i).getPassThrough();
-               ( *m_hltConfigLowerChainNameMap )[ configChains.at(i).getChainName() ] = configChains.at(i).getLowerName();
-
-               REPORT_MESSAGE( MSG::VERBOSE )
-                  << "   \"" << configChains.at(i).getChainName()
-                  << "\" Chain counter = "
-                  << configChains.at(i).getCounter()
-                  << ", prescale = "
-                  << configChains.at(i).getPrescale();
-            }
-         }
-       
-         // Fill the configuration into the output:
-         if( m_configTree->capture().isFailure() ) {
-            ATH_MSG_ERROR( "Couldn't save the configuration." );
-            return;
-         } else {
-            ATH_MSG_INFO( "Trigger configuration from TrigMonConfig source successfully saved." );
-         }
-
-         // Update the book-keeping variable:
-         m_configKeyCache.insert( config_keys );
-      }   
-   }
-
-} // namespace D3PD
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.h b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.h
deleted file mode 100644
index 946afbbece5c..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.h
+++ /dev/null
@@ -1,168 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: TrigConfMetadataTool.h 603620 2014-06-25 17:55:37Z tamartin $
-#ifndef TRIGGERD3PDMAKER_TRIGCOSTCONFMETADATATOOL_H
-#define TRIGGERD3PDMAKER_TRIGCOSTCONFMETADATATOOL_H
-
-// STL include(s):
-#include <map>
-#include <string>
-#include <set>
-
-// Gaudi/Athena include(s):
-#include "GaudiKernel/IIncidentListener.h"
-#include "GaudiKernel/IIncidentSvc.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/StoreGateSvc.h"
-
-// Trigger configuration include(s):
-#include "TrigConfInterfaces/ITrigConfigSvc.h"
-
-// D3PDMaker include(s):
-#include "D3PDMakerInterfaces/IMetadataTool.h"
-#include "D3PDMakerInterfaces/ID3PDSvc.h"
-
-namespace D3PD {
-
-   // Forward declaration(s):
-   class ID3PD;
-
-   /**
-    *  @short Tool for dumping trigger configuration information into D3PDs
-    *
-    *         This tool can be used to save the trigger configuration information
-    *         into D3PDs. It collects the information that may be needed to analyze
-    *         the events that are processed during the job, and saves this information
-    *         gradually during the job.
-    *
-    *         The tool implements two interfaces. It is a D3PD::IMetadataTool to
-    *         be able to add it to the D3PD::MakerAlg as a metadata tool, and it's
-    *         also an IIncidentListener. This latter interface allows it to listen
-    *         to various "incidents" during the job. This is how the tool keeps
-    *         track of which configurations were used during the job, and of which
-    *         luminosity blocks are described by which configuration.
-    *
-    * @author Attila Krasznahorkay Jr.
-    *
-    * $Revision: 603620 $
-    * $Date: 2014-06-25 19:55:37 +0200 (Wed, 25 Jun 2014) $
-    */
-   class TrigCostConfMetadataTool : public AthAlgTool,
-                                public IMetadataTool,
-                                public IIncidentListener {
-
-   public:
-      /// Regular AlgTool constructor
-      TrigCostConfMetadataTool( const std::string& type, const std::string& name,
-                            const IInterface* parent );
-
-      /// AlgTool initialization function
-      virtual StatusCode initialize();
-      /// Gaudi function describing which interfaces the tool implements
-      virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvIf );
-
-      /// Function writing the configuration information to the D3PD
-      virtual StatusCode writeMetadata( ID3PD* d3pd );
-
-      /// Function called when a relevant incident happened
-      virtual void handle( const Incident& inc );
-
-   private:
-      
-      /// Function handling new trigger configurations using [TrigMonConfig] summary objects
-      void handleNewTrigConfFromDataStore( const Incident& inc );
-
-      /// Directory in which to store the configuration
-      std::string m_configDir;
-
-      /// Handle for the trigger configuration service
-      ServiceHandle< TrigConf::ITrigConfigSvc > m_trigConfSvc;
-      /// Handle for the incident service
-      ServiceHandle< IIncidentSvc > m_incidentSvc;
-      /// Handle for the D3PDSvc:
-      ServiceHandle< ID3PDSvc > m_d3pdSvc;
-      /// Handle for the StoreGate service used by [TrigMonConfig]:
-      ServiceHandle< StoreGateSvc > m_storeGate;  
-      
-      /// Storegate key for [TrigMonConfig] trigger configuration summary
-      std::string m_keyConfig;
-      
-      /// Cache of which trigger configurations have been "translated"
-      typedef std::pair<int, std::pair<int, int> > Keys;
-      std::set<Keys> m_configKeyCache;
-
-      //
-      // The configuration variables:
-      //
-      ID3PD* m_configTree; ///< D3PD object holding the configuration description
-      int* m_smk; ///< Super Master Key
-      int* m_l1psk; ///< LVL1 Prescale Key
-      int* m_hltpsk; ///< HLT Prescale key
-      std::map< std::string, int >*   m_lvl1ConfigNameMap; ///< LVL1 name -> CTP ID map
-      std::map< std::string, float >* m_lvl1ConfigPSKMap; ///< LVL1 name -> prescale map
-      std::map< std::string, int >*   m_hltConfigNameMap; ///< HLT name -> counter map
-      std::map< std::string, float >* m_hltConfigPSKMap; ///< HLT name -> prescale map
-      std::map< std::string, float >* m_hltConfigRPSKMap; ///< HLT name -> rerun prescale map
-      std::map< std::string, float >* m_hltConfigPTMap; ///< HLT name -> passthrough map
-      std::map< std::string, std::string >* m_hltConfigLowerChainNameMap; ///< HLT name -> seed name map
-      
-      //
-      // The detailed configuration variables [TrigMonConfig]:  
-      //     
-      // variables for CHAIN
-      uint16_t*                                  m_chainN;
-      std::vector< uint32_t >*                   m_chainID;
-      std::vector< uint16_t >*                   m_chainCounter;
-      std::vector< std::string >*                m_chainName;
-      std::vector< uint32_t >*                   m_chainLowerID;
-      std::vector< std::vector< uint32_t > >*    m_chainLowerIDs;
-      std::vector< std::string >*                m_chainLowerName;
-      std::vector< uint16_t >*                   m_chainLowerCounter;
-      std::vector< uint8_t >*                    m_chainLevel;
-      std::vector< float >*                      m_chainPrescale;
-      std::vector< float >*                      m_chainPassthrough;
-      std::vector< std::vector< std::string > >* m_chainStreamNames;
-      std::vector< std::vector< float > >*       m_chainStreamPrescales;
-      std::vector< std::vector< std::string > >* m_chainGroupNames;
-      std::vector< std::vector< std::string > >* m_chainEBHypoNames;
-      // variables for CHAIN -> SIGNATURE
-      std::vector< uint16_t >*                   m_chainSigN;
-      std::vector< std::vector< uint32_t > >*    m_chainSigCounter;
-      std::vector< std::vector< uint32_t > >*    m_chainSigLogic;
-      std::vector< std::vector< std::string > >* m_chainSigLabel;
-      std::vector< std::vector< uint16_t > >*    m_chainSigOutputTEn;
-      std::vector< std::vector< uint32_t > >*    m_chainSigOutputTEIndex;
-      std::vector< std::vector< uint32_t > >*    m_chainSigOutputTEs;
-      // variables for SEQUENCE
-      uint16_t* m_seqN;
-      std::vector< uint32_t >*                   m_seqID;
-      std::vector< uint16_t >*                   m_seqIndex;
-      std::vector< std::string >*                m_seqName;
-      std::vector< uint32_t >*                   m_seqTopoTEID;
-      std::vector< std::vector< uint32_t > >*    m_seqInputTEs;
-      // variables for SEQUENCE -> ALG
-      std::vector< uint16_t >*                   m_seqAlgN;
-      std::vector< std::vector< uint16_t > >*    m_seqAlgIndex;
-      std::vector< std::vector< uint8_t > >*     m_seqAlgPosition;
-      std::vector< std::vector< uint32_t > >*    m_seqAlgNameID;
-      std::vector< std::vector< uint32_t > >*    m_seqAlgTypeID;
-      std::vector< std::vector< std::string > >* m_seqAlgName;
-      std::vector< std::vector< std::string > >* m_seqAlgTypeName;
-      // variables for additional configuration data
-      std::vector<std::string>*                  m_confVarKey;
-      std::vector<uint32_t>*                     m_confVarVal;
-      std::vector<std::string>*                  m_confStringKey;
-      std::vector<std::string>*                  m_confStringVal;
-
-
-   }; // class TrigConfMetadataTool
-
-} // namespace D3PD
-
-#endif // TRIGGERD3PDMAKER_TRIGCOSTCONFMETADATATOOL_H
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.cxx b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.cxx
deleted file mode 100644
index f8da8a29ee06..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.cxx
+++ /dev/null
@@ -1,1214 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: TrigCostD3PDMakerTool.cxx 2014-09-23 12:48:32Z tamartin $
-
-// Athena/Gaudi include(s):
-#include "AthenaKernel/errorcheck.h"
-
-// STL include(s):
-#include "limits.h"
-
-// Trigger [TrigMonConfig] data include(s):
-#include "TrigMonitoringEvent/TrigMonEventCollection.h"
-#include "TrigMonitoringEvent/TrigMonEvent.h"
-
-// D3PDMaker include(s):
-#include "D3PDMakerInterfaces/ID3PD.h"
-
-// Local include(s):
-#include "TrigCostD3PDMakerTool.h"
-
-namespace D3PD {
-
-  TrigCostD3PDMakerTool::TrigCostD3PDMakerTool( const std::string& type,
-                                                const std::string& name,
-                                                const IInterface* parent )
-    : AthAlgTool( type, name, parent ),
-      m_dir( "" ),
-      m_incidentSvc( "IncidentSvc", name ),
-      m_d3pdSvc( "D3PD::RootD3PDSvc/TrigConfD3PDSvc", name ),
-      m_tree( nullptr ),
-      m_onlySaveCostEvents( true ),
-      m_doBasic (false),
-      m_doExtra (false),
-      m_doChain (false),
-      m_doL1 (false),
-      m_doROS (false),
-      m_doROSSum (false),
-      m_doRoI (false),
-      m_doSeq (false),
-      m_doTE (false),
-      m_doDBKey (false),
-      m_doEB (false),
-
-      m_event (nullptr),
-      m_lumi (nullptr),
-      m_lumiLength (nullptr),
-      m_bunch_id (nullptr),
-      m_run (nullptr),
-      m_sec (nullptr),
-      m_nsec (nullptr),
-      m_timer (nullptr),
-      m_ebWeight (nullptr),
-      m_ebWeightBG (nullptr),
-      m_ebUnbiased (nullptr),
-      m_ranScaleTools(nullptr),
-      m_appId (nullptr),
-      m_chainN (nullptr),
-      m_chainCounter (nullptr),
-      m_chainLevel (nullptr),
-      m_chainTimer (nullptr),
-      m_chainIsPassed (nullptr),
-      m_chainIsPassedRaw (nullptr),
-      m_chainIsPassthrough (nullptr),
-      m_chainIsResurrected (nullptr),
-      m_chainIsPrescaled (nullptr),
-      m_chainWasL1AfterVeto (nullptr),
-      m_chainWasL1BeforePrescale (nullptr),
-      m_chainWasL1AfterPrescale (nullptr),
-      m_chainIsExpressStream (nullptr),
-      m_timerTrigCost (nullptr),
-      m_timerEndSteer (nullptr),
-      m_timerChainProcess (nullptr),
-      m_timerResultBuilder (nullptr),
-      m_timerMon (nullptr),
-      m_costEvent (nullptr),
-      m_costRunSec (nullptr),
-      m_costRunNsec (nullptr),
-      m_l1N (nullptr),
-      m_l1CtpId (nullptr),
-      m_l1PassedBeforePrescale (nullptr),
-      m_l1PassedAfterPrescale (nullptr),
-      m_l1PassedAfterVeto (nullptr),
-      m_l1Passed (nullptr),
-      m_l1Prescaled (nullptr),
-      m_l1Vetoed (nullptr),
-      m_robN (nullptr),
-      m_robRequestorId (nullptr),
-      m_robTimer (nullptr),
-      m_robTimeStartSec (nullptr),
-      m_robTimeStartMicroSec (nullptr),
-      m_robTimeStopSec (nullptr),
-      m_robTimeStopMicroSec (nullptr),
-      m_robDataN (nullptr),
-      m_robDataRobId (nullptr),
-      m_robDataRobSize (nullptr),
-      m_robDataIsUnclassified (nullptr),
-      m_robDataIsCached (nullptr),
-      m_robDataIsRetrieved (nullptr),
-      m_robDataIsIgnored (nullptr),
-      m_robDataIsDisabled (nullptr),
-      m_robDataIsStatusOk (nullptr),
-      m_robDataIsPrefetched (nullptr),
-      m_robSumDataN (nullptr),
-      m_robSumDataSize (nullptr),
-      m_robSumDataNRob (nullptr),
-      m_robSumDataSubDet (nullptr),
-      m_robSumDataIsUnclassified (nullptr),
-      m_robSumDataIsCached (nullptr),
-      m_robSumDataIsRetrieved (nullptr),
-      m_robSumDataIsIgnored (nullptr),
-      m_robSumDataIsDisabled (nullptr),
-      m_roiN (nullptr),
-      m_roiIsNoneType (nullptr),
-      m_roiIsMuonType (nullptr),
-      m_roiIsEmTauType (nullptr),
-      m_roiIsTau (nullptr),
-      m_roiIsJetType (nullptr),
-      m_roiIsJetEtType (nullptr),
-      m_roiIsEnergyType (nullptr),
-      m_roiId (nullptr),
-      m_roiNL1thresholds (nullptr),
-      m_roiEta (nullptr),
-      m_roiPhi (nullptr),
-      m_roiArea (nullptr),
-      m_roiEt (nullptr),
-      m_roiEtLarge (nullptr),
-      m_roiMuCharge (nullptr),
-      m_roiIsolationBits (nullptr),
-      m_roiVectorEX (nullptr),
-      m_roiVectorEY (nullptr),
-      m_roiOverflowEX (nullptr),
-      m_roiOverflowEY (nullptr),
-      m_roiOverflowET (nullptr),
-      m_seqN (nullptr),
-      m_seqIsInitial (nullptr),
-      m_seqIsExecuted (nullptr),
-      m_seqIsAlreadyExecuted (nullptr),
-      m_seqIsPrevious (nullptr),
-      m_seqLevel (nullptr),
-      m_seqChannelCounter (nullptr),
-      m_seqIndex (nullptr),
-      m_seqSequenceTimer (nullptr),
-      m_seqAlgTimerTot (nullptr),
-      m_seqAlgN (nullptr),
-      m_seqAlgPosition (nullptr),
-      m_seqAlgNRoIs (nullptr),
-      m_seqAlgRoIIndex (nullptr),
-      m_seqRoI (nullptr),
-      m_seqAlgIsCached (nullptr),
-      m_seqAlgIsCalled (nullptr),
-      m_seqAlgTimer (nullptr),
-      m_seqAlgTimeStartSec (nullptr),
-      m_seqAlgTimeStartMicroSec (nullptr),
-      m_seqAlgTimeStopSec (nullptr),
-      m_seqAlgTimeStopMicroSec (nullptr),
-      m_teN (nullptr),
-      m_teId (nullptr),
-      m_teIndex (nullptr),
-      m_teIsRegularTE (nullptr),
-      m_teIsInitialTE (nullptr),
-      m_teIsRoITE (nullptr),
-      m_teIsL1ThreshTE (nullptr),
-      m_teActiveState (nullptr),
-      m_teErrorState (nullptr),
-      m_teIsTerminalNode (nullptr),
-      m_teIsOutputL2Node (nullptr),
-      m_teIsOutputEFNode (nullptr),
-      m_teIsTopologicalTE (nullptr),
-      m_teChildIndex (nullptr),
-      m_teParentIndex (nullptr),
-      m_teRoiId (nullptr),
-      m_teClid (nullptr),
-      m_DB_SMK (nullptr),
-      m_DB_L1PSK (nullptr),
-      m_DB_HLTPSK (nullptr)
-  {
-
-    declareProperty( "dir", m_dir = "/StreamNTUP_TRIGCOST/trig_cost" );
-    declareProperty( "IncidentSvc", m_incidentSvc );
-    declareProperty( "D3PDSvc", m_d3pdSvc );
-    declareProperty( "prefix", m_prefix = "TrigCostHLT_" );
-    declareProperty( "keyEvent", m_keyEvent = "HLT_TrigMonEventCollection_OPI_HLT_monitoring_event");
-    declareProperty( "mode", m_writeMode = "COST");
-    declareProperty( "onlySaveCostEvents", m_onlySaveCostEvents = true, "Export only events which ran the full suite of Cost tools online"); 
-  }
-
-  StatusCode TrigCostD3PDMakerTool::initialize() {
-
-    ATH_MSG_INFO( "Initializing. Package version: " << PACKAGE_VERSION );
-
-    // Retrieve the needed services:
-    CHECK( m_incidentSvc.retrieve() );
-    CHECK( m_d3pdSvc.retrieve() );
-
-    // Set up the tool to listen to a few incidents:
-    m_incidentSvc->addListener( this, IncidentType::EndEvent );
-
-    // Create the configuration objects through the D3PD service:
-    CHECK( m_d3pdSvc->make( m_dir, m_tree ) );
-
-    if (m_writeMode == "COST") {
-      m_doBasic = true;
-      m_doExtra = true;
-      m_doChain = true;
-      m_doL1    = true;
-      m_doROS   = true;
-      m_doROSSum= false;
-      m_doRoI   = true;
-      m_doSeq   = true;
-      m_doTE    = true;
-      m_doDBKey = true;
-      m_doEB    = false;
-    } else if (m_writeMode == "RATE") {
-      m_doBasic = true;
-      m_doExtra = false;
-      m_doChain = true;
-      m_doL1    = true;
-      m_doROS   = false;
-      m_doROSSum= false;
-      m_doRoI   = true;
-      m_doSeq   = false;
-      m_doTE    = false;
-      m_doDBKey = true;
-      m_doEB    = false;
-    } else if (m_writeMode == "EBWEIGHT") {
-      m_doBasic = false;
-      m_doExtra = false;
-      m_doChain = false;
-      m_doL1    = false;
-      m_doROS   = false;
-      m_doROSSum= false;
-      m_doRoI   = false;
-      m_doSeq   = false;
-      m_doTE    = false;
-      m_doDBKey = false;
-      m_doEB    = true;
-    } else {
-      ATH_MSG_ERROR("Unrecognised write mode " << m_writeMode << " given. Options are COST, RATE or EBWEIGHT.");
-    }
-
-    //////////////
-    //BASIC DATA//
-    //////////////
-    if (m_doBasic) {
-      CHECK( m_tree->addVariable( m_prefix + "eventNumber", m_event, "Event number" ) );
-      CHECK( m_tree->addVariable( m_prefix + "lumi", m_lumi, "Lumi block number for this event" ) );
-      CHECK( m_tree->addVariable( m_prefix + "lumiLength", m_lumiLength, "Length in s of this lumi block" ) );
-      CHECK( m_tree->addVariable( m_prefix + "bunchCrossingId", m_bunch_id, "BCID for this event" ) );
-      CHECK( m_tree->addVariable( m_prefix + "runNumber", m_run, "Run number for this event" ) );
-      CHECK( m_tree->addVariable( m_prefix + "seconds", m_sec, "Start of the event in seconds" ) );
-      CHECK( m_tree->addVariable( m_prefix + "nanoSeconds", m_nsec, "Start of the event nanoseconds" ) );
-      CHECK( m_tree->addVariable( m_prefix + "timer", m_timer, "Nominal time for this event" ) );
-      CHECK( m_tree->addVariable( m_prefix + "appId", m_appId, "Hash of AppId of the XPU node processing this event." ) );
-      CHECK( m_tree->addVariable( m_prefix + "ranScaleTools", m_ranScaleTools, "If this was a monitored event (did we run the scale tools online)" ) );
-      CHECK( m_tree->addVariable( m_prefix + "costRunSec", m_costRunSec, "Second the data were saved by CostMon" ) );
-      CHECK( m_tree->addVariable( m_prefix + "costRunNsec", m_costRunNsec, "Nanosecond the data were saved by CostMon" ) );
-      CHECK( m_tree->addVariable( m_prefix + "costEvent", m_costEvent, "Sequential number of cost events processed" ) );
-    }
-
-    if (m_doEB && !m_doBasic) {
-      CHECK( m_tree->addVariable( m_prefix + "eventNumber", m_event, "Event number" ) );
-      CHECK( m_tree->addVariable( m_prefix + "ebWeight", m_ebWeight, "Enhanced bias weighting factor." ) );
-      CHECK( m_tree->addVariable( m_prefix + "ebWeightBG", m_ebWeightBG, "Enhanced bias bunch group identifier." ) );
-      CHECK( m_tree->addVariable( m_prefix + "ebUnbiased", m_ebUnbiased, "If EB event was unbiased online." ) );
-    }
-
-    //////////////
-    //EXTRA DATA//
-    //////////////
-    if (m_doExtra) {
-      CHECK( m_tree->addVariable( m_prefix + "timerTrigCost", m_timerTrigCost, "Detailed: Time to run the OPI trig cost tools" ) );
-      CHECK( m_tree->addVariable( m_prefix + "timerEndSteer", m_timerEndSteer, "Detailed: Time to end of steering" ) );
-      CHECK( m_tree->addVariable( m_prefix + "timerChainProcess", m_timerChainProcess, "Detailed: Time of chain execution" ) );
-      CHECK( m_tree->addVariable( m_prefix + "timerResultBuilder", m_timerResultBuilder, "Detailed: Time of ResultBuilder tool execution" ) );
-      CHECK( m_tree->addVariable( m_prefix + "timerMon", m_timerMon, "Detailed: Total time of monitoring tool(s) execution" ) );
-    }
-
-    //////////////
-    //CHAIN DATA//
-    //////////////
-    if (m_doChain) {
-      CHECK( m_tree->addVariable( m_prefix + "chain_n", m_chainN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_counter", m_chainCounter, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_level", m_chainLevel, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_timer", m_chainTimer, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_isPassed", m_chainIsPassed, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_isPassedRaw", m_chainIsPassedRaw, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_isPassthrough", m_chainIsPassthrough, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_isResurrected", m_chainIsResurrected, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "chain_isPrescaled", m_chainIsPrescaled, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_wasL1AfterVeto", m_chainWasL1AfterVeto, "" ) );     
-      CHECK( m_tree->addVariable( m_prefix + "chain_wasL1BeforePrescale", m_chainWasL1BeforePrescale, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "chain_wasL1AfterPrescale", m_chainWasL1AfterPrescale, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "chain_isExpressStream", m_chainIsExpressStream, "" ) );
-    }
-
-    ///////////
-    //L1 DATA//
-    ///////////
-    if (m_doL1) {
-      CHECK( m_tree->addVariable( m_prefix + "l1_n", m_l1N, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_ctpId", m_l1CtpId, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_passedBeforePrescale", m_l1PassedBeforePrescale, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_passedAfterPrescale", m_l1PassedAfterPrescale, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_passedAfterVeto", m_l1PassedAfterVeto, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_passed", m_l1Passed, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_isPrescaled", m_l1Prescaled, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_isVetoed", m_l1Vetoed, "" ) ); 
-    }
-
-    ////////////
-    //ROS DATA//
-    ////////////
-    if (m_doROS) {
-      CHECK( m_tree->addVariable( m_prefix + "rob_n", m_robN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_requestorId", m_robRequestorId, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_timer", m_robTimer, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_timeStartSec", m_robTimeStartSec, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_timeStartMicroSec", m_robTimeStartMicroSec, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_timeStopSec", m_robTimeStopSec, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_timeStopMicroSec", m_robTimeStopMicroSec, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_n", m_robDataN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_id", m_robDataRobId, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_size", m_robDataRobSize, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isUnclassified", m_robDataIsUnclassified, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isCached", m_robDataIsCached, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isRetrieved", m_robDataIsRetrieved, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isIgnored", m_robDataIsIgnored, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isDisabled", m_robDataIsDisabled, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isStatusOk", m_robDataIsStatusOk, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isStatusPrefetched", m_robDataIsPrefetched, "" ) );
-    }
-
-    ////////////////
-    //ROS SUM DATA//
-    ////////////////
-    if (m_doROSSum) {
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_n", m_robSumDataN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_size", m_robSumDataSize, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_nRob", m_robSumDataNRob, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_subDet", m_robSumDataSubDet, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_isUnclassified", m_robSumDataIsUnclassified, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_isCached", m_robSumDataIsCached, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_isRetrieved", m_robSumDataIsRetrieved, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_isIgnored", m_robSumDataIsIgnored, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_isDisabled", m_robSumDataIsDisabled, "" ) );
-    }
-
-
-    ////////////
-    //RoI DATA//
-    ////////////
-    if (m_doRoI) {
-      CHECK( m_tree->addVariable( m_prefix + "roi_n", m_roiN, "Number of L1 RoI" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeNone", m_roiIsNoneType, "Flag RoI has no type" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeMuon", m_roiIsMuonType, "Flag RoI was MUON" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeEmTau", m_roiIsEmTauType, "Flag RoI was EMTAU (see isTau)" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTau", m_roiIsTau, "Flag, disambiguity between EM and TAU" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeJet", m_roiIsJetType, "Flag RoI was Jet" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeJetEt", m_roiIsJetEtType, "Floag RoI was JetET" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeEnergy", m_roiIsEnergyType, "Flag RoI was Energy" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_id", m_roiId, "RoI ID for matching to algorithms" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_nL1Thresholds", m_roiNL1thresholds, "Number of thresholds passed, depends on config" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_eta", m_roiEta, "RoI eta coordinate" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_phi", m_roiPhi, "RoI phi coordinate" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_area", m_roiArea, "RoI area in eta x phi" ) ); 
-      // Extra RoI
-      CHECK( m_tree->addVariable( m_prefix + "roi_et", m_roiEt, "RoI ET for EMTAU, ETSmall for Jet, pT for muon, scalar sum ET for ENERGY" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_etLarge", m_roiEtLarge, "RoI ET Large for jets only" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_muCharge", m_roiMuCharge, "RoI muon charge, muons only" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_isoBits", m_roiIsolationBits, "RoI isolation bits, EMTAU only" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_vectorEX", m_roiVectorEX, "RoI signed vector sum ET in X, ENERGY only" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_vectorEY", m_roiVectorEY, "RoI signed vector sum ET in Y, ENEGY only" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_overflowEX", m_roiOverflowEX, "RoI vector sum ET X overflow bit" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_overflowEY", m_roiOverflowEY, "RoI vector sum ET Y overflow bit" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_overflowET", m_roiOverflowET, "RoI scalar sum ET overflow bit" ) ); 
-    }
-
-    ////////////////
-    //SEQ/ALG DATA//
-    ////////////////
-    if (m_doSeq) {
-      CHECK( m_tree->addVariable( m_prefix + "seq_n", m_seqN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "seq_level", m_seqLevel, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_isInitial", m_seqIsInitial, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_isExecuted", m_seqIsExecuted, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_isAlreadyExecuted", m_seqIsAlreadyExecuted, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_isPrevious", m_seqIsPrevious, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_channelCounter", m_seqChannelCounter, "" ) );         
-      CHECK( m_tree->addVariable( m_prefix + "seq_index", m_seqIndex, "" ) );         
-      CHECK( m_tree->addVariable( m_prefix + "seq_timer", m_seqSequenceTimer, "" ) );         
-      CHECK( m_tree->addVariable( m_prefix + "seq_algTotalTime", m_seqAlgTimerTot, "" ) );         
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_n", m_seqAlgN, "" ) );         
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_position", m_seqAlgPosition, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_roi_n", m_seqAlgNRoIs, "How many RoIs this alg has." ) );   
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_roi_index", m_seqAlgRoIIndex, "Index where to find these RoI IDs" ) );
-      CHECK( m_tree->addVariable( m_prefix + "seq_roi", m_seqRoI, "Look at this index to get the vector<RoI ID>" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_isCached", m_seqAlgIsCached, "" ) );       
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_isCalled", m_seqAlgIsCalled, "" ) );       
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_timer", m_seqAlgTimer, "" ) );    
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_timeStartSec", m_seqAlgTimeStartSec, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_timeStartMicroSec", m_seqAlgTimeStartMicroSec, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_timeStopSec", m_seqAlgTimeStopSec, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_timeStopMicroSec", m_seqAlgTimeStopMicroSec, "" ) ); 
-    }
-
-    ///////////
-    //TE DATA//
-    ///////////
-    if (m_doTE) {
-      CHECK( m_tree->addVariable( m_prefix + "te_n", m_teN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_id", m_teId, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_index", m_teIndex, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isRegularTe", m_teIsRegularTE, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isInitialTe", m_teIsInitialTE, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isRoITe", m_teIsRoITE, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isL1ThresholdTe", m_teIsL1ThreshTE, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isActiveState", m_teActiveState, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isErrorState", m_teErrorState, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isTerminalNode", m_teIsTerminalNode, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isOutputL2Node", m_teIsOutputL2Node, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isOutputEFNode", m_teIsOutputEFNode, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isTopologicalTe", m_teIsTopologicalTE, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_childIndex", m_teChildIndex, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_parentIndex", m_teParentIndex, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_roiId", m_teRoiId, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_clid", m_teClid, "" ) );  
-    }
-
-    ///////////
-    //DB DATA//
-    ///////////
-    if (m_doDBKey) {
-      CHECK( m_tree->addVariable( "trig_DB_SMK", m_DB_SMK, "" ) );
-      CHECK( m_tree->addVariable( "trig_DB_L1PSK", m_DB_L1PSK, "" ) );
-      CHECK( m_tree->addVariable( "trig_DB_HLTPSK", m_DB_HLTPSK, "" ) );
-    }
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode TrigCostD3PDMakerTool::queryInterface( const InterfaceID& riid,
-                                                    void** ppvIf ) {
-
-    if( riid == IMetadataTool::interfaceID() ) {
-       *ppvIf = static_cast< IMetadataTool* >( this );
-       addRef();
-       return StatusCode::SUCCESS;
-    } else if( riid == IIncidentListener::interfaceID() ) {
-       *ppvIf = static_cast< IIncidentListener* >( this );
-       addRef();
-       return StatusCode::SUCCESS;
-    }
-
-    return AthAlgTool::queryInterface( riid, ppvIf );
-  }
-
-   /**
-    * The function is actually empty. The metadata should already be in the output
-    * file at this point...
-    */
-  StatusCode TrigCostD3PDMakerTool::writeMetadata( ID3PD* ) {
-
-    ATH_MSG_INFO( "Trig cost information available in the D3PD in directory: \""
-                  << m_dir << "\"" );
-
-    return StatusCode::SUCCESS;
-  }
-
-   /**
-    * This function is called whenever an incident happens that the tool
-    * was set up to listen to. The function has to decide what kind of
-    * incident it was, and the call the appropriate internal function to
-    * handle that incident.
-    *
-    * @param inc The incident that happened
-    */
-  void TrigCostD3PDMakerTool::handle( const Incident& inc ) {
-    //
-    // Handle trigger configuration change incidents:
-    //
-    if( inc.type() == IncidentType::EndEvent ) { 
-       handleNewEvent( inc );
-       return;
-    }
-
-    ATH_MSG_WARNING( "Received incident not recognised" );
-    return;
-  }
-   
-   
-  /**
-  * Save all events in the TrigMonEventCollection to the D3PD
-  * Note magic numbers come from TrigMonVar.h
-  */
-  void TrigCostD3PDMakerTool::handleNewEvent( const Incident& ) {
-      
-    const TrigMonEventCollection *eventCol = 0;
- 
-    if( !evtStore()->contains<TrigMonEventCollection>(m_keyEvent) ) {
-      ATH_MSG_DEBUG( "No TrigMonEventCollection in this event Key:" << m_keyEvent );
-      return;
-    } else {
-      ATH_MSG_DEBUG( "TrigMonEventCollection in this event Key:" << m_keyEvent << ". Exporting to D3PD." );
-    }
-   
-    if( evtStore()->retrieve(eventCol, m_keyEvent).isFailure() || !eventCol) {
-      ATH_MSG_WARNING( "TrigMonEventCollection present, however failed to retrieve from SG. Key:" << m_keyEvent );
-      return;
-    }
-      
-    ATH_MSG_DEBUG( "Got TrigMonEventCollection: " << m_keyEvent << " Size:" << eventCol->size() );
-
-    for( TrigMonEventCollection::const_iterator it = eventCol->begin(); it != eventCol->end(); ++it) {
-      const TrigMonEvent* event = *it;
-      if(!event) {
-        ATH_MSG_WARNING( "Could not resolve TrigMonEvent pointer." );
-        continue;
-      }
-
-      // Do we want to save this event?
-      if (m_onlySaveCostEvents == true) {
-        float result = 0.;
-        event->getVar(Trig::kIsCostEvent, result); // 47, is the magic number in this case. 
-        // Bool stored as float. Test for 0
-        if (result < 0.5) {
-          ATH_MSG_DEBUG( "Not a Cost Event (scale tools were not run, but L1 result info still there). Skipping event due to m_onlySaveCostEvents == true" );
-          continue;
-        }
-      }
-
-      // Zero before new event
-      clear();
-	
-      //////////////
-      //BASIC DATA//
-      //////////////
-      if (m_doBasic) {
-        *m_event    = event->getEvent();
-        *m_lumi     = event->getLumi();
-        *m_bunch_id = event->getBunchId();
-        *m_run      = event->getRun();
-        *m_sec      = event->getSec();
-        *m_nsec     = event->getNanoSec();
-        *m_timer    = event->getTimer();
-
-        for (unsigned i=0; i < event->getWord().size(); ++i) {
-          switch (i) {
-            case 0:
-              *m_costRunSec = event->getWord().at(i);
-              break;
-            case 1:
-              *m_costRunNsec = event->getWord().at(i);
-              break;
-            case 2:
-              *m_appId = event->getWord().at(i);
-              break;
-            default:
-              break;
-          }
-        }  
-        for (unsigned i=0; i < event->getVarKey().size(); ++i) {
-          switch (event->getVarKey().at(i)) {
-            case Trig::kIsCostEvent:
-              *m_ranScaleTools = (uint8_t) event->getVarVal().at(i);
-              break;
-            case Trig::kEventLumiBlockLength:
-              *m_lumiLength = event->getVarVal().at(i);
-              break;
-            case Trig::kEventNumber:
-              *m_costEvent = event->getVarVal().at(i);
-              break;
-            default:
-              break;
-          }
-        }
-      }
-
-      //////////////
-      //EXTRA DATA//
-      //////////////
-      if (m_doExtra) {
-        // Check and save additonal payload relating to the event
-        if ( event->getVarKey().size() != event->getVarVal().size() ) {
-          REPORT_MESSAGE( MSG::WARNING ) << "Trigger cost monitor additional integer payload size different to key size, skipping.";
-        } else {
-          for (unsigned i=0; i < event->getVarKey().size(); ++i) {
-            switch (event->getVarKey().at(i)) {
-              case Trig::kTimeCostMonitoring:
-                *m_timerTrigCost = event->getVarVal().at(i);
-                break;
-              case Trig::kTimeExec:
-                *m_timerEndSteer = event->getVarVal().at(i);
-                break;
-              case Trig::kTimeProc:
-                *m_timerChainProcess = event->getVarVal().at(i);
-                break;
-              case Trig::kTimeRes:
-                *m_timerResultBuilder = event->getVarVal().at(i);
-                break;
-              case Trig::kTimeMon:
-                *m_timerMon = event->getVarVal().at(i);
-                break;
-              default:
-                break;
-            } // Switch
-          } // Key loop
-        } // Size check
-      } // m_doExtra
-
-      ///////////
-      //EB DATA//
-      ///////////
-      if (m_doEB && !m_doBasic) {
-        *m_event = event->getEvent();
-        for (unsigned i=0; i < event->getVarKey().size(); ++i) {
-          switch (event->getVarKey().at(i)) {
-            case Trig::kEBWeight:
-              *m_ebWeight = event->getVarVal().at(i);
-              break;
-            case Trig::kEBBunchGroup:
-              *m_ebWeightBG = (uint32_t) event->getVarVal().at(i);
-              break;
-            case Trig::kEBIsUnbiasedFlag:
-              *m_ebUnbiased = (uint8_t) event->getVarVal().at(i);
-              break;
-            default:
-              break;
-          }
-        }
-      }
-
-      //////////////
-      //CHAIN DATA//
-      //////////////
-      const std::vector<TrigMonChain> eventChains = event->getChains();
-      if (m_doChain && eventChains.size() > 0) {
-        *m_chainN = eventChains.size();
-        //Save details about the chain
-        m_chainCounter            ->resize( eventChains.size() );
-        m_chainLevel              ->resize( eventChains.size() );         
-        m_chainTimer              ->resize( eventChains.size() );         
-        m_chainIsPassed           ->resize( eventChains.size() );
-        m_chainIsPassedRaw        ->resize( eventChains.size() );
-        m_chainIsPassthrough      ->resize( eventChains.size() );    
-        m_chainIsResurrected      ->resize( eventChains.size() );
-        m_chainIsPrescaled        ->resize( eventChains.size() );
-        m_chainWasL1AfterVeto     ->resize( eventChains.size() );
-        m_chainWasL1BeforePrescale->resize( eventChains.size() );
-        m_chainWasL1AfterPrescale ->resize( eventChains.size() );
-        m_chainIsExpressStream    ->resize( eventChains.size() );
-        for(unsigned int i = 0; i < eventChains.size(); ++i) {
-          m_chainCounter            ->at(i) = eventChains.at(i).getCounter();     
-          m_chainLevel              ->at(i) = eventChains.at(i).getLevel();
-          m_chainTimer              ->at(i) = eventChains.at(i).getTimer();
-          m_chainIsPassed           ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kPassed );
-          m_chainIsPassedRaw        ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kPassedRaw );
-          m_chainIsPassthrough      ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kPassedThrough );
-          m_chainIsResurrected      ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kResurrected );
-          m_chainIsPrescaled        ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kPrescaled );
-          m_chainWasL1AfterVeto     ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kL1AfterVeto );
-          m_chainWasL1BeforePrescale->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kL1BeforePrescale );
-          m_chainWasL1AfterPrescale ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kL1AfterPrescale );
-          m_chainIsExpressStream    ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kExpressStream );
-
-          // Check and save additonal payload 
-          if ( eventChains.at(i).getVarKey().size() != eventChains.at(i).getVarVal().size() ) {
-            REPORT_MESSAGE( MSG::WARNING ) << "Trigger chain float payload size different to key size, skipping.";
-          } else {
-            for (unsigned j=0; j < eventChains.at(i).getVarKey().size(); ++j) {
-              REPORT_MESSAGE( MSG::DEBUG ) << "Got a CHAIN["<<i<<"] int=>float pair. Currently not saved. " << eventChains.at(i).getVarKey().at(j) << " => " << eventChains.at(i).getVarVal().at(j);
-            }
-          }  
-        }
-      }
-
-      ///////////
-      //L1 DATA//
-      ///////////
-      const std::vector<TrigMonL1Item> eventL1Items = event->getL1Items();
-      if (m_doL1 && eventL1Items.size() > 0) {
-        *m_l1N = eventL1Items.size();
-        m_l1CtpId               ->resize( eventL1Items.size() );
-        m_l1PassedBeforePrescale->resize( eventL1Items.size() );    
-        m_l1PassedAfterPrescale ->resize( eventL1Items.size() );    
-        m_l1PassedAfterVeto     ->resize( eventL1Items.size() );
-        m_l1Passed              ->resize( eventL1Items.size() );
-        m_l1Prescaled           ->resize( eventL1Items.size() );
-        m_l1Vetoed              ->resize( eventL1Items.size() );  
-        for (unsigned int i = 0; i < eventL1Items.size(); ++i) {
-          m_l1CtpId               ->at(i) = eventL1Items.at(i).getCtpId();
-          m_l1PassedBeforePrescale->at(i) = (uint8_t) eventL1Items.at(i).isPassedBeforePrescale();
-          m_l1PassedAfterPrescale ->at(i) = (uint8_t) eventL1Items.at(i).isPassedAfterPrescale();
-          m_l1PassedAfterVeto     ->at(i) = (uint8_t) eventL1Items.at(i).isPassedAfterVeto();
-          m_l1Passed              ->at(i) = (uint8_t) eventL1Items.at(i).isPassed();
-          m_l1Prescaled           ->at(i) = (uint8_t) eventL1Items.at(i).isPrescaled();
-          m_l1Vetoed              ->at(i) = (uint8_t) eventL1Items.at(i).isVeto();
-        }
-      }
-
-      ////////////
-      //ROS DATA//
-      ////////////
-      const std::vector<TrigMonROB> eventROBs = event->getVec<TrigMonROB>();
-      if (m_doROS && eventROBs.size() > 0) {
-        *m_robN = eventROBs.size();
-        m_robRequestorId          ->resize( eventROBs.size() );
-        m_robTimer                ->resize( eventROBs.size() ); 
-        m_robTimeStartSec         ->resize( eventROBs.size() );
-        m_robTimeStartMicroSec    ->resize( eventROBs.size() );
-        m_robTimeStopSec           ->resize( eventROBs.size() );
-        m_robTimeStopMicroSec      ->resize( eventROBs.size() );
-        m_robDataN                ->resize( eventROBs.size() );
-        m_robDataRobId            ->resize( eventROBs.size() );
-        m_robDataRobSize          ->resize( eventROBs.size() );
-        m_robDataIsUnclassified   ->resize( eventROBs.size() );
-        m_robDataIsCached         ->resize( eventROBs.size() );
-        m_robDataIsRetrieved      ->resize( eventROBs.size() );
-        m_robDataIsIgnored        ->resize( eventROBs.size() );
-        m_robDataIsDisabled       ->resize( eventROBs.size() );
-        m_robDataIsStatusOk       ->resize( eventROBs.size() );
-        m_robDataIsPrefetched     ->resize( eventROBs.size() );   
-        for(unsigned int i = 0; i < eventROBs.size(); ++i) { 
-          m_robRequestorId      ->at(i) = eventROBs.at(i).getRequestorId();
-          m_robTimer            ->at(i) = eventROBs.at(i).getTimer();
-          m_robTimeStartSec     ->at(i) = eventROBs.at(i).start().getSec();
-          m_robTimeStartMicroSec->at(i) = eventROBs.at(i).start().getMicroSec();
-          m_robTimeStopSec      ->at(i) = eventROBs.at(i).stop().getSec();
-          m_robTimeStopMicroSec ->at(i) = eventROBs.at(i).stop().getMicroSec();
-          //Loop over ROB data items
-          const std::vector<TrigMonROBData> robData = eventROBs.at(i).getData(); 
-          m_robDataN->at(i) = robData.size();
-          (m_robDataRobId         ->at(i)).resize( robData.size() );
-          (m_robDataRobSize       ->at(i)).resize( robData.size() );
-          (m_robDataIsUnclassified->at(i)).resize( robData.size() );
-          (m_robDataIsCached      ->at(i)).resize( robData.size() );
-          (m_robDataIsRetrieved   ->at(i)).resize( robData.size() );
-          (m_robDataIsIgnored     ->at(i)).resize( robData.size() );
-          (m_robDataIsDisabled    ->at(i)).resize( robData.size() );
-          (m_robDataIsStatusOk    ->at(i)).resize( robData.size() );
-          (m_robDataIsPrefetched  ->at(i)).resize( robData.size() ); 
-          for (unsigned int j = 0; j < robData.size(); ++j) {
-            (m_robDataRobId         ->at(i)).at(j) = robData.at(j).getROBId();
-            (m_robDataRobSize       ->at(i)).at(j) = robData.at(j).getROBSize();
-            (m_robDataIsUnclassified->at(i)).at(j) = (uint8_t) robData.at(j).isUnclassified();
-            (m_robDataIsCached      ->at(i)).at(j) = (uint8_t) robData.at(j).isCached();
-            (m_robDataIsRetrieved   ->at(i)).at(j) = (uint8_t) robData.at(j).isRetrieved();
-            (m_robDataIsIgnored     ->at(i)).at(j) = (uint8_t) robData.at(j).isIgnored();
-            (m_robDataIsDisabled    ->at(i)).at(j) = (uint8_t) robData.at(j).isDisabled();
-            (m_robDataIsStatusOk    ->at(i)).at(j) = (uint8_t) robData.at(j).isStatusOk();
-            (m_robDataIsPrefetched  ->at(i)).at(j) = (uint8_t) robData.at(j).isStatusPrefetched(); 
-          }
-        }
-      }
-
-      ////////////////
-      //ROS SUM DATA//
-      ////////////////
-      if (m_doROSSum && eventROBs.size() > 0) {
-        m_robSumDataN             ->resize( eventROBs.size() );
-        m_robSumDataSize          ->resize( eventROBs.size() );
-        m_robSumDataNRob          ->resize( eventROBs.size() );
-        m_robSumDataSubDet        ->resize( eventROBs.size() );   
-        m_robSumDataIsUnclassified->resize( eventROBs.size() );
-        m_robSumDataIsCached      ->resize( eventROBs.size() );
-        m_robSumDataIsRetrieved   ->resize( eventROBs.size() );
-        m_robSumDataIsIgnored     ->resize( eventROBs.size() );
-        m_robSumDataIsDisabled    ->resize( eventROBs.size() );
-        for(unsigned int i = 0; i < eventROBs.size(); ++i) { 
-          //Loop over ROB SUM data items
-          const std::vector<TrigMonROBSum> robSum = eventROBs.at(i).getSum();
-          m_robSumDataN->at(i) = robSum.size();
-          (m_robSumDataSize          ->at(i)).resize( robSum.size() );
-          (m_robSumDataNRob          ->at(i)).resize( robSum.size() );
-          (m_robSumDataSubDet        ->at(i)).resize( robSum.size() );   
-          (m_robSumDataIsUnclassified->at(i)).resize( robSum.size() );
-          (m_robSumDataIsCached      ->at(i)).resize( robSum.size() );
-          (m_robSumDataIsRetrieved   ->at(i)).resize( robSum.size() );
-          (m_robSumDataIsIgnored     ->at(i)).resize( robSum.size() );
-          (m_robSumDataIsDisabled    ->at(i)).resize( robSum.size() );
-          for (unsigned int j = 0; j < robSum.size(); ++j) {
-            (m_robSumDataSize          ->at(i)).at(j) = robSum.at(j).getSize();
-            (m_robSumDataNRob          ->at(i)).at(j) = robSum.at(j).getNROB();
-            (m_robSumDataSubDet        ->at(i)).at(j) = robSum.at(j).getSubDet();
-            (m_robSumDataIsUnclassified->at(i)).at(j) = (uint8_t) (robSum.at(j).getHistory() == TrigMonROBData::kUNCLASSIFIED);
-            (m_robSumDataIsCached      ->at(i)).at(j) = (uint8_t) (robSum.at(j).getHistory() == TrigMonROBData::kCACHED);
-            (m_robSumDataIsRetrieved   ->at(i)).at(j) = (uint8_t) (robSum.at(j).getHistory() == TrigMonROBData::kRETRIEVED);
-            (m_robSumDataIsIgnored     ->at(i)).at(j) = (uint8_t) (robSum.at(j).getHistory() == TrigMonROBData::kIGNORED);
-            (m_robSumDataIsDisabled    ->at(i)).at(j) = (uint8_t) (robSum.at(j).getHistory() == TrigMonROBData::kDISABLED);
-          }
-        }
-      }
-
-      ////////////
-      //RoI DATA//
-      ////////////
-      const std::vector<TrigMonRoi> eventRoIs = event->getVec<TrigMonRoi>();
-      if (m_doRoI && eventRoIs.size() > 0) {
-        *m_roiN = eventRoIs.size();
-        m_roiIsNoneType     ->resize( eventRoIs.size() );
-        m_roiIsMuonType     ->resize( eventRoIs.size() );
-        m_roiIsEmTauType    ->resize( eventRoIs.size() );
-        m_roiIsTau          ->resize( eventRoIs.size() );
-        m_roiIsJetType      ->resize( eventRoIs.size() );
-        m_roiIsJetEtType    ->resize( eventRoIs.size() );
-        m_roiIsEnergyType   ->resize( eventRoIs.size() );
-        m_roiId             ->resize( eventRoIs.size() );
-        m_roiNL1thresholds  ->resize( eventRoIs.size() );
-        m_roiEta            ->resize( eventRoIs.size() );
-        m_roiPhi            ->resize( eventRoIs.size() );
-        m_roiArea           ->resize( eventRoIs.size() );
-        m_roiEt             ->resize( eventRoIs.size() );
-        m_roiEtLarge        ->resize( eventRoIs.size() );
-        m_roiMuCharge       ->resize( eventRoIs.size() );
-        m_roiIsolationBits  ->resize( eventRoIs.size() );
-        m_roiVectorEX       ->resize( eventRoIs.size() );
-        m_roiVectorEY       ->resize( eventRoIs.size() );
-        m_roiOverflowEX     ->resize( eventRoIs.size() );
-        m_roiOverflowEY     ->resize( eventRoIs.size() );
-        m_roiOverflowET     ->resize( eventRoIs.size() );
-        for(unsigned int i = 0; i < eventRoIs.size(); ++i) {
-          m_roiIsNoneType   ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kNone);
-          m_roiIsMuonType   ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kMuon);
-          m_roiIsEmTauType  ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kEmTau);
-          m_roiIsTau        ->at(i) = (uint8_t) (eventRoIs.at(i).getVarVal(Trig::kRoIIsTau)); // Resolve ambiguity
-          m_roiIsJetType    ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kJet);
-          m_roiIsJetEtType  ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kJetEt);
-          m_roiIsEnergyType ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kEnergy);
-          m_roiId           ->at(i) = eventRoIs.at(i).getRoiId();
-          m_roiNL1thresholds->at(i) = eventRoIs.at(i).getNL1th();
-          m_roiEta          ->at(i) = eventRoIs.at(i).getEta();
-          m_roiPhi          ->at(i) = eventRoIs.at(i).getPhi();
-          m_roiArea         ->at(i) = eventRoIs.at(i).getRoIArea();
-          m_roiEt           ->at(i) = eventRoIs.at(i).getVarVal(Trig::kRoIET); //EMTAU=ET, muon=pT, jet=ETSmall, energy=scaler total energy
-          m_roiEtLarge      ->at(i) = eventRoIs.at(i).getVarVal(Trig::kRoIETLarge); //Only for jets
-          m_roiMuCharge     ->at(i) = (uint8_t) eventRoIs.at(i).getVarVal(Trig::kRoIMuonCharge); //Only for muons
-          m_roiIsolationBits->at(i) = (uint32_t) eventRoIs.at(i).getVarVal(Trig::kRoIIsolationBits); //Only for EMTAU
-          m_roiVectorEX     ->at(i) = eventRoIs.at(i).getVarVal(Trig::kRoIEnergyVectorX); //Only for ENERGY
-          m_roiVectorEY     ->at(i) = eventRoIs.at(i).getVarVal(Trig::kRoIEnergyVectorY); //Only for ENERGY
-          m_roiOverflowEX   ->at(i) = (uint8_t) eventRoIs.at(i).getVarVal(Trig::kRoIEnergyOverflowX); //Only for ENERGY
-          m_roiOverflowEY   ->at(i) = (uint8_t) eventRoIs.at(i).getVarVal(Trig::kRoIEnergyOverflowY); //Only for ENERGY
-          m_roiOverflowET   ->at(i) = (uint8_t) eventRoIs.at(i).getVarVal(Trig::kRoIEnergyOverflowT); //Only for ENERGY
-        }
-      }
-
-      ////////////////
-      //SEQ/ALG DATA//
-      ////////////////
-      const std::vector<TrigMonSeq> eventSeqs = event->getVec<TrigMonSeq>();
-      if (m_doSeq && eventSeqs.size() > 0) {
-        int RoIIndex = 0;
-        *m_seqN = eventSeqs.size();
-        
-        m_seqLevel               ->resize( eventSeqs.size() );
-        m_seqIsInitial           ->resize( eventSeqs.size() );
-        m_seqIsExecuted          ->resize( eventSeqs.size() );
-        m_seqIsAlreadyExecuted   ->resize( eventSeqs.size() );
-        m_seqIsPrevious          ->resize( eventSeqs.size() );
-        m_seqChannelCounter      ->resize( eventSeqs.size() ); 
-        m_seqIndex               ->resize( eventSeqs.size() );
-        m_seqSequenceTimer       ->resize( eventSeqs.size() ); 
-        m_seqAlgTimerTot         ->resize( eventSeqs.size() );
-        m_seqAlgN                ->resize( eventSeqs.size() ); 
-        m_seqAlgPosition         ->resize( eventSeqs.size() );
-        m_seqAlgNRoIs            ->resize( eventSeqs.size() );
-        m_seqAlgRoIIndex         ->resize( eventSeqs.size() );
-        // We do not resize m_seqRoI as we don't yet know how big it will be
-        m_seqAlgIsCached         ->resize( eventSeqs.size() );
-        m_seqAlgIsCalled         ->resize( eventSeqs.size() );
-        m_seqAlgTimer            ->resize( eventSeqs.size() );
-        m_seqAlgTimeStartSec     ->resize( eventSeqs.size() );
-        m_seqAlgTimeStartMicroSec->resize( eventSeqs.size() );
-        m_seqAlgTimeStopSec      ->resize( eventSeqs.size() );
-        m_seqAlgTimeStopMicroSec ->resize( eventSeqs.size() ); 
-        
-        for(unsigned int i = 0; i < eventSeqs.size(); ++i) {
-          m_seqLevel            ->at(i) = eventSeqs.at(i).getLevel();
-          m_seqIsInitial        ->at(i) = (uint8_t) eventSeqs.at(i).isInitial();
-          m_seqIsExecuted       ->at(i) = (uint8_t) eventSeqs.at(i).isExecuted();
-          m_seqIsAlreadyExecuted->at(i) = (uint8_t) eventSeqs.at(i).isAlreadyExecuted();
-          m_seqIsPrevious       ->at(i) = (uint8_t) eventSeqs.at(i).isPrevious();
-          m_seqChannelCounter   ->at(i) = eventSeqs.at(i).getChnCounter();
-          m_seqIndex            ->at(i) = eventSeqs.at(i).getSeqIndex();
-          m_seqSequenceTimer    ->at(i) = eventSeqs.at(i).getSeqTimer();
-          m_seqAlgTimerTot      ->at(i) = eventSeqs.at(i).getAlgTimer();
-          //Loop over sequence algorithms
-          const std::vector<TrigMonAlg> seqAlgs = eventSeqs.at(i).getAlg();
-          m_seqAlgN->at(i) = seqAlgs.size();
-          (m_seqAlgPosition         ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgNRoIs            ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgRoIIndex         ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgIsCached         ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgIsCalled         ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgTimer            ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgTimeStartSec     ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgTimeStartMicroSec->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgTimeStopSec      ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgTimeStopMicroSec ->at(i)).resize( seqAlgs.size() );
-          for (unsigned int j = 0; j < seqAlgs.size(); ++j) {
-            (m_seqAlgPosition   ->at(i)).at(j) = seqAlgs.at(j).getPosition();
-            // We shall not go deeper than vector<vector< bla > >, so store this vector<uint8_t> "up one level"
-            (m_seqAlgNRoIs            ->at(i)).at(j) = seqAlgs.at(j).getNRoi();
-            (m_seqAlgRoIIndex         ->at(i)).at(j) = RoIIndex++;
-            // We need to go via a vector, but this class gives us a set. Need to convert
-            std::vector< uint8_t > RoIIdSet;
-            RoIIdSet.clear();
-            RoIIdSet.resize( seqAlgs.at(j).getNRoi() );
-            for (unsigned int roi = 0; roi < seqAlgs.at(j).getNRoi(); ++roi) {
-              RoIIdSet.at(roi) = seqAlgs.at(j).getRoiId( roi );
-            }
-            m_seqRoI                  ->push_back( RoIIdSet );
-            (m_seqAlgIsCached         ->at(i)).at(j) = (uint8_t) seqAlgs.at(j).isCached();
-            (m_seqAlgIsCalled         ->at(i)).at(j) = (uint8_t) seqAlgs.at(j).isCalled();
-            (m_seqAlgTimer            ->at(i)).at(j) = seqAlgs.at(j).getTimer();
-            (m_seqAlgTimeStartSec     ->at(i)).at(j) = seqAlgs.at(j).start().getSec();
-            (m_seqAlgTimeStartMicroSec->at(i)).at(j) = seqAlgs.at(j).start().getMicroSec();
-            (m_seqAlgTimeStopSec      ->at(i)).at(j) = seqAlgs.at(j).stop().getSec();
-            (m_seqAlgTimeStopMicroSec ->at(i)).at(j) = seqAlgs.at(j).stop().getMicroSec();
-          }
-
-          // Check for additonal payload 
-          if ( eventSeqs.at(i).getVarKey().size() != eventSeqs.at(i).getVarVal().size() ) {
-            REPORT_MESSAGE( MSG::WARNING ) << "Trigger sequences additional float payload size different to key size, skipping.";
-          } else {
-            for (unsigned j=0; j < eventSeqs.at(i).getVarKey().size(); ++j) {
-              REPORT_MESSAGE( MSG::DEBUG ) << "Got a SEQ["<<i<<"] int=>float pair. " << eventSeqs.at(i).getVarKey().at(j) << " => " << eventSeqs.at(i).getVarVal().at(j);
-            }
-          }  
-        }
-      }
-
-      ///////////
-      //TE DATA//
-      ///////////
-      const std::vector<TrigMonTE> eventTEs = event->getVec<TrigMonTE>();
-      if (m_doTE && eventTEs.size() > 0) {  
-        *m_teN = eventTEs.size();
-        m_teId             ->resize( eventTEs.size() );
-        m_teIndex          ->resize( eventTEs.size() );
-        m_teIsRegularTE    ->resize( eventTEs.size() );
-        m_teIsInitialTE    ->resize( eventTEs.size() );
-        m_teIsRoITE        ->resize( eventTEs.size() );
-        m_teIsL1ThreshTE   ->resize( eventTEs.size() );
-        m_teActiveState    ->resize( eventTEs.size() );
-        m_teErrorState     ->resize( eventTEs.size() );
-        m_teIsTerminalNode ->resize( eventTEs.size() );
-        m_teIsOutputL2Node ->resize( eventTEs.size() );
-        m_teIsOutputEFNode ->resize( eventTEs.size() );
-        m_teIsTopologicalTE->resize( eventTEs.size() );
-        m_teChildIndex     ->resize( eventTEs.size() ); 
-        m_teParentIndex    ->resize( eventTEs.size() );
-        m_teRoiId          ->resize( eventTEs.size() );
-        m_teClid           ->resize( eventTEs.size() ); 
-        for(unsigned int i = 0; i < eventTEs.size(); ++i) {
-          m_teId             ->at(i) = eventTEs.at(i).getId();
-          m_teIndex          ->at(i) = eventTEs.at(i).getIndex();
-          m_teIsRegularTE    ->at(i) = (uint8_t) (eventTEs.at(i).getType() == TrigMonTE::kELEM);
-          m_teIsInitialTE    ->at(i) = (uint8_t) (eventTEs.at(i).getType() == TrigMonTE::kINIT);
-          m_teIsRoITE        ->at(i) = (uint8_t) (eventTEs.at(i).getType() == TrigMonTE::kROI);
-          m_teIsL1ThreshTE   ->at(i) = (uint8_t) (eventTEs.at(i).getType() == TrigMonTE::kL1TH);
-          m_teActiveState    ->at(i) = (uint8_t) eventTEs.at(i).getActiveState();
-          m_teErrorState     ->at(i) = (uint8_t) eventTEs.at(i).getErrorState();
-          m_teIsTerminalNode ->at(i) = (uint8_t) eventTEs.at(i).isTerminalNode();
-          m_teIsOutputL2Node ->at(i) = (uint8_t) eventTEs.at(i).isOutputL2Node();
-          m_teIsOutputEFNode ->at(i) = (uint8_t) eventTEs.at(i).isOutputEFNode();
-          m_teIsTopologicalTE->at(i) = (uint8_t) eventTEs.at(i).isTopologicalTE();
-          //Get inner vectors direct from the TE
-          m_teChildIndex ->at(i) = eventTEs.at(i).getChildIndex();
-          m_teParentIndex->at(i) = eventTEs.at(i).getParentIndex();
-          m_teRoiId      ->at(i) = eventTEs.at(i).getRoiId();
-          m_teClid       ->at(i) = eventTEs.at(i).getClid();
-
-          // Check additonal payload 
-          if ( eventTEs.at(i).getVarKey().size() != eventTEs.at(i).getVarVal().size() ) {
-            REPORT_MESSAGE( MSG::WARNING ) << "Trigger TE additional float payload size different to key size, skipping.";
-          } else {
-            for (unsigned j=0; j < eventTEs.at(i).getVarKey().size(); ++j) {
-              REPORT_MESSAGE( MSG::DEBUG ) << "Got a TE["<<i<<"] int=>float pair. " << eventTEs.at(i).getVarKey().at(j) << " => " << eventTEs.at(i).getVarVal().at(j);
-            }
-          }  
-        }
-      }
-
-      ///////////
-      //DB DATA//
-      ///////////
-      if (m_doDBKey) {
-        for (unsigned i=0; i < event->getVarKey().size(); ++i) {
-          switch (event->getVarKey().at(i)) {
-            case Trig::kSMK:
-              *m_DB_SMK = event->getVarVal().at(i);
-              break;
-            case Trig::kL1PSK:
-              *m_DB_L1PSK = event->getVarVal().at(i);
-              break;
-            case Trig::kHLTPSK:
-              *m_DB_HLTPSK = event->getVarVal().at(i);
-              break;
-            default:
-              break;
-          } // Switch
-        }
-      } 
-
-      if( m_tree->capture().isFailure() ) {
-        ATH_MSG_ERROR( "Couldn't save the TrigMonEvent." );
-        return;
-      } else {
-        ATH_MSG_DEBUG( "Trigger monitoring event from TrigMonEvent source successfully saved." );
-      }
-
-    } // Loop over TrigMonEventCollection DataVector
-  } // TrigCostD3PDMakerTool::handleNewEvent
-
-  void TrigCostD3PDMakerTool::clear() {
-    if (m_doBasic) {
-      *m_event = 0;
-      *m_lumi = 0;
-      *m_lumiLength = 0;
-      *m_bunch_id = 0;
-      *m_run = 0;
-      *m_sec = 0;
-      *m_nsec = 0;
-      *m_timer = 0;
-      *m_ranScaleTools= 0;
-      *m_appId = 0;
-      *m_costEvent = 0;
-      *m_costRunSec = 0;
-      *m_costRunNsec = 0;
-    }
-
-    if (m_doEB && !m_doBasic) {
-      *m_event = 0;
-      *m_ebWeight = 0;
-      *m_ebWeightBG = 0;
-      *m_ebUnbiased = 0;
-    }
-
-    //////////////
-    //EXTRA DATA//
-    //////////////
-    if (m_doExtra) {
-      *m_timerTrigCost = 0;
-      *m_timerEndSteer = 0;
-      *m_timerChainProcess = 0;
-      *m_timerResultBuilder = 0;
-      *m_timerMon = 0;
-    }
-
-    //////////////
-    //CHAIN DATA//
-    //////////////
-    if (m_doChain) {
-      *m_chainN = 0;
-      m_chainCounter->clear();
-      m_chainLevel->clear();
-      m_chainTimer->clear();
-      m_chainIsPassed->clear();
-      m_chainIsPassedRaw->clear();
-      m_chainIsPassthrough->clear();
-      m_chainIsResurrected->clear();
-      m_chainIsPrescaled->clear();
-      m_chainWasL1AfterVeto->clear();
-      m_chainWasL1BeforePrescale->clear();
-      m_chainWasL1AfterPrescale->clear();
-      m_chainIsExpressStream->clear();
-    }
-
-    ///////////
-    //L1 DATA//
-    ///////////
-    if (m_doL1) {
-      *m_l1N = 0;
-      m_l1CtpId ->clear();
-      m_l1PassedBeforePrescale ->clear();
-      m_l1PassedAfterPrescale->clear();
-      m_l1PassedAfterVeto->clear();
-      m_l1Passed->clear();
-      m_l1Prescaled->clear();
-      m_l1Vetoed->clear();
-    }
-
-    ////////////
-    //ROS DATA//
-    ////////////
-    if (m_doROS) {
-      *m_robN = 0;
-      m_robRequestorId->clear();
-      m_robTimer->clear();
-      m_robTimeStartSec->clear();
-      m_robTimeStartMicroSec->clear();
-      m_robTimeStopSec->clear();
-      m_robTimeStopMicroSec->clear();
-      m_robDataN->clear();
-      m_robDataRobId->clear();
-      m_robDataRobSize->clear();
-      m_robDataIsUnclassified->clear();
-      m_robDataIsCached->clear();
-      m_robDataIsRetrieved->clear();
-      m_robDataIsIgnored->clear();
-      m_robDataIsDisabled->clear();
-      m_robDataIsStatusOk->clear();
-      m_robDataIsPrefetched->clear();
-    }
-
-    ////////////////
-    //ROS SUM DATA//
-    ////////////////
-    if (m_doROSSum) {
-      m_robSumDataN->clear();
-      m_robSumDataSize->clear();
-      m_robSumDataNRob->clear();
-      m_robSumDataSubDet->clear();
-      m_robSumDataIsUnclassified->clear();
-      m_robSumDataIsCached->clear();
-      m_robSumDataIsRetrieved->clear();
-      m_robSumDataIsIgnored->clear();
-      m_robSumDataIsDisabled->clear();
-    }
-
-
-    ////////////
-    //RoI DATA//
-    ////////////
-    if (m_doRoI) {
-      *m_roiN = 0;
-      m_roiIsNoneType->clear();
-      m_roiIsMuonType->clear();
-      m_roiIsEmTauType->clear();
-      m_roiIsTau->clear();
-      m_roiIsJetType->clear();
-      m_roiIsJetEtType->clear();
-      m_roiIsEnergyType->clear();
-      m_roiId->clear();
-      m_roiNL1thresholds->clear();
-      m_roiEta->clear();
-      m_roiPhi->clear();
-      m_roiArea->clear();
-      //
-      m_roiEt->clear();
-      m_roiEtLarge->clear();
-      m_roiMuCharge->clear();
-      m_roiIsolationBits->clear();
-      m_roiVectorEX->clear();
-      m_roiVectorEY->clear();
-      m_roiOverflowEX->clear();
-      m_roiOverflowEY->clear();
-      m_roiOverflowET->clear();
-    }
-
-    ////////////////
-    //SEQ/ALG DATA//
-    ////////////////
-    if (m_doSeq) {
-      *m_seqN = 0;
-      m_seqIsInitial->clear();
-      m_seqIsExecuted->clear();
-      m_seqIsAlreadyExecuted->clear();
-      m_seqIsPrevious->clear();
-      m_seqLevel->clear();
-      m_seqChannelCounter->clear();
-      m_seqIndex->clear();
-      m_seqSequenceTimer->clear();
-      m_seqAlgTimerTot->clear();
-      m_seqAlgN->clear();
-      m_seqAlgPosition->clear();
-      m_seqAlgNRoIs->clear();
-      m_seqAlgRoIIndex->clear();
-      m_seqRoI->clear();
-      m_seqAlgIsCached->clear();
-      m_seqAlgIsCalled->clear();
-      m_seqAlgTimer->clear();
-      m_seqAlgTimeStartSec->clear();
-      m_seqAlgTimeStartMicroSec->clear();
-      m_seqAlgTimeStopSec->clear();
-      m_seqAlgTimeStopMicroSec->clear();
-    }
-
-    ///////////
-    //TE DATA//
-    ///////////
-    if (m_doTE) {
-      *m_teN = 0;
-      m_teId->clear();
-      m_teIndex->clear();
-      m_teIsRegularTE->clear();
-      m_teIsInitialTE->clear();
-      m_teIsRoITE->clear();
-      m_teIsL1ThreshTE->clear();
-      m_teActiveState->clear();
-      m_teErrorState->clear();
-      m_teIsTerminalNode->clear();
-      m_teIsOutputL2Node->clear();
-      m_teIsOutputEFNode->clear();
-      m_teIsTopologicalTE->clear();
-      m_teChildIndex->clear();
-      m_teParentIndex->clear();
-      m_teRoiId->clear();
-      m_teClid->clear(); 
-    }
-
-    ///////////
-    //DB DATA//
-    ///////////
-    if (m_doDBKey) {
-      *m_DB_SMK = 0;
-      *m_DB_L1PSK = 0;
-      *m_DB_HLTPSK = 0;
-    }
-  }
-
-} // namespace D3PD
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.h b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.h
deleted file mode 100644
index 4913a1470b62..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.h
+++ /dev/null
@@ -1,272 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: TrigCostD3PDMakerTool.h 603620 2014-06-25 17:55:37Z tamartin $
-#ifndef TRIGGERD3PDMAKER_TRIGCOSTD3PDMAKERTOOL_H
-#define TRIGGERD3PDMAKER_TRIGCOSTD3PDMAKERTOOL_H
-
-// STL include(s):
-#include <map>
-#include <string>
-#include <set>
-
-// Gaudi/Athena include(s):
-#include "GaudiKernel/IIncidentListener.h"
-#include "GaudiKernel/IIncidentSvc.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/StoreGateSvc.h"
-
-// D3PDMaker include(s):
-#include "D3PDMakerInterfaces/IMetadataTool.h"
-#include "D3PDMakerInterfaces/ID3PDSvc.h"
-
-namespace D3PD {
-
-    // Forward declaration(s):
-    class ID3PD;
-
-    /**
-    * @short D3PDMaker package to write out TrigMonEvent objects to flat ntuple.
-    * As these are written out to the bytestream en-bulk, have to use tricks from the 
-    * TrigConfMetadata writer and manually write out the TTree with the D3PD metadata tools
-    * rather than using a standard D3PDMaker alg.
-    *
-    * Hence we do not get one entry per event, we get one entry for every TrigMonEvent object 
-    * (represnets an event in the HLT).
-    */
-    class TrigCostD3PDMakerTool : public AthAlgTool,
-                                  public IMetadataTool,
-                                  public IIncidentListener {
-
-      public:
-        /// Regular AlgTool constructor
-        TrigCostD3PDMakerTool( const std::string& type, const std::string& name,
-        const IInterface* parent );
-
-        /// AlgTool initialization function
-        virtual StatusCode initialize();
-        /// Gaudi function describing which interfaces the tool implements
-        virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvIf );
-
-        /// Function writing the configuration information to the D3PD
-        virtual StatusCode writeMetadata( ID3PD* d3pd );
-
-        /// Function called when a relevant incident happened
-        virtual void handle( const Incident& inc );
-
-      private:
-        /// Function handling new trigger configurations
-        void handleNewEvent( const Incident& inc );
-
-        void clear();
-
-        /// Directory in which to store the data
-        std::string m_dir;
-
-        /// Handle for the incident service
-        ServiceHandle< IIncidentSvc > m_incidentSvc;
-        /// Handle for the D3PDSvc:
-        ServiceHandle< ID3PDSvc > m_d3pdSvc;
-
-        /// Storegate key for TrigMonEvent objects
-        std::string m_keyEvent;
-        /// D3PD prefix
-        std::string m_prefix;
-
-        //
-        // The configuration variables:
-        //
-        ID3PD* m_tree; ///< D3PD object holding the configuration description
-        bool m_onlySaveCostEvents; //!< Export non cost events?
-        std::string m_writeMode; //!< What to export
-        bool m_doBasic;
-        bool m_doExtra;
-        bool m_doChain;
-        bool m_doL1;
-        bool m_doROS;
-        bool m_doROSSum;
-        bool m_doRoI;
-        bool m_doSeq;
-        bool m_doTE;
-        bool m_doDBKey;
-        bool m_doEB;
-
-        //////////////
-        //BASIC DATA//
-        //////////////
-        uint32_t* m_event;              // Event number
-        uint32_t* m_lumi;               // Lumi block (low 16 bits of TrigMonEvent.m_lumi) 
-        float*    m_lumiLength;         // Lumi block length in seconds
-        uint32_t* m_bunch_id;           // bunch crossing id (high 16 bits of TrigMonEvent.m_lumi)
-        uint32_t* m_run;                // Run number
-        uint32_t* m_sec;                // Event second
-        uint32_t* m_nsec;               // Event ns
-        float*    m_timer;              // Event timer
-        float*    m_ebWeight;           // Enhanced bias weighting factor
-        uint32_t* m_ebWeightBG;         // Enhanced bias weight bunch group
-        uint8_t*  m_ebUnbiased;         // Enhanced Bias flag for unbiased online events
-        uint8_t*  m_ranScaleTools;      // If this was a monitoring event
-        uint32_t* m_appId;              // Application ID - hash of trigger XPU node
-
-        //////////////
-        //CHAIN DATA//
-        //////////////
-        uint16_t*                m_chainN; 
-        std::vector< uint16_t >* m_chainCounter;
-        std::vector< uint16_t >* m_chainLevel;    
-        std::vector< float >*    m_chainTimer;         
-        std::vector< uint8_t >*  m_chainIsPassed;   
-        std::vector< uint8_t >*  m_chainIsPassedRaw;
-        std::vector< uint8_t >*  m_chainIsPassthrough;
-        std::vector< uint8_t >*  m_chainIsResurrected;
-        std::vector< uint8_t >*  m_chainIsPrescaled;
-        std::vector< uint8_t >*  m_chainWasL1AfterVeto;
-        std::vector< uint8_t >*  m_chainWasL1BeforePrescale;
-        std::vector< uint8_t >*  m_chainWasL1AfterPrescale;
-        std::vector< uint8_t >*  m_chainIsExpressStream;
-
-        //////////////
-        //EXTRA DATA//
-        //////////////
-        float*    m_timerTrigCost;      // Detailed time - Time to process TrigCost OPI tools
-        float*    m_timerEndSteer;      // Detailed time - End of OPI steering
-        float*    m_timerChainProcess;  // Detailed time - chain processing
-        float*    m_timerResultBuilder; // Detailed time - result building
-        float*    m_timerMon;           // Detailed time - monitoring 
-        float*    m_costEvent;          // Sequential cost event number
-        uint32_t* m_costRunSec;         // Cost processing time second
-        uint32_t* m_costRunNsec;        // Cost processing time ns
-
-        ///////////
-        //L1 DATA//
-        ///////////
-        uint16_t*                m_l1N; 
-        std::vector< uint16_t >* m_l1CtpId;
-        std::vector< uint8_t >*  m_l1PassedBeforePrescale;    
-        std::vector< uint8_t >*  m_l1PassedAfterPrescale;    
-        std::vector< uint8_t >*  m_l1PassedAfterVeto;
-        std::vector< uint8_t >*  m_l1Passed;
-        std::vector< uint8_t >*  m_l1Prescaled;
-        std::vector< uint8_t >*  m_l1Vetoed; 
-
-        ////////////
-        //ROS DATA//
-        ////////////
-        uint16_t*                               m_robN;
-        std::vector< uint32_t >*                m_robRequestorId;
-        std::vector< double >*                  m_robTimer;
-        std::vector< uint32_t >*                m_robTimeStartSec;
-        std::vector< uint32_t >*                m_robTimeStartMicroSec;
-        std::vector< uint32_t >*                m_robTimeStopSec;
-        std::vector< uint32_t >*                m_robTimeStopMicroSec;
-        std::vector< uint16_t >*                m_robDataN;
-        std::vector< std::vector< uint32_t > >* m_robDataRobId;
-        std::vector< std::vector< uint32_t > >* m_robDataRobSize;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsUnclassified;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsCached;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsRetrieved;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsIgnored;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsDisabled;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsStatusOk;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsPrefetched;   
-        std::vector< uint16_t >*                m_robSumDataN;
-        std::vector< std::vector< uint32_t > >* m_robSumDataSize;
-        std::vector< std::vector< uint32_t > >* m_robSumDataNRob;
-        std::vector< std::vector< uint32_t > >* m_robSumDataSubDet;  
-        std::vector< std::vector< uint8_t > >*  m_robSumDataIsUnclassified; 
-        std::vector< std::vector< uint8_t > >*  m_robSumDataIsCached;
-        std::vector< std::vector< uint8_t > >*  m_robSumDataIsRetrieved;
-        std::vector< std::vector< uint8_t > >*  m_robSumDataIsIgnored;
-        std::vector< std::vector< uint8_t > >*  m_robSumDataIsDisabled;
-
-        ////////////
-        //RoI DATA//
-        ////////////
-        uint16_t*                 m_roiN;
-        std::vector< uint8_t >*   m_roiIsNoneType;
-        std::vector< uint8_t >*   m_roiIsMuonType;
-        std::vector< uint8_t >*   m_roiIsEmTauType;
-        std::vector< uint8_t >*   m_roiIsTau;
-        std::vector< uint8_t >*   m_roiIsJetType;
-        std::vector< uint8_t >*   m_roiIsJetEtType;
-        std::vector< uint8_t >*   m_roiIsEnergyType;
-        std::vector< uint32_t >*  m_roiId;
-        std::vector< uint8_t >*   m_roiNL1thresholds;
-        std::vector< float >*     m_roiEta;
-        std::vector< float >*     m_roiPhi;
-        std::vector< float >*     m_roiArea;
-        //
-        std::vector< float >*     m_roiEt;
-        std::vector< float >*     m_roiEtLarge;
-        std::vector< uint8_t >*   m_roiMuCharge;
-        std::vector< uint32_t >*  m_roiIsolationBits;
-        std::vector< float >*     m_roiVectorEX;
-        std::vector< float >*     m_roiVectorEY;
-        std::vector< uint8_t >*   m_roiOverflowEX;
-        std::vector< uint8_t >*   m_roiOverflowEY;
-        std::vector< uint8_t >*   m_roiOverflowET;
-
-        ////////////////
-        //SEQ/ALG DATA//
-        ////////////////
-        uint16_t*                               m_seqN;
-        std::vector< uint8_t >*                 m_seqIsInitial;
-        std::vector< uint8_t >*                 m_seqIsExecuted;
-        std::vector< uint8_t >*                 m_seqIsAlreadyExecuted;
-        std::vector< uint8_t >*                 m_seqIsPrevious;
-        std::vector< uint16_t >*                m_seqLevel;
-        std::vector< uint16_t >*                m_seqChannelCounter;
-        std::vector< uint16_t >*                m_seqIndex; 
-        std::vector< float >*                   m_seqSequenceTimer; 
-        std::vector< double >*                  m_seqAlgTimerTot; 
-        std::vector< uint16_t >*                m_seqAlgN; 
-        std::vector< std::vector< uint8_t > >*  m_seqAlgPosition; 
-        std::vector< std::vector< uint8_t > >*  m_seqAlgNRoIs; // RoI's are held in another varaible
-        std::vector< std::vector< uint32_t > >* m_seqAlgRoIIndex;
-        std::vector< std::vector< uint8_t > >*  m_seqRoI; // Hold the RoI data
-        std::vector< std::vector< uint8_t > >*  m_seqAlgIsCached;
-        std::vector< std::vector< uint8_t > >*  m_seqAlgIsCalled;
-        std::vector< std::vector< double > >*   m_seqAlgTimer; 
-        std::vector< std::vector< uint32_t > >* m_seqAlgTimeStartSec; 
-        std::vector< std::vector< uint32_t > >* m_seqAlgTimeStartMicroSec; 
-        std::vector< std::vector< uint32_t > >* m_seqAlgTimeStopSec; 
-        std::vector< std::vector< uint32_t > >* m_seqAlgTimeStopMicroSec; 
-
-        ///////////
-        //TE DATA//
-        ///////////
-        uint16_t*                                 m_teN; 
-        std::vector< uint16_t >*                  m_teId;
-        std::vector< uint16_t >*                  m_teIndex;
-        std::vector< uint8_t >*                   m_teIsRegularTE;
-        std::vector< uint8_t >*                   m_teIsInitialTE;
-        std::vector< uint8_t >*                   m_teIsRoITE;
-        std::vector< uint8_t >*                   m_teIsL1ThreshTE;
-        std::vector< uint8_t >*                   m_teActiveState;
-        std::vector< uint8_t >*                   m_teErrorState;
-        std::vector< uint8_t >*                   m_teIsTerminalNode;
-        std::vector< uint8_t >*                   m_teIsOutputL2Node;
-        std::vector< uint8_t >*                   m_teIsOutputEFNode;
-        std::vector< uint8_t >*                   m_teIsTopologicalTE;
-        std::vector< std::vector< uint16_t > >*   m_teChildIndex;
-        std::vector< std::vector< uint16_t > >*   m_teParentIndex;
-        std::vector< std::vector< uint8_t > >*    m_teRoiId;
-        std::vector< std::vector< uint32_t > >*   m_teClid;
-
-        ///////////
-        //DB DATA//
-        ///////////
-        uint32_t* m_DB_SMK;
-        uint32_t* m_DB_L1PSK;
-        uint32_t* m_DB_HLTPSK;
-
-    }; // class TrigCostD3PDMakerTool
-
-} // namespace D3PD
-
-#endif // TRIGGERD3PDMAKER_TRIGCOSTD3PDMAKERTOOL_H
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/components/TrigCostD3PDMaker_entries.cxx b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/components/TrigCostD3PDMaker_entries.cxx
deleted file mode 100644
index 86fcac335e11..000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/components/TrigCostD3PDMaker_entries.cxx
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "../TrigCostD3PDMakerTool.h"
-#include "../TrigCostConfMetadataTool.h"
-
-DECLARE_COMPONENT( D3PD::TrigCostD3PDMakerTool )
-DECLARE_COMPONENT( D3PD::TrigCostConfMetadataTool )
-
diff --git a/Trigger/TrigMonitoring/TrigCostMonitor/share/readTrigCost.py b/Trigger/TrigMonitoring/TrigCostMonitor/share/readTrigCost.py
deleted file mode 100644
index ceff0d601a14..000000000000
--- a/Trigger/TrigMonitoring/TrigCostMonitor/share/readTrigCost.py
+++ /dev/null
@@ -1,119 +0,0 @@
-
-#----------------------------------------------------------------------
-# Global and trigger flags
-#
-
-if (not 'costD3PD_doL2' in dir()):
-  costD3PD_doL2 = False
-
-if (not 'costD3PD_doEF' in dir()):
-  costD3PD_doEF = False
-
-if (not 'costD3PD_doHLT' in dir()):
-  costD3PD_doHLT = True
-
-if (not 'costOutput' in dir()):
-  costOutput = "COST RATE EB"
-
-#BSRDOInput=['data_test.00212967.Single_Stream.daq.RAW._lb0291._Athena._0101.data']
-
-if not ('BSRDOInput' in dir()):
-    print 'ERROR! Please supply a BSRDOInput to run over'
-    sys.exit(1)
-
-if not ('EvtMax' in dir()):
-    EvtMax=-1
-from AthenaCommon.AppMgr import theApp
-theApp.EvtMax = EvtMax
-
-if ('setEvent' in dir()) and type(setEvent) == int:
-    from AthenaCommon.AppMgr import theApp
-    theApp.setEvent = setEvent
-
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-#athenaCommonFlags.isOnline = True
-athenaCommonFlags.BSRDOInput=BSRDOInput
-
-
-from RecExConfig.RecFlags import rec
-rec.readRDO = False
-rec.AutoConfiguration=['everything']
-
-from AthenaCommon.AlgSequence import AlgSequence
-topSeq = AlgSequence()
-
-#----------------------------------------------------------------------
-# Set services for reading BS files
-#
-include("ByteStreamCnvSvc/BSEventStorageEventSelector_jobOptions.py")
-
-svcMgr.ByteStreamCnvSvc.InitCnvs += [ "EventInfo",
-                                      "HLT::HLTResult"]
-
-svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/HLTResult_L2",
-                                                   "HLT::HLTResult/HLTResult_EF",
-                                                   "HLT::HLTResult/HLTResult_HLT"]
-
-
-#----------------------------------------------------------------------
-# Set input files
-#
-if ('BSRDOInput' in dir()):
-    svcMgr.EventSelector.Input = BSRDOInput
-
-if len(svcMgr.EventSelector.Input) == 0:
-    print 'ERROR! svcMgr.EventSelector.Input is empty'
-    sys.exit(1)
-
-#----------------------------------------------------------------------
-# Setup cost algorithm
-#
-from TrigCostMonitor.TrigCostMonitorConfig import prepareCostRun, setupCostDebug
-
-costRunString = " "
-if ('costD3PD_doL2' in dir() and bool(costD3PD_doL2) == True): costRunString += "l2 "
-if ('costD3PD_doEF' in dir() and bool(costD3PD_doEF) == True): costRunString += "ef "
-if ('costD3PD_doHLT' in dir() and bool(costD3PD_doHLT) == True): costRunString += "hlt "
-
-print "Setting up TrigCostRun algorithm: Running over levels - " + costRunString
-runAlg = prepareCostRun('TrigCostRun', costRunString)
-
-#setDebug = 1
-
-if ('enableCostDebug' in dir() and bool(enableCostDebug) == True):
-    print 'Setting TrigCostRun to DEBUG output level'
-    setupCostDebug()
-    runAlg.OutputLevel = DEBUG
-    runAlg.navigation.OutputLevel = DEBUG
-    for tool in runAlg.tools:
-        tool.OutputLevel = DEBUG
-    print runAlg
-
-topSeq += runAlg
-
-from AthenaCommon.Include import include
-if ("COST" in costOutput):
-  include("TrigCostD3PDMaker/TrigCostD3PDMaker_prodJobOFragment.py")
-
-if ("RATE" in costOutput):
-  include("TrigCostD3PDMaker/TrigRateD3PDMaker_prodJobOFragment.py")
-
-if ("EB" in costOutput):
-  include("TrigCostD3PDMaker/TrigEBWeightD3PDMaker_prodJobOFragment.py")
-
-#----------------------------------------------------------------------
-# Message service and loop manager options
-#
-ServiceMgr.MessageSvc.OutputLevel = 3
-#ServiceMgr.MessageSvc.defaultLimit = 0
-#ServiceMgr.MessageSvc.enableSuppression = False
-ServiceMgr.MessageSvc.Format = "% F%35W%S%7W%R%T %0W%M"
-ServiceMgr.MessageSvc.showStats = True
-ServiceMgr.MessageSvc.statLevel = WARNING
-
-if not hasattr(ServiceMgr, "AthenaEventLoopMgr"):
-    from AthenaServices.AthenaServicesConf import AthenaEventLoopMgr
-    ServiceMgr += AthenaEventLoopMgr()
-    
-ServiceMgr.AthenaEventLoopMgr.EventPrintoutInterval = 100
-
diff --git a/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDO.py b/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDO.py
index a679fdd0085f..64f9d5b8d504 100644
--- a/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDO.py
+++ b/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDO.py
@@ -17,15 +17,6 @@ if ('enableCostMonitoring' in dir() and bool(enableCostMonitoring) == True):
 else: 
     enableCostMonitoring = False
 
-#RTT runs with costMonitoring on - test whether it is available in a given release
-#test whether a package is useable in this release
-import imp
-try:
-    imp.find_module('TrigCostD3PDMaker')
-except:
-    printfunc ('CostMonitoring packages not available, setting  enableCostMonitoring=False')
-    enableCostMonitoring=False
-
 # flags for RecExCommon
 doTrigger=True
 rec.doWriteAOD=False
@@ -183,7 +174,6 @@ if 'enableCostMonitoring' in dir() and bool(enableCostMonitoring) == True:
     import TriggerJobOpts.Modifiers
     getattr(TriggerJobOpts.Modifiers,'enableCostMonitoring')().postSetup()
     getattr(TriggerJobOpts.Modifiers,'enableCostForCAF')().postSetup()
-    getattr(TriggerJobOpts.Modifiers,'enableCostD3PD')().postSetup()
     # Check if we are debugging the cost mon output - false by default
     if 'enableCostDebug' in dir() and bool(enableCostDebug) == True:
         getattr(TriggerJobOpts.Modifiers,'enableCostDebug')().postSetup()
diff --git a/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDOtoAOD.py b/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDOtoAOD.py
index ee15054237ea..8dc63e0d4a18 100644
--- a/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDOtoAOD.py
+++ b/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDOtoAOD.py
@@ -22,15 +22,6 @@ if ('enableCostMonitoring' in dir()):
 else: 
     enableCostMonitoring = False
 
-#RTT runs with costMonitoring on - test whether it is available in a given release
-#test whether a package is useable in this release
-import imp
-try:
-    imp.find_module('TrigCostD3PDMaker')
-except:
-    printfunc ('CostMonitoring packages not available, setting  enableCostMonitoring=False')
-    enableCostMonitoring=False
-
 # flags for RecExCommon
 #thanks to Olya for the "magic" AOD combination - see: https://its.cern.ch/jira/browse/ATR-11211
 doTrigger=True
@@ -208,7 +199,6 @@ if 'enableCostMonitoring' in dir() and bool(enableCostMonitoring) == True:
     import TriggerJobOpts.Modifiers
     getattr(TriggerJobOpts.Modifiers,'enableCostMonitoring')().postSetup()
     getattr(TriggerJobOpts.Modifiers,'enableCostForCAF')().postSetup()
-    getattr(TriggerJobOpts.Modifiers,'enableCostD3PD')().postSetup()
     # Check if we are debugging the cost mon output - false by default
     if 'enableCostDebug' in dir() and bool(enableCostDebug) == True:
         getattr(TriggerJobOpts.Modifiers,'enableCostDebug')().postSetup()
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
index 634c3b2c8cdb..be28e95d4871 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
@@ -1288,37 +1288,6 @@ class autoConditionsTag(_modifier):
         from RecExConfig.AutoConfiguration import ConfigureConditionsTag
         ConfigureConditionsTag()
 
-
-class enableCostD3PD(_modifier):
-    """
-    Enables creation of Cost D3PD during trigger execution
-    Should be used in conjunction with enableCostMonitoring
-    D3PDMaker packages must be in the release or compiled manually
-    """
-    def postSetup(self):
-        import imp
-        try:
-            imp.find_module('TrigCostD3PDMaker')
-            from AthenaCommon.Include import include, IncludeError
-            include("TrigCostD3PDMaker/TrigCostD3PDMaker_prodJobOFragment.py")
-        except IncludeError:
-            log.error('TrigCostD3PDMaker packages not available, will not produce CostMonitoring D3PD.')
-
-class enableRateD3PD(_modifier):
-    """
-    Enables creation of Rate D3PD during trigger execution
-    Should be used in conjunction with enableCostMonitoring
-    D3PDMaker packages must be in the release or compiled manually
-    """
-    def postSetup(self):
-        import imp
-        try:
-            imp.find_module('TrigCostD3PDMaker')
-            from AthenaCommon.Include import include, IncludeError
-            include("TrigCostD3PDMaker/TrigRateD3PDMaker_prodJobOFragment.py")
-        except IncludeError:
-            log.warning('TrigCostD3PDMaker packages not available, will not produce RateMonitoring D3PD.')
-
 class enableCostDebug(_modifier):
     """
     Enables cost debugging options
@@ -1375,14 +1344,6 @@ class doEnhancedBiasWeights(_modifier):
             costConfig.postSetupEBWeighting()
         except AttributeError:
             log.warning('TrigCostMonitor has no EnhancedBias postSetup option...')
-        # Try to put this in D3PD (will only work offline), still goes in the BS anyway
-        import imp
-        try:
-            imp.find_module('TrigCostD3PDMaker')
-            from AthenaCommon.Include import include, ImportError
-            include("TrigCostD3PDMaker/TrigEBWeightD3PDMaker_prodJobOFragment.py")
-        except ImportError:
-            log.warning('TrigCostD3PDMaker packages not available, will not produce Enhanced Bias weighting D3PD.')
 
 class BeamspotFromSqlite(_modifier):
     """
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 381efafe28d6..762ffaaf69fd 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -30,7 +30,6 @@ class opt:
     doMuon           = True           # ConfigFlags.Trigger.doMuon
     doDBConfig       = None           # dump trigger configuration
     trigBase         = None           # file name for trigger config dump
-    enableCostD3PD   = False          # enable cost monitoring
     doWriteRDOTrigger = False         # Write out RDOTrigger?
     doWriteBS        = True           # Write out BS?
     doL1Unpacking    = True           # decode L1 data in input file if True, else setup emulation
-- 
GitLab


From 1449931258b21d91c5930aa2b372f56813e849a7 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Tue, 22 Sep 2020 17:23:42 +0200
Subject: [PATCH 363/422] TrigCostD3PD: Delete unused package

---
 Trigger/TrigCost/TrigCostD3PD/CMakeLists.txt  |   23 -
 Trigger/TrigCost/TrigCostD3PD/Root/LinkDef.h  |   86 -
 .../TrigCostD3PD/Root/NTUP_TRIGCOST.cxx       |  105 --
 .../TrigCostD3PD/Root/TrigCostD3PDObject.cxx  | 1450 -----------------
 .../Root/TrigDBKeysD3PDObject.cxx             |  315 ----
 .../TrigCostD3PD/Root/UserD3PDObject.cxx      |  326 ----
 Trigger/TrigCost/TrigCostD3PD/Root/Utils.cxx  |  164 --
 .../TrigCost/TrigCostD3PD/Root/VarHandle.cxx  |  284 ----
 .../TrigCostD3PD/D3PDObjectBase.h             |   67 -
 .../TrigCostD3PD/TrigCostD3PD/NTUP_TRIGCOST.h |   75 -
 .../TrigCostD3PD/TrigCostD3PDObject.h         |  234 ---
 .../TrigCostD3PD/TrigDBKeysD3PDObject.h       |   91 --
 .../TrigCostD3PD/UserD3PDObject.h             |  186 ---
 .../TrigCostD3PD/UserD3PDObject.icc           |  249 ---
 .../TrigCostD3PD/TrigCostD3PD/Utils.h         |   27 -
 .../TrigCostD3PD/TrigCostD3PD/VarHandle.h     |  225 ---
 .../TrigCostD3PD/TrigCostD3PD/VarHandle.icc   |  277 ----
 .../TrigCostD3PD/TrigCostD3PD/VarProxy.h      |   90 -
 .../TrigCostD3PD/TrigCostD3PD/VarProxy.icc    |   72 -
 19 files changed, 4346 deletions(-)
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/CMakeLists.txt
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/Root/LinkDef.h
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/Root/NTUP_TRIGCOST.cxx
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/Root/TrigCostD3PDObject.cxx
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/Root/TrigDBKeysD3PDObject.cxx
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/Root/UserD3PDObject.cxx
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/Root/Utils.cxx
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/Root/VarHandle.cxx
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/D3PDObjectBase.h
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/NTUP_TRIGCOST.h
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigCostD3PDObject.h
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigDBKeysD3PDObject.h
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.h
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.icc
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/Utils.h
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.h
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.icc
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.h
 delete mode 100644 Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.icc

diff --git a/Trigger/TrigCost/TrigCostD3PD/CMakeLists.txt b/Trigger/TrigCost/TrigCostD3PD/CMakeLists.txt
deleted file mode 100644
index e31dc074cb24..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/CMakeLists.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Package: TrigCostD3PD
-################################################################################
-
-# Declare the package name:
-atlas_subdir( TrigCostD3PD )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Cint Core Tree MathCore Hist RIO pthread )
-
-# Component(s) in the package:
-atlas_add_root_dictionary( TrigCostD3PD
-                           TrigCostD3PDDictSource
-                           ROOT_HEADERS TrigCostD3PD/*.h Root/LinkDef.h
-                           EXTERNAL_PACKAGES ROOT )
-
-atlas_add_library( TrigCostD3PD
-                   Root/*.cxx
-                   ${TrigCostD3PDDictSource}
-                   PUBLIC_HEADERS TrigCostD3PD
-                   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${ROOT_LIBRARIES} )
-
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/LinkDef.h b/Trigger/TrigCost/TrigCostD3PD/Root/LinkDef.h
deleted file mode 100644
index d2295f82fbfc..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/LinkDef.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Helpers.py 530000 2012-12-11 15:45:53Z krasznaa $
-#ifdef __CINT__
-
-#include "../TrigCostD3PD/D3PDObjectBase.h"
-//#include "../TrigCostD3PD/D3PDPerfStats.h"
-//#include "../TrigCostD3PD/D3PDReadStats.h"
-#include "../TrigCostD3PD/NTUP_TRIGCOST.h"
-#include "../TrigCostD3PD/TrigCostD3PDObject.h"
-#include "../TrigCostD3PD/TrigDBKeysD3PDObject.h"
-#include "../TrigCostD3PD/UserD3PDObject.h"
-#include "../TrigCostD3PD/Utils.h"
-
-#pragma link off all globals;
-#pragma link off all classes;
-#pragma link off all functions;
-
-#pragma link C++ nestedclass;
-
-#pragma link C++ class std::map<std::string,int>+;
-#pragma link C++ class std::map<std::string,float>+;
-
-#pragma link C++ class D3PDReader::VarHandleBase+;
-#pragma link C++ class D3PDReader::VarProxyBase+;
-//#pragma link C++ class D3PDReader::VariableStats+;
-//#pragma link C++ class D3PDReader::D3PDReadStats+;
-//#pragma link C++ class map<TString,D3PDReader::VariableStats>+;
-//#pragma link C++ class pair<TString,D3PDReader::VariableStats>+;
-#pragma link C++ class map<TString,D3PDReader::VarHandleBase*>+;
-#pragma link C++ class pair<TString,D3PDReader::VarHandleBase*>+;
-#pragma link C++ class D3PDReader::UserD3PDObjectElement+;
-#pragma link C++ class D3PDReader::UserD3PDObject+;
-#pragma link C++ class D3PDReader::VarHandle<unsigned int>+;
-#pragma link C++ class D3PDReader::D3PDObjectBase+;
-//#pragma link C++ class D3PDReader::D3PDPerfStats+;
-#pragma link C++ class D3PDReader::VarHandle<float>+;
-#pragma link C++ class D3PDReader::NTUP_TRIGCOST+;
-#pragma link C++ class D3PDReader::VarHandle<vector<unsigned short>*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<unsigned char>*>+;
-#pragma link C++ class D3PDReader::VarHandle<unsigned short>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<float>*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<vector<unsigned int> >*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<vector<unsigned char> >*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<unsigned int>*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<double>*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<vector<double> >*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<vector<unsigned short> >*>+;
-#pragma link C++ class D3PDReader::TrigCostD3PDObject+;
-#pragma link C++ class D3PDReader::TrigDBKeysD3PDObject+;
-#pragma link C++ class D3PDReader::VarHandle<vector<short>*>+;
-#pragma link C++ class D3PDReader::VarHandle<bool>+;
-// You can disable the remaining lines if you don't
-// plan to use the library in CINT or PyROOT.
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<bool>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<short>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<unsigned short>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<int>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<unsigned int>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<long long>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<unsigned long long>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<float>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<double>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<bool>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<short>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<unsigned short>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<int>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<unsigned int>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<long long>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<unsigned long long>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<float>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<double>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<short>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<unsigned short>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<int>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<unsigned int>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<long long>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<unsigned long long>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<float>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<double>;
-
-#endif // __CINT__
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/NTUP_TRIGCOST.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/NTUP_TRIGCOST.cxx
deleted file mode 100644
index 01315336d409..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/NTUP_TRIGCOST.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-
-#include "../TrigCostD3PD/NTUP_TRIGCOST.h"
-//#include "../TrigCostD3PD/D3PDPerfStats.h"
-
-ClassImp( D3PDReader::NTUP_TRIGCOST )
-
-namespace D3PDReader {
-
-   NTUP_TRIGCOST::NTUP_TRIGCOST()
-      : D3PDObjectBase(),
-        TrigCostHLT( m_entry, "TrigCostHLT_" ),
-        trig_DB( m_entry, "trig_DB_" ),
-        m_entry( 0 ),
-        m_fromInput( kTRUE ) {
-
-   }
-
-   NTUP_TRIGCOST::NTUP_TRIGCOST( Bool_t )
-      : D3PDObjectBase(),
-        TrigCostHLT( "TrigCostHLT_" ),
-        trig_DB( "trig_DB_" ),
-        m_entry( 0 ),
-        m_fromInput( kFALSE ) {
-
-   }
-
-   const char* NTUP_TRIGCOST::GetPrefix() const {
-
-      Warning( "GetPrefix", "A prefix is not defined for this object" );
-      return "";
-   }
-
-   void NTUP_TRIGCOST::SetPrefix( const char* ) {
-
-      Warning( "SetPrefix", "A prefix is not defined for this object" );
-      return;
-   }
-
-   void NTUP_TRIGCOST::ReadFrom( ::TTree* tree ) {
-
-      if( ! m_fromInput ) {
-         Error( "ReadFrom", "Object can't read a D3PD. Use a different constructor!" );
-         return;
-      }
-
-      TrigCostHLT.ReadFrom( tree );
-      trig_DB.ReadFrom( tree );
-
-      return;
-   }
-
-   void NTUP_TRIGCOST::WriteTo( ::TTree* tree ) {
-
-      TrigCostHLT.WriteTo( tree );
-      trig_DB.WriteTo( tree );
-
-      return;
-   }
-
-   void NTUP_TRIGCOST::SetActive( ::Bool_t active, const ::TString& pattern ) {
-
-      TrigCostHLT.SetActive( active, pattern );
-      trig_DB.SetActive( active, pattern );
-
-      return;
-   }
-
-   void NTUP_TRIGCOST::ReadAllActive() {
-
-      TrigCostHLT.ReadAllActive();
-      trig_DB.ReadAllActive();
-
-      return;
-   }
-
-   // D3PDReadStats NTUP_TRIGCOST::GetStatistics() const {
-
-   //    // The result object:
-   //    D3PDReadStats result( D3PDPerfStats::Instance()->GetStats() );
-
-   //    // Collect the statistics from all constituents:
-   //    result += TrigCostHLT.GetStatistics();
-   //    result += trig_DB.GetStatistics();
-
-   //    return result;
-   // }
-
-   void NTUP_TRIGCOST::GetEntry( ::Long64_t entry ) {
-
-      m_entry = entry;
-      return;
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/TrigCostD3PDObject.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/TrigCostD3PDObject.cxx
deleted file mode 100644
index 70c5b52afb55..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/TrigCostD3PDObject.cxx
+++ /dev/null
@@ -1,1450 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-
-#include <TPRegexp.h>
-#include <TList.h>
-#include <TDataMember.h>
-
-#include "../TrigCostD3PD/TrigCostD3PDObject.h"
-
-ClassImp( D3PDReader::TrigCostD3PDObject )
-
-namespace D3PDReader {
-
-   /**
-    * This constructor should be used when the object will be used to read
-    * variables from an existing ntuple. The object will also be able to
-    * output variables, but it will also need to read them from somewhere.
-    *
-    * @param master Reference to the variable holding the current event number
-    * @param prefix Prefix of the variables in the D3PD
-    */
-   TrigCostD3PDObject::TrigCostD3PDObject( const ::Long64_t& master, const char* prefix )
-      : UserD3PDObject( master, prefix ),
-        m_handles(),
-        m_fromInput( kTRUE ),
-        m_prefix( prefix ) {
-
-      SetVarHandles( &master );
-   }
-
-   /**
-    * This constructor can be used when the object will only have to output
-    * (and temporarily store) new information into an output ntuple. For
-    * instance when one wants to create a selected/modified list of information.
-    *
-    * @param prefix Prefix of the variables in the D3PD
-    */
-   TrigCostD3PDObject::TrigCostD3PDObject( const char* prefix )
-      : UserD3PDObject( prefix ),
-        m_handles(),
-        m_fromInput( kFALSE ),
-        m_prefix( prefix ) {
-
-      SetVarHandles( 0 );
-   }
-
-   /**
-    * @returns The branch name prefix used by the object
-    */
-   const char* TrigCostD3PDObject::GetPrefix() const {
-
-      return m_prefix;
-   }
-
-   /**
-    * @param prefix The prefix that should be used for the variables
-    */
-   void TrigCostD3PDObject::SetPrefix( const char* prefix ) {
-
-      // Call the base class's function:
-      UserD3PDObject::SetPrefix( prefix );
-
-      // Remember the prefix:
-      m_prefix = prefix;
-
-      // Set all the variable names:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->SetName( ::TString( prefix ) + itr->first );
-      }
-
-      return;
-   }
-
-   /**
-    * This function should be called every time a new TFile is opened
-    * by your analysis code.
-    *
-    * @param tree Pointer to the TTree with the variables
-    */
-   void TrigCostD3PDObject::ReadFrom( TTree* tree ) {
-
-      // Check if the object will be able to read from the TTree:
-      if( ! m_fromInput ) {
-         Error( "ReadFrom", "The object was not created with the correct" );
-         Error( "ReadFrom", "constructor to read data from a D3PD!" );
-         return;
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::ReadFrom( tree );
-
-      // Call ReadFrom(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->ReadFrom( tree );
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be called to connect the active variables of the object
-    * to an output TTree. It can be called multiple times, then the variables
-    * will be written to multiple TTrees.
-    *
-    * @param tree Pointer to the TTree where the variables should be written
-    */
-   void TrigCostD3PDObject::WriteTo( TTree* tree ) {
-
-      // Call the base class's function:
-      UserD3PDObject::WriteTo( tree );
-
-      // Call WriteTo(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->WriteTo( tree );
-      }
-
-      return;
-   }
-
-   /**
-    * This is a convenience function for turning the branches active or
-    * inactive conveniently. If the parameter is set to <code>kTRUE</code>
-    * then the branches available from the input which match the given
-    * pattern are turned active.
-    * When it's set to <code>kFALSE</code> then all the variables matching
-    * the pattern are turned inactive.
-    *
-    * @param active Flag behaving as explained above
-    * @param pattern Regular expression specifying which branches to modify
-    */
-   void TrigCostD3PDObject::SetActive( ::Bool_t active, const ::TString& pattern ) {
-
-      // Call the base class's function:
-      UserD3PDObject::SetActive( active, pattern );
-
-      ::TPRegexp re( pattern );
-
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! re.Match( m_prefix + itr->first ) ) continue;
-         if( active ) {
-            if( itr->second->IsAvailable() ) itr->second->SetActive( active );
-         } else {
-            itr->second->SetActive( active );
-         }
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to read in all the branches from the input
-    * TTree which are set active for writing out. This can simplify writing
-    * event selector codes immensely. Remember to set the desired variable
-    * active before calling this function.
-    */
-   void TrigCostD3PDObject::ReadAllActive() {
-
-      // Check if it makes sense to call this function:
-      if( ! m_fromInput ) {
-         static ::Bool_t wPrinted = kFALSE;
-         if( ! wPrinted ) {
-            Warning( "ReadAllActive", "Function only meaningful when used on objects" );
-            Warning( "ReadAllActive", "which are used to read information from a D3PD" );
-            wPrinted = kTRUE;
-         }
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::ReadAllActive();
-
-      // Read in the current entry for each active variable:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! itr->second->IsActive() ) continue;
-         itr->second->ReadCurrentEntry();
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to get information about the access
-    * pattern/statistics of the job. It should be called at the end of
-    * an analysis job to get the information about the performance of the
-    * analysis.
-    *
-    * @returns An object describing the D3PD access statistics
-    */
-   // D3PDReadStats TrigCostD3PDObject::GetStatistics() const {
-
-   //    // The result object:
-   //    D3PDReadStats result = UserD3PDObject::GetStatistics();
-
-   //    // Add the statistics from each variable to the result:
-   //    std::map< ::TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-   //    std::map< ::TString, VarHandleBase* >::const_iterator end = m_handles.end();
-   //    for( ; itr != end; ++itr ) {
-   //       result.AddVariable( itr->second->GetStatistics() );
-   //    }
-
-   //    return result;
-   // }
-
-   /**
-    * This function can be used to copy the contents of the entire object
-    * for a given event. This can be useful for instance when the user
-    * wants to copy all information to an output file, and modify it a bit,
-    * and only then write it out.
-    *
-    * @param parent The object to copy the information from
-    * @returns This same object, for convenience reasons
-    */
-   TrigCostD3PDObject& TrigCostD3PDObject::Set( const TrigCostD3PDObject& parent ) {
-
-      // Check if this function can be used on the object:
-      if( m_fromInput ) {
-         Error( "Set", "Objects used for reading a D3PD can't be modified!" );
-         return *this;
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::Set( parent );
-
-      if( parent.appId.IsAvailable() && appId.IsActive() ) {
-         appId() = parent.appId();
-      } else {
-         appId() = 0;
-      }
-      if( parent.ebWeight.IsAvailable() && ebWeight.IsActive() ) {
-         ebWeight() = parent.ebWeight();
-      } else {
-         ebWeight() = 0;
-      }
-      if( parent.ebWeightBG.IsAvailable() && ebWeightBG.IsActive() ) {
-         ebWeightBG() = parent.ebWeightBG();
-      } else {
-         ebWeightBG() = 0;
-      }
-      if( parent.ebUnbiased.IsAvailable() && ebUnbiased.IsActive() ) {
-         ebUnbiased() = parent.ebUnbiased();
-      } else {
-         ebUnbiased() = 0;
-      }
-      if( parent.ranScaleTools.IsAvailable() && ranScaleTools.IsActive() ) {
-         ranScaleTools() = parent.ranScaleTools();
-      } else {
-         ranScaleTools() = 0;
-      }
-      if( parent.bunchCrossingId.IsAvailable() && bunchCrossingId.IsActive() ) {
-         bunchCrossingId() = parent.bunchCrossingId();
-      } else {
-         bunchCrossingId() = 0;
-      }
-      if( parent.chain_counter.IsAvailable() && chain_counter.IsActive() ) {
-         *( chain_counter() ) = *( parent.chain_counter() );
-      } else {
-         chain_counter()->clear();
-      }
-      if( parent.chain_isExpressStream.IsAvailable() && chain_isExpressStream.IsActive() ) {
-         *( chain_isExpressStream() ) = *( parent.chain_isExpressStream() );
-      } else {
-         chain_isExpressStream()->clear();
-      }
-      if( parent.chain_isPassed.IsAvailable() && chain_isPassed.IsActive() ) {
-         *( chain_isPassed() ) = *( parent.chain_isPassed() );
-      } else {
-         chain_isPassed()->clear();
-      }
-      if( parent.chain_isPassedRaw.IsAvailable() && chain_isPassedRaw.IsActive() ) {
-         *( chain_isPassedRaw() ) = *( parent.chain_isPassedRaw() );
-      } else {
-         chain_isPassedRaw()->clear();
-      }
-      if( parent.chain_isPassthrough.IsAvailable() && chain_isPassthrough.IsActive() ) {
-         *( chain_isPassthrough() ) = *( parent.chain_isPassthrough() );
-      } else {
-         chain_isPassthrough()->clear();
-      }
-      if( parent.chain_isPrescaled.IsAvailable() && chain_isPrescaled.IsActive() ) {
-         *( chain_isPrescaled() ) = *( parent.chain_isPrescaled() );
-      } else {
-         chain_isPrescaled()->clear();
-      }
-      if( parent.chain_isResurrected.IsAvailable() && chain_isResurrected.IsActive() ) {
-         *( chain_isResurrected() ) = *( parent.chain_isResurrected() );
-      } else {
-         chain_isResurrected()->clear();
-      }
-      if( parent.chain_level.IsAvailable() && chain_level.IsActive() ) {
-         *( chain_level() ) = *( parent.chain_level() );
-      } else {
-         chain_level()->clear();
-      }
-      if( parent.chain_n.IsAvailable() && chain_n.IsActive() ) {
-         chain_n() = parent.chain_n();
-      } else {
-         chain_n() = 0;
-      }
-      if( parent.chain_timer.IsAvailable() && chain_timer.IsActive() ) {
-         *( chain_timer() ) = *( parent.chain_timer() );
-      } else {
-         chain_timer()->clear();
-      }
-      if( parent.chain_wasL1AfterPrescale.IsAvailable() && chain_wasL1AfterPrescale.IsActive() ) {
-         *( chain_wasL1AfterPrescale() ) = *( parent.chain_wasL1AfterPrescale() );
-      } else {
-         chain_wasL1AfterPrescale()->clear();
-      }
-      if( parent.chain_wasL1AfterVeto.IsAvailable() && chain_wasL1AfterVeto.IsActive() ) {
-         *( chain_wasL1AfterVeto() ) = *( parent.chain_wasL1AfterVeto() );
-      } else {
-         chain_wasL1AfterVeto()->clear();
-      }
-      if( parent.chain_wasL1BeforePrescale.IsAvailable() && chain_wasL1BeforePrescale.IsActive() ) {
-         *( chain_wasL1BeforePrescale() ) = *( parent.chain_wasL1BeforePrescale() );
-      } else {
-         chain_wasL1BeforePrescale()->clear();
-      }
-      if( parent.costEvent.IsAvailable() && costEvent.IsActive() ) {
-         costEvent() = parent.costEvent();
-      } else {
-         costEvent() = 0;
-      }
-      if( parent.costRunNsec.IsAvailable() && costRunNsec.IsActive() ) {
-         costRunNsec() = parent.costRunNsec();
-      } else {
-         costRunNsec() = 0;
-      }
-      if( parent.costRunSec.IsAvailable() && costRunSec.IsActive() ) {
-         costRunSec() = parent.costRunSec();
-      } else {
-         costRunSec() = 0;
-      }
-      if( parent.eventNumber.IsAvailable() && eventNumber.IsActive() ) {
-         eventNumber() = parent.eventNumber();
-      } else {
-         eventNumber() = 0;
-      }
-      if( parent.l1_ctpId.IsAvailable() && l1_ctpId.IsActive() ) {
-         *( l1_ctpId() ) = *( parent.l1_ctpId() );
-      } else {
-         l1_ctpId()->clear();
-      }
-      if( parent.l1_isPrescaled.IsAvailable() && l1_isPrescaled.IsActive() ) {
-         *( l1_isPrescaled() ) = *( parent.l1_isPrescaled() );
-      } else {
-         l1_isPrescaled()->clear();
-      }
-      if( parent.l1_isVetoed.IsAvailable() && l1_isVetoed.IsActive() ) {
-         *( l1_isVetoed() ) = *( parent.l1_isVetoed() );
-      } else {
-         l1_isVetoed()->clear();
-      }
-      if( parent.l1_n.IsAvailable() && l1_n.IsActive() ) {
-         l1_n() = parent.l1_n();
-      } else {
-         l1_n() = 0;
-      }
-      if( parent.l1_passed.IsAvailable() && l1_passed.IsActive() ) {
-         *( l1_passed() ) = *( parent.l1_passed() );
-      } else {
-         l1_passed()->clear();
-      }
-      if( parent.l1_passedAfterPrescale.IsAvailable() && l1_passedAfterPrescale.IsActive() ) {
-         *( l1_passedAfterPrescale() ) = *( parent.l1_passedAfterPrescale() );
-      } else {
-         l1_passedAfterPrescale()->clear();
-      }
-      if( parent.l1_passedAfterVeto.IsAvailable() && l1_passedAfterVeto.IsActive() ) {
-         *( l1_passedAfterVeto() ) = *( parent.l1_passedAfterVeto() );
-      } else {
-         l1_passedAfterVeto()->clear();
-      }
-      if( parent.l1_passedBeforePrescale.IsAvailable() && l1_passedBeforePrescale.IsActive() ) {
-         *( l1_passedBeforePrescale() ) = *( parent.l1_passedBeforePrescale() );
-      } else {
-         l1_passedBeforePrescale()->clear();
-      }
-      if( parent.lumi.IsAvailable() && lumi.IsActive() ) {
-         lumi() = parent.lumi();
-      } else {
-         lumi() = 0;
-      }
-      if( parent.lumiLength.IsAvailable() && lumiLength.IsActive() ) {
-         lumiLength() = parent.lumiLength();
-      } else {
-         lumiLength() = 0;
-      }
-      if( parent.nanoSeconds.IsAvailable() && nanoSeconds.IsActive() ) {
-         nanoSeconds() = parent.nanoSeconds();
-      } else {
-         nanoSeconds() = 0;
-      }
-      if( parent.rob_data_id.IsAvailable() && rob_data_id.IsActive() ) {
-         *( rob_data_id() ) = *( parent.rob_data_id() );
-      } else {
-         rob_data_id()->clear();
-      }
-      if( parent.rob_data_isCached.IsAvailable() && rob_data_isCached.IsActive() ) {
-         *( rob_data_isCached() ) = *( parent.rob_data_isCached() );
-      } else {
-         rob_data_isCached()->clear();
-      }
-      if( parent.rob_data_isDisabled.IsAvailable() && rob_data_isDisabled.IsActive() ) {
-         *( rob_data_isDisabled() ) = *( parent.rob_data_isDisabled() );
-      } else {
-         rob_data_isDisabled()->clear();
-      }
-      if( parent.rob_data_isIgnored.IsAvailable() && rob_data_isIgnored.IsActive() ) {
-         *( rob_data_isIgnored() ) = *( parent.rob_data_isIgnored() );
-      } else {
-         rob_data_isIgnored()->clear();
-      }
-      if( parent.rob_data_isRetrieved.IsAvailable() && rob_data_isRetrieved.IsActive() ) {
-         *( rob_data_isRetrieved() ) = *( parent.rob_data_isRetrieved() );
-      } else {
-         rob_data_isRetrieved()->clear();
-      }
-      if( parent.rob_data_isStatusOk.IsAvailable() && rob_data_isStatusOk.IsActive() ) {
-         *( rob_data_isStatusOk() ) = *( parent.rob_data_isStatusOk() );
-      } else {
-         rob_data_isStatusOk()->clear();
-      }
-      if( parent.rob_data_isStatusPrefetched.IsAvailable() && rob_data_isStatusPrefetched.IsActive() ) {
-         *( rob_data_isStatusPrefetched() ) = *( parent.rob_data_isStatusPrefetched() );
-      } else {
-         rob_data_isStatusPrefetched()->clear();
-      }
-      if( parent.rob_data_isUnclassified.IsAvailable() && rob_data_isUnclassified.IsActive() ) {
-         *( rob_data_isUnclassified() ) = *( parent.rob_data_isUnclassified() );
-      } else {
-         rob_data_isUnclassified()->clear();
-      }
-      if( parent.rob_data_n.IsAvailable() && rob_data_n.IsActive() ) {
-         *( rob_data_n() ) = *( parent.rob_data_n() );
-      } else {
-         rob_data_n()->clear();
-      }
-      if( parent.rob_data_size.IsAvailable() && rob_data_size.IsActive() ) {
-         *( rob_data_size() ) = *( parent.rob_data_size() );
-      } else {
-         rob_data_size()->clear();
-      }
-      if( parent.rob_n.IsAvailable() && rob_n.IsActive() ) {
-         rob_n() = parent.rob_n();
-      } else {
-         rob_n() = 0;
-      }
-      if( parent.rob_requestorId.IsAvailable() && rob_requestorId.IsActive() ) {
-         *( rob_requestorId() ) = *( parent.rob_requestorId() );
-      } else {
-         rob_requestorId()->clear();
-      }
-      if( parent.rob_sum_isCached.IsAvailable() && rob_sum_isCached.IsActive() ) {
-         *( rob_sum_isCached() ) = *( parent.rob_sum_isCached() );
-      } else {
-         rob_sum_isCached()->clear();
-      }
-      if( parent.rob_sum_isDisabled.IsAvailable() && rob_sum_isDisabled.IsActive() ) {
-         *( rob_sum_isDisabled() ) = *( parent.rob_sum_isDisabled() );
-      } else {
-         rob_sum_isDisabled()->clear();
-      }
-      if( parent.rob_sum_isIgnored.IsAvailable() && rob_sum_isIgnored.IsActive() ) {
-         *( rob_sum_isIgnored() ) = *( parent.rob_sum_isIgnored() );
-      } else {
-         rob_sum_isIgnored()->clear();
-      }
-      if( parent.rob_sum_isRetrieved.IsAvailable() && rob_sum_isRetrieved.IsActive() ) {
-         *( rob_sum_isRetrieved() ) = *( parent.rob_sum_isRetrieved() );
-      } else {
-         rob_sum_isRetrieved()->clear();
-      }
-      if( parent.rob_sum_isUnclassified.IsAvailable() && rob_sum_isUnclassified.IsActive() ) {
-         *( rob_sum_isUnclassified() ) = *( parent.rob_sum_isUnclassified() );
-      } else {
-         rob_sum_isUnclassified()->clear();
-      }
-      if( parent.rob_sum_n.IsAvailable() && rob_sum_n.IsActive() ) {
-         *( rob_sum_n() ) = *( parent.rob_sum_n() );
-      } else {
-         rob_sum_n()->clear();
-      }
-      if( parent.rob_sum_nRob.IsAvailable() && rob_sum_nRob.IsActive() ) {
-         *( rob_sum_nRob() ) = *( parent.rob_sum_nRob() );
-      } else {
-         rob_sum_nRob()->clear();
-      }
-      if( parent.rob_sum_size.IsAvailable() && rob_sum_size.IsActive() ) {
-         *( rob_sum_size() ) = *( parent.rob_sum_size() );
-      } else {
-         rob_sum_size()->clear();
-      }
-      if( parent.rob_sum_subDet.IsAvailable() && rob_sum_subDet.IsActive() ) {
-         *( rob_sum_subDet() ) = *( parent.rob_sum_subDet() );
-      } else {
-         rob_sum_subDet()->clear();
-      }
-      if( parent.rob_timeStartMicroSec.IsAvailable() && rob_timeStartMicroSec.IsActive() ) {
-         *( rob_timeStartMicroSec() ) = *( parent.rob_timeStartMicroSec() );
-      } else {
-         rob_timeStartMicroSec()->clear();
-      }
-      if( parent.rob_timeStartSec.IsAvailable() && rob_timeStartSec.IsActive() ) {
-         *( rob_timeStartSec() ) = *( parent.rob_timeStartSec() );
-      } else {
-         rob_timeStartSec()->clear();
-      }
-      if( parent.rob_timeStopMicroSec.IsAvailable() && rob_timeStopMicroSec.IsActive() ) {
-         *( rob_timeStopMicroSec() ) = *( parent.rob_timeStopMicroSec() );
-      } else {
-         rob_timeStopMicroSec()->clear();
-      }
-      if( parent.rob_timeStopSec.IsAvailable() && rob_timeStopSec.IsActive() ) {
-         *( rob_timeStopSec() ) = *( parent.rob_timeStopSec() );
-      } else {
-         rob_timeStopSec()->clear();
-      }
-      if( parent.rob_timer.IsAvailable() && rob_timer.IsActive() ) {
-         *( rob_timer() ) = *( parent.rob_timer() );
-      } else {
-         rob_timer()->clear();
-      }
-      if( parent.roi_area.IsAvailable() && roi_area.IsActive() ) {
-         *( roi_area() ) = *( parent.roi_area() );
-      } else {
-         roi_area()->clear();
-      }
-      if( parent.roi_eta.IsAvailable() && roi_eta.IsActive() ) {
-         *( roi_eta() ) = *( parent.roi_eta() );
-      } else {
-         roi_eta()->clear();
-      }
-      if( parent.roi_id.IsAvailable() && roi_id.IsActive() ) {
-         *( roi_id() ) = *( parent.roi_id() );
-      } else {
-         roi_id()->clear();
-      }
-      if( parent.roi_isTypeEmTau.IsAvailable() && roi_isTypeEmTau.IsActive() ) {
-         *( roi_isTypeEmTau() ) = *( parent.roi_isTypeEmTau() );
-      } else {
-         roi_isTypeEmTau()->clear();
-      }
-      if( parent.roi_isTypeEnergy.IsAvailable() && roi_isTypeEnergy.IsActive() ) {
-         *( roi_isTypeEnergy() ) = *( parent.roi_isTypeEnergy() );
-      } else {
-         roi_isTypeEnergy()->clear();
-      }
-      if( parent.roi_isTypeJet.IsAvailable() && roi_isTypeJet.IsActive() ) {
-         *( roi_isTypeJet() ) = *( parent.roi_isTypeJet() );
-      } else {
-         roi_isTypeJet()->clear();
-      }
-      if( parent.roi_isTypeJetEt.IsAvailable() && roi_isTypeJetEt.IsActive() ) {
-         *( roi_isTypeJetEt() ) = *( parent.roi_isTypeJetEt() );
-      } else {
-         roi_isTypeJetEt()->clear();
-      }
-      if( parent.roi_isTau.IsAvailable() && roi_isTau.IsActive() ) {
-         *( roi_isTau() ) = *( parent.roi_isTau() );
-      } else {
-         roi_isTau()->clear();
-      }
-      if( parent.roi_isTypeMuon.IsAvailable() && roi_isTypeMuon.IsActive() ) {
-         *( roi_isTypeMuon() ) = *( parent.roi_isTypeMuon() );
-      }
-       else {
-         roi_isTypeMuon()->clear();
-      }
-      if( parent.roi_isTypeNone.IsAvailable() && roi_isTypeNone.IsActive() ) {
-         *( roi_isTypeNone() ) = *( parent.roi_isTypeNone() );
-      } else {
-         roi_isTypeNone()->clear();
-      }
-      if( parent.roi_n.IsAvailable() && roi_n.IsActive() ) {
-         roi_n() = parent.roi_n();
-      } else {
-         roi_n() = 0;
-      }
-      if( parent.roi_nL1Thresholds.IsAvailable() && roi_nL1Thresholds.IsActive() ) {
-         *( roi_nL1Thresholds() ) = *( parent.roi_nL1Thresholds() );
-      } else {
-         roi_nL1Thresholds()->clear();
-      }
-      if( parent.roi_phi.IsAvailable() && roi_phi.IsActive() ) {
-         *( roi_phi() ) = *( parent.roi_phi() );
-      } else {
-         roi_phi()->clear();
-      }
-      if( parent.roi_et.IsAvailable() && roi_et.IsActive() ) {
-         *( roi_et() ) = *( parent.roi_et() );
-      } else {
-         roi_et()->clear();
-      }       
-      if( parent.roi_etLarge.IsAvailable() && roi_etLarge.IsActive() ) {
-         *( roi_etLarge() ) = *( parent.roi_etLarge() );
-      } else {
-         roi_etLarge()->clear();
-      }       
-      if( parent.roi_muCharge.IsAvailable() && roi_muCharge.IsActive() ) {
-         *( roi_muCharge() ) = *( parent.roi_muCharge() );
-      } else {
-         roi_muCharge()->clear();
-      }       
-      if( parent.roi_isoBits.IsAvailable() && roi_isoBits.IsActive() ) {
-         *( roi_isoBits() ) = *( parent.roi_isoBits() );
-      } else {
-         roi_isoBits()->clear();
-      }       
-      if( parent.roi_vectorEX.IsAvailable() && roi_vectorEX.IsActive() ) {
-         *( roi_vectorEX() ) = *( parent.roi_vectorEX() );
-      } else {
-         roi_vectorEX()->clear();
-      }       
-      if( parent.roi_vectorEY.IsAvailable() && roi_vectorEY.IsActive() ) {
-         *( roi_vectorEY() ) = *( parent.roi_vectorEY() );
-      } else {
-         roi_vectorEY()->clear();
-      }       
-      if( parent.roi_overflowEX.IsAvailable() && roi_overflowEX.IsActive() ) {
-         *( roi_overflowEX() ) = *( parent.roi_overflowEX() );
-      } else {
-         roi_overflowEX()->clear();
-      }       
-      if( parent.roi_overflowEY.IsAvailable() && roi_overflowEY.IsActive() ) {
-         *( roi_overflowEY() ) = *( parent.roi_overflowEY() );
-      } else {
-         roi_overflowEY()->clear();
-      }       
-      if( parent.roi_overflowET.IsAvailable() && roi_overflowET.IsActive() ) {
-         *( roi_overflowET() ) = *( parent.roi_overflowET() );
-      } else {
-         roi_overflowET()->clear();
-      }
-      if( parent.runNumber.IsAvailable() && runNumber.IsActive() ) {
-         runNumber() = parent.runNumber();
-      } else {
-         runNumber() = 0;
-      }
-      if( parent.seconds.IsAvailable() && seconds.IsActive() ) {
-         seconds() = parent.seconds();
-      } else {
-         seconds() = 0;
-      }
-      if( parent.seq_algTotalTime.IsAvailable() && seq_algTotalTime.IsActive() ) {
-         *( seq_algTotalTime() ) = *( parent.seq_algTotalTime() );
-      } else {
-         seq_algTotalTime()->clear();
-      }
-      if( parent.seq_alg_isCached.IsAvailable() && seq_alg_isCached.IsActive() ) {
-         *( seq_alg_isCached() ) = *( parent.seq_alg_isCached() );
-      } else {
-         seq_alg_isCached()->clear();
-      }
-      if( parent.seq_alg_isCalled.IsAvailable() && seq_alg_isCalled.IsActive() ) {
-         *( seq_alg_isCalled() ) = *( parent.seq_alg_isCalled() );
-      } else {
-         seq_alg_isCalled()->clear();
-      }
-      if( parent.seq_alg_n.IsAvailable() && seq_alg_n.IsActive() ) {
-         *( seq_alg_n() ) = *( parent.seq_alg_n() );
-      } else {
-         seq_alg_n()->clear();
-      }
-      if( parent.seq_alg_position.IsAvailable() && seq_alg_position.IsActive() ) {
-         *( seq_alg_position() ) = *( parent.seq_alg_position() );
-      } else {
-         seq_alg_position()->clear();
-      }
-      if( parent.seq_alg_roi_index.IsAvailable() && seq_alg_roi_index.IsActive() ) {
-         *( seq_alg_roi_index() ) = *( parent.seq_alg_roi_index() );
-      } else {
-         seq_alg_roi_index()->clear();
-      }
-      if( parent.seq_alg_roi_n.IsAvailable() && seq_alg_roi_n.IsActive() ) {
-         *( seq_alg_roi_n() ) = *( parent.seq_alg_roi_n() );
-      } else {
-         seq_alg_roi_n()->clear();
-      }
-      if( parent.seq_alg_timeStartMicroSec.IsAvailable() && seq_alg_timeStartMicroSec.IsActive() ) {
-         *( seq_alg_timeStartMicroSec() ) = *( parent.seq_alg_timeStartMicroSec() );
-      } else {
-         seq_alg_timeStartMicroSec()->clear();
-      }
-      if( parent.seq_alg_timeStartSec.IsAvailable() && seq_alg_timeStartSec.IsActive() ) {
-         *( seq_alg_timeStartSec() ) = *( parent.seq_alg_timeStartSec() );
-      } else {
-         seq_alg_timeStartSec()->clear();
-      }
-      if( parent.seq_alg_timeStopMicroSec.IsAvailable() && seq_alg_timeStopMicroSec.IsActive() ) {
-         *( seq_alg_timeStopMicroSec() ) = *( parent.seq_alg_timeStopMicroSec() );
-      } else {
-         seq_alg_timeStopMicroSec()->clear();
-      }
-      if( parent.seq_alg_timeStopSec.IsAvailable() && seq_alg_timeStopSec.IsActive() ) {
-         *( seq_alg_timeStopSec() ) = *( parent.seq_alg_timeStopSec() );
-      } else {
-         seq_alg_timeStopSec()->clear();
-      }
-      if( parent.seq_alg_timer.IsAvailable() && seq_alg_timer.IsActive() ) {
-         *( seq_alg_timer() ) = *( parent.seq_alg_timer() );
-      } else {
-         seq_alg_timer()->clear();
-      }
-      if( parent.seq_channelCounter.IsAvailable() && seq_channelCounter.IsActive() ) {
-         *( seq_channelCounter() ) = *( parent.seq_channelCounter() );
-      } else {
-         seq_channelCounter()->clear();
-      }
-      if( parent.seq_index.IsAvailable() && seq_index.IsActive() ) {
-         *( seq_index() ) = *( parent.seq_index() );
-      } else {
-         seq_index()->clear();
-      }
-      if( parent.seq_isAlreadyExecuted.IsAvailable() && seq_isAlreadyExecuted.IsActive() ) {
-         *( seq_isAlreadyExecuted() ) = *( parent.seq_isAlreadyExecuted() );
-      } else {
-         seq_isAlreadyExecuted()->clear();
-      }
-      if( parent.seq_isExecuted.IsAvailable() && seq_isExecuted.IsActive() ) {
-         *( seq_isExecuted() ) = *( parent.seq_isExecuted() );
-      } else {
-         seq_isExecuted()->clear();
-      }
-      if( parent.seq_isInitial.IsAvailable() && seq_isInitial.IsActive() ) {
-         *( seq_isInitial() ) = *( parent.seq_isInitial() );
-      } else {
-         seq_isInitial()->clear();
-      }
-      if( parent.seq_isPrevious.IsAvailable() && seq_isPrevious.IsActive() ) {
-         *( seq_isPrevious() ) = *( parent.seq_isPrevious() );
-      } else {
-         seq_isPrevious()->clear();
-      }
-      if( parent.seq_level.IsAvailable() && seq_level.IsActive() ) {
-         *( seq_level() ) = *( parent.seq_level() );
-      } else {
-         seq_level()->clear();
-      }
-      if( parent.seq_n.IsAvailable() && seq_n.IsActive() ) {
-         seq_n() = parent.seq_n();
-      } else {
-         seq_n() = 0;
-      }
-      if( parent.seq_roi.IsAvailable() && seq_roi.IsActive() ) {
-         *( seq_roi() ) = *( parent.seq_roi() );
-      } else {
-         seq_roi()->clear();
-      }
-      if( parent.seq_timer.IsAvailable() && seq_timer.IsActive() ) {
-         *( seq_timer() ) = *( parent.seq_timer() );
-      } else {
-         seq_timer()->clear();
-      }
-      if( parent.te_childIndex.IsAvailable() && te_childIndex.IsActive() ) {
-         *( te_childIndex() ) = *( parent.te_childIndex() );
-      } else {
-         te_childIndex()->clear();
-      }
-      if( parent.te_clid.IsAvailable() && te_clid.IsActive() ) {
-         *( te_clid() ) = *( parent.te_clid() );
-      } else {
-         te_clid()->clear();
-      }
-      if( parent.te_id.IsAvailable() && te_id.IsActive() ) {
-         *( te_id() ) = *( parent.te_id() );
-      } else {
-         te_id()->clear();
-      }
-      if( parent.te_index.IsAvailable() && te_index.IsActive() ) {
-         *( te_index() ) = *( parent.te_index() );
-      } else {
-         te_index()->clear();
-      }
-      if( parent.te_isActiveState.IsAvailable() && te_isActiveState.IsActive() ) {
-         *( te_isActiveState() ) = *( parent.te_isActiveState() );
-      } else {
-         te_isActiveState()->clear();
-      }
-      if( parent.te_isErrorState.IsAvailable() && te_isErrorState.IsActive() ) {
-         *( te_isErrorState() ) = *( parent.te_isErrorState() );
-      } else {
-         te_isErrorState()->clear();
-      }
-      if( parent.te_isInitialTe.IsAvailable() && te_isInitialTe.IsActive() ) {
-         *( te_isInitialTe() ) = *( parent.te_isInitialTe() );
-      } else {
-         te_isInitialTe()->clear();
-      }
-      if( parent.te_isL1ThresholdTe.IsAvailable() && te_isL1ThresholdTe.IsActive() ) {
-         *( te_isL1ThresholdTe() ) = *( parent.te_isL1ThresholdTe() );
-      } else {
-         te_isL1ThresholdTe()->clear();
-      }
-      if( parent.te_isOutputEFNode.IsAvailable() && te_isOutputEFNode.IsActive() ) {
-         *( te_isOutputEFNode() ) = *( parent.te_isOutputEFNode() );
-      } else {
-         te_isOutputEFNode()->clear();
-      }
-      if( parent.te_isOutputL2Node.IsAvailable() && te_isOutputL2Node.IsActive() ) {
-         *( te_isOutputL2Node() ) = *( parent.te_isOutputL2Node() );
-      } else {
-         te_isOutputL2Node()->clear();
-      }
-      if( parent.te_isRegularTe.IsAvailable() && te_isRegularTe.IsActive() ) {
-         *( te_isRegularTe() ) = *( parent.te_isRegularTe() );
-      } else {
-         te_isRegularTe()->clear();
-      }
-      if( parent.te_isRoITe.IsAvailable() && te_isRoITe.IsActive() ) {
-         *( te_isRoITe() ) = *( parent.te_isRoITe() );
-      } else {
-         te_isRoITe()->clear();
-      }
-      if( parent.te_isTerminalNode.IsAvailable() && te_isTerminalNode.IsActive() ) {
-         *( te_isTerminalNode() ) = *( parent.te_isTerminalNode() );
-      } else {
-         te_isTerminalNode()->clear();
-      }
-      if( parent.te_isTopologicalTe.IsAvailable() && te_isTopologicalTe.IsActive() ) {
-         *( te_isTopologicalTe() ) = *( parent.te_isTopologicalTe() );
-      } else {
-         te_isTopologicalTe()->clear();
-      }
-      if( parent.te_n.IsAvailable() && te_n.IsActive() ) {
-         te_n() = parent.te_n();
-      } else {
-         te_n() = 0;
-      }
-      if( parent.te_parentIndex.IsAvailable() && te_parentIndex.IsActive() ) {
-         *( te_parentIndex() ) = *( parent.te_parentIndex() );
-      } else {
-         te_parentIndex()->clear();
-      }
-      if( parent.te_roiId.IsAvailable() && te_roiId.IsActive() ) {
-         *( te_roiId() ) = *( parent.te_roiId() );
-      } else {
-         te_roiId()->clear();
-      }
-      if( parent.timer.IsAvailable() && timer.IsActive() ) {
-         timer() = parent.timer();
-      } else {
-         timer() = 0;
-      }
-      if( parent.timerChainProcess.IsAvailable() && timerChainProcess.IsActive() ) {
-         timerChainProcess() = parent.timerChainProcess();
-      } else {
-         timerChainProcess() = 0;
-      }
-      if( parent.timerEndSteer.IsAvailable() && timerEndSteer.IsActive() ) {
-         timerEndSteer() = parent.timerEndSteer();
-      } else {
-         timerEndSteer() = 0;
-      }
-      if( parent.timerMon.IsAvailable() && timerMon.IsActive() ) {
-         timerMon() = parent.timerMon();
-      } else {
-         timerMon() = 0;
-      }
-      if( parent.timerResultBuilder.IsAvailable() && timerResultBuilder.IsActive() ) {
-         timerResultBuilder() = parent.timerResultBuilder();
-      } else {
-         timerResultBuilder() = 0;
-      }
-      if( parent.timerTrigCost.IsAvailable() && timerTrigCost.IsActive() ) {
-         timerTrigCost() = parent.timerTrigCost();
-      } else {
-         timerTrigCost() = 0;
-      }
-
-      return *this;
-   }
-
-   /**
-    * This function is used internally to access VarHandle members
-    * by name. This is necessary to push some setup from compile time
-    * to run time. It may sound weird, but it makes a lot of sense for large
-    * classes.
-    *
-    * @param name The name of the C++ variable (not of the branch)
-    * @returns A pointer to the VarHandle object
-    */
-   VarHandleBase* TrigCostD3PDObject::GetVarHandle( const char* name ) {
-
-      if( ! ::strcmp( name, "appId" ) ) {
-         return &appId;
-      }
-      else if( ! ::strcmp( name, "ebWeight" ) ) {
-         return &ebWeight;
-      }
-      else if( ! ::strcmp( name, "ebWeightBG" ) ) {
-         return &ebWeightBG;
-      }
-      else if( ! ::strcmp( name, "ebUnbiased" ) ) {
-         return &ebUnbiased;
-      }
-      else if( ! ::strcmp( name, "ranScaleTools" ) ) {
-         return &ranScaleTools;
-      }
-      else if( ! ::strcmp( name, "bunchCrossingId" ) ) {
-         return &bunchCrossingId;
-      }
-      else if( ! ::strcmp( name, "chain_counter" ) ) {
-         return &chain_counter;
-      }
-      else if( ! ::strcmp( name, "chain_isExpressStream" ) ) {
-         return &chain_isExpressStream;
-      }
-      else if( ! ::strcmp( name, "chain_isPassed" ) ) {
-         return &chain_isPassed;
-      }
-      else if( ! ::strcmp( name, "chain_isPassedRaw" ) ) {
-         return &chain_isPassedRaw;
-      }
-      else if( ! ::strcmp( name, "chain_isPassthrough" ) ) {
-         return &chain_isPassthrough;
-      }
-      else if( ! ::strcmp( name, "chain_isPrescaled" ) ) {
-         return &chain_isPrescaled;
-      }
-      else if( ! ::strcmp( name, "chain_isResurrected" ) ) {
-         return &chain_isResurrected;
-      }
-      else if( ! ::strcmp( name, "chain_level" ) ) {
-         return &chain_level;
-      }
-      else if( ! ::strcmp( name, "chain_n" ) ) {
-         return &chain_n;
-      }
-      else if( ! ::strcmp( name, "chain_timer" ) ) {
-         return &chain_timer;
-      }
-      else if( ! ::strcmp( name, "chain_wasL1AfterPrescale" ) ) {
-         return &chain_wasL1AfterPrescale;
-      }
-      else if( ! ::strcmp( name, "chain_wasL1AfterVeto" ) ) {
-         return &chain_wasL1AfterVeto;
-      }
-      else if( ! ::strcmp( name, "chain_wasL1BeforePrescale" ) ) {
-         return &chain_wasL1BeforePrescale;
-      }
-      else if( ! ::strcmp( name, "costEvent" ) ) {
-         return &costEvent;
-      }
-      else if( ! ::strcmp( name, "costRunNsec" ) ) {
-         return &costRunNsec;
-      }
-      else if( ! ::strcmp( name, "costRunSec" ) ) {
-         return &costRunSec;
-      }
-      else if( ! ::strcmp( name, "eventNumber" ) ) {
-         return &eventNumber;
-      }
-      else if( ! ::strcmp( name, "l1_ctpId" ) ) {
-         return &l1_ctpId;
-      }
-      else if( ! ::strcmp( name, "l1_isPrescaled" ) ) {
-         return &l1_isPrescaled;
-      }
-      else if( ! ::strcmp( name, "l1_isVetoed" ) ) {
-         return &l1_isVetoed;
-      }
-      else if( ! ::strcmp( name, "l1_n" ) ) {
-         return &l1_n;
-      }
-      else if( ! ::strcmp( name, "l1_passed" ) ) {
-         return &l1_passed;
-      }
-      else if( ! ::strcmp( name, "l1_passedAfterPrescale" ) ) {
-         return &l1_passedAfterPrescale;
-      }
-      else if( ! ::strcmp( name, "l1_passedAfterVeto" ) ) {
-         return &l1_passedAfterVeto;
-      }
-      else if( ! ::strcmp( name, "l1_passedBeforePrescale" ) ) {
-         return &l1_passedBeforePrescale;
-      }
-      else if( ! ::strcmp( name, "lumi" ) ) {
-         return &lumi;
-      }
-      else if( ! ::strcmp( name, "lumiLength" ) ) {
-         return &lumiLength;
-      }
-      else if( ! ::strcmp( name, "nanoSeconds" ) ) {
-         return &nanoSeconds;
-      }
-      else if( ! ::strcmp( name, "rob_data_id" ) ) {
-         return &rob_data_id;
-      }
-      else if( ! ::strcmp( name, "rob_data_isCached" ) ) {
-         return &rob_data_isCached;
-      }
-      else if( ! ::strcmp( name, "rob_data_isDisabled" ) ) {
-         return &rob_data_isDisabled;
-      }
-      else if( ! ::strcmp( name, "rob_data_isIgnored" ) ) {
-         return &rob_data_isIgnored;
-      }
-      else if( ! ::strcmp( name, "rob_data_isRetrieved" ) ) {
-         return &rob_data_isRetrieved;
-      }
-      else if( ! ::strcmp( name, "rob_data_isStatusOk" ) ) {
-         return &rob_data_isStatusOk;
-      }
-      else if( ! ::strcmp( name, "rob_data_isStatusPrefetched" ) ) {
-         return &rob_data_isStatusPrefetched;
-      }
-      else if( ! ::strcmp( name, "rob_data_isUnclassified" ) ) {
-         return &rob_data_isUnclassified;
-      }
-      else if( ! ::strcmp( name, "rob_data_n" ) ) {
-         return &rob_data_n;
-      }
-      else if( ! ::strcmp( name, "rob_data_size" ) ) {
-         return &rob_data_size;
-      }
-      else if( ! ::strcmp( name, "rob_n" ) ) {
-         return &rob_n;
-      }
-      else if( ! ::strcmp( name, "rob_requestorId" ) ) {
-         return &rob_requestorId;
-      }
-      else if( ! ::strcmp( name, "rob_sum_isCached" ) ) {
-         return &rob_sum_isCached;
-      }
-      else if( ! ::strcmp( name, "rob_sum_isDisabled" ) ) {
-         return &rob_sum_isDisabled;
-      }
-      else if( ! ::strcmp( name, "rob_sum_isIgnored" ) ) {
-         return &rob_sum_isIgnored;
-      }
-      else if( ! ::strcmp( name, "rob_sum_isRetrieved" ) ) {
-         return &rob_sum_isRetrieved;
-      }
-      else if( ! ::strcmp( name, "rob_sum_isUnclassified" ) ) {
-         return &rob_sum_isUnclassified;
-      }
-      else if( ! ::strcmp( name, "rob_sum_n" ) ) {
-         return &rob_sum_n;
-      }
-      else if( ! ::strcmp( name, "rob_sum_nRob" ) ) {
-         return &rob_sum_nRob;
-      }
-      else if( ! ::strcmp( name, "rob_sum_size" ) ) {
-         return &rob_sum_size;
-      }
-      else if( ! ::strcmp( name, "rob_sum_subDet" ) ) {
-         return &rob_sum_subDet;
-      }
-      else if( ! ::strcmp( name, "rob_timeStartMicroSec" ) ) {
-         return &rob_timeStartMicroSec;
-      }
-      else if( ! ::strcmp( name, "rob_timeStartSec" ) ) {
-         return &rob_timeStartSec;
-      }
-      else if( ! ::strcmp( name, "rob_timeStopMicroSec" ) ) {
-         return &rob_timeStopMicroSec;
-      }
-      else if( ! ::strcmp( name, "rob_timeStopSec" ) ) {
-         return &rob_timeStopSec;
-      }
-      else if( ! ::strcmp( name, "rob_timer" ) ) {
-         return &rob_timer;
-      }
-      else if( ! ::strcmp( name, "roi_area" ) ) {
-         return &roi_area;
-      }
-      else if( ! ::strcmp( name, "roi_eta" ) ) {
-         return &roi_eta;
-      }
-      else if( ! ::strcmp( name, "roi_id" ) ) {
-         return &roi_id;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeEmTau" ) ) {
-         return &roi_isTypeEmTau;
-      }
-      else if( ! ::strcmp( name, "roi_isTau" ) ) {
-         return &roi_isTau;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeEnergy" ) ) {
-         return &roi_isTypeEnergy;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeJet" ) ) {
-         return &roi_isTypeJet;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeJetEt" ) ) {
-         return &roi_isTypeJetEt;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeMuon" ) ) {
-         return &roi_isTypeMuon;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeNone" ) ) {
-         return &roi_isTypeNone;
-      }
-      else if( ! ::strcmp( name, "roi_n" ) ) {
-         return &roi_n;
-      }
-      else if( ! ::strcmp( name, "roi_nL1Thresholds" ) ) {
-         return &roi_nL1Thresholds;
-      }
-       else if( ! ::strcmp( name, "roi_phi" ) ) {
-         return &roi_phi;
-      }
-      else if( ! ::strcmp( name, "roi_et" ) ) {
-         return &roi_et;
-      }
-      else if( ! ::strcmp( name, "roi_etLarge" ) ) {
-         return &roi_etLarge;
-      }
-      else if( ! ::strcmp( name, "roi_muCharge" ) ) {
-         return &roi_muCharge;
-      }
-      else if( ! ::strcmp( name, "roi_isoBits" ) ) {
-         return &roi_isoBits;
-      }
-      else if( ! ::strcmp( name, "roi_vectorEX" ) ) {
-         return &roi_vectorEX;
-      }
-      else if( ! ::strcmp( name, "roi_vectorEY" ) ) {
-         return &roi_vectorEY;
-      }
-      else if( ! ::strcmp( name, "roi_overflowEX" ) ) {
-         return &roi_overflowEX;
-      }
-      else if( ! ::strcmp( name, "roi_overflowEY" ) ) {
-         return &roi_overflowEY;
-      }
-      else if( ! ::strcmp( name, "roi_overflowET" ) ) {
-         return &roi_overflowET;
-      }
-      else if( ! ::strcmp( name, "runNumber" ) ) {
-         return &runNumber;
-      }
-      else if( ! ::strcmp( name, "seconds" ) ) {
-         return &seconds;
-      }
-      else if( ! ::strcmp( name, "seq_algTotalTime" ) ) {
-         return &seq_algTotalTime;
-      }
-      else if( ! ::strcmp( name, "seq_alg_isCached" ) ) {
-         return &seq_alg_isCached;
-      }
-      else if( ! ::strcmp( name, "seq_alg_isCalled" ) ) {
-         return &seq_alg_isCalled;
-      }
-      else if( ! ::strcmp( name, "seq_alg_n" ) ) {
-         return &seq_alg_n;
-      }
-      else if( ! ::strcmp( name, "seq_alg_position" ) ) {
-         return &seq_alg_position;
-      }
-      else if( ! ::strcmp( name, "seq_alg_roi_index" ) ) {
-         return &seq_alg_roi_index;
-      }
-      else if( ! ::strcmp( name, "seq_alg_roi_n" ) ) {
-         return &seq_alg_roi_n;
-      }
-      else if( ! ::strcmp( name, "seq_alg_timeStartMicroSec" ) ) {
-         return &seq_alg_timeStartMicroSec;
-      }
-      else if( ! ::strcmp( name, "seq_alg_timeStartSec" ) ) {
-         return &seq_alg_timeStartSec;
-      }
-      else if( ! ::strcmp( name, "seq_alg_timeStopMicroSec" ) ) {
-         return &seq_alg_timeStopMicroSec;
-      }
-      else if( ! ::strcmp( name, "seq_alg_timeStopSec" ) ) {
-         return &seq_alg_timeStopSec;
-      }
-      else if( ! ::strcmp( name, "seq_alg_timer" ) ) {
-         return &seq_alg_timer;
-      }
-      else if( ! ::strcmp( name, "seq_channelCounter" ) ) {
-         return &seq_channelCounter;
-      }
-      else if( ! ::strcmp( name, "seq_index" ) ) {
-         return &seq_index;
-      }
-      else if( ! ::strcmp( name, "seq_isAlreadyExecuted" ) ) {
-         return &seq_isAlreadyExecuted;
-      }
-      else if( ! ::strcmp( name, "seq_isExecuted" ) ) {
-         return &seq_isExecuted;
-      }
-      else if( ! ::strcmp( name, "seq_isInitial" ) ) {
-         return &seq_isInitial;
-      }
-      else if( ! ::strcmp( name, "seq_isPrevious" ) ) {
-         return &seq_isPrevious;
-      }
-      else if( ! ::strcmp( name, "seq_level" ) ) {
-         return &seq_level;
-      }
-      else if( ! ::strcmp( name, "seq_n" ) ) {
-         return &seq_n;
-      }
-      else if( ! ::strcmp( name, "seq_roi" ) ) {
-         return &seq_roi;
-      }
-      else if( ! ::strcmp( name, "seq_timer" ) ) {
-         return &seq_timer;
-      }
-      else if( ! ::strcmp( name, "te_childIndex" ) ) {
-         return &te_childIndex;
-      }
-      else if( ! ::strcmp( name, "te_clid" ) ) {
-         return &te_clid;
-      }
-      else if( ! ::strcmp( name, "te_id" ) ) {
-         return &te_id;
-      }
-      else if( ! ::strcmp( name, "te_index" ) ) {
-         return &te_index;
-      }
-      else if( ! ::strcmp( name, "te_isActiveState" ) ) {
-         return &te_isActiveState;
-      }
-      else if( ! ::strcmp( name, "te_isErrorState" ) ) {
-         return &te_isErrorState;
-      }
-      else if( ! ::strcmp( name, "te_isInitialTe" ) ) {
-         return &te_isInitialTe;
-      }
-      else if( ! ::strcmp( name, "te_isL1ThresholdTe" ) ) {
-         return &te_isL1ThresholdTe;
-      }
-      else if( ! ::strcmp( name, "te_isOutputEFNode" ) ) {
-         return &te_isOutputEFNode;
-      }
-      else if( ! ::strcmp( name, "te_isOutputL2Node" ) ) {
-         return &te_isOutputL2Node;
-      }
-      else if( ! ::strcmp( name, "te_isRegularTe" ) ) {
-         return &te_isRegularTe;
-      }
-      else if( ! ::strcmp( name, "te_isRoITe" ) ) {
-         return &te_isRoITe;
-      }
-      else if( ! ::strcmp( name, "te_isTerminalNode" ) ) {
-         return &te_isTerminalNode;
-      }
-      else if( ! ::strcmp( name, "te_isTopologicalTe" ) ) {
-         return &te_isTopologicalTe;
-      }
-      else if( ! ::strcmp( name, "te_n" ) ) {
-         return &te_n;
-      }
-      else if( ! ::strcmp( name, "te_parentIndex" ) ) {
-         return &te_parentIndex;
-      }
-      else if( ! ::strcmp( name, "te_roiId" ) ) {
-         return &te_roiId;
-      }
-      else if( ! ::strcmp( name, "timer" ) ) {
-         return &timer;
-      }
-      else if( ! ::strcmp( name, "timerChainProcess" ) ) {
-         return &timerChainProcess;
-      }
-      else if( ! ::strcmp( name, "timerEndSteer" ) ) {
-         return &timerEndSteer;
-      }
-      else if( ! ::strcmp( name, "timerMon" ) ) {
-         return &timerMon;
-      }
-      else if( ! ::strcmp( name, "timerResultBuilder" ) ) {
-         return &timerResultBuilder;
-      }
-      else if( ! ::strcmp( name, "timerTrigCost" ) ) {
-         return &timerTrigCost;
-      }
-
-      Error( "GetVarHandle", "Variable \"%s\" unknown", name );
-      return 0;
-   }
-
-   /**
-    * This function is used internally to set up all the VarHandle members
-    * of the class. It speeds up compilation *a lot* to do this at run-time
-    * like this, instead of putting a lot of lines of code operating on
-    * the std::map member.
-    *
-    * @param master Pointer to the master index, or a null pointer
-    */
-   void TrigCostD3PDObject::SetVarHandles( const ::Long64_t* master ) {
-
-      // Create a list of variable-branch name pairs:
-      static const Int_t NVARNAMES = 129;
-      static const char* VARNAMES[ NVARNAMES ][ 2 ] = {
-         { "appId", "appId" },
-         { "ebWeight", "ebWeight" },
-         { "ebWeightBG", "ebWeightBG" },
-         { "ebUnbiased", "ebUnbiased" },         
-         { "ranScaleTools", "ranScaleTools" },         
-         { "bunchCrossingId", "bunchCrossingId" },
-         { "chain_counter", "chain_counter" },
-         { "chain_isExpressStream", "chain_isExpressStream" },
-         { "chain_isPassed", "chain_isPassed" },
-         { "chain_isPassedRaw", "chain_isPassedRaw" },
-         { "chain_isPassthrough", "chain_isPassthrough" },
-         { "chain_isPrescaled", "chain_isPrescaled" },
-         { "chain_isResurrected", "chain_isResurrected" },
-         { "chain_level", "chain_level" },
-         { "chain_n", "chain_n" },
-         { "chain_timer", "chain_timer" },
-         { "chain_wasL1AfterPrescale", "chain_wasL1AfterPrescale" },
-         { "chain_wasL1AfterVeto", "chain_wasL1AfterVeto" },
-         { "chain_wasL1BeforePrescale", "chain_wasL1BeforePrescale" },
-         { "costEvent", "costEvent" },
-         { "costRunNsec", "costRunNsec" },
-         { "costRunSec", "costRunSec" },
-         { "eventNumber", "eventNumber" },
-         { "l1_ctpId", "l1_ctpId" },
-         { "l1_isPrescaled", "l1_isPrescaled" },
-         { "l1_isVetoed", "l1_isVetoed" },
-         { "l1_n", "l1_n" },
-         { "l1_passed", "l1_passed" },
-         { "l1_passedAfterPrescale", "l1_passedAfterPrescale" },
-         { "l1_passedAfterVeto", "l1_passedAfterVeto" },
-         { "l1_passedBeforePrescale", "l1_passedBeforePrescale" },
-         { "lumi", "lumi" },
-         { "lumiLength", "lumiLength" },
-         { "nanoSeconds", "nanoSeconds" },
-         { "rob_data_id", "rob_data_id" },
-         { "rob_data_isCached", "rob_data_isCached" },
-         { "rob_data_isDisabled", "rob_data_isDisabled" },
-         { "rob_data_isIgnored", "rob_data_isIgnored" },
-         { "rob_data_isRetrieved", "rob_data_isRetrieved" },
-         { "rob_data_isStatusOk", "rob_data_isStatusOk" },
-         { "rob_data_isStatusPrefetched", "rob_data_isStatusPrefetched" },
-         { "rob_data_isUnclassified", "rob_data_isUnclassified" },
-         { "rob_data_n", "rob_data_n" },
-         { "rob_data_size", "rob_data_size" },
-         { "rob_n", "rob_n" },
-         { "rob_requestorId", "rob_requestorId" },
-         { "rob_sum_isCached", "rob_sum_isCached" },
-         { "rob_sum_isDisabled", "rob_sum_isDisabled" },
-         { "rob_sum_isIgnored", "rob_sum_isIgnored" },
-         { "rob_sum_isRetrieved", "rob_sum_isRetrieved" },
-         { "rob_sum_isUnclassified", "rob_sum_isUnclassified" },
-         { "rob_sum_n", "rob_sum_n" },
-         { "rob_sum_nRob", "rob_sum_nRob" },
-         { "rob_sum_size", "rob_sum_size" },
-         { "rob_sum_subDet", "rob_sum_subDet" },
-         { "rob_timeStartMicroSec", "rob_timeStartMicroSec" },
-         { "rob_timeStartSec", "rob_timeStartSec" },
-         { "rob_timeStopMicroSec", "rob_timeStopMicroSec" },
-         { "rob_timeStopSec", "rob_timeStopSec" },
-         { "rob_timer", "rob_timer" },
-         { "roi_area", "roi_area" },
-         { "roi_eta", "roi_eta" },
-         { "roi_id", "roi_id" },
-         { "roi_isTypeEmTau", "roi_isTypeEmTau" },
-         { "roi_isTau", "roi_isTau" },         
-         { "roi_isTypeEnergy", "roi_isTypeEnergy" },
-         { "roi_isTypeJet", "roi_isTypeJet" },
-         { "roi_isTypeJetEt", "roi_isTypeJetEt" },
-         { "roi_isTypeMuon", "roi_isTypeMuon" },
-         { "roi_isTypeNone", "roi_isTypeNone" },
-         { "roi_n", "roi_n" },
-         { "roi_nL1Thresholds", "roi_nL1Thresholds" },
-         { "roi_phi", "roi_phi" },
-         { "roi_et", "roi_et" },
-         { "roi_etLarge", "roi_etLarge" },
-         { "roi_muCharge", "roi_muCharge" },
-         { "roi_isoBits", "roi_isoBits" },
-         { "roi_vectorEX", "roi_vectorEX" },
-         { "roi_vectorEY", "roi_vectorEY" },
-         { "roi_overflowEX", "roi_overflowEX" },
-         { "roi_overflowEY", "roi_overflowEY" },
-         { "roi_overflowET", "roi_overflowET" },
-         { "runNumber", "runNumber" },
-         { "seconds", "seconds" },
-         { "seq_algTotalTime", "seq_algTotalTime" },
-         { "seq_alg_isCached", "seq_alg_isCached" },
-         { "seq_alg_isCalled", "seq_alg_isCalled" },
-         { "seq_alg_n", "seq_alg_n" },
-         { "seq_alg_position", "seq_alg_position" },
-         { "seq_alg_roi_index", "seq_alg_roi_index" },
-         { "seq_alg_roi_n", "seq_alg_roi_n" },
-         { "seq_alg_timeStartMicroSec", "seq_alg_timeStartMicroSec" },
-         { "seq_alg_timeStartSec", "seq_alg_timeStartSec" },
-         { "seq_alg_timeStopMicroSec", "seq_alg_timeStopMicroSec" },
-         { "seq_alg_timeStopSec", "seq_alg_timeStopSec" },
-         { "seq_alg_timer", "seq_alg_timer" },
-         { "seq_channelCounter", "seq_channelCounter" },
-         { "seq_index", "seq_index" },
-         { "seq_isAlreadyExecuted", "seq_isAlreadyExecuted" },
-         { "seq_isExecuted", "seq_isExecuted" },
-         { "seq_isInitial", "seq_isInitial" },
-         { "seq_isPrevious", "seq_isPrevious" },
-         { "seq_level", "seq_level" },
-         { "seq_n", "seq_n" },
-         { "seq_roi", "seq_roi" },
-         { "seq_timer", "seq_timer" },
-         { "te_childIndex", "te_childIndex" },
-         { "te_clid", "te_clid" },
-         { "te_id", "te_id" },
-         { "te_index", "te_index" },
-         { "te_isActiveState", "te_isActiveState" },
-         { "te_isErrorState", "te_isErrorState" },
-         { "te_isInitialTe", "te_isInitialTe" },
-         { "te_isL1ThresholdTe", "te_isL1ThresholdTe" },
-         { "te_isOutputEFNode", "te_isOutputEFNode" },
-         { "te_isOutputL2Node", "te_isOutputL2Node" },
-         { "te_isRegularTe", "te_isRegularTe" },
-         { "te_isRoITe", "te_isRoITe" },
-         { "te_isTerminalNode", "te_isTerminalNode" },
-         { "te_isTopologicalTe", "te_isTopologicalTe" },
-         { "te_n", "te_n" },
-         { "te_parentIndex", "te_parentIndex" },
-         { "te_roiId", "te_roiId" },
-         { "timer", "timer" },
-         { "timerChainProcess", "timerChainProcess" },
-         { "timerEndSteer", "timerEndSteer" },
-         { "timerMon", "timerMon" },
-         { "timerResultBuilder", "timerResultBuilder" },
-         { "timerTrigCost", "timerTrigCost" }
-      };
-
-      // Set up the m_handles map using this list:
-      for( Int_t i = 0; i < NVARNAMES; ++i ) {
-         VarHandleBase* vh = GetVarHandle( VARNAMES[ i ][ 0 ] );
-         vh->SetName( m_prefix + VARNAMES[ i ][ 1 ] );
-         vh->SetMaster( master );
-         m_handles[ VARNAMES[ i ][ 0 ] ] = vh;
-      }
-
-      return;
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/TrigDBKeysD3PDObject.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/TrigDBKeysD3PDObject.cxx
deleted file mode 100644
index ca0d18230b9a..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/TrigDBKeysD3PDObject.cxx
+++ /dev/null
@@ -1,315 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-
-#include <TPRegexp.h>
-#include <TList.h>
-#include <TDataMember.h>
-
-#include "../TrigCostD3PD/TrigDBKeysD3PDObject.h"
-
-ClassImp( D3PDReader::TrigDBKeysD3PDObject )
-
-namespace D3PDReader {
-
-   /**
-    * This constructor should be used when the object will be used to read
-    * variables from an existing ntuple. The object will also be able to
-    * output variables, but it will also need to read them from somewhere.
-    *
-    * @param master Reference to the variable holding the current event number
-    * @param prefix Prefix of the variables in the D3PD
-    */
-   TrigDBKeysD3PDObject::TrigDBKeysD3PDObject( const ::Long64_t& master, const char* prefix )
-      : UserD3PDObject( master, prefix ),
-        m_handles(),
-        m_fromInput( kTRUE ),
-        m_prefix( prefix ) {
-
-      SetVarHandles( &master );
-   }
-
-   /**
-    * This constructor can be used when the object will only have to output
-    * (and temporarily store) new information into an output ntuple. For
-    * instance when one wants to create a selected/modified list of information.
-    *
-    * @param prefix Prefix of the variables in the D3PD
-    */
-   TrigDBKeysD3PDObject::TrigDBKeysD3PDObject( const char* prefix )
-      : UserD3PDObject( prefix ),
-        m_handles(),
-        m_fromInput( kFALSE ),
-        m_prefix( prefix ) {
-
-      SetVarHandles( 0 );
-   }
-
-   /**
-    * @returns The branch name prefix used by the object
-    */
-   const char* TrigDBKeysD3PDObject::GetPrefix() const {
-
-      return m_prefix;
-   }
-
-   /**
-    * @param prefix The prefix that should be used for the variables
-    */
-   void TrigDBKeysD3PDObject::SetPrefix( const char* prefix ) {
-
-      // Call the base class's function:
-      UserD3PDObject::SetPrefix( prefix );
-
-      // Remember the prefix:
-      m_prefix = prefix;
-
-      // Set all the variable names:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->SetName( ::TString( prefix ) + itr->first );
-      }
-
-      return;
-   }
-
-   /**
-    * This function should be called every time a new TFile is opened
-    * by your analysis code.
-    *
-    * @param tree Pointer to the TTree with the variables
-    */
-   void TrigDBKeysD3PDObject::ReadFrom( TTree* tree ) {
-
-      // Check if the object will be able to read from the TTree:
-      if( ! m_fromInput ) {
-         Error( "ReadFrom", "The object was not created with the correct" );
-         Error( "ReadFrom", "constructor to read data from a D3PD!" );
-         return;
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::ReadFrom( tree );
-
-      // Call ReadFrom(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->ReadFrom( tree );
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be called to connect the active variables of the object
-    * to an output TTree. It can be called multiple times, then the variables
-    * will be written to multiple TTrees.
-    *
-    * @param tree Pointer to the TTree where the variables should be written
-    */
-   void TrigDBKeysD3PDObject::WriteTo( TTree* tree ) {
-
-      // Call the base class's function:
-      UserD3PDObject::WriteTo( tree );
-
-      // Call WriteTo(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->WriteTo( tree );
-      }
-
-      return;
-   }
-
-   /**
-    * This is a convenience function for turning the branches active or
-    * inactive conveniently. If the parameter is set to <code>kTRUE</code>
-    * then the branches available from the input which match the given
-    * pattern are turned active.
-    * When it's set to <code>kFALSE</code> then all the variables matching
-    * the pattern are turned inactive.
-    *
-    * @param active Flag behaving as explained above
-    * @param pattern Regular expression specifying which branches to modify
-    */
-   void TrigDBKeysD3PDObject::SetActive( ::Bool_t active, const ::TString& pattern ) {
-
-      // Call the base class's function:
-      UserD3PDObject::SetActive( active, pattern );
-
-      ::TPRegexp re( pattern );
-
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! re.Match( m_prefix + itr->first ) ) continue;
-         if( active ) {
-            if( itr->second->IsAvailable() ) itr->second->SetActive( active );
-         } else {
-            itr->second->SetActive( active );
-         }
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to read in all the branches from the input
-    * TTree which are set active for writing out. This can simplify writing
-    * event selector codes immensely. Remember to set the desired variable
-    * active before calling this function.
-    */
-   void TrigDBKeysD3PDObject::ReadAllActive() {
-
-      // Check if it makes sense to call this function:
-      if( ! m_fromInput ) {
-         static ::Bool_t wPrinted = kFALSE;
-         if( ! wPrinted ) {
-            Warning( "ReadAllActive", "Function only meaningful when used on objects" );
-            Warning( "ReadAllActive", "which are used to read information from a D3PD" );
-            wPrinted = kTRUE;
-         }
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::ReadAllActive();
-
-      // Read in the current entry for each active variable:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! itr->second->IsActive() ) continue;
-         itr->second->ReadCurrentEntry();
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to get information about the access
-    * pattern/statistics of the job. It should be called at the end of
-    * an analysis job to get the information about the performance of the
-    * analysis.
-    *
-    * @returns An object describing the D3PD access statistics
-    */
-   // D3PDReadStats TrigDBKeysD3PDObject::GetStatistics() const {
-
-   //    // The result object:
-   //    D3PDReadStats result = UserD3PDObject::GetStatistics();
-
-   //    // Add the statistics from each variable to the result:
-   //    std::map< ::TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-   //    std::map< ::TString, VarHandleBase* >::const_iterator end = m_handles.end();
-   //    for( ; itr != end; ++itr ) {
-   //       result.AddVariable( itr->second->GetStatistics() );
-   //    }
-
-   //    return result;
-   // }
-
-   /**
-    * This function can be used to copy the contents of the entire object
-    * for a given event. This can be useful for instance when the user
-    * wants to copy all information to an output file, and modify it a bit,
-    * and only then write it out.
-    *
-    * @param parent The object to copy the information from
-    * @returns This same object, for convenience reasons
-    */
-   TrigDBKeysD3PDObject& TrigDBKeysD3PDObject::Set( const TrigDBKeysD3PDObject& parent ) {
-
-      // Check if this function can be used on the object:
-      if( m_fromInput ) {
-         Error( "Set", "Objects used for reading a D3PD can't be modified!" );
-         return *this;
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::Set( parent );
-
-      if( parent.HLTPSK.IsAvailable() && HLTPSK.IsActive() ) {
-         HLTPSK() = parent.HLTPSK();
-      } else {
-         HLTPSK() = 0;
-      }
-      if( parent.L1PSK.IsAvailable() && L1PSK.IsActive() ) {
-         L1PSK() = parent.L1PSK();
-      } else {
-         L1PSK() = 0;
-      }
-      if( parent.SMK.IsAvailable() && SMK.IsActive() ) {
-         SMK() = parent.SMK();
-      } else {
-         SMK() = 0;
-      }
-
-      return *this;
-   }
-
-   /**
-    * This function is used internally to access VarHandle members
-    * by name. This is necessary to push some setup from compile time
-    * to run time. It may sound weird, but it makes a lot of sense for large
-    * classes.
-    *
-    * @param name The name of the C++ variable (not of the branch)
-    * @returns A pointer to the VarHandle object
-    */
-   VarHandleBase* TrigDBKeysD3PDObject::GetVarHandle( const char* name ) {
-
-      if( ! ::strcmp( name, "HLTPSK" ) ) {
-         return &HLTPSK;
-      }
-      else if( ! ::strcmp( name, "L1PSK" ) ) {
-         return &L1PSK;
-      }
-      else if( ! ::strcmp( name, "SMK" ) ) {
-         return &SMK;
-      }
-
-      Error( "GetVarHandle", "Variable \"%s\" unknown", name );
-      return 0;
-   }
-
-   /**
-    * This function is used internally to set up all the VarHandle members
-    * of the class. It speeds up compilation *a lot* to do this at run-time
-    * like this, instead of putting a lot of lines of code operating on
-    * the std::map member.
-    *
-    * @param master Pointer to the master index, or a null pointer
-    */
-   void TrigDBKeysD3PDObject::SetVarHandles( const ::Long64_t* master ) {
-
-      // Create a list of variable-branch name pairs:
-      static const Int_t NVARNAMES = 3;
-      static const char* VARNAMES[ NVARNAMES ][ 2 ] = {
-         { "HLTPSK", "HLTPSK" },
-         { "L1PSK", "L1PSK" },
-         { "SMK", "SMK" }
-      };
-
-      // Set up the m_handles map using this list:
-      for( Int_t i = 0; i < NVARNAMES; ++i ) {
-         VarHandleBase* vh = GetVarHandle( VARNAMES[ i ][ 0 ] );
-         vh->SetName( m_prefix + VARNAMES[ i ][ 1 ] );
-         vh->SetMaster( master );
-         m_handles[ VARNAMES[ i ][ 0 ] ] = vh;
-      }
-
-      return;
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/UserD3PDObject.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/UserD3PDObject.cxx
deleted file mode 100644
index 287a328621fa..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/UserD3PDObject.cxx
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-
-// ROOT include(s):
-#include <TPRegexp.h>
-
-// Local include(s):
-#include "../TrigCostD3PD/UserD3PDObject.h"
-
-namespace D3PDReader {
-
-   UserD3PDObjectElement::UserD3PDObjectElement( size_t index,
-                                                 const UserD3PDObject& parent )
-      : ::TNamed(), m_parent( &parent ), m_index( index ), m_proxies() {
-
-   }
-
-   UserD3PDObjectElement::
-   UserD3PDObjectElement( const UserD3PDObjectElement& parent )
-      : TNamed( parent ), m_parent( parent.m_parent ), m_index( parent.m_index ),
-        m_proxies() {
-
-   }
-
-   UserD3PDObjectElement::~UserD3PDObjectElement() {
-
-      // Delete the allocated objects:
-      std::map< ::TString, VarProxyBase* >::iterator itr = m_proxies.begin();
-      std::map< ::TString, VarProxyBase* >::iterator end = m_proxies.end();
-      for( ; itr != end; ++itr ) {
-         delete itr->second;
-      }
-   }
-
-   size_t UserD3PDObjectElement::GetIndex() const {
-
-      return m_index;
-   }
-
-   UserD3PDObject::UserD3PDObject( const ::Long64_t& master,
-                                   const char* prefix )
-      : D3PDObjectBase(), m_master( &master ), m_prefix( prefix ), m_proxies(),
-        m_handles(), m_extraHandles(), m_fromInput( kTRUE ),
-        m_inTree( 0 ) {
-
-   }
-
-   UserD3PDObject::UserD3PDObject( const char* prefix )
-      : D3PDObjectBase(), m_master( 0 ), m_prefix( prefix ), m_proxies(),
-        m_handles(), m_extraHandles(), m_fromInput( kFALSE ),
-        m_inTree( 0 ) {
-
-   }
-
-   UserD3PDObject::~UserD3PDObject() {
-
-      // Delete the allocated objects:
-      std::map< ::TString, VarHandleBase* >::iterator itr = m_handles.begin();
-      std::map< ::TString, VarHandleBase* >::iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         delete itr->second;
-      }
-      // Although the code almost certainly crashes when such dummy objects
-      // are created, there's still some chance that they need to be cleaned:
-      std::vector< VarHandleBase* >::iterator eitr = m_extraHandles.begin();
-      std::vector< VarHandleBase* >::iterator eend = m_extraHandles.end();
-      for( ; eitr != eend; ++eitr ) {
-         delete *eitr;
-      }
-   }
-
-   /**
-    * @returns The branch name prefix used by the object
-    */
-   const char* UserD3PDObject::GetPrefix() const {
-
-      return m_prefix;
-   }
-
-   /**
-    * @param prefix The prefix that should be used for the variables
-    */
-   void UserD3PDObject::SetPrefix( const char* prefix ) {
-
-      m_prefix = prefix;
-
-      // Set all the variable names:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->SetName( ::TString( prefix ) + itr->first );
-      }
-
-      return;
-   }
-
-   /**
-    * This function should be called every time a new TFile is opened
-    * by your analysis code.
-    *
-    * @param tree Pointer to the TTree with the variables
-    */
-   void UserD3PDObject::ReadFrom( TTree* tree ) {
-
-      // Check if the object will be able to read from the TTree:
-      if( ! m_fromInput ) {
-         Error( "ReadFrom",
-                "The object was not created with the correct" );
-         Error( "ReadFrom",
-                "constructor to read data from a D3PD!" );
-         return;
-      }
-
-      // Call ReadFrom(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         // Ignore the variables that are created only now:
-         if( ! itr->second->GetMaster() ) continue;
-         itr->second->ReadFrom( tree );
-      }
-
-      // Remember the pointer:
-      m_inTree = tree;
-
-      return;
-   }
-
-   /**
-    * This function can be called to connect the active variables of the object
-    * to an output TTree. It can be called multiple times, then the variables
-    * will be written to multiple TTrees.
-    *
-    * @param tree Pointer to the TTree where the variables should be written
-    */
-   void UserD3PDObject::WriteTo( TTree* tree ) {
-
-      // Call WriteTo(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->WriteTo( tree );
-      }
-
-      return;
-   }
-
-   /**
-    * This is a convenience function for turning the branches active or
-    * inactive conveniently. If the parameter is set to <code>kTRUE</code>
-    * then the branches available from the input which match the given
-    * pattern are turned active.
-    * When it's set to <code>kFALSE</code> then all the variables matching
-    * the pattern are turned inactive.
-    *
-    * @param active Flag behaving as explained above
-    * @param pattern Regular expression specifying which branches to modify
-    */
-   void UserD3PDObject::SetActive( ::Bool_t active, const ::TString& pattern ) {
-
-      ::TPRegexp re( pattern );
-
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! re.Match( m_prefix + itr->first ) ) continue;
-         if( active ) {
-            if( itr->second->IsAvailable() ) itr->second->SetActive( active );
-         } else {
-            itr->second->SetActive( active );
-         }
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to read in all the branches from the input
-    * TTree which are set active for writing out. This can simplify writing
-    * event selector codes immensely. Remember to set the desired variable
-    * active before calling this function.
-    */
-   void UserD3PDObject::ReadAllActive() {
-
-      // Check if it makes sense to call this function:
-      if( ! m_fromInput ) {
-         static ::Bool_t wPrinted = kFALSE;
-         if( ! wPrinted ) {
-            Warning( "ReadAllActive",
-                     "Function only meaningful when used on objects" );
-            Warning( "ReadAllActive",
-                     "which are used to read information from a D3PD" );
-            wPrinted = kTRUE;
-         }
-      }
-
-      // Read in the current entry for each active variable:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! itr->second->IsActive() ) continue;
-         itr->second->ReadCurrentEntry();
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to get information about the access
-    * pattern/statistics of the job. It should be called at the end of
-    * an analysis job to get the information about the performance of the
-    * analysis.
-    *
-    * @returns An object describing the D3PD access statistics
-    */
-   // D3PDReadStats UserD3PDObject::GetStatistics() const {
-
-   //    // The result object:
-   //    D3PDReadStats result;
-
-   //    // Add the statistics from each variable to the result:
-   //    std::map< ::TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-   //    std::map< ::TString, VarHandleBase* >::const_iterator end = m_handles.end();
-   //    for( ; itr != end; ++itr ) {
-   //       result.AddVariable( itr->second->GetStatistics() );
-   //    }
-
-   //    return result;
-   // }
-
-   /**
-    * User variables can't be copied like this at the moment.
-    */
-   UserD3PDObject& UserD3PDObject::Set( const UserD3PDObject& parent ) {
-
-      if( parent.m_handles.size() ) {
-         Error( "Set",
-                "User variables can not be copied usig this function!" );
-      }
-      return *this;
-   }
-
-   /**
-    * This function makes it easier to clear out the object completely.
-    * It cleares all the vector variables, and sets the element number
-    * variable to 0. Very useful when performing object selection.
-    * The option argument is not used at the moment for anything.
-    * It's only there because the <code>Clear</code> function defined in
-    * TObject has this parameter as well.
-    *
-    * @param option Ignored at the moment
-    */
-   void UserD3PDObject::Clear( Option_t* ) {
-
-      // Clear each variable:
-      std::map< ::TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< ::TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->Clear();
-      }
-
-      return;
-   }
-
-   /**
-    * User variables can't be copied like this at the moment.
-    */
-   UserD3PDObject& UserD3PDObject::Add( const UserD3PDObjectElement& el ) {
-
-      if( el.m_proxies.size() ) {
-         Error( "Add",
-                "User variables can not be copied usig this function!" );
-      }
-      return *this;
-   }
-
-   /**
-    * This operator can be used to get access to one element in the
-    * collection. This element can then be passed around between parts
-    * of the analysis code easily.
-    *
-    * This version is useful when modifying the variable contents through
-    * the proxy objects.
-    *
-    * @param index Index of the element inside the collection
-    */
-   UserD3PDObjectElement& UserD3PDObject::operator[]( size_t index ) {
-
-      while( m_proxies.size() <= index ) {
-         m_proxies.push_back( new UserD3PDObjectElement( m_proxies.size(), *this ) );
-      }
-      return *m_proxies[ index ];
-   }
-
-   /**
-    * This operator can be used to get access to one element in the
-    * collection. This element can then be passed around between parts
-    * of the analysis code easily.
-    *
-    * This version is useful when only reading the variables.
-    *
-    * @param index Index of the element inside the collection
-    */
-   const UserD3PDObjectElement& UserD3PDObject::operator[]( size_t index ) const {
-
-      while( m_proxies.size() <= index ) {
-         m_proxies.push_back( new UserD3PDObjectElement( m_proxies.size(), *this ) );
-      }
-      return *m_proxies[ index ];
-   }
-
-   /**
-    * A convenience operator for adding an 'element' to this collection.
-    *
-    * @see Add
-    * @param el The 'element' that should be added to the collection
-    */
-   UserD3PDObject& UserD3PDObject::operator+=( const UserD3PDObjectElement& el ) {
-
-      return this->Add( el );
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/Utils.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/Utils.cxx
deleted file mode 100644
index 96cbdc137481..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/Utils.cxx
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-
-// STL include(s):
-#include <cmath>
-
-// Local include(s):
-#include "../TrigCostD3PD/Utils.h"
-
-namespace {
-
-   /**
-    *  @short Simple structure describing an elapsed amount of time
-    *
-    *         In order to print some elapsed times in a nice way, the
-    *         private functions of this source file use this structure.
-    *
-    *         The amount of times measured by the code should be
-    *         representable by this structure. (We shouldn't care about
-    *         sub-milisecond times, or longer running periods than a
-    *         few days...)
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   struct TimeStruct {
-      ::Int_t miliseconds; ///< Elapsed milisecods
-      ::Int_t seconds; ///< Elapsed seconds
-      ::Int_t minutes; ///< Elapsed minutes
-      ::Int_t hours; ///< Elapsed hours
-      ::Int_t days; ///< Elapsed days
-   }; // struct TimeStruct
-
-   /// Function creating a time structure
-   /**
-    * This function is used to break down a simple elapsed time expressed in
-    * seconds into an easy-to-print structure. Shame that I couldn't find something
-    * in standard C/C++ to do it...
-    *
-    * @param secs The elapsed time expressed in seconds
-    * @returns A structure describing the elapsed time
-    */
-   TimeStruct TimeToStruct( ::Double_t secs ) {
-
-      // Create the structure, fill its miliseconds variable,
-      // and reset all the rest:
-      TimeStruct result;
-      result.miliseconds =
-         static_cast< ::Int_t >( std::fmod( secs, 1.0 ) * 1000.0 );
-      result.seconds = 0; result.minutes = 0; result.hours = 0;
-      result.days = 0;
-
-      // If the elapsed time was less than a second, finish here:
-      secs -= ( result.miliseconds / 1000.0 );
-      if( std::abs( secs ) < 0.5 ) return result;
-
-      // Calculate the number of seconds passed, and finish if the
-      // amount of time passed was less than a minute:
-      result.seconds =
-         static_cast< ::Int_t >( std::fmod( secs, 60.0 ) );
-      secs -= result.seconds;
-      if( std::abs( secs ) < 0.5 ) return result;
-
-      // Calculate the number of minutes passed, and finish if the
-      // amount of time passed was less than an hour:
-      result.minutes =
-         static_cast< ::Int_t >( std::fmod( secs, 3600.0 ) / 60.0 );
-      secs -= result.minutes * 60.0;
-      if( std::abs( secs ) < 0.5 ) return result;
-
-      // Calculate the number of hours passed, and finish if the
-      // amount of time passed was less than a day:
-      result.hours =
-         static_cast< ::Int_t >( std::fmod( secs, 86400.0 ) / 3600.0 );
-      secs -= result.hours * 3600.0;
-      if( std::abs( secs ) < 0.5 ) return result;
-
-      // Calculate the number of days passed. The function should
-      // not expect to have to express a larger order of magnitude...
-      result.days = static_cast< ::Int_t >( secs / 86400.0 );
-
-      return result;
-   }
-
-} // private namespace
-
-namespace D3PDReader {
-
-   /**
-    * Since I wasn't able to find a nice function printing elapsed times
-    * in a human-readable format, I ended up writing one. This function
-    * is used in printing the statistics about an analysis.
-    *
-    * @param secs An amount of time passed, expressed in seconds
-    * @returns A formatted, human-readable version of the amount of time passed
-    */
-   ::TString TimeToString( ::Double_t secs ) {
-
-      const TimeStruct ts = TimeToStruct( secs );
-      ::TString result;
-      if( ts.days ) {
-         result += ::TString::Format( "%id ", ts.days );
-      }
-      if( ts.hours ) {
-         result += ::TString::Format( "%ih ", ts.hours );
-      }
-      if( ts.minutes ) {
-         result += ::TString::Format( "%im ", ts.minutes );
-      }
-      if( ts.seconds ) {
-         result += ::TString::Format( "%is ", ts.seconds );
-      }
-      result += ::TString::Format( "%ims", ts.miliseconds );
-
-      return result;
-   }
-
-   /**
-    * This function is used to produce nicely readable printouts for
-    * amounts of data.
-    *
-    * @param bytes The amount of data expressed in bytes
-    * @returns A human-readable printout of the data size
-    */
-   ::TString SizeToString( ::Long64_t bytes ) {
-
-      if( std::abs( bytes ) > 1e12 ) {
-         return ::TString::Format( "%g TB", bytes * 1e-12 );
-      } else if( std::abs( bytes ) > 1e9 ) {
-         return ::TString::Format( "%g GB", bytes * 1e-9 );
-      } else if( std::abs( bytes ) > 1e6 ) {
-         return ::TString::Format( "%g MB", bytes * 1e-6 );
-      } else if( std::abs( bytes ) > 1e3 ) {
-         return ::TString::Format( "%g kB", bytes * 1e-3 );
-      } else {
-         return ::TString::Format( "%lli bytes", bytes );
-      }
-   }
-
-   /**
-    * @param bytespersec The speed expressed in bytes / seconds
-    * @returns A human-readable printout of the data processing speed
-    */
-   ::TString SpeedToString( ::Double_t bytespersec ) {
-
-      if( ::fabs( bytespersec ) > 1e12 ) {
-         return ::TString::Format( "%g TB/s", bytespersec * 1e-12 );
-      } else if( ::fabs( bytespersec ) > 1e9 ) {
-         return ::TString::Format( "%g GB/s", bytespersec * 1e-9 );
-      } else if( ::fabs( bytespersec ) > 1e6 ) {
-         return ::TString::Format( "%g MB/s", bytespersec * 1e-6 );
-      } else if( ::fabs( bytespersec ) > 1e3 ) {
-         return ::TString::Format( "%g kB/s", bytespersec * 1e-3 );
-      } else {
-         return ::TString::Format( "%g B/s", bytespersec );
-      }
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/VarHandle.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/VarHandle.cxx
deleted file mode 100644
index 0173a2460b7f..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/VarHandle.cxx
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-
-// ROOT include(s):
-#include <TError.h>
-
-// Local include(s):
-#include "../TrigCostD3PD/VarHandle.h"
-//#include "../TrigCostD3PD/D3PDPerfStats.h"
-
-namespace D3PDReader {
-
-   VarHandleBase::VarHandleBase( const char* name,
-                                 const ::Long64_t* master )
-      : m_master( master ), m_fromInput( kFALSE ),
-        m_inTree( 0 ), m_inBranch( 0 ), m_available( UNKNOWN ), m_name( name ),
-        m_active( kFALSE ), m_type( "" ),
-        m_entriesRead(), m_branchSize(), m_zippedSize() {
-
-#ifdef COLLECT_D3PD_READING_STATISTICS
-      //D3PDPerfStats::Instance();
-#endif // COLLECT_D3PD_READING_STATISTICS
-   }
-
-   const char* VarHandleBase::GetName() const {
-
-      return m_name;
-   }
-
-   void VarHandleBase::SetName( const char* name ) {
-
-      m_name = name;
-      return;
-   }
-
-   const char* VarHandleBase::GetType() const {
-
-      return m_type;
-   }
-
-   void VarHandleBase::SetType( const char* type ) {
-
-      m_type = type;
-      return;
-   }
-
-   const ::Long64_t* VarHandleBase::GetMaster() const {
-
-      return m_master;
-   }
-
-   void VarHandleBase::SetMaster( const ::Long64_t* master ) {
-
-      m_master = master;
-      return;
-   }
-
-   ::Bool_t VarHandleBase::IsActive() const {
-
-      return m_active;
-   }
-
-   void VarHandleBase::SetActive( ::Bool_t active ) {
-
-      m_active = active;
-      return;
-   }
-
-   ::Bool_t VarHandleBase::IsAvailable() const {
-
-      if( ! m_fromInput ) return kTRUE;
-      switch( m_available ) {
-
-      case AVAILABLE:
-         return kTRUE;
-         break;
-      case UNAVAILABLE:
-         return kFALSE;
-         break;
-      case UNKNOWN:
-         {
-            if( ! m_inTree ) return kTRUE;
-            ::Bool_t temp = kFALSE;
-            m_available = ( temp = m_inTree->GetBranch( GetName() ) ) ? AVAILABLE :
-                         UNAVAILABLE;
-            return temp;
-         }
-         break;
-      default:
-         // This should really never be reached...
-         break;
-      }
-
-      // It's just here to make the compiler happy:
-      return kFALSE;
-   }
-
-   // VariableStats VarHandleBase::GetStatistics() const {
-
-   //    // Calculate the statistics:
-   //    ::Long64_t readEntries = 0;
-   //    ::Long64_t unzippedBytes = 0;
-   //    ::Long64_t zippedBytes = 0;
-   //    for( size_t i = 0; i < m_entriesRead.size(); ++i ) { 
-   //       readEntries += m_entriesRead[ i ];
-   //       unzippedBytes += static_cast< ::Long64_t >( m_branchSize[ i ] *
-   //                                                   m_entriesRead[ i ] );
-   //       zippedBytes += static_cast< ::Long64_t >( m_zippedSize[ i ] *
-   //                                                 m_entriesRead[ i ] );
-   //    }
-
-   //    // Now return the "smart" object:
-   //    return VariableStats( GetName(), GetType(),
-   //                          m_entriesRead.size(), readEntries,
-   //                          unzippedBytes, zippedBytes );
-   // }
-
-   ::Bool_t VarHandleBase::ConnectVariable( void* var, ::TClass* realClass,
-                                            EDataType dtype, Bool_t isptr ) const {
-
-      if( ! m_inTree ) {
-         ::Error( "D3PDReader::VarHandleBase::ConnectVariable",
-                  "Object not connected yet!" );
-         return kFALSE;
-      }
-      if( ! m_inTree->GetBranch( GetName() ) ) {
-         ::Error( "D3PDReader::VarHandleBase::ConnectVariable",
-                  "The following variable doesn't exist: %s",
-                  GetName() );
-         return kFALSE;
-      }
-#ifdef ACTIVATE_BRANCHES
-      // Only call this function when the user asks for it. It's quite expensive...
-      m_inTree->SetBranchStatus( ::TString( GetName() ) + "*", 1 );
-#endif // ACTIVATE_BRANCHES
-      if( m_inTree->SetBranchAddress( GetName(), var, &m_inBranch,
-                                     realClass, dtype, isptr ) ) {
-         ::Error( "D3PDReader::VarHandleBase::ConnectVariable",
-                  "Couldn't connect variable to branch: %s", GetName() );
-         return kFALSE;
-      }
-
-#ifdef COLLECT_D3PD_READING_STATISTICS
-      //UpdateStat( m_inBranch );
-#endif // COLLECT_D3PD_READING_STATISTICS
-
-      return kTRUE;
-   }
-
-   void VarHandleBase::UpdateBranch() const {
-      //Cov warning
-      if (!m_inBranch) return;
-
-      if( *m_master != m_inBranch->GetReadEntry() ) {
-         m_inBranch->GetEntry( *m_master );
-#ifdef COLLECT_D3PD_READING_STATISTICS
-        // ++( m_entriesRead.back() );
-#endif // COLLECT_D3PD_READING_STATISTICS
-      }
-
-      return;
-   }
-
-   // void VarHandleBase::UpdateStat( ::TBranch* br ) const {
-
-   //    m_entriesRead.push_back( 0 );
-   //    m_branchSize.push_back( ( ::Float_t ) br->GetTotalSize( "*" ) /
-   //                           ( ::Float_t ) br->GetEntries() );
-   //    m_zippedSize.push_back( ( ::Float_t ) br->GetZipBytes( "*" ) /
-   //                           ( ::Float_t ) br->GetEntries() );
-
-   //    D3PDPerfStats::Instance()->NewTreeAccessed( m_inTree );
-
-   //    return;
-   // }
-
-   const char* VarHandleBase::RootType( const char* typeid_type ) const {
-
-      if( strlen( typeid_type ) != 1 ) {
-         ::Error( "D3PDReader::VarHandleBase::RootType",
-                  "Received complex object description" );
-         return "";
-      }
-
-      switch( typeid_type[ 0 ] ) {
-
-      case 'c':
-         return "B";
-         break;
-      case 'h':
-         return "b";
-         break;
-      case 's':
-         return "S";
-         break;
-      case 't':
-         return "s";
-         break;
-      case 'i':
-         return "I";
-         break;
-      case 'j':
-         return "i";
-         break;
-      case 'f':
-         return "F";
-         break;
-      case 'd':
-         return "D";
-         break;
-      case 'x':
-         return "L";
-         break;
-      case 'y':
-         return "l";
-         break;
-      case 'b':
-         return "O";
-         break;
-
-      }
-
-      ::Error( "D3PDReader::VarHandleBase::RootType",
-               "Unknown primitive type encountered: %s",
-               typeid_type );
-      return "";
-   }
-
-   const char* VarHandleBase::RootCppType( const char* typeid_type ) const {
-
-      if( strlen( typeid_type ) != 1 ) {
-         ::Error( "D3PDReader::VarHandleBase::RootCppType",
-                  "Received complex object description" );
-         return "";
-      }
-
-      switch( typeid_type[ 0 ] ) {
-
-      case 'c':
-         return "Char_t";
-         break;
-      case 'h':
-         return "UChar_t";
-         break;
-      case 's':
-         return "Short_t";
-         break;
-      case 't':
-         return "UShort_t";
-         break;
-      case 'i':
-         return "Int_t";
-         break;
-      case 'j':
-         return "UInt_t";
-         break;
-      case 'f':
-         return "Float_t";
-         break;
-      case 'd':
-         return "Double_t";
-         break;
-      case 'x':
-         return "Long64_t";
-         break;
-      case 'y':
-         return "ULong64_t";
-         break;
-      case 'b':
-         return "Bool_t";
-         break;
-
-      }
-
-      ::Error( "D3PDReader::VarHandleBase::RootCppType",
-               "Unknown primitive type encountered: %s",
-               typeid_type );
-      return "";
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/D3PDObjectBase.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/D3PDObjectBase.h
deleted file mode 100644
index 21d81c091b23..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/D3PDObjectBase.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_D3PDOBJECTBASE_H
-#define D3PDREADER_D3PDOBJECTBASE_H
-
-// ROOT include(s):
-#include <TNamed.h>
-#include <TString.h>
-
-// Local include(s):
-//#include "D3PDReadStats.h"
-
-// Forward declaration(s):
-class TTree;
-
-namespace D3PDReader {
-
-   /**
-    *  @short Common base class for all main D3PDReader classes
-    *
-    *         To make the classes a bit easier to handle in "smart" code
-    *         they inherit from a common base that defines all of their
-    *         common features.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   class D3PDObjectBase : public ::TNamed {
-
-   public:
-      /// Default constructor
-      D3PDObjectBase() : ::TNamed() {}
-
-      /// Get the currently configured prefix value
-      virtual const char* GetPrefix() const = 0;
-      /// Set the prefix for the variables
-      virtual void SetPrefix( const char* prefix ) = 0;
-
-      /// Connect the object to an input TTree
-      virtual void ReadFrom( ::TTree* tree ) = 0;
-      /// Connect the object to an output TTree
-      virtual void WriteTo( ::TTree* tree ) = 0;
-
-      /// Turn (selected) branches either on or off
-      virtual void SetActive( ::Bool_t active = kTRUE,
-                              const ::TString& pattern = ".*" ) = 0;
-
-      /// Read in all the variables that we need to write out as well
-      virtual void ReadAllActive() = 0;
-
-      /// Get the D3PD reading statistics
-      //virtual D3PDReadStats GetStatistics() const = 0;
-
-      ClassDef( D3PDObjectBase, 0 )
-
-   }; // class D3PDObjectBase
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_D3PDOBJECTBASE_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/NTUP_TRIGCOST.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/NTUP_TRIGCOST.h
deleted file mode 100644
index a759ee9a5caa..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/NTUP_TRIGCOST.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-#ifndef D3PDREADER_NTUP_TRIGCOST_H
-#define D3PDREADER_NTUP_TRIGCOST_H
-
-// Local include(s):
-#include "D3PDObjectBase.h"
-#include "TrigCostD3PDObject.h"
-#include "TrigDBKeysD3PDObject.h"
-
-namespace D3PDReader {
-
-   /**
-    * Code generated by CodeGenerator_v2 on:
-    *  host = lxplus0164.cern.ch
-    *  OS   = Linux / 2.6.32-431.11.2.el6.x86_64
-    *  user = tamartin
-    *  time = Fri Jun 27 16:52:19 2014
-    */
-   class NTUP_TRIGCOST : public D3PDObjectBase {
-
-   public:
-      /// Default constructor, to be used when reading a D3PD
-      NTUP_TRIGCOST();
-      /// Constructor for only writing data
-      NTUP_TRIGCOST( Bool_t onlyForWriting );
-
-      /// Get the currently configured prefix value
-      virtual const char* GetPrefix() const;
-      /// Set the prefix for the variables
-      virtual void SetPrefix( const char* prefix );
-
-      /// Connect the object to an input TTree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output TTree
-      virtual void WriteTo( ::TTree* tree );
-
-      /// Turn (selected) branches either on or off
-      virtual void SetActive( ::Bool_t active = kTRUE,
-                              const ::TString& pattern = ".*" );
-      /// Read in all the variables that we need to write out as well
-      virtual void ReadAllActive();
-
-      /// Get the D3PD reading statistics
-      //virtual D3PDReadStats GetStatistics() const;
-
-      /// Switch the reader object to a new event
-      void GetEntry( ::Long64_t entry );
-
-      //
-      // All the components of the D3PD:
-      //
-      TrigCostD3PDObject TrigCostHLT;
-      TrigDBKeysD3PDObject trig_DB;
-
-   private:
-      Long64_t m_entry; ///< Variable storing the current entry number
-      Bool_t m_fromInput; ///< Flag specifying if object is used for D3PD reading
-
-      ClassDef( NTUP_TRIGCOST, 0 )
-
-   }; // class NTUP_TRIGCOST
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_NTUP_TRIGCOST_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigCostD3PDObject.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigCostD3PDObject.h
deleted file mode 100644
index e4ce74f86c6d..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigCostD3PDObject.h
+++ /dev/null
@@ -1,234 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-#ifndef D3PDREADER_TrigCostD3PDObject_H
-#define D3PDREADER_TrigCostD3PDObject_H
-
-// STL include(s):
-#include <map>
-#include <vector>
-
-// ROOT include(s):
-#include <TObject.h>
-#include <TString.h>
-
-#include "D3PDObjectBase.h"
-//#include "D3PDReadStats.h"
-#include "VarHandle.h"
-#include "UserD3PDObject.h"
-
-class TTree;
-
-namespace D3PDReader {
-
-   /**
-    * Code generated by CodeGenerator_v2 on:
-    *  host = lxplus0164.cern.ch
-    *  OS   = Linux / 2.6.32-431.11.2.el6.x86_64
-    *  user = tamartin
-    *  time = Fri Jun 27 16:52:19 2014
-    */
-   class TrigCostD3PDObject : public UserD3PDObject {
-
-   public:
-      /// Constructor used when reading from a TTree
-      TrigCostD3PDObject( const ::Long64_t& master, const char* prefix = "TrigCostHLT_" );
-      /// Constructor when the object is only used for writing data out
-      TrigCostD3PDObject( const char* prefix = "TrigCostHLT_" );
-
-      /// Get the currently configured prefix value
-      virtual const char* GetPrefix() const;
-      /// Set the prefix for the variables
-      virtual void SetPrefix( const char* prefix );
-
-      /// Connect the object to an input TTree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output TTree
-      virtual void WriteTo( ::TTree* tree );
-
-      /// Turn (selected) branches either on or off
-      virtual void SetActive( ::Bool_t active = kTRUE,
-                              const ::TString& pattern = ".*" );
-      /// Read in all the variables that we need to write out as well
-      virtual void ReadAllActive();
-
-      /// Get the D3PD reading statistics
-      //virtual D3PDReadStats GetStatistics() const;
-
-      /// Set the contents of the object according to another object
-      TrigCostD3PDObject& Set( const TrigCostD3PDObject& parent );
-
-      /// Hash of AppId of the XPU node processing this event.
-      VarHandle< unsigned int > appId;
-      /// Enhanced bias weight of the event (only if specificaly calculated)
-      VarHandle< float > ebWeight;
-      VarHandle< unsigned int > ebWeightBG;
-      VarHandle< unsigned char > ebUnbiased;
-      /// If the event was a monitoring event
-      VarHandle< unsigned char > ranScaleTools;
-      /// BCID for this event
-      VarHandle< unsigned int > bunchCrossingId;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > chain_counter;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isExpressStream;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isPassed;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isPassedRaw;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isPassthrough;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isPrescaled;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isResurrected;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > chain_level;
-      VarHandle< unsigned short > chain_n;
-      VarHandle< std::vector<float,std::allocator<float> >* > chain_timer;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_wasL1AfterPrescale;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_wasL1AfterVeto;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_wasL1BeforePrescale;
-      /// Sequential number of cost events processed
-      VarHandle< float > costEvent;
-      /// Nanosecond the data were saved by CostMon
-      VarHandle< unsigned int > costRunNsec;
-      /// Second the data were saved by CostMon
-      VarHandle< unsigned int > costRunSec;
-      /// Event number
-      VarHandle< unsigned int > eventNumber;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > l1_ctpId;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_isPrescaled;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_isVetoed;
-      VarHandle< unsigned short > l1_n;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_passed;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_passedAfterPrescale;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_passedAfterVeto;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_passedBeforePrescale;
-      /// Lumi block number for this event
-      VarHandle< unsigned int > lumi;
-      VarHandle< float > lumiLength;
-      /// Start of the event nanoseconds
-      VarHandle< unsigned int > nanoSeconds;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > rob_data_id;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isCached;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isDisabled;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isIgnored;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isRetrieved;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isStatusOk;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isStatusPrefetched;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isUnclassified;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > rob_data_n;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > rob_data_size;
-      VarHandle< unsigned short > rob_n;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > rob_requestorId;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_sum_isCached;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_sum_isDisabled;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_sum_isIgnored;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_sum_isRetrieved;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_sum_isUnclassified;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > rob_sum_n;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > rob_sum_nRob;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > rob_sum_size;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > rob_sum_subDet;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > rob_timeStartMicroSec;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > rob_timeStartSec;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > rob_timeStopMicroSec;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > rob_timeStopSec;
-      VarHandle< std::vector<double,std::allocator<double> >* > rob_timer;
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_area;
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_eta;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > roi_id;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeEmTau;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTau; // new
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeEnergy;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeJet;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeJetEt;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeMuon;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeNone;
-      VarHandle< unsigned short > roi_n;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_nL1Thresholds;
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_phi;
-      // New
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_et;
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_etLarge;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_muCharge;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > roi_isoBits;
-      VarHandle< std::vector<float,std::allocator<float> >* >  roi_vectorEX;
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_vectorEY;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_overflowEX;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_overflowEY;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_overflowET;
-      /// Run number for this event
-      VarHandle< unsigned int > runNumber;
-      /// Start of the event in seconds
-      VarHandle< unsigned int > seconds;
-      VarHandle< std::vector<double,std::allocator<double> >* > seq_algTotalTime;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > seq_alg_isCached;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > seq_alg_isCalled;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > seq_alg_n;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > seq_alg_position;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > seq_alg_roi_index;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > seq_alg_roi_n;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > seq_alg_timeStartMicroSec;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > seq_alg_timeStartSec;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > seq_alg_timeStopMicroSec;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > seq_alg_timeStopSec;
-      VarHandle< std::vector<std::vector<double,std::allocator<double> >,std::allocator<std::vector<double,std::allocator<double> > > >* > seq_alg_timer;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > seq_channelCounter;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > seq_index;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > seq_isAlreadyExecuted;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > seq_isExecuted;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > seq_isInitial;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > seq_isPrevious;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > seq_level;
-      VarHandle< unsigned short > seq_n;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > seq_roi;
-      VarHandle< std::vector<float,std::allocator<float> >* > seq_timer;
-      VarHandle< std::vector<std::vector<unsigned short,std::allocator<unsigned short> >,std::allocator<std::vector<unsigned short,std::allocator<unsigned short> > > >* > te_childIndex;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > te_clid;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > te_id;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > te_index;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isActiveState;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isErrorState;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isInitialTe;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isL1ThresholdTe;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isOutputEFNode;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isOutputL2Node;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isRegularTe;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isRoITe;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isTerminalNode;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isTopologicalTe;
-      VarHandle< unsigned short > te_n;
-      VarHandle< std::vector<std::vector<unsigned short,std::allocator<unsigned short> >,std::allocator<std::vector<unsigned short,std::allocator<unsigned short> > > >* > te_parentIndex;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > te_roiId;
-      /// Nominal time for this event
-      VarHandle< float > timer;
-      /// Detailed: Time of chain execution
-      VarHandle< float > timerChainProcess;
-      /// Detailed: Time to end of steering
-      VarHandle< float > timerEndSteer;
-      /// Detailed: Total time of monitoring tool(s) execution
-      VarHandle< float > timerMon;
-      /// Detailed: Time of ResultBuilder tool execution
-      VarHandle< float > timerResultBuilder;
-      /// Detailed: Time to run the OPI trig cost tools
-      VarHandle< float > timerTrigCost;
-
-   private:
-      /// Function used internally to access the variables
-      VarHandleBase* GetVarHandle( const char* name );
-      /// Function setting up all the VarHandle members
-      void SetVarHandles( const ::Long64_t* master );
-
-      std::map< ::TString, VarHandleBase* > m_handles; ///< Book-keeper of the VarHandle members
-      const ::Bool_t m_fromInput; ///< Flag specifying if object is used for D3PD reading
-      ::TString m_prefix; ///< Prefix to the branch names
-
-      ClassDef( TrigCostD3PDObject, 0 )
-
-   }; // class TrigCostD3PDObject
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_TrigCostD3PDObject_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigDBKeysD3PDObject.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigDBKeysD3PDObject.h
deleted file mode 100644
index 59cba60fbf7c..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigDBKeysD3PDObject.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-#ifndef D3PDREADER_TrigDBKeysD3PDObject_H
-#define D3PDREADER_TrigDBKeysD3PDObject_H
-
-// STL include(s):
-#include <map>
-
-// ROOT include(s):
-#include <TObject.h>
-#include <TString.h>
-
-#include "D3PDObjectBase.h"
-//#include "D3PDReadStats.h"
-#include "VarHandle.h"
-#include "UserD3PDObject.h"
-
-class TTree;
-
-namespace D3PDReader {
-
-   /**
-    * Code generated by CodeGenerator_v2 on:
-    *  host = epp-ui01
-    *  OS   = Linux / 2.6.18-348.3.1.el5
-    *  user = phsmai
-    *  time = Tue Apr 16 11:36:42 2013
-    */
-   class TrigDBKeysD3PDObject : public UserD3PDObject {
-
-   public:
-      /// Constructor used when reading from a TTree
-      TrigDBKeysD3PDObject( const ::Long64_t& master, const char* prefix = "trig_DB_" );
-      /// Constructor when the object is only used for writing data out
-      TrigDBKeysD3PDObject( const char* prefix = "trig_DB_" );
-
-      /// Get the currently configured prefix value
-      virtual const char* GetPrefix() const;
-      /// Set the prefix for the variables
-      virtual void SetPrefix( const char* prefix );
-
-      /// Connect the object to an input TTree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output TTree
-      virtual void WriteTo( ::TTree* tree );
-
-      /// Turn (selected) branches either on or off
-      virtual void SetActive( ::Bool_t active = kTRUE,
-                              const ::TString& pattern = ".*" );
-      /// Read in all the variables that we need to write out as well
-      virtual void ReadAllActive();
-
-      /// Get the D3PD reading statistics
-      //virtual D3PDReadStats GetStatistics() const;
-
-      /// Set the contents of the object according to another object
-      TrigDBKeysD3PDObject& Set( const TrigDBKeysD3PDObject& parent );
-
-      /// HLT PreScale Key
-      VarHandle< unsigned int > HLTPSK;
-      /// LVL1 PreScale Key
-      VarHandle< unsigned int > L1PSK;
-      /// Super Master Key
-      VarHandle< unsigned int > SMK;
-
-   private:
-      /// Function used internally to access the variables
-      VarHandleBase* GetVarHandle( const char* name );
-      /// Function setting up all the VarHandle members
-      void SetVarHandles( const ::Long64_t* master );
-
-      std::map< ::TString, VarHandleBase* > m_handles; ///< Book-keeper of the VarHandle members
-      const ::Bool_t m_fromInput; ///< Flag specifying if object is used for D3PD reading
-      ::TString m_prefix; ///< Prefix to the branch names
-
-      ClassDef( TrigDBKeysD3PDObject, 0 )
-
-   }; // class TrigDBKeysD3PDObject
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_TrigDBKeysD3PDObject_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.h
deleted file mode 100644
index 8fbf2bbced91..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.h
+++ /dev/null
@@ -1,186 +0,0 @@
-// Dear emacs, this is -*- c++ -*--
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_UserD3PDObject_H
-#define D3PDREADER_UserD3PDObject_H
-
-// STL include(s):
-#include <map>
-#include <vector>
-
-// ROOT include(s):
-#include <TNamed.h>
-#include <TString.h>
-
-// Local include(s):
-#include "D3PDObjectBase.h"
-//#include "D3PDReadStats.h"
-#include "VarHandle.h"
-#include "VarProxy.h"
-
-// Forward declaration(s):
-class TTree;
-
-namespace D3PDReader {
-
-   // Forward declaration(s):
-   class UserD3PDObject;
-
-   /**
-    *  @short Special class for handling user variables
-    *
-    *         This proxy class can be used to handle user-defined vector
-    *         variables in a fancy way. It is also used by all of the regular
-    *         proxy classes as base class, so they could handle user defined
-    *         variables as well. (For instance for adding a new property to
-    *         electrons in the analysis.)
-    *
-    *         The class doesn't inherit from TObject on purpose, in order to
-    *         avoid ending up with a diamond in the inheritance structure.
-    *         (Python *really* doesn't like that...)
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   class UserD3PDObjectElement : public ::TNamed {
-
-      friend class UserD3PDObject;
-
-   protected:
-      /// Constructor only visible to children and UserD3PDObject
-      UserD3PDObjectElement( size_t index, const UserD3PDObject& parent );
-
-   public:
-      /// Copy constructor
-      UserD3PDObjectElement( const UserD3PDObjectElement& parent );
-      /// Destructor, cleaning up the created objects
-      virtual ~UserD3PDObjectElement();
-
-      /// Index of the object inside its container
-      virtual size_t GetIndex() const;
-
-      /// Access a variable
-      template< typename T >
-      VarProxy< T >& Variable( const TString& name );
-      /// Access a variable (constant version)
-      template< typename T >
-      const VarProxy< T >& Variable( const TString& name ) const;
-
-   private:
-      /// Reference to the parent of this object
-      const UserD3PDObject* m_parent;
-      /// The index of this object inside the parent container
-      size_t m_index;
-      /// Book-keeper of the VarProxy members
-      mutable std::map< ::TString, VarProxyBase* > m_proxies;
-
-      UserD3PDObjectElement& operator=( const UserD3PDObjectElement& parent );
-
-      ClassDef( UserD3PDObjectElement, 0 )
-
-   }; // class UserD3PDObjectElement
-
-   /**
-    *  @short Special class for handling user variables
-    *
-    *         This class is used to handle user defined variables. It can be
-    *         used on its own to read/write any sort of variable, but it also
-    *         acts as a base class for all the other D3PDObject classes, to
-    *         make it possible to decorate the information stored by them.
-    *
-    *         While the class fully implements the D3PDObjectBase interface,
-    *         it doesn't inherit from it, in order to avoid creating a diamond
-    *         in the inheritance structure. Python is not able to handle such
-    *         an inheritance structure correctly.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   class UserD3PDObject : public D3PDObjectBase {
-
-   public:
-      /// Constructor used when reading from a TTree
-      UserD3PDObject( const ::Long64_t& master, const char* prefix = "" );
-      /// Constructor when the object is only used for writing data out
-      UserD3PDObject( const char* prefix = "" );
-      /// Destructor, cleaning up the created objects
-      virtual ~UserD3PDObject();
-
-      /// Get the currently configured prefix value
-      virtual const char* GetPrefix() const;
-      /// Set the prefix for the variables
-      virtual void SetPrefix( const char* prefix );
-
-      /// Connect the object to an input TTree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output TTree
-      virtual void WriteTo( ::TTree* tree );
-
-      /// Turn (selected) branches either on or off
-      virtual void SetActive( ::Bool_t active = kTRUE,
-                              const ::TString& pattern = ".*" );
-      /// Read in all the variables that we need to write out as well
-      virtual void ReadAllActive();
-
-      /// Get the D3PD reading statistics
-      //virtual D3PDReadStats GetStatistics() const;
-
-      /// Set the contents of the object according to another object
-      UserD3PDObject& Set( const UserD3PDObject& parent );
-
-      /// Clear the container. Useful when writing new branches.
-      void Clear( Option_t* option = "" );
-      /// Add one element to an output collection
-      UserD3PDObject& Add( const UserD3PDObjectElement& el );
-
-      /// Access a proxy class describing one element of the container
-      UserD3PDObjectElement& operator[]( size_t index );
-      /// Access a proxy class describing one element of the container (constant version)
-      const UserD3PDObjectElement& operator[]( size_t index ) const;
-      /// Add one element to an output collection
-      UserD3PDObject& operator+=( const UserD3PDObjectElement& el );
-
-      /// Declare a new variable for writing
-      template< typename T >
-      void DeclareVariable( const TString& name );
-      /// Access a variable
-      template< typename T >
-      VarHandle< T >& Variable( const TString& name );
-      /// Access a variable (constant version)
-      template< typename T >
-      const VarHandle< T >& Variable( const TString& name ) const;
-
-   private:
-      const ::Long64_t* m_master; ///< Pointer to the master entry number
-      ::TString m_prefix; ///< Prefix to the branch names
-      ///< Internal list of proxy objects
-      mutable std::vector< UserD3PDObjectElement* > m_proxies;
-      /// Book-keeper of the VarHandle members
-      mutable std::map< ::TString, VarHandleBase* > m_handles;
-      /// Book-keeper of VarHandle objects needed for technical reasons
-      mutable std::vector< VarHandleBase* > m_extraHandles;
-      /// Flag specifying if object is used for D3PD reading
-      const ::Bool_t m_fromInput;
-      /// TTree that is being read currently
-      ::TTree* m_inTree;
-
-      ClassDef( UserD3PDObject, 0 )
-
-   }; // class UserD3PDObject
-
-} // namespace D3PDReader
-
-// Include the template implementation:
-#ifndef __CINT__
-#include "UserD3PDObject.icc"
-#endif // __CINT__
-
-#endif // D3PDREADER_UserD3PDObject_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.icc b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.icc
deleted file mode 100644
index f034ce35b1f6..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.icc
+++ /dev/null
@@ -1,249 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_UserD3PDObject_ICC
-#define D3PDREADER_UserD3PDObject_ICC
-
-namespace D3PDReader {
-
-   /**
-    * This function accesses a user-defined variable for modification.
-    * The template type needs to follow the type of the underlying
-    * TTree branch's type, without the outermost vector. So for instance
-    * to access a <code>std::vector<float></code> variable from here, you
-    * need to call the function with a <code>float</code> template argument.
-    *
-    * The function also takes care of extending the underlying vector variable
-    * to the needed size. This makes the decoration of existing objects in
-    * a container with new variables much easier.
-    *
-    * If you're decorating elements that you are reading from an input D3PD,
-    * you must have already called <code>DeclareVariable(...)</code> on the
-    * parent object before calling thig function.
-    *
-    * @param name The name of the user variable
-    * @returns The VarProxy object handling the requested variable
-    */
-   template< typename T >
-   VarProxy< T >& UserD3PDObjectElement::Variable( const TString& name ) {
-
-      // Try to find the variable:
-      std::map< ::TString, VarProxyBase* >::const_iterator itr =
-         m_proxies.find( name );
-      if( itr != m_proxies.end() ) {
-         // If it's already known, let's see if it's the right type:
-         VarProxy< T >* result =
-            dynamic_cast< VarProxy< T >* >( itr->second );
-         if( ! result ) {
-            // Create a dummy object. The code will crash soon
-            // anyway...
-            VarProxy< T >* dummy =
-               new VarProxy< T >( m_parent->Variable< std::vector< T >* >( name ),
-                                  m_index );
-            m_proxies[ name ] = dummy;
-            // Tell the user what happened:
-            Error( "Variable",
-                   "Variable with name '%s' requested with wrong type",
-                   name.Data() );
-            return *dummy;
-         }
-         // Check if the underlying vector is large enough:
-         const VarHandle< std::vector< T >* >& vh = 
-            m_parent->Variable< std::vector< T >* >( name );
-         if( vh.IsAvailable() && ( ! vh.GetMaster() ) &&
-             ( vh()->size() <= m_index ) ) {
-            UserD3PDObject* ncparent = const_cast< UserD3PDObject* >( m_parent );
-            ncparent->Variable< std::vector< T >* >( name )()->resize( m_index + 1 );
-         }
-         // Return the proxy:
-         return *result;
-      }
-
-      // Add the new proxy variable:
-      VarProxy< T >* result =
-         new VarProxy< T >( m_parent->Variable< std::vector< T >* >( name ),
-                            m_index );
-      m_proxies[ name ] = result;
-
-      // Check if the underlying vector is large enough:
-      const VarHandle< std::vector< T >* >& vh = 
-         m_parent->Variable< std::vector< T >* >( name );
-      if( vh.IsAvailable() && ( ! vh.GetMaster() ) &&
-          ( vh()->size() <= m_index ) ) {
-         UserD3PDObject* ncparent = const_cast< UserD3PDObject* >( m_parent );
-         ncparent->Variable< std::vector< T >* >( name )()->resize( m_index + 1 );
-      }
-
-      // Return the proxy:
-      return *result;
-   }
-
-   /**
-    * This function accesses a user-defined variable for reading.
-    * The template type needs to follow the type of the underlying
-    * TTree branch's type, without the outermost vector. So for instance
-    * to access a <code>std::vector<float></code> variable from here, you
-    * need to call the function with a <code>float</code> template argument.
-    *
-    * If you're decorating elements that you are reading from an input D3PD,
-    * you must have already called <code>DeclareVariable(...)</code> on the
-    * parent object before calling thig function.
-    *
-    * @param name The name of the user variable
-    * @returns The VarProxy object handling the requested variable
-    */
-   template< typename T >
-   const VarProxy< T >& UserD3PDObjectElement::Variable( const TString& name ) const {
-
-      // Try to find the variable:
-      std::map< ::TString, VarProxyBase* >::const_iterator itr =
-         m_proxies.find( name );
-      if( itr != m_proxies.end() ) {
-         // If it's already known, let's see if it's the right type:
-         VarProxy< T >* result =
-            dynamic_cast< VarProxy< T >* >( itr->second );
-         if( ! result ) {
-            // Create a dummy object. The code will crash soon
-            // anyway...
-            VarProxy< T >* dummy =
-               new VarProxy< T >( m_parent->Variable< std::vector< T >* >( name ),
-                                  m_index );
-            m_proxies[ name ] = dummy;
-            // Tell the user what happened:
-            Error( "Variable",
-                   "Variable with name '%s' requested with wrong type",
-                   name.Data() );
-            return *dummy;
-         }
-         // Return the proxy:
-         return *result;
-      }
-
-      // Add the new proxy variable:
-      VarProxy< T >* result =
-         new VarProxy< T >( m_parent->Variable< std::vector< T >* >( name ),
-                            m_index );
-      m_proxies[ name ] = result;
-
-      // Return the proxy:
-      return *result;
-   }
-
-   /**
-    * This function can be used to add a new variable to an output D3PD.
-    * When reading an input D3PD that the user wants to write out a part of,
-    * extended with some additional variables, this function should be used.
-    *
-    * @param name The name of the new variable to create
-    */
-   template< typename T >
-   void UserD3PDObject::DeclareVariable( const TString& name ) {
-
-      // Check if the variable with this name is already in place:
-      std::map< ::TString, VarHandleBase* >::const_iterator itr =
-         m_handles.find( name );
-      if( itr != m_handles.end() ) {
-         Warning( "DeclareVariable",
-                  "Variable with name '%s' already declared",
-                  ( m_prefix + name ).Data() );
-         return;
-      }
-
-      // Declare the new variable:
-      m_handles[ name ] = new VarHandle< T >( m_prefix + name, 0 );
-
-      return;
-   }
-
-   /**
-    * This function can be used to access a user-defined variable for
-    * modification. It should mostly be used when writing a D3PD with the
-    * additional user variable.
-    *
-    * @param name The name of the user-defined variable
-    * @returns The VarHandle object handling the user variable
-    */
-   template< typename T >
-   VarHandle< T >& UserD3PDObject::Variable( const TString& name ) {
-
-      // Try to find the variable:
-      std::map< ::TString, VarHandleBase* >::const_iterator itr =
-         m_handles.find( name );
-      if( itr != m_handles.end() ) {
-         // It's already known, so let's see if it's of the right type:
-         VarHandle< T >* result =
-            dynamic_cast< VarHandle< T >* >( itr->second );
-         if( ! result ) {
-            // Add a dummy object for technical reasons. The user code
-            // will anyway probably die after this.
-            VarHandle< T >* dummy = new VarHandle< T >();
-            m_extraHandles.push_back( dummy );
-            // Tell the user what happened:
-            Error( "Variable",
-                   "Variable with name '%s' is of type '%s', "
-                   "not of type '%s'",
-                   ( m_prefix + name ).Data(), itr->second->GetType(),
-                   dummy->GetType() );
-            // Return the dummy:
-            return *dummy;
-         }
-         // Return the object:
-         return *result;
-      }
-
-      // If it doesn't exist yet, let's add it:
-      VarHandle< T >* result = new VarHandle< T >( m_prefix + name, m_master );
-      if( m_inTree ) result->ReadFrom( m_inTree );
-      m_handles[ name ] = result;
-      return *result;
-   }
-
-   /**
-    * This function can be used to access a user-defined variable for
-    * reading. It can be used both when reading or writing a D3PD.
-    *
-    * @param name The name of the user-defined variable
-    * @returns The VarHandle object handling the user variable
-    */
-   template< typename T >
-   const VarHandle< T >& UserD3PDObject::Variable( const TString& name ) const {
-
-      // Try to find the variable:
-      std::map< ::TString, VarHandleBase* >::const_iterator itr =
-         m_handles.find( name );
-      if( itr != m_handles.end() ) {
-         // It's already known, so let's see if it's of the right type:
-         VarHandle< T >* result =
-            dynamic_cast< VarHandle< T >* >( itr->second );
-         if( ! result ) {
-            // Add a dummy object for technical reasons. The user code
-            // will anyway probably die after this.
-            VarHandle< T >* dummy = new VarHandle< T >();
-            m_extraHandles.push_back( dummy );
-            // Tell the user what happened:
-            Error( "Variable",
-                   "Variable with name '%s' is of type '%s', "
-                   "not of type '%s'",
-                   ( m_prefix + name ).Data(), itr->second->GetType(),
-                   dummy->GetType() );
-            // Return the dummy:
-            return *dummy;
-         }
-         // Return the object:
-         return *result;
-      }
-
-      // If it doesn't exist yet, let's add it:
-      VarHandle< T >* result = new VarHandle< T >( m_prefix + name, m_master );
-      if( m_inTree ) result->ReadFrom( m_inTree );
-      m_handles[ name ] = result;
-      return *result;
-   }
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_UserD3PDObject_ICC
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/Utils.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/Utils.h
deleted file mode 100644
index a30e4f4bc4d0..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/Utils.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_UTILS_H
-#define D3PDREADER_UTILS_H
-
-// ROOT include(s):
-#include <TString.h>
-
-namespace D3PDReader {
-
-   /// Function creating a human-readable elapsed time printout
-   ::TString TimeToString( ::Double_t secs );
-
-   /// Function for printing data sizes in human-readable format
-   ::TString SizeToString( ::Long64_t bytes );
-
-   /// Function for printing data processing speeds in a human-readable format
-   ::TString SpeedToString( ::Double_t bytespersec );
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_UTILS_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.h
deleted file mode 100644
index 243e09ce81e2..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.h
+++ /dev/null
@@ -1,225 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_VARHANDLE_H
-#define D3PDREADER_VARHANDLE_H
-
-// ROOT include(s):
-#include <TString.h>
-#include <TDataType.h>
-
-// Local include(s):
-//#include "D3PDReadStats.h"
-
-// Forward declaration(s):
-class TTree;
-class TBranch;
-
-namespace D3PDReader {
-
-   /**
-    *  @short Base class for the different kind of VarHandle specializations
-    *
-    *         This class is used to keep a list of all the VarHandle members of
-    *         a D3PDObject class. It makes some operations much easier.
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   class VarHandleBase {
-
-   protected:
-      /// Custom enumeration describing the availability of the branch
-      enum BranchAvailability {
-         UNKNOWN = 0, ///< The input TTree has not yet been checked
-         AVAILABLE = 1, ///< The input branch is available
-         UNAVAILABLE = 2 ///< The input branch is not available
-      };
-
-   public:
-      /// Constructor specifying all the needed parameters
-      VarHandleBase( const char* name = "",
-                     const ::Long64_t* master = 0 );
-      /// The destructor is actually only useful in the specialized class...
-      virtual ~VarHandleBase() {}
-
-      /// Get the name of the branch handled by this class
-      const char* GetName() const;
-      /// Set the name of the branch handled by this class
-      void SetName( const char* name );
-
-      /// Get the type name of the branch handled by this object
-      const char* GetType() const;
-      /// Set the type name of the branch handled by this object
-      void SetType( const char* type );
-
-      /// Get a pointer to the master entry variable
-      const ::Long64_t* GetMaster() const;
-      /// Set the pointer to the master entry variable
-      void SetMaster( const ::Long64_t* master );
-
-      /// Connect the object to an input tree
-      virtual void ReadFrom( ::TTree* tree ) = 0;
-      /// Connect the object to an output tree
-      virtual ::TBranch* WriteTo( ::TTree* tree ) = 0;
-
-      /// Check if this variable is "active" at the moment
-      ::Bool_t IsActive() const;
-      /// Set the "activity level" of the variable
-      void SetActive( ::Bool_t active = kTRUE );
-
-      /// Check if the variable is available in the input
-      virtual ::Bool_t IsAvailable() const;
-
-      /// Read in the current entry from the branch
-      virtual void ReadCurrentEntry() const = 0;
-
-      /// "Clear" the variable of its contents
-      virtual void Clear() = 0;
-
-      /// Get information about the read statistics
-      //virtual VariableStats GetStatistics() const;
-
-   protected:
-      /// Connect the variable to the branch
-      ::Bool_t ConnectVariable( void* var, ::TClass* realClass,
-                                EDataType dtype, Bool_t isptr ) const;
-      /// Update the variable to the current entry in the D3PD
-      void UpdateBranch() const;
-      /// Switch to a new tree in the statistics gathering
-      // void UpdateStat( ::TBranch* br ) const;
-      /// Translate the typeid() type name to something ROOT understands
-      const char* RootType( const char* typeid_type ) const;
-      /// Translate the typeid() type name to a huma-readable ROOT type name
-      const char* RootCppType( const char* typeid_type ) const;
-
-      const ::Long64_t* m_master; ///< Pointer to the current entry number
-      ::Bool_t m_fromInput; ///< Flag showing if the variable is read from an input TTree
-      ::TTree* m_inTree; ///< The input TTree
-      mutable ::TBranch* m_inBranch; /// The input branch belonging to this variable
-      mutable BranchAvailability m_available; ///< Availability of the branch
-
-   private:
-      ::TString m_name; ///< Name of the branch to handle
-      ::Bool_t m_active; ///< Flag telling if the variable can be written to the output
-
-      ::TString m_type; ///< Variable type
-      mutable std::vector< ::Long64_t > m_entriesRead; ///< Number of read entries for each tree
-      mutable std::vector< ::Float_t > m_branchSize; ///< Unzipped entry size for each tree
-      mutable std::vector< ::Float_t > m_zippedSize; ///< Zipped entry size for each tree
-
-   }; // class VarHandleBase
-
-   /**
-    *  @short Class responsible for reading primitive types from the D3PD
-    *
-    *         This class is used by all the D3PDReader classes to physically
-    *         handle the branches of the input TTree.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   template< typename Type >
-   class VarHandle : public VarHandleBase {
-
-   public:
-      /// Convenience typedef of the used variable
-      typedef Type& result_type;
-      /// Convenience typedef of the used variable (const version)
-      typedef const Type& const_result_type;
-
-      /// Constructor specifying all the needed parameters
-      VarHandle( const char* name = "",
-                 const ::Long64_t* master = 0 );
-      /// The destructor is actually only useful in the specialized class...
-      ~VarHandle();
-
-      /// Connect the object to an input tree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output tree
-      virtual ::TBranch* WriteTo( ::TTree* tree );
-
-      /// Operator used to access the branch itself
-      result_type operator()();
-      /// Operator used to access the branch itself (constant version)
-      const_result_type operator()() const;
-
-      /// Read in the current entry from the branch
-      virtual void ReadCurrentEntry() const;
-
-      /// "Clear" the variable of its contents
-      virtual void Clear();
-
-      /// Set the value of the variable. Used primarily from Python.
-      void Set( Type value );
-
-   private:
-      mutable Type m_variable; ///< The variable in memory
-
-   }; // class VarHandle
-
-   /**
-    *  @short Class responsible for reading STL objects from the D3PD
-    *
-    *         This specialization of the template class makes it possible to
-    *         handle branches describing primitive types and branches describing
-    *         STL collections a little differently.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   template< typename Type >
-   class VarHandle< Type* > : public VarHandleBase {
-
-   public:
-      /// Convenience typedef of the used variable
-      typedef Type* result_type;
-      /// Convenience typedef of the used variable (const version)
-      typedef const Type* const_result_type;
-
-      /// Constructor specifying all the needed parameters
-      VarHandle( const char* name = "",
-                 const ::Long64_t* master = 0 );
-      /// This destructor actually does something...
-      ~VarHandle();
-
-      /// Connect the object to an input tree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output tree
-      virtual ::TBranch* WriteTo( ::TTree* tree );
-
-      /// Operator used to access the branch itself
-      result_type operator()();
-      /// Operator used to access the branch itself (constant version)
-      const_result_type operator()() const;
-
-      /// Read in the current entry from the branch
-      virtual void ReadCurrentEntry() const;
-
-      /// "Clear" the variable of its contents
-      virtual void Clear();
-
-      /// Set the value of the variable. Used primarily from Python.
-      void Set( const_result_type value );
-
-   private:
-      mutable Type* m_variable; ///< The variable in memory
-
-   }; // class VarHandle
-
-} // namespace D3PDReader
-
-// Include the implementation:
-#ifndef __CINT__
-#include "VarHandle.icc"
-#endif // __CINT__
-
-#endif // D3PDREADER_VARHANDLE_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.icc b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.icc
deleted file mode 100644
index c5c45b58dde3..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.icc
+++ /dev/null
@@ -1,277 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_VARHANDLE_ICC
-#define D3PDREADER_VARHANDLE_ICC
-
-// System include(s):
-#include <string.h>
-#include <cxxabi.h>
-#include <cstdlib>
-
-// ROOT include(s):
-#include <TObject.h>
-#include <TClass.h>
-#include <TTree.h>
-#include <TBranch.h>
-#include <TError.h>
-
-namespace D3PDReader {
-
-   template< typename Type >
-   // cppcheck-suppress uninitMemberVar
-   VarHandle< Type >::VarHandle( const char* name,
-                                 const ::Long64_t* master )
-      : VarHandleBase( name, master ),
-        m_variable() {
-
-      SetType( RootCppType( typeid( Type ).name() ) );
-   }
-
-   template< typename Type >
-   VarHandle< Type >::~VarHandle() {
-
-   }
-
-   template< typename Type >
-   void VarHandle< Type >::ReadFrom( ::TTree* tree ) {
-
-      m_inTree = tree;
-      m_fromInput = kTRUE;
-      m_variable = 0;
-      m_inBranch = 0;
-      m_available = UNKNOWN;
-
-      return;
-   }
-
-   template< typename Type >
-   ::TBranch* VarHandle< Type >::WriteTo( ::TTree* tree ) {
-
-      if( ! IsActive() ) return 0;
-
-      ::TBranch* branch = tree->GetBranch( GetName() );
-      if( branch ) return branch;
-
-      branch = tree->Branch( GetName(), &m_variable,
-                             ::TString::Format( "%s/%s", GetName(),
-                                                RootType( typeid( Type ).name() ) ) );
-      if( ! branch ) {
-         ::Error( "D3PDReader::VarHandle::WriteTo",
-                  "Couldn't add variable %s to tree %s",
-                  GetName(), tree->GetName() );
-      } else {
-         for( ::Long64_t i = 0; i < tree->GetEntries(); ++i ) {
-            branch->Fill();
-         }
-      }
-
-      return branch;
-   }
-
-   template< typename Type >
-   typename VarHandle< Type >::result_type VarHandle< Type >::operator()() {
-
-      if( ! m_fromInput ) return m_variable;
-
-      if( ! m_inBranch ) {
-         if( ! ConnectVariable( &m_variable, TClass::GetClass( typeid( Type ) ),
-                                TDataType::GetType( typeid( Type ) ), kFALSE ) ||
-             !m_inBranch )
-         {
-            ::Error( ::TString( "D3PDReader::VarHandle::" ) + GetName() + "()",
-                     "Failed connecting to D3PD" );
-            return m_variable;
-         }
-      }
-      UpdateBranch();
-
-      return m_variable;
-   }
-
-   template< typename Type >
-   typename VarHandle< Type >::const_result_type VarHandle< Type >::operator()() const {
-
-      if( ! m_fromInput ) return m_variable;
-
-      if( ! m_inBranch ) {
-         if( ! ConnectVariable( &m_variable, TClass::GetClass( typeid( Type ) ),
-                                TDataType::GetType( typeid( Type ) ), kFALSE ) ) {
-            ::Error( ::TString( "D3PDReader::VarHandle::" ) + GetName() + "()",
-                     "Failed connecting to D3PD" );
-            return m_variable;
-         }
-      }
-      UpdateBranch();
-
-      return m_variable;
-   }
-
-   template< typename Type >
-   void VarHandle< Type >::ReadCurrentEntry() const {
-
-      if( IsAvailable() ) {
-         this->operator()();
-      } else {
-         m_variable = 0;
-      }
-      return;
-   }
-
-   template< typename Type >
-   void VarHandle< Type >::Clear() {
-
-      this->operator()() = 0;
-      return;
-   }
-
-   template< typename Type >
-   void VarHandle< Type >::Set( Type value ) {
-
-      m_variable = value;
-      return;
-   }
-
-   template< typename Type >
-   // cppcheck-suppress uninitMemberVar
-   VarHandle< Type* >::VarHandle( const char* name,
-                                  const ::Long64_t* master )
-      : VarHandleBase( name, master ),
-        m_variable( 0 ) {
-
-      int status;
-      char* type_name = abi::__cxa_demangle( typeid( Type ).name(), 0, 0, &status );
-      if( ! status ) {
-         SetType( type_name );
-         ::free( type_name );
-      }
-   }
-
-   template< typename Type >
-   VarHandle< Type* >::~VarHandle() {
-
-      if( m_variable ) delete m_variable;
-   }
-
-   template< typename Type >
-   void VarHandle< Type* >::ReadFrom( ::TTree* tree ) {
-
-      m_inTree = tree;
-      m_fromInput = kTRUE;
-      if( m_variable ) m_variable->clear();
-      m_inBranch = 0;
-      m_available = UNKNOWN;
-
-      return;
-   }
-
-   template< typename Type >
-   ::TBranch* VarHandle< Type* >::WriteTo( ::TTree* tree ) {
-
-      if( ! IsActive() ) return 0;
-
-      ::TBranch* branch = tree->GetBranch( GetName() );
-      if( branch ) return branch;
-
-      if( ! ::strcmp( GetType(), "" ) ) {
-         ::Error( "D3PDReader::VarHandle::WriteTo",
-                  "Couldn't demangle type name: %s",
-                  typeid( Type ).name() );
-         return 0;
-      }
-      if( ! m_variable ) {
-         m_variable = new Type();
-      }
-      branch = tree->Bronch( GetName(), GetType(), &m_variable );
-      if( ! branch ) {
-         ::Error( "D3PDReader::VarHandle::WriteTo",
-                  "Couldn't add variable %s to tree %s",
-                  GetName(), tree->GetName() );
-      } else {
-         for( ::Long64_t i = 0; i < tree->GetEntries(); ++i ) {
-            branch->Fill();
-         }
-      }
-
-      return branch;
-   }
-
-   template< typename Type >
-   typename VarHandle< Type* >::result_type
-   VarHandle< Type* >::operator()() {
-
-      if( ! m_fromInput ) {
-         if( ! m_variable ) m_variable = new Type();
-         return m_variable;
-      }
-
-      if( ! m_inBranch ) {
-         if( ! ConnectVariable( &m_variable, TClass::GetClass( typeid( Type ) ),
-                                TDataType::GetType( typeid( Type ) ), kTRUE ) ) {
-            ::Error( ::TString( "D3PDReader::VarHandle::" ) + GetName() + "()",
-                     "Failed connecting to D3PD" );
-            return m_variable;
-         }
-      }
-      UpdateBranch();
-
-      return m_variable;
-   }
-
-   template< typename Type >
-   typename VarHandle< Type* >::const_result_type
-   VarHandle< Type* >::operator()() const {
-
-      if( ! m_fromInput ) {
-         if( ! m_variable ) m_variable = new Type();
-         return m_variable;
-      }
-
-      if( ! m_inBranch ) {
-         if( ! ConnectVariable( &m_variable, TClass::GetClass( typeid( Type ) ),
-                                TDataType::GetType( typeid( Type ) ), kTRUE ) ||
-             !m_inBranch)
-         {
-            ::Error( ::TString( "D3PDReader::VarHandle::" ) + GetName() + "()",
-                     "Failed connecting to D3PD" );
-            return m_variable;
-         }
-      }
-      UpdateBranch();
-
-      return m_variable;
-   }
-
-   template< typename Type >
-   void VarHandle< Type* >::ReadCurrentEntry() const {
-
-      if( IsAvailable() ) {
-         this->operator()();
-      } else {
-         if( ! m_variable ) m_variable = new Type();
-         m_variable->clear();
-      }
-      return;
-   }
-
-   template< typename Type >
-   void VarHandle< Type* >::Clear() {
-
-      this->operator()()->clear();
-      return;
-   }
-
-   template< typename Type >
-   void VarHandle< Type* >::Set( const_result_type value ) {
-
-      *m_variable = *value;
-      return;
-   }
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_VARHANDLE_ICC
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.h
deleted file mode 100644
index bc6f71c51134..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_VARPROXY_H
-#define D3PDREADER_VARPROXY_H
-
-// STL include(s):
-#include <vector>
-
-// Local include(s):
-#include "VarHandle.h"
-
-namespace D3PDReader {
-
-   /**
-    *  @short Base class for the VarProxy versions
-    *
-    *         This class is needed for technical reasons in order to handle
-    *         user defined variables in a nice way.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   class VarProxyBase {
-
-   public:
-      /// Destructor, to make vtable happy
-      virtual ~VarProxyBase() {}
-
-      /// Check if the variable is available in the input
-      virtual ::Bool_t IsAvailable() const = 0;
-
-   }; // class VarProxyBase
-
-   /**
-    *  @short Class acting as a proxy to one element of an std::vector
-    *
-    *         This class is used in the "Element" classes to represent one
-    *         object from a collection.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   template< typename Type >
-   class VarProxy : public VarProxyBase {
-
-   public:
-      /// Convenience typedef of the used variable
-      typedef Type& result_type;
-      /// Convenience typedef of the used variable (const version)
-      typedef const Type& const_result_type;
-
-      /// Constructor specifying the handle object this proxy uses
-      VarProxy( const VarHandle< std::vector< Type >* >& handle, size_t i );
-      /// Copy constructor
-      VarProxy( const VarProxy< Type >& parent );
-      /// Copy operator
-      VarProxy< Type >& operator=( const VarProxy< Type >& parent );
-
-      /// Check if the variable is available in the input
-      virtual ::Bool_t IsAvailable() const;
-
-      /// Operator returning the variable belonging to this object
-      result_type operator()();
-      /// Operator returning the variable belonging to this object (constant version)
-      const_result_type operator()() const;
-
-   private:
-      VarHandle< std::vector< Type >* >* m_handle; ///< Pointer to the handle object
-      size_t m_index; ///< Index inside the handle object's vector
-      Type m_dummy; ///< Object returned by default
-
-   }; // class VarProxy
-
-} // namespace D3PDReader
-
-// Include the implementation:
-#ifndef __CINT__
-#include "VarProxy.icc"
-#endif // __CINT__
-
-#endif // D3PDREADER_VARPROXY_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.icc b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.icc
deleted file mode 100644
index 7ab1c65f9dfb..000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.icc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_VARPROXY_ICC
-#define D3PDREADER_VARPROXY_ICC
-
-// ROOT include(s):
-#include <TError.h>
-
-namespace D3PDReader {
-
-   template< typename Type >
-   VarProxy< Type >::VarProxy( const VarHandle< std::vector< Type >* >& handle,
-                               size_t i )
-      : m_handle( const_cast< VarHandle< std::vector< Type >* >* >( &handle ) ),
-        m_index( i ), m_dummy() {
-
-   }
-
-   template< typename Type >
-   VarProxy< Type >::VarProxy( const VarProxy< Type >& parent )
-      : VarProxyBase(), m_handle( parent.m_handle ), m_index( parent.m_index ),
-        m_dummy() {
-
-   }
-
-   template< typename Type >
-   VarProxy< Type >& VarProxy< Type >::operator=( const VarProxy< Type >& parent ) {
-
-      m_handle = parent.m_handle;
-      m_index  = parent.m_index;
-
-      return *this;
-   }
-
-   template< typename Type >
-   ::Bool_t VarProxy< Type >::IsAvailable() const {
-
-      return m_handle->IsAvailable();
-   }
-
-   template< typename Type >
-   typename VarProxy< Type >::result_type VarProxy< Type >::operator()() {
-
-      if( m_handle->IsAvailable() ) {
-         return ( ( *( *m_handle )() ) )[ m_index ];
-      } else {
-         ::Warning( ::TString( "D3PDReader::VarProxy::" ) + m_handle->GetName() + "()",
-                    "Variable not available on input. Returning 0" );
-         return m_dummy;
-      }
-   }
-
-   template< typename Type >
-   typename VarProxy< Type >::const_result_type VarProxy< Type >::operator()() const {
-
-      if( m_handle->IsAvailable() ) {
-         return ( ( *( *m_handle )() ) )[ m_index ];
-      } else {
-         ::Warning( ::TString( "D3PDReader::VarProxy::" ) + m_handle->GetName() + "()",
-                    "Variable not available on input. Returning 0" );
-         return m_dummy;
-      }
-   }
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_VARPROXY_ICC
-- 
GitLab


From 6048359ab7c7bab49c9d81bbc9164aa1d6e44780 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Tue, 22 Sep 2020 18:37:02 +0200
Subject: [PATCH 364/422] Remove ConditionStore objects from ViewDataVerifier

---
 .../python/HLTMenuConfig/Muon/MuonSetup.py     | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
index 7f7b73870e7b..1ae0bfc23eff 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
@@ -499,9 +499,6 @@ def muCombRecoSequence( RoIs, name ):
   ViewVerify = CfgMgr.AthViews__ViewDataVerifier("muFastViewDataVerifier")
   ViewVerify.DataObjects = [('xAOD::L2StandAloneMuonContainer','StoreGateSvc+'+muNames.L2SAName)]
 
-  from IOVDbSvc.CondDB import conddb
-  if not conddb.folderRequested( '/TDAQ/Resources/ATLAS/PIXEL/Modules' ):
-    ViewVerify.DataObjects += [( 'CondAttrListCollection', 'ConditionStore+/TDAQ/Resources/ATLAS/PIXEL/Modules' )]
   muCombRecoSequence+=ViewVerify
 
   ### please read out TrigmuCombMTConfig file ###
@@ -568,13 +565,6 @@ def muEFSARecoSequence( RoIs, name ):
                                         ( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+'+RoIs )]
   efAlgs.append( EFMuonViewDataVerifier )
 
-  # Only load these objects if they aren't available in conddb
-  from IOVDbSvc.CondDB import conddb
-  if not conddb.folderRequested( "/MDT/DQMF/DEAD_ELEMENT" ):
-    EFMuonViewDataVerifier.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/MDT/DQMF/DEAD_ELEMENT' )]
-  if not conddb.folderRequested( "/MDT/TUBE_STATUS/DEAD_TUBE" ):
-    EFMuonViewDataVerifier.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/MDT/TUBE_STATUS/DEAD_TUBE' )]
-
   #need MdtCondDbAlg for the MuonStationIntersectSvc (required by segment and track finding)
   from AthenaCommon.AlgSequence import AthSequencer
   from MuonCondAlg.MuonTopCondAlgConfigRUN2 import MdtCondDbAlg
@@ -683,12 +673,8 @@ def muEFCBRecoSequence( RoIs, name ):
 
   muEFCBRecoSequence += ViewVerifyMS
 
-  # Add conditions data if not already available
-  from IOVDbSvc.CondDB import conddb
   from AthenaCommon.AlgSequence import AlgSequence
   topSequence = AlgSequence()
-  if not conddb.folderRequested( "/PIXEL/PixdEdx" ):
-    ViewVerifyMS.DataObjects += [( 'AthenaAttributeList' , 'ConditionStore+/PIXEL/PixdEdx' )]
 
   if not globalflags.InputFormat.is_bytestream():
     topSequence.SGInputLoader.Load += [( 'TRT_RDO_Container' , 'StoreGateSvc+TRT_RDOs' )]
@@ -937,9 +923,9 @@ def efmuisoRecoSequence( RoIs, Muons ):
                              ( 'xAOD::MuonContainer' , 'StoreGateSvc+IsoViewMuons' )]
 
   # Make sure required objects are still available at whole-event level
-  from AthenaCommon.AlgSequence import AlgSequence
-  topSequence = AlgSequence()
   if not globalflags.InputFormat.is_bytestream():
+    from AthenaCommon.AlgSequence import AlgSequence
+    topSequence = AlgSequence()
     viewVerify.DataObjects += [( 'TRT_RDO_Container' , 'StoreGateSvc+TRT_RDOs' )]
     topSequence.SGInputLoader.Load += [( 'TRT_RDO_Container' , 'StoreGateSvc+TRT_RDOs' )]
 
-- 
GitLab


From e95d0b4a53ca0274963188a81af74a683d335e72 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Tue, 22 Sep 2020 18:59:05 +0200
Subject: [PATCH 365/422] Remove ConditionStore objects from ViewDataVerifier

---
 Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py   | 3 +--
 .../python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py    | 6 ------
 .../HLTMenuConfig/MinBias/MinBiasChainConfiguration.py      | 6 ------
 .../python/HLTMenuConfig/Muon/MuonSequenceSetup.py          | 5 -----
 .../python/HLTMenuConfig/Tau/TauRecoSequences.py            | 2 --
 5 files changed, 1 insertion(+), 21 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py
index 16bd617e6908..6093811ed349 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py
@@ -142,8 +142,7 @@ def HLTRoITopoRecoSequence(RoIs):
     import AthenaCommon.CfgMgr as CfgMgr
     HLTRoITopoRecoSequenceVDV = CfgMgr.AthViews__ViewDataVerifier("HLTRoITopoRecoSequenceVDV")
     HLTRoITopoRecoSequenceVDV.DataObjects = [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+PrecisionCaloRoIs' ),
-                                             ( 'CaloBCIDAverage' , 'StoreGateSvc+CaloBCIDAverage' ),
-                                             ( 'ILArHVScaleCorr' , 'ConditionStore+LArHVScaleCorrRecomputed' )]
+                                             ( 'CaloBCIDAverage' , 'StoreGateSvc+CaloBCIDAverage' )]
 
     cellMaker = HLTCellMaker(RoIs, algSuffix="RoI")
     topoClusterMaker = _algoHLTTopoCluster(inputEDM = cellMaker.CellsName, algSuffix="RoI")
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py
index 5c05433350f4..4ac4fbc20523 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py
@@ -28,12 +28,6 @@ def fastElectronSequence(ConfigFlags):
     viewVerify.DataObjects += [( 'xAOD::TrigEMClusterContainer' , 'StoreGateSvc+' + CaloMenuDefs.L2CaloClusters ),
                                ( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+'+RoIs )]
 
-    from IOVDbSvc.CondDB import conddb
-    if not conddb.folderRequested( "/PIXEL/DCS/FSMSTATUS"):
-      viewVerify.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATUS' )]
-    if not conddb.folderRequested( "/PIXEL/DCS/FSMSTATE"):
-      viewVerify.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATE' )]
-    
     TrackParticlesName = ""
     for viewAlg in viewAlgs:
         if "InDetTrigTrackParticleCreatorAlg" in viewAlg.name():
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
index bb92b344c250..be042ccaf556 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
@@ -65,12 +65,6 @@ class MinBiasChainConfig(ChainConfigurationBase):
                                            ( 'PixelID' , 'DetectorStore+PixelID' ),
                                            ( 'TagInfo' , 'DetectorStore+ProcessingTags' )]
 
-        from IOVDbSvc.CondDB import conddb
-        if not conddb.folderRequested( '/PIXEL/DCS/FSMSTATE' ):
-          verifier.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATE' )]
-        if not conddb.folderRequested( '/PIXEL/DCS/FSMSTATUS' ):
-          verifier.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATUS' )]
-
         SpList = idAlgs[:-2]
 
         SpCount=TrigCountSpacePointsMT()
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
index 8ba5a2aee278..20ae6f40614b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
@@ -130,11 +130,6 @@ def muCombAlgSequence(ConfigFlags):
     muCombFilterSequence = seqAND("l2muCombFilterSequence", [muonChainFilter, muCombRecoSequence])
 
     extraLoads = []
-    from IOVDbSvc.CondDB import conddb
-    if not conddb.folderRequested( '/PIXEL/DCS/FSMSTATUS' ):
-      extraLoads += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATUS' )]
-    if not conddb.folderRequested( '/PIXEL/DCS/FSMSTATE' ):
-      extraLoads += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATE' )]
 
     for decision in muonChainFilter.InputDecisions:
       extraLoads += [( 'xAOD::TrigCompositeContainer' , 'StoreGateSvc+'+decision )]
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py
index a09d7e2fec79..edc783904320 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py
@@ -142,7 +142,6 @@ def tauCaloSequence(ConfigFlags):
     tauCaloRecoVDV = CfgMgr.AthViews__ViewDataVerifier( "tauCaloRecoVDV" )
     tauCaloRecoVDV.DataObjects = [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+TAUCaloRoIs' ),
                                   ( 'CaloBCIDAverage' , 'StoreGateSvc+CaloBCIDAverage' ),
-                                  ( 'ILArHVScaleCorr' , 'ConditionStore+LArHVScaleCorrRecomputed' ),
                                   ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),
                                   ( 'SG::AuxElement' , 'StoreGateSvc+EventInfo.ActIntPerXDecor' ),
                                   ( 'SG::AuxElement' , 'StoreGateSvc+EventInfo.AveIntPerXDecor' )]
@@ -169,7 +168,6 @@ def tauCaloMVASequence(ConfigFlags):
     tauCaloMVARecoVDV = CfgMgr.AthViews__ViewDataVerifier( "tauCaloMVARecoVDV" )
     tauCaloMVARecoVDV.DataObjects = [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+TAUCaloRoIs' ),
                                      ( 'CaloBCIDAverage' , 'StoreGateSvc+CaloBCIDAverage' ),
-                                     ( 'ILArHVScaleCorr' , 'ConditionStore+LArHVScaleCorrRecomputed' ),
                                      ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),
                                      ( 'SG::AuxElement' , 'StoreGateSvc+EventInfo.ActIntPerXDecor' ),
                                      ( 'SG::AuxElement' , 'StoreGateSvc+EventInfo.AveIntPerXDecor' )]
-- 
GitLab


From 5ecc5d06b3386bdf1eb0319171f2f40b8e374cb8 Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Tue, 22 Sep 2020 10:14:35 -0700
Subject: [PATCH 366/422] #ifndef -> #ifdef for AB

---
 .../Root/MVATrackVertexAssociationTool.cxx                      | 2 +-
 .../TrackVertexAssociationTool/MVATrackVertexAssociationTool.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
index b8793af58a66..50c641ed0fc9 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -25,7 +25,7 @@ namespace CP {
 MVATrackVertexAssociationTool::MVATrackVertexAssociationTool(const std::string& name) :
   AsgTool(name)
 {
-  #ifndef XAOD_STANDALONE
+  #ifdef XAOD_STANDALONE
   declareProperty("NetworkFileName", m_fileName,        "Name of the input lwtnn network file."                                                              );
   declareProperty("InputNames",      m_inputNames,      "Vector of the network's input variable names (std::vector<std::string>)."                           );
   declareProperty("InputTypes",      m_inputTypes,      "Vector of the network's input variable evaluator types (std::vector<CP::MVAEvaluatorInput::Input>).");
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
index 317eb235e9ba..a939afa52e11 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
@@ -66,7 +66,7 @@ private:
   float evaluateNetwork(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const;
 
   // For AnalysisBase
-  #ifndef XAOD_STANDALONE
+  #ifdef XAOD_STANDALONE
 
   // Input lwtnn network file
   std::string m_fileName = "";
-- 
GitLab


From 8241c7e1f40b578d881f5086f8dc7dd6c030b636 Mon Sep 17 00:00:00 2001
From: Peter Van Gemmeren <peter.van.gemmeren@cern.ch>
Date: Tue, 22 Sep 2020 17:31:48 +0000
Subject: [PATCH 367/422] Improve memory for new Athena/ROOT Shared I/O

---
 .../src/AthenaRootSharedWriterSvc.cxx            | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaRootSharedWriterSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaRootSharedWriterSvc.cxx
index 410e4e4742b6..be51bbc79c3f 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaRootSharedWriterSvc.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaRootSharedWriterSvc.cxx
@@ -9,10 +9,12 @@
 
 #include "AthenaRootSharedWriterSvc.h"
 
+#include "TClass.h"
 #include "TFile.h"
 #include "TFileMerger.h"
-#include "TMessage.h"
+#include "TKey.h"
 #include "TMemFile.h"
+#include "TMessage.h"
 #include "TMonitor.h"
 #include "TServerSocket.h"
 #include "TSocket.h"
@@ -47,6 +49,15 @@ struct ParallelFileMerger : public TObject
    {
       fMerger.AddFile(input);
       Bool_t result = fMerger.PartialMerge(TFileMerger::kIncremental | TFileMerger::kResetable | TFileMerger::kKeepCompression);
+      TIter nextKey(input->GetListOfKeys());
+      while (TKey* key = static_cast<TKey*>(nextKey())) {
+         TClass *cl = TClass::GetClass(key->GetClassName());
+         if (0 != cl->GetResetAfterMerge()) {
+            key->Delete();
+            input->GetListOfKeys()->Remove(key);
+            delete key;
+         }
+      }
       return result;
    }
 };
@@ -106,7 +117,7 @@ StatusCode AthenaRootSharedWriterSvc::share(int numClients) {
                m_rootMonitor->Add(client);
                ATH_MSG_INFO("ROOT Monitor add client: " << m_rootClientIndex << ", " << client);
             } else {
-               TMessage* message;
+               TMessage* message = nullptr;
                socket->Recv(message);
                if (message == nullptr) {
                   ATH_MSG_WARNING("ROOT Monitor got no message from socket: " << socket);
@@ -139,6 +150,7 @@ StatusCode AthenaRootSharedWriterSvc::share(int numClients) {
                   }
                   info->MergeTrees(transient.get());
                }
+               delete message; message = nullptr;
             }
          }
       } else if (m_rootMonitor == nullptr) {
-- 
GitLab


From 4c800bf56e3bc5f3f3758de8d5e8e6bc399f1471 Mon Sep 17 00:00:00 2001
From: Nicolas Koehler <nicolas.koehler@cern.ch>
Date: Tue, 22 Sep 2020 17:38:27 +0000
Subject: [PATCH 368/422] Add muon IdDict dictionnaries for Run3 (NSW+BIS78)

---
 .../IdDictMuonSpectrometer_R.09.02.Asym.xml   | 2897 +++++++++++++++++
 .../data/IdDictMuonSpectrometer_R.09.02.xml   | 2746 ++++++++++++++++
 2 files changed, 5643 insertions(+)
 create mode 100755 DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.Asym.xml
 create mode 100755 DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.xml

diff --git a/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.Asym.xml b/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.Asym.xml
new file mode 100755
index 000000000000..993e6f7403fb
--- /dev/null
+++ b/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.Asym.xml
@@ -0,0 +1,2897 @@
+<!-- Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -->
+
+<IdDictionary name="MuonSpectrometer" version="R.09.02.Asym">
+
+  <!--  IdDictionary for asymmetric layout wrt NSW/BIS78: NSW and BIS78 only on Aside, while old small wheel (EI+CSC+TGC4F) and old BIS7 and BIS8 MDTs stay on Cside  -->
+
+  <field name="stationName" >
+    <label name="BIL" value="0" />
+    <label name="BIS" value="1" />
+    <label name="BML" value="2" />
+    <label name="BMS" value="3" />
+    <label name="BOL" value="4" />
+    <label name="BOS" value="5" />
+    <label name="BEE" value="6" />
+    <label name="BIR" value="7" />
+    <label name="BMF" value="8" />
+    <label name="BOF" value="9" />
+    <label name="BOG" value="10" />
+    <label name="BME" value="53" />
+    <label name="EIL" value="13" />
+    <label name="EEL" value="14" />
+    <label name="EES" value="15" />
+    <label name="EML" value="17" />
+    <label name="EMS" value="18" />
+    <label name="EOL" value="20" />
+    <label name="EOS" value="21" />
+    <label name="T1F" value="41" />
+    <label name="T1E" value="42" />
+    <label name="T2F" value="43" />
+    <label name="T2E" value="44" />
+    <label name="T3F" value="45" />
+    <label name="T3E" value="46" />
+    <label name="T4F" value="47" />
+    <label name="T4E" value="48" />
+    <label name="EIS" value="49" />
+    <label name="CSS" value="50" />
+    <label name="CSL" value="51" />
+    <label name="BIM" value="52" />
+    <label name="BMG" value="54" />
+    <label name="MMS" value="55" />
+    <label name="MML" value="56" />
+    <label name="STS" value="57" />
+    <label name="STL" value="58" />
+  </field>
+
+  <field name="technology" >
+    <label name="MDT"  value="0" />
+    <label name="CSC"  value="1" />
+    <label name="RPC"  value="2" />
+    <label name="TGC"  value="3" />
+    <label name="STGC" value="4" />
+    <label name="MM"   value="5" />
+  </field>
+
+     <!--  MDT  -->
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="1 2 3 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="1 2 3 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="4 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="27" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="33" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="27" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="21" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-7" />
+    <range field="stationPhi" minvalue="4" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-7" />
+    <range field="stationPhi" minvalue="1" maxvalue="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-8" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="16" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="7" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="110" />
+  </region>
+
+  
+  <region group="mdt">
+    <range field="stationName" value="BEE" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BEE" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="1" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="3 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="4" maxvalue="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="16" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3"/>
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="4 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="1 2 3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="2" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-2" />
+    <range field="stationPhi" values="1 2 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-2" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" value="0" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="12" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="12" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="2 3 4 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="54" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="42" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="42" />
+  </region>
+  
+   <region group="mdt">
+    <range field="stationName" value="EIS" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="42" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIS" />
+    <range field="stationEta" values="-2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 4 5 6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 4 5 6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+ <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EES" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+    <region group="mdt">
+    <range field="stationName" value="EES" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <!-- BME mdt --> 
+  <region group="mdt">
+    <range field="stationName" value="BME" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="78" />
+  </region>
+
+  <!-- BOE mdt --> 
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+
+   <!-- BMG mdt -->
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-1 1" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+ 
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-2 2" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+ 
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-3 3" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+
+     <!--  CSC  -->
+
+
+  <region group="csc">
+    <range field="stationName" value="CSS" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="CSC" />
+    <range field="chamberLayer" minvalue="2" maxvalue="2" />
+    <range field="wireLayer" minvalue="1" maxvalue="4" />
+    <range field="cscMeasuresPhi" value="0" />
+    <range field="cscStrip" minvalue="1" maxvalue="192" />
+  </region>
+
+  <region group="csc">
+    <range field="stationName" value="CSS" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="CSC" />
+    <range field="chamberLayer" minvalue="2" maxvalue="2" />
+    <range field="wireLayer" minvalue="1" maxvalue="4" />
+    <range field="cscMeasuresPhi" value="1" />
+    <range field="cscStrip" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="csc">
+    <range field="stationName" value="CSL" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="CSC" />
+    <range field="chamberLayer" minvalue="2" maxvalue="2" />
+    <range field="wireLayer" minvalue="1" maxvalue="4" />
+    <range field="cscMeasuresPhi" value="0" />
+    <range field="cscStrip" minvalue="1" maxvalue="192" />
+  </region>
+
+  <region group="csc">
+    <range field="stationName" value="CSL" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="CSC" />
+    <range field="chamberLayer" minvalue="2" maxvalue="2" />
+    <range field="wireLayer" minvalue="1" maxvalue="4" />
+    <range field="cscMeasuresPhi" value="1" />
+    <range field="cscStrip" minvalue="1" maxvalue="48" />
+  </region>
+
+     <!--  RPC  -->
+     <!--  RPC BML  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="1 2" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="1" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="2" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="3 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+ 
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="4 5" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+     <!--  RPC BMS  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2 3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="2" />
+    <range field="doubletZ" minvalue="1" maxvalue="3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" values="1 2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOL  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+     <!--  RPC BOS  -->
+  
+   <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BMF  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOF  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOG  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="0" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <!-- BME rpc --> 
+  <region group="rpc">
+    <range field="stationName" value="BME" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" minvalue="1" maxvalue="2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <!-- BOE rpc --> 
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-8 8" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <!-- BIS rpc -->
+  <region group="rpc">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="7" />
+    <range field="stationPhi"  minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="3" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!-- The following is a dummy region needed to make bit
+     allocation uniform between mdt and rpc down to the technoloy
+     level (region name "dummy" is used to suppress this region
+     from being used other than adjusting the bit allocation) -->
+
+   <region group="rpc" name="dummy" >
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-8 -7 7 8" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  TGC  -->
+
+  <region group="tgc">
+    <range field="stationName" value="T1F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="105" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="92" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="62" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="23" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="125" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="110" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="103" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="122" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="96" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="106" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="31" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4F" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4F" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="21" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="21" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+     <!--  sTGC  -->
+
+  <field name="stgcChannelType" >
+    <label name="sTgcPad"   value="0" />
+    <label name="sTgcStrip" value="1" />
+    <label name="sTgcWire"  value="2" />
+  </field>
+
+     <!--  sTGC  Pads (stgcChannelType=0) -->
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+  
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region> 
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+
+     <!--  sTGC  Strips (stgcChannelType=1) -->
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+     <!--  sTGC  Wire (stgcChannelType=2) -->
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+     <!--  MicroMegas  -->
+
+     <!--  MicroMegas Small Sector -->     
+     <!--  Nominal position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+
+     <!--  Nominal position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+
+
+     <!--  MicroMegas Large Sector -->
+     <!--  Nominal position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+
+     <!--  Nominal position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+
+</IdDictionary>
diff --git a/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.xml b/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.xml
new file mode 100755
index 000000000000..3893e236d5d6
--- /dev/null
+++ b/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.xml
@@ -0,0 +1,2746 @@
+<!-- Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -->
+
+<IdDictionary name="MuonSpectrometer" version="R.09.02">
+
+  <!--  IdDictionary for symmetric layout wrt NSW/BIS78: NSW and BIS78 on both sides, no EI+CSC+TGC4F  -->
+
+  <field name="stationName" >
+    <label name="BIL" value="0" />
+    <label name="BIS" value="1" />
+    <label name="BML" value="2" />
+    <label name="BMS" value="3" />
+    <label name="BOL" value="4" />
+    <label name="BOS" value="5" />
+    <label name="BEE" value="6" />
+    <label name="BIR" value="7" />
+    <label name="BMF" value="8" />
+    <label name="BOF" value="9" />
+    <label name="BOG" value="10" />
+    <label name="BME" value="53" />
+    <label name="EIL" value="13" />
+    <label name="EEL" value="14" />
+    <label name="EES" value="15" />
+    <label name="EML" value="17" />
+    <label name="EMS" value="18" />
+    <label name="EOL" value="20" />
+    <label name="EOS" value="21" />
+    <label name="T1F" value="41" />
+    <label name="T1E" value="42" />
+    <label name="T2F" value="43" />
+    <label name="T2E" value="44" />
+    <label name="T3F" value="45" />
+    <label name="T3E" value="46" />
+    <label name="T4E" value="48" />
+    <label name="BIM" value="52" />
+    <label name="BMG" value="54" />
+    <label name="MMS" value="55" />
+    <label name="MML" value="56" />
+    <label name="STS" value="57" />
+    <label name="STL" value="58" />
+  </field>
+
+  <field name="technology" >
+    <label name="MDT"  value="0" />
+    <label name="CSC"  value="1" />
+    <label name="RPC"  value="2" />
+    <label name="TGC"  value="3" />
+    <label name="STGC" value="4" />
+    <label name="MM"   value="5" />
+  </field>
+
+     <!--  MDT  -->
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="1 2 3 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="1 2 3 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="4 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="27" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="33" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="27" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="21" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="110" />
+  </region>
+
+  
+  <region group="mdt">
+    <range field="stationName" value="BEE" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BEE" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="1" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="3 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="4" maxvalue="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="16" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3"/>
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="4 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="1 2 3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="2" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-2" />
+    <range field="stationPhi" values="1 2 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-2" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" value="0" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="12" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="2 3 4 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="54" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="42" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="42" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 4 5 6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 4 5 6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+ <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EES" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+    <region group="mdt">
+    <range field="stationName" value="EES" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <!-- BME mdt --> 
+  <region group="mdt">
+    <range field="stationName" value="BME" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="78" />
+  </region>
+
+  <!-- BOE mdt --> 
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+
+   <!-- BMG mdt -->
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-1 1" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+ 
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-2 2" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+ 
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-3 3" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+
+     <!--  RPC  -->
+     <!--  RPC BML  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="1 2" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="1" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="2" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="3 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+ 
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="4 5" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+     <!--  RPC BMS  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2 3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="2" />
+    <range field="doubletZ" minvalue="1" maxvalue="3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" values="1 2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOL  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+     <!--  RPC BOS  -->
+  
+   <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BMF  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOF  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOG  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="0" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <!-- BME rpc --> 
+  <region group="rpc">
+    <range field="stationName" value="BME" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" minvalue="1" maxvalue="2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <!-- BOE rpc --> 
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-8 8" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <!-- BIS rpc -->
+  <region group="rpc">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi"  minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="3" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!-- The following is a dummy region needed to make bit
+     allocation uniform between mdt and rpc down to the technoloy
+     level (region name "dummy" is used to suppress this region
+     from being used other than adjusting the bit allocation) -->
+
+   <region group="rpc" name="dummy" >
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-8 -7 7 8" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  TGC  -->
+
+  <region group="tgc">
+    <range field="stationName" value="T1F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="105" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="92" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="62" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="23" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="125" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="110" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="103" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="122" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="96" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="106" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="31" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="21" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="21" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+     <!--  sTGC  -->
+
+  <field name="stgcChannelType" >
+    <label name="sTgcPad"   value="0" />
+    <label name="sTgcStrip" value="1" />
+    <label name="sTgcWire"  value="2" />
+  </field>
+
+     <!--  sTGC  Pads (stgcChannelType=0) -->
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+  
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region> 
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+
+     <!--  sTGC  Strips (stgcChannelType=1) -->
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+     <!--  sTGC  Wire (stgcChannelType=2) -->
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+     <!--  MicroMegas  -->
+
+     <!--  MicroMegas Small Sector -->     
+     <!--  Nominal position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+
+     <!--  Nominal position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+
+
+     <!--  MicroMegas Large Sector -->
+     <!--  Nominal position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+
+     <!--  Nominal position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+
+</IdDictionary>
-- 
GitLab


From d00c64a6feb303f0c678889f3c51dc39ee5934f3 Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Tue, 22 Sep 2020 17:45:12 +0000
Subject: [PATCH 369/422] MdtDriftCircleOnTrackCreator: Reduce log output, use
 unique_ptr

---
 .../MdtDriftCircleOnTrackCreator.h            |  6 +-
 .../src/MdtDriftCircleOnTrackCreator.cxx      | 59 +++++++++----------
 2 files changed, 30 insertions(+), 35 deletions(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h
index 179a04421fce..77f8091767c2 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h
@@ -18,11 +18,12 @@
 #include "MdtCalibSvc/MdtCalibrationDbTool.h"
 #include "TrkEventPrimitives/LocalParameters.h"
 #include "TrkSpaceTimePoint/SpaceTimePoint.h"
+#include "MdtCalibSvc/MdtCalibrationSvcSettings.h"
 
 #include <bitset>
 #include <string>
+#include <memory>
 
-class MdtCalibrationSvcSettings;
 class MdtCalibrationSvcInput;
 
 namespace Muon {
@@ -72,7 +73,6 @@ namespace Muon {
       MdtDriftCircleOnTrackCreator(const std::string&,const std::string&,const IInterface*);
       virtual ~MdtDriftCircleOnTrackCreator()=default;
       virtual StatusCode initialize();
-      virtual StatusCode finalize();
 
       /** @brief Calibrate a MdtPrepData object. The result is stored in a new MdtDriftCircleOnTrack object.
       Included calibrations:
@@ -201,7 +201,7 @@ namespace Muon {
       double                               m_fixedError; //!< Error used when m_doFixed error =true or m_scaleErrorManually = true
       double                               m_globalToLocalTolerance; 
       
-      MdtCalibrationSvcSettings*           m_mdtCalibSvcSettings; 
+      std::unique_ptr<MdtCalibrationSvcSettings>           m_mdtCalibSvcSettings; 
 
       // Member variables used to fill the default error strategy
       MuonDriftCircleErrorStrategy        m_errorStrategy; //!< Error strategy for created ROTs
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx
index 22b742b84736..d7d7affb396f 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx
@@ -3,8 +3,6 @@
 */
 
 #include "MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h"
-
-#include "MdtCalibSvc/MdtCalibrationSvcSettings.h"
 #include "MdtCalibSvc/MdtCalibrationSvcInput.h"
 #include "MdtCalibData/MdtRtRelation.h"
 #include "MdtCalibData/MdtFullCalibData.h"
@@ -25,13 +23,10 @@
 
 Muon::MdtDriftCircleOnTrackCreator::MdtDriftCircleOnTrackCreator(const std::string& ty,const std::string& na,const IInterface* pa) :
     AthAlgTool(ty,na,pa),
-    m_mdtCalibSvcSettings(nullptr),
+    m_mdtCalibSvcSettings(new MdtCalibrationSvcSettings()), // create calibration service settings 
     m_errorStrategy(Muon::MuonDriftCircleErrorStrategyInput())
 {
-  // create calibration service settings 
-  m_mdtCalibSvcSettings = new MdtCalibrationSvcSettings();
-  
-  // algtool interface - necessary!
+    // algtool interface - necessary!
   declareInterface<IMdtDriftCircleOnTrackCreator>(this);
   declareInterface<IRIO_OnTrackCreator>(this);
   
@@ -102,26 +97,31 @@ StatusCode Muon::MdtDriftCircleOnTrackCreator::initialize()
     // By default use one of the real strategies - don't default to unknown!
     m_errorStrategy.setStrategy(MuonDriftCircleErrorStrategy::Muon);
   }
-  ATH_MSG_INFO("Constructed default MuonDriftCircleErrorStrategy: ");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::BroadError ) ) ATH_MSG_INFO(" Broad");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ScaledError ) ) ATH_MSG_INFO(" Scaled"); 
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::FixedError ) ) ATH_MSG_INFO(" Fixed");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ParameterisedErrors ) ) ATH_MSG_INFO(" Parm");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::StationError ) ) ATH_MSG_INFO(" Station");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ErrorAtPredictedPosition ) ) ATH_MSG_INFO(" ErrAtPos");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::T0Refit ) ) ATH_MSG_INFO(" T0");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::WireSagGeomCorrection ) ) ATH_MSG_INFO(" WireG");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::TofCorrection ) ) ATH_MSG_INFO(" TOF");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::PropCorrection ) ) ATH_MSG_INFO(" Prop");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::TempCorrection ) ) ATH_MSG_INFO(" Temp");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::MagFieldCorrection ) ) ATH_MSG_INFO(" Mag");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::WireSagTimeCorrection ) ) ATH_MSG_INFO(" WireT");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::SlewCorrection ) ) ATH_MSG_INFO(" Slew");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::BackgroundCorrection ) ) ATH_MSG_INFO(" Back");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::Segment ) ) ATH_MSG_INFO(" Seg");
-  
-  if( !m_isMC && m_looseErrors )  ATH_MSG_INFO( "Using Data Loose error tuning");
-  if( !m_isMC && !m_looseErrors ) ATH_MSG_INFO( "Using Data Tight error tuning");
+  if (msgLevel(MSG::INFO)) {
+    std::stringstream ss;
+    ss << "Constructed default MuonDriftCircleErrorStrategy:";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::BroadError ) ) ss << " Broad";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ScaledError ) ) ss << " Scaled"; 
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::FixedError ) ) ss << " Fixed";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ParameterisedErrors ) ) ss << " Parm";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::StationError ) ) ss << " Station";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ErrorAtPredictedPosition ) ) ss << " ErrAtPos";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::T0Refit ) ) ss << " T0";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::WireSagGeomCorrection ) ) ss << " WireG";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::TofCorrection ) ) ss << " TOF";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::PropCorrection ) ) ss << " Prop";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::TempCorrection ) ) ss << " Temp";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::MagFieldCorrection ) ) ss << " Mag";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::WireSagTimeCorrection ) ) ss << " WireT";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::SlewCorrection ) ) ss << " Slew";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::BackgroundCorrection ) ) ss << " Back";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::Segment ) ) ss << " Seg";
+    ss << ". ";
+    if( !m_isMC && m_looseErrors )  ss << "Using Data Loose error tuning";
+    if( !m_isMC && !m_looseErrors ) ss <<  "Using Data Tight error tuning";
+
+    msg(MSG::INFO) << ss.str() << endmsg;
+  }
   if( m_isMC )                    ATH_MSG_INFO( "Using MC error tuning");
   ATH_MSG_VERBOSE( "A correction is made if set to true: do_MDT = " << m_doMdt ); 
   
@@ -141,11 +141,6 @@ StatusCode Muon::MdtDriftCircleOnTrackCreator::initialize()
   return StatusCode::SUCCESS; 
 } 
 
-StatusCode Muon::MdtDriftCircleOnTrackCreator::finalize()
-{
-  delete m_mdtCalibSvcSettings;
-  return AthAlgTool::finalize(); 
-}
 
 Muon::MdtDriftCircleOnTrack* Muon::MdtDriftCircleOnTrackCreator::createRIO_OnTrack( 
                                                                                          const MdtPrepData& mdtPrd,
-- 
GitLab


From b44bdae46bf285ab6d328d56fd96d7f4d94cc8a0 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Tue, 22 Sep 2020 20:15:28 +0200
Subject: [PATCH 370/422] updated ref files

---
 .../TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref    | 3 +++
 .../TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index a4bf9b02d095..5b6bf1006e68 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -115,6 +115,9 @@ TrigSignatureMoniMT                                 INFO -- #1834383636 Features
 TrigSignatureMoniMT                                 INFO HLT_5j70_0eta240_L14J20 #1175391812
 TrigSignatureMoniMT                                 INFO -- #1175391812 Events         7          7          0          0          0          0          0          0          0          0          0          1          -          -          1
 TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          5          -          -
+TrigSignatureMoniMT                                 INFO HLT_alfacalib_AlfaPEB_L1ALFA_ANY #4094852824
+TrigSignatureMoniMT                                 INFO -- #4094852824 Events         0          0          0          -          -          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #4094852824 Features                             0          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_beamspot_allTE_trkfast_BeamSpotPEB_L1J15 #3989372080
 TrigSignatureMoniMT                                 INFO -- #3989372080 Events         20         20         20         20         -          -          -          -          -          -          -          -          -          -          20
 TrigSignatureMoniMT                                 INFO -- #3989372080 Features                             20         20         -          -          -          -          -          -          -          -          -          -
diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
index 19caee227831..6047fbdf7596 100644
--- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
@@ -115,6 +115,9 @@ TrigSignatureMoniMT                                 INFO -- #1834383636 Features
 TrigSignatureMoniMT                                 INFO HLT_5j70_0eta240_L14J20 #1175391812
 TrigSignatureMoniMT                                 INFO -- #1175391812 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_alfacalib_AlfaPEB_L1ALFA_ANY #4094852824
+TrigSignatureMoniMT                                 INFO -- #4094852824 Events         20         20         20         -          -          -          -          -          -          -          -          -          -          -          20         
+TrigSignatureMoniMT                                 INFO -- #4094852824 Features                             20         -          -          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_beamspot_allTE_trkfast_BeamSpotPEB_L1J15 #3989372080
 TrigSignatureMoniMT                                 INFO -- #3989372080 Events         20         20         20         20         -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #3989372080 Features                             20         20         -          -          -          -          -          -          -          -          -          -          
-- 
GitLab


From 3580c1053576aa5494e528cf56de18272f760c38 Mon Sep 17 00:00:00 2001
From: lbazzano <lisandro.tomas.bazzano.hurrell@cern.ch>
Date: Tue, 22 Sep 2020 20:18:37 +0200
Subject: [PATCH 371/422] Added ghost area as a new variable of Constituent
 Subtraction

---
 .../Jet/JetRecTools/JetRecTools/ConstituentSubtractorTool.h    | 1 +
 .../Jet/JetRecTools/Root/ConstituentSubtractorTool.cxx         | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Reconstruction/Jet/JetRecTools/JetRecTools/ConstituentSubtractorTool.h b/Reconstruction/Jet/JetRecTools/JetRecTools/ConstituentSubtractorTool.h
index de414b56a703..84ffc633a302 100644
--- a/Reconstruction/Jet/JetRecTools/JetRecTools/ConstituentSubtractorTool.h
+++ b/Reconstruction/Jet/JetRecTools/JetRecTools/ConstituentSubtractorTool.h
@@ -35,6 +35,7 @@ private:
 
   float m_maxDeltaR;
   float m_alpha;
+  float m_ghostArea;
   float m_maxEta;
   bool m_ignoreChargedPFOs;
 
diff --git a/Reconstruction/Jet/JetRecTools/Root/ConstituentSubtractorTool.cxx b/Reconstruction/Jet/JetRecTools/Root/ConstituentSubtractorTool.cxx
index 857d9f1f908e..63f69e7f8abb 100644
--- a/Reconstruction/Jet/JetRecTools/Root/ConstituentSubtractorTool.cxx
+++ b/Reconstruction/Jet/JetRecTools/Root/ConstituentSubtractorTool.cxx
@@ -20,6 +20,7 @@ ConstituentSubtractorTool::ConstituentSubtractorTool(const std::string & name):
 
   declareProperty("MaxDeltaR", m_maxDeltaR=0.25);
   declareProperty("Alpha", m_alpha=0.);
+  declareProperty("GhostArea", m_ghostArea=0.01);
   declareProperty("MaxEta", m_maxEta=2.5);
 
   // Option to disregard cPFOs in the weight calculation
@@ -51,7 +52,7 @@ StatusCode ConstituentSubtractorTool::process_impl(xAOD::IParticleContainer* con
   contrib::ConstituentSubtractor subtractor;
   subtractor.set_max_standardDeltaR(m_maxDeltaR); // free parameter for the maximal allowed distance sqrt((y_i-y_k)^2+(phi_i-phi_k)^2) between particle i and ghost k
   subtractor.set_alpha(m_alpha);  // free parameter for the distance measure (the exponent of particle pt). The larger the parameter alpha, the more are favoured the lower pt particles in the subtraction process
-  subtractor.set_ghost_area(0.01); // free parameter for the density of ghosts. The smaller, the better - but also the computation is slower.
+  subtractor.set_ghost_area(m_ghostArea); // free parameter for the density of ghosts. The smaller, the better - but also the computation is slower.
 
   // prepare PseudoJet input from
   std::vector<PseudoJet>  full_event; full_event.reserve( cont->size() );
-- 
GitLab


From 2c8716213f8572257d67dc2c6ef4e84e92298cf7 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch>
Date: Tue, 22 Sep 2020 18:49:01 +0000
Subject: [PATCH 372/422] Migration of GeneratorObjectsTPCnv to HePMC3, part I

---
 .../GeneratorObjects/McEventDict.h            |  5 ++
 .../src/GenEventCnv_p1.cxx                    | 36 ++++++++
 .../src/McEventCollectionCnv_p2.cxx           | 88 +++++++++++++++++++
 .../src/McEventCollectionCnv_p3.cxx           | 61 +++++++++++++
 .../src/McEventCollectionCnv_utils.h          |  2 +-
 5 files changed, 191 insertions(+), 1 deletion(-)

diff --git a/Generators/GeneratorObjects/GeneratorObjects/McEventDict.h b/Generators/GeneratorObjects/GeneratorObjects/McEventDict.h
index 58b8b0605e44..3b6701b3e82f 100644
--- a/Generators/GeneratorObjects/GeneratorObjects/McEventDict.h
+++ b/Generators/GeneratorObjects/GeneratorObjects/McEventDict.h
@@ -13,6 +13,7 @@
 #include "GeneratorObjects/HijingEventParams.h"
 #include "RootUtils/PyROOTIteratorFuncs.h"
 
+#include "AtlasHepMC/GenEvent.h"
 namespace GeneratorObjectsMcEventDict {
   
   struct tmp {
@@ -25,8 +26,12 @@ namespace GeneratorObjectsMcEventDict {
     std::iterator<std::forward_iterator_tag,HepMC::GenVertex*,int,HepMC::GenVertex**,HepMC::GenVertex*&> m_1;
     std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,int,HepMC::GenParticle**,HepMC::GenParticle*&> m_2;
     
+#ifdef HEPMC3 
+    RootUtils::PyROOTIteratorFuncs<std::vector<HepMC::GenVertex>::const_iterator> m_it;
+#else    
     RootUtils::PyROOTIteratorFuncs<
       HepMC::GenVertex::particles_out_const_iterator> m_it;
+#endif
   };
 
 }
diff --git a/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx b/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx
index fd88e5a0df01..ea04b2c8fd0a 100755
--- a/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx
@@ -62,6 +62,16 @@ void GenEventCnv_p1::persToTrans( const GenEvent_p1* persObj,
     m_pool->part.reserve( m_pool->part.allocated() + nParts );
   }
 
+#ifdef HEPMC3
+  transObj->add_attribute("signal_process_id",std::make_shared<HepMC3::IntAttribute>(persObj->m_signalProcessId ));
+  transObj->set_event_number(persObj->m_eventNbr);
+  transObj->add_attribute("event_scale",std::make_shared<HepMC3::DoubleAttribute>(persObj->m_eventScale));
+  transObj->add_attribute("alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(persObj->m_alphaQCD));
+  transObj->add_attribute("alphaQED",std::make_shared<HepMC3::DoubleAttribute>(persObj->m_alphaQED));
+  transObj->weights()= persObj->m_weights;
+  transObj->add_attribute("random_states",std::make_shared<HepMC3::VectorLongIntAttribute>(persObj->m_randomStates));
+
+#else  
   transObj->set_signal_process_id( persObj->m_signalProcessId );
   transObj->set_event_number( persObj->m_eventNbr );
   transObj->set_event_scale ( persObj->m_eventScale );
@@ -78,6 +88,7 @@ void GenEventCnv_p1::persToTrans( const GenEvent_p1* persObj,
 
   transObj->m_pdf_info = 0;         //> not available at that time...
 
+#endif
   // create a temporary map associating the barcode of an end-vtx to its 
   // particle.
   // As not all particles are stable (d'oh!) we take 50% of the number of
@@ -142,6 +153,12 @@ GenEventCnv_p1::createGenVertex( const GenEvent_p1& persEvt,
 				 const GenVertex_p1& persVtx,
 				 ParticlesMap_t& partToEndVtx ) const
 {
+#ifdef HEPMC3
+  HepMC::GenVertexPtr vtx = *(m_pool->vtx.nextElementPtr());
+  vtx->set_position( HepMC::FourVector(persVtx.m_x,persVtx.m_y,persVtx.m_z,persVtx.m_t) );
+  vtx->add_attribute("weights",std::make_shared<HepMC3::VectorDoubleAttribute>(persVtx.m_weights));
+  vtx->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persVtx.m_barcode));
+#else
   HepMC::GenVertexPtr vtx = m_pool->vtx.nextElementPtr();
   vtx->m_position.setX( persVtx.m_x );
   vtx->m_position.setY( persVtx.m_y );
@@ -153,6 +170,7 @@ GenEventCnv_p1::createGenVertex( const GenEvent_p1& persEvt,
   vtx->m_weights = persVtx.m_weights;
   vtx->m_event   = 0;
   vtx->m_barcode = persVtx.m_barcode;
+#endif
   
   // handle the in-going (orphans) particles
   const unsigned int nPartsIn = persVtx.m_particlesIn.size();
@@ -175,6 +193,23 @@ HepMC::GenParticlePtr
 GenEventCnv_p1::createGenParticle( const GenParticle_p1& persPart,
 				   ParticlesMap_t& partToEndVtx ) const
 {
+#ifdef HEPMC3
+  HepMC::GenParticlePtr p = *(m_pool->part.nextElementPtr());
+  p->set_momentum( HepMC::FourVector(persPart.m_px,persPart.m_py,persPart.m_pz,persPart.m_ene));
+  p->set_pdg_id(persPart.m_pdgId);
+  p->set_status(persPart.m_status);
+  p->add_attribute("phi",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_phiPolarization));
+  p->add_attribute("theta",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_thetaPolarization));
+  p->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persPart.m_barcode));
+  // fillin' the flow
+  std::vector<int> flows;
+  const unsigned int nFlow = persPart.m_flow.size();
+  for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
+  flows.push_back(persPart.m_flow[iFlow].second );
+  }
+  //We construct it here as vector w/o gaps.
+  p->add_attribute("flows", std::make_shared<HepMC3::VectorIntAttribute>(flows));
+#else
 
 
   HepMC::GenParticlePtr p = m_pool->part.nextElementPtr();
@@ -196,6 +231,7 @@ GenEventCnv_p1::createGenParticle( const GenParticle_p1& persPart,
     p->m_flow.set_icode( persPart.m_flow[iFlow].first, 
 			 persPart.m_flow[iFlow].second );
   }
+#endif
 
   if ( persPart.m_endVtx != 0 ) {
     partToEndVtx[p] = persPart.m_endVtx;
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx
index aa4cb45c00db..2c18a9775d96 100755
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx
@@ -79,6 +79,46 @@ void McEventCollectionCnv_p2::persToTrans( const McEventCollection_p2* persObj,
         ++itr ) {
     const GenEvent_p2& persEvt = *itr;
     HepMC::GenEvent * genEvt        = poolOfEvents.nextElementPtr();
+#ifdef HEPMC3
+    genEvt->add_attribute("signal_process_id",std::make_shared<HepMC3::IntAttribute>(persEvt.m_signalProcessId));
+    genEvt->set_event_number(persEvt.m_eventNbr);
+    genEvt->add_attribute("event_scale",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_eventScale));
+    genEvt->add_attribute("alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQCD));
+    genEvt->add_attribute("alphaQED",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQED));
+    genEvt->weights()= persEvt.m_weights;
+    genEvt->add_attribute("random_states",std::make_shared<HepMC3::VectorLongIntAttribute>(persEvt.m_randomStates));
+
+    transObj->push_back( genEvt );
+
+    // create a temporary map associating the barcode of an end-vtx to its
+    // particle.
+    // As not all particles are stable (d'oh!) we take 50% of the number of
+    // particles as an initial size of the hash-map (to prevent re-hash)
+    ParticlesMap_t partToEndVtx( (persEvt.m_particlesEnd-persEvt.m_particlesBegin)/2 );
+
+    // create the vertices
+    const unsigned int endVtx = persEvt.m_verticesEnd;
+    for ( unsigned int iVtx= persEvt.m_verticesBegin; iVtx != endVtx; ++iVtx ) {
+      genEvt->add_vertex( createGenVertex( *persObj,
+                                           persObj->m_genVertices[iVtx],
+                                           partToEndVtx,
+                                           &datapools ) );
+    } //> end loop over vertices
+
+    // set the signal process vertex
+    const int sigProcVtx = persEvt.m_signalProcessVtx;
+    if ( sigProcVtx ) HepMC::set_signal_process_vertex(genEvt, HepMC::barcode_to_vertex(genEvt, sigProcVtx ) );
+
+    // connect particles to their end vertices
+    for ( auto p:  partToEndVtx) {
+      auto decayVtx = HepMC::barcode_to_vertex(genEvt, p.second );
+      if ( decayVtx ) {
+        decayVtx->add_particle_in( p.first );
+      } else {
+        msg << MSG::ERROR<< "GenParticle points to null end vertex !!"<< endmsg;
+      }
+    }
+#else
     genEvt->m_signal_process_id     = persEvt.m_signalProcessId;
     genEvt->m_event_number          = persEvt.m_eventNbr;
     genEvt->m_event_scale           = persEvt.m_eventScale;
@@ -129,6 +169,7 @@ void McEventCollectionCnv_p2::persToTrans( const McEventCollection_p2* persObj,
             << endmsg;
       }
     }
+#endif    
   } //> end loop over m_genEvents
 
   msg << MSG::DEBUG << "Loaded McEventCollection from persistent state [OK]"
@@ -160,6 +201,31 @@ McEventCollectionCnv_p2::createGenVertex( const McEventCollection_p2& persEvt,
                                           const GenVertex_p2& persVtx,
                                           ParticlesMap_t& partToEndVtx, HepMC::DataPool* datapools ) const
 {
+#ifdef HEPMC3
+  DataPool<HepMC::GenVertexPtr>& poolOfVertices = datapools->vtx;
+  HepMC::GenVertexPtr vtx = *(poolOfVertices.nextElementPtr());
+  vtx->set_position( HepMC::FourVector(persVtx.m_x,persVtx.m_y, persVtx.m_z, persVtx.m_t) );
+  //AV ID cannot be assigned in HepMC3. And its meaning in HepMC2 is not clear.
+  // vtx->m_id      = persVtx.m_id;
+  vtx->add_attribute("weights",std::make_shared<HepMC3::VectorFloatAttribute>(persVtx.m_weights));
+  vtx->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persVtx.m_barcode));
+
+  // handle the in-going (orphans) particles
+  const unsigned int nPartsIn = persVtx.m_particlesIn.size();
+  for ( unsigned int i = 0; i != nPartsIn; ++i ) {
+    createGenParticle( persEvt.m_genParticles[persVtx.m_particlesIn[i]],
+                       partToEndVtx,
+                       datapools );
+  }
+
+  // now handle the out-going particles
+  const unsigned int nPartsOut = persVtx.m_particlesOut.size();
+  for ( unsigned int i = 0; i != nPartsOut; ++i ) {
+    vtx->add_particle_out( createGenParticle( persEvt.m_genParticles[persVtx.m_particlesOut[i]],
+                                              partToEndVtx,
+                                              datapools ) );
+  }
+#else
   DataPool<HepMC::GenVertex>& poolOfVertices = datapools->vtx;
   HepMC::GenVertexPtr vtx = poolOfVertices.nextElementPtr();
   vtx->m_position.setX( persVtx.m_x );
@@ -190,6 +256,7 @@ McEventCollectionCnv_p2::createGenVertex( const McEventCollection_p2& persEvt,
                                               partToEndVtx,
                                               datapools ) );
   }
+#endif
 
   return vtx;
 }
@@ -198,6 +265,26 @@ HepMC::GenParticlePtr
 McEventCollectionCnv_p2::createGenParticle( const GenParticle_p2& persPart,
                                             ParticlesMap_t& partToEndVtx, HepMC::DataPool* datapools ) const
 {
+#ifdef HEPMC3
+  DataPool<HepMC::GenParticlePtr>& poolOfParticles = datapools->part;
+  HepMC::GenParticlePtr p    = *(poolOfParticles.nextElementPtr());
+  p->set_momentum( HepMC::FourVector(persPart.m_px,persPart.m_py,persPart.m_pz, persPart.m_ene ));
+  p->set_pdg_id(               persPart.m_pdgId);
+  p->set_status(               persPart.m_status);
+  p->add_attribute("phi",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_phiPolarization));
+  p->add_attribute("theta",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_thetaPolarization));
+  p->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persPart.m_barcode));
+
+  // fillin' the flow
+  std::vector<int> flows;
+  const unsigned int nFlow = persPart.m_flow.size();
+  for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
+  flows.push_back(persPart.m_flow[iFlow].second );
+  }
+  //We construct it here as vector w/o gaps.
+  p->add_attribute("flows", std::make_shared<HepMC3::VectorIntAttribute>(flows));
+  
+#else
   DataPool<HepMC::GenParticle>& poolOfParticles = datapools->part;
   HepMC::GenParticlePtr p    = poolOfParticles.nextElementPtr();
   p->m_momentum.setPx( persPart.m_px  );
@@ -218,6 +305,7 @@ McEventCollectionCnv_p2::createGenParticle( const GenParticle_p2& persPart,
     p->m_flow.set_icode( persPart.m_flow[iFlow].first,
                          persPart.m_flow[iFlow].second );
   }
+#endif
 
   if ( persPart.m_endVtx != 0 ) {
     partToEndVtx[p] = persPart.m_endVtx;
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx
index 6a6383de3e96..950c671058a0 100755
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx
@@ -83,6 +83,16 @@ void McEventCollectionCnv_p3::persToTrans( const McEventCollection_p3* persObj,
     const GenEvent_p3& persEvt = *itr;
 
     HepMC::GenEvent * genEvt        = poolOfEvents.nextElementPtr();
+#ifdef HEPMC3
+    genEvt->add_attribute("signal_process_id",std::make_shared<HepMC3::IntAttribute>(persEvt.m_signalProcessId));
+    genEvt->set_event_number(persEvt.m_eventNbr);
+    genEvt->add_attribute("event_scale",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_eventScale));
+    genEvt->add_attribute("alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQCD));
+    genEvt->add_attribute("alphaQED",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQED));
+    genEvt->weights()= persEvt.m_weights;
+    genEvt->add_attribute("random_states",std::make_shared<HepMC3::VectorLongIntAttribute>(persEvt.m_randomStates));
+
+#else
     genEvt->m_signal_process_id     = persEvt.m_signalProcessId;
     genEvt->m_event_number          = persEvt.m_eventNbr;
     genEvt->m_event_scale           = persEvt.m_eventScale;
@@ -94,6 +104,7 @@ void McEventCollectionCnv_p3::persToTrans( const McEventCollection_p3* persObj,
     genEvt->m_vertex_barcodes.clear();
     genEvt->m_particle_barcodes.clear();
     genEvt->m_pdf_info = 0;         //> not available at that time...
+#endif
 
     transObj->push_back( genEvt );
 
@@ -163,6 +174,16 @@ McEventCollectionCnv_p3::createGenVertex( const McEventCollection_p3& persEvt,
                                           ParticlesMap_t& partToEndVtx,
                                           HepMC::DataPool* datapools ) const
 {
+
+#ifdef HEPMC3
+  DataPool<HepMC::GenVertexPtr>& poolOfVertices = datapools->vtx;
+  HepMC::GenVertexPtr vtx=*(poolOfVertices.nextElementPtr());
+  vtx->set_position( HepMC::FourVector(persVtx.m_x,persVtx.m_y,persVtx.m_z,persVtx.m_t) );
+  //AV ID cannot be assigned in HepMC3. And its meaning in HepMC2 is not clear.
+  // vtx->m_id      = persVtx.m_id;
+  vtx->add_attribute("weights",std::make_shared<HepMC3::VectorFloatAttribute>(persVtx.m_weights));
+  vtx->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persVtx.m_barcode));
+#else
   DataPool<HepMC::GenVertex>& poolOfVertices = datapools->vtx;
   HepMC::GenVertexPtr vtx = poolOfVertices.nextElementPtr();
   vtx->m_position.setX( persVtx.m_x );
@@ -177,6 +198,7 @@ McEventCollectionCnv_p3::createGenVertex( const McEventCollection_p3& persEvt,
                                     persVtx.m_weights.end() );
   vtx->m_event   = 0;
   vtx->m_barcode = persVtx.m_barcode;
+#endif
 
   // handle the in-going (orphans) particles
   const unsigned int nPartsIn = persVtx.m_particlesIn.size();
@@ -202,6 +224,44 @@ McEventCollectionCnv_p3::createGenParticle( const GenParticle_p3& persPart,
                                             ParticlesMap_t& partToEndVtx,
                                             HepMC::DataPool* datapools ) const
 {
+
+#ifdef HEPMC3
+  DataPool<HepMC::GenParticlePtr>& poolOfParticles = datapools->part;
+  HepMC::GenParticlePtr p    = *(poolOfParticles.nextElementPtr());
+  p->set_pdg_id(persPart.m_pdgId);
+  p->set_status(persPart.m_status);
+  // Note: do the E calculation in extended (long double) precision.
+  // That happens implicitly on x86 with optimization on; saying it
+  // explicitly ensures that we get the same results with and without
+  // optimization.  (If this is a performance issue for platforms
+  // other than x86, one could change to double for those platforms.)
+  double temp_e=0.0;
+  if ( 0 == persPart.m_recoMethod ) {
+    temp_e = std::sqrt( (long double)(persPart.m_px)*persPart.m_px +
+                          (long double)(persPart.m_py)*persPart.m_py +
+                          (long double)(persPart.m_pz)*persPart.m_pz +
+                          (long double)(persPart.m_m) *persPart.m_m );
+  } else {
+    const int signM2 = ( persPart.m_m >= 0. ? 1 : -1 );
+    const double persPart_ene =
+      std::sqrt( std::abs((long double)(persPart.m_px)*persPart.m_px +
+                (long double)(persPart.m_py)*persPart.m_py +
+                (long double)(persPart.m_pz)*persPart.m_pz +
+                signM2* (long double)(persPart.m_m)* persPart.m_m));
+    const int signEne = ( persPart.m_recoMethod == 1 ? 1 : -1 );
+    temp_e=signEne * persPart_ene;
+  }
+  p->set_momentum(HepMC::FourVector(persPart.m_px,persPart.m_py,persPart.m_pz,temp_e));
+  // setup flow
+  // fillin' the flow
+  std::vector<int> flows;
+  const unsigned int nFlow = persPart.m_flow.size();
+  for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
+  flows.push_back(persPart.m_flow[iFlow].second );
+  }
+  //We construct it here as vector w/o gaps.
+  p->add_attribute("flows", std::make_shared<HepMC3::VectorIntAttribute>(flows));
+#else
   DataPool<HepMC::GenParticle>& poolOfParticles = datapools->part;
   HepMC::GenParticlePtr p    = poolOfParticles.nextElementPtr();
   p->m_pdg_id              = persPart.m_pdgId;
@@ -246,6 +306,7 @@ McEventCollectionCnv_p3::createGenParticle( const GenParticle_p3& persPart,
     p->m_flow.set_icode( persPart.m_flow[iFlow].first,
                          persPart.m_flow[iFlow].second );
   }
+#endif
 
   if ( persPart.m_endVtx != 0 ) {
     partToEndVtx[p] = persPart.m_endVtx;
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
index 982693b593a1..30b519f17a39 100644
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
@@ -20,4 +20,4 @@ namespace {
 
     return std::make_pair( nParts, nVerts );
   }
-}
\ No newline at end of file
+}
-- 
GitLab


From 8de3ee96205d69c35f9e2e0e5e216beb5c724a77 Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Tue, 22 Sep 2020 21:42:35 +0200
Subject: [PATCH 373/422] fixed output of ClusterMeanPresamplerFrac function +
 removed unneccesary cut on dR in the FirstEngDensOver function

---
 Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index bafc43445152..0d89c334089f 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -331,12 +331,7 @@ bool ClustersMeanFirstEngDens(const xAOD::TauJet &tau, double &out){
 bool ClustersMeanPresamplerFrac(const xAOD::TauJet &tau, double &out){
   float ClustersMeanPresamplerFrac;
   const auto success = tau.detail(TauDetail::ClustersMeanPresamplerFrac, ClustersMeanPresamplerFrac);
-  out = ClustersMeanPresamplerFrac;
-
-  if (std::isnan(std::abs(out))){
-	out = 0.;
-  }
-  out = std::max(0., out);
+  out = std::max(0.f, ClustersMeanPresamplerFrac);
 
   return success;
 }
@@ -562,7 +557,6 @@ bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const
     cls = clusters[i];
 
     TLorentzVector cluster_P4 = cls->p4(xAOD::CaloCluster::State::CALIBRATED);
-    if(LC_P4.DeltaR(cluster_P4)>dRCut)            continue;
     Etot += cls->calE();
   }
 	
-- 
GitLab


From 1e101d1b79181a89e38341c370aaba8640ff6427 Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Tue, 22 Sep 2020 12:48:57 -0700
Subject: [PATCH 374/422] Also fix directive around finalize :'(

---
 .../Root/MVATrackVertexAssociationTool.cxx                      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
index 50c641ed0fc9..1875bc927549 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -75,7 +75,7 @@ StatusCode MVATrackVertexAssociationTool::initialize() {
   return StatusCode::SUCCESS;
 }
 
-#ifndef XAOD_STANDALONE
+#ifdef XAOD_STANDALONE
 StatusCode MVATrackVertexAssociationTool::finalize() {
   ATH_MSG_INFO("Finalizing MVATrackVertexAssociationTool.");
   return StatusCode::SUCCESS;
-- 
GitLab


From e53a10468fdd70d09e55dc3d0266b06fed19c108 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 22 Sep 2020 19:57:17 +0200
Subject: [PATCH 375/422] AthAnalysisBaseComps: Fix
 AthAnalysisHelper::setProperty.

AthAnalysisHelper::setProperty was changed from
IJobOptionsSvc::addPropertyToCatalogue to IOptionsSvc::set.
However, the functionality is not identical.
When settingg a string property, the old interface would strip off
quotes surrounding the value; the new interface does not do this.
Further, the code in AthAnalysisHelper would uncoditionally use
Gaudi::Utils;:toString, which adds quotes around values
which are strings.

So if we have something convertible to a string, don't use toString().
---
 .../AthAnalysisBaseComps/AthAnalysisHelper.h     | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h b/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
index 51707fde53be..b0f8645d292f 100644
--- a/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
+++ b/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
@@ -31,6 +31,8 @@
 
 #include "GaudiKernel/ToolHandle.h"
 
+#include <type_traits>
+
 class AthAnalysisHelper { //thought about being a namespace but went for static methods instead, in case I want private data members in future
 
 public:
@@ -55,7 +57,19 @@ public:
         return StatusCode::FAILURE;
       }
      }
-     joSvc->set( name+"."+property , Gaudi::Utils::toString ( value ) );
+
+     if constexpr (std::is_convertible<W, std::string>::value) {
+       // If value is already convertible to a string, don't use toString().
+       // Otherwise, toString() will add quotes around the string,
+       // which confuses things further on.
+       // (These quotes used to be removed by the old 
+       // IJobOptionsSvc::addPropertyToCatalogue interface, but IOptionsSvc::set
+       // doesn't do that.)
+       joSvc->set( name+"."+property , std::string (value) );
+     }
+     else {
+       joSvc->set( name+"."+property , Gaudi::Utils::toString ( value ) );
+     }
      return StatusCode::SUCCESS;
    }
    
-- 
GitLab


From 98351e9a01a3b161d17a9e01bd9c760aa141a158 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 16 Sep 2020 19:47:52 -0400
Subject: [PATCH 376/422] EventInfoUtils: Enable thread-safety checking.

Enable thread-safety checking.
---
 Event/EventInfoUtils/EventInfoUtils/ATLAS_CHECK_THREAD_SAFETY | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 Event/EventInfoUtils/EventInfoUtils/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Event/EventInfoUtils/EventInfoUtils/ATLAS_CHECK_THREAD_SAFETY b/Event/EventInfoUtils/EventInfoUtils/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..d37d44670034
--- /dev/null
+++ b/Event/EventInfoUtils/EventInfoUtils/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Event/EventInfoUtils
-- 
GitLab


From b72f262b955bf5bf4660b1db773423fe1b468046 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 17 Sep 2020 16:23:13 -0400
Subject: [PATCH 377/422] InDetByteStreamErrors: cmake fixes

Library dependency fixes.
---
 .../InDetByteStreamErrors/CMakeLists.txt             | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrors/CMakeLists.txt b/InnerDetector/InDetConditions/InDetByteStreamErrors/CMakeLists.txt
index 5559457d833f..4c252f00bcb9 100644
--- a/InnerDetector/InDetConditions/InDetByteStreamErrors/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrors/CMakeLists.txt
@@ -5,16 +5,6 @@
 # Declare the package name:
 atlas_subdir( InDetByteStreamErrors )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaKernel
-                          Control/AthContainers
-                          Event/EventContainers
-                          DetectorDescription/Identifier )
-
-# this line failed automatic conversion in cmt2cmake :
-# use AtlasReflex          AtlasReflex-*              External - no_auto_imports
-
 # Component(s) in the package:
 atlas_add_dictionary( InDetByteStreamErrorsDict
                       InDetByteStreamErrors/InDetByteStreamErrorsDict.h
@@ -24,5 +14,5 @@ atlas_add_dictionary( InDetByteStreamErrorsDict
 atlas_add_library( InDetByteStreamErrors
                    src/*.cxx
                    PUBLIC_HEADERS InDetByteStreamErrors
-                   LINK_LIBRARIES AthenaKernel )
+                   LINK_LIBRARIES AthenaKernel EventContainers )
 
-- 
GitLab


From 7bd3b8297c033ff29c1eefe3be52e2096e575316 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 17 Sep 2020 16:37:44 -0400
Subject: [PATCH 378/422] InDetByteStreamErrorsAthenaPool: Clean up
 thread-safety annotations.

Thread-safety annotations should match between declarations and definitions.
---
 .../src/InDetBSErrContainerCnv_p1.cxx                         | 4 ++--
 .../src/TRT_BSIdErrContainerCnv_p1.cxx                        | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/InDetBSErrContainerCnv_p1.cxx b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/InDetBSErrContainerCnv_p1.cxx
index e428085596a7..a27a6c7839ee 100644
--- a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/InDetBSErrContainerCnv_p1.cxx
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/InDetBSErrContainerCnv_p1.cxx
@@ -4,7 +4,7 @@
 
 #include "InDetBSErrContainerCnv_p1.h"
 
-void InDetBSErrContainerCnv_p1::transToPers ATLAS_NOT_THREAD_SAFE // const_cast is used.
+void InDetBSErrContainerCnv_p1::transToPers
 (const InDetBSErrContainer* transCont, InDetBSErrContainer_p1* persCont, MsgStream& /*log*/)
 {
   InDetBSErrContainer::const_iterator it = transCont->begin();
@@ -14,7 +14,7 @@ void InDetBSErrContainerCnv_p1::transToPers ATLAS_NOT_THREAD_SAFE // const_cast
   for (; it != itEnd; ++it) {
     // FIXME: Should change type of m_bsErrs, but don't want to cause possible
     // back-compatibility problems.
-    std::pair<IdentifierHash, int>* ptr = const_cast<std::pair<IdentifierHash, int>*> (*it);
+    std::pair<IdentifierHash, int>* ptr ATLAS_THREAD_SAFE = const_cast<std::pair<IdentifierHash, int>*> (*it);
     (persCont->m_bsErrs).push_back(ptr);
   }
   return;
diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/TRT_BSIdErrContainerCnv_p1.cxx b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/TRT_BSIdErrContainerCnv_p1.cxx
index d27504bc31d2..0161e97b8a75 100644
--- a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/TRT_BSIdErrContainerCnv_p1.cxx
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/TRT_BSIdErrContainerCnv_p1.cxx
@@ -11,7 +11,7 @@
 
 #include <iostream>
 
-void TRT_BSIdErrContainerCnv_p1::transToPers ATLAS_NOT_THREAD_SAFE // const_cast is used.
+void TRT_BSIdErrContainerCnv_p1::transToPers
 (const TRT_BSIdErrContainer* transCont, TRT_BSIdErrContainer_p1* persCont, MsgStream & /* log */) 
 {
   TRT_BSIdErrContainer::const_iterator it = transCont->begin();
@@ -21,7 +21,7 @@ void TRT_BSIdErrContainerCnv_p1::transToPers ATLAS_NOT_THREAD_SAFE // const_cast
   for (; it != itEnd; ++it) {
     // FIXME: Should change type of m_bsErrs, but don't want to cause possible
     // back-compatibility problems.
-    std::pair<uint8_t, std::pair<uint32_t, uint8_t> >* ptr = const_cast<std::pair<uint8_t, std::pair<uint32_t, uint8_t> >*> (*it);
+    std::pair<uint8_t, std::pair<uint32_t, uint8_t> >* ptr ATLAS_THREAD_SAFE = const_cast<std::pair<uint8_t, std::pair<uint32_t, uint8_t> >*> (*it);
     (persCont->m_bsErrs).push_back(ptr);
   }
   return;
-- 
GitLab


From b3340b3c3d751468ad0ea4ade568429d59c8e33a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 17 Sep 2020 20:57:18 -0400
Subject: [PATCH 379/422] TrkMaterialProvider: Fix cppcheck warning.

DataVector<>::iterator is a non-trivial class.
Pass it by const reference, not by value.
---
 .../TrkMaterialProvider/TrkMaterialProviderTool.h             | 4 ++--
 .../TrkMaterialProvider/src/TrkMaterialProviderTool.cxx       | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h b/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h
index 636a4cc0938f..bd2f19258197 100644
--- a/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h
+++ b/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h
@@ -118,8 +118,8 @@ namespace Trk{
 
     /** update the TSOS vector for the Muon Spectrometer applying X0 and Eloss scaling*/
     void updateVectorMS(DataVector<const Trk::TrackStateOnSurface>* inputTSOS,
-                                                  DataVector<const Trk::TrackStateOnSurface>::iterator firstMS,
-                                                  double X0ScaleMS, double ElossScaleMS) const;
+                        const DataVector<const Trk::TrackStateOnSurface>::iterator& firstMS,
+                        double X0ScaleMS, double ElossScaleMS) const;
 
     //* Helper to indentify detector volume**/
     unsigned int getVolumeByGeo(const Trk::TrackStateOnSurface* m) const;
diff --git a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
index 104596fc7ba2..fd6059c46eb0 100644
--- a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
+++ b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
@@ -1142,8 +1142,8 @@ void Trk::TrkMaterialProviderTool::updateVector(DataVector<const Trk::TrackState
   // delete the view container
   delete caloTSOS;
 }
-void Trk::TrkMaterialProviderTool::updateVectorMS(DataVector<const Trk::TrackStateOnSurface>* inputTSOS, 
-						  DataVector<const Trk::TrackStateOnSurface>::iterator firstMS, 
+void Trk::TrkMaterialProviderTool::updateVectorMS(DataVector<const Trk::TrackStateOnSurface>* inputTSOS,
+						  const DataVector<const Trk::TrackStateOnSurface>::iterator& firstMS, 
                                                   double X0ScaleMS, double ElossScaleMS) const
 {
 
-- 
GitLab


From 8cc7393ef309f8f40a1d7c14159040d8edde1f7c Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 17 Sep 2020 21:45:53 -0400
Subject: [PATCH 380/422] TRT_G4Utilities: Suppress a cppcheck warning.

Suppress a cppcheck warning.
---
 .../InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx        | 1 +
 1 file changed, 1 insertion(+)

diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx b/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx
index ab30309f4b96..25ba86cadf56 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx
@@ -94,6 +94,7 @@ BOOST_AUTO_TEST_CASE(GetPartOfExistingDoubleArray, * utf::tolerance(0.01) ){
 BOOST_AUTO_TEST_SUITE_END()
 
 
+// cppcheck-suppress unknownMacro
 BOOST_FIXTURE_TEST_SUITE(Test_TRTOutputFile , setupOutputFile)
 BOOST_AUTO_TEST_CASE(OutputToFile  ){
   auto & f(p->GetReference());
-- 
GitLab


From 437986c781a873832283e088b81f1ff96318198d Mon Sep 17 00:00:00 2001
From: Matthew Joseph Basso <matthew.joseph.basso@cern.ch>
Date: Tue, 22 Sep 2020 16:58:49 -0700
Subject: [PATCH 381/422] Let's try this one more time

---
 .../Root/MVATrackVertexAssociationTool.cxx                    | 4 +++-
 .../MVATrackVertexAssociationTool.h                           | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
index 1875bc927549..3c7563ab8dce 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -25,6 +25,7 @@ namespace CP {
 MVATrackVertexAssociationTool::MVATrackVertexAssociationTool(const std::string& name) :
   AsgTool(name)
 {
+  // For AnalysisBase
   #ifdef XAOD_STANDALONE
   declareProperty("NetworkFileName", m_fileName,        "Name of the input lwtnn network file."                                                              );
   declareProperty("InputNames",      m_inputNames,      "Vector of the network's input variable names (std::vector<std::string>)."                           );
@@ -75,7 +76,8 @@ StatusCode MVATrackVertexAssociationTool::initialize() {
   return StatusCode::SUCCESS;
 }
 
-#ifdef XAOD_STANDALONE
+// For Athena
+#ifndef XAOD_STANDALONE
 StatusCode MVATrackVertexAssociationTool::finalize() {
   ATH_MSG_INFO("Finalizing MVATrackVertexAssociationTool.");
   return StatusCode::SUCCESS;
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
index a939afa52e11..91ee4575fcbc 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
@@ -36,7 +36,10 @@ public:
   MVATrackVertexAssociationTool(const std::string& name);
 
   virtual StatusCode initialize() override;
+  // For Athena
+  #ifndef XAOD_STANDALONE
   virtual StatusCode finalize() override;
+  #endif
 
   virtual bool isCompatible(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx) const override;
 
-- 
GitLab


From 061c3d03b6f8b38fbb4a639820a70dbdc8209f97 Mon Sep 17 00:00:00 2001
From: Xiaozhong Huang <xiaozhong.huang@cern.ch>
Date: Wed, 23 Sep 2020 08:52:28 +0800
Subject: [PATCH 382/422] tauRecTools: avoid the type conversion in function
 overloading

---
 .../tauRecTools/Root/CaloClusterVariables.cxx          |  2 +-
 .../tauRecTools/Root/MvaTESVariableDecorator.cxx       |  2 +-
 Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx |  2 +-
 Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx |  2 +-
 .../tauRecTools/Root/TauSubstructureVariables.cxx      |  2 +-
 .../tauRecTools/src/TauPi0ClusterCreator.cxx           | 10 +++++-----
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx b/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx
index adb2157ab41d..166f13a549db 100644
--- a/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx
+++ b/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx
@@ -44,7 +44,7 @@ bool CaloClusterVariables::update(const xAOD::TauJet& pTau, const ToolHandle<ITa
 
     std::vector<TLorentzVector> clusterP4Vector;
     for (const xAOD::CaloCluster* cluster : clusterList) {
-      TLorentzVector clusterP4 = tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+      TLorentzVector clusterP4 = tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
       clusterP4Vector.push_back(clusterP4);
     }
 
diff --git a/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx b/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx
index 07f56f54b077..292e8e2fc3a9 100644
--- a/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx
+++ b/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx
@@ -98,7 +98,7 @@ StatusCode MvaTESVariableDecorator::execute(xAOD::TauJet& xTau) const {
 
   // Loop through clusters and jet constituents
   for (const xAOD::CaloCluster* cluster : clusterList){
-    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
   
     if (clusterP4.DeltaR(tauAxis) > 0.2) continue;
 
diff --git a/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
index 614cfe0d6232..6df31f25c0a6 100644
--- a/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
+++ b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
@@ -102,7 +102,7 @@ StatusCode TauIDVarCalculator::execute(xAOD::TauJet& tau) const
   float eHad1AtEMScaleFixed = 0.;
 
   for (const xAOD::CaloCluster* cluster  : clusterList) {
-    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
     
     if( tauAxis.DeltaR(clusterP4) > 0.2 ) continue;
     
diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx
index 82ac97fe9ca8..e5ca38e7aa87 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx
@@ -200,7 +200,7 @@ StatusCode TauJetRNNEvaluator::get_clusters(
     auto cItr = clusters.begin();
     while( cItr != clusters.end() ){
       const xAOD::CaloCluster* cluster = (*cItr);
-      TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+      TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
 
       if (tauAxis.DeltaR(clusterP4) > m_max_cluster_dr) {
         clusters.erase(cItr);
diff --git a/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx b/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx
index 5fdc7a493676..dd0f79b48d9e 100644
--- a/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx
+++ b/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx
@@ -103,7 +103,7 @@ StatusCode TauSubstructureVariables::execute(xAOD::TauJet& pTau) const {
   for (auto cluster : vClusters){
     totalEnergy += cluster->e();
 		
-    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
     dr = tauAxis.DeltaR(clusterP4);    
     
     if (0.2 <= dr && dr < 0.4) {
diff --git a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
index 7db492683bd0..59a1e7c708da 100644
--- a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
+++ b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
@@ -81,8 +81,8 @@ StatusCode TauPi0ClusterCreator::executePi0ClusterCreator(xAOD::TauJet& pTau, xA
     
     TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(pTau);
 
-    for (auto cluster: pPi0ClusterContainer){
-        TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+    for (const xAOD::CaloCluster* cluster: pPi0ClusterContainer){
+        TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
         
         // selection
         if (clusterP4.Pt() < m_clusterEtCut)   continue;
@@ -272,7 +272,7 @@ std::map<unsigned, xAOD::CaloCluster*> TauPi0ClusterCreator::getClusterToShotMap
 
         for (; clusterItr != clusterItrEnd; ++clusterItr){
             xAOD::CaloCluster* cluster = (xAOD::CaloCluster*) (*clusterItr);
-            TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+            TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
             
             weightInCluster=-1.;
             if (clusterP4.Et() < m_clusterEtCut) continue; // Not interested in clusters that fail the Et cut
@@ -443,14 +443,14 @@ bool TauPi0ClusterCreator::setHadronicClusterPFOs(xAOD::TauJet& pTau, xAOD::PFOC
     StatusCode sc = tauRecTools::GetJetClusterList(jetSeed, clusterList, m_incShowerSubtr);
     if (!sc) return false;
 
-    for (auto cluster : clusterList){
+    for (const xAOD::CaloCluster* cluster : clusterList){
         // Procedure: 
         // - Calculate cluster energy in Hcal. This is to treat -ve energy cells correctly
         // - Then set 4momentum via setP4(E/cosh(eta), eta, phi, m). This forces the PFO to have the correct energy and mass
         // - Ignore clusters outside 0.2 cone and those with overall negative energy or negative energy in Hcal
 
         // Don't create PFOs for clusters with overall (Ecal+Hcal) negative energy (noise)
-        TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(cluster, tauVertex, jetVertex);
+        TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
         
         if(clusterP4.E()<=0.) continue;
 
-- 
GitLab


From a89cd058a45f05c0b002f3c49e3b6f6312ce1da0 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 23 Sep 2020 04:28:46 +0200
Subject: [PATCH 383/422] more cmake fixes

---
 .../CMakeLists.txt                            | 20 ++++---------------
 .../IDCInDetBSErrContainerCnv_p1_test.ref     |  1 +
 2 files changed, 5 insertions(+), 16 deletions(-)
 create mode 100644 InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/share/IDCInDetBSErrContainerCnv_p1_test.ref

diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/CMakeLists.txt b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/CMakeLists.txt
index f117789cb97c..7a30a784da66 100644
--- a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/CMakeLists.txt
@@ -5,18 +5,6 @@
 # Declare the package name:
 atlas_subdir( InDetByteStreamErrorsAthenaPool )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Database/AthenaPOOL/AthenaPoolUtilities
-   DetectorDescription/Identifier
-   PRIVATE
-   GaudiKernel
-   AtlasTest/TestTools
-   Control/AthAllocators
-   Database/AthenaPOOL/AthenaPoolCnvSvc
-   InnerDetector/InDetConditions/InDetByteStreamErrors )
-
 # Component(s) in the package:
 atlas_add_poolcnv_library( InDetByteStreamErrorsAthenaPoolPoolCnv src/*.cxx
    FILES InDetByteStreamErrors/InDetBSErrContainer.h
@@ -36,22 +24,22 @@ atlas_add_dictionary( InDetByteStreamErrorsAthenaPoolCnvDict
 atlas_add_test( InDetBSErrContainerCnv_p1_test
    SOURCES test/InDetBSErrContainerCnv_p1_test.cxx
    src/InDetBSErrContainerCnv_p1.cxx
-   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators )
+   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators InDetByteStreamErrors )
 
 atlas_add_test( IDCInDetBSErrContainerCnv_p1_test
    SOURCES test/IDCInDetBSErrContainerCnv_p1_test.cxx
    src/IDCInDetBSErrContainerCnv_p1.cxx
-   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators )
+   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators InDetByteStreamErrors )
 
 #atlas_add_test( TRT_BSErrContainerCnv_p1_test
 #   SOURCES test/TRT_BSErrContainerCnv_p1_test.cxx
 #   src/TRT_BSErrContainerCnv_p1.cxx
-#   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators )
+#   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators InDetByteStreamErrors )
 
 atlas_add_test( TRT_BSIdErrContainerCnv_p1_test
    SOURCES test/TRT_BSIdErrContainerCnv_p1_test.cxx
    src/TRT_BSIdErrContainerCnv_p1.cxx
-   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators )
+   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators InDetByteStreamErrors )
 
 # Install files from the package:
 atlas_install_headers( InDetByteStreamErrorsAthenaPool )
diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/share/IDCInDetBSErrContainerCnv_p1_test.ref b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/share/IDCInDetBSErrContainerCnv_p1_test.ref
new file mode 100644
index 000000000000..a5bce3fd2565
--- /dev/null
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/share/IDCInDetBSErrContainerCnv_p1_test.ref
@@ -0,0 +1 @@
+test1
-- 
GitLab


From b6734cbd56a57e14b0b6bc3fa0a9b308f136acc8 Mon Sep 17 00:00:00 2001
From: Katherine Pachal <katepachal@gmail.com>
Date: Wed, 23 Sep 2020 08:25:26 +0000
Subject: [PATCH 384/422] Quick print fix in TriggerAlgorithmsTest_eljob.py

---
 .../share/TriggerAlgorithmsTest_eljob.py                        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py
index ffcf2f3e48d0..4ac99cd0b355 100755
--- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py
@@ -54,7 +54,7 @@ job.options().setString( ROOT.EL.Job.optSubmitDirMode, "unique" )
 
 from TriggerAnalysisAlgorithms.TriggerAnalysisAlgorithmsTest import makeSequence
 algSeq = makeSequence (dataType)
-print algSeq # For debugging
+print(algSeq) # For debugging
 for alg in algSeq:
     job.algsAdd( alg )
     pass
-- 
GitLab


From 9a47ccdbdecc2635335438cb6ce0445a55563378 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Wed, 23 Sep 2020 11:49:05 +0200
Subject: [PATCH 385/422] eflowRec cleanup minor comments and naming
 conventions for PFEGamFlowElementAssoc

---
 .../eflowRec/PFEGamFlowElementAssoc.h         | 16 ++--
 .../eflowRec/src/PFEGamFlowElementAssoc.cxx   | 96 +++++++++----------
 2 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
index 4388401c8747..6c95a5121f2c 100644
--- a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
+++ b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /*
@@ -24,7 +24,7 @@
 #include "StoreGate/WriteDecorHandle.h"
 #include "xAODPFlow/FlowElementContainer.h"
 /**                                                                                                                                                                                     
-This is the algorithm, which inherits from AthAlgorithm, that adds element links between particle flow objects (Flow Elements) and Egamma objects. The algorithm associates charged (c) Flow Elements to all electron and converted photon tracks, and neutral (n) Flow Elements to all electron and photon clusters. 
+This is the algorithm, which inherits from AthReentrantAlgorithm, that adds element links between particle flow objects (Flow Elements) and Egamma objects. The algorithm associates charged (c) Flow Elements to all electron and converted photon tracks, and neutral (n) Flow Elements to all electron and photon clusters. 
 
 This is done by adding decorations to the "Electron" and "Photon" container, for charged Charged Flow Elements and Neutral Flow Elements separately, in the form of vectors of element links to the associated Flow Elements. 
 The algorithm also adds decorations to the "JetETMissNeutralFlowElements" and 
@@ -51,9 +51,9 @@ private:
   SG::ReadHandleKey<xAOD::PhotonContainer>m_photonReadHandleKey{this,"PhotonContainer","Photons","ReadHandleKey for PhotonContainer"};
 
   //Readhandles for FlowElements.
-  SG::ReadHandleKey<xAOD::FlowElementContainer> m_neutralfeReadHandleKey{this,"JetEtMissNeutralFlowElementContainer","JetETMissNeutralFlowElements","ReadHandleKey for neutral FlowElements"};
+  SG::ReadHandleKey<xAOD::FlowElementContainer> m_neutralFEReadHandleKey{this,"JetEtMissNeutralFlowElementContainer","JetETMissNeutralFlowElements","ReadHandleKey for neutral FlowElements"};
   
-  SG::ReadHandleKey<xAOD::FlowElementContainer> m_chargedfeReadHandleKey{this,"JetEtMissChargedFlowElementContainer","JetETMissChargedFlowElements","ReadHandleKey for charged FlowElements"};
+  SG::ReadHandleKey<xAOD::FlowElementContainer> m_chargedFEReadHandleKey{this,"JetEtMissChargedFlowElementContainer","JetETMissChargedFlowElements","ReadHandleKey for charged FlowElements"};
 
 
   /** The write key for adding Neutral Flow Element element link decorations to electrons */ 
@@ -61,18 +61,18 @@ private:
   /** The write key for adding Charged Flow Element element link decorations to electrons */
   SG::WriteDecorHandleKey<xAOD::ElectronContainer> m_electronChargedFEWriteDecorKey;
   /** The write key for adding electron element link decorations to Neutral Flow Elements */
-  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralfeElectronWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralFEElectronWriteDecorKey;
   /** The write key for adding electron element link decorations to Charged Flow Elements */
-  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedfeElectronWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedFEElectronWriteDecorKey;
 
   /** The write key for adding Neutral Flow Element element link decorations to photons */
   SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonNeutralFEWriteDecorKey;
   /** The write key for adding Charged Flow Element element link decorations to photons */
   SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonChargedFEWriteDecorKey;
   /** The write key for adding photon element link decorations to Neutral Flow Elements */
-  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralfePhotonWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralFEPhotonWriteDecorKey;
   /** The write key for adding photon element link decorations to Charged Flow Elements */
-  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedfePhotonWriteDecorKey;
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedFEPhotonWriteDecorKey;
 
  
 };
diff --git a/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
index 1fd39eb658df..d4f91632eb5f 100644
--- a/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
+++ b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
@@ -1,5 +1,5 @@
 /*  
- Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "StoreGate/WriteDecorHandle.h" 
@@ -15,7 +15,7 @@
 
 
 #include "eflowRec/PFEGamFlowElementAssoc.h" 
-#include <typeinfo> // temp debug for type checks on objects
+
 
 typedef ElementLink<xAOD::ElectronContainer> ElectronLink_t; 
 typedef ElementLink<xAOD::PhotonContainer> PhotonLink_t;
@@ -28,17 +28,17 @@ const std::string& name,
   AthReentrantAlgorithm(name,pSvcLocator)
 {
 // Class initializer 
-declareProperty ("ElectronNeutralFEDecorKey", m_electronNeutralFEWriteDecorKey = "Electrons.neutralfeLinks");   
-declareProperty ("ElectronChargedFEDecorKey", m_electronChargedFEWriteDecorKey = "Electrons.chargedfeLinks");   
+declareProperty ("ElectronNeutralFEDecorKey", m_electronNeutralFEWriteDecorKey = "Electrons.neutralFELinks");   
+declareProperty ("ElectronChargedFEDecorKey", m_electronChargedFEWriteDecorKey = "Electrons.chargedFELinks");   
 
-declareProperty ("NeutralFEElectronDecorKey", m_neutralfeElectronWriteDecorKey = "JetETMissNeutralFlowElements.fe_ElectronLinks");   
+declareProperty ("NeutralFEElectronDecorKey", m_neutralFEElectronWriteDecorKey = "JetETMissNeutralFlowElements.FE_ElectronLinks");   
 
-declareProperty ("ChargedFEElectronDecorKey", m_chargedfeElectronWriteDecorKey = "JetETMissChargedFlowElements.fe_ElectronLinks"); 
+declareProperty ("ChargedFEElectronDecorKey", m_chargedFEElectronWriteDecorKey = "JetETMissChargedFlowElements.FE_ElectronLinks"); 
 
-declareProperty ("PhotonNeutralFEDecorKey", m_photonNeutralFEWriteDecorKey = "Photons.neutralfeLinks");
-declareProperty ("PhotonChargedFEDecorKey", m_photonChargedFEWriteDecorKey = "Photons.chargedfeLinks");
-declareProperty ("NeutralFEPhotonDecorKey", m_neutralfePhotonWriteDecorKey = "JetETMissNeutralFlowElements.fe_PhotonLinks");
-declareProperty ("ChargedFEPhotonDecorKey", m_chargedfePhotonWriteDecorKey = "JetETMissChargedFlowElements.fe_PhotonLinks");
+declareProperty ("PhotonNeutralFEDecorKey", m_photonNeutralFEWriteDecorKey = "Photons.neutralFELinks");
+declareProperty ("PhotonChargedFEDecorKey", m_photonChargedFEWriteDecorKey = "Photons.chargedFELinks");
+declareProperty ("NeutralFEPhotonDecorKey", m_neutralFEPhotonWriteDecorKey = "JetETMissNeutralFlowElements.FE_PhotonLinks");
+declareProperty ("ChargedFEPhotonDecorKey", m_chargedFEPhotonWriteDecorKey = "JetETMissChargedFlowElements.FE_PhotonLinks");
 }
 
 // Class destructor 
@@ -50,19 +50,19 @@ StatusCode PFEGamFlowElementAssoc::initialize()
   ATH_MSG_DEBUG("Initializing "<<name() << "...");
  ATH_CHECK(m_electronNeutralFEWriteDecorKey.initialize());   
  ATH_CHECK(m_electronChargedFEWriteDecorKey.initialize());   
- ATH_CHECK(m_neutralfeElectronWriteDecorKey.initialize());   
- ATH_CHECK(m_chargedfeElectronWriteDecorKey.initialize());  
+ ATH_CHECK(m_neutralFEElectronWriteDecorKey.initialize());   
+ ATH_CHECK(m_chargedFEElectronWriteDecorKey.initialize());  
 
  ATH_CHECK(m_photonNeutralFEWriteDecorKey.initialize());
  ATH_CHECK(m_photonChargedFEWriteDecorKey.initialize());
- ATH_CHECK(m_neutralfePhotonWriteDecorKey.initialize());
- ATH_CHECK(m_chargedfePhotonWriteDecorKey.initialize());
+ ATH_CHECK(m_neutralFEPhotonWriteDecorKey.initialize());
+ ATH_CHECK(m_chargedFEPhotonWriteDecorKey.initialize());
 
  //Init ReadHandleKeys
  ATH_CHECK(m_photonReadHandleKey.initialize());
  ATH_CHECK(m_electronReadHandleKey.initialize());
- ATH_CHECK(m_chargedfeReadHandleKey.initialize());
- ATH_CHECK(m_neutralfeReadHandleKey.initialize());
+ ATH_CHECK(m_chargedFEReadHandleKey.initialize());
+ ATH_CHECK(m_neutralFEReadHandleKey.initialize());
 
  ATH_MSG_DEBUG("Initialization completed successfully");   
 
@@ -85,14 +85,14 @@ StatusCode PFEGamFlowElementAssoc::execute(const EventContext &ctx) const
   //Electron Write Handle
   SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronNeutralFEWriteDecorHandle (m_electronNeutralFEWriteDecorKey,ctx);   
   SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronChargedFEWriteDecorHandle (m_electronChargedFEWriteDecorKey,ctx);   
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > neutralfeElectronWriteDecorHandle (m_neutralfeElectronWriteDecorKey,ctx);   
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > chargedfeElectronWriteDecorHandle (m_chargedfeElectronWriteDecorKey,ctx); 
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > neutralFEElectronWriteDecorHandle (m_neutralFEElectronWriteDecorKey,ctx);   
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > chargedFEElectronWriteDecorHandle (m_chargedFEElectronWriteDecorKey,ctx); 
 
   //Photon Write Handle
   SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonNeutralFEWriteDecorHandle (m_photonNeutralFEWriteDecorKey,ctx);
   SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonChargedFEWriteDecorHandle (m_photonChargedFEWriteDecorKey,ctx);
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > neutralfePhotonWriteDecorHandle (m_neutralfePhotonWriteDecorKey,ctx);
-  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > chargedfePhotonWriteDecorHandle (m_chargedfePhotonWriteDecorKey,ctx);  
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > neutralFEPhotonWriteDecorHandle (m_neutralFEPhotonWriteDecorKey,ctx);
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > chargedFEPhotonWriteDecorHandle (m_chargedFEPhotonWriteDecorKey,ctx);  
   
   
   // This is the READ handles (so the input containers for electron, photon, FE)
@@ -101,8 +101,8 @@ StatusCode PFEGamFlowElementAssoc::execute(const EventContext &ctx) const
   SG::ReadHandle<xAOD::PhotonContainer> photonReadHandle (m_photonReadHandleKey,ctx);
   
   // Charged and Neutral PFlow "Flow elements"
-  SG::ReadHandle<xAOD::FlowElementContainer> neutralfeReadHandle (m_neutralfeReadHandleKey,ctx);   
-  SG::ReadHandle<xAOD::FlowElementContainer> chargedfeReadHandle (m_chargedfeReadHandleKey,ctx);   
+  SG::ReadHandle<xAOD::FlowElementContainer> neutralFEReadHandle (m_neutralFEReadHandleKey,ctx);   
+  SG::ReadHandle<xAOD::FlowElementContainer> chargedFEReadHandle (m_chargedFEReadHandleKey,ctx);   
   
   // now initialise some Flow element link containers
   std::vector<std::vector<FlowElementLink_t>> electronNeutralFEVec(electronReadHandle->size());
@@ -118,13 +118,13 @@ StatusCode PFEGamFlowElementAssoc::execute(const EventContext &ctx) const
   ///////////////////////////
   // Loop over neutral flow elements (FEs)
   ///////////////////////////
-  for (const xAOD::FlowElement* fe: *neutralfeElectronWriteDecorHandle){
+  for (const xAOD::FlowElement* FE: *neutralFEElectronWriteDecorHandle){
     //Obtain the index of the FE calo-cluster
-    size_t feClusterIndex=fe->otherObjects().at(0)->index();
+    size_t FEClusterIndex=FE->otherObjects().at(0)->index();
 
     // init the linkers
-    std::vector<ElectronLink_t> feElectronLinks;
-    std::vector<PhotonLink_t> fePhotonLinks;
+    std::vector<ElectronLink_t> FEElectronLinks;
+    std::vector<PhotonLink_t> FEPhotonLinks;
     
     //Loop over electrons:
     for (const xAOD::Electron* electron: *electronNeutralFEWriteDecorHandle){
@@ -137,11 +137,11 @@ StatusCode PFEGamFlowElementAssoc::execute(const EventContext &ctx) const
 	// obtain the index of the electron seed topocluster
 	size_t electronClusterIndex=cluster->index();	
 	//match the indices: Cluster match between Flow Element (FE) and electron
-	if(electronClusterIndex==feClusterIndex){
-	  feElectronLinks.push_back( ElectronLink_t(*electronReadHandle,electron->index()) );
+	if(electronClusterIndex==FEClusterIndex){
+	  FEElectronLinks.push_back( ElectronLink_t(*electronReadHandle,electron->index()) );
 	  //Add Flow Element (FE) link to a vector
 	  //index() is the unique index of the Flow Element in the container
-	  electronNeutralFEVec.at(electron->index()).push_back(FlowElementLink_t(*neutralfeReadHandle, fe->index()) );
+	  electronNeutralFEVec.at(electron->index()).push_back(FlowElementLink_t(*neutralFEReadHandle, FE->index()) );
 	}// end of matching block
 
       } // end loop over cluster
@@ -157,12 +157,12 @@ StatusCode PFEGamFlowElementAssoc::execute(const EventContext &ctx) const
 	//retrieve index of the cluster
 	size_t photonClusterIndex=cluster->index();
 	//do the matching
-	if(photonClusterIndex==feClusterIndex){
+	if(photonClusterIndex==FEClusterIndex){
 	  // Add flow element (FE) links to photon
-	  fePhotonLinks.push_back( PhotonLink_t(*photonReadHandle,photon->index()) );
+	  FEPhotonLinks.push_back( PhotonLink_t(*photonReadHandle,photon->index()) );
 	  //Add Flow Element (FE) link to a vector
 	  //index() is the unique index of the Flow Element in the container
-	  photonNeutralFEVec.at(photon->index()).push_back(FlowElementLink_t(*neutralfeReadHandle, fe->index()) );	  
+	  photonNeutralFEVec.at(photon->index()).push_back(FlowElementLink_t(*neutralFEReadHandle, FE->index()) );	  
 	}// end of matching block
       } // end of neutral loop
       
@@ -170,20 +170,20 @@ StatusCode PFEGamFlowElementAssoc::execute(const EventContext &ctx) const
     }// end of photon loop
     
     //Add vector of electron element links as decoration to FlowElement container
-    neutralfeElectronWriteDecorHandle (*fe)=feElectronLinks;
-    neutralfePhotonWriteDecorHandle (*fe)=fePhotonLinks;
+    neutralFEElectronWriteDecorHandle (*FE)=FEElectronLinks;
+    neutralFEPhotonWriteDecorHandle (*FE)=FEPhotonLinks;
 
   } // end neutral FE loop
 
   ////////////////////////////////////////////////////////
   //             Loop over charged Flow Elements (FEs)
   ////////////////////////////////////////////////////////
-  for (const xAOD::FlowElement* fe: *chargedfeElectronWriteDecorHandle){
+  for (const xAOD::FlowElement* FE: *chargedFEElectronWriteDecorHandle){
     // retrieve the track from the Flow element
-    size_t feTrackIndex=fe->chargedObjects().at(0)->index();
+    size_t FETrackIndex=FE->chargedObjects().at(0)->index();
     // Initialise a vector of element links to electrons/Photons
-    std::vector<ElectronLink_t> feElectronLinks;
-    std::vector<PhotonLink_t> fePhotonLinks;
+    std::vector<ElectronLink_t> FEElectronLinks;
+    std::vector<PhotonLink_t> FEPhotonLinks;
 
     //loop over electrons
     for (const xAOD::Electron* electron: *electronChargedFEWriteDecorHandle){
@@ -194,13 +194,13 @@ StatusCode PFEGamFlowElementAssoc::execute(const EventContext &ctx) const
 	 size_t electronTrackIndex = electronTrack->index();
 
 	 //link to FE if track indices match
-	 if(electronTrackIndex==feTrackIndex){
+	 if(electronTrackIndex==FETrackIndex){
 	   // Add electron element link to a vector 
 	   // index() is the unique index of the electron in the electron container 
-	   feElectronLinks.push_back( ElectronLink_t(*electronReadHandle, electron->index()) );
-	   // Add fe element link to a vector 
+	   FEElectronLinks.push_back( ElectronLink_t(*electronReadHandle, electron->index()) );
+	   // Add FE element link to a vector 
 	   // index() is the unique index of the cFE in the cFE container 
-	   electronChargedFEVec.at(electron->index()).push_back( FlowElementLink_t(*chargedfeReadHandle, fe->index()) );  
+	   electronChargedFEVec.at(electron->index()).push_back( FlowElementLink_t(*chargedFEReadHandle, FE->index()) );  
 
 	 }//end of matching block
 	 
@@ -215,13 +215,13 @@ StatusCode PFEGamFlowElementAssoc::execute(const EventContext &ctx) const
 	size_t photonTrackIndex=photonTrack->index();
 	
 	// Link the photon to the Flow Element (FE) if the track indices match
-	if (photonTrackIndex==feTrackIndex){
+	if (photonTrackIndex==FETrackIndex){
 	            // Add photon element link to a vector
           // index() is the unique index of the photon in the photon container
-          fePhotonLinks.push_back( PhotonLink_t(*photonReadHandle, photon->index()) );
-          // Add fe element link to a vector
+          FEPhotonLinks.push_back( PhotonLink_t(*photonReadHandle, photon->index()) );
+          // Add FE element link to a vector
           // index() is the unique index of the cFE in the cFE container
-          photonChargedFEVec.at(photon->index()).push_back( FlowElementLink_t(*chargedfeReadHandle, fe->index()) );
+          photonChargedFEVec.at(photon->index()).push_back( FlowElementLink_t(*chargedFEReadHandle, FE->index()) );
 	}// end of matching block
 
       }// end of loop on tracks
@@ -230,9 +230,9 @@ StatusCode PFEGamFlowElementAssoc::execute(const EventContext &ctx) const
 
 
     // Add vector of electron element links as decoration to FE container     
-    chargedfeElectronWriteDecorHandle (*fe) = feElectronLinks;  
+    chargedFEElectronWriteDecorHandle (*FE) = FEElectronLinks;  
     // Add vector of photon element links as decoration to FE container
-    chargedfePhotonWriteDecorHandle (*fe) = fePhotonLinks;
+    chargedFEPhotonWriteDecorHandle (*FE) = FEPhotonLinks;
 
   } // end of charged FE loop
   
-- 
GitLab


From 9e83d4f036b14721479563c81b1d575f7089bc86 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 22 Jul 2019 17:40:06 +0200
Subject: [PATCH 386/422] Move remaining configurable property definitions to
 header

---
 .../InDetOverlay/InDetOverlay/TRTOverlay.h     | 18 ++++++++++++------
 .../InDetOverlay/src/TRTOverlay.cxx            |  4 ----
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h
index 07ed78bc47d8..74b339599654 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h
@@ -20,10 +20,16 @@ namespace CLHEP {
   class HepRandomEngine;
 }
 
+namespace OverlayTesting {
+  class TRTOverlay_test;
+}
+
 class TRTOverlay : public AthReentrantAlgorithm
 {
 public:
 
+  friend class OverlayTesting::TRTOverlay_test;
+
   TRTOverlay(const std::string &name, ISvcLocator *pSvcLocator);
 
   virtual StatusCode initialize() override final;
@@ -53,12 +59,12 @@ private:
   // Following tools, services and configurables are there only for the correct of HT hits
   ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", "Random Number Service"};      // Random number service
 
-  double                                 m_HTOccupancyCorrectionB;
-  double                                 m_HTOccupancyCorrectionEC;
-  double                                 m_HTOccupancyCorrectionB_noE;
-  double                                 m_HTOccupancyCorrectionEC_noE;
-  ToolHandle<InDet::ITRT_LocalOccupancy> m_TRT_LocalOccupancyTool{this, "TRT_LocalOccupancyTool", "TRT_LocalOccupancy", ""};
-  ToolHandle<ITRT_StrawStatusSummaryTool>   m_TRTStrawSummaryTool{this, "TRTStrawSummaryTool", "TRT_StrawStatusSummaryTool", ""};
+  Gaudi::Property<double> m_HTOccupancyCorrectionB{this, "TRT_HT_OccupancyCorrectionBarrel", 0.110, ""};
+  Gaudi::Property<double> m_HTOccupancyCorrectionEC{this, "TRT_HT_OccupancyCorrectionEndcap", 0.090, ""};
+  Gaudi::Property<double> m_HTOccupancyCorrectionB_noE{this, "TRT_HT_OccupancyCorrectionBarrelNoE", 0.060, ""};
+  Gaudi::Property<double> m_HTOccupancyCorrectionEC_noE{this, "TRT_HT_OccupancyCorrectionEndcapNoE", 0.050, ""};
+  ToolHandle<InDet::ITRT_LocalOccupancy>  m_TRT_LocalOccupancyTool{this, "TRT_LocalOccupancyTool", "TRT_LocalOccupancy", ""};
+  ToolHandle<ITRT_StrawStatusSummaryTool> m_TRTStrawSummaryTool{this, "TRTStrawSummaryTool", "TRT_StrawStatusSummaryTool", ""};
 
 };
 
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
index 0b6a8f1b013a..a0a565fe4bfa 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
@@ -45,10 +45,6 @@ namespace Overlay
 TRTOverlay::TRTOverlay(const std::string &name, ISvcLocator *pSvcLocator)
   : AthReentrantAlgorithm(name, pSvcLocator)
 {
-  declareProperty("TRT_HT_OccupancyCorrectionBarrel", m_HTOccupancyCorrectionB=0.110);
-  declareProperty("TRT_HT_OccupancyCorrectionEndcap", m_HTOccupancyCorrectionEC=0.090);
-  declareProperty("TRT_HT_OccupancyCorrectionBarrelNoE", m_HTOccupancyCorrectionB_noE=0.060);
-  declareProperty("TRT_HT_OccupancyCorrectionEndcapNoE", m_HTOccupancyCorrectionEC_noE=0.050);
 }
 
 
-- 
GitLab


From f2426fbd95aa350974681c62a51490551f358f24 Mon Sep 17 00:00:00 2001
From: Andrew Beddall <Andrew.Beddall@cern.ch>
Date: Wed, 23 Sep 2020 15:46:16 +0200
Subject: [PATCH 387/422] TRT RDO Reduction 2 (still p2 but ready for p3)

---
 .../InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h      | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h
index e8b39c0770d1..66f994bb2437 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h
@@ -21,10 +21,11 @@
 
 
 // the latest persistent representation type of DataCollection:
-//typedef  InDetRawDataContainer_p2         TRT_RDO_Container_PERS;
-//typedef  TRT_LoLumRawDataContainerCnv_p2  TRT_RDO_ContainerCnv_PERS;
-typedef  InDetRawDataContainer_p3         TRT_RDO_Container_PERS;
-typedef  TRT_LoLumRawDataContainerCnv_p3  TRT_RDO_ContainerCnv_PERS;
+typedef  InDetRawDataContainer_p2         TRT_RDO_Container_PERS;
+typedef  TRT_LoLumRawDataContainerCnv_p2  TRT_RDO_ContainerCnv_PERS;
+// To switch to the p3 version (20% RDO size reduction), comment the two lines above and uncomment the two below.
+// typedef  InDetRawDataContainer_p3         TRT_RDO_Container_PERS;
+// typedef  TRT_LoLumRawDataContainerCnv_p3  TRT_RDO_ContainerCnv_PERS;
 
 typedef  T_AthenaPoolCustomCnv<TRT_RDO_Container, TRT_RDO_Container_PERS >   TRT_RDO_ContainerCnvBase;
 
-- 
GitLab


From da69362151fdb3f0407c295f424f1bafc71aae57 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Wed, 23 Sep 2020 15:18:50 +0100
Subject: [PATCH 388/422] Add reasonable upper limits to 16 final components, 8
 from Bethe Heitler so up to 128 total , currently we do 12, 6 , 72

---
 .../GsfMaterialMixtureConvolution.h           |  4 +---
 .../src/GaussianSumFitter.cxx                 | 23 +++++++++----------
 .../src/GsfBetheHeitlerEffects.cxx            |  8 +++----
 .../src/GsfMaterialMixtureConvolution.cxx     | 12 ++++------
 4 files changed, 20 insertions(+), 27 deletions(-)

diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h
index 815240b3e929..7eb271c1cf36 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h
@@ -47,10 +47,8 @@ public:
   virtual ~GsfMaterialMixtureConvolution();
 
   //!< AlgTool initialise method
-  virtual StatusCode initialize() override;
+  virtual StatusCode initialize() override final;
 
-  //!< AlgTool finalize method
-  virtual StatusCode finalize() override;
 
   //!< Convolution with full material properties
   virtual MultiComponentState update(
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
index 63b782bfba77..1a2b758b8606 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
@@ -69,10 +69,8 @@ Trk::GaussianSumFitter::initialize()
   StatusCode sc;
   // Request the GSF extrapolator
   ATH_CHECK(m_extrapolator.retrieve());
-
   // Request the RIO_OnTrack creator
   // No need to return if RioOnTrack creator tool, only if PrepRawData is used
-  // in fit
   if (m_rioOnTrackCreator.retrieve().isFailure()) {
     if (!m_refitOnMeasurementBase) {
       ATH_MSG_FATAL("Attempting to use PrepRawData with no RIO_OnTrack creator "
@@ -83,7 +81,16 @@ Trk::GaussianSumFitter::initialize()
       "Request to retrieve the RIO_OnTrack Creator"
       << "failed but track is fit at the MeasurementBase level... Continuing!");
   }
-
+  if (m_overideMaterialEffectsSwitch) {
+    ATH_MSG_INFO("Material effects in forwards fitter have been overiden by "
+                 "jobOptions... New "
+                 "Trk::ParticleHypothesis: "
+                 << m_overideMaterialEffects);
+  }
+  if( m_maximumNumberOfComponents > 16){
+      ATH_MSG_FATAL("Requested MaximumNumberOfComponents > 16");
+      return StatusCode::FAILURE;
+  }
   // Initialise the closest track parameters search algorithm
   Amg::Vector3D referencePosition(m_sortingReferencePoint[0],
                                   m_sortingReferencePoint[1],
@@ -91,19 +98,11 @@ Trk::GaussianSumFitter::initialize()
 
   m_trkParametersComparisonFunction =
     std::make_unique<Trk::TrkParametersComparisonFunction>(referencePosition);
-
   Trk::ParticleSwitcher particleSwitcher;
   m_overideParticleHypothesis =
     particleSwitcher.particle[m_overideMaterialEffects];
-  if (m_overideMaterialEffectsSwitch) {
-    ATH_MSG_INFO("Material effects in forwards fitter have been overiden by "
-                 "jobOptions... New "
-                 "Trk::ParticleHypothesis: "
-                 << m_overideMaterialEffects);
-  }
-
   m_inputPreparator = std::make_unique<TrackFitInputPreparator>();
-  ATH_MSG_INFO("Initialisation of " << name() << " was successful");
+
   return StatusCode::SUCCESS;
 }
 
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx
index 9b95a0ab243f..3c6063f1c849 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx
@@ -238,8 +238,8 @@ Trk::GsfBetheHeitlerEffects::readParameters()
   fin >> orderPolynomial;
   fin >> m_transformationCode;
   //
-  if (not inRange(m_numberOfComponents, 0, 100)) {
-    ATH_MSG_ERROR("numberOfComponents Parameter out of range 0-100: "
+  if (not inRange(m_numberOfComponents, 0, 8)) {
+    ATH_MSG_ERROR("numberOfComponents Parameter out of range 0-8: "
                   << m_numberOfComponents);
     return false;
   }
@@ -288,8 +288,8 @@ Trk::GsfBetheHeitlerEffects::readParameters()
     fin >> orderPolynomial;
     fin >> m_transformationCodeHighX0;
     //
-    if (not inRange(m_numberOfComponentsHighX0, 0, 100)) {
-      ATH_MSG_ERROR("numberOfComponents Parameter out of range 0-100: "
+    if (not inRange(m_numberOfComponentsHighX0, 0, 8)) {
+      ATH_MSG_ERROR("numberOfComponents Parameter out of range 0-8: "
                     << m_numberOfComponentsHighX0);
       return false;
     }
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx
index 480069ee1be2..b7b99c9aafa1 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx
@@ -39,15 +39,11 @@ Trk::GsfMaterialMixtureConvolution::~GsfMaterialMixtureConvolution() = default;
 StatusCode
 Trk::GsfMaterialMixtureConvolution::initialize()
 {
-
+  if( m_maximumNumberOfComponents > 16){
+      ATH_MSG_FATAL("Requested MaximumNumberOfComponents > 16");
+      return StatusCode::FAILURE;
+  }
   ATH_CHECK(m_materialEffects.retrieve());
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode
-Trk::GsfMaterialMixtureConvolution::finalize()
-{
   return StatusCode::SUCCESS;
 }
 
-- 
GitLab


From 4b3bee8cc4abf9619e14eb08953655617134651a Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Wed, 23 Sep 2020 16:21:17 +0200
Subject: [PATCH 389/422] cleanup

---
 .../TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py  | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
index 040b93cde377..d4c6cc4797fc 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
@@ -816,7 +816,6 @@ def defineMenu():
         'L1_eEM15VHI_2eTAU12IM_gXERHO35' : 477,
         'L1_eEM15VH_MU10' : 478,
         'L1_eEM18VHI_3jJ20' : 489,
-        # 'L1_eEM20VHI_eTAU20IM_2eTAU20_jJ25_3jJ20' :  490,
         'L1_ALFA_ANY' : 490,
         'L1_eEM20VH_3eEM10VH' : 491,
         'L1_eEM22VHI' : 492,
-- 
GitLab


From 0756def054e2ce778524e5642b2cf7e70159205b Mon Sep 17 00:00:00 2001
From: Rupert Tombs <rt500@cam.ac.uk>
Date: Wed, 23 Sep 2020 14:40:29 +0000
Subject: [PATCH 390/422] Implement PileUpMergeSvcCfg configuration for
 digitization modules.

Clean up PileUpMergeSvcCfg with a named keyword argument.

Minor other tidyup.
---
 .../python/BCM_DigitizationConfigNew.py       | 30 +++++++++++---
 .../python/PixelDigitizationConfigNew.py      | 38 ++++++++++++++----
 .../test/PixelDigitizationConfigNew_test.py   | 12 +-----
 .../python/SCT_DigitizationConfigNew.py       | 33 +++++++++++++---
 .../python/TRT_DigitizationConfigNew.py       | 39 +++++++++++++++----
 .../python/CSC_DigitizationConfig.py          | 13 +++++--
 .../python/MDT_DigitizationConfig.py          | 13 +++++--
 .../python/RPC_DigitizationConfig.py          | 13 +++++--
 .../python/TGC_DigitizationConfig.py          |  8 ++--
 .../python/PileUpMergeSvcConfigNew.py         | 13 +++----
 .../python/MCTruthSimAlgsConfigNew.py         |  5 +--
 .../python/TileHitVecToCntConfig.py           | 11 ++++--
 12 files changed, 162 insertions(+), 66 deletions(-)

diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
index 67941c9cade9..3882f4e41916 100644
--- a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
@@ -9,6 +9,7 @@ from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -28,11 +29,10 @@ def BCM_RangeCfg(flags, name="BCM_Range", **kwargs):
     # Default 0 no dataproxy reset
     kwargs.setdefault("CacheRefreshFrequency", 1.0)
     kwargs.setdefault("ItemList", ["SiHitCollection#BCMHits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
-def BCM_DigitizationToolCfg(flags, name="BCM_DigitizationTool", **kwargs):
+def BCM_DigitizationToolCommonCfg(flags, name="BCM_DigitizationTool", **kwargs):
     """Return a ComponentAccumulator with configured BCM_DigitizationTool"""
     # take initial ComponentAccumulator from RNG
     acc = RNG(flags.Random.Engine)
@@ -64,12 +64,30 @@ def BCM_DigitizationToolCfg(flags, name="BCM_DigitizationTool", **kwargs):
     if flags.Digitization.DoXingByXingPileUp:
         kwargs.setdefault("FirstXing", BCM_FirstXing())
         kwargs.setdefault("LastXing",  BCM_LastXing())
-    
+
     BCM_DigitizationTool = CompFactory.BCM_DigitizationTool
     acc.setPrivateTools(BCM_DigitizationTool(name, **kwargs))
     return acc
 
 
+def BCM_DigitizationToolCfg(flags, name="BCM_DigitizationTool", **kwargs):
+    """Return ComponentAccumulator with BCM_DigitizationTool for non-overlay"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(BCM_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
+    tool = acc.popToolsAndMerge(BCM_DigitizationToolCommonCfg(flags, name))
+    acc.setPrivateTools(tool)
+    return acc
+
+
+def BCM_OverlayDigitizationToolCfg(flags, name="BCM_OverlayDigitizationTool", **kwargs):
+    """Return ComponentAccumulator with BCM_DigitizationTool for Overlay"""
+    acc = ComponentAccumulator()
+    tool = acc.popToolsAndMerge(BCM_DigitizationToolCommonCfg(flags, name))
+    acc.setPrivateTools(tool)
+    return acc
+
+
 def BCM_OutputCfg(flags):
     """Return ComponentAccumulator with Output for BCM. Not standalone."""
     acc = ComponentAccumulator()
@@ -85,6 +103,8 @@ def BCM_OutputCfg(flags):
 def BCM_DigitizationBasicCfg(flags, **kwargs):
     """Return ComponentAccumulator for BCM digitization"""
     acc = PixelGeometryCfg(flags)
+    rangetool = acc.popToolsAndMerge(BCM_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     if "PileUpTools" not in kwargs:
         PileUpTools = acc.popToolsAndMerge(BCM_DigitizationToolCfg(flags))
         kwargs["PileUpTools"] = PileUpTools
@@ -97,7 +117,7 @@ def BCM_OverlayDigitizationBasicCfg(flags, name="BCM_OverlayDigitization", **kwa
     acc = PixelGeometryCfg(flags)
 
     if "DigitizationTool" not in kwargs:
-        tool = acc.popToolsAndMerge(BCM_DigitizationToolCfg(flags, name="BCM_OverlayDigitizationTool"))
+        tool = acc.popToolsAndMerge(BCM_OverlayDigitizationToolCfg(flags))
         kwargs["DigitizationTool"] = tool
 
     if flags.Concurrency.NumThreads > 0:
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py
index 64e5ff85bc7c..b133d30a5f7d 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py
@@ -21,6 +21,7 @@ from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSum
 from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -207,38 +208,62 @@ def PixelDigitizationBasicToolCfg(flags, name="PixelDigitizationBasicTool", **kw
 
 def PixelDigitizationToolCfg(flags, name="PixelDigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured BasicPixelDigitizationTool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(PixelRangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("HardScatterSplittingMode", 0)
-    return PixelDigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(PixelDigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def PixelGeantinoTruthDigitizationToolCfg(flags, name="PixelGeantinoTruthDigitizationTool", **kwargs):
     """Return configured PixelDigitizationTool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(PixelRangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("ParticleBarcodeVeto", 0)
     PixelDigitizationTool = CompFactory.PixelDigitizationTool
-    return PixelDigitizationTool(name, **kwargs)
+    acc.setPrivateTools(PixelDigitizationTool(name, **kwargs))
+    return acc
 
 
 def PixelDigitizationHSToolCfg(flags, name="PixelDigitizationHSTool", **kwargs):
     """Return ComponentAccumulator with PixelDigitizationTool configured for Hard Scatter"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(PixelRangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("HardScatterSplittingMode", 1)
-    return PixelDigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(PixelDigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def PixelDigitizationPUToolCfg(flags, name="PixelDigitizationPUTool", **kwargs):
     """Return ComponentAccumulator with PixelDigitizationTool configured for PileUp"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(PixelRangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("HardScatterSplittingMode", 2)
     kwargs.setdefault("RDOCollName", "Pixel_PU_RDOs")
     kwargs.setdefault("SDOCollName", "Pixel_PU_SDO_Map")
-    return PixelDigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(PixelDigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def PixelDigitizationSplitNoMergePUToolCfg(flags, name="PixelDigitizationSplitNoMergePUTool", **kwargs):
     """Return ComponentAccumulator with PixelDigitizationTool configured for PileUpPixelHits"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(PixelRangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("HardScatterSplittingMode", 0)
     kwargs.setdefault("InputObjectName", "PileupPixelHits")
     kwargs.setdefault("RDOCollName", "Pixel_PU_RDOs")
     kwargs.setdefault("SDOCollName", "Pixel_PU_SDO_Map")
-    return PixelDigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(PixelDigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def PixelOverlayDigitizationToolCfg(flags, name="PixelOverlayDigitizationTool", **kwargs):
@@ -256,8 +281,7 @@ def PixelRangeCfg(flags, name="PixelRange", **kwargs):
     kwargs.setdefault("LastXing", Pixel_LastXing(flags))
     kwargs.setdefault("CacheRefreshFrequency", 1.0) # default 0 no dataproxy reset
     kwargs.setdefault("ItemList", ["SiHitCollection#PixelHits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def PixelOutputCfg(flags):
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/test/PixelDigitizationConfigNew_test.py b/InnerDetector/InDetDigitization/PixelDigitization/test/PixelDigitizationConfigNew_test.py
index c24d8f88cf32..1ecfd86a2035 100755
--- a/InnerDetector/InDetDigitization/PixelDigitization/test/PixelDigitizationConfigNew_test.py
+++ b/InnerDetector/InDetDigitization/PixelDigitization/test/PixelDigitizationConfigNew_test.py
@@ -7,21 +7,11 @@ import sys
 from AthenaCommon.Logging import log
 from AthenaCommon.Constants import DEBUG
 from AthenaCommon.Configurable import Configurable
-from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaConfiguration.TestDefaults import defaultTestFiles
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
-from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
-from PixelDigitization.PixelDigitizationConfigNew import (
-    ChargeCollProbSvcCfg, EnergyDepositionToolCfg, SensorSimPlanarToolCfg, SensorSim3DToolCfg,
-    BarrelRD53SimToolCfg, EndcapRD53SimToolCfg, BarrelFEI4SimToolCfg, DBMFEI4SimToolCfg,
-    BarrelFEI3SimToolCfg, EndcapFEI3SimToolCfg, PixelDigitizationBasicToolCfg, PixelDigitizationToolCfg,
-    PixelGeantinoTruthDigitizationToolCfg, PixelDigitizationHSToolCfg, PixelDigitizationPUToolCfg,
-    PixelDigitizationSplitNoMergePUToolCfg, PixelDigitizationOverlayToolCfg, PixelRangeCfg,
-    PixelDigitizationHSCfg, PixelDigitizationPUCfg, PixelDigitizationOverlayCfg,
-)
+from PixelDigitization.PixelDigitizationConfigNew import PixelDigitizationHSCfg
 
 # Set up logging and new style config
 log.setLevel(DEBUG)
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
index c3615af60448..6f64115c6b9a 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
@@ -14,6 +14,7 @@ from SiPropertiesTool.SCT_SiPropertiesConfig import SCT_SiPropertiesCfg
 from SiLorentzAngleTool.SCT_LorentzAngleConfig import SCT_LorentzAngleCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 import AthenaCommon.SystemOfUnits as Units
 
@@ -55,6 +56,9 @@ def SCT_DigitizationCommonCfg(flags, name="SCT_DigitizationToolCommon", **kwargs
 
 def SCT_DigitizationToolCfg(flags, name="SCT_DigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured SCT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(SCT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     if flags.Digitization.PileUpPremixing:
         kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "SCT_RDOs")
         kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "SCT_SDO_Map")
@@ -62,23 +66,35 @@ def SCT_DigitizationToolCfg(flags, name="SCT_DigitizationTool", **kwargs):
         kwargs.setdefault("OutputObjectName", "SCT_RDOs")
         kwargs.setdefault("OutputSDOName", "SCT_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 0)
-    return SCT_DigitizationCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(SCT_DigitizationCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def SCT_DigitizationHSToolCfg(flags, name="SCT_DigitizationHSTool", **kwargs):
     """Return ComponentAccumulator with hard scatter configured SCT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(SCT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "SCT_RDOs")
     kwargs.setdefault("OutputSDOName", "SCT_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 1)
-    return SCT_DigitizationCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(SCT_DigitizationCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def SCT_DigitizationPUToolCfg(flags, name="SCT_DigitizationPUTool",**kwargs):
     """Return ComponentAccumulator with pileup configured SCT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(SCT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "SCT_PU_RDOs")
     kwargs.setdefault("OutputSDOName", "SCT_PU_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 2)
-    return SCT_DigitizationCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(SCT_DigitizationCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def SCT_OverlayDigitizationToolCfg(flags, name="SCT_OverlayDigitizationTool",**kwargs):
@@ -95,13 +111,18 @@ def SCT_OverlayDigitizationToolCfg(flags, name="SCT_OverlayDigitizationTool",**k
 
 def SCT_DigitizationToolSplitNoMergePUCfg(flags, name="SCT_DigitizationToolSplitNoMergePU",**kwargs):
     """Return ComponentAccumulator with merged pileup configured SCT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(SCT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("InputObjectName", "PileupSCT_Hits")
     kwargs.setdefault("HardScatterSplittingMode", 0)
     kwargs.setdefault("OutputObjectName", "SCT_PU_RDOs")
     kwargs.setdefault("OutputSDOName", "SCT_PU_SDO_Map")
     kwargs.setdefault("OnlyHitElements", True)
     kwargs.setdefault("FrontEnd", "PileupSCT_FrontEnd")
-    return SCT_DigitizationCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(SCT_DigitizationCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def SCT_DigitizationToolGeantinoTruthCfg(flags, name="SCT_GeantinoTruthDigitizationTool", **kwargs):
@@ -227,14 +248,14 @@ def SCT_FrontEndPileupCfg(flags, name="PileupSCT_FrontEnd", **kwargs):
     kwargs.setdefault("NoiseOn", False)
     return SCT_FrontEndCfg(flags, name, **kwargs)
 
+
 def SCT_RangeCfg(flags, name="SiliconRange", **kwargs):
     """Return an SCT configured PileUpXingFolder tool"""
     kwargs.setdefault("FirstXing", SCT_FirstXing())
     kwargs.setdefault("LastXing", SCT_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0) # default 0 no dataproxy reset
     kwargs.setdefault("ItemList", ["SiHitCollection#SCT_Hits"] )
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def SCT_OutputCfg(flags):
diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/python/TRT_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/TRT_Digitization/python/TRT_DigitizationConfigNew.py
index 05ea43ed8e2a..1aeb4207ed65 100644
--- a/InnerDetector/InDetDigitization/TRT_Digitization/python/TRT_DigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/TRT_Digitization/python/TRT_DigitizationConfigNew.py
@@ -12,6 +12,7 @@ from TRT_PAI_Process.TRT_PAI_ProcessConfigNew import TRT_PAI_Process_KrToolCfg
 from IOVDbSvc.IOVDbSvcConfig import addFolders
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 
 
@@ -31,8 +32,7 @@ def TRT_RangeCfg(flags, name="TRTRange", **kwargs):
     kwargs.setdefault("LastXing", TRT_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0) #default 0 no dataproxy reset
     kwargs.setdefault("ItemList", ["TRTUncompressedHitCollection#TRTUncompressedHits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def TRT_DigitizationBasicToolCfg(flags, name="TRT_DigitizationBasicTool", **kwargs):
@@ -69,8 +69,12 @@ def TRT_DigitizationBasicToolCfg(flags, name="TRT_DigitizationBasicTool", **kwar
     acc.setPrivateTools(tool)
     return acc
 
+
 def TRT_DigitizationToolCfg(flags, name="TRTDigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured TRT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TRT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     if flags.Digitization.PileUpPremixing:
         kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "TRT_RDOs")
         kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "TRT_SDO_Map")
@@ -78,40 +82,61 @@ def TRT_DigitizationToolCfg(flags, name="TRTDigitizationTool", **kwargs):
         kwargs.setdefault("OutputObjectName", "TRT_RDOs")
         kwargs.setdefault("OutputSDOName", "TRT_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 0)
-    return TRT_DigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(TRT_DigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def TRT_DigitizationGeantinoTruthToolCfg(flags, name="TRT_GeantinoTruthDigitizationTool", **kwargs):
     """Return ComponentAccumulator with Geantino configured TRT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TRT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("ParticleBarcodeVeto", 0)
-    return TRT_DigitizationToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(TRT_DigitizationToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def TRT_DigitizationHSToolCfg(flags, name="TRT_DigitizationToolHS", **kwargs):
     """Return ComponentAccumulator with Hard Scatter configured TRT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TRT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "TRT_RDOs")
     kwargs.setdefault("OutputSDOName", "TRT_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 1)
-    return TRT_DigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(TRT_DigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def TRT_DigitizationPUToolCfg(flags, name="TRT_DigitizationToolPU", **kwargs):
     """Return ComponentAccumulator with Pile Up configured TRT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TRT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "TRT_PU_RDOs")
     kwargs.setdefault("OutputSDOName", "TRT_PU_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 2)
-    return TRT_DigitizationBasicToolCfg(flags, name, **kwargs)
+    acc.merge(TRT_DigitizationBasicToolCfg(flags, name, **kwargs))
+    return acc
 
 
 def TRT_DigitizationSplitNoMergePUToolCfg(flags, name="TRT_DigitizationToolSplitNoMergePU", **kwargs):
     """Return ComponentAccumulator with PileUpTRT_Hits configured TRT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TRT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("HardScatterSplittingMode", 0)
     kwargs.setdefault("DataObjectName", "PileupTRTUncompressedHits")
     kwargs.setdefault("OutputObjectName", "TRT_PU_RDOs")
     kwargs.setdefault("OutputSDOName", "TRT_PU_SDO_Map")
     kwargs.setdefault("Override_noiseInSimhits", 0)
     kwargs.setdefault("Override_noiseInUnhitStraws", 0)
-    return TRT_DigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(TRT_DigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def TRT_OverlayDigitizationToolCfg(flags, name="TRT_OverlayDigitizationTool", **kwargs):
diff --git a/MuonSpectrometer/MuonConfig/python/CSC_DigitizationConfig.py b/MuonSpectrometer/MuonConfig/python/CSC_DigitizationConfig.py
index 7c3010840037..f215ecb6bd30 100644
--- a/MuonSpectrometer/MuonConfig/python/CSC_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/CSC_DigitizationConfig.py
@@ -11,6 +11,7 @@ from MuonConfig.MuonByteStreamCnvTestConfig import CscDigitToCscRDOCfg
 from MuonConfig.MuonCablingConfig import CSCCablingConfigCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -23,14 +24,13 @@ def CSC_LastXing():
     return 175
 
 
-def CSC_RangeToolCfg(flags, name="CSC_Range", **kwargs):
+def CSC_RangeCfg(flags, name="CSC_Range", **kwargs):
     """Return a PileUpXingFolder tool configured for CSC"""
     kwargs.setdefault("FirstXing", CSC_FirstXing())
     kwargs.setdefault("LastXing",  CSC_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0)
     kwargs.setdefault("ItemList", ["CSCSimHitCollection#CSC_Hits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def CSC_DigitizationToolCommonCfg(flags, name="CscDigitizationTool", **kwargs):
@@ -58,13 +58,18 @@ def CSC_DigitizationToolCommonCfg(flags, name="CscDigitizationTool", **kwargs):
 
 def CSC_DigitizationToolCfg(flags, name="CscDigitizationTool", **kwargs):
     """Return a ComponentAccumulator with configured CscDigitizationTool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(CSC_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("InputObjectName", "CSC_Hits")
     kwargs.setdefault("OutputObjectName", "CSC_DIGITS")
     if flags.Digitization.PileUpPremixing:
         kwargs.setdefault("CSCSimDataCollectionOutputName", flags.Overlay.BkgPrefix + "CSC_SDO")
     else:
         kwargs.setdefault("CSCSimDataCollectionOutputName", "CSC_SDO")
-    return CSC_DigitizationToolCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(CSC_DigitizationToolCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def CSC_OverlayDigitizationToolCfg(flags, name="CscOverlayDigitizationTool", **kwargs):
diff --git a/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py b/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py
index 4826a2b8d2ec..94ed7f1ad3ce 100644
--- a/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py
@@ -11,6 +11,7 @@ from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
 from MuonConfig.MuonCalibConfig import MdtCalibrationDbToolCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -24,14 +25,13 @@ def MDT_LastXing():
     return 150
 
 
-def MDT_RangeToolCfg(flags, name="MDT_Range", **kwargs):
+def MDT_RangeCfg(flags, name="MDT_Range", **kwargs):
     """Return a PileUpXingFolder tool configured for MDT"""
     kwargs.setdefault("FirstXing", MDT_FirstXing())
     kwargs.setdefault("LastXing",  MDT_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0)
     kwargs.setdefault("ItemList", ["MDTSimHitCollection#MDT_Hits"])
-    PileUpXingFolder=CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def RT_Relation_DB_DigiToolCfg(flags, name="RT_Relation_DB_DigiTool", **kwargs):
@@ -82,12 +82,17 @@ def MDT_DigitizationToolCommonCfg(flags, name="MdtDigitizationTool", **kwargs):
 
 def MDT_DigitizationToolCfg(flags, name="MdtDigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured MdtDigitizationTool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(MDT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "MDT_DIGITS")
     if flags.Digitization.PileUpPremixing:
         kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "MDT_SDO")
     else:
         kwargs.setdefault("OutputSDOName", "MDT_SDO")
-    return MDT_DigitizationToolCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(MDT_DigitizationToolCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def MDT_OverlayDigitizationToolCfg(flags, name="Mdt_OverlayDigitizationTool", **kwargs):
diff --git a/MuonSpectrometer/MuonConfig/python/RPC_DigitizationConfig.py b/MuonSpectrometer/MuonConfig/python/RPC_DigitizationConfig.py
index 50333b6e6fe7..11876f0d741e 100644
--- a/MuonSpectrometer/MuonConfig/python/RPC_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/RPC_DigitizationConfig.py
@@ -10,6 +10,7 @@ from MuonConfig.MuonByteStreamCnvTestConfig import RpcDigitToRpcRDOCfg
 from MuonConfig.MuonCablingConfig import RPCCablingConfigCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -22,14 +23,13 @@ def RPC_LastXing():
     return 125
 
 
-def RPC_RangeToolCfg(flags, name="RPC_Range", **kwargs):
+def RPC_RangeCfg(flags, name="RPC_Range", **kwargs):
     """Return a PileUpXingFolder tool configured for RPC"""
     kwargs.setdefault("FirstXing", RPC_FirstXing())
     kwargs.setdefault("LastXing", RPC_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0)
     kwargs.setdefault("ItemList", ["RPCSimHitCollection#RPC_Hits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def RPC_DigitizationToolCommonCfg(flags, name="RpcDigitizationTool", **kwargs):
@@ -84,12 +84,17 @@ def RPC_DigitizationToolCommonCfg(flags, name="RpcDigitizationTool", **kwargs):
 
 def RPC_DigitizationToolCfg(flags, name="RpcDigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured RpcDigitizationTool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(RPC_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "RPC_DIGITS")
     if flags.Digitization.PileUpPremixing:
         kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "RPC_SDO")
     else:
         kwargs.setdefault("OutputSDOName", "RPC_SDO")
-    return RPC_DigitizationToolCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(RPC_DigitizationToolCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def RPC_OverlayDigitizationToolCfg(flags, name="Rpc_OverlayDigitizationTool", **kwargs):
diff --git a/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py b/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py
index 8d91c5a29c17..e0b8f50e9c2d 100644
--- a/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py
@@ -10,6 +10,7 @@ from MuonConfig.MuonByteStreamCnvTestConfig import TgcDigitToTgcRDOCfg
 from MuonConfig.MuonCablingConfig import TGCCablingConfigCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -22,19 +23,20 @@ def TGC_LastXing():
     return 75
 
 
-def TGC_RangeToolCfg(flags, name="TGC_Range", **kwargs):
+def TGC_RangeCfg(flags, name="TGC_Range", **kwargs):
     """Return a PileUpXingFolder tool configured for TGC"""
     kwargs.setdefault("FirstXing", TGC_FirstXing())
     kwargs.setdefault("LastXing", TGC_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0)
     kwargs.setdefault("ItemList", ["TGCSimHitCollection#TGC_Hits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def TGC_DigitizationToolCfg(flags, name="TgcDigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured TgcDigitizationTool"""
     acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TGC_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     if flags.Digitization.DoXingByXingPileUp:
         kwargs.setdefault("FirstXing", TGC_FirstXing())
         kwargs.setdefault("LastXing", TGC_LastXing())
diff --git a/Simulation/Digitization/python/PileUpMergeSvcConfigNew.py b/Simulation/Digitization/python/PileUpMergeSvcConfigNew.py
index c89acc0eba56..c19d73763523 100644
--- a/Simulation/Digitization/python/PileUpMergeSvcConfigNew.py
+++ b/Simulation/Digitization/python/PileUpMergeSvcConfigNew.py
@@ -6,22 +6,19 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 
 
-def PileUpMergeSvcCfg(flags, name="PileUpMergeSvc", **kwargs):
+def PileUpMergeSvcCfg(flags, name="PileUpMergeSvc", Intervals=[], **kwargs):
     """Return ComponentAccumulator with PileUpMergeSvc
 
-    If doing XingByXingPileUp, the "Intervals" keyword argument should
-    be set with PileUpXingFolder tools.
-    Otherwise, "Intervals" is should be empty, and we enforce that here.
+    If doing XingByXingPileUp, Intervals should contian PileUpXingFolder tools.
+    Otherwise it should be empty, and we enforce that here.
     """
     acc = ComponentAccumulator()
 
     if flags.Digitization.DoXingByXingPileUp:
         # handle input type variety
-        Intervals = kwargs.setdefault("Intervals", [])
         if not isinstance(Intervals, list):
-            kwargs["Intervals"] = [Intervals]
-    else:
-        kwargs["Intervals"] = []
+            Intervals = [Intervals]
+        kwargs["Intervals"] = Intervals
 
     acc.addService(CompFactory.PileUpMergeSvc(name, **kwargs))
     return acc
diff --git a/Simulation/G4Utilities/MCTruthSimAlgs/python/MCTruthSimAlgsConfigNew.py b/Simulation/G4Utilities/MCTruthSimAlgs/python/MCTruthSimAlgsConfigNew.py
index e020d2997f14..a32b0552f450 100644
--- a/Simulation/G4Utilities/MCTruthSimAlgs/python/MCTruthSimAlgsConfigNew.py
+++ b/Simulation/G4Utilities/MCTruthSimAlgs/python/MCTruthSimAlgsConfigNew.py
@@ -7,7 +7,6 @@ from AthenaConfiguration.ComponentFactory import CompFactory
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
 from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
-
 # Note: various experimentalDigi uses not migrated
 
 def GenericMergeMcEventCollCfg(flags, name="MergeMcEventCollTool", **kwargs):
@@ -119,7 +118,7 @@ def TrackRecord_LastXing():
     return 1
 
 
-def TrackRangeCfg(flags, name="TrackRange" , **kwargs):
+def TrackRangeCfg(flags, name="TrackRange", **kwargs):
     """Return a Track configured PileUpXingFolder tool"""
     # this is the time of the xing in ns
     kwargs.setdefault("FirstXing", TrackRecord_FirstXing())
@@ -226,7 +225,7 @@ def TimingObj_LastXing():
     return 1
 
 
-def TimingObjRangeCfg(flags, name="TimingObjRange" , **kwargs):
+def TimingObjRangeCfg(flags, name="TimingObjRange", **kwargs):
     """Return a RecoTiming configured PileUpXingFolder tool"""
     #this is the time of the xing in ns
     kwargs.setdefault("FirstXing", TimingObj_FirstXing())
diff --git a/TileCalorimeter/TileSimAlgs/python/TileHitVecToCntConfig.py b/TileCalorimeter/TileSimAlgs/python/TileHitVecToCntConfig.py
index c38fe1c4f3e9..699717870314 100644
--- a/TileCalorimeter/TileSimAlgs/python/TileHitVecToCntConfig.py
+++ b/TileCalorimeter/TileSimAlgs/python/TileHitVecToCntConfig.py
@@ -5,6 +5,7 @@
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 def getTileFirstXing():
     """Return the earliest bunch crossing time for which interactions will be sent to the TileHitVecToCntTool"""
@@ -16,14 +17,12 @@ def getTileLastXing():
     return 150
 
 
-def getTileRange(name = 'TileRange', **kwargs):
+def TileRangeCfg(flags, name = 'TileRange', **kwargs):
     """Return a PileUpXingFolder tool for Tile"""
     kwargs.setdefault('FirstXing', getTileFirstXing() )
     kwargs.setdefault('LastXing',  getTileLastXing() )
     kwargs.setdefault('ItemList', ['TileHitVector#TileHitVec', 'TileHitVector#MBTSHits'] )
-
-    PileUpXingFolder=CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def TileHitVecToCntToolCfg(flags, **kwargs):
@@ -78,6 +77,10 @@ def TileHitVecToCntToolCfg(flags, **kwargs):
         kwargs.setdefault("FirstXing", getTileFirstXing() )
         kwargs.setdefault("LastXing",  getTileLastXing() )
 
+    if flags.Detector.OverlayTile:
+        rangetool = acc.popToolsAndMerge(TileRangeCfg(flags))
+        acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
+
     TileHitVecToCntTool=CompFactory.TileHitVecToCntTool
     acc.setPrivateTools(TileHitVecToCntTool(**kwargs))
 
-- 
GitLab


From 8d77fb23c52d65539e5b5af324eb2ca9842ee81a Mon Sep 17 00:00:00 2001
From: Christos Anastopoulos <christos.anastopoulos@cern.ch>
Date: Wed, 23 Sep 2020 14:53:28 +0000
Subject: [PATCH 391/422] Track summary  allow for true "update" clarify a bit
 the different purpose of methods

---
 .../src/EMBremCollectionBuilder.cxx           |  62 +++---
 .../IExtendedTrackSummaryTool.h               |  15 +-
 .../TrkToolInterfaces/ITrackSummaryTool.h     |  33 ++--
 .../TrkTrackSummaryTool/TrackSummaryTool.h    |  99 +++++++---
 .../src/TrackSummaryTool.cxx                  | 181 +++++++++---------
 5 files changed, 225 insertions(+), 165 deletions(-)

diff --git a/Reconstruction/egamma/egammaAlgs/src/EMBremCollectionBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/EMBremCollectionBuilder.cxx
index 969e7ee50f97..fedb6bc04bac 100644
--- a/Reconstruction/egamma/egammaAlgs/src/EMBremCollectionBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/EMBremCollectionBuilder.cxx
@@ -43,7 +43,7 @@ StatusCode EMBremCollectionBuilder::initialize() {
   ATH_CHECK(m_OutputTrkPartContainerKey.initialize());
   ATH_CHECK(m_OutputTrackContainerKey.initialize());
   ATH_CHECK(m_TruthParticlesLinkKey.initialize(m_doTruth));
-  
+
   /* retrieve the track refitter tool*/
   ATH_CHECK(m_trkRefitTool.retrieve());
   /* Get the particle creation tool */
@@ -52,12 +52,12 @@ StatusCode EMBremCollectionBuilder::initialize() {
   ATH_CHECK(m_slimTool.retrieve());
   /* Get the track summary tool */
   ATH_CHECK(m_summaryTool.retrieve());
-  
+
   return StatusCode::SUCCESS;
-}  
+}
+
+StatusCode EMBremCollectionBuilder::EMBremCollectionBuilder::finalize(){
 
-StatusCode EMBremCollectionBuilder::EMBremCollectionBuilder::finalize(){ 
-  
   ATH_MSG_INFO ("Not refitted due to Silicon Requirements " << m_FailedSiliconRequirFit);
   ATH_MSG_INFO ("Failed Fit Tracks " << m_FailedFitTracks);
   ATH_MSG_INFO ("RefittedTracks " << m_RefittedTracks);
@@ -99,62 +99,62 @@ EMBremCollectionBuilder::execute_r(const EventContext& ctx) const
   SG::WriteHandle<TrackCollection> finalTracks(m_OutputTrackContainerKey, ctx);
   ATH_CHECK(finalTracks.record(std::make_unique<TrackCollection>()));
   TrackCollection* cPtrTracks = finalTracks.ptr();
-  /* 
+  /*
    * Split TRT-alone from silicon ones
    * For the TRT we can get all the info already
    */
   std::vector<const xAOD::TrackParticle*> siliconTrkTracks;
-  siliconTrkTracks.reserve(16); 
+  siliconTrkTracks.reserve(16);
   std::vector<TrackWithIndex> trtAloneTrkTracks;
-  trtAloneTrkTracks.reserve(16); 
+  trtAloneTrkTracks.reserve(16);
   for(const xAOD::TrackParticle* track : *selectedTracks){
     const Trk::Track* trktrack{nullptr};
-    if (  track->trackLink().isValid() ){ 
+    if (  track->trackLink().isValid() ){
       trktrack =track->track();
     }
     else{
       ATH_MSG_ERROR("TrackParticle has not Track --  are you running on AOD?");
       return StatusCode::FAILURE;
     }
-    int nSiliconHits_trk =0; 
-    uint8_t dummy(0); 
+    int nSiliconHits_trk =0;
+    uint8_t dummy(0);
     if( track->summaryValue(dummy,xAOD::numberOfSCTHits) ){
       nSiliconHits_trk += dummy;
     }
     if(track->summaryValue(dummy,xAOD::numberOfPixelHits) ){
       nSiliconHits_trk += dummy;
     }
-    ATH_MSG_DEBUG("Number of Silicon hits "<<nSiliconHits_trk);    
+    ATH_MSG_DEBUG("Number of Silicon hits "<<nSiliconHits_trk);
 
     if(nSiliconHits_trk >= m_MinNoSiHits){
-      siliconTrkTracks.push_back(track); 
+      siliconTrkTracks.push_back(track);
     }else{
       //copy Trk::Track and keep also the index of the original
       trtAloneTrkTracks.emplace_back(
         std::make_unique<Trk::Track>(*trktrack),track->index());
     }
   }
-  /* 
+  /*
    * Refitted  and possible failed fit info
    */
-  std::vector<TrackWithIndex> refitted; 
-  refitted.reserve(siliconTrkTracks.size());    
-  std::vector<TrackWithIndex> failedfit; 
+  std::vector<TrackWithIndex> refitted;
+  refitted.reserve(siliconTrkTracks.size());
+  std::vector<TrackWithIndex> failedfit;
   /*
    * Do the refit and get all the info
    */
-  ATH_CHECK(refitTracks(ctx,siliconTrkTracks,refitted,failedfit)); 
+  ATH_CHECK(refitTracks(ctx,siliconTrkTracks,refitted,failedfit));
   siliconTrkTracks.clear();
   /*
    * Fill the final collections
    */
   ATH_CHECK(createCollections(refitted,failedfit,trtAloneTrkTracks,
                     cPtrTracks,cPtrTrkPart,trackTES.ptr()));
-   /* 
+   /*
    * update counters
    * */
   m_RefittedTracks.fetch_add(refitted.size(), std::memory_order_relaxed);
-  m_FailedFitTracks.fetch_add(failedfit.size(), std::memory_order_relaxed); 
+  m_FailedFitTracks.fetch_add(failedfit.size(), std::memory_order_relaxed);
   m_FailedSiliconRequirFit.fetch_add(trtAloneTrkTracks.size(),std::memory_order_relaxed);
   return StatusCode::SUCCESS;
 }
@@ -169,7 +169,7 @@ EMBremCollectionBuilder::refitTracks(
   for (const xAOD::TrackParticle* in:input){
     const Trk::Track* track =in->track();
     IegammaTrkRefitterTool::Cache cache{};
-    StatusCode status = m_trkRefitTool->refitTrack(ctx,                                                   
+    StatusCode status = m_trkRefitTool->refitTrack(ctx,
                                                    track,
                                                    cache);
     if (status == StatusCode::SUCCESS){
@@ -177,7 +177,7 @@ EMBremCollectionBuilder::refitTracks(
       //this is new track
       refitted.emplace_back(
         std::move(cache.refittedTrack),in->index()
-        ); 
+        );
     }
     else{
       ATH_MSG_DEBUG("FIT FAILED ");
@@ -185,7 +185,7 @@ EMBremCollectionBuilder::refitTracks(
       failedfit.emplace_back(
         std::make_unique<Trk::Track>(*track),in->index()
         );
-    }    
+    }
   }
   return StatusCode::SUCCESS;
 }
@@ -210,11 +210,11 @@ EMBremCollectionBuilder::createCollections(
   for (auto& Info : refitted){
     ATH_CHECK(createNew(Info,finalTracks,finalTrkPartContainer,AllTracks));
   }
-                                                               
+
   for (auto& Info  :  failedfit){
     ATH_CHECK(createNew(Info,finalTracks,finalTrkPartContainer,AllTracks));
   }
-                                                                
+
   for (auto& Info : trtAlone){
     ATH_CHECK(createNew(Info,finalTracks,finalTrkPartContainer,AllTracks));
   }
@@ -299,7 +299,7 @@ EMBremCollectionBuilder::createNew(
   m_slimTool->slimTrack(*(Info.track));
   finalTracks->push_back(std::move(Info.track));
   ElementLink<TrackCollection> trackLink(*finalTracks,finalTracks->size()-1);
-  aParticle->setTrackLink( trackLink );     
+  aParticle->setTrackLink( trackLink );
   return StatusCode::SUCCESS;
 }
 
@@ -310,19 +310,19 @@ EMBremCollectionBuilder::updateGSFTrack(
 {
 
   //update the summary of the non-const track without hole search
-  m_summaryTool->updateRefittedTrack(*(Info.track));
+  m_summaryTool->updateTrackSummary(*(Info.track));
   //Get the summary so as to add info to it
   Trk::TrackSummary* summary = Info.track->trackSummary();
 
   size_t origIndex = Info.origIndex;
   const xAOD::TrackParticle* original = AllTracks->at(origIndex);
-  
+
   uint8_t dummy(0);
   if (m_doPix) {
     //copy over dead sensors
     uint8_t deadPixel= original->summaryValue(dummy,xAOD::numberOfPixelDeadSensors)?dummy:0;
     summary->update(Trk::numberOfPixelDeadSensors,deadPixel);
-    
+
     int nPixHitsRefitted = summary->get(Trk::numberOfPixelHits);
     int nPixOutliersRefitted = summary->get(Trk::numberOfPixelOutliers);
     int nPixHitsOriginal = original->summaryValue(dummy,xAOD::numberOfPixelHits) ? dummy:-1;
@@ -336,10 +336,10 @@ EMBremCollectionBuilder::updateGSFTrack(
   }
   if (m_doSCT) {
     uint8_t deadSCT= original->summaryValue(dummy,xAOD::numberOfSCTDeadSensors)?dummy:0;
-    summary->update(Trk::numberOfSCTDeadSensors,deadSCT); 
+    summary->update(Trk::numberOfSCTDeadSensors,deadSCT);
 
     uint8_t SCTDoubleHoles = original->summaryValue(dummy,xAOD::numberOfSCTDoubleHoles )?dummy:0;
-    summary->update(Trk::numberOfSCTDoubleHoles , SCTDoubleHoles); 
+    summary->update(Trk::numberOfSCTDoubleHoles , SCTDoubleHoles);
 
     int nSCTHitsRefitted = summary->get(Trk::numberOfSCTHits);
     int nSCTOutliersRefitted = summary->get(Trk::numberOfSCTOutliers);
diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h
index a079f8ac11c6..da1c39a339dd 100644
--- a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h
+++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h
@@ -47,14 +47,21 @@ public:
     Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map,
     bool suppress_hole_search = false) const = 0;
-
-  /** create a summary object from passed Track.*/
+  
+   /* Start from a copy of the existing input track summary if there,
+    * otherwise start from a new one. Fill it and return it.
+    * Does not modify the const track.
+    */
   virtual std::unique_ptr<Trk::TrackSummary> summary(
     const Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map) const = 0;
 
-  /** create a summary object of passed track without doing the tedious hole
-   * search. */
+
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * but without doing the hole search.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summaryNoHoleSearch(
     const Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map) const = 0;
diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h
index 75616e5fb9b6..7417ae0e0a3e 100755
--- a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h
+++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h
@@ -27,26 +27,35 @@ class ITrackSummaryTool : virtual public IAlgTool
 public:
   static const InterfaceID& interfaceID();
 
-  /** Create a  new summary object from a passed Track or clone
-   * the existing.
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * Does not modify the const track.
    */
   virtual std::unique_ptr<Trk::TrackSummary> summary(
     const Track& track) const = 0;
-
-  /** create a summary object from a passed track, without doing the tedious
-   hole search, or clone the existing.*/
+  
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * but without doing the hole search.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summaryNoHoleSearch(
     const Track& track) const = 0;
 
-  /** Method which can be used to update the track and add a summary to it.
-      This can be used to add a summary to a track and then retrieve it from it
-     without the need to clone. */
+  /** Same behavious as
+   * IExtendedTrackSummaryTool:computeAndReplaceTrackSummary
+   * but without the need to pass
+   * Trk::PRDtoTrackMap
+   * Does hole search
+   */
   virtual void updateTrack(Track& track) const = 0;
 
-  /** method which can be used to update a refitted track and add a summary to
-   * it, without doing shard hit/ or hole search. Adds a summary to a track and
-   * then retrieve it from it without the need to clone. */
-  virtual void updateRefittedTrack(Track& track) const = 0;
+  /** method which can be used to update the summary of a track
+   * it, without doing shared hit/ or hole search. 
+   * If a summary is present is modified in place
+   * otherwise a new one is created.
+   */
+  virtual void updateTrackSummary(Track& track) const = 0;
 
   /** method to update the shared hit content only, this is optimised for track
    * collection merging. */
diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h
index c134eb940a35..376249d54fd6 100755
--- a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h
+++ b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h
@@ -72,26 +72,63 @@ public:
     const Trk::PRDtoTrackMap* prd_to_track_map,
     bool suppress_hole_search = false) const override;
 
-  /** create a summary object from passed Track or clone the existing*/
+  /** Same behavious as
+   * IExtendedTrackSummaryTool:computeAndReplaceTrackSummary
+   * but without the need to pass
+   * Trk::PRDtoTrackMap
+   * Does hole search
+   */
+  virtual void updateTrack(Track& track) const override
+  {
+   computeAndReplaceTrackSummary(track,nullptr,false /*DO NOT suppress hole search*/);
+  }
+  
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summary(
     const Track& track) const override;
 
-  /** create a summary object of passed track, without doing the tedious hole
-   * search, or clone the existing*/
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * but without doing the hole search.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summaryNoHoleSearch(
     const Track& track) const override;
 
-  /** create a summary object from passed Track,*/
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summary(
     const Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map) const override;
-
-  /** create a summary object of passed track without doing the tedious hole
-   * search. */
+  
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * but without doing the hole search.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summaryNoHoleSearch(
     const Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map) const override;
 
+  /** method which can be used to update the summary of a track
+   * it, without doing shared hit/ or hole search. 
+   * If a summary is present it is  modified in place.
+   * Otherwise a new one is created and filled.
+   */
+  virtual void updateTrackSummary(Track& track) const override
+  {
+    /*suppress hole search*/
+    UpdateSummary(track, nullptr, true);
+    /*Needed for expected B-Layer*/
+    m_idTool->updateExpectedHitInfo(track, *track.trackSummary());
+  }
+
+ 
   /** method to update the shared hit content only, this is optimised for track
    * collection merging. */
   virtual void updateSharedHitCount(
@@ -125,23 +162,6 @@ public:
     }
   }
 
-  /** use this method to update a track. this means a tracksummary is created
-  for this track but not returned. the summary can then be obtained from the
-  track. Because it is taken from the track the ownership stays with the track
-*/
-  virtual void updateTrack(Track& track) const override
-  {
-    updateTrack(track, nullptr);
-  }
-
-  /** method which can be used to update a refitted track and add a summary to
-   * it, without doing shard hit/ or hole search. Adds a summary to a track and
-   * then retrieve it from it without the need to clone. */
-  virtual void updateRefittedTrack(Track& track) const override
-  {
-    updateTrackNoHoleSearch(track, nullptr);
-  }
-
   /** Update the shared hit count of the given track summary.
    * @param summary the summary to be updated i.e. a copy of the track summary
    * of the given track.
@@ -207,6 +227,33 @@ public:
   }
 
 private:
+
+  /*
+   * Fill the summary info for a Track*/
+  void fillSummary(Trk::TrackSummary& ts,
+                   const Trk::Track& track,
+                   const Trk::PRDtoTrackMap *prd_to_track_map,
+                   bool doHolesInDet,
+                   bool doHolesMuon) const;
+
+  /*
+   * If a summary is there Update it with the required info.
+   * If not there create a new one with the required info.
+   */
+  void UpdateSummary(Track& track,
+                     const Trk::PRDtoTrackMap* prd_to_track_map,
+                     bool suppress_hole_search) const
+  {
+    if (!track.trackSummary()) {
+      track.setTrackSummary(std::make_unique<Trk::TrackSummary>());
+    }
+    fillSummary(*(track.trackSummary()),
+                track,
+                prd_to_track_map,
+                m_doHolesInDet && !suppress_hole_search,
+                m_doHolesMuon && !suppress_hole_search);
+  }
+
   void updateAdditionalInfo(const Track& track,
                             const Trk::PRDtoTrackMap* prd_to_track_map,
                             TrackSummary& summary,
@@ -219,10 +266,6 @@ private:
   void updateTrack(Track& track,
                    const Trk::PRDtoTrackMap* prd_to_track_map) const;
 
-  void updateTrackNoHoleSearch(
-    Track& track,
-    const Trk::PRDtoTrackMap* prd_to_track_map) const;
-
   std::unique_ptr<Trk::TrackSummary> createSummary(
     const Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map,
diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
index f84bcee4a5df..e4d61f0349a8 100755
--- a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
+++ b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
@@ -117,43 +117,53 @@ StatusCode
 }
 
 /*
- * First the methods to create a new or clone the existing
+ * Method that creates a new summary for the track.
+ * First calculates a summary according to job options.
+ * If one is present it uses it as starting point (cloning it).
+ * But adds relavant info.
+ * And then sets the Track Summary for the non-const
+ * track.
  */
-void Trk::TrackSummaryTool::computeAndReplaceTrackSummary(Trk::Track &track,
-                                                          const Trk::PRDtoTrackMap *prd_to_track_map,
-                                                          bool suppress_hole_search) const {
-  track.setTrackSummary(
-    createSummary(
-      track,
-      prd_to_track_map,
-      m_doHolesInDet & !suppress_hole_search,
-      m_doHolesMuon  & !suppress_hole_search
-    )
-  );
+void
+Trk::TrackSummaryTool::computeAndReplaceTrackSummary(
+  Trk::Track& track,
+  const Trk::PRDtoTrackMap* prd_to_track_map,
+  bool suppress_hole_search) const
+{
+  track.setTrackSummary(createSummary(track,
+                                      prd_to_track_map,
+                                      m_doHolesInDet & !suppress_hole_search,
+                                      m_doHolesMuon & !suppress_hole_search));
 }
 
-std::unique_ptr<Trk::TrackSummary> Trk::TrackSummaryTool::summary( const Track& track) const
+std::unique_ptr<Trk::TrackSummary>
+Trk::TrackSummaryTool::summary(const Track& track) const
 {
-  return createSummary(track, nullptr, m_doHolesInDet, m_doHolesMuon );
+  return createSummary(track, nullptr, m_doHolesInDet, m_doHolesMuon);
 }
 
-std::unique_ptr<Trk::TrackSummary> Trk::TrackSummaryTool::summary( const Track& track,
-                                                                   const Trk::PRDtoTrackMap *prd_to_track_map) const
+std::unique_ptr<Trk::TrackSummary>
+Trk::TrackSummaryTool::summary(const Track& track,
+                               const Trk::PRDtoTrackMap* prd_to_track_map) const
 {
-  return createSummary(track, prd_to_track_map, m_doHolesInDet, m_doHolesMuon );
+  return createSummary(track, prd_to_track_map, m_doHolesInDet, m_doHolesMuon);
 }
 
-std::unique_ptr<Trk::TrackSummary> Trk::TrackSummaryTool::summaryNoHoleSearch( const Track& track) const
+std::unique_ptr<Trk::TrackSummary>
+Trk::TrackSummaryTool::summaryNoHoleSearch(const Track& track) const
 {
-  return createSummary(track, nullptr, false, false );
+  return createSummary(track, nullptr, false, false);
 }
 
-std::unique_ptr<Trk::TrackSummary> Trk::TrackSummaryTool::summaryNoHoleSearch( const Track& track,
-                                                                               const Trk::PRDtoTrackMap *prd_to_track_map) const
+std::unique_ptr<Trk::TrackSummary>
+Trk::TrackSummaryTool::summaryNoHoleSearch(
+  const Track& track,
+  const Trk::PRDtoTrackMap* prd_to_track_map) const
 {
-  return createSummary(track, prd_to_track_map, false, false );
+  return createSummary(track, prd_to_track_map, false, false);
 }
 
+//Method to create a new summary
 std::unique_ptr<Trk::TrackSummary>
 Trk::TrackSummaryTool::createSummary( const Track& track,
                                       const Trk::PRDtoTrackMap *prd_to_track_map,
@@ -169,60 +179,72 @@ Trk::TrackSummaryTool::createSummary( const Track& track,
   } else {
     ts = std::make_unique<Trk::TrackSummary>();
   }
+  //fill the summary
+  fillSummary(*ts, track, prd_to_track_map, doHolesInDet, doHolesMuon);
+  return ts;
+}
 
-  std::vector<int> & information = ts->m_information;
-  information.resize(std::min(information.size(), static_cast<size_t>(numberOfTrackSummaryTypes)));
+// Method filling the summary with information
+void
+Trk::TrackSummaryTool::fillSummary(Trk::TrackSummary& ts,
+                                   const Trk::Track& track,
+                                   const Trk::PRDtoTrackMap *prd_to_track_map,
+                                   bool doHolesInDet,
+                                   bool doHolesMuon) const {
 
-  // Troels.Petersen@cern.ch:
-  unsigned int numberOfeProbabilityTypes = Trk::numberOfeProbabilityTypes+1;
-  std::vector<float> eProbability(numberOfeProbabilityTypes,0.5);
+std::vector<int>& information = ts.m_information;
+information.resize(std::min(information.size(),
+                            static_cast<size_t>(numberOfTrackSummaryTypes)));
 
-  float dedx=-1;
-  int nhitsuseddedx=-1;
-  int noverflowhitsdedx=-1;
+// Troels.Petersen@cern.ch:
+unsigned int numberOfeProbabilityTypes = Trk::numberOfeProbabilityTypes + 1;
+std::vector<float> eProbability(numberOfeProbabilityTypes, 0.5);
+
+  float dedx = -1;
+  int nhitsuseddedx = -1;
+  int noverflowhitsdedx = -1;
 
   // Now set values to 0 for the ones we evaluate
   if (!m_idTool.empty()) {
-    if (m_pixelExists)
-    {
-      information [numberOfContribPixelLayers]   = 0;
-      information [numberOfInnermostPixelLayerHits] = 0;
-      information [numberOfInnermostPixelLayerOutliers] = 0;
-      information [numberOfNextToInnermostPixelLayerHits] = 0;
-      information [numberOfNextToInnermostPixelLayerOutliers] = 0;
-      information [numberOfPixelHits]            = 0;
-      information [numberOfPixelOutliers]        = 0;
-      information [numberOfGangedPixels]         = 0;
-      information [numberOfGangedFlaggedFakes]   = 0;
-      information [numberOfPixelSpoiltHits]      = 0;
-      information [numberOfGangedFlaggedFakes]   = 0;
-      information [numberOfPixelSplitHits]       = 0;
-      information [numberOfInnermostLayerSplitHits] = 0;
-      information [numberOfNextToInnermostLayerSplitHits] = 0;
-      if (track.info().trackFitter() != TrackInfo::Unknown && !m_dedxtool.empty()) {
+    if (m_pixelExists) {
+      information[numberOfContribPixelLayers] = 0;
+      information[numberOfInnermostPixelLayerHits] = 0;
+      information[numberOfInnermostPixelLayerOutliers] = 0;
+      information[numberOfNextToInnermostPixelLayerHits] = 0;
+      information[numberOfNextToInnermostPixelLayerOutliers] = 0;
+      information[numberOfPixelHits] = 0;
+      information[numberOfPixelOutliers] = 0;
+      information[numberOfGangedPixels] = 0;
+      information[numberOfGangedFlaggedFakes] = 0;
+      information[numberOfPixelSpoiltHits] = 0;
+      information[numberOfGangedFlaggedFakes] = 0;
+      information[numberOfPixelSplitHits] = 0;
+      information[numberOfInnermostLayerSplitHits] = 0;
+      information[numberOfNextToInnermostLayerSplitHits] = 0;
+      if (track.info().trackFitter() != TrackInfo::Unknown &&
+          !m_dedxtool.empty()) {
         dedx = m_dedxtool->dEdx(track, nhitsuseddedx, noverflowhitsdedx);
       }
-      information [Trk::numberOfDBMHits]                  = 0;
+      information[Trk::numberOfDBMHits] = 0;
     }
-    information [numberOfSCTHits]                  = 0;
-    information [numberOfSCTSpoiltHits]            = 0;
-    information [numberOfSCTOutliers]              = 0;
-    information [numberOfTRTHits]                  = 0;
-    information [numberOfTRTXenonHits]             = 0;
-    information [numberOfTRTHighThresholdHits]     = 0;
-    information [numberOfTRTHighThresholdHitsTotal]= 0;
-    information [numberOfTRTOutliers]              = 0;
-    information [numberOfTRTHighThresholdOutliers] = 0;
-    information [numberOfTRTTubeHits]              = 0;
-    information [numberOfTRTSharedHits]            = 0;
+    information[numberOfSCTHits] = 0;
+    information[numberOfSCTSpoiltHits] = 0;
+    information[numberOfSCTOutliers] = 0;
+    information[numberOfTRTHits] = 0;
+    information[numberOfTRTXenonHits] = 0;
+    information[numberOfTRTHighThresholdHits] = 0;
+    information[numberOfTRTHighThresholdHitsTotal] = 0;
+    information[numberOfTRTOutliers] = 0;
+    information[numberOfTRTHighThresholdOutliers] = 0;
+    information[numberOfTRTTubeHits] = 0;
+    information[numberOfTRTSharedHits] = 0;
 
     // Troels.Petersen@cern.ch:
-    if ( !m_eProbabilityTool.empty() ) {
+    if (!m_eProbabilityTool.empty()) {
       eProbability = m_eProbabilityTool->electronProbability(track);
     }
   }
 
-
   if (m_doSharedHits) {
     information [numberOfSCTSharedHits]      = 0;
     if (m_pixelExists) {
@@ -297,43 +319,22 @@ Trk::TrackSummaryTool::createSummary( const Track& track,
     eProbability.push_back(0.0);
   }
 
-  ts->m_eProbability = eProbability;
-  ts->m_idHitPattern = hitPattern.to_ulong();
-  ts->m_dedx = dedx;
-  ts->m_nhitsdedx = nhitsuseddedx;
-  ts->m_nhitsoverflowdedx = noverflowhitsdedx;
+  ts.m_eProbability = eProbability;
+  ts.m_idHitPattern = hitPattern.to_ulong();
+  ts.m_dedx = dedx;
+  ts.m_nhitsdedx = nhitsuseddedx;
+  ts.m_nhitsoverflowdedx = noverflowhitsdedx;
 
   // add detailed summary for indet
   if( m_addInDetDetailedSummary && !m_idTool.empty() ){
-    m_idTool->addDetailedTrackSummary(track,*ts);
+    m_idTool->addDetailedTrackSummary(track,ts);
   }
   // add detailed summary for muons
   if( m_addMuonDetailedSummary && !m_muonTool.empty() ){
-    m_muonTool->addDetailedTrackSummary(track,*ts);
+    m_muonTool->addDetailedTrackSummary(track,ts);
   }
   // move this part to VERBOSE
-  ATH_MSG_VERBOSE ( *ts << endmsg << "Finished!");
-
-  return ts;
-}
-
-/*
- * The the update methods
- */
-
-void Trk::TrackSummaryTool::updateTrack(Track& track,const Trk::PRDtoTrackMap *prd_to_track_map) const
-{
-  // first check if track has summary already.
-  computeAndReplaceTrackSummary(track,prd_to_track_map,false /*DO NOT suppress hole search*/);
-}
-
-void
-Trk::TrackSummaryTool::updateTrackNoHoleSearch(Track& track,
-                                               const Trk::PRDtoTrackMap* prd_to_track_map) const
-{
-  // first check if track has summary already.
-  computeAndReplaceTrackSummary(track, prd_to_track_map, true /*suppress hole search*/);
-  m_idTool->updateExpectedHitInfo(track, *track.trackSummary()); /*Needed for expected B-Layer*/
+  ATH_MSG_VERBOSE ( ts << endmsg << "Finished!");
 }
 
 void Trk::TrackSummaryTool::updateSharedHitCount(const Track& track, const Trk::PRDtoTrackMap *prd_to_track_map,TrackSummary &summary) const
-- 
GitLab


From 9c15ba0ab2a487cbc06a46a40598c39712039651 Mon Sep 17 00:00:00 2001
From: Savanna Marie Shaw <savanna.marie.shaw@cern.ch>
Date: Wed, 23 Sep 2020 17:51:02 +0200
Subject: [PATCH 392/422] Update rois used for run 2 muon triggers

For the Run 3 triggers, we use the RoIs created by the L2 algorithms directly for the precision muon finding which have some variation in the eta/phi widths based on position. For the Run 2 triggers, we were taking the positions from L2, but using a fixed size regardless of the detector position. Updating the Run 2 code to use the eta/phi widths from the L2 RoIs as well since it's a more sensible approach (and to make comparisons with the Run 3 triggers easier).
---
 Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx b/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
index 0476c11ae892..5aaf35b9b998 100644
--- a/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
+++ b/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
@@ -1664,7 +1664,7 @@ const IRoiDescriptor* TrigMuSuperEF::getRoiDescriptor(const HLT::TriggerElement*
       }
       
       if (trigRoI) {
-	newTrigRoI = createSingleTrigRoiDescriptor( trigRoI->eta(), trigRoI->phi(), m_dEtaRoI, m_dPhiRoI, trigRoI->roiId() );
+	newTrigRoI = new TrigRoiDescriptor(unsigned(0), unsigned(trigRoI->roiId()), trigRoI->eta(), trigRoI->etaMinus(), trigRoI->etaPlus(), trigRoI->phi(), trigRoI->phiMinus(), trigRoI->phiPlus());
 	m_Roi_StillToBeAttached = newTrigRoI;
 	m_roi = newTrigRoI;
       } // if trigRoI
-- 
GitLab


From 8aabacdfd05429528b3b8818cf44032189968096 Mon Sep 17 00:00:00 2001
From: manthony <matthew.thomas.anthony@cern.ch>
Date: Wed, 23 Sep 2020 18:25:21 +0200
Subject: [PATCH 393/422] python pep8 compliant structure to PFlowMTConfig.py

---
 Reconstruction/eflowRec/share/PFlowMTConfig.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Reconstruction/eflowRec/share/PFlowMTConfig.py b/Reconstruction/eflowRec/share/PFlowMTConfig.py
index 8fc0211ac214..edd98bf0749f 100644
--- a/Reconstruction/eflowRec/share/PFlowMTConfig.py
+++ b/Reconstruction/eflowRec/share/PFlowMTConfig.py
@@ -13,7 +13,7 @@ TrackCaloExtensionTool=eflowTrackCaloExtensionTool(TrackCaloExtensionTool=pcExte
 
 #If reading from ESD we not create a cache of extrapolations to the calorimeter, so we should signify this by setting the cache key to a null string
 from RecExConfig.RecFlags import rec
-if True == rec.readESD:
+if rec.readESD==True:
    TrackCaloExtensionTool.PFParticleCache = ""
 
 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
-- 
GitLab


From ab5c21362cb46d5d1239132bed0cdad70e53d909 Mon Sep 17 00:00:00 2001
From: Nikola Dikic <nikola.dikic@cern.ch>
Date: Wed, 23 Sep 2020 19:55:48 +0200
Subject: [PATCH 394/422] Cleaning before MR

---
 .../python/Run3AFPExampleMonitorAlgorithm.py   | 18 +++++++++---------
 .../src/AFPSiLayerAlgorithm.cxx                |  2 ++
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index b512c4350d5a..5a1c07c50c2c 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -9,9 +9,11 @@
 
 def Run3AFPExampleMonitoringConfig(inputFlags):
     '''Function to configures some algorithms in the monitoring system.'''
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    result = ComponentAccumulator()
 
-    from LumiBlockComps.BunchCrossingCondAlgDefault import BunchCrossingCondAlgDefault
-    BunchCrossingCondAlgDefault()
+    from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
+    result.merge(BunchCrossingCondAlgCfg(inputFlags))
     
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
@@ -80,7 +82,8 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     arrayToF.defineHistogram('barInTrainIDC', title='Total hits per bars in {}; barID; hits', type='TH1F', path='HitsPerBarsInTrain/farCside', xbins=4,xmin=-0.5,xmax=3.5)
     
     # Finalize. The return value should be a tuple of the ComponentAccumulator
-    return helper.result()
+    result.merge(helper.result())
+    return result
     
 
 if __name__=='__main__':
@@ -96,9 +99,9 @@ if __name__=='__main__':
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
-    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000001.xAOD.root','/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000002.xAOD.root']
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000001.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput61-337371-449k.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput63-test.root'
     
     ConfigFlags.lock()
 
@@ -110,10 +113,7 @@ if __name__=='__main__':
     
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
-    
-    from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
-    cfg.merge (BunchCrossingCondAlgCfg(ConfigFlags))
 
-    cfg.run()
+    cfg.run(10000)
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 895c0ec4fada..f2a9bc75a9e5 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -248,6 +248,7 @@ void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb,
 			for(int i = 0; i < 4; i++)
 			{
 				clustersPerStationFloat = clusterCounterStationA[previouslbStationA][i];
+				clusterCounterStationA[previouslbStationA][i] = 0;
 				if(muPerBCID != 0 && clustersPerStationFloat!=0)
 				{
 					clustersPerStationFloat = clustersPerStationFloat/(muPerBCID*counterForEventsStationA*4);
@@ -305,6 +306,7 @@ void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, i
 				for(int j=0; j<4; j++)
 				{
 					clustersPerPlaneFloat = clusterCounterPlane[previouslbPlane][i][j];
+					clusterCounterPlane[previouslbPlane][i][j] = 0;
 					if(muPerBCID != 0 && clustersPerPlaneFloat != 0)
 					{
 						clustersPerPlaneFloat = clustersPerPlaneFloat/(muPerBCID*counterForEventsPlane);
-- 
GitLab


From 2e1e82bd8d9607deb0f60a0a93623e7ca4382f52 Mon Sep 17 00:00:00 2001
From: Nicolas Koehler <nicolas.koehler@cern.ch>
Date: Wed, 23 Sep 2020 18:54:06 +0000
Subject: [PATCH 395/422] Remove commented/unsused code in muon packages

---
 .../MMRawDataMonitoring/MMRawDataMonAlg.h     |  1 -
 .../RPCStandaloneTracksMon.h                  |  1 -
 .../src/RPCStandaloneTracksMon.cxx            | 20 +++----------------
 3 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h
index 23e6a4682269..cdfe61fcd02c 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h
@@ -29,7 +29,6 @@
 #include "MuonPrepRawData/MMPrepDataCollection.h"
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
-#include "TrkSegment/SegmentCollection.h"
 #include "AthenaMonitoring/DQAtlasReadyFilterTool.h"
 #include "EventInfo/EventInfo.h"
 #include "EventInfo/EventID.h"
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RPCStandaloneTracksMon.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RPCStandaloneTracksMon.h
index 7be2ebd9963b..369b985a1f3d 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RPCStandaloneTracksMon.h
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RPCStandaloneTracksMon.h
@@ -85,7 +85,6 @@ class RPCStandaloneTracksMon: public ManagedMonitorToolBase {
   
   ActiveStoreSvc* m_activeStore;
 
-  std::string m_muonSegmentsName;
   std::string m_muonTracksName;
   std::string m_msVertexCollection;
   std::string m_muonExtrapTracksName;
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx
index 9e120ac8ebdd..6f395b80a830 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx
@@ -103,14 +103,11 @@ RPCStandaloneTracksMon::RPCStandaloneTracksMon( const std::string & type, const
   declareProperty("Muon_Trigger_Items",   m_muon_triggers);
   declareProperty("TriggerDecisionTool",  m_trigDecTool);
   
-  declareProperty("MuonSegmentCollection",	     m_muonSegmentsName     = "MuonSegments");
   declareProperty("MuonTrackCollection",	     m_muonTracksName	    = "MuonSpectrometerTrackParticles");
   declareProperty("MuonExtrapolatedTrackCollection", m_muonExtrapTracksName = "ExtrapolatedMuonTrackParticles");
   declareProperty("InDetTrackParticles",	     m_innerTracksName      = "InDetTrackParticles");
   declareProperty("MSVertexCollection",              m_msVertexCollection   = "MSDisplacedVertex");
   
-  
-  
   declareProperty("MuonDeltaRMatching"          , m_MuonDeltaRMatching         =   0.15 ); 
   declareProperty("requireMuonCombinedTight"    , m_requireMuonCombinedTight   = false  );
   declareProperty("StandAloneMatchedWithTrack"  , m_StandAloneMatchedWithTrack = true   );
@@ -289,26 +286,15 @@ StatusCode RPCStandaloneTracksMon::fillHistograms()
       }
   }
     
-   //Muon tracks
-     
-//       // retrieve containers
-//       const xAOD::MuonSegmentContainer*     MuonSegments = evtStore()->retrieve< const xAOD::MuonSegmentContainer >        (m_muonSegmentsName);       
-//       const xAOD::TrackParticleContainer*   tracksMS     = evtStore()->retrieve< const xAOD::TrackParticleContainer >        (m_muonTracksName);      
-         SG::ReadHandle<xAOD::MuonContainer> Muons(m_muonsName);
+   //Muon tracks   
+   SG::ReadHandle<xAOD::MuonContainer> Muons(m_muonsName);
 	 ATH_MSG_DEBUG ("Muon container with key: " << m_muonsName.key()<<" found");
-//       const xAOD::VertexContainer*	       MSVertices   = evtStore()->retrieve< const xAOD::VertexContainer >           (m_msVertexCollection);
-//       const xAOD::TrackParticleContainer*   METracks     = evtStore()->retrieve< const xAOD::TrackParticleContainer >( m_muonExtrapTracksName );
-//       const xAOD::TrackParticleContainer*   IDTracks     = evtStore()->retrieve< const xAOD::TrackParticleContainer >     ( m_innerTracksName );
-  
-      
-      
+
       SG::ReadHandle<Muon::RpcPrepDataContainer> rpc_container(m_key_rpc);
       ATH_MSG_DEBUG ( "RpcPrepDataContainer " << m_key_rpc.key() <<" found");
 
       SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfo);
 
-      //int RunNumber = eventInfo->runNumber();
-      //long int EventNumber = eventInfo->eventNumber();
       long int BCID   =  eventInfo->       bcid()  ;
       int lumiBlock   =  eventInfo->  lumiBlock()  ; 
       
-- 
GitLab


From 6d39c90b1b27329a20887f832a2f5d1d75d53bf7 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Wed, 23 Sep 2020 18:55:36 +0000
Subject: [PATCH 396/422] Refactored histograms filling code for speed

---
 .../GenericMonitoringTool.h                   |   5 +-
 .../AthenaMonitoringKernel/HistogramFiller.h  |  92 +++++++----
 .../src/GenericMonitoringTool.cxx             | 149 +++++++-----------
 .../CumulativeHistogramFiller1D.h             |  19 +--
 .../src/HistogramFiller/HistogramFiller1D.h   |  33 ++--
 .../src/HistogramFiller/HistogramFiller2D.h   |  50 +++---
 .../HistogramFiller2DProfile.h                |  26 ++-
 .../HistogramFillerEfficiency.h               |  49 +++---
 .../HistogramFillerRebinable.h                |  14 +-
 .../src/HistogramFiller/HistogramFillerTree.h |  19 +--
 .../HistogramFiller/HistogramFillerUtils.h    |   8 +-
 .../HistogramFiller/VecHistogramFiller1D.h    |  22 ++-
 .../test/HistogramFillerFactoryTestSuite.cxx  |   2 +-
 .../HistogramFillerRebinable1DTestSuite.cxx   |  38 ++---
 .../HistogramFillerRebinable2DTestSuite.cxx   |  12 +-
 15 files changed, 249 insertions(+), 289 deletions(-)

diff --git a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/GenericMonitoringTool.h b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/GenericMonitoringTool.h
index 4240937a3dba..8deb6504183a 100644
--- a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/GenericMonitoringTool.h
+++ b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/GenericMonitoringTool.h
@@ -21,7 +21,7 @@
 
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODEventInfo/EventInfo.h"
-
+#include "AthenaMonitoringKernel/HistogramFiller.h"
 
 /* Here, by forward declaring these two classes, which appear as parameters and values
    in GenericMonitoringTool functions only as pointers (not as the objects themselves),
@@ -81,8 +81,9 @@ private:
   Gaudi::Property<bool> m_explicitBooking { this, "ExplicitBooking", false, "Do not create histograms automatically in initialize but wait until the method book is called." };
   Gaudi::Property<bool> m_failOnEmpty { this, "FailOnEmpty", true, "Fail in initialize() if no histograms defined" };
 
-  std::unordered_map<std::string, std::vector<std::shared_ptr<Monitored::HistogramFiller>>> m_fillerMap; //!< map from variables to fillers
+  std::vector<std::shared_ptr<Monitored::HistogramFiller>> m_fillers; //!< plain list of fillers
   mutable std::mutex m_fillMutex;
+  mutable Monitored::HistogramFiller::VariablesPack m_vars ATLAS_THREAD_SAFE;
 };
 
 /**
diff --git a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/HistogramFiller.h b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/HistogramFiller.h
index 96b7bf5db3a8..670f3efe686b 100644
--- a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/HistogramFiller.h
+++ b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/HistogramFiller.h
@@ -8,6 +8,7 @@
 #include <functional>
 #include <memory>
 #include <vector>
+#include "CxxUtils/AthUnlikelyMacros.h"
 
 #include "AthenaMonitoringKernel/HistogramDef.h"
 #include "AthenaMonitoringKernel/IHistogramProvider.h"
@@ -45,9 +46,7 @@ namespace Monitored {
      */
     HistogramFiller(const HistogramFiller& hf)
       : m_histDef(hf.m_histDef),
-        m_histogramProvider(hf.m_histogramProvider),
-        m_monWeight(hf.m_monWeight),
-        m_monCutMask(hf.m_monCutMask) {}
+        m_histogramProvider(hf.m_histogramProvider) {}
     /**
      * @brief Move constructor
      */
@@ -58,35 +57,65 @@ namespace Monitored {
      */
     virtual ~HistogramFiller() {}
 
+
     /**
-     * @brief Method that actually fills the ROOT object
-     * @return number of fills performed
+     * @brief helper class to pass variables to fillers
      */
-    virtual unsigned fill() const = 0;
+    struct VariablesPack {
+      VariablesPack() {}
+      VariablesPack( const std::initializer_list<const Monitored::IMonitoredVariable*>&  v)
+	:var( v ) {}
+
+      /**
+       * @brief number of variables in the pack ( not counting the weight and mask )
+       */
+      size_t size () const {
+	return var.size() - std::count( var.begin(), var.end(), nullptr );
+      }
 
+      /**
+       * @brief removes all monitored variables
+       */
+      inline void reset() {
+	std::fill( var.begin(), var.end(), nullptr );
+	cut = nullptr;
+	weight = nullptr;
+      }
 
-    /**
-     * @brief clone filler for actual filling
-     * Note that this operation is very cheap as the this class is effectively a flyweight
-     */
-    virtual HistogramFiller* clone() const = 0;
+      /**
+       * @brief sets monitored variable at the index (may need to reszie vector of variables)
+       */
+      inline void set( unsigned index, const IMonitoredVariable* ptr ) {
+	if ( ATH_UNLIKELY( var.size() <= index ) ) {
+	  var.resize(index+1);
+	}
+	var[index] = ptr;
+      }
 
+      /**
+       * @brief names of all varaibles stored
+       */
+      std::vector<std::string> names() const {
+	std::vector<std::string> r;
+	for ( const auto* v: var )
+	  if ( v != nullptr )
+	    r.push_back( v->name() );
+	return r;
+      }
 
-    void setMonitoredVariables(std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>&& monitoredVariables) {
-      m_monVariables = std::move(monitoredVariables);
-    }
+      std::vector<const Monitored::IMonitoredVariable*> var = { nullptr, nullptr, nullptr, nullptr }; //!< storage for variables, default size of 4, serves all histograming uses
+      const Monitored::IMonitoredVariable* weight = nullptr; //!< pointer to weight variable, typically absent
+      const Monitored::IMonitoredVariable* cut = nullptr; //!< pointer to cut mask variable, typically absent
+    };
 
     /**
-     * @brief Stores histogram weight
-     * @param monitoredWeight weight to use
+     * @brief Method that actually fills the ROOT object
+     * @return number of fills performed
      */
-    void setMonitoredWeight(Monitored::IMonitoredVariable* monitoredWeight) {
-      m_monWeight = monitoredWeight;
-    }
+    virtual unsigned fill( const VariablesPack& ) const = 0;
+
+
 
-    void setMonitoredCutMask(Monitored::IMonitoredVariable* monitoredCutMask) {
-      m_monCutMask = monitoredCutMask;
-    }
 
     const std::vector<std::string>& histogramVariablesNames() const {
       return m_histDef->name;
@@ -99,7 +128,7 @@ namespace Monitored {
     const std::string& histogramCutMaskName() const {
       return m_histDef->cutMask;
     }
-    
+
   protected:
     template <class H>
     H* histogram() const {
@@ -107,19 +136,19 @@ namespace Monitored {
     }
 
     // convenience function to provide a function that interprets the cutmask
-    std::pair<size_t, std::function<bool(size_t)>> getCutMaskFunc() const {
-      std::function<bool(size_t)> cutMaskValue = [] (size_t){ return true; }; // default is true
+    std::pair<size_t, std::function<bool(size_t)>> getCutMaskFunc(const Monitored::IMonitoredVariable* mask ) const {
+      std::function<bool(size_t)> cutMaskValue = [mask] (size_t){ return true; }; // default is true
       size_t maskSize = 1;
-      if ( m_monCutMask != nullptr ) {
-        maskSize = m_monCutMask->size();
+      if ( mask != nullptr ) {
+        maskSize = mask->size();
         if (maskSize == 1) {
-          if (!m_monCutMask->get(0)) {
+          if (!mask->get(0)) {
             // globally fails cut; zero first argument is a signal that one can abort
             return std::make_pair(0, [](size_t){ return false; });
             // otherwise, default cutMaskValue is sufficient
           }
         } else {
-          return std::make_pair(maskSize, [this](size_t i){ return static_cast<bool>(m_monCutMask->get(i)); });
+          return std::make_pair(maskSize, [mask](size_t i){ return static_cast<bool>(mask->get(i)); });
         }
       }
       return std::make_pair(maskSize, cutMaskValue);
@@ -150,10 +179,7 @@ namespace Monitored {
 
     std::shared_ptr<HistogramDef> m_histDef;
     std::shared_ptr<IHistogramProvider> m_histogramProvider;
-    std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> m_monVariables;
-    Monitored::IMonitoredVariable* m_monWeight{nullptr}; // bare pointer instead of reference as it can be null
-    Monitored::IMonitoredVariable* m_monCutMask{nullptr};
-    
+
   private:
     HistogramFiller& operator=(HistogramFiller const&) = delete;
   };
diff --git a/Control/AthenaMonitoringKernel/src/GenericMonitoringTool.cxx b/Control/AthenaMonitoringKernel/src/GenericMonitoringTool.cxx
index 15bc0bb6aef5..3431c7a2138e 100644
--- a/Control/AthenaMonitoringKernel/src/GenericMonitoringTool.cxx
+++ b/Control/AthenaMonitoringKernel/src/GenericMonitoringTool.cxx
@@ -39,7 +39,7 @@ StatusCode GenericMonitoringTool::start() {
 }
 
 StatusCode GenericMonitoringTool::stop() {
-  m_fillerMap.clear();
+  m_fillers.clear();
   return StatusCode::SUCCESS;
 }
 
@@ -58,10 +58,6 @@ StatusCode GenericMonitoringTool::book() {
 
   HistogramFillerFactory factory(this, m_histoPath);
 
-  // First, make a vector of fillers. Then move the pointers to an unordered_map en masse.
-  std::vector<std::shared_ptr<Monitored::HistogramFiller>> fillers;
-  fillers.reserve(m_histograms.size());
-  m_fillerMap.reserve(m_histograms.size());
   for (const std::string& item : m_histograms) {
     if (item.empty()) {
       ATH_MSG_DEBUG( "Skipping empty histogram definition" );
@@ -74,7 +70,7 @@ StatusCode GenericMonitoringTool::book() {
       std::shared_ptr<HistogramFiller> filler(factory.create(def));
 
       if (filler) {
-        fillers.push_back(filler);
+	m_fillers.push_back(filler);
       } else {
         ATH_MSG_WARNING( "The histogram filler cannot be instantiated for: " << def.name );
       }
@@ -85,7 +81,7 @@ StatusCode GenericMonitoringTool::book() {
     ATH_MSG_DEBUG( "Monitoring for variable " << def.name << " prepared" );
   }
 
-  if ( fillers.empty() && m_failOnEmpty ) {
+  if ( m_fillers.empty() && m_failOnEmpty ) {
     std::string hists;
     for (const auto &h : m_histograms) hists += (h+",");
     ATH_MSG_ERROR("No monitored variables created based on histogram definition: [" << hists <<
@@ -93,12 +89,6 @@ StatusCode GenericMonitoringTool::book() {
     return StatusCode::FAILURE;
   }
 
-  for (const auto& filler : fillers ) {
-    const auto& fillerVariables = filler->histogramVariablesNames();
-    for (const auto& fillerVariable : fillerVariables) {
-      m_fillerMap[fillerVariable].push_back(filler);
-    }
-  }
 
   return StatusCode::SUCCESS;
 }
@@ -112,89 +102,68 @@ namespace Monitored {
 
 
 void GenericMonitoringTool::invokeFillers(const std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>& monitoredVariables) const {
-
-  // stage 1: get candidate fillers (assume generally we get only a few variables)
-  std::vector<HistogramFiller*> candidates;
-  for (const auto& monValue : monitoredVariables) {
-    const auto& match = m_fillerMap.find(monValue.get().name());
-    if (match != m_fillerMap.end()) {
-      candidates.reserve(candidates.size() + match->second.size());
-      for (const auto& i : match->second) {
-        candidates.push_back(i.get());
-      }
-    }
-  }
-  // dedup vector (yes, this is faster than using std::set above)
-  std::sort(candidates.begin(), candidates.end());
-  candidates.erase(std::unique(candidates.begin(), candidates.end()), candidates.end());
-  // stage 2: refine for fillers that have all variables set
-  std::vector<std::reference_wrapper<IMonitoredVariable>> variables;
-  variables.reserve(3); // enough for all current fillers
-
-  for (const auto& filler : candidates) {
-    // Find the associated monitored variable for each histogram's variable(s)
-    const auto& fillerVariables = filler->histogramVariablesNames();
-
-    variables.clear();
-    for (const auto& fillerVariable : fillerVariables) {
-      for (const auto& monValue : monitoredVariables) {
-        if (fillerVariable.compare(monValue.get().name()) == 0) {
-          variables.push_back(monValue);
+  std::scoped_lock guard(m_fillMutex);
+  for ( auto filler: m_fillers ) {
+    m_vars.reset();
+    const int fillerCardinality = filler->histogramVariablesNames().size() + (filler->histogramWeightName().empty() ? 0: 1) + (filler->histogramCutMaskName().empty() ? 0 : 1);
+
+    if ( fillerCardinality == 1 ) { // simplest case, optimising this to be super fast
+      for ( auto& var: monitoredVariables ) {
+        if ( var.get().name().compare( filler->histogramVariablesNames()[0] ) == 0 )  {
+	  m_vars.var[0] = &var.get();
+          filler->fill( m_vars );
           break;
         }
       }
-    }
-
-    // Find the weight variable in the list of monitored variables
-    const auto& fillerWeight = filler->histogramWeightName();
-    Monitored::IMonitoredVariable* weight(nullptr);
-    if ( not fillerWeight.empty() ) {
-      for (const auto& monValue : monitoredVariables) {
-        if (fillerWeight.compare(monValue.get().name()) == 0) {
-          weight = &monValue.get();
-          break;
-        }
+    } else { // a more complicated case, and cuts or weights
+      int matchesCount = 0;
+      for ( const auto& var: monitoredVariables ) {
+	bool matched = false;
+	for ( unsigned fillerVarIndex = 0; fillerVarIndex < filler->histogramVariablesNames().size(); ++fillerVarIndex ) {
+	  if ( var.get().name().compare( filler->histogramVariablesNames()[fillerVarIndex] ) == 0 ) {
+	    m_vars.set(fillerVarIndex, &var.get());
+	    matched = true;
+	    matchesCount++;
+	    break;
+	  }
+	}
+	if ( matchesCount == fillerCardinality ) break;
+	if ( not matched ) { // may be a weight or cut variable still
+	  if ( var.get().name().compare( filler->histogramWeightName() ) == 0 )  {
+	    m_vars.weight = &var.get();
+	    matchesCount ++;
+	  } else if ( var.get().name().compare( filler->histogramCutMaskName() ) == 0 )  {
+	    m_vars.cut = &var.get();
+	    matchesCount++;
+	  }
+	}
+	if ( matchesCount == fillerCardinality ) break;
       }
-    }
-
-    // Find the cutMask variable in the list of monitored variables
-    const auto& fillerCutMask = filler->histogramCutMaskName();
-    Monitored::IMonitoredVariable* cutmask(nullptr);
-    if ( not fillerCutMask.empty() ) {
-      for (const auto& monValue : monitoredVariables) {
-        if (fillerCutMask.compare(monValue.get().name()) == 0) {
-          cutmask = &monValue.get();
-          break;
-        }
+      if ( matchesCount == fillerCardinality ) {
+	filler->fill( m_vars );
+      } else if ( ATH_UNLIKELY( matchesCount != 0 ) ) { // something has matched, but not all, worth informing user
+	bool reasonFound = false;
+	if (ATH_UNLIKELY(!filler->histogramWeightName().empty() && !m_vars.weight)) {
+	  reasonFound = true;
+	  ATH_MSG_DEBUG("Filler weight not found in monitoredVariables:"
+			<< "\n  Filler weight               : " << filler->histogramWeightName()
+			<< "\n  Asked to fill from mon. vars: " << monitoredVariables);
+	}
+	if (ATH_UNLIKELY(!filler->histogramCutMaskName().empty() && !m_vars.cut)) {
+	  reasonFound = true;
+	  ATH_MSG_DEBUG("Filler cut mask not found in monitoredVariables:"
+			<< "\n  Filler cut mask             : " << filler->histogramCutMaskName()
+			<< "\n  Asked to fill from mon. vars: " << monitoredVariables);
+	}
+	if ( not reasonFound ) {
+	  ATH_MSG_DEBUG("Filler has different variables than monitoredVariables:"
+			<< "\n  Filler variables            : " << filler->histogramVariablesNames()
+			<< "\n  Asked to fill from mon. vars: " << monitoredVariables
+			<< "\n  Selected monitored variables: " << m_vars.names() );
+	}
       }
     }
-
-    if (fillerVariables.size() != variables.size()) {
-      ATH_MSG_DEBUG("Filler has different variables than monitoredVariables:"
-                    << "\n  Filler variables            : " << fillerVariables
-                    << "\n  Asked to fill from mon. vars: " << monitoredVariables
-                    << "\n  Selected monitored variables: " << variables);
-      continue;
-    }
-    if (ATH_UNLIKELY(!fillerWeight.empty() && !weight)) {
-      ATH_MSG_DEBUG("Filler weight not found in monitoredVariables:"
-                    << "\n  Filler weight               : " << fillerWeight
-                    << "\n  Asked to fill from mon. vars: " << monitoredVariables);
-      continue;
-    }
-    if (ATH_UNLIKELY(!fillerCutMask.empty() && !cutmask)) {
-      ATH_MSG_DEBUG("Filler cut mask not found in monitoredVariables:"
-                    << "\n  Filler cut mask             : " << fillerCutMask
-                    << "\n  Asked to fill from mon. vars: " << monitoredVariables);
-      continue;
-    }
-    
-    std::scoped_lock guard(m_fillMutex);
-    filler->setMonitoredVariables(std::move(variables));
-    filler->setMonitoredWeight(weight);
-    filler->setMonitoredCutMask(cutmask);
-    filler->fill();    
-  }  
+  }
 }
 
 uint32_t GenericMonitoringTool::runNumber() {
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/CumulativeHistogramFiller1D.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/CumulativeHistogramFiller1D.h
index 195ce9c23b66..3cd467a27562 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/CumulativeHistogramFiller1D.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/CumulativeHistogramFiller1D.h
@@ -16,20 +16,17 @@ namespace Monitored {
     CumulativeHistogramFiller1D(const HistogramDef& definition, std::shared_ptr<IHistogramProvider> provider)
       : HistogramFiller1D(definition, provider) {}
 
-    virtual CumulativeHistogramFiller1D* clone() const override {
-      return new CumulativeHistogramFiller1D( *this );
-    }
 
     
-    virtual unsigned fill() const override {
-      if (m_monVariables.size() != 1) {
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
+      if ( vars.size() != 1) {
         return 0;
       }
 
-      size_t varVecSize = m_monVariables.at(0).get().size();
+      const size_t varVecSize = vars.var[0]->size();
 
       // handling of the cutmask
-      auto cutMaskValuePair = getCutMaskFunc();
+      auto cutMaskValuePair = getCutMaskFunc( vars.cut );
       if (cutMaskValuePair.first == 0) { return 0; }
       if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != varVecSize)) {
         MsgStream log(Athena::getMessageSvc(), "CumulativeHistogramFiller1D");
@@ -37,13 +34,11 @@ namespace Monitored {
             << cutMaskValuePair.first << " " << varVecSize << endmsg;
       }
       auto cutMaskValue = cutMaskValuePair.second;
-
-      unsigned i(0);
+      unsigned i{0};
       auto histogram = this->histogram<TH1>();
-      const IMonitoredVariable& var = m_monVariables[0].get();
-      for (size_t i = 0; i < var.size(); i++) {
+      for (; i < varVecSize; i++) {
         if (!cutMaskValue(i)) { continue; }
-        const unsigned bin = histogram->FindBin(var.get(i));
+        const unsigned bin = histogram->FindBin(vars.var[0]->get(i));
 
         for (unsigned j = bin; j > 0; --j) {
           histogram->AddBinContent(j);
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller1D.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller1D.h
index 4d0232d86549..57c8e9064b1e 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller1D.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller1D.h
@@ -24,42 +24,35 @@ namespace Monitored {
       : HistogramFiller(definition, provider) {
     }
 
-    virtual HistogramFiller1D* clone() const override {
-      return new HistogramFiller1D( *this );
-    }
-
-    virtual unsigned fill() const override {
-      if (m_monVariables.size() != 1) { return 0; }
-      const IMonitoredVariable& var = m_monVariables.at(0).get();
-
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
       std::function<bool(size_t)> cutMaskAccessor;
-      if (m_monCutMask) {
+      if ( vars.cut ) {
         // handling of the cutmask
-        auto cutMaskValuePair = getCutMaskFunc();
+        auto cutMaskValuePair = getCutMaskFunc(vars.cut);
         if (cutMaskValuePair.first == 0) { return 0; }
-        if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != var.size())) {
+        if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != vars.var[0]->size())) {
           MsgStream log(Athena::getMessageSvc(), "HistogramFiller1D");
           log << MSG::ERROR << "CutMask does not match the size of plotted variable: "
-              << cutMaskValuePair.first << " " << var.size() << endmsg;
+              << cutMaskValuePair.first << " " << vars.var[0]->size() << endmsg;
         }
         cutMaskAccessor = cutMaskValuePair.second;
       }
 
-      if (m_monWeight) {
-        auto weightAccessor = [&](size_t i){ return m_monWeight->get(i); };
+      if (vars.weight) {
+        auto weightAccessor = [&](size_t i){ return vars.weight->get(i); };
 
-        if (ATH_UNLIKELY(m_monWeight->size() != var.size())) {
+        if (ATH_UNLIKELY(vars.weight->size() != vars.var[0]->size())) {
           MsgStream log(Athena::getMessageSvc(), "HistogramFiller1D");
           log << MSG::ERROR << "Weight does not match the size of plotted variable: "
-              << m_monWeight->size() << " " << var.size() << endmsg;
+              << vars.weight->size() << " " << vars.var[0]->size() << endmsg;
         }
         // Need to fill here while weightVector is still in scope
-        if (not m_monCutMask) return HistogramFiller::fill<TH1>(weightAccessor, detail::noCut, var);
-        else                  return HistogramFiller::fill<TH1>(weightAccessor, cutMaskAccessor, var);
+        if (not vars.cut) return HistogramFiller::fill<TH1>(weightAccessor, detail::noCut, *vars.var[0]);
+        else                  return HistogramFiller::fill<TH1>(weightAccessor, cutMaskAccessor, *vars.var[0]);
       }
 
-      if (not m_monCutMask) return HistogramFiller::fill<TH1>(detail::noWeight, detail::noCut, var);
-      else                  return HistogramFiller::fill<TH1>(detail::noWeight, cutMaskAccessor, var);
+      if (not vars.cut) return HistogramFiller::fill<TH1>(detail::noWeight, detail::noCut, *vars.var[0]);
+      else                  return HistogramFiller::fill<TH1>(detail::noWeight, cutMaskAccessor, *vars.var[0]);      
     }
   };
 }
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2D.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2D.h
index 302e6f3c2938..fdea3f617abb 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2D.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2D.h
@@ -25,62 +25,55 @@ namespace Monitored {
     HistogramFiller2DGeneric(const HistogramDef& definition, std::shared_ptr<IHistogramProvider> provider)
       : HistogramFiller(definition, provider) {}
 
-    virtual HistogramFiller2DGeneric* clone() const override {
-      return new HistogramFiller2DGeneric( *this );
-    }
-    
-    virtual unsigned fill() const override {
-      if (ATH_UNLIKELY(m_monVariables.size() != 2)) return 0;
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars) const override {
+      if (ATH_UNLIKELY(vars.var[0] == nullptr or vars.var[1] == nullptr )) return 0;
 
-      const IMonitoredVariable& var1 = m_monVariables[0].get();
-      const IMonitoredVariable& var2 = m_monVariables[1].get();
-      const size_t size1 = var1.size();
-      const size_t size2 = var2.size();
+      const size_t size0 = vars.var[0]->size();
+      const size_t size1 = vars.var[1]->size();
 
-      if (ATH_UNLIKELY(size1 == 0 || size2 == 0)) {
+      if (ATH_UNLIKELY(size0 == 0 || size1 == 0)) {
         // nothing to do
         return 0;
       }
 
-      if (ATH_UNLIKELY(size1 > 1 && size2 > 1 && size1 != size2)) {
+      if (ATH_UNLIKELY(size0 > 1 && size1 > 1 && size0 != size1)) {
         MsgStream log(Athena::getMessageSvc(), "HistogramFiller2D");
         log << MSG::ERROR << "Mismatch of provided vector sizes "
-            << size1 << "," << size2 << " for " << m_histDef->alias << endmsg;
+            << size0 << "," << size1 << " for " << m_histDef->alias << endmsg;
         return 0;
       }
 
       std::function<bool(size_t)> cutMaskAccessor;
-      if (m_monCutMask) {
+      if (vars.cut) {
         // handling of the cutmask
-        auto cutMaskValuePair = getCutMaskFunc();
+        auto cutMaskValuePair = getCutMaskFunc(vars.cut);
         if (cutMaskValuePair.first == 0) { return 0; }
-        if (ATH_UNLIKELY(size1 > 1 && size2 > 1 &&
-                         cutMaskValuePair.first > 1 && size1 != cutMaskValuePair.first)) {
+        if (ATH_UNLIKELY(size0 > 1 && size1 > 1 &&
+                         cutMaskValuePair.first > 1 && size0 != cutMaskValuePair.first)) {
           MsgStream log(Athena::getMessageSvc(), "HistogramFiller2D");
           log << MSG::ERROR << "CutMask does not match the size of plotted variable: "
-              << cutMaskValuePair.first << " " << size1 << endmsg;
+              << cutMaskValuePair.first << " " << size0 << endmsg;
           return 0;
         }
         cutMaskAccessor = cutMaskValuePair.second;
       }
 
-      if (m_monWeight) {
-        auto weightAccessor = [&](size_t i){ return m_monWeight->get(i); };
-
-        if (ATH_UNLIKELY(size1 > 1 && size2 > 1 &&
-                         m_monWeight->size() > 1 && size1 != m_monWeight->size())) {
+      if (vars.weight) {
+        auto weightAccessor = [&](size_t i){ return vars.weight->get(i); };
+        if (ATH_UNLIKELY(size0 > 1 && size1 > 1 &&
+                         vars.weight->size() > 1 && size0 != vars.weight->size())) {
           MsgStream log(Athena::getMessageSvc(), "HistogramFiller2D");
           log << MSG::ERROR << "Weight does not match the size of plotted variable: "
-              << m_monWeight->size() << " " << size1 << endmsg;
+              << vars.weight->size() << " " << size0 << endmsg;
           return 0;
         }
         // Need to fill here while weightVector is still in scope
-        if (not m_monCutMask) return HistogramFiller::fill<H>(weightAccessor, detail::noCut, var1, var2);
-        else                  return HistogramFiller::fill<H>(weightAccessor, cutMaskAccessor, var1, var2);
+        if (not vars.cut) return HistogramFiller::fill<H>(weightAccessor, detail::noCut, *vars.var[0], *vars.var[1]);
+        else                  return HistogramFiller::fill<H>(weightAccessor, cutMaskAccessor, *vars.var[0], *vars.var[1]);
       }
 
-      if (not m_monCutMask) return HistogramFiller::fill<H>(detail::noWeight, detail::noCut, var1, var2);
-      else                  return HistogramFiller::fill<H>(detail::noWeight, cutMaskAccessor, var1, var2);
+      if (not vars.cut) return HistogramFiller::fill<H>(detail::noWeight, detail::noCut, *vars.var[0], *vars.var[1]);
+      else                  return HistogramFiller::fill<H>(detail::noWeight, cutMaskAccessor, *vars.var[0], *vars.var[1]);
     }
   };
 
@@ -88,3 +81,4 @@ namespace Monitored {
 }
 
 #endif /* AthenaMonitoringKernel_HistogramFiller_HistogramFiller2D_h */
+
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2DProfile.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2DProfile.h
index e8f8e150b19a..1e79c9462cc7 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2DProfile.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2DProfile.h
@@ -19,26 +19,18 @@ namespace Monitored {
     HistogramFiller2DProfile(const HistogramDef& definition, std::shared_ptr<IHistogramProvider> provider)
       : HistogramFiller(definition, provider) {}
 
-    virtual HistogramFiller2DProfile* clone() const override {
-      return new HistogramFiller2DProfile( *this );
-    }
-
 
-    virtual unsigned fill() const override {
-      if (m_monVariables.size() != 3) {
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
+	if ( vars.size() != 3) {
         return 0;
       }
 
       // handling of the cutmask
-      auto cutMaskValuePair = getCutMaskFunc();
+      auto cutMaskValuePair = getCutMaskFunc(vars.cut);
       if (cutMaskValuePair.first == 0) { return 0; }
       auto cutMaskAccessor = cutMaskValuePair.second;
 
       auto histogram = this->histogram<TProfile2D>();
-      const IMonitoredVariable& var1 = m_monVariables[0].get();
-      const IMonitoredVariable& var2 = m_monVariables[1].get();
-      const IMonitoredVariable& var3 = m_monVariables[2].get();
-
       /*HERE NEED TO INCLUDE CASE IN WHICH SOME VARIABLES ARE SCALAR AND SOME VARIABLES ARE VECTORS
       unsigned i(0);
       if (m_variable1->size() != m_variable2->size() || m_variable1->size() != m_variable3->size() || m_variable2->size() != m_variable3->size() ) {
@@ -46,22 +38,22 @@ namespace Monitored {
       }*/
 
       //For now lets just consider the case in which all variables are of the same length
-      if ( m_monWeight && m_monWeight->size()==var1.size() ) {
+      if ( vars.weight && vars.weight->size() == vars.var[0]->size() ) {
         // Weighted fill
-        for (unsigned i = 0; i < var1.size(); ++i) {
+        for (unsigned i = 0; i < vars.var[0]->size(); ++i) {
           if (cutMaskAccessor(i)) {
-            histogram->Fill(var1.get(i), var2.get(i), var3.get(i), m_monWeight->get(i));
+            histogram->Fill(vars.var[0]->get(i), vars.var[1]->get(i), vars.var[2]->get(i), vars.weight->get(i));
           }
         }
       } else {
         // Unweighted fill
-        for (unsigned i = 0; i < var1.size(); ++i) {
+        for (unsigned i = 0; i < vars.var[0]->size(); ++i) {
           if (cutMaskAccessor(i)) {
-            histogram->Fill(var1.get(i), var2.get(i), var3.get(i));
+            histogram->Fill(vars.var[0]->get(i), vars.var[1]->get(i), vars.var[2]->get(i));
           }
         }
       }
-      return var1.size();
+      return vars.var[0]->size();
     }
   };
 }
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerEfficiency.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerEfficiency.h
index 2cd1f38d003e..14a619ce2452 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerEfficiency.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerEfficiency.h
@@ -19,58 +19,57 @@ namespace Monitored {
     HistogramFillerEfficiency(const HistogramDef& definition, std::shared_ptr<IHistogramProvider> provider)
       : HistogramFiller(definition, provider) {}
 
-    virtual HistogramFillerEfficiency* clone() const override {
-      return new HistogramFillerEfficiency( *this );
-    }
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
+
+      if ( ATH_UNLIKELY( vars.var[0] == nullptr or vars.var[1] == nullptr ) ) return 0;
 
-    virtual unsigned fill() const override {
-      const size_t nMonVar = m_monVariables.size();
-      if ( nMonVar<2 ) return 0;
 
-      const IMonitoredVariable& var0 = m_monVariables[0].get();
 
-      auto cutMaskValuePair = getCutMaskFunc();
+      auto cutMaskValuePair = getCutMaskFunc(vars.cut);
       if (cutMaskValuePair.first == 0) { return 0; }
-      if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != var0.size())) {
+      if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != vars.var[0]->size())) {
         MsgStream log(Athena::getMessageSvc(), "HistogramFillerEfficiency");
         log << MSG::ERROR << "CutMask does not match the size of plotted variable: " 
-            << cutMaskValuePair.first << " " << var0.size() << endmsg;
+            << cutMaskValuePair.first << " " << vars.var[0]->size() << endmsg;
       }
       auto cutMaskAccessor = cutMaskValuePair.second;
 
       TEfficiency* efficiency = this->histogram<TEfficiency>();
       const TH1* efftot = efficiency->GetTotalHistogram();
 
+      const unsigned nMonVar = vars.size();
+      const size_t var0Size = vars.var[0]->size();
       if ( nMonVar==2 ) { // Single observable (1D TEfficiency)
-        for (unsigned i = 0; i < var0.size(); ++i) {
+        for (unsigned i = 0; i < var0Size; ++i) {
           if (cutMaskAccessor(i)) {
-            efficiency->Fill(var0.get(i),
-                             detail::getFillValue<Axis::X>(efftot, m_monVariables[1].get(), i));
+            efficiency->Fill(vars.var[0]->get(i),
+                             detail::getFillValue<Axis::X>(efftot, vars.var[1], i));
           }
         }
-        return var0.size();
+        return var0Size;
       } else if ( nMonVar==3 ) { // Two observables (2D TEfficiency)
-        for (unsigned i = 0; i < var0.size(); ++i) {
+        for (unsigned i = 0; i < var0Size; ++i) {
           if (cutMaskAccessor(i)) {
-            efficiency->Fill(var0.get(i),
-                             detail::getFillValue<Axis::X>(efftot, m_monVariables[1].get(), i),
-                             detail::getFillValue<Axis::Y>(efftot, m_monVariables[2].get(), i));
+            efficiency->Fill(vars.var[0]->get(i),
+                             detail::getFillValue<Axis::X>(efftot, vars.var[1], i),
+                             detail::getFillValue<Axis::Y>(efftot, vars.var[2], i));
           }
         }
-        return var0.size();
+        return var0Size;
       } else if ( nMonVar==4 ) { // Three observables (3D Efficiency)
-        for (unsigned i = 0; i < var0.size(); ++i) {
+        for (unsigned i = 0; i < var0Size; ++i) {
           if (cutMaskAccessor(i)) {
-            efficiency->Fill(var0.get(i),
-                             detail::getFillValue<Axis::X>(efftot, m_monVariables[1].get(), i),
-                             detail::getFillValue<Axis::Y>(efftot, m_monVariables[2].get(), i),
-                             detail::getFillValue<Axis::Z>(efftot, m_monVariables[3].get(), i));
+            efficiency->Fill(vars.var[0]->get(i),
+                             detail::getFillValue<Axis::X>(efftot, vars.var[1], i),
+                             detail::getFillValue<Axis::Y>(efftot, vars.var[2], i),
+                             detail::getFillValue<Axis::Z>(efftot, vars.var[3], i));
           }
         }
-        return var0.size();
+        return var0Size;
       } else {
         return 0;
       }
+      return var0Size;
     }
   };
 }
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerRebinable.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerRebinable.h
index e609696d8beb..acbfe563cd74 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerRebinable.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerRebinable.h
@@ -33,17 +33,13 @@ namespace Monitored {
       }
     }
 
-    virtual HistogramFillerRebinableAxis* clone() const override {
-      return new HistogramFillerRebinableAxis( *this );
-    }
-
-    virtual unsigned fill() const override {
-      if (AXIS >= this->m_monVariables.size()) { return 0; }
-      if (this->m_monVariables[AXIS].get().size()==0) { return 0; }
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
+      if (AXIS >= vars.size() ) { return 0; }
+      if (vars.var[AXIS]->size()==0) { return 0; }
 
       double min = std::numeric_limits<double>::max();
       double max = std::numeric_limits<double>::min();
-      const IMonitoredVariable& var = this->m_monVariables[AXIS].get();
+      const IMonitoredVariable& var = *vars.var[AXIS];
       for (size_t i = 0; i < var.size(); i++) {
         const double v = var.get(i);
         if (v < min) min = v;
@@ -62,7 +58,7 @@ namespace Monitored {
         if (max >= axis->GetXmax()) hist->ExtendAxis(max, axis);
         if (min < axis->GetXmin()) hist->ExtendAxis(min, axis);
       }
-      return BASE::fill();
+      return BASE::fill( vars );
     }
 
   private:
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerTree.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerTree.h
index f06b017558dc..07f5bdf52af5 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerTree.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerTree.h
@@ -26,13 +26,9 @@ namespace Monitored {
         parseDefinition();
     }
 
-    virtual HistogramFillerTree* clone() const override {
-      return new HistogramFillerTree( *this );
-    }
-
-    virtual unsigned fill() const override {
-      // handling of the cutmask
-      auto cutMaskValuePair = getCutMaskFunc();
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
+      // handling of the cutmask      
+      auto cutMaskValuePair = getCutMaskFunc(vars.cut);
       if (cutMaskValuePair.first == 0) { return 0; }
       if (ATH_UNLIKELY(cutMaskValuePair.first > 1)) {
         MsgStream log(Athena::getMessageSvc(), "HistogramFillerTree");
@@ -42,10 +38,10 @@ namespace Monitored {
         if (! cutMaskValuePair.second(0)) { return 0; }
       }
 
-      if (ATH_UNLIKELY(m_monVariables.size() != m_branchDefs.size())) {
+      if (ATH_UNLIKELY(vars.size() != m_branchDefs.size())) {
         MsgStream log(Athena::getMessageSvc(), "HistogramFillerTree");
         log << MSG::ERROR << "Mismatch of passed variables and expected variables for " << m_histDef->alias 
-                          << "(" << m_monVariables.size() << ", " << m_branchDefs.size() << ")" << endmsg;
+                          << "(" << vars.size() << ", " << m_branchDefs.size() << ")" << endmsg;
         return 0;
       }
 
@@ -63,7 +59,8 @@ namespace Monitored {
           ++idx; continue;
         }
         TBranch* branch = static_cast<TBranch*>(branchList->At(idxgood));
-        m_fillerFunctions[idx](branch, m_monVariables[idx].get());
+	std::cout << "Calling filler function for var : " <<  vars.var[idx]->name() << " branch " << branch->GetName() << "\n";
+        m_fillerFunctions[idx](branch, *vars.var[idx]);
         ++idx; ++idxgood;
       }
       for (Int_t i = 0; i < branchList->GetEntries(); ++i) {
@@ -71,7 +68,7 @@ namespace Monitored {
 
       }
       tree->SetEntries(tree->GetEntries() + 1);
-      return 1;
+      return 1;     
     }
 
   private:
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerUtils.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerUtils.h
index 3552810fe760..546eaf03f187 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerUtils.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerUtils.h
@@ -51,13 +51,13 @@ namespace Monitored {
      * @param  i       index for IMonitoredVariable value lookup
      */
     template<Axis AXIS, typename H>
-    double getFillValue(const H* hist, const IMonitoredVariable& var, size_t i) {
-      if ( var.hasStringRepresentation() ) {
+    double getFillValue(const H* hist, const IMonitoredVariable* var, size_t i) {
+      if ( var->hasStringRepresentation() ) {
         const TAxis* axis = getAxis<AXIS>(hist);
-        const int binNumber = axis->FindFixBin( var.getString(i).c_str() );
+        const int binNumber = axis->FindFixBin( var->getString(i).c_str() );
         return axis->GetBinCenter(binNumber);
       } else {
-        return var.get(i);
+        return var->get(i);
       }
     }
 
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/VecHistogramFiller1D.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/VecHistogramFiller1D.h
index 71424fa18f1c..27ecc1c19d16 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/VecHistogramFiller1D.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/VecHistogramFiller1D.h
@@ -13,38 +13,34 @@ namespace Monitored {
     VecHistogramFiller1D(const HistogramDef& definition, std::shared_ptr<IHistogramProvider> provider)
       : HistogramFiller1D(definition, provider) {}
 
-    virtual VecHistogramFiller1D* clone() const override {
-      return new VecHistogramFiller1D( *this );
-    }
 
-    virtual unsigned fill() const override {
-      if (m_monVariables.size() != 1) { return 0; }
-      const IMonitoredVariable& var = m_monVariables[0].get();
+    virtual unsigned fill(const HistogramFiller::VariablesPack& vars) const override {
+      if ( ATH_UNLIKELY( vars.var[0] == nullptr or vars.size() != 0 ) ) { return 0; }
 
       std::function<bool(size_t)> cutMaskAccessor;
-      if (m_monCutMask) {
+      if (vars.cut) {
         // handling of the cutmask
-        auto cutMaskValuePair = getCutMaskFunc();
+        auto cutMaskValuePair = getCutMaskFunc(vars.cut);
         if (cutMaskValuePair.first == 0) { return 0; }
-        if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != var.size())) {
+        if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != vars.var[0]->size())) {
           MsgStream log(Athena::getMessageSvc(), "VecHistogramFiller1D");
           log << MSG::ERROR << "CutMask does not match the size of plotted variable: "
-              << cutMaskValuePair.first << " " << var.size() << endmsg;
+              << cutMaskValuePair.first << " " << vars.var[0]->size() << endmsg;
         }
         cutMaskAccessor = cutMaskValuePair.second;
       }
 
       auto histogram = this->histogram<TH1>();
       const unsigned offset = m_histDef->kVecUO ? 0 : 1;
-      for (unsigned i = 0; i < var.size(); ++i) {
+      for (unsigned i = 0; i < vars.var[0]->size(); ++i) {
         if (cutMaskAccessor && cutMaskAccessor(i)) {
-          const double value = var.get(i);
+          const double value = vars.var[0]->get(i);
           histogram->AddBinContent(i+offset, value);
           histogram->SetEntries(histogram->GetEntries() + value);
         }
       }
 
-      return var.size();
+      return vars.var[0]->size();
     }
   };
 }
diff --git a/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx b/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx
index a16941c0cc10..a62e401b2280 100644
--- a/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx
+++ b/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx
@@ -47,7 +47,7 @@ class HistogramProviderGetter : public HistogramFiller {
     HistogramProviderGetter(const HistogramFiller& hf) 
       : HistogramFiller(hf) {}
 
-    virtual unsigned fill() const { return 0; }
+  virtual unsigned fill( const HistogramFiller::VariablesPack& ) const { return 0; }
     virtual HistogramFiller* clone() const { return nullptr; }
 
     std::shared_ptr<IHistogramProvider> histogramProvider() { return m_histogramProvider; }
diff --git a/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable1DTestSuite.cxx b/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable1DTestSuite.cxx
index 1744e3dd5e90..4133e65d0efb 100644
--- a/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable1DTestSuite.cxx
+++ b/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable1DTestSuite.cxx
@@ -64,12 +64,14 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldKeepNumberOfBinsForValueInHistogramsRange() {
       Monitored::Scalar<double> var("var", 2.9);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
+
+
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -79,13 +81,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldDoubleNumberOfBinsForBoundaryValueOf3() {
       Monitored::Scalar<double> var("var", 3.0);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(16);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -95,13 +97,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldDoubleNumberOfBinsForValueSlightlySmallerThan5() {
       Monitored::Scalar<double> var("var", 4.9);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(16);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -111,13 +113,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldQuadrupleNumberOfBinsForBoundaryValueOf5() {
       Monitored::Scalar<double> var("var", 5.0);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(32);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -127,13 +129,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldQuadrupleNumberOfBinsForValueSlightlyBiggerThan5() {
       Monitored::Scalar<double> var("var", 5.1);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(32);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -143,13 +145,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldQuadrupleNumberOfBinsForValueSlightlySmallerThan9() {
       Monitored::Scalar<double> var("var", 8.9);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(32);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -159,13 +161,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldOctupleNumberOfBinsForBoundaryValueOf9() {
       Monitored::Scalar<double> var("var", 9.0);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(64);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -175,13 +177,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldOctupleNumberOfBinsForValueSlightlyBiggerThan9() {
       Monitored::Scalar<double> var("var", 9.1);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(64);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -194,7 +196,7 @@ class HistogramFillerRebinable1DTestSuite {
 
   // ==================== Initialization & run ====================
   public:
-    HistogramFillerRebinable1DTestSuite() 
+    HistogramFillerRebinable1DTestSuite()
       : m_log(Athena::getMessageSvc(), "HistogramFillerRebinable1DTestSuite") {
     }
 
@@ -224,7 +226,7 @@ class HistogramFillerRebinable1DTestSuite {
     HistogramDef m_histogramDef;
     shared_ptr<MockHistogramProvider> m_histogramProvider;
     shared_ptr<TH1D> m_histogram;
-    
+
     shared_ptr<HistogramFillerRebinable1D> m_testObj;
 };
 
diff --git a/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable2DTestSuite.cxx b/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable2DTestSuite.cxx
index 3986434f8673..f55abb00313a 100644
--- a/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable2DTestSuite.cxx
+++ b/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable2DTestSuite.cxx
@@ -22,7 +22,7 @@
 #include "AthenaKernel/getMessageSvc.h"
 
 #include "TH2D.h"
-
+#include "AthenaMonitoringKernel/HistogramFiller.h"
 #include "AthenaMonitoringKernel/MonitoredScalar.h"
 #include "../src/HistogramFiller/HistogramFillerRebinable.h"
 
@@ -60,7 +60,7 @@ class HistogramFillerRebinable2DTestSuite {
     void test_shouldKeepNumberOfBinsForValueInHistogramsRange() {
       Monitored::Scalar<double> var1("var1", 2.9);
       Monitored::Scalar<double> var2("var2", 4.9);
-      m_testObj->setMonitoredVariables({var1, var2});
+      HistogramFiller::VariablesPack vars({&var1, &var2});
 
       auto check = [&](){
         VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
@@ -71,7 +71,7 @@ class HistogramFillerRebinable2DTestSuite {
         VALUE(m_histogram->GetYaxis()->GetXmax()) EXPECTED(5.0);
       };
       check();
-      m_testObj->fill();
+      m_testObj->fill(vars);
       check();
       VALUE(m_histogram->GetBinContent(8,5)) EXPECTED(1.0);
     }
@@ -79,9 +79,9 @@ class HistogramFillerRebinable2DTestSuite {
     void test_shouldDoubleNumberOfBinsForValueOutsideRange() {
       Monitored::Scalar<double> var1("var1", 3.0);
       Monitored::Scalar<double> var2("var2", 5.0);
-      m_testObj->setMonitoredVariables({var1, var2});
+      HistogramFiller::VariablesPack vars({&var1, &var2});
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(16);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -125,7 +125,7 @@ class HistogramFillerRebinable2DTestSuite {
     HistogramDef m_histogramDef;
     shared_ptr<MockHistogramProvider> m_histogramProvider;
     shared_ptr<TH2D> m_histogram;
-    
+
     shared_ptr<HistogramFillerRebinable2D> m_testObj;
 };
 
-- 
GitLab


From c94a0162b8e4f448cd64d1d3b935b37242819118 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Wed, 23 Sep 2020 19:54:41 +0100
Subject: [PATCH 397/422] ElectronEfficiencyCorrectionTool, remove unneeded /
 unused files

---
 .../IAsgElectronEfficiencyCorrectionTool.h    |  12 --
 .../src/EleChargeAlg.cxx                      | 137 ------------------
 .../src/EleChargeAlg.h                        |  44 ------
 .../ElectronEfficiencyCorrection_entries.cxx  |   4 -
 .../src/testAthenaElectronAlg.cxx             | 103 -------------
 .../src/testAthenaElectronAlg.h               |  28 ----
 6 files changed, 328 deletions(-)
 delete mode 100644 PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h
 delete mode 100644 PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.cxx
 delete mode 100644 PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.h
 delete mode 100644 PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.cxx
 delete mode 100644 PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.h

diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h
deleted file mode 100644
index ea8aeb75e815..000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//IAsgElectronEfficiencyCorrection.h to be used in the tool.
-#ifndef __IASGELECTRONEFFICIENCYCORRECTION__
-#define __IASGELECTRONEFFICIENCYCORRECTION__
-
-#include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
-#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
-
-#endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.cxx
deleted file mode 100644
index 3ccf4efa02c9..000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ElectronChargeCorrection includes
-#include "EleChargeAlg.h"
-#include "xAODEventInfo/EventInfo.h"
-#include "xAODEgamma/ElectronContainer.h"
-// #include "xAODTruth/TruthEventContainer.h"
-// #include "xAODTruth/TruthVertex.h"
-// #include "xAODEgamma/EgammaTruthxAODHelpers.h"
-#include "GaudiKernel/ITHistSvc.h"
-#include "PATInterfaces/ISystematicsTool.h"
-
-#include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
-
-
-
-EleChargeAlg::EleChargeAlg( const std::string& name, ISvcLocator* pSvcLocator ) :
-  AthAlgorithm( name, pSvcLocator ),
-  m_syst(),
-  m_eccTool("CP::ElectronChargeEfficiencyCorrectionTool/ElectronChargeEfficiencyCorrectionTool", this),
-  m_eleContName("Electrons")
-{
-  declareProperty("ElectronChargeEfficiencyCorrectionTool",  m_eccTool, "The private ElectronChargeEfficiencyCorrectionTool" );
-  declareProperty("ElectronContainerName",         m_eleContName, "The name of the input electron container");
-}
-
-
-EleChargeAlg::~EleChargeAlg() {}
-
-
-StatusCode EleChargeAlg::initialize() {
-
-  ATH_MSG_INFO ("Initializing " << name() << "...");
-  ATH_CHECK( m_eccTool.retrieve() );
-  m_syst = m_eccTool->affectingSystematics();
-  for( const auto& variation : m_syst ) {
-    ATH_MSG_INFO(" Affecting systematics: " << variation.name());
-  }
-  return StatusCode::SUCCESS;
-}
-
-StatusCode EleChargeAlg::finalize() {
-  ATH_MSG_INFO ("Finalizing " << name() << "...");
-  ATH_CHECK( m_eccTool.release() );
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode EleChargeAlg::execute() {
-
-  //----------------------------
-  // Event information
-  //---------------------------
-
-  const xAOD::EventInfo* eventInfo = nullptr; //NOTE: Everything that comes from the storegate direct from the input files is const!
-
-  // ask the event store to retrieve the xAOD EventInfo container
-
-  CHECK( evtStore()->retrieve( eventInfo) );
-  // if there is only one container of that type in the xAOD (as with the EventInfo container), you do not need to pass
-  // the key name, the default will be taken as the only key name in the xAOD
-
-  // check if data or MC
-  if(!eventInfo->eventType(xAOD::EventInfo::IS_SIMULATION ) ){
-    ATH_MSG_DEBUG( "DATA. Will stop processing this algorithm for the current event.");
-    return StatusCode::SUCCESS; // stop this algorithms execute() for this event, here only interested in MC
-  }
-
-
-  //---------
-  // electrons
-  //---------
-
-  const xAOD::ElectronContainer* electrons = nullptr;
-  CHECK( evtStore()->retrieve( electrons, m_eleContName.value() ) );
-
-  ATH_MSG_VERBOSE ("Executing " << name() << "... in event with: " << electrons->size() << " electrons");
-
-  // Loop over all electrons in this container
-  for ( const auto* electron : *electrons ) {
-
-    if ( electron->pt() < 25000 ) continue;
-    if ( std::abs(electron->eta()) > 2.5 ) continue;
-
-    ATH_MSG_DEBUG("-------------------------------------------------------------------" );
-    ATH_MSG_DEBUG(" ...  electron with pt = " << electron->pt() << " , eta: " << fabs(electron->eta()) );
-
-    double sf=-999;
-    //float rate=-999;
-    CP::SystematicSet syst_set;
-
-    CP::SystematicCode tmpSysResult = m_eccTool->applySystematicVariation(syst_set);
-    ATH_MSG_DEBUG("applySystematicVariation returned CP::SystematicCode = " << tmpSysResult);
-    if ( tmpSysResult != CP::SystematicCode::Ok ) {
-      ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool did NOT report a CP::SystematicCode::Ok when calling applySystematicVariation");
-      return StatusCode::FAILURE;
-    }
-
-    CP::CorrectionCode tmpResult = m_eccTool->getEfficiencyScaleFactor(*electron,sf);
-    ATH_MSG_DEBUG("Nominal value SF = " << sf << " and CP::CorrectionCode = " << tmpResult);
-    if ( tmpResult == CP::CorrectionCode::Error ) {
-      ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool reported a CP::CorrectionCode::Error");
-      return StatusCode::FAILURE;
-    }
-
-    for( const auto& variation : m_syst ) {
-      double tmpSF=0;
-      ///float tmprate=0;
-      CP::SystematicSet syst_set1;
-      syst_set1.insert( variation );
-
-      tmpSysResult = m_eccTool->applySystematicVariation(syst_set1);
-      ATH_MSG_DEBUG("applySystematicVariation (second time) returned CP::SystematicCode = " << tmpSysResult);
-      if ( tmpSysResult != CP::SystematicCode::Ok ) {
-        ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool did NOT report a CP::SystematicCode::Ok when calling applySystematicVariation");
-        return StatusCode::FAILURE;
-      }
-      tmpResult = m_eccTool->getEfficiencyScaleFactor(*electron, tmpSF);
-      ATH_MSG_DEBUG("getEfficiencyScaleFactor returned CP::CorrectionCode = " << tmpResult);
-      if ( tmpResult == CP::CorrectionCode::Error ) {
-        ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool reported a CP::CorrectionCode::Error when calling getEfficiencyScaleFactor");
-        return StatusCode::FAILURE;
-      }
-      //   //m_eccTool->getDataEfficiency(*electron, tmprate);
-      ATH_MSG_DEBUG("   Systematic "<< variation.name() << ":" << " SF-> " << tmpSF);
-      //   //ATH_MSG_DEBUG("Systematic "<< variation.name() << ":" << " data rate-> " << tmprate);
-    }
-
-
-  } // end for loop over electrons
-
-
-  return StatusCode::SUCCESS;
-
-} //-------end of execute
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.h
deleted file mode 100644
index adf091bf941c..000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ELECTRONCHARGECORRECTION_ELECHARGEALG_H
-#define ELECTRONCHARGECORRECTION_ELECHARGEALG_H 1
-
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-// #include "xAODTruth/TruthParticle.h"
-
-#include "TTree.h"
-#include "TLorentzVector.h"
-
-#include <vector>
-
-// #include "MCTruthClassifier/IMCTruthClassifier.h"
-#include "PATInterfaces/SystematicSet.h"
-
-class IAsgElectronEfficiencyCorrectionTool;
-
-class EleChargeAlg: public ::AthAlgorithm {
- public:
-  EleChargeAlg( const std::string& name, ISvcLocator* pSvcLocator);
-
-  virtual ~EleChargeAlg();
-
-  virtual StatusCode  initialize();
-  virtual StatusCode  execute();
-  virtual StatusCode  finalize();
-
-
- private:
-  /// The systematics set that will contain all the systematic variations
-  CP::SystematicSet m_syst;
-
-  /// The handle to the charge-misid scale-factor tool
-  ToolHandle<IAsgElectronEfficiencyCorrectionTool> m_eccTool;
-
-  /// The name of the input electron container
-  StringProperty m_eleContName;
-};
-
-#endif //> !ELECTRONCHARGECORRECTION_ELECHARGEALG_H
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx
index ec72b97a2777..13672c9891b5 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx
@@ -1,9 +1,5 @@
 #include "ElectronEfficiencyCorrection/AsgElectronEfficiencyCorrectionTool.h"
 #include "ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h"
-#include "../testAthenaElectronAlg.h"
 
 DECLARE_COMPONENT( AsgElectronEfficiencyCorrectionTool )
 DECLARE_COMPONENT( CP::ElectronChargeEfficiencyCorrectionTool )
-
-DECLARE_COMPONENT( testAthenaElectronAlg )
-
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.cxx
deleted file mode 100644
index 2d0318c8fd86..000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.cxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ElectronEfficiencyCorrection includes
-#include "testAthenaElectronAlg.h"
-
-#include "xAODEventInfo/EventInfo.h"
-#include "xAODEgamma/ElectronContainer.h"
-#include "xAODEgamma/ElectronAuxContainer.h"
-#include "xAODCore/ShallowCopy.h"
-#include "PATInterfaces/SystematicsTool.h"
-#include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
-
-testAthenaElectronAlg::testAthenaElectronAlg( const std::string& name, ISvcLocator* pSvcLocator ) : 
-  AthAlgorithm( name, pSvcLocator ),  
-  m_electronSF("AsgElectronEfficiencyCorrectionTool/AsgElectronEfficiencyCorrectionTool",this){
-  //declareProperty( "Property", m_nProperty ); //example property declaration
-  declareProperty( "ElectronEfficiencyCorrectionTool", m_electronSF );
-}
-//
-testAthenaElectronAlg::~testAthenaElectronAlg() {}
-
-
-StatusCode testAthenaElectronAlg::initialize() {
-  ATH_MSG_INFO ("Initializing " << name() << "...");
-  // Retrieve the tool
-  ATH_CHECK( m_electronSF.retrieve() );
-  return StatusCode::SUCCESS;
-}
-
-StatusCode testAthenaElectronAlg::finalize() {
-  ATH_MSG_INFO ("Finalizing " << name() << "...");
-  // Clean up
-  ATH_CHECK( m_electronSF.release() );
-  return StatusCode::SUCCESS;
-}
-
-StatusCode testAthenaElectronAlg::execute() {  
-  ATH_MSG_DEBUG ("Executing " << name() << "...");
-
-  //----------------------------
-  // Event information
-  //--------------------------- 
-  const xAOD::EventInfo* eventInfo = nullptr; //NOTE: Everything that comes from the storegate direct from the input files is const!
-
-  // ask the event store to retrieve the xAOD EventInfo container
-  //ATH_CHECK( evtStore()->retrieve( eventInfo, "EventInfo") );  // the second argument ("EventInfo") is the key name
-  ATH_CHECK( evtStore()->retrieve( eventInfo) );
-  // if there is only one container of that type in the xAOD (as with the EventInfo container), you do not need to pass
-  // the key name, the default will be taken as the only key name in the xAOD 
- 
-  //---------
-  // electrons
-  //---------
-  const xAOD::ElectronContainer* electrons = nullptr;
-  ATH_CHECK( evtStore()->retrieve( electrons, "Electrons") );
- 
-  // Let's create a shallow copy of the const electron container, and decorate it with the obtained SF
-  auto inContShallowCopy = xAOD::shallowCopyContainer( *electrons );
-
-  //creates a new electron container to hold the subset as well as the needed auxiliary container
-  xAOD::ElectronContainer* myelectrons = new xAOD::ElectronContainer;
-  xAOD::ElectronAuxContainer* myelectronsAux = new xAOD::ElectronAuxContainer;
-  // You need to tell the jet container in which auxiliary container it should write its member variables
-  myelectrons->setStore( myelectronsAux ); //gives it a new associated aux container
-  // Also record to storegate: you must record both the container and the auxcontainer.
-  // Note that storegate takes ownership of these objects, i.e., you must not try to delete them yourself.
-  ATH_CHECK( evtStore()->record(myelectrons,  "MyElectrons" ) );
-  ATH_CHECK( evtStore()->record(myelectronsAux, "MyElectronsAux" ) );
-
-  // Loop over all Electrons in the shallow-copy container, decorate it with SF, and store in new xAOD file, in addition print out all SF (with get* function)
-
-  CP::SystematicSet mySysSet;
-  //mySysSet.insert(CP::SystematicVariation("EL_EFF_UncorrUncertainty", 1));
-  m_electronSF->applySystematicVariation(mySysSet);
-
-  for ( xAOD::Electron* el : *(inContShallowCopy.first) ) {
-
-    if ( el->pt()<7000. ) continue;
-    ATH_MSG_DEBUG( "  electron pt = " << el->pt() <<", electron eta = " << el->eta() );
-
-    double SF; // for electron SF 
-    if( m_electronSF->getEfficiencyScaleFactor(*el,SF) != CP::CorrectionCode::Ok){
-      ATH_MSG_WARNING( "Couldn't get electron scale factor!" );
-      continue;
-    }
-
-    if ( m_electronSF->applyEfficiencyScaleFactor(*el) == CP::CorrectionCode::Error ) {
-      ATH_MSG_ERROR("ElectronEfficiencyCorrectionTool reported a CP::CorrectionCode::Error");
-      return StatusCode::FAILURE;
-    }
-
-    //m_electronSF->applyEfficiencyScaleFactor(*el);
-    ATH_MSG_DEBUG( "  electron SF, from get function = " << SF <<", electron SF from apply function " << el->auxdata< float >("SF") );
-    
-    myelectrons->push_back(el); // add it to a new electron container which will be writed to a new file
-  }// and loop on electrons
- 
-  return StatusCode::SUCCESS;
-}
-
-
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.h
deleted file mode 100644
index 85b2b8004255..000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ELECTRONEFFICIENCYCORRECTION_TESTATHENAELECTRONALG_H
-#define ELECTRONEFFICIENCYCORRECTION_TESTATHENAELECTRONALG_H 
-
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-
-// forward declarations
-class IAsgElectronEfficiencyCorrectionTool;
-
-class testAthenaElectronAlg: public ::AthAlgorithm { 
- public: 
-  testAthenaElectronAlg( const std::string& name, ISvcLocator* pSvcLocator );
-  virtual ~testAthenaElectronAlg(); 
-
-  virtual StatusCode  initialize();
-  virtual StatusCode  execute();
-  virtual StatusCode  finalize();
-
- private: 
- /// The tool handles our electron efficiency corrections
- ToolHandle< IAsgElectronEfficiencyCorrectionTool > m_electronSF;
-}; 
-
-#endif //> !ELECTRONEFFICIENCYCORRECTION_TESTATHENAELECTRONALG_H
-- 
GitLab


From 425304430df7f9530ff558f2f0475cb655621704 Mon Sep 17 00:00:00 2001
From: Adam Edward Barton <adam.edward.barton@cern.ch>
Date: Wed, 23 Sep 2020 18:58:15 +0000
Subject: [PATCH 398/422] MMRawDataMonitoring: Fix threading

---
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../MMRawDataMonitoring/MMRawDataMonAlg.h     | 19 -----------------
 .../src/MMRawDataMonAlg.cxx                   | 21 ++-----------------
 .../src/MMRawDataUtils.cxx                    |  7 -------
 4 files changed, 3 insertions(+), 45 deletions(-)
 create mode 100644 MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/ATLAS_CHECK_THREAD_SAFETY

diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/ATLAS_CHECK_THREAD_SAFETY b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..8d1faf319c61
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h
index 23e6a4682269..a0ee1e941782 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h
@@ -18,33 +18,22 @@
 #include "AthenaMonitoringKernel/Monitored.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h" 
-#include "AsgTools/ToolHandleArray.h"
-
 //Helper Includes
 
 #include "MuonAnalysisInterfaces/IMuonSelectionTool.h"
-#include "MuonDQAUtils/MuonDQAHistMap.h"
-#include "MuonPrepRawData/MuonCluster.h"
 #include "MuonPrepRawData/MuonPrepDataContainer.h"
 #include "MuonPrepRawData/MMPrepDataCollection.h"
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "TrkSegment/SegmentCollection.h"
 #include "AthenaMonitoring/DQAtlasReadyFilterTool.h"
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
 #include "xAODTrigger/MuonRoIContainer.h"
 #include "xAODMuon/MuonContainer.h"
 #include "MuonPrepRawData/MuonPrepDataContainer.h"
 #include "MuonPrepRawData/MMPrepDataContainer.h"
 #include "MuonPrepRawData/MMPrepData.h"
-#include "xAODEventInfo/EventInfo.h"
 #include "StoreGate/ReadHandleKey.h"
 
-//standard library includes
-#include <fstream> 
-#include <cstdlib>
-#include <iostream>
 
 namespace Muon {
   class MMPrepData;
@@ -56,15 +45,7 @@ namespace {
 }
 
 //stl includes                                                                                              
-                                                                    
-#include <sstream>
 #include <string>
-#include <vector>
-#include <map>
-#include <set>
-
-//root includes
-class TString;
 
 class MMRawDataMonAlg: public AthMonitorAlgorithm {
  public:
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataMonAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataMonAlg.cxx
index aa2187a5f2a5..f7c30ff74ee0 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataMonAlg.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataMonAlg.cxx
@@ -15,36 +15,20 @@
 #include "MuonReadoutGeometry/MMReadoutElement.h"
 #include "MuonDQAUtils/MuonChamberNameConverter.h"
 #include "MuonDQAUtils/MuonChambersRange.h"
-#include "MuonDQAUtils/MuonDQAHistMap.h"
 #include "MuonCalibIdentifier/MuonFixedId.h"
-#include "MuonSegment/MuonSegment.h"
 
 #include "MMRawDataMonitoring/MMRawDataMonAlg.h"
-#include "TrkEventPrimitives/FitQuality.h"
 
-#include "AnalysisTriggerEvent/LVL1_ROI.h"
-#include "xAODMuon/Muon.h"
 #include "xAODTracking/TrackParticleContainer.h"
 #include "xAODTracking/TrackParticle.h"
 #include "xAODTracking/TrackingPrimitives.h"
 #include "MuonPrepRawData/MuonPrepDataContainer.h"
 #include "MuonRIO_OnTrack/MMClusterOnTrack.h"
-#include "TrkTrack/TrackCollection.h"
-#include "TrkTrack/Track.h"
-#include "GaudiKernel/MsgStream.h"
 #include "AthenaMonitoring/AthenaMonManager.h"
 #include "MuonPrepRawData/MMPrepData.h"
 
-//root includes
-#include <TMath.h>
-#include <math.h>
-#include <sstream>
-#include <TH2F.h>
-#include <cmath>
-
 namespace {
 
-  int PCB;
   static constexpr double const toDeg = 180/M_PI;
 
   //1e=1.6X10-4 fC                                                                                          
@@ -212,11 +196,10 @@ StatusCode MMRawDataMonAlg::fillMMOverviewVects( const Muon::MMPrepData* prd, MM
   float mu_TPC_chi2=prd->chisqProb();
 
   Amg::Vector3D pos    = prd->globalPosition();
-  TVector3 v (pos.x(),pos.y(),pos.z());
   
   float R=std::hypot(pos.x(),pos.y());
 
-  PCB=get_PCB_from_channel(channel);
+  int PCB=get_PCB_from_channel(channel);
 
   //MM gaps are back to back, so the direction of the drift (time) is different for the even and odd gaps -> flip for the even gaps
 
@@ -466,7 +449,7 @@ void MMRawDataMonAlg::clusterFromTrack(const xAOD::TrackParticleContainer*  muon
 		
 		int sectorPhi=get_sectorPhi_from_stationPhi_stName(stPhi,stName);
 		
-		PCB=get_PCB_from_channel(ch);
+		int PCB=get_PCB_from_channel(ch);
 		
 		auto& vects=overviewPlots;
 		
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx
index 7305096e21bc..3607876f7f9a 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx
@@ -17,14 +17,7 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
          
 
 #include "MMRawDataMonitoring/MMRawDataMonAlg.h"
-#include <TError.h>
 #include <string>
-#include <TBox.h>
-#include <TList.h>
-#include <TLine.h>
-#include <TColor.h>
-#include <TString.h>
-#include <TRegexp.h>
 #include <stdexcept>
 
 int MMRawDataMonAlg::get_PCB_from_channel(int channel) const {
-- 
GitLab


From d829da679dea19e4f524d1b698dea364ea9f34c2 Mon Sep 17 00:00:00 2001
From: Bertrand Martin <martindl@cern.ch>
Date: Wed, 23 Sep 2020 21:16:27 +0200
Subject: [PATCH 399/422] Hello,

This MR is simply dropping a ReadHandleKey that is declared in a header but never used.

Cheers,
Bertrand
---
 Reconstruction/tauRec/python/TauAlgorithmsHolder.py   | 1 -
 Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h | 2 --
 2 files changed, 3 deletions(-)

diff --git a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
index 02c74c1cf1fa..bbc3b752a446 100644
--- a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
+++ b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
@@ -388,7 +388,6 @@ def getPi0ClusterCreator():
     
     from tauRecTools.tauRecToolsConf import TauPi0ClusterCreator
     TauPi0ClusterCreator = TauPi0ClusterCreator(name = _name,
-                                                Key_Pi0ClusterContainer="TauPi0SubtractedClusters",
                                                 TauVertexCorrection = getTauVertexCorrection(),
                                                 IncShowerSubtr = tauFlags.useShowerSubClusters()
                                                 )
diff --git a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h
index 9395ffac3662..49c3bc0da56b 100644
--- a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h
+++ b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h
@@ -69,8 +69,6 @@ private:
     Gaudi::Property<double> m_clusterEtCut {this, "ClusterEtCut", 0.5 * Gaudi::Units::GeV, "Et threshould for pi0 candidate clusters"};
     Gaudi::Property<bool> m_incShowerSubtr {this, "IncShowerSubtr", true, "use shower subtracted clusters in calo calculations"};
 
-    SG::ReadHandleKey<xAOD::CaloClusterContainer> m_pi0ClusterInputContainer{this,"Key_Pi0ClusterContainer", "TauPi0SubtractedClusters", "input pi0 cluster"};
-
     ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
       "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
-- 
GitLab


From 3312b2f2bd41e65880ff92e462928904843f9953 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 23 Sep 2020 22:59:13 +0200
Subject: [PATCH 400/422] PyDumper: Null pointer comparison fix.

Fix muon null pointer comparison.  (Was using the wrong Muon).

Fixes test failure in JetEventAthenaPool.
---
 Event/PyDumper/python/Dumpers.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Event/PyDumper/python/Dumpers.py b/Event/PyDumper/python/Dumpers.py
index df924f27a2fb..53450f2afc93 100644
--- a/Event/PyDumper/python/Dumpers.py
+++ b/Event/PyDumper/python/Dumpers.py
@@ -45,7 +45,8 @@ getattr (ROOT.xAOD, 'Jet_v1', None)
 
 #Typed nullptr:
 JetAssociationBase = getattr (cppyy.gbl, 'JetAssociationBase', None)
-Muon = getattr (cppyy.gbl, 'Muon', None)
+Analysis = getattr (cppyy.gbl, 'Analysis', None)
+Muon = getattr (Analysis, 'Muon', None) if Analysis else None
 jetAssocNull = cppyy.bind_object(cppyy.nullptr, JetAssociationBase) if JetAssociationBase else None
 muonNull = cppyy.bind_object(cppyy.nullptr, Muon) if Muon else None
 
-- 
GitLab


From 0a658c9f494a7f8f43c64db1ef8187e542e3d44b Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Wed, 23 Sep 2020 23:09:50 +0200
Subject: [PATCH 401/422] fixed style issues + added check of the jetLink

---
 Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index 0d89c334089f..317104d80a81 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -525,16 +525,15 @@ bool CENTER_LAMBDAOverClustersMeanCenterLambda   (const xAOD::TauJet &tau, const
 
 
 bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out){
-  const xAOD::Jet *jet_seed = tau.jet();
-  if (!jet_seed) {
+  if (!tau.jetLink().isValid()){
     return false;
   }
-
+  const xAOD::Jet *jetSeed = tau.jet();
+   
   std::vector<const xAOD::CaloCluster *> clusters;
-  bool            incShowerSubtracted(false);
-  const TLorentzVector&  LC_P4 = tau.p4(xAOD::TauJetParameters::DetectorAxis);
-  double          dRCut(0.2);
-  auto        check_clusters = tauRecTools::GetJetClusterList(jet_seed, clusters, incShowerSubtracted, LC_P4, dRCut);
+  bool            incShowerSubtracted(true);
+  auto check_tauClusters = tauRecTools::GetJetClusterList(jetSeed, clusters, incShowerSubtracted);
+
   std::size_t nClustersTotal = clusters.size();
 
   // Number of tracks to save
-- 
GitLab


From bbf7d2244614be48f7475c4da54dd2571da9042d Mon Sep 17 00:00:00 2001
From: gipezzul <g.pezzullo@yale.edu>
Date: Thu, 24 Sep 2020 00:06:45 +0200
Subject: [PATCH 402/422] added new parameter in the TauAlgHolder instance of
 the EleRNN

---
 Reconstruction/tauRec/python/TauAlgorithmsHolder.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
index 9ac9efa37856..ea2c9e17c353 100644
--- a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
+++ b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
@@ -944,6 +944,7 @@ def getTauEleRNNEvaluator(_n,
                               InputLayerClusters=InputLayerClusters,
                               OutputLayer=OutputLayer,
                               OutputNode=OutputNode,
+                              TauVertexCorrection = getTauVertexCorrection(),
                               IncShowerSubtr = tauFlags.useShowerSubClusters())
 
     cached_instances[_name] = tool
-- 
GitLab


From 0064368b7fb46ff54ff95b343c64a9e981752dba Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 23 Sep 2020 20:33:40 +0200
Subject: [PATCH 403/422] TrkVertexFitterUtils: Update test reference file.

Fix test failure in master.
---
 .../share/ImpactPoint3dEstimator_test.ref       | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/share/ImpactPoint3dEstimator_test.ref b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/share/ImpactPoint3dEstimator_test.ref
index 3c785584c0fa..1f10c9c8f988 100644
--- a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/share/ImpactPoint3dEstimator_test.ref
+++ b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/share/ImpactPoint3dEstimator_test.ref
@@ -1,18 +1,29 @@
 TrkVertexFitterUtils/ImpactPoint3dEstimator_test
 
 
+Initializing Gaudi ApplicationMgr using job opts /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/TrkVertexFitterUtils/TrkVertexFitterUtils_tests.txt
+JobOptionsSvc        INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/TrkVertexFitterUtils/TrkVertexFitterUtils_tests.txt
+JobOptionsSvc        INFO # (1,1): ToolSvc.Trk::DetAnnealingMaker.SetOfTemperatures = [3, 2, 1]
+JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/TrkVertexFitterUtils/TrkVertexFitterUtils_tests.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on lxplus750.cern.ch on Wed Sep 23 18:13:22 2020
+====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
 EventLoopMgr      WARNING No events will be processed from external input.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
+ClassIDSvc           INFO  getRegistryEntries: read 1476 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 379 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2769 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 652 CLIDRegistry entries for module ALL
 ServiceManager      FATAL No Service factory for AtlasTrackingGeometrySvc available.
 ToolSvc.Trk::Ex...  ERROR ServiceLocatorHelper::service: can not locate service AtlasTrackingGeometrySvc
 ToolSvc.Trk::Ex...WARNING Couldn't retrieve TrackingGeometrySvc = ServiceHandle('AtlasTrackingGeometrySvc'). 
 ToolSvc.Trk::Ex...WARNING  -> Trying to retrieve default 'AtlasTrackingGeometry' from DetectorStore.
-ToolSvc.Trk::Ex...   INFO Minimal momentum cut for material update : 50 MeV
-ToolSvc.AtlasEn...   INFO initialize()
 ToolSvc.AtlasMu...   INFO initialize() successful
+ClassIDSvc           INFO  getRegistryEntries: read 113 CLIDRegistry entries for module ALL
 ToolSvc.Trk::Ex...   INFO initialize() successful
-ToolSvc.Trk::Ex...   INFO initialize()
 test1
-- 
GitLab


From 7cbc4fdb5753727a9996787f03e70dc4f41fb423 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 23 Sep 2020 18:47:50 +0200
Subject: [PATCH 404/422] AthenaPoolExampleAlgorithms: Update test reference
 files.

Fix test failures in master.
---
 .../share/AthenaPoolExample_ReWrite.ref       | 24 ++++++++++---------
 .../share/AthenaPoolExample_ReWriteAgain.ref  | 18 +++++++-------
 .../share/AthenaPoolExample_ReWriteNext.ref   | 18 +++++++-------
 3 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
index c1dd45cb5593..814f5dd5a1bd 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
@@ -1,17 +1,17 @@
-Fri Sep 11 23:45:59 CEST 20?0
+Wed Sep 23 17:58:44 CEST 20?0
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RWJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5568 configurables from 4 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5565 configurables from 45 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
-                                          running on aibuild028.cern.ch on Fri Sep 11 23:46:11 20?0
+                                          running on lxplus750.cern.ch on Wed Sep 23 17:58:51 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
@@ -32,8 +32,8 @@ PoolSvc             DEBUG Service base class initialized successfully
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-09-10T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-09-22T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus750.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -1835,6 +1835,7 @@ Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG slot 0  handle() incident type: MetaDataStop
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
+MetaDataSvc         DEBUG Locking metadata tools
 Stream1             DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*]
 Stream1             DEBUG addItemObjects(167728019,"Stream1") called
 Stream1             DEBUG            Key:Stream1
@@ -1873,6 +1874,7 @@ MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of ty
 SimplePoolFile3...  DEBUG --->Adding Assoc :????/MetaDataHdrForm(DataHeaderForm) [20?]  (d , ffffffff)
 SimplePoolFile3...  DEBUG ---->ClassID:????
 Stream1              INFO Metadata records written: 21
+MetaDataSvc         DEBUG Unlocking metadata tools
 Stream1             DEBUG Leaving incident handler for MetaDataStop
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     UPDATE    [ROOT_All] 
@@ -1891,13 +1893,13 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 62
-cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.152(+-    1.22)/       0/      10 [ms] #= 66
-cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.317(+-    1.75)/       0/      10 [ms] #= 63
-cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.139(+-    1.66)/       0/      20 [ms] #=144
-fRep_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=   0.645(+-    3.04)/       0/      20 [ms] #= 62
-ChronoStatSvc        INFO Time User   : Tot=  430 [ms]  #=  1
+cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 66
+commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 21
+cObj_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.159(+-    1.25)/       0/      10 [ms] #= 63
+fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.323(+-    1.77)/       0/      10 [ms] #= 62
+cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.139(+-    1.17)/       0/      10 [ms] #=144
+ChronoStatSvc        INFO Time User   : Tot=  280 [ms]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
index 43bdcbf6f6da..4ec01f4e859a 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
@@ -1,17 +1,17 @@
-Fri Sep 11 23:46:44 CEST 20?0
+Wed Sep 23 17:41:03 CEST 20?0
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteAgainJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5568 configurables from 4 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5565 configurables from 45 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
-                                          running on aibuild028.cern.ch on Fri Sep 11 23:46:56 20?0
+                                          running on lxplus750.cern.ch on Wed Sep 23 17:41:10 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
@@ -32,8 +32,8 @@ PoolSvc             DEBUG Service base class initialized successfully
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-09-10T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-09-22T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus750.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -1858,6 +1858,7 @@ Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG slot 0  handle() incident type: MetaDataStop
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
+MetaDataSvc         DEBUG Locking metadata tools
 Stream1             DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*]
 Stream1             DEBUG addItemObjects(167728019,"Stream1") called
 Stream1             DEBUG            Key:Stream1
@@ -1896,6 +1897,7 @@ MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of ty
 SimplePoolFile3...  DEBUG --->Adding Assoc :????/MetaDataHdrForm(DataHeaderForm) [20?]  (d , ffffffff)
 SimplePoolFile3...  DEBUG ---->ClassID:????
 Stream1              INFO Metadata records written: 21
+MetaDataSvc         DEBUG Unlocking metadata tools
 Stream1             DEBUG Leaving incident handler for MetaDataStop
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     UPDATE    [ROOT_All] 
@@ -1917,10 +1919,10 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 62
 cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 65
 commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 21
+cObj_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.159(+-    1.25)/       0/      10 [ms] #= 63
 cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=  0.0694(+-    0.83)/       0/      10 [ms] #=144
-cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.317(+-    1.75)/       0/      10 [ms] #= 63
-fRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=   0.484(+-    2.15)/       0/      10 [ms] #= 62
-ChronoStatSvc        INFO Time User   : Tot=  380 [ms]  #=  1
+fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.323(+-    1.77)/       0/      10 [ms] #= 62
+ChronoStatSvc        INFO Time User   : Tot=  260 [ms]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
index 680578f81ce0..51941979e8ec 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
@@ -1,17 +1,17 @@
-Fri Sep 11 23:46:59 CEST 20?0
+Wed Sep 23 16:50:48 CEST 20?0
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteNextJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5568 configurables from 4 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5565 configurables from 45 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
-                                          running on aibuild028.cern.ch on Fri Sep 11 23:47:11 20?0
+                                          running on lxplus750.cern.ch on Wed Sep 23 16:50:56 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
@@ -32,8 +32,8 @@ PoolSvc             DEBUG Service base class initialized successfully
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-09-10T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-09-22T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus750.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -1193,6 +1193,7 @@ Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG slot 0  handle() incident type: MetaDataStop
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
+MetaDataSvc         DEBUG Locking metadata tools
 Stream1             DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*]
 Stream1             DEBUG addItemObjects(167728019,"Stream1") called
 Stream1             DEBUG            Key:Stream1
@@ -1231,6 +1232,7 @@ MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of ty
 SimplePoolFile4...  DEBUG --->Adding Assoc :????/MetaDataHdrForm(DataHeaderForm) [20?]  (d , ffffffff)
 SimplePoolFile4...  DEBUG ---->ClassID:????
 Stream1              INFO Metadata records written: 21
+MetaDataSvc         DEBUG Unlocking metadata tools
 Stream1             DEBUG Leaving incident handler for MetaDataStop
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     UPDATE    [ROOT_All] 
@@ -1251,11 +1253,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 62
-cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 65
+fRep_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.161(+-    1.26)/       0/      10 [ms] #= 62
+cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.154(+-    1.23)/       0/      10 [ms] #= 65
 cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=  0.0694(+-    0.83)/       0/      10 [ms] #=144
-fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.323(+-    1.77)/       0/      10 [ms] #= 62
 cObj_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.159(+-    1.25)/       0/      10 [ms] #= 63
-ChronoStatSvc        INFO Time User   : Tot=  370 [ms]  #=  1
+ChronoStatSvc        INFO Time User   : Tot=  270 [ms]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
-- 
GitLab


From 411eee4a294de1e680c11b8248406ff86b5a720e Mon Sep 17 00:00:00 2001
From: Ewelina Maria Lobodzinska <ewelina.maria.lobodzinska@cern.ch>
Date: Wed, 23 Sep 2020 13:17:22 +0000
Subject: [PATCH 405/422] Merge branch '21.6_MGC_PDFNameTag' into '21.6'

Patch for bad LHE comments from AGENE-1894

See merge request atlas/athena!36652

(cherry picked from commit 7a470b42d3d983ae03ef197c06eeba9151933649)

504ee30b Patch for bad LHE comments from AGENE-1894
---
 Generators/MadGraphControl/python/MadGraphUtils.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Generators/MadGraphControl/python/MadGraphUtils.py b/Generators/MadGraphControl/python/MadGraphUtils.py
index 994d630839fd..238df7d9aca0 100755
--- a/Generators/MadGraphControl/python/MadGraphUtils.py
+++ b/Generators/MadGraphControl/python/MadGraphUtils.py
@@ -1016,12 +1016,18 @@ def arrange_output(process_dir=MADGRAPH_GRIDPACK_LOCATION,lhe_version=None,saveP
         orig_input = process_dir+'/Events/'+MADGRAPH_RUN_NAME+'/events.lhe'
         mod_output = open(os.getcwd()+'/events.lhe','w')
 
-    #Removing empty lines in LHE
+    #Removing empty lines and bad comments in LHE
     nEmpty=0
     with open(orig_input,'r') as fileobject:
         for line in fileobject:
             if line.strip():
-                mod_output.write(line)
+                if '#' not in line:
+                    mod_output.write(line)
+                elif '>' not in line[ line.find('#'): ]:
+                    mod_output.write(line)
+                else:
+                    mglog.warning('Found bad LHE line with an XML mark in a comment: "'+line.strip()+'"')
+                    mod_output.write(line[:line.find('#')]+'#'+ (line[line.find('#'):].replace('>','-')))
             else:
                 nEmpty=nEmpty+1
     mod_output.close()
-- 
GitLab


From f31fa6bf0e13b5edde39e1052e52fb968d1602f1 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 22 Sep 2020 16:02:09 -0400
Subject: [PATCH 406/422] CaloInterface: Add IToolWithConstants.

Add an interface for the functionality of ToolWithConstants used for
dumping data to pool.
---
 .../CaloInterface/IToolWithConstants.h        | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h

diff --git a/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h b/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h
new file mode 100644
index 000000000000..d58d79b057cb
--- /dev/null
+++ b/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h
@@ -0,0 +1,48 @@
+// This file's extension implies that it's C, but it's really -*- C++ -*-.
+/*
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
+ */
+/**
+ * @file CaloInterface/IToolWithConstants.h
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Sep, 2020
+ * @brief Abstact interface for ToolWithConstants.
+ */
+
+
+#ifndef CALOINTERFACE_ITOOLWITHCONSTANTS_H
+#define CALOINTERFACE_ITOOLWITHCONSTANTS_H
+
+
+#include "CaloConditions/ToolConstants.h"
+#include "GaudiKernel/IAlgTool.h"
+#include "GaudiKernel/StatusCode.h"
+#include "GaudiKernel/EventContext.h"
+#include <string>
+
+
+/**
+ * @brief Abstact interface for ToolWithConstants.
+ *
+ * Defines operations needed by CaloClusterCorrDBWriter.
+ */
+class IToolWithConstants
+  : virtual public IAlgTool
+{
+public:
+  DeclareInterfaceID (IToolWithConstants, 1, 0);
+
+
+  /**
+   * @brief Merge our constants into @c out with the proper prefix.
+   * @param[out] out Object to receive our constants.
+   * @param ctx Event context.
+   */
+  virtual
+  StatusCode
+  mergeConstants (CaloRec::ToolConstants& out,
+                  const EventContext& ctx) const = 0;
+};
+
+
+#endif // not CALOINTERFACE_ITOOLWITHCONSTANTS_H
-- 
GitLab


From 1fb411d502a715061e8c7385466c36ba5f215fa8 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 23 Sep 2020 14:32:34 +0200
Subject: [PATCH 407/422] MuonClusterOnTrackCreator: Fix clang warings.

Fix test for missing fit results.
---
 .../MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
index 2a4595e3883e..6e4323af41a1 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
@@ -331,7 +331,7 @@ namespace Muon {
       results = m_clusterUtilTool->getRefitCluster(MClus,tantheta);
       results0 = m_clusterUtilTool->getRefitCluster(MClus,0);
 
-      if(&results[0]==nullptr || &results0[0]==nullptr){
+      if(results.empty() || results0.empty()){
 	ATH_MSG_VERBOSE("No fit result");
 	return new CscClusterOnTrack(MClus,locpar,loce,positionAlongStrip,MClus->status(),MClus->timeStatus(),MClus->time());
       }
-- 
GitLab


From 8171a86486f1a424948f1ef25ded2fbd5d09d389 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 15 Sep 2020 10:05:08 -0400
Subject: [PATCH 408/422] TRT_CalibTools: Fix cppcheck warnings.

 - Pass class instances by const reference, not by value.
 - Prefer using an initializer list to assigning members
   in a ctor body.
 - Prefer preincrement (or range for) to postincrement for iterators.
 - Memory allocation cleanup.
---
 .../TRT_CalibTools/src/Calibrator.cxx         | 232 ++++++++----------
 .../TRT_CalibTools/src/Calibrator.h           |  11 +-
 .../TRT_CalibTools/src/TRTCalibrator.cxx      | 191 +++++++-------
 .../TRT_CalibTools/src/TRTCalibrator.h        |   4 +-
 4 files changed, 210 insertions(+), 228 deletions(-)

diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.cxx b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.cxx
index 2a17e6fced88..0bf227d58431 100644
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.cxx
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.cxx
@@ -52,9 +52,6 @@ caldata::caldata(){
   calflag  = -999;
   rtflag  = -999;
   t0flag  = -999;
-  m_treshist  = nullptr;
-  reshist  = nullptr;
-  rthist  = nullptr;
   det = -999;
   lay = -999;
   mod = -999;
@@ -71,10 +68,6 @@ caldata::caldata(){
 }
 
 caldata::~caldata(){
-  delete[] m_treshist;
-  delete[] reshist;
-  delete[] rthist;
-
 }
 
 caldata::caldata(bool makehist, int nbinst, int nbinsr){
@@ -100,9 +93,6 @@ caldata::caldata(bool makehist, int nbinst, int nbinsr){
   calflag  = -999;
   rtflag  = -999;
   t0flag  = -999;
-  m_treshist  = nullptr;
-  reshist  = nullptr;
-  rthist  = nullptr;
   det = -999;
   lay = -999;
   mod = -999;
@@ -118,16 +108,9 @@ caldata::caldata(bool makehist, int nbinst, int nbinsr){
   rtgraph = nullptr;
 
   if (makehist) {
-    if (m_treshist) delete m_treshist;
-    m_treshist = new float[100];
-  }
-  if (makehist) {
-    if (reshist) delete reshist;
-    reshist = new float[100];
-  }
-  if (makehist) {
-    if (rthist) delete rthist;
-    rthist = new float[nbinsr*nbinst+200];
+    m_treshist.resize (100);
+    reshist.resize (100);
+    rthist.resize (nbinsr*nbinst+200);
   }
 }
 
@@ -299,18 +282,18 @@ RtGraph::RtGraph(TH2F* rtHist, int binvar, const char* binlabel, bool pflag, TDi
 
 RtGraph::~RtGraph(){  
 
- delete hslizes   ;
- delete m_btype     ;
- delete m_tv        ;
- delete m_dv        ;
- delete m_etv       ;
- delete m_edv       ;
- delete m_rightsig  ;
- delete m_leftsig   ;
- delete m_leftval   ;
- delete m_rightval  ;
- delete m_maxbin    ;
- delete m_maxval    ;
+ delete [] hslizes   ;
+ delete [] m_btype     ;
+ delete [] m_tv        ;
+ delete [] m_dv        ;
+ delete [] m_etv       ;
+ delete [] m_edv       ;
+ delete [] m_rightsig  ;
+ delete [] m_leftsig   ;
+ delete [] m_leftval   ;
+ delete [] m_rightval  ;
+ delete [] m_maxbin    ;
+ delete [] m_maxval    ;
 }
 
 
@@ -350,98 +333,94 @@ double rtrel_dines(double *x, double*par){
 
 
 
-Calibrator::Calibrator(){
-  level =-10;
-  m_name ="None"; 
-  m_rtbinning ="None";
-  m_minrtstat =-10;
-  m_mint0stat =-10;
-  m_t0shift =-100.;
-  m_mint=-5;
-  m_maxt=50;
-  m_nbinst=55;
-
-  m_minr=0;
-  m_maxr=2;
-  m_nbinsr=100;
-
-  m_mintres=-10;
-  m_maxtres=10;
-  m_nbinstres=100;
-
-  m_minres=-0.6;
-  m_maxres=0.6;
-  m_nbinsres=100;
-
-  m_isdines = false;
-  dort=false;
-  dot0=false;
-  dores=false;
-  nort=false;
-  not0=false;
-  usebref=false;
-  bequiet=false;
-  printlog=false;
-  printt0=false;
-  printrt=false;
-  usep0=false;
-  floatp3=false;
+Calibrator::Calibrator()
+  : dort(false),
+    dot0(false),
+    dores(false),
+    nort(false),
+    not0(false),
+    usebref(false),
+    bequiet(false),
+    printlog(false),
+    printt0(false),
+    printrt(false),
+    usep0(false),
+    floatp3(false),
+    useshortstraws(true),
+
+    m_name ("None"),
+    m_rtbinning ("None"),
+    m_minrtstat (-10),
+    m_mint0stat (-10),
+    m_t0shift (-100.),
+
+    m_nbinsr(100),
+    m_nbinst(55),
+    m_nbinstres(100),
+    m_nbinsres(100),
+    m_minr(0),
+    m_maxr(2),
+    m_mint(-5),
+    m_maxt(50),
+    m_mintres(-10),
+    m_maxtres(10),
+    m_minres(-0.6),
+    m_maxres(0.6),
+
+    m_ntreshits(0),
+    m_nreshits(0),
+    m_nrthits(0),
+    m_nhits(0),
+
+    m_isdines ( false)
+{
   selection.insert(-3);
-  useshortstraws=true;
-  m_ntreshits=0;
-  m_nreshits=0;
-  m_nrthits=0;
-  m_nhits=0;
-
-
-
-
-
+  level =-10;
 }
 
-Calibrator::Calibrator(int lev, std::string nme, int mint0, int minrt, std::string rtr, std::string rtb, float t0sft){
+Calibrator::Calibrator(int lev, const std::string& nme, int mint0, int minrt, const std::string& rtr, const std::string& rtb, float t0sft)
+  :  dort(false),
+     dot0(false),
+     dores(false),
+     nort(false),
+     not0(false),
+     usebref(false),
+     bequiet(false),
+     printlog(false),
+     printt0(false),
+     printrt(false),
+     usep0(false),
+     floatp3(false),
+     useshortstraws(true),
+
+     m_name(nme), 
+     m_rtbinning(rtb),
+     m_minrtstat(minrt),
+     m_mint0stat(mint0),
+     m_t0shift(t0sft),
+
+     m_nbinsr(100),
+     m_nbinst(55),
+     m_nbinstres(100),
+     m_nbinsres(100),
+     m_minr(0),
+     m_maxr(2),
+     m_mint(-5),
+     m_maxt(50),
+     m_mintres(-10),
+     m_maxtres(10),
+     m_minres(-0.6),
+     m_maxres(0.6),
+
+     m_ntreshits(0),
+     m_nreshits(0),
+     m_nrthits(0),
+     m_nhits(0),
+
+     m_isdines ( rtr.find("dines")!=std::string::npos)
+{
   level=lev;
-  m_name=nme; 
-  m_rtbinning=rtb;
-  m_minrtstat=minrt;
-  m_mint0stat=mint0;
-  m_t0shift=t0sft;
-
-  m_mint=-5;
-  m_maxt=50;
-  m_nbinst=55;
-
-  m_minr=0;
-  m_maxr=2;
-  m_nbinsr=100;
-
-  m_mintres=-10;
-  m_maxtres=10;
-  m_nbinstres=100;
-
-  m_minres=-0.6;
-  m_maxres=0.6;
-  m_nbinsres=100;
-
-  m_isdines = rtr.find("dines")!=std::string::npos;
-  dort=false;
-  dot0=false;
-  dores=false;
-  nort=false;
-  not0=false;
-  usebref=false;
-  bequiet=false;
-  printlog=false;
-  printt0=false;
-  printrt=false;
-  usep0=false;
-  floatp3=false;
   selection.insert(-3);
-  useshortstraws=true;
-  m_ntreshits=0;
-  m_nreshits=0;
-  m_nrthits=0;
-  m_nhits=0;
 }
 
 Calibrator::~Calibrator(){
@@ -482,10 +461,10 @@ bool Calibrator::Skip(){
 std::string Calibrator::PrintInfo(){
   std::string yn[2]={"NO","YES"};
   std::string info = std::string(Form("CONFIGURATION %-16s: dort=%-3s, dot0=%-3s, dores=%-3s, selection=",m_name.data(),yn[dort].data(),yn[dot0].data(),yn[dores].data()));
-  for (std::set<int>::iterator isel = selection.begin(); isel != selection.end(); isel++) {
-    if (*isel==-3) info += std::string("all"); 
-    else if (*isel==-4) info += std::string("none"); 
-    else info += std::string(Form("%2i,",*isel)); 
+  for (int isel : selection) {
+    if (isel==-3) info += std::string("all"); 
+    else if (isel==-4) info += std::string("none"); 
+    else info += std::string(Form("%2i,",isel)); 
   } 
   return info;
 }
@@ -520,7 +499,7 @@ std::string Calibrator::GetSelString(){
   std::string selstr="";
   if (selection.find(-3)!=selection.end()) selstr="*";
   else if (selection.find(-4)!=selection.end()) selstr="-";
-  else for (std::set<int>::iterator isel=selection.begin(); isel!=selection.end(); isel++) selstr += std::string(Form("%i",*isel));
+  else for (int isel : selection)  selstr += std::string(Form("%i",isel));
   return selstr;
 }
 
@@ -1212,9 +1191,8 @@ void Calibrator::DumpConstants(){
 
   std::ofstream dumpfile( "calib_constants_out.txt", std::ios::out | std::ios::app);
 
-  for(std::map<std::string,caldata>::iterator ihist=data.begin(); ihist!=data.end(); ihist++){
-    
-    dumpfile << ihist->first << " " << (ihist->second).t0 << " " << std::endl;
+  for (const std::pair<const std::string, caldata>& p : data) {
+    dumpfile << p.first << " " << p.second.t0 << " " << std::endl;
     
   }
   
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.h b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.h
index d59d7a4ea978..afbc6650f18d 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.h
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.h
@@ -141,9 +141,9 @@ class caldata{
   /**flag indicating if any calibration has been made*/ bool calflag;
   /**flag indicating if an R-t calibration has been made*/ bool rtflag;
   /**flag indicating if a t0 calibration has been made*/ bool t0flag;
-  /**the 1D time residual histogram (100 bins)*/ float* m_treshist;
-  /**the 1D residual histogram (100 bins)*/ float* reshist;
-  /**the 2D rt histogram (20x32 bins)*/ float* rthist;
+  /**the 1D time residual histogram (100 bins)*/ std::vector<float> m_treshist;
+  /**the 1D residual histogram (100 bins)*/ std::vector<float> reshist;
+  /**the 2D rt histogram (20x32 bins)*/ std::vector<float> rthist;
   /**the rt graph*/ RtGraph* rtgraph;
 };
 
@@ -187,7 +187,10 @@ public:
      @param[in] rtr which rt-relation to use
      @param[in] rtb which rt binning to use
   */
-  Calibrator(int,std::string,int,int,std::string,std::string,float);
+  Calibrator(int,const std::string&,int,int,const std::string&,const std::string&,float);
+
+  Calibrator (const Calibrator&) = delete;
+  Calibrator& operator= (const Calibrator&) = delete;
 
   /**
      Destructor
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx
index ebcd7e2a3c72..699e23218893 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx
@@ -290,7 +290,7 @@ void TRTCalibrator::DumpStrawData(int isid){
 }
 
 
-bool TRTCalibrator::IsSubLev(std::string key, int lev, std::string sublev){  
+bool TRTCalibrator::IsSubLev(const std::string& key, int lev, const std::string& sublev){  
   
   std::string sl=sublev;
 
@@ -305,7 +305,7 @@ bool TRTCalibrator::IsSubLev(std::string key, int lev, std::string sublev){
 
 }
 
-int TRTCalibrator::GetSubLevels(std::string key, int lev, std::set<int>* levels){ 
+int TRTCalibrator::GetSubLevels(const std::string& key, int lev, std::set<int>* levels){ 
 
   std::string sl=SubLev(key,lev);
 
@@ -418,26 +418,27 @@ bool TRTCalibrator::calibrate ATLAS_NOT_THREAD_SAFE () {
   }
 
   //configure the calibrators
-  for (std::vector<std::string>::iterator it = m_doRt.begin();        it != m_doRt.end();        it++) calibrators[*it]->dort=true;
-  for (std::vector<std::string>::iterator it = m_doT0.begin();        it != m_doT0.end();        it++) calibrators[*it]->dot0=true;
-  for (std::vector<std::string>::iterator it = m_doRes.begin();       it != m_doRes.end();       it++) calibrators[*it]->dores=true;
-  for (std::vector<std::string>::iterator it = m_beQuiet.begin();     it != m_beQuiet.end();     it++) calibrators[*it]->bequiet=true;
-  for (std::vector<std::string>::iterator it = m_doOutPrint.begin();  it != m_doOutPrint.end();  it++) calibrators[*it]->printt0=true;
-  for (std::vector<std::string>::iterator it = m_doRtPrint.begin();   it != m_doRtPrint.end();   it++)  calibrators[*it]->printrt=true;
-  for (std::vector<std::string>::iterator it = m_doLogPrint.begin();  it != m_doLogPrint.end();  it++) calibrators[*it]->printlog=true;
-  for (std::vector<std::string>::iterator it = m_useBoardRef.begin(); it != m_useBoardRef.end(); it++) calibrators[*it]->usebref=true;
-  for (std::map<std::string,Calibrator*>::iterator it = calibrators.begin(); it != calibrators.end(); it++){
-    (it->second)->usep0=m_useP0;
-    (it->second)->floatp3=m_floatP3;
-    (it->second)->useshortstraws=m_DoShortStrawCorrection;
-
-    if (m_doRt.size()==0) (it->second)->nort=true;
-    if (m_doT0.size()==0) (it->second)->not0=true;
+  for (const std::string& s : m_doRt)        calibrators[s]->dort=true;
+  for (const std::string& s : m_doT0)        calibrators[s]->dot0=true;
+  for (const std::string& s : m_doRes)       calibrators[s]->dores=true;
+  for (const std::string& s : m_beQuiet)     calibrators[s]->bequiet=true;
+  for (const std::string& s : m_doOutPrint)  calibrators[s]->printt0=true;
+  for (const std::string& s : m_doRtPrint)   calibrators[s]->printrt=true;
+  for (const std::string& s : m_doLogPrint)  calibrators[s]->printlog=true;
+  for (const std::string& s : m_useBoardRef) calibrators[s]->usebref=true;
+  for (std::pair<const std::string, Calibrator*>& p : calibrators) {
+    Calibrator* calib = p.second;
+    calib->usep0=m_useP0;
+    calib->floatp3=m_floatP3;
+    calib->useshortstraws=m_DoShortStrawCorrection;
+
+    if (m_doRt.size()==0) calib->nort=true;
+    if (m_doT0.size()==0) calib->not0=true;
     
     std::set<int> selset;
-    GetSubLevels(m_selstring,(it->second)->level+1,&selset); //get the set of selections for level "level+1" from the m_selstring ... 
-    for (std::set<int>::iterator imod=selset.begin(); imod!=selset.end(); imod++){
-      (it->second)->selection = selset;//... and configure the calibrator with them
+    GetSubLevels(m_selstring,calib->level+1,&selset); //get the set of selections for level "level+1" from the m_selstring ...
+    for (std::set<int>::iterator imod=selset.begin(); imod!=selset.end(); ++imod){
+      calib->selection = selset;//... and configure the calibrator with them
     }
   }     
 
@@ -461,26 +462,27 @@ bool TRTCalibrator::calibrate ATLAS_NOT_THREAD_SAFE () {
   calibratorsAr["Straw"]                =&Straw_Ar;
 
   //configure the calibrators
-  for (std::vector<std::string>::iterator it = m_doRt.begin();        it != m_doRt.end();        it++) calibratorsAr[*it]->dort=true;
-  for (std::vector<std::string>::iterator it = m_doT0.begin();        it != m_doT0.end();        it++) calibratorsAr[*it]->dot0=true;
-  for (std::vector<std::string>::iterator it = m_doRes.begin();       it != m_doRes.end();       it++) calibratorsAr[*it]->dores=true;
-  for (std::vector<std::string>::iterator it = m_beQuiet.begin();     it != m_beQuiet.end();     it++) calibratorsAr[*it]->bequiet=true;
-  for (std::vector<std::string>::iterator it = m_doOutPrint.begin();  it != m_doOutPrint.end();  it++) calibratorsAr[*it]->printt0=true;
-  for (std::vector<std::string>::iterator it = m_doRtPrint.begin();   it != m_doRtPrint.end();   it++)  calibratorsAr[*it]->printrt=true;
-  for (std::vector<std::string>::iterator it = m_doLogPrint.begin();  it != m_doLogPrint.end();  it++) calibratorsAr[*it]->printlog=true;
-  for (std::vector<std::string>::iterator it = m_useBoardRef.begin(); it != m_useBoardRef.end(); it++) calibratorsAr[*it]->usebref=true;
-  for (std::map<std::string,Calibrator*>::iterator it = calibratorsAr.begin(); it != calibratorsAr.end(); it++){
-    (it->second)->usep0=m_useP0;
-    (it->second)->floatp3=m_floatP3;
-    (it->second)->useshortstraws=m_DoShortStrawCorrection;
-
-    if (m_doRt.size()==0) (it->second)->nort=true;
-    if (m_doT0.size()==0) (it->second)->not0=true;
+  for (const std::string& s : m_doRt)        calibratorsAr[s]->dort=true;
+  for (const std::string& s : m_doT0)        calibratorsAr[s]->dot0=true;
+  for (const std::string& s : m_doRes)       calibratorsAr[s]->dores=true;
+  for (const std::string& s : m_beQuiet)     calibratorsAr[s]->bequiet=true;
+  for (const std::string& s : m_doOutPrint)  calibratorsAr[s]->printt0=true;
+  for (const std::string& s : m_doRtPrint)   calibratorsAr[s]->printrt=true;
+  for (const std::string& s : m_doLogPrint)  calibratorsAr[s]->printlog=true;
+  for (const std::string& s : m_useBoardRef) calibratorsAr[s]->usebref=true;
+  for (std::pair<const std::string, Calibrator*>& p : calibratorsAr) {
+    Calibrator* calib = p.second;
+    calib->usep0=m_useP0;
+    calib->floatp3=m_floatP3;
+    calib->useshortstraws=m_DoShortStrawCorrection;
+
+    if (m_doRt.size()==0) calib->nort=true;
+    if (m_doT0.size()==0) calib->not0=true;
 
     std::set<int> selset;
-    GetSubLevels(m_selstring,(it->second)->level+1,&selset); //get the set of selections for level "level+1" from the m_selstring ... 
-    for (std::set<int>::iterator imod=selset.begin(); imod!=selset.end(); imod++){
-      (it->second)->selection = selset;//... and configure the calibrator with them
+    GetSubLevels(m_selstring,calib->level+1,&selset); //get the set of selections for level "level+1" from the m_selstring ... 
+    for (std::set<int>::iterator imod=selset.begin(); imod!=selset.end(); ++imod){
+      calib->selection = selset;//... and configure the calibrator with them
     }
   }
 
@@ -959,59 +961,59 @@ bool TRTCalibrator::calibrate ATLAS_NOT_THREAD_SAFE () {
 
   //if (m_SplitBarrel){
   
-  for (std::map<std::string,BDdetector>::iterator it = m_trt.t.begin(); it != m_trt.t.end(); it++){
+  for (std::pair<const std::string, BDdetector>& pt : m_trt.t) {
     
     if (TRT.Skip()) break;
-    if (TRT.HasKey(it->first)) {
-      trtdir = TRT.Calibrate(m_histfile,it->first,SubLev(m_options,1),&startdata);
-      if (TRT.printt0) t0calfile << Form("-3 -1 -1 -1 -1 : %e %e",TRT.data[it->first].t0,TRT.data[it->first].t0err) << std::endl;
-      if (TRT.printrt) rtcalfile << Form("-3 -1 -1 -1 -1 : %i %e %e %e %e",rtint,TRT.data[it->first].rtpar[0],TRT.data[it->first].rtpar[1],TRT.data[it->first].rtpar[2],TRT.data[it->first].rtpar[3]) << std::endl;
+    if (TRT.HasKey(pt.first)) {
+      trtdir = TRT.Calibrate(m_histfile,pt.first,SubLev(m_options,1),&startdata);
+      if (TRT.printt0) t0calfile << Form("-3 -1 -1 -1 -1 : %e %e",TRT.data[pt.first].t0,TRT.data[pt.first].t0err) << std::endl;
+      if (TRT.printrt) rtcalfile << Form("-3 -1 -1 -1 -1 : %i %e %e %e %e",rtint,TRT.data[pt.first].rtpar[0],TRT.data[pt.first].rtpar[1],TRT.data[pt.first].rtpar[2],TRT.data[pt.first].rtpar[3]) << std::endl;
     }
-    for (std::map<std::string,BDlayer>::iterator id = (it->second.d).begin() ; id != (it->second.d).end(); id++){
+    for (std::pair<const std::string, BDlayer>& pd : pt.second.d) {
       
       if(Detector.Skip()) break; 
-      if(Detector.HasKey(id->first)){
-        detdir = Detector.Calibrate(trtdir,id->first,SubLev(m_options,2),&TRT.data[it->first]);
+      if(Detector.HasKey(pd.first)){
+        detdir = Detector.Calibrate(trtdir,pd.first,SubLev(m_options,2),&TRT.data[pt.first]);
       }
-      for (std::map<std::string,BDmodule>::iterator il = (id->second.l).begin(); il != (id->second.l).end(); il++){
+      for (std::pair<const std::string, BDmodule>& pl : pd.second.l) {
 
         if(Layer.Skip()) break;
-        if(Layer.HasKey(il->first)){
-          laydir = Layer.Calibrate(detdir,il->first,SubLev(m_options,3),&Detector.data[id->first]);
-          if (Layer.printt0) t0calfile << Form("%i %i -1 -1 -1 : %e %e",Layer.data[il->first].det,Layer.data[il->first].lay,Layer.data[il->first].t0,Layer.data[il->first].t0err) << std::endl;
-          if (Layer.printrt) rtcalfile    << Form("%i %i -1 -1 -1 : %i %e %e %e %e",Layer.data[il->first].det,Layer.data[il->first].lay,rtint,Layer.data[il->first].rtpar[0],Layer.data[il->first].rtpar[1],Layer.data[il->first].rtpar[2],Layer.data[il->first].rtpar[3]) << std::endl;
+        if(Layer.HasKey(pl.first)){
+          laydir = Layer.Calibrate(detdir,pl.first,SubLev(m_options,3),&Detector.data[pd.first]);
+          if (Layer.printt0) t0calfile << Form("%i %i -1 -1 -1 : %e %e",Layer.data[pl.first].det,Layer.data[pl.first].lay,Layer.data[pl.first].t0,Layer.data[pl.first].t0err) << std::endl;
+          if (Layer.printrt) rtcalfile    << Form("%i %i -1 -1 -1 : %i %e %e %e %e",Layer.data[pl.first].det,Layer.data[pl.first].lay,rtint,Layer.data[pl.first].rtpar[0],Layer.data[pl.first].rtpar[1],Layer.data[pl.first].rtpar[2],Layer.data[pl.first].rtpar[3]) << std::endl;
           if (!m_SplitBarrel) {
-            if (Layer.printt0) t0calfile    << Form("%i %i -1 -1 -1 : %e %e",-Layer.data[il->first].det,Layer.data[il->first].lay,Layer.data[il->first].t0,Layer.data[il->first].t0err) << std::endl;
-            if (Layer.printrt) rtcalfile    << Form("%i %i -1 -1 -1 : %i %e %e %e %e",-Layer.data[il->first].det,Layer.data[il->first].lay,rtint,Layer.data[il->first].rtpar[0],Layer.data[il->first].rtpar[1],Layer.data[il->first].rtpar[2],Layer.data[il->first].rtpar[3]) << std::endl;
+            if (Layer.printt0) t0calfile    << Form("%i %i -1 -1 -1 : %e %e",-Layer.data[pl.first].det,Layer.data[pl.first].lay,Layer.data[pl.first].t0,Layer.data[pl.first].t0err) << std::endl;
+            if (Layer.printrt) rtcalfile    << Form("%i %i -1 -1 -1 : %i %e %e %e %e",-Layer.data[pl.first].det,Layer.data[pl.first].lay,rtint,Layer.data[pl.first].rtpar[0],Layer.data[pl.first].rtpar[1],Layer.data[pl.first].rtpar[2],Layer.data[pl.first].rtpar[3]) << std::endl;
           }
         }
-        for (std::map<std::string,BDboard>::iterator im = (il->second.m).begin(); im != (il->second.m).end(); im++){
+        for (std::pair<const std::string, BDboard>& pm : pl.second.m) {
 
           if(Module.Skip()) break; 
-          if(Module.HasKey(im->first)){ 
-            moddir = Module.Calibrate(laydir,im->first,SubLev(m_options,4),&Layer.data[il->first]);
-            if (Module.printt0) t0calfile << Form("%i %i %i -1 -1 : %e %e",Module.data[im->first].det,Module.data[im->first].lay,Module.data[im->first].mod,Module.data[im->first].t0,Module.data[im->first].t0err) << std::endl;
-            if (Module.printrt) rtcalfile    << Form("%i %i %i -1 -1 : %i %e %e %e %e",Module.data[im->first].det,Module.data[im->first].lay,Module.data[im->first].mod,rtint,Module.data[im->first].rtpar[0],Module.data[im->first].rtpar[1],Module.data[im->first].rtpar[2],Module.data[im->first].rtpar[3]) << std::endl;
+          if(Module.HasKey(pm.first)){ 
+            moddir = Module.Calibrate(laydir,pm.first,SubLev(m_options,4),&Layer.data[pl.first]);
+            if (Module.printt0) t0calfile << Form("%i %i %i -1 -1 : %e %e",Module.data[pm.first].det,Module.data[pm.first].lay,Module.data[pm.first].mod,Module.data[pm.first].t0,Module.data[pm.first].t0err) << std::endl;
+            if (Module.printrt) rtcalfile    << Form("%i %i %i -1 -1 : %i %e %e %e %e",Module.data[pm.first].det,Module.data[pm.first].lay,Module.data[pm.first].mod,rtint,Module.data[pm.first].rtpar[0],Module.data[pm.first].rtpar[1],Module.data[pm.first].rtpar[2],Module.data[pm.first].rtpar[3]) << std::endl;
           } 
-          for (std::map<std::string,BDchip>::iterator ib = (im->second.b).begin(); ib != (im->second.b).end(); ib++){
+          for (std::pair<const std::string, BDchip>& pb : pm.second.b) {
 
             if(Board.Skip()) break; 
-            if(Board.HasKey(ib->first)){ 
-              brddir = Board.Calibrate(moddir,ib->first,SubLev(m_options,5),&Module.data[im->first]);
+            if(Board.HasKey(pb.first)){ 
+              brddir = Board.Calibrate(moddir,pb.first,SubLev(m_options,5),&Module.data[pm.first]);
             } 
-            for (std::map<std::string,BDstraw>::iterator ic = (ib->second.c).begin(); ic != (ib->second.c).end(); ic++){
+            for (std::pair<const std::string, BDstraw>& pc : pb.second.c) {
 
               if(Chip.Skip()) break; 
-              if(Chip.HasKey(ic->first)){ 
-                chpdir = Chip.Calibrate(brddir,ic->first,SubLev(m_options,6),&Board.data[ib->first]);
+              if(Chip.HasKey(pc.first)){ 
+                chpdir = Chip.Calibrate(brddir,pc.first,SubLev(m_options,6),&Board.data[pb.first]);
               }
-              for (std::map<std::string,BDzero>::iterator is = (ic->second.s).begin(); is != (ic->second.s).end(); is++){
+              for (std::pair<const std::string, BDzero>& ps : pc.second.s) {
 
                 if(Straw.Skip()) break;
-                if(Straw.HasKey(is->first)){ 
-                  Straw.Calibrate(chpdir,is->first,SubLev(m_options,7),&Chip.data[ic->first]);
-                  if (Straw.printt0) t0calfile << Form("%i %i %i %i %i : %e %e",Straw.data[is->first].det,Straw.data[is->first].lay,Straw.data[is->first].mod,Straw.data[is->first].stl,Straw.data[is->first].stw,Straw.data[is->first].t0,Straw.data[is->first].t0err) << std::endl;
-                  if (Straw.printrt) rtcalfile << Form("%i %i %i %i %i : %i %e %e %e %e",Straw.data[is->first].det,Straw.data[is->first].lay,Straw.data[is->first].mod,Straw.data[is->first].stl,Straw.data[is->first].stw,rtint,Straw.data[is->first].rtpar[0],Straw.data[is->first].rtpar[1],Straw.data[is->first].rtpar[2],Straw.data[is->first].rtpar[3]) << std::endl;
+                if(Straw.HasKey(ps.first)){ 
+                  Straw.Calibrate(chpdir,ps.first,SubLev(m_options,7),&Chip.data[pc.first]);
+                  if (Straw.printt0) t0calfile << Form("%i %i %i %i %i : %e %e",Straw.data[ps.first].det,Straw.data[ps.first].lay,Straw.data[ps.first].mod,Straw.data[ps.first].stl,Straw.data[ps.first].stw,Straw.data[ps.first].t0,Straw.data[ps.first].t0err) << std::endl;
+                  if (Straw.printrt) rtcalfile << Form("%i %i %i %i %i : %i %e %e %e %e",Straw.data[ps.first].det,Straw.data[ps.first].lay,Straw.data[ps.first].mod,Straw.data[ps.first].stl,Straw.data[ps.first].stw,rtint,Straw.data[ps.first].rtpar[0],Straw.data[ps.first].rtpar[1],Straw.data[ps.first].rtpar[2],Straw.data[ps.first].rtpar[3]) << std::endl;
                 
 
                 }
@@ -1033,52 +1035,51 @@ bool TRTCalibrator::calibrate ATLAS_NOT_THREAD_SAFE () {
 
   if (m_DoArXenonSep){
 
-  for (std::map<std::string,BDdetector>::iterator it = m_trt.t.begin(); it != m_trt.t.end(); it++){
+  for (std::pair<const std::string, BDdetector>& pt : m_trt.t) {
 
     if (TRT_Ar.Skip()) break;
-    if (TRT_Ar.HasKey(it->first)) {
-      trtdirAr = TRT_Ar.Calibrate(m_histfile,it->first,SubLev(m_options,1),&startdata);
+    if (TRT_Ar.HasKey(pt.first)) {
+      trtdirAr = TRT_Ar.Calibrate(m_histfile,pt.first,SubLev(m_options,1),&startdata);
     }
-    for (std::map<std::string,BDlayer>::iterator id = (it->second.d).begin() ; id != (it->second.d).end(); id++){
+    for (std::pair<const std::string, BDlayer>& pd : pt.second.d) {
 
       if(Detector_Ar.Skip()) break;
-      if(Detector_Ar.HasKey(id->first)){
-        detdirAr = Detector_Ar.Calibrate(trtdirAr,id->first,SubLev(m_options,2),&TRT_Ar.data[it->first]);
+      if(Detector_Ar.HasKey(pd.first)){
+        detdirAr = Detector_Ar.Calibrate(trtdirAr,pd.first,SubLev(m_options,2),&TRT_Ar.data[pt.first]);
       }
-      for (std::map<std::string,BDmodule>::iterator il = (id->second.l).begin(); il != (id->second.l).end(); il++){
+      for (std::pair<const std::string, BDmodule>& pl : pd.second.l) {
 
         if(Layer_Ar.Skip()) break;
-        if(Layer_Ar.HasKey(il->first)){
-          laydirAr = Layer_Ar.Calibrate(detdirAr,il->first,SubLev(m_options,3),&Detector_Ar.data[id->first]);
+        if(Layer_Ar.HasKey(pl.first)){
+          laydirAr = Layer_Ar.Calibrate(detdirAr,pl.first,SubLev(m_options,3),&Detector_Ar.data[pd.first]);
        
         }
-        for (std::map<std::string,BDboard>::iterator im = (il->second.m).begin(); im != (il->second.m).end(); im++){
+        for (std::pair<const std::string, BDboard>& pm : pl.second.m) {
 
           if(Module_Ar.Skip()) break;
-          if(Module_Ar.HasKey(im->first)){
-            moddirAr = Module_Ar.Calibrate(laydirAr,im->first,SubLev(m_options,4),&Layer_Ar.data[il->first]);
-            if (Module_Ar.printt0) t0calfile << Form("%i %i %i -1 -1 : %e %e",Module_Ar.data[im->first].det,Module_Ar.data[im->first].lay,Module_Ar.data[im->first].mod,Module_Ar.data[im->first].t0,Module_Ar.data[im->first].t0err) << std::endl;
-            if (Layer_Ar.printrt) rtcalfile    << Form("%i %i %i -1 -1 : %i %e %e %e %e",Module_Ar.data[im->first].det,Module_Ar.data[im->first].lay,Module_Ar.data[im->first].mod,rtint,Module_Ar.data[im->first].rtpar[0],Module_Ar.data[im->first].rtpar[1],Module_Ar.data[im->first].rtpar[2],Module_Ar.data[im->first].rtpar[3]) << std::endl;
+          if(Module_Ar.HasKey(pm.first)){
+            moddirAr = Module_Ar.Calibrate(laydirAr,pm.first,SubLev(m_options,4),&Layer_Ar.data[pl.first]);
+            if (Module_Ar.printt0) t0calfile << Form("%i %i %i -1 -1 : %e %e",Module_Ar.data[pm.first].det,Module_Ar.data[pm.first].lay,Module_Ar.data[pm.first].mod,Module_Ar.data[pm.first].t0,Module_Ar.data[pm.first].t0err) << std::endl;
+            if (Layer_Ar.printrt) rtcalfile    << Form("%i %i %i -1 -1 : %i %e %e %e %e",Module_Ar.data[pm.first].det,Module_Ar.data[pm.first].lay,Module_Ar.data[pm.first].mod,rtint,Module_Ar.data[pm.first].rtpar[0],Module_Ar.data[pm.first].rtpar[1],Module_Ar.data[pm.first].rtpar[2],Module_Ar.data[pm.first].rtpar[3]) << std::endl;
           }
-          for (std::map<std::string,BDchip>::iterator ib = (im->second.b).begin(); ib != (im->second.b).end(); ib++){
-
+          for (std::pair<const std::string, BDchip>& pb : pm.second.b) {
             if(Board_Ar.Skip()) break;
-            if(Board_Ar.HasKey(ib->first)){
-              brddirAr = Board_Ar.Calibrate(moddirAr,ib->first,SubLev(m_options,5),&Module_Ar.data[im->first]);
+            if(Board_Ar.HasKey(pb.first)){
+              brddirAr = Board_Ar.Calibrate(moddirAr,pb.first,SubLev(m_options,5),&Module_Ar.data[pm.first]);
             }
-            for (std::map<std::string,BDstraw>::iterator ic = (ib->second.c).begin(); ic != (ib->second.c).end(); ic++){
+            for (std::pair<const std::string, BDstraw>& pc : pb.second.c) {
 
               if(Chip_Ar.Skip()) break;
-              if(Chip_Ar.HasKey(ic->first)){
-                chpdirAr = Chip_Ar.Calibrate(brddirAr,ic->first,SubLev(m_options,6),&Board_Ar.data[ib->first]);
+              if(Chip_Ar.HasKey(pc.first)){
+                chpdirAr = Chip_Ar.Calibrate(brddirAr,pc.first,SubLev(m_options,6),&Board_Ar.data[pb.first]);
               }
-              for (std::map<std::string,BDzero>::iterator is = (ic->second.s).begin(); is != (ic->second.s).end(); is++){
+              for (std::pair<const std::string, BDzero>& ps : pc.second.s) {
 
                 if(Straw_Ar.Skip()) break;
-                if(Straw_Ar.HasKey(is->first)){
-                  Straw_Ar.Calibrate(chpdirAr,is->first,SubLev(m_options,7),&Chip_Ar.data[ic->first]);
-                  if (Straw_Ar.printt0) t0calfile << Form("%i %i %i %i %i : %e %e",Straw_Ar.data[is->first].det,Straw_Ar.data[is->first].lay,Straw_Ar.data[is->first].mod,Straw_Ar.data[is->first].stl,Straw_Ar.data[is->first].stw,Straw_Ar.data[is->first].t0,Straw_Ar.data[is->first].t0err) << std::endl;
-                  if (Straw_Ar.printrt) rtcalfile << Form("%i %i %i %i %i : %i %e %e %e %e",Straw_Ar.data[is->first].det,Straw_Ar.data[is->first].lay,Straw_Ar.data[is->first].mod,Straw_Ar.data[is->first].stl,Straw_Ar.data[is->first].stw,rtint,Straw_Ar.data[is->first].rtpar[0],Straw_Ar.data[is->first].rtpar[1],Straw_Ar.data[is->first].rtpar[2],Straw_Ar.data[is->first].rtpar[3]) << std::endl;
+                if(Straw_Ar.HasKey(ps.first)){
+                  Straw_Ar.Calibrate(chpdirAr,ps.first,SubLev(m_options,7),&Chip_Ar.data[pc.first]);
+                  if (Straw_Ar.printt0) t0calfile << Form("%i %i %i %i %i : %e %e",Straw_Ar.data[ps.first].det,Straw_Ar.data[ps.first].lay,Straw_Ar.data[ps.first].mod,Straw_Ar.data[ps.first].stl,Straw_Ar.data[ps.first].stw,Straw_Ar.data[ps.first].t0,Straw_Ar.data[ps.first].t0err) << std::endl;
+                  if (Straw_Ar.printrt) rtcalfile << Form("%i %i %i %i %i : %i %e %e %e %e",Straw_Ar.data[ps.first].det,Straw_Ar.data[ps.first].lay,Straw_Ar.data[ps.first].mod,Straw_Ar.data[ps.first].stl,Straw_Ar.data[ps.first].stw,rtint,Straw_Ar.data[ps.first].rtpar[0],Straw_Ar.data[ps.first].rtpar[1],Straw_Ar.data[ps.first].rtpar[2],Straw_Ar.data[ps.first].rtpar[3]) << std::endl;
                 }
               }
             }
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.h b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.h
index 0f5de05eae42..00330815d4e3 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.h
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.h
@@ -87,7 +87,7 @@ public:
   /**
      returns true if the ...
   */
-  bool IsSubLev(std::string, int, std::string);  
+  bool IsSubLev(const std::string&, int, const std::string&);  
 
   /**
      returns true if the ...
@@ -97,7 +97,7 @@ public:
   /**
      fills a set of integers with the indexes af the sub-modules that are conatined in a selection 
   */
-  int GetSubLevels(std::string, int, std::set<int>*);  
+  int GetSubLevels(const std::string&, int, std::set<int>*);  
 
   /**
      makes the key strings for a sub-module
-- 
GitLab


From 29b9077b924681734a0f5d799d19f079e1a2a7aa Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 16 Sep 2020 11:59:05 -0400
Subject: [PATCH 409/422] IDScanHitFilter: Fix cppcheck warnings.

 - Shifting of signed values.
 - Prefer preincrement (or range for) to postincrement for iterators.
---
 .../TrigTools/IDScanHitFilter/src/FilterBin.h |  8 ++--
 .../IDScanHitFilter/src/FixedBitSet.h         | 38 +++++++++---------
 .../IDScanHitFilter/src/IDScanHitFilter.cxx   |  5 +--
 .../IDScanHitFilter/src/iHitFilter.cxx        | 40 ++++++++-----------
 4 files changed, 41 insertions(+), 50 deletions(-)

diff --git a/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.h b/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.h
index 0263c23f8228..c93b01262fdc 100644
--- a/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.h
+++ b/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.h
@@ -63,10 +63,10 @@ private:
 inline std::ostream& operator<<(std::ostream& s, const FilterBin& f) { 
   s << "[ Nhits="    << f.NumberOfHits() 
     << "\t Nlayers=" << f.NumberOfLayers() << "\taddr=" << (void*)&f << "\t]";
-  
-  std::list<IdScanSpPoint*>::const_iterator spitr(f.hitList().begin());
-  std::list<IdScanSpPoint*>::const_iterator spend(f.hitList().end());
-  for ( ; spitr!=spend ; spitr++ ) s << "\n\t" << *(*spitr);
+
+  for (const IdScanSpPoint* hit : f.hitList()) {
+    s << "\n\t" << *hit;
+  }
   return s;
 }
 
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/FixedBitSet.h b/Trigger/TrigTools/IDScanHitFilter/src/FixedBitSet.h
index 390cb42b1cd6..da4311ccd464 100755
--- a/Trigger/TrigTools/IDScanHitFilter/src/FixedBitSet.h
+++ b/Trigger/TrigTools/IDScanHitFilter/src/FixedBitSet.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -26,25 +26,25 @@
 
 
   // Create the masks for each bit.
-  static const int setMask[] = { 
-    ((int) 1<< 0), ((int) 1<< 1), ((int) 1<< 2), ((int) 1<< 3), 
-    ((int) 1<< 4), ((int) 1<< 5), ((int) 1<< 6), ((int) 1<< 7), 
-    ((int) 1<< 8), ((int) 1<< 9), ((int) 1<<10), ((int) 1<<11), 
-    ((int) 1<<12), ((int) 1<<13), ((int) 1<<14), ((int) 1<<15), 
-    ((int) 1<<16), ((int) 1<<17), ((int) 1<<18), ((int) 1<<19), 
-    ((int) 1<<20), ((int) 1<<21), ((int) 1<<22), ((int) 1<<23), 
-    ((int) 1<<24), ((int) 1<<25), ((int) 1<<26), ((int) 1<<27), 
-    ((int) 1<<28), ((int) 1<<29), ((int) 1<<30), ((int) 1<<31)};
+  static const unsigned int setMask[] = { 
+    (1u<< 0), (1u<< 1), (1u<< 2), (1u<< 3), 
+    (1u<< 4), (1u<< 5), (1u<< 6), (1u<< 7), 
+    (1u<< 8), (1u<< 9), (1u<<10), (1u<<11), 
+    (1u<<12), (1u<<13), (1u<<14), (1u<<15), 
+    (1u<<16), (1u<<17), (1u<<18), (1u<<19), 
+    (1u<<20), (1u<<21), (1u<<22), (1u<<23), 
+    (1u<<24), (1u<<25), (1u<<26), (1u<<27), 
+    (1u<<28), (1u<<29), (1u<<30), (1u<<31)};
   
-  static const int clearMask[] = { 
-    ~((int) 1<< 0),~((int) 1<< 1),~((int) 1<< 2),~((int) 1<< 3), 
-    ~((int) 1<< 4),~((int) 1<< 5),~((int) 1<< 6),~((int) 1<< 7), 
-    ~((int) 1<< 8),~((int) 1<< 9),~((int) 1<<10),~((int) 1<<11), 
-    ~((int) 1<<12),~((int) 1<<13),~((int) 1<<14),~((int) 1<<15), 
-    ~((int) 1<<16),~((int) 1<<17),~((int) 1<<18),~((int) 1<<19), 
-    ~((int) 1<<20),~((int) 1<<21),~((int) 1<<22),~((int) 1<<23), 
-    ~((int) 1<<24),~((int) 1<<25),~((int) 1<<26),~((int) 1<<27), 
-    ~((int) 1<<28),~((int) 1<<29),~((int) 1<<30),~((int) 1<<31)};
+  static const unsigned int clearMask[] = { 
+    ~(1u<< 0),~(1u<< 1),~(1u<< 2),~(1u<< 3), 
+    ~(1u<< 4),~(1u<< 5),~(1u<< 6),~(1u<< 7), 
+    ~(1u<< 8),~(1u<< 9),~(1u<<10),~(1u<<11), 
+    ~(1u<<12),~(1u<<13),~(1u<<14),~(1u<<15), 
+    ~(1u<<16),~(1u<<17),~(1u<<18),~(1u<<19), 
+    ~(1u<<20),~(1u<<21),~(1u<<22),~(1u<<23), 
+    ~(1u<<24),~(1u<<25),~(1u<<26),~(1u<<27), 
+    ~(1u<<28),~(1u<<29),~(1u<<30),~(1u<<31)};
 
   static const int countLUT0[] = 
   {0,2,1,3,1,3,2,4,1,3,2,4,2,4,3,5,1,3,2,4,2,4,3,5,2,4,3,5,3,5,4,6,
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx b/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx
index 834b75178052..57304efd3e9a 100755
--- a/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx
+++ b/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx
@@ -203,10 +203,9 @@ void IDScanHitFilter::makeTracks( GroupList& idScanGroups, TrigInDetTrackCollect
 							      1.0/ptInv );
 
     std::vector<const TrigSiSpacePoint*> spacePointsOnTrack;
-    for(std::list<IdScanSpPoint *>::iterator hitItr=gItr->groupHits().begin();
-	hitItr!=gItr->groupHits().end();hitItr++) 
+    for (IdScanSpPoint* sp : gItr->groupHits())
       {
-	spacePointsOnTrack.push_back( (**hitItr).commonSP() );
+	spacePointsOnTrack.push_back( sp->commonSP() );
       }
     std::vector<const TrigSiSpacePoint*>* spv = new std::vector<const TrigSiSpacePoint*>;
     spv->assign(spacePointsOnTrack.begin(),spacePointsOnTrack.end());
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.cxx b/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.cxx
index b40a435d2e46..8812d32fc307 100755
--- a/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.cxx
+++ b/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.cxx
@@ -435,9 +435,7 @@ void iHitFilter::groupCleaner( GroupList::iterator& inputItr, GroupList& cleanGr
 		    << std::endl;
 #endif
 
-	  std::list<IdScanSpPoint *>::iterator hitItr=(*gItr2).groupHits().begin();
-	  for( ; hitItr!=(*gItr2).groupHits().end(); hitItr++) {
-	    IdScanSpPoint* pSP=(*hitItr);
+          for (IdScanSpPoint* pSP : gItr2->groupHits()) {
 	    pSP->setUsed(1);
 #ifdef IDSCAN_DEBUG
 	    std::cout << "IDSCAN_DEBUG: new group - layer = " << pSP->layer()
@@ -451,14 +449,14 @@ void iHitFilter::groupCleaner( GroupList::iterator& inputItr, GroupList& cleanGr
 	  int badHit=0;
 	  //setting used=0 to spacepoints in the same layer
 	  for(std::list<IdScanSpPoint *>::iterator phIt1=(*gItr2).groupHits().begin();
-	      phIt1!=(*gItr2).groupHits().end();phIt1++) 
+	      phIt1!=(*gItr2).groupHits().end();++phIt1) 
 	    {
 	      //if((*phIt1)->used()==0) continue;
 	      int lay1=(*phIt1)->layer();
 	      int type1=((*phIt1)->dz()<(*phIt1)->dr())?1:0;
 	      std::list<IdScanSpPoint *>::iterator phIt2=phIt1;
-	      phIt2++;
-	      for(;phIt2!=(*gItr2).groupHits().end();phIt2++)
+	      ++phIt2;
+	      for(;phIt2!=(*gItr2).groupHits().end();++phIt2)
 		{
 		  //if((*phIt2)->used()==0) continue;
 		  int lay2=(*phIt2)->layer();
@@ -499,7 +497,7 @@ void iHitFilter::groupCleaner( GroupList::iterator& inputItr, GroupList& cleanGr
 		    }
 		  else 
 		    {
-		      hitItr++;pSP->setUsed(1);
+		      ++hitItr;pSP->setUsed(1);
 		    }
 		}
 	    }
@@ -899,10 +897,8 @@ void TrackFilterClass::removeClones(int cut)
       (*pTCCIt)->m_nHitShift=nTrackCounter*nSign;
       memset(nContribHisto,0,sizeof(nContribHisto));
 
-      for(std::list<IdScanSpPoint *>::iterator hitItr=(*pTCCIt)->m_pGroup->groupHits().begin();
-	  hitItr!=(*pTCCIt)->m_pGroup->groupHits().end();hitItr++) 
+      for (IdScanSpPoint* pSP : (*pTCCIt)->m_pGroup->groupHits())
 	{
-	  IdScanSpPoint* pSP=(*hitItr);
 	  if(pSP->used()==0) continue;
 	  if(pSP->used()==1)
 	    pSP->setUsed((*pTCCIt)->m_nHitShift);
@@ -977,17 +973,15 @@ void iHitFilter::fitGroup(Group& G)
 
   double minPhi=(*G.groupHits().begin())->phi();
 
-  for(std::list<IdScanSpPoint *>::iterator hitItr=G.groupHits().begin();
-      hitItr!=G.groupHits().end();hitItr++) 
+  for (IdScanSpPoint* pSP : G.groupHits())
     {
-      if(minPhi>(*hitItr)->phi()) minPhi=(*hitItr)->phi();
-      spVec.push_back((*hitItr));
+      if(minPhi>pSP->phi()) minPhi=pSP->phi();
+      spVec.push_back(pSP);
     }
   std::sort(spVec.begin(),spVec.end(),CompareSpByLayer);
 
-  for(std::vector<IdScanSpPoint *>::iterator hitItr=spVec.begin();hitItr!=spVec.end();hitItr++) 
+  for (IdScanSpPoint* pSP : spVec)
     {
-      IdScanSpPoint* pSP=(*hitItr);
       nHits++;
       double delta=pSP->phi()-minPhi;
       if(std::fabs(delta)>M_PI) delta-=2.0*M_PI;
@@ -999,7 +993,7 @@ void iHitFilter::fitGroup(Group& G)
   printf("Average PHI0=%f Initial Pt=%f\n",averagePhi0,1.0/G.getPtInv());
 #endif
 
-  for(std::vector<IdScanSpPoint *>::reverse_iterator hitItr=spVec.rbegin();hitItr!=spVec.rend();hitItr++) 
+  for(std::vector<IdScanSpPoint *>::reverse_iterator hitItr=spVec.rbegin();hitItr!=spVec.rend();++hitItr) 
     {
       IdScanSpPoint* pSP=(*hitItr);
       if(pSP->used()!=0)
@@ -1309,17 +1303,15 @@ void iHitFilter::fitGroupWithoutHitRemoval(Group& G)
 
   double minPhi=(*G.groupHits().begin())->phi();
 
-  for(std::list<IdScanSpPoint *>::iterator hitItr=G.groupHits().begin();
-      hitItr!=G.groupHits().end();hitItr++) 
+  for (IdScanSpPoint* pSP : G.groupHits())
     {
-      if(minPhi>(*hitItr)->phi()) minPhi=(*hitItr)->phi();
-      spVec.push_back((*hitItr));
+      if(minPhi>pSP->phi()) minPhi=pSP->phi();
+      spVec.push_back(pSP);
     }
   std::sort(spVec.begin(),spVec.end(),CompareSpByLayer);
 
-  for(std::vector<IdScanSpPoint *>::iterator hitItr=spVec.begin();hitItr!=spVec.end();hitItr++) 
+  for (IdScanSpPoint* pSP : spVec)
     {
-      IdScanSpPoint* pSP=(*hitItr);
       if(pSP->used()==0)
 	pSP->setUsed(1);
       nHits++;
@@ -1333,7 +1325,7 @@ void iHitFilter::fitGroupWithoutHitRemoval(Group& G)
   printf("Average PHI0=%f Initial Pt=%f\n",averagePhi0,1.0/G.getPtInv());
 #endif
 
-  for(std::vector<IdScanSpPoint *>::reverse_iterator hitItr=spVec.rbegin();hitItr!=spVec.rend();hitItr++) 
+  for(std::vector<IdScanSpPoint *>::reverse_iterator hitItr=spVec.rbegin();hitItr!=spVec.rend();++hitItr) 
     {
       IdScanSpPoint* pSP=(*hitItr);
       int LayId=pSP->layer();
-- 
GitLab


From f44f03fefaa3a065cb9487bb0fc68878e6093e9f Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 16 Sep 2020 15:51:29 -0400
Subject: [PATCH 410/422] TrigJiveXML: Fix cppcheck warnings.

 - Prefer using an initializer list to assigning members
   in a ctor body.
---
 .../TrigJiveXML/src/TrigSiSpacePointRetriever.cxx         | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Trigger/TrigAnalysis/TrigJiveXML/src/TrigSiSpacePointRetriever.cxx b/Trigger/TrigAnalysis/TrigJiveXML/src/TrigSiSpacePointRetriever.cxx
index c42287556dbb..53d943cc5f08 100755
--- a/Trigger/TrigAnalysis/TrigJiveXML/src/TrigSiSpacePointRetriever.cxx
+++ b/Trigger/TrigAnalysis/TrigJiveXML/src/TrigSiSpacePointRetriever.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrigJiveXML/TrigSiSpacePointRetriever.h"
@@ -21,13 +21,13 @@ namespace JiveXML {
     AthAlgTool(type, name, parent),
     m_typeName("TrigS3D"),
     m_pixelHelper(nullptr),
-    m_sctHelper(nullptr)
+    m_sctHelper(nullptr),
+    m_pixelSpContainerName ("TrigPixelSpacePoints"),
+    m_SCT_SpContainerName  ("TrigSCT_SpacePoints")
   {
 
     declareInterface<IDataRetriever>(this);
 
-    m_pixelSpContainerName = "TrigPixelSpacePoints";
-    m_SCT_SpContainerName  = "TrigSCT_SpacePoints";
     declareProperty("PixelSpacePoints", m_pixelSpContainerName);
     declareProperty("SCTSpacePoints"  , m_SCT_SpContainerName);
   }
-- 
GitLab


From 55e9ad8b42a64aaad8d65425407111e54bbbe6af Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 12 Sep 2020 17:23:51 -0400
Subject: [PATCH 411/422] TRT_G4_SD: Thread-safety fixes.

Clean up to remove most thread-safety annotations.
---
 .../InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx   | 2 +-
 .../InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h     | 2 +-
 .../InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx   | 2 +-
 .../InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h     | 2 +-
 InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h    | 7 +++----
 .../InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h      | 2 +-
 .../InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.cxx    | 2 +-
 .../InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h      | 2 +-
 .../InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx         | 2 +-
 InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h | 2 +-
 .../InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx     | 2 +-
 .../InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx  | 2 +-
 12 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx
index c5ca836bcee8..efb0fd16073d 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx
@@ -154,7 +154,7 @@ void TRTParametersForBarrelHits::DefineParameters() const
 
 // Called by TRTParametersForBarrelHits
 
-void TRTParametersForBarrelHits::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTOutputFile is used.
+void TRTParametersForBarrelHits::PrintParameters() const
 {
 
   if (m_verboseLevel>5) { G4cout << "######### Method TRTParametersForBarrelHits::PrintParameters" << G4endl; }
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h
index 04355929ff18..aef7f11f8458 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h
@@ -10,7 +10,7 @@
 class TRTParameters;
 class TRTProcessingOfBarrelHits;
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersForBarrelHits // Thread unsafe TRTParameters and TRTProcessingOfBarrelHits classes are used.
+class TRTParametersForBarrelHits
 {
 public:
   TRTParametersForBarrelHits(TRTProcessingOfBarrelHits*);
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx
index 080e2776426c..545d8e624d6c 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx
@@ -102,7 +102,7 @@ void TRTParametersForEndCapHits::DefineParameters() const
 
 // Called by TRTParametersForEndCapHits
 
-void TRTParametersForEndCapHits::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTOutputFile class is used.
+void TRTParametersForEndCapHits::PrintParameters() const
 {
   if (m_verboseLevel>5) { G4cout << "######### Method TRTParametersForEndCapHits::PrintParameters" << G4endl; }
 
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h
index f633561f31a5..197081207fc3 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h
@@ -10,7 +10,7 @@
 class TRTParameters;
 class TRTProcessingOfEndCapHits;
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersForEndCapHits // Thread unsafe TRTParameters and TRTProcessingOfEndCapHits classes are used.
+class TRTParametersForEndCapHits
 {
 public:
   TRTParametersForEndCapHits(TRTProcessingOfEndCapHits*);
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h
index abe80a0441e4..834e0c3a7b2f 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h
@@ -12,7 +12,7 @@
 class TRTUncompressedHit;
 class TRTOutputFile;
 
-class ATLAS_NOT_THREAD_SAFE TRTPrintingOfHits // Thread unsafe TRTOutputFile class is used.
+class TRTPrintingOfHits
 {
   public:
     TRTPrintingOfHits();
@@ -20,7 +20,7 @@ class ATLAS_NOT_THREAD_SAFE TRTPrintingOfHits // Thread unsafe TRTOutputFile cla
 
     void PrintUncompressedHit(TRTUncompressedHit*);
 
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
     bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
 
   private:
@@ -31,8 +31,7 @@ class ATLAS_NOT_THREAD_SAFE TRTPrintingOfHits // Thread unsafe TRTOutputFile cla
 
     TRTOutputFile* m_pOutputFile;
 
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
-
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif //TRT_G4_SD_TRTPrintingOfHits_hh
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h
index 1ef37d5cfa5d..41ff36832d5e 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h
@@ -12,7 +12,7 @@ class TRTSensitiveDetector;
 
 class G4Step;
 
-class ATLAS_NOT_THREAD_SAFE TRTProcessingOfBarrelHits // Thread unsafe TRTParameters and TRTSensitiveDetector classes are used.
+class TRTProcessingOfBarrelHits
 {
   friend class TRTParametersForBarrelHits;
 
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.cxx
index cb16877c6fb4..0301aab20f5e 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Class header
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h
index ea4e0ce8ec5d..76ded35f0c32 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h
@@ -12,7 +12,7 @@ class TRTSensitiveDetector;
 
 class G4Step;
 
-class ATLAS_NOT_THREAD_SAFE TRTProcessingOfEndCapHits // Thread unsafe TRTParameters and TRTSensitiveDetector classes are used.
+class TRTProcessingOfEndCapHits
 {
   friend class TRTParametersForEndCapHits;
 
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx
index 51765600f816..86bf1ad85eb5 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx
@@ -70,7 +70,7 @@ TRTSensitiveDetector::TRTSensitiveDetector(const std::string& name, const std::s
 // Called by TRTSensitiveDetector
 // Once per run
 
-void TRTSensitiveDetector::InitializeHitProcessing ATLAS_NOT_THREAD_SAFE () // Thread unsafe TRTParametersForBarrelHits, TRTParametersForEndCapHits  classes are used.
+void TRTSensitiveDetector::InitializeHitProcessing()
 {
   if(verboseLevel>4)
     {
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h
index 0f811912fb9f..f195ea1ffdee 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h
@@ -21,7 +21,7 @@ class G4HCofThisEvent;
 class G4Step;
 class G4TouchableHistory;
 
-class ATLAS_NOT_THREAD_SAFE TRTSensitiveDetector : public G4VSensitiveDetector // Thread unsafe TRTParameters, TRTProcessingOfBarrelHits, TRTProcessingOfEndCapHits classes is used.
+class TRTSensitiveDetector : public G4VSensitiveDetector
 {
  FRIEND_TEST( TRTSensitiveDetectortest, Initialize);
  FRIEND_TEST( TRTSensitiveDetectortest, ProcessHits );
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx
index d2d769c6f438..a16d587ee668 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx
@@ -18,7 +18,7 @@ TRTSensitiveDetectorTool::TRTSensitiveDetectorTool(const std::string& type, cons
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-G4VSensitiveDetector* TRTSensitiveDetectorTool::makeSD ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTSensitiveDetector class is used.
+G4VSensitiveDetector* TRTSensitiveDetectorTool::makeSD() const
 {
 
   ATH_MSG_DEBUG( "Initializing SD" );
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx b/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx
index d669dbf77d46..aaed580ea6b5 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx
@@ -32,7 +32,7 @@
 #include "G4AtlasTools/DerivedG4SensitiveDetectorTestSetting.h"
 #include "MCTruth/TrackHelper.h"
 
-ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // Thread unsafe TRTSensitiveDetector class is tested in this unit test.
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // googletest
 
 //set environment
 class GaudiEnvironment : public ::testing::Environment {
-- 
GitLab


From 628cb9ca993ceda8cab75603313d5c865fbef9bb Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 7 Sep 2020 15:09:43 -0400
Subject: [PATCH 412/422] TRT_GeoModel: Thread-safety cleanups.

Const consistency.
Remove most ATLAS_NOT_THREAD_SAFE annotations (except for registerCallback).
Remove use of static data.
---
 .../src/TRTDetectorFactory_Full.cxx           | 34 +++++++++----------
 .../src/TRTDetectorFactory_Full.h             |  6 ++--
 .../src/TRT_DetDescrDB_ParameterInterface.cxx |  2 +-
 .../src/TRT_DetDescrDB_ParameterInterface.h   |  2 +-
 .../TRT_GeoModel/src/TRT_DetectorTool.cxx     |  2 +-
 5 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx
index 3ced1b74b7ca..d48ccba8a08d 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx
@@ -2287,7 +2287,7 @@ GeoPhysVol * TRTDetectorFactory_Full::makeStraw( double& activeGasZPosition, boo
 ///////////////////////////////// makeStrawPlane /////////////////////////////////
 //
 //GeoFullPhysVol * TRTDetectorFactory_Full::makeStrawPlane(size_t w) const {
-GeoFullPhysVol * TRTDetectorFactory_Full::makeStrawPlane(size_t w, ActiveGasMixture gasMixture) const {
+GeoFullPhysVol * TRTDetectorFactory_Full::makeStrawPlane(size_t w, ActiveGasMixture gasMixture) {
   // -----------------------------------------------------------------------------------//
   //                                                                                    //
   // There are twelve straw planes; however there are only two kinds, one for sector    //
@@ -2295,29 +2295,29 @@ GeoFullPhysVol * TRTDetectorFactory_Full::makeStrawPlane(size_t w, ActiveGasMixt
   // In order to economize, we shall only create two planes.                            //
   // -----------------------------------------------------------------------------------//
 
-  static GeoFullPhysVol *type1Plane=nullptr, *type2Plane=nullptr, *type1PlaneAr=nullptr, *type2PlaneAr=nullptr, *type1PlaneKr=nullptr, *type2PlaneKr=nullptr;
   size_t nstraws=0;
 
   //A and B wheels have similar straw planes, but the C wheels are different.
   //  const size_t firstIndexOfC = 15; //hardcoded
   const size_t firstIndexOfC = 14; //hardcoded
 
-  GeoFullPhysVol *&cur_type1Plane = (gasMixture == GM_KRYPTON) ? type1PlaneKr :
-                                    (gasMixture == GM_ARGON  ) ? type1PlaneAr :
-                                                                 type1Plane;
-  GeoFullPhysVol *&cur_type2Plane = (gasMixture == GM_KRYPTON) ? type2PlaneKr :
-                                    (gasMixture == GM_ARGON  ) ? type2PlaneAr :
-                                                                 type2Plane;
+  unsigned iplane = 0;
+  if (gasMixture == GM_ARGON) {
+    iplane = 1;
+  }
+  else if (gasMixture == GM_KRYPTON) {
+    iplane = 2;
+  }
 
   if (w>=firstIndexOfC) {
-    if (cur_type2Plane!=nullptr) {
-      return cur_type2Plane;
+    if (m_type2Planes[iplane] != nullptr) {
+      return m_type2Planes[iplane];
     }
     nstraws=m_data->endcapNumberOfStrawsInStrawLayer_CWheels;
   } 
   else {
-    if (cur_type1Plane!=nullptr) {
-      return cur_type1Plane;
+    if (m_type1Planes[iplane] != nullptr) {
+      return m_type1Planes[iplane];
     }
     nstraws=m_data->endcapNumberOfStrawsInStrawLayer_AWheels;
     //Check here that (m_data->endcapNumberOfStrawsInStrawLayer_AWheels == m_data->endcapNumberOfStrawsInStrawLayer_BWheels) !!
@@ -2415,15 +2415,13 @@ GeoFullPhysVol * TRTDetectorFactory_Full::makeStrawPlane(size_t w, ActiveGasMixt
   GeoPhysVol *pWire = new GeoPhysVol(lWire);
   pStraw->add(pWire);
 
-  // Look above *type2Plane=nullptr
-  if (w>=firstIndexOfC && type2Plane!=nullptr) {
-    cur_type2Plane=pStrawPlane;
-    return cur_type2Plane;
+  if (w>=firstIndexOfC) {
+    m_type2Planes[iplane] = pStrawPlane;
   }
   else {
-    cur_type1Plane=pStrawPlane;
-    return cur_type1Plane;
+    m_type1Planes[iplane] = pStrawPlane;
   }
+  return pStrawPlane;
 
 }
 
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
index eed23fcd1885..aabed98257ae 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
@@ -29,7 +29,7 @@ class GeoFullPhysVol;
 class TRTParameterInterface;
 class InDetMaterialManager;
 
-class ATLAS_NOT_THREAD_SAFE TRTDetectorFactory_Full : public InDetDD::DetectorFactoryBase  { // Static variables are used.
+class TRTDetectorFactory_Full : public InDetDD::DetectorFactoryBase  {
 
  public:
   
@@ -88,7 +88,7 @@ class ATLAS_NOT_THREAD_SAFE TRTDetectorFactory_Full : public InDetDD::DetectorFa
   //GeoPhysVol * makeStraw( double& activeGasZPosition, bool hasLargeDeadRegion=false ) const;
   GeoPhysVol * makeStraw( double& activeGasZPosition, bool hasLargeDeadRegion=false, ActiveGasMixture gasMixture = GM_XENON) const;
   //GeoFullPhysVol  *makeStrawPlane( size_t w ) const;
-  GeoFullPhysVol  *makeStrawPlane( size_t w , ActiveGasMixture gasMixture = GM_XENON) const;
+  GeoFullPhysVol  *makeStrawPlane( size_t w , ActiveGasMixture gasMixture = GM_XENON);
 
   // private member data:
   InDetDD::TRT_DetectorManager * m_detectorManager;
@@ -105,6 +105,8 @@ class ATLAS_NOT_THREAD_SAFE TRTDetectorFactory_Full : public InDetDD::DetectorFa
   bool m_doKrypton;
   bool m_useDynamicAlignFolders;
 
+  GeoFullPhysVol* m_type1Planes[3] = {nullptr, nullptr, nullptr};
+  GeoFullPhysVol* m_type2Planes[3] = {nullptr, nullptr, nullptr};
 };
 
 #endif // TRTDetectorFactory_Full_h
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
index 02fd09c0bb6a..65baba4b4caa 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
@@ -53,7 +53,7 @@ TRT_DetDescrDB_ParameterInterface::~TRT_DetDescrDB_ParameterInterface() {
 }
 
 //_________________________________________________________________________________________
-void TRT_DetDescrDB_ParameterInterface::SetValues ATLAS_NOT_THREAD_SAFE () { // Thread unsafe AthenaComps::rdbAccessSvc const method is used.
+void TRT_DetDescrDB_ParameterInterface::SetValues() {
 
   /////////////////////////////////////////////////////////////////////////////////////////
   //                                 Initialize Services                                 //
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
index 7d294887ce1e..f28529a3f1dd 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
@@ -23,7 +23,7 @@ public:
 
    
   // Only allowed constructor
-  TRT_DetDescrDB_ParameterInterface(InDetDD::AthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe SetValues method is used.
+  TRT_DetDescrDB_ParameterInterface(InDetDD::AthenaComps * athenaComps);
 
   ~TRT_DetDescrDB_ParameterInterface();
   // delete copy c'tor
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx
index b14adda18339..ffe15af57e62 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx
@@ -68,7 +68,7 @@ TRT_DetectorTool::~TRT_DetectorTool()
 
 //////////////  Create the Detector Node corresponding to this tool //////////////
 //
-StatusCode TRT_DetectorTool::create ATLAS_NOT_THREAD_SAFE () // Thread unsafe TRTDetectorFactory_Full class is used.
+StatusCode TRT_DetectorTool::create()
 { 
 
   // Get the detector configuration.
-- 
GitLab


From 144e2d98b8de622a2c9a21ebcf9c950d606df8d8 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 7 Sep 2020 12:30:30 -0400
Subject: [PATCH 413/422] SCT_GeoModel: Thread-safety cleanup.

const consistency.
Remove most ATLAS_NOT_THREAD_SAFE annotations (except for registerCallback).
---
 .../InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h      | 2 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h             | 2 +-
 .../InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
index 7f960b3832b5..4fa0a746e0f9 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
@@ -19,7 +19,7 @@ class SCT_DataBase
   
 public:
 
-  SCT_DataBase(SCT_GeoModelAthenaComps* athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe AthenaComps::rdbAccessSvc const method is used.
+  SCT_DataBase(SCT_GeoModelAthenaComps* athenaComps);
 
   SCT_GeoModelAthenaComps* athenaComps();
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
index 4158c1406879..a509917a12ad 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
@@ -25,7 +25,7 @@ class SCT_DetectorFactory : public InDetDD::DetectorFactoryBase
  public: 
   // Constructor
   SCT_DetectorFactory(SCT_GeoModelAthenaComps * athenaComps, 
-		      const SCT_Options & options) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::DetectorFactoryBase::rdbAccessSvc() method is used.
+		      const SCT_Options & options);
 
   // Destructor
   virtual ~SCT_DetectorFactory(); 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
index 2fc7636e39f2..e1a1394147e4 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
@@ -48,7 +48,7 @@ SCT_DetectorTool::SCT_DetectorTool(const std::string& type,
 //
 
 StatusCode
-SCT_DetectorTool::create ATLAS_NOT_THREAD_SAFE () // Thread unsafe SCT_DetectorFactory constructor is used.
+SCT_DetectorTool::create()
 {
   // Get the detector configuration.
   ATH_CHECK(m_geoDbTagSvc.retrieve());
-- 
GitLab


From 897ad47427a914ecca298aa32cec6393e26f4494 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 7 Sep 2020 11:32:51 -0400
Subject: [PATCH 414/422] TRT_ReadoutGeometry: Thread-safety cleanup.

If a definition is marked as not thread-safe, the declaration should
be as well.
---
 .../TRT_ReadoutGeometry/TRT_DetectorManager.h               | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/TRT_ReadoutGeometry/TRT_DetectorManager.h b/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/TRT_ReadoutGeometry/TRT_DetectorManager.h
index 28eaa8410bc5..79b19bc58359 100755
--- a/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/TRT_ReadoutGeometry/TRT_DetectorManager.h
+++ b/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/TRT_ReadoutGeometry/TRT_DetectorManager.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -28,6 +28,8 @@
 
 #include "InDetReadoutGeometry/InDetDD_Defs.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include <map>
 #include <memory>
 #include <set>
@@ -170,7 +172,7 @@ namespace InDetDD {
 
     // Alignment stuff
     // DEPRECATED - kept for compatibilty with Lisbon CondDB
-    void addKey(const std::string & key, int level);
+    void addKey ATLAS_NOT_THREAD_SAFE (const std::string & key, int level);
     // DEPRECATED use addChannel
     void addKey(const std::string & key, int level, FrameType frame);
 
-- 
GitLab


From 178a5c4a3a568b87222710b9b6431adee9213086 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Thu, 24 Sep 2020 10:54:34 +0100
Subject: [PATCH 415/422] Fixed initialisation of GeoModelSvc

---
 Control/AthenaConfiguration/python/MainServicesConfig.py       | 3 ++-
 .../GeoModel/AtlasGeoModel/python/GeoModelConfig.py            | 2 +-
 .../OverlayConfiguration/test/OverlayMetadataConfig_test.py    | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Control/AthenaConfiguration/python/MainServicesConfig.py b/Control/AthenaConfiguration/python/MainServicesConfig.py
index 072ec1ea40fd..0b8a8eba5038 100644
--- a/Control/AthenaConfiguration/python/MainServicesConfig.py
+++ b/Control/AthenaConfiguration/python/MainServicesConfig.py
@@ -78,7 +78,8 @@ def MainServicesCfg(cfgFlags):
     cfg.addService(StoreGateSvc("HistoryStore"))
     cfg.addService(StoreGateSvc("ConditionStore"))
 
-    cfg.addService(CompFactory.GeoModelSvc(), create=True)
+    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
+    cfg.merge( GeoModelCfg(cfgFlags) )
     cfg.addService(CompFactory.DetDescrCnvSvc(), create=True)
     cfg.addService(CompFactory.CoreDumpSvc(), create=True)
 
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py
index 2da385b00cfd..b6ee4e15d397 100644
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py
@@ -22,7 +22,7 @@ def GeoModelCfg(configFlags):
     if configFlags.Detector.Simulate:
         ## Protects GeoModelSvc in the simulation from the AlignCallbacks
         gms.AlignCallbacks = False
-    result.addService(gms,primary=True)
+    result.addService(gms, primary=True, create=True)
 
 
     #Get DetDescrCnvSvc (for identifier dictionaries (identifier helpers)
diff --git a/Simulation/Overlay/OverlayConfiguration/test/OverlayMetadataConfig_test.py b/Simulation/Overlay/OverlayConfiguration/test/OverlayMetadataConfig_test.py
index 8e3740ede839..c71c2ef052e0 100755
--- a/Simulation/Overlay/OverlayConfiguration/test/OverlayMetadataConfig_test.py
+++ b/Simulation/Overlay/OverlayConfiguration/test/OverlayMetadataConfig_test.py
@@ -25,7 +25,8 @@ args = parser.parse_args()
 defaultTestFlags(ConfigFlags, args)
 overlayMetadataCheck(ConfigFlags)
 postprocessAndLockFlags(ConfigFlags, args)
-
+ConfigFlags.initAll()
+ConfigFlags.dump()
 # Construct our accumulator to run
 acc = MainServicesCfg(ConfigFlags)
 acc.merge(PoolReadCfg(ConfigFlags))
-- 
GitLab


From 532b90a8fafaf7c2ba5f347f2ac5ab9857ab5d83 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 11 Mar 2019 17:14:35 +0100
Subject: [PATCH 416/422] Unit test of TRTOverlay

The test has to create realistic RDOs and exercise as much of the TRTOverlay code as possible
by Overlaying TRT_RDO_Containers containing various TRT_RDO_Collections and TRT_RDOs.
---
 .../InDetRawAlgs/InDetOverlay/CMakeLists.txt  |  10 +
 .../InDetOverlay/test/TRTOverlay_test.cxx     | 946 ++++++++++++++++++
 2 files changed, 956 insertions(+)
 create mode 100644 InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx

diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
index ca37b502fa8e..ed109d04c803 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
@@ -6,6 +6,7 @@ atlas_subdir( InDetOverlay )
 # External dependencies:
 find_package( CLHEP )
 find_package( GTest )
+find_package( GMock )
 
 # Helper variable(s):
 set( _jobOPath
@@ -29,6 +30,15 @@ atlas_add_test( SCTOverlay_test
                 LINK_LIBRARIES AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData CxxUtils StoreGateLib SGtests GeneratorObjects InDetIdentifier InDetSimData TrkTrack IdDictParser ${GTEST_LIBRARIES}
                 ENVIRONMENT "JOBOPTSEARCHPATH=${_jobOPath}" )
 
+atlas_add_test( TRTOverlay_test
+                SOURCES src/TRTOverlay.cxx test/TRTOverlay_test.cxx
+                INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS}
+                LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests GeneratorObjects InDetIdentifier InDetSimData TrkTrack TRT_ConditionsServicesLib TRT_ElectronPidToolsLib IdDictParser ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES}
+                ENVIRONMENT "JOBOPTSEARCHPATH=${_jobOPath}" )
+
+# Needed for the plugin service to see the test components
+# defined in the test binary.
+set_target_properties( InDetOverlay_TRTOverlay_test PROPERTIES ENABLE_EXPORTS True )
 
 # Component(s) in the package:
 atlas_add_component( InDetOverlay
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx
new file mode 100644
index 000000000000..76a29520ee30
--- /dev/null
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx
@@ -0,0 +1,946 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @author John Chapman
+ * @brief Tests for TRTOverlay.
+ */
+
+#undef NDEBUG
+
+// Tested AthAlgorithm
+#include "../InDetOverlay/TRTOverlay.h"
+
+#include <vector>
+
+#include "InDetIdentifier/TRT_ID.h"
+#include "IdDictParser/IdDictParser.h"
+#include "GaudiKernel/MsgStream.h"
+
+// HepMC includes
+#include "HepMC/GenEvent.h"
+#include "HepMC/GenParticle.h"
+#include "HepMC/GenVertex.h"
+
+// CLHEP includes
+#include "CLHEP/Vector/LorentzVector.h"
+#include "CLHEP/Units/SystemOfUnits.h"
+
+#include "GeneratorObjects/McEventCollection.h"
+#include "InDetSimData/InDetSimData.h"
+#include "InDetSimData/InDetSimDataCollection.h"
+
+// Framework includes
+#include "AthenaBaseComps/AthService.h"
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/IAppMgrUI.h"
+#include "GaudiKernel/IJobOptionsSvc.h"
+#include "GaudiKernel/SmartIF.h"
+#include "GaudiKernel/SystemOfUnits.h"
+#include "GaudiKernel/PhysicalConstants.h"
+
+// Google Test
+#include "gtest/gtest.h"
+// Google Mock
+#include "gmock/gmock.h"
+
+
+namespace OverlayTesting {
+
+  // Athena Tool to emulate TRT_LocalOccupancy Tool
+  //
+  const std::string mockTRT_LocalOccupancyName = "OverlayTesting::MockTRT_LocalOccupancy/MyTestLocalOccupancy";
+
+  class MockTRT_LocalOccupancy : public extends<AthAlgTool, InDet::ITRT_LocalOccupancy> {
+  public:
+    /// constructor
+    MockTRT_LocalOccupancy(const std::string& type, const std::string& name, const IInterface* parent)
+      : base_class(type,name,parent)
+    { };
+
+    /// destructor
+    virtual ~MockTRT_LocalOccupancy() = default;
+
+    /** Return a map of the occupancy in the barrel (-1,+1) and endcaps (-2,+2) */
+    MOCK_CONST_METHOD1(getDetectorOccupancy, std::map<int, double>(const TRT_RDO_Container*) );
+
+    // Dummy methods to confirm status
+    virtual StatusCode initialize() override final {
+      ATH_MSG_INFO ("initializing MockTRT_LocalOccupancy: " << name());
+      return StatusCode::SUCCESS;
+    };
+
+    // dummy methods implementing in pure virtual interface methods (to make class non-abstract)
+    /** Return the local occupancy for the sectors crossed by a given track */
+    virtual float LocalOccupancy( const Trk::Track& ) const { return 1.0; }; // not used - dummy implementation
+    virtual float LocalOccupancy(const double, const double) const  { return 1.0; }; // not used - dummy implementation
+
+    /** Return the global occupancy of the event*/
+    virtual std::vector<float> GlobalOccupancy( ) const { std::vector<float> dummyVect{}; return dummyVect; }; // not used - dummy implementation
+  };
+
+  DECLARE_COMPONENT( MockTRT_LocalOccupancy )
+
+  // Athena Service to emulate TRT_StrawStatusSummaryTool
+  //
+  const std::string mockTRT_StrawStatusSummaryToolName = "OverlayTesting::MockTRT_StrawStatusSummaryTool/MyTestTRT_StrawStatusSummaryTool";
+  class MockTRT_StrawStatusSummaryTool : public extends<AthAlgTool, ITRT_StrawStatusSummaryTool> {
+  public:
+
+    /// constructor
+    MockTRT_StrawStatusSummaryTool(const std::string& type, const std::string& name, const IInterface* parent)
+      : base_class(type,name,parent)
+    { };
+
+    /// destructor
+    virtual ~MockTRT_StrawStatusSummaryTool() = default;
+
+    // Dummy methods to confirm status
+    virtual StatusCode initialize() override final {
+      ATH_MSG_INFO ("initializing MockTRT_StrawStatusSummaryTool: " << name());
+      return StatusCode::SUCCESS;
+    };
+
+    virtual int getStatus(const Identifier ) const { return 1; }; // not used - dummy implementation
+    virtual int getStatusPermanent(const Identifier) const { return 1; }; // not used - dummy implementation
+    MOCK_CONST_METHOD1(getStatusHT, int(const Identifier)); // This is the only method that we actually need! <--------------
+    virtual bool get_status(const Identifier) const { return false; }; // not used - dummy implementation
+    virtual bool get_statusHT(const Identifier) const { return false; }; // not used - dummy implementation
+    virtual const StrawStatusContainer* getStrawStatusHTContainer() const {return nullptr;}; // not used - dummy implementation
+
+    virtual int getStatus(const Identifier, const EventContext&  ) const { return 1; }; // not used - dummy implementation
+    virtual int getStatusPermanent(const Identifier, const EventContext& ) const { return 1; }; // not used - dummy implementation
+    virtual int getStatusHT(const Identifier, const EventContext& ) const { return 1; }; // not used - dummy implementation
+    virtual bool get_status(const Identifier, const EventContext& ) const { return false; }; // not used - dummy implementation
+    virtual bool get_statusHT(const Identifier, const EventContext& ) const { return false; }; // not used - dummy implementation
+
+  };
+
+  DECLARE_COMPONENT( MockTRT_StrawStatusSummaryTool )
+
+
+  // Gaudi Test fixture that provides a clean Gaudi environment for
+  // each individual test case
+  class GaudiFixture {
+
+  protected:
+    GaudiFixture() {
+      SetUpGaudi();
+    }
+
+    ~GaudiFixture() {
+      TearDownGaudi();
+    }
+
+    void SetUpGaudi() {
+      m_appMgr = Gaudi::createApplicationMgr();
+      ASSERT_TRUE( m_appMgr!=nullptr );
+
+      m_svcLoc = m_appMgr;
+      ASSERT_TRUE( m_svcLoc.isValid() );
+
+      m_svcMgr = m_appMgr;
+      ASSERT_TRUE( m_svcMgr.isValid() );
+
+      m_propMgr = m_appMgr;
+      ASSERT_TRUE( m_propMgr.isValid() );
+      ASSERT_TRUE( m_propMgr->setProperty( "EvtSel",         "NONE" ).isSuccess() );
+      ASSERT_TRUE( m_propMgr->setProperty( "JobOptionsType", "FILE" ).isSuccess() );
+      ASSERT_TRUE( m_propMgr->setProperty( "JobOptionsPath", "StoreGateTestCommon.txt" ).isSuccess() );
+
+      m_toolSvc = m_svcLoc->service("ToolSvc");
+      ASSERT_TRUE( m_toolSvc.isValid() );
+
+      ASSERT_TRUE( m_appMgr->configure().isSuccess() );
+      ASSERT_TRUE( m_appMgr->initialize().isSuccess() );
+
+      m_jobOptionsSvc = m_svcLoc->service("JobOptionsSvc");
+      ASSERT_TRUE( m_jobOptionsSvc.isValid() );
+    }
+
+    void TearDownGaudi() {
+      ASSERT_TRUE( m_svcMgr->finalize().isSuccess() );
+      ASSERT_TRUE( m_appMgr->finalize().isSuccess() );
+      ASSERT_TRUE( m_appMgr->terminate().isSuccess() );
+      m_svcLoc->release();
+      m_svcMgr->release();
+      Gaudi::setInstance( static_cast<IAppMgrUI*>(nullptr) );
+    }
+
+    // protected member variables for Core Gaudi components
+    IAppMgrUI*               m_appMgr = nullptr;
+    SmartIF<ISvcLocator>     m_svcLoc;
+    SmartIF<ISvcManager>     m_svcMgr;
+    SmartIF<IJobOptionsSvc>  m_jobOptionsSvc;
+    SmartIF<IToolSvc>        m_toolSvc;
+    SmartIF<IProperty>       m_propMgr;
+  };
+
+
+  class TRTOverlay_test : public ::testing::Test, public GaudiFixture {
+
+  protected:
+    virtual void SetUp() override {
+      // DetectorStore and ID Helper
+      StoreGateSvc *detStore(nullptr);
+      ASSERT_TRUE( m_svcLoc->service("DetectorStore", detStore, true).isSuccess() );
+      if (detStore) {
+        if (not detStore->contains<TRT_ID>("TRT_ID")) {
+          auto trt_id = std::make_unique<TRT_ID>();
+          IdDictParser parser;
+          parser.register_external_entity ("InnerDetector",
+                                           "IdDictInnerDetector.xml");
+          IdDictMgr& idd = parser.parse ("IdDictParser/ATLAS_IDS.xml");
+          trt_id->initialize_from_dictionary (idd);
+          ASSERT_TRUE( detStore->record (std::move (trt_id), "TRT_ID").isSuccess() );
+        }
+      }
+      ASSERT_TRUE( m_svcLoc->service("StoreGateSvc", m_sg, true).isSuccess() );
+
+      // the tested Algorithm
+      m_alg = new TRTOverlay{"TRTOverlay", m_svcLoc};
+      m_alg->addRef();
+      ASSERT_TRUE( m_alg->setProperties().isSuccess() );
+      // ordering B, A, C, D is on purpose to test for unintended alphabetic ordering
+      std::string        inputSigPropertyValue = "'StoreGateSvc+TRT_RDOs_SIG'";
+      std::string        inputBkgPropertyValue = "'StoreGateSvc+TRT_RDOs_BKG'";
+      std::string          outputPropertyValue = "'StoreGateSvc+TRT_RDOs'";
+      std::string     inputSigSDOPropertyValue = "'StoreGateSvc+TRT_SDO_Map_SIG'";
+      ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "SignalInputSDOKey",   inputSigSDOPropertyValue).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "TRT_LocalOccupancyTool", mockTRT_LocalOccupancyName).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "TRTStrawSummaryTool", mockTRT_StrawStatusSummaryToolName).isSuccess() );
+    }
+
+    virtual void TearDown() override {
+      // let the Gaudi ServiceManager finalize all services
+      ASSERT_TRUE( m_svcMgr->finalize().isSuccess() );
+      ASSERT_TRUE( m_alg->finalize().isSuccess() );
+      delete m_alg;
+    }
+
+    template<typename T>
+    T* retrieveService(const std::string& name) {
+      T* service = nullptr;
+      SmartIF<IService>& serviceSmartPointer = m_svcLoc->service(name);
+      service = dynamic_cast<T*>(serviceSmartPointer.get());
+      EXPECT_NE(nullptr, service);
+      if(!service) {
+        return nullptr;
+      }
+      EXPECT_TRUE( service->setProperties().isSuccess() );
+      EXPECT_TRUE( service->configure().isSuccess() );
+      EXPECT_TRUE( m_svcMgr->addService(service).isSuccess() );
+      // assert that finalize() gets called once per test case
+      EXPECT_CALL( *service, finalize() )
+        .Times(1)
+        .WillOnce(::testing::Return(StatusCode::SUCCESS));
+
+      return service;
+    }
+
+    template<typename T>
+    T* retrieveTool(const std::string& name) {
+      IAlgTool* toolInterface = nullptr;
+      EXPECT_TRUE( m_toolSvc->retrieveTool(name, toolInterface).isSuccess() );
+      EXPECT_NE(nullptr, toolInterface);
+
+      T* tool = dynamic_cast<T*>(toolInterface);
+      EXPECT_NE(nullptr, tool);
+      if(!tool) {
+        return nullptr;
+      }
+
+      EXPECT_TRUE( tool->setProperties().isSuccess() );
+      EXPECT_TRUE( tool->configure().isSuccess() );
+
+      // assert that finalize() gets called once per test case
+      EXPECT_CALL( *tool, finalize() )
+        .Times(1)
+        .WillOnce(::testing::Return(StatusCode::SUCCESS));
+
+      return tool;
+    }
+
+    unsigned int encodeDigit(const std::vector<unsigned int>& bits)
+    {
+      unsigned digit(0);
+      const unsigned one(1);
+      for (unsigned int bit=0; bit < bits.size(); ++bit) {
+        if (bits[bit]==1) {
+          digit += one << (31-bit);
+        }
+      }
+      return digit;
+    }
+
+    bool initMcEventCollection(std::vector<HepMC::GenParticle*>& genPartList)
+    {
+      // create dummy input McEventCollection with a name that
+      // HepMcParticleLink knows about
+      SG::WriteHandle<McEventCollection> inputTestDataHandle{"TruthEvent"};
+      inputTestDataHandle = std::make_unique<McEventCollection>();
+      // Add a dummy GenEvent
+      const int process_id1(20);
+      const int event_number1(17);
+      inputTestDataHandle->push_back(new HepMC::GenEvent(process_id1, event_number1));
+      HepMC::GenEvent& ge1 = *(inputTestDataHandle->at(0));
+      populateGenEvent(ge1,-11,11,genPartList);
+      populateGenEvent(ge1,-13,13,genPartList);
+      populateGenEvent(ge1,-11,11,genPartList);
+      populateGenEvent(ge1,-13,13,genPartList);
+      populateGenEvent(ge1,-11,11,genPartList);
+      populateGenEvent(ge1,22,22,genPartList);
+      return true;
+    }
+
+    void populateGenEvent(HepMC::GenEvent & ge, int pdgid1, int pdgid2, std::vector<HepMC::GenParticle*>& genPartList)
+    {
+      CLHEP::HepLorentzVector myPos( 0.0, 0.0, 0.0, 0.0);
+      HepMC::GenVertex *myVertex = new HepMC::GenVertex( myPos, -1 );
+      HepMC::FourVector fourMomentum1( 0.0, 0.0, 1.0, 1.0*CLHEP::TeV);
+      HepMC::GenParticle* inParticle1 = new HepMC::GenParticle(fourMomentum1, pdgid1, 2);
+      myVertex->add_particle_in(inParticle1);
+      HepMC::FourVector fourMomentum2( 0.0, 0.0, -1.0, 1.0*CLHEP::TeV);
+      HepMC::GenParticle* inParticle2 = new HepMC::GenParticle(fourMomentum2, pdgid2, 2);
+      myVertex->add_particle_in(inParticle2);
+      HepMC::FourVector fourMomentum3( 0.0, 1.0, 0.0, 1.0*CLHEP::TeV);
+      HepMC::GenParticle* inParticle3 = new HepMC::GenParticle(fourMomentum3, pdgid1, 1);
+      myVertex->add_particle_out(inParticle3);
+      genPartList.push_back(inParticle3);
+      HepMC::FourVector fourMomentum4( 0.0, -1.0, 0.0, 1.0*CLHEP::TeV);
+      HepMC::GenParticle* inParticle4 = new HepMC::GenParticle(fourMomentum4, pdgid2, 1);
+      myVertex->add_particle_out(inParticle4);
+      genPartList.push_back(inParticle4);
+      ge.add_vertex( myVertex );
+      ge.set_signal_process_vertex( myVertex );
+      ge.set_beam_particles(inParticle1,inParticle2);
+    }
+
+    void setPrivateToolPointers()
+    {
+      m_mockTRT_StrawStatusSummaryTool = dynamic_cast<OverlayTesting::MockTRT_StrawStatusSummaryTool*>(&*(m_alg->m_TRTStrawSummaryTool));
+      m_mockTRT_LocalOccupancy = dynamic_cast<OverlayTesting::MockTRT_LocalOccupancy*>(&*(m_alg->m_TRT_LocalOccupancyTool));
+    }
+    // the tested AthAlgorithm
+    TRTOverlay* m_alg{};
+
+    StoreGateSvc* m_sg{};
+    // mocked Athena components
+    OverlayTesting::MockTRT_LocalOccupancy* m_mockTRT_LocalOccupancy = nullptr;
+    OverlayTesting::MockTRT_StrawStatusSummaryTool* m_mockTRT_StrawStatusSummaryTool = nullptr;
+    const std::map<int, double> m_empty_occupancy = {{-2,0.0},{-1,0.0},{1,0.0},{2,0.0}};
+    const std::map<int, double> m_full_occupancy = {{-2,1.0},{-1,1.0},{1,1.0},{2,1.0}};
+  };   // TRTOverlay_test fixture
+
+
+  TEST_F(TRTOverlay_test, missing_inputs_alg_execute) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute(ctx).isFailure() ); //inputs don't exist
+  }
+
+  TEST_F(TRTOverlay_test, empty_containers_alg_execute) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    ASSERT_EQ( outputDataHandle->numberOfCollections(), 0 );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_empty_collections) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    IdentifierHash sigElementHash(10026);
+    IdentifierHash bkgElementHash(10026);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    ASSERT_EQ( outputDataHandle->numberOfCollections(),1 );
+    const TRT_RDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection, nullptr );
+    ASSERT_TRUE( outputCollection->empty() );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_different_empty_collections) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    IdentifierHash sigElementHash(10026);
+    IdentifierHash bkgElementHash(10025);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    ASSERT_EQ( outputDataHandle->numberOfCollections(), 2 );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_TRUE( outputCollection1->empty() );
+    const TRT_RDO_Collection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_NE( outputCollection2, nullptr );
+    ASSERT_TRUE( outputCollection2->empty() );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_collections_one_with_an_RDO) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10026);
+    const IdentifierHash bkgElementHash(10026);
+    Identifier::value_type value = 0x1612282000000000;
+    Identifier sigStrawID = Identifier(value); //Digit ID 2229569 Digit 2147483696
+    const std::vector<unsigned int> sigBits = {
+      1, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,0,0, // LT bits for leading BC
+      0, // In-time HT bit
+      0,0,0,0,0,0,0,0, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      0,0,1,1,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int sigWord = encodeDigit(sigBits);
+    const unsigned int checkWord(2147483696); //10000000000000000000000000110000
+    ASSERT_EQ( sigWord, checkWord ); // Cross-check of encodeDigit function
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    const auto sigHT=sigDigit->highLevel();
+    const auto sigTOT=sigDigit->timeOverThreshold();
+    const auto sigDriftTimeBin=sigDigit->driftTimeBin();
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    ASSERT_EQ( outputDataHandle->numberOfCollections(), 1 );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), sigHT );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), sigTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), sigDriftTimeBin );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_different_collections_one_RDO_each) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10026);
+    const Identifier::value_type sigValue = 0x1612282000000000;
+    const Identifier sigStrawID = Identifier(sigValue);
+    const std::vector<unsigned int> sigBits = {
+      1, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,0,0, // LT bits for leading BC
+      0, // In-time HT bit
+      0,0,0,0,0,0,0,0, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      0,0,1,1,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int sigWord = encodeDigit(sigBits);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    const auto sigHT=sigDigit->highLevel();
+    const auto sigTOT=sigDigit->timeOverThreshold();
+    const auto sigDriftTimeBin=sigDigit->driftTimeBin();
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    const IdentifierHash bkgElementHash(10027);
+    const Identifier::value_type bkgValue = 0x16122ce000000000;
+    const Identifier bkgStrawID = Identifier(bkgValue);
+    const std::vector<unsigned int> bkgBits = {
+      1, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,0,0, // LT bits for leading BC
+      0, // In-time HT bit
+      0,0,0,1,1,1,1,1, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      1,1,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int bkgWord = encodeDigit(bkgBits);
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(bkgElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> bkgDigit = std::make_unique<TRT_LoLumRawData>(bkgStrawID,bkgWord);
+    const auto bkgHT=bkgDigit->highLevel();
+    const auto bkgTOT=bkgDigit->timeOverThreshold();
+    const auto bkgDriftTimeBin=bkgDigit->driftTimeBin();
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), sigHT );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), sigTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), sigDriftTimeBin );
+    const TRT_RDO_Collection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_NE( outputCollection2, nullptr );
+    ASSERT_EQ( outputCollection2->size(), 1 );
+    const TRT_LoLumRawData* outputDigit2 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection2->at(0));
+    ASSERT_NE( outputDigit2, nullptr );
+    ASSERT_EQ( outputDigit2->highLevel(), bkgHT );
+    ASSERT_EQ( outputDigit2->timeOverThreshold(), bkgTOT );
+    ASSERT_EQ( outputDigit2->driftTimeBin(), bkgDriftTimeBin );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_collections_with_matching_RDOs) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10027);
+    const Identifier::value_type sigValue = 0x16122ce000000000;
+    const Identifier sigStrawID = Identifier(sigValue);
+    const std::vector<unsigned int> sigBits = {
+      1, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,0,0, // LT bits for leading BC
+      0, // In-time HT bit
+      0,0,0,1,1,1,1,1, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      1,1,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int sigWord = encodeDigit(sigBits);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    const auto sigHT=sigDigit->highLevel();
+    const auto sigTOT=sigDigit->timeOverThreshold();
+    const auto sigDriftTimeBin=sigDigit->driftTimeBin();
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> bkgDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),sigElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    std::vector<HepMC::GenParticle*> genPartList;
+    initMcEventCollection(genPartList);
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+    const HepMC::GenParticle* pGenParticle = genPartList.at(0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
+    InDetSimData::Deposit deposit( trkLink, 0.0 );
+    std::vector<InDetSimData::Deposit> depositVector(1);
+    depositVector.push_back(deposit);
+    inputSigSDODataHandle->insert(std::make_pair(sigStrawID, InDetSimData(depositVector)));
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), sigHT );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), sigTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), sigDriftTimeBin );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_collections_with_differing_RDOs_same_strawID) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10027);
+    const Identifier::value_type sigValue = 0x16122ce000000000;
+    const Identifier sigStrawID = Identifier(sigValue);
+    const std::vector<unsigned int> sigBits = {
+      1, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,1,1, // LT bits for leading BC
+      1, // In-time HT bit
+      1,1,1,1,1,1,1,1, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      1,1,1,1,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+
+    const unsigned int sigWord = encodeDigit(sigBits);
+    const std::vector<unsigned int> bkgBits = {
+      0, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,1,1,1, // LT bits for leading BC
+      1, // In-time HT bit
+      1,1,1,1,0,0,0,0, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      0,0,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int bkgWord = encodeDigit(bkgBits);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    const auto sigHT=sigDigit->highLevel();
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> bkgDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,bkgWord);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),sigElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    std::vector<unsigned int> outBits(32,0);
+    for(unsigned int i=0; i<32; ++i) {
+      outBits[i]=std::max(sigBits[i], bkgBits[i]);
+    }
+    const unsigned int outWord = encodeDigit(outBits);
+    const double outputTOT = TRT_LoLumRawData::timeOverThreshold(outWord);
+    const unsigned int outputDriftTimeBin = TRT_LoLumRawData::driftTimeBin(outWord);
+
+    std::vector<HepMC::GenParticle*> genPartList;
+    initMcEventCollection(genPartList);
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+    const HepMC::GenParticle* pGenParticle = genPartList.at(0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
+    InDetSimData::Deposit deposit( trkLink, 0.0 );
+    std::vector<InDetSimData::Deposit> depositVector(1);
+    depositVector.push_back(deposit);
+    inputSigSDODataHandle->insert(std::make_pair(sigStrawID, InDetSimData(depositVector)));
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), sigHT );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), outputTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), outputDriftTimeBin );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_collections_with_differing_LT_RDOs_same_strawID) {
+
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10027);
+    const Identifier::value_type sigValue = 0x16122ce000000000;
+    const Identifier sigStrawID = Identifier(sigValue);
+    const std::vector<unsigned int> sigBits = {
+      0, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,1,1, // LT bits for leading BC
+      0, // In-time HT bit
+      1,1,1,1,1,1,1,1, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      1,1,1,1,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int sigWord = encodeDigit(sigBits);
+    // const std::vector<unsigned int> bkgBits = {
+    //   0,0,0,0,0, // msb and unused bits - always zero
+    //   0, // leading HT bit - always zero
+    //   1,1,1,1,1,1,1,1, // LT bits for leading BC
+    //   1, // In-time HT bit
+    //   1,1,1,1,0,0,0,0, // LT bits for in-time BC
+    //   0, // trailing HT bit - always zero
+    //   0,0,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    // };
+    const std::vector<unsigned int> bkgBits = {
+      0, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,1,1,1, // LT bits for leading BC
+      0, // In-time HT bit
+      1,1,1,1,0,0,0,0, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      0,0,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int bkgWord = encodeDigit(bkgBits);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    const auto sigHT=sigDigit->highLevel();
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> bkgDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,bkgWord);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),sigElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    std::vector<unsigned int> outBits(32,0);
+    for(unsigned int i=0; i<32; ++i) {
+      outBits[i]=std::max(sigBits[i], bkgBits[i]);
+    }
+    const unsigned int outWord = encodeDigit(outBits);
+    const double outputTOT = TRT_LoLumRawData::timeOverThreshold(outWord);
+    const unsigned int outputDriftTimeBin = TRT_LoLumRawData::driftTimeBin(outWord);
+
+    std::vector<HepMC::GenParticle*> genPartList;
+    initMcEventCollection(genPartList);
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+    const HepMC::GenParticle* pGenParticle = genPartList.at(0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
+    ASSERT_EQ(trkLink.cptr()->pdg_id(), -11); // Sanity check to confirm that we are linking to a positron as expected
+    InDetSimData::Deposit deposit( trkLink, 0.0 );
+    std::vector<InDetSimData::Deposit> depositVector(1);
+    depositVector.push_back(deposit);
+    inputSigSDODataHandle->insert(std::make_pair(sigStrawID, InDetSimData(depositVector)));
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_StrawStatusSummaryTool, getStatusHT(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(TRTCond::StrawStatus::Good));
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), sigHT );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), outputTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), outputDriftTimeBin );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_collections_with_differing_LT_RDOs_same_strawID_ForceHTbit) {
+
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10027);
+    const Identifier::value_type sigValue = 0x16122ce000000000;
+    const Identifier sigStrawID = Identifier(sigValue);
+    const std::vector<unsigned int> sigBits = {
+      0, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,1,1, // LT bits for leading BC
+      0, // In-time HT bit
+      1,1,1,1,1,1,1,1, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      1,1,1,1,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int sigWord = encodeDigit(sigBits);
+
+    const std::vector<unsigned int> bkgBits = {
+      0, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,1,1,1, // LT bits for leading BC
+      0, // In-time HT bit
+      1,1,1,1,0,0,0,0, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      0,0,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int bkgWord = encodeDigit(bkgBits);
+
+    std::vector<unsigned int> outBits(32,0);
+    for(unsigned int i=0; i<32; ++i) {
+      outBits[i]=std::max(sigBits[i], bkgBits[i]);
+    }
+    outBits[17]=1;    // force in-time HT bit to be true
+
+    const unsigned int outWord = encodeDigit(outBits);
+    const double outputTOT = TRT_LoLumRawData::timeOverThreshold(outWord);
+    const unsigned int outputDriftTimeBin = TRT_LoLumRawData::driftTimeBin(outWord);
+
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> bkgDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,bkgWord);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),sigElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    std::vector<HepMC::GenParticle*> genPartList;
+    initMcEventCollection(genPartList);
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+    const HepMC::GenParticle* pGenParticle = genPartList.at(0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
+    ASSERT_EQ(trkLink.cptr()->pdg_id(), -11); // Sanity check to confirm that we are linking to a positron as expected
+    InDetSimData::Deposit deposit( trkLink, 0.0 );
+    std::vector<InDetSimData::Deposit> depositVector(1);
+    depositVector.push_back(deposit);
+    inputSigSDODataHandle->insert(std::make_pair(sigStrawID, InDetSimData(depositVector)));
+
+    // Override Occupancy correction, so that HT bit will always be set
+    ASSERT_TRUE( m_alg->setProperty( "TRT_HT_OccupancyCorrectionBarrel", 1.0).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "TRT_HT_OccupancyCorrectionEndcap", 1.0).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_StrawStatusSummaryTool, getStatusHT(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(TRTCond::StrawStatus::Good));
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), true );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), outputTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), outputDriftTimeBin );
+  }
+
+} // <-- namespace OverlayTesting
+
+
+int main(int argc, char *argv[])
+{
+  ::testing::InitGoogleTest( &argc, argv );
+
+  //return RUN_ALL_TESTS();
+  // if the above gets stuck forever while trying to finalize Boost stuff
+  // inside SGTools, try to use the following:
+  // skips proper finalization:
+  std::quick_exit( RUN_ALL_TESTS() );
+}
-- 
GitLab


From 360ad4aeca5ee45ed6be2cfe9eb601410823d832 Mon Sep 17 00:00:00 2001
From: Alaettin Serhan Mete <alaettin.serhan.mete@cern.ch>
Date: Thu, 24 Sep 2020 15:47:00 +0000
Subject: [PATCH 417/422] PyUtils: Update categorization mapping in
 checkxAOD.py

---
 Tools/PyUtils/bin/checkxAOD.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Tools/PyUtils/bin/checkxAOD.py b/Tools/PyUtils/bin/checkxAOD.py
index c694d0a0bcd5..39a718b68918 100755
--- a/Tools/PyUtils/bin/checkxAOD.py
+++ b/Tools/PyUtils/bin/checkxAOD.py
@@ -36,7 +36,6 @@ if __name__ == "__main__":
        help = "Output CSV file name, to use with spreadsheets" )
     ( options, args ) = parser.parse_args()
 
-    # Set up categorization matching strings:
     # Set up categorization matching strings:
     categoryStrings = {
         "MetaData" : ["^DataHeader", "(.*)_mems$", "(.*)_timings$", "^Token$", "^RawInfoSummaryForTag$", "^index_ref$"],
@@ -49,10 +48,11 @@ if __name__ == "__main__":
         "Muon"     : ["^Muon", "^TileMuObj", "^MS", "^SlowMuons", "^Staus", "(.*)MuonTrackParticles$", "MUCTPI_RDO", "^RPC", "^TGC", "^MDT", "^CSC", ".*MuonMeasurements$", "^ExtrapolatedMuonTracks", "^CombinedMuonTracks", "^NCB_MuonSegments"],
         "BTag"     : ["^BTag"],
         "InDet"    : ["^InDet", "^PrimaryVertices", "^ComTime_TRT", "^Pixel", "^TRT", "^SCT", "^BCM", "^CTP", "^Tracks", "^ResolvedForwardTracks", "^SplitClusterAmbiguityMap"],
-        "Jet"      : ["^CamKt", "^AntiKt", "^Jet","^LCOriginTopoClusters","^EMOriginTopoClusters"],
+        "Jet"      : ["^CamKt", "^AntiKt", "^Jet(?!.*ParticleFlowObjects$)","^LCOriginTopoClusters","^EMOriginTopoClusters"],
         "CaloTopo" : ["CaloCalTopoCluster"],
         "Calo"     : ["^LAr", "^AllCalo", "^AODCellContainer", "^MBTSContainer", "^CaloCompactCellContainer", "^E4prContainer", "^TileCellVec", "^TileDigits"],
-        "Truth"    : ["^Truth", "Truth$", "TruthMap$", "TruthCollection$", "^PRD_MultiTruth", "TracksTruth$", ".*TrackTruth$", "TrackTruthCollection"]
+        "Truth"    : ["^Truth", "Truth$", "TruthMap$", "TruthCollection$", "^PRD_MultiTruth", "TracksTruth$", ".*TrackTruth$", "TrackTruthCollection"],
+        "AFP"      : ["^AFP"]
         }
     
     fileNames = []
-- 
GitLab


From 7e6a6983d09553435b7c307e55dedbfdb2d6a6c0 Mon Sep 17 00:00:00 2001
From: Nicolas Koehler <nicolas.koehler@cern.ch>
Date: Thu, 24 Sep 2020 15:49:05 +0000
Subject: [PATCH 418/422] Remove failure from dump-geo execute

---
 .../DumpGeo/DumpGeo/DumpGeo.h                   |  6 ++----
 .../DumpGeo/share/dump-geo.py                   |  4 ++++
 .../GeoModelStandalone/DumpGeo/src/DumpGeo.cxx  | 17 +----------------
 3 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/DumpGeo/DumpGeo.h b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/DumpGeo/DumpGeo.h
index 076191d88700..85e8e6d99b0c 100755
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/DumpGeo/DumpGeo.h
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/DumpGeo/DumpGeo.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /////////////////////////////////////////////////////////////
@@ -13,7 +13,6 @@
 //                                                         //
 /////////////////////////////////////////////////////////////
 
-
 #ifndef DumpGeo_DumpGeo
 #define DumpGeo_DumpGeo
 
@@ -30,11 +29,10 @@ class DumpGeo: public AthAlgorithm,
 {
  public:
   DumpGeo(const std::string& name, ISvcLocator* pSvcLocator);
-  ~DumpGeo();
+  ~DumpGeo()=default;
 
   StatusCode initialize();
   StatusCode execute();
-  StatusCode finalize();
 
   void handle(const Incident& inc);
 
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py
index e5aa8a114cd8..448174309dfb 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py
@@ -354,6 +354,10 @@ if (vp1InputFiles != []):
 else:
     vp1Extrapolator = False
 
+# do not need to run execute since layout is dumped during initialize
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+athenaCommonFlags.EvtMax = 0
+
 #watch LAr HV:
 if ( vp1LarHvData ):
     from time import time
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/src/DumpGeo.cxx b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/src/DumpGeo.cxx
index a87a10bfabbd..75e3e5cf3850 100755
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/src/DumpGeo.cxx
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/src/DumpGeo.cxx
@@ -1,8 +1,7 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-
 #include "DumpGeo/DumpGeo.h"
 
 #include "GeoExporter/GeoExporter.h"
@@ -13,7 +12,6 @@
 #include <iomanip>
 #include <cstdlib> //For setenv
 
-
 //____________________________________________________________________
 DumpGeo::DumpGeo(const std::string& name, ISvcLocator* svcLocator):
   AthAlgorithm(name, svcLocator),
@@ -24,11 +22,6 @@ DumpGeo::DumpGeo(const std::string& name, ISvcLocator* svcLocator):
   ::setenv("LCGPATCH_COINMULTISELECT","1",1);
 }
 
-//____________________________________________________________________
-DumpGeo::~DumpGeo()
-{
-}
-
 //____________________________________________________________________
 StatusCode DumpGeo::initialize()
 {
@@ -60,17 +53,9 @@ StatusCode DumpGeo::initialize()
 StatusCode DumpGeo::execute()
 {
   msg(MSG::DEBUG) <<" in execute() " << endmsg;
-  return StatusCode::FAILURE;
-}
-
-//____________________________________________________________________
-StatusCode DumpGeo::finalize()
-{
-  msg(MSG::INFO) <<" in finalize() " << endmsg;
   return StatusCode::SUCCESS;
 }
 
-
 //____________________________________________________________________
 void DumpGeo::handle(const Incident& inc)
 {
-- 
GitLab


From 92dacc22b1986358828d0f5ab82a7d489e2500c8 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch>
Date: Thu, 24 Sep 2020 15:54:35 +0000
Subject: [PATCH 419/422] Migration of GeneratorObjectsTPCnv to HePMC3, part II

---
 .../McEventCollectionCnv_p4.h                 |  10 +
 .../src/McEventCollectionCnv_p4.cxx           | 240 +++++++++++++++++-
 .../src/McEventCollectionCnv_utils.h          |  27 ++
 3 files changed, 273 insertions(+), 4 deletions(-)

diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h
index 19ba716047d0..3615633b6724 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h
@@ -129,17 +129,27 @@ class McEventCollectionCnv_p4 : public T_AthenaPoolTPCnvBase<
    *  vertex is added to the persistent is added to the persistent
    *  @c GenEvent.
    */
+#ifdef HEPMC3
+  void writeGenVertex( HepMC::ConstGenVertexPtr vtx,
+                       McEventCollection_p4& persEvt ) const;
+#else
   void writeGenVertex( const HepMC::GenVertex& vtx,
                        McEventCollection_p4& persEvt ) const;
+#endif
 
   /** @brief Method to write a persistent @c GenParticle object
    *  It returns the index of the persistent @c GenParticle into the
    *  collection of persistent of @c GenParticles from the
    *  persistent @c GenEvent
    */
+#ifdef HEPMC3   
+  int writeGenParticle( HepMC::ConstGenParticlePtr p,
+                        McEventCollection_p4& persEvt ) const;
+#else
   int writeGenParticle( const HepMC::GenParticle& p,
                         McEventCollection_p4& persEvt ) const;
 
+#endif
   ///////////////////////////////////////////////////////////////////
   // Protected data:
   ///////////////////////////////////////////////////////////////////
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx
index db580216dada..38b204417a7e 100755
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx
@@ -107,6 +107,37 @@ void McEventCollectionCnv_p4::persToTrans( const McEventCollection_p4* persObj,
         {
           genEvt        =  poolOfEvents.nextElementPtr();
         }
+#ifdef HEPMC3
+      genEvt->add_attribute("signal_process_id",std::make_shared<HepMC3::IntAttribute>(persEvt.m_signalProcessId));
+      genEvt->set_event_number(persEvt.m_eventNbr);
+      genEvt->add_attribute("event_scale",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_eventScale));
+      genEvt->add_attribute("alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQCD));
+      genEvt->add_attribute("alphaQED",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQED));
+
+      genEvt->add_attribute("signal_process_vertex",std::make_shared<HepMC3::IntAttribute>(0));
+      genEvt->weights()= persEvt.m_weights;
+      genEvt->add_attribute("random_states",std::make_shared<HepMC3::VectorLongIntAttribute>(persEvt.m_randomStates));
+      //restore weight names from the dedicated svc (which was keeping them in metadata for efficiency)
+      if(genEvt->run_info()) genEvt->run_info()->set_weight_names(name_index_map_to_names(m_hepMCWeightSvc->weightNames()));
+      else msg << MSG::WARNING << "No run info!" << endmsg;
+
+
+       // pdfinfo restore
+      if (!persEvt.m_pdfinfo.empty())
+        {
+          const std::vector<double>& pdf = persEvt.m_pdfinfo;
+              HepMC3::GenPdfInfoPtr pi;
+              pi->set(
+              static_cast<int>(pdf[6]), // id1
+              static_cast<int>(pdf[5]), // id2
+              pdf[4],                   // x1
+              pdf[3],                   // x2
+              pdf[2],                   // scalePDF
+              pdf[1],                   // pdf1
+              pdf[0] );                 // pdf2
+              genEvt->set_pdf_info(pi);
+        }
+#else
       genEvt->m_signal_process_id     = persEvt.m_signalProcessId;
       genEvt->m_event_number          = persEvt.m_eventNbr;
       genEvt->m_event_scale           = persEvt.m_eventScale;
@@ -134,6 +165,7 @@ void McEventCollectionCnv_p4::persToTrans( const McEventCollection_p4* persObj,
               pdf[1],                   // pdf1
               pdf[0] );                 // pdf2
         }
+#endif
 
       transObj->push_back( genEvt );
 
@@ -205,6 +237,56 @@ void McEventCollectionCnv_p4::transToPers( const McEventCollection* transObj,
         itr != itrEnd;
         ++itr )
     {
+#ifdef HEPMC3 
+      const unsigned int nPersVtx   = persObj->m_genVertices.size();
+      const unsigned int nPersParts = persObj->m_genParticles.size();
+      const HepMC::GenEvent* genEvt = *itr;
+      //save the weight names to metadata via the HepMCWeightSvc
+      m_hepMCWeightSvc->setWeightNames(  names_to_name_index_map(genEvt->weight_names()) ).ignore(); 
+      auto A_signal_process_id=genEvt->attribute<HepMC3::IntAttribute>("signal_process_id");    
+      auto A_event_scale=genEvt->attribute<HepMC3::DoubleAttribute>("event_scale");    
+      auto A_alphaQCD=genEvt->attribute<HepMC3::DoubleAttribute>("alphaQCD");    
+      auto A_alphaQED=genEvt->attribute<HepMC3::DoubleAttribute>("alphaQED");    
+      auto A_signal_process_vertex=genEvt->attribute<HepMC3::IntAttribute>("signal_process_vertex");    
+      auto A_random_states=genEvt->attribute<HepMC3::VectorLongIntAttribute>("random_states");    
+
+      persObj->m_genEvents.
+      push_back( GenEvent_p4( A_signal_process_id?(A_signal_process_id->value()):0,
+                                genEvt->event_number(),
+                                A_event_scale?(A_event_scale->value()):0.0, 
+                                A_alphaQCD?(A_alphaQCD->value()):0.0, 
+                                A_alphaQED?(A_alphaQED->value()):0.0, 
+                                A_signal_process_vertex?(A_signal_process_vertex->value()):0, 
+                                genEvt->weights(), 
+                                std::vector<double>(),//No idea why it is empty 
+                                A_random_states?(A_random_states->value()):std::vector<long>(), 
+                                nPersVtx,
+                                nPersVtx + genEvt->vertices().size(),
+                                nPersParts,
+                                nPersParts + genEvt->particles().size() ) );
+
+      //PdfInfo encoding
+   if (genEvt->pdf_info())
+        {
+          auto pi=genEvt->pdf_info();
+          GenEvent_p4& persEvt = persObj->m_genEvents.back();
+          std::vector<double>& pdfinfo = persEvt.m_pdfinfo;
+          pdfinfo.resize(7);
+          pdfinfo[6] = static_cast<double>(pi->parton_id[0]);
+          pdfinfo[5] = static_cast<double>(pi->parton_id[1]);
+          pdfinfo[4] = pi->x[0];
+          pdfinfo[3] = pi->x[1];
+          pdfinfo[2] = pi->scale;
+          pdfinfo[1] = pi->xf[0];
+          pdfinfo[0] = pi->xf[1];
+        }
+      // create vertices
+      for ( auto v: genEvt->vertices())
+        {
+          writeGenVertex( v, *persObj );
+        }
+
+#else
       const unsigned int nPersVtx   = persObj->m_genVertices.size();
       const unsigned int nPersParts = persObj->m_genParticles.size();
       const HepMC::GenEvent* genEvt = *itr;
@@ -250,6 +332,7 @@ void McEventCollectionCnv_p4::transToPers( const McEventCollection* transObj,
         {
           writeGenVertex( **i, *persObj );
         }
+#endif
 
     } //> end loop over GenEvents
 
@@ -265,6 +348,24 @@ McEventCollectionCnv_p4::createGenVertex( const McEventCollection_p4& persEvt,
                                           ParticlesMap_t& partToEndVtx,
                                           HepMC::DataPool* datapools ) const
 {
+#ifdef HEPMC3
+  DataPool<HepMC::GenVertexPtr>& poolOfVertices = datapools->vtx;
+  HepMC::GenVertexPtr vtx(0);
+  if(m_isPileup)
+    {
+      vtx=HepMC::newGenVertexPtr();
+    }
+  else
+    {
+      vtx = *(poolOfVertices.nextElementPtr());
+    }
+  vtx->set_position(HepMC::FourVector( persVtx.m_x , persVtx.m_y , persVtx.m_z ,persVtx.m_t ));
+  //AV ID cannot be assigned in HepMC3. And its meaning in HepMC2 is not clear.
+  // vtx->m_id      = persVtx.m_id;
+  vtx->add_attribute("weights",std::make_shared<HepMC3::VectorFloatAttribute>(persVtx.m_weights));
+  vtx->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persVtx.m_barcode));
+
+#else
   DataPool<HepMC::GenVertex>& poolOfVertices = datapools->vtx;
   HepMC::GenVertexPtr vtx(0);
   if(m_isPileup)
@@ -287,6 +388,7 @@ McEventCollectionCnv_p4::createGenVertex( const McEventCollection_p4& persEvt,
                                     persVtx.m_weights.end() );
   vtx->m_event   = 0;
   vtx->m_barcode = persVtx.m_barcode;
+#endif
 
   // handle the in-going (orphans) particles
   const unsigned int nPartsIn = persVtx.m_particlesIn.size();
@@ -314,6 +416,60 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart,
                                             ParticlesMap_t& partToEndVtx,
                                             HepMC::DataPool* datapools ) const
 {
+#ifdef HEPMC3
+  DataPool<HepMC::GenParticlePtr>& poolOfParticles = datapools->part;
+  HepMC::GenParticlePtr p(0);
+  if (m_isPileup)
+    {
+      p = HepMC::newGenParticlePtr();
+    }
+  else
+    {
+      p    = *(poolOfParticles.nextElementPtr());
+    }
+  p->set_pdg_id(              persPart.m_pdgId);
+  p->set_status(              persPart.m_status);
+  p->add_attribute("phi",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_phiPolarization));
+  p->add_attribute("theta",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_thetaPolarization));
+  p->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persPart.m_barcode));  
+
+  // Note: do the E calculation in extended (long double) precision.
+  // That happens implicitly on x86 with optimization on; saying it
+  // explicitly ensures that we get the same results with and without
+  // optimization.  (If this is a performance issue for platforms
+  // other than x86, one could change to double for those platforms.)
+  if ( 0 == persPart.m_recoMethod )
+    {
+      double temp_e = std::sqrt( (long double)(persPart.m_px)*persPart.m_px +
+                            (long double)(persPart.m_py)*persPart.m_py +
+                            (long double)(persPart.m_pz)*persPart.m_pz +
+                            (long double)(persPart.m_m) *persPart.m_m );
+      p->set_momentum( HepMC::FourVector(persPart.m_px,persPart.m_px,persPart.m_px,temp_e));
+    }
+  else
+    {
+      const int signM2 = ( persPart.m_m >= 0. ? 1 : -1 );
+      const double persPart_ene =
+        std::sqrt( std::abs((long double)(persPart.m_px)*persPart.m_px +
+                  (long double)(persPart.m_py)*persPart.m_py +
+                  (long double)(persPart.m_pz)*persPart.m_pz +
+                  signM2* (long double)(persPart.m_m)* persPart.m_m));
+      const int signEne = ( persPart.m_recoMethod == 1 ? 1 : -1 );
+     p->set_momentum( HepMC::FourVector( persPart.m_px,
+                         persPart.m_py,
+                         persPart.m_pz,
+                         signEne * persPart_ene ));
+    }
+
+  // setup flow
+  std::vector<int> flows;
+  const unsigned int nFlow = persPart.m_flow.size();
+  for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
+  flows.push_back(persPart.m_flow[iFlow].second );
+  }
+  //We construct it here as vector w/o gaps.
+  p->add_attribute("flows", std::make_shared<HepMC3::VectorIntAttribute>(flows));
+#else
   DataPool<HepMC::GenParticle>& poolOfParticles = datapools->part;
   HepMC::GenParticlePtr p(0);
   if (m_isPileup)
@@ -339,10 +495,6 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart,
   // other than x86, one could change to double for those platforms.)
   if ( 0 == persPart.m_recoMethod )
     {
-      //    p->m_momentum.setVectM(Hep4Vector( persPart.m_px,
-      //					persPart.m_py,
-      //					persPart.m_pz ),
-      //                            persPart.m_m );
 
       p->m_momentum.setPx( persPart.m_px);
       p->m_momentum.setPy( persPart.m_py);
@@ -375,6 +527,7 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart,
       p->m_flow.set_icode( persPart.m_flow[iFlow].first,
                            persPart.m_flow[iFlow].second );
     }
+#endif
 
   if ( persPart.m_endVtx != 0 )
     {
@@ -384,6 +537,42 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart,
   return p;
 }
 
+#ifdef HEPMC3
+void McEventCollectionCnv_p4::writeGenVertex( HepMC::ConstGenVertexPtr vtx,
+                                              McEventCollection_p4& persEvt ) const
+{                                              
+  const HepMC::FourVector& position = vtx->position();
+  auto A_weights=vtx->attribute<HepMC3::VectorDoubleAttribute>("weights"); 
+  auto A_barcode=vtx->attribute<HepMC3::IntAttribute>("barcode"); 
+  std::vector<double> weights=A_weights?(A_weights->value()):std::vector<double>();
+  persEvt.m_genVertices.push_back(
+                                  GenVertex_p4( position.x(),
+                                                position.y(),
+                                                position.z(),
+                                                position.t(),
+                                                vtx->id(),
+                                                weights.begin(),
+                                                weights.end(),
+                                                A_barcode?(A_barcode->value()):vtx->id()
+                                                ) );
+  GenVertex_p4& persVtx = persEvt.m_genVertices.back();
+  // we write only the orphans in-coming particles
+  persVtx.m_particlesIn.reserve(vtx->particles_in().size());
+  for ( auto p: vtx->particles_in())
+    {
+      if ( !p->production_vertex() )
+        {
+          persVtx.m_particlesIn.push_back( writeGenParticle(p, persEvt ));
+        }
+    }
+  persVtx.m_particlesOut.reserve(vtx->particles_out().size());
+  for ( auto p: vtx->particles_out())
+    {
+      persVtx.m_particlesOut.push_back( writeGenParticle(p, persEvt ) );
+    }
+  return;
+}
+#else
 void McEventCollectionCnv_p4::writeGenVertex( const HepMC::GenVertex& vtx,
                                               McEventCollection_p4& persEvt ) const
 {
@@ -423,7 +612,49 @@ void McEventCollectionCnv_p4::writeGenVertex( const HepMC::GenVertex& vtx,
 
   return;
 }
+#endif
 
+#ifdef HEPMC3
+int McEventCollectionCnv_p4::writeGenParticle( HepMC::ConstGenParticlePtr p,
+                                               McEventCollection_p4& persEvt ) const
+{                                               
+  const HepMC::FourVector& mom = p->momentum();
+  const double ene = mom.e();
+  const double m2  = mom.m2();
+
+  // Definitions of Bool isTimeLilike, isSpacelike and isLightlike according to HepLorentzVector definition
+  const bool useP2M2 = !(m2 > 0) &&   // !isTimelike
+    (m2 < 0) &&   //  isSpacelike
+    !(std::abs(m2) < 2.0*DBL_EPSILON*ene*ene); // !isLightlike
+
+    const short recoMethod = ( !useP2M2 ? 0: ( ene >= 0. ? 1 : 2 ) );
+    auto A_theta=p->attribute<HepMC3::DoubleAttribute>("theta"); 
+    auto A_phi=p->attribute<HepMC3::DoubleAttribute>("phi"); 
+    auto A_flows=p->attribute<HepMC3::VectorIntAttribute>("flows"); 
+    
+    
+    persEvt.m_genParticles.push_back( GenParticle_p4( mom.px(),
+                               mom.py(),
+                               mom.pz(),
+                               mom.m(),
+                               p->pdg_id(),
+                               p->status(),
+                               A_flows?(A_flows->value().size()):0,
+                               A_theta?(A_theta->value()):0.0,
+                               A_phi?(A_phi->value()):0.0,
+                               p->production_vertex()?(HepMC::barcode(p->production_vertex())):0,
+                               p->end_vertex()?(HepMC::barcode(p->end_vertex())):0,
+                               HepMC::barcode(p),
+                               recoMethod ) );
+  
+  std::vector< std::pair<int,int> > flow_hepmc2;
+  if(A_flows) flow_hepmc2=vector_to_vector_int_int(A_flows->value());
+  persEvt.m_genParticles.back().m_flow.assign( flow_hepmc2.begin(),flow_hepmc2.end() );
+  // we return the index of the particle in the big vector of particles
+  // (contained by the persistent GenEvent)
+  return (persEvt.m_genParticles.size() - 1);
+}                                               
+#else
 int McEventCollectionCnv_p4::writeGenParticle( const HepMC::GenParticle& p,
                                                McEventCollection_p4& persEvt ) const
 {
@@ -467,6 +698,7 @@ int McEventCollectionCnv_p4::writeGenParticle( const HepMC::GenParticle& p,
   // (contained by the persistent GenEvent)
   return (persEvt.m_genParticles.size() - 1);
 }
+#endif
 
 void McEventCollectionCnv_p4::setPileup()
 {
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
index 30b519f17a39..46b86158da55 100644
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
@@ -20,4 +20,31 @@ namespace {
 
     return std::make_pair( nParts, nVerts );
   }
+#ifdef HEPMC3
+std::vector<std::string>   name_index_map_to_names(const std::map<std::string, unsigned long int> &input)
+{
+std::vector<std::string> result;
+std::vector<std::pair<std::string, unsigned long int> > sorted; 
+for (auto el: input) sorted.push_back(el);
+std::sort(sorted.begin(), sorted.end(),[](std::pair<std::string, unsigned long int> a, std::pair<std::string, unsigned long int> b) {return a.second > b.second; }); 
+for (auto a: sorted) result.push_back(a.first);
+return result;
+}
+
+std::map<std::string, unsigned long int> names_to_name_index_map(const  std::vector<std::string>  &input )
+{
+std::map<std::string, unsigned long int> result;
+unsigned long int i=0;
+for (auto a: input) {result[a]=i; i++;}
+return result;
+}
+
+std::vector<std::pair<int,int> > vector_to_vector_int_int(const  std::vector<int>  &input )
+{
+std::vector<std::pair<int,int> > result;
+unsigned long int i=0;
+for (auto a: input) {result.push_back(std::pair<int,int>(a,i)); i++;}
+return result;
+}
+#endif
 }
-- 
GitLab


From fa15a6a1e950687984105516bf6906c13d55e361 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch>
Date: Thu, 24 Sep 2020 15:54:42 +0000
Subject: [PATCH 420/422] Migration of GeneratorObjectsTPCnv to HePMC3, part
 III

---
 .../McEventCollectionCnv_p5.h                 |  10 +
 .../GeneratorObjectsTPCnv/src/HepMcDataPool.h |  45 +++
 .../src/McEventCollectionCnv_p5.cxx           | 349 ++++++++++++++++++
 .../src/McEventCollectionCnv_utils.h          |  27 ++
 4 files changed, 431 insertions(+)

diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h
index c5649ca6fd44..59701c3de5f4 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h
@@ -130,16 +130,26 @@ class McEventCollectionCnv_p5 : public T_AthenaPoolTPCnvBase<
    *  vertex is added to the persistent is added to the persistent
    *  @c GenEvent.
    */
+#ifdef HEPMC3
+  void writeGenVertex( HepMC::ConstGenVertexPtr vtx,
+                       McEventCollection_p5& persEvt ) const;
+#else
   void writeGenVertex( const HepMC::GenVertex& vtx,
                        McEventCollection_p5& persEvt ) const;
 
+#endif
   /** @brief Method to write a persistent @c GenParticle object
    *  It returns the index of the persistent @c GenParticle into the
    *  collection of persistent of @c GenParticles from the
    *  persistent @c GenEvent
    */
+#ifdef HEPMC3
+  int writeGenParticle( HepMC::ConstGenParticlePtr p,
+                        McEventCollection_p5& persEvt ) const;
+#else
   int writeGenParticle( const HepMC::GenParticle& p,
                         McEventCollection_p5& persEvt ) const;
+#endif
 
   ///////////////////////////////////////////////////////////////////
   // Protected data:
diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcDataPool.h b/Generators/GeneratorObjectsTPCnv/src/HepMcDataPool.h
index be051d1fbb40..3bc40ae512b3 100755
--- a/Generators/GeneratorObjectsTPCnv/src/HepMcDataPool.h
+++ b/Generators/GeneratorObjectsTPCnv/src/HepMcDataPool.h
@@ -35,6 +35,33 @@
 // various DataPool<Xyz>.
 namespace SG {
 
+#ifdef HEPMC3
+
+
+  template<>
+  inline void
+  ArenaAllocatorBase::destroy_fcn<HepMC::GenParticlePtr>(ArenaAllocatorBase::pointer p)
+  {
+  //GenParticlePtr is smart pointer
+  }
+
+  template<>
+  inline void
+  ArenaAllocatorBase::destroy_fcn<HepMC::GenVertexPtr>(ArenaAllocatorBase::pointer p)
+  {
+  //GenVertexPtr is smart pointer
+  }
+
+  template<>
+  inline void
+  ArenaAllocatorBase::destroy_fcn<HepMC::GenEvent>(ArenaAllocatorBase::pointer p)
+  {
+    HepMC::GenEvent* evt = reinterpret_cast<HepMC::GenEvent*>(p);
+    evt->~GenEvent();
+  }
+
+#else
+
   template<>
   inline void
   ArenaAllocatorBase::destroy_fcn<HepMC::GenParticle>(ArenaAllocatorBase::pointer p)
@@ -66,9 +93,26 @@ namespace SG {
     delete evt->m_pdf_info; evt->m_pdf_info = 0;
     evt->~GenEvent();
   }
+#endif  
 } // end namespace SG
 
 namespace HepMC {
+ #ifdef HEPMC3
+  struct DataPool {
+
+    typedef ::DataPool<HepMC::GenEvent> GenEvtPool_t;
+    /// an arena of @c HepMC::GenEvent for efficient object instantiation
+    GenEvtPool_t evt;
+
+    typedef ::DataPool<HepMC::GenVertexPtr> GenVtxPool_t;
+    /// an arena of @c HepMC::GenVertex for efficient object instantiation
+    GenVtxPool_t vtx;
+
+    typedef ::DataPool<HepMC::GenParticlePtr> GenPartPool_t;
+    /// an arena of @c HepMC::GenParticle for efficient object instantiation
+    GenPartPool_t part;
+  };
+#else
   struct DataPool {
 
     typedef ::DataPool<HepMC::GenEvent> GenEvtPool_t;
@@ -84,6 +128,7 @@ namespace HepMC {
     GenPartPool_t part;
   };
 
+#endif
 } // end namespace HepMC
 
 #endif // GENERATOROBJECTSATHENAPOOL_HEPMCDATAPOOL_H
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx
index a769cb98d3f4..bdf12ec5494c 100755
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx
@@ -93,6 +93,119 @@ void McEventCollectionCnv_p5::persToTrans( const McEventCollection_p5* persObj,
     } else {
       genEvt        =  poolOfEvents.nextElementPtr();
     }
+#ifdef HEPMC3
+    genEvt->add_attribute("signal_process_id",std::make_shared<HepMC3::IntAttribute>(persEvt.m_signalProcessId));
+    genEvt->set_event_number(persEvt.m_eventNbr);
+    genEvt->add_attribute("mpi",std::make_shared<HepMC3::IntAttribute>(persEvt.m_mpi));
+    genEvt->add_attribute("event_scale",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_eventScale));
+    genEvt->add_attribute("alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQCD));
+    genEvt->add_attribute("alphaQED",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQED));
+    genEvt->weights()= persEvt.m_weights;
+    genEvt->add_attribute("random_states",std::make_shared<HepMC3::VectorLongIntAttribute>(persEvt.m_randomStates));
+
+    genEvt->set_units(static_cast<HepMC3::Units::MomentumUnit>(persEvt.m_momentumUnit),
+                      static_cast<HepMC3::Units::LengthUnit>(persEvt.m_lengthUnit));
+
+    //restore weight names from the dedicated svc (which was keeping them in metadata for efficiency)
+    if(genEvt->run_info()) genEvt->run_info()->set_weight_names(name_index_map_to_names(m_hepMCWeightSvc->weightNames()));
+    else msg << MSG::WARNING << "No run info!" << endmsg;
+    // cross-section restore
+
+    auto cs = std::make_shared<HepMC3::GenCrossSection>();
+    if (!persEvt.m_crossSection.empty()) {
+      const std::vector<double>& xsection = persEvt.m_crossSection;
+      if( static_cast<bool>(xsection[0]) )
+        cs->set_cross_section(xsection[2],xsection[1]);
+    genEvt->set_cross_section(cs);
+    }
+    
+    // heavyIon restore
+    auto hi = std::make_shared<HepMC3::GenHeavyIon>();
+    if (!persEvt.m_heavyIon.empty()) {
+      const std::vector<float>& hIon = persEvt.m_heavyIon;
+      //AV NOTE THE ORDER
+      hi->set(
+         static_cast<int>(hIon[12]), // Ncoll_hard
+         static_cast<int>(hIon[11]), // Npart_proj
+         static_cast<int>(hIon[10]), // Npart_targ
+         static_cast<int>(hIon[9]), // Ncoll
+         static_cast<int>(hIon[8]), // spectator_neutrons
+         static_cast<int>(hIon[7]), // spectator_protons
+         static_cast<int>(hIon[6]), // N_Nwounded_collisions
+         static_cast<int>(hIon[5]), // Nwounded_N_collisions
+         static_cast<int>(hIon[4]), // Nwounded_Nwounded_collisions
+         hIon[3],                   // impact_parameter
+         hIon[2],                  // event_plane_angle
+         hIon[1],                  // eccentricity
+         hIon[0]         );         // sigma_inel_NN
+    genEvt->set_heavy_ion(hi);
+    }
+
+
+
+       // pdfinfo restore
+      if (!persEvt.m_pdfinfo.empty())
+        {
+          const std::vector<double>& pdf = persEvt.m_pdfinfo;
+              HepMC3::GenPdfInfoPtr pi;
+              pi->set(
+              static_cast<int>(pdf[6]), // id1
+              static_cast<int>(pdf[5]), // id2
+              pdf[4],                   // x1
+              pdf[3],                   // x2
+              pdf[2],                   // scalePDF
+              pdf[1],                   // pdf1
+              pdf[0] );                 // pdf2
+              genEvt->set_pdf_info(pi);
+        }
+    transObj->push_back( genEvt );
+
+    // create a temporary map associating the barcode of an end-vtx to its
+    // particle.
+    // As not all particles are stable (d'oh!) we take 50% of the number of
+    // particles as an initial size of the hash-map (to prevent re-hash)
+    ParticlesMap_t partToEndVtx( (persEvt.m_particlesEnd-
+                                  persEvt.m_particlesBegin)/2 );
+
+    // create the vertices
+    const unsigned int endVtx = persEvt.m_verticesEnd;
+    for ( unsigned int iVtx= persEvt.m_verticesBegin; iVtx != endVtx; ++iVtx ) {
+      genEvt->add_vertex( createGenVertex( *persObj,
+                                           persObj->m_genVertices[iVtx],
+                                           partToEndVtx,
+                                           &datapools ) );
+    } //> end loop over vertices
+
+    // set the signal process vertex
+    const int sigProcVtx = persEvt.m_signalProcessVtx;
+    if ( sigProcVtx != 0 ) {
+     HepMC::set_signal_process_vertex(genEvt,HepMC::barcode_to_vertex(genEvt, sigProcVtx ) );
+    }
+
+    // connect particles to their end vertices
+    for ( ParticlesMap_t::iterator
+            p = partToEndVtx.begin(),
+            endItr = partToEndVtx.end();
+          p != endItr;
+          ++p ) {
+      auto decayVtx = HepMC::barcode_to_vertex(genEvt, p->second );
+      if ( decayVtx ) {
+        decayVtx->add_particle_in( p->first );
+      } else {
+        msg << MSG::ERROR
+            << "GenParticle points to null end vertex !!"
+            << endmsg;
+      }
+    }
+    // set the beam particles
+    const int beamPart1 = persEvt.m_beamParticle1;
+    const int beamPart2 = persEvt.m_beamParticle2;
+    if (  beamPart1 != 0  &&  beamPart2 !=0 ) {
+      genEvt->set_beam_particles(HepMC::barcode_to_particle(genEvt,beamPart1),
+                                 HepMC::barcode_to_particle(genEvt,beamPart2));
+    }
+
+#else  
     genEvt->m_signal_process_id     = persEvt.m_signalProcessId;
     genEvt->m_event_number          = persEvt.m_eventNbr;
     genEvt->m_mpi                   = persEvt.m_mpi;
@@ -217,6 +330,7 @@ void McEventCollectionCnv_p5::persToTrans( const McEventCollection_p5* persObj,
                                  genEvt->barcode_to_particle(beamPart2));
     }
 
+#endif
 
 
   } //> end loop over m_genEvents
@@ -246,6 +360,95 @@ void McEventCollectionCnv_p5::transToPers( const McEventCollection* transObj,
     const unsigned int nPersVtx   = persObj->m_genVertices.size();
     const unsigned int nPersParts = persObj->m_genParticles.size();
     const HepMC::GenEvent* genEvt = *itr;
+#ifdef HEPMC3
+   //save the weight names to metadata via the HepMCWeightSvc 
+      m_hepMCWeightSvc->setWeightNames(  names_to_name_index_map(genEvt->weight_names()) ).ignore();
+   
+      auto A_mpi=genEvt->attribute<HepMC3::IntAttribute>("mpi");    
+      auto A_signal_process_id=genEvt->attribute<HepMC3::IntAttribute>("signal_process_id");    
+      auto A_event_scale=genEvt->attribute<HepMC3::DoubleAttribute>("event_scale");    
+      auto A_alphaQCD=genEvt->attribute<HepMC3::DoubleAttribute>("alphaQCD");    
+      auto A_alphaQED=genEvt->attribute<HepMC3::DoubleAttribute>("alphaQED");    
+      auto A_signal_process_vertex=genEvt->attribute<HepMC3::IntAttribute>("signal_process_vertex");    
+      auto A_random_states=genEvt->attribute<HepMC3::VectorLongIntAttribute>("random_states");    
+      auto beams=genEvt->beams();
+      persObj->m_genEvents.
+      push_back( GenEvent_p5(A_signal_process_id?(A_signal_process_id->value()):0,
+                              genEvt->event_number(),
+                              A_mpi?(A_mpi->value()):-1, 
+                              A_event_scale?(A_event_scale->value()):0.0, 
+                              A_alphaQCD?(A_alphaQCD->value()):0.0, 
+                              A_alphaQED?(A_alphaQED->value()):0.0, 
+                              A_signal_process_vertex?(A_signal_process_vertex->value()):0, 
+                              HepMC::barcode(beams[0]),
+                              HepMC::barcode(beams[1]),
+                              genEvt->weights(),
+                              A_random_states?(A_random_states->value()):std::vector<long>(), 
+                              std::vector<double>(),      // cross section
+                              std::vector<float>(),       // heavyion
+                              std::vector<double>(),      // pdf info
+                              genEvt->momentum_unit(),
+                              genEvt->length_unit(),
+                              nPersVtx,
+                              nPersVtx + genEvt->vertices().size(),
+                              nPersParts,
+                              nPersParts + genEvt->particles().size() ) );
+    
+                                    
+    //HepMC::GenCrossSection encoding
+    if (genEvt->cross_section()) {
+      auto cs=genEvt->cross_section();
+      GenEvent_p5& persEvt = persObj->m_genEvents.back();
+      std::vector<double>& crossSection = persEvt.m_crossSection;
+      crossSection.resize(3);
+      crossSection[2] = cs->xsec();
+      crossSection[1] = cs->xsec_err();
+      crossSection[0] = static_cast<double>(cs->is_valid());
+    }
+
+    //HepMC::HeavyIon encoding
+    if (genEvt->heavy_ion()) {
+      auto hi=genEvt->heavy_ion();
+      GenEvent_p5& persEvt = persObj->m_genEvents.back();
+      std::vector<float>& heavyIon = persEvt.m_heavyIon;
+      heavyIon.resize(13);
+      heavyIon[12]  = static_cast<float>(hi->Ncoll_hard);
+      heavyIon[11]  = static_cast<float>(hi->Npart_proj);
+      heavyIon[10]  = static_cast<float>(hi->Npart_targ);
+      heavyIon[9]   = static_cast<float>(hi->Ncoll);
+      heavyIon[8]   = static_cast<float>(hi->spectator_neutrons);
+      heavyIon[7]   = static_cast<float>(hi->spectator_protons);
+      heavyIon[6]   = static_cast<float>(hi->N_Nwounded_collisions);
+      heavyIon[5]   = static_cast<float>(hi->Nwounded_N_collisions);
+      heavyIon[4]   = static_cast<float>(hi->Nwounded_Nwounded_collisions);
+      heavyIon[3]   = hi->impact_parameter;
+      heavyIon[2]   = hi->event_plane_angle;
+      heavyIon[1]   = hi->eccentricity;
+      heavyIon[0]   = hi->sigma_inel_NN;
+    }
+
+    //PdfInfo encoding
+    if (genEvt->pdf_info()) {
+      auto pi=genEvt->pdf_info();
+      GenEvent_p5& persEvt = persObj->m_genEvents.back();
+      std::vector<double>& pdfinfo = persEvt.m_pdfinfo;
+      pdfinfo.resize(9);
+      pdfinfo[8] = static_cast<double>(pi->parton_id[0]);
+      pdfinfo[7] = static_cast<double>(pi->parton_id[1]);
+      pdfinfo[6] = static_cast<double>(pi->pdf_id[0]);
+      pdfinfo[5] = static_cast<double>(pi->pdf_id[1]);
+      pdfinfo[4] = pi->x[0];
+      pdfinfo[3] = pi->x[1];
+      pdfinfo[2] = pi->scale;
+      pdfinfo[1] = pi->xf[0];
+      pdfinfo[0] = pi->xf[1];
+    }
+
+    // create vertices
+    for (auto v: genEvt->vertices()) {
+      writeGenVertex( v, *persObj );
+    }
+#else
     const int signalProcessVtx = genEvt->m_signal_process_vertex
       ? genEvt->m_signal_process_vertex->barcode()
       : 0;
@@ -334,6 +537,7 @@ void McEventCollectionCnv_p5::transToPers( const McEventCollection* transObj,
           ++i ) {
       writeGenVertex( **i, *persObj );
     }
+#endif
 
   } //> end loop over GenEvents
 
@@ -349,6 +553,20 @@ McEventCollectionCnv_p5::createGenVertex( const McEventCollection_p5& persEvt,
                                           ParticlesMap_t& partToEndVtx, HepMC::DataPool* datapools
                                           ) const
 {
+#ifdef HEPMC3
+  HepMC::GenVertexPtr vtx(0);
+  DataPool<HepMC::GenVertexPtr>& poolOfVertices = datapools->vtx;
+  if(m_isPileup) {
+    vtx=HepMC::newGenVertexPtr();
+  } else {
+    vtx = *(poolOfVertices.nextElementPtr());
+  }
+  vtx->set_position(HepMC::FourVector( persVtx.m_x , persVtx.m_y , persVtx.m_z ,persVtx.m_t ));
+  //AV ID cannot be assigned in HepMC3. And its meaning in HepMC2 is not clear.
+  // vtx->m_id      = persVtx.m_id;
+  vtx->add_attribute("weights",std::make_shared<HepMC3::VectorFloatAttribute>(persVtx.m_weights));
+  vtx->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persVtx.m_barcode));
+#else
   DataPool<HepMC::GenVertex>& poolOfVertices = datapools->vtx;
   HepMC::GenVertexPtr vtx(0);
   if(m_isPileup) {
@@ -368,6 +586,7 @@ McEventCollectionCnv_p5::createGenVertex( const McEventCollection_p5& persEvt,
                                     persVtx.m_weights.end() );
   vtx->m_event   = 0;
   vtx->m_barcode = persVtx.m_barcode;
+#endif
 
   // handle the in-going (orphans) particles
   const unsigned int nPartsIn = persVtx.m_particlesIn.size();
@@ -392,6 +611,55 @@ HepMC::GenParticlePtr
 McEventCollectionCnv_p5::createGenParticle( const GenParticle_p5& persPart,
                                             ParticlesMap_t& partToEndVtx, HepMC::DataPool* datapools ) const
 {
+#ifdef HEPMC3
+  DataPool<HepMC::GenParticlePtr>& poolOfParticles = datapools->part;
+  HepMC::GenParticlePtr p(0);
+    if (m_isPileup) {
+    p = HepMC::newGenParticlePtr();
+  } else {
+    p    = *(poolOfParticles.nextElementPtr());
+  }
+  p->set_pdg_id(              persPart.m_pdgId);
+  p->set_status(              persPart.m_status);
+  p->add_attribute("phi",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_phiPolarization));
+  p->add_attribute("theta",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_thetaPolarization));
+  p->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persPart.m_barcode));  
+  p->set_generated_mass(persPart.m_generated_mass);
+
+  // Note: do the E calculation in extended (long double) precision.
+  // That happens implicitly on x86 with optimization on; saying it
+  // explicitly ensures that we get the same results with and without
+  // optimization.  (If this is a performance issue for platforms
+  // other than x86, one could change to double for those platforms.)
+  if ( 0 == persPart.m_recoMethod ) {
+    double temp_e = std::sqrt( (long double)(persPart.m_px)*persPart.m_px +
+                          (long double)(persPart.m_py)*persPart.m_py +
+                          (long double)(persPart.m_pz)*persPart.m_pz +
+                          (long double)(persPart.m_m) *persPart.m_m );
+      p->set_momentum( HepMC::FourVector(persPart.m_px,persPart.m_px,persPart.m_px,temp_e));
+  } else {
+    const int signM2 = ( persPart.m_m >= 0. ? 1 : -1 );
+    const double persPart_ene =
+      std::sqrt( std::abs((long double)(persPart.m_px)*persPart.m_px +
+                (long double)(persPart.m_py)*persPart.m_py +
+                (long double)(persPart.m_pz)*persPart.m_pz +
+                signM2* (long double)(persPart.m_m)* persPart.m_m));
+    const int signEne = ( persPart.m_recoMethod == 1 ? 1 : -1 );
+    p->set_momentum(HepMC::FourVector( persPart.m_px,
+                       persPart.m_py,
+                       persPart.m_pz,
+                       signEne * persPart_ene ));
+  }
+
+  // setup flow
+  std::vector<int> flows;
+  const unsigned int nFlow = persPart.m_flow.size();
+  for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
+  flows.push_back(persPart.m_flow[iFlow].second );
+  }
+  //We construct it here as vector w/o gaps.
+  p->add_attribute("flows", std::make_shared<HepMC3::VectorIntAttribute>(flows));
+#else
   DataPool<HepMC::GenParticle>& poolOfParticles = datapools->part;
   HepMC::GenParticlePtr p(0);
   if (m_isPileup) {
@@ -444,6 +712,7 @@ McEventCollectionCnv_p5::createGenParticle( const GenParticle_p5& persPart,
     p->m_flow.set_icode( persPart.m_flow[iFlow].first,
                          persPart.m_flow[iFlow].second );
   }
+#endif
 
   if ( persPart.m_endVtx != 0 ) {
     partToEndVtx[p] = persPart.m_endVtx;
@@ -452,6 +721,41 @@ McEventCollectionCnv_p5::createGenParticle( const GenParticle_p5& persPart,
   return p;
 }
 
+#ifdef HEPMC3
+void McEventCollectionCnv_p5::writeGenVertex( HepMC::ConstGenVertexPtr vtx,
+                                              McEventCollection_p5& persEvt ) const
+{
+  const HepMC::FourVector& position = vtx->position();
+  auto A_weights=vtx->attribute<HepMC3::VectorDoubleAttribute>("weights"); 
+  auto A_barcode=vtx->attribute<HepMC3::IntAttribute>("barcode"); 
+  std::vector<double> weights=A_weights?(A_weights->value()):std::vector<double>();
+  persEvt.m_genVertices.push_back(
+                                  GenVertex_p5( position.x(),
+                                                position.y(),
+                                                position.z(),
+                                                position.t(),
+                                                vtx->id(),
+                                                weights.begin(),
+                                                weights.end(),
+                                                A_barcode?(A_barcode->value()):vtx->id()) );
+  GenVertex_p5& persVtx = persEvt.m_genVertices.back();
+
+  // we write only the orphans in-coming particles
+  persVtx.m_particlesIn.reserve(vtx->particles_in().size());
+  for (auto p: vtx->particles_in()) {
+    if ( !p->production_vertex() ) {
+      persVtx.m_particlesIn.push_back( writeGenParticle( p, persEvt ) );
+    }
+  }
+
+  persVtx.m_particlesOut.reserve(vtx->particles_out().size());
+  for (auto p: vtx->particles_out()) {
+    persVtx.m_particlesOut.push_back( writeGenParticle( p, persEvt ) );
+  }
+
+  return;
+}
+#else
 void McEventCollectionCnv_p5::writeGenVertex( const HepMC::GenVertex& vtx,
                                               McEventCollection_p5& persEvt ) const
 {
@@ -488,7 +792,51 @@ void McEventCollectionCnv_p5::writeGenVertex( const HepMC::GenVertex& vtx,
 
   return;
 }
+#endif
 
+#ifdef HEPMC3
+int McEventCollectionCnv_p5::writeGenParticle( HepMC::ConstGenParticlePtr p,
+                                               McEventCollection_p5& persEvt ) const
+{
+  const HepMC::FourVector mom = p->momentum();
+  const double ene = mom.e();
+  const double m2  = mom.m2();
+
+  // Definitions of Bool isTimeLilike, isSpacelike and isLightlike according to HepLorentzVector definition
+  const bool useP2M2 = !(m2 > 0) &&   // !isTimelike
+    (m2 < 0) &&   //  isSpacelike
+    !(std::abs(m2) < 2.0*DBL_EPSILON*ene*ene); // !isLightlike
+    auto A_flows=p->attribute<HepMC3::VectorIntAttribute>("flows"); 
+    auto A_phi=p->attribute<HepMC3::DoubleAttribute>("phi"); 
+    auto A_theta=p->attribute<HepMC3::DoubleAttribute>("theta"); 
+    
+  const short recoMethod = ( !useP2M2 ? 0: ( ene >= 0.? 1: 2 ) );
+  persEvt.m_genParticles.
+    push_back( GenParticle_p5( mom.px(),
+                               mom.py(),
+                               mom.pz(),
+                               mom.m(),
+                               p->pdg_id(),
+                               p->status(),
+                               A_flows?(A_flows->value().size()):0,
+                               A_theta?(A_theta->value()):0.0,
+                               A_phi?(A_phi->value()):0.0,
+                               p->production_vertex()? HepMC::barcode(p->production_vertex()):0,
+                               p->end_vertex()? HepMC::barcode(p->end_vertex()):0,
+                               HepMC::barcode(p),
+                               p->generated_mass(),
+                               recoMethod ) );
+                               
+  std::vector< std::pair<int,int> > flow_hepmc2;
+  if(A_flows) flow_hepmc2=vector_to_vector_int_int(A_flows->value());
+  persEvt.m_genParticles.back().m_flow.assign( flow_hepmc2.begin(),flow_hepmc2.end() );
+
+  // we return the index of the particle in the big vector of particles
+  // (contained by the persistent GenEvent)
+  return (persEvt.m_genParticles.size() - 1);
+
+}
+#else
 int McEventCollectionCnv_p5::writeGenParticle( const HepMC::GenParticle& p,
                                                McEventCollection_p5& persEvt ) const
 {
@@ -534,6 +882,7 @@ int McEventCollectionCnv_p5::writeGenParticle( const HepMC::GenParticle& p,
   // (contained by the persistent GenEvent)
   return (persEvt.m_genParticles.size() - 1);
 }
+#endif
 
 void McEventCollectionCnv_p5::setPileup() {
   m_isPileup = true;
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
index 30b519f17a39..46b86158da55 100644
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
@@ -20,4 +20,31 @@ namespace {
 
     return std::make_pair( nParts, nVerts );
   }
+#ifdef HEPMC3
+std::vector<std::string>   name_index_map_to_names(const std::map<std::string, unsigned long int> &input)
+{
+std::vector<std::string> result;
+std::vector<std::pair<std::string, unsigned long int> > sorted; 
+for (auto el: input) sorted.push_back(el);
+std::sort(sorted.begin(), sorted.end(),[](std::pair<std::string, unsigned long int> a, std::pair<std::string, unsigned long int> b) {return a.second > b.second; }); 
+for (auto a: sorted) result.push_back(a.first);
+return result;
+}
+
+std::map<std::string, unsigned long int> names_to_name_index_map(const  std::vector<std::string>  &input )
+{
+std::map<std::string, unsigned long int> result;
+unsigned long int i=0;
+for (auto a: input) {result[a]=i; i++;}
+return result;
+}
+
+std::vector<std::pair<int,int> > vector_to_vector_int_int(const  std::vector<int>  &input )
+{
+std::vector<std::pair<int,int> > result;
+unsigned long int i=0;
+for (auto a: input) {result.push_back(std::pair<int,int>(a,i)); i++;}
+return result;
+}
+#endif
 }
-- 
GitLab


From 76483f9edf0b208dff768f52b08c2c35be9cdb0b Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Thu, 24 Sep 2020 16:03:03 +0000
Subject: [PATCH 421/422] 22.0-validation-InDetPhysValMonitoring

---
 Control/AthenaPython/share/icopy_file.py      |  2 +-
 Control/AthenaPython/share/iread_file.py      |  2 +-
 .../run/PhysVal_jobOptions.py                 | 70 +++++-----------
 .../scripts/getSomeData.sh                    |  2 +-
 .../src/ParameterErrDecoratorAlg.cxx          | 84 +++++++------------
 .../src/ParameterErrDecoratorAlg.h            |  4 +-
 6 files changed, 55 insertions(+), 109 deletions(-)
 mode change 100644 => 100755 InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/getSomeData.sh

diff --git a/Control/AthenaPython/share/icopy_file.py b/Control/AthenaPython/share/icopy_file.py
index 7b78938e0171..ce7b1b4749fc 100644
--- a/Control/AthenaPython/share/icopy_file.py
+++ b/Control/AthenaPython/share/icopy_file.py
@@ -13,7 +13,7 @@ __doc__ = "simple jobo to copy any file, leveraging the auto-config fwk"
 from AthenaCommon.AthenaCommonFlags import jobproperties as jp
 acf = jp.AthenaCommonFlags
 _input_files = globals()['FNAME']
-if isinstance(_input_files, basestring):
+if isinstance(_input_files, str):
     _input_files = [_input_files]
 acf.FilesInput = _input_files
 del _input_files
diff --git a/Control/AthenaPython/share/iread_file.py b/Control/AthenaPython/share/iread_file.py
index 057cbad995e4..398d27da60cc 100644
--- a/Control/AthenaPython/share/iread_file.py
+++ b/Control/AthenaPython/share/iread_file.py
@@ -13,7 +13,7 @@ __doc__ = "simple jobo to read any file, leveraging the auto-config fwk"
 from AthenaCommon.AthenaCommonFlags import jobproperties as jp
 acf = jp.AthenaCommonFlags
 _input_files = globals().get('FNAME', [])
-if isinstance(_input_files, basestring):
+if isinstance(_input_files, str):
     _input_files = [_input_files]
 acf.FilesInput = _input_files
 del _input_files
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py
index 007395fc9d28..02bd8e2dfb59 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py
@@ -8,19 +8,11 @@ FNAME = "AOD.pool.root"
 mode = "Fwd" #Set this to "Back" for backtracking
 usingTrackSelection = False
 #
-#options for Max to explore backtracking
-if (getpass.getuser())=="mbaugh":
-  mode="Back"
-  FNAME = "../command/target.pool.root"
-  '''
-  The following sets an environment variable to enable backtracking debug messages.
-  To use in C++:
-  const char * debugBacktracking = std::getenv("BACKTRACKDEBUG");
-  '''
-  os.environ["BACKTRACKDEBUG"] = "1"
-  #
-include( "AthenaPython/iread_file.py" )
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.doSlimming.set_Value_and_Lock(False)
+rec.doTrigger.set_Value_and_Lock(False);
 
+include( "AthenaPython/iread_file.py" )
 # Access the algorithm sequence:
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
@@ -36,42 +28,21 @@ for decorator in InDetPhysValMonitoring.InDetPhysValDecoration.getDecorators() :
   topSequence += decorator
 
 from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
-monMan = AthenaMonManager( "PhysValMonManager" )
-monMan.ManualDataTypeSetup = True
-monMan.DataType            = "monteCarlo"
-monMan.Environment         = "altprod"
-monMan.ManualRunLBSetup    = True
-monMan.Run                 = 1
-monMan.LumiBlock           = 1
-monMan.FileKey = "M_output"
+monMan = AthenaMonManager( "PhysValMonManager",
+  FileKey = "M_output",
+  Environment = "altprod",
+  ManualDataTypeSetup = True,
+  DataType = "monteCarlo",
+  ManualRunLBSetup = True,
+  Run = 1,
+  LumiBlock = 1  )
+  
+print (monMan)
+
 topSequence += monMan
 
 
-#this works:
-'''
-from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool
-InDetTrackSelectorTool = InDet__InDetTrackSelectionTool(name = "InDetTrackSelectorTool",
-                                                        CutLevel = InDetPrimaryVertexingCuts.TrackCutLevel(),
-                                                        minPt = InDetPrimaryVertexingCuts.minPT(),
-                                                        maxD0 = InDetPrimaryVertexingCuts.IPd0Max(),
-                                                        maxZ0 = InDetPrimaryVertexingCuts.z0Max(),
-                                                        maxZ0SinTheta = InDetPrimaryVertexingCuts.IPz0Max(),
-                                                        maxSigmaD0 = InDetPrimaryVertexingCuts.sigIPd0Max(),
-                                                        maxSigmaZ0SinTheta = InDetPrimaryVertexingCuts.sigIPz0Max(),
-                                                        # maxChiSqperNdf = InDetPrimaryVertexingCuts.fitChi2OnNdfMax(), # Seems not to be implemented?
-                                                        maxAbsEta = InDetPrimaryVertexingCuts.etaMax(),
-                                                        minNInnermostLayerHits = InDetPrimaryVertexingCuts.nHitInnermostLayer(),
-                                                        minNPixelHits = InDetPrimaryVertexingCuts.nHitPix(),
-                                                        maxNPixelHoles = InDetPrimaryVertexingCuts.nHolesPix(),
-                                                        minNSctHits = InDetPrimaryVertexingCuts.nHitSct(),
-                                                        minNTrtHits = InDetPrimaryVertexingCuts.nHitTrt(),
-                                                        minNSiHits = InDetPrimaryVertexingCuts.nHitSi(),
-                                                        TrackSummaryTool = InDetTrackSummaryTool,
-                                                        Extrapolator = InDetExtrapolator)
 
-
-ToolSvc += InDetTrackSelectorTool
-'''
 from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool
 InDetTrackSelectorTool=InDet__InDetTrackSelectionTool()
 ToolSvc += InDetTrackSelectorTool
@@ -90,8 +61,7 @@ if mode=="Back":
   AthTruthSelectionTool.poselectronfromgamma = True
   os.environ["BACKTRACKDEBUG"] = "1"
 
-print AthTruthSelectionTool
-#ToolSvc += AthTruthSelectionTool
+print (AthTruthSelectionTool)
 
 from InDetPhysValMonitoring.InDetPhysValMonitoringConf import InDetPhysValMonitoringTool
 tool1 = InDetPhysValMonitoringTool()
@@ -99,8 +69,10 @@ tool1.TruthSelectionTool = AthTruthSelectionTool
 tool1.useTrackSelection = usingTrackSelection
 tool1.TrackSelectionTool=InDetTrackSelectorTool
 tool1.FillTrackInJetPlots = True
-print tool1
-#ToolSvc += tool1
+print (tool1)
+tool1.ManagerName = 'PhysValMonManager'
+
+
 
 monMan.AthenaMonTools += [tool1]
 
@@ -113,7 +85,7 @@ ToolSvc += InDetBoundaryCheckTool
 from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
 InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, BoundaryCheckTool=InDetBoundaryCheckTool, CountDeadModulesAfterLastHit = True)
 ToolSvc += InDetHoleSearchTool
-print InDetHoleSearchTool
+print (InDetHoleSearchTool)
 
 from GaudiSvc.GaudiSvcConf import THistSvc
 ServiceMgr += THistSvc()
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/getSomeData.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/getSomeData.sh
old mode 100644
new mode 100755
index 060c2d8da9d7..e1949268b37e
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/getSomeData.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/getSomeData.sh
@@ -8,7 +8,7 @@
 #Itk
 #rucio download mc15_14TeV.117050.PowhegPythia_P2011C_ttbar.recon.DAOD_IDTRKVALID.e2176_s2897_s2901_r8209
 rm -f ~$USER/run/AOD.pool.root
-ln -s ~npetters/workDir/public/OUT.ESD.pool.root ~$USER/run/AOD.pool.root
+ln -s ~npetters/workDir/public/forShaun/group.perf-idtracking.21564941.EXT0._000008.RDO.pool.root ~$USER/run/AOD.pool.root
 rm -f ~$USER/run/*.xml
 
 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.cxx
index b0c825494765..f382935c788b 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -23,18 +23,22 @@ ParameterErrDecoratorAlg::~ParameterErrDecoratorAlg() {
 
 StatusCode
 ParameterErrDecoratorAlg::initialize() {
-  ATH_CHECK( m_trkParticleName.initialize() );
+  ATH_CHECK( m_trkParticleKey.initialize() );
 
-  std::vector<std::string> decor_names(kNDecorators);
-  decor_names[kDecorD0err]="d0err";
-  decor_names[kDecorZ0err]="z0err";
-  decor_names[kDecorPhierr]="phierr";
-  decor_names[kDecorThetaerr]="thetaerr";
-  decor_names[kDecorQopterr]="qopterr";
-
-  IDPVM::createDecoratorKeys(*this, m_trkParticleName, m_prefix, decor_names, m_decor);
+  std::vector<std::string> decorationNames(kNDecorators);
+  decorationNames[kDecorD0err]="d0err";
+  decorationNames[kDecorZ0err]="z0err";
+  decorationNames[kDecorPhierr]="phierr";
+  decorationNames[kDecorThetaerr]="thetaerr";
+  decorationNames[kDecorQopterr]="qopterr";
+  std::string message{"The following decorations should be added by ParameterErrDecoratorAlg:\n"};
+  for (const auto & thisName: decorationNames){
+    message += thisName+"\n";
+  }
+  ATH_MSG_INFO(message);
+  IDPVM::createDecoratorKeys(*this, m_trkParticleKey, m_prefix, decorationNames, m_decor);
   assert( m_decor.size() == kNDecorators);
-
+  
   return StatusCode::SUCCESS;
 }
 
@@ -45,23 +49,25 @@ ParameterErrDecoratorAlg::finalize() {
 
 StatusCode
 ParameterErrDecoratorAlg::execute(const EventContext &ctx) const {
-  SG::ReadHandle<xAOD::TrackParticleContainer> ptracks(m_trkParticleName, ctx);
+  SG::ReadHandle<xAOD::TrackParticleContainer> ptracks(m_trkParticleKey, ctx);
   if ((not ptracks.isValid())) {
+    ATH_MSG_ERROR("The track particle container '"<< m_trkParticleKey.key()<<"' could not be read.");
     return StatusCode::FAILURE;
   }
-
   std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> >
-    float_decor( IDPVM::createDecorators<xAOD::TrackParticleContainer,float>(m_decor, ctx) );
-
-  for (const xAOD::TrackParticle *trk_particle : *ptracks) {
-    if (not decorateTrack(*trk_particle, float_decor) ) return StatusCode::FAILURE;
+    floatDecoration( IDPVM::createDecorators<xAOD::TrackParticleContainer,float>(m_decor, ctx) );
+  for (const xAOD::TrackParticle *pTrkParticle : *ptracks) {
+    if (not decorateTrack(*pTrkParticle, floatDecoration) ) {
+      ATH_MSG_ERROR("Decoration failed in ParameterErrDecoratorAlg::execute.");
+      return StatusCode::FAILURE;
+    }
   }
   return StatusCode::SUCCESS;
 }
 
 bool
 ParameterErrDecoratorAlg::decorateTrack(const xAOD::TrackParticle& particle,
-                                         std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> > &float_decor) const {
+                                         std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> > &floatDecoration) const {
   ATH_MSG_VERBOSE("Decorate track with errors ");
   bool success(true);
   const AmgSymMatrix(5)  errorMat = particle.definingParametersCovMatrix();
@@ -70,42 +76,10 @@ ParameterErrDecoratorAlg::decorateTrack(const xAOD::TrackParticle& particle,
   Trk::JacobianThetaPToCotThetaPt TheJac(mtheta, mqp);
   AmgSymMatrix(5) covVert;
   covVert = errorMat.similarity(TheJac);
-  float_decor[kDecorD0err](particle)=Amg::error(covVert, 0);
-  float_decor[kDecorZ0err](particle)=Amg::error(covVert, 1);
-  float_decor[kDecorPhierr](particle)=Amg::error(covVert, 2);
-  float_decor[kDecorThetaerr](particle)=Amg::error(errorMat, Trk::theta);
-  float_decor[kDecorQopterr](particle)=Amg::error(covVert, 4) * 1000.;
+  floatDecoration[kDecorD0err](particle)=Amg::error(covVert, 0);
+  floatDecoration[kDecorZ0err](particle)=Amg::error(covVert, 1);
+  floatDecoration[kDecorPhierr](particle)=Amg::error(covVert, 2);
+  floatDecoration[kDecorThetaerr](particle)=Amg::error(errorMat, Trk::theta);
+  floatDecoration[kDecorQopterr](particle)=Amg::error(covVert, 4) * 1000.;
   return success;
 }
-
-/**
-   AmgVector(5) perigeeParams = startPerigee->parameters();
-      trkd0    = perigeeParams[Trk::d0];
-      trkz0    = perigeeParams[Trk::z0];
-      trkphi   = perigeeParams[Trk::phi0];
-      trktheta = perigeeParams[Trk::theta];
-      //trkcot   = 1./tan(trktheta);
-      trketa   = - log(tan(trktheta / 2.0));
-      trkqOverPt  = perigeeParams[Trk::qOverP]*1000./sin(trktheta);
-      trkpt    = abs(1.0 / trkqOverPt);
-      if (trkqOverPt<0) charge=-1;
-      else charge=+1;
-      const AmgSymMatrix(5) * ErrorMat = startPerigee->covariance();
-      double mtheta = (startPerigee->parameters())[Trk::theta];
-      double mqp = (startPerigee->parameters())[Trk::qOverP];
-      Trk::JacobianThetaPToCotThetaPt TheJac(mtheta,mqp);
-      AmgSymMatrix(5) covVert;
-      covVert = ErrorMat->similarity(TheJac);
-      // trkd0err = sqrt(covVert[0][0]);
-      // trkz0err = sqrt(covVert[1][1]);
-      // trkphierr = sqrt(covVert[2][2]);
-      // trkcoterr = sqrt(covVert[3][3]);
-      // trkqopterr = sqrt(covVert[4][4])*1000.;
-      // trkthetaerr = ErrorMat->error(Trk::theta);
-      trkd0err = Amg::error(covVert,0);
-      trkz0err = Amg::error(covVert,1);
-      trkphierr = Amg::error(covVert,2);
-      //trkcoterr = Amg::error(covVert,3);
-      trkqopterr = Amg::error(covVert,4)*1000.;
-      trkthetaerr = Amg::error((*ErrorMat),Trk::theta);
- **/
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.h
index 02ad809325d4..302a6cca336f 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.h
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETPHYSVALMONITORING_ParameterErrDecoratorAlg_H
@@ -37,7 +37,7 @@ private:
     {this, "Prefix", "", "Decoration prefix to avoid clashes."};
 
   // need tracks particle key, to compose decoration keys
-  SG::ReadHandleKey<xAOD::TrackParticleContainer>  m_trkParticleName
+  SG::ReadHandleKey<xAOD::TrackParticleContainer>  m_trkParticleKey
     {this,"TrackParticleContainerName", "InDetTrackParticles",""};
 
   enum EDecorations {
-- 
GitLab


From 7b5d5968de0f70240e58b561ee34d96415d608f9 Mon Sep 17 00:00:00 2001
From: Elin Bergeaas Kuutmann <elin.bergeaas.kuutmann@physics.uu.se>
Date: Thu, 24 Sep 2020 16:05:56 +0000
Subject: [PATCH 422/422] Splitting the top-level and general HLT monitoring
 into their own files; General mon now in TrigGeneralMonitorAlgorithm.py

---
 .../python/TrigGeneralMonitorAlgorithm.py     | 145 ++++++++++++++++
 .../python/TrigHLTMonitorAlgorithm.py         | 157 ++++--------------
 .../src/TrigHLTMonitorAlgorithm.cxx           | 115 ++++++++++---
 .../src/TrigHLTMonitorAlgorithm.h             |   6 +
 4 files changed, 273 insertions(+), 150 deletions(-)
 create mode 100644 Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigGeneralMonitorAlgorithm.py

diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigGeneralMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigGeneralMonitorAlgorithm.py
new file mode 100644
index 000000000000..ed93bbc43eac
--- /dev/null
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigGeneralMonitorAlgorithm.py
@@ -0,0 +1,145 @@
+#
+#  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#
+
+'''@file TrigHLTMonitorAlgorithm.py
+@date 2020-09-18
+@brief TrigHLTMonitoring general monitoring
+'''
+
+
+def TrigGeneralMonConfig(inputFlags):
+    '''Function to configure general HLT algorithms in the monitoring system.'''
+
+
+    ### Set up logging functionality 
+    from AthenaCommon.Logging import logging
+    log_trighlt = logging.getLogger( 'TrigGeneralMonitorAlgorithm' )
+
+
+    ################################
+    # HLT general monitoring
+
+    # The following class will make a sequence, configure algorithms, and link
+    # them to GenericMonitoringTools
+    from AthenaMonitoring import AthMonitorCfgHelper
+    helper = AthMonitorCfgHelper(inputFlags,'TrigHLTAthMonitorCfg')
+
+
+    # Adding algorithms to the helper. 
+    # The added algorithm must exist as a .h file 
+
+    from AthenaConfiguration.ComponentFactory import CompFactory
+    cfgsvc = CompFactory.TrigConf.xAODConfigSvc('xAODConfigSvc')
+    helper.resobj.addService(cfgsvc)
+    trigHLTMonAlg = helper.addAlgorithm(CompFactory.TrigHLTMonitorAlgorithm,'TrigHLTMonAlg')
+    trigHLTMonAlg.TrigConfigSvc = cfgsvc
+
+
+
+    # Edit properties of a algorithm
+    # Placeholder
+
+
+    # Add a generic monitoring tool (a "group" in old language). 
+    hltGroup = helper.addGroup(
+        trigHLTMonAlg,
+        'TrigHLTMonitor',
+        'HLT/ResultMon/'
+    )
+
+
+    # Configure histograms
+    #NB! The histograms defined here must match the ones in the cxx file exactly
+
+    ###########################################################
+    ##### HLTResult and ConfigConsistency  ####################
+  
+    hltGroup.defineHistogram('HLTResultHLT', title='HLT Result PLACEHOLDER;result;Events',
+                             path='',xbins=3,xmin=0,xmax=3)
+
+    consistency_names=['SMK DB NULL','SMK BS NULL','SMK Inconsistent','HLT Prescale DB NULL','HLT Prescale BS NULL','HLT Prescale Inconsistent','No HLTResult']
+    hltGroup.defineHistogram('ConfigConsistency_HLT', title='ConfigConsistency_HLT;;Events',
+                             path='',xbins=7,xmin=1,xmax=8,xlabels=consistency_names)
+
+ 
+    ############################################################
+    #### Overall summary histograms ############################
+
+    from AthenaConfiguration.AutoConfigFlags import GetFileMD
+
+    #The HLT chains
+    counter_i = 1
+    for chain_name in GetFileMD(inputFlags.Input.Files)['TriggerMenu']['HLTChains']:
+        counter_i = counter_i+1
+        log_trighlt.debug('HLT chain_name = %s',chain_name)
+    max_hlt_chains = counter_i-1
+    log_trighlt.info('max_hlt_chains = %i', max_hlt_chains)
+
+    #The L1 items
+    counter_L1 = 1
+    for item_name in GetFileMD(inputFlags.Input.Files)['TriggerMenu']['L1Items']:
+        counter_L1 = counter_L1+1
+        log_trighlt.debug('L1 item_name = %s',item_name)
+    max_L1_items = counter_L1-1 
+    log_trighlt.info('max_L1_items = %i', max_L1_items)
+
+    ##### L1 summary histogram ################################
+
+    hltGroup.defineHistogram('L1Events',title='Events per Item at L1;;Events',
+                             path='',xbins=max_L1_items,xmin=1,xmax=max_L1_items+1)
+
+    #### HLT summary histograms #########################
+
+    hltGroup.defineHistogram('HLT_AllChainsRAW',title='AllChains;;Events',
+                             path='AllChains',xbins=max_hlt_chains,
+                             xmin=1,xmax=max_hlt_chains+1)
+
+    hltGroup.defineHistogram('eta,phi;HLT_AllChainsRoIs',type='TH2F',title='AllChains;#eta;#phi',
+                             path='AllChains',xbins=64,xmin=-3.2,xmax=3.2,
+                             ybins=64,ymin=-3.2,ymax=3.2)
+
+
+    #### Summary histograms for the signatures #################
+    hltGroup.defineHistogram('HLT_ElectronsRAW',title='Placeholder;X;Y',
+                             path='Electrons',xbins=1000000,xmin=-0.5,xmax=999999.5)
+
+
+
+    #####################################
+    # Finalize. 
+    return helper.result()
+    
+
+if __name__=='__main__':
+    # Setup the Run III behavior
+    from AthenaCommon.Configurable import Configurable
+    Configurable.configurableRun3Behavior = 1
+
+    # Setup logs
+    from AthenaCommon.Logging import log
+    from AthenaCommon.Constants import DEBUG
+    log.setLevel(DEBUG)
+
+    # Set the Athena configuration flags
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    ConfigFlags.Input.isMC = False
+    ConfigFlags.Output.HISTFileName = 'TrigHLTMonitorOutput.root'
+    
+    ConfigFlags.lock()
+
+    # Initialize configuration object, add accumulator, merge, and run.
+    from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
+    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+    cfg = MainServicesCfg(ConfigFlags)
+    cfg.merge(PoolReadCfg(ConfigFlags))
+
+    trigHLTMonitorAcc = TrigGeneralMonConfig(ConfigFlags)
+    cfg.merge(trigHLTMonitorAcc)
+
+    # If you want to turn on more detailed messages ...
+    #trigHLTMonitorAcc.getEventAlgo('TrigHLTMonAlg').OutputLevel = 2 # DEBUG
+    cfg.printConfig(withDetails=True) # set True for exhaustive info
+
+    cfg.run() #use cfg.run(20) to only run on first 20 events
+
diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitorAlgorithm.py
index 6d8e29bb010a..12576dc04759 100644
--- a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitorAlgorithm.py
@@ -4,8 +4,8 @@
 
 '''@file TrigHLTMonitorAlgorithm.py
 @date 2019-09-10
-@date 2020-08-24
-@brief TrigHLTMonitoring top-level files, general monitoring
+@date 2020-09-18
+@brief TrigHLTMonitoring top-level files
 '''
 
 def createHLTDQConfigFlags():
@@ -13,14 +13,14 @@ def createHLTDQConfigFlags():
     acf=AthConfigFlags()
 
     acf.addFlag('DQ.Steering.HLT.doGeneral', True)
-    acf.addFlag('DQ.Steering.HLT.doEgamma', True)
-    acf.addFlag('DQ.Steering.HLT.doMET', True)
-    acf.addFlag('DQ.Steering.HLT.doJet', True)
     acf.addFlag('DQ.Steering.HLT.doBjet', True)
-    acf.addFlag('DQ.Steering.HLT.doCalo', True)
-    acf.addFlag('DQ.Steering.HLT.doMuon', True)
     acf.addFlag('DQ.Steering.HLT.doBphys', True)
+    acf.addFlag('DQ.Steering.HLT.doCalo', True)
+    acf.addFlag('DQ.Steering.HLT.doEgamma', True)
+    acf.addFlag('DQ.Steering.HLT.doJet', True)
+    acf.addFlag('DQ.Steering.HLT.doMET', True)
     acf.addFlag('DQ.Steering.HLT.doMinBias', True)
+    acf.addFlag('DQ.Steering.HLT.doMuon', True)
     acf.addFlag('DQ.Steering.HLT.doTau', True)
 
     return acf
@@ -32,152 +32,51 @@ def TrigHLTMonTopConfig(inputFlags):
     ########
     #HLT top-level steering
 
-    ### STEP 1 ###
     # Define one top-level monitoring algorithm. The new configuration 
     # framework uses a component accumulator.
+
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     result = ComponentAccumulator()
 
     if inputFlags.DQ.Steering.HLT.doGeneral:
-        from TrigHLTMonitoring.TrigHLTMonitorAlgorithm import TrigHLTMonConfig
-        result.merge(TrigHLTMonConfig(inputFlags))
+        from TrigHLTMonitoring.TrigGeneralMonitorAlgorithm import TrigGeneralMonConfig
+        result.merge(TrigGeneralMonConfig(inputFlags))
+
+    if inputFlags.DQ.Steering.HLT.doBjet:
+        from TrigBjetMonitoring.TrigBjetMonitorAlgorithm import TrigBjetMonConfig
+        result.merge(TrigBjetMonConfig(inputFlags))
+
+    if inputFlags.DQ.Steering.HLT.doBphys:
+        from TrigBphysMonitoring.TrigBphysMonitorAlgorithm import TrigBphysMonConfig
+        result.merge(TrigBphysMonConfig(inputFlags))
+
+    if inputFlags.DQ.Steering.HLT.doCalo:
+        from TrigCaloMonitoring.TrigCaloMonitorAlgorithm import TrigCaloMonConfig
+        result.merge(TrigCaloMonConfig(inputFlags))
 
     if inputFlags.DQ.Steering.HLT.doEgamma:
         from TrigEgammaMonitoring.TrigEgammaMonitorAlgorithm import TrigEgammaMonConfig
         result.merge(TrigEgammaMonConfig(inputFlags))
 
-    if inputFlags.DQ.Steering.HLT.doMET:
-        from TrigMETMonitoring.TrigMETMonitorAlgorithm import TrigMETMonConfig
-        result.merge(TrigMETMonConfig(inputFlags))
-
     if inputFlags.DQ.Steering.HLT.doJet:
         from TrigJetMonitoring.TrigJetMonitorAlgorithm import TrigJetMonConfig
         result.merge(TrigJetMonConfig(inputFlags))
 
-    if inputFlags.DQ.Steering.HLT.doBjet:
-        from TrigBjetMonitoring.TrigBjetMonitorAlgorithm import TrigBjetMonConfig
-        result.merge(TrigBjetMonConfig(inputFlags))
+    if inputFlags.DQ.Steering.HLT.doMET:
+        from TrigMETMonitoring.TrigMETMonitorAlgorithm import TrigMETMonConfig
+        result.merge(TrigMETMonConfig(inputFlags))
 
-    if inputFlags.DQ.Steering.HLT.doCalo:
-        from TrigCaloMonitoring.TrigCaloMonitorAlgorithm import TrigCaloMonConfig
-        result.merge(TrigCaloMonConfig(inputFlags))
+    if inputFlags.DQ.Steering.HLT.doMinBias:
+        from TrigMinBiasMonitoring.TrigMinBiasMonitoringMT import TrigMinBias
+        result.merge(TrigMinBias(inputFlags))
 
     if inputFlags.DQ.Steering.HLT.doMuon:
         from TrigMuonMonitoringMT.TrigMuonMonitoringMTConfig import TrigMuonMonConfig
         result.merge(TrigMuonMonConfig(inputFlags))
 
-    if inputFlags.DQ.Steering.HLT.doBphys:
-        from TrigBphysMonitoring.TrigBphysMonitorAlgorithm import TrigBphysMonConfig
-        result.merge(TrigBphysMonConfig(inputFlags))
-        
-    if inputFlags.DQ.Steering.HLT.doMinBias:
-        from TrigMinBiasMonitoring.TrigMinBiasMonitoringMT import TrigMinBias
-        result.merge(TrigMinBias(inputFlags))
-
     if inputFlags.DQ.Steering.HLT.doTau:
         from TrigTauMonitoring.TrigTauMonitorAlgorithm import TrigTauMonConfig
         result.merge(TrigTauMonConfig(inputFlags))
 
     return result
 
-
-
-def TrigHLTMonConfig(inputFlags):
-    '''Function to configure general HLT algorithms in the monitoring system.'''
-
-    ################################
-    # HLT general monitoring
-
-
-    # The following class will make a sequence, configure algorithms, and link
-    # them to GenericMonitoringTools
-    from AthenaMonitoring import AthMonitorCfgHelper
-    helper = AthMonitorCfgHelper(inputFlags,'TrigHLTAthMonitorCfg')
-
-
-    ### STEP 2 ###
-    # Adding algorithms to the helper. 
-    # The added algorithm must exist as a .h file 
-
-    from AthenaConfiguration.ComponentFactory import CompFactory
-    #trigHLTMonAlg = helper.addAlgorithm(CompFactory.TrigHLTMonitorAlgorithm,'TrigHLTMonAlg')
-    cfgsvc = CompFactory.TrigConf.xAODConfigSvc('xAODConfigSvc')
-    helper.resobj.addService(cfgsvc)
-    trigHLTMonAlg = helper.addAlgorithm(CompFactory.TrigHLTMonitorAlgorithm,'TrigHLTMonAlg')
-    trigHLTMonAlg.TrigConfigSvc = cfgsvc
-
-
-
-    #signatureTrigHLTMonAlg = helper.addAlgorithm(CompFactory.TrigHLTMonitorAlgorithm,'SignatureTrigHLTMonAlg')
-
-
-    ### STEP 3 ###
-    # Edit properties of a algorithm
-    # Placeholder
-
-    ### STEP 4 ###
-    # Add a generic monitoring tool (a "group" in old language). 
-    hltGroup = helper.addGroup(
-        trigHLTMonAlg,
-        'TrigHLTMonitor',
-        'HLT/ResultMon/'
-    )
-
-    # Add a GMT for the other example monitor algorithm
-    #signatureGroup = helper.addGroup(signatureTrigHLTMonAlg,'TrigHLTMonitor','HLT/ResultMon/')
-
-    ### STEP 5 ###
-    # Configure histograms
-    #NB! The histograms defined here must match the ones in the cxx file exactly
-    
-    hltGroup.defineHistogram('HLTResultHLT', title='HLT Result PLACEHOLDER;result;Events',
-                            path='',xbins=3,xmin=0,xmax=3)
-
-    consistency_names=['SMK DB NULL','SMK BS NULL','SMK Inconsistent','HLT Prescale DB NULL','HLT Prescale BS NULL','HLT Prescale Inconsistent','No HLTResult']
-    hltGroup.defineHistogram('ConfigConsistency_HLT', title='ConfigConsistency_HLT;;Events',
-                             path='',xbins=7,xmin=1,xmax=8,xlabels=consistency_names)
-
-    hltGroup.defineHistogram('placeholder_hlt',title='Placeholder;X;Y',
-                                  path='AllChains',xbins=1000000,xmin=-0.5,xmax=999999.5)
-
-    #Summary histograms for the signatures
-    hltGroup.defineHistogram('placeholder_ele',title='Placeholder;X;Y',
-                                  path='Electrons',xbins=1000000,xmin=-0.5,xmax=999999.5)
-
-    ### STEP 6 ###
-    # Finalize. 
-    return helper.result()
-    
-
-if __name__=='__main__':
-    # Setup the Run III behavior
-    from AthenaCommon.Configurable import Configurable
-    Configurable.configurableRun3Behavior = 1
-
-    # Setup logs
-    from AthenaCommon.Logging import log
-    from AthenaCommon.Constants import DEBUG
-    log.setLevel(DEBUG)
-
-    # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'TrigHLTMonitorOutput.root'
-    
-    ConfigFlags.lock()
-
-    # Initialize configuration object, add accumulator, merge, and run.
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
-    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
-
-    trigHLTMonitorAcc = TrigHLTMonConfig(ConfigFlags)
-    cfg.merge(trigHLTMonitorAcc)
-
-    # If you want to turn on more detailed messages ...
-    #trigHLTMonitorAcc.getEventAlgo('TrigHLTMonAlg').OutputLevel = 2 # DEBUG
-    cfg.printConfig(withDetails=True) # set True for exhaustive info
-
-    cfg.run() #use cfg.run(20) to only run on first 20 events
-
diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.cxx
index fcaffe752b88..051c8b4cf780 100644
--- a/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.cxx
@@ -4,9 +4,12 @@
 
 #include "TrigHLTMonitorAlgorithm.h"
 
+using namespace TrigCompositeUtils;
+
 TrigHLTMonitorAlgorithm::TrigHLTMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
   : AthMonitorAlgorithm(name,pSvcLocator)
   , m_trigDecTool("Trig::TrigDecisionTool/TrigDecisionTool") 
+
 {
 }
 
@@ -28,27 +31,98 @@ StatusCode TrigHLTMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co
   using namespace Monitored;
   StatusCode sc = StatusCode::FAILURE;
 
-  ////////////////////////////////////
-  // Chain monitoring
+  auto tool = getGroup("TrigHLTMonitor");
 
+  ////////////////////////////////////////
   // Declare the quantities which should be monitored
-  //NB! The variables and histograms defined here must match the ones in the py file exactly!
-  auto placeholder_ele = Monitored::Scalar<int>("placeholder_ele",0);
-  auto placeholder_hlt = Monitored::Scalar<int>("placeholder_hlt",0);
-  
-  //// Set the values of the monitored variables for the event		
-  placeholder_ele = GetEventInfo(ctx)->runNumber(); //DUMMY; to be updated.
-  placeholder_hlt = GetEventInfo(ctx)->runNumber(); //DUMMY; to be updated.
-  
+  // NB! The variables and histograms defined here must match the ones in the py file exactly!
+
+  auto HLT_ElectronsRAW = Monitored::Scalar<int>("HLT_ElectronsRAW",0);
+  auto HLT_AllChainsRAW = Monitored::Scalar<std::string>("HLT_AllChainsRAW");
+  auto L1Events = Monitored::Scalar<std::string>("L1Events");
+
+
+  ////////////////////////////////////
+  // L1 items monitoring
+
+  std::vector<std::string> L1items = m_trigDecTool->getChainGroup("L1_.*")->getListOfTriggers();
+  unsigned int nL1Items = L1items.size();
+
   // Fill. First argument is the tool (GMT) name as defined in the py file, 
   // all others are the variables to be saved.
   // Alternative fill method. Get the group yourself, and pass it to the fill function.
-  auto tool = getGroup("TrigHLTMonitor");
-  
-  fill(tool,placeholder_hlt);
-  fill(tool,placeholder_ele);
-  
+
+  ATH_MSG_INFO("Filling L1Events histogram");
+  for(unsigned int it=0; it<nL1Items; ++it) {
+    if( L1items[it] != "" ) {
+      
+      ATH_MSG_DEBUG("L1Item " << it << " " << L1items << m_trigDecTool->isPassed(L1items[it]));
+      if(m_trigDecTool->isPassed(L1items[it])) {
+	
+	/// Fill L1 histogram
+	L1Events = L1items[it];
+	ATH_MSG_DEBUG("L1Chain " << it << L1items[it]  << " is passed");
+	fill(tool,L1Events);
+      }
+    }
+  }
+
+
+  ////////////////////////////////////
+  // HLT chain monitoring
+
+  //// Set the values of the monitored variables for the event		
+  HLT_ElectronsRAW = GetEventInfo(ctx)->runNumber(); //DUMMY; to be updated.
+
+  ATH_MSG_INFO( "Filling HLT_AllChains and RoI information" );
+  std::vector< std::string > chainNames = m_trigDecTool->getChainGroup("HLT_.*")->getListOfTriggers();
+  unsigned int nHLTChains = chainNames.size();
+
+  for(unsigned int ith=0; ith<nHLTChains; ++ith) {
+    if( chainNames[ith] != "" ) {
+
+      ATH_MSG_DEBUG("HLTChain " << ith << " " << chainNames << m_trigDecTool->isPassed(chainNames[ith]));
+      if(m_trigDecTool->isPassed(chainNames[ith])) {
+	ATH_MSG_DEBUG( "    Chain " << chainNames[ith] << " IS passed");
+
+	/// Fill plain chains histogram
+	HLT_AllChainsRAW = chainNames[ith];
+	ATH_MSG_DEBUG( "Fill HLT_AllChainsRAW" ); // with " << HLT_AllChainsRAW );
+	fill(tool,HLT_AllChainsRAW);
+	
+	/// Fill RoIs histogram
+	ATH_MSG_DEBUG("Fill RoI histograms for chain " << chainNames[ith] );
+	std::vector<LinkInfo<TrigRoiDescriptorCollection>> fvec = m_trigDecTool->features<TrigRoiDescriptorCollection>(chainNames[ith], TrigDefs::Physics, "", TrigDefs::lastFeatureOfType, "initialRoI"); //initialRoiString()
+
+	//Loop over RoIs
+	for (const LinkInfo<TrigRoiDescriptorCollection>& li : fvec) {
+
+	  if( li.isValid() ) {
+	    auto phi = Monitored::Scalar("phi", 0.0);
+	    auto eta = Monitored::Scalar("eta", 0.0);
+	    auto HLT_AllChainsRoIs = Monitored::Group(tool, eta, phi); //filled when going out of scope
+
+	    const TrigRoiDescriptor* roi = *(li.link).cptr();
+    	    eta = roi->eta();
+	    phi = roi->phi();
+	    ATH_MSG_DEBUG( "RoI: eta = " << eta << ", phi = " << phi ); 
+	  }
+
+	  else {
+	    ATH_MSG_WARNING( "TrigRoiDescriptorCollection for chain " << chainNames[ith] << " is not valid");
+	  }
+
+	}//end for (const LinkInfo<TrigRoiDescriptorCollection>& li : fvec)
+      }// end if(m_trigDecTool->isPassed(chainNames[ith]))
+    }// end if( chainNames[ith] != "" )
+  }//end for(unsigned int ith=0; ith<nHLTChains; ++ith)
+
+
+  //Placeholder   
+  ATH_MSG_DEBUG( "Fill HLT_ElectronsRAW with " << HLT_ElectronsRAW );
+  fill(tool,HLT_ElectronsRAW);
   
+
   //////////////////////////////////////
   // HLTResult and ConfigConsistency
   
@@ -57,11 +131,13 @@ StatusCode TrigHLTMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co
   
   //////////////////////////////////////
   // End
+  ATH_MSG_INFO( "Finalizing the TrigHLTMonitorAlgorithm..." );
   return StatusCode::SUCCESS;
 }
 
 
 StatusCode TrigHLTMonitorAlgorithm::fillResultAndConsistencyHistograms( const EventContext& ctx ) const {
+
   using namespace Monitored;
   StatusCode sc_trigDec = StatusCode::FAILURE; 
   StatusCode sc_hltResult = StatusCode::FAILURE; 
@@ -77,9 +153,6 @@ StatusCode TrigHLTMonitorAlgorithm::fillResultAndConsistencyHistograms( const Ev
   //////////////////////////////////////
   // HLTResult and ConfigConsistency
 
-  //Use the m_trigConfigSvc rather than the m_configTool. You should remove the m_configTool.
-  //But use the TrigConf::xAODConfigSvc rather than the old TrigConf::TrigConfigSvc/TrigConfigSvc
-    
   uint32_t bskeys_1 = 9999; uint32_t bskeys_2 = 9999;
   HLTResultHLT = 1; //DUMMY; to be updated.
   sc_hltResult = StatusCode::FAILURE; //no HLTResult yet
@@ -99,7 +172,9 @@ StatusCode TrigHLTMonitorAlgorithm::fillResultAndConsistencyHistograms( const Ev
   }
   else {
     //For now, this will always happen    
-    ATH_MSG_WARNING("No HLTResult found"); //Prints a warning message in the log file
+    ATH_MSG_INFO("No HLTResult monitored (because it has not been implemented yet)");
+    //FIXME: When the HLTResult IS implemented this should be a WARNING // ebergeas Sept 2020
+    //ATH_MSG_WARNING("No HLTResult found"); //Prints a warning message in the log file
     ConfigConsistency_HLT=7;
     fill(tool,ConfigConsistency_HLT); //Fills the warning bin in the ConfigConsistency histogram
     bskeys_1 = 0;
@@ -108,7 +183,6 @@ StatusCode TrigHLTMonitorAlgorithm::fillResultAndConsistencyHistograms( const Ev
 
   }
 
-  
   uint32_t bskeys[] = {bskeys_1, bskeys_2};
   uint32_t dbkeys[2];
   dbkeys[0]=m_trigConfigSvc->masterKey();
@@ -133,7 +207,6 @@ StatusCode TrigHLTMonitorAlgorithm::fillResultAndConsistencyHistograms( const Ev
     } 
   }
     
-
   fill(tool,HLTResultHLT);
 
   return StatusCode::SUCCESS;
diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.h
index c8ae56432f36..2b5ea0b571d7 100644
--- a/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.h
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.h
@@ -5,11 +5,17 @@
 #ifndef TRIGHLTMONITORING_TRIGHLTMONITORALGORITHM_H
 #define TRIGHLTMONITORING_TRIGHLTMONITORALGORITHM_H
 
+#include <set>
+#include <string>
+#include <vector>
+
 #include "AthenaMonitoring/AthMonitorAlgorithm.h"
 #include "AthenaMonitoringKernel/Monitored.h"
 
 #include "TrigSteeringEvent/HLTResultMT.h"   
 #include "StoreGate/ReadHandleKey.h"
+#include "TrigSteeringEvent/TrigRoiDescriptor.h"
+#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
 
 class TrigHLTMonitorAlgorithm : public AthMonitorAlgorithm {
  public:
-- 
GitLab