diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopEventReconstructionTools/util/topreco_test_mt2.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopEventReconstructionTools/util/topreco_test_mt2.cxx
deleted file mode 100644
index 144400c36be3808f79750da0e0fdc348b02c9e78..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopEventReconstructionTools/util/topreco_test_mt2.cxx
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include <iostream>
-
-//#include "RootCore/Packages.h"
-
-#ifdef ROOTCORE_PACKAGE_Oxbridgekinetics
-#include "Mt2/Basic_Mt2_332_Calculator.h"
-#include "Mt2/Mt2TwoVector.h"
-#include "Mt2/Mt2LorentzVector.h"
-#include "Mt2/Mt2LorentzTransverseVector.h"
-#endif
-
-int main() {
-#ifndef ROOTCORE_PACKAGE_Oxbridgekinetics
-  std::cout << "Oxbridgekinetics library not found when compiling" << std::endl;
-#else
-  std::cout << "Starting top mt2 test\n";
-  Mt2::LorentzTransverseVector a;
-  Mt2::LorentzTransverseVector b;
-  Mt2::TwoVector c;
-  double d = 0.;
-
-  Mt2::Basic_Mt2_332_Calculator mt2Calculator;
-  const double mt2 = mt2Calculator.mt2_332(a, b, c, d);
-
-  std::cout << "mt2 " << mt2 << std::endl;
-  std::cout << "Ending\n";
-#endif
-
-  return 0;
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/CMakeLists.txt b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/CMakeLists.txt
index a21d9da1fc371573cef4cbe7e81bfa856ac73f3b..f059f7ca7c398c76fc400824e83da8a7e3825b86 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/CMakeLists.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/CMakeLists.txt
@@ -3,35 +3,9 @@
 # Declare the name of this package:
 atlas_subdir( TopExamples )
 
+# This package uses ROOT:
 find_package( ROOT REQUIRED COMPONENTS Core Hist RIO Tree )
 
-# Build a library that other components can link against:
-atlas_add_library( TopExamples Root/*.cxx Root/*.h Root/*.icc
-                   TopExamples/*.h TopExamples/*.icc TopExamples/*/*.h
-                   TopExamples/*/*.icc 
-                   PUBLIC_HEADERS TopExamples
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES AsgTools
-                                  TopAnalysis
-                                  TopCPTools
-                                  TopCorrections
-                                  TopEvent
-                                  TopEventReconstructionTools
-                                  TopEventSelectionTools
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES}
-                                          PathResolver
-                                          TopConfiguration
-                                          TopDataPreparation
-                                          xAODBTagging
-                                          xAODEgamma
-                                          xAODEventInfo
-                                          xAODJet
-                                          xAODMissingET
-                                          xAODMuon
-                                          xAODRootAccess
-                                          xAODTau
-                                          xAODTruth )
-
 # Install the Python modules of the package:
 atlas_install_python_modules( python/*.py )
 
@@ -39,36 +13,6 @@ atlas_install_python_modules( python/*.py )
 atlas_install_data( share/* )
 
 # Build the executables of the package:
-atlas_add_executable( mini-to-flat
-                      util/mini-to-flat.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES}
-                                     TopAnalysis
-                                     TopConfiguration
-                                     TopEvent
-                                     TopExamples
-                                     xAODCore
-                                     xAODRootAccess )
-
-atlas_add_executable( mini-xaod
-                      util/mini-xaod.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES}
-                                     TopAnalysis
-                                     TopEvent
-                                     TopExamples
-                                     xAODCore
-                                     xAODRootAccess )
-
-atlas_add_executable( mini-to-plots
-                      util/mini-to-plots.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES}
-                                     TopAnalysis
-                                     TopEvent
-                                     TopExamples
-                                     xAODRootAccess )
-
 atlas_add_executable( combineATOutputs
                       util/combineATOutputs.cxx
                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/AnalysisTools.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/AnalysisTools.cxx
deleted file mode 100644
index 6f33a13f8361acdc2b9f63670e71b7917ee739d7..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/AnalysisTools.cxx
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include "TopExamples/AnalysisTools.h"
-#include "TopExamples/NoSelectionAnalysis.h"
-#include "TopExamples/LJetsAnalysis.h"
-#include "TopExamples/LJetsTtresAnalysis.h"
-#include "TopExamples/DileptonAnalysis.h"
-
-#include "TopEvent/Event.h"
-#include "TopEvent/EventTools.h"
-
-// PathResolver include(s):
-#include "PathResolver/PathResolver.h"
-
-#include "TopDataPreparation/SampleXsection.h"
-
-#include "xAODRootAccess/TEvent.h"
-
-#include "xAODEventInfo/EventInfo.h"
-
-#include "TH1D.h"
-#include "TFile.h"
-
-#include <iostream>
-#include <memory>
-
-namespace top {
-  std::unique_ptr<top::AnalysisBase> loadAnalysis(const std::string& name, TFile* outputFile, EL::Worker* wk) {
-    if (name == "Dilepton") return std::unique_ptr<top::AnalysisBase>(new top::DileptonAnalysis(outputFile, wk));
-    else if (name == "LJets") return std::unique_ptr<top::AnalysisBase>(new top::LJetsAnalysis(outputFile, wk));
-    else if (name ==
-             "NoSelection") return std::unique_ptr<top::AnalysisBase>(new top::NoSelectionAnalysis(outputFile, wk));
-    else if (name == "LJetsTtres") return std::unique_ptr<top::AnalysisBase>(new top::LJetsTtresAnalysis(outputFile));
-    else {
-      std::cout << "I only know about:\n";
-      std::cout << "NoSelection\n";
-      std::cout << "LJets\n";
-      std::cout << "Dilepton\n";
-      std::cout << "LJetsTtres\n";
-      exit(1);
-    }
-
-    //make sure this never happens with the if statement above
-    return nullptr;
-  }
-
-  const std::string getSampleNumberAsString(const std::string& filename, const std::string& infoContainerName) {
-    xAOD::TEvent xaodEvent(xAOD::TEvent::kBranchAccess);
-    std::unique_ptr<TFile> fileForSampleNumber(TFile::Open(filename.c_str()));
-    top::check(xaodEvent.readFrom(fileForSampleNumber.get()), "xAOD::TEvent readFrom failed");
-    xaodEvent.getEntry(0);
-
-    const xAOD::EventInfo* info(0);
-    if (!xaodEvent.retrieve(info,
-                            infoContainerName)) throw std::string("xAOD::TEvent couldn't get hold of ") +
-            infoContainerName;
-
-    //data is padded with zero until it's 8 char long in ATLAS
-    std::stringstream ss;
-    ss << std::setw(8) << std::setfill('0') << info->runNumber();
-
-    //but MC simulation is not padded in dataset names :)
-    if (info->eventType(xAOD::EventInfo::IS_SIMULATION)) {
-      ss.str("");
-      ss << info->mcChannelNumber();
-    }
-
-    return ss.str();
-  }
-
-  double sfToOneInversefb(unsigned int mcChannelNumber, double mcWeightsInSample) {
-    //load the x-section from a file
-    SampleXsection tdp;
-
-//     const char* const rc = getenv("ROOTCOREBIN");
-//     std::string filename = std::string(rc) + "/data/TopDataPreparation/XSection-MC15-13TeV-fromSusyGrp.data";
-    std::string filename = PathResolverFindCalibFile("TopDataPreparation/XSection-MC15-13TeV-fromSusyGrp.data");
-    if (!tdp.readFromFile(filename.c_str())) {
-      std::cout << "TopDataPreparation - could not read file\n";
-      std::cout << filename << "\n";
-      std::cout << "Maybe check it exists, first?" << std::endl;
-      exit(1);
-    }
-
-    //calculate
-    double xsection = tdp.getXsection(mcChannelNumber);
-    if (xsection < 0) { // try exotics samples
-      //      std::string filenameExot = std::string(rc) + "/data/TopDataPreparation/XSection-MC12-8TeV-4gt.data";
-      //if (!tdp.readFromFile(filenameExot.c_str())) {
-      // do not exit since it is an Exotic sample and the file could not be there
-      //}
-      // xsection = tdp.getXsection(mcChannelNumber);
-    }
-    const double integratedluminosity = mcWeightsInSample / xsection;
-    const double sf = 1000. / integratedluminosity;
-
-    //useful information
-    std::cout << "mcChannelNumber           : " << mcChannelNumber << "\n";
-    std::cout << "X-section                 : " << xsection << " pb\n";
-    std::cout << "Sum weights before cuts   : " << mcWeightsInSample << "\n";
-    std::cout << "Integrated Lumi for sample: " << integratedluminosity << " pb-1\n";
-    std::cout << "Scale factor to 1 fb-1    : " << sf << "\n";
-
-    return sf;
-  }
-
-  void updateCutflow(const std::string& name, TH1D*& histogram, TFile* inputFile) {
-    const auto* const temp = dynamic_cast<TH1D*> (inputFile->Get(name.c_str()));
-
-    if (histogram == nullptr) {
-      histogram = dynamic_cast<TH1D*> (temp->Clone());
-      histogram->SetDirectory(0);
-    } else histogram->Add(temp);
-  }
-
-  std::string gridTagFromDirectoryName(const std::string inputFile) {
-    std::string gridTag = inputFile;
-
-    try {
-      gridTag.erase(gridTag.rfind("/"));
-      gridTag = gridTag.substr(gridTag.rfind("/") + 1);
-
-      for (int i = 0; i < 3; ++i)
-        gridTag = gridTag.erase(0, gridTag.find(".") + 1);
-
-      gridTag = gridTag.erase(gridTag.rfind("."));
-    } catch (...) {
-      gridTag = "unkown";
-    }
-
-    return gridTag;
-  }
-
-  bool passesPreSelection(const top::Event& topEvent, const std::string& name) {
-    return topEvent.m_info->auxdata<int>(name);
-  }
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/ContainerNames.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/ContainerNames.cxx
deleted file mode 100644
index 2c8e04577a9e1afef35b713d193eb960738d590d..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/ContainerNames.cxx
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include "TopExamples/ContainerNames.h"
-
-#include <ostream>
-
-std::ostream & operator << (std::ostream& os, const top::ContainerNames& names) {
-  os << "EventInfo           " << names.eventInfoName << "\n";
-  os << "ElectronCollection: " << names.electronCollectionName << "\n";
-  os << "MuonCollection:     " << names.muonCollectionName << "\n";
-  os << "JetCollection:      " << names.jetCollectionName << "\n";
-  os << "LargeJetCollection: " << names.largeJetCollectionName << "\n";
-  os << "MET:                " << names.metName << "\n";
-  os << "TauCollection:      " << names.tauCollectionName << "\n";
-  os << "TruthCollection:    " << names.truthCollectionName << "\n";
-
-  return os;
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/DefaultPlots.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/DefaultPlots.cxx
deleted file mode 100644
index d41c386afcff55acf9194037d0df0908ed42def2..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/DefaultPlots.cxx
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include "TopExamples/DefaultPlots.h"
-
-#include "TopEvent/Event.h"
-#include "TopEvent/EventTools.h"
-#include "TopEventSelectionTools/PlotManager.h"
-
-#include "TopCorrections/ScaleFactorRetriever.h"
-
-#include "xAODBTagging/BTaggingUtilities.h"
-
-#include <cmath>
-#include <array>
-
-#include "TH1.h"
-
-namespace top {
-  void addPlots(top::PlotManager& manager) {
-    manager.addHist("control_sig_njet", ";Number of selected jets;Events", 12, -0.5, 11.5);
-    manager.addHist("control_sig_met", ";E_{T}^{miss} [GeV];Events / 10 GeV", 22, 0, 220);
-    manager.addHist("control_met", ";E_{T}^{miss} [GeV];Events / 5 GeV", 45, 0, 225);
-    manager.addHist("control_njet", ";Number of selected jets;Events", 12, -0.5, 11.5);
-    manager.addHist("control_invmass", ";Invariant mass [GeV];Events / 5 GeV", 34, 15, 185);
-    manager.addHist("control_sig_invmass", ";Invariant mass [GeV];Events / 10 GeV", 40, 11, 411);
-    manager.addHist("control_sig_invmass_cut", ";Invariant mass [GeV];Events / 10 GeV", 40, 11, 411);
-    manager.addHist("dy_dphi", ";#Delta#phi;Events", 10, 0., M_PI);
-    manager.addHist("dy_dphi_zpt", ";Z p_{T} [GeV];Events", 30., 0., 300.);
-    manager.addHist("dy_counter", ";DD norm;Events", 5., 0., 5.);
-
-    manager.addHist("mu", ";<#mu>;Events", 50, 0., 50.);
-    manager.addHist("mc_weight", ";MC Event Weight", 100, -1.5, 5e6);
-
-    manager.addHist("pileup_weight", ";Pileup Weight", 20, -1.5, 10);
-
-    manager.addHist("el_n", ";Number of electrons;Events", 5, -0.5, 4.5);
-    manager.addHist("el_pt", ";Electron p_{T} / GeV;Electrons / 10 GeV", 20, 5, 205);
-    manager.addHist("el_eta", ";Electron #eta;Electrons", 20, -2.5, 2.5);
-    manager.addHist("el_phi", ";Electron #phi;Electrons", 20, -M_PI, M_PI);
-    manager.addHist("el_e", ";Electron E / GeV;Electrons", 40, 0, 200);
-    manager.addHist("el_m", ";Electron m / GeV;Electrons", 40, 0, 200);
-    manager.addHist("el_charge", ";Electron charge;Electrons", 2, -1.5, 1.5);
-
-    manager.addHist("mu_n", ";Number of muons;Events", 5, -0.5, 4.5);
-    manager.addHist("mu_pt", ";Muon p_{T} / GeV;Muons / 10 GeV", 20, 5, 205);
-    manager.addHist("mu_eta", ";Muon #eta;Muons", 20, -2.5, 2.5);
-    manager.addHist("mu_phi", ";Muon #phi;Muons", 20, -M_PI, M_PI);
-    manager.addHist("mu_e", ";Muon E / GeV;Muons", 40, 0, 200);
-    manager.addHist("mu_m", ";Muon m / GeV;Muons", 40, 0, 200);
-    manager.addHist("mu_charge", ";Muon charge;Muons", 2, -1.5, 1.5);
-
-    manager.addHist("jet_n", ";Number of jets;Events", 12, -0.5, 11.5);
-    manager.addHist("jet_pt", ";Jet p_{T} / GeV;Jets / 10 GeV", 25, 5, 255);
-    manager.addHist("jet_eta", ";Jet #eta;Jets", 25, -2.5, 2.5);
-    manager.addHist("jet_phi", ";Jet #phi;Jets", 25, -M_PI, M_PI);
-    manager.addHist("jet_e", ";Jet E / GeV;Jets", 50, 0, 250);
-    manager.addHist("jet_mv2c10", ";Jet mv2c10;Jets", 50, 0, 1);
-
-    manager.addHist("jet0_pt", ";Jet0 p_{T} / GeV; Events / 10 GeV", 25, 5, 255);
-    manager.addHist("jet0_eta", ";Jet0 #eta; Jets", 25, -2.5, 2.5);
-    manager.addHist("jet0_phi", ";Jet0 #phi; Jets", 25, -M_PI, M_PI);
-    manager.addHist("jet0_e", ";Jet0 E / GeV; Jets", 50, 0, 250);
-    manager.addHist("jet0_mv2c10", ";Jet0 mv2c10; Jets", 50, 0, 1);
-
-    manager.addHist("jet1_pt", ";Jet1 p_{T} / GeV; Events / 10 GeV", 25, 5, 255);
-    manager.addHist("jet1_eta", ";Jet1 #eta; Jets", 25, -2.5, 2.5);
-    manager.addHist("jet1_phi", ";Jet1 #phi; Jets", 25, -M_PI, M_PI);
-    manager.addHist("jet1_e", ";Jet1 E / GeV; Jets", 50, 0, 250);
-    manager.addHist("jet1_mv2c10", ";Jet1 mv2c10; Jets", 50, 0, 1);
-
-    manager.addHist("jet2_pt", ";Jet2 p_{T} / GeV; Events / 10 GeV", 25, 5, 255);
-    manager.addHist("jet2_eta", ";Jet2 #eta; Jets", 25, -2.5, 2.5);
-    manager.addHist("jet2_phi", ";Jet2 #phi; Jets", 25, -M_PI, M_PI);
-    manager.addHist("jet2_e", ";Jet2 E / GeV; Jets", 50, 0, 250);
-    manager.addHist("jet2_mv2c10", ";Jet2 mv2c10; Jets", 50, 0, 1);
-
-    manager.addHist("jet3_pt", ";Jet3 p_{T} / GeV; Events / 10 GeV", 25, 5, 255);
-    manager.addHist("jet3_eta", ";Jet3 #eta; Jets", 25, -2.5, 2.5);
-    manager.addHist("jet3_phi", ";Jet3 #phi; Jets", 25, -M_PI, M_PI);
-    manager.addHist("jet3_e", ";Jet3 E / GeV; Jets", 50, 0, 250);
-    manager.addHist("jet3_mv2c10", ";Jet3 mv2c10; Jets", 50, 0, 1);
-
-    manager.addHist("met_et", ";MET / GeV;Events / 5 GeV", 40, 0, 200);
-    manager.addHist("met_phi", ";MET #phi;Events", 40, -M_PI, M_PI);
-  }
-
-  void fillPlots(const top::Event& topEvent, top::PlotManager& manager, double eventWeight) {
-    const double toGeV = 0.001;
-
-    manager.hist("mu")->Fill(topEvent.m_info->averageInteractionsPerCrossing(), eventWeight);
-
-    if (top::isSimulation(topEvent)) {
-      manager.hist("mc_weight")->Fill(topEvent.m_info->auxdataConst<float>("AnalysisTop_eventWeight"));
-
-      if (top::ScaleFactorRetriever::hasPileupSF(topEvent)) manager.hist("pileup_weight")->Fill(top::ScaleFactorRetriever::pileupSF(
-                                                                                                  topEvent),
-                                                                                                eventWeight);
-    }
-
-    manager.hist("el_n")->Fill(topEvent.m_electrons.size(), eventWeight);
-    manager.hist("mu_n")->Fill(topEvent.m_muons.size(), eventWeight);
-    manager.hist("jet_n")->Fill(topEvent.m_jets.size(), eventWeight);
-
-    //loop over all the electrons - new for loop style is cool
-    for (const auto* const elPtr : topEvent.m_electrons) {
-      manager.hist("el_pt")->Fill(elPtr->pt() * toGeV, eventWeight);
-      manager.hist("el_eta")->Fill(elPtr->eta(), eventWeight);
-      manager.hist("el_phi")->Fill(elPtr->phi(), eventWeight);
-      manager.hist("el_e")->Fill(elPtr->e() * toGeV, eventWeight);
-      manager.hist("el_m")->Fill(elPtr->m() * toGeV, eventWeight);
-      manager.hist("el_charge")->Fill(elPtr->charge(), eventWeight);
-    }
-
-    for (const auto* const muPtr : topEvent.m_muons) {
-      manager.hist("mu_pt")->Fill(muPtr->pt() * toGeV, eventWeight);
-      manager.hist("mu_eta")->Fill(muPtr->eta(), eventWeight);
-      manager.hist("mu_phi")->Fill(muPtr->phi(), eventWeight);
-      manager.hist("mu_e")->Fill(muPtr->e() * toGeV, eventWeight);
-      manager.hist("mu_m")->Fill(muPtr->m() * toGeV, eventWeight);
-      manager.hist("mu_charge")->Fill(muPtr->charge(), eventWeight);
-    }
-
-    //plot for all jets, and also the four leading jets separately
-    unsigned int i = 0;
-    std::array<std::string, 4> numbers {{
-                                          "jet0", "jet1", "jet2", "jet3"
-                                        }};
-    for (const auto* const jetPtr : topEvent.m_jets) {
-      manager.hist("jet_pt")->Fill(jetPtr->pt() * toGeV, eventWeight);
-      manager.hist("jet_eta")->Fill(jetPtr->eta(), eventWeight);
-      manager.hist("jet_phi")->Fill(jetPtr->phi(), eventWeight);
-      manager.hist("jet_e")->Fill(jetPtr->e() * toGeV, eventWeight);
-
-      double mv2c10_discriminant = 0.;
-      xAOD::BTaggingUtilities::getBTagging(*jetPtr)->MVx_discriminant("MV2c10", mv2c10_discriminant);
-
-      manager.hist("jet_mv2c10")->Fill(mv2c10_discriminant, eventWeight);
-
-      if (i < numbers.size()) {
-        manager.hist(numbers[i] + "_pt")->Fill(jetPtr->pt() * toGeV, eventWeight);
-        manager.hist(numbers[i] + "_eta")->Fill(jetPtr->eta(), eventWeight);
-        manager.hist(numbers[i] + "_phi")->Fill(jetPtr->phi(), eventWeight);
-        manager.hist(numbers[i] + "_e")->Fill(jetPtr->e() * toGeV, eventWeight);
-        manager.hist(numbers[i] + "_mv2c10")->Fill(mv2c10_discriminant, eventWeight);
-      }
-
-      ++i;
-    }
-
-
-    manager.hist("met_et")->Fill(topEvent.m_met->met() * toGeV, eventWeight);
-    manager.hist("met_phi")->Fill(topEvent.m_met->phi(), eventWeight);
-  }
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/DileptonAnalysis.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/DileptonAnalysis.cxx
deleted file mode 100644
index fea19b10ea6ff292ac8b7993dfd3fd73e6611522..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/DileptonAnalysis.cxx
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include "TopExamples/DileptonAnalysis.h"
-#include "TopExamples/DefaultPlots.h"
-#include "TopExamples/AnalysisTools.h"
-
-#include "TopEvent/Event.h"
-#include "TopEvent/EventTools.h"
-
-#include "TFile.h"
-#include "TH1.h"
-
-#include <sstream>
-#include <iostream>
-#include <fstream>
-
-namespace top {
-/**
- * @brief Setup the analysis, add some histograms.
- *
- * This sets up a histogram manager for each of the three channels (ee, mumu,
- * emu).  It also defaults the histograms used to save cutflows for each channel
- * and with / without weights to nullptr.  They are loaded from the input files.
- * Also three counters are set to 0 for the number of processed events.
- */
-  DileptonAnalysis::DileptonAnalysis(TFile* outputFile, EL::Worker* wk) :
-    m_mcChannelNumber(0),
-    m_runNumber(0),
-    m_histsElEl("ee", outputFile, wk),
-    m_histsMuMu("mumu", outputFile, wk),
-    m_histsElMu("emu", outputFile, wk),
-    m_cutflowEventsElEl(nullptr),
-    m_cutflowMCWeightsElEl(nullptr),
-    m_cutflowEventsMuMu(nullptr),
-    m_cutflowMCWeightsMuMu(nullptr),
-    m_cutflowEventsElMu(nullptr),
-    m_cutflowMCWeightsElMu(nullptr),
-    m_counterElEl(0),
-    m_counterMuMu(0),
-    m_counterElMu(0) {
-    //add some default histograms for each channel
-    top::addPlots(m_histsElEl);
-    top::addPlots(m_histsMuMu);
-    top::addPlots(m_histsElMu);
-
-    //a special histogram for emu
-    m_histsElMu.addHist("ht", ";HT / GeV;Events / 20 GeV", 40, 0, 800);
-  }
-
-  DileptonAnalysis::~DileptonAnalysis() {
-  }
-
-/**
- * @brief When a new input file is opened we want to grab the cutflow histograms
- * from it and update.
- *
- * @param inputFile The file that was just opened.
- */
-  void DileptonAnalysis::newFile(TFile* inputFile) {
-    updateCutflow("ee/cutflow", m_cutflowEventsElEl, inputFile);
-    updateCutflow("ee/cutflow_mc", m_cutflowMCWeightsElEl, inputFile);
-    updateCutflow("mumu/cutflow", m_cutflowEventsMuMu, inputFile);
-    updateCutflow("mumu/cutflow_mc", m_cutflowMCWeightsMuMu, inputFile);
-    updateCutflow("emu/cutflow", m_cutflowEventsElMu, inputFile);
-    updateCutflow("emu/cutflow_mc", m_cutflowMCWeightsElMu, inputFile);
-  }
-
-/**
- * @brief Work out if it's ee, mumu or emu and send the event to the correct
- * analysis.
- *
- * Before filling any plots figure out if this is data or MC simulation and get
- * the event weight if appropriate.
- *
- * Use the number of electrons or muons to figure out which channel this
- * is.  Note that overlap removal and some of the cuts have been done already.
- *
- * @param topEvent The event in question
- */
-  void DileptonAnalysis::event(const top::Event& topEvent) {
-    m_runNumber = topEvent.m_info->runNumber();
-
-    double eventWeight = 1.;
-    if (top::isSimulation(topEvent)) {
-      m_mcChannelNumber = topEvent.m_info->mcChannelNumber();
-      eventWeight = topEvent.m_info->auxdataConst<float>("AnalysisTop_eventWeight");
-    }
-
-    //std::cout << topEvent << std::endl;
-
-    if (top::passesPreSelection(topEvent, "ee")) eeAnalysis(topEvent, eventWeight);
-
-    if (top::passesPreSelection(topEvent, "mumu")) mumuAnalysis(topEvent, eventWeight);
-
-    if (top::passesPreSelection(topEvent, "emu")) emuAnalysis(topEvent, eventWeight);
-  }
-
-/**
- * @brief Plot some control regions, then the final plots for the analysis.
- *
- * Most of the code here is spent defining different combinations of cuts for
- * the control plots.  The very last few lines make the plots in the signal
- * region.
- *
- * Note that for now we are manually calculating TLorentzVectors for the two
- * leptons, since this appears to be broken in the current xAOD code.
- *
- * @param topEvent The event to perform the analysis on.  We assume it has
- * exactly two electrons for the rest of this function.
- * @param eventWeight The event weight to be used when filling plots.
- */
-  void DileptonAnalysis::eeAnalysis(const top::Event& topEvent, double eventWeight) {
-    ++m_counterElEl;
-
-    const auto* e0 = topEvent.m_electrons[0];
-    const auto* e1 = topEvent.m_electrons[1];
-    const TLorentzVector Z = e0->p4() + e1->p4();
-
-    //does it pass some cuts?
-    const bool gteq2jets = topEvent.m_jets.size() >= 2;
-    const bool metgt30 = topEvent.m_met->met() > 30000.;
-    const bool metgt60 = topEvent.m_met->met() > 60000.;
-    const bool inZWindow = fabs(Z.M() - 91000.) < 10000.;
-
-    //plot the met for all events in the Z-window
-    if (inZWindow && gteq2jets) m_histsElEl.hist("control_met")->Fill(topEvent.m_met->met() * toGeV, eventWeight);
-
-    //plot the invariant mass for low MET events
-    if (!metgt60 && gteq2jets) m_histsElEl.hist("control_invmass")->Fill(Z.M() / 1000., eventWeight);
-
-    //plot njet in zwindow for low MET events
-    if (inZWindow && !metgt60) m_histsElEl.hist("control_njet")->Fill(topEvent.m_jets.size(), eventWeight);
-
-    //DY control region: inside Z window, but lower pt cut to signal region
-    if (inZWindow && metgt30 && gteq2jets) {
-      m_histsElEl.hist("dy_dphi")->Fill(fabs(top::deltaPhi(*e0, *e1)), eventWeight);
-      m_histsElEl.hist("dy_dphi_zpt")->Fill(Z.Pt() * toGeV, eventWeight);
-      m_histsElEl.hist("dy_counter")->Fill(1., eventWeight);
-    }
-
-    //signal region - all cuts except Z mass
-    if (gteq2jets && metgt60) m_histsElEl.hist("control_sig_invmass")->Fill(Z.M() * toGeV, eventWeight);
-
-    if (!inZWindow && gteq2jets &&
-        metgt60) m_histsElEl.hist("control_sig_invmass_cut")->Fill(Z.M() * toGeV, eventWeight);
-
-    //signal region - all cuts except njet
-    if (!inZWindow && metgt60) m_histsElEl.hist("control_sig_njet")->Fill(topEvent.m_jets.size(), eventWeight);
-
-    //signal region - all cuts except met
-    if (!inZWindow && gteq2jets) m_histsElEl.hist("control_sig_met")->Fill(topEvent.m_met->met() * toGeV, eventWeight);
-
-    //pretag selection
-    if (gteq2jets && !inZWindow && metgt60) top::fillPlots(topEvent, m_histsElEl, eventWeight);
-  }
-
-  void DileptonAnalysis::mumuAnalysis(const top::Event& topEvent, double eventWeight) {
-    ++m_counterMuMu;
-
-    const auto* mu0 = topEvent.m_muons[0];
-    const auto* mu1 = topEvent.m_muons[1];
-    const TLorentzVector Z = mu0->p4() + mu1->p4();
-
-    //does it pass some cuts?
-    const bool gteq2jets = topEvent.m_jets.size() >= 2;
-    const bool metgt30 = topEvent.m_met->met() > 30000.;
-    const bool metgt60 = topEvent.m_met->met() > 60000.;
-    const bool inZWindow = fabs(Z.M() - 91000.) < 10000.;
-
-    //plot the met for all events in the Z-window
-    if (inZWindow && gteq2jets) m_histsMuMu.hist("control_met")->Fill(topEvent.m_met->met() * toGeV, eventWeight);
-
-    //plot the invariant mass for low MET events
-    if (!metgt60 && gteq2jets) m_histsMuMu.hist("control_invmass")->Fill(Z.M() / 1000., eventWeight);
-
-    //plot njet in zwindow for low MET events
-    if (inZWindow && !metgt60) m_histsMuMu.hist("control_njet")->Fill(topEvent.m_jets.size(), eventWeight);
-
-    //DY control region: inside Z window, but lower pt cut to signal region
-    if (inZWindow && metgt30 && gteq2jets) {
-      m_histsMuMu.hist("dy_dphi")->Fill(fabs(top::deltaPhi(*mu0, *mu1)), eventWeight);
-      m_histsMuMu.hist("dy_dphi_zpt")->Fill(Z.Pt() * toGeV, eventWeight);
-      m_histsMuMu.hist("dy_counter")->Fill(1., eventWeight);
-    }
-
-    //signal region - all cuts except Z mass
-    if (gteq2jets && metgt60) m_histsMuMu.hist("control_sig_invmass")->Fill(Z.M() * toGeV, eventWeight);
-
-    if (!inZWindow && gteq2jets &&
-        metgt60) m_histsMuMu.hist("control_sig_invmass_cut")->Fill(Z.M() * toGeV, eventWeight);
-
-    //signal region - all cuts except njet
-    if (!inZWindow && metgt60) m_histsMuMu.hist("control_sig_njet")->Fill(topEvent.m_jets.size(), eventWeight);
-
-    //signal region - all cuts except met
-    if (!inZWindow && gteq2jets) m_histsMuMu.hist("control_sig_met")->Fill(topEvent.m_met->met() * toGeV, eventWeight);
-
-    //pretag selection
-    if (gteq2jets && !inZWindow && metgt60) top::fillPlots(topEvent, m_histsMuMu, eventWeight);
-  }
-
-/**
- * @brief emu channel
- *
- * The way it's setup at the moment we just need to add a cut on jet
- * multiplicity and ht to get a "full" set of pretag cuts.  Apply these
- * and then fill the plots.
- *
- * @param topEvent The event in question
- * @param eventWeight The weights that are used when filling the histograms.
- */
-  void DileptonAnalysis::emuAnalysis(const top::Event& topEvent, double eventWeight) {
-    ++m_counterElMu;
-
-    //does it pass some cuts?
-    const bool gteq2jets = topEvent.m_jets.size() >= 2;
-    const double ht = top::ht(topEvent);
-
-    if (gteq2jets && ht > 120. * toGeV) {
-      m_histsElMu.hist("ht")->Fill(ht * toGeV, eventWeight);
-      top::fillPlots(topEvent, m_histsElMu, eventWeight);
-    }
-  }
-
-/**
- * @brief Print cutflows for each of the three channels.  Save any histograms
- * that we've made. If running on MC simulation then normalise the histograms
- * to 1 fb-1.
- *
- * @param outputFile Root file to save the histograms to.
- */
-  void DileptonAnalysis::finalise(TFile* outputFile) {
-    //to screen
-    std::cout << "Cutflows directly from the input files:\n";
-    printCutflow(std::cout, m_cutflowEventsElEl, m_cutflowMCWeightsElEl, "ee", m_counterElEl);
-    printCutflow(std::cout, m_cutflowEventsMuMu, m_cutflowMCWeightsMuMu, "mumu", m_counterMuMu);
-    printCutflow(std::cout, m_cutflowEventsElMu, m_cutflowMCWeightsElMu, "emu", m_counterElMu);
-
-    //tofile - mc use channel number, data use run number
-    std::stringstream ss;
-    if (m_mcChannelNumber > 0) ss << m_mcChannelNumber;
-    else ss << m_runNumber;
-
-    std::ofstream cutflowfile_ee(ss.str() + "_ee_cutflow.txt");
-    std::ofstream cutflowfile_mumu(ss.str() + "_mumu_cutflow.txt");
-    std::ofstream cutflowfile_emu(ss.str() + "_emu_cutflow.txt");
-
-    printCutflow(cutflowfile_ee, m_cutflowEventsElEl, m_cutflowMCWeightsElEl, "ee", m_counterElEl);
-    printCutflow(cutflowfile_mumu, m_cutflowEventsMuMu, m_cutflowMCWeightsMuMu, "mumu", m_counterMuMu);
-    printCutflow(cutflowfile_emu, m_cutflowEventsElMu, m_cutflowMCWeightsElMu, "emu", m_counterElMu);
-
-    cutflowfile_ee.close();
-    cutflowfile_mumu.close();
-    cutflowfile_emu.close();
-
-    //if MC then calculate a SF to 1 fb-1
-    double sf = 1.;
-    if (m_mcChannelNumber != 0) {
-      const double mcWeightsInSample = m_cutflowMCWeightsElEl->GetBinContent(1);
-      sf = sfToOneInversefb(m_mcChannelNumber, mcWeightsInSample);
-    }
-
-    //save the plots for the three channels
-    m_histsElEl.scaleHistograms(sf);
-    m_histsMuMu.scaleHistograms(sf);
-    m_histsElMu.scaleHistograms(sf);
-    outputFile->Write();
-  }
-
-/**
- * @brief Prints the cutflow table to the screen or a file.  This is not scaled
- * to the integrated to 1fb-1 like the output histograms are for MC simulation.
- * Should it be?
- *
- * @param out For the screen use std::cout, for a text file use an ofstream, e.g.
- * std::ofstream file("myfile").
- * @param eventHist Histogram containing the raw event yield.  No weights. Also
- * used for the row headings / cut names. The numbers here come from the grid,
- * not from the local analysis code.
- * @param mcWeightHist Histogram containing yield weighted by the mc event
- * weight. The numbers here come from the grid/ input file, not from the local
- * analysis code.
- * @param name The name of the current selection (e.g. ee, mumu, emu)
- * @param localYield Yield that the local code ran over.  It should match the
- * number from the grid (since you ran on the same events).
- */
-  void DileptonAnalysis::printCutflow(std::ostream& out, const TH1D* const eventHist, const TH1D* const mcWeightHist,
-                                      const std::string& name, const unsigned int localYield) {
-    out << name << " cutflow:\n";
-    out << "    " <<
-      std::setw(4) << "Num" <<
-      std::setw(30) << "Name" <<
-      std::setw(20) << "Grid (Events)" <<
-      std::setw(20) << "Grid (MC Weights)" <<
-      std::setw(20) << "Local (Events)" << "\n";
-
-    for (int i = 1; i <= eventHist->GetNbinsX(); ++i) {
-      out << "    " << std::setw(4) << i
-          << std::setw(30) << eventHist->GetXaxis()->GetBinLabel(i)
-          << std::setw(20) << eventHist->GetBinContent(i)
-          << std::setw(20) << mcWeightHist->GetBinContent(i);
-
-      if (i == eventHist->GetNbinsX()) out << std::setw(20) << localYield;
-
-      out << "\n";
-    }
-
-    out << "\n";
-  }
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/EventLoaderDirect.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/EventLoaderDirect.cxx
deleted file mode 100644
index 96b7c4fc4089743ccd26f09245d86e1584429b57..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/EventLoaderDirect.cxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include "TopExamples/EventLoaderDirect.h"
-
-#include "TopEvent/EventTools.h"
-
-#include "xAODRootAccess/TEvent.h"
-#include "xAODEventInfo/EventInfo.h"
-#include "xAODEgamma/ElectronContainer.h"
-#include "xAODMuon/MuonContainer.h"
-#include "xAODJet/JetContainer.h"
-#include "xAODTau/TauJetContainer.h"
-#include "xAODMissingET/MissingETContainer.h"
-#include "xAODTruth/TruthParticleContainer.h"
-
-namespace top {
-  EventLoaderDirect::EventLoaderDirect(const ContainerNames& names) :
-    m_containerNames(names) {
-  }
-
-  EventLoaderDirect::~EventLoaderDirect() {
-  }
-
-  top::Event EventLoaderDirect::loadEvent(xAOD::TEvent& xaodEvent) {
-    top::Event te;
-
-    //EventInfo
-    top::check(xaodEvent.retrieve(te.m_info,
-                                  m_containerNames.eventInfoName),
-               "xAOD::TEvent retrieve failed to get " + m_containerNames.eventInfoName);
-
-    //Electrons
-    if (m_containerNames.electronCollectionName != "None") {
-      const xAOD::ElectronContainer* electrons(0);
-      top::check(xaodEvent.retrieve(electrons,
-                                    m_containerNames.electronCollectionName),
-                 "xAOD::TEvent retrieve failed to get " + m_containerNames.electronCollectionName);
-      te.m_electrons = *electrons;
-    }
-
-    //Muons
-    if (m_containerNames.muonCollectionName != "None") {
-      const xAOD::MuonContainer* muons(0);
-      top::check(xaodEvent.retrieve(muons,
-                                    m_containerNames.muonCollectionName),
-                 "xAOD::TEvent retrieve failed to get " + m_containerNames.muonCollectionName);
-      te.m_muons = *muons;
-    }
-
-    //Jets
-    if (m_containerNames.jetCollectionName != "None") {
-      const xAOD::JetContainer* jets(0);
-      top::check(xaodEvent.retrieve(jets,
-                                    m_containerNames.jetCollectionName),
-                 "xAOD::TEvent retrieve failed to get " + m_containerNames.jetCollectionName);
-      te.m_jets = *jets;
-    }
-
-    //LargeJets
-    if (m_containerNames.largeJetCollectionName != "None") {
-      const xAOD::JetContainer* largeJets(0);
-      top::check(xaodEvent.retrieve(largeJets,
-                                    m_containerNames.largeJetCollectionName),
-                 "xAOD::TEvent retrieve failed to get " + m_containerNames.largeJetCollectionName);
-      te.m_largeJets = *largeJets;
-    }
-
-    //Taus
-    if (m_containerNames.tauCollectionName != "None") {
-      const xAOD::TauJetContainer* taus(0);
-      top::check(xaodEvent.retrieve(taus,
-                                    m_containerNames.tauCollectionName),
-                 "xAOD::TEvent retrieve failed to get " + m_containerNames.tauCollectionName);
-      te.m_tauJets = *taus;
-    }
-
-    //MET
-    if (m_containerNames.metName != "None") {
-      const xAOD::MissingETContainer* mets(0);
-      check(xaodEvent.retrieve(mets,
-                               m_containerNames.metName),
-            "xAOD::TEvent retrieve failed to get " + m_containerNames.metName);
-      te.m_met = (*mets)[MissingETBase::Source::total()];
-    }
-
-    return te;
-  }
-
-  void EventLoaderDirect::print(std::ostream& os) const {
-    os << "EventLoaderDirect Configuration\n";
-    os << "No object corrections and no object selection\n";
-
-    os << "\n";
-    os << "Electron ContainerName: " << m_containerNames.electronCollectionName << "\n";
-    os << "Muon ContainerName: " << m_containerNames.muonCollectionName << "\n";
-    os << "Tau ContainerName: " << m_containerNames.tauCollectionName << "\n";
-    os << "Jet ContainerName: " << m_containerNames.jetCollectionName << "\n";
-    os << "LargeJet ContainerName: " << m_containerNames.largeJetCollectionName << "\n";
-    os << "MET ContainerName: " << m_containerNames.metName << "\n";
-  }
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/LJetsAnalysis.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/LJetsAnalysis.cxx
deleted file mode 100644
index f825145316f923c3de487244115a9292b850e0d5..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/LJetsAnalysis.cxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include "TopExamples/LJetsAnalysis.h"
-#include "TopExamples/DefaultPlots.h"
-#include "TopExamples/AnalysisTools.h"
-
-#include "TopEvent/Event.h"
-#include "TopEvent/EventTools.h"
-
-#include "TFile.h"
-#include "TH1.h"
-
-#include <sstream>
-#include <iostream>
-#include <fstream>
-
-namespace top {
-  LJetsAnalysis::LJetsAnalysis(TFile* outputFile, EL::Worker* wk) :
-    m_mcChannelNumber(0),
-    m_runNumber(0),
-    m_histsEl("ejets", outputFile, wk),
-    m_histsMu("mujets", outputFile, wk),
-    m_cutflowEventsEl(nullptr),
-    m_cutflowMCWeightsEl(nullptr),
-    m_cutflowEventsMu(nullptr),
-    m_cutflowMCWeightsMu(nullptr),
-    m_counterEl(0),
-    m_counterMu(0) {
-    //add some default histograms for each channel
-    top::addPlots(m_histsEl);
-    top::addPlots(m_histsMu);
-
-    //some extra histograms
-    m_histsEl.addHist("mwt", ";MWT [GeV];Events", 20, 0, 200);
-    m_histsMu.addHist("mwt", ";MWT [GeV];Events", 20, 0, 200);
-  }
-
-  LJetsAnalysis::~LJetsAnalysis() {
-  }
-
-  void LJetsAnalysis::newFile(TFile* inputFile) {
-    updateCutflow("ejets/cutflow", m_cutflowEventsEl, inputFile);
-    updateCutflow("ejets/cutflow_mc", m_cutflowMCWeightsEl, inputFile);
-    updateCutflow("mujets/cutflow", m_cutflowEventsMu, inputFile);
-    updateCutflow("mujets/cutflow_mc", m_cutflowMCWeightsMu, inputFile);
-  }
-
-  void LJetsAnalysis::event(const top::Event& topEvent) {
-    m_runNumber = topEvent.m_info->runNumber();
-
-    double eventWeight = 1.;
-    if (top::isSimulation(topEvent)) {
-      m_mcChannelNumber = topEvent.m_info->mcChannelNumber();
-      eventWeight = topEvent.m_info->auxdataConst<float>("AnalysisTop_eventWeight");
-    }
-
-    //std::cout << topEvent << std::endl;
-
-    if (top::passesPreSelection(topEvent, "ejets")) {
-      top::fillPlots(topEvent, m_histsEl, eventWeight);
-      const double mwt = top::mwt(*topEvent.m_electrons[0], *topEvent.m_met);
-      m_histsEl.hist("mwt")->Fill(mwt * top::toGeV, eventWeight);
-      ++m_counterEl;
-    }
-
-    if (top::passesPreSelection(topEvent, "mujets")) {
-      top::fillPlots(topEvent, m_histsMu, eventWeight);
-      const double mwt = top::mwt(*topEvent.m_muons[0], *topEvent.m_met);
-      m_histsMu.hist("mwt")->Fill(mwt * top::toGeV, eventWeight);
-      ++m_counterMu;
-    }
-  }
-
-  void LJetsAnalysis::finalise(TFile* outputFile) {
-    //to screen
-    std::cout << "Cutflows directly from the input files:\n";
-    printCutflow(std::cout, m_cutflowEventsEl, m_cutflowMCWeightsEl, "ejets", m_counterEl);
-    printCutflow(std::cout, m_cutflowEventsMu, m_cutflowMCWeightsMu, "mujets", m_counterMu);
-
-    //tofile - mc use channel number, data use run number
-    std::stringstream ss;
-    if (m_mcChannelNumber > 0) ss << m_mcChannelNumber;
-    else ss << m_runNumber;
-
-    std::ofstream cutflowfile_ejets(ss.str() + "_ejets_cutflow.txt");
-    std::ofstream cutflowfile_mujets(ss.str() + "_mujets_cutflow.txt");
-
-    printCutflow(cutflowfile_ejets, m_cutflowEventsEl, m_cutflowMCWeightsEl, "ejets", m_counterEl);
-    printCutflow(cutflowfile_mujets, m_cutflowEventsMu, m_cutflowMCWeightsMu, "mujets", m_counterMu);
-
-    cutflowfile_ejets.close();
-    cutflowfile_mujets.close();
-
-    //normalise to 1 fb-1 for MC simulation
-    double sf = 1.;
-    if (m_mcChannelNumber != 0) {
-      const double mcWeightsInSample = m_cutflowMCWeightsEl->GetBinContent(1);
-      sf = sfToOneInversefb(m_mcChannelNumber, mcWeightsInSample);
-    }
-
-    m_histsEl.scaleHistograms(sf);
-    m_histsMu.scaleHistograms(sf);
-    outputFile->Write();
-  }
-
-/**
- * @brief Prints the cutflow table to the screen or a file.  This is not scaled
- * to the integrated to 1fb-1 like the output histograms are for MC simulation.
- * Should it be?
- *
- * @param out For the screen use std::cout, for a text file use an ofstream, e.g.
- * std::ofstream file("myfile").
- * @param eventHist Histogram containing the raw event yield.  No weights. Also
- * used for the row headings / cut names. The numbers here come from the grid,
- * not from the local analysis code.
- * @param mcWeightHist Histogram containing yield weighted by the mc event
- * weight. The numbers here come from the grid/ input file, not from the local
- * analysis code.
- * @param name The name of the current selection (e.g. ee, mumu, emu)
- * @param localYield Yield that the local code ran over.  It should match the
- * number from the grid (since you ran on the same events).
- */
-  void LJetsAnalysis::printCutflow(std::ostream& out, const TH1D* const eventHist, const TH1D* const mcWeightHist,
-                                   const std::string& name, const unsigned int localYield) {
-    out << name << " cutflow:\n";
-    out << "    " <<
-      std::setw(4) << "Num" <<
-      std::setw(20) << "Name" <<
-      std::setw(20) << "Grid (Events)" <<
-      std::setw(20) << "Grid (MC Weights)" <<
-      std::setw(20) << "Local (Events)" << "\n";
-
-    for (int i = 1; i <= eventHist->GetNbinsX(); ++i) {
-      out << "    " << std::setw(4) << i
-          << std::setw(20) << eventHist->GetXaxis()->GetBinLabel(i)
-          << std::setw(20) << eventHist->GetBinContent(i)
-          << std::setw(20) << mcWeightHist->GetBinContent(i);
-
-      if (i == eventHist->GetNbinsX()) out << std::setw(20) << localYield;
-
-      out << "\n";
-    }
-
-    out << "\n";
-  }
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/LJetsTtresAnalysis.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/LJetsTtresAnalysis.cxx
deleted file mode 100644
index 00c2d3798b6f99c65bd02e364a387f76de778e70..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/LJetsTtresAnalysis.cxx
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include "TopExamples/LJetsTtresAnalysis.h"
-#include "TopExamples/DefaultPlots.h"
-#include "TopExamples/AnalysisTools.h"
-
-#include "TopEvent/Event.h"
-#include "TopEvent/EventTools.h"
-
-#include "xAODBTagging/BTaggingUtilities.h"
-
-#include "TFile.h"
-#include "TH1.h"
-
-#include <sstream>
-#include <iostream>
-
-#include "TopEventReconstructionTools/TtresNeutrinoBuilder.h"
-#include "TopEventReconstructionTools/TtresChi2.h"
-
-
-namespace top {
-  LJetsTtresAnalysis::LJetsTtresAnalysis(TFile* outputFile) :
-    m_mcChannelNumber(0),
-    m_histsREl("rejets", outputFile),
-    m_histsRMu("rmujets", outputFile),
-    m_histsBEl("bejets", outputFile),
-    m_histsBMu("bmujets", outputFile),
-    m_cutflowEventsREl(nullptr),
-    m_cutflowMCWeightsREl(nullptr),
-    m_cutflowEventsRMu(nullptr),
-    m_cutflowMCWeightsRMu(nullptr),
-    m_cutflowEventsBEl(nullptr),
-    m_cutflowMCWeightsBEl(nullptr),
-    m_cutflowEventsBMu(nullptr),
-    m_cutflowMCWeightsBMu(nullptr),
-    m_counterREl(0),
-    m_counterRMu(0),
-    m_counterBEl(0),
-    m_counterBMu(0),
-    m_neutrinoBuilder("MeV"),
-    m_chi2("MeV") {
-    //tell it to load AKT10
-    SetContainerNames()->largeJetCollectionName = "CorrectedSelectedAntiKt10LCTopoTrimmedPtFrac30SmallR5Jets"; // AntiKt10LCTopoTrimmedPtFrac30SmallR5Jets
-    //SetContainerNames()->largeJetCollectionName = "CorrectedSelectedAntiKt10LCTopoJets";
-    m_chi2.Init(TtresChi2::DATA2012SUMMER2013);
-
-    //add some default histograms for each channel
-    top::addPlots(m_histsREl);
-    top::addPlots(m_histsRMu);
-
-    top::addPlots(m_histsBEl);
-    top::addPlots(m_histsBMu);
-
-    //some extra histograms
-    m_histsREl.addHist("mwt", ";MWT [GeV];Events", 20, 0, 200);
-    m_histsRMu.addHist("mwt", ";MWT [GeV];Events", 20, 0, 200);
-
-    m_histsREl.addHist("met", ";MET [GeV];Events", 30, 0, 300);
-    m_histsRMu.addHist("met", ";MET [GeV];Events", 30, 0, 300);
-
-    m_histsREl.addHist("lep_pt", ";lepton p_{T} [GeV];Events", 50, 0, 500);
-    m_histsRMu.addHist("lep_pt", ";lepton p_{T} [GeV];Events", 50, 0, 500);
-    m_histsREl.addHist("lep_eta", ";lepton #eta ;Events", 40, -2.0, 2.0);
-    m_histsRMu.addHist("lep_eta", ";lepton #eta ;Events", 40, -2.0, 2.0);
-    m_histsREl.addHist("lep_phi", ";lepton #phi ;Events", 64, -3.2, 3.2);
-    m_histsRMu.addHist("lep_phi", ";lepton #phi ;Events", 64, -3.2, 3.2);
-
-    m_histsREl.addHist("overlap", ";Overlap boosted resolved ;Events", 3, -0.5, 2.5);
-    m_histsRMu.addHist("overlap", ";Overlap boosted resolved ;Events", 3, -0.5, 2.5);
-
-    m_histsBEl.addHist("mwt", ";MWT [GeV];Events", 20, 0, 200);
-    m_histsBMu.addHist("mwt", ";MWT [GeV];Events", 20, 0, 200);
-
-    m_histsBEl.addHist("met", ";MET [GeV];Events", 30, 0, 300);
-    m_histsBMu.addHist("met", ";MET [GeV];Events", 30, 0, 300);
-
-    m_histsBEl.addHist("lep_pt", ";lepton p_{T} [GeV];Events", 50, 0, 500);
-    m_histsBMu.addHist("lep_pt", ";lepton p_{T} [GeV];Events", 50, 0, 500);
-    m_histsBEl.addHist("lep_eta", ";lepton #eta ;Events", 40, -2.0, 2.0);
-    m_histsBMu.addHist("lep_eta", ";lepton #eta ;Events", 40, -2.0, 2.0);
-    m_histsBEl.addHist("lep_phi", ";lepton #phi ;Events", 64, -3.2, 3.2);
-    m_histsBMu.addHist("lep_phi", ";lepton #phi ;Events", 64, -3.2, 3.2);
-
-    m_histsBEl.addHist("overlap", ";Overlap boosted resolved ;Events", 3, -0.5, 2.5);
-    m_histsBMu.addHist("overlap", ";Overlap boosted resolved ;Events", 3, -0.5, 2.5);
-
-    m_histsBEl.addHist("ljet_pt", ";large-R jet p_{T} [GeV];Events", 50, 0, 500);
-    m_histsBMu.addHist("ljet_pt", ";large-R jet p_{T} [GeV];Events", 50, 0, 500);
-    m_histsBEl.addHist("ljet_m", ";large-R jet mass [GeV];Events", 30, 0, 300);
-    m_histsBMu.addHist("ljet_m", ";large-R jet mass [GeV];Events", 30, 0, 300);
-    m_histsBEl.addHist("ljet_eta", ";large-R jet #eta ;Events", 40, -2.0, 2.0);
-    m_histsBMu.addHist("ljet_eta", ";large-R jet #eta ;Events", 40, -2.0, 2.0);
-    m_histsBEl.addHist("ljet_phi", ";large-R jet #phi ;Events", 64, -3.2, 3.2);
-    m_histsBMu.addHist("ljet_phi", ";large-R jet #phi ;Events", 64, -3.2, 3.2);
-    m_histsBEl.addHist("ljet_sd12", ";large-R jet #sqrt{d_{12}} [GeV];Events", 10, 0, 100);
-    m_histsBMu.addHist("ljet_sd12", ";large-R jet #sqrt{d_{12}} [GeV];Events", 10, 0, 100);
-
-    m_histsBEl.addHist("ljetSel_pt", ";large-R jet p_{T} [GeV];Events", 50, 0, 500);
-    m_histsBMu.addHist("ljetSel_pt", ";large-R jet p_{T} [GeV];Events", 50, 0, 500);
-    m_histsBEl.addHist("ljetSel_m", ";large-R jet mass [GeV];Events", 30, 0, 300);
-    m_histsBMu.addHist("ljetSel_m", ";large-R jet mass [GeV];Events", 30, 0, 300);
-    m_histsBEl.addHist("ljetSel_eta", ";large-R jet #eta ;Events", 40, -2.0, 2.0);
-    m_histsBMu.addHist("ljetSel_eta", ";large-R jet #eta ;Events", 40, -2.0, 2.0);
-    m_histsBEl.addHist("ljetSel_phi", ";large-R jet #phi ;Events", 64, -3.2, 3.2);
-    m_histsBMu.addHist("ljetSel_phi", ";large-R jet #phi ;Events", 64, -3.2, 3.2);
-    m_histsBEl.addHist("ljetSel_sd12", ";large-R jet #sqrt{d_{12}} [GeV];Events", 10, 0, 100);
-    m_histsBMu.addHist("ljetSel_sd12", ";large-R jet #sqrt{d_{12}} [GeV];Events", 10, 0, 100);
-
-    m_histsREl.addHist("mtt", ";boosted m_{tt} [GeV];Events", 30, 0, 3000);
-    m_histsRMu.addHist("mtt", ";boosted m_{tt} [GeV];Events", 30, 0, 3000);
-
-    m_histsBEl.addHist("mtt", ";boosted m_{tt} [GeV];Events", 30, 0, 3000);
-    m_histsBMu.addHist("mtt", ";boosted m_{tt} [GeV];Events", 30, 0, 3000);
-  }
-
-  LJetsTtresAnalysis::~LJetsTtresAnalysis() {
-  }
-
-  void LJetsTtresAnalysis::newFile(TFile* inputFile) {
-    updateCutflow("rejets/cutflow", m_cutflowEventsREl, inputFile);
-    updateCutflow("rejets/cutflow_mc", m_cutflowMCWeightsREl, inputFile);
-    updateCutflow("rmujets/cutflow", m_cutflowEventsRMu, inputFile);
-    updateCutflow("rmujets/cutflow_mc", m_cutflowMCWeightsRMu, inputFile);
-    updateCutflow("bejets/cutflow", m_cutflowEventsBEl, inputFile);
-    updateCutflow("bejets/cutflow_mc", m_cutflowMCWeightsBEl, inputFile);
-    updateCutflow("bmujets/cutflow", m_cutflowEventsBMu, inputFile);
-    updateCutflow("bmujets/cutflow_mc", m_cutflowMCWeightsBMu, inputFile);
-  }
-
-  void LJetsTtresAnalysis::fillIt(top::PlotManager& hists, const top::Event& topEvent, bool isBoosted) {
-    double eventWeight = 1.;
-
-    if (top::isSimulation(topEvent)) {
-      m_mcChannelNumber = topEvent.m_info->mcChannelNumber();
-      eventWeight = topEvent.m_info->auxdataConst<float>("AnalysisTop_eventWeight");
-    }
-    top::fillPlots(topEvent, hists, eventWeight);
-
-    double mwt = -1;
-    if (topEvent.m_electrons.size() == 1) mwt = top::mwt(*topEvent.m_electrons[0], *topEvent.m_met);
-    if (topEvent.m_muons.size() == 1) mwt = top::mwt(*topEvent.m_muons[0], *topEvent.m_met);
-
-    hists.hist("mwt")->Fill(mwt * top::toGeV, eventWeight);
-    hists.hist("met")->Fill(topEvent.m_met->met() * top::toGeV, eventWeight);
-
-    TLorentzVector lepton;
-    if (topEvent.m_electrons.size() == 1) lepton.SetPtEtaPhiE(
-        topEvent.m_electrons[0]->pt(), topEvent.m_electrons[0]->eta(),
-        topEvent.m_electrons[0]->phi(), topEvent.m_electrons[0]->e());
-    if (topEvent.m_muons.size() == 1) lepton.SetPtEtaPhiE(topEvent.m_muons[0]->pt(),
-                                                          topEvent.m_muons[0]->eta(),
-                                                          topEvent.m_muons[0]->phi(), topEvent.m_muons[0]->e());
-
-    hists.hist("lep_pt")->Fill(lepton.Pt() * top::toGeV, eventWeight);
-    hists.hist("lep_eta")->Fill(lepton.Eta(), eventWeight);
-    hists.hist("lep_phi")->Fill(lepton.Phi(), eventWeight);
-
-    if (isBoosted) {
-      const xAOD::Jet* selJet = nullptr;
-      for (const auto* const jetPtr : topEvent.m_jets) {
-        if (jetPtr->auxdata<int>("closeToLepton") == 1) {
-          selJet = jetPtr;
-          break;
-        }
-      }
-
-      const xAOD::Jet* largeJet = nullptr;
-      for (const auto* const jetPtr : topEvent.m_largeJets) {
-        if (jetPtr->auxdata<int>("good") == 1) {
-          largeJet = jetPtr;
-          break;
-        }
-      }
-      if (largeJet != nullptr && selJet != nullptr) {
-        hists.hist("ljetSel_m")->Fill(largeJet->m() * top::toGeV, eventWeight);
-        double d12 = 0;
-        largeJet->getAttribute("Split12", d12);
-        hists.hist("ljetSel_sd12")->Fill(d12 * top::toGeV, eventWeight);
-        hists.hist("ljetSel_pt")->Fill(largeJet->pt() * top::toGeV, eventWeight);
-        hists.hist("ljetSel_eta")->Fill(largeJet->eta(), eventWeight);
-        hists.hist("ljetSel_phi")->Fill(largeJet->phi(), eventWeight);
-
-        TLorentzVector tt(0, 0, 0, 0);
-        tt += largeJet->p4();
-        tt += lepton;
-        tt += selJet->p4();
-        std::vector<TLorentzVector*> vec_nu = m_neutrinoBuilder.candidatesFromWMass_Rotation(&lepton,
-                                                                                             topEvent.m_met->met(),
-                                                                                             topEvent.m_met->phi(),
-                                                                                             true);
-        TLorentzVector nu(0, 0, 0, 0);
-        if (vec_nu.size() > 0) {
-          nu = *(vec_nu[0]);
-          for (size_t z = 0; z < vec_nu.size(); ++z) delete vec_nu[z];
-          vec_nu.clear();
-        }
-        tt += nu;
-
-        hists.hist("mtt")->Fill(tt.M() * top::toGeV, eventWeight);
-      }
-
-      if (topEvent.m_largeJets.size() > 0) {
-        hists.hist("ljet_m")->Fill(topEvent.m_largeJets[0]->m() * top::toGeV, eventWeight);
-        double d12 = 0;
-        topEvent.m_largeJets[0]->getAttribute("Split12", d12);
-        hists.hist("ljet_sd12")->Fill(d12 * top::toGeV, eventWeight);
-        hists.hist("ljet_pt")->Fill(topEvent.m_largeJets[0]->pt() * top::toGeV, eventWeight);
-        hists.hist("ljet_eta")->Fill(topEvent.m_largeJets[0]->eta(), eventWeight);
-        hists.hist("ljet_phi")->Fill(topEvent.m_largeJets[0]->phi(), eventWeight);
-      }
-    } else { // is resolved
-      // inputs
-      // LEPTON --> TLorentzVector for your lepton
-      // vjets -->  std::vector<TLorentzVector*> for the jets
-      // vjets_btagged --> std::vector<bool> to say if the jets are btagged or not
-      // met --> TLorentzVector for your MET
-
-      // outputs, they will be filled by the TTBarLeptonJetsBuilder_chi2
-      int igj3, igj4; // index for the Whad
-      int igb3, igb4; // index for the b's
-      int ign1;  // index for the neutrino (because chi2 can test both pz solution)
-      double chi2ming1, chi2ming1H, chi2ming1L;
-      std::vector<TLorentzVector*> vjets;
-      std::vector<bool> vjets_btagged;
-      for (size_t z = 0; z < topEvent.m_jets.size(); ++z) {
-        vjets.push_back(new TLorentzVector(0, 0, 0, 0));
-        vjets[z]->SetPtEtaPhiE(topEvent.m_jets[z]->pt(), topEvent.m_jets[z]->eta(),
-                               topEvent.m_jets[z]->phi(), topEvent.m_jets[z]->e());
-        const xAOD::BTagging* myBTag = xAOD::BTaggingUtilities::getBTagging(*topEvent.m_jets[z]);
-        // https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/BTagingxAODEDM
-        // https://twiki.cern.ch/twiki/bin/view/AtlasProtected/BTaggingBenchmarks
-        vjets_btagged.push_back(myBTag->SV1plusIP3D_discriminant() > 1.85); // best discriminant available for 8 TeV
-                                                                            // (cut at 70%)
-      }
-      TLorentzVector met(0, 0, 0, 0);
-      met.SetPtEtaPhiM(topEvent.m_met->met(), 0, topEvent.m_met->phi(), 0);
-      bool status = m_chi2.findMinChiSquare(&lepton, &vjets, &vjets_btagged, &met, igj3, igj4, igb3, igb4, ign1,
-                                            chi2ming1, chi2ming1H, chi2ming1L); // status has to be true
-
-      double mtt = -1;
-      if (status) mtt = m_chi2.getResult_Mtt();
-      hists.hist("mtt")->Fill(mtt * top::toGeV, eventWeight);
-      for (size_t z = 0; z < vjets.size(); ++z) {
-        delete vjets[z];
-      }
-      vjets.clear();
-      vjets_btagged.clear();
-    }
-  }
-
-  void LJetsTtresAnalysis::event(const top::Event& topEvent) {
-    double eventWeight = 1.;
-
-    if (top::isSimulation(topEvent)) {
-      m_mcChannelNumber = topEvent.m_info->mcChannelNumber();
-//         eventWeight = topEvent.m_info->mcEventWeight();
-      eventWeight = topEvent.m_truthEvent->at(0)->weights()[0];// FIXME temporary bugfix
-    }
-
-    int pass_rejets = top::passesPreSelection(topEvent, "rejets");
-    int pass_rmujets = top::passesPreSelection(topEvent, "rmujets");
-
-    int pass_bejets = top::passesPreSelection(topEvent, "bejets");
-    int pass_bmujets = top::passesPreSelection(topEvent, "bmujets");
-
-    if (pass_rejets) fillIt(m_histsREl, topEvent, false);
-    if (pass_rmujets) fillIt(m_histsRMu, topEvent, false);
-
-    if (pass_bejets) fillIt(m_histsBEl, topEvent, true);
-    if (pass_bmujets) fillIt(m_histsBMu, topEvent, true);
-
-    // fill overlap histogram with 1 if there is an overlap
-    // fill it with 0 for resolved only or 2 if it is boosted only
-    if (pass_rejets && pass_bejets) m_histsREl.hist("overlap")->Fill(1.0, eventWeight);
-
-    if (pass_rejets && !pass_bejets) m_histsREl.hist("overlap")->Fill(0.0, eventWeight);
-
-    if (!pass_rejets && pass_bejets) m_histsREl.hist("overlap")->Fill(2.0, eventWeight);
-
-    if (pass_rmujets && pass_bmujets) m_histsRMu.hist("overlap")->Fill(1.0, eventWeight);
-
-    if (pass_rmujets && !pass_bmujets) m_histsRMu.hist("overlap")->Fill(0.0, eventWeight);
-
-    if (!pass_rmujets && pass_bmujets) m_histsRMu.hist("overlap")->Fill(2.0, eventWeight);
-
-    if (pass_rejets && pass_bejets) m_histsBEl.hist("overlap")->Fill(1.0, eventWeight);
-
-    if (pass_rejets && !pass_bejets) m_histsBEl.hist("overlap")->Fill(0.0, eventWeight);
-
-    if (!pass_rejets && pass_bejets) m_histsBEl.hist("overlap")->Fill(2.0, eventWeight);
-
-    if (pass_rmujets && pass_bmujets) m_histsBMu.hist("overlap")->Fill(1.0, eventWeight);
-
-    if (pass_rmujets && !pass_bmujets) m_histsBMu.hist("overlap")->Fill(0.0, eventWeight);
-
-    if (!pass_rmujets && pass_bmujets) m_histsBMu.hist("overlap")->Fill(2.0, eventWeight);
-
-    if (pass_rejets) m_counterREl++;
-    if (pass_rmujets) m_counterRMu++;
-    if (pass_bejets) m_counterBEl++;
-    if (pass_bmujets) m_counterBMu++;
-  }
-
-  void LJetsTtresAnalysis::finalise(TFile* outputFile) {
-    std::cout << "Cutflows directly from the input files:\n";
-    printCutflow(m_cutflowEventsREl, m_cutflowMCWeightsREl, "rejets", m_counterREl);
-    printCutflow(m_cutflowEventsRMu, m_cutflowMCWeightsRMu, "rmujets", m_counterRMu);
-
-    printCutflow(m_cutflowEventsBEl, m_cutflowMCWeightsBEl, "bejets", m_counterBEl);
-    printCutflow(m_cutflowEventsBMu, m_cutflowMCWeightsBMu, "bmujets", m_counterBMu);
-
-    //normalise to 1 fb-1 for MC simulation
-    double sf = 1.;
-    if (m_mcChannelNumber != 0) {
-      const double mcWeightsInSample = m_cutflowMCWeightsREl->GetBinContent(1);
-      sf = sfToOneInversefb(m_mcChannelNumber, mcWeightsInSample);
-    }
-
-    m_histsREl.scaleHistograms(sf);
-    m_histsRMu.scaleHistograms(sf);
-
-    m_histsBEl.scaleHistograms(sf);
-    m_histsBMu.scaleHistograms(sf);
-    outputFile->Write();
-  }
-
-  void LJetsTtresAnalysis::printCutflow(TH1D* eventHist, TH1D* mcWeightHist, const std::string& name,
-                                        unsigned int localYield) {
-    std::cout << name << " cutflow:\n";
-    std::cout << "    " <<
-      std::setw(4) << "Num" <<
-      std::setw(20) << "Name" <<
-      std::setw(20) << "Grid (Events)" <<
-      std::setw(20) << "Grid (MC Weights)" <<
-      std::setw(20) << "Local (Events)" << "\n";
-
-    for (int i = 1; i <= eventHist->GetNbinsX(); ++i) {
-      std::cout << "    " << std::setw(4) << i
-                << std::setw(20) << eventHist->GetXaxis()->GetBinLabel(i)
-                << std::setw(20) << eventHist->GetBinContent(i)
-                << std::setw(20) << mcWeightHist->GetBinContent(i);
-
-      if (i == eventHist->GetNbinsX()) std::cout << std::setw(20) << localYield;
-
-      std::cout << "\n";
-    }
-
-    std::cout << "\n";
-  }
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/MakeTopConfig.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/MakeTopConfig.cxx
deleted file mode 100644
index fdf30956a4740446b54a3ee1980923f55a45a544..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/MakeTopConfig.cxx
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include "TopExamples/MakeTopConfig.h"
-#include "TopConfiguration/TopConfig.h"
-#include "TopConfiguration/TopPersistentSettings.h"
-#include "TopEvent/EventTools.h"
-
-namespace top {
-  MakeTopConfig::MakeTopConfig(const std::string& name) :
-    asg::AsgMetadataTool(name) {
-  }
-
-  std::shared_ptr<top::TopConfig> MakeTopConfig::makeTopConfig() {
-    ///-- Get the settings from the input file
-    const top::TopPersistentSettings* settings(nullptr);
-
-    top::check(inputMetaStore()->retrieve(settings, "TopPersistentSettings"),
-               "Failed to retrieve TopPersistentSettings");
-
-    ///-- Create the top::TopConfig from the TopPersistentSettings --///
-    std::shared_ptr<top::TopConfig> config(new top::TopConfig(settings));
-
-    return config;
-  }
-}
\ No newline at end of file
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/MiniToFlatAnalysis.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/MiniToFlatAnalysis.cxx
deleted file mode 100644
index 8993881a7a03f3693a384d49a93da66584146a43..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/MiniToFlatAnalysis.cxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include "TopExamples/MiniToFlatAnalysis.h"
-
-#include <string>
-
-#include "TopConfiguration/TopConfig.h"
-
-#include "TopEvent/EventTools.h"
-#include "TopEvent/TopEventMaker.h"
-#include "TopEvent/Event.h"
-
-#include "TopEventSelectionTools/PlotManager.h"
-#include "TH1.h"
-#include "TH1D.h"
-#include "TFile.h"
-#include "TDirectoryFile.h"
-
-namespace top {
-  MiniToFlatAnalysis::MiniToFlatAnalysis(const std::string& name) :
-    asg::AsgTool(name),
-    m_config(nullptr),
-
-    m_topTools(nullptr),
-    m_sfCalc(nullptr),
-    m_evtMaker(nullptr),
-
-    m_outputFileName("SetMe"),
-    m_outputFile(nullptr) {
-    declareProperty("config", m_config);
-    declareProperty("outputFileName", m_outputFileName = "miniout.root");
-  }
-
-  StatusCode MiniToFlatAnalysis::initialize() {
-    m_topTools = std::unique_ptr<top::TopToolStore> (new top::TopToolStore("top::TopToolStore"));
-    top::check(m_topTools->setProperty("config", m_config),
-               "Failed to set config for topTools");
-    top::check(m_topTools->initialize(), "Failed to initialize");
-
-    m_sfCalc =
-      std::unique_ptr<top::ScaleFactorCalculator> (new top::ScaleFactorCalculator("top::ScaleFactorCalculator"));
-    top::check(m_sfCalc->setProperty("config", m_config),
-               "Failed to set config for sfCalc");
-    top::check(m_sfCalc->initialize(), "Failed to initialize");
-
-    m_evtMaker = std::unique_ptr<top::TopEventMaker>(new top::TopEventMaker("top::TopEventMaker"));
-    top::check(m_evtMaker->setProperty("config", m_config),
-               "Failed to set config for evtMaker");
-    top::check(m_evtMaker->initialize(), "Failed to initialize");
-
-    m_outputFile = new TFile(m_outputFileName.c_str(), "RECREATE");
-
-    m_event_saver = std::unique_ptr<top::EventSaverFlatNtuple>(new top::EventSaverFlatNtuple());
-    m_event_saver->initialize(m_config, m_outputFile, *(m_config->allSelectionNames().get()));
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode MiniToFlatAnalysis::execute() {
-    // Re-do Scale Factors - You cannot do this with a flat ntuple
-    top::check(m_sfCalc->execute(), "Failed to calculate scale factors");
-
-    const xAOD::SystematicEventContainer* allSystematics = m_evtMaker->systematicEvents(
-      m_config->sgKeyTopSystematicEvents());
-    // ATH_MSG_INFO(" Total number of SystematicEvents (inc Nominal) = "<<allSystematics->size());
-
-    for (auto currentSystematic : *allSystematics) {
-      // Make a top::Event
-      top::Event topEvent = m_evtMaker->makeTopEvent(currentSystematic);
-      topEvent.m_saveEvent = false;
-
-      // Reset the ttree indicies (probably should be done somewhere else)
-      if (topEvent.m_isLoose) {
-        topEvent.m_ttreeIndex = m_config->ttreeIndexLoose(topEvent.m_hashValue);
-      } else {
-        topEvent.m_ttreeIndex = m_config->ttreeIndex(topEvent.m_hashValue);
-      }
-
-      for (auto sel : *m_config->allSelectionNames()) {
-        if (currentSystematic->auxdataConst<int>(sel) == 1) {
-          topEvent.m_saveEvent = true;
-          break;
-        }
-      }
-
-      m_event_saver->saveEvent(topEvent);
-    }
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode MiniToFlatAnalysis::finalize() {
-    m_outputFile->cd();
-    m_event_saver->finalize();
-
-    return StatusCode::SUCCESS;
-  }
-}  // namespace top
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/MinixAODAnalysis.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/MinixAODAnalysis.cxx
deleted file mode 100644
index 68b74c4025b3e6f253c230c16eeae780570a4335..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/MinixAODAnalysis.cxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include "TopExamples//MinixAODAnalysis.h"
-
-#include "TopConfiguration/TopConfig.h"
-
-#include "TopEvent/EventTools.h"
-#include "TopEvent/TopEventMaker.h"
-#include "TopEvent/Event.h"
-
-#include "TopExamples/DefaultPlots.h"
-
-#include "TopEventSelectionTools/PlotManager.h"
-#include "TH1.h"
-#include "TH1D.h"
-#include "TFile.h"
-#include "TDirectoryFile.h"
-
-namespace top {
-  MinixAODAnalysis::MinixAODAnalysis(const std::string& name) :
-    asg::AsgTool(name),
-    m_config(nullptr),
-
-    m_topTools(nullptr),
-    m_sfCalc(nullptr),
-    m_evtMaker(nullptr),
-
-    m_outputFileName("SetMe"),
-    m_outputFile(nullptr),
-
-    m_firstEvent(true),
-    m_sampleName("SetMe"),
-    m_plots() {
-    declareProperty("config", m_config);
-    declareProperty("outputFileName", m_outputFileName = "miniout.root");
-    declareProperty("sampleName", m_sampleName = "Example");
-  }
-
-  StatusCode MinixAODAnalysis::initialize() {
-    m_topTools = std::unique_ptr<top::TopToolStore> (new top::TopToolStore("top::TopToolStore"));
-    top::check(m_topTools->setProperty("config", m_config), "Failed to set property");
-    top::check(m_topTools->initialize(), "Failed to initialize");
-
-    m_sfCalc =
-      std::unique_ptr<top::ScaleFactorCalculator> (new top::ScaleFactorCalculator("top::ScaleFactorCalculator"));
-    top::check(m_sfCalc->setProperty("config", m_config), "Failed to set property");
-    top::check(m_sfCalc->initialize(), "Failed to initialize");
-
-    m_evtMaker = std::unique_ptr<top::TopEventMaker> (new top::TopEventMaker("top::TopEventMaker"));
-    top::check(m_evtMaker->setProperty("config", m_config), "Failed to set property");
-    top::check(m_evtMaker->initialize(), "Failed to initialize");
-
-    m_outputFile = new TFile(m_outputFileName.c_str(), "RECREATE");
-
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode MinixAODAnalysis::execute() {
-    ///-- Re-do Scale Factors - You cannot do this with a flat ntuple --///
-    top::check(m_sfCalc->execute(), "Failed to calculate scale factors");
-
-    const xAOD::SystematicEventContainer* allSystematics = m_evtMaker->systematicEvents(
-      m_config->sgKeyTopSystematicEvents());
-//     ATH_MSG_INFO(" Total number of SystematicEvents (inc Nominal) = "<<allSystematics->size());
-
-    ///-- OK, this is a bit ugly, it will be cleaned up massively in future versions --///
-    ///-- This is a demonstration program only --///
-
-
-    if (m_firstEvent) {
-      m_firstEvent = false;
-
-      // Setup a top::PlotManager for each channel and each syst
-      for (auto channel : *m_config->allSelectionNames()) {
-        std::unordered_map<std::string, top::PlotManager*> channelPlotMap;
-        for (auto currentSystematic : *allSystematics) {
-          channelPlotMap.insert(std::make_pair(
-                                  m_config->systematicName(currentSystematic->hashValue()),
-                                  new top::PlotManager(m_sampleName, channel,
-                                                       m_config->systematicName(currentSystematic->hashValue()),
-                                                       m_outputFile)
-                                  ));
-        }
-        m_plots.insert(std::make_pair(channel, channelPlotMap));
-      }
-
-      for (Itr i = m_plots.begin(); i != m_plots.end(); ++i) {
-        for (Itr2 j = (*i).second.begin(); j != (*i).second.end(); ++j) {
-          top::addPlots(*((*j).second));
-        }
-      }
-    }
-
-    for (auto currentSystematic : *allSystematics) {
-      ///-- Make a top::Event --///
-      top::Event topEvent = m_evtMaker->makeTopEvent(currentSystematic);
-
-      ///-- Loop over all selections --///
-      for (auto sel : *m_config->allSelectionNames()) {
-        Itr channelPlotMap = m_plots.find(sel);
-        if (channelPlotMap != m_plots.end()) {
-          ///-- If selection passes, plot the top::Event --///
-          if (currentSystematic->isAvailable<int>(sel)) {
-            bool passSelection = currentSystematic->auxdataConst<int>(sel) == 1 ? true : false;
-            if (passSelection) {
-              Itr2 systPlotMap =
-                (*channelPlotMap).second.find(m_config->systematicName(currentSystematic->hashValue()));
-              if (systPlotMap != (*channelPlotMap).second.end()) {
-                top::fillPlots(topEvent, *((*systPlotMap).second), 1.);
-              }
-            }
-          }
-        }
-      }
-    }
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode MinixAODAnalysis::finalize() {
-    m_outputFile->cd();
-    m_outputFile->Write();
-
-    return StatusCode::SUCCESS;
-  }
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/NoSelectionAnalysis.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/NoSelectionAnalysis.cxx
deleted file mode 100644
index f2a52c5c4133d1c3c1e8070654b04242e52b6e3d..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/Root/NoSelectionAnalysis.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#include "TopExamples/NoSelectionAnalysis.h"
-#include "TopExamples/DefaultPlots.h"
-#include "TopExamples/AnalysisTools.h"
-
-#include "TopEvent/Event.h"
-#include "TopEvent/EventTools.h"
-
-#include "TFile.h"
-#include "TH1.h"
-
-#include <iostream>
-
-namespace top {
-  NoSelectionAnalysis::NoSelectionAnalysis(TFile* outputFile, EL::Worker* wk) :
-    m_hists("all", outputFile, wk),
-    m_cutflowEvents(nullptr),
-    m_cutflowMCWeights(nullptr),
-    m_counter(0) {
-    top::addPlots(m_hists);
-  }
-
-  NoSelectionAnalysis::~NoSelectionAnalysis() {
-  }
-
-  void NoSelectionAnalysis::newFile(TFile* inputFile) {
-    top::updateCutflow("all/cutflow", m_cutflowEvents, inputFile);
-    top::updateCutflow("all/cutflow_mc", m_cutflowMCWeights, inputFile);
-  }
-
-  void NoSelectionAnalysis::event(const top::Event& topEvent) {
-    ++m_counter;
-
-    double eventWeight = 1.;
-    if (top::isSimulation(topEvent)) eventWeight = topEvent.m_info->auxdataConst<float>("AnalysisTop_eventWeight");
-
-    //std::cout << topEvent << std::endl;
-    top::fillPlots(topEvent, m_hists, eventWeight);
-  }
-
-  void NoSelectionAnalysis::finalise(TFile* outputFile) {
-    std::cout << "Cutflow directly from the input files:\n";
-    printCutflow(m_cutflowEvents, m_cutflowMCWeights, "all", m_counter);
-
-    //write out plots
-    outputFile->Write();
-  }
-
-  void NoSelectionAnalysis::printCutflow(TH1D* eventHist, TH1D* mcWeightHist, const std::string& name,
-                                         unsigned int localYield) {
-    std::cout << name << " cutflow:\n";
-    std::cout << "    " <<
-      std::setw(4) << "Num" <<
-      std::setw(20) << "Name" <<
-      std::setw(20) << "Grid (Events)" <<
-      std::setw(20) << "Grid (MC Weights)" <<
-      std::setw(20) << "Local (Events)" << "\n";
-
-    for (int i = 1; i <= eventHist->GetNbinsX(); ++i) {
-      std::cout << "    " << std::setw(4) << i
-                << std::setw(20) << eventHist->GetXaxis()->GetBinLabel(i)
-                << std::setw(20) << eventHist->GetBinContent(i)
-                << std::setw(20) << mcWeightHist->GetBinContent(i);
-
-      if (i == eventHist->GetNbinsX()) std::cout << std::setw(20) << localYield;
-
-      std::cout << "\n";
-    }
-
-    std::cout << "\n";
-  }
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/AnalysisBase.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/AnalysisBase.h
deleted file mode 100644
index 99735ec988836fc27bff4cf7e59d2182b5785cd3..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/AnalysisBase.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#ifndef ANALYSISBASE_H_
-#define ANALYSISBASE_H_
-
-#include "TopExamples/ContainerNames.h"
-
-class TFile;
-
-namespace top {
-  class Event;
-
-/**
- * @brief An interface so that the analysis codes look the same and can be
- * run by the mini-to-plots executable.
- */
-  class AnalysisBase {
-  public:
-    /**
-     * @brief This is run once only at the very start.  You might want to book
-     * some histograms or something.
-     */
-    AnalysisBase() {
-      //container names
-      m_containerNames.eventInfoName = "EventInfo";
-      m_containerNames.electronCollectionName = "CorrectedSelectedElectrons";
-      m_containerNames.muonCollectionName = "CorrectedSelectedMuons";
-      m_containerNames.jetCollectionName = "CorrectedSelectedAntiKt4EMTopoJets";
-      m_containerNames.largeJetCollectionName = "None";
-      m_containerNames.tauCollectionName = "None";
-      m_containerNames.truthCollectionName = "None";
-      m_containerNames.metName = "MET_Reference_AntiKt4EMTopo";
-    }
-
-    /**
-     * @brief Do nothing.
-     */
-    virtual ~AnalysisBase() {}
-
-    /**
-     * @brief Perform some task only when a new file is opened.
-     *
-     * For example, in the current system we save the cutflow that was generated
-     * by the grid job in the file.  Every time we open a new file we want to
-     * add this to the cutflow from the previous file.
-     *
-     * Don't try to delete the file - maybe we should change this to a reference?
-     */
-    virtual void newFile(TFile*) = 0;
-
-    /**
-     * @brief Write the analysis code that needs to be run for every event in
-     * this function.
-     */
-    virtual void event(const top::Event&) = 0;
-
-    /**
-     * @brief This is run once at the very end.  You might want to save your
-     * histograms. And / or normalise them. Or something like that.  The file
-     * will be opened for you at the end of the job to save your output to.
-     */
-    virtual void finalise(TFile*) = 0;
-
-    const ContainerNames containerNames() const {return m_containerNames;}
-
-    ContainerNames* SetContainerNames() {return &m_containerNames;}
-  private:
-    top::ContainerNames m_containerNames;
-  };
-}
-
-#endif /* ANALYSISBASE_H_ */
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/AnalysisTools.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/AnalysisTools.h
deleted file mode 100644
index 649cd8490d02927ae2ef2448140395076bd45cd1..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/AnalysisTools.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#ifndef ANALYSISTOOLS_H
-#define ANALYSISTOOLS_H
-
-#include <string>
-#include <memory>
-
-#include "TopExamples/AnalysisBase.h"
-#include "TopExamples/ContainerNames.h"
-
-class TH1D;
-class TFile;
-
-namespace EL {
-  class Worker;
-}
-
-/**
- * @file AnalysisTools.h
- *
- * @brief A few functions for analysis code in the final stages.
- */
-
-namespace top {
-///Sometimes you want things in GeV, no.  Do by multiplication.
-  const double toGeV = 0.001;
-
-/**
- * @brief Load one of the three analyses in a factory like way.
- *
- * Allows you to specify a string name which is mapped to the analysis code
- * using this function.  Note that if you add some new analysis code and want
- * to actually run it then you also need to modify this function in a hopefully
- * trivial way.
- *
- * @param name The name of the analysis to load (Dilepton, LJets, NoSelection etc)
- *
- * @return a unique ptr (these things are magic, they delete themselves when they
- * are no longer needed) to the analysis code.
- */
-  std::unique_ptr<top::AnalysisBase> loadAnalysis(const std::string& name, TFile* outputFile, EL::Worker* wk = nullptr);
-
-/**
- * @brief Open an xAOD and return the sample number as a string.
- *
- * For data this is the run number but for MC simulation this returns the
- * MC channel number.  Not that for data we also pad it to 8 characters long
- * with a zero or two.  Because this is how the grid datasets are named to. For
- * MC simulation datasets are not padded out to 8 characters long.
- *
- * @param filename Name of an xAOD file to extract the information from.
- * @param containerNames Name of the containers to load.  In theory only the
- * EventInfo is important, but this seemed easier for now.
- *
- * @return run number for data, MC channel number for MC simulation.
- */
-  const std::string getSampleNumberAsString(const std::string& filename, const std::string& infoContainerName);
-
-/**
- * @brief Calculate a scale factor to one inverse fb given the sum of weights
- * and the mc channel number.
- *
- * This loads the TopDataPreparation code and text file to get the cross-section
- * for the MC sample.
- *
- * @param mcChannelNumber The MC channel number, so we can look up the cross-
- * section using TopDataPreparation
- * @param mcWeightsInSample The sum of the MC weights in the MC sample
- */
-  double sfToOneInversefb(unsigned int mcChannelNumber, double mcWeightsInSample);
-
-/**
- * @brief We want to add a histogram with name "name" from file "inputFile" to
- * the histogram "histogram".  Note that if "histogram" is nullptr this function
- * will create it using the first one it finds in a file.  Otherwise it just adds
- * the new histogram to this one.
- *
- * @param name The name of the cutflow histogram in the input file (e.g.
- * ee/cutflow).
- * @param histogram The histogram in our code that we want to add to. This is
- * modified by this function!
- * @param inputFile The inputFile to read the histogram from.
- */
-  void updateCutflow(const std::string& name, TH1D*& histogram, TFile* inputFile);
-
-/**
- * @brief Messy.
- *
- * Given a path /this/is/a/path/user.simon.117050.e1727_s1933_s1911_r5591.MC_31_07_1/input.txt.
- * Strip off the input.txt and all the stuff before the very last directory.
- * Then remove user.simon.117050 (i.e. the first three items between dots).
- * Then strip off the end bit to leave e1727_s1933_s1911_r5591.
- *
- * @param inputFile A path with a specific naming convention for the last directory.
- * @return The e<blah>_s<blah>_r<blah> or equivalent.
- */
-  std::string gridTagFromDirectoryName(const std::string inputFile);
-
-/**
- * @brief The top-xaod code is decorating events with a integer (not bool!)
- * flag for every event that passes/fails the pre-selection.  The name of the
- * decoration is the analysis channel (e.g. ee, mumu, emu).  So we can check
- * if the event passes or fails the selection done on the grid by looking at
- * this.
- *
- * @param topEvent The top event we want to know about.
- * @param name The channel we're interested in. e.g. ee
- * @return True if the event passed the grid selection, false otherwise.
- */
-  bool passesPreSelection(const top::Event& topEvent, const std::string& name);
-}
-
-#endif
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/ContainerNames.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/ContainerNames.h
deleted file mode 100644
index d2496e6c045113f55528b340f7cfdb628658105f..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/ContainerNames.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#ifndef CONTAINERNAMES_H_
-#define CONTAINERNAMES_H_
-
-#include <string>
-
-namespace top {
-  struct ContainerNames {
-    std::string eventInfoName;
-    std::string electronCollectionName;
-    std::string muonCollectionName;
-    std::string jetCollectionName;
-    std::string largeJetCollectionName;
-    std::string metName;
-    std::string tauCollectionName;
-    std::string truthCollectionName;
-  };
-}
-
-std::ostream& operator << (std::ostream& os, const top::ContainerNames& names);
-
-#endif
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/DefaultPlots.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/DefaultPlots.h
deleted file mode 100644
index d60e0be9908aefb249b72f83b3c131f06a142d59..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/DefaultPlots.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#ifndef DEFAULTPLOTS_H_
-#define DEFAULTPLOTS_H_
-
-namespace top {
-  class PlotManager;
-  class Event;
-
-/**
- * @brief Since a few of the analyses might want some 'default' plots we've put
- * the code to make them in this little function.
- *
- * Hopefully the names and axis labels make it clear what they should contain.
- *
- * @param manager This is a little package that lets you store a bunch of
- * histograms and then refer to them by name.
- */
-  void addPlots(top::PlotManager& manager);
-
-/**
- * @brief Fill the plots made by the addPlots function. This should be run every
- * event.
- *
- * @param topEvent The 'event' which contains electrons, muons, jets, met etc.
- * @param manager The histogram manager that the plots were added to.  It's used
- * to access them via their name, and then fill them.
- * @param eventWeight Maybe you're running on MC simulation and the events are
- * weighted and you want to plot them with weights?
- */
-  void fillPlots(const top::Event& topEvent, top::PlotManager& manager, double eventWeight);
-}
-
-#endif
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/DileptonAnalysis.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/DileptonAnalysis.h
deleted file mode 100644
index 430a9a5d2d9f671dfc45b3e0715f32cba74d677a..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/DileptonAnalysis.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#ifndef DILEPTONANALYSIS_H_
-#define DILEPTONANALYSIS_H_
-
-#include "TopExamples/AnalysisBase.h"
-#include "TopEventSelectionTools/PlotManager.h"
-
-class TH1D;
-class TFile;
-
-namespace EL {
-  class Worker;
-}
-
-namespace top {
-  class DileptonAnalysis: public AnalysisBase {
-  public:
-    DileptonAnalysis(TFile* outputFile, EL::Worker* wk = nullptr);
-    ~DileptonAnalysis();
-
-    void newFile(TFile* inputFile) override;
-    void event(const top::Event& topEvent) override;
-    void finalise(TFile* outputFile) override;
-  private:
-    void eeAnalysis(const top::Event& topEvent, double eventWeight);
-    void mumuAnalysis(const top::Event& topEvent, double eventWeight);
-    void emuAnalysis(const top::Event& topEvent, double eventWeight);
-
-    void printCutflow(std::ostream& out, const TH1D* const eventHist, const TH1D* const mcWeightHist,
-                      const std::string& name, const unsigned int localYield);
-
-    ///MC Channel number is needed to calculate the SF (to 1 fb-1) at the end of the job
-    unsigned int m_mcChannelNumber;
-
-    ///runNumber used for output filename
-    unsigned int m_runNumber;
-
-    ///Histograms for the ee, mumu and emu channels
-    top::PlotManager m_histsElEl;
-    top::PlotManager m_histsMuMu;
-    top::PlotManager m_histsElMu;
-
-    ///Cutflows for (1) raw events and (2) events with MC weights
-    TH1D* m_cutflowEventsElEl;
-    TH1D* m_cutflowMCWeightsElEl;
-    TH1D* m_cutflowEventsMuMu;
-    TH1D* m_cutflowMCWeightsMuMu;
-    TH1D* m_cutflowEventsElMu;
-    TH1D* m_cutflowMCWeightsElMu;
-
-    ///Counters for events running locally
-    unsigned int m_counterElEl;
-    unsigned int m_counterMuMu;
-    unsigned int m_counterElMu;
-  };
-}
-
-#endif /* DILEPTONANALYSIS_H_ */
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/EventLoaderDirect.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/EventLoaderDirect.h
deleted file mode 100644
index 6102101f7086f5d421895a13f525fee073e5034c..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/EventLoaderDirect.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#ifndef LOADALL_H_
-#define LOADALL_H_
-
-#include "TopExamples/ContainerNames.h"
-
-#include "TopEvent/Event.h"
-
-namespace top {
-  class EventLoaderDirect {
-  public:
-    EventLoaderDirect(const ContainerNames& names);
-
-    ~EventLoaderDirect();
-
-    top::Event loadEvent(xAOD::TEvent& xaodEvent);
-
-    void print(std::ostream& os) const;
-
-    ///Get hold of the container names (in derived classes too).
-    const ContainerNames containerNames() const {return m_containerNames;}
-  private:
-    ///Store the container names
-    ContainerNames m_containerNames;
-  };
-}
-
-#endif
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/LJetsAnalysis.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/LJetsAnalysis.h
deleted file mode 100644
index b569b6ba73d007b0ab91283fa12695a093d22b54..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/LJetsAnalysis.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#ifndef LJETSANALYSIS_H_
-#define LJETSANALYSIS_H_
-
-#include "TopExamples/AnalysisBase.h"
-#include "TopEventSelectionTools/PlotManager.h"
-
-#include <string>
-
-class TH1D;
-class TFile;
-
-namespace EL {
-  class Worker;
-}
-
-namespace top {
-  class LJetsAnalysis: public AnalysisBase {
-  public:
-    LJetsAnalysis(TFile* outputFile, EL::Worker* wk = nullptr);
-    ~LJetsAnalysis();
-
-    void newFile(TFile* inputFile) override;
-    void event(const top::Event& topEvent) override;
-    void finalise(TFile* outputFile) override;
-  private:
-    void printCutflow(std::ostream& out, const TH1D* const eventHist, const TH1D* const mcWeightHist,
-                      const std::string& name, const unsigned int localYield);
-
-    ///used for output filename (for MC)
-    unsigned int m_mcChannelNumber;
-
-    ///runNumber used for output filename
-    unsigned int m_runNumber;
-
-    top::PlotManager m_histsEl;
-    top::PlotManager m_histsMu;
-
-    TH1D* m_cutflowEventsEl;
-    TH1D* m_cutflowMCWeightsEl;
-    TH1D* m_cutflowEventsMu;
-    TH1D* m_cutflowMCWeightsMu;
-
-    unsigned int m_counterEl;
-    unsigned int m_counterMu;
-  };
-}
-
-#endif
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/LJetsTtresAnalysis.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/LJetsTtresAnalysis.h
deleted file mode 100644
index 6ab4306a8af7fa7376050d4199db37f3f3c7b506..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/LJetsTtresAnalysis.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#ifndef LJETSTTRESANALYSIS_H_
-#define LJETSTTRESANALYSIS_H_
-
-#include "TopExamples/AnalysisBase.h"
-#include "TopEventSelectionTools/PlotManager.h"
-
-#include "TopEventReconstructionTools/TtresNeutrinoBuilder.h"
-#include "TopEventReconstructionTools/TtresChi2.h"
-
-#include <string>
-
-class TH1D;
-class TFile;
-
-namespace top {
-  class LJetsTtresAnalysis: public AnalysisBase {
-  public:
-    LJetsTtresAnalysis(TFile* outputFile);
-    ~LJetsTtresAnalysis();
-
-    void newFile(TFile* inputFile) override;
-    void event(const top::Event& topEvent) override;
-    void finalise(TFile* outputFile) override;
-  private:
-    void printCutflow(TH1D* eventHist, TH1D* mcWeightHist, const std::string& name, unsigned int localYield);
-
-    void fillIt(top::PlotManager& hist, const top::Event& topEvent, bool isBoosted);
-
-    unsigned int m_mcChannelNumber;
-
-    top::PlotManager m_histsREl;
-    top::PlotManager m_histsRMu;
-    top::PlotManager m_histsBEl;
-    top::PlotManager m_histsBMu;
-
-    TH1D* m_cutflowEventsREl;
-    TH1D* m_cutflowMCWeightsREl;
-    TH1D* m_cutflowEventsRMu;
-    TH1D* m_cutflowMCWeightsRMu;
-
-    TH1D* m_cutflowEventsBEl;
-    TH1D* m_cutflowMCWeightsBEl;
-    TH1D* m_cutflowEventsBMu;
-    TH1D* m_cutflowMCWeightsBMu;
-
-    unsigned int m_counterREl;
-    unsigned int m_counterRMu;
-
-    unsigned int m_counterBEl;
-    unsigned int m_counterBMu;
-
-    TtresNeutrinoBuilder m_neutrinoBuilder;
-    TtresChi2 m_chi2;
-  };
-}
-
-#endif
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/MakeTopConfig.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/MakeTopConfig.h
deleted file mode 100644
index b78dbc121e8af44927ca6a3863d98b0bb441953f..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/MakeTopConfig.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-   Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
- */
-
-#ifndef ANALYSISTOP_NEXTGEN_MAKETOPCONFIG_H
-#define ANALYSISTOP_NEXTGEN_MAKETOPCONFIG_H
-
-/**
- * @author John Morris <john.morris@cern.ch>
- *
- * @brief MakeTopConfig - it makes a top::TopConfig from the metadata
- *
- *
- **/
-
-#include <memory>
-
-// Framework include(s):
-#include "AsgTools/AsgMetadataTool.h"
-
-namespace top {
-  class TopConfig;
-  class MakeTopConfig: public asg::AsgMetadataTool {
-  public:
-    explicit MakeTopConfig(const std::string& name);
-
-    std::shared_ptr<top::TopConfig> makeTopConfig();
-  };
-}
-#endif
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/MiniToFlatAnalysis.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/MiniToFlatAnalysis.h
deleted file mode 100644
index 1adde5c9abaed1cc2cfc08d841f4ece9bd2f6461..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/MiniToFlatAnalysis.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-// $Id: MiniToFlatAnalysis.h 733950 2016-04-05 11:21:48Z tneep $
-#ifndef TOPEXAMPLES_MINITOFLATANALYSIS_H_
-#define TOPEXAMPLES_MINITOFLATANALYSIS_H_
-
-/**
- * @author Tom Neep <tom.neep@cern.ch>
- *
- * @brief MiniToFlatAnalysis
- *
- * $Revision: 683667 $
- * $Date: 2015-07-17 04:24:59 +0200 (Fri, 17 Jul 2015) $
- *
- *
- **/
-
-#include <memory>
-#include <unordered_map>
-#include <string>
-
-// Framework include(s):
-#include "AsgTools/AsgTool.h"
-
-// Forward declaration(s):
-namespace top {
-  class TopConfig;
-  class PlotManager;
-}
-
-class TFile;
-
-#include "TopCPTools/TopToolStore.h"
-#include "TopCorrections/ScaleFactorCalculator.h"
-#include "TopEvent/TopEventMaker.h"
-#include "TopAnalysis/EventSaverFlatNtuple.h"
-
-namespace top {
-  class MiniToFlatAnalysis: public asg::AsgTool {
-  public:
-    explicit MiniToFlatAnalysis(const std::string& name);
-    virtual ~MiniToFlatAnalysis() {}
-
-    // Delete Standard constructors
-    MiniToFlatAnalysis(const MiniToFlatAnalysis& rhs) = delete;
-    MiniToFlatAnalysis(MiniToFlatAnalysis&& rhs) = delete;
-    MiniToFlatAnalysis& operator = (const MiniToFlatAnalysis& rhs) = delete;
-
-    virtual StatusCode initialize();
-    virtual StatusCode execute();
-    virtual StatusCode finalize();
-  private:
-    std::shared_ptr<top::TopConfig> m_config;
-
-    std::unique_ptr<top::TopToolStore> m_topTools;
-    std::unique_ptr<top::ScaleFactorCalculator> m_sfCalc;
-    std::unique_ptr<top::TopEventMaker> m_evtMaker;
-    std::unique_ptr<top::EventSaverFlatNtuple> m_event_saver;
-
-    std::string m_outputFileName;
-    ::TFile* m_outputFile;
-  };
-}  // namespace top
-#endif  // TOPEXAMPLES_MINITOFLATANALYSIS_H_
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/MinixAODAnalysis.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/MinixAODAnalysis.h
deleted file mode 100644
index 2a6ad4a4c263dcd1c91232810e3a8f340ff7e458..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/MinixAODAnalysis.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-// $Id: MinixAODAnalysis.h 683667 2015-07-17 02:24:59Z morrisj $
-#ifndef ANALYSISTOP_TOPEXAMPLES_MINIXAODANALYSIS_H
-#define ANALYSISTOP_TOPEXAMPLES_MINIXAODANALYSIS_H
-
-/**
- * @author John Morris <john.morris@cern.ch>
- *
- * @brief MinixAODAnalysis
- *
- * $Revision: 683667 $
- * $Date: 2015-07-17 03:24:59 +0100 (Fri, 17 Jul 2015) $
- *
- *
- **/
-
-#include <memory>
-#include <unordered_map>
-
-// Framework include(s):
-#include "AsgTools/AsgTool.h"
-
-// Forward declaration(s):
-namespace top {
-  class TopConfig;
-  class PlotManager;
-}
-class TFile;
-
-#include "TopCPTools/TopToolStore.h"
-#include "TopCorrections/ScaleFactorCalculator.h"
-#include "TopEvent/TopEventMaker.h"
-
-namespace top {
-  class MinixAODAnalysis: public asg::AsgTool {
-  public:
-    explicit MinixAODAnalysis(const std::string& name);
-    virtual ~MinixAODAnalysis() {}
-
-    // Delete Standard constructors
-    MinixAODAnalysis(const MinixAODAnalysis& rhs) = delete;
-    MinixAODAnalysis(MinixAODAnalysis&& rhs) = delete;
-    MinixAODAnalysis& operator = (const MinixAODAnalysis& rhs) = delete;
-
-    virtual StatusCode initialize();
-    virtual StatusCode execute();
-    virtual StatusCode finalize();
-  private:
-    std::shared_ptr<top::TopConfig> m_config;
-
-    std::unique_ptr<top::TopToolStore> m_topTools;
-    std::unique_ptr<top::ScaleFactorCalculator> m_sfCalc;
-    std::unique_ptr<top::TopEventMaker> m_evtMaker;
-
-    std::string m_outputFileName;
-    ::TFile* m_outputFile;
-
-    // Analysis
-    bool m_firstEvent;
-    std::string m_sampleName;
-    std::unordered_map<std::string, std::unordered_map<std::string, top::PlotManager*> > m_plots;
-    typedef std::unordered_map<std::string, std::unordered_map<std::string, top::PlotManager*> >::const_iterator Itr;
-    typedef std::unordered_map<std::string, top::PlotManager*>::const_iterator Itr2;
-  };
-}
-#endif
\ No newline at end of file
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/NoSelectionAnalysis.h b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/NoSelectionAnalysis.h
deleted file mode 100644
index ec3a05c61f4170e7dd06cdb80aedf54ebe1b81aa..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/TopExamples/NoSelectionAnalysis.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
- */
-
-#ifndef NOSELECTIONANALYSIS_H_
-#define NOSELECTIONANALYSIS_H_
-
-#include <string>
-
-#include "TopExamples/AnalysisBase.h"
-#include "TopEventSelectionTools/PlotManager.h"
-
-class TH1D;
-class TFile;
-
-namespace EL {
-  class Worker;
-}
-
-namespace top {
-  class NoSelectionAnalysis: public AnalysisBase {
-  public:
-    NoSelectionAnalysis(TFile* outputFile, EL::Worker* wk = nullptr);
-    ~NoSelectionAnalysis();
-
-    void newFile(TFile* inputFile) override;
-    void event(const top::Event& topEvent) override;
-    void finalise(TFile* outputFile) override;
-  private:
-    void printCutflow(TH1D* eventHist, TH1D* mcWeightHist, const std::string& name, unsigned int localYield);
-
-    top::PlotManager m_hists;
-
-    TH1D* m_cutflowEvents;
-    TH1D* m_cutflowMCWeights;
-
-    unsigned int m_counter;
-  };
-}
-
-#endif
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/ami.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/ami.py
index 11f85a41b73cfd64fe9f20449c1828d5b7ac59e8..f67e40cb7476e88f31204122c548536eef184820 100755
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/ami.py
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/ami.py
@@ -1,19 +1,17 @@
 #!/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
 import re
-import os
 import sys
-from xml.dom.minidom import parse, parseString
+from xml.dom.minidom import parseString
 
 import logger
 
 
 try:
-   import pyAMI.client
-   import pyAMI.atlas.api
-   #import pyAMI
-except:
+    import pyAMI.client
+    import pyAMI.atlas.api
+except ModuleNotFoundError:
     print("Maybe you didn't do localSetupPyAMI?")
     sys.exit()
 
@@ -22,83 +20,81 @@ except:
 # Quite likely, this is due to a missing VOMS proxy, so point
 # that out to the user and exit with error code.
 def exit_with_pyami_exception():
-   print('')
-   print(logger.FAIL + 'is your voms proxy okay?' + logger.ENDC)
-   print('Try voms-proxy-init -voms atlas')
-   sys.exit(1)
+    print('')
+    print(logger.FAIL + 'is your voms proxy okay?' + logger.ENDC)
+    print('Try voms-proxy-init -voms atlas')
+    sys.exit(1)
 
 
 # Exception to be thrown when information cannot be extracted
 # from an LDN, e.g. the p-tag cannot be identified.
 class ldn_decypher_error(Exception):
-   """Raised when information cannot be extracted from an LDN"""
-   pass
+    """Raised when information cannot be extracted from an LDN"""
+    pass
 
 
 # Exception to be thrown when the wrong LDN type is fed into a
 # function (e.g. data-type LDN into an MC-only function). This
 # assumes there are only data and MC as types.
 class ldn_wrong_type(Exception):
-   """Raised when an LDN of a wrong type is used"""
-   pass
+    """Raised when an LDN of a wrong type is used"""
+    pass
 
 
 def getContainerContents(containerName):
-  amiclient = pyAMI.client.Client('atlas')
+    amiclient = pyAMI.client.Client('atlas')
 
-  query = containerName.rstrip('/')
-  data = "'%"+query+"%'"
+    query = containerName.rstrip('/')
+    data = "'%"+query+"%'"
 
-  argument = 'SearchQuery -glite="select dataset.logicalDatasetName, dataset.identifier where dataset.logicalDatasetName like %s" -processingStep=real_data -project=dataSuper_001' % data
+    argument = 'SearchQuery -glite="select dataset.logicalDatasetName, dataset.identifier where dataset.logicalDatasetName like %s" -processingStep=real_data -project=dataSuper_001' % data
 
-  maxTries = 3
+    maxTries = 3
 
-  failures = 0
-  for i in range(maxTries):
-      try:
-          results = amiclient.execute(argument, format='xml')
-      except:
-          failures += 1
+    failures = 0
+    for i in range(maxTries):
+        try:
+            results = amiclient.execute(argument, format='xml')
+        except Exception:
+            failures += 1
 
-  if failures == maxTries: exit_with_pyami_exception()
+    if failures == maxTries: exit_with_pyami_exception()
 
-  dom = parseString(results)
-  rows = dom.getElementsByTagName('row')
+    dom = parseString(results)
+    rows = dom.getElementsByTagName('row')
 
-  datasets = []
-  for row in rows:
-      fields = row.getElementsByTagName('field')
-      for field in fields:
-        if field.attributes['name'].value == 'logicalDatasetName':
-          retName=field.firstChild.nodeValue
-        if field.attributes['name'].value == 'identifier':
-          identifier = field.firstChild.nodeValue
+    datasets = []
+    for row in rows:
+        fields = row.getElementsByTagName('field')
+        for field in fields:
+            if field.attributes['name'].value == 'identifier':
+                identifier = field.firstChild.nodeValue
 
-          #Now search for all datasets that match that
-          argument = 'SearchQuery -glite="SELECT contained_dataset.contained_datasetName WHERE dataset.identifier=%s" -processingStep=real_data -project=dataSuper_001' % identifier
+            #Now search for all datasets that match that
+            argument = 'SearchQuery -glite="SELECT contained_dataset.contained_datasetName WHERE dataset.identifier=%s" -processingStep=real_data -project=dataSuper_001' % identifier
 
-          results = amiclient.execute(argument, format='xml')
-          dom = parseString(results)
-          container = dom.getElementsByTagName('row')
+            results = amiclient.execute(argument, format='xml')
+            dom = parseString(results)
+            container = dom.getElementsByTagName('row')
 
-          for dataset in container:
-               fields = dataset.getElementsByTagName('field')
-               for field in fields:
-                 if field.attributes['name'].value == 'contained_datasetName':
-                   datasets.append(field.firstChild.nodeValue.encode('ascii','ignore') + '/')
-  return sorted(datasets)
+            for dataset in container:
+                fields = dataset.getElementsByTagName('field')
+                for field in fields:
+                    if field.attributes['name'].value == 'contained_datasetName':
+                        datasets.append(field.firstChild.nodeValue.encode('ascii', 'ignore') + '/')
+    return sorted(datasets)
 
 
 def askAmi(query, property = 'totalEvents'):
-  amiclient = pyAMI.client.Client('atlas')
+    amiclient = pyAMI.client.Client('atlas')
 
-  #swap * for % - databases
-  query = query.replace('*', '%%')
-  data = "'"+query+"'"
+    #swap * for % - databases
+    query = query.replace('*', '%%')
+    data = "'"+query+"'"
 
-  argument = 'SearchQuery -glite="SELECT dataset.logicalDatasetName, dataset.%s WHERE dataset.logicalDatasetName LIKE %s"' % (property, data)
+    argument = 'SearchQuery -glite="SELECT dataset.logicalDatasetName, dataset.%s WHERE dataset.logicalDatasetName LIKE %s"' % (property, data)
 
-  if data.find('data') > -1:
+    if data.find('data') > -1:
         argument += ' -processingStep=real_data'
         if data.find('data15') > -1:
             argument += ' -project=data15_001'
@@ -110,121 +106,134 @@ def askAmi(query, property = 'totalEvents'):
             argument += ' -project=data11_001'
         else:
             argument += ' -project=data10_001'
-  else:
+    else:
         argument += ' -processingStep=production'
         if data.find('mc09') > -1:
-          argument += ' -project=mc09'
+            argument += ' -project=mc09'
         elif data.find('mc10') > -1:
-          argument += ' -project=mc10'
+            argument += ' -project=mc10'
         elif data.find('mc11') > -1:
-          argument += ' -project=mc11_001'
+            argument += ' -project=mc11_001'
         elif data.find('mc12') > -1:
-          argument += ' -project=mc12_001'
+            argument += ' -project=mc12_001'
         elif data.find('mc14') > -1:
-          argument += ' -project=mc14_001'
+            argument += ' -project=mc14_001'
         elif data.find('mc15') > -1:
-          argument += ' -project=mc15_001'
+            argument += ' -project=mc15_001'
         elif data.find('mc16') > -1:
-           argument += ' -project=mc16_001'
+            argument += ' -project=mc16_001'
 
-  maxTries = 3
+    maxTries = 3
 
-  failures = 0
-  for i in range(maxTries):
-     final = {}
+    failures = 0
+    for i in range(maxTries):
+        final = {}
 
-     if not "period" in query:
-         try:
-            results = amiclient.execute(argument, format='xml')
-         except:
-            failures += 1
+        if "period" not in query:
+            try:
+                results = amiclient.execute(argument, format='xml')
+            except Exception:
+                failures += 1
 
-         if failures == maxTries: exit_with_pyami_exception()
+            if failures == maxTries:
+                exit_with_pyami_exception()
 
-         dom = parseString(results)
+            dom = parseString(results)
 
-         #they changed it so that a voms-proxy-init error now returns a search
-         #result with error in it. That's annoying.
-         mayBeAnError = dom.getElementsByTagName('error')
-         for row in mayBeAnError:
-            print(row.firstChild.nodeValue)
-            sys.exit(1)
+            #they changed it so that a voms-proxy-init error now returns a search
+            #result with error in it. That's annoying.
+            mayBeAnError = dom.getElementsByTagName('error')
+            for row in mayBeAnError:
+                print(row.firstChild.nodeValue)
+                sys.exit(1)
 
-         rows = dom.getElementsByTagName('row')
+            rows = dom.getElementsByTagName('row')
 
-         for row in rows:
-            fields = row.getElementsByTagName('field')
-            retName = ''
-            retNev = 0
+            for row in rows:
+                fields = row.getElementsByTagName('field')
+                retName = ''
+                retNev = 0
 
-            for field in fields:
-               if field.attributes['name'].value == 'logicalDatasetName':
-                  retName = field.firstChild.nodeValue
+                for field in fields:
+                    if field.attributes['name'].value == 'logicalDatasetName':
+                        retName = field.firstChild.nodeValue
 
-               if field.attributes['name'].value == property:
-                  if field.firstChild != None:
-                     retNev = field.firstChild.nodeValue
-            final[retName] = retNev
-     else:
-        try:
-           results = pyAMI.atlas.api.list_datasets(amiclient, query, fields="ldn,events,modified")
-        except:
-           failures += 1
+                    if field.attributes['name'].value == property:
+                        if field.firstChild is not None:
+                            retNev = field.firstChild.nodeValue
+                final[retName] = retNev
+        else:
+            try:
+                results = pyAMI.atlas.api.list_datasets(amiclient, query, fields="ldn,events,modified")
+            except Exception:
+                failures += 1
 
-        if failures == maxTries: exit_with_pyami_exception()
+            if failures == maxTries:
+                exit_with_pyami_exception()
 
-        for row in results:
-           retName = row["ldn"]
-           retNev  = row["events"]
+            for row in results:
+                retName = row["ldn"]
+                retNev  = row["events"]
 
-           final[retName] = retNev
+                final[retName] = retNev
 
-  results = {}
-  for k in final.keys():
-    results[str(k)] = int(final[k])
+    results = {}
+    for k in final.keys():
+        results[str(k)] = int(final[k])
 
-  return results
+    return results
 
 
 # Take a single LDN, extract its dataset number and return it.
 def get_dataset_number(ldn):
-   if is_data(ldn): raise ldn_wrong_type
-   regex = re.compile("\.[0-9]{6}\.")
-   match = regex.search(ldn)
-   if not match: raise ldn_decypher_error
-   else: return match.group(0)[1:-1]
+    if is_data(ldn):
+        raise ldn_wrong_type
+    regex = re.compile("\.[0-9]{6}\.")
+    match = regex.search(ldn)
+    if not match:
+        raise ldn_decypher_error
+    else:
+        return match.group(0)[1:-1]
 
 
 # Take a single LDN, extract its p-tag and return it.
 def get_ptag(ldn):
-   regex = re.compile("_p[0-9]+")
-   match = regex.search(ldn)
-   if not match: raise ldn_decypher_error
-   else: return match.group(0)[1:]
+    regex = re.compile("_p[0-9]+")
+    match = regex.search(ldn)
+    if not match:
+        raise ldn_decypher_error
+    else:
+        return match.group(0)[1:]
 
 
 # Return the type of LDN we're looking at (e.g. simul.HITS,
 # recon.AOD, DAOD_TOPQ1 or other derivation).
 def get_type(ldn):
-   match = re.search("\.recon\.AOD\.", ldn)
-   if match: return match.group(0)[1:-1]
-   match = re.search("\.simul.HITS\.", ldn)
-   if match: return match.group(0)[1:-1]
-   match = re.search("\.DAOD_[A-Z]+[0-9]+\.", ldn)
-   if match: return match.group(0)[1:-1]
-   # If none of the above, raise exception.
-   raise ldn_decypher_error
+    match = re.search("\.recon\.AOD\.", ldn)
+    if match:
+        return match.group(0)[1:-1]
+    match = re.search("\.simul.HITS\.", ldn)
+    if match:
+        return match.group(0)[1:-1]
+    match = re.search("\.DAOD_[A-Z]+[0-9]+\.", ldn)
+    if match:
+        return match.group(0)[1:-1]
+    # If none of the above, raise exception.
+    raise ldn_decypher_error
 
 
 # Get the data scope of a data-type LDN (e.g.
 # data15_13TeV.periodA or data16_13TeV.AllYear) and return it.
 # This function should only be called on data LDNs.
 def get_data_scope(ldn):
-   if not is_data(ldn): raise ldn_wrong_type
-   regex = re.compile("data[0-9]+.*?\..*?\.")
-   match = regex.search(ldn)
-   if not match: raise ldn_decypher_error
-   else: return match.group(0)[:-1]
+    if not is_data(ldn):
+        raise ldn_wrong_type
+    regex = re.compile("data[0-9]+.*?\..*?\.")
+    match = regex.search(ldn)
+    if not match:
+        raise ldn_decypher_error
+    else:
+        return match.group(0)[:-1]
 
 
 # Get a list of all derivations registered on AMI for a list of
@@ -233,123 +242,136 @@ def get_data_scope(ldn):
 # dictionary with dataset numbers as keys, and a list of LDNs as
 # values. The LDNs are assumed to be TOPQ derivations.
 def get_derivations(ldns):
-   amiclient = pyAMI.client.Client('atlas')
-   regex = re.compile("_p[0-9]+")
-   wildcards = [regex.sub('_p%', d) for d in ldns]
-   try: results = pyAMI.atlas.api.list_datasets(amiclient, patterns = wildcards)
-   except pyAMI.exception.Error: exit_with_pyami_exception()
-
-   dictionary = dict()
-
-   # Make sure the dictionary has empty lists prepared for all
-   # LDNs that were searched for. If MC, use the dataset number
-   # as dictionary key, if data, use the data scope.
-   for ldn in ldns:
-      try: dictionary[get_dataset_number(ldn)] = []
-      except ldn_wrong_type: dictionary[get_data_scope(ldn)] = []
+    amiclient = pyAMI.client.Client('atlas')
+    regex = re.compile("_p[0-9]+")
+    wildcards = [regex.sub('_p%', d) for d in ldns]
+    try:
+        results = pyAMI.atlas.api.list_datasets(amiclient, patterns=wildcards)
+    except pyAMI.exception.Error:
+        exit_with_pyami_exception()
+
+    dictionary = dict()
+
+    # Make sure the dictionary has empty lists prepared for all
+    # LDNs that were searched for. If MC, use the dataset number
+    # as dictionary key, if data, use the data scope.
+    for ldn in ldns:
+        try:
+            dictionary[get_dataset_number(ldn)] = []
+        except ldn_wrong_type:
+            dictionary[get_data_scope(ldn)] = []
 
-   # Go through the results and add them to appropriate
-   # dictionary entries (appending to lists).
-   for d in results:
-      try: dictionary[get_dataset_number(d['ldn'])].append(d['ldn'])
-      except ldn_wrong_type: dictionary[get_data_scope(d['ldn'])].append(d['ldn'])
-   return dictionary
+    # Go through the results and add them to appropriate
+    # dictionary entries (appending to lists).
+    for d in results:
+        try:
+            dictionary[get_dataset_number(d['ldn'])].append(d['ldn'])
+        except ldn_wrong_type:
+            dictionary[get_data_scope(d['ldn'])].append(d['ldn'])
+    return dictionary
 
 
 # Check whether an LDN is actually available and valid on AMI.
 def is_available(ldn):
-   amiclient = pyAMI.client.Client('atlas')
-   try: results = pyAMI.atlas.api.list_datasets(amiclient, patterns = [ldn], fields = ['ldn'])
-   except pyAMI.exception.Error: exit_with_pyami_exception()
-   for d in results:
-      if d['ldn'] == ldn: return True
-   return False
+    amiclient = pyAMI.client.Client('atlas')
+    try:
+        results = pyAMI.atlas.api.list_datasets(amiclient, patterns=[ldn], fields=['ldn'])
+    except pyAMI.exception.Error:
+        exit_with_pyami_exception()
+    for d in results:
+        if d['ldn'] == ldn:
+            return True
+    return False
 
 
 # Check whether an LDN refers to data (and not MC).
 def is_data(ldn):
-   if (ldn[0:4] == "data"): return True
-   return False
+    if (ldn[0:4] == "data"):
+        return True
+    return False
 
 
 # From a given list of LDNs, pick the latest one (i.e. extract
 # the p-tag and pick the LDN with the highest one). If the p-tag
 # cannot be identified, just return None.
 def pick_newest_derivation(ldn_list):
-   if len(ldn_list) == 0: return ""
-   try:
-      get_ptag_as_int = lambda a: int(get_ptag(a)[1:])
-      return sorted(ldn_list, key = get_ptag_as_int)[-1]
-   except ldn_decypher_error:
-      return None
+    if len(ldn_list) == 0: return ""
+    try:
+        get_ptag_as_int = lambda a: int(get_ptag(a)[1:])
+        return sorted(ldn_list, key = get_ptag_as_int)[-1]
+    except ldn_decypher_error:
+        return None
 
 
 # Print the status of a list of samples on AMI. This takes a list
 # of objects of type TopExamples.grid.Sample, wich then contain
 # lists of datasets. Set the second argument to "True" will make
 # the function stop on any errors.
-def check_sample_status(samples, stop_on_error = False):
-   for s in samples:
-      print('\n' + logger.WARNING + s.name + logger.ENDC + " (%s %s)" % (len(s.datasets), "dataset" if len(s.datasets) == 1 else "datasets"))
-      derivations = get_derivations(s.datasets)
-      status_ok = True
-
-      for ldn in s.datasets:
-         # First try to understand what type of LDN we're looking
-         # at (e.g. recon.AOD or DAOD_xx derivations). If this
-         # fails, exit here.
-         try:
-            dataset_type = get_type(ldn)
-         except:
-            print("Could not identify dataset type (e.g. recon.AOD or DAOD_TOPQ1) of LDN: %s" % ldn)
-            sys.exit(1)
-
-         # Try to guess the name of the dictionary key. If the
-         # LDN is of type MC, then the dataset number should be
-         # the key, for data it's the data scope.
-         try: dict_key = get_dataset_number(ldn)
-         except ldn_wrong_type: dict_key = get_data_scope(ldn)
-         latest_ldn = pick_newest_derivation(derivations[dict_key])
-
-         status_msg = ""
-
-         # First output whether the requested LDN exists and
-         # has a valid entry in the AMI database.
-         if is_available(ldn):
-            status_msg = logger.OKGREEN + "found" + logger.ENDC
-         else:
-            status_msg = logger.FAIL + "not found" + logger.ENDC
-            status_ok = False
-
-         # If the dataset is _not_ a derivation, output its type
-         # and mark it in red.
-         if dataset_type[0:5] != "DAOD_":
-            status_msg += ", " + logger.WARNING + "Type: " + dataset_type + logger.ENDC
-            status_ok = False
-
-         # Then output the derivation status: (1) no derivation
-         # available at all, (2) derivations available, but the
-         # requested p-tag is not the latest, (3) requested p-tag
-         # is the latest.
-         if not latest_ldn:
-            status_ok = False
-         elif not ldn == latest_ldn:
+def check_sample_status(samples, stop_on_error=False):
+    for s in samples:
+        print('\n' + logger.WARNING + s.name + logger.ENDC
+                + " ({0} {1})".format(len(s.datasets), "dataset" if len(s.datasets) == 1 else "datasets"))
+        derivations = get_derivations(s.datasets)
+        status_ok = True
+
+        for ldn in s.datasets:
+            # First try to understand what type of LDN we're looking
+            # at (e.g. recon.AOD or DAOD_xx derivations). If this
+            # fails, exit here.
             try:
-               status_msg += ", " + logger.WARNING + "latest p-tag: " + get_ptag(latest_ldn) + logger.ENDC
-               status_ok = False
-            except ldn_decypher_error:
-               print("Could not identify p-tag of LDN: %s" % latest_ldn)
-               sys.exit(1)
-         else:
-            status_msg += ", " + logger.OKGREEN + "latest" + logger.ENDC
-
-         print(" - %s (%s)" % (ldn, status_msg))
-
-      # Make the function stop if requested and any of the
-      # datasets of the previous sample list had problems.
-      if (stop_on_error and not status_ok):
-         print("\nRequested to stop on error. Please check the above samples ... ")
-         sys.exit(1)
+                dataset_type = get_type(ldn)
+            except Exception:
+                print("Could not identify dataset type (e.g. recon.AOD or DAOD_TOPQ1) of LDN: %s" % ldn)
+                sys.exit(1)
+
+            # Try to guess the name of the dictionary key. If the
+            # LDN is of type MC, then the dataset number should be
+            # the key, for data it's the data scope.
+            try:
+                dict_key = get_dataset_number(ldn)
+            except ldn_wrong_type:
+                dict_key = get_data_scope(ldn)
+            latest_ldn = pick_newest_derivation(derivations[dict_key])
+
+            status_msg = ""
+
+            # First output whether the requested LDN exists and
+            # has a valid entry in the AMI database.
+            if is_available(ldn):
+                status_msg = logger.OKGREEN + "found" + logger.ENDC
+            else:
+                status_msg = logger.FAIL + "not found" + logger.ENDC
+                status_ok = False
+
+            # If the dataset is _not_ a derivation, output its type
+            # and mark it in red.
+            if dataset_type[0:5] != "DAOD_":
+                status_msg += ", " + logger.WARNING + "Type: " + dataset_type + logger.ENDC
+                status_ok = False
+
+            # Then output the derivation status: (1) no derivation
+            # available at all, (2) derivations available, but the
+            # requested p-tag is not the latest, (3) requested p-tag
+            # is the latest.
+            if not latest_ldn:
+                status_ok = False
+            elif not ldn == latest_ldn:
+                try:
+                    status_msg += ", " + logger.WARNING + "latest p-tag: " + get_ptag(latest_ldn) + logger.ENDC
+                    status_ok = False
+                except ldn_decypher_error:
+                    print("Could not identify p-tag of LDN: %s" % latest_ldn)
+                    sys.exit(1)
+            else:
+                status_msg += ", " + logger.OKGREEN + "latest" + logger.ENDC
+
+            print(" - %s (%s)" % (ldn, status_msg))
+
+        # Make the function stop if requested and any of the
+        # datasets of the previous sample list had problems.
+        if (stop_on_error and not status_ok):
+            print("\nRequested to stop on error. Please check the above samples ... ")
+            sys.exit(1)
 
 
 if __name__ == '__main__':
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/analysis.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/analysis.py
index 1cc750b9331d86f28c5fa2bfaf9b42a49578cf69..d2b630d0007f9e7c32bd079ab3772cba0404eef0 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/analysis.py
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/analysis.py
@@ -1,86 +1,81 @@
-# 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 logger
 import ami
 
 import ROOT
 
-import glob
 import os
 import sys
 import pickle
 
 ROOT.TFile.SetReadStreamerInfo(False)
 
-class DS:
-  def __init__(self, id, xsec, kfac, shower):
-    self.id = id
-    self.xsec = xsec
-    self.kfac = kfac
-    self.shower = shower
-
-class TopDataPreparation:
-  def __init__(self, filename):
-    self.datasets = {}
-    self.filename = filename
 
-    input = open(filename)
+class DS:
+    def __init__(self, id, xsec, kfac, shower):
+        self.id = id
+        self.xsec = xsec
+        self.kfac = kfac
+        self.shower = shower
 
-    for l in input:
-      #print l
-      if l.find('#') > -1:
-        l = l.split('#')[0]
 
-      l = l.strip().split()
+class TopDataPreparation:
+    def __init__(self, filename):
+        self.datasets = {}
+        self.filename = filename
 
-      #print l
-      if len(l) >= 3:
-        id = int(l[0])
-        xsec = float(l[1])
-        kfac = float(l[2])
+        input = open(filename)
 
-        shower = 'not available'
-        if len(l) >= 4:
-          shower = l[3]
+        for line in input:
+            if line.find('#') > -1:
+                line = line.split('#')[0]
 
-        self.datasets[id] = DS(id, xsec, kfac, shower)
+            line = line.strip().split()
 
-      #print l
-    input.close()
+            if len(line) >= 3:
+                id = int(line[0])
+                xsec = float(line[1])
+                kfac = float(line[2])
 
-  def getFilename(self):
-      return self.filename
+                shower = 'not available'
+                if len(line) >= 4:
+                    shower = line[3]
 
-  def hasID(self, id):
-    return self.datasets.has_key(id)
+                self.datasets[id] = DS(id, xsec, kfac, shower)
 
-  def getRawXsection(self, id):
-    if self.datasets.has_key(id):
-      ds = self.datasets[id]
-      return ds.xsec
+        input.close()
 
-    return 0
+    def getFilename(self):
+        return self.filename
 
-  def getKfactor(self, id):
-      if self.datasets.has_key(id):
-        ds = self.datasets[id]
-        return ds.kfac
+    def hasID(self, id):
+        return id in self.datasets
 
-      return 0
+    def getRawXsection(self, id):
+        if id in self.datasets:
+            ds = self.datasets[id]
+            return ds.xsec
+        return 0
 
-  def getXsection(self, id):
-    if self.datasets.has_key(id):
-      ds = self.datasets[id]
-      return ds.xsec * ds.kfac
+    def getKfactor(self, id):
+        if id in self.datasets:
+            ds = self.datasets[id]
+            return ds.kfac
+        return 0
 
-    return 0
+    def getXsection(self, id):
+        if id in self.datasets:
+            ds = self.datasets[id]
+            return ds.xsec * ds.kfac
+        return 0
 
-  def getShower(self, id):
-    if self.datasets.has_key(id):
-      ds = self.datasets[id]
-      return ds.shower
+    def getShower(self, id):
+        if id in self.datasets:
+            ds = self.datasets[id]
+            return ds.shower
+        return 0
 
-    return 0
 
 def queryAmi(amiSamples, tag):
     sys.stdout.write('-> %s: ' % tag)
@@ -90,23 +85,23 @@ def queryAmi(amiSamples, tag):
     print(len(ds), 'datasets')
     amiSamples.update(ds)
 
+
 def cacheAmi(ptaglist):
     try:
-        amiSamples = pickle.load(open("amiyields.pickle", "rb" ))
+        amiSamples = pickle.load(open("amiyields.pickle", "rb"))
         print(logger.OKBLUE + 'Using cached yields - to force me to query AMI delete amiyields.pickle' + logger.ENDC)
     except IOError as ioex:
         if ioex.errno == 2:
             print(logger.OKBLUE + 'Asking AMI' + logger.ENDC)
 
             amiSamples = {}
-            
+
             for ptag in ptaglist:
-              #data15_13TeV.periodD.physics_Main.PhysCont.DAOD_{}.grp15_v01_p2667
-              queryAmi(amiSamples, 'data16_13TeV.%.physics_Main.%.DAOD_TOPQ%' + ptag)
-              queryAmi(amiSamples, 'data15_13TeV.%.physics_Main.%.DAOD_TOPQ%' + ptag)
-              queryAmi(amiSamples, 'data16_13TeV.period%physics_Main.PhysCont.DAOD_TOPQ%' + ptag)
-              queryAmi(amiSamples, 'data15_13TeV.period%physics_Main.PhysCont.DAOD_TOPQ%' + ptag)
-              queryAmi(amiSamples, 'mc15_13TeV.%.DAOD_TOPQ%.%' + ptag)
+                queryAmi(amiSamples, 'data16_13TeV.%.physics_Main.%.DAOD_TOPQ%' + ptag)
+                queryAmi(amiSamples, 'data15_13TeV.%.physics_Main.%.DAOD_TOPQ%' + ptag)
+                queryAmi(amiSamples, 'data16_13TeV.period%physics_Main.PhysCont.DAOD_TOPQ%' + ptag)
+                queryAmi(amiSamples, 'data15_13TeV.period%physics_Main.PhysCont.DAOD_TOPQ%' + ptag)
+                queryAmi(amiSamples, 'mc16_13TeV.%.DAOD_TOPQ%.%' + ptag)
 
             if len(amiSamples) == 0:
                 print(logger.FAIL + 'Something went wrong when trying to get the data from ami' + logger.ENDC)
@@ -114,51 +109,20 @@ def cacheAmi(ptaglist):
             else:
                 pickle.dump(amiSamples, open("amiyields.pickle", "wb"))
 
-    return amiSamples
-
-def getDatasetYield(directoryName):
-    counter = 0
+        return amiSamples
 
-    #this sucks - think of a better way
-    histogramsIKnowAbout = ["all/cutflow",
-                            "ee/cutflow",
-                            "mumu/cutflow",
-                            "emu/cutflow",
-                            "ejets/cutflow",
-                            "mujets/cutflow"]
 
-    #i  = 0
-    for fileName in glob.glob(directoryName + '/*root*'):
-        #print i, fileName
-        #i += 1
-        f = ROOT.TFile.Open(fileName)
-
-        if not f:
-            print(logger.FAIL + 'ERROR: Failed to open %s' % fileName + logger.ENDC)
-            continue
-
-        #Look for TDirectory file (not TTree) and read the cutflow from
-        #the first one that we come to (since we only want the initial events)
-        for key in f.GetListOfKeys():
-            if key.ReadObj().ClassName() == 'TDirectoryFile':
-                h = f.Get(key.GetName() + '/cutflow')
-                if h:
-                    counter += h.GetBinContent(1)
-                    break
-
-        f.Close()
-
-    return counter
-
-#Make a directory if it doesn't exist
 def makeDirectory(outputDirectory):
+    '''
+    Create a directory if it doesn't and print a message.
+    '''
     try:
         os.makedirs(outputDirectory)
         print('Made directory', outputDirectory)
-    except:
-        #directory already exists
+    except FileExistsError:  # directory already exists
         pass
 
+
 def makeNameFitOnTerminal(name, maxlength):
     evenshortername = name
 
@@ -170,6 +134,7 @@ def makeNameFitOnTerminal(name, maxlength):
 
     return evenshortername
 
+
 def makeFileNameFitOnTerminal(name, maxlength):
     evenshortername = name
 
@@ -179,146 +144,3 @@ def makeFileNameFitOnTerminal(name, maxlength):
         evenshortername = '.'.join(ar)
 
     return evenshortername
-
-def check(analysis, directory, runDirectory, samples):
-
-    localDatasetFolders = sorted(glob.glob(directory + '/*'))
-
-    #print localDatasetFolders
-
-    ptaglist = []
-
-    localMap = {}
-    for l in localDatasetFolders:
-        justfile = os.path.basename(l)
-        #print 'justfile', justfile
-        #print justfile.split('.')
-        shortname = justfile.split('.')[2] + '.' + justfile.split('.')[4] + '.' + justfile.split('.')[5]
-        localMap[shortname] = l
-        #print 'localMap:', localMap.keys()
-        taglist = (justfile.split('.')[5]).split('_')
-
-        for tag in taglist:
-          if "p" in tag and not "grp" in tag:
-            IsInList = False
-            for helptag in ptaglist:
-              if tag in helptag:
-                IsInList = True
-            if not IsInList:
-              ptaglist.append(tag)
-
-    print(ptaglist)
-
-    amiSamples = cacheAmi(ptaglist)
-
-    #print amiSamples
-
-    #Organise into dsid.derivation.tags: yield
-    amiSamples2 = {}
-    for l in amiSamples.keys():
-        newname = l.replace('/','').split('.')
-        #print newname,
-        newname = newname[1] + '.' + newname[-2] + '.' + newname[-1]
-        #print newname
-        amiSamples2[newname] = amiSamples[l]
-
-    #for k in sorted(amiSamples2.keys()):
-    #   print k, amiSamples2[k]
-
-    analyses = []
-    bad = []
-
-    print('%s%50s %90s %12s %12s%s' % (logger.OKBLUE, 'dsid.gridtag', 'local location', 'local yield', 'ami yield', logger.ENDC))
-    for sample in samples:
-        existingSampleFilenames = []
-
-        print(logger.OKBLUE + sample.name + logger.ENDC)
-        for ds in sample.datasets:
-            splitName = ds.replace('/','').split('.')
-            shortname = splitName[1] + '.' + splitName[-2] + '.' + splitName[-1]
-            #print 'shortname', shortname
-
-            #local yield
-            directory = ''
-            directoryYield = 0
-            if localMap.has_key(shortname):
-                #print 'key    ', localMap[shortname]
-                directory = localMap[shortname]
-                directoryYield = getDatasetYield(directory)
-
-            #ami yield
-            amiYield = 0
-            if amiSamples2.has_key(shortname):
-                #print 'here', amiSamples2[shortname]
-                amiYield = amiSamples2[shortname]
-
-            colourstart = ''
-            colourend = ''
-
-            #no events in local copy
-            if directoryYield == 0:
-                colourstart = logger.FAIL
-                colourend = logger.ENDC
-
-            #local not the same as ami
-            if directoryYield != amiYield:
-                colourstart = logger.FAIL
-                colourend = logger.ENDC
-
-            evenshortername = makeNameFitOnTerminal(shortname, 50)
-            eventshorterfilename = makeFileNameFitOnTerminal(directory.split('/')[-1], 60)
-
-            print('%s%50s %90s %12d %12d%s' % (colourstart, evenshortername, eventshorterfilename, directoryYield, amiYield,  colourend))
-
-            if amiYield > 0 and directoryYield != amiYield:
-                bad.append(ds)
-
-            if localMap.has_key(shortname):
-                out = open('%s/input.txt' % directory, 'w')
-                for l in sorted(glob.glob('%s/*root*' % directory)):
-                    out.write(l + '\n')
-                out.close()
-
-                #only run on files that contain events
-                if directoryYield > 0:
-                    analyses.append('cd %s;mini-to-plots %s %s/input.txt' % (runDirectory, analysis, directory))
-
-                    #figure out the output filename from mini-to-plots so we can merge them
-                    components = directory.split('/')[-1].split('.')
-                    outputName = '.'.join(components[2:8])
-                    existingSampleFilenames.append(outputName)
-
-        #generate the command to merge them together
-        if len(existingSampleFilenames) > 0:
-            mergelist = ' '.join(existingSampleFilenames)
-            analyses.append('cd %s;hadd -f %s.root %s' % (runDirectory, sample.name, mergelist))
-
-    if '--debug' in sys.argv:
-        print('')
-        print('')
-        print('These commands are going to be run:')
-        for l in analyses:
-            print(l)
-
-    if '--bad' in sys.argv:
-        print('')
-        print('')
-        print('These are datasets where the ami yield does not match')
-        print('TopExamples.grid.Add("Resubmit").datasets = [')
-
-        for l in bad:
-            print('"%s",' % l)
-
-        print(']')
-        print("resubmit = TopExamples.grid.Samples(['Resubmit'])")
-        print('TopExamples.grid.submit(config, resubmit)')
-
-    if '--run' in sys.argv:
-        makeDirectory(runDirectory)
-
-        print('')
-        print('')
-        print(analyses)
-        for i, l in enumerate(analyses):
-            print(logger.OKBLUE + l + logger.ENDC)
-            o.ssysteml()
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/grid.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/grid.py
index 4ee66715d8c67c3e9837c05b7db9f79502f8df9c..079933065285b9498d300a4ce16ae27dc18a2f11 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/grid.py
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/grid.py
@@ -88,7 +88,7 @@ class Config:
     excludedSites   = ''
     forceSite       = ''
     noSubmit        = False
-    CMake           = (os.getenv('ROOTCORE_RELEASE_SERIES')=='25') # ROOTCORE_RELEASE_SERIES variable used to identify release (CMake required for R21)
+    CMake           = True
     mergeType       = 'Default' #None, Default, xAOD 
     destSE          = ''
     memory          = '2000' #in MB
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/plot.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/plot.py
index dde501e1a954ffc752d42884440bbf567f0e0b8d..837e1c7341619507346ccdadc0519412f8071af3 100755
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/plot.py
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/python/plot.py
@@ -1,31 +1,22 @@
-# 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 ROOT
 
-import sys
-import os
-
 import logger
 import AtlasStyle
+from analysis import makeDirectory
 
 ROOT.gROOT.SetBatch(True)
 
-#Make a directory if it doesn't exist
-def makeDirectory(outputDirectory):
-    try:
-        os.makedirs(outputDirectory)
-        print('Made directory', outputDirectory)
-    except:
-        print('directory already exists:', outputDirectory)
-        pass
 
 class Proc:
-    def __init__(self, filename, colour, caption, isMC = True):
+    def __init__(self, filename, colour, caption, isMC=True):
         self.name = filename
         self.colour = colour
         self.caption = caption
         self.isMC = isMC
 
+
 class Plotter:
     def __init__(self, htmlOutputName, stack, mcSF):
         self.out = open(htmlOutputName, 'w')
@@ -42,20 +33,23 @@ class Plotter:
 
         makeDirectory(self.imgDirectory)
 
-        print(logger.OKBLUE +'Stack configuration'+ logger.ENDC)
+        print(logger.OKBLUE + 'Stack configuration' + logger.ENDC)
         for currentProcess in stack:
-            print('  Name %s Colour %d Caption %s' % (currentProcess.name, currentProcess.colour, currentProcess.caption))
+            print('  Name {0} Colour {1} Caption {2}'.format(
+                currentProcess.name,
+                currentProcess.colour,
+                currentProcess.caption))
 
     def doneAndDusted(self):
         self.out.write('</html>\n')
         self.out.close()
 
     def getPlot(self, fileName, histName):
-        if not self.files.has_key(fileName):
+        if fileName not in self.files:
             f = ROOT.TFile.Open(fileName)
             if not f:
-                print(logger.FAIL + 'Failed to open %s' % fileName + logger.ENDC)
-                raise Exception('Failed to open %s' % fileName)
+                print(logger.FAIL + 'Failed to open ' + fileName + logger.ENDC)
+                raise Exception('Failed to open ' + fileName)
 
             self.files[fileName] = f
 
@@ -105,7 +99,7 @@ class Plotter:
                 h.Scale(self.mcSF)
                 ths.Add(h)
 
-                if blackoutline == None:
+                if blackoutline is None:
                     blackoutline = h.Clone()
                 else:
                     blackoutline.Add(h)
@@ -152,7 +146,7 @@ class Plotter:
 
         showIntLumi = True
         if showIntLumi:
-            s = "#int Ldt = " + str(round(self.mcSF, 1)) +  " fb^{-1}"
+            s = "#int Ldt = " + str(round(self.mcSF, 1)) + " fb^{-1}"
             lmode = ROOT.TLatex()
             lmode.SetNDC()
             lmode.SetTextColor(1)
@@ -174,20 +168,22 @@ class Plotter:
 
         #save a gif (and a little thumbnail)
         #and an eps version of the plot
-        imgname = histName.replace('/','.') + '.gif'
+        imgname = histName.replace('/', '.') + '.gif'
         self.c1.Print(self.imgDirectory + imgname)
-        self.c1.Print(self.imgDirectory + imgname.replace('.gif','.eps'))
+        self.c1.Print(self.imgDirectory + imgname.replace('.gif', '.eps'))
         self.thumbnail(self.imgDirectory + imgname, 200, 200)
-        self.out.write('<a href="%s"><img src="%s"></a>\n' % (self.imgDirectory + imgname, self.imgDirectory +imgname.replace('.gif', '_tn.gif')))
+        self.out.write('<a href="{0}"><img src="{1}"></a>\n'.format(
+            self.imgDirectory + imgname,
+            self.imgDirectory + imgname.replace('.gif', '_tn.gif')))
 
     def br(self):
         self.out.write('<br>\n')
 
     def h1(self, txt):
-        self.out.write('<h1>%s</h1>\n' % txt)
+        self.out.write('<h1>{0}</h1>\n'.format(txt))
 
     def h2(self, txt):
-        self.out.write('<h2>%s</h2>\n' % txt)
+        self.out.write('<h2>{0}</h2>\n'.format(txt))
 
     def h3(self, txt):
-        self.out.write('<h3>%s</h3>\n' % txt)
+        self.out.write('<h3>{0}</h3>\n'.format(txt))
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/01SubmitToGrid.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/01SubmitToGrid.py
index e37a7f43a8b7725513ec394d9497bdf9eb310f80..0bb82bdcdd5525453c537187767acdac7affef91 100755
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/01SubmitToGrid.py
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/01SubmitToGrid.py
@@ -22,6 +22,7 @@ import MC16_TOPQ1
 config = TopExamples.grid.Config()
 config.code          = 'top-xaod'
 config.settingsFile  = 'validation-cuts.txt'
+# in case you want to run multiple configurations in a single file:
 #config.settingsFile  = 'validation-cuts_Topo.txt,validation-cuts_PFlow.txt'
 #config.combine_outputFile = 'out.root'
 #config.combine_prefixes = 'Topo,PFlow'
@@ -29,11 +30,11 @@ config.settingsFile  = 'validation-cuts.txt'
 config.gridUsername  = 'iconnell' # use e.g. phys-top or phys-higgs for group production
 config.suffix        = '17-10-03'
 config.excludedSites = ''
-config.noSubmit      = False
+config.noSubmit      = False # set to True if you just want to test the submission
 config.mergeType     = 'Default' #'None', 'Default' or 'xAOD'
 config.destSE        = '' #This is the default (anywhere), or try e.g. 'UKI-SOUTHGRID-BHAM-HEP_LOCALGROUPDISK'
-# by default the requested memory is set to 2GB, if you need to increase this, please disable the line below!!!
-# config.memory = '4000' 
+# by default the requested memory is set to 2GB, if you need to increase this, see the option below
+# config.memory = '4000' # NOTE grid sites with 4GB for single-core user jobs are rare
 #config.nameShortener = MyFancyShortener # to use your own physics part shortening function - uncomment here and in the function definition above
 
 ###############################################################################
@@ -76,4 +77,3 @@ names = ['TOPQ1_ttbar_PowPy8',
 samples = TopExamples.grid.Samples(names)
 TopExamples.ami.check_sample_status(samples)  # Call with (samples, True) to halt on error
 TopExamples.grid.submit(config, samples)
-
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/01SubmitToGrid_Tutorial.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/01SubmitToGrid_Tutorial.py
deleted file mode 100755
index c27371a1b709c27f41db1f2f66fad4af53787722..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/01SubmitToGrid_Tutorial.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-import TopExamples.grid
-import DerivationTags
-import Data_rel21
-import MC16_TOPQ1
-
-config = TopExamples.grid.Config()
-config.code          = 'top-xaod'
-config.settingsFile  = 'dil-cuts.txt'
-config.gridUsername  = 'aknue'
-config.suffix        = '02-06-02'
-config.excludedSites = ''
-config.noSubmit      = False # set to True if you just want to test the submission
-config.CMake         = True # need to set to True for CMake-based releases (release 21)
-config.mergeType     = 'Default' #'None', 'Default' or 'xAOD'
-config.destSE        = '' #This is the default (anywhere), or try e.g. 'UKI-SOUTHGRID-BHAM-HEP_LOCALGROUPDISK'
-
-
-###Data - look in Data_rel21.py
-###MC Simulation - look in MC16_TOPQ1.py
-###Using a few test samples produced with release 21
-###Edit these lines if you don't want to run everything!
-names = [
-    'TOPQ1_ttbar_PowPy8',
-#    'Data16_TOPQ1',
-]
-
-samples = TopExamples.grid.Samples(names)
-TopExamples.grid.submit(config, samples)
-
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/03LocalAnalysis.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/03LocalAnalysis.py
deleted file mode 100755
index 01a9aa72bb0ffb08dbf9065ffe2731351313421a..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/03LocalAnalysis.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-import TopExamples.analysis
-import TopExamples.grid
-import TopExamples.logger as logger
-import DerivationTags
-import Data
-import MC15c_TOPQ1
-
-inputDirectory = '/ptmp/mpp/knand/TopAnalysis_13TeV/Downloads_2.4.24/Downloads/'
-runDirectory   = 'test1/'
-analysis       = 'Dilepton'
-
-#For data
-print logger.OKGREEN + 'Data' + logger.ENDC
-names = ['Data15_TOPQ1', 'Data16_TOPQ1']
-samples = TopExamples.grid.Samples(names)
-TopExamples.analysis.check(analysis, inputDirectory, runDirectory, samples)
-
-print '\n\n'
-print logger.OKGREEN + 'MC simulation' + logger.ENDC
-names = [
-    'TOPQ1_ttbar_PowPy6',
-    'TOPQ1_singleTop_PowPy6',                                                                                                                                                           
-    'TOPQ1_ttV',                                                                                                                                                                        
-    'TOPQ1_Diboson_Sherpa',                                                                                                                                                             
-    'TOPQ1_Wjets_Sherpa22',                                                                                                                                                             
-    'TOPQ1_Zjets_Sherpa22',  
-]
-
-samples = TopExamples.grid.Samples(names)
-TopExamples.analysis.check(analysis, inputDirectory, runDirectory, samples)
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/03LocalAnalysis_Tutorial.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/03LocalAnalysis_Tutorial.py
deleted file mode 100755
index 0ceb76cdcedbefcb95b807ce70931cb2e74a7cd6..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/03LocalAnalysis_Tutorial.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-import TopExamples.analysis
-import TopExamples.grid
-import TopExamples.logger as logger
-import DerivationTags
-import Data_rel21
-import MC16_TOPQ1
-
-inputDirectory = '/tmp/YOURUSERNAME/DownloadFolder/'
-runDirectory   = 'test1/'
-analysis       = 'Dilepton'
-
-print '\n\n'
-print logger.OKGREEN + 'MC simulation' + logger.ENDC
-names = [
-'TOPQ1_ttbar_PowPy8',
-]
-
-samples = TopExamples.grid.Samples(names)
-TopExamples.analysis.check(analysis, inputDirectory, runDirectory, samples)
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/11CrossSection.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/11CrossSection.py
deleted file mode 100755
index f442327f19ee54ceb53f4d275a727bc5ebd107a1..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/11CrossSection.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-import TopExamples.analysis
-import os
-import sys
-
-if len(sys.argv) != 2:
-    print 'Use like this:'
-    print 'python %s %s' % (sys.argv[0], '410000')
-    print sys.exit(1)
-
-id = 0
-try:
-    id = int(sys.argv[1])
-except:
-    print sys.argv[1], 'is not a number'
-    print 'Use like this:'
-    print 'python %s %s' % (sys.argv[0], '410000')
-    sys.exit()
-
-filename = 'XSection-MC15-13TeV.data'
-tdp = TopExamples.analysis.TopDataPreparation(os.getenv('ROOTCOREBIN') + '/data/TopDataPreparation/' + filename)
-
-print 'Using', tdp.getFilename()
-print ''
-
-if tdp.hasID(id):
-    print 'ID: %s' % id
-    print '  Cross-section: %f (%f * %f)' % (tdp.getXsection(id), tdp.getRawXsection(id), tdp.getKfactor(id))
-    print '  Shower       : %s' % tdp.getShower(id)
-else:
-    print 'ID: %s not available' % id
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/Data.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/Data.py
deleted file mode 100644
index 766c4a0a5dacfe84a0f32f3e4270ea1a003ead75..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/Data.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-import TopExamples.grid
-import TopExamples.ami
-
-# Reprocessed 2015 data
-# includes runs in:
-# http://atlas.web.cern.ch/Atlas/GROUPS/DATABASE/GroupData/GoodRunsLists/data15_13TeV/20160622/data15_13TeV.periodAllYear_DetStatus-v79-repro20-02_DQDefects-00-02-02_PHYS_StandardGRL_All_Good_25ns.xml
-DATA15 = ['data15_13TeV.periodD.physics_Main.PhysCont.DAOD_{}.grp15_v01_p2667',
-          'data15_13TeV.periodE.physics_Main.PhysCont.DAOD_{}.grp15_v01_p2667',
-          'data15_13TeV.periodF.physics_Main.PhysCont.DAOD_{}.grp15_v01_p2667',
-          'data15_13TeV.periodG.physics_Main.PhysCont.DAOD_{}.grp15_v01_p2667',
-          'data15_13TeV.periodH.physics_Main.PhysCont.DAOD_{}.grp15_v01_p2667',
-          'data15_13TeV.periodJ.physics_Main.PhysCont.DAOD_{}.grp15_v01_p2667']
-
-# Full 2016 data (periods A-L, lumi = 33257.2 pb^{-1})
-# includes runs in:
-# http://atlas.web.cern.ch/Atlas/GROUPS/DATABASE/GroupData/GoodRunsLists/data16_13TeV/20161101/data16_13TeV.periodAllYear_DetStatus-v83-pro20-15_DQDefects-00-02-04_PHYS_StandardGRL_All_Good_25ns.xml
-DATA16 = ['data16_13TeV.periodA.physics_Main.PhysCont.DAOD_{}.grp16_v01_p2667',
-          'data16_13TeV.periodB.physics_Main.PhysCont.DAOD_{}.grp16_v01_p2667',
-          'data16_13TeV.periodC.physics_Main.PhysCont.DAOD_{}.grp16_v01_p2667_p2689',
-          'data16_13TeV.periodD.physics_Main.PhysCont.DAOD_{}.grp16_v01_p2689',
-          'data16_13TeV.periodE.physics_Main.PhysCont.DAOD_{}.grp16_v01_p2689',
-          'data16_13TeV.periodF.physics_Main.PhysCont.DAOD_{}.grp16_v01_p2689',
-          'data16_13TeV.periodG.physics_Main.PhysCont.DAOD_{}.grp16_v01_p2769',
-          'data16_13TeV.periodI.physics_Main.PhysCont.DAOD_{}.grp16_v01_p2769',
-          'data16_13TeV.periodK.physics_Main.PhysCont.DAOD_{}.grp16_v01_p2769',
-          'data16_13TeV.periodL.physics_Main.PhysCont.DAOD_{}.grp16_v01_p2769_p2840',]
-
-TopExamples.grid.Add('Data15_TOPQ1').datasets = [i.format('TOPQ1') for i in DATA15]
-TopExamples.grid.Add('Data15_TOPQ2').datasets = [i.format('TOPQ2') for i in DATA15]
-TopExamples.grid.Add('Data15_TOPQ3').datasets = [i.format('TOPQ3') for i in DATA15]
-TopExamples.grid.Add('Data15_TOPQ4').datasets = [i.format('TOPQ4') for i in DATA15]
-
-TopExamples.grid.Add('Data16_TOPQ1').datasets = [i.format('TOPQ1') for i in DATA16]
-TopExamples.grid.Add('Data16_TOPQ2').datasets = [i.format('TOPQ2') for i in DATA16]
-TopExamples.grid.Add('Data16_TOPQ3').datasets = [i.format('TOPQ3') for i in DATA16]
-TopExamples.grid.Add('Data16_TOPQ4').datasets = [i.format('TOPQ4') for i in DATA16]
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/DerivationTags.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/DerivationTags.py
index 708194248934b25158e83d13099ea4e9409ef6b6..57ce360d7202ee119f9320336df79d7617e0bdf5 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/DerivationTags.py
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/DerivationTags.py
@@ -1,14 +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
 
 import TopExamples
 
 #Moving the definition of ptags here, so we only have to modify them in a
 #single place from now on
 
-#DefaultDataPtag        = 'p2411'
 DefaultMCSkimmedPtag   = 'p2411'
 DefaultMCUnskimmedPtag = 'p2413'
 
+
 #https://twiki.cern.ch/twiki/bin/view/AtlasProtected/TopDerivations#Production_Caches
 def InteractiveSubmission():
     samples = TopExamples.grid.AvailableDatasets()
@@ -20,27 +20,28 @@ def InteractiveSubmission():
         txt = ''
         if nsamples != 1:
             txt = 's'
-        print '  (%d) %s (%s sample%s)' % (i, s, nsamples, txt)
+        print('  (%d) %s (%s sample%s)' % (i, s, nsamples, txt))
 
-    print ''
-    print 'Type the numbers you want to submit, separated by a comma e.g. 0,1,2,3'
-    data = raw_input('Type it here -> : ')
+    print('')
+    print('Type the numbers you want to submit, separated by a comma e.g. 0,1,2,3')
+    data = input('Type it here -> : ')
 
     txt_list = data.strip().split(',')
     names = [keys[int(x)] for x in txt_list]
 
     derivation = 'DAOD_TOPQ1'
-    print 'Which derivation would you like [%s]? ' % derivation
-    input = raw_input('Type it here -> : ')
-    if len(input) > 0:
-        derivation = input
+    print('Which derivation would you like [{0}]? '.format(derivation))
+    input_data = input('Type it here -> : ')
+    if len(input_data) > 0:
+        derivation = input_data
 
     ptag = DefaultMCSkimmedPtag
 
-    print 'Which ptag would you like %s = skimmed, %s = not skimmed [%s] ' % (DefaultMCSkimmedPtag, DefaultMCUnskimmedPtag, ptag)
-    input = raw_input('Type it here -> : ')
-    if len(input) > 0:
-        ptag = input
+    print('Which ptag would you like {0} = skimmed, {1} = not skimmed [{2}]'.format(
+        DefaultMCSkimmedPtag, DefaultMCUnskimmedPtag, ptag))
+    input_data = input('Type it here -> : ')
+    if len(input_data) > 0:
+        ptag = input_data
 
-    print names, derivation, ptag
+    print(names, derivation, ptag)
     return names, derivation, ptag
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/MC15c_TOPQ1.py b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/MC15c_TOPQ1.py
deleted file mode 100644
index b9b9798ba5813c02c96e8d077b2f2d5935607e43..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/MC15c_TOPQ1.py
+++ /dev/null
@@ -1,651 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-import TopExamples.grid
-# list of 25ns MC samples for the MC15c campaign                                                                                                                                                                                
-# this is a consistent mixture of different ptags                                                                                                                                                           
-
-TopExamples.grid.Add("TOPQ1_ttbar_PowPy6").datasets = [
-    "mc15_13TeV.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.DAOD_TOPQ1.e3698_s2608_s2183_r7725_r7676_p2669",
-    ]
-
-TopExamples.grid.Add("TOPQ1_ttbar_PowPy8").datasets = [
-    "mc15_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.DAOD_TOPQ1.e5458_s2726_r7772_r7676_p2877",
-]
-
-TopExamples.grid.Add("TOPQ1_ttbar_Sherpa221").datasets = [
-    "mc15_13TeV.410250.Sherpa_221_NNPDF30NNLO_ttbar_SingleLeptonP_MEPS_NLO.merge.DAOD_TOPQ1.e5450_s2726_r7772_r7676_p2877", 
-    "mc15_13TeV.410251.Sherpa_221_NNPDF30NNLO_ttbar_SingleLeptonM_MEPS_NLO.merge.DAOD_TOPQ1.e5450_s2726_r7772_r7676_p2877",
-    "mc15_13TeV.410252.Sherpa_221_NNPDF30NNLO_ttbar_dilepton_MEPS_NLO.merge.DAOD_TOPQ1.e5450_s2726_r7772_r7676_p2877", 
-]
-
-TopExamples.grid.Add("TOPQ1_ttbar_PowPy6_MassVar").datasets = [
-    "mc15_13TeV.410037.PowhegPythiaEvtGen_P2012_ttbar_hdamp170_nonallhad.merge.DAOD_TOPQ1.e4529_s2608_s2183_r7725_r7676_p2771", 
-    "mc15_13TeV.410038.PowhegPythiaEvtGen_P2012_ttbar_hdamp171p5_nonallhad.merge.DAOD_TOPQ1.e4529_s2608_s2183_r7725_r7676_p2771", 
-    "mc15_13TeV.410039.PowhegPythiaEvtGen_P2012_ttbar_hdamp173p5_nonallhad.merge.DAOD_TOPQ1.e4529_s2608_s2183_r7725_r7676_p2771",
-    "mc15_13TeV.410040.PowhegPythiaEvtGen_P2012_ttbar_hdamp175_nonallhad.merge.DAOD_TOPQ1.e4529_s2608_s2183_r7725_r7676_p2771",
-    "mc15_13TeV.410041.PowhegPythiaEvtGen_P2012_ttbar_hdamp177p5_nonallhad.merge.DAOD_TOPQ1.e4529_s2608_s2183_r7725_r7676_p2771",
-    ]
-
-TopExamples.grid.Add("TOPQ1_ttbar_Alt").datasets = [
-        "mc15_13TeV.410001.PowhegPythiaEvtGen_P2012radHi_ttbar_hdamp345_down_nonallhad.merge.DAOD_TOPQ1.e3783_s2608_r7725_r7676_p2669",
-        "mc15_13TeV.410002.PowhegPythiaEvtGen_P2012radLo_ttbar_hdamp172_up_nonallhad.merge.DAOD_TOPQ1.e3783_s2608_r7725_r7676_p2669",
-        "mc15_13TeV.410003.aMcAtNloHerwigppEvtGen_ttbar_nonallhad.merge.DAOD_TOPQ1.e4441_s2726_r7772_r7676_p2669",
-        "mc15_13TeV.410004.PowhegHerwigppEvtGen_UEEE5_ttbar_hdamp172p5_nonallhad.merge.DAOD_TOPQ1.e3836_a766_a821_r7676_p2669",
-        "mc15_13TeV.410159.aMcAtNloPythia8EvtGen_A14_NNPDF23_NNPDF30ME_ttbar_nonallhad.merge.DAOD_TOPQ1.e4683_s2726_r7725_r7676_p2669",
-        ]
-
-TopExamples.grid.Add("TOPQ1_TTH_aMCatNLO").datasets = [
-    "mc15_13TeV.341177.aMcAtNloHerwigppEvtGen_UEEE5_CTEQ6L1_CT10ME_ttH125_dil.merge.DAOD_TOPQ1.e4277_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.341270.aMcAtNloHerwigppEvtGen_UEEE5_CTEQ6L1_CT10ME_ttH125_semilep.merge.DAOD_TOPQ1.e4277_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.341271.aMcAtNloHerwigppEvtGen_UEEE5_CTEQ6L1_CT10ME_ttH125_allhad.merge.DAOD_TOPQ1.e4277_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.343365.aMcAtNloPythia8EvtGen_A14_NNPDF23_NNPDF30ME_ttH125_dilep.merge.DAOD_TOPQ1.e4706_s2726_r7772_r7676_p2669",
-    "mc15_13TeV.343366.aMcAtNloPythia8EvtGen_A14_NNPDF23_NNPDF30ME_ttH125_semilep.merge.DAOD_TOPQ1.e4706_s2726_r7772_r7676_p2669",
-    "mc15_13TeV.343367.aMcAtNloPythia8EvtGen_A14_NNPDF23_NNPDF30ME_ttH125_allhad.merge.DAOD_TOPQ1.e4706_s2726_r7772_r7676_p2669",
-    ]
-
-TopExamples.grid.Add("TOPQ1_Hplus").datasets = [
-    "mc15_13TeV.341541.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H200_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341542.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H225_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341543.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H250_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341544.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H275_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341545.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H300_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341546.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H350_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341547.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H400_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341548.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H500_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341549.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H600_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341550.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H700_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341551.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H800_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341552.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H900_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341553.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H1000_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341554.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H1200_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341555.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H1400_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341556.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H1600_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341557.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H1800_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    "mc15_13TeV.341558.aMcAtNloPythia8EvtGen_A14NNPDF23LO_Hplus4FS_H2000_tb.merge.DAOD_TOPQ1.e4336_a766_a821_r7676_p2669",
-    ]
-
-TopExamples.grid.Add("TOPQ1_OtherHiggs").datasets = [
-    "mc15_13TeV.342283.PowhegPythia8EvtGen_CT10_AZNLOCTEQ6L1_VBFH125_inc.merge.DAOD_TOPQ1.e4246_s2726_r7772_r7676_p2669",
-    "mc15_13TeV.342284.Pythia8EvtGen_A14NNPDF23LO_WH125_inc.merge.DAOD_TOPQ1.e4246_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.342285.Pythia8EvtGen_A14NNPDF23LO_ZH125_inc.merge.DAOD_TOPQ1.e4246_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.342286.aMcAtNloPythia8EvtGen_A14NNPDF23LO_bbH125_yb2_inc.merge.DAOD_TOPQ1.e4259_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.342287.aMcAtNloPythia8EvtGen_A14NNPDF23LO_bbH125_ybyt_inc.merge.DAOD_TOPQ1.e4259_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.342299.aMcAtNloHerwigppEvtGen_UEEE5_CTEQ6L1_CT10ME_ttH125_inc.merge.DAOD_TOPQ1.e4346_s2608_s2183_a821_r7676_p2669",
-    "mc15_13TeV.342299.aMcAtNloHerwigppEvtGen_UEEE5_CTEQ6L1_CT10ME_ttH125_inc.merge.DAOD_TOPQ1.e4346_s2608_s2183_r7772_r7676_p2669",
-    ]
-
-TopExamples.grid.Add("TOPQ1_ttbar_MadGraph").datasets = [
-    "mc15_13TeV.343852.MadGraphPythia8EvtGen_A14NNPDF23LO_ttbar_Np0.merge.DAOD_TOPQ1.e4849_a766_a818_r7676_p2669",
-    "mc15_13TeV.343853.MadGraphPythia8EvtGen_A14NNPDF23LO_ttbar_Np1.merge.DAOD_TOPQ1.e4849_a766_a818_r7676_p2669",
-    "mc15_13TeV.343854.MadGraphPythia8EvtGen_A14NNPDF23LO_ttbar_Np2.merge.DAOD_TOPQ1.e4849_a766_a818_r7676_p2669",
-    ]
-
-TopExamples.grid.Add("TOPQ1_Diboson_Sherpa").datasets = [
-    "mc15_13TeV.361063.Sherpa_CT10_llll.merge.DAOD_TOPQ1.e3836_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361064.Sherpa_CT10_lllvSFMinus.merge.DAOD_TOPQ1.e3836_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361065.Sherpa_CT10_lllvOFMinus.merge.DAOD_TOPQ1.e3836_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361066.Sherpa_CT10_lllvSFPlus.merge.DAOD_TOPQ1.e3836_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361067.Sherpa_CT10_lllvOFPlus.merge.DAOD_TOPQ1.e3836_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361068.Sherpa_CT10_llvv.merge.DAOD_TOPQ1.e3836_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361070.Sherpa_CT10_llvvjj_ss_EW6.merge.DAOD_TOPQ1.e3836_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361071.Sherpa_CT10_lllvjj_EW6.merge.DAOD_TOPQ1.e3836_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361072.Sherpa_CT10_lllljj_EW6.merge.DAOD_TOPQ1.e3836_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361073.Sherpa_CT10_ggllll.merge.DAOD_TOPQ1.e3836_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361077.Sherpa_CT10_ggllvv.merge.DAOD_TOPQ1.e4641_s2726_r7772_r7676_p2669",
-    "mc15_13TeV.361091.Sherpa_CT10_WplvWmqq_SHv21_improved.merge.DAOD_TOPQ1.e4607_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.361092.Sherpa_CT10_WpqqWmlv_SHv21_improved.merge.DAOD_TOPQ1.e4607_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.361093.Sherpa_CT10_WlvZqq_SHv21_improved.merge.DAOD_TOPQ1.e4607_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.361094.Sherpa_CT10_WqqZll_SHv21_improved.merge.DAOD_TOPQ1.e4607_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.361095.Sherpa_CT10_WqqZvv_SHv21_improved.merge.DAOD_TOPQ1.e4607_s2726_r7772_r7676_p2669",
-    "mc15_13TeV.361096.Sherpa_CT10_ZqqZll_SHv21_improved.merge.DAOD_TOPQ1.e4607_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.361097.Sherpa_CT10_ZqqZvv_SHv21_improved.merge.DAOD_TOPQ1.e4607_s2726_r7772_r7676_p2669",
-    ]
-
-TopExamples.grid.Add("TOPQ1_Wjets_PowhegPy8").datasets = [
-    "mc15_13TeV.361100.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Wplusenu.merge.DAOD_TOPQ1.e3601_s2576_s2132_r7725_r7676_p2669",
-    "mc15_13TeV.361101.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Wplusmunu.merge.DAOD_TOPQ1.e3601_s2576_s2132_r7725_r7676_p2669",
-    "mc15_13TeV.361102.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Wplustaunu.merge.DAOD_TOPQ1.e3601_s2576_s2132_r7725_r7676_p2669",
-    "mc15_13TeV.361103.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Wminusenu.merge.DAOD_TOPQ1.e3601_s2576_s2132_r7725_r7676_p2669",
-    "mc15_13TeV.361104.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Wminusmunu.merge.DAOD_TOPQ1.e3601_s2576_s2132_r7725_r7676_p2669",
-    "mc15_13TeV.361105.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Wminustaunu.merge.DAOD_TOPQ1.e3601_s2576_s2132_r7772_r7676_p2669",
-    ]
-
-TopExamples.grid.Add("TOPQ1_Zjets_PowhegPy8").datasets = [
-    "mc15_13TeV.361106.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zee.merge.DAOD_TOPQ1.e3601_s2576_s2132_r7725_r7676_p2669",
-    "mc15_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.merge.DAOD_TOPQ1.e3601_s2576_s2132_r7725_r7676_p2669",
-    "mc15_13TeV.361108.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Ztautau.merge.DAOD_TOPQ1.e3601_s2726_r7725_r7676_p2669",
-    ]
-
-TopExamples.grid.Add("TOPQ1_Wjets_Sherpa").datasets = [
-    "mc15_13TeV.361300.Sherpa_CT10_Wenu_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361301.Sherpa_CT10_Wenu_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361302.Sherpa_CT10_Wenu_Pt0_70_BFilter.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361303.Sherpa_CT10_Wenu_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361304.Sherpa_CT10_Wenu_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361305.Sherpa_CT10_Wenu_Pt70_140_BFilter.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361306.Sherpa_CT10_Wenu_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361307.Sherpa_CT10_Wenu_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361308.Sherpa_CT10_Wenu_Pt140_280_BFilter.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361309.Sherpa_CT10_Wenu_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361310.Sherpa_CT10_Wenu_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361311.Sherpa_CT10_Wenu_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361312.Sherpa_CT10_Wenu_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361313.Sherpa_CT10_Wenu_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361314.Sherpa_CT10_Wenu_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361315.Sherpa_CT10_Wenu_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361316.Sherpa_CT10_Wenu_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361317.Sherpa_CT10_Wenu_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361318.Sherpa_CT10_Wenu_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361319.Sherpa_CT10_Wenu_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361320.Sherpa_CT10_Wenu_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361321.Sherpa_CT10_Wenu_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361322.Sherpa_CT10_Wenu_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361323.Sherpa_CT10_Wenu_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361324.Sherpa_CT10_Wmunu_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361325.Sherpa_CT10_Wmunu_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361326.Sherpa_CT10_Wmunu_Pt0_70_BFilter.merge.DAOD_TOPQ1.e3651_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361327.Sherpa_CT10_Wmunu_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361328.Sherpa_CT10_Wmunu_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361329.Sherpa_CT10_Wmunu_Pt70_140_BFilter.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361330.Sherpa_CT10_Wmunu_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361331.Sherpa_CT10_Wmunu_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361332.Sherpa_CT10_Wmunu_Pt140_280_BFilter.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361333.Sherpa_CT10_Wmunu_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361334.Sherpa_CT10_Wmunu_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361335.Sherpa_CT10_Wmunu_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361336.Sherpa_CT10_Wmunu_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361337.Sherpa_CT10_Wmunu_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361338.Sherpa_CT10_Wmunu_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361339.Sherpa_CT10_Wmunu_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361340.Sherpa_CT10_Wmunu_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361341.Sherpa_CT10_Wmunu_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361342.Sherpa_CT10_Wmunu_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361343.Sherpa_CT10_Wmunu_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361344.Sherpa_CT10_Wmunu_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361345.Sherpa_CT10_Wmunu_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361346.Sherpa_CT10_Wmunu_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361347.Sherpa_CT10_Wmunu_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361348.Sherpa_CT10_Wtaunu_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361349.Sherpa_CT10_Wtaunu_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361350.Sherpa_CT10_Wtaunu_Pt0_70_BFilter.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361351.Sherpa_CT10_Wtaunu_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361352.Sherpa_CT10_Wtaunu_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361353.Sherpa_CT10_Wtaunu_Pt70_140_BFilter.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361354.Sherpa_CT10_Wtaunu_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361355.Sherpa_CT10_Wtaunu_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361356.Sherpa_CT10_Wtaunu_Pt140_280_BFilter.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361357.Sherpa_CT10_Wtaunu_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361358.Sherpa_CT10_Wtaunu_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361359.Sherpa_CT10_Wtaunu_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361360.Sherpa_CT10_Wtaunu_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361361.Sherpa_CT10_Wtaunu_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361362.Sherpa_CT10_Wtaunu_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361363.Sherpa_CT10_Wtaunu_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361364.Sherpa_CT10_Wtaunu_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361365.Sherpa_CT10_Wtaunu_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361366.Sherpa_CT10_Wtaunu_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361367.Sherpa_CT10_Wtaunu_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361368.Sherpa_CT10_Wtaunu_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361369.Sherpa_CT10_Wtaunu_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361370.Sherpa_CT10_Wtaunu_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    "mc15_13TeV.361371.Sherpa_CT10_Wtaunu_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7725_r7676_p2669",
-    ]
-
-TopExamples.grid.Add("TOPQ1_Zjets_Sherpa").datasets = [
-    "mc15_13TeV.361372.Sherpa_CT10_Zee_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361373.Sherpa_CT10_Zee_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361374.Sherpa_CT10_Zee_Pt0_70_BFilter.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361375.Sherpa_CT10_Zee_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361376.Sherpa_CT10_Zee_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361377.Sherpa_CT10_Zee_Pt70_140_BFilter.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361378.Sherpa_CT10_Zee_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361379.Sherpa_CT10_Zee_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361380.Sherpa_CT10_Zee_Pt140_280_BFilter.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361381.Sherpa_CT10_Zee_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361382.Sherpa_CT10_Zee_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361383.Sherpa_CT10_Zee_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361384.Sherpa_CT10_Zee_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361385.Sherpa_CT10_Zee_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361386.Sherpa_CT10_Zee_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361387.Sherpa_CT10_Zee_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361388.Sherpa_CT10_Zee_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361389.Sherpa_CT10_Zee_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361390.Sherpa_CT10_Zee_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361391.Sherpa_CT10_Zee_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361392.Sherpa_CT10_Zee_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361393.Sherpa_CT10_Zee_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361394.Sherpa_CT10_Zee_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361395.Sherpa_CT10_Zee_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361396.Sherpa_CT10_Zmumu_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361397.Sherpa_CT10_Zmumu_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361398.Sherpa_CT10_Zmumu_Pt0_70_BFilter.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361399.Sherpa_CT10_Zmumu_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361400.Sherpa_CT10_Zmumu_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361401.Sherpa_CT10_Zmumu_Pt70_140_BFilter.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361402.Sherpa_CT10_Zmumu_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361403.Sherpa_CT10_Zmumu_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361404.Sherpa_CT10_Zmumu_Pt140_280_BFilter.merge.DAOD_TOPQ1.e3651_s2586_s2174_r7772_r7676_p2669",
-    "mc15_13TeV.361405.Sherpa_CT10_Zmumu_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361406.Sherpa_CT10_Zmumu_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361407.Sherpa_CT10_Zmumu_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361408.Sherpa_CT10_Zmumu_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361409.Sherpa_CT10_Zmumu_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361410.Sherpa_CT10_Zmumu_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361411.Sherpa_CT10_Zmumu_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361412.Sherpa_CT10_Zmumu_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361413.Sherpa_CT10_Zmumu_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361414.Sherpa_CT10_Zmumu_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361415.Sherpa_CT10_Zmumu_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361416.Sherpa_CT10_Zmumu_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361417.Sherpa_CT10_Zmumu_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361418.Sherpa_CT10_Zmumu_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361419.Sherpa_CT10_Zmumu_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361420.Sherpa_CT10_Ztautau_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361421.Sherpa_CT10_Ztautau_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361422.Sherpa_CT10_Ztautau_Pt0_70_BFilter.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361423.Sherpa_CT10_Ztautau_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361424.Sherpa_CT10_Ztautau_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361425.Sherpa_CT10_Ztautau_Pt70_140_BFilter.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361426.Sherpa_CT10_Ztautau_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361427.Sherpa_CT10_Ztautau_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361428.Sherpa_CT10_Ztautau_Pt140_280_BFilter.merge.DAOD_TOPQ1.e3733_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361429.Sherpa_CT10_Ztautau_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361430.Sherpa_CT10_Ztautau_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361431.Sherpa_CT10_Ztautau_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361432.Sherpa_CT10_Ztautau_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361433.Sherpa_CT10_Ztautau_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361434.Sherpa_CT10_Ztautau_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361435.Sherpa_CT10_Ztautau_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361436.Sherpa_CT10_Ztautau_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361437.Sherpa_CT10_Ztautau_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361438.Sherpa_CT10_Ztautau_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361439.Sherpa_CT10_Ztautau_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361440.Sherpa_CT10_Ztautau_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361441.Sherpa_CT10_Ztautau_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361442.Sherpa_CT10_Ztautau_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361443.Sherpa_CT10_Ztautau_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4133_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361468.Sherpa_CT10_Zee_Mll10to40_Pt0_70_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361469.Sherpa_CT10_Zee_Mll10to40_Pt0_70_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361470.Sherpa_CT10_Zee_Mll10to40_Pt70_140_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361471.Sherpa_CT10_Zee_Mll10to40_Pt70_140_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361472.Sherpa_CT10_Zee_Mll10to40_Pt140_400_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361473.Sherpa_CT10_Zee_Mll10to40_Pt140_400_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361474.Sherpa_CT10_Zee_Mll10to40_Pt400_E_CMS_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361475.Sherpa_CT10_Zee_Mll10to40_Pt400_E_CMS_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361476.Sherpa_CT10_Zmumu_Mll10to40_Pt0_70_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361477.Sherpa_CT10_Zmumu_Mll10to40_Pt0_70_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361478.Sherpa_CT10_Zmumu_Mll10to40_Pt70_140_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361479.Sherpa_CT10_Zmumu_Mll10to40_Pt70_140_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361480.Sherpa_CT10_Zmumu_Mll10to40_Pt140_400_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361481.Sherpa_CT10_Zmumu_Mll10to40_Pt140_400_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361482.Sherpa_CT10_Zmumu_Mll10to40_Pt400_E_CMS_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361483.Sherpa_CT10_Zmumu_Mll10to40_Pt400_E_CMS_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361484.Sherpa_CT10_Ztautau_Mll10to40_Pt0_70_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361485.Sherpa_CT10_Ztautau_Mll10to40_Pt0_70_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361486.Sherpa_CT10_Ztautau_Mll10to40_Pt70_140_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361487.Sherpa_CT10_Ztautau_Mll10to40_Pt70_140_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361488.Sherpa_CT10_Ztautau_Mll10to40_Pt140_400_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361489.Sherpa_CT10_Ztautau_Mll10to40_Pt140_400_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361490.Sherpa_CT10_Ztautau_Mll10to40_Pt400_E_CMS_BVeto.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361491.Sherpa_CT10_Ztautau_Mll10to40_Pt400_E_CMS_BFilter.merge.DAOD_TOPQ1.e4198_s2608_s2183_r7772_r7676_p2669",
-    ]
-
-TopExamples.grid.Add("TOPQ1_Triboson_Sherpa").datasets = [
-    "mc15_13TeV.361620.Sherpa_CT10_WWW_3l3v.merge.DAOD_TOPQ1.e4093_s2608_s2183_r8112_r7676_p2669",
-    "mc15_13TeV.361621.Sherpa_CT10_WWZ_4l2v.merge.DAOD_TOPQ1.e4053_s2608_s2183_r8112_r7676_p2669",
-    "mc15_13TeV.361622.Sherpa_CT10_WWZ_2l4v.merge.DAOD_TOPQ1.e4053_s2608_s2183_r8112_r7676_p2669",
-    "mc15_13TeV.361623.Sherpa_CT10_WZZ_5l1v.merge.DAOD_TOPQ1.e4093_s2608_s2183_r8112_r7676_p2669",
-    "mc15_13TeV.361624.Sherpa_CT10_WZZ_3l3v.merge.DAOD_TOPQ1.e4093_s2608_s2183_r8112_r7676_p2669",
-    "mc15_13TeV.361625.Sherpa_CT10_ZZZ_6l0v.merge.DAOD_TOPQ1.e4093_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361626.Sherpa_CT10_ZZZ_4l2v.merge.DAOD_TOPQ1.e4093_s2608_s2183_r7772_r7676_p2669",
-    "mc15_13TeV.361627.Sherpa_CT10_ZZZ_2l4v.merge.DAOD_TOPQ1.e4093_s2608_s2183_r7772_r7676_p2669",
-    ]
-
-TopExamples.grid.Add("TOPQ1_Zjets_Sherpa22").datasets = [
-    "mc15_13TeV.363102.Sherpa_NNPDF30NNLO_Ztautau_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e4742_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363103.Sherpa_NNPDF30NNLO_Ztautau_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e4742_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363104.Sherpa_NNPDF30NNLO_Ztautau_Pt70_140_BFilter.merge.DAOD_TOPQ1.e4792_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363105.Sherpa_NNPDF30NNLO_Ztautau_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e4666_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363106.Sherpa_NNPDF30NNLO_Ztautau_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e4666_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363107.Sherpa_NNPDF30NNLO_Ztautau_Pt140_280_BFilter.merge.DAOD_TOPQ1.e4742_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363108.Sherpa_NNPDF30NNLO_Ztautau_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4666_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363109.Sherpa_NNPDF30NNLO_Ztautau_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4792_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363110.Sherpa_NNPDF30NNLO_Ztautau_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4792_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363111.Sherpa_NNPDF30NNLO_Ztautau_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4666_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363112.Sherpa_NNPDF30NNLO_Ztautau_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4742_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363113.Sherpa_NNPDF30NNLO_Ztautau_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4742_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363114.Sherpa_NNPDF30NNLO_Ztautau_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4742_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363115.Sherpa_NNPDF30NNLO_Ztautau_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4792_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363116.Sherpa_NNPDF30NNLO_Ztautau_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4742_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363117.Sherpa_NNPDF30NNLO_Ztautau_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4666_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363118.Sherpa_NNPDF30NNLO_Ztautau_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4666_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363119.Sherpa_NNPDF30NNLO_Ztautau_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4666_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363120.Sherpa_NNPDF30NNLO_Ztautau_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4690_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363121.Sherpa_NNPDF30NNLO_Ztautau_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4690_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363122.Sherpa_NNPDF30NNLO_Ztautau_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4792_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363361.Sherpa_NNPDF30NNLO_Ztautau_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e4689_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363362.Sherpa_NNPDF30NNLO_Ztautau_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e4689_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363363.Sherpa_NNPDF30NNLO_Ztautau_Pt0_70_BFilter.merge.DAOD_TOPQ1.e4743_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363364.Sherpa_NNPDF30NNLO_Zmumu_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363365.Sherpa_NNPDF30NNLO_Zmumu_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363366.Sherpa_NNPDF30NNLO_Zmumu_Pt0_70_BFilter.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363367.Sherpa_NNPDF30NNLO_Zmumu_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363368.Sherpa_NNPDF30NNLO_Zmumu_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363369.Sherpa_NNPDF30NNLO_Zmumu_Pt70_140_BFilter.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363370.Sherpa_NNPDF30NNLO_Zmumu_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363371.Sherpa_NNPDF30NNLO_Zmumu_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363372.Sherpa_NNPDF30NNLO_Zmumu_Pt140_280_BFilter.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363373.Sherpa_NNPDF30NNLO_Zmumu_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363374.Sherpa_NNPDF30NNLO_Zmumu_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363375.Sherpa_NNPDF30NNLO_Zmumu_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4772_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363376.Sherpa_NNPDF30NNLO_Zmumu_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363377.Sherpa_NNPDF30NNLO_Zmumu_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363378.Sherpa_NNPDF30NNLO_Zmumu_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4772_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363379.Sherpa_NNPDF30NNLO_Zmumu_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363380.Sherpa_NNPDF30NNLO_Zmumu_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363381.Sherpa_NNPDF30NNLO_Zmumu_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363382.Sherpa_NNPDF30NNLO_Zmumu_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363383.Sherpa_NNPDF30NNLO_Zmumu_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363384.Sherpa_NNPDF30NNLO_Zmumu_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363385.Sherpa_NNPDF30NNLO_Zmumu_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363386.Sherpa_NNPDF30NNLO_Zmumu_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363387.Sherpa_NNPDF30NNLO_Zmumu_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363388.Sherpa_NNPDF30NNLO_Zee_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363389.Sherpa_NNPDF30NNLO_Zee_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363390.Sherpa_NNPDF30NNLO_Zee_Pt0_70_BFilter.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363391.Sherpa_NNPDF30NNLO_Zee_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363392.Sherpa_NNPDF30NNLO_Zee_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e4772_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363393.Sherpa_NNPDF30NNLO_Zee_Pt70_140_BFilter.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363394.Sherpa_NNPDF30NNLO_Zee_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363395.Sherpa_NNPDF30NNLO_Zee_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363396.Sherpa_NNPDF30NNLO_Zee_Pt140_280_BFilter.merge.DAOD_TOPQ1.e4772_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363397.Sherpa_NNPDF30NNLO_Zee_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363398.Sherpa_NNPDF30NNLO_Zee_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363399.Sherpa_NNPDF30NNLO_Zee_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4772_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363400.Sherpa_NNPDF30NNLO_Zee_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363401.Sherpa_NNPDF30NNLO_Zee_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363402.Sherpa_NNPDF30NNLO_Zee_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363403.Sherpa_NNPDF30NNLO_Zee_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363404.Sherpa_NNPDF30NNLO_Zee_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363405.Sherpa_NNPDF30NNLO_Zee_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363406.Sherpa_NNPDF30NNLO_Zee_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363407.Sherpa_NNPDF30NNLO_Zee_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363408.Sherpa_NNPDF30NNLO_Zee_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4772_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363409.Sherpa_NNPDF30NNLO_Zee_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363410.Sherpa_NNPDF30NNLO_Zee_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4716_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363411.Sherpa_NNPDF30NNLO_Zee_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4772_s2726_r7725_r7676_p2669",
-    
-    ]
-
-TopExamples.grid.Add("TOPQ1_Wjets_Sherpa22").datasets = [
-    "mc15_13TeV.363331.Sherpa_NNPDF30NNLO_Wtaunu_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363332.Sherpa_NNPDF30NNLO_Wtaunu_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363333.Sherpa_NNPDF30NNLO_Wtaunu_Pt0_70_BFilter.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363334.Sherpa_NNPDF30NNLO_Wtaunu_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363335.Sherpa_NNPDF30NNLO_Wtaunu_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363336.Sherpa_NNPDF30NNLO_Wtaunu_Pt70_140_BFilter.merge.DAOD_TOPQ1.e4779_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363337.Sherpa_NNPDF30NNLO_Wtaunu_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363338.Sherpa_NNPDF30NNLO_Wtaunu_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363339.Sherpa_NNPDF30NNLO_Wtaunu_Pt140_280_BFilter.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363340.Sherpa_NNPDF30NNLO_Wtaunu_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363341.Sherpa_NNPDF30NNLO_Wtaunu_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4779_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363342.Sherpa_NNPDF30NNLO_Wtaunu_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4779_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363343.Sherpa_NNPDF30NNLO_Wtaunu_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363344.Sherpa_NNPDF30NNLO_Wtaunu_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363345.Sherpa_NNPDF30NNLO_Wtaunu_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4779_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363346.Sherpa_NNPDF30NNLO_Wtaunu_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363347.Sherpa_NNPDF30NNLO_Wtaunu_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363348.Sherpa_NNPDF30NNLO_Wtaunu_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4779_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363349.Sherpa_NNPDF30NNLO_Wtaunu_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363350.Sherpa_NNPDF30NNLO_Wtaunu_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363351.Sherpa_NNPDF30NNLO_Wtaunu_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4779_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363352.Sherpa_NNPDF30NNLO_Wtaunu_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363353.Sherpa_NNPDF30NNLO_Wtaunu_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363354.Sherpa_NNPDF30NNLO_Wtaunu_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4709_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363436.Sherpa_NNPDF30NNLO_Wmunu_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363437.Sherpa_NNPDF30NNLO_Wmunu_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363438.Sherpa_NNPDF30NNLO_Wmunu_Pt0_70_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363439.Sherpa_NNPDF30NNLO_Wmunu_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363440.Sherpa_NNPDF30NNLO_Wmunu_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363441.Sherpa_NNPDF30NNLO_Wmunu_Pt70_140_BFilter.merge.DAOD_TOPQ1.e4771_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363442.Sherpa_NNPDF30NNLO_Wmunu_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363443.Sherpa_NNPDF30NNLO_Wmunu_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363444.Sherpa_NNPDF30NNLO_Wmunu_Pt140_280_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363445.Sherpa_NNPDF30NNLO_Wmunu_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363446.Sherpa_NNPDF30NNLO_Wmunu_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363447.Sherpa_NNPDF30NNLO_Wmunu_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363448.Sherpa_NNPDF30NNLO_Wmunu_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363449.Sherpa_NNPDF30NNLO_Wmunu_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363450.Sherpa_NNPDF30NNLO_Wmunu_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363451.Sherpa_NNPDF30NNLO_Wmunu_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363452.Sherpa_NNPDF30NNLO_Wmunu_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363453.Sherpa_NNPDF30NNLO_Wmunu_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363454.Sherpa_NNPDF30NNLO_Wmunu_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363455.Sherpa_NNPDF30NNLO_Wmunu_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363456.Sherpa_NNPDF30NNLO_Wmunu_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363457.Sherpa_NNPDF30NNLO_Wmunu_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363458.Sherpa_NNPDF30NNLO_Wmunu_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363459.Sherpa_NNPDF30NNLO_Wmunu_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363460.Sherpa_NNPDF30NNLO_Wenu_Pt0_70_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363461.Sherpa_NNPDF30NNLO_Wenu_Pt0_70_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363462.Sherpa_NNPDF30NNLO_Wenu_Pt0_70_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363463.Sherpa_NNPDF30NNLO_Wenu_Pt70_140_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363464.Sherpa_NNPDF30NNLO_Wenu_Pt70_140_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363465.Sherpa_NNPDF30NNLO_Wenu_Pt70_140_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363466.Sherpa_NNPDF30NNLO_Wenu_Pt140_280_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363467.Sherpa_NNPDF30NNLO_Wenu_Pt140_280_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363468.Sherpa_NNPDF30NNLO_Wenu_Pt140_280_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363469.Sherpa_NNPDF30NNLO_Wenu_Pt280_500_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363470.Sherpa_NNPDF30NNLO_Wenu_Pt280_500_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363471.Sherpa_NNPDF30NNLO_Wenu_Pt280_500_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363472.Sherpa_NNPDF30NNLO_Wenu_Pt500_700_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363473.Sherpa_NNPDF30NNLO_Wenu_Pt500_700_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363474.Sherpa_NNPDF30NNLO_Wenu_Pt500_700_BFilter.merge.DAOD_TOPQ1.e4771_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363475.Sherpa_NNPDF30NNLO_Wenu_Pt700_1000_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363476.Sherpa_NNPDF30NNLO_Wenu_Pt700_1000_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363477.Sherpa_NNPDF30NNLO_Wenu_Pt700_1000_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363478.Sherpa_NNPDF30NNLO_Wenu_Pt1000_2000_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363479.Sherpa_NNPDF30NNLO_Wenu_Pt1000_2000_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363480.Sherpa_NNPDF30NNLO_Wenu_Pt1000_2000_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363481.Sherpa_NNPDF30NNLO_Wenu_Pt2000_E_CMS_CVetoBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-    "mc15_13TeV.363482.Sherpa_NNPDF30NNLO_Wenu_Pt2000_E_CMS_CFilterBVeto.merge.DAOD_TOPQ1.e4715_s2726_r7772_r7676_p2669",
-    "mc15_13TeV.363483.Sherpa_NNPDF30NNLO_Wenu_Pt2000_E_CMS_BFilter.merge.DAOD_TOPQ1.e4715_s2726_r7725_r7676_p2669",
-]    
-
-TopExamples.grid.Add("TOPQ1_Zjets_Sherpa221").datasets = [
-    "mc15_13TeV.364114.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV0_70_CVetoBVeto.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364115.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV0_70_CFilterBVeto.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364116.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV0_70_BFilter.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364117.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV70_140_CVetoBVeto.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364118.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV70_140_CFilterBVeto.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364119.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV70_140_BFilter.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364120.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV140_280_CVetoBVeto.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364121.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV140_280_CFilterBVeto.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364122.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV140_280_BFilter.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364123.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV280_500_CVetoBVeto.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364124.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV280_500_CFilterBVeto.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364125.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV280_500_BFilter.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364126.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV500_1000.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364127.Sherpa_221_NNPDF30NNLO_Zee_MAXHTPTV1000_E_CMS.merge.DAOD_TOPQ1.e5299_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364100.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV0_70_CVetoBVeto.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364101.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV0_70_CFilterBVeto.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364102.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV0_70_BFilter.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364103.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV70_140_CVetoBVeto.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364104.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV70_140_CFilterBVeto.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364105.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV70_140_BFilter.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364106.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV140_280_CVetoBVeto.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364107.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV140_280_CFilterBVeto.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364108.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV140_280_BFilter.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364109.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV280_500_CVetoBVeto.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364110.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV280_500_CFilterBVeto.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364111.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV280_500_BFilter.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364112.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV500_1000.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364113.Sherpa_221_NNPDF30NNLO_Zmumu_MAXHTPTV1000_E_CMS.merge.DAOD_TOPQ1.e5271_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364128.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV0_70_CVetoBVeto.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364129.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV0_70_CFilterBVeto.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364130.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV0_70_BFilter.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364131.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV70_140_CVetoBVeto.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364132.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV70_140_CFilterBVeto.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364133.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV70_140_BFilter.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364134.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV140_280_CVetoBVeto.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364135.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV140_280_CFilterBVeto.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364136.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV140_280_BFilter.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364137.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV280_500_CVetoBVeto.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364138.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV280_500_CFilterBVeto.merge.DAOD_TOPQ1.e5313_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364139.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV280_500_BFilter.merge.DAOD_TOPQ1.e5313_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364140.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV500_1000.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    "mc15_13TeV.364141.Sherpa_221_NNPDF30NNLO_Ztautau_MAXHTPTV1000_E_CMS.merge.DAOD_TOPQ1.e5307_s2726_r7772_r7676_p2722",
-    ]
-
-TopExamples.grid.Add("TOPQ1_Wjets_Sherpa221").datasets = [
-    "mc15_13TeV.364170.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV0_70_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364171.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV0_70_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364172.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV0_70_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364173.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV70_140_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364174.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV70_140_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364175.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV70_140_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364176.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV140_280_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364177.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV140_280_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364178.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV140_280_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364179.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV280_500_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364180.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV280_500_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364181.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV280_500_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364182.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV500_1000.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364183.Sherpa_221_NNPDF30NNLO_Wenu_MAXHTPTV1000_E_CMS.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364156.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV0_70_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364157.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV0_70_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364158.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV0_70_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364159.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV70_140_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364160.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV70_140_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364161.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV70_140_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364162.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV140_280_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364163.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV140_280_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364164.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV140_280_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364165.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV280_500_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364166.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV280_500_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364167.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV280_500_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364168.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV500_1000.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364169.Sherpa_221_NNPDF30NNLO_Wmunu_MAXHTPTV1000_E_CMS.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364184.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV0_70_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364185.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV0_70_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364186.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV0_70_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364187.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV70_140_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364188.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV70_140_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364189.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV70_140_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364190.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV140_280_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364191.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV140_280_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364192.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV140_280_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364193.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV280_500_CVetoBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364194.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV280_500_CFilterBVeto.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364195.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV280_500_BFilter.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364196.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV500_1000.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    "mc15_13TeV.364197.Sherpa_221_NNPDF30NNLO_Wtaunu_MAXHTPTV1000_E_CMS.merge.DAOD_TOPQ1.e5340_s2726_r7772_r7676_p2842",
-    ]
-
-
-
-TopExamples.grid.Add("TOPQ1_ttbar_allhad").datasets = [
-        "mc15_13TeV.410007.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_allhad.merge.DAOD_TOPQ1.e4135_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410008.aMcAtNloHerwigppEvtGen_ttbar_allhad.merge.DAOD_TOPQ1.e3964_s2726_r7772_r7676_p2669",
-        "mc15_13TeV.410160.aMcAtNloPythia8EvtGen_A14_NNPDF23_NNPDF30ME_ttbar_allhad.merge.DAOD_TOPQ1.e4683_s2726_r7725_r7676_p2669",
-        "mc15_13TeV.410161.PowhegPythiaEvtGen_P2012radHi_ttbar_hdamp345_down_allhad.merge.DAOD_TOPQ1.e4837_s2726_r7772_r7676_p2669",
-        "mc15_13TeV.410162.PowhegPythiaEvtGen_P2012radLo_ttbar_hdamp172p5_up_allhad.merge.DAOD_TOPQ1.e4837_s2726_r7772_r7676_p2669",
-        "mc15_13TeV.410163.PowhegHerwigppEvtGen_UEEE5_ttbar_hdamp172p5_allhad.merge.DAOD_TOPQ1.e4836_s2726_r7772_r7676_p2669",
-        ]
-
-TopExamples.grid.Add("TOPQ1_ttbar_dil").datasets = [
-        "mc15_13TeV.410009.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_dil.merge.DAOD_TOPQ1.e4511_s2608_s2183_r7725_r7676_p2669",
-        ]
-
-TopExamples.grid.Add("TOPQ1_singleTop_PowPy6").datasets = [
-        "mc15_13TeV.410011.PowhegPythiaEvtGen_P2012_singletop_tchan_lept_top.merge.DAOD_TOPQ1.e3824_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410012.PowhegPythiaEvtGen_P2012_singletop_tchan_lept_antitop.merge.DAOD_TOPQ1.e3824_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410013.PowhegPythiaEvtGen_P2012_Wt_inclusive_top.merge.DAOD_TOPQ1.e3753_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410014.PowhegPythiaEvtGen_P2012_Wt_inclusive_antitop.merge.DAOD_TOPQ1.e3753_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410025.PowhegPythiaEvtGen_P2012_SingleTopSchan_noAllHad_top.merge.DAOD_TOPQ1.e3998_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410026.PowhegPythiaEvtGen_P2012_SingleTopSchan_noAllHad_antitop.merge.DAOD_TOPQ1.e3998_s2608_s2183_r7725_r7676_p2669",
-        ]
-
-TopExamples.grid.Add("TOPQ1_tchan_ScaleVar").datasets = [
-        "mc15_13TeV.410017.PowhegPythiaEvtGen_P2012radLo_singletop_tchan_lept_top.merge.DAOD_TOPQ1.e3978_a766_a818_r7676_p2669",
-        "mc15_13TeV.410018.PowhegPythiaEvtGen_P2012radHi_singletop_tchan_lept_top.merge.DAOD_TOPQ1.e3978_a766_a818_r7676_p2669",
-        "mc15_13TeV.410019.PowhegPythiaEvtGen_P2012radLo_singletop_tchan_lept_antitop.merge.DAOD_TOPQ1.e3978_a766_a818_r7676_p2669",
-        "mc15_13TeV.410020.PowhegPythiaEvtGen_P2012radHi_singletop_tchan_lept_antitop.merge.DAOD_TOPQ1.e3978_a766_a818_r7676_p2669",
-        "mc15_13TeV.410047.PowhegHerwigppEvtGen_UEEE5_singletop_tchan_lept_top.merge.DAOD_TOPQ1.e4775_a766_a818_r7676_p2669",
-        "mc15_13TeV.410048.PowhegHerwigppEvtGen_UEEE5_singletop_tchan_lept_antitop.merge.DAOD_TOPQ1.e4775_a766_a818_r7676_p2669",
-        ]
-
-TopExamples.grid.Add("TOPQ1_ttbar_Sherpa").datasets = [
-        "mc15_13TeV.410021.Sherpa_CT10_ttbar_DiLepton_MEPS_NLO.merge.DAOD_TOPQ1.e3957_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410022.Sherpa_CT10_ttbar_SingleLeptonP_MEPS_NLO.merge.DAOD_TOPQ1.e3957_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410023.Sherpa_CT10_ttbar_SingleLeptonM_MEPS_NLO.merge.DAOD_TOPQ1.e3957_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410024.Sherpa_CT10_ttbar_AllHadron_MEPS_NLO.merge.DAOD_TOPQ1.e3957_s2608_s2183_r7725_r7676_p2669",
-]
-
-TopExamples.grid.Add("TOPQ1_ttbar_MassVar").datasets = [
-        "mc15_13TeV.410037.PowhegPythiaEvtGen_P2012_ttbar_hdamp170_nonallhad.merge.DAOD_TOPQ1.e4529_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410038.PowhegPythiaEvtGen_P2012_ttbar_hdamp171p5_nonallhad.merge.DAOD_TOPQ1.e4529_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410039.PowhegPythiaEvtGen_P2012_ttbar_hdamp173p5_nonallhad.merge.DAOD_TOPQ1.e4529_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410040.PowhegPythiaEvtGen_P2012_ttbar_hdamp175_nonallhad.merge.DAOD_TOPQ1.e4529_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410041.PowhegPythiaEvtGen_P2012_ttbar_hdamp177p5_nonallhad.merge.DAOD_TOPQ1.e4529_s2608_s2183_r7725_r7676_p2669",
-        ]
-
-TopExamples.grid.Add("TOPQ1_ttbar_MassVar_allhad").datasets = [
-        "mc15_13TeV.410042.PowhegPythiaEvtGen_P2012_ttbar_hdamp170_allhad.merge.DAOD_TOPQ1.e4510_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410043.PowhegPythiaEvtGen_P2012_ttbar_hdamp171p5_allhad.merge.DAOD_TOPQ1.e4510_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410044.PowhegPythiaEvtGen_P2012_ttbar_hdamp173p5_allhad.merge.DAOD_TOPQ1.e4510_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410045.PowhegPythiaEvtGen_P2012_ttbar_hdamp175_allhad.merge.DAOD_TOPQ1.e4510_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410046.PowhegPythiaEvtGen_P2012_ttbar_hdamp177p5_allhad.merge.DAOD_TOPQ1.e4510_s2608_s2183_r7725_r7676_p2669",
-        ]
-        
-    
-TopExamples.grid.Add("TOPQ1_ttV").datasets = [
-        "mc15_13TeV.410050.MadGraphPythiaEvtGen_P2012_tZ_4fl_tchan_noAllHad.merge.DAOD_TOPQ1.e4279_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410080.MadGraphPythia8EvtGen_A14NNPDF23_4topSM.merge.DAOD_TOPQ1.e4111_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410081.MadGraphPythia8EvtGen_A14NNPDF23_ttbarWW.merge.DAOD_TOPQ1.e4111_s2608_s2183_r7725_r7676_p2669",
-        "mc15_13TeV.410155.aMcAtNloPythia8EvtGen_MEN30NLO_A14N23LO_ttW.merge.DAOD_TOPQ1.e5070_s2726_r7772_r7676_p2669",
-        "mc15_13TeV.410156.aMcAtNloPythia8EvtGen_MEN30NLO_A14N23LO_ttZnunu.merge.DAOD_TOPQ1.e5070_s2726_r7772_r7676_p2669",
-        "mc15_13TeV.410157.aMcAtNloPythia8EvtGen_MEN30NLO_A14N23LO_ttZqq.merge.DAOD_TOPQ1.e5070_s2726_r7772_r7676_p2669",
-        "mc15_13TeV.410218.aMcAtNloPythia8EvtGen_MEN30NLO_A14N23LO_ttee.merge.DAOD_TOPQ1.e5070_s2726_r7772_r7676_p2669",
-        "mc15_13TeV.410219.aMcAtNloPythia8EvtGen_MEN30NLO_A14N23LO_ttmumu.merge.DAOD_TOPQ1.e5070_s2726_r7772_r7676_p2669",
-        "mc15_13TeV.410220.aMcAtNloPythia8EvtGen_MEN30NLO_A14N23LO_tttautau.merge.DAOD_TOPQ1.e5070_s2726_r7772_r7676_p2669",
-        "mc15_13TeV.410215.aMcAtNloPythia8EvtGen_A14_NNPDF23LO_260000_tWZDR.merge.DAOD_TOPQ1.e4851_s2726_r7725_r7676_p2669",
-        "mc15_13TeV.410217.aMcAtNloHerwigppEvtGen_UEEE5_CTEQ6L1_CT10ME_260000_tWZDR.merge.DAOD_TOPQ1.e4851_s2726_r7725_r7676_p2669",
-]
-
-TopExamples.grid.Add("TOPQ1_Wt_schan_ScaleVar").datasets = [
-        "mc15_13TeV.410099.PowhegPythiaEvtGen_P2012radHi_Wt_inclusive_top.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        "mc15_13TeV.410100.PowhegPythiaEvtGen_P2012radLo_Wt_inclusive_top.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        "mc15_13TeV.410101.PowhegPythiaEvtGen_P2012radHi_Wt_inclusive_antitop.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        "mc15_13TeV.410102.PowhegPythiaEvtGen_P2012radLo_Wt_inclusive_antitop.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        "mc15_13TeV.410103.PowhegPythiaEvtGen_P2012radHi_Wt_dilepton_top.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        "mc15_13TeV.410104.PowhegPythiaEvtGen_P2012radLo_Wt_dilepton_top.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        "mc15_13TeV.410105.PowhegPythiaEvtGen_P2012radHi_Wt_dilepton_antitop.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        "mc15_13TeV.410106.PowhegPythiaEvtGen_P2012radLo_Wt_dilepton_antitop.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        "mc15_13TeV.410107.PowhegPythiaEvtGen_P2012radHi_SingleTopSchan_lept_top.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        "mc15_13TeV.410108.PowhegPythiaEvtGen_P2012radLo_SingleTopSchan_lept_top.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        "mc15_13TeV.410109.PowhegPythiaEvtGen_P2012radHi_SingleTopSchan_lept_antitop.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        "mc15_13TeV.410110.PowhegPythiaEvtGen_P2012radLo_SingleTopSchan_lept_antitop.merge.DAOD_TOPQ1.e4403_a766_a818_r7676_p2669",
-        ]
-
-TopExamples.grid.Add("TOPQ1_").datasets = [
-        "mc15_13TeV.410111.MadGraphPythia8EvtGen_A14NNPDF23LO_ttee_Np0.merge.DAOD_TOPQ1.e4632_s2726_r7725_r7676_p2669",
-        "mc15_13TeV.410112.MadGraphPythia8EvtGen_A14NNPDF23LO_ttee_Np1.merge.DAOD_TOPQ1.e4632_s2726_r7725_r7676_p2669",
-        "mc15_13TeV.410113.MadGraphPythia8EvtGen_A14NNPDF23LO_ttmumu_Np0.merge.DAOD_TOPQ1.e4632_s2726_r7725_r7676_p2669",
-        "mc15_13TeV.410114.MadGraphPythia8EvtGen_A14NNPDF23LO_ttmumu_Np1.merge.DAOD_TOPQ1.e4632_s2726_r7725_r7676_p2669",
-        "mc15_13TeV.410115.MadGraphPythia8EvtGen_A14NNPDF23LO_tttautau_Np0.merge.DAOD_TOPQ1.e4632_s2726_r7725_r7676_p2669",
-        "mc15_13TeV.410116.MadGraphPythia8EvtGen_A14NNPDF23LO_tttautau_Np1.merge.DAOD_TOPQ1.e4632_s2726_r7725_r7676_p2669",
-]
-
-TopExamples.grid.Add("TOPQ1_ttbb_PowhegPy6").datasets = [
-        "mc15_13TeV.410120.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad_bfilter.merge.DAOD_TOPQ1.e4373_s2608_r7725_r7676_p2669",
-        "mc15_13TeV.410121.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_dil_bfilter.merge.DAOD_TOPQ1.e4426_s2726_r7725_r7676_p2669",
-]
-
-TopExamples.grid.Add("TOPQ1_ttbar_Sherpa22").datasets = [
-        "mc15_13TeV.410186.Sherpa_NNPDF30NNLO_ttbar_AllHadronic_MEPS_NLO.merge.DAOD_TOPQ1.e4714_s2726_r7725_r7676_p2669",
-        "mc15_13TeV.410187.Sherpa_NNPDF30NNLO_ttbar_SingleLeptonP_MEPS_NLO.merge.DAOD_TOPQ1.e4714_s2726_r7725_r7676_p2669",
-        "mc15_13TeV.410188.Sherpa_NNPDF30NNLO_ttbar_SingleLeptonM_MEPS_NLO.merge.DAOD_TOPQ1.e4714_s2726_r7725_r7676_p2669",
-        "mc15_13TeV.410189.Sherpa_NNPDF30NNLO_ttbar_dilepton_MEPS_NLO.merge.DAOD_TOPQ1.e4714_s2726_r7725_r7676_p2669",
-]
-
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/getExamples b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/getExamples
index 875d6375cc7ed96cd9c34ec123f039238e76be2e..2093acd31662f01b9af46ebc63caacb8333936b3 100755
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/getExamples
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/scripts/getExamples
@@ -8,32 +8,28 @@ output = os.getcwd() + '/grid'
 if len(sys.argv) == 2:
     output = sys.argv[1]
 elif len(sys.argv) > 2:
-    print 'I dont understand you'
-    print 'Use me like'
-    print sys.argv[0]
-    print 'or'
-    print sys.argv[0], '<directory>'
+    print('I dont understand you')
+    print('Use me like')
+    print(sys.argv[0])
+    print('or')
+    print(sys.argv[0], '<directory>')
     sys.exit()
 
 # We cannot use a wildcard anymore as everything is stored in /bin/
 list_of_scripts = ["01SubmitToGrid.py", 
                    "02DownloadFromGrid.py",           
-                   "03LocalAnalysis.py",
                    "04Plot.py",          
                    "10AmiYield.py",
-                   "11CrossSection.py", 
                    "DerivationTags.py",
                    "Data_rel21.py",                 
                    "MC16_TOPQ1.py"
                    ]
 
-print 'Using PathResolver to copy scripts to', output
-if not os.path.exists(output):
-    os.makedirs(output)
+print('Using PathResolver to copy scripts to', output)
+os.makedirs(output, exist_ok=True)
 
 for script in list_of_scripts:
     full_path = ROOT.PathResolver.find_file(script, "PATH")
-    print "Copying",full_path
-    cmd = "cp %s %s"%(full_path, output)
+    print("Copying", full_path)
+    cmd = "cp {0} {1}".format(full_path, output)
     os.system(cmd)
-                                            
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/util/mini-to-flat.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/util/mini-to-flat.cxx
deleted file mode 100644
index 85db11d171cca010b115c5aeac3426d956c94fea..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/util/mini-to-flat.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <iostream>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "TFile.h"
-#include "TTree.h"
-#include "TTreeFormula.h"
-
-#include "xAODRootAccess/TEvent.h"
-#include "xAODRootAccess/TStore.h"
-#include "xAODRootAccess/TActiveStore.h"
-
-// bits for I/O performance monitoring
-#include "xAODCore/tools/ReadStats.h"
-#include "xAODCore/tools/PerfStats.h"
-#include "xAODCore/tools/IOStats.h"
-
-#include "TopAnalysis/Tools.h"
-#include "TopEvent/EventTools.h"
-#include "TopConfiguration/ConfigurationSettings.h"
-
-#include "TopExamples/MakeTopConfig.h"
-#include "TopExamples/MiniToFlatAnalysis.h"
-
-int main(int argc, char** argv) {
-  if (argc != 3) {
-    std::cout << "Please provide a file containing input files!!!" << std::endl;
-  }
-
-  // magic xAOD stuff
-  // true = fail at even the slightest xaod issue
-  top::xAODInit(true);
-  StatusCode::enableFailure();
-
-  std::cout << "Configuration Files:\n";
-  std::string settingsFilename = std::string(argv[1]);
-  std::cout << "    " << settingsFilename << "\n";
-  std::cout << "    " << std::string(argv[2]) << "\n\n";
-
-  // load the settings from the input file
-  auto* const settings = top::ConfigurationSettings::get();
-  settings->loadFromFile(settingsFilename);
-  // std::cout << "Configuration:\n";
-  // std::cout << *settings << "\n";
-
-  // open the files (to check they exist) and count how many events we have
-  std::vector<std::string> filenames = top::fileList(std::string(argv[2]));
-  if (filenames.size() == 0) {
-    std::cout << "Please supply an input file in the filelist" << std::endl;
-    exit(1);
-  }
-
-  // Create a TEvent object:
-  xAOD::TEvent xaodevent(xAOD::TEvent::kBranchAccess);
-  // Create a transient object store. Needed for the tools.
-  xAOD::TStore store;
-
-  // Make a Top::TopConfig from the input file metadata
-  top::MakeTopConfig mkConfig("top::MakeTopConfig");
-  std::unique_ptr<TFile> firstInputFile(TFile::Open(filenames[0].c_str()));
-  top::check(xaodevent.readFrom(firstInputFile.get()),
-             "xAOD::TEvent readFrom failed");
-  std::shared_ptr<top::TopConfig> topConfig = mkConfig.makeTopConfig();
-  topConfig->setConfigSettings(settings);
-  // Analysis
-  top::MiniToFlatAnalysis analysis("top::MiniToFlatAnalysis");
-  top::check(analysis.setProperty("config", topConfig),
-             "Failed to set property");
-  top::check(analysis.initialize() , "Failed to initialize");
-
-  xAOD::PerfStats::instance().start();
-
-  // Loop over files, and events in files
-  for (const auto& filename : filenames) {
-    std::cout << "Opening " << filename << std::endl;
-    std::unique_ptr<TFile> inputFile(TFile::Open(filename.c_str()));
-    top::check(xaodevent.readFrom(inputFile.get()),
-               "xAOD::TEvent readFrom failed");
-    Long64_t entries = xaodevent.getEntries();
-    for (Long64_t entry=0; entry < entries; ++entry) {
-      // clear the TStore - get rid of the last events objects
-      xAOD::TActiveStore::store()->clear();
-      // increment the event
-      xaodevent.getEntry(entry);
-      top::check(analysis.execute() , "Failed to execute event");
-    }
-  }
-
-  top::check(analysis.finalize() , "Failed to finalize");
-
-  xAOD::PerfStats::instance().stop();
-  // xAOD::IOStats::instance().stats().Print("Summary");
-  // xAOD::IOStats::instance().stats().Print();
-
-  return 0;
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/util/mini-to-plots.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/util/mini-to-plots.cxx
deleted file mode 100644
index 2194e47a316097ac4c6b31f76e8b0a12be692790..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/util/mini-to-plots.cxx
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <iostream>
-#include <memory>
-#include <cstdlib>
-#include <sstream>
-
-#include "TFile.h"
-
-#include "xAODRootAccess/TEvent.h"
-
-#include "TopEvent/Event.h"
-#include "TopEvent/EventTools.h"
-
-#include "TopAnalysis/Tools.h"
-
-#include "TopExamples/EventLoaderDirect.h"
-#include "TopExamples/AnalysisTools.h"
-
-/**
- * @file mini-to-plots.cxx
- *
- * @brief Executable for the 'local' part of the analysis.
- *
- */
-
-/**
- * @brief The main executable
- *
- * Does the xAOD stuff, then makes an output file (root) based on the name of
- * the input file directory (hopefully useful for grid running).  Then goes on
- * to loop over all the files in that directory and make some plots / do some
- * analysis.
- *
- * The output plots are normalised to 1fb-1.
- */
-int main(int argc, char** argv) {
-    if (argc != 3) {
-        std::cout << "Use like:\n";
-        std::cout << argv[0] << " Dilepton /path/with/user.simon.117050.e1727_s1933_s1911_r5591.MC_31_07_1/input.txt\n";
-        std::cout << "\n";
-        std::cout << "note that the directory has user.simon.117050.GRIDTAG.stuff/input.txt\n";
-        std::cout << "i.e. something.something.something.GRIDTAG.something\n";
-        exit(1);
-    }
-
-    //magic xAOD stuff
-    top::xAODInit();
-
-    //attempt to extract the tag from the directory that the input files lives in
-    std::vector<std::string> filenames = top::fileList(argv[2]);
-
-    //attempt to extract the tag from the directory name
-    const std::string gridTag = top::gridTagFromDirectoryName(argv[2]);
-
-    //get the sample number (run or mc-sample number depending on data / MC sim)
-    //todo should this be in a function instead?
-    //padded to 8 char for data, not padded for MC to match dataset naming convention
-    std::string sampleNumberString;
-    size_t firstIdx = 0;
-    while (firstIdx < filenames.size()) {
-        try {
-            sampleNumberString = top::getSampleNumberAsString(filenames[firstIdx], "EventInfo");
-            break;
-        } catch(std::string &e) { // can fail if no events passed selection in a specific job
-            std::cout << "Error getting MC sample number: " << e.c_str() << std::endl;
-            ++firstIdx;
-        }
-    }
-    if (firstIdx >= filenames.size()) {
-        std::cout << "No events passed in any of the jobs. No entries available. Abort!" << std::endl;
-        exit(1);
-    }
-
-    //generate the output filename
-    //pad the run number to 8 digits
-    std::stringstream s;
-    s << sampleNumberString << "." << gridTag << ".root";
-    std::cout << "Writing plots to: " << s.str() << "\n";
-
-    //output file
-    std::unique_ptr<TFile> plotsFile(TFile::Open(s.str().c_str(), "RECREATE"));
-
-    //user analysis code to make histograms
-    std::unique_ptr<top::AnalysisBase> analy(top::loadAnalysis(argv[1], plotsFile.get()));
-    const unsigned int totalYield = top::checkFiles(filenames);
-
-    //event loop
-    xAOD::TEvent xaodEvent(xAOD::TEvent::kBranchAccess); //don't use kClassAccess on non-primary xAOD, obviously.
-
-    top::EventLoaderDirect loader(analy->containerNames());
-
-    //loop over input files
-    unsigned int totalYieldSoFar = 0;
-    unsigned int fileCounter = 0;
-    for (const auto& filename : filenames) {
-        std::cout << "Opening " << fileCounter << " of " << filenames.size() << ": " << filename << std::endl;
-        std::unique_ptr<TFile> inputFile(TFile::Open(filename.c_str()));
-        top::check(xaodEvent.readFrom(inputFile.get()), "xAOD::TEvent readFrom failed");
-
-        //update any cutflow / meta stuff we might need to get per-file
-        analy->newFile(inputFile.get());
-
-        //loop over events in the file
-        const unsigned int entries = xaodEvent.getEntries();
-        for (unsigned int entry = 0; entry < entries; ++entry, ++totalYieldSoFar) {
-            if (entry % 100 == 0)
-                std::cout << "    Processing event " << totalYieldSoFar << " / " << totalYield << " (this file: " << entry << " / " << entries << ")" << std::endl;
-
-            //read the event and do stuff
-            xaodEvent.getEntry(entry);
-            top::Event topEvent = loader.loadEvent(xaodEvent);
-            analy->event(topEvent);
-        }
-
-        ++fileCounter;
-    }
-
-    //save output histograms
-    analy->finalise(plotsFile.get());
-
-
-    return 0;
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/util/mini-xaod.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopExamples/util/mini-xaod.cxx
deleted file mode 100644
index 6360acc87a5f449f1b09e97dd1845a5a1d61a214..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopExamples/util/mini-xaod.cxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <iostream>
-#include <memory>
-
-#include "TFile.h"
-#include "TTree.h"
-#include "TTreeFormula.h"
-
-#include "xAODRootAccess/TEvent.h"
-#include "xAODRootAccess/TStore.h"
-#include "xAODRootAccess/TActiveStore.h"
-
-// bits for I/O performance monitoring
-#include "xAODCore/tools/ReadStats.h"
-#include "xAODCore/tools/PerfStats.h"
-#include "xAODCore/tools/IOStats.h"
-
-#include "TopAnalysis/Tools.h"
-#include "TopEvent/EventTools.h"
-
-#include "TopExamples/MakeTopConfig.h"
-#include "TopExamples/MinixAODAnalysis.h"
-
-int main(int argc, char** argv) {
-  
-  if (argc != 2) {
-    std::cout<<"Please provide a file containing input files!!!"<<std::endl;
-  }
-  
-  //magic xAOD stuff
-  //true = fail at even the slightest xaod issue
-  top::xAODInit(true);
-  StatusCode::enableFailure();  
-  
-  //open the files (to check they exist) and count how many events we have  
-  std::vector<std::string> filenames = top::fileList(std::string(argv[1]));  
-  if (filenames.size() == 0){
-    std::cout<<"Please supply an input file in the filelist"<<std::endl;
-    exit(1);
-  }
-  
-  // Create a TEvent object:
-  xAOD::TEvent xaodevent( xAOD::TEvent::kBranchAccess );
-  // Create a transient object store. Needed for the tools.
-  xAOD::TStore store;
-  
-  // Make a Top::TopConfig from the input file metadata
-  top::MakeTopConfig mkConfig( "top::MakeTopConfig" );
-  std::unique_ptr<TFile> firstInputFile(TFile::Open(filenames[0].c_str())); 
-  top::check(xaodevent.readFrom(firstInputFile.get()), "xAOD::TEvent readFrom failed");   
-  std::shared_ptr<top::TopConfig> topConfig = mkConfig.makeTopConfig();
-  
-  // Analysis
-  top::MinixAODAnalysis analysis( "top::MinixAODAnalysis" );
-  top::check( analysis.setProperty( "config" , topConfig ) , "Failed to set property" );
-  top::check( analysis.initialize() , "Failed to initialize" );
-  
-  xAOD::PerfStats::instance().start(); 
-  
-  // Loop over files, and events in files
-  for (const auto& filename : filenames) {  
-    std::cout << "Opening " << filename << std::endl;
-    std::unique_ptr<TFile> inputFile(TFile::Open(filename.c_str()));    
-    top::check(xaodevent.readFrom(inputFile.get()), "xAOD::TEvent readFrom failed");   
-    Long64_t entries = xaodevent.getEntries();
-    for (Long64_t entry=0; entry<entries;++entry) {
-      // clear the TStore - get rid of the last events objects
-      xAOD::TActiveStore::store()->clear();
-      // increment the event      
-      xaodevent.getEntry( entry );
-      top::check( analysis.execute() , "Failed to execute event" );
-    }   
-  }
-  
-  top::check( analysis.finalize() , "Failed to finalize" );
-  
-  xAOD::PerfStats::instance().stop();
-//   xAOD::IOStats::instance().stats().Print("Summary");
-//   xAOD::IOStats::instance().stats().Print();
-
-  return 0;
-}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/PhotonMC15.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/PhotonMC15.cxx
deleted file mode 100644
index ad4e620d5e7a6a22ca8dc170992be9935df6b75d..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/PhotonMC15.cxx
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TopObjectSelectionTools/PhotonMC15.h"
-
-// Include what you use!
-#include <map>
-#include <string>
-
-#include "TopEvent/EventTools.h"
-
-namespace top {
-
-PhotonMC15::PhotonMC15(double ptcut, double etamax, IsolationBase* isolation) :
-  m_ptcut(ptcut),
-  m_etamax(etamax),
-  m_photon_selection("DFCommonPhotonsIsEMTight"),
-  m_loose_photon_selection("DFCommonPhotonsIsEMLoose"),
-  m_isolation(isolation) {
-}
-
-PhotonMC15::PhotonMC15(double ptcut, double etamax,
-                       const std::string& tightID,
-                       const std::string& looseID,
-                       IsolationBase* isolation) :
-  m_ptcut(ptcut),
-  m_etamax(etamax),
-  m_photon_selection(tightID),
-  m_loose_photon_selection(looseID),
-  m_isolation(isolation) {
-  // Make a map of shortcuts e.g "Tight = DFCommonPhotonsIsEMTight"
-  std::map<std::string, std::string> id_map;
-  id_map["Tight"] = "DFCommonPhotonsIsEMTight";
-  id_map["Loose"] = "DFCommonPhotonsIsEMLoose";
-  id_map["None"] = "None";
-  // If ID in map then set it to full name, else keep as is.
-  if (id_map.find(tightID) != id_map.end())
-    m_photon_selection = id_map[tightID];
-  if (id_map.find(looseID) != id_map.end())
-    m_loose_photon_selection = id_map[looseID];
-}
-
-bool PhotonMC15::passSelection(const xAOD::Photon& ph) const {
-  if (!passSelectionNoIsolation(ph, m_photon_selection))
-    return false;
-
-  if (m_isolation && !m_isolation->passSelection(ph))
-    return false;
-
-  return true;
-}
-
-bool PhotonMC15::passSelectionLoose(const xAOD::Photon& ph) const {
-  if (!passSelectionNoIsolation(ph, m_loose_photon_selection))
-    return false;
-
-  if (m_isolation && !m_isolation->passSelectionLoose(ph))
-    return false;
-
-  return true;
-}
-
-bool PhotonMC15::passSelectionNoIsolation(const xAOD::Photon& ph,
-                                          const std::string& photon_selection) const {
-  // Photon author : AuthorPhoton/AuthorAmbiguous.
-  // Also, for special-case recovery of soft photons:
-  // xAOD::EgammaParameters::AuthorCaloTopo35.
-  if (ph.author() != xAOD::EgammaParameters::AuthorPhoton
-      && ph.author() != xAOD::EgammaParameters::AuthorAmbiguous)
-    return false;
-
-  if (ph.pt() < m_ptcut)
-    return false;
-
-  // removing bad photon cluser [http://cern.ch/go/kp8F]
-  if (!ph.isGoodOQ(xAOD::EgammaParameters::BADCLUSPHOTON))
-    return false;
-
-  //  Photon selection using derivation decorations
-  if (photon_selection != "None")
-    if (!ph.auxdataConst<char>(photon_selection))
-      return false;
-
-  if (!ph.caloCluster()) return false;
-  float abs_eta = std::abs(ph.caloCluster()->etaBE(2));
-  if (abs_eta > m_etamax)
-    return false;
-
-  // Remove crack region
-  if (abs_eta > 1.37 && abs_eta < 1.52)
-    return false;
-
-  // Photon cleaning [http://cern.ch/go/8RdK]
-  // <tom.neep@cern.ch>: This is madness!! I *think* this is the right way
-  // to do this but there should really be a helper function supplied by egamma!
-  if ((ph.OQ() & 134217728) != 0
-      &&
-      (ph.showerShapeValue(xAOD::EgammaParameters::Reta) > 0.98
-       || ph.showerShapeValue(xAOD::EgammaParameters::Rphi) > 1.0
-       || (ph.OQ() & 67108864) != 0))
-    return false;
-
-  return true;
-}
-
-void PhotonMC15::print(std::ostream& os) const {
-  os << "PhotonMC15\n";
-  os << "    * pT > " << m_ptcut << "\n";
-  os << "    * |eta| < " << m_etamax << "\n";
-  os << "    * Photon PID: " << m_photon_selection << "\n";
-  os << "    * Loose Photon PID: " << m_loose_photon_selection << "\n";
-  if (!m_isolation)
-    os << "    * No isolation requirement\n";
-  else
-    m_isolation->print(os);
-}
-}  // namespace top
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/PhotonMC15.h b/PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/PhotonMC15.h
deleted file mode 100644
index 028629c64ea9a13689a785321f6b11257fe87760..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/PhotonMC15.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TOPOBJECTSELECTIONTOOLS_PHOTONMC15_H_
-#define TOPOBJECTSELECTIONTOOLS_PHOTONMC15_H_
-
-#include <memory>
-#include <string>
-
-#include "TopObjectSelectionTools/PhotonSelectionBase.h"
-#include "TopObjectSelectionTools/IsolationTools.h"
-
-#include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h"
-
-namespace top {
-
-/**
- * @brief Photon selection for top analyses.
- */
-
-class PhotonMC15 : public top::PhotonSelectionBase {
- public:
-  /**
-   * @brief Class to help select good photons.
-   *
-   * @param ptcut The minimum pT cut to apply to the photons.
-   * @param etamax The maximum eta cut
-   * @param isolation nullptr for un-isolated, or a new "isolation object" to
-   * apply isolation cuts
-   */
-  PhotonMC15(double ptcut, double etamax, IsolationBase* isolation);
-
-  /**
-   * @brief Class to help select good photons.
-   *
-   * @param ptcut The minimum pT cut to apply to the photons.
-   * @param etamax The maximum eta cut
-   * @param tightID The ID level used to select tight photons.
-   * @param looseID The ID level used to select loose photons.
-   * @param isolation nullptr for un-isolated, or a new "isolation object" to
-   * apply isolation cuts
-   */
-  PhotonMC15(double ptcut, double etamax,
-             const std::string& tightID,
-             const std::string& looseID,
-             IsolationBase* isolation);
-
-  /**
-   * @brief The cuts to select good photons for your analysis should be
-   * implemented in here.
-   *
-   * @param ph The photon to cut on (all photons in the event are passed
-   * to the tool)
-   * @return True if this is a good photon, false otherwise.
-   */
-  bool passSelection(const xAOD::Photon& ph) const override;
-
-  /**
-   * @brief The loose selection.
-   *
-   * @param ph
-   * @return
-   */
-  bool passSelectionLoose(const xAOD::Photon& ph) const override;
-
-  /**
-   * @brief Print some useful information about the photon selection.
-   *
-   * Usually this goes to the log file, so you know what you ran with.
-   *
-   * @param Where the print-out should go, e.g. cout.
-   */
-  void print(std::ostream&) const override;
-
- private:
-  /**
-   * @brief Do all the cuts except for the isolation.
-   *
-   * @param ph The photon in question
-   * @return True if the photon passes
-   */
-  bool passSelectionNoIsolation(const xAOD::Photon& ph,
-                                const std::string& photon_selection) const;
-
-  std::string getConfigFile(int operatingPoint);
-
-  // minimum pT cut to apply
-  double m_ptcut;
-
-  // max eta cut
-  double m_etamax;
-
-  std::string m_photon_selection;
-  std::string m_loose_photon_selection;
-
-  // Proper tool to select photons.
-  // ToolHandle<AsgPhotonIsEMSelector> m_photonTightIsEMSelector;
-  // ToolHandle<AsgPhotonIsEMSelector> m_photonMediumIsEMSelector;
-  // ToolHandle<AsgPhotonIsEMSelector> m_photonLooseIsEMSelector;
-
-  // The isolation tool, or nullptr if we don't want isolation
-  std::unique_ptr<top::IsolationBase> m_isolation;
-};
-
-}  // namespace top
-#endif  // TOPOBJECTSELECTIONTOOLS_PHOTONMC15_H_